obi-sdk 0.18.31 → 0.18.32

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.
@@ -1,9 +1,9 @@
1
- (function(){"use strict";function r_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Lp={exports:{}};(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function i(a,c,u){this.fn=a,this.context=c,this.once=u||!1}function A(a,c,u,l,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,l||a,d),f=t?t+c:c;return a._events[f]?a._events[f].fn?a._events[f]=[a._events[f],h]:a._events[f].push(h):(a._events[f]=h,a._eventsCount++),a}function s(a,c){--a._eventsCount===0?a._events=new r:delete a._events[c]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],u,l;if(this._eventsCount===0)return c;for(l in u=this._events)e.call(u,l)&&c.push(t?l.slice(1):l);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},o.prototype.listeners=function(c){var u=t?t+c:c,l=this._events[u];if(!l)return[];if(l.fn)return[l.fn];for(var d=0,h=l.length,f=new Array(h);d<h;d++)f[d]=l[d].fn;return f},o.prototype.listenerCount=function(c){var u=t?t+c:c,l=this._events[u];return l?l.fn?1:l.length:0},o.prototype.emit=function(c,u,l,d,h,f){var p=t?t+c:c;if(!this._events[p])return!1;var g=this._events[p],v=arguments.length,y,B;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),v){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,l),!0;case 4:return g.fn.call(g.context,u,l,d),!0;case 5:return g.fn.call(g.context,u,l,d,h),!0;case 6:return g.fn.call(g.context,u,l,d,h,f),!0}for(B=1,y=new Array(v-1);B<v;B++)y[B-1]=arguments[B];g.fn.apply(g.context,y)}else{var b=g.length,w;for(B=0;B<b;B++)switch(g[B].once&&this.removeListener(c,g[B].fn,void 0,!0),v){case 1:g[B].fn.call(g[B].context);break;case 2:g[B].fn.call(g[B].context,u);break;case 3:g[B].fn.call(g[B].context,u,l);break;case 4:g[B].fn.call(g[B].context,u,l,d);break;default:if(!y)for(w=1,y=new Array(v-1);w<v;w++)y[w-1]=arguments[w];g[B].fn.apply(g[B].context,y)}}return!0},o.prototype.on=function(c,u,l){return A(this,c,u,l,!1)},o.prototype.once=function(c,u,l){return A(this,c,u,l,!0)},o.prototype.removeListener=function(c,u,l,d){var h=t?t+c:c;if(!this._events[h])return this;if(!u)return s(this,h),this;var f=this._events[h];if(f.fn)f.fn===u&&(!d||f.once)&&(!l||f.context===l)&&s(this,h);else{for(var p=0,g=[],v=f.length;p<v;p++)(f[p].fn!==u||d&&!f[p].once||l&&f[p].context!==l)&&g.push(f[p]);g.length?this._events[h]=g.length===1?g[0]:g:s(this,h)}return this},o.prototype.removeAllListeners=function(c){var u;return c?(u=t?t+c:c,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,n.exports=o})(Lp);var i_=Lp.exports;const Gc=r_(i_);var jc=function(n,e){return jc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},jc(n,e)};function nn(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");jc(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Wc=function(){return Wc=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var A in t)Object.prototype.hasOwnProperty.call(t,A)&&(e[A]=t[A])}return e},Wc.apply(this,arguments)};function Tt(n,e,t,r){function i(A){return A instanceof t?A:new t(function(s){s(A)})}return new(t||(t=Promise))(function(A,s){function o(u){try{c(r.next(u))}catch(l){s(l)}}function a(u){try{c(r.throw(u))}catch(l){s(l)}}function c(u){u.done?A(u.value):i(u.value).then(o,a)}c((r=r.apply(n,e||[])).next())})}function Ct(n,e){var t={label:0,sent:function(){if(A[0]&1)throw A[1];return A[1]},trys:[],ops:[]},r,i,A,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(u){return a([c,u])}}function a(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(t=0)),t;)try{if(r=1,i&&(A=c[0]&2?i.return:c[0]?i.throw||((A=i.return)&&A.call(i),0):i.next)&&!(A=A.call(i,c[1])).done)return A;switch(i=0,A&&(c=[c[0]&2,A.value]),c[0]){case 0:case 1:A=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,i=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(A=t.trys,!(A=A.length>0&&A[A.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!A||c[1]>A[0]&&c[1]<A[3])){t.label=c[1];break}if(c[0]===6&&t.label<A[1]){t.label=A[1],A=c;break}if(A&&t.label<A[2]){t.label=A[2],t.ops.push(c);break}A[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(u){c=[6,u],i=0}finally{r=A=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function xs(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,A;r<i;r++)(A||!(r in e))&&(A||(A=Array.prototype.slice.call(e,0,r)),A[r]=e[r]);return n.concat(A||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;for(var Rn=function(){function n(e,t,r,i){this.left=e,this.top=t,this.width=r,this.height=i}return n.prototype.add=function(e,t,r,i){return new n(this.left+e,this.top+t,this.width+r,this.height+i)},n.fromClientRect=function(e,t){return new n(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)},n.fromDOMRectList=function(e,t){var r=Array.from(t).find(function(i){return i.width!==0});return r?new n(r.left+e.windowBounds.left,r.top+e.windowBounds.top,r.width,r.height):n.EMPTY},n.EMPTY=new n(0,0,0,0),n}(),Qs=function(n,e){return Rn.fromClientRect(n,e.getBoundingClientRect())},A_=function(n){var e=n.body,t=n.documentElement;if(!e||!t)throw new Error("Unable to get document size");var r=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),i=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight));return new Rn(0,0,r,i)},Rs=function(n){for(var e=[],t=0,r=n.length;t<r;){var i=n.charCodeAt(t++);if(i>=55296&&i<=56319&&t<r){var A=n.charCodeAt(t++);(A&64512)===56320?e.push(((i&1023)<<10)+(A&1023)+65536):(e.push(i),t--)}else e.push(i)}return e},tt=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,n);var t=n.length;if(!t)return"";for(var r=[],i=-1,A="";++i<t;){var s=n[i];s<=65535?r.push(s):(s-=65536,r.push((s>>10)+55296,s%1024+56320)),(i+1===t||r.length>16384)&&(A+=String.fromCharCode.apply(String,r),r.length=0)}return A},Dp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s_=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ps=0;Ps<Dp.length;Ps++)s_[Dp.charCodeAt(Ps)]=Ps;for(var Np="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pA=typeof Uint8Array>"u"?[]:new Uint8Array(256),Os=0;Os<Np.length;Os++)pA[Np.charCodeAt(Os)]=Os;for(var o_=function(n){var e=n.length*.75,t=n.length,r,i=0,A,s,o,a;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);var c=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),u=Array.isArray(c)?c:new Uint8Array(c);for(r=0;r<t;r+=4)A=pA[n.charCodeAt(r)],s=pA[n.charCodeAt(r+1)],o=pA[n.charCodeAt(r+2)],a=pA[n.charCodeAt(r+3)],u[i++]=A<<2|s>>4,u[i++]=(s&15)<<4|o>>2,u[i++]=(o&3)<<6|a&63;return c},a_=function(n){for(var e=n.length,t=[],r=0;r<e;r+=2)t.push(n[r+1]<<8|n[r]);return t},c_=function(n){for(var e=n.length,t=[],r=0;r<e;r+=4)t.push(n[r+3]<<24|n[r+2]<<16|n[r+1]<<8|n[r]);return t},Rr=5,qc=6+5,Jc=2,u_=qc-Rr,Hp=65536>>Rr,l_=1<<Rr,zc=l_-1,d_=1024>>Rr,h_=Hp+d_,p_=h_,f_=32,g_=p_+f_,m_=65536>>qc,v_=1<<u_,y_=v_-1,Kp=function(n,e,t){return n.slice?n.slice(e,t):new Uint16Array(Array.prototype.slice.call(n,e,t))},w_=function(n,e,t){return n.slice?n.slice(e,t):new Uint32Array(Array.prototype.slice.call(n,e,t))},b_=function(n,e){var t=o_(n),r=Array.isArray(t)?c_(t):new Uint32Array(t),i=Array.isArray(t)?a_(t):new Uint16Array(t),A=24,s=Kp(i,A/2,r[4]/2),o=r[5]===2?Kp(i,(A+r[4])/2):w_(r,Math.ceil((A+r[4])/4));return new B_(r[0],r[1],r[2],r[3],s,o)},B_=function(){function n(e,t,r,i,A,s){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=i,this.index=A,this.data=s}return n.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>Rr],t=(t<<Jc)+(e&zc),this.data[t];if(e<=65535)return t=this.index[Hp+(e-55296>>Rr)],t=(t<<Jc)+(e&zc),this.data[t];if(e<this.highStart)return t=g_-m_+(e>>qc),t=this.index[t],t+=e>>Rr&y_,t=this.index[t],t=(t<<Jc)+(e&zc),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},n}(),Vp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C_=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ms=0;Ms<Vp.length;Ms++)C_[Vp.charCodeAt(Ms)]=Ms;var __="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",Gp=50,S_=1,jp=2,Wp=3,k_=4,E_=5,qp=7,Jp=8,zp=9,Zn=10,Xc=11,Xp=12,Yc=13,U_=14,fA=15,Zc=16,Ls=17,gA=18,T_=19,Yp=20,$c=21,mA=22,eu=23,di=24,jt=25,vA=26,yA=27,hi=28,I_=29,Pr=30,F_=31,Ds=32,Ns=33,tu=34,nu=35,ru=36,wA=37,iu=38,Hs=39,Ks=40,Au=41,Zp=42,x_=43,Q_=[9001,65288],$p="!",Ae="\xD7",Vs="\xF7",su=b_(__),Pn=[Pr,ru],ou=[S_,jp,Wp,E_],ef=[Zn,Jp],tf=[yA,vA],R_=ou.concat(ef),nf=[iu,Hs,Ks,tu,nu],P_=[fA,Yc],O_=function(n,e){e===void 0&&(e="strict");var t=[],r=[],i=[];return n.forEach(function(A,s){var o=su.get(A);if(o>Gp?(i.push(!0),o-=Gp):i.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(A)!==-1)return r.push(s),t.push(Zc);if(o===k_||o===Xc){if(s===0)return r.push(s),t.push(Pr);var a=t[s-1];return R_.indexOf(a)===-1?(r.push(r[s-1]),t.push(a)):(r.push(s),t.push(Pr))}if(r.push(s),o===F_)return t.push(e==="strict"?$c:wA);if(o===Zp||o===I_)return t.push(Pr);if(o===x_)return A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(wA):t.push(Pr);t.push(o)}),[r,t,i]},au=function(n,e,t,r){var i=r[t];if(Array.isArray(n)?n.indexOf(i)!==-1:n===i)for(var A=t;A<=r.length;){A++;var s=r[A];if(s===e)return!0;if(s!==Zn)break}if(i===Zn)for(var A=t;A>0;){A--;var o=r[A];if(Array.isArray(n)?n.indexOf(o)!==-1:n===o)for(var a=t;a<=r.length;){a++;var s=r[a];if(s===e)return!0;if(s!==Zn)break}if(o!==Zn)break}return!1},rf=function(n,e){for(var t=n;t>=0;){var r=e[t];if(r===Zn)t--;else return r}return 0},M_=function(n,e,t,r,i){if(t[r]===0)return Ae;var A=r-1;if(Array.isArray(i)&&i[A]===!0)return Ae;var s=A-1,o=A+1,a=e[A],c=s>=0?e[s]:0,u=e[o];if(a===jp&&u===Wp)return Ae;if(ou.indexOf(a)!==-1)return $p;if(ou.indexOf(u)!==-1||ef.indexOf(u)!==-1)return Ae;if(rf(A,e)===Jp)return Vs;if(su.get(n[A])===Xc||(a===Ds||a===Ns)&&su.get(n[o])===Xc||a===qp||u===qp||a===zp||[Zn,Yc,fA].indexOf(a)===-1&&u===zp||[Ls,gA,T_,di,hi].indexOf(u)!==-1||rf(A,e)===mA||au(eu,mA,A,e)||au([Ls,gA],$c,A,e)||au(Xp,Xp,A,e))return Ae;if(a===Zn)return Vs;if(a===eu||u===eu)return Ae;if(u===Zc||a===Zc)return Vs;if([Yc,fA,$c].indexOf(u)!==-1||a===U_||c===ru&&P_.indexOf(a)!==-1||a===hi&&u===ru||u===Yp||Pn.indexOf(u)!==-1&&a===jt||Pn.indexOf(a)!==-1&&u===jt||a===yA&&[wA,Ds,Ns].indexOf(u)!==-1||[wA,Ds,Ns].indexOf(a)!==-1&&u===vA||Pn.indexOf(a)!==-1&&tf.indexOf(u)!==-1||tf.indexOf(a)!==-1&&Pn.indexOf(u)!==-1||[yA,vA].indexOf(a)!==-1&&(u===jt||[mA,fA].indexOf(u)!==-1&&e[o+1]===jt)||[mA,fA].indexOf(a)!==-1&&u===jt||a===jt&&[jt,hi,di].indexOf(u)!==-1)return Ae;if([jt,hi,di,Ls,gA].indexOf(u)!==-1)for(var l=A;l>=0;){var d=e[l];if(d===jt)return Ae;if([hi,di].indexOf(d)!==-1)l--;else break}if([yA,vA].indexOf(u)!==-1)for(var l=[Ls,gA].indexOf(a)!==-1?s:A;l>=0;){var d=e[l];if(d===jt)return Ae;if([hi,di].indexOf(d)!==-1)l--;else break}if(iu===a&&[iu,Hs,tu,nu].indexOf(u)!==-1||[Hs,tu].indexOf(a)!==-1&&[Hs,Ks].indexOf(u)!==-1||[Ks,nu].indexOf(a)!==-1&&u===Ks||nf.indexOf(a)!==-1&&[Yp,vA].indexOf(u)!==-1||nf.indexOf(u)!==-1&&a===yA||Pn.indexOf(a)!==-1&&Pn.indexOf(u)!==-1||a===di&&Pn.indexOf(u)!==-1||Pn.concat(jt).indexOf(a)!==-1&&u===mA&&Q_.indexOf(n[o])===-1||Pn.concat(jt).indexOf(u)!==-1&&a===gA)return Ae;if(a===Au&&u===Au){for(var h=t[A],f=1;h>0&&(h--,e[h]===Au);)f++;if(f%2!==0)return Ae}return a===Ds&&u===Ns?Ae:Vs},L_=function(n,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=O_(n,e.lineBreak),r=t[0],i=t[1],A=t[2];(e.wordBreak==="break-all"||e.wordBreak==="break-word")&&(i=i.map(function(o){return[jt,Pr,Zp].indexOf(o)!==-1?wA:o}));var s=e.wordBreak==="keep-all"?A.map(function(o,a){return o&&n[a]>=19968&&n[a]<=40959}):void 0;return[r,i,s]},D_=function(){function n(e,t,r,i){this.codePoints=e,this.required=t===$p,this.start=r,this.end=i}return n.prototype.slice=function(){return tt.apply(void 0,this.codePoints.slice(this.start,this.end))},n}(),N_=function(n,e){var t=Rs(n),r=L_(t,e),i=r[0],A=r[1],s=r[2],o=t.length,a=0,c=0;return{next:function(){if(c>=o)return{done:!0,value:null};for(var u=Ae;c<o&&(u=M_(t,A,i,++c,s))===Ae;);if(u!==Ae||c===o){var l=new D_(t,u,a,c);return a=c,{value:l,done:!1}}return{done:!0,value:null}}}},H_=1,K_=2,bA=4,Af=8,Gs=10,sf=47,BA=92,V_=9,G_=32,js=34,CA=61,j_=35,W_=36,q_=37,Ws=39,qs=40,_A=41,J_=95,Pt=45,z_=33,X_=60,Y_=62,Z_=64,$_=91,eS=93,tS=61,nS=123,Js=63,rS=125,of=124,iS=126,AS=128,af=65533,cu=42,Or=43,sS=44,oS=58,aS=59,SA=46,cS=0,uS=8,lS=11,dS=14,hS=31,pS=127,vn=-1,cf=48,uf=97,lf=101,fS=102,gS=117,mS=122,df=65,hf=69,pf=70,vS=85,yS=90,_t=function(n){return n>=cf&&n<=57},wS=function(n){return n>=55296&&n<=57343},pi=function(n){return _t(n)||n>=df&&n<=pf||n>=uf&&n<=fS},bS=function(n){return n>=uf&&n<=mS},BS=function(n){return n>=df&&n<=yS},CS=function(n){return bS(n)||BS(n)},_S=function(n){return n>=AS},zs=function(n){return n===Gs||n===V_||n===G_},Xs=function(n){return CS(n)||_S(n)||n===J_},ff=function(n){return Xs(n)||_t(n)||n===Pt},SS=function(n){return n>=cS&&n<=uS||n===lS||n>=dS&&n<=hS||n===pS},$n=function(n,e){return n!==BA?!1:e!==Gs},Ys=function(n,e,t){return n===Pt?Xs(e)||$n(e,t):Xs(n)?!0:!!(n===BA&&$n(n,e))},uu=function(n,e,t){return n===Or||n===Pt?_t(e)?!0:e===SA&&_t(t):_t(n===SA?e:n)},kS=function(n){var e=0,t=1;(n[e]===Or||n[e]===Pt)&&(n[e]===Pt&&(t=-1),e++);for(var r=[];_t(n[e]);)r.push(n[e++]);var i=r.length?parseInt(tt.apply(void 0,r),10):0;n[e]===SA&&e++;for(var A=[];_t(n[e]);)A.push(n[e++]);var s=A.length,o=s?parseInt(tt.apply(void 0,A),10):0;(n[e]===hf||n[e]===lf)&&e++;var a=1;(n[e]===Or||n[e]===Pt)&&(n[e]===Pt&&(a=-1),e++);for(var c=[];_t(n[e]);)c.push(n[e++]);var u=c.length?parseInt(tt.apply(void 0,c),10):0;return t*(i+o*Math.pow(10,-s))*Math.pow(10,a*u)},ES={type:2},US={type:3},TS={type:4},IS={type:13},FS={type:8},xS={type:21},QS={type:9},RS={type:10},PS={type:11},OS={type:12},MS={type:14},Zs={type:23},LS={type:1},DS={type:25},NS={type:24},HS={type:26},KS={type:27},VS={type:28},GS={type:29},jS={type:31},lu={type:32},gf=function(){function n(){this._value=[]}return n.prototype.write=function(e){this._value=this._value.concat(Rs(e))},n.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==lu;)e.push(t),t=this.consumeToken();return e},n.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case js:return this.consumeStringToken(js);case j_:var t=this.peekCodePoint(0),r=this.peekCodePoint(1),i=this.peekCodePoint(2);if(ff(t)||$n(r,i)){var A=Ys(t,r,i)?K_:H_,s=this.consumeName();return{type:5,value:s,flags:A}}break;case W_:if(this.peekCodePoint(0)===CA)return this.consumeCodePoint(),IS;break;case Ws:return this.consumeStringToken(Ws);case qs:return ES;case _A:return US;case cu:if(this.peekCodePoint(0)===CA)return this.consumeCodePoint(),MS;break;case Or:if(uu(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case sS:return TS;case Pt:var o=e,a=this.peekCodePoint(0),c=this.peekCodePoint(1);if(uu(o,a,c))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(Ys(o,a,c))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(a===Pt&&c===Y_)return this.consumeCodePoint(),this.consumeCodePoint(),NS;break;case SA:if(uu(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case sf:if(this.peekCodePoint(0)===cu)for(this.consumeCodePoint();;){var u=this.consumeCodePoint();if(u===cu&&(u=this.consumeCodePoint(),u===sf))return this.consumeToken();if(u===vn)return this.consumeToken()}break;case oS:return HS;case aS:return KS;case X_:if(this.peekCodePoint(0)===z_&&this.peekCodePoint(1)===Pt&&this.peekCodePoint(2)===Pt)return this.consumeCodePoint(),this.consumeCodePoint(),DS;break;case Z_:var l=this.peekCodePoint(0),d=this.peekCodePoint(1),h=this.peekCodePoint(2);if(Ys(l,d,h)){var s=this.consumeName();return{type:7,value:s}}break;case $_:return VS;case BA:if($n(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case eS:return GS;case tS:if(this.peekCodePoint(0)===CA)return this.consumeCodePoint(),FS;break;case nS:return PS;case rS:return OS;case gS:case vS:var f=this.peekCodePoint(0),p=this.peekCodePoint(1);return f===Or&&(pi(p)||p===Js)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case of:if(this.peekCodePoint(0)===CA)return this.consumeCodePoint(),QS;if(this.peekCodePoint(0)===of)return this.consumeCodePoint(),xS;break;case iS:if(this.peekCodePoint(0)===CA)return this.consumeCodePoint(),RS;break;case vn:return lu}return zs(e)?(this.consumeWhiteSpace(),jS):_t(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):Xs(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:tt(e)}},n.prototype.consumeCodePoint=function(){var e=this._value.shift();return typeof e>"u"?-1:e},n.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},n.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},n.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();pi(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var r=!1;t===Js&&e.length<6;)e.push(t),t=this.consumeCodePoint(),r=!0;if(r){var i=parseInt(tt.apply(void 0,e.map(function(a){return a===Js?cf:a})),16),A=parseInt(tt.apply(void 0,e.map(function(a){return a===Js?pf:a})),16);return{type:30,start:i,end:A}}var s=parseInt(tt.apply(void 0,e),16);if(this.peekCodePoint(0)===Pt&&pi(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var o=[];pi(t)&&o.length<6;)o.push(t),t=this.consumeCodePoint();var A=parseInt(tt.apply(void 0,o),16);return{type:30,start:s,end:A}}else return{type:30,start:s,end:s}},n.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return e.toLowerCase()==="url"&&this.peekCodePoint(0)===qs?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===qs?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},n.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===vn)return{type:22,value:""};var t=this.peekCodePoint(0);if(t===Ws||t===js){var r=this.consumeStringToken(this.consumeCodePoint());return r.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===vn||this.peekCodePoint(0)===_A)?(this.consumeCodePoint(),{type:22,value:r.value}):(this.consumeBadUrlRemnants(),Zs)}for(;;){var i=this.consumeCodePoint();if(i===vn||i===_A)return{type:22,value:tt.apply(void 0,e)};if(zs(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===vn||this.peekCodePoint(0)===_A?(this.consumeCodePoint(),{type:22,value:tt.apply(void 0,e)}):(this.consumeBadUrlRemnants(),Zs);if(i===js||i===Ws||i===qs||SS(i))return this.consumeBadUrlRemnants(),Zs;if(i===BA)if($n(i,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),Zs;else e.push(i)}},n.prototype.consumeWhiteSpace=function(){for(;zs(this.peekCodePoint(0));)this.consumeCodePoint()},n.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===_A||e===vn)return;$n(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},n.prototype.consumeStringSlice=function(e){for(var t=5e4,r="";e>0;){var i=Math.min(t,e);r+=tt.apply(void 0,this._value.splice(0,i)),e-=i}return this._value.shift(),r},n.prototype.consumeStringToken=function(e){var t="",r=0;do{var i=this._value[r];if(i===vn||i===void 0||i===e)return t+=this.consumeStringSlice(r),{type:0,value:t};if(i===Gs)return this._value.splice(0,r),LS;if(i===BA){var A=this._value[r+1];A!==vn&&A!==void 0&&(A===Gs?(t+=this.consumeStringSlice(r),r=-1,this._value.shift()):$n(i,A)&&(t+=this.consumeStringSlice(r),t+=tt(this.consumeEscapedCodePoint()),r=-1))}r++}while(!0)},n.prototype.consumeNumber=function(){var e=[],t=bA,r=this.peekCodePoint(0);for((r===Or||r===Pt)&&e.push(this.consumeCodePoint());_t(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(r===SA&&_t(i))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=Af;_t(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0),i=this.peekCodePoint(1);var A=this.peekCodePoint(2);if((r===hf||r===lf)&&((i===Or||i===Pt)&&_t(A)||_t(i)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=Af;_t(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[kS(e),t]},n.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],r=e[1],i=this.peekCodePoint(0),A=this.peekCodePoint(1),s=this.peekCodePoint(2);if(Ys(i,A,s)){var o=this.consumeName();return{type:15,number:t,flags:r,unit:o}}return i===q_?(this.consumeCodePoint(),{type:16,number:t,flags:r}):{type:17,number:t,flags:r}},n.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(pi(e)){for(var t=tt(e);pi(this.peekCodePoint(0))&&t.length<6;)t+=tt(this.consumeCodePoint());zs(this.peekCodePoint(0))&&this.consumeCodePoint();var r=parseInt(t,16);return r===0||wS(r)||r>1114111?af:r}return e===vn?af:e},n.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(ff(t))e+=tt(t);else if($n(t,this.peekCodePoint(0)))e+=tt(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),e}},n}(),mf=function(){function n(e){this._tokens=e}return n.create=function(e){var t=new gf;return t.write(e),new n(t.read())},n.parseValue=function(e){return n.create(e).parseComponentValue()},n.parseValues=function(e){return n.create(e).parseComponentValues()},n.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===31;)e=this.consumeToken();if(e.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},n.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(t.type===32)return e;e.push(t),e.push()}},n.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},n.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},r=this.consumeToken();;){if(r.type===32||qS(r,e))return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue()),r=this.consumeToken()}},n.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var r=this.consumeToken();if(r.type===32||r.type===3)return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue())}},n.prototype.consumeToken=function(){var e=this._tokens.shift();return typeof e>"u"?lu:e},n.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},n}(),er=function(n){return n.type===15},ot=function(n){return n.type===17},ce=function(n){return n.type===20},WS=function(n){return n.type===0},du=function(n,e){return ce(n)&&n.value===e},vf=function(n){return n.type!==31},mt=function(n){return n.type!==31&&n.type!==4},yn=function(n){var e=[],t=[];return n.forEach(function(r){if(r.type===4){if(t.length===0)throw new Error("Error parsing function args, zero tokens for arg");e.push(t),t=[];return}r.type!==31&&t.push(r)}),t.length&&e.push(t),e},qS=function(n,e){return e===11&&n.type===12||e===28&&n.type===29?!0:e===2&&n.type===3},tr=function(n){return n.type===17||n.type===15},Pe=function(n){return n.type===16||tr(n)},yf=function(n){return n.length>1?[n[0],n[1]]:[n[0]]},vt={type:17,number:0,flags:bA},hu={type:16,number:50,flags:bA},nr={type:16,number:100,flags:bA},kA=function(n,e,t){var r=n[0],i=n[1];return[Se(r,e),Se(typeof i<"u"?i:r,t)]},Se=function(n,e){if(n.type===16)return n.number/100*e;if(er(n))switch(n.unit){case"rem":case"em":return 16*n.number;case"px":default:return n.number}return n.number},wf="deg",bf="grad",Bf="rad",Cf="turn",$s={name:"angle",parse:function(n,e){if(e.type===15)switch(e.unit){case wf:return Math.PI*e.number/180;case bf:return Math.PI/200*e.number;case Bf:return e.number;case Cf:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},_f=function(n){return n.type===15&&(n.unit===wf||n.unit===bf||n.unit===Bf||n.unit===Cf)},Sf=function(n){var e=n.filter(ce).map(function(t){return t.value}).join(" ");switch(e){case"to bottom right":case"to right bottom":case"left top":case"top left":return[vt,vt];case"to top":case"bottom":return qt(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[vt,nr];case"to right":case"left":return qt(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[nr,nr];case"to bottom":case"top":return qt(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[nr,vt];case"to left":case"right":return qt(270)}return 0},qt=function(n){return Math.PI*n/180},rr=function(n){return(255&n)===0},pt=function(n){var e=255&n,t=255&n>>8,r=255&n>>16,i=255&n>>24;return e<255?"rgba(".concat(i,",").concat(r,",").concat(t,",").concat(e/255,")"):"rgb(".concat(i,",").concat(r,",").concat(t,")")},wn=function(n,e,t,r){return(n<<24|e<<16|t<<8|Math.round(r*255)<<0)>>>0},eo=function(n,e){if(n.type===17)return n.number;if(n.type===16){var t=e===3?1:255;return e===3?n.number/100*t:Math.round(n.number/100*t)}return 0},Mr=function(n){return(n[0].type===20?n[0].value:"unknown")==="from"},ze=function(n,e,t){return Math.min(Math.max(n,e),t)},Ot=function(n,e){return[n[0]*e[0]+n[1]*e[1]+n[2]*e[2],n[3]*e[0]+n[4]*e[1]+n[5]*e[2],n[6]*e[0]+n[7]*e[1]+n[8]*e[2]]},JS=function(n){return wn(ze(Math.round(n[0]*255),0,255),ze(Math.round(n[1]*255),0,255),ze(Math.round(n[2]*255),0,255),ze(n[3],0,1))},pu=function(n){var e=n[0],t=n[1],r=n[2],i=n[3],A=Lr([e,t,r]);return wn(ze(Math.round(A[0]*255),0,255),ze(Math.round(A[1]*255),0,255),ze(Math.round(A[2]*255),0,255),i)},EA=function(n){var e=ir([n[0],n[1],n[2]]);return pu([e[0],e[1],e[2],n[3]])},zS=function(n,e){if(Mr(e.filter(mt)))throw new Error("Relative color not supported for lab()");var t=to(e),r=t[0],i=t[1],A=t[2],s=t[3],o=Lr(ir(io([r,i,A])));return wn(ze(Math.round(o[0]*255),0,255),ze(Math.round(o[1]*255),0,255),ze(Math.round(o[2]*255),0,255),s)},XS=function(n,e){if(Mr(e.filter(mt)))throw new Error("Relative color not supported for oklab()");var t=to(e),r=t[0],i=t[1],A=t[2],s=t[3],o=Lr(ir(ro([r,i,A])));return wn(ze(Math.round(o[0]*255),0,255),ze(Math.round(o[1]*255),0,255),ze(Math.round(o[2]*255),0,255),s)},YS=function(n,e){if(Mr(e.filter(mt)))throw new Error("Relative color not supported for oklch()");var t=Tf(e),r=t[0],i=t[1],A=t[2],s=t[3],o=Lr(ir(ro(no([r,i,A]))));return wn(ze(Math.round(o[0]*255),0,255),ze(Math.round(o[1]*255),0,255),ze(Math.round(o[2]*255),0,255),s)},ZS=function(n,e){if(Mr(e.filter(mt)))throw new Error("Relative color not supported for lch()");var t=Uf(e),r=t[0],i=t[1],A=t[2],s=t[3],o=Lr(ir(io(no([r,i,A]))));return wn(ze(Math.round(o[0]*255),0,255),ze(Math.round(o[1]*255),0,255),ze(Math.round(o[2]*255),0,255),s)},kf=function(n,e){var t=e.filter(mt),r=t[0],i=t[1],A=t[2],s=t[3],o=(r.type===17?qt(r.number):$s.parse(n,r))/(Math.PI*2),a=Pe(i)?i.number/100:0,c=Pe(A)?A.number/100:0,u=typeof s<"u"&&Pe(s)?Se(s,1):1;return[o,a,c,u]},Ef=function(n,e){if(Mr(e))throw new Error("Relative color not supported for hsl()");var t=kf(n,e),r=t[0],i=t[1],A=t[2],s=t[3],o=Ff([r,i,A]);return wn(o[0]*255,o[1]*255,o[2]*255,i===0?1:s)},Uf=function(n){var e=n.filter(mt),t=Pe(e[0])?e[0].number:0,r=Pe(e[1])?e[1].number:0,i=ot(e[2])||er(e[2])?e[2].number:0,A=typeof e[4]<"u"&&Pe(e[4])?Se(e[4],1):1;return[t,r,i,A]},to=function(n){var e=n.filter(mt),t=e[0].type===16?e[0].number/100:ot(e[0])?e[0].number:0,r=e[1].type===16?e[1].number/100:ot(e[1])?e[1].number:0,i=ot(e[2])||er(e[2])?e[2].number:0,A=typeof e[4]<"u"&&Pe(e[4])?Se(e[4],1):1;return[t,r,i,A]},Tf=function(n){var e=n.filter(mt),t=e[0].type===16?e[0].number/100:ot(e[0])?e[0].number:0,r=e[1].type===16?e[1].number/100:ot(e[1])?e[1].number:0,i=ot(e[2])||er(e[2])?e[2].number:0,A=typeof e[4]<"u"&&Pe(e[4])?Se(e[4],1):1;return[t,r,i,A]},If=function(n){return Ot([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],n)},fu=function(n){return Ot([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],n)},gu=function(n,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-n)*t*6+n:t<1/2?e:t<2/3?(e-n)*6*(2/3-t)+n:n},Ff=function(n){var e=n[0],t=n[1],r=n[2];if(t===0)return[r*255,r*255,r*255];var i=r<=.5?r*(t+1):r+t-r*t,A=r*2-i,s=gu(A,i,e+1/3),o=gu(A,i,e),a=gu(A,i,e-1/3);return[s,o,a]},no=function(n){var e=n[0],t=n[1],r=n[2];return t<0&&(t=0),isNaN(r)&&(r=0),[e,t*Math.cos(r*Math.PI/180),t*Math.sin(r*Math.PI/180)]},ro=function(n){var e=Ot([1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092],n),t=e.map(function(r){return Math.pow(r,3)});return Ot([1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],t)},io=function(n){var e=(n[0]+16)/116,t=n[1]/500+e,r=e-n[2]/200,i=24389/27,A=24/116,s=[(t>A?Math.pow(t,3):(116*t-16)/i)*.3457/.3585,n[0]>8?Math.pow(e,3):n[0]/i,(r>A?Math.pow(r,3):(116*r-16)/i)*(1-.3457-.3585)/.3585];return fu([s[0],s[1],s[2]])},$S=function(n,e){var t=e.filter(mt);if(t.length===3){var r=t.map(eo),i=r[0],A=r[1],s=r[2],o=vu([i/255,A/255,s/255]),a=mu([o[0],o[1],o[2]]),c=a[0],u=a[1],l=a[2];return[c,u,l,1]}if(t.length===4){var d=t.map(eo),i=d[0],A=d[1],s=d[2],h=d[3],o=vu([i/255,A/255,s/255]),f=mu([o[0],o[1],o[2]]),c=f[0],u=f[1],l=f[2];return[c,u,l,h]}return[0,0,0,1]},ek=function(n,e){var t=kf(n,e),r=t[0],i=t[1],A=t[2],s=t[3],o=vu(Ff([r,i,A])),a=mu([o[0],o[1],o[2]]),c=a[0],u=a[1],l=a[2];return[c,u,l,s]},tk=function(n,e){var t=to(e),r=t[0],i=t[1],A=t[2],s=t[3],o=io([r,i,A]),a=o[0],c=o[1],u=o[2];return[a,c,u,s]},nk=function(n,e){var t=Uf(e),r=t[0],i=t[1],A=t[2],s=t[3],o=io(no([r,i,A])),a=o[0],c=o[1],u=o[2];return[a,c,u,s]},rk=function(n,e){var t=Tf(e),r=t[0],i=t[1],A=t[2],s=t[3],o=ro(no([r,i,A])),a=o[0],c=o[1],u=o[2];return[a,c,u,s]},ik=function(n,e){var t=to(e),r=t[0],i=t[1],A=t[2],s=t[3],o=ro([r,i,A]),a=o[0],c=o[1],u=o[2];return[a,c,u,s]},Ak=function(n){return fu([n[0],n[1],n[2]])},xf=function(n){return n},sk=function(n){var e=If([n[0],n[2],n[3]]),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},Qf=function(n){return EA([n[0],n[1],n[2],n[3]])},ok=function(n){var e=Ak([n[0],n[1],n[2]]);return EA([e[0],e[1],e[2],n[3]])},ir=function(n){return Ot([3.2409699419045226,-1.537383177570094,-.4986107602930034,-.9692436362808796,1.8759675015077202,.04155505740717559,.05563007969699366,-.20397695888897652,1.0569715142428786],n)},mu=function(n){return Ot([.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],n)},Lr=function(n){return n.map(function(e){var t=e<0?-1:1,r=Math.abs(e);return r>.0031308?t*(1.055*Math.pow(r,1/2.4)-.055):12.92*e})},vu=function(n){return n.map(function(e){var t=e<0?-1:1,r=Math.abs(e);return r<=.04045?e/12.92:t*Math.pow((r+.055)/1.055,2.4)})},ak=function(n){var e=Lr(ir([n[0],n[1],n[2]])),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},ck=function(n){var e=ir([n[0],n[1],n[2]]),t=e[0],r=e[1],i=e[2];return[ze(Math.round(t*255),0,255),ze(Math.round(r*255),0,255),ze(Math.round(i*255),0,255),n[3]]},uk=function(n){return Ot([.4865709486482162,.26566769316909306,.1982172852343625,.2289745640697488,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],n)},lk=function(n){return Ot([2.493496911941425,-.9313836179191239,-.40271078445071684,-.8294889695615747,1.7626640603183463,.023624685841943577,.03584583024378447,-.07617238926804182,.9568845240076872],n)},dk=function(n){return n.map(function(e){var t=e<0?-1:1,r=e*t;return r<=.04045?e/12.92:t*Math.pow((e+.055)/1.055,2.4)||0})},hk=function(n){return Lr(n)},pk=function(n){var e=dk([n[0],n[1],n[2]]);return uk([e[0],e[1],e[2]])},fk=function(n){var e=hk(lk([n[0],n[1],n[2]])),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},gk=function(n){var e=pk([n[0],n[1],n[2]]);return EA([e[0],e[1],e[2],n[3]])},mk=function(n){return Ot([2.0415879038107465,-.5650069742788596,-.34473135077832956,-.9692436362808795,1.8759675015077202,.04155505740717557,.013444280632031142,-.11836239223101838,1.0151749943912054],n)},vk=function(n){return Ot([.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.0752914584939978,.02703136138641234,.07068885253582723,.9913375368376388],n)},yk=function(n){var e=n.map(function(t){var r=t<0?-1:1,i=Math.abs(t);return r*Math.pow(i,2.19921875)});return[e[0],e[1],e[2]]},wk=function(n){var e=n.map(function(t){var r=t<0?-1:1,i=Math.abs(t);return r*Math.pow(i,.4547069271758437)});return[e[0],e[1],e[2]]},bk=function(n){var e=wk(mk([n[0],n[1],n[2]])),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},Bk=function(n){var e=ir(vk(yk([n[0],n[1],n[2]])));return pu([e[0],e[1],e[2],n[3]])},Ck=function(n){return Ot([.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602],n)},_k=function(n){return Ot([1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452],n)},Sk=function(n){return n.map(function(e){return e<16/512?e/16:Math.pow(e,1.8)})},kk=function(n){return n.map(function(e){return e>1/512?Math.pow(e,1/1.8):e*16})},Ek=function(n){var e=Sk([n[0],n[1],n[2]]);return fu(Ck([e[0],e[1],e[2]]))},Uk=function(n){var e=kk(_k(If([n[0],n[1],n[2]]))),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},Tk=function(n){var e=Ek([n[0],n[1],n[2]]);return EA([e[0],e[1],e[2],n[3]])},Ao=1.09929682680944,Rf=.018053968510807,Ik=function(n){return n.map(function(e){return e<Rf*4.5?e/4.5:Math.pow((e+Ao-1)/Ao,1/.45)})},Fk=function(n){return n.map(function(e){return e>=Rf?Ao*Math.pow(e,.45)-(Ao-1):4.5*e})},xk=function(n){return Ot([.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.060985057710791],n)},Qk=function(n){return Ot([1.716651187971268,-.355670783776392,-.25336628137366,-.666684351832489,1.616481236634939,.0157685458139111,.017639857445311,-.042770613257809,.942103121235474],n)},Rk=function(n){var e=Ik([n[0],n[1],n[2]]);return xk([e[0],e[1],e[2]])},Pk=function(n){var e=Fk(Qk([n[0],n[1],n[2]])),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},Ok=function(n){var e=Rk([n[0],n[1],n[2]]);return EA([e[0],e[1],e[2],n[3]])},Ar={name:"color",parse:function(n,e){if(e.type===18){var t=Nk[e.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported color function "'.concat(e.name,'"'));return t(n,e.values)}if(e.type===5){var r=Pf(e),i=r[0],A=r[1],s=r[2],o=r[3];return wn(i,A,s,o)}if(e.type===20){var a=bn[e.value.toUpperCase()];if(typeof a<"u")return a}return bn.TRANSPARENT}},Pf=function(n){if(n.value.length===3){var e=n.value.substring(0,1),t=n.value.substring(1,2),r=n.value.substring(2,3);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(r+r,16),1]}if(n.value.length===4){var e=n.value.substring(0,1),t=n.value.substring(1,2),r=n.value.substring(2,3),i=n.value.substring(3,4);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(r+r,16),parseInt(i+i,16)/255]}if(n.value.length===6){var e=n.value.substring(0,2),t=n.value.substring(2,4),r=n.value.substring(4,6);return[parseInt(e,16),parseInt(t,16),parseInt(r,16),1]}if(n.value.length===8){var e=n.value.substring(0,2),t=n.value.substring(2,4),r=n.value.substring(4,6),i=n.value.substring(6,8);return[parseInt(e,16),parseInt(t,16),parseInt(r,16),parseInt(i,16)/255]}return[0,0,0,1]},Of=function(n,e){var t=e.filter(mt);if(Mr(t))throw new Error("Relative color not supported for rgb()");if(t.length===3){var r=t.map(eo),i=r[0],A=r[1],s=r[2];return wn(i,A,s,1)}if(t.length===4){var o=t.map(eo),i=o[0],A=o[1],s=o[2],a=o[3];return wn(i,A,s,a)}return 0},Mk=function(n,e){var t=e.filter(mt),r=t[0].type===20?t[0].value:"unknown",i=!Mr(t);if(i){var A=r,s=Mf[A];if(typeof s>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(A,'" for color() function'));var o=ot(t[1])?t[1].number:0,a=ot(t[2])?t[2].number:0,c=ot(t[3])?t[3].number:0,u=t.length>4&&t[4].type===6&&t[4].value==="/"&&ot(t[5])?t[5].number:1;return s([o,a,c,u])}else{var l=function(H,q){if(ot(q))return q.number;var ve=function(Be){return Be==="r"||Be==="x"?0:Be==="g"||Be==="y"?1:2};if(ce(q)){var Y=ve(q.value);return H[Y]}var ie=function(Be){for(var ht=Be.filter(mt),Re="(",Ne=0,ne=ht;Ne<ne.length;Ne++){var et=ne[Ne];Re+=et.type===18&&et.name==="calc"?ie(et.values):ot(et)?et.number:et.type===6||ce(et)?et.value:""}return Re+=")",Re};if(q.type===18){var Qe=q.values.filter(mt);if(q.name==="calc"){var qe=ie(Qe).replace(/r|x/,H[0].toString()).replace(/g|y/,H[1].toString()).replace(/b|z/,H[2].toString());return new Function("return "+qe)()}}return null},d=t[1].type===18?t[1].name:ce(t[1])||t[1].type===5?"rgb":"unknown",h=ce(t[2])?t[2].value:"unknown",f=t[1].type===18?t[1].values:ce(t[1])?[t[1]]:[];if(ce(t[1])){var p=bn[t[1].value.toUpperCase()];if(typeof p>"u")throw new Error("Attempting to use unknown color in relative color 'from'");var g=fi(n,t[1].value),v=255&g,y=255&g>>8,B=255&g>>16,b=255&g>>24;f=[{type:17,number:b,flags:1},{type:17,number:B,flags:1},{type:17,number:y,flags:1},{type:17,number:v>1?v/255:v,flags:1}]}else if(t[1].type===5){var w=Pf(t[1]),b=w[0],B=w[1],y=w[2],v=w[3];f=[{type:17,number:b,flags:1},{type:17,number:B,flags:1},{type:17,number:y,flags:1},{type:17,number:v>1?v/255:v,flags:1}]}if(f.length===0)throw new Error("Attempting to use unknown color in relative color 'from'");if(h==="unknown")throw new Error("Attempting to use unknown colorspace in relative color 'to'");var _=Lk[d],k=Dk[h],F=Mf[h];if(typeof _>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(d,'" for color() function'));if(typeof k>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(h,'" for color() function'));var x=_(n,f),U=k(x),o=l(U,t[3]),a=l(U,t[4]),c=l(U,t[5]),u=t.length>6&&t[6].type===6&&t[6].value==="/"&&ot(t[7])?t[7].number:1;if(o===null||a===null||c===null)throw new Error("Invalid relative color in color() function");return F([o,a,c,u])}},Mf={srgb:JS,"srgb-linear":pu,"display-p3":gk,"a98-rgb":Bk,"prophoto-rgb":Tk,xyz:Qf,"xyz-d50":ok,"xyz-d65":Qf,rec2020:Ok},Lk={rgb:$S,hsl:ek,lab:tk,lch:nk,oklab:ik,oklch:rk},Dk={srgb:ak,"srgb-linear":ck,"display-p3":fk,"a98-rgb":bk,"prophoto-rgb":Uk,xyz:xf,"xyz-d50":sk,"xyz-d65":xf,rec2020:Pk},Nk={hsl:Ef,hsla:Ef,rgb:Of,rgba:Of,lch:ZS,oklch:YS,oklab:XS,lab:zS,color:Mk},fi=function(n,e){return Ar.parse(n,mf.create(e).parseComponentValue())},bn={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},Hk={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(n,e){return e.map(function(t){if(ce(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Kk={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},so=function(n,e){var t=Ar.parse(n,e[0]),r=e[1];return r&&Pe(r)?{color:t,stop:r}:{color:t,stop:null}},Lf=function(n,e){var t=n[0],r=n[n.length-1];t.stop===null&&(t.stop=vt),r.stop===null&&(r.stop=nr);for(var i=[],A=0,s=0;s<n.length;s++){var o=n[s].stop;if(o!==null){var a=Se(o,e);a>A?i.push(a):i.push(A),A=a}else i.push(null)}for(var c=null,s=0;s<i.length;s++){var u=i[s];if(u===null)c===null&&(c=s);else if(c!==null){for(var l=s-c,d=i[c-1],h=(u-d)/(l+1),f=1;f<=l;f++)i[c+f-1]=h*f;c=null}}return n.map(function(p,g){var v=p.color;return{color:v,stop:Math.max(Math.min(1,i[g]/e),0)}})},Vk=function(n,e,t){var r=e/2,i=t/2,A=Se(n[0],e)-r,s=i-Se(n[1],t);return(Math.atan2(s,A)+Math.PI*2)%(Math.PI*2)},Gk=function(n,e,t){var r=typeof n=="number"?n:Vk(n,e,t),i=Math.abs(e*Math.sin(r))+Math.abs(t*Math.cos(r)),A=e/2,s=t/2,o=i/2,a=Math.sin(r-Math.PI/2)*o,c=Math.cos(r-Math.PI/2)*o;return[i,A-c,A+c,s-a,s+a]},rn=function(n,e){return Math.sqrt(n*n+e*e)},Df=function(n,e,t,r,i){var A=[[0,0],[0,e],[n,0],[n,e]];return A.reduce(function(s,o){var a=o[0],c=o[1],u=rn(t-a,r-c);return(i?u<s.optimumDistance:u>s.optimumDistance)?{optimumCorner:o,optimumDistance:u}:s},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},jk=function(n,e,t,r,i){var A=0,s=0;switch(n.size){case 0:n.shape===0?A=s=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-i)):n.shape===1&&(A=Math.min(Math.abs(e),Math.abs(e-r)),s=Math.min(Math.abs(t),Math.abs(t-i)));break;case 2:if(n.shape===0)A=s=Math.min(rn(e,t),rn(e,t-i),rn(e-r,t),rn(e-r,t-i));else if(n.shape===1){var o=Math.min(Math.abs(t),Math.abs(t-i))/Math.min(Math.abs(e),Math.abs(e-r)),a=Df(r,i,e,t,!0),c=a[0],u=a[1];A=rn(c-e,(u-t)/o),s=o*A}break;case 1:n.shape===0?A=s=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-i)):n.shape===1&&(A=Math.max(Math.abs(e),Math.abs(e-r)),s=Math.max(Math.abs(t),Math.abs(t-i)));break;case 3:if(n.shape===0)A=s=Math.max(rn(e,t),rn(e,t-i),rn(e-r,t),rn(e-r,t-i));else if(n.shape===1){var o=Math.max(Math.abs(t),Math.abs(t-i))/Math.max(Math.abs(e),Math.abs(e-r)),l=Df(r,i,e,t,!1),c=l[0],u=l[1];A=rn(c-e,(u-t)/o),s=o*A}break}return Array.isArray(n.size)&&(A=Se(n.size[0],r),s=n.size.length===2?Se(n.size[1],i):A),[A,s]},Wk=function(n,e){var t=qt(180),r=[];return yn(e).forEach(function(i,A){if(A===0){var s=i[0];if(s.type===20&&s.value==="to"){t=Sf(i);return}else if(_f(s)){t=$s.parse(n,s);return}}var o=so(n,i);r.push(o)}),{angle:t,stops:r,type:1}},oo=function(n,e){var t=qt(180),r=[];return yn(e).forEach(function(i,A){if(A===0){var s=i[0];if(s.type===20&&["top","left","right","bottom"].indexOf(s.value)!==-1){t=Sf(i);return}else if(_f(s)){t=($s.parse(n,s)+qt(270))%qt(360);return}}var o=so(n,i);r.push(o)}),{angle:t,stops:r,type:1}},qk=function(n,e){var t=qt(180),r=[],i=1,A=0,s=3,o=[];return yn(e).forEach(function(a,c){var u=a[0];if(c===0){if(ce(u)&&u.value==="linear"){i=1;return}else if(ce(u)&&u.value==="radial"){i=2;return}}if(u.type===18){if(u.name==="from"){var l=Ar.parse(n,u.values[0]);r.push({stop:vt,color:l})}else if(u.name==="to"){var l=Ar.parse(n,u.values[0]);r.push({stop:nr,color:l})}else if(u.name==="color-stop"){var d=u.values.filter(mt);if(d.length===2){var l=Ar.parse(n,d[1]),h=d[0];ot(h)&&r.push({stop:{type:16,number:h.number*100,flags:h.flags},color:l})}}}}),i===1?{angle:(t+qt(180))%qt(360),stops:r,type:i}:{size:s,shape:A,stops:r,position:o,type:i}},Nf="closest-side",Hf="farthest-side",Kf="closest-corner",Vf="farthest-corner",Gf="circle",jf="ellipse",Wf="cover",qf="contain",Jk=function(n,e){var t=0,r=3,i=[],A=[];return yn(e).forEach(function(s,o){var a=!0;if(o===0){var c=!1;a=s.reduce(function(l,d){if(c)if(ce(d))switch(d.value){case"center":return A.push(hu),l;case"top":case"left":return A.push(vt),l;case"right":case"bottom":return A.push(nr),l}else(Pe(d)||tr(d))&&A.push(d);else if(ce(d))switch(d.value){case Gf:return t=0,!1;case jf:return t=1,!1;case"at":return c=!0,!1;case Nf:return r=0,!1;case Wf:case Hf:return r=1,!1;case qf:case Kf:return r=2,!1;case Vf:return r=3,!1}else if(tr(d)||Pe(d))return Array.isArray(r)||(r=[]),r.push(d),!1;return l},a)}if(a){var u=so(n,s);i.push(u)}}),{size:r,shape:t,stops:i,position:A,type:2}},ao=function(n,e){var t=0,r=3,i=[],A=[];return yn(e).forEach(function(s,o){var a=!0;if(o===0?a=s.reduce(function(u,l){if(ce(l))switch(l.value){case"center":return A.push(hu),!1;case"top":case"left":return A.push(vt),!1;case"right":case"bottom":return A.push(nr),!1}else if(Pe(l)||tr(l))return A.push(l),!1;return u},a):o===1&&(a=s.reduce(function(u,l){if(ce(l))switch(l.value){case Gf:return t=0,!1;case jf:return t=1,!1;case qf:case Nf:return r=0,!1;case Hf:return r=1,!1;case Kf:return r=2,!1;case Wf:case Vf:return r=3,!1}else if(tr(l)||Pe(l))return Array.isArray(r)||(r=[]),r.push(l),!1;return u},a)),a){var c=so(n,s);i.push(c)}}),{size:r,shape:t,stops:i,position:A,type:2}},zk=function(n){return n.type===1},Xk=function(n){return n.type===2},yu={name:"image",parse:function(n,e){if(e.type===22){var t={url:e.value,type:0};return n.cache.addImage(e.value),t}if(e.type===18){var r=Jf[e.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported image function "'.concat(e.name,'"'));return r(n,e.values)}throw new Error("Unsupported image type ".concat(e.type))}};function Yk(n){return!(n.type===20&&n.value==="none")&&(n.type!==18||!!Jf[n.name])}var Jf={"linear-gradient":Wk,"-moz-linear-gradient":oo,"-ms-linear-gradient":oo,"-o-linear-gradient":oo,"-webkit-linear-gradient":oo,"radial-gradient":Jk,"-moz-radial-gradient":ao,"-ms-radial-gradient":ao,"-o-radial-gradient":ao,"-webkit-radial-gradient":ao,"-webkit-gradient":qk},Zk={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(n,e){if(e.length===0)return[];var t=e[0];return t.type===20&&t.value==="none"?[]:e.filter(function(r){return mt(r)&&Yk(r)}).map(function(r){return yu.parse(n,r)})}},$k={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(n,e){return e.map(function(t){if(ce(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},eE={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(n,e){return yn(e).map(function(t){return t.filter(Pe)}).map(yf)}},tE={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(n,e){return yn(e).map(function(t){return t.filter(ce).map(function(r){return r.value}).join(" ")}).map(nE)}},nE=function(n){switch(n){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},gi;(function(n){n.AUTO="auto",n.CONTAIN="contain",n.COVER="cover"})(gi||(gi={}));var rE={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(n,e){return yn(e).map(function(t){return t.filter(iE)})}},iE=function(n){return ce(n)||Pe(n)},co=function(n){return{name:"border-".concat(n,"-color"),initialValue:"transparent",prefix:!1,type:3,format:"color"}},AE=co("top"),sE=co("right"),oE=co("bottom"),aE=co("left"),uo=function(n){return{name:"border-radius-".concat(n),initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return yf(t.filter(Pe))}}},cE=uo("top-left"),uE=uo("top-right"),lE=uo("bottom-right"),dE=uo("bottom-left"),lo=function(n){return{name:"border-".concat(n,"-style"),initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},hE=lo("top"),pE=lo("right"),fE=lo("bottom"),gE=lo("left"),ho=function(n){return{name:"border-".concat(n,"-width"),initialValue:"0",type:0,prefix:!1,parse:function(e,t){return er(t)?t.number:0}}},mE=ho("top"),vE=ho("right"),yE=ho("bottom"),wE=ho("left"),bE={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},BE={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(n,e){switch(e){case"rtl":return 1;case"ltr":default:return 0}}},CE={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(n,e){return e.filter(ce).reduce(function(t,r){return t|_E(r.value)},0)}},_E=function(n){switch(n){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},SE={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},kE={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(n,e){return e.type===20&&e.value==="normal"?0:e.type===17||e.type===15?e.number:0}},po;(function(n){n.NORMAL="normal",n.STRICT="strict"})(po||(po={}));var EE={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"strict":return po.STRICT;case"normal":default:return po.NORMAL}}},UE={name:"line-height",initialValue:"normal",prefix:!1,type:4},zf=function(n,e){return ce(n)&&n.value==="normal"?1.2*e:n.type===17?e*n.number:Pe(n)?Se(n,e):e},TE={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(n,e){return e.type===20&&e.value==="none"?null:yu.parse(n,e)}},IE={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(n,e){switch(e){case"inside":return 0;case"outside":default:return 1}}},wu={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 52;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},fo=function(n){return{name:"margin-".concat(n),initialValue:"0",prefix:!1,type:4}},FE=fo("top"),xE=fo("right"),QE=fo("bottom"),RE=fo("left"),PE={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(n,e){return e.filter(ce).map(function(t){switch(t.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},OE={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"break-word":return"break-word";case"normal":default:return"normal"}}},go=function(n){return{name:"padding-".concat(n),initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},ME=go("top"),LE=go("right"),DE=go("bottom"),NE=go("left"),HE={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(n,e){switch(e){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},KE={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(n,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},VE={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(n,e){return e.length===1&&du(e[0],"none")?[]:yn(e).map(function(t){for(var r={color:bn.TRANSPARENT,offsetX:vt,offsetY:vt,blur:vt},i=0,A=0;A<t.length;A++){var s=t[A];tr(s)?(i===0?r.offsetX=s:i===1?r.offsetY=s:r.blur=s,i++):r.color=Ar.parse(n,s)}return r})}},GE={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},jE={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(n,e){if(e.type===20&&e.value==="none")return null;if(e.type===18){var t=JE[e.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported transform function "'.concat(e.name,'"'));return t(e.values)}return null}},WE=function(n){var e=n.filter(function(t){return t.type===17}).map(function(t){return t.number});return e.length===6?e:null},qE=function(n){var e=n.filter(function(a){return a.type===17}).map(function(a){return a.number}),t=e[0],r=e[1];e[2],e[3];var i=e[4],A=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var s=e[12],o=e[13];return e[14],e[15],e.length===16?[t,r,i,A,s,o]:null},JE={matrix:WE,matrix3d:qE},Xf={type:16,number:50,flags:bA},zE=[Xf,Xf],XE={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(n,e){var t=e.filter(Pe);return t.length!==2?zE:[t[0],t[1]]}},YE={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},UA;(function(n){n.NORMAL="normal",n.BREAK_ALL="break-all",n.KEEP_ALL="keep-all"})(UA||(UA={}));for(var ZE={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"break-all":return UA.BREAK_ALL;case"keep-all":return UA.KEEP_ALL;case"normal":default:return UA.NORMAL}}},$E={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(n,e){if(e.type===20)return{auto:!0,order:0};if(ot(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},Yf={name:"time",parse:function(n,e){if(e.type===15)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},e1={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(n,e){return ot(e)?e.number:1}},t1={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},n1={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(n,e){return e.filter(ce).map(function(t){switch(t.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(t){return t!==0})}},r1={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(n,e){var t=[],r=[];return e.forEach(function(i){switch(i.type){case 20:case 0:t.push(i.value);break;case 17:t.push(i.number.toString());break;case 4:r.push(t.join(" ")),t.length=0;break}}),t.length&&r.push(t.join(" ")),r.map(function(i){return i.indexOf(" ")===-1?i:"'".concat(i,"'")})}},i1={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},A1={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(n,e){if(ot(e))return e.number;if(ce(e))switch(e.value){case"bold":return 700;case"normal":default:return 400}return 400}},s1={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(n,e){return e.filter(ce).map(function(t){return t.value})}},o1={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},ut=function(n,e){return(n&e)!==0},a1={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(n,e){if(e.length===0)return[];var t=e[0];return t.type===20&&t.value==="none"?[]:e}},c1={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(n,e){if(e.length===0)return null;var t=e[0];if(t.type===20&&t.value==="none")return null;for(var r=[],i=e.filter(vf),A=0;A<i.length;A++){var s=i[A],o=i[A+1];if(s.type===20){var a=o&&ot(o)?o.number:1;r.push({counter:s.value,increment:a})}}return r}},u1={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(n,e){if(e.length===0)return[];for(var t=[],r=e.filter(vf),i=0;i<r.length;i++){var A=r[i],s=r[i+1];if(ce(A)&&A.value!=="none"){var o=s&&ot(s)?s.number:0;t.push({counter:A.value,reset:o})}}return t}},l1={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(n,e){return e.filter(er).map(function(t){return Yf.parse(n,t)})}},d1={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(n,e){if(e.length===0)return null;var t=e[0];if(t.type===20&&t.value==="none")return null;var r=[],i=e.filter(WS);if(i.length%2!==0)return null;for(var A=0;A<i.length;A+=2){var s=i[A].value,o=i[A+1].value;r.push({open:s,close:o})}return r}},Zf=function(n,e,t){if(!n)return"";var r=n[Math.min(e,n.length-1)];return r?t?r.open:r.close:""},h1={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(n,e){return e.length===1&&du(e[0],"none")?[]:yn(e).map(function(t){for(var r={color:255,offsetX:vt,offsetY:vt,blur:vt,spread:vt,inset:!1},i=0,A=0;A<t.length;A++){var s=t[A];du(s,"inset")?r.inset=!0:tr(s)?(i===0?r.offsetX=s:i===1?r.offsetY=s:i===2?r.blur=s:r.spread=s,i++):r.color=Ar.parse(n,s)}return r})}},p1={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(n,e){var t=[0,1,2],r=[];return e.filter(ce).forEach(function(i){switch(i.value){case"stroke":r.push(1);break;case"fill":r.push(0);break;case"markers":r.push(2);break}}),t.forEach(function(i){r.indexOf(i)===-1&&r.push(i)}),r}},f1={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},g1={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(n,e){return er(e)?e.number:0}},m1={name:"objectFit",initialValue:"fill",prefix:!1,type:1,parse:function(n,e){return e.filter(ce).reduce(function(t,r){return t|v1(r.value)},0)}},v1=function(n){switch(n){case"contain":return 2;case"cover":return 4;case"none":return 8;case"scale-down":return 16}return 0},y1=function(){function n(e,t){var r,i;this.animationDuration=j(e,l1,t.animationDuration),this.backgroundClip=j(e,Hk,t.backgroundClip),this.backgroundColor=j(e,Kk,t.backgroundColor),this.backgroundImage=j(e,Zk,t.backgroundImage),this.backgroundOrigin=j(e,$k,t.backgroundOrigin),this.backgroundPosition=j(e,eE,t.backgroundPosition),this.backgroundRepeat=j(e,tE,t.backgroundRepeat),this.backgroundSize=j(e,rE,t.backgroundSize),this.borderTopColor=j(e,AE,t.borderTopColor),this.borderRightColor=j(e,sE,t.borderRightColor),this.borderBottomColor=j(e,oE,t.borderBottomColor),this.borderLeftColor=j(e,aE,t.borderLeftColor),this.borderTopLeftRadius=j(e,cE,t.borderTopLeftRadius),this.borderTopRightRadius=j(e,uE,t.borderTopRightRadius),this.borderBottomRightRadius=j(e,lE,t.borderBottomRightRadius),this.borderBottomLeftRadius=j(e,dE,t.borderBottomLeftRadius),this.borderTopStyle=j(e,hE,t.borderTopStyle),this.borderRightStyle=j(e,pE,t.borderRightStyle),this.borderBottomStyle=j(e,fE,t.borderBottomStyle),this.borderLeftStyle=j(e,gE,t.borderLeftStyle),this.borderTopWidth=j(e,mE,t.borderTopWidth),this.borderRightWidth=j(e,vE,t.borderRightWidth),this.borderBottomWidth=j(e,yE,t.borderBottomWidth),this.borderLeftWidth=j(e,wE,t.borderLeftWidth),this.boxShadow=j(e,h1,t.boxShadow),this.color=j(e,bE,t.color),this.direction=j(e,BE,t.direction),this.display=j(e,CE,t.display),this.float=j(e,SE,t.cssFloat),this.fontFamily=j(e,r1,t.fontFamily),this.fontSize=j(e,i1,t.fontSize),this.fontStyle=j(e,o1,t.fontStyle),this.fontVariant=j(e,s1,t.fontVariant),this.fontWeight=j(e,A1,t.fontWeight),this.letterSpacing=j(e,kE,t.letterSpacing),this.lineBreak=j(e,EE,t.lineBreak),this.lineHeight=j(e,UE,t.lineHeight),this.listStyleImage=j(e,TE,t.listStyleImage),this.listStylePosition=j(e,IE,t.listStylePosition),this.listStyleType=j(e,wu,t.listStyleType),this.marginTop=j(e,FE,t.marginTop),this.marginRight=j(e,xE,t.marginRight),this.marginBottom=j(e,QE,t.marginBottom),this.marginLeft=j(e,RE,t.marginLeft),this.opacity=j(e,e1,t.opacity);var A=j(e,PE,t.overflow);this.overflowX=A[0],this.overflowY=A[A.length>1?1:0],this.overflowWrap=j(e,OE,t.overflowWrap),this.paddingTop=j(e,ME,t.paddingTop),this.paddingRight=j(e,LE,t.paddingRight),this.paddingBottom=j(e,DE,t.paddingBottom),this.paddingLeft=j(e,NE,t.paddingLeft),this.paintOrder=j(e,p1,t.paintOrder),this.position=j(e,KE,t.position),this.textAlign=j(e,HE,t.textAlign),this.textDecorationColor=j(e,t1,(r=t.textDecorationColor)!==null&&r!==void 0?r:t.color),this.textDecorationLine=j(e,n1,(i=t.textDecorationLine)!==null&&i!==void 0?i:t.textDecoration),this.textShadow=j(e,VE,t.textShadow),this.textTransform=j(e,GE,t.textTransform),this.transform=j(e,jE,t.transform),this.transformOrigin=j(e,XE,t.transformOrigin),this.visibility=j(e,YE,t.visibility),this.webkitTextStrokeColor=j(e,f1,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=j(e,g1,t.webkitTextStrokeWidth),this.wordBreak=j(e,ZE,t.wordBreak),this.zIndex=j(e,$E,t.zIndex),this.objectFit=j(e,m1,t.objectFit)}return n.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},n.prototype.isTransparent=function(){return rr(this.backgroundColor)},n.prototype.isTransformed=function(){return this.transform!==null},n.prototype.isPositioned=function(){return this.position!==0},n.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},n.prototype.isFloating=function(){return this.float!==0},n.prototype.isInlineLevel=function(){return ut(this.display,4)||ut(this.display,33554432)||ut(this.display,268435456)||ut(this.display,536870912)||ut(this.display,67108864)||ut(this.display,134217728)},n}(),w1=function(){function n(e,t){this.content=j(e,a1,t.content),this.quotes=j(e,d1,t.quotes)}return n}(),$f=function(){function n(e,t){this.counterIncrement=j(e,c1,t.counterIncrement),this.counterReset=j(e,u1,t.counterReset)}return n}(),j=function(n,e,t){var r=new gf,i=t!==null&&typeof t<"u"?t.toString():e.initialValue;r.write(i);var A=new mf(r.read());switch(e.type){case 2:var s=A.parseComponentValue();return e.parse(n,ce(s)?s.value:e.initialValue);case 0:return e.parse(n,A.parseComponentValue());case 1:return e.parse(n,A.parseComponentValues());case 4:return A.parseComponentValue();case 3:switch(e.format){case"angle":return $s.parse(n,A.parseComponentValue());case"color":return Ar.parse(n,A.parseComponentValue());case"image":return yu.parse(n,A.parseComponentValue());case"length":var o=A.parseComponentValue();return tr(o)?o:vt;case"length-percentage":var a=A.parseComponentValue();return Pe(a)?a:vt;case"time":return Yf.parse(n,A.parseComponentValue())}break}},b1="data-html2canvas-debug",B1=function(n){var e=n.getAttribute(b1);switch(e){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},bu=function(n,e){var t=B1(n);return t===1||e===t},Bn=function(){function n(e,t){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,bu(t,3),this.styles=new y1(e,window.getComputedStyle(t,null)),Pu(t)&&(this.styles.animationDuration.some(function(r){return r>0})&&(t.style.animationDuration="0s"),this.styles.transform!==null&&(t.style.transform="none")),this.bounds=Qs(this.context,t),bu(t,4)&&(this.flags|=16)}return n}(),C1="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",eg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",TA=typeof Uint8Array>"u"?[]:new Uint8Array(256),mo=0;mo<eg.length;mo++)TA[eg.charCodeAt(mo)]=mo;for(var _1=function(n){var e=n.length*.75,t=n.length,r,i=0,A,s,o,a;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);var c=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),u=Array.isArray(c)?c:new Uint8Array(c);for(r=0;r<t;r+=4)A=TA[n.charCodeAt(r)],s=TA[n.charCodeAt(r+1)],o=TA[n.charCodeAt(r+2)],a=TA[n.charCodeAt(r+3)],u[i++]=A<<2|s>>4,u[i++]=(s&15)<<4|o>>2,u[i++]=(o&3)<<6|a&63;return c},S1=function(n){for(var e=n.length,t=[],r=0;r<e;r+=2)t.push(n[r+1]<<8|n[r]);return t},k1=function(n){for(var e=n.length,t=[],r=0;r<e;r+=4)t.push(n[r+3]<<24|n[r+2]<<16|n[r+1]<<8|n[r]);return t},Dr=5,Bu=6+5,Cu=2,E1=Bu-Dr,tg=65536>>Dr,U1=1<<Dr,_u=U1-1,T1=1024>>Dr,I1=tg+T1,F1=I1,x1=32,Q1=F1+x1,R1=65536>>Bu,P1=1<<E1,O1=P1-1,ng=function(n,e,t){return n.slice?n.slice(e,t):new Uint16Array(Array.prototype.slice.call(n,e,t))},M1=function(n,e,t){return n.slice?n.slice(e,t):new Uint32Array(Array.prototype.slice.call(n,e,t))},L1=function(n,e){var t=_1(n),r=Array.isArray(t)?k1(t):new Uint32Array(t),i=Array.isArray(t)?S1(t):new Uint16Array(t),A=24,s=ng(i,A/2,r[4]/2),o=r[5]===2?ng(i,(A+r[4])/2):M1(r,Math.ceil((A+r[4])/4));return new D1(r[0],r[1],r[2],r[3],s,o)},D1=function(){function n(e,t,r,i,A,s){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=i,this.index=A,this.data=s}return n.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>Dr],t=(t<<Cu)+(e&_u),this.data[t];if(e<=65535)return t=this.index[tg+(e-55296>>Dr)],t=(t<<Cu)+(e&_u),this.data[t];if(e<this.highStart)return t=Q1-R1+(e>>Bu),t=this.index[t],t+=e>>Dr&O1,t=this.index[t],t=(t<<Cu)+(e&_u),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},n}(),rg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N1=typeof Uint8Array>"u"?[]:new Uint8Array(256),vo=0;vo<rg.length;vo++)N1[rg.charCodeAt(vo)]=vo;var H1=1,Su=2,ku=3,ig=4,Ag=5,K1=7,sg=8,Eu=9,Uu=10,og=11,ag=12,cg=13,ug=14,Tu=15,V1=function(n){for(var e=[],t=0,r=n.length;t<r;){var i=n.charCodeAt(t++);if(i>=55296&&i<=56319&&t<r){var A=n.charCodeAt(t++);(A&64512)===56320?e.push(((i&1023)<<10)+(A&1023)+65536):(e.push(i),t--)}else e.push(i)}return e},G1=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,n);var t=n.length;if(!t)return"";for(var r=[],i=-1,A="";++i<t;){var s=n[i];s<=65535?r.push(s):(s-=65536,r.push((s>>10)+55296,s%1024+56320)),(i+1===t||r.length>16384)&&(A+=String.fromCharCode.apply(String,r),r.length=0)}return A},j1=L1(C1),Jt="\xD7",Iu="\xF7",W1=function(n){return j1.get(n)},q1=function(n,e,t){var r=t-2,i=e[r],A=e[t-1],s=e[t];if(A===Su&&s===ku)return Jt;if(A===Su||A===ku||A===ig||s===Su||s===ku||s===ig)return Iu;if(A===sg&&[sg,Eu,og,ag].indexOf(s)!==-1||(A===og||A===Eu)&&(s===Eu||s===Uu)||(A===ag||A===Uu)&&s===Uu||s===cg||s===Ag||s===K1||A===H1)return Jt;if(A===cg&&s===ug){for(;i===Ag;)i=e[--r];if(i===ug)return Jt}if(A===Tu&&s===Tu){for(var o=0;i===Tu;)o++,i=e[--r];if(o%2===0)return Jt}return Iu},J1=function(n){var e=V1(n),t=e.length,r=0,i=0,A=e.map(W1);return{next:function(){if(r>=t)return{done:!0,value:null};for(var s=Jt;r<t&&(s=q1(e,A,++r))===Jt;);if(s!==Jt||r===t){var o=G1.apply(null,e.slice(i,r));return i=r,{value:o,done:!1}}return{done:!0,value:null}}}},z1=function(n){for(var e=J1(n),t=[],r;!(r=e.next()).done;)r.value&&t.push(r.value.slice());return t},X1=function(n){var e=123;if(n.createRange){var t=n.createRange();if(t.getBoundingClientRect){var r=n.createElement("boundtest");r.style.height="".concat(e,"px"),r.style.display="block",n.body.appendChild(r),t.selectNode(r);var i=t.getBoundingClientRect(),A=Math.round(i.height);if(n.body.removeChild(r),A===e)return!0}}return!1},Y1=function(n){var e=n.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",n.body.appendChild(e);var t=n.createRange();e.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var r=e.firstChild,i=Rs(r.data).map(function(a){return tt(a)}),A=0,s={},o=i.every(function(a,c){t.setStart(r,A),t.setEnd(r,A+a.length);var u=t.getBoundingClientRect();A+=a.length;var l=u.x>s.x||u.y>s.y;return s=u,c===0?!0:l});return n.body.removeChild(e),o},Z1=function(){return typeof new Image().crossOrigin<"u"},$1=function(){return typeof new XMLHttpRequest().responseType=="string"},eU=function(n){var e=new Image,t=n.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(e,0,0),t.toDataURL()}catch{return!1}return!0},lg=function(n){return n[0]===0&&n[1]===255&&n[2]===0&&n[3]===255},tU=function(n){var e=n.createElement("canvas"),t=100;e.width=t,e.height=t;var r=e.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,t,t);var i=new Image,A=e.toDataURL();i.src=A;var s=Fu(t,t,0,0,i);return r.fillStyle="red",r.fillRect(0,0,t,t),dg(s).then(function(o){r.drawImage(o,0,0);var a=r.getImageData(0,0,t,t).data;r.fillStyle="red",r.fillRect(0,0,t,t);var c=n.createElement("div");return c.style.backgroundImage="url(".concat(A,")"),c.style.height="".concat(t,"px"),lg(a)?dg(Fu(t,t,0,0,c)):Promise.reject(!1)}).then(function(o){return r.drawImage(o,0,0),lg(r.getImageData(0,0,t,t).data)}).catch(function(){return!1})},Fu=function(n,e,t,r,i){var A="http://www.w3.org/2000/svg",s=document.createElementNS(A,"svg"),o=document.createElementNS(A,"foreignObject");return s.setAttributeNS(null,"width",n.toString()),s.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",r.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(o),o.appendChild(i),s},dg=function(n){return new Promise(function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(new XMLSerializer().serializeToString(n)))})},yt={get SUPPORT_RANGE_BOUNDS(){var n=X1(document);return Object.defineProperty(yt,"SUPPORT_RANGE_BOUNDS",{value:n}),n},get SUPPORT_WORD_BREAKING(){var n=yt.SUPPORT_RANGE_BOUNDS&&Y1(document);return Object.defineProperty(yt,"SUPPORT_WORD_BREAKING",{value:n}),n},get SUPPORT_SVG_DRAWING(){var n=eU(document);return Object.defineProperty(yt,"SUPPORT_SVG_DRAWING",{value:n}),n},get SUPPORT_FOREIGNOBJECT_DRAWING(){var n=typeof Array.from=="function"&&typeof window.fetch=="function"?tU(document):Promise.resolve(!1);return Object.defineProperty(yt,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:n}),n},get SUPPORT_CORS_IMAGES(){var n=Z1();return Object.defineProperty(yt,"SUPPORT_CORS_IMAGES",{value:n}),n},get SUPPORT_RESPONSE_TYPE(){var n=$1();return Object.defineProperty(yt,"SUPPORT_RESPONSE_TYPE",{value:n}),n},get SUPPORT_CORS_XHR(){var n="withCredentials"in new XMLHttpRequest;return Object.defineProperty(yt,"SUPPORT_CORS_XHR",{value:n}),n},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var n=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(yt,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:n}),n}},IA=function(){function n(e,t){this.text=e,this.bounds=t}return n}(),nU=function(n,e,t,r){var i=AU(e,t),A=[],s=0;return i.forEach(function(o){if(t.textDecorationLine.length||o.trim().length>0)if(yt.SUPPORT_RANGE_BOUNDS){var a=hg(r,s,o.length).getClientRects();if(a.length>1){var c=xu(o),u=0;c.forEach(function(d){A.push(new IA(d,Rn.fromDOMRectList(n,hg(r,u+s,d.length).getClientRects()))),u+=d.length})}else A.push(new IA(o,Rn.fromDOMRectList(n,a)))}else{var l=r.splitText(o.length);A.push(new IA(o,rU(n,r))),r=l}else yt.SUPPORT_RANGE_BOUNDS||(r=r.splitText(o.length));s+=o.length}),A},rU=function(n,e){var t=e.ownerDocument;if(t){var r=t.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));var i=e.parentNode;if(i){i.replaceChild(r,e);var A=Qs(n,r);return r.firstChild&&i.replaceChild(r.firstChild,r),A}}return Rn.EMPTY},hg=function(n,e,t){var r=n.ownerDocument;if(!r)throw new Error("Node has no owner document");var i=r.createRange();return i.setStart(n,e),i.setEnd(n,e+t),i},xu=function(n){if(yt.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(n)).map(function(t){return t.segment})}return z1(n)},iU=function(n,e){if(yt.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(n)).map(function(r){return r.segment})}return oU(n,e)},AU=function(n,e){return e.letterSpacing!==0?xu(n):iU(n,e)},sU=[32,160,4961,65792,65793,4153,4241],oU=function(n,e){for(var t=N_(n,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap==="break-word"?"break-word":e.wordBreak}),r=[],i,A=function(){if(i.value){var s=i.value.slice(),o=Rs(s),a="";o.forEach(function(c){sU.indexOf(c)===-1?a+=tt(c):(a.length&&r.push(a),r.push(tt(c)),a="")}),a.length&&r.push(a)}};!(i=t.next()).done;)A();return r},aU=function(){function n(e,t,r){this.text=cU(t.data,r.textTransform),this.textBounds=nU(e,this.text,r,t)}return n}(),cU=function(n,e){switch(e){case 1:return n.toLowerCase();case 3:return n.replace(uU,lU);case 2:return n.toUpperCase();default:return n}},uU=/(^|\s|:|-|\(|\))([a-z])/g,lU=function(n,e,t){return n.length>0?e+t.toUpperCase():n},pg=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.src=r.currentSrc||r.src,i.intrinsicWidth=r.naturalWidth,i.intrinsicHeight=r.naturalHeight,i.context.cache.addImage(i.src),i}return e}(Bn),fg=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.canvas=r,i.intrinsicWidth=r.width,i.intrinsicHeight=r.height,i}return e}(Bn),gg=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this,A=new XMLSerializer,s=Qs(t,r);return r.setAttribute("width","".concat(s.width,"px")),r.setAttribute("height","".concat(s.height,"px")),i.svg="data:image/svg+xml,".concat(encodeURIComponent(A.serializeToString(r))),i.intrinsicWidth=r.width.baseVal.value,i.intrinsicHeight=r.height.baseVal.value,i.context.cache.addImage(i.svg),i}return e}(Bn),mg=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.value=r.value,i}return e}(Bn),Qu=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.start=r.start,i.reversed=typeof r.reversed=="boolean"&&r.reversed===!0,i}return e}(Bn),dU=[{type:15,flags:0,unit:"px",number:3}],hU=[{type:16,flags:0,number:50}],pU=function(n){return n.width>n.height?new Rn(n.left+(n.width-n.height)/2,n.top,n.height,n.height):n.width<n.height?new Rn(n.left,n.top+(n.height-n.width)/2,n.width,n.width):n},fU=function(n){var e=n.type===gU?new Array(n.value.length+1).join("\u2022"):n.value;return e.length===0?n.placeholder||"":e},yo="checkbox",wo="radio",gU="password",vg=707406591,Ru=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;switch(i.type=r.type.toLowerCase(),i.checked=r.checked,i.value=fU(r),(i.type===yo||i.type===wo)&&(i.styles.backgroundColor=3739148031,i.styles.borderTopColor=i.styles.borderRightColor=i.styles.borderBottomColor=i.styles.borderLeftColor=2779096575,i.styles.borderTopWidth=i.styles.borderRightWidth=i.styles.borderBottomWidth=i.styles.borderLeftWidth=1,i.styles.borderTopStyle=i.styles.borderRightStyle=i.styles.borderBottomStyle=i.styles.borderLeftStyle=1,i.styles.backgroundClip=[0],i.styles.backgroundOrigin=[0],i.bounds=pU(i.bounds)),i.type){case yo:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=dU;break;case wo:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=hU;break}return i}return e}(Bn),yg=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this,A=r.options[r.selectedIndex||0];return i.value=A&&A.text||"",i}return e}(Bn),wg=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.value=r.value,i}return e}(Bn),bg=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;i.src=r.src,i.width=parseInt(r.width,10)||0,i.height=parseInt(r.height,10)||0,i.backgroundColor=i.styles.backgroundColor;try{if(r.contentWindow&&r.contentWindow.document&&r.contentWindow.document.documentElement){i.tree=Cg(t,r.contentWindow.document.documentElement);var A=r.contentWindow.document.documentElement?fi(t,getComputedStyle(r.contentWindow.document.documentElement).backgroundColor):bn.TRANSPARENT,s=r.contentWindow.document.body?fi(t,getComputedStyle(r.contentWindow.document.body).backgroundColor):bn.TRANSPARENT;i.backgroundColor=rr(A)?rr(s)?i.styles.backgroundColor:s:A}}catch{}return i}return e}(Bn),mU=["OL","UL","MENU"],bo=function(n,e,t,r){for(var i=e.firstChild,A=void 0;i;i=A)if(A=i.nextSibling,_g(i)&&i.data.length>0)t.textNodes.push(new aU(n,i,t.styles));else if(mi(i))if(Ig(i)&&i.assignedNodes)i.assignedNodes().forEach(function(o){return bo(n,o,t,r)});else{var s=Bg(n,i);s.styles.isVisible()&&(vU(i,s,r)?s.flags|=4:yU(s.styles)&&(s.flags|=2),mU.indexOf(i.tagName)!==-1&&(s.flags|=8),t.elements.push(s),i.slot,i.shadowRoot?bo(n,i.shadowRoot,s,r):!Co(i)&&!Sg(i)&&!_o(i)&&bo(n,i,s,r))}},Bg=function(n,e){return Mu(e)?new pg(n,e):kg(e)?new fg(n,e):Sg(e)?new gg(n,e):wU(e)?new mg(n,e):bU(e)?new Qu(n,e):BU(e)?new Ru(n,e):_o(e)?new yg(n,e):Co(e)?new wg(n,e):Ug(e)?new bg(n,e):new Bn(n,e)},Cg=function(n,e){var t=Bg(n,e);return t.flags|=4,bo(n,e,t,t),t},vU=function(n,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Ou(n)&&t.styles.isTransparent()},yU=function(n){return n.isPositioned()||n.isFloating()},_g=function(n){return n.nodeType===Node.TEXT_NODE},mi=function(n){return n.nodeType===Node.ELEMENT_NODE},Pu=function(n){return mi(n)&&typeof n.style<"u"&&!Bo(n)},Bo=function(n){return typeof n.className=="object"},wU=function(n){return n.tagName==="LI"},bU=function(n){return n.tagName==="OL"},BU=function(n){return n.tagName==="INPUT"},CU=function(n){return n.tagName==="HTML"},Sg=function(n){return n.tagName==="svg"},Ou=function(n){return n.tagName==="BODY"},kg=function(n){return n.tagName==="CANVAS"},Eg=function(n){return n.tagName==="VIDEO"},Mu=function(n){return n.tagName==="IMG"},Ug=function(n){return n.tagName==="IFRAME"},Tg=function(n){return n.tagName==="STYLE"},_U=function(n){return n.tagName==="SCRIPT"},Co=function(n){return n.tagName==="TEXTAREA"},_o=function(n){return n.tagName==="SELECT"},Ig=function(n){return n.tagName==="SLOT"},Fg=function(n){return n.tagName.indexOf("-")>0},SU=function(){function n(){this.counters={}}return n.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},n.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},n.prototype.pop=function(e){var t=this;e.forEach(function(r){return t.counters[r].pop()})},n.prototype.parse=function(e){var t=this,r=e.counterIncrement,i=e.counterReset,A=!0;r!==null&&r.forEach(function(o){var a=t.counters[o.counter];a&&o.increment!==0&&(A=!1,a.length||a.push(1),a[Math.max(0,a.length-1)]+=o.increment)});var s=[];return A&&i.forEach(function(o){var a=t.counters[o.counter];s.push(o.counter),a||(a=t.counters[o.counter]=[]),a.push(o.reset)}),s},n}(),xg={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Qg={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u0554","\u0553","\u0552","\u0551","\u0550","\u054F","\u054E","\u054D","\u054C","\u054B","\u054A","\u0549","\u0548","\u0547","\u0546","\u0545","\u0544","\u0543","\u0542","\u0541","\u0540","\u053F","\u053E","\u053D","\u053C","\u053B","\u053A","\u0539","\u0538","\u0537","\u0536","\u0535","\u0534","\u0533","\u0532","\u0531"]},kU={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["\u05D9\u05F3","\u05D8\u05F3","\u05D7\u05F3","\u05D6\u05F3","\u05D5\u05F3","\u05D4\u05F3","\u05D3\u05F3","\u05D2\u05F3","\u05D1\u05F3","\u05D0\u05F3","\u05EA","\u05E9","\u05E8","\u05E7","\u05E6","\u05E4","\u05E2","\u05E1","\u05E0","\u05DE","\u05DC","\u05DB","\u05D9\u05D8","\u05D9\u05D7","\u05D9\u05D6","\u05D8\u05D6","\u05D8\u05D5","\u05D9","\u05D8","\u05D7","\u05D6","\u05D5","\u05D4","\u05D3","\u05D2","\u05D1","\u05D0"]},EU={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u10F5","\u10F0","\u10EF","\u10F4","\u10EE","\u10ED","\u10EC","\u10EB","\u10EA","\u10E9","\u10E8","\u10E7","\u10E6","\u10E5","\u10E4","\u10F3","\u10E2","\u10E1","\u10E0","\u10DF","\u10DE","\u10DD","\u10F2","\u10DC","\u10DB","\u10DA","\u10D9","\u10D8","\u10D7","\u10F1","\u10D6","\u10D5","\u10D4","\u10D3","\u10D2","\u10D1","\u10D0"]},vi=function(n,e,t,r,i,A){return n<e||n>t?xA(n,i,A.length>0):r.integers.reduce(function(s,o,a){for(;n>=o;)n-=o,s+=r.values[a];return s},"")+A},Rg=function(n,e,t,r){var i="";do t||n--,i=r(n)+i,n/=e;while(n*e>=e);return i},nt=function(n,e,t,r,i){var A=t-e+1;return(n<0?"-":"")+(Rg(Math.abs(n),A,r,function(s){return tt(Math.floor(s%A)+e)})+i)},Nr=function(n,e,t){t===void 0&&(t=". ");var r=e.length;return Rg(Math.abs(n),r,!1,function(i){return e[Math.floor(i%r)]})+t},yi=1,sr=2,or=4,FA=8,On=function(n,e,t,r,i,A){if(n<-9999||n>9999)return xA(n,4,i.length>0);var s=Math.abs(n),o=i;if(s===0)return e[0]+o;for(var a=0;s>0&&a<=4;a++){var c=s%10;c===0&&ut(A,yi)&&o!==""?o=e[c]+o:c>1||c===1&&a===0||c===1&&a===1&&ut(A,sr)||c===1&&a===1&&ut(A,or)&&n>100||c===1&&a>1&&ut(A,FA)?o=e[c]+(a>0?t[a-1]:"")+o:c===1&&a>0&&(o=t[a-1]+o),s=Math.floor(s/10)}return(n<0?r:"")+o},Pg="\u5341\u767E\u5343\u842C",Og="\u62FE\u4F70\u4EDF\u842C",Mg="\u30DE\u30A4\u30CA\u30B9",Lu="\uB9C8\uC774\uB108\uC2A4",xA=function(n,e,t){var r=t?". ":"",i=t?"\u3001":"",A=t?", ":"",s=t?" ":"";switch(e){case 0:return"\u2022"+s;case 1:return"\u25E6"+s;case 2:return"\u25FE"+s;case 5:var o=nt(n,48,57,!0,r);return o.length<4?"0".concat(o):o;case 4:return Nr(n,"\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",i);case 6:return vi(n,1,3999,xg,3,r).toLowerCase();case 7:return vi(n,1,3999,xg,3,r);case 8:return nt(n,945,969,!1,r);case 9:return nt(n,97,122,!1,r);case 10:return nt(n,65,90,!1,r);case 11:return nt(n,1632,1641,!0,r);case 12:case 49:return vi(n,1,9999,Qg,3,r);case 35:return vi(n,1,9999,Qg,3,r).toLowerCase();case 13:return nt(n,2534,2543,!0,r);case 14:case 30:return nt(n,6112,6121,!0,r);case 15:return Nr(n,"\u5B50\u4E11\u5BC5\u536F\u8FB0\u5DF3\u5348\u672A\u7533\u9149\u620C\u4EA5",i);case 16:return Nr(n,"\u7532\u4E59\u4E19\u4E01\u620A\u5DF1\u5E9A\u8F9B\u58EC\u7678",i);case 17:case 48:return On(n,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",Pg,"\u8CA0",i,sr|or|FA);case 47:return On(n,"\u96F6\u58F9\u8CB3\u53C3\u8086\u4F0D\u9678\u67D2\u634C\u7396",Og,"\u8CA0",i,yi|sr|or|FA);case 42:return On(n,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",Pg,"\u8D1F",i,sr|or|FA);case 41:return On(n,"\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396",Og,"\u8D1F",i,yi|sr|or|FA);case 26:return On(n,"\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u5341\u767E\u5343\u4E07",Mg,i,0);case 25:return On(n,"\u96F6\u58F1\u5F10\u53C2\u56DB\u4F0D\u516D\u4E03\u516B\u4E5D","\u62FE\u767E\u5343\u4E07",Mg,i,yi|sr|or);case 31:return On(n,"\uC601\uC77C\uC774\uC0BC\uC0AC\uC624\uC721\uCE60\uD314\uAD6C","\uC2ED\uBC31\uCC9C\uB9CC",Lu,A,yi|sr|or);case 33:return On(n,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u5341\u767E\u5343\u842C",Lu,A,0);case 32:return On(n,"\u96F6\u58F9\u8CB3\u53C3\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u62FE\u767E\u5343",Lu,A,yi|sr|or);case 18:return nt(n,2406,2415,!0,r);case 20:return vi(n,1,19999,EU,3,r);case 21:return nt(n,2790,2799,!0,r);case 22:return nt(n,2662,2671,!0,r);case 52:return vi(n,1,10999,kU,3,r);case 23:return Nr(n,"\u3042\u3044\u3046\u3048\u304A\u304B\u304D\u304F\u3051\u3053\u3055\u3057\u3059\u305B\u305D\u305F\u3061\u3064\u3066\u3068\u306A\u306B\u306C\u306D\u306E\u306F\u3072\u3075\u3078\u307B\u307E\u307F\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308A\u308B\u308C\u308D\u308F\u3090\u3091\u3092\u3093");case 24:return Nr(n,"\u3044\u308D\u306F\u306B\u307B\u3078\u3068\u3061\u308A\u306C\u308B\u3092\u308F\u304B\u3088\u305F\u308C\u305D\u3064\u306D\u306A\u3089\u3080\u3046\u3090\u306E\u304A\u304F\u3084\u307E\u3051\u3075\u3053\u3048\u3066\u3042\u3055\u304D\u3086\u3081\u307F\u3057\u3091\u3072\u3082\u305B\u3059");case 27:return nt(n,3302,3311,!0,r);case 28:return Nr(n,"\u30A2\u30A4\u30A6\u30A8\u30AA\u30AB\u30AD\u30AF\u30B1\u30B3\u30B5\u30B7\u30B9\u30BB\u30BD\u30BF\u30C1\u30C4\u30C6\u30C8\u30CA\u30CB\u30CC\u30CD\u30CE\u30CF\u30D2\u30D5\u30D8\u30DB\u30DE\u30DF\u30E0\u30E1\u30E2\u30E4\u30E6\u30E8\u30E9\u30EA\u30EB\u30EC\u30ED\u30EF\u30F0\u30F1\u30F2\u30F3",i);case 29:return Nr(n,"\u30A4\u30ED\u30CF\u30CB\u30DB\u30D8\u30C8\u30C1\u30EA\u30CC\u30EB\u30F2\u30EF\u30AB\u30E8\u30BF\u30EC\u30BD\u30C4\u30CD\u30CA\u30E9\u30E0\u30A6\u30F0\u30CE\u30AA\u30AF\u30E4\u30DE\u30B1\u30D5\u30B3\u30A8\u30C6\u30A2\u30B5\u30AD\u30E6\u30E1\u30DF\u30B7\u30F1\u30D2\u30E2\u30BB\u30B9",i);case 34:return nt(n,3792,3801,!0,r);case 37:return nt(n,6160,6169,!0,r);case 38:return nt(n,4160,4169,!0,r);case 39:return nt(n,2918,2927,!0,r);case 40:return nt(n,1776,1785,!0,r);case 43:return nt(n,3046,3055,!0,r);case 44:return nt(n,3174,3183,!0,r);case 45:return nt(n,3664,3673,!0,r);case 46:return nt(n,3872,3881,!0,r);case 3:default:return nt(n,48,57,!0,r)}},Lg="data-html2canvas-ignore",Dg=function(){function n(e,t,r){if(this.context=e,this.options=r,this.scrolledElements=[],this.referenceElement=t,this.counters=new SU,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return n.prototype.toIFrame=function(e,t){var r=this,i=UU(e,t);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var A=e.defaultView.pageXOffset,s=e.defaultView.pageYOffset,o=i.contentWindow,a=o.document,c=FU(i).then(function(){return Tt(r,void 0,void 0,function(){var l,d;return Ct(this,function(h){switch(h.label){case 0:return this.scrolledElements.forEach(PU),o&&(o.scrollTo(t.left,t.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(o.scrollY!==t.top||o.scrollX!==t.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-t.left,o.scrollY-t.top,0,0))),l=this.options.onclone,d=this.clonedReferenceElement,typeof d>"u"?[2,Promise.reject("Error finding the ".concat(this.referenceElement.nodeName," in the cloned document"))]:a.fonts&&a.fonts.ready?[4,a.fonts.ready]:[3,2];case 1:h.sent(),h.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,IU(a)]:[3,4];case 3:h.sent(),h.label=4;case 4:return typeof l=="function"?[2,Promise.resolve().then(function(){return l(a,d)}).then(function(){return i})]:[2,i]}})})}),u=a.adoptNode(this.documentElement);return NU(u,a),a.open(),a.write("".concat(QU(document.doctype),"<html></html>")),RU(this.referenceElement.ownerDocument,A,s),a.replaceChild(u,a.documentElement),a.close(),c},n.prototype.createElementClone=function(e){if(bu(e,2),kg(e))return this.createCanvasClone(e);if(Eg(e))return this.createVideoClone(e);if(Tg(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return Mu(t)&&(Mu(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager")),Fg(t)?this.createCustomElementClone(t):t},n.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return Du(e.style,t),t},n.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var r=[].slice.call(t.cssRules,0).reduce(function(A,s){return s&&typeof s.cssText=="string"?A+s.cssText:A},""),i=e.cloneNode(!1);return i.textContent=r,i}}catch(A){if(this.context.logger.error("Unable to access cssRules property",A),A.name!=="SecurityError")throw A}return e.cloneNode(!1)},n.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var r=e.ownerDocument.createElement("img");try{return r.src=e.toDataURL(),r}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var i=e.cloneNode(!1);try{i.width=e.width,i.height=e.height;var A=e.getContext("2d"),s=i.getContext("2d",{willReadFrequently:!0});if(s)if(!this.options.allowTaint&&A)s.putImageData(A.getImageData(0,0,e.width,e.height),0,0);else{var o=(t=e.getContext("webgl2"))!==null&&t!==void 0?t:e.getContext("webgl");if(o){var a=o.getContextAttributes();(a==null?void 0:a.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}s.drawImage(e,0,0)}return i}catch{this.context.logger.info("Unable to clone canvas as it is tainted",e)}return i},n.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var r=t.getContext("2d");try{return r&&(r.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||r.getImageData(0,0,t.width,t.height)),t}catch{this.context.logger.info("Unable to clone video as it is tainted",e)}var i=e.ownerDocument.createElement("canvas");return i.width=e.offsetWidth,i.height=e.offsetHeight,i},n.prototype.appendChildNode=function(e,t,r){(!mi(t)||!_U(t)&&!t.hasAttribute(Lg)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(t)))&&(!this.options.copyStyles||!mi(t)||!Tg(t))&&e.appendChild(this.cloneNode(t,r))},n.prototype.cloneChildNodes=function(e,t,r){for(var i=this,A=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;A;A=A.nextSibling)if(mi(A)&&Ig(A)&&typeof A.assignedNodes=="function"){var s=A.assignedNodes();s.length&&s.forEach(function(o){return i.appendChildNode(t,o,r)})}else this.appendChildNode(t,A,r)},n.prototype.cloneNode=function(e,t){if(_g(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var r=e.ownerDocument.defaultView;if(r&&mi(e)&&(Pu(e)||Bo(e))){var i=this.createElementClone(e);i.style.transitionProperty="none";var A=r.getComputedStyle(e),s=r.getComputedStyle(e,":before"),o=r.getComputedStyle(e,":after");this.referenceElement===e&&Pu(i)&&(this.clonedReferenceElement=i),Ou(i)&&LU(i);var a=this.counters.parse(new $f(this.context,A)),c=this.resolvePseudoContent(e,i,s,QA.BEFORE);Fg(e)&&(t=!0),Eg(e)||this.cloneChildNodes(e,i,t),c&&i.insertBefore(c,i.firstChild);var u=this.resolvePseudoContent(e,i,o,QA.AFTER);return u&&i.appendChild(u),this.counters.pop(a),(A&&(this.options.copyStyles||Bo(e))&&!Ug(e)||t)&&Du(A,i),(e.scrollTop!==0||e.scrollLeft!==0)&&this.scrolledElements.push([i,e.scrollLeft,e.scrollTop]),(Co(e)||_o(e))&&(Co(i)||_o(i))&&(i.value=e.value),i}return e.cloneNode(!1)},n.prototype.resolvePseudoContent=function(e,t,r,i){var A=this;if(r){var s=r.content,o=t.ownerDocument;if(!(!o||!s||s==="none"||s==="-moz-alt-content"||r.display==="none")){this.counters.parse(new $f(this.context,r));var a=new w1(this.context,r),c=o.createElement("html2canvaspseudoelement");Du(r,c),a.content.forEach(function(l){if(l.type===0)c.appendChild(o.createTextNode(l.value));else if(l.type===22){var d=o.createElement("img");d.src=l.value,d.style.opacity="1",c.appendChild(d)}else if(l.type===18){if(l.name==="attr"){var h=l.values.filter(ce);h.length&&c.appendChild(o.createTextNode(e.getAttribute(h[0].value)||""))}else if(l.name==="counter"){var f=l.values.filter(mt),p=f[0],g=f[1];if(p&&ce(p)){var v=A.counters.getCounterValue(p.value),y=g&&ce(g)?wu.parse(A.context,g.value):3;c.appendChild(o.createTextNode(xA(v,y,!1)))}}else if(l.name==="counters"){var B=l.values.filter(mt),p=B[0],b=B[1],g=B[2];if(p&&ce(p)){var w=A.counters.getCounterValues(p.value),_=g&&ce(g)?wu.parse(A.context,g.value):3,k=b&&b.type===0?b.value:"",F=w.map(function(T){return xA(T,_,!1)}).join(k);c.appendChild(o.createTextNode(F))}}}else if(l.type===20)switch(l.value){case"open-quote":c.appendChild(o.createTextNode(Zf(a.quotes,A.quoteDepth++,!0)));break;case"close-quote":c.appendChild(o.createTextNode(Zf(a.quotes,--A.quoteDepth,!1)));break;default:c.appendChild(o.createTextNode(l.value))}}),c.className="".concat(Nu," ").concat(Hu);var u=i===QA.BEFORE?" ".concat(Nu):" ".concat(Hu);return Bo(t)?t.className.baseValue+=u:t.className+=u,c}}},n.destroy=function(e){return e.parentNode?(e.parentNode.removeChild(e),!0):!1},n}(),QA;(function(n){n[n.BEFORE=0]="BEFORE",n[n.AFTER=1]="AFTER"})(QA||(QA={}));var UU=function(n,e){var t=n.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(Lg,"true"),n.body.appendChild(t),t},TU=function(n){return new Promise(function(e){if(n.complete){e();return}if(!n.src){e();return}n.onload=e,n.onerror=e})},IU=function(n){return Promise.all([].slice.call(n.images,0).map(TU))},FU=function(n){return new Promise(function(e,t){var r=n.contentWindow;if(!r)return t("No window assigned for iframe");var i=r.document;r.onload=n.onload=function(){r.onload=n.onload=null;var A=setInterval(function(){i.body.childNodes.length>0&&i.readyState==="complete"&&(clearInterval(A),e(n))},50)}})},xU=["all","d","content"],Du=function(n,e){for(var t=n.length-1;t>=0;t--){var r=n.item(t);xU.indexOf(r)===-1&&e.style.setProperty(r,n.getPropertyValue(r))}return e},QU=function(n){var e="";return n&&(e+="<!DOCTYPE ",n.name&&(e+=n.name),n.internalSubset&&(e+=n.internalSubset),n.publicId&&(e+='"'.concat(n.publicId,'"')),n.systemId&&(e+='"'.concat(n.systemId,'"')),e+=">"),e},RU=function(n,e,t){n&&n.defaultView&&(e!==n.defaultView.pageXOffset||t!==n.defaultView.pageYOffset)&&n.defaultView.scrollTo(e,t)},PU=function(n){var e=n[0],t=n[1],r=n[2];e.scrollLeft=t,e.scrollTop=r},OU=":before",MU=":after",Nu="___html2canvas___pseudoelement_before",Hu="___html2canvas___pseudoelement_after",Ng=`{
1
+ (function(){"use strict";function r_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Lp={exports:{}};(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function i(a,c,u){this.fn=a,this.context=c,this.once=u||!1}function A(a,c,u,l,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,l||a,d),f=t?t+c:c;return a._events[f]?a._events[f].fn?a._events[f]=[a._events[f],h]:a._events[f].push(h):(a._events[f]=h,a._eventsCount++),a}function s(a,c){--a._eventsCount===0?a._events=new r:delete a._events[c]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],u,l;if(this._eventsCount===0)return c;for(l in u=this._events)e.call(u,l)&&c.push(t?l.slice(1):l);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},o.prototype.listeners=function(c){var u=t?t+c:c,l=this._events[u];if(!l)return[];if(l.fn)return[l.fn];for(var d=0,h=l.length,f=new Array(h);d<h;d++)f[d]=l[d].fn;return f},o.prototype.listenerCount=function(c){var u=t?t+c:c,l=this._events[u];return l?l.fn?1:l.length:0},o.prototype.emit=function(c,u,l,d,h,f){var p=t?t+c:c;if(!this._events[p])return!1;var g=this._events[p],v=arguments.length,y,B;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),v){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,l),!0;case 4:return g.fn.call(g.context,u,l,d),!0;case 5:return g.fn.call(g.context,u,l,d,h),!0;case 6:return g.fn.call(g.context,u,l,d,h,f),!0}for(B=1,y=new Array(v-1);B<v;B++)y[B-1]=arguments[B];g.fn.apply(g.context,y)}else{var b=g.length,w;for(B=0;B<b;B++)switch(g[B].once&&this.removeListener(c,g[B].fn,void 0,!0),v){case 1:g[B].fn.call(g[B].context);break;case 2:g[B].fn.call(g[B].context,u);break;case 3:g[B].fn.call(g[B].context,u,l);break;case 4:g[B].fn.call(g[B].context,u,l,d);break;default:if(!y)for(w=1,y=new Array(v-1);w<v;w++)y[w-1]=arguments[w];g[B].fn.apply(g[B].context,y)}}return!0},o.prototype.on=function(c,u,l){return A(this,c,u,l,!1)},o.prototype.once=function(c,u,l){return A(this,c,u,l,!0)},o.prototype.removeListener=function(c,u,l,d){var h=t?t+c:c;if(!this._events[h])return this;if(!u)return s(this,h),this;var f=this._events[h];if(f.fn)f.fn===u&&(!d||f.once)&&(!l||f.context===l)&&s(this,h);else{for(var p=0,g=[],v=f.length;p<v;p++)(f[p].fn!==u||d&&!f[p].once||l&&f[p].context!==l)&&g.push(f[p]);g.length?this._events[h]=g.length===1?g[0]:g:s(this,h)}return this},o.prototype.removeAllListeners=function(c){var u;return c?(u=t?t+c:c,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,n.exports=o})(Lp);var i_=Lp.exports;const Gc=r_(i_);var jc=function(n,e){return jc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},jc(n,e)};function nn(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");jc(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Wc=function(){return Wc=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var A in t)Object.prototype.hasOwnProperty.call(t,A)&&(e[A]=t[A])}return e},Wc.apply(this,arguments)};function Tt(n,e,t,r){function i(A){return A instanceof t?A:new t(function(s){s(A)})}return new(t||(t=Promise))(function(A,s){function o(u){try{c(r.next(u))}catch(l){s(l)}}function a(u){try{c(r.throw(u))}catch(l){s(l)}}function c(u){u.done?A(u.value):i(u.value).then(o,a)}c((r=r.apply(n,e||[])).next())})}function Ct(n,e){var t={label:0,sent:function(){if(A[0]&1)throw A[1];return A[1]},trys:[],ops:[]},r,i,A,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(u){return a([c,u])}}function a(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(t=0)),t;)try{if(r=1,i&&(A=c[0]&2?i.return:c[0]?i.throw||((A=i.return)&&A.call(i),0):i.next)&&!(A=A.call(i,c[1])).done)return A;switch(i=0,A&&(c=[c[0]&2,A.value]),c[0]){case 0:case 1:A=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,i=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(A=t.trys,!(A=A.length>0&&A[A.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!A||c[1]>A[0]&&c[1]<A[3])){t.label=c[1];break}if(c[0]===6&&t.label<A[1]){t.label=A[1],A=c;break}if(A&&t.label<A[2]){t.label=A[2],t.ops.push(c);break}A[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(u){c=[6,u],i=0}finally{r=A=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function xs(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,A;r<i;r++)(A||!(r in e))&&(A||(A=Array.prototype.slice.call(e,0,r)),A[r]=e[r]);return n.concat(A||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;for(var Rn=function(){function n(e,t,r,i){this.left=e,this.top=t,this.width=r,this.height=i}return n.prototype.add=function(e,t,r,i){return new n(this.left+e,this.top+t,this.width+r,this.height+i)},n.fromClientRect=function(e,t){return new n(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)},n.fromDOMRectList=function(e,t){var r=Array.from(t).find(function(i){return i.width!==0});return r?new n(r.left+e.windowBounds.left,r.top+e.windowBounds.top,r.width,r.height):n.EMPTY},n.EMPTY=new n(0,0,0,0),n}(),Qs=function(n,e){return Rn.fromClientRect(n,e.getBoundingClientRect())},A_=function(n){var e=n.body,t=n.documentElement;if(!e||!t)throw new Error("Unable to get document size");var r=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),i=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight));return new Rn(0,0,r,i)},Rs=function(n){for(var e=[],t=0,r=n.length;t<r;){var i=n.charCodeAt(t++);if(i>=55296&&i<=56319&&t<r){var A=n.charCodeAt(t++);(A&64512)===56320?e.push(((i&1023)<<10)+(A&1023)+65536):(e.push(i),t--)}else e.push(i)}return e},tt=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,n);var t=n.length;if(!t)return"";for(var r=[],i=-1,A="";++i<t;){var s=n[i];s<=65535?r.push(s):(s-=65536,r.push((s>>10)+55296,s%1024+56320)),(i+1===t||r.length>16384)&&(A+=String.fromCharCode.apply(String,r),r.length=0)}return A},Dp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s_=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ps=0;Ps<Dp.length;Ps++)s_[Dp.charCodeAt(Ps)]=Ps;for(var Np="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pA=typeof Uint8Array>"u"?[]:new Uint8Array(256),Os=0;Os<Np.length;Os++)pA[Np.charCodeAt(Os)]=Os;for(var o_=function(n){var e=n.length*.75,t=n.length,r,i=0,A,s,o,a;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);var c=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),u=Array.isArray(c)?c:new Uint8Array(c);for(r=0;r<t;r+=4)A=pA[n.charCodeAt(r)],s=pA[n.charCodeAt(r+1)],o=pA[n.charCodeAt(r+2)],a=pA[n.charCodeAt(r+3)],u[i++]=A<<2|s>>4,u[i++]=(s&15)<<4|o>>2,u[i++]=(o&3)<<6|a&63;return c},a_=function(n){for(var e=n.length,t=[],r=0;r<e;r+=2)t.push(n[r+1]<<8|n[r]);return t},c_=function(n){for(var e=n.length,t=[],r=0;r<e;r+=4)t.push(n[r+3]<<24|n[r+2]<<16|n[r+1]<<8|n[r]);return t},Rr=5,qc=6+5,Jc=2,u_=qc-Rr,Hp=65536>>Rr,l_=1<<Rr,zc=l_-1,d_=1024>>Rr,h_=Hp+d_,p_=h_,f_=32,g_=p_+f_,m_=65536>>qc,v_=1<<u_,y_=v_-1,Kp=function(n,e,t){return n.slice?n.slice(e,t):new Uint16Array(Array.prototype.slice.call(n,e,t))},w_=function(n,e,t){return n.slice?n.slice(e,t):new Uint32Array(Array.prototype.slice.call(n,e,t))},b_=function(n,e){var t=o_(n),r=Array.isArray(t)?c_(t):new Uint32Array(t),i=Array.isArray(t)?a_(t):new Uint16Array(t),A=24,s=Kp(i,A/2,r[4]/2),o=r[5]===2?Kp(i,(A+r[4])/2):w_(r,Math.ceil((A+r[4])/4));return new B_(r[0],r[1],r[2],r[3],s,o)},B_=function(){function n(e,t,r,i,A,s){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=i,this.index=A,this.data=s}return n.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>Rr],t=(t<<Jc)+(e&zc),this.data[t];if(e<=65535)return t=this.index[Hp+(e-55296>>Rr)],t=(t<<Jc)+(e&zc),this.data[t];if(e<this.highStart)return t=g_-m_+(e>>qc),t=this.index[t],t+=e>>Rr&y_,t=this.index[t],t=(t<<Jc)+(e&zc),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},n}(),Vp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C_=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ms=0;Ms<Vp.length;Ms++)C_[Vp.charCodeAt(Ms)]=Ms;var __="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",Gp=50,S_=1,jp=2,Wp=3,k_=4,E_=5,qp=7,Jp=8,zp=9,Zn=10,Xc=11,Xp=12,Yc=13,U_=14,fA=15,Zc=16,Ls=17,gA=18,T_=19,Yp=20,$c=21,mA=22,eu=23,di=24,jt=25,vA=26,yA=27,hi=28,I_=29,Pr=30,F_=31,Ds=32,Ns=33,tu=34,nu=35,ru=36,wA=37,iu=38,Hs=39,Ks=40,Au=41,Zp=42,x_=43,Q_=[9001,65288],$p="!",Ae="\xD7",Vs="\xF7",su=b_(__),Pn=[Pr,ru],ou=[S_,jp,Wp,E_],ef=[Zn,Jp],tf=[yA,vA],R_=ou.concat(ef),nf=[iu,Hs,Ks,tu,nu],P_=[fA,Yc],O_=function(n,e){e===void 0&&(e="strict");var t=[],r=[],i=[];return n.forEach(function(A,s){var o=su.get(A);if(o>Gp?(i.push(!0),o-=Gp):i.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(A)!==-1)return r.push(s),t.push(Zc);if(o===k_||o===Xc){if(s===0)return r.push(s),t.push(Pr);var a=t[s-1];return R_.indexOf(a)===-1?(r.push(r[s-1]),t.push(a)):(r.push(s),t.push(Pr))}if(r.push(s),o===F_)return t.push(e==="strict"?$c:wA);if(o===Zp||o===I_)return t.push(Pr);if(o===x_)return A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(wA):t.push(Pr);t.push(o)}),[r,t,i]},au=function(n,e,t,r){var i=r[t];if(Array.isArray(n)?n.indexOf(i)!==-1:n===i)for(var A=t;A<=r.length;){A++;var s=r[A];if(s===e)return!0;if(s!==Zn)break}if(i===Zn)for(var A=t;A>0;){A--;var o=r[A];if(Array.isArray(n)?n.indexOf(o)!==-1:n===o)for(var a=t;a<=r.length;){a++;var s=r[a];if(s===e)return!0;if(s!==Zn)break}if(o!==Zn)break}return!1},rf=function(n,e){for(var t=n;t>=0;){var r=e[t];if(r===Zn)t--;else return r}return 0},M_=function(n,e,t,r,i){if(t[r]===0)return Ae;var A=r-1;if(Array.isArray(i)&&i[A]===!0)return Ae;var s=A-1,o=A+1,a=e[A],c=s>=0?e[s]:0,u=e[o];if(a===jp&&u===Wp)return Ae;if(ou.indexOf(a)!==-1)return $p;if(ou.indexOf(u)!==-1||ef.indexOf(u)!==-1)return Ae;if(rf(A,e)===Jp)return Vs;if(su.get(n[A])===Xc||(a===Ds||a===Ns)&&su.get(n[o])===Xc||a===qp||u===qp||a===zp||[Zn,Yc,fA].indexOf(a)===-1&&u===zp||[Ls,gA,T_,di,hi].indexOf(u)!==-1||rf(A,e)===mA||au(eu,mA,A,e)||au([Ls,gA],$c,A,e)||au(Xp,Xp,A,e))return Ae;if(a===Zn)return Vs;if(a===eu||u===eu)return Ae;if(u===Zc||a===Zc)return Vs;if([Yc,fA,$c].indexOf(u)!==-1||a===U_||c===ru&&P_.indexOf(a)!==-1||a===hi&&u===ru||u===Yp||Pn.indexOf(u)!==-1&&a===jt||Pn.indexOf(a)!==-1&&u===jt||a===yA&&[wA,Ds,Ns].indexOf(u)!==-1||[wA,Ds,Ns].indexOf(a)!==-1&&u===vA||Pn.indexOf(a)!==-1&&tf.indexOf(u)!==-1||tf.indexOf(a)!==-1&&Pn.indexOf(u)!==-1||[yA,vA].indexOf(a)!==-1&&(u===jt||[mA,fA].indexOf(u)!==-1&&e[o+1]===jt)||[mA,fA].indexOf(a)!==-1&&u===jt||a===jt&&[jt,hi,di].indexOf(u)!==-1)return Ae;if([jt,hi,di,Ls,gA].indexOf(u)!==-1)for(var l=A;l>=0;){var d=e[l];if(d===jt)return Ae;if([hi,di].indexOf(d)!==-1)l--;else break}if([yA,vA].indexOf(u)!==-1)for(var l=[Ls,gA].indexOf(a)!==-1?s:A;l>=0;){var d=e[l];if(d===jt)return Ae;if([hi,di].indexOf(d)!==-1)l--;else break}if(iu===a&&[iu,Hs,tu,nu].indexOf(u)!==-1||[Hs,tu].indexOf(a)!==-1&&[Hs,Ks].indexOf(u)!==-1||[Ks,nu].indexOf(a)!==-1&&u===Ks||nf.indexOf(a)!==-1&&[Yp,vA].indexOf(u)!==-1||nf.indexOf(u)!==-1&&a===yA||Pn.indexOf(a)!==-1&&Pn.indexOf(u)!==-1||a===di&&Pn.indexOf(u)!==-1||Pn.concat(jt).indexOf(a)!==-1&&u===mA&&Q_.indexOf(n[o])===-1||Pn.concat(jt).indexOf(u)!==-1&&a===gA)return Ae;if(a===Au&&u===Au){for(var h=t[A],f=1;h>0&&(h--,e[h]===Au);)f++;if(f%2!==0)return Ae}return a===Ds&&u===Ns?Ae:Vs},L_=function(n,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=O_(n,e.lineBreak),r=t[0],i=t[1],A=t[2];(e.wordBreak==="break-all"||e.wordBreak==="break-word")&&(i=i.map(function(o){return[jt,Pr,Zp].indexOf(o)!==-1?wA:o}));var s=e.wordBreak==="keep-all"?A.map(function(o,a){return o&&n[a]>=19968&&n[a]<=40959}):void 0;return[r,i,s]},D_=function(){function n(e,t,r,i){this.codePoints=e,this.required=t===$p,this.start=r,this.end=i}return n.prototype.slice=function(){return tt.apply(void 0,this.codePoints.slice(this.start,this.end))},n}(),N_=function(n,e){var t=Rs(n),r=L_(t,e),i=r[0],A=r[1],s=r[2],o=t.length,a=0,c=0;return{next:function(){if(c>=o)return{done:!0,value:null};for(var u=Ae;c<o&&(u=M_(t,A,i,++c,s))===Ae;);if(u!==Ae||c===o){var l=new D_(t,u,a,c);return a=c,{value:l,done:!1}}return{done:!0,value:null}}}},H_=1,K_=2,bA=4,Af=8,Gs=10,sf=47,BA=92,V_=9,G_=32,js=34,CA=61,j_=35,W_=36,q_=37,Ws=39,qs=40,_A=41,J_=95,Pt=45,z_=33,X_=60,Y_=62,Z_=64,$_=91,eS=93,tS=61,nS=123,Js=63,rS=125,of=124,iS=126,AS=128,af=65533,cu=42,Or=43,sS=44,oS=58,aS=59,SA=46,cS=0,uS=8,lS=11,dS=14,hS=31,pS=127,vn=-1,cf=48,uf=97,lf=101,fS=102,gS=117,mS=122,df=65,hf=69,pf=70,vS=85,yS=90,_t=function(n){return n>=cf&&n<=57},wS=function(n){return n>=55296&&n<=57343},pi=function(n){return _t(n)||n>=df&&n<=pf||n>=uf&&n<=fS},bS=function(n){return n>=uf&&n<=mS},BS=function(n){return n>=df&&n<=yS},CS=function(n){return bS(n)||BS(n)},_S=function(n){return n>=AS},zs=function(n){return n===Gs||n===V_||n===G_},Xs=function(n){return CS(n)||_S(n)||n===J_},ff=function(n){return Xs(n)||_t(n)||n===Pt},SS=function(n){return n>=cS&&n<=uS||n===lS||n>=dS&&n<=hS||n===pS},$n=function(n,e){return n!==BA?!1:e!==Gs},Ys=function(n,e,t){return n===Pt?Xs(e)||$n(e,t):Xs(n)?!0:!!(n===BA&&$n(n,e))},uu=function(n,e,t){return n===Or||n===Pt?_t(e)?!0:e===SA&&_t(t):_t(n===SA?e:n)},kS=function(n){var e=0,t=1;(n[e]===Or||n[e]===Pt)&&(n[e]===Pt&&(t=-1),e++);for(var r=[];_t(n[e]);)r.push(n[e++]);var i=r.length?parseInt(tt.apply(void 0,r),10):0;n[e]===SA&&e++;for(var A=[];_t(n[e]);)A.push(n[e++]);var s=A.length,o=s?parseInt(tt.apply(void 0,A),10):0;(n[e]===hf||n[e]===lf)&&e++;var a=1;(n[e]===Or||n[e]===Pt)&&(n[e]===Pt&&(a=-1),e++);for(var c=[];_t(n[e]);)c.push(n[e++]);var u=c.length?parseInt(tt.apply(void 0,c),10):0;return t*(i+o*Math.pow(10,-s))*Math.pow(10,a*u)},ES={type:2},US={type:3},TS={type:4},IS={type:13},FS={type:8},xS={type:21},QS={type:9},RS={type:10},PS={type:11},OS={type:12},MS={type:14},Zs={type:23},LS={type:1},DS={type:25},NS={type:24},HS={type:26},KS={type:27},VS={type:28},GS={type:29},jS={type:31},lu={type:32},gf=function(){function n(){this._value=[]}return n.prototype.write=function(e){this._value=this._value.concat(Rs(e))},n.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==lu;)e.push(t),t=this.consumeToken();return e},n.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case js:return this.consumeStringToken(js);case j_:var t=this.peekCodePoint(0),r=this.peekCodePoint(1),i=this.peekCodePoint(2);if(ff(t)||$n(r,i)){var A=Ys(t,r,i)?K_:H_,s=this.consumeName();return{type:5,value:s,flags:A}}break;case W_:if(this.peekCodePoint(0)===CA)return this.consumeCodePoint(),IS;break;case Ws:return this.consumeStringToken(Ws);case qs:return ES;case _A:return US;case cu:if(this.peekCodePoint(0)===CA)return this.consumeCodePoint(),MS;break;case Or:if(uu(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case sS:return TS;case Pt:var o=e,a=this.peekCodePoint(0),c=this.peekCodePoint(1);if(uu(o,a,c))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(Ys(o,a,c))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(a===Pt&&c===Y_)return this.consumeCodePoint(),this.consumeCodePoint(),NS;break;case SA:if(uu(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case sf:if(this.peekCodePoint(0)===cu)for(this.consumeCodePoint();;){var u=this.consumeCodePoint();if(u===cu&&(u=this.consumeCodePoint(),u===sf))return this.consumeToken();if(u===vn)return this.consumeToken()}break;case oS:return HS;case aS:return KS;case X_:if(this.peekCodePoint(0)===z_&&this.peekCodePoint(1)===Pt&&this.peekCodePoint(2)===Pt)return this.consumeCodePoint(),this.consumeCodePoint(),DS;break;case Z_:var l=this.peekCodePoint(0),d=this.peekCodePoint(1),h=this.peekCodePoint(2);if(Ys(l,d,h)){var s=this.consumeName();return{type:7,value:s}}break;case $_:return VS;case BA:if($n(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case eS:return GS;case tS:if(this.peekCodePoint(0)===CA)return this.consumeCodePoint(),FS;break;case nS:return PS;case rS:return OS;case gS:case vS:var f=this.peekCodePoint(0),p=this.peekCodePoint(1);return f===Or&&(pi(p)||p===Js)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case of:if(this.peekCodePoint(0)===CA)return this.consumeCodePoint(),QS;if(this.peekCodePoint(0)===of)return this.consumeCodePoint(),xS;break;case iS:if(this.peekCodePoint(0)===CA)return this.consumeCodePoint(),RS;break;case vn:return lu}return zs(e)?(this.consumeWhiteSpace(),jS):_t(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):Xs(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:tt(e)}},n.prototype.consumeCodePoint=function(){var e=this._value.shift();return typeof e>"u"?-1:e},n.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},n.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},n.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();pi(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var r=!1;t===Js&&e.length<6;)e.push(t),t=this.consumeCodePoint(),r=!0;if(r){var i=parseInt(tt.apply(void 0,e.map(function(a){return a===Js?cf:a})),16),A=parseInt(tt.apply(void 0,e.map(function(a){return a===Js?pf:a})),16);return{type:30,start:i,end:A}}var s=parseInt(tt.apply(void 0,e),16);if(this.peekCodePoint(0)===Pt&&pi(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var o=[];pi(t)&&o.length<6;)o.push(t),t=this.consumeCodePoint();var A=parseInt(tt.apply(void 0,o),16);return{type:30,start:s,end:A}}else return{type:30,start:s,end:s}},n.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return e.toLowerCase()==="url"&&this.peekCodePoint(0)===qs?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===qs?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},n.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===vn)return{type:22,value:""};var t=this.peekCodePoint(0);if(t===Ws||t===js){var r=this.consumeStringToken(this.consumeCodePoint());return r.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===vn||this.peekCodePoint(0)===_A)?(this.consumeCodePoint(),{type:22,value:r.value}):(this.consumeBadUrlRemnants(),Zs)}for(;;){var i=this.consumeCodePoint();if(i===vn||i===_A)return{type:22,value:tt.apply(void 0,e)};if(zs(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===vn||this.peekCodePoint(0)===_A?(this.consumeCodePoint(),{type:22,value:tt.apply(void 0,e)}):(this.consumeBadUrlRemnants(),Zs);if(i===js||i===Ws||i===qs||SS(i))return this.consumeBadUrlRemnants(),Zs;if(i===BA)if($n(i,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),Zs;else e.push(i)}},n.prototype.consumeWhiteSpace=function(){for(;zs(this.peekCodePoint(0));)this.consumeCodePoint()},n.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===_A||e===vn)return;$n(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},n.prototype.consumeStringSlice=function(e){for(var t=5e4,r="";e>0;){var i=Math.min(t,e);r+=tt.apply(void 0,this._value.splice(0,i)),e-=i}return this._value.shift(),r},n.prototype.consumeStringToken=function(e){var t="",r=0;do{var i=this._value[r];if(i===vn||i===void 0||i===e)return t+=this.consumeStringSlice(r),{type:0,value:t};if(i===Gs)return this._value.splice(0,r),LS;if(i===BA){var A=this._value[r+1];A!==vn&&A!==void 0&&(A===Gs?(t+=this.consumeStringSlice(r),r=-1,this._value.shift()):$n(i,A)&&(t+=this.consumeStringSlice(r),t+=tt(this.consumeEscapedCodePoint()),r=-1))}r++}while(!0)},n.prototype.consumeNumber=function(){var e=[],t=bA,r=this.peekCodePoint(0);for((r===Or||r===Pt)&&e.push(this.consumeCodePoint());_t(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(r===SA&&_t(i))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=Af;_t(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0),i=this.peekCodePoint(1);var A=this.peekCodePoint(2);if((r===hf||r===lf)&&((i===Or||i===Pt)&&_t(A)||_t(i)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=Af;_t(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[kS(e),t]},n.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],r=e[1],i=this.peekCodePoint(0),A=this.peekCodePoint(1),s=this.peekCodePoint(2);if(Ys(i,A,s)){var o=this.consumeName();return{type:15,number:t,flags:r,unit:o}}return i===q_?(this.consumeCodePoint(),{type:16,number:t,flags:r}):{type:17,number:t,flags:r}},n.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(pi(e)){for(var t=tt(e);pi(this.peekCodePoint(0))&&t.length<6;)t+=tt(this.consumeCodePoint());zs(this.peekCodePoint(0))&&this.consumeCodePoint();var r=parseInt(t,16);return r===0||wS(r)||r>1114111?af:r}return e===vn?af:e},n.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(ff(t))e+=tt(t);else if($n(t,this.peekCodePoint(0)))e+=tt(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),e}},n}(),mf=function(){function n(e){this._tokens=e}return n.create=function(e){var t=new gf;return t.write(e),new n(t.read())},n.parseValue=function(e){return n.create(e).parseComponentValue()},n.parseValues=function(e){return n.create(e).parseComponentValues()},n.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===31;)e=this.consumeToken();if(e.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},n.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(t.type===32)return e;e.push(t),e.push()}},n.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},n.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},r=this.consumeToken();;){if(r.type===32||qS(r,e))return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue()),r=this.consumeToken()}},n.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var r=this.consumeToken();if(r.type===32||r.type===3)return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue())}},n.prototype.consumeToken=function(){var e=this._tokens.shift();return typeof e>"u"?lu:e},n.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},n}(),er=function(n){return n.type===15},ot=function(n){return n.type===17},ce=function(n){return n.type===20},WS=function(n){return n.type===0},du=function(n,e){return ce(n)&&n.value===e},vf=function(n){return n.type!==31},mt=function(n){return n.type!==31&&n.type!==4},yn=function(n){var e=[],t=[];return n.forEach(function(r){if(r.type===4){if(t.length===0)throw new Error("Error parsing function args, zero tokens for arg");e.push(t),t=[];return}r.type!==31&&t.push(r)}),t.length&&e.push(t),e},qS=function(n,e){return e===11&&n.type===12||e===28&&n.type===29?!0:e===2&&n.type===3},tr=function(n){return n.type===17||n.type===15},Pe=function(n){return n.type===16||tr(n)},yf=function(n){return n.length>1?[n[0],n[1]]:[n[0]]},vt={type:17,number:0,flags:bA},hu={type:16,number:50,flags:bA},nr={type:16,number:100,flags:bA},kA=function(n,e,t){var r=n[0],i=n[1];return[ke(r,e),ke(typeof i<"u"?i:r,t)]},ke=function(n,e){if(n.type===16)return n.number/100*e;if(er(n))switch(n.unit){case"rem":case"em":return 16*n.number;case"px":default:return n.number}return n.number},wf="deg",bf="grad",Bf="rad",Cf="turn",$s={name:"angle",parse:function(n,e){if(e.type===15)switch(e.unit){case wf:return Math.PI*e.number/180;case bf:return Math.PI/200*e.number;case Bf:return e.number;case Cf:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},_f=function(n){return n.type===15&&(n.unit===wf||n.unit===bf||n.unit===Bf||n.unit===Cf)},Sf=function(n){var e=n.filter(ce).map(function(t){return t.value}).join(" ");switch(e){case"to bottom right":case"to right bottom":case"left top":case"top left":return[vt,vt];case"to top":case"bottom":return qt(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[vt,nr];case"to right":case"left":return qt(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[nr,nr];case"to bottom":case"top":return qt(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[nr,vt];case"to left":case"right":return qt(270)}return 0},qt=function(n){return Math.PI*n/180},rr=function(n){return(255&n)===0},pt=function(n){var e=255&n,t=255&n>>8,r=255&n>>16,i=255&n>>24;return e<255?"rgba(".concat(i,",").concat(r,",").concat(t,",").concat(e/255,")"):"rgb(".concat(i,",").concat(r,",").concat(t,")")},wn=function(n,e,t,r){return(n<<24|e<<16|t<<8|Math.round(r*255)<<0)>>>0},eo=function(n,e){if(n.type===17)return n.number;if(n.type===16){var t=e===3?1:255;return e===3?n.number/100*t:Math.round(n.number/100*t)}return 0},Mr=function(n){return(n[0].type===20?n[0].value:"unknown")==="from"},ze=function(n,e,t){return Math.min(Math.max(n,e),t)},Ot=function(n,e){return[n[0]*e[0]+n[1]*e[1]+n[2]*e[2],n[3]*e[0]+n[4]*e[1]+n[5]*e[2],n[6]*e[0]+n[7]*e[1]+n[8]*e[2]]},JS=function(n){return wn(ze(Math.round(n[0]*255),0,255),ze(Math.round(n[1]*255),0,255),ze(Math.round(n[2]*255),0,255),ze(n[3],0,1))},pu=function(n){var e=n[0],t=n[1],r=n[2],i=n[3],A=Lr([e,t,r]);return wn(ze(Math.round(A[0]*255),0,255),ze(Math.round(A[1]*255),0,255),ze(Math.round(A[2]*255),0,255),i)},EA=function(n){var e=ir([n[0],n[1],n[2]]);return pu([e[0],e[1],e[2],n[3]])},zS=function(n,e){if(Mr(e.filter(mt)))throw new Error("Relative color not supported for lab()");var t=to(e),r=t[0],i=t[1],A=t[2],s=t[3],o=Lr(ir(io([r,i,A])));return wn(ze(Math.round(o[0]*255),0,255),ze(Math.round(o[1]*255),0,255),ze(Math.round(o[2]*255),0,255),s)},XS=function(n,e){if(Mr(e.filter(mt)))throw new Error("Relative color not supported for oklab()");var t=to(e),r=t[0],i=t[1],A=t[2],s=t[3],o=Lr(ir(ro([r,i,A])));return wn(ze(Math.round(o[0]*255),0,255),ze(Math.round(o[1]*255),0,255),ze(Math.round(o[2]*255),0,255),s)},YS=function(n,e){if(Mr(e.filter(mt)))throw new Error("Relative color not supported for oklch()");var t=Tf(e),r=t[0],i=t[1],A=t[2],s=t[3],o=Lr(ir(ro(no([r,i,A]))));return wn(ze(Math.round(o[0]*255),0,255),ze(Math.round(o[1]*255),0,255),ze(Math.round(o[2]*255),0,255),s)},ZS=function(n,e){if(Mr(e.filter(mt)))throw new Error("Relative color not supported for lch()");var t=Uf(e),r=t[0],i=t[1],A=t[2],s=t[3],o=Lr(ir(io(no([r,i,A]))));return wn(ze(Math.round(o[0]*255),0,255),ze(Math.round(o[1]*255),0,255),ze(Math.round(o[2]*255),0,255),s)},kf=function(n,e){var t=e.filter(mt),r=t[0],i=t[1],A=t[2],s=t[3],o=(r.type===17?qt(r.number):$s.parse(n,r))/(Math.PI*2),a=Pe(i)?i.number/100:0,c=Pe(A)?A.number/100:0,u=typeof s<"u"&&Pe(s)?ke(s,1):1;return[o,a,c,u]},Ef=function(n,e){if(Mr(e))throw new Error("Relative color not supported for hsl()");var t=kf(n,e),r=t[0],i=t[1],A=t[2],s=t[3],o=Ff([r,i,A]);return wn(o[0]*255,o[1]*255,o[2]*255,i===0?1:s)},Uf=function(n){var e=n.filter(mt),t=Pe(e[0])?e[0].number:0,r=Pe(e[1])?e[1].number:0,i=ot(e[2])||er(e[2])?e[2].number:0,A=typeof e[4]<"u"&&Pe(e[4])?ke(e[4],1):1;return[t,r,i,A]},to=function(n){var e=n.filter(mt),t=e[0].type===16?e[0].number/100:ot(e[0])?e[0].number:0,r=e[1].type===16?e[1].number/100:ot(e[1])?e[1].number:0,i=ot(e[2])||er(e[2])?e[2].number:0,A=typeof e[4]<"u"&&Pe(e[4])?ke(e[4],1):1;return[t,r,i,A]},Tf=function(n){var e=n.filter(mt),t=e[0].type===16?e[0].number/100:ot(e[0])?e[0].number:0,r=e[1].type===16?e[1].number/100:ot(e[1])?e[1].number:0,i=ot(e[2])||er(e[2])?e[2].number:0,A=typeof e[4]<"u"&&Pe(e[4])?ke(e[4],1):1;return[t,r,i,A]},If=function(n){return Ot([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],n)},fu=function(n){return Ot([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],n)},gu=function(n,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-n)*t*6+n:t<1/2?e:t<2/3?(e-n)*6*(2/3-t)+n:n},Ff=function(n){var e=n[0],t=n[1],r=n[2];if(t===0)return[r*255,r*255,r*255];var i=r<=.5?r*(t+1):r+t-r*t,A=r*2-i,s=gu(A,i,e+1/3),o=gu(A,i,e),a=gu(A,i,e-1/3);return[s,o,a]},no=function(n){var e=n[0],t=n[1],r=n[2];return t<0&&(t=0),isNaN(r)&&(r=0),[e,t*Math.cos(r*Math.PI/180),t*Math.sin(r*Math.PI/180)]},ro=function(n){var e=Ot([1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092],n),t=e.map(function(r){return Math.pow(r,3)});return Ot([1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],t)},io=function(n){var e=(n[0]+16)/116,t=n[1]/500+e,r=e-n[2]/200,i=24389/27,A=24/116,s=[(t>A?Math.pow(t,3):(116*t-16)/i)*.3457/.3585,n[0]>8?Math.pow(e,3):n[0]/i,(r>A?Math.pow(r,3):(116*r-16)/i)*(1-.3457-.3585)/.3585];return fu([s[0],s[1],s[2]])},$S=function(n,e){var t=e.filter(mt);if(t.length===3){var r=t.map(eo),i=r[0],A=r[1],s=r[2],o=vu([i/255,A/255,s/255]),a=mu([o[0],o[1],o[2]]),c=a[0],u=a[1],l=a[2];return[c,u,l,1]}if(t.length===4){var d=t.map(eo),i=d[0],A=d[1],s=d[2],h=d[3],o=vu([i/255,A/255,s/255]),f=mu([o[0],o[1],o[2]]),c=f[0],u=f[1],l=f[2];return[c,u,l,h]}return[0,0,0,1]},ek=function(n,e){var t=kf(n,e),r=t[0],i=t[1],A=t[2],s=t[3],o=vu(Ff([r,i,A])),a=mu([o[0],o[1],o[2]]),c=a[0],u=a[1],l=a[2];return[c,u,l,s]},tk=function(n,e){var t=to(e),r=t[0],i=t[1],A=t[2],s=t[3],o=io([r,i,A]),a=o[0],c=o[1],u=o[2];return[a,c,u,s]},nk=function(n,e){var t=Uf(e),r=t[0],i=t[1],A=t[2],s=t[3],o=io(no([r,i,A])),a=o[0],c=o[1],u=o[2];return[a,c,u,s]},rk=function(n,e){var t=Tf(e),r=t[0],i=t[1],A=t[2],s=t[3],o=ro(no([r,i,A])),a=o[0],c=o[1],u=o[2];return[a,c,u,s]},ik=function(n,e){var t=to(e),r=t[0],i=t[1],A=t[2],s=t[3],o=ro([r,i,A]),a=o[0],c=o[1],u=o[2];return[a,c,u,s]},Ak=function(n){return fu([n[0],n[1],n[2]])},xf=function(n){return n},sk=function(n){var e=If([n[0],n[2],n[3]]),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},Qf=function(n){return EA([n[0],n[1],n[2],n[3]])},ok=function(n){var e=Ak([n[0],n[1],n[2]]);return EA([e[0],e[1],e[2],n[3]])},ir=function(n){return Ot([3.2409699419045226,-1.537383177570094,-.4986107602930034,-.9692436362808796,1.8759675015077202,.04155505740717559,.05563007969699366,-.20397695888897652,1.0569715142428786],n)},mu=function(n){return Ot([.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],n)},Lr=function(n){return n.map(function(e){var t=e<0?-1:1,r=Math.abs(e);return r>.0031308?t*(1.055*Math.pow(r,1/2.4)-.055):12.92*e})},vu=function(n){return n.map(function(e){var t=e<0?-1:1,r=Math.abs(e);return r<=.04045?e/12.92:t*Math.pow((r+.055)/1.055,2.4)})},ak=function(n){var e=Lr(ir([n[0],n[1],n[2]])),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},ck=function(n){var e=ir([n[0],n[1],n[2]]),t=e[0],r=e[1],i=e[2];return[ze(Math.round(t*255),0,255),ze(Math.round(r*255),0,255),ze(Math.round(i*255),0,255),n[3]]},uk=function(n){return Ot([.4865709486482162,.26566769316909306,.1982172852343625,.2289745640697488,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],n)},lk=function(n){return Ot([2.493496911941425,-.9313836179191239,-.40271078445071684,-.8294889695615747,1.7626640603183463,.023624685841943577,.03584583024378447,-.07617238926804182,.9568845240076872],n)},dk=function(n){return n.map(function(e){var t=e<0?-1:1,r=e*t;return r<=.04045?e/12.92:t*Math.pow((e+.055)/1.055,2.4)||0})},hk=function(n){return Lr(n)},pk=function(n){var e=dk([n[0],n[1],n[2]]);return uk([e[0],e[1],e[2]])},fk=function(n){var e=hk(lk([n[0],n[1],n[2]])),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},gk=function(n){var e=pk([n[0],n[1],n[2]]);return EA([e[0],e[1],e[2],n[3]])},mk=function(n){return Ot([2.0415879038107465,-.5650069742788596,-.34473135077832956,-.9692436362808795,1.8759675015077202,.04155505740717557,.013444280632031142,-.11836239223101838,1.0151749943912054],n)},vk=function(n){return Ot([.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.0752914584939978,.02703136138641234,.07068885253582723,.9913375368376388],n)},yk=function(n){var e=n.map(function(t){var r=t<0?-1:1,i=Math.abs(t);return r*Math.pow(i,2.19921875)});return[e[0],e[1],e[2]]},wk=function(n){var e=n.map(function(t){var r=t<0?-1:1,i=Math.abs(t);return r*Math.pow(i,.4547069271758437)});return[e[0],e[1],e[2]]},bk=function(n){var e=wk(mk([n[0],n[1],n[2]])),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},Bk=function(n){var e=ir(vk(yk([n[0],n[1],n[2]])));return pu([e[0],e[1],e[2],n[3]])},Ck=function(n){return Ot([.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602],n)},_k=function(n){return Ot([1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452],n)},Sk=function(n){return n.map(function(e){return e<16/512?e/16:Math.pow(e,1.8)})},kk=function(n){return n.map(function(e){return e>1/512?Math.pow(e,1/1.8):e*16})},Ek=function(n){var e=Sk([n[0],n[1],n[2]]);return fu(Ck([e[0],e[1],e[2]]))},Uk=function(n){var e=kk(_k(If([n[0],n[1],n[2]]))),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},Tk=function(n){var e=Ek([n[0],n[1],n[2]]);return EA([e[0],e[1],e[2],n[3]])},Ao=1.09929682680944,Rf=.018053968510807,Ik=function(n){return n.map(function(e){return e<Rf*4.5?e/4.5:Math.pow((e+Ao-1)/Ao,1/.45)})},Fk=function(n){return n.map(function(e){return e>=Rf?Ao*Math.pow(e,.45)-(Ao-1):4.5*e})},xk=function(n){return Ot([.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.060985057710791],n)},Qk=function(n){return Ot([1.716651187971268,-.355670783776392,-.25336628137366,-.666684351832489,1.616481236634939,.0157685458139111,.017639857445311,-.042770613257809,.942103121235474],n)},Rk=function(n){var e=Ik([n[0],n[1],n[2]]);return xk([e[0],e[1],e[2]])},Pk=function(n){var e=Fk(Qk([n[0],n[1],n[2]])),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},Ok=function(n){var e=Rk([n[0],n[1],n[2]]);return EA([e[0],e[1],e[2],n[3]])},Ar={name:"color",parse:function(n,e){if(e.type===18){var t=Nk[e.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported color function "'.concat(e.name,'"'));return t(n,e.values)}if(e.type===5){var r=Pf(e),i=r[0],A=r[1],s=r[2],o=r[3];return wn(i,A,s,o)}if(e.type===20){var a=bn[e.value.toUpperCase()];if(typeof a<"u")return a}return bn.TRANSPARENT}},Pf=function(n){if(n.value.length===3){var e=n.value.substring(0,1),t=n.value.substring(1,2),r=n.value.substring(2,3);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(r+r,16),1]}if(n.value.length===4){var e=n.value.substring(0,1),t=n.value.substring(1,2),r=n.value.substring(2,3),i=n.value.substring(3,4);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(r+r,16),parseInt(i+i,16)/255]}if(n.value.length===6){var e=n.value.substring(0,2),t=n.value.substring(2,4),r=n.value.substring(4,6);return[parseInt(e,16),parseInt(t,16),parseInt(r,16),1]}if(n.value.length===8){var e=n.value.substring(0,2),t=n.value.substring(2,4),r=n.value.substring(4,6),i=n.value.substring(6,8);return[parseInt(e,16),parseInt(t,16),parseInt(r,16),parseInt(i,16)/255]}return[0,0,0,1]},Of=function(n,e){var t=e.filter(mt);if(Mr(t))throw new Error("Relative color not supported for rgb()");if(t.length===3){var r=t.map(eo),i=r[0],A=r[1],s=r[2];return wn(i,A,s,1)}if(t.length===4){var o=t.map(eo),i=o[0],A=o[1],s=o[2],a=o[3];return wn(i,A,s,a)}return 0},Mk=function(n,e){var t=e.filter(mt),r=t[0].type===20?t[0].value:"unknown",i=!Mr(t);if(i){var A=r,s=Mf[A];if(typeof s>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(A,'" for color() function'));var o=ot(t[1])?t[1].number:0,a=ot(t[2])?t[2].number:0,c=ot(t[3])?t[3].number:0,u=t.length>4&&t[4].type===6&&t[4].value==="/"&&ot(t[5])?t[5].number:1;return s([o,a,c,u])}else{var l=function(H,q){if(ot(q))return q.number;var ve=function(Be){return Be==="r"||Be==="x"?0:Be==="g"||Be==="y"?1:2};if(ce(q)){var Y=ve(q.value);return H[Y]}var ie=function(Be){for(var ht=Be.filter(mt),Re="(",Ne=0,ne=ht;Ne<ne.length;Ne++){var et=ne[Ne];Re+=et.type===18&&et.name==="calc"?ie(et.values):ot(et)?et.number:et.type===6||ce(et)?et.value:""}return Re+=")",Re};if(q.type===18){var Qe=q.values.filter(mt);if(q.name==="calc"){var qe=ie(Qe).replace(/r|x/,H[0].toString()).replace(/g|y/,H[1].toString()).replace(/b|z/,H[2].toString());return new Function("return "+qe)()}}return null},d=t[1].type===18?t[1].name:ce(t[1])||t[1].type===5?"rgb":"unknown",h=ce(t[2])?t[2].value:"unknown",f=t[1].type===18?t[1].values:ce(t[1])?[t[1]]:[];if(ce(t[1])){var p=bn[t[1].value.toUpperCase()];if(typeof p>"u")throw new Error("Attempting to use unknown color in relative color 'from'");var g=fi(n,t[1].value),v=255&g,y=255&g>>8,B=255&g>>16,b=255&g>>24;f=[{type:17,number:b,flags:1},{type:17,number:B,flags:1},{type:17,number:y,flags:1},{type:17,number:v>1?v/255:v,flags:1}]}else if(t[1].type===5){var w=Pf(t[1]),b=w[0],B=w[1],y=w[2],v=w[3];f=[{type:17,number:b,flags:1},{type:17,number:B,flags:1},{type:17,number:y,flags:1},{type:17,number:v>1?v/255:v,flags:1}]}if(f.length===0)throw new Error("Attempting to use unknown color in relative color 'from'");if(h==="unknown")throw new Error("Attempting to use unknown colorspace in relative color 'to'");var _=Lk[d],k=Dk[h],F=Mf[h];if(typeof _>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(d,'" for color() function'));if(typeof k>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(h,'" for color() function'));var x=_(n,f),E=k(x),o=l(E,t[3]),a=l(E,t[4]),c=l(E,t[5]),u=t.length>6&&t[6].type===6&&t[6].value==="/"&&ot(t[7])?t[7].number:1;if(o===null||a===null||c===null)throw new Error("Invalid relative color in color() function");return F([o,a,c,u])}},Mf={srgb:JS,"srgb-linear":pu,"display-p3":gk,"a98-rgb":Bk,"prophoto-rgb":Tk,xyz:Qf,"xyz-d50":ok,"xyz-d65":Qf,rec2020:Ok},Lk={rgb:$S,hsl:ek,lab:tk,lch:nk,oklab:ik,oklch:rk},Dk={srgb:ak,"srgb-linear":ck,"display-p3":fk,"a98-rgb":bk,"prophoto-rgb":Uk,xyz:xf,"xyz-d50":sk,"xyz-d65":xf,rec2020:Pk},Nk={hsl:Ef,hsla:Ef,rgb:Of,rgba:Of,lch:ZS,oklch:YS,oklab:XS,lab:zS,color:Mk},fi=function(n,e){return Ar.parse(n,mf.create(e).parseComponentValue())},bn={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},Hk={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(n,e){return e.map(function(t){if(ce(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Kk={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},so=function(n,e){var t=Ar.parse(n,e[0]),r=e[1];return r&&Pe(r)?{color:t,stop:r}:{color:t,stop:null}},Lf=function(n,e){var t=n[0],r=n[n.length-1];t.stop===null&&(t.stop=vt),r.stop===null&&(r.stop=nr);for(var i=[],A=0,s=0;s<n.length;s++){var o=n[s].stop;if(o!==null){var a=ke(o,e);a>A?i.push(a):i.push(A),A=a}else i.push(null)}for(var c=null,s=0;s<i.length;s++){var u=i[s];if(u===null)c===null&&(c=s);else if(c!==null){for(var l=s-c,d=i[c-1],h=(u-d)/(l+1),f=1;f<=l;f++)i[c+f-1]=h*f;c=null}}return n.map(function(p,g){var v=p.color;return{color:v,stop:Math.max(Math.min(1,i[g]/e),0)}})},Vk=function(n,e,t){var r=e/2,i=t/2,A=ke(n[0],e)-r,s=i-ke(n[1],t);return(Math.atan2(s,A)+Math.PI*2)%(Math.PI*2)},Gk=function(n,e,t){var r=typeof n=="number"?n:Vk(n,e,t),i=Math.abs(e*Math.sin(r))+Math.abs(t*Math.cos(r)),A=e/2,s=t/2,o=i/2,a=Math.sin(r-Math.PI/2)*o,c=Math.cos(r-Math.PI/2)*o;return[i,A-c,A+c,s-a,s+a]},rn=function(n,e){return Math.sqrt(n*n+e*e)},Df=function(n,e,t,r,i){var A=[[0,0],[0,e],[n,0],[n,e]];return A.reduce(function(s,o){var a=o[0],c=o[1],u=rn(t-a,r-c);return(i?u<s.optimumDistance:u>s.optimumDistance)?{optimumCorner:o,optimumDistance:u}:s},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},jk=function(n,e,t,r,i){var A=0,s=0;switch(n.size){case 0:n.shape===0?A=s=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-i)):n.shape===1&&(A=Math.min(Math.abs(e),Math.abs(e-r)),s=Math.min(Math.abs(t),Math.abs(t-i)));break;case 2:if(n.shape===0)A=s=Math.min(rn(e,t),rn(e,t-i),rn(e-r,t),rn(e-r,t-i));else if(n.shape===1){var o=Math.min(Math.abs(t),Math.abs(t-i))/Math.min(Math.abs(e),Math.abs(e-r)),a=Df(r,i,e,t,!0),c=a[0],u=a[1];A=rn(c-e,(u-t)/o),s=o*A}break;case 1:n.shape===0?A=s=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-i)):n.shape===1&&(A=Math.max(Math.abs(e),Math.abs(e-r)),s=Math.max(Math.abs(t),Math.abs(t-i)));break;case 3:if(n.shape===0)A=s=Math.max(rn(e,t),rn(e,t-i),rn(e-r,t),rn(e-r,t-i));else if(n.shape===1){var o=Math.max(Math.abs(t),Math.abs(t-i))/Math.max(Math.abs(e),Math.abs(e-r)),l=Df(r,i,e,t,!1),c=l[0],u=l[1];A=rn(c-e,(u-t)/o),s=o*A}break}return Array.isArray(n.size)&&(A=ke(n.size[0],r),s=n.size.length===2?ke(n.size[1],i):A),[A,s]},Wk=function(n,e){var t=qt(180),r=[];return yn(e).forEach(function(i,A){if(A===0){var s=i[0];if(s.type===20&&s.value==="to"){t=Sf(i);return}else if(_f(s)){t=$s.parse(n,s);return}}var o=so(n,i);r.push(o)}),{angle:t,stops:r,type:1}},oo=function(n,e){var t=qt(180),r=[];return yn(e).forEach(function(i,A){if(A===0){var s=i[0];if(s.type===20&&["top","left","right","bottom"].indexOf(s.value)!==-1){t=Sf(i);return}else if(_f(s)){t=($s.parse(n,s)+qt(270))%qt(360);return}}var o=so(n,i);r.push(o)}),{angle:t,stops:r,type:1}},qk=function(n,e){var t=qt(180),r=[],i=1,A=0,s=3,o=[];return yn(e).forEach(function(a,c){var u=a[0];if(c===0){if(ce(u)&&u.value==="linear"){i=1;return}else if(ce(u)&&u.value==="radial"){i=2;return}}if(u.type===18){if(u.name==="from"){var l=Ar.parse(n,u.values[0]);r.push({stop:vt,color:l})}else if(u.name==="to"){var l=Ar.parse(n,u.values[0]);r.push({stop:nr,color:l})}else if(u.name==="color-stop"){var d=u.values.filter(mt);if(d.length===2){var l=Ar.parse(n,d[1]),h=d[0];ot(h)&&r.push({stop:{type:16,number:h.number*100,flags:h.flags},color:l})}}}}),i===1?{angle:(t+qt(180))%qt(360),stops:r,type:i}:{size:s,shape:A,stops:r,position:o,type:i}},Nf="closest-side",Hf="farthest-side",Kf="closest-corner",Vf="farthest-corner",Gf="circle",jf="ellipse",Wf="cover",qf="contain",Jk=function(n,e){var t=0,r=3,i=[],A=[];return yn(e).forEach(function(s,o){var a=!0;if(o===0){var c=!1;a=s.reduce(function(l,d){if(c)if(ce(d))switch(d.value){case"center":return A.push(hu),l;case"top":case"left":return A.push(vt),l;case"right":case"bottom":return A.push(nr),l}else(Pe(d)||tr(d))&&A.push(d);else if(ce(d))switch(d.value){case Gf:return t=0,!1;case jf:return t=1,!1;case"at":return c=!0,!1;case Nf:return r=0,!1;case Wf:case Hf:return r=1,!1;case qf:case Kf:return r=2,!1;case Vf:return r=3,!1}else if(tr(d)||Pe(d))return Array.isArray(r)||(r=[]),r.push(d),!1;return l},a)}if(a){var u=so(n,s);i.push(u)}}),{size:r,shape:t,stops:i,position:A,type:2}},ao=function(n,e){var t=0,r=3,i=[],A=[];return yn(e).forEach(function(s,o){var a=!0;if(o===0?a=s.reduce(function(u,l){if(ce(l))switch(l.value){case"center":return A.push(hu),!1;case"top":case"left":return A.push(vt),!1;case"right":case"bottom":return A.push(nr),!1}else if(Pe(l)||tr(l))return A.push(l),!1;return u},a):o===1&&(a=s.reduce(function(u,l){if(ce(l))switch(l.value){case Gf:return t=0,!1;case jf:return t=1,!1;case qf:case Nf:return r=0,!1;case Hf:return r=1,!1;case Kf:return r=2,!1;case Wf:case Vf:return r=3,!1}else if(tr(l)||Pe(l))return Array.isArray(r)||(r=[]),r.push(l),!1;return u},a)),a){var c=so(n,s);i.push(c)}}),{size:r,shape:t,stops:i,position:A,type:2}},zk=function(n){return n.type===1},Xk=function(n){return n.type===2},yu={name:"image",parse:function(n,e){if(e.type===22){var t={url:e.value,type:0};return n.cache.addImage(e.value),t}if(e.type===18){var r=Jf[e.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported image function "'.concat(e.name,'"'));return r(n,e.values)}throw new Error("Unsupported image type ".concat(e.type))}};function Yk(n){return!(n.type===20&&n.value==="none")&&(n.type!==18||!!Jf[n.name])}var Jf={"linear-gradient":Wk,"-moz-linear-gradient":oo,"-ms-linear-gradient":oo,"-o-linear-gradient":oo,"-webkit-linear-gradient":oo,"radial-gradient":Jk,"-moz-radial-gradient":ao,"-ms-radial-gradient":ao,"-o-radial-gradient":ao,"-webkit-radial-gradient":ao,"-webkit-gradient":qk},Zk={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(n,e){if(e.length===0)return[];var t=e[0];return t.type===20&&t.value==="none"?[]:e.filter(function(r){return mt(r)&&Yk(r)}).map(function(r){return yu.parse(n,r)})}},$k={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(n,e){return e.map(function(t){if(ce(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},eE={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(n,e){return yn(e).map(function(t){return t.filter(Pe)}).map(yf)}},tE={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(n,e){return yn(e).map(function(t){return t.filter(ce).map(function(r){return r.value}).join(" ")}).map(nE)}},nE=function(n){switch(n){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},gi;(function(n){n.AUTO="auto",n.CONTAIN="contain",n.COVER="cover"})(gi||(gi={}));var rE={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(n,e){return yn(e).map(function(t){return t.filter(iE)})}},iE=function(n){return ce(n)||Pe(n)},co=function(n){return{name:"border-".concat(n,"-color"),initialValue:"transparent",prefix:!1,type:3,format:"color"}},AE=co("top"),sE=co("right"),oE=co("bottom"),aE=co("left"),uo=function(n){return{name:"border-radius-".concat(n),initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return yf(t.filter(Pe))}}},cE=uo("top-left"),uE=uo("top-right"),lE=uo("bottom-right"),dE=uo("bottom-left"),lo=function(n){return{name:"border-".concat(n,"-style"),initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},hE=lo("top"),pE=lo("right"),fE=lo("bottom"),gE=lo("left"),ho=function(n){return{name:"border-".concat(n,"-width"),initialValue:"0",type:0,prefix:!1,parse:function(e,t){return er(t)?t.number:0}}},mE=ho("top"),vE=ho("right"),yE=ho("bottom"),wE=ho("left"),bE={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},BE={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(n,e){switch(e){case"rtl":return 1;case"ltr":default:return 0}}},CE={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(n,e){return e.filter(ce).reduce(function(t,r){return t|_E(r.value)},0)}},_E=function(n){switch(n){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},SE={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},kE={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(n,e){return e.type===20&&e.value==="normal"?0:e.type===17||e.type===15?e.number:0}},po;(function(n){n.NORMAL="normal",n.STRICT="strict"})(po||(po={}));var EE={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"strict":return po.STRICT;case"normal":default:return po.NORMAL}}},UE={name:"line-height",initialValue:"normal",prefix:!1,type:4},zf=function(n,e){return ce(n)&&n.value==="normal"?1.2*e:n.type===17?e*n.number:Pe(n)?ke(n,e):e},TE={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(n,e){return e.type===20&&e.value==="none"?null:yu.parse(n,e)}},IE={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(n,e){switch(e){case"inside":return 0;case"outside":default:return 1}}},wu={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 52;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},fo=function(n){return{name:"margin-".concat(n),initialValue:"0",prefix:!1,type:4}},FE=fo("top"),xE=fo("right"),QE=fo("bottom"),RE=fo("left"),PE={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(n,e){return e.filter(ce).map(function(t){switch(t.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},OE={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"break-word":return"break-word";case"normal":default:return"normal"}}},go=function(n){return{name:"padding-".concat(n),initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},ME=go("top"),LE=go("right"),DE=go("bottom"),NE=go("left"),HE={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(n,e){switch(e){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},KE={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(n,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},VE={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(n,e){return e.length===1&&du(e[0],"none")?[]:yn(e).map(function(t){for(var r={color:bn.TRANSPARENT,offsetX:vt,offsetY:vt,blur:vt},i=0,A=0;A<t.length;A++){var s=t[A];tr(s)?(i===0?r.offsetX=s:i===1?r.offsetY=s:r.blur=s,i++):r.color=Ar.parse(n,s)}return r})}},GE={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},jE={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(n,e){if(e.type===20&&e.value==="none")return null;if(e.type===18){var t=JE[e.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported transform function "'.concat(e.name,'"'));return t(e.values)}return null}},WE=function(n){var e=n.filter(function(t){return t.type===17}).map(function(t){return t.number});return e.length===6?e:null},qE=function(n){var e=n.filter(function(a){return a.type===17}).map(function(a){return a.number}),t=e[0],r=e[1];e[2],e[3];var i=e[4],A=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var s=e[12],o=e[13];return e[14],e[15],e.length===16?[t,r,i,A,s,o]:null},JE={matrix:WE,matrix3d:qE},Xf={type:16,number:50,flags:bA},zE=[Xf,Xf],XE={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(n,e){var t=e.filter(Pe);return t.length!==2?zE:[t[0],t[1]]}},YE={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},UA;(function(n){n.NORMAL="normal",n.BREAK_ALL="break-all",n.KEEP_ALL="keep-all"})(UA||(UA={}));for(var ZE={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"break-all":return UA.BREAK_ALL;case"keep-all":return UA.KEEP_ALL;case"normal":default:return UA.NORMAL}}},$E={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(n,e){if(e.type===20)return{auto:!0,order:0};if(ot(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},Yf={name:"time",parse:function(n,e){if(e.type===15)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},e1={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(n,e){return ot(e)?e.number:1}},t1={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},n1={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(n,e){return e.filter(ce).map(function(t){switch(t.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(t){return t!==0})}},r1={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(n,e){var t=[],r=[];return e.forEach(function(i){switch(i.type){case 20:case 0:t.push(i.value);break;case 17:t.push(i.number.toString());break;case 4:r.push(t.join(" ")),t.length=0;break}}),t.length&&r.push(t.join(" ")),r.map(function(i){return i.indexOf(" ")===-1?i:"'".concat(i,"'")})}},i1={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},A1={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(n,e){if(ot(e))return e.number;if(ce(e))switch(e.value){case"bold":return 700;case"normal":default:return 400}return 400}},s1={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(n,e){return e.filter(ce).map(function(t){return t.value})}},o1={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},ut=function(n,e){return(n&e)!==0},a1={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(n,e){if(e.length===0)return[];var t=e[0];return t.type===20&&t.value==="none"?[]:e}},c1={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(n,e){if(e.length===0)return null;var t=e[0];if(t.type===20&&t.value==="none")return null;for(var r=[],i=e.filter(vf),A=0;A<i.length;A++){var s=i[A],o=i[A+1];if(s.type===20){var a=o&&ot(o)?o.number:1;r.push({counter:s.value,increment:a})}}return r}},u1={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(n,e){if(e.length===0)return[];for(var t=[],r=e.filter(vf),i=0;i<r.length;i++){var A=r[i],s=r[i+1];if(ce(A)&&A.value!=="none"){var o=s&&ot(s)?s.number:0;t.push({counter:A.value,reset:o})}}return t}},l1={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(n,e){return e.filter(er).map(function(t){return Yf.parse(n,t)})}},d1={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(n,e){if(e.length===0)return null;var t=e[0];if(t.type===20&&t.value==="none")return null;var r=[],i=e.filter(WS);if(i.length%2!==0)return null;for(var A=0;A<i.length;A+=2){var s=i[A].value,o=i[A+1].value;r.push({open:s,close:o})}return r}},Zf=function(n,e,t){if(!n)return"";var r=n[Math.min(e,n.length-1)];return r?t?r.open:r.close:""},h1={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(n,e){return e.length===1&&du(e[0],"none")?[]:yn(e).map(function(t){for(var r={color:255,offsetX:vt,offsetY:vt,blur:vt,spread:vt,inset:!1},i=0,A=0;A<t.length;A++){var s=t[A];du(s,"inset")?r.inset=!0:tr(s)?(i===0?r.offsetX=s:i===1?r.offsetY=s:i===2?r.blur=s:r.spread=s,i++):r.color=Ar.parse(n,s)}return r})}},p1={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(n,e){var t=[0,1,2],r=[];return e.filter(ce).forEach(function(i){switch(i.value){case"stroke":r.push(1);break;case"fill":r.push(0);break;case"markers":r.push(2);break}}),t.forEach(function(i){r.indexOf(i)===-1&&r.push(i)}),r}},f1={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},g1={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(n,e){return er(e)?e.number:0}},m1={name:"objectFit",initialValue:"fill",prefix:!1,type:1,parse:function(n,e){return e.filter(ce).reduce(function(t,r){return t|v1(r.value)},0)}},v1=function(n){switch(n){case"contain":return 2;case"cover":return 4;case"none":return 8;case"scale-down":return 16}return 0},y1=function(){function n(e,t){var r,i;this.animationDuration=j(e,l1,t.animationDuration),this.backgroundClip=j(e,Hk,t.backgroundClip),this.backgroundColor=j(e,Kk,t.backgroundColor),this.backgroundImage=j(e,Zk,t.backgroundImage),this.backgroundOrigin=j(e,$k,t.backgroundOrigin),this.backgroundPosition=j(e,eE,t.backgroundPosition),this.backgroundRepeat=j(e,tE,t.backgroundRepeat),this.backgroundSize=j(e,rE,t.backgroundSize),this.borderTopColor=j(e,AE,t.borderTopColor),this.borderRightColor=j(e,sE,t.borderRightColor),this.borderBottomColor=j(e,oE,t.borderBottomColor),this.borderLeftColor=j(e,aE,t.borderLeftColor),this.borderTopLeftRadius=j(e,cE,t.borderTopLeftRadius),this.borderTopRightRadius=j(e,uE,t.borderTopRightRadius),this.borderBottomRightRadius=j(e,lE,t.borderBottomRightRadius),this.borderBottomLeftRadius=j(e,dE,t.borderBottomLeftRadius),this.borderTopStyle=j(e,hE,t.borderTopStyle),this.borderRightStyle=j(e,pE,t.borderRightStyle),this.borderBottomStyle=j(e,fE,t.borderBottomStyle),this.borderLeftStyle=j(e,gE,t.borderLeftStyle),this.borderTopWidth=j(e,mE,t.borderTopWidth),this.borderRightWidth=j(e,vE,t.borderRightWidth),this.borderBottomWidth=j(e,yE,t.borderBottomWidth),this.borderLeftWidth=j(e,wE,t.borderLeftWidth),this.boxShadow=j(e,h1,t.boxShadow),this.color=j(e,bE,t.color),this.direction=j(e,BE,t.direction),this.display=j(e,CE,t.display),this.float=j(e,SE,t.cssFloat),this.fontFamily=j(e,r1,t.fontFamily),this.fontSize=j(e,i1,t.fontSize),this.fontStyle=j(e,o1,t.fontStyle),this.fontVariant=j(e,s1,t.fontVariant),this.fontWeight=j(e,A1,t.fontWeight),this.letterSpacing=j(e,kE,t.letterSpacing),this.lineBreak=j(e,EE,t.lineBreak),this.lineHeight=j(e,UE,t.lineHeight),this.listStyleImage=j(e,TE,t.listStyleImage),this.listStylePosition=j(e,IE,t.listStylePosition),this.listStyleType=j(e,wu,t.listStyleType),this.marginTop=j(e,FE,t.marginTop),this.marginRight=j(e,xE,t.marginRight),this.marginBottom=j(e,QE,t.marginBottom),this.marginLeft=j(e,RE,t.marginLeft),this.opacity=j(e,e1,t.opacity);var A=j(e,PE,t.overflow);this.overflowX=A[0],this.overflowY=A[A.length>1?1:0],this.overflowWrap=j(e,OE,t.overflowWrap),this.paddingTop=j(e,ME,t.paddingTop),this.paddingRight=j(e,LE,t.paddingRight),this.paddingBottom=j(e,DE,t.paddingBottom),this.paddingLeft=j(e,NE,t.paddingLeft),this.paintOrder=j(e,p1,t.paintOrder),this.position=j(e,KE,t.position),this.textAlign=j(e,HE,t.textAlign),this.textDecorationColor=j(e,t1,(r=t.textDecorationColor)!==null&&r!==void 0?r:t.color),this.textDecorationLine=j(e,n1,(i=t.textDecorationLine)!==null&&i!==void 0?i:t.textDecoration),this.textShadow=j(e,VE,t.textShadow),this.textTransform=j(e,GE,t.textTransform),this.transform=j(e,jE,t.transform),this.transformOrigin=j(e,XE,t.transformOrigin),this.visibility=j(e,YE,t.visibility),this.webkitTextStrokeColor=j(e,f1,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=j(e,g1,t.webkitTextStrokeWidth),this.wordBreak=j(e,ZE,t.wordBreak),this.zIndex=j(e,$E,t.zIndex),this.objectFit=j(e,m1,t.objectFit)}return n.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},n.prototype.isTransparent=function(){return rr(this.backgroundColor)},n.prototype.isTransformed=function(){return this.transform!==null},n.prototype.isPositioned=function(){return this.position!==0},n.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},n.prototype.isFloating=function(){return this.float!==0},n.prototype.isInlineLevel=function(){return ut(this.display,4)||ut(this.display,33554432)||ut(this.display,268435456)||ut(this.display,536870912)||ut(this.display,67108864)||ut(this.display,134217728)},n}(),w1=function(){function n(e,t){this.content=j(e,a1,t.content),this.quotes=j(e,d1,t.quotes)}return n}(),$f=function(){function n(e,t){this.counterIncrement=j(e,c1,t.counterIncrement),this.counterReset=j(e,u1,t.counterReset)}return n}(),j=function(n,e,t){var r=new gf,i=t!==null&&typeof t<"u"?t.toString():e.initialValue;r.write(i);var A=new mf(r.read());switch(e.type){case 2:var s=A.parseComponentValue();return e.parse(n,ce(s)?s.value:e.initialValue);case 0:return e.parse(n,A.parseComponentValue());case 1:return e.parse(n,A.parseComponentValues());case 4:return A.parseComponentValue();case 3:switch(e.format){case"angle":return $s.parse(n,A.parseComponentValue());case"color":return Ar.parse(n,A.parseComponentValue());case"image":return yu.parse(n,A.parseComponentValue());case"length":var o=A.parseComponentValue();return tr(o)?o:vt;case"length-percentage":var a=A.parseComponentValue();return Pe(a)?a:vt;case"time":return Yf.parse(n,A.parseComponentValue())}break}},b1="data-html2canvas-debug",B1=function(n){var e=n.getAttribute(b1);switch(e){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},bu=function(n,e){var t=B1(n);return t===1||e===t},Bn=function(){function n(e,t){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,bu(t,3),this.styles=new y1(e,window.getComputedStyle(t,null)),Pu(t)&&(this.styles.animationDuration.some(function(r){return r>0})&&(t.style.animationDuration="0s"),this.styles.transform!==null&&(t.style.transform="none")),this.bounds=Qs(this.context,t),bu(t,4)&&(this.flags|=16)}return n}(),C1="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",eg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",TA=typeof Uint8Array>"u"?[]:new Uint8Array(256),mo=0;mo<eg.length;mo++)TA[eg.charCodeAt(mo)]=mo;for(var _1=function(n){var e=n.length*.75,t=n.length,r,i=0,A,s,o,a;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);var c=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),u=Array.isArray(c)?c:new Uint8Array(c);for(r=0;r<t;r+=4)A=TA[n.charCodeAt(r)],s=TA[n.charCodeAt(r+1)],o=TA[n.charCodeAt(r+2)],a=TA[n.charCodeAt(r+3)],u[i++]=A<<2|s>>4,u[i++]=(s&15)<<4|o>>2,u[i++]=(o&3)<<6|a&63;return c},S1=function(n){for(var e=n.length,t=[],r=0;r<e;r+=2)t.push(n[r+1]<<8|n[r]);return t},k1=function(n){for(var e=n.length,t=[],r=0;r<e;r+=4)t.push(n[r+3]<<24|n[r+2]<<16|n[r+1]<<8|n[r]);return t},Dr=5,Bu=6+5,Cu=2,E1=Bu-Dr,tg=65536>>Dr,U1=1<<Dr,_u=U1-1,T1=1024>>Dr,I1=tg+T1,F1=I1,x1=32,Q1=F1+x1,R1=65536>>Bu,P1=1<<E1,O1=P1-1,ng=function(n,e,t){return n.slice?n.slice(e,t):new Uint16Array(Array.prototype.slice.call(n,e,t))},M1=function(n,e,t){return n.slice?n.slice(e,t):new Uint32Array(Array.prototype.slice.call(n,e,t))},L1=function(n,e){var t=_1(n),r=Array.isArray(t)?k1(t):new Uint32Array(t),i=Array.isArray(t)?S1(t):new Uint16Array(t),A=24,s=ng(i,A/2,r[4]/2),o=r[5]===2?ng(i,(A+r[4])/2):M1(r,Math.ceil((A+r[4])/4));return new D1(r[0],r[1],r[2],r[3],s,o)},D1=function(){function n(e,t,r,i,A,s){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=i,this.index=A,this.data=s}return n.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>Dr],t=(t<<Cu)+(e&_u),this.data[t];if(e<=65535)return t=this.index[tg+(e-55296>>Dr)],t=(t<<Cu)+(e&_u),this.data[t];if(e<this.highStart)return t=Q1-R1+(e>>Bu),t=this.index[t],t+=e>>Dr&O1,t=this.index[t],t=(t<<Cu)+(e&_u),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},n}(),rg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N1=typeof Uint8Array>"u"?[]:new Uint8Array(256),vo=0;vo<rg.length;vo++)N1[rg.charCodeAt(vo)]=vo;var H1=1,Su=2,ku=3,ig=4,Ag=5,K1=7,sg=8,Eu=9,Uu=10,og=11,ag=12,cg=13,ug=14,Tu=15,V1=function(n){for(var e=[],t=0,r=n.length;t<r;){var i=n.charCodeAt(t++);if(i>=55296&&i<=56319&&t<r){var A=n.charCodeAt(t++);(A&64512)===56320?e.push(((i&1023)<<10)+(A&1023)+65536):(e.push(i),t--)}else e.push(i)}return e},G1=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,n);var t=n.length;if(!t)return"";for(var r=[],i=-1,A="";++i<t;){var s=n[i];s<=65535?r.push(s):(s-=65536,r.push((s>>10)+55296,s%1024+56320)),(i+1===t||r.length>16384)&&(A+=String.fromCharCode.apply(String,r),r.length=0)}return A},j1=L1(C1),Jt="\xD7",Iu="\xF7",W1=function(n){return j1.get(n)},q1=function(n,e,t){var r=t-2,i=e[r],A=e[t-1],s=e[t];if(A===Su&&s===ku)return Jt;if(A===Su||A===ku||A===ig||s===Su||s===ku||s===ig)return Iu;if(A===sg&&[sg,Eu,og,ag].indexOf(s)!==-1||(A===og||A===Eu)&&(s===Eu||s===Uu)||(A===ag||A===Uu)&&s===Uu||s===cg||s===Ag||s===K1||A===H1)return Jt;if(A===cg&&s===ug){for(;i===Ag;)i=e[--r];if(i===ug)return Jt}if(A===Tu&&s===Tu){for(var o=0;i===Tu;)o++,i=e[--r];if(o%2===0)return Jt}return Iu},J1=function(n){var e=V1(n),t=e.length,r=0,i=0,A=e.map(W1);return{next:function(){if(r>=t)return{done:!0,value:null};for(var s=Jt;r<t&&(s=q1(e,A,++r))===Jt;);if(s!==Jt||r===t){var o=G1.apply(null,e.slice(i,r));return i=r,{value:o,done:!1}}return{done:!0,value:null}}}},z1=function(n){for(var e=J1(n),t=[],r;!(r=e.next()).done;)r.value&&t.push(r.value.slice());return t},X1=function(n){var e=123;if(n.createRange){var t=n.createRange();if(t.getBoundingClientRect){var r=n.createElement("boundtest");r.style.height="".concat(e,"px"),r.style.display="block",n.body.appendChild(r),t.selectNode(r);var i=t.getBoundingClientRect(),A=Math.round(i.height);if(n.body.removeChild(r),A===e)return!0}}return!1},Y1=function(n){var e=n.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",n.body.appendChild(e);var t=n.createRange();e.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var r=e.firstChild,i=Rs(r.data).map(function(a){return tt(a)}),A=0,s={},o=i.every(function(a,c){t.setStart(r,A),t.setEnd(r,A+a.length);var u=t.getBoundingClientRect();A+=a.length;var l=u.x>s.x||u.y>s.y;return s=u,c===0?!0:l});return n.body.removeChild(e),o},Z1=function(){return typeof new Image().crossOrigin<"u"},$1=function(){return typeof new XMLHttpRequest().responseType=="string"},eU=function(n){var e=new Image,t=n.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(e,0,0),t.toDataURL()}catch{return!1}return!0},lg=function(n){return n[0]===0&&n[1]===255&&n[2]===0&&n[3]===255},tU=function(n){var e=n.createElement("canvas"),t=100;e.width=t,e.height=t;var r=e.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,t,t);var i=new Image,A=e.toDataURL();i.src=A;var s=Fu(t,t,0,0,i);return r.fillStyle="red",r.fillRect(0,0,t,t),dg(s).then(function(o){r.drawImage(o,0,0);var a=r.getImageData(0,0,t,t).data;r.fillStyle="red",r.fillRect(0,0,t,t);var c=n.createElement("div");return c.style.backgroundImage="url(".concat(A,")"),c.style.height="".concat(t,"px"),lg(a)?dg(Fu(t,t,0,0,c)):Promise.reject(!1)}).then(function(o){return r.drawImage(o,0,0),lg(r.getImageData(0,0,t,t).data)}).catch(function(){return!1})},Fu=function(n,e,t,r,i){var A="http://www.w3.org/2000/svg",s=document.createElementNS(A,"svg"),o=document.createElementNS(A,"foreignObject");return s.setAttributeNS(null,"width",n.toString()),s.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",r.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(o),o.appendChild(i),s},dg=function(n){return new Promise(function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(new XMLSerializer().serializeToString(n)))})},yt={get SUPPORT_RANGE_BOUNDS(){var n=X1(document);return Object.defineProperty(yt,"SUPPORT_RANGE_BOUNDS",{value:n}),n},get SUPPORT_WORD_BREAKING(){var n=yt.SUPPORT_RANGE_BOUNDS&&Y1(document);return Object.defineProperty(yt,"SUPPORT_WORD_BREAKING",{value:n}),n},get SUPPORT_SVG_DRAWING(){var n=eU(document);return Object.defineProperty(yt,"SUPPORT_SVG_DRAWING",{value:n}),n},get SUPPORT_FOREIGNOBJECT_DRAWING(){var n=typeof Array.from=="function"&&typeof window.fetch=="function"?tU(document):Promise.resolve(!1);return Object.defineProperty(yt,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:n}),n},get SUPPORT_CORS_IMAGES(){var n=Z1();return Object.defineProperty(yt,"SUPPORT_CORS_IMAGES",{value:n}),n},get SUPPORT_RESPONSE_TYPE(){var n=$1();return Object.defineProperty(yt,"SUPPORT_RESPONSE_TYPE",{value:n}),n},get SUPPORT_CORS_XHR(){var n="withCredentials"in new XMLHttpRequest;return Object.defineProperty(yt,"SUPPORT_CORS_XHR",{value:n}),n},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var n=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(yt,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:n}),n}},IA=function(){function n(e,t){this.text=e,this.bounds=t}return n}(),nU=function(n,e,t,r){var i=AU(e,t),A=[],s=0;return i.forEach(function(o){if(t.textDecorationLine.length||o.trim().length>0)if(yt.SUPPORT_RANGE_BOUNDS){var a=hg(r,s,o.length).getClientRects();if(a.length>1){var c=xu(o),u=0;c.forEach(function(d){A.push(new IA(d,Rn.fromDOMRectList(n,hg(r,u+s,d.length).getClientRects()))),u+=d.length})}else A.push(new IA(o,Rn.fromDOMRectList(n,a)))}else{var l=r.splitText(o.length);A.push(new IA(o,rU(n,r))),r=l}else yt.SUPPORT_RANGE_BOUNDS||(r=r.splitText(o.length));s+=o.length}),A},rU=function(n,e){var t=e.ownerDocument;if(t){var r=t.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));var i=e.parentNode;if(i){i.replaceChild(r,e);var A=Qs(n,r);return r.firstChild&&i.replaceChild(r.firstChild,r),A}}return Rn.EMPTY},hg=function(n,e,t){var r=n.ownerDocument;if(!r)throw new Error("Node has no owner document");var i=r.createRange();return i.setStart(n,e),i.setEnd(n,e+t),i},xu=function(n){if(yt.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(n)).map(function(t){return t.segment})}return z1(n)},iU=function(n,e){if(yt.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(n)).map(function(r){return r.segment})}return oU(n,e)},AU=function(n,e){return e.letterSpacing!==0?xu(n):iU(n,e)},sU=[32,160,4961,65792,65793,4153,4241],oU=function(n,e){for(var t=N_(n,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap==="break-word"?"break-word":e.wordBreak}),r=[],i,A=function(){if(i.value){var s=i.value.slice(),o=Rs(s),a="";o.forEach(function(c){sU.indexOf(c)===-1?a+=tt(c):(a.length&&r.push(a),r.push(tt(c)),a="")}),a.length&&r.push(a)}};!(i=t.next()).done;)A();return r},aU=function(){function n(e,t,r){this.text=cU(t.data,r.textTransform),this.textBounds=nU(e,this.text,r,t)}return n}(),cU=function(n,e){switch(e){case 1:return n.toLowerCase();case 3:return n.replace(uU,lU);case 2:return n.toUpperCase();default:return n}},uU=/(^|\s|:|-|\(|\))([a-z])/g,lU=function(n,e,t){return n.length>0?e+t.toUpperCase():n},pg=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.src=r.currentSrc||r.src,i.intrinsicWidth=r.naturalWidth,i.intrinsicHeight=r.naturalHeight,i.context.cache.addImage(i.src),i}return e}(Bn),fg=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.canvas=r,i.intrinsicWidth=r.width,i.intrinsicHeight=r.height,i}return e}(Bn),gg=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this,A=new XMLSerializer,s=Qs(t,r);return r.setAttribute("width","".concat(s.width,"px")),r.setAttribute("height","".concat(s.height,"px")),i.svg="data:image/svg+xml,".concat(encodeURIComponent(A.serializeToString(r))),i.intrinsicWidth=r.width.baseVal.value,i.intrinsicHeight=r.height.baseVal.value,i.context.cache.addImage(i.svg),i}return e}(Bn),mg=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.value=r.value,i}return e}(Bn),Qu=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.start=r.start,i.reversed=typeof r.reversed=="boolean"&&r.reversed===!0,i}return e}(Bn),dU=[{type:15,flags:0,unit:"px",number:3}],hU=[{type:16,flags:0,number:50}],pU=function(n){return n.width>n.height?new Rn(n.left+(n.width-n.height)/2,n.top,n.height,n.height):n.width<n.height?new Rn(n.left,n.top+(n.height-n.width)/2,n.width,n.width):n},fU=function(n){var e=n.type===gU?new Array(n.value.length+1).join("\u2022"):n.value;return e.length===0?n.placeholder||"":e},yo="checkbox",wo="radio",gU="password",vg=707406591,Ru=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;switch(i.type=r.type.toLowerCase(),i.checked=r.checked,i.value=fU(r),(i.type===yo||i.type===wo)&&(i.styles.backgroundColor=3739148031,i.styles.borderTopColor=i.styles.borderRightColor=i.styles.borderBottomColor=i.styles.borderLeftColor=2779096575,i.styles.borderTopWidth=i.styles.borderRightWidth=i.styles.borderBottomWidth=i.styles.borderLeftWidth=1,i.styles.borderTopStyle=i.styles.borderRightStyle=i.styles.borderBottomStyle=i.styles.borderLeftStyle=1,i.styles.backgroundClip=[0],i.styles.backgroundOrigin=[0],i.bounds=pU(i.bounds)),i.type){case yo:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=dU;break;case wo:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=hU;break}return i}return e}(Bn),yg=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this,A=r.options[r.selectedIndex||0];return i.value=A&&A.text||"",i}return e}(Bn),wg=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.value=r.value,i}return e}(Bn),bg=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;i.src=r.src,i.width=parseInt(r.width,10)||0,i.height=parseInt(r.height,10)||0,i.backgroundColor=i.styles.backgroundColor;try{if(r.contentWindow&&r.contentWindow.document&&r.contentWindow.document.documentElement){i.tree=Cg(t,r.contentWindow.document.documentElement);var A=r.contentWindow.document.documentElement?fi(t,getComputedStyle(r.contentWindow.document.documentElement).backgroundColor):bn.TRANSPARENT,s=r.contentWindow.document.body?fi(t,getComputedStyle(r.contentWindow.document.body).backgroundColor):bn.TRANSPARENT;i.backgroundColor=rr(A)?rr(s)?i.styles.backgroundColor:s:A}}catch{}return i}return e}(Bn),mU=["OL","UL","MENU"],bo=function(n,e,t,r){for(var i=e.firstChild,A=void 0;i;i=A)if(A=i.nextSibling,_g(i)&&i.data.length>0)t.textNodes.push(new aU(n,i,t.styles));else if(mi(i))if(Ig(i)&&i.assignedNodes)i.assignedNodes().forEach(function(o){return bo(n,o,t,r)});else{var s=Bg(n,i);s.styles.isVisible()&&(vU(i,s,r)?s.flags|=4:yU(s.styles)&&(s.flags|=2),mU.indexOf(i.tagName)!==-1&&(s.flags|=8),t.elements.push(s),i.slot,i.shadowRoot?bo(n,i.shadowRoot,s,r):!Co(i)&&!Sg(i)&&!_o(i)&&bo(n,i,s,r))}},Bg=function(n,e){return Mu(e)?new pg(n,e):kg(e)?new fg(n,e):Sg(e)?new gg(n,e):wU(e)?new mg(n,e):bU(e)?new Qu(n,e):BU(e)?new Ru(n,e):_o(e)?new yg(n,e):Co(e)?new wg(n,e):Ug(e)?new bg(n,e):new Bn(n,e)},Cg=function(n,e){var t=Bg(n,e);return t.flags|=4,bo(n,e,t,t),t},vU=function(n,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Ou(n)&&t.styles.isTransparent()},yU=function(n){return n.isPositioned()||n.isFloating()},_g=function(n){return n.nodeType===Node.TEXT_NODE},mi=function(n){return n.nodeType===Node.ELEMENT_NODE},Pu=function(n){return mi(n)&&typeof n.style<"u"&&!Bo(n)},Bo=function(n){return typeof n.className=="object"},wU=function(n){return n.tagName==="LI"},bU=function(n){return n.tagName==="OL"},BU=function(n){return n.tagName==="INPUT"},CU=function(n){return n.tagName==="HTML"},Sg=function(n){return n.tagName==="svg"},Ou=function(n){return n.tagName==="BODY"},kg=function(n){return n.tagName==="CANVAS"},Eg=function(n){return n.tagName==="VIDEO"},Mu=function(n){return n.tagName==="IMG"},Ug=function(n){return n.tagName==="IFRAME"},Tg=function(n){return n.tagName==="STYLE"},_U=function(n){return n.tagName==="SCRIPT"},Co=function(n){return n.tagName==="TEXTAREA"},_o=function(n){return n.tagName==="SELECT"},Ig=function(n){return n.tagName==="SLOT"},Fg=function(n){return n.tagName.indexOf("-")>0},SU=function(){function n(){this.counters={}}return n.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},n.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},n.prototype.pop=function(e){var t=this;e.forEach(function(r){return t.counters[r].pop()})},n.prototype.parse=function(e){var t=this,r=e.counterIncrement,i=e.counterReset,A=!0;r!==null&&r.forEach(function(o){var a=t.counters[o.counter];a&&o.increment!==0&&(A=!1,a.length||a.push(1),a[Math.max(0,a.length-1)]+=o.increment)});var s=[];return A&&i.forEach(function(o){var a=t.counters[o.counter];s.push(o.counter),a||(a=t.counters[o.counter]=[]),a.push(o.reset)}),s},n}(),xg={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Qg={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u0554","\u0553","\u0552","\u0551","\u0550","\u054F","\u054E","\u054D","\u054C","\u054B","\u054A","\u0549","\u0548","\u0547","\u0546","\u0545","\u0544","\u0543","\u0542","\u0541","\u0540","\u053F","\u053E","\u053D","\u053C","\u053B","\u053A","\u0539","\u0538","\u0537","\u0536","\u0535","\u0534","\u0533","\u0532","\u0531"]},kU={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["\u05D9\u05F3","\u05D8\u05F3","\u05D7\u05F3","\u05D6\u05F3","\u05D5\u05F3","\u05D4\u05F3","\u05D3\u05F3","\u05D2\u05F3","\u05D1\u05F3","\u05D0\u05F3","\u05EA","\u05E9","\u05E8","\u05E7","\u05E6","\u05E4","\u05E2","\u05E1","\u05E0","\u05DE","\u05DC","\u05DB","\u05D9\u05D8","\u05D9\u05D7","\u05D9\u05D6","\u05D8\u05D6","\u05D8\u05D5","\u05D9","\u05D8","\u05D7","\u05D6","\u05D5","\u05D4","\u05D3","\u05D2","\u05D1","\u05D0"]},EU={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u10F5","\u10F0","\u10EF","\u10F4","\u10EE","\u10ED","\u10EC","\u10EB","\u10EA","\u10E9","\u10E8","\u10E7","\u10E6","\u10E5","\u10E4","\u10F3","\u10E2","\u10E1","\u10E0","\u10DF","\u10DE","\u10DD","\u10F2","\u10DC","\u10DB","\u10DA","\u10D9","\u10D8","\u10D7","\u10F1","\u10D6","\u10D5","\u10D4","\u10D3","\u10D2","\u10D1","\u10D0"]},vi=function(n,e,t,r,i,A){return n<e||n>t?xA(n,i,A.length>0):r.integers.reduce(function(s,o,a){for(;n>=o;)n-=o,s+=r.values[a];return s},"")+A},Rg=function(n,e,t,r){var i="";do t||n--,i=r(n)+i,n/=e;while(n*e>=e);return i},nt=function(n,e,t,r,i){var A=t-e+1;return(n<0?"-":"")+(Rg(Math.abs(n),A,r,function(s){return tt(Math.floor(s%A)+e)})+i)},Nr=function(n,e,t){t===void 0&&(t=". ");var r=e.length;return Rg(Math.abs(n),r,!1,function(i){return e[Math.floor(i%r)]})+t},yi=1,sr=2,or=4,FA=8,On=function(n,e,t,r,i,A){if(n<-9999||n>9999)return xA(n,4,i.length>0);var s=Math.abs(n),o=i;if(s===0)return e[0]+o;for(var a=0;s>0&&a<=4;a++){var c=s%10;c===0&&ut(A,yi)&&o!==""?o=e[c]+o:c>1||c===1&&a===0||c===1&&a===1&&ut(A,sr)||c===1&&a===1&&ut(A,or)&&n>100||c===1&&a>1&&ut(A,FA)?o=e[c]+(a>0?t[a-1]:"")+o:c===1&&a>0&&(o=t[a-1]+o),s=Math.floor(s/10)}return(n<0?r:"")+o},Pg="\u5341\u767E\u5343\u842C",Og="\u62FE\u4F70\u4EDF\u842C",Mg="\u30DE\u30A4\u30CA\u30B9",Lu="\uB9C8\uC774\uB108\uC2A4",xA=function(n,e,t){var r=t?". ":"",i=t?"\u3001":"",A=t?", ":"",s=t?" ":"";switch(e){case 0:return"\u2022"+s;case 1:return"\u25E6"+s;case 2:return"\u25FE"+s;case 5:var o=nt(n,48,57,!0,r);return o.length<4?"0".concat(o):o;case 4:return Nr(n,"\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",i);case 6:return vi(n,1,3999,xg,3,r).toLowerCase();case 7:return vi(n,1,3999,xg,3,r);case 8:return nt(n,945,969,!1,r);case 9:return nt(n,97,122,!1,r);case 10:return nt(n,65,90,!1,r);case 11:return nt(n,1632,1641,!0,r);case 12:case 49:return vi(n,1,9999,Qg,3,r);case 35:return vi(n,1,9999,Qg,3,r).toLowerCase();case 13:return nt(n,2534,2543,!0,r);case 14:case 30:return nt(n,6112,6121,!0,r);case 15:return Nr(n,"\u5B50\u4E11\u5BC5\u536F\u8FB0\u5DF3\u5348\u672A\u7533\u9149\u620C\u4EA5",i);case 16:return Nr(n,"\u7532\u4E59\u4E19\u4E01\u620A\u5DF1\u5E9A\u8F9B\u58EC\u7678",i);case 17:case 48:return On(n,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",Pg,"\u8CA0",i,sr|or|FA);case 47:return On(n,"\u96F6\u58F9\u8CB3\u53C3\u8086\u4F0D\u9678\u67D2\u634C\u7396",Og,"\u8CA0",i,yi|sr|or|FA);case 42:return On(n,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",Pg,"\u8D1F",i,sr|or|FA);case 41:return On(n,"\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396",Og,"\u8D1F",i,yi|sr|or|FA);case 26:return On(n,"\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u5341\u767E\u5343\u4E07",Mg,i,0);case 25:return On(n,"\u96F6\u58F1\u5F10\u53C2\u56DB\u4F0D\u516D\u4E03\u516B\u4E5D","\u62FE\u767E\u5343\u4E07",Mg,i,yi|sr|or);case 31:return On(n,"\uC601\uC77C\uC774\uC0BC\uC0AC\uC624\uC721\uCE60\uD314\uAD6C","\uC2ED\uBC31\uCC9C\uB9CC",Lu,A,yi|sr|or);case 33:return On(n,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u5341\u767E\u5343\u842C",Lu,A,0);case 32:return On(n,"\u96F6\u58F9\u8CB3\u53C3\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u62FE\u767E\u5343",Lu,A,yi|sr|or);case 18:return nt(n,2406,2415,!0,r);case 20:return vi(n,1,19999,EU,3,r);case 21:return nt(n,2790,2799,!0,r);case 22:return nt(n,2662,2671,!0,r);case 52:return vi(n,1,10999,kU,3,r);case 23:return Nr(n,"\u3042\u3044\u3046\u3048\u304A\u304B\u304D\u304F\u3051\u3053\u3055\u3057\u3059\u305B\u305D\u305F\u3061\u3064\u3066\u3068\u306A\u306B\u306C\u306D\u306E\u306F\u3072\u3075\u3078\u307B\u307E\u307F\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308A\u308B\u308C\u308D\u308F\u3090\u3091\u3092\u3093");case 24:return Nr(n,"\u3044\u308D\u306F\u306B\u307B\u3078\u3068\u3061\u308A\u306C\u308B\u3092\u308F\u304B\u3088\u305F\u308C\u305D\u3064\u306D\u306A\u3089\u3080\u3046\u3090\u306E\u304A\u304F\u3084\u307E\u3051\u3075\u3053\u3048\u3066\u3042\u3055\u304D\u3086\u3081\u307F\u3057\u3091\u3072\u3082\u305B\u3059");case 27:return nt(n,3302,3311,!0,r);case 28:return Nr(n,"\u30A2\u30A4\u30A6\u30A8\u30AA\u30AB\u30AD\u30AF\u30B1\u30B3\u30B5\u30B7\u30B9\u30BB\u30BD\u30BF\u30C1\u30C4\u30C6\u30C8\u30CA\u30CB\u30CC\u30CD\u30CE\u30CF\u30D2\u30D5\u30D8\u30DB\u30DE\u30DF\u30E0\u30E1\u30E2\u30E4\u30E6\u30E8\u30E9\u30EA\u30EB\u30EC\u30ED\u30EF\u30F0\u30F1\u30F2\u30F3",i);case 29:return Nr(n,"\u30A4\u30ED\u30CF\u30CB\u30DB\u30D8\u30C8\u30C1\u30EA\u30CC\u30EB\u30F2\u30EF\u30AB\u30E8\u30BF\u30EC\u30BD\u30C4\u30CD\u30CA\u30E9\u30E0\u30A6\u30F0\u30CE\u30AA\u30AF\u30E4\u30DE\u30B1\u30D5\u30B3\u30A8\u30C6\u30A2\u30B5\u30AD\u30E6\u30E1\u30DF\u30B7\u30F1\u30D2\u30E2\u30BB\u30B9",i);case 34:return nt(n,3792,3801,!0,r);case 37:return nt(n,6160,6169,!0,r);case 38:return nt(n,4160,4169,!0,r);case 39:return nt(n,2918,2927,!0,r);case 40:return nt(n,1776,1785,!0,r);case 43:return nt(n,3046,3055,!0,r);case 44:return nt(n,3174,3183,!0,r);case 45:return nt(n,3664,3673,!0,r);case 46:return nt(n,3872,3881,!0,r);case 3:default:return nt(n,48,57,!0,r)}},Lg="data-html2canvas-ignore",Dg=function(){function n(e,t,r){if(this.context=e,this.options=r,this.scrolledElements=[],this.referenceElement=t,this.counters=new SU,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return n.prototype.toIFrame=function(e,t){var r=this,i=UU(e,t);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var A=e.defaultView.pageXOffset,s=e.defaultView.pageYOffset,o=i.contentWindow,a=o.document,c=FU(i).then(function(){return Tt(r,void 0,void 0,function(){var l,d;return Ct(this,function(h){switch(h.label){case 0:return this.scrolledElements.forEach(PU),o&&(o.scrollTo(t.left,t.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(o.scrollY!==t.top||o.scrollX!==t.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-t.left,o.scrollY-t.top,0,0))),l=this.options.onclone,d=this.clonedReferenceElement,typeof d>"u"?[2,Promise.reject("Error finding the ".concat(this.referenceElement.nodeName," in the cloned document"))]:a.fonts&&a.fonts.ready?[4,a.fonts.ready]:[3,2];case 1:h.sent(),h.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,IU(a)]:[3,4];case 3:h.sent(),h.label=4;case 4:return typeof l=="function"?[2,Promise.resolve().then(function(){return l(a,d)}).then(function(){return i})]:[2,i]}})})}),u=a.adoptNode(this.documentElement);return NU(u,a),a.open(),a.write("".concat(QU(document.doctype),"<html></html>")),RU(this.referenceElement.ownerDocument,A,s),a.replaceChild(u,a.documentElement),a.close(),c},n.prototype.createElementClone=function(e){if(bu(e,2),kg(e))return this.createCanvasClone(e);if(Eg(e))return this.createVideoClone(e);if(Tg(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return Mu(t)&&(Mu(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager")),Fg(t)?this.createCustomElementClone(t):t},n.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return Du(e.style,t),t},n.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var r=[].slice.call(t.cssRules,0).reduce(function(A,s){return s&&typeof s.cssText=="string"?A+s.cssText:A},""),i=e.cloneNode(!1);return i.textContent=r,i}}catch(A){if(this.context.logger.error("Unable to access cssRules property",A),A.name!=="SecurityError")throw A}return e.cloneNode(!1)},n.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var r=e.ownerDocument.createElement("img");try{return r.src=e.toDataURL(),r}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var i=e.cloneNode(!1);try{i.width=e.width,i.height=e.height;var A=e.getContext("2d"),s=i.getContext("2d",{willReadFrequently:!0});if(s)if(!this.options.allowTaint&&A)s.putImageData(A.getImageData(0,0,e.width,e.height),0,0);else{var o=(t=e.getContext("webgl2"))!==null&&t!==void 0?t:e.getContext("webgl");if(o){var a=o.getContextAttributes();(a==null?void 0:a.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}s.drawImage(e,0,0)}return i}catch{this.context.logger.info("Unable to clone canvas as it is tainted",e)}return i},n.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var r=t.getContext("2d");try{return r&&(r.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||r.getImageData(0,0,t.width,t.height)),t}catch{this.context.logger.info("Unable to clone video as it is tainted",e)}var i=e.ownerDocument.createElement("canvas");return i.width=e.offsetWidth,i.height=e.offsetHeight,i},n.prototype.appendChildNode=function(e,t,r){(!mi(t)||!_U(t)&&!t.hasAttribute(Lg)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(t)))&&(!this.options.copyStyles||!mi(t)||!Tg(t))&&e.appendChild(this.cloneNode(t,r))},n.prototype.cloneChildNodes=function(e,t,r){for(var i=this,A=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;A;A=A.nextSibling)if(mi(A)&&Ig(A)&&typeof A.assignedNodes=="function"){var s=A.assignedNodes();s.length&&s.forEach(function(o){return i.appendChildNode(t,o,r)})}else this.appendChildNode(t,A,r)},n.prototype.cloneNode=function(e,t){if(_g(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var r=e.ownerDocument.defaultView;if(r&&mi(e)&&(Pu(e)||Bo(e))){var i=this.createElementClone(e);i.style.transitionProperty="none";var A=r.getComputedStyle(e),s=r.getComputedStyle(e,":before"),o=r.getComputedStyle(e,":after");this.referenceElement===e&&Pu(i)&&(this.clonedReferenceElement=i),Ou(i)&&LU(i);var a=this.counters.parse(new $f(this.context,A)),c=this.resolvePseudoContent(e,i,s,QA.BEFORE);Fg(e)&&(t=!0),Eg(e)||this.cloneChildNodes(e,i,t),c&&i.insertBefore(c,i.firstChild);var u=this.resolvePseudoContent(e,i,o,QA.AFTER);return u&&i.appendChild(u),this.counters.pop(a),(A&&(this.options.copyStyles||Bo(e))&&!Ug(e)||t)&&Du(A,i),(e.scrollTop!==0||e.scrollLeft!==0)&&this.scrolledElements.push([i,e.scrollLeft,e.scrollTop]),(Co(e)||_o(e))&&(Co(i)||_o(i))&&(i.value=e.value),i}return e.cloneNode(!1)},n.prototype.resolvePseudoContent=function(e,t,r,i){var A=this;if(r){var s=r.content,o=t.ownerDocument;if(!(!o||!s||s==="none"||s==="-moz-alt-content"||r.display==="none")){this.counters.parse(new $f(this.context,r));var a=new w1(this.context,r),c=o.createElement("html2canvaspseudoelement");Du(r,c),a.content.forEach(function(l){if(l.type===0)c.appendChild(o.createTextNode(l.value));else if(l.type===22){var d=o.createElement("img");d.src=l.value,d.style.opacity="1",c.appendChild(d)}else if(l.type===18){if(l.name==="attr"){var h=l.values.filter(ce);h.length&&c.appendChild(o.createTextNode(e.getAttribute(h[0].value)||""))}else if(l.name==="counter"){var f=l.values.filter(mt),p=f[0],g=f[1];if(p&&ce(p)){var v=A.counters.getCounterValue(p.value),y=g&&ce(g)?wu.parse(A.context,g.value):3;c.appendChild(o.createTextNode(xA(v,y,!1)))}}else if(l.name==="counters"){var B=l.values.filter(mt),p=B[0],b=B[1],g=B[2];if(p&&ce(p)){var w=A.counters.getCounterValues(p.value),_=g&&ce(g)?wu.parse(A.context,g.value):3,k=b&&b.type===0?b.value:"",F=w.map(function(T){return xA(T,_,!1)}).join(k);c.appendChild(o.createTextNode(F))}}}else if(l.type===20)switch(l.value){case"open-quote":c.appendChild(o.createTextNode(Zf(a.quotes,A.quoteDepth++,!0)));break;case"close-quote":c.appendChild(o.createTextNode(Zf(a.quotes,--A.quoteDepth,!1)));break;default:c.appendChild(o.createTextNode(l.value))}}),c.className="".concat(Nu," ").concat(Hu);var u=i===QA.BEFORE?" ".concat(Nu):" ".concat(Hu);return Bo(t)?t.className.baseValue+=u:t.className+=u,c}}},n.destroy=function(e){return e.parentNode?(e.parentNode.removeChild(e),!0):!1},n}(),QA;(function(n){n[n.BEFORE=0]="BEFORE",n[n.AFTER=1]="AFTER"})(QA||(QA={}));var UU=function(n,e){var t=n.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(Lg,"true"),n.body.appendChild(t),t},TU=function(n){return new Promise(function(e){if(n.complete){e();return}if(!n.src){e();return}n.onload=e,n.onerror=e})},IU=function(n){return Promise.all([].slice.call(n.images,0).map(TU))},FU=function(n){return new Promise(function(e,t){var r=n.contentWindow;if(!r)return t("No window assigned for iframe");var i=r.document;r.onload=n.onload=function(){r.onload=n.onload=null;var A=setInterval(function(){i.body.childNodes.length>0&&i.readyState==="complete"&&(clearInterval(A),e(n))},50)}})},xU=["all","d","content"],Du=function(n,e){for(var t=n.length-1;t>=0;t--){var r=n.item(t);xU.indexOf(r)===-1&&e.style.setProperty(r,n.getPropertyValue(r))}return e},QU=function(n){var e="";return n&&(e+="<!DOCTYPE ",n.name&&(e+=n.name),n.internalSubset&&(e+=n.internalSubset),n.publicId&&(e+='"'.concat(n.publicId,'"')),n.systemId&&(e+='"'.concat(n.systemId,'"')),e+=">"),e},RU=function(n,e,t){n&&n.defaultView&&(e!==n.defaultView.pageXOffset||t!==n.defaultView.pageYOffset)&&n.defaultView.scrollTo(e,t)},PU=function(n){var e=n[0],t=n[1],r=n[2];e.scrollLeft=t,e.scrollTop=r},OU=":before",MU=":after",Nu="___html2canvas___pseudoelement_before",Hu="___html2canvas___pseudoelement_after",Ng=`{
2
2
  content: "" !important;
3
3
  display: none !important;
4
4
  }`,LU=function(n){DU(n,".".concat(Nu).concat(OU).concat(Ng,`
5
- .`).concat(Hu).concat(MU).concat(Ng))},DU=function(n,e){var t=n.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,n.appendChild(r)}},NU=function(n,e){var t,r=e.createElement("base");r.href=e.baseURI;var i=n.getElementsByTagName("head").item(0);i==null||i.insertBefore(r,(t=i==null?void 0:i.firstChild)!==null&&t!==void 0?t:null)},Ku=function(){function n(){}return n.getOrigin=function(e){var t=n._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},n.isSameOrigin=function(e){return n.getOrigin(e)===n._origin},n.setContext=function(e){n._link=e.document.createElement("a"),n._origin=n.getOrigin(e.location.href)},n._origin="about:blank",n}(),HU=function(){function n(e,t){this.context=e,this._options=t,this._cache={}}return n.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Gu(e)||jU(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},n.prototype.match=function(e){return this._cache[e]},n.prototype.loadImage=function(e){return Tt(this,void 0,void 0,function(){var t,r,i,A,s,o=this;return Ct(this,function(a){switch(a.label){case 0:return typeof this._options.customIsSameOrigin!="function"?[3,2]:[4,this._options.customIsSameOrigin(e,Ku.isSameOrigin)];case 1:return r=a.sent(),[3,3];case 2:r=Ku.isSameOrigin(e),a.label=3;case 3:return t=r,i=!Vu(e)&&this._options.useCORS===!0&&yt.SUPPORT_CORS_IMAGES&&!t,A=!Vu(e)&&!t&&!Gu(e)&&typeof this._options.proxy=="string"&&yt.SUPPORT_CORS_XHR&&!i,!t&&this._options.allowTaint===!1&&!Vu(e)&&!Gu(e)&&!A&&!i?[2]:(s=e,A?[4,this.proxy(s)]:[3,5]);case 4:s=a.sent(),a.label=5;case 5:return this.context.logger.debug("Added image ".concat(e.substring(0,256))),[4,new Promise(function(c,u){var l=new Image;l.onload=function(){return c(l)},l.onerror=u,(WU(s)||i)&&(l.crossOrigin="anonymous"),l.src=s,l.complete===!0&&setTimeout(function(){return c(l)},500),o._options.imageTimeout>0&&setTimeout(function(){return u("Timed out (".concat(o._options.imageTimeout,"ms) loading image"))},o._options.imageTimeout)})];case 6:return[2,a.sent()]}})})},n.prototype.has=function(e){return typeof this._cache[e]<"u"},n.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},n.prototype.proxy=function(e){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var i=e.substring(0,256);return new Promise(function(A,s){var o=yt.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(o==="text")A(a.response);else{var l=new FileReader;l.addEventListener("load",function(){return A(l.result)},!1),l.addEventListener("error",function(d){return s(d)},!1),l.readAsDataURL(a.response)}else s("Failed to proxy resource ".concat(i," with status code ").concat(a.status))},a.onerror=s;var c=r.indexOf("?")>-1?"&":"?";if(a.open("GET","".concat(r).concat(c,"url=").concat(encodeURIComponent(e),"&responseType=").concat(o)),o!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=o),t._options.imageTimeout){var u=t._options.imageTimeout;a.timeout=u,a.ontimeout=function(){return s("Timed out (".concat(u,"ms) proxying ").concat(i))}}a.send()})},n}(),KU=/^data:image\/svg\+xml/i,VU=/^data:image\/.*;base64,/i,GU=/^data:image\/.*/i,jU=function(n){return yt.SUPPORT_SVG_DRAWING||!qU(n)},Vu=function(n){return GU.test(n)},WU=function(n){return VU.test(n)},Gu=function(n){return n.substr(0,4)==="blob"},qU=function(n){return n.substr(-3).toLowerCase()==="svg"||KU.test(n)},G=function(){function n(e,t){this.type=0,this.x=e,this.y=t}return n.prototype.add=function(e,t){return new n(this.x+e,this.y+t)},n}(),wi=function(n,e,t){return new G(n.x+(e.x-n.x)*t,n.y+(e.y-n.y)*t)},So=function(){function n(e,t,r,i){this.type=1,this.start=e,this.startControl=t,this.endControl=r,this.end=i}return n.prototype.subdivide=function(e,t){var r=wi(this.start,this.startControl,e),i=wi(this.startControl,this.endControl,e),A=wi(this.endControl,this.end,e),s=wi(r,i,e),o=wi(i,A,e),a=wi(s,o,e);return t?new n(this.start,r,s,a):new n(a,o,A,this.end)},n.prototype.add=function(e,t){return new n(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},n.prototype.reverse=function(){return new n(this.end,this.endControl,this.startControl,this.start)},n}(),zt=function(n){return n.type===1},JU=function(){function n(e){var t=e.styles,r=e.bounds,i=kA(t.borderTopLeftRadius,r.width,r.height),A=i[0],s=i[1],o=kA(t.borderTopRightRadius,r.width,r.height),a=o[0],c=o[1],u=kA(t.borderBottomRightRadius,r.width,r.height),l=u[0],d=u[1],h=kA(t.borderBottomLeftRadius,r.width,r.height),f=h[0],p=h[1],g=[];g.push((A+a)/r.width),g.push((f+l)/r.width),g.push((s+p)/r.height),g.push((c+d)/r.height);var v=Math.max.apply(Math,g);v>1&&(A/=v,s/=v,a/=v,c/=v,l/=v,d/=v,f/=v,p/=v);var y=r.width-a,B=r.height-d,b=r.width-l,w=r.height-p,_=t.borderTopWidth,k=t.borderRightWidth,F=t.borderBottomWidth,x=t.borderLeftWidth,U=Se(t.paddingTop,e.bounds.width),T=Se(t.paddingRight,e.bounds.width),Q=Se(t.paddingBottom,e.bounds.width),M=Se(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=A>0||s>0?He(r.left+x/3,r.top+_/3,A-x/3,s-_/3,Ce.TOP_LEFT):new G(r.left+x/3,r.top+_/3),this.topRightBorderDoubleOuterBox=A>0||s>0?He(r.left+y,r.top+_/3,a-k/3,c-_/3,Ce.TOP_RIGHT):new G(r.left+r.width-k/3,r.top+_/3),this.bottomRightBorderDoubleOuterBox=l>0||d>0?He(r.left+b,r.top+B,l-k/3,d-F/3,Ce.BOTTOM_RIGHT):new G(r.left+r.width-k/3,r.top+r.height-F/3),this.bottomLeftBorderDoubleOuterBox=f>0||p>0?He(r.left+x/3,r.top+w,f-x/3,p-F/3,Ce.BOTTOM_LEFT):new G(r.left+x/3,r.top+r.height-F/3),this.topLeftBorderDoubleInnerBox=A>0||s>0?He(r.left+x*2/3,r.top+_*2/3,A-x*2/3,s-_*2/3,Ce.TOP_LEFT):new G(r.left+x*2/3,r.top+_*2/3),this.topRightBorderDoubleInnerBox=A>0||s>0?He(r.left+y,r.top+_*2/3,a-k*2/3,c-_*2/3,Ce.TOP_RIGHT):new G(r.left+r.width-k*2/3,r.top+_*2/3),this.bottomRightBorderDoubleInnerBox=l>0||d>0?He(r.left+b,r.top+B,l-k*2/3,d-F*2/3,Ce.BOTTOM_RIGHT):new G(r.left+r.width-k*2/3,r.top+r.height-F*2/3),this.bottomLeftBorderDoubleInnerBox=f>0||p>0?He(r.left+x*2/3,r.top+w,f-x*2/3,p-F*2/3,Ce.BOTTOM_LEFT):new G(r.left+x*2/3,r.top+r.height-F*2/3),this.topLeftBorderStroke=A>0||s>0?He(r.left+x/2,r.top+_/2,A-x/2,s-_/2,Ce.TOP_LEFT):new G(r.left+x/2,r.top+_/2),this.topRightBorderStroke=A>0||s>0?He(r.left+y,r.top+_/2,a-k/2,c-_/2,Ce.TOP_RIGHT):new G(r.left+r.width-k/2,r.top+_/2),this.bottomRightBorderStroke=l>0||d>0?He(r.left+b,r.top+B,l-k/2,d-F/2,Ce.BOTTOM_RIGHT):new G(r.left+r.width-k/2,r.top+r.height-F/2),this.bottomLeftBorderStroke=f>0||p>0?He(r.left+x/2,r.top+w,f-x/2,p-F/2,Ce.BOTTOM_LEFT):new G(r.left+x/2,r.top+r.height-F/2),this.topLeftBorderBox=A>0||s>0?He(r.left,r.top,A,s,Ce.TOP_LEFT):new G(r.left,r.top),this.topRightBorderBox=a>0||c>0?He(r.left+y,r.top,a,c,Ce.TOP_RIGHT):new G(r.left+r.width,r.top),this.bottomRightBorderBox=l>0||d>0?He(r.left+b,r.top+B,l,d,Ce.BOTTOM_RIGHT):new G(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=f>0||p>0?He(r.left,r.top+w,f,p,Ce.BOTTOM_LEFT):new G(r.left,r.top+r.height),this.topLeftPaddingBox=A>0||s>0?He(r.left+x,r.top+_,Math.max(0,A-x),Math.max(0,s-_),Ce.TOP_LEFT):new G(r.left+x,r.top+_),this.topRightPaddingBox=a>0||c>0?He(r.left+Math.min(y,r.width-k),r.top+_,y>r.width+k?0:Math.max(0,a-k),Math.max(0,c-_),Ce.TOP_RIGHT):new G(r.left+r.width-k,r.top+_),this.bottomRightPaddingBox=l>0||d>0?He(r.left+Math.min(b,r.width-x),r.top+Math.min(B,r.height-F),Math.max(0,l-k),Math.max(0,d-F),Ce.BOTTOM_RIGHT):new G(r.left+r.width-k,r.top+r.height-F),this.bottomLeftPaddingBox=f>0||p>0?He(r.left+x,r.top+Math.min(w,r.height-F),Math.max(0,f-x),Math.max(0,p-F),Ce.BOTTOM_LEFT):new G(r.left+x,r.top+r.height-F),this.topLeftContentBox=A>0||s>0?He(r.left+x+M,r.top+_+U,Math.max(0,A-(x+M)),Math.max(0,s-(_+U)),Ce.TOP_LEFT):new G(r.left+x+M,r.top+_+U),this.topRightContentBox=a>0||c>0?He(r.left+Math.min(y,r.width+x+M),r.top+_+U,y>r.width+x+M?0:a-x+M,c-(_+U),Ce.TOP_RIGHT):new G(r.left+r.width-(k+T),r.top+_+U),this.bottomRightContentBox=l>0||d>0?He(r.left+Math.min(b,r.width-(x+M)),r.top+Math.min(B,r.height+_+U),Math.max(0,l-(k+T)),d-(F+Q),Ce.BOTTOM_RIGHT):new G(r.left+r.width-(k+T),r.top+r.height-(F+Q)),this.bottomLeftContentBox=f>0||p>0?He(r.left+x+M,r.top+w,Math.max(0,f-(x+M)),p-(F+Q),Ce.BOTTOM_LEFT):new G(r.left+x+M,r.top+r.height-(F+Q))}return n}(),Ce;(function(n){n[n.TOP_LEFT=0]="TOP_LEFT",n[n.TOP_RIGHT=1]="TOP_RIGHT",n[n.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",n[n.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Ce||(Ce={}));var He=function(n,e,t,r,i){var A=4*((Math.sqrt(2)-1)/3),s=t*A,o=r*A,a=n+t,c=e+r;switch(i){case Ce.TOP_LEFT:return new So(new G(n,c),new G(n,c-o),new G(a-s,e),new G(a,e));case Ce.TOP_RIGHT:return new So(new G(n,e),new G(n+s,e),new G(a,c-o),new G(a,c));case Ce.BOTTOM_RIGHT:return new So(new G(a,e),new G(a,e+o),new G(n+s,c),new G(n,c));case Ce.BOTTOM_LEFT:default:return new So(new G(a,c),new G(a-s,c),new G(n,e+o),new G(n,e))}},ko=function(n){return[n.topLeftBorderBox,n.topRightBorderBox,n.bottomRightBorderBox,n.bottomLeftBorderBox]},zU=function(n){return[n.topLeftContentBox,n.topRightContentBox,n.bottomRightContentBox,n.bottomLeftContentBox]},Eo=function(n){return[n.topLeftPaddingBox,n.topRightPaddingBox,n.bottomRightPaddingBox,n.bottomLeftPaddingBox]},XU=function(){function n(e,t,r){this.offsetX=e,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return n}(),Uo=function(){function n(e,t){this.path=e,this.target=t,this.type=1}return n}(),YU=function(){function n(e){this.opacity=e,this.type=2,this.target=6}return n}(),ZU=function(n){return n.type===0},Hg=function(n){return n.type===1},$U=function(n){return n.type===2},Kg=function(n,e){return n.length===e.length?n.some(function(t,r){return t===e[r]}):!1},eT=function(n,e,t,r,i){return n.map(function(A,s){switch(s){case 0:return A.add(e,t);case 1:return A.add(e+r,t);case 2:return A.add(e+r,t+i);case 3:return A.add(e,t+i)}return A})},Vg=function(){function n(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return n}(),Gg=function(){function n(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new JU(this.container),this.container.styles.opacity<1&&this.effects.push(new YU(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,A=this.container.styles.transform;this.effects.push(new XU(r,i,A))}if(this.container.styles.overflowX!==0){var s=ko(this.curves),o=Eo(this.curves);Kg(s,o)?this.effects.push(new Uo(s,6)):(this.effects.push(new Uo(s,2)),this.effects.push(new Uo(o,4)))}}return n.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,i=this.effects.slice(0);r;){var A=r.effects.filter(function(a){return!Hg(a)});if(t||r.container.styles.position!==0||!r.parent){if(t=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var s=ko(r.curves),o=Eo(r.curves);Kg(s,o)||i.unshift(new Uo(o,6))}i.unshift.apply(i,A)}else i.unshift.apply(i,A);r=r.parent}return i.filter(function(a){return ut(a.target,e)})},n}(),ju=function(n,e,t,r){n.container.elements.forEach(function(i){var A=ut(i.flags,4),s=ut(i.flags,2),o=new Gg(i,n);ut(i.styles.display,2048)&&r.push(o);var a=ut(i.flags,8)?[]:r;if(A||s){var c=A||i.styles.isPositioned()?t:e,u=new Vg(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var l=i.styles.zIndex.order;if(l<0){var d=0;c.negativeZIndex.some(function(f,p){return l>f.element.container.styles.zIndex.order?(d=p,!1):d>0}),c.negativeZIndex.splice(d,0,u)}else if(l>0){var h=0;c.positiveZIndex.some(function(f,p){return l>=f.element.container.styles.zIndex.order?(h=p+1,!1):h>0}),c.positiveZIndex.splice(h,0,u)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else i.styles.isFloating()?c.nonPositionedFloats.push(u):c.nonPositionedInlineLevel.push(u);ju(o,u,A?u:t,a)}else i.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),ju(o,e,t,a);ut(i.flags,8)&&jg(i,a)})},jg=function(n,e){for(var t=n instanceof Qu?n.start:1,r=n instanceof Qu?n.reversed:!1,i=0;i<e.length;i++){var A=e[i];A.container instanceof mg&&typeof A.container.value=="number"&&A.container.value!==0&&(t=A.container.value),A.listValue=xA(t,A.container.styles.listStyleType,!0),t+=r?-1:1}},tT=function(n){var e=new Gg(n,null),t=new Vg(e),r=[];return ju(e,t,t,r),jg(e.container,r),t},Wg=function(n,e){switch(e){case 0:return Xt(n.topLeftBorderBox,n.topLeftPaddingBox,n.topRightBorderBox,n.topRightPaddingBox);case 1:return Xt(n.topRightBorderBox,n.topRightPaddingBox,n.bottomRightBorderBox,n.bottomRightPaddingBox);case 2:return Xt(n.bottomRightBorderBox,n.bottomRightPaddingBox,n.bottomLeftBorderBox,n.bottomLeftPaddingBox);case 3:default:return Xt(n.bottomLeftBorderBox,n.bottomLeftPaddingBox,n.topLeftBorderBox,n.topLeftPaddingBox)}},nT=function(n,e){switch(e){case 0:return Xt(n.topLeftBorderBox,n.topLeftBorderDoubleOuterBox,n.topRightBorderBox,n.topRightBorderDoubleOuterBox);case 1:return Xt(n.topRightBorderBox,n.topRightBorderDoubleOuterBox,n.bottomRightBorderBox,n.bottomRightBorderDoubleOuterBox);case 2:return Xt(n.bottomRightBorderBox,n.bottomRightBorderDoubleOuterBox,n.bottomLeftBorderBox,n.bottomLeftBorderDoubleOuterBox);case 3:default:return Xt(n.bottomLeftBorderBox,n.bottomLeftBorderDoubleOuterBox,n.topLeftBorderBox,n.topLeftBorderDoubleOuterBox)}},rT=function(n,e){switch(e){case 0:return Xt(n.topLeftBorderDoubleInnerBox,n.topLeftPaddingBox,n.topRightBorderDoubleInnerBox,n.topRightPaddingBox);case 1:return Xt(n.topRightBorderDoubleInnerBox,n.topRightPaddingBox,n.bottomRightBorderDoubleInnerBox,n.bottomRightPaddingBox);case 2:return Xt(n.bottomRightBorderDoubleInnerBox,n.bottomRightPaddingBox,n.bottomLeftBorderDoubleInnerBox,n.bottomLeftPaddingBox);case 3:default:return Xt(n.bottomLeftBorderDoubleInnerBox,n.bottomLeftPaddingBox,n.topLeftBorderDoubleInnerBox,n.topLeftPaddingBox)}},iT=function(n,e){switch(e){case 0:return To(n.topLeftBorderStroke,n.topRightBorderStroke);case 1:return To(n.topRightBorderStroke,n.bottomRightBorderStroke);case 2:return To(n.bottomRightBorderStroke,n.bottomLeftBorderStroke);case 3:default:return To(n.bottomLeftBorderStroke,n.topLeftBorderStroke)}},To=function(n,e){var t=[];return zt(n)?t.push(n.subdivide(.5,!1)):t.push(n),zt(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},Xt=function(n,e,t,r){var i=[];return zt(n)?i.push(n.subdivide(.5,!1)):i.push(n),zt(t)?i.push(t.subdivide(.5,!0)):i.push(t),zt(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),zt(e)?i.push(e.subdivide(.5,!1).reverse()):i.push(e),i},qg=function(n){var e=n.bounds,t=n.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Io=function(n){var e=n.styles,t=n.bounds,r=Se(e.paddingLeft,t.width),i=Se(e.paddingRight,t.width),A=Se(e.paddingTop,t.width),s=Se(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,A+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+i),-(e.borderTopWidth+e.borderBottomWidth+A+s))},AT=function(n,e){return n===0?e.bounds:n===2?Io(e):qg(e)},sT=function(n,e){return n===0?e.bounds:n===2?Io(e):qg(e)},Wu=function(n,e,t){var r=AT(Bi(n.styles.backgroundOrigin,e),n),i=sT(Bi(n.styles.backgroundClip,e),n),A=oT(Bi(n.styles.backgroundSize,e),t,r),s=A[0],o=A[1],a=kA(Bi(n.styles.backgroundPosition,e),r.width-s,r.height-o),c=aT(Bi(n.styles.backgroundRepeat,e),a,A,r,i),u=Math.round(r.left+a[0]),l=Math.round(r.top+a[1]);return s=Math.max(1,s),o=Math.max(1,o),[c,u,l,s,o]},bi=function(n){return ce(n)&&n.value===gi.AUTO},Fo=function(n){return typeof n=="number"},oT=function(n,e,t){var r=e[0],i=e[1],A=e[2],s=n[0],o=n[1];if(!s)return[0,0];if(Pe(s)&&o&&Pe(o))return[Se(s,t.width),Se(o,t.height)];var a=Fo(A);if(ce(s)&&(s.value===gi.CONTAIN||s.value===gi.COVER)){if(Fo(A)){var c=t.width/t.height;return c<A!=(s.value===gi.COVER)?[t.width,t.width/A]:[t.height*A,t.height]}return[t.width,t.height]}var u=Fo(r),l=Fo(i),d=u||l;if(bi(s)&&(!o||bi(o))){if(u&&l)return[r,i];if(!a&&!d)return[t.width,t.height];if(d&&a){var h=u?r:i*A,f=l?i:r/A;return[h,f]}var p=u?r:t.width,g=l?i:t.height;return[p,g]}if(a){var v=0,y=0;return Pe(s)?v=Se(s,t.width):Pe(o)&&(y=Se(o,t.height)),bi(s)?v=y*A:(!o||bi(o))&&(y=v/A),[v,y]}var B=null,b=null;if(Pe(s)?B=Se(s,t.width):o&&Pe(o)&&(b=Se(o,t.height)),B!==null&&(!o||bi(o))&&(b=u&&l?B/r*i:t.height),b!==null&&bi(s)&&(B=u&&l?b/i*r:t.width),B!==null&&b!==null)return[B,b];throw new Error("Unable to calculate background-size for element")},Bi=function(n,e){var t=n[e];return typeof t>"u"?n[0]:t},aT=function(n,e,t,r,i){var A=e[0],s=e[1],o=t[0],a=t[1];switch(n){case 2:return[new G(Math.round(r.left),Math.round(r.top+s)),new G(Math.round(r.left+r.width),Math.round(r.top+s)),new G(Math.round(r.left+r.width),Math.round(a+r.top+s)),new G(Math.round(r.left),Math.round(a+r.top+s))];case 3:return[new G(Math.round(r.left+A),Math.round(r.top)),new G(Math.round(r.left+A+o),Math.round(r.top)),new G(Math.round(r.left+A+o),Math.round(r.height+r.top)),new G(Math.round(r.left+A),Math.round(r.height+r.top))];case 1:return[new G(Math.round(r.left+A),Math.round(r.top+s)),new G(Math.round(r.left+A+o),Math.round(r.top+s)),new G(Math.round(r.left+A+o),Math.round(r.top+s+a)),new G(Math.round(r.left+A),Math.round(r.top+s+a))];default:return[new G(Math.round(i.left),Math.round(i.top)),new G(Math.round(i.left+i.width),Math.round(i.top)),new G(Math.round(i.left+i.width),Math.round(i.height+i.top)),new G(Math.round(i.left),Math.round(i.height+i.top))]}},cT="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Jg="Hidden Text",uT=function(){function n(e){this._data={},this._document=e}return n.prototype.parseMetrics=function(e,t){var r=this._document.createElement("div"),i=this._document.createElement("img"),A=this._document.createElement("span"),s=this._document.body;r.style.visibility="hidden",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",s.appendChild(r),i.src=cT,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",A.style.fontFamily=e,A.style.fontSize=t,A.style.margin="0",A.style.padding="0",A.appendChild(this._document.createTextNode(Jg)),r.appendChild(A),r.appendChild(i);var o=i.offsetTop-A.offsetTop+2;r.removeChild(A),r.appendChild(this._document.createTextNode(Jg)),r.style.lineHeight="normal",i.style.verticalAlign="super";var a=i.offsetTop-r.offsetTop+2;return s.removeChild(r),{baseline:o,middle:a}},n.prototype.getMetrics=function(e,t){var r="".concat(e," ").concat(t);return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(e,t)),this._data[r]},n}(),zg=function(){function n(e,t){this.context=e,this.options=t}return n}(),lT=1e4,dT=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i._activeEffects=[],i.canvas=r.canvas?r.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),r.canvas||(i.canvas.width=Math.floor(r.width*r.scale),i.canvas.height=Math.floor(r.height*r.scale),i.canvas.style.width="".concat(r.width,"px"),i.canvas.style.height="".concat(r.height,"px")),i.fontMetrics=new uT(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-r.x,-r.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized (".concat(r.width,"x").concat(r.height,") with scale ").concat(r.scale)),i}return e.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(i){return r.applyEffect(i)})},e.prototype.applyEffect=function(t){this.ctx.save(),$U(t)&&(this.ctx.globalAlpha=t.opacity),ZU(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),Hg(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return Tt(this,void 0,void 0,function(){var r;return Ct(this,function(i){switch(i.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return Tt(this,void 0,void 0,function(){return Ct(this,function(r){switch(r.label){case 0:return ut(t.container.flags,16),t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(t)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(t,r,i){var A=this;if(r===0)navigator.userAgent.indexOf("Firefox")===-1?(this.ctx.textBaseline="ideographic",this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+t.bounds.height)):this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+i);else{var s=xu(t.text);s.reduce(function(o,a){return A.ctx.fillText(a,o,t.bounds.top+i),o+A.ctx.measureText(a).width},t.bounds.left)}},e.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),i=mT(t.fontFamily).join(", "),A=er(t.fontSize)?"".concat(t.fontSize.number).concat(t.fontSize.unit):"".concat(t.fontSize.number,"px");return[[t.fontStyle,r,t.fontWeight,A,i].join(" "),i,A]},e.prototype.renderTextNode=function(t,r){return Tt(this,void 0,void 0,function(){var i,A,s=this;return Ct(this,function(o){return i=this.createFontStyle(r)[0],this.ctx.font=i,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",A=r.paintOrder,t.textBounds.forEach(function(a){A.forEach(function(c){switch(c){case 0:s.ctx.fillStyle=pt(r.color),s.renderTextWithLetterSpacing(a,r.letterSpacing,r.fontSize.number);var u=r.textShadow;if(u.length&&a.text.trim().length&&(u.slice(0).reverse().forEach(function(d){s.ctx.shadowColor=pt(d.color),s.ctx.shadowOffsetX=d.offsetX.number*s.options.scale,s.ctx.shadowOffsetY=d.offsetY.number*s.options.scale,s.ctx.shadowBlur=d.blur.number,s.renderTextWithLetterSpacing(a,r.letterSpacing,r.fontSize.number)}),s.ctx.shadowColor="",s.ctx.shadowOffsetX=0,s.ctx.shadowOffsetY=0,s.ctx.shadowBlur=0),r.textDecorationLine.length){s.ctx.fillStyle=pt(r.textDecorationColor||r.color);var l=1;r.textDecorationLine.forEach(function(d){switch(d){case 1:s.ctx.fillRect(a.bounds.left,a.bounds.top+a.bounds.height-l,a.bounds.width,l);break;case 2:s.ctx.fillRect(a.bounds.left,a.bounds.top,a.bounds.width,l);break;case 3:s.ctx.fillRect(a.bounds.left,a.bounds.top+(a.bounds.height/2-l/2),a.bounds.width,l);break}})}break;case 1:r.webkitTextStrokeWidth&&a.text.trim().length&&(s.ctx.strokeStyle=pt(r.webkitTextStrokeColor),s.ctx.lineWidth=r.webkitTextStrokeWidth,s.ctx.lineJoin=window.chrome?"miter":"round",s.ctx.strokeText(a.text,a.bounds.left,a.bounds.top+a.bounds.height)),s.ctx.strokeStyle="",s.ctx.lineWidth=0,s.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(t,r,i){var A=i.naturalWidth||t.intrinsicWidth,s=i.naturalHeight||t.intrinsicHeight;if(i&&A>0&&s>0){var o=Io(t),a=Eo(r);this.path(a),this.ctx.save(),this.ctx.clip();var c=0,u=0,l=A,d=s,h=o.left,f=o.top,p=o.width,g=o.height,v=t.styles.objectFit,y=p/g,B=l/d;if(v===2)B>y?(g=p/B,f+=(o.height-g)/2):(p=g*B,h+=(o.width-p)/2);else if(v===4)B>y?(l=d*y,c+=(A-l)/2):(d=l/y,u+=(s-d)/2);else if(v===8)l>p?(c+=(l-p)/2,l=p):(h+=(p-l)/2,p=l),d>g?(u+=(d-g)/2,d=g):(f+=(g-d)/2,g=d);else if(v===16){var b=B>y?p:g*B,w=l>p?l:p;b<w?B>y?(g=p/B,f+=(o.height-g)/2):(p=g*B,h+=(o.width-p)/2):(l>p?(c+=(l-p)/2,l=p):(h+=(p-l)/2,p=l),d>g?(u+=(d-g)/2,d=g):(f+=(g-d)/2,g=d))}this.ctx.drawImage(i,c,u,l,d,h,f,p,g),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return Tt(this,void 0,void 0,function(){var r,i,A,s,o,a,B,B,c,u,l,d,w,h,f,p,_,g,v,y,B,b,w,_;return Ct(this,function(k){switch(k.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,i=t.curves,A=r.styles,s=0,o=r.textNodes,k.label=1;case 1:return s<o.length?(a=o[s],[4,this.renderTextNode(a,A)]):[3,4];case 2:k.sent(),k.label=3;case 3:return s++,[3,1];case 4:if(!(r instanceof pg))return[3,8];k.label=5;case 5:return k.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return B=k.sent(),this.renderReplacedElement(r,i,B),[3,8];case 7:return k.sent(),this.context.logger.error("Error loading image ".concat(r.src)),[3,8];case 8:if(r instanceof fg&&this.renderReplacedElement(r,i,r.canvas),!(r instanceof gg))return[3,12];k.label=9;case 9:return k.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return B=k.sent(),this.renderReplacedElement(r,i,B),[3,12];case 11:return k.sent(),this.context.logger.error("Error loading svg ".concat(r.svg.substring(0,255))),[3,12];case 12:return r instanceof bg&&r.tree?(c=new e(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,c.render(r.tree)]):[3,14];case 13:u=k.sent(),r.width&&r.height&&this.ctx.drawImage(u,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),k.label=14;case 14:if(r instanceof Ru&&(l=Math.min(r.bounds.width,r.bounds.height),r.type===yo?r.checked&&(this.ctx.save(),this.path([new G(r.bounds.left+l*.39363,r.bounds.top+l*.79),new G(r.bounds.left+l*.16,r.bounds.top+l*.5549),new G(r.bounds.left+l*.27347,r.bounds.top+l*.44071),new G(r.bounds.left+l*.39694,r.bounds.top+l*.5649),new G(r.bounds.left+l*.72983,r.bounds.top+l*.23),new G(r.bounds.left+l*.84,r.bounds.top+l*.34085),new G(r.bounds.left+l*.39363,r.bounds.top+l*.79)]),this.ctx.fillStyle=pt(vg),this.ctx.fill(),this.ctx.restore()):r.type===wo&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+l/2,r.bounds.top+l/2,l/4,0,Math.PI*2,!0),this.ctx.fillStyle=pt(vg),this.ctx.fill(),this.ctx.restore())),hT(r)&&r.value.length){switch(d=this.createFontStyle(A),w=d[0],h=d[1],f=d[2],p=this.fontMetrics.getMetrics(h,f).baseline,this.ctx.font=w,this.ctx.fillStyle=pt(A.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=fT(r.styles.textAlign),_=Io(r),g=0,r.styles.textAlign){case 1:g+=_.width/2;break;case 2:g+=_.width;break}v=_.add(g,0,0,-_.height/2+1),this.ctx.save(),this.path([new G(_.left,_.top),new G(_.left+_.width,_.top),new G(_.left+_.width,_.top+_.height),new G(_.left,_.top+_.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new IA(r.value,v),A.letterSpacing,p),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ut(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(y=r.styles.listStyleImage,y.type!==0)return[3,18];B=void 0,b=y.url,k.label=15;case 15:return k.trys.push([15,17,,18]),[4,this.context.cache.match(b)];case 16:return B=k.sent(),this.ctx.drawImage(B,r.bounds.left-(B.width+10),r.bounds.top),[3,18];case 17:return k.sent(),this.context.logger.error("Error loading list-style-image ".concat(b)),[3,18];case 18:return[3,20];case 19:t.listValue&&r.styles.listStyleType!==-1&&(w=this.createFontStyle(A)[0],this.ctx.font=w,this.ctx.fillStyle=pt(A.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",_=new Rn(r.bounds.left,r.bounds.top+Se(r.styles.paddingTop,r.bounds.width),r.bounds.width,zf(A.lineHeight,A.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new IA(t.listValue,_),A.letterSpacing,zf(A.lineHeight,A.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),k.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return Tt(this,void 0,void 0,function(){var r,i,v,A,s,v,o,a,v,c,u,v,l,d,v,h,f,v,p,g,v;return Ct(this,function(y){switch(y.label){case 0:return ut(t.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:y.sent(),r=0,i=t.negativeZIndex,y.label=2;case 2:return r<i.length?(v=i[r],[4,this.renderStack(v)]):[3,5];case 3:y.sent(),y.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:y.sent(),A=0,s=t.nonInlineLevel,y.label=7;case 7:return A<s.length?(v=s[A],[4,this.renderNode(v)]):[3,10];case 8:y.sent(),y.label=9;case 9:return A++,[3,7];case 10:o=0,a=t.nonPositionedFloats,y.label=11;case 11:return o<a.length?(v=a[o],[4,this.renderStack(v)]):[3,14];case 12:y.sent(),y.label=13;case 13:return o++,[3,11];case 14:c=0,u=t.nonPositionedInlineLevel,y.label=15;case 15:return c<u.length?(v=u[c],[4,this.renderStack(v)]):[3,18];case 16:y.sent(),y.label=17;case 17:return c++,[3,15];case 18:l=0,d=t.inlineLevel,y.label=19;case 19:return l<d.length?(v=d[l],[4,this.renderNode(v)]):[3,22];case 20:y.sent(),y.label=21;case 21:return l++,[3,19];case 22:h=0,f=t.zeroOrAutoZIndexOrTransformedOrOpacity,y.label=23;case 23:return h<f.length?(v=f[h],[4,this.renderStack(v)]):[3,26];case 24:y.sent(),y.label=25;case 25:return h++,[3,23];case 26:p=0,g=t.positiveZIndex,y.label=27;case 27:return p<g.length?(v=g[p],[4,this.renderStack(v)]):[3,30];case 28:y.sent(),y.label=29;case 29:return p++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var r=this;t.forEach(function(i,A){var s=zt(i)?i.start:i;A===0?r.ctx.moveTo(s.x,s.y):r.ctx.lineTo(s.x,s.y),zt(i)&&r.ctx.bezierCurveTo(i.startControl.x,i.startControl.y,i.endControl.x,i.endControl.y,i.end.x,i.end.y)})},e.prototype.renderRepeat=function(t,r,i,A){this.path(t),this.ctx.fillStyle=r,this.ctx.translate(i,A),this.ctx.fill(),this.ctx.translate(-i,-A)},e.prototype.resizeImage=function(t,r,i){var A,s=(A=this.canvas.ownerDocument)!==null&&A!==void 0?A:document,o=s.createElement("canvas");o.width=Math.max(1,r),o.height=Math.max(1,i);var a=o.getContext("2d");return a.drawImage(t,0,0,t.width,t.height,0,0,r,i),o},e.prototype.renderBackgroundImage=function(t){return Tt(this,void 0,void 0,function(){var r,i,A,s,o,a;return Ct(this,function(c){switch(c.label){case 0:r=t.styles.backgroundImage.length-1,i=function(u){var l,d,h,f,p,Q,Y,ie,H,q,U,g,Q,Y,ie,H,q,v,y,B,b,w,_,k,F,x,U,T,Q,M,X,H,q,ve,Y,ie,Qe,qe,Be,ht,Re,Ne,ne,et;return Ct(this,function(Z){switch(Z.label){case 0:if(u.type!==0)return[3,5];l=void 0,d=u.url,Z.label=1;case 1:return Z.trys.push([1,3,,4]),[4,A.context.cache.match(d)];case 2:return l=Z.sent(),[3,4];case 3:return Z.sent(),A.context.logger.error("Error loading background-image ".concat(d)),[3,4];case 4:return l&&(h=isNaN(l.width)||l.width===0?1:l.width,f=isNaN(l.height)||l.height===0?1:l.height,p=Wu(t,r,[h,f,h/f]),Q=p[0],Y=p[1],ie=p[2],H=p[3],q=p[4],U=A.ctx.createPattern(A.resizeImage(l,H,q),"repeat"),A.renderRepeat(Q,U,Y,ie)),[3,6];case 5:zk(u)?(g=Wu(t,r,[null,null,null]),Q=g[0],Y=g[1],ie=g[2],H=g[3],q=g[4],v=Gk(u.angle,H,q),y=v[0],B=v[1],b=v[2],w=v[3],_=v[4],k=document.createElement("canvas"),k.width=H,k.height=q,F=k.getContext("2d"),x=F.createLinearGradient(B,w,b,_),Lf(u.stops,y||1).forEach(function(We){return x.addColorStop(We.stop,pt(We.color))}),F.fillStyle=x,F.fillRect(0,0,H,q),H>0&&q>0&&(U=A.ctx.createPattern(k,"repeat"),A.renderRepeat(Q,U,Y,ie))):Xk(u)&&(T=Wu(t,r,[null,null,null]),Q=T[0],M=T[1],X=T[2],H=T[3],q=T[4],ve=u.position.length===0?[hu]:u.position,Y=Se(ve[0],H),ie=Se(ve[ve.length-1],q),Qe=jk(u,Y,ie,H,q),qe=Qe[0],Be=Qe[1],qe>0&&Be>0&&(ht=A.ctx.createRadialGradient(M+Y,X+ie,0,M+Y,X+ie,qe),Lf(u.stops,qe*2).forEach(function(We){return ht.addColorStop(We.stop,pt(We.color))}),A.path(Q),A.ctx.fillStyle=ht,qe!==Be?(Re=t.bounds.left+.5*t.bounds.width,Ne=t.bounds.top+.5*t.bounds.height,ne=Be/qe,et=1/ne,A.ctx.save(),A.ctx.translate(Re,Ne),A.ctx.transform(1,0,0,ne,0,0),A.ctx.translate(-Re,-Ne),A.ctx.fillRect(M,et*(X-Ne)+Ne,H,q*et),A.ctx.restore()):A.ctx.fill())),Z.label=6;case 6:return r--,[2]}})},A=this,s=0,o=t.styles.backgroundImage.slice(0).reverse(),c.label=1;case 1:return s<o.length?(a=o[s],[5,i(a)]):[3,4];case 2:c.sent(),c.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,r,i){return Tt(this,void 0,void 0,function(){return Ct(this,function(A){return this.path(Wg(i,r)),this.ctx.fillStyle=pt(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,r,i,A){return Tt(this,void 0,void 0,function(){var s,o;return Ct(this,function(a){switch(a.label){case 0:return r<3?[4,this.renderSolidBorder(t,i,A)]:[3,2];case 1:return a.sent(),[2];case 2:return s=nT(A,i),this.path(s),this.ctx.fillStyle=pt(t),this.ctx.fill(),o=rT(A,i),this.path(o),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return Tt(this,void 0,void 0,function(){var r,i,A,s,o,a,c,u,l=this;return Ct(this,function(d){switch(d.label){case 0:return this.applyEffects(t.getEffects(2)),r=t.container.styles,i=!rr(r.backgroundColor)||r.backgroundImage.length,A=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],s=pT(Bi(r.backgroundClip,0),t.curves),i||r.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),rr(r.backgroundColor)||(this.ctx.fillStyle=pt(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:d.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(h){l.ctx.save();var f=ko(t.curves),p=h.inset?0:lT,g=eT(f,-p+(h.inset?1:-1)*h.spread.number,(h.inset?1:-1)*h.spread.number,h.spread.number*(h.inset?-2:2),h.spread.number*(h.inset?-2:2));h.inset?(l.path(f),l.ctx.clip(),l.mask(g)):(l.mask(f),l.ctx.clip(),l.path(g)),l.ctx.shadowOffsetX=h.offsetX.number+p,l.ctx.shadowOffsetY=h.offsetY.number,l.ctx.shadowColor=pt(h.color),l.ctx.shadowBlur=h.blur.number,l.ctx.fillStyle=h.inset?pt(h.color):"rgba(0,0,0,1)",l.ctx.fill(),l.ctx.restore()}),d.label=2;case 2:o=0,a=0,c=A,d.label=3;case 3:return a<c.length?(u=c[a],u.style!==0&&!rr(u.color)&&u.width>0?u.style!==2?[3,5]:[4,this.renderDashedDottedBorder(u.color,u.width,o,t.curves,2)]:[3,11]):[3,13];case 4:return d.sent(),[3,11];case 5:return u.style!==3?[3,7]:[4,this.renderDashedDottedBorder(u.color,u.width,o,t.curves,3)];case 6:return d.sent(),[3,11];case 7:return u.style!==4?[3,9]:[4,this.renderDoubleBorder(u.color,u.width,o,t.curves)];case 8:return d.sent(),[3,11];case 9:return[4,this.renderSolidBorder(u.color,o,t.curves)];case 10:d.sent(),d.label=11;case 11:o++,d.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,r,i,A,s){return Tt(this,void 0,void 0,function(){var o,a,c,u,l,d,h,f,p,g,v,y,B,b,w,_,w,_;return Ct(this,function(k){return this.ctx.save(),o=iT(A,i),a=Wg(A,i),s===2&&(this.path(a),this.ctx.clip()),zt(a[0])?(c=a[0].start.x,u=a[0].start.y):(c=a[0].x,u=a[0].y),zt(a[1])?(l=a[1].end.x,d=a[1].end.y):(l=a[1].x,d=a[1].y),i===0||i===2?h=Math.abs(c-l):h=Math.abs(u-d),this.ctx.beginPath(),s===3?this.formatPath(o):this.formatPath(a.slice(0,2)),f=r<3?r*3:r*2,p=r<3?r*2:r,s===3&&(f=r,p=r),g=!0,h<=f*2?g=!1:h<=f*2+p?(v=h/(2*f+p),f*=v,p*=v):(y=Math.floor((h+p)/(f+p)),B=(h-y*f)/(y-1),b=(h-(y+1)*f)/y,p=b<=0||Math.abs(p-B)<Math.abs(p-b)?B:b),g&&(s===3?this.ctx.setLineDash([0,f+p]):this.ctx.setLineDash([f,p])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=pt(t),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&(zt(a[0])&&(w=a[3],_=a[0],this.ctx.beginPath(),this.formatPath([new G(w.end.x,w.end.y),new G(_.start.x,_.start.y)]),this.ctx.stroke()),zt(a[1])&&(w=a[1],_=a[2],this.ctx.beginPath(),this.formatPath([new G(w.end.x,w.end.y),new G(_.start.x,_.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(t){return Tt(this,void 0,void 0,function(){var r;return Ct(this,function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=pt(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=tT(t),[4,this.renderStack(r)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}})})},e}(zg),hT=function(n){return n instanceof wg||n instanceof yg?!0:n instanceof Ru&&n.type!==wo&&n.type!==yo},pT=function(n,e){switch(n){case 0:return ko(e);case 2:return zU(e);case 1:default:return Eo(e)}},fT=function(n){switch(n){case 1:return"center";case 2:return"right";case 0:default:return"left"}},gT=["-apple-system","system-ui"],mT=function(n){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?n.filter(function(e){return gT.indexOf(e)===-1}):n},vT=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.canvas=r.canvas?r.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=r,i.canvas.width=Math.floor(r.width*r.scale),i.canvas.height=Math.floor(r.height*r.scale),i.canvas.style.width="".concat(r.width,"px"),i.canvas.style.height="".concat(r.height,"px"),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-r.x,-r.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized (".concat(r.width,"x").concat(r.height," at ").concat(r.x,",").concat(r.y,") with scale ").concat(r.scale)),i}return e.prototype.render=function(t){return Tt(this,void 0,void 0,function(){var r,i;return Ct(this,function(A){switch(A.label){case 0:return r=Fu(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,yT(r)];case 1:return i=A.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=pt(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e}(zg),yT=function(n){return new Promise(function(e,t){var r=new Image;r.onload=function(){e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(new XMLSerializer().serializeToString(n)))})},wT=function(){function n(e){var t=e.id,r=e.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return n.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console?(()=>{}).apply(console,xs([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},n.prototype.getTime=function(){return Date.now()-this.start},n.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,xs([this.id,"".concat(this.getTime(),"ms")],e,!1))},n.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,xs([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},n.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,xs([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},n.instances={},n}(),bT=function(){function n(e,t){var r;this.windowBounds=t,this.instanceName="#".concat(n.instanceCount++),this.logger=new wT({id:this.instanceName,enabled:e.logging}),this.cache=(r=e.cache)!==null&&r!==void 0?r:new HU(this,e)}return n.instanceCount=1,n}(),BT=function(n,e){return e===void 0&&(e={}),CT(n,e)};typeof window<"u"&&Ku.setContext(window);var CT=function(n,e){return Tt(void 0,void 0,void 0,function(){var t,r,i,A,s,o,a,c,u,l,d,h,f,p,g,v,y,B,b,w,k,_,k,F,x,U,T,Q,M,X,H,q,ve,Y,ie,Qe,qe,Be,ht,Re;return Ct(this,function(Ne){switch(Ne.label){case 0:if(!n||typeof n!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=n.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(r=t.defaultView,!r)throw new Error("Document is not attached to a Window");return i={allowTaint:(F=e.allowTaint)!==null&&F!==void 0?F:!1,imageTimeout:(x=e.imageTimeout)!==null&&x!==void 0?x:15e3,proxy:e.proxy,useCORS:(U=e.useCORS)!==null&&U!==void 0?U:!1,customIsSameOrigin:e.customIsSameOrigin},A=Wc({logging:(T=e.logging)!==null&&T!==void 0?T:!0,cache:e.cache},i),s={windowWidth:(Q=e.windowWidth)!==null&&Q!==void 0?Q:r.innerWidth,windowHeight:(M=e.windowHeight)!==null&&M!==void 0?M:r.innerHeight,scrollX:(X=e.scrollX)!==null&&X!==void 0?X:r.pageXOffset,scrollY:(H=e.scrollY)!==null&&H!==void 0?H:r.pageYOffset},o=new Rn(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),a=new bT(A,o),c=(q=e.foreignObjectRendering)!==null&&q!==void 0?q:!1,u={allowTaint:(ve=e.allowTaint)!==null&&ve!==void 0?ve:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:c,copyStyles:c},a.logger.debug("Starting document clone with size ".concat(o.width,"x").concat(o.height," scrolled to ").concat(-o.left,",").concat(-o.top)),l=new Dg(a,n,u),d=l.clonedReferenceElement,d?[4,l.toIFrame(t,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return h=Ne.sent(),f=Ou(d)||CU(d)?A_(d.ownerDocument):Qs(a,d),p=f.width,g=f.height,v=f.left,y=f.top,B=_T(a,d,e.backgroundColor),b={canvas:e.canvas,backgroundColor:B,scale:(ie=(Y=e.scale)!==null&&Y!==void 0?Y:r.devicePixelRatio)!==null&&ie!==void 0?ie:1,x:((Qe=e.x)!==null&&Qe!==void 0?Qe:0)+v,y:((qe=e.y)!==null&&qe!==void 0?qe:0)+y,width:(Be=e.width)!==null&&Be!==void 0?Be:Math.ceil(p),height:(ht=e.height)!==null&&ht!==void 0?ht:Math.ceil(g)},c?(a.logger.debug("Document cloned, using foreign object rendering"),k=new vT(a,b),[4,k.render(d)]):[3,3];case 2:return w=Ne.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at ".concat(v,",").concat(y," with size ").concat(p,"x").concat(g," using computed rendering")),a.logger.debug("Starting DOM parsing"),_=Cg(a,d),B===_.styles.backgroundColor&&(_.styles.backgroundColor=bn.TRANSPARENT),a.logger.debug("Starting renderer for element at ".concat(b.x,",").concat(b.y," with size ").concat(b.width,"x").concat(b.height)),k=new dT(a,b),[4,k.render(_)];case 4:w=Ne.sent(),Ne.label=5;case 5:return(!((Re=e.removeContainer)!==null&&Re!==void 0)||Re)&&(Dg.destroy(h)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,w]}})})},_T=function(n,e,t){var r=e.ownerDocument,i=r.documentElement?fi(n,getComputedStyle(r.documentElement).backgroundColor):bn.TRANSPARENT,A=r.body?fi(n,getComputedStyle(r.body).backgroundColor):bn.TRANSPARENT,s=typeof t=="string"?fi(n,t):t===null?bn.TRANSPARENT:4294967295;return e===r.documentElement?rr(i)?rr(A)?s:A:i:s};function ST(n,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if(r!=="default"&&!(r in n)){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(n)}var kT=Object.defineProperty,ET=(n,e,t)=>e in n?kT(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Xg=(n,e,t)=>ET(n,typeof e!="symbol"?e+"":e,t);let Mt=class{constructor(){Xg(this,"_locking"),Xg(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){this._locks+=1;let e;const t=new Promise(i=>e=()=>{this._locks-=1,i()}),r=this._locking.then(()=>e);return this._locking=this._locking.then(()=>t),r}};function Xe(n,e){if(!n)throw new Error(e)}const UT=34028234663852886e22,TT=-34028234663852886e22,IT=4294967295,FT=2147483647,xT=-2147483648;function xo(n){if(typeof n!="number")throw new Error("invalid int 32: "+typeof n);if(!Number.isInteger(n)||n>FT||n<xT)throw new Error("invalid int 32: "+n)}function qu(n){if(typeof n!="number")throw new Error("invalid uint 32: "+typeof n);if(!Number.isInteger(n)||n>IT||n<0)throw new Error("invalid uint 32: "+n)}function Yg(n){if(typeof n!="number")throw new Error("invalid float 32: "+typeof n);if(Number.isFinite(n)&&(n>UT||n<TT))throw new Error("invalid float 32: "+n)}const Zg=Symbol("@bufbuild/protobuf/enum-type");function QT(n){const e=n[Zg];return Xe(e,"missing enum type on enum object"),e}function $g(n,e,t,r){n[Zg]=em(e,t.map(i=>({no:i.no,name:i.name,localName:n[i.no]})))}function em(n,e,t){const r=Object.create(null),i=Object.create(null),A=[];for(const s of e){const o=tm(s);A.push(o),r[s.name]=o,i[s.no]=o}return{typeName:n,values:A,findName(s){return r[s]},findNumber(s){return i[s]}}}function RT(n,e,t){const r={};for(const i of e){const A=tm(i);r[A.localName]=A.no,r[A.no]=A.localName}return $g(r,n,e),r}function tm(n){return"localName"in n?n:Object.assign(Object.assign({},n),{localName:n.name})}class Ju{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,t){const r=this.getType(),i=r.runtime.bin,A=i.makeReadOptions(t);return i.readMessage(this,A.readerFactory(e),e.byteLength,A),this}fromJson(e,t){const r=this.getType(),i=r.runtime.json,A=i.makeReadOptions(t);return i.readMessage(r,e,A,this),this}fromJsonString(e,t){let r;try{r=JSON.parse(e)}catch(i){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(i instanceof Error?i.message:String(i)))}return this.fromJson(r,t)}toBinary(e){const t=this.getType(),r=t.runtime.bin,i=r.makeWriteOptions(e),A=i.writerFactory();return r.writeMessage(this,A,i),A.finish()}toJson(e){const t=this.getType(),r=t.runtime.json,i=r.makeWriteOptions(e);return r.writeMessage(this,i)}toJsonString(e){var t;const r=this.toJson(e);return JSON.stringify(r,null,(t=e==null?void 0:e.prettySpaces)!==null&&t!==void 0?t:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function PT(n,e,t,r){var i;const A=(i=r==null?void 0:r.localName)!==null&&i!==void 0?i:e.substring(e.lastIndexOf(".")+1),s={[A]:function(o){n.util.initFields(this),n.util.initPartial(o,this)}}[A];return Object.setPrototypeOf(s.prototype,new Ju),Object.assign(s,{runtime:n,typeName:e,fields:n.util.newFieldList(t),fromBinary(o,a){return new s().fromBinary(o,a)},fromJson(o,a){return new s().fromJson(o,a)},fromJsonString(o,a){return new s().fromJsonString(o,a)},equals(o,a){return n.util.equals(s,o,a)}}),s}function OT(){let n=0,e=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(n|=(i&127)<<r,!(i&128))return this.assertBounds(),[n,e]}let t=this.buf[this.pos++];if(n|=(t&15)<<28,e=(t&112)>>4,!(t&128))return this.assertBounds(),[n,e];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<r,!(i&128))return this.assertBounds(),[n,e]}throw new Error("invalid varint")}function zu(n,e,t){for(let A=0;A<28;A=A+7){const s=n>>>A,o=!(!(s>>>7)&&e==0),a=(o?s|128:s)&255;if(t.push(a),!o)return}const r=n>>>28&15|(e&7)<<4,i=!!(e>>3);if(t.push((i?r|128:r)&255),!!i){for(let A=3;A<31;A=A+7){const s=e>>>A,o=!!(s>>>7),a=(o?s|128:s)&255;if(t.push(a),!o)return}t.push(e>>>31&1)}}const Qo=4294967296;function nm(n){const e=n[0]==="-";e&&(n=n.slice(1));const t=1e6;let r=0,i=0;function A(s,o){const a=Number(n.slice(s,o));i*=t,r=r*t+a,r>=Qo&&(i=i+(r/Qo|0),r=r%Qo)}return A(-24,-18),A(-18,-12),A(-12,-6),A(-6),e?im(r,i):Xu(r,i)}function MT(n,e){let t=Xu(n,e);const r=t.hi&2147483648;r&&(t=im(t.lo,t.hi));const i=rm(t.lo,t.hi);return r?"-"+i:i}function rm(n,e){if({lo:n,hi:e}=LT(n,e),e<=2097151)return String(Qo*e+n);const t=n&16777215,r=(n>>>24|e<<8)&16777215,i=e>>16&65535;let A=t+r*6777216+i*6710656,s=r+i*8147497,o=i*2;const a=1e7;return A>=a&&(s+=Math.floor(A/a),A%=a),s>=a&&(o+=Math.floor(s/a),s%=a),o.toString()+Am(s)+Am(A)}function LT(n,e){return{lo:n>>>0,hi:e>>>0}}function Xu(n,e){return{lo:n|0,hi:e|0}}function im(n,e){return e=~e,n?n=~n+1:e+=1,Xu(n,e)}const Am=n=>{const e=String(n);return"0000000".slice(e.length)+e};function sm(n,e){if(n>=0){for(;n>127;)e.push(n&127|128),n=n>>>7;e.push(n)}else{for(let t=0;t<9;t++)e.push(n&127|128),n=n>>7;e.push(1)}}function DT(){let n=this.buf[this.pos++],e=n&127;if(!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<7,!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<14,!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<21,!(n&128))return this.assertBounds(),e;n=this.buf[this.pos++],e|=(n&15)<<28;for(let t=5;n&128&&t<10;t++)n=this.buf[this.pos++];if(n&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function NT(){const n=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof n.getBigInt64=="function"&&typeof n.getBigUint64=="function"&&typeof n.setBigInt64=="function"&&typeof n.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const i=BigInt("-9223372036854775808"),A=BigInt("9223372036854775807"),s=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){const c=typeof a=="bigint"?a:BigInt(a);if(c>A||c<i)throw new Error("int64 invalid: ".concat(a));return c},uParse(a){const c=typeof a=="bigint"?a:BigInt(a);if(c>o||c<s)throw new Error("uint64 invalid: ".concat(a));return c},enc(a){return n.setBigInt64(0,this.parse(a),!0),{lo:n.getInt32(0,!0),hi:n.getInt32(4,!0)}},uEnc(a){return n.setBigInt64(0,this.uParse(a),!0),{lo:n.getInt32(0,!0),hi:n.getInt32(4,!0)}},dec(a,c){return n.setInt32(0,a,!0),n.setInt32(4,c,!0),n.getBigInt64(0,!0)},uDec(a,c){return n.setInt32(0,a,!0),n.setInt32(4,c,!0),n.getBigUint64(0,!0)}}}const t=i=>Xe(/^-?[0-9]+$/.test(i),"int64 invalid: ".concat(i)),r=i=>Xe(/^[0-9]+$/.test(i),"uint64 invalid: ".concat(i));return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),t(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),r(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),t(i),nm(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),r(i),nm(i)},dec(i,A){return MT(i,A)},uDec(i,A){return rm(i,A)}}}const Ke=NT();var R;(function(n){n[n.DOUBLE=1]="DOUBLE",n[n.FLOAT=2]="FLOAT",n[n.INT64=3]="INT64",n[n.UINT64=4]="UINT64",n[n.INT32=5]="INT32",n[n.FIXED64=6]="FIXED64",n[n.FIXED32=7]="FIXED32",n[n.BOOL=8]="BOOL",n[n.STRING=9]="STRING",n[n.BYTES=12]="BYTES",n[n.UINT32=13]="UINT32",n[n.SFIXED32=15]="SFIXED32",n[n.SFIXED64=16]="SFIXED64",n[n.SINT32=17]="SINT32",n[n.SINT64=18]="SINT64"})(R||(R={}));var ar;(function(n){n[n.BIGINT=0]="BIGINT",n[n.STRING=1]="STRING"})(ar||(ar={}));function cr(n,e,t){if(e===t)return!0;if(n==R.BYTES){if(!(e instanceof Uint8Array)||!(t instanceof Uint8Array)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}switch(n){case R.UINT64:case R.FIXED64:case R.INT64:case R.SFIXED64:case R.SINT64:return e==t}return!1}function Ci(n,e){switch(n){case R.BOOL:return!1;case R.UINT64:case R.FIXED64:case R.INT64:case R.SFIXED64:case R.SINT64:return e==0?Ke.zero:"0";case R.DOUBLE:case R.FLOAT:return 0;case R.BYTES:return new Uint8Array(0);case R.STRING:return"";default:return 0}}function om(n,e){switch(n){case R.BOOL:return e===!1;case R.STRING:return e==="";case R.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}var rt;(function(n){n[n.Varint=0]="Varint",n[n.Bit64=1]="Bit64",n[n.LengthDelimited=2]="LengthDelimited",n[n.StartGroup=3]="StartGroup",n[n.EndGroup=4]="EndGroup",n[n.Bit32=5]="Bit32"})(rt||(rt={}));class HT{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i<this.chunks.length;i++)e+=this.chunks[i].length;let t=new Uint8Array(e),r=0;for(let i=0;i<this.chunks.length;i++)t.set(this.chunks[i],r),r+=this.chunks[i].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(qu(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return xo(e),sm(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){Yg(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){qu(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){xo(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return xo(e),e=(e<<1^e>>31)>>>0,sm(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),i=Ke.enc(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),i=Ke.uEnc(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(t)}int64(e){let t=Ke.enc(e);return zu(t.lo,t.hi,this.buf),this}sint64(e){let t=Ke.enc(e),r=t.hi>>31,i=t.lo<<1^r,A=(t.hi<<1|t.lo>>>31)^r;return zu(i,A,this.buf),this}uint64(e){let t=Ke.uEnc(e);return zu(t.lo,t.hi,this.buf),this}}class KT{constructor(e,t){this.varint64=OT,this.uint32=DT,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t??new TextDecoder}tag(){let e=this.uint32(),t=e>>>3,r=e&7;if(t<=0||r<0||r>5)throw new Error("illegal tag: field no "+t+" wire type "+r);return[t,r]}skip(e,t){let r=this.pos;switch(e){case rt.Varint:for(;this.buf[this.pos++]&128;);break;case rt.Bit64:this.pos+=4;case rt.Bit32:this.pos+=4;break;case rt.LengthDelimited:let i=this.uint32();this.pos+=i;break;case rt.StartGroup:for(;;){const[A,s]=this.tag();if(s===rt.EndGroup){if(t!==void 0&&A!==t)throw new Error("invalid end group tag");break}this.skip(s,A)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return Ke.dec(...this.varint64())}uint64(){return Ke.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),r=-(e&1);return e=(e>>>1|(t&1)<<31)^r,t=t>>>1^r,Ke.dec(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Ke.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Ke.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}}function VT(n,e,t,r){let i;return{typeName:e,extendee:t,get field(){if(!i){const A=typeof r=="function"?r():r;A.name=e.split(".").pop(),A.jsonName="[".concat(e,"]"),i=n.util.newFieldList([A]).list()[0]}return i},runtime:n}}function am(n){const e=n.field.localName,t=Object.create(null);return t[e]=GT(n),[t,()=>t[e]]}function GT(n){const e=n.field;if(e.repeated)return[];if(e.default!==void 0)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;case"scalar":return Ci(e.T,e.L);case"message":const t=e.T,r=new t;return t.fieldWrapper?t.fieldWrapper.unwrapField(r):r;case"map":throw"map fields are not allowed to be extensions"}}function jT(n,e){if(!e.repeated&&(e.kind=="enum"||e.kind=="scalar")){for(let t=n.length-1;t>=0;--t)if(n[t].no==e.no)return[n[t]];return[]}return n.filter(t=>t.no===e.no)}let Mn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ro=[];for(let n=0;n<Mn.length;n++)Ro[Mn[n].charCodeAt(0)]=n;Ro["-".charCodeAt(0)]=Mn.indexOf("+"),Ro["_".charCodeAt(0)]=Mn.indexOf("/");const cm={dec(n){let e=n.length*3/4;n[n.length-2]=="="?e-=2:n[n.length-1]=="="&&(e-=1);let t=new Uint8Array(e),r=0,i=0,A,s=0;for(let o=0;o<n.length;o++){if(A=Ro[n.charCodeAt(o)],A===void 0)switch(n[o]){case"=":i=0;case`
6
- `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:s=A,i=1;break;case 1:t[r++]=s<<2|(A&48)>>4,s=A,i=2;break;case 2:t[r++]=(s&15)<<4|(A&60)>>2,s=A,i=3;break;case 3:t[r++]=(s&3)<<6|A,i=0;break}}if(i==1)throw Error("invalid base64 string.");return t.subarray(0,r)},enc(n){let e="",t=0,r,i=0;for(let A=0;A<n.length;A++)switch(r=n[A],t){case 0:e+=Mn[r>>2],i=(r&3)<<4,t=1;break;case 1:e+=Mn[i|r>>4],i=(r&15)<<2,t=2;break;case 2:e+=Mn[i|r>>6],e+=Mn[r&63],t=0;break}return t&&(e+=Mn[i],e+="=",t==1&&(e+="=")),e}};function WT(n,e,t){lm(e,n);const r=e.runtime.bin.makeReadOptions(t),i=jT(n.getType().runtime.bin.listUnknownFields(n),e.field),[A,s]=am(e);for(const o of i)e.runtime.bin.readField(A,r.readerFactory(o.data),e.field,o.wireType,r);return s()}function qT(n,e,t,r){lm(e,n);const i=e.runtime.bin.makeReadOptions(r),A=e.runtime.bin.makeWriteOptions(r);if(um(n,e)){const c=n.getType().runtime.bin.listUnknownFields(n).filter(u=>u.no!=e.field.no);n.getType().runtime.bin.discardUnknownFields(n);for(const u of c)n.getType().runtime.bin.onUnknownField(n,u.no,u.wireType,u.data)}const s=A.writerFactory();let o=e.field;!o.opt&&!o.repeated&&(o.kind=="enum"||o.kind=="scalar")&&(o=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(o,t,s,A);const a=i.readerFactory(s.finish());for(;a.pos<a.len;){const[c,u]=a.tag(),l=a.skip(u,c);n.getType().runtime.bin.onUnknownField(n,c,u,l)}}function um(n,e){const t=n.getType();return e.extendee.typeName===t.typeName&&!!t.runtime.bin.listUnknownFields(n).find(r=>r.no==e.field.no)}function lm(n,e){Xe(n.extendee.typeName==e.getType().typeName,"extension ".concat(n.typeName," can only be applied to message ").concat(n.extendee.typeName))}function dm(n,e){const t=n.localName;if(n.repeated)return e[t].length>0;if(n.oneof)return e[n.oneof.localName].case===t;switch(n.kind){case"enum":case"scalar":return n.opt||n.req?e[t]!==void 0:n.kind=="enum"?e[t]!==n.T.values[0].no:!om(n.T,e[t]);case"message":return e[t]!==void 0;case"map":return Object.keys(e[t]).length>0}}function hm(n,e){const t=n.localName,r=!n.opt&&!n.req;if(n.repeated)e[t]=[];else if(n.oneof)e[n.oneof.localName]={case:void 0};else switch(n.kind){case"map":e[t]={};break;case"enum":e[t]=r?n.T.values[0].no:void 0;break;case"scalar":e[t]=r?Ci(n.T,n.L):void 0;break;case"message":e[t]=void 0;break}}function Hr(n,e){if(n===null||typeof n!="object"||!Object.getOwnPropertyNames(Ju.prototype).every(r=>r in n&&typeof n[r]=="function"))return!1;const t=n.getType();return t===null||typeof t!="function"||!("typeName"in t)||typeof t.typeName!="string"?!1:e===void 0?!0:t.typeName==e.typeName}function pm(n,e){return Hr(e)||!n.fieldWrapper?e:n.fieldWrapper.wrapField(e)}R.DOUBLE,R.FLOAT,R.INT64,R.UINT64,R.INT32,R.UINT32,R.BOOL,R.STRING,R.BYTES;const fm={ignoreUnknownFields:!1},gm={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function JT(n){return n?Object.assign(Object.assign({},fm),n):fm}function zT(n){return n?Object.assign(Object.assign({},gm),n):gm}const Po=Symbol(),Oo=Symbol();function XT(){return{makeReadOptions:JT,makeWriteOptions:zT,readMessage(n,e,t,r){if(e==null||Array.isArray(e)||typeof e!="object")throw new Error("cannot decode message ".concat(n.typeName," from JSON: ").concat(Cn(e)));r=r??new n;const i=new Map,A=t.typeRegistry;for(const[s,o]of Object.entries(e)){const a=n.fields.findJsonName(s);if(a){if(a.oneof){if(o===null&&a.kind=="scalar")continue;const c=i.get(a.oneof);if(c!==void 0)throw new Error("cannot decode message ".concat(n.typeName,' from JSON: multiple keys for oneof "').concat(a.oneof.name,'" present: "').concat(c,'", "').concat(s,'"'));i.set(a.oneof,s)}mm(r,o,a,t,n)}else{let c=!1;if(A!=null&&A.findExtension&&s.startsWith("[")&&s.endsWith("]")){const u=A.findExtension(s.substring(1,s.length-1));if(u&&u.extendee.typeName==n.typeName){c=!0;const[l,d]=am(u);mm(l,o,u.field,t,u),qT(r,u,d(),t)}}if(!c&&!t.ignoreUnknownFields)throw new Error("cannot decode message ".concat(n.typeName,' from JSON: key "').concat(s,'" is unknown'))}}return r},writeMessage(n,e){const t=n.getType(),r={};let i;try{for(i of t.fields.byNumber()){if(!dm(i,n)){if(i.req)throw"required field not set";if(!e.emitDefaultValues||!ZT(i))continue}const s=i.oneof?n[i.oneof.localName].value:n[i.localName],o=vm(i,s,e);o!==void 0&&(r[e.useProtoFieldName?i.name:i.jsonName]=o)}const A=e.typeRegistry;if(A!=null&&A.findExtensionFor)for(const s of t.runtime.bin.listUnknownFields(n)){const o=A.findExtensionFor(t.typeName,s.no);if(o&&um(n,o)){const a=WT(n,o,e),c=vm(o.field,a,e);c!==void 0&&(r[o.field.jsonName]=c)}}}catch(A){const s=i?"cannot encode field ".concat(t.typeName,".").concat(i.name," to JSON"):"cannot encode message ".concat(t.typeName," to JSON"),o=A instanceof Error?A.message:String(A);throw new Error(s+(o.length>0?": ".concat(o):""))}return r},readScalar(n,e,t){return RA(n,e,t??ar.BIGINT,!0)},writeScalar(n,e,t){if(e!==void 0&&(t||om(n,e)))return Mo(n,e)},debug:Cn}}function Cn(n){if(n===null)return"null";switch(typeof n){case"object":return Array.isArray(n)?"array":"object";case"string":return n.length>100?"string":'"'.concat(n.split('"').join('\\"'),'"');default:return String(n)}}function mm(n,e,t,r,i){let A=t.localName;if(t.repeated){if(Xe(t.kind!="map"),e===null)return;if(!Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Cn(e)));const s=n[A];for(const o of e){if(o===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Cn(o)));switch(t.kind){case"message":s.push(t.T.fromJson(o,r));break;case"enum":const a=Yu(t.T,o,r.ignoreUnknownFields,!0);a!==Oo&&s.push(a);break;case"scalar":try{s.push(RA(t.T,o,t.L,!0))}catch(c){let u="cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Cn(o));throw c instanceof Error&&c.message.length>0&&(u+=": ".concat(c.message)),new Error(u)}break}}}else if(t.kind=="map"){if(e===null)return;if(typeof e!="object"||Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Cn(e)));const s=n[A];for(const[o,a]of Object.entries(e)){if(a===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: map value null"));let c;try{c=YT(t.K,o)}catch(u){let l="cannot decode map key for field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Cn(e));throw u instanceof Error&&u.message.length>0&&(l+=": ".concat(u.message)),new Error(l)}switch(t.V.kind){case"message":s[c]=t.V.T.fromJson(a,r);break;case"enum":const u=Yu(t.V.T,a,r.ignoreUnknownFields,!0);u!==Oo&&(s[c]=u);break;case"scalar":try{s[c]=RA(t.V.T,a,ar.BIGINT,!0)}catch(l){let d="cannot decode map value for field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Cn(e));throw l instanceof Error&&l.message.length>0&&(d+=": ".concat(l.message)),new Error(d)}break}}}else switch(t.oneof&&(n=n[t.oneof.localName]={case:A},A="value"),t.kind){case"message":const s=t.T;if(e===null&&s.typeName!="google.protobuf.Value")return;let o=n[A];Hr(o)?o.fromJson(e,r):(n[A]=o=s.fromJson(e,r),s.fieldWrapper&&!t.oneof&&(n[A]=s.fieldWrapper.unwrapField(o)));break;case"enum":const a=Yu(t.T,e,r.ignoreUnknownFields,!1);switch(a){case Po:hm(t,n);break;case Oo:break;default:n[A]=a;break}break;case"scalar":try{const c=RA(t.T,e,t.L,!1);switch(c){case Po:hm(t,n);break;default:n[A]=c;break}}catch(c){let u="cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Cn(e));throw c instanceof Error&&c.message.length>0&&(u+=": ".concat(c.message)),new Error(u)}break}}function YT(n,e){if(n===R.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return RA(n,e,ar.BIGINT,!0).toString()}function RA(n,e,t,r){if(e===null)return r?Ci(n,t):Po;switch(n){case R.DOUBLE:case R.FLOAT:if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""||typeof e=="string"&&e.trim().length!==e.length||typeof e!="string"&&typeof e!="number")break;const i=Number(e);if(Number.isNaN(i)||!Number.isFinite(i))break;return n==R.FLOAT&&Yg(i),i;case R.INT32:case R.FIXED32:case R.SFIXED32:case R.SINT32:case R.UINT32:let A;if(typeof e=="number"?A=e:typeof e=="string"&&e.length>0&&e.trim().length===e.length&&(A=Number(e)),A===void 0)break;return n==R.UINT32||n==R.FIXED32?qu(A):xo(A),A;case R.INT64:case R.SFIXED64:case R.SINT64:if(typeof e!="number"&&typeof e!="string")break;const s=Ke.parse(e);return t?s.toString():s;case R.FIXED64:case R.UINT64:if(typeof e!="number"&&typeof e!="string")break;const o=Ke.uParse(e);return t?o.toString():o;case R.BOOL:if(typeof e!="boolean")break;return e;case R.STRING:if(typeof e!="string")break;try{encodeURIComponent(e)}catch{throw new Error("invalid UTF8")}return e;case R.BYTES:if(e==="")return new Uint8Array(0);if(typeof e!="string")break;return cm.dec(e)}throw new Error}function Yu(n,e,t,r){if(e===null)return n.typeName=="google.protobuf.NullValue"?0:r?n.values[0].no:Po;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const i=n.findName(e);if(i!==void 0)return i.no;if(t)return Oo;break}throw new Error("cannot decode enum ".concat(n.typeName," from JSON: ").concat(Cn(e)))}function ZT(n){return n.repeated||n.kind=="map"?!0:!(n.oneof||n.kind=="message"||n.opt||n.req)}function vm(n,e,t){if(n.kind=="map"){Xe(typeof e=="object"&&e!=null);const r={},i=Object.entries(e);switch(n.V.kind){case"scalar":for(const[s,o]of i)r[s.toString()]=Mo(n.V.T,o);break;case"message":for(const[s,o]of i)r[s.toString()]=o.toJson(t);break;case"enum":const A=n.V.T;for(const[s,o]of i)r[s.toString()]=Zu(A,o,t.enumAsInteger);break}return t.emitDefaultValues||i.length>0?r:void 0}if(n.repeated){Xe(Array.isArray(e));const r=[];switch(n.kind){case"scalar":for(let i=0;i<e.length;i++)r.push(Mo(n.T,e[i]));break;case"enum":for(let i=0;i<e.length;i++)r.push(Zu(n.T,e[i],t.enumAsInteger));break;case"message":for(let i=0;i<e.length;i++)r.push(e[i].toJson(t));break}return t.emitDefaultValues||r.length>0?r:void 0}switch(n.kind){case"scalar":return Mo(n.T,e);case"enum":return Zu(n.T,e,t.enumAsInteger);case"message":return pm(n.T,e).toJson(t)}}function Zu(n,e,t){var r;if(Xe(typeof e=="number"),n.typeName=="google.protobuf.NullValue")return null;if(t)return e;const i=n.findNumber(e);return(r=i==null?void 0:i.name)!==null&&r!==void 0?r:e}function Mo(n,e){switch(n){case R.INT32:case R.SFIXED32:case R.SINT32:case R.FIXED32:case R.UINT32:return Xe(typeof e=="number"),e;case R.FLOAT:case R.DOUBLE:return Xe(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case R.STRING:return Xe(typeof e=="string"),e;case R.BOOL:return Xe(typeof e=="boolean"),e;case R.UINT64:case R.FIXED64:case R.INT64:case R.SFIXED64:case R.SINT64:return Xe(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case R.BYTES:return Xe(e instanceof Uint8Array),cm.enc(e)}}const _i=Symbol("@bufbuild/protobuf/unknown-fields"),ym={readUnknownFields:!0,readerFactory:n=>new KT(n)},wm={writeUnknownFields:!0,writerFactory:()=>new HT};function $T(n){return n?Object.assign(Object.assign({},ym),n):ym}function eI(n){return n?Object.assign(Object.assign({},wm),n):wm}function tI(){return{makeReadOptions:$T,makeWriteOptions:eI,listUnknownFields(n){var e;return(e=n[_i])!==null&&e!==void 0?e:[]},discardUnknownFields(n){delete n[_i]},writeUnknownFields(n,e){const r=n[_i];if(r)for(const i of r)e.tag(i.no,i.wireType).raw(i.data)},onUnknownField(n,e,t,r){const i=n;Array.isArray(i[_i])||(i[_i]=[]),i[_i].push({no:e,wireType:t,data:r})},readMessage(n,e,t,r,i){const A=n.getType(),s=i?e.len:e.pos+t;let o,a;for(;e.pos<s&&([o,a]=e.tag(),!(i===!0&&a==rt.EndGroup));){const c=A.fields.find(o);if(!c){const u=e.skip(a,o);r.readUnknownFields&&this.onUnknownField(n,o,a,u);continue}bm(n,e,c,a,r)}if(i&&(a!=rt.EndGroup||o!==t))throw new Error("invalid end group tag")},readField:bm,writeMessage(n,e,t){const r=n.getType();for(const i of r.fields.byNumber()){if(!dm(i,n)){if(i.req)throw new Error("cannot encode field ".concat(r.typeName,".").concat(i.name," to binary: required field not set"));continue}const A=i.oneof?n[i.oneof.localName].value:n[i.localName];Bm(i,A,e,t)}return t.writeUnknownFields&&this.writeUnknownFields(n,e),e},writeField(n,e,t,r){e!==void 0&&Bm(n,e,t,r)}}}function bm(n,e,t,r,i){let{repeated:A,localName:s}=t;switch(t.oneof&&(n=n[t.oneof.localName],n.case!=s&&delete n.value,n.case=s,s="value"),t.kind){case"scalar":case"enum":const o=t.kind=="enum"?R.INT32:t.T;let a=Do;if(t.kind=="scalar"&&t.L>0&&(a=rI),A){let d=n[s];if(r==rt.LengthDelimited&&o!=R.STRING&&o!=R.BYTES){let f=e.uint32()+e.pos;for(;e.pos<f;)d.push(a(e,o))}else d.push(a(e,o))}else n[s]=a(e,o);break;case"message":const c=t.T;A?n[s].push(Lo(e,new c,i,t)):Hr(n[s])?Lo(e,n[s],i,t):(n[s]=Lo(e,new c,i,t),c.fieldWrapper&&!t.oneof&&!t.repeated&&(n[s]=c.fieldWrapper.unwrapField(n[s])));break;case"map":let[u,l]=nI(t,e,i);n[s][u]=l;break}}function Lo(n,e,t,r){const i=e.getType().runtime.bin,A=r==null?void 0:r.delimited;return i.readMessage(e,n,A?r.no:n.uint32(),t,A),e}function nI(n,e,t){const r=e.uint32(),i=e.pos+r;let A,s;for(;e.pos<i;){const[o]=e.tag();switch(o){case 1:A=Do(e,n.K);break;case 2:switch(n.V.kind){case"scalar":s=Do(e,n.V.T);break;case"enum":s=e.int32();break;case"message":s=Lo(e,new n.V.T,t,void 0);break}break}}if(A===void 0&&(A=Ci(n.K,ar.BIGINT)),typeof A!="string"&&typeof A!="number"&&(A=A.toString()),s===void 0)switch(n.V.kind){case"scalar":s=Ci(n.V.T,ar.BIGINT);break;case"enum":s=n.V.T.values[0].no;break;case"message":s=new n.V.T;break}return[A,s]}function rI(n,e){const t=Do(n,e);return typeof t=="bigint"?t.toString():t}function Do(n,e){switch(e){case R.STRING:return n.string();case R.BOOL:return n.bool();case R.DOUBLE:return n.double();case R.FLOAT:return n.float();case R.INT32:return n.int32();case R.INT64:return n.int64();case R.UINT64:return n.uint64();case R.FIXED64:return n.fixed64();case R.BYTES:return n.bytes();case R.FIXED32:return n.fixed32();case R.SFIXED32:return n.sfixed32();case R.SFIXED64:return n.sfixed64();case R.SINT64:return n.sint64();case R.UINT32:return n.uint32();case R.SINT32:return n.sint32()}}function Bm(n,e,t,r){Xe(e!==void 0);const i=n.repeated;switch(n.kind){case"scalar":case"enum":let A=n.kind=="enum"?R.INT32:n.T;if(i)if(Xe(Array.isArray(e)),n.packed)AI(t,A,n.no,e);else for(const s of e)PA(t,A,n.no,s);else PA(t,A,n.no,e);break;case"message":if(i){Xe(Array.isArray(e));for(const s of e)Cm(t,r,n,s)}else Cm(t,r,n,e);break;case"map":Xe(typeof e=="object"&&e!=null);for(const[s,o]of Object.entries(e))iI(t,r,n,s,o);break}}function iI(n,e,t,r,i){n.tag(t.no,rt.LengthDelimited),n.fork();let A=r;switch(t.K){case R.INT32:case R.FIXED32:case R.UINT32:case R.SFIXED32:case R.SINT32:A=Number.parseInt(r);break;case R.BOOL:Xe(r=="true"||r=="false"),A=r=="true";break}switch(PA(n,t.K,1,A),t.V.kind){case"scalar":PA(n,t.V.T,2,i);break;case"enum":PA(n,R.INT32,2,i);break;case"message":Xe(i!==void 0),n.tag(2,rt.LengthDelimited).bytes(i.toBinary(e));break}n.join()}function Cm(n,e,t,r){const i=pm(t.T,r);t.delimited?n.tag(t.no,rt.StartGroup).raw(i.toBinary(e)).tag(t.no,rt.EndGroup):n.tag(t.no,rt.LengthDelimited).bytes(i.toBinary(e))}function PA(n,e,t,r){Xe(r!==void 0);let[i,A]=_m(e);n.tag(t,i)[A](r)}function AI(n,e,t,r){if(!r.length)return;n.tag(t,rt.LengthDelimited).fork();let[,i]=_m(e);for(let A=0;A<r.length;A++)n[i](r[A]);n.join()}function _m(n){let e=rt.Varint;switch(n){case R.BYTES:case R.STRING:e=rt.LengthDelimited;break;case R.DOUBLE:case R.FIXED64:case R.SFIXED64:e=rt.Bit64;break;case R.FIXED32:case R.SFIXED32:case R.FLOAT:e=rt.Bit32;break}const t=R[n].toLowerCase();return[e,t]}function sI(){return{setEnumType:$g,initPartial(n,e){if(n===void 0)return;const t=e.getType();for(const r of t.fields.byMember()){const i=r.localName,A=e,s=n;if(s[i]!=null)switch(r.kind){case"oneof":const o=s[i].case;if(o===void 0)continue;const a=r.findField(o);let c=s[i].value;a&&a.kind=="message"&&!Hr(c,a.T)?c=new a.T(c):a&&a.kind==="scalar"&&a.T===R.BYTES&&(c=OA(c)),A[i]={case:o,value:c};break;case"scalar":case"enum":let u=s[i];r.T===R.BYTES&&(u=r.repeated?u.map(OA):OA(u)),A[i]=u;break;case"map":switch(r.V.kind){case"scalar":case"enum":if(r.V.T===R.BYTES)for(const[h,f]of Object.entries(s[i]))A[i][h]=OA(f);else Object.assign(A[i],s[i]);break;case"message":const d=r.V.T;for(const h of Object.keys(s[i])){let f=s[i][h];d.fieldWrapper||(f=new d(f)),A[i][h]=f}break}break;case"message":const l=r.T;if(r.repeated)A[i]=s[i].map(d=>Hr(d,l)?d:new l(d));else{const d=s[i];l.fieldWrapper?l.typeName==="google.protobuf.BytesValue"?A[i]=OA(d):A[i]=d:A[i]=Hr(d,l)?d:new l(d)}break}}},equals(n,e,t){return e===t?!0:!e||!t?!1:n.fields.byMember().every(r=>{const i=e[r.localName],A=t[r.localName];if(r.repeated){if(i.length!==A.length)return!1;switch(r.kind){case"message":return i.every((s,o)=>r.T.equals(s,A[o]));case"scalar":return i.every((s,o)=>cr(r.T,s,A[o]));case"enum":return i.every((s,o)=>cr(R.INT32,s,A[o]))}throw new Error("repeated cannot contain ".concat(r.kind))}switch(r.kind){case"message":return r.T.equals(i,A);case"enum":return cr(R.INT32,i,A);case"scalar":return cr(r.T,i,A);case"oneof":if(i.case!==A.case)return!1;const s=r.findField(i.case);if(s===void 0)return!0;switch(s.kind){case"message":return s.T.equals(i.value,A.value);case"enum":return cr(R.INT32,i.value,A.value);case"scalar":return cr(s.T,i.value,A.value)}throw new Error("oneof cannot contain ".concat(s.kind));case"map":const o=Object.keys(i).concat(Object.keys(A));switch(r.V.kind){case"message":const a=r.V.T;return o.every(u=>a.equals(i[u],A[u]));case"enum":return o.every(u=>cr(R.INT32,i[u],A[u]));case"scalar":const c=r.V.T;return o.every(u=>cr(c,i[u],A[u]))}break}})},clone(n){const e=n.getType(),t=new e,r=t;for(const i of e.fields.byMember()){const A=n[i.localName];let s;if(i.repeated)s=A.map(No);else if(i.kind=="map"){s=r[i.localName];for(const[o,a]of Object.entries(A))s[o]=No(a)}else i.kind=="oneof"?s=i.findField(A.case)?{case:A.case,value:No(A.value)}:{case:void 0}:s=No(A);r[i.localName]=s}for(const i of e.runtime.bin.listUnknownFields(n))e.runtime.bin.onUnknownField(r,i.no,i.wireType,i.data);return t}}}function No(n){if(n===void 0)return n;if(Hr(n))return n.clone();if(n instanceof Uint8Array){const e=new Uint8Array(n.byteLength);return e.set(n),e}return n}function OA(n){return n instanceof Uint8Array?n:new Uint8Array(n)}function oI(n,e,t){return{syntax:n,json:XT(),bin:tI(),util:Object.assign(Object.assign({},sI()),{newFieldList:e,initFields:t}),makeMessageType(r,i,A){return PT(this,r,i,A)},makeEnum:RT,makeEnumType:em,getEnumType:QT,makeExtension(r,i,A){return VT(this,r,i,A)}}}class aI{constructor(e,t){this._fields=e,this._normalizer=t}findJsonName(e){if(!this.jsonNames){const t={};for(const r of this.list())t[r.jsonName]=t[r.name]=r;this.jsonNames=t}return this.jsonNames[e]}find(e){if(!this.numbers){const t={};for(const r of this.list())t[r.no]=r;this.numbers=t}return this.numbers[e]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((e,t)=>e.no-t.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const e=this.members;let t;for(const r of this.list())r.oneof?r.oneof!==t&&(t=r.oneof,e.push(t)):e.push(r)}return this.members}}function Sm(n,e){const t=km(n);return e?t:pI(hI(t))}function cI(n){return Sm(n,!1)}const uI=km;function km(n){let e=!1;const t=[];for(let r=0;r<n.length;r++){let i=n.charAt(r);switch(i){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":t.push(i),e=!1;break;default:e&&(e=!1,i=i.toUpperCase()),t.push(i);break}}return t.join("")}const lI=new Set(["constructor","toString","toJSON","valueOf"]),dI=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),Em=n=>"".concat(n,"$"),hI=n=>dI.has(n)?Em(n):n,pI=n=>lI.has(n)?Em(n):n;class fI{constructor(e){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=cI(e)}addField(e){Xe(e.oneof===this,"field ".concat(e.name," not one of ").concat(this.name)),this.fields.push(e)}findField(e){if(!this._lookup){this._lookup=Object.create(null);for(let t=0;t<this.fields.length;t++)this._lookup[this.fields[t].localName]=this.fields[t]}return this._lookup[e]}}function gI(n,e){var t,r,i,A,s,o;const a=[];let c;for(const u of typeof n=="function"?n():n){const l=u;if(l.localName=Sm(u.name,u.oneof!==void 0),l.jsonName=(t=u.jsonName)!==null&&t!==void 0?t:uI(u.name),l.repeated=(r=u.repeated)!==null&&r!==void 0?r:!1,u.kind=="scalar"&&(l.L=(i=u.L)!==null&&i!==void 0?i:ar.BIGINT),l.delimited=(A=u.delimited)!==null&&A!==void 0?A:!1,l.req=(s=u.req)!==null&&s!==void 0?s:!1,l.opt=(o=u.opt)!==null&&o!==void 0?o:!1,u.packed===void 0&&(l.packed=u.kind=="enum"||u.kind=="scalar"&&u.T!=R.BYTES&&u.T!=R.STRING),u.oneof!==void 0){const d=typeof u.oneof=="string"?u.oneof:u.oneof.name;(!c||c.name!=d)&&(c=new fI(d)),l.oneof=c,c.addField(l)}a.push(l)}return a}const I=oI("proto3",n=>new aI(n,e=>gI(e)),n=>{for(const e of n.getType().fields.byMember()){if(e.opt)continue;const t=e.localName,r=n;if(e.repeated){r[t]=[];continue}switch(e.kind){case"oneof":r[t]={case:void 0};break;case"enum":r[t]=0;break;case"map":r[t]={};break;case"scalar":r[t]=Ci(e.T,e.L);break}}});class Lt extends Ju{constructor(e){super(),this.seconds=Ke.zero,this.nanos=0,I.util.initPartial(e,this)}fromJson(e,t){if(typeof e!="string")throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(I.json.debug(e)));const r=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const i=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(i))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=Ke.parse(i/1e3),this.nanos=0,r[7]&&(this.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),this}toJson(e){const t=Number(this.seconds)*1e3;if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let r="Z";if(this.nanos>0){const i=(this.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?r="."+i.substring(0,3)+"Z":i.substring(6)==="000"?r="."+i.substring(0,6)+"Z":r="."+i+"Z"}return new Date(t).toISOString().replace(".000Z",r)}toDate(){return new Date(Number(this.seconds)*1e3+Math.ceil(this.nanos/1e6))}static now(){return Lt.fromDate(new Date)}static fromDate(e){const t=e.getTime();return new Lt({seconds:Ke.parse(Math.floor(t/1e3)),nanos:t%1e3*1e6})}static fromBinary(e,t){return new Lt().fromBinary(e,t)}static fromJson(e,t){return new Lt().fromJson(e,t)}static fromJsonString(e,t){return new Lt().fromJsonString(e,t)}static equals(e,t){return I.util.equals(Lt,e,t)}}Lt.runtime=I,Lt.typeName="google.protobuf.Timestamp",Lt.fields=I.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);const mI=I.makeMessageType("livekit.MetricsBatch",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Lt},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:vI,repeated:!0},{no:5,name:"events",kind:"message",T:wI,repeated:!0}]),vI=I.makeMessageType("livekit.TimeSeriesMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"samples",kind:"message",T:yI,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}]),yI=I.makeMessageType("livekit.MetricSample",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Lt},{no:3,name:"value",kind:"scalar",T:2}]),wI=I.makeMessageType("livekit.EventMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"start_timestamp_ms",kind:"scalar",T:3},{no:5,name:"end_timestamp_ms",kind:"scalar",T:3,opt:!0},{no:6,name:"normalized_start_timestamp",kind:"message",T:Lt},{no:7,name:"normalized_end_timestamp",kind:"message",T:Lt,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}]),Um=I.makeEnum("livekit.BackupCodecPolicy",[{no:0,name:"PREFER_REGRESSION"},{no:1,name:"SIMULCAST"},{no:2,name:"REGRESSION"}]),An=I.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),at=I.makeEnum("livekit.TrackSource",[{no:0,name:"UNKNOWN"},{no:1,name:"CAMERA"},{no:2,name:"MICROPHONE"},{no:3,name:"SCREEN_SHARE"},{no:4,name:"SCREEN_SHARE_AUDIO"}]),Si=I.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),MA=I.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),LA=I.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),sn=I.makeEnum("livekit.DisconnectReason",[{no:0,name:"UNKNOWN_REASON"},{no:1,name:"CLIENT_INITIATED"},{no:2,name:"DUPLICATE_IDENTITY"},{no:3,name:"SERVER_SHUTDOWN"},{no:4,name:"PARTICIPANT_REMOVED"},{no:5,name:"ROOM_DELETED"},{no:6,name:"STATE_MISMATCH"},{no:7,name:"JOIN_FAILURE"},{no:8,name:"MIGRATION"},{no:9,name:"SIGNAL_CLOSE"},{no:10,name:"ROOM_CLOSED"},{no:11,name:"USER_UNAVAILABLE"},{no:12,name:"USER_REJECTED"},{no:13,name:"SIP_TRUNK_FAILURE"},{no:14,name:"CONNECTION_TIMEOUT"}]),ki=I.makeEnum("livekit.ReconnectReason",[{no:0,name:"RR_UNKNOWN"},{no:1,name:"RR_SIGNAL_DISCONNECTED"},{no:2,name:"RR_PUBLISHER_FAILED"},{no:3,name:"RR_SUBSCRIBER_FAILED"},{no:4,name:"RR_SWITCH_CANDIDATE"}]),bI=I.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),on=I.makeEnum("livekit.AudioTrackFeature",[{no:0,name:"TF_STEREO"},{no:1,name:"TF_NO_DTX"},{no:2,name:"TF_AUTO_GAIN_CONTROL"},{no:3,name:"TF_ECHO_CANCELLATION"},{no:4,name:"TF_NOISE_SUPPRESSION"},{no:5,name:"TF_ENHANCED_NOISE_CANCELLATION"},{no:6,name:"TF_PRECONNECT_BUFFER"}]),Ho=I.makeMessageType("livekit.Room",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"empty_timeout",kind:"scalar",T:13},{no:14,name:"departure_timeout",kind:"scalar",T:13},{no:4,name:"max_participants",kind:"scalar",T:13},{no:5,name:"creation_time",kind:"scalar",T:3},{no:15,name:"creation_time_ms",kind:"scalar",T:3},{no:6,name:"turn_password",kind:"scalar",T:9},{no:7,name:"enabled_codecs",kind:"message",T:Ko,repeated:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"num_participants",kind:"scalar",T:13},{no:11,name:"num_publishers",kind:"scalar",T:13},{no:10,name:"active_recording",kind:"scalar",T:8},{no:13,name:"version",kind:"message",T:Hm}]),Ko=I.makeMessageType("livekit.Codec",()=>[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}]),BI=I.makeMessageType("livekit.ParticipantPermission",()=>[{no:1,name:"can_subscribe",kind:"scalar",T:8},{no:2,name:"can_publish",kind:"scalar",T:8},{no:3,name:"can_publish_data",kind:"scalar",T:8},{no:9,name:"can_publish_sources",kind:"enum",T:I.getEnumType(at),repeated:!0},{no:7,name:"hidden",kind:"scalar",T:8},{no:8,name:"recorder",kind:"scalar",T:8},{no:10,name:"can_update_metadata",kind:"scalar",T:8},{no:11,name:"agent",kind:"scalar",T:8},{no:12,name:"can_subscribe_metrics",kind:"scalar",T:8}]),Kr=I.makeMessageType("livekit.ParticipantInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"identity",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:I.getEnumType(Ei)},{no:4,name:"tracks",kind:"message",T:Ui,repeated:!0},{no:5,name:"metadata",kind:"scalar",T:9},{no:6,name:"joined_at",kind:"scalar",T:3},{no:17,name:"joined_at_ms",kind:"scalar",T:3},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"version",kind:"scalar",T:13},{no:11,name:"permission",kind:"message",T:BI},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:I.getEnumType(Vo)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:I.getEnumType(sn)},{no:18,name:"kind_details",kind:"enum",T:I.getEnumType(CI),repeated:!0}]),Ei=I.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),Vo=I.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"}]),CI=I.makeEnum("livekit.ParticipantInfo.KindDetail",[{no:0,name:"CLOUD_AGENT"},{no:1,name:"FORWARDED"}]),Wt=I.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),_I=I.makeMessageType("livekit.SimulcastCodecInfo",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"mid",kind:"scalar",T:9},{no:3,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:Vr,repeated:!0}]),Ui=I.makeMessageType("livekit.TrackInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:I.getEnumType(An)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"muted",kind:"scalar",T:8},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"simulcast",kind:"scalar",T:8},{no:8,name:"disable_dtx",kind:"scalar",T:8},{no:9,name:"source",kind:"enum",T:I.getEnumType(at)},{no:10,name:"layers",kind:"message",T:Vr,repeated:!0},{no:11,name:"mime_type",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:9},{no:13,name:"codecs",kind:"message",T:_I,repeated:!0},{no:14,name:"stereo",kind:"scalar",T:8},{no:15,name:"disable_red",kind:"scalar",T:8},{no:16,name:"encryption",kind:"enum",T:I.getEnumType(Wt)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:Hm},{no:19,name:"audio_features",kind:"enum",T:I.getEnumType(on),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:I.getEnumType(Um)}]),Vr=I.makeMessageType("livekit.VideoLayer",()=>[{no:1,name:"quality",kind:"enum",T:I.getEnumType(Si)},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13},{no:4,name:"bitrate",kind:"scalar",T:13},{no:5,name:"ssrc",kind:"scalar",T:13}]),Dt=I.makeMessageType("livekit.DataPacket",()=>[{no:1,name:"kind",kind:"enum",T:I.getEnumType(pe)},{no:4,name:"participant_identity",kind:"scalar",T:9},{no:5,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:2,name:"user",kind:"message",T:Im,oneof:"value"},{no:3,name:"speaker",kind:"message",T:SI,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:Fm,oneof:"value"},{no:7,name:"transcription",kind:"message",T:kI,oneof:"value"},{no:8,name:"metrics",kind:"message",T:mI,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:$u,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:xm,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:Qm,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:Rm,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:tl,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:nl,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:rl,oneof:"value"}]),pe=I.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),SI=I.makeMessageType("livekit.ActiveSpeakerUpdate",()=>[{no:1,name:"speakers",kind:"message",T:Tm,repeated:!0}]),Tm=I.makeMessageType("livekit.SpeakerInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:2},{no:3,name:"active",kind:"scalar",T:8}]),Im=I.makeMessageType("livekit.UserPacket",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:5,name:"participant_identity",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"destination_sids",kind:"scalar",T:9,repeated:!0},{no:6,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:4,name:"topic",kind:"scalar",T:9,opt:!0},{no:8,name:"id",kind:"scalar",T:9,opt:!0},{no:9,name:"start_time",kind:"scalar",T:4,opt:!0},{no:10,name:"end_time",kind:"scalar",T:4,opt:!0},{no:11,name:"nonce",kind:"scalar",T:12}]),Fm=I.makeMessageType("livekit.SipDTMF",()=>[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}]),kI=I.makeMessageType("livekit.Transcription",()=>[{no:2,name:"transcribed_participant_identity",kind:"scalar",T:9},{no:3,name:"track_id",kind:"scalar",T:9},{no:4,name:"segments",kind:"message",T:EI,repeated:!0}]),EI=I.makeMessageType("livekit.TranscriptionSegment",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:4},{no:4,name:"end_time",kind:"scalar",T:4},{no:5,name:"final",kind:"scalar",T:8},{no:6,name:"language",kind:"scalar",T:9}]),$u=I.makeMessageType("livekit.ChatMessage",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"edit_timestamp",kind:"scalar",T:3,opt:!0},{no:4,name:"message",kind:"scalar",T:9},{no:5,name:"deleted",kind:"scalar",T:8},{no:6,name:"generated",kind:"scalar",T:8}]),xm=I.makeMessageType("livekit.RpcRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"payload",kind:"scalar",T:9},{no:4,name:"response_timeout_ms",kind:"scalar",T:13},{no:5,name:"version",kind:"scalar",T:13}]),Qm=I.makeMessageType("livekit.RpcAck",()=>[{no:1,name:"request_id",kind:"scalar",T:9}]),Rm=I.makeMessageType("livekit.RpcResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9,oneof:"value"},{no:3,name:"error",kind:"message",T:Pm,oneof:"value"}]),Pm=I.makeMessageType("livekit.RpcError",()=>[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"scalar",T:9}]),Om=I.makeMessageType("livekit.ParticipantTracks",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}]),UI=I.makeMessageType("livekit.ServerInfo",()=>[{no:1,name:"edition",kind:"enum",T:I.getEnumType(Mm)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"region",kind:"scalar",T:9},{no:5,name:"node_id",kind:"scalar",T:9},{no:6,name:"debug_info",kind:"scalar",T:9},{no:7,name:"agent_protocol",kind:"scalar",T:5}]),Mm=I.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),TI=I.makeMessageType("livekit.ClientInfo",()=>[{no:1,name:"sdk",kind:"enum",T:I.getEnumType(Lm)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"os",kind:"scalar",T:9},{no:5,name:"os_version",kind:"scalar",T:9},{no:6,name:"device_model",kind:"scalar",T:9},{no:7,name:"browser",kind:"scalar",T:9},{no:8,name:"browser_version",kind:"scalar",T:9},{no:9,name:"address",kind:"scalar",T:9},{no:10,name:"network",kind:"scalar",T:9},{no:11,name:"other_sdks",kind:"scalar",T:9}]),Lm=I.makeEnum("livekit.ClientInfo.SDK",[{no:0,name:"UNKNOWN"},{no:1,name:"JS"},{no:2,name:"SWIFT"},{no:3,name:"ANDROID"},{no:4,name:"FLUTTER"},{no:5,name:"GO"},{no:6,name:"UNITY"},{no:7,name:"REACT_NATIVE"},{no:8,name:"RUST"},{no:9,name:"PYTHON"},{no:10,name:"CPP"},{no:11,name:"UNITY_WEB"},{no:12,name:"NODE"},{no:13,name:"UNREAL"}]),Dm=I.makeMessageType("livekit.ClientConfiguration",()=>[{no:1,name:"video",kind:"message",T:Nm},{no:2,name:"screen",kind:"message",T:Nm},{no:3,name:"resume_connection",kind:"enum",T:I.getEnumType(LA)},{no:4,name:"disabled_codecs",kind:"message",T:II},{no:5,name:"force_relay",kind:"enum",T:I.getEnumType(LA)}]),Nm=I.makeMessageType("livekit.VideoConfiguration",()=>[{no:1,name:"hardware_encoder",kind:"enum",T:I.getEnumType(LA)}]),II=I.makeMessageType("livekit.DisabledCodecs",()=>[{no:1,name:"codecs",kind:"message",T:Ko,repeated:!0},{no:2,name:"publish",kind:"message",T:Ko,repeated:!0}]),Hm=I.makeMessageType("livekit.TimedVersion",()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]),el=I.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),Km=I.makeMessageType("livekit.DataStream.TextHeader",()=>[{no:1,name:"operation_type",kind:"enum",T:I.getEnumType(el)},{no:2,name:"version",kind:"scalar",T:5},{no:3,name:"reply_to_stream_id",kind:"scalar",T:9},{no:4,name:"attached_stream_ids",kind:"scalar",T:9,repeated:!0},{no:5,name:"generated",kind:"scalar",T:8}],{localName:"DataStream_TextHeader"}),Vm=I.makeMessageType("livekit.DataStream.ByteHeader",()=>[{no:1,name:"name",kind:"scalar",T:9}],{localName:"DataStream_ByteHeader"}),tl=I.makeMessageType("livekit.DataStream.Header",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"topic",kind:"scalar",T:9},{no:4,name:"mime_type",kind:"scalar",T:9},{no:5,name:"total_length",kind:"scalar",T:4,opt:!0},{no:7,name:"encryption_type",kind:"enum",T:I.getEnumType(Wt)},{no:8,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:9,name:"text_header",kind:"message",T:Km,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:Vm,oneof:"content_header"}],{localName:"DataStream_Header"}),nl=I.makeMessageType("livekit.DataStream.Chunk",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"chunk_index",kind:"scalar",T:4},{no:3,name:"content",kind:"scalar",T:12},{no:4,name:"version",kind:"scalar",T:5},{no:5,name:"iv",kind:"scalar",T:12,opt:!0}],{localName:"DataStream_Chunk"}),rl=I.makeMessageType("livekit.DataStream.Trailer",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"reason",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}}],{localName:"DataStream_Trailer"}),an=I.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),il=I.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),FI=I.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),xI=I.makeMessageType("livekit.SignalRequest",()=>[{no:1,name:"offer",kind:"message",T:Gr,oneof:"message"},{no:2,name:"answer",kind:"message",T:Gr,oneof:"message"},{no:3,name:"trickle",kind:"message",T:ol,oneof:"message"},{no:4,name:"add_track",kind:"message",T:sl,oneof:"message"},{no:5,name:"mute",kind:"message",T:al,oneof:"message"},{no:6,name:"subscription",kind:"message",T:Go,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:jm,oneof:"message"},{no:8,name:"leave",kind:"message",T:jo,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:qm,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:Ym,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:Zm,oneof:"message"},{no:13,name:"simulate",kind:"message",T:_n,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:Jm,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:ev,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:Wm,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:MI,oneof:"message"}]),Gm=I.makeMessageType("livekit.SignalResponse",()=>[{no:1,name:"join",kind:"message",T:QI,oneof:"message"},{no:2,name:"answer",kind:"message",T:Gr,oneof:"message"},{no:3,name:"offer",kind:"message",T:Gr,oneof:"message"},{no:4,name:"trickle",kind:"message",T:ol,oneof:"message"},{no:5,name:"update",kind:"message",T:OI,oneof:"message"},{no:6,name:"track_published",kind:"message",T:cl,oneof:"message"},{no:8,name:"leave",kind:"message",T:jo,oneof:"message"},{no:9,name:"mute",kind:"message",T:al,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:LI,oneof:"message"},{no:11,name:"room_update",kind:"message",T:DI,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:HI,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:VI,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:jI,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:WI,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:PI,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:RI,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:JI,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:YI,oneof:"message"},{no:22,name:"request_response",kind:"message",T:ZI,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:$I,oneof:"message"},{no:24,name:"room_moved",kind:"message",T:qI,oneof:"message"}]),Al=I.makeMessageType("livekit.SimulcastCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}]),sl=I.makeMessageType("livekit.AddTrackRequest",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:I.getEnumType(An)},{no:4,name:"width",kind:"scalar",T:13},{no:5,name:"height",kind:"scalar",T:13},{no:6,name:"muted",kind:"scalar",T:8},{no:7,name:"disable_dtx",kind:"scalar",T:8},{no:8,name:"source",kind:"enum",T:I.getEnumType(at)},{no:9,name:"layers",kind:"message",T:Vr,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:Al,repeated:!0},{no:11,name:"sid",kind:"scalar",T:9},{no:12,name:"stereo",kind:"scalar",T:8},{no:13,name:"disable_red",kind:"scalar",T:8},{no:14,name:"encryption",kind:"enum",T:I.getEnumType(Wt)},{no:15,name:"stream",kind:"scalar",T:9},{no:16,name:"backup_codec_policy",kind:"enum",T:I.getEnumType(Um)},{no:17,name:"audio_features",kind:"enum",T:I.getEnumType(on),repeated:!0}]),ol=I.makeMessageType("livekit.TrickleRequest",()=>[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:I.getEnumType(an)},{no:3,name:"final",kind:"scalar",T:8}]),al=I.makeMessageType("livekit.MuteTrackRequest",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}]),QI=I.makeMessageType("livekit.JoinResponse",()=>[{no:1,name:"room",kind:"message",T:Ho},{no:2,name:"participant",kind:"message",T:Kr},{no:3,name:"other_participants",kind:"message",T:Kr,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:zm,repeated:!0},{no:6,name:"subscriber_primary",kind:"scalar",T:8},{no:7,name:"alternative_url",kind:"scalar",T:9},{no:8,name:"client_configuration",kind:"message",T:Dm},{no:9,name:"server_region",kind:"scalar",T:9},{no:10,name:"ping_timeout",kind:"scalar",T:5},{no:11,name:"ping_interval",kind:"scalar",T:5},{no:12,name:"server_info",kind:"message",T:UI},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:Ko,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}]),RI=I.makeMessageType("livekit.ReconnectResponse",()=>[{no:1,name:"ice_servers",kind:"message",T:zm,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:Dm}]),cl=I.makeMessageType("livekit.TrackPublishedResponse",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:Ui}]),PI=I.makeMessageType("livekit.TrackUnpublishedResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]),Gr=I.makeMessageType("livekit.SessionDescription",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9}]),OI=I.makeMessageType("livekit.ParticipantUpdate",()=>[{no:1,name:"participants",kind:"message",T:Kr,repeated:!0}]),Go=I.makeMessageType("livekit.UpdateSubscription",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"participant_tracks",kind:"message",T:Om,repeated:!0}]),jm=I.makeMessageType("livekit.UpdateTrackSettings",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:3,name:"disabled",kind:"scalar",T:8},{no:4,name:"quality",kind:"enum",T:I.getEnumType(Si)},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"fps",kind:"scalar",T:13},{no:8,name:"priority",kind:"scalar",T:13}]),Wm=I.makeMessageType("livekit.UpdateLocalAudioTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:I.getEnumType(on),repeated:!0}]),MI=I.makeMessageType("livekit.UpdateLocalVideoTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13}]),jo=I.makeMessageType("livekit.LeaveRequest",()=>[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:I.getEnumType(sn)},{no:3,name:"action",kind:"enum",T:I.getEnumType(Ti)},{no:4,name:"regions",kind:"message",T:zI}]),Ti=I.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),qm=I.makeMessageType("livekit.UpdateVideoLayers",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:Vr,repeated:!0}]),Jm=I.makeMessageType("livekit.UpdateParticipantMetadata",()=>[{no:1,name:"metadata",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"request_id",kind:"scalar",T:13}]),zm=I.makeMessageType("livekit.ICEServer",()=>[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]),LI=I.makeMessageType("livekit.SpeakersChanged",()=>[{no:1,name:"speakers",kind:"message",T:Tm,repeated:!0}]),DI=I.makeMessageType("livekit.RoomUpdate",()=>[{no:1,name:"room",kind:"message",T:Ho}]),NI=I.makeMessageType("livekit.ConnectionQualityInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:I.getEnumType(MA)},{no:3,name:"score",kind:"scalar",T:2}]),HI=I.makeMessageType("livekit.ConnectionQualityUpdate",()=>[{no:1,name:"updates",kind:"message",T:NI,repeated:!0}]),KI=I.makeMessageType("livekit.StreamStateInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:I.getEnumType(il)}]),VI=I.makeMessageType("livekit.StreamStateUpdate",()=>[{no:1,name:"stream_states",kind:"message",T:KI,repeated:!0}]),ul=I.makeMessageType("livekit.SubscribedQuality",()=>[{no:1,name:"quality",kind:"enum",T:I.getEnumType(Si)},{no:2,name:"enabled",kind:"scalar",T:8}]),GI=I.makeMessageType("livekit.SubscribedCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:ul,repeated:!0}]),jI=I.makeMessageType("livekit.SubscribedQualityUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:ul,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:GI,repeated:!0}]),Xm=I.makeMessageType("livekit.TrackPermission",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"all_tracks",kind:"scalar",T:8},{no:3,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:4,name:"participant_identity",kind:"scalar",T:9}]),Ym=I.makeMessageType("livekit.SubscriptionPermission",()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:Xm,repeated:!0}]),WI=I.makeMessageType("livekit.SubscriptionPermissionUpdate",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"allowed",kind:"scalar",T:8}]),qI=I.makeMessageType("livekit.RoomMovedResponse",()=>[{no:1,name:"room",kind:"message",T:Ho},{no:2,name:"token",kind:"scalar",T:9},{no:3,name:"participant",kind:"message",T:Kr},{no:4,name:"other_participants",kind:"message",T:Kr,repeated:!0}]),Zm=I.makeMessageType("livekit.SyncState",()=>[{no:1,name:"answer",kind:"message",T:Gr},{no:2,name:"subscription",kind:"message",T:Go},{no:3,name:"publish_tracks",kind:"message",T:cl,repeated:!0},{no:4,name:"data_channels",kind:"message",T:$m,repeated:!0},{no:5,name:"offer",kind:"message",T:Gr},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0}]),$m=I.makeMessageType("livekit.DataChannelInfo",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:13},{no:3,name:"target",kind:"enum",T:I.getEnumType(an)}]),_n=I.makeMessageType("livekit.SimulateScenario",()=>[{no:1,name:"speaker_update",kind:"scalar",T:5,oneof:"scenario"},{no:2,name:"node_failure",kind:"scalar",T:8,oneof:"scenario"},{no:3,name:"migration",kind:"scalar",T:8,oneof:"scenario"},{no:4,name:"server_leave",kind:"scalar",T:8,oneof:"scenario"},{no:5,name:"switch_candidate_protocol",kind:"enum",T:I.getEnumType(FI),oneof:"scenario"},{no:6,name:"subscriber_bandwidth",kind:"scalar",T:3,oneof:"scenario"},{no:7,name:"disconnect_signal_on_resume",kind:"scalar",T:8,oneof:"scenario"},{no:8,name:"disconnect_signal_on_resume_no_messages",kind:"scalar",T:8,oneof:"scenario"},{no:9,name:"leave_request_full_reconnect",kind:"scalar",T:8,oneof:"scenario"}]),ev=I.makeMessageType("livekit.Ping",()=>[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}]),JI=I.makeMessageType("livekit.Pong",()=>[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}]),zI=I.makeMessageType("livekit.RegionSettings",()=>[{no:1,name:"regions",kind:"message",T:XI,repeated:!0}]),XI=I.makeMessageType("livekit.RegionInfo",()=>[{no:1,name:"region",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"distance",kind:"scalar",T:3}]),YI=I.makeMessageType("livekit.SubscriptionResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:I.getEnumType(bI)}]),ZI=I.makeMessageType("livekit.RequestResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:I.getEnumType(ll)},{no:3,name:"message",kind:"scalar",T:9}]),ll=I.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"}]),$I=I.makeMessageType("livekit.TrackSubscribed",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]);function eF(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Wo={exports:{}},tF=Wo.exports,tv;function nF(){return tv||(tv=1,function(n){(function(e,t){n.exports?n.exports=t():e.log=t()})(tF,function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],A={},s=null;function o(p,g){var v=p[g];if(typeof v.bind=="function")return v.bind(p);try{return Function.prototype.bind.call(v,p)}catch{return function(){return Function.prototype.apply.apply(v,[p,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(p){return p==="debug"&&(p="log"),typeof console===t?!1:p==="trace"&&r?a:console[p]!==void 0?o(console,p):console.log!==void 0?o(console,"log"):e}function u(){for(var p=this.getLevel(),g=0;g<i.length;g++){var v=i[g];this[v]=g<p?e:this.methodFactory(v,p,this.name)}if(this.log=this.debug,typeof console===t&&p<this.levels.SILENT)return"No console available for logging"}function l(p){return function(){typeof console!==t&&(u.call(this),this[p].apply(this,arguments))}}function d(p,g,v){return c(p)||l.apply(this,arguments)}function h(p,g){var v=this,y,B,b,w="loglevel";typeof p=="string"?w+=":"+p:typeof p=="symbol"&&(w=void 0);function _(T){var Q=(i[T]||"silent").toUpperCase();if(!(typeof window===t||!w)){try{window.localStorage[w]=Q;return}catch{}try{window.document.cookie=encodeURIComponent(w)+"="+Q+";"}catch{}}}function k(){var T;if(!(typeof window===t||!w)){try{T=window.localStorage[w]}catch{}if(typeof T===t)try{var Q=window.document.cookie,M=encodeURIComponent(w),X=Q.indexOf(M+"=");X!==-1&&(T=/^([^;]+)/.exec(Q.slice(X+M.length+1))[1])}catch{}return v.levels[T]===void 0&&(T=void 0),T}}function F(){if(!(typeof window===t||!w)){try{window.localStorage.removeItem(w)}catch{}try{window.document.cookie=encodeURIComponent(w)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function x(T){var Q=T;if(typeof Q=="string"&&v.levels[Q.toUpperCase()]!==void 0&&(Q=v.levels[Q.toUpperCase()]),typeof Q=="number"&&Q>=0&&Q<=v.levels.SILENT)return Q;throw new TypeError("log.setLevel() called with invalid level: "+T)}v.name=p,v.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},v.methodFactory=g||d,v.getLevel=function(){return b??B??y},v.setLevel=function(T,Q){return b=x(T),Q!==!1&&_(b),u.call(v)},v.setDefaultLevel=function(T){B=x(T),k()||v.setLevel(T,!1)},v.resetLevel=function(){b=null,F(),u.call(v)},v.enableAll=function(T){v.setLevel(v.levels.TRACE,T)},v.disableAll=function(T){v.setLevel(v.levels.SILENT,T)},v.rebuild=function(){if(s!==v&&(y=x(s.getLevel())),u.call(v),s===v)for(var T in A)A[T].rebuild()},y=x(s?s.getLevel():"WARN");var U=k();U!=null&&(b=x(U)),u.call(v)}s=new h,s.getLogger=function(g){if(typeof g!="symbol"&&typeof g!="string"||g==="")throw new TypeError("You must supply a name when creating a logger.");var v=A[g];return v||(v=A[g]=new h(g,s.methodFactory)),v};var f=typeof window!==t?window.log:void 0;return s.noConflict=function(){return typeof window!==t&&window.log===s&&(window.log=f),s},s.getLoggers=function(){return A},s.default=s,s})}(Wo)),Wo.exports}var qo=nF(),dl;(function(n){n[n.trace=0]="trace",n[n.debug=1]="debug",n[n.info=2]="info",n[n.warn=3]="warn",n[n.error=4]="error",n[n.silent=5]="silent"})(dl||(dl={}));var cn;(function(n){n.Default="livekit",n.Room="livekit-room",n.Participant="livekit-participant",n.Track="livekit-track",n.Publication="livekit-track-publication",n.Engine="livekit-engine",n.Signal="livekit-signal",n.PCManager="livekit-pc-manager",n.PCTransport="livekit-pc-transport",n.E2EE="lk-e2ee"})(cn||(cn={}));let ue=qo.getLogger("livekit");Object.values(cn).map(n=>qo.getLogger(n)),ue.setDefaultLevel(dl.info);function Ln(n){const e=qo.getLogger(n);return e.setDefaultLevel(ue.getLevel()),e}const rF=qo.getLogger("lk-e2ee"),DA=7e3,iF=[0,300,2*2*300,3*3*300,4*4*300,DA,DA,DA,DA,DA];class AF{constructor(e){this._retryDelays=e!==void 0?[...e]:iF}nextRetryDelayInMs(e){if(e.retryCount>=this._retryDelays.length)return null;const t=this._retryDelays[e.retryCount];return e.retryCount<=1?t:t+Math.random()*1e3}}function sF(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function S(n,e,t,r){function i(A){return A instanceof t?A:new t(function(s){s(A)})}return new(t||(t=Promise))(function(A,s){function o(u){try{c(r.next(u))}catch(l){s(l)}}function a(u){try{c(r.throw(u))}catch(l){s(l)}}function c(u){u.done?A(u.value):i(u.value).then(o,a)}c((r=r.apply(n,e||[])).next())})}function nv(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ur(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof nv=="function"?nv(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(A){t[A]=n[A]&&function(s){return new Promise(function(o,a){s=n[A](s),i(o,a,s.done,s.value)})}}function i(A,s,o,a){Promise.resolve(a).then(function(c){A({value:c,done:o})},s)}}typeof SuppressedError=="function"&&SuppressedError;var Jo={exports:{}},rv;function oF(){if(rv)return Jo.exports;rv=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(w,_,k){return Function.prototype.apply.call(w,_,k)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(w){return Object.getOwnPropertyNames(w).concat(Object.getOwnPropertySymbols(w))}:t=function(w){return Object.getOwnPropertyNames(w)};function r(b){console&&console.warn&&console.warn(b)}var i=Number.isNaN||function(w){return w!==w};function A(){A.init.call(this)}Jo.exports=A,Jo.exports.once=v,A.EventEmitter=A,A.prototype._events=void 0,A.prototype._eventsCount=0,A.prototype._maxListeners=void 0;var s=10;function o(b){if(typeof b!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof b)}Object.defineProperty(A,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(b){if(typeof b!="number"||b<0||i(b))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+b+".");s=b}}),A.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},A.prototype.setMaxListeners=function(w){if(typeof w!="number"||w<0||i(w))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+w+".");return this._maxListeners=w,this};function a(b){return b._maxListeners===void 0?A.defaultMaxListeners:b._maxListeners}A.prototype.getMaxListeners=function(){return a(this)},A.prototype.emit=function(w){for(var _=[],k=1;k<arguments.length;k++)_.push(arguments[k]);var F=w==="error",x=this._events;if(x!==void 0)F=F&&x.error===void 0;else if(!F)return!1;if(F){var U;if(_.length>0&&(U=_[0]),U instanceof Error)throw U;var T=new Error("Unhandled error."+(U?" ("+U.message+")":""));throw T.context=U,T}var Q=x[w];if(Q===void 0)return!1;if(typeof Q=="function")e(Q,this,_);else for(var M=Q.length,X=f(Q,M),k=0;k<M;++k)e(X[k],this,_);return!0};function c(b,w,_,k){var F,x,U;if(o(_),x=b._events,x===void 0?(x=b._events=Object.create(null),b._eventsCount=0):(x.newListener!==void 0&&(b.emit("newListener",w,_.listener?_.listener:_),x=b._events),U=x[w]),U===void 0)U=x[w]=_,++b._eventsCount;else if(typeof U=="function"?U=x[w]=k?[_,U]:[U,_]:k?U.unshift(_):U.push(_),F=a(b),F>0&&U.length>F&&!U.warned){U.warned=!0;var T=new Error("Possible EventEmitter memory leak detected. "+U.length+" "+String(w)+" listeners added. Use emitter.setMaxListeners() to increase limit");T.name="MaxListenersExceededWarning",T.emitter=b,T.type=w,T.count=U.length,r(T)}return b}A.prototype.addListener=function(w,_){return c(this,w,_,!1)},A.prototype.on=A.prototype.addListener,A.prototype.prependListener=function(w,_){return c(this,w,_,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(b,w,_){var k={fired:!1,wrapFn:void 0,target:b,type:w,listener:_},F=u.bind(k);return F.listener=_,k.wrapFn=F,F}A.prototype.once=function(w,_){return o(_),this.on(w,l(this,w,_)),this},A.prototype.prependOnceListener=function(w,_){return o(_),this.prependListener(w,l(this,w,_)),this},A.prototype.removeListener=function(w,_){var k,F,x,U,T;if(o(_),F=this._events,F===void 0)return this;if(k=F[w],k===void 0)return this;if(k===_||k.listener===_)--this._eventsCount===0?this._events=Object.create(null):(delete F[w],F.removeListener&&this.emit("removeListener",w,k.listener||_));else if(typeof k!="function"){for(x=-1,U=k.length-1;U>=0;U--)if(k[U]===_||k[U].listener===_){T=k[U].listener,x=U;break}if(x<0)return this;x===0?k.shift():p(k,x),k.length===1&&(F[w]=k[0]),F.removeListener!==void 0&&this.emit("removeListener",w,T||_)}return this},A.prototype.off=A.prototype.removeListener,A.prototype.removeAllListeners=function(w){var _,k,F;if(k=this._events,k===void 0)return this;if(k.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):k[w]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete k[w]),this;if(arguments.length===0){var x=Object.keys(k),U;for(F=0;F<x.length;++F)U=x[F],U!=="removeListener"&&this.removeAllListeners(U);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(_=k[w],typeof _=="function")this.removeListener(w,_);else if(_!==void 0)for(F=_.length-1;F>=0;F--)this.removeListener(w,_[F]);return this};function d(b,w,_){var k=b._events;if(k===void 0)return[];var F=k[w];return F===void 0?[]:typeof F=="function"?_?[F.listener||F]:[F]:_?g(F):f(F,F.length)}A.prototype.listeners=function(w){return d(this,w,!0)},A.prototype.rawListeners=function(w){return d(this,w,!1)},A.listenerCount=function(b,w){return typeof b.listenerCount=="function"?b.listenerCount(w):h.call(b,w)},A.prototype.listenerCount=h;function h(b){var w=this._events;if(w!==void 0){var _=w[b];if(typeof _=="function")return 1;if(_!==void 0)return _.length}return 0}A.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function f(b,w){for(var _=new Array(w),k=0;k<w;++k)_[k]=b[k];return _}function p(b,w){for(;w+1<b.length;w++)b[w]=b[w+1];b.pop()}function g(b){for(var w=new Array(b.length),_=0;_<w.length;++_)w[_]=b[_].listener||b[_];return w}function v(b,w){return new Promise(function(_,k){function F(U){b.removeListener(w,x),k(U)}function x(){typeof b.removeListener=="function"&&b.removeListener("error",F),_([].slice.call(arguments))}B(b,w,x,{once:!0}),w!=="error"&&y(b,F,{once:!0})})}function y(b,w,_){typeof b.on=="function"&&B(b,"error",w,_)}function B(b,w,_,k){if(typeof b.on=="function")k.once?b.once(w,_):b.on(w,_);else if(typeof b.addEventListener=="function")b.addEventListener(w,function F(x){k.once&&b.removeEventListener(w,F),_(x)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof b)}return Jo.exports}var Sn=oF();let iv=!0,Av=!0;function zo(n,e,t){const r=n.match(e);return r&&r.length>=t&&parseInt(r[t],10)}function jr(n,e,t){if(!n.RTCPeerConnection)return;const r=n.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(s,o){if(s!==e)return i.apply(this,arguments);const a=c=>{const u=t(c);u&&(o.handleEvent?o.handleEvent(u):o(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(o,a),i.apply(this,[s,a])};const A=r.removeEventListener;r.removeEventListener=function(s,o){if(s!==e||!this._eventMap||!this._eventMap[e])return A.apply(this,arguments);if(!this._eventMap[e].has(o))return A.apply(this,arguments);const a=this._eventMap[e].get(o);return this._eventMap[e].delete(o),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,A.apply(this,[s,a])},Object.defineProperty(r,"on"+e,{get(){return this["_on"+e]},set(s){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),s&&this.addEventListener(e,this["_on"+e]=s)},enumerable:!0,configurable:!0})}function aF(n){return typeof n!="boolean"?new Error("Argument type: "+typeof n+". Please use a boolean."):(iv=n,n?"adapter.js logging disabled":"adapter.js logging enabled")}function cF(n){return typeof n!="boolean"?new Error("Argument type: "+typeof n+". Please use a boolean."):(Av=!n,"adapter.js deprecation warnings "+(n?"disabled":"enabled"))}function sv(){if(typeof window=="object"){if(iv)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function hl(n,e){Av&&console.warn(n+" is deprecated, please use "+e+" instead.")}function uF(n){const e={browser:null,version:null};if(typeof n>"u"||!n.navigator||!n.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:t}=n;if(t.userAgentData&&t.userAgentData.brands){const r=t.userAgentData.brands.find(i=>i.brand==="Chromium");if(r)return{browser:"chrome",version:parseInt(r.version,10)}}if(t.mozGetUserMedia)e.browser="firefox",e.version=zo(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||n.isSecureContext===!1&&n.webkitRTCPeerConnection)e.browser="chrome",e.version=zo(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(n.RTCPeerConnection&&t.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=zo(t.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=n.RTCRtpTransceiver&&"currentDirection"in n.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function ov(n){return Object.prototype.toString.call(n)==="[object Object]"}function av(n){return ov(n)?Object.keys(n).reduce(function(e,t){const r=ov(n[t]),i=r?av(n[t]):n[t],A=r&&!Object.keys(i).length;return i===void 0||A?e:Object.assign(e,{[t]:i})},{}):n}function pl(n,e,t){!e||t.has(e.id)||(t.set(e.id,e),Object.keys(e).forEach(r=>{r.endsWith("Id")?pl(n,n.get(e[r]),t):r.endsWith("Ids")&&e[r].forEach(i=>{pl(n,n.get(i),t)})}))}function cv(n,e,t){const r=t?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const A=[];return n.forEach(s=>{s.type==="track"&&s.trackIdentifier===e.id&&A.push(s)}),A.forEach(s=>{n.forEach(o=>{o.type===r&&o.trackId===s.id&&pl(n,o,i)})}),i}const uv=sv;function lv(n,e){const t=n&&n.navigator;if(!t.mediaDevices)return;const r=function(o){if(typeof o!="object"||o.mandatory||o.optional)return o;const a={};return Object.keys(o).forEach(c=>{if(c==="require"||c==="advanced"||c==="mediaSource")return;const u=typeof o[c]=="object"?o[c]:{ideal:o[c]};u.exact!==void 0&&typeof u.exact=="number"&&(u.min=u.max=u.exact);const l=function(d,h){return d?d+h.charAt(0).toUpperCase()+h.slice(1):h==="deviceId"?"sourceId":h};if(u.ideal!==void 0){a.optional=a.optional||[];let d={};typeof u.ideal=="number"?(d[l("min",c)]=u.ideal,a.optional.push(d),d={},d[l("max",c)]=u.ideal,a.optional.push(d)):(d[l("",c)]=u.ideal,a.optional.push(d))}u.exact!==void 0&&typeof u.exact!="number"?(a.mandatory=a.mandatory||{},a.mandatory[l("",c)]=u.exact):["min","max"].forEach(d=>{u[d]!==void 0&&(a.mandatory=a.mandatory||{},a.mandatory[l(d,c)]=u[d])})}),o.advanced&&(a.optional=(a.optional||[]).concat(o.advanced)),a},i=function(o,a){if(e.version>=61)return a(o);if(o=JSON.parse(JSON.stringify(o)),o&&typeof o.audio=="object"){const c=function(u,l,d){l in u&&!(d in u)&&(u[d]=u[l],delete u[l])};o=JSON.parse(JSON.stringify(o)),c(o.audio,"autoGainControl","googAutoGainControl"),c(o.audio,"noiseSuppression","googNoiseSuppression"),o.audio=r(o.audio)}if(o&&typeof o.video=="object"){let c=o.video.facingMode;c=c&&(typeof c=="object"?c:{ideal:c});const u=e.version<66;if(c&&(c.exact==="user"||c.exact==="environment"||c.ideal==="user"||c.ideal==="environment")&&!(t.mediaDevices.getSupportedConstraints&&t.mediaDevices.getSupportedConstraints().facingMode&&!u)){delete o.video.facingMode;let l;if(c.exact==="environment"||c.ideal==="environment"?l=["back","rear"]:(c.exact==="user"||c.ideal==="user")&&(l=["front"]),l)return t.mediaDevices.enumerateDevices().then(d=>{d=d.filter(f=>f.kind==="videoinput");let h=d.find(f=>l.some(p=>f.label.toLowerCase().includes(p)));return!h&&d.length&&l.includes("back")&&(h=d[d.length-1]),h&&(o.video.deviceId=c.exact?{exact:h.deviceId}:{ideal:h.deviceId}),o.video=r(o.video),uv("chrome: "+JSON.stringify(o)),a(o)})}o.video=r(o.video)}return uv("chrome: "+JSON.stringify(o)),a(o)},A=function(o){return e.version>=64?o:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[o.name]||o.name,message:o.message,constraint:o.constraint||o.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},s=function(o,a,c){i(o,u=>{t.webkitGetUserMedia(u,a,l=>{c&&c(A(l))})})};if(t.getUserMedia=s.bind(t),t.mediaDevices.getUserMedia){const o=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(a){return i(a,c=>o(c).then(u=>{if(c.audio&&!u.getAudioTracks().length||c.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(l=>{l.stop()}),new DOMException("","NotFoundError");return u},u=>Promise.reject(A(u))))}}}function dv(n){n.MediaStream=n.MediaStream||n.webkitMediaStream}function hv(n){if(typeof n=="object"&&n.RTCPeerConnection&&!("ontrack"in n.RTCPeerConnection.prototype)){Object.defineProperty(n.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});const e=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=r=>{r.stream.addEventListener("addtrack",i=>{let A;n.RTCPeerConnection.prototype.getReceivers?A=this.getReceivers().find(o=>o.track&&o.track.id===i.track.id):A={track:i.track};const s=new Event("track");s.track=i.track,s.receiver=A,s.transceiver={receiver:A},s.streams=[r.stream],this.dispatchEvent(s)}),r.stream.getTracks().forEach(i=>{let A;n.RTCPeerConnection.prototype.getReceivers?A=this.getReceivers().find(o=>o.track&&o.track.id===i.id):A={track:i};const s=new Event("track");s.track=i,s.receiver=A,s.transceiver={receiver:A},s.streams=[r.stream],this.dispatchEvent(s)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else jr(n,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function pv(n){if(typeof n=="object"&&n.RTCPeerConnection&&!("getSenders"in n.RTCPeerConnection.prototype)&&"createDTMFSender"in n.RTCPeerConnection.prototype){const e=function(i,A){return{track:A,get dtmf(){return this._dtmf===void 0&&(A.kind==="audio"?this._dtmf=i.createDTMFSender(A):this._dtmf=null),this._dtmf},_pc:i}};if(!n.RTCPeerConnection.prototype.getSenders){n.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addTrack=function(o,a){let c=i.apply(this,arguments);return c||(c=e(this,o),this._senders.push(c)),c};const A=n.RTCPeerConnection.prototype.removeTrack;n.RTCPeerConnection.prototype.removeTrack=function(o){A.apply(this,arguments);const a=this._senders.indexOf(o);a!==-1&&this._senders.splice(a,1)}}const t=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(A){this._senders=this._senders||[],t.apply(this,[A]),A.getTracks().forEach(s=>{this._senders.push(e(this,s))})};const r=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(A){this._senders=this._senders||[],r.apply(this,[A]),A.getTracks().forEach(s=>{const o=this._senders.find(a=>a.track===s);o&&this._senders.splice(this._senders.indexOf(o),1)})}}else if(typeof n=="object"&&n.RTCPeerConnection&&"getSenders"in n.RTCPeerConnection.prototype&&"createDTMFSender"in n.RTCPeerConnection.prototype&&n.RTCRtpSender&&!("dtmf"in n.RTCRtpSender.prototype)){const e=n.RTCPeerConnection.prototype.getSenders;n.RTCPeerConnection.prototype.getSenders=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r},Object.defineProperty(n.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function fv(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender&&n.RTCRtpReceiver))return;if(!("getStats"in n.RTCRtpSender.prototype)){const t=n.RTCPeerConnection.prototype.getSenders;t&&(n.RTCPeerConnection.prototype.getSenders=function(){const A=t.apply(this,[]);return A.forEach(s=>s._pc=this),A});const r=n.RTCPeerConnection.prototype.addTrack;r&&(n.RTCPeerConnection.prototype.addTrack=function(){const A=r.apply(this,arguments);return A._pc=this,A}),n.RTCRtpSender.prototype.getStats=function(){const A=this;return this._pc.getStats().then(s=>cv(s,A.track,!0))}}if(!("getStats"in n.RTCRtpReceiver.prototype)){const t=n.RTCPeerConnection.prototype.getReceivers;t&&(n.RTCPeerConnection.prototype.getReceivers=function(){const i=t.apply(this,[]);return i.forEach(A=>A._pc=this),i}),jr(n,"track",r=>(r.receiver._pc=r.srcElement,r)),n.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(A=>cv(A,i.track,!1))}}if(!("getStats"in n.RTCRtpSender.prototype&&"getStats"in n.RTCRtpReceiver.prototype))return;const e=n.RTCPeerConnection.prototype.getStats;n.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof n.MediaStreamTrack){const r=arguments[0];let i,A,s;return this.getSenders().forEach(o=>{o.track===r&&(i?s=!0:i=o)}),this.getReceivers().forEach(o=>(o.track===r&&(A?s=!0:A=o),o.track===r)),s||i&&A?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():A?A.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function gv(n){n.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(s=>this._shimmedLocalStreams[s][0])};const e=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addTrack=function(s,o){if(!o)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const a=e.apply(this,arguments);return this._shimmedLocalStreams[o.id]?this._shimmedLocalStreams[o.id].indexOf(a)===-1&&this._shimmedLocalStreams[o.id].push(a):this._shimmedLocalStreams[o.id]=[o,a],a};const t=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(s){this._shimmedLocalStreams=this._shimmedLocalStreams||{},s.getTracks().forEach(c=>{if(this.getSenders().find(l=>l.track===c))throw new DOMException("Track already exists.","InvalidAccessError")});const o=this.getSenders();t.apply(this,arguments);const a=this.getSenders().filter(c=>o.indexOf(c)===-1);this._shimmedLocalStreams[s.id]=[s].concat(a)};const r=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],r.apply(this,arguments)};const i=n.RTCPeerConnection.prototype.removeTrack;n.RTCPeerConnection.prototype.removeTrack=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},s&&Object.keys(this._shimmedLocalStreams).forEach(o=>{const a=this._shimmedLocalStreams[o].indexOf(s);a!==-1&&this._shimmedLocalStreams[o].splice(a,1),this._shimmedLocalStreams[o].length===1&&delete this._shimmedLocalStreams[o]}),i.apply(this,arguments)}}function mv(n,e){if(!n.RTCPeerConnection)return;if(n.RTCPeerConnection.prototype.addTrack&&e.version>=65)return gv(n);const t=n.RTCPeerConnection.prototype.getLocalStreams;n.RTCPeerConnection.prototype.getLocalStreams=function(){const u=t.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(l=>this._reverseStreams[l.id])};const r=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(u){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},u.getTracks().forEach(l=>{if(this.getSenders().find(h=>h.track===l))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[u.id]){const l=new n.MediaStream(u.getTracks());this._streams[u.id]=l,this._reverseStreams[l.id]=u,u=l}r.apply(this,[u])};const i=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(u){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[u.id]||u]),delete this._reverseStreams[this._streams[u.id]?this._streams[u.id].id:u.id],delete this._streams[u.id]},n.RTCPeerConnection.prototype.addTrack=function(u,l){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const d=[].slice.call(arguments,1);if(d.length!==1||!d[0].getTracks().find(p=>p===u))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(p=>p.track===u))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const f=this._streams[l.id];if(f)f.addTrack(u),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const p=new n.MediaStream([u]);this._streams[l.id]=p,this._reverseStreams[p.id]=l,this.addStream(p)}return this.getSenders().find(p=>p.track===u)};function A(c,u){let l=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(d=>{const h=c._reverseStreams[d],f=c._streams[h.id];l=l.replace(new RegExp(f.id,"g"),h.id)}),new RTCSessionDescription({type:u.type,sdp:l})}function s(c,u){let l=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(d=>{const h=c._reverseStreams[d],f=c._streams[h.id];l=l.replace(new RegExp(h.id,"g"),f.id)}),new RTCSessionDescription({type:u.type,sdp:l})}["createOffer","createAnswer"].forEach(function(c){const u=n.RTCPeerConnection.prototype[c],l={[c](){const d=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[f=>{const p=A(this,f);d[0].apply(null,[p])},f=>{d[1]&&d[1].apply(null,f)},arguments[2]]):u.apply(this,arguments).then(f=>A(this,f))}};n.RTCPeerConnection.prototype[c]=l[c]});const o=n.RTCPeerConnection.prototype.setLocalDescription;n.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?o.apply(this,arguments):(arguments[0]=s(this,arguments[0]),o.apply(this,arguments))};const a=Object.getOwnPropertyDescriptor(n.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(n.RTCPeerConnection.prototype,"localDescription",{get(){const c=a.get.apply(this);return c.type===""?c:A(this,c)}}),n.RTCPeerConnection.prototype.removeTrack=function(u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!u._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(u._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let d;Object.keys(this._streams).forEach(h=>{this._streams[h].getTracks().find(p=>u.track===p)&&(d=this._streams[h])}),d&&(d.getTracks().length===1?this.removeStream(this._reverseStreams[d.id]):d.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function fl(n,e){!n.RTCPeerConnection&&n.webkitRTCPeerConnection&&(n.RTCPeerConnection=n.webkitRTCPeerConnection),n.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){const r=n.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new(t==="addIceCandidate"?n.RTCIceCandidate:n.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};n.RTCPeerConnection.prototype[t]=i[t]})}function vv(n,e){jr(n,"negotiationneeded",t=>{const r=t.target;if(!((e.version<72||r.getConfiguration&&r.getConfiguration().sdpSemantics==="plan-b")&&r.signalingState!=="stable"))return t})}var yv=Object.freeze({__proto__:null,fixNegotiationNeeded:vv,shimAddTrackRemoveTrack:mv,shimAddTrackRemoveTrackWithNative:gv,shimGetSendersWithDtmf:pv,shimGetUserMedia:lv,shimMediaStream:dv,shimOnTrack:hv,shimPeerConnection:fl,shimSenderReceiverGetStats:fv});function wv(n,e){const t=n&&n.navigator,r=n&&n.MediaStreamTrack;if(t.getUserMedia=function(i,A,s){hl("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),t.mediaDevices.getUserMedia(i).then(A,s)},!(e.version>55&&"autoGainControl"in t.mediaDevices.getSupportedConstraints())){const i=function(s,o,a){o in s&&!(a in s)&&(s[a]=s[o],delete s[o])},A=t.mediaDevices.getUserMedia.bind(t.mediaDevices);if(t.mediaDevices.getUserMedia=function(s){return typeof s=="object"&&typeof s.audio=="object"&&(s=JSON.parse(JSON.stringify(s)),i(s.audio,"autoGainControl","mozAutoGainControl"),i(s.audio,"noiseSuppression","mozNoiseSuppression")),A(s)},r&&r.prototype.getSettings){const s=r.prototype.getSettings;r.prototype.getSettings=function(){const o=s.apply(this,arguments);return i(o,"mozAutoGainControl","autoGainControl"),i(o,"mozNoiseSuppression","noiseSuppression"),o}}if(r&&r.prototype.applyConstraints){const s=r.prototype.applyConstraints;r.prototype.applyConstraints=function(o){return this.kind==="audio"&&typeof o=="object"&&(o=JSON.parse(JSON.stringify(o)),i(o,"autoGainControl","mozAutoGainControl"),i(o,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[o])}}}}function lF(n,e){n.navigator.mediaDevices&&"getDisplayMedia"in n.navigator.mediaDevices||n.navigator.mediaDevices&&(n.navigator.mediaDevices.getDisplayMedia=function(r){if(!(r&&r.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return r.video===!0?r.video={mediaSource:e}:r.video.mediaSource=e,n.navigator.mediaDevices.getUserMedia(r)})}function bv(n){typeof n=="object"&&n.RTCTrackEvent&&"receiver"in n.RTCTrackEvent.prototype&&!("transceiver"in n.RTCTrackEvent.prototype)&&Object.defineProperty(n.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function gl(n,e){if(typeof n!="object"||!(n.RTCPeerConnection||n.mozRTCPeerConnection))return;!n.RTCPeerConnection&&n.mozRTCPeerConnection&&(n.RTCPeerConnection=n.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(i){const A=n.RTCPeerConnection.prototype[i],s={[i](){return arguments[0]=new(i==="addIceCandidate"?n.RTCIceCandidate:n.RTCSessionDescription)(arguments[0]),A.apply(this,arguments)}};n.RTCPeerConnection.prototype[i]=s[i]});const t={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=n.RTCPeerConnection.prototype.getStats;n.RTCPeerConnection.prototype.getStats=function(){const[A,s,o]=arguments;return r.apply(this,[A||null]).then(a=>{if(e.version<53&&!s)try{a.forEach(c=>{c.type=t[c.type]||c.type})}catch(c){if(c.name!=="TypeError")throw c;a.forEach((u,l)=>{a.set(l,Object.assign({},u,{type:t[u.type]||u.type}))})}return a}).then(s,o)}}function Bv(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender)||n.RTCRtpSender&&"getStats"in n.RTCRtpSender.prototype)return;const e=n.RTCPeerConnection.prototype.getSenders;e&&(n.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(A=>A._pc=this),i});const t=n.RTCPeerConnection.prototype.addTrack;t&&(n.RTCPeerConnection.prototype.addTrack=function(){const i=t.apply(this,arguments);return i._pc=this,i}),n.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function Cv(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender)||n.RTCRtpSender&&"getStats"in n.RTCRtpReceiver.prototype)return;const e=n.RTCPeerConnection.prototype.getReceivers;e&&(n.RTCPeerConnection.prototype.getReceivers=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r}),jr(n,"track",t=>(t.receiver._pc=t.srcElement,t)),n.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function _v(n){!n.RTCPeerConnection||"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){hl("removeStream","removeTrack"),this.getSenders().forEach(r=>{r.track&&t.getTracks().includes(r.track)&&this.removeTrack(r)})})}function Sv(n){n.DataChannel&&!n.RTCDataChannel&&(n.RTCDataChannel=n.DataChannel)}function kv(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.addTransceiver;e&&(n.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let r=arguments[1]&&arguments[1].sendEncodings;r===void 0&&(r=[]),r=[...r];const i=r.length>0;i&&r.forEach(s=>{if("rid"in s&&!/^[a-z0-9]{0,16}$/i.test(s.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in s&&!(parseFloat(s.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in s&&!(parseFloat(s.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const A=e.apply(this,arguments);if(i){const{sender:s}=A,o=s.getParameters();(!("encodings"in o)||o.encodings.length===1&&Object.keys(o.encodings[0]).length===0)&&(o.encodings=r,s.sendEncodings=r,this.setParametersPromises.push(s.setParameters(o).then(()=>{delete s.sendEncodings}).catch(()=>{delete s.sendEncodings})))}return A})}function Ev(n){if(!(typeof n=="object"&&n.RTCRtpSender))return;const e=n.RTCRtpSender.prototype.getParameters;e&&(n.RTCRtpSender.prototype.getParameters=function(){const r=e.apply(this,arguments);return"encodings"in r||(r.encodings=[].concat(this.sendEncodings||[{}])),r})}function Uv(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.createOffer;n.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function Tv(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.createAnswer;n.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}var Iv=Object.freeze({__proto__:null,shimAddTransceiver:kv,shimCreateAnswer:Tv,shimCreateOffer:Uv,shimGetDisplayMedia:lF,shimGetParameters:Ev,shimGetUserMedia:wv,shimOnTrack:bv,shimPeerConnection:gl,shimRTCDataChannel:Sv,shimReceiverGetStats:Cv,shimRemoveStream:_v,shimSenderGetStats:Bv});function Fv(n){if(!(typeof n!="object"||!n.RTCPeerConnection)){if("getLocalStreams"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in n.RTCPeerConnection.prototype)){const e=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addStream=function(r){this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(i=>e.call(this,i,r)),r.getVideoTracks().forEach(i=>e.call(this,i,r))},n.RTCPeerConnection.prototype.addTrack=function(r){for(var i=arguments.length,A=new Array(i>1?i-1:0),s=1;s<i;s++)A[s-1]=arguments[s];return A&&A.forEach(o=>{this._localStreams?this._localStreams.includes(o)||this._localStreams.push(o):this._localStreams=[o]}),e.apply(this,arguments)}}"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){this._localStreams||(this._localStreams=[]);const r=this._localStreams.indexOf(t);if(r===-1)return;this._localStreams.splice(r,1);const i=t.getTracks();this.getSenders().forEach(A=>{i.includes(A.track)&&this.removeTrack(A)})})}}function xv(n){if(!(typeof n!="object"||!n.RTCPeerConnection)&&("getRemoteStreams"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in n.RTCPeerConnection.prototype))){Object.defineProperty(n.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(t){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=r=>{r.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const A=new Event("addstream");A.stream=i,this.dispatchEvent(A)})})}});const e=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){const r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(A=>{if(r._remoteStreams||(r._remoteStreams=[]),r._remoteStreams.indexOf(A)>=0)return;r._remoteStreams.push(A);const s=new Event("addstream");s.stream=A,r.dispatchEvent(s)})}),e.apply(r,arguments)}}}function Qv(n){if(typeof n!="object"||!n.RTCPeerConnection)return;const e=n.RTCPeerConnection.prototype,t=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,A=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(c,u){const l=arguments.length>=2?arguments[2]:arguments[0],d=t.apply(this,[l]);return u?(d.then(c,u),Promise.resolve()):d},e.createAnswer=function(c,u){const l=arguments.length>=2?arguments[2]:arguments[0],d=r.apply(this,[l]);return u?(d.then(c,u),Promise.resolve()):d};let o=function(a,c,u){const l=i.apply(this,[a]);return u?(l.then(c,u),Promise.resolve()):l};e.setLocalDescription=o,o=function(a,c,u){const l=A.apply(this,[a]);return u?(l.then(c,u),Promise.resolve()):l},e.setRemoteDescription=o,o=function(a,c,u){const l=s.apply(this,[a]);return u?(l.then(c,u),Promise.resolve()):l},e.addIceCandidate=o}function Rv(n){const e=n&&n.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const t=e.mediaDevices,r=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=i=>r(Pv(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(r,i,A){e.mediaDevices.getUserMedia(r).then(i,A)}).bind(e))}function Pv(n){return n&&n.video!==void 0?Object.assign({},n,{video:av(n.video)}):n}function Ov(n){if(!n.RTCPeerConnection)return;const e=n.RTCPeerConnection;n.RTCPeerConnection=function(r,i){if(r&&r.iceServers){const A=[];for(let s=0;s<r.iceServers.length;s++){let o=r.iceServers[s];o.urls===void 0&&o.url?(hl("RTCIceServer.url","RTCIceServer.urls"),o=JSON.parse(JSON.stringify(o)),o.urls=o.url,delete o.url,A.push(o)):A.push(r.iceServers[s])}r.iceServers=A}return new e(r,i)},n.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(n.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function Mv(n){typeof n=="object"&&n.RTCTrackEvent&&"receiver"in n.RTCTrackEvent.prototype&&!("transceiver"in n.RTCTrackEvent.prototype)&&Object.defineProperty(n.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Lv(n){const e=n.RTCPeerConnection.prototype.createOffer;n.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio<"u"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);const i=this.getTransceivers().find(s=>s.receiver.track.kind==="audio");r.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo<"u"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);const A=this.getTransceivers().find(s=>s.receiver.track.kind==="video");r.offerToReceiveVideo===!1&&A?A.direction==="sendrecv"?A.setDirection?A.setDirection("sendonly"):A.direction="sendonly":A.direction==="recvonly"&&(A.setDirection?A.setDirection("inactive"):A.direction="inactive"):r.offerToReceiveVideo===!0&&!A&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function Dv(n){typeof n!="object"||n.AudioContext||(n.AudioContext=n.webkitAudioContext)}var Nv=Object.freeze({__proto__:null,shimAudioContext:Dv,shimCallbacksAPI:Qv,shimConstraints:Pv,shimCreateOfferLegacy:Lv,shimGetUserMedia:Rv,shimLocalStreamsAPI:Fv,shimRTCIceServerUrls:Ov,shimRemoteStreamsAPI:xv,shimTrackEventTransceiver:Mv}),ml={exports:{}},Hv;function dF(){return Hv||(Hv=1,function(n){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split(`
5
+ .`).concat(Hu).concat(MU).concat(Ng))},DU=function(n,e){var t=n.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,n.appendChild(r)}},NU=function(n,e){var t,r=e.createElement("base");r.href=e.baseURI;var i=n.getElementsByTagName("head").item(0);i==null||i.insertBefore(r,(t=i==null?void 0:i.firstChild)!==null&&t!==void 0?t:null)},Ku=function(){function n(){}return n.getOrigin=function(e){var t=n._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},n.isSameOrigin=function(e){return n.getOrigin(e)===n._origin},n.setContext=function(e){n._link=e.document.createElement("a"),n._origin=n.getOrigin(e.location.href)},n._origin="about:blank",n}(),HU=function(){function n(e,t){this.context=e,this._options=t,this._cache={}}return n.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Gu(e)||jU(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},n.prototype.match=function(e){return this._cache[e]},n.prototype.loadImage=function(e){return Tt(this,void 0,void 0,function(){var t,r,i,A,s,o=this;return Ct(this,function(a){switch(a.label){case 0:return typeof this._options.customIsSameOrigin!="function"?[3,2]:[4,this._options.customIsSameOrigin(e,Ku.isSameOrigin)];case 1:return r=a.sent(),[3,3];case 2:r=Ku.isSameOrigin(e),a.label=3;case 3:return t=r,i=!Vu(e)&&this._options.useCORS===!0&&yt.SUPPORT_CORS_IMAGES&&!t,A=!Vu(e)&&!t&&!Gu(e)&&typeof this._options.proxy=="string"&&yt.SUPPORT_CORS_XHR&&!i,!t&&this._options.allowTaint===!1&&!Vu(e)&&!Gu(e)&&!A&&!i?[2]:(s=e,A?[4,this.proxy(s)]:[3,5]);case 4:s=a.sent(),a.label=5;case 5:return this.context.logger.debug("Added image ".concat(e.substring(0,256))),[4,new Promise(function(c,u){var l=new Image;l.onload=function(){return c(l)},l.onerror=u,(WU(s)||i)&&(l.crossOrigin="anonymous"),l.src=s,l.complete===!0&&setTimeout(function(){return c(l)},500),o._options.imageTimeout>0&&setTimeout(function(){return u("Timed out (".concat(o._options.imageTimeout,"ms) loading image"))},o._options.imageTimeout)})];case 6:return[2,a.sent()]}})})},n.prototype.has=function(e){return typeof this._cache[e]<"u"},n.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},n.prototype.proxy=function(e){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var i=e.substring(0,256);return new Promise(function(A,s){var o=yt.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(o==="text")A(a.response);else{var l=new FileReader;l.addEventListener("load",function(){return A(l.result)},!1),l.addEventListener("error",function(d){return s(d)},!1),l.readAsDataURL(a.response)}else s("Failed to proxy resource ".concat(i," with status code ").concat(a.status))},a.onerror=s;var c=r.indexOf("?")>-1?"&":"?";if(a.open("GET","".concat(r).concat(c,"url=").concat(encodeURIComponent(e),"&responseType=").concat(o)),o!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=o),t._options.imageTimeout){var u=t._options.imageTimeout;a.timeout=u,a.ontimeout=function(){return s("Timed out (".concat(u,"ms) proxying ").concat(i))}}a.send()})},n}(),KU=/^data:image\/svg\+xml/i,VU=/^data:image\/.*;base64,/i,GU=/^data:image\/.*/i,jU=function(n){return yt.SUPPORT_SVG_DRAWING||!qU(n)},Vu=function(n){return GU.test(n)},WU=function(n){return VU.test(n)},Gu=function(n){return n.substr(0,4)==="blob"},qU=function(n){return n.substr(-3).toLowerCase()==="svg"||KU.test(n)},G=function(){function n(e,t){this.type=0,this.x=e,this.y=t}return n.prototype.add=function(e,t){return new n(this.x+e,this.y+t)},n}(),wi=function(n,e,t){return new G(n.x+(e.x-n.x)*t,n.y+(e.y-n.y)*t)},So=function(){function n(e,t,r,i){this.type=1,this.start=e,this.startControl=t,this.endControl=r,this.end=i}return n.prototype.subdivide=function(e,t){var r=wi(this.start,this.startControl,e),i=wi(this.startControl,this.endControl,e),A=wi(this.endControl,this.end,e),s=wi(r,i,e),o=wi(i,A,e),a=wi(s,o,e);return t?new n(this.start,r,s,a):new n(a,o,A,this.end)},n.prototype.add=function(e,t){return new n(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},n.prototype.reverse=function(){return new n(this.end,this.endControl,this.startControl,this.start)},n}(),zt=function(n){return n.type===1},JU=function(){function n(e){var t=e.styles,r=e.bounds,i=kA(t.borderTopLeftRadius,r.width,r.height),A=i[0],s=i[1],o=kA(t.borderTopRightRadius,r.width,r.height),a=o[0],c=o[1],u=kA(t.borderBottomRightRadius,r.width,r.height),l=u[0],d=u[1],h=kA(t.borderBottomLeftRadius,r.width,r.height),f=h[0],p=h[1],g=[];g.push((A+a)/r.width),g.push((f+l)/r.width),g.push((s+p)/r.height),g.push((c+d)/r.height);var v=Math.max.apply(Math,g);v>1&&(A/=v,s/=v,a/=v,c/=v,l/=v,d/=v,f/=v,p/=v);var y=r.width-a,B=r.height-d,b=r.width-l,w=r.height-p,_=t.borderTopWidth,k=t.borderRightWidth,F=t.borderBottomWidth,x=t.borderLeftWidth,E=ke(t.paddingTop,e.bounds.width),T=ke(t.paddingRight,e.bounds.width),Q=ke(t.paddingBottom,e.bounds.width),M=ke(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=A>0||s>0?He(r.left+x/3,r.top+_/3,A-x/3,s-_/3,Ce.TOP_LEFT):new G(r.left+x/3,r.top+_/3),this.topRightBorderDoubleOuterBox=A>0||s>0?He(r.left+y,r.top+_/3,a-k/3,c-_/3,Ce.TOP_RIGHT):new G(r.left+r.width-k/3,r.top+_/3),this.bottomRightBorderDoubleOuterBox=l>0||d>0?He(r.left+b,r.top+B,l-k/3,d-F/3,Ce.BOTTOM_RIGHT):new G(r.left+r.width-k/3,r.top+r.height-F/3),this.bottomLeftBorderDoubleOuterBox=f>0||p>0?He(r.left+x/3,r.top+w,f-x/3,p-F/3,Ce.BOTTOM_LEFT):new G(r.left+x/3,r.top+r.height-F/3),this.topLeftBorderDoubleInnerBox=A>0||s>0?He(r.left+x*2/3,r.top+_*2/3,A-x*2/3,s-_*2/3,Ce.TOP_LEFT):new G(r.left+x*2/3,r.top+_*2/3),this.topRightBorderDoubleInnerBox=A>0||s>0?He(r.left+y,r.top+_*2/3,a-k*2/3,c-_*2/3,Ce.TOP_RIGHT):new G(r.left+r.width-k*2/3,r.top+_*2/3),this.bottomRightBorderDoubleInnerBox=l>0||d>0?He(r.left+b,r.top+B,l-k*2/3,d-F*2/3,Ce.BOTTOM_RIGHT):new G(r.left+r.width-k*2/3,r.top+r.height-F*2/3),this.bottomLeftBorderDoubleInnerBox=f>0||p>0?He(r.left+x*2/3,r.top+w,f-x*2/3,p-F*2/3,Ce.BOTTOM_LEFT):new G(r.left+x*2/3,r.top+r.height-F*2/3),this.topLeftBorderStroke=A>0||s>0?He(r.left+x/2,r.top+_/2,A-x/2,s-_/2,Ce.TOP_LEFT):new G(r.left+x/2,r.top+_/2),this.topRightBorderStroke=A>0||s>0?He(r.left+y,r.top+_/2,a-k/2,c-_/2,Ce.TOP_RIGHT):new G(r.left+r.width-k/2,r.top+_/2),this.bottomRightBorderStroke=l>0||d>0?He(r.left+b,r.top+B,l-k/2,d-F/2,Ce.BOTTOM_RIGHT):new G(r.left+r.width-k/2,r.top+r.height-F/2),this.bottomLeftBorderStroke=f>0||p>0?He(r.left+x/2,r.top+w,f-x/2,p-F/2,Ce.BOTTOM_LEFT):new G(r.left+x/2,r.top+r.height-F/2),this.topLeftBorderBox=A>0||s>0?He(r.left,r.top,A,s,Ce.TOP_LEFT):new G(r.left,r.top),this.topRightBorderBox=a>0||c>0?He(r.left+y,r.top,a,c,Ce.TOP_RIGHT):new G(r.left+r.width,r.top),this.bottomRightBorderBox=l>0||d>0?He(r.left+b,r.top+B,l,d,Ce.BOTTOM_RIGHT):new G(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=f>0||p>0?He(r.left,r.top+w,f,p,Ce.BOTTOM_LEFT):new G(r.left,r.top+r.height),this.topLeftPaddingBox=A>0||s>0?He(r.left+x,r.top+_,Math.max(0,A-x),Math.max(0,s-_),Ce.TOP_LEFT):new G(r.left+x,r.top+_),this.topRightPaddingBox=a>0||c>0?He(r.left+Math.min(y,r.width-k),r.top+_,y>r.width+k?0:Math.max(0,a-k),Math.max(0,c-_),Ce.TOP_RIGHT):new G(r.left+r.width-k,r.top+_),this.bottomRightPaddingBox=l>0||d>0?He(r.left+Math.min(b,r.width-x),r.top+Math.min(B,r.height-F),Math.max(0,l-k),Math.max(0,d-F),Ce.BOTTOM_RIGHT):new G(r.left+r.width-k,r.top+r.height-F),this.bottomLeftPaddingBox=f>0||p>0?He(r.left+x,r.top+Math.min(w,r.height-F),Math.max(0,f-x),Math.max(0,p-F),Ce.BOTTOM_LEFT):new G(r.left+x,r.top+r.height-F),this.topLeftContentBox=A>0||s>0?He(r.left+x+M,r.top+_+E,Math.max(0,A-(x+M)),Math.max(0,s-(_+E)),Ce.TOP_LEFT):new G(r.left+x+M,r.top+_+E),this.topRightContentBox=a>0||c>0?He(r.left+Math.min(y,r.width+x+M),r.top+_+E,y>r.width+x+M?0:a-x+M,c-(_+E),Ce.TOP_RIGHT):new G(r.left+r.width-(k+T),r.top+_+E),this.bottomRightContentBox=l>0||d>0?He(r.left+Math.min(b,r.width-(x+M)),r.top+Math.min(B,r.height+_+E),Math.max(0,l-(k+T)),d-(F+Q),Ce.BOTTOM_RIGHT):new G(r.left+r.width-(k+T),r.top+r.height-(F+Q)),this.bottomLeftContentBox=f>0||p>0?He(r.left+x+M,r.top+w,Math.max(0,f-(x+M)),p-(F+Q),Ce.BOTTOM_LEFT):new G(r.left+x+M,r.top+r.height-(F+Q))}return n}(),Ce;(function(n){n[n.TOP_LEFT=0]="TOP_LEFT",n[n.TOP_RIGHT=1]="TOP_RIGHT",n[n.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",n[n.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Ce||(Ce={}));var He=function(n,e,t,r,i){var A=4*((Math.sqrt(2)-1)/3),s=t*A,o=r*A,a=n+t,c=e+r;switch(i){case Ce.TOP_LEFT:return new So(new G(n,c),new G(n,c-o),new G(a-s,e),new G(a,e));case Ce.TOP_RIGHT:return new So(new G(n,e),new G(n+s,e),new G(a,c-o),new G(a,c));case Ce.BOTTOM_RIGHT:return new So(new G(a,e),new G(a,e+o),new G(n+s,c),new G(n,c));case Ce.BOTTOM_LEFT:default:return new So(new G(a,c),new G(a-s,c),new G(n,e+o),new G(n,e))}},ko=function(n){return[n.topLeftBorderBox,n.topRightBorderBox,n.bottomRightBorderBox,n.bottomLeftBorderBox]},zU=function(n){return[n.topLeftContentBox,n.topRightContentBox,n.bottomRightContentBox,n.bottomLeftContentBox]},Eo=function(n){return[n.topLeftPaddingBox,n.topRightPaddingBox,n.bottomRightPaddingBox,n.bottomLeftPaddingBox]},XU=function(){function n(e,t,r){this.offsetX=e,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return n}(),Uo=function(){function n(e,t){this.path=e,this.target=t,this.type=1}return n}(),YU=function(){function n(e){this.opacity=e,this.type=2,this.target=6}return n}(),ZU=function(n){return n.type===0},Hg=function(n){return n.type===1},$U=function(n){return n.type===2},Kg=function(n,e){return n.length===e.length?n.some(function(t,r){return t===e[r]}):!1},eT=function(n,e,t,r,i){return n.map(function(A,s){switch(s){case 0:return A.add(e,t);case 1:return A.add(e+r,t);case 2:return A.add(e+r,t+i);case 3:return A.add(e,t+i)}return A})},Vg=function(){function n(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return n}(),Gg=function(){function n(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new JU(this.container),this.container.styles.opacity<1&&this.effects.push(new YU(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,A=this.container.styles.transform;this.effects.push(new XU(r,i,A))}if(this.container.styles.overflowX!==0){var s=ko(this.curves),o=Eo(this.curves);Kg(s,o)?this.effects.push(new Uo(s,6)):(this.effects.push(new Uo(s,2)),this.effects.push(new Uo(o,4)))}}return n.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,i=this.effects.slice(0);r;){var A=r.effects.filter(function(a){return!Hg(a)});if(t||r.container.styles.position!==0||!r.parent){if(t=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var s=ko(r.curves),o=Eo(r.curves);Kg(s,o)||i.unshift(new Uo(o,6))}i.unshift.apply(i,A)}else i.unshift.apply(i,A);r=r.parent}return i.filter(function(a){return ut(a.target,e)})},n}(),ju=function(n,e,t,r){n.container.elements.forEach(function(i){var A=ut(i.flags,4),s=ut(i.flags,2),o=new Gg(i,n);ut(i.styles.display,2048)&&r.push(o);var a=ut(i.flags,8)?[]:r;if(A||s){var c=A||i.styles.isPositioned()?t:e,u=new Vg(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var l=i.styles.zIndex.order;if(l<0){var d=0;c.negativeZIndex.some(function(f,p){return l>f.element.container.styles.zIndex.order?(d=p,!1):d>0}),c.negativeZIndex.splice(d,0,u)}else if(l>0){var h=0;c.positiveZIndex.some(function(f,p){return l>=f.element.container.styles.zIndex.order?(h=p+1,!1):h>0}),c.positiveZIndex.splice(h,0,u)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else i.styles.isFloating()?c.nonPositionedFloats.push(u):c.nonPositionedInlineLevel.push(u);ju(o,u,A?u:t,a)}else i.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),ju(o,e,t,a);ut(i.flags,8)&&jg(i,a)})},jg=function(n,e){for(var t=n instanceof Qu?n.start:1,r=n instanceof Qu?n.reversed:!1,i=0;i<e.length;i++){var A=e[i];A.container instanceof mg&&typeof A.container.value=="number"&&A.container.value!==0&&(t=A.container.value),A.listValue=xA(t,A.container.styles.listStyleType,!0),t+=r?-1:1}},tT=function(n){var e=new Gg(n,null),t=new Vg(e),r=[];return ju(e,t,t,r),jg(e.container,r),t},Wg=function(n,e){switch(e){case 0:return Xt(n.topLeftBorderBox,n.topLeftPaddingBox,n.topRightBorderBox,n.topRightPaddingBox);case 1:return Xt(n.topRightBorderBox,n.topRightPaddingBox,n.bottomRightBorderBox,n.bottomRightPaddingBox);case 2:return Xt(n.bottomRightBorderBox,n.bottomRightPaddingBox,n.bottomLeftBorderBox,n.bottomLeftPaddingBox);case 3:default:return Xt(n.bottomLeftBorderBox,n.bottomLeftPaddingBox,n.topLeftBorderBox,n.topLeftPaddingBox)}},nT=function(n,e){switch(e){case 0:return Xt(n.topLeftBorderBox,n.topLeftBorderDoubleOuterBox,n.topRightBorderBox,n.topRightBorderDoubleOuterBox);case 1:return Xt(n.topRightBorderBox,n.topRightBorderDoubleOuterBox,n.bottomRightBorderBox,n.bottomRightBorderDoubleOuterBox);case 2:return Xt(n.bottomRightBorderBox,n.bottomRightBorderDoubleOuterBox,n.bottomLeftBorderBox,n.bottomLeftBorderDoubleOuterBox);case 3:default:return Xt(n.bottomLeftBorderBox,n.bottomLeftBorderDoubleOuterBox,n.topLeftBorderBox,n.topLeftBorderDoubleOuterBox)}},rT=function(n,e){switch(e){case 0:return Xt(n.topLeftBorderDoubleInnerBox,n.topLeftPaddingBox,n.topRightBorderDoubleInnerBox,n.topRightPaddingBox);case 1:return Xt(n.topRightBorderDoubleInnerBox,n.topRightPaddingBox,n.bottomRightBorderDoubleInnerBox,n.bottomRightPaddingBox);case 2:return Xt(n.bottomRightBorderDoubleInnerBox,n.bottomRightPaddingBox,n.bottomLeftBorderDoubleInnerBox,n.bottomLeftPaddingBox);case 3:default:return Xt(n.bottomLeftBorderDoubleInnerBox,n.bottomLeftPaddingBox,n.topLeftBorderDoubleInnerBox,n.topLeftPaddingBox)}},iT=function(n,e){switch(e){case 0:return To(n.topLeftBorderStroke,n.topRightBorderStroke);case 1:return To(n.topRightBorderStroke,n.bottomRightBorderStroke);case 2:return To(n.bottomRightBorderStroke,n.bottomLeftBorderStroke);case 3:default:return To(n.bottomLeftBorderStroke,n.topLeftBorderStroke)}},To=function(n,e){var t=[];return zt(n)?t.push(n.subdivide(.5,!1)):t.push(n),zt(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},Xt=function(n,e,t,r){var i=[];return zt(n)?i.push(n.subdivide(.5,!1)):i.push(n),zt(t)?i.push(t.subdivide(.5,!0)):i.push(t),zt(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),zt(e)?i.push(e.subdivide(.5,!1).reverse()):i.push(e),i},qg=function(n){var e=n.bounds,t=n.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Io=function(n){var e=n.styles,t=n.bounds,r=ke(e.paddingLeft,t.width),i=ke(e.paddingRight,t.width),A=ke(e.paddingTop,t.width),s=ke(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,A+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+i),-(e.borderTopWidth+e.borderBottomWidth+A+s))},AT=function(n,e){return n===0?e.bounds:n===2?Io(e):qg(e)},sT=function(n,e){return n===0?e.bounds:n===2?Io(e):qg(e)},Wu=function(n,e,t){var r=AT(Bi(n.styles.backgroundOrigin,e),n),i=sT(Bi(n.styles.backgroundClip,e),n),A=oT(Bi(n.styles.backgroundSize,e),t,r),s=A[0],o=A[1],a=kA(Bi(n.styles.backgroundPosition,e),r.width-s,r.height-o),c=aT(Bi(n.styles.backgroundRepeat,e),a,A,r,i),u=Math.round(r.left+a[0]),l=Math.round(r.top+a[1]);return s=Math.max(1,s),o=Math.max(1,o),[c,u,l,s,o]},bi=function(n){return ce(n)&&n.value===gi.AUTO},Fo=function(n){return typeof n=="number"},oT=function(n,e,t){var r=e[0],i=e[1],A=e[2],s=n[0],o=n[1];if(!s)return[0,0];if(Pe(s)&&o&&Pe(o))return[ke(s,t.width),ke(o,t.height)];var a=Fo(A);if(ce(s)&&(s.value===gi.CONTAIN||s.value===gi.COVER)){if(Fo(A)){var c=t.width/t.height;return c<A!=(s.value===gi.COVER)?[t.width,t.width/A]:[t.height*A,t.height]}return[t.width,t.height]}var u=Fo(r),l=Fo(i),d=u||l;if(bi(s)&&(!o||bi(o))){if(u&&l)return[r,i];if(!a&&!d)return[t.width,t.height];if(d&&a){var h=u?r:i*A,f=l?i:r/A;return[h,f]}var p=u?r:t.width,g=l?i:t.height;return[p,g]}if(a){var v=0,y=0;return Pe(s)?v=ke(s,t.width):Pe(o)&&(y=ke(o,t.height)),bi(s)?v=y*A:(!o||bi(o))&&(y=v/A),[v,y]}var B=null,b=null;if(Pe(s)?B=ke(s,t.width):o&&Pe(o)&&(b=ke(o,t.height)),B!==null&&(!o||bi(o))&&(b=u&&l?B/r*i:t.height),b!==null&&bi(s)&&(B=u&&l?b/i*r:t.width),B!==null&&b!==null)return[B,b];throw new Error("Unable to calculate background-size for element")},Bi=function(n,e){var t=n[e];return typeof t>"u"?n[0]:t},aT=function(n,e,t,r,i){var A=e[0],s=e[1],o=t[0],a=t[1];switch(n){case 2:return[new G(Math.round(r.left),Math.round(r.top+s)),new G(Math.round(r.left+r.width),Math.round(r.top+s)),new G(Math.round(r.left+r.width),Math.round(a+r.top+s)),new G(Math.round(r.left),Math.round(a+r.top+s))];case 3:return[new G(Math.round(r.left+A),Math.round(r.top)),new G(Math.round(r.left+A+o),Math.round(r.top)),new G(Math.round(r.left+A+o),Math.round(r.height+r.top)),new G(Math.round(r.left+A),Math.round(r.height+r.top))];case 1:return[new G(Math.round(r.left+A),Math.round(r.top+s)),new G(Math.round(r.left+A+o),Math.round(r.top+s)),new G(Math.round(r.left+A+o),Math.round(r.top+s+a)),new G(Math.round(r.left+A),Math.round(r.top+s+a))];default:return[new G(Math.round(i.left),Math.round(i.top)),new G(Math.round(i.left+i.width),Math.round(i.top)),new G(Math.round(i.left+i.width),Math.round(i.height+i.top)),new G(Math.round(i.left),Math.round(i.height+i.top))]}},cT="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Jg="Hidden Text",uT=function(){function n(e){this._data={},this._document=e}return n.prototype.parseMetrics=function(e,t){var r=this._document.createElement("div"),i=this._document.createElement("img"),A=this._document.createElement("span"),s=this._document.body;r.style.visibility="hidden",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",s.appendChild(r),i.src=cT,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",A.style.fontFamily=e,A.style.fontSize=t,A.style.margin="0",A.style.padding="0",A.appendChild(this._document.createTextNode(Jg)),r.appendChild(A),r.appendChild(i);var o=i.offsetTop-A.offsetTop+2;r.removeChild(A),r.appendChild(this._document.createTextNode(Jg)),r.style.lineHeight="normal",i.style.verticalAlign="super";var a=i.offsetTop-r.offsetTop+2;return s.removeChild(r),{baseline:o,middle:a}},n.prototype.getMetrics=function(e,t){var r="".concat(e," ").concat(t);return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(e,t)),this._data[r]},n}(),zg=function(){function n(e,t){this.context=e,this.options=t}return n}(),lT=1e4,dT=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i._activeEffects=[],i.canvas=r.canvas?r.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),r.canvas||(i.canvas.width=Math.floor(r.width*r.scale),i.canvas.height=Math.floor(r.height*r.scale),i.canvas.style.width="".concat(r.width,"px"),i.canvas.style.height="".concat(r.height,"px")),i.fontMetrics=new uT(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-r.x,-r.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized (".concat(r.width,"x").concat(r.height,") with scale ").concat(r.scale)),i}return e.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(i){return r.applyEffect(i)})},e.prototype.applyEffect=function(t){this.ctx.save(),$U(t)&&(this.ctx.globalAlpha=t.opacity),ZU(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),Hg(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return Tt(this,void 0,void 0,function(){var r;return Ct(this,function(i){switch(i.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return Tt(this,void 0,void 0,function(){return Ct(this,function(r){switch(r.label){case 0:return ut(t.container.flags,16),t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(t)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(t,r,i){var A=this;if(r===0)navigator.userAgent.indexOf("Firefox")===-1?(this.ctx.textBaseline="ideographic",this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+t.bounds.height)):this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+i);else{var s=xu(t.text);s.reduce(function(o,a){return A.ctx.fillText(a,o,t.bounds.top+i),o+A.ctx.measureText(a).width},t.bounds.left)}},e.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),i=mT(t.fontFamily).join(", "),A=er(t.fontSize)?"".concat(t.fontSize.number).concat(t.fontSize.unit):"".concat(t.fontSize.number,"px");return[[t.fontStyle,r,t.fontWeight,A,i].join(" "),i,A]},e.prototype.renderTextNode=function(t,r){return Tt(this,void 0,void 0,function(){var i,A,s=this;return Ct(this,function(o){return i=this.createFontStyle(r)[0],this.ctx.font=i,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",A=r.paintOrder,t.textBounds.forEach(function(a){A.forEach(function(c){switch(c){case 0:s.ctx.fillStyle=pt(r.color),s.renderTextWithLetterSpacing(a,r.letterSpacing,r.fontSize.number);var u=r.textShadow;if(u.length&&a.text.trim().length&&(u.slice(0).reverse().forEach(function(d){s.ctx.shadowColor=pt(d.color),s.ctx.shadowOffsetX=d.offsetX.number*s.options.scale,s.ctx.shadowOffsetY=d.offsetY.number*s.options.scale,s.ctx.shadowBlur=d.blur.number,s.renderTextWithLetterSpacing(a,r.letterSpacing,r.fontSize.number)}),s.ctx.shadowColor="",s.ctx.shadowOffsetX=0,s.ctx.shadowOffsetY=0,s.ctx.shadowBlur=0),r.textDecorationLine.length){s.ctx.fillStyle=pt(r.textDecorationColor||r.color);var l=1;r.textDecorationLine.forEach(function(d){switch(d){case 1:s.ctx.fillRect(a.bounds.left,a.bounds.top+a.bounds.height-l,a.bounds.width,l);break;case 2:s.ctx.fillRect(a.bounds.left,a.bounds.top,a.bounds.width,l);break;case 3:s.ctx.fillRect(a.bounds.left,a.bounds.top+(a.bounds.height/2-l/2),a.bounds.width,l);break}})}break;case 1:r.webkitTextStrokeWidth&&a.text.trim().length&&(s.ctx.strokeStyle=pt(r.webkitTextStrokeColor),s.ctx.lineWidth=r.webkitTextStrokeWidth,s.ctx.lineJoin=window.chrome?"miter":"round",s.ctx.strokeText(a.text,a.bounds.left,a.bounds.top+a.bounds.height)),s.ctx.strokeStyle="",s.ctx.lineWidth=0,s.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(t,r,i){var A=i.naturalWidth||t.intrinsicWidth,s=i.naturalHeight||t.intrinsicHeight;if(i&&A>0&&s>0){var o=Io(t),a=Eo(r);this.path(a),this.ctx.save(),this.ctx.clip();var c=0,u=0,l=A,d=s,h=o.left,f=o.top,p=o.width,g=o.height,v=t.styles.objectFit,y=p/g,B=l/d;if(v===2)B>y?(g=p/B,f+=(o.height-g)/2):(p=g*B,h+=(o.width-p)/2);else if(v===4)B>y?(l=d*y,c+=(A-l)/2):(d=l/y,u+=(s-d)/2);else if(v===8)l>p?(c+=(l-p)/2,l=p):(h+=(p-l)/2,p=l),d>g?(u+=(d-g)/2,d=g):(f+=(g-d)/2,g=d);else if(v===16){var b=B>y?p:g*B,w=l>p?l:p;b<w?B>y?(g=p/B,f+=(o.height-g)/2):(p=g*B,h+=(o.width-p)/2):(l>p?(c+=(l-p)/2,l=p):(h+=(p-l)/2,p=l),d>g?(u+=(d-g)/2,d=g):(f+=(g-d)/2,g=d))}this.ctx.drawImage(i,c,u,l,d,h,f,p,g),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return Tt(this,void 0,void 0,function(){var r,i,A,s,o,a,B,B,c,u,l,d,w,h,f,p,_,g,v,y,B,b,w,_;return Ct(this,function(k){switch(k.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,i=t.curves,A=r.styles,s=0,o=r.textNodes,k.label=1;case 1:return s<o.length?(a=o[s],[4,this.renderTextNode(a,A)]):[3,4];case 2:k.sent(),k.label=3;case 3:return s++,[3,1];case 4:if(!(r instanceof pg))return[3,8];k.label=5;case 5:return k.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return B=k.sent(),this.renderReplacedElement(r,i,B),[3,8];case 7:return k.sent(),this.context.logger.error("Error loading image ".concat(r.src)),[3,8];case 8:if(r instanceof fg&&this.renderReplacedElement(r,i,r.canvas),!(r instanceof gg))return[3,12];k.label=9;case 9:return k.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return B=k.sent(),this.renderReplacedElement(r,i,B),[3,12];case 11:return k.sent(),this.context.logger.error("Error loading svg ".concat(r.svg.substring(0,255))),[3,12];case 12:return r instanceof bg&&r.tree?(c=new e(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,c.render(r.tree)]):[3,14];case 13:u=k.sent(),r.width&&r.height&&this.ctx.drawImage(u,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),k.label=14;case 14:if(r instanceof Ru&&(l=Math.min(r.bounds.width,r.bounds.height),r.type===yo?r.checked&&(this.ctx.save(),this.path([new G(r.bounds.left+l*.39363,r.bounds.top+l*.79),new G(r.bounds.left+l*.16,r.bounds.top+l*.5549),new G(r.bounds.left+l*.27347,r.bounds.top+l*.44071),new G(r.bounds.left+l*.39694,r.bounds.top+l*.5649),new G(r.bounds.left+l*.72983,r.bounds.top+l*.23),new G(r.bounds.left+l*.84,r.bounds.top+l*.34085),new G(r.bounds.left+l*.39363,r.bounds.top+l*.79)]),this.ctx.fillStyle=pt(vg),this.ctx.fill(),this.ctx.restore()):r.type===wo&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+l/2,r.bounds.top+l/2,l/4,0,Math.PI*2,!0),this.ctx.fillStyle=pt(vg),this.ctx.fill(),this.ctx.restore())),hT(r)&&r.value.length){switch(d=this.createFontStyle(A),w=d[0],h=d[1],f=d[2],p=this.fontMetrics.getMetrics(h,f).baseline,this.ctx.font=w,this.ctx.fillStyle=pt(A.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=fT(r.styles.textAlign),_=Io(r),g=0,r.styles.textAlign){case 1:g+=_.width/2;break;case 2:g+=_.width;break}v=_.add(g,0,0,-_.height/2+1),this.ctx.save(),this.path([new G(_.left,_.top),new G(_.left+_.width,_.top),new G(_.left+_.width,_.top+_.height),new G(_.left,_.top+_.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new IA(r.value,v),A.letterSpacing,p),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ut(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(y=r.styles.listStyleImage,y.type!==0)return[3,18];B=void 0,b=y.url,k.label=15;case 15:return k.trys.push([15,17,,18]),[4,this.context.cache.match(b)];case 16:return B=k.sent(),this.ctx.drawImage(B,r.bounds.left-(B.width+10),r.bounds.top),[3,18];case 17:return k.sent(),this.context.logger.error("Error loading list-style-image ".concat(b)),[3,18];case 18:return[3,20];case 19:t.listValue&&r.styles.listStyleType!==-1&&(w=this.createFontStyle(A)[0],this.ctx.font=w,this.ctx.fillStyle=pt(A.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",_=new Rn(r.bounds.left,r.bounds.top+ke(r.styles.paddingTop,r.bounds.width),r.bounds.width,zf(A.lineHeight,A.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new IA(t.listValue,_),A.letterSpacing,zf(A.lineHeight,A.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),k.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return Tt(this,void 0,void 0,function(){var r,i,v,A,s,v,o,a,v,c,u,v,l,d,v,h,f,v,p,g,v;return Ct(this,function(y){switch(y.label){case 0:return ut(t.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:y.sent(),r=0,i=t.negativeZIndex,y.label=2;case 2:return r<i.length?(v=i[r],[4,this.renderStack(v)]):[3,5];case 3:y.sent(),y.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:y.sent(),A=0,s=t.nonInlineLevel,y.label=7;case 7:return A<s.length?(v=s[A],[4,this.renderNode(v)]):[3,10];case 8:y.sent(),y.label=9;case 9:return A++,[3,7];case 10:o=0,a=t.nonPositionedFloats,y.label=11;case 11:return o<a.length?(v=a[o],[4,this.renderStack(v)]):[3,14];case 12:y.sent(),y.label=13;case 13:return o++,[3,11];case 14:c=0,u=t.nonPositionedInlineLevel,y.label=15;case 15:return c<u.length?(v=u[c],[4,this.renderStack(v)]):[3,18];case 16:y.sent(),y.label=17;case 17:return c++,[3,15];case 18:l=0,d=t.inlineLevel,y.label=19;case 19:return l<d.length?(v=d[l],[4,this.renderNode(v)]):[3,22];case 20:y.sent(),y.label=21;case 21:return l++,[3,19];case 22:h=0,f=t.zeroOrAutoZIndexOrTransformedOrOpacity,y.label=23;case 23:return h<f.length?(v=f[h],[4,this.renderStack(v)]):[3,26];case 24:y.sent(),y.label=25;case 25:return h++,[3,23];case 26:p=0,g=t.positiveZIndex,y.label=27;case 27:return p<g.length?(v=g[p],[4,this.renderStack(v)]):[3,30];case 28:y.sent(),y.label=29;case 29:return p++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var r=this;t.forEach(function(i,A){var s=zt(i)?i.start:i;A===0?r.ctx.moveTo(s.x,s.y):r.ctx.lineTo(s.x,s.y),zt(i)&&r.ctx.bezierCurveTo(i.startControl.x,i.startControl.y,i.endControl.x,i.endControl.y,i.end.x,i.end.y)})},e.prototype.renderRepeat=function(t,r,i,A){this.path(t),this.ctx.fillStyle=r,this.ctx.translate(i,A),this.ctx.fill(),this.ctx.translate(-i,-A)},e.prototype.resizeImage=function(t,r,i){var A,s=(A=this.canvas.ownerDocument)!==null&&A!==void 0?A:document,o=s.createElement("canvas");o.width=Math.max(1,r),o.height=Math.max(1,i);var a=o.getContext("2d");return a.drawImage(t,0,0,t.width,t.height,0,0,r,i),o},e.prototype.renderBackgroundImage=function(t){return Tt(this,void 0,void 0,function(){var r,i,A,s,o,a;return Ct(this,function(c){switch(c.label){case 0:r=t.styles.backgroundImage.length-1,i=function(u){var l,d,h,f,p,Q,Y,ie,H,q,E,g,Q,Y,ie,H,q,v,y,B,b,w,_,k,F,x,E,T,Q,M,X,H,q,ve,Y,ie,Qe,qe,Be,ht,Re,Ne,ne,et;return Ct(this,function(Z){switch(Z.label){case 0:if(u.type!==0)return[3,5];l=void 0,d=u.url,Z.label=1;case 1:return Z.trys.push([1,3,,4]),[4,A.context.cache.match(d)];case 2:return l=Z.sent(),[3,4];case 3:return Z.sent(),A.context.logger.error("Error loading background-image ".concat(d)),[3,4];case 4:return l&&(h=isNaN(l.width)||l.width===0?1:l.width,f=isNaN(l.height)||l.height===0?1:l.height,p=Wu(t,r,[h,f,h/f]),Q=p[0],Y=p[1],ie=p[2],H=p[3],q=p[4],E=A.ctx.createPattern(A.resizeImage(l,H,q),"repeat"),A.renderRepeat(Q,E,Y,ie)),[3,6];case 5:zk(u)?(g=Wu(t,r,[null,null,null]),Q=g[0],Y=g[1],ie=g[2],H=g[3],q=g[4],v=Gk(u.angle,H,q),y=v[0],B=v[1],b=v[2],w=v[3],_=v[4],k=document.createElement("canvas"),k.width=H,k.height=q,F=k.getContext("2d"),x=F.createLinearGradient(B,w,b,_),Lf(u.stops,y||1).forEach(function(We){return x.addColorStop(We.stop,pt(We.color))}),F.fillStyle=x,F.fillRect(0,0,H,q),H>0&&q>0&&(E=A.ctx.createPattern(k,"repeat"),A.renderRepeat(Q,E,Y,ie))):Xk(u)&&(T=Wu(t,r,[null,null,null]),Q=T[0],M=T[1],X=T[2],H=T[3],q=T[4],ve=u.position.length===0?[hu]:u.position,Y=ke(ve[0],H),ie=ke(ve[ve.length-1],q),Qe=jk(u,Y,ie,H,q),qe=Qe[0],Be=Qe[1],qe>0&&Be>0&&(ht=A.ctx.createRadialGradient(M+Y,X+ie,0,M+Y,X+ie,qe),Lf(u.stops,qe*2).forEach(function(We){return ht.addColorStop(We.stop,pt(We.color))}),A.path(Q),A.ctx.fillStyle=ht,qe!==Be?(Re=t.bounds.left+.5*t.bounds.width,Ne=t.bounds.top+.5*t.bounds.height,ne=Be/qe,et=1/ne,A.ctx.save(),A.ctx.translate(Re,Ne),A.ctx.transform(1,0,0,ne,0,0),A.ctx.translate(-Re,-Ne),A.ctx.fillRect(M,et*(X-Ne)+Ne,H,q*et),A.ctx.restore()):A.ctx.fill())),Z.label=6;case 6:return r--,[2]}})},A=this,s=0,o=t.styles.backgroundImage.slice(0).reverse(),c.label=1;case 1:return s<o.length?(a=o[s],[5,i(a)]):[3,4];case 2:c.sent(),c.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,r,i){return Tt(this,void 0,void 0,function(){return Ct(this,function(A){return this.path(Wg(i,r)),this.ctx.fillStyle=pt(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,r,i,A){return Tt(this,void 0,void 0,function(){var s,o;return Ct(this,function(a){switch(a.label){case 0:return r<3?[4,this.renderSolidBorder(t,i,A)]:[3,2];case 1:return a.sent(),[2];case 2:return s=nT(A,i),this.path(s),this.ctx.fillStyle=pt(t),this.ctx.fill(),o=rT(A,i),this.path(o),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return Tt(this,void 0,void 0,function(){var r,i,A,s,o,a,c,u,l=this;return Ct(this,function(d){switch(d.label){case 0:return this.applyEffects(t.getEffects(2)),r=t.container.styles,i=!rr(r.backgroundColor)||r.backgroundImage.length,A=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],s=pT(Bi(r.backgroundClip,0),t.curves),i||r.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),rr(r.backgroundColor)||(this.ctx.fillStyle=pt(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:d.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(h){l.ctx.save();var f=ko(t.curves),p=h.inset?0:lT,g=eT(f,-p+(h.inset?1:-1)*h.spread.number,(h.inset?1:-1)*h.spread.number,h.spread.number*(h.inset?-2:2),h.spread.number*(h.inset?-2:2));h.inset?(l.path(f),l.ctx.clip(),l.mask(g)):(l.mask(f),l.ctx.clip(),l.path(g)),l.ctx.shadowOffsetX=h.offsetX.number+p,l.ctx.shadowOffsetY=h.offsetY.number,l.ctx.shadowColor=pt(h.color),l.ctx.shadowBlur=h.blur.number,l.ctx.fillStyle=h.inset?pt(h.color):"rgba(0,0,0,1)",l.ctx.fill(),l.ctx.restore()}),d.label=2;case 2:o=0,a=0,c=A,d.label=3;case 3:return a<c.length?(u=c[a],u.style!==0&&!rr(u.color)&&u.width>0?u.style!==2?[3,5]:[4,this.renderDashedDottedBorder(u.color,u.width,o,t.curves,2)]:[3,11]):[3,13];case 4:return d.sent(),[3,11];case 5:return u.style!==3?[3,7]:[4,this.renderDashedDottedBorder(u.color,u.width,o,t.curves,3)];case 6:return d.sent(),[3,11];case 7:return u.style!==4?[3,9]:[4,this.renderDoubleBorder(u.color,u.width,o,t.curves)];case 8:return d.sent(),[3,11];case 9:return[4,this.renderSolidBorder(u.color,o,t.curves)];case 10:d.sent(),d.label=11;case 11:o++,d.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,r,i,A,s){return Tt(this,void 0,void 0,function(){var o,a,c,u,l,d,h,f,p,g,v,y,B,b,w,_,w,_;return Ct(this,function(k){return this.ctx.save(),o=iT(A,i),a=Wg(A,i),s===2&&(this.path(a),this.ctx.clip()),zt(a[0])?(c=a[0].start.x,u=a[0].start.y):(c=a[0].x,u=a[0].y),zt(a[1])?(l=a[1].end.x,d=a[1].end.y):(l=a[1].x,d=a[1].y),i===0||i===2?h=Math.abs(c-l):h=Math.abs(u-d),this.ctx.beginPath(),s===3?this.formatPath(o):this.formatPath(a.slice(0,2)),f=r<3?r*3:r*2,p=r<3?r*2:r,s===3&&(f=r,p=r),g=!0,h<=f*2?g=!1:h<=f*2+p?(v=h/(2*f+p),f*=v,p*=v):(y=Math.floor((h+p)/(f+p)),B=(h-y*f)/(y-1),b=(h-(y+1)*f)/y,p=b<=0||Math.abs(p-B)<Math.abs(p-b)?B:b),g&&(s===3?this.ctx.setLineDash([0,f+p]):this.ctx.setLineDash([f,p])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=pt(t),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&(zt(a[0])&&(w=a[3],_=a[0],this.ctx.beginPath(),this.formatPath([new G(w.end.x,w.end.y),new G(_.start.x,_.start.y)]),this.ctx.stroke()),zt(a[1])&&(w=a[1],_=a[2],this.ctx.beginPath(),this.formatPath([new G(w.end.x,w.end.y),new G(_.start.x,_.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(t){return Tt(this,void 0,void 0,function(){var r;return Ct(this,function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=pt(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=tT(t),[4,this.renderStack(r)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}})})},e}(zg),hT=function(n){return n instanceof wg||n instanceof yg?!0:n instanceof Ru&&n.type!==wo&&n.type!==yo},pT=function(n,e){switch(n){case 0:return ko(e);case 2:return zU(e);case 1:default:return Eo(e)}},fT=function(n){switch(n){case 1:return"center";case 2:return"right";case 0:default:return"left"}},gT=["-apple-system","system-ui"],mT=function(n){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?n.filter(function(e){return gT.indexOf(e)===-1}):n},vT=function(n){nn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.canvas=r.canvas?r.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=r,i.canvas.width=Math.floor(r.width*r.scale),i.canvas.height=Math.floor(r.height*r.scale),i.canvas.style.width="".concat(r.width,"px"),i.canvas.style.height="".concat(r.height,"px"),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-r.x,-r.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized (".concat(r.width,"x").concat(r.height," at ").concat(r.x,",").concat(r.y,") with scale ").concat(r.scale)),i}return e.prototype.render=function(t){return Tt(this,void 0,void 0,function(){var r,i;return Ct(this,function(A){switch(A.label){case 0:return r=Fu(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,yT(r)];case 1:return i=A.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=pt(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e}(zg),yT=function(n){return new Promise(function(e,t){var r=new Image;r.onload=function(){e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(new XMLSerializer().serializeToString(n)))})},wT=function(){function n(e){var t=e.id,r=e.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return n.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console?(()=>{}).apply(console,xs([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},n.prototype.getTime=function(){return Date.now()-this.start},n.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,xs([this.id,"".concat(this.getTime(),"ms")],e,!1))},n.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,xs([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},n.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,xs([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},n.instances={},n}(),bT=function(){function n(e,t){var r;this.windowBounds=t,this.instanceName="#".concat(n.instanceCount++),this.logger=new wT({id:this.instanceName,enabled:e.logging}),this.cache=(r=e.cache)!==null&&r!==void 0?r:new HU(this,e)}return n.instanceCount=1,n}(),BT=function(n,e){return e===void 0&&(e={}),CT(n,e)};typeof window<"u"&&Ku.setContext(window);var CT=function(n,e){return Tt(void 0,void 0,void 0,function(){var t,r,i,A,s,o,a,c,u,l,d,h,f,p,g,v,y,B,b,w,k,_,k,F,x,E,T,Q,M,X,H,q,ve,Y,ie,Qe,qe,Be,ht,Re;return Ct(this,function(Ne){switch(Ne.label){case 0:if(!n||typeof n!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=n.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(r=t.defaultView,!r)throw new Error("Document is not attached to a Window");return i={allowTaint:(F=e.allowTaint)!==null&&F!==void 0?F:!1,imageTimeout:(x=e.imageTimeout)!==null&&x!==void 0?x:15e3,proxy:e.proxy,useCORS:(E=e.useCORS)!==null&&E!==void 0?E:!1,customIsSameOrigin:e.customIsSameOrigin},A=Wc({logging:(T=e.logging)!==null&&T!==void 0?T:!0,cache:e.cache},i),s={windowWidth:(Q=e.windowWidth)!==null&&Q!==void 0?Q:r.innerWidth,windowHeight:(M=e.windowHeight)!==null&&M!==void 0?M:r.innerHeight,scrollX:(X=e.scrollX)!==null&&X!==void 0?X:r.pageXOffset,scrollY:(H=e.scrollY)!==null&&H!==void 0?H:r.pageYOffset},o=new Rn(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),a=new bT(A,o),c=(q=e.foreignObjectRendering)!==null&&q!==void 0?q:!1,u={allowTaint:(ve=e.allowTaint)!==null&&ve!==void 0?ve:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:c,copyStyles:c},a.logger.debug("Starting document clone with size ".concat(o.width,"x").concat(o.height," scrolled to ").concat(-o.left,",").concat(-o.top)),l=new Dg(a,n,u),d=l.clonedReferenceElement,d?[4,l.toIFrame(t,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return h=Ne.sent(),f=Ou(d)||CU(d)?A_(d.ownerDocument):Qs(a,d),p=f.width,g=f.height,v=f.left,y=f.top,B=_T(a,d,e.backgroundColor),b={canvas:e.canvas,backgroundColor:B,scale:(ie=(Y=e.scale)!==null&&Y!==void 0?Y:r.devicePixelRatio)!==null&&ie!==void 0?ie:1,x:((Qe=e.x)!==null&&Qe!==void 0?Qe:0)+v,y:((qe=e.y)!==null&&qe!==void 0?qe:0)+y,width:(Be=e.width)!==null&&Be!==void 0?Be:Math.ceil(p),height:(ht=e.height)!==null&&ht!==void 0?ht:Math.ceil(g)},c?(a.logger.debug("Document cloned, using foreign object rendering"),k=new vT(a,b),[4,k.render(d)]):[3,3];case 2:return w=Ne.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at ".concat(v,",").concat(y," with size ").concat(p,"x").concat(g," using computed rendering")),a.logger.debug("Starting DOM parsing"),_=Cg(a,d),B===_.styles.backgroundColor&&(_.styles.backgroundColor=bn.TRANSPARENT),a.logger.debug("Starting renderer for element at ".concat(b.x,",").concat(b.y," with size ").concat(b.width,"x").concat(b.height)),k=new dT(a,b),[4,k.render(_)];case 4:w=Ne.sent(),Ne.label=5;case 5:return(!((Re=e.removeContainer)!==null&&Re!==void 0)||Re)&&(Dg.destroy(h)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,w]}})})},_T=function(n,e,t){var r=e.ownerDocument,i=r.documentElement?fi(n,getComputedStyle(r.documentElement).backgroundColor):bn.TRANSPARENT,A=r.body?fi(n,getComputedStyle(r.body).backgroundColor):bn.TRANSPARENT,s=typeof t=="string"?fi(n,t):t===null?bn.TRANSPARENT:4294967295;return e===r.documentElement?rr(i)?rr(A)?s:A:i:s};function ST(n,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if(r!=="default"&&!(r in n)){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(n)}var kT=Object.defineProperty,ET=(n,e,t)=>e in n?kT(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Xg=(n,e,t)=>ET(n,typeof e!="symbol"?e+"":e,t);let Mt=class{constructor(){Xg(this,"_locking"),Xg(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){this._locks+=1;let e;const t=new Promise(i=>e=()=>{this._locks-=1,i()}),r=this._locking.then(()=>e);return this._locking=this._locking.then(()=>t),r}};function Xe(n,e){if(!n)throw new Error(e)}const UT=34028234663852886e22,TT=-34028234663852886e22,IT=4294967295,FT=2147483647,xT=-2147483648;function xo(n){if(typeof n!="number")throw new Error("invalid int 32: "+typeof n);if(!Number.isInteger(n)||n>FT||n<xT)throw new Error("invalid int 32: "+n)}function qu(n){if(typeof n!="number")throw new Error("invalid uint 32: "+typeof n);if(!Number.isInteger(n)||n>IT||n<0)throw new Error("invalid uint 32: "+n)}function Yg(n){if(typeof n!="number")throw new Error("invalid float 32: "+typeof n);if(Number.isFinite(n)&&(n>UT||n<TT))throw new Error("invalid float 32: "+n)}const Zg=Symbol("@bufbuild/protobuf/enum-type");function QT(n){const e=n[Zg];return Xe(e,"missing enum type on enum object"),e}function $g(n,e,t,r){n[Zg]=em(e,t.map(i=>({no:i.no,name:i.name,localName:n[i.no]})))}function em(n,e,t){const r=Object.create(null),i=Object.create(null),A=[];for(const s of e){const o=tm(s);A.push(o),r[s.name]=o,i[s.no]=o}return{typeName:n,values:A,findName(s){return r[s]},findNumber(s){return i[s]}}}function RT(n,e,t){const r={};for(const i of e){const A=tm(i);r[A.localName]=A.no,r[A.no]=A.localName}return $g(r,n,e),r}function tm(n){return"localName"in n?n:Object.assign(Object.assign({},n),{localName:n.name})}class Ju{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,t){const r=this.getType(),i=r.runtime.bin,A=i.makeReadOptions(t);return i.readMessage(this,A.readerFactory(e),e.byteLength,A),this}fromJson(e,t){const r=this.getType(),i=r.runtime.json,A=i.makeReadOptions(t);return i.readMessage(r,e,A,this),this}fromJsonString(e,t){let r;try{r=JSON.parse(e)}catch(i){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(i instanceof Error?i.message:String(i)))}return this.fromJson(r,t)}toBinary(e){const t=this.getType(),r=t.runtime.bin,i=r.makeWriteOptions(e),A=i.writerFactory();return r.writeMessage(this,A,i),A.finish()}toJson(e){const t=this.getType(),r=t.runtime.json,i=r.makeWriteOptions(e);return r.writeMessage(this,i)}toJsonString(e){var t;const r=this.toJson(e);return JSON.stringify(r,null,(t=e==null?void 0:e.prettySpaces)!==null&&t!==void 0?t:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function PT(n,e,t,r){var i;const A=(i=r==null?void 0:r.localName)!==null&&i!==void 0?i:e.substring(e.lastIndexOf(".")+1),s={[A]:function(o){n.util.initFields(this),n.util.initPartial(o,this)}}[A];return Object.setPrototypeOf(s.prototype,new Ju),Object.assign(s,{runtime:n,typeName:e,fields:n.util.newFieldList(t),fromBinary(o,a){return new s().fromBinary(o,a)},fromJson(o,a){return new s().fromJson(o,a)},fromJsonString(o,a){return new s().fromJsonString(o,a)},equals(o,a){return n.util.equals(s,o,a)}}),s}function OT(){let n=0,e=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(n|=(i&127)<<r,!(i&128))return this.assertBounds(),[n,e]}let t=this.buf[this.pos++];if(n|=(t&15)<<28,e=(t&112)>>4,!(t&128))return this.assertBounds(),[n,e];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<r,!(i&128))return this.assertBounds(),[n,e]}throw new Error("invalid varint")}function zu(n,e,t){for(let A=0;A<28;A=A+7){const s=n>>>A,o=!(!(s>>>7)&&e==0),a=(o?s|128:s)&255;if(t.push(a),!o)return}const r=n>>>28&15|(e&7)<<4,i=!!(e>>3);if(t.push((i?r|128:r)&255),!!i){for(let A=3;A<31;A=A+7){const s=e>>>A,o=!!(s>>>7),a=(o?s|128:s)&255;if(t.push(a),!o)return}t.push(e>>>31&1)}}const Qo=4294967296;function nm(n){const e=n[0]==="-";e&&(n=n.slice(1));const t=1e6;let r=0,i=0;function A(s,o){const a=Number(n.slice(s,o));i*=t,r=r*t+a,r>=Qo&&(i=i+(r/Qo|0),r=r%Qo)}return A(-24,-18),A(-18,-12),A(-12,-6),A(-6),e?im(r,i):Xu(r,i)}function MT(n,e){let t=Xu(n,e);const r=t.hi&2147483648;r&&(t=im(t.lo,t.hi));const i=rm(t.lo,t.hi);return r?"-"+i:i}function rm(n,e){if({lo:n,hi:e}=LT(n,e),e<=2097151)return String(Qo*e+n);const t=n&16777215,r=(n>>>24|e<<8)&16777215,i=e>>16&65535;let A=t+r*6777216+i*6710656,s=r+i*8147497,o=i*2;const a=1e7;return A>=a&&(s+=Math.floor(A/a),A%=a),s>=a&&(o+=Math.floor(s/a),s%=a),o.toString()+Am(s)+Am(A)}function LT(n,e){return{lo:n>>>0,hi:e>>>0}}function Xu(n,e){return{lo:n|0,hi:e|0}}function im(n,e){return e=~e,n?n=~n+1:e+=1,Xu(n,e)}const Am=n=>{const e=String(n);return"0000000".slice(e.length)+e};function sm(n,e){if(n>=0){for(;n>127;)e.push(n&127|128),n=n>>>7;e.push(n)}else{for(let t=0;t<9;t++)e.push(n&127|128),n=n>>7;e.push(1)}}function DT(){let n=this.buf[this.pos++],e=n&127;if(!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<7,!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<14,!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<21,!(n&128))return this.assertBounds(),e;n=this.buf[this.pos++],e|=(n&15)<<28;for(let t=5;n&128&&t<10;t++)n=this.buf[this.pos++];if(n&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function NT(){const n=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof n.getBigInt64=="function"&&typeof n.getBigUint64=="function"&&typeof n.setBigInt64=="function"&&typeof n.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const i=BigInt("-9223372036854775808"),A=BigInt("9223372036854775807"),s=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){const c=typeof a=="bigint"?a:BigInt(a);if(c>A||c<i)throw new Error("int64 invalid: ".concat(a));return c},uParse(a){const c=typeof a=="bigint"?a:BigInt(a);if(c>o||c<s)throw new Error("uint64 invalid: ".concat(a));return c},enc(a){return n.setBigInt64(0,this.parse(a),!0),{lo:n.getInt32(0,!0),hi:n.getInt32(4,!0)}},uEnc(a){return n.setBigInt64(0,this.uParse(a),!0),{lo:n.getInt32(0,!0),hi:n.getInt32(4,!0)}},dec(a,c){return n.setInt32(0,a,!0),n.setInt32(4,c,!0),n.getBigInt64(0,!0)},uDec(a,c){return n.setInt32(0,a,!0),n.setInt32(4,c,!0),n.getBigUint64(0,!0)}}}const t=i=>Xe(/^-?[0-9]+$/.test(i),"int64 invalid: ".concat(i)),r=i=>Xe(/^[0-9]+$/.test(i),"uint64 invalid: ".concat(i));return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),t(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),r(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),t(i),nm(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),r(i),nm(i)},dec(i,A){return MT(i,A)},uDec(i,A){return rm(i,A)}}}const Ke=NT();var R;(function(n){n[n.DOUBLE=1]="DOUBLE",n[n.FLOAT=2]="FLOAT",n[n.INT64=3]="INT64",n[n.UINT64=4]="UINT64",n[n.INT32=5]="INT32",n[n.FIXED64=6]="FIXED64",n[n.FIXED32=7]="FIXED32",n[n.BOOL=8]="BOOL",n[n.STRING=9]="STRING",n[n.BYTES=12]="BYTES",n[n.UINT32=13]="UINT32",n[n.SFIXED32=15]="SFIXED32",n[n.SFIXED64=16]="SFIXED64",n[n.SINT32=17]="SINT32",n[n.SINT64=18]="SINT64"})(R||(R={}));var ar;(function(n){n[n.BIGINT=0]="BIGINT",n[n.STRING=1]="STRING"})(ar||(ar={}));function cr(n,e,t){if(e===t)return!0;if(n==R.BYTES){if(!(e instanceof Uint8Array)||!(t instanceof Uint8Array)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}switch(n){case R.UINT64:case R.FIXED64:case R.INT64:case R.SFIXED64:case R.SINT64:return e==t}return!1}function Ci(n,e){switch(n){case R.BOOL:return!1;case R.UINT64:case R.FIXED64:case R.INT64:case R.SFIXED64:case R.SINT64:return e==0?Ke.zero:"0";case R.DOUBLE:case R.FLOAT:return 0;case R.BYTES:return new Uint8Array(0);case R.STRING:return"";default:return 0}}function om(n,e){switch(n){case R.BOOL:return e===!1;case R.STRING:return e==="";case R.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}var rt;(function(n){n[n.Varint=0]="Varint",n[n.Bit64=1]="Bit64",n[n.LengthDelimited=2]="LengthDelimited",n[n.StartGroup=3]="StartGroup",n[n.EndGroup=4]="EndGroup",n[n.Bit32=5]="Bit32"})(rt||(rt={}));class HT{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i<this.chunks.length;i++)e+=this.chunks[i].length;let t=new Uint8Array(e),r=0;for(let i=0;i<this.chunks.length;i++)t.set(this.chunks[i],r),r+=this.chunks[i].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(qu(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return xo(e),sm(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){Yg(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){qu(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){xo(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return xo(e),e=(e<<1^e>>31)>>>0,sm(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),i=Ke.enc(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),i=Ke.uEnc(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(t)}int64(e){let t=Ke.enc(e);return zu(t.lo,t.hi,this.buf),this}sint64(e){let t=Ke.enc(e),r=t.hi>>31,i=t.lo<<1^r,A=(t.hi<<1|t.lo>>>31)^r;return zu(i,A,this.buf),this}uint64(e){let t=Ke.uEnc(e);return zu(t.lo,t.hi,this.buf),this}}class KT{constructor(e,t){this.varint64=OT,this.uint32=DT,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t??new TextDecoder}tag(){let e=this.uint32(),t=e>>>3,r=e&7;if(t<=0||r<0||r>5)throw new Error("illegal tag: field no "+t+" wire type "+r);return[t,r]}skip(e,t){let r=this.pos;switch(e){case rt.Varint:for(;this.buf[this.pos++]&128;);break;case rt.Bit64:this.pos+=4;case rt.Bit32:this.pos+=4;break;case rt.LengthDelimited:let i=this.uint32();this.pos+=i;break;case rt.StartGroup:for(;;){const[A,s]=this.tag();if(s===rt.EndGroup){if(t!==void 0&&A!==t)throw new Error("invalid end group tag");break}this.skip(s,A)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return Ke.dec(...this.varint64())}uint64(){return Ke.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),r=-(e&1);return e=(e>>>1|(t&1)<<31)^r,t=t>>>1^r,Ke.dec(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Ke.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Ke.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}}function VT(n,e,t,r){let i;return{typeName:e,extendee:t,get field(){if(!i){const A=typeof r=="function"?r():r;A.name=e.split(".").pop(),A.jsonName="[".concat(e,"]"),i=n.util.newFieldList([A]).list()[0]}return i},runtime:n}}function am(n){const e=n.field.localName,t=Object.create(null);return t[e]=GT(n),[t,()=>t[e]]}function GT(n){const e=n.field;if(e.repeated)return[];if(e.default!==void 0)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;case"scalar":return Ci(e.T,e.L);case"message":const t=e.T,r=new t;return t.fieldWrapper?t.fieldWrapper.unwrapField(r):r;case"map":throw"map fields are not allowed to be extensions"}}function jT(n,e){if(!e.repeated&&(e.kind=="enum"||e.kind=="scalar")){for(let t=n.length-1;t>=0;--t)if(n[t].no==e.no)return[n[t]];return[]}return n.filter(t=>t.no===e.no)}let Mn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ro=[];for(let n=0;n<Mn.length;n++)Ro[Mn[n].charCodeAt(0)]=n;Ro["-".charCodeAt(0)]=Mn.indexOf("+"),Ro["_".charCodeAt(0)]=Mn.indexOf("/");const cm={dec(n){let e=n.length*3/4;n[n.length-2]=="="?e-=2:n[n.length-1]=="="&&(e-=1);let t=new Uint8Array(e),r=0,i=0,A,s=0;for(let o=0;o<n.length;o++){if(A=Ro[n.charCodeAt(o)],A===void 0)switch(n[o]){case"=":i=0;case`
6
+ `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:s=A,i=1;break;case 1:t[r++]=s<<2|(A&48)>>4,s=A,i=2;break;case 2:t[r++]=(s&15)<<4|(A&60)>>2,s=A,i=3;break;case 3:t[r++]=(s&3)<<6|A,i=0;break}}if(i==1)throw Error("invalid base64 string.");return t.subarray(0,r)},enc(n){let e="",t=0,r,i=0;for(let A=0;A<n.length;A++)switch(r=n[A],t){case 0:e+=Mn[r>>2],i=(r&3)<<4,t=1;break;case 1:e+=Mn[i|r>>4],i=(r&15)<<2,t=2;break;case 2:e+=Mn[i|r>>6],e+=Mn[r&63],t=0;break}return t&&(e+=Mn[i],e+="=",t==1&&(e+="=")),e}};function WT(n,e,t){lm(e,n);const r=e.runtime.bin.makeReadOptions(t),i=jT(n.getType().runtime.bin.listUnknownFields(n),e.field),[A,s]=am(e);for(const o of i)e.runtime.bin.readField(A,r.readerFactory(o.data),e.field,o.wireType,r);return s()}function qT(n,e,t,r){lm(e,n);const i=e.runtime.bin.makeReadOptions(r),A=e.runtime.bin.makeWriteOptions(r);if(um(n,e)){const c=n.getType().runtime.bin.listUnknownFields(n).filter(u=>u.no!=e.field.no);n.getType().runtime.bin.discardUnknownFields(n);for(const u of c)n.getType().runtime.bin.onUnknownField(n,u.no,u.wireType,u.data)}const s=A.writerFactory();let o=e.field;!o.opt&&!o.repeated&&(o.kind=="enum"||o.kind=="scalar")&&(o=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(o,t,s,A);const a=i.readerFactory(s.finish());for(;a.pos<a.len;){const[c,u]=a.tag(),l=a.skip(u,c);n.getType().runtime.bin.onUnknownField(n,c,u,l)}}function um(n,e){const t=n.getType();return e.extendee.typeName===t.typeName&&!!t.runtime.bin.listUnknownFields(n).find(r=>r.no==e.field.no)}function lm(n,e){Xe(n.extendee.typeName==e.getType().typeName,"extension ".concat(n.typeName," can only be applied to message ").concat(n.extendee.typeName))}function dm(n,e){const t=n.localName;if(n.repeated)return e[t].length>0;if(n.oneof)return e[n.oneof.localName].case===t;switch(n.kind){case"enum":case"scalar":return n.opt||n.req?e[t]!==void 0:n.kind=="enum"?e[t]!==n.T.values[0].no:!om(n.T,e[t]);case"message":return e[t]!==void 0;case"map":return Object.keys(e[t]).length>0}}function hm(n,e){const t=n.localName,r=!n.opt&&!n.req;if(n.repeated)e[t]=[];else if(n.oneof)e[n.oneof.localName]={case:void 0};else switch(n.kind){case"map":e[t]={};break;case"enum":e[t]=r?n.T.values[0].no:void 0;break;case"scalar":e[t]=r?Ci(n.T,n.L):void 0;break;case"message":e[t]=void 0;break}}function Hr(n,e){if(n===null||typeof n!="object"||!Object.getOwnPropertyNames(Ju.prototype).every(r=>r in n&&typeof n[r]=="function"))return!1;const t=n.getType();return t===null||typeof t!="function"||!("typeName"in t)||typeof t.typeName!="string"?!1:e===void 0?!0:t.typeName==e.typeName}function pm(n,e){return Hr(e)||!n.fieldWrapper?e:n.fieldWrapper.wrapField(e)}R.DOUBLE,R.FLOAT,R.INT64,R.UINT64,R.INT32,R.UINT32,R.BOOL,R.STRING,R.BYTES;const fm={ignoreUnknownFields:!1},gm={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function JT(n){return n?Object.assign(Object.assign({},fm),n):fm}function zT(n){return n?Object.assign(Object.assign({},gm),n):gm}const Po=Symbol(),Oo=Symbol();function XT(){return{makeReadOptions:JT,makeWriteOptions:zT,readMessage(n,e,t,r){if(e==null||Array.isArray(e)||typeof e!="object")throw new Error("cannot decode message ".concat(n.typeName," from JSON: ").concat(Cn(e)));r=r??new n;const i=new Map,A=t.typeRegistry;for(const[s,o]of Object.entries(e)){const a=n.fields.findJsonName(s);if(a){if(a.oneof){if(o===null&&a.kind=="scalar")continue;const c=i.get(a.oneof);if(c!==void 0)throw new Error("cannot decode message ".concat(n.typeName,' from JSON: multiple keys for oneof "').concat(a.oneof.name,'" present: "').concat(c,'", "').concat(s,'"'));i.set(a.oneof,s)}mm(r,o,a,t,n)}else{let c=!1;if(A!=null&&A.findExtension&&s.startsWith("[")&&s.endsWith("]")){const u=A.findExtension(s.substring(1,s.length-1));if(u&&u.extendee.typeName==n.typeName){c=!0;const[l,d]=am(u);mm(l,o,u.field,t,u),qT(r,u,d(),t)}}if(!c&&!t.ignoreUnknownFields)throw new Error("cannot decode message ".concat(n.typeName,' from JSON: key "').concat(s,'" is unknown'))}}return r},writeMessage(n,e){const t=n.getType(),r={};let i;try{for(i of t.fields.byNumber()){if(!dm(i,n)){if(i.req)throw"required field not set";if(!e.emitDefaultValues||!ZT(i))continue}const s=i.oneof?n[i.oneof.localName].value:n[i.localName],o=vm(i,s,e);o!==void 0&&(r[e.useProtoFieldName?i.name:i.jsonName]=o)}const A=e.typeRegistry;if(A!=null&&A.findExtensionFor)for(const s of t.runtime.bin.listUnknownFields(n)){const o=A.findExtensionFor(t.typeName,s.no);if(o&&um(n,o)){const a=WT(n,o,e),c=vm(o.field,a,e);c!==void 0&&(r[o.field.jsonName]=c)}}}catch(A){const s=i?"cannot encode field ".concat(t.typeName,".").concat(i.name," to JSON"):"cannot encode message ".concat(t.typeName," to JSON"),o=A instanceof Error?A.message:String(A);throw new Error(s+(o.length>0?": ".concat(o):""))}return r},readScalar(n,e,t){return RA(n,e,t??ar.BIGINT,!0)},writeScalar(n,e,t){if(e!==void 0&&(t||om(n,e)))return Mo(n,e)},debug:Cn}}function Cn(n){if(n===null)return"null";switch(typeof n){case"object":return Array.isArray(n)?"array":"object";case"string":return n.length>100?"string":'"'.concat(n.split('"').join('\\"'),'"');default:return String(n)}}function mm(n,e,t,r,i){let A=t.localName;if(t.repeated){if(Xe(t.kind!="map"),e===null)return;if(!Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Cn(e)));const s=n[A];for(const o of e){if(o===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Cn(o)));switch(t.kind){case"message":s.push(t.T.fromJson(o,r));break;case"enum":const a=Yu(t.T,o,r.ignoreUnknownFields,!0);a!==Oo&&s.push(a);break;case"scalar":try{s.push(RA(t.T,o,t.L,!0))}catch(c){let u="cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Cn(o));throw c instanceof Error&&c.message.length>0&&(u+=": ".concat(c.message)),new Error(u)}break}}}else if(t.kind=="map"){if(e===null)return;if(typeof e!="object"||Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Cn(e)));const s=n[A];for(const[o,a]of Object.entries(e)){if(a===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: map value null"));let c;try{c=YT(t.K,o)}catch(u){let l="cannot decode map key for field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Cn(e));throw u instanceof Error&&u.message.length>0&&(l+=": ".concat(u.message)),new Error(l)}switch(t.V.kind){case"message":s[c]=t.V.T.fromJson(a,r);break;case"enum":const u=Yu(t.V.T,a,r.ignoreUnknownFields,!0);u!==Oo&&(s[c]=u);break;case"scalar":try{s[c]=RA(t.V.T,a,ar.BIGINT,!0)}catch(l){let d="cannot decode map value for field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Cn(e));throw l instanceof Error&&l.message.length>0&&(d+=": ".concat(l.message)),new Error(d)}break}}}else switch(t.oneof&&(n=n[t.oneof.localName]={case:A},A="value"),t.kind){case"message":const s=t.T;if(e===null&&s.typeName!="google.protobuf.Value")return;let o=n[A];Hr(o)?o.fromJson(e,r):(n[A]=o=s.fromJson(e,r),s.fieldWrapper&&!t.oneof&&(n[A]=s.fieldWrapper.unwrapField(o)));break;case"enum":const a=Yu(t.T,e,r.ignoreUnknownFields,!1);switch(a){case Po:hm(t,n);break;case Oo:break;default:n[A]=a;break}break;case"scalar":try{const c=RA(t.T,e,t.L,!1);switch(c){case Po:hm(t,n);break;default:n[A]=c;break}}catch(c){let u="cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Cn(e));throw c instanceof Error&&c.message.length>0&&(u+=": ".concat(c.message)),new Error(u)}break}}function YT(n,e){if(n===R.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return RA(n,e,ar.BIGINT,!0).toString()}function RA(n,e,t,r){if(e===null)return r?Ci(n,t):Po;switch(n){case R.DOUBLE:case R.FLOAT:if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""||typeof e=="string"&&e.trim().length!==e.length||typeof e!="string"&&typeof e!="number")break;const i=Number(e);if(Number.isNaN(i)||!Number.isFinite(i))break;return n==R.FLOAT&&Yg(i),i;case R.INT32:case R.FIXED32:case R.SFIXED32:case R.SINT32:case R.UINT32:let A;if(typeof e=="number"?A=e:typeof e=="string"&&e.length>0&&e.trim().length===e.length&&(A=Number(e)),A===void 0)break;return n==R.UINT32||n==R.FIXED32?qu(A):xo(A),A;case R.INT64:case R.SFIXED64:case R.SINT64:if(typeof e!="number"&&typeof e!="string")break;const s=Ke.parse(e);return t?s.toString():s;case R.FIXED64:case R.UINT64:if(typeof e!="number"&&typeof e!="string")break;const o=Ke.uParse(e);return t?o.toString():o;case R.BOOL:if(typeof e!="boolean")break;return e;case R.STRING:if(typeof e!="string")break;try{encodeURIComponent(e)}catch{throw new Error("invalid UTF8")}return e;case R.BYTES:if(e==="")return new Uint8Array(0);if(typeof e!="string")break;return cm.dec(e)}throw new Error}function Yu(n,e,t,r){if(e===null)return n.typeName=="google.protobuf.NullValue"?0:r?n.values[0].no:Po;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const i=n.findName(e);if(i!==void 0)return i.no;if(t)return Oo;break}throw new Error("cannot decode enum ".concat(n.typeName," from JSON: ").concat(Cn(e)))}function ZT(n){return n.repeated||n.kind=="map"?!0:!(n.oneof||n.kind=="message"||n.opt||n.req)}function vm(n,e,t){if(n.kind=="map"){Xe(typeof e=="object"&&e!=null);const r={},i=Object.entries(e);switch(n.V.kind){case"scalar":for(const[s,o]of i)r[s.toString()]=Mo(n.V.T,o);break;case"message":for(const[s,o]of i)r[s.toString()]=o.toJson(t);break;case"enum":const A=n.V.T;for(const[s,o]of i)r[s.toString()]=Zu(A,o,t.enumAsInteger);break}return t.emitDefaultValues||i.length>0?r:void 0}if(n.repeated){Xe(Array.isArray(e));const r=[];switch(n.kind){case"scalar":for(let i=0;i<e.length;i++)r.push(Mo(n.T,e[i]));break;case"enum":for(let i=0;i<e.length;i++)r.push(Zu(n.T,e[i],t.enumAsInteger));break;case"message":for(let i=0;i<e.length;i++)r.push(e[i].toJson(t));break}return t.emitDefaultValues||r.length>0?r:void 0}switch(n.kind){case"scalar":return Mo(n.T,e);case"enum":return Zu(n.T,e,t.enumAsInteger);case"message":return pm(n.T,e).toJson(t)}}function Zu(n,e,t){var r;if(Xe(typeof e=="number"),n.typeName=="google.protobuf.NullValue")return null;if(t)return e;const i=n.findNumber(e);return(r=i==null?void 0:i.name)!==null&&r!==void 0?r:e}function Mo(n,e){switch(n){case R.INT32:case R.SFIXED32:case R.SINT32:case R.FIXED32:case R.UINT32:return Xe(typeof e=="number"),e;case R.FLOAT:case R.DOUBLE:return Xe(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case R.STRING:return Xe(typeof e=="string"),e;case R.BOOL:return Xe(typeof e=="boolean"),e;case R.UINT64:case R.FIXED64:case R.INT64:case R.SFIXED64:case R.SINT64:return Xe(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case R.BYTES:return Xe(e instanceof Uint8Array),cm.enc(e)}}const _i=Symbol("@bufbuild/protobuf/unknown-fields"),ym={readUnknownFields:!0,readerFactory:n=>new KT(n)},wm={writeUnknownFields:!0,writerFactory:()=>new HT};function $T(n){return n?Object.assign(Object.assign({},ym),n):ym}function eI(n){return n?Object.assign(Object.assign({},wm),n):wm}function tI(){return{makeReadOptions:$T,makeWriteOptions:eI,listUnknownFields(n){var e;return(e=n[_i])!==null&&e!==void 0?e:[]},discardUnknownFields(n){delete n[_i]},writeUnknownFields(n,e){const r=n[_i];if(r)for(const i of r)e.tag(i.no,i.wireType).raw(i.data)},onUnknownField(n,e,t,r){const i=n;Array.isArray(i[_i])||(i[_i]=[]),i[_i].push({no:e,wireType:t,data:r})},readMessage(n,e,t,r,i){const A=n.getType(),s=i?e.len:e.pos+t;let o,a;for(;e.pos<s&&([o,a]=e.tag(),!(i===!0&&a==rt.EndGroup));){const c=A.fields.find(o);if(!c){const u=e.skip(a,o);r.readUnknownFields&&this.onUnknownField(n,o,a,u);continue}bm(n,e,c,a,r)}if(i&&(a!=rt.EndGroup||o!==t))throw new Error("invalid end group tag")},readField:bm,writeMessage(n,e,t){const r=n.getType();for(const i of r.fields.byNumber()){if(!dm(i,n)){if(i.req)throw new Error("cannot encode field ".concat(r.typeName,".").concat(i.name," to binary: required field not set"));continue}const A=i.oneof?n[i.oneof.localName].value:n[i.localName];Bm(i,A,e,t)}return t.writeUnknownFields&&this.writeUnknownFields(n,e),e},writeField(n,e,t,r){e!==void 0&&Bm(n,e,t,r)}}}function bm(n,e,t,r,i){let{repeated:A,localName:s}=t;switch(t.oneof&&(n=n[t.oneof.localName],n.case!=s&&delete n.value,n.case=s,s="value"),t.kind){case"scalar":case"enum":const o=t.kind=="enum"?R.INT32:t.T;let a=Do;if(t.kind=="scalar"&&t.L>0&&(a=rI),A){let d=n[s];if(r==rt.LengthDelimited&&o!=R.STRING&&o!=R.BYTES){let f=e.uint32()+e.pos;for(;e.pos<f;)d.push(a(e,o))}else d.push(a(e,o))}else n[s]=a(e,o);break;case"message":const c=t.T;A?n[s].push(Lo(e,new c,i,t)):Hr(n[s])?Lo(e,n[s],i,t):(n[s]=Lo(e,new c,i,t),c.fieldWrapper&&!t.oneof&&!t.repeated&&(n[s]=c.fieldWrapper.unwrapField(n[s])));break;case"map":let[u,l]=nI(t,e,i);n[s][u]=l;break}}function Lo(n,e,t,r){const i=e.getType().runtime.bin,A=r==null?void 0:r.delimited;return i.readMessage(e,n,A?r.no:n.uint32(),t,A),e}function nI(n,e,t){const r=e.uint32(),i=e.pos+r;let A,s;for(;e.pos<i;){const[o]=e.tag();switch(o){case 1:A=Do(e,n.K);break;case 2:switch(n.V.kind){case"scalar":s=Do(e,n.V.T);break;case"enum":s=e.int32();break;case"message":s=Lo(e,new n.V.T,t,void 0);break}break}}if(A===void 0&&(A=Ci(n.K,ar.BIGINT)),typeof A!="string"&&typeof A!="number"&&(A=A.toString()),s===void 0)switch(n.V.kind){case"scalar":s=Ci(n.V.T,ar.BIGINT);break;case"enum":s=n.V.T.values[0].no;break;case"message":s=new n.V.T;break}return[A,s]}function rI(n,e){const t=Do(n,e);return typeof t=="bigint"?t.toString():t}function Do(n,e){switch(e){case R.STRING:return n.string();case R.BOOL:return n.bool();case R.DOUBLE:return n.double();case R.FLOAT:return n.float();case R.INT32:return n.int32();case R.INT64:return n.int64();case R.UINT64:return n.uint64();case R.FIXED64:return n.fixed64();case R.BYTES:return n.bytes();case R.FIXED32:return n.fixed32();case R.SFIXED32:return n.sfixed32();case R.SFIXED64:return n.sfixed64();case R.SINT64:return n.sint64();case R.UINT32:return n.uint32();case R.SINT32:return n.sint32()}}function Bm(n,e,t,r){Xe(e!==void 0);const i=n.repeated;switch(n.kind){case"scalar":case"enum":let A=n.kind=="enum"?R.INT32:n.T;if(i)if(Xe(Array.isArray(e)),n.packed)AI(t,A,n.no,e);else for(const s of e)PA(t,A,n.no,s);else PA(t,A,n.no,e);break;case"message":if(i){Xe(Array.isArray(e));for(const s of e)Cm(t,r,n,s)}else Cm(t,r,n,e);break;case"map":Xe(typeof e=="object"&&e!=null);for(const[s,o]of Object.entries(e))iI(t,r,n,s,o);break}}function iI(n,e,t,r,i){n.tag(t.no,rt.LengthDelimited),n.fork();let A=r;switch(t.K){case R.INT32:case R.FIXED32:case R.UINT32:case R.SFIXED32:case R.SINT32:A=Number.parseInt(r);break;case R.BOOL:Xe(r=="true"||r=="false"),A=r=="true";break}switch(PA(n,t.K,1,A),t.V.kind){case"scalar":PA(n,t.V.T,2,i);break;case"enum":PA(n,R.INT32,2,i);break;case"message":Xe(i!==void 0),n.tag(2,rt.LengthDelimited).bytes(i.toBinary(e));break}n.join()}function Cm(n,e,t,r){const i=pm(t.T,r);t.delimited?n.tag(t.no,rt.StartGroup).raw(i.toBinary(e)).tag(t.no,rt.EndGroup):n.tag(t.no,rt.LengthDelimited).bytes(i.toBinary(e))}function PA(n,e,t,r){Xe(r!==void 0);let[i,A]=_m(e);n.tag(t,i)[A](r)}function AI(n,e,t,r){if(!r.length)return;n.tag(t,rt.LengthDelimited).fork();let[,i]=_m(e);for(let A=0;A<r.length;A++)n[i](r[A]);n.join()}function _m(n){let e=rt.Varint;switch(n){case R.BYTES:case R.STRING:e=rt.LengthDelimited;break;case R.DOUBLE:case R.FIXED64:case R.SFIXED64:e=rt.Bit64;break;case R.FIXED32:case R.SFIXED32:case R.FLOAT:e=rt.Bit32;break}const t=R[n].toLowerCase();return[e,t]}function sI(){return{setEnumType:$g,initPartial(n,e){if(n===void 0)return;const t=e.getType();for(const r of t.fields.byMember()){const i=r.localName,A=e,s=n;if(s[i]!=null)switch(r.kind){case"oneof":const o=s[i].case;if(o===void 0)continue;const a=r.findField(o);let c=s[i].value;a&&a.kind=="message"&&!Hr(c,a.T)?c=new a.T(c):a&&a.kind==="scalar"&&a.T===R.BYTES&&(c=OA(c)),A[i]={case:o,value:c};break;case"scalar":case"enum":let u=s[i];r.T===R.BYTES&&(u=r.repeated?u.map(OA):OA(u)),A[i]=u;break;case"map":switch(r.V.kind){case"scalar":case"enum":if(r.V.T===R.BYTES)for(const[h,f]of Object.entries(s[i]))A[i][h]=OA(f);else Object.assign(A[i],s[i]);break;case"message":const d=r.V.T;for(const h of Object.keys(s[i])){let f=s[i][h];d.fieldWrapper||(f=new d(f)),A[i][h]=f}break}break;case"message":const l=r.T;if(r.repeated)A[i]=s[i].map(d=>Hr(d,l)?d:new l(d));else{const d=s[i];l.fieldWrapper?l.typeName==="google.protobuf.BytesValue"?A[i]=OA(d):A[i]=d:A[i]=Hr(d,l)?d:new l(d)}break}}},equals(n,e,t){return e===t?!0:!e||!t?!1:n.fields.byMember().every(r=>{const i=e[r.localName],A=t[r.localName];if(r.repeated){if(i.length!==A.length)return!1;switch(r.kind){case"message":return i.every((s,o)=>r.T.equals(s,A[o]));case"scalar":return i.every((s,o)=>cr(r.T,s,A[o]));case"enum":return i.every((s,o)=>cr(R.INT32,s,A[o]))}throw new Error("repeated cannot contain ".concat(r.kind))}switch(r.kind){case"message":return r.T.equals(i,A);case"enum":return cr(R.INT32,i,A);case"scalar":return cr(r.T,i,A);case"oneof":if(i.case!==A.case)return!1;const s=r.findField(i.case);if(s===void 0)return!0;switch(s.kind){case"message":return s.T.equals(i.value,A.value);case"enum":return cr(R.INT32,i.value,A.value);case"scalar":return cr(s.T,i.value,A.value)}throw new Error("oneof cannot contain ".concat(s.kind));case"map":const o=Object.keys(i).concat(Object.keys(A));switch(r.V.kind){case"message":const a=r.V.T;return o.every(u=>a.equals(i[u],A[u]));case"enum":return o.every(u=>cr(R.INT32,i[u],A[u]));case"scalar":const c=r.V.T;return o.every(u=>cr(c,i[u],A[u]))}break}})},clone(n){const e=n.getType(),t=new e,r=t;for(const i of e.fields.byMember()){const A=n[i.localName];let s;if(i.repeated)s=A.map(No);else if(i.kind=="map"){s=r[i.localName];for(const[o,a]of Object.entries(A))s[o]=No(a)}else i.kind=="oneof"?s=i.findField(A.case)?{case:A.case,value:No(A.value)}:{case:void 0}:s=No(A);r[i.localName]=s}for(const i of e.runtime.bin.listUnknownFields(n))e.runtime.bin.onUnknownField(r,i.no,i.wireType,i.data);return t}}}function No(n){if(n===void 0)return n;if(Hr(n))return n.clone();if(n instanceof Uint8Array){const e=new Uint8Array(n.byteLength);return e.set(n),e}return n}function OA(n){return n instanceof Uint8Array?n:new Uint8Array(n)}function oI(n,e,t){return{syntax:n,json:XT(),bin:tI(),util:Object.assign(Object.assign({},sI()),{newFieldList:e,initFields:t}),makeMessageType(r,i,A){return PT(this,r,i,A)},makeEnum:RT,makeEnumType:em,getEnumType:QT,makeExtension(r,i,A){return VT(this,r,i,A)}}}class aI{constructor(e,t){this._fields=e,this._normalizer=t}findJsonName(e){if(!this.jsonNames){const t={};for(const r of this.list())t[r.jsonName]=t[r.name]=r;this.jsonNames=t}return this.jsonNames[e]}find(e){if(!this.numbers){const t={};for(const r of this.list())t[r.no]=r;this.numbers=t}return this.numbers[e]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((e,t)=>e.no-t.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const e=this.members;let t;for(const r of this.list())r.oneof?r.oneof!==t&&(t=r.oneof,e.push(t)):e.push(r)}return this.members}}function Sm(n,e){const t=km(n);return e?t:pI(hI(t))}function cI(n){return Sm(n,!1)}const uI=km;function km(n){let e=!1;const t=[];for(let r=0;r<n.length;r++){let i=n.charAt(r);switch(i){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":t.push(i),e=!1;break;default:e&&(e=!1,i=i.toUpperCase()),t.push(i);break}}return t.join("")}const lI=new Set(["constructor","toString","toJSON","valueOf"]),dI=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),Em=n=>"".concat(n,"$"),hI=n=>dI.has(n)?Em(n):n,pI=n=>lI.has(n)?Em(n):n;class fI{constructor(e){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=cI(e)}addField(e){Xe(e.oneof===this,"field ".concat(e.name," not one of ").concat(this.name)),this.fields.push(e)}findField(e){if(!this._lookup){this._lookup=Object.create(null);for(let t=0;t<this.fields.length;t++)this._lookup[this.fields[t].localName]=this.fields[t]}return this._lookup[e]}}function gI(n,e){var t,r,i,A,s,o;const a=[];let c;for(const u of typeof n=="function"?n():n){const l=u;if(l.localName=Sm(u.name,u.oneof!==void 0),l.jsonName=(t=u.jsonName)!==null&&t!==void 0?t:uI(u.name),l.repeated=(r=u.repeated)!==null&&r!==void 0?r:!1,u.kind=="scalar"&&(l.L=(i=u.L)!==null&&i!==void 0?i:ar.BIGINT),l.delimited=(A=u.delimited)!==null&&A!==void 0?A:!1,l.req=(s=u.req)!==null&&s!==void 0?s:!1,l.opt=(o=u.opt)!==null&&o!==void 0?o:!1,u.packed===void 0&&(l.packed=u.kind=="enum"||u.kind=="scalar"&&u.T!=R.BYTES&&u.T!=R.STRING),u.oneof!==void 0){const d=typeof u.oneof=="string"?u.oneof:u.oneof.name;(!c||c.name!=d)&&(c=new fI(d)),l.oneof=c,c.addField(l)}a.push(l)}return a}const I=oI("proto3",n=>new aI(n,e=>gI(e)),n=>{for(const e of n.getType().fields.byMember()){if(e.opt)continue;const t=e.localName,r=n;if(e.repeated){r[t]=[];continue}switch(e.kind){case"oneof":r[t]={case:void 0};break;case"enum":r[t]=0;break;case"map":r[t]={};break;case"scalar":r[t]=Ci(e.T,e.L);break}}});class Lt extends Ju{constructor(e){super(),this.seconds=Ke.zero,this.nanos=0,I.util.initPartial(e,this)}fromJson(e,t){if(typeof e!="string")throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(I.json.debug(e)));const r=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const i=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(i))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=Ke.parse(i/1e3),this.nanos=0,r[7]&&(this.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),this}toJson(e){const t=Number(this.seconds)*1e3;if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let r="Z";if(this.nanos>0){const i=(this.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?r="."+i.substring(0,3)+"Z":i.substring(6)==="000"?r="."+i.substring(0,6)+"Z":r="."+i+"Z"}return new Date(t).toISOString().replace(".000Z",r)}toDate(){return new Date(Number(this.seconds)*1e3+Math.ceil(this.nanos/1e6))}static now(){return Lt.fromDate(new Date)}static fromDate(e){const t=e.getTime();return new Lt({seconds:Ke.parse(Math.floor(t/1e3)),nanos:t%1e3*1e6})}static fromBinary(e,t){return new Lt().fromBinary(e,t)}static fromJson(e,t){return new Lt().fromJson(e,t)}static fromJsonString(e,t){return new Lt().fromJsonString(e,t)}static equals(e,t){return I.util.equals(Lt,e,t)}}Lt.runtime=I,Lt.typeName="google.protobuf.Timestamp",Lt.fields=I.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);const mI=I.makeMessageType("livekit.MetricsBatch",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Lt},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:vI,repeated:!0},{no:5,name:"events",kind:"message",T:wI,repeated:!0}]),vI=I.makeMessageType("livekit.TimeSeriesMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"samples",kind:"message",T:yI,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}]),yI=I.makeMessageType("livekit.MetricSample",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Lt},{no:3,name:"value",kind:"scalar",T:2}]),wI=I.makeMessageType("livekit.EventMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"start_timestamp_ms",kind:"scalar",T:3},{no:5,name:"end_timestamp_ms",kind:"scalar",T:3,opt:!0},{no:6,name:"normalized_start_timestamp",kind:"message",T:Lt},{no:7,name:"normalized_end_timestamp",kind:"message",T:Lt,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}]),Um=I.makeEnum("livekit.BackupCodecPolicy",[{no:0,name:"PREFER_REGRESSION"},{no:1,name:"SIMULCAST"},{no:2,name:"REGRESSION"}]),An=I.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),at=I.makeEnum("livekit.TrackSource",[{no:0,name:"UNKNOWN"},{no:1,name:"CAMERA"},{no:2,name:"MICROPHONE"},{no:3,name:"SCREEN_SHARE"},{no:4,name:"SCREEN_SHARE_AUDIO"}]),Si=I.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),MA=I.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),LA=I.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),sn=I.makeEnum("livekit.DisconnectReason",[{no:0,name:"UNKNOWN_REASON"},{no:1,name:"CLIENT_INITIATED"},{no:2,name:"DUPLICATE_IDENTITY"},{no:3,name:"SERVER_SHUTDOWN"},{no:4,name:"PARTICIPANT_REMOVED"},{no:5,name:"ROOM_DELETED"},{no:6,name:"STATE_MISMATCH"},{no:7,name:"JOIN_FAILURE"},{no:8,name:"MIGRATION"},{no:9,name:"SIGNAL_CLOSE"},{no:10,name:"ROOM_CLOSED"},{no:11,name:"USER_UNAVAILABLE"},{no:12,name:"USER_REJECTED"},{no:13,name:"SIP_TRUNK_FAILURE"},{no:14,name:"CONNECTION_TIMEOUT"}]),ki=I.makeEnum("livekit.ReconnectReason",[{no:0,name:"RR_UNKNOWN"},{no:1,name:"RR_SIGNAL_DISCONNECTED"},{no:2,name:"RR_PUBLISHER_FAILED"},{no:3,name:"RR_SUBSCRIBER_FAILED"},{no:4,name:"RR_SWITCH_CANDIDATE"}]),bI=I.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),on=I.makeEnum("livekit.AudioTrackFeature",[{no:0,name:"TF_STEREO"},{no:1,name:"TF_NO_DTX"},{no:2,name:"TF_AUTO_GAIN_CONTROL"},{no:3,name:"TF_ECHO_CANCELLATION"},{no:4,name:"TF_NOISE_SUPPRESSION"},{no:5,name:"TF_ENHANCED_NOISE_CANCELLATION"},{no:6,name:"TF_PRECONNECT_BUFFER"}]),Ho=I.makeMessageType("livekit.Room",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"empty_timeout",kind:"scalar",T:13},{no:14,name:"departure_timeout",kind:"scalar",T:13},{no:4,name:"max_participants",kind:"scalar",T:13},{no:5,name:"creation_time",kind:"scalar",T:3},{no:15,name:"creation_time_ms",kind:"scalar",T:3},{no:6,name:"turn_password",kind:"scalar",T:9},{no:7,name:"enabled_codecs",kind:"message",T:Ko,repeated:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"num_participants",kind:"scalar",T:13},{no:11,name:"num_publishers",kind:"scalar",T:13},{no:10,name:"active_recording",kind:"scalar",T:8},{no:13,name:"version",kind:"message",T:Hm}]),Ko=I.makeMessageType("livekit.Codec",()=>[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}]),BI=I.makeMessageType("livekit.ParticipantPermission",()=>[{no:1,name:"can_subscribe",kind:"scalar",T:8},{no:2,name:"can_publish",kind:"scalar",T:8},{no:3,name:"can_publish_data",kind:"scalar",T:8},{no:9,name:"can_publish_sources",kind:"enum",T:I.getEnumType(at),repeated:!0},{no:7,name:"hidden",kind:"scalar",T:8},{no:8,name:"recorder",kind:"scalar",T:8},{no:10,name:"can_update_metadata",kind:"scalar",T:8},{no:11,name:"agent",kind:"scalar",T:8},{no:12,name:"can_subscribe_metrics",kind:"scalar",T:8}]),Kr=I.makeMessageType("livekit.ParticipantInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"identity",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:I.getEnumType(Ei)},{no:4,name:"tracks",kind:"message",T:Ui,repeated:!0},{no:5,name:"metadata",kind:"scalar",T:9},{no:6,name:"joined_at",kind:"scalar",T:3},{no:17,name:"joined_at_ms",kind:"scalar",T:3},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"version",kind:"scalar",T:13},{no:11,name:"permission",kind:"message",T:BI},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:I.getEnumType(Vo)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:I.getEnumType(sn)},{no:18,name:"kind_details",kind:"enum",T:I.getEnumType(CI),repeated:!0}]),Ei=I.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),Vo=I.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"}]),CI=I.makeEnum("livekit.ParticipantInfo.KindDetail",[{no:0,name:"CLOUD_AGENT"},{no:1,name:"FORWARDED"}]),Wt=I.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),_I=I.makeMessageType("livekit.SimulcastCodecInfo",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"mid",kind:"scalar",T:9},{no:3,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:Vr,repeated:!0}]),Ui=I.makeMessageType("livekit.TrackInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:I.getEnumType(An)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"muted",kind:"scalar",T:8},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"simulcast",kind:"scalar",T:8},{no:8,name:"disable_dtx",kind:"scalar",T:8},{no:9,name:"source",kind:"enum",T:I.getEnumType(at)},{no:10,name:"layers",kind:"message",T:Vr,repeated:!0},{no:11,name:"mime_type",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:9},{no:13,name:"codecs",kind:"message",T:_I,repeated:!0},{no:14,name:"stereo",kind:"scalar",T:8},{no:15,name:"disable_red",kind:"scalar",T:8},{no:16,name:"encryption",kind:"enum",T:I.getEnumType(Wt)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:Hm},{no:19,name:"audio_features",kind:"enum",T:I.getEnumType(on),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:I.getEnumType(Um)}]),Vr=I.makeMessageType("livekit.VideoLayer",()=>[{no:1,name:"quality",kind:"enum",T:I.getEnumType(Si)},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13},{no:4,name:"bitrate",kind:"scalar",T:13},{no:5,name:"ssrc",kind:"scalar",T:13}]),Dt=I.makeMessageType("livekit.DataPacket",()=>[{no:1,name:"kind",kind:"enum",T:I.getEnumType(pe)},{no:4,name:"participant_identity",kind:"scalar",T:9},{no:5,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:2,name:"user",kind:"message",T:Im,oneof:"value"},{no:3,name:"speaker",kind:"message",T:SI,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:Fm,oneof:"value"},{no:7,name:"transcription",kind:"message",T:kI,oneof:"value"},{no:8,name:"metrics",kind:"message",T:mI,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:$u,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:xm,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:Qm,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:Rm,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:tl,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:nl,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:rl,oneof:"value"}]),pe=I.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),SI=I.makeMessageType("livekit.ActiveSpeakerUpdate",()=>[{no:1,name:"speakers",kind:"message",T:Tm,repeated:!0}]),Tm=I.makeMessageType("livekit.SpeakerInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:2},{no:3,name:"active",kind:"scalar",T:8}]),Im=I.makeMessageType("livekit.UserPacket",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:5,name:"participant_identity",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"destination_sids",kind:"scalar",T:9,repeated:!0},{no:6,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:4,name:"topic",kind:"scalar",T:9,opt:!0},{no:8,name:"id",kind:"scalar",T:9,opt:!0},{no:9,name:"start_time",kind:"scalar",T:4,opt:!0},{no:10,name:"end_time",kind:"scalar",T:4,opt:!0},{no:11,name:"nonce",kind:"scalar",T:12}]),Fm=I.makeMessageType("livekit.SipDTMF",()=>[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}]),kI=I.makeMessageType("livekit.Transcription",()=>[{no:2,name:"transcribed_participant_identity",kind:"scalar",T:9},{no:3,name:"track_id",kind:"scalar",T:9},{no:4,name:"segments",kind:"message",T:EI,repeated:!0}]),EI=I.makeMessageType("livekit.TranscriptionSegment",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:4},{no:4,name:"end_time",kind:"scalar",T:4},{no:5,name:"final",kind:"scalar",T:8},{no:6,name:"language",kind:"scalar",T:9}]),$u=I.makeMessageType("livekit.ChatMessage",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"edit_timestamp",kind:"scalar",T:3,opt:!0},{no:4,name:"message",kind:"scalar",T:9},{no:5,name:"deleted",kind:"scalar",T:8},{no:6,name:"generated",kind:"scalar",T:8}]),xm=I.makeMessageType("livekit.RpcRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"payload",kind:"scalar",T:9},{no:4,name:"response_timeout_ms",kind:"scalar",T:13},{no:5,name:"version",kind:"scalar",T:13}]),Qm=I.makeMessageType("livekit.RpcAck",()=>[{no:1,name:"request_id",kind:"scalar",T:9}]),Rm=I.makeMessageType("livekit.RpcResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9,oneof:"value"},{no:3,name:"error",kind:"message",T:Pm,oneof:"value"}]),Pm=I.makeMessageType("livekit.RpcError",()=>[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"scalar",T:9}]),Om=I.makeMessageType("livekit.ParticipantTracks",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}]),UI=I.makeMessageType("livekit.ServerInfo",()=>[{no:1,name:"edition",kind:"enum",T:I.getEnumType(Mm)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"region",kind:"scalar",T:9},{no:5,name:"node_id",kind:"scalar",T:9},{no:6,name:"debug_info",kind:"scalar",T:9},{no:7,name:"agent_protocol",kind:"scalar",T:5}]),Mm=I.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),TI=I.makeMessageType("livekit.ClientInfo",()=>[{no:1,name:"sdk",kind:"enum",T:I.getEnumType(Lm)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"os",kind:"scalar",T:9},{no:5,name:"os_version",kind:"scalar",T:9},{no:6,name:"device_model",kind:"scalar",T:9},{no:7,name:"browser",kind:"scalar",T:9},{no:8,name:"browser_version",kind:"scalar",T:9},{no:9,name:"address",kind:"scalar",T:9},{no:10,name:"network",kind:"scalar",T:9},{no:11,name:"other_sdks",kind:"scalar",T:9}]),Lm=I.makeEnum("livekit.ClientInfo.SDK",[{no:0,name:"UNKNOWN"},{no:1,name:"JS"},{no:2,name:"SWIFT"},{no:3,name:"ANDROID"},{no:4,name:"FLUTTER"},{no:5,name:"GO"},{no:6,name:"UNITY"},{no:7,name:"REACT_NATIVE"},{no:8,name:"RUST"},{no:9,name:"PYTHON"},{no:10,name:"CPP"},{no:11,name:"UNITY_WEB"},{no:12,name:"NODE"},{no:13,name:"UNREAL"}]),Dm=I.makeMessageType("livekit.ClientConfiguration",()=>[{no:1,name:"video",kind:"message",T:Nm},{no:2,name:"screen",kind:"message",T:Nm},{no:3,name:"resume_connection",kind:"enum",T:I.getEnumType(LA)},{no:4,name:"disabled_codecs",kind:"message",T:II},{no:5,name:"force_relay",kind:"enum",T:I.getEnumType(LA)}]),Nm=I.makeMessageType("livekit.VideoConfiguration",()=>[{no:1,name:"hardware_encoder",kind:"enum",T:I.getEnumType(LA)}]),II=I.makeMessageType("livekit.DisabledCodecs",()=>[{no:1,name:"codecs",kind:"message",T:Ko,repeated:!0},{no:2,name:"publish",kind:"message",T:Ko,repeated:!0}]),Hm=I.makeMessageType("livekit.TimedVersion",()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]),el=I.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),Km=I.makeMessageType("livekit.DataStream.TextHeader",()=>[{no:1,name:"operation_type",kind:"enum",T:I.getEnumType(el)},{no:2,name:"version",kind:"scalar",T:5},{no:3,name:"reply_to_stream_id",kind:"scalar",T:9},{no:4,name:"attached_stream_ids",kind:"scalar",T:9,repeated:!0},{no:5,name:"generated",kind:"scalar",T:8}],{localName:"DataStream_TextHeader"}),Vm=I.makeMessageType("livekit.DataStream.ByteHeader",()=>[{no:1,name:"name",kind:"scalar",T:9}],{localName:"DataStream_ByteHeader"}),tl=I.makeMessageType("livekit.DataStream.Header",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"topic",kind:"scalar",T:9},{no:4,name:"mime_type",kind:"scalar",T:9},{no:5,name:"total_length",kind:"scalar",T:4,opt:!0},{no:7,name:"encryption_type",kind:"enum",T:I.getEnumType(Wt)},{no:8,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:9,name:"text_header",kind:"message",T:Km,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:Vm,oneof:"content_header"}],{localName:"DataStream_Header"}),nl=I.makeMessageType("livekit.DataStream.Chunk",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"chunk_index",kind:"scalar",T:4},{no:3,name:"content",kind:"scalar",T:12},{no:4,name:"version",kind:"scalar",T:5},{no:5,name:"iv",kind:"scalar",T:12,opt:!0}],{localName:"DataStream_Chunk"}),rl=I.makeMessageType("livekit.DataStream.Trailer",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"reason",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}}],{localName:"DataStream_Trailer"}),an=I.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),il=I.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),FI=I.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),xI=I.makeMessageType("livekit.SignalRequest",()=>[{no:1,name:"offer",kind:"message",T:Gr,oneof:"message"},{no:2,name:"answer",kind:"message",T:Gr,oneof:"message"},{no:3,name:"trickle",kind:"message",T:ol,oneof:"message"},{no:4,name:"add_track",kind:"message",T:sl,oneof:"message"},{no:5,name:"mute",kind:"message",T:al,oneof:"message"},{no:6,name:"subscription",kind:"message",T:Go,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:jm,oneof:"message"},{no:8,name:"leave",kind:"message",T:jo,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:qm,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:Ym,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:Zm,oneof:"message"},{no:13,name:"simulate",kind:"message",T:_n,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:Jm,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:ev,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:Wm,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:MI,oneof:"message"}]),Gm=I.makeMessageType("livekit.SignalResponse",()=>[{no:1,name:"join",kind:"message",T:QI,oneof:"message"},{no:2,name:"answer",kind:"message",T:Gr,oneof:"message"},{no:3,name:"offer",kind:"message",T:Gr,oneof:"message"},{no:4,name:"trickle",kind:"message",T:ol,oneof:"message"},{no:5,name:"update",kind:"message",T:OI,oneof:"message"},{no:6,name:"track_published",kind:"message",T:cl,oneof:"message"},{no:8,name:"leave",kind:"message",T:jo,oneof:"message"},{no:9,name:"mute",kind:"message",T:al,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:LI,oneof:"message"},{no:11,name:"room_update",kind:"message",T:DI,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:HI,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:VI,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:jI,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:WI,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:PI,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:RI,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:JI,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:YI,oneof:"message"},{no:22,name:"request_response",kind:"message",T:ZI,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:$I,oneof:"message"},{no:24,name:"room_moved",kind:"message",T:qI,oneof:"message"}]),Al=I.makeMessageType("livekit.SimulcastCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}]),sl=I.makeMessageType("livekit.AddTrackRequest",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:I.getEnumType(An)},{no:4,name:"width",kind:"scalar",T:13},{no:5,name:"height",kind:"scalar",T:13},{no:6,name:"muted",kind:"scalar",T:8},{no:7,name:"disable_dtx",kind:"scalar",T:8},{no:8,name:"source",kind:"enum",T:I.getEnumType(at)},{no:9,name:"layers",kind:"message",T:Vr,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:Al,repeated:!0},{no:11,name:"sid",kind:"scalar",T:9},{no:12,name:"stereo",kind:"scalar",T:8},{no:13,name:"disable_red",kind:"scalar",T:8},{no:14,name:"encryption",kind:"enum",T:I.getEnumType(Wt)},{no:15,name:"stream",kind:"scalar",T:9},{no:16,name:"backup_codec_policy",kind:"enum",T:I.getEnumType(Um)},{no:17,name:"audio_features",kind:"enum",T:I.getEnumType(on),repeated:!0}]),ol=I.makeMessageType("livekit.TrickleRequest",()=>[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:I.getEnumType(an)},{no:3,name:"final",kind:"scalar",T:8}]),al=I.makeMessageType("livekit.MuteTrackRequest",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}]),QI=I.makeMessageType("livekit.JoinResponse",()=>[{no:1,name:"room",kind:"message",T:Ho},{no:2,name:"participant",kind:"message",T:Kr},{no:3,name:"other_participants",kind:"message",T:Kr,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:zm,repeated:!0},{no:6,name:"subscriber_primary",kind:"scalar",T:8},{no:7,name:"alternative_url",kind:"scalar",T:9},{no:8,name:"client_configuration",kind:"message",T:Dm},{no:9,name:"server_region",kind:"scalar",T:9},{no:10,name:"ping_timeout",kind:"scalar",T:5},{no:11,name:"ping_interval",kind:"scalar",T:5},{no:12,name:"server_info",kind:"message",T:UI},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:Ko,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}]),RI=I.makeMessageType("livekit.ReconnectResponse",()=>[{no:1,name:"ice_servers",kind:"message",T:zm,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:Dm}]),cl=I.makeMessageType("livekit.TrackPublishedResponse",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:Ui}]),PI=I.makeMessageType("livekit.TrackUnpublishedResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]),Gr=I.makeMessageType("livekit.SessionDescription",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9}]),OI=I.makeMessageType("livekit.ParticipantUpdate",()=>[{no:1,name:"participants",kind:"message",T:Kr,repeated:!0}]),Go=I.makeMessageType("livekit.UpdateSubscription",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"participant_tracks",kind:"message",T:Om,repeated:!0}]),jm=I.makeMessageType("livekit.UpdateTrackSettings",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:3,name:"disabled",kind:"scalar",T:8},{no:4,name:"quality",kind:"enum",T:I.getEnumType(Si)},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"fps",kind:"scalar",T:13},{no:8,name:"priority",kind:"scalar",T:13}]),Wm=I.makeMessageType("livekit.UpdateLocalAudioTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:I.getEnumType(on),repeated:!0}]),MI=I.makeMessageType("livekit.UpdateLocalVideoTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13}]),jo=I.makeMessageType("livekit.LeaveRequest",()=>[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:I.getEnumType(sn)},{no:3,name:"action",kind:"enum",T:I.getEnumType(Ti)},{no:4,name:"regions",kind:"message",T:zI}]),Ti=I.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),qm=I.makeMessageType("livekit.UpdateVideoLayers",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:Vr,repeated:!0}]),Jm=I.makeMessageType("livekit.UpdateParticipantMetadata",()=>[{no:1,name:"metadata",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"request_id",kind:"scalar",T:13}]),zm=I.makeMessageType("livekit.ICEServer",()=>[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]),LI=I.makeMessageType("livekit.SpeakersChanged",()=>[{no:1,name:"speakers",kind:"message",T:Tm,repeated:!0}]),DI=I.makeMessageType("livekit.RoomUpdate",()=>[{no:1,name:"room",kind:"message",T:Ho}]),NI=I.makeMessageType("livekit.ConnectionQualityInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:I.getEnumType(MA)},{no:3,name:"score",kind:"scalar",T:2}]),HI=I.makeMessageType("livekit.ConnectionQualityUpdate",()=>[{no:1,name:"updates",kind:"message",T:NI,repeated:!0}]),KI=I.makeMessageType("livekit.StreamStateInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:I.getEnumType(il)}]),VI=I.makeMessageType("livekit.StreamStateUpdate",()=>[{no:1,name:"stream_states",kind:"message",T:KI,repeated:!0}]),ul=I.makeMessageType("livekit.SubscribedQuality",()=>[{no:1,name:"quality",kind:"enum",T:I.getEnumType(Si)},{no:2,name:"enabled",kind:"scalar",T:8}]),GI=I.makeMessageType("livekit.SubscribedCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:ul,repeated:!0}]),jI=I.makeMessageType("livekit.SubscribedQualityUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:ul,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:GI,repeated:!0}]),Xm=I.makeMessageType("livekit.TrackPermission",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"all_tracks",kind:"scalar",T:8},{no:3,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:4,name:"participant_identity",kind:"scalar",T:9}]),Ym=I.makeMessageType("livekit.SubscriptionPermission",()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:Xm,repeated:!0}]),WI=I.makeMessageType("livekit.SubscriptionPermissionUpdate",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"allowed",kind:"scalar",T:8}]),qI=I.makeMessageType("livekit.RoomMovedResponse",()=>[{no:1,name:"room",kind:"message",T:Ho},{no:2,name:"token",kind:"scalar",T:9},{no:3,name:"participant",kind:"message",T:Kr},{no:4,name:"other_participants",kind:"message",T:Kr,repeated:!0}]),Zm=I.makeMessageType("livekit.SyncState",()=>[{no:1,name:"answer",kind:"message",T:Gr},{no:2,name:"subscription",kind:"message",T:Go},{no:3,name:"publish_tracks",kind:"message",T:cl,repeated:!0},{no:4,name:"data_channels",kind:"message",T:$m,repeated:!0},{no:5,name:"offer",kind:"message",T:Gr},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0}]),$m=I.makeMessageType("livekit.DataChannelInfo",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:13},{no:3,name:"target",kind:"enum",T:I.getEnumType(an)}]),_n=I.makeMessageType("livekit.SimulateScenario",()=>[{no:1,name:"speaker_update",kind:"scalar",T:5,oneof:"scenario"},{no:2,name:"node_failure",kind:"scalar",T:8,oneof:"scenario"},{no:3,name:"migration",kind:"scalar",T:8,oneof:"scenario"},{no:4,name:"server_leave",kind:"scalar",T:8,oneof:"scenario"},{no:5,name:"switch_candidate_protocol",kind:"enum",T:I.getEnumType(FI),oneof:"scenario"},{no:6,name:"subscriber_bandwidth",kind:"scalar",T:3,oneof:"scenario"},{no:7,name:"disconnect_signal_on_resume",kind:"scalar",T:8,oneof:"scenario"},{no:8,name:"disconnect_signal_on_resume_no_messages",kind:"scalar",T:8,oneof:"scenario"},{no:9,name:"leave_request_full_reconnect",kind:"scalar",T:8,oneof:"scenario"}]),ev=I.makeMessageType("livekit.Ping",()=>[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}]),JI=I.makeMessageType("livekit.Pong",()=>[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}]),zI=I.makeMessageType("livekit.RegionSettings",()=>[{no:1,name:"regions",kind:"message",T:XI,repeated:!0}]),XI=I.makeMessageType("livekit.RegionInfo",()=>[{no:1,name:"region",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"distance",kind:"scalar",T:3}]),YI=I.makeMessageType("livekit.SubscriptionResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:I.getEnumType(bI)}]),ZI=I.makeMessageType("livekit.RequestResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:I.getEnumType(ll)},{no:3,name:"message",kind:"scalar",T:9}]),ll=I.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"}]),$I=I.makeMessageType("livekit.TrackSubscribed",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]);function eF(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Wo={exports:{}},tF=Wo.exports,tv;function nF(){return tv||(tv=1,function(n){(function(e,t){n.exports?n.exports=t():e.log=t()})(tF,function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],A={},s=null;function o(p,g){var v=p[g];if(typeof v.bind=="function")return v.bind(p);try{return Function.prototype.bind.call(v,p)}catch{return function(){return Function.prototype.apply.apply(v,[p,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(p){return p==="debug"&&(p="log"),typeof console===t?!1:p==="trace"&&r?a:console[p]!==void 0?o(console,p):console.log!==void 0?o(console,"log"):e}function u(){for(var p=this.getLevel(),g=0;g<i.length;g++){var v=i[g];this[v]=g<p?e:this.methodFactory(v,p,this.name)}if(this.log=this.debug,typeof console===t&&p<this.levels.SILENT)return"No console available for logging"}function l(p){return function(){typeof console!==t&&(u.call(this),this[p].apply(this,arguments))}}function d(p,g,v){return c(p)||l.apply(this,arguments)}function h(p,g){var v=this,y,B,b,w="loglevel";typeof p=="string"?w+=":"+p:typeof p=="symbol"&&(w=void 0);function _(T){var Q=(i[T]||"silent").toUpperCase();if(!(typeof window===t||!w)){try{window.localStorage[w]=Q;return}catch{}try{window.document.cookie=encodeURIComponent(w)+"="+Q+";"}catch{}}}function k(){var T;if(!(typeof window===t||!w)){try{T=window.localStorage[w]}catch{}if(typeof T===t)try{var Q=window.document.cookie,M=encodeURIComponent(w),X=Q.indexOf(M+"=");X!==-1&&(T=/^([^;]+)/.exec(Q.slice(X+M.length+1))[1])}catch{}return v.levels[T]===void 0&&(T=void 0),T}}function F(){if(!(typeof window===t||!w)){try{window.localStorage.removeItem(w)}catch{}try{window.document.cookie=encodeURIComponent(w)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function x(T){var Q=T;if(typeof Q=="string"&&v.levels[Q.toUpperCase()]!==void 0&&(Q=v.levels[Q.toUpperCase()]),typeof Q=="number"&&Q>=0&&Q<=v.levels.SILENT)return Q;throw new TypeError("log.setLevel() called with invalid level: "+T)}v.name=p,v.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},v.methodFactory=g||d,v.getLevel=function(){return b??B??y},v.setLevel=function(T,Q){return b=x(T),Q!==!1&&_(b),u.call(v)},v.setDefaultLevel=function(T){B=x(T),k()||v.setLevel(T,!1)},v.resetLevel=function(){b=null,F(),u.call(v)},v.enableAll=function(T){v.setLevel(v.levels.TRACE,T)},v.disableAll=function(T){v.setLevel(v.levels.SILENT,T)},v.rebuild=function(){if(s!==v&&(y=x(s.getLevel())),u.call(v),s===v)for(var T in A)A[T].rebuild()},y=x(s?s.getLevel():"WARN");var E=k();E!=null&&(b=x(E)),u.call(v)}s=new h,s.getLogger=function(g){if(typeof g!="symbol"&&typeof g!="string"||g==="")throw new TypeError("You must supply a name when creating a logger.");var v=A[g];return v||(v=A[g]=new h(g,s.methodFactory)),v};var f=typeof window!==t?window.log:void 0;return s.noConflict=function(){return typeof window!==t&&window.log===s&&(window.log=f),s},s.getLoggers=function(){return A},s.default=s,s})}(Wo)),Wo.exports}var qo=nF(),dl;(function(n){n[n.trace=0]="trace",n[n.debug=1]="debug",n[n.info=2]="info",n[n.warn=3]="warn",n[n.error=4]="error",n[n.silent=5]="silent"})(dl||(dl={}));var cn;(function(n){n.Default="livekit",n.Room="livekit-room",n.Participant="livekit-participant",n.Track="livekit-track",n.Publication="livekit-track-publication",n.Engine="livekit-engine",n.Signal="livekit-signal",n.PCManager="livekit-pc-manager",n.PCTransport="livekit-pc-transport",n.E2EE="lk-e2ee"})(cn||(cn={}));let ue=qo.getLogger("livekit");Object.values(cn).map(n=>qo.getLogger(n)),ue.setDefaultLevel(dl.info);function Ln(n){const e=qo.getLogger(n);return e.setDefaultLevel(ue.getLevel()),e}const rF=qo.getLogger("lk-e2ee"),DA=7e3,iF=[0,300,2*2*300,3*3*300,4*4*300,DA,DA,DA,DA,DA];class AF{constructor(e){this._retryDelays=e!==void 0?[...e]:iF}nextRetryDelayInMs(e){if(e.retryCount>=this._retryDelays.length)return null;const t=this._retryDelays[e.retryCount];return e.retryCount<=1?t:t+Math.random()*1e3}}function sF(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function S(n,e,t,r){function i(A){return A instanceof t?A:new t(function(s){s(A)})}return new(t||(t=Promise))(function(A,s){function o(u){try{c(r.next(u))}catch(l){s(l)}}function a(u){try{c(r.throw(u))}catch(l){s(l)}}function c(u){u.done?A(u.value):i(u.value).then(o,a)}c((r=r.apply(n,e||[])).next())})}function nv(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ur(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof nv=="function"?nv(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(A){t[A]=n[A]&&function(s){return new Promise(function(o,a){s=n[A](s),i(o,a,s.done,s.value)})}}function i(A,s,o,a){Promise.resolve(a).then(function(c){A({value:c,done:o})},s)}}typeof SuppressedError=="function"&&SuppressedError;var Jo={exports:{}},rv;function oF(){if(rv)return Jo.exports;rv=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(w,_,k){return Function.prototype.apply.call(w,_,k)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(w){return Object.getOwnPropertyNames(w).concat(Object.getOwnPropertySymbols(w))}:t=function(w){return Object.getOwnPropertyNames(w)};function r(b){console&&console.warn&&console.warn(b)}var i=Number.isNaN||function(w){return w!==w};function A(){A.init.call(this)}Jo.exports=A,Jo.exports.once=v,A.EventEmitter=A,A.prototype._events=void 0,A.prototype._eventsCount=0,A.prototype._maxListeners=void 0;var s=10;function o(b){if(typeof b!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof b)}Object.defineProperty(A,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(b){if(typeof b!="number"||b<0||i(b))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+b+".");s=b}}),A.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},A.prototype.setMaxListeners=function(w){if(typeof w!="number"||w<0||i(w))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+w+".");return this._maxListeners=w,this};function a(b){return b._maxListeners===void 0?A.defaultMaxListeners:b._maxListeners}A.prototype.getMaxListeners=function(){return a(this)},A.prototype.emit=function(w){for(var _=[],k=1;k<arguments.length;k++)_.push(arguments[k]);var F=w==="error",x=this._events;if(x!==void 0)F=F&&x.error===void 0;else if(!F)return!1;if(F){var E;if(_.length>0&&(E=_[0]),E instanceof Error)throw E;var T=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw T.context=E,T}var Q=x[w];if(Q===void 0)return!1;if(typeof Q=="function")e(Q,this,_);else for(var M=Q.length,X=f(Q,M),k=0;k<M;++k)e(X[k],this,_);return!0};function c(b,w,_,k){var F,x,E;if(o(_),x=b._events,x===void 0?(x=b._events=Object.create(null),b._eventsCount=0):(x.newListener!==void 0&&(b.emit("newListener",w,_.listener?_.listener:_),x=b._events),E=x[w]),E===void 0)E=x[w]=_,++b._eventsCount;else if(typeof E=="function"?E=x[w]=k?[_,E]:[E,_]:k?E.unshift(_):E.push(_),F=a(b),F>0&&E.length>F&&!E.warned){E.warned=!0;var T=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(w)+" listeners added. Use emitter.setMaxListeners() to increase limit");T.name="MaxListenersExceededWarning",T.emitter=b,T.type=w,T.count=E.length,r(T)}return b}A.prototype.addListener=function(w,_){return c(this,w,_,!1)},A.prototype.on=A.prototype.addListener,A.prototype.prependListener=function(w,_){return c(this,w,_,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(b,w,_){var k={fired:!1,wrapFn:void 0,target:b,type:w,listener:_},F=u.bind(k);return F.listener=_,k.wrapFn=F,F}A.prototype.once=function(w,_){return o(_),this.on(w,l(this,w,_)),this},A.prototype.prependOnceListener=function(w,_){return o(_),this.prependListener(w,l(this,w,_)),this},A.prototype.removeListener=function(w,_){var k,F,x,E,T;if(o(_),F=this._events,F===void 0)return this;if(k=F[w],k===void 0)return this;if(k===_||k.listener===_)--this._eventsCount===0?this._events=Object.create(null):(delete F[w],F.removeListener&&this.emit("removeListener",w,k.listener||_));else if(typeof k!="function"){for(x=-1,E=k.length-1;E>=0;E--)if(k[E]===_||k[E].listener===_){T=k[E].listener,x=E;break}if(x<0)return this;x===0?k.shift():p(k,x),k.length===1&&(F[w]=k[0]),F.removeListener!==void 0&&this.emit("removeListener",w,T||_)}return this},A.prototype.off=A.prototype.removeListener,A.prototype.removeAllListeners=function(w){var _,k,F;if(k=this._events,k===void 0)return this;if(k.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):k[w]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete k[w]),this;if(arguments.length===0){var x=Object.keys(k),E;for(F=0;F<x.length;++F)E=x[F],E!=="removeListener"&&this.removeAllListeners(E);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(_=k[w],typeof _=="function")this.removeListener(w,_);else if(_!==void 0)for(F=_.length-1;F>=0;F--)this.removeListener(w,_[F]);return this};function d(b,w,_){var k=b._events;if(k===void 0)return[];var F=k[w];return F===void 0?[]:typeof F=="function"?_?[F.listener||F]:[F]:_?g(F):f(F,F.length)}A.prototype.listeners=function(w){return d(this,w,!0)},A.prototype.rawListeners=function(w){return d(this,w,!1)},A.listenerCount=function(b,w){return typeof b.listenerCount=="function"?b.listenerCount(w):h.call(b,w)},A.prototype.listenerCount=h;function h(b){var w=this._events;if(w!==void 0){var _=w[b];if(typeof _=="function")return 1;if(_!==void 0)return _.length}return 0}A.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function f(b,w){for(var _=new Array(w),k=0;k<w;++k)_[k]=b[k];return _}function p(b,w){for(;w+1<b.length;w++)b[w]=b[w+1];b.pop()}function g(b){for(var w=new Array(b.length),_=0;_<w.length;++_)w[_]=b[_].listener||b[_];return w}function v(b,w){return new Promise(function(_,k){function F(E){b.removeListener(w,x),k(E)}function x(){typeof b.removeListener=="function"&&b.removeListener("error",F),_([].slice.call(arguments))}B(b,w,x,{once:!0}),w!=="error"&&y(b,F,{once:!0})})}function y(b,w,_){typeof b.on=="function"&&B(b,"error",w,_)}function B(b,w,_,k){if(typeof b.on=="function")k.once?b.once(w,_):b.on(w,_);else if(typeof b.addEventListener=="function")b.addEventListener(w,function F(x){k.once&&b.removeEventListener(w,F),_(x)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof b)}return Jo.exports}var Sn=oF();let iv=!0,Av=!0;function zo(n,e,t){const r=n.match(e);return r&&r.length>=t&&parseInt(r[t],10)}function jr(n,e,t){if(!n.RTCPeerConnection)return;const r=n.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(s,o){if(s!==e)return i.apply(this,arguments);const a=c=>{const u=t(c);u&&(o.handleEvent?o.handleEvent(u):o(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(o,a),i.apply(this,[s,a])};const A=r.removeEventListener;r.removeEventListener=function(s,o){if(s!==e||!this._eventMap||!this._eventMap[e])return A.apply(this,arguments);if(!this._eventMap[e].has(o))return A.apply(this,arguments);const a=this._eventMap[e].get(o);return this._eventMap[e].delete(o),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,A.apply(this,[s,a])},Object.defineProperty(r,"on"+e,{get(){return this["_on"+e]},set(s){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),s&&this.addEventListener(e,this["_on"+e]=s)},enumerable:!0,configurable:!0})}function aF(n){return typeof n!="boolean"?new Error("Argument type: "+typeof n+". Please use a boolean."):(iv=n,n?"adapter.js logging disabled":"adapter.js logging enabled")}function cF(n){return typeof n!="boolean"?new Error("Argument type: "+typeof n+". Please use a boolean."):(Av=!n,"adapter.js deprecation warnings "+(n?"disabled":"enabled"))}function sv(){if(typeof window=="object"){if(iv)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function hl(n,e){Av&&console.warn(n+" is deprecated, please use "+e+" instead.")}function uF(n){const e={browser:null,version:null};if(typeof n>"u"||!n.navigator||!n.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:t}=n;if(t.userAgentData&&t.userAgentData.brands){const r=t.userAgentData.brands.find(i=>i.brand==="Chromium");if(r)return{browser:"chrome",version:parseInt(r.version,10)}}if(t.mozGetUserMedia)e.browser="firefox",e.version=zo(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||n.isSecureContext===!1&&n.webkitRTCPeerConnection)e.browser="chrome",e.version=zo(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(n.RTCPeerConnection&&t.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=zo(t.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=n.RTCRtpTransceiver&&"currentDirection"in n.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function ov(n){return Object.prototype.toString.call(n)==="[object Object]"}function av(n){return ov(n)?Object.keys(n).reduce(function(e,t){const r=ov(n[t]),i=r?av(n[t]):n[t],A=r&&!Object.keys(i).length;return i===void 0||A?e:Object.assign(e,{[t]:i})},{}):n}function pl(n,e,t){!e||t.has(e.id)||(t.set(e.id,e),Object.keys(e).forEach(r=>{r.endsWith("Id")?pl(n,n.get(e[r]),t):r.endsWith("Ids")&&e[r].forEach(i=>{pl(n,n.get(i),t)})}))}function cv(n,e,t){const r=t?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const A=[];return n.forEach(s=>{s.type==="track"&&s.trackIdentifier===e.id&&A.push(s)}),A.forEach(s=>{n.forEach(o=>{o.type===r&&o.trackId===s.id&&pl(n,o,i)})}),i}const uv=sv;function lv(n,e){const t=n&&n.navigator;if(!t.mediaDevices)return;const r=function(o){if(typeof o!="object"||o.mandatory||o.optional)return o;const a={};return Object.keys(o).forEach(c=>{if(c==="require"||c==="advanced"||c==="mediaSource")return;const u=typeof o[c]=="object"?o[c]:{ideal:o[c]};u.exact!==void 0&&typeof u.exact=="number"&&(u.min=u.max=u.exact);const l=function(d,h){return d?d+h.charAt(0).toUpperCase()+h.slice(1):h==="deviceId"?"sourceId":h};if(u.ideal!==void 0){a.optional=a.optional||[];let d={};typeof u.ideal=="number"?(d[l("min",c)]=u.ideal,a.optional.push(d),d={},d[l("max",c)]=u.ideal,a.optional.push(d)):(d[l("",c)]=u.ideal,a.optional.push(d))}u.exact!==void 0&&typeof u.exact!="number"?(a.mandatory=a.mandatory||{},a.mandatory[l("",c)]=u.exact):["min","max"].forEach(d=>{u[d]!==void 0&&(a.mandatory=a.mandatory||{},a.mandatory[l(d,c)]=u[d])})}),o.advanced&&(a.optional=(a.optional||[]).concat(o.advanced)),a},i=function(o,a){if(e.version>=61)return a(o);if(o=JSON.parse(JSON.stringify(o)),o&&typeof o.audio=="object"){const c=function(u,l,d){l in u&&!(d in u)&&(u[d]=u[l],delete u[l])};o=JSON.parse(JSON.stringify(o)),c(o.audio,"autoGainControl","googAutoGainControl"),c(o.audio,"noiseSuppression","googNoiseSuppression"),o.audio=r(o.audio)}if(o&&typeof o.video=="object"){let c=o.video.facingMode;c=c&&(typeof c=="object"?c:{ideal:c});const u=e.version<66;if(c&&(c.exact==="user"||c.exact==="environment"||c.ideal==="user"||c.ideal==="environment")&&!(t.mediaDevices.getSupportedConstraints&&t.mediaDevices.getSupportedConstraints().facingMode&&!u)){delete o.video.facingMode;let l;if(c.exact==="environment"||c.ideal==="environment"?l=["back","rear"]:(c.exact==="user"||c.ideal==="user")&&(l=["front"]),l)return t.mediaDevices.enumerateDevices().then(d=>{d=d.filter(f=>f.kind==="videoinput");let h=d.find(f=>l.some(p=>f.label.toLowerCase().includes(p)));return!h&&d.length&&l.includes("back")&&(h=d[d.length-1]),h&&(o.video.deviceId=c.exact?{exact:h.deviceId}:{ideal:h.deviceId}),o.video=r(o.video),uv("chrome: "+JSON.stringify(o)),a(o)})}o.video=r(o.video)}return uv("chrome: "+JSON.stringify(o)),a(o)},A=function(o){return e.version>=64?o:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[o.name]||o.name,message:o.message,constraint:o.constraint||o.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},s=function(o,a,c){i(o,u=>{t.webkitGetUserMedia(u,a,l=>{c&&c(A(l))})})};if(t.getUserMedia=s.bind(t),t.mediaDevices.getUserMedia){const o=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(a){return i(a,c=>o(c).then(u=>{if(c.audio&&!u.getAudioTracks().length||c.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(l=>{l.stop()}),new DOMException("","NotFoundError");return u},u=>Promise.reject(A(u))))}}}function dv(n){n.MediaStream=n.MediaStream||n.webkitMediaStream}function hv(n){if(typeof n=="object"&&n.RTCPeerConnection&&!("ontrack"in n.RTCPeerConnection.prototype)){Object.defineProperty(n.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});const e=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=r=>{r.stream.addEventListener("addtrack",i=>{let A;n.RTCPeerConnection.prototype.getReceivers?A=this.getReceivers().find(o=>o.track&&o.track.id===i.track.id):A={track:i.track};const s=new Event("track");s.track=i.track,s.receiver=A,s.transceiver={receiver:A},s.streams=[r.stream],this.dispatchEvent(s)}),r.stream.getTracks().forEach(i=>{let A;n.RTCPeerConnection.prototype.getReceivers?A=this.getReceivers().find(o=>o.track&&o.track.id===i.id):A={track:i};const s=new Event("track");s.track=i,s.receiver=A,s.transceiver={receiver:A},s.streams=[r.stream],this.dispatchEvent(s)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else jr(n,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function pv(n){if(typeof n=="object"&&n.RTCPeerConnection&&!("getSenders"in n.RTCPeerConnection.prototype)&&"createDTMFSender"in n.RTCPeerConnection.prototype){const e=function(i,A){return{track:A,get dtmf(){return this._dtmf===void 0&&(A.kind==="audio"?this._dtmf=i.createDTMFSender(A):this._dtmf=null),this._dtmf},_pc:i}};if(!n.RTCPeerConnection.prototype.getSenders){n.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addTrack=function(o,a){let c=i.apply(this,arguments);return c||(c=e(this,o),this._senders.push(c)),c};const A=n.RTCPeerConnection.prototype.removeTrack;n.RTCPeerConnection.prototype.removeTrack=function(o){A.apply(this,arguments);const a=this._senders.indexOf(o);a!==-1&&this._senders.splice(a,1)}}const t=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(A){this._senders=this._senders||[],t.apply(this,[A]),A.getTracks().forEach(s=>{this._senders.push(e(this,s))})};const r=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(A){this._senders=this._senders||[],r.apply(this,[A]),A.getTracks().forEach(s=>{const o=this._senders.find(a=>a.track===s);o&&this._senders.splice(this._senders.indexOf(o),1)})}}else if(typeof n=="object"&&n.RTCPeerConnection&&"getSenders"in n.RTCPeerConnection.prototype&&"createDTMFSender"in n.RTCPeerConnection.prototype&&n.RTCRtpSender&&!("dtmf"in n.RTCRtpSender.prototype)){const e=n.RTCPeerConnection.prototype.getSenders;n.RTCPeerConnection.prototype.getSenders=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r},Object.defineProperty(n.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function fv(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender&&n.RTCRtpReceiver))return;if(!("getStats"in n.RTCRtpSender.prototype)){const t=n.RTCPeerConnection.prototype.getSenders;t&&(n.RTCPeerConnection.prototype.getSenders=function(){const A=t.apply(this,[]);return A.forEach(s=>s._pc=this),A});const r=n.RTCPeerConnection.prototype.addTrack;r&&(n.RTCPeerConnection.prototype.addTrack=function(){const A=r.apply(this,arguments);return A._pc=this,A}),n.RTCRtpSender.prototype.getStats=function(){const A=this;return this._pc.getStats().then(s=>cv(s,A.track,!0))}}if(!("getStats"in n.RTCRtpReceiver.prototype)){const t=n.RTCPeerConnection.prototype.getReceivers;t&&(n.RTCPeerConnection.prototype.getReceivers=function(){const i=t.apply(this,[]);return i.forEach(A=>A._pc=this),i}),jr(n,"track",r=>(r.receiver._pc=r.srcElement,r)),n.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(A=>cv(A,i.track,!1))}}if(!("getStats"in n.RTCRtpSender.prototype&&"getStats"in n.RTCRtpReceiver.prototype))return;const e=n.RTCPeerConnection.prototype.getStats;n.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof n.MediaStreamTrack){const r=arguments[0];let i,A,s;return this.getSenders().forEach(o=>{o.track===r&&(i?s=!0:i=o)}),this.getReceivers().forEach(o=>(o.track===r&&(A?s=!0:A=o),o.track===r)),s||i&&A?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():A?A.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function gv(n){n.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(s=>this._shimmedLocalStreams[s][0])};const e=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addTrack=function(s,o){if(!o)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const a=e.apply(this,arguments);return this._shimmedLocalStreams[o.id]?this._shimmedLocalStreams[o.id].indexOf(a)===-1&&this._shimmedLocalStreams[o.id].push(a):this._shimmedLocalStreams[o.id]=[o,a],a};const t=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(s){this._shimmedLocalStreams=this._shimmedLocalStreams||{},s.getTracks().forEach(c=>{if(this.getSenders().find(l=>l.track===c))throw new DOMException("Track already exists.","InvalidAccessError")});const o=this.getSenders();t.apply(this,arguments);const a=this.getSenders().filter(c=>o.indexOf(c)===-1);this._shimmedLocalStreams[s.id]=[s].concat(a)};const r=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],r.apply(this,arguments)};const i=n.RTCPeerConnection.prototype.removeTrack;n.RTCPeerConnection.prototype.removeTrack=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},s&&Object.keys(this._shimmedLocalStreams).forEach(o=>{const a=this._shimmedLocalStreams[o].indexOf(s);a!==-1&&this._shimmedLocalStreams[o].splice(a,1),this._shimmedLocalStreams[o].length===1&&delete this._shimmedLocalStreams[o]}),i.apply(this,arguments)}}function mv(n,e){if(!n.RTCPeerConnection)return;if(n.RTCPeerConnection.prototype.addTrack&&e.version>=65)return gv(n);const t=n.RTCPeerConnection.prototype.getLocalStreams;n.RTCPeerConnection.prototype.getLocalStreams=function(){const u=t.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(l=>this._reverseStreams[l.id])};const r=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(u){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},u.getTracks().forEach(l=>{if(this.getSenders().find(h=>h.track===l))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[u.id]){const l=new n.MediaStream(u.getTracks());this._streams[u.id]=l,this._reverseStreams[l.id]=u,u=l}r.apply(this,[u])};const i=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(u){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[u.id]||u]),delete this._reverseStreams[this._streams[u.id]?this._streams[u.id].id:u.id],delete this._streams[u.id]},n.RTCPeerConnection.prototype.addTrack=function(u,l){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const d=[].slice.call(arguments,1);if(d.length!==1||!d[0].getTracks().find(p=>p===u))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(p=>p.track===u))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const f=this._streams[l.id];if(f)f.addTrack(u),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const p=new n.MediaStream([u]);this._streams[l.id]=p,this._reverseStreams[p.id]=l,this.addStream(p)}return this.getSenders().find(p=>p.track===u)};function A(c,u){let l=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(d=>{const h=c._reverseStreams[d],f=c._streams[h.id];l=l.replace(new RegExp(f.id,"g"),h.id)}),new RTCSessionDescription({type:u.type,sdp:l})}function s(c,u){let l=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(d=>{const h=c._reverseStreams[d],f=c._streams[h.id];l=l.replace(new RegExp(h.id,"g"),f.id)}),new RTCSessionDescription({type:u.type,sdp:l})}["createOffer","createAnswer"].forEach(function(c){const u=n.RTCPeerConnection.prototype[c],l={[c](){const d=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[f=>{const p=A(this,f);d[0].apply(null,[p])},f=>{d[1]&&d[1].apply(null,f)},arguments[2]]):u.apply(this,arguments).then(f=>A(this,f))}};n.RTCPeerConnection.prototype[c]=l[c]});const o=n.RTCPeerConnection.prototype.setLocalDescription;n.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?o.apply(this,arguments):(arguments[0]=s(this,arguments[0]),o.apply(this,arguments))};const a=Object.getOwnPropertyDescriptor(n.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(n.RTCPeerConnection.prototype,"localDescription",{get(){const c=a.get.apply(this);return c.type===""?c:A(this,c)}}),n.RTCPeerConnection.prototype.removeTrack=function(u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!u._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(u._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let d;Object.keys(this._streams).forEach(h=>{this._streams[h].getTracks().find(p=>u.track===p)&&(d=this._streams[h])}),d&&(d.getTracks().length===1?this.removeStream(this._reverseStreams[d.id]):d.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function fl(n,e){!n.RTCPeerConnection&&n.webkitRTCPeerConnection&&(n.RTCPeerConnection=n.webkitRTCPeerConnection),n.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){const r=n.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new(t==="addIceCandidate"?n.RTCIceCandidate:n.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};n.RTCPeerConnection.prototype[t]=i[t]})}function vv(n,e){jr(n,"negotiationneeded",t=>{const r=t.target;if(!((e.version<72||r.getConfiguration&&r.getConfiguration().sdpSemantics==="plan-b")&&r.signalingState!=="stable"))return t})}var yv=Object.freeze({__proto__:null,fixNegotiationNeeded:vv,shimAddTrackRemoveTrack:mv,shimAddTrackRemoveTrackWithNative:gv,shimGetSendersWithDtmf:pv,shimGetUserMedia:lv,shimMediaStream:dv,shimOnTrack:hv,shimPeerConnection:fl,shimSenderReceiverGetStats:fv});function wv(n,e){const t=n&&n.navigator,r=n&&n.MediaStreamTrack;if(t.getUserMedia=function(i,A,s){hl("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),t.mediaDevices.getUserMedia(i).then(A,s)},!(e.version>55&&"autoGainControl"in t.mediaDevices.getSupportedConstraints())){const i=function(s,o,a){o in s&&!(a in s)&&(s[a]=s[o],delete s[o])},A=t.mediaDevices.getUserMedia.bind(t.mediaDevices);if(t.mediaDevices.getUserMedia=function(s){return typeof s=="object"&&typeof s.audio=="object"&&(s=JSON.parse(JSON.stringify(s)),i(s.audio,"autoGainControl","mozAutoGainControl"),i(s.audio,"noiseSuppression","mozNoiseSuppression")),A(s)},r&&r.prototype.getSettings){const s=r.prototype.getSettings;r.prototype.getSettings=function(){const o=s.apply(this,arguments);return i(o,"mozAutoGainControl","autoGainControl"),i(o,"mozNoiseSuppression","noiseSuppression"),o}}if(r&&r.prototype.applyConstraints){const s=r.prototype.applyConstraints;r.prototype.applyConstraints=function(o){return this.kind==="audio"&&typeof o=="object"&&(o=JSON.parse(JSON.stringify(o)),i(o,"autoGainControl","mozAutoGainControl"),i(o,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[o])}}}}function lF(n,e){n.navigator.mediaDevices&&"getDisplayMedia"in n.navigator.mediaDevices||n.navigator.mediaDevices&&(n.navigator.mediaDevices.getDisplayMedia=function(r){if(!(r&&r.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return r.video===!0?r.video={mediaSource:e}:r.video.mediaSource=e,n.navigator.mediaDevices.getUserMedia(r)})}function bv(n){typeof n=="object"&&n.RTCTrackEvent&&"receiver"in n.RTCTrackEvent.prototype&&!("transceiver"in n.RTCTrackEvent.prototype)&&Object.defineProperty(n.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function gl(n,e){if(typeof n!="object"||!(n.RTCPeerConnection||n.mozRTCPeerConnection))return;!n.RTCPeerConnection&&n.mozRTCPeerConnection&&(n.RTCPeerConnection=n.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(i){const A=n.RTCPeerConnection.prototype[i],s={[i](){return arguments[0]=new(i==="addIceCandidate"?n.RTCIceCandidate:n.RTCSessionDescription)(arguments[0]),A.apply(this,arguments)}};n.RTCPeerConnection.prototype[i]=s[i]});const t={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=n.RTCPeerConnection.prototype.getStats;n.RTCPeerConnection.prototype.getStats=function(){const[A,s,o]=arguments;return r.apply(this,[A||null]).then(a=>{if(e.version<53&&!s)try{a.forEach(c=>{c.type=t[c.type]||c.type})}catch(c){if(c.name!=="TypeError")throw c;a.forEach((u,l)=>{a.set(l,Object.assign({},u,{type:t[u.type]||u.type}))})}return a}).then(s,o)}}function Bv(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender)||n.RTCRtpSender&&"getStats"in n.RTCRtpSender.prototype)return;const e=n.RTCPeerConnection.prototype.getSenders;e&&(n.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(A=>A._pc=this),i});const t=n.RTCPeerConnection.prototype.addTrack;t&&(n.RTCPeerConnection.prototype.addTrack=function(){const i=t.apply(this,arguments);return i._pc=this,i}),n.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function Cv(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender)||n.RTCRtpSender&&"getStats"in n.RTCRtpReceiver.prototype)return;const e=n.RTCPeerConnection.prototype.getReceivers;e&&(n.RTCPeerConnection.prototype.getReceivers=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r}),jr(n,"track",t=>(t.receiver._pc=t.srcElement,t)),n.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function _v(n){!n.RTCPeerConnection||"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){hl("removeStream","removeTrack"),this.getSenders().forEach(r=>{r.track&&t.getTracks().includes(r.track)&&this.removeTrack(r)})})}function Sv(n){n.DataChannel&&!n.RTCDataChannel&&(n.RTCDataChannel=n.DataChannel)}function kv(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.addTransceiver;e&&(n.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let r=arguments[1]&&arguments[1].sendEncodings;r===void 0&&(r=[]),r=[...r];const i=r.length>0;i&&r.forEach(s=>{if("rid"in s&&!/^[a-z0-9]{0,16}$/i.test(s.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in s&&!(parseFloat(s.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in s&&!(parseFloat(s.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const A=e.apply(this,arguments);if(i){const{sender:s}=A,o=s.getParameters();(!("encodings"in o)||o.encodings.length===1&&Object.keys(o.encodings[0]).length===0)&&(o.encodings=r,s.sendEncodings=r,this.setParametersPromises.push(s.setParameters(o).then(()=>{delete s.sendEncodings}).catch(()=>{delete s.sendEncodings})))}return A})}function Ev(n){if(!(typeof n=="object"&&n.RTCRtpSender))return;const e=n.RTCRtpSender.prototype.getParameters;e&&(n.RTCRtpSender.prototype.getParameters=function(){const r=e.apply(this,arguments);return"encodings"in r||(r.encodings=[].concat(this.sendEncodings||[{}])),r})}function Uv(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.createOffer;n.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function Tv(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.createAnswer;n.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}var Iv=Object.freeze({__proto__:null,shimAddTransceiver:kv,shimCreateAnswer:Tv,shimCreateOffer:Uv,shimGetDisplayMedia:lF,shimGetParameters:Ev,shimGetUserMedia:wv,shimOnTrack:bv,shimPeerConnection:gl,shimRTCDataChannel:Sv,shimReceiverGetStats:Cv,shimRemoveStream:_v,shimSenderGetStats:Bv});function Fv(n){if(!(typeof n!="object"||!n.RTCPeerConnection)){if("getLocalStreams"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in n.RTCPeerConnection.prototype)){const e=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addStream=function(r){this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(i=>e.call(this,i,r)),r.getVideoTracks().forEach(i=>e.call(this,i,r))},n.RTCPeerConnection.prototype.addTrack=function(r){for(var i=arguments.length,A=new Array(i>1?i-1:0),s=1;s<i;s++)A[s-1]=arguments[s];return A&&A.forEach(o=>{this._localStreams?this._localStreams.includes(o)||this._localStreams.push(o):this._localStreams=[o]}),e.apply(this,arguments)}}"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){this._localStreams||(this._localStreams=[]);const r=this._localStreams.indexOf(t);if(r===-1)return;this._localStreams.splice(r,1);const i=t.getTracks();this.getSenders().forEach(A=>{i.includes(A.track)&&this.removeTrack(A)})})}}function xv(n){if(!(typeof n!="object"||!n.RTCPeerConnection)&&("getRemoteStreams"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in n.RTCPeerConnection.prototype))){Object.defineProperty(n.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(t){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=r=>{r.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const A=new Event("addstream");A.stream=i,this.dispatchEvent(A)})})}});const e=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){const r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(A=>{if(r._remoteStreams||(r._remoteStreams=[]),r._remoteStreams.indexOf(A)>=0)return;r._remoteStreams.push(A);const s=new Event("addstream");s.stream=A,r.dispatchEvent(s)})}),e.apply(r,arguments)}}}function Qv(n){if(typeof n!="object"||!n.RTCPeerConnection)return;const e=n.RTCPeerConnection.prototype,t=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,A=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(c,u){const l=arguments.length>=2?arguments[2]:arguments[0],d=t.apply(this,[l]);return u?(d.then(c,u),Promise.resolve()):d},e.createAnswer=function(c,u){const l=arguments.length>=2?arguments[2]:arguments[0],d=r.apply(this,[l]);return u?(d.then(c,u),Promise.resolve()):d};let o=function(a,c,u){const l=i.apply(this,[a]);return u?(l.then(c,u),Promise.resolve()):l};e.setLocalDescription=o,o=function(a,c,u){const l=A.apply(this,[a]);return u?(l.then(c,u),Promise.resolve()):l},e.setRemoteDescription=o,o=function(a,c,u){const l=s.apply(this,[a]);return u?(l.then(c,u),Promise.resolve()):l},e.addIceCandidate=o}function Rv(n){const e=n&&n.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const t=e.mediaDevices,r=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=i=>r(Pv(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(r,i,A){e.mediaDevices.getUserMedia(r).then(i,A)}).bind(e))}function Pv(n){return n&&n.video!==void 0?Object.assign({},n,{video:av(n.video)}):n}function Ov(n){if(!n.RTCPeerConnection)return;const e=n.RTCPeerConnection;n.RTCPeerConnection=function(r,i){if(r&&r.iceServers){const A=[];for(let s=0;s<r.iceServers.length;s++){let o=r.iceServers[s];o.urls===void 0&&o.url?(hl("RTCIceServer.url","RTCIceServer.urls"),o=JSON.parse(JSON.stringify(o)),o.urls=o.url,delete o.url,A.push(o)):A.push(r.iceServers[s])}r.iceServers=A}return new e(r,i)},n.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(n.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function Mv(n){typeof n=="object"&&n.RTCTrackEvent&&"receiver"in n.RTCTrackEvent.prototype&&!("transceiver"in n.RTCTrackEvent.prototype)&&Object.defineProperty(n.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Lv(n){const e=n.RTCPeerConnection.prototype.createOffer;n.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio<"u"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);const i=this.getTransceivers().find(s=>s.receiver.track.kind==="audio");r.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo<"u"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);const A=this.getTransceivers().find(s=>s.receiver.track.kind==="video");r.offerToReceiveVideo===!1&&A?A.direction==="sendrecv"?A.setDirection?A.setDirection("sendonly"):A.direction="sendonly":A.direction==="recvonly"&&(A.setDirection?A.setDirection("inactive"):A.direction="inactive"):r.offerToReceiveVideo===!0&&!A&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function Dv(n){typeof n!="object"||n.AudioContext||(n.AudioContext=n.webkitAudioContext)}var Nv=Object.freeze({__proto__:null,shimAudioContext:Dv,shimCallbacksAPI:Qv,shimConstraints:Pv,shimCreateOfferLegacy:Lv,shimGetUserMedia:Rv,shimLocalStreamsAPI:Fv,shimRTCIceServerUrls:Ov,shimRemoteStreamsAPI:xv,shimTrackEventTransceiver:Mv}),ml={exports:{}},Hv;function dF(){return Hv||(Hv=1,function(n){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split(`
7
7
  `).map(r=>r.trim())},e.splitSections=function(t){return t.split(`
8
8
  m=`).map((i,A)=>(A>0?"m="+i:i).trim()+`\r
9
9
  `)},e.getDescription=function(t){const r=e.splitSections(t);return r&&r[0]},e.getMediaSections=function(t){const r=e.splitSections(t);return r.shift(),r},e.matchPrefix=function(t,r){return e.splitLines(t).filter(i=>i.indexOf(r)===0)},e.parseCandidate=function(t){let r;t.indexOf("a=candidate:")===0?r=t.substring(12).split(" "):r=t.substring(10).split(" ");const i={foundation:r[0],component:{1:"rtp",2:"rtcp"}[r[1]]||r[1],protocol:r[2].toLowerCase(),priority:parseInt(r[3],10),ip:r[4],address:r[4],port:parseInt(r[5],10),type:r[7]};for(let A=8;A<r.length;A+=2)switch(r[A]){case"raddr":i.relatedAddress=r[A+1];break;case"rport":i.relatedPort=parseInt(r[A+1],10);break;case"tcptype":i.tcpType=r[A+1];break;case"ufrag":i.ufrag=r[A+1],i.usernameFragment=r[A+1];break;default:i[r[A]]===void 0&&(i[r[A]]=r[A+1]);break}return i},e.writeCandidate=function(t){const r=[];r.push(t.foundation);const i=t.component;i==="rtp"?r.push(1):i==="rtcp"?r.push(2):r.push(i),r.push(t.protocol.toUpperCase()),r.push(t.priority),r.push(t.address||t.ip),r.push(t.port);const A=t.type;return r.push("typ"),r.push(A),A!=="host"&&t.relatedAddress&&t.relatedPort&&(r.push("raddr"),r.push(t.relatedAddress),r.push("rport"),r.push(t.relatedPort)),t.tcpType&&t.protocol.toLowerCase()==="tcp"&&(r.push("tcptype"),r.push(t.tcpType)),(t.usernameFragment||t.ufrag)&&(r.push("ufrag"),r.push(t.usernameFragment||t.ufrag)),"candidate:"+r.join(" ")},e.parseIceOptions=function(t){return t.substring(14).split(" ")},e.parseRtpMap=function(t){let r=t.substring(9).split(" ");const i={payloadType:parseInt(r.shift(),10)};return r=r[0].split("/"),i.name=r[0],i.clockRate=parseInt(r[1],10),i.channels=r.length===3?parseInt(r[2],10):1,i.numChannels=i.channels,i},e.writeRtpMap=function(t){let r=t.payloadType;t.preferredPayloadType!==void 0&&(r=t.preferredPayloadType);const i=t.channels||t.numChannels||1;return"a=rtpmap:"+r+" "+t.name+"/"+t.clockRate+(i!==1?"/"+i:"")+`\r
@@ -39,7 +39,7 @@ a=extmap-allow-mixed`)!==-1){const A=i.sdp.split(`
39
39
  `).filter(s=>s.trim()!=="a=extmap-allow-mixed").join(`
40
40
  `);n.RTCSessionDescription&&i instanceof n.RTCSessionDescription?arguments[0]=new n.RTCSessionDescription({type:i.type,sdp:A}):i.sdp=A}return t.apply(this,arguments)}}function $o(n,e){if(!(n.RTCPeerConnection&&n.RTCPeerConnection.prototype))return;const t=n.RTCPeerConnection.prototype.addIceCandidate;!t||t.length===0||(n.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(e.browser==="chrome"&&e.version<78||e.browser==="firefox"&&e.version<68||e.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ea(n,e){if(!(n.RTCPeerConnection&&n.RTCPeerConnection.prototype))return;const t=n.RTCPeerConnection.prototype.setLocalDescription;!t||t.length===0||(n.RTCPeerConnection.prototype.setLocalDescription=function(){let i=arguments[0]||{};if(typeof i!="object"||i.type&&i.sdp)return t.apply(this,arguments);if(i={type:i.type,sdp:i.sdp},!i.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":i.type="offer";break;default:i.type="answer";break}return i.sdp||i.type!=="offer"&&i.type!=="answer"?t.apply(this,[i]):(i.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(s=>t.apply(this,[s]))})}var pF=Object.freeze({__proto__:null,removeExtmapAllowMixed:wl,shimAddIceCandidateNullOrEmpty:$o,shimConnectionState:yl,shimMaxMessageSize:Yo,shimParameterlessSetLocalDescription:ea,shimRTCIceCandidate:Xo,shimRTCIceCandidateRelayProtocol:vl,shimSendThrowTypeError:Zo});function fF(){let{window:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const t=sv,r=uF(n),i={browserDetails:r,commonShim:pF,extractVersion:zo,disableLog:aF,disableWarnings:cF,sdp:hF};switch(r.browser){case"chrome":if(!yv||!fl||!e.shimChrome)return t("Chrome shim is not included in this adapter release."),i;if(r.version===null)return t("Chrome shim can not determine version, not shimming."),i;t("adapter.js shimming chrome."),i.browserShim=yv,$o(n,r),ea(n),lv(n,r),dv(n),fl(n,r),hv(n),mv(n,r),pv(n),fv(n),vv(n,r),Xo(n),vl(n),yl(n),Yo(n,r),Zo(n),wl(n,r);break;case"firefox":if(!Iv||!gl||!e.shimFirefox)return t("Firefox shim is not included in this adapter release."),i;t("adapter.js shimming firefox."),i.browserShim=Iv,$o(n,r),ea(n),wv(n,r),gl(n,r),bv(n),_v(n),Bv(n),Cv(n),Sv(n),kv(n),Ev(n),Uv(n),Tv(n),Xo(n),yl(n),Yo(n,r),Zo(n);break;case"safari":if(!Nv||!e.shimSafari)return t("Safari shim is not included in this adapter release."),i;t("adapter.js shimming safari."),i.browserShim=Nv,$o(n,r),ea(n),Ov(n),Lv(n),Qv(n),Fv(n),xv(n),Mv(n),Rv(n),Dv(n),Xo(n),vl(n),Yo(n,r),Zo(n),wl(n,r);break;default:t("Unsupported browser!");break}return i}fF({window:typeof window>"u"?void 0:window});const gF=10,ta="lk_e2ee",mF={sharedKey:!1,ratchetSalt:"LKFrameEncryptionKey",ratchetWindowSize:8,failureTolerance:gF,keyringSize:16};var lr;(function(n){n.SetKey="setKey",n.RatchetRequest="ratchetRequest",n.KeyRatcheted="keyRatcheted"})(lr||(lr={}));var Vv;(function(n){n.KeyRatcheted="keyRatcheted"})(Vv||(Vv={}));var dr;(function(n){n.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",n.EncryptionError="encryptionError"})(dr||(dr={}));var Gv;(function(n){n.Error="cryptorError"})(Gv||(Gv={}));function vF(){return yF()||bl()}function bl(){return typeof window.RTCRtpScriptTransform<"u"}function yF(){return typeof window.RTCRtpSender<"u"&&typeof window.RTCRtpSender.prototype.createEncodedStreams<"u"}class F4 extends Sn.EventEmitter{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.onKeyRatcheted=(t,r,i)=>{ue.debug("key ratcheted event received",{ratchetResult:t,participantId:r,keyIndex:i})},this.keyInfoMap=new Map,this.options=Object.assign(Object.assign({},mF),e),this.on(lr.KeyRatcheted,this.onKeyRatcheted)}onSetEncryptionKey(e,t,r){const i={key:e,participantIdentity:t,keyIndex:r};if(!this.options.sharedKey&&!t)throw new Error("participant identity needs to be passed for encryption key if sharedKey option is false");this.keyInfoMap.set("".concat(t??"shared","-").concat(r??0),i),this.emit(lr.SetKey,i)}getKeys(){return Array.from(this.keyInfoMap.values())}getOptions(){return this.options}ratchetKey(e,t){this.emit(lr.RatchetRequest,e,t)}}class hr extends Error{constructor(e,t){super(t||"an error has occured"),this.name="LiveKitError",this.code=e}}var de;(function(n){n[n.NotAllowed=0]="NotAllowed",n[n.ServerUnreachable=1]="ServerUnreachable",n[n.InternalError=2]="InternalError",n[n.Cancelled=3]="Cancelled",n[n.LeaveRequest=4]="LeaveRequest"})(de||(de={}));class Fe extends hr{constructor(e,t,r,i){super(1,e),this.name="ConnectionError",this.status=r,this.reason=t,this.context=i,this.reasonName=de[t]}}class Bl extends hr{constructor(e){super(21,e??"device is unsupported"),this.name="DeviceUnsupportedError"}}class Dn extends hr{constructor(e){super(20,e??"track is invalid"),this.name="TrackInvalidError"}}class wF extends hr{constructor(e){super(10,e??"unsupported server"),this.name="UnsupportedServer"}}class lt extends hr{constructor(e){super(12,e??"unexpected connection state"),this.name="UnexpectedConnectionState"}}class Cl extends hr{constructor(e){super(13,e??"unable to negotiate"),this.name="NegotiationError"}}class _l extends hr{constructor(e,t){super(15,e),this.name="PublishTrackError",this.status=t}}class jv extends hr{constructor(e,t){super(15,e),this.reason=t,this.reasonName=typeof t=="string"?t:ll[t]}}var na;(function(n){n.PermissionDenied="PermissionDenied",n.NotFound="NotFound",n.DeviceInUse="DeviceInUse",n.Other="Other"})(na||(na={})),function(n){function e(t){if(t&&"name"in t)return t.name==="NotFoundError"||t.name==="DevicesNotFoundError"?n.NotFound:t.name==="NotAllowedError"||t.name==="PermissionDeniedError"?n.PermissionDenied:t.name==="NotReadableError"||t.name==="TrackStartError"?n.DeviceInUse:n.Other}n.getFailure=e}(na||(na={}));var Wv;(function(n){n[n.InvalidKey=0]="InvalidKey",n[n.MissingKey=1]="MissingKey",n[n.InternalError=2]="InternalError"})(Wv||(Wv={}));var O;(function(n){n.Connected="connected",n.Reconnecting="reconnecting",n.SignalReconnecting="signalReconnecting",n.Reconnected="reconnected",n.Disconnected="disconnected",n.ConnectionStateChanged="connectionStateChanged",n.Moved="moved",n.MediaDevicesChanged="mediaDevicesChanged",n.ParticipantConnected="participantConnected",n.ParticipantDisconnected="participantDisconnected",n.TrackPublished="trackPublished",n.TrackSubscribed="trackSubscribed",n.TrackSubscriptionFailed="trackSubscriptionFailed",n.TrackUnpublished="trackUnpublished",n.TrackUnsubscribed="trackUnsubscribed",n.TrackMuted="trackMuted",n.TrackUnmuted="trackUnmuted",n.LocalTrackPublished="localTrackPublished",n.LocalTrackUnpublished="localTrackUnpublished",n.LocalAudioSilenceDetected="localAudioSilenceDetected",n.ActiveSpeakersChanged="activeSpeakersChanged",n.ParticipantMetadataChanged="participantMetadataChanged",n.ParticipantNameChanged="participantNameChanged",n.ParticipantAttributesChanged="participantAttributesChanged",n.ParticipantActive="participantActive",n.RoomMetadataChanged="roomMetadataChanged",n.DataReceived="dataReceived",n.SipDTMFReceived="sipDTMFReceived",n.TranscriptionReceived="transcriptionReceived",n.ConnectionQualityChanged="connectionQualityChanged",n.TrackStreamStateChanged="trackStreamStateChanged",n.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",n.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",n.AudioPlaybackStatusChanged="audioPlaybackChanged",n.VideoPlaybackStatusChanged="videoPlaybackChanged",n.MediaDevicesError="mediaDevicesError",n.ParticipantPermissionsChanged="participantPermissionsChanged",n.SignalConnected="signalConnected",n.RecordingStatusChanged="recordingStatusChanged",n.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",n.EncryptionError="encryptionError",n.DCBufferStatusChanged="dcBufferStatusChanged",n.ActiveDeviceChanged="activeDeviceChanged",n.ChatMessage="chatMessage",n.LocalTrackSubscribed="localTrackSubscribed",n.MetricsReceived="metricsReceived"})(O||(O={}));var K;(function(n){n.TrackPublished="trackPublished",n.TrackSubscribed="trackSubscribed",n.TrackSubscriptionFailed="trackSubscriptionFailed",n.TrackUnpublished="trackUnpublished",n.TrackUnsubscribed="trackUnsubscribed",n.TrackMuted="trackMuted",n.TrackUnmuted="trackUnmuted",n.LocalTrackPublished="localTrackPublished",n.LocalTrackUnpublished="localTrackUnpublished",n.ParticipantMetadataChanged="participantMetadataChanged",n.ParticipantNameChanged="participantNameChanged",n.DataReceived="dataReceived",n.SipDTMFReceived="sipDTMFReceived",n.TranscriptionReceived="transcriptionReceived",n.IsSpeakingChanged="isSpeakingChanged",n.ConnectionQualityChanged="connectionQualityChanged",n.TrackStreamStateChanged="trackStreamStateChanged",n.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",n.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",n.MediaDevicesError="mediaDevicesError",n.AudioStreamAcquired="audioStreamAcquired",n.ParticipantPermissionsChanged="participantPermissionsChanged",n.PCTrackAdded="pcTrackAdded",n.AttributesChanged="attributesChanged",n.LocalTrackSubscribed="localTrackSubscribed",n.ChatMessage="chatMessage",n.Active="active"})(K||(K={}));var D;(function(n){n.TransportsCreated="transportsCreated",n.Connected="connected",n.Disconnected="disconnected",n.Resuming="resuming",n.Resumed="resumed",n.Restarting="restarting",n.Restarted="restarted",n.SignalResumed="signalResumed",n.SignalRestarted="signalRestarted",n.Closing="closing",n.MediaTrackAdded="mediaTrackAdded",n.ActiveSpeakersUpdate="activeSpeakersUpdate",n.DataPacketReceived="dataPacketReceived",n.RTPVideoMapUpdate="rtpVideoMapUpdate",n.DCBufferStatusChanged="dcBufferStatusChanged",n.ParticipantUpdate="participantUpdate",n.RoomUpdate="roomUpdate",n.SpeakersChanged="speakersChanged",n.StreamStateChanged="streamStateChanged",n.ConnectionQualityUpdate="connectionQualityUpdate",n.SubscriptionError="subscriptionError",n.SubscriptionPermissionUpdate="subscriptionPermissionUpdate",n.RemoteMute="remoteMute",n.SubscribedQualityUpdate="subscribedQualityUpdate",n.LocalTrackUnpublished="localTrackUnpublished",n.LocalTrackSubscribed="localTrackSubscribed",n.Offline="offline",n.SignalRequestResponse="signalRequestResponse",n.SignalConnected="signalConnected",n.RoomMoved="roomMoved"})(D||(D={}));var L;(function(n){n.Message="message",n.Muted="muted",n.Unmuted="unmuted",n.Restarted="restarted",n.Ended="ended",n.Subscribed="subscribed",n.Unsubscribed="unsubscribed",n.UpdateSettings="updateSettings",n.UpdateSubscription="updateSubscription",n.AudioPlaybackStarted="audioPlaybackStarted",n.AudioPlaybackFailed="audioPlaybackFailed",n.AudioSilenceDetected="audioSilenceDetected",n.VisibilityChanged="visibilityChanged",n.VideoDimensionsChanged="videoDimensionsChanged",n.VideoPlaybackStarted="videoPlaybackStarted",n.VideoPlaybackFailed="videoPlaybackFailed",n.ElementAttached="elementAttached",n.ElementDetached="elementDetached",n.UpstreamPaused="upstreamPaused",n.UpstreamResumed="upstreamResumed",n.SubscriptionPermissionChanged="subscriptionPermissionChanged",n.SubscriptionStatusChanged="subscriptionStatusChanged",n.SubscriptionFailed="subscriptionFailed",n.TrackProcessorUpdate="trackProcessorUpdate",n.AudioTrackFeatureUpdate="audioTrackFeatureUpdate",n.TranscriptionReceived="transcriptionReceived",n.TimeSyncUpdate="timeSyncUpdate"})(L||(L={}));function bF(n){return typeof n>"u"?n:typeof structuredClone=="function"?structuredClone(n):JSON.parse(JSON.stringify(n))}const BF=/version\/(\d+(\.?_?\d+)+)/i;let Sl;function un(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(typeof n>"u"&&typeof navigator>"u")return;const t=(n??navigator.userAgent).toLowerCase();if(Sl===void 0||e){const r=CF.find(i=>{let{test:A}=i;return A.test(t)});Sl=r==null?void 0:r.describe(t)}return Sl}const CF=[{test:/firefox|iceweasel|fxios/i,describe(n){return{name:"Firefox",version:ra(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,n),os:n.toLowerCase().includes("fxios")?"iOS":void 0,osVersion:kl(n)}}},{test:/chrom|crios|crmo/i,describe(n){return{name:"Chrome",version:ra(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i,n),os:n.toLowerCase().includes("crios")?"iOS":void 0,osVersion:kl(n)}}},{test:/safari|applewebkit/i,describe(n){return{name:"Safari",version:ra(BF,n),os:n.includes("mobile/")?"iOS":"macOS",osVersion:kl(n)}}}];function ra(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const r=e.match(n);return r&&r.length>=t&&r[t]||""}function kl(n){return n.includes("mac os")?ra(/\(.+?(\d+_\d+(:?_\d+)?)/,n,1).replace(/_/g,"."):void 0}var _F="2.13.0";const SF=_F,kF=16;class wt{}wt.setTimeout=function(){return setTimeout(...arguments)},wt.setInterval=function(){return setInterval(...arguments)},wt.clearTimeout=function(){return clearTimeout(...arguments)},wt.clearInterval=function(){return clearInterval(...arguments)};const EF=5e3,NA=[];var Yt;(function(n){n[n.LOW=0]="LOW",n[n.MEDIUM=1]="MEDIUM",n[n.HIGH=2]="HIGH"})(Yt||(Yt={}));class P extends Sn.EventEmitter{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var i;super(),this.attachedElements=[],this.isMuted=!1,this.streamState=P.StreamState.Active,this.isInBackground=!1,this._currentBitrate=0,this.log=ue,this.appVisibilityChangedListener=()=>{this.backgroundTimeout&&clearTimeout(this.backgroundTimeout),document.visibilityState==="hidden"?this.backgroundTimeout=setTimeout(()=>this.handleAppVisibilityChanged(),EF):this.handleAppVisibilityChanged()},this.log=Ln((i=r.loggerName)!==null&&i!==void 0?i:cn.Track),this.loggerContextCb=r.loggerContextCb,this.setMaxListeners(100),this.kind=t,this._mediaStreamTrack=e,this._mediaStreamID=e.id,this.source=P.Source.Unknown}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),_e(this))}get currentBitrate(){return this._currentBitrate}get mediaStreamTrack(){return this._mediaStreamTrack}get mediaStreamID(){return this._mediaStreamID}attach(e){let t="audio";this.kind===P.Kind.Video&&(t="video"),this.attachedElements.length===0&&this.kind===P.Kind.Video&&this.addAppVisibilityListener(),e||(t==="audio"&&(NA.forEach(A=>{A.parentElement===null&&!e&&(e=A)}),e&&NA.splice(NA.indexOf(e),1)),e||(e=document.createElement(t))),this.attachedElements.includes(e)||this.attachedElements.push(e),Fi(this.mediaStreamTrack,e);const r=e.srcObject.getTracks(),i=r.some(A=>A.kind==="audio");return e.play().then(()=>{this.emit(i?L.AudioPlaybackStarted:L.VideoPlaybackStarted)}).catch(A=>{A.name==="NotAllowedError"?this.emit(i?L.AudioPlaybackFailed:L.VideoPlaybackFailed,A):A.name==="AbortError"?ue.debug("".concat(i?"audio":"video"," playback aborted, likely due to new play request")):ue.warn("could not playback ".concat(i?"audio":"video"),A),i&&e&&r.some(s=>s.kind==="video")&&A.name==="NotAllowedError"&&(e.muted=!0,e.play().catch(()=>{}))}),this.emit(L.ElementAttached,e),e}detach(e){try{if(e){xi(this.mediaStreamTrack,e);const r=this.attachedElements.indexOf(e);return r>=0&&(this.attachedElements.splice(r,1),this.recycleElement(e),this.emit(L.ElementDetached,e)),e}const t=[];return this.attachedElements.forEach(r=>{xi(this.mediaStreamTrack,r),t.push(r),this.recycleElement(r),this.emit(L.ElementDetached,r)}),this.attachedElements=[],t}finally{this.attachedElements.length===0&&this.removeAppVisibilityListener()}}stop(){this.stopMonitor(),this._mediaStreamTrack.stop()}enable(){this._mediaStreamTrack.enabled=!0}disable(){this._mediaStreamTrack.enabled=!1}stopMonitor(){this.monitorInterval&&clearInterval(this.monitorInterval),this.timeSyncHandle&&cancelAnimationFrame(this.timeSyncHandle)}updateLoggerOptions(e){e.loggerName&&(this.log=Ln(e.loggerName)),e.loggerContextCb&&(this.loggerContextCb=e.loggerContextCb)}recycleElement(e){if(e instanceof HTMLAudioElement){let t=!0;e.pause(),NA.forEach(r=>{r.parentElement||(t=!1)}),t&&NA.push(e)}}handleAppVisibilityChanged(){return S(this,void 0,void 0,function*(){this.isInBackground=document.visibilityState==="hidden",!this.isInBackground&&this.kind===P.Kind.Video&&setTimeout(()=>this.attachedElements.forEach(e=>e.play().catch(()=>{})),0)})}addAppVisibilityListener(){Ht()?(this.isInBackground=document.visibilityState==="hidden",document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}removeAppVisibilityListener(){Ht()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}function Fi(n,e){let t;e.srcObject instanceof MediaStream?t=e.srcObject:t=new MediaStream;let r;n.kind==="audio"?r=t.getAudioTracks():r=t.getVideoTracks(),r.includes(n)||(r.forEach(i=>{t.removeTrack(i)}),t.addTrack(n)),(!pr()||!(e instanceof HTMLVideoElement))&&(e.autoplay=!0),e.muted=t.getAudioTracks().length===0,e instanceof HTMLVideoElement&&(e.playsInline=!0),e.srcObject!==t&&(e.srcObject=t,(pr()||Qi())&&e instanceof HTMLVideoElement&&setTimeout(()=>{e.srcObject=t,e.play().catch(()=>{})},0))}function xi(n,e){if(e.srcObject instanceof MediaStream){const t=e.srcObject;t.removeTrack(n),t.getTracks().length>0?e.srcObject=t:e.srcObject=null}}(function(n){let e;(function(c){c.Audio="audio",c.Video="video",c.Unknown="unknown"})(e=n.Kind||(n.Kind={}));let t;(function(c){c.Camera="camera",c.Microphone="microphone",c.ScreenShare="screen_share",c.ScreenShareAudio="screen_share_audio",c.Unknown="unknown"})(t=n.Source||(n.Source={}));let r;(function(c){c.Active="active",c.Paused="paused",c.Unknown="unknown"})(r=n.StreamState||(n.StreamState={}));function i(c){switch(c){case e.Audio:return An.AUDIO;case e.Video:return An.VIDEO;default:return An.DATA}}n.kindToProto=i;function A(c){switch(c){case An.AUDIO:return e.Audio;case An.VIDEO:return e.Video;default:return e.Unknown}}n.kindFromProto=A;function s(c){switch(c){case t.Camera:return at.CAMERA;case t.Microphone:return at.MICROPHONE;case t.ScreenShare:return at.SCREEN_SHARE;case t.ScreenShareAudio:return at.SCREEN_SHARE_AUDIO;default:return at.UNKNOWN}}n.sourceToProto=s;function o(c){switch(c){case at.CAMERA:return t.Camera;case at.MICROPHONE:return t.Microphone;case at.SCREEN_SHARE:return t.ScreenShare;case at.SCREEN_SHARE_AUDIO:return t.ScreenShareAudio;default:return t.Unknown}}n.sourceFromProto=o;function a(c){switch(c){case il.ACTIVE:return r.Active;case il.PAUSED:return r.Paused;default:return r.Unknown}}n.streamStateFromProto=a})(P||(P={}));class Te{constructor(e,t,r,i,A){if(typeof e=="object")this.width=e.width,this.height=e.height,this.aspectRatio=e.aspectRatio,this.encoding={maxBitrate:e.maxBitrate,maxFramerate:e.maxFramerate,priority:e.priority};else if(t!==void 0&&r!==void 0)this.width=e,this.height=t,this.aspectRatio=e/t,this.encoding={maxBitrate:r,maxFramerate:i,priority:A};else throw new TypeError("Unsupported options: provide at least width, height and maxBitrate")}get resolution(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.aspectRatio}}}const UF=["vp8","h264"],TF=["vp8","h264","vp9","av1"];function IF(n){return!!UF.find(e=>e===n)}var qv;(function(n){n[n.PREFER_REGRESSION=0]="PREFER_REGRESSION",n[n.SIMULCAST=1]="SIMULCAST",n[n.REGRESSION=2]="REGRESSION"})(qv||(qv={}));var El;(function(n){n.telephone={maxBitrate:12e3},n.speech={maxBitrate:24e3},n.music={maxBitrate:48e3},n.musicStereo={maxBitrate:64e3},n.musicHighQuality={maxBitrate:96e3},n.musicHighQualityStereo={maxBitrate:128e3}})(El||(El={}));const HA={h90:new Te(160,90,9e4,20),h180:new Te(320,180,16e4,20),h216:new Te(384,216,18e4,20),h360:new Te(640,360,45e4,20),h540:new Te(960,540,8e5,25),h720:new Te(1280,720,17e5,30),h1080:new Te(1920,1080,3e6,30),h1440:new Te(2560,1440,5e6,30),h2160:new Te(3840,2160,8e6,30)},Ul={h120:new Te(160,120,7e4,20),h180:new Te(240,180,125e3,20),h240:new Te(320,240,14e4,20),h360:new Te(480,360,33e4,20),h480:new Te(640,480,5e5,20),h540:new Te(720,540,6e5,25),h720:new Te(960,720,13e5,30),h1080:new Te(1440,1080,23e5,30),h1440:new Te(1920,1440,38e5,30)},Tl={h360fps3:new Te(640,360,2e5,3,"medium"),h360fps15:new Te(640,360,4e5,15,"medium"),h720fps5:new Te(1280,720,8e5,5,"medium"),h720fps15:new Te(1280,720,15e5,15,"medium"),h720fps30:new Te(1280,720,2e6,30,"medium"),h1080fps15:new Te(1920,1080,25e5,15,"medium"),h1080fps30:new Te(1920,1080,5e6,30,"medium"),original:new Te(0,0,7e6,30,"medium")},FF="|",Jv="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";function xF(n){const e=n.split(FF);return e.length>1?[e[0],n.substr(e[0].length+1)]:[n,""]}function Nt(n){return S(this,void 0,void 0,function*(){return new Promise(e=>wt.setTimeout(e,n))})}function Il(){return"addTransceiver"in RTCPeerConnection.prototype}function Fl(){return"addTrack"in RTCPeerConnection.prototype}function QF(){if(!("getCapabilities"in RTCRtpSender)||pr())return!1;const n=RTCRtpSender.getCapabilities("video");let e=!1;if(n){for(const t of n.codecs)if(t.mimeType==="video/AV1"){e=!0;break}}return e}function RF(){if(!("getCapabilities"in RTCRtpSender)||Qi())return!1;if(pr()){const t=un();if(t!=null&&t.version&&Wr(t.version,"16")<0)return!1}const n=RTCRtpSender.getCapabilities("video");let e=!1;if(n){for(const t of n.codecs)if(t.mimeType==="video/VP9"){e=!0;break}}return e}function KA(n){return n==="av1"||n==="vp9"}function xl(n){return document?(n||(n=document.createElement("audio")),"setSinkId"in n):!1}function PF(){return typeof RTCPeerConnection>"u"?!1:Il()||Fl()}function Qi(){var n;return((n=un())===null||n===void 0?void 0:n.name)==="Firefox"}function pr(){var n;return((n=un())===null||n===void 0?void 0:n.name)==="Safari"}function OF(){const n=un();return(n==null?void 0:n.name)==="Safari"&&n.version.startsWith("17.")}function zv(){var n,e;return Ht()?(e=(n=navigator.userAgentData)===null||n===void 0?void 0:n.mobile)!==null&&e!==void 0?e:/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent):!1}function MF(){const n=un(),e="17.2";if(n)return n.name!=="Safari"&&n.os!=="iOS"||n.os==="iOS"&&n.osVersion&&Wr(e,n.osVersion)>=0?!0:n.name==="Safari"&&Wr(e,n.version)>=0}function Ht(){return typeof document<"u"}function kn(){return navigator.product=="ReactNative"}function Ql(n){return n.hostname.endsWith(".livekit.cloud")||n.hostname.endsWith(".livekit.run")}function Xv(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function Yv(){if(!kn())return;let n=Xv();if(n)return n.platform}function Zv(){if(Ht())return window.devicePixelRatio;if(kn()){let n=Xv();if(n)return n.devicePixelRatio}return 1}function Wr(n,e){const t=n.split("."),r=e.split("."),i=Math.min(t.length,r.length);for(let A=0;A<i;++A){const s=parseInt(t[A],10),o=parseInt(r[A],10);if(s>o)return 1;if(s<o)return-1;if(A===i-1&&s===o)return 0}return n===""&&e!==""?-1:e===""?1:t.length==r.length?0:t.length<r.length?-1:1}function LF(n){for(const e of n)e.target.handleResize(e)}function DF(n){for(const e of n)e.target.handleVisibilityChanged(e)}let Rl=null;const $v=()=>(Rl||(Rl=new ResizeObserver(LF)),Rl);let Pl=null;const e0=()=>(Pl||(Pl=new IntersectionObserver(DF,{root:null,rootMargin:"0px"})),Pl);function NF(){var n;const e=new TI({sdk:Lm.JS,protocol:kF,version:SF});return kn()&&(e.os=(n=Yv())!==null&&n!==void 0?n:""),e}function t0(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:16,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const i=document.createElement("canvas");i.width=n,i.height=e;const A=i.getContext("2d");A==null||A.fillRect(0,0,i.width,i.height),r&&A&&(A.beginPath(),A.arc(n/2,e/2,50,0,Math.PI*2,!0),A.closePath(),A.fillStyle="grey",A.fill());const s=i.captureStream(),[o]=s.getTracks();if(!o)throw Error("Could not get empty media stream video track");return o.enabled=t,o}let VA;function Ol(){if(!VA){const n=new AudioContext,e=n.createOscillator(),t=n.createGain();t.gain.setValueAtTime(0,0);const r=n.createMediaStreamDestination();if(e.connect(t),t.connect(r),e.start(),[VA]=r.stream.getAudioTracks(),!VA)throw Error("Could not get empty media stream audio track");VA.enabled=!1}return VA.clone()}class Ml{constructor(e,t){this.onFinally=t,this.promise=new Promise((r,i)=>S(this,void 0,void 0,function*(){this.resolve=r,this.reject=i,e&&(yield e(r,i))})).finally(()=>{var r;return(r=this.onFinally)===null||r===void 0?void 0:r.call(this)})}}function HF(n){return TF.includes(n)}function fr(n){if(typeof n=="string"||typeof n=="number")return n;if(Array.isArray(n))return n[0];if(n.exact)return Array.isArray(n.exact)?n.exact[0]:n.exact;if(n.ideal)return Array.isArray(n.ideal)?n.ideal[0]:n.ideal;throw Error("could not unwrap constraint")}function KF(n){return n.startsWith("http")?n.replace(/^(http)/,"ws"):n}function Ll(n){return n.startsWith("ws")?n.replace(/^(ws)/,"http"):n}function VF(n,e){return n.segments.map(t=>{let{id:r,text:i,language:A,startTime:s,endTime:o,final:a}=t;var c;const u=(c=e.get(r))!==null&&c!==void 0?c:Date.now(),l=Date.now();return a?e.delete(r):e.set(r,u),{id:r,text:i,startTime:Number.parseInt(s.toString()),endTime:Number.parseInt(o.toString()),final:a,language:A,firstReceivedTime:u,lastReceivedTime:l}})}function GF(n){const{id:e,timestamp:t,message:r,editTimestamp:i}=n;return{id:e,timestamp:Number.parseInt(t.toString()),editTimestamp:i?Number.parseInt(i.toString()):void 0,message:r}}function n0(n){switch(n.reason){case de.LeaveRequest:return n.context;case de.Cancelled:return sn.CLIENT_INITIATED;case de.NotAllowed:return sn.USER_REJECTED;case de.ServerUnreachable:return sn.JOIN_FAILURE;default:return sn.UNKNOWN_REASON}}function ia(n){return n!==void 0?Number(n):void 0}function qr(n){return n!==void 0?BigInt(n):void 0}function Ri(n){return!!n&&!(n instanceof MediaStreamTrack)&&n.isLocal}function Nn(n){return!!n&&n.kind==P.Kind.Audio}function Pi(n){return!!n&&n.kind==P.Kind.Video}function gr(n){return Ri(n)&&Pi(n)}function Jr(n){return Ri(n)&&Nn(n)}function Dl(n){return!!n&&!n.isLocal}function jF(n){return!!n&&!n.isLocal}function Nl(n){return Dl(n)&&Pi(n)}function WF(n){return n.isLocal}function qF(n,e){const t=[];let r=new TextEncoder().encode(n);for(;r.length>e;){let i=e;for(;i>0;){const A=r[i];if(A!==void 0&&(A&192)!==128)break;i--}t.push(r.slice(0,i)),r=r.slice(i)}return r.length>0&&t.push(r),t}function r0(n,e,t){var r,i,A,s;const{optionsWithoutProcessor:o,audioProcessor:a,videoProcessor:c}=o0(n??{}),u=e==null?void 0:e.processor,l=t==null?void 0:t.processor,d=o??{};return d.audio===!0&&(d.audio={}),d.video===!0&&(d.video={}),d.audio&&(Hl(d.audio,e),(r=(A=d.audio).deviceId)!==null&&r!==void 0||(A.deviceId={ideal:"default"}),(a||u)&&(d.audio.processor=a??u)),d.video&&(Hl(d.video,t),(i=(s=d.video).deviceId)!==null&&i!==void 0||(s.deviceId={ideal:"default"}),(c||l)&&(d.video.processor=c??l)),d}function Hl(n,e){return Object.keys(e).forEach(t=>{n[t]===void 0&&(n[t]=e[t])}),n}function Kl(n){var e,t,r,i;const A={};if(n.video)if(typeof n.video=="object"){const s={},o=s,a=n.video;Object.keys(a).forEach(c=>{switch(c){case"resolution":Hl(o,a.resolution);break;default:o[c]=a[c]}}),A.video=s,(e=(r=A.video).deviceId)!==null&&e!==void 0||(r.deviceId={ideal:"default"})}else A.video=n.video?{deviceId:{ideal:"default"}}:!1;else A.video=!1;return n.audio?typeof n.audio=="object"?(A.audio=n.audio,(t=(i=A.audio).deviceId)!==null&&t!==void 0||(i.deviceId={ideal:"default"})):A.audio={deviceId:{ideal:"default"}}:A.audio=!1,A}function i0(n){return S(this,arguments,void 0,function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200;return function*(){const r=A0();if(r){const i=r.createAnalyser();i.fftSize=2048;const A=i.frequencyBinCount,s=new Uint8Array(A);r.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(i),yield Nt(t),i.getByteTimeDomainData(s);const a=s.some(c=>c!==128&&c!==0);return r.close(),!a}return!1}()})}function A0(){var n;const e=typeof window<"u"&&(window.AudioContext||window.webkitAudioContext);if(e){const t=new e({latencyHint:"interactive"});if(t.state==="suspended"&&typeof window<"u"&&(!((n=window.document)===null||n===void 0)&&n.body)){const r=()=>S(this,void 0,void 0,function*(){var i;try{t.state==="suspended"&&(yield t.resume())}catch(A){console.warn("Error trying to auto-resume audio context",A)}(i=window.document.body)===null||i===void 0||i.removeEventListener("click",r)});window.document.body.addEventListener("click",r)}return t}}function JF(n){return n==="audioinput"?P.Source.Microphone:n==="videoinput"?P.Source.Camera:P.Source.Unknown}function s0(n){return n===P.Source.Microphone?"audioinput":n===P.Source.Camera?"videoinput":void 0}function zF(n){var e,t;let r=(e=n.video)!==null&&e!==void 0?e:!0;return n.resolution&&n.resolution.width>0&&n.resolution.height>0&&(r=typeof r=="boolean"?{}:r,pr()?r=Object.assign(Object.assign({},r),{width:{max:n.resolution.width},height:{max:n.resolution.height},frameRate:n.resolution.frameRate}):r=Object.assign(Object.assign({},r),{width:{ideal:n.resolution.width},height:{ideal:n.resolution.height},frameRate:n.resolution.frameRate})),{audio:(t=n.audio)!==null&&t!==void 0?t:!1,video:r,controller:n.controller,selfBrowserSurface:n.selfBrowserSurface,surfaceSwitching:n.surfaceSwitching,systemAudio:n.systemAudio,preferCurrentTab:n.preferCurrentTab}}function Aa(n){return n.split("/")[1].toLowerCase()}function XF(n){const e=[];return n.forEach(t=>{t.track!==void 0&&e.push(new cl({cid:t.track.mediaStreamID,track:t.trackInfo}))}),e}function _e(n){return"mediaStreamTrack"in n?{trackID:n.sid,source:n.source,muted:n.isMuted,enabled:n.mediaStreamTrack.enabled,kind:n.kind,streamID:n.mediaStreamID,streamTrackID:n.mediaStreamTrack.id}:{trackID:n.trackSid,enabled:n.isEnabled,muted:n.isMuted,trackInfo:Object.assign({mimeType:n.mimeType,name:n.trackName,encrypted:n.isEncrypted,kind:n.kind,source:n.source},n.track?_e(n.track):{})}}function YF(){return typeof RTCRtpReceiver<"u"&&"getSynchronizationSources"in RTCRtpReceiver}function ZF(n,e){var t;n===void 0&&(n={}),e===void 0&&(e={});const r=[...Object.keys(e),...Object.keys(n)],i={};for(const A of r)n[A]!==e[A]&&(i[A]=(t=e[A])!==null&&t!==void 0?t:"");return i}function o0(n){const e=Object.assign({},n);let t,r;return typeof e.audio=="object"&&e.audio.processor&&(t=e.audio.processor,e.audio=Object.assign(Object.assign({},e.audio),{processor:void 0})),typeof e.video=="object"&&e.video.processor&&(r=e.video.processor,e.video=Object.assign(Object.assign({},e.video),{processor:void 0})),{audioProcessor:t,videoProcessor:r,optionsWithoutProcessor:bF(e)}}function $F(n){switch(n){case at.CAMERA:return P.Source.Camera;case at.MICROPHONE:return P.Source.Microphone;case at.SCREEN_SHARE:return P.Source.ScreenShare;case at.SCREEN_SHARE_AUDIO:return P.Source.ScreenShareAudio;default:return P.Source.Unknown}}class ex extends Sn.EventEmitter{constructor(e){super(),this.onWorkerMessage=t=>{var r,i;const{kind:A,data:s}=t.data;switch(A){case"error":ue.error(s.error.message),this.emit(dr.EncryptionError,s.error);break;case"initAck":s.enabled&&this.keyProvider.getKeys().forEach(o=>{this.postKey(o)});break;case"enable":if(s.enabled&&this.keyProvider.getKeys().forEach(o=>{this.postKey(o)}),this.encryptionEnabled!==s.enabled&&s.participantIdentity===((r=this.room)===null||r===void 0?void 0:r.localParticipant.identity))this.emit(dr.ParticipantEncryptionStatusChanged,s.enabled,this.room.localParticipant),this.encryptionEnabled=s.enabled;else if(s.participantIdentity){const o=(i=this.room)===null||i===void 0?void 0:i.getParticipantByIdentity(s.participantIdentity);if(!o)throw TypeError("couldn't set encryption status, participant not found".concat(s.participantIdentity));this.emit(dr.ParticipantEncryptionStatusChanged,s.enabled,o)}break;case"ratchetKey":this.keyProvider.emit(lr.KeyRatcheted,s.ratchetResult,s.participantIdentity,s.keyIndex);break}},this.onWorkerError=t=>{ue.error("e2ee worker encountered an error:",{error:t.error}),this.emit(dr.EncryptionError,t.error)},this.keyProvider=e.keyProvider,this.worker=e.worker,this.encryptionEnabled=!1}setup(e){if(!vF())throw new Bl("tried to setup end-to-end encryption on an unsupported browser");if(ue.info("setting up e2ee"),e!==this.room){this.room=e,this.setupEventListeners(e,this.keyProvider);const t={kind:"init",data:{keyProviderOptions:this.keyProvider.getOptions(),loglevel:rF.getLevel()}};this.worker&&(ue.info("initializing worker",{worker:this.worker}),this.worker.onmessage=this.onWorkerMessage,this.worker.onerror=this.onWorkerError,this.worker.postMessage(t))}}setParticipantCryptorEnabled(e,t){ue.debug("set e2ee to ".concat(e," for participant ").concat(t)),this.postEnable(e,t)}setSifTrailer(e){!e||e.length===0?ue.warn("ignoring server sent trailer as it's empty"):this.postSifTrailer(e)}setupEngine(e){e.on(D.RTPVideoMapUpdate,t=>{this.postRTPMap(t)})}setupEventListeners(e,t){e.on(O.TrackPublished,(r,i)=>this.setParticipantCryptorEnabled(r.trackInfo.encryption!==Wt.NONE,i.identity)),e.on(O.ConnectionStateChanged,r=>{r===fe.Connected&&e.remoteParticipants.forEach(i=>{i.trackPublications.forEach(A=>{this.setParticipantCryptorEnabled(A.trackInfo.encryption!==Wt.NONE,i.identity)})})}).on(O.TrackUnsubscribed,(r,i,A)=>{var s;const o={kind:"removeTransform",data:{participantIdentity:A.identity,trackId:r.mediaStreamID}};(s=this.worker)===null||s===void 0||s.postMessage(o)}).on(O.TrackSubscribed,(r,i,A)=>{this.setupE2EEReceiver(r,A.identity,i.trackInfo)}).on(O.SignalConnected,()=>{if(!this.room)throw new TypeError("expected room to be present on signal connect");t.getKeys().forEach(r=>{this.postKey(r)}),this.setParticipantCryptorEnabled(this.room.localParticipant.isE2EEEnabled,this.room.localParticipant.identity)}),e.localParticipant.on(K.LocalTrackPublished,r=>S(this,void 0,void 0,function*(){this.setupE2EESender(r.track,r.track.sender)})),t.on(lr.SetKey,r=>this.postKey(r)).on(lr.RatchetRequest,(r,i)=>this.postRatchetRequest(r,i))}postRatchetRequest(e,t){if(!this.worker)throw Error("could not ratchet key, worker is missing");const r={kind:"ratchetRequest",data:{participantIdentity:e,keyIndex:t}};this.worker.postMessage(r)}postKey(e){let{key:t,participantIdentity:r,keyIndex:i}=e;var A;if(!this.worker)throw Error("could not set key, worker is missing");const s={kind:"setKey",data:{participantIdentity:r,isPublisher:r===((A=this.room)===null||A===void 0?void 0:A.localParticipant.identity),key:t,keyIndex:i}};this.worker.postMessage(s)}postEnable(e,t){if(this.worker){const r={kind:"enable",data:{enabled:e,participantIdentity:t}};this.worker.postMessage(r)}else throw new ReferenceError("failed to enable e2ee, worker is not ready")}postRTPMap(e){var t;if(!this.worker)throw TypeError("could not post rtp map, worker is missing");if(!(!((t=this.room)===null||t===void 0)&&t.localParticipant.identity))throw TypeError("could not post rtp map, local participant identity is missing");const r={kind:"setRTPMap",data:{map:e,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(r)}postSifTrailer(e){if(!this.worker)throw Error("could not post SIF trailer, worker is missing");const t={kind:"setSifTrailer",data:{trailer:e}};this.worker.postMessage(t)}setupE2EEReceiver(e,t,r){if(e.receiver){if(!(r!=null&&r.mimeType)||r.mimeType==="")throw new TypeError("MimeType missing from trackInfo, cannot set up E2EE cryptor");this.handleReceiver(e.receiver,e.mediaStreamID,t,e.kind==="video"?Aa(r.mimeType):void 0)}}setupE2EESender(e,t){if(!Ri(e)||!t){t||ue.warn("early return because sender is not ready");return}this.handleSender(t,e.mediaStreamID,void 0)}handleReceiver(e,t,r,i){return S(this,void 0,void 0,function*(){if(this.worker){if(bl()){const A={kind:"decode",participantIdentity:r,trackId:t,codec:i};e.transform=new RTCRtpScriptTransform(this.worker,A)}else{if(ta in e&&i){const a={kind:"updateCodec",data:{trackId:t,codec:i,participantIdentity:r}};this.worker.postMessage(a);return}let A=e.writableStream,s=e.readableStream;if(!A||!s){const a=e.createEncodedStreams();e.writableStream=a.writable,A=a.writable,e.readableStream=a.readable,s=a.readable}const o={kind:"decode",data:{readableStream:s,writableStream:A,trackId:t,codec:i,participantIdentity:r}};this.worker.postMessage(o,[s,A])}e[ta]=!0}})}handleSender(e,t,r){var i;if(!(ta in e||!this.worker)){if(!(!((i=this.room)===null||i===void 0)&&i.localParticipant.identity)||this.room.localParticipant.identity==="")throw TypeError("local identity needs to be known in order to set up encrypted sender");if(bl()){ue.info("initialize script transform");const A={kind:"encode",participantIdentity:this.room.localParticipant.identity,trackId:t,codec:r};e.transform=new RTCRtpScriptTransform(this.worker,A)}else{ue.info("initialize encoded streams");const A=e.createEncodedStreams(),s={kind:"encode",data:{readableStream:A.readable,writableStream:A.writable,codec:r,trackId:t,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(s,[A.readable,A.writable])}e[ta]=!0}}}const Vl="default";class ft{constructor(){this._previousDevices=[]}static getInstance(){return this.instance===void 0&&(this.instance=new ft),this.instance}get previousDevices(){return this._previousDevices}getDevices(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var A;if(((A=ft.userMediaPromiseMap)===null||A===void 0?void 0:A.size)>0){ue.debug("awaiting getUserMedia promise");try{t?yield ft.userMediaPromiseMap.get(t):yield Promise.all(ft.userMediaPromiseMap.values())}catch{ue.warn("error waiting for media permissons")}}let s=yield navigator.mediaDevices.enumerateDevices();if(i&&!(pr()&&r.hasDeviceInUse(t))&&(s.filter(a=>a.kind===t).length===0||s.some(a=>{const c=a.label==="",u=t?a.kind===t:!0;return c&&u}))){const a={video:t!=="audioinput"&&t!=="audiooutput",audio:t!=="videoinput"&&{deviceId:{ideal:"default"}}},c=yield navigator.mediaDevices.getUserMedia(a);s=yield navigator.mediaDevices.enumerateDevices(),c.getTracks().forEach(u=>{u.stop()})}return r._previousDevices=s,t&&(s=s.filter(o=>o.kind===t)),s}()})}normalizeDeviceId(e,t,r){return S(this,void 0,void 0,function*(){if(t!==Vl)return t;const i=yield this.getDevices(e),A=i.find(o=>o.deviceId===Vl);if(!A){ue.warn("could not reliably determine default device");return}const s=i.find(o=>o.deviceId!==Vl&&o.groupId===(r??A.groupId));if(!s){ue.warn("could not reliably determine default device");return}return s==null?void 0:s.deviceId})}hasDeviceInUse(e){return e?ft.userMediaPromiseMap.has(e):ft.userMediaPromiseMap.size>0}}ft.mediaDeviceKinds=["audioinput","audiooutput","videoinput"],ft.userMediaPromiseMap=new Map;var GA;(function(n){n[n.WAITING=0]="WAITING",n[n.RUNNING=1]="RUNNING",n[n.COMPLETED=2]="COMPLETED"})(GA||(GA={}));class tx{constructor(){this.pendingTasks=new Map,this.taskMutex=new Mt,this.nextTaskIndex=0}run(e){return S(this,void 0,void 0,function*(){const t={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:GA.WAITING};this.pendingTasks.set(t.id,t);const r=yield this.taskMutex.lock();try{return t.executedAt=Date.now(),t.status=GA.RUNNING,yield e()}finally{t.status=GA.COMPLETED,this.pendingTasks.delete(t.id),r()}})}flush(){return S(this,void 0,void 0,function*(){return this.run(()=>S(this,void 0,void 0,function*(){}))})}snapshot(){return Array.from(this.pendingTasks.values())}}function nx(n,e){const t=new URL(KF(n));return e.forEach((r,i)=>{t.searchParams.set(i,r)}),a0(t,"rtc")}function rx(n){const e=new URL(Ll(n));return a0(e,"validate")}function ix(n){return n.endsWith("/")?n:"".concat(n,"/")}function a0(n,e){return n.pathname="".concat(ix(n.pathname)).concat(e),n.toString()}const Ax=["syncState","trickle","offer","answer","simulate","leave"];function sx(n){const e=Ax.indexOf(n.case)>=0;return ue.trace("request allowed to bypass queue:",{canPass:e,req:n}),e}var Oe;(function(n){n[n.CONNECTING=0]="CONNECTING",n[n.CONNECTED=1]="CONNECTED",n[n.RECONNECTING=2]="RECONNECTING",n[n.DISCONNECTING=3]="DISCONNECTING",n[n.DISCONNECTED=4]="DISCONNECTED"})(Oe||(Oe={}));class Gl{get currentState(){return this.state}get isDisconnected(){return this.state===Oe.DISCONNECTING||this.state===Oe.DISCONNECTED}get isEstablishingConnection(){return this.state===Oe.CONNECTING||this.state===Oe.RECONNECTING}getNextRequestId(){return this._requestId+=1,this._requestId}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r;this.rtt=0,this.state=Oe.DISCONNECTED,this.log=ue,this._requestId=0,this.resetCallbacks=()=>{this.onAnswer=void 0,this.onLeave=void 0,this.onLocalTrackPublished=void 0,this.onLocalTrackUnpublished=void 0,this.onNegotiateRequested=void 0,this.onOffer=void 0,this.onRemoteMuteChanged=void 0,this.onSubscribedQualityUpdate=void 0,this.onTokenRefresh=void 0,this.onTrickle=void 0,this.onClose=void 0},this.log=Ln((r=t.loggerName)!==null&&r!==void 0?r:cn.Signal),this.loggerContextCb=t.loggerContextCb,this.useJSON=e,this.requestQueue=new tx,this.queuedRequests=[],this.closingLock=new Mt,this.connectionLock=new Mt,this.state=Oe.DISCONNECTED}get logContext(){var e,t;return(t=(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this))!==null&&t!==void 0?t:{}}join(e,t,r,i){return S(this,void 0,void 0,function*(){return this.state=Oe.CONNECTING,this.options=r,yield this.connect(e,t,r,i)})}reconnect(e,t,r,i){return S(this,void 0,void 0,function*(){if(!this.options){this.log.warn("attempted to reconnect without signal options being set, ignoring",this.logContext);return}return this.state=Oe.RECONNECTING,this.clearPingInterval(),yield this.connect(e,t,Object.assign(Object.assign({},this.options),{reconnect:!0,sid:r,reconnectReason:i}))})}connect(e,t,r,i){this.connectOptions=r;const A=NF(),s=ox(t,A,r),o=nx(e,s),a=rx(o);return new Promise((c,u)=>S(this,void 0,void 0,function*(){const l=yield this.connectionLock.lock();try{const d=()=>S(this,void 0,void 0,function*(){this.close(),clearTimeout(h),u(new Fe("room connection has been cancelled (signal)",de.Cancelled))}),h=setTimeout(()=>{this.close(),u(new Fe("room connection has timed out (signal)",de.ServerUnreachable))},r.websocketTimeout);i!=null&&i.aborted&&d(),i==null||i.addEventListener("abort",d);const f=new URL(o);f.searchParams.has("access_token")&&f.searchParams.set("access_token","<redacted>"),this.log.debug("connecting to ".concat(f),Object.assign({reconnect:r.reconnect,reconnectReason:r.reconnectReason},this.logContext)),this.ws&&(yield this.close(!1)),this.ws=new WebSocket(o),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{clearTimeout(h)},this.ws.onerror=p=>S(this,void 0,void 0,function*(){if(this.state!==Oe.CONNECTED){this.state=Oe.DISCONNECTED,clearTimeout(h);try{const g=yield fetch(a);if(g.status.toFixed(0).startsWith("4")){const v=yield g.text();u(new Fe(v,de.NotAllowed,g.status))}else u(new Fe("Encountered unknown websocket error during connection: ".concat(p.toString()),de.InternalError,g.status))}catch(g){u(new Fe(g instanceof Error?g.message:"server was not reachable",de.ServerUnreachable))}return}this.handleWSError(p)}),this.ws.onmessage=p=>S(this,void 0,void 0,function*(){var g,v,y;let B;if(typeof p.data=="string"){const b=JSON.parse(p.data);B=Gm.fromJson(b,{ignoreUnknownFields:!0})}else if(p.data instanceof ArrayBuffer)B=Gm.fromBinary(new Uint8Array(p.data));else{this.log.error("could not decode websocket message: ".concat(typeof p.data),this.logContext);return}if(this.state!==Oe.CONNECTED){let b=!1;if(((g=B.message)===null||g===void 0?void 0:g.case)==="join"?(this.state=Oe.CONNECTED,i==null||i.removeEventListener("abort",d),this.pingTimeoutDuration=B.message.value.pingTimeout,this.pingIntervalDuration=B.message.value.pingInterval,this.pingTimeoutDuration&&this.pingTimeoutDuration>0&&(this.log.debug("ping config",Object.assign(Object.assign({},this.logContext),{timeout:this.pingTimeoutDuration,interval:this.pingIntervalDuration})),this.startPingInterval()),c(B.message.value)):this.state===Oe.RECONNECTING&&B.message.case!=="leave"?(this.state=Oe.CONNECTED,i==null||i.removeEventListener("abort",d),this.startPingInterval(),((v=B.message)===null||v===void 0?void 0:v.case)==="reconnect"?c(B.message.value):(this.log.debug("declaring signal reconnected without reconnect response received",this.logContext),c(void 0),b=!0)):this.isEstablishingConnection&&B.message.case==="leave"?u(new Fe("Received leave request while trying to (re)connect",de.LeaveRequest,void 0,B.message.value.reason)):r.reconnect||u(new Fe("did not receive join response, got ".concat((y=B.message)===null||y===void 0?void 0:y.case," instead"),de.InternalError)),!b)return}this.signalLatency&&(yield Nt(this.signalLatency)),this.handleSignalResponse(B)}),this.ws.onclose=p=>{this.isEstablishingConnection&&u(new Fe("Websocket got closed during a (re)connection attempt",de.InternalError)),this.log.warn("websocket closed",Object.assign(Object.assign({},this.logContext),{reason:p.reason,code:p.code,wasClean:p.wasClean,state:this.state})),this.handleOnClose(p.reason)}}finally{l()}}))}close(){return S(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){const r=yield e.closingLock.lock();try{if(e.clearPingInterval(),t&&(e.state=Oe.DISCONNECTING),e.ws){e.ws.onmessage=null,e.ws.onopen=null,e.ws.onclose=null;const i=new Promise(A=>{e.ws?e.ws.onclose=()=>{A()}:A()});e.ws.readyState<e.ws.CLOSING&&(e.ws.close(),yield Promise.race([i,Nt(250)])),e.ws=void 0}}finally{t&&(e.state=Oe.DISCONNECTED),r()}}()})}sendOffer(e){this.log.debug("sending offer",Object.assign(Object.assign({},this.logContext),{offerSdp:e.sdp})),this.sendRequest({case:"offer",value:sa(e)})}sendAnswer(e){return this.log.debug("sending answer",Object.assign(Object.assign({},this.logContext),{answerSdp:e.sdp})),this.sendRequest({case:"answer",value:sa(e)})}sendIceCandidate(e,t){return this.log.debug("sending ice candidate",Object.assign(Object.assign({},this.logContext),{candidate:e})),this.sendRequest({case:"trickle",value:new ol({candidateInit:JSON.stringify(e),target:t})})}sendMuteTrack(e,t){return this.sendRequest({case:"mute",value:new al({sid:e,muted:t})})}sendAddTrack(e){return this.sendRequest({case:"addTrack",value:e})}sendUpdateLocalMetadata(e,t){return S(this,arguments,void 0,function(r,i){var A=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){const o=A.getNextRequestId();return yield A.sendRequest({case:"updateMetadata",value:new Jm({requestId:o,metadata:r,name:i,attributes:s})}),o}()})}sendUpdateTrackSettings(e){this.sendRequest({case:"trackSetting",value:e})}sendUpdateSubscription(e){return this.sendRequest({case:"subscription",value:e})}sendSyncState(e){return this.sendRequest({case:"syncState",value:e})}sendUpdateVideoLayers(e,t){return this.sendRequest({case:"updateLayers",value:new qm({trackSid:e,layers:t})})}sendUpdateSubscriptionPermissions(e,t){return this.sendRequest({case:"subscriptionPermission",value:new Ym({allParticipants:e,trackPermissions:t})})}sendSimulateScenario(e){return this.sendRequest({case:"simulate",value:e})}sendPing(){return Promise.all([this.sendRequest({case:"ping",value:Ke.parse(Date.now())}),this.sendRequest({case:"pingReq",value:new ev({timestamp:Ke.parse(Date.now()),rtt:Ke.parse(this.rtt)})})])}sendUpdateLocalAudioTrack(e,t){return this.sendRequest({case:"updateAudioTrack",value:new Wm({trackSid:e,features:t})})}sendLeave(){return this.sendRequest({case:"leave",value:new jo({reason:sn.CLIENT_INITIATED,action:Ti.DISCONNECT})})}sendRequest(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return function*(){if(!i&&!sx(t)&&r.state===Oe.RECONNECTING){r.queuedRequests.push(()=>S(r,void 0,void 0,function*(){yield this.sendRequest(t,!0)}));return}if(i||(yield r.requestQueue.flush()),r.signalLatency&&(yield Nt(r.signalLatency)),!r.ws||r.ws.readyState!==r.ws.OPEN){r.log.error("cannot send signal request before connected, type: ".concat(t==null?void 0:t.case),r.logContext);return}const s=new xI({message:t});try{r.useJSON?r.ws.send(s.toJsonString()):r.ws.send(s.toBinary())}catch(o){r.log.error("error sending signal message",Object.assign(Object.assign({},r.logContext),{error:o}))}}()})}handleSignalResponse(e){var t,r;const i=e.message;if(i==null){this.log.debug("received unsupported message",this.logContext);return}let A=!1;if(i.case==="answer"){const s=c0(i.value);this.onAnswer&&this.onAnswer(s)}else if(i.case==="offer"){const s=c0(i.value);this.onOffer&&this.onOffer(s)}else if(i.case==="trickle"){const s=JSON.parse(i.value.candidateInit);this.onTrickle&&this.onTrickle(s,i.value.target)}else i.case==="update"?this.onParticipantUpdate&&this.onParticipantUpdate((t=i.value.participants)!==null&&t!==void 0?t:[]):i.case==="trackPublished"?this.onLocalTrackPublished&&this.onLocalTrackPublished(i.value):i.case==="speakersChanged"?this.onSpeakersChanged&&this.onSpeakersChanged((r=i.value.speakers)!==null&&r!==void 0?r:[]):i.case==="leave"?this.onLeave&&this.onLeave(i.value):i.case==="mute"?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(i.value.sid,i.value.muted):i.case==="roomUpdate"?this.onRoomUpdate&&i.value.room&&this.onRoomUpdate(i.value.room):i.case==="connectionQuality"?this.onConnectionQuality&&this.onConnectionQuality(i.value):i.case==="streamStateUpdate"?this.onStreamStateUpdate&&this.onStreamStateUpdate(i.value):i.case==="subscribedQualityUpdate"?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(i.value):i.case==="subscriptionPermissionUpdate"?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(i.value):i.case==="refreshToken"?this.onTokenRefresh&&this.onTokenRefresh(i.value):i.case==="trackUnpublished"?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(i.value):i.case==="subscriptionResponse"?this.onSubscriptionError&&this.onSubscriptionError(i.value):i.case==="pong"||(i.case==="pongResp"?(this.rtt=Date.now()-Number.parseInt(i.value.lastPingTimestamp.toString()),this.resetPingTimeout(),A=!0):i.case==="requestResponse"?this.onRequestResponse&&this.onRequestResponse(i.value):i.case==="trackSubscribed"?this.onLocalTrackSubscribed&&this.onLocalTrackSubscribed(i.value.trackSid):i.case==="roomMoved"?(this.onTokenRefresh&&this.onTokenRefresh(i.value.token),this.onRoomMoved&&this.onRoomMoved(i.value)):this.log.debug("unsupported message",Object.assign(Object.assign({},this.logContext),{msgCase:i.case})));A||this.resetPingTimeout()}setReconnected(){for(;this.queuedRequests.length>0;){const e=this.queuedRequests.shift();e&&this.requestQueue.run(e)}}handleOnClose(e){return S(this,void 0,void 0,function*(){if(this.state===Oe.DISCONNECTED)return;const t=this.onClose;yield this.close(),this.log.debug("websocket connection closed: ".concat(e),Object.assign(Object.assign({},this.logContext),{reason:e})),t&&t(e)})}handleWSError(e){this.log.error("websocket error",Object.assign(Object.assign({},this.logContext),{error:e}))}resetPingTimeout(){if(this.clearPingTimeout(),!this.pingTimeoutDuration){this.log.warn("ping timeout duration not set",this.logContext);return}this.pingTimeout=wt.setTimeout(()=>{this.log.warn("ping timeout triggered. last pong received at: ".concat(new Date(Date.now()-this.pingTimeoutDuration*1e3).toUTCString()),this.logContext),this.handleOnClose("ping timeout")},this.pingTimeoutDuration*1e3)}clearPingTimeout(){this.pingTimeout&&wt.clearTimeout(this.pingTimeout)}startPingInterval(){if(this.clearPingInterval(),this.resetPingTimeout(),!this.pingIntervalDuration){this.log.warn("ping interval duration not set",this.logContext);return}this.log.debug("start ping interval",this.logContext),this.pingInterval=wt.setInterval(()=>{this.sendPing()},this.pingIntervalDuration*1e3)}clearPingInterval(){this.log.debug("clearing ping interval",this.logContext),this.clearPingTimeout(),this.pingInterval&&wt.clearInterval(this.pingInterval)}}function c0(n){const e={type:"offer",sdp:n.sdp};switch(n.type){case"answer":case"offer":case"pranswer":case"rollback":e.type=n.type;break}return e}function sa(n){return new Gr({sdp:n.sdp,type:n.type})}function ox(n,e,t){var r;const i=new URLSearchParams;return i.set("access_token",n),t.reconnect&&(i.set("reconnect","1"),t.sid&&i.set("sid",t.sid)),i.set("auto_subscribe",t.autoSubscribe?"1":"0"),i.set("sdk",kn()?"reactnative":"js"),i.set("version",e.version),i.set("protocol",e.protocol.toString()),e.deviceModel&&i.set("device_model",e.deviceModel),e.os&&i.set("os",e.os),e.osVersion&&i.set("os_version",e.osVersion),e.browser&&i.set("browser",e.browser),e.browserVersion&&i.set("browser_version",e.browserVersion),t.adaptiveStream&&i.set("adaptive_stream","1"),t.reconnectReason&&i.set("reconnect_reason",t.reconnectReason.toString()),!((r=navigator.connection)===null||r===void 0)&&r.type&&i.set("network",navigator.connection.type),i}var ln={},jl={},Wl={exports:{}},u0;function ql(){if(u0)return Wl.exports;u0=1;var n=Wl.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return e.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return e.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return e.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=e.raddr!=null?" raddr %s rport %d":"%v%v",t+=e.tcptype!=null?" tcptype %s":"%v",e.generation!=null&&(t+=" generation %d"),t+=e["network-id"]!=null?" network-id %d":"%v",t+=e["network-cost"]!=null?" network-cost %d":"%v",t}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return e.attribute!=null&&(t+=" %s",e.value!=null&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return e.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(e.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=e.id!=null?"id=%s %s":"%v%s",t+=e.mediaClockValue!=null?"=%s":"",t+=e.rateNumerator!=null?" rate=%s":"",t+=e.rateDenominator!=null?"/%s":"",t}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(n).forEach(function(e){var t=n[e];t.forEach(function(r){r.reg||(r.reg=/(.*)/),r.format||(r.format="%s")})}),Wl.exports}var l0;function ax(){return l0||(l0=1,function(n){var e=function(o){return String(Number(o))===o?Number(o):o},t=function(o,a,c,u){if(u&&!c)a[u]=e(o[1]);else for(var l=0;l<c.length;l+=1)o[l+1]!=null&&(a[c[l]]=e(o[l+1]))},r=function(o,a,c){var u=o.name&&o.names;o.push&&!a[o.push]?a[o.push]=[]:u&&!a[o.name]&&(a[o.name]={});var l=o.push?{}:u?a[o.name]:a;t(c.match(o.reg),l,o.names,o.name),o.push&&a[o.push].push(l)},i=ql(),A=RegExp.prototype.test.bind(/^([a-z])=(.*)/);n.parse=function(o){var a={},c=[],u=a;return o.split(/(\r\n|\r|\n)/).filter(A).forEach(function(l){var d=l[0],h=l.slice(2);d==="m"&&(c.push({rtp:[],fmtp:[]}),u=c[c.length-1]);for(var f=0;f<(i[d]||[]).length;f+=1){var p=i[d][f];if(p.reg.test(h))return r(p,u,h)}}),a.media=c,a};var s=function(o,a){var c=a.split(/=(.+)/,2);return c.length===2?o[c[0]]=e(c[1]):c.length===1&&a.length>1&&(o[c[0]]=void 0),o};n.parseParams=function(o){return o.split(/;\s?/).reduce(s,{})},n.parseFmtpConfig=n.parseParams,n.parsePayloads=function(o){return o.toString().split(" ").map(Number)},n.parseRemoteCandidates=function(o){for(var a=[],c=o.split(" ").map(e),u=0;u<c.length;u+=3)a.push({component:c[u],ip:c[u+1],port:c[u+2]});return a},n.parseImageAttributes=function(o){return o.split(" ").map(function(a){return a.substring(1,a.length-1).split(",").reduce(s,{})})},n.parseSimulcastStreamList=function(o){return o.split(";").map(function(a){return a.split(",").map(function(c){var u,l=!1;return c[0]!=="~"?u=e(c):(u=e(c.substring(1,c.length)),l=!0),{scid:u,paused:l}})})}}(jl)),jl}var Jl,d0;function cx(){if(d0)return Jl;d0=1;var n=ql(),e=/%[sdv%]/g,t=function(s){var o=1,a=arguments,c=a.length;return s.replace(e,function(u){if(o>=c)return u;var l=a[o];switch(o+=1,u){case"%%":return"%";case"%s":return String(l);case"%d":return Number(l);case"%v":return""}})},r=function(s,o,a){var c=o.format instanceof Function?o.format(o.push?a:a[o.name]):o.format,u=[s+"="+c];if(o.names)for(var l=0;l<o.names.length;l+=1){var d=o.names[l];o.name?u.push(a[o.name][d]):u.push(a[o.names[l]])}else u.push(a[o.name]);return t.apply(null,u)},i=["v","o","s","i","u","e","p","c","b","t","r","z","a"],A=["i","c","b","a"];return Jl=function(s,o){o=o||{},s.version==null&&(s.version=0),s.name==null&&(s.name=" "),s.media.forEach(function(l){l.payloads==null&&(l.payloads="")});var a=o.outerOrder||i,c=o.innerOrder||A,u=[];return a.forEach(function(l){n[l].forEach(function(d){d.name in s&&s[d.name]!=null?u.push(r(l,d,s)):d.push in s&&s[d.push]!=null&&s[d.push].forEach(function(h){u.push(r(l,d,h))})})}),s.media.forEach(function(l){u.push(r("m",n.m[0],l)),c.forEach(function(d){n[d].forEach(function(h){h.name in l&&l[h.name]!=null?u.push(r(d,h,l)):h.push in l&&l[h.push]!=null&&l[h.push].forEach(function(f){u.push(r(d,h,f))})})})}),u.join(`\r
41
41
  `)+`\r
42
- `},Jl}var h0;function ux(){if(h0)return ln;h0=1;var n=ax(),e=cx(),t=ql();return ln.grammar=t,ln.write=e,ln.parse=n.parse,ln.parseParams=n.parseParams,ln.parseFmtpConfig=n.parseFmtpConfig,ln.parsePayloads=n.parsePayloads,ln.parseRemoteCandidates=n.parseRemoteCandidates,ln.parseImageAttributes=n.parseImageAttributes,ln.parseSimulcastStreamList=n.parseSimulcastStreamList,ln}var mr=ux();function zl(n,e,t){var r,i,A;e===void 0&&(e=50),t===void 0&&(t={});var s=(r=t.isImmediate)!=null&&r,o=(i=t.callback)!=null&&i,a=t.maxWait,c=Date.now(),u=[];function l(){if(a!==void 0){var h=Date.now()-c;if(h+e>=a)return a-h}return e}var d=function(){var h=[].slice.call(arguments),f=this;return new Promise(function(p,g){var v=s&&A===void 0;if(A!==void 0&&clearTimeout(A),A=setTimeout(function(){if(A=void 0,c=Date.now(),!s){var B=n.apply(f,h);o&&o(B),u.forEach(function(b){return(0,b.resolve)(B)}),u=[]}},l()),v){var y=n.apply(f,h);return o&&o(y),p(y)}u.push({resolve:p,reject:g})})};return d.cancel=function(h){A!==void 0&&clearTimeout(A),u.forEach(function(f){return(0,f.reject)(h)}),u=[]},d}const lx=.7,dx=20,Oi={NegotiationStarted:"negotiationStarted",NegotiationComplete:"negotiationComplete",RTPVideoPayloadTypes:"rtpVideoPayloadTypes"};class p0 extends Sn.EventEmitter{get pc(){return this._pc||(this._pc=this.createPC()),this._pc}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r;super(),this.log=ue,this.ddExtID=0,this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate=!1,this.trackBitrates=[],this.remoteStereoMids=[],this.remoteNackMids=[],this.negotiate=zl(i=>S(this,void 0,void 0,function*(){this.emit(Oi.NegotiationStarted);try{yield this.createAndSendOffer()}catch(A){if(i)i(A);else throw A}}),dx),this.close=()=>{this._pc&&(this._pc.close(),this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.ondatachannel=null,this._pc.onnegotiationneeded=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ondatachannel=null,this._pc.ontrack=null,this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc=null)},this.log=Ln((r=t.loggerName)!==null&&r!==void 0?r:cn.PCTransport),this.loggerOptions=t,this.config=e,this._pc=this.createPC()}createPC(){const e=new RTCPeerConnection(this.config);return e.onicecandidate=t=>{var r;t.candidate&&((r=this.onIceCandidate)===null||r===void 0||r.call(this,t.candidate))},e.onicecandidateerror=t=>{var r;(r=this.onIceCandidateError)===null||r===void 0||r.call(this,t)},e.oniceconnectionstatechange=()=>{var t;(t=this.onIceConnectionStateChange)===null||t===void 0||t.call(this,e.iceConnectionState)},e.onsignalingstatechange=()=>{var t;(t=this.onSignalingStatechange)===null||t===void 0||t.call(this,e.signalingState)},e.onconnectionstatechange=()=>{var t;(t=this.onConnectionStateChange)===null||t===void 0||t.call(this,e.connectionState)},e.ondatachannel=t=>{var r;(r=this.onDataChannel)===null||r===void 0||r.call(this,t)},e.ontrack=t=>{var r;(r=this.onTrack)===null||r===void 0||r.call(this,t)},e}get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions).loggerContextCb)===null||t===void 0?void 0:t.call(e))}get isICEConnected(){return this._pc!==null&&(this.pc.iceConnectionState==="connected"||this.pc.iceConnectionState==="completed")}addIceCandidate(e){return S(this,void 0,void 0,function*(){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(e);this.pendingCandidates.push(e)})}setRemoteDescription(e){return S(this,void 0,void 0,function*(){var t;let r;if(e.type==="offer"){let{stereoMids:i,nackMids:A}=hx(e);this.remoteStereoMids=i,this.remoteNackMids=A}else if(e.type==="answer"){const i=mr.parse((t=e.sdp)!==null&&t!==void 0?t:"");i.media.forEach(A=>{A.type==="audio"&&this.trackBitrates.some(s=>{if(!s.transceiver||A.mid!=s.transceiver.mid)return!1;let o=0;if(A.rtp.some(c=>c.codec.toUpperCase()===s.codec.toUpperCase()?(o=c.payload,!0):!1),o===0)return!0;let a=!1;for(const c of A.fmtp)if(c.payload===o){c.config=c.config.split(";").filter(u=>!u.includes("maxaveragebitrate")).join(";"),s.maxbr>0&&(c.config+=";maxaveragebitrate=".concat(s.maxbr*1e3)),a=!0;break}return a||s.maxbr>0&&A.fmtp.push({payload:o,config:"maxaveragebitrate=".concat(s.maxbr*1e3)}),!0})}),r=mr.write(i)}yield this.setMungedSDP(e,r,!0),this.pendingCandidates.forEach(i=>{this.pc.addIceCandidate(i)}),this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate?(this.renegotiate=!1,yield this.createAndSendOffer()):e.type==="answer"&&(this.emit(Oi.NegotiationComplete),e.sdp&&mr.parse(e.sdp).media.forEach(A=>{A.type==="video"&&this.emit(Oi.RTPVideoPayloadTypes,A.rtp)}))})}createAndSendOffer(e){return S(this,void 0,void 0,function*(){var t;if(this.onOffer===void 0)return;if(e!=null&&e.iceRestart&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),this._pc&&this._pc.signalingState==="have-local-offer"){const A=this._pc.remoteDescription;if(e!=null&&e.iceRestart&&A)yield this._pc.setRemoteDescription(A);else{this.renegotiate=!0;return}}else if(!this._pc||this._pc.signalingState==="closed"){this.log.warn("could not createOffer with closed peer connection",this.logContext);return}this.log.debug("starting to negotiate",this.logContext);const r=yield this.pc.createOffer(e);this.log.debug("original offer",Object.assign({sdp:r.sdp},this.logContext));const i=mr.parse((t=r.sdp)!==null&&t!==void 0?t:"");i.media.forEach(A=>{g0(A),A.type==="audio"?f0(A,[],[]):A.type==="video"&&this.trackBitrates.some(s=>{if(!A.msid||!s.cid||!A.msid.includes(s.cid))return!1;let o=0;if(A.rtp.some(c=>c.codec.toUpperCase()===s.codec.toUpperCase()?(o=c.payload,!0):!1),o===0||(KA(s.codec)&&this.ensureVideoDDExtensionForSVC(A,i),s.codec!=="av1"))return!0;const a=Math.round(s.maxbr*lx);for(const c of A.fmtp)if(c.payload===o){c.config.includes("x-google-start-bitrate")||(c.config+=";x-google-start-bitrate=".concat(a));break}return!0})}),yield this.setMungedSDP(r,mr.write(i)),this.onOffer(r)})}createAndSetAnswer(){return S(this,void 0,void 0,function*(){var e;const t=yield this.pc.createAnswer(),r=mr.parse((e=t.sdp)!==null&&e!==void 0?e:"");return r.media.forEach(i=>{g0(i),i.type==="audio"&&f0(i,this.remoteStereoMids,this.remoteNackMids)}),yield this.setMungedSDP(t,mr.write(r)),t})}createDataChannel(e,t){return this.pc.createDataChannel(e,t)}addTransceiver(e,t){return this.pc.addTransceiver(e,t)}addTrack(e){if(!this._pc)throw new lt("PC closed, cannot add track");return this._pc.addTrack(e)}setTrackCodecBitrate(e){this.trackBitrates.push(e)}setConfiguration(e){var t;if(!this._pc)throw new lt("PC closed, cannot configure");return(t=this._pc)===null||t===void 0?void 0:t.setConfiguration(e)}canRemoveTrack(){var e;return!!(!((e=this._pc)===null||e===void 0)&&e.removeTrack)}removeTrack(e){var t;return(t=this._pc)===null||t===void 0?void 0:t.removeTrack(e)}getConnectionState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.connectionState)!==null&&t!==void 0?t:"closed"}getICEConnectionState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.iceConnectionState)!==null&&t!==void 0?t:"closed"}getSignallingState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.signalingState)!==null&&t!==void 0?t:"closed"}getTransceivers(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.getTransceivers())!==null&&t!==void 0?t:[]}getSenders(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.getSenders())!==null&&t!==void 0?t:[]}getLocalDescription(){var e;return(e=this._pc)===null||e===void 0?void 0:e.localDescription}getRemoteDescription(){var e;return(e=this.pc)===null||e===void 0?void 0:e.remoteDescription}getStats(){return this.pc.getStats()}getConnectedAddress(){return S(this,void 0,void 0,function*(){var e;if(!this._pc)return;let t="";const r=new Map,i=new Map;if((yield this._pc.getStats()).forEach(o=>{switch(o.type){case"transport":t=o.selectedCandidatePairId;break;case"candidate-pair":t===""&&o.selected&&(t=o.id),r.set(o.id,o);break;case"remote-candidate":i.set(o.id,"".concat(o.address,":").concat(o.port));break}}),t==="")return;const s=(e=r.get(t))===null||e===void 0?void 0:e.remoteCandidateId;if(s!==void 0)return i.get(s)})}setMungedSDP(e,t,r){return S(this,void 0,void 0,function*(){if(t){const i=e.sdp;e.sdp=t;try{this.log.debug("setting munged ".concat(r?"remote":"local"," description"),this.logContext),r?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e);return}catch(A){this.log.warn("not able to set ".concat(e.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:A,sdp:t})),e.sdp=i}}try{r?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e)}catch(i){let A="unknown error";i instanceof Error?A=i.message:typeof i=="string"&&(A=i);const s={error:A,sdp:e.sdp};throw!r&&this.pc.remoteDescription&&(s.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(e.type),Object.assign(Object.assign({},this.logContext),{fields:s})),new Cl(A)}})}ensureVideoDDExtensionForSVC(e,t){var r,i;if(!((r=e.ext)===null||r===void 0?void 0:r.some(s=>s.uri===Jv))){if(this.ddExtID===0){let s=0;t.media.forEach(o=>{var a;o.type==="video"&&((a=o.ext)===null||a===void 0||a.forEach(c=>{c.value>s&&(s=c.value)}))}),this.ddExtID=s+1}(i=e.ext)===null||i===void 0||i.push({value:this.ddExtID,uri:Jv})}}}function f0(n,e,t){let r=0;n.rtp.some(i=>i.codec==="opus"?(r=i.payload,!0):!1),r>0&&(n.rtcpFb||(n.rtcpFb=[]),t.includes(n.mid)&&!n.rtcpFb.some(i=>i.payload===r&&i.type==="nack")&&n.rtcpFb.push({payload:r,type:"nack"}),e.includes(n.mid)&&n.fmtp.some(i=>i.payload===r?(i.config.includes("stereo=1")||(i.config+=";stereo=1"),!0):!1))}function hx(n){var e;const t=[],r=[],i=mr.parse((e=n.sdp)!==null&&e!==void 0?e:"");let A=0;return i.media.forEach(s=>{var o;s.type==="audio"&&(s.rtp.some(a=>a.codec==="opus"?(A=a.payload,!0):!1),!((o=s.rtcpFb)===null||o===void 0)&&o.some(a=>a.payload===A&&a.type==="nack")&&r.push(s.mid),s.fmtp.some(a=>a.payload===A?(a.config.includes("sprop-stereo=1")&&t.push(s.mid),!0):!1))}),{stereoMids:t,nackMids:r}}function g0(n){if(n.connection){const e=n.connection.ip.indexOf(":")>=0;(n.connection.version===4&&e||n.connection.version===6&&!e)&&(n.connection.ip="0.0.0.0",n.connection.version=4)}}const Xl="vp8",px={audioPreset:El.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:Tl.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:Xl,backupCodec:!0},m0={deviceId:{ideal:"default"},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},v0={deviceId:{ideal:"default"},resolution:HA.h720.resolution},fx={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new AF,disconnectOnPageLeave:!0,webAudioMix:!1},Yl={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};var Ye;(function(n){n[n.NEW=0]="NEW",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED",n[n.FAILED=3]="FAILED",n[n.CLOSING=4]="CLOSING",n[n.CLOSED=5]="CLOSED"})(Ye||(Ye={}));class gx{get needsPublisher(){return this.isPublisherConnectionRequired}get needsSubscriber(){return this.isSubscriberConnectionRequired}get currentState(){return this.state}constructor(e,t,r){var i;this.peerConnectionTimeout=Yl.peerConnectionTimeout,this.log=ue,this.updateState=()=>{var A;const s=this.state,o=this.requiredTransports.map(a=>a.getConnectionState());o.every(a=>a==="connected")?this.state=Ye.CONNECTED:o.some(a=>a==="failed")?this.state=Ye.FAILED:o.some(a=>a==="connecting")?this.state=Ye.CONNECTING:o.every(a=>a==="closed")?this.state=Ye.CLOSED:o.some(a=>a==="closed")?this.state=Ye.CLOSING:o.every(a=>a==="new")&&(this.state=Ye.NEW),s!==this.state&&(this.log.debug("pc state change: from ".concat(Ye[s]," to ").concat(Ye[this.state]),this.logContext),(A=this.onStateChange)===null||A===void 0||A.call(this,this.state,this.publisher.getConnectionState(),this.subscriber.getConnectionState()))},this.log=Ln((i=r.loggerName)!==null&&i!==void 0?i:cn.PCManager),this.loggerOptions=r,this.isPublisherConnectionRequired=!t,this.isSubscriberConnectionRequired=t,this.publisher=new p0(e,r),this.subscriber=new p0(e,r),this.publisher.onConnectionStateChange=this.updateState,this.subscriber.onConnectionStateChange=this.updateState,this.publisher.onIceConnectionStateChange=this.updateState,this.subscriber.onIceConnectionStateChange=this.updateState,this.publisher.onSignalingStatechange=this.updateState,this.subscriber.onSignalingStatechange=this.updateState,this.publisher.onIceCandidate=A=>{var s;(s=this.onIceCandidate)===null||s===void 0||s.call(this,A,an.PUBLISHER)},this.subscriber.onIceCandidate=A=>{var s;(s=this.onIceCandidate)===null||s===void 0||s.call(this,A,an.SUBSCRIBER)},this.subscriber.onDataChannel=A=>{var s;(s=this.onDataChannel)===null||s===void 0||s.call(this,A)},this.subscriber.onTrack=A=>{var s;(s=this.onTrack)===null||s===void 0||s.call(this,A)},this.publisher.onOffer=A=>{var s;(s=this.onPublisherOffer)===null||s===void 0||s.call(this,A)},this.state=Ye.NEW,this.connectionLock=new Mt,this.remoteOfferLock=new Mt}get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions).loggerContextCb)===null||t===void 0?void 0:t.call(e))}requirePublisher(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isPublisherConnectionRequired=e,this.updateState()}requireSubscriber(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isSubscriberConnectionRequired=e,this.updateState()}createAndSendPublisherOffer(e){return this.publisher.createAndSendOffer(e)}setPublisherAnswer(e){return this.publisher.setRemoteDescription(e)}removeTrack(e){return this.publisher.removeTrack(e)}close(){return S(this,void 0,void 0,function*(){if(this.publisher&&this.publisher.getSignallingState()!=="closed"){const e=this.publisher;for(const t of e.getSenders())try{e.canRemoveTrack()&&e.removeTrack(t)}catch(r){this.log.warn("could not removeTrack",Object.assign(Object.assign({},this.logContext),{error:r}))}}yield Promise.all([this.publisher.close(),this.subscriber.close()]),this.updateState()})}triggerIceRestart(){return S(this,void 0,void 0,function*(){this.subscriber.restartingIce=!0,this.needsPublisher&&(yield this.createAndSendPublisherOffer({iceRestart:!0}))})}addIceCandidate(e,t){return S(this,void 0,void 0,function*(){t===an.PUBLISHER?yield this.publisher.addIceCandidate(e):yield this.subscriber.addIceCandidate(e)})}createSubscriberAnswerFromOffer(e){return S(this,void 0,void 0,function*(){this.log.debug("received server offer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type,sdp:e.sdp,signalingState:this.subscriber.getSignallingState().toString()}));const t=yield this.remoteOfferLock.lock();try{return yield this.subscriber.setRemoteDescription(e),yield this.subscriber.createAndSetAnswer()}finally{t()}})}updateConfiguration(e,t){this.publisher.setConfiguration(e),this.subscriber.setConfiguration(e),t&&this.triggerIceRestart()}ensurePCTransportConnection(e,t){return S(this,void 0,void 0,function*(){var r;const i=yield this.connectionLock.lock();try{this.isPublisherConnectionRequired&&this.publisher.getConnectionState()!=="connected"&&this.publisher.getConnectionState()!=="connecting"&&(this.log.debug("negotiation required, start negotiating",this.logContext),this.publisher.negotiate()),yield Promise.all((r=this.requiredTransports)===null||r===void 0?void 0:r.map(A=>this.ensureTransportConnected(A,e,t)))}finally{i()}})}negotiate(e){return S(this,void 0,void 0,function*(){return new Promise((t,r)=>S(this,void 0,void 0,function*(){const i=setTimeout(()=>{r("negotiation timed out")},this.peerConnectionTimeout),A=()=>{clearTimeout(i),r("negotiation aborted")};e.signal.addEventListener("abort",A),this.publisher.once(Oi.NegotiationStarted,()=>{e.signal.aborted||this.publisher.once(Oi.NegotiationComplete,()=>{clearTimeout(i),t()})}),yield this.publisher.negotiate(s=>{clearTimeout(i),r(s)})}))})}addPublisherTransceiver(e,t){return this.publisher.addTransceiver(e,t)}addPublisherTrack(e){return this.publisher.addTrack(e)}createPublisherDataChannel(e,t){return this.publisher.createDataChannel(e,t)}getConnectedAddress(e){return e===an.PUBLISHER?this.publisher.getConnectedAddress():e===an.SUBSCRIBER?this.publisher.getConnectedAddress():this.requiredTransports[0].getConnectedAddress()}get requiredTransports(){const e=[];return this.isPublisherConnectionRequired&&e.push(this.publisher),this.isSubscriberConnectionRequired&&e.push(this.subscriber),e}ensureTransportConnected(e,t){return S(this,arguments,void 0,function(r,i){var A=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.peerConnectionTimeout;return function*(){if(r.getConnectionState()!=="connected")return new Promise((a,c)=>S(A,void 0,void 0,function*(){const u=()=>{this.log.warn("abort transport connection",this.logContext),wt.clearTimeout(l),c(new Fe("room connection has been cancelled",de.Cancelled))};i!=null&&i.signal.aborted&&u(),i==null||i.signal.addEventListener("abort",u);const l=wt.setTimeout(()=>{i==null||i.signal.removeEventListener("abort",u),c(new Fe("could not establish pc connection",de.InternalError))},s);for(;this.state!==Ye.CONNECTED;)if(yield Nt(50),i!=null&&i.signal.aborted){c(new Fe("room connection has been cancelled",de.Cancelled));return}wt.clearTimeout(l),i==null||i.signal.removeEventListener("abort",u),a()}))}()})}}class Ze extends Error{constructor(e,t,r){super(t),this.code=e,this.message=w0(t,Ze.MAX_MESSAGE_BYTES),this.data=r?w0(r,Ze.MAX_DATA_BYTES):void 0}static fromProto(e){return new Ze(e.code,e.message,e.data)}toProto(){return new Pm({code:this.code,message:this.message,data:this.data})}static builtIn(e,t){return new Ze(Ze.ErrorCode[e],Ze.ErrorMessage[e],t)}}Ze.MAX_MESSAGE_BYTES=256,Ze.MAX_DATA_BYTES=15360,Ze.ErrorCode={APPLICATION_ERROR:1500,CONNECTION_TIMEOUT:1501,RESPONSE_TIMEOUT:1502,RECIPIENT_DISCONNECTED:1503,RESPONSE_PAYLOAD_TOO_LARGE:1504,SEND_FAILED:1505,UNSUPPORTED_METHOD:1400,RECIPIENT_NOT_FOUND:1401,REQUEST_PAYLOAD_TOO_LARGE:1402,UNSUPPORTED_SERVER:1403,UNSUPPORTED_VERSION:1404},Ze.ErrorMessage={APPLICATION_ERROR:"Application error in method handler",CONNECTION_TIMEOUT:"Connection timeout",RESPONSE_TIMEOUT:"Response timeout",RECIPIENT_DISCONNECTED:"Recipient disconnected",RESPONSE_PAYLOAD_TOO_LARGE:"Response payload too large",SEND_FAILED:"Failed to send",UNSUPPORTED_METHOD:"Method not supported at destination",RECIPIENT_NOT_FOUND:"Recipient not found",REQUEST_PAYLOAD_TOO_LARGE:"Request payload too large",UNSUPPORTED_SERVER:"RPC not supported by server",UNSUPPORTED_VERSION:"Unsupported RPC version"};const y0=15360;function Zl(n){return new TextEncoder().encode(n).length}function w0(n,e){if(Zl(n)<=e)return n;let t=0,r=n.length;const i=new TextEncoder;for(;t<r;){const A=Math.floor((t+r+1)/2);i.encode(n.slice(0,A)).length<=e?t=A:r=A-1}return n.slice(0,t)}const $l=2e3;function oa(n,e){if(!e)return 0;let t,r;return"bytesReceived"in n?(t=n.bytesReceived,r=e.bytesReceived):"bytesSent"in n&&(t=n.bytesSent,r=e.bytesSent),t===void 0||r===void 0||n.timestamp===void 0||e.timestamp===void 0?0:(t-r)*8*1e3/(n.timestamp-e.timestamp)}const mx=1e3;class b0 extends P{get sender(){return this._sender}set sender(e){this._sender=e}get constraints(){return this._constraints}constructor(e,t,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,A=arguments.length>4?arguments[4]:void 0;super(e,t,A),this.manuallyStopped=!1,this._isUpstreamPaused=!1,this.handleTrackMuteEvent=()=>this.debouncedTrackMuteHandler().catch(()=>this.log.debug("track mute bounce got cancelled by an unmute event",this.logContext)),this.debouncedTrackMuteHandler=zl(()=>S(this,void 0,void 0,function*(){yield this.pauseUpstream()}),5e3),this.handleTrackUnmuteEvent=()=>S(this,void 0,void 0,function*(){this.debouncedTrackMuteHandler.cancel("unmute"),yield this.resumeUpstream()}),this.handleEnded=()=>{this.isInBackground&&(this.reacquireTrack=!0),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),this.emit(L.Ended,this)},this.reacquireTrack=!1,this.providedByUser=i,this.muteLock=new Mt,this.pauseUpstreamLock=new Mt,this.processorLock=new Mt,this.restartLock=new Mt,this.setMediaStreamTrack(e,!0),this._constraints=e.getConstraints(),r&&(this._constraints=r)}get id(){return this._mediaStreamTrack.id}get dimensions(){if(this.kind!==P.Kind.Video)return;const{width:e,height:t}=this._mediaStreamTrack.getSettings();if(e&&t)return{width:e,height:t}}get isUpstreamPaused(){return this._isUpstreamPaused}get isUserProvided(){return this.providedByUser}get mediaStreamTrack(){var e,t;return(t=(e=this.processor)===null||e===void 0?void 0:e.processedTrack)!==null&&t!==void 0?t:this._mediaStreamTrack}get isLocal(){return!0}getSourceTrackSettings(){return this._mediaStreamTrack.getSettings()}setMediaStreamTrack(e,t){return S(this,void 0,void 0,function*(){var r;if(e===this._mediaStreamTrack&&!t)return;this._mediaStreamTrack&&(this.attachedElements.forEach(A=>{xi(this._mediaStreamTrack,A)}),this.debouncedTrackMuteHandler.cancel("new-track"),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent)),this.mediaStream=new MediaStream([e]),e&&(e.addEventListener("ended",this.handleEnded),e.addEventListener("mute",this.handleTrackMuteEvent),e.addEventListener("unmute",this.handleTrackUnmuteEvent),this._constraints=e.getConstraints());let i;if(this.processor&&e){const A=yield this.processorLock.lock();try{if(this.log.debug("restarting processor",this.logContext),this.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");this.processorElement&&(Fi(e,this.processorElement),this.processorElement.muted=!0),yield this.processor.restart({track:e,kind:this.kind,element:this.processorElement}),i=this.processor.processedTrack}finally{A()}}this.sender&&((r=this.sender.transport)===null||r===void 0?void 0:r.state)!=="closed"&&(yield this.sender.replaceTrack(i??e)),!this.providedByUser&&this._mediaStreamTrack!==e&&this._mediaStreamTrack.stop(),this._mediaStreamTrack=e,e&&(this._mediaStreamTrack.enabled=!this.isMuted,yield this.resumeUpstream(),this.attachedElements.forEach(A=>{Fi(i??e,A)}))})}waitForDimensions(){return S(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mx;return function*(){var r;if(e.kind===P.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");((r=un())===null||r===void 0?void 0:r.os)==="iOS"&&(yield Nt(10));const i=Date.now();for(;Date.now()-i<t;){const A=e.dimensions;if(A)return A;yield Nt(50)}throw new Dn("unable to get track dimensions after timeout")}()})}setDeviceId(e){return S(this,void 0,void 0,function*(){return this._constraints.deviceId===e&&this._mediaStreamTrack.getSettings().deviceId===fr(e)||(this._constraints.deviceId=e,this.isMuted)?!0:(yield this.restartTrack(),fr(e)===this._mediaStreamTrack.getSettings().deviceId)})}getDeviceId(){return S(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){if(e.source===P.Source.ScreenShare)return;const{deviceId:r,groupId:i}=e._mediaStreamTrack.getSettings(),A=e.kind===P.Kind.Audio?"audioinput":"videoinput";return t?ft.getInstance().normalizeDeviceId(A,r,i):r}()})}mute(){return S(this,void 0,void 0,function*(){return this.setTrackMuted(!0),this})}unmute(){return S(this,void 0,void 0,function*(){return this.setTrackMuted(!1),this})}replaceTrack(e,t){return S(this,void 0,void 0,function*(){if(!this.sender)throw new Dn("unable to replace an unpublished track");let r,i;return typeof t=="boolean"?r=t:t!==void 0&&(r=t.userProvidedTrack,i=t.stopProcessor),this.providedByUser=r??!0,this.log.debug("replace MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(e),i&&this.processor&&(yield this.stopProcessor()),this})}restart(e){return S(this,void 0,void 0,function*(){this.manuallyStopped=!1;const t=yield this.restartLock.lock();try{e||(e=this._constraints);const{deviceId:r,facingMode:i}=e,A=sF(e,["deviceId","facingMode"]);this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:e}));const s={audio:!1,video:!1};this.kind===P.Kind.Video?s.video=r||i?{deviceId:r,facingMode:i}:!0:s.audio=r?{deviceId:r}:!0,this.attachedElements.forEach(c=>{xi(this.mediaStreamTrack,c)}),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop();const a=(yield navigator.mediaDevices.getUserMedia(s)).getTracks()[0];return yield a.applyConstraints(A),a.addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(a),this._constraints=e,this.emit(L.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),this}finally{t()}})}setTrackMuted(e){this.log.debug("setting ".concat(this.kind," track ").concat(e?"muted":"unmuted"),this.logContext),!(this.isMuted===e&&this._mediaStreamTrack.enabled!==e)&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?L.Muted:L.Unmuted,this))}get needsReAcquisition(){return this._mediaStreamTrack.readyState!=="live"||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return S(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),zv()&&(this.log.debug("visibility changed, is in Background: ".concat(this.isInBackground),this.logContext),!this.isInBackground&&this.needsReAcquisition&&!this.isUserProvided&&!this.isMuted&&(this.log.debug("track needs to be reacquired, restarting ".concat(this.source),this.logContext),yield this.restart(),this.reacquireTrack=!1))})}stop(){var e;this.manuallyStopped=!0,super.stop(),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),(e=this.processor)===null||e===void 0||e.destroy(),this.processor=void 0}pauseUpstream(){return S(this,void 0,void 0,function*(){var e;const t=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!0)return;if(!this.sender){this.log.warn("unable to pause upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!0,this.emit(L.UpstreamPaused,this);const r=un();if((r==null?void 0:r.name)==="Safari"&&Wr(r.version,"12.0")<0)throw new Bl("pauseUpstream is not supported on Safari < 12.");((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(null))}finally{t()}})}resumeUpstream(){return S(this,void 0,void 0,function*(){var e;const t=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!1)return;if(!this.sender){this.log.warn("unable to resume upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!1,this.emit(L.UpstreamResumed,this),((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(this.mediaStreamTrack))}finally{t()}})}getRTCStatsReport(){return S(this,void 0,void 0,function*(){var e;return!((e=this.sender)===null||e===void 0)&&e.getStats?yield this.sender.getStats():void 0})}setProcessor(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var A;const s=yield r.processorLock.lock();try{r.log.debug("setting up processor",r.logContext);const o=document.createElement(r.kind),a={kind:r.kind,track:r._mediaStreamTrack,element:o,audioContext:r.audioContext};if(yield t.init(a),r.log.debug("processor initialized",r.logContext),r.processor&&(yield r.stopProcessor()),r.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");if(Fi(r._mediaStreamTrack,o),o.muted=!0,o.play().catch(c=>r.log.error("failed to play processor element",Object.assign(Object.assign({},r.logContext),{error:c}))),r.processor=t,r.processorElement=o,r.processor.processedTrack){for(const c of r.attachedElements)c!==r.processorElement&&i&&(xi(r._mediaStreamTrack,c),Fi(r.processor.processedTrack,c));yield(A=r.sender)===null||A===void 0?void 0:A.replaceTrack(r.processor.processedTrack)}r.emit(L.TrackProcessorUpdate,r.processor)}finally{s()}}()})}getProcessor(){return this.processor}stopProcessor(){return S(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var r,i;e.processor&&(e.log.debug("stopping processor",e.logContext),(r=e.processor.processedTrack)===null||r===void 0||r.stop(),yield e.processor.destroy(),e.processor=void 0,t||((i=e.processorElement)===null||i===void 0||i.remove(),e.processorElement=void 0),yield e._mediaStreamTrack.applyConstraints(e._constraints),yield e.setMediaStreamTrack(e._mediaStreamTrack,!0),e.emit(L.TrackProcessorUpdate))}()})}}class aa extends b0{get enhancedNoiseCancellation(){return this.isKrispNoiseFilterEnabled}constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0,A=arguments.length>4?arguments[4]:void 0;super(e,P.Kind.Audio,t,r,A),this.stopOnMute=!1,this.isKrispNoiseFilterEnabled=!1,this.monitorSender=()=>S(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let s;try{s=yield this.getSenderStats()}catch(o){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:o}));return}s&&this.prevStats&&(this._currentBitrate=oa(s,this.prevStats)),this.prevStats=s}),this.handleKrispNoiseFilterEnable=()=>{this.isKrispNoiseFilterEnabled=!0,this.log.debug("Krisp noise filter enabled",this.logContext),this.emit(L.AudioTrackFeatureUpdate,this,on.TF_ENHANCED_NOISE_CANCELLATION,!0)},this.handleKrispNoiseFilterDisable=()=>{this.isKrispNoiseFilterEnabled=!1,this.log.debug("Krisp noise filter disabled",this.logContext),this.emit(L.AudioTrackFeatureUpdate,this,on.TF_ENHANCED_NOISE_CANCELLATION,!1)},this.audioContext=i,this.checkForSilence()}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return S(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===P.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{t()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return S(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{if(!this.isMuted)return this.log.debug("Track already unmuted",this.logContext),this;const r=this._constraints.deviceId&&this._mediaStreamTrack.getSettings().deviceId!==fr(this._constraints.deviceId);return this.source===P.Source.Microphone&&(this.stopOnMute||this._mediaStreamTrack.readyState==="ended"||r)&&!this.isUserProvided&&(this.log.debug("reacquiring mic track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this}finally{t()}})}restartTrack(e){return S(this,void 0,void 0,function*(){let t;if(e){const r=Kl({audio:e});typeof r.audio!="boolean"&&(t=r.audio)}yield this.restart(t)})}restart(e){const t=Object.create(null,{restart:{get:()=>super.restart}});return S(this,void 0,void 0,function*(){const r=yield t.restart.call(this,e);return this.checkForSilence(),r})}startMonitor(){Ht()&&(this.monitorInterval||(this.monitorInterval=setInterval(()=>{this.monitorSender()},$l)))}setProcessor(e){return S(this,void 0,void 0,function*(){var t;const r=yield this.processorLock.lock();try{if(!kn()&&!this.audioContext)throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");this.processor&&(yield this.stopProcessor());const i={kind:this.kind,track:this._mediaStreamTrack,audioContext:this.audioContext};this.log.debug("setting up audio processor ".concat(e.name),this.logContext),yield e.init(i),this.processor=e,this.processor.processedTrack&&(yield(t=this.sender)===null||t===void 0?void 0:t.replaceTrack(this.processor.processedTrack),this.processor.processedTrack.addEventListener("enable-lk-krisp-noise-filter",this.handleKrispNoiseFilterEnable),this.processor.processedTrack.addEventListener("disable-lk-krisp-noise-filter",this.handleKrispNoiseFilterDisable)),this.emit(L.TrackProcessorUpdate,this.processor)}finally{r()}})}setAudioContext(e){this.audioContext=e}getSenderStats(){return S(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return;const t=yield this.sender.getStats();let r;return t.forEach(i=>{i.type==="outbound-rtp"&&(r={type:"audio",streamId:i.id,packetsSent:i.packetsSent,packetsLost:i.packetsLost,bytesSent:i.bytesSent,timestamp:i.timestamp,roundTripTime:i.roundTripTime,jitter:i.jitter})}),r})}checkForSilence(){return S(this,void 0,void 0,function*(){const e=yield i0(this);return e&&(this.isMuted||this.log.warn("silence detected on local audio track",this.logContext),this.emit(L.AudioSilenceDetected)),e})}}function vx(n,e,t){switch(n.kind){case"audio":return new aa(n,e,!1,void 0,t);case"video":return new ua(n,e,!1,t);default:throw new Dn("unsupported track type: ".concat(n.kind))}}const yx=Object.values(HA),wx=Object.values(Ul),bx=Object.values(Tl),Bx=[HA.h180,HA.h360],Cx=[Ul.h180,Ul.h360],_x=n=>[{scaleResolutionDownBy:2,fps:n.encoding.maxFramerate}].map(t=>{var r,i;return new Te(Math.floor(n.width/t.scaleResolutionDownBy),Math.floor(n.height/t.scaleResolutionDownBy),Math.max(15e4,Math.floor(n.encoding.maxBitrate/(Math.pow(t.scaleResolutionDownBy,2)*(((r=n.encoding.maxFramerate)!==null&&r!==void 0?r:30)/((i=t.fps)!==null&&i!==void 0?i:30))))),t.fps,n.encoding.priority)}),ed=["q","h","f"];function td(n,e,t,r){var i,A;let s=r==null?void 0:r.videoEncoding;n&&(s=r==null?void 0:r.screenShareEncoding);const o=r==null?void 0:r.simulcast,a=r==null?void 0:r.scalabilityMode,c=r==null?void 0:r.videoCodec;if(!s&&!o&&!a||!e||!t)return[{}];s||(s=kx(n,e,t,c),ue.debug("using video encoding",s));const u=s.maxFramerate,l=new Te(e,t,s.maxBitrate,s.maxFramerate,s.priority);if(a&&KA(c)){const f=new ca(a),p=[];if(f.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(a));const g=un();if(pr()||kn()||(g==null?void 0:g.name)==="Chrome"&&Wr(g==null?void 0:g.version,"113")<0){const v=f.suffix=="h"?2:3;for(let y=0;y<f.spatial;y+=1)p.push({rid:ed[2-y],maxBitrate:s.maxBitrate/Math.pow(v,y),maxFramerate:l.encoding.maxFramerate});p[0].scalabilityMode=a}else p.push({maxBitrate:s.maxBitrate,maxFramerate:l.encoding.maxFramerate,scalabilityMode:a});return l.encoding.priority&&(p[0].priority=l.encoding.priority,p[0].networkPriority=l.encoding.priority),ue.debug("using svc encoding",{encodings:p}),p}if(!o)return[s];let d=[];n?d=(i=C0(r==null?void 0:r.screenShareSimulcastLayers))!==null&&i!==void 0?i:B0(n,l):d=(A=C0(r==null?void 0:r.videoSimulcastLayers))!==null&&A!==void 0?A:B0(n,l);let h;if(d.length>0){const f=d[0];d.length>1&&([,h]=d);const p=Math.max(e,t);if(p>=960&&h)return nd(e,t,[f,h,l],u);if(p>=480)return nd(e,t,[f,l],u)}return nd(e,t,[l])}function Sx(n,e,t){var r,i,A,s;if(!t.backupCodec||t.backupCodec===!0||t.backupCodec.codec===t.videoCodec)return;e!==t.backupCodec.codec&&ue.warn("requested a different codec than specified as backup",{serverRequested:e,backup:t.backupCodec.codec}),t.videoCodec=e,t.videoEncoding=t.backupCodec.encoding;const o=n.mediaStreamTrack.getSettings(),a=(r=o.width)!==null&&r!==void 0?r:(i=n.dimensions)===null||i===void 0?void 0:i.width,c=(A=o.height)!==null&&A!==void 0?A:(s=n.dimensions)===null||s===void 0?void 0:s.height;return n.source===P.Source.ScreenShare&&t.simulcast&&(t.simulcast=!1),td(n.source===P.Source.ScreenShare,a,c,t)}function kx(n,e,t,r){const i=Ex(n,e,t);let{encoding:A}=i[0];const s=Math.max(e,t);for(let o=0;o<i.length;o+=1){const a=i[o];if(A=a.encoding,a.width>=s)break}if(r)switch(r){case"av1":A=Object.assign({},A),A.maxBitrate=A.maxBitrate*.7;break;case"vp9":A=Object.assign({},A),A.maxBitrate=A.maxBitrate*.85;break}return A}function Ex(n,e,t){if(n)return bx;const r=e>t?e/t:t/e;return Math.abs(r-16/9)<Math.abs(r-4/3)?yx:wx}function B0(n,e){if(n)return _x(e);const{width:t,height:r}=e,i=t>r?t/r:r/t;return Math.abs(i-16/9)<Math.abs(i-4/3)?Bx:Cx}function nd(n,e,t,r){const i=[];if(t.forEach((A,s)=>{if(s>=ed.length)return;const o=Math.min(n,e),c={rid:ed[s],scaleResolutionDownBy:Math.max(1,o/Math.min(A.width,A.height)),maxBitrate:A.encoding.maxBitrate},u=r&&A.encoding.maxFramerate?Math.min(r,A.encoding.maxFramerate):A.encoding.maxFramerate;u&&(c.maxFramerate=u);const l=Qi()||s===0;A.encoding.priority&&l&&(c.priority=A.encoding.priority,c.networkPriority=A.encoding.priority),i.push(c)}),kn()&&Yv()==="ios"){let A;i.forEach(o=>{A?o.maxFramerate&&o.maxFramerate>A&&(A=o.maxFramerate):A=o.maxFramerate});let s=!0;i.forEach(o=>{var a;o.maxFramerate!=A&&(s&&(s=!1,ue.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),ue.info('Setting framerate of encoding "'.concat((a=o.rid)!==null&&a!==void 0?a:"",'" to ').concat(A)),o.maxFramerate=A)})}return i}function C0(n){if(n)return n.sort((e,t)=>{const{encoding:r}=e,{encoding:i}=t;return r.maxBitrate>i.maxBitrate?1:r.maxBitrate<i.maxBitrate?-1:r.maxBitrate===i.maxBitrate&&r.maxFramerate&&i.maxFramerate?r.maxFramerate>i.maxFramerate?1:-1:0})}class ca{constructor(e){const t=e.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!t)throw new Error("invalid scalability mode");if(this.spatial=parseInt(t[1]),this.temporal=parseInt(t[2]),t.length>3)switch(t[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=t[3]}}toString(){var e;return"L".concat(this.spatial,"T").concat(this.temporal).concat((e=this.suffix)!==null&&e!==void 0?e:"")}}function Ux(n){return n.source===P.Source.ScreenShare||n.constraints.height&&fr(n.constraints.height)>=1080?"maintain-resolution":"balanced"}const Tx=5e3;class ua extends b0{get sender(){return this._sender}set sender(e){this._sender=e,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0;super(e,P.Kind.Video,t,r,i),this.simulcastCodecs=new Map,this.degradationPreference="balanced",this.monitorSender=()=>S(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let A;try{A=yield this.getSenderStats()}catch(o){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:o}));return}const s=new Map(A.map(o=>[o.rid,o]));if(this.prevStats){let o=0;s.forEach((a,c)=>{var u;const l=(u=this.prevStats)===null||u===void 0?void 0:u.get(c);o+=oa(a,l)}),this._currentBitrate=o}this.prevStats=s}),this.senderLock=new Mt}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(e){var t;if(this.signalClient=e,!Ht())return;const r=(t=this.sender)===null||t===void 0?void 0:t.getParameters();r&&(this.encodings=r.encodings),!this.monitorInterval&&(this.monitorInterval=setInterval(()=>{this.monitorSender()},$l))}stop(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach(e=>{e.mediaStreamTrack.stop()}),super.stop()}pauseUpstream(){const e=Object.create(null,{pauseUpstream:{get:()=>super.pauseUpstream}});return S(this,void 0,void 0,function*(){var t,r,i,A,s;yield e.pauseUpstream.call(this);try{for(var o=!0,a=ur(this.simulcastCodecs.values()),c;c=yield a.next(),t=c.done,!t;o=!0)A=c.value,o=!1,yield(s=A.sender)===null||s===void 0?void 0:s.replaceTrack(null)}catch(u){r={error:u}}finally{try{!o&&!t&&(i=a.return)&&(yield i.call(a))}finally{if(r)throw r.error}}})}resumeUpstream(){const e=Object.create(null,{resumeUpstream:{get:()=>super.resumeUpstream}});return S(this,void 0,void 0,function*(){var t,r,i,A,s;yield e.resumeUpstream.call(this);try{for(var o=!0,a=ur(this.simulcastCodecs.values()),c;c=yield a.next(),t=c.done,!t;o=!0){A=c.value,o=!1;const u=A;yield(s=u.sender)===null||s===void 0?void 0:s.replaceTrack(u.mediaStreamTrack)}}catch(u){r={error:u}}finally{try{!o&&!t&&(i=a.return)&&(yield i.call(a))}finally{if(r)throw r.error}}})}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return S(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===P.Source.Camera&&!this.isUserProvided&&(this.log.debug("stopping camera track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{t()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return S(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.source===P.Source.Camera&&!this.isUserProvided&&(this.log.debug("reacquiring camera track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this):(this.log.debug("Track already unmuted",this.logContext),this)}finally{t()}})}setTrackMuted(e){super.setTrackMuted(e);for(const t of this.simulcastCodecs.values())t.mediaStreamTrack.enabled=!e}getSenderStats(){return S(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return[];const t=[],r=yield this.sender.getStats();return r.forEach(i=>{var A;if(i.type==="outbound-rtp"){const s={type:"video",streamId:i.id,frameHeight:i.frameHeight,frameWidth:i.frameWidth,framesPerSecond:i.framesPerSecond,framesSent:i.framesSent,firCount:i.firCount,pliCount:i.pliCount,nackCount:i.nackCount,packetsSent:i.packetsSent,bytesSent:i.bytesSent,qualityLimitationReason:i.qualityLimitationReason,qualityLimitationDurations:i.qualityLimitationDurations,qualityLimitationResolutionChanges:i.qualityLimitationResolutionChanges,rid:(A=i.rid)!==null&&A!==void 0?A:i.id,retransmittedPacketsSent:i.retransmittedPacketsSent,targetBitrate:i.targetBitrate,timestamp:i.timestamp},o=r.get(i.remoteId);o&&(s.jitter=o.jitter,s.packetsLost=o.packetsLost,s.roundTripTime=o.roundTripTime),t.push(s)}}),t.sort((i,A)=>{var s,o;return((s=A.frameWidth)!==null&&s!==void 0?s:0)-((o=i.frameWidth)!==null&&o!==void 0?o:0)}),t})}setPublishingQuality(e){const t=[];for(let r=Yt.LOW;r<=Yt.HIGH;r+=1)t.push(new ul({quality:r,enabled:r<=e}));this.log.debug("setting publishing quality. max quality ".concat(e),this.logContext),this.setPublishingLayers(t)}restartTrack(e){return S(this,void 0,void 0,function*(){var t,r,i,A,s;let o;if(e){const l=Kl({video:e});typeof l.video!="boolean"&&(o=l.video)}yield this.restart(o);try{for(var a=!0,c=ur(this.simulcastCodecs.values()),u;u=yield c.next(),t=u.done,!t;a=!0){A=u.value,a=!1;const l=A;l.sender&&((s=l.sender.transport)===null||s===void 0?void 0:s.state)!=="closed"&&(l.mediaStreamTrack=this.mediaStreamTrack.clone(),yield l.sender.replaceTrack(l.mediaStreamTrack))}}catch(l){r={error:l}}finally{try{!a&&!t&&(i=c.return)&&(yield i.call(c))}finally{if(r)throw r.error}}})}setProcessor(e){const t=Object.create(null,{setProcessor:{get:()=>super.setProcessor}});return S(this,arguments,void 0,function(r){var i=this;let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var s,o,a,c,u,l;if(yield t.setProcessor.call(i,r,A),!((u=i.processor)===null||u===void 0)&&u.processedTrack)try{for(var d=!0,h=ur(i.simulcastCodecs.values()),f;f=yield h.next(),s=f.done,!s;d=!0)c=f.value,d=!1,yield(l=c.sender)===null||l===void 0?void 0:l.replaceTrack(i.processor.processedTrack)}catch(p){o={error:p}}finally{try{!d&&!s&&(a=h.return)&&(yield a.call(h))}finally{if(o)throw o.error}}}()})}setDegradationPreference(e){return S(this,void 0,void 0,function*(){if(this.degradationPreference=e,this.sender)try{this.log.debug("setting degradationPreference to ".concat(e),this.logContext);const t=this.sender.getParameters();t.degradationPreference=e,this.sender.setParameters(t)}catch(t){this.log.warn("failed to set degradationPreference",Object.assign({error:t},this.logContext))}})}addSimulcastTrack(e,t){if(this.simulcastCodecs.has(e)){this.log.error("".concat(e," already added, skipping adding simulcast codec"),this.logContext);return}const r={codec:e,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:t};return this.simulcastCodecs.set(e,r),r}setSimulcastTrackSender(e,t){const r=this.simulcastCodecs.get(e);r&&(r.sender=t,setTimeout(()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)},Tx))}setPublishingCodecs(e){return S(this,void 0,void 0,function*(){var t,r,i,A,s,o,a;if(this.log.debug("setting publishing codecs",Object.assign(Object.assign({},this.logContext),{codecs:e,currentCodec:this.codec})),!this.codec&&e.length>0)return yield this.setPublishingLayers(e[0].qualities),[];this.subscribedCodecs=e;const c=[];try{for(t=!0,r=ur(e);i=yield r.next(),A=i.done,!A;t=!0){a=i.value,t=!1;const u=a;if(!this.codec||this.codec===u.codec)yield this.setPublishingLayers(u.qualities);else{const l=this.simulcastCodecs.get(u.codec);if(this.log.debug("try setPublishingCodec for ".concat(u.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:l})),!l||!l.sender){for(const d of u.qualities)if(d.enabled){c.push(u.codec);break}}else l.encodings&&(this.log.debug("try setPublishingLayersForSender ".concat(u.codec),this.logContext),yield _0(l.sender,l.encodings,u.qualities,this.senderLock,this.log,this.logContext))}}}catch(u){s={error:u}}finally{try{!t&&!A&&(o=r.return)&&(yield o.call(r))}finally{if(s)throw s.error}}return c})}setPublishingLayers(e){return S(this,void 0,void 0,function*(){this.log.debug("setting publishing layers",Object.assign(Object.assign({},this.logContext),{qualities:e})),!(!this.sender||!this.encodings)&&(yield _0(this.sender,this.encodings,e,this.senderLock,this.log,this.logContext))})}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return S(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),zv()&&this.isInBackground&&this.source===P.Source.Camera&&(this._mediaStreamTrack.enabled=!1)})}}function _0(n,e,t,r,i,A){return S(this,void 0,void 0,function*(){const s=yield r.lock();i.debug("setPublishingLayersForSender",Object.assign(Object.assign({},A),{sender:n,qualities:t,senderEncodings:e}));try{const o=n.getParameters(),{encodings:a}=o;if(!a)return;if(a.length!==e.length){i.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},A),{encodings:a,senderEncodings:e}));return}let c=!1;const u=un();if((u==null?void 0:u.name)==="Chrome"&&Wr(u==null?void 0:u.version,"133")>0&&a[0].scalabilityMode){const d=a[0],h=new ca(d.scalabilityMode);let f=Si.OFF;if(t.forEach(p=>{p.enabled&&(f===Si.OFF||p.quality>f)&&(f=p.quality)}),f===Si.OFF)d.active&&(d.active=!1,c=!0);else if(!d.active||h.spatial!==f+1){c=!0,d.active=!0;const p=new ca(e[0].scalabilityMode);h.spatial=f+1,h.suffix=p.suffix,h.spatial===1&&(h.suffix=void 0),d.scalabilityMode=h.toString(),d.scaleResolutionDownBy=Math.pow(2,2-f),e[0].maxBitrate&&(d.maxBitrate=e[0].maxBitrate/(d.scaleResolutionDownBy*d.scaleResolutionDownBy))}}else a.forEach((d,h)=>{var f;let p=(f=d.rid)!==null&&f!==void 0?f:"";p===""&&(p="q");const g=S0(p),v=t.find(y=>y.quality===g);v&&d.active!==v.enabled&&(c=!0,d.active=v.enabled,i.debug("setting layer ".concat(v.quality," to ").concat(d.active?"enabled":"disabled"),A),Qi()&&(v.enabled?(d.scaleResolutionDownBy=e[h].scaleResolutionDownBy,d.maxBitrate=e[h].maxBitrate,d.maxFrameRate=e[h].maxFrameRate):(d.scaleResolutionDownBy=4,d.maxBitrate=10,d.maxFrameRate=2)))});c&&(o.encodings=a,i.debug("setting encodings",Object.assign(Object.assign({},A),{encodings:o.encodings})),yield n.setParameters(o))}finally{s()}})}function S0(n){switch(n){case"f":return Yt.HIGH;case"h":return Yt.MEDIUM;case"q":return Yt.LOW;default:return Yt.HIGH}}function k0(n,e,t,r){if(!t)return[new Vr({quality:Yt.HIGH,width:n,height:e,bitrate:0,ssrc:0})];if(r){const i=t[0].scalabilityMode,A=new ca(i),s=[],o=A.suffix=="h"?1.5:2,a=A.suffix=="h"?2:3;for(let c=0;c<A.spatial;c+=1)s.push(new Vr({quality:Math.min(Yt.HIGH,A.spatial-1)-c,width:Math.ceil(n/Math.pow(o,c)),height:Math.ceil(e/Math.pow(o,c)),bitrate:t[0].maxBitrate?Math.ceil(t[0].maxBitrate/Math.pow(a,c)):0,ssrc:0}));return s}return t.map(i=>{var A,s,o;const a=(A=i.scaleResolutionDownBy)!==null&&A!==void 0?A:1;let c=S0((s=i.rid)!==null&&s!==void 0?s:"");return new Vr({quality:c,width:Math.ceil(n/a),height:Math.ceil(e/a),bitrate:(o=i.maxBitrate)!==null&&o!==void 0?o:0,ssrc:0})})}const E0="_lossy",U0="_reliable",Ix=2*1e3,rd="leave-reconnect";var dn;(function(n){n[n.New=0]="New",n[n.Connected=1]="Connected",n[n.Disconnected=2]="Disconnected",n[n.Reconnecting=3]="Reconnecting",n[n.Closed=4]="Closed"})(dn||(dn={}));class Fx extends Sn.EventEmitter{get isClosed(){return this._isClosed}get pendingReconnect(){return!!this.reconnectTimeout}constructor(e){var t;super(),this.options=e,this.rtcConfig={},this.peerConnectionTimeout=Yl.peerConnectionTimeout,this.fullReconnectOnNext=!1,this.subscriberPrimary=!1,this.pcState=dn.New,this._isClosed=!0,this.pendingTrackResolvers={},this.reconnectAttempts=0,this.reconnectStart=0,this.attemptingReconnect=!1,this.joinAttempts=0,this.maxJoinAttempts=1,this.shouldFailNext=!1,this.log=ue,this.handleDataChannel=r=>S(this,[r],void 0,function(i){var A=this;let{channel:s}=i;return function*(){if(s){if(s.label===U0)A.reliableDCSub=s;else if(s.label===E0)A.lossyDCSub=s;else return;A.log.debug("on data channel ".concat(s.id,", ").concat(s.label),A.logContext),s.onmessage=A.handleDataMessage}}()}),this.handleDataMessage=r=>S(this,void 0,void 0,function*(){var i,A;const s=yield this.dataProcessLock.lock();try{let o;if(r.data instanceof ArrayBuffer)o=r.data;else if(r.data instanceof Blob)o=yield r.data.arrayBuffer();else{this.log.error("unsupported data type",Object.assign(Object.assign({},this.logContext),{data:r.data}));return}const a=Dt.fromBinary(new Uint8Array(o));((i=a.value)===null||i===void 0?void 0:i.case)==="speaker"?this.emit(D.ActiveSpeakersUpdate,a.value.value.speakers):(((A=a.value)===null||A===void 0?void 0:A.case)==="user"&&Qx(a,a.value.value),this.emit(D.DataPacketReceived,a))}finally{s()}}),this.handleDataError=r=>{const A=r.currentTarget.maxRetransmits===0?"lossy":"reliable";if(r instanceof ErrorEvent&&r.error){const{error:s}=r.error;this.log.error("DataChannel error on ".concat(A,": ").concat(r.message),Object.assign(Object.assign({},this.logContext),{error:s}))}else this.log.error("Unknown DataChannel error on ".concat(A),Object.assign(Object.assign({},this.logContext),{event:r}))},this.handleBufferedAmountLow=r=>{const A=r.currentTarget.maxRetransmits===0?pe.LOSSY:pe.RELIABLE;this.updateAndEmitDCBufferStatus(A)},this.handleDisconnect=(r,i)=>{if(this._isClosed)return;this.log.warn("".concat(r," disconnected"),this.logContext),this.reconnectAttempts===0&&(this.reconnectStart=Date.now());const A=a=>{this.log.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(a,"ms. giving up"),this.logContext),this.emit(D.Disconnected),this.close()},s=Date.now()-this.reconnectStart;let o=this.getNextRetryDelay({elapsedMs:s,retryCount:this.reconnectAttempts});if(o===null){A(s);return}r===rd&&(o=0),this.log.debug("reconnecting in ".concat(o,"ms"),this.logContext),this.clearReconnectTimeout(),this.token&&this.regionUrlProvider&&this.regionUrlProvider.updateToken(this.token),this.reconnectTimeout=wt.setTimeout(()=>this.attemptReconnect(i).finally(()=>this.reconnectTimeout=void 0),o)},this.waitForRestarted=()=>new Promise((r,i)=>{this.pcState===dn.Connected&&r();const A=()=>{this.off(D.Disconnected,s),r()},s=()=>{this.off(D.Restarted,A),i()};this.once(D.Restarted,A),this.once(D.Disconnected,s)}),this.updateAndEmitDCBufferStatus=r=>{const i=this.isBufferStatusLow(r);typeof i<"u"&&i!==this.dcBufferStatus.get(r)&&(this.dcBufferStatus.set(r,i),this.emit(D.DCBufferStatusChanged,i,r))},this.isBufferStatusLow=r=>{const i=this.dataChannelForKind(r);if(i)return i.bufferedAmount<=i.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>{this.client.currentState===Oe.RECONNECTING&&(this.clearReconnectTimeout(),this.attemptReconnect(ki.RR_SIGNAL_DISCONNECTED))},this.log=Ln((t=e.loggerName)!==null&&t!==void 0?t:cn.Engine),this.loggerOptions={loggerName:e.loggerName,loggerContextCb:()=>this.logContext},this.client=new Gl(void 0,this.loggerOptions),this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.registerOnLineListener(),this.closingLock=new Mt,this.dataProcessLock=new Mt,this.dcBufferStatus=new Map([[pe.LOSSY,!0],[pe.RELIABLE,!0]]),this.client.onParticipantUpdate=r=>this.emit(D.ParticipantUpdate,r),this.client.onConnectionQuality=r=>this.emit(D.ConnectionQualityUpdate,r),this.client.onRoomUpdate=r=>this.emit(D.RoomUpdate,r),this.client.onSubscriptionError=r=>this.emit(D.SubscriptionError,r),this.client.onSubscriptionPermissionUpdate=r=>this.emit(D.SubscriptionPermissionUpdate,r),this.client.onSpeakersChanged=r=>this.emit(D.SpeakersChanged,r),this.client.onStreamStateUpdate=r=>this.emit(D.StreamStateChanged,r),this.client.onRequestResponse=r=>this.emit(D.SignalRequestResponse,r)}get logContext(){var e,t,r,i,A,s,o,a;return{room:(t=(e=this.latestJoinResponse)===null||e===void 0?void 0:e.room)===null||t===void 0?void 0:t.name,roomID:(i=(r=this.latestJoinResponse)===null||r===void 0?void 0:r.room)===null||i===void 0?void 0:i.sid,participant:(s=(A=this.latestJoinResponse)===null||A===void 0?void 0:A.participant)===null||s===void 0?void 0:s.identity,pID:(a=(o=this.latestJoinResponse)===null||o===void 0?void 0:o.participant)===null||a===void 0?void 0:a.sid}}join(e,t,r,i){return S(this,void 0,void 0,function*(){this.url=e,this.token=t,this.signalOpts=r,this.maxJoinAttempts=r.maxRetries;try{this.joinAttempts+=1,this.setupSignalClientCallbacks();const A=yield this.client.join(e,t,r,i);return this._isClosed=!1,this.latestJoinResponse=A,this.subscriberPrimary=A.subscriberPrimary,this.pcManager||(yield this.configure(A)),(!this.subscriberPrimary||A.fastPublish)&&this.negotiate(),this.clientConfiguration=A.clientConfiguration,setTimeout(()=>{this.emit(D.SignalConnected)},10),A}catch(A){if(A instanceof Fe&&A.reason===de.ServerUnreachable&&(this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts," of ").concat(this.maxJoinAttempts),this.logContext),this.joinAttempts<this.maxJoinAttempts))return this.join(e,t,r,i);throw A}})}close(){return S(this,void 0,void 0,function*(){const e=yield this.closingLock.lock();if(this.isClosed){e();return}try{this._isClosed=!0,this.joinAttempts=0,this.emit(D.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),yield this.cleanupPeerConnections(),yield this.cleanupClient()}finally{e()}})}cleanupPeerConnections(){return S(this,void 0,void 0,function*(){var e;yield(e=this.pcManager)===null||e===void 0?void 0:e.close(),this.pcManager=void 0;const t=r=>{r&&(r.close(),r.onbufferedamountlow=null,r.onclose=null,r.onclosing=null,r.onerror=null,r.onmessage=null,r.onopen=null)};t(this.lossyDC),t(this.lossyDCSub),t(this.reliableDC),t(this.reliableDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0})}cleanupClient(){return S(this,void 0,void 0,function*(){yield this.client.close(),this.client.resetCallbacks()})}addTrack(e){if(this.pendingTrackResolvers[e.cid])throw new Dn("a track with the same ID has already been published");return new Promise((t,r)=>{const i=setTimeout(()=>{delete this.pendingTrackResolvers[e.cid],r(new Fe("publication of local track timed out, no response from server",de.InternalError))},1e4);this.pendingTrackResolvers[e.cid]={resolve:A=>{clearTimeout(i),t(A)},reject:()=>{clearTimeout(i),r(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(e)})}removeTrack(e){if(e.track&&this.pendingTrackResolvers[e.track.id]){const{reject:t}=this.pendingTrackResolvers[e.track.id];t&&t(),delete this.pendingTrackResolvers[e.track.id]}try{return this.pcManager.removeTrack(e),!0}catch(t){this.log.warn("failed to remove track",Object.assign(Object.assign({},this.logContext),{error:t}))}return!1}updateMuteStatus(e,t){this.client.sendMuteTrack(e,t)}get dataSubscriberReadyState(){var e;return(e=this.reliableDCSub)===null||e===void 0?void 0:e.readyState}getConnectedServerAddress(){return S(this,void 0,void 0,function*(){var e;return(e=this.pcManager)===null||e===void 0?void 0:e.getConnectedAddress()})}setRegionUrlProvider(e){this.regionUrlProvider=e}configure(e){return S(this,void 0,void 0,function*(){var t,r;if(this.pcManager&&this.pcManager.currentState!==Ye.NEW)return;this.participantSid=(t=e.participant)===null||t===void 0?void 0:t.sid;const i=this.makeRTCConfiguration(e);this.pcManager=new gx(i,e.subscriberPrimary,this.loggerOptions),this.emit(D.TransportsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=(A,s)=>{this.client.sendIceCandidate(A,s)},this.pcManager.onPublisherOffer=A=>{this.client.sendOffer(A)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=(A,s,o)=>S(this,void 0,void 0,function*(){if(this.log.debug("primary PC state changed ".concat(A),this.logContext),["closed","disconnected","failed"].includes(s)&&(this.publisherConnectionPromise=void 0),A===Ye.CONNECTED){const u=this.pcState===dn.New;this.pcState=dn.Connected,u&&this.emit(D.Connected,e)}else A===Ye.FAILED&&this.pcState===dn.Connected&&(this.pcState=dn.Disconnected,this.handleDisconnect("peerconnection failed",o==="failed"?ki.RR_SUBSCRIBER_FAILED:ki.RR_PUBLISHER_FAILED));const a=this.client.isDisconnected||this.client.currentState===Oe.RECONNECTING,c=[Ye.FAILED,Ye.CLOSING,Ye.CLOSED].includes(A);a&&c&&!this._isClosed&&this.emit(D.Offline)}),this.pcManager.onTrack=A=>{this.emit(D.MediaTrackAdded,A.track,A.streams[0],A.receiver)},xx((r=e.serverInfo)===null||r===void 0?void 0:r.protocol)||this.createDataChannels()})}setupSignalClientCallbacks(){this.client.onAnswer=e=>S(this,void 0,void 0,function*(){this.pcManager&&(this.log.debug("received server answer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type})),yield this.pcManager.setPublisherAnswer(e))}),this.client.onTrickle=(e,t)=>{this.pcManager&&(this.log.debug("got ICE candidate from peer",Object.assign(Object.assign({},this.logContext),{candidate:e,target:t})),this.pcManager.addIceCandidate(e,t))},this.client.onOffer=e=>S(this,void 0,void 0,function*(){if(!this.pcManager)return;const t=yield this.pcManager.createSubscriberAnswerFromOffer(e);this.client.sendAnswer(t)}),this.client.onLocalTrackPublished=e=>{var t;if(this.log.debug("received trackPublishedResponse",Object.assign(Object.assign({},this.logContext),{cid:e.cid,track:(t=e.track)===null||t===void 0?void 0:t.sid})),!this.pendingTrackResolvers[e.cid]){this.log.error("missing track resolver for ".concat(e.cid),Object.assign(Object.assign({},this.logContext),{cid:e.cid}));return}const{resolve:r}=this.pendingTrackResolvers[e.cid];delete this.pendingTrackResolvers[e.cid],r(e.track)},this.client.onLocalTrackUnpublished=e=>{this.emit(D.LocalTrackUnpublished,e)},this.client.onLocalTrackSubscribed=e=>{this.emit(D.LocalTrackSubscribed,e)},this.client.onTokenRefresh=e=>{this.token=e},this.client.onRemoteMuteChanged=(e,t)=>{this.emit(D.RemoteMute,e,t)},this.client.onSubscribedQualityUpdate=e=>{this.emit(D.SubscribedQualityUpdate,e)},this.client.onRoomMoved=e=>{var t;this.participantSid=(t=e.participant)===null||t===void 0?void 0:t.sid,this.emit(D.RoomMoved,e)},this.client.onClose=()=>{this.handleDisconnect("signal",ki.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=e=>{switch(this.log.debug("client leave request",Object.assign(Object.assign({},this.logContext),{reason:e==null?void 0:e.reason})),e.regions&&this.regionUrlProvider&&(this.log.debug("updating regions",this.logContext),this.regionUrlProvider.setServerReportedRegions(e.regions)),e.action){case Ti.DISCONNECT:this.emit(D.Disconnected,e==null?void 0:e.reason),this.close();break;case Ti.RECONNECT:this.fullReconnectOnNext=!0,this.handleDisconnect(rd);break;case Ti.RESUME:this.handleDisconnect(rd)}}}makeRTCConfiguration(e){var t;const r=Object.assign({},this.rtcConfig);if(!((t=this.signalOpts)===null||t===void 0)&&t.e2eeEnabled&&(this.log.debug("E2EE - setting up transports with insertable streams",this.logContext),r.encodedInsertableStreams=!0),e.iceServers&&!r.iceServers){const i=[];e.iceServers.forEach(A=>{const s={urls:A.urls};A.username&&(s.username=A.username),A.credential&&(s.credential=A.credential),i.push(s)}),r.iceServers=i}return e.clientConfiguration&&e.clientConfiguration.forceRelay===LA.ENABLED&&(r.iceTransportPolicy="relay"),r.sdpSemantics="unified-plan",r.continualGatheringPolicy="gather_continually",r}createDataChannels(){this.pcManager&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.lossyDC=this.pcManager.createPublisherDataChannel(E0,{ordered:!1,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(U0,{ordered:!0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=this.handleBufferedAmountLow,this.reliableDC.onbufferedamountlow=this.handleBufferedAmountLow)}createSender(e,t,r){return S(this,void 0,void 0,function*(){if(Il())return yield this.createTransceiverRTCRtpSender(e,t,r);if(Fl())return this.log.warn("using add-track fallback",this.logContext),yield this.createRTCRtpSender(e.mediaStreamTrack);throw new lt("Required webRTC APIs not supported on this device")})}createSimulcastSender(e,t,r,i){return S(this,void 0,void 0,function*(){if(Il())return this.createSimulcastTransceiverSender(e,t,r,i);if(Fl())return this.log.debug("using add-track fallback",this.logContext),this.createRTCRtpSender(e.mediaStreamTrack);throw new lt("Cannot stream on this device")})}createTransceiverRTCRtpSender(e,t,r){return S(this,void 0,void 0,function*(){if(!this.pcManager)throw new lt("publisher is closed");const i=[];e.mediaStream&&i.push(e.mediaStream),Pi(e)&&(e.codec=t.videoCodec);const A={direction:"sendonly",streams:i};return r&&(A.sendEncodings=r),(yield this.pcManager.addPublisherTransceiver(e.mediaStreamTrack,A)).sender})}createSimulcastTransceiverSender(e,t,r,i){return S(this,void 0,void 0,function*(){if(!this.pcManager)throw new lt("publisher is closed");const A={direction:"sendonly"};i&&(A.sendEncodings=i);const s=yield this.pcManager.addPublisherTransceiver(t.mediaStreamTrack,A);if(r.videoCodec)return e.setSimulcastTrackSender(r.videoCodec,s.sender),s.sender})}createRTCRtpSender(e){return S(this,void 0,void 0,function*(){if(!this.pcManager)throw new lt("publisher is closed");return this.pcManager.addPublisherTrack(e)})}attemptReconnect(e){return S(this,void 0,void 0,function*(){var t,r,i;if(!this._isClosed){if(this.attemptingReconnect){ue.warn("already attempting reconnect, returning early",this.logContext);return}(((t=this.clientConfiguration)===null||t===void 0?void 0:t.resumeConnection)===LA.DISABLED||((i=(r=this.pcManager)===null||r===void 0?void 0:r.currentState)!==null&&i!==void 0?i:Ye.NEW)===Ye.NEW)&&(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?yield this.restartConnection():yield this.resumeConnection(e),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(A){this.reconnectAttempts+=1;let s=!0;A instanceof lt?(this.log.debug("received unrecoverable error",Object.assign(Object.assign({},this.logContext),{error:A})),s=!1):A instanceof Mi||(this.fullReconnectOnNext=!0),s?this.handleDisconnect("reconnect",ki.RR_UNKNOWN):(this.log.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up"),this.logContext),this.emit(D.Disconnected),yield this.close())}finally{this.attemptingReconnect=!1}}})}getNextRetryDelay(e){try{return this.reconnectPolicy.nextRetryDelayInMs(e)}catch(t){this.log.warn("encountered error in reconnect policy",Object.assign(Object.assign({},this.logContext),{error:t}))}return null}restartConnection(e){return S(this,void 0,void 0,function*(){var t,r,i;try{if(!this.url||!this.token)throw new lt("could not reconnect, url or token not saved");this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts),this.logContext),this.emit(D.Restarting),this.client.isDisconnected||(yield this.client.sendLeave()),yield this.cleanupPeerConnections(),yield this.cleanupClient();let A;try{if(!this.signalOpts)throw this.log.warn("attempted connection restart, without signal options present",this.logContext),new Mi;A=yield this.join(e??this.url,this.token,this.signalOpts)}catch(s){throw s instanceof Fe&&s.reason===de.NotAllowed?new lt("could not reconnect, token might be expired"):new Mi}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(this.client.setReconnected(),this.emit(D.SignalRestarted,A),yield this.waitForPCReconnected(),this.client.currentState!==Oe.CONNECTED)throw new Mi("Signal connection got severed during reconnect");(t=this.regionUrlProvider)===null||t===void 0||t.resetAttempts(),this.emit(D.Restarted)}catch(A){const s=yield(r=this.regionUrlProvider)===null||r===void 0?void 0:r.getNextBestRegionUrl();if(s){yield this.restartConnection(s);return}else throw(i=this.regionUrlProvider)===null||i===void 0||i.resetAttempts(),A}})}resumeConnection(e){return S(this,void 0,void 0,function*(){var t;if(!this.url||!this.token)throw new lt("could not reconnect, url or token not saved");if(!this.pcManager)throw new lt("publisher and subscriber connections unset");this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts),this.logContext),this.emit(D.Resuming);let r;try{this.setupSignalClientCallbacks(),r=yield this.client.reconnect(this.url,this.token,this.participantSid,e)}catch(i){let A="";throw i instanceof Error&&(A=i.message,this.log.error(i.message,Object.assign(Object.assign({},this.logContext),{error:i}))),i instanceof Fe&&i.reason===de.NotAllowed?new lt("could not reconnect, token might be expired"):i instanceof Fe&&i.reason===de.LeaveRequest?i:new Mi(A)}if(this.emit(D.SignalResumed),r){const i=this.makeRTCConfiguration(r);this.pcManager.updateConfiguration(i)}else this.log.warn("Did not receive reconnect response",this.logContext);if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(yield this.pcManager.triggerIceRestart(),yield this.waitForPCReconnected(),this.client.currentState!==Oe.CONNECTED)throw new Mi("Signal connection got severed during reconnect");this.client.setReconnected(),((t=this.reliableDC)===null||t===void 0?void 0:t.readyState)==="open"&&this.reliableDC.id===null&&this.createDataChannels(),this.emit(D.Resumed)})}waitForPCInitialConnection(e,t){return S(this,void 0,void 0,function*(){if(!this.pcManager)throw new lt("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(t,e)})}waitForPCReconnected(){return S(this,void 0,void 0,function*(){this.pcState=dn.Reconnecting,this.log.debug("waiting for peer connection to reconnect",this.logContext);try{if(yield Nt(Ix),!this.pcManager)throw new lt("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout),this.pcState=dn.Connected}catch(e){throw this.pcState=dn.Disconnected,new Fe("could not establish PC connection, ".concat(e.message),de.InternalError)}})}publishRpcResponse(e,t,r,i){return S(this,void 0,void 0,function*(){const A=new Dt({destinationIdentities:[e],kind:pe.RELIABLE,value:{case:"rpcResponse",value:new Rm({requestId:t,value:i?{case:"error",value:i.toProto()}:{case:"payload",value:r??""}})}});yield this.sendDataPacket(A,pe.RELIABLE)})}publishRpcAck(e,t){return S(this,void 0,void 0,function*(){const r=new Dt({destinationIdentities:[e],kind:pe.RELIABLE,value:{case:"rpcAck",value:new Qm({requestId:t})}});yield this.sendDataPacket(r,pe.RELIABLE)})}sendDataPacket(e,t){return S(this,void 0,void 0,function*(){const r=e.toBinary();yield this.ensurePublisherConnected(t);const i=this.dataChannelForKind(t);i&&i.send(r),this.updateAndEmitDCBufferStatus(t)})}waitForBufferStatusLow(e){return new Promise((t,r)=>S(this,void 0,void 0,function*(){if(this.isBufferStatusLow(e))t();else{const i=()=>r("Engine closed");for(this.once(D.Closing,i);!this.dcBufferStatus.get(e);)yield Nt(10);this.off(D.Closing,i),t()}}))}ensureDataTransportConnected(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.subscriberPrimary;return function*(){var A;if(!r.pcManager)throw new lt("PC manager is closed");const s=i?r.pcManager.subscriber:r.pcManager.publisher,o=i?"Subscriber":"Publisher";if(!s)throw new Fe("".concat(o," connection not set"),de.InternalError);let a=!1;!i&&!r.dataChannelForKind(t,i)&&(r.createDataChannels(),a=!0),!a&&!i&&!r.pcManager.publisher.isICEConnected&&r.pcManager.publisher.getICEConnectionState()!=="checking"&&(a=!0),a&&r.negotiate();const c=r.dataChannelForKind(t,i);if((c==null?void 0:c.readyState)==="open")return;const u=new Date().getTime()+r.peerConnectionTimeout;for(;new Date().getTime()<u;){if(s.isICEConnected&&((A=r.dataChannelForKind(t,i))===null||A===void 0?void 0:A.readyState)==="open")return;yield Nt(50)}throw new Fe("could not establish ".concat(o," connection, state: ").concat(s.getICEConnectionState()),de.InternalError)}()})}ensurePublisherConnected(e){return S(this,void 0,void 0,function*(){this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(e,!1)),yield this.publisherConnectionPromise})}verifyTransport(){return!(!this.pcManager||this.pcManager.currentState!==Ye.CONNECTED||!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}negotiate(){return S(this,void 0,void 0,function*(){return new Promise((e,t)=>S(this,void 0,void 0,function*(){if(!this.pcManager){t(new Cl("PC manager is closed"));return}this.pcManager.requirePublisher(),this.pcManager.publisher.getTransceivers().length==0&&!this.lossyDC&&!this.reliableDC&&this.createDataChannels();const r=new AbortController,i=()=>{r.abort(),this.log.debug("engine disconnected while negotiation was ongoing",this.logContext),e()};this.isClosed&&t("cannot negotiate on closed engine"),this.on(D.Closing,i),this.pcManager.publisher.once(Oi.RTPVideoPayloadTypes,A=>{const s=new Map;A.forEach(o=>{const a=o.codec.toLowerCase();HF(a)&&s.set(o.payload,a)}),this.emit(D.RTPVideoMapUpdate,s)});try{yield this.pcManager.negotiate(r),e()}catch(A){A instanceof Cl&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",ki.RR_UNKNOWN),t(A)}finally{this.off(D.Closing,i)}}))})}dataChannelForKind(e,t){if(t){if(e===pe.LOSSY)return this.lossyDCSub;if(e===pe.RELIABLE)return this.reliableDCSub}else{if(e===pe.LOSSY)return this.lossyDC;if(e===pe.RELIABLE)return this.reliableDC}}sendSyncState(e,t){var r,i;if(!this.pcManager){this.log.warn("sync state cannot be sent without peer connection setup",this.logContext);return}const A=this.pcManager.subscriber.getLocalDescription(),s=this.pcManager.subscriber.getRemoteDescription(),o=(i=(r=this.signalOpts)===null||r===void 0?void 0:r.autoSubscribe)!==null&&i!==void 0?i:!0,a=new Array,c=new Array;e.forEach(u=>{u.isDesired!==o&&a.push(u.trackSid),u.isEnabled||c.push(u.trackSid)}),this.client.sendSyncState(new Zm({answer:A?sa({sdp:A.sdp,type:A.type}):void 0,offer:s?sa({sdp:s.sdp,type:s.type}):void 0,subscription:new Go({trackSids:a,subscribe:!o,participantTracks:[]}),publishTracks:XF(t),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:c}))}failNext(){this.shouldFailNext=!0}dataChannelsInfo(){const e=[],t=(r,i)=>{(r==null?void 0:r.id)!==void 0&&r.id!==null&&e.push(new $m({label:r.label,id:r.id,target:i}))};return t(this.dataChannelForKind(pe.LOSSY),an.PUBLISHER),t(this.dataChannelForKind(pe.RELIABLE),an.PUBLISHER),t(this.dataChannelForKind(pe.LOSSY,!0),an.SUBSCRIBER),t(this.dataChannelForKind(pe.RELIABLE,!0),an.SUBSCRIBER),e}clearReconnectTimeout(){this.reconnectTimeout&&wt.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){Ht()&&window.addEventListener("online",this.handleBrowserOnLine)}deregisterOnLineListener(){Ht()&&window.removeEventListener("online",this.handleBrowserOnLine)}}class Mi extends Error{}function xx(n){return n!==void 0&&n>13}function Qx(n,e){const t=n.participantIdentity?n.participantIdentity:e.participantIdentity;n.participantIdentity=t,e.participantIdentity=t;const r=n.destinationIdentities.length!==0?n.destinationIdentities:e.destinationIdentities;n.destinationIdentities=r,e.destinationIdentities=r}class id{constructor(e,t){this.lastUpdateAt=0,this.settingsCacheTime=3e3,this.attemptedRegions=[],this.serverUrl=new URL(e),this.token=t}updateToken(e){this.token=e}isCloud(){return Ql(this.serverUrl)}getServerUrl(){return this.serverUrl}getNextBestRegionUrl(e){return S(this,void 0,void 0,function*(){if(!this.isCloud())throw Error("region availability is only supported for LiveKit Cloud domains");(!this.regionSettings||Date.now()-this.lastUpdateAt>this.settingsCacheTime)&&(this.regionSettings=yield this.fetchRegionSettings(e));const t=this.regionSettings.regions.filter(r=>!this.attemptedRegions.find(i=>i.url===r.url));if(t.length>0){const r=t[0];return this.attemptedRegions.push(r),ue.debug("next region: ".concat(r.region)),r.url}else return null})}resetAttempts(){this.attemptedRegions=[]}fetchRegionSettings(e){return S(this,void 0,void 0,function*(){const t=yield fetch("".concat(Rx(this.serverUrl),"/regions"),{headers:{authorization:"Bearer ".concat(this.token)},signal:e});if(t.ok){const r=yield t.json();return this.lastUpdateAt=Date.now(),r}else throw new Fe("Could not fetch region settings: ".concat(t.statusText),t.status===401?de.NotAllowed:de.InternalError,t.status)})}setServerReportedRegions(e){this.regionSettings=e,this.lastUpdateAt=Date.now()}}function Rx(n){return"".concat(n.protocol.replace("ws","http"),"//").concat(n.host,"/settings")}class T0{get info(){return this._info}constructor(e,t,r){this.reader=t,this.totalByteSize=r,this._info=e,this.bytesReceived=0}}class Px extends T0{handleChunkReceived(e){var t;this.bytesReceived+=e.content.byteLength;const r=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(t=this.onProgress)===null||t===void 0||t.call(this,r)}[Symbol.asyncIterator](){const e=this.reader.getReader();return{next:()=>S(this,void 0,void 0,function*(){try{const{done:t,value:r}=yield e.read();return t?{done:!0,value:void 0}:(this.handleChunkReceived(r),{done:!1,value:r.content})}catch{return{done:!0,value:void 0}}}),return(){return S(this,void 0,void 0,function*(){return e.releaseLock(),{done:!0,value:void 0}})}}}readAll(){return S(this,void 0,void 0,function*(){var e,t,r,i;let A=new Set;try{for(var s=!0,o=ur(this),a;a=yield o.next(),e=a.done,!e;s=!0){i=a.value,s=!1;const c=i;A.add(c)}}catch(c){t={error:c}}finally{try{!s&&!e&&(r=o.return)&&(yield r.call(o))}finally{if(t)throw t.error}}return Array.from(A)})}}class Ox extends T0{constructor(e,t,r){super(e,t,r),this.receivedChunks=new Map}handleChunkReceived(e){var t;const r=ia(e.chunkIndex),i=this.receivedChunks.get(r);if(i&&i.version>e.version)return;this.receivedChunks.set(r,e),this.bytesReceived+=e.content.byteLength;const A=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(t=this.onProgress)===null||t===void 0||t.call(this,A)}[Symbol.asyncIterator](){const e=this.reader.getReader(),t=new TextDecoder;return{next:()=>S(this,void 0,void 0,function*(){try{const{done:r,value:i}=yield e.read();return r?{done:!0,value:void 0}:(this.handleChunkReceived(i),{done:!1,value:t.decode(i.content)})}catch{return{done:!0,value:void 0}}}),return(){return S(this,void 0,void 0,function*(){return e.releaseLock(),{done:!0,value:void 0}})}}}readAll(){return S(this,void 0,void 0,function*(){var e,t,r,i;let A="";try{for(var s=!0,o=ur(this),a;a=yield o.next(),e=a.done,!e;s=!0)i=a.value,s=!1,A+=i}catch(c){t={error:c}}finally{try{!s&&!e&&(r=o.return)&&(yield r.call(o))}finally{if(t)throw t.error}}return A})}}class I0{constructor(e,t,r){this.writableStream=e,this.defaultWriter=e.getWriter(),this.onClose=r,this.info=t}write(e){return this.defaultWriter.write(e)}close(){return S(this,void 0,void 0,function*(){var e;yield this.defaultWriter.close(),this.defaultWriter.releaseLock(),(e=this.onClose)===null||e===void 0||e.call(this)})}}class Mx extends I0{}class Lx extends I0{}class F0 extends P{constructor(e,t,r,i,A){super(e,r,A),this.sid=t,this.receiver=i}get isLocal(){return!1}setMuted(e){this.isMuted!==e&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?L.Muted:L.Unmuted,this))}setMediaStream(e){this.mediaStream=e;const t=r=>{r.track===this._mediaStreamTrack&&(e.removeEventListener("removetrack",t),this.receiver&&"playoutDelayHint"in this.receiver&&(this.receiver.playoutDelayHint=void 0),this.receiver=void 0,this._currentBitrate=0,this.emit(L.Ended,this))};e.addEventListener("removetrack",t)}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}getRTCStatsReport(){return S(this,void 0,void 0,function*(){var e;return!((e=this.receiver)===null||e===void 0)&&e.getStats?yield this.receiver.getStats():void 0})}setPlayoutDelay(e){this.receiver?"playoutDelayHint"in this.receiver?this.receiver.playoutDelayHint=e:this.log.warn("Playout delay not supported in this browser"):this.log.warn("Cannot set playout delay, track already ended")}getPlayoutDelay(){if(this.receiver){if("playoutDelayHint"in this.receiver)return this.receiver.playoutDelayHint;this.log.warn("Playout delay not supported in this browser")}else this.log.warn("Cannot get playout delay, track already ended");return 0}startMonitor(){this.monitorInterval||(this.monitorInterval=setInterval(()=>this.monitorReceiver(),$l)),YF()&&this.registerTimeSyncUpdate()}registerTimeSyncUpdate(){const e=()=>{var t;this.timeSyncHandle=requestAnimationFrame(()=>e());const r=(t=this.receiver)===null||t===void 0?void 0:t.getSynchronizationSources()[0];if(r){const{timestamp:i,rtpTimestamp:A}=r;A&&this.rtpTimestamp!==A&&(this.emit(L.TimeSyncUpdate,{timestamp:i,rtpTimestamp:A}),this.rtpTimestamp=A)}};e()}}class Dx extends F0{constructor(e,t,r,i,A,s){super(e,t,P.Kind.Audio,r,s),this.monitorReceiver=()=>S(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const o=yield this.getReceiverStats();o&&this.prevStats&&this.receiver&&(this._currentBitrate=oa(o,this.prevStats)),this.prevStats=o}),this.audioContext=i,this.webAudioPluginNodes=[],A&&(this.sinkId=A.deviceId)}setVolume(e){var t;for(const r of this.attachedElements)this.audioContext?(t=this.gainNode)===null||t===void 0||t.gain.setTargetAtTime(e,0,.1):r.volume=e;kn()&&this._mediaStreamTrack._setVolume(e),this.elementVolume=e}getVolume(){if(this.elementVolume)return this.elementVolume;if(kn())return 1;let e=0;return this.attachedElements.forEach(t=>{t.volume>e&&(e=t.volume)}),e}setSinkId(e){return S(this,void 0,void 0,function*(){this.sinkId=e,yield Promise.all(this.attachedElements.map(t=>{if(xl(t))return t.setSinkId(e)}))})}attach(e){const t=this.attachedElements.length===0;return e?super.attach(e):e=super.attach(),this.sinkId&&xl(e)&&e.setSinkId(this.sinkId).catch(r=>{this.log.error("Failed to set sink id on remote audio track",r,this.logContext)}),this.audioContext&&t&&(this.log.debug("using audio context mapping",this.logContext),this.connectWebAudio(this.audioContext,e),e.volume=0,e.muted=!0),this.elementVolume&&this.setVolume(this.elementVolume),e}detach(e){let t;return e?(t=super.detach(e),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(t=super.detach(),this.disconnectWebAudio()),t}setAudioContext(e){this.audioContext=e,e&&this.attachedElements.length>0?this.connectWebAudio(e,this.attachedElements[0]):e||this.disconnectWebAudio()}setWebAudioPlugins(e){this.webAudioPluginNodes=e,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}connectWebAudio(e,t){this.disconnectWebAudio(),this.sourceNode=e.createMediaStreamSource(t.srcObject);let r=this.sourceNode;this.webAudioPluginNodes.forEach(i=>{r.connect(i),r=i}),this.gainNode=e.createGain(),r.connect(this.gainNode),this.gainNode.connect(e.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),e.state!=="running"&&e.resume().then(()=>{e.state!=="running"&&this.emit(L.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))}).catch(i=>{this.emit(L.AudioPlaybackFailed,i)})}disconnectWebAudio(){var e,t;(e=this.gainNode)===null||e===void 0||e.disconnect(),(t=this.sourceNode)===null||t===void 0||t.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}getReceiverStats(){return S(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let t;return e.forEach(r=>{r.type==="inbound-rtp"&&(t={type:"audio",streamId:r.id,timestamp:r.timestamp,jitter:r.jitter,bytesReceived:r.bytesReceived,concealedSamples:r.concealedSamples,concealmentEvents:r.concealmentEvents,silentConcealedSamples:r.silentConcealedSamples,silentConcealmentEvents:r.silentConcealmentEvents,totalAudioEnergy:r.totalAudioEnergy,totalSamplesDuration:r.totalSamplesDuration})}),t})}}const Ad=100;class Nx extends F0{constructor(e,t,r,i,A){super(e,t,P.Kind.Video,r,A),this.elementInfos=[],this.monitorReceiver=()=>S(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const s=yield this.getReceiverStats();s&&this.prevStats&&this.receiver&&(this._currentBitrate=oa(s,this.prevStats)),this.prevStats=s}),this.debouncedHandleResize=zl(()=>{this.updateDimensions()},Ad),this.adaptiveStreamSettings=i}get isAdaptiveStream(){return this.adaptiveStreamSettings!==void 0}get mediaStreamTrack(){return this._mediaStreamTrack}setMuted(e){super.setMuted(e),this.attachedElements.forEach(t=>{e?xi(this._mediaStreamTrack,t):Fi(this._mediaStreamTrack,t)})}attach(e){if(e?super.attach(e):e=super.attach(),this.adaptiveStreamSettings&&this.elementInfos.find(t=>t.element===e)===void 0){const t=new Hx(e);this.observeElementInfo(t)}return e}observeElementInfo(e){this.adaptiveStreamSettings&&this.elementInfos.find(t=>t===e)===void 0?(e.handleResize=()=>{this.debouncedHandleResize()},e.handleVisibilityChanged=()=>{this.updateVisibility()},this.elementInfos.push(e),e.observe(),this.debouncedHandleResize(),this.updateVisibility()):this.log.warn("visibility resize observer not triggered",this.logContext)}stopObservingElementInfo(e){if(!this.isAdaptiveStream){this.log.warn("stopObservingElementInfo ignored",this.logContext);return}const t=this.elementInfos.filter(r=>r===e);for(const r of t)r.stopObserving();this.elementInfos=this.elementInfos.filter(r=>r!==e),this.updateVisibility(),this.debouncedHandleResize()}detach(e){let t=[];if(e)return this.stopObservingElement(e),super.detach(e);t=super.detach();for(const r of t)this.stopObservingElement(r);return t}getDecoderImplementation(){var e;return(e=this.prevStats)===null||e===void 0?void 0:e.decoderImplementation}getReceiverStats(){return S(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let t,r="",i=new Map;return e.forEach(A=>{A.type==="inbound-rtp"?(r=A.codecId,t={type:"video",streamId:A.id,framesDecoded:A.framesDecoded,framesDropped:A.framesDropped,framesReceived:A.framesReceived,packetsReceived:A.packetsReceived,packetsLost:A.packetsLost,frameWidth:A.frameWidth,frameHeight:A.frameHeight,pliCount:A.pliCount,firCount:A.firCount,nackCount:A.nackCount,jitter:A.jitter,timestamp:A.timestamp,bytesReceived:A.bytesReceived,decoderImplementation:A.decoderImplementation}):A.type==="codec"&&i.set(A.id,A)}),t&&r!==""&&i.get(r)&&(t.mimeType=i.get(r).mimeType),t})}stopObservingElement(e){const t=this.elementInfos.filter(r=>r.element===e);for(const r of t)this.stopObservingElementInfo(r)}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return S(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),this.isAdaptiveStream&&this.updateVisibility()})}updateVisibility(){var e,t;const r=this.elementInfos.reduce((o,a)=>Math.max(o,a.visibilityChangedAt||0),0),i=!((t=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pauseVideoInBackground)!==null&&t!==void 0)||t?this.isInBackground:!1,A=this.elementInfos.some(o=>o.pictureInPicture),s=this.elementInfos.some(o=>o.visible)&&!i||A;if(this.lastVisible!==s){if(!s&&Date.now()-r<Ad){wt.setTimeout(()=>{this.updateVisibility()},Ad);return}this.lastVisible=s,this.emit(L.VisibilityChanged,s,this)}}updateDimensions(){var e,t;let r=0,i=0;const A=this.getPixelDensity();for(const s of this.elementInfos){const o=s.width()*A,a=s.height()*A;o+a>r+i&&(r=o,i=a)}((e=this.lastDimensions)===null||e===void 0?void 0:e.width)===r&&((t=this.lastDimensions)===null||t===void 0?void 0:t.height)===i||(this.lastDimensions={width:r,height:i},this.emit(L.VideoDimensionsChanged,this.lastDimensions,this))}getPixelDensity(){var e;const t=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pixelDensity;return t==="screen"?Zv():t||(Zv()>2?2:1)}}class Hx{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(e,t){this.onVisibilityChanged=r=>{var i;const{target:A,isIntersecting:s}=r;A===this.element&&(this.isIntersecting=s,this.isPiP=jA(this.element),this.visibilityChangedAt=Date.now(),(i=this.handleVisibilityChanged)===null||i===void 0||i.call(this))},this.onEnterPiP=()=>{var r,i,A;(i=(r=window.documentPictureInPicture)===null||r===void 0?void 0:r.window)===null||i===void 0||i.addEventListener("pagehide",this.onLeavePiP),this.isPiP=jA(this.element),(A=this.handleVisibilityChanged)===null||A===void 0||A.call(this)},this.onLeavePiP=()=>{var r;this.isPiP=jA(this.element),(r=this.handleVisibilityChanged)===null||r===void 0||r.call(this)},this.element=e,this.isIntersecting=t??sd(e),this.isPiP=Ht()&&jA(e),this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){var e,t,r;this.isIntersecting=sd(this.element),this.isPiP=jA(this.element),this.element.handleResize=()=>{var i;(i=this.handleResize)===null||i===void 0||i.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,e0().observe(this.element),$v().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP),(e=window.documentPictureInPicture)===null||e===void 0||e.addEventListener("enter",this.onEnterPiP),(r=(t=window.documentPictureInPicture)===null||t===void 0?void 0:t.window)===null||r===void 0||r.addEventListener("pagehide",this.onLeavePiP)}stopObserving(){var e,t,r,i,A;(e=e0())===null||e===void 0||e.unobserve(this.element),(t=$v())===null||t===void 0||t.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP),(r=window.documentPictureInPicture)===null||r===void 0||r.removeEventListener("enter",this.onEnterPiP),(A=(i=window.documentPictureInPicture)===null||i===void 0?void 0:i.window)===null||A===void 0||A.removeEventListener("pagehide",this.onLeavePiP)}}function jA(n){var e,t;return document.pictureInPictureElement===n?!0:!((e=window.documentPictureInPicture)===null||e===void 0)&&e.window?sd(n,(t=window.documentPictureInPicture)===null||t===void 0?void 0:t.window):!1}function sd(n,e){const t=e||window;let r=n.offsetTop,i=n.offsetLeft;const A=n.offsetWidth,s=n.offsetHeight,{hidden:o}=n,{display:a}=getComputedStyle(n);for(;n.offsetParent;)n=n.offsetParent,r+=n.offsetTop,i+=n.offsetLeft;return r<t.pageYOffset+t.innerHeight&&i<t.pageXOffset+t.innerWidth&&r+s>t.pageYOffset&&i+A>t.pageXOffset&&!o&&a!=="none"}class Hn extends Sn.EventEmitter{constructor(e,t,r,i){var A;super(),this.metadataMuted=!1,this.encryption=Wt.NONE,this.log=ue,this.handleMuted=()=>{this.emit(L.Muted)},this.handleUnmuted=()=>{this.emit(L.Unmuted)},this.log=Ln((A=i==null?void 0:i.loggerName)!==null&&A!==void 0?A:cn.Publication),this.loggerContextCb=this.loggerContextCb,this.setMaxListeners(100),this.kind=e,this.trackSid=t,this.trackName=r,this.source=P.Source.Unknown}setTrack(e){this.track&&(this.track.off(L.Muted,this.handleMuted),this.track.off(L.Unmuted,this.handleUnmuted)),this.track=e,e&&(e.on(L.Muted,this.handleMuted),e.on(L.Unmuted,this.handleUnmuted))}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),_e(this))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return this.track!==void 0}get isEncrypted(){return this.encryption!==Wt.NONE}get audioTrack(){if(Nn(this.track))return this.track}get videoTrack(){if(Pi(this.track))return this.track}updateInfo(e){this.trackSid=e.sid,this.trackName=e.name,this.source=P.sourceFromProto(e.source),this.mimeType=e.mimeType,this.kind===P.Kind.Video&&e.width>0&&(this.dimensions={width:e.width,height:e.height},this.simulcasted=e.simulcast),this.encryption=e.encryption,this.trackInfo=e,this.log.debug("update publication info",Object.assign(Object.assign({},this.logContext),{info:e}))}}(function(n){(function(e){e.Desired="desired",e.Subscribed="subscribed",e.Unsubscribed="unsubscribed"})(n.SubscriptionStatus||(n.SubscriptionStatus={})),function(e){e.Allowed="allowed",e.NotAllowed="not_allowed"}(n.PermissionStatus||(n.PermissionStatus={}))})(Hn||(Hn={}));class od extends Hn{get isUpstreamPaused(){var e;return(e=this.track)===null||e===void 0?void 0:e.isUpstreamPaused}constructor(e,t,r,i){super(e,t.sid,t.name,i),this.track=void 0,this.handleTrackEnded=()=>{this.emit(L.Ended)},this.updateInfo(t),this.setTrack(r)}setTrack(e){this.track&&this.track.off(L.Ended,this.handleTrackEnded),super.setTrack(e),e&&e.on(L.Ended,this.handleTrackEnded)}get isMuted(){return this.track?this.track.isMuted:super.isMuted}get audioTrack(){return super.audioTrack}get videoTrack(){return super.videoTrack}get isLocal(){return!0}mute(){return S(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.mute()})}unmute(){return S(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.unmute()})}pauseUpstream(){return S(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.pauseUpstream()})}resumeUpstream(){return S(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.resumeUpstream()})}getTrackFeatures(){var e;if(Nn(this.track)){const t=this.track.getSourceTrackSettings(),r=new Set;return t.autoGainControl&&r.add(on.TF_AUTO_GAIN_CONTROL),t.echoCancellation&&r.add(on.TF_ECHO_CANCELLATION),t.noiseSuppression&&r.add(on.TF_NOISE_SUPPRESSION),t.channelCount&&t.channelCount>1&&r.add(on.TF_STEREO),!((e=this.options)===null||e===void 0)&&e.dtx||r.add(on.TF_NO_DTX),this.track.enhancedNoiseCancellation&&r.add(on.TF_ENHANCED_NOISE_CANCELLATION),Array.from(r.values())}else return[]}}function la(n,e){return S(this,void 0,void 0,function*(){n??(n={});let t=!1;const{audioProcessor:r,videoProcessor:i,optionsWithoutProcessor:A}=o0(n);let s=A.audio,o=A.video;if(r&&typeof A.audio=="object"&&(A.audio.processor=r),i&&typeof A.video=="object"&&(A.video.processor=i),n.audio&&typeof A.audio=="object"&&typeof A.audio.deviceId=="string"){const l=A.audio.deviceId;A.audio.deviceId={exact:l},t=!0,s=Object.assign(Object.assign({},A.audio),{deviceId:{ideal:l}})}if(A.video&&typeof A.video=="object"&&typeof A.video.deviceId=="string"){const l=A.video.deviceId;A.video.deviceId={exact:l},t=!0,o=Object.assign(Object.assign({},A.video),{deviceId:{ideal:l}})}(A.audio===!0||typeof A.audio=="object"&&!A.audio.deviceId)&&(A.audio={deviceId:"default"}),A.video===!0?A.video={deviceId:"default"}:typeof A.video=="object"&&!A.video.deviceId&&(A.video.deviceId="default");const a=r0(A,m0,v0),c=Kl(a),u=navigator.mediaDevices.getUserMedia(c);A.audio&&(ft.userMediaPromiseMap.set("audioinput",u),u.catch(()=>ft.userMediaPromiseMap.delete("audioinput"))),A.video&&(ft.userMediaPromiseMap.set("videoinput",u),u.catch(()=>ft.userMediaPromiseMap.delete("videoinput")));try{const l=yield u;return yield Promise.all(l.getTracks().map(d=>S(this,void 0,void 0,function*(){const h=d.kind==="audio";let f=h?a.audio:a.video;(typeof f=="boolean"||!f)&&(f={});let p;const g=h?c.audio:c.video;typeof g!="boolean"&&(p=g);const v=d.getSettings().deviceId;p!=null&&p.deviceId&&fr(p.deviceId)!==v?p.deviceId=v:p||(p={deviceId:v});const y=vx(d,p,e);return y.kind===P.Kind.Video?y.source=P.Source.Camera:y.kind===P.Kind.Audio&&(y.source=P.Source.Microphone),y.mediaStream=l,Nn(y)&&r?yield y.setProcessor(r):Pi(y)&&i&&(yield y.setProcessor(i)),y})))}catch(l){if(!t)throw l;return la(Object.assign(Object.assign({},n),{audio:s,video:o}),e)}})}function Kx(n){return S(this,void 0,void 0,function*(){return(yield la({audio:!1,video:n??!0}))[0]})}function Vx(n){return S(this,void 0,void 0,function*(){return(yield la({audio:n??!0,video:!1}))[0]})}var vr;(function(n){n.Excellent="excellent",n.Good="good",n.Poor="poor",n.Lost="lost",n.Unknown="unknown"})(vr||(vr={}));function Gx(n){switch(n){case MA.EXCELLENT:return vr.Excellent;case MA.GOOD:return vr.Good;case MA.POOR:return vr.Poor;case MA.LOST:return vr.Lost;default:return vr.Unknown}}class x0 extends Sn.EventEmitter{get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions)===null||e===void 0?void 0:e.loggerContextCb)===null||t===void 0?void 0:t.call(e))}get isEncrypted(){return this.trackPublications.size>0&&Array.from(this.trackPublications.values()).every(e=>e.isEncrypted)}get isAgent(){var e;return((e=this.permissions)===null||e===void 0?void 0:e.agent)||this.kind===Vo.AGENT}get isActive(){var e;return((e=this.participantInfo)===null||e===void 0?void 0:e.state)===Ei.ACTIVE}get kind(){return this._kind}get attributes(){return Object.freeze(Object.assign({},this._attributes))}constructor(e,t,r,i,A,s){let o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:Vo.STANDARD;var a;super(),this.audioLevel=0,this.isSpeaking=!1,this._connectionQuality=vr.Unknown,this.log=ue,this.log=Ln((a=s==null?void 0:s.loggerName)!==null&&a!==void 0?a:cn.Participant),this.loggerOptions=s,this.setMaxListeners(100),this.sid=e,this.identity=t,this.name=r,this.metadata=i,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this._kind=o,this._attributes=A??{}}getTrackPublications(){return Array.from(this.trackPublications.values())}getTrackPublication(e){for(const[,t]of this.trackPublications)if(t.source===e)return t}getTrackPublicationByName(e){for(const[,t]of this.trackPublications)if(t.trackName===e)return t}waitUntilActive(){return this.isActive?Promise.resolve():this.activeFuture?this.activeFuture.promise:(this.activeFuture=new Ml,this.once(K.Active,()=>{var e,t;(t=(e=this.activeFuture)===null||e===void 0?void 0:e.resolve)===null||t===void 0||t.call(e),this.activeFuture=void 0}),this.activeFuture.promise)}get connectionQuality(){return this._connectionQuality}get isCameraEnabled(){var e;const t=this.getTrackPublication(P.Source.Camera);return!(!((e=t==null?void 0:t.isMuted)!==null&&e!==void 0)||e)}get isMicrophoneEnabled(){var e;const t=this.getTrackPublication(P.Source.Microphone);return!(!((e=t==null?void 0:t.isMuted)!==null&&e!==void 0)||e)}get isScreenShareEnabled(){return!!this.getTrackPublication(P.Source.ScreenShare)}get isLocal(){return!1}get joinedAt(){return this.participantInfo?new Date(Number.parseInt(this.participantInfo.joinedAt.toString())*1e3):new Date}updateInfo(e){var t;return this.participantInfo&&this.participantInfo.sid===e.sid&&this.participantInfo.version>e.version?!1:(this.identity=e.identity,this.sid=e.sid,this._setName(e.name),this._setMetadata(e.metadata),this._setAttributes(e.attributes),e.state===Ei.ACTIVE&&((t=this.participantInfo)===null||t===void 0?void 0:t.state)!==Ei.ACTIVE&&this.emit(K.Active),e.permission&&this.setPermissions(e.permission),this.participantInfo=e,!0)}_setMetadata(e){const t=this.metadata!==e,r=this.metadata;this.metadata=e,t&&this.emit(K.ParticipantMetadataChanged,r)}_setName(e){const t=this.name!==e;this.name=e,t&&this.emit(K.ParticipantNameChanged,e)}_setAttributes(e){const t=ZF(this.attributes,e);this._attributes=e,Object.keys(t).length>0&&this.emit(K.AttributesChanged,t)}setPermissions(e){var t,r,i,A,s,o;const a=this.permissions,c=e.canPublish!==((t=this.permissions)===null||t===void 0?void 0:t.canPublish)||e.canSubscribe!==((r=this.permissions)===null||r===void 0?void 0:r.canSubscribe)||e.canPublishData!==((i=this.permissions)===null||i===void 0?void 0:i.canPublishData)||e.hidden!==((A=this.permissions)===null||A===void 0?void 0:A.hidden)||e.recorder!==((s=this.permissions)===null||s===void 0?void 0:s.recorder)||e.canPublishSources.length!==this.permissions.canPublishSources.length||e.canPublishSources.some((u,l)=>{var d;return u!==((d=this.permissions)===null||d===void 0?void 0:d.canPublishSources[l])})||e.canSubscribeMetrics!==((o=this.permissions)===null||o===void 0?void 0:o.canSubscribeMetrics);return this.permissions=e,c&&this.emit(K.ParticipantPermissionsChanged,a),c}setIsSpeaking(e){e!==this.isSpeaking&&(this.isSpeaking=e,e&&(this.lastSpokeAt=new Date),this.emit(K.IsSpeakingChanged,e))}setConnectionQuality(e){const t=this._connectionQuality;this._connectionQuality=Gx(e),t!==this._connectionQuality&&this.emit(K.ConnectionQualityChanged,this._connectionQuality)}setDisconnected(){var e,t;this.activeFuture&&((t=(e=this.activeFuture).reject)===null||t===void 0||t.call(e,new Error("Participant disconnected")),this.activeFuture=void 0)}setAudioContext(e){this.audioContext=e,this.audioTrackPublications.forEach(t=>Nn(t.track)&&t.track.setAudioContext(e))}addTrackPublication(e){e.on(L.Muted,()=>{this.emit(K.TrackMuted,e)}),e.on(L.Unmuted,()=>{this.emit(K.TrackUnmuted,e)});const t=e;switch(t.track&&(t.track.sid=e.trackSid),this.trackPublications.set(e.trackSid,e),e.kind){case P.Kind.Audio:this.audioTrackPublications.set(e.trackSid,e);break;case P.Kind.Video:this.videoTrackPublications.set(e.trackSid,e);break}}}function jx(n){var e,t,r;if(!n.participantSid&&!n.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new Xm({participantIdentity:(e=n.participantIdentity)!==null&&e!==void 0?e:"",participantSid:(t=n.participantSid)!==null&&t!==void 0?t:"",allTracks:(r=n.allowAll)!==null&&r!==void 0?r:!1,trackSids:n.allowedTrackSids||[]})}const Q0=15e3;class Wx extends x0{constructor(e,t,r,i,A){super(e,t,void 0,void 0,void 0,{loggerName:i.loggerName,loggerContextCb:()=>this.engine.logContext}),this.pendingPublishing=new Set,this.pendingPublishPromises=new Map,this.participantTrackPermissions=[],this.allParticipantsAllowedToSubscribe=!0,this.encryptionType=Wt.NONE,this.enabledPublishVideoCodecs=[],this.pendingAcks=new Map,this.pendingResponses=new Map,this.handleReconnecting=()=>{this.reconnectFuture||(this.reconnectFuture=new Ml)},this.handleReconnected=()=>{var s,o;(o=(s=this.reconnectFuture)===null||s===void 0?void 0:s.resolve)===null||o===void 0||o.call(s),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleDisconnected=()=>{var s,o;this.reconnectFuture&&(this.reconnectFuture.promise.catch(a=>this.log.warn(a.message,this.logContext)),(o=(s=this.reconnectFuture)===null||s===void 0?void 0:s.reject)===null||o===void 0||o.call(s,"Got disconnected during reconnection attempt"),this.reconnectFuture=void 0)},this.handleSignalRequestResponse=s=>{const{requestId:o,reason:a,message:c}=s,u=this.pendingSignalRequests.get(o);u&&(a!==ll.OK&&u.reject(new jv(c,a)),this.pendingSignalRequests.delete(o))},this.handleDataPacket=s=>{switch(s.value.case){case"rpcResponse":let o=s.value.value,a=null,c=null;o.value.case==="payload"?a=o.value.value:o.value.case==="error"&&(c=Ze.fromProto(o.value.value)),this.handleIncomingRpcResponse(o.requestId,a,c);break;case"rpcAck":let u=s.value.value;this.handleIncomingRpcAck(u.requestId);break}},this.updateTrackSubscriptionPermissions=()=>{this.log.debug("updating track subscription permissions",Object.assign(Object.assign({},this.logContext),{allParticipantsAllowed:this.allParticipantsAllowedToSubscribe,participantTrackPermissions:this.participantTrackPermissions})),this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe,this.participantTrackPermissions.map(s=>jx(s)))},this.onTrackUnmuted=s=>{this.onTrackMuted(s,s.isUpstreamPaused)},this.onTrackMuted=(s,o)=>{if(o===void 0&&(o=!0),!s.sid){this.log.error("could not update mute status for unpublished track",Object.assign(Object.assign({},this.logContext),_e(s)));return}this.engine.updateMuteStatus(s.sid,o)},this.onTrackUpstreamPaused=s=>{this.log.debug("upstream paused",Object.assign(Object.assign({},this.logContext),_e(s))),this.onTrackMuted(s,!0)},this.onTrackUpstreamResumed=s=>{this.log.debug("upstream resumed",Object.assign(Object.assign({},this.logContext),_e(s))),this.onTrackMuted(s,s.isMuted)},this.onTrackFeatureUpdate=s=>{const o=this.audioTrackPublications.get(s.sid);if(!o){this.log.warn("Could not update local audio track settings, missing publication for track ".concat(s.sid),this.logContext);return}this.engine.client.sendUpdateLocalAudioTrack(o.trackSid,o.getTrackFeatures())},this.handleSubscribedQualityUpdate=s=>S(this,void 0,void 0,function*(){var o,a,c,u,l,d;if(!(!((l=this.roomOptions)===null||l===void 0)&&l.dynacast))return;const h=this.videoTrackPublications.get(s.trackSid);if(!h){this.log.warn("received subscribed quality update for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:s.trackSid}));return}if(s.subscribedCodecs.length>0){if(!h.videoTrack)return;const v=yield h.videoTrack.setPublishingCodecs(s.subscribedCodecs);try{for(var f=!0,p=ur(v),g;g=yield p.next(),o=g.done,!o;f=!0){u=g.value,f=!1;const y=u;IF(y)&&(this.log.debug("publish ".concat(y," for ").concat(h.videoTrack.sid),Object.assign(Object.assign({},this.logContext),_e(h))),yield this.publishAdditionalCodecForTrack(h.videoTrack,y,h.options))}}catch(y){a={error:y}}finally{try{!f&&!o&&(c=p.return)&&(yield c.call(p))}finally{if(a)throw a.error}}}else s.subscribedQualities.length>0&&(yield(d=h.videoTrack)===null||d===void 0?void 0:d.setPublishingLayers(s.subscribedQualities))}),this.handleLocalTrackUnpublished=s=>{const o=this.trackPublications.get(s.trackSid);if(!o){this.log.warn("received unpublished event for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:s.trackSid}));return}this.unpublishTrack(o.track)},this.handleTrackEnded=s=>S(this,void 0,void 0,function*(){if(s.source===P.Source.ScreenShare||s.source===P.Source.ScreenShareAudio)this.log.debug("unpublishing local track due to TrackEnded",Object.assign(Object.assign({},this.logContext),_e(s))),this.unpublishTrack(s);else if(s.isUserProvided)yield s.mute();else if(Jr(s)||gr(s))try{if(Ht())try{const o=yield navigator==null?void 0:navigator.permissions.query({name:s.source===P.Source.Camera?"camera":"microphone"});if(o&&o.state==="denied")throw this.log.warn("user has revoked access to ".concat(s.source),Object.assign(Object.assign({},this.logContext),_e(s))),o.onchange=()=>{o.state!=="denied"&&(s.isMuted||s.restartTrack(),o.onchange=null)},new Error("GetUserMedia Permission denied")}catch{}s.isMuted||(this.log.debug("track ended, attempting to use a different device",Object.assign(Object.assign({},this.logContext),_e(s))),Jr(s)?yield s.restartTrack({deviceId:"default"}):yield s.restartTrack())}catch{this.log.warn("could not restart track, muting instead",Object.assign(Object.assign({},this.logContext),_e(s))),yield s.mute()}}),this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this.engine=r,this.roomOptions=i,this.setupEngine(r),this.activeDeviceMap=new Map([["audioinput","default"],["videoinput","default"],["audiooutput","default"]]),this.pendingSignalRequests=new Map,this.rpcHandlers=A}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}get isE2EEEnabled(){return this.encryptionType!==Wt.NONE}getTrackPublication(e){const t=super.getTrackPublication(e);if(t)return t}getTrackPublicationByName(e){const t=super.getTrackPublicationByName(e);if(t)return t}setupEngine(e){this.engine=e,this.engine.on(D.RemoteMute,(t,r)=>{const i=this.trackPublications.get(t);!i||!i.track||(r?i.mute():i.unmute())}),this.engine.on(D.Connected,this.handleReconnected).on(D.SignalRestarted,this.handleReconnected).on(D.SignalResumed,this.handleReconnected).on(D.Restarting,this.handleReconnecting).on(D.Resuming,this.handleReconnecting).on(D.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(D.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(D.Disconnected,this.handleDisconnected).on(D.SignalRequestResponse,this.handleSignalRequestResponse).on(D.DataPacketReceived,this.handleDataPacket)}setMetadata(e){return S(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({metadata:e})})}setName(e){return S(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({name:e})})}setAttributes(e){return S(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({attributes:e})})}requestMetadataUpdate(e){return S(this,arguments,void 0,function(t){var r=this;let{metadata:i,name:A,attributes:s}=t;return function*(){return new Promise((o,a)=>S(r,void 0,void 0,function*(){var c,u;try{let l=!1;const d=yield this.engine.client.sendUpdateLocalMetadata((c=i??this.metadata)!==null&&c!==void 0?c:"",(u=A??this.name)!==null&&u!==void 0?u:"",s),h=performance.now();for(this.pendingSignalRequests.set(d,{resolve:o,reject:f=>{a(f),l=!0},values:{name:A,metadata:i,attributes:s}});performance.now()-h<5e3&&!l;){if((!A||this.name===A)&&(!i||this.metadata===i)&&(!s||Object.entries(s).every(f=>{let[p,g]=f;return this.attributes[p]===g||g===""&&!this.attributes[p]}))){this.pendingSignalRequests.delete(d),o();return}yield Nt(50)}a(new jv("Request to update local metadata timed out","TimeoutError"))}catch(l){l instanceof Error&&a(l)}}))}()})}setCameraEnabled(e,t,r){return this.setTrackEnabled(P.Source.Camera,e,t,r)}setMicrophoneEnabled(e,t,r){return this.setTrackEnabled(P.Source.Microphone,e,t,r)}setScreenShareEnabled(e,t,r){return this.setTrackEnabled(P.Source.ScreenShare,e,t,r)}setPermissions(e){const t=this.permissions,r=super.setPermissions(e);return r&&t&&this.emit(K.ParticipantPermissionsChanged,t),r}setE2EEEnabled(e){return S(this,void 0,void 0,function*(){this.encryptionType=e?Wt.GCM:Wt.NONE,yield this.republishAllTracks(void 0,!1)})}setTrackEnabled(e,t,r,i){return S(this,void 0,void 0,function*(){var A,s;this.log.debug("setTrackEnabled",Object.assign(Object.assign({},this.logContext),{source:e,enabled:t})),this.republishPromise&&(yield this.republishPromise);let o=this.getTrackPublication(e);if(t)if(o)yield o.unmute();else{let a;if(this.pendingPublishing.has(e)){const c=yield this.waitForPendingPublicationOfSource(e);return c||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e})),yield c==null?void 0:c.unmute(),c}this.pendingPublishing.add(e);try{switch(e){case P.Source.Camera:a=yield this.createTracks({video:(A=r)!==null&&A!==void 0?A:!0});break;case P.Source.Microphone:a=yield this.createTracks({audio:(s=r)!==null&&s!==void 0?s:!0});break;case P.Source.ScreenShare:a=yield this.createScreenTracks(Object.assign({},r));break;default:throw new Dn(e)}}catch(c){throw a==null||a.forEach(u=>{u.stop()}),c instanceof Error&&this.emit(K.MediaDevicesError,c),this.pendingPublishing.delete(e),c}try{const c=[];for(const l of a)this.log.info("publishing track",Object.assign(Object.assign({},this.logContext),_e(l))),c.push(this.publishTrack(l,i));[o]=yield Promise.all(c)}catch(c){throw a==null||a.forEach(u=>{u.stop()}),c}finally{this.pendingPublishing.delete(e)}}else if(!(o!=null&&o.track)&&this.pendingPublishing.has(e)&&(o=yield this.waitForPendingPublicationOfSource(e),o||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e}))),o&&o.track)if(e===P.Source.ScreenShare){o=yield this.unpublishTrack(o.track);const a=this.getTrackPublication(P.Source.ScreenShareAudio);a&&a.track&&this.unpublishTrack(a.track)}else yield o.mute();return o})}enableCameraAndMicrophone(){return S(this,void 0,void 0,function*(){if(!(this.pendingPublishing.has(P.Source.Camera)||this.pendingPublishing.has(P.Source.Microphone))){this.pendingPublishing.add(P.Source.Camera),this.pendingPublishing.add(P.Source.Microphone);try{const e=yield this.createTracks({audio:!0,video:!0});yield Promise.all(e.map(t=>this.publishTrack(t)))}finally{this.pendingPublishing.delete(P.Source.Camera),this.pendingPublishing.delete(P.Source.Microphone)}}})}createTracks(e){return S(this,void 0,void 0,function*(){var t,r;e??(e={});const i=r0(e,(t=this.roomOptions)===null||t===void 0?void 0:t.audioCaptureDefaults,(r=this.roomOptions)===null||r===void 0?void 0:r.videoCaptureDefaults);try{return(yield la(i,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext})).map(o=>(Nn(o)&&(this.microphoneError=void 0,o.setAudioContext(this.audioContext),o.source=P.Source.Microphone,this.emit(K.AudioStreamAcquired)),Pi(o)&&(this.cameraError=void 0,o.source=P.Source.Camera),o))}catch(A){throw A instanceof Error&&(e.audio&&(this.microphoneError=A),e.video&&(this.cameraError=A)),A}})}createScreenTracks(e){return S(this,void 0,void 0,function*(){if(e===void 0&&(e={}),navigator.mediaDevices.getDisplayMedia===void 0)throw new Bl("getDisplayMedia not supported");e.resolution===void 0&&!OF()&&(e.resolution=Tl.h1080fps30.resolution);const t=zF(e),r=yield navigator.mediaDevices.getDisplayMedia(t),i=r.getVideoTracks();if(i.length===0)throw new Dn("no video track found");const A=new ua(i[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});A.source=P.Source.ScreenShare,e.contentHint&&(A.mediaStreamTrack.contentHint=e.contentHint);const s=[A];if(r.getAudioTracks().length>0){this.emit(K.AudioStreamAcquired);const o=new aa(r.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});o.source=P.Source.ScreenShareAudio,s.push(o)}return s})}publishTrack(e,t){return S(this,void 0,void 0,function*(){return this.publishOrRepublishTrack(e,t)})}publishOrRepublishTrack(e,t){return S(this,arguments,void 0,function(r,i){var A=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function*(){var o,a,c,u;Jr(r)&&r.setAudioContext(A.audioContext),yield(o=A.reconnectFuture)===null||o===void 0?void 0:o.promise,A.republishPromise&&!s&&(yield A.republishPromise),Ri(r)&&A.pendingPublishPromises.has(r)&&(yield A.pendingPublishPromises.get(r));let l;if(r instanceof MediaStreamTrack)l=r.getConstraints();else{l=r.constraints;let v;switch(r.source){case P.Source.Microphone:v="audioinput";break;case P.Source.Camera:v="videoinput"}v&&A.activeDeviceMap.has(v)&&(l=Object.assign(Object.assign({},l),{deviceId:A.activeDeviceMap.get(v)}))}if(r instanceof MediaStreamTrack)switch(r.kind){case"audio":r=new aa(r,l,!0,A.audioContext,{loggerName:A.roomOptions.loggerName,loggerContextCb:()=>A.logContext});break;case"video":r=new ua(r,l,!0,{loggerName:A.roomOptions.loggerName,loggerContextCb:()=>A.logContext});break;default:throw new Dn("unsupported MediaStreamTrack kind ".concat(r.kind))}else r.updateLoggerOptions({loggerName:A.roomOptions.loggerName,loggerContextCb:()=>A.logContext});let d;if(A.trackPublications.forEach(v=>{v.track&&v.track===r&&(d=v)}),d)return A.log.warn("track has already been published, skipping",Object.assign(Object.assign({},A.logContext),_e(d))),d;const h="channelCount"in r.mediaStreamTrack.getSettings()&&r.mediaStreamTrack.getSettings().channelCount===2||r.mediaStreamTrack.getConstraints().channelCount===2,f=(a=i==null?void 0:i.forceStereo)!==null&&a!==void 0?a:h;f&&(i||(i={}),i.dtx===void 0&&A.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",Object.assign(Object.assign({},A.logContext),_e(r))),i.red===void 0&&A.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),(c=i.dtx)!==null&&c!==void 0||(i.dtx=!1),(u=i.red)!==null&&u!==void 0||(i.red=!1));const p=Object.assign(Object.assign({},A.roomOptions.publishDefaults),i);!MF()&&A.roomOptions.e2ee&&(A.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2",Object.assign({},A.logContext)),p.simulcast=!1),p.source&&(r.source=p.source);const g=new Promise((v,y)=>S(A,void 0,void 0,function*(){try{if(this.engine.client.currentState!==Oe.CONNECTED){this.log.debug("deferring track publication until signal is connected",Object.assign(Object.assign({},this.logContext),{track:_e(r)}));const B=()=>S(this,void 0,void 0,function*(){try{const b=yield this.publish(r,p,f);v(b)}catch(b){y(b)}});setTimeout(()=>{this.engine.off(D.SignalConnected,B),y(new _l("publishing rejected as engine not connected within timeout",408))},15e3),this.engine.once(D.SignalConnected,B),this.engine.on(D.Closing,()=>{this.engine.off(D.SignalConnected,B),y(new _l("publishing rejected as engine closed",499))})}else try{const B=yield this.publish(r,p,f);v(B)}catch(B){y(B)}}catch(B){y(B)}}));A.pendingPublishPromises.set(r,g);try{return yield g}catch(v){throw v}finally{A.pendingPublishPromises.delete(r)}}()})}hasPermissionsToPublish(e){if(!this.permissions)return this.log.warn("no permissions present for publishing track",Object.assign(Object.assign({},this.logContext),_e(e))),!1;const{canPublish:t,canPublishSources:r}=this.permissions;return t&&(r.length===0||r.map(i=>$F(i)).includes(e.source))?!0:(this.log.warn("insufficient permissions to publish",Object.assign(Object.assign({},this.logContext),_e(e))),!1)}publish(e,t,r){return S(this,void 0,void 0,function*(){var i,A,s,o,a,c,u,l,d,h;if(!this.hasPermissionsToPublish(e))throw new _l("failed to publish track, insufficient permissions",403);Array.from(this.trackPublications.values()).find(w=>Ri(e)&&w.source===e.source)&&e.source!==P.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(e.source),Object.assign(Object.assign({},this.logContext),_e(e))),t.stopMicTrackOnMute&&Nn(e)&&(e.stopOnMute=!0),e.source===P.Source.ScreenShare&&Qi()&&(t.simulcast=!1),t.videoCodec==="av1"&&!QF()&&(t.videoCodec=void 0),t.videoCodec==="vp9"&&!RF()&&(t.videoCodec=void 0),t.videoCodec===void 0&&(t.videoCodec=Xl),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some(w=>t.videoCodec===Aa(w.mime))||(t.videoCodec=Aa(this.enabledPublishVideoCodecs[0].mime)));const p=t.videoCodec;e.on(L.Muted,this.onTrackMuted),e.on(L.Unmuted,this.onTrackUnmuted),e.on(L.Ended,this.handleTrackEnded),e.on(L.UpstreamPaused,this.onTrackUpstreamPaused),e.on(L.UpstreamResumed,this.onTrackUpstreamResumed),e.on(L.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate);const g=new sl({cid:e.mediaStreamTrack.id,name:t.name,type:P.kindToProto(e.kind),muted:e.isMuted,source:P.sourceToProto(e.source),disableDtx:!(!((i=t.dtx)!==null&&i!==void 0)||i),encryption:this.encryptionType,stereo:r,disableRed:this.isE2EEEnabled||!(!((A=t.red)!==null&&A!==void 0)||A),stream:t==null?void 0:t.stream,backupCodecPolicy:t==null?void 0:t.backupCodecPolicy});let v;if(e.kind===P.Kind.Video){let w={width:0,height:0};try{w=yield e.waitForDimensions()}catch{const k=(o=(s=this.roomOptions.videoCaptureDefaults)===null||s===void 0?void 0:s.resolution)!==null&&o!==void 0?o:HA.h720.resolution;w={width:k.width,height:k.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign(Object.assign({},this.logContext),_e(e)),{dims:w}))}g.width=w.width,g.height=w.height,gr(e)&&(KA(p)&&(e.source===P.Source.ScreenShare&&(t.scalabilityMode="L1T3","contentHint"in e.mediaStreamTrack&&(e.mediaStreamTrack.contentHint="motion",this.log.info("forcing contentHint to motion for screenshare with SVC codecs",Object.assign(Object.assign({},this.logContext),_e(e))))),t.scalabilityMode=(a=t.scalabilityMode)!==null&&a!==void 0?a:"L3T3_KEY"),g.simulcastCodecs=[new Al({codec:p,cid:e.mediaStreamTrack.id})],t.backupCodec===!0&&(t.backupCodec={codec:Xl}),t.backupCodec&&p!==t.backupCodec.codec&&g.encryption===Wt.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),g.simulcastCodecs.push(new Al({codec:t.backupCodec.codec,cid:""})))),v=td(e.source===P.Source.ScreenShare,g.width,g.height,t),g.layers=k0(g.width,g.height,v,KA(t.videoCodec))}else e.kind===P.Kind.Audio&&(v=[{maxBitrate:(c=t.audioPreset)===null||c===void 0?void 0:c.maxBitrate,priority:(l=(u=t.audioPreset)===null||u===void 0?void 0:u.priority)!==null&&l!==void 0?l:"high",networkPriority:(h=(d=t.audioPreset)===null||d===void 0?void 0:d.priority)!==null&&h!==void 0?h:"high"}]);if(!this.engine||this.engine.isClosed)throw new lt("cannot publish track when not connected");const y=()=>S(this,void 0,void 0,function*(){var w,_,k;if(!this.engine.pcManager)throw new lt("pcManager is not ready");if(e.sender=yield this.engine.createSender(e,t,v),gr(e)&&((w=t.degradationPreference)!==null&&w!==void 0||(t.degradationPreference=Ux(e)),e.setDegradationPreference(t.degradationPreference)),v)if(Qi()&&e.kind===P.Kind.Audio){let F;for(const x of this.engine.pcManager.publisher.getTransceivers())if(x.sender===e.sender){F=x;break}F&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:F,codec:"opus",maxbr:!((_=v[0])===null||_===void 0)&&_.maxBitrate?v[0].maxBitrate/1e3:0})}else e.codec&&KA(e.codec)&&(!((k=v[0])===null||k===void 0)&&k.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:g.cid,codec:e.codec,maxbr:v[0].maxBitrate/1e3});yield this.engine.negotiate()});let B;if(this.enabledPublishVideoCodecs.length>0)B=(yield Promise.all([this.engine.addTrack(g),y()]))[0];else{B=yield this.engine.addTrack(g);let w;if(B.codecs.forEach(_=>{w===void 0&&(w=_.mimeType)}),w&&e.kind===P.Kind.Video){const _=Aa(w);_!==p&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign(Object.assign({},this.logContext),_e(e)),{codec:_})),t.videoCodec=_,v=td(e.source===P.Source.ScreenShare,g.width,g.height,t))}yield y()}const b=new od(e.kind,B,e,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});return b.options=t,e.sid=B.sid,this.log.debug("publishing ".concat(e.kind," with encodings"),Object.assign(Object.assign({},this.logContext),{encodings:v,trackInfo:B})),gr(e)?e.startMonitor(this.engine.client):Jr(e)&&e.startMonitor(),this.addTrackPublication(b),this.emit(K.LocalTrackPublished,b),b})}get isLocal(){return!0}publishAdditionalCodecForTrack(e,t,r){return S(this,void 0,void 0,function*(){var i;if(this.encryptionType!==Wt.NONE)return;let A;if(this.trackPublications.forEach(h=>{h.track&&h.track===e&&(A=h)}),!A)throw new Dn("track is not published");if(!gr(e))throw new Dn("track is not a video track");const s=Object.assign(Object.assign({},(i=this.roomOptions)===null||i===void 0?void 0:i.publishDefaults),r),o=Sx(e,t,s);if(!o){this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",Object.assign(Object.assign({},this.logContext),_e(e)));return}const a=e.addSimulcastTrack(t,o);if(!a)return;const c=new sl({cid:a.mediaStreamTrack.id,type:P.kindToProto(e.kind),muted:e.isMuted,source:P.sourceToProto(e.source),sid:e.sid,simulcastCodecs:[{codec:s.videoCodec,cid:a.mediaStreamTrack.id}]});if(c.layers=k0(c.width,c.height,o),!this.engine||this.engine.isClosed)throw new lt("cannot publish track when not connected");const u=()=>S(this,void 0,void 0,function*(){yield this.engine.createSimulcastSender(e,a,s,o),yield this.engine.negotiate()}),d=(yield Promise.all([this.engine.addTrack(c),u()]))[0];this.log.debug("published ".concat(t," for track ").concat(e.sid),Object.assign(Object.assign({},this.logContext),{encodings:o,trackInfo:d}))})}unpublishTrack(e,t){return S(this,void 0,void 0,function*(){var r,i;if(Ri(e)){const c=this.pendingPublishPromises.get(e);c&&(this.log.info("awaiting publish promise before attempting to unpublish",Object.assign(Object.assign({},this.logContext),_e(e))),yield c)}const A=this.getPublicationForTrack(e),s=A?_e(A):void 0;if(this.log.debug("unpublishing track",Object.assign(Object.assign({},this.logContext),s)),!A||!A.track){this.log.warn("track was not unpublished because no publication was found",Object.assign(Object.assign({},this.logContext),s));return}e=A.track,e.off(L.Muted,this.onTrackMuted),e.off(L.Unmuted,this.onTrackUnmuted),e.off(L.Ended,this.handleTrackEnded),e.off(L.UpstreamPaused,this.onTrackUpstreamPaused),e.off(L.UpstreamResumed,this.onTrackUpstreamResumed),e.off(L.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),t===void 0&&(t=(i=(r=this.roomOptions)===null||r===void 0?void 0:r.stopLocalTrackOnUnpublish)!==null&&i!==void 0?i:!0),t?e.stop():e.stopMonitor();let o=!1;const a=e.sender;if(e.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<Ye.FAILED&&a)try{for(const c of this.engine.pcManager.publisher.getTransceivers())c.sender===a&&(c.direction="inactive",o=!0);if(this.engine.removeTrack(a)&&(o=!0),gr(e)){for(const[,c]of e.simulcastCodecs)c.sender&&(this.engine.removeTrack(c.sender)&&(o=!0),c.sender=void 0);e.simulcastCodecs.clear()}}catch(c){this.log.warn("failed to unpublish track",Object.assign(Object.assign(Object.assign({},this.logContext),s),{error:c}))}switch(this.trackPublications.delete(A.trackSid),A.kind){case P.Kind.Audio:this.audioTrackPublications.delete(A.trackSid);break;case P.Kind.Video:this.videoTrackPublications.delete(A.trackSid);break}return this.emit(K.LocalTrackUnpublished,A),A.setTrack(void 0),o&&(yield this.engine.negotiate()),A})}unpublishTracks(e){return S(this,void 0,void 0,function*(){return(yield Promise.all(e.map(r=>this.unpublishTrack(r)))).filter(r=>!!r)})}republishAllTracks(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){r.republishPromise&&(yield r.republishPromise),r.republishPromise=new Promise((A,s)=>S(r,void 0,void 0,function*(){try{const o=[];this.trackPublications.forEach(a=>{a.track&&(t&&(a.options=Object.assign(Object.assign({},a.options),t)),o.push(a))}),yield Promise.all(o.map(a=>S(this,void 0,void 0,function*(){const c=a.track;yield this.unpublishTrack(c,!1),i&&!c.isMuted&&c.source!==P.Source.ScreenShare&&c.source!==P.Source.ScreenShareAudio&&(Jr(c)||gr(c))&&!c.isUserProvided&&(this.log.debug("restarting existing track",Object.assign(Object.assign({},this.logContext),{track:a.trackSid})),yield c.restartTrack()),yield this.publishOrRepublishTrack(c,a.options,!0)}))),A()}catch(o){s(o)}finally{this.republishPromise=void 0}})),yield r.republishPromise}()})}publishData(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){const A=i.reliable?pe.RELIABLE:pe.LOSSY,s=i.destinationIdentities,o=i.topic,a=new Dt({kind:A,value:{case:"user",value:new Im({participantIdentity:r.identity,payload:t,destinationIdentities:s,topic:o})}});yield r.engine.sendDataPacket(a,A)}()})}publishDtmf(e,t){return S(this,void 0,void 0,function*(){const r=new Dt({kind:pe.RELIABLE,value:{case:"sipDtmf",value:new Fm({code:e,digit:t})}});yield this.engine.sendDataPacket(r,pe.RELIABLE)})}sendChatMessage(e,t){return S(this,void 0,void 0,function*(){const r={id:crypto.randomUUID(),message:e,timestamp:Date.now(),attachedFiles:t==null?void 0:t.attachments},i=new Dt({value:{case:"chatMessage",value:new $u(Object.assign(Object.assign({},r),{timestamp:Ke.parse(r.timestamp)}))}});return yield this.engine.sendDataPacket(i,pe.RELIABLE),this.emit(K.ChatMessage,r),r})}editChatMessage(e,t){return S(this,void 0,void 0,function*(){const r=Object.assign(Object.assign({},t),{message:e,editTimestamp:Date.now()}),i=new Dt({value:{case:"chatMessage",value:new $u(Object.assign(Object.assign({},r),{timestamp:Ke.parse(r.timestamp),editTimestamp:Ke.parse(r.editTimestamp)}))}});return yield this.engine.sendDataPacket(i,pe.RELIABLE),this.emit(K.ChatMessage,r),r})}sendText(e,t){return S(this,void 0,void 0,function*(){var r;const i=crypto.randomUUID(),s=new TextEncoder().encode(e).byteLength,o=(r=t==null?void 0:t.attachments)===null||r===void 0?void 0:r.map(()=>crypto.randomUUID()),a=new Array(o?o.length+1:1).fill(0),c=(l,d)=>{var h;a[d]=l;const f=a.reduce((p,g)=>p+g,0);(h=t==null?void 0:t.onProgress)===null||h===void 0||h.call(t,f)},u=yield this.streamText({streamId:i,totalSize:s,destinationIdentities:t==null?void 0:t.destinationIdentities,topic:t==null?void 0:t.topic,attachedStreamIds:o,attributes:t==null?void 0:t.attributes});return yield u.write(e),c(1,0),yield u.close(),t!=null&&t.attachments&&o&&(yield Promise.all(t.attachments.map((l,d)=>S(this,void 0,void 0,function*(){return this._sendFile(o[d],l,{topic:t.topic,mimeType:l.type,onProgress:h=>{c(h,d+1)}})})))),u.info})}streamText(e){return S(this,void 0,void 0,function*(){var t,r;const i=(t=e==null?void 0:e.streamId)!==null&&t!==void 0?t:crypto.randomUUID(),A={id:i,mimeType:"text/plain",timestamp:Date.now(),topic:(r=e==null?void 0:e.topic)!==null&&r!==void 0?r:"",size:e==null?void 0:e.totalSize,attributes:e==null?void 0:e.attributes},s=new tl({streamId:i,mimeType:A.mimeType,topic:A.topic,timestamp:qr(A.timestamp),totalLength:qr(e==null?void 0:e.totalSize),attributes:A.attributes,contentHeader:{case:"textHeader",value:new Km({version:e==null?void 0:e.version,attachedStreamIds:e==null?void 0:e.attachedStreamIds,replyToStreamId:e==null?void 0:e.replyToStreamId,operationType:(e==null?void 0:e.type)==="update"?el.UPDATE:el.CREATE})}}),o=e==null?void 0:e.destinationIdentities,a=new Dt({destinationIdentities:o,value:{case:"streamHeader",value:s}});yield this.engine.sendDataPacket(a,pe.RELIABLE);let c=0;const u=this,l=new WritableStream({write(f){return S(this,void 0,void 0,function*(){for(const p of qF(f,Q0)){yield u.engine.waitForBufferStatusLow(pe.RELIABLE);const g=new nl({content:p,streamId:i,chunkIndex:qr(c)}),v=new Dt({destinationIdentities:o,value:{case:"streamChunk",value:g}});yield u.engine.sendDataPacket(v,pe.RELIABLE),c+=1}})},close(){return S(this,void 0,void 0,function*(){const f=new rl({streamId:i}),p=new Dt({destinationIdentities:o,value:{case:"streamTrailer",value:f}});yield u.engine.sendDataPacket(p,pe.RELIABLE)})},abort(f){console.log("Sink error:",f)}});let d=()=>S(this,void 0,void 0,function*(){yield h.close()});u.engine.once(D.Closing,d);const h=new Mx(l,A,()=>this.engine.off(D.Closing,d));return h})}sendFile(e,t){return S(this,void 0,void 0,function*(){const r=crypto.randomUUID();return yield this._sendFile(r,e,t),{id:r}})}_sendFile(e,t,r){return S(this,void 0,void 0,function*(){var i;const A=yield this.streamBytes({streamId:e,totalSize:t.size,name:t.name,mimeType:(i=r==null?void 0:r.mimeType)!==null&&i!==void 0?i:t.type,topic:r==null?void 0:r.topic,destinationIdentities:r==null?void 0:r.destinationIdentities}),s=t.stream().getReader();for(;;){const{done:o,value:a}=yield s.read();if(o)break;yield A.write(a)}return yield A.close(),A.info})}streamBytes(e){return S(this,void 0,void 0,function*(){var t,r,i,A,s;const o=(t=e==null?void 0:e.streamId)!==null&&t!==void 0?t:crypto.randomUUID(),a=e==null?void 0:e.destinationIdentities,c={id:o,mimeType:(r=e==null?void 0:e.mimeType)!==null&&r!==void 0?r:"application/octet-stream",topic:(i=e==null?void 0:e.topic)!==null&&i!==void 0?i:"",timestamp:Date.now(),attributes:e==null?void 0:e.attributes,size:e==null?void 0:e.totalSize,name:(A=e==null?void 0:e.name)!==null&&A!==void 0?A:"unknown"},u=new tl({totalLength:qr((s=c.size)!==null&&s!==void 0?s:0),mimeType:c.mimeType,streamId:o,topic:c.topic,timestamp:qr(Date.now()),attributes:c.attributes,contentHeader:{case:"byteHeader",value:new Vm({name:c.name})}}),l=new Dt({destinationIdentities:a,value:{case:"streamHeader",value:u}});yield this.engine.sendDataPacket(l,pe.RELIABLE);let d=0;const h=new Mt,f=this.engine,p=this.log,g=new WritableStream({write(y){return S(this,void 0,void 0,function*(){const B=yield h.lock();let b=0;try{for(;b<y.byteLength;){const w=y.slice(b,b+Q0);yield f.waitForBufferStatusLow(pe.RELIABLE);const _=new Dt({destinationIdentities:a,value:{case:"streamChunk",value:new nl({content:w,streamId:o,chunkIndex:qr(d)})}});yield f.sendDataPacket(_,pe.RELIABLE),d+=1,b+=w.byteLength}}finally{B()}})},close(){return S(this,void 0,void 0,function*(){const y=new rl({streamId:o}),B=new Dt({destinationIdentities:a,value:{case:"streamTrailer",value:y}});yield f.sendDataPacket(B,pe.RELIABLE)})},abort(y){p.error("Sink error:",y)}});return new Lx(g,c)})}performRpc(e){return S(this,arguments,void 0,function(t){var r=this;let{destinationIdentity:i,method:A,payload:s,responseTimeout:o=1e4}=t;return function*(){return new Promise((c,u)=>S(r,void 0,void 0,function*(){var l,d,h,f;if(Zl(s)>y0){u(Ze.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));return}if(!((d=(l=this.engine.latestJoinResponse)===null||l===void 0?void 0:l.serverInfo)===null||d===void 0)&&d.version&&Wr((f=(h=this.engine.latestJoinResponse)===null||h===void 0?void 0:h.serverInfo)===null||f===void 0?void 0:f.version,"1.8.0")<0){u(Ze.builtIn("UNSUPPORTED_SERVER"));return}const p=crypto.randomUUID();yield this.publishRpcRequest(i,p,A,s,o-2e3);const g=setTimeout(()=>{this.pendingAcks.delete(p),u(Ze.builtIn("CONNECTION_TIMEOUT")),this.pendingResponses.delete(p),clearTimeout(v)},2e3);this.pendingAcks.set(p,{resolve:()=>{clearTimeout(g)},participantIdentity:i});const v=setTimeout(()=>{this.pendingResponses.delete(p),u(Ze.builtIn("RESPONSE_TIMEOUT"))},o);this.pendingResponses.set(p,{resolve:(y,B)=>{clearTimeout(v),this.pendingAcks.has(p)&&(console.warn("RPC response received before ack",p),this.pendingAcks.delete(p),clearTimeout(g)),B?u(B):c(y??"")},participantIdentity:i})}))}()})}registerRpcMethod(e,t){this.rpcHandlers.has(e)&&this.log.warn("you're overriding the RPC handler for method ".concat(e,", in the future this will throw an error")),this.rpcHandlers.set(e,t)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}setTrackSubscriptionPermissions(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];this.participantTrackPermissions=t,this.allParticipantsAllowedToSubscribe=e,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}handleIncomingRpcAck(e){const t=this.pendingAcks.get(e);t?(t.resolve(),this.pendingAcks.delete(e)):console.error("Ack received for unexpected RPC request",e)}handleIncomingRpcResponse(e,t,r){const i=this.pendingResponses.get(e);i?(i.resolve(t,r),this.pendingResponses.delete(e)):console.error("Response received for unexpected RPC request",e)}publishRpcRequest(e,t,r,i,A){return S(this,void 0,void 0,function*(){const s=new Dt({destinationIdentities:[e],kind:pe.RELIABLE,value:{case:"rpcRequest",value:new xm({id:t,method:r,payload:i,responseTimeoutMs:A,version:1})}});yield this.engine.sendDataPacket(s,pe.RELIABLE)})}handleParticipantDisconnected(e){for(const[t,{participantIdentity:r}]of this.pendingAcks)r===e&&this.pendingAcks.delete(t);for(const[t,{participantIdentity:r,resolve:i}]of this.pendingResponses)r===e&&(i(null,Ze.builtIn("RECIPIENT_DISCONNECTED")),this.pendingResponses.delete(t))}setEnabledPublishCodecs(e){this.enabledPublishVideoCodecs=e.filter(t=>t.mime.split("/")[0].toLowerCase()==="video")}updateInfo(e){return super.updateInfo(e)?(e.tracks.forEach(t=>{var r,i;const A=this.trackPublications.get(t.sid);if(A){const s=A.isMuted||((i=(r=A.track)===null||r===void 0?void 0:r.isUpstreamPaused)!==null&&i!==void 0?i:!1);s!==t.muted&&(this.log.debug("updating server mute state after reconcile",Object.assign(Object.assign(Object.assign({},this.logContext),_e(A)),{mutedOnServer:s})),this.engine.client.sendMuteTrack(t.sid,s))}}),!0):!1}getPublicationForTrack(e){let t;return this.trackPublications.forEach(r=>{const i=r.track;i&&(e instanceof MediaStreamTrack?(Jr(i)||gr(i))&&i.mediaStreamTrack===e&&(t=r):e===i&&(t=r))}),t}waitForPendingPublicationOfSource(e){return S(this,void 0,void 0,function*(){const r=Date.now();for(;Date.now()<r+1e4;){const i=Array.from(this.pendingPublishPromises.entries()).find(A=>{let[s]=A;return s.source===e});if(i)return i[1];yield Nt(20)}})}}class qx extends Hn{constructor(e,t,r,i){super(e,t.sid,t.name,i),this.track=void 0,this.allowed=!0,this.disabled=!1,this.currentVideoQuality=Yt.HIGH,this.handleEnded=A=>{this.setTrack(void 0),this.emit(L.Ended,A)},this.handleVisibilityChange=A=>{this.log.debug("adaptivestream video visibility ".concat(this.trackSid,", visible=").concat(A),this.logContext),this.disabled=!A,this.emitTrackUpdate()},this.handleVideoDimensionsChange=A=>{this.log.debug("adaptivestream video dimensions ".concat(A.width,"x").concat(A.height),this.logContext),this.videoDimensions=A,this.emitTrackUpdate()},this.subscribed=r,this.updateInfo(t)}setSubscribed(e){const t=this.subscriptionStatus,r=this.permissionStatus;this.subscribed=e,e&&(this.allowed=!0);const i=new Go({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new Om({participantSid:"",trackSids:[this.trackSid]})]});this.emit(L.UpdateSubscription,i),this.emitSubscriptionUpdateIfChanged(t),this.emitPermissionUpdateIfChanged(r)}get subscriptionStatus(){return this.subscribed===!1?Hn.SubscriptionStatus.Unsubscribed:super.isSubscribed?Hn.SubscriptionStatus.Subscribed:Hn.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?Hn.PermissionStatus.Allowed:Hn.PermissionStatus.NotAllowed}get isSubscribed(){return this.subscribed===!1?!1:super.isSubscribed}get isDesired(){return this.subscribed!==!1}get isEnabled(){return!this.disabled}get isLocal(){return!1}setEnabled(e){!this.isManualOperationAllowed()||this.disabled===!e||(this.disabled=!e,this.emitTrackUpdate())}setVideoQuality(e){!this.isManualOperationAllowed()||this.currentVideoQuality===e||(this.currentVideoQuality=e,this.videoDimensions=void 0,this.emitTrackUpdate())}setVideoDimensions(e){var t,r;this.isManualOperationAllowed()&&(((t=this.videoDimensions)===null||t===void 0?void 0:t.width)===e.width&&((r=this.videoDimensions)===null||r===void 0?void 0:r.height)===e.height||(Nl(this.track)&&(this.videoDimensions=e),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(e){this.isManualOperationAllowed()&&Nl(this.track)&&this.fps!==e&&(this.fps=e,this.emitTrackUpdate())}get videoQuality(){return this.currentVideoQuality}setTrack(e){const t=this.subscriptionStatus,r=this.permissionStatus,i=this.track;i!==e&&(i&&(i.off(L.VideoDimensionsChanged,this.handleVideoDimensionsChange),i.off(L.VisibilityChanged,this.handleVisibilityChange),i.off(L.Ended,this.handleEnded),i.detach(),i.stopMonitor(),this.emit(L.Unsubscribed,i)),super.setTrack(e),e&&(e.sid=this.trackSid,e.on(L.VideoDimensionsChanged,this.handleVideoDimensionsChange),e.on(L.VisibilityChanged,this.handleVisibilityChange),e.on(L.Ended,this.handleEnded),this.emit(L.Subscribed,e)),this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(t))}setAllowed(e){const t=this.subscriptionStatus,r=this.permissionStatus;this.allowed=e,this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(t)}setSubscriptionError(e){this.emit(L.SubscriptionFailed,e)}updateInfo(e){super.updateInfo(e);const t=this.metadataMuted;this.metadataMuted=e.muted,this.track?this.track.setMuted(e.muted):t!==e.muted&&this.emit(e.muted?L.Muted:L.Unmuted)}emitSubscriptionUpdateIfChanged(e){const t=this.subscriptionStatus;e!==t&&this.emit(L.SubscriptionStatusChanged,t,e)}emitPermissionUpdateIfChanged(e){this.permissionStatus!==e&&this.emit(L.SubscriptionPermissionChanged,this.permissionStatus,e)}isManualOperationAllowed(){return this.kind===P.Kind.Video&&this.isAdaptiveStream?(this.log.warn("adaptive stream is enabled, cannot change video track settings",this.logContext),!1):this.isDesired?!0:(this.log.warn("cannot update track settings when not subscribed",this.logContext),!1)}get isAdaptiveStream(){return Nl(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const e=new jm({trackSids:[this.trackSid],disabled:this.disabled,fps:this.fps});this.videoDimensions?(e.width=Math.ceil(this.videoDimensions.width),e.height=Math.ceil(this.videoDimensions.height)):this.currentVideoQuality!==void 0?e.quality=this.currentVideoQuality:e.quality=Yt.HIGH,this.emit(L.UpdateSettings,e)}}class da extends x0{static fromParticipantInfo(e,t,r){return new da(e,t.sid,t.identity,t.name,t.metadata,t.attributes,r,t.kind)}get logContext(){return Object.assign(Object.assign({},super.logContext),{rpID:this.sid,remoteParticipant:this.identity})}constructor(e,t,r,i,A,s,o){let a=arguments.length>7&&arguments[7]!==void 0?arguments[7]:Vo.STANDARD;super(t,r||"",i,A,s,o,a),this.signalClient=e,this.trackPublications=new Map,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.volumeMap=new Map}addTrackPublication(e){super.addTrackPublication(e),e.on(L.UpdateSettings,t=>{this.log.debug("send update settings",Object.assign(Object.assign({},this.logContext),_e(e))),this.signalClient.sendUpdateTrackSettings(t)}),e.on(L.UpdateSubscription,t=>{t.participantTracks.forEach(r=>{r.participantSid=this.sid}),this.signalClient.sendUpdateSubscription(t)}),e.on(L.SubscriptionPermissionChanged,t=>{this.emit(K.TrackSubscriptionPermissionChanged,e,t)}),e.on(L.SubscriptionStatusChanged,t=>{this.emit(K.TrackSubscriptionStatusChanged,e,t)}),e.on(L.Subscribed,t=>{this.emit(K.TrackSubscribed,t,e)}),e.on(L.Unsubscribed,t=>{this.emit(K.TrackUnsubscribed,t,e)}),e.on(L.SubscriptionFailed,t=>{this.emit(K.TrackSubscriptionFailed,e.trackSid,t)})}getTrackPublication(e){const t=super.getTrackPublication(e);if(t)return t}getTrackPublicationByName(e){const t=super.getTrackPublicationByName(e);if(t)return t}setVolume(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:P.Source.Microphone;this.volumeMap.set(t,e);const r=this.getTrackPublication(t);r&&r.track&&r.track.setVolume(e)}getVolume(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P.Source.Microphone;const t=this.getTrackPublication(e);return t&&t.track?t.track.getVolume():this.volumeMap.get(e)}addSubscribedMediaTrack(e,t,r,i,A,s){let o=this.getTrackPublicationBySid(t);if(o||t.startsWith("TR")||this.trackPublications.forEach(u=>{!o&&e.kind===u.kind.toString()&&(o=u)}),!o){if(s===0){this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:t})),this.emit(K.TrackSubscriptionFailed,t);return}s===void 0&&(s=20),setTimeout(()=>{this.addSubscribedMediaTrack(e,t,r,i,A,s-1)},150);return}if(e.readyState==="ended"){this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",Object.assign(Object.assign({},this.logContext),_e(o))),this.emit(K.TrackSubscriptionFailed,t);return}const a=e.kind==="video";let c;return a?c=new Nx(e,t,i,A):c=new Dx(e,t,i,this.audioContext,this.audioOutput),c.source=o.source,c.isMuted=o.isMuted,c.setMediaStream(r),c.start(),o.setTrack(c),this.volumeMap.has(o.source)&&Dl(c)&&Nn(c)&&c.setVolume(this.volumeMap.get(o.source)),o}get hasMetadata(){return!!this.participantInfo}getTrackPublicationBySid(e){return this.trackPublications.get(e)}updateInfo(e){if(!super.updateInfo(e))return!1;const t=new Map,r=new Map;return e.tracks.forEach(i=>{var A,s;let o=this.getTrackPublicationBySid(i.sid);if(o)o.updateInfo(i);else{const a=P.kindFromProto(i.type);if(!a)return;o=new qx(a,i,(A=this.signalClient.connectOptions)===null||A===void 0?void 0:A.autoSubscribe,{loggerContextCb:()=>this.logContext,loggerName:(s=this.loggerOptions)===null||s===void 0?void 0:s.loggerName}),o.updateInfo(i),r.set(i.sid,o);const c=Array.from(this.trackPublications.values()).find(u=>u.source===(o==null?void 0:o.source));c&&o.source!==P.Source.Unknown&&this.log.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(o.source),Object.assign(Object.assign({},this.logContext),{oldTrack:_e(c),newTrack:_e(o)})),this.addTrackPublication(o)}t.set(i.sid,o)}),this.trackPublications.forEach(i=>{t.has(i.trackSid)||(this.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},this.logContext),_e(i))),this.unpublishTrack(i.trackSid,!0))}),r.forEach(i=>{this.emit(K.TrackPublished,i)}),!0}unpublishTrack(e,t){const r=this.trackPublications.get(e);if(!r)return;const{track:i}=r;switch(i&&(i.stop(),r.setTrack(void 0)),this.trackPublications.delete(e),r.kind){case P.Kind.Audio:this.audioTrackPublications.delete(e);break;case P.Kind.Video:this.videoTrackPublications.delete(e);break}t&&this.emit(K.TrackUnpublished,r)}setAudioOutput(e){return S(this,void 0,void 0,function*(){this.audioOutput=e;const t=[];this.audioTrackPublications.forEach(r=>{var i;Nn(r.track)&&Dl(r.track)&&t.push(r.track.setSinkId((i=e.deviceId)!==null&&i!==void 0?i:"default"))}),yield Promise.all(t)})}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:e,args:r})),super.emit(e,...r)}}var fe;(function(n){n.Disconnected="disconnected",n.Connecting="connecting",n.Connected="connected",n.Reconnecting="reconnecting",n.SignalReconnecting="signalReconnecting"})(fe||(fe={}));const Jx=4*1e3;class Li extends Sn.EventEmitter{constructor(e){var t,r,i,A;if(super(),t=this,this.state=fe.Disconnected,this.activeSpeakers=[],this.isE2EEEnabled=!1,this.audioEnabled=!0,this.isVideoPlaybackBlocked=!1,this.log=ue,this.bufferedEvents=[],this.isResuming=!1,this.byteStreamControllers=new Map,this.textStreamControllers=new Map,this.byteStreamHandlers=new Map,this.textStreamHandlers=new Map,this.rpcHandlers=new Map,this.connect=(s,o,a)=>S(this,void 0,void 0,function*(){var c;if(!PF())throw kn()?Error("WebRTC isn't detected, have you called registerGlobals?"):Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");const u=yield this.disconnectLock.lock();if(this.state===fe.Connected)return this.log.info("already connected to room ".concat(this.name),this.logContext),u(),Promise.resolve();if(this.connectFuture)return u(),this.connectFuture.promise;this.setAndEmitConnectionState(fe.Connecting),((c=this.regionUrlProvider)===null||c===void 0?void 0:c.getServerUrl().toString())!==s&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),Ql(new URL(s))&&(this.regionUrlProvider===void 0?this.regionUrlProvider=new id(s,o):this.regionUrlProvider.updateToken(o),this.regionUrlProvider.fetchRegionSettings().then(h=>{var f;(f=this.regionUrlProvider)===null||f===void 0||f.setServerReportedRegions(h)}).catch(h=>{this.log.warn("could not fetch region settings",Object.assign(Object.assign({},this.logContext),{error:h}))}));const l=(h,f,p)=>S(this,void 0,void 0,function*(){var g,v;this.abortController&&this.abortController.abort();const y=new AbortController;this.abortController=y,u==null||u();try{yield this.attemptConnection(p??s,o,a,y),this.abortController=void 0,h()}catch(B){if(this.regionUrlProvider&&B instanceof Fe&&B.reason!==de.Cancelled&&B.reason!==de.NotAllowed){let b=null;try{b=yield this.regionUrlProvider.getNextBestRegionUrl((g=this.abortController)===null||g===void 0?void 0:g.signal)}catch(w){if(w instanceof Fe&&(w.status===401||w.reason===de.Cancelled)){this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),f(w);return}}b&&!(!((v=this.abortController)===null||v===void 0)&&v.signal.aborted)?(this.log.info("Initial connection failed with ConnectionError: ".concat(B.message,". Retrying with another region: ").concat(b),this.logContext),this.recreateEngine(),yield l(h,f,b)):(this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,n0(B)),f(B))}else{let b=sn.UNKNOWN_REASON;B instanceof Fe&&(b=n0(B)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,b),f(B)}}}),d=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new Ml((h,f)=>{l(h,f,d)},()=>{this.clearConnectionFutures()}),this.connectFuture.promise}),this.connectSignal=(s,o,a,c,u,l)=>S(this,void 0,void 0,function*(){var d,h,f;const p=yield a.join(s,o,{autoSubscribe:c.autoSubscribe,adaptiveStream:typeof u.adaptiveStream=="object"?!0:u.adaptiveStream,maxRetries:c.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:c.websocketTimeout},l.signal);let g=p.serverInfo;if(g||(g={version:p.serverVersion,region:p.serverRegion}),this.serverInfo=g,this.log.debug("connected to Livekit Server ".concat(Object.entries(g).map(v=>{let[y,B]=v;return"".concat(y,": ").concat(B)}).join(", ")),{room:(d=p.room)===null||d===void 0?void 0:d.name,roomSid:(h=p.room)===null||h===void 0?void 0:h.sid,identity:(f=p.participant)===null||f===void 0?void 0:f.identity}),!g.version)throw new wF("unknown server version");return g.version==="0.15.1"&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version",this.logContext),u.dynacast=!1),p}),this.applyJoinResponse=s=>{const o=s.participant;if(this.localParticipant.sid=o.sid,this.localParticipant.identity=o.identity,this.localParticipant.setEnabledPublishCodecs(s.enabledPublishCodecs),this.options.e2ee&&this.e2eeManager)try{this.e2eeManager.setSifTrailer(s.sifTrailer)}catch(a){this.log.error(a instanceof Error?a.message:"Could not set SifTrailer",Object.assign(Object.assign({},this.logContext),{error:a}))}this.handleParticipantUpdates([o,...s.otherParticipants]),s.room&&this.handleRoomUpdate(s.room)},this.attemptConnection=(s,o,a,c)=>S(this,void 0,void 0,function*(){var u,l;this.state===fe.Reconnecting||this.isResuming||!((u=this.engine)===null||u===void 0)&&u.pendingReconnect?(this.log.info("Reconnection attempt replaced by new connection attempt",this.logContext),this.recreateEngine()):this.maybeCreateEngine(),!((l=this.regionUrlProvider)===null||l===void 0)&&l.isCloud()&&this.engine.setRegionUrlProvider(this.regionUrlProvider),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},Yl),a),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const d=yield this.connectSignal(s,o,this.engine,this.connOptions,this.options,c);this.applyJoinResponse(d),this.setupLocalParticipantEvents(),this.emit(O.SignalConnected)}catch(d){yield this.engine.close(),this.recreateEngine();const h=new Fe("could not establish signal connection",de.ServerUnreachable);throw d instanceof Error&&(h.message="".concat(h.message,": ").concat(d.message)),d instanceof Fe&&(h.reason=d.reason,h.status=d.status),this.log.debug("error trying to establish signal connection",Object.assign(Object.assign({},this.logContext),{error:d})),h}if(c.signal.aborted)throw yield this.engine.close(),this.recreateEngine(),new Fe("Connection attempt aborted",de.Cancelled);try{yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,c)}catch(d){throw yield this.engine.close(),this.recreateEngine(),d}Ht()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),Ht()&&document.addEventListener("freeze",this.onPageLeave),this.setAndEmitConnectionState(fe.Connected),this.emit(O.Connected),this.registerConnectionReconcile()}),this.disconnect=function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return S(t,[...o],void 0,function(){var c=this;let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var l,d,h,f;const p=yield c.disconnectLock.lock();try{if(c.state===fe.Disconnected){c.log.debug("already disconnected",c.logContext);return}c.log.info("disconnect from room",Object.assign({},c.logContext)),(c.state===fe.Connecting||c.state===fe.Reconnecting||c.isResuming)&&(c.log.warn("abort connection attempt",c.logContext),(l=c.abortController)===null||l===void 0||l.abort(),(h=(d=c.connectFuture)===null||d===void 0?void 0:d.reject)===null||h===void 0||h.call(d,new Fe("Client initiated disconnect",de.Cancelled)),c.connectFuture=void 0),!((f=c.engine)===null||f===void 0)&&f.client.isDisconnected||(yield c.engine.client.sendLeave()),c.engine&&(yield c.engine.close()),c.handleDisconnect(u,sn.CLIENT_INITIATED),c.engine=void 0}finally{p()}}()})},this.onPageLeave=()=>S(this,void 0,void 0,function*(){this.log.info("Page leave detected, disconnecting",this.logContext),yield this.disconnect()}),this.startAudio=()=>S(this,void 0,void 0,function*(){const s=[],o=un();if(o&&o.os==="iOS"){const a="livekit-dummy-audio-el";let c=document.getElementById(a);if(!c){c=document.createElement("audio"),c.id=a,c.autoplay=!0,c.hidden=!0;const u=Ol();u.enabled=!0;const l=new MediaStream([u]);c.srcObject=l,document.addEventListener("visibilitychange",()=>{c&&(c.srcObject=document.hidden?null:l,document.hidden||(this.log.debug("page visible again, triggering startAudio to resume playback and update playback status",this.logContext),this.startAudio()))}),document.body.append(c),this.once(O.Disconnected,()=>{c==null||c.remove(),c=null})}s.push(c)}this.remoteParticipants.forEach(a=>{a.audioTrackPublications.forEach(c=>{c.track&&c.track.attachedElements.forEach(u=>{s.push(u)})})});try{yield Promise.all([this.acquireAudioContext(),...s.map(a=>(a.muted=!1,a.play()))]),this.handleAudioPlaybackStarted()}catch(a){throw this.handleAudioPlaybackFailed(a),a}}),this.startVideo=()=>S(this,void 0,void 0,function*(){const s=[];for(const o of this.remoteParticipants.values())o.videoTrackPublications.forEach(a=>{var c;(c=a.track)===null||c===void 0||c.attachedElements.forEach(u=>{s.includes(u)||s.push(u)})});yield Promise.all(s.map(o=>o.play())).then(()=>{this.handleVideoPlaybackStarted()}).catch(o=>{o.name==="NotAllowedError"?this.handleVideoPlaybackFailed():this.log.warn("Resuming video playback failed, make sure you call `startVideo` directly in a user gesture handler",this.logContext)})}),this.handleRestarting=()=>{this.clearConnectionReconcile(),this.isResuming=!1;for(const s of this.remoteParticipants.values())this.handleParticipantDisconnected(s.identity,s);this.setAndEmitConnectionState(fe.Reconnecting)&&this.emit(O.Reconnecting)},this.handleSignalRestarted=s=>S(this,void 0,void 0,function*(){this.log.debug("signal reconnected to server, region ".concat(s.serverRegion),Object.assign(Object.assign({},this.logContext),{region:s.serverRegion})),this.bufferedEvents=[],this.applyJoinResponse(s);try{yield this.localParticipant.republishAllTracks(void 0,!0)}catch(o){this.log.error("error trying to re-publish tracks after reconnection",Object.assign(Object.assign({},this.logContext),{error:o}))}try{yield this.engine.waitForRestarted(),this.log.debug("fully reconnected to server",Object.assign(Object.assign({},this.logContext),{region:s.serverRegion}))}catch{return}this.setAndEmitConnectionState(fe.Connected),this.emit(O.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents()}),this.handleParticipantUpdates=s=>{s.forEach(o=>{var a;if(o.identity===this.localParticipant.identity){this.localParticipant.updateInfo(o);return}o.identity===""&&(o.identity=(a=this.sidToIdentity.get(o.sid))!==null&&a!==void 0?a:"");let c=this.remoteParticipants.get(o.identity);o.state===Ei.DISCONNECTED?this.handleParticipantDisconnected(o.identity,c):c=this.getOrCreateParticipant(o.identity,o)})},this.handleActiveSpeakersUpdate=s=>{const o=[],a={};s.forEach(c=>{if(a[c.sid]=!0,c.sid===this.localParticipant.sid)this.localParticipant.audioLevel=c.level,this.localParticipant.setIsSpeaking(!0),o.push(this.localParticipant);else{const u=this.getRemoteParticipantBySid(c.sid);u&&(u.audioLevel=c.level,u.setIsSpeaking(!0),o.push(u))}}),a[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.remoteParticipants.forEach(c=>{a[c.sid]||(c.audioLevel=0,c.setIsSpeaking(!1))}),this.activeSpeakers=o,this.emitWhenConnected(O.ActiveSpeakersChanged,o)},this.handleSpeakersChanged=s=>{const o=new Map;this.activeSpeakers.forEach(c=>{const u=this.remoteParticipants.get(c.identity);u&&u.sid!==c.sid||o.set(c.sid,c)}),s.forEach(c=>{let u=this.getRemoteParticipantBySid(c.sid);c.sid===this.localParticipant.sid&&(u=this.localParticipant),u&&(u.audioLevel=c.level,u.setIsSpeaking(c.active),c.active?o.set(c.sid,u):o.delete(c.sid))});const a=Array.from(o.values());a.sort((c,u)=>u.audioLevel-c.audioLevel),this.activeSpeakers=a,this.emitWhenConnected(O.ActiveSpeakersChanged,a)},this.handleStreamStateUpdate=s=>{s.streamStates.forEach(o=>{const a=this.getRemoteParticipantBySid(o.participantSid);if(!a)return;const c=a.getTrackPublicationBySid(o.trackSid);if(!c||!c.track)return;const u=P.streamStateFromProto(o.state);u!==c.track.streamState&&(c.track.streamState=u,a.emit(K.TrackStreamStateChanged,c,c.track.streamState),this.emitWhenConnected(O.TrackStreamStateChanged,c,c.track.streamState,a))})},this.handleSubscriptionPermissionUpdate=s=>{const o=this.getRemoteParticipantBySid(s.participantSid);if(!o)return;const a=o.getTrackPublicationBySid(s.trackSid);a&&a.setAllowed(s.allowed)},this.handleSubscriptionError=s=>{const o=Array.from(this.remoteParticipants.values()).find(c=>c.trackPublications.has(s.trackSid));if(!o)return;const a=o.getTrackPublicationBySid(s.trackSid);a&&a.setSubscriptionError(s.err)},this.handleDataPacket=s=>{const o=this.remoteParticipants.get(s.participantIdentity);if(s.value.case==="user")this.handleUserPacket(o,s.value.value,s.kind);else if(s.value.case==="transcription")this.handleTranscription(o,s.value.value);else if(s.value.case==="sipDtmf")this.handleSipDtmf(o,s.value.value);else if(s.value.case==="chatMessage")this.handleChatMessage(o,s.value.value);else if(s.value.case==="metrics")this.handleMetrics(s.value.value,o);else if(s.value.case==="streamHeader")this.handleStreamHeader(s.value.value,s.participantIdentity);else if(s.value.case==="streamChunk")this.handleStreamChunk(s.value.value);else if(s.value.case==="streamTrailer")this.handleStreamTrailer(s.value.value);else if(s.value.case==="rpcRequest"){const a=s.value.value;this.handleIncomingRpcRequest(s.participantIdentity,a.id,a.method,a.payload,a.responseTimeoutMs,a.version)}},this.handleUserPacket=(s,o,a)=>{this.emit(O.DataReceived,o.payload,s,a,o.topic),s==null||s.emit(K.DataReceived,o.payload,a)},this.handleSipDtmf=(s,o)=>{this.emit(O.SipDTMFReceived,o,s),s==null||s.emit(K.SipDTMFReceived,o)},this.bufferedSegments=new Map,this.handleTranscription=(s,o)=>{const a=o.transcribedParticipantIdentity===this.localParticipant.identity?this.localParticipant:this.getParticipantByIdentity(o.transcribedParticipantIdentity),c=a==null?void 0:a.trackPublications.get(o.trackId),u=VF(o,this.transcriptionReceivedTimes);c==null||c.emit(L.TranscriptionReceived,u),a==null||a.emit(K.TranscriptionReceived,u,c),this.emit(O.TranscriptionReceived,u,a,c)},this.handleChatMessage=(s,o)=>{const a=GF(o);this.emit(O.ChatMessage,a,s)},this.handleMetrics=(s,o)=>{this.emit(O.MetricsReceived,s,o)},this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(O.AudioPlaybackStatusChanged,!0))},this.handleAudioPlaybackFailed=s=>{this.log.warn("could not playback audio",Object.assign(Object.assign({},this.logContext),{error:s})),this.canPlaybackAudio&&(this.audioEnabled=!1,this.emit(O.AudioPlaybackStatusChanged,!1))},this.handleVideoPlaybackStarted=()=>{this.isVideoPlaybackBlocked&&(this.isVideoPlaybackBlocked=!1,this.emit(O.VideoPlaybackStatusChanged,!0))},this.handleVideoPlaybackFailed=()=>{this.isVideoPlaybackBlocked||(this.isVideoPlaybackBlocked=!0,this.emit(O.VideoPlaybackStatusChanged,!1))},this.handleDeviceChange=()=>S(this,void 0,void 0,function*(){var s,o,a;const c=ft.getInstance().previousDevices,u=yield ft.getInstance().getDevices(void 0,!1),l=un();if((l==null?void 0:l.name)==="Chrome"&&l.os!=="iOS")for(let h of u){const f=c.find(p=>p.deviceId===h.deviceId);f&&f.label!==""&&f.kind===h.kind&&f.label!==h.label&&this.getActiveDevice(h.kind)==="default"&&this.emit(O.ActiveDeviceChanged,h.kind,h.deviceId)}const d=["audiooutput","audioinput","videoinput"];for(let h of d){const f=JF(h),p=this.localParticipant.getTrackPublication(f);if(p&&(!((s=p.track)===null||s===void 0)&&s.isUserProvided))continue;const g=u.filter(y=>y.kind===h),v=this.getActiveDevice(h);if(v===((o=c.filter(y=>y.kind===h)[0])===null||o===void 0?void 0:o.deviceId)&&g.length>0&&((a=g[0])===null||a===void 0?void 0:a.deviceId)!==v){yield this.switchActiveDevice(h,g[0].deviceId);continue}h==="audioinput"&&!pr()||h==="videoinput"||g.length>0&&!g.find(y=>y.deviceId===this.getActiveDevice(h))&&(yield this.switchActiveDevice(h,g[0].deviceId))}this.emit(O.MediaDevicesChanged)}),this.handleRoomUpdate=s=>{const o=this.roomInfo;this.roomInfo=s,o&&o.metadata!==s.metadata&&this.emitWhenConnected(O.RoomMetadataChanged,s.metadata),(o==null?void 0:o.activeRecording)!==s.activeRecording&&this.emitWhenConnected(O.RecordingStatusChanged,s.activeRecording)},this.handleConnectionQualityUpdate=s=>{s.updates.forEach(o=>{if(o.participantSid===this.localParticipant.sid){this.localParticipant.setConnectionQuality(o.quality);return}const a=this.getRemoteParticipantBySid(o.participantSid);a&&a.setConnectionQuality(o.quality)})},this.onLocalParticipantMetadataChanged=s=>{this.emit(O.ParticipantMetadataChanged,s,this.localParticipant)},this.onLocalParticipantNameChanged=s=>{this.emit(O.ParticipantNameChanged,s,this.localParticipant)},this.onLocalAttributesChanged=s=>{this.emit(O.ParticipantAttributesChanged,s,this.localParticipant)},this.onLocalTrackMuted=s=>{this.emit(O.TrackMuted,s,this.localParticipant)},this.onLocalTrackUnmuted=s=>{this.emit(O.TrackUnmuted,s,this.localParticipant)},this.onTrackProcessorUpdate=s=>{var o;(o=s==null?void 0:s.onPublish)===null||o===void 0||o.call(s,this)},this.onLocalTrackPublished=s=>S(this,void 0,void 0,function*(){var o,a,c,u,l,d;(o=s.track)===null||o===void 0||o.on(L.TrackProcessorUpdate,this.onTrackProcessorUpdate),(a=s.track)===null||a===void 0||a.on(L.Restarted,this.onLocalTrackRestarted),(l=(u=(c=s.track)===null||c===void 0?void 0:c.getProcessor())===null||u===void 0?void 0:u.onPublish)===null||l===void 0||l.call(u,this),this.emit(O.LocalTrackPublished,s,this.localParticipant),Jr(s.track)&&(yield s.track.checkForSilence())&&this.emit(O.LocalAudioSilenceDetected,s);const h=yield(d=s.track)===null||d===void 0?void 0:d.getDeviceId(!1),f=s0(s.source);f&&h&&h!==this.localParticipant.activeDeviceMap.get(f)&&(this.localParticipant.activeDeviceMap.set(f,h),this.emit(O.ActiveDeviceChanged,f,h))}),this.onLocalTrackUnpublished=s=>{var o,a;(o=s.track)===null||o===void 0||o.off(L.TrackProcessorUpdate,this.onTrackProcessorUpdate),(a=s.track)===null||a===void 0||a.off(L.Restarted,this.onLocalTrackRestarted),this.emit(O.LocalTrackUnpublished,s,this.localParticipant)},this.onLocalTrackRestarted=s=>S(this,void 0,void 0,function*(){const o=yield s.getDeviceId(!1),a=s0(s.source);a&&o&&o!==this.localParticipant.activeDeviceMap.get(a)&&(this.log.debug("local track restarted, setting ".concat(a," ").concat(o," active"),this.logContext),this.localParticipant.activeDeviceMap.set(a,o),this.emit(O.ActiveDeviceChanged,a,o))}),this.onLocalConnectionQualityChanged=s=>{this.emit(O.ConnectionQualityChanged,s,this.localParticipant)},this.onMediaDevicesError=s=>{this.emit(O.MediaDevicesError,s)},this.onLocalParticipantPermissionsChanged=s=>{this.emit(O.ParticipantPermissionsChanged,s,this.localParticipant)},this.onLocalChatMessageSent=s=>{this.emit(O.ChatMessage,s,this.localParticipant)},this.setMaxListeners(100),this.remoteParticipants=new Map,this.sidToIdentity=new Map,this.options=Object.assign(Object.assign({},fx),e),this.log=Ln((r=this.options.loggerName)!==null&&r!==void 0?r:cn.Room),this.transcriptionReceivedTimes=new Map,this.options.audioCaptureDefaults=Object.assign(Object.assign({},m0),e==null?void 0:e.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},v0),e==null?void 0:e.videoCaptureDefaults),this.options.publishDefaults=Object.assign(Object.assign({},px),e==null?void 0:e.publishDefaults),this.maybeCreateEngine(),this.disconnectLock=new Mt,this.localParticipant=new Wx("","",this.engine,this.options,this.rpcHandlers),this.options.videoCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("videoinput",fr(this.options.videoCaptureDefaults.deviceId)),this.options.audioCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("audioinput",fr(this.options.audioCaptureDefaults.deviceId)),!((i=this.options.audioOutput)===null||i===void 0)&&i.deviceId&&this.switchActiveDevice("audiooutput",fr(this.options.audioOutput.deviceId)).catch(s=>this.log.warn("Could not set audio output: ".concat(s.message),this.logContext)),this.options.e2ee&&this.setupE2EE(),Ht()){const s=new AbortController;(A=navigator.mediaDevices)===null||A===void 0||A.addEventListener("devicechange",this.handleDeviceChange,{signal:s.signal}),Li.cleanupRegistry&&Li.cleanupRegistry.register(this,()=>{s.abort()})}}registerTextStreamHandler(e,t){if(this.textStreamHandlers.has(e))throw new TypeError('A text stream handler for topic "'.concat(e,'" has already been set.'));this.textStreamHandlers.set(e,t)}unregisterTextStreamHandler(e){this.textStreamHandlers.delete(e)}registerByteStreamHandler(e,t){if(this.byteStreamHandlers.has(e))throw new TypeError('A byte stream handler for topic "'.concat(e,'" has already been set.'));this.byteStreamHandlers.set(e,t)}unregisterByteStreamHandler(e){this.byteStreamHandlers.delete(e)}registerRpcMethod(e,t){if(this.rpcHandlers.has(e))throw Error("RPC handler already registered for method ".concat(e,", unregisterRpcMethod before trying to register again"));this.rpcHandlers.set(e,t)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}handleIncomingRpcRequest(e,t,r,i,A,s){return S(this,void 0,void 0,function*(){if(yield this.engine.publishRpcAck(e,t),s!==1){yield this.engine.publishRpcResponse(e,t,null,Ze.builtIn("UNSUPPORTED_VERSION"));return}const o=this.rpcHandlers.get(r);if(!o){yield this.engine.publishRpcResponse(e,t,null,Ze.builtIn("UNSUPPORTED_METHOD"));return}let a=null,c=null;try{const u=yield o({requestId:t,callerIdentity:e,payload:i,responseTimeout:A});Zl(u)>y0?(a=Ze.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"),console.warn("RPC Response payload too large for ".concat(r))):c=u}catch(u){u instanceof Ze?a=u:(console.warn("Uncaught error returned by RPC handler for ".concat(r,". Returning APPLICATION_ERROR instead."),u),a=Ze.builtIn("APPLICATION_ERROR"))}yield this.engine.publishRpcResponse(e,t,c,a)})}setE2EEEnabled(e){return S(this,void 0,void 0,function*(){if(this.e2eeManager)yield Promise.all([this.localParticipant.setE2EEEnabled(e)]),this.localParticipant.identity!==""&&this.e2eeManager.setParticipantCryptorEnabled(e,this.localParticipant.identity);else throw Error("e2ee not configured, please set e2ee settings within the room options")})}setupE2EE(){var e;this.options.e2ee&&("e2eeManager"in this.options.e2ee?this.e2eeManager=this.options.e2ee.e2eeManager:this.e2eeManager=new ex(this.options.e2ee),this.e2eeManager.on(dr.ParticipantEncryptionStatusChanged,(t,r)=>{WF(r)&&(this.isE2EEEnabled=t),this.emit(O.ParticipantEncryptionStatusChanged,t,r)}),this.e2eeManager.on(dr.EncryptionError,t=>this.emit(O.EncryptionError,t)),(e=this.e2eeManager)===null||e===void 0||e.setup(this))}get logContext(){var e;return{room:this.name,roomID:(e=this.roomInfo)===null||e===void 0?void 0:e.sid,participant:this.localParticipant.identity,pID:this.localParticipant.sid}}get isRecording(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.activeRecording)!==null&&t!==void 0?t:!1}getSid(){return S(this,void 0,void 0,function*(){return this.state===fe.Disconnected?"":this.roomInfo&&this.roomInfo.sid!==""?this.roomInfo.sid:new Promise((e,t)=>{const r=i=>{i.sid!==""&&(this.engine.off(D.RoomUpdate,r),e(i.sid))};this.engine.on(D.RoomUpdate,r),this.once(O.Disconnected,()=>{this.engine.off(D.RoomUpdate,r),t("Room disconnected before room server id was available")})})})}get name(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:""}get metadata(){var e;return(e=this.roomInfo)===null||e===void 0?void 0:e.metadata}get numParticipants(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.numParticipants)!==null&&t!==void 0?t:0}get numPublishers(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.numPublishers)!==null&&t!==void 0?t:0}maybeCreateEngine(){this.engine&&!this.engine.isClosed||(this.engine=new Fx(this.options),this.engine.on(D.ParticipantUpdate,this.handleParticipantUpdates).on(D.RoomUpdate,this.handleRoomUpdate).on(D.SpeakersChanged,this.handleSpeakersChanged).on(D.StreamStateChanged,this.handleStreamStateUpdate).on(D.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(D.SubscriptionError,this.handleSubscriptionError).on(D.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(D.MediaTrackAdded,(e,t,r)=>{this.onTrackAdded(e,t,r)}).on(D.Disconnected,e=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,e)}).on(D.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(D.DataPacketReceived,this.handleDataPacket).on(D.Resuming,()=>{this.clearConnectionReconcile(),this.isResuming=!0,this.log.info("Resuming signal connection",this.logContext),this.setAndEmitConnectionState(fe.SignalReconnecting)&&this.emit(O.SignalReconnecting)}).on(D.Resumed,()=>{this.registerConnectionReconcile(),this.isResuming=!1,this.log.info("Resumed signal connection",this.logContext),this.updateSubscriptions(),this.emitBufferedEvents(),this.setAndEmitConnectionState(fe.Connected)&&this.emit(O.Reconnected)}).on(D.SignalResumed,()=>{this.bufferedEvents=[],(this.state===fe.Reconnecting||this.isResuming)&&this.sendSyncState()}).on(D.Restarting,this.handleRestarting).on(D.SignalRestarted,this.handleSignalRestarted).on(D.Offline,()=>{this.setAndEmitConnectionState(fe.Reconnecting)&&this.emit(O.Reconnecting)}).on(D.DCBufferStatusChanged,(e,t)=>{this.emit(O.DCBufferStatusChanged,e,t)}).on(D.LocalTrackSubscribed,e=>{const t=this.localParticipant.getTrackPublications().find(r=>{let{trackSid:i}=r;return i===e});if(!t){this.log.warn("could not find local track subscription for subscribed event",this.logContext);return}this.localParticipant.emit(K.LocalTrackSubscribed,t),this.emitWhenConnected(O.LocalTrackSubscribed,t,this.localParticipant)}).on(D.RoomMoved,e=>{this.log.debug("room moved",e),e.room&&this.handleRoomUpdate(e.room),this.remoteParticipants.forEach((t,r)=>{this.handleParticipantDisconnected(r,t)}),this.emit(O.Moved,e.room.name,e.token),e.participant?this.handleParticipantUpdates([e.participant,...e.otherParticipants]):this.handleParticipantUpdates(e.otherParticipants)}),this.localParticipant&&this.localParticipant.setupEngine(this.engine),this.e2eeManager&&this.e2eeManager.setupEngine(this.engine))}static getLocalDevices(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ft.getInstance().getDevices(e,t)}prepareConnection(e,t){return S(this,void 0,void 0,function*(){if(this.state===fe.Disconnected){this.log.debug("prepareConnection to ".concat(e),this.logContext);try{if(Ql(new URL(e))&&t){this.regionUrlProvider=new id(e,t);const r=yield this.regionUrlProvider.getNextBestRegionUrl();r&&this.state===fe.Disconnected&&(this.regionUrl=r,yield fetch(Ll(r),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(r),this.logContext))}else yield fetch(Ll(e),{method:"HEAD"})}catch(r){this.log.warn("could not prepare connection",Object.assign(Object.assign({},this.logContext),{error:r}))}}})}getParticipantByIdentity(e){return this.localParticipant.identity===e?this.localParticipant:this.remoteParticipants.get(e)}clearConnectionFutures(){this.connectFuture=void 0}simulateScenario(e,t){return S(this,void 0,void 0,function*(){let r=()=>{},i;switch(e){case"signal-reconnect":yield this.engine.client.handleOnClose("simulate disconnect");break;case"speaker":i=new _n({scenario:{case:"speakerUpdate",value:3}});break;case"node-failure":i=new _n({scenario:{case:"nodeFailure",value:!0}});break;case"server-leave":i=new _n({scenario:{case:"serverLeave",value:!0}});break;case"migration":i=new _n({scenario:{case:"migration",value:!0}});break;case"resume-reconnect":this.engine.failNext(),yield this.engine.client.handleOnClose("simulate resume-disconnect");break;case"disconnect-signal-on-resume":r=()=>S(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new _n({scenario:{case:"disconnectSignalOnResume",value:!0}});break;case"disconnect-signal-on-resume-no-messages":r=()=>S(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new _n({scenario:{case:"disconnectSignalOnResumeNoMessages",value:!0}});break;case"full-reconnect":this.engine.fullReconnectOnNext=!0,yield this.engine.client.handleOnClose("simulate full-reconnect");break;case"force-tcp":case"force-tls":i=new _n({scenario:{case:"switchCandidateProtocol",value:e==="force-tls"?2:1}}),r=()=>S(this,void 0,void 0,function*(){const A=this.engine.client.onLeave;A&&A(new jo({reason:sn.CLIENT_INITIATED,action:Ti.RECONNECT}))});break;case"subscriber-bandwidth":if(t===void 0||typeof t!="number")throw new Error("subscriber-bandwidth requires a number as argument");i=new _n({scenario:{case:"subscriberBandwidth",value:qr(t)}});break;case"leave-full-reconnect":i=new _n({scenario:{case:"leaveRequestFullReconnect",value:!0}})}i&&(yield this.engine.client.sendSimulateScenario(i),yield r())})}get canPlaybackAudio(){return this.audioEnabled}get canPlaybackVideo(){return!this.isVideoPlaybackBlocked}getActiveDevice(e){return this.localParticipant.activeDeviceMap.get(e)}switchActiveDevice(e,t){return S(this,arguments,void 0,function(r,i){var A=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function*(){var o,a,c,u,l,d,h,f;let p=!0,g=!1;const v=s?{exact:i}:i;if(r==="audioinput"){g=A.localParticipant.audioTrackPublications.size===0;const y=(o=A.getActiveDevice(r))!==null&&o!==void 0?o:A.options.audioCaptureDefaults.deviceId;A.options.audioCaptureDefaults.deviceId=v;const B=Array.from(A.localParticipant.audioTrackPublications.values()).filter(b=>b.source===P.Source.Microphone);try{p=(yield Promise.all(B.map(b=>{var w;return(w=b.audioTrack)===null||w===void 0?void 0:w.setDeviceId(v)}))).every(b=>b===!0)}catch(b){throw A.options.audioCaptureDefaults.deviceId=y,b}}else if(r==="videoinput"){g=A.localParticipant.videoTrackPublications.size===0;const y=(a=A.getActiveDevice(r))!==null&&a!==void 0?a:A.options.videoCaptureDefaults.deviceId;A.options.videoCaptureDefaults.deviceId=v;const B=Array.from(A.localParticipant.videoTrackPublications.values()).filter(b=>b.source===P.Source.Camera);try{p=(yield Promise.all(B.map(b=>{var w;return(w=b.videoTrack)===null||w===void 0?void 0:w.setDeviceId(v)}))).every(b=>b===!0)}catch(b){throw A.options.videoCaptureDefaults.deviceId=y,b}}else if(r==="audiooutput"){if(!xl()&&!A.options.webAudioMix||A.options.webAudioMix&&A.audioContext&&!("setSinkId"in A.audioContext))throw new Error("cannot switch audio output, setSinkId not supported");A.options.webAudioMix&&(i=(c=yield ft.getInstance().normalizeDeviceId("audiooutput",i))!==null&&c!==void 0?c:""),(u=(f=A.options).audioOutput)!==null&&u!==void 0||(f.audioOutput={});const y=(l=A.getActiveDevice(r))!==null&&l!==void 0?l:A.options.audioOutput.deviceId;A.options.audioOutput.deviceId=i;try{A.options.webAudioMix&&((d=A.audioContext)===null||d===void 0||d.setSinkId(i)),yield Promise.all(Array.from(A.remoteParticipants.values()).map(B=>B.setAudioOutput({deviceId:i})))}catch(B){throw A.options.audioOutput.deviceId=y,B}}return(g||r==="audiooutput")&&(A.localParticipant.activeDeviceMap.set(r,r==="audiooutput"&&((h=A.options.audioOutput)===null||h===void 0?void 0:h.deviceId)||i),A.emit(O.ActiveDeviceChanged,r,i)),p}()})}setupLocalParticipantEvents(){this.localParticipant.on(K.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(K.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(K.AttributesChanged,this.onLocalAttributesChanged).on(K.TrackMuted,this.onLocalTrackMuted).on(K.TrackUnmuted,this.onLocalTrackUnmuted).on(K.LocalTrackPublished,this.onLocalTrackPublished).on(K.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(K.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(K.MediaDevicesError,this.onMediaDevicesError).on(K.AudioStreamAcquired,this.startAudio).on(K.ChatMessage,this.onLocalChatMessageSent).on(K.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}recreateEngine(){var e;(e=this.engine)===null||e===void 0||e.close(),this.engine=void 0,this.isResuming=!1,this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.bufferedEvents=[],this.maybeCreateEngine()}onTrackAdded(e,t,r){if(this.state===fe.Connecting||this.state===fe.Reconnecting){const u=()=>{this.onTrackAdded(e,t,r),l()},l=()=>{this.off(O.Reconnected,u),this.off(O.Connected,u),this.off(O.Disconnected,l)};this.once(O.Reconnected,u),this.once(O.Connected,u),this.once(O.Disconnected,l);return}if(this.state===fe.Disconnected){this.log.warn("skipping incoming track after Room disconnected",this.logContext);return}if(e.readyState==="ended"){this.log.info("skipping incoming track as it already ended",this.logContext);return}const i=xF(t.id),A=i[0];let s=i[1],o=e.id;if(s&&s.startsWith("TR")&&(o=s),A===this.localParticipant.sid){this.log.warn("tried to create RemoteParticipant for local participant",this.logContext);return}const a=Array.from(this.remoteParticipants.values()).find(u=>u.sid===A);if(!a){this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(A),this.logContext);return}let c;this.options.adaptiveStream&&(typeof this.options.adaptiveStream=="object"?c=this.options.adaptiveStream:c={}),a.addSubscribedMediaTrack(e,o,t,r,c)}handleDisconnect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1?arguments[1]:void 0;var r;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.state!==fe.Disconnected){this.regionUrl=void 0;try{this.remoteParticipants.forEach(i=>{i.trackPublications.forEach(A=>{i.unpublishTrack(A.trackSid)})}),this.localParticipant.trackPublications.forEach(i=>{var A,s,o;i.track&&this.localParticipant.unpublishTrack(i.track,e),e?((A=i.track)===null||A===void 0||A.detach(),(s=i.track)===null||s===void 0||s.stop()):(o=i.track)===null||o===void 0||o.stopMonitor()}),this.localParticipant.off(K.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(K.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(K.AttributesChanged,this.onLocalAttributesChanged).off(K.TrackMuted,this.onLocalTrackMuted).off(K.TrackUnmuted,this.onLocalTrackUnmuted).off(K.LocalTrackPublished,this.onLocalTrackPublished).off(K.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(K.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(K.MediaDevicesError,this.onMediaDevicesError).off(K.AudioStreamAcquired,this.startAudio).off(K.ChatMessage,this.onLocalChatMessageSent).off(K.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.trackPublications.clear(),this.localParticipant.videoTrackPublications.clear(),this.localParticipant.audioTrackPublications.clear(),this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.activeSpeakers=[],this.audioContext&&typeof this.options.webAudioMix=="boolean"&&(this.audioContext.close(),this.audioContext=void 0),Ht()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),(r=navigator.mediaDevices)===null||r===void 0||r.removeEventListener("devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(fe.Disconnected),this.emit(O.Disconnected,t)}}}handleParticipantDisconnected(e,t){var r;this.remoteParticipants.delete(e),t&&(t.trackPublications.forEach(i=>{t.unpublishTrack(i.trackSid,!0)}),this.emit(O.ParticipantDisconnected,t),t.setDisconnected(),(r=this.localParticipant)===null||r===void 0||r.handleParticipantDisconnected(t.identity))}handleStreamHeader(e,t){return S(this,void 0,void 0,function*(){var r;if(e.contentHeader.case==="byteHeader"){const i=this.byteStreamHandlers.get(e.topic);if(!i){this.log.debug("ignoring incoming byte stream due to no handler for topic",e.topic);return}let A;const s={id:e.streamId,name:(r=e.contentHeader.value.name)!==null&&r!==void 0?r:"unknown",mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:ia(e.timestamp),attributes:e.attributes},o=new ReadableStream({start:a=>{A=a,this.byteStreamControllers.set(e.streamId,{info:s,controller:A,startTime:Date.now()})}});i(new Px(s,o,ia(e.totalLength)),{identity:t})}else if(e.contentHeader.case==="textHeader"){const i=this.textStreamHandlers.get(e.topic);if(!i){this.log.debug("ignoring incoming text stream due to no handler for topic",e.topic);return}let A;const s={id:e.streamId,mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Number(e.timestamp),attributes:e.attributes},o=new ReadableStream({start:a=>{A=a,this.textStreamControllers.set(e.streamId,{info:s,controller:A,startTime:Date.now()})}});i(new Ox(s,o,ia(e.totalLength)),{identity:t})}})}handleStreamChunk(e){const t=this.byteStreamControllers.get(e.streamId);t&&e.content.length>0&&t.controller.enqueue(e);const r=this.textStreamControllers.get(e.streamId);r&&e.content.length>0&&r.controller.enqueue(e)}handleStreamTrailer(e){const t=this.textStreamControllers.get(e.streamId);t&&(t.info.attributes=Object.assign(Object.assign({},t.info.attributes),e.attributes),t.controller.close(),this.textStreamControllers.delete(e.streamId));const r=this.byteStreamControllers.get(e.streamId);r&&(r.info.attributes=Object.assign(Object.assign({},r.info.attributes),e.attributes),r.controller.close(),this.byteStreamControllers.delete(e.streamId))}acquireAudioContext(){return S(this,void 0,void 0,function*(){var e,t;if(typeof this.options.webAudioMix!="boolean"&&this.options.webAudioMix.audioContext?this.audioContext=this.options.webAudioMix.audioContext:(!this.audioContext||this.audioContext.state==="closed")&&(this.audioContext=(e=A0())!==null&&e!==void 0?e:void 0),this.options.webAudioMix&&this.remoteParticipants.forEach(i=>i.setAudioContext(this.audioContext)),this.localParticipant.setAudioContext(this.audioContext),this.audioContext&&this.audioContext.state==="suspended")try{yield Promise.race([this.audioContext.resume(),Nt(200)])}catch(i){this.log.warn("Could not resume audio context",Object.assign(Object.assign({},this.logContext),{error:i}))}const r=((t=this.audioContext)===null||t===void 0?void 0:t.state)==="running";r!==this.canPlaybackAudio&&(this.audioEnabled=r,this.emit(O.AudioPlaybackStatusChanged,r))})}createParticipant(e,t){var r;let i;return t?i=da.fromParticipantInfo(this.engine.client,t,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}):i=new da(this.engine.client,"",e,void 0,void 0,void 0,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}),this.options.webAudioMix&&i.setAudioContext(this.audioContext),!((r=this.options.audioOutput)===null||r===void 0)&&r.deviceId&&i.setAudioOutput(this.options.audioOutput).catch(A=>this.log.warn("Could not set audio output: ".concat(A.message),this.logContext)),i}getOrCreateParticipant(e,t){if(this.remoteParticipants.has(e)){const i=this.remoteParticipants.get(e);return t&&i.updateInfo(t)&&this.sidToIdentity.set(t.sid,t.identity),i}const r=this.createParticipant(e,t);return this.remoteParticipants.set(e,r),this.sidToIdentity.set(t.sid,t.identity),this.emitWhenConnected(O.ParticipantConnected,r),r.on(K.TrackPublished,i=>{this.emitWhenConnected(O.TrackPublished,i,r)}).on(K.TrackSubscribed,(i,A)=>{i.kind===P.Kind.Audio?(i.on(L.AudioPlaybackStarted,this.handleAudioPlaybackStarted),i.on(L.AudioPlaybackFailed,this.handleAudioPlaybackFailed)):i.kind===P.Kind.Video&&(i.on(L.VideoPlaybackFailed,this.handleVideoPlaybackFailed),i.on(L.VideoPlaybackStarted,this.handleVideoPlaybackStarted)),this.emit(O.TrackSubscribed,i,A,r)}).on(K.TrackUnpublished,i=>{this.emit(O.TrackUnpublished,i,r)}).on(K.TrackUnsubscribed,(i,A)=>{this.emit(O.TrackUnsubscribed,i,A,r)}).on(K.TrackMuted,i=>{this.emitWhenConnected(O.TrackMuted,i,r)}).on(K.TrackUnmuted,i=>{this.emitWhenConnected(O.TrackUnmuted,i,r)}).on(K.ParticipantMetadataChanged,i=>{this.emitWhenConnected(O.ParticipantMetadataChanged,i,r)}).on(K.ParticipantNameChanged,i=>{this.emitWhenConnected(O.ParticipantNameChanged,i,r)}).on(K.AttributesChanged,i=>{this.emitWhenConnected(O.ParticipantAttributesChanged,i,r)}).on(K.ConnectionQualityChanged,i=>{this.emitWhenConnected(O.ConnectionQualityChanged,i,r)}).on(K.ParticipantPermissionsChanged,i=>{this.emitWhenConnected(O.ParticipantPermissionsChanged,i,r)}).on(K.TrackSubscriptionStatusChanged,(i,A)=>{this.emitWhenConnected(O.TrackSubscriptionStatusChanged,i,A,r)}).on(K.TrackSubscriptionFailed,(i,A)=>{this.emit(O.TrackSubscriptionFailed,i,r,A)}).on(K.TrackSubscriptionPermissionChanged,(i,A)=>{this.emitWhenConnected(O.TrackSubscriptionPermissionChanged,i,A,r)}).on(K.Active,()=>{this.emitWhenConnected(O.ParticipantActive,r)}),t&&r.updateInfo(t),r}sendSyncState(){const e=Array.from(this.remoteParticipants.values()).reduce((r,i)=>(r.push(...i.getTrackPublications()),r),[]),t=this.localParticipant.getTrackPublications();this.engine.sendSyncState(e,t)}updateSubscriptions(){for(const e of this.remoteParticipants.values())for(const t of e.videoTrackPublications.values())t.isSubscribed&&jF(t)&&t.emitTrackUpdate()}getRemoteParticipantBySid(e){const t=this.sidToIdentity.get(e);if(t)return this.remoteParticipants.get(t)}registerConnectionReconcile(){this.clearConnectionReconcile();let e=0;this.connectionReconcileInterval=wt.setInterval(()=>{!this.engine||this.engine.isClosed||!this.engine.verifyTransport()?(e++,this.log.warn("detected connection state mismatch",Object.assign(Object.assign({},this.logContext),{numFailures:e,engine:this.engine?{closed:this.engine.isClosed,transportsConnected:this.engine.verifyTransport()}:void 0})),e>=3&&(this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,sn.STATE_MISMATCH))):e=0},Jx)}clearConnectionReconcile(){this.connectionReconcileInterval&&wt.clearInterval(this.connectionReconcileInterval)}setAndEmitConnectionState(e){return e===this.state?!1:(this.state=e,this.emit(O.ConnectionStateChanged,this.state),!0)}emitBufferedEvents(){this.bufferedEvents.forEach(e=>{let[t,r]=e;this.emit(t,...r)}),this.bufferedEvents=[]}emitWhenConnected(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(this.state===fe.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([e,r]);else if(this.state===fe.Connected)return this.emit(e,...r);return!1}simulateParticipants(e){return S(this,void 0,void 0,function*(){var t,r;const i=Object.assign({audio:!0,video:!0,useRealTracks:!1},e.publish),A=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},e.participants);if(this.handleDisconnect(),this.roomInfo=new Ho({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:Ke.parse(new Date().getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new Kr({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(O.SignalConnected),this.emit(O.Connected),this.setAndEmitConnectionState(fe.Connected),i.video){const s=new od(P.Kind.Video,new Ui({source:at.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:An.AUDIO,name:"video-dummy"}),new ua(i.useRealTracks?(yield window.navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0]:t0(160*((t=A.aspectRatios[0])!==null&&t!==void 0?t:1),160,!0,!0),void 0,!1,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(s),this.localParticipant.emit(K.LocalTrackPublished,s)}if(i.audio){const s=new od(P.Kind.Audio,new Ui({source:at.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:An.AUDIO}),new aa(i.useRealTracks?(yield navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0]:Ol(),void 0,!1,this.audioContext,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(s),this.localParticipant.emit(K.LocalTrackPublished,s)}for(let s=0;s<A.count-1;s+=1){let o=new Kr({sid:Math.floor(Math.random()*1e4).toString(),identity:"simulated-".concat(s),state:Ei.ACTIVE,tracks:[],joinedAt:Ke.parse(Date.now())});const a=this.getOrCreateParticipant(o.identity,o);if(A.video){const c=t0(160*((r=A.aspectRatios[s%A.aspectRatios.length])!==null&&r!==void 0?r:1),160,!1,!0),u=new Ui({source:at.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:An.AUDIO});a.addSubscribedMediaTrack(c,u.sid,new MediaStream([c]),new RTCRtpReceiver),o.tracks=[...o.tracks,u]}if(A.audio){const c=Ol(),u=new Ui({source:at.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:An.AUDIO});a.addSubscribedMediaTrack(c,u.sid,new MediaStream([c]),new RTCRtpReceiver),o.tracks=[...o.tracks,u]}a.updateInfo(o)}})}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(e!==O.ActiveSpeakersChanged&&e!==O.TranscriptionReceived){const A=R0(r).filter(s=>s!==void 0);this.log.debug("room event ".concat(e),Object.assign(Object.assign({},this.logContext),{event:e,args:A}))}return super.emit(e,...r)}}Li.cleanupRegistry=typeof FinalizationRegistry<"u"&&new FinalizationRegistry(n=>{n()});function R0(n){return n.map(e=>{if(e)return Array.isArray(e)?R0(e):typeof e=="object"?"logContext"in e?e.logContext:void 0:e})}var hn;(function(n){n[n.IDLE=0]="IDLE",n[n.RUNNING=1]="RUNNING",n[n.SKIPPED=2]="SKIPPED",n[n.SUCCESS=3]="SUCCESS",n[n.FAILED=4]="FAILED"})(hn||(hn={}));class yr extends Sn.EventEmitter{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.status=hn.IDLE,this.logs=[],this.options={},this.url=e,this.token=t,this.name=this.constructor.name,this.room=new Li(r.roomOptions),this.connectOptions=r.connectOptions,this.options=r}run(e){return S(this,void 0,void 0,function*(){if(this.status!==hn.IDLE)throw Error("check is running already");this.setStatus(hn.RUNNING);try{yield this.perform()}catch(t){t instanceof Error&&(this.options.errorsAsWarnings?this.appendWarning(t.message):this.appendError(t.message))}return yield this.disconnect(),yield new Promise(t=>setTimeout(t,500)),this.status!==hn.SKIPPED&&this.setStatus(this.isSuccess()?hn.SUCCESS:hn.FAILED),e&&e(),this.getInfo()})}isSuccess(){return!this.logs.some(e=>e.level==="error")}connect(e){return S(this,void 0,void 0,function*(){return this.room.state===fe.Connected?this.room:(e||(e=this.url),yield this.room.connect(e,this.token,this.connectOptions),this.room)})}disconnect(){return S(this,void 0,void 0,function*(){this.room&&this.room.state!==fe.Disconnected&&(yield this.room.disconnect(),yield new Promise(e=>setTimeout(e,500)))})}skip(){this.setStatus(hn.SKIPPED)}switchProtocol(e){return S(this,void 0,void 0,function*(){let t=!1,r=!1;if(this.room.on(O.Reconnecting,()=>{t=!0}),this.room.once(O.Reconnected,()=>{r=!0}),this.room.simulateScenario("force-".concat(e)),yield new Promise(A=>setTimeout(A,1e3)),!t)return;const i=Date.now()+1e4;for(;Date.now()<i;){if(r)return;yield Nt(100)}throw new Error("Could not reconnect using ".concat(e," protocol after 10 seconds"))})}appendMessage(e){this.logs.push({level:"info",message:e}),this.emit("update",this.getInfo())}appendWarning(e){this.logs.push({level:"warning",message:e}),this.emit("update",this.getInfo())}appendError(e){this.logs.push({level:"error",message:e}),this.emit("update",this.getInfo())}setStatus(e){this.status=e,this.emit("update",this.getInfo())}get engine(){var e;return(e=this.room)===null||e===void 0?void 0:e.engine}getInfo(){return{logs:this.logs,name:this.name,status:this.status,description:this.description}}}class zx extends yr{get description(){return"Cloud regions"}perform(){return S(this,void 0,void 0,function*(){const e=new id(this.url,this.token);if(!e.isCloud()){this.skip();return}const t=[],r=new Set;for(let A=0;A<3;A++){const s=yield e.getNextBestRegionUrl();if(!s)break;if(r.has(s))continue;r.add(s);const o=yield this.checkCloudRegion(s);this.appendMessage("".concat(o.region," RTT: ").concat(o.rtt,"ms, duration: ").concat(o.duration,"ms")),t.push(o)}t.sort((A,s)=>(A.duration-s.duration)*.5+(A.rtt-s.rtt)*.5);const i=t[0];this.bestStats=i,this.appendMessage("best Cloud region: ".concat(i.region))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkCloudRegion(e){return S(this,void 0,void 0,function*(){var t,r;yield this.connect(e),this.options.protocol==="tcp"&&(yield this.switchProtocol("tcp"));const i=(t=this.room.serverInfo)===null||t===void 0?void 0:t.region;if(!i)throw new Error("Region not found");const A=yield this.room.localParticipant.streamText({topic:"test"}),s=1e3,a=1e6/s,c="A".repeat(s),u=Date.now();for(let f=0;f<a;f++)yield A.write(c);yield A.close();const l=Date.now(),d=yield(r=this.room.engine.pcManager)===null||r===void 0?void 0:r.publisher.getStats(),h={region:i,rtt:1e4,duration:l-u};return d==null||d.forEach(f=>{f.type==="candidate-pair"&&f.nominated&&(h.rtt=f.currentRoundTripTime*1e3)}),yield this.disconnect(),h})}}const ad=1e4;class Xx extends yr{get description(){return"Connection via UDP vs TCP"}perform(){return S(this,void 0,void 0,function*(){const e=yield this.checkConnectionProtocol("udp"),t=yield this.checkConnectionProtocol("tcp");this.bestStats=e,e.qualityLimitationDurations.bandwidth-t.qualityLimitationDurations.bandwidth>.5||(e.packetsLost-t.packetsLost)/e.packetsSent>.01?(this.appendMessage("best connection quality via tcp"),this.bestStats=t):this.appendMessage("best connection quality via udp");const r=this.bestStats;this.appendMessage("upstream bitrate: ".concat((r.bitrateTotal/r.count/1e3/1e3).toFixed(2)," mbps")),this.appendMessage("RTT: ".concat((r.rttTotal/r.count*1e3).toFixed(2)," ms")),this.appendMessage("jitter: ".concat((r.jitterTotal/r.count*1e3).toFixed(2)," ms")),r.packetsLost>0&&this.appendWarning("packets lost: ".concat((r.packetsLost/r.packetsSent*100).toFixed(2),"%")),r.qualityLimitationDurations.bandwidth>1&&this.appendWarning("bandwidth limited ".concat((r.qualityLimitationDurations.bandwidth/(ad/1e3)*100).toFixed(2),"%")),r.qualityLimitationDurations.cpu>0&&this.appendWarning("cpu limited ".concat((r.qualityLimitationDurations.cpu/(ad/1e3)*100).toFixed(2),"%"))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkConnectionProtocol(e){return S(this,void 0,void 0,function*(){yield this.connect(),e==="tcp"?yield this.switchProtocol("tcp"):yield this.switchProtocol("udp");const t=document.createElement("canvas");t.width=1280,t.height=720;const r=t.getContext("2d");if(!r)throw new Error("Could not get canvas context");let i=0;const A=()=>{i=(i+1)%360,r.fillStyle="hsl(".concat(i,", 100%, 50%)"),r.fillRect(0,0,t.width,t.height),requestAnimationFrame(A)};A();const o=t.captureStream(30).getVideoTracks()[0],c=(yield this.room.localParticipant.publishTrack(o,{simulcast:!1,degradationPreference:"maintain-resolution",videoEncoding:{maxBitrate:2e6}})).track,u={protocol:e,packetsLost:0,packetsSent:0,qualityLimitationDurations:{},rttTotal:0,jitterTotal:0,bitrateTotal:0,count:0},l=setInterval(()=>S(this,void 0,void 0,function*(){const d=yield c.getRTCStatsReport();d==null||d.forEach(h=>{h.type==="outbound-rtp"?(u.packetsSent=h.packetsSent,u.qualityLimitationDurations=h.qualityLimitationDurations,u.bitrateTotal+=h.targetBitrate,u.count++):h.type==="remote-inbound-rtp"&&(u.packetsLost=h.packetsLost,u.rttTotal+=h.roundTripTime,u.jitterTotal+=h.jitter)})}),1e3);return yield new Promise(d=>setTimeout(d,ad)),clearInterval(l),o.stop(),t.remove(),yield this.disconnect(),u})}}class Yx extends yr{get description(){return"Can publish audio"}perform(){return S(this,void 0,void 0,function*(){var e;const t=yield this.connect(),r=yield Vx();if(yield i0(r,1e3))throw new Error("unable to detect audio from microphone");this.appendMessage("detected audio from microphone"),t.localParticipant.publishTrack(r),yield new Promise(o=>setTimeout(o,3e3));const A=yield(e=r.sender)===null||e===void 0?void 0:e.getStats();if(!A)throw new Error("Could not get RTCStats");let s=0;if(A.forEach(o=>{o.type==="outbound-rtp"&&(o.kind==="audio"||!o.kind&&o.mediaType==="audio")&&(s=o.packetsSent)}),s===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(s," audio packets"))})}}class Zx extends yr{get description(){return"Can publish video"}perform(){return S(this,void 0,void 0,function*(){var e;const t=yield this.connect(),r=yield Kx();yield this.checkForVideo(r.mediaStreamTrack),t.localParticipant.publishTrack(r),yield new Promise(s=>setTimeout(s,5e3));const i=yield(e=r.sender)===null||e===void 0?void 0:e.getStats();if(!i)throw new Error("Could not get RTCStats");let A=0;if(i.forEach(s=>{s.type==="outbound-rtp"&&(s.kind==="video"||!s.kind&&s.mediaType==="video")&&(A+=s.packetsSent)}),A===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(A," video packets"))})}checkForVideo(e){return S(this,void 0,void 0,function*(){const t=new MediaStream;t.addTrack(e.clone());const r=document.createElement("video");r.srcObject=t,r.muted=!0,yield new Promise(i=>{r.onplay=()=>{setTimeout(()=>{var A,s,o,a;const c=document.createElement("canvas"),u=e.getSettings(),l=(s=(A=u.width)!==null&&A!==void 0?A:r.videoWidth)!==null&&s!==void 0?s:1280,d=(a=(o=u.height)!==null&&o!==void 0?o:r.videoHeight)!==null&&a!==void 0?a:720;c.width=l,c.height=d;const h=c.getContext("2d");h.drawImage(r,0,0);const p=h.getImageData(0,0,c.width,c.height).data;let g=!0;for(let v=0;v<p.length;v+=4)if(p[v]!==0||p[v+1]!==0||p[v+2]!==0){g=!1;break}g?this.appendError("camera appears to be producing only black frames"):this.appendMessage("received video frames"),i()},1e3)},r.play()}),r.remove()})}}class $x extends yr{get description(){return"Resuming connection after interruption"}perform(){return S(this,void 0,void 0,function*(){var e;const t=yield this.connect();let r=!1,i=!1,A;const s=new Promise(c=>{setTimeout(c,5e3),A=c}),o=()=>{r=!0};t.on(O.SignalReconnecting,o).on(O.Reconnecting,o).on(O.Reconnected,()=>{i=!0,A(!0)}),(e=t.engine.client.ws)===null||e===void 0||e.close();const a=t.engine.client.onClose;if(a&&a(""),yield s,r){if(!i||t.state!==fe.Connected)throw this.appendWarning("reconnection is only possible in Redis-based configurations"),new Error("Not able to reconnect")}else throw new Error("Did not attempt to reconnect")})}}class eQ extends yr{get description(){return"Can connect via TURN"}perform(){return S(this,void 0,void 0,function*(){var e,t;const r=new Gl,i=yield r.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3});let A=!1,s=!1,o=!1;for(let a of i.iceServers)for(let c of a.urls)c.startsWith("turn:")?(s=!0,o=!0):c.startsWith("turns:")&&(s=!0,o=!0,A=!0),c.startsWith("stun:")&&(o=!0);o?s&&!A&&this.appendWarning("TURN is configured server side, but TURN/TLS is unavailable."):this.appendWarning("No STUN servers configured on server side."),yield r.close(),!((t=(e=this.connectOptions)===null||e===void 0?void 0:e.rtcConfig)===null||t===void 0)&&t.iceServers||s?yield this.room.connect(this.url,this.token,{rtcConfig:{iceTransportPolicy:"relay"}}):(this.appendWarning("No TURN servers configured."),this.skip(),yield new Promise(a=>setTimeout(a,0)))})}}class tQ extends yr{get description(){return"Establishing WebRTC connection"}perform(){return S(this,void 0,void 0,function*(){let e=!1,t=!1;this.room.on(O.SignalConnected,()=>{const r=this.room.engine.client.onTrickle;this.room.engine.client.onTrickle=(i,A)=>{if(i.candidate){const s=new RTCIceCandidate(i);let o="".concat(s.protocol," ").concat(s.address,":").concat(s.port," ").concat(s.type);s.address&&(nQ(s.address)?o+=" (private)":s.protocol==="tcp"&&s.tcpType==="passive"?(e=!0,o+=" (passive)"):s.protocol==="udp"&&(t=!0)),this.appendMessage(o)}r&&r(i,A)},this.room.engine.pcManager&&(this.room.engine.pcManager.subscriber.onIceCandidateError=i=>{i instanceof RTCPeerConnectionIceErrorEvent&&this.appendWarning("error with ICE candidate: ".concat(i.errorCode," ").concat(i.errorText," ").concat(i.url))})});try{yield this.connect(),ue.info("now the room is connected")}catch(r){throw this.appendWarning("ports need to be open on firewall in order to connect."),r}e||this.appendWarning("Server is not configured for ICE/TCP"),t||this.appendWarning("No public IPv4 UDP candidates were found. Your server is likely not configured correctly")})}}function nQ(n){const e=n.split(".");if(e.length===4){if(e[0]==="10")return!0;if(e[0]==="192"&&e[1]==="168")return!0;if(e[0]==="172"){const t=parseInt(e[1],10);if(t>=16&&t<=31)return!0}}return!1}class rQ extends yr{get description(){return"Connecting to signal connection via WebSocket"}perform(){return S(this,void 0,void 0,function*(){var e,t,r;(this.url.startsWith("ws:")||this.url.startsWith("http:"))&&this.appendWarning("Server is insecure, clients may block connections to it");let i=new Gl;const A=yield i.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3});this.appendMessage("Connected to server, version ".concat(A.serverVersion,".")),((e=A.serverInfo)===null||e===void 0?void 0:e.edition)===Mm.Cloud&&(!((t=A.serverInfo)===null||t===void 0)&&t.region)&&this.appendMessage("LiveKit Cloud: ".concat((r=A.serverInfo)===null||r===void 0?void 0:r.region)),yield i.close()})}}class x4 extends Sn.EventEmitter{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.options={},this.checkResults=new Map,this.url=e,this.token=t,this.options=r}getNextCheckId(){const e=this.checkResults.size;return this.checkResults.set(e,{logs:[],status:hn.IDLE,name:"",description:""}),e}updateCheck(e,t){this.checkResults.set(e,t),this.emit("checkUpdate",e,t)}isSuccess(){return Array.from(this.checkResults.values()).every(e=>e.status!==hn.FAILED)}getResults(){return Array.from(this.checkResults.values())}createAndRunCheck(e){return S(this,void 0,void 0,function*(){const t=this.getNextCheckId(),r=new e(this.url,this.token,this.options),i=s=>{this.updateCheck(t,s)};r.on("update",i);const A=yield r.run();return r.off("update",i),A})}checkWebsocket(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(rQ)})}checkWebRTC(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(tQ)})}checkTURN(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(eQ)})}checkReconnect(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck($x)})}checkPublishAudio(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(Yx)})}checkPublishVideo(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(Zx)})}checkConnectionProtocol(){return S(this,void 0,void 0,function*(){const e=yield this.createAndRunCheck(Xx);if(e.data&&"protocol"in e.data){const t=e.data;this.options.protocol=t.protocol}return e})}checkCloudRegion(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(zx)})}}const iQ=/\{[^{}]+\}/g;function AQ(){return Math.random().toString(36).slice(2,11)}function sQ(n){let{baseUrl:e="",Request:t=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:A,headers:s,...o}={...n};e=L0(e);const a=[];async function c(u,l){const{baseUrl:d,fetch:h=r,Request:f=t,headers:p,params:g={},parseAs:v="json",querySerializer:y,bodySerializer:B=A??aQ,body:b,...w}=l||{};d&&(e=L0(d));let _=typeof i=="function"?i:M0(i);y&&(_=typeof y=="function"?y:M0({...typeof i=="object"?i:{},...y}));const k=b===void 0?void 0:B(b),F=k===void 0||k instanceof FormData?{}:{"Content-Type":"application/json"},x={redirect:"follow",...o,...w,body:k,headers:uQ(F,s,p,g.header)};let U,T,Q=new t(cQ(u,{baseUrl:e,params:g,querySerializer:_}),x);for(const H in w)H in Q||(Q[H]=w[H]);if(a.length){U=AQ(),T=Object.freeze({baseUrl:e,fetch:h,parseAs:v,querySerializer:_,bodySerializer:B});for(const H of a)if(H&&typeof H=="object"&&typeof H.onRequest=="function"){const q=await H.onRequest({request:Q,schemaPath:u,params:g,options:T,id:U});if(q){if(!(q instanceof t))throw new Error("onRequest: must return new Request() when modifying the request");Q=q}}}let M=await h(Q);if(a.length)for(let H=a.length-1;H>=0;H--){const q=a[H];if(q&&typeof q=="object"&&typeof q.onResponse=="function"){const ve=await q.onResponse({request:Q,response:M,schemaPath:u,params:g,options:T,id:U});if(ve){if(!(ve instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");M=ve}}}if(M.status===204||M.headers.get("Content-Length")==="0")return M.ok?{data:{},response:M}:{error:{},response:M};if(M.ok)return v==="stream"?{data:M.body,response:M}:{data:await M[v](),response:M};let X=await M.text();try{X=JSON.parse(X)}catch{}return{error:X,response:M}}return{GET(u,l){return c(u,{...l,method:"GET"})},PUT(u,l){return c(u,{...l,method:"PUT"})},POST(u,l){return c(u,{...l,method:"POST"})},DELETE(u,l){return c(u,{...l,method:"DELETE"})},OPTIONS(u,l){return c(u,{...l,method:"OPTIONS"})},HEAD(u,l){return c(u,{...l,method:"HEAD"})},PATCH(u,l){return c(u,{...l,method:"PATCH"})},TRACE(u,l){return c(u,{...l,method:"TRACE"})},use(...u){for(const l of u)if(l){if(typeof l!="object"||!("onRequest"in l||"onResponse"in l))throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");a.push(l)}},eject(...u){for(const l of u){const d=a.indexOf(l);d!==-1&&a.splice(d,1)}}}}function ha(n,e,t){if(e==null)return"";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${n}=${(t==null?void 0:t.allowReserved)===!0?e:encodeURIComponent(e)}`}function P0(n,e,t){if(!e||typeof e!="object")return"";const r=[],i={simple:",",label:".",matrix:";"}[t.style]||"&";if(t.style!=="deepObject"&&t.explode===!1){for(const o in e)r.push(o,t.allowReserved===!0?e[o]:encodeURIComponent(e[o]));const s=r.join(",");switch(t.style){case"form":return`${n}=${s}`;case"label":return`.${s}`;case"matrix":return`;${n}=${s}`;default:return s}}for(const s in e){const o=t.style==="deepObject"?`${n}[${s}]`:s;r.push(ha(o,e[s],t))}const A=r.join(i);return t.style==="label"||t.style==="matrix"?`${i}${A}`:A}function O0(n,e,t){if(!Array.isArray(e))return"";if(t.explode===!1){const A={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[t.style]||",",s=(t.allowReserved===!0?e:e.map(o=>encodeURIComponent(o))).join(A);switch(t.style){case"simple":return s;case"label":return`.${s}`;case"matrix":return`;${n}=${s}`;default:return`${n}=${s}`}}const r={simple:",",label:".",matrix:";"}[t.style]||"&",i=[];for(const A of e)t.style==="simple"||t.style==="label"?i.push(t.allowReserved===!0?A:encodeURIComponent(A)):i.push(ha(n,A,t));return t.style==="label"||t.style==="matrix"?`${r}${i.join(r)}`:i.join(r)}function M0(n){return function(t){const r=[];if(t&&typeof t=="object")for(const i in t){const A=t[i];if(A!=null){if(Array.isArray(A)){if(A.length===0)continue;r.push(O0(i,A,{style:"form",explode:!0,...n==null?void 0:n.array,allowReserved:(n==null?void 0:n.allowReserved)||!1}));continue}if(typeof A=="object"){r.push(P0(i,A,{style:"deepObject",explode:!0,...n==null?void 0:n.object,allowReserved:(n==null?void 0:n.allowReserved)||!1}));continue}r.push(ha(i,A,n))}}return r.join("&")}}function oQ(n,e){let t=n;for(const r of n.match(iQ)??[]){let i=r.substring(1,r.length-1),A=!1,s="simple";if(i.endsWith("*")&&(A=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(s="label",i=i.substring(1)):i.startsWith(";")&&(s="matrix",i=i.substring(1)),!e||e[i]===void 0||e[i]===null)continue;const o=e[i];if(Array.isArray(o)){t=t.replace(r,O0(i,o,{style:s,explode:A}));continue}if(typeof o=="object"){t=t.replace(r,P0(i,o,{style:s,explode:A}));continue}if(s==="matrix"){t=t.replace(r,`;${ha(i,o)}`);continue}t=t.replace(r,s==="label"?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return t}function aQ(n){return n instanceof FormData?n:JSON.stringify(n)}function cQ(n,e){var i;let t=`${e.baseUrl}${n}`;(i=e.params)!=null&&i.path&&(t=oQ(t,e.params.path));let r=e.querySerializer(e.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(t+=`?${r}`),t}function uQ(...n){const e=new Headers;for(const t of n){if(!t||typeof t!="object")continue;const r=t instanceof Headers?t.entries():Object.entries(t);for(const[i,A]of r)if(A===null)e.delete(i);else if(Array.isArray(A))for(const s of A)e.append(i,s);else A!==void 0&&e.set(i,A)}return e}function L0(n){return n.endsWith("/")?n.substring(0,n.length-1):n}const D0="Onboardee-Session-Token",N0="OnboardeeSessionToken";class H0{constructor(e){this.client=sQ({baseUrl:e.baseUrl,headers:e.headers,fetch:e.fetch}),this.client.use({onRequest({request:t}){if(window.localStorage){const r=window.localStorage.getItem(N0);r&&t.headers.set(D0,r)}return t},onResponse({response:t}){const r=t.headers.get(D0);return r&&window.localStorage&&window.localStorage.setItem(N0,r),t}})}setAuthToken(e){this.client.use({onRequest({request:t}){return t.headers.set("Authorization",`Bearer ${e}`),t}})}setApiToken(e){this.client.use({onRequest({request:t}){return t.headers.set("Authorization",`Token ${e}`),t}})}async getAuthUrl(e){return await this.client.GET("/api/auth/{type}",{params:{path:{type:e}}})}async getConnectUrl(e){return await this.client.GET("/api/connect/{type}",{params:{path:{type:e}}})}async logout(){return await this.client.POST("/api/logout")}async getCurrentUser(){return await this.client.GET("/api/me")}async clientInitialise(e,t={}){return await this.client.POST("/api/client/{appToken}/initialise",{params:{path:{appToken:e}},body:t})}async clientStartSession(e,t){return await this.client.POST("/api/client/{appToken}/start-session",{params:{path:{appToken:e}},body:t})}async createPresignedUploadUrl(e){return await this.client.POST("/api/files",{body:e})}async createKnowledgeBlock(e){return await this.client.POST("/api/knowledge",{body:e})}async listOnboardees(){return await this.client.GET("/api/onboardees")}async getOnboardee(e){return await this.client.GET("/api/onboardees/{id}",{params:{path:{id:e}}})}async getOnboardeeWidgetConfig(e,t){return await this.client.GET("/api/onboardees/{id}/config",{params:{path:{id:e}},signal:t})}async listPlans(e){return await this.client.GET("/api/plans",{params:{query:{...e&&{client_type:e}}}})}async listPlansWithStatus(){return await this.client.GET("/api/plans-with-status")}async listProducts(){return await this.client.GET("/api/products")}async getProduct(e){return await this.client.GET("/api/products/{id}",{params:{path:{id:e}}})}async getProductAnalytics(e,t,r,i){return await this.client.GET("/api/products/{id}/analytics",{params:{path:{id:e},query:{...t&&{start_date:t},...r&&{end_date:r},...i&&{course_id:i}}}})}async createProduct(e){return await this.client.POST("/api/products",{body:e})}async updateProduct(e,t){return await this.client.PATCH("/api/products/{id}",{params:{path:{id:e}},body:t})}async getProductNavigationIndex(e){return await this.client.GET("/api/products/{id}/navigation-index",{params:{path:{id:e}}})}async replaceProductNavigationIndex(e,t){return await this.client.PUT("/api/products/{id}/navigation-index",{params:{path:{id:e}},body:t})}async listProductKnowledgeBlocks(e){return await this.client.GET("/api/products/{id}/knowledge-blocks",{params:{path:{id:e}}})}async createProductKnowledgeBlock(e,t){return await this.client.POST("/api/products/{id}/knowledge-blocks",{params:{path:{id:e}},body:t})}async searchProductKnowledgeBlocks(e,t,r){return await this.client.GET("/api/products/{id}/knowledge-blocks/search",{params:{path:{id:e},query:{q:t,...r&&{limit:r.toString()}}}})}async updateProductKnowledgeBlock(e,t,r){return await this.client.PATCH("/api/products/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}},body:r})}async deleteProductKnowledgeBlock(e,t){return await this.client.DELETE("/api/products/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}}})}async createPlan(e){return await this.client.POST("/api/plans",{body:e})}async getPlan(e){return await this.client.GET("/api/plans/{id}",{params:{path:{id:e}}})}async getAdminPlan(e){return await this.client.GET("/api/admin/plans/{id}",{params:{path:{id:e}}})}async getPlanAnalytics(e,t,r){return await this.client.GET("/api/plans/{id}/analytics",{params:{path:{id:e},query:{...t&&{start_date:t},...r&&{end_date:r}}}})}async replacePlan(e,t){return await this.client.PUT("/api/plans/{id}",{params:{path:{id:e}},body:t})}async updatePlan(e,t){return await this.client.PATCH("/api/plans/{id}",{params:{path:{id:e}},body:t})}async getPlanVideoUrl(e){return await this.client.GET("/api/plans/{id}/video-url",{params:{path:{id:e}}})}async deletePlan(e){return await this.client.DELETE("/api/admin/plans/{id}",{params:{path:{id:e}}})}async publishPlanRevision(e,t){return await this.client.POST("/api/plans/{id}/publish",{params:{path:{id:e}},body:t})}async listPlanRevisions(e){return await this.client.GET("/api/plans/{id}/revisions",{params:{path:{id:e}}})}async listPlanKnowledgeBlocks(e){return await this.client.GET("/api/plans/{id}/knowledge-blocks",{params:{path:{id:e}}})}async createPlanKnowledgeBlock(e,t){return await this.client.POST("/api/plans/{id}/knowledge-blocks",{params:{path:{id:e}},body:t})}async updatePlanKnowledgeBlock(e,t,r){return await this.client.PUT("/api/plans/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}},body:r})}async deletePlanKnowledgeBlock(e,t){return await this.client.DELETE("/api/plans/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}}})}async getPlanNavigationIndex(e){return await this.client.GET("/api/plans/{id}/navigation-index",{params:{path:{id:e}}})}async replacePlanNavigationIndex(e,t){return await this.client.POST("/api/plans/{id}/navigation-index",{params:{path:{id:e}},body:t})}async getRevisionNavigationIndex(e){return await this.client.GET("/api/revisions/{id}/navigation-index",{params:{path:{id:e}}})}async replaceRevisionNavigationIndex(e,t){return await this.client.PUT("/api/revisions/{id}/navigation-index",{params:{path:{id:e}},body:t})}async getPlanFAQ(e){return await this.client.GET("/api/plans/{id}/faq",{params:{path:{id:e}}})}async getRevisionFAQ(e){return await this.client.GET("/api/revisions/{id}/faq",{params:{path:{id:e}}})}async replaceRevisionFAQ(e,t){return await this.client.PUT("/api/revisions/{id}/faq",{params:{path:{id:e}},body:t})}async listRevisionKnowledgeBlocks(e){return await this.client.GET("/api/revisions/{id}/knowledge-blocks",{params:{path:{id:e}}})}async getRevisionSteps(e){return await this.client.GET("/api/revisions/{id}/steps",{params:{path:{id:e}}})}async replaceRevisionKnowledgeBlocks(e,t){return await this.client.PUT("/api/revisions/{id}/knowledge-blocks",{params:{path:{id:e}},body:t})}async createRevisionKnowledgeBlock(e,t){return await this.client.POST("/api/revisions/{id}/knowledge-blocks",{params:{path:{id:e}},body:t})}async updateRevisionKnowledgeBlock(e,t,r){return await this.client.PUT("/api/revisions/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}},body:r})}async deleteRevisionKnowledgeBlock(e,t){return await this.client.DELETE("/api/revisions/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}}})}async listSessions(e,t){const r={token:e};return t!=null&&t.productId&&(r.product_id=t.productId),t!=null&&t.startDate&&(r.start_date=t.startDate),t!=null&&t.endDate&&(r.end_date=t.endDate),await this.client.GET("/api/sessions",{params:{query:r}})}async createSession(e){return await this.client.POST("/api/sessions",{body:e})}async getSession(e){return await this.client.GET("/api/sessions/{id}",{params:{path:{id:e}}})}async startSession(e,t){return await this.client.GET("/api/sessions/{id}/start-session",{params:{path:{id:e},query:{token:t}}})}async getSessionRecording(e){return await this.client.GET("/api/sessions/{id}/recording",{params:{path:{id:e}}})}async getSessionSummary(e){return await this.client.GET("/api/sessions/{id}/summary",{params:{path:{id:e}}})}async getSessionProductUrl(e){return await this.client.GET("/api/sessions/{id}/product-url",{params:{path:{id:e}}})}async updateSession(e,t){return await this.client.PATCH("/api/sessions/{id}",{params:{path:{id:e}},body:t})}async listUserSessions(e){const t={};return e!=null&&e.productId&&(t.product_id=e.productId),e!=null&&e.courseId&&(t.course_id=e.courseId),e!=null&&e.startDate&&(t.start_date=e.startDate),e!=null&&e.endDate&&(t.end_date=e.endDate),e!=null&&e.page&&(t.page=e.page),e!=null&&e.limit&&(t.limit=e.limit),e!=null&&e.courseName&&(t.course_name=e.courseName),e!=null&&e.userName&&(t.user_name=e.userName),e!=null&&e.company&&(t.company=e.company),e!=null&&e.email&&(t.email=e.email),e!=null&&e.sortBy&&(t.sort_by=e.sortBy),e!=null&&e.sortOrder&&(t.sort_order=e.sortOrder),await this.client.GET("/api/user-sessions",{params:Object.keys(t).length>0?{query:t}:void 0})}async listUserSessionsAggregate(e){const t={};return e!=null&&e.productId&&(t.product_id=e.productId),e!=null&&e.courseId&&(t.course_id=e.courseId),e!=null&&e.startDate&&(t.start_date=e.startDate),e!=null&&e.endDate&&(t.end_date=e.endDate),await this.client.GET("/api/user-sessions-aggregate",{params:Object.keys(t).length>0?{query:t}:void 0})}async getJoinToken(e,{clientType:t,user:r}={}){return await this.client.GET("/api/join-token",{params:{query:{token:e,...t&&{client_type:t},...r&&{user:encodeURIComponent(r)}}}})}async getSessionPlan(e){return await this.client.GET("/api/sessions/{id}/plan",{params:{path:{id:e}}})}getClient(){return this.client}}const K0="https://app.coragents.ai";class pa extends Gc{constructor(e,t,r,i){super(),this.state=null,this.isPaused=!1,this.speakingState=null,this.captureScreen=null,this.sessionUuid=null,this.roomId=null,this.joinToken=null,this.roomUrl=null,this.room=null,this.agentAnalyser=null,this.userAnalyser=null,this.appToken=e,this.planId=t,this.clientType=r,this.api=i.api||new H0({baseUrl:K0}),this.identity=i.identity||null,this.roomFactory=i.roomFactory||(A=>new Li(A)),this.captureScreen=i.captureScreen||null}async start(){this.planId,this.setState("connecting"),this.speakingStateChanged("thinking");try{const t=(await this.api.clientStartSession(this.appToken,{client_type:this.clientType,onboarding_plan:this.planId})).data;if(!(t!=null&&t.url)||!(t!=null&&t.token)||!(t!=null&&t.room)||!(t!=null&&t.session_uuid))throw new Error("Invalid room info");this.sessionUuid=t==null?void 0:t.session_uuid,this.roomId=t==null?void 0:t.room,this.joinToken=t==null?void 0:t.token,this.roomUrl=t==null?void 0:t.url,await this.joinRoom(),this.setState("connected"),this.planId,this.sessionUuid}catch(e){console.error("[obi] error starting session",{error:e}),this.setState("error")}}async joinRoom({withMicrophone:e=!1,withStateRecovery:t=!1}={}){this.room=this.roomFactory({adaptiveStream:!0,dynacast:!0}),this.room.on(O.Disconnected,r=>{if(!this.room)return;let i=null;switch(r){case 12:i="invalid-room";break}this.shutdown(i)}),this.room.on(O.TrackSubscribed,r=>{r.kind==="audio"&&(r.attach(),r.source===P.Source.Microphone&&(this.agentAnalyser&&this.agentAnalyser.disconnect(),this.agentAnalyser=this.createFFT(r.mediaStream)))}),this.room.on(O.LocalTrackPublished,r=>{r.kind==="audio"&&(this.userAnalyser&&this.userAnalyser.disconnect(),this.userAnalyser=this.createFFT(r.audioTrack.mediaStream))}),this.room.on(O.ParticipantAttributesChanged,r=>{if(!r["lk.agent.state"])return;const i=r["lk.agent.state"];switch(i){case"speaking":this.speakingStateChanged("speaking");break;case"listening":this.state!=="connected"&&this.speakingStateChanged("listening");break;case"thinking":this.speakingStateChanged("thinking");break;default:console.warn("[obi] unknown speaking state",i)}}),this.room.on(O.DataReceived,async r=>{try{const i=new TextDecoder().decode(r),A=JSON.parse(i);switch(A.status||A.request||A.type){case"course_progress":typeof A.current_step=="number"&&typeof A.total_steps=="number"&&Array.isArray(A.step_names)&&this.emit("courseProgress",{currentStep:Math.max(1,A.current_step),totalSteps:Math.max(1,A.total_steps),stepNames:A.step_names});break;case"using_tool":this.speakingStateChanged("busy");break;case"using_tool_ended":this.speakingStateChanged("speaking");break;case"prompt_user":this.setState("volume-check");break;case"mic_check":this.setState("mic-check");break;case"share_mic":this.setState("mic-share");break;case"share_screen":this.setState("screen-share");break;case"navigate":this.setState("navigate");break;default:console.warn("[obi] unknown data received",A)}}catch(i){console.error("[obi] error parsing data",i)}}),this.room.localParticipant.registerRpcMethod("mic_check",async r=>(this.sessionUuid,await this.checkMicrophone()?"ok":"error")),this.room.localParticipant.registerRpcMethod("screen_capture",async r=>{if(!this.captureScreen)return console.error("[obi] no captureScreen function provided"),"error";let i=null,A=null;try{i=await this.captureScreen()}catch(s){i=null,s=s}if(!i||A)return console.error("[obi] error capturing screen",{error:A}),"error";try{return await this.room.localParticipant.sendFile(new File([i],"screen_capture.png",{type:"image/png"}),{mimeType:"image/png",topic:"screen_capture"}),"ok"}catch(s){return console.error("[obi] error sending screen capture",{error:s}),"error"}}),await this.room.connect(this.roomUrl,this.joinToken);for(let r=0;r<9&&!(this.room.state===fe.Connected&&this.room.remoteParticipants.size>=1);r++)await new Promise(i=>setTimeout(i,1e3));if(!(this.room.state===fe.Connected&&this.room.remoteParticipants.size>=1)){console.error("[obi] room not connected",{state:this.room.state,numParticipants:this.room.remoteParticipants.size}),this.shutdown("invalid-room");return}if(e&&await this.room.localParticipant.setMicrophoneEnabled(!0),t){let r=!1;for(const i of this.room.remoteParticipants.values())i.isSpeaking&&(r=!0);r?this.speakingState="speaking":this.speakingState="listening"}}async continue(){this.sessionUuid,this.speakingStateChanged("thinking"),await this.sendData({request:"prompt_user",success:!0})}async checkMicrophone(){let e=!1;try{e=(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch(t){console.error("[obi] error checking microphone permission:",t)}return e?(this.sessionUuid,await this.room.localParticipant.setMicrophoneEnabled(!0),this.isMicShared=!0):this.sessionUuid,e&&this.clientType==="sdk"&&this.setState("in-progress"),this.emit("micCheckComplete",e),e}async shareMicrophone(){this.sessionUuid,this.speakingStateChanged("thinking");let e=null,t=null;try{e=await this.room.localParticipant.setMicrophoneEnabled(!0),this.isMicShared=!0}catch(r){r=r,this.isMicShared=!1}e?this.sessionUuid:console.error("[obi] failed to share microphone",{error:t}),await this.sendData({request:"share_mic",success:!!e}),this.clientType==="sdk"&&this.setState("in-progress")}async shareMicrophoneFailed(){this.isMicShared=!1,await this.sendData({request:"share_mic",success:!1}),this.clientType==="sdk"&&this.setState("in-progress")}async shareScreen(){this.sessionUuid,this.speakingStateChanged("thinking"),await this.room.localParticipant.setScreenShareEnabled(!0,{video:{displaySurface:"window"}}),await this.sendData({request:"share_screen",success:!0}),this.setState("navigate")}async pause(){this.muteMicrophone(),this.isPaused=!0,this.emit("paused"),await this.sendData({request:"pause"}),console.log("[obi] paused session",{sessionUuid:this.sessionUuid})}async unpause(){this.unmuteMicrophone(),this.isPaused=!1,this.emit("unpaused"),await this.sendData({request:"unpause"}),console.log("[obi] unpaused session",{sessionUuid:this.sessionUuid})}muteMicrophone(){this.sessionUuid,this.room.localParticipant.getTrackPublications().forEach(e=>{var t,r;e.handleMuted(),(r=(t=e.track)==null?void 0:t.mediaStream)==null||r.getTracks().forEach(i=>i.enabled=!1)})}unmuteMicrophone(){this.sessionUuid,this.room.localParticipant.getTrackPublications().forEach(e=>{var t,r;e.handleUnmuted(),(r=(t=e.track)==null?void 0:t.mediaStream)==null||r.getTracks().forEach(i=>i.enabled=!0)})}async stop(){this.emit("stopped"),await this.shutdown()}async shutdown(e=null){if(this.room){this.sessionUuid;const t=this.room;this.room=null,await t.disconnect(),this.sessionUuid}this.sessionUuid=null,this.roomId=null,this.joinToken=null,this.roomUrl=null,this.emit("shutdown",e)}async say(e){this.speakingStateChanged("thinking"),this.isPaused&&await this.unpause(),await this.sendData({request:"say",message:e})}serialise(){return JSON.stringify({state:this.state,speakingState:this.speakingState,appToken:this.appToken,planId:this.planId,clientType:this.clientType,isPaused:this.isPaused,identity:this.identity,sessionUuid:this.sessionUuid,roomId:this.roomId,joinToken:this.joinToken,roomUrl:this.roomUrl})}audioSpectrum(){return this.speakingState==="speaking"&&this.agentAnalyser?this.normaliseSpectrum(this.agentAnalyser):this.speakingState==="listening"&&this.userAnalyser?this.normaliseSpectrum(this.userAnalyser):null}normaliseSpectrum(e){const r=e.context.sampleRate/2/e.frequencyBinCount,i=new Uint8Array(e.frequencyBinCount);e.getByteFrequencyData(i);const A=[],s=50,o=5e3,a=8,c=Math.pow(o/s,1/a);for(let u=0;u<a;u++){const l=s*Math.pow(c,u),d=s*Math.pow(c,u+1),h=Math.floor(l/r),f=Math.floor(d/r),p=Math.min(f,i.length),g=Math.min(h,p);if(g<p){const v=i.slice(g,p).reduce((y,B)=>y+B,0)/(p-g)/255;A.push(v)}else A.push(0)}return A}setState(e){this.state;const t=this.state;this.state=e,this.emit("stateChanged",e,t)}static deserialise(e,t,r,i={}){const A=JSON.parse(e),s=new pa(t,A.planId,r,i);return s.state=A.state,s.speakingState=A.speakingState,s.identity=A.identity||null,s.isPaused=A.isPaused||!1,s.sessionUuid=A.sessionUuid||null,s.roomId=A.roomId||null,s.joinToken=A.joinToken||null,s.roomUrl=A.roomUrl||null,s}speakingStateChanged(e){this.speakingState;const t=this.speakingState;this.speakingState=e,this.emit("speakingStateChanged",e,t)}async sendData(e){await this.room.localParticipant.publishData(new TextEncoder().encode(JSON.stringify(e)),{reliable:!0})}createFFT(e){const t=new AudioContext,r=t.createAnalyser();return t.createMediaStreamSource(e).connect(r),r.fftSize=2048,r.smoothingTimeConstant=.6,r}}class fa extends Gc{constructor(e,t,r={}){super(),this.state="loading",this.error=null,this.identity=null,this.product=null,this.plans=[],this.selectedPlan=null,this.selectedPlanUuid=null,this.showWidget=!1,this.session=null,this.captureScreen=null,this.appToken=e,this.clientType=t,this.api=r.api||new H0({baseUrl:r.apiBaseUrl||K0}),this.sessionFactory=r.sessionFactory||((i,A,s,o)=>new pa(i,A,s,o)),this.captureScreen=r.captureScreen||null}async initialise(e={}){var t,r,i,A;if(!this.appToken)throw new Error("App token is required");this.setState("loading");try{const s=await this.api.clientInitialise(this.appToken,{identity:e.identity,client_type:this.clientType});if(this.identity=e.identity||null,this.product=((t=s.data)==null?void 0:t.product)||null,this.plans=((r=s.data)==null?void 0:r.onboarding_plans)||[],this.selectedPlan=((i=s.data)==null?void 0:i.selected_plan)||null,this.showWidget=((A=s.data)==null?void 0:A.show_widget)||!1,e.planUuid){let o=this.plans.find(a=>a.uuid===e.planUuid)||null;if(!o)try{const a=await this.api.getSessionPlan(e.planUuid);o=this.plans.find(c=>{var u;return c.uuid===((u=a.data)==null?void 0:u.plan_uuid)})||null}catch(a){console.error("[obi] error getting session plan",a)}o?(this.selectedPlan=o,this.selectedPlanUuid=e.planUuid):console.warn("[obi] plan not found",{planUuid:e.planUuid})}this.identity,this.product,this.plans,this.selectedPlan,this.showWidget}catch(s){throw this.error=s instanceof Error?s:new Error(String(s)),this.setState("error"),s}finally{this.setState("ready")}}selectPlan(e){this.selectedPlan=e,this.selectedPlanUuid=(e==null?void 0:e.uuid)||null,this.emit("planSelected",e),e&&this.trackEvent("course-selected")}async startSession(e,t){return await this._stopSession(),this.session=this.sessionFactory(this.appToken,e,this.clientType,{api:this.api,identity:this.identity,captureScreen:this.captureScreen}),this.prepareSession(t),this.session.start().then(()=>{this.emit("sessionStarted",this.session)}).catch(r=>{this.session=null,console.error("[obi] error starting session",r)}),this.trackEvent("course-get-started"),this.session}async resumeSession(e){var t,r;return this.state,(t=this.session)==null||t.state,(r=this.session)==null||r.speakingState,this.session.captureScreen=this.captureScreen,this.prepareSession(e),this.session.joinRoom({withMicrophone:!0,withStateRecovery:!0}).then(()=>{this.emit("sessionResumed",this.session)}).catch(i=>{console.error("[obi] error joining room",{error:i}),i instanceof Error&&i.message==="Room is not connected"&&this.session.stop()}),this.trackEvent("session_resumed"),this.session}prepareSession(e){if(!this.session)throw new Error("No session to prepare");return e(this.session),this.session.on("stopped",()=>{this.emit("sessionStopped")}),this.session.on("shutdown",t=>{var r,i;(i=(r=this.session)==null?void 0:r.removeAllListeners)==null||i.call(r),this.session=null,this.selectedPlan=null,this.selectedPlanUuid=null,this.emit("sessionShutdown",t)}),this.session}async stopSession(){await this._stopSession(),this.selectedPlan&&this.selectPlan(null)}async _stopSession(){this.session&&(this.trackEvent("session_stopped"),await this.session.stop(),this.session=null)}isLoading(){return this.state==="loading"}isReady(){return this.state==="ready"}serialise(){var e;return JSON.stringify({state:this.state,appToken:this.appToken,clientType:this.clientType,identity:this.identity,product:this.product,plans:this.plans,selectedPlan:this.selectedPlan,selectedPlanUuid:this.selectedPlanUuid,showWidget:this.showWidget,session:(e=this.session)==null?void 0:e.serialise(),serialisedAt:new Date().toISOString()})}static deserialise(e,t,r,i={}){const A=JSON.parse(e);if(A.serialisedAt){const o=new Date(A.serialisedAt);if(new Date().getTime()-o.getTime()>1e3*20)throw new Error("Client was serialised more than 20 seconds ago, assuming it's dead.")}else throw new Error("Client was not serialised, assuming it's dead.");const s=new fa(t,r,i);return s.state=A.state,s.identity=A.identity||null,s.product=A.product||null,s.plans=A.plans||[],s.selectedPlan=A.selectedPlan||null,s.selectedPlanUuid=A.selectedPlanUuid||null,s.showWidget=A.showWidget||!1,A.session&&(s.session=pa.deserialise(A.session,t,r,{api:s.api})),s}setState(e){const t=this.state;this.state=e,this.emit("stateChanged",e,t)}trackEvent(e,t={}){var r,i,A;this.emit("trackEvent",e,{...t,clientType:this.clientType,planId:(r=this.selectedPlan)==null?void 0:r.uuid,productId:(i=this.product)==null?void 0:i.uuid,sessionId:(A=this.session)==null?void 0:A.sessionUuid})}}var ga,ee,V0,zr,G0,j0,W0,q0,cd,ud,ld,J0,WA={},z0=[],lQ=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qA=Array.isArray;function Kn(n,e){for(var t in e)n[t]=e[t];return n}function dd(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function hd(n,e,t){var r,i,A,s={};for(A in e)A=="key"?r=e[A]:A=="ref"?i=e[A]:s[A]=e[A];if(arguments.length>2&&(s.children=arguments.length>3?ga.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(A in n.defaultProps)s[A]==null&&(s[A]=n.defaultProps[A]);return ma(n,s,r,i,null)}function ma(n,e,t,r,i){var A={type:n,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++V0,__i:-1,__u:0};return i==null&&ee.vnode!=null&&ee.vnode(A),A}function St(n){return n.children}function Vn(n,e){this.props=n,this.context=e}function Di(n,e){if(e==null)return n.__?Di(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?Di(n):null}function X0(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return X0(n)}}function pd(n){(!n.__d&&(n.__d=!0)&&zr.push(n)&&!va.__r++||G0!=ee.debounceRendering)&&((G0=ee.debounceRendering)||j0)(va)}function va(){for(var n,e,t,r,i,A,s,o=1;zr.length;)zr.length>o&&zr.sort(W0),n=zr.shift(),o=zr.length,n.__d&&(t=void 0,i=(r=(e=n).__v).__e,A=[],s=[],e.__P&&((t=Kn({},r)).__v=r.__v+1,ee.vnode&&ee.vnode(t),fd(e.__P,t,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,A,i??Di(r),!!(32&r.__u),s),t.__v=r.__v,t.__.__k[t.__i]=t,ty(A,t,s),t.__e!=i&&X0(t)));va.__r=0}function Y0(n,e,t,r,i,A,s,o,a,c,u){var l,d,h,f,p,g,v=r&&r.__k||z0,y=e.length;for(a=dQ(t,e,v,a,y),l=0;l<y;l++)(h=t.__k[l])!=null&&(d=h.__i==-1?WA:v[h.__i]||WA,h.__i=l,g=fd(n,h,d,i,A,s,o,a,c,u),f=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&gd(d.ref,null,h),u.push(h.ref,h.__c||f,h)),p==null&&f!=null&&(p=f),4&h.__u||d.__k===h.__k?a=Z0(h,a,n):typeof h.type=="function"&&g!==void 0?a=g:f&&(a=f.nextSibling),h.__u&=-7);return t.__e=p,a}function dQ(n,e,t,r,i){var A,s,o,a,c,u=t.length,l=u,d=0;for(n.__k=new Array(i),A=0;A<i;A++)(s=e[A])!=null&&typeof s!="boolean"&&typeof s!="function"?(a=A+d,(s=n.__k[A]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?ma(null,s,null,null,null):qA(s)?ma(St,{children:s},null,null,null):s.constructor==null&&s.__b>0?ma(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=n,s.__b=n.__b+1,o=null,(c=s.__i=hQ(s,t,a,l))!=-1&&(l--,(o=t[c])&&(o.__u|=2)),o==null||o.__v==null?(c==-1&&(i>u?d--:i<u&&d++),typeof s.type!="function"&&(s.__u|=4)):c!=a&&(c==a-1?d--:c==a+1?d++:(c>a?d--:d++,s.__u|=4))):n.__k[A]=null;if(l)for(A=0;A<u;A++)(o=t[A])!=null&&!(2&o.__u)&&(o.__e==r&&(r=Di(o)),ry(o,o));return r}function Z0(n,e,t){var r,i;if(typeof n.type=="function"){for(r=n.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=n,e=Z0(r[i],e,t));return e}n.__e!=e&&(e&&n.type&&!t.contains(e)&&(e=Di(n)),t.insertBefore(n.__e,e||null),e=n.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ya(n,e){return e=e||[],n==null||typeof n=="boolean"||(qA(n)?n.some(function(t){ya(t,e)}):e.push(n)),e}function hQ(n,e,t,r){var i,A,s=n.key,o=n.type,a=e[t];if(a===null&&n.key==null||a&&s==a.key&&o==a.type&&!(2&a.__u))return t;if(r>(a!=null&&!(2&a.__u)?1:0))for(i=t-1,A=t+1;i>=0||A<e.length;){if(i>=0){if((a=e[i])&&!(2&a.__u)&&s==a.key&&o==a.type)return i;i--}if(A<e.length){if((a=e[A])&&!(2&a.__u)&&s==a.key&&o==a.type)return A;A++}}return-1}function $0(n,e,t){e[0]=="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||lQ.test(e)?t:t+"px"}function wa(n,e,t,r,i){var A;e:if(e=="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof r=="string"&&(n.style.cssText=r=""),r)for(e in r)t&&e in t||$0(n.style,e,"");if(t)for(e in t)r&&t[e]==r[e]||$0(n.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")A=e!=(e=e.replace(q0,"$1")),e=e.toLowerCase()in n||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),n.l||(n.l={}),n.l[e+A]=t,t?r?t.u=r.u:(t.u=cd,n.addEventListener(e,A?ld:ud,A)):n.removeEventListener(e,A?ld:ud,A);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in n)try{n[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?n.removeAttribute(e):n.setAttribute(e,e=="popover"&&t==1?"":t))}}function ey(n){return function(e){if(this.l){var t=this.l[e.type+n];if(e.t==null)e.t=cd++;else if(e.t<t.u)return;return t(ee.event?ee.event(e):e)}}}function fd(n,e,t,r,i,A,s,o,a,c){var u,l,d,h,f,p,g,v,y,B,b,w,_,k,F,x,U,T=e.type;if(e.constructor!=null)return null;128&t.__u&&(a=!!(32&t.__u),A=[o=e.__e=t.__e]),(u=ee.__b)&&u(e);e:if(typeof T=="function")try{if(v=e.props,y="prototype"in T&&T.prototype.render,B=(u=T.contextType)&&r[u.__c],b=u?B?B.props.value:u.__:r,t.__c?g=(l=e.__c=t.__c).__=l.__E:(y?e.__c=l=new T(v,b):(e.__c=l=new Vn(v,b),l.constructor=T,l.render=fQ),B&&B.sub(l),l.props=v,l.state||(l.state={}),l.context=b,l.__n=r,d=l.__d=!0,l.__h=[],l._sb=[]),y&&l.__s==null&&(l.__s=l.state),y&&T.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Kn({},l.__s)),Kn(l.__s,T.getDerivedStateFromProps(v,l.__s))),h=l.props,f=l.state,l.__v=e,d)y&&T.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),y&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(y&&T.getDerivedStateFromProps==null&&v!==h&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(v,b),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(v,l.__s,b)===!1||e.__v==t.__v){for(e.__v!=t.__v&&(l.props=v,l.state=l.__s,l.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(Q){Q&&(Q.__=e)}),w=0;w<l._sb.length;w++)l.__h.push(l._sb[w]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(v,l.__s,b),y&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(h,f,p)})}if(l.context=b,l.props=v,l.__P=n,l.__e=!1,_=ee.__r,k=0,y){for(l.state=l.__s,l.__d=!1,_&&_(e),u=l.render(l.props,l.state,l.context),F=0;F<l._sb.length;F++)l.__h.push(l._sb[F]);l._sb=[]}else do l.__d=!1,_&&_(e),u=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++k<25);l.state=l.__s,l.getChildContext!=null&&(r=Kn(Kn({},r),l.getChildContext())),y&&!d&&l.getSnapshotBeforeUpdate!=null&&(p=l.getSnapshotBeforeUpdate(h,f)),x=u,u!=null&&u.type===St&&u.key==null&&(x=ny(u.props.children)),o=Y0(n,qA(x)?x:[x],e,t,r,i,A,s,o,a,c),l.base=e.__e,e.__u&=-161,l.__h.length&&s.push(l),g&&(l.__E=l.__=null)}catch(Q){if(e.__v=null,a||A!=null)if(Q.then){for(e.__u|=a?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;A[A.indexOf(o)]=null,e.__e=o}else for(U=A.length;U--;)dd(A[U]);else e.__e=t.__e,e.__k=t.__k;ee.__e(Q,e,t)}else A==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):o=e.__e=pQ(t.__e,e,t,r,i,A,s,a,c);return(u=ee.diffed)&&u(e),128&e.__u?void 0:o}function ty(n,e,t){for(var r=0;r<t.length;r++)gd(t[r],t[++r],t[++r]);ee.__c&&ee.__c(e,n),n.some(function(i){try{n=i.__h,i.__h=[],n.some(function(A){A.call(i)})}catch(A){ee.__e(A,i.__v)}})}function ny(n){return typeof n!="object"||n==null||n.__b&&n.__b>0?n:qA(n)?n.map(ny):Kn({},n)}function pQ(n,e,t,r,i,A,s,o,a){var c,u,l,d,h,f,p,g=t.props,v=e.props,y=e.type;if(y=="svg"?i="http://www.w3.org/2000/svg":y=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),A!=null){for(c=0;c<A.length;c++)if((h=A[c])&&"setAttribute"in h==!!y&&(y?h.localName==y:h.nodeType==3)){n=h,A[c]=null;break}}if(n==null){if(y==null)return document.createTextNode(v);n=document.createElementNS(i,y,v.is&&v),o&&(ee.__m&&ee.__m(e,A),o=!1),A=null}if(y==null)g===v||o&&n.data==v||(n.data=v);else{if(A=A&&ga.call(n.childNodes),g=t.props||WA,!o&&A!=null)for(g={},c=0;c<n.attributes.length;c++)g[(h=n.attributes[c]).name]=h.value;for(c in g)if(h=g[c],c!="children"){if(c=="dangerouslySetInnerHTML")l=h;else if(!(c in v)){if(c=="value"&&"defaultValue"in v||c=="checked"&&"defaultChecked"in v)continue;wa(n,c,null,h,i)}}for(c in v)h=v[c],c=="children"?d=h:c=="dangerouslySetInnerHTML"?u=h:c=="value"?f=h:c=="checked"?p=h:o&&typeof h!="function"||g[c]===h||wa(n,c,h,g[c],i);if(u)o||l&&(u.__html==l.__html||u.__html==n.innerHTML)||(n.innerHTML=u.__html),e.__k=[];else if(l&&(n.innerHTML=""),Y0(e.type=="template"?n.content:n,qA(d)?d:[d],e,t,r,y=="foreignObject"?"http://www.w3.org/1999/xhtml":i,A,s,A?A[0]:t.__k&&Di(t,0),o,a),A!=null)for(c=A.length;c--;)dd(A[c]);o||(c="value",y=="progress"&&f==null?n.removeAttribute("value"):f!=null&&(f!==n[c]||y=="progress"&&!f||y=="option"&&f!=g[c])&&wa(n,c,f,g[c],i),c="checked",p!=null&&p!=n[c]&&wa(n,c,p,g[c],i))}return n}function gd(n,e,t){try{if(typeof n=="function"){var r=typeof n.__u=="function";r&&n.__u(),r&&e==null||(n.__u=n(e))}else n.current=e}catch(i){ee.__e(i,t)}}function ry(n,e,t){var r,i;if(ee.unmount&&ee.unmount(n),(r=n.ref)&&(r.current&&r.current!=n.__e||gd(r,null,e)),(r=n.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(A){ee.__e(A,e)}r.base=r.__P=null}if(r=n.__k)for(i=0;i<r.length;i++)r[i]&&ry(r[i],e,t||typeof n.type!="function");t||dd(n.__e),n.__c=n.__=n.__e=void 0}function fQ(n,e,t){return this.constructor(n,t)}function gQ(n,e,t){var r,i,A,s;e==document&&(e=document.documentElement),ee.__&&ee.__(n,e),i=(r=typeof t=="function")?null:t&&t.__k||e.__k,A=[],s=[],fd(e,n=(!r&&t||e).__k=hd(St,null,[n]),i||WA,WA,e.namespaceURI,!r&&t?[t]:i?null:e.firstChild?ga.call(e.childNodes):null,A,!r&&t?t:i?i.__e:e.firstChild,r,s),ty(A,n,s)}function iy(n){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(A){this.props.value!=A.value&&r.forEach(function(s){s.__e=!0,pd(s)})},this.sub=function(A){r.add(A);var s=A.componentWillUnmount;A.componentWillUnmount=function(){r&&r.delete(A),s&&s.call(A)}}),t.children}return e.__c="__cC"+J0++,e.__=n,e.Provider=e.__l=(e.Consumer=function(t,r){return t.children(r)}).contextType=e,e}ga=z0.slice,ee={__e:function(n,e,t,r){for(var i,A,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((A=i.constructor)&&A.getDerivedStateFromError!=null&&(i.setState(A.getDerivedStateFromError(n)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(n,r||{}),s=i.__d),s)return i.__E=i}catch(o){n=o}throw n}},V0=0,Vn.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Kn({},this.state),typeof n=="function"&&(n=n(Kn({},t),this.props)),n&&Kn(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),pd(this))},Vn.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),pd(this))},Vn.prototype.render=St,zr=[],j0=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,W0=function(n,e){return n.__v.__b-e.__v.__b},va.__r=0,q0=/(PointerCapture)$|Capture$/i,cd=0,ud=ey(!1),ld=ey(!0),J0=0;var mQ=0;function C(n,e,t,r,i,A){e||(e={});var s,o,a=e;if("ref"in a)for(o in a={},e)o=="ref"?s=e[o]:a[o]=e[o];var c={type:n,props:a,key:t,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--mQ,__i:-1,__u:0,__source:i,__self:A};if(typeof n=="function"&&(s=n.defaultProps))for(o in s)a[o]===void 0&&(a[o]=s[o]);return ee.vnode&&ee.vnode(c),c}var Xr,Ve,md,Ay,JA=0,sy=[],it=ee,oy=it.__b,ay=it.__r,cy=it.diffed,uy=it.__c,ly=it.unmount,dy=it.__;function zA(n,e){it.__h&&it.__h(Ve,n,JA||e),JA=0;var t=Ve.__H||(Ve.__H={__:[],__h:[]});return n>=t.__.length&&t.__.push({}),t.__[n]}function ge(n){return JA=1,vQ(fy,n)}function vQ(n,e,t){var r=zA(Xr++,2);if(r.t=n,!r.__c&&(r.__=[t?t(e):fy(void 0,e),function(o){var a=r.__N?r.__N[0]:r.__[0],c=r.t(a,o);a!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=Ve,!Ve.__f)){var i=function(o,a,c){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(d){return!!d.__c});if(u.every(function(d){return!d.__N}))return!A||A.call(this,o,a,c);var l=r.__c.props!==o;return u.forEach(function(d){if(d.__N){var h=d.__[0];d.__=d.__N,d.__N=void 0,h!==d.__[0]&&(l=!0)}}),A&&A.call(this,o,a,c)||l};Ve.__f=!0;var A=Ve.shouldComponentUpdate,s=Ve.componentWillUpdate;Ve.componentWillUpdate=function(o,a,c){if(this.__e){var u=A;A=void 0,i(o,a,c),A=u}s&&s.call(this,o,a,c)},Ve.shouldComponentUpdate=i}return r.__N||r.__}function Kt(n,e){var t=zA(Xr++,3);!it.__s&&bd(t.__H,e)&&(t.__=n,t.u=e,Ve.__H.__h.push(t))}function vd(n,e){var t=zA(Xr++,4);!it.__s&&bd(t.__H,e)&&(t.__=n,t.u=e,Ve.__h.push(t))}function En(n){return JA=5,yd(function(){return{current:n}},[])}function yd(n,e){var t=zA(Xr++,7);return bd(t.__H,e)&&(t.__=n(),t.__H=e,t.__h=n),t.__}function yQ(n,e){return JA=8,yd(function(){return n},e)}function hy(n){var e=Ve.context[n.__c],t=zA(Xr++,9);return t.c=n,e?(t.__==null&&(t.__=!0,e.sub(Ve)),e.props.value):n.__}function wQ(){for(var n;n=sy.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(ba),n.__H.__h.forEach(wd),n.__H.__h=[]}catch(e){n.__H.__h=[],it.__e(e,n.__v)}}it.__b=function(n){Ve=null,oy&&oy(n)},it.__=function(n,e){n&&e.__k&&e.__k.__m&&(n.__m=e.__k.__m),dy&&dy(n,e)},it.__r=function(n){ay&&ay(n),Xr=0;var e=(Ve=n.__c).__H;e&&(md===Ve?(e.__h=[],Ve.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(ba),e.__h.forEach(wd),e.__h=[],Xr=0)),md=Ve},it.diffed=function(n){cy&&cy(n);var e=n.__c;e&&e.__H&&(e.__H.__h.length&&(sy.push(e)!==1&&Ay===it.requestAnimationFrame||((Ay=it.requestAnimationFrame)||bQ)(wQ)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),md=Ve=null},it.__c=function(n,e){e.some(function(t){try{t.__h.forEach(ba),t.__h=t.__h.filter(function(r){return!r.__||wd(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],it.__e(r,t.__v)}}),uy&&uy(n,e)},it.unmount=function(n){ly&&ly(n);var e,t=n.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{ba(r)}catch(i){e=i}}),t.__H=void 0,e&&it.__e(e,t.__v))};var py=typeof requestAnimationFrame=="function";function bQ(n){var e,t=function(){clearTimeout(r),py&&cancelAnimationFrame(e),setTimeout(n)},r=setTimeout(t,100);py&&(e=requestAnimationFrame(t))}function ba(n){var e=Ve,t=n.__c;typeof t=="function"&&(n.__c=void 0,t()),Ve=e}function wd(n){var e=Ve;n.__c=n.__(),Ve=e}function bd(n,e){return!n||n.length!==e.length||e.some(function(t,r){return t!==n[r]})}function fy(n,e){return typeof e=="function"?e(n):e}function BQ({size:n=24,color:e="#000"}){return C("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-x-icon lucide-x",children:[C("path",{d:"M18 6 6 18"}),C("path",{d:"m6 6 12 12"})]})}function gy({onClose:n}){return C("button",{class:"obi-button obi-close-button",onClick:n,"aria-label":"Close",type:"button",children:C(BQ,{})})}function my({open:n=!1,children:e,onClose:t,size:r="medium"}){const i=En(null),A=En(null);Kt(()=>{const c=i.current;c&&(n&&!c.open?c.showModal():!n&&c.open&&(A.current="programmatic",c.close()))},[n]);const s=c=>{const u=i.current;c.target===u&&(A.current="user-initiated",u==null||u.close())},o=c=>{c.preventDefault(),A.current||(A.current="user-initiated");const u=A.current;A.current=null,t==null||t(u)},a=()=>{var c;A.current="user-initiated",(c=i.current)==null||c.close()};return Kt(()=>{const c=i.current;if(c)return c.addEventListener("click",s),c.addEventListener("close",o),()=>{c.removeEventListener("click",s),c.removeEventListener("close",o)}},[t]),C("dialog",{ref:i,className:`modal-${r}`,children:[C(gy,{onClose:a}),C("div",{class:"modal-content",children:n?typeof e=="function"?e():e:null})]})}function Bd(n){const{children:e,className:t="",...r}=n;return C("div",{className:`${t} obi-panel`,...r,children:e})}function Cd({className:n="",isActive:e=!1,speakingStatus:t,onClick:r,onMouseEnter:i,onMouseLeave:A,children:s}){let o=`obi-pill container ${e&&"active"}`;return t==="user-speaking"&&(o+=" user-speaking"),t==="busy"&&(o+=" busy"),C("div",{className:o,onMouseEnter:i,onMouseLeave:A,children:C("div",{className:`obi-pill pill ${n}`,onClick:r,children:s})})}function vy({className:n="",active:e,speakingStatus:t,onClick:r,onMouseEnter:i,onMouseLeave:A,children:s,...o}){const a=`obi-pill2 container ${e?"active":""} ${t==="user-speaking"?"user-speaking":""} ${n}`;return C("div",{className:a,...o,children:C("div",{className:"pill",onClick:r,onMouseEnter:i,onMouseLeave:A,children:s})})}function Yr({type:n,size:e=24}){return C("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:CQ(n)})}function CQ(n){switch(n){case"pause":return C(St,{children:[C("rect",{x:"14",y:"3",width:"5",height:"18",rx:"1"}),C("rect",{x:"5",y:"3",width:"5",height:"18",rx:"1"})]});case"play":return C(St,{children:C("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})});case"close":return C(St,{children:[C("path",{d:"M18 6 6 18"}),C("path",{d:"m6 6 12 12"})]});case"message":return C(St,{children:C("path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"})});case"minimize":return C(St,{children:[C("path",{d:"m14 10 7-7"}),C("path",{d:"M20 10h-6V4"}),C("path",{d:"m3 21 7-7"}),C("path",{d:"M4 14h6v6"})]});case"voice":return C(St,{children:[C("path",{d:"M2 10v3"}),C("path",{d:"M6 6v11"}),C("path",{d:"M10 3v18"}),C("path",{d:"M14 8v7"}),C("path",{d:"M18 5v13"}),C("path",{d:"M22 10v3"})]});case"open":return C(St,{children:[C("path",{d:"M12 7v14"}),C("path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"})]})}}const _d=iy(null);function _Q({children:n}){const e=hy(_d);if(!e)throw new Error("PopoutTarget must be used within a Popout component");const{controlledOpen:t,isOpen:r,setIsOpen:i,setAnimating:A,targetRef:s,trigger:o,onChange:a,delayMs:c}=e,u=En(null),l=yy(s,A),[d,h]=ge(!1);Kt(()=>{t!==void 0&&t!==d&&(t?p():g()),h(t)},[t]),Kt(()=>()=>{u.current&&clearTimeout(u.current)},[]);function f(){u.current&&(clearTimeout(u.current),u.current=null)}function p(){f(),c>0?u.current=setTimeout(()=>{a==null||a(!0),i(!0),u.current=null},c):(a==null||a(!0),i(!0))}function g(){f(),a==null||a(!1),i(!1)}const v=()=>{o==="click"&&(r?g():p())};function y(){o==="hover"&&p()}function B(){o==="hover"&&g()}return C("div",{ref:l,class:"target",onClick:v,onMouseEnter:y,onMouseLeave:B,children:n})}function SQ({children:n}){const e=hy(_d);if(!e)throw new Error("PopoutContent must be used within a Popout component");const{isOpen:t,animating:r,setAnimating:i,targetRef:A,contentRef:s}=e,o=yy(s,i);return vd(()=>{if(t&&!r&&A.current&&s.current){const a=s.current;if(!a)return;const c=A.current;if(!c)return;const u=a.getBoundingClientRect(),l=c.getBoundingClientRect(),d=l.right-l.left;a.style.top=`${u.top-u.bottom-(8+e.offset)}px`,a.style.left=`${-(u.right-u.left-d)/2}px`}},[t,r]),t?C("div",{ref:o,class:"content",style:{opacity:r?0:1},children:n}):null}function Vt({trigger:n="click",open:e,onChange:t,children:r,delayMs:i=0,offset:A=0,className:s=""}){const[o,a]=ge(!1),[c,u]=ge(!1),l=En(null),d=En(null),h={controlledOpen:e,isOpen:o,setIsOpen:a,animating:c,setAnimating:u,targetRef:l,contentRef:d,trigger:n,onChange:t,delayMs:i,offset:A};return C(_d.Provider,{value:h,children:C("div",{class:`obi-popout ${s}`,children:r})})}Vt.Target=_Q,Vt.Content=SQ;function yy(n,e){const t=En(null),r=En(null),i=En(!0),A=yQ(s=>{if(n.current=s,!s){r.current&&(r.current.disconnect(),r.current=null),i.current=!0;return}function o(){if(i.current){i.current=!1;return}t.current?clearTimeout(t.current):e(!0),t.current=setTimeout(()=>{e(!1),t.current=null},200)}r.current=new ResizeObserver(o),r.current.observe(s,{box:"border-box"})},[]);return Kt(()=>()=>{r.current&&(r.current.disconnect(),r.current=null)},[]),A}function pn({className:n,onClick:e,type:t,disabled:r,title:i}){const A={cancel:C(Yr,{type:"close",size:16}),pause:C(Yr,{type:"pause",size:16}),play:C(Yr,{type:"play",size:16}),message:C(Yr,{type:"message",size:16}),minimize:C(Yr,{type:"minimize",size:16}),voice:C(Yr,{type:"voice",size:16}),open:C(Yr,{type:"open",size:16})}[t],s={cancel:"",pause:"",play:"",message:"",minimize:"",voice:"",open:""}[t],o=C("button",{class:`obi-button obi-round-button ${s} ${n}`,onClick:r?void 0:e,disabled:r,children:A});return i?C(Vt,{className:"obi-round-button-popout",trigger:"hover",delayMs:200,offset:9,children:[C(Vt.Target,{children:o}),C(Vt.Content,{children:C("div",{className:"obi-round-button-title",children:i})})]}):o}const wy=8,Ba=8,kQ=50,EQ=.7,Ni=3;function by({getBands:n,color:e="white"}){const t=En(null);return Kt(()=>{if(!n)return;const r=setInterval(()=>{try{const i=n();if(!t.current)return;const A=t.current.querySelectorAll(".bar"),s=i&&i.length>0?i.slice(0,Ba).map(o=>{const a=Math.abs(o);return Math.min(a/EQ*wy,wy)||Ni}):Array(Ba).fill(Ni);for(;s.length<Ba;)s.push(Ni);s.forEach((o,a)=>{if(o<Ni&&(o=Ni),A[a]){const c=o*2;A[a].style.height=`${c}px`,A[a].style.display=o>0?"block":"none"}})}catch(i){console.warn("Error updating equaliser:",i)}},kQ);return()=>{clearInterval(r)}},[n]),C("div",{className:"obi-equaliser",ref:t,children:Array.from({length:Ba},(r,i)=>C("div",{className:"column",children:C("div",{className:"bar",style:{height:`${Ni}px`,backgroundColor:e,display:"block"}})},i))})}function XA({className:n,children:e,onClick:t}){return t?C("button",{class:`obi-button obi-message ${n} clickable`,onClick:t,children:e}):C("div",{class:`obi-message ${n}`,children:e})}const UQ=8;function By({color:n="white"}){return C("div",{className:"obi-loading-dots",children:Array.from({length:UQ},(e,t)=>C("div",{className:"column",children:[C("div",{className:"bar",style:{backgroundColor:n,animationDelay:`${t*.15}s`}}),C("div",{className:"dot",style:{backgroundColor:n}})]},t))})}function TQ({onContinue:n,onWrapUp:e}){return C(Bd,{className:"obi-exit-survey",children:C(FQ,{onContinue:n,onWrapUp:()=>{e()}})})}function IQ({onOtherSelect:n,onReasonSelect:e,onClose:t}){const[r,i]=ge("reason"),A=s=>{s==="other"?(n(),i("other-reason")):e(s)};return C(Bd,{className:`obi-exit-survey ${r==="reason"?"obi-exit-survey-reason":""}`,children:r==="reason"?C(xQ,{onReasonSelect:A}):C(QQ,{onReasonSelect:A,onClose:t})})}function FQ({onContinue:n,onWrapUp:e}){return C("div",{className:"obi-exit-survey-container",children:[C("h2",{className:"obi-exit-survey-title",children:"Wrapping up early?"}),C("div",{className:"obi-exit-survey-options",children:[C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-button-continue",onClick:n,type:"button",children:"No, let's continue"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-button-wrap-up",onClick:e,type:"button",children:"Yes, let's wrap up"})]})]})}function xQ({onReasonSelect:n}){return C("div",{className:"obi-exit-survey-container obi-exit-survey-reason-container",children:[C("div",{className:"obi-exit-survey-header",children:C("h2",{className:"obi-exit-survey-title obi-exit-survey-reason-title",children:"Quick feedback?"})}),C("div",{className:"obi-exit-survey-options obi-exit-survey-reason-options",children:[C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("do-later"),type:"button",children:"Will do later"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("cant-talk"),type:"button",children:"Can't talk right now"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("prefer-written"),type:"button",children:"Prefer written instructions"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("technical-issues"),type:"button",children:"Experienced technical issues"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("other"),type:"button",children:"Other"})]})]})}function QQ({onReasonSelect:n,onClose:e}){const[t,r]=ge("");return C("div",{className:"obi-exit-survey-container obi-exit-survey-reason-container",children:[C("div",{className:"obi-exit-survey-header",children:[C(gy,{onClose:e}),C("h2",{className:"obi-exit-survey-title obi-exit-survey-reason-title",children:"Tell us more"})]}),C("div",{className:"obi-exit-survey-options obi-exit-survey-reason-options",children:[C("textarea",{className:"obi-exit-survey-button obi-exit-survey-reason-button",placeholder:"What's on your mind?",value:t,onChange:i=>r(i.target.value)}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-button-wrap-up",onClick:()=>n("other-feedback",t),type:"button",children:"Send feedback"})]})]})}function RQ(n,e){for(var t in e)n[t]=e[t];return n}function Cy(n,e){for(var t in n)if(t!=="__source"&&!(t in e))return!0;for(var r in e)if(r!=="__source"&&n[r]!==e[r])return!0;return!1}function _y(n,e){this.props=n,this.context=e}(_y.prototype=new Vn).isPureReactComponent=!0,_y.prototype.shouldComponentUpdate=function(n,e){return Cy(this.props,n)||Cy(this.state,e)};var Sy=ee.__b;ee.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),Sy&&Sy(n)};var PQ=ee.__e;ee.__e=function(n,e,t,r){if(n.then){for(var i,A=e;A=A.__;)if((i=A.__c)&&i.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),i.__c(n,e)}PQ(n,e,t,r)};var ky=ee.unmount;function Ey(n,e,t){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),n.__c.__H=null),(n=RQ({},n)).__c!=null&&(n.__c.__P===t&&(n.__c.__P=e),n.__c.__e=!0,n.__c=null),n.__k=n.__k&&n.__k.map(function(r){return Ey(r,e,t)})),n}function Uy(n,e,t){return n&&t&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(r){return Uy(r,e,t)}),n.__c&&n.__c.__P===e&&(n.__e&&t.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=t)),n}function Sd(){this.__u=0,this.o=null,this.__b=null}function Ty(n){var e=n.__.__c;return e&&e.__a&&e.__a(n)}function Ca(){this.i=null,this.l=null}ee.unmount=function(n){var e=n.__c;e&&e.__R&&e.__R(),e&&32&n.__u&&(n.type=null),ky&&ky(n)},(Sd.prototype=new Vn).__c=function(n,e){var t=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(t);var i=Ty(r.__v),A=!1,s=function(){A||(A=!0,t.__R=null,i?i(o):o())};t.__R=s;var o=function(){if(!--r.__u){if(r.state.__a){var a=r.state.__a;r.__v.__k[0]=Uy(a,a.__c.__P,a.__c.__O)}var c;for(r.setState({__a:r.__b=null});c=r.o.pop();)c.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(s,s)},Sd.prototype.componentWillUnmount=function(){this.o=[]},Sd.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Ey(this.__b,t,r.__O=r.__P)}this.__b=null}var i=e.__a&&hd(St,null,n.fallback);return i&&(i.__u&=-33),[hd(St,null,e.__a?null:n.children),i]};var Iy=function(n,e,t){if(++t[1]===t[0]&&n.l.delete(e),n.props.revealOrder&&(n.props.revealOrder[0]!=="t"||!n.l.size))for(t=n.i;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;n.i=t=t[2]}};(Ca.prototype=new Vn).__a=function(n){var e=this,t=Ty(e.__v),r=e.l.get(n);return r[0]++,function(i){var A=function(){e.props.revealOrder?(r.push(i),Iy(e,n,r)):i()};t?t(A):A()}},Ca.prototype.render=function(n){this.i=null,this.l=new Map;var e=ya(n.children);n.revealOrder&&n.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.l.set(e[t],this.i=[1,0,this.i]);return n.children},Ca.prototype.componentDidUpdate=Ca.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(e,t){Iy(n,t,e)})};var OQ=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,MQ=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,LQ=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,DQ=/[A-Z0-9]/g,NQ=typeof document<"u",HQ=function(n){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(n)};Vn.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(Vn.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:e})}})});var Fy=ee.event;function KQ(){}function VQ(){return this.cancelBubble}function GQ(){return this.defaultPrevented}ee.event=function(n){return Fy&&(n=Fy(n)),n.persist=KQ,n.isPropagationStopped=VQ,n.isDefaultPrevented=GQ,n.nativeEvent=n};var jQ={enumerable:!1,configurable:!0,get:function(){return this.class}},xy=ee.vnode;ee.vnode=function(n){typeof n.type=="string"&&function(e){var t=e.props,r=e.type,i={},A=r.indexOf("-")===-1;for(var s in t){var o=t[s];if(!(s==="value"&&"defaultValue"in t&&o==null||NQ&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var a=s.toLowerCase();s==="defaultValue"&&"value"in t&&t.value==null?s="value":s==="download"&&o===!0?o="":a==="translate"&&o==="no"?o=!1:a[0]==="o"&&a[1]==="n"?a==="ondoubleclick"?s="ondblclick":a!=="onchange"||r!=="input"&&r!=="textarea"||HQ(t.type)?a==="onfocus"?s="onfocusin":a==="onblur"?s="onfocusout":LQ.test(s)&&(s=a):a=s="oninput":A&&MQ.test(s)?s=s.replace(DQ,"-$&").toLowerCase():o===null&&(o=void 0),a==="oninput"&&i[s=a]&&(s="oninputCapture"),i[s]=o}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=ya(t.children).forEach(function(c){c.props.selected=i.value.indexOf(c.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=ya(t.children).forEach(function(c){c.props.selected=i.multiple?i.defaultValue.indexOf(c.props.value)!=-1:i.defaultValue==c.props.value})),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",jQ)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(n),n.$$typeof=OQ,xy&&xy(n)};var Qy=ee.__r;ee.__r=function(n){Qy&&Qy(n),n.__c};var Ry=ee.diffed;ee.diffed=function(n){Ry&&Ry(n);var e=n.props,t=n.__e;t!=null&&n.type==="textarea"&&"value"in e&&e.value!==t.value&&(t.value=e.value==null?"":e.value)};function WQ(n){const{placeholder:e="Type your message...",value:t,defaultValue:r,onChange:i,onSend:A,onCancel:s,onExpand:o,isLoading:a=!1,disabled:c=!1,maxLength:u=500,children:l}=n,[d,h]=ge(t||r||""),[f,p]=ge((t||r||"").length>24),g=En(null);vd(()=>{f&&(o==null||o(!0))},[]);const v=t!==void 0?t:d,y=w=>{const _=w.currentTarget.value;t===void 0&&h(_),i==null||i(_)},B=w=>{w.key==="Escape"&&(h(t||r||""),p(!1),s==null||s()),w.key==="Enter"&&!w.shiftKey&&v.trim()&&(w.preventDefault(),h(t||r||""),p(!1),b()),(v||"").length>=24&&!f&&(p(!0),o==null||o(!0))};Kt(()=>{g.current&&g.current.focus()},[g.current]);const b=()=>{!v.trim()||a||c||(A==null||A(v.trim()),t===void 0&&h(""))};return C("div",{className:`obi-message-input ${f?"expanded":""}`,children:[C("div",{className:"container",children:C("textarea",{ref:g,className:"field",placeholder:e,value:v,onInput:y,onKeyDown:B,disabled:c||a,maxLength:u,rows:1})}),C("div",{className:"button-container",children:[f&&C("div",{children:l}),C("button",{className:"obi-button send",onClick:b,disabled:!v.trim()||a||c,type:"button",children:C("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:C("path",{d:"M6.00016 10.6673V1.33398M6.00016 1.33398L1.3335 6.00065M6.00016 1.33398L10.6668 6.00065",stroke:"#F3F3F3","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"})})})]})]})}function qQ(n){const{currentStep:e,totalSteps:t,stepNames:r,className:i}=n,A=Array.from({length:t},(a,c)=>({isCompleted:c<e,stepNumber:c+1})),s=r[e-1]||`Step ${e}`,o=`${e}/${t} \u2022 ${s}`;return C("div",{class:`obi-course-progress ${i||""}`,children:[C("div",{class:"obi-course-progress-steps",children:A.map((a,c)=>C("div",{class:"obi-course-progress-container",children:C("div",{class:`obi-course-progress-step ${a.isCompleted?"completed":""}`})},c))}),C("div",{class:"obi-course-progress-description",children:o})]})}function JQ(n){const{disabled:e,inPlan:t,isPaused:r}=n,[i,A]=ge(null),[s,o]=ge(n.isActive??n.defaultIsActive??!1),[a,c]=ge(!1),[u,l]=ge(n.cancelling??!1),[d,h]=ge(n.messaging??!1),[f,p]=ge(!1),[g,v]=ge(!1);vd(()=>{n.messaging!==void 0&&h(n.messaging)},[n.messaging]);function y(){o(!0),c(!1),v(!0),n.messaging!==void 0&&h(n.messaging)}function B(){}function b(){i&&(clearTimeout(i),A(null))}function w(){A(setTimeout(()=>{o(n.defaultIsActive??!1),v(!1)},400))}function _(Z){var We;p(!1),(We=n.onMessage)==null||We.call(n,Z)}function k(){var Z;h(!1),p(!1),o(!1),c(!0),(Z=n.onMinimize)==null||Z.call(n)}function F(){var Z;h(!1),l(!0),p(!1),(Z=n.onCancelClick)==null||Z.call(n)}function x(){var Z;t||((Z=n.onOpen)==null||Z.call(n))}function U(){var Z,We;(Z=n.onMessage)==null||Z.call(n,"Okay, let's continue."),(We=n.onOneClickAction)==null||We.call(n,"Ready to continue?")}function T(Z){var We;n.messaging===void 0&&((We=n.onMessagingChange)==null||We.call(n,Z),h(Z)),Z||p(!1)}const Q=n.isActive??((s||t)&&!a&&!e),M=Q&&t,X=Q&&t&&!f,H=n.speakingStatus==="user-speaking",q=n.speakingStatus==="thinking",ve=n.speakingStatus==="busy",Y=Q&&!t&&!u&&g,ie=Q&&t&&r&&!H&&!u,Qe=Q&&t&&r&&H&&!u,qe=Q&&t&&!r&&H&&!u,Be=Q&&t&&!r&&ve&&!u,ht=d&&H,Re=Y||ie||Qe||qe||u,Ne=400,ne=Q&&t&&!f,et=Y?5:10;return!t&&!u?C(zQ,{...n}):!t&&u?C(XQ,{onOtherSelect:()=>{var Z;(Z=n.onCancelReasonOther)==null||Z.call(n)},onCancelReason:Z=>{var We;o(n.defaultIsActive??!1),l(!1),(We=n.onCancelReason)==null||We.call(n,Z)},onClose:()=>{o(n.defaultIsActive??!1),l(!1)}}):C(Bd,{className:`obi-widget-panel ${M?"expanded":""} ${f?"maximized":""} ${d?"messaging":""} ${ve?"tool-usage":""}`,children:[C("div",{className:`obi-widget ${Q?"active":""} ${t?"in-plan":""}`,onMouseEnter:b,onMouseLeave:w,children:[X&&C(pn,{type:"cancel",onClick:F,disabled:u,title:"Cancel session"}),X&&!r&&C(pn,{type:"pause",onClick:n.onPause,title:"Pause session"}),X&&r&&C(pn,{type:"play",onClick:n.onUnpause,title:"Unpause session"}),C(Vt,{className:"obi-widget-popout",open:Re,trigger:null,delayMs:Ne,offset:et,children:[C(Vt.Target,{children:[ht&&C(WQ,{value:n.message,defaultValue:"Okay, let's continue.",onCancel:()=>T(!1),onSend:_,onExpand:p,onChange:n.onMessageChange,children:C("div",{className:"obi-widget-buttons",children:[C(pn,{type:"cancel",onClick:F,disabled:u,title:"Cancel session"}),!r&&C(pn,{type:"pause",onClick:n.onPause,title:"Pause session"}),r&&C(pn,{type:"play",onClick:n.onUnpause,title:"Unpause session"}),C(pn,{type:d?"voice":"message",disabled:!H||n.messaging!==void 0,onClick:()=>T(!d),title:d?"Voice input":"Text input"}),C(pn,{type:"minimize",onClick:k,title:"Minimize widget"})]})}),!ht&&C(Cd,{className:Q&&!t?"button":"",isActive:Q,speakingStatus:n.speakingStatus,onClick:x,onMouseEnter:y,onMouseLeave:B,children:[Q&&!t&&!Be&&C("span",{className:"obi-widget-pill-text",children:"Tutorials"}),Q&&t&&Be&&C("span",{className:"obi-widget-pill-text",children:"Searching knowledge ..."}),Q&&t&&!q&&!Be&&C(by,{getBands:n.spectrum}),Q&&q&&!Be&&C(By,{})]})]}),C(Vt.Content,{children:C("div",{onMouseLeave:w,children:[Y&&C(XA,{onClick:x,children:"Click to see all"}),ie&&C(XA,{children:"Session will pause shortly"}),Qe&&C(XA,{children:"Paused"}),qe&&C(XA,{onClick:U,children:"Ready to continue?"}),u&&C(TQ,{onContinue:()=>{var Z;(Z=n.onCancelAbort)==null||Z.call(n),l(!1),n.messaging!==void 0&&h(n.messaging)},onWrapUp:()=>{var Z;(Z=n.onCancel)==null||Z.call(n)}})]})})]}),X&&C(pn,{type:d?"voice":"message",disabled:!H||n.messaging!==void 0,onClick:()=>T(!d),title:d?"Voice input":"Text input"}),X&&C(pn,{type:"minimize",onClick:k,title:"Minimize widget"})]}),ne&&n.courseProgress&&C("div",{className:`obi-course-progress-container ${d?"expanded":""}`,children:C(qQ,{currentStep:n.courseProgress.currentStep,totalSteps:n.courseProgress.totalSteps,stepNames:n.courseProgress.stepNames})})]})}function zQ(n){const{disabled:e}=n,[t,r]=ge(null),[i,A]=ge(n.isActive??n.defaultIsActive??!1),[s,o]=ge(!1),[a,c]=ge(n.hovered??!1);function u(){var b;A(!0),o(!1),c(!0),(b=n.onHover)==null||b.call(n,!0)}function l(){}function d(){t&&(clearTimeout(t),r(null))}function h(){i&&r(setTimeout(()=>{var b;A(n.defaultIsActive??!1),c(!1),(b=n.onHover)==null||b.call(n,!1)},400))}function f(){A(!1),o(!0)}function p(){var b;(b=n.onOpen)==null||b.call(n)}const g=n.hovered??(a&&!s),v=n.isActive??(i&&!e&&!s),y=v&&g,B=`round-button ${v?"active":""}`;return C("div",{className:"obi-widget-out-of-plan-container",children:C("div",{className:`obi-widget-out-of-plan ${g?"hover":""} ${v?"active":""}`,onMouseEnter:d,onMouseLeave:h,children:[C("div",{className:B,style:{width:"27px",height:"30px"}}),C(Vt,{className:"obi-widget-popout",open:y,trigger:null,delayMs:400,offset:5,children:[C(Vt.Target,{children:C(vy,{className:v?"button":"",active:v,onClick:p,onMouseEnter:u,onMouseLeave:l,children:v&&C("span",{className:"text",children:"Tutorials"})})}),C(Vt.Content,{children:C("div",{onMouseLeave:h,children:C(XA,{className:"message",onClick:p,children:"Click to see all"})})})]}),C(pn,{className:B,type:"minimize",onClick:f,title:"Minimize widget"})]})})}function XQ(n){return C("div",{className:"obi-widget-out-of-plan-container",children:C("div",{className:"obi-widget-out-of-plan",children:C(Vt,{className:"obi-widget-popout",open:!0,trigger:null,delayMs:100,offset:5,children:[C(Vt.Target,{children:C(vy,{active:!1})}),C(Vt.Content,{children:C(IQ,{onOtherSelect:()=>{var e;(e=n.onOtherSelect)==null||e.call(n)},onReasonSelect:(e,t)=>{var r;(r=n.onCancelReason)==null||r.call(n,e,t)},onClose:()=>{var e;(e=n.onClose)==null||e.call(n)}})})]})})})}function YQ({open:n=!1,children:e,onClose:t}){return C(my,{open:n,onClose:t,children:C("div",{className:"tour content-area",children:n?typeof e=="function"?e():e:null})})}function Hi({title:n="",subtitle:e="",agentName:t="Obi",buttonText:r="Continue",speakingState:i=null,actionDisabled:A=!1,href:s=null,centerVisual:o,description:a,button:c,onAction:u}){const[l,d]=ge(A),[h,f]=ge(!1),[p,g]=ge(i);return Kt(()=>{h||(i==="listening"&&p!=="listening"&&l&&d(!1),i!=="listening"&&!l&&d(!0)),g(i)},[i,l]),Kt(()=>{d(A)},[A]),C("div",{className:"tour-content",children:C("div",{className:"container",children:[C("div",{className:"header",children:[C("h1",{className:"title",children:n}),C("p",{className:"subtitle",children:e})]}),C("div",{className:"visual",style:{background:"var(--obi-color-tint)"},children:o}),C("div",{className:"description",children:a}),C("div",{className:"button-container",children:c||C(s?"a":"button",{className:`action-button ${l?"disabled":""}`,onClick:()=>{l||(d(!0),f(!0),u==null||u())},disabled:l,...s?{href:s,target:"_blank",rel:"noopener noreferrer"}:{type:"button"},children:C("span",{className:"button-text",children:(()=>{switch(i){case"thinking":return"Loading...";case"speaking":return`${t} is speaking`;default:return r}})()})})})]})})}function ZQ({logoUrl:n="",appName:e="App"}){const[t,r]=ge(!1),[i,A]=ge(!1),s=()=>{r(!0)},o=()=>{A(!0),r(!1)},a={container:{display:"block"},logoContainer:{width:"480px",height:"240px",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"},backgroundPattern:{position:"absolute",inset:0,zIndex:0,background:"#F5F5F5",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='277' height='195' viewBox='0 0 277 195' fill='none'%3E%3Cpath opacity='0.4' d='M341.308 0.75C380.279 0.750001 411.872 24.3772 411.872 53.5229C411.872 82.6685 380.279 106.296 341.308 106.296H215.792C176.964 108.335 145.691 130.837 141.128 159.475V256.616C145.912 286.659 180.089 309.954 221.548 309.954H330.872C375.607 309.954 411.872 282.833 411.872 249.377V159.069C411.872 129.923 443.465 106.296 482.436 106.296C521.407 106.296 553 129.923 553 159.069V257.181C553 285.058 524.099 307.88 487.483 309.815C489.264 309.902 491.061 309.954 492.871 309.954C448.137 309.954 411.872 337.076 411.872 370.532C411.872 369.177 411.803 367.834 411.686 366.502C409.098 393.885 378.582 415.5 341.308 415.5H210.118C171.147 415.5 139.554 391.873 139.554 362.727C139.554 362.204 139.565 361.683 139.585 361.163C133.564 332.156 100.023 309.954 59.5488 309.954C61.4544 309.954 63.3441 309.9 65.2169 309.803C28.7434 307.76 -8.57239e-07 284.982 0 257.181V159.069C1.64632e-06 130.901 29.5078 107.89 66.6662 106.377C64.3207 106.224 61.9472 106.141 59.5488 106.141C100.012 106.141 133.54 83.951 139.575 54.9552C139.558 54.4793 139.554 54.0018 139.554 53.5229C139.554 24.3772 171.147 0.75 210.118 0.75H341.308Z' fill='white'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"190px 60px",backgroundSize:"300px 225px"},logoWrapper:{background:"#888888",width:"120px",height:"120px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",zIndex:10,overflow:"hidden"},appLogo:{width:"120px",height:"120px",objectFit:"cover",display:n&&!t&&i?"block":"none"},placeholderLogo:{width:"60px",height:"60px",background:"rgba(255, 255, 255, 0.2)",borderRadius:"4px",display:!n||t||!i?"flex":"none",alignItems:"center",justifyContent:"center",color:"rgba(255, 255, 255, 0.8)",fontSize:"24px",fontWeight:"bold"}};return C("div",{style:a.container,children:C("div",{style:a.logoContainer,children:[C("div",{style:a.backgroundPattern}),C("div",{style:a.logoWrapper,children:[n&&C("img",{style:a.appLogo,src:n,alt:`${e} logo`,onError:s,onLoad:o}),C("div",{style:a.placeholderLogo,children:e.charAt(0).toUpperCase()})]})]})})}function $Q({session:n,speakingState:e,onAction:t}){const r=n.appName?`Navigate to ${n.appName}`:"Navigate to app",i=n.appName?`Open ${n.appName}`:"Open app",A=n.appName?`Enjoy the tutorial in ${n.appName}`:"Enjoy the tutorial";return C(Hi,{title:r,subtitle:"Click the button below to open the app",agentName:n.agentName||"Obi",buttonText:i,speakingState:e,actionDisabled:!0,href:n.url,description:A,centerVisual:C(ZQ,{logoUrl:n.appLogoUrl,appName:n.appName}),onAction:t})}function Py({className:n=""}){return C("svg",{width:"64",height:"64",viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,children:C("path",{d:"M158.803 0L160.352 0.0399439C176.267 0.844061 188.922 13.9634 188.922 30.0311C188.922 46.6174 175.438 60.0653 158.803 60.0656H99.0263L98.9061 60.0722C78.8071 61.4795 62.6269 77.004 60.2644 96.7673L60.241 96.9704V158.93L60.2644 159.13C62.7406 179.86 80.4234 195.934 101.881 195.935H153.842C176.993 195.935 195.759 177.223 195.759 154.14V96.9138L195.799 95.3693C196.606 79.5009 209.766 66.8827 225.881 66.8827C242.515 66.8834 256 80.328 256 96.9138V159.086L255.963 160.564C255.225 175.748 243.176 187.971 228.038 189.038V189.214C207.121 190.591 190.4 207.263 189.019 228.119H188.842C187.738 243.7 174.712 256 158.803 256H96.4491C79.8147 256 66.3309 242.555 66.3302 225.969C66.3302 225.673 66.3349 225.375 66.3436 225.077H66.3503H66.3035C63.3344 206.008 47.4427 190.589 27.8321 189.231L27.8354 189.031C12.2702 187.868 0.000167669 174.905 0 159.086V96.9138L0.0367222 95.4192C0.791087 80.0787 13.0909 67.7634 28.453 66.9293C47.7697 65.3039 63.3522 50.3234 66.2969 31.4658L66.3469 31.1595L66.3369 30.85C66.3301 30.5933 66.3302 30.3238 66.3302 30.0311C66.3309 13.4454 79.8148 0.000165137 96.4491 0H158.803Z",fill:"currentColor"})})}function eR({children:n}){const e={container:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},logo:{display:"flex",width:"120px",height:"120px",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",borderRadius:"8px",color:"#FFFFFF",position:"relative",overflow:"hidden",background:"var(--obi-color-primary)",boxShadow:`
42
+ `},Jl}var h0;function ux(){if(h0)return ln;h0=1;var n=ax(),e=cx(),t=ql();return ln.grammar=t,ln.write=e,ln.parse=n.parse,ln.parseParams=n.parseParams,ln.parseFmtpConfig=n.parseFmtpConfig,ln.parsePayloads=n.parsePayloads,ln.parseRemoteCandidates=n.parseRemoteCandidates,ln.parseImageAttributes=n.parseImageAttributes,ln.parseSimulcastStreamList=n.parseSimulcastStreamList,ln}var mr=ux();function zl(n,e,t){var r,i,A;e===void 0&&(e=50),t===void 0&&(t={});var s=(r=t.isImmediate)!=null&&r,o=(i=t.callback)!=null&&i,a=t.maxWait,c=Date.now(),u=[];function l(){if(a!==void 0){var h=Date.now()-c;if(h+e>=a)return a-h}return e}var d=function(){var h=[].slice.call(arguments),f=this;return new Promise(function(p,g){var v=s&&A===void 0;if(A!==void 0&&clearTimeout(A),A=setTimeout(function(){if(A=void 0,c=Date.now(),!s){var B=n.apply(f,h);o&&o(B),u.forEach(function(b){return(0,b.resolve)(B)}),u=[]}},l()),v){var y=n.apply(f,h);return o&&o(y),p(y)}u.push({resolve:p,reject:g})})};return d.cancel=function(h){A!==void 0&&clearTimeout(A),u.forEach(function(f){return(0,f.reject)(h)}),u=[]},d}const lx=.7,dx=20,Oi={NegotiationStarted:"negotiationStarted",NegotiationComplete:"negotiationComplete",RTPVideoPayloadTypes:"rtpVideoPayloadTypes"};class p0 extends Sn.EventEmitter{get pc(){return this._pc||(this._pc=this.createPC()),this._pc}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r;super(),this.log=ue,this.ddExtID=0,this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate=!1,this.trackBitrates=[],this.remoteStereoMids=[],this.remoteNackMids=[],this.negotiate=zl(i=>S(this,void 0,void 0,function*(){this.emit(Oi.NegotiationStarted);try{yield this.createAndSendOffer()}catch(A){if(i)i(A);else throw A}}),dx),this.close=()=>{this._pc&&(this._pc.close(),this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.ondatachannel=null,this._pc.onnegotiationneeded=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ondatachannel=null,this._pc.ontrack=null,this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc=null)},this.log=Ln((r=t.loggerName)!==null&&r!==void 0?r:cn.PCTransport),this.loggerOptions=t,this.config=e,this._pc=this.createPC()}createPC(){const e=new RTCPeerConnection(this.config);return e.onicecandidate=t=>{var r;t.candidate&&((r=this.onIceCandidate)===null||r===void 0||r.call(this,t.candidate))},e.onicecandidateerror=t=>{var r;(r=this.onIceCandidateError)===null||r===void 0||r.call(this,t)},e.oniceconnectionstatechange=()=>{var t;(t=this.onIceConnectionStateChange)===null||t===void 0||t.call(this,e.iceConnectionState)},e.onsignalingstatechange=()=>{var t;(t=this.onSignalingStatechange)===null||t===void 0||t.call(this,e.signalingState)},e.onconnectionstatechange=()=>{var t;(t=this.onConnectionStateChange)===null||t===void 0||t.call(this,e.connectionState)},e.ondatachannel=t=>{var r;(r=this.onDataChannel)===null||r===void 0||r.call(this,t)},e.ontrack=t=>{var r;(r=this.onTrack)===null||r===void 0||r.call(this,t)},e}get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions).loggerContextCb)===null||t===void 0?void 0:t.call(e))}get isICEConnected(){return this._pc!==null&&(this.pc.iceConnectionState==="connected"||this.pc.iceConnectionState==="completed")}addIceCandidate(e){return S(this,void 0,void 0,function*(){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(e);this.pendingCandidates.push(e)})}setRemoteDescription(e){return S(this,void 0,void 0,function*(){var t;let r;if(e.type==="offer"){let{stereoMids:i,nackMids:A}=hx(e);this.remoteStereoMids=i,this.remoteNackMids=A}else if(e.type==="answer"){const i=mr.parse((t=e.sdp)!==null&&t!==void 0?t:"");i.media.forEach(A=>{A.type==="audio"&&this.trackBitrates.some(s=>{if(!s.transceiver||A.mid!=s.transceiver.mid)return!1;let o=0;if(A.rtp.some(c=>c.codec.toUpperCase()===s.codec.toUpperCase()?(o=c.payload,!0):!1),o===0)return!0;let a=!1;for(const c of A.fmtp)if(c.payload===o){c.config=c.config.split(";").filter(u=>!u.includes("maxaveragebitrate")).join(";"),s.maxbr>0&&(c.config+=";maxaveragebitrate=".concat(s.maxbr*1e3)),a=!0;break}return a||s.maxbr>0&&A.fmtp.push({payload:o,config:"maxaveragebitrate=".concat(s.maxbr*1e3)}),!0})}),r=mr.write(i)}yield this.setMungedSDP(e,r,!0),this.pendingCandidates.forEach(i=>{this.pc.addIceCandidate(i)}),this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate?(this.renegotiate=!1,yield this.createAndSendOffer()):e.type==="answer"&&(this.emit(Oi.NegotiationComplete),e.sdp&&mr.parse(e.sdp).media.forEach(A=>{A.type==="video"&&this.emit(Oi.RTPVideoPayloadTypes,A.rtp)}))})}createAndSendOffer(e){return S(this,void 0,void 0,function*(){var t;if(this.onOffer===void 0)return;if(e!=null&&e.iceRestart&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),this._pc&&this._pc.signalingState==="have-local-offer"){const A=this._pc.remoteDescription;if(e!=null&&e.iceRestart&&A)yield this._pc.setRemoteDescription(A);else{this.renegotiate=!0;return}}else if(!this._pc||this._pc.signalingState==="closed"){this.log.warn("could not createOffer with closed peer connection",this.logContext);return}this.log.debug("starting to negotiate",this.logContext);const r=yield this.pc.createOffer(e);this.log.debug("original offer",Object.assign({sdp:r.sdp},this.logContext));const i=mr.parse((t=r.sdp)!==null&&t!==void 0?t:"");i.media.forEach(A=>{g0(A),A.type==="audio"?f0(A,[],[]):A.type==="video"&&this.trackBitrates.some(s=>{if(!A.msid||!s.cid||!A.msid.includes(s.cid))return!1;let o=0;if(A.rtp.some(c=>c.codec.toUpperCase()===s.codec.toUpperCase()?(o=c.payload,!0):!1),o===0||(KA(s.codec)&&this.ensureVideoDDExtensionForSVC(A,i),s.codec!=="av1"))return!0;const a=Math.round(s.maxbr*lx);for(const c of A.fmtp)if(c.payload===o){c.config.includes("x-google-start-bitrate")||(c.config+=";x-google-start-bitrate=".concat(a));break}return!0})}),yield this.setMungedSDP(r,mr.write(i)),this.onOffer(r)})}createAndSetAnswer(){return S(this,void 0,void 0,function*(){var e;const t=yield this.pc.createAnswer(),r=mr.parse((e=t.sdp)!==null&&e!==void 0?e:"");return r.media.forEach(i=>{g0(i),i.type==="audio"&&f0(i,this.remoteStereoMids,this.remoteNackMids)}),yield this.setMungedSDP(t,mr.write(r)),t})}createDataChannel(e,t){return this.pc.createDataChannel(e,t)}addTransceiver(e,t){return this.pc.addTransceiver(e,t)}addTrack(e){if(!this._pc)throw new lt("PC closed, cannot add track");return this._pc.addTrack(e)}setTrackCodecBitrate(e){this.trackBitrates.push(e)}setConfiguration(e){var t;if(!this._pc)throw new lt("PC closed, cannot configure");return(t=this._pc)===null||t===void 0?void 0:t.setConfiguration(e)}canRemoveTrack(){var e;return!!(!((e=this._pc)===null||e===void 0)&&e.removeTrack)}removeTrack(e){var t;return(t=this._pc)===null||t===void 0?void 0:t.removeTrack(e)}getConnectionState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.connectionState)!==null&&t!==void 0?t:"closed"}getICEConnectionState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.iceConnectionState)!==null&&t!==void 0?t:"closed"}getSignallingState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.signalingState)!==null&&t!==void 0?t:"closed"}getTransceivers(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.getTransceivers())!==null&&t!==void 0?t:[]}getSenders(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.getSenders())!==null&&t!==void 0?t:[]}getLocalDescription(){var e;return(e=this._pc)===null||e===void 0?void 0:e.localDescription}getRemoteDescription(){var e;return(e=this.pc)===null||e===void 0?void 0:e.remoteDescription}getStats(){return this.pc.getStats()}getConnectedAddress(){return S(this,void 0,void 0,function*(){var e;if(!this._pc)return;let t="";const r=new Map,i=new Map;if((yield this._pc.getStats()).forEach(o=>{switch(o.type){case"transport":t=o.selectedCandidatePairId;break;case"candidate-pair":t===""&&o.selected&&(t=o.id),r.set(o.id,o);break;case"remote-candidate":i.set(o.id,"".concat(o.address,":").concat(o.port));break}}),t==="")return;const s=(e=r.get(t))===null||e===void 0?void 0:e.remoteCandidateId;if(s!==void 0)return i.get(s)})}setMungedSDP(e,t,r){return S(this,void 0,void 0,function*(){if(t){const i=e.sdp;e.sdp=t;try{this.log.debug("setting munged ".concat(r?"remote":"local"," description"),this.logContext),r?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e);return}catch(A){this.log.warn("not able to set ".concat(e.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:A,sdp:t})),e.sdp=i}}try{r?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e)}catch(i){let A="unknown error";i instanceof Error?A=i.message:typeof i=="string"&&(A=i);const s={error:A,sdp:e.sdp};throw!r&&this.pc.remoteDescription&&(s.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(e.type),Object.assign(Object.assign({},this.logContext),{fields:s})),new Cl(A)}})}ensureVideoDDExtensionForSVC(e,t){var r,i;if(!((r=e.ext)===null||r===void 0?void 0:r.some(s=>s.uri===Jv))){if(this.ddExtID===0){let s=0;t.media.forEach(o=>{var a;o.type==="video"&&((a=o.ext)===null||a===void 0||a.forEach(c=>{c.value>s&&(s=c.value)}))}),this.ddExtID=s+1}(i=e.ext)===null||i===void 0||i.push({value:this.ddExtID,uri:Jv})}}}function f0(n,e,t){let r=0;n.rtp.some(i=>i.codec==="opus"?(r=i.payload,!0):!1),r>0&&(n.rtcpFb||(n.rtcpFb=[]),t.includes(n.mid)&&!n.rtcpFb.some(i=>i.payload===r&&i.type==="nack")&&n.rtcpFb.push({payload:r,type:"nack"}),e.includes(n.mid)&&n.fmtp.some(i=>i.payload===r?(i.config.includes("stereo=1")||(i.config+=";stereo=1"),!0):!1))}function hx(n){var e;const t=[],r=[],i=mr.parse((e=n.sdp)!==null&&e!==void 0?e:"");let A=0;return i.media.forEach(s=>{var o;s.type==="audio"&&(s.rtp.some(a=>a.codec==="opus"?(A=a.payload,!0):!1),!((o=s.rtcpFb)===null||o===void 0)&&o.some(a=>a.payload===A&&a.type==="nack")&&r.push(s.mid),s.fmtp.some(a=>a.payload===A?(a.config.includes("sprop-stereo=1")&&t.push(s.mid),!0):!1))}),{stereoMids:t,nackMids:r}}function g0(n){if(n.connection){const e=n.connection.ip.indexOf(":")>=0;(n.connection.version===4&&e||n.connection.version===6&&!e)&&(n.connection.ip="0.0.0.0",n.connection.version=4)}}const Xl="vp8",px={audioPreset:El.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:Tl.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:Xl,backupCodec:!0},m0={deviceId:{ideal:"default"},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},v0={deviceId:{ideal:"default"},resolution:HA.h720.resolution},fx={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new AF,disconnectOnPageLeave:!0,webAudioMix:!1},Yl={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};var Ye;(function(n){n[n.NEW=0]="NEW",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED",n[n.FAILED=3]="FAILED",n[n.CLOSING=4]="CLOSING",n[n.CLOSED=5]="CLOSED"})(Ye||(Ye={}));class gx{get needsPublisher(){return this.isPublisherConnectionRequired}get needsSubscriber(){return this.isSubscriberConnectionRequired}get currentState(){return this.state}constructor(e,t,r){var i;this.peerConnectionTimeout=Yl.peerConnectionTimeout,this.log=ue,this.updateState=()=>{var A;const s=this.state,o=this.requiredTransports.map(a=>a.getConnectionState());o.every(a=>a==="connected")?this.state=Ye.CONNECTED:o.some(a=>a==="failed")?this.state=Ye.FAILED:o.some(a=>a==="connecting")?this.state=Ye.CONNECTING:o.every(a=>a==="closed")?this.state=Ye.CLOSED:o.some(a=>a==="closed")?this.state=Ye.CLOSING:o.every(a=>a==="new")&&(this.state=Ye.NEW),s!==this.state&&(this.log.debug("pc state change: from ".concat(Ye[s]," to ").concat(Ye[this.state]),this.logContext),(A=this.onStateChange)===null||A===void 0||A.call(this,this.state,this.publisher.getConnectionState(),this.subscriber.getConnectionState()))},this.log=Ln((i=r.loggerName)!==null&&i!==void 0?i:cn.PCManager),this.loggerOptions=r,this.isPublisherConnectionRequired=!t,this.isSubscriberConnectionRequired=t,this.publisher=new p0(e,r),this.subscriber=new p0(e,r),this.publisher.onConnectionStateChange=this.updateState,this.subscriber.onConnectionStateChange=this.updateState,this.publisher.onIceConnectionStateChange=this.updateState,this.subscriber.onIceConnectionStateChange=this.updateState,this.publisher.onSignalingStatechange=this.updateState,this.subscriber.onSignalingStatechange=this.updateState,this.publisher.onIceCandidate=A=>{var s;(s=this.onIceCandidate)===null||s===void 0||s.call(this,A,an.PUBLISHER)},this.subscriber.onIceCandidate=A=>{var s;(s=this.onIceCandidate)===null||s===void 0||s.call(this,A,an.SUBSCRIBER)},this.subscriber.onDataChannel=A=>{var s;(s=this.onDataChannel)===null||s===void 0||s.call(this,A)},this.subscriber.onTrack=A=>{var s;(s=this.onTrack)===null||s===void 0||s.call(this,A)},this.publisher.onOffer=A=>{var s;(s=this.onPublisherOffer)===null||s===void 0||s.call(this,A)},this.state=Ye.NEW,this.connectionLock=new Mt,this.remoteOfferLock=new Mt}get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions).loggerContextCb)===null||t===void 0?void 0:t.call(e))}requirePublisher(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isPublisherConnectionRequired=e,this.updateState()}requireSubscriber(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isSubscriberConnectionRequired=e,this.updateState()}createAndSendPublisherOffer(e){return this.publisher.createAndSendOffer(e)}setPublisherAnswer(e){return this.publisher.setRemoteDescription(e)}removeTrack(e){return this.publisher.removeTrack(e)}close(){return S(this,void 0,void 0,function*(){if(this.publisher&&this.publisher.getSignallingState()!=="closed"){const e=this.publisher;for(const t of e.getSenders())try{e.canRemoveTrack()&&e.removeTrack(t)}catch(r){this.log.warn("could not removeTrack",Object.assign(Object.assign({},this.logContext),{error:r}))}}yield Promise.all([this.publisher.close(),this.subscriber.close()]),this.updateState()})}triggerIceRestart(){return S(this,void 0,void 0,function*(){this.subscriber.restartingIce=!0,this.needsPublisher&&(yield this.createAndSendPublisherOffer({iceRestart:!0}))})}addIceCandidate(e,t){return S(this,void 0,void 0,function*(){t===an.PUBLISHER?yield this.publisher.addIceCandidate(e):yield this.subscriber.addIceCandidate(e)})}createSubscriberAnswerFromOffer(e){return S(this,void 0,void 0,function*(){this.log.debug("received server offer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type,sdp:e.sdp,signalingState:this.subscriber.getSignallingState().toString()}));const t=yield this.remoteOfferLock.lock();try{return yield this.subscriber.setRemoteDescription(e),yield this.subscriber.createAndSetAnswer()}finally{t()}})}updateConfiguration(e,t){this.publisher.setConfiguration(e),this.subscriber.setConfiguration(e),t&&this.triggerIceRestart()}ensurePCTransportConnection(e,t){return S(this,void 0,void 0,function*(){var r;const i=yield this.connectionLock.lock();try{this.isPublisherConnectionRequired&&this.publisher.getConnectionState()!=="connected"&&this.publisher.getConnectionState()!=="connecting"&&(this.log.debug("negotiation required, start negotiating",this.logContext),this.publisher.negotiate()),yield Promise.all((r=this.requiredTransports)===null||r===void 0?void 0:r.map(A=>this.ensureTransportConnected(A,e,t)))}finally{i()}})}negotiate(e){return S(this,void 0,void 0,function*(){return new Promise((t,r)=>S(this,void 0,void 0,function*(){const i=setTimeout(()=>{r("negotiation timed out")},this.peerConnectionTimeout),A=()=>{clearTimeout(i),r("negotiation aborted")};e.signal.addEventListener("abort",A),this.publisher.once(Oi.NegotiationStarted,()=>{e.signal.aborted||this.publisher.once(Oi.NegotiationComplete,()=>{clearTimeout(i),t()})}),yield this.publisher.negotiate(s=>{clearTimeout(i),r(s)})}))})}addPublisherTransceiver(e,t){return this.publisher.addTransceiver(e,t)}addPublisherTrack(e){return this.publisher.addTrack(e)}createPublisherDataChannel(e,t){return this.publisher.createDataChannel(e,t)}getConnectedAddress(e){return e===an.PUBLISHER?this.publisher.getConnectedAddress():e===an.SUBSCRIBER?this.publisher.getConnectedAddress():this.requiredTransports[0].getConnectedAddress()}get requiredTransports(){const e=[];return this.isPublisherConnectionRequired&&e.push(this.publisher),this.isSubscriberConnectionRequired&&e.push(this.subscriber),e}ensureTransportConnected(e,t){return S(this,arguments,void 0,function(r,i){var A=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.peerConnectionTimeout;return function*(){if(r.getConnectionState()!=="connected")return new Promise((a,c)=>S(A,void 0,void 0,function*(){const u=()=>{this.log.warn("abort transport connection",this.logContext),wt.clearTimeout(l),c(new Fe("room connection has been cancelled",de.Cancelled))};i!=null&&i.signal.aborted&&u(),i==null||i.signal.addEventListener("abort",u);const l=wt.setTimeout(()=>{i==null||i.signal.removeEventListener("abort",u),c(new Fe("could not establish pc connection",de.InternalError))},s);for(;this.state!==Ye.CONNECTED;)if(yield Nt(50),i!=null&&i.signal.aborted){c(new Fe("room connection has been cancelled",de.Cancelled));return}wt.clearTimeout(l),i==null||i.signal.removeEventListener("abort",u),a()}))}()})}}class Ze extends Error{constructor(e,t,r){super(t),this.code=e,this.message=w0(t,Ze.MAX_MESSAGE_BYTES),this.data=r?w0(r,Ze.MAX_DATA_BYTES):void 0}static fromProto(e){return new Ze(e.code,e.message,e.data)}toProto(){return new Pm({code:this.code,message:this.message,data:this.data})}static builtIn(e,t){return new Ze(Ze.ErrorCode[e],Ze.ErrorMessage[e],t)}}Ze.MAX_MESSAGE_BYTES=256,Ze.MAX_DATA_BYTES=15360,Ze.ErrorCode={APPLICATION_ERROR:1500,CONNECTION_TIMEOUT:1501,RESPONSE_TIMEOUT:1502,RECIPIENT_DISCONNECTED:1503,RESPONSE_PAYLOAD_TOO_LARGE:1504,SEND_FAILED:1505,UNSUPPORTED_METHOD:1400,RECIPIENT_NOT_FOUND:1401,REQUEST_PAYLOAD_TOO_LARGE:1402,UNSUPPORTED_SERVER:1403,UNSUPPORTED_VERSION:1404},Ze.ErrorMessage={APPLICATION_ERROR:"Application error in method handler",CONNECTION_TIMEOUT:"Connection timeout",RESPONSE_TIMEOUT:"Response timeout",RECIPIENT_DISCONNECTED:"Recipient disconnected",RESPONSE_PAYLOAD_TOO_LARGE:"Response payload too large",SEND_FAILED:"Failed to send",UNSUPPORTED_METHOD:"Method not supported at destination",RECIPIENT_NOT_FOUND:"Recipient not found",REQUEST_PAYLOAD_TOO_LARGE:"Request payload too large",UNSUPPORTED_SERVER:"RPC not supported by server",UNSUPPORTED_VERSION:"Unsupported RPC version"};const y0=15360;function Zl(n){return new TextEncoder().encode(n).length}function w0(n,e){if(Zl(n)<=e)return n;let t=0,r=n.length;const i=new TextEncoder;for(;t<r;){const A=Math.floor((t+r+1)/2);i.encode(n.slice(0,A)).length<=e?t=A:r=A-1}return n.slice(0,t)}const $l=2e3;function oa(n,e){if(!e)return 0;let t,r;return"bytesReceived"in n?(t=n.bytesReceived,r=e.bytesReceived):"bytesSent"in n&&(t=n.bytesSent,r=e.bytesSent),t===void 0||r===void 0||n.timestamp===void 0||e.timestamp===void 0?0:(t-r)*8*1e3/(n.timestamp-e.timestamp)}const mx=1e3;class b0 extends P{get sender(){return this._sender}set sender(e){this._sender=e}get constraints(){return this._constraints}constructor(e,t,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,A=arguments.length>4?arguments[4]:void 0;super(e,t,A),this.manuallyStopped=!1,this._isUpstreamPaused=!1,this.handleTrackMuteEvent=()=>this.debouncedTrackMuteHandler().catch(()=>this.log.debug("track mute bounce got cancelled by an unmute event",this.logContext)),this.debouncedTrackMuteHandler=zl(()=>S(this,void 0,void 0,function*(){yield this.pauseUpstream()}),5e3),this.handleTrackUnmuteEvent=()=>S(this,void 0,void 0,function*(){this.debouncedTrackMuteHandler.cancel("unmute"),yield this.resumeUpstream()}),this.handleEnded=()=>{this.isInBackground&&(this.reacquireTrack=!0),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),this.emit(L.Ended,this)},this.reacquireTrack=!1,this.providedByUser=i,this.muteLock=new Mt,this.pauseUpstreamLock=new Mt,this.processorLock=new Mt,this.restartLock=new Mt,this.setMediaStreamTrack(e,!0),this._constraints=e.getConstraints(),r&&(this._constraints=r)}get id(){return this._mediaStreamTrack.id}get dimensions(){if(this.kind!==P.Kind.Video)return;const{width:e,height:t}=this._mediaStreamTrack.getSettings();if(e&&t)return{width:e,height:t}}get isUpstreamPaused(){return this._isUpstreamPaused}get isUserProvided(){return this.providedByUser}get mediaStreamTrack(){var e,t;return(t=(e=this.processor)===null||e===void 0?void 0:e.processedTrack)!==null&&t!==void 0?t:this._mediaStreamTrack}get isLocal(){return!0}getSourceTrackSettings(){return this._mediaStreamTrack.getSettings()}setMediaStreamTrack(e,t){return S(this,void 0,void 0,function*(){var r;if(e===this._mediaStreamTrack&&!t)return;this._mediaStreamTrack&&(this.attachedElements.forEach(A=>{xi(this._mediaStreamTrack,A)}),this.debouncedTrackMuteHandler.cancel("new-track"),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent)),this.mediaStream=new MediaStream([e]),e&&(e.addEventListener("ended",this.handleEnded),e.addEventListener("mute",this.handleTrackMuteEvent),e.addEventListener("unmute",this.handleTrackUnmuteEvent),this._constraints=e.getConstraints());let i;if(this.processor&&e){const A=yield this.processorLock.lock();try{if(this.log.debug("restarting processor",this.logContext),this.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");this.processorElement&&(Fi(e,this.processorElement),this.processorElement.muted=!0),yield this.processor.restart({track:e,kind:this.kind,element:this.processorElement}),i=this.processor.processedTrack}finally{A()}}this.sender&&((r=this.sender.transport)===null||r===void 0?void 0:r.state)!=="closed"&&(yield this.sender.replaceTrack(i??e)),!this.providedByUser&&this._mediaStreamTrack!==e&&this._mediaStreamTrack.stop(),this._mediaStreamTrack=e,e&&(this._mediaStreamTrack.enabled=!this.isMuted,yield this.resumeUpstream(),this.attachedElements.forEach(A=>{Fi(i??e,A)}))})}waitForDimensions(){return S(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mx;return function*(){var r;if(e.kind===P.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");((r=un())===null||r===void 0?void 0:r.os)==="iOS"&&(yield Nt(10));const i=Date.now();for(;Date.now()-i<t;){const A=e.dimensions;if(A)return A;yield Nt(50)}throw new Dn("unable to get track dimensions after timeout")}()})}setDeviceId(e){return S(this,void 0,void 0,function*(){return this._constraints.deviceId===e&&this._mediaStreamTrack.getSettings().deviceId===fr(e)||(this._constraints.deviceId=e,this.isMuted)?!0:(yield this.restartTrack(),fr(e)===this._mediaStreamTrack.getSettings().deviceId)})}getDeviceId(){return S(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){if(e.source===P.Source.ScreenShare)return;const{deviceId:r,groupId:i}=e._mediaStreamTrack.getSettings(),A=e.kind===P.Kind.Audio?"audioinput":"videoinput";return t?ft.getInstance().normalizeDeviceId(A,r,i):r}()})}mute(){return S(this,void 0,void 0,function*(){return this.setTrackMuted(!0),this})}unmute(){return S(this,void 0,void 0,function*(){return this.setTrackMuted(!1),this})}replaceTrack(e,t){return S(this,void 0,void 0,function*(){if(!this.sender)throw new Dn("unable to replace an unpublished track");let r,i;return typeof t=="boolean"?r=t:t!==void 0&&(r=t.userProvidedTrack,i=t.stopProcessor),this.providedByUser=r??!0,this.log.debug("replace MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(e),i&&this.processor&&(yield this.stopProcessor()),this})}restart(e){return S(this,void 0,void 0,function*(){this.manuallyStopped=!1;const t=yield this.restartLock.lock();try{e||(e=this._constraints);const{deviceId:r,facingMode:i}=e,A=sF(e,["deviceId","facingMode"]);this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:e}));const s={audio:!1,video:!1};this.kind===P.Kind.Video?s.video=r||i?{deviceId:r,facingMode:i}:!0:s.audio=r?{deviceId:r}:!0,this.attachedElements.forEach(c=>{xi(this.mediaStreamTrack,c)}),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop();const a=(yield navigator.mediaDevices.getUserMedia(s)).getTracks()[0];return yield a.applyConstraints(A),a.addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(a),this._constraints=e,this.emit(L.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),this}finally{t()}})}setTrackMuted(e){this.log.debug("setting ".concat(this.kind," track ").concat(e?"muted":"unmuted"),this.logContext),!(this.isMuted===e&&this._mediaStreamTrack.enabled!==e)&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?L.Muted:L.Unmuted,this))}get needsReAcquisition(){return this._mediaStreamTrack.readyState!=="live"||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return S(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),zv()&&(this.log.debug("visibility changed, is in Background: ".concat(this.isInBackground),this.logContext),!this.isInBackground&&this.needsReAcquisition&&!this.isUserProvided&&!this.isMuted&&(this.log.debug("track needs to be reacquired, restarting ".concat(this.source),this.logContext),yield this.restart(),this.reacquireTrack=!1))})}stop(){var e;this.manuallyStopped=!0,super.stop(),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),(e=this.processor)===null||e===void 0||e.destroy(),this.processor=void 0}pauseUpstream(){return S(this,void 0,void 0,function*(){var e;const t=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!0)return;if(!this.sender){this.log.warn("unable to pause upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!0,this.emit(L.UpstreamPaused,this);const r=un();if((r==null?void 0:r.name)==="Safari"&&Wr(r.version,"12.0")<0)throw new Bl("pauseUpstream is not supported on Safari < 12.");((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(null))}finally{t()}})}resumeUpstream(){return S(this,void 0,void 0,function*(){var e;const t=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!1)return;if(!this.sender){this.log.warn("unable to resume upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!1,this.emit(L.UpstreamResumed,this),((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(this.mediaStreamTrack))}finally{t()}})}getRTCStatsReport(){return S(this,void 0,void 0,function*(){var e;return!((e=this.sender)===null||e===void 0)&&e.getStats?yield this.sender.getStats():void 0})}setProcessor(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var A;const s=yield r.processorLock.lock();try{r.log.debug("setting up processor",r.logContext);const o=document.createElement(r.kind),a={kind:r.kind,track:r._mediaStreamTrack,element:o,audioContext:r.audioContext};if(yield t.init(a),r.log.debug("processor initialized",r.logContext),r.processor&&(yield r.stopProcessor()),r.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");if(Fi(r._mediaStreamTrack,o),o.muted=!0,o.play().catch(c=>r.log.error("failed to play processor element",Object.assign(Object.assign({},r.logContext),{error:c}))),r.processor=t,r.processorElement=o,r.processor.processedTrack){for(const c of r.attachedElements)c!==r.processorElement&&i&&(xi(r._mediaStreamTrack,c),Fi(r.processor.processedTrack,c));yield(A=r.sender)===null||A===void 0?void 0:A.replaceTrack(r.processor.processedTrack)}r.emit(L.TrackProcessorUpdate,r.processor)}finally{s()}}()})}getProcessor(){return this.processor}stopProcessor(){return S(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var r,i;e.processor&&(e.log.debug("stopping processor",e.logContext),(r=e.processor.processedTrack)===null||r===void 0||r.stop(),yield e.processor.destroy(),e.processor=void 0,t||((i=e.processorElement)===null||i===void 0||i.remove(),e.processorElement=void 0),yield e._mediaStreamTrack.applyConstraints(e._constraints),yield e.setMediaStreamTrack(e._mediaStreamTrack,!0),e.emit(L.TrackProcessorUpdate))}()})}}class aa extends b0{get enhancedNoiseCancellation(){return this.isKrispNoiseFilterEnabled}constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0,A=arguments.length>4?arguments[4]:void 0;super(e,P.Kind.Audio,t,r,A),this.stopOnMute=!1,this.isKrispNoiseFilterEnabled=!1,this.monitorSender=()=>S(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let s;try{s=yield this.getSenderStats()}catch(o){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:o}));return}s&&this.prevStats&&(this._currentBitrate=oa(s,this.prevStats)),this.prevStats=s}),this.handleKrispNoiseFilterEnable=()=>{this.isKrispNoiseFilterEnabled=!0,this.log.debug("Krisp noise filter enabled",this.logContext),this.emit(L.AudioTrackFeatureUpdate,this,on.TF_ENHANCED_NOISE_CANCELLATION,!0)},this.handleKrispNoiseFilterDisable=()=>{this.isKrispNoiseFilterEnabled=!1,this.log.debug("Krisp noise filter disabled",this.logContext),this.emit(L.AudioTrackFeatureUpdate,this,on.TF_ENHANCED_NOISE_CANCELLATION,!1)},this.audioContext=i,this.checkForSilence()}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return S(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===P.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{t()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return S(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{if(!this.isMuted)return this.log.debug("Track already unmuted",this.logContext),this;const r=this._constraints.deviceId&&this._mediaStreamTrack.getSettings().deviceId!==fr(this._constraints.deviceId);return this.source===P.Source.Microphone&&(this.stopOnMute||this._mediaStreamTrack.readyState==="ended"||r)&&!this.isUserProvided&&(this.log.debug("reacquiring mic track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this}finally{t()}})}restartTrack(e){return S(this,void 0,void 0,function*(){let t;if(e){const r=Kl({audio:e});typeof r.audio!="boolean"&&(t=r.audio)}yield this.restart(t)})}restart(e){const t=Object.create(null,{restart:{get:()=>super.restart}});return S(this,void 0,void 0,function*(){const r=yield t.restart.call(this,e);return this.checkForSilence(),r})}startMonitor(){Ht()&&(this.monitorInterval||(this.monitorInterval=setInterval(()=>{this.monitorSender()},$l)))}setProcessor(e){return S(this,void 0,void 0,function*(){var t;const r=yield this.processorLock.lock();try{if(!kn()&&!this.audioContext)throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");this.processor&&(yield this.stopProcessor());const i={kind:this.kind,track:this._mediaStreamTrack,audioContext:this.audioContext};this.log.debug("setting up audio processor ".concat(e.name),this.logContext),yield e.init(i),this.processor=e,this.processor.processedTrack&&(yield(t=this.sender)===null||t===void 0?void 0:t.replaceTrack(this.processor.processedTrack),this.processor.processedTrack.addEventListener("enable-lk-krisp-noise-filter",this.handleKrispNoiseFilterEnable),this.processor.processedTrack.addEventListener("disable-lk-krisp-noise-filter",this.handleKrispNoiseFilterDisable)),this.emit(L.TrackProcessorUpdate,this.processor)}finally{r()}})}setAudioContext(e){this.audioContext=e}getSenderStats(){return S(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return;const t=yield this.sender.getStats();let r;return t.forEach(i=>{i.type==="outbound-rtp"&&(r={type:"audio",streamId:i.id,packetsSent:i.packetsSent,packetsLost:i.packetsLost,bytesSent:i.bytesSent,timestamp:i.timestamp,roundTripTime:i.roundTripTime,jitter:i.jitter})}),r})}checkForSilence(){return S(this,void 0,void 0,function*(){const e=yield i0(this);return e&&(this.isMuted||this.log.warn("silence detected on local audio track",this.logContext),this.emit(L.AudioSilenceDetected)),e})}}function vx(n,e,t){switch(n.kind){case"audio":return new aa(n,e,!1,void 0,t);case"video":return new ua(n,e,!1,t);default:throw new Dn("unsupported track type: ".concat(n.kind))}}const yx=Object.values(HA),wx=Object.values(Ul),bx=Object.values(Tl),Bx=[HA.h180,HA.h360],Cx=[Ul.h180,Ul.h360],_x=n=>[{scaleResolutionDownBy:2,fps:n.encoding.maxFramerate}].map(t=>{var r,i;return new Te(Math.floor(n.width/t.scaleResolutionDownBy),Math.floor(n.height/t.scaleResolutionDownBy),Math.max(15e4,Math.floor(n.encoding.maxBitrate/(Math.pow(t.scaleResolutionDownBy,2)*(((r=n.encoding.maxFramerate)!==null&&r!==void 0?r:30)/((i=t.fps)!==null&&i!==void 0?i:30))))),t.fps,n.encoding.priority)}),ed=["q","h","f"];function td(n,e,t,r){var i,A;let s=r==null?void 0:r.videoEncoding;n&&(s=r==null?void 0:r.screenShareEncoding);const o=r==null?void 0:r.simulcast,a=r==null?void 0:r.scalabilityMode,c=r==null?void 0:r.videoCodec;if(!s&&!o&&!a||!e||!t)return[{}];s||(s=kx(n,e,t,c),ue.debug("using video encoding",s));const u=s.maxFramerate,l=new Te(e,t,s.maxBitrate,s.maxFramerate,s.priority);if(a&&KA(c)){const f=new ca(a),p=[];if(f.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(a));const g=un();if(pr()||kn()||(g==null?void 0:g.name)==="Chrome"&&Wr(g==null?void 0:g.version,"113")<0){const v=f.suffix=="h"?2:3;for(let y=0;y<f.spatial;y+=1)p.push({rid:ed[2-y],maxBitrate:s.maxBitrate/Math.pow(v,y),maxFramerate:l.encoding.maxFramerate});p[0].scalabilityMode=a}else p.push({maxBitrate:s.maxBitrate,maxFramerate:l.encoding.maxFramerate,scalabilityMode:a});return l.encoding.priority&&(p[0].priority=l.encoding.priority,p[0].networkPriority=l.encoding.priority),ue.debug("using svc encoding",{encodings:p}),p}if(!o)return[s];let d=[];n?d=(i=C0(r==null?void 0:r.screenShareSimulcastLayers))!==null&&i!==void 0?i:B0(n,l):d=(A=C0(r==null?void 0:r.videoSimulcastLayers))!==null&&A!==void 0?A:B0(n,l);let h;if(d.length>0){const f=d[0];d.length>1&&([,h]=d);const p=Math.max(e,t);if(p>=960&&h)return nd(e,t,[f,h,l],u);if(p>=480)return nd(e,t,[f,l],u)}return nd(e,t,[l])}function Sx(n,e,t){var r,i,A,s;if(!t.backupCodec||t.backupCodec===!0||t.backupCodec.codec===t.videoCodec)return;e!==t.backupCodec.codec&&ue.warn("requested a different codec than specified as backup",{serverRequested:e,backup:t.backupCodec.codec}),t.videoCodec=e,t.videoEncoding=t.backupCodec.encoding;const o=n.mediaStreamTrack.getSettings(),a=(r=o.width)!==null&&r!==void 0?r:(i=n.dimensions)===null||i===void 0?void 0:i.width,c=(A=o.height)!==null&&A!==void 0?A:(s=n.dimensions)===null||s===void 0?void 0:s.height;return n.source===P.Source.ScreenShare&&t.simulcast&&(t.simulcast=!1),td(n.source===P.Source.ScreenShare,a,c,t)}function kx(n,e,t,r){const i=Ex(n,e,t);let{encoding:A}=i[0];const s=Math.max(e,t);for(let o=0;o<i.length;o+=1){const a=i[o];if(A=a.encoding,a.width>=s)break}if(r)switch(r){case"av1":A=Object.assign({},A),A.maxBitrate=A.maxBitrate*.7;break;case"vp9":A=Object.assign({},A),A.maxBitrate=A.maxBitrate*.85;break}return A}function Ex(n,e,t){if(n)return bx;const r=e>t?e/t:t/e;return Math.abs(r-16/9)<Math.abs(r-4/3)?yx:wx}function B0(n,e){if(n)return _x(e);const{width:t,height:r}=e,i=t>r?t/r:r/t;return Math.abs(i-16/9)<Math.abs(i-4/3)?Bx:Cx}function nd(n,e,t,r){const i=[];if(t.forEach((A,s)=>{if(s>=ed.length)return;const o=Math.min(n,e),c={rid:ed[s],scaleResolutionDownBy:Math.max(1,o/Math.min(A.width,A.height)),maxBitrate:A.encoding.maxBitrate},u=r&&A.encoding.maxFramerate?Math.min(r,A.encoding.maxFramerate):A.encoding.maxFramerate;u&&(c.maxFramerate=u);const l=Qi()||s===0;A.encoding.priority&&l&&(c.priority=A.encoding.priority,c.networkPriority=A.encoding.priority),i.push(c)}),kn()&&Yv()==="ios"){let A;i.forEach(o=>{A?o.maxFramerate&&o.maxFramerate>A&&(A=o.maxFramerate):A=o.maxFramerate});let s=!0;i.forEach(o=>{var a;o.maxFramerate!=A&&(s&&(s=!1,ue.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),ue.info('Setting framerate of encoding "'.concat((a=o.rid)!==null&&a!==void 0?a:"",'" to ').concat(A)),o.maxFramerate=A)})}return i}function C0(n){if(n)return n.sort((e,t)=>{const{encoding:r}=e,{encoding:i}=t;return r.maxBitrate>i.maxBitrate?1:r.maxBitrate<i.maxBitrate?-1:r.maxBitrate===i.maxBitrate&&r.maxFramerate&&i.maxFramerate?r.maxFramerate>i.maxFramerate?1:-1:0})}class ca{constructor(e){const t=e.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!t)throw new Error("invalid scalability mode");if(this.spatial=parseInt(t[1]),this.temporal=parseInt(t[2]),t.length>3)switch(t[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=t[3]}}toString(){var e;return"L".concat(this.spatial,"T").concat(this.temporal).concat((e=this.suffix)!==null&&e!==void 0?e:"")}}function Ux(n){return n.source===P.Source.ScreenShare||n.constraints.height&&fr(n.constraints.height)>=1080?"maintain-resolution":"balanced"}const Tx=5e3;class ua extends b0{get sender(){return this._sender}set sender(e){this._sender=e,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0;super(e,P.Kind.Video,t,r,i),this.simulcastCodecs=new Map,this.degradationPreference="balanced",this.monitorSender=()=>S(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let A;try{A=yield this.getSenderStats()}catch(o){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:o}));return}const s=new Map(A.map(o=>[o.rid,o]));if(this.prevStats){let o=0;s.forEach((a,c)=>{var u;const l=(u=this.prevStats)===null||u===void 0?void 0:u.get(c);o+=oa(a,l)}),this._currentBitrate=o}this.prevStats=s}),this.senderLock=new Mt}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(e){var t;if(this.signalClient=e,!Ht())return;const r=(t=this.sender)===null||t===void 0?void 0:t.getParameters();r&&(this.encodings=r.encodings),!this.monitorInterval&&(this.monitorInterval=setInterval(()=>{this.monitorSender()},$l))}stop(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach(e=>{e.mediaStreamTrack.stop()}),super.stop()}pauseUpstream(){const e=Object.create(null,{pauseUpstream:{get:()=>super.pauseUpstream}});return S(this,void 0,void 0,function*(){var t,r,i,A,s;yield e.pauseUpstream.call(this);try{for(var o=!0,a=ur(this.simulcastCodecs.values()),c;c=yield a.next(),t=c.done,!t;o=!0)A=c.value,o=!1,yield(s=A.sender)===null||s===void 0?void 0:s.replaceTrack(null)}catch(u){r={error:u}}finally{try{!o&&!t&&(i=a.return)&&(yield i.call(a))}finally{if(r)throw r.error}}})}resumeUpstream(){const e=Object.create(null,{resumeUpstream:{get:()=>super.resumeUpstream}});return S(this,void 0,void 0,function*(){var t,r,i,A,s;yield e.resumeUpstream.call(this);try{for(var o=!0,a=ur(this.simulcastCodecs.values()),c;c=yield a.next(),t=c.done,!t;o=!0){A=c.value,o=!1;const u=A;yield(s=u.sender)===null||s===void 0?void 0:s.replaceTrack(u.mediaStreamTrack)}}catch(u){r={error:u}}finally{try{!o&&!t&&(i=a.return)&&(yield i.call(a))}finally{if(r)throw r.error}}})}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return S(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===P.Source.Camera&&!this.isUserProvided&&(this.log.debug("stopping camera track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{t()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return S(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.source===P.Source.Camera&&!this.isUserProvided&&(this.log.debug("reacquiring camera track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this):(this.log.debug("Track already unmuted",this.logContext),this)}finally{t()}})}setTrackMuted(e){super.setTrackMuted(e);for(const t of this.simulcastCodecs.values())t.mediaStreamTrack.enabled=!e}getSenderStats(){return S(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return[];const t=[],r=yield this.sender.getStats();return r.forEach(i=>{var A;if(i.type==="outbound-rtp"){const s={type:"video",streamId:i.id,frameHeight:i.frameHeight,frameWidth:i.frameWidth,framesPerSecond:i.framesPerSecond,framesSent:i.framesSent,firCount:i.firCount,pliCount:i.pliCount,nackCount:i.nackCount,packetsSent:i.packetsSent,bytesSent:i.bytesSent,qualityLimitationReason:i.qualityLimitationReason,qualityLimitationDurations:i.qualityLimitationDurations,qualityLimitationResolutionChanges:i.qualityLimitationResolutionChanges,rid:(A=i.rid)!==null&&A!==void 0?A:i.id,retransmittedPacketsSent:i.retransmittedPacketsSent,targetBitrate:i.targetBitrate,timestamp:i.timestamp},o=r.get(i.remoteId);o&&(s.jitter=o.jitter,s.packetsLost=o.packetsLost,s.roundTripTime=o.roundTripTime),t.push(s)}}),t.sort((i,A)=>{var s,o;return((s=A.frameWidth)!==null&&s!==void 0?s:0)-((o=i.frameWidth)!==null&&o!==void 0?o:0)}),t})}setPublishingQuality(e){const t=[];for(let r=Yt.LOW;r<=Yt.HIGH;r+=1)t.push(new ul({quality:r,enabled:r<=e}));this.log.debug("setting publishing quality. max quality ".concat(e),this.logContext),this.setPublishingLayers(t)}restartTrack(e){return S(this,void 0,void 0,function*(){var t,r,i,A,s;let o;if(e){const l=Kl({video:e});typeof l.video!="boolean"&&(o=l.video)}yield this.restart(o);try{for(var a=!0,c=ur(this.simulcastCodecs.values()),u;u=yield c.next(),t=u.done,!t;a=!0){A=u.value,a=!1;const l=A;l.sender&&((s=l.sender.transport)===null||s===void 0?void 0:s.state)!=="closed"&&(l.mediaStreamTrack=this.mediaStreamTrack.clone(),yield l.sender.replaceTrack(l.mediaStreamTrack))}}catch(l){r={error:l}}finally{try{!a&&!t&&(i=c.return)&&(yield i.call(c))}finally{if(r)throw r.error}}})}setProcessor(e){const t=Object.create(null,{setProcessor:{get:()=>super.setProcessor}});return S(this,arguments,void 0,function(r){var i=this;let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var s,o,a,c,u,l;if(yield t.setProcessor.call(i,r,A),!((u=i.processor)===null||u===void 0)&&u.processedTrack)try{for(var d=!0,h=ur(i.simulcastCodecs.values()),f;f=yield h.next(),s=f.done,!s;d=!0)c=f.value,d=!1,yield(l=c.sender)===null||l===void 0?void 0:l.replaceTrack(i.processor.processedTrack)}catch(p){o={error:p}}finally{try{!d&&!s&&(a=h.return)&&(yield a.call(h))}finally{if(o)throw o.error}}}()})}setDegradationPreference(e){return S(this,void 0,void 0,function*(){if(this.degradationPreference=e,this.sender)try{this.log.debug("setting degradationPreference to ".concat(e),this.logContext);const t=this.sender.getParameters();t.degradationPreference=e,this.sender.setParameters(t)}catch(t){this.log.warn("failed to set degradationPreference",Object.assign({error:t},this.logContext))}})}addSimulcastTrack(e,t){if(this.simulcastCodecs.has(e)){this.log.error("".concat(e," already added, skipping adding simulcast codec"),this.logContext);return}const r={codec:e,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:t};return this.simulcastCodecs.set(e,r),r}setSimulcastTrackSender(e,t){const r=this.simulcastCodecs.get(e);r&&(r.sender=t,setTimeout(()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)},Tx))}setPublishingCodecs(e){return S(this,void 0,void 0,function*(){var t,r,i,A,s,o,a;if(this.log.debug("setting publishing codecs",Object.assign(Object.assign({},this.logContext),{codecs:e,currentCodec:this.codec})),!this.codec&&e.length>0)return yield this.setPublishingLayers(e[0].qualities),[];this.subscribedCodecs=e;const c=[];try{for(t=!0,r=ur(e);i=yield r.next(),A=i.done,!A;t=!0){a=i.value,t=!1;const u=a;if(!this.codec||this.codec===u.codec)yield this.setPublishingLayers(u.qualities);else{const l=this.simulcastCodecs.get(u.codec);if(this.log.debug("try setPublishingCodec for ".concat(u.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:l})),!l||!l.sender){for(const d of u.qualities)if(d.enabled){c.push(u.codec);break}}else l.encodings&&(this.log.debug("try setPublishingLayersForSender ".concat(u.codec),this.logContext),yield _0(l.sender,l.encodings,u.qualities,this.senderLock,this.log,this.logContext))}}}catch(u){s={error:u}}finally{try{!t&&!A&&(o=r.return)&&(yield o.call(r))}finally{if(s)throw s.error}}return c})}setPublishingLayers(e){return S(this,void 0,void 0,function*(){this.log.debug("setting publishing layers",Object.assign(Object.assign({},this.logContext),{qualities:e})),!(!this.sender||!this.encodings)&&(yield _0(this.sender,this.encodings,e,this.senderLock,this.log,this.logContext))})}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return S(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),zv()&&this.isInBackground&&this.source===P.Source.Camera&&(this._mediaStreamTrack.enabled=!1)})}}function _0(n,e,t,r,i,A){return S(this,void 0,void 0,function*(){const s=yield r.lock();i.debug("setPublishingLayersForSender",Object.assign(Object.assign({},A),{sender:n,qualities:t,senderEncodings:e}));try{const o=n.getParameters(),{encodings:a}=o;if(!a)return;if(a.length!==e.length){i.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},A),{encodings:a,senderEncodings:e}));return}let c=!1;const u=un();if((u==null?void 0:u.name)==="Chrome"&&Wr(u==null?void 0:u.version,"133")>0&&a[0].scalabilityMode){const d=a[0],h=new ca(d.scalabilityMode);let f=Si.OFF;if(t.forEach(p=>{p.enabled&&(f===Si.OFF||p.quality>f)&&(f=p.quality)}),f===Si.OFF)d.active&&(d.active=!1,c=!0);else if(!d.active||h.spatial!==f+1){c=!0,d.active=!0;const p=new ca(e[0].scalabilityMode);h.spatial=f+1,h.suffix=p.suffix,h.spatial===1&&(h.suffix=void 0),d.scalabilityMode=h.toString(),d.scaleResolutionDownBy=Math.pow(2,2-f),e[0].maxBitrate&&(d.maxBitrate=e[0].maxBitrate/(d.scaleResolutionDownBy*d.scaleResolutionDownBy))}}else a.forEach((d,h)=>{var f;let p=(f=d.rid)!==null&&f!==void 0?f:"";p===""&&(p="q");const g=S0(p),v=t.find(y=>y.quality===g);v&&d.active!==v.enabled&&(c=!0,d.active=v.enabled,i.debug("setting layer ".concat(v.quality," to ").concat(d.active?"enabled":"disabled"),A),Qi()&&(v.enabled?(d.scaleResolutionDownBy=e[h].scaleResolutionDownBy,d.maxBitrate=e[h].maxBitrate,d.maxFrameRate=e[h].maxFrameRate):(d.scaleResolutionDownBy=4,d.maxBitrate=10,d.maxFrameRate=2)))});c&&(o.encodings=a,i.debug("setting encodings",Object.assign(Object.assign({},A),{encodings:o.encodings})),yield n.setParameters(o))}finally{s()}})}function S0(n){switch(n){case"f":return Yt.HIGH;case"h":return Yt.MEDIUM;case"q":return Yt.LOW;default:return Yt.HIGH}}function k0(n,e,t,r){if(!t)return[new Vr({quality:Yt.HIGH,width:n,height:e,bitrate:0,ssrc:0})];if(r){const i=t[0].scalabilityMode,A=new ca(i),s=[],o=A.suffix=="h"?1.5:2,a=A.suffix=="h"?2:3;for(let c=0;c<A.spatial;c+=1)s.push(new Vr({quality:Math.min(Yt.HIGH,A.spatial-1)-c,width:Math.ceil(n/Math.pow(o,c)),height:Math.ceil(e/Math.pow(o,c)),bitrate:t[0].maxBitrate?Math.ceil(t[0].maxBitrate/Math.pow(a,c)):0,ssrc:0}));return s}return t.map(i=>{var A,s,o;const a=(A=i.scaleResolutionDownBy)!==null&&A!==void 0?A:1;let c=S0((s=i.rid)!==null&&s!==void 0?s:"");return new Vr({quality:c,width:Math.ceil(n/a),height:Math.ceil(e/a),bitrate:(o=i.maxBitrate)!==null&&o!==void 0?o:0,ssrc:0})})}const E0="_lossy",U0="_reliable",Ix=2*1e3,rd="leave-reconnect";var dn;(function(n){n[n.New=0]="New",n[n.Connected=1]="Connected",n[n.Disconnected=2]="Disconnected",n[n.Reconnecting=3]="Reconnecting",n[n.Closed=4]="Closed"})(dn||(dn={}));class Fx extends Sn.EventEmitter{get isClosed(){return this._isClosed}get pendingReconnect(){return!!this.reconnectTimeout}constructor(e){var t;super(),this.options=e,this.rtcConfig={},this.peerConnectionTimeout=Yl.peerConnectionTimeout,this.fullReconnectOnNext=!1,this.subscriberPrimary=!1,this.pcState=dn.New,this._isClosed=!0,this.pendingTrackResolvers={},this.reconnectAttempts=0,this.reconnectStart=0,this.attemptingReconnect=!1,this.joinAttempts=0,this.maxJoinAttempts=1,this.shouldFailNext=!1,this.log=ue,this.handleDataChannel=r=>S(this,[r],void 0,function(i){var A=this;let{channel:s}=i;return function*(){if(s){if(s.label===U0)A.reliableDCSub=s;else if(s.label===E0)A.lossyDCSub=s;else return;A.log.debug("on data channel ".concat(s.id,", ").concat(s.label),A.logContext),s.onmessage=A.handleDataMessage}}()}),this.handleDataMessage=r=>S(this,void 0,void 0,function*(){var i,A;const s=yield this.dataProcessLock.lock();try{let o;if(r.data instanceof ArrayBuffer)o=r.data;else if(r.data instanceof Blob)o=yield r.data.arrayBuffer();else{this.log.error("unsupported data type",Object.assign(Object.assign({},this.logContext),{data:r.data}));return}const a=Dt.fromBinary(new Uint8Array(o));((i=a.value)===null||i===void 0?void 0:i.case)==="speaker"?this.emit(D.ActiveSpeakersUpdate,a.value.value.speakers):(((A=a.value)===null||A===void 0?void 0:A.case)==="user"&&Qx(a,a.value.value),this.emit(D.DataPacketReceived,a))}finally{s()}}),this.handleDataError=r=>{const A=r.currentTarget.maxRetransmits===0?"lossy":"reliable";if(r instanceof ErrorEvent&&r.error){const{error:s}=r.error;this.log.error("DataChannel error on ".concat(A,": ").concat(r.message),Object.assign(Object.assign({},this.logContext),{error:s}))}else this.log.error("Unknown DataChannel error on ".concat(A),Object.assign(Object.assign({},this.logContext),{event:r}))},this.handleBufferedAmountLow=r=>{const A=r.currentTarget.maxRetransmits===0?pe.LOSSY:pe.RELIABLE;this.updateAndEmitDCBufferStatus(A)},this.handleDisconnect=(r,i)=>{if(this._isClosed)return;this.log.warn("".concat(r," disconnected"),this.logContext),this.reconnectAttempts===0&&(this.reconnectStart=Date.now());const A=a=>{this.log.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(a,"ms. giving up"),this.logContext),this.emit(D.Disconnected),this.close()},s=Date.now()-this.reconnectStart;let o=this.getNextRetryDelay({elapsedMs:s,retryCount:this.reconnectAttempts});if(o===null){A(s);return}r===rd&&(o=0),this.log.debug("reconnecting in ".concat(o,"ms"),this.logContext),this.clearReconnectTimeout(),this.token&&this.regionUrlProvider&&this.regionUrlProvider.updateToken(this.token),this.reconnectTimeout=wt.setTimeout(()=>this.attemptReconnect(i).finally(()=>this.reconnectTimeout=void 0),o)},this.waitForRestarted=()=>new Promise((r,i)=>{this.pcState===dn.Connected&&r();const A=()=>{this.off(D.Disconnected,s),r()},s=()=>{this.off(D.Restarted,A),i()};this.once(D.Restarted,A),this.once(D.Disconnected,s)}),this.updateAndEmitDCBufferStatus=r=>{const i=this.isBufferStatusLow(r);typeof i<"u"&&i!==this.dcBufferStatus.get(r)&&(this.dcBufferStatus.set(r,i),this.emit(D.DCBufferStatusChanged,i,r))},this.isBufferStatusLow=r=>{const i=this.dataChannelForKind(r);if(i)return i.bufferedAmount<=i.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>{this.client.currentState===Oe.RECONNECTING&&(this.clearReconnectTimeout(),this.attemptReconnect(ki.RR_SIGNAL_DISCONNECTED))},this.log=Ln((t=e.loggerName)!==null&&t!==void 0?t:cn.Engine),this.loggerOptions={loggerName:e.loggerName,loggerContextCb:()=>this.logContext},this.client=new Gl(void 0,this.loggerOptions),this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.registerOnLineListener(),this.closingLock=new Mt,this.dataProcessLock=new Mt,this.dcBufferStatus=new Map([[pe.LOSSY,!0],[pe.RELIABLE,!0]]),this.client.onParticipantUpdate=r=>this.emit(D.ParticipantUpdate,r),this.client.onConnectionQuality=r=>this.emit(D.ConnectionQualityUpdate,r),this.client.onRoomUpdate=r=>this.emit(D.RoomUpdate,r),this.client.onSubscriptionError=r=>this.emit(D.SubscriptionError,r),this.client.onSubscriptionPermissionUpdate=r=>this.emit(D.SubscriptionPermissionUpdate,r),this.client.onSpeakersChanged=r=>this.emit(D.SpeakersChanged,r),this.client.onStreamStateUpdate=r=>this.emit(D.StreamStateChanged,r),this.client.onRequestResponse=r=>this.emit(D.SignalRequestResponse,r)}get logContext(){var e,t,r,i,A,s,o,a;return{room:(t=(e=this.latestJoinResponse)===null||e===void 0?void 0:e.room)===null||t===void 0?void 0:t.name,roomID:(i=(r=this.latestJoinResponse)===null||r===void 0?void 0:r.room)===null||i===void 0?void 0:i.sid,participant:(s=(A=this.latestJoinResponse)===null||A===void 0?void 0:A.participant)===null||s===void 0?void 0:s.identity,pID:(a=(o=this.latestJoinResponse)===null||o===void 0?void 0:o.participant)===null||a===void 0?void 0:a.sid}}join(e,t,r,i){return S(this,void 0,void 0,function*(){this.url=e,this.token=t,this.signalOpts=r,this.maxJoinAttempts=r.maxRetries;try{this.joinAttempts+=1,this.setupSignalClientCallbacks();const A=yield this.client.join(e,t,r,i);return this._isClosed=!1,this.latestJoinResponse=A,this.subscriberPrimary=A.subscriberPrimary,this.pcManager||(yield this.configure(A)),(!this.subscriberPrimary||A.fastPublish)&&this.negotiate(),this.clientConfiguration=A.clientConfiguration,setTimeout(()=>{this.emit(D.SignalConnected)},10),A}catch(A){if(A instanceof Fe&&A.reason===de.ServerUnreachable&&(this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts," of ").concat(this.maxJoinAttempts),this.logContext),this.joinAttempts<this.maxJoinAttempts))return this.join(e,t,r,i);throw A}})}close(){return S(this,void 0,void 0,function*(){const e=yield this.closingLock.lock();if(this.isClosed){e();return}try{this._isClosed=!0,this.joinAttempts=0,this.emit(D.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),yield this.cleanupPeerConnections(),yield this.cleanupClient()}finally{e()}})}cleanupPeerConnections(){return S(this,void 0,void 0,function*(){var e;yield(e=this.pcManager)===null||e===void 0?void 0:e.close(),this.pcManager=void 0;const t=r=>{r&&(r.close(),r.onbufferedamountlow=null,r.onclose=null,r.onclosing=null,r.onerror=null,r.onmessage=null,r.onopen=null)};t(this.lossyDC),t(this.lossyDCSub),t(this.reliableDC),t(this.reliableDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0})}cleanupClient(){return S(this,void 0,void 0,function*(){yield this.client.close(),this.client.resetCallbacks()})}addTrack(e){if(this.pendingTrackResolvers[e.cid])throw new Dn("a track with the same ID has already been published");return new Promise((t,r)=>{const i=setTimeout(()=>{delete this.pendingTrackResolvers[e.cid],r(new Fe("publication of local track timed out, no response from server",de.InternalError))},1e4);this.pendingTrackResolvers[e.cid]={resolve:A=>{clearTimeout(i),t(A)},reject:()=>{clearTimeout(i),r(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(e)})}removeTrack(e){if(e.track&&this.pendingTrackResolvers[e.track.id]){const{reject:t}=this.pendingTrackResolvers[e.track.id];t&&t(),delete this.pendingTrackResolvers[e.track.id]}try{return this.pcManager.removeTrack(e),!0}catch(t){this.log.warn("failed to remove track",Object.assign(Object.assign({},this.logContext),{error:t}))}return!1}updateMuteStatus(e,t){this.client.sendMuteTrack(e,t)}get dataSubscriberReadyState(){var e;return(e=this.reliableDCSub)===null||e===void 0?void 0:e.readyState}getConnectedServerAddress(){return S(this,void 0,void 0,function*(){var e;return(e=this.pcManager)===null||e===void 0?void 0:e.getConnectedAddress()})}setRegionUrlProvider(e){this.regionUrlProvider=e}configure(e){return S(this,void 0,void 0,function*(){var t,r;if(this.pcManager&&this.pcManager.currentState!==Ye.NEW)return;this.participantSid=(t=e.participant)===null||t===void 0?void 0:t.sid;const i=this.makeRTCConfiguration(e);this.pcManager=new gx(i,e.subscriberPrimary,this.loggerOptions),this.emit(D.TransportsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=(A,s)=>{this.client.sendIceCandidate(A,s)},this.pcManager.onPublisherOffer=A=>{this.client.sendOffer(A)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=(A,s,o)=>S(this,void 0,void 0,function*(){if(this.log.debug("primary PC state changed ".concat(A),this.logContext),["closed","disconnected","failed"].includes(s)&&(this.publisherConnectionPromise=void 0),A===Ye.CONNECTED){const u=this.pcState===dn.New;this.pcState=dn.Connected,u&&this.emit(D.Connected,e)}else A===Ye.FAILED&&this.pcState===dn.Connected&&(this.pcState=dn.Disconnected,this.handleDisconnect("peerconnection failed",o==="failed"?ki.RR_SUBSCRIBER_FAILED:ki.RR_PUBLISHER_FAILED));const a=this.client.isDisconnected||this.client.currentState===Oe.RECONNECTING,c=[Ye.FAILED,Ye.CLOSING,Ye.CLOSED].includes(A);a&&c&&!this._isClosed&&this.emit(D.Offline)}),this.pcManager.onTrack=A=>{this.emit(D.MediaTrackAdded,A.track,A.streams[0],A.receiver)},xx((r=e.serverInfo)===null||r===void 0?void 0:r.protocol)||this.createDataChannels()})}setupSignalClientCallbacks(){this.client.onAnswer=e=>S(this,void 0,void 0,function*(){this.pcManager&&(this.log.debug("received server answer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type})),yield this.pcManager.setPublisherAnswer(e))}),this.client.onTrickle=(e,t)=>{this.pcManager&&(this.log.debug("got ICE candidate from peer",Object.assign(Object.assign({},this.logContext),{candidate:e,target:t})),this.pcManager.addIceCandidate(e,t))},this.client.onOffer=e=>S(this,void 0,void 0,function*(){if(!this.pcManager)return;const t=yield this.pcManager.createSubscriberAnswerFromOffer(e);this.client.sendAnswer(t)}),this.client.onLocalTrackPublished=e=>{var t;if(this.log.debug("received trackPublishedResponse",Object.assign(Object.assign({},this.logContext),{cid:e.cid,track:(t=e.track)===null||t===void 0?void 0:t.sid})),!this.pendingTrackResolvers[e.cid]){this.log.error("missing track resolver for ".concat(e.cid),Object.assign(Object.assign({},this.logContext),{cid:e.cid}));return}const{resolve:r}=this.pendingTrackResolvers[e.cid];delete this.pendingTrackResolvers[e.cid],r(e.track)},this.client.onLocalTrackUnpublished=e=>{this.emit(D.LocalTrackUnpublished,e)},this.client.onLocalTrackSubscribed=e=>{this.emit(D.LocalTrackSubscribed,e)},this.client.onTokenRefresh=e=>{this.token=e},this.client.onRemoteMuteChanged=(e,t)=>{this.emit(D.RemoteMute,e,t)},this.client.onSubscribedQualityUpdate=e=>{this.emit(D.SubscribedQualityUpdate,e)},this.client.onRoomMoved=e=>{var t;this.participantSid=(t=e.participant)===null||t===void 0?void 0:t.sid,this.emit(D.RoomMoved,e)},this.client.onClose=()=>{this.handleDisconnect("signal",ki.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=e=>{switch(this.log.debug("client leave request",Object.assign(Object.assign({},this.logContext),{reason:e==null?void 0:e.reason})),e.regions&&this.regionUrlProvider&&(this.log.debug("updating regions",this.logContext),this.regionUrlProvider.setServerReportedRegions(e.regions)),e.action){case Ti.DISCONNECT:this.emit(D.Disconnected,e==null?void 0:e.reason),this.close();break;case Ti.RECONNECT:this.fullReconnectOnNext=!0,this.handleDisconnect(rd);break;case Ti.RESUME:this.handleDisconnect(rd)}}}makeRTCConfiguration(e){var t;const r=Object.assign({},this.rtcConfig);if(!((t=this.signalOpts)===null||t===void 0)&&t.e2eeEnabled&&(this.log.debug("E2EE - setting up transports with insertable streams",this.logContext),r.encodedInsertableStreams=!0),e.iceServers&&!r.iceServers){const i=[];e.iceServers.forEach(A=>{const s={urls:A.urls};A.username&&(s.username=A.username),A.credential&&(s.credential=A.credential),i.push(s)}),r.iceServers=i}return e.clientConfiguration&&e.clientConfiguration.forceRelay===LA.ENABLED&&(r.iceTransportPolicy="relay"),r.sdpSemantics="unified-plan",r.continualGatheringPolicy="gather_continually",r}createDataChannels(){this.pcManager&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.lossyDC=this.pcManager.createPublisherDataChannel(E0,{ordered:!1,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(U0,{ordered:!0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=this.handleBufferedAmountLow,this.reliableDC.onbufferedamountlow=this.handleBufferedAmountLow)}createSender(e,t,r){return S(this,void 0,void 0,function*(){if(Il())return yield this.createTransceiverRTCRtpSender(e,t,r);if(Fl())return this.log.warn("using add-track fallback",this.logContext),yield this.createRTCRtpSender(e.mediaStreamTrack);throw new lt("Required webRTC APIs not supported on this device")})}createSimulcastSender(e,t,r,i){return S(this,void 0,void 0,function*(){if(Il())return this.createSimulcastTransceiverSender(e,t,r,i);if(Fl())return this.log.debug("using add-track fallback",this.logContext),this.createRTCRtpSender(e.mediaStreamTrack);throw new lt("Cannot stream on this device")})}createTransceiverRTCRtpSender(e,t,r){return S(this,void 0,void 0,function*(){if(!this.pcManager)throw new lt("publisher is closed");const i=[];e.mediaStream&&i.push(e.mediaStream),Pi(e)&&(e.codec=t.videoCodec);const A={direction:"sendonly",streams:i};return r&&(A.sendEncodings=r),(yield this.pcManager.addPublisherTransceiver(e.mediaStreamTrack,A)).sender})}createSimulcastTransceiverSender(e,t,r,i){return S(this,void 0,void 0,function*(){if(!this.pcManager)throw new lt("publisher is closed");const A={direction:"sendonly"};i&&(A.sendEncodings=i);const s=yield this.pcManager.addPublisherTransceiver(t.mediaStreamTrack,A);if(r.videoCodec)return e.setSimulcastTrackSender(r.videoCodec,s.sender),s.sender})}createRTCRtpSender(e){return S(this,void 0,void 0,function*(){if(!this.pcManager)throw new lt("publisher is closed");return this.pcManager.addPublisherTrack(e)})}attemptReconnect(e){return S(this,void 0,void 0,function*(){var t,r,i;if(!this._isClosed){if(this.attemptingReconnect){ue.warn("already attempting reconnect, returning early",this.logContext);return}(((t=this.clientConfiguration)===null||t===void 0?void 0:t.resumeConnection)===LA.DISABLED||((i=(r=this.pcManager)===null||r===void 0?void 0:r.currentState)!==null&&i!==void 0?i:Ye.NEW)===Ye.NEW)&&(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?yield this.restartConnection():yield this.resumeConnection(e),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(A){this.reconnectAttempts+=1;let s=!0;A instanceof lt?(this.log.debug("received unrecoverable error",Object.assign(Object.assign({},this.logContext),{error:A})),s=!1):A instanceof Mi||(this.fullReconnectOnNext=!0),s?this.handleDisconnect("reconnect",ki.RR_UNKNOWN):(this.log.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up"),this.logContext),this.emit(D.Disconnected),yield this.close())}finally{this.attemptingReconnect=!1}}})}getNextRetryDelay(e){try{return this.reconnectPolicy.nextRetryDelayInMs(e)}catch(t){this.log.warn("encountered error in reconnect policy",Object.assign(Object.assign({},this.logContext),{error:t}))}return null}restartConnection(e){return S(this,void 0,void 0,function*(){var t,r,i;try{if(!this.url||!this.token)throw new lt("could not reconnect, url or token not saved");this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts),this.logContext),this.emit(D.Restarting),this.client.isDisconnected||(yield this.client.sendLeave()),yield this.cleanupPeerConnections(),yield this.cleanupClient();let A;try{if(!this.signalOpts)throw this.log.warn("attempted connection restart, without signal options present",this.logContext),new Mi;A=yield this.join(e??this.url,this.token,this.signalOpts)}catch(s){throw s instanceof Fe&&s.reason===de.NotAllowed?new lt("could not reconnect, token might be expired"):new Mi}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(this.client.setReconnected(),this.emit(D.SignalRestarted,A),yield this.waitForPCReconnected(),this.client.currentState!==Oe.CONNECTED)throw new Mi("Signal connection got severed during reconnect");(t=this.regionUrlProvider)===null||t===void 0||t.resetAttempts(),this.emit(D.Restarted)}catch(A){const s=yield(r=this.regionUrlProvider)===null||r===void 0?void 0:r.getNextBestRegionUrl();if(s){yield this.restartConnection(s);return}else throw(i=this.regionUrlProvider)===null||i===void 0||i.resetAttempts(),A}})}resumeConnection(e){return S(this,void 0,void 0,function*(){var t;if(!this.url||!this.token)throw new lt("could not reconnect, url or token not saved");if(!this.pcManager)throw new lt("publisher and subscriber connections unset");this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts),this.logContext),this.emit(D.Resuming);let r;try{this.setupSignalClientCallbacks(),r=yield this.client.reconnect(this.url,this.token,this.participantSid,e)}catch(i){let A="";throw i instanceof Error&&(A=i.message,this.log.error(i.message,Object.assign(Object.assign({},this.logContext),{error:i}))),i instanceof Fe&&i.reason===de.NotAllowed?new lt("could not reconnect, token might be expired"):i instanceof Fe&&i.reason===de.LeaveRequest?i:new Mi(A)}if(this.emit(D.SignalResumed),r){const i=this.makeRTCConfiguration(r);this.pcManager.updateConfiguration(i)}else this.log.warn("Did not receive reconnect response",this.logContext);if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(yield this.pcManager.triggerIceRestart(),yield this.waitForPCReconnected(),this.client.currentState!==Oe.CONNECTED)throw new Mi("Signal connection got severed during reconnect");this.client.setReconnected(),((t=this.reliableDC)===null||t===void 0?void 0:t.readyState)==="open"&&this.reliableDC.id===null&&this.createDataChannels(),this.emit(D.Resumed)})}waitForPCInitialConnection(e,t){return S(this,void 0,void 0,function*(){if(!this.pcManager)throw new lt("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(t,e)})}waitForPCReconnected(){return S(this,void 0,void 0,function*(){this.pcState=dn.Reconnecting,this.log.debug("waiting for peer connection to reconnect",this.logContext);try{if(yield Nt(Ix),!this.pcManager)throw new lt("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout),this.pcState=dn.Connected}catch(e){throw this.pcState=dn.Disconnected,new Fe("could not establish PC connection, ".concat(e.message),de.InternalError)}})}publishRpcResponse(e,t,r,i){return S(this,void 0,void 0,function*(){const A=new Dt({destinationIdentities:[e],kind:pe.RELIABLE,value:{case:"rpcResponse",value:new Rm({requestId:t,value:i?{case:"error",value:i.toProto()}:{case:"payload",value:r??""}})}});yield this.sendDataPacket(A,pe.RELIABLE)})}publishRpcAck(e,t){return S(this,void 0,void 0,function*(){const r=new Dt({destinationIdentities:[e],kind:pe.RELIABLE,value:{case:"rpcAck",value:new Qm({requestId:t})}});yield this.sendDataPacket(r,pe.RELIABLE)})}sendDataPacket(e,t){return S(this,void 0,void 0,function*(){const r=e.toBinary();yield this.ensurePublisherConnected(t);const i=this.dataChannelForKind(t);i&&i.send(r),this.updateAndEmitDCBufferStatus(t)})}waitForBufferStatusLow(e){return new Promise((t,r)=>S(this,void 0,void 0,function*(){if(this.isBufferStatusLow(e))t();else{const i=()=>r("Engine closed");for(this.once(D.Closing,i);!this.dcBufferStatus.get(e);)yield Nt(10);this.off(D.Closing,i),t()}}))}ensureDataTransportConnected(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.subscriberPrimary;return function*(){var A;if(!r.pcManager)throw new lt("PC manager is closed");const s=i?r.pcManager.subscriber:r.pcManager.publisher,o=i?"Subscriber":"Publisher";if(!s)throw new Fe("".concat(o," connection not set"),de.InternalError);let a=!1;!i&&!r.dataChannelForKind(t,i)&&(r.createDataChannels(),a=!0),!a&&!i&&!r.pcManager.publisher.isICEConnected&&r.pcManager.publisher.getICEConnectionState()!=="checking"&&(a=!0),a&&r.negotiate();const c=r.dataChannelForKind(t,i);if((c==null?void 0:c.readyState)==="open")return;const u=new Date().getTime()+r.peerConnectionTimeout;for(;new Date().getTime()<u;){if(s.isICEConnected&&((A=r.dataChannelForKind(t,i))===null||A===void 0?void 0:A.readyState)==="open")return;yield Nt(50)}throw new Fe("could not establish ".concat(o," connection, state: ").concat(s.getICEConnectionState()),de.InternalError)}()})}ensurePublisherConnected(e){return S(this,void 0,void 0,function*(){this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(e,!1)),yield this.publisherConnectionPromise})}verifyTransport(){return!(!this.pcManager||this.pcManager.currentState!==Ye.CONNECTED||!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}negotiate(){return S(this,void 0,void 0,function*(){return new Promise((e,t)=>S(this,void 0,void 0,function*(){if(!this.pcManager){t(new Cl("PC manager is closed"));return}this.pcManager.requirePublisher(),this.pcManager.publisher.getTransceivers().length==0&&!this.lossyDC&&!this.reliableDC&&this.createDataChannels();const r=new AbortController,i=()=>{r.abort(),this.log.debug("engine disconnected while negotiation was ongoing",this.logContext),e()};this.isClosed&&t("cannot negotiate on closed engine"),this.on(D.Closing,i),this.pcManager.publisher.once(Oi.RTPVideoPayloadTypes,A=>{const s=new Map;A.forEach(o=>{const a=o.codec.toLowerCase();HF(a)&&s.set(o.payload,a)}),this.emit(D.RTPVideoMapUpdate,s)});try{yield this.pcManager.negotiate(r),e()}catch(A){A instanceof Cl&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",ki.RR_UNKNOWN),t(A)}finally{this.off(D.Closing,i)}}))})}dataChannelForKind(e,t){if(t){if(e===pe.LOSSY)return this.lossyDCSub;if(e===pe.RELIABLE)return this.reliableDCSub}else{if(e===pe.LOSSY)return this.lossyDC;if(e===pe.RELIABLE)return this.reliableDC}}sendSyncState(e,t){var r,i;if(!this.pcManager){this.log.warn("sync state cannot be sent without peer connection setup",this.logContext);return}const A=this.pcManager.subscriber.getLocalDescription(),s=this.pcManager.subscriber.getRemoteDescription(),o=(i=(r=this.signalOpts)===null||r===void 0?void 0:r.autoSubscribe)!==null&&i!==void 0?i:!0,a=new Array,c=new Array;e.forEach(u=>{u.isDesired!==o&&a.push(u.trackSid),u.isEnabled||c.push(u.trackSid)}),this.client.sendSyncState(new Zm({answer:A?sa({sdp:A.sdp,type:A.type}):void 0,offer:s?sa({sdp:s.sdp,type:s.type}):void 0,subscription:new Go({trackSids:a,subscribe:!o,participantTracks:[]}),publishTracks:XF(t),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:c}))}failNext(){this.shouldFailNext=!0}dataChannelsInfo(){const e=[],t=(r,i)=>{(r==null?void 0:r.id)!==void 0&&r.id!==null&&e.push(new $m({label:r.label,id:r.id,target:i}))};return t(this.dataChannelForKind(pe.LOSSY),an.PUBLISHER),t(this.dataChannelForKind(pe.RELIABLE),an.PUBLISHER),t(this.dataChannelForKind(pe.LOSSY,!0),an.SUBSCRIBER),t(this.dataChannelForKind(pe.RELIABLE,!0),an.SUBSCRIBER),e}clearReconnectTimeout(){this.reconnectTimeout&&wt.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){Ht()&&window.addEventListener("online",this.handleBrowserOnLine)}deregisterOnLineListener(){Ht()&&window.removeEventListener("online",this.handleBrowserOnLine)}}class Mi extends Error{}function xx(n){return n!==void 0&&n>13}function Qx(n,e){const t=n.participantIdentity?n.participantIdentity:e.participantIdentity;n.participantIdentity=t,e.participantIdentity=t;const r=n.destinationIdentities.length!==0?n.destinationIdentities:e.destinationIdentities;n.destinationIdentities=r,e.destinationIdentities=r}class id{constructor(e,t){this.lastUpdateAt=0,this.settingsCacheTime=3e3,this.attemptedRegions=[],this.serverUrl=new URL(e),this.token=t}updateToken(e){this.token=e}isCloud(){return Ql(this.serverUrl)}getServerUrl(){return this.serverUrl}getNextBestRegionUrl(e){return S(this,void 0,void 0,function*(){if(!this.isCloud())throw Error("region availability is only supported for LiveKit Cloud domains");(!this.regionSettings||Date.now()-this.lastUpdateAt>this.settingsCacheTime)&&(this.regionSettings=yield this.fetchRegionSettings(e));const t=this.regionSettings.regions.filter(r=>!this.attemptedRegions.find(i=>i.url===r.url));if(t.length>0){const r=t[0];return this.attemptedRegions.push(r),ue.debug("next region: ".concat(r.region)),r.url}else return null})}resetAttempts(){this.attemptedRegions=[]}fetchRegionSettings(e){return S(this,void 0,void 0,function*(){const t=yield fetch("".concat(Rx(this.serverUrl),"/regions"),{headers:{authorization:"Bearer ".concat(this.token)},signal:e});if(t.ok){const r=yield t.json();return this.lastUpdateAt=Date.now(),r}else throw new Fe("Could not fetch region settings: ".concat(t.statusText),t.status===401?de.NotAllowed:de.InternalError,t.status)})}setServerReportedRegions(e){this.regionSettings=e,this.lastUpdateAt=Date.now()}}function Rx(n){return"".concat(n.protocol.replace("ws","http"),"//").concat(n.host,"/settings")}class T0{get info(){return this._info}constructor(e,t,r){this.reader=t,this.totalByteSize=r,this._info=e,this.bytesReceived=0}}class Px extends T0{handleChunkReceived(e){var t;this.bytesReceived+=e.content.byteLength;const r=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(t=this.onProgress)===null||t===void 0||t.call(this,r)}[Symbol.asyncIterator](){const e=this.reader.getReader();return{next:()=>S(this,void 0,void 0,function*(){try{const{done:t,value:r}=yield e.read();return t?{done:!0,value:void 0}:(this.handleChunkReceived(r),{done:!1,value:r.content})}catch{return{done:!0,value:void 0}}}),return(){return S(this,void 0,void 0,function*(){return e.releaseLock(),{done:!0,value:void 0}})}}}readAll(){return S(this,void 0,void 0,function*(){var e,t,r,i;let A=new Set;try{for(var s=!0,o=ur(this),a;a=yield o.next(),e=a.done,!e;s=!0){i=a.value,s=!1;const c=i;A.add(c)}}catch(c){t={error:c}}finally{try{!s&&!e&&(r=o.return)&&(yield r.call(o))}finally{if(t)throw t.error}}return Array.from(A)})}}class Ox extends T0{constructor(e,t,r){super(e,t,r),this.receivedChunks=new Map}handleChunkReceived(e){var t;const r=ia(e.chunkIndex),i=this.receivedChunks.get(r);if(i&&i.version>e.version)return;this.receivedChunks.set(r,e),this.bytesReceived+=e.content.byteLength;const A=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(t=this.onProgress)===null||t===void 0||t.call(this,A)}[Symbol.asyncIterator](){const e=this.reader.getReader(),t=new TextDecoder;return{next:()=>S(this,void 0,void 0,function*(){try{const{done:r,value:i}=yield e.read();return r?{done:!0,value:void 0}:(this.handleChunkReceived(i),{done:!1,value:t.decode(i.content)})}catch{return{done:!0,value:void 0}}}),return(){return S(this,void 0,void 0,function*(){return e.releaseLock(),{done:!0,value:void 0}})}}}readAll(){return S(this,void 0,void 0,function*(){var e,t,r,i;let A="";try{for(var s=!0,o=ur(this),a;a=yield o.next(),e=a.done,!e;s=!0)i=a.value,s=!1,A+=i}catch(c){t={error:c}}finally{try{!s&&!e&&(r=o.return)&&(yield r.call(o))}finally{if(t)throw t.error}}return A})}}class I0{constructor(e,t,r){this.writableStream=e,this.defaultWriter=e.getWriter(),this.onClose=r,this.info=t}write(e){return this.defaultWriter.write(e)}close(){return S(this,void 0,void 0,function*(){var e;yield this.defaultWriter.close(),this.defaultWriter.releaseLock(),(e=this.onClose)===null||e===void 0||e.call(this)})}}class Mx extends I0{}class Lx extends I0{}class F0 extends P{constructor(e,t,r,i,A){super(e,r,A),this.sid=t,this.receiver=i}get isLocal(){return!1}setMuted(e){this.isMuted!==e&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?L.Muted:L.Unmuted,this))}setMediaStream(e){this.mediaStream=e;const t=r=>{r.track===this._mediaStreamTrack&&(e.removeEventListener("removetrack",t),this.receiver&&"playoutDelayHint"in this.receiver&&(this.receiver.playoutDelayHint=void 0),this.receiver=void 0,this._currentBitrate=0,this.emit(L.Ended,this))};e.addEventListener("removetrack",t)}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}getRTCStatsReport(){return S(this,void 0,void 0,function*(){var e;return!((e=this.receiver)===null||e===void 0)&&e.getStats?yield this.receiver.getStats():void 0})}setPlayoutDelay(e){this.receiver?"playoutDelayHint"in this.receiver?this.receiver.playoutDelayHint=e:this.log.warn("Playout delay not supported in this browser"):this.log.warn("Cannot set playout delay, track already ended")}getPlayoutDelay(){if(this.receiver){if("playoutDelayHint"in this.receiver)return this.receiver.playoutDelayHint;this.log.warn("Playout delay not supported in this browser")}else this.log.warn("Cannot get playout delay, track already ended");return 0}startMonitor(){this.monitorInterval||(this.monitorInterval=setInterval(()=>this.monitorReceiver(),$l)),YF()&&this.registerTimeSyncUpdate()}registerTimeSyncUpdate(){const e=()=>{var t;this.timeSyncHandle=requestAnimationFrame(()=>e());const r=(t=this.receiver)===null||t===void 0?void 0:t.getSynchronizationSources()[0];if(r){const{timestamp:i,rtpTimestamp:A}=r;A&&this.rtpTimestamp!==A&&(this.emit(L.TimeSyncUpdate,{timestamp:i,rtpTimestamp:A}),this.rtpTimestamp=A)}};e()}}class Dx extends F0{constructor(e,t,r,i,A,s){super(e,t,P.Kind.Audio,r,s),this.monitorReceiver=()=>S(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const o=yield this.getReceiverStats();o&&this.prevStats&&this.receiver&&(this._currentBitrate=oa(o,this.prevStats)),this.prevStats=o}),this.audioContext=i,this.webAudioPluginNodes=[],A&&(this.sinkId=A.deviceId)}setVolume(e){var t;for(const r of this.attachedElements)this.audioContext?(t=this.gainNode)===null||t===void 0||t.gain.setTargetAtTime(e,0,.1):r.volume=e;kn()&&this._mediaStreamTrack._setVolume(e),this.elementVolume=e}getVolume(){if(this.elementVolume)return this.elementVolume;if(kn())return 1;let e=0;return this.attachedElements.forEach(t=>{t.volume>e&&(e=t.volume)}),e}setSinkId(e){return S(this,void 0,void 0,function*(){this.sinkId=e,yield Promise.all(this.attachedElements.map(t=>{if(xl(t))return t.setSinkId(e)}))})}attach(e){const t=this.attachedElements.length===0;return e?super.attach(e):e=super.attach(),this.sinkId&&xl(e)&&e.setSinkId(this.sinkId).catch(r=>{this.log.error("Failed to set sink id on remote audio track",r,this.logContext)}),this.audioContext&&t&&(this.log.debug("using audio context mapping",this.logContext),this.connectWebAudio(this.audioContext,e),e.volume=0,e.muted=!0),this.elementVolume&&this.setVolume(this.elementVolume),e}detach(e){let t;return e?(t=super.detach(e),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(t=super.detach(),this.disconnectWebAudio()),t}setAudioContext(e){this.audioContext=e,e&&this.attachedElements.length>0?this.connectWebAudio(e,this.attachedElements[0]):e||this.disconnectWebAudio()}setWebAudioPlugins(e){this.webAudioPluginNodes=e,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}connectWebAudio(e,t){this.disconnectWebAudio(),this.sourceNode=e.createMediaStreamSource(t.srcObject);let r=this.sourceNode;this.webAudioPluginNodes.forEach(i=>{r.connect(i),r=i}),this.gainNode=e.createGain(),r.connect(this.gainNode),this.gainNode.connect(e.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),e.state!=="running"&&e.resume().then(()=>{e.state!=="running"&&this.emit(L.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))}).catch(i=>{this.emit(L.AudioPlaybackFailed,i)})}disconnectWebAudio(){var e,t;(e=this.gainNode)===null||e===void 0||e.disconnect(),(t=this.sourceNode)===null||t===void 0||t.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}getReceiverStats(){return S(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let t;return e.forEach(r=>{r.type==="inbound-rtp"&&(t={type:"audio",streamId:r.id,timestamp:r.timestamp,jitter:r.jitter,bytesReceived:r.bytesReceived,concealedSamples:r.concealedSamples,concealmentEvents:r.concealmentEvents,silentConcealedSamples:r.silentConcealedSamples,silentConcealmentEvents:r.silentConcealmentEvents,totalAudioEnergy:r.totalAudioEnergy,totalSamplesDuration:r.totalSamplesDuration})}),t})}}const Ad=100;class Nx extends F0{constructor(e,t,r,i,A){super(e,t,P.Kind.Video,r,A),this.elementInfos=[],this.monitorReceiver=()=>S(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const s=yield this.getReceiverStats();s&&this.prevStats&&this.receiver&&(this._currentBitrate=oa(s,this.prevStats)),this.prevStats=s}),this.debouncedHandleResize=zl(()=>{this.updateDimensions()},Ad),this.adaptiveStreamSettings=i}get isAdaptiveStream(){return this.adaptiveStreamSettings!==void 0}get mediaStreamTrack(){return this._mediaStreamTrack}setMuted(e){super.setMuted(e),this.attachedElements.forEach(t=>{e?xi(this._mediaStreamTrack,t):Fi(this._mediaStreamTrack,t)})}attach(e){if(e?super.attach(e):e=super.attach(),this.adaptiveStreamSettings&&this.elementInfos.find(t=>t.element===e)===void 0){const t=new Hx(e);this.observeElementInfo(t)}return e}observeElementInfo(e){this.adaptiveStreamSettings&&this.elementInfos.find(t=>t===e)===void 0?(e.handleResize=()=>{this.debouncedHandleResize()},e.handleVisibilityChanged=()=>{this.updateVisibility()},this.elementInfos.push(e),e.observe(),this.debouncedHandleResize(),this.updateVisibility()):this.log.warn("visibility resize observer not triggered",this.logContext)}stopObservingElementInfo(e){if(!this.isAdaptiveStream){this.log.warn("stopObservingElementInfo ignored",this.logContext);return}const t=this.elementInfos.filter(r=>r===e);for(const r of t)r.stopObserving();this.elementInfos=this.elementInfos.filter(r=>r!==e),this.updateVisibility(),this.debouncedHandleResize()}detach(e){let t=[];if(e)return this.stopObservingElement(e),super.detach(e);t=super.detach();for(const r of t)this.stopObservingElement(r);return t}getDecoderImplementation(){var e;return(e=this.prevStats)===null||e===void 0?void 0:e.decoderImplementation}getReceiverStats(){return S(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let t,r="",i=new Map;return e.forEach(A=>{A.type==="inbound-rtp"?(r=A.codecId,t={type:"video",streamId:A.id,framesDecoded:A.framesDecoded,framesDropped:A.framesDropped,framesReceived:A.framesReceived,packetsReceived:A.packetsReceived,packetsLost:A.packetsLost,frameWidth:A.frameWidth,frameHeight:A.frameHeight,pliCount:A.pliCount,firCount:A.firCount,nackCount:A.nackCount,jitter:A.jitter,timestamp:A.timestamp,bytesReceived:A.bytesReceived,decoderImplementation:A.decoderImplementation}):A.type==="codec"&&i.set(A.id,A)}),t&&r!==""&&i.get(r)&&(t.mimeType=i.get(r).mimeType),t})}stopObservingElement(e){const t=this.elementInfos.filter(r=>r.element===e);for(const r of t)this.stopObservingElementInfo(r)}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return S(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),this.isAdaptiveStream&&this.updateVisibility()})}updateVisibility(){var e,t;const r=this.elementInfos.reduce((o,a)=>Math.max(o,a.visibilityChangedAt||0),0),i=!((t=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pauseVideoInBackground)!==null&&t!==void 0)||t?this.isInBackground:!1,A=this.elementInfos.some(o=>o.pictureInPicture),s=this.elementInfos.some(o=>o.visible)&&!i||A;if(this.lastVisible!==s){if(!s&&Date.now()-r<Ad){wt.setTimeout(()=>{this.updateVisibility()},Ad);return}this.lastVisible=s,this.emit(L.VisibilityChanged,s,this)}}updateDimensions(){var e,t;let r=0,i=0;const A=this.getPixelDensity();for(const s of this.elementInfos){const o=s.width()*A,a=s.height()*A;o+a>r+i&&(r=o,i=a)}((e=this.lastDimensions)===null||e===void 0?void 0:e.width)===r&&((t=this.lastDimensions)===null||t===void 0?void 0:t.height)===i||(this.lastDimensions={width:r,height:i},this.emit(L.VideoDimensionsChanged,this.lastDimensions,this))}getPixelDensity(){var e;const t=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pixelDensity;return t==="screen"?Zv():t||(Zv()>2?2:1)}}class Hx{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(e,t){this.onVisibilityChanged=r=>{var i;const{target:A,isIntersecting:s}=r;A===this.element&&(this.isIntersecting=s,this.isPiP=jA(this.element),this.visibilityChangedAt=Date.now(),(i=this.handleVisibilityChanged)===null||i===void 0||i.call(this))},this.onEnterPiP=()=>{var r,i,A;(i=(r=window.documentPictureInPicture)===null||r===void 0?void 0:r.window)===null||i===void 0||i.addEventListener("pagehide",this.onLeavePiP),this.isPiP=jA(this.element),(A=this.handleVisibilityChanged)===null||A===void 0||A.call(this)},this.onLeavePiP=()=>{var r;this.isPiP=jA(this.element),(r=this.handleVisibilityChanged)===null||r===void 0||r.call(this)},this.element=e,this.isIntersecting=t??sd(e),this.isPiP=Ht()&&jA(e),this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){var e,t,r;this.isIntersecting=sd(this.element),this.isPiP=jA(this.element),this.element.handleResize=()=>{var i;(i=this.handleResize)===null||i===void 0||i.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,e0().observe(this.element),$v().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP),(e=window.documentPictureInPicture)===null||e===void 0||e.addEventListener("enter",this.onEnterPiP),(r=(t=window.documentPictureInPicture)===null||t===void 0?void 0:t.window)===null||r===void 0||r.addEventListener("pagehide",this.onLeavePiP)}stopObserving(){var e,t,r,i,A;(e=e0())===null||e===void 0||e.unobserve(this.element),(t=$v())===null||t===void 0||t.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP),(r=window.documentPictureInPicture)===null||r===void 0||r.removeEventListener("enter",this.onEnterPiP),(A=(i=window.documentPictureInPicture)===null||i===void 0?void 0:i.window)===null||A===void 0||A.removeEventListener("pagehide",this.onLeavePiP)}}function jA(n){var e,t;return document.pictureInPictureElement===n?!0:!((e=window.documentPictureInPicture)===null||e===void 0)&&e.window?sd(n,(t=window.documentPictureInPicture)===null||t===void 0?void 0:t.window):!1}function sd(n,e){const t=e||window;let r=n.offsetTop,i=n.offsetLeft;const A=n.offsetWidth,s=n.offsetHeight,{hidden:o}=n,{display:a}=getComputedStyle(n);for(;n.offsetParent;)n=n.offsetParent,r+=n.offsetTop,i+=n.offsetLeft;return r<t.pageYOffset+t.innerHeight&&i<t.pageXOffset+t.innerWidth&&r+s>t.pageYOffset&&i+A>t.pageXOffset&&!o&&a!=="none"}class Hn extends Sn.EventEmitter{constructor(e,t,r,i){var A;super(),this.metadataMuted=!1,this.encryption=Wt.NONE,this.log=ue,this.handleMuted=()=>{this.emit(L.Muted)},this.handleUnmuted=()=>{this.emit(L.Unmuted)},this.log=Ln((A=i==null?void 0:i.loggerName)!==null&&A!==void 0?A:cn.Publication),this.loggerContextCb=this.loggerContextCb,this.setMaxListeners(100),this.kind=e,this.trackSid=t,this.trackName=r,this.source=P.Source.Unknown}setTrack(e){this.track&&(this.track.off(L.Muted,this.handleMuted),this.track.off(L.Unmuted,this.handleUnmuted)),this.track=e,e&&(e.on(L.Muted,this.handleMuted),e.on(L.Unmuted,this.handleUnmuted))}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),_e(this))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return this.track!==void 0}get isEncrypted(){return this.encryption!==Wt.NONE}get audioTrack(){if(Nn(this.track))return this.track}get videoTrack(){if(Pi(this.track))return this.track}updateInfo(e){this.trackSid=e.sid,this.trackName=e.name,this.source=P.sourceFromProto(e.source),this.mimeType=e.mimeType,this.kind===P.Kind.Video&&e.width>0&&(this.dimensions={width:e.width,height:e.height},this.simulcasted=e.simulcast),this.encryption=e.encryption,this.trackInfo=e,this.log.debug("update publication info",Object.assign(Object.assign({},this.logContext),{info:e}))}}(function(n){(function(e){e.Desired="desired",e.Subscribed="subscribed",e.Unsubscribed="unsubscribed"})(n.SubscriptionStatus||(n.SubscriptionStatus={})),function(e){e.Allowed="allowed",e.NotAllowed="not_allowed"}(n.PermissionStatus||(n.PermissionStatus={}))})(Hn||(Hn={}));class od extends Hn{get isUpstreamPaused(){var e;return(e=this.track)===null||e===void 0?void 0:e.isUpstreamPaused}constructor(e,t,r,i){super(e,t.sid,t.name,i),this.track=void 0,this.handleTrackEnded=()=>{this.emit(L.Ended)},this.updateInfo(t),this.setTrack(r)}setTrack(e){this.track&&this.track.off(L.Ended,this.handleTrackEnded),super.setTrack(e),e&&e.on(L.Ended,this.handleTrackEnded)}get isMuted(){return this.track?this.track.isMuted:super.isMuted}get audioTrack(){return super.audioTrack}get videoTrack(){return super.videoTrack}get isLocal(){return!0}mute(){return S(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.mute()})}unmute(){return S(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.unmute()})}pauseUpstream(){return S(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.pauseUpstream()})}resumeUpstream(){return S(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.resumeUpstream()})}getTrackFeatures(){var e;if(Nn(this.track)){const t=this.track.getSourceTrackSettings(),r=new Set;return t.autoGainControl&&r.add(on.TF_AUTO_GAIN_CONTROL),t.echoCancellation&&r.add(on.TF_ECHO_CANCELLATION),t.noiseSuppression&&r.add(on.TF_NOISE_SUPPRESSION),t.channelCount&&t.channelCount>1&&r.add(on.TF_STEREO),!((e=this.options)===null||e===void 0)&&e.dtx||r.add(on.TF_NO_DTX),this.track.enhancedNoiseCancellation&&r.add(on.TF_ENHANCED_NOISE_CANCELLATION),Array.from(r.values())}else return[]}}function la(n,e){return S(this,void 0,void 0,function*(){n??(n={});let t=!1;const{audioProcessor:r,videoProcessor:i,optionsWithoutProcessor:A}=o0(n);let s=A.audio,o=A.video;if(r&&typeof A.audio=="object"&&(A.audio.processor=r),i&&typeof A.video=="object"&&(A.video.processor=i),n.audio&&typeof A.audio=="object"&&typeof A.audio.deviceId=="string"){const l=A.audio.deviceId;A.audio.deviceId={exact:l},t=!0,s=Object.assign(Object.assign({},A.audio),{deviceId:{ideal:l}})}if(A.video&&typeof A.video=="object"&&typeof A.video.deviceId=="string"){const l=A.video.deviceId;A.video.deviceId={exact:l},t=!0,o=Object.assign(Object.assign({},A.video),{deviceId:{ideal:l}})}(A.audio===!0||typeof A.audio=="object"&&!A.audio.deviceId)&&(A.audio={deviceId:"default"}),A.video===!0?A.video={deviceId:"default"}:typeof A.video=="object"&&!A.video.deviceId&&(A.video.deviceId="default");const a=r0(A,m0,v0),c=Kl(a),u=navigator.mediaDevices.getUserMedia(c);A.audio&&(ft.userMediaPromiseMap.set("audioinput",u),u.catch(()=>ft.userMediaPromiseMap.delete("audioinput"))),A.video&&(ft.userMediaPromiseMap.set("videoinput",u),u.catch(()=>ft.userMediaPromiseMap.delete("videoinput")));try{const l=yield u;return yield Promise.all(l.getTracks().map(d=>S(this,void 0,void 0,function*(){const h=d.kind==="audio";let f=h?a.audio:a.video;(typeof f=="boolean"||!f)&&(f={});let p;const g=h?c.audio:c.video;typeof g!="boolean"&&(p=g);const v=d.getSettings().deviceId;p!=null&&p.deviceId&&fr(p.deviceId)!==v?p.deviceId=v:p||(p={deviceId:v});const y=vx(d,p,e);return y.kind===P.Kind.Video?y.source=P.Source.Camera:y.kind===P.Kind.Audio&&(y.source=P.Source.Microphone),y.mediaStream=l,Nn(y)&&r?yield y.setProcessor(r):Pi(y)&&i&&(yield y.setProcessor(i)),y})))}catch(l){if(!t)throw l;return la(Object.assign(Object.assign({},n),{audio:s,video:o}),e)}})}function Kx(n){return S(this,void 0,void 0,function*(){return(yield la({audio:!1,video:n??!0}))[0]})}function Vx(n){return S(this,void 0,void 0,function*(){return(yield la({audio:n??!0,video:!1}))[0]})}var vr;(function(n){n.Excellent="excellent",n.Good="good",n.Poor="poor",n.Lost="lost",n.Unknown="unknown"})(vr||(vr={}));function Gx(n){switch(n){case MA.EXCELLENT:return vr.Excellent;case MA.GOOD:return vr.Good;case MA.POOR:return vr.Poor;case MA.LOST:return vr.Lost;default:return vr.Unknown}}class x0 extends Sn.EventEmitter{get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions)===null||e===void 0?void 0:e.loggerContextCb)===null||t===void 0?void 0:t.call(e))}get isEncrypted(){return this.trackPublications.size>0&&Array.from(this.trackPublications.values()).every(e=>e.isEncrypted)}get isAgent(){var e;return((e=this.permissions)===null||e===void 0?void 0:e.agent)||this.kind===Vo.AGENT}get isActive(){var e;return((e=this.participantInfo)===null||e===void 0?void 0:e.state)===Ei.ACTIVE}get kind(){return this._kind}get attributes(){return Object.freeze(Object.assign({},this._attributes))}constructor(e,t,r,i,A,s){let o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:Vo.STANDARD;var a;super(),this.audioLevel=0,this.isSpeaking=!1,this._connectionQuality=vr.Unknown,this.log=ue,this.log=Ln((a=s==null?void 0:s.loggerName)!==null&&a!==void 0?a:cn.Participant),this.loggerOptions=s,this.setMaxListeners(100),this.sid=e,this.identity=t,this.name=r,this.metadata=i,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this._kind=o,this._attributes=A??{}}getTrackPublications(){return Array.from(this.trackPublications.values())}getTrackPublication(e){for(const[,t]of this.trackPublications)if(t.source===e)return t}getTrackPublicationByName(e){for(const[,t]of this.trackPublications)if(t.trackName===e)return t}waitUntilActive(){return this.isActive?Promise.resolve():this.activeFuture?this.activeFuture.promise:(this.activeFuture=new Ml,this.once(K.Active,()=>{var e,t;(t=(e=this.activeFuture)===null||e===void 0?void 0:e.resolve)===null||t===void 0||t.call(e),this.activeFuture=void 0}),this.activeFuture.promise)}get connectionQuality(){return this._connectionQuality}get isCameraEnabled(){var e;const t=this.getTrackPublication(P.Source.Camera);return!(!((e=t==null?void 0:t.isMuted)!==null&&e!==void 0)||e)}get isMicrophoneEnabled(){var e;const t=this.getTrackPublication(P.Source.Microphone);return!(!((e=t==null?void 0:t.isMuted)!==null&&e!==void 0)||e)}get isScreenShareEnabled(){return!!this.getTrackPublication(P.Source.ScreenShare)}get isLocal(){return!1}get joinedAt(){return this.participantInfo?new Date(Number.parseInt(this.participantInfo.joinedAt.toString())*1e3):new Date}updateInfo(e){var t;return this.participantInfo&&this.participantInfo.sid===e.sid&&this.participantInfo.version>e.version?!1:(this.identity=e.identity,this.sid=e.sid,this._setName(e.name),this._setMetadata(e.metadata),this._setAttributes(e.attributes),e.state===Ei.ACTIVE&&((t=this.participantInfo)===null||t===void 0?void 0:t.state)!==Ei.ACTIVE&&this.emit(K.Active),e.permission&&this.setPermissions(e.permission),this.participantInfo=e,!0)}_setMetadata(e){const t=this.metadata!==e,r=this.metadata;this.metadata=e,t&&this.emit(K.ParticipantMetadataChanged,r)}_setName(e){const t=this.name!==e;this.name=e,t&&this.emit(K.ParticipantNameChanged,e)}_setAttributes(e){const t=ZF(this.attributes,e);this._attributes=e,Object.keys(t).length>0&&this.emit(K.AttributesChanged,t)}setPermissions(e){var t,r,i,A,s,o;const a=this.permissions,c=e.canPublish!==((t=this.permissions)===null||t===void 0?void 0:t.canPublish)||e.canSubscribe!==((r=this.permissions)===null||r===void 0?void 0:r.canSubscribe)||e.canPublishData!==((i=this.permissions)===null||i===void 0?void 0:i.canPublishData)||e.hidden!==((A=this.permissions)===null||A===void 0?void 0:A.hidden)||e.recorder!==((s=this.permissions)===null||s===void 0?void 0:s.recorder)||e.canPublishSources.length!==this.permissions.canPublishSources.length||e.canPublishSources.some((u,l)=>{var d;return u!==((d=this.permissions)===null||d===void 0?void 0:d.canPublishSources[l])})||e.canSubscribeMetrics!==((o=this.permissions)===null||o===void 0?void 0:o.canSubscribeMetrics);return this.permissions=e,c&&this.emit(K.ParticipantPermissionsChanged,a),c}setIsSpeaking(e){e!==this.isSpeaking&&(this.isSpeaking=e,e&&(this.lastSpokeAt=new Date),this.emit(K.IsSpeakingChanged,e))}setConnectionQuality(e){const t=this._connectionQuality;this._connectionQuality=Gx(e),t!==this._connectionQuality&&this.emit(K.ConnectionQualityChanged,this._connectionQuality)}setDisconnected(){var e,t;this.activeFuture&&((t=(e=this.activeFuture).reject)===null||t===void 0||t.call(e,new Error("Participant disconnected")),this.activeFuture=void 0)}setAudioContext(e){this.audioContext=e,this.audioTrackPublications.forEach(t=>Nn(t.track)&&t.track.setAudioContext(e))}addTrackPublication(e){e.on(L.Muted,()=>{this.emit(K.TrackMuted,e)}),e.on(L.Unmuted,()=>{this.emit(K.TrackUnmuted,e)});const t=e;switch(t.track&&(t.track.sid=e.trackSid),this.trackPublications.set(e.trackSid,e),e.kind){case P.Kind.Audio:this.audioTrackPublications.set(e.trackSid,e);break;case P.Kind.Video:this.videoTrackPublications.set(e.trackSid,e);break}}}function jx(n){var e,t,r;if(!n.participantSid&&!n.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new Xm({participantIdentity:(e=n.participantIdentity)!==null&&e!==void 0?e:"",participantSid:(t=n.participantSid)!==null&&t!==void 0?t:"",allTracks:(r=n.allowAll)!==null&&r!==void 0?r:!1,trackSids:n.allowedTrackSids||[]})}const Q0=15e3;class Wx extends x0{constructor(e,t,r,i,A){super(e,t,void 0,void 0,void 0,{loggerName:i.loggerName,loggerContextCb:()=>this.engine.logContext}),this.pendingPublishing=new Set,this.pendingPublishPromises=new Map,this.participantTrackPermissions=[],this.allParticipantsAllowedToSubscribe=!0,this.encryptionType=Wt.NONE,this.enabledPublishVideoCodecs=[],this.pendingAcks=new Map,this.pendingResponses=new Map,this.handleReconnecting=()=>{this.reconnectFuture||(this.reconnectFuture=new Ml)},this.handleReconnected=()=>{var s,o;(o=(s=this.reconnectFuture)===null||s===void 0?void 0:s.resolve)===null||o===void 0||o.call(s),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleDisconnected=()=>{var s,o;this.reconnectFuture&&(this.reconnectFuture.promise.catch(a=>this.log.warn(a.message,this.logContext)),(o=(s=this.reconnectFuture)===null||s===void 0?void 0:s.reject)===null||o===void 0||o.call(s,"Got disconnected during reconnection attempt"),this.reconnectFuture=void 0)},this.handleSignalRequestResponse=s=>{const{requestId:o,reason:a,message:c}=s,u=this.pendingSignalRequests.get(o);u&&(a!==ll.OK&&u.reject(new jv(c,a)),this.pendingSignalRequests.delete(o))},this.handleDataPacket=s=>{switch(s.value.case){case"rpcResponse":let o=s.value.value,a=null,c=null;o.value.case==="payload"?a=o.value.value:o.value.case==="error"&&(c=Ze.fromProto(o.value.value)),this.handleIncomingRpcResponse(o.requestId,a,c);break;case"rpcAck":let u=s.value.value;this.handleIncomingRpcAck(u.requestId);break}},this.updateTrackSubscriptionPermissions=()=>{this.log.debug("updating track subscription permissions",Object.assign(Object.assign({},this.logContext),{allParticipantsAllowed:this.allParticipantsAllowedToSubscribe,participantTrackPermissions:this.participantTrackPermissions})),this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe,this.participantTrackPermissions.map(s=>jx(s)))},this.onTrackUnmuted=s=>{this.onTrackMuted(s,s.isUpstreamPaused)},this.onTrackMuted=(s,o)=>{if(o===void 0&&(o=!0),!s.sid){this.log.error("could not update mute status for unpublished track",Object.assign(Object.assign({},this.logContext),_e(s)));return}this.engine.updateMuteStatus(s.sid,o)},this.onTrackUpstreamPaused=s=>{this.log.debug("upstream paused",Object.assign(Object.assign({},this.logContext),_e(s))),this.onTrackMuted(s,!0)},this.onTrackUpstreamResumed=s=>{this.log.debug("upstream resumed",Object.assign(Object.assign({},this.logContext),_e(s))),this.onTrackMuted(s,s.isMuted)},this.onTrackFeatureUpdate=s=>{const o=this.audioTrackPublications.get(s.sid);if(!o){this.log.warn("Could not update local audio track settings, missing publication for track ".concat(s.sid),this.logContext);return}this.engine.client.sendUpdateLocalAudioTrack(o.trackSid,o.getTrackFeatures())},this.handleSubscribedQualityUpdate=s=>S(this,void 0,void 0,function*(){var o,a,c,u,l,d;if(!(!((l=this.roomOptions)===null||l===void 0)&&l.dynacast))return;const h=this.videoTrackPublications.get(s.trackSid);if(!h){this.log.warn("received subscribed quality update for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:s.trackSid}));return}if(s.subscribedCodecs.length>0){if(!h.videoTrack)return;const v=yield h.videoTrack.setPublishingCodecs(s.subscribedCodecs);try{for(var f=!0,p=ur(v),g;g=yield p.next(),o=g.done,!o;f=!0){u=g.value,f=!1;const y=u;IF(y)&&(this.log.debug("publish ".concat(y," for ").concat(h.videoTrack.sid),Object.assign(Object.assign({},this.logContext),_e(h))),yield this.publishAdditionalCodecForTrack(h.videoTrack,y,h.options))}}catch(y){a={error:y}}finally{try{!f&&!o&&(c=p.return)&&(yield c.call(p))}finally{if(a)throw a.error}}}else s.subscribedQualities.length>0&&(yield(d=h.videoTrack)===null||d===void 0?void 0:d.setPublishingLayers(s.subscribedQualities))}),this.handleLocalTrackUnpublished=s=>{const o=this.trackPublications.get(s.trackSid);if(!o){this.log.warn("received unpublished event for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:s.trackSid}));return}this.unpublishTrack(o.track)},this.handleTrackEnded=s=>S(this,void 0,void 0,function*(){if(s.source===P.Source.ScreenShare||s.source===P.Source.ScreenShareAudio)this.log.debug("unpublishing local track due to TrackEnded",Object.assign(Object.assign({},this.logContext),_e(s))),this.unpublishTrack(s);else if(s.isUserProvided)yield s.mute();else if(Jr(s)||gr(s))try{if(Ht())try{const o=yield navigator==null?void 0:navigator.permissions.query({name:s.source===P.Source.Camera?"camera":"microphone"});if(o&&o.state==="denied")throw this.log.warn("user has revoked access to ".concat(s.source),Object.assign(Object.assign({},this.logContext),_e(s))),o.onchange=()=>{o.state!=="denied"&&(s.isMuted||s.restartTrack(),o.onchange=null)},new Error("GetUserMedia Permission denied")}catch{}s.isMuted||(this.log.debug("track ended, attempting to use a different device",Object.assign(Object.assign({},this.logContext),_e(s))),Jr(s)?yield s.restartTrack({deviceId:"default"}):yield s.restartTrack())}catch{this.log.warn("could not restart track, muting instead",Object.assign(Object.assign({},this.logContext),_e(s))),yield s.mute()}}),this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this.engine=r,this.roomOptions=i,this.setupEngine(r),this.activeDeviceMap=new Map([["audioinput","default"],["videoinput","default"],["audiooutput","default"]]),this.pendingSignalRequests=new Map,this.rpcHandlers=A}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}get isE2EEEnabled(){return this.encryptionType!==Wt.NONE}getTrackPublication(e){const t=super.getTrackPublication(e);if(t)return t}getTrackPublicationByName(e){const t=super.getTrackPublicationByName(e);if(t)return t}setupEngine(e){this.engine=e,this.engine.on(D.RemoteMute,(t,r)=>{const i=this.trackPublications.get(t);!i||!i.track||(r?i.mute():i.unmute())}),this.engine.on(D.Connected,this.handleReconnected).on(D.SignalRestarted,this.handleReconnected).on(D.SignalResumed,this.handleReconnected).on(D.Restarting,this.handleReconnecting).on(D.Resuming,this.handleReconnecting).on(D.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(D.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(D.Disconnected,this.handleDisconnected).on(D.SignalRequestResponse,this.handleSignalRequestResponse).on(D.DataPacketReceived,this.handleDataPacket)}setMetadata(e){return S(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({metadata:e})})}setName(e){return S(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({name:e})})}setAttributes(e){return S(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({attributes:e})})}requestMetadataUpdate(e){return S(this,arguments,void 0,function(t){var r=this;let{metadata:i,name:A,attributes:s}=t;return function*(){return new Promise((o,a)=>S(r,void 0,void 0,function*(){var c,u;try{let l=!1;const d=yield this.engine.client.sendUpdateLocalMetadata((c=i??this.metadata)!==null&&c!==void 0?c:"",(u=A??this.name)!==null&&u!==void 0?u:"",s),h=performance.now();for(this.pendingSignalRequests.set(d,{resolve:o,reject:f=>{a(f),l=!0},values:{name:A,metadata:i,attributes:s}});performance.now()-h<5e3&&!l;){if((!A||this.name===A)&&(!i||this.metadata===i)&&(!s||Object.entries(s).every(f=>{let[p,g]=f;return this.attributes[p]===g||g===""&&!this.attributes[p]}))){this.pendingSignalRequests.delete(d),o();return}yield Nt(50)}a(new jv("Request to update local metadata timed out","TimeoutError"))}catch(l){l instanceof Error&&a(l)}}))}()})}setCameraEnabled(e,t,r){return this.setTrackEnabled(P.Source.Camera,e,t,r)}setMicrophoneEnabled(e,t,r){return this.setTrackEnabled(P.Source.Microphone,e,t,r)}setScreenShareEnabled(e,t,r){return this.setTrackEnabled(P.Source.ScreenShare,e,t,r)}setPermissions(e){const t=this.permissions,r=super.setPermissions(e);return r&&t&&this.emit(K.ParticipantPermissionsChanged,t),r}setE2EEEnabled(e){return S(this,void 0,void 0,function*(){this.encryptionType=e?Wt.GCM:Wt.NONE,yield this.republishAllTracks(void 0,!1)})}setTrackEnabled(e,t,r,i){return S(this,void 0,void 0,function*(){var A,s;this.log.debug("setTrackEnabled",Object.assign(Object.assign({},this.logContext),{source:e,enabled:t})),this.republishPromise&&(yield this.republishPromise);let o=this.getTrackPublication(e);if(t)if(o)yield o.unmute();else{let a;if(this.pendingPublishing.has(e)){const c=yield this.waitForPendingPublicationOfSource(e);return c||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e})),yield c==null?void 0:c.unmute(),c}this.pendingPublishing.add(e);try{switch(e){case P.Source.Camera:a=yield this.createTracks({video:(A=r)!==null&&A!==void 0?A:!0});break;case P.Source.Microphone:a=yield this.createTracks({audio:(s=r)!==null&&s!==void 0?s:!0});break;case P.Source.ScreenShare:a=yield this.createScreenTracks(Object.assign({},r));break;default:throw new Dn(e)}}catch(c){throw a==null||a.forEach(u=>{u.stop()}),c instanceof Error&&this.emit(K.MediaDevicesError,c),this.pendingPublishing.delete(e),c}try{const c=[];for(const l of a)this.log.info("publishing track",Object.assign(Object.assign({},this.logContext),_e(l))),c.push(this.publishTrack(l,i));[o]=yield Promise.all(c)}catch(c){throw a==null||a.forEach(u=>{u.stop()}),c}finally{this.pendingPublishing.delete(e)}}else if(!(o!=null&&o.track)&&this.pendingPublishing.has(e)&&(o=yield this.waitForPendingPublicationOfSource(e),o||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e}))),o&&o.track)if(e===P.Source.ScreenShare){o=yield this.unpublishTrack(o.track);const a=this.getTrackPublication(P.Source.ScreenShareAudio);a&&a.track&&this.unpublishTrack(a.track)}else yield o.mute();return o})}enableCameraAndMicrophone(){return S(this,void 0,void 0,function*(){if(!(this.pendingPublishing.has(P.Source.Camera)||this.pendingPublishing.has(P.Source.Microphone))){this.pendingPublishing.add(P.Source.Camera),this.pendingPublishing.add(P.Source.Microphone);try{const e=yield this.createTracks({audio:!0,video:!0});yield Promise.all(e.map(t=>this.publishTrack(t)))}finally{this.pendingPublishing.delete(P.Source.Camera),this.pendingPublishing.delete(P.Source.Microphone)}}})}createTracks(e){return S(this,void 0,void 0,function*(){var t,r;e??(e={});const i=r0(e,(t=this.roomOptions)===null||t===void 0?void 0:t.audioCaptureDefaults,(r=this.roomOptions)===null||r===void 0?void 0:r.videoCaptureDefaults);try{return(yield la(i,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext})).map(o=>(Nn(o)&&(this.microphoneError=void 0,o.setAudioContext(this.audioContext),o.source=P.Source.Microphone,this.emit(K.AudioStreamAcquired)),Pi(o)&&(this.cameraError=void 0,o.source=P.Source.Camera),o))}catch(A){throw A instanceof Error&&(e.audio&&(this.microphoneError=A),e.video&&(this.cameraError=A)),A}})}createScreenTracks(e){return S(this,void 0,void 0,function*(){if(e===void 0&&(e={}),navigator.mediaDevices.getDisplayMedia===void 0)throw new Bl("getDisplayMedia not supported");e.resolution===void 0&&!OF()&&(e.resolution=Tl.h1080fps30.resolution);const t=zF(e),r=yield navigator.mediaDevices.getDisplayMedia(t),i=r.getVideoTracks();if(i.length===0)throw new Dn("no video track found");const A=new ua(i[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});A.source=P.Source.ScreenShare,e.contentHint&&(A.mediaStreamTrack.contentHint=e.contentHint);const s=[A];if(r.getAudioTracks().length>0){this.emit(K.AudioStreamAcquired);const o=new aa(r.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});o.source=P.Source.ScreenShareAudio,s.push(o)}return s})}publishTrack(e,t){return S(this,void 0,void 0,function*(){return this.publishOrRepublishTrack(e,t)})}publishOrRepublishTrack(e,t){return S(this,arguments,void 0,function(r,i){var A=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function*(){var o,a,c,u;Jr(r)&&r.setAudioContext(A.audioContext),yield(o=A.reconnectFuture)===null||o===void 0?void 0:o.promise,A.republishPromise&&!s&&(yield A.republishPromise),Ri(r)&&A.pendingPublishPromises.has(r)&&(yield A.pendingPublishPromises.get(r));let l;if(r instanceof MediaStreamTrack)l=r.getConstraints();else{l=r.constraints;let v;switch(r.source){case P.Source.Microphone:v="audioinput";break;case P.Source.Camera:v="videoinput"}v&&A.activeDeviceMap.has(v)&&(l=Object.assign(Object.assign({},l),{deviceId:A.activeDeviceMap.get(v)}))}if(r instanceof MediaStreamTrack)switch(r.kind){case"audio":r=new aa(r,l,!0,A.audioContext,{loggerName:A.roomOptions.loggerName,loggerContextCb:()=>A.logContext});break;case"video":r=new ua(r,l,!0,{loggerName:A.roomOptions.loggerName,loggerContextCb:()=>A.logContext});break;default:throw new Dn("unsupported MediaStreamTrack kind ".concat(r.kind))}else r.updateLoggerOptions({loggerName:A.roomOptions.loggerName,loggerContextCb:()=>A.logContext});let d;if(A.trackPublications.forEach(v=>{v.track&&v.track===r&&(d=v)}),d)return A.log.warn("track has already been published, skipping",Object.assign(Object.assign({},A.logContext),_e(d))),d;const h="channelCount"in r.mediaStreamTrack.getSettings()&&r.mediaStreamTrack.getSettings().channelCount===2||r.mediaStreamTrack.getConstraints().channelCount===2,f=(a=i==null?void 0:i.forceStereo)!==null&&a!==void 0?a:h;f&&(i||(i={}),i.dtx===void 0&&A.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",Object.assign(Object.assign({},A.logContext),_e(r))),i.red===void 0&&A.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),(c=i.dtx)!==null&&c!==void 0||(i.dtx=!1),(u=i.red)!==null&&u!==void 0||(i.red=!1));const p=Object.assign(Object.assign({},A.roomOptions.publishDefaults),i);!MF()&&A.roomOptions.e2ee&&(A.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2",Object.assign({},A.logContext)),p.simulcast=!1),p.source&&(r.source=p.source);const g=new Promise((v,y)=>S(A,void 0,void 0,function*(){try{if(this.engine.client.currentState!==Oe.CONNECTED){this.log.debug("deferring track publication until signal is connected",Object.assign(Object.assign({},this.logContext),{track:_e(r)}));const B=()=>S(this,void 0,void 0,function*(){try{const b=yield this.publish(r,p,f);v(b)}catch(b){y(b)}});setTimeout(()=>{this.engine.off(D.SignalConnected,B),y(new _l("publishing rejected as engine not connected within timeout",408))},15e3),this.engine.once(D.SignalConnected,B),this.engine.on(D.Closing,()=>{this.engine.off(D.SignalConnected,B),y(new _l("publishing rejected as engine closed",499))})}else try{const B=yield this.publish(r,p,f);v(B)}catch(B){y(B)}}catch(B){y(B)}}));A.pendingPublishPromises.set(r,g);try{return yield g}catch(v){throw v}finally{A.pendingPublishPromises.delete(r)}}()})}hasPermissionsToPublish(e){if(!this.permissions)return this.log.warn("no permissions present for publishing track",Object.assign(Object.assign({},this.logContext),_e(e))),!1;const{canPublish:t,canPublishSources:r}=this.permissions;return t&&(r.length===0||r.map(i=>$F(i)).includes(e.source))?!0:(this.log.warn("insufficient permissions to publish",Object.assign(Object.assign({},this.logContext),_e(e))),!1)}publish(e,t,r){return S(this,void 0,void 0,function*(){var i,A,s,o,a,c,u,l,d,h;if(!this.hasPermissionsToPublish(e))throw new _l("failed to publish track, insufficient permissions",403);Array.from(this.trackPublications.values()).find(w=>Ri(e)&&w.source===e.source)&&e.source!==P.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(e.source),Object.assign(Object.assign({},this.logContext),_e(e))),t.stopMicTrackOnMute&&Nn(e)&&(e.stopOnMute=!0),e.source===P.Source.ScreenShare&&Qi()&&(t.simulcast=!1),t.videoCodec==="av1"&&!QF()&&(t.videoCodec=void 0),t.videoCodec==="vp9"&&!RF()&&(t.videoCodec=void 0),t.videoCodec===void 0&&(t.videoCodec=Xl),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some(w=>t.videoCodec===Aa(w.mime))||(t.videoCodec=Aa(this.enabledPublishVideoCodecs[0].mime)));const p=t.videoCodec;e.on(L.Muted,this.onTrackMuted),e.on(L.Unmuted,this.onTrackUnmuted),e.on(L.Ended,this.handleTrackEnded),e.on(L.UpstreamPaused,this.onTrackUpstreamPaused),e.on(L.UpstreamResumed,this.onTrackUpstreamResumed),e.on(L.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate);const g=new sl({cid:e.mediaStreamTrack.id,name:t.name,type:P.kindToProto(e.kind),muted:e.isMuted,source:P.sourceToProto(e.source),disableDtx:!(!((i=t.dtx)!==null&&i!==void 0)||i),encryption:this.encryptionType,stereo:r,disableRed:this.isE2EEEnabled||!(!((A=t.red)!==null&&A!==void 0)||A),stream:t==null?void 0:t.stream,backupCodecPolicy:t==null?void 0:t.backupCodecPolicy});let v;if(e.kind===P.Kind.Video){let w={width:0,height:0};try{w=yield e.waitForDimensions()}catch{const k=(o=(s=this.roomOptions.videoCaptureDefaults)===null||s===void 0?void 0:s.resolution)!==null&&o!==void 0?o:HA.h720.resolution;w={width:k.width,height:k.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign(Object.assign({},this.logContext),_e(e)),{dims:w}))}g.width=w.width,g.height=w.height,gr(e)&&(KA(p)&&(e.source===P.Source.ScreenShare&&(t.scalabilityMode="L1T3","contentHint"in e.mediaStreamTrack&&(e.mediaStreamTrack.contentHint="motion",this.log.info("forcing contentHint to motion for screenshare with SVC codecs",Object.assign(Object.assign({},this.logContext),_e(e))))),t.scalabilityMode=(a=t.scalabilityMode)!==null&&a!==void 0?a:"L3T3_KEY"),g.simulcastCodecs=[new Al({codec:p,cid:e.mediaStreamTrack.id})],t.backupCodec===!0&&(t.backupCodec={codec:Xl}),t.backupCodec&&p!==t.backupCodec.codec&&g.encryption===Wt.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),g.simulcastCodecs.push(new Al({codec:t.backupCodec.codec,cid:""})))),v=td(e.source===P.Source.ScreenShare,g.width,g.height,t),g.layers=k0(g.width,g.height,v,KA(t.videoCodec))}else e.kind===P.Kind.Audio&&(v=[{maxBitrate:(c=t.audioPreset)===null||c===void 0?void 0:c.maxBitrate,priority:(l=(u=t.audioPreset)===null||u===void 0?void 0:u.priority)!==null&&l!==void 0?l:"high",networkPriority:(h=(d=t.audioPreset)===null||d===void 0?void 0:d.priority)!==null&&h!==void 0?h:"high"}]);if(!this.engine||this.engine.isClosed)throw new lt("cannot publish track when not connected");const y=()=>S(this,void 0,void 0,function*(){var w,_,k;if(!this.engine.pcManager)throw new lt("pcManager is not ready");if(e.sender=yield this.engine.createSender(e,t,v),gr(e)&&((w=t.degradationPreference)!==null&&w!==void 0||(t.degradationPreference=Ux(e)),e.setDegradationPreference(t.degradationPreference)),v)if(Qi()&&e.kind===P.Kind.Audio){let F;for(const x of this.engine.pcManager.publisher.getTransceivers())if(x.sender===e.sender){F=x;break}F&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:F,codec:"opus",maxbr:!((_=v[0])===null||_===void 0)&&_.maxBitrate?v[0].maxBitrate/1e3:0})}else e.codec&&KA(e.codec)&&(!((k=v[0])===null||k===void 0)&&k.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:g.cid,codec:e.codec,maxbr:v[0].maxBitrate/1e3});yield this.engine.negotiate()});let B;if(this.enabledPublishVideoCodecs.length>0)B=(yield Promise.all([this.engine.addTrack(g),y()]))[0];else{B=yield this.engine.addTrack(g);let w;if(B.codecs.forEach(_=>{w===void 0&&(w=_.mimeType)}),w&&e.kind===P.Kind.Video){const _=Aa(w);_!==p&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign(Object.assign({},this.logContext),_e(e)),{codec:_})),t.videoCodec=_,v=td(e.source===P.Source.ScreenShare,g.width,g.height,t))}yield y()}const b=new od(e.kind,B,e,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});return b.options=t,e.sid=B.sid,this.log.debug("publishing ".concat(e.kind," with encodings"),Object.assign(Object.assign({},this.logContext),{encodings:v,trackInfo:B})),gr(e)?e.startMonitor(this.engine.client):Jr(e)&&e.startMonitor(),this.addTrackPublication(b),this.emit(K.LocalTrackPublished,b),b})}get isLocal(){return!0}publishAdditionalCodecForTrack(e,t,r){return S(this,void 0,void 0,function*(){var i;if(this.encryptionType!==Wt.NONE)return;let A;if(this.trackPublications.forEach(h=>{h.track&&h.track===e&&(A=h)}),!A)throw new Dn("track is not published");if(!gr(e))throw new Dn("track is not a video track");const s=Object.assign(Object.assign({},(i=this.roomOptions)===null||i===void 0?void 0:i.publishDefaults),r),o=Sx(e,t,s);if(!o){this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",Object.assign(Object.assign({},this.logContext),_e(e)));return}const a=e.addSimulcastTrack(t,o);if(!a)return;const c=new sl({cid:a.mediaStreamTrack.id,type:P.kindToProto(e.kind),muted:e.isMuted,source:P.sourceToProto(e.source),sid:e.sid,simulcastCodecs:[{codec:s.videoCodec,cid:a.mediaStreamTrack.id}]});if(c.layers=k0(c.width,c.height,o),!this.engine||this.engine.isClosed)throw new lt("cannot publish track when not connected");const u=()=>S(this,void 0,void 0,function*(){yield this.engine.createSimulcastSender(e,a,s,o),yield this.engine.negotiate()}),d=(yield Promise.all([this.engine.addTrack(c),u()]))[0];this.log.debug("published ".concat(t," for track ").concat(e.sid),Object.assign(Object.assign({},this.logContext),{encodings:o,trackInfo:d}))})}unpublishTrack(e,t){return S(this,void 0,void 0,function*(){var r,i;if(Ri(e)){const c=this.pendingPublishPromises.get(e);c&&(this.log.info("awaiting publish promise before attempting to unpublish",Object.assign(Object.assign({},this.logContext),_e(e))),yield c)}const A=this.getPublicationForTrack(e),s=A?_e(A):void 0;if(this.log.debug("unpublishing track",Object.assign(Object.assign({},this.logContext),s)),!A||!A.track){this.log.warn("track was not unpublished because no publication was found",Object.assign(Object.assign({},this.logContext),s));return}e=A.track,e.off(L.Muted,this.onTrackMuted),e.off(L.Unmuted,this.onTrackUnmuted),e.off(L.Ended,this.handleTrackEnded),e.off(L.UpstreamPaused,this.onTrackUpstreamPaused),e.off(L.UpstreamResumed,this.onTrackUpstreamResumed),e.off(L.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),t===void 0&&(t=(i=(r=this.roomOptions)===null||r===void 0?void 0:r.stopLocalTrackOnUnpublish)!==null&&i!==void 0?i:!0),t?e.stop():e.stopMonitor();let o=!1;const a=e.sender;if(e.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<Ye.FAILED&&a)try{for(const c of this.engine.pcManager.publisher.getTransceivers())c.sender===a&&(c.direction="inactive",o=!0);if(this.engine.removeTrack(a)&&(o=!0),gr(e)){for(const[,c]of e.simulcastCodecs)c.sender&&(this.engine.removeTrack(c.sender)&&(o=!0),c.sender=void 0);e.simulcastCodecs.clear()}}catch(c){this.log.warn("failed to unpublish track",Object.assign(Object.assign(Object.assign({},this.logContext),s),{error:c}))}switch(this.trackPublications.delete(A.trackSid),A.kind){case P.Kind.Audio:this.audioTrackPublications.delete(A.trackSid);break;case P.Kind.Video:this.videoTrackPublications.delete(A.trackSid);break}return this.emit(K.LocalTrackUnpublished,A),A.setTrack(void 0),o&&(yield this.engine.negotiate()),A})}unpublishTracks(e){return S(this,void 0,void 0,function*(){return(yield Promise.all(e.map(r=>this.unpublishTrack(r)))).filter(r=>!!r)})}republishAllTracks(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){r.republishPromise&&(yield r.republishPromise),r.republishPromise=new Promise((A,s)=>S(r,void 0,void 0,function*(){try{const o=[];this.trackPublications.forEach(a=>{a.track&&(t&&(a.options=Object.assign(Object.assign({},a.options),t)),o.push(a))}),yield Promise.all(o.map(a=>S(this,void 0,void 0,function*(){const c=a.track;yield this.unpublishTrack(c,!1),i&&!c.isMuted&&c.source!==P.Source.ScreenShare&&c.source!==P.Source.ScreenShareAudio&&(Jr(c)||gr(c))&&!c.isUserProvided&&(this.log.debug("restarting existing track",Object.assign(Object.assign({},this.logContext),{track:a.trackSid})),yield c.restartTrack()),yield this.publishOrRepublishTrack(c,a.options,!0)}))),A()}catch(o){s(o)}finally{this.republishPromise=void 0}})),yield r.republishPromise}()})}publishData(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){const A=i.reliable?pe.RELIABLE:pe.LOSSY,s=i.destinationIdentities,o=i.topic,a=new Dt({kind:A,value:{case:"user",value:new Im({participantIdentity:r.identity,payload:t,destinationIdentities:s,topic:o})}});yield r.engine.sendDataPacket(a,A)}()})}publishDtmf(e,t){return S(this,void 0,void 0,function*(){const r=new Dt({kind:pe.RELIABLE,value:{case:"sipDtmf",value:new Fm({code:e,digit:t})}});yield this.engine.sendDataPacket(r,pe.RELIABLE)})}sendChatMessage(e,t){return S(this,void 0,void 0,function*(){const r={id:crypto.randomUUID(),message:e,timestamp:Date.now(),attachedFiles:t==null?void 0:t.attachments},i=new Dt({value:{case:"chatMessage",value:new $u(Object.assign(Object.assign({},r),{timestamp:Ke.parse(r.timestamp)}))}});return yield this.engine.sendDataPacket(i,pe.RELIABLE),this.emit(K.ChatMessage,r),r})}editChatMessage(e,t){return S(this,void 0,void 0,function*(){const r=Object.assign(Object.assign({},t),{message:e,editTimestamp:Date.now()}),i=new Dt({value:{case:"chatMessage",value:new $u(Object.assign(Object.assign({},r),{timestamp:Ke.parse(r.timestamp),editTimestamp:Ke.parse(r.editTimestamp)}))}});return yield this.engine.sendDataPacket(i,pe.RELIABLE),this.emit(K.ChatMessage,r),r})}sendText(e,t){return S(this,void 0,void 0,function*(){var r;const i=crypto.randomUUID(),s=new TextEncoder().encode(e).byteLength,o=(r=t==null?void 0:t.attachments)===null||r===void 0?void 0:r.map(()=>crypto.randomUUID()),a=new Array(o?o.length+1:1).fill(0),c=(l,d)=>{var h;a[d]=l;const f=a.reduce((p,g)=>p+g,0);(h=t==null?void 0:t.onProgress)===null||h===void 0||h.call(t,f)},u=yield this.streamText({streamId:i,totalSize:s,destinationIdentities:t==null?void 0:t.destinationIdentities,topic:t==null?void 0:t.topic,attachedStreamIds:o,attributes:t==null?void 0:t.attributes});return yield u.write(e),c(1,0),yield u.close(),t!=null&&t.attachments&&o&&(yield Promise.all(t.attachments.map((l,d)=>S(this,void 0,void 0,function*(){return this._sendFile(o[d],l,{topic:t.topic,mimeType:l.type,onProgress:h=>{c(h,d+1)}})})))),u.info})}streamText(e){return S(this,void 0,void 0,function*(){var t,r;const i=(t=e==null?void 0:e.streamId)!==null&&t!==void 0?t:crypto.randomUUID(),A={id:i,mimeType:"text/plain",timestamp:Date.now(),topic:(r=e==null?void 0:e.topic)!==null&&r!==void 0?r:"",size:e==null?void 0:e.totalSize,attributes:e==null?void 0:e.attributes},s=new tl({streamId:i,mimeType:A.mimeType,topic:A.topic,timestamp:qr(A.timestamp),totalLength:qr(e==null?void 0:e.totalSize),attributes:A.attributes,contentHeader:{case:"textHeader",value:new Km({version:e==null?void 0:e.version,attachedStreamIds:e==null?void 0:e.attachedStreamIds,replyToStreamId:e==null?void 0:e.replyToStreamId,operationType:(e==null?void 0:e.type)==="update"?el.UPDATE:el.CREATE})}}),o=e==null?void 0:e.destinationIdentities,a=new Dt({destinationIdentities:o,value:{case:"streamHeader",value:s}});yield this.engine.sendDataPacket(a,pe.RELIABLE);let c=0;const u=this,l=new WritableStream({write(f){return S(this,void 0,void 0,function*(){for(const p of qF(f,Q0)){yield u.engine.waitForBufferStatusLow(pe.RELIABLE);const g=new nl({content:p,streamId:i,chunkIndex:qr(c)}),v=new Dt({destinationIdentities:o,value:{case:"streamChunk",value:g}});yield u.engine.sendDataPacket(v,pe.RELIABLE),c+=1}})},close(){return S(this,void 0,void 0,function*(){const f=new rl({streamId:i}),p=new Dt({destinationIdentities:o,value:{case:"streamTrailer",value:f}});yield u.engine.sendDataPacket(p,pe.RELIABLE)})},abort(f){console.log("Sink error:",f)}});let d=()=>S(this,void 0,void 0,function*(){yield h.close()});u.engine.once(D.Closing,d);const h=new Mx(l,A,()=>this.engine.off(D.Closing,d));return h})}sendFile(e,t){return S(this,void 0,void 0,function*(){const r=crypto.randomUUID();return yield this._sendFile(r,e,t),{id:r}})}_sendFile(e,t,r){return S(this,void 0,void 0,function*(){var i;const A=yield this.streamBytes({streamId:e,totalSize:t.size,name:t.name,mimeType:(i=r==null?void 0:r.mimeType)!==null&&i!==void 0?i:t.type,topic:r==null?void 0:r.topic,destinationIdentities:r==null?void 0:r.destinationIdentities}),s=t.stream().getReader();for(;;){const{done:o,value:a}=yield s.read();if(o)break;yield A.write(a)}return yield A.close(),A.info})}streamBytes(e){return S(this,void 0,void 0,function*(){var t,r,i,A,s;const o=(t=e==null?void 0:e.streamId)!==null&&t!==void 0?t:crypto.randomUUID(),a=e==null?void 0:e.destinationIdentities,c={id:o,mimeType:(r=e==null?void 0:e.mimeType)!==null&&r!==void 0?r:"application/octet-stream",topic:(i=e==null?void 0:e.topic)!==null&&i!==void 0?i:"",timestamp:Date.now(),attributes:e==null?void 0:e.attributes,size:e==null?void 0:e.totalSize,name:(A=e==null?void 0:e.name)!==null&&A!==void 0?A:"unknown"},u=new tl({totalLength:qr((s=c.size)!==null&&s!==void 0?s:0),mimeType:c.mimeType,streamId:o,topic:c.topic,timestamp:qr(Date.now()),attributes:c.attributes,contentHeader:{case:"byteHeader",value:new Vm({name:c.name})}}),l=new Dt({destinationIdentities:a,value:{case:"streamHeader",value:u}});yield this.engine.sendDataPacket(l,pe.RELIABLE);let d=0;const h=new Mt,f=this.engine,p=this.log,g=new WritableStream({write(y){return S(this,void 0,void 0,function*(){const B=yield h.lock();let b=0;try{for(;b<y.byteLength;){const w=y.slice(b,b+Q0);yield f.waitForBufferStatusLow(pe.RELIABLE);const _=new Dt({destinationIdentities:a,value:{case:"streamChunk",value:new nl({content:w,streamId:o,chunkIndex:qr(d)})}});yield f.sendDataPacket(_,pe.RELIABLE),d+=1,b+=w.byteLength}}finally{B()}})},close(){return S(this,void 0,void 0,function*(){const y=new rl({streamId:o}),B=new Dt({destinationIdentities:a,value:{case:"streamTrailer",value:y}});yield f.sendDataPacket(B,pe.RELIABLE)})},abort(y){p.error("Sink error:",y)}});return new Lx(g,c)})}performRpc(e){return S(this,arguments,void 0,function(t){var r=this;let{destinationIdentity:i,method:A,payload:s,responseTimeout:o=1e4}=t;return function*(){return new Promise((c,u)=>S(r,void 0,void 0,function*(){var l,d,h,f;if(Zl(s)>y0){u(Ze.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));return}if(!((d=(l=this.engine.latestJoinResponse)===null||l===void 0?void 0:l.serverInfo)===null||d===void 0)&&d.version&&Wr((f=(h=this.engine.latestJoinResponse)===null||h===void 0?void 0:h.serverInfo)===null||f===void 0?void 0:f.version,"1.8.0")<0){u(Ze.builtIn("UNSUPPORTED_SERVER"));return}const p=crypto.randomUUID();yield this.publishRpcRequest(i,p,A,s,o-2e3);const g=setTimeout(()=>{this.pendingAcks.delete(p),u(Ze.builtIn("CONNECTION_TIMEOUT")),this.pendingResponses.delete(p),clearTimeout(v)},2e3);this.pendingAcks.set(p,{resolve:()=>{clearTimeout(g)},participantIdentity:i});const v=setTimeout(()=>{this.pendingResponses.delete(p),u(Ze.builtIn("RESPONSE_TIMEOUT"))},o);this.pendingResponses.set(p,{resolve:(y,B)=>{clearTimeout(v),this.pendingAcks.has(p)&&(console.warn("RPC response received before ack",p),this.pendingAcks.delete(p),clearTimeout(g)),B?u(B):c(y??"")},participantIdentity:i})}))}()})}registerRpcMethod(e,t){this.rpcHandlers.has(e)&&this.log.warn("you're overriding the RPC handler for method ".concat(e,", in the future this will throw an error")),this.rpcHandlers.set(e,t)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}setTrackSubscriptionPermissions(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];this.participantTrackPermissions=t,this.allParticipantsAllowedToSubscribe=e,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}handleIncomingRpcAck(e){const t=this.pendingAcks.get(e);t?(t.resolve(),this.pendingAcks.delete(e)):console.error("Ack received for unexpected RPC request",e)}handleIncomingRpcResponse(e,t,r){const i=this.pendingResponses.get(e);i?(i.resolve(t,r),this.pendingResponses.delete(e)):console.error("Response received for unexpected RPC request",e)}publishRpcRequest(e,t,r,i,A){return S(this,void 0,void 0,function*(){const s=new Dt({destinationIdentities:[e],kind:pe.RELIABLE,value:{case:"rpcRequest",value:new xm({id:t,method:r,payload:i,responseTimeoutMs:A,version:1})}});yield this.engine.sendDataPacket(s,pe.RELIABLE)})}handleParticipantDisconnected(e){for(const[t,{participantIdentity:r}]of this.pendingAcks)r===e&&this.pendingAcks.delete(t);for(const[t,{participantIdentity:r,resolve:i}]of this.pendingResponses)r===e&&(i(null,Ze.builtIn("RECIPIENT_DISCONNECTED")),this.pendingResponses.delete(t))}setEnabledPublishCodecs(e){this.enabledPublishVideoCodecs=e.filter(t=>t.mime.split("/")[0].toLowerCase()==="video")}updateInfo(e){return super.updateInfo(e)?(e.tracks.forEach(t=>{var r,i;const A=this.trackPublications.get(t.sid);if(A){const s=A.isMuted||((i=(r=A.track)===null||r===void 0?void 0:r.isUpstreamPaused)!==null&&i!==void 0?i:!1);s!==t.muted&&(this.log.debug("updating server mute state after reconcile",Object.assign(Object.assign(Object.assign({},this.logContext),_e(A)),{mutedOnServer:s})),this.engine.client.sendMuteTrack(t.sid,s))}}),!0):!1}getPublicationForTrack(e){let t;return this.trackPublications.forEach(r=>{const i=r.track;i&&(e instanceof MediaStreamTrack?(Jr(i)||gr(i))&&i.mediaStreamTrack===e&&(t=r):e===i&&(t=r))}),t}waitForPendingPublicationOfSource(e){return S(this,void 0,void 0,function*(){const r=Date.now();for(;Date.now()<r+1e4;){const i=Array.from(this.pendingPublishPromises.entries()).find(A=>{let[s]=A;return s.source===e});if(i)return i[1];yield Nt(20)}})}}class qx extends Hn{constructor(e,t,r,i){super(e,t.sid,t.name,i),this.track=void 0,this.allowed=!0,this.disabled=!1,this.currentVideoQuality=Yt.HIGH,this.handleEnded=A=>{this.setTrack(void 0),this.emit(L.Ended,A)},this.handleVisibilityChange=A=>{this.log.debug("adaptivestream video visibility ".concat(this.trackSid,", visible=").concat(A),this.logContext),this.disabled=!A,this.emitTrackUpdate()},this.handleVideoDimensionsChange=A=>{this.log.debug("adaptivestream video dimensions ".concat(A.width,"x").concat(A.height),this.logContext),this.videoDimensions=A,this.emitTrackUpdate()},this.subscribed=r,this.updateInfo(t)}setSubscribed(e){const t=this.subscriptionStatus,r=this.permissionStatus;this.subscribed=e,e&&(this.allowed=!0);const i=new Go({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new Om({participantSid:"",trackSids:[this.trackSid]})]});this.emit(L.UpdateSubscription,i),this.emitSubscriptionUpdateIfChanged(t),this.emitPermissionUpdateIfChanged(r)}get subscriptionStatus(){return this.subscribed===!1?Hn.SubscriptionStatus.Unsubscribed:super.isSubscribed?Hn.SubscriptionStatus.Subscribed:Hn.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?Hn.PermissionStatus.Allowed:Hn.PermissionStatus.NotAllowed}get isSubscribed(){return this.subscribed===!1?!1:super.isSubscribed}get isDesired(){return this.subscribed!==!1}get isEnabled(){return!this.disabled}get isLocal(){return!1}setEnabled(e){!this.isManualOperationAllowed()||this.disabled===!e||(this.disabled=!e,this.emitTrackUpdate())}setVideoQuality(e){!this.isManualOperationAllowed()||this.currentVideoQuality===e||(this.currentVideoQuality=e,this.videoDimensions=void 0,this.emitTrackUpdate())}setVideoDimensions(e){var t,r;this.isManualOperationAllowed()&&(((t=this.videoDimensions)===null||t===void 0?void 0:t.width)===e.width&&((r=this.videoDimensions)===null||r===void 0?void 0:r.height)===e.height||(Nl(this.track)&&(this.videoDimensions=e),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(e){this.isManualOperationAllowed()&&Nl(this.track)&&this.fps!==e&&(this.fps=e,this.emitTrackUpdate())}get videoQuality(){return this.currentVideoQuality}setTrack(e){const t=this.subscriptionStatus,r=this.permissionStatus,i=this.track;i!==e&&(i&&(i.off(L.VideoDimensionsChanged,this.handleVideoDimensionsChange),i.off(L.VisibilityChanged,this.handleVisibilityChange),i.off(L.Ended,this.handleEnded),i.detach(),i.stopMonitor(),this.emit(L.Unsubscribed,i)),super.setTrack(e),e&&(e.sid=this.trackSid,e.on(L.VideoDimensionsChanged,this.handleVideoDimensionsChange),e.on(L.VisibilityChanged,this.handleVisibilityChange),e.on(L.Ended,this.handleEnded),this.emit(L.Subscribed,e)),this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(t))}setAllowed(e){const t=this.subscriptionStatus,r=this.permissionStatus;this.allowed=e,this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(t)}setSubscriptionError(e){this.emit(L.SubscriptionFailed,e)}updateInfo(e){super.updateInfo(e);const t=this.metadataMuted;this.metadataMuted=e.muted,this.track?this.track.setMuted(e.muted):t!==e.muted&&this.emit(e.muted?L.Muted:L.Unmuted)}emitSubscriptionUpdateIfChanged(e){const t=this.subscriptionStatus;e!==t&&this.emit(L.SubscriptionStatusChanged,t,e)}emitPermissionUpdateIfChanged(e){this.permissionStatus!==e&&this.emit(L.SubscriptionPermissionChanged,this.permissionStatus,e)}isManualOperationAllowed(){return this.kind===P.Kind.Video&&this.isAdaptiveStream?(this.log.warn("adaptive stream is enabled, cannot change video track settings",this.logContext),!1):this.isDesired?!0:(this.log.warn("cannot update track settings when not subscribed",this.logContext),!1)}get isAdaptiveStream(){return Nl(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const e=new jm({trackSids:[this.trackSid],disabled:this.disabled,fps:this.fps});this.videoDimensions?(e.width=Math.ceil(this.videoDimensions.width),e.height=Math.ceil(this.videoDimensions.height)):this.currentVideoQuality!==void 0?e.quality=this.currentVideoQuality:e.quality=Yt.HIGH,this.emit(L.UpdateSettings,e)}}class da extends x0{static fromParticipantInfo(e,t,r){return new da(e,t.sid,t.identity,t.name,t.metadata,t.attributes,r,t.kind)}get logContext(){return Object.assign(Object.assign({},super.logContext),{rpID:this.sid,remoteParticipant:this.identity})}constructor(e,t,r,i,A,s,o){let a=arguments.length>7&&arguments[7]!==void 0?arguments[7]:Vo.STANDARD;super(t,r||"",i,A,s,o,a),this.signalClient=e,this.trackPublications=new Map,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.volumeMap=new Map}addTrackPublication(e){super.addTrackPublication(e),e.on(L.UpdateSettings,t=>{this.log.debug("send update settings",Object.assign(Object.assign({},this.logContext),_e(e))),this.signalClient.sendUpdateTrackSettings(t)}),e.on(L.UpdateSubscription,t=>{t.participantTracks.forEach(r=>{r.participantSid=this.sid}),this.signalClient.sendUpdateSubscription(t)}),e.on(L.SubscriptionPermissionChanged,t=>{this.emit(K.TrackSubscriptionPermissionChanged,e,t)}),e.on(L.SubscriptionStatusChanged,t=>{this.emit(K.TrackSubscriptionStatusChanged,e,t)}),e.on(L.Subscribed,t=>{this.emit(K.TrackSubscribed,t,e)}),e.on(L.Unsubscribed,t=>{this.emit(K.TrackUnsubscribed,t,e)}),e.on(L.SubscriptionFailed,t=>{this.emit(K.TrackSubscriptionFailed,e.trackSid,t)})}getTrackPublication(e){const t=super.getTrackPublication(e);if(t)return t}getTrackPublicationByName(e){const t=super.getTrackPublicationByName(e);if(t)return t}setVolume(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:P.Source.Microphone;this.volumeMap.set(t,e);const r=this.getTrackPublication(t);r&&r.track&&r.track.setVolume(e)}getVolume(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P.Source.Microphone;const t=this.getTrackPublication(e);return t&&t.track?t.track.getVolume():this.volumeMap.get(e)}addSubscribedMediaTrack(e,t,r,i,A,s){let o=this.getTrackPublicationBySid(t);if(o||t.startsWith("TR")||this.trackPublications.forEach(u=>{!o&&e.kind===u.kind.toString()&&(o=u)}),!o){if(s===0){this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:t})),this.emit(K.TrackSubscriptionFailed,t);return}s===void 0&&(s=20),setTimeout(()=>{this.addSubscribedMediaTrack(e,t,r,i,A,s-1)},150);return}if(e.readyState==="ended"){this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",Object.assign(Object.assign({},this.logContext),_e(o))),this.emit(K.TrackSubscriptionFailed,t);return}const a=e.kind==="video";let c;return a?c=new Nx(e,t,i,A):c=new Dx(e,t,i,this.audioContext,this.audioOutput),c.source=o.source,c.isMuted=o.isMuted,c.setMediaStream(r),c.start(),o.setTrack(c),this.volumeMap.has(o.source)&&Dl(c)&&Nn(c)&&c.setVolume(this.volumeMap.get(o.source)),o}get hasMetadata(){return!!this.participantInfo}getTrackPublicationBySid(e){return this.trackPublications.get(e)}updateInfo(e){if(!super.updateInfo(e))return!1;const t=new Map,r=new Map;return e.tracks.forEach(i=>{var A,s;let o=this.getTrackPublicationBySid(i.sid);if(o)o.updateInfo(i);else{const a=P.kindFromProto(i.type);if(!a)return;o=new qx(a,i,(A=this.signalClient.connectOptions)===null||A===void 0?void 0:A.autoSubscribe,{loggerContextCb:()=>this.logContext,loggerName:(s=this.loggerOptions)===null||s===void 0?void 0:s.loggerName}),o.updateInfo(i),r.set(i.sid,o);const c=Array.from(this.trackPublications.values()).find(u=>u.source===(o==null?void 0:o.source));c&&o.source!==P.Source.Unknown&&this.log.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(o.source),Object.assign(Object.assign({},this.logContext),{oldTrack:_e(c),newTrack:_e(o)})),this.addTrackPublication(o)}t.set(i.sid,o)}),this.trackPublications.forEach(i=>{t.has(i.trackSid)||(this.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},this.logContext),_e(i))),this.unpublishTrack(i.trackSid,!0))}),r.forEach(i=>{this.emit(K.TrackPublished,i)}),!0}unpublishTrack(e,t){const r=this.trackPublications.get(e);if(!r)return;const{track:i}=r;switch(i&&(i.stop(),r.setTrack(void 0)),this.trackPublications.delete(e),r.kind){case P.Kind.Audio:this.audioTrackPublications.delete(e);break;case P.Kind.Video:this.videoTrackPublications.delete(e);break}t&&this.emit(K.TrackUnpublished,r)}setAudioOutput(e){return S(this,void 0,void 0,function*(){this.audioOutput=e;const t=[];this.audioTrackPublications.forEach(r=>{var i;Nn(r.track)&&Dl(r.track)&&t.push(r.track.setSinkId((i=e.deviceId)!==null&&i!==void 0?i:"default"))}),yield Promise.all(t)})}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:e,args:r})),super.emit(e,...r)}}var fe;(function(n){n.Disconnected="disconnected",n.Connecting="connecting",n.Connected="connected",n.Reconnecting="reconnecting",n.SignalReconnecting="signalReconnecting"})(fe||(fe={}));const Jx=4*1e3;class Li extends Sn.EventEmitter{constructor(e){var t,r,i,A;if(super(),t=this,this.state=fe.Disconnected,this.activeSpeakers=[],this.isE2EEEnabled=!1,this.audioEnabled=!0,this.isVideoPlaybackBlocked=!1,this.log=ue,this.bufferedEvents=[],this.isResuming=!1,this.byteStreamControllers=new Map,this.textStreamControllers=new Map,this.byteStreamHandlers=new Map,this.textStreamHandlers=new Map,this.rpcHandlers=new Map,this.connect=(s,o,a)=>S(this,void 0,void 0,function*(){var c;if(!PF())throw kn()?Error("WebRTC isn't detected, have you called registerGlobals?"):Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");const u=yield this.disconnectLock.lock();if(this.state===fe.Connected)return this.log.info("already connected to room ".concat(this.name),this.logContext),u(),Promise.resolve();if(this.connectFuture)return u(),this.connectFuture.promise;this.setAndEmitConnectionState(fe.Connecting),((c=this.regionUrlProvider)===null||c===void 0?void 0:c.getServerUrl().toString())!==s&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),Ql(new URL(s))&&(this.regionUrlProvider===void 0?this.regionUrlProvider=new id(s,o):this.regionUrlProvider.updateToken(o),this.regionUrlProvider.fetchRegionSettings().then(h=>{var f;(f=this.regionUrlProvider)===null||f===void 0||f.setServerReportedRegions(h)}).catch(h=>{this.log.warn("could not fetch region settings",Object.assign(Object.assign({},this.logContext),{error:h}))}));const l=(h,f,p)=>S(this,void 0,void 0,function*(){var g,v;this.abortController&&this.abortController.abort();const y=new AbortController;this.abortController=y,u==null||u();try{yield this.attemptConnection(p??s,o,a,y),this.abortController=void 0,h()}catch(B){if(this.regionUrlProvider&&B instanceof Fe&&B.reason!==de.Cancelled&&B.reason!==de.NotAllowed){let b=null;try{b=yield this.regionUrlProvider.getNextBestRegionUrl((g=this.abortController)===null||g===void 0?void 0:g.signal)}catch(w){if(w instanceof Fe&&(w.status===401||w.reason===de.Cancelled)){this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),f(w);return}}b&&!(!((v=this.abortController)===null||v===void 0)&&v.signal.aborted)?(this.log.info("Initial connection failed with ConnectionError: ".concat(B.message,". Retrying with another region: ").concat(b),this.logContext),this.recreateEngine(),yield l(h,f,b)):(this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,n0(B)),f(B))}else{let b=sn.UNKNOWN_REASON;B instanceof Fe&&(b=n0(B)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,b),f(B)}}}),d=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new Ml((h,f)=>{l(h,f,d)},()=>{this.clearConnectionFutures()}),this.connectFuture.promise}),this.connectSignal=(s,o,a,c,u,l)=>S(this,void 0,void 0,function*(){var d,h,f;const p=yield a.join(s,o,{autoSubscribe:c.autoSubscribe,adaptiveStream:typeof u.adaptiveStream=="object"?!0:u.adaptiveStream,maxRetries:c.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:c.websocketTimeout},l.signal);let g=p.serverInfo;if(g||(g={version:p.serverVersion,region:p.serverRegion}),this.serverInfo=g,this.log.debug("connected to Livekit Server ".concat(Object.entries(g).map(v=>{let[y,B]=v;return"".concat(y,": ").concat(B)}).join(", ")),{room:(d=p.room)===null||d===void 0?void 0:d.name,roomSid:(h=p.room)===null||h===void 0?void 0:h.sid,identity:(f=p.participant)===null||f===void 0?void 0:f.identity}),!g.version)throw new wF("unknown server version");return g.version==="0.15.1"&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version",this.logContext),u.dynacast=!1),p}),this.applyJoinResponse=s=>{const o=s.participant;if(this.localParticipant.sid=o.sid,this.localParticipant.identity=o.identity,this.localParticipant.setEnabledPublishCodecs(s.enabledPublishCodecs),this.options.e2ee&&this.e2eeManager)try{this.e2eeManager.setSifTrailer(s.sifTrailer)}catch(a){this.log.error(a instanceof Error?a.message:"Could not set SifTrailer",Object.assign(Object.assign({},this.logContext),{error:a}))}this.handleParticipantUpdates([o,...s.otherParticipants]),s.room&&this.handleRoomUpdate(s.room)},this.attemptConnection=(s,o,a,c)=>S(this,void 0,void 0,function*(){var u,l;this.state===fe.Reconnecting||this.isResuming||!((u=this.engine)===null||u===void 0)&&u.pendingReconnect?(this.log.info("Reconnection attempt replaced by new connection attempt",this.logContext),this.recreateEngine()):this.maybeCreateEngine(),!((l=this.regionUrlProvider)===null||l===void 0)&&l.isCloud()&&this.engine.setRegionUrlProvider(this.regionUrlProvider),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},Yl),a),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const d=yield this.connectSignal(s,o,this.engine,this.connOptions,this.options,c);this.applyJoinResponse(d),this.setupLocalParticipantEvents(),this.emit(O.SignalConnected)}catch(d){yield this.engine.close(),this.recreateEngine();const h=new Fe("could not establish signal connection",de.ServerUnreachable);throw d instanceof Error&&(h.message="".concat(h.message,": ").concat(d.message)),d instanceof Fe&&(h.reason=d.reason,h.status=d.status),this.log.debug("error trying to establish signal connection",Object.assign(Object.assign({},this.logContext),{error:d})),h}if(c.signal.aborted)throw yield this.engine.close(),this.recreateEngine(),new Fe("Connection attempt aborted",de.Cancelled);try{yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,c)}catch(d){throw yield this.engine.close(),this.recreateEngine(),d}Ht()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),Ht()&&document.addEventListener("freeze",this.onPageLeave),this.setAndEmitConnectionState(fe.Connected),this.emit(O.Connected),this.registerConnectionReconcile()}),this.disconnect=function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return S(t,[...o],void 0,function(){var c=this;let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var l,d,h,f;const p=yield c.disconnectLock.lock();try{if(c.state===fe.Disconnected){c.log.debug("already disconnected",c.logContext);return}c.log.info("disconnect from room",Object.assign({},c.logContext)),(c.state===fe.Connecting||c.state===fe.Reconnecting||c.isResuming)&&(c.log.warn("abort connection attempt",c.logContext),(l=c.abortController)===null||l===void 0||l.abort(),(h=(d=c.connectFuture)===null||d===void 0?void 0:d.reject)===null||h===void 0||h.call(d,new Fe("Client initiated disconnect",de.Cancelled)),c.connectFuture=void 0),!((f=c.engine)===null||f===void 0)&&f.client.isDisconnected||(yield c.engine.client.sendLeave()),c.engine&&(yield c.engine.close()),c.handleDisconnect(u,sn.CLIENT_INITIATED),c.engine=void 0}finally{p()}}()})},this.onPageLeave=()=>S(this,void 0,void 0,function*(){this.log.info("Page leave detected, disconnecting",this.logContext),yield this.disconnect()}),this.startAudio=()=>S(this,void 0,void 0,function*(){const s=[],o=un();if(o&&o.os==="iOS"){const a="livekit-dummy-audio-el";let c=document.getElementById(a);if(!c){c=document.createElement("audio"),c.id=a,c.autoplay=!0,c.hidden=!0;const u=Ol();u.enabled=!0;const l=new MediaStream([u]);c.srcObject=l,document.addEventListener("visibilitychange",()=>{c&&(c.srcObject=document.hidden?null:l,document.hidden||(this.log.debug("page visible again, triggering startAudio to resume playback and update playback status",this.logContext),this.startAudio()))}),document.body.append(c),this.once(O.Disconnected,()=>{c==null||c.remove(),c=null})}s.push(c)}this.remoteParticipants.forEach(a=>{a.audioTrackPublications.forEach(c=>{c.track&&c.track.attachedElements.forEach(u=>{s.push(u)})})});try{yield Promise.all([this.acquireAudioContext(),...s.map(a=>(a.muted=!1,a.play()))]),this.handleAudioPlaybackStarted()}catch(a){throw this.handleAudioPlaybackFailed(a),a}}),this.startVideo=()=>S(this,void 0,void 0,function*(){const s=[];for(const o of this.remoteParticipants.values())o.videoTrackPublications.forEach(a=>{var c;(c=a.track)===null||c===void 0||c.attachedElements.forEach(u=>{s.includes(u)||s.push(u)})});yield Promise.all(s.map(o=>o.play())).then(()=>{this.handleVideoPlaybackStarted()}).catch(o=>{o.name==="NotAllowedError"?this.handleVideoPlaybackFailed():this.log.warn("Resuming video playback failed, make sure you call `startVideo` directly in a user gesture handler",this.logContext)})}),this.handleRestarting=()=>{this.clearConnectionReconcile(),this.isResuming=!1;for(const s of this.remoteParticipants.values())this.handleParticipantDisconnected(s.identity,s);this.setAndEmitConnectionState(fe.Reconnecting)&&this.emit(O.Reconnecting)},this.handleSignalRestarted=s=>S(this,void 0,void 0,function*(){this.log.debug("signal reconnected to server, region ".concat(s.serverRegion),Object.assign(Object.assign({},this.logContext),{region:s.serverRegion})),this.bufferedEvents=[],this.applyJoinResponse(s);try{yield this.localParticipant.republishAllTracks(void 0,!0)}catch(o){this.log.error("error trying to re-publish tracks after reconnection",Object.assign(Object.assign({},this.logContext),{error:o}))}try{yield this.engine.waitForRestarted(),this.log.debug("fully reconnected to server",Object.assign(Object.assign({},this.logContext),{region:s.serverRegion}))}catch{return}this.setAndEmitConnectionState(fe.Connected),this.emit(O.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents()}),this.handleParticipantUpdates=s=>{s.forEach(o=>{var a;if(o.identity===this.localParticipant.identity){this.localParticipant.updateInfo(o);return}o.identity===""&&(o.identity=(a=this.sidToIdentity.get(o.sid))!==null&&a!==void 0?a:"");let c=this.remoteParticipants.get(o.identity);o.state===Ei.DISCONNECTED?this.handleParticipantDisconnected(o.identity,c):c=this.getOrCreateParticipant(o.identity,o)})},this.handleActiveSpeakersUpdate=s=>{const o=[],a={};s.forEach(c=>{if(a[c.sid]=!0,c.sid===this.localParticipant.sid)this.localParticipant.audioLevel=c.level,this.localParticipant.setIsSpeaking(!0),o.push(this.localParticipant);else{const u=this.getRemoteParticipantBySid(c.sid);u&&(u.audioLevel=c.level,u.setIsSpeaking(!0),o.push(u))}}),a[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.remoteParticipants.forEach(c=>{a[c.sid]||(c.audioLevel=0,c.setIsSpeaking(!1))}),this.activeSpeakers=o,this.emitWhenConnected(O.ActiveSpeakersChanged,o)},this.handleSpeakersChanged=s=>{const o=new Map;this.activeSpeakers.forEach(c=>{const u=this.remoteParticipants.get(c.identity);u&&u.sid!==c.sid||o.set(c.sid,c)}),s.forEach(c=>{let u=this.getRemoteParticipantBySid(c.sid);c.sid===this.localParticipant.sid&&(u=this.localParticipant),u&&(u.audioLevel=c.level,u.setIsSpeaking(c.active),c.active?o.set(c.sid,u):o.delete(c.sid))});const a=Array.from(o.values());a.sort((c,u)=>u.audioLevel-c.audioLevel),this.activeSpeakers=a,this.emitWhenConnected(O.ActiveSpeakersChanged,a)},this.handleStreamStateUpdate=s=>{s.streamStates.forEach(o=>{const a=this.getRemoteParticipantBySid(o.participantSid);if(!a)return;const c=a.getTrackPublicationBySid(o.trackSid);if(!c||!c.track)return;const u=P.streamStateFromProto(o.state);u!==c.track.streamState&&(c.track.streamState=u,a.emit(K.TrackStreamStateChanged,c,c.track.streamState),this.emitWhenConnected(O.TrackStreamStateChanged,c,c.track.streamState,a))})},this.handleSubscriptionPermissionUpdate=s=>{const o=this.getRemoteParticipantBySid(s.participantSid);if(!o)return;const a=o.getTrackPublicationBySid(s.trackSid);a&&a.setAllowed(s.allowed)},this.handleSubscriptionError=s=>{const o=Array.from(this.remoteParticipants.values()).find(c=>c.trackPublications.has(s.trackSid));if(!o)return;const a=o.getTrackPublicationBySid(s.trackSid);a&&a.setSubscriptionError(s.err)},this.handleDataPacket=s=>{const o=this.remoteParticipants.get(s.participantIdentity);if(s.value.case==="user")this.handleUserPacket(o,s.value.value,s.kind);else if(s.value.case==="transcription")this.handleTranscription(o,s.value.value);else if(s.value.case==="sipDtmf")this.handleSipDtmf(o,s.value.value);else if(s.value.case==="chatMessage")this.handleChatMessage(o,s.value.value);else if(s.value.case==="metrics")this.handleMetrics(s.value.value,o);else if(s.value.case==="streamHeader")this.handleStreamHeader(s.value.value,s.participantIdentity);else if(s.value.case==="streamChunk")this.handleStreamChunk(s.value.value);else if(s.value.case==="streamTrailer")this.handleStreamTrailer(s.value.value);else if(s.value.case==="rpcRequest"){const a=s.value.value;this.handleIncomingRpcRequest(s.participantIdentity,a.id,a.method,a.payload,a.responseTimeoutMs,a.version)}},this.handleUserPacket=(s,o,a)=>{this.emit(O.DataReceived,o.payload,s,a,o.topic),s==null||s.emit(K.DataReceived,o.payload,a)},this.handleSipDtmf=(s,o)=>{this.emit(O.SipDTMFReceived,o,s),s==null||s.emit(K.SipDTMFReceived,o)},this.bufferedSegments=new Map,this.handleTranscription=(s,o)=>{const a=o.transcribedParticipantIdentity===this.localParticipant.identity?this.localParticipant:this.getParticipantByIdentity(o.transcribedParticipantIdentity),c=a==null?void 0:a.trackPublications.get(o.trackId),u=VF(o,this.transcriptionReceivedTimes);c==null||c.emit(L.TranscriptionReceived,u),a==null||a.emit(K.TranscriptionReceived,u,c),this.emit(O.TranscriptionReceived,u,a,c)},this.handleChatMessage=(s,o)=>{const a=GF(o);this.emit(O.ChatMessage,a,s)},this.handleMetrics=(s,o)=>{this.emit(O.MetricsReceived,s,o)},this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(O.AudioPlaybackStatusChanged,!0))},this.handleAudioPlaybackFailed=s=>{this.log.warn("could not playback audio",Object.assign(Object.assign({},this.logContext),{error:s})),this.canPlaybackAudio&&(this.audioEnabled=!1,this.emit(O.AudioPlaybackStatusChanged,!1))},this.handleVideoPlaybackStarted=()=>{this.isVideoPlaybackBlocked&&(this.isVideoPlaybackBlocked=!1,this.emit(O.VideoPlaybackStatusChanged,!0))},this.handleVideoPlaybackFailed=()=>{this.isVideoPlaybackBlocked||(this.isVideoPlaybackBlocked=!0,this.emit(O.VideoPlaybackStatusChanged,!1))},this.handleDeviceChange=()=>S(this,void 0,void 0,function*(){var s,o,a;const c=ft.getInstance().previousDevices,u=yield ft.getInstance().getDevices(void 0,!1),l=un();if((l==null?void 0:l.name)==="Chrome"&&l.os!=="iOS")for(let h of u){const f=c.find(p=>p.deviceId===h.deviceId);f&&f.label!==""&&f.kind===h.kind&&f.label!==h.label&&this.getActiveDevice(h.kind)==="default"&&this.emit(O.ActiveDeviceChanged,h.kind,h.deviceId)}const d=["audiooutput","audioinput","videoinput"];for(let h of d){const f=JF(h),p=this.localParticipant.getTrackPublication(f);if(p&&(!((s=p.track)===null||s===void 0)&&s.isUserProvided))continue;const g=u.filter(y=>y.kind===h),v=this.getActiveDevice(h);if(v===((o=c.filter(y=>y.kind===h)[0])===null||o===void 0?void 0:o.deviceId)&&g.length>0&&((a=g[0])===null||a===void 0?void 0:a.deviceId)!==v){yield this.switchActiveDevice(h,g[0].deviceId);continue}h==="audioinput"&&!pr()||h==="videoinput"||g.length>0&&!g.find(y=>y.deviceId===this.getActiveDevice(h))&&(yield this.switchActiveDevice(h,g[0].deviceId))}this.emit(O.MediaDevicesChanged)}),this.handleRoomUpdate=s=>{const o=this.roomInfo;this.roomInfo=s,o&&o.metadata!==s.metadata&&this.emitWhenConnected(O.RoomMetadataChanged,s.metadata),(o==null?void 0:o.activeRecording)!==s.activeRecording&&this.emitWhenConnected(O.RecordingStatusChanged,s.activeRecording)},this.handleConnectionQualityUpdate=s=>{s.updates.forEach(o=>{if(o.participantSid===this.localParticipant.sid){this.localParticipant.setConnectionQuality(o.quality);return}const a=this.getRemoteParticipantBySid(o.participantSid);a&&a.setConnectionQuality(o.quality)})},this.onLocalParticipantMetadataChanged=s=>{this.emit(O.ParticipantMetadataChanged,s,this.localParticipant)},this.onLocalParticipantNameChanged=s=>{this.emit(O.ParticipantNameChanged,s,this.localParticipant)},this.onLocalAttributesChanged=s=>{this.emit(O.ParticipantAttributesChanged,s,this.localParticipant)},this.onLocalTrackMuted=s=>{this.emit(O.TrackMuted,s,this.localParticipant)},this.onLocalTrackUnmuted=s=>{this.emit(O.TrackUnmuted,s,this.localParticipant)},this.onTrackProcessorUpdate=s=>{var o;(o=s==null?void 0:s.onPublish)===null||o===void 0||o.call(s,this)},this.onLocalTrackPublished=s=>S(this,void 0,void 0,function*(){var o,a,c,u,l,d;(o=s.track)===null||o===void 0||o.on(L.TrackProcessorUpdate,this.onTrackProcessorUpdate),(a=s.track)===null||a===void 0||a.on(L.Restarted,this.onLocalTrackRestarted),(l=(u=(c=s.track)===null||c===void 0?void 0:c.getProcessor())===null||u===void 0?void 0:u.onPublish)===null||l===void 0||l.call(u,this),this.emit(O.LocalTrackPublished,s,this.localParticipant),Jr(s.track)&&(yield s.track.checkForSilence())&&this.emit(O.LocalAudioSilenceDetected,s);const h=yield(d=s.track)===null||d===void 0?void 0:d.getDeviceId(!1),f=s0(s.source);f&&h&&h!==this.localParticipant.activeDeviceMap.get(f)&&(this.localParticipant.activeDeviceMap.set(f,h),this.emit(O.ActiveDeviceChanged,f,h))}),this.onLocalTrackUnpublished=s=>{var o,a;(o=s.track)===null||o===void 0||o.off(L.TrackProcessorUpdate,this.onTrackProcessorUpdate),(a=s.track)===null||a===void 0||a.off(L.Restarted,this.onLocalTrackRestarted),this.emit(O.LocalTrackUnpublished,s,this.localParticipant)},this.onLocalTrackRestarted=s=>S(this,void 0,void 0,function*(){const o=yield s.getDeviceId(!1),a=s0(s.source);a&&o&&o!==this.localParticipant.activeDeviceMap.get(a)&&(this.log.debug("local track restarted, setting ".concat(a," ").concat(o," active"),this.logContext),this.localParticipant.activeDeviceMap.set(a,o),this.emit(O.ActiveDeviceChanged,a,o))}),this.onLocalConnectionQualityChanged=s=>{this.emit(O.ConnectionQualityChanged,s,this.localParticipant)},this.onMediaDevicesError=s=>{this.emit(O.MediaDevicesError,s)},this.onLocalParticipantPermissionsChanged=s=>{this.emit(O.ParticipantPermissionsChanged,s,this.localParticipant)},this.onLocalChatMessageSent=s=>{this.emit(O.ChatMessage,s,this.localParticipant)},this.setMaxListeners(100),this.remoteParticipants=new Map,this.sidToIdentity=new Map,this.options=Object.assign(Object.assign({},fx),e),this.log=Ln((r=this.options.loggerName)!==null&&r!==void 0?r:cn.Room),this.transcriptionReceivedTimes=new Map,this.options.audioCaptureDefaults=Object.assign(Object.assign({},m0),e==null?void 0:e.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},v0),e==null?void 0:e.videoCaptureDefaults),this.options.publishDefaults=Object.assign(Object.assign({},px),e==null?void 0:e.publishDefaults),this.maybeCreateEngine(),this.disconnectLock=new Mt,this.localParticipant=new Wx("","",this.engine,this.options,this.rpcHandlers),this.options.videoCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("videoinput",fr(this.options.videoCaptureDefaults.deviceId)),this.options.audioCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("audioinput",fr(this.options.audioCaptureDefaults.deviceId)),!((i=this.options.audioOutput)===null||i===void 0)&&i.deviceId&&this.switchActiveDevice("audiooutput",fr(this.options.audioOutput.deviceId)).catch(s=>this.log.warn("Could not set audio output: ".concat(s.message),this.logContext)),this.options.e2ee&&this.setupE2EE(),Ht()){const s=new AbortController;(A=navigator.mediaDevices)===null||A===void 0||A.addEventListener("devicechange",this.handleDeviceChange,{signal:s.signal}),Li.cleanupRegistry&&Li.cleanupRegistry.register(this,()=>{s.abort()})}}registerTextStreamHandler(e,t){if(this.textStreamHandlers.has(e))throw new TypeError('A text stream handler for topic "'.concat(e,'" has already been set.'));this.textStreamHandlers.set(e,t)}unregisterTextStreamHandler(e){this.textStreamHandlers.delete(e)}registerByteStreamHandler(e,t){if(this.byteStreamHandlers.has(e))throw new TypeError('A byte stream handler for topic "'.concat(e,'" has already been set.'));this.byteStreamHandlers.set(e,t)}unregisterByteStreamHandler(e){this.byteStreamHandlers.delete(e)}registerRpcMethod(e,t){if(this.rpcHandlers.has(e))throw Error("RPC handler already registered for method ".concat(e,", unregisterRpcMethod before trying to register again"));this.rpcHandlers.set(e,t)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}handleIncomingRpcRequest(e,t,r,i,A,s){return S(this,void 0,void 0,function*(){if(yield this.engine.publishRpcAck(e,t),s!==1){yield this.engine.publishRpcResponse(e,t,null,Ze.builtIn("UNSUPPORTED_VERSION"));return}const o=this.rpcHandlers.get(r);if(!o){yield this.engine.publishRpcResponse(e,t,null,Ze.builtIn("UNSUPPORTED_METHOD"));return}let a=null,c=null;try{const u=yield o({requestId:t,callerIdentity:e,payload:i,responseTimeout:A});Zl(u)>y0?(a=Ze.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"),console.warn("RPC Response payload too large for ".concat(r))):c=u}catch(u){u instanceof Ze?a=u:(console.warn("Uncaught error returned by RPC handler for ".concat(r,". Returning APPLICATION_ERROR instead."),u),a=Ze.builtIn("APPLICATION_ERROR"))}yield this.engine.publishRpcResponse(e,t,c,a)})}setE2EEEnabled(e){return S(this,void 0,void 0,function*(){if(this.e2eeManager)yield Promise.all([this.localParticipant.setE2EEEnabled(e)]),this.localParticipant.identity!==""&&this.e2eeManager.setParticipantCryptorEnabled(e,this.localParticipant.identity);else throw Error("e2ee not configured, please set e2ee settings within the room options")})}setupE2EE(){var e;this.options.e2ee&&("e2eeManager"in this.options.e2ee?this.e2eeManager=this.options.e2ee.e2eeManager:this.e2eeManager=new ex(this.options.e2ee),this.e2eeManager.on(dr.ParticipantEncryptionStatusChanged,(t,r)=>{WF(r)&&(this.isE2EEEnabled=t),this.emit(O.ParticipantEncryptionStatusChanged,t,r)}),this.e2eeManager.on(dr.EncryptionError,t=>this.emit(O.EncryptionError,t)),(e=this.e2eeManager)===null||e===void 0||e.setup(this))}get logContext(){var e;return{room:this.name,roomID:(e=this.roomInfo)===null||e===void 0?void 0:e.sid,participant:this.localParticipant.identity,pID:this.localParticipant.sid}}get isRecording(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.activeRecording)!==null&&t!==void 0?t:!1}getSid(){return S(this,void 0,void 0,function*(){return this.state===fe.Disconnected?"":this.roomInfo&&this.roomInfo.sid!==""?this.roomInfo.sid:new Promise((e,t)=>{const r=i=>{i.sid!==""&&(this.engine.off(D.RoomUpdate,r),e(i.sid))};this.engine.on(D.RoomUpdate,r),this.once(O.Disconnected,()=>{this.engine.off(D.RoomUpdate,r),t("Room disconnected before room server id was available")})})})}get name(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:""}get metadata(){var e;return(e=this.roomInfo)===null||e===void 0?void 0:e.metadata}get numParticipants(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.numParticipants)!==null&&t!==void 0?t:0}get numPublishers(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.numPublishers)!==null&&t!==void 0?t:0}maybeCreateEngine(){this.engine&&!this.engine.isClosed||(this.engine=new Fx(this.options),this.engine.on(D.ParticipantUpdate,this.handleParticipantUpdates).on(D.RoomUpdate,this.handleRoomUpdate).on(D.SpeakersChanged,this.handleSpeakersChanged).on(D.StreamStateChanged,this.handleStreamStateUpdate).on(D.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(D.SubscriptionError,this.handleSubscriptionError).on(D.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(D.MediaTrackAdded,(e,t,r)=>{this.onTrackAdded(e,t,r)}).on(D.Disconnected,e=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,e)}).on(D.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(D.DataPacketReceived,this.handleDataPacket).on(D.Resuming,()=>{this.clearConnectionReconcile(),this.isResuming=!0,this.log.info("Resuming signal connection",this.logContext),this.setAndEmitConnectionState(fe.SignalReconnecting)&&this.emit(O.SignalReconnecting)}).on(D.Resumed,()=>{this.registerConnectionReconcile(),this.isResuming=!1,this.log.info("Resumed signal connection",this.logContext),this.updateSubscriptions(),this.emitBufferedEvents(),this.setAndEmitConnectionState(fe.Connected)&&this.emit(O.Reconnected)}).on(D.SignalResumed,()=>{this.bufferedEvents=[],(this.state===fe.Reconnecting||this.isResuming)&&this.sendSyncState()}).on(D.Restarting,this.handleRestarting).on(D.SignalRestarted,this.handleSignalRestarted).on(D.Offline,()=>{this.setAndEmitConnectionState(fe.Reconnecting)&&this.emit(O.Reconnecting)}).on(D.DCBufferStatusChanged,(e,t)=>{this.emit(O.DCBufferStatusChanged,e,t)}).on(D.LocalTrackSubscribed,e=>{const t=this.localParticipant.getTrackPublications().find(r=>{let{trackSid:i}=r;return i===e});if(!t){this.log.warn("could not find local track subscription for subscribed event",this.logContext);return}this.localParticipant.emit(K.LocalTrackSubscribed,t),this.emitWhenConnected(O.LocalTrackSubscribed,t,this.localParticipant)}).on(D.RoomMoved,e=>{this.log.debug("room moved",e),e.room&&this.handleRoomUpdate(e.room),this.remoteParticipants.forEach((t,r)=>{this.handleParticipantDisconnected(r,t)}),this.emit(O.Moved,e.room.name,e.token),e.participant?this.handleParticipantUpdates([e.participant,...e.otherParticipants]):this.handleParticipantUpdates(e.otherParticipants)}),this.localParticipant&&this.localParticipant.setupEngine(this.engine),this.e2eeManager&&this.e2eeManager.setupEngine(this.engine))}static getLocalDevices(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ft.getInstance().getDevices(e,t)}prepareConnection(e,t){return S(this,void 0,void 0,function*(){if(this.state===fe.Disconnected){this.log.debug("prepareConnection to ".concat(e),this.logContext);try{if(Ql(new URL(e))&&t){this.regionUrlProvider=new id(e,t);const r=yield this.regionUrlProvider.getNextBestRegionUrl();r&&this.state===fe.Disconnected&&(this.regionUrl=r,yield fetch(Ll(r),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(r),this.logContext))}else yield fetch(Ll(e),{method:"HEAD"})}catch(r){this.log.warn("could not prepare connection",Object.assign(Object.assign({},this.logContext),{error:r}))}}})}getParticipantByIdentity(e){return this.localParticipant.identity===e?this.localParticipant:this.remoteParticipants.get(e)}clearConnectionFutures(){this.connectFuture=void 0}simulateScenario(e,t){return S(this,void 0,void 0,function*(){let r=()=>{},i;switch(e){case"signal-reconnect":yield this.engine.client.handleOnClose("simulate disconnect");break;case"speaker":i=new _n({scenario:{case:"speakerUpdate",value:3}});break;case"node-failure":i=new _n({scenario:{case:"nodeFailure",value:!0}});break;case"server-leave":i=new _n({scenario:{case:"serverLeave",value:!0}});break;case"migration":i=new _n({scenario:{case:"migration",value:!0}});break;case"resume-reconnect":this.engine.failNext(),yield this.engine.client.handleOnClose("simulate resume-disconnect");break;case"disconnect-signal-on-resume":r=()=>S(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new _n({scenario:{case:"disconnectSignalOnResume",value:!0}});break;case"disconnect-signal-on-resume-no-messages":r=()=>S(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new _n({scenario:{case:"disconnectSignalOnResumeNoMessages",value:!0}});break;case"full-reconnect":this.engine.fullReconnectOnNext=!0,yield this.engine.client.handleOnClose("simulate full-reconnect");break;case"force-tcp":case"force-tls":i=new _n({scenario:{case:"switchCandidateProtocol",value:e==="force-tls"?2:1}}),r=()=>S(this,void 0,void 0,function*(){const A=this.engine.client.onLeave;A&&A(new jo({reason:sn.CLIENT_INITIATED,action:Ti.RECONNECT}))});break;case"subscriber-bandwidth":if(t===void 0||typeof t!="number")throw new Error("subscriber-bandwidth requires a number as argument");i=new _n({scenario:{case:"subscriberBandwidth",value:qr(t)}});break;case"leave-full-reconnect":i=new _n({scenario:{case:"leaveRequestFullReconnect",value:!0}})}i&&(yield this.engine.client.sendSimulateScenario(i),yield r())})}get canPlaybackAudio(){return this.audioEnabled}get canPlaybackVideo(){return!this.isVideoPlaybackBlocked}getActiveDevice(e){return this.localParticipant.activeDeviceMap.get(e)}switchActiveDevice(e,t){return S(this,arguments,void 0,function(r,i){var A=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function*(){var o,a,c,u,l,d,h,f;let p=!0,g=!1;const v=s?{exact:i}:i;if(r==="audioinput"){g=A.localParticipant.audioTrackPublications.size===0;const y=(o=A.getActiveDevice(r))!==null&&o!==void 0?o:A.options.audioCaptureDefaults.deviceId;A.options.audioCaptureDefaults.deviceId=v;const B=Array.from(A.localParticipant.audioTrackPublications.values()).filter(b=>b.source===P.Source.Microphone);try{p=(yield Promise.all(B.map(b=>{var w;return(w=b.audioTrack)===null||w===void 0?void 0:w.setDeviceId(v)}))).every(b=>b===!0)}catch(b){throw A.options.audioCaptureDefaults.deviceId=y,b}}else if(r==="videoinput"){g=A.localParticipant.videoTrackPublications.size===0;const y=(a=A.getActiveDevice(r))!==null&&a!==void 0?a:A.options.videoCaptureDefaults.deviceId;A.options.videoCaptureDefaults.deviceId=v;const B=Array.from(A.localParticipant.videoTrackPublications.values()).filter(b=>b.source===P.Source.Camera);try{p=(yield Promise.all(B.map(b=>{var w;return(w=b.videoTrack)===null||w===void 0?void 0:w.setDeviceId(v)}))).every(b=>b===!0)}catch(b){throw A.options.videoCaptureDefaults.deviceId=y,b}}else if(r==="audiooutput"){if(!xl()&&!A.options.webAudioMix||A.options.webAudioMix&&A.audioContext&&!("setSinkId"in A.audioContext))throw new Error("cannot switch audio output, setSinkId not supported");A.options.webAudioMix&&(i=(c=yield ft.getInstance().normalizeDeviceId("audiooutput",i))!==null&&c!==void 0?c:""),(u=(f=A.options).audioOutput)!==null&&u!==void 0||(f.audioOutput={});const y=(l=A.getActiveDevice(r))!==null&&l!==void 0?l:A.options.audioOutput.deviceId;A.options.audioOutput.deviceId=i;try{A.options.webAudioMix&&((d=A.audioContext)===null||d===void 0||d.setSinkId(i)),yield Promise.all(Array.from(A.remoteParticipants.values()).map(B=>B.setAudioOutput({deviceId:i})))}catch(B){throw A.options.audioOutput.deviceId=y,B}}return(g||r==="audiooutput")&&(A.localParticipant.activeDeviceMap.set(r,r==="audiooutput"&&((h=A.options.audioOutput)===null||h===void 0?void 0:h.deviceId)||i),A.emit(O.ActiveDeviceChanged,r,i)),p}()})}setupLocalParticipantEvents(){this.localParticipant.on(K.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(K.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(K.AttributesChanged,this.onLocalAttributesChanged).on(K.TrackMuted,this.onLocalTrackMuted).on(K.TrackUnmuted,this.onLocalTrackUnmuted).on(K.LocalTrackPublished,this.onLocalTrackPublished).on(K.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(K.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(K.MediaDevicesError,this.onMediaDevicesError).on(K.AudioStreamAcquired,this.startAudio).on(K.ChatMessage,this.onLocalChatMessageSent).on(K.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}recreateEngine(){var e;(e=this.engine)===null||e===void 0||e.close(),this.engine=void 0,this.isResuming=!1,this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.bufferedEvents=[],this.maybeCreateEngine()}onTrackAdded(e,t,r){if(this.state===fe.Connecting||this.state===fe.Reconnecting){const u=()=>{this.onTrackAdded(e,t,r),l()},l=()=>{this.off(O.Reconnected,u),this.off(O.Connected,u),this.off(O.Disconnected,l)};this.once(O.Reconnected,u),this.once(O.Connected,u),this.once(O.Disconnected,l);return}if(this.state===fe.Disconnected){this.log.warn("skipping incoming track after Room disconnected",this.logContext);return}if(e.readyState==="ended"){this.log.info("skipping incoming track as it already ended",this.logContext);return}const i=xF(t.id),A=i[0];let s=i[1],o=e.id;if(s&&s.startsWith("TR")&&(o=s),A===this.localParticipant.sid){this.log.warn("tried to create RemoteParticipant for local participant",this.logContext);return}const a=Array.from(this.remoteParticipants.values()).find(u=>u.sid===A);if(!a){this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(A),this.logContext);return}let c;this.options.adaptiveStream&&(typeof this.options.adaptiveStream=="object"?c=this.options.adaptiveStream:c={}),a.addSubscribedMediaTrack(e,o,t,r,c)}handleDisconnect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1?arguments[1]:void 0;var r;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.state!==fe.Disconnected){this.regionUrl=void 0;try{this.remoteParticipants.forEach(i=>{i.trackPublications.forEach(A=>{i.unpublishTrack(A.trackSid)})}),this.localParticipant.trackPublications.forEach(i=>{var A,s,o;i.track&&this.localParticipant.unpublishTrack(i.track,e),e?((A=i.track)===null||A===void 0||A.detach(),(s=i.track)===null||s===void 0||s.stop()):(o=i.track)===null||o===void 0||o.stopMonitor()}),this.localParticipant.off(K.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(K.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(K.AttributesChanged,this.onLocalAttributesChanged).off(K.TrackMuted,this.onLocalTrackMuted).off(K.TrackUnmuted,this.onLocalTrackUnmuted).off(K.LocalTrackPublished,this.onLocalTrackPublished).off(K.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(K.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(K.MediaDevicesError,this.onMediaDevicesError).off(K.AudioStreamAcquired,this.startAudio).off(K.ChatMessage,this.onLocalChatMessageSent).off(K.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.trackPublications.clear(),this.localParticipant.videoTrackPublications.clear(),this.localParticipant.audioTrackPublications.clear(),this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.activeSpeakers=[],this.audioContext&&typeof this.options.webAudioMix=="boolean"&&(this.audioContext.close(),this.audioContext=void 0),Ht()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),(r=navigator.mediaDevices)===null||r===void 0||r.removeEventListener("devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(fe.Disconnected),this.emit(O.Disconnected,t)}}}handleParticipantDisconnected(e,t){var r;this.remoteParticipants.delete(e),t&&(t.trackPublications.forEach(i=>{t.unpublishTrack(i.trackSid,!0)}),this.emit(O.ParticipantDisconnected,t),t.setDisconnected(),(r=this.localParticipant)===null||r===void 0||r.handleParticipantDisconnected(t.identity))}handleStreamHeader(e,t){return S(this,void 0,void 0,function*(){var r;if(e.contentHeader.case==="byteHeader"){const i=this.byteStreamHandlers.get(e.topic);if(!i){this.log.debug("ignoring incoming byte stream due to no handler for topic",e.topic);return}let A;const s={id:e.streamId,name:(r=e.contentHeader.value.name)!==null&&r!==void 0?r:"unknown",mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:ia(e.timestamp),attributes:e.attributes},o=new ReadableStream({start:a=>{A=a,this.byteStreamControllers.set(e.streamId,{info:s,controller:A,startTime:Date.now()})}});i(new Px(s,o,ia(e.totalLength)),{identity:t})}else if(e.contentHeader.case==="textHeader"){const i=this.textStreamHandlers.get(e.topic);if(!i){this.log.debug("ignoring incoming text stream due to no handler for topic",e.topic);return}let A;const s={id:e.streamId,mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Number(e.timestamp),attributes:e.attributes},o=new ReadableStream({start:a=>{A=a,this.textStreamControllers.set(e.streamId,{info:s,controller:A,startTime:Date.now()})}});i(new Ox(s,o,ia(e.totalLength)),{identity:t})}})}handleStreamChunk(e){const t=this.byteStreamControllers.get(e.streamId);t&&e.content.length>0&&t.controller.enqueue(e);const r=this.textStreamControllers.get(e.streamId);r&&e.content.length>0&&r.controller.enqueue(e)}handleStreamTrailer(e){const t=this.textStreamControllers.get(e.streamId);t&&(t.info.attributes=Object.assign(Object.assign({},t.info.attributes),e.attributes),t.controller.close(),this.textStreamControllers.delete(e.streamId));const r=this.byteStreamControllers.get(e.streamId);r&&(r.info.attributes=Object.assign(Object.assign({},r.info.attributes),e.attributes),r.controller.close(),this.byteStreamControllers.delete(e.streamId))}acquireAudioContext(){return S(this,void 0,void 0,function*(){var e,t;if(typeof this.options.webAudioMix!="boolean"&&this.options.webAudioMix.audioContext?this.audioContext=this.options.webAudioMix.audioContext:(!this.audioContext||this.audioContext.state==="closed")&&(this.audioContext=(e=A0())!==null&&e!==void 0?e:void 0),this.options.webAudioMix&&this.remoteParticipants.forEach(i=>i.setAudioContext(this.audioContext)),this.localParticipant.setAudioContext(this.audioContext),this.audioContext&&this.audioContext.state==="suspended")try{yield Promise.race([this.audioContext.resume(),Nt(200)])}catch(i){this.log.warn("Could not resume audio context",Object.assign(Object.assign({},this.logContext),{error:i}))}const r=((t=this.audioContext)===null||t===void 0?void 0:t.state)==="running";r!==this.canPlaybackAudio&&(this.audioEnabled=r,this.emit(O.AudioPlaybackStatusChanged,r))})}createParticipant(e,t){var r;let i;return t?i=da.fromParticipantInfo(this.engine.client,t,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}):i=new da(this.engine.client,"",e,void 0,void 0,void 0,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}),this.options.webAudioMix&&i.setAudioContext(this.audioContext),!((r=this.options.audioOutput)===null||r===void 0)&&r.deviceId&&i.setAudioOutput(this.options.audioOutput).catch(A=>this.log.warn("Could not set audio output: ".concat(A.message),this.logContext)),i}getOrCreateParticipant(e,t){if(this.remoteParticipants.has(e)){const i=this.remoteParticipants.get(e);return t&&i.updateInfo(t)&&this.sidToIdentity.set(t.sid,t.identity),i}const r=this.createParticipant(e,t);return this.remoteParticipants.set(e,r),this.sidToIdentity.set(t.sid,t.identity),this.emitWhenConnected(O.ParticipantConnected,r),r.on(K.TrackPublished,i=>{this.emitWhenConnected(O.TrackPublished,i,r)}).on(K.TrackSubscribed,(i,A)=>{i.kind===P.Kind.Audio?(i.on(L.AudioPlaybackStarted,this.handleAudioPlaybackStarted),i.on(L.AudioPlaybackFailed,this.handleAudioPlaybackFailed)):i.kind===P.Kind.Video&&(i.on(L.VideoPlaybackFailed,this.handleVideoPlaybackFailed),i.on(L.VideoPlaybackStarted,this.handleVideoPlaybackStarted)),this.emit(O.TrackSubscribed,i,A,r)}).on(K.TrackUnpublished,i=>{this.emit(O.TrackUnpublished,i,r)}).on(K.TrackUnsubscribed,(i,A)=>{this.emit(O.TrackUnsubscribed,i,A,r)}).on(K.TrackMuted,i=>{this.emitWhenConnected(O.TrackMuted,i,r)}).on(K.TrackUnmuted,i=>{this.emitWhenConnected(O.TrackUnmuted,i,r)}).on(K.ParticipantMetadataChanged,i=>{this.emitWhenConnected(O.ParticipantMetadataChanged,i,r)}).on(K.ParticipantNameChanged,i=>{this.emitWhenConnected(O.ParticipantNameChanged,i,r)}).on(K.AttributesChanged,i=>{this.emitWhenConnected(O.ParticipantAttributesChanged,i,r)}).on(K.ConnectionQualityChanged,i=>{this.emitWhenConnected(O.ConnectionQualityChanged,i,r)}).on(K.ParticipantPermissionsChanged,i=>{this.emitWhenConnected(O.ParticipantPermissionsChanged,i,r)}).on(K.TrackSubscriptionStatusChanged,(i,A)=>{this.emitWhenConnected(O.TrackSubscriptionStatusChanged,i,A,r)}).on(K.TrackSubscriptionFailed,(i,A)=>{this.emit(O.TrackSubscriptionFailed,i,r,A)}).on(K.TrackSubscriptionPermissionChanged,(i,A)=>{this.emitWhenConnected(O.TrackSubscriptionPermissionChanged,i,A,r)}).on(K.Active,()=>{this.emitWhenConnected(O.ParticipantActive,r)}),t&&r.updateInfo(t),r}sendSyncState(){const e=Array.from(this.remoteParticipants.values()).reduce((r,i)=>(r.push(...i.getTrackPublications()),r),[]),t=this.localParticipant.getTrackPublications();this.engine.sendSyncState(e,t)}updateSubscriptions(){for(const e of this.remoteParticipants.values())for(const t of e.videoTrackPublications.values())t.isSubscribed&&jF(t)&&t.emitTrackUpdate()}getRemoteParticipantBySid(e){const t=this.sidToIdentity.get(e);if(t)return this.remoteParticipants.get(t)}registerConnectionReconcile(){this.clearConnectionReconcile();let e=0;this.connectionReconcileInterval=wt.setInterval(()=>{!this.engine||this.engine.isClosed||!this.engine.verifyTransport()?(e++,this.log.warn("detected connection state mismatch",Object.assign(Object.assign({},this.logContext),{numFailures:e,engine:this.engine?{closed:this.engine.isClosed,transportsConnected:this.engine.verifyTransport()}:void 0})),e>=3&&(this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,sn.STATE_MISMATCH))):e=0},Jx)}clearConnectionReconcile(){this.connectionReconcileInterval&&wt.clearInterval(this.connectionReconcileInterval)}setAndEmitConnectionState(e){return e===this.state?!1:(this.state=e,this.emit(O.ConnectionStateChanged,this.state),!0)}emitBufferedEvents(){this.bufferedEvents.forEach(e=>{let[t,r]=e;this.emit(t,...r)}),this.bufferedEvents=[]}emitWhenConnected(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(this.state===fe.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([e,r]);else if(this.state===fe.Connected)return this.emit(e,...r);return!1}simulateParticipants(e){return S(this,void 0,void 0,function*(){var t,r;const i=Object.assign({audio:!0,video:!0,useRealTracks:!1},e.publish),A=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},e.participants);if(this.handleDisconnect(),this.roomInfo=new Ho({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:Ke.parse(new Date().getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new Kr({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(O.SignalConnected),this.emit(O.Connected),this.setAndEmitConnectionState(fe.Connected),i.video){const s=new od(P.Kind.Video,new Ui({source:at.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:An.AUDIO,name:"video-dummy"}),new ua(i.useRealTracks?(yield window.navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0]:t0(160*((t=A.aspectRatios[0])!==null&&t!==void 0?t:1),160,!0,!0),void 0,!1,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(s),this.localParticipant.emit(K.LocalTrackPublished,s)}if(i.audio){const s=new od(P.Kind.Audio,new Ui({source:at.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:An.AUDIO}),new aa(i.useRealTracks?(yield navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0]:Ol(),void 0,!1,this.audioContext,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(s),this.localParticipant.emit(K.LocalTrackPublished,s)}for(let s=0;s<A.count-1;s+=1){let o=new Kr({sid:Math.floor(Math.random()*1e4).toString(),identity:"simulated-".concat(s),state:Ei.ACTIVE,tracks:[],joinedAt:Ke.parse(Date.now())});const a=this.getOrCreateParticipant(o.identity,o);if(A.video){const c=t0(160*((r=A.aspectRatios[s%A.aspectRatios.length])!==null&&r!==void 0?r:1),160,!1,!0),u=new Ui({source:at.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:An.AUDIO});a.addSubscribedMediaTrack(c,u.sid,new MediaStream([c]),new RTCRtpReceiver),o.tracks=[...o.tracks,u]}if(A.audio){const c=Ol(),u=new Ui({source:at.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:An.AUDIO});a.addSubscribedMediaTrack(c,u.sid,new MediaStream([c]),new RTCRtpReceiver),o.tracks=[...o.tracks,u]}a.updateInfo(o)}})}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(e!==O.ActiveSpeakersChanged&&e!==O.TranscriptionReceived){const A=R0(r).filter(s=>s!==void 0);this.log.debug("room event ".concat(e),Object.assign(Object.assign({},this.logContext),{event:e,args:A}))}return super.emit(e,...r)}}Li.cleanupRegistry=typeof FinalizationRegistry<"u"&&new FinalizationRegistry(n=>{n()});function R0(n){return n.map(e=>{if(e)return Array.isArray(e)?R0(e):typeof e=="object"?"logContext"in e?e.logContext:void 0:e})}var hn;(function(n){n[n.IDLE=0]="IDLE",n[n.RUNNING=1]="RUNNING",n[n.SKIPPED=2]="SKIPPED",n[n.SUCCESS=3]="SUCCESS",n[n.FAILED=4]="FAILED"})(hn||(hn={}));class yr extends Sn.EventEmitter{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.status=hn.IDLE,this.logs=[],this.options={},this.url=e,this.token=t,this.name=this.constructor.name,this.room=new Li(r.roomOptions),this.connectOptions=r.connectOptions,this.options=r}run(e){return S(this,void 0,void 0,function*(){if(this.status!==hn.IDLE)throw Error("check is running already");this.setStatus(hn.RUNNING);try{yield this.perform()}catch(t){t instanceof Error&&(this.options.errorsAsWarnings?this.appendWarning(t.message):this.appendError(t.message))}return yield this.disconnect(),yield new Promise(t=>setTimeout(t,500)),this.status!==hn.SKIPPED&&this.setStatus(this.isSuccess()?hn.SUCCESS:hn.FAILED),e&&e(),this.getInfo()})}isSuccess(){return!this.logs.some(e=>e.level==="error")}connect(e){return S(this,void 0,void 0,function*(){return this.room.state===fe.Connected?this.room:(e||(e=this.url),yield this.room.connect(e,this.token,this.connectOptions),this.room)})}disconnect(){return S(this,void 0,void 0,function*(){this.room&&this.room.state!==fe.Disconnected&&(yield this.room.disconnect(),yield new Promise(e=>setTimeout(e,500)))})}skip(){this.setStatus(hn.SKIPPED)}switchProtocol(e){return S(this,void 0,void 0,function*(){let t=!1,r=!1;if(this.room.on(O.Reconnecting,()=>{t=!0}),this.room.once(O.Reconnected,()=>{r=!0}),this.room.simulateScenario("force-".concat(e)),yield new Promise(A=>setTimeout(A,1e3)),!t)return;const i=Date.now()+1e4;for(;Date.now()<i;){if(r)return;yield Nt(100)}throw new Error("Could not reconnect using ".concat(e," protocol after 10 seconds"))})}appendMessage(e){this.logs.push({level:"info",message:e}),this.emit("update",this.getInfo())}appendWarning(e){this.logs.push({level:"warning",message:e}),this.emit("update",this.getInfo())}appendError(e){this.logs.push({level:"error",message:e}),this.emit("update",this.getInfo())}setStatus(e){this.status=e,this.emit("update",this.getInfo())}get engine(){var e;return(e=this.room)===null||e===void 0?void 0:e.engine}getInfo(){return{logs:this.logs,name:this.name,status:this.status,description:this.description}}}class zx extends yr{get description(){return"Cloud regions"}perform(){return S(this,void 0,void 0,function*(){const e=new id(this.url,this.token);if(!e.isCloud()){this.skip();return}const t=[],r=new Set;for(let A=0;A<3;A++){const s=yield e.getNextBestRegionUrl();if(!s)break;if(r.has(s))continue;r.add(s);const o=yield this.checkCloudRegion(s);this.appendMessage("".concat(o.region," RTT: ").concat(o.rtt,"ms, duration: ").concat(o.duration,"ms")),t.push(o)}t.sort((A,s)=>(A.duration-s.duration)*.5+(A.rtt-s.rtt)*.5);const i=t[0];this.bestStats=i,this.appendMessage("best Cloud region: ".concat(i.region))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkCloudRegion(e){return S(this,void 0,void 0,function*(){var t,r;yield this.connect(e),this.options.protocol==="tcp"&&(yield this.switchProtocol("tcp"));const i=(t=this.room.serverInfo)===null||t===void 0?void 0:t.region;if(!i)throw new Error("Region not found");const A=yield this.room.localParticipant.streamText({topic:"test"}),s=1e3,a=1e6/s,c="A".repeat(s),u=Date.now();for(let f=0;f<a;f++)yield A.write(c);yield A.close();const l=Date.now(),d=yield(r=this.room.engine.pcManager)===null||r===void 0?void 0:r.publisher.getStats(),h={region:i,rtt:1e4,duration:l-u};return d==null||d.forEach(f=>{f.type==="candidate-pair"&&f.nominated&&(h.rtt=f.currentRoundTripTime*1e3)}),yield this.disconnect(),h})}}const ad=1e4;class Xx extends yr{get description(){return"Connection via UDP vs TCP"}perform(){return S(this,void 0,void 0,function*(){const e=yield this.checkConnectionProtocol("udp"),t=yield this.checkConnectionProtocol("tcp");this.bestStats=e,e.qualityLimitationDurations.bandwidth-t.qualityLimitationDurations.bandwidth>.5||(e.packetsLost-t.packetsLost)/e.packetsSent>.01?(this.appendMessage("best connection quality via tcp"),this.bestStats=t):this.appendMessage("best connection quality via udp");const r=this.bestStats;this.appendMessage("upstream bitrate: ".concat((r.bitrateTotal/r.count/1e3/1e3).toFixed(2)," mbps")),this.appendMessage("RTT: ".concat((r.rttTotal/r.count*1e3).toFixed(2)," ms")),this.appendMessage("jitter: ".concat((r.jitterTotal/r.count*1e3).toFixed(2)," ms")),r.packetsLost>0&&this.appendWarning("packets lost: ".concat((r.packetsLost/r.packetsSent*100).toFixed(2),"%")),r.qualityLimitationDurations.bandwidth>1&&this.appendWarning("bandwidth limited ".concat((r.qualityLimitationDurations.bandwidth/(ad/1e3)*100).toFixed(2),"%")),r.qualityLimitationDurations.cpu>0&&this.appendWarning("cpu limited ".concat((r.qualityLimitationDurations.cpu/(ad/1e3)*100).toFixed(2),"%"))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkConnectionProtocol(e){return S(this,void 0,void 0,function*(){yield this.connect(),e==="tcp"?yield this.switchProtocol("tcp"):yield this.switchProtocol("udp");const t=document.createElement("canvas");t.width=1280,t.height=720;const r=t.getContext("2d");if(!r)throw new Error("Could not get canvas context");let i=0;const A=()=>{i=(i+1)%360,r.fillStyle="hsl(".concat(i,", 100%, 50%)"),r.fillRect(0,0,t.width,t.height),requestAnimationFrame(A)};A();const o=t.captureStream(30).getVideoTracks()[0],c=(yield this.room.localParticipant.publishTrack(o,{simulcast:!1,degradationPreference:"maintain-resolution",videoEncoding:{maxBitrate:2e6}})).track,u={protocol:e,packetsLost:0,packetsSent:0,qualityLimitationDurations:{},rttTotal:0,jitterTotal:0,bitrateTotal:0,count:0},l=setInterval(()=>S(this,void 0,void 0,function*(){const d=yield c.getRTCStatsReport();d==null||d.forEach(h=>{h.type==="outbound-rtp"?(u.packetsSent=h.packetsSent,u.qualityLimitationDurations=h.qualityLimitationDurations,u.bitrateTotal+=h.targetBitrate,u.count++):h.type==="remote-inbound-rtp"&&(u.packetsLost=h.packetsLost,u.rttTotal+=h.roundTripTime,u.jitterTotal+=h.jitter)})}),1e3);return yield new Promise(d=>setTimeout(d,ad)),clearInterval(l),o.stop(),t.remove(),yield this.disconnect(),u})}}class Yx extends yr{get description(){return"Can publish audio"}perform(){return S(this,void 0,void 0,function*(){var e;const t=yield this.connect(),r=yield Vx();if(yield i0(r,1e3))throw new Error("unable to detect audio from microphone");this.appendMessage("detected audio from microphone"),t.localParticipant.publishTrack(r),yield new Promise(o=>setTimeout(o,3e3));const A=yield(e=r.sender)===null||e===void 0?void 0:e.getStats();if(!A)throw new Error("Could not get RTCStats");let s=0;if(A.forEach(o=>{o.type==="outbound-rtp"&&(o.kind==="audio"||!o.kind&&o.mediaType==="audio")&&(s=o.packetsSent)}),s===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(s," audio packets"))})}}class Zx extends yr{get description(){return"Can publish video"}perform(){return S(this,void 0,void 0,function*(){var e;const t=yield this.connect(),r=yield Kx();yield this.checkForVideo(r.mediaStreamTrack),t.localParticipant.publishTrack(r),yield new Promise(s=>setTimeout(s,5e3));const i=yield(e=r.sender)===null||e===void 0?void 0:e.getStats();if(!i)throw new Error("Could not get RTCStats");let A=0;if(i.forEach(s=>{s.type==="outbound-rtp"&&(s.kind==="video"||!s.kind&&s.mediaType==="video")&&(A+=s.packetsSent)}),A===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(A," video packets"))})}checkForVideo(e){return S(this,void 0,void 0,function*(){const t=new MediaStream;t.addTrack(e.clone());const r=document.createElement("video");r.srcObject=t,r.muted=!0,yield new Promise(i=>{r.onplay=()=>{setTimeout(()=>{var A,s,o,a;const c=document.createElement("canvas"),u=e.getSettings(),l=(s=(A=u.width)!==null&&A!==void 0?A:r.videoWidth)!==null&&s!==void 0?s:1280,d=(a=(o=u.height)!==null&&o!==void 0?o:r.videoHeight)!==null&&a!==void 0?a:720;c.width=l,c.height=d;const h=c.getContext("2d");h.drawImage(r,0,0);const p=h.getImageData(0,0,c.width,c.height).data;let g=!0;for(let v=0;v<p.length;v+=4)if(p[v]!==0||p[v+1]!==0||p[v+2]!==0){g=!1;break}g?this.appendError("camera appears to be producing only black frames"):this.appendMessage("received video frames"),i()},1e3)},r.play()}),r.remove()})}}class $x extends yr{get description(){return"Resuming connection after interruption"}perform(){return S(this,void 0,void 0,function*(){var e;const t=yield this.connect();let r=!1,i=!1,A;const s=new Promise(c=>{setTimeout(c,5e3),A=c}),o=()=>{r=!0};t.on(O.SignalReconnecting,o).on(O.Reconnecting,o).on(O.Reconnected,()=>{i=!0,A(!0)}),(e=t.engine.client.ws)===null||e===void 0||e.close();const a=t.engine.client.onClose;if(a&&a(""),yield s,r){if(!i||t.state!==fe.Connected)throw this.appendWarning("reconnection is only possible in Redis-based configurations"),new Error("Not able to reconnect")}else throw new Error("Did not attempt to reconnect")})}}class eQ extends yr{get description(){return"Can connect via TURN"}perform(){return S(this,void 0,void 0,function*(){var e,t;const r=new Gl,i=yield r.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3});let A=!1,s=!1,o=!1;for(let a of i.iceServers)for(let c of a.urls)c.startsWith("turn:")?(s=!0,o=!0):c.startsWith("turns:")&&(s=!0,o=!0,A=!0),c.startsWith("stun:")&&(o=!0);o?s&&!A&&this.appendWarning("TURN is configured server side, but TURN/TLS is unavailable."):this.appendWarning("No STUN servers configured on server side."),yield r.close(),!((t=(e=this.connectOptions)===null||e===void 0?void 0:e.rtcConfig)===null||t===void 0)&&t.iceServers||s?yield this.room.connect(this.url,this.token,{rtcConfig:{iceTransportPolicy:"relay"}}):(this.appendWarning("No TURN servers configured."),this.skip(),yield new Promise(a=>setTimeout(a,0)))})}}class tQ extends yr{get description(){return"Establishing WebRTC connection"}perform(){return S(this,void 0,void 0,function*(){let e=!1,t=!1;this.room.on(O.SignalConnected,()=>{const r=this.room.engine.client.onTrickle;this.room.engine.client.onTrickle=(i,A)=>{if(i.candidate){const s=new RTCIceCandidate(i);let o="".concat(s.protocol," ").concat(s.address,":").concat(s.port," ").concat(s.type);s.address&&(nQ(s.address)?o+=" (private)":s.protocol==="tcp"&&s.tcpType==="passive"?(e=!0,o+=" (passive)"):s.protocol==="udp"&&(t=!0)),this.appendMessage(o)}r&&r(i,A)},this.room.engine.pcManager&&(this.room.engine.pcManager.subscriber.onIceCandidateError=i=>{i instanceof RTCPeerConnectionIceErrorEvent&&this.appendWarning("error with ICE candidate: ".concat(i.errorCode," ").concat(i.errorText," ").concat(i.url))})});try{yield this.connect(),ue.info("now the room is connected")}catch(r){throw this.appendWarning("ports need to be open on firewall in order to connect."),r}e||this.appendWarning("Server is not configured for ICE/TCP"),t||this.appendWarning("No public IPv4 UDP candidates were found. Your server is likely not configured correctly")})}}function nQ(n){const e=n.split(".");if(e.length===4){if(e[0]==="10")return!0;if(e[0]==="192"&&e[1]==="168")return!0;if(e[0]==="172"){const t=parseInt(e[1],10);if(t>=16&&t<=31)return!0}}return!1}class rQ extends yr{get description(){return"Connecting to signal connection via WebSocket"}perform(){return S(this,void 0,void 0,function*(){var e,t,r;(this.url.startsWith("ws:")||this.url.startsWith("http:"))&&this.appendWarning("Server is insecure, clients may block connections to it");let i=new Gl;const A=yield i.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3});this.appendMessage("Connected to server, version ".concat(A.serverVersion,".")),((e=A.serverInfo)===null||e===void 0?void 0:e.edition)===Mm.Cloud&&(!((t=A.serverInfo)===null||t===void 0)&&t.region)&&this.appendMessage("LiveKit Cloud: ".concat((r=A.serverInfo)===null||r===void 0?void 0:r.region)),yield i.close()})}}class x4 extends Sn.EventEmitter{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.options={},this.checkResults=new Map,this.url=e,this.token=t,this.options=r}getNextCheckId(){const e=this.checkResults.size;return this.checkResults.set(e,{logs:[],status:hn.IDLE,name:"",description:""}),e}updateCheck(e,t){this.checkResults.set(e,t),this.emit("checkUpdate",e,t)}isSuccess(){return Array.from(this.checkResults.values()).every(e=>e.status!==hn.FAILED)}getResults(){return Array.from(this.checkResults.values())}createAndRunCheck(e){return S(this,void 0,void 0,function*(){const t=this.getNextCheckId(),r=new e(this.url,this.token,this.options),i=s=>{this.updateCheck(t,s)};r.on("update",i);const A=yield r.run();return r.off("update",i),A})}checkWebsocket(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(rQ)})}checkWebRTC(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(tQ)})}checkTURN(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(eQ)})}checkReconnect(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck($x)})}checkPublishAudio(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(Yx)})}checkPublishVideo(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(Zx)})}checkConnectionProtocol(){return S(this,void 0,void 0,function*(){const e=yield this.createAndRunCheck(Xx);if(e.data&&"protocol"in e.data){const t=e.data;this.options.protocol=t.protocol}return e})}checkCloudRegion(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(zx)})}}const iQ=/\{[^{}]+\}/g;function AQ(){return Math.random().toString(36).slice(2,11)}function sQ(n){let{baseUrl:e="",Request:t=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:A,headers:s,...o}={...n};e=L0(e);const a=[];async function c(u,l){const{baseUrl:d,fetch:h=r,Request:f=t,headers:p,params:g={},parseAs:v="json",querySerializer:y,bodySerializer:B=A??aQ,body:b,...w}=l||{};d&&(e=L0(d));let _=typeof i=="function"?i:M0(i);y&&(_=typeof y=="function"?y:M0({...typeof i=="object"?i:{},...y}));const k=b===void 0?void 0:B(b),F=k===void 0||k instanceof FormData?{}:{"Content-Type":"application/json"},x={redirect:"follow",...o,...w,body:k,headers:uQ(F,s,p,g.header)};let E,T,Q=new t(cQ(u,{baseUrl:e,params:g,querySerializer:_}),x);for(const H in w)H in Q||(Q[H]=w[H]);if(a.length){E=AQ(),T=Object.freeze({baseUrl:e,fetch:h,parseAs:v,querySerializer:_,bodySerializer:B});for(const H of a)if(H&&typeof H=="object"&&typeof H.onRequest=="function"){const q=await H.onRequest({request:Q,schemaPath:u,params:g,options:T,id:E});if(q){if(!(q instanceof t))throw new Error("onRequest: must return new Request() when modifying the request");Q=q}}}let M=await h(Q);if(a.length)for(let H=a.length-1;H>=0;H--){const q=a[H];if(q&&typeof q=="object"&&typeof q.onResponse=="function"){const ve=await q.onResponse({request:Q,response:M,schemaPath:u,params:g,options:T,id:E});if(ve){if(!(ve instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");M=ve}}}if(M.status===204||M.headers.get("Content-Length")==="0")return M.ok?{data:{},response:M}:{error:{},response:M};if(M.ok)return v==="stream"?{data:M.body,response:M}:{data:await M[v](),response:M};let X=await M.text();try{X=JSON.parse(X)}catch{}return{error:X,response:M}}return{GET(u,l){return c(u,{...l,method:"GET"})},PUT(u,l){return c(u,{...l,method:"PUT"})},POST(u,l){return c(u,{...l,method:"POST"})},DELETE(u,l){return c(u,{...l,method:"DELETE"})},OPTIONS(u,l){return c(u,{...l,method:"OPTIONS"})},HEAD(u,l){return c(u,{...l,method:"HEAD"})},PATCH(u,l){return c(u,{...l,method:"PATCH"})},TRACE(u,l){return c(u,{...l,method:"TRACE"})},use(...u){for(const l of u)if(l){if(typeof l!="object"||!("onRequest"in l||"onResponse"in l))throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");a.push(l)}},eject(...u){for(const l of u){const d=a.indexOf(l);d!==-1&&a.splice(d,1)}}}}function ha(n,e,t){if(e==null)return"";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${n}=${(t==null?void 0:t.allowReserved)===!0?e:encodeURIComponent(e)}`}function P0(n,e,t){if(!e||typeof e!="object")return"";const r=[],i={simple:",",label:".",matrix:";"}[t.style]||"&";if(t.style!=="deepObject"&&t.explode===!1){for(const o in e)r.push(o,t.allowReserved===!0?e[o]:encodeURIComponent(e[o]));const s=r.join(",");switch(t.style){case"form":return`${n}=${s}`;case"label":return`.${s}`;case"matrix":return`;${n}=${s}`;default:return s}}for(const s in e){const o=t.style==="deepObject"?`${n}[${s}]`:s;r.push(ha(o,e[s],t))}const A=r.join(i);return t.style==="label"||t.style==="matrix"?`${i}${A}`:A}function O0(n,e,t){if(!Array.isArray(e))return"";if(t.explode===!1){const A={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[t.style]||",",s=(t.allowReserved===!0?e:e.map(o=>encodeURIComponent(o))).join(A);switch(t.style){case"simple":return s;case"label":return`.${s}`;case"matrix":return`;${n}=${s}`;default:return`${n}=${s}`}}const r={simple:",",label:".",matrix:";"}[t.style]||"&",i=[];for(const A of e)t.style==="simple"||t.style==="label"?i.push(t.allowReserved===!0?A:encodeURIComponent(A)):i.push(ha(n,A,t));return t.style==="label"||t.style==="matrix"?`${r}${i.join(r)}`:i.join(r)}function M0(n){return function(t){const r=[];if(t&&typeof t=="object")for(const i in t){const A=t[i];if(A!=null){if(Array.isArray(A)){if(A.length===0)continue;r.push(O0(i,A,{style:"form",explode:!0,...n==null?void 0:n.array,allowReserved:(n==null?void 0:n.allowReserved)||!1}));continue}if(typeof A=="object"){r.push(P0(i,A,{style:"deepObject",explode:!0,...n==null?void 0:n.object,allowReserved:(n==null?void 0:n.allowReserved)||!1}));continue}r.push(ha(i,A,n))}}return r.join("&")}}function oQ(n,e){let t=n;for(const r of n.match(iQ)??[]){let i=r.substring(1,r.length-1),A=!1,s="simple";if(i.endsWith("*")&&(A=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(s="label",i=i.substring(1)):i.startsWith(";")&&(s="matrix",i=i.substring(1)),!e||e[i]===void 0||e[i]===null)continue;const o=e[i];if(Array.isArray(o)){t=t.replace(r,O0(i,o,{style:s,explode:A}));continue}if(typeof o=="object"){t=t.replace(r,P0(i,o,{style:s,explode:A}));continue}if(s==="matrix"){t=t.replace(r,`;${ha(i,o)}`);continue}t=t.replace(r,s==="label"?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return t}function aQ(n){return n instanceof FormData?n:JSON.stringify(n)}function cQ(n,e){var i;let t=`${e.baseUrl}${n}`;(i=e.params)!=null&&i.path&&(t=oQ(t,e.params.path));let r=e.querySerializer(e.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(t+=`?${r}`),t}function uQ(...n){const e=new Headers;for(const t of n){if(!t||typeof t!="object")continue;const r=t instanceof Headers?t.entries():Object.entries(t);for(const[i,A]of r)if(A===null)e.delete(i);else if(Array.isArray(A))for(const s of A)e.append(i,s);else A!==void 0&&e.set(i,A)}return e}function L0(n){return n.endsWith("/")?n.substring(0,n.length-1):n}const D0="Onboardee-Session-Token",N0="OnboardeeSessionToken";class H0{constructor(e){this.client=sQ({baseUrl:e.baseUrl,headers:e.headers,fetch:e.fetch}),this.client.use({onRequest({request:t}){if(window.localStorage){const r=window.localStorage.getItem(N0);r&&t.headers.set(D0,r)}return t},onResponse({response:t}){const r=t.headers.get(D0);return r&&window.localStorage&&window.localStorage.setItem(N0,r),t}})}setAuthToken(e){this.client.use({onRequest({request:t}){return t.headers.set("Authorization",`Bearer ${e}`),t}})}setApiToken(e){this.client.use({onRequest({request:t}){return t.headers.set("Authorization",`Token ${e}`),t}})}async getAuthUrl(e){return await this.client.GET("/api/auth/{type}",{params:{path:{type:e}}})}async getConnectUrl(e){return await this.client.GET("/api/connect/{type}",{params:{path:{type:e}}})}async logout(){return await this.client.POST("/api/logout")}async getCurrentUser(){return await this.client.GET("/api/me")}async clientInitialise(e,t={}){return await this.client.POST("/api/client/{appToken}/initialise",{params:{path:{appToken:e}},body:t})}async clientStartSession(e,t){return await this.client.POST("/api/client/{appToken}/start-session",{params:{path:{appToken:e}},body:t})}async createPresignedUploadUrl(e){return await this.client.POST("/api/files",{body:e})}async createKnowledgeBlock(e){return await this.client.POST("/api/knowledge",{body:e})}async listOnboardees(){return await this.client.GET("/api/onboardees")}async getOnboardee(e){return await this.client.GET("/api/onboardees/{id}",{params:{path:{id:e}}})}async getOnboardeeWidgetConfig(e,t){return await this.client.GET("/api/onboardees/{id}/config",{params:{path:{id:e}},signal:t})}async listPlans(e){return await this.client.GET("/api/plans",{params:{query:{...e&&{client_type:e}}}})}async listPlansWithStatus(){return await this.client.GET("/api/plans-with-status")}async listProducts(){return await this.client.GET("/api/products")}async getProduct(e){return await this.client.GET("/api/products/{id}",{params:{path:{id:e}}})}async getProductAnalytics(e,t,r,i){return await this.client.GET("/api/products/{id}/analytics",{params:{path:{id:e},query:{...t&&{start_date:t},...r&&{end_date:r},...i&&{course_id:i}}}})}async createProduct(e){return await this.client.POST("/api/products",{body:e})}async updateProduct(e,t){return await this.client.PATCH("/api/products/{id}",{params:{path:{id:e}},body:t})}async getProductNavigationIndex(e){return await this.client.GET("/api/products/{id}/navigation-index",{params:{path:{id:e}}})}async replaceProductNavigationIndex(e,t){return await this.client.PUT("/api/products/{id}/navigation-index",{params:{path:{id:e}},body:t})}async listProductKnowledgeBlocks(e){return await this.client.GET("/api/products/{id}/knowledge-blocks",{params:{path:{id:e}}})}async createProductKnowledgeBlock(e,t){return await this.client.POST("/api/products/{id}/knowledge-blocks",{params:{path:{id:e}},body:t})}async searchProductKnowledgeBlocks(e,t,r){return await this.client.GET("/api/products/{id}/knowledge-blocks/search",{params:{path:{id:e},query:{q:t,...r&&{limit:r.toString()}}}})}async updateProductKnowledgeBlock(e,t,r){return await this.client.PATCH("/api/products/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}},body:r})}async deleteProductKnowledgeBlock(e,t){return await this.client.DELETE("/api/products/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}}})}async createPlan(e){return await this.client.POST("/api/plans",{body:e})}async getPlan(e){return await this.client.GET("/api/plans/{id}",{params:{path:{id:e}}})}async getAdminPlan(e){return await this.client.GET("/api/admin/plans/{id}",{params:{path:{id:e}}})}async getPlanAnalytics(e,t,r){return await this.client.GET("/api/plans/{id}/analytics",{params:{path:{id:e},query:{...t&&{start_date:t},...r&&{end_date:r}}}})}async replacePlan(e,t){return await this.client.PUT("/api/plans/{id}",{params:{path:{id:e}},body:t})}async updatePlan(e,t){return await this.client.PATCH("/api/plans/{id}",{params:{path:{id:e}},body:t})}async getPlanVideoUrl(e){return await this.client.GET("/api/plans/{id}/video-url",{params:{path:{id:e}}})}async deletePlan(e){return await this.client.DELETE("/api/admin/plans/{id}",{params:{path:{id:e}}})}async publishPlanRevision(e,t){return await this.client.POST("/api/plans/{id}/publish",{params:{path:{id:e}},body:t})}async listPlanRevisions(e){return await this.client.GET("/api/plans/{id}/revisions",{params:{path:{id:e}}})}async listPlanKnowledgeBlocks(e){return await this.client.GET("/api/plans/{id}/knowledge-blocks",{params:{path:{id:e}}})}async createPlanKnowledgeBlock(e,t){return await this.client.POST("/api/plans/{id}/knowledge-blocks",{params:{path:{id:e}},body:t})}async updatePlanKnowledgeBlock(e,t,r){return await this.client.PUT("/api/plans/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}},body:r})}async deletePlanKnowledgeBlock(e,t){return await this.client.DELETE("/api/plans/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}}})}async getPlanNavigationIndex(e){return await this.client.GET("/api/plans/{id}/navigation-index",{params:{path:{id:e}}})}async replacePlanNavigationIndex(e,t){return await this.client.POST("/api/plans/{id}/navigation-index",{params:{path:{id:e}},body:t})}async getRevisionNavigationIndex(e){return await this.client.GET("/api/revisions/{id}/navigation-index",{params:{path:{id:e}}})}async replaceRevisionNavigationIndex(e,t){return await this.client.PUT("/api/revisions/{id}/navigation-index",{params:{path:{id:e}},body:t})}async getPlanFAQ(e){return await this.client.GET("/api/plans/{id}/faq",{params:{path:{id:e}}})}async getRevisionFAQ(e){return await this.client.GET("/api/revisions/{id}/faq",{params:{path:{id:e}}})}async replaceRevisionFAQ(e,t){return await this.client.PUT("/api/revisions/{id}/faq",{params:{path:{id:e}},body:t})}async listRevisionKnowledgeBlocks(e){return await this.client.GET("/api/revisions/{id}/knowledge-blocks",{params:{path:{id:e}}})}async getRevisionSteps(e){return await this.client.GET("/api/revisions/{id}/steps",{params:{path:{id:e}}})}async replaceRevisionKnowledgeBlocks(e,t){return await this.client.PUT("/api/revisions/{id}/knowledge-blocks",{params:{path:{id:e}},body:t})}async createRevisionKnowledgeBlock(e,t){return await this.client.POST("/api/revisions/{id}/knowledge-blocks",{params:{path:{id:e}},body:t})}async updateRevisionKnowledgeBlock(e,t,r){return await this.client.PUT("/api/revisions/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}},body:r})}async deleteRevisionKnowledgeBlock(e,t){return await this.client.DELETE("/api/revisions/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}}})}async listSessions(e,t){const r={token:e};return t!=null&&t.productId&&(r.product_id=t.productId),t!=null&&t.startDate&&(r.start_date=t.startDate),t!=null&&t.endDate&&(r.end_date=t.endDate),await this.client.GET("/api/sessions",{params:{query:r}})}async createSession(e){return await this.client.POST("/api/sessions",{body:e})}async getSession(e){return await this.client.GET("/api/sessions/{id}",{params:{path:{id:e}}})}async startSession(e,t){return await this.client.GET("/api/sessions/{id}/start-session",{params:{path:{id:e},query:{token:t}}})}async getSessionRecording(e){return await this.client.GET("/api/sessions/{id}/recording",{params:{path:{id:e}}})}async getSessionSummary(e){return await this.client.GET("/api/sessions/{id}/summary",{params:{path:{id:e}}})}async getSessionProductUrl(e){return await this.client.GET("/api/sessions/{id}/product-url",{params:{path:{id:e}}})}async updateSession(e,t){return await this.client.PATCH("/api/sessions/{id}",{params:{path:{id:e}},body:t})}async listUserSessions(e){const t={};return e!=null&&e.productId&&(t.product_id=e.productId),e!=null&&e.courseId&&(t.course_id=e.courseId),e!=null&&e.startDate&&(t.start_date=e.startDate),e!=null&&e.endDate&&(t.end_date=e.endDate),e!=null&&e.page&&(t.page=e.page),e!=null&&e.limit&&(t.limit=e.limit),e!=null&&e.courseName&&(t.course_name=e.courseName),e!=null&&e.userName&&(t.user_name=e.userName),e!=null&&e.company&&(t.company=e.company),e!=null&&e.email&&(t.email=e.email),e!=null&&e.sortBy&&(t.sort_by=e.sortBy),e!=null&&e.sortOrder&&(t.sort_order=e.sortOrder),await this.client.GET("/api/user-sessions",{params:Object.keys(t).length>0?{query:t}:void 0})}async listUserSessionsAggregate(e){const t={};return e!=null&&e.productId&&(t.product_id=e.productId),e!=null&&e.courseId&&(t.course_id=e.courseId),e!=null&&e.startDate&&(t.start_date=e.startDate),e!=null&&e.endDate&&(t.end_date=e.endDate),await this.client.GET("/api/user-sessions-aggregate",{params:Object.keys(t).length>0?{query:t}:void 0})}async getJoinToken(e,{clientType:t,user:r}={}){return await this.client.GET("/api/join-token",{params:{query:{token:e,...t&&{client_type:t},...r&&{user:encodeURIComponent(r)}}}})}async getSessionPlan(e){return await this.client.GET("/api/sessions/{id}/plan",{params:{path:{id:e}}})}getClient(){return this.client}}const K0="https://app.coragents.ai";class pa extends Gc{constructor(e,t,r,i){super(),this.state=null,this.isPaused=!1,this.speakingState=null,this.captureScreen=null,this.sessionUuid=null,this.roomId=null,this.joinToken=null,this.roomUrl=null,this.room=null,this.agentAnalyser=null,this.userAnalyser=null,this.appToken=e,this.planId=t,this.clientType=r,this.api=i.api||new H0({baseUrl:K0}),this.identity=i.identity||null,this.roomFactory=i.roomFactory||(A=>new Li(A)),this.captureScreen=i.captureScreen||null}async start(){this.planId,this.setState("connecting"),this.speakingStateChanged("thinking");try{const t=(await this.api.clientStartSession(this.appToken,{client_type:this.clientType,onboarding_plan:this.planId})).data;if(!(t!=null&&t.url)||!(t!=null&&t.token)||!(t!=null&&t.room)||!(t!=null&&t.session_uuid))throw new Error("Invalid room info");this.sessionUuid=t==null?void 0:t.session_uuid,this.roomId=t==null?void 0:t.room,this.joinToken=t==null?void 0:t.token,this.roomUrl=t==null?void 0:t.url,await this.joinRoom(),this.setState("connected"),this.planId,this.sessionUuid}catch(e){console.error("[obi] error starting session",{error:e}),this.setState("error")}}async joinRoom({withMicrophone:e=!1,withStateRecovery:t=!1}={}){this.room=this.roomFactory({adaptiveStream:!0,dynacast:!0}),this.room.on(O.Disconnected,r=>{if(!this.room)return;let i=null;switch(r){case 12:i="invalid-room";break}this.shutdown(i)}),this.room.on(O.TrackSubscribed,r=>{r.kind==="audio"&&(r.attach(),r.source===P.Source.Microphone&&(this.agentAnalyser&&this.agentAnalyser.disconnect(),this.agentAnalyser=this.createFFT(r.mediaStream)))}),this.room.on(O.LocalTrackPublished,r=>{r.kind==="audio"&&(this.userAnalyser&&this.userAnalyser.disconnect(),this.userAnalyser=this.createFFT(r.audioTrack.mediaStream))}),this.room.on(O.ParticipantAttributesChanged,r=>{if(!r["lk.agent.state"])return;const i=r["lk.agent.state"];switch(i){case"speaking":this.speakingStateChanged("speaking");break;case"listening":this.state!=="connected"&&this.speakingStateChanged("listening");break;case"thinking":this.speakingStateChanged("thinking");break;default:console.warn("[obi] unknown speaking state",i)}}),this.room.on(O.DataReceived,async r=>{try{const i=new TextDecoder().decode(r),A=JSON.parse(i);switch(A.status||A.request||A.type){case"course_progress":typeof A.current_step=="number"&&typeof A.total_steps=="number"&&Array.isArray(A.step_names)&&this.emit("courseProgress",{currentStep:Math.max(1,A.current_step),totalSteps:Math.max(1,A.total_steps),stepNames:A.step_names});break;case"using_tool":this.speakingStateChanged("busy");break;case"using_tool_ended":this.speakingStateChanged("speaking");break;case"prompt_user":this.setState("volume-check");break;case"mic_check":this.setState("mic-check");break;case"share_mic":this.setState("mic-share");break;case"share_screen":this.setState("screen-share");break;case"navigate":this.setState("navigate");break;default:console.warn("[obi] unknown data received",A)}}catch(i){console.error("[obi] error parsing data",i)}}),this.room.localParticipant.registerRpcMethod("mic_check",async r=>(this.sessionUuid,await this.checkMicrophone()?"ok":"error")),this.room.localParticipant.registerRpcMethod("screen_capture",async r=>{if(!this.captureScreen)return console.error("[obi] no captureScreen function provided"),"error";let i=null,A=null;try{i=await this.captureScreen()}catch(s){i=null,s=s}if(!i||A)return console.error("[obi] error capturing screen",{error:A}),"error";try{return await this.room.localParticipant.sendFile(new File([i],"screen_capture.png",{type:"image/png"}),{mimeType:"image/png",topic:"screen_capture"}),"ok"}catch(s){return console.error("[obi] error sending screen capture",{error:s}),"error"}}),await this.room.connect(this.roomUrl,this.joinToken);for(let r=0;r<9&&!(this.room.state===fe.Connected&&this.room.remoteParticipants.size>=1);r++)await new Promise(i=>setTimeout(i,1e3));if(!(this.room.state===fe.Connected&&this.room.remoteParticipants.size>=1)){console.error("[obi] room not connected",{state:this.room.state,numParticipants:this.room.remoteParticipants.size}),this.shutdown("invalid-room");return}if(e&&await this.room.localParticipant.setMicrophoneEnabled(!0),t){let r=!1;for(const i of this.room.remoteParticipants.values())i.isSpeaking&&(r=!0);r?this.speakingState="speaking":this.speakingState="listening"}}async continue(){this.sessionUuid,this.speakingStateChanged("thinking"),await this.sendData({request:"prompt_user",success:!0})}async checkMicrophone(){let e=!1;try{e=(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch(t){console.error("[obi] error checking microphone permission:",t)}return e?(this.sessionUuid,await this.room.localParticipant.setMicrophoneEnabled(!0),this.isMicShared=!0):this.sessionUuid,e&&this.clientType==="sdk"&&this.setState("in-progress"),this.emit("micCheckComplete",e),e}async shareMicrophone(){this.sessionUuid,this.speakingStateChanged("thinking");let e=null,t=null;try{e=await this.room.localParticipant.setMicrophoneEnabled(!0),this.isMicShared=!0}catch(r){r=r,this.isMicShared=!1}e?this.sessionUuid:console.error("[obi] failed to share microphone",{error:t}),await this.sendData({request:"share_mic",success:!!e}),this.clientType==="sdk"&&this.setState("in-progress")}async shareMicrophoneFailed(){this.isMicShared=!1,await this.sendData({request:"share_mic",success:!1}),this.clientType==="sdk"&&this.setState("in-progress")}async shareScreen(){this.sessionUuid,this.speakingStateChanged("thinking"),await this.room.localParticipant.setScreenShareEnabled(!0,{video:{displaySurface:"window"}}),await this.sendData({request:"share_screen",success:!0}),this.setState("navigate")}async pause(){this.muteMicrophone(),this.isPaused=!0,this.emit("paused"),await this.sendData({request:"pause"}),console.log("[obi] paused session",{sessionUuid:this.sessionUuid})}async unpause(){this.unmuteMicrophone(),this.isPaused=!1,this.emit("unpaused"),await this.sendData({request:"unpause"}),console.log("[obi] unpaused session",{sessionUuid:this.sessionUuid})}muteMicrophone(){this.sessionUuid,this.room.localParticipant.getTrackPublications().forEach(e=>{var t,r;e.handleMuted(),(r=(t=e.track)==null?void 0:t.mediaStream)==null||r.getTracks().forEach(i=>i.enabled=!1)})}unmuteMicrophone(){this.sessionUuid,this.room.localParticipant.getTrackPublications().forEach(e=>{var t,r;e.handleUnmuted(),(r=(t=e.track)==null?void 0:t.mediaStream)==null||r.getTracks().forEach(i=>i.enabled=!0)})}async stop(){this.emit("stopped"),await this.shutdown()}async shutdown(e=null){if(this.room){this.sessionUuid;const t=this.room;this.room=null,await t.disconnect(),this.sessionUuid}this.sessionUuid=null,this.roomId=null,this.joinToken=null,this.roomUrl=null,this.emit("shutdown",e)}async say(e){this.speakingStateChanged("thinking"),this.isPaused&&await this.unpause(),await this.sendData({request:"say",message:e})}serialise(){return JSON.stringify({state:this.state,speakingState:this.speakingState,appToken:this.appToken,planId:this.planId,clientType:this.clientType,isPaused:this.isPaused,identity:this.identity,sessionUuid:this.sessionUuid,roomId:this.roomId,joinToken:this.joinToken,roomUrl:this.roomUrl})}audioSpectrum(){return this.speakingState==="speaking"&&this.agentAnalyser?this.normaliseSpectrum(this.agentAnalyser):this.speakingState==="listening"&&this.userAnalyser?this.normaliseSpectrum(this.userAnalyser):null}normaliseSpectrum(e){const r=e.context.sampleRate/2/e.frequencyBinCount,i=new Uint8Array(e.frequencyBinCount);e.getByteFrequencyData(i);const A=[],s=50,o=5e3,a=8,c=Math.pow(o/s,1/a);for(let u=0;u<a;u++){const l=s*Math.pow(c,u),d=s*Math.pow(c,u+1),h=Math.floor(l/r),f=Math.floor(d/r),p=Math.min(f,i.length),g=Math.min(h,p);if(g<p){const v=i.slice(g,p).reduce((y,B)=>y+B,0)/(p-g)/255;A.push(v)}else A.push(0)}return A}setState(e){this.state;const t=this.state;this.state=e,this.emit("stateChanged",e,t)}static deserialise(e,t,r,i={}){const A=JSON.parse(e),s=new pa(t,A.planId,r,i);return s.state=A.state,s.speakingState=A.speakingState,s.identity=A.identity||null,s.isPaused=A.isPaused||!1,s.sessionUuid=A.sessionUuid||null,s.roomId=A.roomId||null,s.joinToken=A.joinToken||null,s.roomUrl=A.roomUrl||null,s}speakingStateChanged(e){this.speakingState;const t=this.speakingState;this.speakingState=e,this.emit("speakingStateChanged",e,t)}async sendData(e){await this.room.localParticipant.publishData(new TextEncoder().encode(JSON.stringify(e)),{reliable:!0})}createFFT(e){const t=new AudioContext,r=t.createAnalyser();return t.createMediaStreamSource(e).connect(r),r.fftSize=2048,r.smoothingTimeConstant=.6,r}}class fa extends Gc{constructor(e,t,r={}){super(),this.state="loading",this.error=null,this.identity=null,this.product=null,this.plans=[],this.selectedPlan=null,this.selectedPlanUuid=null,this.showWidget=!1,this.session=null,this.captureScreen=null,this.appToken=e,this.clientType=t,this.api=r.api||new H0({baseUrl:r.apiBaseUrl||K0}),this.sessionFactory=r.sessionFactory||((i,A,s,o)=>new pa(i,A,s,o)),this.captureScreen=r.captureScreen||null}async initialise(e={}){var t,r,i,A;if(!this.appToken)throw new Error("App token is required");this.setState("loading");try{const s=await this.api.clientInitialise(this.appToken,{identity:e.identity,client_type:this.clientType});if(this.identity=e.identity||null,this.product=((t=s.data)==null?void 0:t.product)||null,this.plans=((r=s.data)==null?void 0:r.onboarding_plans)||[],this.selectedPlan=((i=s.data)==null?void 0:i.selected_plan)||null,this.showWidget=((A=s.data)==null?void 0:A.show_widget)||!1,e.planUuid){let o=this.plans.find(a=>a.uuid===e.planUuid)||null;if(!o)try{const a=await this.api.getSessionPlan(e.planUuid);o=this.plans.find(c=>{var u;return c.uuid===((u=a.data)==null?void 0:u.plan_uuid)})||null}catch(a){console.error("[obi] error getting session plan",a)}o?(this.selectedPlan=o,this.selectedPlanUuid=e.planUuid):console.warn("[obi] plan not found",{planUuid:e.planUuid})}this.identity,this.product,this.plans,this.selectedPlan,this.showWidget}catch(s){throw this.error=s instanceof Error?s:new Error(String(s)),this.setState("error"),s}finally{this.setState("ready")}}selectPlan(e){this.selectedPlan=e,this.selectedPlanUuid=(e==null?void 0:e.uuid)||null,this.emit("planSelected",e)}async startSession(e,t){return await this._stopSession(),this.session=this.sessionFactory(this.appToken,e,this.clientType,{api:this.api,identity:this.identity,captureScreen:this.captureScreen}),this.prepareSession(t),this.session.start().then(()=>{this.emit("sessionStarted",this.session)}).catch(r=>{this.session=null,console.error("[obi] error starting session",r)}),this.session}async resumeSession(e){var t,r;return this.state,(t=this.session)==null||t.state,(r=this.session)==null||r.speakingState,this.session.captureScreen=this.captureScreen,this.prepareSession(e),this.session.joinRoom({withMicrophone:!0,withStateRecovery:!0}).then(()=>{this.emit("sessionResumed",this.session)}).catch(i=>{console.error("[obi] error joining room",{error:i}),i instanceof Error&&i.message==="Room is not connected"&&this.session.stop()}),this.session}prepareSession(e){if(!this.session)throw new Error("No session to prepare");return e(this.session),this.session.on("stopped",()=>{this.emit("sessionStopped")}),this.session.on("shutdown",t=>{var r,i;(i=(r=this.session)==null?void 0:r.removeAllListeners)==null||i.call(r),this.session=null,this.selectedPlan=null,this.selectedPlanUuid=null,this.emit("sessionShutdown",t)}),this.session}async stopSession(){await this._stopSession(),this.selectedPlan&&this.selectPlan(null)}async _stopSession(){this.session&&(this.trackEvent("session-stopped",{sessionUuid:this.session.sessionUuid}),await this.session.stop(),this.session=null)}isLoading(){return this.state==="loading"}isReady(){return this.state==="ready"}serialise(){var e;return JSON.stringify({state:this.state,appToken:this.appToken,clientType:this.clientType,identity:this.identity,product:this.product,plans:this.plans,selectedPlan:this.selectedPlan,selectedPlanUuid:this.selectedPlanUuid,showWidget:this.showWidget,session:(e=this.session)==null?void 0:e.serialise(),serialisedAt:new Date().toISOString()})}static deserialise(e,t,r,i={}){const A=JSON.parse(e);if(A.serialisedAt){const o=new Date(A.serialisedAt);if(new Date().getTime()-o.getTime()>1e3*20)throw new Error("Client was serialised more than 20 seconds ago, assuming it's dead.")}else throw new Error("Client was not serialised, assuming it's dead.");const s=new fa(t,r,i);return s.state=A.state,s.identity=A.identity||null,s.product=A.product||null,s.plans=A.plans||[],s.selectedPlan=A.selectedPlan||null,s.selectedPlanUuid=A.selectedPlanUuid||null,s.showWidget=A.showWidget||!1,A.session&&(s.session=pa.deserialise(A.session,t,r,{api:s.api})),s}setState(e){const t=this.state;this.state=e,this.emit("stateChanged",e,t)}trackEvent(e,t={}){var r,i,A;this.emit("trackEvent",e,{...t,clientType:this.clientType,planId:(r=this.selectedPlan)==null?void 0:r.uuid,productId:(i=this.product)==null?void 0:i.uuid,sessionId:(A=this.session)==null?void 0:A.sessionUuid})}}var ga,ee,V0,zr,G0,j0,W0,q0,cd,ud,ld,J0,WA={},z0=[],lQ=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qA=Array.isArray;function Kn(n,e){for(var t in e)n[t]=e[t];return n}function dd(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function hd(n,e,t){var r,i,A,s={};for(A in e)A=="key"?r=e[A]:A=="ref"?i=e[A]:s[A]=e[A];if(arguments.length>2&&(s.children=arguments.length>3?ga.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(A in n.defaultProps)s[A]==null&&(s[A]=n.defaultProps[A]);return ma(n,s,r,i,null)}function ma(n,e,t,r,i){var A={type:n,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++V0,__i:-1,__u:0};return i==null&&ee.vnode!=null&&ee.vnode(A),A}function St(n){return n.children}function Vn(n,e){this.props=n,this.context=e}function Di(n,e){if(e==null)return n.__?Di(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?Di(n):null}function X0(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return X0(n)}}function pd(n){(!n.__d&&(n.__d=!0)&&zr.push(n)&&!va.__r++||G0!=ee.debounceRendering)&&((G0=ee.debounceRendering)||j0)(va)}function va(){for(var n,e,t,r,i,A,s,o=1;zr.length;)zr.length>o&&zr.sort(W0),n=zr.shift(),o=zr.length,n.__d&&(t=void 0,i=(r=(e=n).__v).__e,A=[],s=[],e.__P&&((t=Kn({},r)).__v=r.__v+1,ee.vnode&&ee.vnode(t),fd(e.__P,t,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,A,i??Di(r),!!(32&r.__u),s),t.__v=r.__v,t.__.__k[t.__i]=t,ty(A,t,s),t.__e!=i&&X0(t)));va.__r=0}function Y0(n,e,t,r,i,A,s,o,a,c,u){var l,d,h,f,p,g,v=r&&r.__k||z0,y=e.length;for(a=dQ(t,e,v,a,y),l=0;l<y;l++)(h=t.__k[l])!=null&&(d=h.__i==-1?WA:v[h.__i]||WA,h.__i=l,g=fd(n,h,d,i,A,s,o,a,c,u),f=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&gd(d.ref,null,h),u.push(h.ref,h.__c||f,h)),p==null&&f!=null&&(p=f),4&h.__u||d.__k===h.__k?a=Z0(h,a,n):typeof h.type=="function"&&g!==void 0?a=g:f&&(a=f.nextSibling),h.__u&=-7);return t.__e=p,a}function dQ(n,e,t,r,i){var A,s,o,a,c,u=t.length,l=u,d=0;for(n.__k=new Array(i),A=0;A<i;A++)(s=e[A])!=null&&typeof s!="boolean"&&typeof s!="function"?(a=A+d,(s=n.__k[A]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?ma(null,s,null,null,null):qA(s)?ma(St,{children:s},null,null,null):s.constructor==null&&s.__b>0?ma(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=n,s.__b=n.__b+1,o=null,(c=s.__i=hQ(s,t,a,l))!=-1&&(l--,(o=t[c])&&(o.__u|=2)),o==null||o.__v==null?(c==-1&&(i>u?d--:i<u&&d++),typeof s.type!="function"&&(s.__u|=4)):c!=a&&(c==a-1?d--:c==a+1?d++:(c>a?d--:d++,s.__u|=4))):n.__k[A]=null;if(l)for(A=0;A<u;A++)(o=t[A])!=null&&!(2&o.__u)&&(o.__e==r&&(r=Di(o)),ry(o,o));return r}function Z0(n,e,t){var r,i;if(typeof n.type=="function"){for(r=n.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=n,e=Z0(r[i],e,t));return e}n.__e!=e&&(e&&n.type&&!t.contains(e)&&(e=Di(n)),t.insertBefore(n.__e,e||null),e=n.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ya(n,e){return e=e||[],n==null||typeof n=="boolean"||(qA(n)?n.some(function(t){ya(t,e)}):e.push(n)),e}function hQ(n,e,t,r){var i,A,s=n.key,o=n.type,a=e[t];if(a===null&&n.key==null||a&&s==a.key&&o==a.type&&!(2&a.__u))return t;if(r>(a!=null&&!(2&a.__u)?1:0))for(i=t-1,A=t+1;i>=0||A<e.length;){if(i>=0){if((a=e[i])&&!(2&a.__u)&&s==a.key&&o==a.type)return i;i--}if(A<e.length){if((a=e[A])&&!(2&a.__u)&&s==a.key&&o==a.type)return A;A++}}return-1}function $0(n,e,t){e[0]=="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||lQ.test(e)?t:t+"px"}function wa(n,e,t,r,i){var A;e:if(e=="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof r=="string"&&(n.style.cssText=r=""),r)for(e in r)t&&e in t||$0(n.style,e,"");if(t)for(e in t)r&&t[e]==r[e]||$0(n.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")A=e!=(e=e.replace(q0,"$1")),e=e.toLowerCase()in n||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),n.l||(n.l={}),n.l[e+A]=t,t?r?t.u=r.u:(t.u=cd,n.addEventListener(e,A?ld:ud,A)):n.removeEventListener(e,A?ld:ud,A);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in n)try{n[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?n.removeAttribute(e):n.setAttribute(e,e=="popover"&&t==1?"":t))}}function ey(n){return function(e){if(this.l){var t=this.l[e.type+n];if(e.t==null)e.t=cd++;else if(e.t<t.u)return;return t(ee.event?ee.event(e):e)}}}function fd(n,e,t,r,i,A,s,o,a,c){var u,l,d,h,f,p,g,v,y,B,b,w,_,k,F,x,E,T=e.type;if(e.constructor!=null)return null;128&t.__u&&(a=!!(32&t.__u),A=[o=e.__e=t.__e]),(u=ee.__b)&&u(e);e:if(typeof T=="function")try{if(v=e.props,y="prototype"in T&&T.prototype.render,B=(u=T.contextType)&&r[u.__c],b=u?B?B.props.value:u.__:r,t.__c?g=(l=e.__c=t.__c).__=l.__E:(y?e.__c=l=new T(v,b):(e.__c=l=new Vn(v,b),l.constructor=T,l.render=fQ),B&&B.sub(l),l.props=v,l.state||(l.state={}),l.context=b,l.__n=r,d=l.__d=!0,l.__h=[],l._sb=[]),y&&l.__s==null&&(l.__s=l.state),y&&T.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Kn({},l.__s)),Kn(l.__s,T.getDerivedStateFromProps(v,l.__s))),h=l.props,f=l.state,l.__v=e,d)y&&T.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),y&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(y&&T.getDerivedStateFromProps==null&&v!==h&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(v,b),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(v,l.__s,b)===!1||e.__v==t.__v){for(e.__v!=t.__v&&(l.props=v,l.state=l.__s,l.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(Q){Q&&(Q.__=e)}),w=0;w<l._sb.length;w++)l.__h.push(l._sb[w]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(v,l.__s,b),y&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(h,f,p)})}if(l.context=b,l.props=v,l.__P=n,l.__e=!1,_=ee.__r,k=0,y){for(l.state=l.__s,l.__d=!1,_&&_(e),u=l.render(l.props,l.state,l.context),F=0;F<l._sb.length;F++)l.__h.push(l._sb[F]);l._sb=[]}else do l.__d=!1,_&&_(e),u=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++k<25);l.state=l.__s,l.getChildContext!=null&&(r=Kn(Kn({},r),l.getChildContext())),y&&!d&&l.getSnapshotBeforeUpdate!=null&&(p=l.getSnapshotBeforeUpdate(h,f)),x=u,u!=null&&u.type===St&&u.key==null&&(x=ny(u.props.children)),o=Y0(n,qA(x)?x:[x],e,t,r,i,A,s,o,a,c),l.base=e.__e,e.__u&=-161,l.__h.length&&s.push(l),g&&(l.__E=l.__=null)}catch(Q){if(e.__v=null,a||A!=null)if(Q.then){for(e.__u|=a?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;A[A.indexOf(o)]=null,e.__e=o}else for(E=A.length;E--;)dd(A[E]);else e.__e=t.__e,e.__k=t.__k;ee.__e(Q,e,t)}else A==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):o=e.__e=pQ(t.__e,e,t,r,i,A,s,a,c);return(u=ee.diffed)&&u(e),128&e.__u?void 0:o}function ty(n,e,t){for(var r=0;r<t.length;r++)gd(t[r],t[++r],t[++r]);ee.__c&&ee.__c(e,n),n.some(function(i){try{n=i.__h,i.__h=[],n.some(function(A){A.call(i)})}catch(A){ee.__e(A,i.__v)}})}function ny(n){return typeof n!="object"||n==null||n.__b&&n.__b>0?n:qA(n)?n.map(ny):Kn({},n)}function pQ(n,e,t,r,i,A,s,o,a){var c,u,l,d,h,f,p,g=t.props,v=e.props,y=e.type;if(y=="svg"?i="http://www.w3.org/2000/svg":y=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),A!=null){for(c=0;c<A.length;c++)if((h=A[c])&&"setAttribute"in h==!!y&&(y?h.localName==y:h.nodeType==3)){n=h,A[c]=null;break}}if(n==null){if(y==null)return document.createTextNode(v);n=document.createElementNS(i,y,v.is&&v),o&&(ee.__m&&ee.__m(e,A),o=!1),A=null}if(y==null)g===v||o&&n.data==v||(n.data=v);else{if(A=A&&ga.call(n.childNodes),g=t.props||WA,!o&&A!=null)for(g={},c=0;c<n.attributes.length;c++)g[(h=n.attributes[c]).name]=h.value;for(c in g)if(h=g[c],c!="children"){if(c=="dangerouslySetInnerHTML")l=h;else if(!(c in v)){if(c=="value"&&"defaultValue"in v||c=="checked"&&"defaultChecked"in v)continue;wa(n,c,null,h,i)}}for(c in v)h=v[c],c=="children"?d=h:c=="dangerouslySetInnerHTML"?u=h:c=="value"?f=h:c=="checked"?p=h:o&&typeof h!="function"||g[c]===h||wa(n,c,h,g[c],i);if(u)o||l&&(u.__html==l.__html||u.__html==n.innerHTML)||(n.innerHTML=u.__html),e.__k=[];else if(l&&(n.innerHTML=""),Y0(e.type=="template"?n.content:n,qA(d)?d:[d],e,t,r,y=="foreignObject"?"http://www.w3.org/1999/xhtml":i,A,s,A?A[0]:t.__k&&Di(t,0),o,a),A!=null)for(c=A.length;c--;)dd(A[c]);o||(c="value",y=="progress"&&f==null?n.removeAttribute("value"):f!=null&&(f!==n[c]||y=="progress"&&!f||y=="option"&&f!=g[c])&&wa(n,c,f,g[c],i),c="checked",p!=null&&p!=n[c]&&wa(n,c,p,g[c],i))}return n}function gd(n,e,t){try{if(typeof n=="function"){var r=typeof n.__u=="function";r&&n.__u(),r&&e==null||(n.__u=n(e))}else n.current=e}catch(i){ee.__e(i,t)}}function ry(n,e,t){var r,i;if(ee.unmount&&ee.unmount(n),(r=n.ref)&&(r.current&&r.current!=n.__e||gd(r,null,e)),(r=n.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(A){ee.__e(A,e)}r.base=r.__P=null}if(r=n.__k)for(i=0;i<r.length;i++)r[i]&&ry(r[i],e,t||typeof n.type!="function");t||dd(n.__e),n.__c=n.__=n.__e=void 0}function fQ(n,e,t){return this.constructor(n,t)}function gQ(n,e,t){var r,i,A,s;e==document&&(e=document.documentElement),ee.__&&ee.__(n,e),i=(r=typeof t=="function")?null:t&&t.__k||e.__k,A=[],s=[],fd(e,n=(!r&&t||e).__k=hd(St,null,[n]),i||WA,WA,e.namespaceURI,!r&&t?[t]:i?null:e.firstChild?ga.call(e.childNodes):null,A,!r&&t?t:i?i.__e:e.firstChild,r,s),ty(A,n,s)}function iy(n){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(A){this.props.value!=A.value&&r.forEach(function(s){s.__e=!0,pd(s)})},this.sub=function(A){r.add(A);var s=A.componentWillUnmount;A.componentWillUnmount=function(){r&&r.delete(A),s&&s.call(A)}}),t.children}return e.__c="__cC"+J0++,e.__=n,e.Provider=e.__l=(e.Consumer=function(t,r){return t.children(r)}).contextType=e,e}ga=z0.slice,ee={__e:function(n,e,t,r){for(var i,A,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((A=i.constructor)&&A.getDerivedStateFromError!=null&&(i.setState(A.getDerivedStateFromError(n)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(n,r||{}),s=i.__d),s)return i.__E=i}catch(o){n=o}throw n}},V0=0,Vn.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Kn({},this.state),typeof n=="function"&&(n=n(Kn({},t),this.props)),n&&Kn(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),pd(this))},Vn.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),pd(this))},Vn.prototype.render=St,zr=[],j0=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,W0=function(n,e){return n.__v.__b-e.__v.__b},va.__r=0,q0=/(PointerCapture)$|Capture$/i,cd=0,ud=ey(!1),ld=ey(!0),J0=0;var mQ=0;function C(n,e,t,r,i,A){e||(e={});var s,o,a=e;if("ref"in a)for(o in a={},e)o=="ref"?s=e[o]:a[o]=e[o];var c={type:n,props:a,key:t,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--mQ,__i:-1,__u:0,__source:i,__self:A};if(typeof n=="function"&&(s=n.defaultProps))for(o in s)a[o]===void 0&&(a[o]=s[o]);return ee.vnode&&ee.vnode(c),c}var Xr,Ve,md,Ay,JA=0,sy=[],it=ee,oy=it.__b,ay=it.__r,cy=it.diffed,uy=it.__c,ly=it.unmount,dy=it.__;function zA(n,e){it.__h&&it.__h(Ve,n,JA||e),JA=0;var t=Ve.__H||(Ve.__H={__:[],__h:[]});return n>=t.__.length&&t.__.push({}),t.__[n]}function ge(n){return JA=1,vQ(fy,n)}function vQ(n,e,t){var r=zA(Xr++,2);if(r.t=n,!r.__c&&(r.__=[t?t(e):fy(void 0,e),function(o){var a=r.__N?r.__N[0]:r.__[0],c=r.t(a,o);a!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=Ve,!Ve.__f)){var i=function(o,a,c){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(d){return!!d.__c});if(u.every(function(d){return!d.__N}))return!A||A.call(this,o,a,c);var l=r.__c.props!==o;return u.forEach(function(d){if(d.__N){var h=d.__[0];d.__=d.__N,d.__N=void 0,h!==d.__[0]&&(l=!0)}}),A&&A.call(this,o,a,c)||l};Ve.__f=!0;var A=Ve.shouldComponentUpdate,s=Ve.componentWillUpdate;Ve.componentWillUpdate=function(o,a,c){if(this.__e){var u=A;A=void 0,i(o,a,c),A=u}s&&s.call(this,o,a,c)},Ve.shouldComponentUpdate=i}return r.__N||r.__}function Kt(n,e){var t=zA(Xr++,3);!it.__s&&bd(t.__H,e)&&(t.__=n,t.u=e,Ve.__H.__h.push(t))}function vd(n,e){var t=zA(Xr++,4);!it.__s&&bd(t.__H,e)&&(t.__=n,t.u=e,Ve.__h.push(t))}function En(n){return JA=5,yd(function(){return{current:n}},[])}function yd(n,e){var t=zA(Xr++,7);return bd(t.__H,e)&&(t.__=n(),t.__H=e,t.__h=n),t.__}function yQ(n,e){return JA=8,yd(function(){return n},e)}function hy(n){var e=Ve.context[n.__c],t=zA(Xr++,9);return t.c=n,e?(t.__==null&&(t.__=!0,e.sub(Ve)),e.props.value):n.__}function wQ(){for(var n;n=sy.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(ba),n.__H.__h.forEach(wd),n.__H.__h=[]}catch(e){n.__H.__h=[],it.__e(e,n.__v)}}it.__b=function(n){Ve=null,oy&&oy(n)},it.__=function(n,e){n&&e.__k&&e.__k.__m&&(n.__m=e.__k.__m),dy&&dy(n,e)},it.__r=function(n){ay&&ay(n),Xr=0;var e=(Ve=n.__c).__H;e&&(md===Ve?(e.__h=[],Ve.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(ba),e.__h.forEach(wd),e.__h=[],Xr=0)),md=Ve},it.diffed=function(n){cy&&cy(n);var e=n.__c;e&&e.__H&&(e.__H.__h.length&&(sy.push(e)!==1&&Ay===it.requestAnimationFrame||((Ay=it.requestAnimationFrame)||bQ)(wQ)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),md=Ve=null},it.__c=function(n,e){e.some(function(t){try{t.__h.forEach(ba),t.__h=t.__h.filter(function(r){return!r.__||wd(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],it.__e(r,t.__v)}}),uy&&uy(n,e)},it.unmount=function(n){ly&&ly(n);var e,t=n.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{ba(r)}catch(i){e=i}}),t.__H=void 0,e&&it.__e(e,t.__v))};var py=typeof requestAnimationFrame=="function";function bQ(n){var e,t=function(){clearTimeout(r),py&&cancelAnimationFrame(e),setTimeout(n)},r=setTimeout(t,100);py&&(e=requestAnimationFrame(t))}function ba(n){var e=Ve,t=n.__c;typeof t=="function"&&(n.__c=void 0,t()),Ve=e}function wd(n){var e=Ve;n.__c=n.__(),Ve=e}function bd(n,e){return!n||n.length!==e.length||e.some(function(t,r){return t!==n[r]})}function fy(n,e){return typeof e=="function"?e(n):e}function BQ({size:n=24,color:e="#000"}){return C("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-x-icon lucide-x",children:[C("path",{d:"M18 6 6 18"}),C("path",{d:"m6 6 12 12"})]})}function gy({onClose:n}){return C("button",{class:"obi-button obi-close-button",onClick:n,"aria-label":"Close",type:"button",children:C(BQ,{})})}function my({open:n=!1,children:e,onClose:t,size:r="medium"}){const i=En(null),A=En(null);Kt(()=>{const c=i.current;c&&(n&&!c.open?c.showModal():!n&&c.open&&(A.current="programmatic",c.close()))},[n]);const s=c=>{const u=i.current;c.target===u&&(A.current="user-initiated",u==null||u.close())},o=c=>{c.preventDefault(),A.current||(A.current="user-initiated");const u=A.current;A.current=null,t==null||t(u)},a=()=>{var c;A.current="user-initiated",(c=i.current)==null||c.close()};return Kt(()=>{const c=i.current;if(c)return c.addEventListener("click",s),c.addEventListener("close",o),()=>{c.removeEventListener("click",s),c.removeEventListener("close",o)}},[t]),C("dialog",{ref:i,className:`modal-${r}`,children:[C(gy,{onClose:a}),C("div",{class:"modal-content",children:n?typeof e=="function"?e():e:null})]})}function Bd(n){const{children:e,className:t="",...r}=n;return C("div",{className:`${t} obi-panel`,...r,children:e})}function Cd({className:n="",isActive:e=!1,speakingStatus:t,onClick:r,onMouseEnter:i,onMouseLeave:A,children:s}){let o=`obi-pill container ${e&&"active"}`;return t==="user-speaking"&&(o+=" user-speaking"),t==="busy"&&(o+=" busy"),C("div",{className:o,onMouseEnter:i,onMouseLeave:A,children:C("div",{className:`obi-pill pill ${n}`,onClick:r,children:s})})}function vy({className:n="",active:e,speakingStatus:t,onClick:r,onMouseEnter:i,onMouseLeave:A,children:s,...o}){const a=`obi-pill2 container ${e?"active":""} ${t==="user-speaking"?"user-speaking":""} ${n}`;return C("div",{className:a,...o,children:C("div",{className:"pill",onClick:r,onMouseEnter:i,onMouseLeave:A,children:s})})}function Yr({type:n,size:e=24}){return C("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:CQ(n)})}function CQ(n){switch(n){case"pause":return C(St,{children:[C("rect",{x:"14",y:"3",width:"5",height:"18",rx:"1"}),C("rect",{x:"5",y:"3",width:"5",height:"18",rx:"1"})]});case"play":return C(St,{children:C("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})});case"close":return C(St,{children:[C("path",{d:"M18 6 6 18"}),C("path",{d:"m6 6 12 12"})]});case"message":return C(St,{children:C("path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"})});case"minimize":return C(St,{children:[C("path",{d:"m14 10 7-7"}),C("path",{d:"M20 10h-6V4"}),C("path",{d:"m3 21 7-7"}),C("path",{d:"M4 14h6v6"})]});case"voice":return C(St,{children:[C("path",{d:"M2 10v3"}),C("path",{d:"M6 6v11"}),C("path",{d:"M10 3v18"}),C("path",{d:"M14 8v7"}),C("path",{d:"M18 5v13"}),C("path",{d:"M22 10v3"})]});case"open":return C(St,{children:[C("path",{d:"M12 7v14"}),C("path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"})]})}}const _d=iy(null);function _Q({children:n}){const e=hy(_d);if(!e)throw new Error("PopoutTarget must be used within a Popout component");const{controlledOpen:t,isOpen:r,setIsOpen:i,setAnimating:A,targetRef:s,trigger:o,onChange:a,delayMs:c}=e,u=En(null),l=yy(s,A),[d,h]=ge(!1);Kt(()=>{t!==void 0&&t!==d&&(t?p():g()),h(t)},[t]),Kt(()=>()=>{u.current&&clearTimeout(u.current)},[]);function f(){u.current&&(clearTimeout(u.current),u.current=null)}function p(){f(),c>0?u.current=setTimeout(()=>{a==null||a(!0),i(!0),u.current=null},c):(a==null||a(!0),i(!0))}function g(){f(),a==null||a(!1),i(!1)}const v=()=>{o==="click"&&(r?g():p())};function y(){o==="hover"&&p()}function B(){o==="hover"&&g()}return C("div",{ref:l,class:"target",onClick:v,onMouseEnter:y,onMouseLeave:B,children:n})}function SQ({children:n}){const e=hy(_d);if(!e)throw new Error("PopoutContent must be used within a Popout component");const{isOpen:t,animating:r,setAnimating:i,targetRef:A,contentRef:s}=e,o=yy(s,i);return vd(()=>{if(t&&!r&&A.current&&s.current){const a=s.current;if(!a)return;const c=A.current;if(!c)return;const u=a.getBoundingClientRect(),l=c.getBoundingClientRect(),d=l.right-l.left;a.style.top=`${u.top-u.bottom-(8+e.offset)}px`,a.style.left=`${-(u.right-u.left-d)/2}px`}},[t,r]),t?C("div",{ref:o,class:"content",style:{opacity:r?0:1},children:n}):null}function Vt({trigger:n="click",open:e,onChange:t,children:r,delayMs:i=0,offset:A=0,className:s=""}){const[o,a]=ge(!1),[c,u]=ge(!1),l=En(null),d=En(null),h={controlledOpen:e,isOpen:o,setIsOpen:a,animating:c,setAnimating:u,targetRef:l,contentRef:d,trigger:n,onChange:t,delayMs:i,offset:A};return C(_d.Provider,{value:h,children:C("div",{class:`obi-popout ${s}`,children:r})})}Vt.Target=_Q,Vt.Content=SQ;function yy(n,e){const t=En(null),r=En(null),i=En(!0),A=yQ(s=>{if(n.current=s,!s){r.current&&(r.current.disconnect(),r.current=null),i.current=!0;return}function o(){if(i.current){i.current=!1;return}t.current?clearTimeout(t.current):e(!0),t.current=setTimeout(()=>{e(!1),t.current=null},200)}r.current=new ResizeObserver(o),r.current.observe(s,{box:"border-box"})},[]);return Kt(()=>()=>{r.current&&(r.current.disconnect(),r.current=null)},[]),A}function pn({className:n,onClick:e,type:t,disabled:r,title:i}){const A={cancel:C(Yr,{type:"close",size:16}),pause:C(Yr,{type:"pause",size:16}),play:C(Yr,{type:"play",size:16}),message:C(Yr,{type:"message",size:16}),minimize:C(Yr,{type:"minimize",size:16}),voice:C(Yr,{type:"voice",size:16}),open:C(Yr,{type:"open",size:16})}[t],s={cancel:"",pause:"",play:"",message:"",minimize:"",voice:"",open:""}[t],o=C("button",{class:`obi-button obi-round-button ${s} ${n}`,onClick:r?void 0:e,disabled:r,children:A});return i?C(Vt,{className:"obi-round-button-popout",trigger:"hover",delayMs:200,offset:9,children:[C(Vt.Target,{children:o}),C(Vt.Content,{children:C("div",{className:"obi-round-button-title",children:i})})]}):o}const wy=8,Ba=8,kQ=50,EQ=.7,Ni=3;function by({getBands:n,color:e="white"}){const t=En(null);return Kt(()=>{if(!n)return;const r=setInterval(()=>{try{const i=n();if(!t.current)return;const A=t.current.querySelectorAll(".bar"),s=i&&i.length>0?i.slice(0,Ba).map(o=>{const a=Math.abs(o);return Math.min(a/EQ*wy,wy)||Ni}):Array(Ba).fill(Ni);for(;s.length<Ba;)s.push(Ni);s.forEach((o,a)=>{if(o<Ni&&(o=Ni),A[a]){const c=o*2;A[a].style.height=`${c}px`,A[a].style.display=o>0?"block":"none"}})}catch(i){console.warn("Error updating equaliser:",i)}},kQ);return()=>{clearInterval(r)}},[n]),C("div",{className:"obi-equaliser",ref:t,children:Array.from({length:Ba},(r,i)=>C("div",{className:"column",children:C("div",{className:"bar",style:{height:`${Ni}px`,backgroundColor:e,display:"block"}})},i))})}function XA({className:n,children:e,onClick:t}){return t?C("button",{class:`obi-button obi-message ${n} clickable`,onClick:t,children:e}):C("div",{class:`obi-message ${n}`,children:e})}const UQ=8;function By({color:n="white"}){return C("div",{className:"obi-loading-dots",children:Array.from({length:UQ},(e,t)=>C("div",{className:"column",children:[C("div",{className:"bar",style:{backgroundColor:n,animationDelay:`${t*.15}s`}}),C("div",{className:"dot",style:{backgroundColor:n}})]},t))})}function TQ({onContinue:n,onWrapUp:e}){return C(Bd,{className:"obi-exit-survey",children:C(FQ,{onContinue:n,onWrapUp:()=>{e()}})})}function IQ({onOtherSelect:n,onReasonSelect:e,onClose:t}){const[r,i]=ge("reason"),A=s=>{s==="other"?(n(),i("other-reason")):e(s)};return C(Bd,{className:`obi-exit-survey ${r==="reason"?"obi-exit-survey-reason":""}`,children:r==="reason"?C(xQ,{onReasonSelect:A}):C(QQ,{onReasonSelect:A,onClose:t})})}function FQ({onContinue:n,onWrapUp:e}){return C("div",{className:"obi-exit-survey-container",children:[C("h2",{className:"obi-exit-survey-title",children:"Wrapping up early?"}),C("div",{className:"obi-exit-survey-options",children:[C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-button-continue",onClick:n,type:"button",children:"No, let's continue"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-button-wrap-up",onClick:e,type:"button",children:"Yes, let's wrap up"})]})]})}function xQ({onReasonSelect:n}){return C("div",{className:"obi-exit-survey-container obi-exit-survey-reason-container",children:[C("div",{className:"obi-exit-survey-header",children:C("h2",{className:"obi-exit-survey-title obi-exit-survey-reason-title",children:"Quick feedback?"})}),C("div",{className:"obi-exit-survey-options obi-exit-survey-reason-options",children:[C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("do-later"),type:"button",children:"Will do later"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("cant-talk"),type:"button",children:"Can't talk right now"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("prefer-written"),type:"button",children:"Prefer written instructions"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("technical-issues"),type:"button",children:"Experienced technical issues"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("other"),type:"button",children:"Other"})]})]})}function QQ({onReasonSelect:n,onClose:e}){const[t,r]=ge("");return C("div",{className:"obi-exit-survey-container obi-exit-survey-reason-container",children:[C("div",{className:"obi-exit-survey-header",children:[C(gy,{onClose:e}),C("h2",{className:"obi-exit-survey-title obi-exit-survey-reason-title",children:"Tell us more"})]}),C("div",{className:"obi-exit-survey-options obi-exit-survey-reason-options",children:[C("textarea",{className:"obi-exit-survey-button obi-exit-survey-reason-button",placeholder:"What's on your mind?",value:t,onChange:i=>r(i.target.value)}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-button-wrap-up",onClick:()=>n("other-feedback",t),type:"button",children:"Send feedback"})]})]})}function RQ(n,e){for(var t in e)n[t]=e[t];return n}function Cy(n,e){for(var t in n)if(t!=="__source"&&!(t in e))return!0;for(var r in e)if(r!=="__source"&&n[r]!==e[r])return!0;return!1}function _y(n,e){this.props=n,this.context=e}(_y.prototype=new Vn).isPureReactComponent=!0,_y.prototype.shouldComponentUpdate=function(n,e){return Cy(this.props,n)||Cy(this.state,e)};var Sy=ee.__b;ee.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),Sy&&Sy(n)};var PQ=ee.__e;ee.__e=function(n,e,t,r){if(n.then){for(var i,A=e;A=A.__;)if((i=A.__c)&&i.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),i.__c(n,e)}PQ(n,e,t,r)};var ky=ee.unmount;function Ey(n,e,t){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),n.__c.__H=null),(n=RQ({},n)).__c!=null&&(n.__c.__P===t&&(n.__c.__P=e),n.__c.__e=!0,n.__c=null),n.__k=n.__k&&n.__k.map(function(r){return Ey(r,e,t)})),n}function Uy(n,e,t){return n&&t&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(r){return Uy(r,e,t)}),n.__c&&n.__c.__P===e&&(n.__e&&t.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=t)),n}function Sd(){this.__u=0,this.o=null,this.__b=null}function Ty(n){var e=n.__.__c;return e&&e.__a&&e.__a(n)}function Ca(){this.i=null,this.l=null}ee.unmount=function(n){var e=n.__c;e&&e.__R&&e.__R(),e&&32&n.__u&&(n.type=null),ky&&ky(n)},(Sd.prototype=new Vn).__c=function(n,e){var t=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(t);var i=Ty(r.__v),A=!1,s=function(){A||(A=!0,t.__R=null,i?i(o):o())};t.__R=s;var o=function(){if(!--r.__u){if(r.state.__a){var a=r.state.__a;r.__v.__k[0]=Uy(a,a.__c.__P,a.__c.__O)}var c;for(r.setState({__a:r.__b=null});c=r.o.pop();)c.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(s,s)},Sd.prototype.componentWillUnmount=function(){this.o=[]},Sd.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Ey(this.__b,t,r.__O=r.__P)}this.__b=null}var i=e.__a&&hd(St,null,n.fallback);return i&&(i.__u&=-33),[hd(St,null,e.__a?null:n.children),i]};var Iy=function(n,e,t){if(++t[1]===t[0]&&n.l.delete(e),n.props.revealOrder&&(n.props.revealOrder[0]!=="t"||!n.l.size))for(t=n.i;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;n.i=t=t[2]}};(Ca.prototype=new Vn).__a=function(n){var e=this,t=Ty(e.__v),r=e.l.get(n);return r[0]++,function(i){var A=function(){e.props.revealOrder?(r.push(i),Iy(e,n,r)):i()};t?t(A):A()}},Ca.prototype.render=function(n){this.i=null,this.l=new Map;var e=ya(n.children);n.revealOrder&&n.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.l.set(e[t],this.i=[1,0,this.i]);return n.children},Ca.prototype.componentDidUpdate=Ca.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(e,t){Iy(n,t,e)})};var OQ=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,MQ=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,LQ=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,DQ=/[A-Z0-9]/g,NQ=typeof document<"u",HQ=function(n){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(n)};Vn.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(Vn.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:e})}})});var Fy=ee.event;function KQ(){}function VQ(){return this.cancelBubble}function GQ(){return this.defaultPrevented}ee.event=function(n){return Fy&&(n=Fy(n)),n.persist=KQ,n.isPropagationStopped=VQ,n.isDefaultPrevented=GQ,n.nativeEvent=n};var jQ={enumerable:!1,configurable:!0,get:function(){return this.class}},xy=ee.vnode;ee.vnode=function(n){typeof n.type=="string"&&function(e){var t=e.props,r=e.type,i={},A=r.indexOf("-")===-1;for(var s in t){var o=t[s];if(!(s==="value"&&"defaultValue"in t&&o==null||NQ&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var a=s.toLowerCase();s==="defaultValue"&&"value"in t&&t.value==null?s="value":s==="download"&&o===!0?o="":a==="translate"&&o==="no"?o=!1:a[0]==="o"&&a[1]==="n"?a==="ondoubleclick"?s="ondblclick":a!=="onchange"||r!=="input"&&r!=="textarea"||HQ(t.type)?a==="onfocus"?s="onfocusin":a==="onblur"?s="onfocusout":LQ.test(s)&&(s=a):a=s="oninput":A&&MQ.test(s)?s=s.replace(DQ,"-$&").toLowerCase():o===null&&(o=void 0),a==="oninput"&&i[s=a]&&(s="oninputCapture"),i[s]=o}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=ya(t.children).forEach(function(c){c.props.selected=i.value.indexOf(c.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=ya(t.children).forEach(function(c){c.props.selected=i.multiple?i.defaultValue.indexOf(c.props.value)!=-1:i.defaultValue==c.props.value})),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",jQ)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(n),n.$$typeof=OQ,xy&&xy(n)};var Qy=ee.__r;ee.__r=function(n){Qy&&Qy(n),n.__c};var Ry=ee.diffed;ee.diffed=function(n){Ry&&Ry(n);var e=n.props,t=n.__e;t!=null&&n.type==="textarea"&&"value"in e&&e.value!==t.value&&(t.value=e.value==null?"":e.value)};function WQ(n){const{placeholder:e="Type your message...",value:t,defaultValue:r,onChange:i,onSend:A,onCancel:s,onExpand:o,isLoading:a=!1,disabled:c=!1,maxLength:u=500,children:l}=n,[d,h]=ge(t||r||""),[f,p]=ge((t||r||"").length>24),g=En(null);vd(()=>{f&&(o==null||o(!0))},[]);const v=t!==void 0?t:d,y=w=>{const _=w.currentTarget.value;t===void 0&&h(_),i==null||i(_)},B=w=>{w.key==="Escape"&&(h(t||r||""),p(!1),s==null||s()),w.key==="Enter"&&!w.shiftKey&&v.trim()&&(w.preventDefault(),h(t||r||""),p(!1),b()),(v||"").length>=24&&!f&&(p(!0),o==null||o(!0))};Kt(()=>{g.current&&g.current.focus()},[g.current]);const b=()=>{!v.trim()||a||c||(A==null||A(v.trim()),t===void 0&&h(""))};return C("div",{className:`obi-message-input ${f?"expanded":""}`,children:[C("div",{className:"container",children:C("textarea",{ref:g,className:"field",placeholder:e,value:v,onInput:y,onKeyDown:B,disabled:c||a,maxLength:u,rows:1})}),C("div",{className:"button-container",children:[f&&C("div",{children:l}),C("button",{className:"obi-button send",onClick:b,disabled:!v.trim()||a||c,type:"button",children:C("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:C("path",{d:"M6.00016 10.6673V1.33398M6.00016 1.33398L1.3335 6.00065M6.00016 1.33398L10.6668 6.00065",stroke:"#F3F3F3","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"})})})]})]})}function qQ(n){const{currentStep:e,totalSteps:t,stepNames:r,className:i}=n,A=Array.from({length:t},(a,c)=>({isCompleted:c<e,stepNumber:c+1})),s=r[e-1]||`Step ${e}`,o=`${e}/${t} \u2022 ${s}`;return C("div",{class:`obi-course-progress ${i||""}`,children:[C("div",{class:"obi-course-progress-steps",children:A.map((a,c)=>C("div",{class:"obi-course-progress-container",children:C("div",{class:`obi-course-progress-step ${a.isCompleted?"completed":""}`})},c))}),C("div",{class:"obi-course-progress-description",children:o})]})}function JQ(n){const{disabled:e,inPlan:t,isPaused:r}=n,[i,A]=ge(null),[s,o]=ge(n.isActive??n.defaultIsActive??!1),[a,c]=ge(!1),[u,l]=ge(n.cancelling??!1),[d,h]=ge(n.messaging??!1),[f,p]=ge(!1),[g,v]=ge(!1);vd(()=>{n.messaging!==void 0&&h(n.messaging)},[n.messaging]);function y(){o(!0),c(!1),v(!0),n.messaging!==void 0&&h(n.messaging)}function B(){}function b(){i&&(clearTimeout(i),A(null))}function w(){A(setTimeout(()=>{o(n.defaultIsActive??!1),v(!1)},400))}function _(Z){var We;p(!1),(We=n.onMessage)==null||We.call(n,Z)}function k(){var Z;h(!1),p(!1),o(!1),c(!0),(Z=n.onMinimize)==null||Z.call(n)}function F(){var Z;h(!1),l(!0),p(!1),(Z=n.onCancelClick)==null||Z.call(n)}function x(){var Z;t||((Z=n.onOpen)==null||Z.call(n))}function E(){var Z,We;(Z=n.onMessage)==null||Z.call(n,"Okay, let's continue."),(We=n.onOneClickAction)==null||We.call(n,"Ready to continue?")}function T(Z){var We;n.messaging===void 0&&((We=n.onMessagingChange)==null||We.call(n,Z),h(Z)),Z||p(!1)}const Q=n.isActive??((s||t)&&!a&&!e),M=Q&&t,X=Q&&t&&!f,H=n.speakingStatus==="user-speaking",q=n.speakingStatus==="thinking",ve=n.speakingStatus==="busy",Y=Q&&!t&&!u&&g,ie=Q&&t&&r&&!H&&!u,Qe=Q&&t&&r&&H&&!u,qe=Q&&t&&!r&&H&&!u,Be=Q&&t&&!r&&ve&&!u,ht=d&&H,Re=Y||ie||Qe||qe||u,Ne=400,ne=Q&&t&&!f,et=Y?5:10;return!t&&!u?C(zQ,{...n}):!t&&u?C(XQ,{onOtherSelect:()=>{var Z;(Z=n.onCancelReasonOther)==null||Z.call(n)},onCancelReason:Z=>{var We;o(n.defaultIsActive??!1),l(!1),(We=n.onCancelReason)==null||We.call(n,Z)},onClose:()=>{o(n.defaultIsActive??!1),l(!1)}}):C(Bd,{className:`obi-widget-panel ${M?"expanded":""} ${f?"maximized":""} ${d?"messaging":""} ${ve?"tool-usage":""}`,children:[C("div",{className:`obi-widget ${Q?"active":""} ${t?"in-plan":""}`,onMouseEnter:b,onMouseLeave:w,children:[X&&C(pn,{type:"cancel",onClick:F,disabled:u,title:"Cancel session"}),X&&!r&&C(pn,{type:"pause",onClick:n.onPause,title:"Pause session"}),X&&r&&C(pn,{type:"play",onClick:n.onUnpause,title:"Unpause session"}),C(Vt,{className:"obi-widget-popout",open:Re,trigger:null,delayMs:Ne,offset:et,children:[C(Vt.Target,{children:[ht&&C(WQ,{value:n.message,defaultValue:"Okay, let's continue.",onCancel:()=>T(!1),onSend:_,onExpand:p,onChange:n.onMessageChange,children:C("div",{className:"obi-widget-buttons",children:[C(pn,{type:"cancel",onClick:F,disabled:u,title:"Cancel session"}),!r&&C(pn,{type:"pause",onClick:n.onPause,title:"Pause session"}),r&&C(pn,{type:"play",onClick:n.onUnpause,title:"Unpause session"}),C(pn,{type:d?"voice":"message",disabled:!H||n.messaging!==void 0,onClick:()=>T(!d),title:d?"Voice input":"Text input"}),C(pn,{type:"minimize",onClick:k,title:"Minimize widget"})]})}),!ht&&C(Cd,{className:Q&&!t?"button":"",isActive:Q,speakingStatus:n.speakingStatus,onClick:x,onMouseEnter:y,onMouseLeave:B,children:[Q&&!t&&!Be&&C("span",{className:"obi-widget-pill-text",children:"Tutorials"}),Q&&t&&Be&&C("span",{className:"obi-widget-pill-text",children:"Searching knowledge ..."}),Q&&t&&!q&&!Be&&C(by,{getBands:n.spectrum}),Q&&q&&!Be&&C(By,{})]})]}),C(Vt.Content,{children:C("div",{onMouseLeave:w,children:[Y&&C(XA,{onClick:x,children:"Click to see all"}),ie&&C(XA,{children:"Session will pause shortly"}),Qe&&C(XA,{children:"Paused"}),qe&&C(XA,{onClick:E,children:"Ready to continue?"}),u&&C(TQ,{onContinue:()=>{var Z;(Z=n.onCancelAbort)==null||Z.call(n),l(!1),n.messaging!==void 0&&h(n.messaging)},onWrapUp:()=>{var Z;(Z=n.onCancel)==null||Z.call(n)}})]})})]}),X&&C(pn,{type:d?"voice":"message",disabled:!H||n.messaging!==void 0,onClick:()=>T(!d),title:d?"Voice input":"Text input"}),X&&C(pn,{type:"minimize",onClick:k,title:"Minimize widget"})]}),ne&&n.courseProgress&&C("div",{className:`obi-course-progress-container ${d?"expanded":""}`,children:C(qQ,{currentStep:n.courseProgress.currentStep,totalSteps:n.courseProgress.totalSteps,stepNames:n.courseProgress.stepNames})})]})}function zQ(n){const{disabled:e}=n,[t,r]=ge(null),[i,A]=ge(n.isActive??n.defaultIsActive??!1),[s,o]=ge(!1),[a,c]=ge(n.hovered??!1);function u(){var b;A(!0),o(!1),c(!0),(b=n.onHover)==null||b.call(n,!0)}function l(){}function d(){t&&(clearTimeout(t),r(null))}function h(){i&&r(setTimeout(()=>{var b;A(n.defaultIsActive??!1),c(!1),(b=n.onHover)==null||b.call(n,!1)},400))}function f(){A(!1),o(!0)}function p(){var b;(b=n.onOpen)==null||b.call(n)}const g=n.hovered??(a&&!s),v=n.isActive??(i&&!e&&!s),y=v&&g,B=`round-button ${v?"active":""}`;return C("div",{className:"obi-widget-out-of-plan-container",children:C("div",{className:`obi-widget-out-of-plan ${g?"hover":""} ${v?"active":""}`,onMouseEnter:d,onMouseLeave:h,children:[C("div",{className:B,style:{width:"27px",height:"30px"}}),C(Vt,{className:"obi-widget-popout",open:y,trigger:null,delayMs:400,offset:5,children:[C(Vt.Target,{children:C(vy,{className:v?"button":"",active:v,onClick:p,onMouseEnter:u,onMouseLeave:l,children:v&&C("span",{className:"text",children:"Tutorials"})})}),C(Vt.Content,{children:C("div",{onMouseLeave:h,children:C(XA,{className:"message",onClick:p,children:"Click to see all"})})})]}),C(pn,{className:B,type:"minimize",onClick:f,title:"Minimize widget"})]})})}function XQ(n){return C("div",{className:"obi-widget-out-of-plan-container",children:C("div",{className:"obi-widget-out-of-plan",children:C(Vt,{className:"obi-widget-popout",open:!0,trigger:null,delayMs:100,offset:5,children:[C(Vt.Target,{children:C(vy,{active:!1})}),C(Vt.Content,{children:C(IQ,{onOtherSelect:()=>{var e;(e=n.onOtherSelect)==null||e.call(n)},onReasonSelect:(e,t)=>{var r;(r=n.onCancelReason)==null||r.call(n,e,t)},onClose:()=>{var e;(e=n.onClose)==null||e.call(n)}})})]})})})}function YQ({open:n=!1,children:e,onClose:t}){return C(my,{open:n,onClose:t,children:C("div",{className:"tour content-area",children:n?typeof e=="function"?e():e:null})})}function Hi({title:n="",subtitle:e="",agentName:t="Obi",buttonText:r="Continue",speakingState:i=null,actionDisabled:A=!1,href:s=null,centerVisual:o,description:a,button:c,onAction:u}){const[l,d]=ge(A),[h,f]=ge(!1),[p,g]=ge(i);return Kt(()=>{h||(i==="listening"&&p!=="listening"&&l&&d(!1),i!=="listening"&&!l&&d(!0)),g(i)},[i,l]),Kt(()=>{d(A)},[A]),C("div",{className:"tour-content",children:C("div",{className:"container",children:[C("div",{className:"header",children:[C("h1",{className:"title",children:n}),C("p",{className:"subtitle",children:e})]}),C("div",{className:"visual",style:{background:"var(--obi-color-tint)"},children:o}),C("div",{className:"description",children:a}),C("div",{className:"button-container",children:c||C(s?"a":"button",{className:`action-button ${l?"disabled":""}`,onClick:()=>{l||(d(!0),f(!0),u==null||u())},disabled:l,...s?{href:s,target:"_blank",rel:"noopener noreferrer"}:{type:"button"},children:C("span",{className:"button-text",children:(()=>{switch(i){case"thinking":return"Loading...";case"speaking":return`${t} is speaking`;default:return r}})()})})})]})})}function ZQ({logoUrl:n="",appName:e="App"}){const[t,r]=ge(!1),[i,A]=ge(!1),s=()=>{r(!0)},o=()=>{A(!0),r(!1)},a={container:{display:"block"},logoContainer:{width:"480px",height:"240px",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"},backgroundPattern:{position:"absolute",inset:0,zIndex:0,background:"#F5F5F5",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='277' height='195' viewBox='0 0 277 195' fill='none'%3E%3Cpath opacity='0.4' d='M341.308 0.75C380.279 0.750001 411.872 24.3772 411.872 53.5229C411.872 82.6685 380.279 106.296 341.308 106.296H215.792C176.964 108.335 145.691 130.837 141.128 159.475V256.616C145.912 286.659 180.089 309.954 221.548 309.954H330.872C375.607 309.954 411.872 282.833 411.872 249.377V159.069C411.872 129.923 443.465 106.296 482.436 106.296C521.407 106.296 553 129.923 553 159.069V257.181C553 285.058 524.099 307.88 487.483 309.815C489.264 309.902 491.061 309.954 492.871 309.954C448.137 309.954 411.872 337.076 411.872 370.532C411.872 369.177 411.803 367.834 411.686 366.502C409.098 393.885 378.582 415.5 341.308 415.5H210.118C171.147 415.5 139.554 391.873 139.554 362.727C139.554 362.204 139.565 361.683 139.585 361.163C133.564 332.156 100.023 309.954 59.5488 309.954C61.4544 309.954 63.3441 309.9 65.2169 309.803C28.7434 307.76 -8.57239e-07 284.982 0 257.181V159.069C1.64632e-06 130.901 29.5078 107.89 66.6662 106.377C64.3207 106.224 61.9472 106.141 59.5488 106.141C100.012 106.141 133.54 83.951 139.575 54.9552C139.558 54.4793 139.554 54.0018 139.554 53.5229C139.554 24.3772 171.147 0.75 210.118 0.75H341.308Z' fill='white'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"190px 60px",backgroundSize:"300px 225px"},logoWrapper:{background:"#888888",width:"120px",height:"120px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",zIndex:10,overflow:"hidden"},appLogo:{width:"120px",height:"120px",objectFit:"cover",display:n&&!t&&i?"block":"none"},placeholderLogo:{width:"60px",height:"60px",background:"rgba(255, 255, 255, 0.2)",borderRadius:"4px",display:!n||t||!i?"flex":"none",alignItems:"center",justifyContent:"center",color:"rgba(255, 255, 255, 0.8)",fontSize:"24px",fontWeight:"bold"}};return C("div",{style:a.container,children:C("div",{style:a.logoContainer,children:[C("div",{style:a.backgroundPattern}),C("div",{style:a.logoWrapper,children:[n&&C("img",{style:a.appLogo,src:n,alt:`${e} logo`,onError:s,onLoad:o}),C("div",{style:a.placeholderLogo,children:e.charAt(0).toUpperCase()})]})]})})}function $Q({session:n,speakingState:e,onAction:t}){const r=n.appName?`Navigate to ${n.appName}`:"Navigate to app",i=n.appName?`Open ${n.appName}`:"Open app",A=n.appName?`Enjoy the tutorial in ${n.appName}`:"Enjoy the tutorial";return C(Hi,{title:r,subtitle:"Click the button below to open the app",agentName:n.agentName||"Obi",buttonText:i,speakingState:e,actionDisabled:!0,href:n.url,description:A,centerVisual:C(ZQ,{logoUrl:n.appLogoUrl,appName:n.appName}),onAction:t})}function Py({className:n=""}){return C("svg",{width:"64",height:"64",viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,children:C("path",{d:"M158.803 0L160.352 0.0399439C176.267 0.844061 188.922 13.9634 188.922 30.0311C188.922 46.6174 175.438 60.0653 158.803 60.0656H99.0263L98.9061 60.0722C78.8071 61.4795 62.6269 77.004 60.2644 96.7673L60.241 96.9704V158.93L60.2644 159.13C62.7406 179.86 80.4234 195.934 101.881 195.935H153.842C176.993 195.935 195.759 177.223 195.759 154.14V96.9138L195.799 95.3693C196.606 79.5009 209.766 66.8827 225.881 66.8827C242.515 66.8834 256 80.328 256 96.9138V159.086L255.963 160.564C255.225 175.748 243.176 187.971 228.038 189.038V189.214C207.121 190.591 190.4 207.263 189.019 228.119H188.842C187.738 243.7 174.712 256 158.803 256H96.4491C79.8147 256 66.3309 242.555 66.3302 225.969C66.3302 225.673 66.3349 225.375 66.3436 225.077H66.3503H66.3035C63.3344 206.008 47.4427 190.589 27.8321 189.231L27.8354 189.031C12.2702 187.868 0.000167669 174.905 0 159.086V96.9138L0.0367222 95.4192C0.791087 80.0787 13.0909 67.7634 28.453 66.9293C47.7697 65.3039 63.3522 50.3234 66.2969 31.4658L66.3469 31.1595L66.3369 30.85C66.3301 30.5933 66.3302 30.3238 66.3302 30.0311C66.3309 13.4454 79.8148 0.000165137 96.4491 0H158.803Z",fill:"currentColor"})})}function eR({children:n}){const e={container:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},logo:{display:"flex",width:"120px",height:"120px",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",borderRadius:"8px",color:"#FFFFFF",position:"relative",overflow:"hidden",background:"var(--obi-color-primary)",boxShadow:`
43
43
  0 0 20px color-mix(in srgb, var(--obi-color-primary) 20%, transparent),
44
44
  0 0 40px color-mix(in srgb, var(--obi-color-primary) 15%, transparent),
45
45
  0 0 60px color-mix(in srgb, var(--obi-color-primary) 8%, transparent)
@@ -54,7 +54,7 @@ a=extmap-allow-mixed`)!==-1){const A=i.sdp.split(`
54
54
  50% { transform: translateX(344px); }
55
55
  100% { transform: translateX(344px); }
56
56
  }
57
- `}),C("article",{style:n.skeletonContainer,role:"status","aria-label":"Loading content",children:[C("section",{style:n.headerSection,children:[C("div",{style:n.avatar,role:"img","aria-label":"Loading avatar",children:C("div",{style:n.shimmer})}),C("div",{style:n.textLines,children:[C("div",{style:n.textLine,role:"presentation","aria-label":"Loading text line 1",children:C("div",{style:n.shimmer})}),C("div",{style:n.textLine,role:"presentation","aria-label":"Loading text line 2",children:C("div",{style:n.shimmer})})]})]}),C("section",{style:n.contentSection,children:C("div",{style:n.contentBlock,role:"presentation","aria-label":"Loading card content",children:C("div",{style:n.shimmer})})})]})]})}function oR({}){const n={host:{display:"block"},shareContainer:{width:"480px",height:"240px",borderRadius:"12px",display:"grid",placeItems:"center",overflow:"hidden",position:"relative",backgroundColor:"var(--obi-color-tint)"},controlsRow:{zIndex:10,gridRowStart:1,gridColumnStart:1,display:"flex",alignSelf:"flex-start",marginTop:"36px",alignItems:"center",gap:"8px"},monitorIconContainer:{display:"flex",height:"40px",width:"40px",aspectRatio:"1",alignItems:"center",justifyContent:"center",gap:"8px",borderRadius:"2px",border:"1px solid #E4E4E7",background:"#F8FAFC",padding:"8px"},monitorIcon:{width:"24px",height:"24px",color:"#111827"},tabSelector:{display:"flex",width:"260px",height:"40px",padding:"4px",alignItems:"center",borderRadius:"2px",background:"#E4E4E7"},tabButton:e=>({display:"flex",flex:1,alignSelf:"stretch",alignItems:"center",justifyContent:"center",gap:"10px",borderRadius:"2px",padding:"6px 12px",border:"none",cursor:"pointer",fontFamily:"'Satoshi', sans-serif",fontSize:"14px",fontWeight:500,opacity:e?1:.4,background:e?"white":"#F8FAFC",boxShadow:e?"0 1px 2px 0 rgba(0, 0, 0, 0.05)":"none"}),skeletonContainer:{marginTop:"104px",gridColumnStart:1,gridRowStart:1,alignSelf:"center"}};return C("div",{style:n.host,children:C("div",{style:n.shareContainer,children:[C("div",{style:n.controlsRow,children:[C("div",{style:n.monitorIconContainer,children:C("svg",{style:n.monitorIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[C("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",ry:"2"}),C("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),C("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]})}),C("div",{style:n.tabSelector,children:[C("button",{style:n.tabButton(!1),children:"Tab"}),C("button",{style:n.tabButton(!0),children:"Window"})]})]}),C("div",{style:n.skeletonContainer,children:C(sR,{})})]})})}function aR({session:n,speakingState:e,onAction:t}){return C(Hi,{title:"Connect your screen",subtitle:"Watch for the prompt in your browser",agentName:n.agentName||"Obi",buttonText:"Share screen",speakingState:e,description:`${n.agentName||"Obi"} will guide you through ${n.appName||"the app"} by watching your screen.`,centerVisual:C(oR,{}),actionDisabled:!0,onAction:t})}function cR({spectrum:n}){return C("div",{style:{borderRadius:"15px",boxShadow:"0 0 20px 2px var(--obi-color-primary)",backgroundColor:"var(--obi-color-primary)",transform:"scale(1.6)"},children:C(Cd,{isActive:!0,children:C(by,{getBands:n})})})}function uR({session:n,speakingState:e,spectrum:t,onAction:r}){return C(Hi,{title:"Overview",subtitle:`${n.agentName||"Obi"} will start your tutorial in a moment`,agentName:n.agentName||"Obi",speakingState:e,description:`Get ready to explore ${n.appName||"the app"} with ${n.agentName||"Obi"}.`,centerVisual:C(cR,{spectrum:t}),actionDisabled:!0,onAction:r})}function lR({id:n,name:e,description:t,duration:r=10,order:i=0,selected:A=!1,onClick:s}){return C("div",{className:`course-container ${A?"selected":""}`,onClick:()=>{s==null||s({id:n,name:e,description:t,duration:r,order:i})},children:[C("div",{className:"header-row",children:[C("h2",{className:"course-title",children:e}),C("span",{className:"duration",children:["~",r," mins"]})]}),t&&C("p",{className:"course-description",children:t})]})}function dR({courses:n=[],selectedCourseId:e=null,loading:t=!1,error:r="",onCourseSelect:i}){const[A,s]=ge(""),o=u=>{const l=u.currentTarget;s(l.value)},a=u=>{i==null||i(u)};if(t)return C("div",{className:"loading",children:"Loading..."});if(r)return C("div",{className:"error",children:r});if(!n||n.length===0)return C("div",{className:"empty",children:"No courses available"});const c=n.filter(u=>u.name.toLowerCase().includes(A.toLowerCase())||(u.description||"").toLowerCase().includes(A.toLowerCase()));return C("div",{className:"tour-select",children:[C("div",{className:"controls",children:[C("div",{className:"tabs",children:C("button",{className:"tab active",children:"All"})}),C("div",{className:"filter",children:[C("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:C("path",{d:"M10.0417 8.75002H9.42087L9.20004 8.53502C9.96921 7.63585 10.4417 6.47502 10.4417 5.20835C10.4417 2.56085 8.32254 0.441681 5.67504 0.441681C3.02754 0.441681 0.908374 2.56085 0.908374 5.20835C0.908374 7.85585 3.02754 9.97502 5.67504 9.97502C6.94171 9.97502 8.10254 9.50252 9.00171 8.73335L9.22671 8.95418V9.57502L13.2167 13.5592L14.375 12.4008L10.0417 8.75002ZM5.67504 8.75002C3.72754 8.75002 2.15837 7.18085 2.15837 5.20835C2.15837 3.23585 3.72754 1.66668 5.67504 1.66668C7.62254 1.66668 9.19171 3.23585 9.19171 5.20835C9.19171 7.18085 7.62254 8.75002 5.67504 8.75002Z",fill:"#6B7280"})}),C("input",{type:"text",placeholder:"Search...",value:A,onInput:o})]})]}),C("div",{className:"course-grid",children:c.sort((u,l)=>(u.order||0)-(l.order||0)).map(u=>{const l=u.id===e;return C(lR,{id:u.id,name:u.name,description:u.description||"",duration:u.duration,order:u.order||0,selected:l,onClick:a},u.id)})})]})}function hR({open:n,courses:e=[],loading:t=!1,error:r="",agentName:i="Obi",onClose:A,onCourseSelect:s}){const[o,a]=ge(null),c=l=>{a(l)},u=()=>{o&&s&&s(o)};return C(my,{open:n,onClose:A,size:"large",children:C("div",{className:"tour-select-modal-container",children:[C("div",{className:"header",children:[C("div",{className:"icon",style:{color:"white"},children:C(Py,{})}),C("div",{className:"title-section",children:t?C(St,{children:[C("div",{className:"skeleton skeleton-title"}),C("div",{className:"skeleton skeleton-subtitle"})]}):C(St,{children:[C("h1",{children:["Give ",i," a try!"]}),C("p",{className:"subtitle",children:["Pick a tutorial, share your screen, and ",i," will take it from there."]})]})})]}),C("div",{className:"course-list-wrapper",children:C(dR,{courses:e,selectedCourseId:(o==null?void 0:o.id)||"",loading:t,error:r,onCourseSelect:c})}),C("div",{className:"footer",children:[C("button",{className:"obi-button footer-button",onClick:u,disabled:!o,children:[C("span",{children:"Get started"}),C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",children:C("path",{d:"M3.83325 8.00065H13.1666M13.1666 8.00065L8.49992 3.33398M13.1666 8.00065L8.49992 12.6673",stroke:o?"#FAFAFA":"#999","stroke-width":"1.33","stroke-linecap":"round","stroke-linejoin":"round"})})]}),C("p",{className:"footer-text",children:"Sessions are securely recorded for quality improvement purposes."})]})]})})}function pR({session:n,sessionState:e,speakingState:t,spectrum:r,onStart:i,onContinue:A,onShareMicrophone:s,onShareScreen:o,onModalChange:a}){const[c,u]=ge(null);function l(h){c!==h&&(a==null||a(h),u(h))}function d(){e==="connecting"||e==="connected"||!e?i==null||i():e==="volume-check"||e==="mic-check"?A==null||A():e==="mic-share"?s==null||s():e==="screen-share"&&(o==null||o())}return yd(()=>{switch(e){case null:case"connecting":case"connected":return l("session-start"),C(tR,{session:n,speakingState:t,onAction:d});case"volume-check":return l("voice-guidance"),C(AR,{session:n,speakingState:t,onAction:d});case"mic-check":return l("overview"),C(uR,{session:n,speakingState:t,spectrum:r,onAction:d});case"mic-share":return l("share-mic"),C(rR,{session:n,speakingState:t,onAction:d});case"screen-share":return l("share-screen"),C(aR,{session:n,speakingState:t,onAction:d});case"navigate":return l("navigate"),C($Q,{session:n,speakingState:t,onAction:d});default:return null}},[e,t,i,A,s,o])}function fR(n){const{session:e,sessionState:t,speakingState:r,spectrum:i,onClose:A,onStart:s,onContinue:o,onShareMicrophone:a,onShareScreen:c,onModalChange:u}=n,[l,d]=ge(null);function h(g){u==null||u(g),d(g)}function f(g){A(g,l),d(null)}const p=(n.open??!0)&&(!t||t==="connecting"||t==="connected"||t==="volume-check"||t==="mic-check"||t==="mic-share"||t==="screen-share"||t==="navigate");return C(YQ,{open:p,onClose:f,children:()=>C(pR,{session:e,sessionState:t,speakingState:r,spectrum:i,onStart:s,onContinue:o,onShareMicrophone:a,onShareScreen:c,onModalChange:h})})}var V;if(typeof window>"u"){var Oy={hostname:""};V={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:Oy,referrer:""},screen:{width:0,height:0},location:Oy,addEventListener:function(){},removeEventListener:function(){}}}else V=window;function My(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function Ly(n,e,t,r,i,A,s){try{var o=n[A](s),a=o.value}catch(c){t(c);return}o.done?e(a):Promise.resolve(a).then(r,i)}function kd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var A=n.apply(e,t);function s(a){Ly(A,r,i,s,o,"next",a)}function o(a){Ly(A,r,i,s,o,"throw",a)}s(void 0)})}}function _a(n,e,t){return Dy()?_a=Reflect.construct:_a=function(r,i,A){var s=[null];s.push.apply(s,i);var o=Function.bind.apply(r,s),a=new o;return A&&ZA(a,A.prototype),a},_a.apply(null,arguments)}function gR(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function bt(n,e,t){return e&&gR(n.prototype,e),n}function me(){return me=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},me.apply(this,arguments)}function Ed(n){return Ed=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ed(n)}function kt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&ZA(n,e)}function te(n,e){return e!=null&&typeof Symbol<"u"&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](n):n instanceof e}function mR(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function YA(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,A;for(A=0;A<r.length;A++)i=r[A],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function ZA(n,e){return ZA=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},ZA(n,e)}function se(n){"@swc/helpers - typeof";return n&&typeof Symbol<"u"&&n.constructor===Symbol?"symbol":typeof n}function vR(n,e){if(n){if(typeof n=="string")return My(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return My(n,e)}}function Sa(n){var e=typeof Map=="function"?new Map:void 0;return Sa=function(t){if(t===null||!mR(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return _a(t,arguments,Ed(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),ZA(r,t)},Sa(n)}function Dy(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Dy=function(){return!!n})()}function W(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t)return(t=t.call(n)).next.bind(t);if(Array.isArray(n)||(t=vR(n))||e){t&&(n=t);var r=0;return function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function $A(n,e){var t,r,i,A,s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return A={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(A[Symbol.iterator]=function(){return this}),A;function o(c){return function(u){return a([c,u])}}function a(c){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(i=c[0]&2?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,r=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1],i=c;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(c);break}i[2]&&s.ops.pop(),s.trys.pop();continue}c=e.call(n,s)}catch(u){c=[6,u],r=0}finally{t=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ny(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var yR=Object.defineProperty,wR=function(n,e,t){return e in n?yR(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t},N=function(n,e,t){return wR(n,(typeof e>"u"?"undefined":se(e))!=="symbol"?e+"":e,t)},Hy,bR=Object.defineProperty,BR=function(n,e,t){return e in n?bR(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t},Ky=function(n,e,t){return BR(n,(typeof e>"u"?"undefined":se(e))!=="symbol"?e+"":e,t)},dt=function(n){return n[n.Document=0]="Document",n[n.DocumentType=1]="DocumentType",n[n.Element=2]="Element",n[n.Text=3]="Text",n[n.CDATA=4]="CDATA",n[n.Comment=5]="Comment",n}(dt||{}),Vy={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Gy={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ka={},CR=function(){return!!globalThis.Zone};function Ud(n){if(ka[n])return ka[n];var e=globalThis[n],t=e.prototype,r=n in Vy?Vy[n]:void 0,i=!!(r&&r.every(function(u){var l,d;return!!((d=(l=Object.getOwnPropertyDescriptor(t,u))==null?void 0:l.get)!=null&&d.toString().includes("[native code]"))})),A=n in Gy?Gy[n]:void 0,s=!!(A&&A.every(function(u){var l;return typeof t[u]=="function"&&((l=t[u])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!CR())return ka[n]=e.prototype,e.prototype;try{var o=document.createElement("iframe");document.body.appendChild(o);var a=o.contentWindow;if(!a)return e.prototype;var c=a[n].prototype;return document.body.removeChild(o),c?ka[n]=c:t}catch{return t}}var Td={};function wr(n,e,t){var r,i=n+"."+String(t);if(Td[i])return Td[i].call(e);var A=Ud(n),s=(r=Object.getOwnPropertyDescriptor(A,t))==null?void 0:r.get;return s?(Td[i]=s,s.call(e)):e[t]}var Id={};function jy(n,e,t){var r=n+"."+String(t);if(Id[r])return Id[r].bind(e);var i=Ud(n),A=i[t];return typeof A!="function"?e[t]:(Id[r]=A,A.bind(e))}function _R(n){return wr("Node",n,"childNodes")}function SR(n){return wr("Node",n,"parentNode")}function kR(n){return wr("Node",n,"parentElement")}function ER(n){return wr("Node",n,"textContent")}function UR(n,e){return jy("Node",n,"contains")(e)}function TR(n){return jy("Node",n,"getRootNode")()}function IR(n){return!n||!("host"in n)?null:wr("ShadowRoot",n,"host")}function FR(n){return n.styleSheets}function xR(n){return!n||!("shadowRoot"in n)?null:wr("Element",n,"shadowRoot")}function QR(n,e){return wr("Element",n,"querySelector")(e)}function RR(n,e){return wr("Element",n,"querySelectorAll")(e)}function PR(){return Ud("MutationObserver").constructor}var Et={childNodes:_R,parentNode:SR,parentElement:kR,textContent:ER,contains:UR,getRootNode:TR,host:IR,styleSheets:FR,shadowRoot:xR,querySelector:QR,querySelectorAll:RR,mutationObserver:PR};function Wy(n){return n.nodeType===n.ELEMENT_NODE}function es(n){var e=n&&"host"in n&&"mode"in n&&Et.host(n)||null;return!!(e&&"shadowRoot"in e&&Et.shadowRoot(e)===n)}function ts(n){return Object.prototype.toString.call(n)==="[object ShadowRoot]"}function OR(n){return n.includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}function MR(n){var e=n.cssText;if(e.split('"').length<3)return e;var t=["@import","url("+JSON.stringify(n.href)+")"];return n.layerName===""?t.push("layer"):n.layerName&&t.push("layer("+n.layerName+")"),n.supportsText&&t.push("supports("+n.supportsText+")"),n.media.length&&t.push(n.media.mediaText),t.join(" ")+";"}function Fd(n){try{var e=n.rules||n.cssRules;if(!e)return null;var t=n.href;!t&&n.ownerNode&&n.ownerNode.ownerDocument&&(t=n.ownerNode.ownerDocument.location.href);var r=Array.from(e,function(i){return qy(i,t)}).join("");return OR(r)}catch{return null}}function qy(n,e){if(DR(n)){var t;try{t=Fd(n.styleSheet)||MR(n)}catch{t=n.cssText}return n.styleSheet.href?Ea(t,n.styleSheet.href):t}else{var r=n.cssText;return NR(n)&&n.selectorText.includes(":")&&(r=LR(r)),e?Ea(r,e):r}}function LR(n){var e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return n.replace(e,"$1\\$2")}function DR(n){return"styleSheet"in n}function NR(n){return"selectorText"in n}var Jy=function(){function n(){Ky(this,"idNodeMap",new Map),Ky(this,"nodeMetaMap",new WeakMap)}var e=n.prototype;return e.getId=function(t){var r;if(!t)return-1;var i=(r=this.getMeta(t))==null?void 0:r.id;return i??-1},e.getNode=function(t){return this.idNodeMap.get(t)||null},e.getIds=function(){return Array.from(this.idNodeMap.keys())},e.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.removeNodeFromMap=function(t){var r=this,i=this.getId(t);this.idNodeMap.delete(i),t.childNodes&&t.childNodes.forEach(function(A){return r.removeNodeFromMap(A)})},e.has=function(t){return this.idNodeMap.has(t)},e.hasNode=function(t){return this.nodeMetaMap.has(t)},e.add=function(t,r){var i=r.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,r)},e.replace=function(t,r){var i=this.getNode(t);if(i){var A=this.nodeMetaMap.get(i);A&&this.nodeMetaMap.set(r,A)}this.idNodeMap.set(t,r)},e.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},n}();function HR(){return new Jy}function xd(n){var e=n.element,t=n.maskInputOptions,r=n.tagName,i=n.type,A=n.value,s=n.maskInputFn,o=A||"",a=i&&Zr(i);return(t[r.toLowerCase()]||a&&t[a])&&(s?o=s(o,e):o="*".repeat(o.length)),o}function Zr(n){return n.toLowerCase()}var zy="__rrweb_original__";function KR(n){var e=n.getContext("2d");if(!e)return!0;for(var t=50,r=0;r<n.width;r+=t)for(var i=0;i<n.height;i+=t){var A=e.getImageData,s=zy in A?A[zy]:A,o=new Uint32Array(s.call(e,r,i,Math.min(t,n.width-r),Math.min(t,n.height-i)).data.buffer);if(o.some(function(a){return a!==0}))return!1}return!0}function Qd(n){var e=n.type;return n.hasAttribute("data-rr-is-password")?"password":e?Zr(e):null}function Xy(n,e){var t;try{t=new URL(n,e??window.location.href)}catch{return null}var r=/\.([0-9a-z]+)(?:$)/i,i=t.pathname.match(r),A;return(A=i==null?void 0:i[1])!=null?A:null}function VR(n){var e="";return n.indexOf("//")>-1?e=n.split("/").slice(0,3).join("/"):e=n.split("/")[0],e=e.split("?")[0],e}var GR=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,jR=/^(?:[a-z+]+:)?\/\//i,WR=/^www\..*/i,qR=/^(data:)([^,]*),(.*)/i;function Ea(n,e){return(n||"").replace(GR,function(t,r,i,A,s,o){var a=i||s||o,c=r||A||"";if(!a)return t;if(jR.test(a)||WR.test(a)||qR.test(a))return"url("+c+a+c+")";if(a[0]==="/")return"url("+c+(VR(e)+a)+c+")";var u=e.split("/"),l=a.split("/");u.pop();for(var d=W(l),h;!(h=d()).done;){var f=h.value;f!=="."&&(f===".."?u.pop():u.push(f))}return"url("+c+u.join("/")+c+")"})}function Rd(n){return n.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function JR(n,e){var t=Array.from(e.childNodes),r=[];if(t.length>1&&n&&typeof n=="string"){for(var i=Rd(n),A=1;A<t.length;A++)if(t[A].textContent&&typeof t[A].textContent=="string")for(var s=Rd(t[A].textContent),o=3;o<s.length;o++){var a=s.substring(0,o);if(i.split(a).length===2){for(var c=i.indexOf(a),u=c;u<n.length;u++)if(Rd(n.substring(0,u)).length===c){r.push(n.substring(0,u)),n=n.substring(u);break}break}}}return r.push(n),r}function zR(n,e){return JR(n,e).join("/* rr_split */")}var XR=1,YR=new RegExp("[^a-z0-9-_:]"),ns=-2;function Yy(){return XR++}function ZR(n){if(te(n,HTMLFormElement))return"form";var e=Zr(n.tagName);return YR.test(e)?"div":e}var Ki,Zy,$R=/^[^ \t\n\r\u000c]+/,eP=/^[, \t\n\r\u000c]+/;function tP(n,e){if(e.trim()==="")return e;var t=0;function r(c){var u,l=c.exec(e.substring(t));return l?(u=l[0],t+=u.length,u):""}for(var i=[];r(eP),!(t>=e.length);){var A=r($R);if(A.slice(-1)===",")A=Ua(n,A.substring(0,A.length-1)),i.push(A);else{var s="";A=Ua(n,A);for(var o=!1;;){var a=e.charAt(t);if(a===""){i.push((A+s).trim());break}else if(o)a===")"&&(o=!1);else if(a===","){t+=1,i.push((A+s).trim());break}else a==="("&&(o=!0);s+=a,t+=1}}}return i.join(", ")}var $y=new WeakMap;function Ua(n,e){return!e||e.trim()===""?e:Pd(n,e)}function nP(n){return!!(n.tagName==="svg"||n.ownerSVGElement)}function Pd(n,e){var t=$y.get(n);if(t||(t=n.createElement("a"),$y.set(n,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function ew(n,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?Ua(n,r):t==="srcset"?tP(n,r):t==="style"?Ea(r,Pd(n)):e==="object"&&t==="data"?Ua(n,r):r)}function tw(n,e,t){return(n==="video"||n==="audio")&&e==="autoplay"}function rP(n,e,t){try{if(typeof e=="string"){if(n.classList.contains(e))return!0}else for(var r=n.classList.length;r--;){var i=n.classList[r];if(e.test(i))return!0}if(t)return n.matches(t)}catch{}return!1}function Ta(n,e,t){if(!n)return!1;if(n.nodeType!==n.ELEMENT_NODE)return t?Ta(Et.parentNode(n),e,t):!1;for(var r=n.classList.length;r--;){var i=n.classList[r];if(e.test(i))return!0}return t?Ta(Et.parentNode(n),e,t):!1}function nw(n,e,t,r){var i;if(Wy(n)){if(i=n,!Et.childNodes(i).length)return!1}else{if(Et.parentElement(n)===null)return!1;i=Et.parentElement(n)}try{if(typeof e=="string"){if(r){if(i.closest("."+e))return!0}else if(i.classList.contains(e))return!0}else if(Ta(i,e,r))return!0;if(t){if(r){if(i.closest(t))return!0}else if(i.matches(t))return!0}}catch{}return!1}function iP(n,e,t){var r=n.contentWindow;if(r){var i=!1,A;try{A=r.document.readyState}catch{return}if(A!=="complete"){var s=setTimeout(function(){i||(e(),i=!0)},t);n.addEventListener("load",function(){clearTimeout(s),i=!0,e()});return}var o="about:blank";if(r.location.href!==o||n.src===o||n.src==="")return setTimeout(e,0),n.addEventListener("load",e);n.addEventListener("load",e)}}function AP(n,e,t){var r=!1,i;try{i=n.sheet}catch{return}if(!i){var A=setTimeout(function(){r||(e(),r=!0)},t);n.addEventListener("load",function(){clearTimeout(A),r=!0,e()})}}function sP(n,e){var t=e.doc,r=e.mirror,i=e.blockClass,A=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,c=a===void 0?{}:a,u=e.maskTextFn,l=e.maskInputFn,d=e.dataURLOptions,h=d===void 0?{}:d,f=e.inlineImages,p=e.recordCanvas,g=e.keepIframeSrcFn,v=e.newlyAddedElement,y=v===void 0?!1:v,B=e.cssCaptured,b=B===void 0?!1:B,w=oP(t,r);switch(n.nodeType){case n.DOCUMENT_NODE:return n.compatMode!=="CSS1Compat"?{type:dt.Document,childNodes:[],compatMode:n.compatMode}:{type:dt.Document,childNodes:[]};case n.DOCUMENT_TYPE_NODE:return{type:dt.DocumentType,name:n.name,publicId:n.publicId,systemId:n.systemId,rootId:w};case n.ELEMENT_NODE:return cP(n,{doc:t,blockClass:i,blockSelector:A,inlineStylesheet:o,maskInputOptions:c,maskInputFn:l,dataURLOptions:h,inlineImages:f,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:y,rootId:w});case n.TEXT_NODE:return aP(n,{doc:t,needsMask:s,maskTextFn:u,rootId:w,cssCaptured:b});case n.CDATA_SECTION_NODE:return{type:dt.CDATA,textContent:"",rootId:w};case n.COMMENT_NODE:return{type:dt.Comment,textContent:Et.textContent(n)||"",rootId:w};default:return!1}}function oP(n,e){if(e.hasNode(n)){var t=e.getId(n);return t===1?void 0:t}}function aP(n,e){var t=e.needsMask,r=e.maskTextFn,i=e.rootId,A=e.cssCaptured,s=Et.parentNode(n),o=s&&s.tagName,a="",c=o==="STYLE"?!0:void 0,u=o==="SCRIPT"?!0:void 0;return u?a="SCRIPT_PLACEHOLDER":A||(a=Et.textContent(n),c&&a&&(a=Ea(a,Pd(e.doc)))),!c&&!u&&a&&t&&(a=r?r(a,Et.parentElement(n)):a.replace(/[\S]/g,"*")),{type:dt.Text,textContent:a||"",rootId:i}}function cP(n,e){for(var t=e.doc,r=e.blockClass,i=e.blockSelector,A=e.inlineStylesheet,s=e.maskInputOptions,o=s===void 0?{}:s,a=e.maskInputFn,c=e.dataURLOptions,u=c===void 0?{}:c,l=e.inlineImages,d=e.recordCanvas,h=e.keepIframeSrcFn,f=e.newlyAddedElement,p=f===void 0?!1:f,g=e.rootId,v=rP(n,r,i),y=ZR(n),B={},b=n.attributes.length,w=0;w<b;w++){var _=n.attributes[w];tw(y,_.name,_.value)||(B[_.name]=ew(t,y,Zr(_.name),_.value))}if(y==="link"&&A){var k=Array.from(t.styleSheets).find(function(Re){return Re.href===n.href}),F=null;k&&(F=Fd(k)),F&&(delete B.rel,delete B.href,B._cssText=F)}if(y==="style"&&n.sheet){var x=Fd(n.sheet);x&&(n.childNodes.length>1&&(x=zR(x,n)),B._cssText=x)}if(y==="input"||y==="textarea"||y==="select"){var U=n.value,T=n.checked;B.type!=="radio"&&B.type!=="checkbox"&&B.type!=="submit"&&B.type!=="button"&&U?B.value=xd({element:n,type:Qd(n),tagName:y,value:U,maskInputOptions:o,maskInputFn:a}):T&&(B.checked=T)}if(y==="option"&&(n.selected&&!o.select?B.selected=!0:delete B.selected),y==="dialog"&&n.open&&(B.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal"),y==="canvas"&&d){if(n.__context==="2d")KR(n)||(B.rr_dataURL=n.toDataURL(u.type,u.quality));else if(!("__context"in n)){var Q=n.toDataURL(u.type,u.quality),M=t.createElement("canvas");M.width=n.width,M.height=n.height;var X=M.toDataURL(u.type,u.quality);Q!==X&&(B.rr_dataURL=Q)}}if(y==="img"&&l){Ki||(Ki=t.createElement("canvas"),Zy=Ki.getContext("2d"));var H=n,q=H.currentSrc||H.getAttribute("src")||"<unknown-src>",ve=H.crossOrigin,Y=function(){H.removeEventListener("load",Y);try{Ki.width=H.naturalWidth,Ki.height=H.naturalHeight,Zy.drawImage(H,0,0),B.rr_dataURL=Ki.toDataURL(u.type,u.quality)}catch(Re){if(H.crossOrigin!=="anonymous"){H.crossOrigin="anonymous",H.complete&&H.naturalWidth!==0?Y():H.addEventListener("load",Y);return}else console.warn("Cannot inline img src="+q+"! Error: "+Re)}H.crossOrigin==="anonymous"&&(ve?B.crossOrigin=ve:H.removeAttribute("crossorigin"))};H.complete&&H.naturalWidth!==0?Y():H.addEventListener("load",Y)}if(y==="audio"||y==="video"){var ie=B;ie.rr_mediaState=n.paused?"paused":"played",ie.rr_mediaCurrentTime=n.currentTime,ie.rr_mediaPlaybackRate=n.playbackRate,ie.rr_mediaMuted=n.muted,ie.rr_mediaLoop=n.loop,ie.rr_mediaVolume=n.volume}if(p||(n.scrollLeft&&(B.rr_scrollLeft=n.scrollLeft),n.scrollTop&&(B.rr_scrollTop=n.scrollTop)),v){var Qe=n.getBoundingClientRect(),qe=Qe.width,Be=Qe.height;B={class:B.class,rr_width:""+qe+"px",rr_height:""+Be+"px"}}y==="iframe"&&!h(B.src)&&(n.contentDocument||(B.rr_src=B.src),delete B.src);var ht;try{customElements.get(y)&&(ht=!0)}catch{}return{type:dt.Element,tagName:y,attributes:B,childNodes:[],isSVG:nP(n)||void 0,needBlock:v,rootId:g,isCustom:ht}}function xe(n){return n==null?"":n.toLowerCase()}function uP(n,e){return!!(e.comment&&n.type===dt.Comment||n.type===dt.Element&&(e.script&&(n.tagName==="script"||n.tagName==="link"&&(n.attributes.rel==="preload"||n.attributes.rel==="modulepreload")&&n.attributes.as==="script"||n.tagName==="link"&&n.attributes.rel==="prefetch"&&typeof n.attributes.href=="string"&&Xy(n.attributes.href)==="js")||e.headFavicon&&(n.tagName==="link"&&n.attributes.rel==="shortcut icon"||n.tagName==="meta"&&(xe(n.attributes.name).match(/^msapplication-tile(image|color)$/)||xe(n.attributes.name)==="application-name"||xe(n.attributes.rel)==="icon"||xe(n.attributes.rel)==="apple-touch-icon"||xe(n.attributes.rel)==="shortcut icon"))||n.tagName==="meta"&&(e.headMetaDescKeywords&&xe(n.attributes.name).match(/^description|keywords$/)||e.headMetaSocial&&(xe(n.attributes.property).match(/^(og|twitter|fb):/)||xe(n.attributes.name).match(/^(og|twitter):/)||xe(n.attributes.name)==="pinterest")||e.headMetaRobots&&(xe(n.attributes.name)==="robots"||xe(n.attributes.name)==="googlebot"||xe(n.attributes.name)==="bingbot")||e.headMetaHttpEquiv&&n.attributes["http-equiv"]!==void 0||e.headMetaAuthorship&&(xe(n.attributes.name)==="author"||xe(n.attributes.name)==="generator"||xe(n.attributes.name)==="framework"||xe(n.attributes.name)==="publisher"||xe(n.attributes.name)==="progid"||xe(n.attributes.property).match(/^article:/)||xe(n.attributes.property).match(/^product:/))||e.headMetaVerification&&(xe(n.attributes.name)==="google-site-verification"||xe(n.attributes.name)==="yandex-verification"||xe(n.attributes.name)==="csrf-token"||xe(n.attributes.name)==="p:domain_verify"||xe(n.attributes.name)==="verify-v1"||xe(n.attributes.name)==="verification"||xe(n.attributes.name)==="shopify-checkout-api-token"))))}function Vi(n,e){var t=e.doc,r=e.mirror,i=e.blockClass,A=e.blockSelector,s=e.maskTextClass,o=e.maskTextSelector,a=e.skipChild,c=a===void 0?!1:a,u=e.inlineStylesheet,l=u===void 0?!0:u,d=e.maskInputOptions,h=d===void 0?{}:d,f=e.maskTextFn,p=e.maskInputFn,g=e.slimDOMOptions,v=e.dataURLOptions,y=v===void 0?{}:v,B=e.inlineImages,b=B===void 0?!1:B,w=e.recordCanvas,_=w===void 0?!1:w,k=e.onSerialize,F=e.onIframeLoad,x=e.iframeLoadTimeout,U=x===void 0?5e3:x,T=e.onStylesheetLoad,Q=e.stylesheetLoadTimeout,M=Q===void 0?5e3:Q,X=e.keepIframeSrcFn,H=X===void 0?function(){return!1}:X,q=e.newlyAddedElement,ve=q===void 0?!1:q,Y=e.cssCaptured,ie=Y===void 0?!1:Y,Qe=e.needsMask,qe=e.preserveWhiteSpace,Be=qe===void 0?!0:qe;if(!Qe){var ht=Qe===void 0;Qe=nw(n,s,o,ht)}var Re=sP(n,{doc:t,mirror:r,blockClass:i,blockSelector:A,needsMask:Qe,inlineStylesheet:l,maskInputOptions:h,maskTextFn:f,maskInputFn:p,dataURLOptions:y,inlineImages:b,recordCanvas:_,keepIframeSrcFn:H,newlyAddedElement:ve,cssCaptured:ie});if(!Re)return console.warn(n,"not serialized"),null;var Ne;r.hasNode(n)?Ne=r.getId(n):uP(Re,g)||!Be&&Re.type===dt.Text&&!Re.textContent.replace(/^\s+|\s+$/gm,"").length?Ne=ns:Ne=Yy();var ne=Object.assign(Re,{id:Ne});if(r.add(n,ne),Ne===ns)return null;k&&k(n);var et=!c;if(ne.type===dt.Element){et=et&&!ne.needBlock,delete ne.needBlock;var Z=Et.shadowRoot(n);Z&&ts(Z)&&(ne.isShadowHost=!0)}if((ne.type===dt.Document||ne.type===dt.Element)&&et){g.headWhitespace&&ne.type===dt.Element&&ne.tagName==="head"&&(Be=!1);var We={doc:t,mirror:r,blockClass:i,blockSelector:A,needsMask:Qe,maskTextClass:s,maskTextSelector:o,skipChild:c,inlineStylesheet:l,maskInputOptions:h,maskTextFn:f,maskInputFn:p,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:_,preserveWhiteSpace:Be,onSerialize:k,onIframeLoad:F,iframeLoadTimeout:U,onStylesheetLoad:T,stylesheetLoadTimeout:M,keepIframeSrcFn:H,cssCaptured:!1};if(!(ne.type===dt.Element&&ne.tagName==="textarea"&&ne.attributes.value!==void 0)){ne.type===dt.Element&&ne.attributes._cssText!==void 0&&typeof ne.attributes._cssText=="string"&&(We.cssCaptured=!0);for(var Us=W(Array.from(Et.childNodes(n))),Ts;!(Ts=Us()).done;){var Pp=Ts.value,Kc=Vi(Pp,We);Kc&&ne.childNodes.push(Kc)}}var Qr=null;if(Wy(n)&&(Qr=Et.shadowRoot(n)))for(var oi=W(Array.from(Et.childNodes(Qr))),dA;!(dA=oi()).done;){var Is=dA.value,hA=Vi(Is,We);hA&&(ts(Qr)&&(hA.isShadow=!0),ne.childNodes.push(hA))}}var ai=Et.parentNode(n);return ai&&es(ai)&&ts(ai)&&(ne.isShadow=!0),ne.type===dt.Element&&ne.tagName==="iframe"&&iP(n,function(){var Yn=n.contentDocument;if(Yn&&F){var ci=Vi(Yn,{doc:Yn,mirror:r,blockClass:i,blockSelector:A,needsMask:Qe,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:f,maskInputFn:p,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:_,preserveWhiteSpace:Be,onSerialize:k,onIframeLoad:F,iframeLoadTimeout:U,onStylesheetLoad:T,stylesheetLoadTimeout:M,keepIframeSrcFn:H});ci&&F(n,ci)}},U),ne.type===dt.Element&&ne.tagName==="link"&&typeof ne.attributes.rel=="string"&&(ne.attributes.rel==="stylesheet"||ne.attributes.rel==="preload"&&typeof ne.attributes.href=="string"&&Xy(ne.attributes.href)==="css")&&AP(n,function(){if(T){var Yn=Vi(n,{doc:t,mirror:r,blockClass:i,blockSelector:A,needsMask:Qe,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:f,maskInputFn:p,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:_,preserveWhiteSpace:Be,onSerialize:k,onIframeLoad:F,iframeLoadTimeout:U,onStylesheetLoad:T,stylesheetLoadTimeout:M,keepIframeSrcFn:H});Yn&&T(n,Yn)}},M),ne}function lP(n,e){var t=e||{},r=t.mirror,i=r===void 0?new Jy:r,A=t.blockClass,s=A===void 0?"rr-block":A,o=t.blockSelector,a=o===void 0?null:o,c=t.maskTextClass,u=c===void 0?"rr-mask":c,l=t.maskTextSelector,d=l===void 0?null:l,h=t.inlineStylesheet,f=h===void 0?!0:h,p=t.inlineImages,g=p===void 0?!1:p,v=t.recordCanvas,y=v===void 0?!1:v,B=t.maskAllInputs,b=B===void 0?!1:B,w=t.maskTextFn,_=t.maskInputFn,k=t.slimDOM,F=k===void 0?!1:k,x=t.dataURLOptions,U=t.preserveWhiteSpace,T=t.onSerialize,Q=t.onIframeLoad,M=t.iframeLoadTimeout,X=t.onStylesheetLoad,H=t.stylesheetLoadTimeout,q=t.keepIframeSrcFn,ve=q===void 0?function(){return!1}:q,Y=b===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:b===!1?{password:!0}:b,ie=F===!0||F==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:F==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:F===!1?{}:F;return Vi(n,{doc:n,mirror:i,blockClass:s,blockSelector:a,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:Y,maskTextFn:w,maskInputFn:_,slimDOMOptions:ie,dataURLOptions:x,inlineImages:g,recordCanvas:y,preserveWhiteSpace:U,onSerialize:T,onIframeLoad:Q,iframeLoadTimeout:M,onStylesheetLoad:X,stylesheetLoadTimeout:H,keepIframeSrcFn:ve,newlyAddedElement:!1})}function dP(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function hP(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return te(this,r)?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var Od={exports:{}},Me=String,rw=function(){return{isColorSupported:!1,reset:Me,bold:Me,dim:Me,italic:Me,underline:Me,inverse:Me,hidden:Me,strikethrough:Me,black:Me,red:Me,green:Me,yellow:Me,blue:Me,magenta:Me,cyan:Me,white:Me,gray:Me,bgBlack:Me,bgRed:Me,bgGreen:Me,bgYellow:Me,bgBlue:Me,bgMagenta:Me,bgCyan:Me,bgWhite:Me}};Od.exports=rw(),Od.exports.createColors=rw;var pP=Od.exports,fP={},gP=Object.freeze(Object.defineProperty({__proto__:null,default:fP},Symbol.toStringTag,{value:"Module"})),At=hP(gP),iw=pP,Aw=At,Md=function(n){kt(e,n);function e(r,i,A,s,o,a){var c;return c=n.call(this,r)||this,c.name="CssSyntaxError",c.reason=r,o&&(c.file=o),s&&(c.source=s),a&&(c.plugin=a),typeof i<"u"&&typeof A<"u"&&(typeof i=="number"?(c.line=i,c.column=A):(c.line=i.line,c.column=i.column,c.endLine=A.line,c.endColumn=A.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,e),c}var t=e.prototype;return t.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},t.showSourceCode=function(r){var i=this;if(!this.source)return"";var A=this.source;r==null&&(r=iw.isColorSupported),Aw&&r&&(A=Aw(A));var s=A.split(/\r?\n/),o=Math.max(this.line-3,0),a=Math.min(this.line+2,s.length),c=String(a).length,u,l;if(r){var d=iw.createColors(!0),h=d.bold,f=d.gray,p=d.red;u=function(g){return h(p(g))},l=function(g){return f(g)}}else u=l=function(g){return g};return s.slice(o,a).map(function(g,v){var y=o+1+v,B=" "+(" "+y).slice(-c)+" | ";if(y===i.line){var b=l(B.replace(/\d/g," "))+g.slice(0,i.column-1).replace(/[^\t]/g," ");return u(">")+l(B)+g+`
57
+ `}),C("article",{style:n.skeletonContainer,role:"status","aria-label":"Loading content",children:[C("section",{style:n.headerSection,children:[C("div",{style:n.avatar,role:"img","aria-label":"Loading avatar",children:C("div",{style:n.shimmer})}),C("div",{style:n.textLines,children:[C("div",{style:n.textLine,role:"presentation","aria-label":"Loading text line 1",children:C("div",{style:n.shimmer})}),C("div",{style:n.textLine,role:"presentation","aria-label":"Loading text line 2",children:C("div",{style:n.shimmer})})]})]}),C("section",{style:n.contentSection,children:C("div",{style:n.contentBlock,role:"presentation","aria-label":"Loading card content",children:C("div",{style:n.shimmer})})})]})]})}function oR({}){const n={host:{display:"block"},shareContainer:{width:"480px",height:"240px",borderRadius:"12px",display:"grid",placeItems:"center",overflow:"hidden",position:"relative",backgroundColor:"var(--obi-color-tint)"},controlsRow:{zIndex:10,gridRowStart:1,gridColumnStart:1,display:"flex",alignSelf:"flex-start",marginTop:"36px",alignItems:"center",gap:"8px"},monitorIconContainer:{display:"flex",height:"40px",width:"40px",aspectRatio:"1",alignItems:"center",justifyContent:"center",gap:"8px",borderRadius:"2px",border:"1px solid #E4E4E7",background:"#F8FAFC",padding:"8px"},monitorIcon:{width:"24px",height:"24px",color:"#111827"},tabSelector:{display:"flex",width:"260px",height:"40px",padding:"4px",alignItems:"center",borderRadius:"2px",background:"#E4E4E7"},tabButton:e=>({display:"flex",flex:1,alignSelf:"stretch",alignItems:"center",justifyContent:"center",gap:"10px",borderRadius:"2px",padding:"6px 12px",border:"none",cursor:"pointer",fontFamily:"'Satoshi', sans-serif",fontSize:"14px",fontWeight:500,opacity:e?1:.4,background:e?"white":"#F8FAFC",boxShadow:e?"0 1px 2px 0 rgba(0, 0, 0, 0.05)":"none"}),skeletonContainer:{marginTop:"104px",gridColumnStart:1,gridRowStart:1,alignSelf:"center"}};return C("div",{style:n.host,children:C("div",{style:n.shareContainer,children:[C("div",{style:n.controlsRow,children:[C("div",{style:n.monitorIconContainer,children:C("svg",{style:n.monitorIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[C("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",ry:"2"}),C("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),C("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]})}),C("div",{style:n.tabSelector,children:[C("button",{style:n.tabButton(!1),children:"Tab"}),C("button",{style:n.tabButton(!0),children:"Window"})]})]}),C("div",{style:n.skeletonContainer,children:C(sR,{})})]})})}function aR({session:n,speakingState:e,onAction:t}){return C(Hi,{title:"Connect your screen",subtitle:"Watch for the prompt in your browser",agentName:n.agentName||"Obi",buttonText:"Share screen",speakingState:e,description:`${n.agentName||"Obi"} will guide you through ${n.appName||"the app"} by watching your screen.`,centerVisual:C(oR,{}),actionDisabled:!0,onAction:t})}function cR({spectrum:n}){return C("div",{style:{borderRadius:"15px",boxShadow:"0 0 20px 2px var(--obi-color-primary)",backgroundColor:"var(--obi-color-primary)",transform:"scale(1.6)"},children:C(Cd,{isActive:!0,children:C(by,{getBands:n})})})}function uR({session:n,speakingState:e,spectrum:t,onAction:r}){return C(Hi,{title:"Overview",subtitle:`${n.agentName||"Obi"} will start your tutorial in a moment`,agentName:n.agentName||"Obi",speakingState:e,description:`Get ready to explore ${n.appName||"the app"} with ${n.agentName||"Obi"}.`,centerVisual:C(cR,{spectrum:t}),actionDisabled:!0,onAction:r})}function lR({id:n,name:e,description:t,duration:r=10,order:i=0,selected:A=!1,onClick:s}){return C("div",{className:`course-container ${A?"selected":""}`,onClick:()=>{s==null||s({id:n,name:e,description:t,duration:r,order:i})},children:[C("div",{className:"header-row",children:[C("h2",{className:"course-title",children:e}),C("span",{className:"duration",children:["~",r," mins"]})]}),t&&C("p",{className:"course-description",children:t})]})}function dR({courses:n=[],selectedCourseId:e=null,loading:t=!1,error:r="",onCourseSelect:i}){const[A,s]=ge(""),o=u=>{const l=u.currentTarget;s(l.value)},a=u=>{i==null||i(u)};if(t)return C("div",{className:"loading",children:"Loading..."});if(r)return C("div",{className:"error",children:r});if(!n||n.length===0)return C("div",{className:"empty",children:"No courses available"});const c=n.filter(u=>u.name.toLowerCase().includes(A.toLowerCase())||(u.description||"").toLowerCase().includes(A.toLowerCase()));return C("div",{className:"tour-select",children:[C("div",{className:"controls",children:[C("div",{className:"tabs",children:C("button",{className:"tab active",children:"All"})}),C("div",{className:"filter",children:[C("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:C("path",{d:"M10.0417 8.75002H9.42087L9.20004 8.53502C9.96921 7.63585 10.4417 6.47502 10.4417 5.20835C10.4417 2.56085 8.32254 0.441681 5.67504 0.441681C3.02754 0.441681 0.908374 2.56085 0.908374 5.20835C0.908374 7.85585 3.02754 9.97502 5.67504 9.97502C6.94171 9.97502 8.10254 9.50252 9.00171 8.73335L9.22671 8.95418V9.57502L13.2167 13.5592L14.375 12.4008L10.0417 8.75002ZM5.67504 8.75002C3.72754 8.75002 2.15837 7.18085 2.15837 5.20835C2.15837 3.23585 3.72754 1.66668 5.67504 1.66668C7.62254 1.66668 9.19171 3.23585 9.19171 5.20835C9.19171 7.18085 7.62254 8.75002 5.67504 8.75002Z",fill:"#6B7280"})}),C("input",{type:"text",placeholder:"Search...",value:A,onInput:o})]})]}),C("div",{className:"course-grid",children:c.sort((u,l)=>(u.order||0)-(l.order||0)).map(u=>{const l=u.id===e;return C(lR,{id:u.id,name:u.name,description:u.description||"",duration:u.duration,order:u.order||0,selected:l,onClick:a},u.id)})})]})}function hR({open:n,courses:e=[],loading:t=!1,error:r="",agentName:i="Obi",onClose:A,onCourseSelect:s,onCourseHighlight:o}){const[a,c]=ge(null),u=d=>{c(d),o==null||o(d)},l=()=>{a&&s&&s(a)};return C(my,{open:n,onClose:A,size:"large",children:C("div",{className:"tour-select-modal-container",children:[C("div",{className:"header",children:[C("div",{className:"icon",style:{color:"white"},children:C(Py,{})}),C("div",{className:"title-section",children:t?C(St,{children:[C("div",{className:"skeleton skeleton-title"}),C("div",{className:"skeleton skeleton-subtitle"})]}):C(St,{children:[C("h1",{children:["Give ",i," a try!"]}),C("p",{className:"subtitle",children:["Pick a tutorial, share your screen, and ",i," will take it from there."]})]})})]}),C("div",{className:"course-list-wrapper",children:C(dR,{courses:e,selectedCourseId:(a==null?void 0:a.id)||"",loading:t,error:r,onCourseSelect:u})}),C("div",{className:"footer",children:[C("button",{className:"obi-button footer-button",onClick:l,disabled:!a,children:[C("span",{children:"Get started"}),C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",children:C("path",{d:"M3.83325 8.00065H13.1666M13.1666 8.00065L8.49992 3.33398M13.1666 8.00065L8.49992 12.6673",stroke:a?"#FAFAFA":"#999","stroke-width":"1.33","stroke-linecap":"round","stroke-linejoin":"round"})})]}),C("p",{className:"footer-text",children:"Sessions are securely recorded for quality improvement purposes."})]})]})})}function pR({session:n,sessionState:e,speakingState:t,spectrum:r,onStart:i,onContinue:A,onShareMicrophone:s,onShareScreen:o,onModalChange:a}){const[c,u]=ge(null);function l(h){c!==h&&(a==null||a(h),u(h))}function d(){e==="connecting"||e==="connected"||!e?i==null||i():e==="volume-check"||e==="mic-check"?A==null||A():e==="mic-share"?s==null||s():e==="screen-share"&&(o==null||o())}return yd(()=>{switch(e){case null:case"connecting":case"connected":return l("session-start"),C(tR,{session:n,speakingState:t,onAction:d});case"volume-check":return l("voice-guidance"),C(AR,{session:n,speakingState:t,onAction:d});case"mic-check":return l("overview"),C(uR,{session:n,speakingState:t,spectrum:r,onAction:d});case"mic-share":return l("share-mic"),C(rR,{session:n,speakingState:t,onAction:d});case"screen-share":return l("share-screen"),C(aR,{session:n,speakingState:t,onAction:d});case"navigate":return l("navigate"),C($Q,{session:n,speakingState:t,onAction:d});default:return null}},[e,t,i,A,s,o])}function fR(n){const{session:e,sessionState:t,speakingState:r,spectrum:i,onClose:A,onStart:s,onContinue:o,onShareMicrophone:a,onShareScreen:c,onModalChange:u}=n,[l,d]=ge(null);function h(g){u==null||u(g),d(g)}function f(g){A(g,l),d(null)}const p=(n.open??!0)&&(!t||t==="connecting"||t==="connected"||t==="volume-check"||t==="mic-check"||t==="mic-share"||t==="screen-share"||t==="navigate");return C(YQ,{open:p,onClose:f,children:()=>C(pR,{session:e,sessionState:t,speakingState:r,spectrum:i,onStart:s,onContinue:o,onShareMicrophone:a,onShareScreen:c,onModalChange:h})})}var V;if(typeof window>"u"){var Oy={hostname:""};V={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:Oy,referrer:""},screen:{width:0,height:0},location:Oy,addEventListener:function(){},removeEventListener:function(){}}}else V=window;function My(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function Ly(n,e,t,r,i,A,s){try{var o=n[A](s),a=o.value}catch(c){t(c);return}o.done?e(a):Promise.resolve(a).then(r,i)}function kd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var A=n.apply(e,t);function s(a){Ly(A,r,i,s,o,"next",a)}function o(a){Ly(A,r,i,s,o,"throw",a)}s(void 0)})}}function _a(n,e,t){return Dy()?_a=Reflect.construct:_a=function(r,i,A){var s=[null];s.push.apply(s,i);var o=Function.bind.apply(r,s),a=new o;return A&&ZA(a,A.prototype),a},_a.apply(null,arguments)}function gR(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function bt(n,e,t){return e&&gR(n.prototype,e),n}function me(){return me=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},me.apply(this,arguments)}function Ed(n){return Ed=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ed(n)}function kt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&ZA(n,e)}function te(n,e){return e!=null&&typeof Symbol<"u"&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](n):n instanceof e}function mR(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function YA(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,A;for(A=0;A<r.length;A++)i=r[A],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function ZA(n,e){return ZA=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},ZA(n,e)}function se(n){"@swc/helpers - typeof";return n&&typeof Symbol<"u"&&n.constructor===Symbol?"symbol":typeof n}function vR(n,e){if(n){if(typeof n=="string")return My(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return My(n,e)}}function Sa(n){var e=typeof Map=="function"?new Map:void 0;return Sa=function(t){if(t===null||!mR(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return _a(t,arguments,Ed(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),ZA(r,t)},Sa(n)}function Dy(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Dy=function(){return!!n})()}function W(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t)return(t=t.call(n)).next.bind(t);if(Array.isArray(n)||(t=vR(n))||e){t&&(n=t);var r=0;return function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function $A(n,e){var t,r,i,A,s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return A={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(A[Symbol.iterator]=function(){return this}),A;function o(c){return function(u){return a([c,u])}}function a(c){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(i=c[0]&2?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,r=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1],i=c;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(c);break}i[2]&&s.ops.pop(),s.trys.pop();continue}c=e.call(n,s)}catch(u){c=[6,u],r=0}finally{t=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ny(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var yR=Object.defineProperty,wR=function(n,e,t){return e in n?yR(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t},N=function(n,e,t){return wR(n,(typeof e>"u"?"undefined":se(e))!=="symbol"?e+"":e,t)},Hy,bR=Object.defineProperty,BR=function(n,e,t){return e in n?bR(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t},Ky=function(n,e,t){return BR(n,(typeof e>"u"?"undefined":se(e))!=="symbol"?e+"":e,t)},dt=function(n){return n[n.Document=0]="Document",n[n.DocumentType=1]="DocumentType",n[n.Element=2]="Element",n[n.Text=3]="Text",n[n.CDATA=4]="CDATA",n[n.Comment=5]="Comment",n}(dt||{}),Vy={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Gy={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ka={},CR=function(){return!!globalThis.Zone};function Ud(n){if(ka[n])return ka[n];var e=globalThis[n],t=e.prototype,r=n in Vy?Vy[n]:void 0,i=!!(r&&r.every(function(u){var l,d;return!!((d=(l=Object.getOwnPropertyDescriptor(t,u))==null?void 0:l.get)!=null&&d.toString().includes("[native code]"))})),A=n in Gy?Gy[n]:void 0,s=!!(A&&A.every(function(u){var l;return typeof t[u]=="function"&&((l=t[u])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!CR())return ka[n]=e.prototype,e.prototype;try{var o=document.createElement("iframe");document.body.appendChild(o);var a=o.contentWindow;if(!a)return e.prototype;var c=a[n].prototype;return document.body.removeChild(o),c?ka[n]=c:t}catch{return t}}var Td={};function wr(n,e,t){var r,i=n+"."+String(t);if(Td[i])return Td[i].call(e);var A=Ud(n),s=(r=Object.getOwnPropertyDescriptor(A,t))==null?void 0:r.get;return s?(Td[i]=s,s.call(e)):e[t]}var Id={};function jy(n,e,t){var r=n+"."+String(t);if(Id[r])return Id[r].bind(e);var i=Ud(n),A=i[t];return typeof A!="function"?e[t]:(Id[r]=A,A.bind(e))}function _R(n){return wr("Node",n,"childNodes")}function SR(n){return wr("Node",n,"parentNode")}function kR(n){return wr("Node",n,"parentElement")}function ER(n){return wr("Node",n,"textContent")}function UR(n,e){return jy("Node",n,"contains")(e)}function TR(n){return jy("Node",n,"getRootNode")()}function IR(n){return!n||!("host"in n)?null:wr("ShadowRoot",n,"host")}function FR(n){return n.styleSheets}function xR(n){return!n||!("shadowRoot"in n)?null:wr("Element",n,"shadowRoot")}function QR(n,e){return wr("Element",n,"querySelector")(e)}function RR(n,e){return wr("Element",n,"querySelectorAll")(e)}function PR(){return Ud("MutationObserver").constructor}var Et={childNodes:_R,parentNode:SR,parentElement:kR,textContent:ER,contains:UR,getRootNode:TR,host:IR,styleSheets:FR,shadowRoot:xR,querySelector:QR,querySelectorAll:RR,mutationObserver:PR};function Wy(n){return n.nodeType===n.ELEMENT_NODE}function es(n){var e=n&&"host"in n&&"mode"in n&&Et.host(n)||null;return!!(e&&"shadowRoot"in e&&Et.shadowRoot(e)===n)}function ts(n){return Object.prototype.toString.call(n)==="[object ShadowRoot]"}function OR(n){return n.includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}function MR(n){var e=n.cssText;if(e.split('"').length<3)return e;var t=["@import","url("+JSON.stringify(n.href)+")"];return n.layerName===""?t.push("layer"):n.layerName&&t.push("layer("+n.layerName+")"),n.supportsText&&t.push("supports("+n.supportsText+")"),n.media.length&&t.push(n.media.mediaText),t.join(" ")+";"}function Fd(n){try{var e=n.rules||n.cssRules;if(!e)return null;var t=n.href;!t&&n.ownerNode&&n.ownerNode.ownerDocument&&(t=n.ownerNode.ownerDocument.location.href);var r=Array.from(e,function(i){return qy(i,t)}).join("");return OR(r)}catch{return null}}function qy(n,e){if(DR(n)){var t;try{t=Fd(n.styleSheet)||MR(n)}catch{t=n.cssText}return n.styleSheet.href?Ea(t,n.styleSheet.href):t}else{var r=n.cssText;return NR(n)&&n.selectorText.includes(":")&&(r=LR(r)),e?Ea(r,e):r}}function LR(n){var e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return n.replace(e,"$1\\$2")}function DR(n){return"styleSheet"in n}function NR(n){return"selectorText"in n}var Jy=function(){function n(){Ky(this,"idNodeMap",new Map),Ky(this,"nodeMetaMap",new WeakMap)}var e=n.prototype;return e.getId=function(t){var r;if(!t)return-1;var i=(r=this.getMeta(t))==null?void 0:r.id;return i??-1},e.getNode=function(t){return this.idNodeMap.get(t)||null},e.getIds=function(){return Array.from(this.idNodeMap.keys())},e.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.removeNodeFromMap=function(t){var r=this,i=this.getId(t);this.idNodeMap.delete(i),t.childNodes&&t.childNodes.forEach(function(A){return r.removeNodeFromMap(A)})},e.has=function(t){return this.idNodeMap.has(t)},e.hasNode=function(t){return this.nodeMetaMap.has(t)},e.add=function(t,r){var i=r.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,r)},e.replace=function(t,r){var i=this.getNode(t);if(i){var A=this.nodeMetaMap.get(i);A&&this.nodeMetaMap.set(r,A)}this.idNodeMap.set(t,r)},e.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},n}();function HR(){return new Jy}function xd(n){var e=n.element,t=n.maskInputOptions,r=n.tagName,i=n.type,A=n.value,s=n.maskInputFn,o=A||"",a=i&&Zr(i);return(t[r.toLowerCase()]||a&&t[a])&&(s?o=s(o,e):o="*".repeat(o.length)),o}function Zr(n){return n.toLowerCase()}var zy="__rrweb_original__";function KR(n){var e=n.getContext("2d");if(!e)return!0;for(var t=50,r=0;r<n.width;r+=t)for(var i=0;i<n.height;i+=t){var A=e.getImageData,s=zy in A?A[zy]:A,o=new Uint32Array(s.call(e,r,i,Math.min(t,n.width-r),Math.min(t,n.height-i)).data.buffer);if(o.some(function(a){return a!==0}))return!1}return!0}function Qd(n){var e=n.type;return n.hasAttribute("data-rr-is-password")?"password":e?Zr(e):null}function Xy(n,e){var t;try{t=new URL(n,e??window.location.href)}catch{return null}var r=/\.([0-9a-z]+)(?:$)/i,i=t.pathname.match(r),A;return(A=i==null?void 0:i[1])!=null?A:null}function VR(n){var e="";return n.indexOf("//")>-1?e=n.split("/").slice(0,3).join("/"):e=n.split("/")[0],e=e.split("?")[0],e}var GR=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,jR=/^(?:[a-z+]+:)?\/\//i,WR=/^www\..*/i,qR=/^(data:)([^,]*),(.*)/i;function Ea(n,e){return(n||"").replace(GR,function(t,r,i,A,s,o){var a=i||s||o,c=r||A||"";if(!a)return t;if(jR.test(a)||WR.test(a)||qR.test(a))return"url("+c+a+c+")";if(a[0]==="/")return"url("+c+(VR(e)+a)+c+")";var u=e.split("/"),l=a.split("/");u.pop();for(var d=W(l),h;!(h=d()).done;){var f=h.value;f!=="."&&(f===".."?u.pop():u.push(f))}return"url("+c+u.join("/")+c+")"})}function Rd(n){return n.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function JR(n,e){var t=Array.from(e.childNodes),r=[];if(t.length>1&&n&&typeof n=="string"){for(var i=Rd(n),A=1;A<t.length;A++)if(t[A].textContent&&typeof t[A].textContent=="string")for(var s=Rd(t[A].textContent),o=3;o<s.length;o++){var a=s.substring(0,o);if(i.split(a).length===2){for(var c=i.indexOf(a),u=c;u<n.length;u++)if(Rd(n.substring(0,u)).length===c){r.push(n.substring(0,u)),n=n.substring(u);break}break}}}return r.push(n),r}function zR(n,e){return JR(n,e).join("/* rr_split */")}var XR=1,YR=new RegExp("[^a-z0-9-_:]"),ns=-2;function Yy(){return XR++}function ZR(n){if(te(n,HTMLFormElement))return"form";var e=Zr(n.tagName);return YR.test(e)?"div":e}var Ki,Zy,$R=/^[^ \t\n\r\u000c]+/,eP=/^[, \t\n\r\u000c]+/;function tP(n,e){if(e.trim()==="")return e;var t=0;function r(c){var u,l=c.exec(e.substring(t));return l?(u=l[0],t+=u.length,u):""}for(var i=[];r(eP),!(t>=e.length);){var A=r($R);if(A.slice(-1)===",")A=Ua(n,A.substring(0,A.length-1)),i.push(A);else{var s="";A=Ua(n,A);for(var o=!1;;){var a=e.charAt(t);if(a===""){i.push((A+s).trim());break}else if(o)a===")"&&(o=!1);else if(a===","){t+=1,i.push((A+s).trim());break}else a==="("&&(o=!0);s+=a,t+=1}}}return i.join(", ")}var $y=new WeakMap;function Ua(n,e){return!e||e.trim()===""?e:Pd(n,e)}function nP(n){return!!(n.tagName==="svg"||n.ownerSVGElement)}function Pd(n,e){var t=$y.get(n);if(t||(t=n.createElement("a"),$y.set(n,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function ew(n,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?Ua(n,r):t==="srcset"?tP(n,r):t==="style"?Ea(r,Pd(n)):e==="object"&&t==="data"?Ua(n,r):r)}function tw(n,e,t){return(n==="video"||n==="audio")&&e==="autoplay"}function rP(n,e,t){try{if(typeof e=="string"){if(n.classList.contains(e))return!0}else for(var r=n.classList.length;r--;){var i=n.classList[r];if(e.test(i))return!0}if(t)return n.matches(t)}catch{}return!1}function Ta(n,e,t){if(!n)return!1;if(n.nodeType!==n.ELEMENT_NODE)return t?Ta(Et.parentNode(n),e,t):!1;for(var r=n.classList.length;r--;){var i=n.classList[r];if(e.test(i))return!0}return t?Ta(Et.parentNode(n),e,t):!1}function nw(n,e,t,r){var i;if(Wy(n)){if(i=n,!Et.childNodes(i).length)return!1}else{if(Et.parentElement(n)===null)return!1;i=Et.parentElement(n)}try{if(typeof e=="string"){if(r){if(i.closest("."+e))return!0}else if(i.classList.contains(e))return!0}else if(Ta(i,e,r))return!0;if(t){if(r){if(i.closest(t))return!0}else if(i.matches(t))return!0}}catch{}return!1}function iP(n,e,t){var r=n.contentWindow;if(r){var i=!1,A;try{A=r.document.readyState}catch{return}if(A!=="complete"){var s=setTimeout(function(){i||(e(),i=!0)},t);n.addEventListener("load",function(){clearTimeout(s),i=!0,e()});return}var o="about:blank";if(r.location.href!==o||n.src===o||n.src==="")return setTimeout(e,0),n.addEventListener("load",e);n.addEventListener("load",e)}}function AP(n,e,t){var r=!1,i;try{i=n.sheet}catch{return}if(!i){var A=setTimeout(function(){r||(e(),r=!0)},t);n.addEventListener("load",function(){clearTimeout(A),r=!0,e()})}}function sP(n,e){var t=e.doc,r=e.mirror,i=e.blockClass,A=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,c=a===void 0?{}:a,u=e.maskTextFn,l=e.maskInputFn,d=e.dataURLOptions,h=d===void 0?{}:d,f=e.inlineImages,p=e.recordCanvas,g=e.keepIframeSrcFn,v=e.newlyAddedElement,y=v===void 0?!1:v,B=e.cssCaptured,b=B===void 0?!1:B,w=oP(t,r);switch(n.nodeType){case n.DOCUMENT_NODE:return n.compatMode!=="CSS1Compat"?{type:dt.Document,childNodes:[],compatMode:n.compatMode}:{type:dt.Document,childNodes:[]};case n.DOCUMENT_TYPE_NODE:return{type:dt.DocumentType,name:n.name,publicId:n.publicId,systemId:n.systemId,rootId:w};case n.ELEMENT_NODE:return cP(n,{doc:t,blockClass:i,blockSelector:A,inlineStylesheet:o,maskInputOptions:c,maskInputFn:l,dataURLOptions:h,inlineImages:f,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:y,rootId:w});case n.TEXT_NODE:return aP(n,{doc:t,needsMask:s,maskTextFn:u,rootId:w,cssCaptured:b});case n.CDATA_SECTION_NODE:return{type:dt.CDATA,textContent:"",rootId:w};case n.COMMENT_NODE:return{type:dt.Comment,textContent:Et.textContent(n)||"",rootId:w};default:return!1}}function oP(n,e){if(e.hasNode(n)){var t=e.getId(n);return t===1?void 0:t}}function aP(n,e){var t=e.needsMask,r=e.maskTextFn,i=e.rootId,A=e.cssCaptured,s=Et.parentNode(n),o=s&&s.tagName,a="",c=o==="STYLE"?!0:void 0,u=o==="SCRIPT"?!0:void 0;return u?a="SCRIPT_PLACEHOLDER":A||(a=Et.textContent(n),c&&a&&(a=Ea(a,Pd(e.doc)))),!c&&!u&&a&&t&&(a=r?r(a,Et.parentElement(n)):a.replace(/[\S]/g,"*")),{type:dt.Text,textContent:a||"",rootId:i}}function cP(n,e){for(var t=e.doc,r=e.blockClass,i=e.blockSelector,A=e.inlineStylesheet,s=e.maskInputOptions,o=s===void 0?{}:s,a=e.maskInputFn,c=e.dataURLOptions,u=c===void 0?{}:c,l=e.inlineImages,d=e.recordCanvas,h=e.keepIframeSrcFn,f=e.newlyAddedElement,p=f===void 0?!1:f,g=e.rootId,v=rP(n,r,i),y=ZR(n),B={},b=n.attributes.length,w=0;w<b;w++){var _=n.attributes[w];tw(y,_.name,_.value)||(B[_.name]=ew(t,y,Zr(_.name),_.value))}if(y==="link"&&A){var k=Array.from(t.styleSheets).find(function(Re){return Re.href===n.href}),F=null;k&&(F=Fd(k)),F&&(delete B.rel,delete B.href,B._cssText=F)}if(y==="style"&&n.sheet){var x=Fd(n.sheet);x&&(n.childNodes.length>1&&(x=zR(x,n)),B._cssText=x)}if(y==="input"||y==="textarea"||y==="select"){var E=n.value,T=n.checked;B.type!=="radio"&&B.type!=="checkbox"&&B.type!=="submit"&&B.type!=="button"&&E?B.value=xd({element:n,type:Qd(n),tagName:y,value:E,maskInputOptions:o,maskInputFn:a}):T&&(B.checked=T)}if(y==="option"&&(n.selected&&!o.select?B.selected=!0:delete B.selected),y==="dialog"&&n.open&&(B.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal"),y==="canvas"&&d){if(n.__context==="2d")KR(n)||(B.rr_dataURL=n.toDataURL(u.type,u.quality));else if(!("__context"in n)){var Q=n.toDataURL(u.type,u.quality),M=t.createElement("canvas");M.width=n.width,M.height=n.height;var X=M.toDataURL(u.type,u.quality);Q!==X&&(B.rr_dataURL=Q)}}if(y==="img"&&l){Ki||(Ki=t.createElement("canvas"),Zy=Ki.getContext("2d"));var H=n,q=H.currentSrc||H.getAttribute("src")||"<unknown-src>",ve=H.crossOrigin,Y=function(){H.removeEventListener("load",Y);try{Ki.width=H.naturalWidth,Ki.height=H.naturalHeight,Zy.drawImage(H,0,0),B.rr_dataURL=Ki.toDataURL(u.type,u.quality)}catch(Re){if(H.crossOrigin!=="anonymous"){H.crossOrigin="anonymous",H.complete&&H.naturalWidth!==0?Y():H.addEventListener("load",Y);return}else console.warn("Cannot inline img src="+q+"! Error: "+Re)}H.crossOrigin==="anonymous"&&(ve?B.crossOrigin=ve:H.removeAttribute("crossorigin"))};H.complete&&H.naturalWidth!==0?Y():H.addEventListener("load",Y)}if(y==="audio"||y==="video"){var ie=B;ie.rr_mediaState=n.paused?"paused":"played",ie.rr_mediaCurrentTime=n.currentTime,ie.rr_mediaPlaybackRate=n.playbackRate,ie.rr_mediaMuted=n.muted,ie.rr_mediaLoop=n.loop,ie.rr_mediaVolume=n.volume}if(p||(n.scrollLeft&&(B.rr_scrollLeft=n.scrollLeft),n.scrollTop&&(B.rr_scrollTop=n.scrollTop)),v){var Qe=n.getBoundingClientRect(),qe=Qe.width,Be=Qe.height;B={class:B.class,rr_width:""+qe+"px",rr_height:""+Be+"px"}}y==="iframe"&&!h(B.src)&&(n.contentDocument||(B.rr_src=B.src),delete B.src);var ht;try{customElements.get(y)&&(ht=!0)}catch{}return{type:dt.Element,tagName:y,attributes:B,childNodes:[],isSVG:nP(n)||void 0,needBlock:v,rootId:g,isCustom:ht}}function xe(n){return n==null?"":n.toLowerCase()}function uP(n,e){return!!(e.comment&&n.type===dt.Comment||n.type===dt.Element&&(e.script&&(n.tagName==="script"||n.tagName==="link"&&(n.attributes.rel==="preload"||n.attributes.rel==="modulepreload")&&n.attributes.as==="script"||n.tagName==="link"&&n.attributes.rel==="prefetch"&&typeof n.attributes.href=="string"&&Xy(n.attributes.href)==="js")||e.headFavicon&&(n.tagName==="link"&&n.attributes.rel==="shortcut icon"||n.tagName==="meta"&&(xe(n.attributes.name).match(/^msapplication-tile(image|color)$/)||xe(n.attributes.name)==="application-name"||xe(n.attributes.rel)==="icon"||xe(n.attributes.rel)==="apple-touch-icon"||xe(n.attributes.rel)==="shortcut icon"))||n.tagName==="meta"&&(e.headMetaDescKeywords&&xe(n.attributes.name).match(/^description|keywords$/)||e.headMetaSocial&&(xe(n.attributes.property).match(/^(og|twitter|fb):/)||xe(n.attributes.name).match(/^(og|twitter):/)||xe(n.attributes.name)==="pinterest")||e.headMetaRobots&&(xe(n.attributes.name)==="robots"||xe(n.attributes.name)==="googlebot"||xe(n.attributes.name)==="bingbot")||e.headMetaHttpEquiv&&n.attributes["http-equiv"]!==void 0||e.headMetaAuthorship&&(xe(n.attributes.name)==="author"||xe(n.attributes.name)==="generator"||xe(n.attributes.name)==="framework"||xe(n.attributes.name)==="publisher"||xe(n.attributes.name)==="progid"||xe(n.attributes.property).match(/^article:/)||xe(n.attributes.property).match(/^product:/))||e.headMetaVerification&&(xe(n.attributes.name)==="google-site-verification"||xe(n.attributes.name)==="yandex-verification"||xe(n.attributes.name)==="csrf-token"||xe(n.attributes.name)==="p:domain_verify"||xe(n.attributes.name)==="verify-v1"||xe(n.attributes.name)==="verification"||xe(n.attributes.name)==="shopify-checkout-api-token"))))}function Vi(n,e){var t=e.doc,r=e.mirror,i=e.blockClass,A=e.blockSelector,s=e.maskTextClass,o=e.maskTextSelector,a=e.skipChild,c=a===void 0?!1:a,u=e.inlineStylesheet,l=u===void 0?!0:u,d=e.maskInputOptions,h=d===void 0?{}:d,f=e.maskTextFn,p=e.maskInputFn,g=e.slimDOMOptions,v=e.dataURLOptions,y=v===void 0?{}:v,B=e.inlineImages,b=B===void 0?!1:B,w=e.recordCanvas,_=w===void 0?!1:w,k=e.onSerialize,F=e.onIframeLoad,x=e.iframeLoadTimeout,E=x===void 0?5e3:x,T=e.onStylesheetLoad,Q=e.stylesheetLoadTimeout,M=Q===void 0?5e3:Q,X=e.keepIframeSrcFn,H=X===void 0?function(){return!1}:X,q=e.newlyAddedElement,ve=q===void 0?!1:q,Y=e.cssCaptured,ie=Y===void 0?!1:Y,Qe=e.needsMask,qe=e.preserveWhiteSpace,Be=qe===void 0?!0:qe;if(!Qe){var ht=Qe===void 0;Qe=nw(n,s,o,ht)}var Re=sP(n,{doc:t,mirror:r,blockClass:i,blockSelector:A,needsMask:Qe,inlineStylesheet:l,maskInputOptions:h,maskTextFn:f,maskInputFn:p,dataURLOptions:y,inlineImages:b,recordCanvas:_,keepIframeSrcFn:H,newlyAddedElement:ve,cssCaptured:ie});if(!Re)return console.warn(n,"not serialized"),null;var Ne;r.hasNode(n)?Ne=r.getId(n):uP(Re,g)||!Be&&Re.type===dt.Text&&!Re.textContent.replace(/^\s+|\s+$/gm,"").length?Ne=ns:Ne=Yy();var ne=Object.assign(Re,{id:Ne});if(r.add(n,ne),Ne===ns)return null;k&&k(n);var et=!c;if(ne.type===dt.Element){et=et&&!ne.needBlock,delete ne.needBlock;var Z=Et.shadowRoot(n);Z&&ts(Z)&&(ne.isShadowHost=!0)}if((ne.type===dt.Document||ne.type===dt.Element)&&et){g.headWhitespace&&ne.type===dt.Element&&ne.tagName==="head"&&(Be=!1);var We={doc:t,mirror:r,blockClass:i,blockSelector:A,needsMask:Qe,maskTextClass:s,maskTextSelector:o,skipChild:c,inlineStylesheet:l,maskInputOptions:h,maskTextFn:f,maskInputFn:p,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:_,preserveWhiteSpace:Be,onSerialize:k,onIframeLoad:F,iframeLoadTimeout:E,onStylesheetLoad:T,stylesheetLoadTimeout:M,keepIframeSrcFn:H,cssCaptured:!1};if(!(ne.type===dt.Element&&ne.tagName==="textarea"&&ne.attributes.value!==void 0)){ne.type===dt.Element&&ne.attributes._cssText!==void 0&&typeof ne.attributes._cssText=="string"&&(We.cssCaptured=!0);for(var Us=W(Array.from(Et.childNodes(n))),Ts;!(Ts=Us()).done;){var Pp=Ts.value,Kc=Vi(Pp,We);Kc&&ne.childNodes.push(Kc)}}var Qr=null;if(Wy(n)&&(Qr=Et.shadowRoot(n)))for(var oi=W(Array.from(Et.childNodes(Qr))),dA;!(dA=oi()).done;){var Is=dA.value,hA=Vi(Is,We);hA&&(ts(Qr)&&(hA.isShadow=!0),ne.childNodes.push(hA))}}var ai=Et.parentNode(n);return ai&&es(ai)&&ts(ai)&&(ne.isShadow=!0),ne.type===dt.Element&&ne.tagName==="iframe"&&iP(n,function(){var Yn=n.contentDocument;if(Yn&&F){var ci=Vi(Yn,{doc:Yn,mirror:r,blockClass:i,blockSelector:A,needsMask:Qe,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:f,maskInputFn:p,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:_,preserveWhiteSpace:Be,onSerialize:k,onIframeLoad:F,iframeLoadTimeout:E,onStylesheetLoad:T,stylesheetLoadTimeout:M,keepIframeSrcFn:H});ci&&F(n,ci)}},E),ne.type===dt.Element&&ne.tagName==="link"&&typeof ne.attributes.rel=="string"&&(ne.attributes.rel==="stylesheet"||ne.attributes.rel==="preload"&&typeof ne.attributes.href=="string"&&Xy(ne.attributes.href)==="css")&&AP(n,function(){if(T){var Yn=Vi(n,{doc:t,mirror:r,blockClass:i,blockSelector:A,needsMask:Qe,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:f,maskInputFn:p,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:_,preserveWhiteSpace:Be,onSerialize:k,onIframeLoad:F,iframeLoadTimeout:E,onStylesheetLoad:T,stylesheetLoadTimeout:M,keepIframeSrcFn:H});Yn&&T(n,Yn)}},M),ne}function lP(n,e){var t=e||{},r=t.mirror,i=r===void 0?new Jy:r,A=t.blockClass,s=A===void 0?"rr-block":A,o=t.blockSelector,a=o===void 0?null:o,c=t.maskTextClass,u=c===void 0?"rr-mask":c,l=t.maskTextSelector,d=l===void 0?null:l,h=t.inlineStylesheet,f=h===void 0?!0:h,p=t.inlineImages,g=p===void 0?!1:p,v=t.recordCanvas,y=v===void 0?!1:v,B=t.maskAllInputs,b=B===void 0?!1:B,w=t.maskTextFn,_=t.maskInputFn,k=t.slimDOM,F=k===void 0?!1:k,x=t.dataURLOptions,E=t.preserveWhiteSpace,T=t.onSerialize,Q=t.onIframeLoad,M=t.iframeLoadTimeout,X=t.onStylesheetLoad,H=t.stylesheetLoadTimeout,q=t.keepIframeSrcFn,ve=q===void 0?function(){return!1}:q,Y=b===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:b===!1?{password:!0}:b,ie=F===!0||F==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:F==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:F===!1?{}:F;return Vi(n,{doc:n,mirror:i,blockClass:s,blockSelector:a,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:Y,maskTextFn:w,maskInputFn:_,slimDOMOptions:ie,dataURLOptions:x,inlineImages:g,recordCanvas:y,preserveWhiteSpace:E,onSerialize:T,onIframeLoad:Q,iframeLoadTimeout:M,onStylesheetLoad:X,stylesheetLoadTimeout:H,keepIframeSrcFn:ve,newlyAddedElement:!1})}function dP(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function hP(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return te(this,r)?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var Od={exports:{}},Me=String,rw=function(){return{isColorSupported:!1,reset:Me,bold:Me,dim:Me,italic:Me,underline:Me,inverse:Me,hidden:Me,strikethrough:Me,black:Me,red:Me,green:Me,yellow:Me,blue:Me,magenta:Me,cyan:Me,white:Me,gray:Me,bgBlack:Me,bgRed:Me,bgGreen:Me,bgYellow:Me,bgBlue:Me,bgMagenta:Me,bgCyan:Me,bgWhite:Me}};Od.exports=rw(),Od.exports.createColors=rw;var pP=Od.exports,fP={},gP=Object.freeze(Object.defineProperty({__proto__:null,default:fP},Symbol.toStringTag,{value:"Module"})),At=hP(gP),iw=pP,Aw=At,Md=function(n){kt(e,n);function e(r,i,A,s,o,a){var c;return c=n.call(this,r)||this,c.name="CssSyntaxError",c.reason=r,o&&(c.file=o),s&&(c.source=s),a&&(c.plugin=a),typeof i<"u"&&typeof A<"u"&&(typeof i=="number"?(c.line=i,c.column=A):(c.line=i.line,c.column=i.column,c.endLine=A.line,c.endColumn=A.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,e),c}var t=e.prototype;return t.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},t.showSourceCode=function(r){var i=this;if(!this.source)return"";var A=this.source;r==null&&(r=iw.isColorSupported),Aw&&r&&(A=Aw(A));var s=A.split(/\r?\n/),o=Math.max(this.line-3,0),a=Math.min(this.line+2,s.length),c=String(a).length,u,l;if(r){var d=iw.createColors(!0),h=d.bold,f=d.gray,p=d.red;u=function(g){return h(p(g))},l=function(g){return f(g)}}else u=l=function(g){return g};return s.slice(o,a).map(function(g,v){var y=o+1+v,B=" "+(" "+y).slice(-c)+" | ";if(y===i.line){var b=l(B.replace(/\d/g," "))+g.slice(0,i.column-1).replace(/[^\t]/g," ");return u(">")+l(B)+g+`
58
58
  `+b+u("^")}return" "+l(B)+g}).join(`
59
59
  `)},t.toString=function(){var r=this.showSourceCode();return r&&(r=`
60
60
 
@@ -81,9 +81,9 @@ a=extmap-allow-mixed`)!==-1){const A=i.sdp.split(`
81
81
  `," "];return ss.split(n,e)},split:function(n,e,t){for(var r=[],i="",A=!1,s=0,o=!1,a="",c=!1,u=W(n),l;!(l=u()).done;){var d=l.value;c?c=!1:d==="\\"?c=!0:o?d===a&&(o=!1):d==='"'||d==="'"?(o=!0,a=d):d==="("?s+=1:d===")"?s>0&&(s-=1):s===0&&e.includes(d)&&(A=!0),A?(i!==""&&r.push(i.trim()),i="",A=!1):i+=d}return(t||i!=="")&&r.push(i.trim()),r}},Nw=ss;ss.default=ss;var Hw=$r,nO=Nw,Ja=function(n){kt(e,n);function e(t){var r;return r=n.call(this,t)||this,r.type="rule",r.nodes||(r.nodes=[]),r}return bt(e,[{key:"selectors",get:function(){return nO.comma(this.selector)},set:function(t){var r=this.selector?this.selector.match(/,\s*/):null,i=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(i)}}]),e}(Hw),Ah=Ja;Ja.default=Ja,Hw.registerRule(Ja);var rO=Qa,iO=tO,AO=Da,sO=ih,oO=As,Kw=Ah,Vw={empty:!0,space:!0};function aO(n){for(var e=n.length-1;e>=0;e--){var t=n[e],r=t[3]||t[2];if(r)return r}}var cO=function(){function n(t){this.input=t,this.root=new oO,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}var e=n.prototype;return e.atrule=function(t){var r=new sO;r.name=t[1].slice(1),r.name===""&&this.unnamedAtrule(r,t),this.init(r,t[2]);for(var i,A,s,o=!1,a=!1,c=[],u=[];!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),i=t[0],i==="("||i==="["?u.push(i==="("?")":"]"):i==="{"&&u.length>0?u.push("}"):i===u[u.length-1]&&u.pop(),u.length===0)if(i===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){a=!0;break}else if(i==="}"){if(c.length>0){for(s=c.length-1,A=c[s];A&&A[0]==="space";)A=c[--s];A&&(r.source.end=this.getPosition(A[3]||A[2]),r.source.end.offset++)}this.end(t);break}else c.push(t);else c.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(r.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(r,"params",c),o&&(t=c[c.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)},e.checkMissedSemicolon=function(t){var r=this.colon(t);if(r!==!1){for(var i=0,A,s=r-1;s>=0&&(A=t[s],!(A[0]!=="space"&&(i+=1,i===2)));s--);throw this.input.error("Missed semicolon",A[0]==="word"?A[3]+1:A[2])}},e.colon=function(t){for(var r=0,i,A,s,o=W(t.entries()),a;!(a=o()).done;){var c=a.value,u=c[0],l=c[1];if(i=l,A=i[0],A==="("&&(r+=1),A===")"&&(r-=1),r===0&&A===":")if(!s)this.doubleColon(i);else{if(s[0]==="word"&&s[1]==="progid")continue;return u}s=i}return!1},e.comment=function(t){var r=new AO;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;var i=t[1].slice(2,-2);if(/^\s*$/.test(i))r.text="",r.raws.left=i,r.raws.right="";else{var A=i.match(/^(\s*)([^]*\S)(\s*)$/);r.text=A[2],r.raws.left=A[1],r.raws.right=A[3]}},e.createTokenizer=function(){this.tokenizer=iO(this.input)},e.decl=function(t,r){var i=new rO;this.init(i,t[0][2]);var A=t[t.length-1];for(A[0]===";"&&(this.semicolon=!0,t.pop()),i.source.end=this.getPosition(A[3]||A[2]||aO(t)),i.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),i.raws.before+=t.shift()[1];for(i.source.start=this.getPosition(t[0][2]),i.prop="";t.length;){var s=t[0][0];if(s===":"||s==="space"||s==="comment")break;i.prop+=t.shift()[1]}i.raws.between="";for(var o;t.length;)if(o=t.shift(),o[0]===":"){i.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),i.raws.between+=o[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));for(var a=[],c;t.length&&(c=t[0][0],!(c!=="space"&&c!=="comment"));)a.push(t.shift());this.precheckMissedSemicolon(t);for(var u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){i.important=!0;var l=this.stringFrom(t,u);l=this.spacesFromEnd(t)+l,l!==" !important"&&(i.raws.important=l);break}else if(o[1].toLowerCase()==="important"){for(var d=t.slice(0),h="",f=u;f>0;f--){var p=d[f][0];if(h.trim().indexOf("!")===0&&p!=="space")break;h=d.pop()[1]+h}h.trim().indexOf("!")===0&&(i.important=!0,i.raws.important=h,t=d)}if(o[0]!=="space"&&o[0]!=="comment")break}var g=t.some(function(v){return v[0]!=="space"&&v[0]!=="comment"});g&&(i.raws.between+=a.map(function(v){return v[1]}).join(""),a=[]),this.raw(i,"value",a.concat(t),r),i.value.includes(":")&&!r&&this.checkMissedSemicolon(t)},e.doubleColon=function(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})},e.emptyRule=function(t){var r=new Kw;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r},e.end=function(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)},e.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},e.freeSemicolon=function(t){if(this.spaces+=t[1],this.current.nodes){var r=this.current.nodes[this.current.nodes.length-1];r&&r.type==="rule"&&!r.raws.ownSemicolon&&(r.raws.ownSemicolon=this.spaces,this.spaces="")}},e.getPosition=function(t){var r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}},e.init=function(t,r){this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)},e.other=function(t){for(var r=!1,i=null,A=!1,s=null,o=[],a=t[1].startsWith("--"),c=[],u=t;u;){if(i=u[0],c.push(u),i==="("||i==="[")s||(s=u),o.push(i==="("?")":"]");else if(a&&A&&i==="{")s||(s=u),o.push("}");else if(o.length===0)if(i===";")if(A){this.decl(c,a);return}else break;else if(i==="{"){this.rule(c);return}else if(i==="}"){this.tokenizer.back(c.pop()),r=!0;break}else i===":"&&(A=!0);else i===o[o.length-1]&&(o.pop(),o.length===0&&(s=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(r=!0),o.length>0&&this.unclosedBracket(s),r&&A){if(!a)for(;c.length&&(u=c[c.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(c.pop());this.decl(c,a)}else this.unknownWord(c)},e.parse=function(){for(var t;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()},e.precheckMissedSemicolon=function(){},e.raw=function(t,r,i,A){for(var s,o,a=i.length,c="",u=!0,l,d,h=0;h<a;h+=1)s=i[h],o=s[0],o==="space"&&h===a-1&&!A?u=!1:o==="comment"?(d=i[h-1]?i[h-1][0]:"empty",l=i[h+1]?i[h+1][0]:"empty",!Vw[d]&&!Vw[l]?c.slice(-1)===","?u=!1:c+=s[1]:u=!1):c+=s[1];if(!u){var f=i.reduce(function(p,g){return p+g[1]},"");t.raws[r]={raw:f,value:c}}t[r]=c},e.rule=function(t){t.pop();var r=new Kw;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r},e.spacesAndCommentsFromEnd=function(t){for(var r,i="";t.length&&(r=t[t.length-1][0],!(r!=="space"&&r!=="comment"));)i=t.pop()[1]+i;return i},e.spacesAndCommentsFromStart=function(t){for(var r,i="";t.length&&(r=t[0][0],!(r!=="space"&&r!=="comment"));)i+=t.shift()[1];return i},e.spacesFromEnd=function(t){for(var r,i="";t.length&&(r=t[t.length-1][0],r==="space");)i=t.pop()[1]+i;return i},e.stringFrom=function(t,r){for(var i="",A=r;A<t.length;A++)i+=t[A][1];return t.splice(r,t.length-r),i},e.unclosedBlock=function(){var t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)},e.unclosedBracket=function(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})},e.unexpectedClose=function(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})},e.unknownWord=function(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})},e.unnamedAtrule=function(t,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})},n}(),uO=cO,lO=$r,dO=uO,hO=Oa;function za(n,e){var t=new hO(n,e),r=new dO(t);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?i.message+=`
82
82
  You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(e.from)?i.message+=`
83
83
  You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(e.from)&&(i.message+=`
84
- You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var sh=za;za.default=za,lO.registerParse(za);var Un=br.isClean,pO=br.my,fO=yw,gO=Ia,mO=$r,vO=$d,yO=Fw,Gw=nh,wO=sh,bO=As,BO={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},CO={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},_O={Once:!0,postcssPlugin:!0,prepare:!0},ji=0;function os(n){return(typeof n>"u"?"undefined":se(n))==="object"&&typeof n.then=="function"}function jw(n){var e=!1,t=BO[n.type];return n.type==="decl"?e=n.prop.toLowerCase():n.type==="atrule"&&(e=n.name.toLowerCase()),e&&n.append?[t,t+"-"+e,ji,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:n.append?[t,ji,t+"Exit"]:[t,t+"Exit"]}function Ww(n){var e;return n.type==="document"?e=["Document",ji,"DocumentExit"]:n.type==="root"?e=["Root",ji,"RootExit"]:e=jw(n),{eventIndex:0,events:e,iterator:0,node:n,visitorIndex:0,visitors:[]}}function oh(n){return n[Un]=!1,n.nodes&&n.nodes.forEach(function(e){return oh(e)}),n}var ah={},Wi=function(){function n(t,r,i){var A=this;this.stringified=!1,this.processed=!1;var s;if((typeof r>"u"?"undefined":se(r))==="object"&&r!==null&&(r.type==="root"||r.type==="document"))s=oh(r);else if(te(r,n)||te(r,Gw))s=oh(r.root),r.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{var o=wO;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{s=o(r,i)}catch(a){this.processed=!0,this.error=a}s&&!s[pO]&&mO.rebuild(s)}this.result=new Gw(t,s,i),this.helpers=me({},ah,{postcss:ah,result:this.result}),this.plugins=this.processor.plugins.map(function(a){return(typeof a>"u"?"undefined":se(a))==="object"&&a.prepare?me({},a,a.prepare(A.result)):a})}var e=n.prototype;return e.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},e.catch=function(t){return this.async().catch(t)},e.finally=function(t){return this.async().then(t,t)},e.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},e.handleError=function(t,r){var i=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=i.postcssPlugin,t.setMessage();else if(i.postcssVersion&&process.env.NODE_ENV!=="production"){var A=i.postcssPlugin,s=i.postcssVersion,o=this.result.processor.version,a=s.split("."),c=o.split(".");(a[0]!==c[0]||parseInt(a[1])>parseInt(c[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+A+" uses "+s+". Perhaps this is the source of the error below.")}}catch(u){console&&console.error&&console.error(u)}return t},e.prepareVisitors=function(){var t=this;this.listeners={};for(var r=function(c,u,l){t.listeners[u]||(t.listeners[u]=[]),t.listeners[u].push([c,l])},i=W(this.plugins),A;!(A=i()).done;){var s=A.value;if((typeof s>"u"?"undefined":se(s))==="object")for(var o in s){if(!CO[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event "+o+" in "+s.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!_O[o])if(se(s[o])==="object")for(var a in s[o])a==="*"?r(s,o,s[o][a]):r(s,o+"-"+a.toLowerCase(),s[o][a]);else typeof s[o]=="function"&&r(s,o,s[o])}}this.hasListener=Object.keys(this.listeners).length>0},e.runAsync=function(){var t=this;return kd(function(){var r,i,A,s,o,a,c,u,l,d,h,f;return $A(this,function(p){switch(p.label){case 0:t.plugin=0,r=0,p.label=1;case 1:if(!(r<t.plugins.length))return[3,6];if(i=t.plugins[r],A=t.runOnRoot(i),!os(A))return[3,5];p.label=2;case 2:return p.trys.push([2,4,,5]),[4,A];case 3:return p.sent(),[3,5];case 4:throw s=p.sent(),t.handleError(s);case 5:return r++,[3,1];case 6:if(t.prepareVisitors(),!t.hasListener)return[3,18];o=t.result.root,p.label=7;case 7:if(o[Un])return[3,14];o[Un]=!0,a=[Ww(o)],p.label=8;case 8:if(!(a.length>0))return[3,13];if(c=t.visitTick(a),!os(c))return[3,12];p.label=9;case 9:return p.trys.push([9,11,,12]),[4,c];case 10:return p.sent(),[3,12];case 11:throw u=p.sent(),l=a[a.length-1].node,t.handleError(u,l);case 12:return[3,8];case 13:return[3,7];case 14:if(!t.listeners.OnceExit)return[3,18];d=function(){var g,v,y,B,b;return $A(this,function(w){switch(w.label){case 0:g=f.value,v=g[0],y=g[1],t.result.lastPlugin=v,w.label=1;case 1:return w.trys.push([1,6,,7]),o.type!=="document"?[3,3]:(B=o.nodes.map(function(_){return y(_,t.helpers)}),[4,Promise.all(B)]);case 2:return w.sent(),[3,5];case 3:return[4,y(o,t.helpers)];case 4:w.sent(),w.label=5;case 5:return[3,7];case 6:throw b=w.sent(),t.handleError(b);case 7:return[2]}})},h=W(t.listeners.OnceExit),p.label=15;case 15:return(f=h()).done?[3,18]:[5,Ny(d())];case 16:p.sent(),p.label=17;case 17:return[3,15];case 18:return t.processed=!0,[2,t.stringify()]}})})()},e.runOnRoot=function(t){var r=this;this.result.lastPlugin=t;try{if((typeof t>"u"?"undefined":se(t))==="object"&&t.Once){if(this.result.root.type==="document"){var i=this.result.root.nodes.map(function(A){return t.Once(A,r.helpers)});return os(i[0])?Promise.all(i):i}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(A){throw this.handleError(A)}},e.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var t=this.result.opts,r=gO;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);var i=new fO(r,this.result.root,this.result.opts),A=i.generate();return this.result.css=A[0],this.result.map=A[1],this.result},e.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var t=W(this.plugins),r;!(r=t()).done;){var i=r.value,A=this.runOnRoot(i);if(os(A))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var s=this.result.root;!s[Un];)s[Un]=!0,this.walkSync(s);if(this.listeners.OnceExit)if(s.type==="document")for(var o=W(s.nodes),a;!(a=o()).done;){var c=a.value;this.visitSync(this.listeners.OnceExit,c)}else this.visitSync(this.listeners.OnceExit,s)}return this.result},e.then=function(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||yO("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)},e.toString=function(){return this.css},e.visitSync=function(t,r){for(var i=W(t),A;!(A=i()).done;){var s=A.value,o=s[0],a=s[1];this.result.lastPlugin=o;var c=void 0;try{c=a(r,this.helpers)}catch(u){throw this.handleError(u,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(os(c))throw this.getAsyncError()}},e.visitTick=function(t){var r=t[t.length-1],i=r.node,A=r.visitors;if(i.type!=="root"&&i.type!=="document"&&!i.parent){t.pop();return}if(A.length>0&&r.visitorIndex<A.length){var s=A[r.visitorIndex],o=s[0],a=s[1];r.visitorIndex+=1,r.visitorIndex===A.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=o;try{return a(i.toProxy(),this.helpers)}catch(h){throw this.handleError(h,i)}}if(r.iterator!==0){for(var c=r.iterator,u;u=i.nodes[i.indexes[c]];)if(i.indexes[c]+=1,!u[Un]){u[Un]=!0,t.push(Ww(u));return}r.iterator=0,delete i.indexes[c]}for(var l=r.events;r.eventIndex<l.length;){var d=l[r.eventIndex];if(r.eventIndex+=1,d===ji){i.nodes&&i.nodes.length&&(i[Un]=!0,r.iterator=i.getIterator());return}else if(this.listeners[d]){r.visitors=this.listeners[d];return}}t.pop()},e.walkSync=function(t){var r=this;t[Un]=!0;for(var i=jw(t),A=W(i),s;!(s=A()).done;){var o=s.value;if(o===ji)t.nodes&&t.each(function(c){c[Un]||r.walkSync(c)});else{var a=this.listeners[o];if(a&&this.visitSync(a,t.toProxy()))return}}},e.warnings=function(){return this.sync().warnings()},bt(n,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),n}();Wi.registerPostcss=function(n){ah=n};var qw=Wi;Wi.default=Wi,bO.registerLazyResult(Wi),vO.registerLazyResult(Wi);var SO=yw,kO=Ia,EO=Fw,UO=sh,TO=nh,ch=function(){function n(t,r,i){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=i,this._map=void 0;var A,s=kO;this.result=new TO(this._processor,A,this._opts),this.result.css=r;var o=this;Object.defineProperty(this.result,"root",{get:function(){return o.root}});var a=new SO(s,A,this._opts,r);if(a.isMap()){var c=a.generate(),u=c[0],l=c[1];u&&(this.result.css=u),l&&(this.result.map=l)}else a.clearAnnotation(),this.result.css=a.css}var e=n.prototype;return e.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},e.catch=function(t){return this.async().catch(t)},e.finally=function(t){return this.async().then(t,t)},e.sync=function(){if(this.error)throw this.error;return this.result},e.then=function(t,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||EO("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)},e.toString=function(){return this._css},e.warnings=function(){return[]},bt(n,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var t,r=UO;try{t=r(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=t,t}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),n}(),IO=ch;ch.default=ch;var FO=IO,xO=qw,QO=$d,RO=As,as=function(){function n(t){t===void 0&&(t=[]),this.version="8.4.38",this.plugins=this.normalize(t)}var e=n.prototype;return e.normalize=function(t){for(var r=[],i=W(t),A;!(A=i()).done;){var s=A.value;if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),(typeof s>"u"?"undefined":se(s))==="object"&&Array.isArray(s.plugins))r=r.concat(s.plugins);else if((typeof s>"u"?"undefined":se(s))==="object"&&s.postcssPlugin)r.push(s);else if(typeof s=="function")r.push(s);else if((typeof s>"u"?"undefined":se(s))==="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(s+" is not a PostCSS plugin")}return r},e.process=function(t,r){return r===void 0&&(r={}),!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new FO(this,t,r):new xO(this,t,r)},e.use=function(t){return this.plugins=this.plugins.concat(this.normalize([t])),this},n}(),PO=as;as.default=as,RO.registerProcessor(as),QO.registerProcessor(as);var OO=Qa,MO=uw,LO=Da,DO=ih,NO=Oa,HO=As,KO=Ah;function cs(n,e){if(Array.isArray(n))return n.map(function(l){return cs(l)});var t=n.inputs,r=YA(n,["inputs"]);if(t){e=[];for(var i=W(t),A;!(A=i()).done;){var s=A.value,o=me({},s,{__proto__:NO.prototype});o.map&&(o.map=me({},o.map,{__proto__:MO.prototype})),e.push(o)}}if(r.nodes&&(r.nodes=n.nodes.map(function(l){return cs(l,e)})),r.source){var a=r.source,c=a.inputId,u=YA(a,["inputId"]);r.source=u,c!=null&&(r.source.input=e[c])}if(r.type==="root")return new HO(r);if(r.type==="decl")return new OO(r);if(r.type==="rule")return new KO(r);if(r.type==="comment")return new LO(r);if(r.type==="atrule")return new DO(r);throw new Error("Unknown node type: "+n.type)}var VO=cs;cs.default=cs;var GO=Ld,Jw=Qa,jO=qw,WO=$r,uh=PO,qO=Ia,JO=VO,zw=$d,zO=xw,Xw=Da,Yw=ih,XO=nh,YO=Oa,ZO=sh,$O=Nw,Zw=Ah,$w=As,e2=xa;function ke(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new uh(e)}ke.plugin=function(n,e){var t=!1;function r(){for(var A=arguments.length,s=new Array(A),o=0;o<A;o++)s[o]=arguments[o];console&&console.warn&&!t&&(t=!0,console.warn(n+`: postcss.plugin was deprecated. Migration guide:
84
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var sh=za;za.default=za,lO.registerParse(za);var Un=br.isClean,pO=br.my,fO=yw,gO=Ia,mO=$r,vO=$d,yO=Fw,Gw=nh,wO=sh,bO=As,BO={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},CO={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},_O={Once:!0,postcssPlugin:!0,prepare:!0},ji=0;function os(n){return(typeof n>"u"?"undefined":se(n))==="object"&&typeof n.then=="function"}function jw(n){var e=!1,t=BO[n.type];return n.type==="decl"?e=n.prop.toLowerCase():n.type==="atrule"&&(e=n.name.toLowerCase()),e&&n.append?[t,t+"-"+e,ji,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:n.append?[t,ji,t+"Exit"]:[t,t+"Exit"]}function Ww(n){var e;return n.type==="document"?e=["Document",ji,"DocumentExit"]:n.type==="root"?e=["Root",ji,"RootExit"]:e=jw(n),{eventIndex:0,events:e,iterator:0,node:n,visitorIndex:0,visitors:[]}}function oh(n){return n[Un]=!1,n.nodes&&n.nodes.forEach(function(e){return oh(e)}),n}var ah={},Wi=function(){function n(t,r,i){var A=this;this.stringified=!1,this.processed=!1;var s;if((typeof r>"u"?"undefined":se(r))==="object"&&r!==null&&(r.type==="root"||r.type==="document"))s=oh(r);else if(te(r,n)||te(r,Gw))s=oh(r.root),r.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{var o=wO;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{s=o(r,i)}catch(a){this.processed=!0,this.error=a}s&&!s[pO]&&mO.rebuild(s)}this.result=new Gw(t,s,i),this.helpers=me({},ah,{postcss:ah,result:this.result}),this.plugins=this.processor.plugins.map(function(a){return(typeof a>"u"?"undefined":se(a))==="object"&&a.prepare?me({},a,a.prepare(A.result)):a})}var e=n.prototype;return e.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},e.catch=function(t){return this.async().catch(t)},e.finally=function(t){return this.async().then(t,t)},e.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},e.handleError=function(t,r){var i=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=i.postcssPlugin,t.setMessage();else if(i.postcssVersion&&process.env.NODE_ENV!=="production"){var A=i.postcssPlugin,s=i.postcssVersion,o=this.result.processor.version,a=s.split("."),c=o.split(".");(a[0]!==c[0]||parseInt(a[1])>parseInt(c[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+A+" uses "+s+". Perhaps this is the source of the error below.")}}catch(u){console&&console.error&&console.error(u)}return t},e.prepareVisitors=function(){var t=this;this.listeners={};for(var r=function(c,u,l){t.listeners[u]||(t.listeners[u]=[]),t.listeners[u].push([c,l])},i=W(this.plugins),A;!(A=i()).done;){var s=A.value;if((typeof s>"u"?"undefined":se(s))==="object")for(var o in s){if(!CO[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event "+o+" in "+s.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!_O[o])if(se(s[o])==="object")for(var a in s[o])a==="*"?r(s,o,s[o][a]):r(s,o+"-"+a.toLowerCase(),s[o][a]);else typeof s[o]=="function"&&r(s,o,s[o])}}this.hasListener=Object.keys(this.listeners).length>0},e.runAsync=function(){var t=this;return kd(function(){var r,i,A,s,o,a,c,u,l,d,h,f;return $A(this,function(p){switch(p.label){case 0:t.plugin=0,r=0,p.label=1;case 1:if(!(r<t.plugins.length))return[3,6];if(i=t.plugins[r],A=t.runOnRoot(i),!os(A))return[3,5];p.label=2;case 2:return p.trys.push([2,4,,5]),[4,A];case 3:return p.sent(),[3,5];case 4:throw s=p.sent(),t.handleError(s);case 5:return r++,[3,1];case 6:if(t.prepareVisitors(),!t.hasListener)return[3,18];o=t.result.root,p.label=7;case 7:if(o[Un])return[3,14];o[Un]=!0,a=[Ww(o)],p.label=8;case 8:if(!(a.length>0))return[3,13];if(c=t.visitTick(a),!os(c))return[3,12];p.label=9;case 9:return p.trys.push([9,11,,12]),[4,c];case 10:return p.sent(),[3,12];case 11:throw u=p.sent(),l=a[a.length-1].node,t.handleError(u,l);case 12:return[3,8];case 13:return[3,7];case 14:if(!t.listeners.OnceExit)return[3,18];d=function(){var g,v,y,B,b;return $A(this,function(w){switch(w.label){case 0:g=f.value,v=g[0],y=g[1],t.result.lastPlugin=v,w.label=1;case 1:return w.trys.push([1,6,,7]),o.type!=="document"?[3,3]:(B=o.nodes.map(function(_){return y(_,t.helpers)}),[4,Promise.all(B)]);case 2:return w.sent(),[3,5];case 3:return[4,y(o,t.helpers)];case 4:w.sent(),w.label=5;case 5:return[3,7];case 6:throw b=w.sent(),t.handleError(b);case 7:return[2]}})},h=W(t.listeners.OnceExit),p.label=15;case 15:return(f=h()).done?[3,18]:[5,Ny(d())];case 16:p.sent(),p.label=17;case 17:return[3,15];case 18:return t.processed=!0,[2,t.stringify()]}})})()},e.runOnRoot=function(t){var r=this;this.result.lastPlugin=t;try{if((typeof t>"u"?"undefined":se(t))==="object"&&t.Once){if(this.result.root.type==="document"){var i=this.result.root.nodes.map(function(A){return t.Once(A,r.helpers)});return os(i[0])?Promise.all(i):i}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(A){throw this.handleError(A)}},e.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var t=this.result.opts,r=gO;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);var i=new fO(r,this.result.root,this.result.opts),A=i.generate();return this.result.css=A[0],this.result.map=A[1],this.result},e.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var t=W(this.plugins),r;!(r=t()).done;){var i=r.value,A=this.runOnRoot(i);if(os(A))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var s=this.result.root;!s[Un];)s[Un]=!0,this.walkSync(s);if(this.listeners.OnceExit)if(s.type==="document")for(var o=W(s.nodes),a;!(a=o()).done;){var c=a.value;this.visitSync(this.listeners.OnceExit,c)}else this.visitSync(this.listeners.OnceExit,s)}return this.result},e.then=function(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||yO("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)},e.toString=function(){return this.css},e.visitSync=function(t,r){for(var i=W(t),A;!(A=i()).done;){var s=A.value,o=s[0],a=s[1];this.result.lastPlugin=o;var c=void 0;try{c=a(r,this.helpers)}catch(u){throw this.handleError(u,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(os(c))throw this.getAsyncError()}},e.visitTick=function(t){var r=t[t.length-1],i=r.node,A=r.visitors;if(i.type!=="root"&&i.type!=="document"&&!i.parent){t.pop();return}if(A.length>0&&r.visitorIndex<A.length){var s=A[r.visitorIndex],o=s[0],a=s[1];r.visitorIndex+=1,r.visitorIndex===A.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=o;try{return a(i.toProxy(),this.helpers)}catch(h){throw this.handleError(h,i)}}if(r.iterator!==0){for(var c=r.iterator,u;u=i.nodes[i.indexes[c]];)if(i.indexes[c]+=1,!u[Un]){u[Un]=!0,t.push(Ww(u));return}r.iterator=0,delete i.indexes[c]}for(var l=r.events;r.eventIndex<l.length;){var d=l[r.eventIndex];if(r.eventIndex+=1,d===ji){i.nodes&&i.nodes.length&&(i[Un]=!0,r.iterator=i.getIterator());return}else if(this.listeners[d]){r.visitors=this.listeners[d];return}}t.pop()},e.walkSync=function(t){var r=this;t[Un]=!0;for(var i=jw(t),A=W(i),s;!(s=A()).done;){var o=s.value;if(o===ji)t.nodes&&t.each(function(c){c[Un]||r.walkSync(c)});else{var a=this.listeners[o];if(a&&this.visitSync(a,t.toProxy()))return}}},e.warnings=function(){return this.sync().warnings()},bt(n,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),n}();Wi.registerPostcss=function(n){ah=n};var qw=Wi;Wi.default=Wi,bO.registerLazyResult(Wi),vO.registerLazyResult(Wi);var SO=yw,kO=Ia,EO=Fw,UO=sh,TO=nh,ch=function(){function n(t,r,i){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=i,this._map=void 0;var A,s=kO;this.result=new TO(this._processor,A,this._opts),this.result.css=r;var o=this;Object.defineProperty(this.result,"root",{get:function(){return o.root}});var a=new SO(s,A,this._opts,r);if(a.isMap()){var c=a.generate(),u=c[0],l=c[1];u&&(this.result.css=u),l&&(this.result.map=l)}else a.clearAnnotation(),this.result.css=a.css}var e=n.prototype;return e.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},e.catch=function(t){return this.async().catch(t)},e.finally=function(t){return this.async().then(t,t)},e.sync=function(){if(this.error)throw this.error;return this.result},e.then=function(t,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||EO("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)},e.toString=function(){return this._css},e.warnings=function(){return[]},bt(n,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var t,r=UO;try{t=r(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=t,t}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),n}(),IO=ch;ch.default=ch;var FO=IO,xO=qw,QO=$d,RO=As,as=function(){function n(t){t===void 0&&(t=[]),this.version="8.4.38",this.plugins=this.normalize(t)}var e=n.prototype;return e.normalize=function(t){for(var r=[],i=W(t),A;!(A=i()).done;){var s=A.value;if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),(typeof s>"u"?"undefined":se(s))==="object"&&Array.isArray(s.plugins))r=r.concat(s.plugins);else if((typeof s>"u"?"undefined":se(s))==="object"&&s.postcssPlugin)r.push(s);else if(typeof s=="function")r.push(s);else if((typeof s>"u"?"undefined":se(s))==="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(s+" is not a PostCSS plugin")}return r},e.process=function(t,r){return r===void 0&&(r={}),!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new FO(this,t,r):new xO(this,t,r)},e.use=function(t){return this.plugins=this.plugins.concat(this.normalize([t])),this},n}(),PO=as;as.default=as,RO.registerProcessor(as),QO.registerProcessor(as);var OO=Qa,MO=uw,LO=Da,DO=ih,NO=Oa,HO=As,KO=Ah;function cs(n,e){if(Array.isArray(n))return n.map(function(l){return cs(l)});var t=n.inputs,r=YA(n,["inputs"]);if(t){e=[];for(var i=W(t),A;!(A=i()).done;){var s=A.value,o=me({},s,{__proto__:NO.prototype});o.map&&(o.map=me({},o.map,{__proto__:MO.prototype})),e.push(o)}}if(r.nodes&&(r.nodes=n.nodes.map(function(l){return cs(l,e)})),r.source){var a=r.source,c=a.inputId,u=YA(a,["inputId"]);r.source=u,c!=null&&(r.source.input=e[c])}if(r.type==="root")return new HO(r);if(r.type==="decl")return new OO(r);if(r.type==="rule")return new KO(r);if(r.type==="comment")return new LO(r);if(r.type==="atrule")return new DO(r);throw new Error("Unknown node type: "+n.type)}var VO=cs;cs.default=cs;var GO=Ld,Jw=Qa,jO=qw,WO=$r,uh=PO,qO=Ia,JO=VO,zw=$d,zO=xw,Xw=Da,Yw=ih,XO=nh,YO=Oa,ZO=sh,$O=Nw,Zw=Ah,$w=As,e2=xa;function Ee(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new uh(e)}Ee.plugin=function(n,e){var t=!1;function r(){for(var A=arguments.length,s=new Array(A),o=0;o<A;o++)s[o]=arguments[o];console&&console.warn&&!t&&(t=!0,console.warn(n+`: postcss.plugin was deprecated. Migration guide:
85
85
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(n+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
86
- https://www.w3ctech.com/topic/2226`));var a=e.apply(void 0,[].concat(s));return a.postcssPlugin=n,a.postcssVersion=new uh().version,a}var i;return Object.defineProperty(r,"postcss",{get:function(){return i||(i=r()),i}}),r.process=function(A,s,o){return ke([r(o)]).process(A,s)},r},ke.stringify=qO,ke.parse=ZO,ke.fromJSON=JO,ke.list=$O,ke.comment=function(n){return new Xw(n)},ke.atRule=function(n){return new Yw(n)},ke.decl=function(n){return new Jw(n)},ke.rule=function(n){return new Zw(n)},ke.root=function(n){return new $w(n)},ke.document=function(n){return new zw(n)},ke.CssSyntaxError=GO,ke.Declaration=Jw,ke.Container=WO,ke.Processor=uh,ke.Document=zw,ke.Comment=Xw,ke.Warning=zO,ke.AtRule=Yw,ke.Result=XO,ke.Input=YO,ke.Rule=Zw,ke.Root=$w,ke.Node=e2,jO.registerPostcss(ke);var t2=ke;ke.default=ke;var Ge=dP(t2);Ge.stringify,Ge.fromJSON,Ge.plugin,Ge.parse,Ge.list,Ge.document,Ge.comment,Ge.atRule,Ge.rule,Ge.decl,Ge.root,Ge.CssSyntaxError,Ge.Declaration,Ge.Container,Ge.Processor,Ge.Document,Ge.Comment,Ge.Warning,Ge.AtRule,Ge.Result,Ge.Input,Ge.Rule,Ge.Root,Ge.Node;var n2=Object.defineProperty,r2=function(n,e,t){return e in n?n2(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t},Zt=function(n,e,t){return r2(n,(typeof e>"u"?"undefined":se(e))!=="symbol"?e+"":e,t)};function i2(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function A2(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return te(this,r)?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var lh={exports:{}},Le=String,eb=function(){return{isColorSupported:!1,reset:Le,bold:Le,dim:Le,italic:Le,underline:Le,inverse:Le,hidden:Le,strikethrough:Le,black:Le,red:Le,green:Le,yellow:Le,blue:Le,magenta:Le,cyan:Le,white:Le,gray:Le,bgBlack:Le,bgRed:Le,bgGreen:Le,bgYellow:Le,bgBlue:Le,bgMagenta:Le,bgCyan:Le,bgWhite:Le}};lh.exports=eb(),lh.exports.createColors=eb;var s2=lh.exports,o2={},a2=Object.freeze(Object.defineProperty({__proto__:null,default:o2},Symbol.toStringTag,{value:"Module"})),st=A2(a2),tb=s2,nb=st,dh=function(n){kt(e,n);function e(r,i,A,s,o,a){var c;return c=n.call(this,r)||this,c.name="CssSyntaxError",c.reason=r,o&&(c.file=o),s&&(c.source=s),a&&(c.plugin=a),typeof i<"u"&&typeof A<"u"&&(typeof i=="number"?(c.line=i,c.column=A):(c.line=i.line,c.column=i.column,c.endLine=A.line,c.endColumn=A.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,e),c}var t=e.prototype;return t.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},t.showSourceCode=function(r){var i=this;if(!this.source)return"";var A=this.source;r==null&&(r=tb.isColorSupported),nb&&r&&(A=nb(A));var s=A.split(/\r?\n/),o=Math.max(this.line-3,0),a=Math.min(this.line+2,s.length),c=String(a).length,u,l;if(r){var d=tb.createColors(!0),h=d.bold,f=d.gray,p=d.red;u=function(g){return h(p(g))},l=function(g){return f(g)}}else u=l=function(g){return g};return s.slice(o,a).map(function(g,v){var y=o+1+v,B=" "+(" "+y).slice(-c)+" | ";if(y===i.line){var b=l(B.replace(/\d/g," "))+g.slice(0,i.column-1).replace(/[^\t]/g," ");return u(">")+l(B)+g+`
86
+ https://www.w3ctech.com/topic/2226`));var a=e.apply(void 0,[].concat(s));return a.postcssPlugin=n,a.postcssVersion=new uh().version,a}var i;return Object.defineProperty(r,"postcss",{get:function(){return i||(i=r()),i}}),r.process=function(A,s,o){return Ee([r(o)]).process(A,s)},r},Ee.stringify=qO,Ee.parse=ZO,Ee.fromJSON=JO,Ee.list=$O,Ee.comment=function(n){return new Xw(n)},Ee.atRule=function(n){return new Yw(n)},Ee.decl=function(n){return new Jw(n)},Ee.rule=function(n){return new Zw(n)},Ee.root=function(n){return new $w(n)},Ee.document=function(n){return new zw(n)},Ee.CssSyntaxError=GO,Ee.Declaration=Jw,Ee.Container=WO,Ee.Processor=uh,Ee.Document=zw,Ee.Comment=Xw,Ee.Warning=zO,Ee.AtRule=Yw,Ee.Result=XO,Ee.Input=YO,Ee.Rule=Zw,Ee.Root=$w,Ee.Node=e2,jO.registerPostcss(Ee);var t2=Ee;Ee.default=Ee;var Ge=dP(t2);Ge.stringify,Ge.fromJSON,Ge.plugin,Ge.parse,Ge.list,Ge.document,Ge.comment,Ge.atRule,Ge.rule,Ge.decl,Ge.root,Ge.CssSyntaxError,Ge.Declaration,Ge.Container,Ge.Processor,Ge.Document,Ge.Comment,Ge.Warning,Ge.AtRule,Ge.Result,Ge.Input,Ge.Rule,Ge.Root,Ge.Node;var n2=Object.defineProperty,r2=function(n,e,t){return e in n?n2(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t},Zt=function(n,e,t){return r2(n,(typeof e>"u"?"undefined":se(e))!=="symbol"?e+"":e,t)};function i2(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function A2(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return te(this,r)?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var lh={exports:{}},Le=String,eb=function(){return{isColorSupported:!1,reset:Le,bold:Le,dim:Le,italic:Le,underline:Le,inverse:Le,hidden:Le,strikethrough:Le,black:Le,red:Le,green:Le,yellow:Le,blue:Le,magenta:Le,cyan:Le,white:Le,gray:Le,bgBlack:Le,bgRed:Le,bgGreen:Le,bgYellow:Le,bgBlue:Le,bgMagenta:Le,bgCyan:Le,bgWhite:Le}};lh.exports=eb(),lh.exports.createColors=eb;var s2=lh.exports,o2={},a2=Object.freeze(Object.defineProperty({__proto__:null,default:o2},Symbol.toStringTag,{value:"Module"})),st=A2(a2),tb=s2,nb=st,dh=function(n){kt(e,n);function e(r,i,A,s,o,a){var c;return c=n.call(this,r)||this,c.name="CssSyntaxError",c.reason=r,o&&(c.file=o),s&&(c.source=s),a&&(c.plugin=a),typeof i<"u"&&typeof A<"u"&&(typeof i=="number"?(c.line=i,c.column=A):(c.line=i.line,c.column=i.column,c.endLine=A.line,c.endColumn=A.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,e),c}var t=e.prototype;return t.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},t.showSourceCode=function(r){var i=this;if(!this.source)return"";var A=this.source;r==null&&(r=tb.isColorSupported),nb&&r&&(A=nb(A));var s=A.split(/\r?\n/),o=Math.max(this.line-3,0),a=Math.min(this.line+2,s.length),c=String(a).length,u,l;if(r){var d=tb.createColors(!0),h=d.bold,f=d.gray,p=d.red;u=function(g){return h(p(g))},l=function(g){return f(g)}}else u=l=function(g){return g};return s.slice(o,a).map(function(g,v){var y=o+1+v,B=" "+(" "+y).slice(-c)+" | ";if(y===i.line){var b=l(B.replace(/\d/g," "))+g.slice(0,i.column-1).replace(/[^\t]/g," ");return u(">")+l(B)+g+`
87
87
  `+b+u("^")}return" "+l(B)+g}).join(`
88
88
  `)},t.toString=function(){var r=this.showSourceCode();return r&&(r=`
89
89
 
@@ -110,16 +110,16 @@ https://www.w3ctech.com/topic/2226`));var a=e.apply(void 0,[].concat(s));return
110
110
  `," "];return hs.split(n,e)},split:function(n,e,t){for(var r=[],i="",A=!1,s=0,o=!1,a="",c=!1,u=W(n),l;!(l=u()).done;){var d=l.value;c?c=!1:d==="\\"?c=!0:o?d===a&&(o=!1):d==='"'||d==="'"?(o=!0,a=d):d==="("?s+=1:d===")"?s>0&&(s-=1):s===0&&e.includes(d)&&(A=!0),A?(i!==""&&r.push(i.trim()),i="",A=!1):i+=d}return(t||i!=="")&&r.push(i.trim()),r}},Mb=hs;hs.default=hs;var Lb=ei,J2=Mb,pc=function(n){kt(e,n);function e(t){var r;return r=n.call(this,t)||this,r.type="rule",r.nodes||(r.nodes=[]),r}return bt(e,[{key:"selectors",get:function(){return J2.comma(this.selector)},set:function(t){var r=this.selector?this.selector.match(/,\s*/):null,i=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(i)}}]),e}(Lb),Rh=pc;pc.default=pc,Lb.registerRule(pc);var z2=$a,X2=q2,Y2=Ac,Z2=Qh,$2=ds,Db=Rh,Nb={empty:!0,space:!0};function eM(n){for(var e=n.length-1;e>=0;e--){var t=n[e],r=t[3]||t[2];if(r)return r}}var tM=function(){function n(t){this.input=t,this.root=new $2,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}var e=n.prototype;return e.atrule=function(t){var r=new Z2;r.name=t[1].slice(1),r.name===""&&this.unnamedAtrule(r,t),this.init(r,t[2]);for(var i,A,s,o=!1,a=!1,c=[],u=[];!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),i=t[0],i==="("||i==="["?u.push(i==="("?")":"]"):i==="{"&&u.length>0?u.push("}"):i===u[u.length-1]&&u.pop(),u.length===0)if(i===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){a=!0;break}else if(i==="}"){if(c.length>0){for(s=c.length-1,A=c[s];A&&A[0]==="space";)A=c[--s];A&&(r.source.end=this.getPosition(A[3]||A[2]),r.source.end.offset++)}this.end(t);break}else c.push(t);else c.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(r.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(r,"params",c),o&&(t=c[c.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)},e.checkMissedSemicolon=function(t){var r=this.colon(t);if(r!==!1){for(var i=0,A,s=r-1;s>=0&&(A=t[s],!(A[0]!=="space"&&(i+=1,i===2)));s--);throw this.input.error("Missed semicolon",A[0]==="word"?A[3]+1:A[2])}},e.colon=function(t){for(var r=0,i,A,s,o=W(t.entries()),a;!(a=o()).done;){var c=a.value,u=c[0],l=c[1];if(i=l,A=i[0],A==="("&&(r+=1),A===")"&&(r-=1),r===0&&A===":")if(!s)this.doubleColon(i);else{if(s[0]==="word"&&s[1]==="progid")continue;return u}s=i}return!1},e.comment=function(t){var r=new Y2;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;var i=t[1].slice(2,-2);if(/^\s*$/.test(i))r.text="",r.raws.left=i,r.raws.right="";else{var A=i.match(/^(\s*)([^]*\S)(\s*)$/);r.text=A[2],r.raws.left=A[1],r.raws.right=A[3]}},e.createTokenizer=function(){this.tokenizer=X2(this.input)},e.decl=function(t,r){var i=new z2;this.init(i,t[0][2]);var A=t[t.length-1];for(A[0]===";"&&(this.semicolon=!0,t.pop()),i.source.end=this.getPosition(A[3]||A[2]||eM(t)),i.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),i.raws.before+=t.shift()[1];for(i.source.start=this.getPosition(t[0][2]),i.prop="";t.length;){var s=t[0][0];if(s===":"||s==="space"||s==="comment")break;i.prop+=t.shift()[1]}i.raws.between="";for(var o;t.length;)if(o=t.shift(),o[0]===":"){i.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),i.raws.between+=o[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));for(var a=[],c;t.length&&(c=t[0][0],!(c!=="space"&&c!=="comment"));)a.push(t.shift());this.precheckMissedSemicolon(t);for(var u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){i.important=!0;var l=this.stringFrom(t,u);l=this.spacesFromEnd(t)+l,l!==" !important"&&(i.raws.important=l);break}else if(o[1].toLowerCase()==="important"){for(var d=t.slice(0),h="",f=u;f>0;f--){var p=d[f][0];if(h.trim().indexOf("!")===0&&p!=="space")break;h=d.pop()[1]+h}h.trim().indexOf("!")===0&&(i.important=!0,i.raws.important=h,t=d)}if(o[0]!=="space"&&o[0]!=="comment")break}var g=t.some(function(v){return v[0]!=="space"&&v[0]!=="comment"});g&&(i.raws.between+=a.map(function(v){return v[1]}).join(""),a=[]),this.raw(i,"value",a.concat(t),r),i.value.includes(":")&&!r&&this.checkMissedSemicolon(t)},e.doubleColon=function(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})},e.emptyRule=function(t){var r=new Db;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r},e.end=function(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)},e.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},e.freeSemicolon=function(t){if(this.spaces+=t[1],this.current.nodes){var r=this.current.nodes[this.current.nodes.length-1];r&&r.type==="rule"&&!r.raws.ownSemicolon&&(r.raws.ownSemicolon=this.spaces,this.spaces="")}},e.getPosition=function(t){var r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}},e.init=function(t,r){this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)},e.other=function(t){for(var r=!1,i=null,A=!1,s=null,o=[],a=t[1].startsWith("--"),c=[],u=t;u;){if(i=u[0],c.push(u),i==="("||i==="[")s||(s=u),o.push(i==="("?")":"]");else if(a&&A&&i==="{")s||(s=u),o.push("}");else if(o.length===0)if(i===";")if(A){this.decl(c,a);return}else break;else if(i==="{"){this.rule(c);return}else if(i==="}"){this.tokenizer.back(c.pop()),r=!0;break}else i===":"&&(A=!0);else i===o[o.length-1]&&(o.pop(),o.length===0&&(s=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(r=!0),o.length>0&&this.unclosedBracket(s),r&&A){if(!a)for(;c.length&&(u=c[c.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(c.pop());this.decl(c,a)}else this.unknownWord(c)},e.parse=function(){for(var t;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()},e.precheckMissedSemicolon=function(){},e.raw=function(t,r,i,A){for(var s,o,a=i.length,c="",u=!0,l,d,h=0;h<a;h+=1)s=i[h],o=s[0],o==="space"&&h===a-1&&!A?u=!1:o==="comment"?(d=i[h-1]?i[h-1][0]:"empty",l=i[h+1]?i[h+1][0]:"empty",!Nb[d]&&!Nb[l]?c.slice(-1)===","?u=!1:c+=s[1]:u=!1):c+=s[1];if(!u){var f=i.reduce(function(p,g){return p+g[1]},"");t.raws[r]={raw:f,value:c}}t[r]=c},e.rule=function(t){t.pop();var r=new Db;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r},e.spacesAndCommentsFromEnd=function(t){for(var r,i="";t.length&&(r=t[t.length-1][0],!(r!=="space"&&r!=="comment"));)i=t.pop()[1]+i;return i},e.spacesAndCommentsFromStart=function(t){for(var r,i="";t.length&&(r=t[0][0],!(r!=="space"&&r!=="comment"));)i+=t.shift()[1];return i},e.spacesFromEnd=function(t){for(var r,i="";t.length&&(r=t[t.length-1][0],r==="space");)i=t.pop()[1]+i;return i},e.stringFrom=function(t,r){for(var i="",A=r;A<t.length;A++)i+=t[A][1];return t.splice(r,t.length-r),i},e.unclosedBlock=function(){var t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)},e.unclosedBracket=function(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})},e.unexpectedClose=function(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})},e.unknownWord=function(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})},e.unnamedAtrule=function(t,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})},n}(),nM=tM,rM=ei,iM=nM,AM=nc;function fc(n,e){var t=new AM(n,e),r=new iM(t);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?i.message+=`
111
111
  You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(e.from)?i.message+=`
112
112
  You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(e.from)&&(i.message+=`
113
- You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Ph=fc;fc.default=fc,rM.registerParse(fc);var Tn=Br.isClean,sM=Br.my,oM=gb,aM=Xa,cM=ei,uM=Uh,lM=Ub,Hb=Fh,dM=Ph,hM=ds,pM={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},fM={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},gM={Once:!0,postcssPlugin:!0,prepare:!0},Ji=0;function ps(n){return(typeof n>"u"?"undefined":se(n))==="object"&&typeof n.then=="function"}function Kb(n){var e=!1,t=pM[n.type];return n.type==="decl"?e=n.prop.toLowerCase():n.type==="atrule"&&(e=n.name.toLowerCase()),e&&n.append?[t,t+"-"+e,Ji,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:n.append?[t,Ji,t+"Exit"]:[t,t+"Exit"]}function Vb(n){var e;return n.type==="document"?e=["Document",Ji,"DocumentExit"]:n.type==="root"?e=["Root",Ji,"RootExit"]:e=Kb(n),{eventIndex:0,events:e,iterator:0,node:n,visitorIndex:0,visitors:[]}}function Oh(n){return n[Tn]=!1,n.nodes&&n.nodes.forEach(function(e){return Oh(e)}),n}var Mh={},zi=function(){function n(t,r,i){var A=this;this.stringified=!1,this.processed=!1;var s;if((typeof r>"u"?"undefined":se(r))==="object"&&r!==null&&(r.type==="root"||r.type==="document"))s=Oh(r);else if(te(r,n)||te(r,Hb))s=Oh(r.root),r.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{var o=dM;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{s=o(r,i)}catch(a){this.processed=!0,this.error=a}s&&!s[sM]&&cM.rebuild(s)}this.result=new Hb(t,s,i),this.helpers=me({},Mh,{postcss:Mh,result:this.result}),this.plugins=this.processor.plugins.map(function(a){return(typeof a>"u"?"undefined":se(a))==="object"&&a.prepare?me({},a,a.prepare(A.result)):a})}var e=n.prototype;return e.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},e.catch=function(t){return this.async().catch(t)},e.finally=function(t){return this.async().then(t,t)},e.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},e.handleError=function(t,r){var i=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=i.postcssPlugin,t.setMessage();else if(i.postcssVersion&&process.env.NODE_ENV!=="production"){var A=i.postcssPlugin,s=i.postcssVersion,o=this.result.processor.version,a=s.split("."),c=o.split(".");(a[0]!==c[0]||parseInt(a[1])>parseInt(c[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+A+" uses "+s+". Perhaps this is the source of the error below.")}}catch(u){console&&console.error&&console.error(u)}return t},e.prepareVisitors=function(){var t=this;this.listeners={};for(var r=function(c,u,l){t.listeners[u]||(t.listeners[u]=[]),t.listeners[u].push([c,l])},i=W(this.plugins),A;!(A=i()).done;){var s=A.value;if((typeof s>"u"?"undefined":se(s))==="object")for(var o in s){if(!fM[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event "+o+" in "+s.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!gM[o])if(se(s[o])==="object")for(var a in s[o])a==="*"?r(s,o,s[o][a]):r(s,o+"-"+a.toLowerCase(),s[o][a]);else typeof s[o]=="function"&&r(s,o,s[o])}}this.hasListener=Object.keys(this.listeners).length>0},e.runAsync=function(){var t=this;return kd(function(){var r,i,A,s,o,a,c,u,l,d,h,f;return $A(this,function(p){switch(p.label){case 0:t.plugin=0,r=0,p.label=1;case 1:if(!(r<t.plugins.length))return[3,6];if(i=t.plugins[r],A=t.runOnRoot(i),!ps(A))return[3,5];p.label=2;case 2:return p.trys.push([2,4,,5]),[4,A];case 3:return p.sent(),[3,5];case 4:throw s=p.sent(),t.handleError(s);case 5:return r++,[3,1];case 6:if(t.prepareVisitors(),!t.hasListener)return[3,18];o=t.result.root,p.label=7;case 7:if(o[Tn])return[3,14];o[Tn]=!0,a=[Vb(o)],p.label=8;case 8:if(!(a.length>0))return[3,13];if(c=t.visitTick(a),!ps(c))return[3,12];p.label=9;case 9:return p.trys.push([9,11,,12]),[4,c];case 10:return p.sent(),[3,12];case 11:throw u=p.sent(),l=a[a.length-1].node,t.handleError(u,l);case 12:return[3,8];case 13:return[3,7];case 14:if(!t.listeners.OnceExit)return[3,18];d=function(){var g,v,y,B,b;return $A(this,function(w){switch(w.label){case 0:g=f.value,v=g[0],y=g[1],t.result.lastPlugin=v,w.label=1;case 1:return w.trys.push([1,6,,7]),o.type!=="document"?[3,3]:(B=o.nodes.map(function(_){return y(_,t.helpers)}),[4,Promise.all(B)]);case 2:return w.sent(),[3,5];case 3:return[4,y(o,t.helpers)];case 4:w.sent(),w.label=5;case 5:return[3,7];case 6:throw b=w.sent(),t.handleError(b);case 7:return[2]}})},h=W(t.listeners.OnceExit),p.label=15;case 15:return(f=h()).done?[3,18]:[5,Ny(d())];case 16:p.sent(),p.label=17;case 17:return[3,15];case 18:return t.processed=!0,[2,t.stringify()]}})})()},e.runOnRoot=function(t){var r=this;this.result.lastPlugin=t;try{if((typeof t>"u"?"undefined":se(t))==="object"&&t.Once){if(this.result.root.type==="document"){var i=this.result.root.nodes.map(function(A){return t.Once(A,r.helpers)});return ps(i[0])?Promise.all(i):i}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(A){throw this.handleError(A)}},e.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var t=this.result.opts,r=aM;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);var i=new oM(r,this.result.root,this.result.opts),A=i.generate();return this.result.css=A[0],this.result.map=A[1],this.result},e.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var t=W(this.plugins),r;!(r=t()).done;){var i=r.value,A=this.runOnRoot(i);if(ps(A))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var s=this.result.root;!s[Tn];)s[Tn]=!0,this.walkSync(s);if(this.listeners.OnceExit)if(s.type==="document")for(var o=W(s.nodes),a;!(a=o()).done;){var c=a.value;this.visitSync(this.listeners.OnceExit,c)}else this.visitSync(this.listeners.OnceExit,s)}return this.result},e.then=function(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||lM("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)},e.toString=function(){return this.css},e.visitSync=function(t,r){for(var i=W(t),A;!(A=i()).done;){var s=A.value,o=s[0],a=s[1];this.result.lastPlugin=o;var c=void 0;try{c=a(r,this.helpers)}catch(u){throw this.handleError(u,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(ps(c))throw this.getAsyncError()}},e.visitTick=function(t){var r=t[t.length-1],i=r.node,A=r.visitors;if(i.type!=="root"&&i.type!=="document"&&!i.parent){t.pop();return}if(A.length>0&&r.visitorIndex<A.length){var s=A[r.visitorIndex],o=s[0],a=s[1];r.visitorIndex+=1,r.visitorIndex===A.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=o;try{return a(i.toProxy(),this.helpers)}catch(h){throw this.handleError(h,i)}}if(r.iterator!==0){for(var c=r.iterator,u;u=i.nodes[i.indexes[c]];)if(i.indexes[c]+=1,!u[Tn]){u[Tn]=!0,t.push(Vb(u));return}r.iterator=0,delete i.indexes[c]}for(var l=r.events;r.eventIndex<l.length;){var d=l[r.eventIndex];if(r.eventIndex+=1,d===Ji){i.nodes&&i.nodes.length&&(i[Tn]=!0,r.iterator=i.getIterator());return}else if(this.listeners[d]){r.visitors=this.listeners[d];return}}t.pop()},e.walkSync=function(t){var r=this;t[Tn]=!0;for(var i=Kb(t),A=W(i),s;!(s=A()).done;){var o=s.value;if(o===Ji)t.nodes&&t.each(function(c){c[Tn]||r.walkSync(c)});else{var a=this.listeners[o];if(a&&this.visitSync(a,t.toProxy()))return}}},e.warnings=function(){return this.sync().warnings()},bt(n,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),n}();zi.registerPostcss=function(n){Mh=n};var Gb=zi;zi.default=zi,hM.registerLazyResult(zi),uM.registerLazyResult(zi);var mM=gb,vM=Xa,yM=Ub,wM=Ph,bM=Fh,Lh=function(){function n(t,r,i){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=i,this._map=void 0;var A,s=vM;this.result=new bM(this._processor,A,this._opts),this.result.css=r;var o=this;Object.defineProperty(this.result,"root",{get:function(){return o.root}});var a=new mM(s,A,this._opts,r);if(a.isMap()){var c=a.generate(),u=c[0],l=c[1];u&&(this.result.css=u),l&&(this.result.map=l)}else a.clearAnnotation(),this.result.css=a.css}var e=n.prototype;return e.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},e.catch=function(t){return this.async().catch(t)},e.finally=function(t){return this.async().then(t,t)},e.sync=function(){if(this.error)throw this.error;return this.result},e.then=function(t,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||yM("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)},e.toString=function(){return this._css},e.warnings=function(){return[]},bt(n,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var t,r=wM;try{t=r(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=t,t}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),n}(),BM=Lh;Lh.default=Lh;var CM=BM,_M=Gb,SM=Uh,kM=ds,fs=function(){function n(t){t===void 0&&(t=[]),this.version="8.4.38",this.plugins=this.normalize(t)}var e=n.prototype;return e.normalize=function(t){for(var r=[],i=W(t),A;!(A=i()).done;){var s=A.value;if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),(typeof s>"u"?"undefined":se(s))==="object"&&Array.isArray(s.plugins))r=r.concat(s.plugins);else if((typeof s>"u"?"undefined":se(s))==="object"&&s.postcssPlugin)r.push(s);else if(typeof s=="function")r.push(s);else if((typeof s>"u"?"undefined":se(s))==="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(s+" is not a PostCSS plugin")}return r},e.process=function(t,r){return r===void 0&&(r={}),!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new CM(this,t,r):new _M(this,t,r)},e.use=function(t){return this.plugins=this.plugins.concat(this.normalize([t])),this},n}(),EM=fs;fs.default=fs,kM.registerProcessor(fs),SM.registerProcessor(fs);var UM=$a,TM=ob,IM=Ac,FM=Qh,xM=nc,QM=ds,RM=Rh;function gs(n,e){if(Array.isArray(n))return n.map(function(l){return gs(l)});var t=n.inputs,r=YA(n,["inputs"]);if(t){e=[];for(var i=W(t),A;!(A=i()).done;){var s=A.value,o=me({},s,{__proto__:xM.prototype});o.map&&(o.map=me({},o.map,{__proto__:TM.prototype})),e.push(o)}}if(r.nodes&&(r.nodes=n.nodes.map(function(l){return gs(l,e)})),r.source){var a=r.source,c=a.inputId,u=YA(a,["inputId"]);r.source=u,c!=null&&(r.source.input=e[c])}if(r.type==="root")return new QM(r);if(r.type==="decl")return new UM(r);if(r.type==="rule")return new RM(r);if(r.type==="comment")return new IM(r);if(r.type==="atrule")return new FM(r);throw new Error("Unknown node type: "+n.type)}var PM=gs;gs.default=gs;var OM=hh,jb=$a,MM=Gb,LM=ei,Dh=EM,DM=Xa,NM=PM,Wb=Uh,HM=Tb,qb=Ac,Jb=Qh,KM=Fh,VM=nc,GM=Ph,jM=Mb,zb=Rh,Xb=ds,WM=Za;function Ee(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Dh(e)}Ee.plugin=function(n,e){var t=!1;function r(){for(var A=arguments.length,s=new Array(A),o=0;o<A;o++)s[o]=arguments[o];console&&console.warn&&!t&&(t=!0,console.warn(n+`: postcss.plugin was deprecated. Migration guide:
113
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Ph=fc;fc.default=fc,rM.registerParse(fc);var Tn=Br.isClean,sM=Br.my,oM=gb,aM=Xa,cM=ei,uM=Uh,lM=Ub,Hb=Fh,dM=Ph,hM=ds,pM={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},fM={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},gM={Once:!0,postcssPlugin:!0,prepare:!0},Ji=0;function ps(n){return(typeof n>"u"?"undefined":se(n))==="object"&&typeof n.then=="function"}function Kb(n){var e=!1,t=pM[n.type];return n.type==="decl"?e=n.prop.toLowerCase():n.type==="atrule"&&(e=n.name.toLowerCase()),e&&n.append?[t,t+"-"+e,Ji,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:n.append?[t,Ji,t+"Exit"]:[t,t+"Exit"]}function Vb(n){var e;return n.type==="document"?e=["Document",Ji,"DocumentExit"]:n.type==="root"?e=["Root",Ji,"RootExit"]:e=Kb(n),{eventIndex:0,events:e,iterator:0,node:n,visitorIndex:0,visitors:[]}}function Oh(n){return n[Tn]=!1,n.nodes&&n.nodes.forEach(function(e){return Oh(e)}),n}var Mh={},zi=function(){function n(t,r,i){var A=this;this.stringified=!1,this.processed=!1;var s;if((typeof r>"u"?"undefined":se(r))==="object"&&r!==null&&(r.type==="root"||r.type==="document"))s=Oh(r);else if(te(r,n)||te(r,Hb))s=Oh(r.root),r.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{var o=dM;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{s=o(r,i)}catch(a){this.processed=!0,this.error=a}s&&!s[sM]&&cM.rebuild(s)}this.result=new Hb(t,s,i),this.helpers=me({},Mh,{postcss:Mh,result:this.result}),this.plugins=this.processor.plugins.map(function(a){return(typeof a>"u"?"undefined":se(a))==="object"&&a.prepare?me({},a,a.prepare(A.result)):a})}var e=n.prototype;return e.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},e.catch=function(t){return this.async().catch(t)},e.finally=function(t){return this.async().then(t,t)},e.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},e.handleError=function(t,r){var i=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=i.postcssPlugin,t.setMessage();else if(i.postcssVersion&&process.env.NODE_ENV!=="production"){var A=i.postcssPlugin,s=i.postcssVersion,o=this.result.processor.version,a=s.split("."),c=o.split(".");(a[0]!==c[0]||parseInt(a[1])>parseInt(c[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+A+" uses "+s+". Perhaps this is the source of the error below.")}}catch(u){console&&console.error&&console.error(u)}return t},e.prepareVisitors=function(){var t=this;this.listeners={};for(var r=function(c,u,l){t.listeners[u]||(t.listeners[u]=[]),t.listeners[u].push([c,l])},i=W(this.plugins),A;!(A=i()).done;){var s=A.value;if((typeof s>"u"?"undefined":se(s))==="object")for(var o in s){if(!fM[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event "+o+" in "+s.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!gM[o])if(se(s[o])==="object")for(var a in s[o])a==="*"?r(s,o,s[o][a]):r(s,o+"-"+a.toLowerCase(),s[o][a]);else typeof s[o]=="function"&&r(s,o,s[o])}}this.hasListener=Object.keys(this.listeners).length>0},e.runAsync=function(){var t=this;return kd(function(){var r,i,A,s,o,a,c,u,l,d,h,f;return $A(this,function(p){switch(p.label){case 0:t.plugin=0,r=0,p.label=1;case 1:if(!(r<t.plugins.length))return[3,6];if(i=t.plugins[r],A=t.runOnRoot(i),!ps(A))return[3,5];p.label=2;case 2:return p.trys.push([2,4,,5]),[4,A];case 3:return p.sent(),[3,5];case 4:throw s=p.sent(),t.handleError(s);case 5:return r++,[3,1];case 6:if(t.prepareVisitors(),!t.hasListener)return[3,18];o=t.result.root,p.label=7;case 7:if(o[Tn])return[3,14];o[Tn]=!0,a=[Vb(o)],p.label=8;case 8:if(!(a.length>0))return[3,13];if(c=t.visitTick(a),!ps(c))return[3,12];p.label=9;case 9:return p.trys.push([9,11,,12]),[4,c];case 10:return p.sent(),[3,12];case 11:throw u=p.sent(),l=a[a.length-1].node,t.handleError(u,l);case 12:return[3,8];case 13:return[3,7];case 14:if(!t.listeners.OnceExit)return[3,18];d=function(){var g,v,y,B,b;return $A(this,function(w){switch(w.label){case 0:g=f.value,v=g[0],y=g[1],t.result.lastPlugin=v,w.label=1;case 1:return w.trys.push([1,6,,7]),o.type!=="document"?[3,3]:(B=o.nodes.map(function(_){return y(_,t.helpers)}),[4,Promise.all(B)]);case 2:return w.sent(),[3,5];case 3:return[4,y(o,t.helpers)];case 4:w.sent(),w.label=5;case 5:return[3,7];case 6:throw b=w.sent(),t.handleError(b);case 7:return[2]}})},h=W(t.listeners.OnceExit),p.label=15;case 15:return(f=h()).done?[3,18]:[5,Ny(d())];case 16:p.sent(),p.label=17;case 17:return[3,15];case 18:return t.processed=!0,[2,t.stringify()]}})})()},e.runOnRoot=function(t){var r=this;this.result.lastPlugin=t;try{if((typeof t>"u"?"undefined":se(t))==="object"&&t.Once){if(this.result.root.type==="document"){var i=this.result.root.nodes.map(function(A){return t.Once(A,r.helpers)});return ps(i[0])?Promise.all(i):i}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(A){throw this.handleError(A)}},e.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var t=this.result.opts,r=aM;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);var i=new oM(r,this.result.root,this.result.opts),A=i.generate();return this.result.css=A[0],this.result.map=A[1],this.result},e.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var t=W(this.plugins),r;!(r=t()).done;){var i=r.value,A=this.runOnRoot(i);if(ps(A))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var s=this.result.root;!s[Tn];)s[Tn]=!0,this.walkSync(s);if(this.listeners.OnceExit)if(s.type==="document")for(var o=W(s.nodes),a;!(a=o()).done;){var c=a.value;this.visitSync(this.listeners.OnceExit,c)}else this.visitSync(this.listeners.OnceExit,s)}return this.result},e.then=function(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||lM("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)},e.toString=function(){return this.css},e.visitSync=function(t,r){for(var i=W(t),A;!(A=i()).done;){var s=A.value,o=s[0],a=s[1];this.result.lastPlugin=o;var c=void 0;try{c=a(r,this.helpers)}catch(u){throw this.handleError(u,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(ps(c))throw this.getAsyncError()}},e.visitTick=function(t){var r=t[t.length-1],i=r.node,A=r.visitors;if(i.type!=="root"&&i.type!=="document"&&!i.parent){t.pop();return}if(A.length>0&&r.visitorIndex<A.length){var s=A[r.visitorIndex],o=s[0],a=s[1];r.visitorIndex+=1,r.visitorIndex===A.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=o;try{return a(i.toProxy(),this.helpers)}catch(h){throw this.handleError(h,i)}}if(r.iterator!==0){for(var c=r.iterator,u;u=i.nodes[i.indexes[c]];)if(i.indexes[c]+=1,!u[Tn]){u[Tn]=!0,t.push(Vb(u));return}r.iterator=0,delete i.indexes[c]}for(var l=r.events;r.eventIndex<l.length;){var d=l[r.eventIndex];if(r.eventIndex+=1,d===Ji){i.nodes&&i.nodes.length&&(i[Tn]=!0,r.iterator=i.getIterator());return}else if(this.listeners[d]){r.visitors=this.listeners[d];return}}t.pop()},e.walkSync=function(t){var r=this;t[Tn]=!0;for(var i=Kb(t),A=W(i),s;!(s=A()).done;){var o=s.value;if(o===Ji)t.nodes&&t.each(function(c){c[Tn]||r.walkSync(c)});else{var a=this.listeners[o];if(a&&this.visitSync(a,t.toProxy()))return}}},e.warnings=function(){return this.sync().warnings()},bt(n,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),n}();zi.registerPostcss=function(n){Mh=n};var Gb=zi;zi.default=zi,hM.registerLazyResult(zi),uM.registerLazyResult(zi);var mM=gb,vM=Xa,yM=Ub,wM=Ph,bM=Fh,Lh=function(){function n(t,r,i){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=i,this._map=void 0;var A,s=vM;this.result=new bM(this._processor,A,this._opts),this.result.css=r;var o=this;Object.defineProperty(this.result,"root",{get:function(){return o.root}});var a=new mM(s,A,this._opts,r);if(a.isMap()){var c=a.generate(),u=c[0],l=c[1];u&&(this.result.css=u),l&&(this.result.map=l)}else a.clearAnnotation(),this.result.css=a.css}var e=n.prototype;return e.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},e.catch=function(t){return this.async().catch(t)},e.finally=function(t){return this.async().then(t,t)},e.sync=function(){if(this.error)throw this.error;return this.result},e.then=function(t,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||yM("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)},e.toString=function(){return this._css},e.warnings=function(){return[]},bt(n,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var t,r=wM;try{t=r(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=t,t}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),n}(),BM=Lh;Lh.default=Lh;var CM=BM,_M=Gb,SM=Uh,kM=ds,fs=function(){function n(t){t===void 0&&(t=[]),this.version="8.4.38",this.plugins=this.normalize(t)}var e=n.prototype;return e.normalize=function(t){for(var r=[],i=W(t),A;!(A=i()).done;){var s=A.value;if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),(typeof s>"u"?"undefined":se(s))==="object"&&Array.isArray(s.plugins))r=r.concat(s.plugins);else if((typeof s>"u"?"undefined":se(s))==="object"&&s.postcssPlugin)r.push(s);else if(typeof s=="function")r.push(s);else if((typeof s>"u"?"undefined":se(s))==="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(s+" is not a PostCSS plugin")}return r},e.process=function(t,r){return r===void 0&&(r={}),!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new CM(this,t,r):new _M(this,t,r)},e.use=function(t){return this.plugins=this.plugins.concat(this.normalize([t])),this},n}(),EM=fs;fs.default=fs,kM.registerProcessor(fs),SM.registerProcessor(fs);var UM=$a,TM=ob,IM=Ac,FM=Qh,xM=nc,QM=ds,RM=Rh;function gs(n,e){if(Array.isArray(n))return n.map(function(l){return gs(l)});var t=n.inputs,r=YA(n,["inputs"]);if(t){e=[];for(var i=W(t),A;!(A=i()).done;){var s=A.value,o=me({},s,{__proto__:xM.prototype});o.map&&(o.map=me({},o.map,{__proto__:TM.prototype})),e.push(o)}}if(r.nodes&&(r.nodes=n.nodes.map(function(l){return gs(l,e)})),r.source){var a=r.source,c=a.inputId,u=YA(a,["inputId"]);r.source=u,c!=null&&(r.source.input=e[c])}if(r.type==="root")return new QM(r);if(r.type==="decl")return new UM(r);if(r.type==="rule")return new RM(r);if(r.type==="comment")return new IM(r);if(r.type==="atrule")return new FM(r);throw new Error("Unknown node type: "+n.type)}var PM=gs;gs.default=gs;var OM=hh,jb=$a,MM=Gb,LM=ei,Dh=EM,DM=Xa,NM=PM,Wb=Uh,HM=Tb,qb=Ac,Jb=Qh,KM=Fh,VM=nc,GM=Ph,jM=Mb,zb=Rh,Xb=ds,WM=Za;function Ue(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Dh(e)}Ue.plugin=function(n,e){var t=!1;function r(){for(var A=arguments.length,s=new Array(A),o=0;o<A;o++)s[o]=arguments[o];console&&console.warn&&!t&&(t=!0,console.warn(n+`: postcss.plugin was deprecated. Migration guide:
114
114
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(n+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
115
- https://www.w3ctech.com/topic/2226`));var a=e.apply(void 0,[].concat(s));return a.postcssPlugin=n,a.postcssVersion=new Dh().version,a}var i;return Object.defineProperty(r,"postcss",{get:function(){return i||(i=r()),i}}),r.process=function(A,s,o){return Ee([r(o)]).process(A,s)},r},Ee.stringify=DM,Ee.parse=GM,Ee.fromJSON=NM,Ee.list=jM,Ee.comment=function(n){return new qb(n)},Ee.atRule=function(n){return new Jb(n)},Ee.decl=function(n){return new jb(n)},Ee.rule=function(n){return new zb(n)},Ee.root=function(n){return new Xb(n)},Ee.document=function(n){return new Wb(n)},Ee.CssSyntaxError=OM,Ee.Declaration=jb,Ee.Container=LM,Ee.Processor=Dh,Ee.Document=Wb,Ee.Comment=qb,Ee.Warning=HM,Ee.AtRule=Jb,Ee.Result=KM,Ee.Input=VM,Ee.Rule=zb,Ee.Root=Xb,Ee.Node=WM,MM.registerPostcss(Ee);var qM=Ee;Ee.default=Ee;var je=i2(qM);je.stringify,je.fromJSON,je.plugin,je.parse,je.list,je.document,je.comment,je.atRule,je.rule,je.decl,je.root,je.CssSyntaxError,je.Declaration,je.Container,je.Processor,je.Document,je.Comment,je.Warning,je.AtRule,je.Result,je.Input,je.Rule,je.Root,je.Node;var JM=function(){function n(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];Zt(this,"parentElement",null),Zt(this,"parentNode",null),Zt(this,"ownerDocument"),Zt(this,"firstChild",null),Zt(this,"lastChild",null),Zt(this,"previousSibling",null),Zt(this,"nextSibling",null),Zt(this,"ELEMENT_NODE",1),Zt(this,"TEXT_NODE",3),Zt(this,"nodeType"),Zt(this,"nodeName"),Zt(this,"RRNodeType")}var e=n.prototype;return e.contains=function(t){if(te(t,n)){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1},e.appendChild=function(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")},e.insertBefore=function(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")},e.removeChild=function(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")},e.toString=function(){return"RRNode"},bt(n,[{key:"childNodes",get:function(){for(var t=[],r=this.firstChild;r;)t.push(r),r=r.nextSibling;return t}}]),n}(),Yb={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Zb={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},gc={},zM=function(){return!!globalThis.Zone};function Nh(n){if(gc[n])return gc[n];var e=globalThis[n],t=e.prototype,r=n in Yb?Yb[n]:void 0,i=!!(r&&r.every(function(u){var l,d;return!!((d=(l=Object.getOwnPropertyDescriptor(t,u))==null?void 0:l.get)!=null&&d.toString().includes("[native code]"))})),A=n in Zb?Zb[n]:void 0,s=!!(A&&A.every(function(u){var l;return typeof t[u]=="function"&&((l=t[u])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!zM())return gc[n]=e.prototype,e.prototype;try{var o=document.createElement("iframe");document.body.appendChild(o);var a=o.contentWindow;if(!a)return e.prototype;var c=a[n].prototype;return document.body.removeChild(o),c?gc[n]=c:t}catch{return t}}var Hh={};function Cr(n,e,t){var r,i=n+"."+String(t);if(Hh[i])return Hh[i].call(e);var A=Nh(n),s=(r=Object.getOwnPropertyDescriptor(A,t))==null?void 0:r.get;return s?(Hh[i]=s,s.call(e)):e[t]}var Kh={};function $b(n,e,t){var r=n+"."+String(t);if(Kh[r])return Kh[r].bind(e);var i=Nh(n),A=i[t];return typeof A!="function"?e[t]:(Kh[r]=A,A.bind(e))}function XM(n){return Cr("Node",n,"childNodes")}function YM(n){return Cr("Node",n,"parentNode")}function ZM(n){return Cr("Node",n,"parentElement")}function $M(n){return Cr("Node",n,"textContent")}function eL(n,e){return $b("Node",n,"contains")(e)}function tL(n){return $b("Node",n,"getRootNode")()}function nL(n){return!n||!("host"in n)?null:Cr("ShadowRoot",n,"host")}function rL(n){return n.styleSheets}function iL(n){return!n||!("shadowRoot"in n)?null:Cr("Element",n,"shadowRoot")}function AL(n,e){return Cr("Element",n,"querySelector")(e)}function sL(n,e){return Cr("Element",n,"querySelectorAll")(e)}function eB(){return Nh("MutationObserver").constructor}var oe={childNodes:XM,parentNode:YM,parentElement:ZM,textContent:$M,contains:eL,getRootNode:tL,host:nL,styleSheets:rL,shadowRoot:iL,querySelector:AL,querySelectorAll:sL,mutationObserver:eB};function It(n,e,t){t===void 0&&(t=document);var r={capture:!0,passive:!0};return t.addEventListener(n,e,r),function(){return t.removeEventListener(n,e,r)}}var Xi=`Please stop import mirror directly. Instead of that,\r
115
+ https://www.w3ctech.com/topic/2226`));var a=e.apply(void 0,[].concat(s));return a.postcssPlugin=n,a.postcssVersion=new Dh().version,a}var i;return Object.defineProperty(r,"postcss",{get:function(){return i||(i=r()),i}}),r.process=function(A,s,o){return Ue([r(o)]).process(A,s)},r},Ue.stringify=DM,Ue.parse=GM,Ue.fromJSON=NM,Ue.list=jM,Ue.comment=function(n){return new qb(n)},Ue.atRule=function(n){return new Jb(n)},Ue.decl=function(n){return new jb(n)},Ue.rule=function(n){return new zb(n)},Ue.root=function(n){return new Xb(n)},Ue.document=function(n){return new Wb(n)},Ue.CssSyntaxError=OM,Ue.Declaration=jb,Ue.Container=LM,Ue.Processor=Dh,Ue.Document=Wb,Ue.Comment=qb,Ue.Warning=HM,Ue.AtRule=Jb,Ue.Result=KM,Ue.Input=VM,Ue.Rule=zb,Ue.Root=Xb,Ue.Node=WM,MM.registerPostcss(Ue);var qM=Ue;Ue.default=Ue;var je=i2(qM);je.stringify,je.fromJSON,je.plugin,je.parse,je.list,je.document,je.comment,je.atRule,je.rule,je.decl,je.root,je.CssSyntaxError,je.Declaration,je.Container,je.Processor,je.Document,je.Comment,je.Warning,je.AtRule,je.Result,je.Input,je.Rule,je.Root,je.Node;var JM=function(){function n(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];Zt(this,"parentElement",null),Zt(this,"parentNode",null),Zt(this,"ownerDocument"),Zt(this,"firstChild",null),Zt(this,"lastChild",null),Zt(this,"previousSibling",null),Zt(this,"nextSibling",null),Zt(this,"ELEMENT_NODE",1),Zt(this,"TEXT_NODE",3),Zt(this,"nodeType"),Zt(this,"nodeName"),Zt(this,"RRNodeType")}var e=n.prototype;return e.contains=function(t){if(te(t,n)){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1},e.appendChild=function(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")},e.insertBefore=function(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")},e.removeChild=function(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")},e.toString=function(){return"RRNode"},bt(n,[{key:"childNodes",get:function(){for(var t=[],r=this.firstChild;r;)t.push(r),r=r.nextSibling;return t}}]),n}(),Yb={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Zb={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},gc={},zM=function(){return!!globalThis.Zone};function Nh(n){if(gc[n])return gc[n];var e=globalThis[n],t=e.prototype,r=n in Yb?Yb[n]:void 0,i=!!(r&&r.every(function(u){var l,d;return!!((d=(l=Object.getOwnPropertyDescriptor(t,u))==null?void 0:l.get)!=null&&d.toString().includes("[native code]"))})),A=n in Zb?Zb[n]:void 0,s=!!(A&&A.every(function(u){var l;return typeof t[u]=="function"&&((l=t[u])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!zM())return gc[n]=e.prototype,e.prototype;try{var o=document.createElement("iframe");document.body.appendChild(o);var a=o.contentWindow;if(!a)return e.prototype;var c=a[n].prototype;return document.body.removeChild(o),c?gc[n]=c:t}catch{return t}}var Hh={};function Cr(n,e,t){var r,i=n+"."+String(t);if(Hh[i])return Hh[i].call(e);var A=Nh(n),s=(r=Object.getOwnPropertyDescriptor(A,t))==null?void 0:r.get;return s?(Hh[i]=s,s.call(e)):e[t]}var Kh={};function $b(n,e,t){var r=n+"."+String(t);if(Kh[r])return Kh[r].bind(e);var i=Nh(n),A=i[t];return typeof A!="function"?e[t]:(Kh[r]=A,A.bind(e))}function XM(n){return Cr("Node",n,"childNodes")}function YM(n){return Cr("Node",n,"parentNode")}function ZM(n){return Cr("Node",n,"parentElement")}function $M(n){return Cr("Node",n,"textContent")}function eL(n,e){return $b("Node",n,"contains")(e)}function tL(n){return $b("Node",n,"getRootNode")()}function nL(n){return!n||!("host"in n)?null:Cr("ShadowRoot",n,"host")}function rL(n){return n.styleSheets}function iL(n){return!n||!("shadowRoot"in n)?null:Cr("Element",n,"shadowRoot")}function AL(n,e){return Cr("Element",n,"querySelector")(e)}function sL(n,e){return Cr("Element",n,"querySelectorAll")(e)}function eB(){return Nh("MutationObserver").constructor}var oe={childNodes:XM,parentNode:YM,parentElement:ZM,textContent:$M,contains:eL,getRootNode:tL,host:nL,styleSheets:rL,shadowRoot:iL,querySelector:AL,querySelectorAll:sL,mutationObserver:eB};function It(n,e,t){t===void 0&&(t=document);var r={capture:!0,passive:!0};return t.addEventListener(n,e,r),function(){return t.removeEventListener(n,e,r)}}var Xi=`Please stop import mirror directly. Instead of that,\r
116
116
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
117
- or you can use record.mirror to access the mirror instance during recording.`,tB={map:{},getId:function(){return console.error(Xi),-1},getNode:function(){return console.error(Xi),null},removeNodeFromMap:function(){console.error(Xi)},has:function(){return console.error(Xi),!1},reset:function(){console.error(Xi)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(tB=new Proxy(tB,{get:function(n,e,t){return e==="map"&&console.error(Xi),Reflect.get(n,e,t)}}));function ms(n,e,t){t===void 0&&(t={});var r=null,i=0;return function(){for(var A=arguments.length,s=new Array(A),o=0;o<A;o++)s[o]=arguments[o];var a=Date.now();!i&&t.leading===!1&&(i=a);var c=e-(a-i),u=this;c<=0||c>e?(r&&(clearTimeout(r),r=null),i=a,n.apply(u,s)):!r&&t.trailing!==!1&&(r=setTimeout(function(){i=t.leading===!1?0:Date.now(),r=null,n.apply(u,s)},c))}}function mc(n,e,t,r,i){i===void 0&&(i=window);var A=i.Object.getOwnPropertyDescriptor(n,e);return i.Object.defineProperty(n,e,r?t:{set:function(s){var o=this;setTimeout(function(){t.set.call(o,s)},0),A&&A.set&&A.set.call(this,s)}}),function(){return mc(n,e,A||{},!0)}}function Yi(n,e,t){try{if(!(e in n))return function(){};var r=n[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),n[e]=i,function(){n[e]=r}}catch{return function(){}}}var vc=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(vc=function(){return new Date().getTime()});function nB(n){var e,t,r,i,A=n.document;return{left:A.scrollingElement?A.scrollingElement.scrollLeft:n.pageXOffset!==void 0?n.pageXOffset:A.documentElement.scrollLeft||(A==null?void 0:A.body)&&((e=oe.parentElement(A.body))==null?void 0:e.scrollLeft)||((t=A==null?void 0:A.body)==null?void 0:t.scrollLeft)||0,top:A.scrollingElement?A.scrollingElement.scrollTop:n.pageYOffset!==void 0?n.pageYOffset:(A==null?void 0:A.documentElement.scrollTop)||(A==null?void 0:A.body)&&((r=oe.parentElement(A.body))==null?void 0:r.scrollTop)||((i=A==null?void 0:A.body)==null?void 0:i.scrollTop)||0}}function rB(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function iB(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function AB(n){if(!n)return null;var e=n.nodeType===n.ELEMENT_NODE?n:oe.parentElement(n);return e}function Ft(n,e,t,r){if(!n)return!1;var i=AB(n);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(Ta(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function oL(n,e){return e.getId(n)!==-1}function Vh(n,e,t){return n.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(n)===ns}function sB(n,e){if(es(n))return!1;var t=e.getId(n);if(!e.has(t))return!0;var r=oe.parentNode(n);return r&&r.nodeType===n.DOCUMENT_NODE?!1:r?sB(r,e):!0}function Gh(n){return!!n.changedTouches}function aL(n){n===void 0&&(n=window),"NodeList"in n&&!n.NodeList.prototype.forEach&&(n.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in n&&!n.DOMTokenList.prototype.forEach&&(n.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function oB(n,e){return!!(n.nodeName==="IFRAME"&&e.getMeta(n))}function aB(n,e){return!!(n.nodeName==="LINK"&&n.nodeType===n.ELEMENT_NODE&&n.getAttribute&&n.getAttribute("rel")==="stylesheet"&&e.getMeta(n))}function jh(n){return n?te(n,JM)&&"shadowRoot"in n?!!n.shadowRoot:!!oe.shadowRoot(n):!1}var cL=function(){function n(){N(this,"id",1),N(this,"styleIDMap",new WeakMap),N(this,"idStyleMap",new Map)}var e=n.prototype;return e.getId=function(t){var r;return(r=this.styleIDMap.get(t))!=null?r:-1},e.has=function(t){return this.styleIDMap.has(t)},e.add=function(t,r){if(this.has(t))return this.getId(t);var i;return r===void 0?i=this.id++:i=r,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i},e.getStyle=function(t){return this.idStyleMap.get(t)||null},e.reset=function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1},e.generateId=function(){return this.id++},n}();function cB(n){var e,t=null;return"getRootNode"in n&&((e=oe.getRootNode(n))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&oe.host(oe.getRootNode(n))&&(t=oe.host(oe.getRootNode(n))),t}function uL(n){for(var e=n,t;t=cB(e);)e=t;return e}function lL(n){var e=n.ownerDocument;if(!e)return!1;var t=uL(n);return oe.contains(e,t)}function uB(n){var e=n.ownerDocument;return e?oe.contains(e,n)||lL(n):!1}var le=function(n){return n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n}(le||{}),z=function(n){return n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n}(z||{}),Gt=function(n){return n[n.MouseUp=0]="MouseUp",n[n.MouseDown=1]="MouseDown",n[n.Click=2]="Click",n[n.ContextMenu=3]="ContextMenu",n[n.DblClick=4]="DblClick",n[n.Focus=5]="Focus",n[n.Blur=6]="Blur",n[n.TouchStart=7]="TouchStart",n[n.TouchMove_Departed=8]="TouchMove_Departed",n[n.TouchEnd=9]="TouchEnd",n[n.TouchCancel=10]="TouchCancel",n}(Gt||{}),Wn=function(n){return n[n.Mouse=0]="Mouse",n[n.Pen=1]="Pen",n[n.Touch=2]="Touch",n}(Wn||{}),Zi=function(n){return n[n["2D"]=0]="2D",n[n.WebGL=1]="WebGL",n[n.WebGL2=2]="WebGL2",n}(Zi||{}),$i=function(n){return n[n.Play=0]="Play",n[n.Pause=1]="Pause",n[n.Seeked=2]="Seeked",n[n.VolumeChange=3]="VolumeChange",n[n.RateChange=4]="RateChange",n}($i||{}),lB=function(n){return n[n.Document=0]="Document",n[n.DocumentType=1]="DocumentType",n[n.Element=2]="Element",n[n.Text=3]="Text",n[n.CDATA=4]="CDATA",n[n.Comment=5]="Comment",n}(lB||{});function dB(n){return"__ln"in n}var dL=function(){function n(){N(this,"length",0),N(this,"head",null),N(this,"tail",null)}var e=n.prototype;return e.get=function(t){if(t>=this.length)throw new Error("Position outside of list range");for(var r=this.head,i=0;i<t;i++)r=(r==null?void 0:r.next)||null;return r},e.addNode=function(t){var r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&dB(t.previousSibling)){var i=t.previousSibling.__ln.next;r.next=i,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,i&&(i.previous=r)}else if(t.nextSibling&&dB(t.nextSibling)&&t.nextSibling.__ln.previous){var A=t.nextSibling.__ln.previous;r.previous=A,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,A&&(A.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++},e.removeNode=function(t){var r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)},n}(),hB=function(n,e){return n+"@"+e},hL=function(){function n(){var t=this;N(this,"frozen",!1),N(this,"locked",!1),N(this,"texts",[]),N(this,"attributes",[]),N(this,"attributeMap",new WeakMap),N(this,"removes",[]),N(this,"mapRemoves",[]),N(this,"movedMap",{}),N(this,"addedSet",new Set),N(this,"movedSet",new Set),N(this,"droppedSet",new Set),N(this,"removesSubTreeCache",new Set),N(this,"mutationCb"),N(this,"blockClass"),N(this,"blockSelector"),N(this,"maskTextClass"),N(this,"maskTextSelector"),N(this,"inlineStylesheet"),N(this,"maskInputOptions"),N(this,"maskTextFn"),N(this,"maskInputFn"),N(this,"keepIframeSrcFn"),N(this,"recordCanvas"),N(this,"inlineImages"),N(this,"slimDOMOptions"),N(this,"dataURLOptions"),N(this,"doc"),N(this,"mirror"),N(this,"iframeManager"),N(this,"stylesheetManager"),N(this,"shadowDomManager"),N(this,"canvasManager"),N(this,"processedNodeManager"),N(this,"unattachedDoc"),N(this,"processMutations",function(r){r.forEach(t.processMutation),t.emit()}),N(this,"emit",function(){if(!(t.frozen||t.locked)){for(var r=[],i=new Set,A=new dL,s=function(T){for(var Q=T,M=ns;M===ns;)Q=Q&&Q.nextSibling,M=Q&&t.mirror.getId(Q);return M},o=function(T){var Q=oe.parentNode(T);if(!(!Q||!uB(T))){var M=!1;if(T.nodeType===Node.TEXT_NODE){var X=Q.tagName;if(X==="TEXTAREA")return;X==="STYLE"&&t.addedSet.has(Q)&&(M=!0)}var H=es(Q)?t.mirror.getId(cB(T)):t.mirror.getId(Q),q=s(T);if(H===-1||q===-1)return A.addNode(T);var ve=Vi(T,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(Y){oB(Y,t.mirror)&&t.iframeManager.addIframe(Y),aB(Y,t.mirror)&&t.stylesheetManager.trackLinkElement(Y),jh(T)&&t.shadowDomManager.addShadowRoot(oe.shadowRoot(T),t.doc)},onIframeLoad:function(Y,ie){t.iframeManager.attachIframe(Y,ie),t.shadowDomManager.observeAttachShadow(Y)},onStylesheetLoad:function(Y,ie){t.stylesheetManager.attachLinkElement(Y,ie)},cssCaptured:M});ve&&(r.push({parentId:H,nextId:q,node:ve}),i.add(ve.id))}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());for(var a=W(t.movedSet),c;!(c=a()).done;){var u=c.value;pB(t.removesSubTreeCache,u,t.mirror)&&!t.movedSet.has(oe.parentNode(u))||o(u)}for(var l=W(t.addedSet),d;!(d=l()).done;){var h=d.value;!fB(t.droppedSet,h)&&!pB(t.removesSubTreeCache,h,t.mirror)||fB(t.movedSet,h)?o(h):t.droppedSet.add(h)}for(var f=null;A.length;){var p=null;if(f){var g=t.mirror.getId(oe.parentNode(f.value)),v=s(f.value);g!==-1&&v!==-1&&(p=f)}if(!p)for(var y=A.tail;y;){var B=y;if(y=y.previous,B){var b=t.mirror.getId(oe.parentNode(B.value)),w=s(B.value);if(w===-1)continue;if(b!==-1){p=B;break}else{var _=B.value,k=oe.parentNode(_);if(k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var F=oe.host(k),x=t.mirror.getId(F);if(x!==-1){p=B;break}}}}}if(!p){for(;A.head;)A.removeNode(A.head.value);break}f=p.previous,A.removeNode(p.value),o(p.value)}var U={texts:t.texts.map(function(T){var Q=T.node,M=oe.parentNode(Q);return M&&M.tagName==="TEXTAREA"&&t.genTextAreaValueMutation(M),{id:t.mirror.getId(Q),value:T.value}}).filter(function(T){return!i.has(T.id)}).filter(function(T){return t.mirror.has(T.id)}),attributes:t.attributes.map(function(T){var Q=T.attributes;if(typeof Q.style=="string"){var M=JSON.stringify(T.styleDiff),X=JSON.stringify(T._unchangedStyles);M.length<Q.style.length&&(M+X).split("var(").length===Q.style.split("var(").length&&(Q.style=T.styleDiff)}return{id:t.mirror.getId(T.node),attributes:Q}}).filter(function(T){return!i.has(T.id)}).filter(function(T){return t.mirror.has(T.id)}),removes:t.removes,adds:r};!U.texts.length&&!U.attributes.length&&!U.removes.length&&!U.adds.length||(t.texts=[],t.attributes=[],t.attributeMap=new WeakMap,t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.removesSubTreeCache=new Set,t.movedMap={},t.mutationCb(U))}}),N(this,"genTextAreaValueMutation",function(r){var i=t.attributeMap.get(r);i||(i={node:r,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(i),t.attributeMap.set(r,i)),i.attributes.value=Array.from(oe.childNodes(r),function(A){return oe.textContent(A)||""}).join("")}),N(this,"processMutation",function(r){if(!Vh(r.target,t.mirror,t.slimDOMOptions))switch(r.type){case"characterData":{var i=oe.textContent(r.target);!Ft(r.target,t.blockClass,t.blockSelector,!1)&&i!==r.oldValue&&t.texts.push({value:nw(r.target,t.maskTextClass,t.maskTextSelector,!0)&&i?t.maskTextFn?t.maskTextFn(i,AB(r.target)):i.replace(/[\S]/g,"*"):i,node:r.target});break}case"attributes":{var A=r.target,s=r.attributeName,o=r.target.getAttribute(s);if(s==="value"){var a=Qd(A);o=xd({element:A,maskInputOptions:t.maskInputOptions,tagName:A.tagName,type:a,value:o,maskInputFn:t.maskInputFn})}if(Ft(r.target,t.blockClass,t.blockSelector,!1)||o===r.oldValue)return;var c=t.attributeMap.get(r.target);if(A.tagName==="IFRAME"&&s==="src"&&!t.keepIframeSrcFn(o))if(!A.contentDocument)s="rr_src";else return;if(c||(c={node:r.target,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(c),t.attributeMap.set(r.target,c)),s==="type"&&A.tagName==="INPUT"&&(r.oldValue||"").toLowerCase()==="password"&&A.setAttribute("data-rr-is-password","true"),!tw(A.tagName,s))if(c.attributes[s]=ew(t.doc,Zr(A.tagName),Zr(s),o),s==="style"){if(!t.unattachedDoc)try{t.unattachedDoc=document.implementation.createHTMLDocument()}catch{t.unattachedDoc=t.doc}var u=t.unattachedDoc.createElement("span");r.oldValue&&u.setAttribute("style",r.oldValue);for(var l=W(Array.from(A.style)),d;!(d=l()).done;){var h=d.value,f=A.style.getPropertyValue(h),p=A.style.getPropertyPriority(h);f!==u.style.getPropertyValue(h)||p!==u.style.getPropertyPriority(h)?p===""?c.styleDiff[h]=f:c.styleDiff[h]=[f,p]:c._unchangedStyles[h]=[f,p]}for(var g=W(Array.from(u.style)),v;!(v=g()).done;){var y=v.value;A.style.getPropertyValue(y)===""&&(c.styleDiff[y]=!1)}}else s==="open"&&A.tagName==="DIALOG"&&(A.matches("dialog:modal")?c.attributes.rr_open_mode="modal":c.attributes.rr_open_mode="non-modal");break}case"childList":{if(Ft(r.target,t.blockClass,t.blockSelector,!0))return;if(r.target.tagName==="TEXTAREA"){t.genTextAreaValueMutation(r.target);return}r.addedNodes.forEach(function(B){return t.genAdds(B,r.target)}),r.removedNodes.forEach(function(B){var b=t.mirror.getId(B),w=es(r.target)?t.mirror.getId(oe.host(r.target)):t.mirror.getId(r.target);Ft(r.target,t.blockClass,t.blockSelector,!1)||Vh(B,t.mirror,t.slimDOMOptions)||!oL(B,t.mirror)||(t.addedSet.has(B)?(Wh(t.addedSet,B),t.droppedSet.add(B)):t.addedSet.has(r.target)&&b===-1||sB(r.target,t.mirror)||(t.movedSet.has(B)&&t.movedMap[hB(b,w)]?Wh(t.movedSet,B):(t.removes.push({parentId:w,id:b,isShadow:es(r.target)&&ts(r.target)?!0:void 0}),pL(B,t.removesSubTreeCache))),t.mapRemoves.push(B))});break}}}),N(this,"genAdds",function(r,i){if(!t.processedNodeManager.inOtherBuffer(r,t)&&!(t.addedSet.has(r)||t.movedSet.has(r))){if(t.mirror.hasNode(r)){if(Vh(r,t.mirror,t.slimDOMOptions))return;t.movedSet.add(r);var A=null;i&&t.mirror.hasNode(i)&&(A=t.mirror.getId(i)),A&&A!==-1&&(t.movedMap[hB(t.mirror.getId(r),A)]=!0)}else t.addedSet.add(r),t.droppedSet.delete(r);Ft(r,t.blockClass,t.blockSelector,!1)||(oe.childNodes(r).forEach(function(s){return t.genAdds(s)}),jh(r)&&oe.childNodes(oe.shadowRoot(r)).forEach(function(s){t.processedNodeManager.add(s,t),t.genAdds(s,r)}))}})}var e=n.prototype;return e.init=function(t){var r=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(function(i){r[i]=t[i]})},e.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.isFrozen=function(){return this.frozen},e.lock=function(){this.locked=!0,this.canvasManager.lock()},e.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},n}();function Wh(n,e){n.delete(e),oe.childNodes(e).forEach(function(t){return Wh(n,t)})}function pL(n,e){for(var t=[n];t.length;){var r=t.pop();e.has(r)||(e.add(r),oe.childNodes(r).forEach(function(i){return t.push(i)}))}}function pB(n,e,t){return n.size===0?!1:fL(n,e)}function fL(n,e,t){var r=oe.parentNode(e);return r?n.has(r):!1}function fB(n,e){return n.size===0?!1:gB(n,e)}function gB(n,e){var t=oe.parentNode(e);return t?n.has(t)?!0:gB(n,t):!1}var vs;function gL(n){vs=n}function mL(){vs=void 0}var he=function(n){if(!vs)return n;var e=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];try{return n.apply(void 0,[].concat(r))}catch(A){if(vs&&vs(A)===!0)return;throw A}};return e},ti=[];function ys(n){try{if("composedPath"in n){var e=n.composedPath();if(e.length)return e[0]}else if("path"in n&&n.path.length)return n.path[0]}catch{}return n&&n.target}function mB(n,e){var t=new hL;ti.push(t),t.init(n);var r=new(eB())(he(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function vL(n){var e=n.mousemoveCb,t=n.sampling,r=n.doc,i=n.mirror;if(t.mousemove===!1)return function(){};var A=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,o=[],a,c=ms(he(function(d){var h=Date.now()-a;e(o.map(function(f){return f.timeOffset-=h,f}),d),o=[],a=null}),s),u=he(ms(he(function(d){var h=ys(d),f=Gh(d)?d.changedTouches[0]:d,p=f.clientX,g=f.clientY;a||(a=vc()),o.push({x:p,y:g,id:i.getId(h),timeOffset:vc()-a}),c(typeof DragEvent<"u"&&te(d,DragEvent)?z.Drag:te(d,MouseEvent)?z.MouseMove:z.TouchMove)}),A,{trailing:!1})),l=[It("mousemove",u,r),It("touchmove",u,r),It("drag",u,r)];return he(function(){l.forEach(function(d){return d()})})}function yL(n){var e=n.mouseInteractionCb,t=n.doc,r=n.mirror,i=n.blockClass,A=n.blockSelector,s=n.sampling;if(s.mouseInteraction===!1)return function(){};var o=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,a=[],c=null,u=function(l){return function(d){var h=ys(d);if(!Ft(h,i,A,!0)){var f=null,p=l;if("pointerType"in d){switch(d.pointerType){case"mouse":f=Wn.Mouse;break;case"touch":f=Wn.Touch;break;case"pen":f=Wn.Pen;break}f===Wn.Touch?Gt[l]===Gt.MouseDown?p="TouchStart":Gt[l]===Gt.MouseUp&&(p="TouchEnd"):Wn.Pen}else Gh(d)&&(f=Wn.Touch);f!==null?(c=f,(p.startsWith("Touch")&&f===Wn.Touch||p.startsWith("Mouse")&&f===Wn.Mouse)&&(f=null)):Gt[l]===Gt.Click&&(f=c,c=null);var g=Gh(d)?d.changedTouches[0]:d;if(g){var v=r.getId(h),y=g.clientX,B=g.clientY;he(e)(me({type:Gt[p],id:v,x:y,y:B},f!==null&&{pointerType:f}))}}}};return Object.keys(Gt).filter(function(l){return Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&o[l]!==!1}).forEach(function(l){var d=Zr(l),h=u(l);if(window.PointerEvent)switch(Gt[l]){case Gt.MouseDown:case Gt.MouseUp:d=d.replace("mouse","pointer");break;case Gt.TouchStart:case Gt.TouchEnd:return}a.push(It(d,h,t))}),he(function(){a.forEach(function(l){return l()})})}function vB(n){var e=n.scrollCb,t=n.doc,r=n.mirror,i=n.blockClass,A=n.blockSelector,s=n.sampling,o=he(ms(he(function(a){var c=ys(a);if(!(!c||Ft(c,i,A,!0))){var u=r.getId(c);if(c===t&&t.defaultView){var l=nB(t.defaultView);e({id:u,x:l.left,y:l.top})}else e({id:u,x:c.scrollLeft,y:c.scrollTop})}}),s.scroll||100));return It("scroll",o,t)}function wL(n,e){var t=n.viewportResizeCb,r=e.win,i=-1,A=-1,s=he(ms(he(function(){var o=rB(),a=iB();(i!==o||A!==a)&&(t({width:Number(a),height:Number(o)}),i=o,A=a)}),200));return It("resize",s,r)}var bL=["INPUT","TEXTAREA","SELECT"],yB=new WeakMap;function BL(n){var e=n.inputCb,t=n.doc,r=n.mirror,i=n.blockClass,A=n.blockSelector,s=n.ignoreClass,o=n.ignoreSelector,a=n.maskInputOptions,c=n.maskInputFn,u=n.sampling,l=n.userTriggeredOnInput;function d(b){var w=ys(b),_=b.isTrusted,k=w&&w.tagName;if(w&&k==="OPTION"&&(w=oe.parentElement(w)),!(!w||!k||bL.indexOf(k)<0||Ft(w,i,A,!0))&&!(w.classList.contains(s)||o&&w.matches(o))){var F=w.value,x=!1,U=Qd(w)||"";U==="radio"||U==="checkbox"?x=w.checked:(a[k.toLowerCase()]||a[U])&&(F=xd({element:w,maskInputOptions:a,tagName:k,type:U,value:F,maskInputFn:c})),h(w,l?{text:F,isChecked:x,userTriggered:_}:{text:F,isChecked:x});var T=w.name;U==="radio"&&T&&x&&t.querySelectorAll('input[type="radio"][name="'+T+'"]').forEach(function(Q){if(Q!==w){var M=Q.value;h(Q,l?{text:M,isChecked:!x,userTriggered:!1}:{text:M,isChecked:!x})}})}}function h(b,w){var _=yB.get(b);if(!_||_.text!==w.text||_.isChecked!==w.isChecked){yB.set(b,w);var k=r.getId(b);he(e)(me({},w,{id:k}))}}var f=u.input==="last"?["change"]:["input","change"],p=f.map(function(b){return It(b,he(d),t)}),g=t.defaultView;if(!g)return function(){p.forEach(function(b){return b()})};var v=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];if(v&&v.set){var B;(B=p).push.apply(B,[].concat(y.map(function(b){return mc(b[0],b[1],{set:function(){he(d)({target:this,isTrusted:!1})}},!1,g)})))}return he(function(){p.forEach(function(b){return b()})})}function yc(n){var e=[];function t(r,i){if(wc("CSSGroupingRule")&&te(r.parentRule,CSSGroupingRule)||wc("CSSMediaRule")&&te(r.parentRule,CSSMediaRule)||wc("CSSSupportsRule")&&te(r.parentRule,CSSSupportsRule)||wc("CSSConditionRule")&&te(r.parentRule,CSSConditionRule)){var A=Array.from(r.parentRule.cssRules),s=A.indexOf(r);i.unshift(s)}else if(r.parentStyleSheet){var o=Array.from(r.parentStyleSheet.cssRules),a=o.indexOf(r);i.unshift(a)}return i}return t(n,e)}function _r(n,e,t){var r,i;return n?(n.ownerNode?r=e.getId(n.ownerNode):i=t.getId(n),{styleId:i,id:r}):{}}function CL(n,e){var t=n.styleSheetRuleCb,r=n.mirror,i=n.stylesheetManager,A=e.win;if(!A.CSSStyleSheet||!A.CSSStyleSheet.prototype)return function(){};var s=A.CSSStyleSheet.prototype.insertRule;A.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:he(function(d,h,f){var p=f[0],g=f[1],v=_r(h,r,i.styleMirror),y=v.id,B=v.styleId;return(y&&y!==-1||B&&B!==-1)&&t({id:y,styleId:B,adds:[{rule:p,index:g}]}),d.apply(h,f)})}),A.CSSStyleSheet.prototype.addRule=function(d,h,f){f===void 0&&(f=this.cssRules.length);var p=d+" { "+h+" }";return A.CSSStyleSheet.prototype.insertRule.apply(this,[p,f])};var o=A.CSSStyleSheet.prototype.deleteRule;A.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:he(function(d,h,f){var p=f[0],g=_r(h,r,i.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&t({id:v,styleId:y,removes:[{index:p}]}),d.apply(h,f)})}),A.CSSStyleSheet.prototype.removeRule=function(d){return A.CSSStyleSheet.prototype.deleteRule.apply(this,[d])};var a;A.CSSStyleSheet.prototype.replace&&(a=A.CSSStyleSheet.prototype.replace,A.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:he(function(d,h,f){var p=f[0],g=_r(h,r,i.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&t({id:v,styleId:y,replace:p}),d.apply(h,f)})}));var c;A.CSSStyleSheet.prototype.replaceSync&&(c=A.CSSStyleSheet.prototype.replaceSync,A.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:he(function(d,h,f){var p=f[0],g=_r(h,r,i.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&t({id:v,styleId:y,replaceSync:p}),d.apply(h,f)})}));var u={};bc("CSSGroupingRule")?u.CSSGroupingRule=A.CSSGroupingRule:(bc("CSSMediaRule")&&(u.CSSMediaRule=A.CSSMediaRule),bc("CSSConditionRule")&&(u.CSSConditionRule=A.CSSConditionRule),bc("CSSSupportsRule")&&(u.CSSSupportsRule=A.CSSSupportsRule));var l={};return Object.entries(u).forEach(function(d){var h=d[0],f=d[1];l[h]={insertRule:f.prototype.insertRule,deleteRule:f.prototype.deleteRule},f.prototype.insertRule=new Proxy(l[h].insertRule,{apply:he(function(p,g,v){var y=v[0],B=v[1],b=_r(g.parentStyleSheet,r,i.styleMirror),w=b.id,_=b.styleId;return(w&&w!==-1||_&&_!==-1)&&t({id:w,styleId:_,adds:[{rule:y,index:[].concat(yc(g),[B||0])}]}),p.apply(g,v)})}),f.prototype.deleteRule=new Proxy(l[h].deleteRule,{apply:he(function(p,g,v){var y=v[0],B=_r(g.parentStyleSheet,r,i.styleMirror),b=B.id,w=B.styleId;return(b&&b!==-1||w&&w!==-1)&&t({id:b,styleId:w,removes:[{index:[].concat(yc(g),[y])}]}),p.apply(g,v)})})}),he(function(){A.CSSStyleSheet.prototype.insertRule=s,A.CSSStyleSheet.prototype.deleteRule=o,a&&(A.CSSStyleSheet.prototype.replace=a),c&&(A.CSSStyleSheet.prototype.replaceSync=c),Object.entries(u).forEach(function(d){var h=d[0],f=d[1];f.prototype.insertRule=l[h].insertRule,f.prototype.deleteRule=l[h].deleteRule})})}function wB(n,e){var t=n.mirror,r=n.stylesheetManager,i,A,s,o=null;e.nodeName==="#document"?o=t.getId(e):o=t.getId(oe.host(e));var a=e.nodeName==="#document"?(i=e.defaultView)==null?void 0:i.Document:(s=(A=e.ownerDocument)==null?void 0:A.defaultView)==null?void 0:s.ShadowRoot,c=a!=null&&a.prototype?Object.getOwnPropertyDescriptor(a==null?void 0:a.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!a||!c?function(){}:(Object.defineProperty(e,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:function(){var u;return(u=c.get)==null?void 0:u.call(this)},set:function(u){var l,d=(l=c.set)==null?void 0:l.call(this,u);if(o!==null&&o!==-1)try{r.adoptStyleSheets(u,o)}catch{}return d}}),he(function(){Object.defineProperty(e,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))}function _L(n,e){var t=n.styleDeclarationCb,r=n.mirror,i=n.ignoreCSSAttributes,A=n.stylesheetManager,s=e.win,o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:he(function(c,u,l){var d,h=l[0],f=l[1],p=l[2];if(i.has(h))return o.apply(u,[h,f,p]);var g=_r((d=u.parentRule)==null?void 0:d.parentStyleSheet,r,A.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&t({id:v,styleId:y,set:{property:h,value:f,priority:p},index:yc(u.parentRule)}),c.apply(u,l)})});var a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:he(function(c,u,l){var d,h=l[0];if(i.has(h))return a.apply(u,[h]);var f=_r((d=u.parentRule)==null?void 0:d.parentStyleSheet,r,A.styleMirror),p=f.id,g=f.styleId;return(p&&p!==-1||g&&g!==-1)&&t({id:p,styleId:g,remove:{property:h},index:yc(u.parentRule)}),c.apply(u,l)})}),he(function(){s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a})}function SL(n){var e=n.mediaInteractionCb,t=n.blockClass,r=n.blockSelector,i=n.mirror,A=n.sampling,s=n.doc,o=he(function(c){return ms(he(function(u){var l=ys(u);if(!(!l||Ft(l,t,r,!0))){var d=l.currentTime,h=l.volume,f=l.muted,p=l.playbackRate,g=l.loop;e({type:c,id:i.getId(l),currentTime:d,volume:h,muted:f,playbackRate:p,loop:g})}}),A.media||500)}),a=[It("play",o($i.Play),s),It("pause",o($i.Pause),s),It("seeked",o($i.Seeked),s),It("volumechange",o($i.VolumeChange),s),It("ratechange",o($i.RateChange),s)];return he(function(){a.forEach(function(c){return c()})})}function kL(n){var e=n.fontCb,t=n.doc,r=t.defaultView;if(!r)return function(){};var i=[],A=new WeakMap,s=r.FontFace;r.FontFace=function(a,c,u){var l=new s(a,c,u);return A.set(l,{family:a,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),l};var o=Yi(t.fonts,"add",function(a){return function(c){return setTimeout(he(function(){var u=A.get(c);u&&(e(u),A.delete(c))}),0),a.apply(this,[c])}});return i.push(function(){r.FontFace=s}),i.push(o),he(function(){i.forEach(function(a){return a()})})}function EL(n){var e=n.doc,t=n.mirror,r=n.blockClass,i=n.blockSelector,A=n.selectionCb,s=!0,o=he(function(){var a=e.getSelection();if(!(!a||s&&(a!=null&&a.isCollapsed))){s=a.isCollapsed||!1;for(var c=[],u=a.rangeCount||0,l=0;l<u;l++){var d=a.getRangeAt(l),h=d.startContainer,f=d.startOffset,p=d.endContainer,g=d.endOffset,v=Ft(h,r,i,!0)||Ft(p,r,i,!0);v||c.push({start:t.getId(h),startOffset:f,end:t.getId(p),endOffset:g})}A({ranges:c})}});return o(),It("selectionchange",o)}function UL(n){var e=n.doc,t=n.customElementCb,r=e.defaultView;if(!r||!r.customElements)return function(){};var i=Yi(r.customElements,"define",function(A){return function(s,o,a){try{t({define:{name:s}})}catch{console.warn("Custom element callback failed for "+s)}return A.apply(this,[s,o,a])}});return i}function TL(n,e){var t=n.mutationCb,r=n.mousemoveCb,i=n.mouseInteractionCb,A=n.scrollCb,s=n.viewportResizeCb,o=n.inputCb,a=n.mediaInteractionCb,c=n.styleSheetRuleCb,u=n.styleDeclarationCb,l=n.canvasMutationCb,d=n.fontCb,h=n.selectionCb,f=n.customElementCb;n.mutationCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.mutation){var y;(y=e).mutation.apply(y,[].concat(g))}t.apply(void 0,[].concat(g))},n.mousemoveCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.mousemove){var y;(y=e).mousemove.apply(y,[].concat(g))}r.apply(void 0,[].concat(g))},n.mouseInteractionCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.mouseInteraction){var y;(y=e).mouseInteraction.apply(y,[].concat(g))}i.apply(void 0,[].concat(g))},n.scrollCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.scroll){var y;(y=e).scroll.apply(y,[].concat(g))}A.apply(void 0,[].concat(g))},n.viewportResizeCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.viewportResize){var y;(y=e).viewportResize.apply(y,[].concat(g))}s.apply(void 0,[].concat(g))},n.inputCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.input){var y;(y=e).input.apply(y,[].concat(g))}o.apply(void 0,[].concat(g))},n.mediaInteractionCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.mediaInteaction){var y;(y=e).mediaInteaction.apply(y,[].concat(g))}a.apply(void 0,[].concat(g))},n.styleSheetRuleCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.styleSheetRule){var y;(y=e).styleSheetRule.apply(y,[].concat(g))}c.apply(void 0,[].concat(g))},n.styleDeclarationCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.styleDeclaration){var y;(y=e).styleDeclaration.apply(y,[].concat(g))}u.apply(void 0,[].concat(g))},n.canvasMutationCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.canvasMutation){var y;(y=e).canvasMutation.apply(y,[].concat(g))}l.apply(void 0,[].concat(g))},n.fontCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.font){var y;(y=e).font.apply(y,[].concat(g))}d.apply(void 0,[].concat(g))},n.selectionCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.selection){var y;(y=e).selection.apply(y,[].concat(g))}h.apply(void 0,[].concat(g))},n.customElementCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.customElement){var y;(y=e).customElement.apply(y,[].concat(g))}f.apply(void 0,[].concat(g))}}function IL(n,e){e===void 0&&(e={});var t=n.doc.defaultView;if(!t)return function(){};TL(n,e);var r;n.recordDOM&&(r=mB(n,n.doc));var i=vL(n),A=yL(n),s=vB(n),o=wL(n,{win:t}),a=BL(n),c=SL(n),u=function(){},l=function(){},d=function(){},h=function(){};n.recordDOM&&(u=CL(n,{win:t}),l=wB(n,n.doc),d=_L(n,{win:t}),n.collectFonts&&(h=kL(n)));for(var f=EL(n),p=UL(n),g=[],v=W(n.plugins),y;!(y=v()).done;){var B=y.value;g.push(B.observer(B.callback,t,B.options))}return he(function(){ti.forEach(function(b){return b.reset()}),r==null||r.disconnect(),i(),A(),s(),o(),a(),c(),u(),l(),d(),h(),f(),p(),g.forEach(function(b){return b()})})}function wc(n){return typeof window[n]<"u"}function bc(n){return!!(typeof window[n]<"u"&&window[n].prototype&&"insertRule"in window[n].prototype&&"deleteRule"in window[n].prototype)}for(var bB=function(){function n(t){N(this,"iframeIdToRemoteIdMap",new WeakMap),N(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}var e=n.prototype;return e.getId=function(t,r,i,A){var s=i||this.getIdToRemoteIdMap(t),o=A||this.getRemoteIdToIdMap(t),a=s.get(r);return a||(a=this.generateIdFn(),s.set(r,a),o.set(a,r)),a},e.getIds=function(t,r){var i=this,A=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return r.map(function(o){return i.getId(t,o,A,s)})},e.getRemoteId=function(t,r,i){var A=i||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;var s=A.get(r);return s||-1},e.getRemoteIds=function(t,r){var i=this,A=this.getRemoteIdToIdMap(t);return r.map(function(s){return i.getRemoteId(t,s,A)})},e.reset=function(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)},e.getIdToRemoteIdMap=function(t){var r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r},e.getRemoteIdToIdMap=function(t){var r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r},n}(),FL=function(){function n(t){N(this,"iframes",new WeakMap),N(this,"crossOriginIframeMap",new WeakMap),N(this,"crossOriginIframeMirror",new bB(Yy)),N(this,"crossOriginIframeStyleMirror"),N(this,"crossOriginIframeRootIdMap",new WeakMap),N(this,"mirror"),N(this,"mutationCb"),N(this,"wrappedEmit"),N(this,"loadListener"),N(this,"stylesheetManager"),N(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new bB(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}var e=n.prototype;return e.addIframe=function(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)},e.addLoadListener=function(t){this.loadListener=t},e.attachIframe=function(t,r){var i,A;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((i=t.contentWindow)==null||i.addEventListener("message",this.handleMessage.bind(this))),(A=this.loadListener)==null||A.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))},e.handleMessage=function(t){var r=t;if(!(r.data.type!=="rrweb"||r.origin!==r.data.origin)){var i=t.source;if(i){var A=this.crossOriginIframeMap.get(t.source);if(A){var s=this.transformCrossOriginEvent(A,r.data.event);s&&this.wrappedEmit(s,r.data.isCheckout)}}}},e.transformCrossOriginEvent=function(t,r){var i=this,A;switch(r.type){case le.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);var s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:le.IncrementalSnapshot,data:{source:z.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case le.Meta:case le.Load:case le.DomContentLoaded:return!1;case le.Plugin:return r;case le.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case le.IncrementalSnapshot:switch(r.data.source){case z.Mutation:return r.data.adds.forEach(function(o){i.replaceIds(o,t,["parentId","nextId","previousId"]),i.replaceIdOnNode(o.node,t);var a=i.crossOriginIframeRootIdMap.get(t);a&&i.patchRootIdOnNode(o.node,a)}),r.data.removes.forEach(function(o){i.replaceIds(o,t,["parentId","id"])}),r.data.attributes.forEach(function(o){i.replaceIds(o,t,["id"])}),r.data.texts.forEach(function(o){i.replaceIds(o,t,["id"])}),r;case z.Drag:case z.TouchMove:case z.MouseMove:return r.data.positions.forEach(function(o){i.replaceIds(o,t,["id"])}),r;case z.ViewportResize:return!1;case z.MediaInteraction:case z.MouseInteraction:case z.Scroll:case z.CanvasMutation:case z.Input:return this.replaceIds(r.data,t,["id"]),r;case z.StyleSheetRule:case z.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case z.Font:return r;case z.Selection:return r.data.ranges.forEach(function(o){i.replaceIds(o,t,["start","end"])}),r;case z.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(A=r.data.styles)==null||A.forEach(function(o){i.replaceStyleIds(o,t,["styleId"])}),r}}return!1},e.replace=function(t,r,i,A){for(var s=W(A),o;!(o=s()).done;){var a=o.value;!Array.isArray(r[a])&&typeof r[a]!="number"||(Array.isArray(r[a])?r[a]=t.getIds(i,r[a]):r[a]=t.getId(i,r[a]))}return r},e.replaceIds=function(t,r,i){return this.replace(this.crossOriginIframeMirror,t,r,i)},e.replaceStyleIds=function(t,r,i){return this.replace(this.crossOriginIframeStyleMirror,t,r,i)},e.replaceIdOnNode=function(t,r){var i=this;this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(function(A){i.replaceIdOnNode(A,r)})},e.patchRootIdOnNode=function(t,r){var i=this;t.type!==lB.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(function(A){i.patchRootIdOnNode(A,r)})},n}(),xL=function(){function n(t){N(this,"shadowDoms",new WeakSet),N(this,"mutationCb"),N(this,"scrollCb"),N(this,"bypassOptions"),N(this,"mirror"),N(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}var e=n.prototype;return e.init=function(){this.reset(),this.patchAttachShadow(Element,document)},e.addShadowRoot=function(t,r){var i=this;if(ts(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var A=mB(me({},this.bypassOptions,{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(function(){return A.disconnect()}),this.restoreHandlers.push(vB(me({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(function(){t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&i.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,i.mirror.getId(oe.host(t))),i.restoreHandlers.push(wB({mirror:i.mirror,stylesheetManager:i.bypassOptions.stylesheetManager},t))},0)}},e.observeAttachShadow=function(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)},e.patchAttachShadow=function(t,r){var i=this;this.restoreHandlers.push(Yi(t.prototype,"attachShadow",function(A){return function(s){var o=A.call(this,s),a=oe.shadowRoot(this);return a&&uB(this)&&i.addShadowRoot(a,r),o}}))},e.reset=function(){this.restoreHandlers.forEach(function(t){try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet},n}(),eA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",QL=typeof Uint8Array>"u"?[]:new Uint8Array(256),Bc=0;Bc<eA.length;Bc++)QL[eA.charCodeAt(Bc)]=Bc;var RL=function(n){var e=new Uint8Array(n),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=eA[e[t]>>2],i+=eA[(e[t]&3)<<4|e[t+1]>>4],i+=eA[(e[t+1]&15)<<2|e[t+2]>>6],i+=eA[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},BB=new Map;function PL(n,e){var t=BB.get(n);return t||(t=new Map,BB.set(n,t)),t.has(e)||t.set(e,[]),t.get(e)}var CB=function(n,e,t){if(!(!n||!(SB(n,e)||(typeof n>"u"?"undefined":se(n))==="object"))){var r=n.constructor.name,i=PL(t,r),A=i.indexOf(n);return A===-1&&(A=i.length,i.push(n)),A}};function Cc(n,e,t){if(te(n,Array))return n.map(function(f){return Cc(f,e,t)});if(n===null)return n;if(te(n,Float32Array)||te(n,Float64Array)||te(n,Int32Array)||te(n,Uint32Array)||te(n,Uint8Array)||te(n,Uint16Array)||te(n,Int16Array)||te(n,Int8Array)||te(n,Uint8ClampedArray)){var r=n.constructor.name;return{rr_type:r,args:[Object.values(n)]}}else if(te(n,ArrayBuffer)){var i=n.constructor.name,A=RL(n);return{rr_type:i,base64:A}}else if(te(n,DataView)){var s=n.constructor.name;return{rr_type:s,args:[Cc(n.buffer,e,t),n.byteOffset,n.byteLength]}}else if(te(n,HTMLImageElement)){var o=n.constructor.name,a=n.src;return{rr_type:o,src:a}}else if(te(n,HTMLCanvasElement)){var c="HTMLImageElement",u=n.toDataURL();return{rr_type:c,src:u}}else if(te(n,ImageData)){var l=n.constructor.name;return{rr_type:l,args:[Cc(n.data,e,t),n.width,n.height]}}else if(SB(n,e)||(typeof n>"u"?"undefined":se(n))==="object"){var d=n.constructor.name,h=CB(n,e,t);return{rr_type:d,index:h}}return n}var _B=function(n,e,t){return n.map(function(r){return Cc(r,e,t)})},SB=function(n,e){var t=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"],r=t.filter(function(i){return typeof e[i]=="function"});return!!r.find(function(i){return te(n,e[i])})};function OL(n,e,t,r){for(var i=function(){var c=a.value;try{if(typeof e.CanvasRenderingContext2D.prototype[c]!="function")return"continue";var u=Yi(e.CanvasRenderingContext2D.prototype,c,function(d){return function(){for(var h=this,f=arguments.length,p=new Array(f),g=0;g<f;g++)p[g]=arguments[g];return Ft(this.canvas,t,r,!0)||setTimeout(function(){var v=_B(p,e,h);n(h.canvas,{type:Zi["2D"],property:c,args:v})},0),d.apply(this,p)}});A.push(u)}catch{var l=mc(e.CanvasRenderingContext2D.prototype,c,{set:function(d){n(this.canvas,{type:Zi["2D"],property:c,args:[d],setter:!0})}});A.push(l)}},A=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=W(s),a;!(a=o()).done;)i();return function(){A.forEach(function(c){return c()})}}function ML(n){return n==="experimental-webgl"?"webgl":n}function kB(n,e,t,r){var i=[];try{var A=Yi(n.HTMLCanvasElement.prototype,"getContext",function(s){return function(o){for(var a=arguments.length,c=new Array(a>1?a-1:0),u=1;u<a;u++)c[u-1]=arguments[u];if(!Ft(this,e,t,!0)){var l=ML(o);if("__context"in this||(this.__context=l),r&&["webgl","webgl2"].includes(l))if(c[0]&&se(c[0])==="object"){var d=c[0];d.preserveDrawingBuffer||(d.preserveDrawingBuffer=!0)}else c.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[].concat([o],c))}});i.push(A)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){i.forEach(function(s){return s()})}}function EB(n,e,t,r,i,A){for(var s=function(){var l=u.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return"continue";try{if(typeof n[l]!="function")return"continue";var d=Yi(n,l,function(f){return function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];var y=f.apply(this,g);if(CB(y,A,this),"tagName"in this.canvas&&!Ft(this.canvas,r,i,!0)){var B=_B(g,A,this),b={type:e,property:l,args:B};t(this.canvas,b)}return y}});o.push(d)}catch{var h=mc(n,l,{set:function(f){t(this.canvas,{type:e,property:l,args:[f],setter:!0})}});o.push(h)}},o=[],a=Object.getOwnPropertyNames(n),c=W(a),u;!(u=c()).done;)s();return o}function LL(n,e,t,r){var i,A=[];if((i=A).push.apply(i,[].concat(EB(e.WebGLRenderingContext.prototype,Zi.WebGL,n,t,r,e))),typeof e.WebGL2RenderingContext<"u"){var s;(s=A).push.apply(s,[].concat(EB(e.WebGL2RenderingContext.prototype,Zi.WebGL2,n,t,r,e)))}return function(){A.forEach(function(o){return o()})}}var UB="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",DL=function(n){return Uint8Array.from(atob(n),function(e){return e.charCodeAt(0)})},TB=typeof window<"u"&&window.Blob&&new Blob([DL(UB)],{type:"text/javascript;charset=utf-8"});function NL(n){var e;try{if(e=TB&&(window.URL||window.webkitURL).createObjectURL(TB),!e)throw"";var t=new Worker(e,{name:n==null?void 0:n.name});return t.addEventListener("error",function(){(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+UB,{name:n==null?void 0:n.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var HL=function(){function n(t){var r=this;N(this,"pendingCanvasMutations",new Map),N(this,"rafStamps",{latestId:0,invokeId:null}),N(this,"mirror"),N(this,"mutationCb"),N(this,"resetObservers"),N(this,"frozen",!1),N(this,"locked",!1),N(this,"processMutation",function(l,d){var h=r.rafStamps.invokeId&&r.rafStamps.latestId!==r.rafStamps.invokeId;(h||!r.rafStamps.invokeId)&&(r.rafStamps.invokeId=r.rafStamps.latestId),r.pendingCanvasMutations.has(l)||r.pendingCanvasMutations.set(l,[]),r.pendingCanvasMutations.get(l).push(d)});var i=t.sampling,A=i===void 0?"all":i,s=t.win,o=t.blockClass,a=t.blockSelector,c=t.recordCanvas,u=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,c&&A==="all"&&this.initCanvasMutationObserver(s,o,a),c&&typeof A=="number"&&this.initCanvasFPSObserver(A,s,o,a,{dataURLOptions:u})}var e=n.prototype;return e.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.freeze=function(){this.frozen=!0},e.unfreeze=function(){this.frozen=!1},e.lock=function(){this.locked=!0},e.unlock=function(){this.locked=!1},e.initCanvasFPSObserver=function(t,r,i,A,s){var o=this,a=kB(r,i,A,!0),c=new Map,u=new NL;u.onmessage=function(g){var v=g.data.id;if(c.set(v,!1),"base64"in g.data){var y=g.data,B=y.base64,b=y.type,w=y.width,_=y.height;o.mutationCb({id:v,type:Zi["2D"],commands:[{property:"clearRect",args:[0,0,w,_]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:B}],type:b}]},0,0]}]})}};var l=1e3/t,d=0,h,f=function(){var g=[];return r.document.querySelectorAll("canvas").forEach(function(v){Ft(v,i,A,!0)||g.push(v)}),g},p=function(g){if(d&&g-d<l){h=requestAnimationFrame(p);return}d=g;var v=o;f().forEach(kd(function(y){var B,b,w,_;return $A(this,function(k){switch(k.label){case 0:return b=v.mirror.getId(y),c.get(b)?[2]:y.width===0||y.height===0?[2]:(c.set(b,!0),["webgl","webgl2"].includes(y.__context)&&(w=y.getContext(y.__context),((B=w==null?void 0:w.getContextAttributes())==null?void 0:B.preserveDrawingBuffer)===!1&&w.clear(w.COLOR_BUFFER_BIT)),[4,createImageBitmap(y)]);case 1:return _=k.sent(),u.postMessage({id:b,bitmap:_,width:y.width,height:y.height,dataURLOptions:s.dataURLOptions},[_]),[2]}})})),h=requestAnimationFrame(p)};h=requestAnimationFrame(p),this.resetObservers=function(){a(),cancelAnimationFrame(h)}},e.initCanvasMutationObserver=function(t,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var A=kB(t,r,i,!1),s=OL(this.processMutation.bind(this),t,r,i),o=LL(this.processMutation.bind(this),t,r,i);this.resetObservers=function(){A(),s(),o()}},e.startPendingCanvasMutationFlusher=function(){var t=this;requestAnimationFrame(function(){return t.flushPendingCanvasMutations()})},e.startRAFTimestamping=function(){var t=this,r=function(i){t.rafStamps.latestId=i,requestAnimationFrame(r)};requestAnimationFrame(r)},e.flushPendingCanvasMutations=function(){var t=this;this.pendingCanvasMutations.forEach(function(r,i){var A=t.mirror.getId(i);t.flushPendingCanvasMutationFor(i,A)}),requestAnimationFrame(function(){return t.flushPendingCanvasMutations()})},e.flushPendingCanvasMutationFor=function(t,r){if(!(this.frozen||this.locked)){var i=this.pendingCanvasMutations.get(t);if(!(!i||r===-1)){var A=i.map(function(o){o.type;var a=YA(o,["type"]);return a}),s=i[0].type;this.mutationCb({id:r,type:s,commands:A}),this.pendingCanvasMutations.delete(t)}}},n}(),KL=function(){function n(t){N(this,"trackedLinkElements",new WeakSet),N(this,"mutationCb"),N(this,"adoptedStyleSheetCb"),N(this,"styleMirror",new cL),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}var e=n.prototype;return e.attachLinkElement=function(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)},e.trackLinkElement=function(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))},e.adoptStyleSheets=function(t,r){var i,A=function(){var u=c.value,l=void 0;i.styleMirror.has(u)?l=i.styleMirror.getId(u):(l=i.styleMirror.add(u),o.push({styleId:l,rules:Array.from(u.rules||CSSRule,function(d,h){return{rule:qy(d,u.href),index:h}})})),s.styleIds.push(l)};if(t.length!==0){for(var s={id:r,styleIds:[]},o=[],a=W(t),c;!(c=a()).done;)i=this,A();o.length>0&&(s.styles=o),this.adoptedStyleSheetCb(s)}},e.reset=function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet},e.trackStylesheetInLinkElement=function(t){},n}(),VL=function(){function n(){N(this,"nodeMap",new WeakMap),N(this,"active",!1)}var e=n.prototype;return e.inOtherBuffer=function(t,r){var i=this.nodeMap.get(t);return i&&Array.from(i).some(function(A){return A!==r})},e.add=function(t,r){var i=this;this.active||(this.active=!0,requestAnimationFrame(function(){i.nodeMap=new WeakMap,i.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))},e.destroy=function(){},n}(),$e,_c,qh,Sc=!1;try{if(Array.from([1],function(n){return n*2})[0]!==2){var Jh=document.createElement("iframe");document.body.appendChild(Jh),Array.from=((Hy=Jh.contentWindow)==null?void 0:Hy.Array.from)||Array.from,document.body.removeChild(Jh)}}catch{}var fn=HR();function Sr(n){n===void 0&&(n={});var e=n.emit,t=n.checkoutEveryNms,r=n.checkoutEveryNth,i=n.blockClass,A=i===void 0?"rr-block":i,s=n.blockSelector,o=s===void 0?null:s,a=n.ignoreClass,c=a===void 0?"rr-ignore":a,u=n.ignoreSelector,l=u===void 0?null:u,d=n.maskTextClass,h=d===void 0?"rr-mask":d,f=n.maskTextSelector,p=f===void 0?null:f,g=n.inlineStylesheet,v=g===void 0?!0:g,y=n.maskAllInputs,B=n.maskInputOptions,b=n.slimDOMOptions,w=n.maskInputFn,_=n.maskTextFn,k=n.hooks,F=n.packFn,x=n.sampling,U=x===void 0?{}:x,T=n.dataURLOptions,Q=T===void 0?{}:T,M=n.mousemoveWait,X=n.recordDOM,H=X===void 0?!0:X,q=n.recordCanvas,ve=q===void 0?!1:q,Y=n.recordCrossOriginIframes,ie=Y===void 0?!1:Y,Qe=n.recordAfter,qe=Qe===void 0?n.recordAfter==="DOMContentLoaded"?n.recordAfter:"load":Qe,Be=n.userTriggeredOnInput,ht=Be===void 0?!1:Be,Re=n.collectFonts,Ne=Re===void 0?!1:Re,ne=n.inlineImages,et=ne===void 0?!1:ne,Z=n.plugins,We=n.keepIframeSrcFn,Us=We===void 0?function(){return!1}:We,Ts=n.ignoreCSSAttributes,Pp=Ts===void 0?new Set([]):Ts,Kc=n.errorHandler;gL(Kc);var Qr=ie?window.parent===window:!0,oi=!1;if(!Qr)try{window.parent.document&&(oi=!1)}catch{oi=!0}if(Qr&&!e)throw new Error("emit function is required");if(!Qr&&!oi)return function(){};M!==void 0&&U.mousemove===void 0&&(U.mousemove=M),fn.reset();var dA=y===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:B!==void 0?B:{password:!0},Is=b===!0||b==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:b==="all",headMetaDescKeywords:b==="all",headTitleMutations:b==="all"}:b||{};aL();var hA,ai=0,Yn=function(Ie){for(var tn=W(Z||[]),J;!(J=tn()).done;){var Je=J.value;Je.eventProcessor&&(Ie=Je.eventProcessor(Ie))}return F&&!oi&&(Ie=F(Ie)),Ie};$e=function(Ie,tn){var J,Je=Ie;if(Je.timestamp=vc(),(J=ti[0])!=null&&J.isFrozen()&&Je.type!==le.FullSnapshot&&!(Je.type===le.IncrementalSnapshot&&Je.data.source===z.Mutation)&&ti.forEach(function(T4){return T4.unfreeze()}),Qr)e==null||e(Yn(Je),tn);else if(oi){var k4={type:"rrweb",event:Yn(Je),origin:window.location.origin,isCheckout:tn};window.parent.postMessage(k4,"*")}if(Je.type===le.FullSnapshot)hA=Je,ai=0;else if(Je.type===le.IncrementalSnapshot){if(Je.data.source===z.Mutation&&Je.data.isAttachIframe)return;ai++;var E4=r&&ai>=r,U4=t&&Je.timestamp-hA.timestamp>t;(E4||U4)&&_c(!0)}};for(var ci=function(Ie){$e({type:le.IncrementalSnapshot,data:me({source:z.Mutation},Ie)})},ZC=function(Ie){return $e({type:le.IncrementalSnapshot,data:me({source:z.Scroll},Ie)})},$C=function(Ie){return $e({type:le.IncrementalSnapshot,data:me({source:z.CanvasMutation},Ie)})},_4=function(Ie){return $e({type:le.IncrementalSnapshot,data:me({source:z.AdoptedStyleSheet},Ie)})},ui=new KL({mutationCb:ci,adoptedStyleSheetCb:_4}),li=new FL({mirror:fn,mutationCb:ci,stylesheetManager:ui,recordCrossOriginIframes:ie,wrappedEmit:$e}),S4=W(Z||[]),e_;!(e_=S4()).done;){var t_=e_.value;t_.getMirror&&t_.getMirror({nodeMirror:fn,crossOriginIframeMirror:li.crossOriginIframeMirror,crossOriginIframeStyleMirror:li.crossOriginIframeStyleMirror})}var Op=new VL;qh=new HL({recordCanvas:ve,mutationCb:$C,win:window,blockClass:A,blockSelector:o,mirror:fn,sampling:U.canvas,dataURLOptions:Q});var Vc=new xL({mutationCb:ci,scrollCb:ZC,bypassOptions:{blockClass:A,blockSelector:o,maskTextClass:h,maskTextSelector:p,inlineStylesheet:v,maskInputOptions:dA,dataURLOptions:Q,maskTextFn:_,maskInputFn:w,recordCanvas:ve,inlineImages:et,sampling:U,slimDOMOptions:Is,iframeManager:li,stylesheetManager:ui,canvasManager:qh,keepIframeSrcFn:Us,processedNodeManager:Op},mirror:fn});_c=function(Ie){if(Ie===void 0&&(Ie=!1),!!H){$e({type:le.Meta,data:{href:window.location.href,width:iB(),height:rB()}},Ie),ui.reset(),Vc.init(),ti.forEach(function(J){return J.lock()});var tn=lP(document,{mirror:fn,blockClass:A,blockSelector:o,maskTextClass:h,maskTextSelector:p,inlineStylesheet:v,maskAllInputs:dA,maskTextFn:_,maskInputFn:w,slimDOM:Is,dataURLOptions:Q,recordCanvas:ve,inlineImages:et,onSerialize:function(J){oB(J,fn)&&li.addIframe(J),aB(J,fn)&&ui.trackLinkElement(J),jh(J)&&Vc.addShadowRoot(oe.shadowRoot(J),document)},onIframeLoad:function(J,Je){li.attachIframe(J,Je),Vc.observeAttachShadow(J)},onStylesheetLoad:function(J,Je){ui.attachLinkElement(J,Je)},keepIframeSrcFn:Us});if(!tn)return console.warn("Failed to snapshot the document");$e({type:le.FullSnapshot,data:{node:tn,initialOffset:nB(window)}},Ie),ti.forEach(function(J){return J.unlock()}),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ui.adoptStyleSheets(document.adoptedStyleSheets,fn.getId(document))}};try{var Fs=[],n_=function(Ie){var tn;return he(IL)({mutationCb:ci,mousemoveCb:function(J,Je){return $e({type:le.IncrementalSnapshot,data:{source:Je,positions:J}})},mouseInteractionCb:function(J){return $e({type:le.IncrementalSnapshot,data:me({source:z.MouseInteraction},J)})},scrollCb:ZC,viewportResizeCb:function(J){return $e({type:le.IncrementalSnapshot,data:me({source:z.ViewportResize},J)})},inputCb:function(J){return $e({type:le.IncrementalSnapshot,data:me({source:z.Input},J)})},mediaInteractionCb:function(J){return $e({type:le.IncrementalSnapshot,data:me({source:z.MediaInteraction},J)})},styleSheetRuleCb:function(J){return $e({type:le.IncrementalSnapshot,data:me({source:z.StyleSheetRule},J)})},styleDeclarationCb:function(J){return $e({type:le.IncrementalSnapshot,data:me({source:z.StyleDeclaration},J)})},canvasMutationCb:$C,fontCb:function(J){return $e({type:le.IncrementalSnapshot,data:me({source:z.Font},J)})},selectionCb:function(J){$e({type:le.IncrementalSnapshot,data:me({source:z.Selection},J)})},customElementCb:function(J){$e({type:le.IncrementalSnapshot,data:me({source:z.CustomElement},J)})},blockClass:A,ignoreClass:c,ignoreSelector:l,maskTextClass:h,maskTextSelector:p,maskInputOptions:dA,inlineStylesheet:v,sampling:U,recordDOM:H,recordCanvas:ve,inlineImages:et,userTriggeredOnInput:ht,collectFonts:Ne,doc:Ie,maskInputFn:w,maskTextFn:_,keepIframeSrcFn:Us,blockSelector:o,slimDOMOptions:Is,dataURLOptions:Q,mirror:fn,iframeManager:li,stylesheetManager:ui,shadowDomManager:Vc,processedNodeManager:Op,canvasManager:qh,ignoreCSSAttributes:Pp,plugins:((tn=Z==null?void 0:Z.filter(function(J){return J.observer}))==null?void 0:tn.map(function(J){return{observer:J.observer,options:J.options,callback:function(Je){return $e({type:le.Plugin,data:{plugin:J.name,payload:Je}})}}}))||[]},k)};li.addLoadListener(function(Ie){try{Fs.push(n_(Ie.contentDocument))}catch(tn){console.warn(tn)}});var Mp=function(){_c(),Fs.push(n_(document)),Sc=!0};return document.readyState==="interactive"||document.readyState==="complete"?Mp():(Fs.push(It("DOMContentLoaded",function(){$e({type:le.DomContentLoaded,data:{}}),qe==="DOMContentLoaded"&&Mp()})),Fs.push(It("load",function(){$e({type:le.Load,data:{}}),qe==="load"&&Mp()},window))),function(){Fs.forEach(function(Ie){return Ie()}),Op.destroy(),Sc=!1,mL()}}catch(Ie){console.warn(Ie)}}Sr.addCustomEvent=function(n,e){if(!Sc)throw new Error("please add custom event after start recording");$e({type:le.Custom,data:{tag:n,payload:e}})},Sr.freezePage=function(){ti.forEach(function(n){return n.freeze()})},Sr.takeFullSnapshot=function(n){if(!Sc)throw new Error("please take full snapshot after start recording");_c(n)},Sr.mirror=fn;var IB;(function(n){n[n.NotStarted=0]="NotStarted",n[n.Running=1]="Running",n[n.Stopped=2]="Stopped"})(IB||(IB={})),Sr.addCustomEvent,Sr.freezePage,Sr.takeFullSnapshot;var FB=V.setImmediate,kr,zh,Xh,xB=Object.prototype.toString,GL=typeof FB<"u"?function(n){return FB(n)}:setTimeout;try{Object.defineProperty({},"x",{}),kr=function(n,e,t,r){return Object.defineProperty(n,e,{value:t,writable:!0,configurable:r!==!1})}}catch{kr=function(n,e,t){return n[e]=t,n}}Xh=function(){var n,e,t;function r(i,A){this.fn=i,this.self=A,this.next=void 0}return{add:function(i,A){t=new r(i,A),e?e.next=t:n=t,e=t,t=void 0},drain:function(){var i=n;for(n=e=zh=void 0;i;)i.fn.call(i.self),i=i.next}}}();function kc(n,e){Xh.add(n,e),zh||(zh=GL(Xh.drain))}function QB(n){var e,t=typeof n;return n!==null&&(t==="object"||t==="function")&&(e=n.then),typeof e=="function"?e:!1}function Yh(){for(var n=0;n<this.chain.length;n++)jL(this,this.state===1?this.chain[n].success:this.chain[n].failure,this.chain[n]);this.chain.length=0}function jL(n,e,t){var r,i;try{e===!1?t.reject(n.msg):(e===!0?r=n.msg:r=e.call(void 0,n.msg),r===t.promise?t.reject(TypeError("Promise-chain cycle")):(i=QB(r))?i.call(r,t.resolve,t.reject):t.resolve(r))}catch(A){t.reject(A)}}function RB(n){var e,t=this;if(!t.triggered){t.triggered=!0,t.def&&(t=t.def);try{(e=QB(n))?kc(function(){var r=new OB(t);try{e.call(n,function(){RB.apply(r,arguments)},function(){ws.apply(r,arguments)})}catch(i){ws.call(r,i)}}):(t.msg=n,t.state=1,t.chain.length>0&&kc(Yh,t))}catch(r){ws.call(new OB(t),r)}}}function ws(n){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=n,e.state=2,e.chain.length>0&&kc(Yh,e))}function PB(n,e,t,r){for(var i=0;i<e.length;i++)(function(A){n.resolve(e[A]).then(function(s){t(A,s)},r)})(i)}function OB(n){this.def=n,this.triggered=!1}function WL(n){this.promise=n,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function Er(n){if(typeof n!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var e=new WL(this);this.then=function(t,r){var i={success:typeof t=="function"?t:!0,failure:typeof r=="function"?r:!1};return i.promise=new this.constructor(function(A,s){if(typeof A!="function"||typeof s!="function")throw TypeError("Not a function");i.resolve=A,i.reject=s}),e.chain.push(i),e.state!==0&&kc(Yh,e),i.promise},this.catch=function(t){return this.then(void 0,t)};try{n.call(void 0,function(t){RB.call(e,t)},function(t){ws.call(e,t)})}catch(t){ws.call(e,t)}}var MB=kr({},"constructor",Er,!1);Er.prototype=MB,kr(MB,"__NPO__",0,!1),kr(Er,"resolve",function(n){var e=this;return n&&typeof n=="object"&&n.__NPO__===1?n:new e(function(t,r){if(typeof t!="function"||typeof r!="function")throw TypeError("Not a function");t(n)})}),kr(Er,"reject",function(n){return new this(function(e,t){if(typeof e!="function"||typeof t!="function")throw TypeError("Not a function");t(n)})}),kr(Er,"all",function(n){var e=this;return xB.call(n)!=="[object Array]"?e.reject(TypeError("Not an array")):n.length===0?e.resolve([]):new e(function(t,r){if(typeof t!="function"||typeof r!="function")throw TypeError("Not a function");var i=n.length,A=Array(i),s=0;PB(e,n,function(o,a){A[o]=a,++s===i&&t(A)},r)})}),kr(Er,"race",function(n){var e=this;return xB.call(n)!=="[object Array]"?e.reject(TypeError("Not an array")):new e(function(t,r){if(typeof t!="function"||typeof r!="function")throw TypeError("Not a function");PB(e,n,function(i,A){t(A)},r)})});var be;typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1?be=Promise:be=Er;var gn={DEBUG:!1,LIB_VERSION:"2.68.0"},bs=24*60*60*1e3,Zh=8*1e3,Ec=Array.prototype,qL=Function.prototype,LB=Object.prototype,ni=Ec.slice,Bs=LB.toString,Uc=LB.hasOwnProperty,ct=V.console,Ur=V.navigator,ye=V.document,Tc=V.opera,DB=V.screen,qn=Ur.userAgent,$h=qL.bind,NB=Ec.forEach,HB=Ec.indexOf,KB=Ec.map,JL=Array.isArray,ep={},m={trim:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},we={log:function(){if(gn.DEBUG&&!m.isUndefined(ct)&&ct)try{ct.log.apply(ct,arguments)}catch{m.each(arguments,function(n){ct.log(n)})}},warn:function(){if(gn.DEBUG&&!m.isUndefined(ct)&&ct){var n=["Mixpanel warning:"].concat(m.toArray(arguments));try{ct.warn.apply(ct,n)}catch{m.each(n,function(e){ct.warn(e)})}}},error:function(){if(gn.DEBUG&&!m.isUndefined(ct)&&ct){var n=["Mixpanel error:"].concat(m.toArray(arguments));try{ct.error.apply(ct,n)}catch{m.each(n,function(e){ct.error(e)})}}},critical:function(){if(!m.isUndefined(ct)&&ct){var n=["Mixpanel error:"].concat(m.toArray(arguments));try{ct.error.apply(ct,n)}catch{m.each(n,function(e){ct.error(e)})}}}},tp=function(n,e){return function(){return arguments[0]="["+e+"] "+arguments[0],n.apply(we,arguments)}},ri=function(n){return{log:tp(we.log,n),error:tp(we.error,n),critical:tp(we.critical,n)}},np=function(n){return function(){try{return n.apply(this,arguments)}catch(e){we.critical("Implementation error. Please turn on debug and contact support@mixpanel.com."),gn.DEBUG&&we.critical(e)}}},VB=function(n){var e=n.prototype;for(var t in e)typeof e[t]=="function"&&(e[t]=np(e[t]))};m.bind=function(n,e){var t,r;if($h&&n.bind===$h)return $h.apply(n,ni.call(arguments,1));if(!m.isFunction(n))throw new TypeError;return t=ni.call(arguments,2),r=function(){if(!(this instanceof r))return n.apply(e,t.concat(ni.call(arguments)));var i={};i.prototype=n.prototype;var A=new i;i.prototype=null;var s=n.apply(A,t.concat(ni.call(arguments)));return Object(s)===s?s:A},r},m.each=function(n,e,t){if(n!=null){if(NB&&n.forEach===NB)n.forEach(e,t);else if(n.length===+n.length){for(var r=0,i=n.length;r<i;r++)if(r in n&&e.call(t,n[r],r,n)===ep)return}else for(var A in n)if(Uc.call(n,A)&&e.call(t,n[A],A,n)===ep)return}},m.extend=function(n){return m.each(ni.call(arguments,1),function(e){for(var t in e)e[t]!==void 0&&(n[t]=e[t])}),n},m.isArray=JL||function(n){return Bs.call(n)==="[object Array]"},m.isFunction=function(n){try{return/^\s*\bfunction\b/.test(n)}catch{return!1}},m.isArguments=function(n){return!!(n&&Uc.call(n,"callee"))},m.toArray=function(n){return n?n.toArray?n.toArray():m.isArray(n)||m.isArguments(n)?ni.call(n):m.values(n):[]},m.map=function(n,e,t){if(KB&&n.map===KB)return n.map(e,t);var r=[];return m.each(n,function(i){r.push(e.call(t,i))}),r},m.keys=function(n){var e=[];return n===null||m.each(n,function(t,r){e[e.length]=r}),e},m.values=function(n){var e=[];return n===null||m.each(n,function(t){e[e.length]=t}),e},m.include=function(n,e){var t=!1;return n===null?t:HB&&n.indexOf===HB?n.indexOf(e)!=-1:(m.each(n,function(r){if(t||(t=r===e))return ep}),t)},m.includes=function(n,e){return n.indexOf(e)!==-1},m.inherit=function(n,e){return n.prototype=new e,n.prototype.constructor=n,n.superclass=e.prototype,n},m.isObject=function(n){return n===Object(n)&&!m.isArray(n)},m.isEmptyObject=function(n){if(m.isObject(n)){for(var e in n)if(Uc.call(n,e))return!1;return!0}return!1},m.isUndefined=function(n){return n===void 0},m.isString=function(n){return Bs.call(n)=="[object String]"},m.isDate=function(n){return Bs.call(n)=="[object Date]"},m.isNumber=function(n){return Bs.call(n)=="[object Number]"},m.isElement=function(n){return!!(n&&n.nodeType===1)},m.encodeDates=function(n){return m.each(n,function(e,t){m.isDate(e)?n[t]=m.formatDate(e):m.isObject(e)&&(n[t]=m.encodeDates(e))}),n},m.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},m.formatDate=function(n){function e(t){return t<10?"0"+t:t}return n.getUTCFullYear()+"-"+e(n.getUTCMonth()+1)+"-"+e(n.getUTCDate())+"T"+e(n.getUTCHours())+":"+e(n.getUTCMinutes())+":"+e(n.getUTCSeconds())},m.strip_empty_properties=function(n){var e={};return m.each(n,function(t,r){m.isString(t)&&t.length>0&&(e[r]=t)}),e},m.truncate=function(n,e){var t;return typeof n=="string"?t=n.slice(0,e):m.isArray(n)?(t=[],m.each(n,function(r){t.push(m.truncate(r,e))})):m.isObject(n)?(t={},m.each(n,function(r,i){t[i]=m.truncate(r,e)})):t=n,t},m.JSONEncode=function(){return function(n){var e=n,t=function(i){var A=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return A.lastIndex=0,A.test(i)?'"'+i.replace(A,function(o){var a=s[o];return typeof a=="string"?a:"\\u"+("0000"+o.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},r=function(i,A){var s="",o=" ",a=0,c="",u="",l=0,d=s,h=[],f=A[i];switch(f&&typeof f=="object"&&typeof f.toJSON=="function"&&(f=f.toJSON(i)),typeof f){case"string":return t(f);case"number":return isFinite(f)?String(f):"null";case"boolean":case"null":return String(f);case"object":if(!f)return"null";if(s+=o,h=[],Bs.apply(f)==="[object Array]"){for(l=f.length,a=0;a<l;a+=1)h[a]=r(a,f)||"null";return u=h.length===0?"[]":s?`[
117
+ or you can use record.mirror to access the mirror instance during recording.`,tB={map:{},getId:function(){return console.error(Xi),-1},getNode:function(){return console.error(Xi),null},removeNodeFromMap:function(){console.error(Xi)},has:function(){return console.error(Xi),!1},reset:function(){console.error(Xi)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(tB=new Proxy(tB,{get:function(n,e,t){return e==="map"&&console.error(Xi),Reflect.get(n,e,t)}}));function ms(n,e,t){t===void 0&&(t={});var r=null,i=0;return function(){for(var A=arguments.length,s=new Array(A),o=0;o<A;o++)s[o]=arguments[o];var a=Date.now();!i&&t.leading===!1&&(i=a);var c=e-(a-i),u=this;c<=0||c>e?(r&&(clearTimeout(r),r=null),i=a,n.apply(u,s)):!r&&t.trailing!==!1&&(r=setTimeout(function(){i=t.leading===!1?0:Date.now(),r=null,n.apply(u,s)},c))}}function mc(n,e,t,r,i){i===void 0&&(i=window);var A=i.Object.getOwnPropertyDescriptor(n,e);return i.Object.defineProperty(n,e,r?t:{set:function(s){var o=this;setTimeout(function(){t.set.call(o,s)},0),A&&A.set&&A.set.call(this,s)}}),function(){return mc(n,e,A||{},!0)}}function Yi(n,e,t){try{if(!(e in n))return function(){};var r=n[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),n[e]=i,function(){n[e]=r}}catch{return function(){}}}var vc=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(vc=function(){return new Date().getTime()});function nB(n){var e,t,r,i,A=n.document;return{left:A.scrollingElement?A.scrollingElement.scrollLeft:n.pageXOffset!==void 0?n.pageXOffset:A.documentElement.scrollLeft||(A==null?void 0:A.body)&&((e=oe.parentElement(A.body))==null?void 0:e.scrollLeft)||((t=A==null?void 0:A.body)==null?void 0:t.scrollLeft)||0,top:A.scrollingElement?A.scrollingElement.scrollTop:n.pageYOffset!==void 0?n.pageYOffset:(A==null?void 0:A.documentElement.scrollTop)||(A==null?void 0:A.body)&&((r=oe.parentElement(A.body))==null?void 0:r.scrollTop)||((i=A==null?void 0:A.body)==null?void 0:i.scrollTop)||0}}function rB(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function iB(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function AB(n){if(!n)return null;var e=n.nodeType===n.ELEMENT_NODE?n:oe.parentElement(n);return e}function Ft(n,e,t,r){if(!n)return!1;var i=AB(n);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(Ta(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function oL(n,e){return e.getId(n)!==-1}function Vh(n,e,t){return n.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(n)===ns}function sB(n,e){if(es(n))return!1;var t=e.getId(n);if(!e.has(t))return!0;var r=oe.parentNode(n);return r&&r.nodeType===n.DOCUMENT_NODE?!1:r?sB(r,e):!0}function Gh(n){return!!n.changedTouches}function aL(n){n===void 0&&(n=window),"NodeList"in n&&!n.NodeList.prototype.forEach&&(n.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in n&&!n.DOMTokenList.prototype.forEach&&(n.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function oB(n,e){return!!(n.nodeName==="IFRAME"&&e.getMeta(n))}function aB(n,e){return!!(n.nodeName==="LINK"&&n.nodeType===n.ELEMENT_NODE&&n.getAttribute&&n.getAttribute("rel")==="stylesheet"&&e.getMeta(n))}function jh(n){return n?te(n,JM)&&"shadowRoot"in n?!!n.shadowRoot:!!oe.shadowRoot(n):!1}var cL=function(){function n(){N(this,"id",1),N(this,"styleIDMap",new WeakMap),N(this,"idStyleMap",new Map)}var e=n.prototype;return e.getId=function(t){var r;return(r=this.styleIDMap.get(t))!=null?r:-1},e.has=function(t){return this.styleIDMap.has(t)},e.add=function(t,r){if(this.has(t))return this.getId(t);var i;return r===void 0?i=this.id++:i=r,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i},e.getStyle=function(t){return this.idStyleMap.get(t)||null},e.reset=function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1},e.generateId=function(){return this.id++},n}();function cB(n){var e,t=null;return"getRootNode"in n&&((e=oe.getRootNode(n))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&oe.host(oe.getRootNode(n))&&(t=oe.host(oe.getRootNode(n))),t}function uL(n){for(var e=n,t;t=cB(e);)e=t;return e}function lL(n){var e=n.ownerDocument;if(!e)return!1;var t=uL(n);return oe.contains(e,t)}function uB(n){var e=n.ownerDocument;return e?oe.contains(e,n)||lL(n):!1}var le=function(n){return n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n}(le||{}),z=function(n){return n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n}(z||{}),Gt=function(n){return n[n.MouseUp=0]="MouseUp",n[n.MouseDown=1]="MouseDown",n[n.Click=2]="Click",n[n.ContextMenu=3]="ContextMenu",n[n.DblClick=4]="DblClick",n[n.Focus=5]="Focus",n[n.Blur=6]="Blur",n[n.TouchStart=7]="TouchStart",n[n.TouchMove_Departed=8]="TouchMove_Departed",n[n.TouchEnd=9]="TouchEnd",n[n.TouchCancel=10]="TouchCancel",n}(Gt||{}),Wn=function(n){return n[n.Mouse=0]="Mouse",n[n.Pen=1]="Pen",n[n.Touch=2]="Touch",n}(Wn||{}),Zi=function(n){return n[n["2D"]=0]="2D",n[n.WebGL=1]="WebGL",n[n.WebGL2=2]="WebGL2",n}(Zi||{}),$i=function(n){return n[n.Play=0]="Play",n[n.Pause=1]="Pause",n[n.Seeked=2]="Seeked",n[n.VolumeChange=3]="VolumeChange",n[n.RateChange=4]="RateChange",n}($i||{}),lB=function(n){return n[n.Document=0]="Document",n[n.DocumentType=1]="DocumentType",n[n.Element=2]="Element",n[n.Text=3]="Text",n[n.CDATA=4]="CDATA",n[n.Comment=5]="Comment",n}(lB||{});function dB(n){return"__ln"in n}var dL=function(){function n(){N(this,"length",0),N(this,"head",null),N(this,"tail",null)}var e=n.prototype;return e.get=function(t){if(t>=this.length)throw new Error("Position outside of list range");for(var r=this.head,i=0;i<t;i++)r=(r==null?void 0:r.next)||null;return r},e.addNode=function(t){var r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&dB(t.previousSibling)){var i=t.previousSibling.__ln.next;r.next=i,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,i&&(i.previous=r)}else if(t.nextSibling&&dB(t.nextSibling)&&t.nextSibling.__ln.previous){var A=t.nextSibling.__ln.previous;r.previous=A,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,A&&(A.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++},e.removeNode=function(t){var r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)},n}(),hB=function(n,e){return n+"@"+e},hL=function(){function n(){var t=this;N(this,"frozen",!1),N(this,"locked",!1),N(this,"texts",[]),N(this,"attributes",[]),N(this,"attributeMap",new WeakMap),N(this,"removes",[]),N(this,"mapRemoves",[]),N(this,"movedMap",{}),N(this,"addedSet",new Set),N(this,"movedSet",new Set),N(this,"droppedSet",new Set),N(this,"removesSubTreeCache",new Set),N(this,"mutationCb"),N(this,"blockClass"),N(this,"blockSelector"),N(this,"maskTextClass"),N(this,"maskTextSelector"),N(this,"inlineStylesheet"),N(this,"maskInputOptions"),N(this,"maskTextFn"),N(this,"maskInputFn"),N(this,"keepIframeSrcFn"),N(this,"recordCanvas"),N(this,"inlineImages"),N(this,"slimDOMOptions"),N(this,"dataURLOptions"),N(this,"doc"),N(this,"mirror"),N(this,"iframeManager"),N(this,"stylesheetManager"),N(this,"shadowDomManager"),N(this,"canvasManager"),N(this,"processedNodeManager"),N(this,"unattachedDoc"),N(this,"processMutations",function(r){r.forEach(t.processMutation),t.emit()}),N(this,"emit",function(){if(!(t.frozen||t.locked)){for(var r=[],i=new Set,A=new dL,s=function(T){for(var Q=T,M=ns;M===ns;)Q=Q&&Q.nextSibling,M=Q&&t.mirror.getId(Q);return M},o=function(T){var Q=oe.parentNode(T);if(!(!Q||!uB(T))){var M=!1;if(T.nodeType===Node.TEXT_NODE){var X=Q.tagName;if(X==="TEXTAREA")return;X==="STYLE"&&t.addedSet.has(Q)&&(M=!0)}var H=es(Q)?t.mirror.getId(cB(T)):t.mirror.getId(Q),q=s(T);if(H===-1||q===-1)return A.addNode(T);var ve=Vi(T,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(Y){oB(Y,t.mirror)&&t.iframeManager.addIframe(Y),aB(Y,t.mirror)&&t.stylesheetManager.trackLinkElement(Y),jh(T)&&t.shadowDomManager.addShadowRoot(oe.shadowRoot(T),t.doc)},onIframeLoad:function(Y,ie){t.iframeManager.attachIframe(Y,ie),t.shadowDomManager.observeAttachShadow(Y)},onStylesheetLoad:function(Y,ie){t.stylesheetManager.attachLinkElement(Y,ie)},cssCaptured:M});ve&&(r.push({parentId:H,nextId:q,node:ve}),i.add(ve.id))}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());for(var a=W(t.movedSet),c;!(c=a()).done;){var u=c.value;pB(t.removesSubTreeCache,u,t.mirror)&&!t.movedSet.has(oe.parentNode(u))||o(u)}for(var l=W(t.addedSet),d;!(d=l()).done;){var h=d.value;!fB(t.droppedSet,h)&&!pB(t.removesSubTreeCache,h,t.mirror)||fB(t.movedSet,h)?o(h):t.droppedSet.add(h)}for(var f=null;A.length;){var p=null;if(f){var g=t.mirror.getId(oe.parentNode(f.value)),v=s(f.value);g!==-1&&v!==-1&&(p=f)}if(!p)for(var y=A.tail;y;){var B=y;if(y=y.previous,B){var b=t.mirror.getId(oe.parentNode(B.value)),w=s(B.value);if(w===-1)continue;if(b!==-1){p=B;break}else{var _=B.value,k=oe.parentNode(_);if(k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var F=oe.host(k),x=t.mirror.getId(F);if(x!==-1){p=B;break}}}}}if(!p){for(;A.head;)A.removeNode(A.head.value);break}f=p.previous,A.removeNode(p.value),o(p.value)}var E={texts:t.texts.map(function(T){var Q=T.node,M=oe.parentNode(Q);return M&&M.tagName==="TEXTAREA"&&t.genTextAreaValueMutation(M),{id:t.mirror.getId(Q),value:T.value}}).filter(function(T){return!i.has(T.id)}).filter(function(T){return t.mirror.has(T.id)}),attributes:t.attributes.map(function(T){var Q=T.attributes;if(typeof Q.style=="string"){var M=JSON.stringify(T.styleDiff),X=JSON.stringify(T._unchangedStyles);M.length<Q.style.length&&(M+X).split("var(").length===Q.style.split("var(").length&&(Q.style=T.styleDiff)}return{id:t.mirror.getId(T.node),attributes:Q}}).filter(function(T){return!i.has(T.id)}).filter(function(T){return t.mirror.has(T.id)}),removes:t.removes,adds:r};!E.texts.length&&!E.attributes.length&&!E.removes.length&&!E.adds.length||(t.texts=[],t.attributes=[],t.attributeMap=new WeakMap,t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.removesSubTreeCache=new Set,t.movedMap={},t.mutationCb(E))}}),N(this,"genTextAreaValueMutation",function(r){var i=t.attributeMap.get(r);i||(i={node:r,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(i),t.attributeMap.set(r,i)),i.attributes.value=Array.from(oe.childNodes(r),function(A){return oe.textContent(A)||""}).join("")}),N(this,"processMutation",function(r){if(!Vh(r.target,t.mirror,t.slimDOMOptions))switch(r.type){case"characterData":{var i=oe.textContent(r.target);!Ft(r.target,t.blockClass,t.blockSelector,!1)&&i!==r.oldValue&&t.texts.push({value:nw(r.target,t.maskTextClass,t.maskTextSelector,!0)&&i?t.maskTextFn?t.maskTextFn(i,AB(r.target)):i.replace(/[\S]/g,"*"):i,node:r.target});break}case"attributes":{var A=r.target,s=r.attributeName,o=r.target.getAttribute(s);if(s==="value"){var a=Qd(A);o=xd({element:A,maskInputOptions:t.maskInputOptions,tagName:A.tagName,type:a,value:o,maskInputFn:t.maskInputFn})}if(Ft(r.target,t.blockClass,t.blockSelector,!1)||o===r.oldValue)return;var c=t.attributeMap.get(r.target);if(A.tagName==="IFRAME"&&s==="src"&&!t.keepIframeSrcFn(o))if(!A.contentDocument)s="rr_src";else return;if(c||(c={node:r.target,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(c),t.attributeMap.set(r.target,c)),s==="type"&&A.tagName==="INPUT"&&(r.oldValue||"").toLowerCase()==="password"&&A.setAttribute("data-rr-is-password","true"),!tw(A.tagName,s))if(c.attributes[s]=ew(t.doc,Zr(A.tagName),Zr(s),o),s==="style"){if(!t.unattachedDoc)try{t.unattachedDoc=document.implementation.createHTMLDocument()}catch{t.unattachedDoc=t.doc}var u=t.unattachedDoc.createElement("span");r.oldValue&&u.setAttribute("style",r.oldValue);for(var l=W(Array.from(A.style)),d;!(d=l()).done;){var h=d.value,f=A.style.getPropertyValue(h),p=A.style.getPropertyPriority(h);f!==u.style.getPropertyValue(h)||p!==u.style.getPropertyPriority(h)?p===""?c.styleDiff[h]=f:c.styleDiff[h]=[f,p]:c._unchangedStyles[h]=[f,p]}for(var g=W(Array.from(u.style)),v;!(v=g()).done;){var y=v.value;A.style.getPropertyValue(y)===""&&(c.styleDiff[y]=!1)}}else s==="open"&&A.tagName==="DIALOG"&&(A.matches("dialog:modal")?c.attributes.rr_open_mode="modal":c.attributes.rr_open_mode="non-modal");break}case"childList":{if(Ft(r.target,t.blockClass,t.blockSelector,!0))return;if(r.target.tagName==="TEXTAREA"){t.genTextAreaValueMutation(r.target);return}r.addedNodes.forEach(function(B){return t.genAdds(B,r.target)}),r.removedNodes.forEach(function(B){var b=t.mirror.getId(B),w=es(r.target)?t.mirror.getId(oe.host(r.target)):t.mirror.getId(r.target);Ft(r.target,t.blockClass,t.blockSelector,!1)||Vh(B,t.mirror,t.slimDOMOptions)||!oL(B,t.mirror)||(t.addedSet.has(B)?(Wh(t.addedSet,B),t.droppedSet.add(B)):t.addedSet.has(r.target)&&b===-1||sB(r.target,t.mirror)||(t.movedSet.has(B)&&t.movedMap[hB(b,w)]?Wh(t.movedSet,B):(t.removes.push({parentId:w,id:b,isShadow:es(r.target)&&ts(r.target)?!0:void 0}),pL(B,t.removesSubTreeCache))),t.mapRemoves.push(B))});break}}}),N(this,"genAdds",function(r,i){if(!t.processedNodeManager.inOtherBuffer(r,t)&&!(t.addedSet.has(r)||t.movedSet.has(r))){if(t.mirror.hasNode(r)){if(Vh(r,t.mirror,t.slimDOMOptions))return;t.movedSet.add(r);var A=null;i&&t.mirror.hasNode(i)&&(A=t.mirror.getId(i)),A&&A!==-1&&(t.movedMap[hB(t.mirror.getId(r),A)]=!0)}else t.addedSet.add(r),t.droppedSet.delete(r);Ft(r,t.blockClass,t.blockSelector,!1)||(oe.childNodes(r).forEach(function(s){return t.genAdds(s)}),jh(r)&&oe.childNodes(oe.shadowRoot(r)).forEach(function(s){t.processedNodeManager.add(s,t),t.genAdds(s,r)}))}})}var e=n.prototype;return e.init=function(t){var r=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(function(i){r[i]=t[i]})},e.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.isFrozen=function(){return this.frozen},e.lock=function(){this.locked=!0,this.canvasManager.lock()},e.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},n}();function Wh(n,e){n.delete(e),oe.childNodes(e).forEach(function(t){return Wh(n,t)})}function pL(n,e){for(var t=[n];t.length;){var r=t.pop();e.has(r)||(e.add(r),oe.childNodes(r).forEach(function(i){return t.push(i)}))}}function pB(n,e,t){return n.size===0?!1:fL(n,e)}function fL(n,e,t){var r=oe.parentNode(e);return r?n.has(r):!1}function fB(n,e){return n.size===0?!1:gB(n,e)}function gB(n,e){var t=oe.parentNode(e);return t?n.has(t)?!0:gB(n,t):!1}var vs;function gL(n){vs=n}function mL(){vs=void 0}var he=function(n){if(!vs)return n;var e=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];try{return n.apply(void 0,[].concat(r))}catch(A){if(vs&&vs(A)===!0)return;throw A}};return e},ti=[];function ys(n){try{if("composedPath"in n){var e=n.composedPath();if(e.length)return e[0]}else if("path"in n&&n.path.length)return n.path[0]}catch{}return n&&n.target}function mB(n,e){var t=new hL;ti.push(t),t.init(n);var r=new(eB())(he(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function vL(n){var e=n.mousemoveCb,t=n.sampling,r=n.doc,i=n.mirror;if(t.mousemove===!1)return function(){};var A=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,o=[],a,c=ms(he(function(d){var h=Date.now()-a;e(o.map(function(f){return f.timeOffset-=h,f}),d),o=[],a=null}),s),u=he(ms(he(function(d){var h=ys(d),f=Gh(d)?d.changedTouches[0]:d,p=f.clientX,g=f.clientY;a||(a=vc()),o.push({x:p,y:g,id:i.getId(h),timeOffset:vc()-a}),c(typeof DragEvent<"u"&&te(d,DragEvent)?z.Drag:te(d,MouseEvent)?z.MouseMove:z.TouchMove)}),A,{trailing:!1})),l=[It("mousemove",u,r),It("touchmove",u,r),It("drag",u,r)];return he(function(){l.forEach(function(d){return d()})})}function yL(n){var e=n.mouseInteractionCb,t=n.doc,r=n.mirror,i=n.blockClass,A=n.blockSelector,s=n.sampling;if(s.mouseInteraction===!1)return function(){};var o=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,a=[],c=null,u=function(l){return function(d){var h=ys(d);if(!Ft(h,i,A,!0)){var f=null,p=l;if("pointerType"in d){switch(d.pointerType){case"mouse":f=Wn.Mouse;break;case"touch":f=Wn.Touch;break;case"pen":f=Wn.Pen;break}f===Wn.Touch?Gt[l]===Gt.MouseDown?p="TouchStart":Gt[l]===Gt.MouseUp&&(p="TouchEnd"):Wn.Pen}else Gh(d)&&(f=Wn.Touch);f!==null?(c=f,(p.startsWith("Touch")&&f===Wn.Touch||p.startsWith("Mouse")&&f===Wn.Mouse)&&(f=null)):Gt[l]===Gt.Click&&(f=c,c=null);var g=Gh(d)?d.changedTouches[0]:d;if(g){var v=r.getId(h),y=g.clientX,B=g.clientY;he(e)(me({type:Gt[p],id:v,x:y,y:B},f!==null&&{pointerType:f}))}}}};return Object.keys(Gt).filter(function(l){return Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&o[l]!==!1}).forEach(function(l){var d=Zr(l),h=u(l);if(window.PointerEvent)switch(Gt[l]){case Gt.MouseDown:case Gt.MouseUp:d=d.replace("mouse","pointer");break;case Gt.TouchStart:case Gt.TouchEnd:return}a.push(It(d,h,t))}),he(function(){a.forEach(function(l){return l()})})}function vB(n){var e=n.scrollCb,t=n.doc,r=n.mirror,i=n.blockClass,A=n.blockSelector,s=n.sampling,o=he(ms(he(function(a){var c=ys(a);if(!(!c||Ft(c,i,A,!0))){var u=r.getId(c);if(c===t&&t.defaultView){var l=nB(t.defaultView);e({id:u,x:l.left,y:l.top})}else e({id:u,x:c.scrollLeft,y:c.scrollTop})}}),s.scroll||100));return It("scroll",o,t)}function wL(n,e){var t=n.viewportResizeCb,r=e.win,i=-1,A=-1,s=he(ms(he(function(){var o=rB(),a=iB();(i!==o||A!==a)&&(t({width:Number(a),height:Number(o)}),i=o,A=a)}),200));return It("resize",s,r)}var bL=["INPUT","TEXTAREA","SELECT"],yB=new WeakMap;function BL(n){var e=n.inputCb,t=n.doc,r=n.mirror,i=n.blockClass,A=n.blockSelector,s=n.ignoreClass,o=n.ignoreSelector,a=n.maskInputOptions,c=n.maskInputFn,u=n.sampling,l=n.userTriggeredOnInput;function d(b){var w=ys(b),_=b.isTrusted,k=w&&w.tagName;if(w&&k==="OPTION"&&(w=oe.parentElement(w)),!(!w||!k||bL.indexOf(k)<0||Ft(w,i,A,!0))&&!(w.classList.contains(s)||o&&w.matches(o))){var F=w.value,x=!1,E=Qd(w)||"";E==="radio"||E==="checkbox"?x=w.checked:(a[k.toLowerCase()]||a[E])&&(F=xd({element:w,maskInputOptions:a,tagName:k,type:E,value:F,maskInputFn:c})),h(w,l?{text:F,isChecked:x,userTriggered:_}:{text:F,isChecked:x});var T=w.name;E==="radio"&&T&&x&&t.querySelectorAll('input[type="radio"][name="'+T+'"]').forEach(function(Q){if(Q!==w){var M=Q.value;h(Q,l?{text:M,isChecked:!x,userTriggered:!1}:{text:M,isChecked:!x})}})}}function h(b,w){var _=yB.get(b);if(!_||_.text!==w.text||_.isChecked!==w.isChecked){yB.set(b,w);var k=r.getId(b);he(e)(me({},w,{id:k}))}}var f=u.input==="last"?["change"]:["input","change"],p=f.map(function(b){return It(b,he(d),t)}),g=t.defaultView;if(!g)return function(){p.forEach(function(b){return b()})};var v=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];if(v&&v.set){var B;(B=p).push.apply(B,[].concat(y.map(function(b){return mc(b[0],b[1],{set:function(){he(d)({target:this,isTrusted:!1})}},!1,g)})))}return he(function(){p.forEach(function(b){return b()})})}function yc(n){var e=[];function t(r,i){if(wc("CSSGroupingRule")&&te(r.parentRule,CSSGroupingRule)||wc("CSSMediaRule")&&te(r.parentRule,CSSMediaRule)||wc("CSSSupportsRule")&&te(r.parentRule,CSSSupportsRule)||wc("CSSConditionRule")&&te(r.parentRule,CSSConditionRule)){var A=Array.from(r.parentRule.cssRules),s=A.indexOf(r);i.unshift(s)}else if(r.parentStyleSheet){var o=Array.from(r.parentStyleSheet.cssRules),a=o.indexOf(r);i.unshift(a)}return i}return t(n,e)}function _r(n,e,t){var r,i;return n?(n.ownerNode?r=e.getId(n.ownerNode):i=t.getId(n),{styleId:i,id:r}):{}}function CL(n,e){var t=n.styleSheetRuleCb,r=n.mirror,i=n.stylesheetManager,A=e.win;if(!A.CSSStyleSheet||!A.CSSStyleSheet.prototype)return function(){};var s=A.CSSStyleSheet.prototype.insertRule;A.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:he(function(d,h,f){var p=f[0],g=f[1],v=_r(h,r,i.styleMirror),y=v.id,B=v.styleId;return(y&&y!==-1||B&&B!==-1)&&t({id:y,styleId:B,adds:[{rule:p,index:g}]}),d.apply(h,f)})}),A.CSSStyleSheet.prototype.addRule=function(d,h,f){f===void 0&&(f=this.cssRules.length);var p=d+" { "+h+" }";return A.CSSStyleSheet.prototype.insertRule.apply(this,[p,f])};var o=A.CSSStyleSheet.prototype.deleteRule;A.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:he(function(d,h,f){var p=f[0],g=_r(h,r,i.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&t({id:v,styleId:y,removes:[{index:p}]}),d.apply(h,f)})}),A.CSSStyleSheet.prototype.removeRule=function(d){return A.CSSStyleSheet.prototype.deleteRule.apply(this,[d])};var a;A.CSSStyleSheet.prototype.replace&&(a=A.CSSStyleSheet.prototype.replace,A.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:he(function(d,h,f){var p=f[0],g=_r(h,r,i.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&t({id:v,styleId:y,replace:p}),d.apply(h,f)})}));var c;A.CSSStyleSheet.prototype.replaceSync&&(c=A.CSSStyleSheet.prototype.replaceSync,A.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:he(function(d,h,f){var p=f[0],g=_r(h,r,i.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&t({id:v,styleId:y,replaceSync:p}),d.apply(h,f)})}));var u={};bc("CSSGroupingRule")?u.CSSGroupingRule=A.CSSGroupingRule:(bc("CSSMediaRule")&&(u.CSSMediaRule=A.CSSMediaRule),bc("CSSConditionRule")&&(u.CSSConditionRule=A.CSSConditionRule),bc("CSSSupportsRule")&&(u.CSSSupportsRule=A.CSSSupportsRule));var l={};return Object.entries(u).forEach(function(d){var h=d[0],f=d[1];l[h]={insertRule:f.prototype.insertRule,deleteRule:f.prototype.deleteRule},f.prototype.insertRule=new Proxy(l[h].insertRule,{apply:he(function(p,g,v){var y=v[0],B=v[1],b=_r(g.parentStyleSheet,r,i.styleMirror),w=b.id,_=b.styleId;return(w&&w!==-1||_&&_!==-1)&&t({id:w,styleId:_,adds:[{rule:y,index:[].concat(yc(g),[B||0])}]}),p.apply(g,v)})}),f.prototype.deleteRule=new Proxy(l[h].deleteRule,{apply:he(function(p,g,v){var y=v[0],B=_r(g.parentStyleSheet,r,i.styleMirror),b=B.id,w=B.styleId;return(b&&b!==-1||w&&w!==-1)&&t({id:b,styleId:w,removes:[{index:[].concat(yc(g),[y])}]}),p.apply(g,v)})})}),he(function(){A.CSSStyleSheet.prototype.insertRule=s,A.CSSStyleSheet.prototype.deleteRule=o,a&&(A.CSSStyleSheet.prototype.replace=a),c&&(A.CSSStyleSheet.prototype.replaceSync=c),Object.entries(u).forEach(function(d){var h=d[0],f=d[1];f.prototype.insertRule=l[h].insertRule,f.prototype.deleteRule=l[h].deleteRule})})}function wB(n,e){var t=n.mirror,r=n.stylesheetManager,i,A,s,o=null;e.nodeName==="#document"?o=t.getId(e):o=t.getId(oe.host(e));var a=e.nodeName==="#document"?(i=e.defaultView)==null?void 0:i.Document:(s=(A=e.ownerDocument)==null?void 0:A.defaultView)==null?void 0:s.ShadowRoot,c=a!=null&&a.prototype?Object.getOwnPropertyDescriptor(a==null?void 0:a.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!a||!c?function(){}:(Object.defineProperty(e,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:function(){var u;return(u=c.get)==null?void 0:u.call(this)},set:function(u){var l,d=(l=c.set)==null?void 0:l.call(this,u);if(o!==null&&o!==-1)try{r.adoptStyleSheets(u,o)}catch{}return d}}),he(function(){Object.defineProperty(e,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))}function _L(n,e){var t=n.styleDeclarationCb,r=n.mirror,i=n.ignoreCSSAttributes,A=n.stylesheetManager,s=e.win,o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:he(function(c,u,l){var d,h=l[0],f=l[1],p=l[2];if(i.has(h))return o.apply(u,[h,f,p]);var g=_r((d=u.parentRule)==null?void 0:d.parentStyleSheet,r,A.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&t({id:v,styleId:y,set:{property:h,value:f,priority:p},index:yc(u.parentRule)}),c.apply(u,l)})});var a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:he(function(c,u,l){var d,h=l[0];if(i.has(h))return a.apply(u,[h]);var f=_r((d=u.parentRule)==null?void 0:d.parentStyleSheet,r,A.styleMirror),p=f.id,g=f.styleId;return(p&&p!==-1||g&&g!==-1)&&t({id:p,styleId:g,remove:{property:h},index:yc(u.parentRule)}),c.apply(u,l)})}),he(function(){s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a})}function SL(n){var e=n.mediaInteractionCb,t=n.blockClass,r=n.blockSelector,i=n.mirror,A=n.sampling,s=n.doc,o=he(function(c){return ms(he(function(u){var l=ys(u);if(!(!l||Ft(l,t,r,!0))){var d=l.currentTime,h=l.volume,f=l.muted,p=l.playbackRate,g=l.loop;e({type:c,id:i.getId(l),currentTime:d,volume:h,muted:f,playbackRate:p,loop:g})}}),A.media||500)}),a=[It("play",o($i.Play),s),It("pause",o($i.Pause),s),It("seeked",o($i.Seeked),s),It("volumechange",o($i.VolumeChange),s),It("ratechange",o($i.RateChange),s)];return he(function(){a.forEach(function(c){return c()})})}function kL(n){var e=n.fontCb,t=n.doc,r=t.defaultView;if(!r)return function(){};var i=[],A=new WeakMap,s=r.FontFace;r.FontFace=function(a,c,u){var l=new s(a,c,u);return A.set(l,{family:a,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),l};var o=Yi(t.fonts,"add",function(a){return function(c){return setTimeout(he(function(){var u=A.get(c);u&&(e(u),A.delete(c))}),0),a.apply(this,[c])}});return i.push(function(){r.FontFace=s}),i.push(o),he(function(){i.forEach(function(a){return a()})})}function EL(n){var e=n.doc,t=n.mirror,r=n.blockClass,i=n.blockSelector,A=n.selectionCb,s=!0,o=he(function(){var a=e.getSelection();if(!(!a||s&&(a!=null&&a.isCollapsed))){s=a.isCollapsed||!1;for(var c=[],u=a.rangeCount||0,l=0;l<u;l++){var d=a.getRangeAt(l),h=d.startContainer,f=d.startOffset,p=d.endContainer,g=d.endOffset,v=Ft(h,r,i,!0)||Ft(p,r,i,!0);v||c.push({start:t.getId(h),startOffset:f,end:t.getId(p),endOffset:g})}A({ranges:c})}});return o(),It("selectionchange",o)}function UL(n){var e=n.doc,t=n.customElementCb,r=e.defaultView;if(!r||!r.customElements)return function(){};var i=Yi(r.customElements,"define",function(A){return function(s,o,a){try{t({define:{name:s}})}catch{console.warn("Custom element callback failed for "+s)}return A.apply(this,[s,o,a])}});return i}function TL(n,e){var t=n.mutationCb,r=n.mousemoveCb,i=n.mouseInteractionCb,A=n.scrollCb,s=n.viewportResizeCb,o=n.inputCb,a=n.mediaInteractionCb,c=n.styleSheetRuleCb,u=n.styleDeclarationCb,l=n.canvasMutationCb,d=n.fontCb,h=n.selectionCb,f=n.customElementCb;n.mutationCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.mutation){var y;(y=e).mutation.apply(y,[].concat(g))}t.apply(void 0,[].concat(g))},n.mousemoveCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.mousemove){var y;(y=e).mousemove.apply(y,[].concat(g))}r.apply(void 0,[].concat(g))},n.mouseInteractionCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.mouseInteraction){var y;(y=e).mouseInteraction.apply(y,[].concat(g))}i.apply(void 0,[].concat(g))},n.scrollCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.scroll){var y;(y=e).scroll.apply(y,[].concat(g))}A.apply(void 0,[].concat(g))},n.viewportResizeCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.viewportResize){var y;(y=e).viewportResize.apply(y,[].concat(g))}s.apply(void 0,[].concat(g))},n.inputCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.input){var y;(y=e).input.apply(y,[].concat(g))}o.apply(void 0,[].concat(g))},n.mediaInteractionCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.mediaInteaction){var y;(y=e).mediaInteaction.apply(y,[].concat(g))}a.apply(void 0,[].concat(g))},n.styleSheetRuleCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.styleSheetRule){var y;(y=e).styleSheetRule.apply(y,[].concat(g))}c.apply(void 0,[].concat(g))},n.styleDeclarationCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.styleDeclaration){var y;(y=e).styleDeclaration.apply(y,[].concat(g))}u.apply(void 0,[].concat(g))},n.canvasMutationCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.canvasMutation){var y;(y=e).canvasMutation.apply(y,[].concat(g))}l.apply(void 0,[].concat(g))},n.fontCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.font){var y;(y=e).font.apply(y,[].concat(g))}d.apply(void 0,[].concat(g))},n.selectionCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.selection){var y;(y=e).selection.apply(y,[].concat(g))}h.apply(void 0,[].concat(g))},n.customElementCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.customElement){var y;(y=e).customElement.apply(y,[].concat(g))}f.apply(void 0,[].concat(g))}}function IL(n,e){e===void 0&&(e={});var t=n.doc.defaultView;if(!t)return function(){};TL(n,e);var r;n.recordDOM&&(r=mB(n,n.doc));var i=vL(n),A=yL(n),s=vB(n),o=wL(n,{win:t}),a=BL(n),c=SL(n),u=function(){},l=function(){},d=function(){},h=function(){};n.recordDOM&&(u=CL(n,{win:t}),l=wB(n,n.doc),d=_L(n,{win:t}),n.collectFonts&&(h=kL(n)));for(var f=EL(n),p=UL(n),g=[],v=W(n.plugins),y;!(y=v()).done;){var B=y.value;g.push(B.observer(B.callback,t,B.options))}return he(function(){ti.forEach(function(b){return b.reset()}),r==null||r.disconnect(),i(),A(),s(),o(),a(),c(),u(),l(),d(),h(),f(),p(),g.forEach(function(b){return b()})})}function wc(n){return typeof window[n]<"u"}function bc(n){return!!(typeof window[n]<"u"&&window[n].prototype&&"insertRule"in window[n].prototype&&"deleteRule"in window[n].prototype)}for(var bB=function(){function n(t){N(this,"iframeIdToRemoteIdMap",new WeakMap),N(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}var e=n.prototype;return e.getId=function(t,r,i,A){var s=i||this.getIdToRemoteIdMap(t),o=A||this.getRemoteIdToIdMap(t),a=s.get(r);return a||(a=this.generateIdFn(),s.set(r,a),o.set(a,r)),a},e.getIds=function(t,r){var i=this,A=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return r.map(function(o){return i.getId(t,o,A,s)})},e.getRemoteId=function(t,r,i){var A=i||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;var s=A.get(r);return s||-1},e.getRemoteIds=function(t,r){var i=this,A=this.getRemoteIdToIdMap(t);return r.map(function(s){return i.getRemoteId(t,s,A)})},e.reset=function(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)},e.getIdToRemoteIdMap=function(t){var r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r},e.getRemoteIdToIdMap=function(t){var r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r},n}(),FL=function(){function n(t){N(this,"iframes",new WeakMap),N(this,"crossOriginIframeMap",new WeakMap),N(this,"crossOriginIframeMirror",new bB(Yy)),N(this,"crossOriginIframeStyleMirror"),N(this,"crossOriginIframeRootIdMap",new WeakMap),N(this,"mirror"),N(this,"mutationCb"),N(this,"wrappedEmit"),N(this,"loadListener"),N(this,"stylesheetManager"),N(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new bB(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}var e=n.prototype;return e.addIframe=function(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)},e.addLoadListener=function(t){this.loadListener=t},e.attachIframe=function(t,r){var i,A;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((i=t.contentWindow)==null||i.addEventListener("message",this.handleMessage.bind(this))),(A=this.loadListener)==null||A.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))},e.handleMessage=function(t){var r=t;if(!(r.data.type!=="rrweb"||r.origin!==r.data.origin)){var i=t.source;if(i){var A=this.crossOriginIframeMap.get(t.source);if(A){var s=this.transformCrossOriginEvent(A,r.data.event);s&&this.wrappedEmit(s,r.data.isCheckout)}}}},e.transformCrossOriginEvent=function(t,r){var i=this,A;switch(r.type){case le.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);var s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:le.IncrementalSnapshot,data:{source:z.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case le.Meta:case le.Load:case le.DomContentLoaded:return!1;case le.Plugin:return r;case le.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case le.IncrementalSnapshot:switch(r.data.source){case z.Mutation:return r.data.adds.forEach(function(o){i.replaceIds(o,t,["parentId","nextId","previousId"]),i.replaceIdOnNode(o.node,t);var a=i.crossOriginIframeRootIdMap.get(t);a&&i.patchRootIdOnNode(o.node,a)}),r.data.removes.forEach(function(o){i.replaceIds(o,t,["parentId","id"])}),r.data.attributes.forEach(function(o){i.replaceIds(o,t,["id"])}),r.data.texts.forEach(function(o){i.replaceIds(o,t,["id"])}),r;case z.Drag:case z.TouchMove:case z.MouseMove:return r.data.positions.forEach(function(o){i.replaceIds(o,t,["id"])}),r;case z.ViewportResize:return!1;case z.MediaInteraction:case z.MouseInteraction:case z.Scroll:case z.CanvasMutation:case z.Input:return this.replaceIds(r.data,t,["id"]),r;case z.StyleSheetRule:case z.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case z.Font:return r;case z.Selection:return r.data.ranges.forEach(function(o){i.replaceIds(o,t,["start","end"])}),r;case z.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(A=r.data.styles)==null||A.forEach(function(o){i.replaceStyleIds(o,t,["styleId"])}),r}}return!1},e.replace=function(t,r,i,A){for(var s=W(A),o;!(o=s()).done;){var a=o.value;!Array.isArray(r[a])&&typeof r[a]!="number"||(Array.isArray(r[a])?r[a]=t.getIds(i,r[a]):r[a]=t.getId(i,r[a]))}return r},e.replaceIds=function(t,r,i){return this.replace(this.crossOriginIframeMirror,t,r,i)},e.replaceStyleIds=function(t,r,i){return this.replace(this.crossOriginIframeStyleMirror,t,r,i)},e.replaceIdOnNode=function(t,r){var i=this;this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(function(A){i.replaceIdOnNode(A,r)})},e.patchRootIdOnNode=function(t,r){var i=this;t.type!==lB.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(function(A){i.patchRootIdOnNode(A,r)})},n}(),xL=function(){function n(t){N(this,"shadowDoms",new WeakSet),N(this,"mutationCb"),N(this,"scrollCb"),N(this,"bypassOptions"),N(this,"mirror"),N(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}var e=n.prototype;return e.init=function(){this.reset(),this.patchAttachShadow(Element,document)},e.addShadowRoot=function(t,r){var i=this;if(ts(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var A=mB(me({},this.bypassOptions,{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(function(){return A.disconnect()}),this.restoreHandlers.push(vB(me({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(function(){t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&i.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,i.mirror.getId(oe.host(t))),i.restoreHandlers.push(wB({mirror:i.mirror,stylesheetManager:i.bypassOptions.stylesheetManager},t))},0)}},e.observeAttachShadow=function(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)},e.patchAttachShadow=function(t,r){var i=this;this.restoreHandlers.push(Yi(t.prototype,"attachShadow",function(A){return function(s){var o=A.call(this,s),a=oe.shadowRoot(this);return a&&uB(this)&&i.addShadowRoot(a,r),o}}))},e.reset=function(){this.restoreHandlers.forEach(function(t){try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet},n}(),eA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",QL=typeof Uint8Array>"u"?[]:new Uint8Array(256),Bc=0;Bc<eA.length;Bc++)QL[eA.charCodeAt(Bc)]=Bc;var RL=function(n){var e=new Uint8Array(n),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=eA[e[t]>>2],i+=eA[(e[t]&3)<<4|e[t+1]>>4],i+=eA[(e[t+1]&15)<<2|e[t+2]>>6],i+=eA[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},BB=new Map;function PL(n,e){var t=BB.get(n);return t||(t=new Map,BB.set(n,t)),t.has(e)||t.set(e,[]),t.get(e)}var CB=function(n,e,t){if(!(!n||!(SB(n,e)||(typeof n>"u"?"undefined":se(n))==="object"))){var r=n.constructor.name,i=PL(t,r),A=i.indexOf(n);return A===-1&&(A=i.length,i.push(n)),A}};function Cc(n,e,t){if(te(n,Array))return n.map(function(f){return Cc(f,e,t)});if(n===null)return n;if(te(n,Float32Array)||te(n,Float64Array)||te(n,Int32Array)||te(n,Uint32Array)||te(n,Uint8Array)||te(n,Uint16Array)||te(n,Int16Array)||te(n,Int8Array)||te(n,Uint8ClampedArray)){var r=n.constructor.name;return{rr_type:r,args:[Object.values(n)]}}else if(te(n,ArrayBuffer)){var i=n.constructor.name,A=RL(n);return{rr_type:i,base64:A}}else if(te(n,DataView)){var s=n.constructor.name;return{rr_type:s,args:[Cc(n.buffer,e,t),n.byteOffset,n.byteLength]}}else if(te(n,HTMLImageElement)){var o=n.constructor.name,a=n.src;return{rr_type:o,src:a}}else if(te(n,HTMLCanvasElement)){var c="HTMLImageElement",u=n.toDataURL();return{rr_type:c,src:u}}else if(te(n,ImageData)){var l=n.constructor.name;return{rr_type:l,args:[Cc(n.data,e,t),n.width,n.height]}}else if(SB(n,e)||(typeof n>"u"?"undefined":se(n))==="object"){var d=n.constructor.name,h=CB(n,e,t);return{rr_type:d,index:h}}return n}var _B=function(n,e,t){return n.map(function(r){return Cc(r,e,t)})},SB=function(n,e){var t=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"],r=t.filter(function(i){return typeof e[i]=="function"});return!!r.find(function(i){return te(n,e[i])})};function OL(n,e,t,r){for(var i=function(){var c=a.value;try{if(typeof e.CanvasRenderingContext2D.prototype[c]!="function")return"continue";var u=Yi(e.CanvasRenderingContext2D.prototype,c,function(d){return function(){for(var h=this,f=arguments.length,p=new Array(f),g=0;g<f;g++)p[g]=arguments[g];return Ft(this.canvas,t,r,!0)||setTimeout(function(){var v=_B(p,e,h);n(h.canvas,{type:Zi["2D"],property:c,args:v})},0),d.apply(this,p)}});A.push(u)}catch{var l=mc(e.CanvasRenderingContext2D.prototype,c,{set:function(d){n(this.canvas,{type:Zi["2D"],property:c,args:[d],setter:!0})}});A.push(l)}},A=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=W(s),a;!(a=o()).done;)i();return function(){A.forEach(function(c){return c()})}}function ML(n){return n==="experimental-webgl"?"webgl":n}function kB(n,e,t,r){var i=[];try{var A=Yi(n.HTMLCanvasElement.prototype,"getContext",function(s){return function(o){for(var a=arguments.length,c=new Array(a>1?a-1:0),u=1;u<a;u++)c[u-1]=arguments[u];if(!Ft(this,e,t,!0)){var l=ML(o);if("__context"in this||(this.__context=l),r&&["webgl","webgl2"].includes(l))if(c[0]&&se(c[0])==="object"){var d=c[0];d.preserveDrawingBuffer||(d.preserveDrawingBuffer=!0)}else c.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[].concat([o],c))}});i.push(A)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){i.forEach(function(s){return s()})}}function EB(n,e,t,r,i,A){for(var s=function(){var l=u.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return"continue";try{if(typeof n[l]!="function")return"continue";var d=Yi(n,l,function(f){return function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];var y=f.apply(this,g);if(CB(y,A,this),"tagName"in this.canvas&&!Ft(this.canvas,r,i,!0)){var B=_B(g,A,this),b={type:e,property:l,args:B};t(this.canvas,b)}return y}});o.push(d)}catch{var h=mc(n,l,{set:function(f){t(this.canvas,{type:e,property:l,args:[f],setter:!0})}});o.push(h)}},o=[],a=Object.getOwnPropertyNames(n),c=W(a),u;!(u=c()).done;)s();return o}function LL(n,e,t,r){var i,A=[];if((i=A).push.apply(i,[].concat(EB(e.WebGLRenderingContext.prototype,Zi.WebGL,n,t,r,e))),typeof e.WebGL2RenderingContext<"u"){var s;(s=A).push.apply(s,[].concat(EB(e.WebGL2RenderingContext.prototype,Zi.WebGL2,n,t,r,e)))}return function(){A.forEach(function(o){return o()})}}var UB="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",DL=function(n){return Uint8Array.from(atob(n),function(e){return e.charCodeAt(0)})},TB=typeof window<"u"&&window.Blob&&new Blob([DL(UB)],{type:"text/javascript;charset=utf-8"});function NL(n){var e;try{if(e=TB&&(window.URL||window.webkitURL).createObjectURL(TB),!e)throw"";var t=new Worker(e,{name:n==null?void 0:n.name});return t.addEventListener("error",function(){(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+UB,{name:n==null?void 0:n.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var HL=function(){function n(t){var r=this;N(this,"pendingCanvasMutations",new Map),N(this,"rafStamps",{latestId:0,invokeId:null}),N(this,"mirror"),N(this,"mutationCb"),N(this,"resetObservers"),N(this,"frozen",!1),N(this,"locked",!1),N(this,"processMutation",function(l,d){var h=r.rafStamps.invokeId&&r.rafStamps.latestId!==r.rafStamps.invokeId;(h||!r.rafStamps.invokeId)&&(r.rafStamps.invokeId=r.rafStamps.latestId),r.pendingCanvasMutations.has(l)||r.pendingCanvasMutations.set(l,[]),r.pendingCanvasMutations.get(l).push(d)});var i=t.sampling,A=i===void 0?"all":i,s=t.win,o=t.blockClass,a=t.blockSelector,c=t.recordCanvas,u=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,c&&A==="all"&&this.initCanvasMutationObserver(s,o,a),c&&typeof A=="number"&&this.initCanvasFPSObserver(A,s,o,a,{dataURLOptions:u})}var e=n.prototype;return e.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.freeze=function(){this.frozen=!0},e.unfreeze=function(){this.frozen=!1},e.lock=function(){this.locked=!0},e.unlock=function(){this.locked=!1},e.initCanvasFPSObserver=function(t,r,i,A,s){var o=this,a=kB(r,i,A,!0),c=new Map,u=new NL;u.onmessage=function(g){var v=g.data.id;if(c.set(v,!1),"base64"in g.data){var y=g.data,B=y.base64,b=y.type,w=y.width,_=y.height;o.mutationCb({id:v,type:Zi["2D"],commands:[{property:"clearRect",args:[0,0,w,_]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:B}],type:b}]},0,0]}]})}};var l=1e3/t,d=0,h,f=function(){var g=[];return r.document.querySelectorAll("canvas").forEach(function(v){Ft(v,i,A,!0)||g.push(v)}),g},p=function(g){if(d&&g-d<l){h=requestAnimationFrame(p);return}d=g;var v=o;f().forEach(kd(function(y){var B,b,w,_;return $A(this,function(k){switch(k.label){case 0:return b=v.mirror.getId(y),c.get(b)?[2]:y.width===0||y.height===0?[2]:(c.set(b,!0),["webgl","webgl2"].includes(y.__context)&&(w=y.getContext(y.__context),((B=w==null?void 0:w.getContextAttributes())==null?void 0:B.preserveDrawingBuffer)===!1&&w.clear(w.COLOR_BUFFER_BIT)),[4,createImageBitmap(y)]);case 1:return _=k.sent(),u.postMessage({id:b,bitmap:_,width:y.width,height:y.height,dataURLOptions:s.dataURLOptions},[_]),[2]}})})),h=requestAnimationFrame(p)};h=requestAnimationFrame(p),this.resetObservers=function(){a(),cancelAnimationFrame(h)}},e.initCanvasMutationObserver=function(t,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var A=kB(t,r,i,!1),s=OL(this.processMutation.bind(this),t,r,i),o=LL(this.processMutation.bind(this),t,r,i);this.resetObservers=function(){A(),s(),o()}},e.startPendingCanvasMutationFlusher=function(){var t=this;requestAnimationFrame(function(){return t.flushPendingCanvasMutations()})},e.startRAFTimestamping=function(){var t=this,r=function(i){t.rafStamps.latestId=i,requestAnimationFrame(r)};requestAnimationFrame(r)},e.flushPendingCanvasMutations=function(){var t=this;this.pendingCanvasMutations.forEach(function(r,i){var A=t.mirror.getId(i);t.flushPendingCanvasMutationFor(i,A)}),requestAnimationFrame(function(){return t.flushPendingCanvasMutations()})},e.flushPendingCanvasMutationFor=function(t,r){if(!(this.frozen||this.locked)){var i=this.pendingCanvasMutations.get(t);if(!(!i||r===-1)){var A=i.map(function(o){o.type;var a=YA(o,["type"]);return a}),s=i[0].type;this.mutationCb({id:r,type:s,commands:A}),this.pendingCanvasMutations.delete(t)}}},n}(),KL=function(){function n(t){N(this,"trackedLinkElements",new WeakSet),N(this,"mutationCb"),N(this,"adoptedStyleSheetCb"),N(this,"styleMirror",new cL),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}var e=n.prototype;return e.attachLinkElement=function(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)},e.trackLinkElement=function(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))},e.adoptStyleSheets=function(t,r){var i,A=function(){var u=c.value,l=void 0;i.styleMirror.has(u)?l=i.styleMirror.getId(u):(l=i.styleMirror.add(u),o.push({styleId:l,rules:Array.from(u.rules||CSSRule,function(d,h){return{rule:qy(d,u.href),index:h}})})),s.styleIds.push(l)};if(t.length!==0){for(var s={id:r,styleIds:[]},o=[],a=W(t),c;!(c=a()).done;)i=this,A();o.length>0&&(s.styles=o),this.adoptedStyleSheetCb(s)}},e.reset=function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet},e.trackStylesheetInLinkElement=function(t){},n}(),VL=function(){function n(){N(this,"nodeMap",new WeakMap),N(this,"active",!1)}var e=n.prototype;return e.inOtherBuffer=function(t,r){var i=this.nodeMap.get(t);return i&&Array.from(i).some(function(A){return A!==r})},e.add=function(t,r){var i=this;this.active||(this.active=!0,requestAnimationFrame(function(){i.nodeMap=new WeakMap,i.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))},e.destroy=function(){},n}(),$e,_c,qh,Sc=!1;try{if(Array.from([1],function(n){return n*2})[0]!==2){var Jh=document.createElement("iframe");document.body.appendChild(Jh),Array.from=((Hy=Jh.contentWindow)==null?void 0:Hy.Array.from)||Array.from,document.body.removeChild(Jh)}}catch{}var fn=HR();function Sr(n){n===void 0&&(n={});var e=n.emit,t=n.checkoutEveryNms,r=n.checkoutEveryNth,i=n.blockClass,A=i===void 0?"rr-block":i,s=n.blockSelector,o=s===void 0?null:s,a=n.ignoreClass,c=a===void 0?"rr-ignore":a,u=n.ignoreSelector,l=u===void 0?null:u,d=n.maskTextClass,h=d===void 0?"rr-mask":d,f=n.maskTextSelector,p=f===void 0?null:f,g=n.inlineStylesheet,v=g===void 0?!0:g,y=n.maskAllInputs,B=n.maskInputOptions,b=n.slimDOMOptions,w=n.maskInputFn,_=n.maskTextFn,k=n.hooks,F=n.packFn,x=n.sampling,E=x===void 0?{}:x,T=n.dataURLOptions,Q=T===void 0?{}:T,M=n.mousemoveWait,X=n.recordDOM,H=X===void 0?!0:X,q=n.recordCanvas,ve=q===void 0?!1:q,Y=n.recordCrossOriginIframes,ie=Y===void 0?!1:Y,Qe=n.recordAfter,qe=Qe===void 0?n.recordAfter==="DOMContentLoaded"?n.recordAfter:"load":Qe,Be=n.userTriggeredOnInput,ht=Be===void 0?!1:Be,Re=n.collectFonts,Ne=Re===void 0?!1:Re,ne=n.inlineImages,et=ne===void 0?!1:ne,Z=n.plugins,We=n.keepIframeSrcFn,Us=We===void 0?function(){return!1}:We,Ts=n.ignoreCSSAttributes,Pp=Ts===void 0?new Set([]):Ts,Kc=n.errorHandler;gL(Kc);var Qr=ie?window.parent===window:!0,oi=!1;if(!Qr)try{window.parent.document&&(oi=!1)}catch{oi=!0}if(Qr&&!e)throw new Error("emit function is required");if(!Qr&&!oi)return function(){};M!==void 0&&E.mousemove===void 0&&(E.mousemove=M),fn.reset();var dA=y===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:B!==void 0?B:{password:!0},Is=b===!0||b==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:b==="all",headMetaDescKeywords:b==="all",headTitleMutations:b==="all"}:b||{};aL();var hA,ai=0,Yn=function(Ie){for(var tn=W(Z||[]),J;!(J=tn()).done;){var Je=J.value;Je.eventProcessor&&(Ie=Je.eventProcessor(Ie))}return F&&!oi&&(Ie=F(Ie)),Ie};$e=function(Ie,tn){var J,Je=Ie;if(Je.timestamp=vc(),(J=ti[0])!=null&&J.isFrozen()&&Je.type!==le.FullSnapshot&&!(Je.type===le.IncrementalSnapshot&&Je.data.source===z.Mutation)&&ti.forEach(function(T4){return T4.unfreeze()}),Qr)e==null||e(Yn(Je),tn);else if(oi){var k4={type:"rrweb",event:Yn(Je),origin:window.location.origin,isCheckout:tn};window.parent.postMessage(k4,"*")}if(Je.type===le.FullSnapshot)hA=Je,ai=0;else if(Je.type===le.IncrementalSnapshot){if(Je.data.source===z.Mutation&&Je.data.isAttachIframe)return;ai++;var E4=r&&ai>=r,U4=t&&Je.timestamp-hA.timestamp>t;(E4||U4)&&_c(!0)}};for(var ci=function(Ie){$e({type:le.IncrementalSnapshot,data:me({source:z.Mutation},Ie)})},ZC=function(Ie){return $e({type:le.IncrementalSnapshot,data:me({source:z.Scroll},Ie)})},$C=function(Ie){return $e({type:le.IncrementalSnapshot,data:me({source:z.CanvasMutation},Ie)})},_4=function(Ie){return $e({type:le.IncrementalSnapshot,data:me({source:z.AdoptedStyleSheet},Ie)})},ui=new KL({mutationCb:ci,adoptedStyleSheetCb:_4}),li=new FL({mirror:fn,mutationCb:ci,stylesheetManager:ui,recordCrossOriginIframes:ie,wrappedEmit:$e}),S4=W(Z||[]),e_;!(e_=S4()).done;){var t_=e_.value;t_.getMirror&&t_.getMirror({nodeMirror:fn,crossOriginIframeMirror:li.crossOriginIframeMirror,crossOriginIframeStyleMirror:li.crossOriginIframeStyleMirror})}var Op=new VL;qh=new HL({recordCanvas:ve,mutationCb:$C,win:window,blockClass:A,blockSelector:o,mirror:fn,sampling:E.canvas,dataURLOptions:Q});var Vc=new xL({mutationCb:ci,scrollCb:ZC,bypassOptions:{blockClass:A,blockSelector:o,maskTextClass:h,maskTextSelector:p,inlineStylesheet:v,maskInputOptions:dA,dataURLOptions:Q,maskTextFn:_,maskInputFn:w,recordCanvas:ve,inlineImages:et,sampling:E,slimDOMOptions:Is,iframeManager:li,stylesheetManager:ui,canvasManager:qh,keepIframeSrcFn:Us,processedNodeManager:Op},mirror:fn});_c=function(Ie){if(Ie===void 0&&(Ie=!1),!!H){$e({type:le.Meta,data:{href:window.location.href,width:iB(),height:rB()}},Ie),ui.reset(),Vc.init(),ti.forEach(function(J){return J.lock()});var tn=lP(document,{mirror:fn,blockClass:A,blockSelector:o,maskTextClass:h,maskTextSelector:p,inlineStylesheet:v,maskAllInputs:dA,maskTextFn:_,maskInputFn:w,slimDOM:Is,dataURLOptions:Q,recordCanvas:ve,inlineImages:et,onSerialize:function(J){oB(J,fn)&&li.addIframe(J),aB(J,fn)&&ui.trackLinkElement(J),jh(J)&&Vc.addShadowRoot(oe.shadowRoot(J),document)},onIframeLoad:function(J,Je){li.attachIframe(J,Je),Vc.observeAttachShadow(J)},onStylesheetLoad:function(J,Je){ui.attachLinkElement(J,Je)},keepIframeSrcFn:Us});if(!tn)return console.warn("Failed to snapshot the document");$e({type:le.FullSnapshot,data:{node:tn,initialOffset:nB(window)}},Ie),ti.forEach(function(J){return J.unlock()}),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ui.adoptStyleSheets(document.adoptedStyleSheets,fn.getId(document))}};try{var Fs=[],n_=function(Ie){var tn;return he(IL)({mutationCb:ci,mousemoveCb:function(J,Je){return $e({type:le.IncrementalSnapshot,data:{source:Je,positions:J}})},mouseInteractionCb:function(J){return $e({type:le.IncrementalSnapshot,data:me({source:z.MouseInteraction},J)})},scrollCb:ZC,viewportResizeCb:function(J){return $e({type:le.IncrementalSnapshot,data:me({source:z.ViewportResize},J)})},inputCb:function(J){return $e({type:le.IncrementalSnapshot,data:me({source:z.Input},J)})},mediaInteractionCb:function(J){return $e({type:le.IncrementalSnapshot,data:me({source:z.MediaInteraction},J)})},styleSheetRuleCb:function(J){return $e({type:le.IncrementalSnapshot,data:me({source:z.StyleSheetRule},J)})},styleDeclarationCb:function(J){return $e({type:le.IncrementalSnapshot,data:me({source:z.StyleDeclaration},J)})},canvasMutationCb:$C,fontCb:function(J){return $e({type:le.IncrementalSnapshot,data:me({source:z.Font},J)})},selectionCb:function(J){$e({type:le.IncrementalSnapshot,data:me({source:z.Selection},J)})},customElementCb:function(J){$e({type:le.IncrementalSnapshot,data:me({source:z.CustomElement},J)})},blockClass:A,ignoreClass:c,ignoreSelector:l,maskTextClass:h,maskTextSelector:p,maskInputOptions:dA,inlineStylesheet:v,sampling:E,recordDOM:H,recordCanvas:ve,inlineImages:et,userTriggeredOnInput:ht,collectFonts:Ne,doc:Ie,maskInputFn:w,maskTextFn:_,keepIframeSrcFn:Us,blockSelector:o,slimDOMOptions:Is,dataURLOptions:Q,mirror:fn,iframeManager:li,stylesheetManager:ui,shadowDomManager:Vc,processedNodeManager:Op,canvasManager:qh,ignoreCSSAttributes:Pp,plugins:((tn=Z==null?void 0:Z.filter(function(J){return J.observer}))==null?void 0:tn.map(function(J){return{observer:J.observer,options:J.options,callback:function(Je){return $e({type:le.Plugin,data:{plugin:J.name,payload:Je}})}}}))||[]},k)};li.addLoadListener(function(Ie){try{Fs.push(n_(Ie.contentDocument))}catch(tn){console.warn(tn)}});var Mp=function(){_c(),Fs.push(n_(document)),Sc=!0};return document.readyState==="interactive"||document.readyState==="complete"?Mp():(Fs.push(It("DOMContentLoaded",function(){$e({type:le.DomContentLoaded,data:{}}),qe==="DOMContentLoaded"&&Mp()})),Fs.push(It("load",function(){$e({type:le.Load,data:{}}),qe==="load"&&Mp()},window))),function(){Fs.forEach(function(Ie){return Ie()}),Op.destroy(),Sc=!1,mL()}}catch(Ie){console.warn(Ie)}}Sr.addCustomEvent=function(n,e){if(!Sc)throw new Error("please add custom event after start recording");$e({type:le.Custom,data:{tag:n,payload:e}})},Sr.freezePage=function(){ti.forEach(function(n){return n.freeze()})},Sr.takeFullSnapshot=function(n){if(!Sc)throw new Error("please take full snapshot after start recording");_c(n)},Sr.mirror=fn;var IB;(function(n){n[n.NotStarted=0]="NotStarted",n[n.Running=1]="Running",n[n.Stopped=2]="Stopped"})(IB||(IB={})),Sr.addCustomEvent,Sr.freezePage,Sr.takeFullSnapshot;var FB=V.setImmediate,kr,zh,Xh,xB=Object.prototype.toString,GL=typeof FB<"u"?function(n){return FB(n)}:setTimeout;try{Object.defineProperty({},"x",{}),kr=function(n,e,t,r){return Object.defineProperty(n,e,{value:t,writable:!0,configurable:r!==!1})}}catch{kr=function(n,e,t){return n[e]=t,n}}Xh=function(){var n,e,t;function r(i,A){this.fn=i,this.self=A,this.next=void 0}return{add:function(i,A){t=new r(i,A),e?e.next=t:n=t,e=t,t=void 0},drain:function(){var i=n;for(n=e=zh=void 0;i;)i.fn.call(i.self),i=i.next}}}();function kc(n,e){Xh.add(n,e),zh||(zh=GL(Xh.drain))}function QB(n){var e,t=typeof n;return n!==null&&(t==="object"||t==="function")&&(e=n.then),typeof e=="function"?e:!1}function Yh(){for(var n=0;n<this.chain.length;n++)jL(this,this.state===1?this.chain[n].success:this.chain[n].failure,this.chain[n]);this.chain.length=0}function jL(n,e,t){var r,i;try{e===!1?t.reject(n.msg):(e===!0?r=n.msg:r=e.call(void 0,n.msg),r===t.promise?t.reject(TypeError("Promise-chain cycle")):(i=QB(r))?i.call(r,t.resolve,t.reject):t.resolve(r))}catch(A){t.reject(A)}}function RB(n){var e,t=this;if(!t.triggered){t.triggered=!0,t.def&&(t=t.def);try{(e=QB(n))?kc(function(){var r=new OB(t);try{e.call(n,function(){RB.apply(r,arguments)},function(){ws.apply(r,arguments)})}catch(i){ws.call(r,i)}}):(t.msg=n,t.state=1,t.chain.length>0&&kc(Yh,t))}catch(r){ws.call(new OB(t),r)}}}function ws(n){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=n,e.state=2,e.chain.length>0&&kc(Yh,e))}function PB(n,e,t,r){for(var i=0;i<e.length;i++)(function(A){n.resolve(e[A]).then(function(s){t(A,s)},r)})(i)}function OB(n){this.def=n,this.triggered=!1}function WL(n){this.promise=n,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function Er(n){if(typeof n!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var e=new WL(this);this.then=function(t,r){var i={success:typeof t=="function"?t:!0,failure:typeof r=="function"?r:!1};return i.promise=new this.constructor(function(A,s){if(typeof A!="function"||typeof s!="function")throw TypeError("Not a function");i.resolve=A,i.reject=s}),e.chain.push(i),e.state!==0&&kc(Yh,e),i.promise},this.catch=function(t){return this.then(void 0,t)};try{n.call(void 0,function(t){RB.call(e,t)},function(t){ws.call(e,t)})}catch(t){ws.call(e,t)}}var MB=kr({},"constructor",Er,!1);Er.prototype=MB,kr(MB,"__NPO__",0,!1),kr(Er,"resolve",function(n){var e=this;return n&&typeof n=="object"&&n.__NPO__===1?n:new e(function(t,r){if(typeof t!="function"||typeof r!="function")throw TypeError("Not a function");t(n)})}),kr(Er,"reject",function(n){return new this(function(e,t){if(typeof e!="function"||typeof t!="function")throw TypeError("Not a function");t(n)})}),kr(Er,"all",function(n){var e=this;return xB.call(n)!=="[object Array]"?e.reject(TypeError("Not an array")):n.length===0?e.resolve([]):new e(function(t,r){if(typeof t!="function"||typeof r!="function")throw TypeError("Not a function");var i=n.length,A=Array(i),s=0;PB(e,n,function(o,a){A[o]=a,++s===i&&t(A)},r)})}),kr(Er,"race",function(n){var e=this;return xB.call(n)!=="[object Array]"?e.reject(TypeError("Not an array")):new e(function(t,r){if(typeof t!="function"||typeof r!="function")throw TypeError("Not a function");PB(e,n,function(i,A){t(A)},r)})});var be;typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1?be=Promise:be=Er;var gn={DEBUG:!1,LIB_VERSION:"2.68.0"},bs=24*60*60*1e3,Zh=8*1e3,Ec=Array.prototype,qL=Function.prototype,LB=Object.prototype,ni=Ec.slice,Bs=LB.toString,Uc=LB.hasOwnProperty,ct=V.console,Ur=V.navigator,ye=V.document,Tc=V.opera,DB=V.screen,qn=Ur.userAgent,$h=qL.bind,NB=Ec.forEach,HB=Ec.indexOf,KB=Ec.map,JL=Array.isArray,ep={},m={trim:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},we={log:function(){if(gn.DEBUG&&!m.isUndefined(ct)&&ct)try{ct.log.apply(ct,arguments)}catch{m.each(arguments,function(n){ct.log(n)})}},warn:function(){if(gn.DEBUG&&!m.isUndefined(ct)&&ct){var n=["Mixpanel warning:"].concat(m.toArray(arguments));try{ct.warn.apply(ct,n)}catch{m.each(n,function(e){ct.warn(e)})}}},error:function(){if(gn.DEBUG&&!m.isUndefined(ct)&&ct){var n=["Mixpanel error:"].concat(m.toArray(arguments));try{ct.error.apply(ct,n)}catch{m.each(n,function(e){ct.error(e)})}}},critical:function(){if(!m.isUndefined(ct)&&ct){var n=["Mixpanel error:"].concat(m.toArray(arguments));try{ct.error.apply(ct,n)}catch{m.each(n,function(e){ct.error(e)})}}}},tp=function(n,e){return function(){return arguments[0]="["+e+"] "+arguments[0],n.apply(we,arguments)}},ri=function(n){return{log:tp(we.log,n),error:tp(we.error,n),critical:tp(we.critical,n)}},np=function(n){return function(){try{return n.apply(this,arguments)}catch(e){we.critical("Implementation error. Please turn on debug and contact support@mixpanel.com."),gn.DEBUG&&we.critical(e)}}},VB=function(n){var e=n.prototype;for(var t in e)typeof e[t]=="function"&&(e[t]=np(e[t]))};m.bind=function(n,e){var t,r;if($h&&n.bind===$h)return $h.apply(n,ni.call(arguments,1));if(!m.isFunction(n))throw new TypeError;return t=ni.call(arguments,2),r=function(){if(!(this instanceof r))return n.apply(e,t.concat(ni.call(arguments)));var i={};i.prototype=n.prototype;var A=new i;i.prototype=null;var s=n.apply(A,t.concat(ni.call(arguments)));return Object(s)===s?s:A},r},m.each=function(n,e,t){if(n!=null){if(NB&&n.forEach===NB)n.forEach(e,t);else if(n.length===+n.length){for(var r=0,i=n.length;r<i;r++)if(r in n&&e.call(t,n[r],r,n)===ep)return}else for(var A in n)if(Uc.call(n,A)&&e.call(t,n[A],A,n)===ep)return}},m.extend=function(n){return m.each(ni.call(arguments,1),function(e){for(var t in e)e[t]!==void 0&&(n[t]=e[t])}),n},m.isArray=JL||function(n){return Bs.call(n)==="[object Array]"},m.isFunction=function(n){try{return/^\s*\bfunction\b/.test(n)}catch{return!1}},m.isArguments=function(n){return!!(n&&Uc.call(n,"callee"))},m.toArray=function(n){return n?n.toArray?n.toArray():m.isArray(n)||m.isArguments(n)?ni.call(n):m.values(n):[]},m.map=function(n,e,t){if(KB&&n.map===KB)return n.map(e,t);var r=[];return m.each(n,function(i){r.push(e.call(t,i))}),r},m.keys=function(n){var e=[];return n===null||m.each(n,function(t,r){e[e.length]=r}),e},m.values=function(n){var e=[];return n===null||m.each(n,function(t){e[e.length]=t}),e},m.include=function(n,e){var t=!1;return n===null?t:HB&&n.indexOf===HB?n.indexOf(e)!=-1:(m.each(n,function(r){if(t||(t=r===e))return ep}),t)},m.includes=function(n,e){return n.indexOf(e)!==-1},m.inherit=function(n,e){return n.prototype=new e,n.prototype.constructor=n,n.superclass=e.prototype,n},m.isObject=function(n){return n===Object(n)&&!m.isArray(n)},m.isEmptyObject=function(n){if(m.isObject(n)){for(var e in n)if(Uc.call(n,e))return!1;return!0}return!1},m.isUndefined=function(n){return n===void 0},m.isString=function(n){return Bs.call(n)=="[object String]"},m.isDate=function(n){return Bs.call(n)=="[object Date]"},m.isNumber=function(n){return Bs.call(n)=="[object Number]"},m.isElement=function(n){return!!(n&&n.nodeType===1)},m.encodeDates=function(n){return m.each(n,function(e,t){m.isDate(e)?n[t]=m.formatDate(e):m.isObject(e)&&(n[t]=m.encodeDates(e))}),n},m.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},m.formatDate=function(n){function e(t){return t<10?"0"+t:t}return n.getUTCFullYear()+"-"+e(n.getUTCMonth()+1)+"-"+e(n.getUTCDate())+"T"+e(n.getUTCHours())+":"+e(n.getUTCMinutes())+":"+e(n.getUTCSeconds())},m.strip_empty_properties=function(n){var e={};return m.each(n,function(t,r){m.isString(t)&&t.length>0&&(e[r]=t)}),e},m.truncate=function(n,e){var t;return typeof n=="string"?t=n.slice(0,e):m.isArray(n)?(t=[],m.each(n,function(r){t.push(m.truncate(r,e))})):m.isObject(n)?(t={},m.each(n,function(r,i){t[i]=m.truncate(r,e)})):t=n,t},m.JSONEncode=function(){return function(n){var e=n,t=function(i){var A=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return A.lastIndex=0,A.test(i)?'"'+i.replace(A,function(o){var a=s[o];return typeof a=="string"?a:"\\u"+("0000"+o.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},r=function(i,A){var s="",o=" ",a=0,c="",u="",l=0,d=s,h=[],f=A[i];switch(f&&typeof f=="object"&&typeof f.toJSON=="function"&&(f=f.toJSON(i)),typeof f){case"string":return t(f);case"number":return isFinite(f)?String(f):"null";case"boolean":case"null":return String(f);case"object":if(!f)return"null";if(s+=o,h=[],Bs.apply(f)==="[object Array]"){for(l=f.length,a=0;a<l;a+=1)h[a]=r(a,f)||"null";return u=h.length===0?"[]":s?`[
118
118
  `+s+h.join(`,
119
119
  `+s)+`
120
120
  `+d+"]":"["+h.join(",")+"]",s=d,u}for(c in f)Uc.call(f,c)&&(u=r(c,f),u&&h.push(t(c)+(s?": ":":")+u));return u=h.length===0?"{}":s?"{"+h.join(",")+d+"}":"{"+h.join(",")+"}",s=d,u}};return r("",{"":e})}}(),m.JSONDecode=function(){var n,e,t={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
121
121
  `,r:"\r",t:" "},r,i=function(h){var f=new SyntaxError(h);throw f.at=n,f.text=r,f},A=function(h){return h&&h!==e&&i("Expected '"+h+"' instead of '"+e+"'"),e=r.charAt(n),n+=1,e},s=function(){var h,f="";for(e==="-"&&(f="-",A("-"));e>="0"&&e<="9";)f+=e,A();if(e===".")for(f+=".";A()&&e>="0"&&e<="9";)f+=e;if(e==="e"||e==="E")for(f+=e,A(),(e==="-"||e==="+")&&(f+=e,A());e>="0"&&e<="9";)f+=e,A();if(h=+f,!isFinite(h))i("Bad number");else return h},o=function(){var h,f,p="",g;if(e==='"')for(;A();){if(e==='"')return A(),p;if(e==="\\")if(A(),e==="u"){for(g=0,f=0;f<4&&(h=parseInt(A(),16),!!isFinite(h));f+=1)g=g*16+h;p+=String.fromCharCode(g)}else if(typeof t[e]=="string")p+=t[e];else break;else p+=e}i("Bad string")},a=function(){for(;e&&e<=" ";)A()},c=function(){switch(e){case"t":return A("t"),A("r"),A("u"),A("e"),!0;case"f":return A("f"),A("a"),A("l"),A("s"),A("e"),!1;case"n":return A("n"),A("u"),A("l"),A("l"),null}i('Unexpected "'+e+'"')},u,l=function(){var h=[];if(e==="["){if(A("["),a(),e==="]")return A("]"),h;for(;e;){if(h.push(u()),a(),e==="]")return A("]"),h;A(","),a()}}i("Bad array")},d=function(){var h,f={};if(e==="{"){if(A("{"),a(),e==="}")return A("}"),f;for(;e;){if(h=o(),a(),A(":"),Object.hasOwnProperty.call(f,h)&&i('Duplicate key "'+h+'"'),f[h]=u(),a(),e==="}")return A("}"),f;A(","),a()}}i("Bad object")};return u=function(){switch(a(),e){case"{":return d();case"[":return l();case'"':return o();case"-":return s();default:return e>="0"&&e<="9"?s():c()}},function(h){var f;return r=h,n=0,e=" ",f=u(),a(),e&&i("Syntax error"),f}}(),m.base64Encode=function(n){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",t,r,i,A,s,o,a,c,u=0,l=0,d="",h=[];if(!n)return n;n=m.utf8Encode(n);do t=n.charCodeAt(u++),r=n.charCodeAt(u++),i=n.charCodeAt(u++),c=t<<16|r<<8|i,A=c>>18&63,s=c>>12&63,o=c>>6&63,a=c&63,h[l++]=e.charAt(A)+e.charAt(s)+e.charAt(o)+e.charAt(a);while(u<n.length);switch(d=h.join(""),n.length%3){case 1:d=d.slice(0,-2)+"==";break;case 2:d=d.slice(0,-1)+"=";break}return d},m.utf8Encode=function(n){n=(n+"").replace(/\r\n/g,`
122
122
  `).replace(/\r/g,`
123
- `);var e="",t,r,i=0,A;for(t=r=0,i=n.length,A=0;A<i;A++){var s=n.charCodeAt(A),o=null;s<128?r++:s>127&&s<2048?o=String.fromCharCode(s>>6|192,s&63|128):o=String.fromCharCode(s>>12|224,s>>6&63|128,s&63|128),o!==null&&(r>t&&(e+=n.substring(t,r)),e+=o,t=r=A+1)}return r>t&&(e+=n.substring(t,n.length)),e},m.UUID=function(){try{return V.crypto.randomUUID()}catch{for(var n=new Array(36),e=0;e<36;e++)n[e]=Math.floor(Math.random()*16);return n[14]=4,n[19]=n[19]&=-5,n[19]=n[19]|=8,n[8]=n[13]=n[18]=n[23]="-",m.map(n,function(t){return t.toString(16)}).join("")}};var GB=["ahrefsbot","ahrefssiteaudit","amazonbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandex","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];m.isBlockedUA=function(n){var e;for(n=n.toLowerCase(),e=0;e<GB.length;e++)if(n.indexOf(GB[e])!==-1)return!0;return!1},m.HTTPBuildQuery=function(n,e){var t,r,i=[];return m.isUndefined(e)&&(e="&"),m.each(n,function(A,s){t=encodeURIComponent(A.toString()),r=encodeURIComponent(s),i[i.length]=r+"="+t}),i.join(e)},m.getQueryParam=function(n,e){e=e.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var t="[\\?&]"+e+"=([^&#]*)",r=new RegExp(t),i=r.exec(n);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var A=i[1];try{A=decodeURIComponent(A)}catch{we.error("Skipping decoding for malformed query param: "+A)}return A.replace(/\+/g," ")},m.cookie={get:function(n){for(var e=n+"=",t=ye.cookie.split(";"),r=0;r<t.length;r++){for(var i=t[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}return null},parse:function(n){var e;try{e=m.JSONDecode(m.cookie.get(n))||{}}catch{}return e},set_seconds:function(n,e,t,r,i,A,s){var o="",a="",c="";if(s)o="; domain="+s;else if(r){var u=qB(ye.location.hostname);o=u?"; domain=."+u:""}if(t){var l=new Date;l.setTime(l.getTime()+t*1e3),a="; expires="+l.toGMTString()}A&&(i=!0,c="; SameSite=None"),i&&(c+="; secure"),ye.cookie=n+"="+encodeURIComponent(e)+a+"; path=/"+o+c},set:function(n,e,t,r,i,A,s){var o="",a="",c="";if(s)o="; domain="+s;else if(r){var u=qB(ye.location.hostname);o=u?"; domain=."+u:""}if(t){var l=new Date;l.setTime(l.getTime()+t*24*60*60*1e3),a="; expires="+l.toGMTString()}A&&(i=!0,c="; SameSite=None"),i&&(c+="; secure");var d=n+"="+encodeURIComponent(e)+a+"; path=/"+o+c;return ye.cookie=d,d},remove:function(n,e,t){m.cookie.set(n,"",-1,e,!1,!1,t)}};var jB=function(n){var e=!0;try{var t="__mplss_"+Ap(8),r="xyz";n.setItem(t,r),n.getItem(t)!==r&&(e=!1),n.removeItem(t)}catch{e=!1}return e},rp=null,Cs=function(n,e){return rp!==null&&!e?rp:rp=jB(n||V.localStorage)},ip=null,zL=function(n,e){return ip!==null&&!e?ip:ip=jB(n||V.sessionStorage)};function WB(n,e,t){var r=function(i){we.error(e+" error: "+i)};return{is_supported:function(i){var A=t(n,i);return A||we.error(e+" unsupported"),A},error:r,get:function(i){try{return n.getItem(i)}catch(A){r(A)}return null},parse:function(i){try{return m.JSONDecode(n.getItem(i))||{}}catch{}return null},set:function(i,A){try{n.setItem(i,A)}catch(s){r(s)}},remove:function(i){try{n.removeItem(i)}catch(A){r(A)}}}}m.localStorage=WB(V.localStorage,"localStorage",Cs),m.sessionStorage=WB(V.sessionStorage,"sessionStorage",zL),m.register_event=function(){var n=function(r,i,A,s,o){if(!r){we.error("No valid element provided to register_event");return}if(r.addEventListener&&!s)r.addEventListener(i,A,!!o);else{var a="on"+i,c=r[a];r[a]=e(r,A,c)}};function e(r,i,A){var s=function(o){if(o=o||t(V.event),!!o){var a=!0,c,u;return m.isFunction(A)&&(c=A(o)),u=i.call(r,o),(c===!1||u===!1)&&(a=!1),a}};return s}function t(r){return r&&(r.preventDefault=t.preventDefault,r.stopPropagation=t.stopPropagation),r}return t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0},n}();var XL=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');m.dom_query=function(){function n(i){return i.all?i.all:i.getElementsByTagName("*")}var e=/[\t\r\n]/g;function t(i,A){var s=" "+A+" ";return(" "+i.className+" ").replace(e," ").indexOf(s)>=0}function r(i){if(!ye.getElementsByTagName)return[];var A=i.split(" "),s,o,a,c,u,l,d,h,f,p,g=[ye];for(l=0;l<A.length;l++){if(s=A[l].replace(/^\s+/,"").replace(/\s+$/,""),s.indexOf("#")>-1){o=s.split("#"),a=o[0];var v=o[1],y=ye.getElementById(v);if(!y||a&&y.nodeName.toLowerCase()!=a)return[];g=[y];continue}if(s.indexOf(".")>-1){o=s.split("."),a=o[0];var B=o[1];for(a||(a="*"),c=[],u=0,d=0;d<g.length;d++)for(a=="*"?f=n(g[d]):f=g[d].getElementsByTagName(a),h=0;h<f.length;h++)c[u++]=f[h];for(g=[],p=0,d=0;d<c.length;d++)c[d].className&&m.isString(c[d].className)&&t(c[d],B)&&(g[p++]=c[d]);continue}var b=s.match(XL);if(b){a=b[1];var w=b[2],_=b[3],k=b[4];for(a||(a="*"),c=[],u=0,d=0;d<g.length;d++)for(a=="*"?f=n(g[d]):f=g[d].getElementsByTagName(a),h=0;h<f.length;h++)c[u++]=f[h];g=[],p=0;var F;switch(_){case"=":F=function(x){return x.getAttribute(w)==k};break;case"~":F=function(x){return x.getAttribute(w).match(new RegExp("\\b"+k+"\\b"))};break;case"|":F=function(x){return x.getAttribute(w).match(new RegExp("^"+k+"-?"))};break;case"^":F=function(x){return x.getAttribute(w).indexOf(k)===0};break;case"$":F=function(x){return x.getAttribute(w).lastIndexOf(k)==x.getAttribute(w).length-k.length};break;case"*":F=function(x){return x.getAttribute(w).indexOf(k)>-1};break;default:F=function(x){return x.getAttribute(w)}}for(g=[],p=0,d=0;d<c.length;d++)F(c[d])&&(g[p++]=c[d]);continue}for(a=s,c=[],u=0,d=0;d<g.length;d++)for(f=g[d].getElementsByTagName(a),h=0;h<f.length;h++)c[u++]=f[h];g=c}return g}return function(i){return m.isElement(i)?[i]:m.isObject(i)&&!m.isUndefined(i.length)?i:r.call(this,i)}}();var YL=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],ZL=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];m.info={campaignParams:function(n){var e="",t={};return m.each(YL,function(r){e=m.getQueryParam(ye.URL,r),e.length?t[r]=e:n!==void 0&&(t[r]=n)}),t},clickParams:function(){var n="",e={};return m.each(ZL,function(t){n=m.getQueryParam(ye.URL,t),n.length&&(e[t]=n)}),e},marketingParams:function(){return m.extend(m.info.campaignParams(),m.info.clickParams())},searchEngine:function(n){return n.search("https?://(.*)google.([^/?]*)")===0?"google":n.search("https?://(.*)bing.com")===0?"bing":n.search("https?://(.*)yahoo.com")===0?"yahoo":n.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(n){var e=m.info.searchEngine(n),t=e!="yahoo"?"q":"p",r={};if(e!==null){r.$search_engine=e;var i=m.getQueryParam(n,t);i.length&&(r.mp_keyword=i)}return r},browser:function(n,e,t){return e=e||"",t||m.includes(n," OPR/")?m.includes(n,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":m.includes(n,"IEMobile")||m.includes(n,"WPDesktop")?"Internet Explorer Mobile":m.includes(n,"SamsungBrowser/")?"Samsung Internet":m.includes(n,"Edge")||m.includes(n,"Edg/")?"Microsoft Edge":m.includes(n,"FBIOS")?"Facebook Mobile":m.includes(n,"Whale/")?"Whale Browser":m.includes(n,"Chrome")?"Chrome":m.includes(n,"CriOS")?"Chrome iOS":m.includes(n,"UCWEB")||m.includes(n,"UCBrowser")?"UC Browser":m.includes(n,"FxiOS")?"Firefox iOS":m.includes(e,"Apple")?m.includes(n,"Mobile")?"Mobile Safari":"Safari":m.includes(n,"Android")?"Android Mobile":m.includes(n,"Konqueror")?"Konqueror":m.includes(n,"Firefox")?"Firefox":m.includes(n,"MSIE")||m.includes(n,"Trident/")?"Internet Explorer":m.includes(n,"Gecko")?"Mozilla":""},browserVersion:function(n,e,t){var r=m.info.browser(n,e,t),i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/},A=i[r];if(A===void 0)return null;var s=n.match(A);return s?parseFloat(s[s.length-2]):null},os:function(){var n=qn;return/Windows/i.test(n)?/Phone/.test(n)||/WPDesktop/.test(n)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(n)?"iOS":/Android/.test(n)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":/Mac/i.test(n)?"Mac OS X":/Linux/.test(n)?"Linux":/CrOS/.test(n)?"Chrome OS":""},device:function(n){return/Windows Phone/i.test(n)||/WPDesktop/.test(n)?"Windows Phone":/iPad/.test(n)?"iPad":/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":/Android/.test(n)?"Android":""},referringDomain:function(n){var e=n.split("/");return e.length>=3?e[2]:""},currentUrl:function(){return V.location.href},properties:function(n){return typeof n!="object"&&(n={}),m.extend(m.strip_empty_properties({$os:m.info.os(),$browser:m.info.browser(qn,Ur.vendor,Tc),$referrer:ye.referrer,$referring_domain:m.info.referringDomain(ye.referrer),$device:m.info.device(qn)}),{$current_url:m.info.currentUrl(),$browser_version:m.info.browserVersion(qn,Ur.vendor,Tc),$screen_height:DB.height,$screen_width:DB.width,mp_lib:"web",$lib_version:gn.LIB_VERSION,$insert_id:Ap(),time:m.timestamp()/1e3},m.strip_empty_properties(n))},people_properties:function(){return m.extend(m.strip_empty_properties({$os:m.info.os(),$browser:m.info.browser(qn,Ur.vendor,Tc)}),{$browser_version:m.info.browserVersion(qn,Ur.vendor,Tc)})},mpPageViewProperties:function(){return m.strip_empty_properties({current_page_title:ye.title,current_domain:V.location.hostname,current_url_path:V.location.pathname,current_url_protocol:V.location.protocol,current_url_search:V.location.search})}};var $L=function(n,e){var t=null,r=[];return function(i){var A=this;return r.push(i),t||(t=new be(function(s){setTimeout(function(){var o=n.apply(A,[r]);t=null,r=[],s(o)},e)})),t}},Ap=function(n){var e=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return n?e.substring(0,n):e},eD=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,tD=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,qB=function(n){var e=tD,t=n.split("."),r=t[t.length-1];(r.length>4||r==="com"||r==="org")&&(e=eD);var i=n.match(e);return i?i[0]:""},nD=function(){var n=V.navigator.onLine;return m.isUndefined(n)||n},Tr=function(){},tA=null,Ic=null;typeof JSON<"u"&&(tA=JSON.stringify,Ic=JSON.parse),tA=tA||m.JSONEncode,Ic=Ic||m.JSONDecode,m.info=m.info,m.info.browser=m.info.browser,m.info.browserVersion=m.info.browserVersion,m.info.device=m.info.device,m.info.properties=m.info.properties,m.isBlockedUA=m.isBlockedUA,m.isEmptyObject=m.isEmptyObject,m.isObject=m.isObject,m.JSONDecode=m.JSONDecode,m.JSONEncode=m.JSONEncode,m.toArray=m.toArray,m.NPO=Er;var rD="mixpanelBrowserDb",JB="mixpanelRecordingEvents",sp="mixpanelRecordingRegistry",iD=1,AD=[JB,sp],In=function(n){this.dbPromise=null,this.storeName=n};In.prototype._openDb=function(){return new be(function(n,e){var t=V.indexedDB.open(rD,iD);t.onerror=function(){e(t.error)},t.onsuccess=function(){n(t.result)},t.onupgradeneeded=function(r){var i=r.target.result;AD.forEach(function(A){i.createObjectStore(A)})}})},In.prototype.init=function(){return V.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(n){return n instanceof V.IDBDatabase?be.resolve():be.reject(n)})):be.reject("indexedDB is not supported in this browser")},In.prototype.makeTransaction=function(n,e){var t=this.storeName,r=function(i){return new be(function(A,s){var o=i.transaction(t,n);o.oncomplete=function(){A(o)},o.onabort=o.onerror=function(){s(o.error)},e(o.objectStore(t))})};return this.dbPromise.then(r).catch((function(i){return i&&i.name==="InvalidStateError"?(this.dbPromise=this._openDb(),this.dbPromise.then(r)):be.reject(i)}).bind(this))},In.prototype.setItem=function(n,e){return this.makeTransaction("readwrite",function(t){t.put(e,n)})},In.prototype.getItem=function(n){var e;return this.makeTransaction("readonly",function(t){e=t.get(n)}).then(function(){return e.result})},In.prototype.removeItem=function(n){return this.makeTransaction("readwrite",function(e){e.delete(n)})},In.prototype.getAll=function(){var n;return this.makeTransaction("readonly",function(e){n=e.getAll()}).then(function(){return n.result})};var sD="__mp_opt_in_out_";function oD(n,e){YB(!0,n,e)}function aD(n,e){YB(!1,n,e)}function cD(n,e){return XB(n,e)==="1"}function zB(n,e){if(lD(e))return we.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var t=XB(n,e)==="0";return t&&we.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),t}function Ir(n){return cp(n,function(e){return this.get_config(e)})}function Fr(n){return cp(n,function(e){return this._get_config(e)})}function nA(n){return cp(n,function(e){return this._get_config(e)})}function uD(n,e){e=e||{},op(e).remove(ap(n,e),!!e.crossSubdomainCookie,e.cookieDomain)}function op(n){return n=n||{},n.persistenceType==="localStorage"?m.localStorage:m.cookie}function ap(n,e){return e=e||{},(e.persistencePrefix||sD)+n}function XB(n,e){return op(e).get(ap(n,e))}function lD(n){if(n&&n.ignoreDnt)return!1;var e=n&&n.window||V,t=e.navigator||{},r=!1;return m.each([t.doNotTrack,t.msDoNotTrack,e.doNotTrack],function(i){m.includes([!0,1,"1","yes"],i)&&(r=!0)}),r}function YB(n,e,t){if(!m.isString(e)||!e.length){we.error("gdpr."+(n?"optIn":"optOut")+" called with an invalid token");return}t=t||{},op(t).set(ap(e,t),n?1:0,m.isNumber(t.cookieExpiration)?t.cookieExpiration:null,!!t.crossSubdomainCookie,!!t.secureCookie,!!t.crossSiteCookie,t.cookieDomain),t.track&&n&&t.track(t.trackEventName||"$opt_in",t.trackProperties,{send_immediately:!0})}function cp(n,e){return function(){var t=!1;try{var r=e.call(this,"token"),i=e.call(this,"ignore_dnt"),A=e.call(this,"opt_out_tracking_persistence_type"),s=e.call(this,"opt_out_tracking_cookie_prefix"),o=e.call(this,"window");r&&(t=zB(r,{ignoreDnt:i,persistenceType:A,persistencePrefix:s,window:o}))}catch(c){we.error("Unexpected error when checking tracking opt-out status: "+c)}if(!t)return n.apply(this,arguments);var a=arguments[arguments.length-1];typeof a=="function"&&a(0)}}var dD=ri("lock"),ZB=function(n,e){e=e||{},this.storageKey=n,this.storage=e.storage||V.localStorage,this.pollIntervalMS=e.pollIntervalMS||100,this.timeoutMS=e.timeoutMS||2e3,this.promiseImpl=e.promiseImpl||be};ZB.prototype.withLock=function(n,e){var t=this.promiseImpl;return new t(m.bind(function(r,i){var A=e||new Date().getTime()+"|"+Math.random(),s=new Date().getTime(),o=this.storageKey,a=this.pollIntervalMS,c=this.timeoutMS,u=this.storage,l=o+":X",d=o+":Y",h=o+":Z",f=function(B){if(new Date().getTime()-s>c){dD.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+A+"]"),u.removeItem(h),u.removeItem(d),v();return}setTimeout(function(){try{B()}catch(b){i(b)}},a*(Math.random()+.1))},p=function(B,b){B()?b():f(function(){p(B,b)})},g=function(){var B=u.getItem(d);return B&&B!==A?!1:(u.setItem(d,A),u.getItem(d)===A?!0:(Cs(u,!0)||i(new Error("localStorage support dropped while acquiring lock")),!1))},v=function(){u.setItem(l,A),p(g,function(){if(u.getItem(l)===A){y();return}f(function(){if(u.getItem(d)!==A){v();return}p(function(){return!u.getItem(h)},y)})})},y=function(){u.setItem(h,"1");var B=function(){u.removeItem(h),u.getItem(d)===A&&u.removeItem(d),u.getItem(l)===A&&u.removeItem(l)};n().then(function(b){B(),r(b)}).catch(function(b){B(),i(b)})};try{if(Cs(u,!0))v();else throw new Error("localStorage support check failed")}catch(B){i(B)}},this))};var _s=function(n){this.storage=n||V.localStorage};_s.prototype.init=function(){return be.resolve()},_s.prototype.setItem=function(n,e){return new be(m.bind(function(t,r){try{this.storage.setItem(n,tA(e))}catch(i){r(i)}t()},this))},_s.prototype.getItem=function(n){return new be(m.bind(function(e,t){var r;try{r=Ic(this.storage.getItem(n))}catch(i){t(i)}e(r)},this))},_s.prototype.removeItem=function(n){return new be(m.bind(function(e,t){try{this.storage.removeItem(n)}catch(r){t(r)}e()},this))};var $B=ri("batch"),Fn=function(n,e){e=e||{},this.storageKey=n,this.usePersistence=e.usePersistence,this.usePersistence&&(this.queueStorage=e.queueStorage||new _s,this.lock=new ZB(n,{storage:e.sharedLockStorage||V.localStorage,timeoutMS:e.sharedLockTimeoutMS})),this.reportError=e.errorReporter||m.bind($B.error,$B),this.pid=e.pid||null,this.memQueue=[],this.initialized=!1,e.enqueueThrottleMs?this.enqueuePersisted=$L(m.bind(this._enqueuePersisted,this),e.enqueueThrottleMs):this.enqueuePersisted=m.bind(function(t){return this._enqueuePersisted([t])},this)};Fn.prototype.ensureInit=function(){return this.initialized?be.resolve():this.queueStorage.init().then(m.bind(function(){this.initialized=!0},this)).catch(m.bind(function(n){this.reportError("Error initializing queue persistence. Disabling persistence",n),this.initialized=!0,this.usePersistence=!1},this))},Fn.prototype.enqueue=function(n,e){var t={id:Ap(),flushAfter:new Date().getTime()+e*2,payload:n};return this.usePersistence?this.enqueuePersisted(t):(this.memQueue.push(t),be.resolve(!0))},Fn.prototype._enqueuePersisted=function(n){var e=m.bind(function(){return this.ensureInit().then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(t){return this.saveToStorage(t.concat(n))},this)).then(m.bind(function(t){return t&&(this.memQueue=this.memQueue.concat(n)),t},this)).catch(m.bind(function(t){return this.reportError("Error enqueueing items",t,n),!1},this))},this);return this.lock.withLock(e,this.pid).catch(m.bind(function(t){return this.reportError("Error acquiring storage lock",t),!1},this))},Fn.prototype.fillBatch=function(n){var e=this.memQueue.slice(0,n);return this.usePersistence&&e.length<n?this.ensureInit().then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(t){if(t.length){var r={};m.each(e,function(s){r[s.id]=!0});for(var i=0;i<t.length;i++){var A=t[i];if(new Date().getTime()>A.flushAfter&&!r[A.id]&&(A.orphaned=!0,e.push(A),e.length>=n))break}}return e},this)):be.resolve(e)};var eC=function(n,e){var t=[];return m.each(n,function(r){r.id&&!e[r.id]&&t.push(r)}),t};Fn.prototype.removeItemsByID=function(n){var e={};if(m.each(n,function(r){e[r]=!0}),this.memQueue=eC(this.memQueue,e),this.usePersistence){var t=m.bind(function(){return this.ensureInit().then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(r){return r=eC(r,e),this.saveToStorage(r)},this)).then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(r){for(var i=0;i<r.length;i++){var A=r[i];if(A.id&&e[A.id])throw new Error("Item not removed from storage")}return!0},this)).catch(m.bind(function(r){return this.reportError("Error removing items",r,n),!1},this))},this);return this.lock.withLock(t,this.pid).catch(m.bind(function(r){return this.reportError("Error acquiring storage lock",r),Cs(this.lock.storage,!0)?!1:t().then(m.bind(function(i){return i||this.queueStorage.removeItem(this.storageKey).then(function(){return i})},this)).catch(m.bind(function(i){return this.reportError("Error clearing queue",i),!1},this))},this))}else return be.resolve(!0)};var tC=function(n,e){var t=[];return m.each(n,function(r){var i=r.id;if(i in e){var A=e[i];A!==null&&(r.payload=A,t.push(r))}else t.push(r)}),t};Fn.prototype.updatePayloads=function(n){return this.memQueue=tC(this.memQueue,n),this.usePersistence?this.lock.withLock(m.bind(function(){return this.ensureInit().then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(e){return e=tC(e,n),this.saveToStorage(e)},this)).catch(m.bind(function(e){return this.reportError("Error updating items",n,e),!1},this))},this),this.pid).catch(m.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this)):be.resolve(!0)},Fn.prototype.readFromStorage=function(){return this.ensureInit().then(m.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(m.bind(function(n){return n&&(m.isArray(n)||(this.reportError("Invalid storage entry:",n),n=null)),n||[]},this)).catch(m.bind(function(n){return this.reportError("Error retrieving queue",n),[]},this))},Fn.prototype.saveToStorage=function(n){return this.ensureInit().then(m.bind(function(){return this.queueStorage.setItem(this.storageKey,n)},this)).then(function(){return!0}).catch(m.bind(function(e){return this.reportError("Error saving queue",e),!1},this))},Fn.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(m.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):be.resolve()};var hD=10*60*1e3,Ss=ri("batch"),$t=function(n,e){this.errorReporter=e.errorReporter,this.queue=new Fn(n,{errorReporter:m.bind(this.reportError,this),queueStorage:e.queueStorage,sharedLockStorage:e.sharedLockStorage,sharedLockTimeoutMS:e.sharedLockTimeoutMS,usePersistence:e.usePersistence,enqueueThrottleMs:e.enqueueThrottleMs}),this.libConfig=e.libConfig,this.sendRequest=e.sendRequestFunc,this.beforeSendHook=e.beforeSendHook,this.stopAllBatching=e.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=e.flushOnlyOnInterval||!1,this._flushPromise=null};$t.prototype.enqueue=function(n){return this.queue.enqueue(n,this.flushInterval)},$t.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},$t.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},$t.prototype.clear=function(){return this.queue.clear()},$t.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},$t.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},$t.prototype.scheduleFlush=function(n){this.flushInterval=n,this.stopped||(this.timeoutID=setTimeout(m.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))},$t.prototype.sendRequestPromise=function(n,e){return new be(m.bind(function(t){this.sendRequest(n,e,t)},this))},$t.prototype.flush=function(n){if(this.requestInProgress)return Ss.log("Flush: Request already in progress"),be.resolve();this.requestInProgress=!0,n=n||{};var e=this.libConfig.batch_request_timeout_ms,t=new Date().getTime(),r=this.batchSize;return this.queue.fillBatch(r).then(m.bind(function(i){var A=i.length===r,s=[],o={};if(m.each(i,function(l){var d=l.payload;if(this.beforeSendHook&&!l.orphaned&&(d=this.beforeSendHook(d)),d){d.event&&d.properties&&(d.properties=m.extend({},d.properties,{mp_sent_by_lib_version:gn.LIB_VERSION}));var h=!0,f=l.id;f?(this.itemIdsSentSuccessfully[f]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:l,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[f]}),h=!1):this.reportError("[dupe] found item with no ID",{item:l}),h&&s.push(d)}o[l.id]=d},this),s.length<1)return this.requestInProgress=!1,this.resetFlush(),be.resolve();var a=m.bind(function(){return this.queue.removeItemsByID(m.map(i,function(l){return l.id})).then(m.bind(function(l){return m.each(i,m.bind(function(d){var h=d.id;h?(this.itemIdsSentSuccessfully[h]=this.itemIdsSentSuccessfully[h]||0,this.itemIdsSentSuccessfully[h]++,this.itemIdsSentSuccessfully[h]>5&&this.reportError("[dupe] item ID sent too many times",{item:d,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[h]})):this.reportError("[dupe] found item with no ID while removing",{item:d})},this)),l?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!A?(this.resetFlush(),be.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),be.resolve())},this))},this),c=m.bind(function(l){this.requestInProgress=!1;try{if(n.unloading)return this.queue.updatePayloads(o);if(m.isObject(l)&&l.error==="timeout"&&new Date().getTime()-t>=e)return this.reportError("Network timeout; retrying"),this.flush();if(m.isObject(l)&&(l.httpStatusCode>=500||l.httpStatusCode===429||l.httpStatusCode<=0&&!nD()||l.error==="timeout")){var d=this.flushInterval*2;return l.retryAfter&&(d=parseInt(l.retryAfter,10)*1e3||d),d=Math.min(hD,d),this.reportError("Error; retry in "+d+" ms"),this.scheduleFlush(d),be.resolve()}else if(m.isObject(l)&&l.httpStatusCode===413)if(i.length>1){var h=Math.max(1,Math.floor(r/2));return this.batchSize=Math.min(this.batchSize,h,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),be.resolve()}else return this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),a();else return a()}catch(f){this.reportError("Error handling API response",f),this.resetFlush()}},this),u={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:e};return n.unloading&&(u.transport="sendBeacon"),Ss.log("MIXPANEL REQUEST:",s),this.sendRequestPromise(s,u).then(c)},this)).catch(m.bind(function(i){this.reportError("Error flushing request queue",i),this.resetFlush()},this))},$t.prototype.reportError=function(n,e){if(Ss.error.apply(Ss.error,arguments),this.errorReporter)try{e instanceof Error||(e=new Error(n)),this.errorReporter(n,e)}catch(t){Ss.error(t)}};var up=function(n){var e=Date.now();return!n||e>n.maxExpires||e>n.idleExpires},pD=250,rA=ri("recorder"),nC=V.CompressionStream,fD={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},gD=new Set([z.MouseMove,z.MouseInteraction,z.Scroll,z.ViewportResize,z.Input,z.TouchMove,z.MediaInteraction,z.Drag,z.Selection]);function mD(n){return n.type===le.IncrementalSnapshot&&gD.has(n.data.source)}var Bt=function(n){this._mixpanel=n.mixpanelInstance,this._onIdleTimeout=n.onIdleTimeout||Tr,this._onMaxLengthReached=n.onMaxLengthReached||Tr,this._onBatchSent=n.onBatchSent||Tr,this._rrwebRecord=n.rrwebRecord||null,this._stopRecording=null,this.replayId=n.replayId,this.batchStartUrl=n.batchStartUrl||null,this.replayStartUrl=n.replayStartUrl||null,this.idleExpires=n.idleExpires||null,this.maxExpires=n.maxExpires||null,this.replayStartTime=n.replayStartTime||null,this.seqNo=n.seqNo||0,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=bs,this.recordMinMs=0;var e=Cs(n.sharedLockStorage,!0);this.batcherKey="__mprec_"+this.getConfig("name")+"_"+this.getConfig("token")+"_"+this.replayId,this.queueStorage=new In(JB),this.batcher=new $t(this.batcherKey,{errorReporter:this.reportError.bind(this),flushOnlyOnInterval:!0,libConfig:fD,sendRequestFunc:this.flushEventsWithOptOut.bind(this),queueStorage:this.queueStorage,sharedLockStorage:n.sharedLockStorage,usePersistence:e,stopAllBatchingFunc:this.stopRecording.bind(this),enqueueThrottleMs:pD,sharedLockTimeoutMS:10*1e3})};Bt.prototype.getUserIdInfo=function(){if(this.finalFlushUserIdInfo)return this.finalFlushUserIdInfo;var n={distinct_id:String(this._mixpanel.get_distinct_id())},e=this._mixpanel.get_property("$device_id");e&&(n.$device_id=e);var t=this._mixpanel.get_property("$user_id");return t&&(n.$user_id=t),n},Bt.prototype.unloadPersistedData=function(){return this.batcher.stop(),this.batcher.flush().then((function(){return this.queueStorage.removeItem(this.batcherKey)}).bind(this))},Bt.prototype.getConfig=function(n){return this._mixpanel.get_config(n)},Bt.prototype.get_config=function(n){return this.getConfig(n)},Bt.prototype.startRecording=function(n){if(this._rrwebRecord===null){this.reportError("rrweb record function not provided. ");return}if(this._stopRecording!==null){rA.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>bs&&(this.recordMaxMs=bs,rA.critical("record_max_ms cannot be greater than "+bs+"ms. Capping value.")),this.maxExpires||(this.maxExpires=new Date().getTime()+this.recordMaxMs),this.recordMinMs=this.getConfig("record_min_ms"),this.recordMinMs>Zh&&(this.recordMinMs=Zh,rA.critical("record_min_ms cannot be greater than "+Zh+"ms. Capping value.")),this.replayStartTime||(this.replayStartTime=new Date().getTime(),this.batchStartUrl=m.info.currentUrl(),this.replayStartUrl=m.info.currentUrl()),n||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var e=(function(){clearTimeout(this.idleTimeoutId);var i=this.getConfig("record_idle_timeout_ms");this.idleTimeoutId=setTimeout(this._onIdleTimeout,i),this.idleExpires=new Date().getTime()+i}).bind(this);e();var t=this.getConfig("record_block_selector");(t===""||t===null)&&(t=void 0);try{this._stopRecording=this._rrwebRecord({emit:(function(i){if(this.idleExpires&&this.idleExpires<i.timestamp){this._onIdleTimeout();return}mD(i)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),e()),this.__enqueuePromise=this.batcher.enqueue(i)}).bind(this),blockClass:this.getConfig("record_block_class"),blockSelector:t,collectFonts:this.getConfig("record_collect_fonts"),dataURLOptions:{type:"image/webp",quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector"),recordCanvas:this.getConfig("record_canvas"),sampling:{canvas:15}})}catch(i){this.reportError("Unexpected error when starting rrweb recording.",i)}if(typeof this._stopRecording!="function"){this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,this.stopRecording();return}var r=this.maxExpires-new Date().getTime();this.maxTimeoutId=setTimeout(this._onMaxLengthReached.bind(this),r)},Bt.prototype.stopRecording=function(n){if(this.finalFlushUserIdInfo=this.getUserIdInfo(),!this.isRrwebStopped()){try{this._stopRecording()}catch(t){this.reportError("Error with rrweb stopRecording",t)}this._stopRecording=null}var e;return this.batcher.stopped?e=this.batcher.clear():n||(e=this.batcher.flush()),this.batcher.stop(),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId),e},Bt.prototype.isRrwebStopped=function(){return this._stopRecording===null},Bt.prototype.flushEventsWithOptOut=function(n,e,t){var r=(function(i){i===0&&(this.stopRecording(),t({error:"Tracking has been opted out, stopping recording."}))}).bind(this);this._flushEvents(n,e,t,r)},Bt.prototype.serialize=function(){var n;try{n=this._mixpanel.get_tab_id()}catch(e){this.reportError("Error getting tab ID for serialization ",e),n=null}return{replayId:this.replayId,seqNo:this.seqNo,replayStartTime:this.replayStartTime,batchStartUrl:this.batchStartUrl,replayStartUrl:this.replayStartUrl,idleExpires:this.idleExpires,maxExpires:this.maxExpires,tabId:n}},Bt.deserialize=function(n,e){var t=new Bt(m.extend({},e,{replayId:n.replayId,batchStartUrl:n.batchStartUrl,replayStartUrl:n.replayStartUrl,idleExpires:n.idleExpires,maxExpires:n.maxExpires,replayStartTime:n.replayStartTime,seqNo:n.seqNo,sharedLockStorage:e.sharedLockStorage}));return t},Bt.prototype._sendRequest=function(n,e,t,r){var i=(function(s,o){s.status===200&&this.replayId===n&&(this.seqNo++,this.batchStartUrl=m.info.currentUrl()),this._onBatchSent(),r({status:0,httpStatusCode:s.status,responseBody:o,retryAfter:s.headers.get("Retry-After")})}).bind(this),A=this._mixpanel.get_api_host&&this._mixpanel.get_api_host("record")||this.getConfig("api_host");V.fetch(A+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(e),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:t}).then(function(s){s.json().then(function(o){i(s,o)}).catch(function(o){r({error:o})})}).catch(function(s){r({error:s,httpStatusCode:0})})},Bt.prototype._flushEvents=Ir(function(n,e,t){var r=n.length;if(r>0){for(var i=this.replayId,A=1/0,s=-1/0,o=!1,a=0;a<r;a++)A=Math.min(A,n[a].timestamp),s=Math.max(s,n[a].timestamp),n[a].type===le.FullSnapshot&&(o=!0);if(this.seqNo===0){if(!o){t({error:"First batch does not contain a full snapshot. Aborting recording."}),this.stopRecording(!0);return}this.replayStartTime=A}else this.replayStartTime||(this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=A);var c=s-this.replayStartTime,u={$current_url:this.batchStartUrl,$lib_version:gn.LIB_VERSION,batch_start_time:A/1e3,mp_lib:"web",replay_id:i,replay_length_ms:c,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},l=JSON.stringify(n);if(Object.assign(u,this.getUserIdInfo()),nC){var d=new Blob([l],{type:"application/json"}).stream(),h=d.pipeThrough(new nC("gzip"));new Response(h).blob().then((function(f){u.format="gzip",this._sendRequest(i,u,f,t)}).bind(this))}else u.format="body",this._sendRequest(i,u,l,t)}}),Bt.prototype.reportError=function(n,e){rA.error.apply(rA.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.getConfig("error_reporter")(n,e)}catch(t){rA.error(t)}};var iA=function(n){this.idb=new In(sp),this.errorReporter=n.errorReporter,this.mixpanelInstance=n.mixpanelInstance,this.sharedLockStorage=n.sharedLockStorage};iA.prototype.handleError=function(n){this.errorReporter("IndexedDB error: ",n)},iA.prototype.setActiveRecording=function(n){var e=n.tabId;return e?this.idb.init().then((function(){return this.idb.setItem(e,n)}).bind(this)).catch(this.handleError.bind(this)):(console.warn("No tab ID is set, cannot persist recording metadata."),be.resolve())},iA.prototype.getActiveRecording=function(){return this.idb.init().then((function(){return this.idb.getItem(this.mixpanelInstance.get_tab_id())}).bind(this)).then((function(n){return up(n)?null:n}).bind(this)).catch(this.handleError.bind(this))},iA.prototype.clearActiveRecording=function(){return this.getActiveRecording().then((function(n){if(n)return n.maxExpires=0,this.setActiveRecording(n)}).bind(this)).catch(this.handleError.bind(this))},iA.prototype.flushInactiveRecordings=function(){return this.idb.init().then((function(){return this.idb.getAll()}).bind(this)).then((function(n){var e=n.filter(function(t){return up(t)}).map((function(t){var r=Bt.deserialize(t,{mixpanelInstance:this.mixpanelInstance,sharedLockStorage:this.sharedLockStorage});return r.unloadPersistedData().then((function(){return this.idb.removeItem(t.tabId)}).bind(this)).catch(this.handleError.bind(this))}).bind(this));return be.all(e)}).bind(this)).catch(this.handleError.bind(this))};var ks=ri("recorder"),Jn=function(n,e,t){this.mixpanelInstance=n,this.rrwebRecord=e||Sr,this.sharedLockStorage=t,this.recordingRegistry=new iA({mixpanelInstance:this.mixpanelInstance,errorReporter:ks.error,sharedLockStorage:t}),this._flushInactivePromise=this.recordingRegistry.flushInactiveRecordings(),this.activeRecording=null,this.stopRecordingInProgress=!1};Jn.prototype.startRecording=function(n){if(n=n||{},this.activeRecording&&!this.activeRecording.isRrwebStopped()){ks.log("Recording already in progress, skipping startRecording.");return}var e=(function(){ks.log("Idle timeout reached, restarting recording."),this.resetRecording()}).bind(this),t=(function(){ks.log("Max recording length reached, stopping recording."),this.resetRecording()}).bind(this),r=(function(){this.recordingRegistry.setActiveRecording(this.activeRecording.serialize()),this.__flushPromise=this.activeRecording.batcher._flushPromise}).bind(this),i={mixpanelInstance:this.mixpanelInstance,onBatchSent:r,onIdleTimeout:e,onMaxLengthReached:t,replayId:m.UUID(),rrwebRecord:this.rrwebRecord,sharedLockStorage:this.sharedLockStorage};return n.activeSerializedRecording?this.activeRecording=Bt.deserialize(n.activeSerializedRecording,i):this.activeRecording=new Bt(i),this.activeRecording.startRecording(n.shouldStopBatcher),this.recordingRegistry.setActiveRecording(this.activeRecording.serialize())},Jn.prototype.stopRecording=function(){return this.stopRecordingInProgress=!0,this._stopCurrentRecording(!1,!0).then((function(){return this.recordingRegistry.clearActiveRecording()}).bind(this)).then((function(){this.stopRecordingInProgress=!1}).bind(this))},Jn.prototype.pauseRecording=function(){return this._stopCurrentRecording(!1)},Jn.prototype._stopCurrentRecording=function(n,e){if(this.activeRecording){var t=this.activeRecording.stopRecording(n);return e&&(this.activeRecording=null),t}return be.resolve()},Jn.prototype.resumeRecording=function(n){return this.activeRecording&&this.activeRecording.isRrwebStopped()?(this.activeRecording.startRecording(!1),be.resolve(null)):this.recordingRegistry.getActiveRecording().then((function(e){return e&&!this.stopRecordingInProgress?this.startRecording({activeSerializedRecording:e}):n?this.startRecording({shouldStopBatcher:!1}):(ks.log("No resumable recording found."),null)}).bind(this))},Jn.prototype.resetRecording=function(){this.stopRecording(),this.startRecording({shouldStopBatcher:!0})},Jn.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(Jn.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),V.__mp_recorder=Jn;var Fc="change",ii="click",rC="hashchange",AA="mp_locationchange",iC="popstate",AC="scrollend",lp="submit",vD=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],sC=["mp-include"],dp=["mp-no-track"],oC=dp.concat(["mp-sensitive"]),yD=["aria-label","aria-labelledby","aria-describedby","href","name","role","title","type"],xt=ri("autocapture");function hp(n){for(var e={},t=aC(n).split(" "),r=0;r<t.length;r++){var i=t[r];i&&(e[i]=!0)}return e}function aC(n){switch(typeof n.className){case"string":return n.className;case"object":return n.className.baseVal||n.getAttribute("class")||"";default:return""}}function wD(n){if(n.previousElementSibling)return n.previousElementSibling;do n=n.previousSibling;while(n&&!lC(n));return n}function cC(n,e,t,r,i,A){var s={$classes:aC(n).split(" "),$tag_name:n.tagName.toLowerCase()},o=n.id;o&&(s.$id=o),gp(n,e,i,A)&&m.each(yD.concat(r),function(l){if(n.hasAttribute(l)&&!t[l]){var d=n.getAttribute(l);xc(d)&&(s["$attr-"+l]=d)}});for(var a=1,c=1,u=n;u=wD(u);)a++,u.tagName===n.tagName&&c++;return s.$nth_child=a,s.$nth_of_type=c,s}function bD(n,e){var t=e.allowElementCallback,r=e.allowSelectors||[],i=e.blockAttrs||[],A=e.blockElementCallback,s=e.blockSelectors||[],o=e.captureTextContent||!1,a=e.captureExtraAttrs||[],c=e.capturedForHeatMap||!1,u={};m.each(i,function(w){u[w]=!0});var l=null,d=typeof n.target>"u"?n.srcElement:n.target;if(dC(d)&&(d=d.parentNode),_D(d,n)&&pp(d,n,t,r)&&!fp(d,n,A,s)){for(var h=[d],f=d;f.parentNode&&!xn(f,"body");)h.push(f.parentNode),f=f.parentNode;var p=[],g,v=!1;if(m.each(h,function(w){var _=gp(w,n,t,r);!u.href&&w.tagName.toLowerCase()==="a"&&(g=w.getAttribute("href"),g=_&&xc(g)&&g),fp(w,n,A,s)&&(v=!0),p.push(cC(w,n,u,a,t,r))},this),!v){var y=ye.documentElement;if(l={$event_type:n.type,$host:V.location.host,$pathname:V.location.pathname,$elements:p,$el_attr__href:g,$viewportHeight:Math.max(y.clientHeight,V.innerHeight||0),$viewportWidth:Math.max(y.clientWidth,V.innerWidth||0),$pageHeight:ye.body.offsetHeight||0,$pageWidth:ye.body.offsetWidth||0},m.each(a,function(w){if(!u[w]&&d.hasAttribute(w)){var _=d.getAttribute(w);xc(_)&&(l["$el_attr__"+w]=_)}}),o&&(B=uC(d,n,t,r),B&&B.length&&(l.$el_text=B)),n.type===ii&&(m.each(vD,function(w){w in n&&(l["$"+w]=n[w])}),c&&(l.$captured_for_heatmap=!0),d=BD(n)),o){var B=uC(d,n,t,r);B&&B.length&&(l.$el_text=B)}if(d){if(!pp(d,n,t,r)||fp(d,n,A,s))return null;var b=cC(d,n,u,a,t,r);l.$target=b,l.$el_classes=b.$classes,m.extend(l,m.strip_empty_properties({$el_id:b.$id,$el_tag_name:b.$tag_name}))}}}return l}function uC(n,e,t,r){var i="";return gp(n,e,t,r)&&n.childNodes&&n.childNodes.length&&m.each(n.childNodes,function(A){dC(A)&&A.textContent&&(i+=m.trim(A.textContent).split(/(\s+)/).filter(xc).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),m.trim(i)}function BD(n){for(var e=n.target,t=n.composedPath(),r=0;r<t.length;r++){var i=t[r];if(xn(i,"a")||xn(i,"button")||xn(i,"input")||xn(i,"select")||i.getAttribute&&i.getAttribute("role")==="button"){e=i;break}if(i===e)break}return e}function pp(n,e,t,r){if(t)try{if(!t(n,e))return!1}catch(s){return xt.critical("Error while checking element in allowElementCallback",s),!1}if(!r.length)return!0;for(var i=0;i<r.length;i++){var A=r[i];try{if(n.matches(A))return!0}catch(s){xt.critical("Error while checking selector: "+A,s)}}return!1}function fp(n,e,t,r){var i;if(t)try{if(t(n,e))return!0}catch(o){return xt.critical("Error while checking element in blockElementCallback",o),!0}if(r&&r.length)for(i=0;i<r.length;i++){var A=r[i];try{if(n.matches(A))return!0}catch(o){xt.critical("Error while checking selector: "+A,o)}}var s=hp(n);for(i=0;i<dp.length;i++)if(s[dp[i]])return!0;return!1}function lC(n){return n&&n.nodeType===1}function xn(n,e){return n&&n.tagName&&n.tagName.toLowerCase()===e.toLowerCase()}function dC(n){return n&&n.nodeType===3}function CD(){try{var n=ye.createElement("div");return!!n.matches}catch{return!1}}function _D(n,e){if(!n||xn(n,"html")||!lC(n))return!1;var t=n.tagName.toLowerCase();switch(t){case"form":return e.type===lp;case"input":return["button","submit"].indexOf(n.getAttribute("type"))===-1?e.type===Fc:e.type===ii;case"select":case"textarea":return e.type===Fc;default:return e.type===ii}}function gp(n,e,t,r){var i;if(!pp(n,e,t,r))return!1;for(var A=n;A.parentNode&&!xn(A,"body");A=A.parentNode){var s=hp(A);for(i=0;i<oC.length;i++)if(s[oC[i]])return!1}var o=hp(n);for(i=0;i<sC.length;i++)if(o[sC[i]])return!0;if(xn(n,"input")||xn(n,"select")||xn(n,"textarea")||n.getAttribute("contenteditable")==="true")return!1;var a=n.type||"";if(typeof a=="string")switch(a.toLowerCase()){case"hidden":return!1;case"password":return!1}var c=n.name||n.id||"";if(typeof c=="string"){var u=/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i;if(u.test(c.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function xc(n){if(n===null||m.isUndefined(n))return!1;if(typeof n=="string"){n=m.trim(n);var e=/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/;if(e.test((n||"").replace(/[- ]/g,"")))return!1;var t=/(^\d{3}-?\d{2}-?\d{4}$)/;if(t.test(n))return!1}return!0}var SD=30,kD=1e3,ED=4;function hC(){this.clicks=[]}hC.prototype.isRageClick=function(n,e,t){t=t||{};var r=t.threshold_px||SD,i=t.timeout_ms||kD,A=t.click_count||ED,s=Date.now(),o=this.clicks[this.clicks.length-1];if(o&&s-o.timestamp<i&&Math.sqrt(Math.pow(n-o.x,2)+Math.pow(e-o.y,2))<r){if(this.clicks.push({x:n,y:e,timestamp:s}),this.clicks.length>=A)return this.clicks=[],!0}else this.clicks=[{x:n,y:e,timestamp:s}];return!1};var pC="autocapture",UD="track_pageview",fC="full-url",TD="url-with-path-and-query-string",ID="url-with-path",FD="allow_element_callback",gC="allow_selectors",mC="allow_url_regexes",vC="block_attrs",yC="block_element_callback",wC="block_selectors",bC="block_url_regexes",BC="capture_extra_attrs",CC="capture_text_content",_C="scroll_capture_all",SC="scroll_depth_percent_checkpoints",Qc="click",mp="input",kC="pageview",EC="rage_click",vp="scroll",yp="submit",gt={};gt[gC]=[],gt[mC]=[],gt[vC]=[],gt[yC]=null,gt[wC]=[],gt[bC]=[],gt[BC]=[],gt[CC]=!1,gt[_C]=!1,gt[SC]=[25,50,75,100],gt[Qc]=!0,gt[mp]=!0,gt[kC]=fC,gt[EC]=!0,gt[vp]=!0,gt[yp]=!0;var Rc={$mp_autocapture:!0},UC="$mp_click",xD="$mp_input_change",TC="$mp_rage_click",QD="$mp_scroll",RD="$mp_submit",Qt=function(n){this.mp=n};Qt.prototype.init=function(){if(!CD()){xt.critical("Autocapture unavailable: missing required DOM APIs");return}this.initPageviewTracking(),this.initClickTracking(),this.initInputTracking(),this.initScrollTracking(),this.initSubmitTracking(),this.initRageClickTracking()},Qt.prototype.getFullConfig=function(){var n=this.mp.get_config(pC);return n?m.isObject(n)?m.extend({},gt,n):gt:{}},Qt.prototype.getConfig=function(n){return this.getFullConfig()[n]},Qt.prototype.currentUrlBlocked=function(){var n,e=m.info.currentUrl(),t=this.getConfig(mC)||[];if(t.length){var r=!1;for(n=0;n<t.length;n++){var i=t[n];try{if(e.match(i)){r=!0;break}}catch(s){return xt.critical("Error while checking block URL regex: "+i,s),!0}}if(!r)return!0}var A=this.getConfig(bC)||[];if(!A||!A.length)return!1;for(n=0;n<A.length;n++)try{if(e.match(A[n]))return!0}catch(s){return xt.critical("Error while checking block URL regex: "+A[n],s),!0}return!1},Qt.prototype.pageviewTrackingConfig=function(){return this.mp.get_config(pC)?this.getConfig(kC):this.mp.get_config(UD)},Qt.prototype.trackDomEvent=function(n,e){if(!this.currentUrlBlocked()){var t=this.mp.is_recording_heatmap_data()&&(e===UC&&!this.getConfig(Qc)||e===TC&&!this._getRageClickConfig()),r=bD(n,{allowElementCallback:this.getConfig(FD),allowSelectors:this.getConfig(gC),blockAttrs:this.getConfig(vC),blockElementCallback:this.getConfig(yC),blockSelectors:this.getConfig(wC),captureExtraAttrs:this.getConfig(BC),captureTextContent:this.getConfig(CC),capturedForHeatMap:t});r&&(m.extend(r,Rc),this.mp.track(e,r))}},Qt.prototype._getRageClickConfig=function(){var n=this.getConfig(EC);return n?n===!0?{}:typeof n=="object"?n:{}:null},Qt.prototype.initClickTracking=function(){V.removeEventListener(ii,this.listenerClick),!(!this.getConfig(Qc)&&!this.mp.get_config("record_heatmap_data"))&&(xt.log("Initializing click tracking"),this.listenerClick=V.addEventListener(ii,(function(n){!this.getConfig(Qc)&&!this.mp.is_recording_heatmap_data()||this.trackDomEvent(n,UC)}).bind(this)))},Qt.prototype.initInputTracking=function(){V.removeEventListener(Fc,this.listenerChange),this.getConfig(mp)&&(xt.log("Initializing input tracking"),this.listenerChange=V.addEventListener(Fc,(function(n){this.getConfig(mp)&&this.trackDomEvent(n,xD)}).bind(this)))},Qt.prototype.initPageviewTracking=function(){if(V.removeEventListener(iC,this.listenerPopstate),V.removeEventListener(rC,this.listenerHashchange),V.removeEventListener(AA,this.listenerLocationchange),!!this.pageviewTrackingConfig()){xt.log("Initializing pageview tracking");var n="",e=!1;this.currentUrlBlocked()||(e=this.mp.track_pageview(Rc)),e&&(n=m.info.currentUrl()),this.listenerPopstate=V.addEventListener(iC,function(){V.dispatchEvent(new Event(AA))}),this.listenerHashchange=V.addEventListener(rC,function(){V.dispatchEvent(new Event(AA))});var t=V.history.pushState;typeof t=="function"&&(V.history.pushState=function(i,A,s){t.call(V.history,i,A,s),V.dispatchEvent(new Event(AA))});var r=V.history.replaceState;typeof r=="function"&&(V.history.replaceState=function(i,A,s){r.call(V.history,i,A,s),V.dispatchEvent(new Event(AA))}),this.listenerLocationchange=V.addEventListener(AA,np((function(){if(!this.currentUrlBlocked()){var i=m.info.currentUrl(),A=!1,s=i.split("#")[0].split("?")[0]!==n.split("#")[0].split("?")[0],o=this.pageviewTrackingConfig();if(o===fC?A=i!==n:o===TD?A=i.split("#")[0]!==n.split("#")[0]:o===ID&&(A=s),A){var a=this.mp.track_pageview(Rc);a&&(n=i),s&&(this.lastScrollCheckpoint=0,xt.log("Path change: re-initializing scroll depth checkpoints"))}}}).bind(this)))}},Qt.prototype.initRageClickTracking=function(){V.removeEventListener(ii,this.listenerRageClick);var n=this._getRageClickConfig();!n&&!this.mp.get_config("record_heatmap_data")||(xt.log("Initializing rage click tracking"),this._rageClickTracker||(this._rageClickTracker=new hC),this.listenerRageClick=(function(e){var t=this._getRageClickConfig();!t&&!this.mp.is_recording_heatmap_data()||this.currentUrlBlocked()||this._rageClickTracker.isRageClick(e.pageX,e.pageY,t)&&this.trackDomEvent(e,TC)}).bind(this),V.addEventListener(ii,this.listenerRageClick))},Qt.prototype.initScrollTracking=function(){V.removeEventListener(AC,this.listenerScroll),this.getConfig(vp)&&(xt.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0,this.listenerScroll=V.addEventListener(AC,np((function(){if(this.getConfig(vp)&&!this.currentUrlBlocked()){var n=this.getConfig(_C),e=(this.getConfig(SC)||[]).slice().sort(function(a,c){return a-c}),t=V.scrollY,r=m.extend({$scroll_top:t},Rc);try{var i=ye.body.scrollHeight,A=Math.round(t/(i-V.innerHeight)*100);if(r.$scroll_height=i,r.$scroll_percentage=A,A>this.lastScrollCheckpoint)for(var s=0;s<e.length;s++){var o=e[s];A>=o&&this.lastScrollCheckpoint<o&&(r.$scroll_checkpoint=o,this.lastScrollCheckpoint=o,n=!0)}}catch(a){xt.critical("Error while calculating scroll percentage",a)}n&&this.mp.track(QD,r)}}).bind(this))))},Qt.prototype.initSubmitTracking=function(){V.removeEventListener(lp,this.listenerSubmit),this.getConfig(yp)&&(xt.log("Initializing submit tracking"),this.listenerSubmit=V.addEventListener(lp,(function(n){this.getConfig(yp)&&this.trackDomEvent(n,RD)}).bind(this)))},VB(Qt);var PD=V.fetch,Rt=ri("flags"),Pc="flags",Oc="context",wp={};wp[Oc]={};var ae=function(n){this.getFullApiRoute=n.getFullApiRoute,this.getMpConfig=n.getConfigFunc,this.setMpConfig=n.setConfigFunc,this.getMpProperty=n.getPropertyFunc,this.track=n.trackingFunc};ae.prototype.init=function(){if(!OD()){Rt.critical("Feature Flags unavailable: missing minimum required APIs");return}this.flags=null,this.fetchFlags(),this.trackedFeatures=new Set},ae.prototype.getFullConfig=function(){var n=this.getMpConfig(Pc);return n?m.isObject(n)?m.extend({},wp,n):wp:{}},ae.prototype.getConfig=function(n){return this.getFullConfig()[n]},ae.prototype.isSystemEnabled=function(){return!!this.getMpConfig(Pc)},ae.prototype.updateContext=function(n,e){if(!this.isSystemEnabled())return Rt.critical("Feature Flags not enabled, cannot update context"),Promise.resolve();var t=this.getMpConfig(Pc);m.isObject(t)||(t={});var r=e&&e.replace?{}:this.getConfig(Oc);return t[Oc]=m.extend({},r,n),this.setMpConfig(Pc,t),this.fetchFlags()},ae.prototype.areFlagsReady=function(){return this.isSystemEnabled()||Rt.error("Feature Flags not enabled"),!!this.flags},ae.prototype.fetchFlags=function(){if(!this.isSystemEnabled())return Promise.resolve();var n=this.getMpProperty("distinct_id"),e=this.getMpProperty("$device_id");Rt.log("Fetching flags for distinct ID: "+n);var t={context:m.extend({distinct_id:n,device_id:e},this.getConfig(Oc))};return this._fetchInProgressStartTime=Date.now(),this.fetchPromise=V.fetch(this.getFullApiRoute(),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getMpConfig("token")+":"),"Content-Type":"application/octet-stream"},body:JSON.stringify(t)}).then((function(r){return this.markFetchComplete(),r.json().then((function(i){var A=i.flags;if(!A)throw new Error("No flags in API response");var s=new Map;m.each(A,function(o,a){s.set(a,{key:o.variant_key,value:o.variant_value})}),this.flags=s}).bind(this)).catch((function(i){this.markFetchComplete(),Rt.error(i)}).bind(this))}).bind(this)).catch((function(r){this.markFetchComplete(),Rt.error(r)}).bind(this)),this.fetchPromise},ae.prototype.markFetchComplete=function(){if(!this._fetchInProgressStartTime){Rt.error("Fetch in progress started time not set, cannot mark fetch complete");return}this._fetchStartTime=this._fetchInProgressStartTime,this._fetchCompleteTime=Date.now(),this._fetchLatency=this._fetchCompleteTime-this._fetchStartTime,this._fetchInProgressStartTime=null},ae.prototype.getVariant=function(n,e){return this.fetchPromise?this.fetchPromise.then((function(){return this.getVariantSync(n,e)}).bind(this)).catch(function(t){return Rt.error(t),e}):new Promise(function(t){Rt.critical("Feature Flags not initialized"),t(e)})},ae.prototype.getVariantSync=function(n,e){if(!this.areFlagsReady())return Rt.log("Flags not loaded yet"),e;var t=this.flags.get(n);return t?(this.trackFeatureCheck(n,t),t):(Rt.log('No flag found: "'+n+'"'),e)},ae.prototype.getVariantValue=function(n,e){return this.getVariant(n,{value:e}).then(function(t){return t.value}).catch(function(t){return Rt.error(t),e})},ae.prototype.getFeatureData=function(n,e){return Rt.critical("mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead."),this.getVariantValue(n,e)},ae.prototype.getVariantValueSync=function(n,e){return this.getVariantSync(n,{value:e}).value},ae.prototype.isEnabled=function(n,e){return this.getVariantValue(n).then((function(){return this.isEnabledSync(n,e)}).bind(this)).catch(function(t){return Rt.error(t),e})},ae.prototype.isEnabledSync=function(n,e){e=e||!1;var t=this.getVariantValueSync(n,e);return t!==!0&&t!==!1&&(Rt.error('Feature flag "'+n+'" value: '+t+" is not a boolean; returning fallback value: "+e),t=e),t},ae.prototype.trackFeatureCheck=function(n,e){this.trackedFeatures.has(n)||(this.trackedFeatures.add(n),this.track("$experiment_started",{"Experiment name":n,"Variant name":e.key,$experiment_type:"feature_flag","Variant fetch start time":new Date(this._fetchStartTime).toISOString(),"Variant fetch complete time":new Date(this._fetchCompleteTime).toISOString(),"Variant fetch latency (ms)":this._fetchLatency}))};function OD(){return!!PD&&typeof Promise<"u"&&typeof Map<"u"&&typeof Set<"u"}VB(ae),ae.prototype.are_flags_ready=ae.prototype.areFlagsReady,ae.prototype.get_variant=ae.prototype.getVariant,ae.prototype.get_variant_sync=ae.prototype.getVariantSync,ae.prototype.get_variant_value=ae.prototype.getVariantValue,ae.prototype.get_variant_value_sync=ae.prototype.getVariantValueSync,ae.prototype.is_enabled=ae.prototype.isEnabled,ae.prototype.is_enabled_sync=ae.prototype.isEnabledSync,ae.prototype.update_context=ae.prototype.updateContext,ae.prototype.get_feature_data=ae.prototype.getFeatureData;var zn=function(){};zn.prototype.create_properties=function(){},zn.prototype.event_handler=function(){},zn.prototype.after_track_handler=function(){},zn.prototype.init=function(n){return this.mp=n,this},zn.prototype.track=function(n,e,t,r){var i=this,A=m.dom_query(n);if(A.length===0){we.error("The DOM query ("+n+") returned 0 elements");return}return m.each(A,function(s){m.register_event(s,this.override_event,function(o){var a={},c=i.create_properties(t,this),u=i.mp.get_config("track_links_timeout");i.event_handler(o,this,a),window.setTimeout(i.track_callback(r,c,a,!0),u),i.mp.track(e,c,i.track_callback(r,c,a))})},this),!0},zn.prototype.track_callback=function(n,e,t,r){r=r||!1;var i=this;return function(){t.callback_fired||(t.callback_fired=!0,!(n&&n(r,e)===!1)&&i.after_track_handler(e,t,r))}},zn.prototype.create_properties=function(n,e){var t;return typeof n=="function"?t=n(e):t=m.extend({},n),t};var sA=function(){this.override_event="click"};m.inherit(sA,zn),sA.prototype.create_properties=function(n,e){var t=sA.superclass.create_properties.apply(this,arguments);return e.href&&(t.url=e.href),t},sA.prototype.event_handler=function(n,e,t){t.new_tab=n.which===2||n.metaKey||n.ctrlKey||e.target==="_blank",t.href=e.href,t.new_tab||n.preventDefault()},sA.prototype.after_track_handler=function(n,e){e.new_tab||setTimeout(function(){window.location=e.href},0)};var Mc=function(){this.override_event="submit"};m.inherit(Mc,zn),Mc.prototype.event_handler=function(n,e,t){t.element=e,n.preventDefault()},Mc.prototype.after_track_handler=function(n,e){setTimeout(function(){e.element.submit()},0)};var xr="$set",oA="$set_once",mn="$unset",Ai="$add",Qn="$append",si="$union",Xn="$remove",MD="$delete",IC={set_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=i)},this):r[n]=e,t[xr]=r,t},unset_action:function(n){var e={},t=[];return m.isArray(n)||(n=[n]),m.each(n,function(r){this._is_reserved_property(r)||t.push(r)},this),e[mn]=t,e},set_once_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=i)},this):r[n]=e,t[oA]=r,t},union_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=m.isArray(i)?i:[i])},this):r[n]=m.isArray(e)?e:[e],t[si]=r,t},append_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=i)},this):r[n]=e,t[Qn]=r,t},remove_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=i)},this):r[n]=e,t[Xn]=r,t},delete_action:function(){var n={};return n[MD]="",n}},De=function(){};m.extend(De.prototype,IC),De.prototype._init=function(n,e,t){this._mixpanel=n,this._group_key=e,this._group_id=t},De.prototype.set=nA(function(n,e,t){var r=this.set_action(n,e);return m.isObject(n)&&(t=e),this._send_request(r,t)}),De.prototype.set_once=nA(function(n,e,t){var r=this.set_once_action(n,e);return m.isObject(n)&&(t=e),this._send_request(r,t)}),De.prototype.unset=nA(function(n,e){var t=this.unset_action(n);return this._send_request(t,e)}),De.prototype.union=nA(function(n,e,t){m.isObject(n)&&(t=e);var r=this.union_action(n,e);return this._send_request(r,t)}),De.prototype.delete=nA(function(n){var e=this.delete_action();return this._send_request(e,n)}),De.prototype.remove=nA(function(n,e,t){var r=this.remove_action(n,e);return this._send_request(r,t)}),De.prototype._send_request=function(n,e){n.$group_key=this._group_key,n.$group_id=this._group_id,n.$token=this._get_config("token");var t=m.encodeDates(n);return this._mixpanel._track_or_batch({type:"groups",data:t,endpoint:this._mixpanel.get_api_host("groups")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},e)},De.prototype._is_reserved_property=function(n){return n==="$group_key"||n==="$group_id"},De.prototype._get_config=function(n){return this._mixpanel.get_config(n)},De.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},De.prototype.remove=De.prototype.remove,De.prototype.set=De.prototype.set,De.prototype.set_once=De.prototype.set_once,De.prototype.union=De.prototype.union,De.prototype.unset=De.prototype.unset,De.prototype.toString=De.prototype.toString;var $=function(){};m.extend($.prototype,IC),$.prototype._init=function(n){this._mixpanel=n},$.prototype.set=Fr(function(n,e,t){var r=this.set_action(n,e);return m.isObject(n)&&(t=e),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r[xr]=m.extend({},m.info.people_properties(),r[xr]),this._send_request(r,t)}),$.prototype.set_once=Fr(function(n,e,t){var r=this.set_once_action(n,e);return m.isObject(n)&&(t=e),this._send_request(r,t)}),$.prototype.unset=Fr(function(n,e){var t=this.unset_action(n);return this._send_request(t,e)}),$.prototype.increment=Fr(function(n,e,t){var r={},i={};return m.isObject(n)?(m.each(n,function(A,s){if(!this._is_reserved_property(s))if(isNaN(parseFloat(A))){we.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else i[s]=A},this),t=e):(m.isUndefined(e)&&(e=1),i[n]=e),r[Ai]=i,this._send_request(r,t)}),$.prototype.append=Fr(function(n,e,t){m.isObject(n)&&(t=e);var r=this.append_action(n,e);return this._send_request(r,t)}),$.prototype.remove=Fr(function(n,e,t){m.isObject(n)&&(t=e);var r=this.remove_action(n,e);return this._send_request(r,t)}),$.prototype.union=Fr(function(n,e,t){m.isObject(n)&&(t=e);var r=this.union_action(n,e);return this._send_request(r,t)}),$.prototype.track_charge=Fr(function(){we.error("mixpanel.people.track_charge() is deprecated and no longer has any effect.")}),$.prototype.clear_charges=function(n){return this.set("$transactions",[],n)},$.prototype.delete_user=function(){if(!this._identify_called()){we.error("mixpanel.people.delete_user() requires you to call identify() first");return}var n={$delete:this._mixpanel.get_distinct_id()};return this._send_request(n)},$.prototype.toString=function(){return this._mixpanel.toString()+".people"},$.prototype._send_request=function(n,e){n.$token=this._get_config("token"),n.$distinct_id=this._mixpanel.get_distinct_id();var t=this._mixpanel.get_property("$device_id"),r=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");t&&(n.$device_id=t),r&&(n.$user_id=r),i&&(n.$had_persisted_distinct_id=i);var A=m.encodeDates(n);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:A,endpoint:this._mixpanel.get_api_host("people")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},e):(this._enqueue(n),m.isUndefined(e)||(this._get_config("verbose")?e({status:-1,error:null}):e(-1)),m.truncate(A,255))},$.prototype._get_config=function(n){return this._mixpanel.get_config(n)},$.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},$.prototype._enqueue=function(n){xr in n?this._mixpanel.persistence._add_to_people_queue(xr,n):oA in n?this._mixpanel.persistence._add_to_people_queue(oA,n):mn in n?this._mixpanel.persistence._add_to_people_queue(mn,n):Ai in n?this._mixpanel.persistence._add_to_people_queue(Ai,n):Qn in n?this._mixpanel.persistence._add_to_people_queue(Qn,n):Xn in n?this._mixpanel.persistence._add_to_people_queue(Xn,n):si in n?this._mixpanel.persistence._add_to_people_queue(si,n):we.error("Invalid call to _enqueue():",n)},$.prototype._flush_one_queue=function(n,e,t,r){var i=this,A=m.extend({},this._mixpanel.persistence.load_queue(n)),s=A;!m.isUndefined(A)&&m.isObject(A)&&!m.isEmptyObject(A)&&(i._mixpanel.persistence._pop_from_people_queue(n,A),i._mixpanel.persistence.save(),r&&(s=r(A)),e.call(i,s,function(o,a){o===0&&i._mixpanel.persistence._add_to_people_queue(n,A),m.isUndefined(t)||t(o,a)}))},$.prototype._flush=function(n,e,t,r,i,A,s){var o=this;this._flush_one_queue(xr,this.set,n),this._flush_one_queue(oA,this.set_once,r),this._flush_one_queue(mn,this.unset,A,function(g){return m.keys(g)}),this._flush_one_queue(Ai,this.increment,e),this._flush_one_queue(si,this.union,i);var a=this._mixpanel.persistence.load_queue(Qn);if(!m.isUndefined(a)&&m.isArray(a)&&a.length)for(var c,u=function(g,v){g===0&&o._mixpanel.persistence._add_to_people_queue(Qn,c),m.isUndefined(t)||t(g,v)},l=a.length-1;l>=0;l--)a=this._mixpanel.persistence.load_queue(Qn),c=a.pop(),o._mixpanel.persistence.save(),m.isEmptyObject(c)||o.append(c,u);var d=this._mixpanel.persistence.load_queue(Xn);if(!m.isUndefined(d)&&m.isArray(d)&&d.length)for(var h,f=function(g,v){g===0&&o._mixpanel.persistence._add_to_people_queue(Xn,h),m.isUndefined(s)||s(g,v)},p=d.length-1;p>=0;p--)d=this._mixpanel.persistence.load_queue(Xn),h=d.pop(),o._mixpanel.persistence.save(),m.isEmptyObject(h)||o.remove(h,f)},$.prototype._is_reserved_property=function(n){return n==="$distinct_id"||n==="$token"||n==="$device_id"||n==="$user_id"||n==="$had_persisted_distinct_id"},$.prototype.set=$.prototype.set,$.prototype.set_once=$.prototype.set_once,$.prototype.unset=$.prototype.unset,$.prototype.increment=$.prototype.increment,$.prototype.append=$.prototype.append,$.prototype.remove=$.prototype.remove,$.prototype.union=$.prototype.union,$.prototype.track_charge=$.prototype.track_charge,$.prototype.clear_charges=$.prototype.clear_charges,$.prototype.delete_user=$.prototype.delete_user,$.prototype.toString=$.prototype.toString;var bp="__mps",Bp="__mpso",Cp="__mpus",_p="__mpa",Sp="__mpap",kp="__mpr",Ep="__mpu",FC="$people_distinct_id",Lc="__alias",Es="__timers",LD=[bp,Bp,Cp,_p,Sp,kp,Ep,FC,Lc,Es],re=function(n){this.props={},this.campaign_params_saved=!1,n.persistence_name?this.name="mp_"+n.persistence_name:this.name="mp_"+n.token+"_mixpanel";var e=n.persistence;e!=="cookie"&&e!=="localStorage"&&(we.critical("Unknown persistence type "+e+"; falling back to cookie"),e=n.persistence="cookie"),e==="localStorage"&&m.localStorage.is_supported()?this.storage=m.localStorage:this.storage=m.cookie,this.load(),this.update_config(n),this.upgrade(),this.save()};re.prototype.properties=function(){var n={};return this.load(),m.each(this.props,function(e,t){m.include(LD,t)||(n[t]=e)}),n},re.prototype.load=function(){if(!this.disabled){var n=this.storage.parse(this.name);n&&(this.props=m.extend({},n))}},re.prototype.upgrade=function(){var n,e;this.storage===m.localStorage?(n=m.cookie.parse(this.name),m.cookie.remove(this.name),m.cookie.remove(this.name,!0),n&&this.register_once(n)):this.storage===m.cookie&&(e=m.localStorage.parse(this.name),m.localStorage.remove(this.name),e&&this.register_once(e))},re.prototype.save=function(){this.disabled||this.storage.set(this.name,tA(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},re.prototype.load_prop=function(n){return this.load(),this.props[n]},re.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},re.prototype.clear=function(){this.remove(),this.props={}},re.prototype.register_once=function(n,e,t){return m.isObject(n)?(typeof e>"u"&&(e="None"),this.expire_days=typeof t>"u"?this.default_expiry:t,this.load(),m.each(n,function(r,i){(!this.props.hasOwnProperty(i)||this.props[i]===e)&&(this.props[i]=r)},this),this.save(),!0):!1},re.prototype.register=function(n,e){return m.isObject(n)?(this.expire_days=typeof e>"u"?this.default_expiry:e,this.load(),m.extend(this.props,n),this.save(),!0):!1},re.prototype.unregister=function(n){this.load(),n in this.props&&(delete this.props[n],this.save())},re.prototype.update_search_keyword=function(n){this.register(m.info.searchInfo(n))},re.prototype.update_referrer_info=function(n){this.register_once({$initial_referrer:n||"$direct",$initial_referring_domain:m.info.referringDomain(n)||"$direct"},"")},re.prototype.get_referrer_info=function(){return m.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},re.prototype.update_config=function(n){this.default_expiry=this.expire_days=n.cookie_expiration,this.set_disabled(n.disable_persistence),this.set_cookie_domain(n.cookie_domain),this.set_cross_site(n.cross_site_cookie),this.set_cross_subdomain(n.cross_subdomain_cookie),this.set_secure(n.secure_cookie)},re.prototype.set_disabled=function(n){this.disabled=n,this.disabled?this.remove():this.save()},re.prototype.set_cookie_domain=function(n){n!==this.cookie_domain&&(this.remove(),this.cookie_domain=n,this.save())},re.prototype.set_cross_site=function(n){n!==this.cross_site&&(this.cross_site=n,this.remove(),this.save())},re.prototype.set_cross_subdomain=function(n){n!==this.cross_subdomain&&(this.cross_subdomain=n,this.remove(),this.save())},re.prototype.get_cross_subdomain=function(){return this.cross_subdomain},re.prototype.set_secure=function(n){n!==this.secure&&(this.secure=!!n,this.remove(),this.save())},re.prototype._add_to_people_queue=function(n,e){var t=this._get_queue_key(n),r=e[n],i=this._get_or_create_queue(xr),A=this._get_or_create_queue(oA),s=this._get_or_create_queue(mn),o=this._get_or_create_queue(Ai),a=this._get_or_create_queue(si),c=this._get_or_create_queue(Xn,[]),u=this._get_or_create_queue(Qn,[]);t===bp?(m.extend(i,r),this._pop_from_people_queue(Ai,r),this._pop_from_people_queue(si,r),this._pop_from_people_queue(mn,r)):t===Bp?(m.each(r,function(l,d){d in A||(A[d]=l)}),this._pop_from_people_queue(mn,r)):t===Cp?m.each(r,function(l){m.each([i,A,o,a],function(d){l in d&&delete d[l]}),m.each(u,function(d){l in d&&delete d[l]}),s[l]=!0}):t===_p?(m.each(r,function(l,d){d in i?i[d]+=l:(d in o||(o[d]=0),o[d]+=l)},this),this._pop_from_people_queue(mn,r)):t===Ep?(m.each(r,function(l,d){m.isArray(l)&&(d in a||(a[d]=[]),m.each(l,function(h){m.include(a[d],h)||a[d].push(h)}))}),this._pop_from_people_queue(mn,r)):t===kp?(c.push(r),this._pop_from_people_queue(Qn,r)):t===Sp&&(u.push(r),this._pop_from_people_queue(mn,r)),we.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),we.log(e),this.save()},re.prototype._pop_from_people_queue=function(n,e){var t=this.props[this._get_queue_key(n)];m.isUndefined(t)||m.each(e,function(r,i){n===Qn||n===Xn?m.each(t,function(A){A[i]===r&&delete A[i]}):delete t[i]},this)},re.prototype.load_queue=function(n){return this.load_prop(this._get_queue_key(n))},re.prototype._get_queue_key=function(n){if(n===xr)return bp;if(n===oA)return Bp;if(n===mn)return Cp;if(n===Ai)return _p;if(n===Qn)return Sp;if(n===Xn)return kp;if(n===si)return Ep;we.error("Invalid queue:",n)},re.prototype._get_or_create_queue=function(n,e){var t=this._get_queue_key(n);return e=m.isUndefined(e)?{}:e,this.props[t]||(this.props[t]=e)},re.prototype.set_event_timer=function(n,e){var t=this.load_prop(Es)||{};t[n]=e,this.props[Es]=t,this.save()},re.prototype.remove_event_timer=function(n){var e=this.load_prop(Es)||{},t=e[n];return m.isUndefined(t)||(delete this.props[Es][n],this.save()),t};var Up,xC=function(n,e){throw new Error(n+" not available in this build.")},Ut,QC=0,DD=1,ND=function(n){return n},en="mixpanel",RC="base64",HD="json",Tp="$device:",aA=V.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,PC=!aA&&qn.indexOf("MSIE")===-1&&qn.indexOf("Mozilla")===-1,Dc=null;Ur.sendBeacon&&(Dc=function(){return Ur.sendBeacon.apply(Ur,arguments)});var OC={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},MC={api_host:"https://api-js.mixpanel.com",api_hosts:{},api_routes:OC,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:RC,app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Tr,flags:!1,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Tr,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video, audio",record_canvas:!1,record_collect_fonts:!1,record_heatmap_data:!1,record_idle_timeout_ms:30*60*1e3,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:bs,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},LC=!1,E=function(){},Ip=function(n,e,t){var r,i=t===en?Ut:Ut[t];if(i&&Up===QC)r=i;else{if(i&&!m.isArray(i)){we.error("You have already initialized "+t);return}r=new E}if(r._cached_groups={},r._init(n,e,t),r.people=new $,r.people._init(r),!r.get_config("skip_first_touch_marketing")){var A=m.info.campaignParams(null),s={},o=!1;m.each(A,function(a,c){s["initial_"+c]=a,a&&(o=!0)}),o&&r.people.set_once(s)}return gn.DEBUG=gn.DEBUG||r.get_config("debug"),!m.isUndefined(i)&&m.isArray(i)&&(r._execute_array.call(r.people,i.people),r._execute_array(i)),r};E.prototype.init=function(n,e,t){if(m.isUndefined(t)){this.report_error("You must name your new library: init(token, config, name)");return}if(t===en){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var r=Ip(n,e,t);return Ut[t]=r,r._loaded(),r},E.prototype._init=function(n,e,t){e=e||{},this.__loaded=!0,this.config={};var r={};if(!("api_payload_format"in e)){var i=e.api_host||MC.api_host;i.match(/\.mixpanel\.com/)&&(r.api_payload_format=HD)}if(this.set_config(m.extend({},MC,r,e,{name:t,token:n,callback_fn:(t===en?t:en+"."+t)+"._jsc"})),this._jsc=Tr,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!m.localStorage.is_supported(!0)||!aA)this._batch_requests=!1,we.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),m.each(this.get_batcher_configs(),function(o){we.log("Clearing batch queue "+o.queue_key),m.localStorage.remove(o.queue_key)});else if(this.init_batchers(),Dc&&V.addEventListener){var A=m.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);V.addEventListener("pagehide",function(o){o.persisted&&A()}),V.addEventListener("visibilitychange",function(){ye.visibilityState==="hidden"&&A()})}}this.persistence=this.cookie=new re(this.config),this.unpersisted_superprops={},this._gdpr_init();var s=m.UUID();this.get_distinct_id()||this.register_once({distinct_id:Tp+s,$device_id:s},""),this.flags=new ae({getFullApiRoute:m.bind(function(){return this.get_api_host("flags")+"/"+this.get_config("api_routes").flags},this),getConfigFunc:m.bind(this.get_config,this),setConfigFunc:m.bind(this.set_config,this),getPropertyFunc:m.bind(this.get_property,this),trackingFunc:m.bind(this.track,this)}),this.flags.init(),this.flags=this.flags,this.autocapture=new Qt(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()},E.prototype._init_tab_id=function(){if(m.sessionStorage.is_supported())try{var n=this.get_config("name")+"_"+this.get_config("token"),e="mp_tab_id_"+n,t="mp_gen_new_tab_id_"+n;(m.sessionStorage.get(t)||!m.sessionStorage.get(e))&&m.sessionStorage.set(e,"$tab-"+m.UUID()),m.sessionStorage.set(t,"1"),this.tab_id=m.sessionStorage.get(e),V.addEventListener("beforeunload",function(){m.sessionStorage.remove(t)})}catch(r){this.report_error("Error initializing tab id",r)}else this.report_error("Session storage is not supported, cannot keep track of unique tab ID.")},E.prototype.get_tab_id=function(){return this.tab_id||null},E.prototype._should_load_recorder=function(){var n=new In(sp),e=this.get_tab_id();return n.init().then(function(){return n.getAll()}).then(function(t){for(var r=0;r<t.length;r++)if(up(t[r])||t[r].tabId===e)return!0;return!1}).catch(m.bind(function(t){this.report_error("Error checking recording registry",t)},this))},E.prototype._check_and_start_session_recording=Ir(function(n){if(!V.MutationObserver){we.critical("Browser does not support MutationObserver; skipping session recording");return}var e=m.bind(function(r){var i=m.bind(function(){this._recorder=this._recorder||new V.__mp_recorder(this),this._recorder.resumeRecording(r)},this);m.isUndefined(V.__mp_recorder)?xC(this.get_config("recorder_src"),i):i()},this),t=this.get_config("record_sessions_percent")>0&&Math.random()*100<=this.get_config("record_sessions_percent");n||t?e(!0):this._should_load_recorder().then(function(r){r&&e(!1)})}),E.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)},E.prototype.stop_session_recording=function(){return this._recorder?this._recorder.stopRecording():Promise.resolve()},E.prototype.pause_session_recording=function(){return this._recorder?this._recorder.pauseRecording():Promise.resolve()},E.prototype.resume_session_recording=function(){return this._recorder?this._recorder.resumeRecording():Promise.resolve()},E.prototype.is_recording_heatmap_data=function(){return this._get_session_replay_id()&&this.get_config("record_heatmap_data")},E.prototype.get_session_recording_properties=function(){var n={},e=this._get_session_replay_id();return e&&(n.$mp_replay_id=e),n},E.prototype.get_session_replay_url=function(){var n=null,e=this._get_session_replay_id();if(e){var t=m.HTTPBuildQuery({replay_id:e,distinct_id:this.get_distinct_id(),token:this.get_config("token")});n="https://mixpanel.com/projects/replay-redirect?"+t}return n},E.prototype._get_session_replay_id=function(){var n=null;return this._recorder&&(n=this._recorder.replayId),n||null},E.prototype.__get_recorder=function(){return this._recorder},E.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var n=m.info.campaignParams(null);m.each(n,(function(e,t){this.unregister(t)}).bind(this))}},E.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(ye.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(m.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(ye.referrer)},E.prototype._dom_loaded=function(){m.each(this.__dom_loaded_queue,function(n){this._track_dom.apply(this,n)},this),this.has_opted_out_tracking()||m.each(this.__request_queue,function(n){this._send_request.apply(this,n)},this),delete this.__dom_loaded_queue,delete this.__request_queue},E.prototype._track_dom=function(n,e){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!LC)return this.__dom_loaded_queue.push([n,e]),!1;var t=new n().init(this);return t.track.apply(t,e)},E.prototype._prepare_callback=function(n,e){if(m.isUndefined(n))return null;if(aA){var t=function(s){n(s,e)};return t}else{var r=this._jsc,i=""+Math.floor(Math.random()*1e8),A=this.get_config("callback_fn")+"["+i+"]";return r[i]=function(s){delete r[i],n(s,e)},A}},E.prototype._send_request=function(n,e,t,r){var i=!0;if(PC)return this.__request_queue.push(arguments),i;var A={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;!r&&(m.isFunction(t)||typeof t=="string")&&(r=t,t=null),t=m.extend(A,t||{}),aA||(t.method="GET");var o=t.method==="POST",a=Dc&&o&&t.transport.toLowerCase()==="sendbeacon",c=t.verbose;e.verbose&&(c=!0),this.get_config("test")&&(e.test=1),c&&(e.verbose=1),this.get_config("img")&&(e.img=1),aA||(r?e.callback=r:(c||this.get_config("test"))&&(e.callback="(function(){})")),e.ip=this.get_config("ip")?1:0,e._=new Date().getTime().toString(),o&&(s="data="+encodeURIComponent(e.data),delete e.data),m.extend(e,this.get_config("api_extra_query_params")),n+="?"+m.HTTPBuildQuery(e);var u=this;if("img"in e){var l=ye.createElement("img");l.src=n,ye.body.appendChild(l)}else if(a){try{i=Dc(n,s)}catch(v){u.report_error(v),i=!1}try{r&&r(i?1:0)}catch(v){u.report_error(v)}}else if(aA)try{var d=new XMLHttpRequest;d.open(t.method,n,!0);var h=this.get_config("xhr_headers");if(o&&(h["Content-Type"]="application/x-www-form-urlencoded"),m.each(h,function(v,y){d.setRequestHeader(y,v)}),t.timeout_ms&&typeof d.timeout<"u"){d.timeout=t.timeout_ms;var f=new Date().getTime()}d.withCredentials=!0,d.onreadystatechange=function(){if(d.readyState===4)if(d.status===200){if(r)if(c){var v;try{v=m.JSONDecode(d.responseText)}catch(b){if(u.report_error(b),t.ignore_json_errors)v=d.responseText;else return}r(v)}else r(Number(d.responseText))}else{var y;if(d.timeout&&!d.status&&new Date().getTime()-f>=d.timeout?y="timeout":y="Bad HTTP status: "+d.status+" "+d.statusText,u.report_error(y),r)if(c){var B=d.responseHeaders||{};r({status:0,httpStatusCode:d.status,error:y,retryAfter:B["Retry-After"]})}else r(0)}},d.send(s)}catch(v){u.report_error(v),i=!1}else{var p=ye.createElement("script");p.type="text/javascript",p.async=!0,p.defer=!0,p.src=n;var g=ye.getElementsByTagName("script")[0];g.parentNode.insertBefore(p,g)}return i},E.prototype._execute_array=function(n){var e,t=[],r=[],i=[];m.each(n,function(s){s&&(e=s[0],m.isArray(e)?i.push(s):typeof s=="function"?s.call(this):m.isArray(s)&&e==="alias"?t.push(s):m.isArray(s)&&e.indexOf("track")!==-1&&typeof this[e]=="function"?i.push(s):r.push(s))},this);var A=function(s,o){m.each(s,function(a){if(m.isArray(a[0])){var c=o;m.each(a,function(u){c=c[u[0]].apply(c,u.slice(1))})}else this[a[0]].apply(this,a.slice(1))},o)};A(t,this),A(r,this),A(i,this)},E.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},E.prototype.get_batcher_configs=function(){var n="__mpq_"+this.get_config("token");return this._batcher_configs=this._batcher_configs||{events:{type:"events",api_name:"track",queue_key:n+"_ev"},people:{type:"people",api_name:"engage",queue_key:n+"_pp"},groups:{type:"groups",api_name:"groups",queue_key:n+"_gr"}},this._batcher_configs},E.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var n=m.bind(function(t){return new $t(t.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:m.bind(function(r,i,A){var s=this.get_config("api_routes");this._send_request(this.get_api_host(t.api_name)+"/"+s[t.api_name],this._encode_data_for_request(r),i,this._prepare_callback(A,r))},this),beforeSendHook:m.bind(function(r){return this._run_hook("before_send_"+t.type,r)},this),stopAllBatchingFunc:m.bind(this.stop_batch_senders,this),usePersistence:!0})},this),e=this.get_batcher_configs();this.request_batchers={events:n(e.events),people:n(e.people),groups:n(e.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},E.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,m.each(this.request_batchers,function(n){n.start()}))},E.prototype.stop_batch_senders=function(){this._batch_requests=!1,m.each(this.request_batchers,function(n){n.stop(),n.clear()})},E.prototype.push=function(n){this._execute_array([n])},E.prototype.disable=function(n){typeof n>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(n)},E.prototype._encode_data_for_request=function(n){var e=tA(n);return this.get_config("api_payload_format")===RC&&(e=m.base64Encode(e)),{data:e}},E.prototype._track_or_batch=function(n,e){var t=m.truncate(n.data,255),r=n.endpoint,i=n.batcher,A=n.should_send_immediately,s=n.send_request_options||{};e=e||Tr;var o=!0,a=m.bind(function(){return s.skip_hooks||(t=this._run_hook("before_send_"+n.type,t)),t?(we.log("MIXPANEL REQUEST:"),we.log(t),this._send_request(r,this._encode_data_for_request(t),s,this._prepare_callback(e,t))):null},this);return this._batch_requests&&!A?i.enqueue(t).then(function(c){c?e(1,t):a()}):o=a(),o&&t},E.prototype.track=Ir(function(n,e,t,r){!r&&typeof t=="function"&&(r=t,t=null),t=t||{};var i=t.transport;i&&(t.transport=i);var A=t.send_immediately;if(typeof r!="function"&&(r=Tr),m.isUndefined(n)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(n)){r(0);return}e=m.extend({},e),e.token=this.get_config("token");var s=this.persistence.remove_event_timer(n);if(!m.isUndefined(s)){var o=new Date().getTime()-s;e.$duration=parseFloat((o/1e3).toFixed(3))}this._set_default_superprops();var a=this.get_config("track_marketing")?m.info.marketingParams():{};e=m.extend({},m.info.properties({mp_loader:this.get_config("mp_loader")}),a,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),e);var c=this.get_config("property_blacklist");m.isArray(c)?m.each(c,function(d){delete e[d]}):this.report_error("Invalid value for property_blacklist config: "+c);var u={event:n,properties:e},l=this._track_or_batch({type:"events",data:u,endpoint:this.get_api_host("events")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:A,send_request_options:t},r);return l}),E.prototype.set_group=Ir(function(n,e,t){m.isArray(e)||(e=[e]);var r={};return r[n]=e,this.register(r),this.people.set(n,e,t)}),E.prototype.add_group=Ir(function(n,e,t){var r=this.get_property(n),i={};return r===void 0?(i[n]=[e],this.register(i)):r.indexOf(e)===-1&&(r.push(e),i[n]=r,this.register(i)),this.people.union(n,e,t)}),E.prototype.remove_group=Ir(function(n,e,t){var r=this.get_property(n);if(r!==void 0){var i=r.indexOf(e);i>-1&&(r.splice(i,1),this.register({group_key:r})),r.length===0&&this.unregister(n)}return this.people.remove(n,e,t)}),E.prototype.track_with_groups=Ir(function(n,e,t,r){var i=m.extend({},e||{});return m.each(t,function(A,s){A!=null&&(i[s]=A)}),this.track(n,i,r)}),E.prototype._create_map_key=function(n,e){return n+"_"+JSON.stringify(e)},E.prototype._remove_group_from_cache=function(n,e){delete this._cached_groups[this._create_map_key(n,e)]},E.prototype.get_group=function(n,e){var t=this._create_map_key(n,e),r=this._cached_groups[t];return(r===void 0||r._group_key!==n||r._group_id!==e)&&(r=new De,r._init(this,n,e),this._cached_groups[t]=r),r},E.prototype.track_pageview=Ir(function(n,e){typeof n!="object"&&(n={}),e=e||{};var t=e.event_name||"$mp_web_page_view",r=m.extend(m.info.mpPageViewProperties(),m.info.campaignParams(),m.info.clickParams()),i=m.extend({},r,n);return this.track(t,i)}),E.prototype.track_links=function(){return this._track_dom.call(this,sA,arguments)},E.prototype.track_forms=function(){return this._track_dom.call(this,Mc,arguments)},E.prototype.time_event=function(n){if(m.isUndefined(n)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(n)||this.persistence.set_event_timer(n,new Date().getTime())};var KD={persistent:!0},Fp=function(n){var e;return m.isObject(n)?e=n:m.isUndefined(n)?e={}:e={days:n},m.extend({},KD,e)};E.prototype.register=function(n,e){var t=Fp(e);t.persistent?this.persistence.register(n,t.days):m.extend(this.unpersisted_superprops,n)},E.prototype.register_once=function(n,e,t){var r=Fp(t);r.persistent?this.persistence.register_once(n,e,r.days):(typeof e>"u"&&(e="None"),m.each(n,function(i,A){(!this.unpersisted_superprops.hasOwnProperty(A)||this.unpersisted_superprops[A]===e)&&(this.unpersisted_superprops[A]=i)},this))},E.prototype.unregister=function(n,e){e=Fp(e),e.persistent?this.persistence.unregister(n):delete this.unpersisted_superprops[n]},E.prototype._register_single=function(n,e){var t={};t[n]=e,this.register(t)},E.prototype.identify=function(n,e,t,r,i,A,s,o){var a=this.get_distinct_id();if(n&&a!==n){if(typeof n=="string"&&n.indexOf(Tp)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:n})}if(!this.get_property("$device_id")){var c=a;this.register_once({$had_persisted_distinct_id:!0,$device_id:c},"")}n!==a&&n!==this.get_property(Lc)&&(this.unregister(Lc),this.register({distinct_id:n})),this._flags.identify_called=!0,this.people._flush(e,t,r,i,A,s,o),n!==a&&this.track("$identify",{distinct_id:n,$anon_distinct_id:a},{skip_hooks:!0}),n!==a&&this.flags.fetchFlags()},E.prototype.reset=function(){this.stop_session_recording(),this.persistence.clear(),this._flags.identify_called=!1;var n=m.UUID();this.register_once({distinct_id:Tp+n,$device_id:n},""),this._check_and_start_session_recording()},E.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},E.prototype.alias=function(n,e){if(n===this.get_property(FC))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var t=this;return m.isUndefined(e)&&(e=this.get_distinct_id()),n!==e?(this._register_single(Lc,n),this.track("$create_alias",{alias:n,distinct_id:e},{skip_hooks:!0},function(){t.identify(n)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(n),-1)},E.prototype.name_tag=function(n){this._register_single("mp_name_tag",n)},E.prototype.set_config=function(n){if(m.isObject(n)){m.extend(this.config,n);var e=n.batch_size;e&&m.each(this.request_batchers,function(t){t.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),gn.DEBUG=gn.DEBUG||this.get_config("debug"),("autocapture"in n||"record_heatmap_data"in n)&&this.autocapture&&this.autocapture.init()}},E.prototype.get_config=function(n){return this.config[n]},E.prototype._run_hook=function(n){var e=(this.config.hooks[n]||ND).apply(this,ni.call(arguments,1));return typeof e>"u"&&(this.report_error(n+" hook did not return a value"),e=null),e},E.prototype.get_property=function(n){return this.persistence.load_prop([n])},E.prototype.get_api_host=function(n){return this.get_config("api_hosts")[n]||this.get_config("api_host")},E.prototype.toString=function(){var n=this.get_config("name");return n!==en&&(n=en+"."+n),n},E.prototype._event_is_disabled=function(n){return m.isBlockedUA(qn)||this._flags.disable_all_events||m.include(this.__disabled_events,n)},E.prototype._gdpr_init=function(){var n=this.get_config("opt_out_tracking_persistence_type")==="localStorage";n&&m.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||m.cookie.get("mp_optout"))&&(m.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},E.prototype._gdpr_update_persistence=function(n){var e;if(n&&n.clear_persistence)e=!0;else if(n&&n.enable_persistence)e=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==e&&this.persistence.set_disabled(e),e?(this.stop_batch_senders(),this.stop_session_recording()):this._batchers_were_started&&this.start_batch_senders()},E.prototype._gdpr_call_func=function(n,e){return e=m.extend({track:m.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},e),m.localStorage.is_supported()||(e.persistence_type="cookie"),n(this.get_config("token"),{track:e.track,trackEventName:e.track_event_name,trackProperties:e.track_properties,persistenceType:e.persistence_type,persistencePrefix:e.cookie_prefix,cookieDomain:e.cookie_domain,cookieExpiration:e.cookie_expiration,crossSiteCookie:e.cross_site_cookie,crossSubdomainCookie:e.cross_subdomain_cookie,secureCookie:e.secure_cookie,ignoreDnt:e.ignore_dnt})},E.prototype.opt_in_tracking=function(n){n=m.extend({enable_persistence:!0},n),this._gdpr_call_func(oD,n),this._gdpr_update_persistence(n)},E.prototype.opt_out_tracking=function(n){n=m.extend({clear_persistence:!0,delete_user:!0},n),n.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(aD,n),this._gdpr_update_persistence(n)},E.prototype.has_opted_in_tracking=function(n){return this._gdpr_call_func(cD,n)},E.prototype.has_opted_out_tracking=function(n){return this._gdpr_call_func(zB,n)},E.prototype.clear_opt_in_out_tracking=function(n){n=m.extend({enable_persistence:!0},n),this._gdpr_call_func(uD,n),this._gdpr_update_persistence(n)},E.prototype.report_error=function(n,e){we.error.apply(we.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.get_config("error_reporter")(n,e)}catch(t){we.error(t)}},E.prototype.init=E.prototype.init,E.prototype.reset=E.prototype.reset,E.prototype.disable=E.prototype.disable,E.prototype.time_event=E.prototype.time_event,E.prototype.track=E.prototype.track,E.prototype.track_links=E.prototype.track_links,E.prototype.track_forms=E.prototype.track_forms,E.prototype.track_pageview=E.prototype.track_pageview,E.prototype.register=E.prototype.register,E.prototype.register_once=E.prototype.register_once,E.prototype.unregister=E.prototype.unregister,E.prototype.identify=E.prototype.identify,E.prototype.alias=E.prototype.alias,E.prototype.name_tag=E.prototype.name_tag,E.prototype.set_config=E.prototype.set_config,E.prototype.get_config=E.prototype.get_config,E.prototype.get_api_host=E.prototype.get_api_host,E.prototype.get_property=E.prototype.get_property,E.prototype.get_distinct_id=E.prototype.get_distinct_id,E.prototype.toString=E.prototype.toString,E.prototype.opt_out_tracking=E.prototype.opt_out_tracking,E.prototype.opt_in_tracking=E.prototype.opt_in_tracking,E.prototype.has_opted_out_tracking=E.prototype.has_opted_out_tracking,E.prototype.has_opted_in_tracking=E.prototype.has_opted_in_tracking,E.prototype.clear_opt_in_out_tracking=E.prototype.clear_opt_in_out_tracking,E.prototype.get_group=E.prototype.get_group,E.prototype.set_group=E.prototype.set_group,E.prototype.add_group=E.prototype.add_group,E.prototype.remove_group=E.prototype.remove_group,E.prototype.track_with_groups=E.prototype.track_with_groups,E.prototype.start_batch_senders=E.prototype.start_batch_senders,E.prototype.stop_batch_senders=E.prototype.stop_batch_senders,E.prototype.start_session_recording=E.prototype.start_session_recording,E.prototype.stop_session_recording=E.prototype.stop_session_recording,E.prototype.pause_session_recording=E.prototype.pause_session_recording,E.prototype.resume_session_recording=E.prototype.resume_session_recording,E.prototype.get_session_recording_properties=E.prototype.get_session_recording_properties,E.prototype.get_session_replay_url=E.prototype.get_session_replay_url,E.prototype.get_tab_id=E.prototype.get_tab_id,E.prototype.DEFAULT_API_ROUTES=OC,E.prototype.__get_recorder=E.prototype.__get_recorder,re.prototype.properties=re.prototype.properties,re.prototype.update_search_keyword=re.prototype.update_search_keyword,re.prototype.update_referrer_info=re.prototype.update_referrer_info,re.prototype.get_cross_subdomain=re.prototype.get_cross_subdomain,re.prototype.clear=re.prototype.clear;var cA={},VD=function(){m.each(cA,function(n,e){e!==en&&(Ut[e]=n)}),Ut._=m},GD=function(){Ut.init=function(n,e,t){if(t)return Ut[t]||(Ut[t]=cA[t]=Ip(n,e,t),Ut[t]._loaded()),Ut[t];var r=Ut;cA[en]?r=cA[en]:n&&(r=Ip(n,e,en),r._loaded(),cA[en]=r),Ut=r,Up===DD&&(V[en]=Ut),VD()}},jD=function(){function n(){n.done||(n.done=!0,LC=!0,PC=!1,m.each(cA,function(r){r._dom_loaded()}))}function e(){try{ye.documentElement.doScroll("left")}catch{setTimeout(e,1);return}n()}if(ye.addEventListener)ye.readyState==="complete"?n():ye.addEventListener("DOMContentLoaded",n,!1);else if(ye.attachEvent){ye.attachEvent("onreadystatechange",n);var t=!1;try{t=V.frameElement===null}catch{}ye.documentElement.doScroll&&t&&e()}m.register_event(V,"load",n,!0)};function WD(n){return xC=n,Up=QC,Ut=new E,GD(),Ut.init(),jD(),Ut}function qD(n,e){e()}var Nc=WD(qD);iy({identify:()=>{},track:()=>{},page:()=>{},reset:()=>{}});function JD(n,e={}){const t=e.instanceName||`obi_${Math.random().toString(36).slice(2)}`;Nc.init(n,{debug:e.debug===!0,track_pageview:!1,persistence:"localStorage",...e.config||{}},t);const r=Nc.get_instance?Nc.get_instance(t):Nc[t];return{identify:(i,A)=>{var s;try{r.identify(i),A&&((s=r==null?void 0:r.people)!=null&&s.set)&&r.people.set(A)}catch{}},track:(i,A)=>{try{r.track(i,A||{})}catch{}},page:(i,A)=>{try{r.track("Page Viewed",{name:i,...A||{}})}catch{}},reset:()=>{try{r.reset()}catch{}}}}let xp=null;function Ue(){return xp||(xp=JD("d37cde23ca4b5d8c7ed30653f07f9e47"),xp)}const zD=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,DC="9.23.0",uA=globalThis;function XD(n,e,t=uA){const r=t.__SENTRY__=t.__SENTRY__||{},i=r[DC]=r[DC]||{};return i[n]||(i[n]=e())}const YD="Sentry Logger ",NC=["debug","info","warn","error","log","assert","trace"],HC={};function ZD(n){if(!("console"in uA))return n();const e=uA.console,t={},r=Object.keys(HC);r.forEach(i=>{const A=HC[i];t[i]=e[i],e[i]=A});try{return n()}finally{r.forEach(i=>{e[i]=t[i]})}}function $D(){let n=!1;const e={enable:()=>{n=!0},disable:()=>{n=!1},isEnabled:()=>n};return zD?NC.forEach(t=>{e[t]=(...r)=>{n&&ZD(()=>{uA.console[t](`${YD}[${t}]:`,...r)})}}):NC.forEach(t=>{e[t]=()=>{}}),e}XD("logger",$D);const KC=1e3;function e4(){return Date.now()/KC}function t4(){const{performance:n}=uA;if(!(n!=null&&n.now))return e4;const e=Date.now()-n.now(),t=n.timeOrigin==null?e:n.timeOrigin;return()=>(t+n.now())/KC}t4();const VC=50,lA="?",GC=/\(error: (.*)\)/,jC=/captureMessage|captureException/;function n4(...n){const e=n.sort((t,r)=>t[0]-r[0]).map(t=>t[1]);return(t,r=0,i=0)=>{const A=[],s=t.split(`
123
+ `);var e="",t,r,i=0,A;for(t=r=0,i=n.length,A=0;A<i;A++){var s=n.charCodeAt(A),o=null;s<128?r++:s>127&&s<2048?o=String.fromCharCode(s>>6|192,s&63|128):o=String.fromCharCode(s>>12|224,s>>6&63|128,s&63|128),o!==null&&(r>t&&(e+=n.substring(t,r)),e+=o,t=r=A+1)}return r>t&&(e+=n.substring(t,n.length)),e},m.UUID=function(){try{return V.crypto.randomUUID()}catch{for(var n=new Array(36),e=0;e<36;e++)n[e]=Math.floor(Math.random()*16);return n[14]=4,n[19]=n[19]&=-5,n[19]=n[19]|=8,n[8]=n[13]=n[18]=n[23]="-",m.map(n,function(t){return t.toString(16)}).join("")}};var GB=["ahrefsbot","ahrefssiteaudit","amazonbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandex","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];m.isBlockedUA=function(n){var e;for(n=n.toLowerCase(),e=0;e<GB.length;e++)if(n.indexOf(GB[e])!==-1)return!0;return!1},m.HTTPBuildQuery=function(n,e){var t,r,i=[];return m.isUndefined(e)&&(e="&"),m.each(n,function(A,s){t=encodeURIComponent(A.toString()),r=encodeURIComponent(s),i[i.length]=r+"="+t}),i.join(e)},m.getQueryParam=function(n,e){e=e.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var t="[\\?&]"+e+"=([^&#]*)",r=new RegExp(t),i=r.exec(n);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var A=i[1];try{A=decodeURIComponent(A)}catch{we.error("Skipping decoding for malformed query param: "+A)}return A.replace(/\+/g," ")},m.cookie={get:function(n){for(var e=n+"=",t=ye.cookie.split(";"),r=0;r<t.length;r++){for(var i=t[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}return null},parse:function(n){var e;try{e=m.JSONDecode(m.cookie.get(n))||{}}catch{}return e},set_seconds:function(n,e,t,r,i,A,s){var o="",a="",c="";if(s)o="; domain="+s;else if(r){var u=qB(ye.location.hostname);o=u?"; domain=."+u:""}if(t){var l=new Date;l.setTime(l.getTime()+t*1e3),a="; expires="+l.toGMTString()}A&&(i=!0,c="; SameSite=None"),i&&(c+="; secure"),ye.cookie=n+"="+encodeURIComponent(e)+a+"; path=/"+o+c},set:function(n,e,t,r,i,A,s){var o="",a="",c="";if(s)o="; domain="+s;else if(r){var u=qB(ye.location.hostname);o=u?"; domain=."+u:""}if(t){var l=new Date;l.setTime(l.getTime()+t*24*60*60*1e3),a="; expires="+l.toGMTString()}A&&(i=!0,c="; SameSite=None"),i&&(c+="; secure");var d=n+"="+encodeURIComponent(e)+a+"; path=/"+o+c;return ye.cookie=d,d},remove:function(n,e,t){m.cookie.set(n,"",-1,e,!1,!1,t)}};var jB=function(n){var e=!0;try{var t="__mplss_"+Ap(8),r="xyz";n.setItem(t,r),n.getItem(t)!==r&&(e=!1),n.removeItem(t)}catch{e=!1}return e},rp=null,Cs=function(n,e){return rp!==null&&!e?rp:rp=jB(n||V.localStorage)},ip=null,zL=function(n,e){return ip!==null&&!e?ip:ip=jB(n||V.sessionStorage)};function WB(n,e,t){var r=function(i){we.error(e+" error: "+i)};return{is_supported:function(i){var A=t(n,i);return A||we.error(e+" unsupported"),A},error:r,get:function(i){try{return n.getItem(i)}catch(A){r(A)}return null},parse:function(i){try{return m.JSONDecode(n.getItem(i))||{}}catch{}return null},set:function(i,A){try{n.setItem(i,A)}catch(s){r(s)}},remove:function(i){try{n.removeItem(i)}catch(A){r(A)}}}}m.localStorage=WB(V.localStorage,"localStorage",Cs),m.sessionStorage=WB(V.sessionStorage,"sessionStorage",zL),m.register_event=function(){var n=function(r,i,A,s,o){if(!r){we.error("No valid element provided to register_event");return}if(r.addEventListener&&!s)r.addEventListener(i,A,!!o);else{var a="on"+i,c=r[a];r[a]=e(r,A,c)}};function e(r,i,A){var s=function(o){if(o=o||t(V.event),!!o){var a=!0,c,u;return m.isFunction(A)&&(c=A(o)),u=i.call(r,o),(c===!1||u===!1)&&(a=!1),a}};return s}function t(r){return r&&(r.preventDefault=t.preventDefault,r.stopPropagation=t.stopPropagation),r}return t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0},n}();var XL=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');m.dom_query=function(){function n(i){return i.all?i.all:i.getElementsByTagName("*")}var e=/[\t\r\n]/g;function t(i,A){var s=" "+A+" ";return(" "+i.className+" ").replace(e," ").indexOf(s)>=0}function r(i){if(!ye.getElementsByTagName)return[];var A=i.split(" "),s,o,a,c,u,l,d,h,f,p,g=[ye];for(l=0;l<A.length;l++){if(s=A[l].replace(/^\s+/,"").replace(/\s+$/,""),s.indexOf("#")>-1){o=s.split("#"),a=o[0];var v=o[1],y=ye.getElementById(v);if(!y||a&&y.nodeName.toLowerCase()!=a)return[];g=[y];continue}if(s.indexOf(".")>-1){o=s.split("."),a=o[0];var B=o[1];for(a||(a="*"),c=[],u=0,d=0;d<g.length;d++)for(a=="*"?f=n(g[d]):f=g[d].getElementsByTagName(a),h=0;h<f.length;h++)c[u++]=f[h];for(g=[],p=0,d=0;d<c.length;d++)c[d].className&&m.isString(c[d].className)&&t(c[d],B)&&(g[p++]=c[d]);continue}var b=s.match(XL);if(b){a=b[1];var w=b[2],_=b[3],k=b[4];for(a||(a="*"),c=[],u=0,d=0;d<g.length;d++)for(a=="*"?f=n(g[d]):f=g[d].getElementsByTagName(a),h=0;h<f.length;h++)c[u++]=f[h];g=[],p=0;var F;switch(_){case"=":F=function(x){return x.getAttribute(w)==k};break;case"~":F=function(x){return x.getAttribute(w).match(new RegExp("\\b"+k+"\\b"))};break;case"|":F=function(x){return x.getAttribute(w).match(new RegExp("^"+k+"-?"))};break;case"^":F=function(x){return x.getAttribute(w).indexOf(k)===0};break;case"$":F=function(x){return x.getAttribute(w).lastIndexOf(k)==x.getAttribute(w).length-k.length};break;case"*":F=function(x){return x.getAttribute(w).indexOf(k)>-1};break;default:F=function(x){return x.getAttribute(w)}}for(g=[],p=0,d=0;d<c.length;d++)F(c[d])&&(g[p++]=c[d]);continue}for(a=s,c=[],u=0,d=0;d<g.length;d++)for(f=g[d].getElementsByTagName(a),h=0;h<f.length;h++)c[u++]=f[h];g=c}return g}return function(i){return m.isElement(i)?[i]:m.isObject(i)&&!m.isUndefined(i.length)?i:r.call(this,i)}}();var YL=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],ZL=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];m.info={campaignParams:function(n){var e="",t={};return m.each(YL,function(r){e=m.getQueryParam(ye.URL,r),e.length?t[r]=e:n!==void 0&&(t[r]=n)}),t},clickParams:function(){var n="",e={};return m.each(ZL,function(t){n=m.getQueryParam(ye.URL,t),n.length&&(e[t]=n)}),e},marketingParams:function(){return m.extend(m.info.campaignParams(),m.info.clickParams())},searchEngine:function(n){return n.search("https?://(.*)google.([^/?]*)")===0?"google":n.search("https?://(.*)bing.com")===0?"bing":n.search("https?://(.*)yahoo.com")===0?"yahoo":n.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(n){var e=m.info.searchEngine(n),t=e!="yahoo"?"q":"p",r={};if(e!==null){r.$search_engine=e;var i=m.getQueryParam(n,t);i.length&&(r.mp_keyword=i)}return r},browser:function(n,e,t){return e=e||"",t||m.includes(n," OPR/")?m.includes(n,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":m.includes(n,"IEMobile")||m.includes(n,"WPDesktop")?"Internet Explorer Mobile":m.includes(n,"SamsungBrowser/")?"Samsung Internet":m.includes(n,"Edge")||m.includes(n,"Edg/")?"Microsoft Edge":m.includes(n,"FBIOS")?"Facebook Mobile":m.includes(n,"Whale/")?"Whale Browser":m.includes(n,"Chrome")?"Chrome":m.includes(n,"CriOS")?"Chrome iOS":m.includes(n,"UCWEB")||m.includes(n,"UCBrowser")?"UC Browser":m.includes(n,"FxiOS")?"Firefox iOS":m.includes(e,"Apple")?m.includes(n,"Mobile")?"Mobile Safari":"Safari":m.includes(n,"Android")?"Android Mobile":m.includes(n,"Konqueror")?"Konqueror":m.includes(n,"Firefox")?"Firefox":m.includes(n,"MSIE")||m.includes(n,"Trident/")?"Internet Explorer":m.includes(n,"Gecko")?"Mozilla":""},browserVersion:function(n,e,t){var r=m.info.browser(n,e,t),i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/},A=i[r];if(A===void 0)return null;var s=n.match(A);return s?parseFloat(s[s.length-2]):null},os:function(){var n=qn;return/Windows/i.test(n)?/Phone/.test(n)||/WPDesktop/.test(n)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(n)?"iOS":/Android/.test(n)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":/Mac/i.test(n)?"Mac OS X":/Linux/.test(n)?"Linux":/CrOS/.test(n)?"Chrome OS":""},device:function(n){return/Windows Phone/i.test(n)||/WPDesktop/.test(n)?"Windows Phone":/iPad/.test(n)?"iPad":/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":/Android/.test(n)?"Android":""},referringDomain:function(n){var e=n.split("/");return e.length>=3?e[2]:""},currentUrl:function(){return V.location.href},properties:function(n){return typeof n!="object"&&(n={}),m.extend(m.strip_empty_properties({$os:m.info.os(),$browser:m.info.browser(qn,Ur.vendor,Tc),$referrer:ye.referrer,$referring_domain:m.info.referringDomain(ye.referrer),$device:m.info.device(qn)}),{$current_url:m.info.currentUrl(),$browser_version:m.info.browserVersion(qn,Ur.vendor,Tc),$screen_height:DB.height,$screen_width:DB.width,mp_lib:"web",$lib_version:gn.LIB_VERSION,$insert_id:Ap(),time:m.timestamp()/1e3},m.strip_empty_properties(n))},people_properties:function(){return m.extend(m.strip_empty_properties({$os:m.info.os(),$browser:m.info.browser(qn,Ur.vendor,Tc)}),{$browser_version:m.info.browserVersion(qn,Ur.vendor,Tc)})},mpPageViewProperties:function(){return m.strip_empty_properties({current_page_title:ye.title,current_domain:V.location.hostname,current_url_path:V.location.pathname,current_url_protocol:V.location.protocol,current_url_search:V.location.search})}};var $L=function(n,e){var t=null,r=[];return function(i){var A=this;return r.push(i),t||(t=new be(function(s){setTimeout(function(){var o=n.apply(A,[r]);t=null,r=[],s(o)},e)})),t}},Ap=function(n){var e=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return n?e.substring(0,n):e},eD=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,tD=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,qB=function(n){var e=tD,t=n.split("."),r=t[t.length-1];(r.length>4||r==="com"||r==="org")&&(e=eD);var i=n.match(e);return i?i[0]:""},nD=function(){var n=V.navigator.onLine;return m.isUndefined(n)||n},Tr=function(){},tA=null,Ic=null;typeof JSON<"u"&&(tA=JSON.stringify,Ic=JSON.parse),tA=tA||m.JSONEncode,Ic=Ic||m.JSONDecode,m.info=m.info,m.info.browser=m.info.browser,m.info.browserVersion=m.info.browserVersion,m.info.device=m.info.device,m.info.properties=m.info.properties,m.isBlockedUA=m.isBlockedUA,m.isEmptyObject=m.isEmptyObject,m.isObject=m.isObject,m.JSONDecode=m.JSONDecode,m.JSONEncode=m.JSONEncode,m.toArray=m.toArray,m.NPO=Er;var rD="mixpanelBrowserDb",JB="mixpanelRecordingEvents",sp="mixpanelRecordingRegistry",iD=1,AD=[JB,sp],In=function(n){this.dbPromise=null,this.storeName=n};In.prototype._openDb=function(){return new be(function(n,e){var t=V.indexedDB.open(rD,iD);t.onerror=function(){e(t.error)},t.onsuccess=function(){n(t.result)},t.onupgradeneeded=function(r){var i=r.target.result;AD.forEach(function(A){i.createObjectStore(A)})}})},In.prototype.init=function(){return V.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(n){return n instanceof V.IDBDatabase?be.resolve():be.reject(n)})):be.reject("indexedDB is not supported in this browser")},In.prototype.makeTransaction=function(n,e){var t=this.storeName,r=function(i){return new be(function(A,s){var o=i.transaction(t,n);o.oncomplete=function(){A(o)},o.onabort=o.onerror=function(){s(o.error)},e(o.objectStore(t))})};return this.dbPromise.then(r).catch((function(i){return i&&i.name==="InvalidStateError"?(this.dbPromise=this._openDb(),this.dbPromise.then(r)):be.reject(i)}).bind(this))},In.prototype.setItem=function(n,e){return this.makeTransaction("readwrite",function(t){t.put(e,n)})},In.prototype.getItem=function(n){var e;return this.makeTransaction("readonly",function(t){e=t.get(n)}).then(function(){return e.result})},In.prototype.removeItem=function(n){return this.makeTransaction("readwrite",function(e){e.delete(n)})},In.prototype.getAll=function(){var n;return this.makeTransaction("readonly",function(e){n=e.getAll()}).then(function(){return n.result})};var sD="__mp_opt_in_out_";function oD(n,e){YB(!0,n,e)}function aD(n,e){YB(!1,n,e)}function cD(n,e){return XB(n,e)==="1"}function zB(n,e){if(lD(e))return we.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var t=XB(n,e)==="0";return t&&we.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),t}function Ir(n){return cp(n,function(e){return this.get_config(e)})}function Fr(n){return cp(n,function(e){return this._get_config(e)})}function nA(n){return cp(n,function(e){return this._get_config(e)})}function uD(n,e){e=e||{},op(e).remove(ap(n,e),!!e.crossSubdomainCookie,e.cookieDomain)}function op(n){return n=n||{},n.persistenceType==="localStorage"?m.localStorage:m.cookie}function ap(n,e){return e=e||{},(e.persistencePrefix||sD)+n}function XB(n,e){return op(e).get(ap(n,e))}function lD(n){if(n&&n.ignoreDnt)return!1;var e=n&&n.window||V,t=e.navigator||{},r=!1;return m.each([t.doNotTrack,t.msDoNotTrack,e.doNotTrack],function(i){m.includes([!0,1,"1","yes"],i)&&(r=!0)}),r}function YB(n,e,t){if(!m.isString(e)||!e.length){we.error("gdpr."+(n?"optIn":"optOut")+" called with an invalid token");return}t=t||{},op(t).set(ap(e,t),n?1:0,m.isNumber(t.cookieExpiration)?t.cookieExpiration:null,!!t.crossSubdomainCookie,!!t.secureCookie,!!t.crossSiteCookie,t.cookieDomain),t.track&&n&&t.track(t.trackEventName||"$opt_in",t.trackProperties,{send_immediately:!0})}function cp(n,e){return function(){var t=!1;try{var r=e.call(this,"token"),i=e.call(this,"ignore_dnt"),A=e.call(this,"opt_out_tracking_persistence_type"),s=e.call(this,"opt_out_tracking_cookie_prefix"),o=e.call(this,"window");r&&(t=zB(r,{ignoreDnt:i,persistenceType:A,persistencePrefix:s,window:o}))}catch(c){we.error("Unexpected error when checking tracking opt-out status: "+c)}if(!t)return n.apply(this,arguments);var a=arguments[arguments.length-1];typeof a=="function"&&a(0)}}var dD=ri("lock"),ZB=function(n,e){e=e||{},this.storageKey=n,this.storage=e.storage||V.localStorage,this.pollIntervalMS=e.pollIntervalMS||100,this.timeoutMS=e.timeoutMS||2e3,this.promiseImpl=e.promiseImpl||be};ZB.prototype.withLock=function(n,e){var t=this.promiseImpl;return new t(m.bind(function(r,i){var A=e||new Date().getTime()+"|"+Math.random(),s=new Date().getTime(),o=this.storageKey,a=this.pollIntervalMS,c=this.timeoutMS,u=this.storage,l=o+":X",d=o+":Y",h=o+":Z",f=function(B){if(new Date().getTime()-s>c){dD.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+A+"]"),u.removeItem(h),u.removeItem(d),v();return}setTimeout(function(){try{B()}catch(b){i(b)}},a*(Math.random()+.1))},p=function(B,b){B()?b():f(function(){p(B,b)})},g=function(){var B=u.getItem(d);return B&&B!==A?!1:(u.setItem(d,A),u.getItem(d)===A?!0:(Cs(u,!0)||i(new Error("localStorage support dropped while acquiring lock")),!1))},v=function(){u.setItem(l,A),p(g,function(){if(u.getItem(l)===A){y();return}f(function(){if(u.getItem(d)!==A){v();return}p(function(){return!u.getItem(h)},y)})})},y=function(){u.setItem(h,"1");var B=function(){u.removeItem(h),u.getItem(d)===A&&u.removeItem(d),u.getItem(l)===A&&u.removeItem(l)};n().then(function(b){B(),r(b)}).catch(function(b){B(),i(b)})};try{if(Cs(u,!0))v();else throw new Error("localStorage support check failed")}catch(B){i(B)}},this))};var _s=function(n){this.storage=n||V.localStorage};_s.prototype.init=function(){return be.resolve()},_s.prototype.setItem=function(n,e){return new be(m.bind(function(t,r){try{this.storage.setItem(n,tA(e))}catch(i){r(i)}t()},this))},_s.prototype.getItem=function(n){return new be(m.bind(function(e,t){var r;try{r=Ic(this.storage.getItem(n))}catch(i){t(i)}e(r)},this))},_s.prototype.removeItem=function(n){return new be(m.bind(function(e,t){try{this.storage.removeItem(n)}catch(r){t(r)}e()},this))};var $B=ri("batch"),Fn=function(n,e){e=e||{},this.storageKey=n,this.usePersistence=e.usePersistence,this.usePersistence&&(this.queueStorage=e.queueStorage||new _s,this.lock=new ZB(n,{storage:e.sharedLockStorage||V.localStorage,timeoutMS:e.sharedLockTimeoutMS})),this.reportError=e.errorReporter||m.bind($B.error,$B),this.pid=e.pid||null,this.memQueue=[],this.initialized=!1,e.enqueueThrottleMs?this.enqueuePersisted=$L(m.bind(this._enqueuePersisted,this),e.enqueueThrottleMs):this.enqueuePersisted=m.bind(function(t){return this._enqueuePersisted([t])},this)};Fn.prototype.ensureInit=function(){return this.initialized?be.resolve():this.queueStorage.init().then(m.bind(function(){this.initialized=!0},this)).catch(m.bind(function(n){this.reportError("Error initializing queue persistence. Disabling persistence",n),this.initialized=!0,this.usePersistence=!1},this))},Fn.prototype.enqueue=function(n,e){var t={id:Ap(),flushAfter:new Date().getTime()+e*2,payload:n};return this.usePersistence?this.enqueuePersisted(t):(this.memQueue.push(t),be.resolve(!0))},Fn.prototype._enqueuePersisted=function(n){var e=m.bind(function(){return this.ensureInit().then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(t){return this.saveToStorage(t.concat(n))},this)).then(m.bind(function(t){return t&&(this.memQueue=this.memQueue.concat(n)),t},this)).catch(m.bind(function(t){return this.reportError("Error enqueueing items",t,n),!1},this))},this);return this.lock.withLock(e,this.pid).catch(m.bind(function(t){return this.reportError("Error acquiring storage lock",t),!1},this))},Fn.prototype.fillBatch=function(n){var e=this.memQueue.slice(0,n);return this.usePersistence&&e.length<n?this.ensureInit().then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(t){if(t.length){var r={};m.each(e,function(s){r[s.id]=!0});for(var i=0;i<t.length;i++){var A=t[i];if(new Date().getTime()>A.flushAfter&&!r[A.id]&&(A.orphaned=!0,e.push(A),e.length>=n))break}}return e},this)):be.resolve(e)};var eC=function(n,e){var t=[];return m.each(n,function(r){r.id&&!e[r.id]&&t.push(r)}),t};Fn.prototype.removeItemsByID=function(n){var e={};if(m.each(n,function(r){e[r]=!0}),this.memQueue=eC(this.memQueue,e),this.usePersistence){var t=m.bind(function(){return this.ensureInit().then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(r){return r=eC(r,e),this.saveToStorage(r)},this)).then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(r){for(var i=0;i<r.length;i++){var A=r[i];if(A.id&&e[A.id])throw new Error("Item not removed from storage")}return!0},this)).catch(m.bind(function(r){return this.reportError("Error removing items",r,n),!1},this))},this);return this.lock.withLock(t,this.pid).catch(m.bind(function(r){return this.reportError("Error acquiring storage lock",r),Cs(this.lock.storage,!0)?!1:t().then(m.bind(function(i){return i||this.queueStorage.removeItem(this.storageKey).then(function(){return i})},this)).catch(m.bind(function(i){return this.reportError("Error clearing queue",i),!1},this))},this))}else return be.resolve(!0)};var tC=function(n,e){var t=[];return m.each(n,function(r){var i=r.id;if(i in e){var A=e[i];A!==null&&(r.payload=A,t.push(r))}else t.push(r)}),t};Fn.prototype.updatePayloads=function(n){return this.memQueue=tC(this.memQueue,n),this.usePersistence?this.lock.withLock(m.bind(function(){return this.ensureInit().then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(e){return e=tC(e,n),this.saveToStorage(e)},this)).catch(m.bind(function(e){return this.reportError("Error updating items",n,e),!1},this))},this),this.pid).catch(m.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this)):be.resolve(!0)},Fn.prototype.readFromStorage=function(){return this.ensureInit().then(m.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(m.bind(function(n){return n&&(m.isArray(n)||(this.reportError("Invalid storage entry:",n),n=null)),n||[]},this)).catch(m.bind(function(n){return this.reportError("Error retrieving queue",n),[]},this))},Fn.prototype.saveToStorage=function(n){return this.ensureInit().then(m.bind(function(){return this.queueStorage.setItem(this.storageKey,n)},this)).then(function(){return!0}).catch(m.bind(function(e){return this.reportError("Error saving queue",e),!1},this))},Fn.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(m.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):be.resolve()};var hD=10*60*1e3,Ss=ri("batch"),$t=function(n,e){this.errorReporter=e.errorReporter,this.queue=new Fn(n,{errorReporter:m.bind(this.reportError,this),queueStorage:e.queueStorage,sharedLockStorage:e.sharedLockStorage,sharedLockTimeoutMS:e.sharedLockTimeoutMS,usePersistence:e.usePersistence,enqueueThrottleMs:e.enqueueThrottleMs}),this.libConfig=e.libConfig,this.sendRequest=e.sendRequestFunc,this.beforeSendHook=e.beforeSendHook,this.stopAllBatching=e.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=e.flushOnlyOnInterval||!1,this._flushPromise=null};$t.prototype.enqueue=function(n){return this.queue.enqueue(n,this.flushInterval)},$t.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},$t.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},$t.prototype.clear=function(){return this.queue.clear()},$t.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},$t.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},$t.prototype.scheduleFlush=function(n){this.flushInterval=n,this.stopped||(this.timeoutID=setTimeout(m.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))},$t.prototype.sendRequestPromise=function(n,e){return new be(m.bind(function(t){this.sendRequest(n,e,t)},this))},$t.prototype.flush=function(n){if(this.requestInProgress)return Ss.log("Flush: Request already in progress"),be.resolve();this.requestInProgress=!0,n=n||{};var e=this.libConfig.batch_request_timeout_ms,t=new Date().getTime(),r=this.batchSize;return this.queue.fillBatch(r).then(m.bind(function(i){var A=i.length===r,s=[],o={};if(m.each(i,function(l){var d=l.payload;if(this.beforeSendHook&&!l.orphaned&&(d=this.beforeSendHook(d)),d){d.event&&d.properties&&(d.properties=m.extend({},d.properties,{mp_sent_by_lib_version:gn.LIB_VERSION}));var h=!0,f=l.id;f?(this.itemIdsSentSuccessfully[f]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:l,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[f]}),h=!1):this.reportError("[dupe] found item with no ID",{item:l}),h&&s.push(d)}o[l.id]=d},this),s.length<1)return this.requestInProgress=!1,this.resetFlush(),be.resolve();var a=m.bind(function(){return this.queue.removeItemsByID(m.map(i,function(l){return l.id})).then(m.bind(function(l){return m.each(i,m.bind(function(d){var h=d.id;h?(this.itemIdsSentSuccessfully[h]=this.itemIdsSentSuccessfully[h]||0,this.itemIdsSentSuccessfully[h]++,this.itemIdsSentSuccessfully[h]>5&&this.reportError("[dupe] item ID sent too many times",{item:d,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[h]})):this.reportError("[dupe] found item with no ID while removing",{item:d})},this)),l?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!A?(this.resetFlush(),be.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),be.resolve())},this))},this),c=m.bind(function(l){this.requestInProgress=!1;try{if(n.unloading)return this.queue.updatePayloads(o);if(m.isObject(l)&&l.error==="timeout"&&new Date().getTime()-t>=e)return this.reportError("Network timeout; retrying"),this.flush();if(m.isObject(l)&&(l.httpStatusCode>=500||l.httpStatusCode===429||l.httpStatusCode<=0&&!nD()||l.error==="timeout")){var d=this.flushInterval*2;return l.retryAfter&&(d=parseInt(l.retryAfter,10)*1e3||d),d=Math.min(hD,d),this.reportError("Error; retry in "+d+" ms"),this.scheduleFlush(d),be.resolve()}else if(m.isObject(l)&&l.httpStatusCode===413)if(i.length>1){var h=Math.max(1,Math.floor(r/2));return this.batchSize=Math.min(this.batchSize,h,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),be.resolve()}else return this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),a();else return a()}catch(f){this.reportError("Error handling API response",f),this.resetFlush()}},this),u={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:e};return n.unloading&&(u.transport="sendBeacon"),Ss.log("MIXPANEL REQUEST:",s),this.sendRequestPromise(s,u).then(c)},this)).catch(m.bind(function(i){this.reportError("Error flushing request queue",i),this.resetFlush()},this))},$t.prototype.reportError=function(n,e){if(Ss.error.apply(Ss.error,arguments),this.errorReporter)try{e instanceof Error||(e=new Error(n)),this.errorReporter(n,e)}catch(t){Ss.error(t)}};var up=function(n){var e=Date.now();return!n||e>n.maxExpires||e>n.idleExpires},pD=250,rA=ri("recorder"),nC=V.CompressionStream,fD={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},gD=new Set([z.MouseMove,z.MouseInteraction,z.Scroll,z.ViewportResize,z.Input,z.TouchMove,z.MediaInteraction,z.Drag,z.Selection]);function mD(n){return n.type===le.IncrementalSnapshot&&gD.has(n.data.source)}var Bt=function(n){this._mixpanel=n.mixpanelInstance,this._onIdleTimeout=n.onIdleTimeout||Tr,this._onMaxLengthReached=n.onMaxLengthReached||Tr,this._onBatchSent=n.onBatchSent||Tr,this._rrwebRecord=n.rrwebRecord||null,this._stopRecording=null,this.replayId=n.replayId,this.batchStartUrl=n.batchStartUrl||null,this.replayStartUrl=n.replayStartUrl||null,this.idleExpires=n.idleExpires||null,this.maxExpires=n.maxExpires||null,this.replayStartTime=n.replayStartTime||null,this.seqNo=n.seqNo||0,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=bs,this.recordMinMs=0;var e=Cs(n.sharedLockStorage,!0);this.batcherKey="__mprec_"+this.getConfig("name")+"_"+this.getConfig("token")+"_"+this.replayId,this.queueStorage=new In(JB),this.batcher=new $t(this.batcherKey,{errorReporter:this.reportError.bind(this),flushOnlyOnInterval:!0,libConfig:fD,sendRequestFunc:this.flushEventsWithOptOut.bind(this),queueStorage:this.queueStorage,sharedLockStorage:n.sharedLockStorage,usePersistence:e,stopAllBatchingFunc:this.stopRecording.bind(this),enqueueThrottleMs:pD,sharedLockTimeoutMS:10*1e3})};Bt.prototype.getUserIdInfo=function(){if(this.finalFlushUserIdInfo)return this.finalFlushUserIdInfo;var n={distinct_id:String(this._mixpanel.get_distinct_id())},e=this._mixpanel.get_property("$device_id");e&&(n.$device_id=e);var t=this._mixpanel.get_property("$user_id");return t&&(n.$user_id=t),n},Bt.prototype.unloadPersistedData=function(){return this.batcher.stop(),this.batcher.flush().then((function(){return this.queueStorage.removeItem(this.batcherKey)}).bind(this))},Bt.prototype.getConfig=function(n){return this._mixpanel.get_config(n)},Bt.prototype.get_config=function(n){return this.getConfig(n)},Bt.prototype.startRecording=function(n){if(this._rrwebRecord===null){this.reportError("rrweb record function not provided. ");return}if(this._stopRecording!==null){rA.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>bs&&(this.recordMaxMs=bs,rA.critical("record_max_ms cannot be greater than "+bs+"ms. Capping value.")),this.maxExpires||(this.maxExpires=new Date().getTime()+this.recordMaxMs),this.recordMinMs=this.getConfig("record_min_ms"),this.recordMinMs>Zh&&(this.recordMinMs=Zh,rA.critical("record_min_ms cannot be greater than "+Zh+"ms. Capping value.")),this.replayStartTime||(this.replayStartTime=new Date().getTime(),this.batchStartUrl=m.info.currentUrl(),this.replayStartUrl=m.info.currentUrl()),n||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var e=(function(){clearTimeout(this.idleTimeoutId);var i=this.getConfig("record_idle_timeout_ms");this.idleTimeoutId=setTimeout(this._onIdleTimeout,i),this.idleExpires=new Date().getTime()+i}).bind(this);e();var t=this.getConfig("record_block_selector");(t===""||t===null)&&(t=void 0);try{this._stopRecording=this._rrwebRecord({emit:(function(i){if(this.idleExpires&&this.idleExpires<i.timestamp){this._onIdleTimeout();return}mD(i)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),e()),this.__enqueuePromise=this.batcher.enqueue(i)}).bind(this),blockClass:this.getConfig("record_block_class"),blockSelector:t,collectFonts:this.getConfig("record_collect_fonts"),dataURLOptions:{type:"image/webp",quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector"),recordCanvas:this.getConfig("record_canvas"),sampling:{canvas:15}})}catch(i){this.reportError("Unexpected error when starting rrweb recording.",i)}if(typeof this._stopRecording!="function"){this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,this.stopRecording();return}var r=this.maxExpires-new Date().getTime();this.maxTimeoutId=setTimeout(this._onMaxLengthReached.bind(this),r)},Bt.prototype.stopRecording=function(n){if(this.finalFlushUserIdInfo=this.getUserIdInfo(),!this.isRrwebStopped()){try{this._stopRecording()}catch(t){this.reportError("Error with rrweb stopRecording",t)}this._stopRecording=null}var e;return this.batcher.stopped?e=this.batcher.clear():n||(e=this.batcher.flush()),this.batcher.stop(),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId),e},Bt.prototype.isRrwebStopped=function(){return this._stopRecording===null},Bt.prototype.flushEventsWithOptOut=function(n,e,t){var r=(function(i){i===0&&(this.stopRecording(),t({error:"Tracking has been opted out, stopping recording."}))}).bind(this);this._flushEvents(n,e,t,r)},Bt.prototype.serialize=function(){var n;try{n=this._mixpanel.get_tab_id()}catch(e){this.reportError("Error getting tab ID for serialization ",e),n=null}return{replayId:this.replayId,seqNo:this.seqNo,replayStartTime:this.replayStartTime,batchStartUrl:this.batchStartUrl,replayStartUrl:this.replayStartUrl,idleExpires:this.idleExpires,maxExpires:this.maxExpires,tabId:n}},Bt.deserialize=function(n,e){var t=new Bt(m.extend({},e,{replayId:n.replayId,batchStartUrl:n.batchStartUrl,replayStartUrl:n.replayStartUrl,idleExpires:n.idleExpires,maxExpires:n.maxExpires,replayStartTime:n.replayStartTime,seqNo:n.seqNo,sharedLockStorage:e.sharedLockStorage}));return t},Bt.prototype._sendRequest=function(n,e,t,r){var i=(function(s,o){s.status===200&&this.replayId===n&&(this.seqNo++,this.batchStartUrl=m.info.currentUrl()),this._onBatchSent(),r({status:0,httpStatusCode:s.status,responseBody:o,retryAfter:s.headers.get("Retry-After")})}).bind(this),A=this._mixpanel.get_api_host&&this._mixpanel.get_api_host("record")||this.getConfig("api_host");V.fetch(A+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(e),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:t}).then(function(s){s.json().then(function(o){i(s,o)}).catch(function(o){r({error:o})})}).catch(function(s){r({error:s,httpStatusCode:0})})},Bt.prototype._flushEvents=Ir(function(n,e,t){var r=n.length;if(r>0){for(var i=this.replayId,A=1/0,s=-1/0,o=!1,a=0;a<r;a++)A=Math.min(A,n[a].timestamp),s=Math.max(s,n[a].timestamp),n[a].type===le.FullSnapshot&&(o=!0);if(this.seqNo===0){if(!o){t({error:"First batch does not contain a full snapshot. Aborting recording."}),this.stopRecording(!0);return}this.replayStartTime=A}else this.replayStartTime||(this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=A);var c=s-this.replayStartTime,u={$current_url:this.batchStartUrl,$lib_version:gn.LIB_VERSION,batch_start_time:A/1e3,mp_lib:"web",replay_id:i,replay_length_ms:c,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},l=JSON.stringify(n);if(Object.assign(u,this.getUserIdInfo()),nC){var d=new Blob([l],{type:"application/json"}).stream(),h=d.pipeThrough(new nC("gzip"));new Response(h).blob().then((function(f){u.format="gzip",this._sendRequest(i,u,f,t)}).bind(this))}else u.format="body",this._sendRequest(i,u,l,t)}}),Bt.prototype.reportError=function(n,e){rA.error.apply(rA.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.getConfig("error_reporter")(n,e)}catch(t){rA.error(t)}};var iA=function(n){this.idb=new In(sp),this.errorReporter=n.errorReporter,this.mixpanelInstance=n.mixpanelInstance,this.sharedLockStorage=n.sharedLockStorage};iA.prototype.handleError=function(n){this.errorReporter("IndexedDB error: ",n)},iA.prototype.setActiveRecording=function(n){var e=n.tabId;return e?this.idb.init().then((function(){return this.idb.setItem(e,n)}).bind(this)).catch(this.handleError.bind(this)):(console.warn("No tab ID is set, cannot persist recording metadata."),be.resolve())},iA.prototype.getActiveRecording=function(){return this.idb.init().then((function(){return this.idb.getItem(this.mixpanelInstance.get_tab_id())}).bind(this)).then((function(n){return up(n)?null:n}).bind(this)).catch(this.handleError.bind(this))},iA.prototype.clearActiveRecording=function(){return this.getActiveRecording().then((function(n){if(n)return n.maxExpires=0,this.setActiveRecording(n)}).bind(this)).catch(this.handleError.bind(this))},iA.prototype.flushInactiveRecordings=function(){return this.idb.init().then((function(){return this.idb.getAll()}).bind(this)).then((function(n){var e=n.filter(function(t){return up(t)}).map((function(t){var r=Bt.deserialize(t,{mixpanelInstance:this.mixpanelInstance,sharedLockStorage:this.sharedLockStorage});return r.unloadPersistedData().then((function(){return this.idb.removeItem(t.tabId)}).bind(this)).catch(this.handleError.bind(this))}).bind(this));return be.all(e)}).bind(this)).catch(this.handleError.bind(this))};var ks=ri("recorder"),Jn=function(n,e,t){this.mixpanelInstance=n,this.rrwebRecord=e||Sr,this.sharedLockStorage=t,this.recordingRegistry=new iA({mixpanelInstance:this.mixpanelInstance,errorReporter:ks.error,sharedLockStorage:t}),this._flushInactivePromise=this.recordingRegistry.flushInactiveRecordings(),this.activeRecording=null,this.stopRecordingInProgress=!1};Jn.prototype.startRecording=function(n){if(n=n||{},this.activeRecording&&!this.activeRecording.isRrwebStopped()){ks.log("Recording already in progress, skipping startRecording.");return}var e=(function(){ks.log("Idle timeout reached, restarting recording."),this.resetRecording()}).bind(this),t=(function(){ks.log("Max recording length reached, stopping recording."),this.resetRecording()}).bind(this),r=(function(){this.recordingRegistry.setActiveRecording(this.activeRecording.serialize()),this.__flushPromise=this.activeRecording.batcher._flushPromise}).bind(this),i={mixpanelInstance:this.mixpanelInstance,onBatchSent:r,onIdleTimeout:e,onMaxLengthReached:t,replayId:m.UUID(),rrwebRecord:this.rrwebRecord,sharedLockStorage:this.sharedLockStorage};return n.activeSerializedRecording?this.activeRecording=Bt.deserialize(n.activeSerializedRecording,i):this.activeRecording=new Bt(i),this.activeRecording.startRecording(n.shouldStopBatcher),this.recordingRegistry.setActiveRecording(this.activeRecording.serialize())},Jn.prototype.stopRecording=function(){return this.stopRecordingInProgress=!0,this._stopCurrentRecording(!1,!0).then((function(){return this.recordingRegistry.clearActiveRecording()}).bind(this)).then((function(){this.stopRecordingInProgress=!1}).bind(this))},Jn.prototype.pauseRecording=function(){return this._stopCurrentRecording(!1)},Jn.prototype._stopCurrentRecording=function(n,e){if(this.activeRecording){var t=this.activeRecording.stopRecording(n);return e&&(this.activeRecording=null),t}return be.resolve()},Jn.prototype.resumeRecording=function(n){return this.activeRecording&&this.activeRecording.isRrwebStopped()?(this.activeRecording.startRecording(!1),be.resolve(null)):this.recordingRegistry.getActiveRecording().then((function(e){return e&&!this.stopRecordingInProgress?this.startRecording({activeSerializedRecording:e}):n?this.startRecording({shouldStopBatcher:!1}):(ks.log("No resumable recording found."),null)}).bind(this))},Jn.prototype.resetRecording=function(){this.stopRecording(),this.startRecording({shouldStopBatcher:!0})},Jn.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(Jn.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),V.__mp_recorder=Jn;var Fc="change",ii="click",rC="hashchange",AA="mp_locationchange",iC="popstate",AC="scrollend",lp="submit",vD=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],sC=["mp-include"],dp=["mp-no-track"],oC=dp.concat(["mp-sensitive"]),yD=["aria-label","aria-labelledby","aria-describedby","href","name","role","title","type"],xt=ri("autocapture");function hp(n){for(var e={},t=aC(n).split(" "),r=0;r<t.length;r++){var i=t[r];i&&(e[i]=!0)}return e}function aC(n){switch(typeof n.className){case"string":return n.className;case"object":return n.className.baseVal||n.getAttribute("class")||"";default:return""}}function wD(n){if(n.previousElementSibling)return n.previousElementSibling;do n=n.previousSibling;while(n&&!lC(n));return n}function cC(n,e,t,r,i,A){var s={$classes:aC(n).split(" "),$tag_name:n.tagName.toLowerCase()},o=n.id;o&&(s.$id=o),gp(n,e,i,A)&&m.each(yD.concat(r),function(l){if(n.hasAttribute(l)&&!t[l]){var d=n.getAttribute(l);xc(d)&&(s["$attr-"+l]=d)}});for(var a=1,c=1,u=n;u=wD(u);)a++,u.tagName===n.tagName&&c++;return s.$nth_child=a,s.$nth_of_type=c,s}function bD(n,e){var t=e.allowElementCallback,r=e.allowSelectors||[],i=e.blockAttrs||[],A=e.blockElementCallback,s=e.blockSelectors||[],o=e.captureTextContent||!1,a=e.captureExtraAttrs||[],c=e.capturedForHeatMap||!1,u={};m.each(i,function(w){u[w]=!0});var l=null,d=typeof n.target>"u"?n.srcElement:n.target;if(dC(d)&&(d=d.parentNode),_D(d,n)&&pp(d,n,t,r)&&!fp(d,n,A,s)){for(var h=[d],f=d;f.parentNode&&!xn(f,"body");)h.push(f.parentNode),f=f.parentNode;var p=[],g,v=!1;if(m.each(h,function(w){var _=gp(w,n,t,r);!u.href&&w.tagName.toLowerCase()==="a"&&(g=w.getAttribute("href"),g=_&&xc(g)&&g),fp(w,n,A,s)&&(v=!0),p.push(cC(w,n,u,a,t,r))},this),!v){var y=ye.documentElement;if(l={$event_type:n.type,$host:V.location.host,$pathname:V.location.pathname,$elements:p,$el_attr__href:g,$viewportHeight:Math.max(y.clientHeight,V.innerHeight||0),$viewportWidth:Math.max(y.clientWidth,V.innerWidth||0),$pageHeight:ye.body.offsetHeight||0,$pageWidth:ye.body.offsetWidth||0},m.each(a,function(w){if(!u[w]&&d.hasAttribute(w)){var _=d.getAttribute(w);xc(_)&&(l["$el_attr__"+w]=_)}}),o&&(B=uC(d,n,t,r),B&&B.length&&(l.$el_text=B)),n.type===ii&&(m.each(vD,function(w){w in n&&(l["$"+w]=n[w])}),c&&(l.$captured_for_heatmap=!0),d=BD(n)),o){var B=uC(d,n,t,r);B&&B.length&&(l.$el_text=B)}if(d){if(!pp(d,n,t,r)||fp(d,n,A,s))return null;var b=cC(d,n,u,a,t,r);l.$target=b,l.$el_classes=b.$classes,m.extend(l,m.strip_empty_properties({$el_id:b.$id,$el_tag_name:b.$tag_name}))}}}return l}function uC(n,e,t,r){var i="";return gp(n,e,t,r)&&n.childNodes&&n.childNodes.length&&m.each(n.childNodes,function(A){dC(A)&&A.textContent&&(i+=m.trim(A.textContent).split(/(\s+)/).filter(xc).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),m.trim(i)}function BD(n){for(var e=n.target,t=n.composedPath(),r=0;r<t.length;r++){var i=t[r];if(xn(i,"a")||xn(i,"button")||xn(i,"input")||xn(i,"select")||i.getAttribute&&i.getAttribute("role")==="button"){e=i;break}if(i===e)break}return e}function pp(n,e,t,r){if(t)try{if(!t(n,e))return!1}catch(s){return xt.critical("Error while checking element in allowElementCallback",s),!1}if(!r.length)return!0;for(var i=0;i<r.length;i++){var A=r[i];try{if(n.matches(A))return!0}catch(s){xt.critical("Error while checking selector: "+A,s)}}return!1}function fp(n,e,t,r){var i;if(t)try{if(t(n,e))return!0}catch(o){return xt.critical("Error while checking element in blockElementCallback",o),!0}if(r&&r.length)for(i=0;i<r.length;i++){var A=r[i];try{if(n.matches(A))return!0}catch(o){xt.critical("Error while checking selector: "+A,o)}}var s=hp(n);for(i=0;i<dp.length;i++)if(s[dp[i]])return!0;return!1}function lC(n){return n&&n.nodeType===1}function xn(n,e){return n&&n.tagName&&n.tagName.toLowerCase()===e.toLowerCase()}function dC(n){return n&&n.nodeType===3}function CD(){try{var n=ye.createElement("div");return!!n.matches}catch{return!1}}function _D(n,e){if(!n||xn(n,"html")||!lC(n))return!1;var t=n.tagName.toLowerCase();switch(t){case"form":return e.type===lp;case"input":return["button","submit"].indexOf(n.getAttribute("type"))===-1?e.type===Fc:e.type===ii;case"select":case"textarea":return e.type===Fc;default:return e.type===ii}}function gp(n,e,t,r){var i;if(!pp(n,e,t,r))return!1;for(var A=n;A.parentNode&&!xn(A,"body");A=A.parentNode){var s=hp(A);for(i=0;i<oC.length;i++)if(s[oC[i]])return!1}var o=hp(n);for(i=0;i<sC.length;i++)if(o[sC[i]])return!0;if(xn(n,"input")||xn(n,"select")||xn(n,"textarea")||n.getAttribute("contenteditable")==="true")return!1;var a=n.type||"";if(typeof a=="string")switch(a.toLowerCase()){case"hidden":return!1;case"password":return!1}var c=n.name||n.id||"";if(typeof c=="string"){var u=/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i;if(u.test(c.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function xc(n){if(n===null||m.isUndefined(n))return!1;if(typeof n=="string"){n=m.trim(n);var e=/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/;if(e.test((n||"").replace(/[- ]/g,"")))return!1;var t=/(^\d{3}-?\d{2}-?\d{4}$)/;if(t.test(n))return!1}return!0}var SD=30,kD=1e3,ED=4;function hC(){this.clicks=[]}hC.prototype.isRageClick=function(n,e,t){t=t||{};var r=t.threshold_px||SD,i=t.timeout_ms||kD,A=t.click_count||ED,s=Date.now(),o=this.clicks[this.clicks.length-1];if(o&&s-o.timestamp<i&&Math.sqrt(Math.pow(n-o.x,2)+Math.pow(e-o.y,2))<r){if(this.clicks.push({x:n,y:e,timestamp:s}),this.clicks.length>=A)return this.clicks=[],!0}else this.clicks=[{x:n,y:e,timestamp:s}];return!1};var pC="autocapture",UD="track_pageview",fC="full-url",TD="url-with-path-and-query-string",ID="url-with-path",FD="allow_element_callback",gC="allow_selectors",mC="allow_url_regexes",vC="block_attrs",yC="block_element_callback",wC="block_selectors",bC="block_url_regexes",BC="capture_extra_attrs",CC="capture_text_content",_C="scroll_capture_all",SC="scroll_depth_percent_checkpoints",Qc="click",mp="input",kC="pageview",EC="rage_click",vp="scroll",yp="submit",gt={};gt[gC]=[],gt[mC]=[],gt[vC]=[],gt[yC]=null,gt[wC]=[],gt[bC]=[],gt[BC]=[],gt[CC]=!1,gt[_C]=!1,gt[SC]=[25,50,75,100],gt[Qc]=!0,gt[mp]=!0,gt[kC]=fC,gt[EC]=!0,gt[vp]=!0,gt[yp]=!0;var Rc={$mp_autocapture:!0},UC="$mp_click",xD="$mp_input_change",TC="$mp_rage_click",QD="$mp_scroll",RD="$mp_submit",Qt=function(n){this.mp=n};Qt.prototype.init=function(){if(!CD()){xt.critical("Autocapture unavailable: missing required DOM APIs");return}this.initPageviewTracking(),this.initClickTracking(),this.initInputTracking(),this.initScrollTracking(),this.initSubmitTracking(),this.initRageClickTracking()},Qt.prototype.getFullConfig=function(){var n=this.mp.get_config(pC);return n?m.isObject(n)?m.extend({},gt,n):gt:{}},Qt.prototype.getConfig=function(n){return this.getFullConfig()[n]},Qt.prototype.currentUrlBlocked=function(){var n,e=m.info.currentUrl(),t=this.getConfig(mC)||[];if(t.length){var r=!1;for(n=0;n<t.length;n++){var i=t[n];try{if(e.match(i)){r=!0;break}}catch(s){return xt.critical("Error while checking block URL regex: "+i,s),!0}}if(!r)return!0}var A=this.getConfig(bC)||[];if(!A||!A.length)return!1;for(n=0;n<A.length;n++)try{if(e.match(A[n]))return!0}catch(s){return xt.critical("Error while checking block URL regex: "+A[n],s),!0}return!1},Qt.prototype.pageviewTrackingConfig=function(){return this.mp.get_config(pC)?this.getConfig(kC):this.mp.get_config(UD)},Qt.prototype.trackDomEvent=function(n,e){if(!this.currentUrlBlocked()){var t=this.mp.is_recording_heatmap_data()&&(e===UC&&!this.getConfig(Qc)||e===TC&&!this._getRageClickConfig()),r=bD(n,{allowElementCallback:this.getConfig(FD),allowSelectors:this.getConfig(gC),blockAttrs:this.getConfig(vC),blockElementCallback:this.getConfig(yC),blockSelectors:this.getConfig(wC),captureExtraAttrs:this.getConfig(BC),captureTextContent:this.getConfig(CC),capturedForHeatMap:t});r&&(m.extend(r,Rc),this.mp.track(e,r))}},Qt.prototype._getRageClickConfig=function(){var n=this.getConfig(EC);return n?n===!0?{}:typeof n=="object"?n:{}:null},Qt.prototype.initClickTracking=function(){V.removeEventListener(ii,this.listenerClick),!(!this.getConfig(Qc)&&!this.mp.get_config("record_heatmap_data"))&&(xt.log("Initializing click tracking"),this.listenerClick=V.addEventListener(ii,(function(n){!this.getConfig(Qc)&&!this.mp.is_recording_heatmap_data()||this.trackDomEvent(n,UC)}).bind(this)))},Qt.prototype.initInputTracking=function(){V.removeEventListener(Fc,this.listenerChange),this.getConfig(mp)&&(xt.log("Initializing input tracking"),this.listenerChange=V.addEventListener(Fc,(function(n){this.getConfig(mp)&&this.trackDomEvent(n,xD)}).bind(this)))},Qt.prototype.initPageviewTracking=function(){if(V.removeEventListener(iC,this.listenerPopstate),V.removeEventListener(rC,this.listenerHashchange),V.removeEventListener(AA,this.listenerLocationchange),!!this.pageviewTrackingConfig()){xt.log("Initializing pageview tracking");var n="",e=!1;this.currentUrlBlocked()||(e=this.mp.track_pageview(Rc)),e&&(n=m.info.currentUrl()),this.listenerPopstate=V.addEventListener(iC,function(){V.dispatchEvent(new Event(AA))}),this.listenerHashchange=V.addEventListener(rC,function(){V.dispatchEvent(new Event(AA))});var t=V.history.pushState;typeof t=="function"&&(V.history.pushState=function(i,A,s){t.call(V.history,i,A,s),V.dispatchEvent(new Event(AA))});var r=V.history.replaceState;typeof r=="function"&&(V.history.replaceState=function(i,A,s){r.call(V.history,i,A,s),V.dispatchEvent(new Event(AA))}),this.listenerLocationchange=V.addEventListener(AA,np((function(){if(!this.currentUrlBlocked()){var i=m.info.currentUrl(),A=!1,s=i.split("#")[0].split("?")[0]!==n.split("#")[0].split("?")[0],o=this.pageviewTrackingConfig();if(o===fC?A=i!==n:o===TD?A=i.split("#")[0]!==n.split("#")[0]:o===ID&&(A=s),A){var a=this.mp.track_pageview(Rc);a&&(n=i),s&&(this.lastScrollCheckpoint=0,xt.log("Path change: re-initializing scroll depth checkpoints"))}}}).bind(this)))}},Qt.prototype.initRageClickTracking=function(){V.removeEventListener(ii,this.listenerRageClick);var n=this._getRageClickConfig();!n&&!this.mp.get_config("record_heatmap_data")||(xt.log("Initializing rage click tracking"),this._rageClickTracker||(this._rageClickTracker=new hC),this.listenerRageClick=(function(e){var t=this._getRageClickConfig();!t&&!this.mp.is_recording_heatmap_data()||this.currentUrlBlocked()||this._rageClickTracker.isRageClick(e.pageX,e.pageY,t)&&this.trackDomEvent(e,TC)}).bind(this),V.addEventListener(ii,this.listenerRageClick))},Qt.prototype.initScrollTracking=function(){V.removeEventListener(AC,this.listenerScroll),this.getConfig(vp)&&(xt.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0,this.listenerScroll=V.addEventListener(AC,np((function(){if(this.getConfig(vp)&&!this.currentUrlBlocked()){var n=this.getConfig(_C),e=(this.getConfig(SC)||[]).slice().sort(function(a,c){return a-c}),t=V.scrollY,r=m.extend({$scroll_top:t},Rc);try{var i=ye.body.scrollHeight,A=Math.round(t/(i-V.innerHeight)*100);if(r.$scroll_height=i,r.$scroll_percentage=A,A>this.lastScrollCheckpoint)for(var s=0;s<e.length;s++){var o=e[s];A>=o&&this.lastScrollCheckpoint<o&&(r.$scroll_checkpoint=o,this.lastScrollCheckpoint=o,n=!0)}}catch(a){xt.critical("Error while calculating scroll percentage",a)}n&&this.mp.track(QD,r)}}).bind(this))))},Qt.prototype.initSubmitTracking=function(){V.removeEventListener(lp,this.listenerSubmit),this.getConfig(yp)&&(xt.log("Initializing submit tracking"),this.listenerSubmit=V.addEventListener(lp,(function(n){this.getConfig(yp)&&this.trackDomEvent(n,RD)}).bind(this)))},VB(Qt);var PD=V.fetch,Rt=ri("flags"),Pc="flags",Oc="context",wp={};wp[Oc]={};var ae=function(n){this.getFullApiRoute=n.getFullApiRoute,this.getMpConfig=n.getConfigFunc,this.setMpConfig=n.setConfigFunc,this.getMpProperty=n.getPropertyFunc,this.track=n.trackingFunc};ae.prototype.init=function(){if(!OD()){Rt.critical("Feature Flags unavailable: missing minimum required APIs");return}this.flags=null,this.fetchFlags(),this.trackedFeatures=new Set},ae.prototype.getFullConfig=function(){var n=this.getMpConfig(Pc);return n?m.isObject(n)?m.extend({},wp,n):wp:{}},ae.prototype.getConfig=function(n){return this.getFullConfig()[n]},ae.prototype.isSystemEnabled=function(){return!!this.getMpConfig(Pc)},ae.prototype.updateContext=function(n,e){if(!this.isSystemEnabled())return Rt.critical("Feature Flags not enabled, cannot update context"),Promise.resolve();var t=this.getMpConfig(Pc);m.isObject(t)||(t={});var r=e&&e.replace?{}:this.getConfig(Oc);return t[Oc]=m.extend({},r,n),this.setMpConfig(Pc,t),this.fetchFlags()},ae.prototype.areFlagsReady=function(){return this.isSystemEnabled()||Rt.error("Feature Flags not enabled"),!!this.flags},ae.prototype.fetchFlags=function(){if(!this.isSystemEnabled())return Promise.resolve();var n=this.getMpProperty("distinct_id"),e=this.getMpProperty("$device_id");Rt.log("Fetching flags for distinct ID: "+n);var t={context:m.extend({distinct_id:n,device_id:e},this.getConfig(Oc))};return this._fetchInProgressStartTime=Date.now(),this.fetchPromise=V.fetch(this.getFullApiRoute(),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getMpConfig("token")+":"),"Content-Type":"application/octet-stream"},body:JSON.stringify(t)}).then((function(r){return this.markFetchComplete(),r.json().then((function(i){var A=i.flags;if(!A)throw new Error("No flags in API response");var s=new Map;m.each(A,function(o,a){s.set(a,{key:o.variant_key,value:o.variant_value})}),this.flags=s}).bind(this)).catch((function(i){this.markFetchComplete(),Rt.error(i)}).bind(this))}).bind(this)).catch((function(r){this.markFetchComplete(),Rt.error(r)}).bind(this)),this.fetchPromise},ae.prototype.markFetchComplete=function(){if(!this._fetchInProgressStartTime){Rt.error("Fetch in progress started time not set, cannot mark fetch complete");return}this._fetchStartTime=this._fetchInProgressStartTime,this._fetchCompleteTime=Date.now(),this._fetchLatency=this._fetchCompleteTime-this._fetchStartTime,this._fetchInProgressStartTime=null},ae.prototype.getVariant=function(n,e){return this.fetchPromise?this.fetchPromise.then((function(){return this.getVariantSync(n,e)}).bind(this)).catch(function(t){return Rt.error(t),e}):new Promise(function(t){Rt.critical("Feature Flags not initialized"),t(e)})},ae.prototype.getVariantSync=function(n,e){if(!this.areFlagsReady())return Rt.log("Flags not loaded yet"),e;var t=this.flags.get(n);return t?(this.trackFeatureCheck(n,t),t):(Rt.log('No flag found: "'+n+'"'),e)},ae.prototype.getVariantValue=function(n,e){return this.getVariant(n,{value:e}).then(function(t){return t.value}).catch(function(t){return Rt.error(t),e})},ae.prototype.getFeatureData=function(n,e){return Rt.critical("mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead."),this.getVariantValue(n,e)},ae.prototype.getVariantValueSync=function(n,e){return this.getVariantSync(n,{value:e}).value},ae.prototype.isEnabled=function(n,e){return this.getVariantValue(n).then((function(){return this.isEnabledSync(n,e)}).bind(this)).catch(function(t){return Rt.error(t),e})},ae.prototype.isEnabledSync=function(n,e){e=e||!1;var t=this.getVariantValueSync(n,e);return t!==!0&&t!==!1&&(Rt.error('Feature flag "'+n+'" value: '+t+" is not a boolean; returning fallback value: "+e),t=e),t},ae.prototype.trackFeatureCheck=function(n,e){this.trackedFeatures.has(n)||(this.trackedFeatures.add(n),this.track("$experiment_started",{"Experiment name":n,"Variant name":e.key,$experiment_type:"feature_flag","Variant fetch start time":new Date(this._fetchStartTime).toISOString(),"Variant fetch complete time":new Date(this._fetchCompleteTime).toISOString(),"Variant fetch latency (ms)":this._fetchLatency}))};function OD(){return!!PD&&typeof Promise<"u"&&typeof Map<"u"&&typeof Set<"u"}VB(ae),ae.prototype.are_flags_ready=ae.prototype.areFlagsReady,ae.prototype.get_variant=ae.prototype.getVariant,ae.prototype.get_variant_sync=ae.prototype.getVariantSync,ae.prototype.get_variant_value=ae.prototype.getVariantValue,ae.prototype.get_variant_value_sync=ae.prototype.getVariantValueSync,ae.prototype.is_enabled=ae.prototype.isEnabled,ae.prototype.is_enabled_sync=ae.prototype.isEnabledSync,ae.prototype.update_context=ae.prototype.updateContext,ae.prototype.get_feature_data=ae.prototype.getFeatureData;var zn=function(){};zn.prototype.create_properties=function(){},zn.prototype.event_handler=function(){},zn.prototype.after_track_handler=function(){},zn.prototype.init=function(n){return this.mp=n,this},zn.prototype.track=function(n,e,t,r){var i=this,A=m.dom_query(n);if(A.length===0){we.error("The DOM query ("+n+") returned 0 elements");return}return m.each(A,function(s){m.register_event(s,this.override_event,function(o){var a={},c=i.create_properties(t,this),u=i.mp.get_config("track_links_timeout");i.event_handler(o,this,a),window.setTimeout(i.track_callback(r,c,a,!0),u),i.mp.track(e,c,i.track_callback(r,c,a))})},this),!0},zn.prototype.track_callback=function(n,e,t,r){r=r||!1;var i=this;return function(){t.callback_fired||(t.callback_fired=!0,!(n&&n(r,e)===!1)&&i.after_track_handler(e,t,r))}},zn.prototype.create_properties=function(n,e){var t;return typeof n=="function"?t=n(e):t=m.extend({},n),t};var sA=function(){this.override_event="click"};m.inherit(sA,zn),sA.prototype.create_properties=function(n,e){var t=sA.superclass.create_properties.apply(this,arguments);return e.href&&(t.url=e.href),t},sA.prototype.event_handler=function(n,e,t){t.new_tab=n.which===2||n.metaKey||n.ctrlKey||e.target==="_blank",t.href=e.href,t.new_tab||n.preventDefault()},sA.prototype.after_track_handler=function(n,e){e.new_tab||setTimeout(function(){window.location=e.href},0)};var Mc=function(){this.override_event="submit"};m.inherit(Mc,zn),Mc.prototype.event_handler=function(n,e,t){t.element=e,n.preventDefault()},Mc.prototype.after_track_handler=function(n,e){setTimeout(function(){e.element.submit()},0)};var xr="$set",oA="$set_once",mn="$unset",Ai="$add",Qn="$append",si="$union",Xn="$remove",MD="$delete",IC={set_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=i)},this):r[n]=e,t[xr]=r,t},unset_action:function(n){var e={},t=[];return m.isArray(n)||(n=[n]),m.each(n,function(r){this._is_reserved_property(r)||t.push(r)},this),e[mn]=t,e},set_once_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=i)},this):r[n]=e,t[oA]=r,t},union_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=m.isArray(i)?i:[i])},this):r[n]=m.isArray(e)?e:[e],t[si]=r,t},append_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=i)},this):r[n]=e,t[Qn]=r,t},remove_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=i)},this):r[n]=e,t[Xn]=r,t},delete_action:function(){var n={};return n[MD]="",n}},De=function(){};m.extend(De.prototype,IC),De.prototype._init=function(n,e,t){this._mixpanel=n,this._group_key=e,this._group_id=t},De.prototype.set=nA(function(n,e,t){var r=this.set_action(n,e);return m.isObject(n)&&(t=e),this._send_request(r,t)}),De.prototype.set_once=nA(function(n,e,t){var r=this.set_once_action(n,e);return m.isObject(n)&&(t=e),this._send_request(r,t)}),De.prototype.unset=nA(function(n,e){var t=this.unset_action(n);return this._send_request(t,e)}),De.prototype.union=nA(function(n,e,t){m.isObject(n)&&(t=e);var r=this.union_action(n,e);return this._send_request(r,t)}),De.prototype.delete=nA(function(n){var e=this.delete_action();return this._send_request(e,n)}),De.prototype.remove=nA(function(n,e,t){var r=this.remove_action(n,e);return this._send_request(r,t)}),De.prototype._send_request=function(n,e){n.$group_key=this._group_key,n.$group_id=this._group_id,n.$token=this._get_config("token");var t=m.encodeDates(n);return this._mixpanel._track_or_batch({type:"groups",data:t,endpoint:this._mixpanel.get_api_host("groups")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},e)},De.prototype._is_reserved_property=function(n){return n==="$group_key"||n==="$group_id"},De.prototype._get_config=function(n){return this._mixpanel.get_config(n)},De.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},De.prototype.remove=De.prototype.remove,De.prototype.set=De.prototype.set,De.prototype.set_once=De.prototype.set_once,De.prototype.union=De.prototype.union,De.prototype.unset=De.prototype.unset,De.prototype.toString=De.prototype.toString;var $=function(){};m.extend($.prototype,IC),$.prototype._init=function(n){this._mixpanel=n},$.prototype.set=Fr(function(n,e,t){var r=this.set_action(n,e);return m.isObject(n)&&(t=e),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r[xr]=m.extend({},m.info.people_properties(),r[xr]),this._send_request(r,t)}),$.prototype.set_once=Fr(function(n,e,t){var r=this.set_once_action(n,e);return m.isObject(n)&&(t=e),this._send_request(r,t)}),$.prototype.unset=Fr(function(n,e){var t=this.unset_action(n);return this._send_request(t,e)}),$.prototype.increment=Fr(function(n,e,t){var r={},i={};return m.isObject(n)?(m.each(n,function(A,s){if(!this._is_reserved_property(s))if(isNaN(parseFloat(A))){we.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else i[s]=A},this),t=e):(m.isUndefined(e)&&(e=1),i[n]=e),r[Ai]=i,this._send_request(r,t)}),$.prototype.append=Fr(function(n,e,t){m.isObject(n)&&(t=e);var r=this.append_action(n,e);return this._send_request(r,t)}),$.prototype.remove=Fr(function(n,e,t){m.isObject(n)&&(t=e);var r=this.remove_action(n,e);return this._send_request(r,t)}),$.prototype.union=Fr(function(n,e,t){m.isObject(n)&&(t=e);var r=this.union_action(n,e);return this._send_request(r,t)}),$.prototype.track_charge=Fr(function(){we.error("mixpanel.people.track_charge() is deprecated and no longer has any effect.")}),$.prototype.clear_charges=function(n){return this.set("$transactions",[],n)},$.prototype.delete_user=function(){if(!this._identify_called()){we.error("mixpanel.people.delete_user() requires you to call identify() first");return}var n={$delete:this._mixpanel.get_distinct_id()};return this._send_request(n)},$.prototype.toString=function(){return this._mixpanel.toString()+".people"},$.prototype._send_request=function(n,e){n.$token=this._get_config("token"),n.$distinct_id=this._mixpanel.get_distinct_id();var t=this._mixpanel.get_property("$device_id"),r=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");t&&(n.$device_id=t),r&&(n.$user_id=r),i&&(n.$had_persisted_distinct_id=i);var A=m.encodeDates(n);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:A,endpoint:this._mixpanel.get_api_host("people")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},e):(this._enqueue(n),m.isUndefined(e)||(this._get_config("verbose")?e({status:-1,error:null}):e(-1)),m.truncate(A,255))},$.prototype._get_config=function(n){return this._mixpanel.get_config(n)},$.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},$.prototype._enqueue=function(n){xr in n?this._mixpanel.persistence._add_to_people_queue(xr,n):oA in n?this._mixpanel.persistence._add_to_people_queue(oA,n):mn in n?this._mixpanel.persistence._add_to_people_queue(mn,n):Ai in n?this._mixpanel.persistence._add_to_people_queue(Ai,n):Qn in n?this._mixpanel.persistence._add_to_people_queue(Qn,n):Xn in n?this._mixpanel.persistence._add_to_people_queue(Xn,n):si in n?this._mixpanel.persistence._add_to_people_queue(si,n):we.error("Invalid call to _enqueue():",n)},$.prototype._flush_one_queue=function(n,e,t,r){var i=this,A=m.extend({},this._mixpanel.persistence.load_queue(n)),s=A;!m.isUndefined(A)&&m.isObject(A)&&!m.isEmptyObject(A)&&(i._mixpanel.persistence._pop_from_people_queue(n,A),i._mixpanel.persistence.save(),r&&(s=r(A)),e.call(i,s,function(o,a){o===0&&i._mixpanel.persistence._add_to_people_queue(n,A),m.isUndefined(t)||t(o,a)}))},$.prototype._flush=function(n,e,t,r,i,A,s){var o=this;this._flush_one_queue(xr,this.set,n),this._flush_one_queue(oA,this.set_once,r),this._flush_one_queue(mn,this.unset,A,function(g){return m.keys(g)}),this._flush_one_queue(Ai,this.increment,e),this._flush_one_queue(si,this.union,i);var a=this._mixpanel.persistence.load_queue(Qn);if(!m.isUndefined(a)&&m.isArray(a)&&a.length)for(var c,u=function(g,v){g===0&&o._mixpanel.persistence._add_to_people_queue(Qn,c),m.isUndefined(t)||t(g,v)},l=a.length-1;l>=0;l--)a=this._mixpanel.persistence.load_queue(Qn),c=a.pop(),o._mixpanel.persistence.save(),m.isEmptyObject(c)||o.append(c,u);var d=this._mixpanel.persistence.load_queue(Xn);if(!m.isUndefined(d)&&m.isArray(d)&&d.length)for(var h,f=function(g,v){g===0&&o._mixpanel.persistence._add_to_people_queue(Xn,h),m.isUndefined(s)||s(g,v)},p=d.length-1;p>=0;p--)d=this._mixpanel.persistence.load_queue(Xn),h=d.pop(),o._mixpanel.persistence.save(),m.isEmptyObject(h)||o.remove(h,f)},$.prototype._is_reserved_property=function(n){return n==="$distinct_id"||n==="$token"||n==="$device_id"||n==="$user_id"||n==="$had_persisted_distinct_id"},$.prototype.set=$.prototype.set,$.prototype.set_once=$.prototype.set_once,$.prototype.unset=$.prototype.unset,$.prototype.increment=$.prototype.increment,$.prototype.append=$.prototype.append,$.prototype.remove=$.prototype.remove,$.prototype.union=$.prototype.union,$.prototype.track_charge=$.prototype.track_charge,$.prototype.clear_charges=$.prototype.clear_charges,$.prototype.delete_user=$.prototype.delete_user,$.prototype.toString=$.prototype.toString;var bp="__mps",Bp="__mpso",Cp="__mpus",_p="__mpa",Sp="__mpap",kp="__mpr",Ep="__mpu",FC="$people_distinct_id",Lc="__alias",Es="__timers",LD=[bp,Bp,Cp,_p,Sp,kp,Ep,FC,Lc,Es],re=function(n){this.props={},this.campaign_params_saved=!1,n.persistence_name?this.name="mp_"+n.persistence_name:this.name="mp_"+n.token+"_mixpanel";var e=n.persistence;e!=="cookie"&&e!=="localStorage"&&(we.critical("Unknown persistence type "+e+"; falling back to cookie"),e=n.persistence="cookie"),e==="localStorage"&&m.localStorage.is_supported()?this.storage=m.localStorage:this.storage=m.cookie,this.load(),this.update_config(n),this.upgrade(),this.save()};re.prototype.properties=function(){var n={};return this.load(),m.each(this.props,function(e,t){m.include(LD,t)||(n[t]=e)}),n},re.prototype.load=function(){if(!this.disabled){var n=this.storage.parse(this.name);n&&(this.props=m.extend({},n))}},re.prototype.upgrade=function(){var n,e;this.storage===m.localStorage?(n=m.cookie.parse(this.name),m.cookie.remove(this.name),m.cookie.remove(this.name,!0),n&&this.register_once(n)):this.storage===m.cookie&&(e=m.localStorage.parse(this.name),m.localStorage.remove(this.name),e&&this.register_once(e))},re.prototype.save=function(){this.disabled||this.storage.set(this.name,tA(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},re.prototype.load_prop=function(n){return this.load(),this.props[n]},re.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},re.prototype.clear=function(){this.remove(),this.props={}},re.prototype.register_once=function(n,e,t){return m.isObject(n)?(typeof e>"u"&&(e="None"),this.expire_days=typeof t>"u"?this.default_expiry:t,this.load(),m.each(n,function(r,i){(!this.props.hasOwnProperty(i)||this.props[i]===e)&&(this.props[i]=r)},this),this.save(),!0):!1},re.prototype.register=function(n,e){return m.isObject(n)?(this.expire_days=typeof e>"u"?this.default_expiry:e,this.load(),m.extend(this.props,n),this.save(),!0):!1},re.prototype.unregister=function(n){this.load(),n in this.props&&(delete this.props[n],this.save())},re.prototype.update_search_keyword=function(n){this.register(m.info.searchInfo(n))},re.prototype.update_referrer_info=function(n){this.register_once({$initial_referrer:n||"$direct",$initial_referring_domain:m.info.referringDomain(n)||"$direct"},"")},re.prototype.get_referrer_info=function(){return m.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},re.prototype.update_config=function(n){this.default_expiry=this.expire_days=n.cookie_expiration,this.set_disabled(n.disable_persistence),this.set_cookie_domain(n.cookie_domain),this.set_cross_site(n.cross_site_cookie),this.set_cross_subdomain(n.cross_subdomain_cookie),this.set_secure(n.secure_cookie)},re.prototype.set_disabled=function(n){this.disabled=n,this.disabled?this.remove():this.save()},re.prototype.set_cookie_domain=function(n){n!==this.cookie_domain&&(this.remove(),this.cookie_domain=n,this.save())},re.prototype.set_cross_site=function(n){n!==this.cross_site&&(this.cross_site=n,this.remove(),this.save())},re.prototype.set_cross_subdomain=function(n){n!==this.cross_subdomain&&(this.cross_subdomain=n,this.remove(),this.save())},re.prototype.get_cross_subdomain=function(){return this.cross_subdomain},re.prototype.set_secure=function(n){n!==this.secure&&(this.secure=!!n,this.remove(),this.save())},re.prototype._add_to_people_queue=function(n,e){var t=this._get_queue_key(n),r=e[n],i=this._get_or_create_queue(xr),A=this._get_or_create_queue(oA),s=this._get_or_create_queue(mn),o=this._get_or_create_queue(Ai),a=this._get_or_create_queue(si),c=this._get_or_create_queue(Xn,[]),u=this._get_or_create_queue(Qn,[]);t===bp?(m.extend(i,r),this._pop_from_people_queue(Ai,r),this._pop_from_people_queue(si,r),this._pop_from_people_queue(mn,r)):t===Bp?(m.each(r,function(l,d){d in A||(A[d]=l)}),this._pop_from_people_queue(mn,r)):t===Cp?m.each(r,function(l){m.each([i,A,o,a],function(d){l in d&&delete d[l]}),m.each(u,function(d){l in d&&delete d[l]}),s[l]=!0}):t===_p?(m.each(r,function(l,d){d in i?i[d]+=l:(d in o||(o[d]=0),o[d]+=l)},this),this._pop_from_people_queue(mn,r)):t===Ep?(m.each(r,function(l,d){m.isArray(l)&&(d in a||(a[d]=[]),m.each(l,function(h){m.include(a[d],h)||a[d].push(h)}))}),this._pop_from_people_queue(mn,r)):t===kp?(c.push(r),this._pop_from_people_queue(Qn,r)):t===Sp&&(u.push(r),this._pop_from_people_queue(mn,r)),we.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),we.log(e),this.save()},re.prototype._pop_from_people_queue=function(n,e){var t=this.props[this._get_queue_key(n)];m.isUndefined(t)||m.each(e,function(r,i){n===Qn||n===Xn?m.each(t,function(A){A[i]===r&&delete A[i]}):delete t[i]},this)},re.prototype.load_queue=function(n){return this.load_prop(this._get_queue_key(n))},re.prototype._get_queue_key=function(n){if(n===xr)return bp;if(n===oA)return Bp;if(n===mn)return Cp;if(n===Ai)return _p;if(n===Qn)return Sp;if(n===Xn)return kp;if(n===si)return Ep;we.error("Invalid queue:",n)},re.prototype._get_or_create_queue=function(n,e){var t=this._get_queue_key(n);return e=m.isUndefined(e)?{}:e,this.props[t]||(this.props[t]=e)},re.prototype.set_event_timer=function(n,e){var t=this.load_prop(Es)||{};t[n]=e,this.props[Es]=t,this.save()},re.prototype.remove_event_timer=function(n){var e=this.load_prop(Es)||{},t=e[n];return m.isUndefined(t)||(delete this.props[Es][n],this.save()),t};var Up,xC=function(n,e){throw new Error(n+" not available in this build.")},Ut,QC=0,DD=1,ND=function(n){return n},en="mixpanel",RC="base64",HD="json",Tp="$device:",aA=V.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,PC=!aA&&qn.indexOf("MSIE")===-1&&qn.indexOf("Mozilla")===-1,Dc=null;Ur.sendBeacon&&(Dc=function(){return Ur.sendBeacon.apply(Ur,arguments)});var OC={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},MC={api_host:"https://api-js.mixpanel.com",api_hosts:{},api_routes:OC,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:RC,app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Tr,flags:!1,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Tr,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video, audio",record_canvas:!1,record_collect_fonts:!1,record_heatmap_data:!1,record_idle_timeout_ms:30*60*1e3,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:bs,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},LC=!1,U=function(){},Ip=function(n,e,t){var r,i=t===en?Ut:Ut[t];if(i&&Up===QC)r=i;else{if(i&&!m.isArray(i)){we.error("You have already initialized "+t);return}r=new U}if(r._cached_groups={},r._init(n,e,t),r.people=new $,r.people._init(r),!r.get_config("skip_first_touch_marketing")){var A=m.info.campaignParams(null),s={},o=!1;m.each(A,function(a,c){s["initial_"+c]=a,a&&(o=!0)}),o&&r.people.set_once(s)}return gn.DEBUG=gn.DEBUG||r.get_config("debug"),!m.isUndefined(i)&&m.isArray(i)&&(r._execute_array.call(r.people,i.people),r._execute_array(i)),r};U.prototype.init=function(n,e,t){if(m.isUndefined(t)){this.report_error("You must name your new library: init(token, config, name)");return}if(t===en){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var r=Ip(n,e,t);return Ut[t]=r,r._loaded(),r},U.prototype._init=function(n,e,t){e=e||{},this.__loaded=!0,this.config={};var r={};if(!("api_payload_format"in e)){var i=e.api_host||MC.api_host;i.match(/\.mixpanel\.com/)&&(r.api_payload_format=HD)}if(this.set_config(m.extend({},MC,r,e,{name:t,token:n,callback_fn:(t===en?t:en+"."+t)+"._jsc"})),this._jsc=Tr,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!m.localStorage.is_supported(!0)||!aA)this._batch_requests=!1,we.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),m.each(this.get_batcher_configs(),function(o){we.log("Clearing batch queue "+o.queue_key),m.localStorage.remove(o.queue_key)});else if(this.init_batchers(),Dc&&V.addEventListener){var A=m.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);V.addEventListener("pagehide",function(o){o.persisted&&A()}),V.addEventListener("visibilitychange",function(){ye.visibilityState==="hidden"&&A()})}}this.persistence=this.cookie=new re(this.config),this.unpersisted_superprops={},this._gdpr_init();var s=m.UUID();this.get_distinct_id()||this.register_once({distinct_id:Tp+s,$device_id:s},""),this.flags=new ae({getFullApiRoute:m.bind(function(){return this.get_api_host("flags")+"/"+this.get_config("api_routes").flags},this),getConfigFunc:m.bind(this.get_config,this),setConfigFunc:m.bind(this.set_config,this),getPropertyFunc:m.bind(this.get_property,this),trackingFunc:m.bind(this.track,this)}),this.flags.init(),this.flags=this.flags,this.autocapture=new Qt(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()},U.prototype._init_tab_id=function(){if(m.sessionStorage.is_supported())try{var n=this.get_config("name")+"_"+this.get_config("token"),e="mp_tab_id_"+n,t="mp_gen_new_tab_id_"+n;(m.sessionStorage.get(t)||!m.sessionStorage.get(e))&&m.sessionStorage.set(e,"$tab-"+m.UUID()),m.sessionStorage.set(t,"1"),this.tab_id=m.sessionStorage.get(e),V.addEventListener("beforeunload",function(){m.sessionStorage.remove(t)})}catch(r){this.report_error("Error initializing tab id",r)}else this.report_error("Session storage is not supported, cannot keep track of unique tab ID.")},U.prototype.get_tab_id=function(){return this.tab_id||null},U.prototype._should_load_recorder=function(){var n=new In(sp),e=this.get_tab_id();return n.init().then(function(){return n.getAll()}).then(function(t){for(var r=0;r<t.length;r++)if(up(t[r])||t[r].tabId===e)return!0;return!1}).catch(m.bind(function(t){this.report_error("Error checking recording registry",t)},this))},U.prototype._check_and_start_session_recording=Ir(function(n){if(!V.MutationObserver){we.critical("Browser does not support MutationObserver; skipping session recording");return}var e=m.bind(function(r){var i=m.bind(function(){this._recorder=this._recorder||new V.__mp_recorder(this),this._recorder.resumeRecording(r)},this);m.isUndefined(V.__mp_recorder)?xC(this.get_config("recorder_src"),i):i()},this),t=this.get_config("record_sessions_percent")>0&&Math.random()*100<=this.get_config("record_sessions_percent");n||t?e(!0):this._should_load_recorder().then(function(r){r&&e(!1)})}),U.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)},U.prototype.stop_session_recording=function(){return this._recorder?this._recorder.stopRecording():Promise.resolve()},U.prototype.pause_session_recording=function(){return this._recorder?this._recorder.pauseRecording():Promise.resolve()},U.prototype.resume_session_recording=function(){return this._recorder?this._recorder.resumeRecording():Promise.resolve()},U.prototype.is_recording_heatmap_data=function(){return this._get_session_replay_id()&&this.get_config("record_heatmap_data")},U.prototype.get_session_recording_properties=function(){var n={},e=this._get_session_replay_id();return e&&(n.$mp_replay_id=e),n},U.prototype.get_session_replay_url=function(){var n=null,e=this._get_session_replay_id();if(e){var t=m.HTTPBuildQuery({replay_id:e,distinct_id:this.get_distinct_id(),token:this.get_config("token")});n="https://mixpanel.com/projects/replay-redirect?"+t}return n},U.prototype._get_session_replay_id=function(){var n=null;return this._recorder&&(n=this._recorder.replayId),n||null},U.prototype.__get_recorder=function(){return this._recorder},U.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var n=m.info.campaignParams(null);m.each(n,(function(e,t){this.unregister(t)}).bind(this))}},U.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(ye.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(m.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(ye.referrer)},U.prototype._dom_loaded=function(){m.each(this.__dom_loaded_queue,function(n){this._track_dom.apply(this,n)},this),this.has_opted_out_tracking()||m.each(this.__request_queue,function(n){this._send_request.apply(this,n)},this),delete this.__dom_loaded_queue,delete this.__request_queue},U.prototype._track_dom=function(n,e){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!LC)return this.__dom_loaded_queue.push([n,e]),!1;var t=new n().init(this);return t.track.apply(t,e)},U.prototype._prepare_callback=function(n,e){if(m.isUndefined(n))return null;if(aA){var t=function(s){n(s,e)};return t}else{var r=this._jsc,i=""+Math.floor(Math.random()*1e8),A=this.get_config("callback_fn")+"["+i+"]";return r[i]=function(s){delete r[i],n(s,e)},A}},U.prototype._send_request=function(n,e,t,r){var i=!0;if(PC)return this.__request_queue.push(arguments),i;var A={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;!r&&(m.isFunction(t)||typeof t=="string")&&(r=t,t=null),t=m.extend(A,t||{}),aA||(t.method="GET");var o=t.method==="POST",a=Dc&&o&&t.transport.toLowerCase()==="sendbeacon",c=t.verbose;e.verbose&&(c=!0),this.get_config("test")&&(e.test=1),c&&(e.verbose=1),this.get_config("img")&&(e.img=1),aA||(r?e.callback=r:(c||this.get_config("test"))&&(e.callback="(function(){})")),e.ip=this.get_config("ip")?1:0,e._=new Date().getTime().toString(),o&&(s="data="+encodeURIComponent(e.data),delete e.data),m.extend(e,this.get_config("api_extra_query_params")),n+="?"+m.HTTPBuildQuery(e);var u=this;if("img"in e){var l=ye.createElement("img");l.src=n,ye.body.appendChild(l)}else if(a){try{i=Dc(n,s)}catch(v){u.report_error(v),i=!1}try{r&&r(i?1:0)}catch(v){u.report_error(v)}}else if(aA)try{var d=new XMLHttpRequest;d.open(t.method,n,!0);var h=this.get_config("xhr_headers");if(o&&(h["Content-Type"]="application/x-www-form-urlencoded"),m.each(h,function(v,y){d.setRequestHeader(y,v)}),t.timeout_ms&&typeof d.timeout<"u"){d.timeout=t.timeout_ms;var f=new Date().getTime()}d.withCredentials=!0,d.onreadystatechange=function(){if(d.readyState===4)if(d.status===200){if(r)if(c){var v;try{v=m.JSONDecode(d.responseText)}catch(b){if(u.report_error(b),t.ignore_json_errors)v=d.responseText;else return}r(v)}else r(Number(d.responseText))}else{var y;if(d.timeout&&!d.status&&new Date().getTime()-f>=d.timeout?y="timeout":y="Bad HTTP status: "+d.status+" "+d.statusText,u.report_error(y),r)if(c){var B=d.responseHeaders||{};r({status:0,httpStatusCode:d.status,error:y,retryAfter:B["Retry-After"]})}else r(0)}},d.send(s)}catch(v){u.report_error(v),i=!1}else{var p=ye.createElement("script");p.type="text/javascript",p.async=!0,p.defer=!0,p.src=n;var g=ye.getElementsByTagName("script")[0];g.parentNode.insertBefore(p,g)}return i},U.prototype._execute_array=function(n){var e,t=[],r=[],i=[];m.each(n,function(s){s&&(e=s[0],m.isArray(e)?i.push(s):typeof s=="function"?s.call(this):m.isArray(s)&&e==="alias"?t.push(s):m.isArray(s)&&e.indexOf("track")!==-1&&typeof this[e]=="function"?i.push(s):r.push(s))},this);var A=function(s,o){m.each(s,function(a){if(m.isArray(a[0])){var c=o;m.each(a,function(u){c=c[u[0]].apply(c,u.slice(1))})}else this[a[0]].apply(this,a.slice(1))},o)};A(t,this),A(r,this),A(i,this)},U.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},U.prototype.get_batcher_configs=function(){var n="__mpq_"+this.get_config("token");return this._batcher_configs=this._batcher_configs||{events:{type:"events",api_name:"track",queue_key:n+"_ev"},people:{type:"people",api_name:"engage",queue_key:n+"_pp"},groups:{type:"groups",api_name:"groups",queue_key:n+"_gr"}},this._batcher_configs},U.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var n=m.bind(function(t){return new $t(t.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:m.bind(function(r,i,A){var s=this.get_config("api_routes");this._send_request(this.get_api_host(t.api_name)+"/"+s[t.api_name],this._encode_data_for_request(r),i,this._prepare_callback(A,r))},this),beforeSendHook:m.bind(function(r){return this._run_hook("before_send_"+t.type,r)},this),stopAllBatchingFunc:m.bind(this.stop_batch_senders,this),usePersistence:!0})},this),e=this.get_batcher_configs();this.request_batchers={events:n(e.events),people:n(e.people),groups:n(e.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},U.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,m.each(this.request_batchers,function(n){n.start()}))},U.prototype.stop_batch_senders=function(){this._batch_requests=!1,m.each(this.request_batchers,function(n){n.stop(),n.clear()})},U.prototype.push=function(n){this._execute_array([n])},U.prototype.disable=function(n){typeof n>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(n)},U.prototype._encode_data_for_request=function(n){var e=tA(n);return this.get_config("api_payload_format")===RC&&(e=m.base64Encode(e)),{data:e}},U.prototype._track_or_batch=function(n,e){var t=m.truncate(n.data,255),r=n.endpoint,i=n.batcher,A=n.should_send_immediately,s=n.send_request_options||{};e=e||Tr;var o=!0,a=m.bind(function(){return s.skip_hooks||(t=this._run_hook("before_send_"+n.type,t)),t?(we.log("MIXPANEL REQUEST:"),we.log(t),this._send_request(r,this._encode_data_for_request(t),s,this._prepare_callback(e,t))):null},this);return this._batch_requests&&!A?i.enqueue(t).then(function(c){c?e(1,t):a()}):o=a(),o&&t},U.prototype.track=Ir(function(n,e,t,r){!r&&typeof t=="function"&&(r=t,t=null),t=t||{};var i=t.transport;i&&(t.transport=i);var A=t.send_immediately;if(typeof r!="function"&&(r=Tr),m.isUndefined(n)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(n)){r(0);return}e=m.extend({},e),e.token=this.get_config("token");var s=this.persistence.remove_event_timer(n);if(!m.isUndefined(s)){var o=new Date().getTime()-s;e.$duration=parseFloat((o/1e3).toFixed(3))}this._set_default_superprops();var a=this.get_config("track_marketing")?m.info.marketingParams():{};e=m.extend({},m.info.properties({mp_loader:this.get_config("mp_loader")}),a,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),e);var c=this.get_config("property_blacklist");m.isArray(c)?m.each(c,function(d){delete e[d]}):this.report_error("Invalid value for property_blacklist config: "+c);var u={event:n,properties:e},l=this._track_or_batch({type:"events",data:u,endpoint:this.get_api_host("events")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:A,send_request_options:t},r);return l}),U.prototype.set_group=Ir(function(n,e,t){m.isArray(e)||(e=[e]);var r={};return r[n]=e,this.register(r),this.people.set(n,e,t)}),U.prototype.add_group=Ir(function(n,e,t){var r=this.get_property(n),i={};return r===void 0?(i[n]=[e],this.register(i)):r.indexOf(e)===-1&&(r.push(e),i[n]=r,this.register(i)),this.people.union(n,e,t)}),U.prototype.remove_group=Ir(function(n,e,t){var r=this.get_property(n);if(r!==void 0){var i=r.indexOf(e);i>-1&&(r.splice(i,1),this.register({group_key:r})),r.length===0&&this.unregister(n)}return this.people.remove(n,e,t)}),U.prototype.track_with_groups=Ir(function(n,e,t,r){var i=m.extend({},e||{});return m.each(t,function(A,s){A!=null&&(i[s]=A)}),this.track(n,i,r)}),U.prototype._create_map_key=function(n,e){return n+"_"+JSON.stringify(e)},U.prototype._remove_group_from_cache=function(n,e){delete this._cached_groups[this._create_map_key(n,e)]},U.prototype.get_group=function(n,e){var t=this._create_map_key(n,e),r=this._cached_groups[t];return(r===void 0||r._group_key!==n||r._group_id!==e)&&(r=new De,r._init(this,n,e),this._cached_groups[t]=r),r},U.prototype.track_pageview=Ir(function(n,e){typeof n!="object"&&(n={}),e=e||{};var t=e.event_name||"$mp_web_page_view",r=m.extend(m.info.mpPageViewProperties(),m.info.campaignParams(),m.info.clickParams()),i=m.extend({},r,n);return this.track(t,i)}),U.prototype.track_links=function(){return this._track_dom.call(this,sA,arguments)},U.prototype.track_forms=function(){return this._track_dom.call(this,Mc,arguments)},U.prototype.time_event=function(n){if(m.isUndefined(n)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(n)||this.persistence.set_event_timer(n,new Date().getTime())};var KD={persistent:!0},Fp=function(n){var e;return m.isObject(n)?e=n:m.isUndefined(n)?e={}:e={days:n},m.extend({},KD,e)};U.prototype.register=function(n,e){var t=Fp(e);t.persistent?this.persistence.register(n,t.days):m.extend(this.unpersisted_superprops,n)},U.prototype.register_once=function(n,e,t){var r=Fp(t);r.persistent?this.persistence.register_once(n,e,r.days):(typeof e>"u"&&(e="None"),m.each(n,function(i,A){(!this.unpersisted_superprops.hasOwnProperty(A)||this.unpersisted_superprops[A]===e)&&(this.unpersisted_superprops[A]=i)},this))},U.prototype.unregister=function(n,e){e=Fp(e),e.persistent?this.persistence.unregister(n):delete this.unpersisted_superprops[n]},U.prototype._register_single=function(n,e){var t={};t[n]=e,this.register(t)},U.prototype.identify=function(n,e,t,r,i,A,s,o){var a=this.get_distinct_id();if(n&&a!==n){if(typeof n=="string"&&n.indexOf(Tp)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:n})}if(!this.get_property("$device_id")){var c=a;this.register_once({$had_persisted_distinct_id:!0,$device_id:c},"")}n!==a&&n!==this.get_property(Lc)&&(this.unregister(Lc),this.register({distinct_id:n})),this._flags.identify_called=!0,this.people._flush(e,t,r,i,A,s,o),n!==a&&this.track("$identify",{distinct_id:n,$anon_distinct_id:a},{skip_hooks:!0}),n!==a&&this.flags.fetchFlags()},U.prototype.reset=function(){this.stop_session_recording(),this.persistence.clear(),this._flags.identify_called=!1;var n=m.UUID();this.register_once({distinct_id:Tp+n,$device_id:n},""),this._check_and_start_session_recording()},U.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},U.prototype.alias=function(n,e){if(n===this.get_property(FC))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var t=this;return m.isUndefined(e)&&(e=this.get_distinct_id()),n!==e?(this._register_single(Lc,n),this.track("$create_alias",{alias:n,distinct_id:e},{skip_hooks:!0},function(){t.identify(n)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(n),-1)},U.prototype.name_tag=function(n){this._register_single("mp_name_tag",n)},U.prototype.set_config=function(n){if(m.isObject(n)){m.extend(this.config,n);var e=n.batch_size;e&&m.each(this.request_batchers,function(t){t.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),gn.DEBUG=gn.DEBUG||this.get_config("debug"),("autocapture"in n||"record_heatmap_data"in n)&&this.autocapture&&this.autocapture.init()}},U.prototype.get_config=function(n){return this.config[n]},U.prototype._run_hook=function(n){var e=(this.config.hooks[n]||ND).apply(this,ni.call(arguments,1));return typeof e>"u"&&(this.report_error(n+" hook did not return a value"),e=null),e},U.prototype.get_property=function(n){return this.persistence.load_prop([n])},U.prototype.get_api_host=function(n){return this.get_config("api_hosts")[n]||this.get_config("api_host")},U.prototype.toString=function(){var n=this.get_config("name");return n!==en&&(n=en+"."+n),n},U.prototype._event_is_disabled=function(n){return m.isBlockedUA(qn)||this._flags.disable_all_events||m.include(this.__disabled_events,n)},U.prototype._gdpr_init=function(){var n=this.get_config("opt_out_tracking_persistence_type")==="localStorage";n&&m.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||m.cookie.get("mp_optout"))&&(m.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},U.prototype._gdpr_update_persistence=function(n){var e;if(n&&n.clear_persistence)e=!0;else if(n&&n.enable_persistence)e=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==e&&this.persistence.set_disabled(e),e?(this.stop_batch_senders(),this.stop_session_recording()):this._batchers_were_started&&this.start_batch_senders()},U.prototype._gdpr_call_func=function(n,e){return e=m.extend({track:m.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},e),m.localStorage.is_supported()||(e.persistence_type="cookie"),n(this.get_config("token"),{track:e.track,trackEventName:e.track_event_name,trackProperties:e.track_properties,persistenceType:e.persistence_type,persistencePrefix:e.cookie_prefix,cookieDomain:e.cookie_domain,cookieExpiration:e.cookie_expiration,crossSiteCookie:e.cross_site_cookie,crossSubdomainCookie:e.cross_subdomain_cookie,secureCookie:e.secure_cookie,ignoreDnt:e.ignore_dnt})},U.prototype.opt_in_tracking=function(n){n=m.extend({enable_persistence:!0},n),this._gdpr_call_func(oD,n),this._gdpr_update_persistence(n)},U.prototype.opt_out_tracking=function(n){n=m.extend({clear_persistence:!0,delete_user:!0},n),n.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(aD,n),this._gdpr_update_persistence(n)},U.prototype.has_opted_in_tracking=function(n){return this._gdpr_call_func(cD,n)},U.prototype.has_opted_out_tracking=function(n){return this._gdpr_call_func(zB,n)},U.prototype.clear_opt_in_out_tracking=function(n){n=m.extend({enable_persistence:!0},n),this._gdpr_call_func(uD,n),this._gdpr_update_persistence(n)},U.prototype.report_error=function(n,e){we.error.apply(we.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.get_config("error_reporter")(n,e)}catch(t){we.error(t)}},U.prototype.init=U.prototype.init,U.prototype.reset=U.prototype.reset,U.prototype.disable=U.prototype.disable,U.prototype.time_event=U.prototype.time_event,U.prototype.track=U.prototype.track,U.prototype.track_links=U.prototype.track_links,U.prototype.track_forms=U.prototype.track_forms,U.prototype.track_pageview=U.prototype.track_pageview,U.prototype.register=U.prototype.register,U.prototype.register_once=U.prototype.register_once,U.prototype.unregister=U.prototype.unregister,U.prototype.identify=U.prototype.identify,U.prototype.alias=U.prototype.alias,U.prototype.name_tag=U.prototype.name_tag,U.prototype.set_config=U.prototype.set_config,U.prototype.get_config=U.prototype.get_config,U.prototype.get_api_host=U.prototype.get_api_host,U.prototype.get_property=U.prototype.get_property,U.prototype.get_distinct_id=U.prototype.get_distinct_id,U.prototype.toString=U.prototype.toString,U.prototype.opt_out_tracking=U.prototype.opt_out_tracking,U.prototype.opt_in_tracking=U.prototype.opt_in_tracking,U.prototype.has_opted_out_tracking=U.prototype.has_opted_out_tracking,U.prototype.has_opted_in_tracking=U.prototype.has_opted_in_tracking,U.prototype.clear_opt_in_out_tracking=U.prototype.clear_opt_in_out_tracking,U.prototype.get_group=U.prototype.get_group,U.prototype.set_group=U.prototype.set_group,U.prototype.add_group=U.prototype.add_group,U.prototype.remove_group=U.prototype.remove_group,U.prototype.track_with_groups=U.prototype.track_with_groups,U.prototype.start_batch_senders=U.prototype.start_batch_senders,U.prototype.stop_batch_senders=U.prototype.stop_batch_senders,U.prototype.start_session_recording=U.prototype.start_session_recording,U.prototype.stop_session_recording=U.prototype.stop_session_recording,U.prototype.pause_session_recording=U.prototype.pause_session_recording,U.prototype.resume_session_recording=U.prototype.resume_session_recording,U.prototype.get_session_recording_properties=U.prototype.get_session_recording_properties,U.prototype.get_session_replay_url=U.prototype.get_session_replay_url,U.prototype.get_tab_id=U.prototype.get_tab_id,U.prototype.DEFAULT_API_ROUTES=OC,U.prototype.__get_recorder=U.prototype.__get_recorder,re.prototype.properties=re.prototype.properties,re.prototype.update_search_keyword=re.prototype.update_search_keyword,re.prototype.update_referrer_info=re.prototype.update_referrer_info,re.prototype.get_cross_subdomain=re.prototype.get_cross_subdomain,re.prototype.clear=re.prototype.clear;var cA={},VD=function(){m.each(cA,function(n,e){e!==en&&(Ut[e]=n)}),Ut._=m},GD=function(){Ut.init=function(n,e,t){if(t)return Ut[t]||(Ut[t]=cA[t]=Ip(n,e,t),Ut[t]._loaded()),Ut[t];var r=Ut;cA[en]?r=cA[en]:n&&(r=Ip(n,e,en),r._loaded(),cA[en]=r),Ut=r,Up===DD&&(V[en]=Ut),VD()}},jD=function(){function n(){n.done||(n.done=!0,LC=!0,PC=!1,m.each(cA,function(r){r._dom_loaded()}))}function e(){try{ye.documentElement.doScroll("left")}catch{setTimeout(e,1);return}n()}if(ye.addEventListener)ye.readyState==="complete"?n():ye.addEventListener("DOMContentLoaded",n,!1);else if(ye.attachEvent){ye.attachEvent("onreadystatechange",n);var t=!1;try{t=V.frameElement===null}catch{}ye.documentElement.doScroll&&t&&e()}m.register_event(V,"load",n,!0)};function WD(n){return xC=n,Up=QC,Ut=new U,GD(),Ut.init(),jD(),Ut}function qD(n,e){e()}var Nc=WD(qD);iy({identify:()=>{},track:()=>{},page:()=>{},reset:()=>{}});function JD(n,e={}){const t=e.instanceName||`obi_${Math.random().toString(36).slice(2)}`;Nc.init(n,{debug:e.debug===!0,track_pageview:!1,persistence:"localStorage",...e.config||{}},t);const r=Nc.get_instance?Nc.get_instance(t):Nc[t];return{identify:(i,A)=>{var s;try{r.identify(i),A&&((s=r==null?void 0:r.people)!=null&&s.set)&&r.people.set(A)}catch{}},track:(i,A)=>{try{r.track(i,A||{})}catch{}},page:(i,A)=>{try{r.track("Page Viewed",{name:i,...A||{}})}catch{}},reset:()=>{try{r.reset()}catch{}}}}let xp=null;function Se(){return xp||(xp=JD("d37cde23ca4b5d8c7ed30653f07f9e47"),xp)}const zD=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,DC="9.23.0",uA=globalThis;function XD(n,e,t=uA){const r=t.__SENTRY__=t.__SENTRY__||{},i=r[DC]=r[DC]||{};return i[n]||(i[n]=e())}const YD="Sentry Logger ",NC=["debug","info","warn","error","log","assert","trace"],HC={};function ZD(n){if(!("console"in uA))return n();const e=uA.console,t={},r=Object.keys(HC);r.forEach(i=>{const A=HC[i];t[i]=e[i],e[i]=A});try{return n()}finally{r.forEach(i=>{e[i]=t[i]})}}function $D(){let n=!1;const e={enable:()=>{n=!0},disable:()=>{n=!1},isEnabled:()=>n};return zD?NC.forEach(t=>{e[t]=(...r)=>{n&&ZD(()=>{uA.console[t](`${YD}[${t}]:`,...r)})}}):NC.forEach(t=>{e[t]=()=>{}}),e}XD("logger",$D);const KC=1e3;function e4(){return Date.now()/KC}function t4(){const{performance:n}=uA;if(!(n!=null&&n.now))return e4;const e=Date.now()-n.now(),t=n.timeOrigin==null?e:n.timeOrigin;return()=>(t+n.now())/KC}t4();const VC=50,lA="?",GC=/\(error: (.*)\)/,jC=/captureMessage|captureException/;function n4(...n){const e=n.sort((t,r)=>t[0]-r[0]).map(t=>t[1]);return(t,r=0,i=0)=>{const A=[],s=t.split(`
124
124
  `);for(let o=r;o<s.length;o++){const a=s[o];if(a.length>1024)continue;const c=GC.test(a)?a.replace(GC,"$1"):a;if(!c.match(/\S*Error: /)){for(const u of e){const l=u(c);if(l){A.push(l);break}}if(A.length>=VC+i)break}}return r4(A.slice(i))}}function r4(n){if(!n.length)return[];const e=Array.from(n);return/sentryWrapped/.test(Hc(e).function||"")&&e.pop(),e.reverse(),jC.test(Hc(e).function||"")&&(e.pop(),jC.test(Hc(e).function||"")&&e.pop()),e.slice(0,VC).map(t=>({...t,filename:t.filename||Hc(e).filename,function:t.function||lA}))}function Hc(n){return n[n.length-1]||{}}var WC;(function(n){n[n.PENDING=0]="PENDING";const e=1;n[n.RESOLVED=e]="RESOLVED";const t=2;n[n.REJECTED=t]="REJECTED"})(WC||(WC={})),uA._sentryClientToLogBufferMap=new WeakMap,typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;const i4=30,A4=50;function Qp(n,e,t,r){const i={filename:n,function:e==="<anonymous>"?lA:e,in_app:!0};return t!==void 0&&(i.lineno=t),r!==void 0&&(i.colno=r),i}const s4=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,o4=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a4=/\((\S*)(?::(\d+))(?::(\d+))\)/,c4=n=>{const e=s4.exec(n);if(e){const[,r,i,A]=e;return Qp(r,lA,+i,+A)}const t=o4.exec(n);if(t){if(t[2]&&t[2].indexOf("eval")===0){const A=a4.exec(t[2]);A&&(t[2]=A[1],t[3]=A[2],t[4]=A[3])}const[r,i]=qC(t[1]||lA,t[2]);return Qp(i,r,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}},u4=[i4,c4],l4=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,d4=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;n4(...[u4,[A4,n=>{const e=l4.exec(n);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const i=d4.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let t=e[3],r=e[1]||lA;return[r,t]=qC(r,t),Qp(t,r,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]]);const qC=(n,e)=>{const t=n.indexOf("safari-extension")!==-1,r=n.indexOf("safari-web-extension")!==-1;return t||r?[n.indexOf("@")!==-1?n.split("@")[0]:lA,t?`safari-extension:${e}`:`safari-web-extension:${e}`]:[n,e]};typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;const h4=`:root,:host{--obi-modal-padding: 48px 48px 32px;--obi-modal-background-color: #FFFFFF;--obi-modal-border-radius: 12px;--obi-modal-shadow: 0px 1px 2px rgba(0, 0, 0, .05);--obi-modal-xsmall-width: 320px;--obi-modal-xsmall-height: 240px;--obi-modal-small-width: 480px;--obi-modal-small-height: 400px;--obi-modal-medium-width: 640px;--obi-modal-medium-height: 545px;--obi-modal-large-width: 1200px;--obi-modal-large-height: 700px;--obi-font-family: "Satoshi", sans-serif;--obi-color-primary: #9500FF;--obi-color-primary-50: color-mix(in srgb, var(--obi-color-primary) 50%, white 50%);--obi-color-primary-30: color-mix(in srgb, var(--obi-color-primary) 30%, white 70%);--obi-color-tint: color-mix(in srgb, var(--obi-color-primary) 5%, white 95%);--obi-color-text: #18181B;--obi-course-color-selected: var(--obi-color-primary-50);--obi-course-color-tint: var(--obi-color-tint);--obi-course-progress-step-completed: #B3B3B3;--obi-course-progress-step-incomplete: #D9D9D9;--obi-course-progress-text-color: #757575;font-family:var(--obi-font-family);color:var(--obi-color-text)}.obi-button{font-family:var(--obi-font-family);color:var(--obi-color-text)}dialog{margin:auto;padding:0;border:none;border-radius:var(--obi-modal-border-radius);box-shadow:var(--obi-modal-shadow);background:var(--obi-modal-background-color);box-sizing:border-box}dialog>.modal-content{padding:var(--obi-modal-padding);box-sizing:border-box}dialog,dialog.modal-medium,dialog>.modal-content,dialog.modal-medium>.modal-content{width:var(--obi-modal-medium-width);min-height:var(--obi-modal-medium-height)}dialog.modal-xsmall,dialog.modal-xsmall>.modal-content{width:var(--obi-modal-xsmall-width);min-height:var(--obi-modal-xsmall-height)}dialog.modal-small,dialog.modal-small>.modal-content{width:var(--obi-modal-small-width);min-height:var(--obi-modal-small-height)}dialog.modal-large,dialog.modal-large>.modal-content{width:var(--obi-modal-large-width);min-height:var(--obi-modal-large-height)}dialog::backdrop{background:rgba(0,0,0,.5)}.tour-content{display:block;width:100%;height:100%}.tour-content .container{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;padding:0;width:100%;height:100%}.tour-content .header{display:flex;flex-direction:column;align-items:center;padding:0;gap:16px;width:100%}.tour-content .title{width:100%;font-family:Satoshi,sans-serif;font-style:normal;font-weight:700;font-size:32px;line-height:90%;text-align:center;letter-spacing:-.03em;color:#18181b;margin:0}.tour-content .subtitle{width:100%;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:16px;line-height:140%;text-align:center;letter-spacing:-.01em;color:#18181b;margin:0}.tour-content .visual{width:480px;height:240px;margin-top:24px;border-radius:12px;display:flex;align-items:center;justify-content:center;position:relative}.tour-content .description{width:100%;min-height:48px;margin:24px 0 0;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:16px;line-height:140%;text-align:center;letter-spacing:-.01em;color:#18181b}.tour-content .button-container{display:flex;margin-top:24px;flex-direction:column;align-items:center;gap:16px;width:100%}.tour-content .action-button{box-sizing:border-box;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:12px;gap:8px;min-width:200px;height:40px;background:#303030;border:1px solid #303030;border-radius:4px;cursor:pointer;text-decoration:none}.tour-content .action-button.disabled{opacity:.6;cursor:not-allowed}.tour-content .button-text{height:16px;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:16px;line-height:100%;color:#fbf3ff}.tour.content-area{flex:1;display:flex;flex-direction:column}.obi-close-button{position:absolute;top:24px;right:24px;width:24px;height:24px;cursor:pointer;border:none;background:none;padding:0;display:flex;align-items:center;justify-content:center;z-index:1}.obi-panel{box-sizing:border-box;padding:24px;background-color:#fff;box-shadow:0 16px 32px -4px #0000001f,0 4px 8px -2px #00000014,inset 0 1px #fff9;border-radius:12px}.obi-pill.container{width:96px;height:30px;display:flex;align-items:center;justify-content:center}.obi-pill.container .pill{display:flex;align-items:center;justify-content:center;width:48px;height:6px;opacity:.7;border-radius:3px;background-color:var(--obi-color-primary);transition:width .15s ease-in-out,height .15s ease-in-out,border-radius .15s ease-in-out}.obi-pill.container .pill.button{cursor:pointer}.obi-pill.container.user-speaking .pill{background-color:var(--obi-color-primary-30)}.obi-pill.container.active .pill{width:96px;height:30px;border-radius:15px;opacity:1}.obi-pill.container.busy,.obi-pill.container.busy .pill{width:220px}.obi-pill2.container{display:flex;align-items:center;justify-content:center}.obi-pill2.container .pill{display:flex;align-items:center;justify-content:center;width:48px;height:6px;opacity:.7;border-radius:3px;background-color:var(--obi-color-primary);transform:translateY(0);transition:width .15s ease-in-out,height .15s ease-in-out,border-radius .15s ease-in-out}.obi-pill2.container .pill.button{cursor:pointer}.obi-pill2.container:not(.active){transition:height 0s linear .15s;height:6px}.obi-pill2.container:not(.active) .pill{transform:translateY(12px);transition:transform 0s linear .15s,width .15s ease-in-out,height .15s ease-in-out,border-radius .15s ease-in-out}.obi-pill2.container.active{transition:none;height:30px}.obi-pill2.container.active .pill{transition:transform 0s,width .15s ease-in-out,height .15s ease-in-out,border-radius .15s ease-in-out;width:96px;height:30px;border-radius:15px;opacity:1}.obi-pill2.container.user-speaking .pill{background-color:var(--obi-color-primary-30)}.obi-popout{position:relative;display:inline-block}.obi-popout .obi-popout-target{cursor:pointer;display:inline-block}.obi-popout .content{position:absolute;background-color:#fff0;z-index:100;animation:popout-appear .15s ease-out}@keyframes popout-appear{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.obi-round-button-popout{z-index:600}.obi-round-button{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;padding:0;box-sizing:border-box;background-color:#fff;border:1px solid #D9D9D9;box-shadow:none}.obi-round-button:hover{cursor:pointer}.obi-round-button:disabled{box-shadow:none;background-color:#f0f0f0;color:#999;cursor:not-allowed!important;pointer-events:none}.obi-round-button-title{padding:8px 16px;border-radius:12px;background-color:#fff;color:#000;font-size:14px;font-weight:400;white-space:nowrap;box-shadow:0 4px 12px #00000026,0 2px 4px #0000001a;border:1px solid rgba(0,0,0,.08);z-index:5000;pointer-events:none;-webkit-user-select:none;user-select:none;position:relative}.obi-round-button-title:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid white;filter:drop-shadow(0 2px 2px rgba(0,0,0,.1))}.obi-equaliser{display:flex;align-items:center;gap:2px;height:32px}.obi-equaliser .column{position:relative;display:flex;align-items:center;justify-content:center;width:5px;height:100%}.obi-equaliser .bar{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:3px;border-radius:2px;z-index:1}.obi-message{display:inline-flex;align-items:center;justify-content:center;min-width:140px;padding:0 15px;text-wrap:nowrap;font-size:16px;font-weight:400;height:30px;box-sizing:border-box;background-color:#fff;border-radius:15px;border:1px solid #D9D9D9}.obi-message.clickable{box-shadow:0 4px 6px #0000001a;cursor:pointer}.obi-loading-dots{display:flex;align-items:center;gap:2px;height:32px}.obi-loading-dots .column{position:relative;display:flex;align-items:center;justify-content:center;width:5px;height:100%}.obi-loading-dots .dot{width:3px;height:3px;border-radius:2px;position:relative;z-index:2}.obi-loading-dots .bar{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:3px;border-radius:2px;z-index:1;height:0px;animation:bounce .9s ease-in-out infinite}@keyframes bounce{0%,60%,to{height:0px}30%{height:16px}}.obi-exit-survey{position:relative;width:320px;margin:0 auto;-webkit-backdrop-filter:none;backdrop-filter:none;background:white;z-index:9999}.obi-exit-survey-container{display:flex;flex-direction:column;align-items:center;padding:0;gap:16px;width:272px;flex:none;align-self:stretch}.obi-exit-survey-header{display:flex;flex-direction:column;align-items:flex-start;padding:0;gap:4px;width:272px;flex:none;align-self:stretch}.obi-exit-survey-title{width:272px;height:22px;margin:0;font-family:Satoshi,sans-serif;font-size:16px;font-weight:600;line-height:140%;text-align:center;color:#1e1e1e;flex:none;align-self:stretch}.obi-exit-survey-subtitle{width:272px;height:20px;margin:0;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:140%;text-align:center;color:#757575;flex:none;align-self:stretch}.obi-exit-survey-options{display:flex;flex-direction:column;align-items:flex-start;padding:0;gap:4px;width:272px;flex:none;align-self:stretch}.obi-exit-survey-options textarea{height:80px;resize:none;outline:none}.obi-exit-survey-button{box-sizing:border-box;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:12px;gap:8px;width:272px;height:44px;border-radius:12px;cursor:pointer;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:140%;flex:none;align-self:stretch;transition:all .2s ease}.obi-exit-survey-button:hover{transform:translateY(-1px);box-shadow:0 4px 8px #0000001a}.obi-exit-survey-button:active{transform:translateY(0)}.obi-exit-survey-button-continue{background:rgba(255,255,255);border:1px solid rgba(217,217,217);color:#1e1e1e}.obi-exit-survey-button-continue:hover{background:rgba(255,255,255);border-color:#d9d9d9}.obi-exit-survey-button-wrap-up{background:#303030;border:1px solid rgba(217,217,217);color:#fff;font-weight:500}.obi-exit-survey-button-wrap-up:hover{background:#404040;border-color:#d9d9d9}.obi-exit-survey-reason-button{background:rgba(255,255,255);border:1px solid rgba(217,217,217);color:#1e1e1e}.obi-exit-survey-reason-button:hover{background:rgba(255,255,255);border-color:#d9d9d9}.obi-exit-survey-reason-button-secondary{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:4px 6px;gap:8px;width:272px;height:28px;border-radius:4px;cursor:pointer;border:none;background:transparent;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:140%;color:#5a5a5a;flex:none;align-self:stretch;transition:all .2s ease}.obi-exit-survey-reason-button-secondary:hover{background:rgba(0,0,0,.05);color:#3a3a3a}.obi-message-input{display:inline-block;position:relative}.obi-message-input .container{width:212px;height:30px;box-sizing:border-box;background:#FFFFFF;border:1px solid var(--obi-color-primary-30);border-radius:15px;display:flex;align-items:center;flex:none;order:2;flex-grow:0;transition:height .3s ease,border-radius .3s ease;animation:expandMessageInput .2s cubic-bezier(.4,0,.2,1) 0s 1 normal both}.obi-message-input.expanded .container{height:auto;min-height:140px;border-radius:15px;align-items:flex-start;padding:8px 0;animation:expandMessageInputWide .2s cubic-bezier(.4,0,.2,1) 0s 1 normal both}.obi-message-input .field{flex:1 1 0;border:none;background:transparent;outline:none;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:18px;color:#000;padding:4px 3px 0 16px;height:100%;box-sizing:border-box;min-width:0;resize:none;overflow:hidden;scrollbar-width:none;transition:padding .3s ease;animation:fadeInInputField .2s cubic-bezier(.4,0,.2,1) 0s 1 normal both}.obi-message-input.expanded .field{height:auto;min-height:120px;padding:4px 16px;overflow-y:auto;line-height:18px}.obi-message-input .field::placeholder{color:#999}.obi-message-input .field:disabled{cursor:not-allowed;opacity:.6}.obi-message-input .send{position:absolute;bottom:3px;right:4px;flex-shrink:0;width:24px;height:24px;background:var(--obi-color-primary);border:none;border-radius:9999px;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:all .3s ease;color:#fff}.obi-message-input.expanded .send{width:28px;height:28px;position:relative;top:0;bottom:0;margin-right:0}.obi-message-input.expanded .button-container{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:8px}.obi-message-input .send:disabled{background:#CCCCCC;cursor:not-allowed;transform:none}.obi-message-input .container:focus-within{border-color:var(--obi-color-primary);box-shadow:0 0 0 2px #9008ff1a}@keyframes expandMessageInput{0%{width:32px}to{width:212px}}@keyframes expandMessageInputWide{0%{width:212px}to{width:340px}}@keyframes fadeInInputField{0%{opacity:0}60%{opacity:0}to{opacity:1}}.obi-course-progress{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:6px;width:100%;min-width:0;height:24px;flex:none;order:1;align-self:stretch;flex-grow:0}.obi-course-progress-steps{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0;gap:2px;width:100%;height:6px;flex:none;order:0;align-self:stretch;flex-grow:0}.obi-course-progress-container{display:flex;flex-direction:column;justify-content:center;align-items:stretch;padding:2px 0;height:6px;flex:1;min-width:0}.obi-course-progress-step{width:100%;height:2px;background:var(--obi-course-progress-step-incomplete);border-radius:24px;flex:none;order:0;align-self:stretch;flex-grow:0}.obi-course-progress-step.completed{background:var(--obi-course-progress-step-completed)}.obi-course-progress-description{width:100%;height:14px;font-family:var(--obi-font-family);font-style:normal;font-weight:500;font-size:14px;line-height:100%;color:var(--obi-course-progress-text-color);flex:none;order:1;flex-grow:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.obi-widget-popout{z-index:400}.obi-widget-panel{display:flex;flex-direction:column;gap:8px;align-items:center;justify-content:center;min-width:222px;width:min-content;padding:12px;box-sizing:border-box;border-radius:27px;background:white;transition:background .1s ease-out .1s,box-shadow .1s ease-out .1s}.obi-widget-panel:not(.messaging){width:256px}.obi-widget-panel.tool-usage{width:384px}.obi-widget-panel:not(.expanded){background:transparent;border:none;box-shadow:none;transition:background .1s ease-out .1s,border .1s ease-out .1s,box-shadow .1s ease-out .1s}.obi-widget-panel.maximized{transform:translateY(-110px)}.obi-widget-panel .obi-widget{display:flex;align-items:center;min-width:192px;padding-left:58px;box-sizing:border-box;gap:4px}.obi-widget-panel .obi-widget.active.in-plan{padding-left:0}.obi-widget-panel .obi-widget.active.in-plan .obi-round-button{animation:fade-in-button .2s ease-out .15s both}.obi-widget-panel .obi-widget.active .obi-equaliser{animation:fade-in-equaliser .2s ease-out .15s both}@keyframes fade-in-button{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes fade-in-equaliser{0%{opacity:0}to{opacity:1}}.obi-widget-panel .obi-course-progress-container{display:none;width:100%;max-height:0;opacity:0;transform:translateY(-10px);overflow:hidden;transition:max-height .3s ease-in-out,opacity .3s ease-in-out,transform .3s ease-in-out}.obi-widget-panel:hover .obi-course-progress-container{display:block;max-width:22 0px;animation:expand-course-progress .3s ease-in-out forwards}.obi-widget-panel:hover .obi-course-progress-container.expanded{max-width:330px}@keyframes expand-course-progress{0%{max-height:0;opacity:0;transform:translateY(-10px)}to{max-height:40px;opacity:1;transform:translateY(0)}}.obi-widget-pill-text{font-size:16px;font-weight:400;color:#fff;opacity:0;animation:fade-in-pill-text .3s ease-in-out forwards}@keyframes fade-in-pill-text{0%{opacity:0}40%{opacity:0}to{opacity:1}}.obi-widget-buttons{display:flex;flex-direction:row;gap:4px}.obi-widget-out-of-plan{display:flex;align-items:center;gap:4px}.obi-widget-out-of-plan .text{font-size:16px;color:#fff;animation:fade-in-pill-text .3s ease-in-out forwards}.obi-widget-out-of-plan .round-button{display:none;animation:fade-in-button .2s ease-out .15s both}.obi-widget-out-of-plan .message{display:none}.obi-widget-out-of-plan.active:hover .round-button,.obi-widget-out-of-plan.active:hover .message,.obi-widget-out-of-plan.active.hover .round-button,.obi-widget-out-of-plan.active.hover .message{display:flex}.tour-select{display:block;font-family:Inter,sans-serif}.course-container{display:flex;padding:20px;align-items:flex-start;gap:8px;height:180px;border-radius:6px;border:1px solid rgba(0,0,0,.6);background:#fff;cursor:pointer;transition:all .2s;flex-direction:column;box-sizing:border-box;overflow:hidden}.course-container:hover{background-color:#f9fafb;border-color:#d1d5db;box-shadow:0 1px 2px #0000000d}.course-container:active{transform:scale(.98)}.course-container.selected{border-radius:6px;border:1px solid var(--obi-course-color-selected);background:var(--obi-course-color-tint)}.course-container.selected:hover{background:var(--obi-course-color-tint)}.header-row{display:flex;justify-content:space-between;align-items:flex-start;align-self:stretch;flex-shrink:0;text-align:left}.course-title{color:#000;font-family:Inter,sans-serif;font-size:20px;font-style:normal;font-weight:500;line-height:100%;letter-spacing:-.2px;margin:0}.duration{display:flex;padding:4px 12px;justify-content:center;align-items:center;gap:8px;border-radius:9999px;background:var(--obi-course-color-tint);color:#000;font-family:Inter,sans-serif;font-size:14px;font-style:normal;font-weight:500;line-height:100%;letter-spacing:-.14px;flex-shrink:0}.course-container.selected .duration{background:#fff}.course-description{flex:1 0 0;color:#0009;font-family:Inter,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:140%;letter-spacing:-.16px;margin:0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;text-align:left}.course-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px;padding:0;flex:1 0 0;align-self:stretch;min-height:364px}.controls{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.tabs{display:flex;gap:10px}.tab{display:flex;padding:6px 12px;justify-content:center;align-items:center;align-self:stretch;border:none;background:none;cursor:pointer;font-family:Inter,sans-serif;font-size:16px;font-weight:500;color:#0006;border-bottom:2px solid transparent;transition:all .2s}.tab.active{color:#000;border-bottom:2px solid var(--obi-color-primary)}.tab:hover{color:#000}.filter{position:relative;display:flex;align-items:center;width:336px;height:40px}.filter input{color:var(--obi-color-text);caret-color:var(--obi-color-text);padding:8px 12px 8px 36px;border-radius:6px;border:1px solid rgba(0,0,0,.1);background:#fff;font-family:Inter,sans-serif;font-size:14px;line-height:20px;width:100%;height:100%;box-sizing:border-box;outline:none}.filter input:focus{outline:1px solid var(--obi-color-primary);outline-offset:-1px}.filter input::placeholder{color:#0006}.filter svg{position:absolute;left:12px;pointer-events:none}@media (max-width: 767px){.course-grid{grid-template-columns:1fr}}.loading,.error,.empty{display:flex;justify-content:center;align-items:center;margin-top:16px}.error{color:#ef4444}.tour-select-modal-container{display:flex;flex-direction:column;align-items:center;gap:24px;flex:1 0 0;align-self:stretch;font-family:Satoshi,sans-serif;color:#000;text-align:center;max-width:1200px;width:100%;min-height:600px;box-sizing:border-box}.course-list-wrapper{flex:1;overflow-y:auto;width:100%;min-height:0;max-height:424px;padding-right:3px;box-sizing:border-box}.course-list-wrapper::-webkit-scrollbar{width:3px}.course-list-wrapper::-webkit-scrollbar-track{background:transparent}.course-list-wrapper::-webkit-scrollbar-thumb{background-color:#000;border-radius:2px;min-height:20px}.course-list-wrapper::-webkit-scrollbar-thumb:hover{background-color:#333}.header{display:flex;align-items:flex-start;gap:16px;width:100%;text-align:left}.icon{display:flex;width:56px;height:56px;padding:12px;justify-content:center;align-items:center;border-radius:12px;border:1px solid var(--obi-color-primary);background:var(--obi-color-primary);box-sizing:border-box}.icon img{width:32px;height:32px;color:#fff;fill:#fff}.title-section{align-self:stretch;flex:1}.tour-select-modal-container h1{color:#18181b;font-family:Satoshi;font-size:32px;font-style:normal;font-weight:700;line-height:90%;letter-spacing:-.96px;margin:0 0 8px}.subtitle{color:#18181b;font-family:Satoshi;font-size:20px;font-style:normal;font-weight:500;line-height:90%;letter-spacing:-.6px;margin:0}.footer{display:flex;width:360px;flex-direction:column;align-items:center;gap:12px}.footer-button{display:flex;height:48px;padding:16px;justify-content:center;align-items:center;gap:8px;align-self:stretch;border-radius:6px;background:#18181b;border:none;cursor:pointer;color:#fafafa;font-family:Satoshi;font-weight:500;transition:opacity .2s ease}.footer-button:disabled{opacity:.5;cursor:not-allowed}.footer-button:not(:disabled){opacity:1}.footer-button:not(:disabled):hover{background:#27272a}.footer-text{color:#18181b;font-family:Satoshi;font-size:12px;font-style:normal;font-weight:400;line-height:100%;letter-spacing:-.12px;margin:0;text-align:center}.skeleton{background:linear-gradient(90deg,#e5e7eb 25%,#f3f4f6 50%,#e5e7eb 75%);background-size:200% 100%;animation:loading 1.5s infinite;border-radius:4px}@keyframes loading{0%{background-position:200% 0}to{background-position:-200% 0}}.skeleton-title{height:32px;width:60%;margin-bottom:12px}.skeleton-subtitle{height:20px;width:80%}
125
- `;function p4(n){let e=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"__DOUBLE_STAR__").replace(/\*/g,"[^/]*").replace(/__DOUBLE_STAR__/g,".*").replace(/\?/g,"[^/]");return new RegExp(`^${e}$`,"i")}function f4(n,e){if(!e||e.length===0)return!1;const t=n.replace(/^https?:\/\//,"").replace(/\/$/,"");return e.some(r=>{try{const i=p4(r);return i.test(t)||i.test(n)}catch(i){return console.warn(`Invalid URL pattern: ${r}`,i),!1}})}function Rp(n){if(!n||n.length===0)return!1;const e=window.location.origin+window.location.pathname;return f4(e,n)}function g4(n){var b,w,_,k,F,x;const[e,t]=ge(!1),[r,i]=ge(!1),[A,s]=ge(null),o=m4(n.sdk,a,n.shadowHost,s);function a(U){var T;(T=o.client)!=null&&T.session||(t(U),Ue().track("course-list-opened"))}if(!o.client)return null;const c=v4((b=o.client.product)==null?void 0:b.widget_url_blacklist);let u=o.isActive;((_=(w=o.client)==null?void 0:w.product)==null?void 0:_.name)==="Canibuild"&&(u=!0);const l=o.client.session,d=!!l,h=d&&!e;let f;switch(l==null?void 0:l.speakingState){case"listening":f="user-speaking";break;case"speaking":f="agent-speaking";break;case"thinking":f="thinking";break;case"busy":f="busy";break}const p=l==null?void 0:l.isPaused,g=d||o.client.state==="ready"&&u&&!c&&(o.client.selectedPlan||!((k=o.client.product)!=null&&k.widget_link_only_access)),v=h?100:62,y=()=>{var U,T,Q,M,X,H;return{name:(U=o.client.selectedPlan)==null?void 0:U.name,description:(T=o.client.selectedPlan)==null?void 0:T.description,appName:(Q=o.client.product)==null?void 0:Q.name,appLogoUrl:((M=o.client.product)==null?void 0:M.logo_url)||"",url:(X=o.client.product)==null?void 0:X.url,agentName:((H=o.client.product)==null?void 0:H.agent_name)||"Obi"}},B=((F=o.client.product)==null?void 0:F.widget_position)==="bottom-right"?{position:"fixed",top:`calc(100vh - ${v}px)`,right:"250px",width:"max-content",transform:"translateX(50%)"}:{position:"fixed",top:`calc(100vh - ${v}px)`,left:"50%",transform:"translateX(-50%)",width:"max-content"};return C("div",{children:[e&&C(hR,{open:e,courses:o.client.plans.map(U=>({id:U.uuid,name:U.name,description:U.description||"",duration:U.duration||0})),loading:!1,agentName:((x=o.client.product)==null?void 0:x.agent_name)||"Obi",onCourseSelect:U=>{const T=o.client.plans.find(Q=>Q.uuid===U.id)||null;T&&(o.client.selectPlan(T),t(!1),i(!0),Ue().track("course-selected"))},onClose:U=>{U==="user-initiated"&&o.client.selectPlan(null),t(!1)}}),g&&C(St,{children:[C("div",{style:B,children:C(JQ,{inPlan:d,isActive:r?!1:void 0,defaultIsActive:!0,isPaused:p,messaging:(l==null?void 0:l.isMicShared)===!1?!0:void 0,speakingStatus:f,spectrum:()=>(l==null?void 0:l.audioSpectrum())||null,courseProgress:A,onOpen:()=>{t(!0),Ue().track("course-list-opened")},onCancelClick:()=>{Ue().track("close-button-clicked")},onCancelAbort:()=>{Ue().track("close-confirmation-no")},onCancel:()=>{var U;(U=o.client.session)==null||U.stop(),Ue().track("close-confirmation-yes")},onCancelReason:(U,T)=>{Ue().track("close-survey-answered",{reason:U,reasonText:T})},onPause:()=>{var U,T;(T=(U=o.client.session)==null?void 0:U.pause)==null||T.call(U),Ue().track("pause-button-clicked")},onUnpause:()=>{var U,T;(T=(U=o.client.session)==null?void 0:U.unpause)==null||T.call(U),Ue().track("play-button-clicked")},onMessagingChange:U=>{var T,Q,M,X;U?((Q=(T=o.client.session)==null?void 0:T.muteMicrophone)==null||Q.call(T),Ue().track("switch-to-chat-clicked")):((X=(M=o.client.session)==null?void 0:M.unmuteMicrophone)==null||X.call(M),Ue().track("switch-to-voice-clicked"))},onMessageChange:U=>{Ue().track("chat-input-provided",{message:U,length:U.length})},onMessage:U=>{o.say(U),Ue().track("chat-message-sent")},onHover:U=>{U&&!d&&Ue().track("widget-hover-on")},onOneClickAction:U=>{Ue().track("one-click-action-clicked",{action:U})},onMinimize:()=>{Ue().track("minimise-button-clicked",{inSession:d})}})}),!!o.client.selectedPlan&&C(fR,{open:!0,session:y(),sessionState:(l==null?void 0:l.state)||null,speakingState:(l==null?void 0:l.speakingState)||null,spectrum:()=>(l==null?void 0:l.audioSpectrum())||null,onModalChange:U=>{U==="session-start"?Ue().track("course-screen-opened"):U==="voice-guidance"?Ue().track("can-you-hear-opened"):U==="overview"?Ue().track("welcome-tour-opened"):U==="share-mic"&&Ue().track("connect-mic-opened")},onClose:(U,T)=>{var Q,M;U==="user-initiated"&&(T==="session-start"?Ue().track("course-screen-closed"):T==="voice-guidance"?Ue().track("can-you-hear-closed"):T==="overview"?Ue().track("welcome-tour-closed"):T==="share-mic"&&Ue().track("connect-mic-closed"),((Q=o.client.session)==null?void 0:Q.state)==="mic-share"?(M=o.client.session)==null||M.shareMicrophoneFailed():o.client.stopSession()),i(!1)},onStart:()=>{o.client.selectedPlanUuid&&(Ue().track("course-screen-continue"),o.startSession())},onContinue:()=>{l==null||l.continue(),Ue().track("can-you-hear-continue")},onShareMicrophone:()=>{l==null||l.shareMicrophone(),Ue().track("connect-mic-continue")}})]})]})}function m4(n,e,t,r){const[i,A]=ge(0),[s,o]=ge(null);return Kt(()=>{n.on("showMenu",a=>{e(a)}),n.on("configUpdated",()=>{A(a=>a+1)})},[n]),Kt(()=>{n.client&&(n.client.session&&o(n.client.session),n.client.on("sessionStarted",a=>{o(a),A(c=>c+1)}),n.client.on("sessionStopped",()=>{o(null),A(a=>a+1)}),n.client.on("sessionShutdown",()=>{A(a=>a+1)}),n.client.on("sessionResumed",()=>{A(a=>a+1)}),n.client.on("stateChanged",()=>{var a;n.client.state==="ready"&&t.style.setProperty("--obi-color-primary",((a=n.client.product)==null?void 0:a.primary_color)||"#9500FF"),A(c=>c+1)}),n.client.on("planSelected",()=>{A(a=>a+1)}))},[n,n.client]),Kt(()=>{if(!s)return;s.on("stateChanged",()=>{A(c=>c+1)}),s.on("speakingStateChanged",()=>{A(c=>c+1)}),s.on("paused",()=>{A(c=>c+1)}),s.on("unpaused",()=>{A(c=>c+1)});const a=c=>{r(c)};return s.on&&s.on("courseProgress",a),()=>{s.off&&s.off("courseProgress",a)}},[s]),n}function v4(n){const[e,t]=ge(()=>Rp(n));return Kt(()=>{t(Rp(n))},[n]),Kt(()=>{y4();const r=()=>{t(Rp(n))};return window.addEventListener("locationchange",r),window.addEventListener("popstate",r),window.addEventListener("hashchange",r),()=>{window.removeEventListener("locationchange",r),window.removeEventListener("popstate",r),window.removeEventListener("hashchange",r)}},[n]),e}function y4(){const n=window;if(n.__obi_history_patched)return;const{pushState:e,replaceState:t}=window.history,r=i=>function(...A){const s=i.apply(this,A);return window.dispatchEvent(new Event("locationchange")),s};window.history.pushState=r(e),window.history.replaceState=r(t),n.__obi_history_patched=!0}function w4(n){if(document.querySelector("obi-widget"))return;b4();const e=document.createElement("div");e.id="obi-host",e.style.position="fixed",e.style.zIndex="9999",document.body.appendChild(e);const t=e.attachShadow({mode:"open"}),r=document.createElement("div");r.id="obi-container",t.appendChild(r);const i=new CSSStyleSheet;i.replaceSync(h4),t.adoptedStyleSheets=[i],gQ(C(g4,{sdk:n,shadowHost:e}),r),console.log("[obi-sdk] widget mounted")}function b4(){JC("https://fonts.cdnfonts.com/css/satoshi"),JC("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap")}function JC(n){const e=document.createElement("link");e.href=n,e.rel="stylesheet",document.head.appendChild(e)}const zC="49206C6F7665204F6269_session",XC="obi-url-params";class B4 extends Gc{constructor(e){super(),this.client=null,this.isActive=!1,this.primaryColour="#9500FF",this.passivePlanUuid=null,this.commandQueue=[],this._resumed=!1,this.dispatchCommand=(t,r)=>{var i,A,s,o,a;switch(t){case"update":this.updateConfig(r);break;case"startSession":if(!(r!=null&&r.planUuid)){console.warn("[obi] startSession command requires a planUuid",r);return}const c=(((i=this.client)==null?void 0:i.plans)||[]).find(u=>u.uuid===r.planUuid)||null;if(!c){console.warn("[obi] startSession command requires a valid planUuid",r);return}this.updateActive(!0),(s=(A=this.client)==null?void 0:A.selectPlan)==null||s.call(A,c);break;case"stopSession":(a=(o=this.client)==null?void 0:o.stopSession)==null||a.call(o);break;case"say":this.say(r);break;default:console.warn("[obi] unknown command",{commandType:t,args:r})}},e&&this.createClient(e),this.parsePassiveParams()}async createClient(e){if(this.client){this.client.appToken!==e&&console.warn("[obi] client already exists with different app token");return}let t=null;const r=this.load();if(r)try{t=fa.deserialise(r,e,"sdk",{apiBaseUrl:"https://app.coragents.ai",captureScreen:this.captureScreen.bind(this)}),this._resumed=!0}catch(i){console.error("[obi] error loading cached client",i)}t||(t=new fa(e,"sdk",{apiBaseUrl:"https://app.coragents.ai",captureScreen:this.captureScreen.bind(this)})),this.client=t,this.client.on("stateChanged",i=>{var A,s,o;i==="ready"&&this.updateConfig({isActive:(A=this.client)==null?void 0:A.showWidget,primaryColour:((o=(s=this.client)==null?void 0:s.product)==null?void 0:o.primary_color)||"#9500FF"})}),this.client.on("sessionStarted",()=>{this.save(),this.passivePlanUuid=null}),this.client.on("sessionStopped",()=>{localStorage.removeItem("obi-client"),this.passivePlanUuid=null}),this.client.on("sessionShutdown",i=>{i==="invalid-room"&&localStorage.removeItem("obi-client")}),this.client.on("trackEvent",(i,A)=>{Ue().track(i,A)}),this.client.session&&this.client.resumeSession(i=>{i.on("stateChanged",A=>{A!=="disconnecting"&&A!=="disconnected"&&A!=="error"&&A!=="connecting"&&this.save()}),i.on("paused",()=>{this.save()}),i.on("unpaused",()=>{this.save()})})}async initialise(e={}){this.commandQueue=e.queuedCommands||[],this._resumed?(this._resumed=!1,this.dispatchCommandQueue()):this.client?this.client.initialise({planUuid:this.passivePlanUuid||void 0}).then(()=>{this.emit("initialised"),this.dispatchCommandQueue()}).catch(t=>{console.error("[obi] error initialising client",t),this.emit("error",t)}):this.dispatchCommandQueue()}async updateConfig(e){await this.updateAppToken(e.apiKey),this.updateActive(e.isActive),this.updatePrimaryColour(e.primaryColour),await this.updateIdentity(e.user),this.updateShowMenu(e.showMenu),this.emit("configUpdated")}async updateAppToken(e){var t;e===void 0||e==((t=this.client)==null?void 0:t.appToken)||(this.passivePlanUuid,await this.createClient(e),this.client&&await this.client.initialise({planUuid:this.passivePlanUuid||void 0}).then(()=>{this.emit("initialised")}).catch(r=>{console.error("[obi] error initialising client",r),this.emit("error",r)}))}updateActive(e){e===void 0||e==this.isActive||(this.isActive=e)}updatePrimaryColour(e){e===void 0||e==this.primaryColour||(this.primaryColour=e)}async updateIdentity(e){var r;if(e===void 0||e==((r=this.client)==null?void 0:r.identity))return;let t=e?{...e,extra:{...e,...(e==null?void 0:e.extra)||{}}}:void 0;await this.client.initialise({identity:t,planUuid:this.passivePlanUuid||void 0}).then(()=>{this.emit("initialised")}).catch(i=>{console.error("[obi] error initialising client",i),this.emit("error",i)}),e!=null&&e.email&&Ue().identify((e==null?void 0:e.email)||"",t)}updateShowMenu(e){e!==void 0&&this.emit("showMenu",e)}async say(e){var t,r,i;await((i=(r=(t=this.client)==null?void 0:t.session)==null?void 0:r.say)==null?void 0:i.call(r,e))}async startSession(){await this.client.startSession(this.client.selectedPlan.uuid,e=>{e.on("stateChanged",t=>{t!=="disconnecting"&&t!=="disconnected"&&t!=="error"&&t!=="connecting"&&this.save()})})}dispatchCommandQueue(){const e=this.commandQueue;this.commandQueue=[],e.forEach(t=>{try{this.dispatchCommand(t[0],t[1]||[])}catch(r){console.error("[obi] error dispatching command",r)}})}parsePassiveParams(){if(this.passivePlanUuid){this.passivePlanUuid;return}let e={};e=JSON.parse(localStorage.getItem(XC)||"{}"),Object.keys(e).length===0&&new URLSearchParams(window.location.search).forEach((A,s)=>{e[s]=A});const t=e[zC];if(!t)return null;const r=new URL(window.location.href);r.searchParams.delete(zC),window.history.replaceState({},"",r.toString()),r.toString(),localStorage.removeItem(XC),this.passivePlanUuid=t}mountWidget(){w4(this)}async captureScreen(){return(await BT(document.documentElement,{useCORS:!0,allowTaint:!0,foreignObjectRendering:!0})).toDataURL("image/png")}save(){var e;localStorage.setItem("obi-client",((e=this.client)==null?void 0:e.serialise())||"")}load(){return localStorage.getItem("obi-client")}}async function YC(n){let e;try{e=window}catch{console.warn("[obi] no window object found"),e={}}return C4({appToken:n,window:e})}async function C4({appToken:n,window:e}){var i,A;if(e.obi){console.warn("[obi] obi object already found on window, skipping");return}n||(n=(i=e==null?void 0:e.obiWidgetConfig)==null?void 0:i.apiKey);let t;try{t=((A=e.ObiSDK)==null?void 0:A.q)||[]}catch{t=[]}const r=new B4(n);return e.ObiSDK=r.dispatchCommand,await r.initialise({queuedCommands:t}),e.obi=r,r.mountWidget(),r}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{YC()}):YC()})();
125
+ `;function p4(n){let e=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"__DOUBLE_STAR__").replace(/\*/g,"[^/]*").replace(/__DOUBLE_STAR__/g,".*").replace(/\?/g,"[^/]");return new RegExp(`^${e}$`,"i")}function f4(n,e){if(!e||e.length===0)return!1;const t=n.replace(/^https?:\/\//,"").replace(/\/$/,"");return e.some(r=>{try{const i=p4(r);return i.test(t)||i.test(n)}catch(i){return console.warn(`Invalid URL pattern: ${r}`,i),!1}})}function Rp(n){if(!n||n.length===0)return!1;const e=window.location.origin+window.location.pathname;return f4(e,n)}function g4(n){var b,w,_,k,F,x;const[e,t]=ge(!1),[r,i]=ge(!1),[A,s]=ge(null),o=m4(n.sdk,a,n.shadowHost,s);function a(E){var T;(T=o.client)!=null&&T.session||(t(E),E&&Se().track("course-list-opened"))}if(!o.client)return null;const c=v4((b=o.client.product)==null?void 0:b.widget_url_blacklist);let u=o.isActive;((_=(w=o.client)==null?void 0:w.product)==null?void 0:_.name)==="Canibuild"&&(u=!0);const l=o.client.session,d=!!l,h=d&&!e;let f;switch(l==null?void 0:l.speakingState){case"listening":f="user-speaking";break;case"speaking":f="agent-speaking";break;case"thinking":f="thinking";break;case"busy":f="busy";break}const p=l==null?void 0:l.isPaused,g=d||o.client.state==="ready"&&u&&!c&&(o.client.selectedPlan||!((k=o.client.product)!=null&&k.widget_link_only_access)),v=h?100:62,y=()=>{var E,T,Q,M,X,H;return{name:(E=o.client.selectedPlan)==null?void 0:E.name,description:(T=o.client.selectedPlan)==null?void 0:T.description,appName:(Q=o.client.product)==null?void 0:Q.name,appLogoUrl:((M=o.client.product)==null?void 0:M.logo_url)||"",url:(X=o.client.product)==null?void 0:X.url,agentName:((H=o.client.product)==null?void 0:H.agent_name)||"Obi"}},B=((F=o.client.product)==null?void 0:F.widget_position)==="bottom-right"?{position:"fixed",top:`calc(100vh - ${v}px)`,right:"250px",width:"max-content",transform:"translateX(50%)"}:{position:"fixed",top:`calc(100vh - ${v}px)`,left:"50%",transform:"translateX(-50%)",width:"max-content"};return C("div",{children:[e&&C(hR,{open:e,courses:o.client.plans.map(E=>({id:E.uuid,name:E.name,description:E.description||"",duration:E.duration||0})),loading:!1,agentName:((x=o.client.product)==null?void 0:x.agent_name)||"Obi",onCourseHighlight:E=>{E&&Se().track("course-selected",{courseName:E.name,courseUuid:E.id})},onCourseSelect:E=>{const T=o.client.plans.find(Q=>Q.uuid===E.id)||null;T&&(T==null?void 0:T.uuid)!==o.client.selectedPlanUuid&&(o.client.selectPlan(T),t(!1),i(!0),Se().track("course-get-started",{courseName:E.name,courseUuid:E.id}))},onClose:E=>{E==="user-initiated"&&o.client.selectPlan(null),t(!1)}}),g&&C(St,{children:[C("div",{style:B,children:C(JQ,{inPlan:d,isActive:r?!1:void 0,defaultIsActive:!0,isPaused:p,messaging:(l==null?void 0:l.isMicShared)===!1?!0:void 0,speakingStatus:f,spectrum:()=>(l==null?void 0:l.audioSpectrum())||null,courseProgress:A,onOpen:()=>{t(!0),Se().track("course-list-opened")},onCancelClick:()=>{Se().track("close-button-clicked")},onCancelAbort:()=>{Se().track("close-confirmation-no")},onCancel:()=>{var E;(E=o.client.session)==null||E.stop(),Se().track("close-confirmation-yes")},onCancelReason:(E,T)=>{Se().track("close-survey-answered",{reason:E,reasonText:T})},onPause:()=>{var E,T;(T=(E=o.client.session)==null?void 0:E.pause)==null||T.call(E),Se().track("pause-button-clicked")},onUnpause:()=>{var E,T;(T=(E=o.client.session)==null?void 0:E.unpause)==null||T.call(E),Se().track("play-button-clicked")},onMessagingChange:E=>{var T,Q,M,X;E?((Q=(T=o.client.session)==null?void 0:T.muteMicrophone)==null||Q.call(T),Se().track("switch-to-chat-clicked")):((X=(M=o.client.session)==null?void 0:M.unmuteMicrophone)==null||X.call(M),Se().track("switch-to-voice-clicked"))},onMessageChange:E=>{Se().track("chat-input-provided",{message:E,length:E.length})},onMessage:E=>{o.say(E),Se().track("chat-message-sent")},onHover:E=>{E&&!d&&Se().track("widget-hover-on")},onOneClickAction:E=>{Se().track("one-click-action-clicked",{action:E})},onMinimize:()=>{Se().track("minimise-button-clicked",{inSession:d})}})}),!!o.client.selectedPlan&&C(fR,{open:!0,session:y(),sessionState:(l==null?void 0:l.state)||null,speakingState:(l==null?void 0:l.speakingState)||null,spectrum:()=>(l==null?void 0:l.audioSpectrum())||null,onModalChange:E=>{E==="session-start"?Se().track("course-screen-opened"):E==="voice-guidance"?Se().track("can-you-hear-opened"):E==="overview"?Se().track("welcome-tour-opened"):E==="share-mic"&&Se().track("connect-mic-opened")},onClose:(E,T)=>{var Q,M;E==="user-initiated"&&(T==="session-start"?Se().track("course-screen-closed"):T==="voice-guidance"?Se().track("can-you-hear-closed"):T==="overview"?Se().track("welcome-tour-closed"):T==="share-mic"&&Se().track("connect-mic-closed"),((Q=o.client.session)==null?void 0:Q.state)==="mic-share"?(M=o.client.session)==null||M.shareMicrophoneFailed():o.client.stopSession()),i(!1)},onStart:()=>{o.client.selectedPlanUuid&&(Se().track("course-screen-continue"),o.startSession())},onContinue:()=>{l==null||l.continue(),Se().track("can-you-hear-continue")},onShareMicrophone:()=>{l==null||l.shareMicrophone(),Se().track("connect-mic-continue")}})]})]})}function m4(n,e,t,r){const[i,A]=ge(0),[s,o]=ge(null);return Kt(()=>{n.on("showMenu",a=>{e(a)}),n.on("configUpdated",()=>{A(a=>a+1)})},[n]),Kt(()=>{n.client&&(n.client.session&&o(n.client.session),n.client.on("sessionStarted",a=>{o(a),A(c=>c+1)}),n.client.on("sessionStopped",()=>{o(null),A(a=>a+1)}),n.client.on("sessionShutdown",()=>{A(a=>a+1)}),n.client.on("sessionResumed",()=>{A(a=>a+1)}),n.client.on("stateChanged",()=>{var a;n.client.state==="ready"&&t.style.setProperty("--obi-color-primary",((a=n.client.product)==null?void 0:a.primary_color)||"#9500FF"),A(c=>c+1)}),n.client.on("planSelected",()=>{A(a=>a+1)}))},[n,n.client]),Kt(()=>{if(!s)return;s.on("stateChanged",()=>{A(c=>c+1)}),s.on("speakingStateChanged",()=>{A(c=>c+1)}),s.on("paused",()=>{A(c=>c+1)}),s.on("unpaused",()=>{A(c=>c+1)});const a=c=>{r(c)};return s.on&&s.on("courseProgress",a),()=>{s.off&&s.off("courseProgress",a)}},[s]),n}function v4(n){const[e,t]=ge(()=>Rp(n));return Kt(()=>{t(Rp(n))},[n]),Kt(()=>{y4();const r=()=>{t(Rp(n))};return window.addEventListener("locationchange",r),window.addEventListener("popstate",r),window.addEventListener("hashchange",r),()=>{window.removeEventListener("locationchange",r),window.removeEventListener("popstate",r),window.removeEventListener("hashchange",r)}},[n]),e}function y4(){const n=window;if(n.__obi_history_patched)return;const{pushState:e,replaceState:t}=window.history,r=i=>function(...A){const s=i.apply(this,A);return window.dispatchEvent(new Event("locationchange")),s};window.history.pushState=r(e),window.history.replaceState=r(t),n.__obi_history_patched=!0}function w4(n){if(document.querySelector("obi-widget"))return;b4();const e=document.createElement("div");e.id="obi-host",e.style.position="fixed",e.style.zIndex="9999",document.body.appendChild(e);const t=e.attachShadow({mode:"open"}),r=document.createElement("div");r.id="obi-container",t.appendChild(r);const i=new CSSStyleSheet;i.replaceSync(h4),t.adoptedStyleSheets=[i],gQ(C(g4,{sdk:n,shadowHost:e}),r),console.log("[obi-sdk] widget mounted")}function b4(){JC("https://fonts.cdnfonts.com/css/satoshi"),JC("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap")}function JC(n){const e=document.createElement("link");e.href=n,e.rel="stylesheet",document.head.appendChild(e)}const zC="49206C6F7665204F6269_session",XC="obi-url-params";class B4 extends Gc{constructor(e){super(),this.client=null,this.isActive=!1,this.primaryColour="#9500FF",this.passivePlanUuid=null,this.commandQueue=[],this._resumed=!1,this.dispatchCommand=(t,r)=>{var i,A,s,o,a;switch(t){case"update":this.updateConfig(r);break;case"startSession":if(!(r!=null&&r.planUuid)){console.warn("[obi] startSession command requires a planUuid",r);return}const c=(((i=this.client)==null?void 0:i.plans)||[]).find(u=>u.uuid===r.planUuid)||null;if(!c){console.warn("[obi] startSession command requires a valid planUuid",r);return}this.updateActive(!0),(s=(A=this.client)==null?void 0:A.selectPlan)==null||s.call(A,c);break;case"stopSession":(a=(o=this.client)==null?void 0:o.stopSession)==null||a.call(o);break;case"say":this.say(r);break;default:console.warn("[obi] unknown command",{commandType:t,args:r})}},e&&this.createClient(e),this.parsePassiveParams()}async createClient(e){if(this.client){this.client.appToken!==e&&console.warn("[obi] client already exists with different app token");return}let t=null;const r=this.load();if(r)try{t=fa.deserialise(r,e,"sdk",{apiBaseUrl:"https://app.coragents.ai",captureScreen:this.captureScreen.bind(this)}),this._resumed=!0}catch(i){console.error("[obi] error loading cached client",i)}t||(t=new fa(e,"sdk",{apiBaseUrl:"https://app.coragents.ai",captureScreen:this.captureScreen.bind(this)})),this.client=t,this.client.on("stateChanged",i=>{var A,s,o;i==="ready"&&this.updateConfig({isActive:(A=this.client)==null?void 0:A.showWidget,primaryColour:((o=(s=this.client)==null?void 0:s.product)==null?void 0:o.primary_color)||"#9500FF"})}),this.client.on("sessionStarted",()=>{this.save(),this.passivePlanUuid=null}),this.client.on("sessionStopped",()=>{localStorage.removeItem("obi-client"),this.passivePlanUuid=null}),this.client.on("sessionShutdown",i=>{i==="invalid-room"&&localStorage.removeItem("obi-client")}),this.client.on("trackEvent",(i,A)=>{Se().track(i,A)}),this.client.session&&this.client.resumeSession(i=>{i.on("stateChanged",A=>{A!=="disconnecting"&&A!=="disconnected"&&A!=="error"&&A!=="connecting"&&this.save()}),i.on("paused",()=>{this.save()}),i.on("unpaused",()=>{this.save()})})}async initialise(e={}){this.commandQueue=e.queuedCommands||[],this._resumed?(this._resumed=!1,this.dispatchCommandQueue()):this.client?this.client.initialise({planUuid:this.passivePlanUuid||void 0}).then(()=>{this.emit("initialised"),this.dispatchCommandQueue()}).catch(t=>{console.error("[obi] error initialising client",t),this.emit("error",t)}):this.dispatchCommandQueue()}async updateConfig(e){await this.updateAppToken(e.apiKey),this.updateActive(e.isActive),this.updatePrimaryColour(e.primaryColour),await this.updateIdentity(e.user),this.updateShowMenu(e.showMenu),this.emit("configUpdated")}async updateAppToken(e){var t;e===void 0||e==((t=this.client)==null?void 0:t.appToken)||(this.passivePlanUuid,await this.createClient(e),this.client&&await this.client.initialise({planUuid:this.passivePlanUuid||void 0}).then(()=>{this.emit("initialised")}).catch(r=>{console.error("[obi] error initialising client",r),this.emit("error",r)}))}updateActive(e){e===void 0||e==this.isActive||(this.isActive=e)}updatePrimaryColour(e){e===void 0||e==this.primaryColour||(this.primaryColour=e)}async updateIdentity(e){var r;if(e===void 0||e==((r=this.client)==null?void 0:r.identity))return;let t=e?{...e,extra:{...e,...(e==null?void 0:e.extra)||{}}}:void 0;await this.client.initialise({identity:t,planUuid:this.passivePlanUuid||void 0}).then(()=>{this.emit("initialised")}).catch(i=>{console.error("[obi] error initialising client",i),this.emit("error",i)}),e!=null&&e.email&&Se().identify((e==null?void 0:e.email)||"",t)}updateShowMenu(e){e!==void 0&&this.emit("showMenu",e)}async say(e){var t,r,i;await((i=(r=(t=this.client)==null?void 0:t.session)==null?void 0:r.say)==null?void 0:i.call(r,e))}async startSession(){await this.client.startSession(this.client.selectedPlan.uuid,e=>{e.on("stateChanged",t=>{t!=="disconnecting"&&t!=="disconnected"&&t!=="error"&&t!=="connecting"&&this.save()})})}dispatchCommandQueue(){const e=this.commandQueue;this.commandQueue=[],e.forEach(t=>{try{this.dispatchCommand(t[0],t[1]||[])}catch(r){console.error("[obi] error dispatching command",r)}})}parsePassiveParams(){if(this.passivePlanUuid){this.passivePlanUuid;return}let e={};e=JSON.parse(localStorage.getItem(XC)||"{}"),Object.keys(e).length===0&&new URLSearchParams(window.location.search).forEach((A,s)=>{e[s]=A});const t=e[zC];if(!t)return null;const r=new URL(window.location.href);r.searchParams.delete(zC),window.history.replaceState({},"",r.toString()),r.toString(),localStorage.removeItem(XC),this.passivePlanUuid=t}mountWidget(){w4(this)}async captureScreen(){return(await BT(document.documentElement,{useCORS:!0,allowTaint:!0,foreignObjectRendering:!0})).toDataURL("image/png")}save(){var e;localStorage.setItem("obi-client",((e=this.client)==null?void 0:e.serialise())||"")}load(){return localStorage.getItem("obi-client")}}async function YC(n){let e;try{e=window}catch{console.warn("[obi] no window object found"),e={}}return C4({appToken:n,window:e})}async function C4({appToken:n,window:e}){var i,A;if(e.obi){console.warn("[obi] obi object already found on window, skipping");return}n||(n=(i=e==null?void 0:e.obiWidgetConfig)==null?void 0:i.apiKey);let t;try{t=((A=e.ObiSDK)==null?void 0:A.q)||[]}catch{t=[]}const r=new B4(n);return e.ObiSDK=r.dispatchCommand,await r.initialise({queuedCommands:t}),e.obi=r,r.mountWidget(),r}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{YC()}):YC()})();