@signalwire/web-components 1.0.0-dev-20260428035205 → 1.0.0-dev-20260428141127

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signalwire-web-components-embed.iife.js","sources":["../../../../node_modules/@lit/reactive-element/css-tag.js","../../../../node_modules/@lit/reactive-element/reactive-element.js","../../../../node_modules/lit-html/lit-html.js","../../../../node_modules/lit-element/lit-element.js","../../../../node_modules/@lit/reactive-element/decorators/custom-element.js","../../../../node_modules/@lit/reactive-element/decorators/property.js","../../../../node_modules/@lit/reactive-element/decorators/state.js","../../src/components/example-button.ts","../../../../node_modules/@lit/context/lib/context-request-event.js","../../../../node_modules/@lit/context/lib/create-context.js","../../../../node_modules/@lit/context/lib/controllers/context-consumer.js","../../../../node_modules/@lit/context/lib/value-notifier.js","../../../../node_modules/@lit/context/lib/controllers/context-provider.js","../../../../node_modules/@lit/context/lib/decorators/provide.js","../../../../node_modules/@lit/context/lib/decorators/consume.js","../../src/context/call-context.ts","../../src/utils/debounce.ts","../../src/constants.ts","../../src/utils/video.ts","../../src/components/call-media.ts","../../src/types/index.ts","../../src/components/participants.ts","../../src/components/self-media.ts","../../src/components/audio-level.ts","../../src/components/device-selector.ts","../../../../node_modules/tslib/tslib.es6.mjs","../../../../node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../../../../node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../../../../node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../../../../node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../../../../node_modules/rxjs/dist/esm5/internal/Subscription.js","../../../../node_modules/rxjs/dist/esm5/internal/config.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../../../../node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../../../../node_modules/rxjs/dist/esm5/internal/util/noop.js","../../../../node_modules/rxjs/dist/esm5/internal/util/errorContext.js","../../../../node_modules/rxjs/dist/esm5/internal/Subscriber.js","../../../../node_modules/rxjs/dist/esm5/internal/symbol/observable.js","../../../../node_modules/rxjs/dist/esm5/internal/util/identity.js","../../../../node_modules/rxjs/dist/esm5/internal/util/pipe.js","../../../../node_modules/rxjs/dist/esm5/internal/Observable.js","../../../../node_modules/rxjs/dist/esm5/internal/util/lift.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/animationFrameProvider.js","../../../../node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","../../../../node_modules/rxjs/dist/esm5/internal/Subject.js","../../../../node_modules/rxjs/dist/esm5/internal/BehaviorSubject.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js","../../../../node_modules/rxjs/dist/esm5/internal/ReplaySubject.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/Action.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js","../../../../node_modules/rxjs/dist/esm5/internal/util/Immediate.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/immediateProvider.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/AsapAction.js","../../../../node_modules/rxjs/dist/esm5/internal/Scheduler.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/AsapScheduler.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/asap.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/async.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/AnimationFrameAction.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/AnimationFrameScheduler.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduler/animationFrame.js","../../../../node_modules/rxjs/dist/esm5/internal/observable/empty.js","../../../../node_modules/rxjs/dist/esm5/internal/util/isScheduler.js","../../../../node_modules/rxjs/dist/esm5/internal/util/args.js","../../../../node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js","../../../../node_modules/rxjs/dist/esm5/internal/util/isPromise.js","../../../../node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js","../../../../node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js","../../../../node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js","../../../../node_modules/rxjs/dist/esm5/internal/symbol/iterator.js","../../../../node_modules/rxjs/dist/esm5/internal/util/isIterable.js","../../../../node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js","../../../../node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js","../../../../node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/observeOn.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/subscribeOn.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduled/schedulePromise.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js","../../../../node_modules/rxjs/dist/esm5/internal/scheduled/scheduled.js","../../../../node_modules/rxjs/dist/esm5/internal/observable/from.js","../../../../node_modules/rxjs/dist/esm5/internal/observable/of.js","../../../../node_modules/rxjs/dist/esm5/internal/observable/throwError.js","../../../../node_modules/rxjs/dist/esm5/internal/util/EmptyError.js","../../../../node_modules/rxjs/dist/esm5/internal/lastValueFrom.js","../../../../node_modules/rxjs/dist/esm5/internal/firstValueFrom.js","../../../../node_modules/rxjs/dist/esm5/internal/util/isDate.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/timeout.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/map.js","../../../../node_modules/rxjs/dist/esm5/internal/util/mapOneOrManyArgs.js","../../../../node_modules/rxjs/dist/esm5/internal/util/argsArgArrayOrObject.js","../../../../node_modules/rxjs/dist/esm5/internal/util/createObject.js","../../../../node_modules/rxjs/dist/esm5/internal/observable/combineLatest.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/mergeAll.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/concatAll.js","../../../../node_modules/rxjs/dist/esm5/internal/observable/concat.js","../../../../node_modules/rxjs/dist/esm5/internal/observable/defer.js","../../../../node_modules/rxjs/dist/esm5/internal/observable/timer.js","../../../../node_modules/rxjs/dist/esm5/internal/observable/interval.js","../../../../node_modules/rxjs/dist/esm5/internal/observable/merge.js","../../../../node_modules/rxjs/dist/esm5/internal/observable/never.js","../../../../node_modules/rxjs/dist/esm5/internal/util/argsOrArgArray.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/filter.js","../../../../node_modules/rxjs/dist/esm5/internal/observable/race.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/audit.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/auditTime.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/catchError.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/scanInternals.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/reduce.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/toArray.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/debounceTime.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/take.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/distinctUntilChanged.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/exhaustMap.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/scan.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/share.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/shareReplay.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/skip.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/skipWhile.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/startWith.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/switchMap.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/tap.js","../../../../node_modules/rxjs/dist/esm5/internal/operators/withLatestFrom.js","../../src/components/call-controls.ts","../../src/components/call-status.ts","../../src/components/dialpad.ts","../../src/components/click-to-call.ts","../../src/components/directory.ts","../../src/components/participant-controls.ts","../../src/index.ts","../../../../node_modules/loglevel/lib/loglevel.js","../../../main/dist/operators-CX_lCCJm.mjs","../../../../node_modules/jwt-decode/build/esm/index.js","../../../../node_modules/uuid/dist/stringify.js","../../../../node_modules/uuid/dist/rng.js","../../../../node_modules/uuid/dist/native.js","../../../../node_modules/uuid/dist/v4.js","../../../main/dist/index.mjs"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as s}from\"./css-tag.js\";export{CSSResult,css,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{is:i,defineProperty:e,getOwnPropertyDescriptor:h,getOwnPropertyNames:r,getOwnPropertySymbols:o,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:\"\",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!i(t,s),b={attribute:!0,type:String,converter:u,reflect:!1,useDefault:!1,hasChanged:f};Symbol.metadata??=Symbol(\"metadata\"),a.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e(this.prototype,t,h)}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d(\"elementProperties\")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d(\"properties\"))){const t=this.properties,s=[...r(t),...o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(t(s))}else void 0!==s&&i.push(t(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),!0!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),!0===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];!0!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:\"open\"},y[d(\"elementProperties\")]=new Map,y[d(\"finalized\")]=new Map,p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push(\"2.1.1\");export{y as ReactiveElement,s as adoptStyles,u as defaultConverter,t as getCompatibleStyle,f as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,i=t.trustedTypes,s=i?i.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,e=\"$lit$\",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o=\"?\"+h,n=`<${o}>`,r=document,l=()=>r.createComment(\"\"),c=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,a=Array.isArray,u=t=>a(t)||\"function\"==typeof t?.[Symbol.iterator],d=\"[ \\t\\n\\f\\r]\",f=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\\\s\"'>=/]+)(${d}*=${d}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),p=/'/g,g=/\"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),w=y(3),T=Symbol.for(\"lit-noChange\"),E=Symbol.for(\"lit-nothing\"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?\"<svg>\":3===i?\"<math>\":\"\",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?\"!--\"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp(\"</\"+u[2],\"g\")),c=m):void 0!==u[3]&&(c=m):c===m?\">\"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'\"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith(\"/>\")?\" \":\"\";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x)}return[P(t,l+(t[s]||\"<?>\")+(2===i?\"</svg>\":3===i?\"</math>\":\"\")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:\".\"===e[1]?H:\"?\"===e[1]?I:\"@\"===e[1]?L:k}),r.removeAttribute(t)}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i?i.emptyScript:\"\";for(let i=0;i<s;i++)r.append(t[i],l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l())}}}else if(8===r.nodeType)if(r.data===o)d.push({type:2,index:c});else{let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1}c++}}static createElement(t,i){const s=r.createElement(\"template\");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r).importNode(i,!0);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n]}o!==l?.index&&(h=C.nextNode(),o++)}return C.currentNode=r,e}p(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||\"\"===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:s}=t,e=\"number\"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else{const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l()),this.O(l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??\"\")+h[n+1]),this._$AH[n]=r}o&&!e&&this.j(t)}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??\"\")}}class H extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===E?void 0:t}}class I extends k{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E)}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){\"function\"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}}const Z={M:e,P:h,A:o,C:1,L:V,R:M,D:u,V:S,I:R,H:k,N:I,U:L,B:H,F:z},j=t.litHtmlPolyfillSupport;j?.(N,R),(t.litHtmlVersions??=[]).push(\"3.3.1\");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l(),t),t,void 0,s??{})}return h._$AI(t),h};export{Z as _$LH,x as html,w as mathml,T as noChange,E as nothing,B as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{ReactiveElement as t}from\"@lit/reactive-element\";export*from\"@lit/reactive-element\";import{render as e,noChange as r}from\"lit-html\";export*from\"lit-html\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=globalThis;class i extends t{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=e(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return r}}i._$litElement$=!0,i[\"finalized\"]=!0,s.litElementHydrateSupport?.({LitElement:i});const o=s.litElementPolyfillSupport;o?.({LitElement:i});const n={_$AK:(t,e,r)=>{t._$AK(e,r)},_$AL:t=>t._$AL};(s.litElementVersions??=[]).push(\"4.2.1\");export{i as LitElement,n as _$LE};\n//# sourceMappingURL=lit-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=t=>(e,o)=>{void 0!==o?o.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};export{t as customElement};\n//# sourceMappingURL=custom-element.js.map\n","import{defaultConverter as t,notEqual as e}from\"../reactive-element.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o={attribute:!0,type:String,converter:t,reflect:!1,hasChanged:e},r=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),\"setter\"===n&&((t=Object.create(t)).wrapped=!0),s.set(r.name,t),\"accessor\"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if(\"setter\"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t)}}throw Error(\"Unsupported decorator location: \"+n)};function n(t){return(e,o)=>\"object\"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}export{n as property,r as standardProperty};\n//# sourceMappingURL=property.js.map\n","import{property as t}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function r(r){return t({...r,state:!0,attribute:!1})}export{r as state};\n//# sourceMappingURL=state.js.map\n","import { LitElement, html, css } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\n/**\n * An example button component built with Lit\n *\n * @fires sw-click - Fired when the button is clicked (and not disabled). Detail: `{ originalEvent: MouseEvent }`\n * @slot - Default slot for button content\n * @csspart button - The button element\n */\n@customElement('sw-example-button')\nexport class ExampleButton extends LitElement {\n static styles = css`\n :host {\n display: inline-block;\n }\n\n button {\n padding: 0.5rem 1rem;\n font-size: 1rem;\n border: none;\n border-radius: 4px;\n background-color: #0066cc;\n color: white;\n cursor: pointer;\n transition: background-color 0.2s;\n }\n\n button:hover {\n background-color: #0052a3;\n }\n\n button:active {\n background-color: #003d7a;\n }\n\n button:disabled {\n background-color: #cccccc;\n cursor: not-allowed;\n }\n `;\n\n @property({ type: Boolean })\n disabled = false;\n\n @property({ type: String })\n variant: 'primary' | 'secondary' = 'primary';\n\n private _handleClick(e: MouseEvent) {\n if (this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n this.dispatchEvent(\n new CustomEvent('sw-click', {\n detail: { originalEvent: e },\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html`\n <button part=\"button\" ?disabled=${this.disabled} @click=${this._handleClick}>\n <slot></slot>\n </button>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sw-example-button': ExampleButton;\n }\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nclass s extends Event{constructor(s,t,e,o){super(\"context-request\",{bubbles:!0,composed:!0}),this.context=s,this.contextTarget=t,this.callback=e,this.subscribe=o??!1}}export{s as ContextRequestEvent};\n//# sourceMappingURL=context-request-event.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nfunction n(n){return n}export{n as createContext};\n//# sourceMappingURL=create-context.js.map\n","import{ContextRequestEvent as t}from\"../context-request-event.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class s{constructor(t,s,i,h){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(t,s)=>{this.unsubscribe&&(this.unsubscribe!==s&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(t,s)),this.unsubscribe=s},this.host=t,void 0!==s.context){const t=s;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??!1}else this.context=s,this.callback=i,this.subscribe=h??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new t(this.context,this.host,this.t,this.subscribe))}}export{s as ContextConsumer};\n//# sourceMappingURL=context-consumer.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nclass s{get value(){return this.o}set value(s){this.setValue(s)}setValue(s,t=!1){const i=t||!Object.is(s,this.o);this.o=s,i&&this.updateObservers()}constructor(s){this.subscriptions=new Map,this.updateObservers=()=>{for(const[s,{disposer:t}]of this.subscriptions)s(this.o,t)},void 0!==s&&(this.value=s)}addCallback(s,t,i){if(!i)return void s(this.value);this.subscriptions.has(s)||this.subscriptions.set(s,{disposer:()=>{this.subscriptions.delete(s)},consumerHost:t});const{disposer:h}=this.subscriptions.get(s);s(this.value,h)}clearCallbacks(){this.subscriptions.clear()}}export{s as ValueNotifier};\n//# sourceMappingURL=value-notifier.js.map\n","import{ContextRequestEvent as t}from\"../context-request-event.js\";import{ValueNotifier as s}from\"../value-notifier.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends Event{constructor(t,s){super(\"context-provider\",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=s}}class i extends s{constructor(s,e,i){super(void 0!==e.context?e.initialValue:i),this.onContextRequest=t=>{if(t.context!==this.context)return;const s=t.contextTarget??t.composedPath()[0];s!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,s,t.subscribe))},this.onProviderRequest=s=>{if(s.context!==this.context)return;if((s.contextTarget??s.composedPath()[0])===this.host)return;const e=new Set;for(const[s,{consumerHost:i}]of this.subscriptions)e.has(s)||(e.add(s),i.dispatchEvent(new t(this.context,i,s,!0)));s.stopPropagation()},this.host=s,void 0!==e.context?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(\"context-request\",this.onContextRequest),this.host.addEventListener(\"context-provider\",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new e(this.context,this.host))}}export{i as ContextProvider,e as ContextProviderEvent};\n//# sourceMappingURL=context-provider.js.map\n","import{ContextProvider as t}from\"../controllers/context-provider.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function e({context:e}){return(n,i)=>{const r=new WeakMap;if(\"object\"==typeof i)return{get(){return n.get.call(this)},set(t){return r.get(this).setValue(t),n.set.call(this,t)},init(n){return r.set(this,new t(this,{context:e,initialValue:n})),n}};{n.constructor.addInitializer((n=>{r.set(n,new t(n,{context:e}))}));const o=Object.getOwnPropertyDescriptor(n,i);let s;if(void 0===o){const t=new WeakMap;s={get(){return t.get(this)},set(e){r.get(this).setValue(e),t.set(this,e)},configurable:!0,enumerable:!0}}else{const t=o.set;s={...o,set(e){r.get(this).setValue(e),t?.call(this,e)}}}return void Object.defineProperty(n,i,s)}}}export{e as provide};\n//# sourceMappingURL=provide.js.map\n","import{ContextConsumer as t}from\"../controllers/context-consumer.js\";\n/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function c({context:c,subscribe:e}){return(o,n)=>{\"object\"==typeof n?n.addInitializer((function(){new t(this,{context:c,callback:t=>{o.set.call(this,t)},subscribe:e})})):o.constructor.addInitializer((o=>{new t(o,{context:c,callback:t=>{o[n]=t},subscribe:e})}))}}export{c as consume};\n//# sourceMappingURL=consume.js.map\n","/**\n * Context for sharing Call object between call-media components.\n * Provides call instance from parent <call-media> to child components.\n */\n\nimport { createContext } from '@lit/context';\nimport type { Call } from '../types/index.js';\n\n/**\n * Context key for Call object sharing.\n * Used by call-media (provider) and participants/self-media (consumers).\n */\nexport const callContext = createContext<Call | undefined>('call');\n","/**\n * Creates a debounced function that delays invoking the provided function\n * until after the specified wait time has elapsed since the last invocation.\n *\n * @param func - The function to debounce\n * @param wait - The number of milliseconds to delay\n * @returns A debounced version of the function\n */\nexport function debounce<T extends (...args: any[]) => any>(\n func: T,\n wait: number\n): (...args: Parameters<T>) => void {\n let timeout: ReturnType<typeof setTimeout> | null = null;\n\n return function executedFunction(...args: Parameters<T>) {\n const later = () => {\n timeout = null;\n func(...args);\n };\n\n if (timeout !== null) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(later, wait);\n };\n}\n","/**\n * Constants for the web-components package\n */\n\n/**\n * Timeout in milliseconds for waiting for a video element to become ready.\n * Audio-only streams attached to video elements may never fire `resize` or `canplay`,\n * so this timeout ensures the component doesn't block indefinitely.\n */\nexport const VIDEO_READY_TIMEOUT_MS = 2000;\n","/**\n * Video element utilities for creating and managing video elements\n * with proper configuration for WebRTC streams.\n */\n\nimport { VIDEO_READY_TIMEOUT_MS } from '../constants.js';\n\n/**\n * Creates a video element configured for WebRTC streams.\n * The video is muted, autoplays, and plays inline (mobile Safari support).\n * Prevents pause events which can occur on camera switches or PiP mode.\n *\n * @returns A configured HTMLVideoElement\n */\nexport function createVideoElement(): HTMLVideoElement {\n const video = document.createElement('video');\n video.muted = true;\n video.autoplay = true;\n video.playsInline = true;\n\n // Prevent pause (Safari/Firefox pause on PiP, camera switch)\n video.addEventListener('pause', () => {\n video.play().catch((error) => {\n console.error('Video Element Paused', error);\n });\n });\n\n return video;\n}\n\n/**\n * Waits for a video element to be ready for playback.\n * Resolves when the video has metadata or when it can play.\n *\n * @param element - The video element to wait for\n * @returns A promise that resolves when the video is ready\n */\nexport function waitForVideoReady(element: HTMLVideoElement): Promise<void> {\n return new Promise<void>((resolve) => {\n if (element.readyState >= HTMLMediaElement.HAVE_METADATA) {\n resolve();\n return;\n }\n\n let resolved = false;\n\n const done = () => {\n if (resolved) return;\n resolved = true;\n clearTimeout(timeoutId);\n element.removeEventListener('canplay', done);\n element.removeEventListener('resize', done);\n resolve();\n };\n\n // Timeout fallback for audio-only streams where resize/canplay may never fire\n const timeoutId = setTimeout(done, VIDEO_READY_TIMEOUT_MS);\n element.addEventListener('canplay', done);\n element.addEventListener('resize', done);\n });\n}\n\n/**\n * Attaches a MediaStream to a video element.\n *\n * @param element - The video element to attach the stream to\n * @param stream - The MediaStream to attach, or null to detach\n */\nexport function attachMediaStream(element: HTMLVideoElement, stream: MediaStream | null): void {\n element.srcObject = stream;\n}\n\n/**\n * Detaches any MediaStream from a video element.\n *\n * @param element - The video element to detach the stream from\n */\nexport function detachMediaStream(element: HTMLVideoElement): void {\n if (element.srcObject) {\n element.srcObject = null;\n }\n}\n","/**\n * Call Media Component\n *\n * Root component that renders remote video stream and provides call context\n * to child components. Manages aspect ratio with ResizeObserver and handles\n * video stream lifecycle.\n *\n * @example\n * ```html\n * <call-media .call=${call}>\n * <participants>\n * <self-media mirror=${true}></self-media>\n * </participants>\n * </call-media>\n * ```\n *\n * @cssprop [--sw-color-primary=#044cf6] - Primary accent color used for theming.\n * @cssprop [--sw-color-background=#000000] - Background color of the video container.\n * @cssprop [--sw-border-radius=0px] - Border radius applied to the video container and wrapper.\n */\n\nimport { LitElement, html, css } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { provide } from '@lit/context';\nimport { Subscription } from 'rxjs';\nimport type { Call } from '../types/index.js';\nimport { callContext } from '../context/call-context.js';\nimport { debounce } from '../utils/debounce.js';\nimport { waitForVideoReady, attachMediaStream, detachMediaStream } from '../utils/video.js';\n\n@customElement('sw-call-media')\nexport class CallMedia extends LitElement {\n static styles = css`\n :host {\n /* CSS Custom Properties for theming */\n --sw-color-primary: #044cf6;\n --sw-color-background: #000000;\n --sw-border-radius: 0px;\n\n display: block;\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n\n .mcu-content {\n position: relative;\n width: 100%;\n height: 100%;\n margin: 0 auto;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--sw-color-background);\n border-radius: var(--sw-border-radius);\n overflow: hidden;\n }\n\n .padding-wrapper {\n position: relative;\n max-width: 100%;\n max-height: 100%;\n transition:\n width 0.3s ease,\n height 0.3s ease;\n }\n\n .mcu-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: var(--sw-border-radius);\n overflow: hidden;\n }\n\n .mcu-video {\n width: 100%;\n height: 100%;\n display: block;\n object-fit: contain;\n }\n\n .mcu-layers {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n `;\n\n /**\n * Call object with observable streams and properties\n */\n @property({ type: Object }) call?: Call;\n\n /**\n * Provides call context to child components\n * Note: Used by @provide decorator, TypeScript doesn't see the usage\n */\n @provide({ context: callContext })\n // @ts-expect-error - Used by @provide decorator\n private _providedCall?: Call;\n\n /**\n * Current remote stream value from observable\n */\n private _remoteStreamValue: MediaStream | null = null;\n\n /**\n * RxJS subscriptions for cleanup\n */\n private subscriptions: Subscription[] = [];\n\n /**\n * ResizeObserver instance for aspect ratio management\n */\n private resizeObserver?: ResizeObserver;\n\n /**\n * Video resize event handler reference for cleanup\n */\n private videoResizeHandler?: () => void;\n\n /**\n * Window resize event handler reference for cleanup\n */\n private windowResizeHandler?: () => void;\n\n /**\n * Lifecycle: Component connected to DOM\n */\n connectedCallback() {\n super.connectedCallback();\n this._providedCall = this.call;\n this.setupSubscriptions();\n }\n\n /**\n * Lifecycle: React to property changes\n */\n protected updated(changedProperties: Map<string, unknown>): void {\n super.updated(changedProperties);\n if (changedProperties.has('call')) {\n // Clean up old subscriptions first\n this.cleanupSubscriptions();\n // Update context for child components\n this._providedCall = this.call;\n // Set up new subscriptions\n this.setupSubscriptions();\n }\n }\n\n /**\n * Lifecycle: Component disconnected from DOM\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.cleanupSubscriptions();\n this.cleanupResizeObserver();\n this.cleanupVideoElement();\n }\n\n /**\n * Lifecycle: First update after render\n */\n protected firstUpdated(): void {\n const video = this.shadowRoot?.querySelector('video.mcu-video') as HTMLVideoElement;\n if (video) {\n waitForVideoReady(video).then(() => {\n if (this.isConnected) {\n this.setupResizeObserver();\n }\n });\n }\n }\n\n /**\n * Subscribe to call observables\n */\n private setupSubscriptions(): void {\n if (!this.call) return;\n\n // Subscribe to remote stream\n this.subscriptions.push(\n this.call.remoteStream$.subscribe((stream: MediaStream | null) => {\n this._remoteStreamValue = stream;\n this.requestUpdate();\n\n // Attach stream to video element\n const video = this.shadowRoot?.querySelector('video.mcu-video') as HTMLVideoElement;\n if (video) {\n attachMediaStream(video, stream);\n }\n })\n );\n }\n\n /**\n * Cleanup all subscriptions\n */\n private cleanupSubscriptions(): void {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions = [];\n }\n\n /**\n * Setup ResizeObserver for aspect ratio management\n */\n private setupResizeObserver(): void {\n const video = this.shadowRoot?.querySelector('video.mcu-video') as HTMLVideoElement;\n const paddingWrapper = this.shadowRoot?.querySelector('.padding-wrapper') as HTMLDivElement;\n\n if (!video || !paddingWrapper) return;\n\n // Store references for the update function\n this._videoElement = video;\n this._paddingWrapper = paddingWrapper;\n\n // Observe the host element for container size changes\n this.resizeObserver = new ResizeObserver(\n debounce(() => {\n this.recalculateDimensions();\n }, 50)\n );\n\n this.resizeObserver.observe(this);\n\n // Listen for video intrinsic dimension changes (when media orientation flips)\n this.videoResizeHandler = () => {\n this.recalculateDimensions();\n };\n\n video.addEventListener('resize', this.videoResizeHandler);\n\n // Listen for window/viewport resize changes\n // Use requestAnimationFrame to ensure layout has settled before reading dimensions\n this.windowResizeHandler = () => {\n requestAnimationFrame(() => {\n this.recalculateDimensions();\n });\n };\n\n window.addEventListener('resize', this.windowResizeHandler);\n\n // Initial calculation\n this.recalculateDimensions();\n }\n\n /**\n * Video element reference for dimension calculations\n */\n private _videoElement?: HTMLVideoElement;\n\n /**\n * Padding wrapper reference for dimension calculations\n */\n private _paddingWrapper?: HTMLDivElement;\n\n /**\n * Recalculate and apply dimensions based on viewport, container, and video sizes.\n * Video should never grow bigger than the visible area.\n * When container bleeds viewport, scale proportionally to maintain container's aspect ratio.\n * Uses \"contain\" fitting algorithm - compares aspect ratios to determine constraint.\n */\n private recalculateDimensions(): void {\n const video = this._videoElement;\n const paddingWrapper = this._paddingWrapper;\n\n if (!video || !paddingWrapper) return;\n\n // Audio-only streams have no video dimensions.\n // Fill the container and reset transform so the layout layers remain usable.\n if (!video.videoWidth || !video.videoHeight) {\n paddingWrapper.style.width = '100%';\n paddingWrapper.style.height = '100%';\n paddingWrapper.style.paddingBottom = '0';\n paddingWrapper.style.transform = 'none';\n return;\n }\n\n // Get viewport dimensions\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n // Get container's bounding rect (actual rendered position and size)\n const containerRect = this.getBoundingClientRect();\n const containerWidth = containerRect.width;\n const containerHeight = containerRect.height;\n\n if (containerWidth <= 0 || containerHeight <= 0) return;\n\n // Calculate scale factors for each dimension\n // This tells us how much the container would need to shrink to fit in viewport\n const scaleX = Math.min(1, (viewportWidth - containerRect.left) / containerWidth);\n const scaleY = Math.min(1, (viewportHeight - containerRect.top) / containerHeight);\n\n // Use the minimum scale to maintain proportionality\n // This ensures the container's aspect ratio is preserved when scaling down\n const scale = Math.min(scaleX, scaleY);\n\n // Calculate available space by applying scale to container dimensions\n const maxWidth = containerWidth * scale;\n const maxHeight = containerHeight * scale;\n\n if (maxWidth <= 0 || maxHeight <= 0) return;\n\n const videoWidth = video.videoWidth;\n const videoHeight = video.videoHeight;\n\n // Calculate aspect ratios\n const videoAspectRatio = videoWidth / videoHeight;\n const availableAspectRatio = maxWidth / maxHeight;\n\n let finalWidth: number;\n let finalHeight: number;\n\n // \"Contain\" algorithm: compare aspect ratios to determine which dimension constrains\n if (videoAspectRatio > availableAspectRatio) {\n // Video is wider than available space - constrain by width\n finalWidth = maxWidth;\n finalHeight = finalWidth / videoAspectRatio;\n } else {\n // Video is taller than available space - constrain by height\n finalHeight = maxHeight;\n finalWidth = finalHeight * videoAspectRatio;\n }\n\n // Calculate offset to center video in the visible area of the container\n // When container bleeds viewport, the visible center is different from container center\n const visibleLeft = Math.max(0, containerRect.left);\n const visibleTop = Math.max(0, containerRect.top);\n const visibleRight = Math.min(viewportWidth, containerRect.right);\n const visibleBottom = Math.min(viewportHeight, containerRect.bottom);\n\n // Center of the visible area (in viewport coordinates)\n const visibleCenterX = (visibleLeft + visibleRight) / 2;\n const visibleCenterY = (visibleTop + visibleBottom) / 2;\n\n // Center of the container (in viewport coordinates)\n const containerCenterX = containerRect.left + containerWidth / 2;\n const containerCenterY = containerRect.top + containerHeight / 2;\n\n // Offset needed to shift from container center to visible center\n const offsetX = visibleCenterX - containerCenterX;\n const offsetY = visibleCenterY - containerCenterY;\n\n // Apply the calculated dimensions and offset\n paddingWrapper.style.width = `${finalWidth}px`;\n paddingWrapper.style.height = `${finalHeight}px`;\n paddingWrapper.style.paddingBottom = '0';\n paddingWrapper.style.transform = `translate(${offsetX}px, ${offsetY}px)`;\n }\n\n /**\n * Cleanup ResizeObserver and event listeners\n */\n private cleanupResizeObserver(): void {\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = undefined;\n }\n\n const video = this.shadowRoot?.querySelector('video.mcu-video') as HTMLVideoElement;\n if (video && this.videoResizeHandler) {\n video.removeEventListener('resize', this.videoResizeHandler);\n this.videoResizeHandler = undefined;\n }\n\n if (this.windowResizeHandler) {\n window.removeEventListener('resize', this.windowResizeHandler);\n this.windowResizeHandler = undefined;\n }\n }\n\n /**\n * Cleanup video element\n */\n private cleanupVideoElement(): void {\n const video = this.shadowRoot?.querySelector('video.mcu-video') as HTMLVideoElement;\n if (video) {\n detachMediaStream(video);\n }\n }\n\n /**\n * Render the component\n */\n render() {\n return html`\n <div class=\"mcu-content\" part=\"container\">\n <div class=\"padding-wrapper\">\n <div class=\"mcu-wrapper\">\n <video\n class=\"mcu-video\"\n part=\"video\"\n autoplay\n playsinline\n muted\n .srcObject=${this._remoteStreamValue}\n ></video>\n </div>\n <div class=\"mcu-layers\">\n <slot></slot>\n </div>\n </div>\n </div>\n `;\n }\n}\n\n/**\n * Declare global type for TypeScript\n */\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sw-call-media': CallMedia;\n }\n}\n","/**\n * Type definitions for call-media components.\n *\n * Types are imported directly from the SDK to stay in sync.\n */\n\nimport type { Call, CallParticipant, CallSelfParticipant, DeviceController, LayoutLayer } from '@signalwire/js';\n\n// Re-export SDK types for internal use\nexport type { Call, CallParticipant, CallSelfParticipant, DeviceController, LayoutLayer };\n\n// Use SDK's CallParticipant as the canonical Participant type\nexport type Participant = CallParticipant;\n\n/**\n * Helper to safely get self ID from a Call.\n * Call.self is typed as CallSelfParticipant | null.\n */\nexport function getSelfId(call: Call | undefined): string | undefined {\n return call?.self?.id;\n}\n\n/**\n * Type-safe cast for participants array.\n * The SDK's Call.participants is typed as CallParticipant[], so this\n * provides a semantic helper for web-components that receive unknown[].\n */\nexport function castParticipants(participants: unknown[]): Participant[] {\n return participants as Participant[];\n}\n","/**\n * Participants Component\n *\n * Renders member overlays based on layoutLayers from the call context.\n * Excludes self member and provides slot for <self-media> child component.\n *\n * @example\n * ```html\n * <participants>\n * <self-media mirror=${true}></self-media>\n * </participants>\n * ```\n *\n * @fires sw-participant-mute-audio - Fired to toggle a participant's audio. Detail: `{ participantId: string, muted: boolean }`\n * @fires sw-participant-mute-video - Fired to toggle a participant's video. Detail: `{ participantId: string, muted: boolean }`\n * @fires sw-participant-remove - Fired to remove a participant. Detail: `{ participantId: string }`\n */\n\nimport { LitElement, html, css } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\nimport { Subscription } from 'rxjs';\nimport type { Call, LayoutLayer, Participant } from '../types/index.js';\nimport { getSelfId, castParticipants } from '../types/index.js';\nimport { callContext } from '../context/call-context.js';\n\n@customElement('sw-participants')\nexport class Participants extends LitElement {\n static styles = css`\n :host {\n display: contents; /* Doesn't create a box, children inherit positioning */\n }\n\n .member-overlay {\n box-sizing: border-box;\n /* Thick inset box-shadow with semi-transparent background for debugging */\n box-shadow: inset 0 0 0 8px rgba(255, 0, 0, 0.8);\n background-color: rgba(255, 0, 0, 0.1);\n }\n\n .member-overlay.is-self {\n /* Self overlay uses blue border to distinguish from other participants */\n box-shadow: inset 0 0 0 8px rgba(0, 0, 255, 0.8);\n background-color: rgba(0, 0, 255, 0.1);\n }\n\n /* Circular menu trigger button */\n .menu-trigger {\n position: absolute;\n top: 12px;\n left: 12px;\n width: 36px;\n height: 36px;\n border-radius: 50%;\n background: rgba(0, 0, 0, 0.6);\n border: 2px solid rgba(255, 255, 255, 0.3);\n color: white;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition:\n background 0.2s ease,\n transform 0.2s ease,\n border-color 0.2s ease;\n z-index: 20;\n }\n\n .menu-trigger:hover {\n background: rgba(0, 0, 0, 0.8);\n border-color: rgba(255, 255, 255, 0.6);\n transform: scale(1.1);\n }\n\n .menu-trigger:focus {\n outline: none;\n border-color: #044cf6;\n box-shadow: 0 0 0 3px rgba(4, 78, 246, 0.4);\n }\n\n .menu-trigger svg {\n width: 20px;\n height: 20px;\n }\n\n /* Dropdown menu */\n .menu-dropdown {\n position: absolute;\n top: 12px;\n left: 56px;\n background: rgba(31, 41, 55, 0.95);\n backdrop-filter: blur(8px);\n border-radius: 8px;\n padding: 8px 0;\n min-width: 160px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);\n z-index: 30;\n opacity: 0;\n visibility: hidden;\n transform: translateX(-10px);\n transition:\n opacity 0.2s ease,\n transform 0.2s ease,\n visibility 0.2s ease;\n }\n\n .menu-dropdown.open {\n opacity: 1;\n visibility: visible;\n transform: translateX(0);\n }\n\n .menu-item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 16px;\n color: white;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n cursor: pointer;\n transition: background 0.15s ease;\n border: none;\n background: none;\n width: 100%;\n text-align: left;\n }\n\n .menu-item:hover {\n background: rgba(255, 255, 255, 0.1);\n }\n\n .menu-item svg {\n width: 16px;\n height: 16px;\n flex-shrink: 0;\n }\n\n .menu-item.danger {\n color: #ef4444;\n }\n\n .menu-item.danger:hover {\n background: rgba(239, 68, 68, 0.2);\n }\n `;\n\n /**\n * Consumes call context from parent call-media component\n */\n @consume({ context: callContext, subscribe: true })\n @property({ attribute: false })\n private _call?: Call;\n\n /**\n * Public call property for direct assignment (when not nested in sw-call-media)\n */\n @property({ attribute: false })\n set call(value: Call | undefined) {\n this._call = value;\n this.cleanupSubscriptions();\n this.setupSubscriptions();\n }\n get call(): Call | undefined {\n return this._call;\n }\n\n /**\n * Current layout layers value from observable\n */\n private _layoutLayersValue: LayoutLayer[] = [];\n\n /**\n * Current participants from observable\n */\n private _participantsValue: Participant[] = [];\n\n /**\n * ID of participant with open menu\n */\n @state()\n private _openMenuId: string | null = null;\n\n /**\n * RxJS subscriptions for cleanup\n */\n private subscriptions: Subscription[] = [];\n\n /**\n * Lifecycle: Component connected to DOM\n */\n connectedCallback() {\n super.connectedCallback();\n this.setupSubscriptions();\n }\n\n /**\n * Lifecycle: React to property/context changes\n */\n protected updated(changedProperties: Map<string, unknown>): void {\n super.updated(changedProperties);\n if (changedProperties.has('_call') && this._call) {\n // Clean up old subscriptions first\n this.cleanupSubscriptions();\n // Set up new subscriptions\n this.setupSubscriptions();\n }\n }\n\n /**\n * Lifecycle: Component disconnected from DOM\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.cleanupSubscriptions();\n }\n\n /**\n * Subscribe to call observables\n */\n private setupSubscriptions(): void {\n // Continue observing even if _call is undefined initially\n // This allows component to react when call becomes available\n if (!this._call) return;\n\n this.subscriptions.push(\n this._call.layoutLayers$.subscribe((layers: LayoutLayer[]) => {\n this._layoutLayersValue = layers;\n this.requestUpdate();\n })\n );\n\n // Subscribe to participants for menu actions\n if (this._call.participants$) {\n this.subscriptions.push(\n this._call.participants$.subscribe((participants: unknown[]) => {\n this._participantsValue = castParticipants(participants);\n this.requestUpdate();\n })\n );\n }\n\n // Close menu on outside click\n this._handleOutsideClick = this._handleOutsideClick.bind(this);\n document.addEventListener('click', this._handleOutsideClick);\n }\n\n /**\n * Handle click outside menu to close it\n */\n private _handleOutsideClick(e: Event): void {\n const target = e.target as Element;\n if (!target.closest('.menu-trigger') && !target.closest('.menu-dropdown')) {\n this._openMenuId = null;\n }\n }\n\n /**\n * Toggle menu for a participant\n */\n private _toggleMenu(memberId: string, e: Event): void {\n e.stopPropagation();\n this._openMenuId = this._openMenuId === memberId ? null : memberId;\n }\n\n /**\n * Get participant by member ID\n */\n private _getParticipant(memberId: string): Participant | undefined {\n return this._participantsValue.find((p) => p.id === memberId);\n }\n\n /**\n * Handle mute audio action\n */\n private async _handleMuteAudio(memberId: string, e: Event): Promise<void> {\n e.stopPropagation();\n const participant = this._getParticipant(memberId);\n if (!participant) return;\n\n try {\n if (participant.audioMuted && participant.unmute) {\n await participant.unmute();\n } else if (!participant.audioMuted && participant.mute) {\n await participant.mute();\n }\n this.dispatchEvent(\n new CustomEvent('sw-participant-mute-audio', {\n detail: { participant, memberId },\n bubbles: true,\n composed: true\n })\n );\n } catch {\n // Silently handle error\n }\n this._openMenuId = null;\n }\n\n /**\n * Handle mute video action\n */\n private async _handleMuteVideo(memberId: string, e: Event): Promise<void> {\n e.stopPropagation();\n const participant = this._getParticipant(memberId);\n if (!participant) return;\n\n try {\n if (participant.videoMuted && participant.unmuteVideo) {\n await participant.unmuteVideo();\n } else if (!participant.videoMuted && participant.muteVideo) {\n await participant.muteVideo();\n }\n this.dispatchEvent(\n new CustomEvent('sw-participant-mute-video', {\n detail: { participant, memberId },\n bubbles: true,\n composed: true\n })\n );\n } catch {\n // Silently handle error\n }\n this._openMenuId = null;\n }\n\n /**\n * Handle remove participant action\n */\n private async _handleRemove(memberId: string, e: Event): Promise<void> {\n e.stopPropagation();\n const participant = this._getParticipant(memberId);\n if (!participant?.remove) return;\n\n try {\n await participant.remove();\n this.dispatchEvent(\n new CustomEvent('sw-participant-remove', {\n detail: { participant, memberId },\n bubbles: true,\n composed: true\n })\n );\n } catch {\n // Silently handle error\n }\n this._openMenuId = null;\n }\n\n /**\n * Cleanup all subscriptions\n */\n private cleanupSubscriptions(): void {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions = [];\n document.removeEventListener('click', this._handleOutsideClick);\n }\n\n /**\n * Render member overlays for all participants\n */\n private renderMemberOverlays() {\n if (!this._layoutLayersValue || this._layoutLayersValue.length === 0) {\n return null;\n }\n\n // Get selfId dynamically from call.self to handle cases where self is available after subscription setup\n const selfId = getSelfId(this._call);\n\n return this._layoutLayersValue\n .filter((layer) => layer.member_id)\n .map((layer) => this.renderOverlay(layer, layer.member_id === selfId));\n }\n\n /**\n * Render menu button SVG icon (three dots)\n */\n private renderMenuIcon() {\n return html`\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <circle cx=\"12\" cy=\"6\" r=\"2\" />\n <circle cx=\"12\" cy=\"12\" r=\"2\" />\n <circle cx=\"12\" cy=\"18\" r=\"2\" />\n </svg>\n `;\n }\n\n /**\n * Render menu dropdown for a participant\n */\n private renderMenuDropdown(memberId: string) {\n const participant = this._getParticipant(memberId);\n const isOpen = this._openMenuId === memberId;\n\n return html`\n <div class=\"menu-dropdown ${isOpen ? 'open' : ''}\">\n <button\n class=\"menu-item\"\n @click=${(e: Event) => this._handleMuteAudio(memberId, e)}\n aria-label=\"${participant?.audioMuted ? 'Unmute audio' : 'Mute audio'}\"\n >\n ${participant?.audioMuted\n ? html`<svg viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z\"\n />\n </svg>`\n : html`<svg viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z\"\n />\n </svg>`}\n ${participant?.audioMuted ? 'Unmute' : 'Mute'}\n </button>\n <button\n class=\"menu-item\"\n @click=${(e: Event) => this._handleMuteVideo(memberId, e)}\n aria-label=\"${participant?.videoMuted ? 'Enable video' : 'Disable video'}\"\n >\n ${participant?.videoMuted\n ? html`<svg viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M21 6.5l-4 4V7c0-.55-.45-1-1-1H9.82L21 17.18V6.5zM3.27 2L2 3.27 4.73 6H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.21 0 .39-.08.54-.18L19.73 21 21 19.73 3.27 2z\"\n />\n </svg>`\n : html`<svg viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z\"\n />\n </svg>`}\n ${participant?.videoMuted ? 'Enable video' : 'Disable video'}\n </button>\n <button\n class=\"menu-item danger\"\n @click=${(e: Event) => this._handleRemove(memberId, e)}\n aria-label=\"Remove participant\"\n >\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n />\n </svg>\n Remove\n </button>\n </div>\n `;\n }\n\n /**\n * Render individual member overlay\n */\n private renderOverlay(layer: LayoutLayer, isSelf: boolean = false) {\n const style = `\n position: absolute;\n top: ${layer.y}%;\n left: ${layer.x}%;\n width: ${layer.width}%;\n height: ${layer.height}%;\n opacity: ${layer.visible ? 1 : 0};\n overflow: visible;\n transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease, opacity 0.3s ease;\n pointer-events: auto;\n z-index: 10;\n `;\n\n // member_id is guaranteed to exist by the filter in renderMemberOverlays\n const memberId = layer.member_id!;\n const classes = `member-overlay member-overlay-${memberId}${isSelf ? ' is-self' : ''}`;\n\n return html`\n <div class=\"${classes}\" part=\"overlay\" style=\"${style}\">\n ${!isSelf\n ? html`\n <button\n class=\"menu-trigger\"\n part=\"menu-trigger\"\n @click=${(e: Event) => this._toggleMenu(memberId, e)}\n aria-label=\"Participant menu\"\n aria-expanded=\"${this._openMenuId === memberId}\"\n aria-haspopup=\"menu\"\n >\n ${this.renderMenuIcon()}\n </button>\n ${this.renderMenuDropdown(memberId)}\n `\n : null}\n <span class=\"member-name\" part=\"name\"></span>\n <span class=\"member-indicators\" part=\"indicators\"></span>\n <slot name=\"controls-${memberId}\"></slot>\n </div>\n `;\n }\n\n /**\n * Render the component\n */\n render() {\n return html`\n ${this.renderMemberOverlays()}\n <slot></slot>\n `;\n }\n}\n\n/**\n * Declare global type for TypeScript\n */\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sw-participants': Participants;\n }\n}\n","/**\n * Self Media Component\n *\n * Renders local video overlay with positioning from layoutLayers.\n * Supports optional mirror transform for the video element.\n *\n * @example\n * ```html\n * <self-media mirror=${true}></self-media>\n * ```\n */\n\nimport { LitElement, html, css } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\nimport { Subscription } from 'rxjs';\nimport type { Call, LayoutLayer } from '../types/index.js';\nimport { getSelfId } from '../types/index.js';\nimport { callContext } from '../context/call-context.js';\n\n@customElement('sw-self-media')\nexport class SelfMedia extends LitElement {\n static styles = css`\n :host {\n display: contents; /* Doesn't create a box, children inherit positioning */\n }\n\n .local-overlay {\n box-sizing: border-box;\n }\n\n video {\n display: block;\n }\n `;\n\n /**\n * Mirror the local video horizontally\n */\n @property({ type: Boolean }) mirror = false;\n\n /**\n * Consumes call context from parent call-media component\n */\n @consume({ context: callContext, subscribe: true })\n @property({ attribute: false })\n private _call?: Call;\n\n /**\n * Public call property for direct assignment (when not nested in sw-call-media)\n */\n @property({ attribute: false })\n set call(value: Call | undefined) {\n this._call = value;\n this.cleanupSubscriptions();\n this.setupSubscriptions();\n }\n get call(): Call | undefined {\n return this._call;\n }\n\n /**\n * Current local stream value from observable\n */\n private _localStreamValue: MediaStream | null = null;\n\n /**\n * Current layout layers value from observable\n */\n private _layoutLayersValue: LayoutLayer[] = [];\n\n /**\n * RxJS subscriptions for cleanup\n */\n private subscriptions: Subscription[] = [];\n\n /**\n * Lifecycle: Component connected to DOM\n */\n connectedCallback() {\n super.connectedCallback();\n this.setupSubscriptions();\n }\n\n /**\n * Lifecycle: React to property/context changes\n */\n protected updated(changedProperties: Map<string, unknown>): void {\n super.updated(changedProperties);\n if (changedProperties.has('_call') && this._call) {\n // Clean up old subscriptions first\n this.cleanupSubscriptions();\n // Set up new subscriptions\n this.setupSubscriptions();\n }\n }\n\n /**\n * Lifecycle: Component disconnected from DOM\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.cleanupSubscriptions();\n }\n\n /**\n * Subscribe to call observables\n */\n private setupSubscriptions(): void {\n // Continue observing even if _call is undefined initially\n // This allows component to react when call becomes available\n if (!this._call) return;\n\n // Subscribe to local stream\n this.subscriptions.push(\n this._call.localStream$.subscribe((stream: MediaStream | null) => {\n this._localStreamValue = stream;\n this.requestUpdate();\n })\n );\n\n // Subscribe to layout layers\n this.subscriptions.push(\n this._call.layoutLayers$.subscribe((layers: LayoutLayer[]) => {\n this._layoutLayersValue = layers;\n this.requestUpdate();\n })\n );\n }\n\n /**\n * Cleanup all subscriptions\n */\n private cleanupSubscriptions(): void {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions = [];\n }\n\n /**\n * Find self layer in layout layers\n */\n private getSelfLayer(): LayoutLayer | undefined {\n // Get selfId dynamically from call.self to handle cases where self is available after subscription setup\n const selfId = getSelfId(this._call);\n return this._layoutLayersValue.find((layer) => layer.member_id === selfId);\n }\n\n /**\n * Render the component\n */\n render() {\n const layer = this.getSelfLayer();\n\n // Skip rendering but continue observing - return null allows reactive updates\n if (!layer) return null;\n\n // Skip video overlay for audio-only streams (no video tracks)\n const hasVideoTracks = (this._localStreamValue?.getVideoTracks().length ?? 0) > 0;\n if (!hasVideoTracks) return null;\n\n const style = `\n position: absolute;\n top: ${layer.y}%;\n left: ${layer.x}%;\n width: ${layer.width}%;\n height: ${layer.height}%;\n opacity: ${layer.visible ? 1 : 0};\n overflow: hidden;\n transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease, opacity 0.3s ease;\n pointer-events: none;\n `;\n\n const videoStyle = this.mirror\n ? 'transform: scale(-1, 1); -webkit-transform: scale(-1, 1);'\n : '';\n\n return html`\n <div class=\"local-overlay\" part=\"container\" style=\"${style}\">\n <video\n class=\"local-video\"\n part=\"video\"\n style=\"width: 100%; height: 100%; object-fit: cover; ${videoStyle}\"\n autoplay\n playsinline\n muted\n disablePictureInPicture\n .srcObject=${this._localStreamValue}\n ></video>\n </div>\n `;\n }\n}\n\n/**\n * Declare global type for TypeScript\n */\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sw-self-media': SelfMedia;\n }\n}\n","/**\n * Audio Level Component\n *\n * Visual audio level indicator that renders real-time audio levels from a MediaStream\n * via Web Audio API. Displays configurable number of bars with color transitions\n * based on audio intensity.\n *\n * @example\n * ```html\n * <sw-audio-level .stream=${mediaStream} bars=\"5\" orientation=\"vertical\"></sw-audio-level>\n * ```\n *\n * @cssprop [--sw-color-success=#10b981] - Color for low audio levels.\n * @cssprop [--sw-color-warning=#f59e0b] - Color for medium audio levels.\n * @cssprop [--sw-color-danger=#ef4444] - Color for high audio levels.\n * @cssprop [--sw-audio-bar-width=4px] - Width of each audio level bar.\n * @cssprop [--sw-audio-bar-gap=2px] - Gap between audio level bars.\n * @cssprop [--sw-audio-bar-radius=2px] - Border radius of each bar.\n * @cssprop [--sw-audio-bar-background=#404040] - Background color of inactive bars.\n */\n\nimport { LitElement, html, css } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\n\n@customElement('sw-audio-level')\nexport class AudioLevel extends LitElement {\n static styles = css`\n :host {\n /* CSS Custom Properties for theming */\n --sw-color-success: #10b981;\n --sw-color-warning: #f59e0b;\n --sw-color-danger: #ef4444;\n --sw-audio-bar-width: 4px;\n --sw-audio-bar-gap: 2px;\n --sw-audio-bar-radius: 2px;\n --sw-audio-bar-background: rgba(255, 255, 255, 0.2);\n\n display: inline-flex;\n }\n\n .container {\n display: flex;\n align-items: flex-end;\n justify-content: center;\n gap: var(--sw-audio-bar-gap);\n }\n\n :host([orientation='horizontal']) .container {\n flex-direction: row;\n align-items: center;\n }\n\n :host([orientation='vertical']) .container,\n .container {\n flex-direction: row;\n align-items: flex-end;\n }\n\n .bar {\n width: var(--sw-audio-bar-width);\n background: var(--sw-audio-bar-background);\n border-radius: var(--sw-audio-bar-radius);\n transition:\n height 0.05s ease-out,\n width 0.05s ease-out,\n background-color 0.1s ease;\n min-height: 4px;\n }\n\n :host([orientation='horizontal']) .bar {\n height: var(--sw-audio-bar-width);\n width: 4px;\n min-width: 4px;\n min-height: auto;\n }\n\n .bar.active {\n /* Color is set dynamically via inline style */\n }\n\n .bar.level-low {\n background-color: var(--sw-color-success);\n }\n\n .bar.level-medium {\n background-color: var(--sw-color-warning);\n }\n\n .bar.level-high {\n background-color: var(--sw-color-danger);\n }\n `;\n\n /**\n * MediaStream to analyze for audio levels\n */\n @property({ type: Object }) stream?: MediaStream;\n\n /**\n * Number of bars to display (default: 5)\n */\n @property({ type: Number }) bars = 5;\n\n /**\n * Orientation of the bars: 'vertical' or 'horizontal'\n */\n @property({ type: String, reflect: true }) orientation: 'vertical' | 'horizontal' = 'vertical';\n\n /**\n * Maximum height/width of bars in pixels\n */\n @property({ type: Number }) maxSize = 32;\n\n /**\n * Current audio levels for each bar (0-1)\n */\n @state() private _levels: number[] = [];\n\n /**\n * Web Audio API context\n */\n private _audioContext?: AudioContext;\n\n /**\n * Analyser node for frequency data\n */\n private _analyser?: AnalyserNode;\n\n /**\n * Source node connected to the MediaStream\n */\n private _source?: MediaStreamAudioSourceNode;\n\n /**\n * Animation frame ID for cleanup\n */\n private _animationFrameId?: number;\n\n /**\n * Frequency data buffer\n */\n private _dataArray?: Uint8Array<ArrayBuffer>;\n\n /**\n * Lifecycle: Component connected to DOM\n */\n connectedCallback() {\n super.connectedCallback();\n this._levels = new Array(this.bars).fill(0);\n if (this.stream) {\n this.setupAudioAnalysis();\n }\n }\n\n /**\n * Lifecycle: React to property changes\n */\n protected updated(changedProperties: Map<string, unknown>): void {\n super.updated(changedProperties);\n\n if (changedProperties.has('stream')) {\n this.cleanupAudioAnalysis();\n if (this.stream) {\n this.setupAudioAnalysis();\n }\n }\n\n if (changedProperties.has('bars')) {\n this._levels = new Array(this.bars).fill(0);\n }\n }\n\n /**\n * Lifecycle: Component disconnected from DOM\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.cleanupAudioAnalysis();\n }\n\n /**\n * Public method to release all audio resources immediately\n * Call this before stopping the MediaStream tracks to ensure proper cleanup\n */\n public releaseResources(): void {\n this.cleanupAudioAnalysis();\n this.stream = undefined;\n }\n\n /**\n * Setup Web Audio API for audio level analysis\n */\n private setupAudioAnalysis(): void {\n if (!this.stream) return;\n\n // Check if stream has audio tracks\n const audioTracks = this.stream.getAudioTracks();\n if (audioTracks.length === 0) {\n console.warn('sw-audio-level: MediaStream has no audio tracks');\n return;\n }\n\n try {\n // Create AudioContext\n this._audioContext = new AudioContext();\n\n // Create analyser node\n this._analyser = this._audioContext.createAnalyser();\n this._analyser.fftSize = 256;\n this._analyser.smoothingTimeConstant = 0.8;\n\n // Create source from MediaStream\n this._source = this._audioContext.createMediaStreamSource(this.stream);\n this._source.connect(this._analyser);\n\n // Create data array for frequency data\n const bufferLength = this._analyser.frequencyBinCount;\n this._dataArray = new Uint8Array(bufferLength);\n\n // Start animation loop\n this.startAnimationLoop();\n } catch (error) {\n console.error('sw-audio-level: Failed to setup audio analysis:', error);\n }\n }\n\n /**\n * Cleanup Web Audio API resources\n */\n private cleanupAudioAnalysis(): void {\n // Cancel animation frame\n if (this._animationFrameId !== undefined) {\n cancelAnimationFrame(this._animationFrameId);\n this._animationFrameId = undefined;\n }\n\n // Disconnect source\n if (this._source) {\n this._source.disconnect();\n this._source = undefined;\n }\n\n // Disconnect analyser (not strictly necessary but good practice)\n if (this._analyser) {\n this._analyser.disconnect();\n this._analyser = undefined;\n }\n\n // Close AudioContext\n if (this._audioContext && this._audioContext.state !== 'closed') {\n this._audioContext.close().catch(console.error);\n this._audioContext = undefined;\n }\n\n // Clear data array\n this._dataArray = undefined;\n\n // Reset levels\n this._levels = new Array(this.bars).fill(0);\n }\n\n /**\n * Start the animation loop for updating levels\n */\n private startAnimationLoop(): void {\n const updateLevels = () => {\n const analyser = this._analyser;\n const dataArray = this._dataArray;\n if (!analyser || !dataArray) {\n return;\n }\n\n // Get frequency data\n analyser.getByteFrequencyData(dataArray);\n\n // Calculate levels for each bar by sampling frequency ranges\n const levels: number[] = [];\n const binCount = dataArray.length;\n const binsPerBar = Math.floor(binCount / this.bars);\n\n for (let i = 0; i < this.bars; i++) {\n const startBin = i * binsPerBar;\n const endBin = Math.min(startBin + binsPerBar, binCount);\n\n // Average the frequency values for this bar's range\n let sum = 0;\n for (let j = startBin; j < endBin; j++) {\n sum += dataArray[j] ?? 0;\n }\n const average = sum / (endBin - startBin);\n\n // Normalize to 0-1 range\n levels.push(average / 255);\n }\n\n this._levels = levels;\n this.requestUpdate();\n\n // Schedule next frame\n this._animationFrameId = requestAnimationFrame(updateLevels);\n };\n\n this._animationFrameId = requestAnimationFrame(updateLevels);\n }\n\n /**\n * Get the color class based on level\n */\n private getLevelClass(level: number): string {\n if (level > 0.7) return 'level-high';\n if (level > 0.4) return 'level-medium';\n if (level > 0.05) return 'level-low';\n return '';\n }\n\n /**\n * Get the active class if level is above threshold\n */\n private isActive(level: number): boolean {\n return level > 0.05;\n }\n\n /**\n * Render the component\n */\n render() {\n // Ensure we have the right number of levels\n const levels = this._levels.length === this.bars ? this._levels : new Array(this.bars).fill(0);\n\n return html`\n <div class=\"container\" part=\"container\">\n ${levels.map((level, index) => {\n const isActive = this.isActive(level);\n const levelClass = this.getLevelClass(level);\n const size = Math.max(4, level * this.maxSize);\n\n const style =\n this.orientation === 'horizontal' ? `width: ${size}px;` : `height: ${size}px;`;\n\n return html`\n <div\n class=\"bar ${isActive ? 'active' : ''} ${levelClass}\"\n part=\"bar ${isActive ? 'bar-active' : ''}\"\n style=\"${style}\"\n data-bar-index=\"${index}\"\n ></div>\n `;\n })}\n </div>\n `;\n }\n}\n\n/**\n * Declare global type for TypeScript\n */\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sw-audio-level': AudioLevel;\n }\n}\n","/**\n * Device Selector Component\n *\n * Dropdown-based selector for choosing audio/video devices. Displays device lists from\n * DeviceController observables with labeled dropdowns for microphone, camera, and speaker.\n * Includes inline preview for video (camera) and audio level (microphone) using browser API.\n *\n * @example\n * ```html\n * <sw-device-selector .deviceController=${deviceController} show-preview></sw-device-selector>\n * ```\n *\n * @fires sw-device-change - Fired when a device selection changes. Detail: `{ type: DeviceType, device: MediaDeviceInfo }`\n * @fires sw-test-speaker - Fired when the speaker test button is clicked.\n *\n * @cssprop [--sw-color-primary=#044cf6] - Primary accent color.\n * @cssprop [--sw-color-primary-hover=#0339c4] - Primary color on hover.\n * @cssprop [--sw-color-background=#1a1a1a] - Component background.\n * @cssprop [--sw-color-surface=#2a2a2a] - Dropdown surface color.\n * @cssprop [--sw-color-surface-hover=#3a3a3a] - Surface on hover.\n * @cssprop [--sw-color-text=#ffffff] - Text color.\n * @cssprop [--sw-color-text-muted=#a0a0a0] - Muted text color.\n * @cssprop [--sw-color-border=#404040] - Border color.\n * @cssprop [--sw-color-success=#10b981] - Success indicator color.\n * @cssprop [--sw-border-radius=8px] - Border radius.\n */\n\nimport { LitElement, html, css, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { Subscription } from 'rxjs';\nimport type { DeviceController } from '@signalwire/js';\nimport './audio-level.js';\n\ntype DeviceType = 'microphone' | 'camera' | 'speaker';\n\n@customElement('sw-device-selector')\nexport class DeviceSelector extends LitElement {\n static styles = css`\n :host {\n /* CSS Custom Properties for theming */\n --sw-color-primary: #044cf6;\n --sw-color-primary-hover: #0339c4;\n --sw-color-background: #1a1a1a;\n --sw-color-surface: #2a2a2a;\n --sw-color-surface-hover: #3a3a3a;\n --sw-color-text: #ffffff;\n --sw-color-text-muted: #a0a0a0;\n --sw-color-border: #404040;\n --sw-color-success: #10b981;\n --sw-border-radius: 8px;\n --sw-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n --sw-space-1: 4px;\n --sw-space-2: 8px;\n --sw-space-3: 12px;\n --sw-space-4: 16px;\n --sw-space-6: 24px;\n\n display: block;\n font-family: var(--sw-font-family);\n color: var(--sw-color-text);\n }\n\n .container {\n background: var(--sw-color-background);\n border-radius: var(--sw-border-radius);\n border: 1px solid var(--sw-color-border);\n overflow: hidden;\n min-width: 300px;\n padding: var(--sw-space-4);\n }\n\n .device-section {\n margin-bottom: var(--sw-space-4);\n }\n\n .device-section:last-of-type {\n margin-bottom: 0;\n }\n\n .device-label {\n display: flex;\n align-items: center;\n gap: var(--sw-space-2);\n font-size: 14px;\n font-weight: 500;\n color: var(--sw-color-text);\n margin-bottom: var(--sw-space-2);\n }\n\n .device-icon {\n width: 18px;\n height: 18px;\n flex-shrink: 0;\n color: var(--sw-color-text-muted);\n }\n\n .device-select-wrapper {\n position: relative;\n }\n\n .device-select {\n width: 100%;\n padding: var(--sw-space-3) var(--sw-space-4);\n padding-right: 36px;\n background: var(--sw-color-surface);\n border: 1px solid var(--sw-color-border);\n border-radius: calc(var(--sw-border-radius) - 4px);\n color: var(--sw-color-text);\n font-size: 14px;\n font-family: var(--sw-font-family);\n cursor: pointer;\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n transition:\n border-color 0.2s ease,\n background-color 0.2s ease;\n }\n\n .device-select:hover {\n background: var(--sw-color-surface-hover);\n }\n\n .device-select:focus {\n outline: none;\n border-color: var(--sw-color-primary);\n box-shadow: 0 0 0 2px rgba(4, 76, 246, 0.2);\n }\n\n .device-select:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .device-select option {\n background: var(--sw-color-surface);\n color: var(--sw-color-text);\n padding: var(--sw-space-2);\n }\n\n .select-arrow {\n position: absolute;\n right: var(--sw-space-3);\n top: 50%;\n transform: translateY(-50%);\n width: 16px;\n height: 16px;\n color: var(--sw-color-text-muted);\n pointer-events: none;\n }\n\n .no-devices {\n padding: var(--sw-space-3) var(--sw-space-4);\n background: var(--sw-color-surface);\n border: 1px solid var(--sw-color-border);\n border-radius: calc(var(--sw-border-radius) - 4px);\n color: var(--sw-color-text-muted);\n font-size: 14px;\n }\n\n .device-preview {\n margin-top: var(--sw-space-3);\n }\n\n .video-preview {\n width: 100%;\n aspect-ratio: 16/9;\n background: #000;\n border-radius: calc(var(--sw-border-radius) - 4px);\n overflow: hidden;\n }\n\n .video-preview video {\n width: 100%;\n height: 100%;\n object-fit: cover;\n transform: scaleX(-1);\n }\n\n .video-preview-placeholder {\n width: 100%;\n aspect-ratio: 16/9;\n background: var(--sw-color-surface);\n border-radius: calc(var(--sw-border-radius) - 4px);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--sw-color-text-muted);\n font-size: 14px;\n }\n\n .audio-preview {\n display: flex;\n align-items: center;\n gap: var(--sw-space-3);\n padding: var(--sw-space-3);\n background: var(--sw-color-surface);\n border-radius: calc(var(--sw-border-radius) - 4px);\n }\n\n .audio-preview-label {\n font-size: 12px;\n color: var(--sw-color-text-muted);\n flex-shrink: 0;\n }\n\n .audio-level-wrapper {\n flex: 1;\n display: flex;\n justify-content: center;\n }\n\n .test-speaker-btn {\n padding: var(--sw-space-2) var(--sw-space-4);\n background: var(--sw-color-primary);\n color: white;\n border: none;\n border-radius: calc(var(--sw-border-radius) - 4px);\n font-size: 14px;\n cursor: pointer;\n transition: background-color 0.2s ease;\n }\n\n .test-speaker-btn:hover {\n background: var(--sw-color-primary-hover);\n }\n\n .test-speaker-btn:focus {\n outline: none;\n box-shadow:\n 0 0 0 2px var(--sw-color-background),\n 0 0 0 4px var(--sw-color-primary);\n }\n\n .test-speaker-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Scrollbar styling for select on some browsers */\n .device-select::-webkit-scrollbar {\n width: 8px;\n }\n\n .device-select::-webkit-scrollbar-track {\n background: var(--sw-color-background);\n }\n\n .device-select::-webkit-scrollbar-thumb {\n background: var(--sw-color-border);\n border-radius: 4px;\n }\n\n .device-select::-webkit-scrollbar-thumb:hover {\n background: var(--sw-color-text-muted);\n }\n `;\n\n /**\n * Device controller with observables for device lists\n */\n @property({ type: Object }) deviceController?: DeviceController;\n\n /**\n * Whether to show the preview panel\n */\n @property({ type: Boolean, attribute: 'show-preview' }) showPreview = false;\n\n /**\n * Audio input devices\n */\n @state() private _audioInputDevices: MediaDeviceInfo[] = [];\n\n /**\n * Video input devices\n */\n @state() private _videoInputDevices: MediaDeviceInfo[] = [];\n\n /**\n * Audio output devices\n */\n @state() private _audioOutputDevices: MediaDeviceInfo[] = [];\n\n /**\n * Selected audio input device\n */\n @state() private _selectedAudioInput: MediaDeviceInfo | null = null;\n\n /**\n * Selected video input device\n */\n @state() private _selectedVideoInput: MediaDeviceInfo | null = null;\n\n /**\n * Selected audio output device\n */\n @state() private _selectedAudioOutput: MediaDeviceInfo | null = null;\n\n /**\n * Video preview stream from camera\n */\n @state() private _videoPreviewStream: MediaStream | null = null;\n\n /**\n * Audio preview stream from microphone\n */\n @state() private _audioPreviewStream: MediaStream | null = null;\n\n /**\n * Is test audio playing\n */\n @state() private _isTestingAudio = false;\n\n /**\n * Whether the component is currently visible (combines all visibility factors)\n */\n private _isComponentVisible = false;\n\n /**\n * Whether the component is in the viewport (IntersectionObserver)\n */\n private _isInViewport = false;\n\n /**\n * Whether the document/tab is visible\n */\n private _isDocumentVisible = true;\n\n /**\n * Whether the component is CSS-visible (display, visibility, opacity)\n */\n private _isCSSVisible = true;\n\n /**\n * Video element reference\n */\n private _videoElement?: HTMLVideoElement;\n\n /**\n * RxJS subscriptions for cleanup\n */\n private subscriptions: Subscription[] = [];\n\n /**\n * Audio element for speaker test\n */\n private _testAudioElement?: HTMLAudioElement;\n\n /**\n * IntersectionObserver for viewport visibility\n */\n private _intersectionObserver?: IntersectionObserver;\n\n /**\n * Bound handler for document visibility change\n */\n private _boundHandleDocumentVisibility = this.handleDocumentVisibilityChange.bind(this);\n\n /**\n * Interval ID for CSS visibility polling\n */\n private _cssVisibilityCheckInterval?: ReturnType<typeof setInterval>;\n\n /**\n * Flag to prevent concurrent preview initialization\n */\n private _isInitializingPreviews = false;\n\n /**\n * Interval in milliseconds for checking CSS visibility changes\n */\n private static readonly CSS_VISIBILITY_CHECK_INTERVAL_MS = 200;\n\n /**\n * Lifecycle: Component connected to DOM\n */\n connectedCallback() {\n super.connectedCallback();\n this.setupSubscriptions();\n this.setupVisibilityObservers();\n }\n\n /**\n * Lifecycle: React to property changes\n */\n protected updated(changedProperties: Map<string, unknown>): void {\n super.updated(changedProperties);\n if (changedProperties.has('deviceController')) {\n this.cleanupSubscriptions();\n this.setupSubscriptions();\n }\n if (changedProperties.has('showPreview')) {\n if (this.showPreview && this._isComponentVisible) {\n // Only initialize if component is visible\n this.initializePreviews();\n } else if (!this.showPreview) {\n // Always cleanup when showPreview is disabled\n this.cleanupVideoPreviewStream();\n this.cleanupAudioPreviewStream();\n }\n }\n }\n\n /**\n * Lifecycle: Component disconnected from DOM\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.cleanupSubscriptions();\n this.cleanupVisibilityObservers();\n this.cleanupVideoPreviewStream();\n this.cleanupAudioPreviewStream();\n this.stopTestAudio();\n }\n\n /**\n * Setup all visibility observers (IntersectionObserver, document visibility, CSS polling)\n */\n private setupVisibilityObservers(): void {\n // Defensive cleanup in case of multiple calls without disconnect\n this.cleanupVisibilityObservers();\n\n // Setup IntersectionObserver for viewport visibility\n this._intersectionObserver = new IntersectionObserver(\n (entries) => {\n const entry = entries[0];\n if (entry) {\n this._isInViewport = entry.isIntersecting;\n this.updateVisibilityState();\n }\n },\n { threshold: 0 }\n );\n this._intersectionObserver.observe(this);\n\n // Setup document visibility change listener\n this._isDocumentVisible = document.visibilityState === 'visible';\n document.addEventListener('visibilitychange', this._boundHandleDocumentVisibility);\n\n // Setup CSS visibility polling (checks opacity, display, visibility)\n this._isCSSVisible = this.checkCSSVisibility();\n this._cssVisibilityCheckInterval = setInterval(() => {\n const wasVisible = this._isCSSVisible;\n this._isCSSVisible = this.checkCSSVisibility();\n if (wasVisible !== this._isCSSVisible) {\n this.updateVisibilityState();\n }\n }, DeviceSelector.CSS_VISIBILITY_CHECK_INTERVAL_MS);\n }\n\n /**\n * Cleanup all visibility observers\n */\n private cleanupVisibilityObservers(): void {\n if (this._intersectionObserver) {\n this._intersectionObserver.disconnect();\n this._intersectionObserver = undefined;\n }\n\n document.removeEventListener('visibilitychange', this._boundHandleDocumentVisibility);\n\n if (this._cssVisibilityCheckInterval) {\n clearInterval(this._cssVisibilityCheckInterval);\n this._cssVisibilityCheckInterval = undefined;\n }\n }\n\n /**\n * Handle document visibility change (tab switching)\n */\n private handleDocumentVisibilityChange(): void {\n this._isDocumentVisible = document.visibilityState === 'visible';\n this.updateVisibilityState();\n }\n\n /**\n * Check if the component is visible via CSS (display, visibility, opacity)\n * Traverses the DOM tree including shadow DOM boundaries\n */\n private checkCSSVisibility(): boolean {\n // Guard against being called when disconnected\n if (!this.isConnected) {\n return false;\n }\n\n let element: HTMLElement | null = this;\n while (element) {\n const style = getComputedStyle(element);\n if (\n style.display === 'none' ||\n style.visibility === 'hidden' ||\n parseFloat(style.opacity) === 0\n ) {\n return false;\n }\n\n // Handle shadow DOM boundaries by traversing through shadow hosts\n if (element.parentElement) {\n element = element.parentElement;\n } else {\n const root = element.getRootNode();\n element = root instanceof ShadowRoot ? (root.host as HTMLElement) : null;\n }\n }\n return true;\n }\n\n /**\n * Update the combined visibility state and manage preview streams accordingly\n */\n private updateVisibilityState(): void {\n const wasVisible = this._isComponentVisible;\n this._isComponentVisible = this._isInViewport && this._isDocumentVisible && this._isCSSVisible;\n\n // Only react if visibility actually changed\n if (wasVisible === this._isComponentVisible) {\n return;\n }\n\n if (this._isComponentVisible && this.showPreview) {\n // Component became visible - start previews\n this.initializePreviews();\n } else if (!this._isComponentVisible) {\n // Component became invisible - stop previews\n this.cleanupVideoPreviewStream();\n this.cleanupAudioPreviewStream();\n }\n }\n\n /**\n * Subscribe to device controller observables\n */\n private setupSubscriptions(): void {\n if (!this.deviceController) return;\n\n // Subscribe to audio input devices\n this.subscriptions.push(\n this.deviceController.audioInputDevices$.subscribe((devices) => {\n this._audioInputDevices = devices;\n })\n );\n\n // Subscribe to video input devices\n this.subscriptions.push(\n this.deviceController.videoInputDevices$.subscribe((devices) => {\n this._videoInputDevices = devices;\n })\n );\n\n // Subscribe to audio output devices\n this.subscriptions.push(\n this.deviceController.audioOutputDevices$.subscribe((devices) => {\n this._audioOutputDevices = devices;\n })\n );\n\n // Subscribe to selected devices if available\n if (this.deviceController.selectedAudioInputDevice$) {\n this.subscriptions.push(\n this.deviceController.selectedAudioInputDevice$.subscribe((device) => {\n this._selectedAudioInput = device;\n })\n );\n }\n\n if (this.deviceController.selectedVideoInputDevice$) {\n this.subscriptions.push(\n this.deviceController.selectedVideoInputDevice$.subscribe((device) => {\n this._selectedVideoInput = device;\n })\n );\n }\n\n if (this.deviceController.selectedAudioOutputDevice$) {\n this.subscriptions.push(\n this.deviceController.selectedAudioOutputDevice$.subscribe((device) => {\n this._selectedAudioOutput = device;\n })\n );\n }\n }\n\n /**\n * Cleanup all subscriptions\n */\n private cleanupSubscriptions(): void {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions = [];\n }\n\n /**\n * Cleanup video preview stream\n * Best practice from SDK: Pause video, clear srcObject, remove tracks from stream, then stop tracks\n * @see https://webrtchacks.com/srcobject-intervention/\n */\n private cleanupVideoPreviewStream(): void {\n // Step 1: Pause and clear the video element\n if (this._videoElement) {\n this._videoElement.pause();\n this._videoElement.srcObject = null;\n this._videoElement = undefined;\n }\n\n // Also check for any video element in shadow DOM (in case _videoElement wasn't set)\n const videoElement = this.shadowRoot?.querySelector('video');\n if (videoElement) {\n videoElement.pause();\n videoElement.srcObject = null;\n }\n\n // Step 2: Remove tracks from stream before stopping (SDK pattern)\n if (this._videoPreviewStream) {\n const tracks = this._videoPreviewStream.getTracks();\n tracks.forEach((track: MediaStreamTrack) => {\n // Remove track from stream first (important for proper release)\n this._videoPreviewStream?.removeTrack(track);\n track.stop();\n });\n this._videoPreviewStream = null;\n }\n }\n\n /**\n * Cleanup audio preview stream\n * Best practice from SDK: Release audio components, remove tracks from stream, then stop tracks\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/stop\n */\n private cleanupAudioPreviewStream(): void {\n // Step 1: Release resources from all audio-level components synchronously\n // This closes their AudioContext and disconnects MediaStreamAudioSourceNode\n const audioLevelComponents = this.shadowRoot?.querySelectorAll('sw-audio-level');\n audioLevelComponents?.forEach((component) => {\n const audioLevel = component as HTMLElement & {\n releaseResources?: () => void;\n stream?: MediaStream;\n };\n if (audioLevel.releaseResources) {\n audioLevel.releaseResources();\n } else {\n // Fallback for older versions\n audioLevel.stream = undefined;\n }\n });\n\n // Step 2: Remove tracks from stream before stopping (SDK pattern)\n if (this._audioPreviewStream) {\n const tracks = this._audioPreviewStream.getTracks();\n tracks.forEach((track: MediaStreamTrack) => {\n // Remove track from stream first (important for proper release)\n this._audioPreviewStream?.removeTrack(track);\n track.stop();\n });\n this._audioPreviewStream = null;\n }\n }\n\n /**\n * Get video preview stream from browser API\n */\n private async getVideoPreviewStream(deviceId?: string): Promise<void> {\n this.cleanupVideoPreviewStream();\n\n if (!this.showPreview) return;\n\n try {\n const constraints: MediaStreamConstraints = {\n video: deviceId ? { deviceId: { exact: deviceId } } : true,\n audio: false\n };\n this._videoPreviewStream = await navigator.mediaDevices.getUserMedia(constraints);\n this.updateVideoElement();\n } catch (error) {\n console.warn('Failed to get video preview stream:', error);\n this._videoPreviewStream = null;\n }\n }\n\n /**\n * Get audio preview stream from browser API\n */\n private async getAudioPreviewStream(deviceId?: string): Promise<void> {\n this.cleanupAudioPreviewStream();\n\n if (!this.showPreview) return;\n\n try {\n const constraints: MediaStreamConstraints = {\n video: false,\n audio: deviceId ? { deviceId: { exact: deviceId } } : true\n };\n this._audioPreviewStream = await navigator.mediaDevices.getUserMedia(constraints);\n } catch (error) {\n console.warn('Failed to get audio preview stream:', error);\n this._audioPreviewStream = null;\n }\n }\n\n /**\n * Update video element with current stream\n */\n private updateVideoElement(): void {\n if (this._videoElement && this._videoPreviewStream) {\n this._videoElement.srcObject = this._videoPreviewStream;\n }\n }\n\n /**\n * Initialize previews when show-preview is enabled\n */\n private async initializePreviews(): Promise<void> {\n // Prevent concurrent initialization to avoid stream leaks on rapid visibility toggles\n if (!this.showPreview || this._isInitializingPreviews) return;\n\n this._isInitializingPreviews = true;\n try {\n // Get video preview if we have video devices\n if (this._videoInputDevices.length > 0) {\n const deviceId = this._selectedVideoInput?.deviceId;\n await this.getVideoPreviewStream(deviceId);\n }\n\n // Get audio preview if we have audio devices\n if (this._audioInputDevices.length > 0) {\n const deviceId = this._selectedAudioInput?.deviceId;\n await this.getAudioPreviewStream(deviceId);\n }\n } finally {\n this._isInitializingPreviews = false;\n }\n }\n\n /**\n * Handle device selection change from dropdown\n */\n private handleDeviceChange(event: Event, deviceType: DeviceType): void {\n if (!this.deviceController) return;\n\n const select = event.target as HTMLSelectElement;\n const deviceId = select.value;\n\n let device: MediaDeviceInfo | null = null;\n\n switch (deviceType) {\n case 'microphone':\n device = this._audioInputDevices.find((d) => d.deviceId === deviceId) || null;\n this._selectedAudioInput = device;\n this.deviceController.selectAudioInputDevice?.(device);\n // Update audio preview stream with new device\n if (this.showPreview) {\n this.getAudioPreviewStream(deviceId);\n }\n break;\n case 'camera':\n device = this._videoInputDevices.find((d) => d.deviceId === deviceId) || null;\n this._selectedVideoInput = device;\n this.deviceController.selectVideoInputDevice?.(device);\n // Update video preview stream with new device\n if (this.showPreview) {\n this.getVideoPreviewStream(deviceId);\n }\n break;\n case 'speaker':\n device = this._audioOutputDevices.find((d) => d.deviceId === deviceId) || null;\n this._selectedAudioOutput = device;\n this.deviceController.selectAudioOutputDevice?.(device);\n break;\n }\n\n if (device) {\n this.dispatchEvent(\n new CustomEvent('sw-device-change', {\n detail: { device, deviceType },\n bubbles: true,\n composed: true\n })\n );\n }\n }\n\n /**\n * Test speaker by playing a test tone\n */\n private async testSpeaker(): Promise<void> {\n if (this._isTestingAudio) {\n this.stopTestAudio();\n return;\n }\n\n try {\n this._isTestingAudio = true;\n\n // Create oscillator-based test tone\n const audioContext = new AudioContext();\n const oscillator = audioContext.createOscillator();\n const gainNode = audioContext.createGain();\n\n oscillator.type = 'sine';\n oscillator.frequency.value = 440; // A4 note\n gainNode.gain.value = 0.3;\n\n oscillator.connect(gainNode);\n gainNode.connect(audioContext.destination);\n\n oscillator.start();\n\n // Stop after 1 second\n setTimeout(() => {\n oscillator.stop();\n audioContext.close();\n this._isTestingAudio = false;\n }, 1000);\n\n this.dispatchEvent(\n new CustomEvent('sw-test-speaker', {\n bubbles: true,\n composed: true\n })\n );\n } catch (error) {\n console.error('Failed to play test audio:', error);\n this._isTestingAudio = false;\n }\n }\n\n /**\n * Stop test audio\n */\n private stopTestAudio(): void {\n if (this._testAudioElement) {\n this._testAudioElement.pause();\n this._testAudioElement = undefined;\n }\n this._isTestingAudio = false;\n }\n\n /**\n * Render device icon\n */\n private renderDeviceIcon(deviceType: DeviceType) {\n switch (deviceType) {\n case 'microphone':\n return html`<svg class=\"device-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.91-3c-.49 0-.9.36-.98.85C16.52 14.2 14.47 16 12 16s-4.52-1.8-4.93-4.15c-.08-.49-.49-.85-.98-.85-.61 0-1.09.54-1 1.14.49 3 2.89 5.35 5.91 5.78V20c0 .55.45 1 1 1s1-.45 1-1v-2.08c3.02-.43 5.42-2.78 5.91-5.78.1-.6-.39-1.14-1-1.14z\"\n />\n </svg>`;\n case 'camera':\n return html`<svg class=\"device-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z\"\n />\n </svg>`;\n case 'speaker':\n return html`<svg class=\"device-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z\"\n />\n </svg>`;\n }\n }\n\n /**\n * Render dropdown arrow icon\n */\n private renderSelectArrow() {\n return html`<svg class=\"select-arrow\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7 10l5 5 5-5z\" />\n </svg>`;\n }\n\n /**\n * Render a device selection section\n */\n private renderDeviceSection(\n deviceType: DeviceType,\n label: string,\n devices: MediaDeviceInfo[],\n selectedDevice: MediaDeviceInfo | null\n ) {\n return html`\n <div class=\"device-section\" part=\"device-section\">\n <label class=\"device-label\" for=\"select-${deviceType}\">\n ${this.renderDeviceIcon(deviceType)}\n <span>${label}</span>\n </label>\n ${devices.length === 0\n ? html`<div class=\"no-devices\">No ${label.toLowerCase()} found</div>`\n : html`\n <div class=\"device-select-wrapper\">\n <select\n id=\"select-${deviceType}\"\n class=\"device-select\"\n part=\"device-select\"\n aria-label=\"${label}\"\n .value=${selectedDevice?.deviceId || ''}\n @change=${(e: Event) => this.handleDeviceChange(e, deviceType)}\n >\n ${devices.map(\n (device) => html`\n <option\n value=\"${device.deviceId}\"\n ?selected=${selectedDevice?.deviceId === device.deviceId}\n >\n ${device.label || `Device ${device.deviceId.slice(0, 8)}`}\n </option>\n `\n )}\n </select>\n ${this.renderSelectArrow()}\n </div>\n `}\n </div>\n `;\n }\n\n /**\n * Render video preview for camera section\n */\n private renderVideoPreview() {\n if (!this.showPreview || this._videoInputDevices.length === 0) {\n return nothing;\n }\n\n return html`\n <div class=\"device-preview\">\n ${this._videoPreviewStream\n ? html`\n <div class=\"video-preview\">\n <video\n autoplay\n playsinline\n muted\n .srcObject=${this._videoPreviewStream}\n @loadedmetadata=${(e: Event) => {\n const video = e.target as HTMLVideoElement;\n this._videoElement = video;\n video.play().catch(() => {});\n }}\n ></video>\n </div>\n `\n : html` <div class=\"video-preview-placeholder\">Click to enable camera preview</div> `}\n </div>\n `;\n }\n\n /**\n * Render audio level preview for microphone section\n */\n private renderAudioPreview() {\n if (!this.showPreview || this._audioInputDevices.length === 0) {\n return nothing;\n }\n\n return html`\n <div class=\"device-preview\">\n <div class=\"audio-preview\">\n <span class=\"audio-preview-label\">Level:</span>\n <div class=\"audio-level-wrapper\">\n ${this._audioPreviewStream\n ? html`\n <sw-audio-level\n .stream=${this._audioPreviewStream}\n bars=\"10\"\n orientation=\"horizontal\"\n maxSize=\"20\"\n ></sw-audio-level>\n `\n : html`\n <span style=\"color: var(--sw-color-text-muted); font-size: 12px;\"\n >No audio input</span\n >\n `}\n </div>\n </div>\n </div>\n `;\n }\n\n /**\n * Render the component\n */\n render() {\n return html`\n <div class=\"container\" part=\"container\">\n ${this.renderDeviceSection(\n 'microphone',\n 'Microphone',\n this._audioInputDevices,\n this._selectedAudioInput\n )}\n ${this.renderAudioPreview()}\n ${this.renderDeviceSection(\n 'camera',\n 'Camera',\n this._videoInputDevices,\n this._selectedVideoInput\n )}\n ${this.renderVideoPreview()}\n ${this.renderDeviceSection(\n 'speaker',\n 'Speaker',\n this._audioOutputDevices,\n this._selectedAudioOutput\n )}\n\n <div class=\"device-section\">\n <button\n class=\"test-speaker-btn\"\n @click=${this.testSpeaker}\n ?disabled=${this._isTestingAudio}\n aria-label=\"Test speaker\"\n >\n ${this._isTestingAudio ? 'Playing...' : 'Test Speaker'}\n </button>\n </div>\n </div>\n `;\n }\n}\n\n/**\n * Declare global type for TypeScript\n */\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sw-device-selector': DeviceSelector;\n }\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","import { config } from '../config';\nvar context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n var isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n var _a = context, errorThrown = _a.errorThrown, error = _a.error;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","export var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nvar Observable = (function () {\n function Observable(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var _this = this;\n var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(function () {\n var _a = _this, operator = _a.operator, source = _a.source;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n _this._subscribe(subscriber)\n :\n _this._trySubscribe(subscriber));\n });\n return subscriber;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n _this.subscribe(subscriber);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { isFunction } from './isFunction';\nexport function hasLift(source) {\n return isFunction(source === null || source === void 0 ? void 0 : source.lift);\n}\nexport function operate(init) {\n return function (source) {\n if (hasLift(source)) {\n return source.lift(function (liftedSource) {\n try {\n return init(liftedSource, this);\n }\n catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n//# sourceMappingURL=lift.js.map","import { __extends } from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\nvar OperatorSubscriber = (function (_super) {\n __extends(OperatorSubscriber, _super);\n function OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {\n var _this = _super.call(this, destination) || this;\n _this.onFinalize = onFinalize;\n _this.shouldUnsubscribe = shouldUnsubscribe;\n _this._next = onNext\n ? function (value) {\n try {\n onNext(value);\n }\n catch (err) {\n destination.error(err);\n }\n }\n : _super.prototype._next;\n _this._error = onError\n ? function (err) {\n try {\n onError(err);\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._error;\n _this._complete = onComplete\n ? function () {\n try {\n onComplete();\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._complete;\n return _this;\n }\n OperatorSubscriber.prototype.unsubscribe = function () {\n var _a;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var closed_1 = this.closed;\n _super.prototype.unsubscribe.call(this);\n !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));\n }\n };\n return OperatorSubscriber;\n}(Subscriber));\nexport { OperatorSubscriber };\n//# sourceMappingURL=OperatorSubscriber.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { Subscription } from '../Subscription';\nexport var animationFrameProvider = {\n schedule: function (callback) {\n var request = requestAnimationFrame;\n var cancel = cancelAnimationFrame;\n var delegate = animationFrameProvider.delegate;\n if (delegate) {\n request = delegate.requestAnimationFrame;\n cancel = delegate.cancelAnimationFrame;\n }\n var handle = request(function (timestamp) {\n cancel = undefined;\n callback(timestamp);\n });\n return new Subscription(function () { return cancel === null || cancel === void 0 ? void 0 : cancel(handle); });\n },\n requestAnimationFrame: function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var delegate = animationFrameProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.requestAnimationFrame) || requestAnimationFrame).apply(void 0, __spreadArray([], __read(args)));\n },\n cancelAnimationFrame: function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var delegate = animationFrameProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.cancelAnimationFrame) || cancelAnimationFrame).apply(void 0, __spreadArray([], __read(args)));\n },\n delegate: undefined,\n};\n//# sourceMappingURL=animationFrameProvider.js.map","import { createErrorClass } from './createErrorClass';\nexport var ObjectUnsubscribedError = createErrorClass(function (_super) {\n return function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n };\n});\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","import { __extends, __values } from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.closed = false;\n _this.currentObservers = null;\n _this.observers = [];\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype._throwIfClosed = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n };\n Subject.prototype.next = function (value) {\n var _this = this;\n errorContext(function () {\n var e_1, _a;\n _this._throwIfClosed();\n if (!_this.isStopped) {\n if (!_this.currentObservers) {\n _this.currentObservers = Array.from(_this.observers);\n }\n try {\n for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {\n var observer = _c.value;\n observer.next(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n });\n };\n Subject.prototype.error = function (err) {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.hasError = _this.isStopped = true;\n _this.thrownError = err;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n };\n Subject.prototype.complete = function () {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.isStopped = true;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n };\n Object.defineProperty(Subject.prototype, \"observed\", {\n get: function () {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n },\n enumerable: false,\n configurable: true\n });\n Subject.prototype._trySubscribe = function (subscriber) {\n this._throwIfClosed();\n return _super.prototype._trySubscribe.call(this, subscriber);\n };\n Subject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n };\n Subject.prototype._innerSubscribe = function (subscriber) {\n var _this = this;\n var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(function () {\n _this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n };\n Subject.prototype._checkFinalizedStatuses = function (subscriber) {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;\n if (hasError) {\n subscriber.error(thrownError);\n }\n else if (isStopped) {\n subscriber.complete();\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n };\n AnonymousSubject.prototype.error = function (err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n };\n AnonymousSubject.prototype.complete = function () {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n//# sourceMappingURL=Subject.js.map","import { __extends } from \"tslib\";\nimport { Subject } from './Subject';\nvar BehaviorSubject = (function (_super) {\n __extends(BehaviorSubject, _super);\n function BehaviorSubject(_value) {\n var _this = _super.call(this) || this;\n _this._value = _value;\n return _this;\n }\n Object.defineProperty(BehaviorSubject.prototype, \"value\", {\n get: function () {\n return this.getValue();\n },\n enumerable: false,\n configurable: true\n });\n BehaviorSubject.prototype._subscribe = function (subscriber) {\n var subscription = _super.prototype._subscribe.call(this, subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n };\n BehaviorSubject.prototype.getValue = function () {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, _value = _a._value;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n };\n BehaviorSubject.prototype.next = function (value) {\n _super.prototype.next.call(this, (this._value = value));\n };\n return BehaviorSubject;\n}(Subject));\nexport { BehaviorSubject };\n//# sourceMappingURL=BehaviorSubject.js.map","export var dateTimestampProvider = {\n now: function () {\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n//# sourceMappingURL=dateTimestampProvider.js.map","import { __extends } from \"tslib\";\nimport { Subject } from './Subject';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nvar ReplaySubject = (function (_super) {\n __extends(ReplaySubject, _super);\n function ReplaySubject(_bufferSize, _windowTime, _timestampProvider) {\n if (_bufferSize === void 0) { _bufferSize = Infinity; }\n if (_windowTime === void 0) { _windowTime = Infinity; }\n if (_timestampProvider === void 0) { _timestampProvider = dateTimestampProvider; }\n var _this = _super.call(this) || this;\n _this._bufferSize = _bufferSize;\n _this._windowTime = _windowTime;\n _this._timestampProvider = _timestampProvider;\n _this._buffer = [];\n _this._infiniteTimeWindow = true;\n _this._infiniteTimeWindow = _windowTime === Infinity;\n _this._bufferSize = Math.max(1, _bufferSize);\n _this._windowTime = Math.max(1, _windowTime);\n return _this;\n }\n ReplaySubject.prototype.next = function (value) {\n var _a = this, isStopped = _a.isStopped, _buffer = _a._buffer, _infiniteTimeWindow = _a._infiniteTimeWindow, _timestampProvider = _a._timestampProvider, _windowTime = _a._windowTime;\n if (!isStopped) {\n _buffer.push(value);\n !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);\n }\n this._trimBuffer();\n _super.prototype.next.call(this, value);\n };\n ReplaySubject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._trimBuffer();\n var subscription = this._innerSubscribe(subscriber);\n var _a = this, _infiniteTimeWindow = _a._infiniteTimeWindow, _buffer = _a._buffer;\n var copy = _buffer.slice();\n for (var i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) {\n subscriber.next(copy[i]);\n }\n this._checkFinalizedStatuses(subscriber);\n return subscription;\n };\n ReplaySubject.prototype._trimBuffer = function () {\n var _a = this, _bufferSize = _a._bufferSize, _timestampProvider = _a._timestampProvider, _buffer = _a._buffer, _infiniteTimeWindow = _a._infiniteTimeWindow;\n var adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;\n _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);\n if (!_infiniteTimeWindow) {\n var now = _timestampProvider.now();\n var last = 0;\n for (var i = 1; i < _buffer.length && _buffer[i] <= now; i += 2) {\n last = i;\n }\n last && _buffer.splice(0, last + 1);\n }\n };\n return ReplaySubject;\n}(Subject));\nexport { ReplaySubject };\n//# sourceMappingURL=ReplaySubject.js.map","import { __extends } from \"tslib\";\nimport { Subscription } from '../Subscription';\nvar Action = (function (_super) {\n __extends(Action, _super);\n function Action(scheduler, work) {\n return _super.call(this) || this;\n }\n Action.prototype.schedule = function (state, delay) {\n if (delay === void 0) { delay = 0; }\n return this;\n };\n return Action;\n}(Subscription));\nexport { Action };\n//# sourceMappingURL=Action.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var intervalProvider = {\n setInterval: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = intervalProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {\n return delegate.setInterval.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setInterval.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearInterval: function (handle) {\n var delegate = intervalProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=intervalProvider.js.map","import { __extends } from \"tslib\";\nimport { Action } from './Action';\nimport { intervalProvider } from './intervalProvider';\nimport { arrRemove } from '../util/arrRemove';\nvar AsyncAction = (function (_super) {\n __extends(AsyncAction, _super);\n function AsyncAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n _this.pending = false;\n return _this;\n }\n AsyncAction.prototype.schedule = function (state, delay) {\n var _a;\n if (delay === void 0) { delay = 0; }\n if (this.closed) {\n return this;\n }\n this.state = state;\n var id = this.id;\n var scheduler = this.scheduler;\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.pending = true;\n this.delay = delay;\n this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);\n return this;\n };\n AsyncAction.prototype.requestAsyncId = function (scheduler, _id, delay) {\n if (delay === void 0) { delay = 0; }\n return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);\n };\n AsyncAction.prototype.recycleAsyncId = function (_scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n if (delay != null && this.delay === delay && this.pending === false) {\n return id;\n }\n if (id != null) {\n intervalProvider.clearInterval(id);\n }\n return undefined;\n };\n AsyncAction.prototype.execute = function (state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n var error = this._execute(state, delay);\n if (error) {\n return error;\n }\n else if (this.pending === false && this.id != null) {\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n };\n AsyncAction.prototype._execute = function (state, _delay) {\n var errored = false;\n var errorValue;\n try {\n this.work(state);\n }\n catch (e) {\n errored = true;\n errorValue = e ? e : new Error('Scheduled action threw falsy error');\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n };\n AsyncAction.prototype.unsubscribe = function () {\n if (!this.closed) {\n var _a = this, id = _a.id, scheduler = _a.scheduler;\n var actions = scheduler.actions;\n this.work = this.state = this.scheduler = null;\n this.pending = false;\n arrRemove(actions, this);\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n _super.prototype.unsubscribe.call(this);\n }\n };\n return AsyncAction;\n}(Action));\nexport { AsyncAction };\n//# sourceMappingURL=AsyncAction.js.map","var nextHandle = 1;\nvar resolved;\nvar activeHandles = {};\nfunction findAndClearHandle(handle) {\n if (handle in activeHandles) {\n delete activeHandles[handle];\n return true;\n }\n return false;\n}\nexport var Immediate = {\n setImmediate: function (cb) {\n var handle = nextHandle++;\n activeHandles[handle] = true;\n if (!resolved) {\n resolved = Promise.resolve();\n }\n resolved.then(function () { return findAndClearHandle(handle) && cb(); });\n return handle;\n },\n clearImmediate: function (handle) {\n findAndClearHandle(handle);\n },\n};\nexport var TestTools = {\n pending: function () {\n return Object.keys(activeHandles).length;\n }\n};\n//# sourceMappingURL=Immediate.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { Immediate } from '../util/Immediate';\nvar setImmediate = Immediate.setImmediate, clearImmediate = Immediate.clearImmediate;\nexport var immediateProvider = {\n setImmediate: function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var delegate = immediateProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.setImmediate) || setImmediate).apply(void 0, __spreadArray([], __read(args)));\n },\n clearImmediate: function (handle) {\n var delegate = immediateProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearImmediate) || clearImmediate)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=immediateProvider.js.map","import { __extends } from \"tslib\";\nimport { AsyncAction } from './AsyncAction';\nimport { immediateProvider } from './immediateProvider';\nvar AsapAction = (function (_super) {\n __extends(AsapAction, _super);\n function AsapAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n return _this;\n }\n AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n if (delay !== null && delay > 0) {\n return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);\n }\n scheduler.actions.push(this);\n return scheduler._scheduled || (scheduler._scheduled = immediateProvider.setImmediate(scheduler.flush.bind(scheduler, undefined)));\n };\n AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n var _a;\n if (delay === void 0) { delay = 0; }\n if (delay != null ? delay > 0 : this.delay > 0) {\n return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);\n }\n var actions = scheduler.actions;\n if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {\n immediateProvider.clearImmediate(id);\n if (scheduler._scheduled === id) {\n scheduler._scheduled = undefined;\n }\n }\n return undefined;\n };\n return AsapAction;\n}(AsyncAction));\nexport { AsapAction };\n//# sourceMappingURL=AsapAction.js.map","import { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nvar Scheduler = (function () {\n function Scheduler(schedulerActionCtor, now) {\n if (now === void 0) { now = Scheduler.now; }\n this.schedulerActionCtor = schedulerActionCtor;\n this.now = now;\n }\n Scheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) { delay = 0; }\n return new this.schedulerActionCtor(this, work).schedule(state, delay);\n };\n Scheduler.now = dateTimestampProvider.now;\n return Scheduler;\n}());\nexport { Scheduler };\n//# sourceMappingURL=Scheduler.js.map","import { __extends } from \"tslib\";\nimport { Scheduler } from '../Scheduler';\nvar AsyncScheduler = (function (_super) {\n __extends(AsyncScheduler, _super);\n function AsyncScheduler(SchedulerAction, now) {\n if (now === void 0) { now = Scheduler.now; }\n var _this = _super.call(this, SchedulerAction, now) || this;\n _this.actions = [];\n _this._active = false;\n return _this;\n }\n AsyncScheduler.prototype.flush = function (action) {\n var actions = this.actions;\n if (this._active) {\n actions.push(action);\n return;\n }\n var error;\n this._active = true;\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions.shift()));\n this._active = false;\n if (error) {\n while ((action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsyncScheduler;\n}(Scheduler));\nexport { AsyncScheduler };\n//# sourceMappingURL=AsyncScheduler.js.map","import { __extends } from \"tslib\";\nimport { AsyncScheduler } from './AsyncScheduler';\nvar AsapScheduler = (function (_super) {\n __extends(AsapScheduler, _super);\n function AsapScheduler() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AsapScheduler.prototype.flush = function (action) {\n this._active = true;\n var flushId = this._scheduled;\n this._scheduled = undefined;\n var actions = this.actions;\n var error;\n action = action || actions.shift();\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions[0]) && action.id === flushId && actions.shift());\n this._active = false;\n if (error) {\n while ((action = actions[0]) && action.id === flushId && actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsapScheduler;\n}(AsyncScheduler));\nexport { AsapScheduler };\n//# sourceMappingURL=AsapScheduler.js.map","import { AsapAction } from './AsapAction';\nimport { AsapScheduler } from './AsapScheduler';\nexport var asapScheduler = new AsapScheduler(AsapAction);\nexport var asap = asapScheduler;\n//# sourceMappingURL=asap.js.map","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport var asyncScheduler = new AsyncScheduler(AsyncAction);\nexport var async = asyncScheduler;\n//# sourceMappingURL=async.js.map","import { __extends } from \"tslib\";\nimport { AsyncAction } from './AsyncAction';\nimport { animationFrameProvider } from './animationFrameProvider';\nvar AnimationFrameAction = (function (_super) {\n __extends(AnimationFrameAction, _super);\n function AnimationFrameAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n return _this;\n }\n AnimationFrameAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n if (delay !== null && delay > 0) {\n return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);\n }\n scheduler.actions.push(this);\n return scheduler._scheduled || (scheduler._scheduled = animationFrameProvider.requestAnimationFrame(function () { return scheduler.flush(undefined); }));\n };\n AnimationFrameAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n var _a;\n if (delay === void 0) { delay = 0; }\n if (delay != null ? delay > 0 : this.delay > 0) {\n return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);\n }\n var actions = scheduler.actions;\n if (id != null && id === scheduler._scheduled && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {\n animationFrameProvider.cancelAnimationFrame(id);\n scheduler._scheduled = undefined;\n }\n return undefined;\n };\n return AnimationFrameAction;\n}(AsyncAction));\nexport { AnimationFrameAction };\n//# sourceMappingURL=AnimationFrameAction.js.map","import { __extends } from \"tslib\";\nimport { AsyncScheduler } from './AsyncScheduler';\nvar AnimationFrameScheduler = (function (_super) {\n __extends(AnimationFrameScheduler, _super);\n function AnimationFrameScheduler() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AnimationFrameScheduler.prototype.flush = function (action) {\n this._active = true;\n var flushId;\n if (action) {\n flushId = action.id;\n }\n else {\n flushId = this._scheduled;\n this._scheduled = undefined;\n }\n var actions = this.actions;\n var error;\n action = action || actions.shift();\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions[0]) && action.id === flushId && actions.shift());\n this._active = false;\n if (error) {\n while ((action = actions[0]) && action.id === flushId && actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AnimationFrameScheduler;\n}(AsyncScheduler));\nexport { AnimationFrameScheduler };\n//# sourceMappingURL=AnimationFrameScheduler.js.map","import { AnimationFrameAction } from './AnimationFrameAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\nexport var animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction);\nexport var animationFrame = animationFrameScheduler;\n//# sourceMappingURL=animationFrame.js.map","import { Observable } from '../Observable';\nexport var EMPTY = new Observable(function (subscriber) { return subscriber.complete(); });\nexport function empty(scheduler) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\nfunction emptyScheduled(scheduler) {\n return new Observable(function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });\n}\n//# sourceMappingURL=empty.js.map","import { isFunction } from './isFunction';\nexport function isScheduler(value) {\n return value && isFunction(value.schedule);\n}\n//# sourceMappingURL=isScheduler.js.map","import { isFunction } from './isFunction';\nimport { isScheduler } from './isScheduler';\nfunction last(arr) {\n return arr[arr.length - 1];\n}\nexport function popResultSelector(args) {\n return isFunction(last(args)) ? args.pop() : undefined;\n}\nexport function popScheduler(args) {\n return isScheduler(last(args)) ? args.pop() : undefined;\n}\nexport function popNumber(args, defaultValue) {\n return typeof last(args) === 'number' ? args.pop() : defaultValue;\n}\n//# sourceMappingURL=args.js.map","export var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });\n//# sourceMappingURL=isArrayLike.js.map","import { isFunction } from \"./isFunction\";\nexport function isPromise(value) {\n return isFunction(value === null || value === void 0 ? void 0 : value.then);\n}\n//# sourceMappingURL=isPromise.js.map","import { observable as Symbol_observable } from '../symbol/observable';\nimport { isFunction } from './isFunction';\nexport function isInteropObservable(input) {\n return isFunction(input[Symbol_observable]);\n}\n//# sourceMappingURL=isInteropObservable.js.map","import { isFunction } from './isFunction';\nexport function isAsyncIterable(obj) {\n return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);\n}\n//# sourceMappingURL=isAsyncIterable.js.map","export function createInvalidObservableTypeError(input) {\n return new TypeError(\"You provided \" + (input !== null && typeof input === 'object' ? 'an invalid object' : \"'\" + input + \"'\") + \" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.\");\n}\n//# sourceMappingURL=throwUnobservableError.js.map","export function getSymbolIterator() {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator';\n }\n return Symbol.iterator;\n}\nexport var iterator = getSymbolIterator();\n//# sourceMappingURL=iterator.js.map","import { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from './isFunction';\nexport function isIterable(input) {\n return isFunction(input === null || input === void 0 ? void 0 : input[Symbol_iterator]);\n}\n//# sourceMappingURL=isIterable.js.map","import { __asyncGenerator, __await, __generator } from \"tslib\";\nimport { isFunction } from './isFunction';\nexport function readableStreamLikeToAsyncGenerator(readableStream) {\n return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {\n var reader, _a, value, done;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n reader = readableStream.getReader();\n _b.label = 1;\n case 1:\n _b.trys.push([1, , 9, 10]);\n _b.label = 2;\n case 2:\n if (!true) return [3, 8];\n return [4, __await(reader.read())];\n case 3:\n _a = _b.sent(), value = _a.value, done = _a.done;\n if (!done) return [3, 5];\n return [4, __await(void 0)];\n case 4: return [2, _b.sent()];\n case 5: return [4, __await(value)];\n case 6: return [4, _b.sent()];\n case 7:\n _b.sent();\n return [3, 2];\n case 8: return [3, 10];\n case 9:\n reader.releaseLock();\n return [7];\n case 10: return [2];\n }\n });\n });\n}\nexport function isReadableStreamLike(obj) {\n return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);\n}\n//# sourceMappingURL=isReadableStreamLike.js.map","import { __asyncValues, __awaiter, __generator, __values } from \"tslib\";\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isPromise } from '../util/isPromise';\nimport { Observable } from '../Observable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isIterable } from '../util/isIterable';\nimport { isReadableStreamLike, readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nimport { isFunction } from '../util/isFunction';\nimport { reportUnhandledError } from '../util/reportUnhandledError';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function innerFrom(input) {\n if (input instanceof Observable) {\n return input;\n }\n if (input != null) {\n if (isInteropObservable(input)) {\n return fromInteropObservable(input);\n }\n if (isArrayLike(input)) {\n return fromArrayLike(input);\n }\n if (isPromise(input)) {\n return fromPromise(input);\n }\n if (isAsyncIterable(input)) {\n return fromAsyncIterable(input);\n }\n if (isIterable(input)) {\n return fromIterable(input);\n }\n if (isReadableStreamLike(input)) {\n return fromReadableStreamLike(input);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\nexport function fromInteropObservable(obj) {\n return new Observable(function (subscriber) {\n var obs = obj[Symbol_observable]();\n if (isFunction(obs.subscribe)) {\n return obs.subscribe(subscriber);\n }\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n });\n}\nexport function fromArrayLike(array) {\n return new Observable(function (subscriber) {\n for (var i = 0; i < array.length && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n });\n}\nexport function fromPromise(promise) {\n return new Observable(function (subscriber) {\n promise\n .then(function (value) {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) { return subscriber.error(err); })\n .then(null, reportUnhandledError);\n });\n}\nexport function fromIterable(iterable) {\n return new Observable(function (subscriber) {\n var e_1, _a;\n try {\n for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {\n var value = iterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n subscriber.complete();\n });\n}\nexport function fromAsyncIterable(asyncIterable) {\n return new Observable(function (subscriber) {\n process(asyncIterable, subscriber).catch(function (err) { return subscriber.error(err); });\n });\n}\nexport function fromReadableStreamLike(readableStream) {\n return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));\n}\nfunction process(asyncIterable, subscriber) {\n var asyncIterable_1, asyncIterable_1_1;\n var e_2, _a;\n return __awaiter(this, void 0, void 0, function () {\n var value, e_2_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 5, 6, 11]);\n asyncIterable_1 = __asyncValues(asyncIterable);\n _b.label = 1;\n case 1: return [4, asyncIterable_1.next()];\n case 2:\n if (!(asyncIterable_1_1 = _b.sent(), !asyncIterable_1_1.done)) return [3, 4];\n value = asyncIterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return [2];\n }\n _b.label = 3;\n case 3: return [3, 1];\n case 4: return [3, 11];\n case 5:\n e_2_1 = _b.sent();\n e_2 = { error: e_2_1 };\n return [3, 11];\n case 6:\n _b.trys.push([6, , 9, 10]);\n if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return))) return [3, 8];\n return [4, _a.call(asyncIterable_1)];\n case 7:\n _b.sent();\n _b.label = 8;\n case 8: return [3, 10];\n case 9:\n if (e_2) throw e_2.error;\n return [7];\n case 10: return [7];\n case 11:\n subscriber.complete();\n return [2];\n }\n });\n });\n}\n//# sourceMappingURL=innerFrom.js.map","export function executeSchedule(parentSubscription, scheduler, work, delay, repeat) {\n if (delay === void 0) { delay = 0; }\n if (repeat === void 0) { repeat = false; }\n var scheduleSubscription = scheduler.schedule(function () {\n work();\n if (repeat) {\n parentSubscription.add(this.schedule(null, delay));\n }\n else {\n this.unsubscribe();\n }\n }, delay);\n parentSubscription.add(scheduleSubscription);\n if (!repeat) {\n return scheduleSubscription;\n }\n}\n//# sourceMappingURL=executeSchedule.js.map","import { executeSchedule } from '../util/executeSchedule';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function observeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return operate(function (source, subscriber) {\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return executeSchedule(subscriber, scheduler, function () { return subscriber.next(value); }, delay); }, function () { return executeSchedule(subscriber, scheduler, function () { return subscriber.complete(); }, delay); }, function (err) { return executeSchedule(subscriber, scheduler, function () { return subscriber.error(err); }, delay); }));\n });\n}\n//# sourceMappingURL=observeOn.js.map","import { operate } from '../util/lift';\nexport function subscribeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return operate(function (source, subscriber) {\n subscriber.add(scheduler.schedule(function () { return source.subscribe(subscriber); }, delay));\n });\n}\n//# sourceMappingURL=subscribeOn.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { observeOn } from '../operators/observeOn';\nimport { subscribeOn } from '../operators/subscribeOn';\nexport function scheduleObservable(input, scheduler) {\n return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));\n}\n//# sourceMappingURL=scheduleObservable.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { observeOn } from '../operators/observeOn';\nimport { subscribeOn } from '../operators/subscribeOn';\nexport function schedulePromise(input, scheduler) {\n return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));\n}\n//# sourceMappingURL=schedulePromise.js.map","import { Observable } from '../Observable';\nexport function scheduleArray(input, scheduler) {\n return new Observable(function (subscriber) {\n var i = 0;\n return scheduler.schedule(function () {\n if (i === input.length) {\n subscriber.complete();\n }\n else {\n subscriber.next(input[i++]);\n if (!subscriber.closed) {\n this.schedule();\n }\n }\n });\n });\n}\n//# sourceMappingURL=scheduleArray.js.map","import { Observable } from '../Observable';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from '../util/isFunction';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleIterable(input, scheduler) {\n return new Observable(function (subscriber) {\n var iterator;\n executeSchedule(subscriber, scheduler, function () {\n iterator = input[Symbol_iterator]();\n executeSchedule(subscriber, scheduler, function () {\n var _a;\n var value;\n var done;\n try {\n (_a = iterator.next(), value = _a.value, done = _a.done);\n }\n catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n }\n else {\n subscriber.next(value);\n }\n }, 0, true);\n });\n return function () { return isFunction(iterator === null || iterator === void 0 ? void 0 : iterator.return) && iterator.return(); };\n });\n}\n//# sourceMappingURL=scheduleIterable.js.map","import { Observable } from '../Observable';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleAsyncIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable(function (subscriber) {\n executeSchedule(subscriber, scheduler, function () {\n var iterator = input[Symbol.asyncIterator]();\n executeSchedule(subscriber, scheduler, function () {\n iterator.next().then(function (result) {\n if (result.done) {\n subscriber.complete();\n }\n else {\n subscriber.next(result.value);\n }\n });\n }, 0, true);\n });\n });\n}\n//# sourceMappingURL=scheduleAsyncIterable.js.map","import { scheduleAsyncIterable } from './scheduleAsyncIterable';\nimport { readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nexport function scheduleReadableStreamLike(input, scheduler) {\n return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);\n}\n//# sourceMappingURL=scheduleReadableStreamLike.js.map","import { scheduleObservable } from './scheduleObservable';\nimport { schedulePromise } from './schedulePromise';\nimport { scheduleArray } from './scheduleArray';\nimport { scheduleIterable } from './scheduleIterable';\nimport { scheduleAsyncIterable } from './scheduleAsyncIterable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isPromise } from '../util/isPromise';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isIterable } from '../util/isIterable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isReadableStreamLike } from '../util/isReadableStreamLike';\nimport { scheduleReadableStreamLike } from './scheduleReadableStreamLike';\nexport function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n if (isArrayLike(input)) {\n return scheduleArray(input, scheduler);\n }\n if (isPromise(input)) {\n return schedulePromise(input, scheduler);\n }\n if (isAsyncIterable(input)) {\n return scheduleAsyncIterable(input, scheduler);\n }\n if (isIterable(input)) {\n return scheduleIterable(input, scheduler);\n }\n if (isReadableStreamLike(input)) {\n return scheduleReadableStreamLike(input, scheduler);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\n//# sourceMappingURL=scheduled.js.map","import { scheduled } from '../scheduled/scheduled';\nimport { innerFrom } from './innerFrom';\nexport function from(input, scheduler) {\n return scheduler ? scheduled(input, scheduler) : innerFrom(input);\n}\n//# sourceMappingURL=from.js.map","import { popScheduler } from '../util/args';\nimport { from } from './from';\nexport function of() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = popScheduler(args);\n return from(args, scheduler);\n}\n//# sourceMappingURL=of.js.map","import { Observable } from '../Observable';\nimport { isFunction } from '../util/isFunction';\nexport function throwError(errorOrErrorFactory, scheduler) {\n var errorFactory = isFunction(errorOrErrorFactory) ? errorOrErrorFactory : function () { return errorOrErrorFactory; };\n var init = function (subscriber) { return subscriber.error(errorFactory()); };\n return new Observable(scheduler ? function (subscriber) { return scheduler.schedule(init, 0, subscriber); } : init);\n}\n//# sourceMappingURL=throwError.js.map","import { createErrorClass } from './createErrorClass';\nexport var EmptyError = createErrorClass(function (_super) {\n return function EmptyErrorImpl() {\n _super(this);\n this.name = 'EmptyError';\n this.message = 'no elements in sequence';\n };\n});\n//# sourceMappingURL=EmptyError.js.map","import { EmptyError } from './util/EmptyError';\nexport function lastValueFrom(source, config) {\n var hasConfig = typeof config === 'object';\n return new Promise(function (resolve, reject) {\n var _hasValue = false;\n var _value;\n source.subscribe({\n next: function (value) {\n _value = value;\n _hasValue = true;\n },\n error: reject,\n complete: function () {\n if (_hasValue) {\n resolve(_value);\n }\n else if (hasConfig) {\n resolve(config.defaultValue);\n }\n else {\n reject(new EmptyError());\n }\n },\n });\n });\n}\n//# sourceMappingURL=lastValueFrom.js.map","import { EmptyError } from './util/EmptyError';\nimport { SafeSubscriber } from './Subscriber';\nexport function firstValueFrom(source, config) {\n var hasConfig = typeof config === 'object';\n return new Promise(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n resolve(value);\n subscriber.unsubscribe();\n },\n error: reject,\n complete: function () {\n if (hasConfig) {\n resolve(config.defaultValue);\n }\n else {\n reject(new EmptyError());\n }\n },\n });\n source.subscribe(subscriber);\n });\n}\n//# sourceMappingURL=firstValueFrom.js.map","export function isValidDate(value) {\n return value instanceof Date && !isNaN(value);\n}\n//# sourceMappingURL=isDate.js.map","import { asyncScheduler } from '../scheduler/async';\nimport { isValidDate } from '../util/isDate';\nimport { operate } from '../util/lift';\nimport { innerFrom } from '../observable/innerFrom';\nimport { createErrorClass } from '../util/createErrorClass';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { executeSchedule } from '../util/executeSchedule';\nexport var TimeoutError = createErrorClass(function (_super) {\n return function TimeoutErrorImpl(info) {\n if (info === void 0) { info = null; }\n _super(this);\n this.message = 'Timeout has occurred';\n this.name = 'TimeoutError';\n this.info = info;\n };\n});\nexport function timeout(config, schedulerArg) {\n var _a = (isValidDate(config) ? { first: config } : typeof config === 'number' ? { each: config } : config), first = _a.first, each = _a.each, _b = _a.with, _with = _b === void 0 ? timeoutErrorFactory : _b, _c = _a.scheduler, scheduler = _c === void 0 ? schedulerArg !== null && schedulerArg !== void 0 ? schedulerArg : asyncScheduler : _c, _d = _a.meta, meta = _d === void 0 ? null : _d;\n if (first == null && each == null) {\n throw new TypeError('No timeout provided.');\n }\n return operate(function (source, subscriber) {\n var originalSourceSubscription;\n var timerSubscription;\n var lastValue = null;\n var seen = 0;\n var startTimer = function (delay) {\n timerSubscription = executeSchedule(subscriber, scheduler, function () {\n try {\n originalSourceSubscription.unsubscribe();\n innerFrom(_with({\n meta: meta,\n lastValue: lastValue,\n seen: seen,\n })).subscribe(subscriber);\n }\n catch (err) {\n subscriber.error(err);\n }\n }, delay);\n };\n originalSourceSubscription = source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();\n seen++;\n subscriber.next((lastValue = value));\n each > 0 && startTimer(each);\n }, undefined, undefined, function () {\n if (!(timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.closed)) {\n timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();\n }\n lastValue = null;\n }));\n !seen && startTimer(first != null ? (typeof first === 'number' ? first : +first - scheduler.now()) : each);\n });\n}\nfunction timeoutErrorFactory(info) {\n throw new TimeoutError(info);\n}\n//# sourceMappingURL=timeout.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function map(project, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n subscriber.next(project.call(thisArg, value, index++));\n }));\n });\n}\n//# sourceMappingURL=map.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { map } from \"../operators/map\";\nvar isArray = Array.isArray;\nfunction callOrApply(fn, args) {\n return isArray(args) ? fn.apply(void 0, __spreadArray([], __read(args))) : fn(args);\n}\nexport function mapOneOrManyArgs(fn) {\n return map(function (args) { return callOrApply(fn, args); });\n}\n//# sourceMappingURL=mapOneOrManyArgs.js.map","var isArray = Array.isArray;\nvar getPrototypeOf = Object.getPrototypeOf, objectProto = Object.prototype, getKeys = Object.keys;\nexport function argsArgArrayOrObject(args) {\n if (args.length === 1) {\n var first_1 = args[0];\n if (isArray(first_1)) {\n return { args: first_1, keys: null };\n }\n if (isPOJO(first_1)) {\n var keys = getKeys(first_1);\n return {\n args: keys.map(function (key) { return first_1[key]; }),\n keys: keys,\n };\n }\n }\n return { args: args, keys: null };\n}\nfunction isPOJO(obj) {\n return obj && typeof obj === 'object' && getPrototypeOf(obj) === objectProto;\n}\n//# sourceMappingURL=argsArgArrayOrObject.js.map","export function createObject(keys, values) {\n return keys.reduce(function (result, key, i) { return ((result[key] = values[i]), result); }, {});\n}\n//# sourceMappingURL=createObject.js.map","import { Observable } from '../Observable';\nimport { argsArgArrayOrObject } from '../util/argsArgArrayOrObject';\nimport { from } from './from';\nimport { identity } from '../util/identity';\nimport { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';\nimport { popResultSelector, popScheduler } from '../util/args';\nimport { createObject } from '../util/createObject';\nimport { createOperatorSubscriber } from '../operators/OperatorSubscriber';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function combineLatest() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = popScheduler(args);\n var resultSelector = popResultSelector(args);\n var _a = argsArgArrayOrObject(args), observables = _a.args, keys = _a.keys;\n if (observables.length === 0) {\n return from([], scheduler);\n }\n var result = new Observable(combineLatestInit(observables, scheduler, keys\n ?\n function (values) { return createObject(keys, values); }\n :\n identity));\n return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;\n}\nexport function combineLatestInit(observables, scheduler, valueTransform) {\n if (valueTransform === void 0) { valueTransform = identity; }\n return function (subscriber) {\n maybeSchedule(scheduler, function () {\n var length = observables.length;\n var values = new Array(length);\n var active = length;\n var remainingFirstValues = length;\n var _loop_1 = function (i) {\n maybeSchedule(scheduler, function () {\n var source = from(observables[i], scheduler);\n var hasFirstValue = false;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n values[i] = value;\n if (!hasFirstValue) {\n hasFirstValue = true;\n remainingFirstValues--;\n }\n if (!remainingFirstValues) {\n subscriber.next(valueTransform(values.slice()));\n }\n }, function () {\n if (!--active) {\n subscriber.complete();\n }\n }));\n }, subscriber);\n };\n for (var i = 0; i < length; i++) {\n _loop_1(i);\n }\n }, subscriber);\n };\n}\nfunction maybeSchedule(scheduler, execute, subscription) {\n if (scheduler) {\n executeSchedule(subscription, scheduler, execute);\n }\n else {\n execute();\n }\n}\n//# sourceMappingURL=combineLatest.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { executeSchedule } from '../util/executeSchedule';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {\n var buffer = [];\n var active = 0;\n var index = 0;\n var isComplete = false;\n var checkComplete = function () {\n if (isComplete && !buffer.length && !active) {\n subscriber.complete();\n }\n };\n var outerNext = function (value) { return (active < concurrent ? doInnerSub(value) : buffer.push(value)); };\n var doInnerSub = function (value) {\n expand && subscriber.next(value);\n active++;\n var innerComplete = false;\n innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, function (innerValue) {\n onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);\n if (expand) {\n outerNext(innerValue);\n }\n else {\n subscriber.next(innerValue);\n }\n }, function () {\n innerComplete = true;\n }, undefined, function () {\n if (innerComplete) {\n try {\n active--;\n var _loop_1 = function () {\n var bufferedValue = buffer.shift();\n if (innerSubScheduler) {\n executeSchedule(subscriber, innerSubScheduler, function () { return doInnerSub(bufferedValue); });\n }\n else {\n doInnerSub(bufferedValue);\n }\n };\n while (buffer.length && active < concurrent) {\n _loop_1();\n }\n checkComplete();\n }\n catch (err) {\n subscriber.error(err);\n }\n }\n }));\n };\n source.subscribe(createOperatorSubscriber(subscriber, outerNext, function () {\n isComplete = true;\n checkComplete();\n }));\n return function () {\n additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();\n };\n}\n//# sourceMappingURL=mergeInternals.js.map","import { map } from './map';\nimport { innerFrom } from '../observable/innerFrom';\nimport { operate } from '../util/lift';\nimport { mergeInternals } from './mergeInternals';\nimport { isFunction } from '../util/isFunction';\nexport function mergeMap(project, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Infinity; }\n if (isFunction(resultSelector)) {\n return mergeMap(function (a, i) { return map(function (b, ii) { return resultSelector(a, b, i, ii); })(innerFrom(project(a, i))); }, concurrent);\n }\n else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return operate(function (source, subscriber) { return mergeInternals(source, subscriber, project, concurrent); });\n}\n//# sourceMappingURL=mergeMap.js.map","import { mergeMap } from './mergeMap';\nimport { identity } from '../util/identity';\nexport function mergeAll(concurrent) {\n if (concurrent === void 0) { concurrent = Infinity; }\n return mergeMap(identity, concurrent);\n}\n//# sourceMappingURL=mergeAll.js.map","import { mergeAll } from './mergeAll';\nexport function concatAll() {\n return mergeAll(1);\n}\n//# sourceMappingURL=concatAll.js.map","import { concatAll } from '../operators/concatAll';\nimport { popScheduler } from '../util/args';\nimport { from } from './from';\nexport function concat() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return concatAll()(from(args, popScheduler(args)));\n}\n//# sourceMappingURL=concat.js.map","import { Observable } from '../Observable';\nimport { innerFrom } from './innerFrom';\nexport function defer(observableFactory) {\n return new Observable(function (subscriber) {\n innerFrom(observableFactory()).subscribe(subscriber);\n });\n}\n//# sourceMappingURL=defer.js.map","import { Observable } from '../Observable';\nimport { async as asyncScheduler } from '../scheduler/async';\nimport { isScheduler } from '../util/isScheduler';\nimport { isValidDate } from '../util/isDate';\nexport function timer(dueTime, intervalOrScheduler, scheduler) {\n if (dueTime === void 0) { dueTime = 0; }\n if (scheduler === void 0) { scheduler = asyncScheduler; }\n var intervalDuration = -1;\n if (intervalOrScheduler != null) {\n if (isScheduler(intervalOrScheduler)) {\n scheduler = intervalOrScheduler;\n }\n else {\n intervalDuration = intervalOrScheduler;\n }\n }\n return new Observable(function (subscriber) {\n var due = isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime;\n if (due < 0) {\n due = 0;\n }\n var n = 0;\n return scheduler.schedule(function () {\n if (!subscriber.closed) {\n subscriber.next(n++);\n if (0 <= intervalDuration) {\n this.schedule(undefined, intervalDuration);\n }\n else {\n subscriber.complete();\n }\n }\n }, due);\n });\n}\n//# sourceMappingURL=timer.js.map","import { asyncScheduler } from '../scheduler/async';\nimport { timer } from './timer';\nexport function interval(period, scheduler) {\n if (period === void 0) { period = 0; }\n if (scheduler === void 0) { scheduler = asyncScheduler; }\n if (period < 0) {\n period = 0;\n }\n return timer(period, period, scheduler);\n}\n//# sourceMappingURL=interval.js.map","import { mergeAll } from '../operators/mergeAll';\nimport { innerFrom } from './innerFrom';\nimport { EMPTY } from './empty';\nimport { popNumber, popScheduler } from '../util/args';\nimport { from } from './from';\nexport function merge() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = popScheduler(args);\n var concurrent = popNumber(args, Infinity);\n var sources = args;\n return !sources.length\n ?\n EMPTY\n : sources.length === 1\n ?\n innerFrom(sources[0])\n :\n mergeAll(concurrent)(from(sources, scheduler));\n}\n//# sourceMappingURL=merge.js.map","import { Observable } from '../Observable';\nimport { noop } from '../util/noop';\nexport var NEVER = new Observable(noop);\nexport function never() {\n return NEVER;\n}\n//# sourceMappingURL=never.js.map","var isArray = Array.isArray;\nexport function argsOrArgArray(args) {\n return args.length === 1 && isArray(args[0]) ? args[0] : args;\n}\n//# sourceMappingURL=argsOrArgArray.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function filter(predicate, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return predicate.call(thisArg, value, index++) && subscriber.next(value); }));\n });\n}\n//# sourceMappingURL=filter.js.map","import { Observable } from '../Observable';\nimport { innerFrom } from './innerFrom';\nimport { argsOrArgArray } from '../util/argsOrArgArray';\nimport { createOperatorSubscriber } from '../operators/OperatorSubscriber';\nexport function race() {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n sources = argsOrArgArray(sources);\n return sources.length === 1 ? innerFrom(sources[0]) : new Observable(raceInit(sources));\n}\nexport function raceInit(sources) {\n return function (subscriber) {\n var subscriptions = [];\n var _loop_1 = function (i) {\n subscriptions.push(innerFrom(sources[i]).subscribe(createOperatorSubscriber(subscriber, function (value) {\n if (subscriptions) {\n for (var s = 0; s < subscriptions.length; s++) {\n s !== i && subscriptions[s].unsubscribe();\n }\n subscriptions = null;\n }\n subscriber.next(value);\n })));\n };\n for (var i = 0; subscriptions && !subscriber.closed && i < sources.length; i++) {\n _loop_1(i);\n }\n };\n}\n//# sourceMappingURL=race.js.map","import { operate } from '../util/lift';\nimport { innerFrom } from '../observable/innerFrom';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function audit(durationSelector) {\n return operate(function (source, subscriber) {\n var hasValue = false;\n var lastValue = null;\n var durationSubscriber = null;\n var isComplete = false;\n var endDuration = function () {\n durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();\n durationSubscriber = null;\n if (hasValue) {\n hasValue = false;\n var value = lastValue;\n lastValue = null;\n subscriber.next(value);\n }\n isComplete && subscriber.complete();\n };\n var cleanupDuration = function () {\n durationSubscriber = null;\n isComplete && subscriber.complete();\n };\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n hasValue = true;\n lastValue = value;\n if (!durationSubscriber) {\n innerFrom(durationSelector(value)).subscribe((durationSubscriber = createOperatorSubscriber(subscriber, endDuration, cleanupDuration)));\n }\n }, function () {\n isComplete = true;\n (!hasValue || !durationSubscriber || durationSubscriber.closed) && subscriber.complete();\n }));\n });\n}\n//# sourceMappingURL=audit.js.map","import { asyncScheduler } from '../scheduler/async';\nimport { audit } from './audit';\nimport { timer } from '../observable/timer';\nexport function auditTime(duration, scheduler) {\n if (scheduler === void 0) { scheduler = asyncScheduler; }\n return audit(function () { return timer(duration, scheduler); });\n}\n//# sourceMappingURL=auditTime.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { operate } from '../util/lift';\nexport function catchError(selector) {\n return operate(function (source, subscriber) {\n var innerSub = null;\n var syncUnsub = false;\n var handledResult;\n innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, undefined, function (err) {\n handledResult = innerFrom(selector(err, catchError(selector)(source)));\n if (innerSub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n else {\n syncUnsub = true;\n }\n }));\n if (syncUnsub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n });\n}\n//# sourceMappingURL=catchError.js.map","import { createOperatorSubscriber } from './OperatorSubscriber';\nexport function scanInternals(accumulator, seed, hasSeed, emitOnNext, emitBeforeComplete) {\n return function (source, subscriber) {\n var hasState = hasSeed;\n var state = seed;\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var i = index++;\n state = hasState\n ?\n accumulator(state, value, i)\n :\n ((hasState = true), value);\n emitOnNext && subscriber.next(state);\n }, emitBeforeComplete &&\n (function () {\n hasState && subscriber.next(state);\n subscriber.complete();\n })));\n };\n}\n//# sourceMappingURL=scanInternals.js.map","import { scanInternals } from './scanInternals';\nimport { operate } from '../util/lift';\nexport function reduce(accumulator, seed) {\n return operate(scanInternals(accumulator, seed, arguments.length >= 2, false, true));\n}\n//# sourceMappingURL=reduce.js.map","import { reduce } from './reduce';\nimport { operate } from '../util/lift';\nvar arrReducer = function (arr, value) { return (arr.push(value), arr); };\nexport function toArray() {\n return operate(function (source, subscriber) {\n reduce(arrReducer, [])(source).subscribe(subscriber);\n });\n}\n//# sourceMappingURL=toArray.js.map","import { asyncScheduler } from '../scheduler/async';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function debounceTime(dueTime, scheduler) {\n if (scheduler === void 0) { scheduler = asyncScheduler; }\n return operate(function (source, subscriber) {\n var activeTask = null;\n var lastValue = null;\n var lastTime = null;\n var emit = function () {\n if (activeTask) {\n activeTask.unsubscribe();\n activeTask = null;\n var value = lastValue;\n lastValue = null;\n subscriber.next(value);\n }\n };\n function emitWhenIdle() {\n var targetTime = lastTime + dueTime;\n var now = scheduler.now();\n if (now < targetTime) {\n activeTask = this.schedule(undefined, targetTime - now);\n subscriber.add(activeTask);\n return;\n }\n emit();\n }\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n lastValue = value;\n lastTime = scheduler.now();\n if (!activeTask) {\n activeTask = scheduler.schedule(emitWhenIdle, dueTime);\n subscriber.add(activeTask);\n }\n }, function () {\n emit();\n subscriber.complete();\n }, undefined, function () {\n lastValue = activeTask = null;\n }));\n });\n}\n//# sourceMappingURL=debounceTime.js.map","import { EMPTY } from '../observable/empty';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function take(count) {\n return count <= 0\n ?\n function () { return EMPTY; }\n : operate(function (source, subscriber) {\n var seen = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n if (++seen <= count) {\n subscriber.next(value);\n if (count <= seen) {\n subscriber.complete();\n }\n }\n }));\n });\n}\n//# sourceMappingURL=take.js.map","import { identity } from '../util/identity';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function distinctUntilChanged(comparator, keySelector) {\n if (keySelector === void 0) { keySelector = identity; }\n comparator = comparator !== null && comparator !== void 0 ? comparator : defaultCompare;\n return operate(function (source, subscriber) {\n var previousKey;\n var first = true;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var currentKey = keySelector(value);\n if (first || !comparator(previousKey, currentKey)) {\n first = false;\n previousKey = currentKey;\n subscriber.next(value);\n }\n }));\n });\n}\nfunction defaultCompare(a, b) {\n return a === b;\n}\n//# sourceMappingURL=distinctUntilChanged.js.map","import { map } from './map';\nimport { innerFrom } from '../observable/innerFrom';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function exhaustMap(project, resultSelector) {\n if (resultSelector) {\n return function (source) {\n return source.pipe(exhaustMap(function (a, i) { return innerFrom(project(a, i)).pipe(map(function (b, ii) { return resultSelector(a, b, i, ii); })); }));\n };\n }\n return operate(function (source, subscriber) {\n var index = 0;\n var innerSub = null;\n var isComplete = false;\n source.subscribe(createOperatorSubscriber(subscriber, function (outerValue) {\n if (!innerSub) {\n innerSub = createOperatorSubscriber(subscriber, undefined, function () {\n innerSub = null;\n isComplete && subscriber.complete();\n });\n innerFrom(project(outerValue, index++)).subscribe(innerSub);\n }\n }, function () {\n isComplete = true;\n !innerSub && subscriber.complete();\n }));\n });\n}\n//# sourceMappingURL=exhaustMap.js.map","import { operate } from '../util/lift';\nimport { scanInternals } from './scanInternals';\nexport function scan(accumulator, seed) {\n return operate(scanInternals(accumulator, seed, arguments.length >= 2, true));\n}\n//# sourceMappingURL=scan.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { innerFrom } from '../observable/innerFrom';\nimport { Subject } from '../Subject';\nimport { SafeSubscriber } from '../Subscriber';\nimport { operate } from '../util/lift';\nexport function share(options) {\n if (options === void 0) { options = {}; }\n var _a = options.connector, connector = _a === void 0 ? function () { return new Subject(); } : _a, _b = options.resetOnError, resetOnError = _b === void 0 ? true : _b, _c = options.resetOnComplete, resetOnComplete = _c === void 0 ? true : _c, _d = options.resetOnRefCountZero, resetOnRefCountZero = _d === void 0 ? true : _d;\n return function (wrapperSource) {\n var connection;\n var resetConnection;\n var subject;\n var refCount = 0;\n var hasCompleted = false;\n var hasErrored = false;\n var cancelReset = function () {\n resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();\n resetConnection = undefined;\n };\n var reset = function () {\n cancelReset();\n connection = subject = undefined;\n hasCompleted = hasErrored = false;\n };\n var resetAndUnsubscribe = function () {\n var conn = connection;\n reset();\n conn === null || conn === void 0 ? void 0 : conn.unsubscribe();\n };\n return operate(function (source, subscriber) {\n refCount++;\n if (!hasErrored && !hasCompleted) {\n cancelReset();\n }\n var dest = (subject = subject !== null && subject !== void 0 ? subject : connector());\n subscriber.add(function () {\n refCount--;\n if (refCount === 0 && !hasErrored && !hasCompleted) {\n resetConnection = handleReset(resetAndUnsubscribe, resetOnRefCountZero);\n }\n });\n dest.subscribe(subscriber);\n if (!connection &&\n refCount > 0) {\n connection = new SafeSubscriber({\n next: function (value) { return dest.next(value); },\n error: function (err) {\n hasErrored = true;\n cancelReset();\n resetConnection = handleReset(reset, resetOnError, err);\n dest.error(err);\n },\n complete: function () {\n hasCompleted = true;\n cancelReset();\n resetConnection = handleReset(reset, resetOnComplete);\n dest.complete();\n },\n });\n innerFrom(source).subscribe(connection);\n }\n })(wrapperSource);\n };\n}\nfunction handleReset(reset, on) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n if (on === true) {\n reset();\n return;\n }\n if (on === false) {\n return;\n }\n var onSubscriber = new SafeSubscriber({\n next: function () {\n onSubscriber.unsubscribe();\n reset();\n },\n });\n return innerFrom(on.apply(void 0, __spreadArray([], __read(args)))).subscribe(onSubscriber);\n}\n//# sourceMappingURL=share.js.map","import { ReplaySubject } from '../ReplaySubject';\nimport { share } from './share';\nexport function shareReplay(configOrBufferSize, windowTime, scheduler) {\n var _a, _b, _c;\n var bufferSize;\n var refCount = false;\n if (configOrBufferSize && typeof configOrBufferSize === 'object') {\n (_a = configOrBufferSize.bufferSize, bufferSize = _a === void 0 ? Infinity : _a, _b = configOrBufferSize.windowTime, windowTime = _b === void 0 ? Infinity : _b, _c = configOrBufferSize.refCount, refCount = _c === void 0 ? false : _c, scheduler = configOrBufferSize.scheduler);\n }\n else {\n bufferSize = (configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity);\n }\n return share({\n connector: function () { return new ReplaySubject(bufferSize, windowTime, scheduler); },\n resetOnError: true,\n resetOnComplete: false,\n resetOnRefCountZero: refCount,\n });\n}\n//# sourceMappingURL=shareReplay.js.map","import { filter } from './filter';\nexport function skip(count) {\n return filter(function (_, index) { return count <= index; });\n}\n//# sourceMappingURL=skip.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function skipWhile(predicate) {\n return operate(function (source, subscriber) {\n var taking = false;\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return (taking || (taking = !predicate(value, index++))) && subscriber.next(value); }));\n });\n}\n//# sourceMappingURL=skipWhile.js.map","import { concat } from '../observable/concat';\nimport { popScheduler } from '../util/args';\nimport { operate } from '../util/lift';\nexport function startWith() {\n var values = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n values[_i] = arguments[_i];\n }\n var scheduler = popScheduler(values);\n return operate(function (source, subscriber) {\n (scheduler ? concat(values, source, scheduler) : concat(values, source)).subscribe(subscriber);\n });\n}\n//# sourceMappingURL=startWith.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function switchMap(project, resultSelector) {\n return operate(function (source, subscriber) {\n var innerSubscriber = null;\n var index = 0;\n var isComplete = false;\n var checkComplete = function () { return isComplete && !innerSubscriber && subscriber.complete(); };\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n innerSubscriber === null || innerSubscriber === void 0 ? void 0 : innerSubscriber.unsubscribe();\n var innerIndex = 0;\n var outerIndex = index++;\n innerFrom(project(value, outerIndex)).subscribe((innerSubscriber = createOperatorSubscriber(subscriber, function (innerValue) { return subscriber.next(resultSelector ? resultSelector(value, innerValue, outerIndex, innerIndex++) : innerValue); }, function () {\n innerSubscriber = null;\n checkComplete();\n })));\n }, function () {\n isComplete = true;\n checkComplete();\n }));\n });\n}\n//# sourceMappingURL=switchMap.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { innerFrom } from '../observable/innerFrom';\nimport { noop } from '../util/noop';\nexport function takeUntil(notifier) {\n return operate(function (source, subscriber) {\n innerFrom(notifier).subscribe(createOperatorSubscriber(subscriber, function () { return subscriber.complete(); }, noop));\n !subscriber.closed && source.subscribe(subscriber);\n });\n}\n//# sourceMappingURL=takeUntil.js.map","import { isFunction } from '../util/isFunction';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { identity } from '../util/identity';\nexport function tap(observerOrNext, error, complete) {\n var tapObserver = isFunction(observerOrNext) || error || complete\n ?\n { next: observerOrNext, error: error, complete: complete }\n : observerOrNext;\n return tapObserver\n ? operate(function (source, subscriber) {\n var _a;\n (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n var isUnsub = true;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var _a;\n (_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);\n subscriber.next(value);\n }, function () {\n var _a;\n isUnsub = false;\n (_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n subscriber.complete();\n }, function (err) {\n var _a;\n isUnsub = false;\n (_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);\n subscriber.error(err);\n }, function () {\n var _a, _b;\n if (isUnsub) {\n (_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n }\n (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);\n }));\n })\n :\n identity;\n}\n//# sourceMappingURL=tap.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { innerFrom } from '../observable/innerFrom';\nimport { identity } from '../util/identity';\nimport { noop } from '../util/noop';\nimport { popResultSelector } from '../util/args';\nexport function withLatestFrom() {\n var inputs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n inputs[_i] = arguments[_i];\n }\n var project = popResultSelector(inputs);\n return operate(function (source, subscriber) {\n var len = inputs.length;\n var otherValues = new Array(len);\n var hasValue = inputs.map(function () { return false; });\n var ready = false;\n var _loop_1 = function (i) {\n innerFrom(inputs[i]).subscribe(createOperatorSubscriber(subscriber, function (value) {\n otherValues[i] = value;\n if (!ready && !hasValue[i]) {\n hasValue[i] = true;\n (ready = hasValue.every(identity)) && (hasValue = null);\n }\n }, noop));\n };\n for (var i = 0; i < len; i++) {\n _loop_1(i);\n }\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n if (ready) {\n var values = __spreadArray([value], __read(otherValues));\n subscriber.next(project ? project.apply(void 0, __spreadArray([], __read(values))) : values);\n }\n }));\n });\n}\n//# sourceMappingURL=withLatestFrom.js.map","/**\n * Call Controls Component\n *\n * Responsive button bar for call actions. Displays mute audio, mute video,\n * screen share, and hangup buttons with states reflecting current call state.\n *\n * @example\n * ```html\n * <sw-call-controls .call=${call}></sw-call-controls>\n * ```\n *\n * @fires sw-mute-audio - Fired when the mute audio button is clicked. Detail: `{ muted: boolean }`\n * @fires sw-mute-video - Fired when the mute video button is clicked. Detail: `{ muted: boolean }`\n * @fires sw-screen-share - Fired when the screen share button is clicked. Detail: `{ active: boolean }`\n * @fires sw-hangup - Fired when the hangup button is clicked.\n *\n * @cssprop [--sw-color-primary=#044cf6] - Primary accent color.\n * @cssprop [--sw-color-primary-hover=#0339c4] - Primary color on hover.\n * @cssprop [--sw-color-danger=#ef4444] - Color for destructive actions.\n * @cssprop [--sw-color-danger-hover=#dc2626] - Danger color on hover.\n * @cssprop [--sw-color-background=#1a1a1a] - Component background.\n * @cssprop [--sw-color-surface=#2a2a2a] - Button surface color.\n * @cssprop [--sw-color-surface-hover=#3a3a3a] - Button surface on hover.\n * @cssprop [--sw-color-text=#ffffff] - Text color.\n * @cssprop [--sw-color-text-muted=#a0a0a0] - Muted text color.\n * @cssprop [--sw-color-border=#404040] - Border color.\n * @cssprop [--sw-color-active=#ef4444] - Active/toggled button color.\n * @cssprop [--sw-border-radius=8px] - Border radius for buttons.\n * @cssprop [--sw-font-family] - Font family stack.\n * @cssprop [--sw-space-1=4px] - Smallest spacing unit.\n * @cssprop [--sw-space-2=8px] - Small spacing.\n * @cssprop [--sw-space-3=12px] - Medium spacing.\n * @cssprop [--sw-space-4=16px] - Standard spacing.\n * @cssprop [--sw-space-6=24px] - Large spacing.\n */\n\nimport { LitElement, html, css, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\nimport { Subscription, of } from 'rxjs';\nimport { switchMap, filter } from 'rxjs/operators';\nimport type { Observable } from 'rxjs';\nimport { callContext } from '../context/index.js';\n\n/**\n * Screen share status type\n */\nexport type ScreenShareStatus = 'inactive' | 'pending' | 'active';\n\n/**\n * SelfParticipant interface for call controls\n */\nexport interface SelfParticipant {\n id: string;\n audioMuted$: Observable<boolean | undefined>;\n videoMuted$: Observable<boolean | undefined>;\n screenShareStatus$?: Observable<string>;\n mute: () => Promise<void>;\n unmute: () => Promise<void>;\n muteVideo: () => Promise<void>;\n unmuteVideo: () => Promise<void>;\n startScreenShare?: () => Promise<void>;\n stopScreenShare?: () => Promise<void>;\n}\n\n/**\n * Call interface for call controls\n */\nexport interface CallControlsCall {\n self?: SelfParticipant | null;\n self$?: Observable<SelfParticipant | null>;\n capabilities$?: Observable<string[]>;\n hangup: () => Promise<void>;\n}\n\n/**\n * Button type for controls\n */\ntype ControlButtonType = 'mute-audio' | 'mute-video' | 'screen-share' | 'hangup';\n\n@customElement('sw-call-controls')\nexport class CallControls extends LitElement {\n static styles = css`\n :host {\n /* CSS Custom Properties for theming */\n --sw-color-primary: #044cf6;\n --sw-color-primary-hover: #0339c4;\n --sw-color-danger: #ef4444;\n --sw-color-danger-hover: #dc2626;\n --sw-color-background: #1a1a1a;\n --sw-color-surface: #2a2a2a;\n --sw-color-surface-hover: #3a3a3a;\n --sw-color-text: #ffffff;\n --sw-color-text-muted: #a0a0a0;\n --sw-color-border: #404040;\n --sw-color-active: #ef4444;\n --sw-border-radius: 8px;\n --sw-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n --sw-space-1: 4px;\n --sw-space-2: 8px;\n --sw-space-3: 12px;\n --sw-space-4: 16px;\n --sw-space-6: 24px;\n\n display: block;\n font-family: var(--sw-font-family);\n color: var(--sw-color-text);\n }\n\n .container {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--sw-space-3);\n padding: var(--sw-space-3);\n background: var(--sw-color-background);\n border-radius: var(--sw-border-radius);\n flex-wrap: wrap;\n }\n\n .container.vertical {\n flex-direction: column;\n }\n\n .control-button {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 48px;\n height: 48px;\n min-width: 44px;\n min-height: 44px;\n padding: 0;\n background: var(--sw-color-surface);\n border: 1px solid var(--sw-color-border);\n border-radius: 50%;\n color: var(--sw-color-text);\n cursor: pointer;\n transition:\n background-color 0.2s ease,\n border-color 0.2s ease,\n transform 0.1s ease;\n }\n\n .control-button:hover:not(:disabled) {\n background: var(--sw-color-surface-hover);\n border-color: var(--sw-color-text-muted);\n }\n\n .control-button:focus {\n outline: none;\n box-shadow:\n 0 0 0 2px var(--sw-color-background),\n 0 0 0 4px var(--sw-color-primary);\n }\n\n .control-button:focus-visible {\n outline: 2px solid var(--sw-color-primary);\n outline-offset: 2px;\n }\n\n .control-button:active:not(:disabled) {\n transform: scale(0.95);\n }\n\n .control-button:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n }\n\n .control-button.active {\n background: var(--sw-color-active);\n border-color: var(--sw-color-active);\n color: white;\n }\n\n .control-button.active:hover:not(:disabled) {\n background: var(--sw-color-danger-hover);\n border-color: var(--sw-color-danger-hover);\n }\n\n .control-button.hangup {\n background: var(--sw-color-danger);\n border-color: var(--sw-color-danger);\n color: white;\n }\n\n .control-button.hangup:hover:not(:disabled) {\n background: var(--sw-color-danger-hover);\n border-color: var(--sw-color-danger-hover);\n }\n\n .control-button.screen-share.active {\n background: var(--sw-color-primary);\n border-color: var(--sw-color-primary);\n }\n\n .control-button.screen-share.active:hover:not(:disabled) {\n background: var(--sw-color-primary-hover);\n border-color: var(--sw-color-primary-hover);\n }\n\n .button-icon {\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n }\n\n .tooltip {\n position: absolute;\n bottom: calc(100% + 8px);\n left: 50%;\n transform: translateX(-50%);\n padding: var(--sw-space-1) var(--sw-space-2);\n background: var(--sw-color-surface);\n border: 1px solid var(--sw-color-border);\n border-radius: 4px;\n font-size: 12px;\n white-space: nowrap;\n opacity: 0;\n visibility: hidden;\n transition:\n opacity 0.2s ease,\n visibility 0.2s ease;\n pointer-events: none;\n z-index: 10;\n }\n\n .tooltip::after {\n content: '';\n position: absolute;\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n border: 6px solid transparent;\n border-top-color: var(--sw-color-border);\n }\n\n .control-button:hover .tooltip,\n .control-button:focus .tooltip {\n opacity: 1;\n visibility: visible;\n }\n\n /* Vertical orientation tooltip positioning */\n .container.vertical .tooltip {\n bottom: auto;\n left: calc(100% + 8px);\n top: 50%;\n transform: translateY(-50%);\n }\n\n .container.vertical .tooltip::after {\n top: 50%;\n left: auto;\n right: 100%;\n transform: translateY(-50%);\n border: 6px solid transparent;\n border-right-color: var(--sw-color-border);\n }\n\n /* Overflow menu for responsive collapse */\n .overflow-menu {\n position: relative;\n }\n\n .overflow-button {\n display: none;\n }\n\n .overflow-content {\n display: none;\n position: absolute;\n bottom: calc(100% + 8px);\n right: 0;\n background: var(--sw-color-background);\n border: 1px solid var(--sw-color-border);\n border-radius: var(--sw-border-radius);\n padding: var(--sw-space-2);\n gap: var(--sw-space-2);\n flex-direction: column;\n z-index: 20;\n }\n\n .overflow-menu.open .overflow-content {\n display: flex;\n }\n\n /* Responsive collapse at small widths */\n @media (max-width: 320px) {\n .container:not(.vertical) > .control-button:not(.hangup):not(.overflow-button) {\n display: none;\n }\n\n .container:not(.vertical) .overflow-button {\n display: flex;\n }\n\n /* Ensure overflow content buttons remain visible when menu is open */\n .container:not(.vertical) .overflow-content .control-button {\n display: flex;\n }\n }\n\n /* Dark mode adjustments */\n @media (prefers-color-scheme: light) {\n :host {\n --sw-color-background: #ffffff;\n --sw-color-surface: #f5f5f5;\n --sw-color-surface-hover: #e5e5e5;\n --sw-color-text: #1a1a1a;\n --sw-color-text-muted: #666666;\n --sw-color-border: #d4d4d4;\n }\n }\n\n :host([data-theme='light']) {\n --sw-color-background: #ffffff;\n --sw-color-surface: #f5f5f5;\n --sw-color-surface-hover: #e5e5e5;\n --sw-color-text: #1a1a1a;\n --sw-color-text-muted: #666666;\n --sw-color-border: #d4d4d4;\n }\n `;\n\n /**\n * The call object - can be provided via property or context\n */\n @property({ type: Object }) call?: CallControlsCall;\n\n /**\n * Consume call from context if not provided as property\n */\n @consume({ context: callContext, subscribe: true })\n @state()\n private _contextCall?: CallControlsCall;\n\n /** Layout orientation: 'horizontal' or 'vertical'. */\n @property({ type: String }) orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /** Whether to display tooltip labels on buttons. */\n @property({ type: Boolean, attribute: 'show-tooltips' }) showTooltips = true;\n\n /**\n * Current audio muted state\n */\n @state() private _audioMuted = false;\n\n /**\n * Current video muted state\n */\n @state() private _videoMuted = false;\n\n /**\n * Current screen share status\n */\n @state() private _screenShareStatus: ScreenShareStatus = 'inactive';\n\n /**\n * Available capabilities\n */\n @state() private _capabilities: string[] = [];\n\n /**\n * Is overflow menu open\n */\n @state() private _overflowOpen = false;\n\n /**\n * RxJS subscriptions for cleanup\n */\n private subscriptions: Subscription[] = [];\n\n /**\n * Cached self participant reference for button handlers.\n * Marked as @state() to trigger re-render when self becomes available,\n * enabling the control buttons.\n */\n @state() private selfParticipant?: SelfParticipant;\n\n /**\n * Get the effective call (property or context)\n */\n private get effectiveCall(): CallControlsCall | undefined {\n return this.call || this._contextCall;\n }\n\n /**\n * Lifecycle: Component connected to DOM\n */\n connectedCallback() {\n super.connectedCallback();\n this.setupSubscriptions();\n }\n\n /**\n * Lifecycle: React to property changes\n */\n protected updated(changedProperties: Map<string, unknown>): void {\n super.updated(changedProperties);\n if (changedProperties.has('call') || changedProperties.has('_contextCall')) {\n this.cleanupSubscriptions();\n this.setupSubscriptions();\n }\n }\n\n /**\n * Lifecycle: Component disconnected from DOM\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.cleanupSubscriptions();\n }\n\n /**\n * Subscribe to call observables\n */\n private setupSubscriptions(): void {\n const call = this.effectiveCall;\n if (!call) return;\n\n // Use self$ observable if available (recommended for real calls)\n if (call.self$) {\n // Subscribe to self$ and switch to audioMuted$ when self becomes available\n const nonNullSelf$ = call.self$.pipe(\n filter((self): self is SelfParticipant => self !== null)\n );\n\n const audioSub = nonNullSelf$\n .pipe(\n switchMap((self) => {\n this.selfParticipant = self;\n return self.audioMuted$;\n })\n )\n .subscribe((muted) => {\n if (muted !== undefined) this._audioMuted = muted;\n });\n this.subscriptions.push(audioSub);\n\n // Subscribe to videoMuted$\n const videoSub = nonNullSelf$\n .pipe(switchMap((self) => self.videoMuted$))\n .subscribe((muted) => {\n if (muted !== undefined) this._videoMuted = muted;\n });\n this.subscriptions.push(videoSub);\n\n // Subscribe to screenShareStatus$\n const screenShareSub = nonNullSelf$\n .pipe(switchMap((self) => self.screenShareStatus$ ?? of('inactive' as ScreenShareStatus)))\n .subscribe((status) => {\n this._screenShareStatus = status as ScreenShareStatus;\n });\n this.subscriptions.push(screenShareSub);\n } else if (call.self) {\n // Fallback for synchronous self (tests, mocks)\n this.selfParticipant = call.self;\n\n if (call.self.audioMuted$) {\n this.subscriptions.push(\n call.self.audioMuted$.subscribe((muted) => {\n if (muted !== undefined) this._audioMuted = muted;\n })\n );\n }\n if (call.self.videoMuted$) {\n this.subscriptions.push(\n call.self.videoMuted$.subscribe((muted) => {\n if (muted !== undefined) this._videoMuted = muted;\n })\n );\n }\n if (call.self.screenShareStatus$) {\n this.subscriptions.push(\n call.self.screenShareStatus$.subscribe((status) => {\n this._screenShareStatus = status as ScreenShareStatus;\n })\n );\n }\n }\n\n // Subscribe to capabilities\n if (call.capabilities$) {\n this.subscriptions.push(\n call.capabilities$.subscribe((caps) => {\n this._capabilities = caps;\n })\n );\n }\n }\n\n /**\n * Cleanup all subscriptions\n */\n private cleanupSubscriptions(): void {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions = [];\n this.selfParticipant = undefined;\n }\n\n /**\n * Check if capability is available\n */\n private hasCapability(capability: string): boolean {\n // If no capabilities defined, assume all available\n if (!this._capabilities || this._capabilities.length === 0) {\n return true;\n }\n return this._capabilities.includes(capability);\n }\n\n /**\n * Handle mute audio toggle\n */\n private async handleMuteAudio(): Promise<void> {\n const self = this.selfParticipant ?? this.effectiveCall?.self;\n if (!self) return;\n\n // Capture the intended new state before calling the SDK\n const willBeMuted = !this._audioMuted;\n\n try {\n if (this._audioMuted) {\n await self.unmute();\n } else {\n await self.mute();\n }\n\n this.dispatchEvent(\n new CustomEvent('sw-mute-audio', {\n detail: { muted: willBeMuted },\n bubbles: true,\n composed: true\n })\n );\n } catch (error) {\n console.error('Failed to toggle audio mute:', error);\n }\n }\n\n /**\n * Handle mute video toggle\n */\n private async handleMuteVideo(): Promise<void> {\n const self = this.selfParticipant ?? this.effectiveCall?.self;\n if (!self) return;\n\n // Capture the intended new state before calling the SDK\n const willBeMuted = !this._videoMuted;\n\n try {\n if (this._videoMuted) {\n await self.unmuteVideo();\n } else {\n await self.muteVideo();\n }\n\n this.dispatchEvent(\n new CustomEvent('sw-mute-video', {\n detail: { muted: willBeMuted },\n bubbles: true,\n composed: true\n })\n );\n } catch (error) {\n console.error('Failed to toggle video mute:', error);\n }\n }\n\n /**\n * Handle screen share toggle\n */\n private async handleScreenShare(): Promise<void> {\n const self = this.selfParticipant ?? this.effectiveCall?.self;\n if (!self) return;\n\n // Capture the intended new state before calling the SDK\n const willBeActive = this._screenShareStatus !== 'active';\n\n try {\n if (this._screenShareStatus === 'active') {\n await self.stopScreenShare?.();\n } else {\n await self.startScreenShare?.();\n }\n\n this.dispatchEvent(\n new CustomEvent('sw-screen-share', {\n detail: { active: willBeActive },\n bubbles: true,\n composed: true\n })\n );\n } catch (error) {\n console.error('Failed to toggle screen share:', error);\n }\n }\n\n /**\n * Handle hangup\n */\n private async handleHangup(): Promise<void> {\n const call = this.effectiveCall;\n if (!call) return;\n\n try {\n await call.hangup();\n\n this.dispatchEvent(\n new CustomEvent('sw-hangup', {\n bubbles: true,\n composed: true\n })\n );\n } catch (error) {\n console.error('Failed to hangup:', error);\n }\n }\n\n /**\n * Toggle overflow menu\n */\n private toggleOverflow(): void {\n this._overflowOpen = !this._overflowOpen;\n }\n\n /**\n * Get tooltip text for button\n */\n private getTooltipText(type: ControlButtonType): string {\n switch (type) {\n case 'mute-audio':\n return this._audioMuted ? 'Unmute Audio' : 'Mute Audio';\n case 'mute-video':\n return this._videoMuted ? 'Turn On Camera' : 'Turn Off Camera';\n case 'screen-share':\n return this._screenShareStatus === 'active' ? 'Stop Sharing' : 'Share Screen';\n case 'hangup':\n return 'End Call';\n }\n }\n\n /**\n * Render button icon\n */\n private renderIcon(type: ControlButtonType) {\n switch (type) {\n case 'mute-audio':\n return this._audioMuted\n ? html`<svg class=\"button-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z\"\n />\n </svg>`\n : html`<svg class=\"button-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.91-3c-.49 0-.9.36-.98.85C16.52 14.2 14.47 16 12 16s-4.52-1.8-4.93-4.15c-.08-.49-.49-.85-.98-.85-.61 0-1.09.54-1 1.14.49 3 2.89 5.35 5.91 5.78V20c0 .55.45 1 1 1s1-.45 1-1v-2.08c3.02-.43 5.42-2.78 5.91-5.78.1-.6-.39-1.14-1-1.14z\"\n />\n </svg>`;\n\n case 'mute-video':\n return this._videoMuted\n ? html`<svg class=\"button-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M21 6.5l-4 4V7c0-.55-.45-1-1-1H9.82L21 17.18V6.5zM3.27 2L2 3.27 4.73 6H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.21 0 .39-.08.54-.18L19.73 21 21 19.73 3.27 2z\"\n />\n </svg>`\n : html`<svg class=\"button-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z\"\n />\n </svg>`;\n\n case 'screen-share':\n return this._screenShareStatus === 'active'\n ? html`<svg class=\"button-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M21.22 18.02l2 2H24v-2h-2.78zm.77-2l.01-10c0-1.11-.9-2-2-2H7.22l5.23 5.23c.18-.04.36-.07.55-.1V7.02l4 3.73-1.58 1.47 5.54 5.54c.61-.33 1.03-.99 1.03-1.74zM2.39 1.73L1.11 3l1.54 1.54c-.4.36-.65.89-.65 1.48v10c0 1.1.89 2 2 2H0v2h18.13l2.71 2.71 1.27-1.27L2.39 1.73zM7 15.02c.31-1.48.92-2.95 2.07-4.06l1.59 1.59c-1.54.38-2.7 1.18-3.66 2.47z\"\n />\n </svg>`\n : html`<svg class=\"button-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2h-4zM4 6h16v10H4V6zm9 9v-4h3l-4-4-4 4h3v4h2z\"\n />\n </svg>`;\n\n case 'hangup':\n return html`<svg class=\"button-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M12 9c-1.6 0-3.15.25-4.6.72v3.1c0 .39-.23.74-.56.9-.98.49-1.87 1.12-2.66 1.85-.18.18-.43.28-.7.28-.28 0-.53-.11-.71-.29L.29 13.08c-.18-.17-.29-.42-.29-.7 0-.28.11-.53.29-.71C3.34 8.78 7.46 7 12 7s8.66 1.78 11.71 4.67c.18.18.29.43.29.71 0 .28-.11.53-.29.71l-2.48 2.48c-.18.18-.43.29-.71.29-.27 0-.52-.11-.7-.28-.79-.74-1.69-1.36-2.67-1.85-.33-.16-.56-.5-.56-.9v-3.1C15.15 9.25 13.6 9 12 9z\"\n />\n </svg>`;\n }\n }\n\n /**\n * Render a control button\n */\n private renderButton(\n type: ControlButtonType,\n options: {\n onClick: () => void;\n active?: boolean;\n disabled?: boolean;\n className?: string;\n }\n ) {\n const { onClick, active = false, disabled = false, className = '' } = options;\n const tooltipText = this.getTooltipText(type);\n\n return html`\n <button\n class=\"control-button ${type} ${active ? 'active' : ''} ${className}\"\n part=\"button ${active ? 'button-active' : ''} ${disabled ? 'button-disabled' : ''}\"\n aria-label=\"${tooltipText}\"\n aria-pressed=\"${type !== 'hangup' ? active : nothing}\"\n ?disabled=${disabled}\n @click=${onClick}\n >\n ${this.renderIcon(type)}\n ${this.showTooltips\n ? html` <span class=\"tooltip\" part=\"tooltip\">${tooltipText}</span> `\n : nothing}\n </button>\n `;\n }\n\n /**\n * Render the component\n */\n render() {\n const call = this.effectiveCall;\n const hasSelf = Boolean(this.selfParticipant ?? call?.self);\n\n // Check capabilities - server sends: self, member, vmuted, layout, digit, screenshare, device, lock, end\n // Having 'self' capability implies self-controls are available (mute audio/video)\n const hasSelfCapability = this.hasCapability('self');\n const canMuteAudio =\n hasSelfCapability || this.hasCapability('selfMuteAudio') || this.hasCapability('muteAudio');\n const canMuteVideo =\n hasSelfCapability ||\n this.hasCapability('vmuted') ||\n this.hasCapability('selfMuteVideo') ||\n this.hasCapability('muteVideo');\n const canScreenShare =\n (this.hasCapability('screenshare') || this.hasCapability('screenShare')) &&\n Boolean(this.selfParticipant?.startScreenShare ?? call?.self?.startScreenShare);\n const canHangup = true; // Always allow hangup\n\n return html`\n <div\n class=\"container ${this.orientation === 'vertical' ? 'vertical' : ''}\"\n part=\"container\"\n role=\"toolbar\"\n aria-label=\"Call controls\"\n >\n ${this.renderButton('mute-audio', {\n onClick: () => this.handleMuteAudio(),\n active: this._audioMuted,\n disabled: !hasSelf || !canMuteAudio\n })}\n ${this.renderButton('mute-video', {\n onClick: () => this.handleMuteVideo(),\n active: this._videoMuted,\n disabled: !hasSelf || !canMuteVideo\n })}\n ${this.renderButton('screen-share', {\n onClick: () => this.handleScreenShare(),\n active: this._screenShareStatus === 'active',\n disabled: !hasSelf || !canScreenShare\n })}\n ${this.renderButton('hangup', {\n onClick: () => this.handleHangup(),\n disabled: !call || !canHangup,\n className: 'hangup'\n })}\n\n <!-- Overflow menu for responsive collapse -->\n <div class=\"overflow-menu ${this._overflowOpen ? 'open' : ''}\">\n <button\n class=\"control-button overflow-button\"\n aria-label=\"More options\"\n aria-expanded=\"${this._overflowOpen}\"\n @click=${this.toggleOverflow}\n >\n <svg class=\"button-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z\"\n />\n </svg>\n </button>\n <div class=\"overflow-content\">\n ${this.renderButton('mute-audio', {\n onClick: () => this.handleMuteAudio(),\n active: this._audioMuted,\n disabled: !hasSelf || !canMuteAudio\n })}\n ${this.renderButton('mute-video', {\n onClick: () => this.handleMuteVideo(),\n active: this._videoMuted,\n disabled: !hasSelf || !canMuteVideo\n })}\n ${this.renderButton('screen-share', {\n onClick: () => this.handleScreenShare(),\n active: this._screenShareStatus === 'active',\n disabled: !hasSelf || !canScreenShare\n })}\n </div>\n </div>\n </div>\n `;\n }\n}\n\n/**\n * Declare global type for TypeScript\n */\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sw-call-controls': CallControls;\n }\n}\n","/**\n * Call Status Component\n *\n * Displays current call state with status text and duration timer.\n * Shows animated indicators for transient states (connecting, ringing, disconnecting).\n *\n * @example\n * ```html\n * <sw-call-status .call=${call}></sw-call-status>\n * ```\n *\n * @cssprop [--sw-color-primary=#044cf6] - Primary brand color\n * @cssprop [--sw-color-success=#10b981] - Success/connected indicator color\n * @cssprop [--sw-color-warning=#f59e0b] - Warning/connecting indicator color\n * @cssprop [--sw-color-danger=#ef4444] - Danger/disconnecting indicator color\n * @cssprop [--sw-color-text=#1f2937] - Primary text color\n * @cssprop [--sw-color-text-muted=#6b7280] - Secondary/muted text and duration color\n * @cssprop [--sw-font-family=-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif] - Font family\n * @cssprop [--sw-font-size-sm=14px] - Small font size for duration\n * @cssprop [--sw-font-size-base=16px] - Base font size for status text\n * @cssprop [--sw-font-size-lg=18px] - Large font size\n * @cssprop [--sw-space-1=4px] - Smallest spacing unit\n * @cssprop [--sw-space-2=8px] - Small spacing unit\n * @cssprop [--sw-space-3=12px] - Medium spacing unit\n * @cssprop [--sw-border-radius=8px] - Border radius for container\n */\n\nimport { LitElement, html, css } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\nimport { Subscription } from 'rxjs';\nimport type { Observable } from 'rxjs';\nimport type { CallStatus } from '@signalwire/js';\nimport { callContext } from '../context/index.js';\n\n/**\n * Call interface for status component\n */\nexport interface CallStatusCall {\n status$: Observable<CallStatus>;\n}\n\n@customElement('sw-call-status')\nexport class CallStatusComponent extends LitElement {\n static styles = css`\n :host {\n /* CSS Custom Properties for theming */\n --sw-color-primary: #044cf6;\n --sw-color-success: #10b981;\n --sw-color-warning: #f59e0b;\n --sw-color-danger: #ef4444;\n --sw-color-text: #1f2937;\n --sw-color-text-muted: #6b7280;\n --sw-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n --sw-font-size-sm: 14px;\n --sw-font-size-base: 16px;\n --sw-font-size-lg: 18px;\n --sw-space-1: 4px;\n --sw-space-2: 8px;\n --sw-space-3: 12px;\n --sw-border-radius: 8px;\n\n display: inline-flex;\n align-items: center;\n gap: var(--sw-space-2);\n font-family: var(--sw-font-family);\n font-size: var(--sw-font-size-base);\n }\n\n /* Dark mode support */\n :host([data-theme='dark']) {\n --sw-color-text: #f9fafb;\n --sw-color-text-muted: #9ca3af;\n }\n\n @media (prefers-color-scheme: dark) {\n :host(:not([data-theme='light'])) {\n --sw-color-text: #f9fafb;\n --sw-color-text-muted: #9ca3af;\n }\n }\n\n .container {\n display: inline-flex;\n align-items: center;\n gap: var(--sw-space-2);\n padding: var(--sw-space-2) var(--sw-space-3);\n border-radius: var(--sw-border-radius);\n color: var(--sw-color-text);\n }\n\n .status-indicator {\n width: 10px;\n height: 10px;\n border-radius: 50%;\n flex-shrink: 0;\n }\n\n .status-indicator.new {\n background-color: var(--sw-color-text-muted);\n }\n\n .status-indicator.connecting,\n .status-indicator.ringing {\n background-color: var(--sw-color-warning);\n animation: pulse 1.5s ease-in-out infinite;\n }\n\n .status-indicator.connected {\n background-color: var(--sw-color-success);\n }\n\n .status-indicator.disconnecting {\n background-color: var(--sw-color-danger);\n animation: pulse 1s ease-in-out infinite;\n }\n\n .status-indicator.trying {\n background-color: var(--sw-color-warning);\n animation: pulse 1.5s ease-in-out infinite;\n }\n\n .status-indicator.disconnected,\n .status-indicator.failed {\n background-color: var(--sw-color-danger);\n }\n\n .status-indicator.destroyed {\n background-color: var(--sw-color-text-muted);\n }\n\n @keyframes pulse {\n 0%,\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.5;\n transform: scale(1.1);\n }\n }\n\n .status-text {\n font-weight: 500;\n white-space: nowrap;\n }\n\n .status-text.trying,\n .status-text.connecting,\n .status-text.ringing {\n color: var(--sw-color-warning);\n }\n\n .status-text.disconnecting {\n color: var(--sw-color-danger);\n }\n\n .status-text.connected {\n color: var(--sw-color-success);\n }\n\n .status-text.disconnected,\n .status-text.failed {\n color: var(--sw-color-danger);\n }\n\n .status-text.new,\n .status-text.destroyed {\n color: var(--sw-color-text-muted);\n }\n\n .duration {\n font-variant-numeric: tabular-nums;\n color: var(--sw-color-text-muted);\n font-size: var(--sw-font-size-sm);\n }\n `;\n\n /**\n * Call object with status$ observable\n */\n @property({ attribute: false })\n call: CallStatusCall | null = null;\n\n /**\n * Call from context (if nested in sw-call-media)\n */\n @consume({ context: callContext, subscribe: true })\n @state()\n private contextCall?: CallStatusCall;\n\n /**\n * Current call status\n */\n @state()\n private status: CallStatus = 'new';\n\n /**\n * Call start time for duration calculation\n */\n @state()\n private callStartTime: number | null = null;\n\n /**\n * Formatted duration string\n */\n @state()\n private duration: string = '0:00';\n\n /**\n * RxJS subscriptions for cleanup\n */\n private subscriptions: Subscription[] = [];\n\n /**\n * Duration timer interval\n */\n private durationInterval: number | null = null;\n\n connectedCallback() {\n super.connectedCallback();\n this.subscribeToCall();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.cleanup();\n }\n\n updated(changedProperties: Map<string, unknown>) {\n if (changedProperties.has('call') || changedProperties.has('contextCall')) {\n this.cleanup();\n this.subscribeToCall();\n }\n }\n\n private get activeCall(): CallStatusCall | null {\n return this.call || this.contextCall || null;\n }\n\n private subscribeToCall() {\n const call = this.activeCall;\n if (!call?.status$) return;\n\n const statusSub = call.status$.subscribe((status) => {\n const prevStatus = this.status;\n this.status = status;\n\n // Start duration timer when connected\n if (status === 'connected' && prevStatus !== 'connected') {\n this.startDurationTimer();\n } else if (status !== 'connected') {\n this.stopDurationTimer();\n }\n });\n\n this.subscriptions.push(statusSub);\n }\n\n private startDurationTimer() {\n this.callStartTime = Date.now();\n this.duration = '0:00';\n\n this.durationInterval = window.setInterval(() => {\n if (this.callStartTime) {\n const elapsed = Math.floor((Date.now() - this.callStartTime) / 1000);\n this.duration = this.formatDuration(elapsed);\n }\n }, 1000);\n }\n\n private stopDurationTimer() {\n if (this.durationInterval) {\n clearInterval(this.durationInterval);\n this.durationInterval = null;\n }\n this.callStartTime = null;\n this.duration = '0:00';\n }\n\n private formatDuration(seconds: number): string {\n const hours = Math.floor(seconds / 3600);\n const minutes = Math.floor((seconds % 3600) / 60);\n const secs = seconds % 60;\n\n if (hours > 0) {\n return `${hours}:${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;\n }\n return `${minutes}:${secs.toString().padStart(2, '0')}`;\n }\n\n private cleanup() {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions = [];\n this.stopDurationTimer();\n }\n\n private getStatusText(): string {\n switch (this.status) {\n case 'new':\n return 'Ready';\n case 'trying':\n return 'Trying...';\n case 'connecting':\n return 'Connecting...';\n case 'ringing':\n return 'Ringing...';\n case 'connected':\n return 'Connected';\n case 'recovering':\n return 'Reconnecting...';\n case 'disconnecting':\n return 'Disconnecting...';\n case 'disconnected':\n return 'Disconnected';\n case 'failed':\n return 'Failed';\n case 'destroyed':\n return 'Ended';\n default: {\n const _exhaustive: never = this.status;\n return String(_exhaustive);\n }\n }\n }\n\n render() {\n const statusText = this.getStatusText();\n const showDuration = this.status === 'connected';\n\n return html`\n <div class=\"container\" part=\"container\">\n <span class=\"status-indicator ${this.status}\" aria-hidden=\"true\"></span>\n <span\n class=\"status-text ${this.status}\"\n part=\"status-text\"\n role=\"status\"\n aria-live=\"polite\"\n >\n ${statusText}\n </span>\n ${showDuration\n ? html`<span class=\"duration\" part=\"duration\">${this.duration}</span>`\n : null}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sw-call-status': CallStatusComponent;\n }\n}\n","/**\n * Dialpad Component\n *\n * A 12-key telephone keypad (0-9, *, #) for entering phone numbers\n * and sending DTMF tones during active calls.\n *\n * @example\n * ```html\n * <sw-dialpad .call=${call}></sw-dialpad>\n * ```\n *\n * @fires sw-digit-press - Fired when a digit button is pressed. Detail: `{ digit: string }`\n * @fires sw-backspace - Fired when the backspace button is pressed.\n * @fires sw-dial - Fired when the call button is pressed. Detail: `{ number: string }`\n *\n * @cssprop [--sw-color-primary=#044cf6] - Primary accent color.\n * @cssprop [--sw-color-primary-hover=#0339c4] - Primary color on hover.\n * @cssprop [--sw-color-success=#10b981] - Success/call button color.\n * @cssprop [--sw-color-danger=#ef4444] - Danger/hangup button color.\n * @cssprop [--sw-color-background=#1a1a1a] - Component background.\n * @cssprop [--sw-color-surface=#2a2a2a] - Button surface color.\n * @cssprop [--sw-color-surface-hover=#3a3a3a] - Button surface on hover.\n * @cssprop [--sw-color-text=#ffffff] - Text color.\n * @cssprop [--sw-color-text-muted=#a0a0a0] - Muted text color.\n * @cssprop [--sw-color-border=#404040] - Border color.\n * @cssprop [--sw-border-radius=8px] - Border radius.\n * @cssprop [--sw-font-size-sm=12px] - Small font size.\n * @cssprop [--sw-font-size-base=14px] - Base font size.\n * @cssprop [--sw-font-size-lg=16px] - Large font size.\n * @cssprop [--sw-font-size-xl=20px] - Extra-large font size for digit display.\n */\n\nimport { LitElement, html, css } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\nimport type { Observable } from 'rxjs';\nimport { callContext } from '../context/index.js';\n\n/**\n * Call interface for dialpad component\n */\nexport interface DialpadCall {\n sendDigits?(dtmf: string): Promise<void>;\n status$?: Observable<string>;\n}\n\n/**\n * Key layout for standard telephone keypad\n */\nconst KEYS = [\n { digit: '1', letters: '' },\n { digit: '2', letters: 'ABC' },\n { digit: '3', letters: 'DEF' },\n { digit: '4', letters: 'GHI' },\n { digit: '5', letters: 'JKL' },\n { digit: '6', letters: 'MNO' },\n { digit: '7', letters: 'PQRS' },\n { digit: '8', letters: 'TUV' },\n { digit: '9', letters: 'WXYZ' },\n { digit: '*', letters: '' },\n { digit: '0', letters: '+' },\n { digit: '#', letters: '' }\n];\n\n@customElement('sw-dialpad')\nexport class DialpadComponent extends LitElement {\n static styles = css`\n :host {\n /* CSS Custom Properties for theming */\n --sw-color-primary: #044cf6;\n --sw-color-primary-hover: #0339c4;\n --sw-color-primary-active: #022b92;\n --sw-color-success: #10b981;\n --sw-color-danger: #ef4444;\n --sw-color-text: #1f2937;\n --sw-color-text-muted: #6b7280;\n --sw-color-border: #e5e7eb;\n --sw-color-background: #ffffff;\n --sw-color-background-hover: #f3f4f6;\n --sw-color-background-active: #e5e7eb;\n --sw-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n --sw-font-size-sm: 12px;\n --sw-font-size-base: 16px;\n --sw-font-size-lg: 24px;\n --sw-font-size-xl: 32px;\n --sw-space-1: 4px;\n --sw-space-2: 8px;\n --sw-space-3: 12px;\n --sw-space-4: 16px;\n --sw-border-radius: 8px;\n --sw-border-radius-full: 9999px;\n\n display: block;\n font-family: var(--sw-font-family);\n }\n\n /* Dark mode support */\n :host([data-theme='dark']) {\n --sw-color-text: #f9fafb;\n --sw-color-text-muted: #9ca3af;\n --sw-color-border: #374151;\n --sw-color-background: #1f2937;\n --sw-color-background-hover: #374151;\n --sw-color-background-active: #4b5563;\n }\n\n @media (prefers-color-scheme: dark) {\n :host(:not([data-theme='light'])) {\n --sw-color-text: #f9fafb;\n --sw-color-text-muted: #9ca3af;\n --sw-color-border: #374151;\n --sw-color-background: #1f2937;\n --sw-color-background-hover: #374151;\n --sw-color-background-active: #4b5563;\n }\n }\n\n .container {\n display: flex;\n flex-direction: column;\n gap: var(--sw-space-3);\n padding: var(--sw-space-4);\n max-width: 280px;\n background: var(--sw-color-background);\n border-radius: var(--sw-border-radius);\n }\n\n .display {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--sw-space-3) var(--sw-space-4);\n background: var(--sw-color-background-hover);\n border-radius: var(--sw-border-radius);\n min-height: 48px;\n }\n\n .display-input {\n flex: 1;\n font-size: var(--sw-font-size-xl);\n font-weight: 500;\n font-family: var(--sw-font-family);\n color: var(--sw-color-text);\n background: transparent;\n border: none;\n outline: none;\n letter-spacing: 2px;\n text-align: center;\n }\n\n .display-input::placeholder {\n color: var(--sw-color-text-muted);\n font-size: var(--sw-font-size-base);\n letter-spacing: normal;\n }\n\n .backspace-button {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n background: transparent;\n border: none;\n border-radius: var(--sw-border-radius);\n cursor: pointer;\n color: var(--sw-color-text-muted);\n transition:\n background-color 0.15s ease,\n color 0.15s ease;\n }\n\n .backspace-button:hover {\n background: var(--sw-color-background-active);\n color: var(--sw-color-text);\n }\n\n .backspace-button:disabled {\n opacity: 0.3;\n cursor: not-allowed;\n }\n\n .keypad {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: var(--sw-space-2);\n }\n\n .key {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 72px;\n height: 72px;\n background: var(--sw-color-background);\n border: 1px solid var(--sw-color-border);\n border-radius: var(--sw-border-radius-full);\n cursor: pointer;\n transition:\n background-color 0.1s ease,\n transform 0.1s ease;\n user-select: none;\n -webkit-user-select: none;\n -webkit-tap-highlight-color: transparent;\n }\n\n .key:hover {\n background: var(--sw-color-background-hover);\n }\n\n .key:active,\n .key.pressed {\n background: var(--sw-color-background-active);\n transform: scale(0.95);\n }\n\n .key-digit {\n font-size: var(--sw-font-size-lg);\n font-weight: 500;\n color: var(--sw-color-text);\n line-height: 1;\n }\n\n .key-letters {\n font-size: var(--sw-font-size-sm);\n color: var(--sw-color-text-muted);\n text-transform: uppercase;\n letter-spacing: 1px;\n margin-top: 2px;\n min-height: 14px;\n }\n\n .call-button {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 56px;\n background: var(--sw-color-success);\n border: none;\n border-radius: var(--sw-border-radius);\n cursor: pointer;\n color: white;\n font-size: var(--sw-font-size-base);\n font-weight: 600;\n font-family: var(--sw-font-family);\n transition: background-color 0.15s ease;\n gap: var(--sw-space-2);\n }\n\n .call-button:hover {\n background: #0ea472;\n }\n\n .call-button:active {\n background: #0d9668;\n }\n\n .call-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .call-button svg {\n width: 20px;\n height: 20px;\n }\n `;\n\n /** Call object providing the sendDigits method for DTMF tones. */\n @property({ attribute: false })\n call: DialpadCall | null = null;\n\n /**\n * Call from context (if nested in sw-call-media)\n */\n @consume({ context: callContext, subscribe: true })\n @state()\n private contextCall?: DialpadCall;\n\n /**\n * Current digits entered\n */\n @state()\n private digits: string = '';\n\n /**\n * Currently pressed key (for visual feedback)\n */\n @state()\n private pressedKey: string | null = null;\n\n /** Whether to display the call button below the keypad. */\n @property({ type: Boolean, attribute: 'show-call-button' })\n showCallButton: boolean = false;\n\n /** Placeholder text shown in the digit display input. */\n @property({ type: String })\n placeholder: string = 'Enter number';\n\n private get activeCall(): DialpadCall | null {\n return this.call || this.contextCall || null;\n }\n\n private handleKeyPress(digit: string) {\n this.digits += digit;\n this.pressedKey = digit;\n\n // Send DTMF if call is active\n if (this.activeCall?.sendDigits) {\n this.activeCall.sendDigits(digit).catch((err) => {\n console.error('Failed to send DTMF:', err);\n });\n }\n\n // Dispatch event\n this.dispatchEvent(\n new CustomEvent('sw-digit-press', {\n detail: { digit, digits: this.digits },\n bubbles: true,\n composed: true\n })\n );\n\n // Reset pressed state after animation\n setTimeout(() => {\n this.pressedKey = null;\n }, 100);\n }\n\n private handleBackspace() {\n if (this.digits.length > 0) {\n this.digits = this.digits.slice(0, -1);\n this.dispatchEvent(\n new CustomEvent('sw-backspace', {\n detail: { digits: this.digits },\n bubbles: true,\n composed: true\n })\n );\n }\n }\n\n private handleCall() {\n if (this.digits.length > 0) {\n this.dispatchEvent(\n new CustomEvent('sw-dial', {\n detail: { digits: this.digits },\n bubbles: true,\n composed: true\n })\n );\n }\n }\n\n private handleInputChange(e: Event) {\n const input = e.target as HTMLInputElement;\n // Only allow valid DTMF characters\n this.digits = input.value.replace(/[^0-9*#]/g, '');\n }\n\n private handleKeyDown(e: KeyboardEvent) {\n const key = e.key;\n // Handle keyboard input for digits\n if (/^[0-9*#]$/.test(key)) {\n this.handleKeyPress(key);\n } else if (key === 'Backspace') {\n this.handleBackspace();\n } else if (key === 'Enter' && this.showCallButton) {\n this.handleCall();\n }\n }\n\n render() {\n return html`\n <div class=\"container\" part=\"container\">\n <div class=\"display\" part=\"display\">\n <input\n type=\"tel\"\n class=\"display-input\"\n .value=${this.digits}\n placeholder=${this.placeholder}\n @input=${this.handleInputChange}\n @keydown=${this.handleKeyDown}\n aria-label=\"Phone number input\"\n />\n <button\n class=\"backspace-button\"\n @click=${this.handleBackspace}\n ?disabled=${this.digits.length === 0}\n aria-label=\"Delete last digit\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z\"></path>\n <line x1=\"18\" y1=\"9\" x2=\"12\" y2=\"15\"></line>\n <line x1=\"12\" y1=\"9\" x2=\"18\" y2=\"15\"></line>\n </svg>\n </button>\n </div>\n\n <div class=\"keypad\" part=\"keypad\" role=\"group\" aria-label=\"Telephone keypad\">\n ${KEYS.map(\n (key) => html`\n <button\n class=\"key ${this.pressedKey === key.digit ? 'pressed' : ''}\"\n part=\"key ${this.pressedKey === key.digit ? 'key-pressed' : ''}\"\n @click=${() => this.handleKeyPress(key.digit)}\n aria-label=\"${key.digit}${key.letters ? `, ${key.letters}` : ''}\"\n >\n <span class=\"key-digit\">${key.digit}</span>\n <span class=\"key-letters\">${key.letters}</span>\n </button>\n `\n )}\n </div>\n\n ${this.showCallButton\n ? html`\n <button\n class=\"call-button\"\n part=\"call-button\"\n @click=${this.handleCall}\n ?disabled=${this.digits.length === 0}\n aria-label=\"Call ${this.digits}\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M6.62 10.79c1.44 2.83 3.76 5.15 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z\"\n />\n </svg>\n Call\n </button>\n `\n : null}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sw-dialpad': DialpadComponent;\n }\n}\n","/**\n * Click to Call Component\n *\n * A single button widget to initiate calls to a preconfigured destination.\n * Shows minimal UI with call status, duration, and basic controls.\n *\n * @example\n * ```html\n * <sw-click-to-call\n * destination=\"sip:support@example.com\"\n * .client=${signalWire}\n * label=\"Call Support\"\n * ></sw-click-to-call>\n * ```\n *\n * @fires sw-dial - Fired when a call is initiated. Detail: `{ destination: string }`\n * @fires sw-hangup - Fired when the hangup button is clicked.\n * @fires sw-mute-toggle - Fired when the mute button is toggled. Detail: `{ muted: boolean }`\n *\n * @cssprop [--sw-color-primary=#044cf6] - Primary brand color\n * @cssprop [--sw-color-primary-hover=#0339c4] - Primary color on hover\n * @cssprop [--sw-color-success=#10b981] - Success/positive color\n * @cssprop [--sw-color-success-hover=#0ea472] - Success color on hover\n * @cssprop [--sw-color-danger=#ef4444] - Danger/destructive color\n * @cssprop [--sw-color-danger-hover=#dc2626] - Danger color on hover\n * @cssprop [--sw-color-warning=#f59e0b] - Warning color\n * @cssprop [--sw-color-text=#1f2937] - Primary text color\n * @cssprop [--sw-color-text-muted=#6b7280] - Secondary/muted text color\n * @cssprop [--sw-color-text-inverse=#ffffff] - Inverse text color for buttons\n * @cssprop [--sw-color-background=#ffffff] - Component background color\n * @cssprop [--sw-color-background-hover=#f3f4f6] - Background color on hover\n * @cssprop [--sw-color-border=#e5e7eb] - Border color\n * @cssprop [--sw-font-family=-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif] - Font family\n * @cssprop [--sw-font-size-sm=12px] - Small font size\n * @cssprop [--sw-font-size-base=14px] - Base font size\n * @cssprop [--sw-font-size-lg=16px] - Large font size\n * @cssprop [--sw-space-1=4px] - Smallest spacing unit\n * @cssprop [--sw-space-2=8px] - Small spacing unit\n * @cssprop [--sw-space-3=12px] - Medium spacing unit\n * @cssprop [--sw-space-4=16px] - Large spacing unit\n * @cssprop [--sw-border-radius=8px] - Border radius for containers\n * @cssprop [--sw-border-radius-full=9999px] - Fully rounded border radius for circular buttons\n */\n\nimport { LitElement, html, css } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { Subscription, switchMap } from 'rxjs';\nimport type { Observable } from 'rxjs';\n\n/**\n * Call status type\n */\nexport type ClickToCallStatus = 'idle' | 'connecting' | 'connected' | 'disconnecting' | 'error';\n\n/**\n * Self participant interface for click-to-call component\n */\nexport interface ClickToCallSelf {\n audioMuted$: Observable<boolean | undefined>;\n mute(): Promise<void>;\n unmute(): Promise<void>;\n}\n\n/**\n * Call interface for click-to-call component\n */\nexport interface ClickToCallCall {\n status$: Observable<string>;\n hangup(): Promise<void>;\n self$?: Observable<ClickToCallSelf>;\n self?: ClickToCallSelf;\n}\n\n/**\n * Client interface for click-to-call component\n */\nexport interface ClickToCallClient {\n dial(\n destination: string,\n options?: { audio?: boolean; video?: boolean }\n ): Promise<ClickToCallCall>;\n}\n\n@customElement('sw-click-to-call')\nexport class ClickToCallComponent extends LitElement {\n static styles = css`\n :host {\n /* CSS Custom Properties for theming */\n --sw-color-primary: #044cf6;\n --sw-color-primary-hover: #0339c4;\n --sw-color-success: #10b981;\n --sw-color-success-hover: #0ea472;\n --sw-color-danger: #ef4444;\n --sw-color-danger-hover: #dc2626;\n --sw-color-warning: #f59e0b;\n --sw-color-text: #1f2937;\n --sw-color-text-muted: #6b7280;\n --sw-color-text-inverse: #ffffff;\n --sw-color-background: #ffffff;\n --sw-color-background-hover: #f3f4f6;\n --sw-color-border: #e5e7eb;\n --sw-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n --sw-font-size-sm: 12px;\n --sw-font-size-base: 14px;\n --sw-font-size-lg: 16px;\n --sw-space-1: 4px;\n --sw-space-2: 8px;\n --sw-space-3: 12px;\n --sw-space-4: 16px;\n --sw-border-radius: 8px;\n --sw-border-radius-full: 9999px;\n\n display: inline-block;\n font-family: var(--sw-font-family);\n }\n\n /* Dark mode support */\n :host([data-theme='dark']) {\n --sw-color-text: #f9fafb;\n --sw-color-text-muted: #9ca3af;\n --sw-color-background: #1f2937;\n --sw-color-background-hover: #374151;\n --sw-color-border: #374151;\n }\n\n @media (prefers-color-scheme: dark) {\n :host(:not([data-theme='light'])) {\n --sw-color-text: #f9fafb;\n --sw-color-text-muted: #9ca3af;\n --sw-color-background: #1f2937;\n --sw-color-background-hover: #374151;\n --sw-color-border: #374151;\n }\n }\n\n .container {\n display: flex;\n flex-direction: column;\n gap: var(--sw-space-2);\n }\n\n /* Idle state - call button */\n .call-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--sw-space-2);\n padding: var(--sw-space-3) var(--sw-space-4);\n min-width: 120px;\n min-height: 44px;\n background: var(--sw-color-success);\n color: var(--sw-color-text-inverse);\n border: none;\n border-radius: var(--sw-border-radius);\n font-family: var(--sw-font-family);\n font-size: var(--sw-font-size-lg);\n font-weight: 600;\n cursor: pointer;\n transition:\n background-color 0.15s ease,\n transform 0.1s ease;\n }\n\n .call-button:hover {\n background: var(--sw-color-success-hover);\n }\n\n .call-button:active {\n transform: scale(0.98);\n }\n\n .call-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .call-button svg {\n width: 20px;\n height: 20px;\n }\n\n /* Connected state - expanded controls */\n .active-call {\n display: flex;\n flex-direction: column;\n gap: var(--sw-space-3);\n padding: var(--sw-space-4);\n background: var(--sw-color-background);\n border: 1px solid var(--sw-color-border);\n border-radius: var(--sw-border-radius);\n min-width: 200px;\n }\n\n .status-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--sw-space-3);\n }\n\n .status {\n display: flex;\n align-items: center;\n gap: var(--sw-space-2);\n font-size: var(--sw-font-size-base);\n color: var(--sw-color-text);\n }\n\n .status-indicator {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--sw-color-success);\n }\n\n .status-indicator.connecting {\n background: var(--sw-color-warning);\n animation: pulse 1.5s ease-in-out infinite;\n }\n\n .status-indicator.error {\n background: var(--sw-color-danger);\n }\n\n @keyframes pulse {\n 0%,\n 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.5;\n }\n }\n\n .duration {\n font-variant-numeric: tabular-nums;\n color: var(--sw-color-text-muted);\n font-size: var(--sw-font-size-sm);\n }\n\n .controls-row {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--sw-space-2);\n }\n\n .control-button {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n background: var(--sw-color-background-hover);\n border: 1px solid var(--sw-color-border);\n border-radius: var(--sw-border-radius-full);\n cursor: pointer;\n color: var(--sw-color-text);\n transition: background-color 0.15s ease;\n }\n\n .control-button:hover {\n background: var(--sw-color-border);\n }\n\n .control-button.active {\n background: var(--sw-color-danger);\n border-color: var(--sw-color-danger);\n color: var(--sw-color-text-inverse);\n }\n\n .control-button svg {\n width: 20px;\n height: 20px;\n }\n\n .hangup-button {\n background: var(--sw-color-danger);\n border-color: var(--sw-color-danger);\n color: var(--sw-color-text-inverse);\n }\n\n .hangup-button:hover {\n background: var(--sw-color-danger-hover);\n }\n\n /* Error state */\n .error-message {\n color: var(--sw-color-danger);\n font-size: var(--sw-font-size-sm);\n text-align: center;\n }\n `;\n\n /**\n * Client for initiating calls (SignalWire)\n */\n @property({ attribute: false })\n client: ClickToCallClient | null = null;\n\n /**\n * Destination address to call\n */\n @property({ type: String })\n destination: string = '';\n\n /**\n * Button label when idle\n */\n @property({ type: String })\n label: string = 'Call';\n\n /**\n * Audio-only mode (no video)\n */\n @property({ type: Boolean, attribute: 'audio-only' })\n audioOnly: boolean = true;\n\n /**\n * Current call status\n */\n @state()\n private status: ClickToCallStatus = 'idle';\n\n /**\n * Current call object\n */\n @state()\n private call: ClickToCallCall | null = null;\n\n /**\n * Is audio muted\n */\n @state()\n private audioMuted: boolean = false;\n\n /**\n * Self participant reference for mute/unmute operations\n */\n private selfParticipant: ClickToCallSelf | null = null;\n\n /**\n * Call duration in seconds\n */\n @state()\n private callDuration: number = 0;\n\n /**\n * Error message\n */\n @state()\n private errorMessage: string = '';\n\n /**\n * RxJS subscriptions for cleanup\n */\n private subscriptions: Subscription[] = [];\n\n /**\n * Duration timer interval\n */\n private durationInterval: number | null = null;\n\n /**\n * Call start time\n */\n private callStartTime: number | null = null;\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.cleanup();\n }\n\n private async initiateCall() {\n if (!this.client || !this.destination) {\n this.errorMessage = 'No client or destination configured';\n this.status = 'error';\n return;\n }\n\n try {\n this.status = 'connecting';\n this.errorMessage = '';\n\n // Dispatch dial event\n this.dispatchEvent(\n new CustomEvent('sw-dial', {\n detail: { destination: this.destination },\n bubbles: true,\n composed: true\n })\n );\n\n const call = await this.client.dial(this.destination, {\n audio: true,\n video: !this.audioOnly\n });\n\n this.call = call;\n this.subscribeToCall(call);\n } catch (error) {\n this.status = 'error';\n this.errorMessage = error instanceof Error ? error.message : 'Failed to connect';\n console.error('Click-to-call error:', error);\n }\n }\n\n private subscribeToCall(call: ClickToCallCall) {\n // Subscribe to status\n if (call.status$) {\n const statusSub = call.status$.subscribe((status) => {\n if (status === 'active' || status === 'connected') {\n this.status = 'connected';\n this.startDurationTimer();\n } else if (status === 'disconnecting') {\n this.status = 'disconnecting';\n } else if (status === 'disconnected' || status === 'destroyed' || status === 'failed') {\n this.handleCallEnded();\n }\n });\n this.subscriptions.push(statusSub);\n }\n\n // Subscribe to self$ observable to get audioMuted$ updates when self becomes available\n if (call.self$) {\n const selfSub = call.self$\n .pipe(\n switchMap((self) => {\n this.selfParticipant = self;\n return self.audioMuted$;\n })\n )\n .subscribe((muted) => {\n if (muted !== undefined) this.audioMuted = muted;\n });\n this.subscriptions.push(selfSub);\n }\n }\n\n private startDurationTimer() {\n this.callStartTime = Date.now();\n this.callDuration = 0;\n\n this.durationInterval = window.setInterval(() => {\n if (this.callStartTime) {\n this.callDuration = Math.floor((Date.now() - this.callStartTime) / 1000);\n }\n }, 1000);\n }\n\n private stopDurationTimer() {\n if (this.durationInterval) {\n clearInterval(this.durationInterval);\n this.durationInterval = null;\n }\n this.callStartTime = null;\n }\n\n private formatDuration(seconds: number): string {\n const mins = Math.floor(seconds / 60);\n const secs = seconds % 60;\n return `${mins}:${secs.toString().padStart(2, '0')}`;\n }\n\n private handleCallEnded() {\n this.cleanup();\n this.status = 'idle';\n this.call = null;\n this.selfParticipant = null;\n this.audioMuted = false;\n this.callDuration = 0;\n\n this.dispatchEvent(\n new CustomEvent('sw-hangup', {\n bubbles: true,\n composed: true\n })\n );\n }\n\n private async toggleMute() {\n if (!this.selfParticipant) return;\n\n try {\n if (this.audioMuted) {\n await this.selfParticipant.unmute();\n } else {\n await this.selfParticipant.mute();\n }\n\n this.dispatchEvent(\n new CustomEvent('sw-mute-toggle', {\n detail: { muted: !this.audioMuted },\n bubbles: true,\n composed: true\n })\n );\n } catch (error) {\n console.error('Failed to toggle mute:', error);\n }\n }\n\n private async hangup() {\n if (!this.call) return;\n\n try {\n this.status = 'disconnecting';\n await this.call.hangup();\n } catch (error) {\n console.error('Failed to hangup:', error);\n this.handleCallEnded();\n }\n }\n\n private cleanup() {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions = [];\n this.stopDurationTimer();\n }\n\n private renderIdleState() {\n return html`\n <button\n class=\"call-button\"\n part=\"button\"\n @click=${this.initiateCall}\n ?disabled=${!this.client || !this.destination}\n aria-label=\"${this.label}\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M6.62 10.79c1.44 2.83 3.76 5.15 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z\"\n />\n </svg>\n ${this.label}\n </button>\n `;\n }\n\n private renderConnectingState() {\n return html`\n <div class=\"active-call\" part=\"controls\">\n <div class=\"status-row\">\n <div class=\"status\" part=\"status\">\n <span class=\"status-indicator connecting\"></span>\n Connecting...\n </div>\n </div>\n </div>\n `;\n }\n\n private renderConnectedState() {\n return html`\n <div class=\"active-call\" part=\"controls\">\n <div class=\"status-row\">\n <div class=\"status\" part=\"status\">\n <span class=\"status-indicator\"></span>\n Connected\n </div>\n <span class=\"duration\" part=\"duration\">${this.formatDuration(this.callDuration)}</span>\n </div>\n <div class=\"controls-row\">\n <button\n class=\"control-button ${this.audioMuted ? 'active' : ''}\"\n @click=${this.toggleMute}\n aria-label=\"${this.audioMuted ? 'Unmute' : 'Mute'}\"\n aria-pressed=\"${this.audioMuted}\"\n >\n ${this.audioMuted\n ? html`<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z\"\n />\n </svg>`\n : html`<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z\"\n />\n </svg>`}\n </button>\n <button class=\"control-button hangup-button\" @click=${this.hangup} aria-label=\"Hang up\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M12 9c-1.6 0-3.15.25-4.6.72v3.1c0 .39-.23.74-.56.9-.98.49-1.87 1.12-2.66 1.85-.18.18-.43.28-.7.28-.28 0-.53-.11-.71-.29L.29 13.08c-.18-.17-.29-.42-.29-.7 0-.28.11-.53.29-.71C3.34 8.78 7.46 7 12 7s8.66 1.78 11.71 4.67c.18.18.29.43.29.71 0 .28-.11.53-.29.71l-2.48 2.48c-.18.18-.43.29-.71.29-.27 0-.52-.11-.7-.28-.79-.74-1.69-1.36-2.67-1.85-.33-.16-.56-.5-.56-.9v-3.1C15.15 9.25 13.6 9 12 9z\"\n />\n </svg>\n </button>\n </div>\n </div>\n `;\n }\n\n private renderErrorState() {\n return html`\n <div class=\"container\" part=\"container\">\n ${this.renderIdleState()}\n ${this.errorMessage ? html`<div class=\"error-message\">${this.errorMessage}</div>` : null}\n </div>\n `;\n }\n\n render() {\n if (this.status === 'error') {\n return this.renderErrorState();\n }\n\n if (this.status === 'connecting') {\n return html` <div class=\"container\" part=\"container\">${this.renderConnectingState()}</div> `;\n }\n\n if (this.status === 'connected' || this.status === 'disconnecting') {\n return html` <div class=\"container\" part=\"container\">${this.renderConnectedState()}</div> `;\n }\n\n return html` <div class=\"container\" part=\"container\">${this.renderIdleState()}</div> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sw-click-to-call': ClickToCallComponent;\n }\n}\n","/**\n * Directory Component\n *\n * A searchable list of addresses from the directory service.\n * Supports filtering, selection, and pagination.\n *\n * @example\n * ```html\n * <sw-directory .directory=${directory}></sw-directory>\n * ```\n *\n * @fires sw-address-select - Fired when an address is selected. Detail: `{ address: Address }`\n * @fires sw-dial - Fired when the call button on an address is clicked. Detail: `{ address: Address, channel: string }`\n *\n * @cssprop [--sw-color-primary=#044cf6] - Primary brand color\n * @cssprop [--sw-color-primary-hover=#0339c4] - Primary color on hover\n * @cssprop [--sw-color-success=#10b981] - Success/positive color\n * @cssprop [--sw-color-text=#1f2937] - Primary text color\n * @cssprop [--sw-color-text-muted=#6b7280] - Secondary/muted text color\n * @cssprop [--sw-color-background=#ffffff] - Component background color\n * @cssprop [--sw-color-background-hover=#f3f4f6] - Background color on hover\n * @cssprop [--sw-color-background-active=#e5e7eb] - Background color on active/press\n * @cssprop [--sw-color-border=#e5e7eb] - Border color\n * @cssprop [--sw-font-family=-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif] - Font family\n * @cssprop [--sw-font-size-sm=12px] - Small font size\n * @cssprop [--sw-font-size-base=14px] - Base font size\n * @cssprop [--sw-font-size-lg=16px] - Large font size\n * @cssprop [--sw-space-1=4px] - Smallest spacing unit\n * @cssprop [--sw-space-2=8px] - Small spacing unit\n * @cssprop [--sw-space-3=12px] - Medium spacing unit\n * @cssprop [--sw-space-4=16px] - Large spacing unit\n * @cssprop [--sw-border-radius=8px] - Border radius for containers and inputs\n */\n\nimport { LitElement, html, css } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { Subscription } from 'rxjs';\nimport type { Observable } from 'rxjs';\n\n/**\n * Address type from SDK\n */\nexport interface Address {\n id: string;\n name: string;\n displayName?: string;\n type?: 'room' | 'person';\n channels?: {\n audio?: boolean;\n video?: boolean;\n messaging?: boolean;\n };\n}\n\n/**\n * Directory interface for component\n */\nexport interface DirectoryService {\n addresses$: Observable<Address[]>;\n loading$?: Observable<boolean>;\n hasMore$?: Observable<boolean>;\n loadMore?(): Promise<void>;\n}\n\n@customElement('sw-directory')\nexport class DirectoryComponent extends LitElement {\n static styles = css`\n :host {\n /* CSS Custom Properties for theming */\n --sw-color-primary: #044cf6;\n --sw-color-primary-hover: #0339c4;\n --sw-color-success: #10b981;\n --sw-color-text: #1f2937;\n --sw-color-text-muted: #6b7280;\n --sw-color-background: #ffffff;\n --sw-color-background-hover: #f3f4f6;\n --sw-color-background-active: #e5e7eb;\n --sw-color-border: #e5e7eb;\n --sw-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n --sw-font-size-sm: 12px;\n --sw-font-size-base: 14px;\n --sw-font-size-lg: 16px;\n --sw-space-1: 4px;\n --sw-space-2: 8px;\n --sw-space-3: 12px;\n --sw-space-4: 16px;\n --sw-border-radius: 8px;\n\n display: block;\n font-family: var(--sw-font-family);\n }\n\n /* Dark mode support */\n :host([data-theme='dark']) {\n --sw-color-text: #f9fafb;\n --sw-color-text-muted: #9ca3af;\n --sw-color-background: #1f2937;\n --sw-color-background-hover: #374151;\n --sw-color-background-active: #4b5563;\n --sw-color-border: #374151;\n }\n\n @media (prefers-color-scheme: dark) {\n :host(:not([data-theme='light'])) {\n --sw-color-text: #f9fafb;\n --sw-color-text-muted: #9ca3af;\n --sw-color-background: #1f2937;\n --sw-color-background-hover: #374151;\n --sw-color-background-active: #4b5563;\n --sw-color-border: #374151;\n }\n }\n\n .container {\n display: flex;\n flex-direction: column;\n background: var(--sw-color-background);\n border: 1px solid var(--sw-color-border);\n border-radius: var(--sw-border-radius);\n overflow: hidden;\n }\n\n .search {\n display: flex;\n align-items: center;\n gap: var(--sw-space-2);\n padding: var(--sw-space-3);\n border-bottom: 1px solid var(--sw-color-border);\n }\n\n .search-input {\n flex: 1;\n padding: var(--sw-space-2) var(--sw-space-3);\n border: 1px solid var(--sw-color-border);\n border-radius: var(--sw-border-radius);\n background: var(--sw-color-background);\n color: var(--sw-color-text);\n font-family: var(--sw-font-family);\n font-size: var(--sw-font-size-base);\n outline: none;\n transition: border-color 0.15s ease;\n }\n\n .search-input:focus {\n border-color: var(--sw-color-primary);\n }\n\n .search-input::placeholder {\n color: var(--sw-color-text-muted);\n }\n\n .list {\n display: flex;\n flex-direction: column;\n max-height: 400px;\n overflow-y: auto;\n }\n\n .item {\n display: flex;\n align-items: center;\n gap: var(--sw-space-3);\n padding: var(--sw-space-3) var(--sw-space-4);\n border-bottom: 1px solid var(--sw-color-border);\n cursor: pointer;\n transition: background-color 0.15s ease;\n }\n\n .item:last-child {\n border-bottom: none;\n }\n\n .item:hover {\n background: var(--sw-color-background-hover);\n }\n\n .item:active {\n background: var(--sw-color-background-active);\n }\n\n .item.selected {\n background: var(--sw-color-primary);\n color: white;\n }\n\n .item.selected .item-type,\n .item.selected .item-channels {\n color: rgba(255, 255, 255, 0.8);\n }\n\n .item-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border-radius: 50%;\n background: var(--sw-color-background-hover);\n color: var(--sw-color-text-muted);\n flex-shrink: 0;\n }\n\n .item.selected .item-icon {\n background: rgba(255, 255, 255, 0.2);\n color: white;\n }\n\n .item-icon svg {\n width: 20px;\n height: 20px;\n }\n\n .item-content {\n flex: 1;\n min-width: 0;\n }\n\n .item-name {\n font-size: var(--sw-font-size-base);\n font-weight: 500;\n color: inherit;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .item-type {\n font-size: var(--sw-font-size-sm);\n color: var(--sw-color-text-muted);\n text-transform: capitalize;\n }\n\n .item-channels {\n display: flex;\n gap: var(--sw-space-1);\n color: var(--sw-color-text-muted);\n }\n\n .item-channels svg {\n width: 16px;\n height: 16px;\n }\n\n .item-channels .active {\n color: var(--sw-color-success);\n }\n\n .loading,\n .empty {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--sw-space-4);\n color: var(--sw-color-text-muted);\n font-size: var(--sw-font-size-base);\n }\n\n .scroll-sentinel {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--sw-space-3);\n min-height: 1px;\n }\n\n .scroll-loading {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--sw-space-2);\n padding: var(--sw-space-3);\n color: var(--sw-color-text-muted);\n font-size: var(--sw-font-size-sm);\n }\n\n .spinner {\n width: 16px;\n height: 16px;\n border: 2px solid var(--sw-color-border);\n border-top-color: var(--sw-color-primary);\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .dial-button {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n background: var(--sw-color-success);\n border: none;\n border-radius: 50%;\n color: white;\n cursor: pointer;\n flex-shrink: 0;\n transition: background-color 0.15s ease;\n }\n\n .dial-button:hover {\n background: #0ea472;\n }\n\n .dial-button svg {\n width: 18px;\n height: 18px;\n }\n `;\n\n /**\n * Directory service with addresses$ observable\n */\n @property({ type: Object })\n directory: DirectoryService | null = null;\n\n /**\n * Currently selected address\n */\n @state()\n private selectedAddress: Address | null = null;\n\n /**\n * Search filter query\n */\n @state()\n private searchQuery: string = '';\n\n /**\n * List of addresses from directory\n */\n @state()\n private addresses: Address[] = [];\n\n /**\n * Loading state\n */\n @state()\n private loading: boolean = false;\n\n /**\n * Has more addresses to load\n */\n @state()\n private hasMore: boolean = false;\n\n /**\n * RxJS subscriptions for cleanup\n */\n private subscriptions: Subscription[] = [];\n\n /**\n * Debounce timer for search\n */\n private searchDebounceTimer: number | null = null;\n\n /**\n * IntersectionObserver for infinite scroll\n */\n private intersectionObserver: IntersectionObserver | null = null;\n\n /**\n * Flag to track if we're auto-loading for search\n */\n @state()\n private isAutoLoadingForSearch: boolean = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.subscribeToDirectory();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.cleanup();\n }\n\n private subscribeToDirectory() {\n if (!this.directory) return;\n\n // Subscribe to addresses\n if (this.directory.addresses$) {\n const addressesSub = this.directory.addresses$.subscribe((addresses) => {\n this.addresses = addresses;\n });\n this.subscriptions.push(addressesSub);\n }\n\n // Subscribe to loading state\n if (this.directory.loading$) {\n const loadingSub = this.directory.loading$.subscribe((loading) => {\n this.loading = loading;\n });\n this.subscriptions.push(loadingSub);\n }\n\n // Subscribe to hasMore\n if (this.directory.hasMore$) {\n const hasMoreSub = this.directory.hasMore$.subscribe((hasMore) => {\n this.hasMore = hasMore;\n });\n this.subscriptions.push(hasMoreSub);\n }\n\n // Load initial data\n if (this.directory.loadMore) {\n this.directory.loadMore();\n }\n }\n\n private cleanup() {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions = [];\n if (this.searchDebounceTimer) {\n clearTimeout(this.searchDebounceTimer);\n }\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect();\n this.intersectionObserver = null;\n }\n }\n\n protected firstUpdated() {\n this.setupInfiniteScroll();\n }\n\n private setupInfiniteScroll() {\n const sentinel = this.shadowRoot?.querySelector('.scroll-sentinel');\n if (!sentinel) return;\n\n this.intersectionObserver = new IntersectionObserver(\n (entries) => {\n const entry = entries[0];\n if (entry?.isIntersecting && this.hasMore && !this.loading) {\n this.handleLoadMore();\n }\n },\n {\n root: this.shadowRoot?.querySelector('.list'),\n rootMargin: '100px',\n threshold: 0\n }\n );\n\n this.intersectionObserver.observe(sentinel);\n }\n\n protected updated(changedProperties: Map<string, unknown>) {\n super.updated(changedProperties);\n\n // Handle directory property changes\n if (changedProperties.has('directory')) {\n this.cleanup();\n this.subscribeToDirectory();\n }\n\n // Re-setup infinite scroll if needed\n if (!this.intersectionObserver) {\n this.setupInfiniteScroll();\n }\n\n // Auto-load more when searching and no results found but more available\n // Also check when loading state changes so we can trigger subsequent loads\n if (\n changedProperties.has('addresses') ||\n changedProperties.has('searchQuery') ||\n changedProperties.has('loading')\n ) {\n this.checkAutoLoadForSearch();\n }\n }\n\n private async checkAutoLoadForSearch() {\n // If we have a search query, no filtered results, but more to load, keep loading\n // Note: !this.loading prevents concurrent loads, isAutoLoadingForSearch is for UI state only\n if (\n this.searchQuery.trim() &&\n this.filteredAddresses.length === 0 &&\n this.hasMore &&\n !this.loading\n ) {\n this.isAutoLoadingForSearch = true;\n await this.handleLoadMore();\n // The updated() will be called again when addresses/loading change, continuing the loop\n } else if (this.filteredAddresses.length > 0 || !this.hasMore) {\n this.isAutoLoadingForSearch = false;\n }\n }\n\n private get filteredAddresses(): Address[] {\n if (!this.searchQuery.trim()) {\n return this.addresses;\n }\n const query = this.searchQuery.toLowerCase();\n return this.addresses.filter(\n (addr) =>\n addr.name.toLowerCase().includes(query) ||\n (addr.displayName && addr.displayName.toLowerCase().includes(query))\n );\n }\n\n private handleSearchInput(e: Event) {\n const input = e.target as HTMLInputElement;\n\n // Debounce search\n if (this.searchDebounceTimer) {\n clearTimeout(this.searchDebounceTimer);\n }\n\n this.searchDebounceTimer = window.setTimeout(() => {\n this.searchQuery = input.value;\n }, 200);\n }\n\n private handleItemClick(address: Address) {\n this.selectedAddress = address;\n\n this.dispatchEvent(\n new CustomEvent('sw-address-select', {\n detail: { address },\n bubbles: true,\n composed: true\n })\n );\n }\n\n private handleItemDoubleClick(address: Address) {\n this.handleDial(address);\n }\n\n private handleDial(address: Address) {\n this.dispatchEvent(\n new CustomEvent('sw-dial', {\n detail: { address },\n bubbles: true,\n composed: true\n })\n );\n }\n\n private async handleLoadMore() {\n if (this.directory?.loadMore) {\n await this.directory.loadMore();\n }\n }\n\n private renderAddressIcon(address: Address) {\n if (address.type === 'room') {\n return html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 3c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6zm7 13H5v-.23c0-.62.28-1.2.76-1.58C7.47 15.82 9.64 15 12 15s4.53.82 6.24 2.19c.48.38.76.97.76 1.58V19z\"\n />\n </svg>\n `;\n }\n return html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\"\n />\n </svg>\n `;\n }\n\n private renderChannelIcons(address: Address) {\n const channels = address.channels || {};\n return html`\n <div class=\"item-channels\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"${channels.audio ? 'active' : ''}\"\n title=\"Audio\"\n >\n <path\n d=\"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z\"\n />\n </svg>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n class=\"${channels.video ? 'active' : ''}\"\n title=\"Video\"\n >\n <path\n d=\"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z\"\n />\n </svg>\n </div>\n `;\n }\n\n private renderLoadingIndicator() {\n return html`\n <div class=\"scroll-loading\">\n <div class=\"spinner\"></div>\n <span>${this.isAutoLoadingForSearch ? 'Searching...' : 'Loading more...'}</span>\n </div>\n `;\n }\n\n render() {\n const showInitialLoading = this.loading && this.addresses.length === 0;\n const showEmptyState = !this.loading && this.filteredAddresses.length === 0 && !this.hasMore;\n const showSearchingState = this.isAutoLoadingForSearch && this.filteredAddresses.length === 0;\n\n return html`\n <div class=\"container\" part=\"container\">\n <div class=\"search\" part=\"search\">\n <input\n type=\"text\"\n class=\"search-input\"\n placeholder=\"Search addresses...\"\n @input=${this.handleSearchInput}\n aria-label=\"Search addresses\"\n />\n </div>\n\n <div class=\"list\" part=\"list\" role=\"listbox\">\n ${showInitialLoading\n ? html`<div class=\"loading\">Loading...</div>`\n : showSearchingState\n ? this.renderLoadingIndicator()\n : showEmptyState\n ? html`<div class=\"empty\">No addresses found</div>`\n : html`\n ${this.filteredAddresses.map(\n (address) => html`\n <div\n class=\"item ${this.selectedAddress?.id === address.id ? 'selected' : ''}\"\n part=\"item ${this.selectedAddress?.id === address.id\n ? 'item-selected'\n : ''}\"\n role=\"option\"\n aria-selected=\"${this.selectedAddress?.id === address.id}\"\n @click=${() => this.handleItemClick(address)}\n @dblclick=${() => this.handleItemDoubleClick(address)}\n >\n <div class=\"item-icon\">${this.renderAddressIcon(address)}</div>\n <div class=\"item-content\">\n <div class=\"item-name\" part=\"item-name\">\n ${address.displayName || address.name}\n </div>\n <div class=\"item-type\" part=\"item-type\">\n ${address.type || 'address'}\n </div>\n </div>\n ${this.renderChannelIcons(address)}\n <button\n class=\"dial-button\"\n @click=${(e: Event) => {\n e.stopPropagation();\n this.handleDial(address);\n }}\n aria-label=\"Call ${address.displayName || address.name}\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M6.62 10.79c1.44 2.83 3.76 5.15 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z\"\n />\n </svg>\n </button>\n </div>\n `\n )}\n <!-- Scroll sentinel for infinite scroll -->\n <div class=\"scroll-sentinel\">\n ${this.loading && !this.isAutoLoadingForSearch\n ? this.renderLoadingIndicator()\n : null}\n </div>\n `}\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sw-directory': DirectoryComponent;\n }\n}\n","/**\n * Participant Controls Component\n *\n * Individual participant control panel with actions like mute, remove,\n * volume control, and pin/spotlight.\n *\n * @example\n * ```html\n * <sw-participant-controls\n * .participant=${participant}\n * .capabilities=${['memberMuteAudio', 'memberRemove']}\n * ></sw-participant-controls>\n * ```\n *\n * @fires sw-participant-mute-audio - Fired to toggle a participant's audio. Detail: `{ participantId: string, muted: boolean }`\n * @fires sw-participant-mute-video - Fired to toggle a participant's video. Detail: `{ participantId: string, muted: boolean }`\n * @fires sw-participant-remove - Fired to remove a participant. Detail: `{ participantId: string }`\n * @fires sw-participant-volume - Fired when a participant's volume changes. Detail: `{ participantId: string, volume: number }`\n * @fires sw-participant-pin - Fired to pin/unpin a participant. Detail: `{ participantId: string, pinned: boolean }`\n *\n * @cssprop [--sw-color-primary=#044cf6] - Primary brand color\n * @cssprop [--sw-color-primary-hover=#0339c4] - Primary color on hover\n * @cssprop [--sw-color-success=#10b981] - Success/positive color\n * @cssprop [--sw-color-danger=#ef4444] - Danger/destructive color\n * @cssprop [--sw-color-danger-hover=#dc2626] - Danger color on hover\n * @cssprop [--sw-color-warning=#f59e0b] - Warning color\n * @cssprop [--sw-color-text=#1f2937] - Primary text color\n * @cssprop [--sw-color-text-muted=#6b7280] - Secondary/muted text color\n * @cssprop [--sw-color-text-inverse=#ffffff] - Inverse text color for active buttons\n * @cssprop [--sw-color-background=#ffffff] - Component background color\n * @cssprop [--sw-color-background-hover=#f3f4f6] - Background color on hover\n * @cssprop [--sw-color-background-active=#e5e7eb] - Background color on active/press\n * @cssprop [--sw-color-border=#e5e7eb] - Border color\n * @cssprop [--sw-font-family=-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif] - Font family\n * @cssprop [--sw-font-size-xs=11px] - Extra-small font size\n * @cssprop [--sw-font-size-sm=12px] - Small font size\n * @cssprop [--sw-font-size-base=14px] - Base font size\n * @cssprop [--sw-space-1=4px] - Smallest spacing unit\n * @cssprop [--sw-space-2=8px] - Small spacing unit\n * @cssprop [--sw-space-3=12px] - Medium spacing unit\n * @cssprop [--sw-space-4=16px] - Large spacing unit\n * @cssprop [--sw-border-radius=8px] - Border radius for containers and buttons\n */\n\nimport { LitElement, html, css } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { Subscription } from 'rxjs';\nimport type { Observable } from 'rxjs';\n\n/**\n * Participant interface for controls component\n */\nexport interface ControlParticipant {\n id: string;\n name$?: Observable<string | undefined>;\n audioMuted$?: Observable<boolean | undefined>;\n videoMuted$?: Observable<boolean | undefined>;\n mute?(): Promise<void>;\n unmute?(): Promise<void>;\n muteVideo?(): Promise<void>;\n unmuteVideo?(): Promise<void>;\n remove?(): Promise<void>;\n}\n\n@customElement('sw-participant-controls')\nexport class ParticipantControlsComponent extends LitElement {\n static styles = css`\n :host {\n /* CSS Custom Properties for theming */\n --sw-color-primary: #044cf6;\n --sw-color-primary-hover: #0339c4;\n --sw-color-success: #10b981;\n --sw-color-danger: #ef4444;\n --sw-color-danger-hover: #dc2626;\n --sw-color-warning: #f59e0b;\n --sw-color-text: #1f2937;\n --sw-color-text-muted: #6b7280;\n --sw-color-text-inverse: #ffffff;\n --sw-color-background: #ffffff;\n --sw-color-background-hover: #f3f4f6;\n --sw-color-background-active: #e5e7eb;\n --sw-color-border: #e5e7eb;\n --sw-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n --sw-font-size-xs: 11px;\n --sw-font-size-sm: 12px;\n --sw-font-size-base: 14px;\n --sw-space-1: 4px;\n --sw-space-2: 8px;\n --sw-space-3: 12px;\n --sw-space-4: 16px;\n --sw-border-radius: 8px;\n\n display: block;\n font-family: var(--sw-font-family);\n }\n\n /* Dark mode support */\n :host([data-theme='dark']) {\n --sw-color-text: #f9fafb;\n --sw-color-text-muted: #9ca3af;\n --sw-color-background: #1f2937;\n --sw-color-background-hover: #374151;\n --sw-color-background-active: #4b5563;\n --sw-color-border: #374151;\n }\n\n @media (prefers-color-scheme: dark) {\n :host(:not([data-theme='light'])) {\n --sw-color-text: #f9fafb;\n --sw-color-text-muted: #9ca3af;\n --sw-color-background: #1f2937;\n --sw-color-background-hover: #374151;\n --sw-color-background-active: #4b5563;\n --sw-color-border: #374151;\n }\n }\n\n .container {\n display: flex;\n flex-direction: column;\n gap: var(--sw-space-2);\n padding: var(--sw-space-3);\n background: var(--sw-color-background);\n border: 1px solid var(--sw-color-border);\n border-radius: var(--sw-border-radius);\n min-width: 200px;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n }\n\n .header {\n display: flex;\n align-items: center;\n gap: var(--sw-space-2);\n padding-bottom: var(--sw-space-2);\n border-bottom: 1px solid var(--sw-color-border);\n }\n\n .participant-name {\n flex: 1;\n font-size: var(--sw-font-size-base);\n font-weight: 500;\n color: var(--sw-color-text);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .actions {\n display: flex;\n flex-direction: column;\n gap: var(--sw-space-2);\n }\n\n .action-button {\n display: flex;\n align-items: center;\n gap: var(--sw-space-2);\n padding: var(--sw-space-2) var(--sw-space-3);\n background: var(--sw-color-background-hover);\n border: none;\n border-radius: var(--sw-border-radius);\n color: var(--sw-color-text);\n font-family: var(--sw-font-family);\n font-size: var(--sw-font-size-sm);\n cursor: pointer;\n transition: background-color 0.15s ease;\n text-align: left;\n }\n\n .action-button:hover {\n background: var(--sw-color-background-active);\n }\n\n .action-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .action-button.active {\n background: var(--sw-color-danger);\n color: var(--sw-color-text-inverse);\n }\n\n .action-button.active:hover {\n background: var(--sw-color-danger-hover);\n }\n\n .action-button.danger {\n color: var(--sw-color-danger);\n }\n\n .action-button.danger:hover {\n background: var(--sw-color-danger);\n color: var(--sw-color-text-inverse);\n }\n\n .action-button svg {\n width: 16px;\n height: 16px;\n flex-shrink: 0;\n }\n\n .volume-control {\n display: flex;\n flex-direction: column;\n gap: var(--sw-space-1);\n }\n\n .volume-label {\n display: flex;\n align-items: center;\n gap: var(--sw-space-2);\n font-size: var(--sw-font-size-sm);\n color: var(--sw-color-text-muted);\n }\n\n .volume-label svg {\n width: 14px;\n height: 14px;\n }\n\n .volume-slider {\n width: 100%;\n height: 4px;\n -webkit-appearance: none;\n appearance: none;\n background: var(--sw-color-border);\n border-radius: 2px;\n outline: none;\n cursor: pointer;\n }\n\n .volume-slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 14px;\n height: 14px;\n background: var(--sw-color-primary);\n border-radius: 50%;\n cursor: pointer;\n transition: transform 0.1s ease;\n }\n\n .volume-slider::-webkit-slider-thumb:hover {\n transform: scale(1.2);\n }\n\n .volume-slider::-moz-range-thumb {\n width: 14px;\n height: 14px;\n background: var(--sw-color-primary);\n border-radius: 50%;\n border: none;\n cursor: pointer;\n }\n\n .no-actions {\n color: var(--sw-color-text-muted);\n font-size: var(--sw-font-size-sm);\n text-align: center;\n padding: var(--sw-space-2);\n }\n `;\n\n /**\n * Participant object to control\n */\n @property({ attribute: false })\n participant: ControlParticipant | null = null;\n\n /**\n * Available capabilities (actions user can perform)\n */\n @property({ attribute: false })\n capabilities: string[] = [];\n\n /**\n * Whether to show volume slider\n */\n @property({ type: Boolean, attribute: 'show-volume' })\n showVolume: boolean = false;\n\n /**\n * Whether to show pin/spotlight button\n */\n @property({ type: Boolean, attribute: 'show-pin' })\n showPin: boolean = false;\n\n /**\n * Current volume (0-100)\n */\n @state()\n private volume: number = 100;\n\n /**\n * Participant name\n */\n @state()\n private participantName: string = 'Participant';\n\n /**\n * Audio mute state\n */\n @state()\n private audioMuted: boolean = false;\n\n /**\n * Video mute state\n */\n @state()\n private videoMuted: boolean = false;\n\n /**\n * Is pinned/spotlighted\n */\n @state()\n private isPinned: boolean = false;\n\n /**\n * RxJS subscriptions for cleanup\n */\n private subscriptions: Subscription[] = [];\n\n connectedCallback() {\n super.connectedCallback();\n this.subscribeToParticipant();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.cleanup();\n }\n\n updated(changedProperties: Map<string, unknown>) {\n if (changedProperties.has('participant')) {\n this.cleanup();\n this.subscribeToParticipant();\n }\n }\n\n private subscribeToParticipant() {\n if (!this.participant) return;\n\n if (this.participant.name$) {\n const nameSub = this.participant.name$.subscribe((name) => {\n if (name !== undefined) this.participantName = name;\n });\n this.subscriptions.push(nameSub);\n }\n\n if (this.participant.audioMuted$) {\n const audioSub = this.participant.audioMuted$.subscribe((muted) => {\n if (muted !== undefined) this.audioMuted = muted;\n });\n this.subscriptions.push(audioSub);\n }\n\n if (this.participant.videoMuted$) {\n const videoSub = this.participant.videoMuted$.subscribe((muted) => {\n if (muted !== undefined) this.videoMuted = muted;\n });\n this.subscriptions.push(videoSub);\n }\n }\n\n private cleanup() {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions = [];\n }\n\n private get canMuteAudio(): boolean {\n return this.capabilities.includes('memberMuteAudio');\n }\n\n private get canMuteVideo(): boolean {\n return this.capabilities.includes('memberMuteVideo');\n }\n\n private get canRemove(): boolean {\n return this.capabilities.includes('memberRemove');\n }\n\n private get hasAnyCapability(): boolean {\n return (\n this.canMuteAudio || this.canMuteVideo || this.canRemove || this.showVolume || this.showPin\n );\n }\n\n private async handleToggleAudioMute() {\n if (!this.participant) return;\n\n try {\n if (this.audioMuted && this.participant.unmute) {\n await this.participant.unmute();\n } else if (!this.audioMuted && this.participant.mute) {\n await this.participant.mute();\n }\n\n this.dispatchEvent(\n new CustomEvent('sw-participant-mute-audio', {\n detail: { participant: this.participant, muted: !this.audioMuted },\n bubbles: true,\n composed: true\n })\n );\n } catch (error) {\n console.error('Failed to toggle audio mute:', error);\n }\n }\n\n private async handleToggleVideoMute() {\n if (!this.participant) return;\n\n try {\n if (this.videoMuted && this.participant.unmuteVideo) {\n await this.participant.unmuteVideo();\n } else if (!this.videoMuted && this.participant.muteVideo) {\n await this.participant.muteVideo();\n }\n\n this.dispatchEvent(\n new CustomEvent('sw-participant-mute-video', {\n detail: { participant: this.participant, muted: !this.videoMuted },\n bubbles: true,\n composed: true\n })\n );\n } catch (error) {\n console.error('Failed to toggle video mute:', error);\n }\n }\n\n private async handleRemove() {\n if (!this.participant?.remove) return;\n\n try {\n await this.participant.remove();\n\n this.dispatchEvent(\n new CustomEvent('sw-participant-remove', {\n detail: { participant: this.participant },\n bubbles: true,\n composed: true\n })\n );\n } catch (error) {\n console.error('Failed to remove participant:', error);\n }\n }\n\n private handleVolumeChange(e: Event) {\n const input = e.target as HTMLInputElement;\n this.volume = parseInt(input.value, 10);\n\n this.dispatchEvent(\n new CustomEvent('sw-participant-volume', {\n detail: { participant: this.participant, volume: this.volume },\n bubbles: true,\n composed: true\n })\n );\n }\n\n private handleTogglePin() {\n this.isPinned = !this.isPinned;\n\n this.dispatchEvent(\n new CustomEvent('sw-participant-pin', {\n detail: { participant: this.participant, pinned: this.isPinned },\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html`\n <div class=\"container\" part=\"container\">\n <div class=\"header\">\n <span class=\"participant-name\">${this.participantName}</span>\n </div>\n\n <div class=\"actions\">\n ${!this.hasAnyCapability\n ? html`<div class=\"no-actions\">No actions available</div>`\n : null}\n ${this.canMuteAudio\n ? html`\n <button\n class=\"action-button ${this.audioMuted ? 'active' : ''}\"\n part=\"action-button\"\n @click=${this.handleToggleAudioMute}\n aria-label=\"${this.audioMuted ? 'Unmute audio' : 'Mute audio'}\"\n >\n ${this.audioMuted\n ? html`<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z\"\n />\n </svg>`\n : html`<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z\"\n />\n </svg>`}\n ${this.audioMuted ? 'Unmute' : 'Mute'}\n </button>\n `\n : null}\n ${this.canMuteVideo\n ? html`\n <button\n class=\"action-button ${this.videoMuted ? 'active' : ''}\"\n part=\"action-button\"\n @click=${this.handleToggleVideoMute}\n aria-label=\"${this.videoMuted ? 'Unmute video' : 'Mute video'}\"\n >\n ${this.videoMuted\n ? html`<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M21 6.5l-4 4V7c0-.55-.45-1-1-1H9.82L21 17.18V6.5zM3.27 2L2 3.27 4.73 6H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.21 0 .39-.08.54-.18L19.73 21 21 19.73 3.27 2z\"\n />\n </svg>`\n : html`<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z\"\n />\n </svg>`}\n ${this.videoMuted ? 'Enable video' : 'Disable video'}\n </button>\n `\n : null}\n ${this.showVolume\n ? html`\n <div class=\"volume-control\" part=\"slider\">\n <label class=\"volume-label\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z\"\n />\n </svg>\n Volume: ${this.volume}%\n </label>\n <input\n type=\"range\"\n class=\"volume-slider\"\n min=\"0\"\n max=\"100\"\n .value=${String(this.volume)}\n @input=${this.handleVolumeChange}\n aria-label=\"Participant volume\"\n />\n </div>\n `\n : null}\n ${this.showPin\n ? html`\n <button\n class=\"action-button ${this.isPinned ? 'active' : ''}\"\n part=\"action-button\"\n @click=${this.handleTogglePin}\n aria-label=\"${this.isPinned ? 'Unpin' : 'Pin'}\"\n aria-pressed=\"${this.isPinned}\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M16 12V4h1V2H7v2h1v8l-2 2v2h5.2v6h1.6v-6H18v-2l-2-2z\" />\n </svg>\n ${this.isPinned ? 'Unpin' : 'Pin'}\n </button>\n `\n : null}\n ${this.canRemove\n ? html`\n <button\n class=\"action-button danger\"\n part=\"action-button\"\n @click=${this.handleRemove}\n aria-label=\"Remove participant\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n />\n </svg>\n Remove\n </button>\n `\n : null}\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sw-participant-controls': ParticipantControlsComponent;\n }\n}\n","/**\n * @signalwire/web-components\n * UI Components Library built with Lit\n */\n\n// Export components\nexport { ExampleButton } from './components/example-button.js';\nexport { CallMedia } from './components/call-media.js';\nexport { Participants } from './components/participants.js';\nexport { SelfMedia } from './components/self-media.js';\nexport { AudioLevel } from './components/audio-level.js';\nexport { DeviceSelector } from './components/device-selector.js';\nexport { CallControls } from './components/call-controls.js';\nexport { CallStatusComponent } from './components/call-status.js';\nexport { DialpadComponent } from './components/dialpad.js';\nexport { ClickToCallComponent } from './components/click-to-call.js';\nexport { DirectoryComponent } from './components/directory.js';\nexport { ParticipantControlsComponent } from './components/participant-controls.js';\n\n// Export types (re-exported from core)\nexport type { Call, CallParticipant, CallSelfParticipant, DeviceController, LayoutLayer, Participant } from './types/index.js';\n\n// Export context\nexport * from './context/index.js';\n\n// Re-export Lit utilities for convenience\nexport { html, css, LitElement } from 'lit';\nexport type { TemplateResult, CSSResult } from 'lit';\n\n// ============================================================================\n// Library Ready Event (for async/dynamic script loading)\n// ============================================================================\n\ndeclare const __VERSION__: string;\n\n/**\n * Library version from package.json, injected at build time.\n */\nexport const version: string = __VERSION__;\n\n/**\n * Flag indicating the library has been loaded and is ready to use.\n */\nexport const ready: boolean = true;\n\n/**\n * Emits 'signalwire:web-components:ready' event when the library is loaded.\n *\n * Scripts that might load BEFORE the library (check flag first):\n * ```js\n * if (window.SignalWireUI?.ready) {\n * // Library already loaded, use it directly\n * initApp();\n * } else {\n * window.addEventListener('signalwire:web-components:ready', () => initApp());\n * }\n * ```\n */\nconst emitReadyEvent = (): void => {\n if (typeof window !== 'undefined') {\n const event = new CustomEvent('signalwire:web-components:ready', {\n detail: { version: __VERSION__ }\n });\n window.dispatchEvent(event);\n }\n};\n\nemitReadyEvent();\n","/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n \"use strict\";\n if (typeof define === 'function' && define.amd) {\n define(definition);\n } else if (typeof module === 'object' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n \"use strict\";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = \"undefined\";\n var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (\n /Trident\\/|MSIE /.test(window.navigator.userAgent)\n );\n\n var logMethods = [\n \"trace\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\"\n ];\n\n var _loggersByName = {};\n var defaultLogger = null;\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === 'function') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Trace() doesn't print the message in IE, so for that case we need to wrap it\n function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods() {\n /*jshint validthis:true */\n var level = this.getLevel();\n\n // Replace the actual methods.\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, this.name);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n\n // Return any important warnings.\n if (typeof console === undefinedType && level < this.levels.SILENT) {\n return \"No console available for logging\";\n }\n }\n\n // In old IE versions, the console isn't present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, _level, _loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, factory) {\n // Private instance variables.\n var self = this;\n /**\n * The level inherited from a parent logger (or a global default). We\n * cache this here rather than delegating to the parent so that it stays\n * in sync with the actual logging methods that we have installed (the\n * parent could change levels but we might not have rebuilt the loggers\n * in this child yet).\n * @type {number}\n */\n var inheritedLevel;\n /**\n * The default level for this logger, if any. If set, this overrides\n * `inheritedLevel`.\n * @type {number|null}\n */\n var defaultLevel;\n /**\n * A user-specific level for this logger. If set, this overrides\n * `defaultLevel`.\n * @type {number|null}\n */\n var userLevel;\n\n var storageKey = \"loglevel\";\n if (typeof name === \"string\") {\n storageKey += \":\" + name;\n } else if (typeof name === \"symbol\") {\n storageKey = undefined;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || 'silent').toUpperCase();\n\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=\" + levelName + \";\";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType || !storageKey) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var cookieName = encodeURIComponent(storageKey);\n var location = cookie.indexOf(cookieName + \"=\");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(\n cookie.slice(location + cookieName.length + 1)\n )[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n function clearPersistedLevel() {\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage.removeItem(storageKey);\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n } catch (ignore) {}\n }\n\n function normalizeLevel(input) {\n var level = input;\n if (typeof level === \"string\" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === \"number\" && level >= 0 && level <= self.levels.SILENT) {\n return level;\n } else {\n throw new TypeError(\"log.setLevel() called with invalid level: \" + input);\n }\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { \"TRACE\": 0, \"DEBUG\": 1, \"INFO\": 2, \"WARN\": 3,\n \"ERROR\": 4, \"SILENT\": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n if (userLevel != null) {\n return userLevel;\n } else if (defaultLevel != null) {\n return defaultLevel;\n } else {\n return inheritedLevel;\n }\n };\n\n self.setLevel = function (level, persist) {\n userLevel = normalizeLevel(level);\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(userLevel);\n }\n\n // NOTE: in v2, this should call rebuild(), which updates children.\n return replaceLoggingMethods.call(self);\n };\n\n self.setDefaultLevel = function (level) {\n defaultLevel = normalizeLevel(level);\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.resetLevel = function () {\n userLevel = null;\n clearPersistedLevel();\n replaceLoggingMethods.call(self);\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n self.rebuild = function () {\n if (defaultLogger !== self) {\n inheritedLevel = normalizeLevel(defaultLogger.getLevel());\n }\n replaceLoggingMethods.call(self);\n\n if (defaultLogger === self) {\n for (var childName in _loggersByName) {\n _loggersByName[childName].rebuild();\n }\n }\n };\n\n // Initialize all the internal levels.\n inheritedLevel = normalizeLevel(\n defaultLogger ? defaultLogger.getLevel() : \"WARN\"\n );\n var initialLevel = getPersistedLevel();\n if (initialLevel != null) {\n userLevel = normalizeLevel(initialLevel);\n }\n replaceLoggingMethods.call(self);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n defaultLogger = new Logger();\n\n defaultLogger.getLogger = function getLogger(name) {\n if ((typeof name !== \"symbol\" && typeof name !== \"string\") || name === \"\") {\n throw new TypeError(\"You must supply a name when creating a logger.\");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name,\n defaultLogger.methodFactory\n );\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n // ES6 default export, for compatibility\n defaultLogger['default'] = defaultLogger;\n\n return defaultLogger;\n}));\n","import { filter, map, pipe } from \"rxjs\";\nimport log from \"loglevel\";\nimport { filter as filter$1, map as map$1 } from \"rxjs/operators\";\n\n//#region src/core/errors.ts\nvar UnexpectedError = class extends Error {\n\tconstructor(at, options) {\n\t\tsuper(`Unexpected Error${at ? ` at ${at}` : \"\"}`, options);\n\t\tthis.at = at;\n\t\tthis.name = \"UnexpectedError\";\n\t}\n};\nvar UnimplementedError = class extends Error {\n\tconstructor(reason = \"Not Implemented\", options) {\n\t\tsuper(reason, options);\n\t\tthis.reason = reason;\n\t\tthis.name = \"UnimplementedError\";\n\t}\n};\nvar InvalidCredentialsError = class extends Error {\n\tconstructor(reason = \"Invalid Credentials\", options) {\n\t\tsuper(reason, options);\n\t\tthis.reason = reason;\n\t\tthis.name = \"InvalidCredentialsError\";\n\t}\n};\nvar WebSocketConnectionError = class extends Error {\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tthis.name = \"WebSocketConnectionError\";\n\t}\n};\nvar TransportConnectionError = class extends Error {\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tthis.name = \"TransportConnectionError\";\n\t}\n};\nvar WebSocketTimeoutError = class extends Error {\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tthis.name = \"WebSocketTimeoutError\";\n\t}\n};\nvar RequestTimeoutError = class extends Error {\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tthis.name = \"RequestTimeoutError\";\n\t}\n};\nvar RequestError = class extends Error {\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tthis.name = \"RequestError\";\n\t}\n};\nvar RPCTimeoutError = class extends Error {\n\tconstructor(requestId, timeoutMs, options) {\n\t\tsuper(`RPC request ${requestId} timed out after ${timeoutMs}ms`, options);\n\t\tthis.requestId = requestId;\n\t\tthis.timeoutMs = timeoutMs;\n\t\tthis.name = \"RPCTimeoutError\";\n\t}\n};\nvar AuthStateHandlerError = class extends Error {\n\tconstructor(error = null, options) {\n\t\tsuper(\"Error handling authorization state update\", {\n\t\t\t...options,\n\t\t\tcause: options?.cause ?? (error instanceof Error ? error : void 0)\n\t\t});\n\t\tthis.error = error;\n\t\tthis.name = \"AuthStateHandlerError\";\n\t}\n};\nvar StorageNotAvailableError = class extends Error {\n\tconstructor(storageType = \"localStorage\", options) {\n\t\tsuper(`${storageType} is not available in this environment`, options);\n\t\tthis.storageType = storageType;\n\t\tthis.name = \"StorageNotAvailableError\";\n\t}\n};\nvar SerializationError = class extends Error {\n\tconstructor(key, originalError) {\n\t\tsuper(`Failed to serialize value for key \"${key}\": ${originalError.message}`, { cause: originalError });\n\t\tthis.key = key;\n\t\tthis.originalError = originalError;\n\t\tthis.name = \"SerializationError\";\n\t}\n};\nvar DeserializationError = class extends Error {\n\tconstructor(key, originalError) {\n\t\tsuper(`Failed to deserialize value for key \"${key}\": ${originalError.message}`, { cause: originalError });\n\t\tthis.key = key;\n\t\tthis.originalError = originalError;\n\t\tthis.name = \"DeserializationError\";\n\t}\n};\nvar StorageWriteError = class extends Error {\n\tconstructor(key, originalError) {\n\t\tsuper(`Failed to write to storage for key \"${key}\": ${originalError.message}`, { cause: originalError });\n\t\tthis.key = key;\n\t\tthis.originalError = originalError;\n\t\tthis.name = \"StorageWriteError\";\n\t}\n};\nvar StorageReadError = class extends Error {\n\tconstructor(key, originalError) {\n\t\tsuper(`Failed to read from storage \"${key}\": ${originalError.message}`, { cause: originalError });\n\t\tthis.key = key;\n\t\tthis.originalError = originalError;\n\t\tthis.name = \"StorageReadError\";\n\t}\n};\nvar DependencyError = class extends Error {\n\tconstructor(description, options) {\n\t\tsuper(`Dependency ${description} is not set or available.`, options);\n\t\tthis.description = description;\n\t\tthis.name = \"DependencyError\";\n\t}\n};\nvar CallCreateError = class extends Error {\n\tconstructor(message, error = null, direction = \"outbound\", options) {\n\t\tsuper(message, {\n\t\t\t...options,\n\t\t\tcause: options?.cause ?? (error instanceof Error ? error : void 0)\n\t\t});\n\t\tthis.message = message;\n\t\tthis.error = error;\n\t\tthis.direction = direction;\n\t\tthis.name = \"CallCreateError\";\n\t}\n};\nvar JSONRPCError = class extends Error {\n\tconstructor(code, message, data, options, requestId) {\n\t\tsuper(message, options);\n\t\tthis.code = code;\n\t\tthis.data = data;\n\t\tthis.requestId = requestId;\n\t\tthis.name = \"JSONRPCError\";\n\t}\n};\nvar InvalidParams = class extends Error {\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tthis.message = message;\n\t\tthis.name = \"InvalidParams\";\n\t}\n};\nvar ConversationError = class extends Error {\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tthis.message = message;\n\t\tthis.name = \"ConversationError\";\n\t}\n};\nvar VertoInviteHandlerError = class extends Error {\n\tconstructor(error = null, options) {\n\t\tsuper(\"Error handling Verto invite\", {\n\t\t\t...options,\n\t\t\tcause: options?.cause ?? (error instanceof Error ? error : void 0)\n\t\t});\n\t\tthis.error = error;\n\t\tthis.name = \"VertoInviteHandlerError\";\n\t}\n};\nvar VertoAttachHandlerError = class extends Error {\n\tconstructor(error = null, options) {\n\t\tsuper(\"Error handling Verto attach\", {\n\t\t\t...options,\n\t\t\tcause: options?.cause ?? (error instanceof Error ? error : void 0)\n\t\t});\n\t\tthis.error = error;\n\t\tthis.name = \"VertoAttachHandlerError\";\n\t}\n};\nvar ValidationError = class extends Error {\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tthis.name = \"ValidationError\";\n\t}\n};\nvar VertoPongError = class extends Error {\n\tconstructor(originalError) {\n\t\tsuper(\"Failed to send Verto pong - call may disconnect\", { cause: originalError instanceof Error ? originalError : void 0 });\n\t\tthis.originalError = originalError;\n\t\tthis.name = \"VertoPongError\";\n\t}\n};\nvar MessageParseError = class extends Error {\n\tconstructor(originalError) {\n\t\tsuper(\"Failed to parse incoming WebSocket message\", { cause: originalError instanceof Error ? originalError : void 0 });\n\t\tthis.originalError = originalError;\n\t\tthis.name = \"MessageParseError\";\n\t}\n};\nvar CollectionFetchError = class extends Error {\n\tconstructor(operation, originalError) {\n\t\tsuper(`Collection fetch failed during ${operation}`, { cause: originalError instanceof Error ? originalError : void 0 });\n\t\tthis.operation = operation;\n\t\tthis.originalError = originalError;\n\t\tthis.name = \"CollectionFetchError\";\n\t}\n};\nvar MediaTrackError = class extends Error {\n\tconstructor(operation, kind, originalError) {\n\t\tsuper(`Media track ${operation} failed for ${kind}`, { cause: originalError instanceof Error ? originalError : void 0 });\n\t\tthis.operation = operation;\n\t\tthis.kind = kind;\n\t\tthis.originalError = originalError;\n\t\tthis.name = \"MediaTrackError\";\n\t}\n};\nvar DPoPInitError = class extends Error {\n\tconstructor(originalError, message = \"Failed to initialize DPoP key pair\") {\n\t\tsuper(message, { cause: originalError instanceof Error ? originalError : void 0 });\n\t\tthis.originalError = originalError;\n\t\tthis.name = \"DPoPInitError\";\n\t}\n};\n/**\n* Error thrown when a recovery attempt fails.\n*\n* Carries the recovery action and attempt number for diagnostic purposes.\n*/\nvar RecoveryError = class extends Error {\n\tconstructor(action, attempt, originalError) {\n\t\tsuper(`Recovery failed: ${action} (attempt ${attempt})`, { cause: originalError instanceof Error ? originalError : void 0 });\n\t\tthis.action = action;\n\t\tthis.attempt = attempt;\n\t\tthis.originalError = originalError;\n\t\tthis.name = \"RecoveryError\";\n\t}\n};\n/**\n* Error thrown when getUserMedia fails with OverconstrainedError\n* and all fallback levels have been exhausted.\n*/\nvar OverconstrainedFallbackError = class extends Error {\n\tconstructor(deviceKind, originalError) {\n\t\tsuper(`All constraint fallback levels exhausted for ${deviceKind}`, { cause: originalError instanceof Error ? originalError : void 0 });\n\t\tthis.deviceKind = deviceKind;\n\t\tthis.originalError = originalError;\n\t\tthis.name = \"OverconstrainedFallbackError\";\n\t}\n};\n/**\n* Error thrown when the preflight connectivity test fails.\n*/\nvar PreflightError = class extends Error {\n\tconstructor(phase, originalError) {\n\t\tsuper(`Preflight test failed during ${phase}`, { cause: originalError instanceof Error ? originalError : void 0 });\n\t\tthis.phase = phase;\n\t\tthis.originalError = originalError;\n\t\tthis.name = \"PreflightError\";\n\t}\n};\nvar DeviceTokenError = class extends Error {\n\tconstructor(message, originalError) {\n\t\tsuper(message, { cause: originalError instanceof Error ? originalError : void 0 });\n\t\tthis.originalError = originalError;\n\t\tthis.name = \"DeviceTokenError\";\n\t}\n};\nvar TokenRefreshError = class extends Error {\n\tconstructor(message, originalError) {\n\t\tsuper(message, { cause: originalError instanceof Error ? originalError : void 0 });\n\t\tthis.originalError = originalError;\n\t\tthis.name = \"TokenRefreshError\";\n\t}\n};\n\n//#endregion\n//#region src/utils/logger.ts\nconst datetime = () => (/* @__PURE__ */ new Date()).toISOString();\nconst defaultLogger = log.getLogger(\"signalwire\");\nconst originalFactory = defaultLogger.methodFactory;\ndefaultLogger.methodFactory = (methodName, logLevel, loggerName) => {\n\tconst rawMethod = originalFactory(methodName, logLevel, loggerName);\n\treturn function(...args) {\n\t\tconst prefixed = [\n\t\t\tdatetime(),\n\t\t\t\"-\",\n\t\t\t...args\n\t\t];\n\t\trawMethod.apply(void 0, prefixed);\n\t};\n};\nconst defaultLoggerLevel = defaultLogger.levels.WARN;\ndefaultLogger.setLevel(defaultLoggerLevel);\nlet userLogger = null;\n/** Replace the built-in logger with a custom implementation. Pass `null` to restore defaults. */\nconst setLogger = (logger$1) => {\n\tuserLogger = logger$1;\n};\nlet debugOptions = {};\n/** Configure debug options (e.g., `{ logWsTraffic: true }`). */\nconst setDebugOptions = (options) => {\n\tif (options == null) {\n\t\tdebugOptions = {};\n\t\treturn;\n\t}\n\tdebugOptions = {\n\t\t...debugOptions,\n\t\t...options\n\t};\n};\n/**\n* Set the log level for the built-in logger.\n* Has no effect when a custom logger is set via `setLogger()`.\n*/\nconst setLogLevel = (level) => {\n\tdefaultLogger.setLevel(level);\n};\nconst getLoggerInstance = () => {\n\treturn userLogger ?? defaultLogger;\n};\nconst shouldStringify = (payload) => {\n\tif (payload != null && typeof payload === \"object\" && \"method\" in payload) return payload.method !== \"signalwire.ping\";\n\treturn true;\n};\nconst wsTraffic = (options) => {\n\tconst { logWsTraffic } = debugOptions;\n\tif (!logWsTraffic) return;\n\tconst loggerInstance = getLoggerInstance();\n\tlet payload;\n\tif (\"raw\" in options) try {\n\t\tpayload = JSON.parse(options.raw);\n\t} catch {\n\t\tloggerInstance.debug(`[WebSocket] ${options.type.toUpperCase()}: non-JSON message`);\n\t\treturn;\n\t}\n\telse ({payload} = options);\n\tconst msg = shouldStringify(payload) ? JSON.stringify(payload, null, 2) : payload;\n\tloggerInstance.debug(`${options.type.toUpperCase()}: \\n`, msg, \"\\n\");\n};\nconst getLogger = () => {\n\tconst logger$1 = getLoggerInstance();\n\treturn new Proxy(logger$1, { get(_target, prop, _receiver) {\n\t\tif (prop === \"wsTraffic\") return wsTraffic;\n\t\tconst instance = getLoggerInstance();\n\t\tconst value = Reflect.get(instance, prop);\n\t\tif (typeof value === \"function\") return value.bind(instance);\n\t\treturn value;\n\t} });\n};\n\n//#endregion\n//#region src/operators/filterNull.ts\n/**\n* RxJS operator that filters out `null` and `undefined` values with type narrowing.\n*\n* @example\n* ```ts\n* source$.pipe(filterNull()).subscribe(value => {\n* // value is guaranteed non-null\n* });\n* ```\n*/\nfunction filterNull() {\n\treturn filter((value) => value != null);\n}\n\n//#endregion\n//#region src/utils/getValueFrom.ts\nconst getValueFrom = (obj, path, defaultValue) => {\n\tconst keys = path.split(\".\");\n\tlet result = obj;\n\tfor (const key of keys) if (result && typeof result === \"object\" && key in result) result = result[key];\n\telse return defaultValue;\n\treturn result === void 0 ? defaultValue : result;\n};\n\n//#endregion\n//#region src/operators/filterEventAs.ts\n/**\n* RxJS operator that filters events based on a predicate and maps matching events.\n*\n* This operator combines filter and map operations:\n* 1. Only events that match the predicate are emitted\n* 2. Matching events are transformed using the map function\n*\n* @template TInput - The type of input events\n* @template TOutput - The type of output after mapping\n* @param predicate - Function to test each event. Returns true to include the event.\n* @param mapFn - Function to transform matching events\n* @returns An operator function that filters and maps events\n*\n* @example\n* ```typescript\n* interface CallEvent {\n* type: 'call.started' | 'call.ended';\n* id: string;\n* timestamp: number;\n* }\n*\n* events$.pipe(\n* isEvent(\n* (event: CallEvent) => event.type === 'call.started',\n* (event: CallEvent) => ({ id: event.id, timestamp: event.timestamp })\n* )\n* ).subscribe(startEvent => {\n* console.log('Call started:', startEvent);\n* });\n* ```\n*/\nfunction ifIsMap(predicate, mapFn) {\n\treturn pipe(filter$1(predicate), map$1(mapFn));\n}\n/**\n* Generic RxJS operator that filters events using a type guard and extracts a property.\n*\n* This is the generic version that works with any type, not just JSONRPCRequest.\n* Use this when you need to filter and extract properties from already-narrowed types.\n*\n* **Type inference**: The output type is automatically inferred from the input type and path!\n*\n* @template TInput - The type to narrow to (via type guard)\n* @template TPath - The dot-notation path to extract (inferred from parameter)\n* @param predicate - Type guard function to filter events\n* @param resultPath - Dot-notation path to extract (e.g., 'params', 'params.data')\n* @returns An operator function that filters and extracts\n*\n* @example\n* ```typescript\n* interface EventParams {\n* event_type: string;\n* data: { value: number };\n* }\n*\n* const isAuthEvent = (e: unknown): e is EventParams =>\n* typeof e === 'object' && e !== null && 'event_type' in e;\n*\n* // Type of 'data' is automatically inferred as { value: number }\n* params$.pipe(\n* filterAs(isAuthEvent, 'data')\n* ).subscribe(data => {\n* console.log('Event data:', data.value); // TypeScript knows about .value!\n* });\n*\n* // Deeply nested properties are also inferred\n* params$.pipe(\n* filterAs(isAuthEvent, 'data.value')\n* ).subscribe(value => {\n* console.log(value); // Type is 'number'\n* });\n* ```\n*/\nfunction filterAs(predicate, resultPath) {\n\treturn pipe(ifIsMap(predicate, (event) => {\n\t\treturn getValueFrom(event, resultPath);\n\t}), filter$1((value) => value !== void 0));\n}\n\n//#endregion\n//#region src/operators/throwOnRPCError.ts\nconst logger = getLogger();\n/**\n* RxJS operator that throws a {@link JSONRPCError} when the RPC response contains an error.\n* Passes successful responses through unchanged.\n*/\nfunction throwOnRPCError() {\n\treturn map((response) => {\n\t\tif (response.error) {\n\t\t\tlogger.error(\"[throwOnRPCError] RPC error response:\", {\n\t\t\t\tcode: response.error.code,\n\t\t\t\tmessage: response.error.message,\n\t\t\t\tdata: response.error.data\n\t\t\t});\n\t\t\tthrow new JSONRPCError(response.error.code, response.error.message, response.error.data);\n\t\t}\n\t\tlogger.debug(\"[throwOnRPCError] RPC successful response:\", response);\n\t\treturn response;\n\t});\n}\n\n//#endregion\nexport { StorageNotAvailableError as A, VertoPongError as B, OverconstrainedFallbackError as C, RequestError as D, RecoveryError as E, UnexpectedError as F, WebSocketTimeoutError as H, UnimplementedError as I, ValidationError as L, StorageWriteError as M, TokenRefreshError as N, RequestTimeoutError as O, TransportConnectionError as P, VertoAttachHandlerError as R, MessageParseError as S, RPCTimeoutError as T, WebSocketConnectionError as V, DeviceTokenError as _, filterNull as a, JSONRPCError as b, setLogLevel as c, CallCreateError as d, CollectionFetchError as f, DeserializationError as g, DependencyError as h, getValueFrom as i, StorageReadError as j, SerializationError as k, setLogger as l, DPoPInitError as m, filterAs as n, getLogger as o, ConversationError as p, ifIsMap as r, setDebugOptions as s, throwOnRPCError as t, AuthStateHandlerError as u, InvalidCredentialsError as v, PreflightError as w, MediaTrackError as x, InvalidParams as y, VertoInviteHandlerError as z };\n//# sourceMappingURL=operators-CX_lCCJm.mjs.map","export class InvalidTokenError extends Error {\n}\nInvalidTokenError.prototype.name = \"InvalidTokenError\";\nfunction b64DecodeUnicode(str) {\n return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {\n let code = p.charCodeAt(0).toString(16).toUpperCase();\n if (code.length < 2) {\n code = \"0\" + code;\n }\n return \"%\" + code;\n }));\n}\nfunction base64UrlDecode(str) {\n let output = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += \"==\";\n break;\n case 3:\n output += \"=\";\n break;\n default:\n throw new Error(\"base64 string is not of the correct length\");\n }\n try {\n return b64DecodeUnicode(output);\n }\n catch (err) {\n return atob(output);\n }\n}\nexport function jwtDecode(token, options) {\n if (typeof token !== \"string\") {\n throw new InvalidTokenError(\"Invalid token specified: must be a string\");\n }\n options || (options = {});\n const pos = options.header === true ? 0 : 1;\n const part = token.split(\".\")[pos];\n if (typeof part !== \"string\") {\n throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);\n }\n let decoded;\n try {\n decoded = base64UrlDecode(part);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);\n }\n try {\n return JSON.parse(decoded);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);\n }\n}\n","import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n","let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction _v4(options, buf, offset) {\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? rng();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n return _v4(options, buf, offset);\n}\nexport default v4;\n","import { A as StorageNotAvailableError, B as VertoPongError, C as OverconstrainedFallbackError, D as RequestError, E as RecoveryError, F as UnexpectedError, H as WebSocketTimeoutError, I as UnimplementedError, L as ValidationError, M as StorageWriteError, N as TokenRefreshError, O as RequestTimeoutError, P as TransportConnectionError, R as VertoAttachHandlerError, S as MessageParseError, T as RPCTimeoutError, V as WebSocketConnectionError, _ as DeviceTokenError, a as filterNull, b as JSONRPCError, c as setLogLevel, d as CallCreateError, f as CollectionFetchError, g as DeserializationError, h as DependencyError, i as getValueFrom, j as StorageReadError, k as SerializationError, l as setLogger, m as DPoPInitError, n as filterAs, o as getLogger, p as ConversationError, s as setDebugOptions, t as throwOnRPCError, u as AuthStateHandlerError, v as InvalidCredentialsError, w as PreflightError, x as MediaTrackError, y as InvalidParams, z as VertoInviteHandlerError } from \"./operators-CX_lCCJm.mjs\";\nimport { jwtDecode } from \"jwt-decode\";\nimport { BehaviorSubject, EMPTY, NEVER, Observable, ReplaySubject, Subject, TimeoutError, animationFrameScheduler, asapScheduler, auditTime, catchError, combineLatest, debounceTime, defer, distinctUntilChanged, exhaustMap, filter, first, firstValueFrom, from, interval, lastValueFrom, map, merge, mergeMap, observeOn, of, pipe, race, scan, share, shareReplay, skip, skipWhile, startWith, switchMap, take, takeUntil, tap, throwError, timeout, timer, toArray, withLatestFrom } from \"rxjs\";\nimport { v4 } from \"uuid\";\nimport { distinctUntilChanged as distinctUntilChanged$1, map as map$1 } from \"rxjs/operators\";\n\n//#region src/behaviors/Destroyable.ts\nvar Destroyable = class {\n\tconstructor() {\n\t\tthis.subscriptions = [];\n\t\tthis.subjects = [];\n\t\tthis._destroyed$ = new Subject();\n\t}\n\tdestroy() {\n\t\tthis._observableCache?.clear();\n\t\tthis.subscriptions.forEach((sub) => sub.unsubscribe());\n\t\tthis.subjects.forEach((subject) => subject.complete());\n\t\tthis._destroyed$.next();\n\t\tthis._destroyed$.complete();\n\t}\n\tcachedObservable(key, factory) {\n\t\tthis._observableCache ??= /* @__PURE__ */ new Map();\n\t\tlet cached = this._observableCache.get(key);\n\t\tif (!cached) {\n\t\t\tcached = factory();\n\t\t\tthis._observableCache.set(key, cached);\n\t\t}\n\t\treturn cached;\n\t}\n\t/**\n\t* Like `cachedObservable`, but defers emissions to the microtask queue\n\t* via `observeOn(asapScheduler)`.\n\t*\n\t* Use ONLY for public-facing observable getters that external consumers\n\t* subscribe to. Prevents a class of bugs where `BehaviorSubject` or\n\t* `ReplaySubject` replays synchronously during `subscribe()`, before\n\t* the subscription variable is assigned in the caller's scope.\n\t*\n\t* Do NOT use for observables consumed internally by the SDK — internal\n\t* code using `subscribeTo()`, `firstValueFrom()`, or `withLatestFrom()`\n\t* depends on synchronous emission delivery.\n\t*/\n\tpublicCachedObservable(key, factory) {\n\t\tconst publicKey = `public:${key}`;\n\t\tthis._observableCache ??= /* @__PURE__ */ new Map();\n\t\tlet cached = this._observableCache.get(publicKey);\n\t\tif (!cached) {\n\t\t\tcached = factory().pipe(observeOn(asapScheduler));\n\t\t\tthis._observableCache.set(publicKey, cached);\n\t\t}\n\t\treturn cached;\n\t}\n\t/**\n\t* Wraps an observable so emissions are deferred to the microtask queue.\n\t*\n\t* Use ONLY for public-facing getters that expose a subject via\n\t* `.asObservable()` without going through `cachedObservable`.\n\t*\n\t* Do NOT use for observables consumed internally by the SDK.\n\t*/\n\tdeferEmission(observable) {\n\t\treturn observable.pipe(observeOn(asapScheduler));\n\t}\n\tsubscribeTo(observable, observerOrNext) {\n\t\tconst subscription = observable.subscribe(observerOrNext);\n\t\tthis.subscriptions.push(subscription);\n\t}\n\tcreateSubject() {\n\t\tconst subject = new Subject();\n\t\tthis.subjects.push(subject);\n\t\treturn subject;\n\t}\n\tcreateReplaySubject(bufferSize, windowTime) {\n\t\tconst subject = new ReplaySubject(bufferSize, windowTime);\n\t\tthis.subjects.push(subject);\n\t\treturn subject;\n\t}\n\tcreateBehaviorSubject(initialValue) {\n\t\tconst subject = new BehaviorSubject(initialValue);\n\t\tthis.subjects.push(subject);\n\t\treturn subject;\n\t}\n\t/**\n\t* Observable that emits when the instance is destroyed\n\t*/\n\tget destroyed$() {\n\t\treturn this._destroyed$.asObservable();\n\t}\n};\n\n//#endregion\n//#region src/utils/asyncRetry.ts\nconst DEFAULT_MAX_RETRIES = 10;\nconst DEFAULT_INITIAL_DELAY = 100;\nconst DEFAULT_DELAY_VARIATION = 1;\nconst increasingDelay = ({ delayLimit: upperDelayLimit = Number.MAX_SAFE_INTEGER, initialDelay = DEFAULT_INITIAL_DELAY, variation = DEFAULT_DELAY_VARIATION }) => {\n\tif (initialDelay < 0) throw new ValidationError(\"initialDelay must be gte 0\");\n\tif (upperDelayLimit < 0) throw new ValidationError(\"upperDelayLimit must be gte 0\");\n\tif (variation < 0) throw new ValidationError(\"variation must be gte 0\");\n\tif (initialDelay > upperDelayLimit) throw new ValidationError(\"initialDelay must be lte delayLimit\");\n\tlet delay = Math.min(initialDelay, upperDelayLimit);\n\treturn () => {\n\t\tif (delay === upperDelayLimit) return upperDelayLimit;\n\t\tconst currentDelay = delay;\n\t\tdelay = Math.min(delay + variation, upperDelayLimit);\n\t\treturn currentDelay;\n\t};\n};\nconst asyncRetry = async ({ asyncCallable, maxRetries: retries = DEFAULT_MAX_RETRIES, delayFn, validator, expectedErrorHandler }) => {\n\tlet remainingAttempts = retries - 1;\n\tlet wait = 0;\n\tconst promiseAttempt = async () => {\n\t\ttry {\n\t\t\tlet result;\n\t\t\tif (wait <= 0) result = await asyncCallable();\n\t\t\telse result = await new Promise((resolve, reject) => setTimeout(() => {\n\t\t\t\tasyncCallable().then(resolve).catch(reject);\n\t\t\t}, wait));\n\t\t\tif (remainingAttempts) validator?.(result);\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tif (remainingAttempts-- > 0 && !expectedErrorHandler?.(error)) {\n\t\t\t\twait = delayFn?.() ?? 0;\n\t\t\t\tgetLogger().debug(`Retrying request: ${retries - remainingAttempts} of ${retries}`);\n\t\t\t\treturn promiseAttempt();\n\t\t\t} else throw error;\n\t\t}\n\t};\n\treturn promiseAttempt();\n};\n\n//#endregion\n//#region src/controllers/HTTPRequestController.ts\nconst logger$30 = getLogger();\nconst GET_PARAMS = {\n\tmethod: \"GET\",\n\theaders: { Accept: \"application/json\" }\n};\nconst POST_PARAMS = {\n\tmethod: \"POST\",\n\theaders: {\n\t\tAccept: \"application/json\",\n\t\t\"Content-Type\": \"application/json\"\n\t}\n};\nvar HTTPRequestController = class HTTPRequestController extends Destroyable {\n\tstatic {\n\t\tthis.defaultMaxRetries = 3;\n\t}\n\tstatic {\n\t\tthis.defaultRetryDelayMinMs = 1e3;\n\t}\n\tstatic {\n\t\tthis.defaultRetryDelayMaxMs = 3e4;\n\t}\n\tstatic {\n\t\tthis.defaultRequestTimeoutMs = 3e4;\n\t}\n\tstatic {\n\t\tthis.SENSITIVE_BODY_FIELDS = new Set([\n\t\t\t\"dpop_token\",\n\t\t\t\"token\",\n\t\t\t\"jwt_token\"\n\t\t]);\n\t}\n\tconstructor(baseURL, getCredential, options = {}) {\n\t\tsuper();\n\t\tthis.baseURL = baseURL;\n\t\tthis.getCredential = getCredential;\n\t\tthis._responses$ = this.createSubject();\n\t\tthis._errors$ = this.createSubject();\n\t\tthis._status$ = this.createBehaviorSubject(\"idle\");\n\t\tthis.maxRetries = options.maxRetries ?? HTTPRequestController.defaultMaxRetries;\n\t\tthis.retryDelayMin = options.retryDelayMin ?? HTTPRequestController.defaultRetryDelayMinMs;\n\t\tthis.retryDelayMax = options.retryDelayMax ?? HTTPRequestController.defaultRetryDelayMaxMs;\n\t\tthis.requestTimeout = options.requestTimeout ?? HTTPRequestController.defaultRequestTimeoutMs;\n\t}\n\tget status$() {\n\t\treturn this._status$.asObservable();\n\t}\n\tget status() {\n\t\treturn this._status$.value;\n\t}\n\tget responses$() {\n\t\treturn this._responses$.asObservable();\n\t}\n\tget errors$() {\n\t\treturn this._errors$.asObservable();\n\t}\n\tasync request(request) {\n\t\tthis._status$.next(\"requesting\");\n\t\ttry {\n\t\t\tconst response = await this.executeWithRetry(request);\n\t\t\tthis._status$.next(\"success\");\n\t\t\tthis._responses$.next(response);\n\t\t\treturn response;\n\t\t} catch (error) {\n\t\t\tlogger$30.error(\"[HTTPRequestController] Request error:\", error);\n\t\t\tthis._status$.next(\"error\");\n\t\t\tconst err = error instanceof Error ? error : new Error(\"HTTP request failed\", { cause: error });\n\t\t\tthis._errors$.next(err);\n\t\t\tthrow err;\n\t\t}\n\t}\n\tasync executeWithRetry(request) {\n\t\tconst variation = Math.ceil((this.retryDelayMax - this.retryDelayMin) / Math.max(this.maxRetries - 1, 1));\n\t\tconst delayFn = increasingDelay({\n\t\t\tinitialDelay: this.retryDelayMin,\n\t\t\tvariation,\n\t\t\tdelayLimit: this.retryDelayMax\n\t\t});\n\t\treturn asyncRetry({\n\t\t\tasyncCallable: async () => this.executeRequest(request),\n\t\t\tmaxRetries: this.maxRetries,\n\t\t\tdelayFn,\n\t\t\tvalidator: (response) => {\n\t\t\t\tif (response.status >= 500 && response.status < 600) throw new UnexpectedError(`Server error: ${response.status} ${response.statusText}`);\n\t\t\t}\n\t\t});\n\t}\n\tasync executeRequest(request) {\n\t\tconst url = this.buildURL(request.url);\n\t\tconst headers = this.buildHeaders(request.headers);\n\t\tconst timeout$1 = request.timeout ?? this.requestTimeout;\n\t\tlogger$30.debug(\"[HTTPRequestController] Executing request:\", {\n\t\t\tmethod: request.method,\n\t\t\turl,\n\t\t\theaders: Object.keys(headers).reduce((acc, key) => {\n\t\t\t\tacc[key] = key === \"Authorization\" ? `${headers[key].substring(0, 20)}...` : headers[key];\n\t\t\t\treturn acc;\n\t\t\t}, {}),\n\t\t\tbody: this.sanitizeBody(request.body)\n\t\t});\n\t\tconst controller = new AbortController();\n\t\tconst timeoutId = setTimeout(() => controller.abort(), timeout$1);\n\t\ttry {\n\t\t\tconst response = await fetch(url, {\n\t\t\t\tmethod: request.method,\n\t\t\t\theaders,\n\t\t\t\tbody: request.body,\n\t\t\t\tsignal: controller.signal\n\t\t\t});\n\t\t\tclearTimeout(timeoutId);\n\t\t\tconst httpResponse = await this.convertResponse(response);\n\t\t\tlogger$30.debug(\"[HTTPRequestController] Response received:\", {\n\t\t\t\tstatus: response.status,\n\t\t\t\tstatusText: response.statusText,\n\t\t\t\theaders: [...response.headers.entries()],\n\t\t\t\tbody: httpResponse.body ? httpResponse.body.substring(0, 200) : \"(empty)\"\n\t\t\t});\n\t\t\treturn httpResponse;\n\t\t} catch (error) {\n\t\t\tclearTimeout(timeoutId);\n\t\t\tif (error instanceof Error && error.name === \"AbortError\") throw new RequestTimeoutError(`Request timeout after ${timeout$1}ms`, { cause: error });\n\t\t\tlogger$30.error(\"[HTTPRequestController] Request failed:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\tbuildURL(url) {\n\t\tconst urlString = typeof url === \"string\" ? url : url.toString();\n\t\tif (urlString.startsWith(\"http://\") || urlString.startsWith(\"https://\")) return urlString;\n\t\treturn `${this.baseURL.endsWith(\"/\") ? this.baseURL.slice(0, -1) : this.baseURL}${urlString.startsWith(\"/\") ? urlString : `/${urlString}`}`;\n\t}\n\tbuildHeaders(requestHeaders) {\n\t\tconst headers = { ...requestHeaders ?? {} };\n\t\tconst credential = this.getCredential();\n\t\tif (credential.token) {\n\t\t\theaders.Authorization = `Bearer ${credential.token}`;\n\t\t\tlogger$30.debug(\"[HTTPRequestController] Using Bearer token auth, token length:\", credential.token.length);\n\t\t} else logger$30.warn(\"[HTTPRequestController] No credentials available for authentication\");\n\t\treturn headers;\n\t}\n\t/**\n\t* Sanitizes a request body for debug logging by masking sensitive fields.\n\t*/\n\tsanitizeBody(body) {\n\t\tif (!body || typeof body !== \"string\") return body ? \"(non-string body)\" : void 0;\n\t\ttry {\n\t\t\tconst sanitized = { ...JSON.parse(body) };\n\t\t\tfor (const key of Object.keys(sanitized)) if (HTTPRequestController.SENSITIVE_BODY_FIELDS.has(key) && typeof sanitized[key] === \"string\") sanitized[key] = `${sanitized[key].substring(0, 20)}...[redacted]`;\n\t\t\treturn JSON.stringify(sanitized);\n\t\t} catch {\n\t\t\treturn body.length > 200 ? `${body.substring(0, 200)}...` : body;\n\t\t}\n\t}\n\tasync convertResponse(response) {\n\t\tconst headers = {};\n\t\tresponse.headers.forEach((value, key) => {\n\t\t\theaders[key] = value;\n\t\t});\n\t\tconst bodyText = await response.text();\n\t\treturn {\n\t\t\tstatus: response.status,\n\t\t\tstatusText: response.statusText,\n\t\t\theaders,\n\t\t\tbody: bodyText,\n\t\t\tok: response.ok,\n\t\t\turl: response.url\n\t\t};\n\t}\n};\n\n//#endregion\n//#region src/controllers/DeviceHistoryManager.ts\n/**\n* DeviceHistoryManager - Maintains a per-kind stack of recently used devices.\n*\n* When a device disappears during a call, the SDK uses this history to fall\n* back to the previously used device rather than picking an arbitrary default.\n* This handles the common scenario of AirPods disconnecting and the user\n* expecting to return to their built-in microphone.\n*\n* This is a pure data structure -- it does not extend Destroyable since it\n* holds no subscriptions or subjects.\n*\n* @see Section 5.2 of the Implementation Guide\n*/\n/** Maximum number of entries retained per device kind. */\nconst MAX_HISTORY_SIZE = 5;\n/**\n* Converts a MediaDeviceInfo to a serializable HistoryEntry.\n*/\nconst toHistoryEntry = (device, kind) => ({\n\tdeviceId: device.deviceId,\n\tlabel: device.label,\n\tgroupId: device.groupId,\n\tkind\n});\nvar DeviceHistoryManager = class {\n\tconstructor() {\n\t\tthis._stacks = {\n\t\t\taudioinput: [],\n\t\t\taudiooutput: [],\n\t\t\tvideoinput: []\n\t\t};\n\t}\n\t/**\n\t* Push a device onto the history stack for the given kind.\n\t*\n\t* If the device is already at the top of the stack, this is a no-op.\n\t* Duplicate entries deeper in the stack are removed to keep the stack clean.\n\t* The stack is capped at {@link MAX_HISTORY_SIZE} entries.\n\t*\n\t* @param kind - The device kind (audioinput, audiooutput, videoinput)\n\t* @param device - The MediaDeviceInfo to record\n\t*/\n\tpush(kind, device) {\n\t\tconst entry = toHistoryEntry(device, kind);\n\t\tconst current = this._stacks[kind];\n\t\tif (current.length > 0 && current[0].deviceId === entry.deviceId) return;\n\t\tconst filtered = current.filter((e) => e.deviceId !== entry.deviceId);\n\t\tthis._stacks[kind] = [entry, ...filtered].slice(0, MAX_HISTORY_SIZE);\n\t}\n\t/**\n\t* Pop the most recent device from the history stack for the given kind.\n\t*\n\t* @param kind - The device kind\n\t* @returns The most recent HistoryEntry, or undefined if the stack is empty\n\t*/\n\tpop(kind) {\n\t\tconst current = this._stacks[kind];\n\t\tif (current.length === 0) return;\n\t\tconst [top, ...rest] = current;\n\t\tthis._stacks[kind] = rest;\n\t\treturn top;\n\t}\n\t/**\n\t* Find the most recent device in the history that is still present in the\n\t* available device list.\n\t*\n\t* Searches the history stack from most recent to oldest. A device is\n\t* considered a match if its deviceId or (groupId + label) match an\n\t* available device.\n\t*\n\t* @param kind - The device kind\n\t* @param availableDevices - The current list of available devices\n\t* @returns The matching MediaDeviceInfo from availableDevices, or undefined\n\t*/\n\tfindInHistory(kind, availableDevices) {\n\t\tconst history = this._stacks[kind];\n\t\tfor (const entry of history) {\n\t\t\tconst exactMatch = availableDevices.find((d) => d.deviceId === entry.deviceId);\n\t\t\tif (exactMatch) return exactMatch;\n\t\t\tconst groupMatch = availableDevices.find((d) => d.groupId === entry.groupId && d.label === entry.label);\n\t\t\tif (groupMatch) return groupMatch;\n\t\t}\n\t}\n\t/**\n\t* Return a read-only snapshot of the history stack for a given kind.\n\t*\n\t* @param kind - The device kind\n\t* @returns A read-only array of HistoryEntry objects, most recent first\n\t*/\n\tgetHistory(kind) {\n\t\treturn this._stacks[kind];\n\t}\n\t/**\n\t* Clear all history stacks.\n\t*/\n\tclear() {\n\t\tthis._stacks.audioinput = [];\n\t\tthis._stacks.audiooutput = [];\n\t\tthis._stacks.videoinput = [];\n\t}\n};\n\n//#endregion\n//#region src/core/constants.ts\nconst INVITE_VERSION = 1e3;\nconst DEFAULT_ICE_CANDIDATE_TIMEOUT_MS = 600;\nconst DEFAULT_ICE_GATHERING_TIMEOUT_MS = 6e3;\nconst DEFAULT_RECONNECT_CALLS_TIMEOUT_MS = 300 * 1e3;\nconst DEFAULT_CONNECTION_TIMEOUT_MS = 1e4;\nconst DEFAULT_RECONNECT_DELAY_MIN_MS = 100;\nconst DEFAULT_RECONNECT_DELAY_MAX_MS = 3e3;\nconst DEFAULT_DEVICE_DEBOUNCE_TIME_MS = 1500;\nconst DEFAULT_DEVICE_POLLING_INTERVAL_MS = 0;\nconst PREFERENCES_STORAGE_KEY = \"sw:preferences\";\n/** Scope value that enables automatic token refresh. */\nconst SAT_REFRESH_SCOPE = \"sat:refresh\";\n/** API endpoints for device token operations. */\nconst DEVICE_TOKEN_ENDPOINT = \"/api/fabric/subscriber/devices/token\";\nconst DEVICE_REFRESH_ENDPOINT = \"/api/fabric/subscriber/devices/refresh\";\n/** Default device token TTL in seconds (15 minutes). */\nconst DEVICE_TOKEN_DEFAULT_EXPIRE_IN = 900;\n/** Buffer time in milliseconds before expiry to trigger refresh. */\nconst DEVICE_TOKEN_REFRESH_BUFFER_MS = 3e4;\n/** Maximum retry attempts for device token refresh on transient failure. */\nconst DEVICE_TOKEN_REFRESH_MAX_RETRIES = 3;\n/** Base delay in milliseconds for exponential backoff on refresh retry. */\nconst DEVICE_TOKEN_REFRESH_RETRY_BASE_MS = 1e3;\n/** Maximum retry attempts for developer credential refresh on transient failure. */\nconst CREDENTIAL_REFRESH_MAX_RETRIES = 5;\n/** Base delay in milliseconds for exponential backoff on credential refresh retry. */\nconst CREDENTIAL_REFRESH_RETRY_BASE_MS = 1e3;\n/** Maximum delay in milliseconds for credential refresh backoff. */\nconst CREDENTIAL_REFRESH_MAX_DELAY_MS = 3e4;\n/** Buffer in milliseconds before token expiry to trigger refresh. */\nconst CREDENTIAL_REFRESH_BUFFER_MS = 5e3;\n/** JSON-RPC error code for requester validation failure (corrupted auth state). */\nconst RPC_ERROR_REQUESTER_VALIDATION_FAILED = -32003;\n/** JSON-RPC error code for invalid params (e.g., missing authentication block). */\nconst RPC_ERROR_INVALID_PARAMS = -32602;\n/** JSON-RPC error code for authentication failure (invalid token, missing DPoP, etc.). */\nconst RPC_ERROR_AUTHENTICATION_FAILED = -32002;\n/** Default polling interval for RTCPeerConnection.getStats() in milliseconds. */\nconst DEFAULT_STATS_POLLING_INTERVAL_MS = 1e3;\n/** Number of initial samples used to build a baseline for spike detection. */\nconst DEFAULT_STATS_BASELINE_SAMPLES = 10;\n/** Duration in ms with no inbound audio packets before emitting a critical issue. */\nconst DEFAULT_STATS_NO_PACKET_THRESHOLD_MS = 2e3;\n/** Multiplier applied to baseline RTT to detect a warning-level RTT spike. */\nconst DEFAULT_STATS_RTT_SPIKE_MULTIPLIER = 3;\n/** Packet loss fraction (0-1) above which a warning is emitted. */\nconst DEFAULT_STATS_PACKET_LOSS_THRESHOLD = .05;\n/** Multiplier applied to baseline jitter to detect a jitter spike. */\nconst DEFAULT_STATS_JITTER_SPIKE_MULTIPLIER = 4;\n/** Number of seconds of metrics history to retain. */\nconst DEFAULT_STATS_HISTORY_SIZE = 30;\n/** Maximum keyframe requests allowed within a single burst window. */\nconst DEFAULT_KEYFRAME_MAX_BURST$1 = 3;\n/** Duration of the keyframe burst window in milliseconds. */\nconst DEFAULT_KEYFRAME_BURST_WINDOW_MS$1 = 3e3;\n/** Cooldown period in ms after burst limit is reached before allowing more keyframes. */\nconst DEFAULT_KEYFRAME_COOLDOWN_MS$1 = 1e4;\n/** Minimum time between re-INVITE attempts in milliseconds. */\nconst DEFAULT_REINVITE_DEBOUNCE_TIME_MS = 1e4;\n/** Maximum number of re-INVITE attempts per call. */\nconst DEFAULT_REINVITE_MAX_ATTEMPTS = 3;\n/** Timeout for a single re-INVITE attempt in milliseconds. */\nconst DEFAULT_REINVITE_TIMEOUT_MS = 5e3;\n/** Debounce window in ms to collapse multiple detection signals into one trigger. */\nconst DEFAULT_RECOVERY_DEBOUNCE_TIME_MS = 2e3;\n/** Cooldown period in ms between recovery attempts. */\nconst DEFAULT_RECOVERY_COOLDOWN_MS = 1e4;\n/** Grace period in ms before treating ICE 'disconnected' as a failure. */\nconst DEFAULT_ICE_DISCONNECTED_GRACE_PERIOD_MS = 3e3;\n/** Timeout for a single ICE restart attempt in milliseconds. */\nconst DEFAULT_ICE_RESTART_TIMEOUT_MS$1 = 5e3;\n/** Maximum recovery attempts before emitting 'max_attempts_reached'. */\nconst DEFAULT_MAX_RECOVERY_ATTEMPTS = 3;\n/** Upper bound in ms for waiting on iceGatheringState === 'complete' after an ICE restart. */\nconst ICE_GATHERING_COMPLETE_TIMEOUT_MS = 1e4;\n/** Upper bound in ms for waiting on RTCPeerConnection.connectionState === 'connected' after a recovery ICE restart. */\nconst PEER_CONNECTION_RECOVERY_WAIT_MS = 5e3;\n/** Polling interval in ms while waiting for RTCPeerConnection.connectionState to transition. */\nconst PEER_CONNECTION_RECOVERY_POLL_MS = 100;\n/** Polling interval for LocalAudioPipeline.level$ (ms). ~30fps is smooth for meters. */\nconst AUDIO_LEVEL_POLL_INTERVAL_MS = 33;\n/** RMS level threshold (0..1) above which the local participant is considered speaking. */\nconst VAD_THRESHOLD = .03;\n/** Hold window in ms below the threshold before speaking$ flips back to false. */\nconst VAD_HOLD_MS = 250;\n/** Whether to persist device selections to storage by default. */\nconst DEFAULT_PERSIST_DEVICE_SELECTION = true;\n/** Whether to auto-apply device changes to active calls by default. */\nconst DEFAULT_SYNC_DEVICES_TO_ACTIVE_CALLS = true;\n/** Storage keys for persisted device selections. */\nconst DEVICE_STORAGE_KEY_AUDIO_INPUT = \"sw:device:audioinput\";\nconst DEVICE_STORAGE_KEY_AUDIO_OUTPUT = \"sw:device:audiooutput\";\nconst DEVICE_STORAGE_KEY_VIDEO_INPUT = \"sw:device:videoinput\";\n/** Whether to auto-mute video when the tab becomes hidden. */\nconst DEFAULT_AUTO_MUTE_VIDEO_ON_HIDDEN = false;\n/** Whether to re-enumerate devices when the page becomes visible. */\nconst DEFAULT_REFRESH_DEVICES_ON_VISIBLE = true;\n/** Whether to check peer connection health when the page becomes visible. */\nconst DEFAULT_CHECK_CONNECTION_ON_VISIBLE = true;\n/** Whether automatic video degradation on low bandwidth is enabled. */\nconst DEFAULT_ENABLE_AUTO_DEGRADATION = true;\n/** Bitrate in kbps below which video is automatically disabled. */\nconst DEFAULT_DEGRADATION_BITRATE_THRESHOLD_KBPS = 150;\n/** Bitrate in kbps above which video is automatically re-enabled (hysteresis). */\nconst DEFAULT_DEGRADATION_RECOVERY_THRESHOLD_KBPS = 300;\n/** Whether relay-only escalation is enabled as a last-resort recovery tier. */\nconst DEFAULT_ENABLE_RELAY_FALLBACK = true;\n/** Whether to listen for browser online/offline/connection events. */\nconst DEFAULT_ENABLE_NETWORK_CHANGE_DETECTION = true;\n/** Whether to intercept server-sent media-timeout hangups and attempt recovery. */\nconst DEFAULT_ENABLE_SERVER_HANGUP_INTERCEPTION = true;\n/** Default video track constraints applied when video is enabled without explicit constraints. */\nconst DEFAULT_VIDEO_CONSTRAINTS = {\n\twidth: { ideal: 1280 },\n\theight: { ideal: 720 },\n\taspectRatio: 16 / 9\n};\n/** Whether stereo Opus is enabled by default. */\nconst DEFAULT_STEREO_AUDIO = false;\n/** Max average bitrate for stereo Opus in bits per second. */\nconst DEFAULT_STEREO_MAX_AVERAGE_BITRATE = 51e4;\n\n//#endregion\n//#region src/utils/time.ts\nfunction fromSecToMs(seconds) {\n\treturn seconds * 1e3;\n}\nfunction fromMsToSec(milliseconds) {\n\treturn Math.round(milliseconds / 100) / 10;\n}\n\n//#endregion\n//#region src/containers/PreferencesContainer.ts\nconst logger$29 = getLogger();\nvar PreferencesContainer = class PreferencesContainer {\n\tstatic get instance() {\n\t\tthis._instance ??= new PreferencesContainer();\n\t\treturn this._instance;\n\t}\n\tconstructor() {\n\t\tthis.deviceDebounceTime = DEFAULT_DEVICE_DEBOUNCE_TIME_MS;\n\t\tthis.devicePollingInterval = DEFAULT_DEVICE_POLLING_INTERVAL_MS;\n\t\tthis.reconnectCallsTimeout = DEFAULT_RECONNECT_CALLS_TIMEOUT_MS;\n\t\tthis.connectionTimeout = DEFAULT_CONNECTION_TIMEOUT_MS;\n\t\tthis.reconnectDelayMin = DEFAULT_RECONNECT_DELAY_MIN_MS;\n\t\tthis.reconnectDelayMax = DEFAULT_RECONNECT_DELAY_MAX_MS;\n\t\tthis.disableUdpIceServers = false;\n\t\tthis.relayOnly = false;\n\t\tthis.iceCandidateTimeout = DEFAULT_ICE_CANDIDATE_TIMEOUT_MS;\n\t\tthis.iceGatheringTimeout = DEFAULT_ICE_GATHERING_TIMEOUT_MS;\n\t\tthis.defaultSignalWireOptions = {\n\t\t\tskipConnection: false,\n\t\t\tskipRegister: false,\n\t\t\treconnectAttachedCalls: false,\n\t\t\tskipDeviceMonitoring: false,\n\t\t\tsavePreferences: false\n\t\t};\n\t\tthis.receiveVideo = false;\n\t\tthis.receiveAudio = true;\n\t\tthis.preferredAudioInput = null;\n\t\tthis.preferredAudioOutput = null;\n\t\tthis.preferredVideoInput = null;\n\t\tthis.inviteSubscribeScreenshare = [\"video.room.screenshare\"];\n\t\tthis.inviteSubscribeAdditionalDevice = [];\n\t\tthis.inviteSubscribeMainDevice = [\n\t\t\t\"track\",\n\t\t\t\"destroy\",\n\t\t\t\"member.updated.videoMuted\",\n\t\t\t\"layout.changed\",\n\t\t\t\"room.subscribed\",\n\t\t\t\"member.updated.audioMuted\",\n\t\t\t\"media.connected\",\n\t\t\t\"room.updated\",\n\t\t\t\"call.joined\"\n\t\t];\n\t\tthis.userVariables = {};\n\t\tthis.statsPollingInterval = DEFAULT_STATS_POLLING_INTERVAL_MS;\n\t\tthis.statsBaselineSamples = DEFAULT_STATS_BASELINE_SAMPLES;\n\t\tthis.statsNoPacketThreshold = DEFAULT_STATS_NO_PACKET_THRESHOLD_MS;\n\t\tthis.statsRttSpikeMultiplier = DEFAULT_STATS_RTT_SPIKE_MULTIPLIER;\n\t\tthis.statsPacketLossThreshold = DEFAULT_STATS_PACKET_LOSS_THRESHOLD;\n\t\tthis.statsJitterSpikeMultiplier = DEFAULT_STATS_JITTER_SPIKE_MULTIPLIER;\n\t\tthis.statsHistorySize = DEFAULT_STATS_HISTORY_SIZE;\n\t\tthis.keyframeMaxBurst = DEFAULT_KEYFRAME_MAX_BURST$1;\n\t\tthis.keyframeBurstWindow = DEFAULT_KEYFRAME_BURST_WINDOW_MS$1;\n\t\tthis.keyframeCooldown = DEFAULT_KEYFRAME_COOLDOWN_MS$1;\n\t\tthis.reinviteDebounceTime = DEFAULT_REINVITE_DEBOUNCE_TIME_MS;\n\t\tthis.reinviteMaxAttempts = DEFAULT_REINVITE_MAX_ATTEMPTS;\n\t\tthis.reinviteTimeout = DEFAULT_REINVITE_TIMEOUT_MS;\n\t\tthis.recoveryDebounceTime = DEFAULT_RECOVERY_DEBOUNCE_TIME_MS;\n\t\tthis.recoveryCooldown = DEFAULT_RECOVERY_COOLDOWN_MS;\n\t\tthis.iceDisconnectedGracePeriod = DEFAULT_ICE_DISCONNECTED_GRACE_PERIOD_MS;\n\t\tthis.iceRestartTimeout = DEFAULT_ICE_RESTART_TIMEOUT_MS$1;\n\t\tthis.maxRecoveryAttempts = DEFAULT_MAX_RECOVERY_ATTEMPTS;\n\t\tthis.enableRelayFallback = DEFAULT_ENABLE_RELAY_FALLBACK;\n\t\tthis.enableNetworkChangeDetection = DEFAULT_ENABLE_NETWORK_CHANGE_DETECTION;\n\t\tthis.enableServerHangupInterception = DEFAULT_ENABLE_SERVER_HANGUP_INTERCEPTION;\n\t\tthis.persistDeviceSelection = DEFAULT_PERSIST_DEVICE_SELECTION;\n\t\tthis.syncDevicesToActiveCalls = DEFAULT_SYNC_DEVICES_TO_ACTIVE_CALLS;\n\t\tthis.autoMuteVideoOnHidden = DEFAULT_AUTO_MUTE_VIDEO_ON_HIDDEN;\n\t\tthis.refreshDevicesOnVisible = DEFAULT_REFRESH_DEVICES_ON_VISIBLE;\n\t\tthis.checkConnectionOnVisible = DEFAULT_CHECK_CONNECTION_ON_VISIBLE;\n\t\tthis.defaultAudioConstraints = void 0;\n\t\tthis.defaultVideoConstraints = void 0;\n\t\tthis.stereoAudio = DEFAULT_STEREO_AUDIO;\n\t\tthis.enableAutoDegradation = DEFAULT_ENABLE_AUTO_DEGRADATION;\n\t\tthis.degradationBitrateThreshold = DEFAULT_DEGRADATION_BITRATE_THRESHOLD_KBPS;\n\t\tthis.degradationRecoveryThreshold = DEFAULT_DEGRADATION_RECOVERY_THRESHOLD_KBPS;\n\t\tthis.preferredVideoCodecs = [];\n\t\tthis.preferredAudioCodecs = [];\n\t}\n\tget preferredMediaOptions() {\n\t\treturn {\n\t\t\treceiveVideo: this.receiveVideo,\n\t\t\treceiveAudio: this.receiveAudio,\n\t\t\tinputAudioDeviceConstraints: this.inputAudioDeviceConstraints,\n\t\t\tinputVideoDeviceConstraints: this.inputVideoDeviceConstraints\n\t\t};\n\t}\n\tget inputAudioDeviceConstraints() {\n\t\treturn this._inputAudioDeviceConstraints;\n\t}\n\tset inputAudioDeviceConstraints(value) {\n\t\tthis._inputAudioDeviceConstraints = value;\n\t}\n\tget inputVideoDeviceConstraints() {\n\t\treturn this._inputVideoDeviceConstraints;\n\t}\n\tset inputVideoDeviceConstraints(value) {\n\t\tthis._inputVideoDeviceConstraints = value;\n\t}\n};\n/** Keys of StoredPreferences that map to number fields on PreferencesContainer. */\nconst STORED_NUMBER_KEYS = [\n\t\"connectionTimeout\",\n\t\"reconnectCallsTimeout\",\n\t\"reconnectDelayMin\",\n\t\"reconnectDelayMax\",\n\t\"iceCandidateTimeout\",\n\t\"iceGatheringTimeout\",\n\t\"deviceDebounceTime\",\n\t\"devicePollingInterval\",\n\t\"statsPollingInterval\",\n\t\"statsBaselineSamples\",\n\t\"statsNoPacketThreshold\",\n\t\"statsRttSpikeMultiplier\",\n\t\"statsPacketLossThreshold\",\n\t\"statsJitterSpikeMultiplier\",\n\t\"statsHistorySize\",\n\t\"keyframeMaxBurst\",\n\t\"keyframeBurstWindow\",\n\t\"keyframeCooldown\",\n\t\"reinviteDebounceTime\",\n\t\"reinviteMaxAttempts\",\n\t\"reinviteTimeout\",\n\t\"recoveryDebounceTime\",\n\t\"recoveryCooldown\",\n\t\"iceDisconnectedGracePeriod\",\n\t\"iceRestartTimeout\",\n\t\"maxRecoveryAttempts\",\n\t\"degradationBitrateThreshold\",\n\t\"degradationRecoveryThreshold\"\n];\n/** Keys of StoredPreferences that map to boolean fields on PreferencesContainer. */\nconst STORED_BOOLEAN_KEYS = [\n\t\"receiveVideo\",\n\t\"receiveAudio\",\n\t\"disableUdpIceServers\",\n\t\"relayOnly\",\n\t\"enableRelayFallback\",\n\t\"enableNetworkChangeDetection\",\n\t\"enableServerHangupInterception\",\n\t\"persistDeviceSelection\",\n\t\"syncDevicesToActiveCalls\",\n\t\"autoMuteVideoOnHidden\",\n\t\"refreshDevicesOnVisible\",\n\t\"checkConnectionOnVisible\",\n\t\"stereoAudio\",\n\t\"enableAutoDegradation\"\n];\n/** Collects the serializable preferences from the container. */\nfunction collectStoredPreferences() {\n\tconst container = PreferencesContainer.instance;\n\treturn {\n\t\tconnectionTimeout: container.connectionTimeout,\n\t\treconnectCallsTimeout: container.reconnectCallsTimeout,\n\t\treconnectDelayMin: container.reconnectDelayMin,\n\t\treconnectDelayMax: container.reconnectDelayMax,\n\t\trelayHost: container.relayHost,\n\t\treceiveVideo: container.receiveVideo,\n\t\treceiveAudio: container.receiveAudio,\n\t\tdisableUdpIceServers: container.disableUdpIceServers,\n\t\trelayOnly: container.relayOnly,\n\t\ticeCandidateTimeout: container.iceCandidateTimeout,\n\t\ticeGatheringTimeout: container.iceGatheringTimeout,\n\t\tdeviceDebounceTime: container.deviceDebounceTime,\n\t\tdevicePollingInterval: container.devicePollingInterval,\n\t\ticeServers: container.iceServers,\n\t\tuserVariables: container.userVariables,\n\t\tstatsPollingInterval: container.statsPollingInterval,\n\t\tstatsBaselineSamples: container.statsBaselineSamples,\n\t\tstatsNoPacketThreshold: container.statsNoPacketThreshold,\n\t\tstatsRttSpikeMultiplier: container.statsRttSpikeMultiplier,\n\t\tstatsPacketLossThreshold: container.statsPacketLossThreshold,\n\t\tstatsJitterSpikeMultiplier: container.statsJitterSpikeMultiplier,\n\t\tstatsHistorySize: container.statsHistorySize,\n\t\tkeyframeMaxBurst: container.keyframeMaxBurst,\n\t\tkeyframeBurstWindow: container.keyframeBurstWindow,\n\t\tkeyframeCooldown: container.keyframeCooldown,\n\t\treinviteDebounceTime: container.reinviteDebounceTime,\n\t\treinviteMaxAttempts: container.reinviteMaxAttempts,\n\t\treinviteTimeout: container.reinviteTimeout,\n\t\trecoveryDebounceTime: container.recoveryDebounceTime,\n\t\trecoveryCooldown: container.recoveryCooldown,\n\t\ticeDisconnectedGracePeriod: container.iceDisconnectedGracePeriod,\n\t\ticeRestartTimeout: container.iceRestartTimeout,\n\t\tmaxRecoveryAttempts: container.maxRecoveryAttempts,\n\t\tenableRelayFallback: container.enableRelayFallback,\n\t\tenableNetworkChangeDetection: container.enableNetworkChangeDetection,\n\t\tenableServerHangupInterception: container.enableServerHangupInterception,\n\t\tpersistDeviceSelection: container.persistDeviceSelection,\n\t\tsyncDevicesToActiveCalls: container.syncDevicesToActiveCalls,\n\t\tautoMuteVideoOnHidden: container.autoMuteVideoOnHidden,\n\t\trefreshDevicesOnVisible: container.refreshDevicesOnVisible,\n\t\tcheckConnectionOnVisible: container.checkConnectionOnVisible,\n\t\tstereoAudio: container.stereoAudio,\n\t\tenableAutoDegradation: container.enableAutoDegradation,\n\t\tdegradationBitrateThreshold: container.degradationBitrateThreshold,\n\t\tdegradationRecoveryThreshold: container.degradationRecoveryThreshold,\n\t\tpreferredVideoCodecs: container.preferredVideoCodecs,\n\t\tpreferredAudioCodecs: container.preferredAudioCodecs\n\t};\n}\n/** Applies stored preferences to the container. */\nfunction applyStoredPreferences(stored) {\n\tconst container = PreferencesContainer.instance;\n\tfor (const key of STORED_NUMBER_KEYS) if (stored[key] !== void 0) container[key] = stored[key];\n\tfor (const key of STORED_BOOLEAN_KEYS) if (stored[key] !== void 0) container[key] = stored[key];\n\tif (stored.relayHost !== void 0) container.relayHost = stored.relayHost;\n\tif (stored.iceServers !== void 0) container.iceServers = stored.iceServers;\n\tif (stored.userVariables !== void 0) container.userVariables = stored.userVariables;\n\tif (stored.preferredVideoCodecs !== void 0) container.preferredVideoCodecs = stored.preferredVideoCodecs;\n\tif (stored.preferredAudioCodecs !== void 0) container.preferredAudioCodecs = stored.preferredAudioCodecs;\n}\n/**\n* Public preferences API for configuring SDK behavior.\n*\n* Exposed as {@link SignalWire.preferences}. All timeout values\n* are in seconds when accessed through this class.\n*\n* When {@link enableSavePreferences} is called, preferences are\n* automatically loaded from storage and synced back on every change.\n*/\nvar ClientPreferences = class {\n\tconstructor() {\n\t\tthis._storage = null;\n\t}\n\t/**\n\t* Enables persistence of preferences to storage.\n\t* Loads any previously saved preferences and syncs future changes.\n\t*/\n\tenableSavePreferences(storage) {\n\t\tthis._storage = storage;\n\t\tthis._loadFromStorage();\n\t}\n\t/** WebSocket connection timeout in seconds. */\n\tget connectionTimeout() {\n\t\treturn fromMsToSec(PreferencesContainer.instance.connectionTimeout);\n\t}\n\tset connectionTimeout(seconds) {\n\t\tPreferencesContainer.instance.connectionTimeout = fromSecToMs(seconds);\n\t\tthis._saveToStorage();\n\t}\n\t/** Timeout for reconnecting to previously attached calls, in seconds. */\n\tget reconnectCallsTimeout() {\n\t\treturn fromMsToSec(PreferencesContainer.instance.reconnectCallsTimeout);\n\t}\n\tset reconnectCallsTimeout(seconds) {\n\t\tPreferencesContainer.instance.reconnectCallsTimeout = fromSecToMs(seconds);\n\t\tthis._saveToStorage();\n\t}\n\t/** Minimum reconnection backoff delay in seconds. */\n\tget reconnectDelayMin() {\n\t\treturn fromMsToSec(PreferencesContainer.instance.reconnectDelayMin);\n\t}\n\tset reconnectDelayMin(seconds) {\n\t\tPreferencesContainer.instance.reconnectDelayMin = fromSecToMs(seconds);\n\t\tthis._saveToStorage();\n\t}\n\t/** Maximum reconnection backoff delay in seconds. */\n\tget reconnectDelayMax() {\n\t\treturn fromMsToSec(PreferencesContainer.instance.reconnectDelayMax);\n\t}\n\tset reconnectDelayMax(seconds) {\n\t\tPreferencesContainer.instance.reconnectDelayMax = fromSecToMs(seconds);\n\t\tthis._saveToStorage();\n\t}\n\t/** Custom relay host URL. Empty string uses the default. */\n\tget relayHost() {\n\t\treturn PreferencesContainer.instance.relayHost ?? \"\";\n\t}\n\tset relayHost(value) {\n\t\tPreferencesContainer.instance.relayHost = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Whether to receive remote video by default. */\n\tget receiveVideo() {\n\t\treturn PreferencesContainer.instance.receiveVideo;\n\t}\n\tset receiveVideo(value) {\n\t\tPreferencesContainer.instance.receiveVideo = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Whether to receive remote audio by default. */\n\tget receiveAudio() {\n\t\treturn PreferencesContainer.instance.receiveAudio;\n\t}\n\tset receiveAudio(value) {\n\t\tPreferencesContainer.instance.receiveAudio = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Preferred audio input device for new calls. */\n\tget preferredAudioInput() {\n\t\treturn PreferencesContainer.instance.preferredAudioInput;\n\t}\n\tset preferredAudioInput(value) {\n\t\tPreferencesContainer.instance.preferredAudioInput = value;\n\t}\n\t/** Preferred audio output device for new calls. */\n\tget preferredAudioOutput() {\n\t\treturn PreferencesContainer.instance.preferredAudioOutput;\n\t}\n\tset preferredAudioOutput(value) {\n\t\tPreferencesContainer.instance.preferredAudioOutput = value;\n\t}\n\t/** Preferred video input device for new calls. */\n\tget preferredVideoInput() {\n\t\treturn PreferencesContainer.instance.preferredVideoInput;\n\t}\n\tset preferredVideoInput(value) {\n\t\tPreferencesContainer.instance.preferredVideoInput = value;\n\t}\n\t/** Default audio input track constraints. */\n\tget inputAudioConstraints() {\n\t\treturn PreferencesContainer.instance.inputAudioDeviceConstraints;\n\t}\n\tset inputAudioConstraints(value) {\n\t\tPreferencesContainer.instance.inputAudioDeviceConstraints = value;\n\t}\n\t/** Default video input track constraints. */\n\tget inputVideoConstraints() {\n\t\treturn PreferencesContainer.instance.inputVideoDeviceConstraints;\n\t}\n\tset inputVideoConstraints(value) {\n\t\tPreferencesContainer.instance.inputVideoDeviceConstraints = value;\n\t}\n\t/** Debounce time for device change events, in seconds. */\n\tget deviceDebounceTime() {\n\t\treturn fromMsToSec(PreferencesContainer.instance.deviceDebounceTime);\n\t}\n\tset deviceDebounceTime(seconds) {\n\t\tPreferencesContainer.instance.deviceDebounceTime = fromSecToMs(seconds);\n\t\tthis._saveToStorage();\n\t}\n\t/** Polling interval for device enumeration, in seconds. */\n\tget devicePollingInterval() {\n\t\treturn fromMsToSec(PreferencesContainer.instance.devicePollingInterval);\n\t}\n\tset devicePollingInterval(seconds) {\n\t\tPreferencesContainer.instance.devicePollingInterval = fromSecToMs(seconds);\n\t\tthis._saveToStorage();\n\t}\n\t/** Whether to filter out UDP-based ICE servers. */\n\tget disableUdpIceServers() {\n\t\treturn PreferencesContainer.instance.disableUdpIceServers;\n\t}\n\tset disableUdpIceServers(value) {\n\t\tPreferencesContainer.instance.disableUdpIceServers = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Whether to force TURN relay-only ICE candidates. */\n\tget relayOnly() {\n\t\treturn PreferencesContainer.instance.relayOnly;\n\t}\n\tset relayOnly(value) {\n\t\tPreferencesContainer.instance.relayOnly = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Timeout for individual ICE candidate gathering, in seconds. */\n\tget iceCandidateTimeout() {\n\t\treturn fromMsToSec(PreferencesContainer.instance.iceCandidateTimeout);\n\t}\n\tset iceCandidateTimeout(seconds) {\n\t\tPreferencesContainer.instance.iceCandidateTimeout = fromSecToMs(seconds);\n\t\tthis._saveToStorage();\n\t}\n\t/** Timeout for the entire ICE gathering phase, in seconds. */\n\tget iceGatheringTimeout() {\n\t\treturn fromMsToSec(PreferencesContainer.instance.iceGatheringTimeout);\n\t}\n\tset iceGatheringTimeout(seconds) {\n\t\tPreferencesContainer.instance.iceGatheringTimeout = fromSecToMs(seconds);\n\t\tthis._saveToStorage();\n\t}\n\t/** Custom ICE servers for TURN/STUN configuration. */\n\tget iceServers() {\n\t\treturn PreferencesContainer.instance.iceServers;\n\t}\n\tset iceServers(value) {\n\t\tPreferencesContainer.instance.iceServers = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Custom user variables attached to calls. */\n\tget userVariables() {\n\t\treturn PreferencesContainer.instance.userVariables;\n\t}\n\tset userVariables(value) {\n\t\tPreferencesContainer.instance.userVariables = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Stats polling interval in milliseconds. */\n\tget statsPollingInterval() {\n\t\treturn PreferencesContainer.instance.statsPollingInterval;\n\t}\n\tset statsPollingInterval(value) {\n\t\tPreferencesContainer.instance.statsPollingInterval = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Number of baseline samples for stats monitoring. */\n\tget statsBaselineSamples() {\n\t\treturn PreferencesContainer.instance.statsBaselineSamples;\n\t}\n\tset statsBaselineSamples(value) {\n\t\tPreferencesContainer.instance.statsBaselineSamples = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Duration in ms with no inbound packets before a critical issue is emitted. */\n\tget statsNoPacketThreshold() {\n\t\treturn PreferencesContainer.instance.statsNoPacketThreshold;\n\t}\n\tset statsNoPacketThreshold(value) {\n\t\tPreferencesContainer.instance.statsNoPacketThreshold = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Multiplier for RTT spike detection relative to baseline. */\n\tget statsRttSpikeMultiplier() {\n\t\treturn PreferencesContainer.instance.statsRttSpikeMultiplier;\n\t}\n\tset statsRttSpikeMultiplier(value) {\n\t\tPreferencesContainer.instance.statsRttSpikeMultiplier = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Packet loss fraction threshold (0-1) for issue detection. */\n\tget statsPacketLossThreshold() {\n\t\treturn PreferencesContainer.instance.statsPacketLossThreshold;\n\t}\n\tset statsPacketLossThreshold(value) {\n\t\tPreferencesContainer.instance.statsPacketLossThreshold = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Multiplier for jitter spike detection relative to baseline. */\n\tget statsJitterSpikeMultiplier() {\n\t\treturn PreferencesContainer.instance.statsJitterSpikeMultiplier;\n\t}\n\tset statsJitterSpikeMultiplier(value) {\n\t\tPreferencesContainer.instance.statsJitterSpikeMultiplier = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Number of seconds of metrics history to retain. */\n\tget statsHistorySize() {\n\t\treturn PreferencesContainer.instance.statsHistorySize;\n\t}\n\tset statsHistorySize(value) {\n\t\tPreferencesContainer.instance.statsHistorySize = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Maximum keyframe requests in a burst window. */\n\tget keyframeMaxBurst() {\n\t\treturn PreferencesContainer.instance.keyframeMaxBurst;\n\t}\n\tset keyframeMaxBurst(value) {\n\t\tPreferencesContainer.instance.keyframeMaxBurst = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Keyframe burst window duration in milliseconds. */\n\tget keyframeBurstWindow() {\n\t\treturn PreferencesContainer.instance.keyframeBurstWindow;\n\t}\n\tset keyframeBurstWindow(value) {\n\t\tPreferencesContainer.instance.keyframeBurstWindow = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Cooldown period in ms after keyframe burst limit is reached. */\n\tget keyframeCooldown() {\n\t\treturn PreferencesContainer.instance.keyframeCooldown;\n\t}\n\tset keyframeCooldown(value) {\n\t\tPreferencesContainer.instance.keyframeCooldown = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Minimum time in ms between re-INVITE attempts. */\n\tget reinviteDebounceTime() {\n\t\treturn PreferencesContainer.instance.reinviteDebounceTime;\n\t}\n\tset reinviteDebounceTime(value) {\n\t\tPreferencesContainer.instance.reinviteDebounceTime = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Maximum re-INVITE attempts per call. */\n\tget reinviteMaxAttempts() {\n\t\treturn PreferencesContainer.instance.reinviteMaxAttempts;\n\t}\n\tset reinviteMaxAttempts(value) {\n\t\tPreferencesContainer.instance.reinviteMaxAttempts = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Timeout in ms for a single re-INVITE attempt. */\n\tget reinviteTimeout() {\n\t\treturn PreferencesContainer.instance.reinviteTimeout;\n\t}\n\tset reinviteTimeout(value) {\n\t\tPreferencesContainer.instance.reinviteTimeout = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Recovery signal debounce window in seconds. */\n\tget recoveryDebounceTime() {\n\t\treturn fromMsToSec(PreferencesContainer.instance.recoveryDebounceTime);\n\t}\n\tset recoveryDebounceTime(seconds) {\n\t\tPreferencesContainer.instance.recoveryDebounceTime = fromSecToMs(seconds);\n\t\tthis._saveToStorage();\n\t}\n\t/** Cooldown period between recovery attempts in seconds. */\n\tget recoveryCooldown() {\n\t\treturn fromMsToSec(PreferencesContainer.instance.recoveryCooldown);\n\t}\n\tset recoveryCooldown(seconds) {\n\t\tPreferencesContainer.instance.recoveryCooldown = fromSecToMs(seconds);\n\t\tthis._saveToStorage();\n\t}\n\t/** Grace period before treating ICE 'disconnected' as failure, in seconds. */\n\tget iceDisconnectedGracePeriod() {\n\t\treturn fromMsToSec(PreferencesContainer.instance.iceDisconnectedGracePeriod);\n\t}\n\tset iceDisconnectedGracePeriod(seconds) {\n\t\tPreferencesContainer.instance.iceDisconnectedGracePeriod = fromSecToMs(seconds);\n\t\tthis._saveToStorage();\n\t}\n\t/** Timeout for a single ICE restart attempt in seconds. */\n\tget iceRestartTimeout() {\n\t\treturn fromMsToSec(PreferencesContainer.instance.iceRestartTimeout);\n\t}\n\tset iceRestartTimeout(seconds) {\n\t\tPreferencesContainer.instance.iceRestartTimeout = fromSecToMs(seconds);\n\t\tthis._saveToStorage();\n\t}\n\t/** Maximum recovery attempts before giving up. */\n\tget maxRecoveryAttempts() {\n\t\treturn PreferencesContainer.instance.maxRecoveryAttempts;\n\t}\n\tset maxRecoveryAttempts(value) {\n\t\tPreferencesContainer.instance.maxRecoveryAttempts = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Whether relay-only escalation is enabled as a last-resort recovery tier. */\n\tget enableRelayFallback() {\n\t\treturn PreferencesContainer.instance.enableRelayFallback;\n\t}\n\tset enableRelayFallback(value) {\n\t\tPreferencesContainer.instance.enableRelayFallback = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Whether browser network change detection (online/offline) is enabled. */\n\tget enableNetworkChangeDetection() {\n\t\treturn PreferencesContainer.instance.enableNetworkChangeDetection;\n\t}\n\tset enableNetworkChangeDetection(value) {\n\t\tPreferencesContainer.instance.enableNetworkChangeDetection = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Whether server-sent media-timeout hangups are intercepted for recovery. */\n\tget enableServerHangupInterception() {\n\t\treturn PreferencesContainer.instance.enableServerHangupInterception;\n\t}\n\tset enableServerHangupInterception(value) {\n\t\tPreferencesContainer.instance.enableServerHangupInterception = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Whether device selections are persisted to storage. */\n\tget persistDeviceSelection() {\n\t\treturn PreferencesContainer.instance.persistDeviceSelection;\n\t}\n\tset persistDeviceSelection(value) {\n\t\tPreferencesContainer.instance.persistDeviceSelection = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Whether device changes are auto-applied to active calls. */\n\tget syncDevicesToActiveCalls() {\n\t\treturn PreferencesContainer.instance.syncDevicesToActiveCalls;\n\t}\n\tset syncDevicesToActiveCalls(value) {\n\t\tPreferencesContainer.instance.syncDevicesToActiveCalls = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Whether to auto-mute video when the tab becomes hidden. */\n\tget autoMuteVideoOnHidden() {\n\t\treturn PreferencesContainer.instance.autoMuteVideoOnHidden;\n\t}\n\tset autoMuteVideoOnHidden(value) {\n\t\tPreferencesContainer.instance.autoMuteVideoOnHidden = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Whether to re-enumerate devices when the page becomes visible. */\n\tget refreshDevicesOnVisible() {\n\t\treturn PreferencesContainer.instance.refreshDevicesOnVisible;\n\t}\n\tset refreshDevicesOnVisible(value) {\n\t\tPreferencesContainer.instance.refreshDevicesOnVisible = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Whether to check peer connection health when the page becomes visible. */\n\tget checkConnectionOnVisible() {\n\t\treturn PreferencesContainer.instance.checkConnectionOnVisible;\n\t}\n\tset checkConnectionOnVisible(value) {\n\t\tPreferencesContainer.instance.checkConnectionOnVisible = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Default audio track constraints applied when no explicit constraints are provided. */\n\tget defaultAudioConstraints() {\n\t\treturn PreferencesContainer.instance.defaultAudioConstraints;\n\t}\n\tset defaultAudioConstraints(value) {\n\t\tPreferencesContainer.instance.defaultAudioConstraints = value;\n\t}\n\t/** Default video track constraints applied when video is enabled without explicit constraints. */\n\tget defaultVideoConstraints() {\n\t\treturn PreferencesContainer.instance.defaultVideoConstraints;\n\t}\n\tset defaultVideoConstraints(value) {\n\t\tPreferencesContainer.instance.defaultVideoConstraints = value;\n\t}\n\t/** Whether stereo Opus is enabled globally. */\n\tget stereoAudio() {\n\t\treturn PreferencesContainer.instance.stereoAudio;\n\t}\n\tset stereoAudio(value) {\n\t\tPreferencesContainer.instance.stereoAudio = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Whether automatic video degradation on low bandwidth is enabled. */\n\tget enableAutoDegradation() {\n\t\treturn PreferencesContainer.instance.enableAutoDegradation;\n\t}\n\tset enableAutoDegradation(value) {\n\t\tPreferencesContainer.instance.enableAutoDegradation = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Bitrate in kbps below which video is automatically disabled. */\n\tget degradationBitrateThreshold() {\n\t\treturn PreferencesContainer.instance.degradationBitrateThreshold;\n\t}\n\tset degradationBitrateThreshold(value) {\n\t\tPreferencesContainer.instance.degradationBitrateThreshold = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Bitrate in kbps above which video is automatically re-enabled. */\n\tget degradationRecoveryThreshold() {\n\t\treturn PreferencesContainer.instance.degradationRecoveryThreshold;\n\t}\n\tset degradationRecoveryThreshold(value) {\n\t\tPreferencesContainer.instance.degradationRecoveryThreshold = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Preferred video codecs in priority order. */\n\tget preferredVideoCodecs() {\n\t\treturn PreferencesContainer.instance.preferredVideoCodecs;\n\t}\n\tset preferredVideoCodecs(value) {\n\t\tPreferencesContainer.instance.preferredVideoCodecs = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Preferred audio codecs in priority order. */\n\tget preferredAudioCodecs() {\n\t\treturn PreferencesContainer.instance.preferredAudioCodecs;\n\t}\n\tset preferredAudioCodecs(value) {\n\t\tPreferencesContainer.instance.preferredAudioCodecs = value;\n\t\tthis._saveToStorage();\n\t}\n\t/** Saves current preferences to storage (fire-and-forget). */\n\t_saveToStorage() {\n\t\tif (!this._storage) return;\n\t\tconst data = collectStoredPreferences();\n\t\tthis._storage.setItem(PREFERENCES_STORAGE_KEY, data, \"local\").catch((error) => {\n\t\t\tlogger$29.error(`[ClientPreferences] Failed to save preferences: ${String(error)}`);\n\t\t});\n\t}\n\t/** Loads preferences from storage and applies them to the container. */\n\t_loadFromStorage() {\n\t\tif (!this._storage) return;\n\t\tthis._storage.getItem(PREFERENCES_STORAGE_KEY, \"local\").then((stored) => {\n\t\t\tif (stored) applyStoredPreferences(stored);\n\t\t}).catch((error) => {\n\t\t\tlogger$29.error(`[ClientPreferences] Failed to load preferences: ${String(error)}`);\n\t\t});\n\t}\n};\n\n//#endregion\n//#region src/utils/toError.ts\n/**\n* Normalizes an unknown caught value into a proper Error instance.\n*\n* In catch blocks, the caught value is `unknown` — it could be an Error,\n* string, number, or any other value. This utility ensures a consistent\n* Error object is produced.\n*/\nfunction toError(value) {\n\tif (value instanceof Error) return value;\n\treturn new Error(String(value));\n}\n\n//#endregion\n//#region src/controllers/NavigatorDeviceController.ts\nconst logger$28 = getLogger();\n/** Maps a device kind to its storage key. */\nconst DEVICE_STORAGE_KEYS = {\n\taudioinput: DEVICE_STORAGE_KEY_AUDIO_INPUT,\n\taudiooutput: DEVICE_STORAGE_KEY_AUDIO_OUTPUT,\n\tvideoinput: DEVICE_STORAGE_KEY_VIDEO_INPUT\n};\nconst initialDevicesState = {\n\taudioinput: [],\n\taudiooutput: [],\n\tvideoinput: []\n};\nconst initialSelectedDevicesState = {\n\taudioinput: null,\n\taudiooutput: null,\n\tvideoinput: null\n};\nvar NavigatorDeviceController = class extends Destroyable {\n\tconstructor(webRTCApiProvider, storageManager) {\n\t\tsuper();\n\t\tthis.webRTCApiProvider = webRTCApiProvider;\n\t\tthis.deviceChangeHandler = () => {\n\t\t\tlogger$28.debug(\"[DeviceController] Device change detected\");\n\t\t\tthis.enumerateDevices();\n\t\t};\n\t\tthis._devicesState$ = this.createBehaviorSubject(initialDevicesState);\n\t\tthis._selectedDevicesState$ = this.createBehaviorSubject(initialSelectedDevicesState);\n\t\tthis._errors$ = this.createReplaySubject(1);\n\t\tthis._deviceHistory = new DeviceHistoryManager();\n\t\tthis._deviceRecovered$ = this.createSubject();\n\t\tthis._audioInputDisabled$ = this.createBehaviorSubject(false);\n\t\tthis._videoInputDisabled$ = this.createBehaviorSubject(false);\n\t\tthis._lastAudioInputBeforeDisable = null;\n\t\tthis._lastVideoInputBeforeDisable = null;\n\t\tthis._persistedDevices = {};\n\t\tthis._storageManager = storageManager;\n\t\tthis.init();\n\t}\n\t/** Sets the storage manager for device persistence. */\n\tsetStorageManager(storageManager) {\n\t\tthis._storageManager = storageManager;\n\t\tthis.loadPersistedDevices();\n\t}\n\tget selectedAudioInputDeviceConstraints() {\n\t\tif (this._audioInputDisabled$.value) return false;\n\t\treturn this.deviceInfoToConstraints(this.selectedAudioInputDevice);\n\t}\n\tget selectedVideoInputDeviceConstraints() {\n\t\tif (this._videoInputDisabled$.value) return false;\n\t\treturn this.deviceInfoToConstraints(this.selectedVideoInputDevice);\n\t}\n\tdeviceInfoToConstraints(deviceInfo) {\n\t\tif (!deviceInfo?.deviceId || deviceInfo.deviceId.trim() === \"\") return {};\n\t\tconst devices = deviceInfo.kind === \"audioinput\" ? this.audioInputDevices : this.videoInputDevices;\n\t\tconst device = devices.find((device$1) => device$1.deviceId === deviceInfo.deviceId) ?? devices.find((device$1) => device$1.label === deviceInfo.label);\n\t\tif (device) return { deviceId: { exact: device.deviceId } };\n\t\treturn {};\n\t}\n\tget errors$() {\n\t\treturn this.cachedObservable(\"errors$\", () => this._errors$.asObservable().pipe(takeUntil(this.destroyed$)));\n\t}\n\t/** Observable that emits when the SDK auto-switches a device. */\n\tget deviceRecovered$() {\n\t\treturn this._deviceRecovered$.asObservable().pipe(takeUntil(this.destroyed$));\n\t}\n\tget videoInputDisabled$() {\n\t\treturn this.cachedObservable(\"videoInputDisabled$\", () => this._videoInputDisabled$.asObservable().pipe(distinctUntilChanged(), takeUntil(this.destroyed$)));\n\t}\n\tget audioInputDisabled$() {\n\t\treturn this.cachedObservable(\"audioInputDisabled$\", () => this._audioInputDisabled$.asObservable().pipe(distinctUntilChanged(), takeUntil(this.destroyed$)));\n\t}\n\tget videoInputDisabled() {\n\t\treturn this._videoInputDisabled$.value;\n\t}\n\tget audioInputDisabled() {\n\t\treturn this._audioInputDisabled$.value;\n\t}\n\tget audioInputDevices$() {\n\t\treturn this.cachedObservable(\"audioInputDevices$\", () => this._devicesState$.pipe(map((state) => state.audioinput), distinctUntilChanged(), takeUntil(this.destroyed$)));\n\t}\n\tget audioOutputDevices$() {\n\t\treturn this.cachedObservable(\"audioOutputDevices$\", () => this._devicesState$.pipe(map((state) => state.audiooutput), distinctUntilChanged(), takeUntil(this.destroyed$)));\n\t}\n\tget videoInputDevices$() {\n\t\treturn this.cachedObservable(\"videoInputDevices$\", () => this._devicesState$.pipe(map((state) => state.videoinput), distinctUntilChanged(), takeUntil(this.destroyed$)));\n\t}\n\tget selectedAudioInputDevice$() {\n\t\treturn this.cachedObservable(\"selectedAudioInputDevice$\", () => this._selectedDevicesState$.asObservable().pipe(map((state) => state.audioinput), distinctUntilChanged(), takeUntil(this.destroyed$), tap((info) => logger$28.debug(\"[DeviceController] Selected audio input device changed:\", info))));\n\t}\n\tget selectedAudioOutputDevice$() {\n\t\treturn this.cachedObservable(\"selectedAudioOutputDevice$\", () => this._selectedDevicesState$.asObservable().pipe(map((state) => state.audiooutput), distinctUntilChanged(), takeUntil(this.destroyed$), tap((info) => logger$28.debug(\"[DeviceController] Selected audio output device changed:\", info))));\n\t}\n\tget selectedVideoInputDevice$() {\n\t\treturn this.cachedObservable(\"selectedVideoInputDevice$\", () => this._selectedDevicesState$.asObservable().pipe(map((state) => state.videoinput), distinctUntilChanged(), takeUntil(this.destroyed$), tap((info) => logger$28.debug(\"[DeviceController] Selected video input device changed:\", info))));\n\t}\n\tget selectedAudioInputDevice() {\n\t\tif (this._audioInputDisabled$.value) return null;\n\t\treturn this._selectedDevicesState$.value.audioinput;\n\t}\n\tget selectedAudioOutputDevice() {\n\t\treturn this._selectedDevicesState$.value.audiooutput;\n\t}\n\tget selectedVideoInputDevice() {\n\t\tif (this._videoInputDisabled$.value) return null;\n\t\treturn this._selectedDevicesState$.value.videoinput;\n\t}\n\tget audioInputDevices() {\n\t\treturn this._devicesState$.value.audioinput;\n\t}\n\tget audioOutputDevices() {\n\t\treturn this._devicesState$.value.audiooutput;\n\t}\n\tget videoInputDevices() {\n\t\treturn this._devicesState$.value.videoinput;\n\t}\n\tdisableAudioInput() {\n\t\tif (!this._audioInputDisabled$.value) {\n\t\t\tthis._lastAudioInputBeforeDisable = this._selectedDevicesState$.value.audioinput;\n\t\t\tthis._audioInputDisabled$.next(true);\n\t\t\tthis._selectedDevicesState$.next({\n\t\t\t\t...this._selectedDevicesState$.value,\n\t\t\t\taudioinput: null\n\t\t\t});\n\t\t}\n\t}\n\tenableAudioInput() {\n\t\tif (this._audioInputDisabled$.value) {\n\t\t\tthis._audioInputDisabled$.next(false);\n\t\t\tconst restored = this._lastAudioInputBeforeDisable ?? this.audioInputDevices[0];\n\t\t\tthis._selectedDevicesState$.next({\n\t\t\t\t...this._selectedDevicesState$.value,\n\t\t\t\taudioinput: restored\n\t\t\t});\n\t\t\tthis._lastAudioInputBeforeDisable = null;\n\t\t}\n\t}\n\tdisableVideoInput() {\n\t\tif (!this._videoInputDisabled$.value) {\n\t\t\tthis._lastVideoInputBeforeDisable = this._selectedDevicesState$.value.videoinput;\n\t\t\tthis._videoInputDisabled$.next(true);\n\t\t\tthis._selectedDevicesState$.next({\n\t\t\t\t...this._selectedDevicesState$.value,\n\t\t\t\tvideoinput: null\n\t\t\t});\n\t\t}\n\t}\n\tenableVideoInput() {\n\t\tif (this._videoInputDisabled$.value) {\n\t\t\tthis._videoInputDisabled$.next(false);\n\t\t\tconst restored = this._lastVideoInputBeforeDisable ?? this.videoInputDevices[0];\n\t\t\tthis._selectedDevicesState$.next({\n\t\t\t\t...this._selectedDevicesState$.value,\n\t\t\t\tvideoinput: restored\n\t\t\t});\n\t\t\tthis._lastVideoInputBeforeDisable = null;\n\t\t}\n\t}\n\tselectAudioInputDevice(device) {\n\t\tif (this._audioInputDisabled$.value && device) this._audioInputDisabled$.next(false);\n\t\tconst previous = this._selectedDevicesState$.value.audioinput;\n\t\tif (previous && previous.deviceId !== device?.deviceId) this._deviceHistory.push(\"audioinput\", previous);\n\t\tthis._selectedDevicesState$.next({\n\t\t\t...this._selectedDevicesState$.value,\n\t\t\taudioinput: device\n\t\t});\n\t\tif (device) this.persistDeviceSelection(\"audioinput\", device);\n\t}\n\tselectVideoInputDevice(device) {\n\t\tlogger$28.debug(\"[DeviceController] Setting selected video input device:\", device);\n\t\tif (this._videoInputDisabled$.value && device) this._videoInputDisabled$.next(false);\n\t\tconst previous = this._selectedDevicesState$.value.videoinput;\n\t\tif (previous && previous.deviceId !== device?.deviceId) this._deviceHistory.push(\"videoinput\", previous);\n\t\tthis._selectedDevicesState$.next({\n\t\t\t...this._selectedDevicesState$.value,\n\t\t\tvideoinput: device\n\t\t});\n\t\tif (device) this.persistDeviceSelection(\"videoinput\", device);\n\t}\n\tselectAudioOutputDevice(device) {\n\t\tconst previous = this._selectedDevicesState$.value.audiooutput;\n\t\tif (previous && previous.deviceId !== device?.deviceId) this._deviceHistory.push(\"audiooutput\", previous);\n\t\tthis._selectedDevicesState$.next({\n\t\t\t...this._selectedDevicesState$.value,\n\t\t\taudiooutput: device\n\t\t});\n\t\tif (device) this.persistDeviceSelection(\"audiooutput\", device);\n\t}\n\tinit() {\n\t\tthis.loadPersistedDevices();\n\t\tthis.subscribeTo(this._devicesState$.pipe(debounceTime(PreferencesContainer.instance.deviceDebounceTime)), (devicesState) => {\n\t\t\tconst currentSelected = this._selectedDevicesState$.value;\n\t\t\tconst newAudioInput = this._audioInputDisabled$.value ? null : this.resolveDevice(\"audioinput\", devicesState.audioinput, currentSelected.audioinput, PreferencesContainer.instance.preferredAudioInput);\n\t\t\tconst newAudioOutput = this.resolveDevice(\"audiooutput\", devicesState.audiooutput, currentSelected.audiooutput, PreferencesContainer.instance.preferredAudioOutput);\n\t\t\tconst newVideoInput = this._videoInputDisabled$.value ? null : this.resolveDevice(\"videoinput\", devicesState.videoinput, currentSelected.videoinput, PreferencesContainer.instance.preferredVideoInput);\n\t\t\tif (newAudioInput !== currentSelected.audioinput || newAudioOutput !== currentSelected.audiooutput || newVideoInput !== currentSelected.videoinput) {\n\t\t\t\tconst shouldSync = PreferencesContainer.instance.syncDevicesToActiveCalls;\n\t\t\t\tthis._selectedDevicesState$.next({\n\t\t\t\t\taudioinput: shouldSync || !currentSelected.audioinput ? newAudioInput : currentSelected.audioinput,\n\t\t\t\t\taudiooutput: shouldSync || !currentSelected.audiooutput ? newAudioOutput : currentSelected.audiooutput,\n\t\t\t\t\tvideoinput: shouldSync || !currentSelected.videoinput ? newVideoInput : currentSelected.videoinput\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tthis.enumerateDevices();\n\t}\n\t/**\n\t* Resolves the best device for a given kind, using device history\n\t* for succession when the selected device disappears.\n\t* Section 5.1 adds persisted device resolution.\n\t* Section 5.4 adds duplicate-named device handling.\n\t*/\n\tresolveDevice(kind, devices, selected, preferred) {\n\t\tif (devices.length === 0) return null;\n\t\tif (selected) {\n\t\t\tif (devices.find((device) => device.deviceId === selected.deviceId)) return selected;\n\t\t\tconst labelMatches = devices.filter((device) => device.label === selected.label);\n\t\t\tif (labelMatches.length === 1) return labelMatches[0];\n\t\t\tif (labelMatches.length > 1) {\n\t\t\t\tconst groupMatch = labelMatches.find((device) => device.groupId === selected.groupId);\n\t\t\t\tif (groupMatch) return groupMatch;\n\t\t\t\tthis.emitDeviceRecovered(kind, selected, null, \"ambiguous_match\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst fromHistory = this._deviceHistory.findInHistory(kind, devices);\n\t\t\tif (fromHistory) {\n\t\t\t\tlogger$28.debug(`[DeviceController] Device disappeared, falling back to history: ${fromHistory.label}`);\n\t\t\t\tthis.emitDeviceRecovered(kind, selected, fromHistory, \"device_disconnected\");\n\t\t\t\treturn fromHistory;\n\t\t\t}\n\t\t\tconst newDevice = (preferred ? devices.find((device) => device.deviceId === preferred.deviceId || device.label === preferred.label) : void 0) ?? devices[0];\n\t\t\tthis.emitDeviceRecovered(kind, selected, newDevice, \"fallback_to_default\");\n\t\t\treturn newDevice;\n\t\t}\n\t\tconst persisted = this._persistedDevices[kind];\n\t\tif (persisted) {\n\t\t\tconst fromPersisted = this.resolvePersistedDevice(kind, persisted, devices);\n\t\t\tif (fromPersisted) return fromPersisted;\n\t\t}\n\t\tif (preferred) {\n\t\t\tconst preferredDevice = devices.find((device) => device.deviceId === preferred.deviceId || device.label === preferred.label);\n\t\t\tif (preferredDevice) return preferredDevice;\n\t\t}\n\t\treturn devices[0];\n\t}\n\t/**\n\t* Section 5.1: Resolves a stored device preference against the current device list.\n\t* Priority: exact deviceId > groupId+label > label (single match only)\n\t*/\n\tresolvePersistedDevice(_kind, stored, devices) {\n\t\tconst exactMatch = devices.find((d) => d.deviceId === stored.deviceId);\n\t\tif (exactMatch) return exactMatch;\n\t\tconst groupLabelMatch = devices.find((d) => d.groupId === stored.groupId && d.label === stored.label);\n\t\tif (groupLabelMatch) return groupLabelMatch;\n\t\tconst labelMatches = devices.filter((d) => d.label === stored.label);\n\t\tif (labelMatches.length === 1) return labelMatches[0];\n\t\treturn null;\n\t}\n\temitDeviceRecovered(kind, previousDevice, newDevice, reason) {\n\t\ttry {\n\t\t\tthis._deviceRecovered$.next({\n\t\t\t\tkind,\n\t\t\t\tpreviousDevice,\n\t\t\t\tnewDevice,\n\t\t\t\treason\n\t\t\t});\n\t\t} catch {}\n\t}\n\tasync persistDeviceSelection(kind, device) {\n\t\tif (!this._storageManager || !PreferencesContainer.instance.persistDeviceSelection) return;\n\t\tconst stored = {\n\t\t\tdeviceId: device.deviceId,\n\t\t\tlabel: device.label,\n\t\t\tkind: device.kind,\n\t\t\tgroupId: device.groupId\n\t\t};\n\t\ttry {\n\t\t\tawait this._storageManager.setItem(DEVICE_STORAGE_KEYS[kind], stored, \"local\");\n\t\t} catch (error) {\n\t\t\tlogger$28.error(`[DeviceController] Failed to persist device selection for ${kind}:`, error);\n\t\t}\n\t}\n\tasync loadPersistedDevices() {\n\t\tif (!this._storageManager || !PreferencesContainer.instance.persistDeviceSelection) return;\n\t\tfor (const kind of [\n\t\t\t\"audioinput\",\n\t\t\t\"audiooutput\",\n\t\t\t\"videoinput\"\n\t\t]) try {\n\t\t\tconst stored = await this._storageManager.getItem(DEVICE_STORAGE_KEYS[kind], \"local\");\n\t\t\tif (stored) this._persistedDevices = {\n\t\t\t\t...this._persistedDevices,\n\t\t\t\t[kind]: stored\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tlogger$28.error(`[DeviceController] Failed to load persisted device for ${kind}:`, error);\n\t\t}\n\t}\n\t/** Clears device history, persisted selections, and re-enumerates devices. */\n\tasync clearDeviceState() {\n\t\tthis._deviceHistory.clear();\n\t\tthis._persistedDevices = {};\n\t\tthis._lastAudioInputBeforeDisable = null;\n\t\tthis._lastVideoInputBeforeDisable = null;\n\t\tthis._audioInputDisabled$.next(false);\n\t\tthis._videoInputDisabled$.next(false);\n\t\tthis._selectedDevicesState$.next(initialSelectedDevicesState);\n\t\tawait this.enumerateDevices();\n\t}\n\tenableDeviceMonitoring() {\n\t\tthis.disableDeviceMonitoring();\n\t\tthis.webRTCApiProvider.mediaDevices.addEventListener(\"devicechange\", this.deviceChangeHandler);\n\t\tif (PreferencesContainer.instance.devicePollingInterval > 0) this._devicesPoolingSubscription = interval(PreferencesContainer.instance.devicePollingInterval).subscribe(() => {\n\t\t\tlogger$28.debug(\"[DeviceController] Polling devices due to interval\");\n\t\t\tthis.enumerateDevices();\n\t\t});\n\t\tthis.enumerateDevices();\n\t}\n\tdisableDeviceMonitoring() {\n\t\tthis.webRTCApiProvider.mediaDevices.removeEventListener(\"devicechange\", this.deviceChangeHandler);\n\t\tif (this._devicesPoolingSubscription) {\n\t\t\tthis._devicesPoolingSubscription.unsubscribe();\n\t\t\tthis._devicesPoolingSubscription = void 0;\n\t\t}\n\t}\n\tasync enumerateDevices() {\n\t\ttry {\n\t\t\tconst devicesByKind = (await this.webRTCApiProvider.mediaDevices.enumerateDevices()).reduce((acc, device) => {\n\t\t\t\tconst kind = device.kind;\n\t\t\t\treturn {\n\t\t\t\t\t...acc,\n\t\t\t\t\t[kind]: [...acc[kind], device]\n\t\t\t\t};\n\t\t\t}, {\n\t\t\t\taudioinput: [],\n\t\t\t\taudiooutput: [],\n\t\t\t\tvideoinput: []\n\t\t\t});\n\t\t\tthis._devicesState$.next(devicesByKind);\n\t\t\tlogger$28.debug(\"[DeviceController] Devices enumerated:\", {\n\t\t\t\taudioInputs: devicesByKind.audioinput.length,\n\t\t\t\taudioOutputs: devicesByKind.audiooutput.length,\n\t\t\t\tvideoInputs: devicesByKind.videoinput.length\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tlogger$28.error(\"[DeviceController] Failed to enumerate devices:\", error);\n\t\t\tthis._errors$.next(toError(error));\n\t\t}\n\t}\n\tasync getDeviceCapabilities(deviceInfo) {\n\t\tif (deviceInfo.kind === \"audiooutput\") return null;\n\t\ttry {\n\t\t\tconst constraints = this.deviceInfoToConstraints(deviceInfo);\n\t\t\tconst stream = await this.webRTCApiProvider.mediaDevices.getUserMedia({\n\t\t\t\taudio: deviceInfo.kind === \"audioinput\" ? constraints : false,\n\t\t\t\tvideo: deviceInfo.kind === \"videoinput\" ? constraints : false\n\t\t\t});\n\t\t\tconst capabilities = (deviceInfo.kind === \"audioinput\" ? stream.getAudioTracks()[0] : stream.getVideoTracks()[0]).getCapabilities();\n\t\t\tstream.getTracks().forEach((t) => t.stop());\n\t\t\treturn capabilities;\n\t\t} catch (error) {\n\t\t\tlogger$28.error(\"[DeviceController] Failed to get device capabilities:\", error);\n\t\t\tthis._errors$.next(toError(error));\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync isValidDevice(deviceInfo) {\n\t\tif (!deviceInfo || deviceInfo.kind === \"audiooutput\") return false;\n\t\ttry {\n\t\t\treturn await this.getDeviceCapabilities(deviceInfo) !== null;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}\n\tdestroy() {\n\t\tthis.disableDeviceMonitoring();\n\t\tsuper.destroy();\n\t}\n};\n\n//#endregion\n//#region src/dependencies/DefaultLocalStorage.ts\n/** Default storage implementation backed by browser `localStorage` and `sessionStorage`. */\nvar DefaultLocalStorage = class {\n\tconstructor() {\n\t\tif (typeof localStorage === \"undefined\") throw new StorageNotAvailableError(\"localStorage\");\n\t\tif (typeof sessionStorage === \"undefined\") throw new StorageNotAvailableError(\"sessionStorage\");\n\t\ttry {\n\t\t\tconst testKey = \"__storage_test__\";\n\t\t\tlocalStorage.setItem(testKey, \"test\");\n\t\t\tlocalStorage.removeItem(testKey);\n\t\t} catch (error) {\n\t\t\tgetLogger().error(\"LocalStorage is not accessible:\", error);\n\t\t\tthrow new StorageNotAvailableError(\"localStorage\");\n\t\t}\n\t}\n\tstorage(scope) {\n\t\treturn scope === \"local\" ? localStorage : sessionStorage;\n\t}\n\tasync setItem(key, value, scope = \"session\") {\n\t\tthis.storage(scope).setItem(key, value);\n\t\treturn Promise.resolve();\n\t}\n\tasync getItem(key, scope = \"session\") {\n\t\treturn Promise.resolve(this.storage(scope).getItem(key));\n\t}\n\tasync removeItem(key, scope = \"session\") {\n\t\tthis.storage(scope).removeItem(key);\n\t\treturn Promise.resolve();\n\t}\n\tasync clear(scope = \"session\") {\n\t\tconst store = this.storage(scope);\n\t\tconst keysToRemove = [];\n\t\tfor (let i = 0; i < store.length; i++) {\n\t\t\tconst key = store.key(i);\n\t\t\tif (key?.startsWith(\"sw:\")) keysToRemove.push(key);\n\t\t}\n\t\tfor (const key of keysToRemove) store.removeItem(key);\n\t\treturn Promise.resolve();\n\t}\n};\n\n//#endregion\n//#region src/managers/StorageManager.ts\nvar StorageManager = class {\n\tconstructor(storageImpl = new DefaultLocalStorage()) {\n\t\tthis.storageImpl = storageImpl;\n\t}\n\t/**\n\t* Validates that a value can be safely serialized to JSON\n\t* @throws SerializationError if value contains non-serializable types\n\t*/\n\tserialize(value, key) {\n\t\tif (value === void 0 || value === null) return null;\n\t\ttry {\n\t\t\treturn JSON.stringify(value);\n\t\t} catch (e) {\n\t\t\tthrow new SerializationError(key ?? \"unknown\", e);\n\t\t}\n\t}\n\t/**\n\t* Stores a value in storage\n\t* @throws InvalidStorageValueError if value contains non-serializable types\n\t* @throws SerializationError if JSON serialization fails\n\t* @throws StorageWriteError if writing to storage fails\n\t*/\n\tasync setItem(key, value, scope = \"session\") {\n\t\tconst serialized = this.serialize(value, key);\n\t\ttry {\n\t\t\tawait this.storageImpl.setItem(key, serialized, scope);\n\t\t} catch (error) {\n\t\t\tthrow new StorageWriteError(key, error);\n\t\t}\n\t}\n\t/**\n\t* Retrieves a value from storage\n\t*\n\t* This method distinguishes between:\n\t* - Storage errors (network, permission, etc.) - these are thrown\n\t* - JSON parse errors - these trigger onParseError and return raw string\n\t* - Missing keys - returns null\n\t*\n\t* @returns The parsed value, raw string (on parse error), or null\n\t* @throws StorageReadError\n\t*/\n\tasync getItem(key, scope = \"session\") {\n\t\tlet item;\n\t\ttry {\n\t\t\titem = await this.storageImpl.getItem(key, scope);\n\t\t} catch (error) {\n\t\t\tthrow new StorageReadError(key, error);\n\t\t}\n\t\tif (!item) return null;\n\t\ttry {\n\t\t\treturn JSON.parse(item);\n\t\t} catch (error) {\n\t\t\tthrow new DeserializationError(key, error);\n\t\t}\n\t}\n\t/**\n\t* Removes a value from storage\n\t* @throws Error from underlying storage implementation\n\t*/\n\tasync removeItem(key, scope = \"session\") {\n\t\ttry {\n\t\t\tawait this.storageImpl.removeItem(key, scope);\n\t\t} catch (error) {\n\t\t\tthrow new StorageWriteError(key, error);\n\t\t}\n\t}\n\t/**\n\t* Clears all SDK keys from both 'local' and 'session' scopes.\n\t* @throws StorageWriteError if clearing fails\n\t*/\n\tasync clearAll() {\n\t\ttry {\n\t\t\tawait this.storageImpl.clear(\"local\");\n\t\t\tawait this.storageImpl.clear(\"session\");\n\t\t} catch (error) {\n\t\t\tthrow new StorageWriteError(\"clearAll\", error);\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/containers/DependencyContainer.ts\nvar DependencyContainer = class {\n\tconstructor() {\n\t\tthis.persistSession = false;\n\t\tthis._webSocketConstructor = typeof WebSocket !== \"undefined\" ? WebSocket : void 0;\n\t\tthis._baseURL = this.apiHost;\n\t\tthis._credential = {};\n\t}\n\tget subscriberId() {\n\t\treturn this.subscriber.id;\n\t}\n\tget subscriber() {\n\t\tif (!this._subscriber) throw new DependencyError(\"Subscriber\");\n\t\treturn this._subscriber;\n\t}\n\tset subscriber(subscriber) {\n\t\tthis._subscriber = subscriber;\n\t}\n\tget storage() {\n\t\tif (!this._storageManager) {\n\t\t\tthis._storageImpl ??= new DefaultLocalStorage();\n\t\t\tthis._storageManager = new StorageManager(this._storageImpl);\n\t\t}\n\t\treturn this._storageManager;\n\t}\n\tget http() {\n\t\tthis._httpRequestController ??= new HTTPRequestController(this._baseURL, () => this._credential);\n\t\treturn this._httpRequestController;\n\t}\n\tget conversationManager() {\n\t\tif (!this._conversationManager) throw new DependencyError(\"ConversationsManager\");\n\t\treturn this._conversationManager;\n\t}\n\tset conversationManager(conversationManager) {\n\t\tthis._conversationManager = conversationManager;\n\t}\n\tget WebSocket() {\n\t\tif (!this._webSocketConstructor) throw new DependencyError(\"WebSocket constructor\");\n\t\treturn this._webSocketConstructor;\n\t}\n\tset WebSocket(WebSocketConstructor) {\n\t\tthis._webSocketConstructor = WebSocketConstructor;\n\t}\n\tget deviceController() {\n\t\tthis._deviceController ??= new NavigatorDeviceController(this.webRTCApiProvider, this.storage);\n\t\treturn this._deviceController;\n\t}\n\tget webRTCApiProvider() {\n\t\tif (!this._webRTCApiProvider) {\n\t\t\tif (typeof RTCPeerConnection === \"undefined\" || typeof navigator === \"undefined\") throw new DependencyError(\"WebRTCApiProvider: RTCPeerConnection or navigator.mediaDevices is not available. Please provide a custom webRTCApiProvider in SignalWireOptions.\");\n\t\t\tthis._webRTCApiProvider = {\n\t\t\t\tRTCPeerConnection,\n\t\t\t\tmediaDevices: navigator.mediaDevices\n\t\t\t};\n\t\t}\n\t\treturn this._webRTCApiProvider;\n\t}\n\tset webRTCApiProvider(webRTCApiProvider) {\n\t\tthis._webRTCApiProvider = webRTCApiProvider;\n\t\tthis._deviceController = void 0;\n\t}\n\tget authorizationStateKey() {\n\t\treturn `sw:${this.subscriberId}:as`;\n\t}\n\tget protocolKey() {\n\t\treturn `sw:${this.subscriberId}:pt`;\n\t}\n\tget attachedCallsKey() {\n\t\treturn `sw:${this.subscriberId}:att`;\n\t}\n\tgetSubscriberFromAddressId() {\n\t\treturn this.subscriber.addresses[0]?.id ?? \"\";\n\t}\n\tset baseURL(baseURL) {\n\t\tthis._baseURL = baseURL;\n\t\tthis._httpRequestController = void 0;\n\t}\n\tget credential() {\n\t\treturn this._credential;\n\t}\n\tset credential(credential) {\n\t\tthis._credential = credential;\n\t}\n\tset storageImpl(storageImpl) {\n\t\tthis._storageImpl = storageImpl;\n\t\tthis._storageManager = void 0;\n\t}\n\tset ch(ch) {\n\t\tif (!ch) return;\n\t\tconst firstDot = ch.indexOf(\".\");\n\t\tif (firstDot !== -1) {\n\t\t\tthis._host = ch.substring(0, firstDot);\n\t\t\tthis._domain = ch.substring(firstDot + 1);\n\t\t}\n\t\tthis._baseURL = this.apiHost;\n\t\tthis._httpRequestController = void 0;\n\t}\n\tget relayHost() {\n\t\treturn `wss://${this._host ?? \"puc\"}.${this._domain ?? \"signalwire.com\"}`;\n\t}\n\tget apiHost() {\n\t\treturn `https://fabric.${this._domain ?? \"signalwire.com\"}`;\n\t}\n};\n\n//#endregion\n//#region src/controllers/CryptoController.ts\nconst logger$27 = getLogger();\nconst DPOP_DB_NAME = \"sw-dpop\";\nconst DPOP_DB_VERSION = 1;\nconst DPOP_STORE_NAME = \"keys\";\nconst DPOP_KEY_ID = \"dpop-keypair\";\n/**\n* Base64url-encodes an ArrayBuffer (no padding, URL-safe).\n*/\nconst base64url = (buffer) => {\n\tconst bytes = new Uint8Array(buffer);\n\tlet binary = \"\";\n\tfor (const byte of bytes) binary += String.fromCharCode(byte);\n\treturn btoa(binary).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\n};\n/**\n* Base64url-encodes a UTF-8 string.\n*/\nconst base64urlEncode = (str) => {\n\treturn base64url(new TextEncoder().encode(str).buffer);\n};\n/**\n* Computes the JWK Thumbprint per RFC 7638.\n*\n* Only supports RSA keys — the canonical JSON uses lexicographic member ordering: { e, kty, n }.\n* The thumbprint is SHA-256 of the canonical JSON, base64url-encoded.\n*\n* @throws {Error} If the JWK is not an RSA key.\n*/\nconst computeJwkThumbprint = async (jwk) => {\n\tif (jwk.kty !== \"RSA\") throw new Error(`Unsupported key type for JWK Thumbprint: ${jwk.kty}. Only RSA is supported.`);\n\tconst canonical = JSON.stringify({\n\t\te: jwk.e,\n\t\tkty: jwk.kty,\n\t\tn: jwk.n\n\t});\n\treturn base64url(await crypto.subtle.digest(\"SHA-256\", new TextEncoder().encode(canonical)));\n};\nasync function openDpopDB() {\n\treturn new Promise((resolve, reject) => {\n\t\tconst request = indexedDB.open(DPOP_DB_NAME, DPOP_DB_VERSION);\n\t\trequest.onupgradeneeded = () => {\n\t\t\tconst db = request.result;\n\t\t\tif (!db.objectStoreNames.contains(DPOP_STORE_NAME)) db.createObjectStore(DPOP_STORE_NAME);\n\t\t};\n\t\trequest.onsuccess = () => resolve(request.result);\n\t\trequest.onerror = () => reject(request.error ?? /* @__PURE__ */ new Error(\"Failed to open IndexedDB\"));\n\t});\n}\nasync function loadKeyPairFromDB() {\n\ttry {\n\t\tconst db = await openDpopDB();\n\t\treturn await new Promise((resolve, reject) => {\n\t\t\tconst tx = db.transaction(DPOP_STORE_NAME, \"readonly\");\n\t\t\tconst req = tx.objectStore(DPOP_STORE_NAME).get(DPOP_KEY_ID);\n\t\t\treq.onsuccess = () => resolve(req.result ?? null);\n\t\t\treq.onerror = () => reject(req.error ?? /* @__PURE__ */ new Error(\"Failed to load key pair from IndexedDB\"));\n\t\t\ttx.oncomplete = () => db.close();\n\t\t});\n\t} catch (error) {\n\t\tlogger$27.warn(\"[DPoP] Failed to load key pair from IndexedDB:\", error);\n\t\treturn null;\n\t}\n}\nasync function saveKeyPairToDB(keyPair) {\n\ttry {\n\t\tconst db = await openDpopDB();\n\t\tawait new Promise((resolve, reject) => {\n\t\t\tconst tx = db.transaction(DPOP_STORE_NAME, \"readwrite\");\n\t\t\ttx.objectStore(DPOP_STORE_NAME).put(keyPair, DPOP_KEY_ID);\n\t\t\ttx.oncomplete = () => {\n\t\t\t\tdb.close();\n\t\t\t\tresolve();\n\t\t\t};\n\t\t\ttx.onerror = () => {\n\t\t\t\tdb.close();\n\t\t\t\treject(tx.error ?? /* @__PURE__ */ new Error(\"Failed to save key pair to IndexedDB\"));\n\t\t\t};\n\t\t});\n\t} catch (error) {\n\t\tlogger$27.warn(\"[DPoP] Failed to save key pair to IndexedDB:\", error);\n\t}\n}\nasync function deleteKeyPairFromDB() {\n\ttry {\n\t\tconst db = await openDpopDB();\n\t\tawait new Promise((resolve, reject) => {\n\t\t\tconst tx = db.transaction(DPOP_STORE_NAME, \"readwrite\");\n\t\t\ttx.objectStore(DPOP_STORE_NAME).delete(DPOP_KEY_ID);\n\t\t\ttx.oncomplete = () => {\n\t\t\t\tdb.close();\n\t\t\t\tresolve();\n\t\t\t};\n\t\t\ttx.onerror = () => {\n\t\t\t\tdb.close();\n\t\t\t\treject(tx.error ?? /* @__PURE__ */ new Error(\"Failed to delete key pair from IndexedDB\"));\n\t\t\t};\n\t\t});\n\t} catch (error) {\n\t\tlogger$27.warn(\"[DPoP] Failed to delete key pair from IndexedDB:\", error);\n\t}\n}\n/**\n* Controls DPoP (Demonstrating Proof-of-Possession) cryptographic operations.\n*\n* Generates an RSA-2048 key pair where the private key is non-extractable,\n* computes the JWK Thumbprint (RFC 7638) as the fingerprint, and creates\n* signed DPoP proof JWTs for both HTTP API requests and WebSocket RPC calls.\n*\n* The key pair is persisted in IndexedDB so the same fingerprint survives\n* page reloads. This keeps the Client Bound SAT and stored authorization_state\n* valid across reloads without needing to re-authenticate.\n*\n* @example\n* ```typescript\n* const crypto = new CryptoController();\n* await crypto.init();\n*\n* // Get fingerprint for SAT issuance\n* const fingerprint = crypto.fingerprint;\n*\n* // Create proof for HTTP endpoint\n* const httpProof = await crypto.createHttpProof({\n* method: 'POST',\n* uri: '/api/fabric/subscriber/devices/token'\n* });\n*\n* // Create proof for RPC call\n* const rpcProof = await crypto.createRpcProof({\n* method: 'signalwire.connect'\n* });\n* ```\n*/\nvar CryptoController = class {\n\tconstructor() {\n\t\tthis._keyPair = null;\n\t\tthis._publicJwk = null;\n\t\tthis._fingerprint = null;\n\t\tthis._initialized = false;\n\t}\n\t/**\n\t* Initializes the DPoP key pair. Loads an existing key from IndexedDB\n\t* if available, otherwise generates a new one and persists it.\n\t*\n\t* The private key is non-extractable — IndexedDB stores the CryptoKey\n\t* handle via the structured clone algorithm without exposing key material.\n\t*\n\t* @returns The JWK Thumbprint (fingerprint) for the key.\n\t*/\n\tasync init() {\n\t\tif (this._initialized) return this.fingerprint;\n\t\tconst stored = await loadKeyPairFromDB();\n\t\tif (stored) try {\n\t\t\tconst testData = new TextEncoder().encode(\"dpop-key-check\");\n\t\t\tawait crypto.subtle.sign(\"RSASSA-PKCS1-v1_5\", stored.privateKey, testData);\n\t\t\tthis._keyPair = stored;\n\t\t\tthis._publicJwk = await crypto.subtle.exportKey(\"jwk\", stored.publicKey);\n\t\t\tthis._fingerprint = await computeJwkThumbprint(this._publicJwk);\n\t\t\tthis._initialized = true;\n\t\t\tlogger$27.debug(\"[DPoP] Key pair restored from IndexedDB, fingerprint:\", this._fingerprint);\n\t\t\treturn this._fingerprint;\n\t\t} catch (error) {\n\t\t\tlogger$27.warn(\"[DPoP] Stored key pair unusable, generating new one:\", error);\n\t\t\tawait deleteKeyPairFromDB();\n\t\t}\n\t\tlogger$27.debug(\"[DPoP] Generating RSA key pair\");\n\t\tthis._keyPair = await crypto.subtle.generateKey({\n\t\t\tname: \"RSASSA-PKCS1-v1_5\",\n\t\t\tmodulusLength: 2048,\n\t\t\tpublicExponent: new Uint8Array([\n\t\t\t\t1,\n\t\t\t\t0,\n\t\t\t\t1\n\t\t\t]),\n\t\t\thash: \"SHA-256\"\n\t\t}, false, [\"sign\", \"verify\"]);\n\t\tthis._publicJwk = await crypto.subtle.exportKey(\"jwk\", this._keyPair.publicKey);\n\t\tthis._fingerprint = await computeJwkThumbprint(this._publicJwk);\n\t\tthis._initialized = true;\n\t\tawait saveKeyPairToDB(this._keyPair);\n\t\tlogger$27.debug(\"[DPoP] Key pair generated and persisted, fingerprint:\", this._fingerprint);\n\t\treturn this._fingerprint;\n\t}\n\t/**\n\t* The JWK Thumbprint (RFC 7638) of the public key.\n\t* Used as the `fingerprint` parameter when requesting scoped SATs.\n\t*\n\t* @throws {DPoPInitError} If {@link init} has not been called.\n\t*/\n\tget fingerprint() {\n\t\tif (!this._fingerprint) throw new DPoPInitError(\"CryptoController not initialized. Call init() first.\");\n\t\treturn this._fingerprint;\n\t}\n\t/**\n\t* Whether the controller has been initialized with a key pair.\n\t*/\n\tget initialized() {\n\t\treturn this._initialized;\n\t}\n\t/**\n\t* Creates a DPoP proof JWT for an HTTP API request.\n\t*\n\t* Used for Prime API endpoints like `/api/fabric/subscriber/devices/token`\n\t* and `/api/fabric/subscriber/devices/refresh`.\n\t*\n\t* @param params - HTTP method and URI for the proof.\n\t* @returns Signed DPoP proof JWT string.\n\t*/\n\tasync createHttpProof(params) {\n\t\tconst payload = {\n\t\t\tjti: crypto.randomUUID(),\n\t\t\thtm: params.method,\n\t\t\thtu: params.uri,\n\t\t\tiat: Math.floor(Date.now() / 1e3)\n\t\t};\n\t\tif (params.accessToken) payload.ath = base64url(await crypto.subtle.digest(\"SHA-256\", new TextEncoder().encode(params.accessToken)));\n\t\treturn this.signProof(payload);\n\t}\n\t/**\n\t* Creates a DPoP proof JWT for a WebSocket RPC call.\n\t*\n\t* Used for switchblade RPC methods like `signalwire.connect` and\n\t* `signalwire.reauthenticate`.\n\t*\n\t* @param params - RPC method name for the proof.\n\t* @returns Signed DPoP proof JWT string.\n\t*/\n\tasync createRpcProof(params) {\n\t\tconst payload = {\n\t\t\tjti: crypto.randomUUID(),\n\t\t\trpc: \"request\",\n\t\t\tmth: params.method,\n\t\t\tiat: Math.floor(Date.now() / 1e3)\n\t\t};\n\t\treturn this.signProof(payload);\n\t}\n\t/**\n\t* Releases the key pair references and removes the persisted key from IndexedDB.\n\t* After calling destroy, the controller must be re-initialized to be used again.\n\t*/\n\tdestroy() {\n\t\tthis._keyPair = null;\n\t\tthis._publicJwk = null;\n\t\tthis._fingerprint = null;\n\t\tthis._initialized = false;\n\t\tdeleteKeyPairFromDB();\n\t\tlogger$27.debug(\"[DPoP] Controller destroyed\");\n\t}\n\tget publicJwk() {\n\t\tif (!this._publicJwk) throw new DPoPInitError(\"CryptoController not initialized. Call init() first.\");\n\t\treturn this._publicJwk;\n\t}\n\tget privateKey() {\n\t\tif (!this._keyPair) throw new DPoPInitError(\"CryptoController not initialized. Call init() first.\");\n\t\treturn this._keyPair.privateKey;\n\t}\n\tasync signProof(payload) {\n\t\tconst header = {\n\t\t\ttyp: \"dpop+jwt\",\n\t\t\talg: \"RS256\",\n\t\t\tjwk: this.publicJwk\n\t\t};\n\t\tconst signingInput = `${base64urlEncode(JSON.stringify(header))}.${base64urlEncode(JSON.stringify(payload))}`;\n\t\treturn `${signingInput}.${base64url(await crypto.subtle.sign(\"RSASSA-PKCS1-v1_5\", this.privateKey, new TextEncoder().encode(signingInput)))}`;\n\t}\n};\n\n//#endregion\n//#region src/controllers/NetworkMonitor.ts\nconst logger$26 = getLogger();\n/**\n* Safely check whether we are running in a browser environment\n* with `window` and the relevant event targets.\n*/\nfunction hasBrowserNetworkEvents() {\n\treturn typeof window !== \"undefined\" && typeof window.addEventListener === \"function\";\n}\n/**\n* Attempt to read the current effective type from the Network Information API.\n* Returns `undefined` when the API is not available.\n*/\nfunction getNetworkType() {\n\tif (typeof navigator === \"undefined\") return;\n\tconst { connection } = navigator;\n\treturn connection?.effectiveType ?? void 0;\n}\n/**\n* Returns the `NetworkInformation` object when available, or `undefined`.\n*/\nfunction getNetworkConnection() {\n\tif (typeof navigator === \"undefined\") return;\n\treturn navigator.connection ?? void 0;\n}\n/**\n* Monitors browser-level network connectivity events (online / offline)\n* and, where supported, the Network Information API for connection type changes.\n*\n* Safe for non-browser environments — all event listeners are guarded by\n* feature checks and no-op gracefully when `window` is unavailable.\n*/\nvar NetworkMonitor = class extends Destroyable {\n\tconstructor() {\n\t\tsuper();\n\t\tthis._isOnline$ = this.createBehaviorSubject(typeof navigator !== \"undefined\" ? navigator.onLine : true);\n\t\tthis._networkChange$ = this.createSubject();\n\t\tthis._onOnline = this.handleOnline.bind(this);\n\t\tthis._onOffline = this.handleOffline.bind(this);\n\t\tthis._onConnectionChange = this.handleConnectionChange.bind(this);\n\t\tthis._listenersAttached = false;\n\t\tthis.attachListeners();\n\t}\n\tget isOnline$() {\n\t\treturn this._isOnline$.asObservable().pipe(takeUntil(this._destroyed$));\n\t}\n\tget isOnline() {\n\t\treturn this._isOnline$.value;\n\t}\n\tget networkChange$() {\n\t\treturn this._networkChange$.asObservable().pipe(takeUntil(this._destroyed$));\n\t}\n\tdestroy() {\n\t\tthis.removeListeners();\n\t\tsuper.destroy();\n\t}\n\tattachListeners() {\n\t\tif (!hasBrowserNetworkEvents()) {\n\t\t\tlogger$26.debug(\"NetworkMonitor: no browser environment detected, skipping event listeners\");\n\t\t\treturn;\n\t\t}\n\t\twindow.addEventListener(\"online\", this._onOnline);\n\t\twindow.addEventListener(\"offline\", this._onOffline);\n\t\tconst connection = getNetworkConnection();\n\t\tif (connection) connection.addEventListener(\"change\", this._onConnectionChange);\n\t\tthis._listenersAttached = true;\n\t\tlogger$26.debug(\"NetworkMonitor: event listeners attached\");\n\t}\n\tremoveListeners() {\n\t\tif (!this._listenersAttached) return;\n\t\tif (hasBrowserNetworkEvents()) {\n\t\t\twindow.removeEventListener(\"online\", this._onOnline);\n\t\t\twindow.removeEventListener(\"offline\", this._onOffline);\n\t\t\tconst connection = getNetworkConnection();\n\t\t\tif (connection) connection.removeEventListener(\"change\", this._onConnectionChange);\n\t\t}\n\t\tthis._listenersAttached = false;\n\t\tlogger$26.debug(\"NetworkMonitor: event listeners removed\");\n\t}\n\thandleOnline() {\n\t\tlogger$26.info(\"NetworkMonitor: browser went online\");\n\t\tthis._isOnline$.next(true);\n\t\tthis._networkChange$.next({\n\t\t\ttype: \"online\",\n\t\t\ttimestamp: Date.now(),\n\t\t\tnetworkType: getNetworkType()\n\t\t});\n\t}\n\thandleOffline() {\n\t\tlogger$26.info(\"NetworkMonitor: browser went offline\");\n\t\tthis._isOnline$.next(false);\n\t\tthis._networkChange$.next({\n\t\t\ttype: \"offline\",\n\t\t\ttimestamp: Date.now()\n\t\t});\n\t}\n\thandleConnectionChange() {\n\t\tconst networkType = getNetworkType();\n\t\tlogger$26.info(`NetworkMonitor: connection changed — effectiveType=${networkType ?? \"unknown\"}`);\n\t\tthis._networkChange$.next({\n\t\t\ttype: \"connection_change\",\n\t\t\ttimestamp: Date.now(),\n\t\t\tnetworkType\n\t\t});\n\t}\n};\n\n//#endregion\n//#region src/controllers/PlatformCapabilities.ts\n/**\n* Detects the list of supported codecs for a given media kind\n* by calling RTCRtpSender.getCapabilities when available.\n*\n* @param kind - 'audio' or 'video'\n* @returns Array of unique codec names (e.g., ['VP8', 'VP9', 'H264'])\n*/\nfunction detectCodecs(kind) {\n\tif (typeof RTCRtpSender === \"undefined\" || typeof RTCRtpSender.getCapabilities !== \"function\") return [];\n\tconst capabilities = RTCRtpSender.getCapabilities(kind);\n\tif (!capabilities) return [];\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst codecs = [];\n\tfor (const codec of capabilities.codecs) {\n\t\tconst name = extractCodecName(codec.mimeType);\n\t\tif (name && !seen.has(name)) {\n\t\t\tseen.add(name);\n\t\t\tcodecs.push(name);\n\t\t}\n\t}\n\treturn codecs;\n}\n/**\n* Extracts the codec name from a MIME type string (e.g., 'video/VP8' -> 'VP8').\n*/\nfunction extractCodecName(mimeType) {\n\tconst slashIndex = mimeType.indexOf(\"/\");\n\treturn slashIndex >= 0 ? mimeType.substring(slashIndex + 1) : mimeType;\n}\n/**\n* Checks whether insertable streams / encoded transforms are available.\n*\n* Tests for both the newer RTCRtpScriptTransform (Safari 15.4+, Chrome 128+)\n* and the older MediaStreamTrackProcessor (Chrome 94+).\n*/\nfunction detectInsertableStreams() {\n\tif (typeof globalThis === \"undefined\") return false;\n\treturn \"RTCRtpScriptTransform\" in globalThis || \"MediaStreamTrackProcessor\" in globalThis;\n}\n/**\n* Checks whether setSinkId (audio output device selection) is available.\n*/\nfunction detectAudioOutputSelection() {\n\tif (typeof HTMLMediaElement === \"undefined\") return false;\n\treturn \"setSinkId\" in HTMLMediaElement.prototype;\n}\n/**\n* Checks whether simulcast is supported by checking for RTCRtpSender.setParameters\n* and the presence of encoding parameters support.\n*/\nfunction detectSimulcast() {\n\tif (typeof RTCRtpSender === \"undefined\") return false;\n\treturn typeof RTCRtpSender.prototype.setParameters === \"function\";\n}\n/**\n* Detects platform WebRTC capabilities at call time.\n*\n* If a {@link WebRTCApiProvider} is supplied, its mediaDevices are used\n* for `getUserMedia` / `getDisplayMedia` detection. Otherwise the\n* standard `navigator.mediaDevices` is probed.\n*\n* @param provider - Optional custom WebRTC API provider\n* @returns A frozen {@link PlatformCapabilities} object\n*/\nfunction detectPlatformCapabilities(provider) {\n\tconst mediaDevices = provider?.mediaDevices ?? getNavigatorMediaDevices();\n\tconst hasGetUserMedia = typeof mediaDevices?.getUserMedia === \"function\";\n\tconst hasGetDisplayMedia = typeof mediaDevices?.getDisplayMedia === \"function\";\n\tconst capabilities = {\n\t\twebrtc: provider ? typeof provider.RTCPeerConnection === \"function\" : typeof globalThis !== \"undefined\" && \"RTCPeerConnection\" in globalThis,\n\t\tgetUserMedia: hasGetUserMedia,\n\t\tgetDisplayMedia: hasGetDisplayMedia,\n\t\tscreenShare: hasGetDisplayMedia,\n\t\tscreenShareAudio: detectScreenShareAudio(),\n\t\tsimulcast: detectSimulcast(),\n\t\tinsertableStreams: detectInsertableStreams(),\n\t\taudioOutputSelection: detectAudioOutputSelection(),\n\t\tvideoCodecs: detectCodecs(\"video\"),\n\t\taudioCodecs: detectCodecs(\"audio\")\n\t};\n\treturn Object.freeze(capabilities);\n}\n/**\n* Detects whether screen share with system audio is supported.\n*\n* This is primarily a Chromium feature. We detect it by checking\n* whether getDisplayMedia exists and the browser is Chromium-based.\n*/\nfunction detectScreenShareAudio() {\n\tif (typeof navigator === \"undefined\") return false;\n\tconst mediaDevices = getNavigatorMediaDevices();\n\tif (!mediaDevices || typeof mediaDevices.getDisplayMedia !== \"function\") return false;\n\treturn navigator.userAgent.includes(\"Chrome/\");\n}\n/**\n* Safely retrieves navigator.mediaDevices, returning null if unavailable.\n*/\nfunction getNavigatorMediaDevices() {\n\tif (typeof navigator !== \"undefined\") return navigator.mediaDevices;\n\treturn null;\n}\n\n//#endregion\n//#region src/controllers/PreflightRunner.ts\nconst logger$25 = getLogger();\nconst DEFAULT_MEDIA_TEST_DURATION_S = 10;\nconst ICE_GATHERING_TIMEOUT_MS = 1e4;\nconst SIGNALING_RTT_TIMEOUT_MS = 5e3;\nconst DEVICE_TEST_TIMEOUT_MS = 5e3;\n/**\n* Runs a multi-phase connectivity test:\n* 1. Signaling -- verify WebSocket is connected, measure RTT\n* 2. Devices -- verify getUserMedia works with selected devices\n* 3. ICE/TURN -- gather ICE candidates and check reachability\n* 4. Media/bandwidth -- dial, collect getStats(), compute bandwidth\n*\n* Extends Destroyable so all resources are cleaned up when done.\n*/\nvar PreflightRunner = class extends Destroyable {\n\tconstructor(deviceController, iceServers, isConnected, transportRttMs, dialFn, options = {}) {\n\t\tsuper();\n\t\tthis.deviceController = deviceController;\n\t\tthis.iceServers = iceServers;\n\t\tthis.isConnected = isConnected;\n\t\tthis.transportRttMs = transportRttMs;\n\t\tthis.dialFn = dialFn;\n\t\tthis._options = {\n\t\t\tduration: options.duration ?? DEFAULT_MEDIA_TEST_DURATION_S,\n\t\t\tskipMediaTest: options.skipMediaTest ?? false,\n\t\t\taudioDevice: options.audioDevice,\n\t\t\tvideoDevice: options.videoDevice\n\t\t};\n\t}\n\t/**\n\t* Execute the full preflight test and return the result.\n\t* Always cleans up resources on completion or error.\n\t*/\n\tasync run(destination) {\n\t\tconst warnings = [];\n\t\ttry {\n\t\t\tconst signaling = this.testSignaling();\n\t\t\tif (!signaling.reachable) warnings.push(\"WebSocket not connected\");\n\t\t\tconst devices = await this.testDevices();\n\t\t\tif (!devices.audioInput.working) warnings.push(\"Audio input device not working\");\n\t\t\tif (!devices.videoInput.working) warnings.push(\"Video input device not working\");\n\t\t\tconst connectivity = await this.testIceConnectivity();\n\t\t\tif (connectivity.type === \"failed\") warnings.push(\"No ICE connectivity (neither STUN nor TURN reachable)\");\n\t\t\telse if (connectivity.type === \"relay\") warnings.push(\"Only TURN relay connectivity available (no direct path)\");\n\t\t\tif (!connectivity.turnReachable) warnings.push(\"TURN servers not reachable\");\n\t\t\tlet bandwidth = null;\n\t\t\tif (!this._options.skipMediaTest) try {\n\t\t\t\tbandwidth = await this.testMediaBandwidth(destination);\n\t\t\t} catch (error) {\n\t\t\t\tlogger$25.warn(\"[PreflightRunner] Media bandwidth test failed:\", error);\n\t\t\t\twarnings.push(\"Media bandwidth test failed\");\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: signaling.reachable && connectivity.type !== \"failed\" && devices.audioInput.working,\n\t\t\t\tsignaling,\n\t\t\t\tconnectivity,\n\t\t\t\tbandwidth,\n\t\t\t\tdevices,\n\t\t\t\twarnings\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tlogger$25.error(\"[PreflightRunner] Preflight test failed:\", error);\n\t\t\tthrow new PreflightError(\"preflight\", error instanceof Error ? error : new Error(String(error)));\n\t\t} finally {\n\t\t\tthis.destroy();\n\t\t}\n\t}\n\ttestSignaling() {\n\t\treturn {\n\t\t\treachable: this.isConnected,\n\t\t\trttMs: this.transportRttMs\n\t\t};\n\t}\n\tasync testDevices() {\n\t\tconst audioDevice = this._options.audioDevice ?? this.deviceController.selectedAudioInputDevice;\n\t\tconst videoDevice = this._options.videoDevice ?? this.deviceController.selectedVideoInputDevice;\n\t\tconst audioOutputDevice = this.deviceController.selectedAudioOutputDevice;\n\t\tlet audioWorking = false;\n\t\tlet videoWorking = false;\n\t\tlet audioStream;\n\t\ttry {\n\t\t\tconst constraints = {};\n\t\t\tif (audioDevice) constraints.audio = { deviceId: { exact: audioDevice.deviceId } };\n\t\t\telse constraints.audio = true;\n\t\t\tif (videoDevice) constraints.video = { deviceId: { exact: videoDevice.deviceId } };\n\t\t\telse constraints.video = true;\n\t\t\taudioStream = await Promise.race([navigator.mediaDevices.getUserMedia(constraints), new Promise((_, reject) => setTimeout(() => reject(/* @__PURE__ */ new Error(\"getUserMedia timeout\")), DEVICE_TEST_TIMEOUT_MS))]);\n\t\t\tfor (const track of audioStream.getTracks()) {\n\t\t\t\tif (track.kind === \"audio\" && track.readyState === \"live\") audioWorking = true;\n\t\t\t\tif (track.kind === \"video\" && track.readyState === \"live\") videoWorking = true;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlogger$25.warn(\"[PreflightRunner] Device test failed:\", error);\n\t\t} finally {\n\t\t\tif (audioStream) audioStream.getTracks().forEach((t) => t.stop());\n\t\t}\n\t\treturn {\n\t\t\taudioInput: {\n\t\t\t\tworking: audioWorking,\n\t\t\t\tdevice: audioDevice\n\t\t\t},\n\t\t\tvideoInput: {\n\t\t\t\tworking: videoWorking,\n\t\t\t\tdevice: videoDevice\n\t\t\t},\n\t\t\taudioOutput: {\n\t\t\t\tavailable: !!audioOutputDevice,\n\t\t\t\tdevice: audioOutputDevice\n\t\t\t}\n\t\t};\n\t}\n\tasync testIceConnectivity() {\n\t\tlet pc;\n\t\ttry {\n\t\t\tpc = new RTCPeerConnection({ iceServers: this.iceServers });\n\t\t\tconst peerConnection = pc;\n\t\t\tconst candidateTypes = /* @__PURE__ */ new Set();\n\t\t\tconst startTime = Date.now();\n\t\t\tconst gatheringComplete = new Promise((resolve) => {\n\t\t\t\tconst timer$1 = setTimeout(resolve, ICE_GATHERING_TIMEOUT_MS);\n\t\t\t\tpeerConnection.onicecandidate = (event) => {\n\t\t\t\t\tif (event.candidate) {\n\t\t\t\t\t\tconst candidateStr = event.candidate.candidate;\n\t\t\t\t\t\tif (candidateStr.includes(\"typ host\")) candidateTypes.add(\"host\");\n\t\t\t\t\t\tif (candidateStr.includes(\"typ srflx\")) candidateTypes.add(\"srflx\");\n\t\t\t\t\t\tif (candidateStr.includes(\"typ relay\")) candidateTypes.add(\"relay\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclearTimeout(timer$1);\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t});\n\t\t\tpc.createDataChannel(\"preflight-test\");\n\t\t\tconst offer = await pc.createOffer();\n\t\t\tawait pc.setLocalDescription(offer);\n\t\t\tawait gatheringComplete;\n\t\t\tconst rttMs = Date.now() - startTime;\n\t\t\tconst stunReachable = candidateTypes.has(\"srflx\");\n\t\t\tconst turnReachable = candidateTypes.has(\"relay\");\n\t\t\tconst hasHost = candidateTypes.has(\"host\");\n\t\t\tlet type = \"failed\";\n\t\t\tif (hasHost || stunReachable) type = \"direct\";\n\t\t\telse if (turnReachable) type = \"relay\";\n\t\t\treturn {\n\t\t\t\ttype,\n\t\t\t\tturnReachable,\n\t\t\t\tstunReachable,\n\t\t\t\trttMs\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tlogger$25.warn(\"[PreflightRunner] ICE connectivity test failed:\", error);\n\t\t\treturn {\n\t\t\t\ttype: \"failed\",\n\t\t\t\tturnReachable: false,\n\t\t\t\tstunReachable: false,\n\t\t\t\trttMs: 0\n\t\t\t};\n\t\t} finally {\n\t\t\tif (pc) pc.close();\n\t\t}\n\t}\n\tasync testMediaBandwidth(destination) {\n\t\tlet call;\n\t\ttry {\n\t\t\tcall = await this.dialFn(destination, {\n\t\t\t\taudio: true,\n\t\t\t\tvideo: false\n\t\t\t});\n\t\t\tawait firstValueFrom(call.status$.pipe(filter((s) => s === \"connected\"), take(1), timeout(SIGNALING_RTT_TIMEOUT_MS)));\n\t\t\tconst durationMs = this._options.duration * 1e3;\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, durationMs));\n\t\t\tconst metrics = call.networkMetrics;\n\t\t\tlet uploadKbps = 0;\n\t\t\tlet downloadKbps = 0;\n\t\t\tif (metrics.length > 0) {\n\t\t\t\tconst latest = metrics[metrics.length - 1];\n\t\t\t\tif (latest.availableOutgoingBitrate !== void 0) uploadKbps = Math.round(latest.availableOutgoingBitrate / 1e3);\n\t\t\t\tconst totalPackets = latest.audio.packetsReceived + latest.video.packetsReceived;\n\t\t\t\tif (durationMs > 0 && totalPackets > 0) downloadKbps = uploadKbps;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tuploadKbps,\n\t\t\t\tdownloadKbps\n\t\t\t};\n\t\t} finally {\n\t\t\tif (call) try {\n\t\t\t\tawait call.hangup();\n\t\t\t} catch {}\n\t\t}\n\t}\n\tdestroy() {\n\t\tsuper.destroy();\n\t}\n};\n\n//#endregion\n//#region src/controllers/VisibilityController.ts\nconst logger$24 = getLogger();\n/**\n* Checks whether the document visibility API is available.\n*/\nfunction isVisibilityApiAvailable() {\n\ttry {\n\t\treturn typeof document !== \"undefined\" && typeof document.addEventListener === \"function\" && typeof document.visibilityState === \"string\";\n\t} catch {\n\t\treturn false;\n\t}\n}\n/**\n* Returns the current document visibility state, defaulting to 'visible'\n* in non-browser environments.\n*/\nfunction getCurrentVisibility() {\n\ttry {\n\t\tif (typeof document !== \"undefined\" && typeof document.visibilityState === \"string\") return document.visibilityState === \"visible\" ? \"visible\" : \"hidden\";\n\t} catch {}\n\treturn \"visible\";\n}\n/**\n* VisibilityController tracks browser tab visibility state and exposes\n* it as RxJS observables. Safe for use in non-browser environments\n* where the document API is not available.\n*\n* Extends Destroyable for lifecycle management and automatic cleanup.\n*/\nvar VisibilityController = class extends Destroyable {\n\tconstructor() {\n\t\tsuper();\n\t\tthis._visibility$ = this.createBehaviorSubject(getCurrentVisibility());\n\t\tthis._visibilityChange$ = this.createSubject();\n\t\tthis._hasVisibilityApi = isVisibilityApiAvailable();\n\t\tthis._boundHandler = this._handleVisibilityChange.bind(this);\n\t\tif (this._hasVisibilityApi) {\n\t\t\tdocument.addEventListener(\"visibilitychange\", this._boundHandler);\n\t\t\tlogger$24.debug(\"VisibilityController: listening for visibilitychange events\");\n\t\t} else logger$24.debug(\"VisibilityController: document visibility API not available, defaulting to visible\");\n\t}\n\t/**\n\t* Observable of the current visibility state.\n\t* Emits 'visible' or 'hidden'. Always starts with the current state.\n\t*/\n\tget visibility$() {\n\t\treturn this._visibility$.pipe(takeUntil(this._destroyed$));\n\t}\n\t/**\n\t* The current visibility state value.\n\t*/\n\tget visibility() {\n\t\treturn this._visibility$.value;\n\t}\n\t/**\n\t* Observable that emits transition events when visibility changes.\n\t* Each event includes the previous state, new state, and timestamp.\n\t*/\n\tget visibilityChange$() {\n\t\treturn this._visibilityChange$.pipe(takeUntil(this._destroyed$));\n\t}\n\tdestroy() {\n\t\tif (this._hasVisibilityApi) {\n\t\t\tdocument.removeEventListener(\"visibilitychange\", this._boundHandler);\n\t\t\tlogger$24.debug(\"VisibilityController: removed visibilitychange listener\");\n\t\t}\n\t\tsuper.destroy();\n\t}\n\t/**\n\t* Handle the browser's visibilitychange event.\n\t*/\n\t_handleVisibilityChange() {\n\t\tconst newState = getCurrentVisibility();\n\t\tconst previousState = this._visibility$.value;\n\t\tif (newState === previousState) return;\n\t\tthis._visibility$.next(newState);\n\t\tconst changeEvent = {\n\t\t\tfrom: previousState,\n\t\t\tto: newState,\n\t\t\ttimestamp: Date.now()\n\t\t};\n\t\tthis._visibilityChange$.next(changeEvent);\n\t\tlogger$24.debug(\"VisibilityController: visibility changed\", {\n\t\t\tfrom: previousState,\n\t\t\tto: newState\n\t\t});\n\t}\n};\n\n//#endregion\n//#region src/behaviors/Fetchable.ts\nvar Fetchable = class extends Destroyable {\n\tconstructor(fromPath, http) {\n\t\tsuper();\n\t\tthis.fromPath = fromPath;\n\t\tthis.http = http;\n\t\tthis.fetched$ = defer(() => from(this.fetch())).pipe(shareReplay(1), takeUntil(this.destroyed$));\n\t}\n\tasync fetch() {\n\t\tconst response = await this.http.request({\n\t\t\turl: this.fromPath,\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: \"application/json\" }\n\t\t});\n\t\tif (response.ok && response.body) {\n\t\t\tconst data = JSON.parse(response.body);\n\t\t\tthis.populateInstance(data);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n};\n\n//#endregion\n//#region src/core/entities/Subscriber.ts\n/**\n* Authenticated subscriber profile.\n*\n* Fetched automatically when a {@link SignalWire} connects.\n* Contains identity, contact, and organization details.\n*/\nvar Subscriber = class extends Fetchable {\n\tconstructor(http) {\n\t\tsuper(\"/api/fabric/subscriber/info\", http);\n\t}\n\tpopulateInstance(data) {\n\t\tthis.id = data.id;\n\t\tthis.email = data.email;\n\t\tthis.firstName = data.first_name;\n\t\tthis.lastName = data.last_name;\n\t\tthis.displayName = data.display_name;\n\t\tthis.jobTitle = data.job_title;\n\t\tthis.timeZone = data.time_zone;\n\t\tthis.country = data.country;\n\t\tthis.region = data.region;\n\t\tthis.companyName = data.company_name;\n\t\tthis.pushNotificationKey = data.push_notification_key;\n\t\tthis.appSettings = data.app_settings ? {\n\t\t\tdisplayName: data.app_settings.display_name,\n\t\t\tscopes: data.app_settings.scopes\n\t\t} : void 0;\n\t\tthis.addresses = data.fabric_addresses;\n\t\tthis.satClaims = data.sat_claims;\n\t}\n};\n\n//#endregion\n//#region src/core/RPCMessages/helpers.ts\nconst buildRPCRequest = (params) => {\n\treturn {\n\t\tjsonrpc: \"2.0\",\n\t\tid: params.id ?? v4(),\n\t\t...params\n\t};\n};\nconst makeRPCResponse = (params) => {\n\treturn {\n\t\tjsonrpc: \"2.0\",\n\t\t...params\n\t};\n};\n\n//#endregion\n//#region src/core/RPCMessages/RPCConnect.ts\nconst DEFAULT_CONNECT_VERSION = {\n\tmajor: 4,\n\tminor: 0,\n\trevision: 0\n};\nconst RPCConnect = (params) => {\n\treturn buildRPCRequest({\n\t\tmethod: \"signalwire.connect\",\n\t\tparams: {\n\t\t\tversion: DEFAULT_CONNECT_VERSION,\n\t\t\tevent_acks: true,\n\t\t\t...params\n\t\t}\n\t});\n};\n\n//#endregion\n//#region src/core/RPCMessages/RPCReauthenticate.ts\nconst RPCReauthenticate = (params) => {\n\tconst { dpop_token, ...authFields } = params;\n\treturn buildRPCRequest({\n\t\tmethod: \"signalwire.reauthenticate\",\n\t\tparams: {\n\t\t\tauthentication: authFields,\n\t\t\t...dpop_token ? { dpop_token } : {}\n\t\t}\n\t});\n};\n\n//#endregion\n//#region src/core/RPCMessages/RPCPing.ts\nconst RPCPingResponse = (id, timestamp) => {\n\treturn makeRPCResponse({\n\t\tid,\n\t\tresult: { timestamp: timestamp ?? Date.now() / 1e3 }\n\t});\n};\n\n//#endregion\n//#region src/core/RPCMessages/RPCExecute.ts\nconst RPCExecute = ({ method, params }) => {\n\treturn buildRPCRequest({\n\t\tmethod,\n\t\tparams\n\t});\n};\n\n//#endregion\n//#region src/core/RPCMessages/VertoMessages.ts\nconst SDK_TO_VERTO_FIELD_MAP = {\n\tid: \"callID\",\n\tdestinationNumber: \"destination_number\",\n\tremoteCallerName: \"remote_caller_id_name\",\n\tremoteCallerNumber: \"remote_caller_id_number\",\n\tcallerName: \"caller_id_name\",\n\tcallerNumber: \"caller_id_number\",\n\tfromCallAddressId: \"from_fabric_address_id\"\n};\nconst EXCLUDED_DIALOG_PARAMS = new Set([\n\t\"remoteSdp\",\n\t\"localStream\",\n\t\"remoteStream\"\n]);\n/**\n* Translate SDK fields into verto variables.\n* Returns a new object — the input is never mutated.\n*/\n/** @internal Exported for testing only. */\nconst filterVertoParams = (params) => {\n\tif (!Object.prototype.hasOwnProperty.call(params, \"dialogParams\")) return params;\n\tconst sourceDialogParams = params.dialogParams;\n\tconst filteredDialogParams = Object.entries(sourceDialogParams).reduce((acc, [key, value]) => {\n\t\tif (EXCLUDED_DIALOG_PARAMS.has(key)) return acc;\n\t\tconst mappedKey = SDK_TO_VERTO_FIELD_MAP[key] ?? key;\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[mappedKey]: value\n\t\t};\n\t}, {});\n\treturn {\n\t\t...params,\n\t\tdialogParams: filteredDialogParams\n\t};\n};\nconst buildVertoRPCMessage = (method) => {\n\treturn (params = {}) => {\n\t\treturn buildRPCRequest({\n\t\t\tmethod,\n\t\t\tparams: filterVertoParams(params)\n\t\t});\n\t};\n};\nconst WebrtcVerto = (params) => {\n\treturn buildRPCRequest({\n\t\tmethod: \"webrtc.verto\",\n\t\tparams\n\t});\n};\nconst VertoInvite = buildVertoRPCMessage(\"verto.invite\");\nconst VertoBye = buildVertoRPCMessage(\"verto.bye\");\nconst VertoAttach = buildVertoRPCMessage(\"verto.attach\");\nconst VertoModify = buildVertoRPCMessage(\"verto.modify\");\nconst VertoInfo = buildVertoRPCMessage(\"verto.info\");\nconst VertoAnswer = buildVertoRPCMessage(\"verto.answer\");\nconst VertoSubscribe = buildVertoRPCMessage(\"verto.subscribe\");\nconst VertoPong = buildVertoRPCMessage(\"verto.pong\");\nconst VertoByeCauseCodes = {\n\tNORMAL_CLEARING: \"16\",\n\tUSER_BUSY: \"17\",\n\tMEDIA_TIMEOUT: \"804\"\n};\n\n//#endregion\n//#region src/core/RPCMessages/RPCEventAck.ts\nconst RPCEventAckResponse = (id) => makeRPCResponse({\n\tid,\n\tresult: {}\n});\n\n//#endregion\n//#region src/managers/AttachManager.ts\nconst logger$23 = getLogger();\nvar AttachManager = class {\n\tconstructor(storage, deviceController, reconnectCallsTimeout, attachKey) {\n\t\tthis.storage = storage;\n\t\tthis.deviceController = deviceController;\n\t\tthis.reconnectCallsTimeout = reconnectCallsTimeout;\n\t\tthis.attachKey = attachKey;\n\t\tthis.writeQueue = Promise.resolve();\n\t}\n\tasync detachAll() {\n\t\tawait this.mutate((attached) => {\n\t\t\treturn {};\n\t\t});\n\t}\n\tsetSession(session) {\n\t\tthis.session = session;\n\t}\n\tasync readAttached() {\n\t\ttry {\n\t\t\treturn await this.storage.getItem(this.attachKey) ?? {};\n\t\t} catch (error) {\n\t\t\tlogger$23.warn(\"[AttachManager] Failed to retrieve attached calls from storage\", error);\n\t\t\treturn {};\n\t\t}\n\t}\n\tasync writeAttached(attached) {\n\t\ttry {\n\t\t\tawait this.storage.setItem(this.attachKey, attached);\n\t\t} catch (error) {\n\t\t\tlogger$23.warn(\"[AttachManager] Failed to write attached calls to storage\", error);\n\t\t}\n\t}\n\t/**\n\t* Serialize a read-modify-write operation against the attached-calls\n\t* storage. The mutator receives the current state and returns the new\n\t* state. Concurrent calls queue behind the in-flight one so writes never\n\t* interleave.\n\t*/\n\tasync mutate(mutator) {\n\t\tconst next = this.writeQueue.then(async () => {\n\t\t\tconst updated = await mutator(await this.readAttached());\n\t\t\tawait this.writeAttached(updated);\n\t\t});\n\t\tthis.writeQueue = next.catch(() => void 0);\n\t\treturn next;\n\t}\n\tasync attach(call) {\n\t\tif (!call.to) {\n\t\t\tlogger$23.warn(\"[AttachManager] Skip attach for calls with no destination\");\n\t\t\treturn;\n\t\t}\n\t\tconst destination = call.to;\n\t\tconst attachment = {\n\t\t\tnodeId: call.nodeId,\n\t\t\tdestination,\n\t\t\tmediaDirections: call.mediaDirections,\n\t\t\taudioInputDevice: call.mediaDirections.audio !== \"inactive\" ? this.deviceController.selectedAudioInputDevice : null,\n\t\t\tvideoInputDevice: call.mediaDirections.video !== \"inactive\" ? this.deviceController.selectedVideoInputDevice : null,\n\t\t\tattachedAt: Date.now()\n\t\t};\n\t\tawait this.mutate((attached) => ({\n\t\t\t...attached,\n\t\t\t[call.id]: attachment\n\t\t}));\n\t}\n\tasync detach(call) {\n\t\tawait this.mutate((attached) => {\n\t\t\tconst { [call.id]: _, ...remaining } = attached;\n\t\t\treturn remaining;\n\t\t});\n\t}\n\tasync flush() {\n\t\tawait this.mutate(() => ({}));\n\t}\n\t/**\n\t* Reattach to previously active calls by sending verto.invite with\n\t* reattaching: true.\n\t*\n\t* NOTE: This currently fails with INVALID_CALL_REFERENCE because the\n\t* server's jsock UUID check rejects the new connection's UUID. A\n\t* server-side fix is needed: when reattaching: true is explicitly set\n\t* in dialogParams, FreeSWITCH's attempt_reattach() should update the\n\t* call's jsock reference to the new connection's UUID instead of\n\t* rejecting. Once that fix is deployed, this will work for both\n\t* page reloads and WebSocket reconnects.\n\t*\n\t* Failed reattach attempts are handled gracefully — the stale call\n\t* reference is cleaned up from storage.\n\t*/\n\tasync reattachCalls() {\n\t\tconst attached = await this.readAttached();\n\t\tawait this.detachExpired();\n\t\tfor (const [callId, attachment] of Object.entries(attached)) {\n\t\t\tconst { destination } = attachment;\n\t\t\tconst options = this.buildCallOptions(attachment);\n\t\t\tlet succeeded = false;\n\t\t\tfor (let attempt = 1; attempt <= 3; attempt++) try {\n\t\t\t\tawait this.session.createOutboundCall(destination, {\n\t\t\t\t\tcallId,\n\t\t\t\t\t...options\n\t\t\t\t});\n\t\t\t\tlogger$23.info(`[AttachManager] Reattached call ${callId} (attempt ${attempt})`);\n\t\t\t\tsucceeded = true;\n\t\t\t\tbreak;\n\t\t\t} catch (error) {\n\t\t\t\tlogger$23.warn(`[AttachManager] Reattach attempt ${attempt}/3 failed for call ${callId}:`, error);\n\t\t\t\tif (attempt < 3) await new Promise((r) => setTimeout(r, (attempt + 1) * 1e3));\n\t\t\t}\n\t\t\tif (!succeeded) {\n\t\t\t\tlogger$23.warn(`[AttachManager] Reattach failed after 3 attempts for call ${callId}, removing reference`);\n\t\t\t\tawait this.detach({\n\t\t\t\t\tid: callId,\n\t\t\t\t\tmediaDirections: attachment.mediaDirections\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* Build CallOptions from stored attachment data for a call being reattached.\n\t* Also used by the session-level verto.attach handler.\n\t*/\n\tbuildCallOptions(attachment) {\n\t\tconst { audio: audioDirection, video: videoDirection } = attachment.mediaDirections;\n\t\tconst { audioInputDevice, videoInputDevice, nodeId } = attachment;\n\t\tconst receiveAudio = audioDirection.includes(\"recv\");\n\t\tconst receiveVideo = videoDirection.includes(\"recv\");\n\t\tconst sendAudio = audioDirection.includes(\"send\");\n\t\tconst sendVideo = videoDirection.includes(\"send\");\n\t\treturn {\n\t\t\tnodeId,\n\t\t\treceiveAudio,\n\t\t\treceiveVideo,\n\t\t\tinputAudioDeviceConstraints: sendAudio ? {\n\t\t\t\taudio: true,\n\t\t\t\t...this.deviceController.deviceInfoToConstraints(audioInputDevice)\n\t\t\t} : void 0,\n\t\t\tinputVideoDeviceConstraints: sendVideo ? {\n\t\t\t\tvideo: true,\n\t\t\t\t...this.deviceController.deviceInfoToConstraints(videoInputDevice)\n\t\t\t} : void 0,\n\t\t\treattach: true\n\t\t};\n\t}\n\t/**\n\t* Look up stored attachment data for a call id and return CallOptions\n\t* suitable for rehydrating a reattached call. Returns undefined when no\n\t* matching entry exists in storage.\n\t*\n\t* Used by the session-level verto.attach handler when the server pushes\n\t* an attach event for a call the client doesn't have an object for yet\n\t* (e.g. after a reload).\n\t*/\n\tasync consumePendingAttachment(callId) {\n\t\tconst attached = await this.readAttached();\n\t\tif (!Object.hasOwn(attached, callId)) return;\n\t\treturn this.buildCallOptions(attached[callId]);\n\t}\n\tasync detachExpired() {\n\t\tconst now = Date.now();\n\t\tconst timeout$1 = this.reconnectCallsTimeout;\n\t\tawait this.mutate((attached) => {\n\t\t\tconst remaining = { ...attached };\n\t\t\tlet changed = false;\n\t\t\tfor (const [callId, attachment] of Object.entries(attached)) if (now - attachment.attachedAt > timeout$1) {\n\t\t\t\tdelete remaining[callId];\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t\treturn changed ? remaining : attached;\n\t\t});\n\t}\n};\n\n//#endregion\n//#region src/core/capabilities/types.ts\n/**\n* Default on/off state with no permissions\n*/\nconst DEFAULT_ON_OFF = {\n\ton: false,\n\toff: false\n};\n/**\n* Default member capabilities with no permissions\n*/\nconst DEFAULT_MEMBER_CAPABILITIES = {\n\tmuteAudio: DEFAULT_ON_OFF,\n\tmuteVideo: DEFAULT_ON_OFF,\n\tdeaf: DEFAULT_ON_OFF,\n\traisehand: DEFAULT_ON_OFF,\n\tmicrophoneVolume: false,\n\tmicrophoneSensitivity: false,\n\tspeakerVolume: false,\n\tposition: false,\n\tmeta: false,\n\tremove: false,\n\taudioFlags: false\n};\n/**\n* Default call capabilities with no permissions\n*/\nconst DEFAULT_CALL_CAPABILITIES = {\n\tself: DEFAULT_MEMBER_CAPABILITIES,\n\tmember: DEFAULT_MEMBER_CAPABILITIES,\n\tend: false,\n\tsetLayout: false,\n\tsendDigit: false,\n\tvmutedHide: DEFAULT_ON_OFF,\n\tlock: DEFAULT_ON_OFF,\n\tdevice: false,\n\tscreenshare: false\n};\n\n//#endregion\n//#region src/core/capabilities/computeCapabilities.ts\n/**\n* Computes an on/off capability state from filtered flags\n*\n* Logic:\n* - `on` is true if any flag does NOT end with `.off`\n* - `off` is true if any flag does NOT end with `.on`\n*\n* This means parent permissions (without .on/.off suffix) grant both on and off\n*/\nfunction computeOnOffCapability(filteredFlags) {\n\tif (filteredFlags.length === 0) return DEFAULT_ON_OFF;\n\treturn {\n\t\ton: filteredFlags.some((flag) => !flag.endsWith(\".off\")),\n\t\toff: filteredFlags.some((flag) => !flag.endsWith(\".on\"))\n\t};\n}\n/**\n* Filters flags for a specific member capability with on/off support\n*\n* Matches:\n* - The member type itself (e.g., \"self\" grants all self capabilities)\n* - The parent capability (e.g., \"self.mute\" grants all mute capabilities)\n* - The specific capability and its on/off variants (e.g., \"self.mute.audio*\")\n*/\nfunction filterMemberOnOffFlags(flags, memberType, parent, capability) {\n\treturn flags.filter((flag) => flag === memberType || flag === `${memberType}.${parent}` || flag.startsWith(`${memberType}.${parent}.${capability}`));\n}\n/**\n* Checks if a boolean capability is granted\n*\n* Matches:\n* - The member type itself (e.g., \"self\" grants all self capabilities)\n* - The parent capability if provided (e.g., \"self.microphone\" grants volume and sensitivity)\n* - The specific capability (e.g., \"self.microphone.volume.set\")\n*/\nfunction hasBooleanCapability(flags, memberType, parent, capability) {\n\treturn flags.some((flag) => flag === memberType || parent !== null && flag === `${memberType}.${parent}` || flag.startsWith(`${memberType}.${parent ? `${parent}.` : \"\"}${capability}`));\n}\n/**\n* Computes member-level capabilities (self or member) from raw flags\n*/\nfunction computeMemberCapabilities(flags, memberType) {\n\tif (flags.filter((flag) => flag.startsWith(memberType) || flag === memberType).length === 0) return DEFAULT_MEMBER_CAPABILITIES;\n\treturn {\n\t\tmuteAudio: computeOnOffCapability(filterMemberOnOffFlags(flags, memberType, \"mute\", \"audio\")),\n\t\tmuteVideo: computeOnOffCapability(filterMemberOnOffFlags(flags, memberType, \"mute\", \"video\")),\n\t\tdeaf: computeOnOffCapability(flags.filter((flag) => flag === memberType || flag.startsWith(`${memberType}.deaf`))),\n\t\traisehand: computeOnOffCapability(flags.filter((flag) => flag === memberType || flag.startsWith(`${memberType}.raisehand`))),\n\t\tmicrophoneVolume: hasBooleanCapability(flags, memberType, \"microphone\", \"volume\"),\n\t\tmicrophoneSensitivity: hasBooleanCapability(flags, memberType, \"microphone\", \"sensitivity\"),\n\t\tspeakerVolume: hasBooleanCapability(flags, memberType, \"speaker\", \"volume\"),\n\t\tposition: hasBooleanCapability(flags, memberType, null, \"position\"),\n\t\tmeta: hasBooleanCapability(flags, memberType, null, \"meta\"),\n\t\tremove: hasBooleanCapability(flags, memberType, null, \"remove\"),\n\t\taudioFlags: hasBooleanCapability(flags, memberType, null, \"audioflags\")\n\t};\n}\n/**\n* Computes all call capabilities from raw capability strings\n*\n* This is a pure function that transforms the raw capability strings\n* from the `call.joined` event into a structured capabilities state.\n*\n* @param capabilities - Raw capability strings from the server\n* @returns Computed capabilities state\n*/\nfunction computeCapabilities(capabilities) {\n\tif (capabilities.length === 0) return DEFAULT_CALL_CAPABILITIES;\n\treturn {\n\t\tself: computeMemberCapabilities(capabilities, \"self\"),\n\t\tmember: computeMemberCapabilities(capabilities, \"member\"),\n\t\tend: capabilities.some((cap) => cap === \"end\"),\n\t\tsetLayout: capabilities.some((cap) => cap.startsWith(\"layout\")),\n\t\tsendDigit: capabilities.some((cap) => cap.startsWith(\"digit\")),\n\t\tvmutedHide: computeOnOffCapability(capabilities.filter((flag) => flag.startsWith(\"vmuted\"))),\n\t\tlock: computeOnOffCapability(capabilities.filter((flag) => flag.startsWith(\"lock\"))),\n\t\tdevice: capabilities.some((cap) => cap === \"device\"),\n\t\tscreenshare: capabilities.some((cap) => cap === \"screenshare\")\n\t};\n}\n\n//#endregion\n//#region src/core/capabilities/SelfCapabilities.ts\n/**\n* SelfCapabilities manages the capability state for the self participant.\n*\n* Capabilities are received from the server via `call.joined` events and determine\n* what actions the current participant is allowed to perform.\n*\n* Each capability is exposed as both:\n* - An observable (e.g., `end$`) for reactive state management\n* - A synchronous getter (e.g., `end`) for immediate access\n*\n* Member-level capabilities are accessed via the grouped `self` / `member` accessors:\n* - `capabilities.self.muteAudio` (sync)\n* - `capabilities.self$` (observable)\n*\n* When a new `call.joined` event is received, the capabilities state is\n* completely replaced (not merged).\n*/\nvar SelfCapabilities = class extends Destroyable {\n\tconstructor(..._args) {\n\t\tsuper(..._args);\n\t\tthis._state$ = this.createBehaviorSubject(DEFAULT_CALL_CAPABILITIES);\n\t}\n\t/**\n\t* Updates the capabilities state from raw capability strings.\n\t* This completely replaces the current state.\n\t*\n\t* @param capabilities - Raw capability strings from the server\n\t* @internal\n\t*/\n\tupdateFromRaw(capabilities) {\n\t\tconst newState = computeCapabilities(capabilities);\n\t\tthis._state$.next(newState);\n\t}\n\t/** Observable for self member capabilities */\n\tget self$() {\n\t\treturn this.cachedObservable(\"self$\", () => this._state$.pipe(map((state) => state.self), distinctUntilChanged()));\n\t}\n\t/** Current self member capabilities */\n\tget self() {\n\t\treturn this._state$.value.self;\n\t}\n\t/** Observable for other member capabilities */\n\tget member$() {\n\t\treturn this.cachedObservable(\"member$\", () => this._state$.pipe(map((state) => state.member), distinctUntilChanged()));\n\t}\n\t/** Current other member capabilities */\n\tget member() {\n\t\treturn this._state$.value.member;\n\t}\n\t/** Observable for end call capability */\n\tget end$() {\n\t\treturn this.cachedObservable(\"end$\", () => this._state$.pipe(map((state) => state.end), distinctUntilChanged()));\n\t}\n\t/** Current end call capability */\n\tget end() {\n\t\treturn this._state$.value.end;\n\t}\n\t/** Observable for set layout capability */\n\tget setLayout$() {\n\t\treturn this.cachedObservable(\"setLayout$\", () => this._state$.pipe(map((state) => state.setLayout), distinctUntilChanged()));\n\t}\n\t/** Current set layout capability */\n\tget setLayout() {\n\t\treturn this._state$.value.setLayout;\n\t}\n\t/** Observable for send digit capability */\n\tget sendDigit$() {\n\t\treturn this.cachedObservable(\"sendDigit$\", () => this._state$.pipe(map((state) => state.sendDigit), distinctUntilChanged()));\n\t}\n\t/** Current send digit capability */\n\tget sendDigit() {\n\t\treturn this._state$.value.sendDigit;\n\t}\n\t/** Observable for vmuted hide capability */\n\tget vmutedHide$() {\n\t\treturn this.cachedObservable(\"vmutedHide$\", () => this._state$.pipe(map((state) => state.vmutedHide), distinctUntilChanged()));\n\t}\n\t/** Current vmuted hide capability */\n\tget vmutedHide() {\n\t\treturn this._state$.value.vmutedHide;\n\t}\n\t/** Observable for lock capability */\n\tget lock$() {\n\t\treturn this.cachedObservable(\"lock$\", () => this._state$.pipe(map((state) => state.lock), distinctUntilChanged()));\n\t}\n\t/** Current lock capability */\n\tget lock() {\n\t\treturn this._state$.value.lock;\n\t}\n\t/** Observable for device capability */\n\tget device$() {\n\t\treturn this.cachedObservable(\"device$\", () => this._state$.pipe(map((state) => state.device), distinctUntilChanged()));\n\t}\n\t/** Current device capability */\n\tget device() {\n\t\treturn this._state$.value.device;\n\t}\n\t/** Observable for screenshare capability */\n\tget screenshare$() {\n\t\treturn this.cachedObservable(\"screenshare$\", () => this._state$.pipe(map((state) => state.screenshare), distinctUntilChanged()));\n\t}\n\t/** Current screenshare capability */\n\tget screenshare() {\n\t\treturn this._state$.value.screenshare;\n\t}\n\t/** Observable for the full capabilities state */\n\tget state$() {\n\t\treturn this._state$.asObservable();\n\t}\n\t/** Current full capabilities state */\n\tget state() {\n\t\treturn this._state$.value;\n\t}\n};\n\n//#endregion\n//#region src/core/RPCMessages/utils.ts\nfunction toggleDeafMethod(is) {\n\treturn is ? \"call.undeaf\" : \"call.deaf\";\n}\nfunction toggleHandraiseMethod(is) {\n\treturn is ? \"call.lowerhand\" : \"call.raisehand\";\n}\n\n//#endregion\n//#region src/core/entities/Participant.ts\nconst logger$22 = getLogger();\nconst initialState = {};\n/**\n* Represents a participant in a call.\n*\n* Provides observable state (audio/video mute, hand raise, volume, etc.)\n* and control methods for the participant. See {@link SelfParticipant} for\n* the local participant with additional device control.\n*/\nvar Participant = class extends Destroyable {\n\tconstructor(id, executeMethod, deviceController) {\n\t\tsuper();\n\t\tthis.executeMethod = executeMethod;\n\t\tthis.deviceController = deviceController;\n\t\tthis._state$ = this.createBehaviorSubject(initialState);\n\t\tthis.id = id;\n\t}\n\t/** @internal */\n\tupnext(data) {\n\t\tthis._state$.next({\n\t\t\t...this._state$.value,\n\t\t\t...data\n\t\t});\n\t}\n\t/** Observable of the participant's display name. */\n\tget name$() {\n\t\treturn this.cachedObservable(\"name$\", () => this._state$.pipe(map$1((state) => state.name), distinctUntilChanged$1()));\n\t}\n\t/** Observable of the participant type (e.g. `'member'`, `'screen'`). */\n\tget type$() {\n\t\treturn this.cachedObservable(\"type$\", () => this._state$.pipe(map$1((state) => state.type), distinctUntilChanged$1()));\n\t}\n\t/** Observable indicating whether the participant has raised their hand. */\n\tget handraised$() {\n\t\treturn this.cachedObservable(\"handraised$\", () => this._state$.pipe(map$1((state) => state.handraised), distinctUntilChanged$1()));\n\t}\n\t/** Observable indicating whether the participant is visible in the layout. */\n\tget visible$() {\n\t\treturn this.cachedObservable(\"visible$\", () => this._state$.pipe(map$1((state) => state.visible), distinctUntilChanged$1()));\n\t}\n\t/** Observable indicating whether the participant's audio is muted. */\n\tget audioMuted$() {\n\t\treturn this.cachedObservable(\"audioMuted$\", () => this._state$.pipe(map$1((state) => state.audio_muted), distinctUntilChanged$1()));\n\t}\n\t/** Observable indicating whether the participant's video is muted. */\n\tget videoMuted$() {\n\t\treturn this.cachedObservable(\"videoMuted$\", () => this._state$.pipe(map$1((state) => state.video_muted), distinctUntilChanged$1()));\n\t}\n\t/** Observable indicating whether the participant is deafened. */\n\tget deaf$() {\n\t\treturn this.cachedObservable(\"deaf$\", () => this._state$.pipe(map$1((state) => state.deaf), distinctUntilChanged$1()));\n\t}\n\t/**\n\t* Observable of the participant's **server-side** microphone input volume\n\t* as reported by the mix engine. This is gain applied on the bridged audio\n\t* leg (FreeSWITCH channel read volume), NOT the local browser mic. For a\n\t* local PC mic control, see {@link Call.setLocalMicrophoneGain}.\n\t*\n\t* @see {@link setAudioInputVolume}\n\t*/\n\tget inputVolume$() {\n\t\treturn this.cachedObservable(\"inputVolume$\", () => this._state$.pipe(map$1((state) => state.input_volume), distinctUntilChanged$1()));\n\t}\n\t/**\n\t* Observable of the participant's **server-side** speaker output volume as\n\t* reported by the mix engine (FreeSWITCH channel write volume). NOT the\n\t* local HTML `<audio>` element volume — set that on your own element.\n\t*\n\t* @see {@link setAudioOutputVolume}\n\t*/\n\tget outputVolume$() {\n\t\treturn this.cachedObservable(\"outputVolume$\", () => this._state$.pipe(map$1((state) => state.output_volume), distinctUntilChanged$1()));\n\t}\n\t/**\n\t* Observable of the **conference-only** microphone energy/gate sensitivity\n\t* level for this member. Routes through the conferencing mix engine and has\n\t* no effect on 1:1 WebRTC calls. Populated from `member.updated` events for\n\t* conference members.\n\t*\n\t* @see {@link setAudioInputSensitivity}\n\t*/\n\tget inputSensitivity$() {\n\t\treturn this.cachedObservable(\"inputSensitivity$\", () => this._state$.pipe(map$1((state) => state.input_sensitivity), distinctUntilChanged$1()));\n\t}\n\t/** Observable indicating whether echo cancellation is enabled. */\n\tget echoCancellation$() {\n\t\treturn this.cachedObservable(\"echoCancellation$\", () => this._state$.pipe(map$1((state) => state.echo_cancellation), distinctUntilChanged$1()));\n\t}\n\t/** Observable indicating whether auto-gain control is enabled. */\n\tget autoGain$() {\n\t\treturn this.cachedObservable(\"autoGain$\", () => this._state$.pipe(map$1((state) => state.auto_gain), distinctUntilChanged$1()));\n\t}\n\t/** Observable indicating whether noise suppression is enabled. */\n\tget noiseSuppression$() {\n\t\treturn this.cachedObservable(\"noiseSuppression$\", () => this._state$.pipe(map$1((state) => state.noise_suppression), distinctUntilChanged$1()));\n\t}\n\t/** Observable indicating whether low-bitrate mode is active. */\n\tget lowbitrate$() {\n\t\treturn this.cachedObservable(\"lowbitrate$\", () => this._state$.pipe(map$1((state) => state.lowbitrate), distinctUntilChanged$1()));\n\t}\n\t/** Observable indicating whether noise reduction is active. */\n\tget denoise$() {\n\t\treturn this.cachedObservable(\"denoise$\", () => this._state$.pipe(map$1((state) => state.denoise), distinctUntilChanged$1()));\n\t}\n\t/** Observable of custom metadata for this participant. */\n\tget meta$() {\n\t\treturn this.cachedObservable(\"meta$\", () => this._state$.pipe(map$1((state) => state.meta), distinctUntilChanged$1()));\n\t}\n\t/** Observable of the participant's subscriber ID. */\n\tget subscriberId$() {\n\t\treturn this.cachedObservable(\"subscriberId$\", () => this._state$.pipe(map$1((state) => state.subscriber_id), distinctUntilChanged$1()));\n\t}\n\t/** Observable of the participant's address ID. */\n\tget addressId$() {\n\t\treturn this.cachedObservable(\"addressId$\", () => this._state$.pipe(map$1((state) => state.address_id), distinctUntilChanged$1()));\n\t}\n\t/** Observable of the server node ID for this participant. */\n\tget nodeId$() {\n\t\treturn this.cachedObservable(\"nodeId$\", () => this._state$.pipe(map$1((state) => state.node_id), distinctUntilChanged$1()));\n\t}\n\t/** Observable indicating whether the participant is currently speaking. */\n\tget isTalking$() {\n\t\treturn this.cachedObservable(\"isTalking$\", () => this._state$.pipe(map$1((state) => state.talking), distinctUntilChanged$1()));\n\t}\n\t/** Whether the participant is currently speaking. */\n\tget isTalking() {\n\t\treturn this._state$.value.talking ?? false;\n\t}\n\t/** Observable of the participant's layout position. */\n\tget position$() {\n\t\treturn this.cachedObservable(\"position$\", () => this._state$.pipe(map$1((state) => state.position), distinctUntilChanged$1()));\n\t}\n\t/** Current layout position. */\n\tget position() {\n\t\treturn this._state$.value.position;\n\t}\n\t/** Whether the participant is an audience member (view-only). */\n\tget isAudience() {\n\t\treturn this._state$.value.isAudience ?? false;\n\t}\n\t/** Display name of this participant. */\n\tget name() {\n\t\treturn this._state$.value.name;\n\t}\n\t/** Participant type (e.g. `'member'`, `'screen'`). */\n\tget type() {\n\t\treturn this._state$.value.type;\n\t}\n\t/** Whether the participant has raised their hand. */\n\tget handraised() {\n\t\treturn this._state$.value.handraised ?? false;\n\t}\n\t/** Whether the participant is visible in the layout. */\n\tget visible() {\n\t\treturn this._state$.value.visible ?? false;\n\t}\n\t/** Whether the participant's audio is muted. */\n\tget audioMuted() {\n\t\treturn this._state$.value.audio_muted ?? false;\n\t}\n\t/** Whether the participant's video is muted. */\n\tget videoMuted() {\n\t\treturn this._state$.value.video_muted ?? false;\n\t}\n\t/** Whether the participant is deafened (incoming audio muted). */\n\tget deaf() {\n\t\treturn this._state$.value.deaf ?? false;\n\t}\n\t/**\n\t* Current **server-side** microphone input volume as reported by the mix\n\t* engine, or `undefined` if not set. Not the local PC mic — see\n\t* {@link Call.setLocalMicrophoneGain} for browser-side control.\n\t*/\n\tget inputVolume() {\n\t\treturn this._state$.value.input_volume;\n\t}\n\t/**\n\t* Current **server-side** speaker output volume from the mix engine, or\n\t* `undefined` if not set. Not the local `<audio>` element volume.\n\t*/\n\tget outputVolume() {\n\t\treturn this._state$.value.output_volume;\n\t}\n\t/**\n\t* Current **conference-only** microphone sensitivity/gate level, or\n\t* `undefined` if not set. Applies only to conference members.\n\t*/\n\tget inputSensitivity() {\n\t\treturn this._state$.value.input_sensitivity;\n\t}\n\t/** Whether echo cancellation is enabled. */\n\tget echoCancellation() {\n\t\treturn this._state$.value.echo_cancellation ?? false;\n\t}\n\t/** Whether automatic gain control is enabled. */\n\tget autoGain() {\n\t\treturn this._state$.value.auto_gain ?? false;\n\t}\n\t/** Whether noise suppression is enabled. */\n\tget noiseSuppression() {\n\t\treturn this._state$.value.noise_suppression ?? false;\n\t}\n\t/** Whether low-bitrate mode is active. */\n\tget lowbitrate() {\n\t\treturn this._state$.value.lowbitrate ?? false;\n\t}\n\t/** Whether noise reduction (denoise) is active. */\n\tget denoise() {\n\t\treturn this._state$.value.denoise ?? false;\n\t}\n\t/** Custom metadata for this participant, or `undefined` if not set. */\n\tget meta() {\n\t\treturn this._state$.value.meta;\n\t}\n\t/** Subscriber ID of this participant, or `undefined` if not available. */\n\tget subscriberId() {\n\t\treturn this._state$.value.subscriber_id;\n\t}\n\t/** Address ID of this participant, or `undefined` if not available. */\n\tget addressId() {\n\t\treturn this._state$.value.address_id;\n\t}\n\t/** Server node ID for this participant, or `undefined` if not available. */\n\tget nodeId() {\n\t\treturn this._state$.value.node_id;\n\t}\n\t/** @internal */\n\tget value() {\n\t\treturn this._state$.value;\n\t}\n\t/** Toggles the deafened state (mutes/unmutes incoming audio). */\n\tasync toggleDeaf() {\n\t\tconst method = toggleDeafMethod(this.deaf);\n\t\tawait this.executeMethod(this.id, method, {});\n\t}\n\t/** Toggles the hand-raised state. */\n\tasync toggleHandraise() {\n\t\tawait this.executeMethod(this.id, toggleHandraiseMethod(this.handraised), {});\n\t}\n\t/** Mutes the participant's audio. */\n\tasync mute() {\n\t\tawait this.executeMethod(this.id, \"call.mute\", { channels: [\"audio\"] });\n\t}\n\t/** Unmutes the participant's audio. */\n\tasync unmute() {\n\t\tawait this.executeMethod(this.id, \"call.unmute\", { channels: [\"audio\"] });\n\t}\n\t/** Toggles the participant's audio mute state. */\n\tasync toggleMute() {\n\t\treturn this.audioMuted ? this.unmute() : this.mute();\n\t}\n\t/** Mutes the participant's video. */\n\tasync muteVideo() {\n\t\tawait this.executeMethod(this.id, \"call.mute\", { channels: [\"video\"] });\n\t}\n\t/** Unmutes the participant's video. */\n\tasync unmuteVideo() {\n\t\tawait this.executeMethod(this.id, \"call.unmute\", { channels: [\"video\"] });\n\t}\n\t/** Toggles the participant's video mute state. */\n\tasync toggleMuteVideo() {\n\t\treturn this.videoMuted ? this.unmuteVideo() : this.muteVideo();\n\t}\n\t/** Toggles echo cancellation on the audio input. */\n\tasync toggleEchoCancellation() {\n\t\tawait this.executeMethod(this.id, \"call.audioflags.set\", {\n\t\t\techo_cancellation: !this.echoCancellation,\n\t\t\tauto_gain: this.autoGain,\n\t\t\tnoise_suppression: this.noiseSuppression\n\t\t});\n\t}\n\t/** Toggles automatic gain control on the audio input. */\n\tasync toggleAudioInputAutoGain() {\n\t\tawait this.executeMethod(this.id, \"call.audioflags.set\", {\n\t\t\techo_cancellation: this.echoCancellation,\n\t\t\tauto_gain: !this.autoGain,\n\t\t\tnoise_suppression: this.noiseSuppression\n\t\t});\n\t}\n\t/** Toggles noise suppression on the audio input. */\n\tasync toggleNoiseSuppression() {\n\t\tawait this.executeMethod(this.id, \"call.audioflags.set\", {\n\t\t\techo_cancellation: this.echoCancellation,\n\t\t\tauto_gain: this.autoGain,\n\t\t\tnoise_suppression: !this.noiseSuppression\n\t\t});\n\t}\n\tasync toggleLowbitrate() {\n\t\tthrow new UnimplementedError();\n\t}\n\t/**\n\t* Adjusts the **conference-only** microphone energy gate / sensitivity level\n\t* for this member. Routes through the conferencing mix engine\n\t* (`signalwire.conferencing member.set_input_sensitivity`) and has no effect\n\t* on 1:1 WebRTC calls — for those, use browser audio constraints via\n\t* {@link Call.setNoiseSuppression} / {@link Call.setAutoGainControl}.\n\t*\n\t* This is **not** a local PC mic gain control; it only changes how the\n\t* server-side mixer decides to open the mic gate on this participant.\n\t*\n\t* @param value - Sensitivity level as understood by the conference engine\n\t* (integer, larger values are more sensitive).\n\t*/\n\tasync setAudioInputSensitivity(value) {\n\t\tawait this.executeMethod(this.id, \"call.microphone.sensitivity.set\", { sensitivity: value });\n\t}\n\t/**\n\t* Sets the **server-side** microphone volume on this participant's bridged\n\t* call leg. Applies a multiplier to the audio flowing through the mix\n\t* engine (FreeSWITCH channel read volume) — changes what other participants\n\t* hear, not what the local browser captures.\n\t*\n\t* For local PC mic gain, use {@link Call.setLocalMicrophoneGain} instead.\n\t*\n\t* @param value - Volume level (0-100).\n\t*/\n\tasync setAudioInputVolume(value) {\n\t\tawait this.executeMethod(this.id, \"call.microphone.volume.set\", { volume: value });\n\t}\n\t/**\n\t* Sets the **server-side** speaker volume on this participant's bridged call\n\t* leg (FreeSWITCH channel write volume) — what this participant hears from\n\t* the mix before it reaches their client.\n\t*\n\t* For local playback volume (the `<audio>` element the consumer attaches\n\t* `remoteStream` to), set `audioElement.volume` directly in the consumer's\n\t* code.\n\t*\n\t* @param value - Volume level (0-100).\n\t*/\n\tasync setAudioOutputVolume(value) {\n\t\tawait this.executeMethod(this.id, \"call.speaker.volume.set\", { volume: value });\n\t}\n\t/**\n\t* Sets the participant's position in the video layout.\n\t* @param value - The {@link VideoPosition} to assign (e.g. `'auto'`, `'reserved-0'`).\n\t*/\n\tasync setPosition(value) {\n\t\tawait this.executeMethod(this.id, \"call.member.position.set\", { position: value });\n\t}\n\t/** Removes this participant from the call. */\n\tasync remove() {\n\t\tconst state = this._state$.value;\n\t\tconst target = {\n\t\t\tmember_id: this.id,\n\t\t\tcall_id: state.call_id ?? \"\",\n\t\t\tnode_id: state.node_id ?? \"\"\n\t\t};\n\t\tawait this.executeMethod(target, \"call.member.remove\", {});\n\t}\n\t/** Ends the call for this participant. */\n\tasync end() {\n\t\tawait this.executeMethod(this.id, \"call.end\", {});\n\t}\n\t/**\n\t* Replaces custom metadata for this participant.\n\t* @param _meta - Metadata object to set.\n\t* @throws {UnimplementedError} Not yet implemented.\n\t*/\n\tasync setMeta(_meta) {\n\t\tthrow new UnimplementedError();\n\t}\n\t/**\n\t* Merges values into custom metadata (unlike {@link setMeta} which replaces).\n\t* @param _meta - Metadata to merge.\n\t* @throws {UnimplementedError} Not yet implemented.\n\t*/\n\tasync updateMeta(_meta) {\n\t\tthrow new UnimplementedError();\n\t}\n\t/** Destroys the participant, releasing all subscriptions and references. */\n\tdestroy() {\n\t\tthis.executeMethod = void 0;\n\t\tsuper.destroy();\n\t}\n};\n/**\n* The local participant in a call, with additional device and media control.\n*\n* Extends {@link Participant} with screen sharing, device selection,\n* and local media stream management.\n*/\nvar SelfParticipant = class extends Participant {\n\t/** @internal */\n\tconstructor(id, executeMethod, vertoManager, deviceController) {\n\t\tsuper(id, executeMethod, deviceController);\n\t\tthis.vertoManager = vertoManager;\n\t\tthis._studioAudio$ = this.createBehaviorSubject(false);\n\t\tthis.capabilities = new SelfCapabilities();\n\t}\n\tdestroy() {\n\t\tthis.capabilities.destroy();\n\t\tsuper.destroy();\n\t}\n\t/** Observable indicating whether studio audio (raw/unprocessed audio) mode is enabled. */\n\tget studioAudio$() {\n\t\treturn this._studioAudio$.asObservable();\n\t}\n\t/** Whether studio audio (raw/unprocessed audio) mode is currently enabled. */\n\tget studioAudio() {\n\t\treturn this._studioAudio$.value;\n\t}\n\t/**\n\t* Enables studio audio mode by disabling all audio processing.\n\t* Sets echoCancellation, noiseSuppression, and autoGainControl to false.\n\t*/\n\tasync enableStudioAudio() {\n\t\tif (this._studioAudio$.value) return;\n\t\tthis._studioAudio$.next(true);\n\t\tawait this.executeMethod(this.id, \"call.audioflags.set\", {\n\t\t\techo_cancellation: false,\n\t\t\tauto_gain: false,\n\t\t\tnoise_suppression: false\n\t\t});\n\t}\n\t/**\n\t* Disables studio audio mode by restoring all audio processing to enabled.\n\t* Sets echoCancellation, noiseSuppression, and autoGainControl to true.\n\t*/\n\tasync disableStudioAudio() {\n\t\tif (!this._studioAudio$.value) return;\n\t\tthis._studioAudio$.next(false);\n\t\tawait this.executeMethod(this.id, \"call.audioflags.set\", {\n\t\t\techo_cancellation: true,\n\t\t\tauto_gain: true,\n\t\t\tnoise_suppression: true\n\t\t});\n\t}\n\t/** Starts sharing the local screen. */\n\tasync startScreenShare() {\n\t\ttry {\n\t\t\tawait this.vertoManager.addScreenMedia();\n\t\t} catch (error) {\n\t\t\tlogger$22.error(\"[Participant.startScreenShare] Screen share error:\", error);\n\t\t}\n\t}\n\t/** Observable of the current screen share status. */\n\tget screenShareStatus$() {\n\t\treturn this.vertoManager.screenShareStatus$;\n\t}\n\t/** Current screen share status. */\n\tget screenShareStatus() {\n\t\treturn this.vertoManager.screenShareStatus;\n\t}\n\t/** Stops the current screen share. */\n\tasync stopScreenShare() {\n\t\treturn this.vertoManager.removeScreenMedia();\n\t}\n\t/** Adds an additional media input device to the call. */\n\tasync addAdditionalDevice(options) {\n\t\ttry {\n\t\t\tawait this.vertoManager.addInputDevice(options);\n\t\t} catch (error) {\n\t\t\tlogger$22.error(\"[Participant.startScreenShare] Screen share error:\", error);\n\t\t}\n\t}\n\t/** Removes an additional media input device by ID. */\n\tasync removeAdditionalDevice(id) {\n\t\treturn this.vertoManager.removeInputDevices(id);\n\t}\n\t/** Adds or replaces the primary audio input device with optional constraints or stream. */\n\tasync addAudioInputDevice({ constraints, stream } = {}) {\n\t\tconst audio = constraints ?? stream ? void 0 : true;\n\t\treturn this.vertoManager.addMainInputDevices({\n\t\t\taudio,\n\t\t\tinputAudioDeviceConstraints: constraints,\n\t\t\tinputAudioStream: stream\n\t\t});\n\t}\n\t/** Adds or replaces the primary video input device with optional constraints or stream. */\n\tasync addVideoInputDevice({ constraints, stream } = {}) {\n\t\tconst video = constraints ?? stream ? void 0 : true;\n\t\treturn this.vertoManager.addMainInputDevices({\n\t\t\tvideo,\n\t\t\tinputVideoDeviceConstraints: constraints,\n\t\t\tinputVideoStream: stream\n\t\t});\n\t}\n\t/** Adds or replaces primary input devices (audio and/or video). */\n\tasync addInputDevices(options = {}) {\n\t\tawait this.vertoManager.addMainInputDevices(options);\n\t}\n\t/** Selects the audio input device for future calls. Optionally saves as a preference. */\n\tselectAudioInputDevice(device, options = {}) {\n\t\tthis.deviceController.selectAudioInputDevice(device);\n\t\tif (options.savePreference) PreferencesContainer.instance.preferredAudioInput = device;\n\t}\n\t/** Updates the audio input track constraints for the active call. */\n\tasync setAudioInputDeviceConstraints(constraints) {\n\t\tawait this.vertoManager.updateMediaConstraints({ audio: constraints });\n\t}\n\t/** Updates both audio and video input track constraints for the active call. */\n\tasync setInputDevicesConstraints(constraints) {\n\t\tawait this.vertoManager.updateMediaConstraints(constraints);\n\t}\n\t/** Selects the video input device for future calls. Optionally saves as a preference. */\n\tselectVideoInputDevice(device, options = {}) {\n\t\tthis.deviceController.selectVideoInputDevice(device);\n\t\tif (options.savePreference) PreferencesContainer.instance.preferredVideoInput = device;\n\t}\n\t/** Updates the video input track constraints for the active call. */\n\tasync setVideoInputDeviceConstraints(constraints) {\n\t\tawait this.vertoManager.updateMediaConstraints({ video: constraints });\n\t}\n\t/** Selects the audio output device. Optionally saves as a preference. */\n\tselectAudioOutputDevice(device, options = {}) {\n\t\tthis.deviceController.selectAudioOutputDevice(device);\n\t\tif (options.savePreference) PreferencesContainer.instance.preferredAudioOutput = device;\n\t}\n\t/**\n\t* Exits studio audio mode without restoring defaults.\n\t* Called internally before individual audio flag toggles.\n\t*/\n\texitStudioModeIfActive() {\n\t\tif (this._studioAudio$.value) {\n\t\t\tlogger$22.debug(\"[SelfParticipant] Exiting studio audio mode due to individual flag toggle\");\n\t\t\tthis._studioAudio$.next(false);\n\t\t}\n\t}\n\t/** Toggles echo cancellation. Exits studio mode if active. */\n\tasync toggleEchoCancellation() {\n\t\tthis.exitStudioModeIfActive();\n\t\tawait super.toggleEchoCancellation();\n\t}\n\t/** Toggles automatic gain control. Exits studio mode if active. */\n\tasync toggleAudioInputAutoGain() {\n\t\tthis.exitStudioModeIfActive();\n\t\tawait super.toggleAudioInputAutoGain();\n\t}\n\t/** Toggles noise suppression. Exits studio mode if active. */\n\tasync toggleNoiseSuppression() {\n\t\tthis.exitStudioModeIfActive();\n\t\tawait super.toggleNoiseSuppression();\n\t}\n\t/** Mutes local audio. Falls back to local device mute if the server RPC fails. */\n\tasync mute() {\n\t\ttry {\n\t\t\tawait super.mute();\n\t\t} catch (error) {\n\t\t\tlogger$22.warn(\"[Participant.toggleAudioInput] Server Error while muting audio input, proceeding with local toggle anyway\", error);\n\t\t} finally {\n\t\t\tthis.vertoManager.muteMainAudioInputDevice();\n\t\t}\n\t}\n\t/** Unmutes local audio. Falls back to local device unmute if the server RPC fails. */\n\tasync unmute() {\n\t\ttry {\n\t\t\tawait super.unmute();\n\t\t} catch (error) {\n\t\t\tlogger$22.warn(\"[Participant.toggleAudioInput] Server Error while unmuting audio input, proceeding with local toggle anyway\", error);\n\t\t} finally {\n\t\t\tawait this.vertoManager.unmuteMainAudioInputDevice();\n\t\t}\n\t}\n\t/** Mutes local video. Falls back to local device mute if the server RPC fails. */\n\tasync muteVideo() {\n\t\ttry {\n\t\t\tawait super.muteVideo();\n\t\t} catch (error) {\n\t\t\tlogger$22.warn(\"[Participant.toggleVideoInput] Server Error while muting video input, proceeding with local toggle anyway\", error);\n\t\t} finally {\n\t\t\tthis.vertoManager.muteMainVideoInputDevice();\n\t\t}\n\t}\n\t/** Unmutes local video. Falls back to local device unmute if the server RPC fails. */\n\tasync unmuteVideo() {\n\t\ttry {\n\t\t\tawait super.unmuteVideo();\n\t\t} catch (error) {\n\t\t\tlogger$22.warn(\"[Participant.toggleVideoInput] Server Error while unmuting video input, proceeding with local toggle anyway\", error);\n\t\t} finally {\n\t\t\tawait this.vertoManager.unmuteMainVideoInputDevice();\n\t\t}\n\t}\n};\n/** Type guard that checks if a participant is the local {@link SelfParticipant}. */\nconst isSelfParticipant = (participant) => {\n\treturn participant instanceof SelfParticipant;\n};\n\n//#endregion\n//#region src/core/RPCMessages/guards/base.guards.ts\nfunction isObject(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\nfunction hasProperty(obj, key) {\n\treturn key in obj;\n}\nfunction isJSONRPCRequest(value) {\n\treturn isObject(value) && hasProperty(value, \"jsonrpc\") && value.jsonrpc === \"2.0\" && hasProperty(value, \"id\") && typeof value.id === \"string\" && hasProperty(value, \"method\") && typeof value.method === \"string\";\n}\nfunction isJSONRPCResponse(value) {\n\treturn isObject(value) && hasProperty(value, \"jsonrpc\") && value.jsonrpc === \"2.0\" && hasProperty(value, \"id\") && typeof value.id === \"string\" && (hasProperty(value, \"result\") || hasProperty(value, \"error\"));\n}\nfunction isJSONRPCErrorResponse(value) {\n\treturn isObject(value) && hasProperty(value, \"jsonrpc\") && value.jsonrpc === \"2.0\" && hasProperty(value, \"id\") && typeof value.id === \"string\" && (hasProperty(value, \"error\") && isObject(value.error) && hasProperty(value.error, \"code\") && hasProperty(value.error, \"message\") || hasProperty(value, \"result\") && isObject(value.result) && hasProperty(value.result, \"code\") && value.result.code !== \"200\" && hasProperty(value.result, \"message\"));\n}\n\n//#endregion\n//#region src/core/RPCMessages/guards/events.guards.ts\n/** @internal @packageDocumentation */\n/**\n* Factory function to create Request-level type guards.\n*/\nfunction createEventRequestGuard(eventType) {\n\treturn (value) => isSignalwireRequest(value) && value.params.event_type === eventType;\n}\n/**\n* Factory function to create Metadata-level type guards.\n*/\nfunction createEventMetadataGuard(eventType) {\n\treturn (value) => isSignalwireMetadata(value) && value.event_type === eventType;\n}\nfunction isSignalwireRequest(value) {\n\treturn isJSONRPCRequest(value) && value.method === \"signalwire.event\" && isObject(value.params) && hasProperty(value.params, \"event_type\");\n}\nconst isSignalwireAuthorizationStateRequest = createEventRequestGuard(\"signalwire.authorization.state\");\nconst isWebrtcMessageRequest = createEventRequestGuard(\"webrtc.message\");\nconst isCallJoinedRequest = createEventRequestGuard(\"call.joined\");\nconst isCallLeftRequest = createEventRequestGuard(\"call.left\");\nconst isCallUpdatedRequest = createEventRequestGuard(\"call.updated\");\nconst isCallStateRequest = createEventRequestGuard(\"call.state\");\nconst isCallPlayRequest = createEventRequestGuard(\"call.play\");\nconst isCallConnectRequest = createEventRequestGuard(\"call.connect\");\nconst isRoomUpdatedRequest = createEventRequestGuard(\"room.updated\");\nconst isMemberUpdatedRequest = createEventRequestGuard(\"member.updated\");\nconst isMemberJoinedRequest = createEventRequestGuard(\"member.joined\");\nconst isMemberLeftRequest = createEventRequestGuard(\"member.left\");\nconst isMemberTalkingRequest = createEventRequestGuard(\"member.talking\");\nconst isLayoutChangedRequest = createEventRequestGuard(\"layout.changed\");\nconst isConversationMessageRequest = createEventRequestGuard(\"conversation.message\");\nconst isConversationMessageUpdatedRequest = createEventRequestGuard(\"conversation.message.updated\");\nfunction isSignalwireMetadata(value) {\n\treturn isObject(value) && hasProperty(value, \"event_type\") && typeof value.event_type === \"string\" && hasProperty(value, \"params\");\n}\nfunction isSignalwireCallMetadata(value) {\n\treturn isSignalwireMetadata(value) && (isCallJoinedMetadata(value) || isCallLeftMetadata(value) || isCallUpdatedMetadata(value) || isCallStateMetadata(value) || isCallPlayMetadata(value) || isCallConnectMetadata(value) || isRoomUpdatedMetadata(value) || isMemberUpdatedMetadata(value) || isMemberJoinedMetadata(value) || isMemberLeftMetadata(value) || isMemberTalkingMetadata(value) || isLayoutChangedMetadata(value) || isWebrtcMessageMetadata(value) || isConversationMessageMetadata(value) || isConversationMessageUpdatedMetadata(value));\n}\nconst isSignalwireAuthorizationStateMetadata = createEventMetadataGuard(\"signalwire.authorization.state\");\nconst isWebrtcMessageMetadata = createEventMetadataGuard(\"webrtc.message\");\nconst isCallJoinedMetadata = createEventMetadataGuard(\"call.joined\");\nconst isCallLeftMetadata = createEventMetadataGuard(\"call.left\");\nconst isCallUpdatedMetadata = createEventMetadataGuard(\"call.updated\");\nconst isCallStateMetadata = createEventMetadataGuard(\"call.state\");\nconst isCallPlayMetadata = createEventMetadataGuard(\"call.play\");\nconst isCallConnectMetadata = createEventMetadataGuard(\"call.connect\");\nconst isRoomUpdatedMetadata = createEventMetadataGuard(\"room.updated\");\nconst isMemberUpdatedMetadata = createEventMetadataGuard(\"member.updated\");\nconst isMemberJoinedMetadata = createEventMetadataGuard(\"member.joined\");\nconst isMemberLeftMetadata = createEventMetadataGuard(\"member.left\");\nconst isMemberTalkingMetadata = createEventMetadataGuard(\"member.talking\");\nconst isLayoutChangedMetadata = createEventMetadataGuard(\"layout.changed\");\nconst isConversationMessageMetadata = createEventMetadataGuard(\"conversation.message\");\nconst isConversationMessageUpdatedMetadata = createEventMetadataGuard(\"conversation.message.updated\");\nfunction isCallJoinedPayload(value) {\n\treturn isObject(value) && hasProperty(value, \"room_session\") && hasProperty(value, \"call_id\") && hasProperty(value, \"member_id\") && hasProperty(value, \"capabilities\");\n}\nfunction isLayoutChangedPayload(value) {\n\treturn isObject(value) && hasProperty(value, \"room_id\") && hasProperty(value, \"room_session_id\") && hasProperty(value, \"layout\");\n}\n\n//#endregion\n//#region src/managers/CallEventsManager.ts\nconst logger$21 = getLogger();\nconst initialSessionState = {};\n/** @internal */\nvar CallEventsManager = class extends Destroyable {\n\tconstructor(webRtcCallSession, options = {}) {\n\t\tsuper();\n\t\tthis.webRtcCallSession = webRtcCallSession;\n\t\tthis.options = options;\n\t\tthis.callIds = /* @__PURE__ */ new Set();\n\t\tthis.roomSessionIds = /* @__PURE__ */ new Set();\n\t\tthis._participants$ = this.createBehaviorSubject({});\n\t\tthis._self$ = this.createBehaviorSubject(null);\n\t\tthis._sessionState$ = this.createBehaviorSubject(initialSessionState);\n\t\tthis.initSubscriptions();\n\t}\n\tget participants$() {\n\t\treturn this.cachedObservable(\"participants$\", () => this._participants$.asObservable().pipe(map((participantsRecord) => Object.values(participantsRecord))));\n\t}\n\tget participants() {\n\t\treturn Object.values(this._participants$.value);\n\t}\n\tget self$() {\n\t\treturn this.cachedObservable(\"self$\", () => this._self$.asObservable().pipe(filterNull()));\n\t}\n\tisRoomSessionIdValid(roomSessionId) {\n\t\treturn this.roomSessionIds.has(roomSessionId);\n\t}\n\taddCallId(callId) {\n\t\tthis.callIds.add(callId);\n\t}\n\tisCallIdValid(callId) {\n\t\treturn this.callIds.has(callId);\n\t}\n\tget recording$() {\n\t\treturn this.cachedObservable(\"recording$\", () => this._sessionState$.pipe(map((state) => state.recording), distinctUntilChanged(), filterNull()));\n\t}\n\tget recordings$() {\n\t\treturn this.cachedObservable(\"recordings$\", () => this._sessionState$.pipe(map((state) => state.recordings), distinctUntilChanged(), filterNull()));\n\t}\n\tget streaming$() {\n\t\treturn this.cachedObservable(\"streaming$\", () => this._sessionState$.pipe(map((state) => state.streaming), distinctUntilChanged(), filterNull()));\n\t}\n\tget streams$() {\n\t\treturn this.cachedObservable(\"streams$\", () => this._sessionState$.pipe(map((state) => state.streams), distinctUntilChanged(), filterNull()));\n\t}\n\tget playbacks$() {\n\t\treturn this.cachedObservable(\"playbacks$\", () => this._sessionState$.pipe(map((state) => state.playbacks), distinctUntilChanged(), filterNull()));\n\t}\n\tget raiseHandPriority$() {\n\t\treturn this.cachedObservable(\"raiseHandPriority$\", () => this._sessionState$.pipe(map((state) => state.prioritize_handraise), distinctUntilChanged(), filterNull()));\n\t}\n\tget locked$() {\n\t\treturn this.cachedObservable(\"locked$\", () => this._sessionState$.pipe(map((state) => state.locked), distinctUntilChanged(), filterNull()));\n\t}\n\tget meta$() {\n\t\treturn this.cachedObservable(\"meta$\", () => this._sessionState$.pipe(map((state) => state.meta), distinctUntilChanged(), filterNull()));\n\t}\n\tget capabilities$() {\n\t\treturn this.cachedObservable(\"capabilities$\", () => this._sessionState$.pipe(map((state) => state.capabilities), distinctUntilChanged(), filterNull()));\n\t}\n\tget layout$() {\n\t\treturn this.cachedObservable(\"layout$\", () => this._sessionState$.pipe(map((state) => state.layout_name), distinctUntilChanged(), filterNull()));\n\t}\n\tget layouts$() {\n\t\treturn this.cachedObservable(\"layouts$\", () => this._sessionState$.pipe(map((state) => state.layouts), distinctUntilChanged(), filterNull()));\n\t}\n\tget layoutLayers$() {\n\t\treturn this.cachedObservable(\"layoutLayers$\", () => this._sessionState$.pipe(map((state) => state.layout_layers), distinctUntilChanged(), filterNull()));\n\t}\n\tget self() {\n\t\treturn this._self$.value;\n\t}\n\tget layoutLayers() {\n\t\treturn this._sessionState$.value.layout_layers ?? [];\n\t}\n\tget recording() {\n\t\treturn this._sessionState$.value.recording ?? false;\n\t}\n\tget streaming() {\n\t\treturn this._sessionState$.value.streaming ?? false;\n\t}\n\tget raiseHandPriority() {\n\t\treturn this._sessionState$.value.prioritize_handraise ?? false;\n\t}\n\tget locked() {\n\t\treturn this._sessionState$.value.locked ?? false;\n\t}\n\tget meta() {\n\t\treturn this._sessionState$.value.meta ?? {};\n\t}\n\tget layout() {\n\t\treturn this._sessionState$.value.layout_name;\n\t}\n\tget layouts() {\n\t\treturn this._sessionState$.value.layouts ?? [];\n\t}\n\tget capabilities() {\n\t\treturn this._sessionState$.value.capabilities ?? [];\n\t}\n\tisSessionEvent(id) {\n\t\treturn this.callIds.has(id) || this.roomSessionIds.has(id);\n\t}\n\tinitSubscriptions() {\n\t\tthis.subscribeTo(this.callJoinedEvent$, (callJoinedEvent) => {\n\t\t\tlogger$21.debug(\"[CallEventsManager] Handling call.joined event for call/session IDs:\", {\n\t\t\t\tcallId: callJoinedEvent.call_id,\n\t\t\t\troomSessionId: callJoinedEvent.room_session_id\n\t\t\t});\n\t\t\tconst sessionState = callJoinedEvent.room_session;\n\t\t\tconst capabilities = callJoinedEvent.capabilities;\n\t\t\tthis.selfId = this.selfId ?? callJoinedEvent.member_id;\n\t\t\tthis.originCallId = this.originCallId ?? callJoinedEvent.origin_call_id;\n\t\t\tthis.callIds.add(callJoinedEvent.call_id);\n\t\t\tthis.roomSessionIds.add(callJoinedEvent.room_session_id);\n\t\t\tthis._sessionState$.next({\n\t\t\t\t...this._sessionState$.value,\n\t\t\t\trecording: sessionState.recording,\n\t\t\t\trecordings: sessionState.recordings,\n\t\t\t\tstreaming: sessionState.streaming,\n\t\t\t\tstreams: sessionState.streams,\n\t\t\t\tplaybacks: sessionState.playbacks,\n\t\t\t\tprioritize_handraise: sessionState.prioritize_handraise,\n\t\t\t\tlocked: sessionState.locked,\n\t\t\t\tmeta: sessionState.meta,\n\t\t\t\tcapabilities\n\t\t\t});\n\t\t\tthis.updateParticipants(sessionState.members);\n\t\t\tthis._self$.value?.capabilities.updateFromRaw(capabilities);\n\t\t\tif (this._self$.value?.capabilities.setLayout) this.updateLayouts();\n\t\t});\n\t\tthis.subscribeTo(this.memberUpdates$, (member) => {\n\t\t\tlogger$21.debug(\"[CallEventsManager] Handling member update event for member ID:\", member);\n\t\t\tthis.upsertParticipant(member);\n\t\t});\n\t\tthis.subscribeTo(this.webRtcCallSession.memberLeft$, (memberLeftEvent) => {\n\t\t\tlogger$21.debug(\"[CallEventsManager] Handling member.left event for member ID:\", memberLeftEvent.member.member_id);\n\t\t\tconst participants = { ...this._participants$.value };\n\t\t\tif (memberLeftEvent.member.member_id in participants) {\n\t\t\t\tdelete participants[memberLeftEvent.member.member_id];\n\t\t\t\tthis._participants$.next(participants);\n\t\t\t} else logger$21.warn(`[CallEventsManager] Received member.left event for unknown member ID: ${memberLeftEvent.member.member_id}`);\n\t\t});\n\t\tthis.subscribeTo(this.webRtcCallSession.callUpdated$, (callUpdatedEvent) => {\n\t\t\tlogger$21.debug(\"[CallEventsManager] Handling call.updated event:\", callUpdatedEvent);\n\t\t\tconst roomSession = callUpdatedEvent.room_session;\n\t\t\tthis._sessionState$.next({\n\t\t\t\t...this._sessionState$.value,\n\t\t\t\trecording: roomSession.recording,\n\t\t\t\trecordings: roomSession.recordings,\n\t\t\t\tstreaming: roomSession.streaming,\n\t\t\t\tstreams: roomSession.streams,\n\t\t\t\tplaybacks: roomSession.playbacks,\n\t\t\t\tprioritize_handraise: roomSession.prioritize_handraise,\n\t\t\t\tlocked: roomSession.locked,\n\t\t\t\tmeta: roomSession.meta\n\t\t\t});\n\t\t});\n\t\tthis.subscribeTo(this.layoutChangedEvent$, (layoutChangedEvent) => {\n\t\t\tlogger$21.debug(\"[CallEventsManager] Handling layout.changed event:\", layoutChangedEvent);\n\t\t\tthis._sessionState$.next({\n\t\t\t\t...this._sessionState$.value,\n\t\t\t\tlayout_name: layoutChangedEvent.id,\n\t\t\t\tlayout_layers: layoutChangedEvent.layers\n\t\t\t});\n\t\t\tthis.updateParticipantPositions(layoutChangedEvent);\n\t\t});\n\t}\n\tupdateParticipantPositions(layoutChangedEvent) {\n\t\tif (Object.keys(this._participants$.value).length > 0 && !layoutChangedEvent.layers.some((layer) => !!layer.member_id)) logger$21.warn(\"[CallEventsManager] No layers with member_id found in layout.changed event. Nothing to update.\");\n\t\tlayoutChangedEvent.layers.filter((layer) => !!layer.member_id).filter((layer) => {\n\t\t\tif (!(layer.member_id in this._participants$.value)) {\n\t\t\t\tlogger$21.warn(`[CallEventsManager] Skipping layout layer for unknown member_id: ${layer.member_id}`);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}).map((layer) => {\n\t\t\tthis._participants$.value[layer.member_id].upnext({ position: layer });\n\t\t\treturn this._participants$.value[layer.member_id];\n\t\t}).forEach((participant) => {\n\t\t\tif (isSelfParticipant(participant)) this._self$.next(participant);\n\t\t\tthis._participants$.next({\n\t\t\t\t...this._participants$.value,\n\t\t\t\t[participant.id]: participant\n\t\t\t});\n\t\t});\n\t}\n\tupdateLayouts() {\n\t\tif (!this.selfId) return;\n\t\tthis.webRtcCallSession.executeMethod(this.selfId, \"call.layout.list\", {}).then((response) => {\n\t\t\tthis._sessionState$.next({\n\t\t\t\t...this._sessionState$.value,\n\t\t\t\tlayouts: response.result.layouts\n\t\t\t});\n\t\t}).catch((error) => {\n\t\t\tlogger$21.error(\"[CallEventsManager] Error fetching layouts:\", error);\n\t\t});\n\t}\n\tupdateParticipants(members) {\n\t\tmembers.forEach((member) => this.upsertParticipant(member));\n\t}\n\tupsertParticipant(member) {\n\t\tif (!(member.member_id in this._participants$.value)) {\n\t\t\tconst newParticipant = this.webRtcCallSession.createParticipant(member.member_id, this.selfId);\n\t\t\tthis._participants$.next({\n\t\t\t\t...this._participants$.value,\n\t\t\t\t[member.member_id]: newParticipant\n\t\t\t});\n\t\t}\n\t\tconst participant = this._participants$.value[member.member_id];\n\t\tconst oldValue = participant.value;\n\t\tlogger$21.debug(\"[CallEventsManager] Updating participant:\", member.member_id, {\n\t\t\toldValue,\n\t\t\tnewValue: member\n\t\t});\n\t\tparticipant.upnext({\n\t\t\t...oldValue,\n\t\t\t...member\n\t\t});\n\t\tif (isSelfParticipant(participant)) this._self$.next(participant);\n\t\tthis._participants$.next(this._participants$.value);\n\t}\n\tget callJoinedEvent$() {\n\t\treturn this.cachedObservable(\"callJoinedEvent$\", () => this.webRtcCallSession.callEvent$.pipe(filter(isCallJoinedPayload), tap((event) => {\n\t\t\tlogger$21.debug(\"[CallEventsManager] Call joined event:\", event);\n\t\t})));\n\t}\n\tget layoutChangedEvent$() {\n\t\treturn this.cachedObservable(\"layoutChangedEvent$\", () => this.webRtcCallSession.callEvent$.pipe(filterAs(isLayoutChangedPayload, \"layout\"), tap((event) => {\n\t\t\tlogger$21.debug(\"[CallEventsManager] Layout changed event:\", event);\n\t\t})));\n\t}\n\tget memberUpdates$() {\n\t\treturn this.cachedObservable(\"memberUpdates$\", () => merge(this.webRtcCallSession.memberJoined$, this.webRtcCallSession.memberUpdated$, this.webRtcCallSession.memberTalking$).pipe(map((event) => event.member), tap((event) => {\n\t\t\tlogger$21.debug(\"[CallEventsManager] Member update event:\", event);\n\t\t})));\n\t}\n\tdestroy() {\n\t\tObject.values(this._participants$.value).forEach((participant) => {\n\t\t\tparticipant.destroy();\n\t\t});\n\t\tthis._participants$.next({});\n\t\tthis._self$.next(null);\n\t\tthis.callIds.clear();\n\t\tthis.roomSessionIds.clear();\n\t\tthis.selfId = void 0;\n\t\tthis.originCallId = void 0;\n\t\tthis.webRtcCallSession = void 0;\n\t\tthis.callSession = void 0;\n\t\tsuper.destroy();\n\t}\n};\n\n//#endregion\n//#region src/helpers/SDPHelper.ts\n/**\n* SDPHelper - Utility functions for SDP (Session Description Protocol) parsing and validation.\n*\n* This module provides helper functions to analyze and validate SDP content,\n* particularly for ICE candidate validation in WebRTC connections.\n*/\n/** Valid SDP direction attribute values. */\nconst SDP_DIRECTIONS = new Set([\n\t\"sendrecv\",\n\t\"sendonly\",\n\t\"recvonly\",\n\t\"inactive\"\n]);\n/**\n* Extracts the media directions (audio/video) from an SDP string.\n*\n* Parses each media section (`m=audio` / `m=video`) and reads the `a=` direction\n* attribute (`sendrecv`, `sendonly`, `recvonly`, `inactive`).\n* If no explicit direction attribute is found for a media section, defaults to `sendrecv`\n* per RFC 4566.\n*\n* @param sdp - The SDP string to parse\n* @returns The extracted audio and video directions\n*\n* @example\n* ```typescript\n* const sdp = `v=0\\r\\nm=audio 9 UDP/TLS/RTP/SAVPF 111\\r\\na=sendrecv\\r\\nm=video 9 UDP/TLS/RTP/SAVPF 96\\r\\na=recvonly`;\n* extractMediaDirectionsFromSDP(sdp);\n* // { audio: 'sendrecv', video: 'recvonly' }\n* ```\n*/\nfunction extractMediaDirectionsFromSDP(sdp) {\n\tconst result = {\n\t\taudio: \"inactive\",\n\t\tvideo: \"inactive\"\n\t};\n\tif (!sdp) return result;\n\tconst lines = sdp.split(/\\r?\\n/);\n\tlet currentMediaKind = null;\n\tlet currentDirection = null;\n\tfor (const line of lines) if (line.startsWith(\"m=\")) {\n\t\tif (currentMediaKind) result[currentMediaKind] = currentDirection ?? \"sendrecv\";\n\t\tif (line.startsWith(\"m=audio\")) currentMediaKind = \"audio\";\n\t\telse if (line.startsWith(\"m=video\")) currentMediaKind = \"video\";\n\t\telse currentMediaKind = null;\n\t\tcurrentDirection = null;\n\t} else if (currentMediaKind && line.startsWith(\"a=\")) {\n\t\tconst attr = line.substring(2).trim();\n\t\tif (SDP_DIRECTIONS.has(attr)) currentDirection = attr;\n\t}\n\tif (currentMediaKind) result[currentMediaKind] = currentDirection ?? \"sendrecv\";\n\treturn result;\n}\n/**\n* Validates that an SDP string has at least one non-host ICE candidate\n* for each media section (m= line).\n*\n* Non-host candidates (srflx, prflx, relay) indicate that the SDP has\n* gathered candidates that can be used for connectivity through NAT\n* traversal mechanisms.\n*\n* @param sdp - The SDP string to validate\n* @returns true if the SDP is valid (has non-host candidates for all media sections,\n* or has no media sections), false otherwise\n*\n* @example\n* ```typescript\n* const sdp = `v=0\n* m=audio 9 UDP/TLS/RTP/SAVPF 111\n* a=candidate:1 1 UDP 1694498815 203.0.113.1 50001 typ srflx\n* m=video 9 UDP/TLS/RTP/SAVPF 96\n* a=candidate:2 1 UDP 1694498815 203.0.113.1 50002 typ relay`;\n*\n* isValidLocalDescription(sdp); // returns true\n* ```\n*/\nfunction isValidLocalDescription(sdp) {\n\tif (!sdp) return false;\n\tconst lines = sdp.split(\"\\r\\n\");\n\tconst mediaSectionsValidCandidates = [];\n\tlet currentSection = -1;\n\tfor (const line of lines) if (line.startsWith(\"m=\")) {\n\t\tcurrentSection += 1;\n\t\tmediaSectionsValidCandidates[currentSection] = 0;\n\t} else if (line.startsWith(\"a=candidate:\")) {\n\t\tconst typeMatch = /\\styp\\s+(host|srflx|prflx|relay)/.exec(line);\n\t\tif (typeMatch && typeMatch[1] !== \"host\") mediaSectionsValidCandidates[currentSection] += 1;\n\t}\n\treturn !mediaSectionsValidCandidates.length || mediaSectionsValidCandidates.every((count) => count > 0);\n}\n/**\n* Reorders codec payload types in an SDP m= line to match the preferred order.\n*\n* For each media section (`m=audio` / `m=video`), this function parses the\n* `a=rtpmap` lines to build a payload-type-to-codec-name map, then rewrites\n* the m= line so preferred codecs appear first.\n*\n* Codecs not in the preferred list retain their original relative order after\n* the preferred ones. Preferred codecs that do not appear in the SDP are ignored.\n*\n* @param sdp - The SDP string to modify\n* @param preferredVideo - Preferred video codec names in priority order (e.g., ['VP9', 'VP8'])\n* @param preferredAudio - Preferred audio codec names in priority order (e.g., ['opus'])\n* @returns The modified SDP string with reordered codec payload types\n*\n* @example\n* ```typescript\n* const reordered = reorderCodecs(sdp, ['VP9', 'H264'], ['opus']);\n* ```\n*/\nfunction reorderCodecs(sdp, preferredVideo = [], preferredAudio = []) {\n\tif (!sdp || preferredVideo.length === 0 && preferredAudio.length === 0) return sdp;\n\tconst sections = splitIntoMediaSections(sdp);\n\tconst result = [sections[0]];\n\tfor (let i = 1; i < sections.length; i++) {\n\t\tconst section = sections[i];\n\t\tconst mLine = section.split(/\\r?\\n/)[0];\n\t\tif (mLine.startsWith(\"m=video\") && preferredVideo.length > 0) result.push(reorderSectionCodecs(section, preferredVideo));\n\t\telse if (mLine.startsWith(\"m=audio\") && preferredAudio.length > 0) result.push(reorderSectionCodecs(section, preferredAudio));\n\t\telse result.push(section);\n\t}\n\treturn result.join(\"\");\n}\n/**\n* Adds stereo=1 and sprop-stereo=1 to the Opus fmtp line in the SDP.\n*\n* This enables stereo Opus negotiation for music/podcast use cases.\n* Also sets maxaveragebitrate to accommodate stereo audio (default: 510000 bps).\n*\n* @param sdp - The SDP string to modify\n* @param maxBitrate - Maximum average bitrate in bps (default: 510000)\n* @returns The modified SDP string with stereo Opus parameters\n*\n* @example\n* ```typescript\n* const stereoSdp = enableStereoOpus(sdp);\n* // a=fmtp:111 minptime=10;useinbandfec=1;stereo=1;sprop-stereo=1;maxaveragebitrate=510000\n* ```\n*/\nfunction enableStereoOpus(sdp, maxBitrate = DEFAULT_STEREO_MAX_AVERAGE_BITRATE) {\n\tif (!sdp) return sdp;\n\tconst opusPayloadType = findOpusPayloadType(sdp);\n\tif (opusPayloadType === null) return sdp;\n\tconst lines = sdp.split(/\\r?\\n/);\n\tconst updatedLines = [];\n\tconst fmtpPrefix = `a=fmtp:${opusPayloadType} `;\n\tlet foundFmtp = false;\n\tfor (const line of lines) if (line.startsWith(fmtpPrefix)) {\n\t\tfoundFmtp = true;\n\t\tupdatedLines.push(appendStereoParams(line, maxBitrate));\n\t} else updatedLines.push(line);\n\tif (!foundFmtp) {\n\t\tconst rtpmapLine = `a=rtpmap:${opusPayloadType} `;\n\t\tconst withFmtp = [];\n\t\tfor (const line of updatedLines) {\n\t\t\twithFmtp.push(line);\n\t\t\tif (line.startsWith(rtpmapLine)) withFmtp.push(`a=fmtp:${opusPayloadType} stereo=1;sprop-stereo=1;maxaveragebitrate=${maxBitrate}`);\n\t\t}\n\t\treturn withFmtp.join(\"\\r\\n\");\n\t}\n\treturn updatedLines.join(\"\\r\\n\");\n}\n/**\n* Convenience wrapper that applies both codec reordering and stereo Opus.\n*\n* @param sdp - The SDP string to modify\n* @param audioCodecs - Preferred audio codecs in priority order\n* @param videoCodecs - Preferred video codecs in priority order\n* @returns The modified SDP string\n*/\nfunction setCodecPreferences(sdp, audioCodecs = [], videoCodecs = []) {\n\treturn reorderCodecs(sdp, videoCodecs, audioCodecs);\n}\n/**\n* Splits an SDP string into session-level + per-media sections.\n*\n* The first element is the session-level content (before the first m= line).\n* Subsequent elements each start with an m= line.\n*/\nfunction splitIntoMediaSections(sdp) {\n\treturn sdp.split(/(?=m=)/);\n}\n/**\n* Reorders codecs within a single media section based on preferred names.\n*/\nfunction reorderSectionCodecs(section, preferredNames) {\n\tconst lines = section.split(/\\r?\\n/);\n\tconst mLineParts = lines[0].split(\" \");\n\tif (mLineParts.length < 4) return section;\n\tconst payloadTypes = mLineParts.slice(3);\n\tconst ptToCodec = /* @__PURE__ */ new Map();\n\tfor (const line of lines) {\n\t\tconst match = /^a=rtpmap:(\\d+)\\s+([^\\s/]+)/.exec(line);\n\t\tif (match) ptToCodec.set(match[1], match[2]);\n\t}\n\tconst preferredNamesUpper = preferredNames.map((n) => n.toUpperCase());\n\tconst preferred = [];\n\tconst remaining = [];\n\tfor (const pt of payloadTypes) {\n\t\tconst codecName = ptToCodec.get(pt)?.toUpperCase() ?? \"\";\n\t\tif (preferredNamesUpper.indexOf(codecName) >= 0) preferred.push(pt);\n\t\telse remaining.push(pt);\n\t}\n\tpreferred.sort((a, b) => {\n\t\tconst nameA = ptToCodec.get(a)?.toUpperCase() ?? \"\";\n\t\tconst nameB = ptToCodec.get(b)?.toUpperCase() ?? \"\";\n\t\treturn preferredNamesUpper.indexOf(nameA) - preferredNamesUpper.indexOf(nameB);\n\t});\n\tconst reorderedPTs = [...preferred, ...remaining];\n\treturn [[...mLineParts.slice(0, 3), ...reorderedPTs].join(\" \"), ...lines.slice(1)].join(\"\\r\\n\");\n}\n/**\n* Finds the Opus payload type number from a=rtpmap lines in the SDP.\n*\n* @returns The payload type number as a string, or null if Opus is not found\n*/\nfunction findOpusPayloadType(sdp) {\n\tconst match = /a=rtpmap:(\\d+)\\s+opus\\/48000/i.exec(sdp);\n\treturn match ? match[1] : null;\n}\n/**\n* Appends stereo and bitrate parameters to an existing Opus fmtp line.\n*\n* Avoids duplicating parameters if they already exist.\n*/\nfunction appendStereoParams(fmtpLine, maxBitrate) {\n\tlet result = fmtpLine;\n\tif (!result.includes(\"stereo=\")) result += \";stereo=1\";\n\tif (!result.includes(\"sprop-stereo=\")) result += \";sprop-stereo=1\";\n\tif (!result.includes(\"maxaveragebitrate=\")) result += `;maxaveragebitrate=${maxBitrate}`;\n\treturn result;\n}\n\n//#endregion\n//#region src/controllers/ICEGatheringController.ts\nconst logger$20 = getLogger();\nvar ICEGatheringController = class extends Destroyable {\n\tconstructor(peerConnection, peerConnectionControllerNegotiating$, options = {}) {\n\t\tsuper();\n\t\tthis.peerConnection = peerConnection;\n\t\tthis.peerConnectionControllerNegotiating$ = peerConnectionControllerNegotiating$;\n\t\tthis.onicegatheringstatechangeHandler = () => {\n\t\t\tconst { iceGatheringState } = this.peerConnection;\n\t\t\tlogger$20.debug(`[ICEGatheringController] ICE gathering state changed to: ${iceGatheringState}`);\n\t\t\tif (iceGatheringState === \"gathering\") this._iceCandidatesState.next({\n\t\t\t\tstate: \"gathering\",\n\t\t\t\tvalidSDP: false\n\t\t\t});\n\t\t};\n\t\tthis.onicecandidateHandler = (event) => {\n\t\t\tlogger$20.debug(\"[ICEGatheringController] ICE candidate event received:\", event.candidate);\n\t\t\tthis.removeTimer(\"iceCandidateTimer\");\n\t\t\tif (event.candidate) this.iceCandidateTimer = setTimeout(() => {\n\t\t\t\tif (this.peerConnection.iceGatheringState !== \"complete\") {\n\t\t\t\t\tlogger$20.warn(\"[ICEGatheringController] ICE candidate timeout, using current SDP\");\n\t\t\t\t\tthis.handleICECandidateTimeout();\n\t\t\t\t}\n\t\t\t}, this.iceCandidateTimeout);\n\t\t\telse {\n\t\t\t\tlogger$20.debug(\"[ICEGatheringController] ICE gathering completed: null candidate received\");\n\t\t\t\tthis.removeTimer(\"iceGatheringTimer\");\n\t\t\t\tthis.handleICEGatheringComplete();\n\t\t\t}\n\t\t};\n\t\tthis._iceCandidatesState = this.createBehaviorSubject({\n\t\t\tstate: \"new\",\n\t\t\tvalidSDP: false\n\t\t});\n\t\tthis.iceCandidateTimeout = options.iceCandidateTimeout ?? DEFAULT_ICE_CANDIDATE_TIMEOUT_MS;\n\t\tthis.iceGatheringTimeout = options.iceGatheringTimeout ?? DEFAULT_ICE_GATHERING_TIMEOUT_MS;\n\t\tthis.relayOnly = options.relayOnly ?? false;\n\t\tthis.setupEventListeners();\n\t\tthis.subscribeTo(this.peerConnectionControllerNegotiating$.pipe(filter((isNegotiating) => isNegotiating)), (isNegotiating) => {\n\t\t\tif (isNegotiating) {\n\t\t\t\tthis.setupEventListeners();\n\t\t\t\tthis.iceGatheringTimer = setTimeout(() => {\n\t\t\t\t\tif (this.peerConnection.iceGatheringState !== \"complete\") {\n\t\t\t\t\t\tlogger$20.warn(\"[ICEGatheringController] ICE gathering timeout, using current SDP\");\n\t\t\t\t\t\tthis.handleICEGatheringTimeout();\n\t\t\t\t\t}\n\t\t\t\t}, this.iceGatheringTimeout);\n\t\t\t}\n\t\t});\n\t}\n\tsetupEventListeners() {\n\t\tthis.peerConnection.removeEventListener(\"icecandidate\", this.onicecandidateHandler);\n\t\tthis.peerConnection.addEventListener(\"icecandidate\", this.onicecandidateHandler);\n\t\tthis.peerConnection.removeEventListener(\"icegatheringstatechange\", this.onicegatheringstatechangeHandler);\n\t\tthis.peerConnection.addEventListener(\"icegatheringstatechange\", this.onicegatheringstatechangeHandler);\n\t}\n\tget iceCandidatesState$() {\n\t\treturn this._iceCandidatesState.pipe(withLatestFrom(this.peerConnectionControllerNegotiating$), filter(([_, isNegotiating]) => isNegotiating), map(([state, _]) => state.state));\n\t}\n\tget hasValidLocalDescriptionSDP() {\n\t\tconst sdp = this.peerConnection.localDescription?.sdp;\n\t\treturn isValidLocalDescription(sdp ?? \"\");\n\t}\n\tget isRelayOnly() {\n\t\treturn this.relayOnly;\n\t}\n\tsetRelayOnly(value) {\n\t\tthis.relayOnly = value;\n\t}\n\thandleICEGatheringComplete() {\n\t\tlogger$20.debug(\"[ICEGatheringController] Handling ICE gathering complete\");\n\t\tlogger$20.debug(`[ICEGatheringController] Checking ICE gathering state: ${this.peerConnection.iceGatheringState}`);\n\t\tlogger$20.debug(\"[ICEGatheringController] ICE gathering complete\");\n\t\tthis._iceCandidatesState.next({\n\t\t\tstate: \"complete\",\n\t\t\tvalidSDP: this.hasValidLocalDescriptionSDP\n\t\t});\n\t\tthis.stopGathering();\n\t}\n\tstopGathering() {\n\t\tthis.peerConnection.removeEventListener(\"icegatheringstatechange\", this.onicegatheringstatechangeHandler);\n\t\tthis.peerConnection.removeEventListener(\"icecandidate\", this.onicecandidateHandler);\n\t\tthis.clearAllTimers();\n\t}\n\thandleICEGatheringTimeout() {\n\t\tthis.removeTimer(\"iceGatheringTimer\");\n\t\tconst validSDP = this.hasValidLocalDescriptionSDP;\n\t\tif (validSDP) {\n\t\t\tlogger$20.debug(\"[ICEGatheringController] Local SDP is valid\");\n\t\t\tthis._iceCandidatesState.next({\n\t\t\t\tstate: \"timeout\",\n\t\t\t\tvalidSDP\n\t\t\t});\n\t\t\tthis.stopGathering();\n\t\t} else logger$20.debug(\"### ICE gathering timeout\\n\", this.peerConnection.localDescription?.sdp);\n\t}\n\thandleICECandidateTimeout() {\n\t\tif (this.iceCandidateTimer) this.removeTimer(\"iceCandidateTimer\");\n\t\tlogger$20.warn(\"[ICEGatheringController] ICE candidate timeout\");\n\t\tconst validSDP = this.hasValidLocalDescriptionSDP;\n\t\tif (!validSDP && !this.relayOnly) this.restartICEGatheringWithRelayOnly();\n\t\telse {\n\t\t\tlogger$20.debug(\"[ICEGatheringController] Using current SDP due to ICE candidate timeout\");\n\t\t\tthis._iceCandidatesState.next({\n\t\t\t\tstate: \"timeout\",\n\t\t\t\tvalidSDP\n\t\t\t});\n\t\t\tthis.stopGathering();\n\t\t}\n\t}\n\trestartICEGatheringWithRelayOnly() {\n\t\tlogger$20.debug(\"[ICEGatheringController] Restarting ICE gathering with relay-only candidates\");\n\t\tthis.relayOnly = true;\n\t\tthis.peerConnection.setConfiguration({\n\t\t\t...this.peerConnection.getConfiguration(),\n\t\t\ticeTransportPolicy: \"relay\"\n\t\t});\n\t\tthis.peerConnection.restartIce();\n\t}\n\tremoveTimer(timer$1) {\n\t\tif (this[timer$1]) {\n\t\t\tclearTimeout(this[timer$1]);\n\t\t\tthis[timer$1] = void 0;\n\t\t}\n\t}\n\tclearAllTimers() {\n\t\tlogger$20.debug(\"[ICEGatheringController] Clearing all timers\");\n\t\tthis.removeTimer(\"iceGatheringTimer\");\n\t\tthis.removeTimer(\"iceCandidateTimer\");\n\t}\n\tremoveEventListeners() {\n\t\tthis.peerConnection.removeEventListener(\"icegatheringstatechange\", this.onicegatheringstatechangeHandler);\n\t\tthis.peerConnection.removeEventListener(\"icecandidate\", this.onicecandidateHandler);\n\t}\n\tdestroy() {\n\t\tlogger$20.debug(\"[ICEGatheringController] Destroying ICEGatheringController\");\n\t\tthis.clearAllTimers();\n\t\tthis.removeEventListeners();\n\t\tsuper.destroy();\n\t}\n};\n\n//#endregion\n//#region src/controllers/LocalAudioPipeline.ts\nconst logger$19 = getLogger();\n/**\n* Web Audio pipeline for the local microphone stream.\n*\n* Wraps the raw mic `MediaStreamTrack` in a graph of:\n*\n* ```\n* MediaStreamAudioSourceNode → GainNode → AnalyserNode → MediaStreamAudioDestinationNode\n* ```\n*\n* The {@link outputTrack} from the destination node is what callers should\n* attach to the `RTCRtpSender` in place of the raw mic track. The same\n* destination track is reused across input changes (device switch, mute /\n* unmute track replacement) so the sender reference stays stable — only the\n* source end of the graph is rebuilt.\n*\n* The pipeline owns a single {@link AudioContext}. Callers must invoke\n* {@link destroy} to release it when the call ends.\n*/\nvar LocalAudioPipeline = class extends Destroyable {\n\tconstructor(options = {}) {\n\t\tsuper();\n\t\tthis._inputSource = null;\n\t\tthis._inputStream = null;\n\t\tthis._lastSpokeAt = 0;\n\t\tthis._gain$ = this.createBehaviorSubject(1);\n\t\tthis._pttMultiplier = 1;\n\t\tthis._audioContext = (options.audioContextFactory ?? (() => new AudioContext()))();\n\t\tthis._gainNode = this._audioContext.createGain();\n\t\tthis._analyser = this._audioContext.createAnalyser();\n\t\tthis._analyser.fftSize = 2048;\n\t\tthis._analyser.smoothingTimeConstant = .3;\n\t\tthis._analyserBuffer = new Uint8Array(new ArrayBuffer(this._analyser.fftSize));\n\t\tthis._destination = this._audioContext.createMediaStreamDestination();\n\t\tthis._gainNode.connect(this._analyser);\n\t\tthis._analyser.connect(this._destination);\n\t\tthis._speakingThreshold = options.speakingThreshold ?? VAD_THRESHOLD;\n\t\tthis._speakingHoldMs = options.speakingHoldMs ?? VAD_HOLD_MS;\n\t\tthis._pollIntervalMs = options.pollIntervalMs ?? AUDIO_LEVEL_POLL_INTERVAL_MS;\n\t\tconst initial = options.initialGain ?? 1;\n\t\tthis._gain$.next(initial);\n\t\tthis.applyEffectiveGain();\n\t}\n\t/** Observable of the current gain value (0..2). */\n\tget gain$() {\n\t\treturn this._gain$.asObservable();\n\t}\n\t/** Current gain value (0..2). */\n\tget gain() {\n\t\treturn this._gain$.value;\n\t}\n\t/**\n\t* Processed output track to attach to the RTCRtpSender. Stable reference\n\t* across input changes, so `sender.replaceTrack(pipeline.outputTrack)` only\n\t* needs to be called once.\n\t*/\n\tget outputTrack() {\n\t\tconst [track] = this._destination.stream.getAudioTracks();\n\t\treturn track;\n\t}\n\t/**\n\t* Root-mean-square audio level of the input signal, 0..1. Emits on a fixed\n\t* interval (~30fps by default).\n\t*/\n\tget level$() {\n\t\treturn this.deferEmission(interval(this._pollIntervalMs, animationFrameScheduler).pipe(map(() => this.computeLevel())));\n\t}\n\t/**\n\t* Boolean VAD derived from {@link level$}. True while level ≥ threshold or\n\t* during the hold window after the last frame that crossed the threshold.\n\t*/\n\tget speaking$() {\n\t\treturn this.deferEmission(this.level$.pipe(map((level) => this.evaluateSpeaking(level)), distinctUntilChanged()));\n\t}\n\t/**\n\t* Set gain multiplier applied to the input signal. 0 = silence,\n\t* 1 = unity, 2 = 2x. Values are clamped to [0, 2]. The effective gain on\n\t* the graph also respects the current PTT state.\n\t*/\n\tsetGain(value) {\n\t\tconst clamped = Math.max(0, Math.min(2, value));\n\t\tthis._gain$.next(clamped);\n\t\tthis.applyEffectiveGain();\n\t}\n\t/**\n\t* Silence the graph when `active = false`, otherwise restore the configured\n\t* gain. Use this from a PTT handler: released → `false`, held → `true`.\n\t* Orthogonal to {@link setGain} — once PTT returns to active, the last\n\t* configured gain reappears.\n\t*/\n\tsetPTTActive(active) {\n\t\tthis._pttMultiplier = active ? 1 : 0;\n\t\tthis.applyEffectiveGain();\n\t}\n\tapplyEffectiveGain() {\n\t\tthis._gainNode.gain.value = this._gain$.value * this._pttMultiplier;\n\t}\n\t/**\n\t* Wire a new raw mic track as the pipeline's input. Replaces any previous\n\t* input source and reconnects the graph so {@link outputTrack} continues\n\t* to emit the processed audio. Pass `null` to disconnect the input (the\n\t* output track stays alive but emits silence).\n\t*\n\t* Also resumes the underlying AudioContext on attach — Chrome creates it\n\t* in a suspended state and the graph won't process (the destination\n\t* track emits silence) until resume() succeeds.\n\t*/\n\tsetInputTrack(track) {\n\t\tif (this._inputSource) {\n\t\t\ttry {\n\t\t\t\tthis._inputSource.disconnect();\n\t\t\t} catch (error) {\n\t\t\t\tlogger$19.debug(\"[LocalAudioPipeline] input disconnect warning:\", error);\n\t\t\t}\n\t\t\tthis._inputSource = null;\n\t\t}\n\t\tif (this._inputStream) this._inputStream = null;\n\t\tif (!track) return;\n\t\tthis._inputStream = new MediaStream([track]);\n\t\tthis._inputSource = this._audioContext.createMediaStreamSource(this._inputStream);\n\t\tthis._inputSource.connect(this._gainNode);\n\t\tif (this._audioContext.state === \"suspended\") this._audioContext.resume().catch((error) => {\n\t\t\tlogger$19.warn(\"[LocalAudioPipeline] AudioContext resume failed:\", error);\n\t\t});\n\t}\n\tdestroy() {\n\t\tif (this._inputSource) {\n\t\t\ttry {\n\t\t\t\tthis._inputSource.disconnect();\n\t\t\t} catch {}\n\t\t\tthis._inputSource = null;\n\t\t}\n\t\ttry {\n\t\t\tthis._gainNode.disconnect();\n\t\t\tthis._analyser.disconnect();\n\t\t} catch {}\n\t\tthis._audioContext.close().catch((error) => {\n\t\t\tlogger$19.debug(\"[LocalAudioPipeline] audio context close warning:\", error);\n\t\t});\n\t\tsuper.destroy();\n\t}\n\tcomputeLevel() {\n\t\tif (!this._inputSource) return 0;\n\t\tthis._analyser.getByteTimeDomainData(this._analyserBuffer);\n\t\tlet sum = 0;\n\t\tfor (const sample of this._analyserBuffer) {\n\t\t\tconst normalized = (sample - 128) / 128;\n\t\t\tsum += normalized * normalized;\n\t\t}\n\t\treturn Math.sqrt(sum / this._analyserBuffer.length);\n\t}\n\tevaluateSpeaking(level) {\n\t\tconst now = Date.now();\n\t\tif (level >= this._speakingThreshold) {\n\t\t\tthis._lastSpokeAt = now;\n\t\t\treturn true;\n\t\t}\n\t\treturn now - this._lastSpokeAt < this._speakingHoldMs;\n\t}\n};\n\n//#endregion\n//#region src/controllers/LocalStreamController.ts\nconst logger$18 = getLogger();\nvar LocalStreamController = class extends Destroyable {\n\tconstructor(options) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.mediaTrackEndedHandler = (event) => {\n\t\t\tthis._mediaTrackEnded$.next(event);\n\t\t};\n\t\tthis._localStream$ = this.createBehaviorSubject(null);\n\t\tthis._localAudioTracks$ = this.createBehaviorSubject([]);\n\t\tthis._localVideoTracks$ = this.createBehaviorSubject([]);\n\t\tthis._mediaTrackEnded$ = this.createSubject();\n\t}\n\tget localStream$() {\n\t\treturn this._localStream$.asObservable().pipe(takeUntil(this.destroyed$));\n\t}\n\tget localAudioTracks$() {\n\t\treturn this._localAudioTracks$.asObservable().pipe(takeUntil(this.destroyed$));\n\t}\n\tget localVideoTracks$() {\n\t\treturn this._localVideoTracks$.asObservable().pipe(takeUntil(this.destroyed$));\n\t}\n\tget mediaTrackEnded$() {\n\t\treturn this._mediaTrackEnded$.asObservable().pipe(takeUntil(this.destroyed$));\n\t}\n\tget localStream() {\n\t\treturn this._localStream$.value;\n\t}\n\tget localAudioTracks() {\n\t\treturn this._localAudioTracks$.value;\n\t}\n\tget localVideoTracks() {\n\t\treturn this._localVideoTracks$.value;\n\t}\n\t/**\n\t* Build the local media stream based on the provided options.\n\t*/\n\tasync buildLocalStream() {\n\t\tlogger$18.debug(\"[LocalStreamController] Building local media stream.\");\n\t\tlet stream;\n\t\tif (this.options.inputAudioStream ?? this.options.inputVideoStream) {\n\t\t\tconst tracks = [...this.options.inputAudioStream?.getTracks() ?? [], ...this.options.inputVideoStream?.getTracks() ?? []];\n\t\t\tstream = new MediaStream(tracks);\n\t\t} else if (this.options.propose === \"screenshare\") {\n\t\t\tlogger$18.debug(\"[LocalStreamController] Requesting display media for screen sharing with audio:\", Boolean(this.options.inputAudioDeviceConstraints));\n\t\t\tstream = await this.options.getDisplayMedia({\n\t\t\t\tvideo: true,\n\t\t\t\taudio: Boolean(this.options.inputAudioDeviceConstraints)\n\t\t\t});\n\t\t\tlogger$18.debug(\"[LocalStreamController] Screen share media obtained:\", stream);\n\t\t} else {\n\t\t\tconst constraints = {\n\t\t\t\taudio: this.options.inputAudioDeviceConstraints,\n\t\t\t\tvideo: this.options.inputVideoDeviceConstraints\n\t\t\t};\n\t\t\tlogger$18.debug(\"[LocalStreamController] Requesting user media with constraints:\", constraints);\n\t\t\tstream = await this.options.getUserMedia(constraints);\n\t\t\tlogger$18.debug(\"[LocalStreamController] User media obtained:\", stream);\n\t\t}\n\t\tthis._localStream$.next(stream);\n\t\treturn stream;\n\t}\n\t/**\n\t* Add a local media track to the local stream.\n\t* @param track - The MediaStreamTrack to add\n\t* @returns The MediaStream (either existing or newly created)\n\t*/\n\taddTrack(track) {\n\t\tconst localStream = this._localStream$.value ?? new MediaStream();\n\t\ttrack.addEventListener(\"ended\", this.mediaTrackEndedHandler);\n\t\tlocalStream.addTrack(track);\n\t\tthis._localStream$.next(localStream);\n\t\tif (track.kind === \"video\") this._localVideoTracks$.next(localStream.getVideoTracks());\n\t\telse this._localAudioTracks$.next(localStream.getAudioTracks());\n\t\tlogger$18.debug(`[LocalStreamController] ${track.kind} track added:`, track.id);\n\t\treturn localStream;\n\t}\n\t/**\n\t* Remove a local media track from the local stream.\n\t* @param trackId - The ID of the track to remove\n\t* @returns The removed track, or undefined if not found\n\t*/\n\tremoveTrack(trackId) {\n\t\tconst stream = this._localStream$.value;\n\t\tconst track = stream?.getTracks().find((t) => t.id === trackId);\n\t\tif (!track) {\n\t\t\tlogger$18.debug(`[LocalStreamController] track not found: ${trackId}`);\n\t\t\treturn;\n\t\t}\n\t\ttrack.removeEventListener(\"ended\", this.mediaTrackEndedHandler);\n\t\tstream?.removeTrack(track);\n\t\ttrack.stop();\n\t\tthis._localStream$.next(stream);\n\t\tif (track.kind === \"video\") this._localVideoTracks$.next(stream?.getVideoTracks() ?? []);\n\t\telse this._localAudioTracks$.next(stream?.getAudioTracks() ?? []);\n\t\tlogger$18.debug(`[LocalStreamController] ${track.kind} track removed:`, trackId);\n\t\treturn track;\n\t}\n\t/**\n\t* Get or create a local stream.\n\t*/\n\tgetOrCreateLocalStream() {\n\t\treturn this._localStream$.value ?? new MediaStream();\n\t}\n\t/**\n\t* Set the local stream directly.\n\t*/\n\tsetLocalStream(stream) {\n\t\tthis._localStream$.next(stream);\n\t}\n\t/**\n\t* Add a track ended event listener to a track.\n\t*/\n\taddTrackEndedListener(track) {\n\t\ttrack.addEventListener(\"ended\", this.mediaTrackEndedHandler);\n\t}\n\t/**\n\t* Update the controller options (e.g., when media overrides are applied).\n\t*/\n\tupdateOptions(options) {\n\t\tthis.options = {\n\t\t\t...this.options,\n\t\t\t...options\n\t\t};\n\t}\n\t/**\n\t* Stop all local tracks and clean up.\n\t*/\n\tstopAllTracks() {\n\t\tthis._localStream$.value?.getTracks().forEach((track) => {\n\t\t\tlogger$18.debug(`[LocalStreamController] Stopping local track: ${track.kind}`);\n\t\t\ttrack.removeEventListener(\"ended\", this.mediaTrackEndedHandler);\n\t\t\ttrack.stop();\n\t\t});\n\t}\n\t/**\n\t* Clean up resources.\n\t*/\n\tdestroy() {\n\t\tthis.stopAllTracks();\n\t\tsuper.destroy();\n\t}\n};\n\n//#endregion\n//#region src/controllers/TransceiverController.ts\nconst logger$17 = getLogger();\nconst getDirection = (send, recv) => {\n\tif (send && recv) return \"sendrecv\";\n\telse if (send && !recv) return \"sendonly\";\n\telse if (!send && recv) return \"recvonly\";\n\treturn \"inactive\";\n};\nvar TransceiverController = class extends Destroyable {\n\tconstructor(options) {\n\t\tsuper();\n\t\tthis.peerConnection = options.peerConnection;\n\t\tthis.options = options;\n\t}\n\tget useAddTransceivers() {\n\t\treturn typeof this.peerConnection.addTransceiver === \"function\";\n\t}\n\tget useAddTrack() {\n\t\treturn typeof this.peerConnection.addTrack === \"function\";\n\t}\n\tget useAddStream() {\n\t\treturn typeof this.peerConnection.addStream === \"function\" && !this.useAddTransceivers && !this.useAddTrack;\n\t}\n\tget propose() {\n\t\treturn this.options.propose;\n\t}\n\tget isAdditionalDevice() {\n\t\treturn this.propose === \"additional-device\";\n\t}\n\tget isScreenShare() {\n\t\treturn this.propose === \"screenshare\";\n\t}\n\tget isSimulcast() {\n\t\treturn Boolean(this.options.simulcast);\n\t}\n\tget isSFU() {\n\t\treturn Boolean(this.options.sfu);\n\t}\n\tget receiveVideo() {\n\t\treturn Boolean(this.options.receiveVideo);\n\t}\n\tget receiveAudio() {\n\t\treturn Boolean(this.options.receiveAudio);\n\t}\n\tget localStream() {\n\t\treturn this.options.localStreamController.localStream;\n\t}\n\tget inputAudioDeviceConstraints() {\n\t\treturn this.options.getInputAudioDeviceConstraints();\n\t}\n\tget inputVideoDeviceConstraints() {\n\t\treturn this.options.getInputVideoDeviceConstraints();\n\t}\n\tget audioDirection() {\n\t\tif (this.isAdditionalDevice) return \"sendonly\";\n\t\tconst { localStream } = this;\n\t\tconst hasAudioTrack = localStream?.getAudioTracks().some((track) => track.enabled);\n\t\tconst wantsToSendAudio = Boolean(this.inputAudioDeviceConstraints);\n\t\tconst wantsToReceiveAudio = Boolean(this.receiveAudio);\n\t\treturn getDirection(hasAudioTrack || wantsToSendAudio, wantsToReceiveAudio);\n\t}\n\tget videoDirection() {\n\t\tif (this.isAdditionalDevice || this.isScreenShare) return \"sendonly\";\n\t\tif (this.isSFU) return \"recvonly\";\n\t\tconst { localStream } = this;\n\t\tconst hasVideoTrack = localStream?.getVideoTracks().some((track) => track.enabled);\n\t\tconst wantsToSendVideo = Boolean(this.inputVideoDeviceConstraints);\n\t\tconst wantsToReceiveVideo = Boolean(this.receiveVideo);\n\t\treturn getDirection(hasVideoTrack || wantsToSendVideo, wantsToReceiveVideo);\n\t}\n\tget sendEncodings() {\n\t\tif (!this.isSimulcast) return;\n\t\treturn [\n\t\t\t\"0\",\n\t\t\t\"1\",\n\t\t\t\"2\"\n\t\t].map((rid) => ({\n\t\t\tactive: true,\n\t\t\trid,\n\t\t\tscaleResolutionDownBy: Number(rid) * 6 || 1\n\t\t}));\n\t}\n\tgetConstraintsFor(kind) {\n\t\tconst constraints = kind === \"audio\" ? this.inputAudioDeviceConstraints : this.inputVideoDeviceConstraints;\n\t\treturn typeof constraints === \"boolean\" ? {} : constraints;\n\t}\n\ttransceiverByKind(kind) {\n\t\treturn this.peerConnection.getTransceivers().filter((t) => kind === \"both\" || t.receiver.track.kind === kind);\n\t}\n\tget audioTransceivers() {\n\t\treturn this.transceiverByKind(\"audio\");\n\t}\n\tget videoTransceivers() {\n\t\treturn this.transceiverByKind(\"video\");\n\t}\n\tasync setupTransceiverSender(track, localStream, transceiver) {\n\t\tconst isAudio = track.kind === \"audio\";\n\t\tconst direction = isAudio ? this.audioDirection : this.videoDirection;\n\t\tconst transceiverParams = {\n\t\t\tdirection,\n\t\t\tsendEncodings: isAudio ? void 0 : this.sendEncodings,\n\t\t\tstreams: direction === \"recvonly\" ? void 0 : [localStream]\n\t\t};\n\t\tlogger$17.debug(`[TransceiverController] Setting up transceiver sender for local ${track.kind} track:`, {\n\t\t\ttransceiver,\n\t\t\ttransceiverParams\n\t\t});\n\t\tif (transceiverParams.direction && [\"sendonly\", \"sendrecv\"].includes(transceiverParams.direction)) if (transceiver) {\n\t\t\tawait transceiver.sender.replaceTrack(track);\n\t\t\ttransceiver.direction = transceiverParams.direction;\n\t\t\tif (transceiverParams.streams?.some((stream) => Boolean(stream))) {\n\t\t\t\tlogger$17.debug(`[TransceiverController] Setting streams for transceiver sender for local ${track.kind} track:`, transceiverParams.streams);\n\t\t\t\ttransceiver.sender.setStreams(...transceiverParams.streams);\n\t\t\t}\n\t\t} else {\n\t\t\tlogger$17.debug(`[TransceiverController] Adding new transceiver for local ${track.kind} track:`, track.id);\n\t\t\tthis.peerConnection.addTransceiver(track, transceiverParams);\n\t\t}\n\t}\n\tstopTrackSender(kind, options = { updateTransceiverDirection: false }) {\n\t\ttry {\n\t\t\tconst transceivers = this.transceiverByKind(kind);\n\t\t\tfor (const transceiver of transceivers) if (transceiver.sender.track?.readyState === \"live\") {\n\t\t\t\tconst trackId = transceiver.sender.track.id;\n\t\t\t\ttransceiver.sender.track.stop();\n\t\t\t\tthis.options.localStreamController.removeTrack(trackId);\n\t\t\t\tif (options.updateTransceiverDirection) transceiver.direction = \"inactive\";\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlogger$17.error(\"[TransceiverController] stopTrackSender error\", kind, error);\n\t\t\tthis.options.onError?.(new MediaTrackError(\"stopTrackSender\", kind, error));\n\t\t}\n\t}\n\tasync restoreTrackSender(kind) {\n\t\ttry {\n\t\t\tlogger$17.debug(\"[TransceiverController] restoreTrackSender called\", kind);\n\t\t\tconst constraints = {};\n\t\t\tconst transceivers = this.transceiverByKind(kind);\n\t\t\tfor (const transceiver of transceivers) {\n\t\t\t\tconst { track } = transceiver.sender;\n\t\t\t\tif (!track || track.readyState === \"ended\") {\n\t\t\t\t\tconst trackKind = track?.kind ?? transceiver.receiver.track.kind;\n\t\t\t\t\tif (trackKind === \"audio\" || trackKind === \"video\") constraints[trackKind] = this.getConstraintsFor(trackKind);\n\t\t\t\t}\n\t\t\t}\n\t\t\tlogger$17.debug(\"[TransceiverController] restoreTrackSender constraints:\", constraints);\n\t\t\tif (Object.keys(constraints).length === 0) {\n\t\t\t\tlogger$17.warn(\"[TransceiverController] restoreTrackSender: no tracks need restoration\", kind);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst newTracks = (await this.options.getUserMedia(constraints)).getTracks();\n\t\t\tlogger$17.debug(\"[TransceiverController] restoreTrackSender new tracks:\", newTracks);\n\t\t\tfor (const newTrack of newTracks) {\n\t\t\t\tthis.options.localStreamController.addTrack(newTrack);\n\t\t\t\tconst trackKind = newTrack.kind;\n\t\t\t\tconst transceiverOfKind = this.transceiverByKind(trackKind)[0];\n\t\t\t\ttransceiverOfKind.direction = trackKind === \"audio\" ? this.audioDirection : this.videoDirection;\n\t\t\t\tlogger$17.debug(\"[TransceiverController] restoreTrackSender setting direction for\", trackKind, transceiverOfKind.direction);\n\t\t\t\tawait transceiverOfKind.sender.replaceTrack(newTrack);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlogger$17.error(\"[TransceiverController] restoreTrackSender error\", kind, error);\n\t\t\tthis.options.onError?.(new MediaTrackError(\"restoreTrackSender\", kind, error));\n\t\t}\n\t}\n\tasync replaceSenderTrack(kind, track) {\n\t\tconst transceivers = kind === \"audio\" ? this.audioTransceivers : this.videoTransceivers;\n\t\tfor (const transceiver of transceivers) await transceiver.sender.replaceTrack(track);\n\t}\n\tasync setupRemoteTransceivers(type) {\n\t\tif (type === \"answer\") return;\n\t\tfor (const kind of [\"audio\", \"video\"]) {\n\t\t\tconst transceivers = kind === \"audio\" ? this.audioTransceivers : this.videoTransceivers;\n\t\t\tfor (const transceiver of transceivers) {\n\t\t\t\tconst direction = kind === \"audio\" ? this.audioDirection : this.videoDirection;\n\t\t\t\tif ([\"inactive\", \"recvonly\"].includes(direction)) {\n\t\t\t\t\ttransceiver.direction = direction;\n\t\t\t\t\tawait transceiver.sender.replaceTrack(null);\n\t\t\t\t\ttransceiver.sender.setStreams();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (this.videoDirection === \"recvonly\" && this.isSFU && this.useAddTransceivers) {\n\t\t\tconst { msStreamsNumber = 5 } = this.options;\n\t\t\tfor (let i = 0; i < Number(msStreamsNumber); i++) this.peerConnection.addTransceiver(\"video\", { direction: \"recvonly\" });\n\t\t}\n\t}\n\tasync updateSendersConstraints(kind, constraints) {\n\t\tif (!constraints) {\n\t\t\tthis.stopTrackSender(kind);\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\tconst senders = this.peerConnection.getSenders().filter((sender) => sender.track?.kind === kind && sender.track.readyState === \"live\");\n\t\tfor (const sender of senders) {\n\t\t\tconst { track } = sender;\n\t\t\tif (track) {\n\t\t\t\tconst constraintsToApply = {\n\t\t\t\t\t...track.getConstraints(),\n\t\t\t\t\t...constraints\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\tawait track.applyConstraints(constraintsToApply);\n\t\t\t\t\tlogger$17.debug(`[TransceiverController] Updated ${kind} sender constraints:`, constraintsToApply);\n\t\t\t\t\tlogger$17.debug(`[TransceiverController] Updated ${kind} sender constraints:`, track.getConstraints());\n\t\t\t\t} catch (error) {\n\t\t\t\t\tlogger$17.warn(`[TransceiverController] applyConstraints failed for ${kind} track ${track.id}, attempting track replacement fallback:`, error);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.replaceTrackFallback(sender, track, kind, constraintsToApply);\n\t\t\t\t\t} catch (fallbackError) {\n\t\t\t\t\t\tlogger$17.warn(`[TransceiverController] Track replacement fallback also failed for ${kind} track:`, fallbackError);\n\t\t\t\t\t\tthis.options.onError?.(new MediaTrackError(\"updateSendersConstraints\", kind, fallbackError));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* Fallback when applyConstraints fails: stop the current track, acquire a new\n\t* one via getUserMedia with the merged constraints (preserving the current\n\t* deviceId), replace the sender track, and update the localStream.\n\t*\n\t* This is critical for iOS Safari where applyConstraints on audio tracks\n\t* silently fails or throws.\n\t*/\n\tasync replaceTrackFallback(sender, oldTrack, kind, mergedConstraints) {\n\t\tconst { deviceId } = oldTrack.getSettings();\n\t\tconst constraintsWithDevice = {\n\t\t\t...mergedConstraints,\n\t\t\t...deviceId ? { deviceId: { exact: deviceId } } : {}\n\t\t};\n\t\tconst trackId = oldTrack.id;\n\t\toldTrack.stop();\n\t\tthis.options.localStreamController.removeTrack(trackId);\n\t\tconst newTrack = (await this.options.getUserMedia({ [kind]: constraintsWithDevice })).getTracks().find((t) => t.kind === kind);\n\t\tif (!newTrack) throw new MediaTrackError(\"replaceTrackFallback\", kind, /* @__PURE__ */ new Error(\"getUserMedia returned no track of the requested kind\"));\n\t\tawait sender.replaceTrack(newTrack);\n\t\tthis.options.localStreamController.addTrack(newTrack);\n\t\tlogger$17.debug(`[TransceiverController] Track replacement fallback succeeded for ${kind}. New track: ${newTrack.id}`);\n\t}\n\tgetMediaDirections() {\n\t\tif (this.peerConnection.connectionState === \"connected\") return this.peerConnection.getTransceivers().reduce((acc, transceiver) => {\n\t\t\treturn {\n\t\t\t\t...acc,\n\t\t\t\t[transceiver.receiver.track.kind]: transceiver.direction\n\t\t\t};\n\t\t}, {\n\t\t\taudio: \"inactive\",\n\t\t\tvideo: \"inactive\"\n\t\t});\n\t\treturn {\n\t\t\taudio: this.audioDirection,\n\t\t\tvideo: this.videoDirection\n\t\t};\n\t}\n\tupdatePeerConnection(peerConnection) {\n\t\tthis.peerConnection = peerConnection;\n\t}\n\tupdateOptions(options) {\n\t\tthis.options = {\n\t\t\t...this.options,\n\t\t\t...options\n\t\t};\n\t}\n};\n\n//#endregion\n//#region src/controllers/RTCPeerConnectionController.ts\nconst logger$16 = getLogger();\nvar RTCPeerConnectionController = class extends Destroyable {\n\tconstructor(options = {}, remoteSessionDescription, deviceController) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.firstSDPExchangeCompleted = false;\n\t\tthis.negotiationNeeded$ = this.createSubject();\n\t\tthis.localDescription$ = defer(() => from(this.init())).pipe(switchMap(() => this.iceGatheringController.iceCandidatesState$.pipe(filter((iceCandidateState) => ![\"new\", \"gathering\"].includes(iceCandidateState)), tap(() => {\n\t\t\tthis.negotiationEnded();\n\t\t}), filter(() => this.shouldEmitLocalDescription), map(() => this.peerConnection?.localDescription), filterNull(), tap((desc) => {\n\t\t\tif (desc.type === \"answer\") this._type = \"offer\";\n\t\t}))), shareReplay(1), takeUntil(this.destroyed$));\n\t\tthis.connectionTimeout = 3e3;\n\t\tthis.oniceconnectionstatechangeHandler = () => {\n\t\t\tif (this.peerConnection) {\n\t\t\t\tconst { iceConnectionState } = this.peerConnection;\n\t\t\t\tlogger$16.debug(`[RTCPeerConnectionController] ICE connection state changed to: ${iceConnectionState}`);\n\t\t\t\tthis._iceConnectionState$.next(this.peerConnection.iceConnectionState);\n\t\t\t}\n\t\t};\n\t\tthis.onconnectionstatechangeHandler = () => {\n\t\t\tif (this.peerConnection) {\n\t\t\t\tconst { connectionState } = this.peerConnection;\n\t\t\t\tlogger$16.debug(`[RTCPeerConnectionController] Connection state changed to: ${connectionState}`);\n\t\t\t\tif (connectionState === \"connected\") this.removeConnectionTimer();\n\t\t\t\tthis._connectionState$.next(this.peerConnection.connectionState);\n\t\t\t}\n\t\t};\n\t\tthis.onsignalingstatechangeHandler = () => {\n\t\t\tlogger$16.debug(`[RTCPeerConnectionController] Signaling state changed to: ${this.peerConnection?.signalingState}`);\n\t\t};\n\t\tthis.onicegatheringstatechangeHandler = () => {\n\t\t\tif (this.peerConnection) this._iceGatheringState$.next(this.peerConnection.iceGatheringState);\n\t\t};\n\t\tthis.onnegotiationneededHandler = (event) => {\n\t\t\tlogger$16.debug(\"[RTCPeerConnectionController] Negotiation needed event received.\", event);\n\t\t\tthis.negotiationNeeded$.next();\n\t\t};\n\t\tthis.updateSelectedInputDevice = async (kind, deviceInfo) => {\n\t\t\ttry {\n\t\t\t\tconst { localStream } = this;\n\t\t\t\tif (!localStream) {\n\t\t\t\t\tlogger$16.warn(\"[RTCPeerConnectionController] No local stream available to update input device.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlogger$16.debug(`[RTCPeerConnectionController] Updating selected ${kind} input device:`, localStream.getTracks());\n\t\t\t\tconst track = localStream.getTracks().find((track$1) => track$1.kind === kind);\n\t\t\t\tif (track) {\n\t\t\t\t\tthis.transceiverController?.stopTrackSender(kind);\n\t\t\t\t\tthis.localStreamController.removeTrack(track.id);\n\t\t\t\t\tlogger$16.debug(`[RTCPeerConnectionController] Stopped existing ${kind} track: ${track.id}`, localStream.getTracks());\n\t\t\t\t\tif (!deviceInfo) {\n\t\t\t\t\t\tlogger$16.debug(`[RTCPeerConnectionController] ${kind} input device selected: none`);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst streamTrack = (await this.getUserMedia({ [kind]: {\n\t\t\t\t\t\t...track.getConstraints(),\n\t\t\t\t\t\t...this.deviceController.deviceInfoToConstraints(deviceInfo)\n\t\t\t\t\t} })).getTracks().find((t) => t.kind === kind);\n\t\t\t\t\tif (streamTrack) {\n\t\t\t\t\t\tlogger$16.debug(`[RTCPeerConnectionController] Adding new ${kind} track: ${streamTrack.id}`);\n\t\t\t\t\t\tthis.localStreamController.addTrack(streamTrack);\n\t\t\t\t\t\tawait this.transceiverController?.replaceSenderTrack(kind, streamTrack);\n\t\t\t\t\t\tlogger$16.debug(`[RTCPeerConnectionController] Added new ${kind} track: ${streamTrack.id}`, this.localStream?.getTracks());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlogger$16.debug(`[RTCPeerConnectionController] ${kind} input device selected:`, deviceInfo?.label);\n\t\t\t} catch (error) {\n\t\t\t\tlogger$16.error(`[RTCPeerConnectionController] Failed to select ${kind} input device:`, error);\n\t\t\t\tthis._errors$.next(toError(error));\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t};\n\t\tthis._isNegotiating$ = this.createBehaviorSubject(false);\n\t\tthis._memberId = null;\n\t\tthis._iceConnectionState$ = this.createReplaySubject(1);\n\t\tthis._connectionState$ = this.createReplaySubject(1);\n\t\tthis._signalingState$ = this.createReplaySubject(1);\n\t\tthis._iceGatheringState$ = this.createReplaySubject(1);\n\t\tthis._errors$ = this.createReplaySubject(1);\n\t\tthis._iceCandidates$ = this.createReplaySubject(1);\n\t\tthis._initialized$ = this.createReplaySubject(1);\n\t\tthis._remoteDescription$ = this.createReplaySubject(1);\n\t\tthis._remoteStream$ = this.createBehaviorSubject(null);\n\t\tthis._remoteOfferMediaDirections = null;\n\t\tthis._localAudioPipeline = null;\n\t\tthis.deviceController = deviceController ?? {};\n\t\tthis.id = options.callId ?? v4();\n\t\tthis._type = remoteSessionDescription ? \"answer\" : \"offer\";\n\t\tthis.sdpInit = remoteSessionDescription ? {\n\t\t\ttype: \"offer\",\n\t\t\tsdp: remoteSessionDescription\n\t\t} : void 0;\n\t\tthis._remoteOfferMediaDirections = remoteSessionDescription ? extractMediaDirectionsFromSDP(remoteSessionDescription) : null;\n\t\tconst offerDefaults = this._remoteOfferMediaDirections ? {\n\t\t\taudio: this._remoteOfferMediaDirections.audio.includes(\"recv\"),\n\t\t\tvideo: this._remoteOfferMediaDirections.video.includes(\"recv\"),\n\t\t\treceiveAudio: this._remoteOfferMediaDirections.audio.includes(\"send\"),\n\t\t\treceiveVideo: this._remoteOfferMediaDirections.video.includes(\"send\")\n\t\t} : {};\n\t\tthis.options = {\n\t\t\t...options,\n\t\t\taudio: options.audio ?? offerDefaults.audio,\n\t\t\tvideo: options.video ?? offerDefaults.video,\n\t\t\treceiveAudio: options.receiveAudio ?? offerDefaults.receiveAudio ?? PreferencesContainer.instance.receiveAudio,\n\t\t\treceiveVideo: options.receiveVideo ?? offerDefaults.receiveVideo ?? PreferencesContainer.instance.receiveVideo\n\t\t};\n\t\tthis.localStreamController = new LocalStreamController({\n\t\t\tpropose: this.propose,\n\t\t\tinputAudioStream: this.options.inputAudioStream,\n\t\t\tinputVideoStream: this.options.inputVideoStream,\n\t\t\tinputAudioDeviceConstraints: this.inputAudioDeviceConstraints,\n\t\t\tinputVideoDeviceConstraints: this.inputVideoDeviceConstraints,\n\t\t\tgetUserMedia: async (constraints) => this.getUserMedia(constraints),\n\t\t\tgetDisplayMedia: async (options$1) => this.getDisplayMedia(options$1)\n\t\t});\n\t}\n\tget iceGatheringController() {\n\t\tif (!this._iceGatheringController) throw new DependencyError(\"ICEGatheringController is not initialized\");\n\t\treturn this._iceGatheringController;\n\t}\n\tget shouldEmitLocalDescription() {\n\t\tif (!this.peerConnection) return false;\n\t\tconst { localDescription, signalingState } = this.peerConnection;\n\t\tif (!localDescription || !isValidLocalDescription(localDescription.sdp)) return false;\n\t\treturn localDescription.type === \"offer\" && signalingState === \"have-local-offer\" || localDescription.type === \"answer\" && signalingState === \"stable\";\n\t}\n\tremoveConnectionTimer() {\n\t\tif (this.connectionTimer) {\n\t\t\tclearTimeout(this.connectionTimer);\n\t\t\tthis.connectionTimer = void 0;\n\t\t}\n\t}\n\tsetMemberId(memberId) {\n\t\tthis._memberId = memberId;\n\t}\n\tget memberId() {\n\t\treturn this._memberId;\n\t}\n\tstopTrackSender(kind, options = { updateTransceiverDirection: false }) {\n\t\tthis.transceiverController?.stopTrackSender(kind, options);\n\t}\n\tget isNegotiating$() {\n\t\treturn this._isNegotiating$.asObservable();\n\t}\n\tget isNegotiating() {\n\t\treturn this._isNegotiating$.value;\n\t}\n\tupdateMediaDevicesOptions(options) {\n\t\tthis.options = {\n\t\t\t...this.options,\n\t\t\t...options\n\t\t};\n\t}\n\tget iceGatheringState$() {\n\t\treturn this.cachedObservable(\"iceGatheringState$\", () => this._iceGatheringState$.asObservable().pipe(takeUntil(this.destroyed$)));\n\t}\n\tget mediaTrackEnded$() {\n\t\treturn this.cachedObservable(\"mediaTrackEnded$\", () => this.localStreamController.mediaTrackEnded$.pipe(takeUntil(this.destroyed$)));\n\t}\n\tget errors$() {\n\t\treturn this.cachedObservable(\"errors$\", () => this._errors$.asObservable().pipe(takeUntil(this.destroyed$)));\n\t}\n\tget iceCandidates$() {\n\t\treturn this.cachedObservable(\"iceCandidates$\", () => this._iceCandidates$.asObservable().pipe(takeUntil(this.destroyed$)));\n\t}\n\tget initialized$() {\n\t\treturn this.cachedObservable(\"initialized$\", () => this._initialized$.asObservable().pipe(filter((initialized) => initialized), takeUntil(this.destroyed$)));\n\t}\n\tget remoteDescription$() {\n\t\treturn this.cachedObservable(\"remoteDescription$\", () => this._remoteDescription$.asObservable().pipe(takeUntil(this.destroyed$)));\n\t}\n\tget localStream$() {\n\t\treturn this.cachedObservable(\"localStream$\", () => this.localStreamController.localStream$.pipe(takeUntil(this.destroyed$)));\n\t}\n\tget remoteStream$() {\n\t\treturn this.cachedObservable(\"remoteStream$\", () => this._remoteStream$.asObservable().pipe(takeUntil(this.destroyed$)));\n\t}\n\tget localAudioTracks$() {\n\t\treturn this.cachedObservable(\"localAudioTracks$\", () => this.localStreamController.localAudioTracks$.pipe(takeUntil(this.destroyed$)));\n\t}\n\tget localVideoTracks$() {\n\t\treturn this.cachedObservable(\"localVideoTracks$\", () => this.localStreamController.localVideoTracks$.pipe(takeUntil(this.destroyed$)));\n\t}\n\tget iceConnectionState$() {\n\t\treturn this.cachedObservable(\"iceConnectionState$\", () => this._iceConnectionState$.asObservable().pipe(takeUntil(this.destroyed$)));\n\t}\n\tget connectionState$() {\n\t\treturn this.cachedObservable(\"connectionState$\", () => this._connectionState$.asObservable().pipe(takeUntil(this.destroyed$)));\n\t}\n\tget signalingState$() {\n\t\treturn this.cachedObservable(\"signalingState$\", () => this._signalingState$.asObservable().pipe(takeUntil(this.destroyed$)));\n\t}\n\tget type() {\n\t\treturn this._type;\n\t}\n\tget propose() {\n\t\treturn this.options.propose ?? \"main\";\n\t}\n\tget isAdditionalDevice() {\n\t\treturn this.propose === \"additional-device\";\n\t}\n\tget isMainDevice() {\n\t\treturn this.propose === \"main\";\n\t}\n\tget isScreenShare() {\n\t\treturn this.propose === \"screenshare\";\n\t}\n\tget iceServers() {\n\t\tif (!this.options.disableUdpIceServers) return this.options.iceServers ?? [];\n\t\tconst tcpTransportParam = \"transport=tcp\";\n\t\treturn (this.options.iceServers ?? []).map((server) => {\n\t\t\tconst urls = Array.isArray(server.urls) ? server.urls : [server.urls];\n\t\t\treturn {\n\t\t\t\t...server,\n\t\t\t\turls: urls.filter((url) => url.includes(tcpTransportParam))\n\t\t\t};\n\t\t});\n\t}\n\tget rtcConfiguration() {\n\t\tconst { iceServers: _iceServers, ...restOptions } = this.options;\n\t\treturn {\n\t\t\tbundlePolicy: \"max-compat\",\n\t\t\ticeCandidatePoolSize: 10,\n\t\t\ticeServers: this.iceServers,\n\t\t\ticeTransportPolicy: this.options.relayOnly ? \"relay\" : \"all\",\n\t\t\tsdpSemantics: \"unified-plan\",\n\t\t\t...restOptions\n\t\t};\n\t}\n\tget receiveVideo() {\n\t\treturn Boolean(this.options.receiveVideo);\n\t}\n\tget receiveAudio() {\n\t\treturn Boolean(this.options.receiveAudio);\n\t}\n\tget localStream() {\n\t\treturn this.localStreamController.localStream;\n\t}\n\tget remoteStream() {\n\t\treturn this._remoteStream$.value;\n\t}\n\tget inputAudioDeviceConstraints() {\n\t\tif (this.options.audio === false && !this.options.inputAudioDeviceConstraints) return false;\n\t\tconst deviceConstraints = this.deviceController.selectedAudioInputDeviceConstraints;\n\t\tif (deviceConstraints === false) return false;\n\t\tconst audioBase = typeof this.options.inputAudioDeviceConstraints === \"object\" ? this.options.inputAudioDeviceConstraints : {};\n\t\tconst audioDevice = typeof deviceConstraints === \"object\" ? deviceConstraints : {};\n\t\treturn {\n\t\t\t...audioBase,\n\t\t\t...audioDevice\n\t\t};\n\t}\n\tget inputVideoDeviceConstraints() {\n\t\tif (!this.options.video && !this.options.inputVideoDeviceConstraints) return false;\n\t\tconst deviceConstraints = this.deviceController.selectedVideoInputDeviceConstraints;\n\t\tif (deviceConstraints === false) return false;\n\t\tconst videoBase = typeof this.options.inputVideoDeviceConstraints === \"object\" ? this.options.inputVideoDeviceConstraints : {};\n\t\tconst videoDevice = typeof deviceConstraints === \"object\" ? deviceConstraints : {};\n\t\treturn {\n\t\t\t...videoBase,\n\t\t\t...videoDevice\n\t\t};\n\t}\n\tget WebRTCPeerConnectionConstructor() {\n\t\treturn this.options.webRTCApiProvider?.RTCPeerConnection ?? RTCPeerConnection;\n\t}\n\tget offerOptions() {\n\t\tconst options = { iceRestart: this.firstSDPExchangeCompleted ? true : void 0 };\n\t\tswitch (this.propose) {\n\t\t\tcase \"screenshare\":\n\t\t\tcase \"additional-device\": return {\n\t\t\t\t...options,\n\t\t\t\tofferToReceiveAudio: false,\n\t\t\t\tofferToReceiveVideo: false\n\t\t\t};\n\t\t\tcase \"main\":\n\t\t\tdefault: return {\n\t\t\t\t...options,\n\t\t\t\tofferToReceiveAudio: true,\n\t\t\t\tofferToReceiveVideo: this.options.receiveVideo ?? Boolean(this.inputVideoDeviceConstraints)\n\t\t\t};\n\t\t}\n\t}\n\tget answerOptions() {\n\t\treturn { iceRestart: this.firstSDPExchangeCompleted ? true : void 0 };\n\t}\n\t/**\n\t* Initialize the RTCPeerConnection and setup event listeners.\n\t* Called automatically when localDescription$ is subscribed to (deferred pattern).\n\t* Uses Promise memoization to ensure initialization only happens once,\n\t* even if called concurrently.\n\t*/\n\tasync init() {\n\t\tthis.initPromise ??= this.doInit();\n\t\treturn this.initPromise;\n\t}\n\t/**\n\t* Internal initialization implementation.\n\t* Should only be called via init() to ensure single execution.\n\t*/\n\tasync doInit() {\n\t\ttry {\n\t\t\tthis.setupPeerConnection();\n\t\t\tthis.subscribeTo(this.negotiationNeeded$.pipe(auditTime(0), exhaustMap(async () => this.startNegotiation())), {\n\t\t\t\tnext: () => {\n\t\t\t\t\tlogger$16.debug(\"[RTCPeerConnectionController] Start Negotiation completed successfully\");\n\t\t\t\t},\n\t\t\t\terror: (error) => {\n\t\t\t\t\tlogger$16.error(\"[RTCPeerConnectionController] Start Negotiation error:\", error);\n\t\t\t\t\tthis._errors$.next(toError(error));\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.subscribeTo(merge(this.deviceController.selectedAudioInputDevice$.pipe(map((deviceInfo) => [\"audio\", deviceInfo])), this.deviceController.selectedVideoInputDevice$.pipe(map((deviceInfo) => [\"video\", deviceInfo]))).pipe(skipWhile(() => !this.localStreamController.localStream)), async ([kind, deviceInfo]) => {\n\t\t\t\tlogger$16.debug(`[RTCPeerConnectionController] Selected input device changed for:`, {\n\t\t\t\t\tkind,\n\t\t\t\t\tdeviceInfo\n\t\t\t\t});\n\t\t\t\tawait this.updateSelectedInputDevice(kind, deviceInfo);\n\t\t\t});\n\t\t\tif (this.type === \"answer\" && this.sdpInit) {\n\t\t\t\tawait this.setupRemoteTracks();\n\t\t\t\tthis._initialized$.next(true);\n\t\t\t\tthis.setupEventListeners();\n\t\t\t\tthis._isNegotiating$.next(true);\n\t\t\t\tawait this._setRemoteDescription(this.sdpInit);\n\t\t\t} else {\n\t\t\t\tawait this.setupTrackHandling();\n\t\t\t\tthis._initialized$.next(true);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlogger$16.error(\"[RTCPeerConnectionController] Initialization error:\", error);\n\t\t\tthis._errors$.next(toError(error));\n\t\t\tthis.destroy();\n\t\t}\n\t}\n\tsetupPeerConnection() {\n\t\tthis.peerConnection = new this.WebRTCPeerConnectionConstructor(this.rtcConfiguration);\n\t\tthis.peerConnection.addEventListener(\"negotiationneeded\", this.onnegotiationneededHandler);\n\t\tthis._iceGatheringController = new ICEGatheringController(this.peerConnection, this.isNegotiating$, {\n\t\t\ticeCandidateTimeout: this.options.iceCandidateTimeout,\n\t\t\ticeGatheringTimeout: this.options.iceGatheringTimeout,\n\t\t\trelayOnly: this.options.relayOnly\n\t\t});\n\t\tthis.transceiverController = new TransceiverController({\n\t\t\tpeerConnection: this.peerConnection,\n\t\t\tpropose: this.propose,\n\t\t\tsimulcast: this.options.simulcast,\n\t\t\tsfu: this.options.sfu,\n\t\t\tmsStreamsNumber: this.options.msStreamsNumber,\n\t\t\treceiveAudio: this.receiveAudio,\n\t\t\treceiveVideo: this.receiveVideo,\n\t\t\tlocalStreamController: this.localStreamController,\n\t\t\tgetInputAudioDeviceConstraints: () => this.inputAudioDeviceConstraints,\n\t\t\tgetInputVideoDeviceConstraints: () => this.inputVideoDeviceConstraints,\n\t\t\tgetUserMedia: async (constraints) => this.getUserMedia(constraints),\n\t\t\tonError: (error) => {\n\t\t\t\tthis._errors$.next(error);\n\t\t\t}\n\t\t});\n\t}\n\tasync startNegotiation() {\n\t\tif (this.isNegotiating) {\n\t\t\tlogger$16.debug(\"[RTCPeerConnectionController] Negotiation already in progress, skipping.\");\n\t\t\treturn;\n\t\t}\n\t\tthis.setupEventListeners();\n\t\tif (this.type === \"answer\") {\n\t\t\tlogger$16.debug(\"[RTCPeerConnectionController] This is an answer type still, skipping offer creation.\");\n\t\t\treturn;\n\t\t}\n\t\tthis._isNegotiating$.next(true);\n\t\tlogger$16.debug(\"[RTCPeerConnectionController] Starting negotiation.\");\n\t\ttry {\n\t\t\tconst { offerOptions } = this;\n\t\t\tlogger$16.debug(\"[RTCPeerConnectionController] Creating offer with options:\", offerOptions);\n\t\t\tawait this.createOffer(offerOptions);\n\t\t} catch (error) {\n\t\t\tlogger$16.error(\"[RTCPeerConnectionController] Error during negotiation:\", error);\n\t\t\tthis._errors$.next(toError(error));\n\t\t}\n\t}\n\t/**\n\t* Create an SDP offer and set it as local description.\n\t*/\n\tasync createOffer(options) {\n\t\tif (!this.peerConnection) throw new DependencyError(\"RTCPeerConnection is not initialized\");\n\t\tconst offer = await this.peerConnection.createOffer(options);\n\t\tawait this.setLocalDescription(offer);\n\t}\n\tasync updateAnswerStatus({ status, sdp }) {\n\t\tlet readyToConnect = status !== \"failed\";\n\t\ttry {\n\t\t\tif (status === \"received\" && sdp) {\n\t\t\t\tlogger$16.debug(\"[RTCPeerConnectionController] Received answer SDP:\", sdp);\n\t\t\t\tawait this._setRemoteDescription({\n\t\t\t\t\ttype: \"answer\",\n\t\t\t\t\tsdp\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlogger$16.error(\"[RTCPeerConnectionController] Error updating answer status:\", error);\n\t\t\tthis._errors$.next(toError(error));\n\t\t\treadyToConnect = false;\n\t\t} finally {\n\t\t\tif (readyToConnect) this.readyToConnect();\n\t\t\telse this.iceGatheringController.restartICEGatheringWithRelayOnly();\n\t\t}\n\t}\n\tasync updateOfferStatus({ status, sdp }) {\n\t\tswitch (status) {\n\t\t\tcase \"received\":\n\t\t\t\tthis._type = \"answer\";\n\t\t\t\tthis.sdpInit = {\n\t\t\t\t\ttype: \"offer\",\n\t\t\t\t\tsdp\n\t\t\t\t};\n\t\t\t\tawait this.handleOfferReceived();\n\t\t\t\tbreak;\n\t\t\tcase \"failed\":\n\t\t\t\tlogger$16.error(\"[RTCPeerConnectionController] Offer failed to be processed by remote.\");\n\t\t\t\tbreak;\n\t\t\tcase \"sent\":\n\t\t\tdefault:\n\t\t}\n\t}\n\t/**\n\t* Accept an inbound call by creating the SDP answer.\n\t* Optionally override media options before the answer is generated.\n\t* Must be called after initialization for inbound (answer-type) connections.\n\t*/\n\tasync acceptInbound(mediaOverrides) {\n\t\tif (mediaOverrides) {\n\t\t\tconst { audio, video, receiveAudio, receiveVideo } = mediaOverrides;\n\t\t\tthis.options = {\n\t\t\t\t...this.options,\n\t\t\t\t...audio !== void 0 ? { audio } : {},\n\t\t\t\t...video !== void 0 ? { video } : {},\n\t\t\t\t...receiveAudio !== void 0 ? { receiveAudio } : {},\n\t\t\t\t...receiveVideo !== void 0 ? { receiveVideo } : {}\n\t\t\t};\n\t\t\tthis.transceiverController?.updateOptions({\n\t\t\t\treceiveAudio: this.receiveAudio,\n\t\t\t\treceiveVideo: this.receiveVideo\n\t\t\t});\n\t\t\tthis.localStreamController.updateOptions({\n\t\t\t\tinputAudioDeviceConstraints: this.inputAudioDeviceConstraints,\n\t\t\t\tinputVideoDeviceConstraints: this.inputVideoDeviceConstraints\n\t\t\t});\n\t\t}\n\t\tawait this.setupLocalTracks();\n\t\tconst { answerOptions } = this;\n\t\tlogger$16.debug(\"[RTCPeerConnectionController] Creating inbound answer with options:\", answerOptions);\n\t\tawait this.createAnswer(answerOptions);\n\t}\n\tasync handleOfferReceived() {\n\t\tif (!this.sdpInit) throw new DependencyError(\"SDP initialization parameters are not set\");\n\t\tthis._isNegotiating$.next(true);\n\t\tawait this._setRemoteDescription(this.sdpInit);\n\t\tconst { answerOptions } = this;\n\t\tlogger$16.debug(\"[RTCPeerConnectionController] Creating answer with options:\", answerOptions);\n\t\tawait this.createAnswer(answerOptions);\n\t}\n\treadyToConnect() {\n\t\tthis.firstSDPExchangeCompleted = true;\n\t\tthis.connectionTimer = setTimeout(() => {\n\t\t\tthis.removeConnectionTimer();\n\t\t\tif (this.peerConnection?.connectionState !== \"connected\") {\n\t\t\t\tlogger$16.debug(\"[RTCPeerConnectionController] Connection timeout, restarting ICE gathering with relay only.\");\n\t\t\t\tthis.iceGatheringController.restartICEGatheringWithRelayOnly();\n\t\t\t}\n\t\t}, this.connectionTimeout);\n\t}\n\tasync setRemoteDescriptionBefore(sdp = \"\") {\n\t\treturn Promise.resolve(sdp);\n\t}\n\tasync setLocalDescription(params) {\n\t\tconst finalLocal = await this.setLocalDescriptionBefore(params.sdp);\n\t\treturn this.peerConnection?.setLocalDescription({\n\t\t\t...params,\n\t\t\tsdp: finalLocal\n\t\t});\n\t}\n\tasync setLocalDescriptionBefore(sdp = \"\") {\n\t\tlet result = sdp;\n\t\tconst preferredAudioCodecs = this.options.preferredAudioCodecs ?? PreferencesContainer.instance.preferredAudioCodecs;\n\t\tconst preferredVideoCodecs = this.options.preferredVideoCodecs ?? PreferencesContainer.instance.preferredVideoCodecs;\n\t\tconst stereo = this.options.stereo ?? PreferencesContainer.instance.stereoAudio;\n\t\tif (preferredAudioCodecs.length > 0 || preferredVideoCodecs.length > 0) {\n\t\t\tresult = setCodecPreferences(result, preferredAudioCodecs, preferredVideoCodecs);\n\t\t\tlogger$16.debug(\"[RTCPeerConnectionController] Applied codec preferences to SDP\", {\n\t\t\t\tpreferredAudioCodecs,\n\t\t\t\tpreferredVideoCodecs\n\t\t\t});\n\t\t}\n\t\tif (stereo) {\n\t\t\tresult = enableStereoOpus(result);\n\t\t\tlogger$16.debug(\"[RTCPeerConnectionController] Applied stereo Opus to SDP\");\n\t\t}\n\t\treturn Promise.resolve(result);\n\t}\n\t/**\n\t* Create an SDP answer and set it as local description.\n\t*/\n\tasync createAnswer(options) {\n\t\tif (!this.peerConnection) throw new DependencyError(\"RTCPeerConnection is not initialized\");\n\t\tconst answer = await this.peerConnection.createAnswer(options);\n\t\tawait this.setLocalDescription(answer);\n\t}\n\t/**\n\t* Setup event listeners on RTCPeerConnection for state changes.\n\t*/\n\tsetupEventListeners() {\n\t\tif (!this.peerConnection) throw new DependencyError(\"RTCPeerConnection is not initialized\");\n\t\tthis._iceConnectionState$.next(this.peerConnection.iceConnectionState);\n\t\tthis._connectionState$.next(this.peerConnection.connectionState);\n\t\tthis._signalingState$.next(this.peerConnection.signalingState);\n\t\tthis._iceGatheringState$.next(this.peerConnection.iceGatheringState);\n\t\tthis._remoteDescription$.next(this.peerConnection.remoteDescription);\n\t\tthis.peerConnection.removeEventListener(\"icegatheringstatechange\", this.onicegatheringstatechangeHandler);\n\t\tthis.peerConnection.addEventListener(\"icegatheringstatechange\", this.onicegatheringstatechangeHandler);\n\t\tthis.peerConnection.removeEventListener(\"iceconnectionstatechange\", this.oniceconnectionstatechangeHandler);\n\t\tthis.peerConnection.addEventListener(\"iceconnectionstatechange\", this.oniceconnectionstatechangeHandler);\n\t\tthis.peerConnection.removeEventListener(\"connectionstatechange\", this.onconnectionstatechangeHandler);\n\t\tthis.peerConnection.addEventListener(\"connectionstatechange\", this.onconnectionstatechangeHandler);\n\t\tthis.peerConnection.removeEventListener(\"signalingstatechange\", this.onsignalingstatechangeHandler);\n\t\tthis.peerConnection.addEventListener(\"signalingstatechange\", this.onsignalingstatechangeHandler);\n\t}\n\tnegotiationEnded() {\n\t\tthis._isNegotiating$.next(false);\n\t}\n\t/**\n\t* Trigger an ICE restart through the existing negotiation pipeline.\n\t*\n\t* This creates an offer with iceRestart: true and goes through the full\n\t* SDP pipeline (setLocalDescription → ICE gathering → localDescription$ emission).\n\t* The caller should NOT send the SDP manually — the existing\n\t* setupLocalDescriptionHandler in VertoManager will pick up the emission\n\t* from localDescription$ and send it as a verto.modify.\n\t*\n\t* Unlike calling pc.createOffer/setLocalDescription directly, this method:\n\t* - Sets _isNegotiating$ so ICEGatheringController arms its timers\n\t* - Waits for ICE gathering to complete before localDescription$ emits\n\t* - Goes through setLocalDescriptionBefore() for any SDP munging\n\t*/\n\tasync triggerIceRestart(relayOnly) {\n\t\tif (!this.peerConnection) throw new DependencyError(\"RTCPeerConnection is not initialized\");\n\t\tconst policyChanged = relayOnly && !this.options.relayOnly;\n\t\tif (policyChanged) try {\n\t\t\tthis.peerConnection.setConfiguration({\n\t\t\t\t...this.peerConnection.getConfiguration(),\n\t\t\t\ticeTransportPolicy: \"relay\"\n\t\t\t});\n\t\t\tlogger$16.debug(\"[RTCPeerConnectionController] ICE transport policy set to relay-only\");\n\t\t} catch (error) {\n\t\t\tlogger$16.warn(\"[RTCPeerConnectionController] Failed to set relay-only policy:\", error);\n\t\t}\n\t\tthis.setupEventListeners();\n\t\tthis._isNegotiating$.next(true);\n\t\tlogger$16.debug(`[RTCPeerConnectionController] Triggering ICE restart${relayOnly ? \" (relay-only)\" : \"\"}.`);\n\t\ttry {\n\t\t\tconst offer = await this.peerConnection.createOffer({ iceRestart: true });\n\t\t\tawait this.setLocalDescription(offer);\n\t\t} catch (error) {\n\t\t\tlogger$16.error(\"[RTCPeerConnectionController] ICE restart offer failed:\", error);\n\t\t\tthis._errors$.next(toError(error));\n\t\t\tthis.negotiationEnded();\n\t\t\tif (policyChanged) this.restoreIceTransportPolicy();\n\t\t\tthrow error;\n\t\t}\n\t\tif (policyChanged) firstValueFrom(race(this._iceGatheringState$.pipe(filter((state) => state === \"complete\"), take(1)), timer(ICE_GATHERING_COMPLETE_TIMEOUT_MS).pipe(map(() => \"timeout\")))).then(() => this.restoreIceTransportPolicy()).catch((error) => {\n\t\t\tlogger$16.warn(\"[RTCPeerConnectionController] Error waiting for ICE gathering to complete:\", error);\n\t\t\tthis.restoreIceTransportPolicy();\n\t\t});\n\t}\n\trestoreIceTransportPolicy() {\n\t\ttry {\n\t\t\tthis.peerConnection?.setConfiguration({\n\t\t\t\t...this.peerConnection.getConfiguration(),\n\t\t\t\ticeTransportPolicy: this.options.relayOnly ? \"relay\" : \"all\"\n\t\t\t});\n\t\t\tlogger$16.debug(\"[RTCPeerConnectionController] ICE transport policy restored\");\n\t\t} catch (error) {\n\t\t\tlogger$16.warn(\"[RTCPeerConnectionController] Failed to restore ICE transport policy:\", error);\n\t\t}\n\t}\n\t/**\n\t* Setup track handling for remote tracks.\n\t*/\n\tasync setupTrackHandling() {\n\t\tif (!this.peerConnection) throw new DependencyError(\"RTCPeerConnection is not initialized\");\n\t\tawait this.setupLocalTracks();\n\t\tawait this.setupRemoteTracks();\n\t}\n\tasync setupLocalTracks() {\n\t\tlogger$16.debug(\"[RTCPeerConnectionController] Setting up local tracks/transceivers.\");\n\t\tconst localStream = this.localStream ?? await this.localStreamController.buildLocalStream();\n\t\tif (this.transceiverController?.useAddStream ?? false) {\n\t\t\tlogger$16.warn(\"[RTCPeerConnectionController] Using deprecated addStream API to add local stream.\");\n\t\t\tthis.peerConnection?.addStream(localStream);\n\t\t\tif (!this.isNegotiating) {\n\t\t\t\tlogger$16.debug(\"[RTCPeerConnectionController] Forcing negotiationneeded after local tracks setup.\");\n\t\t\t\tthis.negotiationNeeded$.next();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tfor (const kind of [\"audio\", \"video\"]) {\n\t\t\tconst tracks = (kind === \"audio\" ? localStream.getAudioTracks() : localStream.getVideoTracks()).map((track, index) => ({\n\t\t\t\tindex,\n\t\t\t\ttrack\n\t\t\t}));\n\t\t\tfor (const { index, track } of tracks) {\n\t\t\t\tthis.localStreamController.addTrackEndedListener(track);\n\t\t\t\tif (this.transceiverController?.useAddTransceivers ?? false) {\n\t\t\t\t\tconst transceivers = (kind === \"audio\" ? this.transceiverController?.audioTransceivers : this.transceiverController?.videoTransceivers) ?? [];\n\t\t\t\t\tawait this.transceiverController?.setupTransceiverSender(track, localStream, transceivers[index]);\n\t\t\t\t} else {\n\t\t\t\t\tlogger$16.debug(`[RTCPeerConnectionController] Using addTrack for local ${kind} track:`, track.id);\n\t\t\t\t\tthis.peerConnection?.addTrack(track, localStream);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tasync getUserMedia(constraints) {\n\t\treturn (this.options.webRTCApiProvider?.mediaDevices ?? navigator.mediaDevices).getUserMedia(constraints);\n\t}\n\tasync getDisplayMedia(options) {\n\t\tconst mediaDevices = this.options.webRTCApiProvider?.mediaDevices ?? navigator.mediaDevices;\n\t\tif (!mediaDevices.getDisplayMedia) throw new DependencyError(\"getDisplayMedia is not supported by the current WebRTC provider\");\n\t\treturn mediaDevices.getDisplayMedia(options);\n\t}\n\tasync setupRemoteTracks() {\n\t\tif (!this.peerConnection) throw new DependencyError(\"RTCPeerConnection is not initialized\");\n\t\tthis.peerConnection.ontrack = (event) => {\n\t\t\tlogger$16.debug(\"[RTCPeerConnectionController] Remote track received:\", event.track.kind);\n\t\t\tif (event.streams[0]) this._remoteStream$.next(event.streams[0]);\n\t\t\telse {\n\t\t\t\tconst existingTracks = this._remoteStream$.value?.getTracks() ?? [];\n\t\t\t\tconst newStream = new MediaStream([...existingTracks, event.track]);\n\t\t\t\tthis._remoteStream$.next(newStream);\n\t\t\t}\n\t\t};\n\t\tawait this.transceiverController?.setupRemoteTransceivers(this.type);\n\t}\n\tasync restoreTrackSender(kind) {\n\t\tawait this.transceiverController?.restoreTrackSender(kind);\n\t\tif (kind !== \"video\" && this._localAudioPipeline) await this.applyLocalAudioPipelineToSender();\n\t}\n\t/**\n\t* Return the lazily-created {@link LocalAudioPipeline}, constructing it on\n\t* first access. On creation the current audio sender's track is routed\n\t* through the pipeline (input → gain → analyser → destination) and the\n\t* sender is switched to emit the processed track. Returns `null` when no\n\t* audio sender exists yet (pre-negotiation).\n\t*/\n\tensureLocalAudioPipeline() {\n\t\tif (this._localAudioPipeline) return this._localAudioPipeline;\n\t\tif (!this.peerConnection) return null;\n\t\ttry {\n\t\t\tthis._localAudioPipeline = new LocalAudioPipeline();\n\t\t} catch (error) {\n\t\t\tlogger$16.warn(\"[RTCPeerConnectionController] Failed to create LocalAudioPipeline:\", error);\n\t\t\treturn null;\n\t\t}\n\t\tthis.subscribeTo(this.localStreamController.localAudioTracks$, () => {\n\t\t\tthis.applyLocalAudioPipelineToSender();\n\t\t});\n\t\tthis.applyLocalAudioPipelineToSender();\n\t\treturn this._localAudioPipeline;\n\t}\n\t/** The active LocalAudioPipeline, or null if it hasn't been created yet. */\n\tget localAudioPipeline() {\n\t\treturn this._localAudioPipeline;\n\t}\n\tasync applyLocalAudioPipelineToSender() {\n\t\tif (!this._localAudioPipeline || !this.peerConnection) return;\n\t\tconst raw = this.localStreamController.localAudioTracks.at(0);\n\t\tthis._localAudioPipeline.setInputTrack(raw ?? null);\n\t\tconst sender = (this.transceiverController?.audioTransceivers.at(0))?.sender ?? this.peerConnection.getSenders().find((s) => s.track?.kind === \"audio\");\n\t\tif (!sender || !raw) return;\n\t\ttry {\n\t\t\tawait sender.replaceTrack(this._localAudioPipeline.outputTrack);\n\t\t} catch (error) {\n\t\t\tlogger$16.warn(\"[RTCPeerConnectionController] Failed to route audio sender through pipeline:\", error);\n\t\t}\n\t}\n\t/**\n\t* Add a local media track to the peer connection.\n\t* @param track - The MediaStreamTrack to add\n\t*/\n\taddLocalTrack(track) {\n\t\tif (!this.peerConnection) {\n\t\t\tconst error = new DependencyError(\"RTCPeerConnection is not initialized\");\n\t\t\tthis._errors$.next(error);\n\t\t\tthrow error;\n\t\t}\n\t\ttry {\n\t\t\tconst localStream = this.localStreamController.addTrack(track);\n\t\t\tthis.peerConnection.addTrack(track, localStream);\n\t\t\tlogger$16.debug(`[RTCPeerConnectionController] ${track.kind} track added:`, track.id);\n\t\t} catch (error) {\n\t\t\tlogger$16.error(`[RTCPeerConnectionController] Failed to add ${track.kind} track:`, error);\n\t\t\tthis._errors$.next(toError(error));\n\t\t\tthrow error;\n\t\t}\n\t}\n\t/**\n\t* Remove a local media track from the peer connection.\n\t* @param trackId - The ID of the track to remove\n\t*/\n\tremoveLocalTrack(trackId) {\n\t\tif (!this.peerConnection) {\n\t\t\tconst error = new DependencyError(\"RTCPeerConnection is not initialized\");\n\t\t\tthis._errors$.next(error);\n\t\t\tthrow error;\n\t\t}\n\t\tconst sender = this.peerConnection.getSenders().find((sender$1) => sender$1.track?.id === trackId);\n\t\tif (!sender) {\n\t\t\tlogger$16.debug(`[RTCPeerConnectionController] track not found: ${trackId}`);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tthis.peerConnection.removeTrack(sender);\n\t\t\tthis.localStreamController.removeTrack(trackId);\n\t\t\tlogger$16.debug(`[RTCPeerConnectionController] ${sender.track?.kind} track removed:`, trackId);\n\t\t} catch (error) {\n\t\t\tlogger$16.error(`[RTCPeerConnectionController] Failed to remove ${sender.track?.kind} track:`, error);\n\t\t\tthis._errors$.next(toError(error));\n\t\t\tthrow error;\n\t\t}\n\t}\n\t/**\n\t* Replace all existing media tracks with a new media track.\n\t* Convenience method for single-track scenarios.\n\t* @param track - The MediaStreamTrack to set\n\t*/\n\tsetLocalTrack(track) {\n\t\tconst existingTracks = [...track.kind === \"audio\" ? this.localStreamController.localAudioTracks : this.localStreamController.localVideoTracks];\n\t\tfor (const existingTrack of existingTracks) this.removeLocalTrack(existingTrack.id);\n\t\tthis.addLocalTrack(track);\n\t}\n\tasync updateSendersConstraints(kind, constraints) {\n\t\tawait this.transceiverController?.updateSendersConstraints(kind, constraints);\n\t}\n\t/**\n\t* Replace the current audio track with a new one using the given constraints.\n\t* Used for server-pushed audio constraint changes where applyConstraints\n\t* fails on iOS Safari. Stops the current track, acquires a new one via\n\t* getUserMedia, and replaces the sender track.\n\t*/\n\tasync replaceAudioTrackWithConstraints(constraints) {\n\t\tconst senders = this.peerConnection?.getSenders().filter((s) => s.track?.kind === \"audio\" && s.track.readyState === \"live\");\n\t\tif (!senders || senders.length === 0) {\n\t\t\tlogger$16.warn(\"[RTCPeerConnectionController] No live audio sender to replace\");\n\t\t\treturn;\n\t\t}\n\t\tfor (const sender of senders) {\n\t\t\tconst oldTrack = sender.track;\n\t\t\tif (!oldTrack) continue;\n\t\t\tconst { deviceId } = oldTrack.getSettings();\n\t\t\tconst mergedConstraints = {\n\t\t\t\t...oldTrack.getConstraints(),\n\t\t\t\t...constraints,\n\t\t\t\t...deviceId ? { deviceId: { exact: deviceId } } : {}\n\t\t\t};\n\t\t\tconst trackId = oldTrack.id;\n\t\t\toldTrack.stop();\n\t\t\tthis.localStreamController.removeTrack(trackId);\n\t\t\tconst newTrack = (await this.getUserMedia({ audio: mergedConstraints })).getAudioTracks()[0];\n\t\t\tawait sender.replaceTrack(newTrack);\n\t\t\tthis.localStreamController.addTrack(newTrack);\n\t\t\tlogger$16.debug(`[RTCPeerConnectionController] Audio track replaced for server-pushed params. New track: ${newTrack.id}`);\n\t\t}\n\t}\n\t/**\n\t* Clean up resources and close the peer connection.\n\t* Completes all observables to prevent memory leaks.\n\t*/\n\tdestroy() {\n\t\tlogger$16.debug(`[RTCPeerConnectionController] Destroying RTCPeerConnectionController. ${this.propose}`);\n\t\tthis.removeConnectionTimer();\n\t\tthis._iceGatheringController?.destroy();\n\t\tthis._localAudioPipeline?.destroy();\n\t\tthis._localAudioPipeline = null;\n\t\tthis.localStreamController.destroy();\n\t\tthis.transceiverController?.destroy();\n\t\tif (this.peerConnection) {\n\t\t\tthis.stopRemoteTracks();\n\t\t\tthis.removeAllListeners();\n\t\t\tthis.peerConnection.close();\n\t\t\tthis.peerConnection = void 0;\n\t\t}\n\t\tsuper.destroy();\n\t}\n\tremoveAllListeners() {\n\t\tif (this.peerConnection) {\n\t\t\tthis.peerConnection.removeEventListener(\"icegatheringstatechange\", this.onicegatheringstatechangeHandler);\n\t\t\tthis.peerConnection.removeEventListener(\"iceconnectionstatechange\", this.oniceconnectionstatechangeHandler);\n\t\t\tthis.peerConnection.removeEventListener(\"connectionstatechange\", this.onconnectionstatechangeHandler);\n\t\t\tthis.peerConnection.removeEventListener(\"signalingstatechange\", this.onsignalingstatechangeHandler);\n\t\t\tthis.peerConnection.removeEventListener(\"negotiationneeded\", this.onnegotiationneededHandler);\n\t\t}\n\t}\n\tstopRemoteTracks() {\n\t\tthis._remoteStream$.value?.getTracks().forEach((track) => {\n\t\t\tlogger$16.debug(`[RTCPeerConnectionController] Stopping remote track: ${track.kind}`);\n\t\t\ttrack.stop();\n\t\t});\n\t}\n\tget mediaDirections() {\n\t\treturn this.transceiverController?.getMediaDirections() ?? this._remoteOfferMediaDirections ?? {\n\t\t\taudio: \"inactive\",\n\t\t\tvideo: \"inactive\"\n\t\t};\n\t}\n\tasync _setRemoteDescription(params) {\n\t\tif (!this.peerConnection) throw new DependencyError(\"RTCPeerConnection is not initialized\");\n\t\tconst finalRemote = await this.setRemoteDescriptionBefore(params.sdp);\n\t\tconst answer = {\n\t\t\t...params,\n\t\t\tsdp: finalRemote\n\t\t};\n\t\tlogger$16.debug(\"[RTCPeerConnectionController] Setting remote description:\", answer);\n\t\treturn this.peerConnection.setRemoteDescription(answer);\n\t}\n};\n\n//#endregion\n//#region src/core/RPCMessages/guards/verto.guards.ts\nfunction isVertoMethodMessage(value) {\n\treturn isObject(value) && hasProperty(value, \"jsonrpc\") && value.jsonrpc === \"2.0\" && hasProperty(value, \"id\");\n}\nfunction isVertoInviteMessage(value) {\n\tif (!isVertoMethodMessage(value)) return false;\n\tconst msg = value;\n\treturn msg.method === \"verto.invite\" && isObject(msg.params) && hasProperty(msg.params, \"sdp\") && hasProperty(msg.params, \"callID\");\n}\nfunction isVertoByeMessage(value) {\n\tif (!isVertoMethodMessage(value)) return false;\n\treturn value.method === \"verto.bye\";\n}\nfunction isVertoAttachMessage(value) {\n\tif (!isVertoMethodMessage(value)) return false;\n\treturn value.method === \"verto.attach\";\n}\nfunction isVertoAnswerInnerParams(value) {\n\treturn isObject(value) && hasProperty(value, \"jsonrpc\") && value.jsonrpc === \"2.0\" && hasProperty(value, \"method\") && value.method === \"verto.answer\" && isObject(value.params) && hasProperty(value.params, \"callID\");\n}\nfunction isVertoMediaInnerParams(value) {\n\treturn isObject(value) && hasProperty(value, \"jsonrpc\") && value.jsonrpc === \"2.0\" && hasProperty(value, \"method\") && value.method === \"verto.media\" && isObject(value.params) && hasProperty(value.params, \"callID\") && hasProperty(value.params, \"sdp\");\n}\nfunction isVertoMediaParamsInnerParams(value) {\n\treturn isObject(value) && hasProperty(value, \"jsonrpc\") && value.jsonrpc === \"2.0\" && hasProperty(value, \"method\") && value.method === \"verto.mediaParams\" && isObject(value.params) && hasProperty(value.params, \"mediaParams\");\n}\nfunction isVertoPingInnerParams(value) {\n\treturn isObject(value) && hasProperty(value, \"jsonrpc\") && value.jsonrpc === \"2.0\" && hasProperty(value, \"method\") && value.method === \"verto.ping\";\n}\n\n//#endregion\n//#region src/managers/VertoManager.ts\nconst logger$15 = getLogger();\n/**\n* Decide what value goes on the `node_id` field of a `webrtc.verto` envelope.\n*\n* - **Reattach invite:** must carry the persisted nodeId so the server routes\n* the new connection to the FreeSWITCH instance that holds the existing call.\n* - **Fresh invite, caller-supplied `CallOptions.nodeId`:** carry the explicit\n* value as a steering hint (dev/staging traffic pinning). Server may honour\n* or ignore for placement reasons.\n* - **Fresh invite, no caller nodeId:** strip to `''` = \"server picks\".\n* - **Non-invite frames** (verto.modify, verto.bye, etc.): always carry the\n* current `_nodeId$.value` so the frame targets the node hosting the call.\n*\n* Pure function — exported for unit testing.\n*/\nfunction resolveInviteNodeId(args) {\n\treturn args.isInvite && !args.reattach && !args.explicitNodeId ? \"\" : args.currentNodeId ?? \"\";\n}\nvar VertoManager = class extends Destroyable {\n\tconstructor(callSession) {\n\t\tsuper();\n\t\tthis.callSession = callSession;\n\t}\n\tdestroy() {\n\t\tthis.callSession = void 0;\n\t\tsuper.destroy();\n\t}\n};\nvar WebRTCVertoManager = class extends VertoManager {\n\tconstructor(webRtcCallSession, attachManager, deviceController, webRTCApiProvider, options = {}) {\n\t\tsuper(webRtcCallSession);\n\t\tthis.webRtcCallSession = webRtcCallSession;\n\t\tthis.attachManager = attachManager;\n\t\tthis.deviceController = deviceController;\n\t\tthis.webRTCApiProvider = webRTCApiProvider;\n\t\tthis._rtcPeerConnections$ = this.createBehaviorSubject([]);\n\t\tthis._selfId$ = this.createBehaviorSubject(null);\n\t\tthis._signalingStatus$ = this.createReplaySubject(1);\n\t\tthis._screenShareStatus$ = this.createBehaviorSubject(\"none\");\n\t\tthis._rtcPeerConnectionsMap = /* @__PURE__ */ new Map();\n\t\tthis._screenShareTimeoutMs = 5e4;\n\t\tthis._nodeId$ = this.createBehaviorSubject(options.nodeId ?? null);\n\t\tthis.onError = options.onError;\n\t\tthis.onModifyFailed = options.onModifyFailed;\n\t\tthis.initSubscriptions();\n\t\tthis.initMainPeerConnection();\n\t}\n\tasync hold() {\n\t\tconst vertoModifyMessage = VertoModify({\n\t\t\tsessid: this.webRtcCallSession.id,\n\t\t\tdialogParams: { callID: this.webRtcCallSession.id },\n\t\t\taction: \"hold\"\n\t\t});\n\t\ttry {\n\t\t\tawait this.executeVerto(vertoModifyMessage);\n\t\t} catch (error) {\n\t\t\tlogger$15.warn(\"[WebRTCManager] Call might already be disconnected, error sending Verto hold:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync unhold() {\n\t\tconst vertoModifyMessage = VertoModify({\n\t\t\tsessid: this.webRtcCallSession.id,\n\t\t\tdialogParams: { callID: this.webRtcCallSession.id },\n\t\t\taction: \"unhold\"\n\t\t});\n\t\ttry {\n\t\t\tawait this.executeVerto(vertoModifyMessage);\n\t\t} catch (error) {\n\t\t\tlogger$15.warn(\"[WebRTCManager] Call might already be disconnected, error sending Verto unhold:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\tget mediaDirections() {\n\t\treturn this.mainPeerConnection.mediaDirections;\n\t}\n\tget rtcPeerConnections$() {\n\t\treturn this._rtcPeerConnections$.asObservable();\n\t}\n\tget rtcPeerConnections() {\n\t\treturn this._rtcPeerConnections$.value;\n\t}\n\tget nodeId$() {\n\t\treturn this._nodeId$.asObservable();\n\t}\n\tget selfId$() {\n\t\treturn this._selfId$.asObservable();\n\t}\n\tget localStream() {\n\t\treturn this._rtcPeerConnectionsMap.get(this.webRtcCallSession.id)?.localStream ?? null;\n\t}\n\tget remoteStream() {\n\t\treturn this._rtcPeerConnectionsMap.get(this.webRtcCallSession.id)?.remoteStream ?? null;\n\t}\n\tget nodeId() {\n\t\treturn this._nodeId$.value;\n\t}\n\tget screenShareStatus() {\n\t\treturn this._screenShareStatus$.value;\n\t}\n\tget screenShareStatus$() {\n\t\treturn this._screenShareStatus$.asObservable();\n\t}\n\tget mainPeerConnection() {\n\t\tconst rtcPeerConnection = this._rtcPeerConnectionsMap.get(this.webRtcCallSession.id);\n\t\tif (!rtcPeerConnection) throw new DependencyError(\"Main peer connection not found\");\n\t\treturn rtcPeerConnection;\n\t}\n\tget signalingStatus$() {\n\t\treturn this.cachedObservable(\"signalingStatus$\", () => merge(this._signalingStatus$.asObservable(), this.mainPeerConnection.connectionState$.pipe(filter((connectionState) => [\n\t\t\t\"connected\",\n\t\t\t\"disconnected\",\n\t\t\t\"failed\"\n\t\t].includes(connectionState)))));\n\t}\n\tinitSubscriptions() {\n\t\tthis.subscribeTo(this.callJoinedEvent$, (event) => {\n\t\t\tconst memberNodeId = event.room_session.members.find((m) => m.call_id === event.call_id)?.node_id;\n\t\t\tif (memberNodeId) this.setNodeIdIfNull(memberNodeId);\n\t\t\tif (event.member_id) this.setSelfIdIfNull(event.member_id);\n\t\t});\n\t\tthis.subscribeTo(this.vertoMedia$, (event) => {\n\t\t\tlogger$15.debug(\"[WebRTCManager] Received Verto media event (early media SDP):\", event);\n\t\t\tthis._signalingStatus$.next(\"ringing\");\n\t\t\tconst { sdp, callID } = event;\n\t\t\tthis._rtcPeerConnectionsMap.get(callID)?.updateAnswerStatus({\n\t\t\t\tstatus: \"received\",\n\t\t\t\tsdp\n\t\t\t});\n\t\t});\n\t\tthis.subscribeTo(this.vertoAnswer$, (event) => {\n\t\t\tlogger$15.debug(\"[WebRTCManager] Received Verto answer event:\", event);\n\t\t\tthis._signalingStatus$.next(\"connecting\");\n\t\t\tconst { sdp, callID } = event;\n\t\t\tthis._rtcPeerConnectionsMap.get(callID)?.updateAnswerStatus({\n\t\t\t\tstatus: \"received\",\n\t\t\t\tsdp\n\t\t\t});\n\t\t});\n\t\tthis.subscribeTo(this.vertoMediaParams$, (event) => {\n\t\t\tlogger$15.debug(\"[WebRTCManager] Received Verto mediaParams event:\", event);\n\t\t\tconst { mediaParams, callID } = event;\n\t\t\tconst rtcPeerConnController = this._rtcPeerConnectionsMap.get(callID);\n\t\t\tconst { audio, video } = mediaParams;\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tif (audio && rtcPeerConnController) await rtcPeerConnController.replaceAudioTrackWithConstraints(audio);\n\t\t\t\t\tif (video) await rtcPeerConnController?.updateSendersConstraints(\"video\", video);\n\t\t\t\t\tthis.webRtcCallSession.emitMediaParamsUpdated({\n\t\t\t\t\t\taudio,\n\t\t\t\t\t\tvideo,\n\t\t\t\t\t\ttimestamp: Date.now()\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\tlogger$15.warn(\"[WebRTCManager] Error applying server-pushed media params:\", error);\n\t\t\t\t\tthis.onError?.(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\t\t}\n\t\t\t})();\n\t\t});\n\t\tthis.subscribeTo(this.vertoPing$, (vertoPing) => {\n\t\t\tthis.attachManager.attach(this.buildAttachableCall());\n\t\t\tthis.sendVertoPong(vertoPing);\n\t\t});\n\t}\n\t/**\n\t* Set node_id/selfId only when the current value is null.\n\t*\n\t* During reattach, `call.joined` and `verto.answer` events can deliver\n\t* these identifiers before the `verto.invite` RPC response (`CALL CREATED`)\n\t* arrives. These methods let early events populate them eagerly so that\n\t* downstream RPC calls (e.g. `call.layout.list`) don't fail with empty\n\t* identifiers. `processInviteResponse()` remains the authoritative source\n\t* and always overwrites unconditionally.\n\t*/\n\tsetNodeIdIfNull(nodeId) {\n\t\tif (!this._nodeId$.value && nodeId) {\n\t\t\tlogger$15.debug(`[WebRTCManager] Early node_id set: ${nodeId}`);\n\t\t\tthis._nodeId$.next(nodeId);\n\t\t}\n\t}\n\tsetSelfIdIfNull(selfId) {\n\t\tif (!this._selfId$.value && selfId) {\n\t\t\tlogger$15.debug(`[WebRTCManager] Early selfId set: ${selfId}`);\n\t\t\tthis._selfId$.next(selfId);\n\t\t}\n\t}\n\tasync sendVertoPong(vertoPing) {\n\t\ttry {\n\t\t\tconst vertoPongMessage = VertoPong({ ...vertoPing });\n\t\t\tawait this.executeVerto(vertoPongMessage);\n\t\t} catch (error) {\n\t\t\tlogger$15.warn(\"[WebRTCManager] Call might disconnect, error sending Verto pong:\", error);\n\t\t\tthis.onError?.(new VertoPongError(error));\n\t\t}\n\t}\n\tasync updateMediaConstraints(options = {}) {\n\t\tconst { audio, video } = options;\n\t\ttry {\n\t\t\tif (audio) await this.mainPeerConnection.updateSendersConstraints(\"audio\", audio);\n\t\t\tif (video) await this.mainPeerConnection.updateSendersConstraints(\"video\", video);\n\t\t} catch (error) {\n\t\t\tlogger$15.warn(\"[WebRTCManager] Error updating media constraints:\", error);\n\t\t\tthis.onError?.(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\tthrow error;\n\t\t}\n\t}\n\tget selfId() {\n\t\treturn this._selfId$.value;\n\t}\n\t/** Build an AttachableCall from the current call state. */\n\tbuildAttachableCall(idOverride) {\n\t\treturn {\n\t\t\tnodeId: this.nodeId ?? void 0,\n\t\t\tid: idOverride ?? this.webRtcCallSession.id,\n\t\t\tto: this.webRtcCallSession.to,\n\t\t\tmediaDirections: this.webRtcCallSession.mediaDirections\n\t\t};\n\t}\n\t/**\n\t* Request a video keyframe via RTCP PLI/FIR.\n\t*\n\t* Uses RTCRtpReceiver.requestKeyFrame() (Chrome 124+) to send a\n\t* Picture Loss Indication to the remote sender. This is a client-side\n\t* WebRTC operation — no server RPC is needed.\n\t*\n\t* Best-effort: logs a warning on failure, never emits on errors$.\n\t*/\n\trequestKeyframe() {\n\t\ttry {\n\t\t\tconst pc = this.mainPeerConnection.peerConnection;\n\t\t\tif (!pc) {\n\t\t\t\tlogger$15.warn(\"[WebRTCManager] No peer connection for keyframe request\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst videoReceiver = pc.getReceivers().find((r) => r.track.kind === \"video\");\n\t\t\tif (!videoReceiver) {\n\t\t\t\tlogger$15.warn(\"[WebRTCManager] No video receiver for keyframe request\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (typeof videoReceiver.requestKeyFrame === \"function\") {\n\t\t\t\tvideoReceiver.requestKeyFrame();\n\t\t\t\tlogger$15.debug(\"[WebRTCManager] Keyframe requested via RTCRtpReceiver.requestKeyFrame()\");\n\t\t\t} else logger$15.debug(\"[WebRTCManager] requestKeyFrame() not supported, skipping\");\n\t\t} catch (error) {\n\t\t\tlogger$15.warn(\"[WebRTCManager] Keyframe request failed (non-fatal):\", error);\n\t\t}\n\t}\n\t/**\n\t* Request an ICE restart via the controller's negotiation pipeline.\n\t*\n\t* Triggers an ICE restart offer on the controller, which goes through the\n\t* full SDP pipeline: createOffer → setLocalDescription → ICE gathering →\n\t* localDescription$ emission → setupLocalDescriptionHandler sends verto.modify.\n\t*\n\t* This ensures the SDP sent to the server has fully gathered ICE candidates,\n\t* real ports/IPs, and any configured SDP munging applied — matching the\n\t* same pipeline used for the initial verto.invite.\n\t*/\n\tasync requestIceRestart(relayOnly) {\n\t\ttry {\n\t\t\tconst controller = this.mainPeerConnection;\n\t\t\tif (!controller.peerConnection) {\n\t\t\t\tlogger$15.warn(\"[WebRTCManager] No peer connection for ICE restart\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait controller.triggerIceRestart(relayOnly);\n\t\t\tlogger$15.info(`[WebRTCManager] ICE restart initiated${relayOnly ? \" (relay-only)\" : \"\"}`);\n\t\t} catch (error) {\n\t\t\tlogger$15.error(\"[WebRTCManager] ICE restart failed:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\t/**\n\t* Request an ICE restart on ALL active peer connections (main + additional legs).\n\t*\n\t* Screen share and additional device legs each get their own ICE restart\n\t* via the controller's negotiation pipeline. The SDP flows through\n\t* localDescription$ → setupLocalDescriptionHandler → verto.modify,\n\t* ensuring ICE gathering completes before the offer is sent.\n\t*\n\t* @param relayOnly - If true, constrain to TURN relay candidates only (Tier 3).\n\t*/\n\tasync requestIceRestartAll(relayOnly) {\n\t\tconst entries = Array.from(this._rtcPeerConnectionsMap.entries());\n\t\tfor (const [id, controller] of entries) try {\n\t\t\tif (!controller.peerConnection) {\n\t\t\t\tlogger$15.debug(`[WebRTCManager] No peer connection for leg ${id}, skipping ICE restart`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tawait controller.triggerIceRestart(relayOnly);\n\t\t\tlogger$15.info(`[WebRTCManager] ICE restart initiated for leg ${id}${relayOnly ? \" (relay-only)\" : \"\"}`);\n\t\t} catch (error) {\n\t\t\tlogger$15.warn(`[WebRTCManager] ICE restart failed for leg ${id}:`, error);\n\t\t}\n\t}\n\t/**\n\t* Request a keyframe on video-receiving legs only.\n\t*\n\t* Screen share legs are send-only (getDisplayMedia) so they have no\n\t* video receiver to request a keyframe from — they are skipped.\n\t*/\n\trequestKeyframeAll() {\n\t\tfor (const [id, controller] of this._rtcPeerConnectionsMap) {\n\t\t\tif (controller.isScreenShare) {\n\t\t\t\tlogger$15.debug(`[WebRTCManager] Skipping keyframe for send-only screen share leg ${id}`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst pc = controller.peerConnection;\n\t\t\t\tif (!pc) continue;\n\t\t\t\tconst videoReceiver = pc.getReceivers().find((r) => r.track.kind === \"video\");\n\t\t\t\tif (!videoReceiver) continue;\n\t\t\t\tif (typeof videoReceiver.requestKeyFrame === \"function\") {\n\t\t\t\t\tvideoReceiver.requestKeyFrame();\n\t\t\t\t\tlogger$15.debug(`[WebRTCManager] Keyframe requested for leg ${id}`);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tlogger$15.warn(`[WebRTCManager] Keyframe request failed for leg ${id} (non-fatal):`, error);\n\t\t\t}\n\t\t}\n\t}\n\tget callJoinedEvent$() {\n\t\treturn this.webRtcCallSession.callEvent$.pipe(filter(isCallJoinedPayload), takeUntil(this.destroyed$));\n\t}\n\tget vertoMedia$() {\n\t\treturn this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoMediaInnerParams, \"params\"), takeUntil(this.destroyed$));\n\t}\n\tget vertoAnswer$() {\n\t\treturn this.cachedObservable(\"vertoAnswer$\", () => this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoAnswerInnerParams, \"params\"), takeUntil(this.destroyed$)));\n\t}\n\tget vertoMediaParams$() {\n\t\treturn this.cachedObservable(\"vertoMediaParams$\", () => this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoMediaParamsInnerParams, \"params\"), takeUntil(this.destroyed$)));\n\t}\n\tget vertoBye$() {\n\t\treturn this.cachedObservable(\"vertoBye$\", () => this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoByeMessage, \"params\"), takeUntil(this.destroyed$)));\n\t}\n\tget vertoAttach$() {\n\t\treturn this.cachedObservable(\"vertoAttach$\", () => this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoAttachMessage, \"params\"), takeUntil(this.destroyed$)));\n\t}\n\tget vertoPing$() {\n\t\treturn this.cachedObservable(\"vertoPing$\", () => this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoPingInnerParams, \"params\"), takeUntil(this.destroyed$)));\n\t}\n\tasync executeVerto(message, optionals = {}) {\n\t\tconst webrtcVertoMessage = WebrtcVerto({\n\t\t\tcallID: optionals.callID ?? this.webRtcCallSession.id,\n\t\t\tnode_id: optionals.node_id ?? this._nodeId$.value ?? \"\",\n\t\t\tmessage,\n\t\t\tsubscribe: optionals.subscribe\n\t\t});\n\t\tconst response = await this.webRtcCallSession.execute(webrtcVertoMessage);\n\t\tif (response.error) {\n\t\t\tconst error = new JSONRPCError(response.error.code, response.error.message, response.error.data);\n\t\t\tthis.onError?.(error);\n\t\t\treturn response;\n\t\t}\n\t\tconst innerResult = getValueFrom(response, \"result.result\");\n\t\tif (innerResult?.error) {\n\t\t\tconst error = new JSONRPCError(innerResult.error.code, innerResult.error.message, innerResult.error.data);\n\t\t\tthis.onError?.(error);\n\t\t\treturn response;\n\t\t}\n\t\treturn response;\n\t}\n\tasync sendLocalDescription(message, rtcPeerConnController) {\n\t\tconst vertoMethod = message.method;\n\t\tconst optionalsParams = this.getSendLocalSDPOptionalParams(rtcPeerConnController, message);\n\t\ttry {\n\t\t\tconst response = await this.executeVerto(message, optionalsParams);\n\t\t\tswitch (vertoMethod) {\n\t\t\t\tcase \"verto.invite\":\n\t\t\t\t\tthis.processInviteResponse(response, rtcPeerConnController);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"verto.modify\":\n\t\t\t\t\tawait this.processModifyResponse(response, rtcPeerConnController);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlogger$15.error(`[WebRTCManager] Error sending Verto ${vertoMethod}:`, error);\n\t\t\tthis.onError?.(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\tif (vertoMethod === \"verto.modify\") this.onModifyFailed?.();\n\t\t}\n\t}\n\tasync processModifyResponse(response, rtcPeerConnController) {\n\t\tif (!response.error) {\n\t\t\tconst action = getValueFrom(response, \"result.result.result.action\");\n\t\t\tconst sdp = getValueFrom(response, \"result.result.result.sdp\");\n\t\t\tif (action === \"updateMedia\" && !!sdp) try {\n\t\t\t\tawait rtcPeerConnController.updateAnswerStatus({\n\t\t\t\t\tstatus: \"received\",\n\t\t\t\t\tsdp\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tlogger$15.warn(\"[WebRTCManager] Error processing modify response:\", error);\n\t\t\t\tconst modifyError = error instanceof Error ? error : new Error(String(error), { cause: error });\n\t\t\t\tthis.onError?.(modifyError);\n\t\t\t}\n\t\t}\n\t}\n\tprocessInviteResponse(response, rtcPeerConnController) {\n\t\tif (!response.error && getValueFrom(response, \"result.result.result.message\") === \"CALL CREATED\") {\n\t\t\tthis._signalingStatus$.next(\"trying\");\n\t\t\tthis._nodeId$.next(getValueFrom(response, \"result.node_id\") ?? null);\n\t\t\tconst memberId = getValueFrom(response, \"result.result.result.memberID\") ?? null;\n\t\t\tconst callId = getValueFrom(response, \"result.result.result.callID\") ?? null;\n\t\t\tlogger$15.debug(\"[WebRTCManager] Verto invite response:\", {\n\t\t\t\tcallId,\n\t\t\t\tmemberId,\n\t\t\t\tresponse\n\t\t\t});\n\t\t\tthis._selfId$.next(memberId);\n\t\t\trtcPeerConnController.setMemberId(memberId);\n\t\t\tif (callId) {\n\t\t\t\tthis.webRtcCallSession.addCallId(callId);\n\t\t\t\tthis.attachManager.attach(this.buildAttachableCall(callId));\n\t\t\t} else logger$15.warn(\"[WebRTCManager] Cannot attach call, missing callId:\", {\n\t\t\t\tnodeId: this.nodeId,\n\t\t\t\tcallId\n\t\t\t});\n\t\t\tlogger$15.info(\"[WebRTCManager] Verto invite successful\");\n\t\t\tlogger$15.debug(`[WebRTCManager] nodeid: ${this._nodeId$.value}, selfId: ${this._selfId$.value}`);\n\t\t} else {\n\t\t\tlogger$15.error(\"[WebRTCManager] Verto invite failed:\", response);\n\t\t\tconst inviteError = response.error ? new JSONRPCError(response.error.code, response.error.message, response.error.data) : /* @__PURE__ */ new Error(\"Verto invite failed: unexpected response\");\n\t\t\tthis.onError?.(inviteError);\n\t\t}\n\t}\n\tget RTCPeerConnectionConfig() {\n\t\treturn {\n\t\t\ticeServers: this.webRtcCallSession.clientSession.iceServers ?? PreferencesContainer.instance.iceServers,\n\t\t\trelayOnly: PreferencesContainer.instance.relayOnly || PreferencesContainer.instance.disableUdpIceServers,\n\t\t\tdisableUdpIceServers: PreferencesContainer.instance.disableUdpIceServers,\n\t\t\ticeCandidateTimeout: PreferencesContainer.instance.iceCandidateTimeout,\n\t\t\ticeGatheringTimeout: PreferencesContainer.instance.iceGatheringTimeout\n\t\t};\n\t}\n\tinitMainPeerConnection() {\n\t\tconst { options } = this.webRtcCallSession;\n\t\tconst rtcPeerConnController = new RTCPeerConnectionController({\n\t\t\tpropose: \"main\",\n\t\t\tcallId: this.webRtcCallSession.id,\n\t\t\taudio: options.audio,\n\t\t\tvideo: options.video,\n\t\t\tinputAudioDeviceConstraints: options.inputAudioDeviceConstraints,\n\t\t\tinputVideoDeviceConstraints: options.inputVideoDeviceConstraints,\n\t\t\tinputAudioStream: options.inputAudioStream,\n\t\t\tinputVideoStream: options.inputVideoStream,\n\t\t\treceiveAudio: options.receiveAudio,\n\t\t\treceiveVideo: options.receiveVideo,\n\t\t\twebRTCApiProvider: this.webRTCApiProvider,\n\t\t\tpreferredVideoCodecs: options.preferredVideoCodecs,\n\t\t\tpreferredAudioCodecs: options.preferredAudioCodecs,\n\t\t\tstereo: options.stereo,\n\t\t\t...this.RTCPeerConnectionConfig\n\t\t}, options.initOffer, this.deviceController);\n\t\tthis.setupLocalDescriptionHandler(rtcPeerConnController);\n\t\tthis.setupVertoByeHandler();\n\t\tthis.setupVertoAttachHandler();\n\t\tthis.initObservables(rtcPeerConnController);\n\t\tthis._rtcPeerConnectionsMap.set(rtcPeerConnController.id, rtcPeerConnController);\n\t\tthis._rtcPeerConnections$.next(Array.from(this._rtcPeerConnectionsMap.values()));\n\t\tthis.subscribeTo(rtcPeerConnController.errors$, (error) => {\n\t\t\tthis.onError?.(error);\n\t\t});\n\t\tif (options.initOffer) this.handleInboundAnswer(rtcPeerConnController);\n\t}\n\tasync handleInboundAnswer(rtcPeerConnController) {\n\t\tlogger$15.debug(\"[WebRTCManager] Waiting for inbound call to be accepted or rejected\");\n\t\tconst vertoByeOrAccepted = await firstValueFrom(race(this.vertoBye$, this.webRtcCallSession.answered$).pipe(takeUntil(this.destroyed$))).catch(() => null);\n\t\tif (vertoByeOrAccepted === null) {\n\t\t\tlogger$15.debug(\"[WebRTCManager] Inbound answer handler aborted (destroyed).\");\n\t\t\treturn;\n\t\t}\n\t\tif (isVertoByeMessage(vertoByeOrAccepted)) {\n\t\t\tlogger$15.info(\"[WebRTCManager] Inbound call ended by remote before answer.\");\n\t\t\tthis.callSession?.destroy();\n\t\t} else if (!vertoByeOrAccepted) {\n\t\t\tlogger$15.info(\"[WebRTCManager] Inbound call rejected by user.\");\n\t\t\ttry {\n\t\t\t\tawait this.bye(\"USER_BUSY\");\n\t\t\t} finally {\n\t\t\t\tthis._signalingStatus$.next(\"disconnected\");\n\t\t\t\tthis.callSession?.destroy();\n\t\t\t}\n\t\t} else {\n\t\t\tlogger$15.debug(\"[WebRTCManager] Inbound call accepted, creating SDP answer\");\n\t\t\tconst answerOptions = this.webRtcCallSession.answerMediaOptions;\n\t\t\ttry {\n\t\t\t\tawait rtcPeerConnController.acceptInbound(answerOptions);\n\t\t\t} catch (error) {\n\t\t\t\tlogger$15.error(\"[WebRTCManager] Error creating inbound answer:\", error);\n\t\t\t\tthis.onError?.(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\t}\n\t\t}\n\t}\n\tsetupVertoAttachHandler() {\n\t\tthis.subscribeTo(this.vertoAttach$, async (vertoAttach) => {\n\t\t\tlogger$15.debug(\"[WebRTCManager] Received Verto attach event for existing call:\", vertoAttach);\n\t\t\tconst { callID } = vertoAttach;\n\t\t\tawait this.attachManager.attach({\n\t\t\t\tnodeId: this.nodeId ?? void 0,\n\t\t\t\tid: callID,\n\t\t\t\tto: vertoAttach.callee_id_number,\n\t\t\t\tmediaDirections: {\n\t\t\t\t\taudio: \"sendrecv\",\n\t\t\t\t\tvideo: \"inactive\"\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\tinitObservables(rtcPeerConnController) {\n\t\tthis.mediaDirections$ = rtcPeerConnController.connectionState$.pipe(filter((state) => state === \"connected\"), map(() => rtcPeerConnController.mediaDirections), startWith(rtcPeerConnController.mediaDirections), takeUntil(this.destroyed$));\n\t\tthis.localStream$ = rtcPeerConnController.localStream$.pipe(filterNull(), takeUntil(this.destroyed$));\n\t\tthis.remoteStream$ = rtcPeerConnController.remoteStream$.pipe(filterNull(), takeUntil(this.destroyed$));\n\t}\n\tsetupLocalDescriptionHandler(rtcPeerConnController) {\n\t\tthis.subscribeTo(rtcPeerConnController.localDescription$.pipe(filter((description) => description !== null), takeUntil(this.destroyed$)), (description) => {\n\t\t\tconst { type, sdp } = description;\n\t\t\tconst dialogParams = this.dialogParams(rtcPeerConnController);\n\t\t\tconst initial = !rtcPeerConnController.firstSDPExchangeCompleted;\n\t\t\tif (type === \"answer\") {\n\t\t\t\tconst vertoMessageRequest = VertoAnswer({\n\t\t\t\t\tdialogParams,\n\t\t\t\t\tsdp\n\t\t\t\t});\n\t\t\t\tthis.sendLocalDescriptionOnceAccepted(vertoMessageRequest, rtcPeerConnController);\n\t\t\t} else if (initial) {\n\t\t\t\tconst vertoMessageRequest = VertoInvite({\n\t\t\t\t\tdialogParams,\n\t\t\t\t\tsdp\n\t\t\t\t});\n\t\t\t\tthis.sendLocalDescription(vertoMessageRequest, rtcPeerConnController);\n\t\t\t} else {\n\t\t\t\tconst vertoMessageRequest = VertoModify({\n\t\t\t\t\tdialogParams,\n\t\t\t\t\tsdp,\n\t\t\t\t\taction: \"updateMedia\"\n\t\t\t\t});\n\t\t\t\tthis.sendLocalDescription(vertoMessageRequest, rtcPeerConnController);\n\t\t\t}\n\t\t});\n\t}\n\tsetupVertoByeHandler() {\n\t\tthis.subscribeTo(this.vertoBye$, () => {\n\t\t\tthis._signalingStatus$.next(\"disconnected\");\n\t\t\tthis.attachManager.detach(this.buildAttachableCall());\n\t\t\tthis.callSession?.destroy();\n\t\t});\n\t}\n\tgetSendLocalSDPOptionalParams(rtcPeerConnController, vertoMessage) {\n\t\tlet subscribe = void 0;\n\t\tif (!rtcPeerConnController.firstSDPExchangeCompleted) {\n\t\t\tsubscribe = [];\n\t\t\tif (rtcPeerConnController.isMainDevice) subscribe.push(...PreferencesContainer.instance.inviteSubscribeMainDevice);\n\t\t\telse if (rtcPeerConnController.isAdditionalDevice) subscribe.push(...PreferencesContainer.instance.inviteSubscribeAdditionalDevice);\n\t\t\telse if (rtcPeerConnController.isScreenShare) subscribe.push(...PreferencesContainer.instance.inviteSubscribeScreenshare);\n\t\t}\n\t\treturn {\n\t\t\tcallID: rtcPeerConnController.id,\n\t\t\tnode_id: resolveInviteNodeId({\n\t\t\t\tisInvite: isVertoInviteMessage(vertoMessage),\n\t\t\t\treattach: this.webRtcCallSession.options.reattach === true,\n\t\t\t\texplicitNodeId: this.webRtcCallSession.options.nodeId,\n\t\t\t\tcurrentNodeId: this._nodeId$.value\n\t\t\t}),\n\t\t\tsubscribe\n\t\t};\n\t}\n\tasync sendLocalDescriptionOnceAccepted(vertoMessageRequest, rtcPeerConnectionController) {\n\t\tlogger$15.debug(\"[WebRTCManager] Waiting for call to be accepted or ended before sending answer\");\n\t\tconst vertoByeOrAccepted = await firstValueFrom(race(this.vertoBye$, this.webRtcCallSession.answered$).pipe(takeUntil(this.destroyed$))).catch(() => null);\n\t\tif (vertoByeOrAccepted === null) {\n\t\t\tlogger$15.debug(\"[WebRTCManager] Destroyed while waiting for call acceptance\");\n\t\t\treturn;\n\t\t}\n\t\tif (isVertoByeMessage(vertoByeOrAccepted)) {\n\t\t\tlogger$15.info(\"[WebRTCManager] Call ended before answer was sent.\");\n\t\t\tthis.callSession?.destroy();\n\t\t} else if (!vertoByeOrAccepted) {\n\t\t\tlogger$15.info(\"[WebRTCManager] Call was not accepted, sending verto.bye.\");\n\t\t\ttry {\n\t\t\t\tawait this.bye(\"USER_BUSY\");\n\t\t\t} finally {\n\t\t\t\tthis._signalingStatus$.next(\"disconnected\");\n\t\t\t\tthis.callSession?.destroy();\n\t\t\t}\n\t\t} else {\n\t\t\tlogger$15.debug(\"[WebRTCManager] Call accepted, sending answer\");\n\t\t\ttry {\n\t\t\t\tthis._signalingStatus$.next(\"connecting\");\n\t\t\t\tawait this.sendLocalDescription(vertoMessageRequest, rtcPeerConnectionController);\n\t\t\t\tawait rtcPeerConnectionController.updateAnswerStatus({ status: \"sent\" });\n\t\t\t\tawait this.attachManager.attach(this.buildAttachableCall());\n\t\t\t} catch (error) {\n\t\t\t\tlogger$15.error(\"[WebRTCManager] Error sending Verto answer:\", error);\n\t\t\t\tthis.onError?.(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\t\tawait rtcPeerConnectionController.updateAnswerStatus({ status: \"failed\" });\n\t\t\t}\n\t\t}\n\t}\n\tdialogParams(rtcPeerConnectionController) {\n\t\tconst memberId = rtcPeerConnectionController.memberId ?? this._selfId$.value ?? void 0;\n\t\tconst attach = rtcPeerConnectionController.propose === \"main\" && !rtcPeerConnectionController.firstSDPExchangeCompleted && this.webRtcCallSession.options.reattach;\n\t\treturn {\n\t\t\tid: rtcPeerConnectionController.isMainDevice ? this.webRtcCallSession.id : rtcPeerConnectionController.id,\n\t\t\tdestinationNumber: this.webRtcCallSession.to ?? this.webRtcCallSession.from,\n\t\t\tattach,\n\t\t\treattaching: attach,\n\t\t\tcallerName: this.webRtcCallSession.fromName,\n\t\t\tcallerNumber: this.webRtcCallSession.from,\n\t\t\tremoteCallerName: this.webRtcCallSession.toName,\n\t\t\tremoteCallerNumber: this.webRtcCallSession.to,\n\t\t\tuserVariables: {\n\t\t\t\tmemberCallId: this.webRtcCallSession.id,\n\t\t\t\tmemberId,\n\t\t\t\t...this.webRtcCallSession.userVariables\n\t\t\t},\n\t\t\tscreenShare: rtcPeerConnectionController.isScreenShare,\n\t\t\tadditionalDevice: rtcPeerConnectionController.isAdditionalDevice,\n\t\t\tpingSupported: true,\n\t\t\tversion: INVITE_VERSION\n\t\t};\n\t}\n\tmuteMainAudioInputDevice() {\n\t\treturn this.mainPeerConnection.stopTrackSender(\"audio\");\n\t}\n\tmuteMainVideoInputDevice() {\n\t\treturn this.mainPeerConnection.stopTrackSender(\"video\");\n\t}\n\tasync unmuteMainAudioInputDevice() {\n\t\treturn this.mainPeerConnection.restoreTrackSender(\"audio\");\n\t}\n\tasync unmuteMainVideoInputDevice() {\n\t\treturn this.mainPeerConnection.restoreTrackSender(\"video\");\n\t}\n\t/** Get or lazily create the local audio pipeline for the main peer connection. */\n\tensureLocalAudioPipeline() {\n\t\treturn this.mainPeerConnection.ensureLocalAudioPipeline();\n\t}\n\t/** The currently-active local audio pipeline, or null if it hasn't been created. */\n\tget localAudioPipeline() {\n\t\treturn this.mainPeerConnection.localAudioPipeline;\n\t}\n\tasync addInputDevice(options = {\n\t\taudio: false,\n\t\tvideo: true\n\t}) {\n\t\treturn this.initAdditionalPeerConnection(\"additional-device\", options);\n\t}\n\t/**\n\t* Add a new input device to the main peer connection,\n\t* only if a device of the same kind is not present already.\n\t*\n\t* @see selectAudioInputDevice\n\t* @see selectVideoInputDevice\n\t* @param options - Media options specifying which input devices to add (defaults to audio only).\n\t*/\n\tasync addMainInputDevices(options = { audio: true }) {\n\t\tlet deviceKind = void 0;\n\t\tconst { mediaDirections } = this.mainPeerConnection;\n\t\tif (options.audio ?? options.inputAudioDeviceConstraints ?? (options.inputAudioStream && mediaDirections.audio.startsWith(\"send\"))) deviceKind = \"audio\";\n\t\tif (options.video ?? options.inputVideoDeviceConstraints ?? (options.inputVideoStream && !mediaDirections.video.startsWith(\"send\"))) deviceKind = deviceKind === \"audio\" ? \"both\" : \"video\";\n\t\tif (deviceKind) {\n\t\t\tthis.mainPeerConnection.updateMediaDevicesOptions(options);\n\t\t\tawait this.mainPeerConnection.restoreTrackSender(deviceKind);\n\t\t} else {\n\t\t\tconst error = new InvalidParams(\"No valid device to be added\");\n\t\t\tthis.onError?.(error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync addScreenMedia(options = { audio: false }) {\n\t\tawait this.initAdditionalPeerConnection(\"screenshare\", options);\n\t}\n\tasync initAdditionalPeerConnection(propose, options) {\n\t\tlet rtcPeerConnController = null;\n\t\ttry {\n\t\t\tthis._screenShareStatus$.next(\"starting\");\n\t\t\trtcPeerConnController = new RTCPeerConnectionController({\n\t\t\t\t...options,\n\t\t\t\t...this.RTCPeerConnectionConfig,\n\t\t\t\tpropose,\n\t\t\t\twebRTCApiProvider: this.webRTCApiProvider\n\t\t\t}, void 0, this.deviceController);\n\t\t\tthis.setupLocalDescriptionHandler(rtcPeerConnController);\n\t\t\tif (propose === \"screenshare\") this._screenShareId = rtcPeerConnController.id;\n\t\t\tthis._rtcPeerConnectionsMap.set(rtcPeerConnController.id, rtcPeerConnController);\n\t\t\tthis._rtcPeerConnections$.next(Array.from(this._rtcPeerConnectionsMap.values()));\n\t\t\tthis.subscribeTo(rtcPeerConnController.errors$, (error) => {\n\t\t\t\tthis.onError?.(error);\n\t\t\t});\n\t\t\tawait firstValueFrom(rtcPeerConnController.connectionState$.pipe(filter((state) => state === \"connected\"), take(1), timeout(this._screenShareTimeoutMs), takeUntil(this.destroyed$)));\n\t\t\tthis._screenShareStatus$.next(\"started\");\n\t\t\tlogger$15.info(\"[WebRTCManager] Screen share started successfully.\");\n\t\t\treturn rtcPeerConnController.id;\n\t\t} catch (error) {\n\t\t\tlogger$15.warn(\"[WebRTCManager] Error initializing additional peer connection:\", error);\n\t\t\tthis.onError?.(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\tif (rtcPeerConnController) rtcPeerConnController.destroy();\n\t\t\tthis._screenShareStatus$.next(\"none\");\n\t\t}\n\t}\n\tasync removeInputDevices(id) {\n\t\treturn this.removeAdditionalPeerConnection(id);\n\t}\n\tremoveMainInputDevice(options = {\n\t\tremoveAudio: false,\n\t\tremoveVideo: true\n\t}) {\n\t\tlet removeTrack = void 0;\n\t\tif (options.removeAudio) removeTrack = \"audio\";\n\t\tif (options.removeVideo) removeTrack = removeTrack === \"audio\" ? \"both\" : \"video\";\n\t\tif (removeTrack) return this.mainPeerConnection.stopTrackSender(removeTrack, { updateTransceiverDirection: true });\n\t}\n\tasync removeScreenMedia() {\n\t\tif (![\"starting\", \"started\"].includes(this._screenShareStatus$.value)) logger$15.warn(\"[WebRTCManager] No active screen share to stop.\");\n\t\tif (!this._screenShareId) {\n\t\t\tlogger$15.debug(\"[WebRTCManager] No screen share peer connection found.\");\n\t\t\treturn;\n\t\t}\n\t\tthis._screenShareStatus$.next(\"stopping\");\n\t\tawait this.removeAdditionalPeerConnection(this._screenShareId);\n\t\tthis._screenShareId = void 0;\n\t\tthis._screenShareStatus$.next(\"none\");\n\t}\n\tasync removeAdditionalPeerConnection(id) {\n\t\tconst rtcPeerConnController = this._rtcPeerConnectionsMap.get(id);\n\t\ttry {\n\t\t\tif (rtcPeerConnController) await this.executeVertoBye(rtcPeerConnController);\n\t\t} finally {\n\t\t\trtcPeerConnController?.destroy();\n\t\t\tthis._rtcPeerConnectionsMap.delete(id);\n\t\t\tthis._rtcPeerConnections$.next(Array.from(this._rtcPeerConnectionsMap.values()));\n\t\t}\n\t}\n\tasync executeVertoBye(rtcPeerConnController, cause) {\n\t\ttry {\n\t\t\tconst causeParams = cause ? {\n\t\t\t\tcause,\n\t\t\t\tcauseCode: VertoByeCauseCodes[cause]\n\t\t\t} : {};\n\t\t\tawait this.executeVerto(VertoBye({\n\t\t\t\t...causeParams,\n\t\t\t\tdialogParams: this.dialogParams(rtcPeerConnController)\n\t\t\t}));\n\t\t} catch (error) {\n\t\t\tlogger$15.warn(\"[WebRTCManager] Call might already be disconnected, error sending Verto bye:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync bye(cause) {\n\t\tthis.attachManager.detach(this.buildAttachableCall());\n\t\tconst rtcPeerConnController = this._rtcPeerConnectionsMap.get(this.webRtcCallSession.id);\n\t\tif (rtcPeerConnController) await this.executeVertoBye(rtcPeerConnController, cause);\n\t}\n\tasync sendDigits(dtmf) {\n\t\tconst vertoInfoMessage = VertoInfo({\n\t\t\tsessid: this.webRtcCallSession.id,\n\t\t\tdialogParams: { callID: this.webRtcCallSession.id },\n\t\t\tdtmf\n\t\t});\n\t\ttry {\n\t\t\tawait this.executeVerto(vertoInfoMessage);\n\t\t} catch (error) {\n\t\t\tlogger$15.warn(\"[WebRTCManager] Error sending DTMF digits:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync transfer(options) {\n\t\tconst message = VertoModify({\n\t\t\t...options,\n\t\t\tdialogParams: this.dialogParams(this.mainPeerConnection),\n\t\t\taction: \"transfer\"\n\t\t});\n\t\ttry {\n\t\t\tlogger$15.debug(\"[WebRTCManager] Transferring call with options:\", options);\n\t\t\tawait this.executeVerto(message);\n\t\t} catch (error) {\n\t\t\tlogger$15.error(\"[WebRTCManager] Error transferring call:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\tdestroy() {\n\t\tthis._rtcPeerConnectionsMap.forEach((rtcPeerConnController) => {\n\t\t\trtcPeerConnController.destroy();\n\t\t});\n\t\tthis._rtcPeerConnectionsMap.clear();\n\t\tthis._rtcPeerConnections$.complete();\n\t\tsuper.destroy();\n\t}\n};\n\n//#endregion\n//#region src/controllers/RemoteAudioMeter.ts\nconst logger$14 = getLogger();\n/**\n* Read-only audio level meter for a remote MediaStream. Attaches an\n* AnalyserNode to a MediaStreamAudioSourceNode so it observes the stream\n* without affecting the caller's playback path (no GainNode, no destination).\n*\n* The server delivers all remote audio as a single mixed stream — there is\n* no per-participant demux — so this meter reports the aggregate remote\n* level, not per-member.\n*/\nvar RemoteAudioMeter = class extends Destroyable {\n\tconstructor(options = {}) {\n\t\tsuper();\n\t\tthis._source = null;\n\t\tthis._stream = null;\n\t\tthis._audioContext = (options.audioContextFactory ?? (() => new AudioContext()))();\n\t\tthis._analyser = this._audioContext.createAnalyser();\n\t\tthis._analyser.fftSize = 2048;\n\t\tthis._analyser.smoothingTimeConstant = .3;\n\t\tthis._analyserBuffer = new Uint8Array(new ArrayBuffer(this._analyser.fftSize));\n\t\tthis._pollIntervalMs = options.pollIntervalMs ?? AUDIO_LEVEL_POLL_INTERVAL_MS;\n\t}\n\t/** RMS level of the remote audio, 0..1. 0 when no stream is attached. */\n\tget level$() {\n\t\treturn this.deferEmission(interval(this._pollIntervalMs, animationFrameScheduler).pipe(map(() => this.computeLevel())));\n\t}\n\t/**\n\t* Attach (or replace) the MediaStream whose audio track is being metered.\n\t* Pass null to detach without destroying the meter.\n\t*/\n\tsetStream(stream) {\n\t\tif (this._source) {\n\t\t\ttry {\n\t\t\t\tthis._source.disconnect();\n\t\t\t} catch (error) {\n\t\t\t\tlogger$14.debug(\"[RemoteAudioMeter] source disconnect warning:\", error);\n\t\t\t}\n\t\t\tthis._source = null;\n\t\t\tthis._stream = null;\n\t\t}\n\t\tif (!stream || stream.getAudioTracks().length === 0) return;\n\t\tthis._stream = new MediaStream(stream.getAudioTracks());\n\t\tthis._source = this._audioContext.createMediaStreamSource(this._stream);\n\t}\n\tdestroy() {\n\t\tif (this._source) {\n\t\t\ttry {\n\t\t\t\tthis._source.disconnect();\n\t\t\t} catch {}\n\t\t\tthis._source = null;\n\t\t}\n\t\tthis._audioContext.close().catch((error) => {\n\t\t\tlogger$14.debug(\"[RemoteAudioMeter] audio context close warning:\", error);\n\t\t});\n\t\tsuper.destroy();\n\t}\n\tcomputeLevel() {\n\t\tif (!this._source) return 0;\n\t\tthis._analyser.getByteTimeDomainData(this._analyserBuffer);\n\t\tlet sum = 0;\n\t\tfor (const sample of this._analyserBuffer) {\n\t\t\tconst normalized = (sample - 128) / 128;\n\t\t\tsum += normalized * normalized;\n\t\t}\n\t\treturn Math.sqrt(sum / this._analyserBuffer.length);\n\t}\n};\n\n//#endregion\n//#region src/controllers/RTCStatsMonitor.ts\n/**\n* RTCStatsMonitor — per-call WebRTC stats polling, baseline calculation,\n* and network issue detection (audio/video packets, RTT, jitter, packet loss).\n*\n* Extends Destroyable for automatic RxJS cleanup.\n*/\nconst logger$13 = getLogger();\nconst DEFAULT_POLLING_INTERVAL_MS = 1e3;\nconst DEFAULT_BASELINE_SAMPLES = 10;\nconst DEFAULT_NO_AUDIO_PACKET_THRESHOLD_MS = 2e3;\nconst DEFAULT_NO_VIDEO_PACKET_THRESHOLD_MS = 3e3;\nconst DEFAULT_RTT_SPIKE_WARNING_MULTIPLIER = 3;\nconst DEFAULT_RTT_SPIKE_CRITICAL_MULTIPLIER = 5;\nconst DEFAULT_PACKET_LOSS_WARNING_PERCENT = 5;\nconst DEFAULT_PACKET_LOSS_CRITICAL_PERCENT = 10;\nconst DEFAULT_JITTER_SPIKE_MULTIPLIER = 4;\nconst DEFAULT_HISTORY_WINDOW_SECONDS = 30;\nfunction computePacketLossPercent(lost, received) {\n\tconst total = lost + received;\n\tif (total === 0) return 0;\n\treturn lost / total * 100;\n}\nfunction isInboundRtpStat(stat) {\n\treturn typeof stat === \"object\" && stat !== null && \"type\" in stat && stat.type === \"inbound-rtp\";\n}\nfunction isCandidatePairStat(stat) {\n\treturn typeof stat === \"object\" && stat !== null && \"type\" in stat && stat.type === \"candidate-pair\";\n}\nvar RTCStatsMonitor = class extends Destroyable {\n\tconstructor(peerConnection, config = {}) {\n\t\tsuper();\n\t\tthis.peerConnection = peerConnection;\n\t\tthis.running = false;\n\t\tthis.lastAudioPacketsReceived = 0;\n\t\tthis.lastAudioPacketChangeTime = 0;\n\t\tthis.lastVideoPacketsReceived = 0;\n\t\tthis.lastVideoPacketChangeTime = 0;\n\t\tthis.lastRoundTripTime = 0;\n\t\tthis.lastAvailableOutgoingBitrate = void 0;\n\t\tthis._sample$ = this.createReplaySubject(1);\n\t\tthis._baseline$ = this.createBehaviorSubject({\n\t\t\trtt: 0,\n\t\t\tjitter: 0,\n\t\t\tready: false\n\t\t});\n\t\tthis._networkIssues$ = this.createBehaviorSubject([]);\n\t\tthis._networkMetrics$ = this.createBehaviorSubject([]);\n\t\tthis.pollingIntervalMs = config.pollingIntervalMs ?? DEFAULT_POLLING_INTERVAL_MS;\n\t\tthis.baselineSampleCount = config.baselineSamples ?? DEFAULT_BASELINE_SAMPLES;\n\t\tthis.noAudioPacketThresholdMs = config.noAudioPacketThresholdMs ?? DEFAULT_NO_AUDIO_PACKET_THRESHOLD_MS;\n\t\tthis.noVideoPacketThresholdMs = config.noVideoPacketThresholdMs ?? DEFAULT_NO_VIDEO_PACKET_THRESHOLD_MS;\n\t\tthis.rttSpikeWarningMultiplier = config.rttSpikeWarningMultiplier ?? DEFAULT_RTT_SPIKE_WARNING_MULTIPLIER;\n\t\tthis.rttSpikeCriticalMultiplier = config.rttSpikeCriticalMultiplier ?? DEFAULT_RTT_SPIKE_CRITICAL_MULTIPLIER;\n\t\tthis.packetLossWarningPercent = config.packetLossWarningPercent ?? DEFAULT_PACKET_LOSS_WARNING_PERCENT;\n\t\tthis.packetLossCriticalPercent = config.packetLossCriticalPercent ?? DEFAULT_PACKET_LOSS_CRITICAL_PERCENT;\n\t\tthis.jitterSpikeMultiplier = config.jitterSpikeMultiplier ?? DEFAULT_JITTER_SPIKE_MULTIPLIER;\n\t\tthis.historyWindowSeconds = config.historyWindowSeconds ?? DEFAULT_HISTORY_WINDOW_SECONDS;\n\t}\n\t/** Current list of detected network issues (empty array = healthy). */\n\tget networkIssues$() {\n\t\treturn this._networkIssues$.asObservable();\n\t}\n\t/** Snapshot of current issues (defensive copy). */\n\tget networkIssues() {\n\t\treturn [...this._networkIssues$.value];\n\t}\n\t/** Simple boolean health indicator. */\n\tget isNetworkHealthy$() {\n\t\treturn this.cachedObservable(\"isNetworkHealthy$\", () => this._networkIssues$.pipe(map((issues) => issues.length === 0), distinctUntilChanged(), takeUntil(this.destroyed$)));\n\t}\n\t/** Whether the network is currently healthy. */\n\tget isNetworkHealthy() {\n\t\treturn this._networkIssues$.value.length === 0;\n\t}\n\t/** Rolling metrics history. */\n\tget networkMetrics$() {\n\t\treturn this._networkMetrics$.asObservable();\n\t}\n\t/** Snapshot of rolling metrics (defensive copy). */\n\tget networkMetrics() {\n\t\treturn [...this._networkMetrics$.value];\n\t}\n\t/** Emits individual critical issues for the recovery pipeline. */\n\tget criticalIssue$() {\n\t\treturn this.cachedObservable(\"criticalIssue$\", () => this._networkIssues$.pipe(mergeMap((issues) => from(issues.filter((i) => i.severity === \"critical\"))), takeUntil(this.destroyed$)));\n\t}\n\t/** Emits each raw stats sample extracted from the peer connection. */\n\tget sample$() {\n\t\treturn this._sample$.asObservable();\n\t}\n\tstart() {\n\t\tif (this.running) return;\n\t\tthis.running = true;\n\t\tconst now = Date.now();\n\t\tthis.lastAudioPacketChangeTime = now;\n\t\tthis.lastVideoPacketChangeTime = now;\n\t\tlogger$13.debug(\"[RTCStatsMonitor] Starting stats monitoring\");\n\t\tthis.subscribeTo(interval(this.pollingIntervalMs).pipe(filter(() => this.running), switchMap(() => from(this.peerConnection.getStats()).pipe(catchError((err) => {\n\t\t\tlogger$13.warn(\"[RTCStatsMonitor] Failed to get stats:\", err);\n\t\t\treturn EMPTY;\n\t\t}))), filter(() => this.running), map((report) => this.extractSample(report))), (sample) => this._sample$.next(sample));\n\t\tthis.subscribeTo(this._sample$.pipe(take(this.baselineSampleCount), toArray(), map((samples) => ({\n\t\t\trtt: samples.reduce((s, b) => s + b.roundTripTime, 0) / samples.length,\n\t\t\tjitter: samples.reduce((s, b) => s + b.audioJitter, 0) / samples.length,\n\t\t\tready: true\n\t\t}))), (baseline) => {\n\t\t\tlogger$13.debug(`[RTCStatsMonitor] Baseline established: rtt=${baseline.rtt.toFixed(1)}ms, jitter=${baseline.jitter.toFixed(1)}ms`);\n\t\t\tthis._baseline$.next(baseline);\n\t\t});\n\t\tthis.subscribeTo(this._sample$.pipe(scan((acc, sample) => ({\n\t\t\tprev: acc.current,\n\t\t\tcurrent: sample\n\t\t}), {\n\t\t\tprev: null,\n\t\t\tcurrent: null\n\t\t}), filter((pair) => pair.current !== null)), ({ prev, current }) => {\n\t\t\tconst now$1 = current.timestamp;\n\t\t\tthis.updatePacketTracking(current, now$1);\n\t\t\tconst issues = this.detectIssues(current, prev, now$1);\n\t\t\tthis._networkIssues$.next(issues);\n\t\t});\n\t\tthis.subscribeTo(this._sample$.pipe(scan((history, sample) => {\n\t\t\tconst cutoff = sample.timestamp - this.historyWindowSeconds * 1e3;\n\t\t\tconst metrics = {\n\t\t\t\ttimestamp: sample.timestamp,\n\t\t\t\taudio: {\n\t\t\t\t\tpacketsReceived: sample.audioPacketsReceived,\n\t\t\t\t\tpacketsLost: sample.audioPacketsLost,\n\t\t\t\t\tjitter: sample.audioJitter\n\t\t\t\t},\n\t\t\t\tvideo: {\n\t\t\t\t\tpacketsReceived: sample.videoPacketsReceived,\n\t\t\t\t\tpacketsLost: sample.videoPacketsLost\n\t\t\t\t},\n\t\t\t\troundTripTime: sample.roundTripTime,\n\t\t\t\tavailableOutgoingBitrate: sample.availableOutgoingBitrate\n\t\t\t};\n\t\t\treturn [...history.filter((m) => m.timestamp > cutoff), metrics];\n\t\t}, [])), (metrics) => this._networkMetrics$.next(metrics));\n\t}\n\tstop() {\n\t\tif (!this.running) return;\n\t\tthis.running = false;\n\t\tlogger$13.debug(\"[RTCStatsMonitor] Stopping stats monitoring\");\n\t}\n\tdestroy() {\n\t\tlogger$13.debug(\"[RTCStatsMonitor] Destroying RTCStatsMonitor\");\n\t\tthis.stop();\n\t\tsuper.destroy();\n\t}\n\textractSample(report) {\n\t\tlet audioPacketsReceived = 0;\n\t\tlet audioPacketsLost = 0;\n\t\tlet audioJitter = 0;\n\t\tlet videoPacketsReceived = 0;\n\t\tlet videoPacketsLost = 0;\n\t\tlet roundTripTime = 0;\n\t\tlet availableOutgoingBitrate;\n\t\treport.forEach((stat) => {\n\t\t\tif (isInboundRtpStat(stat)) if (stat.kind === \"audio\") {\n\t\t\t\taudioPacketsReceived += stat.packetsReceived ?? 0;\n\t\t\t\taudioPacketsLost += stat.packetsLost ?? 0;\n\t\t\t\taudioJitter = Math.max(audioJitter, (stat.jitter ?? 0) * 1e3);\n\t\t\t} else {\n\t\t\t\tvideoPacketsReceived += stat.packetsReceived ?? 0;\n\t\t\t\tvideoPacketsLost += stat.packetsLost ?? 0;\n\t\t\t}\n\t\t\tif (isCandidatePairStat(stat) && stat.state === \"succeeded\" && stat.nominated) {\n\t\t\t\troundTripTime = stat.currentRoundTripTime ? stat.currentRoundTripTime * 1e3 : this.lastRoundTripTime;\n\t\t\t\tavailableOutgoingBitrate = stat.availableOutgoingBitrate ?? this.lastAvailableOutgoingBitrate;\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\taudioPacketsReceived,\n\t\t\taudioPacketsLost,\n\t\t\taudioJitter,\n\t\t\tvideoPacketsReceived,\n\t\t\tvideoPacketsLost,\n\t\t\troundTripTime,\n\t\t\tavailableOutgoingBitrate,\n\t\t\ttimestamp: Date.now()\n\t\t};\n\t}\n\tupdatePacketTracking(sample, now) {\n\t\tif (sample.audioPacketsReceived !== this.lastAudioPacketsReceived) {\n\t\t\tthis.lastAudioPacketsReceived = sample.audioPacketsReceived;\n\t\t\tthis.lastAudioPacketChangeTime = now;\n\t\t}\n\t\tif (sample.videoPacketsReceived !== this.lastVideoPacketsReceived) {\n\t\t\tthis.lastVideoPacketsReceived = sample.videoPacketsReceived;\n\t\t\tthis.lastVideoPacketChangeTime = now;\n\t\t}\n\t\tif (sample.roundTripTime > 0) this.lastRoundTripTime = sample.roundTripTime;\n\t\tif (sample.availableOutgoingBitrate !== void 0) this.lastAvailableOutgoingBitrate = sample.availableOutgoingBitrate;\n\t}\n\tdetectIssues(sample, prevSample, now) {\n\t\tconst issues = [];\n\t\tconst baseline = this._baseline$.value;\n\t\tconst audioSilenceMs = now - this.lastAudioPacketChangeTime;\n\t\tif (audioSilenceMs > this.noAudioPacketThresholdMs) issues.push({\n\t\t\ttype: \"no_inbound_audio\",\n\t\t\tseverity: \"critical\",\n\t\t\ttimestamp: now,\n\t\t\tvalue: audioSilenceMs,\n\t\t\tthreshold: this.noAudioPacketThresholdMs\n\t\t});\n\t\tconst videoSilenceMs = now - this.lastVideoPacketChangeTime;\n\t\tif (videoSilenceMs > this.noVideoPacketThresholdMs) issues.push({\n\t\t\ttype: \"no_inbound_video\",\n\t\t\tseverity: \"warning\",\n\t\t\ttimestamp: now,\n\t\t\tvalue: videoSilenceMs,\n\t\t\tthreshold: this.noVideoPacketThresholdMs\n\t\t});\n\t\tif (baseline.ready) {\n\t\t\tconst rtt = sample.roundTripTime;\n\t\t\tconst baselineRtt = baseline.rtt;\n\t\t\tif (baselineRtt > 0) {\n\t\t\t\tconst rttRatio = rtt / baselineRtt;\n\t\t\t\tif (rttRatio > this.rttSpikeCriticalMultiplier) issues.push({\n\t\t\t\t\ttype: \"high_rtt\",\n\t\t\t\t\tseverity: \"critical\",\n\t\t\t\t\ttimestamp: now,\n\t\t\t\t\tvalue: rtt,\n\t\t\t\t\tthreshold: baselineRtt * this.rttSpikeCriticalMultiplier\n\t\t\t\t});\n\t\t\t\telse if (rttRatio > this.rttSpikeWarningMultiplier) issues.push({\n\t\t\t\t\ttype: \"high_rtt\",\n\t\t\t\t\tseverity: \"warning\",\n\t\t\t\t\ttimestamp: now,\n\t\t\t\t\tvalue: rtt,\n\t\t\t\t\tthreshold: baselineRtt * this.rttSpikeWarningMultiplier\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst jitter = sample.audioJitter;\n\t\t\tconst baselineJitter = baseline.jitter;\n\t\t\tif (baselineJitter > 0) {\n\t\t\t\tif (jitter / baselineJitter > this.jitterSpikeMultiplier) issues.push({\n\t\t\t\t\ttype: \"high_jitter\",\n\t\t\t\t\tseverity: \"warning\",\n\t\t\t\t\ttimestamp: now,\n\t\t\t\t\tvalue: jitter,\n\t\t\t\t\tthreshold: baselineJitter * this.jitterSpikeMultiplier\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (prevSample) {\n\t\t\tconst deltaAudioReceived = Math.max(0, sample.audioPacketsReceived - prevSample.audioPacketsReceived);\n\t\t\tconst deltaAudioLost = Math.max(0, sample.audioPacketsLost - prevSample.audioPacketsLost);\n\t\t\tconst deltaVideoReceived = Math.max(0, sample.videoPacketsReceived - prevSample.videoPacketsReceived);\n\t\t\tconst deltaVideoLost = Math.max(0, sample.videoPacketsLost - prevSample.videoPacketsLost);\n\t\t\tconst totalDeltaReceived = deltaAudioReceived + deltaVideoReceived;\n\t\t\tconst lossPercent = computePacketLossPercent(deltaAudioLost + deltaVideoLost, totalDeltaReceived);\n\t\t\tif (lossPercent > this.packetLossCriticalPercent) issues.push({\n\t\t\t\ttype: \"high_packet_loss\",\n\t\t\t\tseverity: \"critical\",\n\t\t\t\ttimestamp: now,\n\t\t\t\tvalue: lossPercent,\n\t\t\t\tthreshold: this.packetLossCriticalPercent\n\t\t\t});\n\t\t\telse if (lossPercent > this.packetLossWarningPercent) issues.push({\n\t\t\t\ttype: \"high_packet_loss\",\n\t\t\t\tseverity: \"warning\",\n\t\t\t\ttimestamp: now,\n\t\t\t\tvalue: lossPercent,\n\t\t\t\tthreshold: this.packetLossWarningPercent\n\t\t\t});\n\t\t}\n\t\treturn issues;\n\t}\n};\n\n//#endregion\n//#region src/managers/CallRecoveryManager.ts\nconst logger$12 = getLogger();\nconst DEFAULT_DEBOUNCE_TIME_MS = 2e3;\nconst DEFAULT_COOLDOWN_MS = 1e4;\nconst DEFAULT_ICE_GRACE_PERIOD_MS = 3e3;\nconst DEFAULT_ICE_RESTART_TIMEOUT_MS = 5e3;\nconst DEFAULT_MAX_ATTEMPTS = 3;\nconst DEFAULT_KEYFRAME_MAX_BURST = 3;\nconst DEFAULT_KEYFRAME_BURST_WINDOW_MS = 3e3;\nconst DEFAULT_KEYFRAME_COOLDOWN_MS = 1e4;\nconst DEFAULT_DEGRADATION_BITRATE_THRESHOLD = 150;\nconst DEFAULT_DEGRADATION_RECOVERY_THRESHOLD = 300;\nconst DEFAULT_PACKET_LOSS_RECOVERY_DELAY_SEC = 5;\n/**\n* Issue types that indicate quality degradation but NOT connectivity loss.\n* These should only trigger Tier 1 (keyframe) — never ICE restart.\n* The network path is slow or lossy, but media is still flowing.\n*/\nconst DEGRADATION_ONLY_ISSUES = new Set([\n\t\"high_rtt\",\n\t\"high_jitter\",\n\t\"high_packet_loss\"\n]);\n/**\n* Implements the tiered recovery pipeline described in Sections 2, 19, 22,\n* and 25 of the implementation guide.\n*\n* Three detection signals (stats critical, ICE state, network events) are\n* merged, debounced, and processed through tiered recovery:\n* Tier 1 - Request video keyframe (throttled burst)\n* Tier 2 - ICE restart via verto.modify\n* Tier 3 - Relay-only ICE restart\n*\n* Gate checks prevent recovery when the call is not in a recoverable state.\n* A state machine tracks the pipeline: IDLE -> DEBOUNCING -> RECOVERING -> COOLDOWN.\n*/\nvar CallRecoveryManager = class extends Destroyable {\n\tconstructor(callbacks, inputs, config = {}) {\n\t\tsuper();\n\t\tthis._recoveryState$ = this.createBehaviorSubject(\"idle\");\n\t\tthis._recoveryEvent$ = this.createSubject();\n\t\tthis._bandwidthConstrained$ = this.createBehaviorSubject(false);\n\t\tthis._hasPacketLoss$ = this.createBehaviorSubject(false);\n\t\tthis._trigger$ = this.createSubject();\n\t\tthis._attemptCount = 0;\n\t\tthis._keyframeBurstCount = 0;\n\t\tthis._keyframeBurstStart = 0;\n\t\tthis._keyframeCooldownUntil = 0;\n\t\tthis._cooldownUntil = 0;\n\t\tthis._pipelineStop$ = this.createSubject();\n\t\tthis._callbacks = callbacks;\n\t\tthis._inputs = inputs;\n\t\tthis._config = {\n\t\t\tdebounceTimeMs: config.debounceTimeMs ?? DEFAULT_DEBOUNCE_TIME_MS,\n\t\t\tcooldownMs: config.cooldownMs ?? DEFAULT_COOLDOWN_MS,\n\t\t\ticeGracePeriodMs: config.iceGracePeriodMs ?? DEFAULT_ICE_GRACE_PERIOD_MS,\n\t\t\ticeRestartTimeoutMs: config.iceRestartTimeoutMs ?? DEFAULT_ICE_RESTART_TIMEOUT_MS,\n\t\t\tmaxAttempts: config.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,\n\t\t\tenableRelayFallback: config.enableRelayFallback ?? true,\n\t\t\tkeyframeMaxBurst: config.keyframeMaxBurst ?? DEFAULT_KEYFRAME_MAX_BURST,\n\t\t\tkeyframeBurstWindowMs: config.keyframeBurstWindowMs ?? DEFAULT_KEYFRAME_BURST_WINDOW_MS,\n\t\t\tkeyframeCooldownMs: config.keyframeCooldownMs ?? DEFAULT_KEYFRAME_COOLDOWN_MS,\n\t\t\tdegradationBitrateThreshold: config.degradationBitrateThreshold ?? DEFAULT_DEGRADATION_BITRATE_THRESHOLD,\n\t\t\tdegradationRecoveryThreshold: config.degradationRecoveryThreshold ?? DEFAULT_DEGRADATION_RECOVERY_THRESHOLD,\n\t\t\tenableAutoDegradation: config.enableAutoDegradation ?? true,\n\t\t\tpacketLossRecoveryDelaySec: config.packetLossRecoveryDelaySec ?? DEFAULT_PACKET_LOSS_RECOVERY_DELAY_SEC\n\t\t};\n\t\tthis.initPipeline();\n\t\tthis.initDegradationRecoveryPipeline();\n\t}\n\tget recoveryState$() {\n\t\treturn this._recoveryState$.asObservable().pipe(takeUntil(this._destroyed$));\n\t}\n\tget recoveryState() {\n\t\treturn this._recoveryState$.value;\n\t}\n\tget recoveryEvent$() {\n\t\treturn this._recoveryEvent$.asObservable().pipe(takeUntil(this._destroyed$));\n\t}\n\tget bandwidthConstrained$() {\n\t\treturn this._bandwidthConstrained$.asObservable().pipe(takeUntil(this._destroyed$));\n\t}\n\tget bandwidthConstrained() {\n\t\treturn this._bandwidthConstrained$.value;\n\t}\n\t/**\n\t* Feed an external detection signal into the recovery pipeline.\n\t* Multiple signals are debounced and collapsed automatically.\n\t*/\n\tpushTrigger(trigger) {\n\t\tthis._trigger$.next(trigger);\n\t}\n\t/**\n\t* Manual ICE restart request — bypasses cooldown and gate checks,\n\t* but skips if the pipeline is already recovering to avoid races.\n\t*/\n\tasync requestIceRestart() {\n\t\tif (this._recoveryState$.value === \"recovering\") {\n\t\t\tlogger$12.info(\"CallRecoveryManager: manual ICE restart skipped — recovery already in progress\");\n\t\t\treturn;\n\t\t}\n\t\tlogger$12.info(\"CallRecoveryManager: manual ICE restart requested\");\n\t\tthis.transitionTo(\"recovering\");\n\t\tawait this.executeIceRestart(false);\n\t\tthis.startCooldown();\n\t}\n\t/**\n\t* Manual keyframe request — subject to burst throttling only.\n\t*/\n\trequestKeyframe() {\n\t\tthis.executeKeyframe(\"manual request\");\n\t}\n\t/**\n\t* Reset all attempt counters and cooldowns. Should be called after\n\t* WebSocket reconnect or call state recovers to 'connected'.\n\t*/\n\treset() {\n\t\tlogger$12.info(\"CallRecoveryManager: resetting counters\");\n\t\tthis._attemptCount = 0;\n\t\tthis._keyframeBurstCount = 0;\n\t\tthis._keyframeBurstStart = 0;\n\t\tthis._keyframeCooldownUntil = 0;\n\t\tthis._cooldownUntil = 0;\n\t\tthis.transitionTo(\"idle\");\n\t}\n\t/**\n\t* Notify the recovery manager that a verto.modify (ICE restart SDP exchange)\n\t* failed at the signaling layer. Resets cooldown and pushes a new trigger\n\t* so recovery can re-attempt.\n\t*/\n\tnotifyModifyFailed() {\n\t\tif (this._recoveryState$.value === \"cooldown\" || this._recoveryState$.value === \"idle\") {\n\t\t\tlogger$12.info(\"CallRecoveryManager: verto.modify failed — re-entering recovery\");\n\t\t\tthis._cooldownUntil = 0;\n\t\t\tthis.transitionTo(\"idle\");\n\t\t\tthis.pushTrigger({\n\t\t\t\tsource: \"network\",\n\t\t\t\tdetail: \"modify_failed_during_recovery\"\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* Feed bandwidth information for graceful degradation (Section 22).\n\t* Call this from the stats monitor with current available outgoing bitrate.\n\t*/\n\treportBandwidth(bitrateKbps) {\n\t\tif (!this._config.enableAutoDegradation) return;\n\t\tconst wasConstrained = this._bandwidthConstrained$.value;\n\t\tif (!wasConstrained && bitrateKbps < this._config.degradationBitrateThreshold) {\n\t\t\tthis._bandwidthConstrained$.next(true);\n\t\t\tthis._callbacks.disableVideo();\n\t\t\tthis.emitEvent({\n\t\t\t\taction: \"video_disabled\",\n\t\t\t\treason: `bandwidth ${bitrateKbps}kbps below threshold ${this._config.degradationBitrateThreshold}kbps`,\n\t\t\t\ttimestamp: Date.now()\n\t\t\t});\n\t\t\tlogger$12.warn(`CallRecoveryManager: disabling video — bandwidth ${bitrateKbps}kbps < ${this._config.degradationBitrateThreshold}kbps`);\n\t\t} else if (wasConstrained && bitrateKbps >= this._config.degradationRecoveryThreshold) {\n\t\t\tthis._bandwidthConstrained$.next(false);\n\t\t\tthis._callbacks.enableVideo();\n\t\t\tthis.emitEvent({\n\t\t\t\taction: \"video_restored\",\n\t\t\t\treason: `bandwidth ${bitrateKbps}kbps recovered above ${this._config.degradationRecoveryThreshold}kbps`,\n\t\t\t\ttimestamp: Date.now()\n\t\t\t});\n\t\t\tlogger$12.info(`CallRecoveryManager: restoring video — bandwidth ${bitrateKbps}kbps >= ${this._config.degradationRecoveryThreshold}kbps`);\n\t\t}\n\t}\n\t/**\n\t* Feed current network issues for degradation recovery.\n\t* When video was disabled due to bandwidth constraints, this pipeline\n\t* monitors packet loss clearance to trigger video restoration.\n\t*/\n\treportNetworkIssues(issues) {\n\t\tconst hasPacketLoss = issues.some((i) => i.type === \"high_packet_loss\");\n\t\tif (hasPacketLoss !== this._hasPacketLoss$.value) this._hasPacketLoss$.next(hasPacketLoss);\n\t}\n\t/**\n\t* Signal-only vs full reconnect distinction (Section 25).\n\t* Call this when WebSocket reconnects to determine the appropriate action.\n\t*/\n\thandleWebSocketReconnect() {\n\t\tconst pcState = this._callbacks.getPeerConnectionState();\n\t\tif (pcState === \"connected\" || pcState === \"completed\") {\n\t\t\tlogger$12.info(\"CallRecoveryManager: signal-only reconnect — peer connection still alive\");\n\t\t\tthis.emitEvent({\n\t\t\t\taction: \"signal_reconnect\",\n\t\t\t\treason: \"WebSocket reconnected, peer connection still connected\",\n\t\t\t\ttimestamp: Date.now()\n\t\t\t});\n\t\t} else {\n\t\t\tlogger$12.info(\"CallRecoveryManager: full reconnect — peer connection also down\");\n\t\t\tthis.emitEvent({\n\t\t\t\taction: \"full_reconnect\",\n\t\t\t\treason: \"WebSocket reconnected, peer connection not connected — ICE restart needed\",\n\t\t\t\ttimestamp: Date.now()\n\t\t\t});\n\t\t\tthis.pushTrigger({\n\t\t\t\tsource: \"network\",\n\t\t\t\tdetail: \"full_reconnect_after_ws\"\n\t\t\t});\n\t\t}\n\t\tthis.reset();\n\t}\n\tdestroy() {\n\t\tthis._pipelineStop$.next();\n\t\tthis._pipelineStop$.complete();\n\t\tsuper.destroy();\n\t}\n\tinitPipeline() {\n\t\tthis.subscribeTo(this._trigger$.pipe(tap(() => {\n\t\t\tif (this._recoveryState$.value === \"idle\") this.transitionTo(\"debouncing\");\n\t\t}), debounceTime(this._config.debounceTimeMs), withLatestFrom(this._inputs.signalingReady$), filter(([, signalingReady]) => this.passGateChecks(signalingReady)), map(([trigger]) => trigger), exhaustMap((trigger) => this.executeTieredRecovery(trigger)), takeUntil(merge(this._destroyed$, this._pipelineStop$))), {\n\t\t\tnext: () => {},\n\t\t\terror: (err) => {\n\t\t\t\tlogger$12.error(\"CallRecoveryManager: pipeline error\", err);\n\t\t\t\tthis.transitionTo(\"idle\");\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* When video was disabled due to bandwidth constraints, the browser's\n\t* bandwidth estimator loses its primary probe signal (video traffic).\n\t* This means availableOutgoingBitrate may never recover to the restoration\n\t* threshold. Instead, we watch for packet loss clearance as a proxy for\n\t* network recovery: if high_packet_loss stays absent for a configurable\n\t* duration while video is degraded, we restore the video track.\n\t*/\n\tinitDegradationRecoveryPipeline() {\n\t\tif (!this._config.enableAutoDegradation) return;\n\t\tconst delayMs = this._config.packetLossRecoveryDelaySec * 1e3;\n\t\tthis.subscribeTo(combineLatest([this._bandwidthConstrained$, this._hasPacketLoss$]).pipe(switchMap(([constrained, hasPacketLoss]) => {\n\t\t\tif (constrained && !hasPacketLoss) return timer(delayMs);\n\t\t\treturn EMPTY;\n\t\t}), takeUntil(this._destroyed$)), () => {\n\t\t\tthis._bandwidthConstrained$.next(false);\n\t\t\tthis._callbacks.enableVideo();\n\t\t\tthis.emitEvent({\n\t\t\t\taction: \"video_restored\",\n\t\t\t\treason: `no packet loss for ${this._config.packetLossRecoveryDelaySec}s — restoring video`,\n\t\t\t\ttimestamp: Date.now()\n\t\t\t});\n\t\t\tlogger$12.info(`CallRecoveryManager: restoring video — no packet loss for ${this._config.packetLossRecoveryDelaySec}s`);\n\t\t});\n\t}\n\tpassGateChecks(signalingReady) {\n\t\tif (this._callbacks.isNegotiating()) {\n\t\t\tlogger$12.debug(\"CallRecoveryManager: gate blocked — negotiation in progress\");\n\t\t\tthis.transitionTo(\"idle\");\n\t\t\treturn false;\n\t\t}\n\t\tif (!signalingReady) {\n\t\t\tlogger$12.debug(\"CallRecoveryManager: gate blocked — signaling not ready\");\n\t\t\tthis.transitionTo(\"idle\");\n\t\t\treturn false;\n\t\t}\n\t\tif (!this._callbacks.isCallConnected()) {\n\t\t\tlogger$12.debug(\"CallRecoveryManager: gate blocked — call not connected\");\n\t\t\tthis.transitionTo(\"idle\");\n\t\t\treturn false;\n\t\t}\n\t\tif (this.isCooldownActive()) {\n\t\t\tlogger$12.debug(\"CallRecoveryManager: gate blocked — cooldown active\");\n\t\t\tthis.transitionTo(\"cooldown\");\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\tisCooldownActive() {\n\t\treturn Date.now() < this._cooldownUntil;\n\t}\n\texecuteTieredRecovery(trigger) {\n\t\tthis.transitionTo(\"recovering\");\n\t\tlogger$12.info(`CallRecoveryManager: starting tiered recovery — source=${trigger.source} detail=${trigger.detail}`);\n\t\treturn from(this.runTiers(trigger)).pipe(tap(() => this.startCooldown()), catchError((err) => {\n\t\t\tlogger$12.error(\"CallRecoveryManager: tiered recovery failed\", err);\n\t\t\tthis.startCooldown();\n\t\t\treturn EMPTY;\n\t\t}));\n\t}\n\tasync runTiers(trigger) {\n\t\tthis.executeKeyframe(trigger.detail);\n\t\tif (trigger.issueType && DEGRADATION_ONLY_ISSUES.has(trigger.issueType)) {\n\t\t\tlogger$12.debug(`CallRecoveryManager: degradation-only issue (${trigger.issueType}) — Tier 1 only, skipping ICE restart`);\n\t\t\treturn;\n\t\t}\n\t\tif (this._attemptCount < this._config.maxAttempts) {\n\t\t\tif (await this.executeIceRestart(false)) return;\n\t\t}\n\t\tif (this._config.enableRelayFallback && this._attemptCount < this._config.maxAttempts) {\n\t\t\tif (await this.executeIceRestart(true)) return;\n\t\t}\n\t\tif (this._attemptCount >= this._config.maxAttempts) {\n\t\t\tthis.emitEvent({\n\t\t\t\taction: \"max_attempts_reached\",\n\t\t\t\treason: `all ${this._config.maxAttempts} recovery attempts exhausted`,\n\t\t\t\tattempt: this._attemptCount,\n\t\t\t\tmaxAttempts: this._config.maxAttempts,\n\t\t\t\ttimestamp: Date.now()\n\t\t\t});\n\t\t\tlogger$12.warn(\"CallRecoveryManager: max recovery attempts reached\");\n\t\t}\n\t}\n\texecuteKeyframe(reason) {\n\t\tconst now = Date.now();\n\t\tif (now < this._keyframeCooldownUntil) {\n\t\t\tlogger$12.debug(\"CallRecoveryManager: keyframe request skipped — cooldown active\");\n\t\t\treturn;\n\t\t}\n\t\tif (now - this._keyframeBurstStart > this._config.keyframeBurstWindowMs) {\n\t\t\tthis._keyframeBurstCount = 0;\n\t\t\tthis._keyframeBurstStart = now;\n\t\t}\n\t\tif (this._keyframeBurstCount >= this._config.keyframeMaxBurst) {\n\t\t\tthis._keyframeCooldownUntil = now + this._config.keyframeCooldownMs;\n\t\t\tlogger$12.debug(`CallRecoveryManager: keyframe burst limit reached (${this._config.keyframeMaxBurst}), cooldown until ${this._keyframeCooldownUntil}`);\n\t\t\treturn;\n\t\t}\n\t\tthis._keyframeBurstCount += 1;\n\t\tthis._callbacks.requestKeyframe();\n\t\tthis.emitEvent({\n\t\t\taction: \"keyframe_requested\",\n\t\t\treason,\n\t\t\ttimestamp: now\n\t\t});\n\t\tlogger$12.debug(`CallRecoveryManager: keyframe requested (burst ${this._keyframeBurstCount}/${this._config.keyframeMaxBurst})`);\n\t}\n\tasync executeIceRestart(relayOnly) {\n\t\tthis._attemptCount += 1;\n\t\tconst tier = relayOnly ? \"Tier 3 (relay-only)\" : \"Tier 2 (standard)\";\n\t\tlogger$12.info(`CallRecoveryManager: ${tier} ICE restart — attempt ${this._attemptCount}/${this._config.maxAttempts}`);\n\t\tthis.emitEvent({\n\t\t\taction: \"reinvite_started\",\n\t\t\treason: `${tier} ICE restart`,\n\t\t\tattempt: this._attemptCount,\n\t\t\tmaxAttempts: this._config.maxAttempts,\n\t\t\ttimestamp: Date.now()\n\t\t});\n\t\ttry {\n\t\t\tif (await this.withTimeout(this._callbacks.requestIceRestart(relayOnly), this._config.iceRestartTimeoutMs)) {\n\t\t\t\tthis.emitEvent({\n\t\t\t\t\taction: \"reinvite_succeeded\",\n\t\t\t\t\treason: `${tier} ICE restart succeeded`,\n\t\t\t\t\tattempt: this._attemptCount,\n\t\t\t\t\tmaxAttempts: this._config.maxAttempts,\n\t\t\t\t\ttimestamp: Date.now()\n\t\t\t\t});\n\t\t\t\tlogger$12.info(`CallRecoveryManager: ${tier} ICE restart succeeded`);\n\t\t\t\tthis._attemptCount = 0;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tthis.emitEvent({\n\t\t\t\taction: \"reinvite_failed\",\n\t\t\t\treason: `${tier} ICE restart returned false`,\n\t\t\t\tattempt: this._attemptCount,\n\t\t\t\tmaxAttempts: this._config.maxAttempts,\n\t\t\t\ttimestamp: Date.now()\n\t\t\t});\n\t\t\tlogger$12.warn(`CallRecoveryManager: ${tier} ICE restart failed`);\n\t\t\treturn false;\n\t\t} catch {\n\t\t\tthis.emitEvent({\n\t\t\t\taction: \"reinvite_timeout\",\n\t\t\t\treason: `${tier} ICE restart timed out after ${this._config.iceRestartTimeoutMs}ms`,\n\t\t\t\tattempt: this._attemptCount,\n\t\t\t\tmaxAttempts: this._config.maxAttempts,\n\t\t\t\ttimestamp: Date.now()\n\t\t\t});\n\t\t\tlogger$12.warn(`CallRecoveryManager: ${tier} ICE restart timed out`);\n\t\t\treturn false;\n\t\t}\n\t}\n\tasync withTimeout(promise, timeoutMs) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst timeoutId = setTimeout(() => {\n\t\t\t\treject(/* @__PURE__ */ new Error(`Timeout after ${timeoutMs}ms`));\n\t\t\t}, timeoutMs);\n\t\t\tpromise.then((value) => {\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\tresolve(value);\n\t\t\t}, (err) => {\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\treject(err instanceof Error ? err : new Error(String(err)));\n\t\t\t});\n\t\t});\n\t}\n\ttransitionTo(state) {\n\t\tconst prev = this._recoveryState$.value;\n\t\tif (prev !== state) {\n\t\t\tlogger$12.debug(`CallRecoveryManager: state ${prev} -> ${state}`);\n\t\t\tthis._recoveryState$.next(state);\n\t\t}\n\t}\n\tstartCooldown() {\n\t\tthis._cooldownUntil = Date.now() + this._config.cooldownMs;\n\t\tthis.transitionTo(\"cooldown\");\n\t\tif (this._cooldownSubscription) this._cooldownSubscription.unsubscribe();\n\t\tthis._cooldownSubscription = timer(this._config.cooldownMs).pipe(take(1), takeUntil(this._destroyed$), filter(() => this._recoveryState$.value === \"cooldown\")).subscribe(() => this.transitionTo(\"idle\"));\n\t}\n\temitEvent(event) {\n\t\tthis._recoveryEvent$.next(event);\n\t}\n};\n\n//#endregion\n//#region src/managers/ParticipantFactory.ts\n/**\n* Factory for creating Participant instances with proper dependency injection\n* Eliminates circular dependency between Call and Participant\n*/\nvar ParticipantFactory = class {\n\tconstructor(executeMethod, vertoManager, deviceController) {\n\t\tthis.executeMethod = executeMethod;\n\t\tthis.vertoManager = vertoManager;\n\t\tthis.deviceController = deviceController;\n\t}\n\t/**\n\t* Create a self participant (the local user in the call)\n\t*/\n\tcreateSelfParticipant(id) {\n\t\treturn new SelfParticipant(id, this.executeMethod, this.vertoManager, this.deviceController);\n\t}\n\t/**\n\t* Create a remote participant\n\t*/\n\tcreateParticipant(id) {\n\t\treturn new Participant(id, this.executeMethod, this.deviceController);\n\t}\n};\n\n//#endregion\n//#region src/utils/qualityScore.ts\n/** E-model base R factor for a perfect channel. */\nconst E_MODEL_BASE_R = 93.2;\n/** Delay/jitter weight factor. */\nconst E_MODEL_DELAY_WEIGHT = .024;\n/** Packet-loss weight factor. */\nconst E_MODEL_LOSS_WEIGHT = 2.5;\n/** R-factor valid range for the E-model polynomial. */\nconst R_FACTOR_MIN = 0;\nconst R_FACTOR_MAX = 100;\n/** Lower bound for MOS. */\nconst MOS_MIN = 1;\n/** Upper bound for MOS. */\nconst MOS_MAX = 5;\n/** MOS threshold boundaries (lower bound of each level). */\nconst MOS_EXCELLENT_THRESHOLD = 4;\nconst MOS_GOOD_THRESHOLD = 3.5;\nconst MOS_FAIR_THRESHOLD = 3;\nconst MOS_POOR_THRESHOLD = 2;\n/**\n* Compute a Mean Opinion Score from network metrics using the simplified\n* E-model formula (ITU-T G.107).\n*\n* ```\n* R = 93.2 - (rtt/2 + jitter) * 0.024 - packetLoss * 2.5\n* MOS = 1 + 0.035 * R + R * (R - 60) * (100 - R) * 7e-6\n* ```\n*\n* @param rtt Round-trip time in milliseconds\n* @param jitter Jitter in milliseconds\n* @param packetLoss Packet loss as a percentage (e.g. 5 means 5%)\n* @returns MOS value clamped to [1.0, 5.0]\n*/\nfunction computeMOS(rtt, jitter, packetLoss) {\n\tconst rawR = E_MODEL_BASE_R - (rtt / 2 + jitter) * E_MODEL_DELAY_WEIGHT - packetLoss * E_MODEL_LOSS_WEIGHT;\n\tconst r = Math.min(R_FACTOR_MAX, Math.max(R_FACTOR_MIN, rawR));\n\tconst mos = 1 + .035 * r + r * (r - 60) * (100 - r) * 7e-6;\n\treturn Math.min(MOS_MAX, Math.max(MOS_MIN, mos));\n}\n/**\n* Map a numeric MOS score to a human-readable quality level.\n*\n* | MOS Range | Level |\n* |-------------|-------------|\n* | 4.0 - 5.0 | excellent |\n* | 3.5 - 4.0 | good |\n* | 3.0 - 3.5 | fair |\n* | 2.0 - 3.0 | poor |\n* | 1.0 - 2.0 | critical |\n*/\nfunction mosToQualityLevel(mos) {\n\tif (mos >= MOS_EXCELLENT_THRESHOLD) return \"excellent\";\n\tif (mos >= MOS_GOOD_THRESHOLD) return \"good\";\n\tif (mos >= MOS_FAIR_THRESHOLD) return \"fair\";\n\tif (mos >= MOS_POOR_THRESHOLD) return \"poor\";\n\treturn \"critical\";\n}\n\n//#endregion\n//#region src/core/entities/Call.ts\nconst logger$11 = getLogger();\n/**\n* Ratio between the critical and warning RTT spike multipliers.\n* Warning threshold = baseline * warningMultiplier (default 3x)\n* Critical threshold = baseline * warningMultiplier * RTT_CRITICAL_TO_WARNING_RATIO\n* With default 3x warning: critical = 3 * 5/3 = 5x baseline.\n*/\nconst RTT_CRITICAL_TO_WARNING_RATIO = 5 / 3;\nconst fromDestinationParams = (destination) => {\n\tif (!destination) return {};\n\ttry {\n\t\tconst url = new URL(`destination:${destination}`);\n\t\tconst params = {};\n\t\turl.searchParams.forEach((value, key) => {\n\t\t\tparams[key] = value;\n\t\t});\n\t\treturn params;\n\t} catch (error) {\n\t\tlogger$11.warn(`Failed to parse destination URI: ${destination}`, error);\n\t\treturn {};\n\t}\n};\n/**\n* Concrete WebRTC call implementation.\n*\n* Manages the full lifecycle of a call including signaling, media streams,\n* participants, layout, and event routing. Created via {@link SignalWire.dial}\n* or received as an inbound call.\n*/\nvar WebRTCCall = class extends Destroyable {\n\tconstructor(clientSession, options, initialization, address) {\n\t\tsuper();\n\t\tthis.clientSession = clientSession;\n\t\tthis.options = options;\n\t\tthis.address = address;\n\t\tthis._errors$ = this.createReplaySubject(1);\n\t\tthis._lastMergedStatus = \"new\";\n\t\tthis._answered$ = this.createReplaySubject();\n\t\tthis._holdState = false;\n\t\tthis._userVariables$ = this.createBehaviorSubject({ ...PreferencesContainer.instance.userVariables });\n\t\tthis._networkIssues$ = this.createBehaviorSubject([]);\n\t\tthis._networkMetrics$ = this.createBehaviorSubject([]);\n\t\tthis._isNetworkHealthy$ = this.createBehaviorSubject(true);\n\t\tthis._qualityScore$ = this.createBehaviorSubject(5);\n\t\tthis._qualityLevel$ = this.createBehaviorSubject(\"excellent\");\n\t\tthis._recoveryState$ = this.createBehaviorSubject(\"idle\");\n\t\tthis._recoveryEvent$ = this.createSubject();\n\t\tthis._bandwidthConstrained$ = this.createBehaviorSubject(false);\n\t\tthis._mediaParamsUpdated$ = this.createSubject();\n\t\tthis._customSubscriptions = /* @__PURE__ */ new Map();\n\t\tthis._pushToTalkEnabled = false;\n\t\tthis._remoteAudioMeter = null;\n\t\tthis.id = options.callId ?? v4();\n\t\tthis.to = options.to;\n\t\tthis._userVariables$.next({\n\t\t\t...this._userVariables$.value,\n\t\t\t...fromDestinationParams(options.to),\n\t\t\t...options.userVariables\n\t\t});\n\t\tthis.subscribeTo(this.webrtcMessages$, (message) => {\n\t\t\tconst userVars = getValueFrom(message, \"params.userVariables\");\n\t\t\tif (userVars) this._userVariables$.next({\n\t\t\t\t...this._userVariables$.value,\n\t\t\t\t...userVars\n\t\t\t});\n\t\t});\n\t\tconst managers = initialization.initializeManagers(this);\n\t\tthis.vertoManager = managers.vertoManager;\n\t\tthis.callEventsManager = managers.callEventsManager;\n\t\tif (options.initOffer) {\n\t\t\tthis._status$ = this.createBehaviorSubject(\"ringing\");\n\t\t\tthis._lastMergedStatus = \"ringing\";\n\t\t} else this._status$ = this.createBehaviorSubject(\"new\");\n\t\tconst { deviceController, networkChange$ } = initialization;\n\t\tthis._networkChange$ = networkChange$;\n\t\tthis.participantFactory = new ParticipantFactory(this.executeMethod.bind(this), this.vertoManager, deviceController);\n\t\tthis.subscribeTo(merge(this._status$.asObservable(), this.vertoManager.signalingStatus$).pipe(distinctUntilChanged(), takeUntil(this._destroyed$)), (status) => {\n\t\t\tthis._lastMergedStatus = status;\n\t\t\tif (status === \"connected\" && !this._statsMonitor) this.initResilienceSubsystems();\n\t\t\telse if (status === \"disconnected\") {\n\t\t\t\tthis._statsMonitor?.destroy();\n\t\t\t\tthis._statsMonitor = void 0;\n\t\t\t} else if (status === \"destroyed\" || status === \"failed\") this.stopResilienceSubsystems();\n\t\t});\n\t}\n\t/** Observable stream of errors from media, signaling, and peer connection layers. */\n\tget errors$() {\n\t\treturn this.deferEmission(this._errors$.asObservable());\n\t}\n\t/**\n\t* @internal Push an error to the call's error stream.\n\t* Fatal errors automatically transition the call to `'failed'` and destroy it.\n\t*/\n\temitError(callError) {\n\t\tif (this._status$.value === \"destroyed\" || this._status$.value === \"failed\") return;\n\t\tthis._errors$.next(callError);\n\t\tif (callError.fatal) {\n\t\t\tthis._status$.next(\"failed\");\n\t\t\tthis.destroy();\n\t\t}\n\t}\n\t/** Notify the recovery manager that a verto.modify signaling exchange failed. */\n\tnotifyModifyFailed() {\n\t\tthis._recoveryManager?.notifyModifyFailed();\n\t}\n\t/** Whether this call is `'inbound'` or `'outbound'`. */\n\tget direction() {\n\t\treturn this.options.initOffer ? \"inbound\" : \"outbound\";\n\t}\n\t/** Observable of the address associated with this call. */\n\tget address$() {\n\t\treturn this.deferEmission(from([this.address])).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Display name of the caller. */\n\tget fromName() {\n\t\treturn this.options.fromName;\n\t}\n\t/** Address URI of the caller. */\n\tget from() {\n\t\treturn this.options.from;\n\t}\n\t/** Display name of the callee. */\n\tget toName() {\n\t\treturn this.options.toName;\n\t}\n\t/** Toggles whether incoming video is received. @throws {UnimplementedError} Not yet implemented. */\n\tasync toggleIncomingVideo() {\n\t\tthrow new UnimplementedError();\n\t}\n\t/** Toggles whether incoming audio is received. @throws {UnimplementedError} Not yet implemented. */\n\tasync toggleIncomingAudio() {\n\t\tthrow new UnimplementedError();\n\t}\n\t/** @internal Registers an additional call ID for event routing. */\n\taddCallId(callId) {\n\t\tthis.callEventsManager.addCallId(callId);\n\t}\n\t/** List of capabilities available in the current call. */\n\tget capabilities() {\n\t\treturn this.callEventsManager.capabilities;\n\t}\n\t/** Current snapshot of all participants in the call. */\n\tget participants() {\n\t\treturn this.callEventsManager.participants;\n\t}\n\t/** The local participant, or `null` if not yet joined. */\n\tget self() {\n\t\treturn this.callEventsManager.self;\n\t}\n\t/** Toggles the call lock state, preventing or allowing new participants from joining. */\n\tasync toggleLock() {\n\t\tconst method = this.locked ? \"call.unlock\" : \"call.lock\";\n\t\tawait this.executeMethod(this.selfId ?? \"\", method, {});\n\t}\n\t/**\n\t* Toggles the hold state of the call (pauses/resumes local media transmission).\n\t*\n\t* Distinct from {@link Participant.toggleMute} which mutes individual tracks.\n\t*/\n\tasync toggleHold() {\n\t\tif (this._holdState) await this.vertoManager.unhold();\n\t\telse await this.vertoManager.hold();\n\t\tthis._holdState = !this._holdState;\n\t}\n\t/** @throws {UnimplementedError} Not yet implemented. Status tracked via {@link recording$}. */\n\tasync startRecording() {\n\t\tthrow new UnimplementedError();\n\t}\n\t/** @throws {UnimplementedError} Not yet implemented. Status tracked via {@link streaming$}. */\n\tasync startStreaming() {\n\t\tthrow new UnimplementedError();\n\t}\n\t/**\n\t* Replaces the call's custom metadata.\n\t* @param _meta - Metadata object to set.\n\t* @throws {UnimplementedError} Not yet implemented.\n\t*/\n\tasync setMeta(_meta) {\n\t\tthrow new UnimplementedError();\n\t}\n\t/**\n\t* Merges values into the call's custom metadata (unlike {@link setMeta} which replaces).\n\t* @param _meta - Metadata to merge.\n\t* @throws {UnimplementedError} Not yet implemented.\n\t*/\n\tasync updateMeta(_meta) {\n\t\tthrow new UnimplementedError();\n\t}\n\t/** Observable of layout layer positions for all participants. */\n\tget layoutLayers$() {\n\t\treturn this.deferEmission(this.callEventsManager.layoutLayers$).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Current snapshot of layout layers. */\n\tget layoutLayers() {\n\t\treturn this.callEventsManager.layoutLayers;\n\t}\n\t/**\n\t* Executes a Verto RPC method targeting a specific participant.\n\t*\n\t* Constructs call context (node_id, call_id, member_id) and sends the RPC request.\n\t*\n\t* @param target - Target member ID string, or a {@link MemberTarget} object.\n\t* @param method - Verto method name (e.g. `'call.mute'`, `'call.member.remove'`).\n\t* @param args - Parameters for the RPC method.\n\t* @returns The RPC response.\n\t* @throws {JSONRPCError} If the RPC call returns an error.\n\t*/\n\tasync executeMethod(target, method, args) {\n\t\tconst params = this.buildMethodParams(target, args);\n\t\tconst request = buildRPCRequest({\n\t\t\tmethod,\n\t\t\tparams\n\t\t});\n\t\ttry {\n\t\t\tconst response = await this.clientSession.execute(request);\n\t\t\tif (isJSONRPCErrorResponse(response)) throw new JSONRPCError(parseInt(response.result?.code ?? \"0\"), `Error response from method ${method}: ${response.result?.code} ${response.result?.message}`, void 0, void 0, request.id);\n\t\t\treturn response;\n\t\t} catch (error) {\n\t\t\tlogger$11.error(`[Call] Error executing method ${method} with params`, params, error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\tbuildMethodParams(target, args) {\n\t\tconst self = {\n\t\t\tnode_id: this.nodeId ?? \"\",\n\t\t\tcall_id: this.id,\n\t\t\tmember_id: this.vertoManager.selfId ?? \"\"\n\t\t};\n\t\tif (typeof target === \"object\") return {\n\t\t\t...args,\n\t\t\tself,\n\t\t\ttargets: [target]\n\t\t};\n\t\treturn {\n\t\t\t...args,\n\t\t\tself,\n\t\t\ttarget: {\n\t\t\t\tnode_id: this.nodeId ?? \"\",\n\t\t\t\tcall_id: this.id,\n\t\t\t\tmember_id: target\n\t\t\t}\n\t\t};\n\t}\n\t/** Observable of the current call status (e.g. `'ringing'`, `'connected'`). */\n\tget status$() {\n\t\treturn this.publicCachedObservable(\"status$\", () => merge(this._status$.asObservable(), this.vertoManager.signalingStatus$).pipe(distinctUntilChanged(), tap((status) => {\n\t\t\tthis._lastMergedStatus = status;\n\t\t})));\n\t}\n\t/** Observable of the participants list, emits on join/leave/update. */\n\tget participants$() {\n\t\treturn this.deferEmission(this.callEventsManager.participants$).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Observable of the local (self) participant. */\n\tget self$() {\n\t\treturn this.deferEmission(this.callEventsManager.self$).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Observable indicating whether the call is being recorded. */\n\tget recording$() {\n\t\treturn this.deferEmission(this.callEventsManager.recording$).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Observable indicating whether the call is being streamed. */\n\tget streaming$() {\n\t\treturn this.deferEmission(this.callEventsManager.streaming$).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Observable indicating whether raise-hand priority is active. */\n\tget raiseHandPriority$() {\n\t\treturn this.deferEmission(this.callEventsManager.raiseHandPriority$).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Observable indicating whether the call room is locked. */\n\tget locked$() {\n\t\treturn this.deferEmission(this.callEventsManager.locked$).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Observable of custom metadata associated with the call. */\n\tget meta$() {\n\t\treturn this.deferEmission(this.callEventsManager.meta$).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Observable of the call's capability flags. */\n\tget capabilities$() {\n\t\treturn this.deferEmission(this.callEventsManager.capabilities$).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Observable of the current layout name. */\n\tget layout$() {\n\t\treturn this.deferEmission(this.callEventsManager.layout$).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Current call status. */\n\tget status() {\n\t\treturn this._lastMergedStatus;\n\t}\n\t/** Whether the call is currently being recorded. */\n\tget recording() {\n\t\treturn this.callEventsManager.recording;\n\t}\n\t/** Whether the call is currently being streamed. */\n\tget streaming() {\n\t\treturn this.callEventsManager.streaming;\n\t}\n\t/** Whether raise-hand priority is active. */\n\tget raiseHandPriority() {\n\t\treturn this.callEventsManager.raiseHandPriority;\n\t}\n\t/** Whether the call room is locked. */\n\tget locked() {\n\t\treturn this.callEventsManager.locked;\n\t}\n\t/** Current custom metadata of the call. */\n\tget meta() {\n\t\treturn this.callEventsManager.meta;\n\t}\n\t/** Current layout name, or `undefined` if not set. */\n\tget layout() {\n\t\treturn this.callEventsManager.layout;\n\t}\n\t/** Observable of available layout names. */\n\tget layouts$() {\n\t\treturn this.deferEmission(this.callEventsManager.layouts$).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Current snapshot of available layout names. */\n\tget layouts() {\n\t\treturn this.callEventsManager.layouts;\n\t}\n\t/** Observable of the local media stream (camera/microphone). */\n\tget localStream$() {\n\t\treturn this.deferEmission(this.vertoManager.localStream$).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Current local media stream, or `null` if not available. */\n\tget localStream() {\n\t\treturn this.vertoManager.localStream;\n\t}\n\t/** Observable of the remote media stream from the far end. */\n\tget remoteStream$() {\n\t\treturn this.deferEmission(this.vertoManager.remoteStream$).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Current remote media stream, or `null` if not available. */\n\tget remoteStream() {\n\t\treturn this.vertoManager.remoteStream;\n\t}\n\t/** Observable of custom user variables associated with the call. */\n\tget userVariables$() {\n\t\treturn this.deferEmission(this._userVariables$.asObservable());\n\t}\n\t/** a copy of the current custom user variables of the call. */\n\tget userVariables() {\n\t\treturn { ...this._userVariables$.value };\n\t}\n\t/** Merge current custom user variables of the call. */\n\tset userVariables(variables) {\n\t\tthis._userVariables$.next({\n\t\t\t...this._userVariables$.value,\n\t\t\t...variables\n\t\t});\n\t}\n\t/** Observable of current network health issues (empty array = healthy). */\n\tget networkIssues$() {\n\t\treturn this.deferEmission(this._networkIssues$.asObservable());\n\t}\n\t/** Current snapshot of network issues. */\n\tget networkIssues() {\n\t\treturn this._networkIssues$.value;\n\t}\n\t/** Simple boolean health indicator derived from stats monitor. */\n\tget isNetworkHealthy$() {\n\t\treturn this.deferEmission(this._isNetworkHealthy$.asObservable());\n\t}\n\t/** Whether the network is currently healthy. */\n\tget isNetworkHealthy() {\n\t\treturn this._isNetworkHealthy$.value;\n\t}\n\t/** Rolling history of raw network metrics (RTT, jitter, packet loss, bitrate). */\n\tget networkMetrics$() {\n\t\treturn this.deferEmission(this._networkMetrics$.asObservable());\n\t}\n\t/** Current snapshot of the metrics rolling window. */\n\tget networkMetrics() {\n\t\treturn this._networkMetrics$.value;\n\t}\n\t/** Observable of MOS quality score (1-5) computed from stats metrics. */\n\tget qualityScore$() {\n\t\treturn this.deferEmission(this._qualityScore$.asObservable());\n\t}\n\t/** Observable of simplified quality level (excellent/good/fair/poor/critical). */\n\tget qualityLevel$() {\n\t\treturn this.deferEmission(this._qualityLevel$.asObservable());\n\t}\n\t/** Observable of the recovery pipeline state machine. */\n\tget recoveryState$() {\n\t\treturn this.deferEmission(this._recoveryState$.asObservable());\n\t}\n\t/** Observable of recovery events (keyframe requested, ICE restart, etc.). */\n\tget recoveryEvent$() {\n\t\treturn this.deferEmission(this._recoveryEvent$.asObservable());\n\t}\n\t/** Observable indicating whether the call is bandwidth-constrained. */\n\tget bandwidthConstrained$() {\n\t\treturn this.deferEmission(this._bandwidthConstrained$.asObservable());\n\t}\n\t/** Observable that emits when server-pushed media params are applied. */\n\tget mediaParamsUpdated$() {\n\t\treturn this.deferEmission(this._mediaParamsUpdated$.asObservable());\n\t}\n\t/**\n\t* @internal Emit a media params update event.\n\t* Called by the VertoManager when server-pushed media params are applied.\n\t*/\n\temitMediaParamsUpdated(event) {\n\t\tthis._mediaParamsUpdated$.next(event);\n\t}\n\t/** Request a video keyframe via RTCP PLI/FIR. */\n\trequestKeyframe() {\n\t\tthis.vertoManager.requestKeyframe?.();\n\t}\n\t/** Force an ICE restart / re-INVITE. */\n\tasync requestIceRestart() {\n\t\tawait this.vertoManager.requestIceRestart?.();\n\t}\n\t/**\n\t* @internal Initialize resilience subsystems when the call reaches 'connected'.\n\t* Called from within the status subscription to wire stats and recovery.\n\t*/\n\tinitResilienceSubsystems() {\n\t\tconst pc = this.rtcPeerConnection;\n\t\tlogger$11.debug(`[Call] initResilienceSubsystems: pc=${pc ? \"exists\" : \"undefined\"}, connectionState=${pc?.connectionState}`);\n\t\tif (!pc) {\n\t\t\tlogger$11.warn(\"[Call] No peer connection available, skipping resilience init\");\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tconst prefs = PreferencesContainer.instance;\n\t\t\tthis._statsMonitor = new RTCStatsMonitor(pc, {\n\t\t\t\tpollingIntervalMs: prefs.statsPollingInterval,\n\t\t\t\tbaselineSamples: prefs.statsBaselineSamples,\n\t\t\t\tnoAudioPacketThresholdMs: prefs.statsNoPacketThreshold,\n\t\t\t\trttSpikeWarningMultiplier: prefs.statsRttSpikeMultiplier,\n\t\t\t\trttSpikeCriticalMultiplier: prefs.statsRttSpikeMultiplier * RTT_CRITICAL_TO_WARNING_RATIO,\n\t\t\t\tpacketLossWarningPercent: prefs.statsPacketLossThreshold * 100,\n\t\t\t\tpacketLossCriticalPercent: prefs.statsPacketLossThreshold * 200,\n\t\t\t\tjitterSpikeMultiplier: prefs.statsJitterSpikeMultiplier,\n\t\t\t\thistoryWindowSeconds: prefs.statsHistorySize\n\t\t\t});\n\t\t\tthis._recoveryManager = new CallRecoveryManager({\n\t\t\t\trequestKeyframe: () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (this.vertoManager.requestKeyframeAll) this.vertoManager.requestKeyframeAll();\n\t\t\t\t\t\telse this.vertoManager.requestKeyframe?.();\n\t\t\t\t\t} catch {}\n\t\t\t\t},\n\t\t\t\trequestIceRestart: async (relayOnly) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (this.vertoManager.requestIceRestartAll) await this.vertoManager.requestIceRestartAll(relayOnly);\n\t\t\t\t\t\telse await this.vertoManager.requestIceRestart?.(relayOnly);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn this.waitForPeerConnectionConnected();\n\t\t\t\t},\n\t\t\t\tdisableVideo: () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.vertoManager.muteMainVideoInputDevice();\n\t\t\t\t\t\tlogger$11.debug(\"[Call] Recovery manager disabled video\");\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tlogger$11.debug(\"[Call] Recovery manager failed to disable video\");\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tenableVideo: () => {\n\t\t\t\t\tthis.vertoManager.unmuteMainVideoInputDevice().catch(() => {\n\t\t\t\t\t\tlogger$11.debug(\"[Call] Recovery manager failed to enable video\");\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tisNegotiating: () => this.vertoManager.mainPeerConnection.isNegotiating,\n\t\t\t\tisCallConnected: () => this._lastMergedStatus === \"connected\",\n\t\t\t\tgetPeerConnectionState: () => pc.connectionState\n\t\t\t}, { signalingReady$: this.clientSession.authenticated$ }, {\n\t\t\t\tdebounceTimeMs: prefs.recoveryDebounceTime,\n\t\t\t\tcooldownMs: prefs.recoveryCooldown,\n\t\t\t\ticeGracePeriodMs: prefs.iceDisconnectedGracePeriod,\n\t\t\t\ticeRestartTimeoutMs: prefs.iceRestartTimeout,\n\t\t\t\tmaxAttempts: prefs.maxRecoveryAttempts,\n\t\t\t\tenableRelayFallback: prefs.enableRelayFallback,\n\t\t\t\tkeyframeMaxBurst: prefs.keyframeMaxBurst,\n\t\t\t\tkeyframeBurstWindowMs: prefs.keyframeBurstWindow,\n\t\t\t\tkeyframeCooldownMs: prefs.keyframeCooldown\n\t\t\t});\n\t\t\tthis.subscribeTo(this._statsMonitor.networkIssues$, (issues) => {\n\t\t\t\tthis._networkIssues$.next(issues);\n\t\t\t\tthis._recoveryManager?.reportNetworkIssues(issues);\n\t\t\t});\n\t\t\tthis.subscribeTo(this._statsMonitor.isNetworkHealthy$, (healthy) => {\n\t\t\t\tthis._isNetworkHealthy$.next(healthy);\n\t\t\t});\n\t\t\tthis.subscribeTo(this._statsMonitor.networkMetrics$, (metrics) => {\n\t\t\t\tthis._networkMetrics$.next(metrics);\n\t\t\t\tif (metrics.length > 0) {\n\t\t\t\t\tconst latest = metrics[metrics.length - 1];\n\t\t\t\t\tconst totalRecv = latest.audio.packetsReceived + latest.video.packetsReceived;\n\t\t\t\t\tconst totalLost = latest.audio.packetsLost + latest.video.packetsLost;\n\t\t\t\t\tconst lossPct = totalRecv + totalLost > 0 ? totalLost / (totalRecv + totalLost) * 100 : 0;\n\t\t\t\t\tconst mos = computeMOS(latest.roundTripTime, latest.audio.jitter, lossPct);\n\t\t\t\t\tthis._qualityScore$.next(mos);\n\t\t\t\t\tthis._qualityLevel$.next(mosToQualityLevel(mos));\n\t\t\t\t\tif (latest.availableOutgoingBitrate !== void 0) this._recoveryManager?.reportBandwidth(latest.availableOutgoingBitrate / 1e3);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.subscribeTo(this._statsMonitor.criticalIssue$, (issue) => {\n\t\t\t\tthis._recoveryManager?.pushTrigger({\n\t\t\t\t\tsource: \"stats\",\n\t\t\t\t\tdetail: `${issue.type}: ${issue.severity}`,\n\t\t\t\t\tissueType: issue.type\n\t\t\t\t});\n\t\t\t});\n\t\t\tthis.subscribeTo(this._recoveryManager.recoveryState$, (state) => {\n\t\t\t\tthis._recoveryState$.next(state);\n\t\t\t});\n\t\t\tthis.subscribeTo(this._recoveryManager.recoveryEvent$, (event) => {\n\t\t\t\tthis._recoveryEvent$.next(event);\n\t\t\t\tif (event.action === \"max_attempts_reached\") {\n\t\t\t\t\tlogger$11.warn(\"[Call] All recovery attempts exhausted, terminating call\");\n\t\t\t\t\tthis.emitError({\n\t\t\t\t\t\tkind: \"network\",\n\t\t\t\t\t\tfatal: true,\n\t\t\t\t\t\terror: /* @__PURE__ */ new Error(\"Call recovery failed: all attempts exhausted\"),\n\t\t\t\t\t\tcallId: this.id\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.subscribeTo(this._recoveryManager.bandwidthConstrained$, (constrained) => {\n\t\t\t\tthis._bandwidthConstrained$.next(constrained);\n\t\t\t});\n\t\t\tif (this._networkChange$) this.subscribeTo(this._networkChange$, (event) => {\n\t\t\t\tif (event.type === \"offline\") this._recoveryManager?.pushTrigger({\n\t\t\t\t\tsource: \"network\",\n\t\t\t\t\tdetail: \"browser went offline\"\n\t\t\t\t});\n\t\t\t\telse if (event.type === \"online\") this._recoveryManager?.handleWebSocketReconnect();\n\t\t\t});\n\t\t\tthis.subscribeTo(this.clientSession.authenticated$.pipe(skip(1), filter(Boolean)), () => {\n\t\t\t\tlogger$11.debug(\"[Call] WebSocket reconnected — notifying recovery manager\");\n\t\t\t\tthis._recoveryManager?.handleWebSocketReconnect();\n\t\t\t});\n\t\t\tthis._statsMonitor.start();\n\t\t\tlogger$11.debug(\"[Call] Resilience subsystems initialized for call\", this.id);\n\t\t} catch (error) {\n\t\t\tlogger$11.warn(\"[Call] Failed to initialize resilience subsystems:\", error);\n\t\t}\n\t}\n\t/**\n\t* Wait for the underlying RTCPeerConnection to reach 'connected' after\n\t* triggering an ICE restart. Resolves true on success, false on failure\n\t* or if the state doesn't transition within the configured timeout.\n\t*\n\t* Polls connectionState directly because the recovery manager already\n\t* wraps this call in its own withTimeout(); a separate listener-based\n\t* implementation would race the outer timeout in subtle ways.\n\t*/\n\tasync waitForPeerConnectionConnected() {\n\t\tconst pc = this.rtcPeerConnection;\n\t\tif (!pc) return false;\n\t\tconst deadline = Date.now() + PEER_CONNECTION_RECOVERY_WAIT_MS;\n\t\tfor (;;) {\n\t\t\tconst state = pc.connectionState;\n\t\t\tif (state === \"connected\") return true;\n\t\t\tif (state === \"failed\" || state === \"closed\") return false;\n\t\t\tif (Date.now() >= deadline) return false;\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, PEER_CONNECTION_RECOVERY_POLL_MS));\n\t\t}\n\t}\n\t/**\n\t* @internal Stop and destroy resilience subsystems (on disconnect/destroy).\n\t* Clears references so they can be re-created on reconnect.\n\t*/\n\tstopResilienceSubsystems() {\n\t\ttry {\n\t\t\tthis._statsMonitor?.destroy();\n\t\t\tthis._recoveryManager?.destroy();\n\t\t} catch {}\n\t\tthis._statsMonitor = void 0;\n\t\tthis._recoveryManager = void 0;\n\t}\n\t/** @internal */\n\tcreateParticipant(memberId, selfId) {\n\t\tif (memberId === (selfId ?? this.vertoManager.selfId)) return this.participantFactory.createSelfParticipant(memberId);\n\t\treturn this.participantFactory.createParticipant(memberId);\n\t}\n\t/** Observable of the current audio/video send/receive directions. */\n\tget mediaDirections$() {\n\t\treturn this.deferEmission(this.vertoManager.mediaDirections$).pipe(takeUntil(this._destroyed$));\n\t}\n\t/** Current audio/video send/receive directions. */\n\tget mediaDirections() {\n\t\treturn this.vertoManager.mediaDirections;\n\t}\n\tget participantsId$() {\n\t\treturn this.cachedObservable(\"participantsId$\", () => this.participants$.pipe(map((participants) => participants.map((participant) => participant.id))));\n\t}\n\t/**\n\t* Executes a raw JSON-RPC request on the client session.\n\t*\n\t* Lower-level than {@link executeMethod} — allows full control over the RPC request structure.\n\t*\n\t* @param request - Complete JSON-RPC request object.\n\t* @param options - Optional RPC execution options (timeout, etc.).\n\t* @returns The RPC response.\n\t* @throws {JSONRPCError} If the RPC call returns an error response.\n\t*/\n\tasync execute(request, options) {\n\t\treturn this.clientSession.execute(request, options);\n\t}\n\t/** Observable of the local participant's member ID. */\n\tget selfId$() {\n\t\treturn this.vertoManager.selfId$;\n\t}\n\t/** Local participant's member ID, or `null` if not joined. */\n\tget selfId() {\n\t\treturn this.vertoManager.selfId;\n\t}\n\t/** Observable of the server node ID handling this call. */\n\tget nodeId$() {\n\t\treturn this.vertoManager.nodeId$;\n\t}\n\t/** Server node ID handling this call, or `null`. */\n\tget nodeId() {\n\t\treturn this.vertoManager.nodeId;\n\t}\n\tisCallSessionEvent(event) {\n\t\ttry {\n\t\t\tlogger$11.debug(\"[Call] Checking if event is for this call session:\", event);\n\t\t\tconst callId = getValueFrom(event, \"params.params.callID\") ?? getValueFrom(event, \"params.call_id\");\n\t\t\tconst roomSessionId = getValueFrom(event, \"params.room_session_id\");\n\t\t\tlogger$11.debug(`[Call] Extracted session identifiers callID: ${callId} and roomSessionID: ${roomSessionId} from event:`);\n\t\t\treturn callId === this.id || !!callId && this.callEventsManager.isCallIdValid(callId) || !!roomSessionId && this.callEventsManager.isRoomSessionIdValid(roomSessionId);\n\t\t} catch (error) {\n\t\t\tlogger$11.error(\"[Call] Error checking if event is for this call session:\", error);\n\t\t\treturn false;\n\t\t}\n\t}\n\tget callSessionEvents$() {\n\t\treturn this.cachedObservable(\"callSessionEvents$\", () => this.clientSession.signalingEvent$.pipe(filter((event) => this.isCallSessionEvent(event)), tap((event) => {\n\t\t\tlogger$11.debug(\"[Call] Received call session event:\", event);\n\t\t}), takeUntil(this.destroyed$), share()));\n\t}\n\t/** Observable of call-updated events. */\n\tget callUpdated$() {\n\t\treturn this.publicCachedObservable(\"callUpdated$\", () => this.callSessionEvents$.pipe(filterAs(isCallUpdatedMetadata, \"params\"), takeUntil(this.destroyed$)));\n\t}\n\t/** Observable of member-joined events, emitted when a remote participant joins the call. */\n\tget memberJoined$() {\n\t\treturn this.publicCachedObservable(\"memberJoined$\", () => this.callSessionEvents$.pipe(filterAs(isMemberJoinedMetadata, \"params\"), takeUntil(this.destroyed$)));\n\t}\n\t/** Observable of member-left events, emitted when a participant leaves the call. */\n\tget memberLeft$() {\n\t\treturn this.publicCachedObservable(\"memberLeft$\", () => this.callSessionEvents$.pipe(filterAs(isMemberLeftMetadata, \"params\"), takeUntil(this.destroyed$)));\n\t}\n\t/** Observable of member-updated events (mute, volume, etc.). */\n\tget memberUpdated$() {\n\t\treturn this.publicCachedObservable(\"memberUpdated$\", () => this.callSessionEvents$.pipe(filterAs(isMemberUpdatedMetadata, \"params\"), takeUntil(this.destroyed$)));\n\t}\n\t/** Observable of member-talking events (speech start/stop). */\n\tget memberTalking$() {\n\t\treturn this.publicCachedObservable(\"memberTalking$\", () => this.callSessionEvents$.pipe(filterAs(isMemberTalkingMetadata, \"params\"), takeUntil(this.destroyed$)));\n\t}\n\t/** Observable of call state-change events. */\n\tget callStates$() {\n\t\treturn this.publicCachedObservable(\"callStates$\", () => this.callSessionEvents$.pipe(filterAs(isCallStateMetadata, \"params\"), takeUntil(this.destroyed$)));\n\t}\n\t/** Observable of layout-changed events. */\n\tget layoutUpdates$() {\n\t\treturn this.publicCachedObservable(\"layoutUpdates$\", () => this.callSessionEvents$.pipe(filterAs(isLayoutChangedMetadata, \"params\"), takeUntil(this.destroyed$)));\n\t}\n\t/** Underlying `RTCPeerConnection`, for advanced use cases. */\n\tget rtcPeerConnection() {\n\t\treturn this.vertoManager.mainPeerConnection.peerConnection;\n\t}\n\t/** Observable of raw signaling events as plain objects. */\n\tget signalingEvent$() {\n\t\treturn this.publicCachedObservable(\"signalingEvent$\", () => this.callEvent$.pipe(map((event) => JSON.parse(JSON.stringify(event)))));\n\t}\n\t/**\n\t* Subscribe to a custom signaling event type on this call.\n\t*\n\t* Returns a cached observable that filters `callSessionEvents$` for events\n\t* whose `event_type` matches the given string. The observable completes\n\t* when the call is destroyed.\n\t*\n\t* Unlike `signalingEvent$` (which only emits known call-level event types),\n\t* this method also matches custom/user-defined event types.\n\t*\n\t* The SDK does not validate event type strings --- the server decides\n\t* whether a given type is valid.\n\t*\n\t* @param eventType - The event type to subscribe to (e.g. `'my.custom.event'`).\n\t* @returns An observable that emits matching signaling events.\n\t*\n\t* @example\n\t* ```ts\n\t* call.subscribe('my.custom.event').subscribe(event => {\n\t* console.log('Custom event:', event);\n\t* });\n\t* ```\n\t*/\n\tsubscribe(eventType) {\n\t\tconst cached = this._customSubscriptions.get(eventType);\n\t\tif (cached) return cached;\n\t\tconst filtered$ = this.callSessionEvents$.pipe(filter((event) => event.event_type === eventType), map((event) => JSON.parse(JSON.stringify(event))), takeUntil(this._destroyed$));\n\t\tthis._sendVertoSubscribe(eventType).then(() => {\n\t\t\tthis._customSubscriptions.set(eventType, filtered$);\n\t\t}, (error) => {\n\t\t\tthis._customSubscriptions.delete(eventType);\n\t\t\tlogger$11.warn(`[Call] verto.subscribe for '${eventType}' failed, not caching:`, error);\n\t\t});\n\t\tthis._customSubscriptions.set(eventType, filtered$);\n\t\treturn filtered$;\n\t}\n\tget webrtcMessages$() {\n\t\treturn this.cachedObservable(\"webrtcMessages$\", () => this.callSessionEvents$.pipe(filterAs(isWebrtcMessageMetadata, \"params\"), tap((event) => logger$11.debug(\"[Call] Event is a WebRTC message event:\", event)), takeUntil(this.destroyed$), share()));\n\t}\n\tget callEvent$() {\n\t\treturn this.cachedObservable(\"callEvent$\", () => this.callSessionEvents$.pipe(filterAs(isSignalwireCallMetadata, \"params\"), tap((event) => logger$11.debug(\"[Call] Event is a call event:\", event)), takeUntil(this.destroyed$), share()));\n\t}\n\tget layoutEvent$() {\n\t\treturn this.cachedObservable(\"layoutEvent$\", () => this.callEvent$.pipe(filterAs(isLayoutChangedMetadata, \"params\")));\n\t}\n\t/**\n\t* Hangs up the call and releases all resources.\n\t*\n\t* Sends a Verto `bye` to the server, transitions status to `'disconnecting'`,\n\t* then destroys the call. After this, the call instance is no longer usable.\n\t*\n\t* @example\n\t* ```ts\n\t* await call.hangup();\n\t* ```\n\t*/\n\tasync hangup() {\n\t\tthis._status$.next(\"disconnecting\");\n\t\ttry {\n\t\t\tawait this.vertoManager.bye();\n\t\t} finally {\n\t\t\tthis.destroy();\n\t\t}\n\t}\n\t/**\n\t* Sends DTMF digits on the call.\n\t*\n\t* @param dtmf - The digit string to send (e.g. `'1234#'`).\n\t*\n\t* @example\n\t* ```ts\n\t* await call.sendDigits('1234#');\n\t* ```\n\t*/\n\tasync sendDigits(dtmf) {\n\t\treturn this.vertoManager.sendDigits(dtmf);\n\t}\n\t/** Observable of WebRTC-specific signaling messages. */\n\t/** Observable of call-level signaling events. */\n\t/** Observable of layout-changed signaling events. */\n\t/**\n\t* Accepts an inbound call, optionally overriding media options for the answer.\n\t*\n\t* @param options - Optional media constraints for the answer (audio/video).\n\t*\n\t* @example\n\t* ```ts\n\t* // Accept with defaults\n\t* call.answer();\n\t*\n\t* // Accept audio-only\n\t* call.answer({ audio: true, video: false });\n\t* ```\n\t* @see {@link reject} to decline the call instead.\n\t* @see {@link answered$} to observe the acceptance state.\n\t*/\n\tanswer(options) {\n\t\tthis._answerMediaOptions = options;\n\t\tthis._answered$.next(true);\n\t}\n\t/** Media options provided when answering. Used internally by the VertoManager. */\n\tget answerMediaOptions() {\n\t\treturn this._answerMediaOptions;\n\t}\n\t/**\n\t* Rejects an inbound call, preventing media negotiation.\n\t*\n\t* @see {@link answer} to accept the call instead.\n\t* @see {@link answered$} to observe the rejection state.\n\t*/\n\treject() {\n\t\tthis._answered$.next(false);\n\t}\n\t/** Observable that emits `true` when answered, `false` when rejected. */\n\tget answered$() {\n\t\treturn this.deferEmission(this._answered$.asObservable());\n\t}\n\t/**\n\t* Sets the call layout and participant positions.\n\t*\n\t* @param layout - Layout name (must be one of {@link layouts}).\n\t* @param positions - Map of member IDs to {@link VideoPosition} values.\n\t* @throws {InvalidParams} If the layout is not in the available {@link layouts}.\n\t*\n\t* @example\n\t* ```ts\n\t* await call.setLayout('grid-responsive', {\n\t* [participantId]: 'reserved-0',\n\t* });\n\t* ```\n\t*/\n\tasync setLayout(layout, positions) {\n\t\tif (!this.layouts.includes(layout)) throw new InvalidParams(`Layout ${layout} is not available in the current call layouts: ${this.layouts.join(\", \")}`);\n\t\tconst selfId = await firstValueFrom(this.selfId$.pipe(filter((id) => id !== null)));\n\t\tawait this.executeMethod(selfId, \"call.layout.set\", {\n\t\t\tlayout,\n\t\t\tpositions\n\t\t});\n\t}\n\t/**\n\t* Transfers the call to another destination.\n\t*\n\t* @param options - Transfer configuration including the target destination.\n\t* @see {@link status$} to observe the transfer progress.\n\t*/\n\tasync transfer(options) {\n\t\treturn this.vertoManager.transfer(options);\n\t}\n\t/**\n\t* Set the local microphone gain as a percentage applied before transmission.\n\t*\n\t* - `0` = silent\n\t* - `100` = unity (no change, default)\n\t* - `200` = 2× digital boost (max; expect clipping / noise amplification)\n\t*\n\t* Values are clamped to [0, 200]. Engages the local audio pipeline on\n\t* first use (one-time cost).\n\t*\n\t* Note: this is a **digital** multiplier applied in a Web Audio GainNode\n\t* between your mic track and the RTCRtpSender — it does not change the\n\t* physical mic's hardware sensitivity. Browsers' autoGainControl can\n\t* fight the setting; call {@link setAutoGainControl}(false) for\n\t* predictable behaviour.\n\t*\n\t* @param value - Gain percentage (0..200; 100 = unity).\n\t*/\n\tsetLocalMicrophoneGain(value) {\n\t\tconst pipeline = this.vertoManager.ensureLocalAudioPipeline();\n\t\tif (!pipeline) {\n\t\t\tlogger$11.warn(\"[Call] setLocalMicrophoneGain: audio pipeline unavailable\");\n\t\t\treturn;\n\t\t}\n\t\tconst percent = Math.max(0, Math.min(200, value));\n\t\tpipeline.setGain(percent / 100);\n\t}\n\t/** Observable of the current local microphone gain (0..200, where 100 = unity). */\n\tget localMicrophoneGain$() {\n\t\tconst pipeline = this.vertoManager.ensureLocalAudioPipeline();\n\t\tif (!pipeline) return of(100).pipe(takeUntil(this._destroyed$));\n\t\treturn this.publicCachedObservable(\"localMicrophoneGain$\", () => pipeline.gain$.pipe(map((multiplier) => multiplier * 100), takeUntil(this._destroyed$)));\n\t}\n\t/**\n\t* Observable of the RMS audio level of the local microphone, 0..1.\n\t* Emits at ~30fps while a mic track is active. Engages the local audio\n\t* pipeline on first subscription.\n\t*/\n\tget localAudioLevel$() {\n\t\tconst pipeline = this.vertoManager.ensureLocalAudioPipeline();\n\t\tif (!pipeline) return of(0).pipe(takeUntil(this._destroyed$));\n\t\treturn this.publicCachedObservable(\"localAudioLevel$\", () => pipeline.level$.pipe(takeUntil(this._destroyed$), share()));\n\t}\n\t/**\n\t* Observable that is `true` while the local participant is speaking\n\t* (RMS level above the VAD threshold, with hold time to avoid flicker).\n\t*/\n\tget localSpeaking$() {\n\t\tconst pipeline = this.vertoManager.ensureLocalAudioPipeline();\n\t\tif (!pipeline) return of(false).pipe(takeUntil(this._destroyed$));\n\t\treturn this.publicCachedObservable(\"localSpeaking$\", () => pipeline.speaking$.pipe(takeUntil(this._destroyed$), share()));\n\t}\n\t/**\n\t* Enable push-to-talk: while {@link setPushToTalkActive} has been called\n\t* with `false`, the microphone gain is forced to 0; calling\n\t* {@link setPushToTalkActive} with `true` restores the configured gain.\n\t* Use this instead of mute/unmute for instant talk/silence transitions\n\t* because it doesn't rebuild the track.\n\t*\n\t* This method installs the pipeline but does not attach any keyboard\n\t* listener — consumers bind the key themselves and call\n\t* {@link setPushToTalkActive} on keydown/keyup.\n\t*/\n\tenablePushToTalk() {\n\t\tconst pipeline = this.vertoManager.ensureLocalAudioPipeline();\n\t\tif (!pipeline) {\n\t\t\tlogger$11.warn(\"[Call] enablePushToTalk: audio pipeline unavailable\");\n\t\t\treturn;\n\t\t}\n\t\tpipeline.setPTTActive(false);\n\t\tthis._pushToTalkEnabled = true;\n\t}\n\t/** Disable push-to-talk; mic gain returns to the configured value. */\n\tdisablePushToTalk() {\n\t\tthis.vertoManager.localAudioPipeline?.setPTTActive(true);\n\t\tthis._pushToTalkEnabled = false;\n\t}\n\t/**\n\t* While push-to-talk is enabled, sets the talk state. `true` = transmitting,\n\t* `false` = silent. No-op if push-to-talk has not been enabled.\n\t*/\n\tsetPushToTalkActive(active) {\n\t\tif (!this._pushToTalkEnabled) return;\n\t\tthis.vertoManager.localAudioPipeline?.setPTTActive(active);\n\t}\n\t/**\n\t* Toggle echo cancellation on the local mic at runtime. Applied via\n\t* `track.applyConstraints`; browsers that don't honour runtime constraints\n\t* (notably iOS Safari) fall back to re-acquiring the track with the new\n\t* constraint set and plumbing the replacement through the local audio\n\t* pipeline if one is active.\n\t*/\n\tasync setEchoCancellation(enabled) {\n\t\tawait this.vertoManager.updateMediaConstraints({ audio: { echoCancellation: enabled } });\n\t}\n\t/** Toggle browser noise suppression on the local mic at runtime. */\n\tasync setNoiseSuppression(enabled) {\n\t\tawait this.vertoManager.updateMediaConstraints({ audio: { noiseSuppression: enabled } });\n\t}\n\t/** Toggle browser automatic gain control on the local mic at runtime. */\n\tasync setAutoGainControl(enabled) {\n\t\tawait this.vertoManager.updateMediaConstraints({ audio: { autoGainControl: enabled } });\n\t}\n\t/**\n\t* Observable of the aggregate remote audio level, 0..1 RMS. The server\n\t* delivers a single mixed audio stream for all remote participants — this\n\t* meter reports that mix. Per-participant audio is not available client-side.\n\t*\n\t* Engages a shared AudioContext on first subscription (cheap — one\n\t* AnalyserNode, no GainNode, no destination) so it does not affect the\n\t* caller's audio element playback.\n\t*/\n\tget remoteAudioLevel$() {\n\t\treturn this.publicCachedObservable(\"remoteAudioLevel$\", () => {\n\t\t\tthis._remoteAudioMeter ??= new RemoteAudioMeter();\n\t\t\tconst meter = this._remoteAudioMeter;\n\t\t\tthis.subscribeTo(this.vertoManager.remoteStream$, (stream) => {\n\t\t\t\tmeter.setStream(stream);\n\t\t\t});\n\t\t\treturn meter.level$.pipe(takeUntil(this._destroyed$), share());\n\t\t});\n\t}\n\t/** Destroys the call, releasing all resources and subscriptions. */\n\tdestroy() {\n\t\tif (this._status$.value === \"destroyed\") return;\n\t\tthis._status$.next(\"destroyed\");\n\t\tthis.stopResilienceSubsystems();\n\t\tthis._remoteAudioMeter?.destroy();\n\t\tthis._remoteAudioMeter = null;\n\t\tthis.vertoManager.destroy();\n\t\tthis.callEventsManager.destroy();\n\t\tsuper.destroy();\n\t}\n\t/**\n\t* @internal Send a verto.subscribe message to add an event type to the\n\t* server's subscription list for this call. Returns the underlying RPC\n\t* promise so callers can decide whether to cache the observable on success\n\t* or retry on failure.\n\t*/\n\tasync _sendVertoSubscribe(eventType) {\n\t\tconst message = VertoSubscribe({\n\t\t\tsessid: this.id,\n\t\t\teventChannel: [eventType]\n\t\t});\n\t\tconst params = {\n\t\t\tcallID: this.id,\n\t\t\tnode_id: this.vertoManager.nodeId ?? \"\",\n\t\t\tmessage\n\t\t};\n\t\tawait this.clientSession.execute(WebrtcVerto(params));\n\t}\n};\n\n//#endregion\n//#region src/managers/CallFactory.ts\n/**\n* Infers the semantic error category from a raw Error thrown by VertoManager\n* or an RTCPeerConnection layer.\n*/\nfunction inferCallErrorKind(error) {\n\tif (error instanceof RPCTimeoutError) return \"timeout\";\n\tif (error instanceof JSONRPCError) return \"signaling\";\n\tif (error instanceof MediaTrackError) return \"media\";\n\tif (error instanceof WebSocketConnectionError || error instanceof TransportConnectionError) return \"network\";\n\treturn \"internal\";\n}\n/** JSON-RPC error codes that ClientSessionManager treats as recoverable at the\n* session level. Surfacing one of these against an in-flight call should not\n* destroy the call, because the session will reauthenticate and any pending\n* RPC can then be retried. */\nconst RECOVERABLE_RPC_CODES = new Set([\n\tRPC_ERROR_REQUESTER_VALIDATION_FAILED,\n\tRPC_ERROR_AUTHENTICATION_FAILED,\n\tRPC_ERROR_INVALID_PARAMS\n]);\n/** Determines whether an error should be fatal (destroy the call). */\nfunction isFatalError(error) {\n\tif (error instanceof VertoPongError) return false;\n\tif (error instanceof MediaTrackError) return false;\n\tif (error instanceof RPCTimeoutError) return false;\n\tif (error instanceof JSONRPCError && RECOVERABLE_RPC_CODES.has(error.code)) return false;\n\treturn true;\n}\n/**\n* Factory for creating WebRTCCall instances with proper manager wiring.\n* Eliminates circular dependencies by centralizing Call and Manager creation.\n*/\nvar CallFactory = class {\n\tconstructor(sessionManager, deviceController, attachManager, webRTCApiProvider, networkChange$) {\n\t\tthis.sessionManager = sessionManager;\n\t\tthis.deviceController = deviceController;\n\t\tthis.attachManager = attachManager;\n\t\tthis.webRTCApiProvider = webRTCApiProvider;\n\t\tthis.networkChange$ = networkChange$;\n\t}\n\t/**\n\t* Create a new WebRTCCall with properly initialized managers\n\t*/\n\tcreateCall(address, options) {\n\t\treturn new WebRTCCall(this.sessionManager, options, {\n\t\t\tinitializeManagers: (callInstance) => {\n\t\t\t\treturn {\n\t\t\t\t\tvertoManager: new WebRTCVertoManager(callInstance, this.attachManager, this.deviceController, this.webRTCApiProvider, {\n\t\t\t\t\t\tnodeId: options.nodeId,\n\t\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\t\tconst callError = {\n\t\t\t\t\t\t\t\tkind: inferCallErrorKind(error),\n\t\t\t\t\t\t\t\tfatal: isFatalError(error),\n\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t\tcallId: callInstance.id\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tcallInstance.emitError(callError);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonModifyFailed: () => {\n\t\t\t\t\t\t\tcallInstance.notifyModifyFailed();\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tcallEventsManager: new CallEventsManager(callInstance)\n\t\t\t\t};\n\t\t\t},\n\t\t\tdeviceController: this.deviceController,\n\t\t\tnetworkChange$: this.networkChange$\n\t\t}, address);\n\t}\n};\n\n//#endregion\n//#region src/behaviors/Collection.ts\nconst logger$10 = getLogger();\nvar Fetcher = class {\n\tconstructor(endpoint, params, http) {\n\t\tthis.endpoint = endpoint;\n\t\tthis.http = http;\n\t\tthis.filter = (_item) => true;\n\t\tthis.mapper = (item) => item;\n\t\tthis.nextUrl = `${this.endpoint}?${params}`;\n\t}\n\tasync next() {\n\t\tif (!this.nextUrl) {\n\t\t\tthis.hasMore = false;\n\t\t\treturn [];\n\t\t}\n\t\tconst response = await this.http.request({\n\t\t\t...GET_PARAMS,\n\t\t\turl: this.nextUrl\n\t\t});\n\t\tif (response.ok && !!response.body) {\n\t\t\tconst result = JSON.parse(response.body);\n\t\t\tthis.nextUrl = result.links.next;\n\t\t\tthis.hasMore = !!this.nextUrl;\n\t\t\treturn result.data.filter(this.filter).map(this.mapper);\n\t\t}\n\t\tlogger$10.error(\"Failed to fetch entity\");\n\t\treturn [];\n\t}\n\tasync id(v) {\n\t\tconst response = await this.http.request({\n\t\t\t...GET_PARAMS,\n\t\t\turl: `${this.endpoint}/${String(v)}`\n\t\t});\n\t\tif (response.ok && !!response.body) return JSON.parse(response.body);\n\t}\n};\nvar EntityCollection = class extends Destroyable {\n\tconstructor(fetchController, update$, onError) {\n\t\tsuper();\n\t\tthis.fetchController = fetchController;\n\t\tthis.update$ = update$;\n\t\tthis.onError = onError;\n\t\tthis.collectionData = /* @__PURE__ */ new Map();\n\t\tthis.observablesRegistry = /* @__PURE__ */ new Map();\n\t\tthis.upsertData = (data) => {\n\t\t\tif (!data.id) return;\n\t\t\tconst existing = this.collectionData.get(data.id) ?? {};\n\t\t\tconst updated = {};\n\t\t\tconst allKeys = new Set([...Object.keys(existing), ...Object.keys(data)]);\n\t\t\tfor (const key of allKeys) {\n\t\t\t\tconst existingVal = existing[key];\n\t\t\t\tconst newVal = data[key];\n\t\t\t\tif (newVal !== void 0 && existingVal !== void 0 && typeof existingVal === \"object\" && existingVal !== null && !Array.isArray(existingVal) && typeof newVal === \"object\" && newVal !== null && !Array.isArray(newVal)) updated[key] = {\n\t\t\t\t\t...existingVal,\n\t\t\t\t\t...newVal\n\t\t\t\t};\n\t\t\t\telse if (newVal !== void 0) updated[key] = newVal;\n\t\t\t\telse updated[key] = existingVal;\n\t\t\t}\n\t\t\tthis.collectionData.set(data.id, updated);\n\t\t\tthis.observablesRegistry.get(data.id)?.next(updated);\n\t\t\tthis._values$.next(Array.from(this.collectionData.values()));\n\t\t};\n\t\tthis._loading$ = this.createBehaviorSubject(false);\n\t\tthis._values$ = this.createReplaySubject(1);\n\t\tthis._hasMore$ = this.createBehaviorSubject(true);\n\t\tthis.subscribeTo(this.update$, this.upsertData);\n\t\tthis.hasMore$ = defer(() => from(this.init())).pipe(switchMap(() => this._hasMore$), distinctUntilChanged(), shareReplay(1), takeUntil(this.destroyed$));\n\t}\n\tget loading$() {\n\t\treturn this._loading$.asObservable();\n\t}\n\tget loading() {\n\t\treturn this._loading$.value;\n\t}\n\tget values$() {\n\t\treturn this._values$.asObservable();\n\t}\n\tget hasMore() {\n\t\treturn this.fetchController.hasMore ?? true;\n\t}\n\tget updated$() {\n\t\treturn this.cachedObservable(\"updated$\", () => this._loading$.pipe(distinctUntilChanged(), skip(1), filter((loading) => !loading), map(() => void 0), takeUntil(this.destroyed$)));\n\t}\n\tget values() {\n\t\treturn Array.from(this.collectionData.values());\n\t}\n\tasync init() {\n\t\tif (this.fetchController.hasMore === false) {\n\t\t\tthis._hasMore$.next(false);\n\t\t\treturn;\n\t\t}\n\t\tawait this.fetchMore();\n\t}\n\tasync fetchMore() {\n\t\ttry {\n\t\t\tthis._loading$.next(true);\n\t\t\t(await this.fetchController.next()).forEach(this.upsertData);\n\t\t\tthis._hasMore$.next(this.fetchController.hasMore ?? false);\n\t\t\tthis._loading$.next(false);\n\t\t} catch (error) {\n\t\t\tlogger$10.error(`Failed to fetch initial collection data`, error);\n\t\t\tthis._hasMore$.next(this.fetchController.hasMore ?? false);\n\t\t\tthis._loading$.next(false);\n\t\t\tthis.onError?.(new CollectionFetchError(\"fetchMore\", error));\n\t\t}\n\t}\n\tasync tryFetch(key, value) {\n\t\ttry {\n\t\t\tthis._loading$.next(true);\n\t\t\tconst data = await this.fetchController[key]?.(value);\n\t\t\tthis._loading$.next(false);\n\t\t\tif (data) this.upsertData(data);\n\t\t\treturn data;\n\t\t} catch (error) {\n\t\t\tlogger$10.error(`Failed to fetch data for (${String(key)}:${String(value)}) :`, error);\n\t\t\tthis._loading$.next(false);\n\t\t\tthis.onError?.(new CollectionFetchError(`tryFetch(${String(key)})`, error));\n\t\t}\n\t}\n\tget$(id) {\n\t\tif (!this.observablesRegistry.has(id)) {\n\t\t\tthis.observablesRegistry.set(id, new ReplaySubject(1));\n\t\t\tconst data = this.collectionData.get(id);\n\t\t\tif (data) this.observablesRegistry.get(id)?.next(data);\n\t\t\telse this.tryFetch(\"id\", id);\n\t\t}\n\t\treturn this.observablesRegistry.get(id)?.asObservable();\n\t}\n\tasync find$(key, value) {\n\t\tconst data = Array.from(this.collectionData.values()).find((item) => item[key] === value) ?? await this.tryFetch(key, value);\n\t\treturn data ? this.get$(data.id) : void 0;\n\t}\n\tloadMore() {\n\t\tif (this.fetchController.hasMore !== false) this.fetchMore();\n\t}\n\tdestroy() {\n\t\tthis.observablesRegistry.forEach((subject) => subject.complete());\n\t\tthis.observablesRegistry.clear();\n\t\tsuper.destroy();\n\t}\n};\nvar EntityCollectionTransformed = class {\n\tconstructor(originalCollection, filter$2 = (i) => !!i, mapper = (item) => item) {\n\t\tthis.originalCollection = originalCollection;\n\t\tthis.filter = filter$2;\n\t\tthis.mapper = mapper;\n\t}\n\tget loading$() {\n\t\treturn this.originalCollection.loading$;\n\t}\n\tget loading() {\n\t\treturn this.originalCollection.loading;\n\t}\n\tget hasMore$() {\n\t\treturn this.originalCollection.hasMore$;\n\t}\n\tget hasMore() {\n\t\treturn this.originalCollection.hasMore;\n\t}\n\tget values() {\n\t\treturn this.originalCollection.values.filter(this.filter).map(this.mapper);\n\t}\n\tget values$() {\n\t\treturn this._values$ ??= this.originalCollection.values$.pipe(map((values) => values.filter(this.filter).map(this.mapper)));\n\t}\n\tget$(id) {\n\t\tconst original$ = this.originalCollection.get$(id);\n\t\treturn !original$ ? original$ : original$.pipe(pipe(filter(this.filter), map(this.mapper)));\n\t}\n\tasync find$(key, value) {\n\t\tconst original$ = await this.originalCollection.find$(key, value);\n\t\treturn !original$ ? original$ : original$.pipe(pipe(filter(this.filter), map(this.mapper)));\n\t}\n\tloadMore() {\n\t\tthis.originalCollection.loadMore();\n\t}\n\tdestroy() {\n\t\tthis.originalCollection.destroy();\n\t}\n};\n\n//#endregion\n//#region src/core/entities/Address.ts\n/**\n* Represents a contact or room in the directory.\n*\n* Provides identity metadata, conversation history, text messaging,\n* and activity state for an address entry.\n*/\nvar Address = class extends Destroyable {\n\tconstructor(addressId, conversationManager, addressProvider) {\n\t\tsuper();\n\t\tthis.addressId = addressId;\n\t\tthis.conversationManager = conversationManager;\n\t\tthis.addressProvider = addressProvider;\n\t\tthis.initConversationMessages = async () => {\n\t\t\tthis._conversationMessages = this._conversationMessages ?? await this.conversationManager.getConversationMessageCollection(this.id);\n\t\t\tif (this._conversationMessages.hasMore) this._conversationMessages.loadMore();\n\t\t\treturn this._conversationMessages;\n\t\t};\n\t\tthis.textMessages$ = defer(this.initConversationMessages).pipe(map(() => this.textMessage), shareReplay(1), takeUntil(this.destroyed$));\n\t\tthis.history$ = defer(this.initConversationMessages).pipe(map(() => this.history), shareReplay(1), takeUntil(this.destroyed$));\n\t\tthis._state$ = this.createBehaviorSubject(null);\n\t}\n\t/** @internal */\n\tupnext(state) {\n\t\tconst update = {\n\t\t\t...this._state$.value,\n\t\t\t...state\n\t\t};\n\t\tthis._state$.next(update);\n\t}\n\t/** @internal */\n\tget state() {\n\t\treturn this._state$.value;\n\t}\n\t/** Unique address identifier. */\n\tget id() {\n\t\treturn this.addressId;\n\t}\n\t/** Address name (resource identifier). */\n\tget name() {\n\t\tif (!this._state$.value) throw new DependencyError(\"state not initialized\");\n\t\treturn this._state$.value.name;\n\t}\n\t/** ISO timestamp of when the address was created. */\n\tget createdAt() {\n\t\tif (!this._state$.value) throw new DependencyError(\"state not initialized\");\n\t\treturn this._state$.value.created_at;\n\t}\n\t/** Default communication channel URI (video for rooms, audio otherwise). */\n\tget defaultChannel() {\n\t\treturn this.type === \"room\" ? this.channels.video : this.channels.audio;\n\t}\n\t/** Observable of the human-readable display name. */\n\tget displayName$() {\n\t\treturn this.cachedObservable(\"displayName$\", () => this._state$.pipe(filterNull(), map((state) => state.display_name), takeUntil(this.destroyed$)));\n\t}\n\t/** Human-readable display name. */\n\tget displayName() {\n\t\tif (!this._state$.value) throw new DependencyError(\"state not initialized\");\n\t\treturn this._state$.value.display_name;\n\t}\n\t/** Observable of the preview image URL. */\n\tget previewUrl$() {\n\t\treturn this.cachedObservable(\"previewUrl$\", () => this._state$.pipe(filterNull(), map((state) => state.preview_url), takeUntil(this.destroyed$)));\n\t}\n\t/** Preview image URL. */\n\tget previewUrl() {\n\t\tif (!this._state$.value) throw new DependencyError(\"state not initialized\");\n\t\treturn this._state$.value.preview_url;\n\t}\n\t/** Observable of the cover image URL. */\n\tget coverUrl$() {\n\t\treturn this.cachedObservable(\"coverUrl$\", () => this._state$.pipe(filterNull(), shareReplay(1), map((state) => state.cover_url), takeUntil(this.destroyed$)));\n\t}\n\t/** Cover image URL. */\n\tget coverUrl() {\n\t\tif (!this._state$.value) throw new DependencyError(\"state not initialized\");\n\t\treturn this._state$.value.cover_url;\n\t}\n\t/** Observable of the underlying resource ID. */\n\tget resourceId$() {\n\t\treturn this.cachedObservable(\"resourceId$\", () => this._state$.pipe(filterNull(), shareReplay(1), map((state) => state.resource_id), takeUntil(this.destroyed$)));\n\t}\n\t/** Underlying resource ID. */\n\tget resourceId() {\n\t\tif (!this._state$.value) throw new DependencyError(\"state not initialized\");\n\t\treturn this._state$.value.resource_id;\n\t}\n\t/** Observable of the resource type (e.g. `'room'`, `'subscriber'`). */\n\tget type$() {\n\t\treturn this.cachedObservable(\"type$\", () => this._state$.pipe(filterNull(), shareReplay(1), map((state) => state.type), takeUntil(this.destroyed$)));\n\t}\n\t/** Resource type (e.g. `'room'`, `'subscriber'`). */\n\tget type() {\n\t\tif (!this._state$.value) throw new DependencyError(\"state not initialized\");\n\t\treturn this._state$.value.type;\n\t}\n\t/** Observable of available communication channels (audio, video, messaging). */\n\tget channels$() {\n\t\treturn this.cachedObservable(\"channels$\", () => this._state$.pipe(filterNull(), shareReplay(1), map((state) => state.channels), takeUntil(this.destroyed$)));\n\t}\n\t/** Available communication channels. */\n\tget channels() {\n\t\tif (!this._state$.value) throw new DependencyError(\"state not initialized\");\n\t\treturn this._state$.value.channels;\n\t}\n\t/** Whether the address (room) is locked. */\n\tget locked() {\n\t\tif (!this._state$.value) throw new DependencyError(\"state not initialized\");\n\t\treturn this._state$.value.locked;\n\t}\n\t/** Observable indicating whether the address (room) is locked. */\n\tget locked$() {\n\t\treturn this.cachedObservable(\"locked$\", () => this._state$.pipe(filterNull(), shareReplay(1), map((state) => state.locked), takeUntil(this.destroyed$)));\n\t}\n\t/**\n\t* Sends a text message to this address.\n\t*\n\t* @param text - The message text to send.\n\t*\n\t* @example\n\t* ```ts\n\t* await address.sendText('Hello!');\n\t* ```\n\t*/\n\tasync sendText(text) {\n\t\treturn this.conversationManager.sendText(text, this.id);\n\t}\n\t/**\n\t* Collection of text messages for this address, with pagination support.\n\t*\n\t* Returns `undefined` until {@link textMessages$} has been subscribed to (lazy-loaded).\n\t* Filters to `'chat'` subtype messages from the conversation.\n\t*\n\t* @see {@link textMessages$} to trigger lazy loading.\n\t* @see {@link sendText} to send a new message.\n\t*/\n\tget textMessage() {\n\t\tif (!this._conversationMessages) return;\n\t\tthis._textMessages$ = this._textMessages$ ?? new EntityCollectionTransformed(this._conversationMessages, (item) => item.subtype === \"chat\", (item) => ({\n\t\t\tid: item.id,\n\t\t\ttext: item.text,\n\t\t\tcreated: item.ts,\n\t\t\tfromAddress$: this.addressProvider.get$(item.from_fabric_address_id)\n\t\t}));\n\t\treturn this._textMessages$;\n\t}\n\t/**\n\t* Collection of call history entries for this address, with pagination support.\n\t*\n\t* Returns `undefined` until {@link history$} has been subscribed to (lazy-loaded).\n\t* Filters to `'log'` subtype messages including kind, status, start/end times.\n\t*\n\t* @see {@link history$} to trigger lazy loading.\n\t*/\n\tget history() {\n\t\tif (!this._conversationMessages) return;\n\t\tthis._history$ = this._history$ ?? new EntityCollectionTransformed(this._conversationMessages, (item) => item.subtype === \"log\", (item) => ({\n\t\t\tid: item.id,\n\t\t\tkind: item.kind,\n\t\t\tstatus: item.details.status,\n\t\t\tstarted: item.details.start_time,\n\t\t\tended: item.details.end_time,\n\t\t\tfromAddress$: this.addressProvider.get$(item.from_fabric_address_id)\n\t\t}));\n\t\treturn this._history$;\n\t}\n\t/** Observable of active call states for this address. @throws {UnimplementedError} Requires presence support. */\n\tget activity$() {\n\t\tthrow new UnimplementedError();\n\t}\n\t/** Active call states for this address. @throws {UnimplementedError} Requires presence support. */\n\tget activity() {\n\t\tthrow new UnimplementedError();\n\t}\n};\n\n//#endregion\n//#region src/core/utils.ts\nconst logger$9 = getLogger();\nconst isRPCConnectResult = (e) => {\n\tlogger$9.debug(\"isRPCConnectResult check:\", e);\n\tif (!e || typeof e !== \"object\") return false;\n\tconst result = e;\n\tconst is = typeof result.identity === \"string\" && typeof result.protocol === \"string\" && typeof result.authorization === \"object\" && typeof result.authorization.jti === \"string\" && typeof result.authorization.project_id === \"string\" && typeof result.authorization.fabric_subscriber === \"object\";\n\tlogger$9.debug(\"isRPCConnectResult check result:\", is);\n\treturn is;\n};\nvar PendingRPC = class PendingRPC {\n\tstatic {\n\t\tthis.defaultTimeoutMs = 5e3;\n\t}\n\tconstructor(request, responses$, options) {\n\t\tthis.id = v4();\n\t\tlogger$9.debug(`[PendingRPC(${this.id}) request:${request.id}: method:${request.method}] Creating PendingRPC`);\n\t\tthis.request = request;\n\t\tconst timeoutMs = options?.timeoutMs ?? PendingRPC.defaultTimeoutMs;\n\t\tconst signal = options?.signal;\n\t\tthis.promise = new Promise((resolve, reject) => {\n\t\t\tif (signal?.aborted) {\n\t\t\t\treject(new DOMException(\"The operation was aborted\", \"AbortError\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet isSettled = false;\n\t\t\tconst subscription = race(responses$.pipe(filter((result) => result.id === request.id), take(1)), new Observable((subscriber) => {\n\t\t\t\tconst timer$1 = setTimeout(() => {\n\t\t\t\t\tsubscriber.error(new RPCTimeoutError(request.id, timeoutMs));\n\t\t\t\t}, timeoutMs);\n\t\t\t\treturn () => clearTimeout(timer$1);\n\t\t\t}), signal ? new Observable((subscriber) => {\n\t\t\t\tconst abortHandler = () => {\n\t\t\t\t\tsubscriber.error(new DOMException(\"The operation was aborted\", \"AbortError\"));\n\t\t\t\t};\n\t\t\t\tsignal.addEventListener(\"abort\", abortHandler);\n\t\t\t\treturn () => signal.removeEventListener(\"abort\", abortHandler);\n\t\t\t}) : NEVER).subscribe({\n\t\t\t\tnext: (response) => {\n\t\t\t\t\tisSettled = true;\n\t\t\t\t\tif (response.error) {\n\t\t\t\t\t\tconst rpcError = new JSONRPCError(response.error.code, response.error.message, response.error.data, void 0, request.id);\n\t\t\t\t\t\tlogger$9.debug(`[PendingRPC(${this.id}) request:${request.id}] Rejecting promise with RPC error:`, rpcError);\n\t\t\t\t\t\treject(rpcError);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlogger$9.debug(`[PendingRPC(${this.id}) request:${request.id}] Resolving promise with response:`, response);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t}\n\t\t\t\t\tsubscription.unsubscribe();\n\t\t\t\t},\n\t\t\t\terror: (error) => {\n\t\t\t\t\tlogger$9.debug(`[PendingRPC(${this.id}) request:${request.id}] Rejecting promise with error:`, error);\n\t\t\t\t\tisSettled = true;\n\t\t\t\t\treject(error);\n\t\t\t\t\tsubscription.unsubscribe();\n\t\t\t\t},\n\t\t\t\tcomplete: () => {\n\t\t\t\t\tlogger$9.debug(`[PendingRPC(${this.id}) request:${request.id}] Observable completed`);\n\t\t\t\t\tif (!isSettled) reject(new RPCTimeoutError(request.id, timeoutMs));\n\t\t\t\t\tsubscription.unsubscribe();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\tasync then(onfulfilled, onrejected) {\n\t\treturn this.promise.then(onfulfilled, onrejected);\n\t}\n\tasync catch(onrejected) {\n\t\treturn this.promise.catch(onrejected);\n\t}\n\tasync finally(onfinally) {\n\t\treturn this.promise.finally(onfinally);\n\t}\n};\n\n//#endregion\n//#region src/managers/ClientSessionManager.ts\nconst logger$8 = getLogger();\nconst getAddressSearchURI = (options) => {\n\tconst to = options.to?.split(\"?\")[0];\n\tconst from$1 = options.from?.startsWith(\"subscriber://\") ? options.from.replace(\"subscriber://\", \"\") : options.from;\n\tconst name = to ?? from$1;\n\tif (!name) throw new UnexpectedError(\"Error building Address name\");\n\treturn name;\n};\nvar ClientSessionManager = class extends Destroyable {\n\tconstructor(getCredential, transport, storage, authorizationStateKey, deviceController, attachManager, webRTCApiProvider, dpopManager, networkChange$) {\n\t\tsuper();\n\t\tthis.getCredential = getCredential;\n\t\tthis.transport = transport;\n\t\tthis.storage = storage;\n\t\tthis.authorizationStateKey = authorizationStateKey;\n\t\tthis.attachManager = attachManager;\n\t\tthis.dpopManager = dpopManager;\n\t\tthis.callCreateTimeout = 6e3;\n\t\tthis.agent = `signalwire-js/4.0.0`;\n\t\tthis.eventAcks = true;\n\t\tthis.authorizationState$ = this.createReplaySubject(1);\n\t\tthis.connectVersion = {\n\t\t\tmajor: 4,\n\t\t\tminor: 0,\n\t\t\trevision: 0\n\t\t};\n\t\tthis._authorization$ = this.createBehaviorSubject(void 0);\n\t\tthis._errors$ = this.createReplaySubject(1);\n\t\tthis._authState$ = this.createBehaviorSubject({ kind: \"unauthenticated\" });\n\t\tthis._wasClientBound = false;\n\t\tthis._subscriberInfo$ = this.createBehaviorSubject(null);\n\t\tthis._calls$ = this.createBehaviorSubject({});\n\t\tthis._iceServers$ = this.createBehaviorSubject([]);\n\t\tattachManager.setSession(this);\n\t\tthis.callFactory = new CallFactory(this, deviceController, attachManager, webRTCApiProvider, networkChange$);\n\t\tthis.initialized$ = defer(() => from(this.init())).pipe(shareReplay(1), takeUntil(this.destroyed$));\n\t}\n\tget incomingCalls$() {\n\t\treturn this.cachedObservable(\"incomingCalls$\", () => this.calls$.pipe(map((calls) => calls.filter((call) => call.direction === \"inbound\"))));\n\t}\n\tget incomingCalls() {\n\t\treturn Object.values(this._calls$.value).filter((call) => call.direction === \"inbound\");\n\t}\n\tget subscriberInfo$() {\n\t\treturn this._subscriberInfo$.asObservable();\n\t}\n\tget subscriberInfo() {\n\t\treturn this._subscriberInfo$.value;\n\t}\n\tget calls$() {\n\t\treturn this.cachedObservable(\"calls$\", () => this._calls$.pipe(map((calls) => Object.values(calls))));\n\t}\n\tget calls() {\n\t\treturn Object.values(this._calls$.value);\n\t}\n\tget iceServers() {\n\t\treturn this._iceServers$.value;\n\t}\n\tget authorization$() {\n\t\treturn this._authorization$.asObservable();\n\t}\n\tget authorization() {\n\t\treturn this._authorization$.value;\n\t}\n\tget errors$() {\n\t\treturn this._errors$.asObservable();\n\t}\n\tget authenticated$() {\n\t\treturn this._authState$.pipe(map((state) => state.kind === \"authenticated\"), distinctUntilChanged());\n\t}\n\tget authenticated() {\n\t\treturn this._authState$.value.kind === \"authenticated\";\n\t}\n\t/**\n\t* Whether this session is client-bound (using a Client Bound SAT).\n\t* When client-bound, DPoP proof creation failures are treated as\n\t* authentication errors rather than silently degraded.\n\t* @internal\n\t*/\n\tget clientBound() {\n\t\treturn this._wasClientBound;\n\t}\n\t/** @internal Current auth state for debugging/testing. */\n\tget authState() {\n\t\treturn this._authState$.value;\n\t}\n\t/**\n\t* Set the directory instance\n\t* Called by SignalWire after directory is created\n\t* @internal\n\t*/\n\tsetDirectory(directory) {\n\t\tthis._directory = directory;\n\t}\n\tasync execute(request, options) {\n\t\ttry {\n\t\t\treturn await this.transport.execute(request, options);\n\t\t} catch (error) {\n\t\t\tlogger$8.debug(\"[Session] Execute Error\", error);\n\t\t\tthis._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\tthrow error;\n\t\t}\n\t}\n\tsend(message) {\n\t\tthis.transport.send(message);\n\t}\n\tasync init() {\n\t\tawait this.loadAuthorizationStateFromStorage();\n\t\tthis.setupMessageHandlers();\n\t\treturn true;\n\t}\n\tsetupMessageHandlers() {\n\t\tlogger$8.debug(\"[Session] Setting up message handlers\");\n\t\tthis.subscribeTo(this.authStateEvent$, async (authStateEvent) => {\n\t\t\tlogger$8.debug(\"[Session] Authorization state event received:\", authStateEvent);\n\t\t\ttry {\n\t\t\t\tawait this.updateAuthorizationStateInStorage(authStateEvent.authorization_state);\n\t\t\t} catch (error) {\n\t\t\t\tlogger$8.error(\"[Session] Failed to handle authorization state update:\", error);\n\t\t\t\tthis._errors$.next(new AuthStateHandlerError(error));\n\t\t\t}\n\t\t});\n\t\tthis.subscribeTo(this.transport.connectionStatus$.pipe(filter((status) => status === \"disconnected\" || status === \"reconnecting\")), () => {\n\t\t\tif (this._authState$.value.kind === \"authenticated\") this._authState$.next({ kind: \"unauthenticated\" });\n\t\t});\n\t\tthis.subscribeTo(this.transport.connectionStatus$.pipe(filter((status) => status === \"connected\"), exhaustMap(() => {\n\t\t\tlogger$8.debug(\"[Session] Connection established, initiating authentication\");\n\t\t\treturn from(this.authenticate()).pipe(catchError((error) => {\n\t\t\t\tthis.handleAuthenticationError(error).catch((err) => {\n\t\t\t\t\tlogger$8.error(\"[Session] Error handling authentication failure:\", err);\n\t\t\t\t});\n\t\t\t\treturn EMPTY;\n\t\t\t}));\n\t\t})), void 0);\n\t\tthis.subscribeTo(this.vertoInvite$, async (invite) => {\n\t\t\tlogger$8.debug(\"[Session] Verto invite received:\", invite);\n\t\t\ttry {\n\t\t\t\tawait this.createInboundCall(invite);\n\t\t\t} catch (error) {\n\t\t\t\tlogger$8.error(\"[Session] Error handling Verto invite:\", error);\n\t\t\t\tthis._errors$.next(new VertoInviteHandlerError(error));\n\t\t\t}\n\t\t});\n\t\tthis.subscribeTo(this.vertoAttach$, async (attach) => {\n\t\t\tlogger$8.debug(\"[Session] Verto attach received:\", attach);\n\t\t\ttry {\n\t\t\t\tawait this.handleVertoAttach(attach);\n\t\t\t} catch (error) {\n\t\t\t\tlogger$8.error(\"[Session] Error handling Verto attach:\", error);\n\t\t\t\tthis._errors$.next(new VertoAttachHandlerError(error));\n\t\t\t}\n\t\t});\n\t}\n\tasync loadAuthorizationStateFromStorage() {\n\t\ttry {\n\t\t\tconst storedState = await this.storage.getItem(this.authorizationStateKey);\n\t\t\tthis.authorizationState$.next(storedState ?? void 0);\n\t\t} catch (error) {\n\t\t\tlogger$8.error(\"Failed to retrieve authorization state from storage:\", error);\n\t\t\tthis.authorizationState$.next(void 0);\n\t\t}\n\t}\n\tasync updateAuthorizationStateInStorage(authorizationState) {\n\t\tif (!authorizationState) {\n\t\t\tlogger$8.debug(\"[Session] Removing authorization state from storage\");\n\t\t\ttry {\n\t\t\t\tawait this.storage.removeItem(this.authorizationStateKey);\n\t\t\t\tthis.authorizationState$.next(void 0);\n\t\t\t} catch (error) {\n\t\t\t\tlogger$8.error(\"Failed to remove authorization state from storage:\", error);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tlogger$8.debug(\"[Session] Updating authorization state in storage\");\n\t\t\tawait this.storage.setItem(this.authorizationStateKey, authorizationState);\n\t\t\tthis.authorizationState$.next(authorizationState);\n\t\t} catch (error) {\n\t\t\tlogger$8.error(\"Failed to retrieve authorization state from storage:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\tget authStateEvent$() {\n\t\treturn this.cachedObservable(\"authStateEvent$\", () => this.signalingEvent$.pipe(tap((msg) => {\n\t\t\tlogger$8.debug(\"[Session] Received incoming message:\", msg);\n\t\t}), filterAs(isSignalwireAuthorizationStateMetadata, \"params\"), tap((event) => {\n\t\t\tlogger$8.debug(\"[Session] Authorization state event received:\", event.authorization_state);\n\t\t})));\n\t}\n\tget signalingEvent$() {\n\t\treturn this.cachedObservable(\"signalingEvent$\", () => this.transport.incomingEvent$.pipe(filterAs(isSignalwireRequest, \"params\"), share()));\n\t}\n\tget vertoInvite$() {\n\t\treturn this.cachedObservable(\"vertoInvite$\", () => this.signalingEvent$.pipe(filter(isWebrtcMessageMetadata), filter((event) => isVertoInviteMessage(event.params)), map((event) => ({\n\t\t\tnode_id: event.node_id,\n\t\t\t...event.params.params\n\t\t}))));\n\t}\n\tget vertoAttach$() {\n\t\treturn this.cachedObservable(\"vertoAttach$\", () => this.signalingEvent$.pipe(filter(isWebrtcMessageMetadata), filter((event) => isVertoAttachMessage(event.params)), map((event) => ({\n\t\t\tnode_id: event.node_id,\n\t\t\t...event.params.params\n\t\t}))));\n\t}\n\tget contexts() {\n\t\treturn [];\n\t}\n\tget eventing() {\n\t\treturn [];\n\t}\n\tget topics() {\n\t\treturn [];\n\t}\n\tget authentication() {\n\t\tconst credential = this.getCredential();\n\t\tif (!credential.token) throw new DependencyError(\"Credential token is undefined\");\n\t\treturn { jwt_token: credential.token };\n\t}\n\tasync connect() {\n\t\tawait firstValueFrom(this.initialized$);\n\t\tawait this.transport.connect();\n\t\tawait firstValueFrom(this.authenticated$.pipe(takeUntil(this.destroyed$), filter(Boolean), take(1), timeout({ first: 15e3 })));\n\t}\n\tasync handleAuthenticationError(error) {\n\t\tlogger$8.error(\"Authentication error:\", error);\n\t\tconst isRecoverableAuthError = error instanceof JSONRPCError && (error.code === RPC_ERROR_REQUESTER_VALIDATION_FAILED || error.code === RPC_ERROR_INVALID_PARAMS || error.code === RPC_ERROR_AUTHENTICATION_FAILED);\n\t\tconst hasStoredState = await firstValueFrom(this.authorizationState$.pipe(take(1))) !== void 0;\n\t\tif (isRecoverableAuthError && hasStoredState) {\n\t\t\tlogger$8.debug(\"[Session] Recoverable auth error — cleaning up stored state and reconnecting fresh\");\n\t\t\ttry {\n\t\t\t\tawait this.cleanupStoredConnectionParams();\n\t\t\t} catch (cleanupError) {\n\t\t\t\tlogger$8.error(\"Failed to cleanup stored connection params:\", cleanupError);\n\t\t\t} finally {\n\t\t\t\tthis.transport.reconnect();\n\t\t\t}\n\t\t} else this._errors$.next(error);\n\t}\n\tasync cleanupStoredConnectionParams() {\n\t\tawait this.transport.setProtocol(void 0);\n\t\tawait this.updateAuthorizationStateInStorage(void 0);\n\t\tthis._authorization$.next(void 0);\n\t}\n\tasync updateAuthState(authorization_state) {\n\t\ttry {\n\t\t\tawait this.storage.setItem(this.authorizationStateKey, authorization_state);\n\t\t} catch (error) {\n\t\t\tlogger$8.error(\"Failed to update authorization state in storage:\", error);\n\t\t\tthis._errors$.next(new AuthStateHandlerError(error));\n\t\t}\n\t}\n\tasync reauthenticate(token, dpopToken, options) {\n\t\tlogger$8.debug(\"[Session] Re-authenticating session\");\n\t\ttry {\n\t\t\tlet resolvedDpopToken = dpopToken;\n\t\t\tif (!resolvedDpopToken && this.dpopManager?.initialized) try {\n\t\t\t\tresolvedDpopToken = await this.dpopManager.createRpcProof({ method: \"signalwire.reauthenticate\" });\n\t\t\t} catch (error) {\n\t\t\t\tif (this.clientBound) throw error;\n\t\t\t\tlogger$8.warn(\"[Session] Failed to create DPoP proof for reauthenticate:\", error);\n\t\t\t}\n\t\t\tconst request = RPCReauthenticate({\n\t\t\t\tproject: this._authorization$.value?.project_id ?? \"\",\n\t\t\t\tjwt_token: token,\n\t\t\t\t...resolvedDpopToken ? { dpop_token: resolvedDpopToken } : {}\n\t\t\t});\n\t\t\tawait lastValueFrom(from(this.transport.execute(request)).pipe(throwOnRPCError(), take(1), catchError((err) => {\n\t\t\t\tlogger$8.error(\"[Session] Re-authentication RPC failed:\", err);\n\t\t\t\tthrow err;\n\t\t\t})));\n\t\t\tif (options?.clientBound) this._wasClientBound = true;\n\t\t\tlogger$8.debug(\"[Session] Re-authentication successful, updating stored auth state\");\n\t\t} catch (error) {\n\t\t\tlogger$8.error(\"[Session] Re-authentication failed:\", error);\n\t\t\tthis._errors$.next(new AuthStateHandlerError(error));\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync authenticate() {\n\t\tlogger$8.debug(\"[Session] Starting authentication process\");\n\t\tconst persistedParams = await firstValueFrom(combineLatest({\n\t\t\tprotocol: this.transport.protocol$,\n\t\t\tauthorization_state: this.authorizationState$\n\t\t}).pipe(take(1)));\n\t\tlogger$8.debug(\"[Session] Persisted params:\\n\", {\n\t\t\tprotocol: persistedParams.protocol,\n\t\t\tauthStateLength: persistedParams.authorization_state?.length\n\t\t});\n\t\tconst hasReconnectState = persistedParams.authorization_state && persistedParams.protocol;\n\t\tconst storedToken = this.getCredential().token;\n\t\tconst isReconnect = hasReconnectState && storedToken;\n\t\tlet dpopToken;\n\t\tif (isReconnect) logger$8.debug(\"[Session] Reconnecting with stored jwt_token + authorization_state\");\n\t\telse if (this.onBeforeReconnect && this.clientBound) {\n\t\t\tlogger$8.debug(\"[Session] Refreshing credentials before fresh connect\");\n\t\t\tawait this.onBeforeReconnect();\n\t\t}\n\t\tif ((!isReconnect || this.clientBound) && this.dpopManager?.initialized) try {\n\t\t\tdpopToken = await this.dpopManager.createRpcProof({ method: \"signalwire.connect\" });\n\t\t} catch (error) {\n\t\t\tif (this.clientBound) throw error;\n\t\t\tlogger$8.warn(\"[Session] Failed to create DPoP proof for connect, proceeding without:\", error);\n\t\t}\n\t\tconst rpcConnectRequest = RPCConnect({\n\t\t\tauthentication: isReconnect ? { jwt_token: storedToken } : this.authentication,\n\t\t\tversion: this.connectVersion,\n\t\t\tagent: this.agent,\n\t\t\tcontexts: this.contexts,\n\t\t\teventing: this.eventing,\n\t\t\ttopics: this.topics,\n\t\t\tevent_acks: this.eventAcks,\n\t\t\t...dpopToken ? { dpop_token: dpopToken } : {},\n\t\t\t...isReconnect ? {\n\t\t\t\tauthorization_state: persistedParams.authorization_state,\n\t\t\t\tprotocol: persistedParams.protocol\n\t\t\t} : {}\n\t\t});\n\t\tconst response = await lastValueFrom(from(this.transport.execute(rpcConnectRequest)).pipe(throwOnRPCError(), map((res) => res.result), filter(isRPCConnectResult), tap(() => {\n\t\t\tlogger$8.debug(\"[Session] Response passed filter, processing authentication result\");\n\t\t}), take(1), catchError((err) => {\n\t\t\tlogger$8.error(\"[Session] Authentication RPC failed:\", err);\n\t\t\tthrow err;\n\t\t})));\n\t\tlogger$8.debug(\"[Session] Processing authentication result:\", {\n\t\t\thasProtocol: !!response.protocol,\n\t\t\thasAuthorization: !!response.authorization,\n\t\t\thasIceServers: !!response.ice_servers\n\t\t});\n\t\tif (response.protocol) await this.transport.setProtocol(response.protocol);\n\t\tthis._authorization$.next(response.authorization);\n\t\tthis._iceServers$.next(response.ice_servers ?? []);\n\t\tthis._authState$.next({ kind: \"authenticated\" });\n\t\tlogger$8.debug(\"[Session] Authentication completed successfully\");\n\t}\n\tasync disconnect() {\n\t\tthis.transport.disconnect();\n\t\tthis._authState$.next({ kind: \"unauthenticated\" });\n\t\tawait this.cleanupStoredConnectionParams();\n\t}\n\tasync createInboundCall(invite) {\n\t\tconst callSession = await this.createCall({\n\t\t\tnodeId: invite.node_id,\n\t\t\tcallId: invite.callID,\n\t\t\tinitOffer: invite.sdp,\n\t\t\ttoName: invite.callee_id_name,\n\t\t\tto: invite.callee_id_number,\n\t\t\tfromName: invite.caller_id_name,\n\t\t\tfrom: invite.caller_id_number,\n\t\t\tdisplayDirection: invite.display_direction,\n\t\t\tuserVariables: invite.userVariables\n\t\t});\n\t\tthis._calls$.next({\n\t\t\t[`${callSession.id}`]: callSession,\n\t\t\t...this._calls$.value\n\t\t});\n\t}\n\t/**\n\t* Handle a server-pushed verto.attach event at the session level.\n\t*\n\t* On page reload the server detects the reconnected session and pushes\n\t* verto.attach for any active calls. If a call object already exists\n\t* (network blip, no reload), the per-call handler in VertoManager deals\n\t* with it. This method only creates a new call object when no existing\n\t* one matches the callID.\n\t*/\n\tasync handleVertoAttach(attach) {\n\t\tconst { callID } = attach;\n\t\tif (callID in this._calls$.value) {\n\t\t\tlogger$8.debug(`[Session] Verto attach for existing call ${callID}, deferring to per-call handler`);\n\t\t\treturn;\n\t\t}\n\t\tconst storedOptions = await this.attachManager.consumePendingAttachment(callID);\n\t\tlogger$8.debug(`[Session] Creating reattached call for callID: ${callID}`);\n\t\tconst callSession = await this.createCall({\n\t\t\tnodeId: attach.node_id,\n\t\t\tcallId: callID,\n\t\t\ttoName: attach.callee_id_name,\n\t\t\tto: attach.callee_id_number,\n\t\t\tfromName: attach.caller_id_name,\n\t\t\tfrom: attach.caller_id_number,\n\t\t\treattach: true,\n\t\t\t...storedOptions\n\t\t});\n\t\tthis._calls$.next({\n\t\t\t[`${callSession.id}`]: callSession,\n\t\t\t...this._calls$.value\n\t\t});\n\t}\n\tasync createOutboundCall(destination, options = {}) {\n\t\tconst destinationURI = destination instanceof Address ? destination.defaultChannel : destination;\n\t\tlet callSession;\n\t\ttry {\n\t\t\tcallSession = await this.createCall({\n\t\t\t\tto: destinationURI,\n\t\t\t\t...options\n\t\t\t});\n\t\t\tawait firstValueFrom(race(callSession.selfId$.pipe(filter((id) => Boolean(id)), take(1), timeout(this.callCreateTimeout)), callSession.errors$.pipe(take(1), switchMap((callError) => throwError(() => callError.error)))));\n\t\t\tthis._calls$.next({\n\t\t\t\t[`${callSession.id}`]: callSession,\n\t\t\t\t...this._calls$.value\n\t\t\t});\n\t\t\treturn callSession;\n\t\t} catch (error) {\n\t\t\tlogger$8.error(\"[Session] Error creating outbound call:\", error);\n\t\t\tcallSession?.destroy();\n\t\t\tconst callError = new CallCreateError(error instanceof TimeoutError ? \"Call create timeout\" : \"Call creation failed\", error, \"outbound\");\n\t\t\tthis._errors$.next(callError);\n\t\t\tthrow callError;\n\t\t}\n\t}\n\tasync createCall(options = {}) {\n\t\ttry {\n\t\t\tconst addressURI = getAddressSearchURI(options);\n\t\t\tlet address;\n\t\t\ttry {\n\t\t\t\tif (!this._directory) throw new DependencyError(\"Directory not initialized\");\n\t\t\t\tconst addressId = await this._directory.findAddressIdByURI(addressURI);\n\t\t\t\tif (!addressId) throw new DependencyError(`Address name: ${addressURI} not found`);\n\t\t\t\taddress = this._directory.get(addressId);\n\t\t\t\tif (!address) throw new DependencyError(`Address ID: ${addressId} not found`);\n\t\t\t} catch {\n\t\t\t\tlogger$8.warn(`[Session] Directory lookup failed for ${addressURI}, proceeding with raw URI`);\n\t\t\t}\n\t\t\tconst callSession = this.callFactory.createCall(address, { ...options });\n\t\t\tthis.subscribeTo(callSession.status$.pipe(filter((status) => status === \"destroyed\"), take(1)), () => {\n\t\t\t\tconst { [`${callSession.id}`]: _, ...remainingCalls } = this._calls$.value;\n\t\t\t\tthis._calls$.next(remainingCalls);\n\t\t\t});\n\t\t\treturn callSession;\n\t\t} catch (error) {\n\t\t\tlogger$8.error(\"[Session] Error creating call session:\", error);\n\t\t\tthrow new CallCreateError(\"Call create error\", error, options.initOffer ? \"inbound\" : \"outbound\");\n\t\t}\n\t}\n\tdestroy() {\n\t\tfor (const call of Object.values(this._calls$.value)) call.hangup();\n\t\tsuper.destroy();\n\t}\n};\nvar ClientSessionWrapper = class {\n\tconstructor(clientSessionManager) {\n\t\tthis.clientSessionManager = clientSessionManager;\n\t}\n\tget authenticated$() {\n\t\treturn this.clientSessionManager.authenticated$;\n\t}\n\tget authenticated() {\n\t\treturn this.clientSessionManager.authenticated;\n\t}\n\tget signalingEvent$() {\n\t\treturn this.clientSessionManager.signalingEvent$;\n\t}\n\tget iceServers() {\n\t\treturn this.clientSessionManager.iceServers;\n\t}\n\tasync execute(request, options) {\n\t\treturn this.clientSessionManager.execute(request, options);\n\t}\n\tget incomingCalls$() {\n\t\treturn this.clientSessionManager.incomingCalls$;\n\t}\n\tget incomingCalls() {\n\t\treturn this.clientSessionManager.incomingCalls;\n\t}\n\tget calls$() {\n\t\treturn this.clientSessionManager.calls$;\n\t}\n\tget calls() {\n\t\treturn this.clientSessionManager.calls;\n\t}\n};\n\n//#endregion\n//#region src/utils/isString.ts\nconst isString = (obj) => typeof obj === \"string\";\n\n//#endregion\n//#region src/managers/ConversationsManager.ts\nconst logger$7 = getLogger();\nvar ConversationMessagesFetcher = class extends Fetcher {\n\tconstructor(groupId, http) {\n\t\tsuper(`/api/fabric/conversations/${groupId}/messages`, \"page_size=100\", http);\n\t\tthis.groupId = groupId;\n\t}\n};\nvar ConversationMessageCollection = class extends EntityCollection {\n\tconstructor(groupId, update$, http, onError) {\n\t\tsuper(new ConversationMessagesFetcher(groupId, http), update$, onError);\n\t}\n};\nvar ConversationsManager = class {\n\tconstructor(clientSession, http, getSubscriberAddressId, onError) {\n\t\tthis.clientSession = clientSession;\n\t\tthis.http = http;\n\t\tthis.getSubscriberAddressId = getSubscriberAddressId;\n\t\tthis.onError = onError;\n\t\tthis.groupIds = /* @__PURE__ */ new Map();\n\t}\n\tasync join(addressId) {\n\t\tconst subscriberFromAddressId = this.getSubscriberAddressId();\n\t\ttry {\n\t\t\tconst response = await this.http.request({\n\t\t\t\t...POST_PARAMS,\n\t\t\t\turl: `/api/fabric/conversations/join`,\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\tfrom_fabric_address_id: subscriberFromAddressId,\n\t\t\t\t\tfabric_address_ids: [addressId, subscriberFromAddressId]\n\t\t\t\t})\n\t\t\t});\n\t\t\tif (response.ok && !!response.body) {\n\t\t\t\tconst data = JSON.parse(response.body);\n\t\t\t\tif (isString(data.group_id)) {\n\t\t\t\t\tthis.groupIds.set(addressId, data.group_id);\n\t\t\t\t\treturn data.group_id;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new ConversationError(\"Join Failed - Unexpected response\");\n\t\t} catch (error) {\n\t\t\tlogger$7.error(\"[ConversationsManager] Failed to join conversation:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync getConversationMessageCollection(addressId) {\n\t\tconst groupId = this.groupIds.get(addressId) ?? await this.join(addressId);\n\t\treturn Promise.resolve(new ConversationMessageCollection(groupId, this.clientSession.signalingEvent$.pipe(filterAs(isConversationMessageMetadata, \"params\"), tap((event) => logger$7.debug(\"[ConversationsManager ] Conversation Event:\", event)), map((params) => ({ ...params }))), this.http, this.onError));\n\t}\n\tasync sendText(text, destinationAddressId) {\n\t\tconst groupId = this.groupIds.get(destinationAddressId) ?? await this.join(destinationAddressId);\n\t\tconst subscriberFromAddressId = this.getSubscriberAddressId();\n\t\ttry {\n\t\t\tif ((await this.http.request({\n\t\t\t\t...POST_PARAMS,\n\t\t\t\turl: \"/api/fabric/messages\",\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\tgroup_id: groupId,\n\t\t\t\t\tfrom_fabric_address_id: subscriberFromAddressId,\n\t\t\t\t\ttext\n\t\t\t\t})\n\t\t\t})).ok) return;\n\t\t\tthrow new ConversationError(\"Send Text Failed - Unexpected response\");\n\t\t} catch (error) {\n\t\t\tlogger$7.error(\"[ConversationsManager] Failed to send text message:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/managers/DeviceTokenManager.ts\nconst logger$6 = getLogger();\n/**\n* Resolves the token expiry timestamp (epoch seconds) using a 3-tier priority chain:\n* 1. `data.expires_at` — server-provided absolute timestamp\n* 2. `data.expires_in` — server-provided relative lifetime\n* 3. Fallback to `DEVICE_TOKEN_DEFAULT_EXPIRE_IN` with a warning\n*/\nfunction resolveExpiresAt(data) {\n\tif (data.expires_at) return data.expires_at;\n\tif (data.expires_in) return Math.floor(Date.now() / 1e3) + data.expires_in;\n\tlogger$6.warn(\"[DeviceToken] Could not determine token expiry, using default\");\n\treturn Math.floor(Date.now() / 1e3) + DEVICE_TOKEN_DEFAULT_EXPIRE_IN;\n}\n/**\n* Resolves the token TTL in seconds from a fresh response.\n* Called at token receive time so `expires_at - now` reflects the original lifetime.\n*\n* 1. `data.expires_in` — server-provided TTL directly\n* 2. `data.expires_at - now` — derive TTL from absolute timestamp\n* 3. Fallback to `DEVICE_TOKEN_DEFAULT_EXPIRE_IN`\n*/\nfunction resolveExpireIn(data) {\n\tif (data.expires_in) return data.expires_in;\n\tif (data.expires_at) return Math.max(data.expires_at - Math.floor(Date.now() / 1e3), 1);\n\treturn DEVICE_TOKEN_DEFAULT_EXPIRE_IN;\n}\n/**\n* Manages the Client Bound SAT lifecycle: activation, token exchange,\n* reauthentication, and automatic refresh scheduling.\n*\n* Extends {@link Destroyable} for automatic RxJS subscription and subject cleanup.\n* Uses a reactive pipeline (`BehaviorSubject` + `switchMap(timer())`) instead of\n* raw `setTimeout` for refresh scheduling.\n*/\nvar DeviceTokenManager = class extends Destroyable {\n\tconstructor(dpopManager, http, errorHandler, getCredential) {\n\t\tsuper();\n\t\tthis.dpopManager = dpopManager;\n\t\tthis.http = http;\n\t\tthis.errorHandler = errorHandler;\n\t\tthis.getCredential = getCredential;\n\t\tthis._currentToken$ = this.createBehaviorSubject(null);\n\t\tthis._refreshInProgress = false;\n\t\tthis._effectiveExpireIn = DEVICE_TOKEN_DEFAULT_EXPIRE_IN;\n\t\tthis.subscribeTo(this._currentToken$.pipe(filter(Boolean), switchMap((tokenData) => {\n\t\t\tconst expiresAt = resolveExpiresAt(tokenData);\n\t\t\tconst refreshIn = Math.max(expiresAt * 1e3 - Date.now() - DEVICE_TOKEN_REFRESH_BUFFER_MS, 1e3);\n\t\t\tlogger$6.debug(`[DeviceToken] Scheduling Client Bound SAT refresh in ${refreshIn}ms`);\n\t\t\treturn timer(refreshIn);\n\t\t})), () => {\n\t\t\tthis.executeRefresh();\n\t\t});\n\t}\n\t/** Current token TTL in milliseconds. Used to extend cached credential expiry on refresh. */\n\tget effectiveExpireIn() {\n\t\treturn this._effectiveExpireIn;\n\t}\n\t/**\n\t* Activates the Client Bound SAT flow when the subscriber's token has\n\t* `sat:refresh` scope.\n\t*\n\t* Steps:\n\t* 1. Check subscriber's `sat_claims` for `sat:refresh` scope\n\t* 2. Call `/api/fabric/subscriber/devices/token` with a DPoP proof\n\t* 3. Reauthenticate the session with the Client Bound SAT + DPoP proof\n\t* 4. Emit token to trigger the reactive refresh pipeline\n\t*/\n\tasync activate(subscriber, session, updateCredential) {\n\t\tconst { satClaims } = subscriber;\n\t\tif (!satClaims?.scope?.includes(SAT_REFRESH_SCOPE)) {\n\t\t\tlogger$6.debug(\"[DeviceToken] No sat:refresh scope, skipping Client Bound SAT activation\");\n\t\t\treturn;\n\t\t}\n\t\tthis._session = session;\n\t\tthis._updateCredential = updateCredential;\n\t\ttry {\n\t\t\tconst tokenData = await this.obtainToken();\n\t\t\tif (!tokenData.expires_at && !tokenData.expires_in && satClaims.expires_at) tokenData.expires_at = satClaims.expires_at;\n\t\t\tthis._effectiveExpireIn = resolveExpireIn(tokenData);\n\t\t\tconst rpcProof = await this.dpopManager.createRpcProof({ method: \"signalwire.reauthenticate\" });\n\t\t\tawait session.reauthenticate(tokenData.token, rpcProof, { clientBound: true });\n\t\t\tupdateCredential({ token: tokenData.token });\n\t\t\tlogger$6.info(\"[DeviceToken] Client Bound SAT activated successfully\");\n\t\t\tthis._currentToken$.next(tokenData);\n\t\t} catch (error) {\n\t\t\tlogger$6.error(\"[DeviceToken] Failed to activate Client Bound SAT:\", error);\n\t\t\tthis.errorHandler(new DPoPInitError(error, \"Failed to activate Client Bound SAT\"));\n\t\t\tconst credential = this.getCredential();\n\t\t\tconst expiresAt = satClaims.expires_at ?? (credential.expiry_at ? credential.expiry_at / 1e3 : Date.now() / 1e3 + DEVICE_TOKEN_DEFAULT_EXPIRE_IN / 1e3);\n\t\t\tthis._currentToken$.next({\n\t\t\t\ttoken: credential.token ?? \"\",\n\t\t\t\texpires_at: expiresAt\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* Obtains a Client Bound SAT from `/api/fabric/subscriber/devices/token`.\n\t* Returns the full {@link DeviceTokenResponse} including expiry metadata.\n\t*/\n\tasync obtainToken() {\n\t\tconst dpopProof = await this.dpopManager.createHttpProof({\n\t\t\tmethod: \"POST\",\n\t\t\turi: DEVICE_TOKEN_ENDPOINT\n\t\t});\n\t\tconst response = await this.http.request({\n\t\t\turl: DEVICE_TOKEN_ENDPOINT,\n\t\t\t...POST_PARAMS,\n\t\t\tbody: JSON.stringify({\n\t\t\t\tdpop_token: dpopProof,\n\t\t\t\texpire_in: DEVICE_TOKEN_DEFAULT_EXPIRE_IN\n\t\t\t})\n\t\t});\n\t\tif (!response.ok || !response.body) throw new DeviceTokenError(`Failed to obtain device token: ${response.status} ${response.statusText}`);\n\t\tconst data = JSON.parse(response.body);\n\t\tif (!data.token) throw new DeviceTokenError(\"Device token response missing token field\");\n\t\treturn data;\n\t}\n\t/**\n\t* Refreshes the Client Bound SAT via `/api/fabric/subscriber/devices/refresh`.\n\t*\n\t* Creates a fresh DPoP proof, calls the refresh endpoint, reauthenticates\n\t* the WebSocket session, and returns the new token data (scheduling is\n\t* handled by the reactive pipeline).\n\t*/\n\tasync refreshToken(session, currentToken, updateCredential) {\n\t\tlogger$6.debug(\"[DeviceToken] Refreshing Client Bound SAT\");\n\t\tconst dpopProof = await this.dpopManager.createHttpProof({\n\t\t\tmethod: \"POST\",\n\t\t\turi: DEVICE_REFRESH_ENDPOINT,\n\t\t\taccessToken: currentToken\n\t\t});\n\t\tconst response = await this.http.request({\n\t\t\turl: DEVICE_REFRESH_ENDPOINT,\n\t\t\t...POST_PARAMS,\n\t\t\tbody: JSON.stringify({\n\t\t\t\tdpop_token: dpopProof,\n\t\t\t\texpire_in: this._effectiveExpireIn\n\t\t\t})\n\t\t});\n\t\tif (!response.ok || !response.body) throw new TokenRefreshError(`Failed to refresh device token: ${response.status} ${response.statusText}`);\n\t\tconst data = JSON.parse(response.body);\n\t\tif (!data.token) throw new TokenRefreshError(\"Device token refresh response missing token field\");\n\t\tif (!data.expires_at && !data.expires_in) data.expires_in = this._effectiveExpireIn;\n\t\tthis._effectiveExpireIn = resolveExpireIn(data);\n\t\tconst rpcProof = await this.dpopManager.createRpcProof({ method: \"signalwire.reauthenticate\" });\n\t\tawait session.reauthenticate(data.token, rpcProof);\n\t\tupdateCredential({ token: data.token });\n\t\tlogger$6.info(\"[DeviceToken] Client Bound SAT refreshed successfully\");\n\t\treturn data;\n\t}\n\t/**\n\t* Executes a refresh with retry and exponential backoff.\n\t* On success, emits to `_currentToken$` to schedule the next refresh.\n\t* On all retries exhausted, emits to `errorHandler`.\n\t*/\n\tasync executeRefresh() {\n\t\tif (this._refreshInProgress) {\n\t\t\tlogger$6.debug(\"[DeviceToken] Refresh already in progress, skipping\");\n\t\t\treturn;\n\t\t}\n\t\tconst session = this._session;\n\t\tconst updateCredential = this._updateCredential;\n\t\tif (!session || !updateCredential) {\n\t\t\tlogger$6.warn(\"[DeviceToken] Cannot refresh: session or updateCredential not set\");\n\t\t\treturn;\n\t\t}\n\t\tif (!session.authenticated) {\n\t\t\tlogger$6.debug(\"[DeviceToken] Session not authenticated, deferring refresh\");\n\t\t\treturn;\n\t\t}\n\t\tthis._refreshInProgress = true;\n\t\ttry {\n\t\t\tconst currentToken = this.getCredential().token;\n\t\t\tif (!currentToken) throw new TokenRefreshError(\"No current token available for refresh\");\n\t\t\tconst newTokenData = await this.retryRefresh(session, currentToken, updateCredential);\n\t\t\tthis._currentToken$.next(newTokenData);\n\t\t} catch (error) {\n\t\t\tlogger$6.error(\"[DeviceToken] Automatic Client Bound SAT refresh failed:\", error);\n\t\t\tthis.errorHandler(error instanceof TokenRefreshError ? error : new TokenRefreshError(\"Automatic token refresh failed\", error));\n\t\t} finally {\n\t\t\tthis._refreshInProgress = false;\n\t\t}\n\t}\n\t/**\n\t* Retries `refreshToken()` up to `DEVICE_TOKEN_REFRESH_MAX_RETRIES` times\n\t* with exponential backoff (1s, 2s, 4s).\n\t*/\n\tasync retryRefresh(session, currentToken, updateCredential) {\n\t\tlet lastError;\n\t\tfor (let attempt = 0; attempt < DEVICE_TOKEN_REFRESH_MAX_RETRIES; attempt++) try {\n\t\t\treturn await this.refreshToken(session, currentToken, updateCredential);\n\t\t} catch (error) {\n\t\t\tlastError = error;\n\t\t\tif (attempt < DEVICE_TOKEN_REFRESH_MAX_RETRIES - 1) {\n\t\t\t\tconst delay = DEVICE_TOKEN_REFRESH_RETRY_BASE_MS * Math.pow(2, attempt);\n\t\t\t\tlogger$6.warn(`[DeviceToken] Refresh attempt ${attempt + 1} failed, retrying in ${delay}ms`);\n\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, delay));\n\t\t\t}\n\t\t}\n\t\tthrow lastError instanceof Error ? lastError : new TokenRefreshError(\"All refresh retries exhausted\", lastError);\n\t}\n\t/** Cleans up the manager, cancelling the reactive pipeline and all subscriptions. */\n\tdestroy() {\n\t\tsuper.destroy();\n\t}\n};\n\n//#endregion\n//#region src/managers/DiagnosticsCollector.ts\nconst logger$5 = getLogger();\n/** Default maximum number of diagnostic events to retain in the ring buffer. */\nconst DEFAULT_MAX_EVENTS = 1e3;\n/**\n* Returns the user agent string, safely handling non-browser environments.\n*/\nfunction getUserAgent() {\n\ttry {\n\t\tif (typeof navigator !== \"undefined\" && navigator.userAgent) return navigator.userAgent;\n\t} catch {}\n\treturn \"unknown\";\n}\n/**\n* DiagnosticsCollector maintains a ring buffer of diagnostic events\n* for structured export. It records connection, call, device, recovery,\n* and error events during a session, and can serialize them into a\n* plain object for support tickets or debugging.\n*\n* Extends Destroyable for lifecycle management.\n*/\nvar DiagnosticsCollector = class extends Destroyable {\n\tconstructor(options) {\n\t\tsuper();\n\t\tthis._events = [];\n\t\tthis._calls = [];\n\t\tthis._deviceChanges = [];\n\t\tthis._eventRecorded$ = this.createSubject();\n\t\tthis._sdkVersion = options.sdkVersion;\n\t\tthis._maxEvents = options.maxEvents ?? DEFAULT_MAX_EVENTS;\n\t\tlogger$5.debug(\"DiagnosticsCollector initialized\", {\n\t\t\tsdkVersion: this._sdkVersion,\n\t\t\tmaxEvents: this._maxEvents\n\t\t});\n\t}\n\t/**\n\t* Observable that emits each time a diagnostic event is recorded.\n\t*/\n\tget eventRecorded$() {\n\t\treturn this._eventRecorded$.asObservable();\n\t}\n\t/**\n\t* Record a diagnostic event into the ring buffer.\n\t*\n\t* @param category - The event category (connection, call, device, recovery, error).\n\t* @param event - A short description of the event.\n\t* @param details - Optional additional details as a key-value map.\n\t*/\n\trecord(category, event, details) {\n\t\tconst entry = {\n\t\t\ttimestamp: Date.now(),\n\t\t\tcategory,\n\t\t\tevent,\n\t\t\t...details !== void 0 ? { details } : {}\n\t\t};\n\t\tthis._events = this._appendToBuffer(this._events, entry);\n\t\tthis._eventRecorded$.next(entry);\n\t}\n\t/**\n\t* Shorthand to record a device change event.\n\t*\n\t* @param event - Description of the device change.\n\t* @param details - Optional additional details.\n\t*/\n\trecordDeviceChange(event, details) {\n\t\tconst entry = {\n\t\t\ttimestamp: Date.now(),\n\t\t\tcategory: \"device\",\n\t\t\tevent,\n\t\t\t...details !== void 0 ? { details } : {}\n\t\t};\n\t\tthis._deviceChanges = this._appendToBuffer(this._deviceChanges, entry);\n\t\tthis._events = this._appendToBuffer(this._events, entry);\n\t\tthis._eventRecorded$.next(entry);\n\t}\n\t/**\n\t* Record a call summary for diagnostic export.\n\t*\n\t* @param summary - The call diagnostic summary to add.\n\t*/\n\trecordCallSummary(summary) {\n\t\tthis._calls = this._appendCallToBuffer(this._calls, summary);\n\t\tthis.record(\"call\", \"call_summary\", {\n\t\t\tcallId: summary.callId,\n\t\t\tdirection: summary.direction,\n\t\t\tduration: summary.duration,\n\t\t\tfinalStatus: summary.finalStatus\n\t\t});\n\t}\n\t/**\n\t* Export the current diagnostic buffer as a structured plain object.\n\t* This can be JSON.stringify'd and attached to support tickets.\n\t*/\n\texport() {\n\t\treturn {\n\t\t\tsdkVersion: this._sdkVersion,\n\t\t\tuserAgent: getUserAgent(),\n\t\t\texportedAt: Date.now(),\n\t\t\tevents: [...this._events],\n\t\t\tcalls: [...this._calls],\n\t\t\tdeviceChanges: [...this._deviceChanges]\n\t\t};\n\t}\n\t/**\n\t* Clear all diagnostic buffers, resetting to empty state.\n\t*/\n\tclear() {\n\t\tthis._events = [];\n\t\tthis._calls = [];\n\t\tthis._deviceChanges = [];\n\t\tlogger$5.debug(\"DiagnosticsCollector buffers cleared\");\n\t}\n\tdestroy() {\n\t\tlogger$5.debug(\"DiagnosticsCollector destroyed\");\n\t\tsuper.destroy();\n\t}\n\t/**\n\t* Append an entry to a buffer array, enforcing the max size via ring buffer semantics.\n\t* Returns a new array (immutable pattern).\n\t*/\n\t_appendToBuffer(buffer, entry) {\n\t\tconst updated = [...buffer, entry];\n\t\tif (updated.length > this._maxEvents) return updated.slice(updated.length - this._maxEvents);\n\t\treturn updated;\n\t}\n\t/**\n\t* Append a call summary to the calls buffer, enforcing max size.\n\t* Returns a new array (immutable pattern).\n\t*/\n\t_appendCallToBuffer(buffer, entry) {\n\t\tconst updated = [...buffer, entry];\n\t\tif (updated.length > this._maxEvents) return updated.slice(updated.length - this._maxEvents);\n\t\treturn updated;\n\t}\n};\n\n//#endregion\n//#region src/utils/arrays.ts\nconst isEmptyArray = (a) => {\n\treturn (a?.length ?? 0) === 0;\n};\n\n//#endregion\n//#region src/utils/warmup.ts\nconst warmup = (observable) => {\n\tobservable.pipe(take(1)).subscribe();\n};\n\n//#endregion\n//#region src/managers/DirectoryManager.ts\nconst logger$4 = getLogger();\nvar AddressFetcher = class extends Fetcher {\n\tconstructor(http) {\n\t\tsuper(\"/api/fabric/addresses\", \"sort_by=name&sort_order=asc\", http);\n\t}\n\tasync name(name) {\n\t\tconst response = await this.http.request({\n\t\t\t...GET_PARAMS,\n\t\t\turl: `${this.endpoint}?name=${encodeURIComponent(name)}`\n\t\t});\n\t\tif (response.ok && !!response.body) {\n\t\t\tconst result = JSON.parse(response.body);\n\t\t\tif (!isEmptyArray(result.data)) return result.data[0];\n\t\t}\n\t\tlogger$4.error(\"Failed to fetch addresses\");\n\t}\n};\n/** Collection of address states with reactive updates and pagination. */\nvar AddressStateCollection = class extends EntityCollection {\n\tconstructor(update$, http, onError) {\n\t\tsuper(new AddressFetcher(http), update$, onError);\n\t}\n};\n/**\n* Manages the directory of {@link Address} entries with paginated loading.\n*\n* Implements the {@link Directory} interface and provides reactive access to\n* addresses via observables, along with pagination and lookup methods.\n*/\nvar DirectoryManager = class extends Destroyable {\n\tconstructor(http, clientSession, conversationManager, onError) {\n\t\tsuper();\n\t\tthis.http = http;\n\t\tthis.conversationManager = conversationManager;\n\t\tthis.onError = onError;\n\t\tthis.addNewAddress = (id) => {\n\t\t\tconst address = new Address(id, this.conversationManager, this);\n\t\t\tconst observable = this._statesCollection.get$(id)?.pipe(filterNull(), map((data) => {\n\t\t\t\taddress.upnext(data);\n\t\t\t\treturn address;\n\t\t\t}));\n\t\t\tif (observable) {\n\t\t\t\twarmup(observable);\n\t\t\t\tthis._observableRegistry.set(id, observable);\n\t\t\t}\n\t\t\tthis._addressesInstances.set(id, address);\n\t\t};\n\t\tthis._addresses$ = this.createBehaviorSubject([]);\n\t\tthis._addressesInstances = /* @__PURE__ */ new Map();\n\t\tthis._observableRegistry = /* @__PURE__ */ new Map();\n\t\tthis._statesCollection = new AddressStateCollection(clientSession.signalingEvent$.pipe(filterAs(isConversationMessageUpdatedMetadata, \"params\"), map((_) => ({}))), this.http, this.onError);\n\t\tthis.initSubscriptions();\n\t}\n\t/** Whether addresses are currently being loaded from the server. */\n\tget loading() {\n\t\treturn this._statesCollection.loading;\n\t}\n\tinitSubscriptions() {\n\t\tthis.subscribeTo(this._statesCollection.updated$, () => {\n\t\t\tconst existing = Array.from(this._addressesInstances.values().map((address) => address.id));\n\t\t\tconst newStates = this._statesCollection.values.filter((state) => !existing.includes(state.id));\n\t\t\tif (!isEmptyArray(newStates)) {\n\t\t\t\tnewStates.forEach((state) => this.addNewAddress(state.id));\n\t\t\t\tthis._addresses$.next(Array.from(this._addressesInstances.values()));\n\t\t\t}\n\t\t});\n\t}\n\t/** Observable stream of all addresses in the directory. */\n\tget addresses$() {\n\t\treturn this._addresses$.asObservable();\n\t}\n\t/** Current snapshot of all loaded addresses. */\n\tget addresses() {\n\t\treturn this._addresses$.value;\n\t}\n\t/** Observable indicating whether more addresses can be loaded. */\n\tget hasMore$() {\n\t\treturn this._statesCollection.hasMore$;\n\t}\n\t/** Observable of the current loading state. */\n\tget loading$() {\n\t\treturn this._statesCollection.loading$;\n\t}\n\t/**\n\t* Loads the next page of addresses from the server.\n\t*\n\t* No-op if {@link hasMore$} is `false`. Loading state is observable via {@link loading$}.\n\t* New addresses are appended to {@link addresses$} when the page loads.\n\t*/\n\tloadMore() {\n\t\tif (this._statesCollection.hasMore) this._statesCollection.loadMore();\n\t}\n\t/**\n\t* Returns a reactive observable for a specific address by ID.\n\t* @param id - The address ID to observe.\n\t* @returns An observable of the address, or `undefined` if not found.\n\t*/\n\tget$(id) {\n\t\tif (!this._observableRegistry.has(id)) this.addNewAddress(id);\n\t\treturn this._observableRegistry.get(id);\n\t}\n\t/**\n\t* Returns an address by ID from the local cache.\n\t* @param addressId - The address ID to look up.\n\t* @returns The address, or `undefined` if not found.\n\t*/\n\tget(addressId) {\n\t\treturn this._addressesInstances.get(addressId);\n\t}\n\t/**\n\t* Finds an address ID by its resource name (URI).\n\t*\n\t* Searches locally loaded addresses first, then queries the server if not found.\n\t* The resource name is the {@link Address.name} identifier, distinct from display name.\n\t*\n\t* @param name - The resource name to search for (exact match, e.g. `'/public/conference'`).\n\t* @returns The address ID, or `undefined` if no match is found locally or on server.\n\t*/\n\tasync findAddressIdByURI(name) {\n\t\tlet addressId = this._addressesInstances.values().find((addr) => addr.name === name)?.id;\n\t\tif (!addressId) {\n\t\t\tconst found$ = await this._statesCollection.find$(\"name\", name);\n\t\t\tif (found$) {\n\t\t\t\tconst state = await firstValueFrom(found$);\n\t\t\t\tthis.addNewAddress(state.id);\n\t\t\t\taddressId = state.id;\n\t\t\t}\n\t\t}\n\t\treturn addressId;\n\t}\n};\n\n//#endregion\n//#region src/controllers/WebSocketController.ts\nconst logger$3 = getLogger();\nvar WebSocketController = class WebSocketController extends Destroyable {\n\tstatic {\n\t\tthis.DEFAULT_RECONNECT_DELAY_MIN_MS = 1e3;\n\t}\n\tstatic {\n\t\tthis.DEFAULT_RECONNECT_DELAY_MAX_MS = 3e4;\n\t}\n\tstatic {\n\t\tthis.DEFAULT_CONNECTION_TIMEOUT_MS = 1e4;\n\t}\n\tconstructor(WebSocketConstructor, endpoint, outgoingMessages$, options = {}) {\n\t\tsuper();\n\t\tthis.WebSocketConstructor = WebSocketConstructor;\n\t\tthis.endpoint = endpoint;\n\t\tthis.outgoingMessages$ = outgoingMessages$;\n\t\tthis.messageQueue = [];\n\t\tthis.shouldReconnect = false;\n\t\tthis.boundHandleOpen = () => this.handleOpen();\n\t\tthis.boundHandleClose = (event) => this.handleClose(event);\n\t\tthis.boundHandleError = () => this.handleError();\n\t\tthis.boundHandleMessage = (event) => this.handleMessage(event);\n\t\tthis._status$ = this.createBehaviorSubject(\"disconnected\");\n\t\tthis._incomingMessages$ = this.createSubject();\n\t\tthis._errors$ = this.createReplaySubject(1);\n\t\tthis.reconnectDelayMin = options.reconnectDelayMin ?? WebSocketController.DEFAULT_RECONNECT_DELAY_MIN_MS;\n\t\tthis.reconnectDelayMax = options.reconnectDelayMax ?? WebSocketController.DEFAULT_RECONNECT_DELAY_MAX_MS;\n\t\tthis.connectionTimeout = options.connectionTimeout ?? WebSocketController.DEFAULT_CONNECTION_TIMEOUT_MS;\n\t\tthis.currentReconnectDelay = this.reconnectDelayMin;\n\t\tthis.subscriptions.push(this.outgoingMessages$.subscribe((data) => {\n\t\t\tthis.send(data);\n\t\t}));\n\t}\n\tget status$() {\n\t\treturn this._status$.asObservable();\n\t}\n\tget incomingMessages$() {\n\t\treturn this._incomingMessages$.asObservable();\n\t}\n\tget errors$() {\n\t\treturn this._errors$.asObservable();\n\t}\n\tconnect() {\n\t\tif (this._status$.value === \"connecting\" || this._status$.value === \"connected\") return;\n\t\tthis.shouldReconnect = true;\n\t\tthis._status$.next(\"connecting\");\n\t\tthis.createWebSocket();\n\t}\n\tdisconnect() {\n\t\tthis.shouldReconnect = false;\n\t\tthis.clearReconnectTimer();\n\t\tthis.clearConnectionTimeout();\n\t\tconst currentStatus = this._status$.value;\n\t\tif (currentStatus === \"connected\" || currentStatus === \"connecting\" || currentStatus === \"reconnecting\") if (this.socket) {\n\t\t\tthis._status$.next(\"disconnecting\");\n\t\t\tthis.socket.close();\n\t\t} else this._status$.next(\"disconnected\");\n\t\telse this._status$.next(\"disconnected\");\n\t}\n\treconnect() {\n\t\tthis.shouldReconnect = true;\n\t\tthis._status$.next(\"reconnecting\");\n\t\tthis.scheduleReconnection();\n\t}\n\tsend(data) {\n\t\tif (this._status$.value === \"connected\" && this.socket?.readyState === 1) {\n\t\t\tlogger$3.wsTraffic({\n\t\t\t\ttype: \"send\",\n\t\t\t\traw: data\n\t\t\t});\n\t\t\tthis.socket.send(data);\n\t\t} else this.messageQueue.push(data);\n\t}\n\tcreateWebSocket() {\n\t\ttry {\n\t\t\tthis.closeExistingSocket();\n\t\t\tthis.socket = new this.WebSocketConstructor(this.endpoint);\n\t\t\tthis.setupWebSocketListeners();\n\t\t\tthis.startConnectionTimeout();\n\t\t} catch (error) {\n\t\t\tconst err = error instanceof Error ? error : new UnexpectedError(\"Failed to create WebSocket\");\n\t\t\tthis._errors$.next(err);\n\t\t\tthis.handleConnectionError();\n\t\t}\n\t}\n\t/**\n\t* Closes the existing socket and removes its event listeners to prevent\n\t* phantom 'open'/'close' events from firing on the orphaned socket.\n\t*/\n\tcloseExistingSocket() {\n\t\tif (!this.socket) return;\n\t\tconst oldSocket = this.socket;\n\t\tthis.socket = void 0;\n\t\tthis.removeWebSocketListeners(oldSocket);\n\t\ttry {\n\t\t\toldSocket.close();\n\t\t} catch {}\n\t}\n\tsetupWebSocketListeners() {\n\t\tif (!this.socket) return;\n\t\tthis.socket.addEventListener(\"open\", this.boundHandleOpen);\n\t\tthis.socket.addEventListener(\"close\", this.boundHandleClose);\n\t\tthis.socket.addEventListener(\"error\", this.boundHandleError);\n\t\tthis.socket.addEventListener(\"message\", this.boundHandleMessage);\n\t}\n\tremoveWebSocketListeners(socket) {\n\t\ttry {\n\t\t\tsocket.removeEventListener(\"open\", this.boundHandleOpen);\n\t\t\tsocket.removeEventListener(\"close\", this.boundHandleClose);\n\t\t\tsocket.removeEventListener(\"error\", this.boundHandleError);\n\t\t\tsocket.removeEventListener(\"message\", this.boundHandleMessage);\n\t\t} catch {}\n\t}\n\thandleOpen() {\n\t\tthis.clearConnectionTimeout();\n\t\tthis._status$.next(\"connected\");\n\t\tthis.currentReconnectDelay = this.reconnectDelayMin;\n\t\tthis.flushMessageQueue();\n\t}\n\thandleClose(_event) {\n\t\tthis.clearConnectionTimeout();\n\t\tif (this.shouldReconnect) {\n\t\t\tthis._status$.next(\"reconnecting\");\n\t\t\tthis.scheduleReconnection();\n\t\t} else this._status$.next(\"disconnected\");\n\t}\n\thandleError() {\n\t\tconst error = new WebSocketConnectionError(\"WebSocket connection error\");\n\t\tthis._errors$.next(error);\n\t\tthis.handleConnectionError();\n\t}\n\thandleMessage(event) {\n\t\tlogger$3.wsTraffic({\n\t\t\ttype: \"recv\",\n\t\t\traw: event.data\n\t\t});\n\t\tthis._incomingMessages$.next(event);\n\t}\n\thandleConnectionError() {\n\t\tthis.reconnect();\n\t}\n\tscheduleReconnection() {\n\t\tthis.clearReconnectTimer();\n\t\tconst jitteredDelay = this.currentReconnectDelay * (.5 + Math.random() * .5);\n\t\tthis.reconnectTimer = setTimeout(() => {\n\t\t\tif (this.shouldReconnect) {\n\t\t\t\tthis._status$.next(\"connecting\");\n\t\t\t\tthis.createWebSocket();\n\t\t\t\tthis.increaseReconnectDelay();\n\t\t\t}\n\t\t}, jitteredDelay);\n\t}\n\tincreaseReconnectDelay() {\n\t\tthis.currentReconnectDelay = Math.min(this.currentReconnectDelay * 2, this.reconnectDelayMax);\n\t}\n\tstartConnectionTimeout() {\n\t\tthis.clearConnectionTimeout();\n\t\tthis.connectionTimeoutTimer = setTimeout(() => {\n\t\t\tif (this._status$.value === \"connecting\") {\n\t\t\t\tconst error = new WebSocketTimeoutError(\"WebSocket connection timeout\");\n\t\t\t\tthis._errors$.next(error);\n\t\t\t\tif (this.socket) this.socket.close();\n\t\t\t}\n\t\t}, this.connectionTimeout);\n\t}\n\tclearConnectionTimeout() {\n\t\tif (this.connectionTimeoutTimer) {\n\t\t\tclearTimeout(this.connectionTimeoutTimer);\n\t\t\tthis.connectionTimeoutTimer = void 0;\n\t\t}\n\t}\n\tclearReconnectTimer() {\n\t\tif (this.reconnectTimer) {\n\t\t\tclearTimeout(this.reconnectTimer);\n\t\t\tthis.reconnectTimer = void 0;\n\t\t}\n\t}\n\tflushMessageQueue() {\n\t\twhile (this.messageQueue.length > 0 && this.socket?.readyState === 1) {\n\t\t\tconst message = this.messageQueue.shift();\n\t\t\tif (message !== void 0) this.socket.send(message);\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/core/RPCMessages/guards/methods.guards.ts\nfunction isSignalwirePingRequest(value) {\n\treturn isJSONRPCRequest(value) && value.method === \"signalwire.ping\";\n}\n\n//#endregion\n//#region src/managers/TransportManager.ts\nconst logger$2 = getLogger();\nvar TransportManager = class extends Destroyable {\n\tconstructor(storage, protocolKey, webSocketConstructor, relayHost, onError) {\n\t\tsuper();\n\t\tthis.storage = storage;\n\t\tthis.protocolKey = protocolKey;\n\t\tthis.onError = onError;\n\t\tthis.protocol$ = this.createReplaySubject(1);\n\t\tthis.isConnecting = false;\n\t\tthis.isConnected = false;\n\t\tthis.ackEvent = () => {\n\t\t\treturn tap((message) => {\n\t\t\t\tif (isSignalwireRequest(message)) try {\n\t\t\t\t\tlogger$2.debug(\"[Transport] Sending event ack\", { eventId: message.id });\n\t\t\t\t\tthis.send(RPCEventAckResponse(message.id));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tlogger$2.error(\"[Transport] Failed to send event acknowledgment:\", error);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\tthis.replySignalwirePing = () => {\n\t\t\treturn filter((message) => {\n\t\t\t\tif (isSignalwirePingRequest(message)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlogger$2.debug(\"[Transport] Received ping, sending pong\", { pingId: message.id });\n\t\t\t\t\t\tthis.send(RPCPingResponse(message.id));\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tlogger$2.error(\"[Transport] Failed to send ping response:\", error);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t});\n\t\t};\n\t\tthis.discardStaleEvents = () => {\n\t\t\treturn filter((message) => {\n\t\t\t\tif (!isSignalwireRequest(message)) return true;\n\t\t\t\tconst eventChannel = message.params.event_channel;\n\t\t\t\tif (!eventChannel) return true;\n\t\t\t\tconst currentProtocol = this._currentProtocol;\n\t\t\t\tif (!currentProtocol) return true;\n\t\t\t\tif (!eventChannel.includes(currentProtocol)) {\n\t\t\t\t\tconst eventType = message.params.event_type;\n\t\t\t\t\tlogger$2.warn(`[Transport] Discarding stale event: ${eventType} (event_channel does not match current protocol)`);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t});\n\t\t};\n\t\tthis._outgoingMessages$ = this.createSubject();\n\t\tthis._webSocketConnections = new WebSocketController(webSocketConstructor, relayHost, this._outgoingMessages$.asObservable(), {\n\t\t\tconnectionTimeout: PreferencesContainer.instance.connectionTimeout,\n\t\t\treconnectDelayMin: PreferencesContainer.instance.reconnectDelayMin,\n\t\t\treconnectDelayMax: PreferencesContainer.instance.reconnectDelayMax\n\t\t});\n\t\tthis.subscribeTo(this._webSocketConnections.errors$, (error) => {\n\t\t\tthis.onError?.(error);\n\t\t});\n\t\tthis.initialized$ = defer(() => from(this._init())).pipe(shareReplay(1), takeUntil(this.destroyed$));\n\t\tthis._jsonRPCMessage$ = this._webSocketConnections.incomingMessages$.pipe(map((event) => {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(event.data);\n\t\t\t} catch (error) {\n\t\t\t\tlogger$2.error(\"[Transport] Failed to parse incoming message:\", error);\n\t\t\t\tthis.onError?.(new MessageParseError(error));\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}), filter((message) => message !== null && (isJSONRPCResponse(message) || isJSONRPCRequest(message))), catchError((error) => {\n\t\t\tlogger$2.error(\"[Transport] Message processing error:\", error);\n\t\t\tthis.onError?.(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\treturn EMPTY;\n\t\t}), share(), takeUntil(this.destroyed$));\n\t\tthis._jsonRPCResponse$ = this._jsonRPCMessage$.pipe(filter(isJSONRPCResponse));\n\t\tthis._incomingEvent$ = this._jsonRPCMessage$.pipe(this.ackEvent(), this.replySignalwirePing(), filter((message) => !isJSONRPCResponse(message)), this.discardStaleEvents(), share(), takeUntil(this.destroyed$));\n\t}\n\tasync setProtocol(protocol) {\n\t\tthis._currentProtocol = protocol;\n\t\tthis.protocol$.next(protocol);\n\t\tawait this._updateProtocolInStorage(protocol);\n\t}\n\tget incomingEvent$() {\n\t\treturn this._incomingEvent$;\n\t}\n\tget connectionStatus$() {\n\t\treturn this._webSocketConnections.status$;\n\t}\n\tasync connect() {\n\t\tif (this.isConnecting || this.isConnected) {\n\t\t\tlogger$2.warn(\"[Transport] Already connecting or connected\");\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.isConnecting = true;\n\t\t\tthis.subscribeTo(this.initialized$, () => {\n\t\t\t\tthis._webSocketConnections.connect();\n\t\t\t\tconst connectionSub = this._webSocketConnections.status$.pipe(filter((status) => status === \"connected\" || status === \"disconnected\"), take(1), timeout(1e4)).subscribe({\n\t\t\t\t\tnext: (status) => {\n\t\t\t\t\t\tif (status === \"connected\") {\n\t\t\t\t\t\t\tthis.isConnecting = false;\n\t\t\t\t\t\t\tthis.isConnected = true;\n\t\t\t\t\t\t\tlogger$2.debug(\"[Transport] Connection established\");\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.isConnecting = false;\n\t\t\t\t\t\t\tconst error = new TransportConnectionError(\"Failed to connect\");\n\t\t\t\t\t\t\tlogger$2.error(\"[Transport] Connection failed\");\n\t\t\t\t\t\t\tthis.onError?.(error);\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror: (err) => {\n\t\t\t\t\t\tthis.isConnecting = false;\n\t\t\t\t\t\tlogger$2.error(\"[Transport] Connection error:\", err);\n\t\t\t\t\t\tthis.onError?.(err instanceof Error ? err : new Error(String(err), { cause: err }));\n\t\t\t\t\t\treject(err);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis.subscriptions.push(connectionSub);\n\t\t\t\tthis.subscribeTo(this._webSocketConnections.status$.pipe(filter((status) => status === \"disconnected\")), () => {\n\t\t\t\t\tlogger$2.debug(\"[Transport] Disconnected\");\n\t\t\t\t\tthis.isConnected = false;\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}\n\treconnect() {\n\t\tthis._webSocketConnections.reconnect();\n\t}\n\tasync execute(request, options) {\n\t\tthis.send(request);\n\t\treturn new PendingRPC(request, this._jsonRPCResponse$, options).promise;\n\t}\n\tsend(message) {\n\t\tconst payload = JSON.stringify(message);\n\t\tthis._outgoingMessages$.next(payload);\n\t}\n\tdisconnect() {\n\t\tlogger$2.debug(\"[Transport] Disconnecting\");\n\t\tthis.isConnected = false;\n\t\tthis.isConnecting = false;\n\t\tthis._webSocketConnections.disconnect();\n\t}\n\tdestroy() {\n\t\tlogger$2.debug(\"[Transport] Destroying\");\n\t\tthis.disconnect();\n\t\tsuper.destroy();\n\t\tthis._webSocketConnections.destroy();\n\t}\n\tasync _loadProtocolFromStorage() {\n\t\ttry {\n\t\t\tconst storedProtocol = await this.storage.getItem(this.protocolKey);\n\t\t\tthis._currentProtocol = storedProtocol ?? void 0;\n\t\t\tthis.protocol$.next(storedProtocol ?? void 0);\n\t\t} catch (error) {\n\t\t\tlogger$2.error(\"Failed to retrieve protocol from storage:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync _updateProtocolInStorage(protocol) {\n\t\tif (!protocol) {\n\t\t\ttry {\n\t\t\t\tawait this.storage.removeItem(this.protocolKey);\n\t\t\t} catch (error) {\n\t\t\t\tlogger$2.error(\"Failed to remove protocol from storage:\", error);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tconst storedProtocol = await this.storage.getItem(this.protocolKey);\n\t\t\tif (!storedProtocol || storedProtocol !== protocol) await this.storage.setItem(this.protocolKey, protocol);\n\t\t} catch (error) {\n\t\t\tlogger$2.error(\"Failed to update protocol in storage:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync _init() {\n\t\tawait this._loadProtocolFromStorage();\n\t\treturn true;\n\t}\n};\n\n//#endregion\n//#region src/clients/SignalWire.ts\nconst logger$1 = getLogger();\nconst buildOptionsFromDestination = (destination) => {\n\tif (typeof destination === \"string\") {\n\t\tconst queryStartIndex = destination.indexOf(\"?\");\n\t\tif (queryStartIndex !== -1) {\n\t\t\tconst queryString = destination.substring(queryStartIndex + 1);\n\t\t\tconst channel = new URLSearchParams(queryString).get(\"channel\");\n\t\t\tif (channel === \"video\") return {\n\t\t\t\taudio: true,\n\t\t\t\tvideo: true,\n\t\t\t\treceiveVideo: true\n\t\t\t};\n\t\t\telse if (channel === \"audio\") return {\n\t\t\t\taudio: true,\n\t\t\t\tvideo: false\n\t\t\t};\n\t\t}\n\t}\n\treturn {};\n};\n/**\n* Main entry point for the SignalWire Browser SDK.\n*\n* Manages authentication, WebSocket transport, call creation, and media devices.\n*\n* @example\n* ```ts\n* const client = new SignalWire(credentialProvider);\n* client.isConnected$.subscribe(connected => console.log('Connected:', connected));\n* const call = await client.dial('/public/my-room');\n* ```\n*/\nvar SignalWire = class extends Destroyable {\n\t/**\n\t* Creates a new SignalWire client and begins connecting.\n\t*\n\t* @param credentialProvider - Provider that supplies authentication credentials.\n\t* @param options - Configuration options (connection, device monitoring, preferences).\n\t*/\n\tconstructor(credentialProvider, options = {}) {\n\t\tsuper();\n\t\tthis.preferences = new ClientPreferences();\n\t\tthis._subscriber$ = this.createBehaviorSubject(void 0);\n\t\tthis._directory$ = this.createBehaviorSubject(void 0);\n\t\tthis._isConnected$ = this.createBehaviorSubject(false);\n\t\tthis._isRegistered$ = this.createBehaviorSubject(false);\n\t\tthis._errors$ = this.createReplaySubject(1);\n\t\tthis._options = {};\n\t\tthis._deps = new DependencyContainer();\n\t\tthis._credentialProvider = credentialProvider;\n\t\tthis._options = {\n\t\t\t...PreferencesContainer.instance.defaultSignalWireOptions,\n\t\t\t...options\n\t\t};\n\t\tif (this._options.storageImplementation) this._deps.storageImpl = this._options.storageImplementation;\n\t\tif (this._options.persistSession) this._deps.persistSession = true;\n\t\tif (this._options.webSocketConstructor) this._deps.WebSocket = this._options.webSocketConstructor;\n\t\tif (this._options.savePreferences) this.preferences.enableSavePreferences(this._deps.storage);\n\t\tif (this._options.webRTCApiProvider) this._deps.webRTCApiProvider = this._options.webRTCApiProvider;\n\t\tif (this._options.logger !== void 0) setLogger(this._options.logger);\n\t\tif (this._options.logLevel) setLogLevel(this._options.logLevel);\n\t\tif (this._options.debug) setDebugOptions(this._options.debug);\n\t\tthis._deviceController = this._deps.deviceController;\n\t\tif (!this._options.skipDeviceMonitoring) this._deviceController.enableDeviceMonitoring();\n\t\tthis.subscribeTo(this._deviceController.errors$, (error) => {\n\t\t\tthis._errors$.next(error);\n\t\t});\n\t\tthis.initResilienceSubsystems();\n\t\tthis.resolveCredentials().then(() => {\n\t\t\tthis.init().catch((error) => {\n\t\t\t\tlogger$1.error(\"[SignalWire] Initialization error:\", error);\n\t\t\t\tthis._deps.storage.removeItem(\"sw:cached_credential\");\n\t\t\t\tthis._deps.storage.removeItem(\"sw:cached_credential\", \"local\");\n\t\t\t\tthis._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\t});\n\t\t}).catch((error) => {\n\t\t\tlogger$1.error(\"[SignalWire] Initialization error:\", error);\n\t\t\tthis._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t});\n\t}\n\t/**\n\t* Initializes DPoP if not already set up. Returns the fingerprint on success.\n\t*/\n\tasync initDPoP() {\n\t\tif (this._dpopManager?.initialized) return this._dpopManager.fingerprint;\n\t\ttry {\n\t\t\tthis._dpopManager = new CryptoController();\n\t\t\tconst fingerprint = await this._dpopManager.init();\n\t\t\tlogger$1.debug(\"[SignalWire] DPoP initialized, fingerprint available\");\n\t\t\treturn fingerprint;\n\t\t} catch (error) {\n\t\t\tlogger$1.warn(\"[SignalWire] DPoP initialization failed, proceeding without DPoP:\", error);\n\t\t\tthis._dpopManager = void 0;\n\t\t\treturn;\n\t\t}\n\t}\n\t/**\n\t* Resolves credentials using cache-first strategy when persistSession is enabled.\n\t*\n\t* 1. If persistSession → check localStorage for cached credential\n\t* 2. If cached and not expired → use it (skip provider.authenticate())\n\t* 3. If no cache or expired → call provider.authenticate()\n\t* 4. If no provider AND no cache → throw\n\t*/\n\tasync resolveCredentials() {\n\t\tconst fingerprint = await this.initDPoP();\n\t\tif (this._credentialProvider) return this.validateCredentials(this._credentialProvider, void 0, fingerprint);\n\t\tfor (const scope of this._deps.persistSession ? [\"local\", \"session\"] : [\"session\"]) try {\n\t\t\tconst cached = await this._deps.storage.getItem(\"sw:cached_credential\", scope);\n\t\t\tif (cached?.token) {\n\t\t\t\tlogger$1.debug(`[SignalWire] Using cached credential from ${scope}Storage`);\n\t\t\t\treturn await this.validateCredentials(void 0, cached);\n\t\t\t}\n\t\t} catch {}\n\t\tthrow new InvalidCredentialsError(\"No credential provider and no cached session. Provide a CredentialProvider or enable persistSession with a prior login.\");\n\t}\n\tasync validateCredentials(credentialProvider, credentials, fingerprint) {\n\t\tconst _fingerprint = fingerprint ?? (this._dpopManager?.initialized ? this._dpopManager.fingerprint : void 0);\n\t\tconst _credentials = credentials ?? (credentialProvider ? await credentialProvider.authenticate(_fingerprint ? { fingerprint: _fingerprint } : void 0) : void 0);\n\t\tif (!_credentials) throw new InvalidCredentialsError(\"No credentials available.\");\n\t\tif (_credentials.token) try {\n\t\t\tconst decodeHeader = jwtDecode(_credentials.token, { header: true });\n\t\t\tthis._deps.ch = decodeHeader.ch;\n\t\t} catch (error) {\n\t\t\tlogger$1.error(\"[SignalWire] Invalid JWT token provided in credentials:\", error);\n\t\t\tthrow new InvalidCredentialsError(\"Invalid JWT token provided in credentials.\", { cause: error });\n\t\t}\n\t\tif (!_credentials.token && !_credentials.authorizationState) {\n\t\t\tlogger$1.error(\"[SignalWire] No valid authentication credentials provided.\");\n\t\t\tthrow new InvalidCredentialsError(\"No valid authentication credentials provided.\");\n\t\t}\n\t\tif (!this._deps.persistSession && _credentials.expiry_at && _credentials.expiry_at < Date.now()) {\n\t\t\tlogger$1.error(\"[SignalWire] Provided credentials have expired.\");\n\t\t\tthrow new InvalidCredentialsError(\"Provided credentials have expired.\");\n\t\t}\n\t\tif (_credentials.expiry_at && credentialProvider?.refresh) this.scheduleCredentialRefresh(credentialProvider, _credentials.expiry_at);\n\t\tthis._deps.credential = _credentials;\n\t\tthis.persistCredential(_credentials);\n\t\tif (this.isConnected && this._clientSession.authenticated && _credentials.token) try {\n\t\t\tawait this._clientSession.reauthenticate(_credentials.token);\n\t\t\tlogger$1.info(\"[SignalWire] Session refreshed with new credentials.\");\n\t\t} catch (error) {\n\t\t\tlogger$1.error(\"[SignalWire] Failed to refresh session with new credentials:\", error);\n\t\t\tthis._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t}\n\t}\n\t/**\n\t* Schedules credential refresh with exponential backoff retry on failure.\n\t* On success, resets attempt counter and schedules the next refresh.\n\t* After exhausting retries, emits TokenRefreshError and disconnects.\n\t*/\n\tscheduleCredentialRefresh(credentialProvider, expiresAt, attempt = 0) {\n\t\tif (this._refreshTimerId !== void 0) clearTimeout(this._refreshTimerId);\n\t\tconst refreshInterval = attempt === 0 ? Math.max(expiresAt - Date.now() - CREDENTIAL_REFRESH_BUFFER_MS, 1e3) : Math.min(CREDENTIAL_REFRESH_RETRY_BASE_MS * Math.pow(2, attempt) * (.5 + Math.random() * .5), CREDENTIAL_REFRESH_MAX_DELAY_MS);\n\t\tthis._refreshTimerId = setTimeout(async () => {\n\t\t\ttry {\n\t\t\t\tif (!credentialProvider.refresh) throw new InvalidCredentialsError(\"Credential provider does not support refresh\");\n\t\t\t\tconst newCredentials = await credentialProvider.refresh();\n\t\t\t\tthis._deps.credential = newCredentials;\n\t\t\t\tthis.persistCredential(newCredentials);\n\t\t\t\tlogger$1.info(\"[SignalWire] Credentials refreshed successfully.\");\n\t\t\t\tif (newCredentials.expiry_at) this.scheduleCredentialRefresh(credentialProvider, newCredentials.expiry_at, 0);\n\t\t\t} catch (error) {\n\t\t\t\tconst nextAttempt = attempt + 1;\n\t\t\t\tlogger$1.error(`[SignalWire] Credential refresh failed (attempt ${nextAttempt}/${CREDENTIAL_REFRESH_MAX_RETRIES}):`, error);\n\t\t\t\tthis._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\t\tif (nextAttempt < CREDENTIAL_REFRESH_MAX_RETRIES) this.scheduleCredentialRefresh(credentialProvider, expiresAt, nextAttempt);\n\t\t\t\telse {\n\t\t\t\t\tlogger$1.error(\"[SignalWire] Credential refresh exhausted all retries. Disconnecting.\");\n\t\t\t\t\tthis._errors$.next(new TokenRefreshError(\"Credential refresh failed after max retries\"));\n\t\t\t\t\tthis.disconnect();\n\t\t\t\t}\n\t\t\t}\n\t\t}, refreshInterval);\n\t}\n\t/** Persist credential to localStorage when persistSession is enabled. */\n\tpersistCredential(credential) {\n\t\tif (!credential.token) return;\n\t\tthis._deps.storage.setItem(\"sw:cached_credential\", credential);\n\t\tif (this._deps.persistSession) this._deps.storage.setItem(\"sw:cached_credential\", credential, \"local\");\n\t}\n\tasync init() {\n\t\tthis._subscriber$.next(new Subscriber(this._deps.http));\n\t\tif (!this._options.skipConnection) await this.connect();\n\t\tif (!this._options.reconnectAttachedCalls && this._attachManager) await this._attachManager.flush();\n\t\tif (!this._options.skipRegister) try {\n\t\t\tawait this.register();\n\t\t} catch (error) {\n\t\t\tlogger$1.error(\"[SignalWire] Registration failed:\", error);\n\t\t\tthis._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t}\n\t\tthis.handleAttachments();\n\t}\n\tasync handleAttachments() {\n\t\tif (!this._attachManager) {\n\t\t\tlogger$1.error(\"[SignalWire] AttachManager not initialized\");\n\t\t\treturn;\n\t\t}\n\t\tif (!this._options.reconnectAttachedCalls) return;\n\t\ttry {\n\t\t\tawait this._attachManager.reattachCalls();\n\t\t} catch (error) {\n\t\t\tlogger$1.error(\"[SignalWire] Failed to reattach calls:\", error);\n\t\t\tthis._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t}\n\t}\n\t/**\n\t* Establishes the WebSocket connection and authenticates the session.\n\t*\n\t* ## Reconnection behavior\n\t*\n\t* After a successful connection the underlying {@link WebSocketController}\n\t* automatically attempts to reconnect whenever the socket closes\n\t* unexpectedly (e.g. network change, server restart). Reconnection uses an\n\t* **exponential back-off** strategy:\n\t*\n\t* - First retry after `reconnectDelayMin` (default **0.1 s**).\n\t* - Each subsequent retry doubles the delay up to `reconnectDelayMax`\n\t* (default **3 s**).\n\t* - The delay resets to `reconnectDelayMin` once a connection succeeds.\n\t* - A per-attempt `connectionTimeout` (default **10 s**) aborts the\n\t* attempt and schedules the next retry if the server does not respond.\n\t*\n\t* Calling {@link disconnect} stops the reconnection loop entirely.\n\t*\n\t* ## Message handling during temporary disconnections\n\t*\n\t* While the socket is not in the `connected` state, **outgoing messages\n\t* are queued** in an internal buffer. Once the connection is\n\t* re-established the queue is flushed in order so no outgoing RPC call is\n\t* lost.\n\t*\n\t* **Incoming** server-to-client messages that arrive while the socket is\n\t* down are *not* buffered by the SDK — they are expected to be\n\t* re-delivered by the server after the session is re-authenticated.\n\t* Active RPC calls that were awaiting a response will time out\n\t* (default **5 s**) and reject with an `RPCTimeoutError`; callers should\n\t* handle this and retry if appropriate.\n\t*\n\t* The connection status can be observed via the `status$` observable on\n\t* the transport layer, which emits `'connecting'`, `'connected'`,\n\t* `'reconnecting'`, `'disconnecting'`, or `'disconnected'`.\n\t*/\n\tasync connect() {\n\t\tawait this.teardownTransportAndSession();\n\t\ttry {\n\t\t\tconst subscriber = this._subscriber$.value;\n\t\t\tif (!subscriber) throw new UnexpectedError(\"Subscriber not initialized before connect\");\n\t\t\tif (!await firstValueFrom(subscriber.fetched$)) throw new UnexpectedError(\"Failed to fetch subscriber information - fetched$ emitted false\");\n\t\t\tthis._deps.subscriber = subscriber;\n\t\t} catch (error) {\n\t\t\tlogger$1.error(`[SignalWire] Failed to fetch subscriber information: ${error instanceof Error ? error.message : \"Unknown error\"}. This usually means the subscriber token is invalid or expired.`);\n\t\t\tthrow new UnexpectedError(\"Error fetching subscriber information\", { cause: error });\n\t\t}\n\t\tconst errorHandler = (error) => {\n\t\t\tthis._errors$.next(error);\n\t\t};\n\t\tthis._transport = new TransportManager(this._deps.storage, this._deps.protocolKey, this._deps.WebSocket, PreferencesContainer.instance.relayHost ?? this._deps.relayHost, errorHandler);\n\t\tthis._attachManager = new AttachManager(this._deps.storage, this._deps.deviceController, PreferencesContainer.instance.reconnectCallsTimeout, this._deps.attachedCallsKey);\n\t\tthis._clientSession = new ClientSessionManager(() => this._deps.credential, this._transport, this._deps.storage, this._deps.authorizationStateKey, this._deps.deviceController, this._attachManager, this._deps.webRTCApiProvider, this._dpopManager, this._networkMonitor?.networkChange$);\n\t\tthis._publicSession = new ClientSessionWrapper(this._clientSession);\n\t\tthis._clientSession.onBeforeReconnect = async () => {\n\t\t\tif (!this._credentialProvider) return;\n\t\t\ttry {\n\t\t\t\tconst fingerprint = this._dpopManager?.initialized ? this._dpopManager.fingerprint : void 0;\n\t\t\t\tlogger$1.debug(\"[SignalWire] Credential expired, refreshing before reconnect\");\n\t\t\t\tconst newCredentials = await this._credentialProvider.authenticate(fingerprint ? { fingerprint } : void 0);\n\t\t\t\tthis._deps.credential = newCredentials;\n\t\t\t\tlogger$1.debug(\"[SignalWire] Credential refreshed successfully for reconnect\");\n\t\t\t} catch (error) {\n\t\t\t\tlogger$1.error(\"[SignalWire] Failed to refresh credentials for reconnect:\", error);\n\t\t\t\tthis._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t};\n\t\tthis.subscribeTo(this._clientSession.errors$, (error) => {\n\t\t\tthis._errors$.next(error);\n\t\t});\n\t\tawait this._clientSession.connect();\n\t\tif (this._dpopManager?.initialized) {\n\t\t\tif (this._refreshTimerId) {\n\t\t\t\tclearTimeout(this._refreshTimerId);\n\t\t\t\tthis._refreshTimerId = void 0;\n\t\t\t\tlogger$1.debug(\"[SignalWire] Developer refresh disabled — Client Bound SAT activation starting\");\n\t\t\t}\n\t\t\tthis._deviceTokenManager = new DeviceTokenManager(this._dpopManager, this._deps.http, (error) => this._errors$.next(error), () => this._deps.credential);\n\t\t\tawait this._deviceTokenManager.activate(this._deps.subscriber, this._clientSession, (cred) => {\n\t\t\t\tthis._deps.credential = {\n\t\t\t\t\t...this._deps.credential,\n\t\t\t\t\t...cred\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t\tthis.subscribeTo(this._clientSession.authenticated$.pipe(skip(1), filter(Boolean)), async () => {\n\t\t\ttry {\n\t\t\t\tif (this._deviceTokenManager) {\n\t\t\t\t\tawait this._deviceTokenManager.activate(this._deps.subscriber, this._clientSession, (cred) => {\n\t\t\t\t\t\tthis._deps.credential = {\n\t\t\t\t\t\t\t...this._deps.credential,\n\t\t\t\t\t\t\t...cred\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t\tlogger$1.debug(\"[SignalWire] Client Bound SAT re-activated after reconnect\");\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tlogger$1.error(\"[SignalWire] Client Bound SAT re-activation failed (non-fatal):\", error);\n\t\t\t\tthis._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tlogger$1.debug(\"[SignalWire] Re-registering subscriber after reconnect\");\n\t\t\t\tawait this.register();\n\t\t\t\tlogger$1.debug(\"[SignalWire] Subscriber re-registered successfully after reconnect\");\n\t\t\t} catch (error) {\n\t\t\t\tlogger$1.error(\"[SignalWire] Re-registration failed after reconnect:\", error);\n\t\t\t\tthis._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\t}\n\t\t});\n\t\tconst conversationManager = new ConversationsManager(this._clientSession, this._deps.http, () => this._deps.getSubscriberFromAddressId(), errorHandler);\n\t\tconst directory = new DirectoryManager(this._deps.http, this._clientSession, conversationManager, errorHandler);\n\t\tthis._directory$.next(directory);\n\t\tthis._clientSession.setDirectory(directory);\n\t\tthis._isConnected$.next(true);\n\t\tthis._diagnosticsCollector?.record(\"connection\", \"connected\");\n\t\tthis.subscribeTo(this._clientSession.authenticated$.pipe(skip(2), filter(Boolean)), () => {\n\t\t\tthis._diagnosticsCollector?.record(\"connection\", \"reconnected\");\n\t\t});\n\t}\n\t/**\n\t* Observable that emits the {@link Subscriber} profile once fetched,\n\t* or `undefined` before authentication completes.\n\t*\n\t* @example\n\t* ```ts\n\t* client.subscriber$.subscribe(sub => {\n\t* if (sub) console.log('Logged in as', sub.email);\n\t* });\n\t* ```\n\t*/\n\tget subscriber$() {\n\t\treturn this.deferEmission(this._subscriber$.asObservable());\n\t}\n\t/** Current subscriber snapshot, or `undefined` if not yet authenticated. */\n\tget subscriber() {\n\t\treturn this._subscriber$.value;\n\t}\n\t/**\n\t* Observable that emits the {@link Directory} instance once the client is connected,\n\t* or `undefined` while disconnected. Subscribe to this to safely wait for the directory\n\t* to become available without risking an error.\n\t*\n\t* @example\n\t* ```ts\n\t* client.directory$.subscribe(dir => {\n\t* if (dir) dir.addresses$.subscribe(console.log);\n\t* });\n\t* ```\n\t*/\n\tget directory$() {\n\t\treturn this.deferEmission(this._directory$.asObservable());\n\t}\n\t/**\n\t* Current directory snapshot, or `undefined` if the client is not yet connected.\n\t* Prefer {@link directory$} when you need to react to the directory becoming available.\n\t*/\n\tget directory() {\n\t\treturn this._directory$.value;\n\t}\n\t/** Observable that emits when the subscriber registration state changes. */\n\tget isRegistered$() {\n\t\treturn this.deferEmission(this._isRegistered$.asObservable());\n\t}\n\t/** Whether the subscriber is currently registered. */\n\tget isRegistered() {\n\t\treturn this._isRegistered$.value;\n\t}\n\t/** Whether the client is currently connected. */\n\tget isConnected() {\n\t\treturn this._isConnected$.value;\n\t}\n\t/** Observable that emits when the connection state changes. */\n\tget isConnected$() {\n\t\treturn this.deferEmission(this._isConnected$.asObservable());\n\t}\n\t/** Observable that emits `true` when the client is both connected and authenticated. */\n\tget ready$() {\n\t\treturn this.publicCachedObservable(\"ready$\", () => this._isConnected$.pipe(switchMap((connected) => connected ? this._clientSession.authenticated$ : of(false))));\n\t}\n\t/** Observable stream of errors from transport, authentication, and devices. */\n\tget errors$() {\n\t\treturn this.deferEmission(this._errors$.asObservable());\n\t}\n\t/** Platform WebRTC capabilities detected at construction time. */\n\tget platformCapabilities() {\n\t\tthis._platformCapabilities ??= detectPlatformCapabilities(this._options.webRTCApiProvider);\n\t\treturn this._platformCapabilities;\n\t}\n\t/** Observable that emits when the SDK auto-switches a device. */\n\tget deviceRecovered$() {\n\t\treturn this.deferEmission(this._deviceController.deviceRecovered$);\n\t}\n\t/**\n\t* Export a structured diagnostic bundle for support/debugging.\n\t* Includes connection events, call summaries, and device changes.\n\t*/\n\texportDiagnostics() {\n\t\tconst devices = {\n\t\t\taudioInput: this.audioInputDevices,\n\t\t\taudioOutput: this.audioOutputDevices,\n\t\t\tvideoInput: this.videoInputDevices\n\t\t};\n\t\tconst base = {\n\t\t\tsdkVersion: \"unknown\",\n\t\t\tuserAgent: typeof navigator !== \"undefined\" ? navigator.userAgent : \"unknown\",\n\t\t\tcapabilities: this.platformCapabilities,\n\t\t\tevents: [],\n\t\t\tcalls: [],\n\t\t\tdeviceChanges: [],\n\t\t\tdevices\n\t\t};\n\t\tif (!this._diagnosticsCollector) return base;\n\t\tconst raw = this._diagnosticsCollector.export();\n\t\treturn {\n\t\t\t...base,\n\t\t\tsdkVersion: raw.sdkVersion,\n\t\t\tuserAgent: raw.userAgent,\n\t\t\tevents: raw.events,\n\t\t\tcalls: raw.calls,\n\t\t\tdeviceChanges: raw.deviceChanges,\n\t\t\tdevices\n\t\t};\n\t}\n\t/**\n\t* Initialize resilience subsystems. Non-fatal: any failure is logged and\n\t* the SDK continues working without the failing subsystem.\n\t*/\n\tinitResilienceSubsystems() {\n\t\ttry {\n\t\t\tthis._platformCapabilities = detectPlatformCapabilities(this._options.webRTCApiProvider);\n\t\t} catch (error) {\n\t\t\tlogger$1.warn(\"[SignalWire] Failed to detect platform capabilities:\", error);\n\t\t}\n\t\ttry {\n\t\t\tthis._networkMonitor = new NetworkMonitor();\n\t\t} catch (error) {\n\t\t\tlogger$1.warn(\"[SignalWire] Failed to initialize NetworkMonitor:\", error);\n\t\t}\n\t\ttry {\n\t\t\tthis._visibilityController = new VisibilityController();\n\t\t\tthis.subscribeTo(this._visibilityController.visibilityChange$.pipe(filter((event) => event.to === \"visible\" && PreferencesContainer.instance.refreshDevicesOnVisible)), () => {\n\t\t\t\tlogger$1.debug(\"[SignalWire] Page visible, re-enumerating devices\");\n\t\t\t\ttry {\n\t\t\t\t\tthis._deviceController.disableDeviceMonitoring();\n\t\t\t\t\tthis._deviceController.enableDeviceMonitoring();\n\t\t\t\t} catch {}\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tlogger$1.warn(\"[SignalWire] Failed to initialize VisibilityController:\", error);\n\t\t}\n\t\ttry {\n\t\t\tthis._diagnosticsCollector = new DiagnosticsCollector({ sdkVersion: \"3.30.0\" });\n\t\t} catch (error) {\n\t\t\tlogger$1.warn(\"[SignalWire] Failed to initialize DiagnosticsCollector:\", error);\n\t\t}\n\t}\n\t/**\n\t* Disconnects the WebSocket and tears down the current session.\n\t*\n\t* The client can be reconnected by calling {@link connect} again,\n\t* which creates a fresh transport and session.\n\t*/\n\tasync disconnect() {\n\t\tif (this._refreshTimerId) {\n\t\t\tclearTimeout(this._refreshTimerId);\n\t\t\tthis._refreshTimerId = void 0;\n\t\t}\n\t\tthis._diagnosticsCollector?.record(\"connection\", \"disconnected\");\n\t\tawait this.teardownTransportAndSession();\n\t\tthis._isConnected$.next(false);\n\t}\n\t/**\n\t* Tear down the current transport / session / attach manager. Safe to call\n\t* when nothing has been initialized yet (e.g. first connect()).\n\t*/\n\tasync teardownTransportAndSession() {\n\t\tconst session = this._clientSession;\n\t\tconst transport = this._transport;\n\t\tif (session) {\n\t\t\ttry {\n\t\t\t\tawait session.disconnect();\n\t\t\t} catch (error) {\n\t\t\t\tlogger$1.warn(\"[SignalWire] Error disconnecting previous session:\", error);\n\t\t\t}\n\t\t\tsession.destroy();\n\t\t}\n\t\tif (transport) transport.destroy();\n\t\tthis._clientSession = void 0;\n\t\tthis._publicSession = void 0;\n\t\tthis._transport = void 0;\n\t\tthis._attachManager = void 0;\n\t}\n\tasync waitAuthentication() {\n\t\tawait firstValueFrom(this.ready$.pipe(filter((ready$1) => ready$1 === true)));\n\t}\n\t/**\n\t* Registers the subscriber as online to receive inbound calls and events.\n\t*\n\t* Waits for authentication to complete before sending the registration.\n\t* If the initial attempt fails, reauthentication is attempted automatically.\n\t*\n\t* @throws {InvalidCredentialsError} If registration and reauthentication both fail.\n\t*/\n\tasync register() {\n\t\ttry {\n\t\t\tawait this.waitAuthentication();\n\t\t\tawait this._transport.execute(RPCExecute({\n\t\t\t\tmethod: \"subscriber.online\",\n\t\t\t\tparams: {}\n\t\t\t}));\n\t\t\tthis._isRegistered$.next(true);\n\t\t\treturn;\n\t\t} catch (error) {\n\t\t\tif (!this._deps.credential.token) {\n\t\t\t\tthis._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tlogger$1.debug(\"[SignalWire] Failed to register subscriber, trying reauthentication...\");\n\t\t\ttry {\n\t\t\t\tawait this._clientSession.reauthenticate(this._deps.credential.token);\n\t\t\t\tlogger$1.debug(\"[SignalWire] Reauthentication successful, retrying register()\");\n\t\t\t\tawait this._transport.execute(RPCExecute({\n\t\t\t\t\tmethod: \"subscriber.online\",\n\t\t\t\t\tparams: {}\n\t\t\t\t}));\n\t\t\t\tthis._isRegistered$.next(true);\n\t\t\t} catch (reauthError) {\n\t\t\t\tlogger$1.error(\"[SignalWire] Reauthentication failed during register():\", reauthError);\n\t\t\t\tconst registerError = new InvalidCredentialsError(\"Failed to register subscriber, and reauthentication attempt also failed. Please check your credentials.\", { cause: reauthError instanceof Error ? reauthError : new Error(String(reauthError), { cause: reauthError }) });\n\t\t\t\tthis._errors$.next(registerError);\n\t\t\t\tthrow registerError;\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* Unregisters the subscriber, going offline for inbound calls.\n\t*\n\t* The WebSocket connection remains open; use {@link disconnect} to fully close it.\n\t*/\n\tasync unregister() {\n\t\ttry {\n\t\t\tawait this._transport.execute(RPCExecute({\n\t\t\t\tmethod: \"subscriber.offline\",\n\t\t\t\tparams: {}\n\t\t\t}));\n\t\t\tthis._isRegistered$.next(false);\n\t\t} catch (error) {\n\t\t\tlogger$1.error(\"[SignalWire] Failed to unregister subscriber:\", error);\n\t\t\tthis._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));\n\t\t\tthrow error;\n\t\t}\n\t}\n\t/**\n\t* Places an outbound call to the given destination.\n\t*\n\t* Waits for authentication before dialing. Media options are merged from\n\t* saved preferences, destination query parameters (e.g. `?channel=video`),\n\t* and the provided `options` (highest priority).\n\t*\n\t* Returns a {@link Call} in `'ringing'` state. Subscribe to {@link Call.status$}\n\t* to track progression through `'connected'` → `'disconnected'`.\n\t*\n\t* @param destination - Address URI string (e.g. `'/public/my-room'`) or {@link Address} instance.\n\t* @param options - Media and dial options (audio/video, device constraints). Overrides defaults.\n\t* @returns The created {@link Call} instance.\n\t* @throws {Error} If authentication is not complete or call creation fails.\n\t*\n\t* @example\n\t* ```ts\n\t* const call = await client.dial('/public/conference', {\n\t* audio: true,\n\t* video: true,\n\t* });\n\t* call.status$.subscribe(status => console.log('Call:', status));\n\t* ```\n\t*/\n\tasync dial(destination, options = {}) {\n\t\tconst computed_options = {\n\t\t\t...PreferencesContainer.instance.preferredMediaOptions,\n\t\t\t...buildOptionsFromDestination(destination),\n\t\t\t...options\n\t\t};\n\t\tawait this.waitAuthentication();\n\t\tlogger$1.debug(\"[SignalWire] Dialing with options:\", computed_options);\n\t\treturn this._clientSession.createOutboundCall(destination, computed_options);\n\t}\n\t/**\n\t* Runs a multi-phase connectivity test against the given destination.\n\t*\n\t* The test checks:\n\t* 1. **Signaling** -- WebSocket connected, RTT measurement\n\t* 2. **Devices** -- getUserMedia succeeds with selected (or specified) devices\n\t* 3. **ICE/TURN** -- gathers ICE candidates to verify STUN/TURN reachability\n\t* 4. **Media/bandwidth** (unless `skipMediaTest`) -- dials the destination,\n\t* collects getStats() for `duration` seconds, computes bandwidth estimates\n\t*\n\t* @param destination - A destination to dial for the media test (e.g. `'/private/network-test'`).\n\t* @param options - Preflight options (duration, skipMediaTest, device overrides).\n\t* @returns A {@link PreflightResult} describing connectivity health.\n\t*\n\t* @example\n\t* ```ts\n\t* const result = await client.preflight('/private/network-test', { duration: 5 });\n\t* if (!result.ok) console.warn('Connectivity issues:', result.warnings);\n\t* ```\n\t*/\n\tasync preflight(destination, options) {\n\t\tconst iceServers = this._clientSession.iceServers ?? PreferencesContainer.instance.iceServers ?? [];\n\t\tconst isConnected = this._isConnected$.value;\n\t\treturn new PreflightRunner(this._deviceController, iceServers, isConnected, 0, async (dest, opts) => this.dial(dest, opts), options).run(destination);\n\t}\n\t/** The underlying client session for advanced RPC operations. */\n\tget session() {\n\t\treturn this._publicSession;\n\t}\n\t/** Observable list of available audio input (microphone) devices. */\n\tget audioInputDevices$() {\n\t\treturn this.deferEmission(this._deviceController.audioInputDevices$);\n\t}\n\t/** Current snapshot of available audio input devices. */\n\tget audioInputDevices() {\n\t\treturn this._deviceController.audioInputDevices;\n\t}\n\t/** Observable list of available audio output (speaker) devices. */\n\tget audioOutputDevices$() {\n\t\treturn this.deferEmission(this._deviceController.audioOutputDevices$);\n\t}\n\t/** Current snapshot of available audio output devices. */\n\tget audioOutputDevices() {\n\t\treturn this._deviceController.audioOutputDevices;\n\t}\n\t/** Observable list of available video input (camera) devices. */\n\tget videoInputDevices$() {\n\t\treturn this.deferEmission(this._deviceController.videoInputDevices$);\n\t}\n\t/** Current snapshot of available video input devices. */\n\tget videoInputDevices() {\n\t\treturn this._deviceController.videoInputDevices;\n\t}\n\t/** Observable of the currently selected audio input device. */\n\tget selectedAudioInputDevice$() {\n\t\treturn this.deferEmission(this._deviceController.selectedAudioInputDevice$);\n\t}\n\t/** Observable of the currently selected audio output device. */\n\tget selectedAudioOutputDevice$() {\n\t\treturn this.deferEmission(this._deviceController.selectedAudioOutputDevice$);\n\t}\n\t/** Observable of the currently selected video input device. */\n\tget selectedVideoInputDevice$() {\n\t\treturn this.deferEmission(this._deviceController.selectedVideoInputDevice$);\n\t}\n\t/** Currently selected audio input device, or `null` if none. */\n\tget selectedAudioInputDevice() {\n\t\treturn this._deviceController.selectedAudioInputDevice;\n\t}\n\t/** Currently selected audio output device, or `null` if none. */\n\tget selectedAudioOutputDevice() {\n\t\treturn this._deviceController.selectedAudioOutputDevice;\n\t}\n\t/** Currently selected video input device, or `null` if none. */\n\tget selectedVideoInputDevice() {\n\t\treturn this._deviceController.selectedVideoInputDevice;\n\t}\n\t/** Media track constraints for the selected audio input device. Returns `false` when disabled. */\n\tget selectedAudioInputDeviceConstraints() {\n\t\treturn this._deviceController.selectedAudioInputDeviceConstraints;\n\t}\n\t/** Media track constraints for the selected video input device. Returns `false` when disabled. */\n\tget selectedVideoInputDeviceConstraints() {\n\t\treturn this._deviceController.selectedVideoInputDeviceConstraints;\n\t}\n\t/** Converts a `MediaDeviceInfo` to track constraints suitable for `getUserMedia`. */\n\tdeviceInfoToConstraints(deviceInfo) {\n\t\treturn this._deviceController.deviceInfoToConstraints(deviceInfo);\n\t}\n\t/** Sets the preferred audio input device. */\n\tselectAudioInputDevice(device) {\n\t\tthis._deviceController.selectAudioInputDevice(device);\n\t}\n\t/** Sets the preferred video input device. */\n\tselectVideoInputDevice(device) {\n\t\tthis._deviceController.selectVideoInputDevice(device);\n\t}\n\t/** Sets the preferred audio output device. */\n\tselectAudioOutputDevice(device) {\n\t\tthis._deviceController.selectAudioOutputDevice(device);\n\t}\n\t/**\n\t* Apply the currently selected audio output device to an HTMLMediaElement\n\t* (e.g. the `<audio>` or `<video>` element the consumer attached the\n\t* remote stream to). Uses `HTMLMediaElement.setSinkId` under the hood.\n\t* Returns a `Promise<boolean>`: `true` if the sink was applied,\n\t* `false` if the browser doesn't support `setSinkId` or no device is\n\t* selected.\n\t*\n\t* @example\n\t* ```ts\n\t* audioEl.srcObject = call.remoteStream;\n\t* await client.applySelectedAudioOutputDevice(audioEl);\n\t* ```\n\t*/\n\tasync applySelectedAudioOutputDevice(element) {\n\t\tconst device = this._deviceController.selectedAudioOutputDevice;\n\t\tif (!device?.deviceId) return false;\n\t\tconst withSink = element;\n\t\tif (typeof withSink.setSinkId !== \"function\") {\n\t\t\tlogger$1.warn(\"[SignalWire] setSinkId not supported on this element / browser\");\n\t\t\treturn false;\n\t\t}\n\t\ttry {\n\t\t\tawait withSink.setSinkId(device.deviceId);\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tlogger$1.warn(\"[SignalWire] Failed to apply audio output device:\", error);\n\t\t\treturn false;\n\t\t}\n\t}\n\t/** Starts monitoring for media device changes (connect/disconnect). */\n\tenableDeviceMonitoring() {\n\t\tthis._deviceController.enableDeviceMonitoring();\n\t}\n\t/** Stops monitoring for media device changes. */\n\tdisableDeviceMonitoring() {\n\t\tthis._deviceController.disableDeviceMonitoring();\n\t}\n\t/**\n\t* Returns the capabilities of a media device.\n\t* @param deviceInfo - The device to query.\n\t* @returns The device capabilities, or `null` if unavailable.\n\t*/\n\tasync getDeviceCapabilities(deviceInfo) {\n\t\treturn this._deviceController.getDeviceCapabilities(deviceInfo);\n\t}\n\t/**\n\t* Checks whether a device is still available and usable.\n\t* @param deviceInfo - The device to validate, or `null`.\n\t* @returns `true` if the device is valid and available. Returns `false` for `null`, audio output devices, or unavailable devices.\n\t*/\n\tasync isValidDevice(deviceInfo) {\n\t\treturn this._deviceController.isValidDevice(deviceInfo);\n\t}\n\t/** Injects a storage manager into the device controller for persistence. */\n\tsetStorageManager(storageManager) {\n\t\tthis._deviceController.setStorageManager(storageManager);\n\t}\n\t/** Clears all device state and re-enumerates. */\n\tasync clearDeviceState() {\n\t\treturn this._deviceController.clearDeviceState();\n\t}\n\t/** Forces a device re-enumeration. */\n\tasync enumerateDevices() {\n\t\treturn this._deviceController.enumerateDevices();\n\t}\n\t/** Disables audio input (receive-only mode). No audio track will be acquired. */\n\tdisableAudioInput() {\n\t\tthis._deviceController.disableAudioInput();\n\t}\n\t/** Re-enables audio input, restoring the last selection or auto-selecting. */\n\tenableAudioInput() {\n\t\tthis._deviceController.enableAudioInput();\n\t}\n\t/** Disables video input (receive-only mode). No video track will be acquired. */\n\tdisableVideoInput() {\n\t\tthis._deviceController.disableVideoInput();\n\t}\n\t/** Re-enables video input, restoring the last selection or auto-selecting. */\n\tenableVideoInput() {\n\t\tthis._deviceController.enableVideoInput();\n\t}\n\t/** Observable that emits `true` when video input is disabled (receive-only). */\n\tget videoInputDisabled$() {\n\t\treturn this.deferEmission(this._deviceController.videoInputDisabled$);\n\t}\n\t/** Observable that emits `true` when audio input is disabled (receive-only). */\n\tget audioInputDisabled$() {\n\t\treturn this.deferEmission(this._deviceController.audioInputDisabled$);\n\t}\n\t/** Whether video input is currently disabled. */\n\tget videoInputDisabled() {\n\t\treturn this._deviceController.videoInputDisabled;\n\t}\n\t/** Whether audio input is currently disabled. */\n\tget audioInputDisabled() {\n\t\treturn this._deviceController.audioInputDisabled;\n\t}\n\t/**\n\t* Triggers the browser's media permission dialog and captures the user's device selections.\n\t*\n\t* @param options - Which permissions to request.\n\t* @param options.audio - Whether to request audio permission.\n\t* @param options.video - Whether to request video permission.\n\t* @returns The permission result with selected devices.\n\t*/\n\tasync requestMediaPermissions(options = {\n\t\taudio: true,\n\t\tvideo: true\n\t}) {\n\t\tconst constraints = {\n\t\t\taudio: options.audio ?? false,\n\t\t\tvideo: options.video ?? false\n\t\t};\n\t\tlet audioGranted = false;\n\t\tlet videoGranted = false;\n\t\tlet selectedAudioDevice;\n\t\tlet selectedVideoDevice;\n\t\ttry {\n\t\t\tconst tracks = (await this._deps.webRTCApiProvider.mediaDevices.getUserMedia(constraints)).getTracks();\n\t\t\tfor (const track of tracks) {\n\t\t\t\tconst settings = track.getSettings();\n\t\t\t\tif (track.kind === \"audio\") {\n\t\t\t\t\taudioGranted = true;\n\t\t\t\t\tif (settings.deviceId) selectedAudioDevice = this.audioInputDevices.find((d) => d.deviceId === settings.deviceId);\n\t\t\t\t} else if (track.kind === \"video\") {\n\t\t\t\t\tvideoGranted = true;\n\t\t\t\t\tif (settings.deviceId) selectedVideoDevice = this.videoInputDevices.find((d) => d.deviceId === settings.deviceId);\n\t\t\t\t}\n\t\t\t\ttrack.stop();\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlogger$1.warn(\"[SignalWire] Media permission request failed:\", error);\n\t\t}\n\t\tawait this._deviceController.enumerateDevices();\n\t\tif (audioGranted && selectedAudioDevice) {\n\t\t\tconst audioDeviceId = selectedAudioDevice.deviceId;\n\t\t\tselectedAudioDevice = this.audioInputDevices.find((d) => d.deviceId === audioDeviceId) ?? selectedAudioDevice;\n\t\t}\n\t\tif (videoGranted && selectedVideoDevice) {\n\t\t\tconst videoDeviceId = selectedVideoDevice.deviceId;\n\t\t\tselectedVideoDevice = this.videoInputDevices.find((d) => d.deviceId === videoDeviceId) ?? selectedVideoDevice;\n\t\t}\n\t\tif (audioGranted && selectedAudioDevice && !this.selectedAudioInputDevice) this.selectAudioInputDevice(selectedAudioDevice);\n\t\tif (videoGranted && selectedVideoDevice && !this.selectedVideoInputDevice) this.selectVideoInputDevice(selectedVideoDevice);\n\t\treturn {\n\t\t\taudio: audioGranted,\n\t\t\tvideo: videoGranted,\n\t\t\tselectedAudioDevice,\n\t\t\tselectedVideoDevice\n\t\t};\n\t}\n\t/**\n\t* Clears all SDK-persisted state and resets to defaults.\n\t*\n\t* This clears device preferences, device history, authorization state,\n\t* attached call IDs, and all SDK storage keys, then re-enumerates devices.\n\t*/\n\tasync resetToDefaults() {\n\t\tawait this._deps.storage.clearAll();\n\t\tconst prefs = PreferencesContainer.instance;\n\t\tprefs.preferredAudioInput = null;\n\t\tprefs.preferredAudioOutput = null;\n\t\tprefs.preferredVideoInput = null;\n\t\tawait this._deviceController.clearDeviceState();\n\t}\n\t/** Destroys the client, clearing timers and releasing all resources. */\n\tdestroy() {\n\t\tif (this._refreshTimerId) {\n\t\t\tclearTimeout(this._refreshTimerId);\n\t\t\tthis._refreshTimerId = void 0;\n\t\t}\n\t\tthis._deviceTokenManager?.destroy();\n\t\tthis._dpopManager?.destroy();\n\t\tif (this._attachManager) this._attachManager.detachAll();\n\t\tthis._transport.destroy();\n\t\tthis._clientSession.destroy();\n\t\ttry {\n\t\t\tthis._networkMonitor?.destroy();\n\t\t} catch {}\n\t\ttry {\n\t\t\tthis._visibilityController?.destroy();\n\t\t} catch {}\n\t\ttry {\n\t\t\tthis._diagnosticsCollector?.destroy();\n\t\t} catch {}\n\t\tthis._networkMonitor = void 0;\n\t\tthis._visibilityController = void 0;\n\t\tthis._diagnosticsCollector = void 0;\n\t\tsuper.destroy();\n\t}\n};\n\n//#endregion\n//#region src/dependencies/EmbedTokenCredentialProvider.ts\nconst logger = getLogger();\n/** Credential provider that exchanges an embed token for a SAT via the host's token endpoint. */\nvar EmbedTokenCredentialProvider = class {\n\tconstructor(host, embedToken) {\n\t\tthis.host = host;\n\t\tthis.embedToken = embedToken;\n\t}\n\tasync fetchSAT() {\n\t\tconst url = `https://${this.host}/api/fabric/embeds/tokens`;\n\t\tconst timeout$1 = 1e4;\n\t\tconst controller = new AbortController();\n\t\tconst timeoutId = setTimeout(() => controller.abort(), timeout$1);\n\t\ttry {\n\t\t\tconst response = await fetch(url, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify({ token: this.embedToken }),\n\t\t\t\tsignal: controller.signal\n\t\t\t});\n\t\t\tclearTimeout(timeoutId);\n\t\t\tif (response.ok) return (await response.json()).token;\n\t\t\tthrow new RequestError(`Failed to fetch SAT using embed token: ${response.status} ${response.statusText}`);\n\t\t} catch (error) {\n\t\t\tclearTimeout(timeoutId);\n\t\t\tif (error instanceof Error && error.name === \"AbortError\") throw new RequestTimeoutError(`Request timeout after ${timeout$1}ms`, { cause: error });\n\t\t\tlogger.error(\"[EmbedCredentialProvider] Request failed:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync authenticate() {\n\t\treturn {\n\t\t\ttoken: await this.fetchSAT(),\n\t\t\texpiry_at: Date.now() + 3600 * 1e3\n\t\t};\n\t}\n\tasync refresh() {\n\t\treturn this.authenticate();\n\t}\n};\n\n//#endregion\n//#region src/utils/embeddableCall.ts\n/**\n* Creates a call using an embed token for simple, embeddable integrations.\n*\n* Handles client creation, authentication, and dialing in a single call.\n*\n* @param options - Embed token, host, and destination.\n* @returns The created {@link Call} instance.\n*/\nasync function embeddableCall(options) {\n\tconst { to, embedToken, host } = options;\n\tconst requiredFailed = [];\n\tif (!to) requiredFailed.push(\"to\");\n\tif (!embedToken) requiredFailed.push(\"embedToken\");\n\tif (!host) requiredFailed.push(\"host\");\n\tif (requiredFailed.length > 0) return Promise.reject(new DependencyError(`Missing required options: ${requiredFailed.join(\", \")}`));\n\tconst client = new SignalWire(new EmbedTokenCredentialProvider(host, embedToken));\n\tconst call = await client.dial(to);\n\tcall.status$.pipe(first((status) => status === \"destroyed\")).subscribe(() => {\n\t\tclient.disconnect();\n\t});\n\treturn call;\n}\n\n//#endregion\n//#region src/dependencies/StaticCredentialProvider.ts\n/**\n* Credential provider that returns a fixed set of credentials.\n*\n* Use when the token is already available (e.g. from a backend endpoint).\n*\n* @example\n* ```ts\n* const provider = new StaticCredentialProvider({ token: 'my-sat-token' });\n* const client = new SignalWire(provider);\n* ```\n*/\nvar StaticCredentialProvider = class {\n\tconstructor(credentials) {\n\t\tthis.credentials = credentials;\n\t}\n\t/** Returns the static credentials. */\n\tasync authenticate() {\n\t\treturn Promise.resolve(this.credentials);\n\t}\n};\n\n//#endregion\n//#region src/index.ts\n/**\n* Library version from package.json, injected at build time.\n*/\nconst version = \"3.30.0\";\n/**\n* Flag indicating the library has been loaded and is ready to use.\n* For UMD builds: `window.SignalWire.ready`\n* For ES modules: `import { ready } from '@signalwire/js'`\n*/\nconst ready = true;\n/**\n* Emits 'signalwire:js:ready' event when the library is loaded.\n*\n* Scripts that might load BEFORE the library (check flag first):\n* ```js\n* if (window.SignalWire?.ready) {\n* // Library already loaded, use it directly\n* initApp();\n* } else {\n* window.addEventListener('signalwire:js:ready', () => initApp());\n* }\n* ```\n*/\nconst emitReadyEvent = () => {\n\tif (typeof window !== \"undefined\") {\n\t\tconst event = new CustomEvent(\"signalwire:js:ready\", { detail: { version: \"3.30.0\" } });\n\t\twindow.dispatchEvent(event);\n\t}\n};\nemitReadyEvent();\n\n//#endregion\nexport { Address, CallCreateError, ClientPreferences, CollectionFetchError, DPoPInitError, DeviceTokenError, EmbedTokenCredentialProvider, InvalidCredentialsError, MediaTrackError, MessageParseError, OverconstrainedFallbackError, Participant, PreflightError, RecoveryError, SelfCapabilities, SelfParticipant, SignalWire, StaticCredentialProvider, Subscriber, TokenRefreshError, UnexpectedError, VertoPongError, WebRTCCall, embeddableCall, getLogger, isSelfParticipant, ready, setDebugOptions, setLogLevel, setLogger, version };\n//# sourceMappingURL=index.mjs.map"],"names":["t","e","s","o","n$4","r","n","i","S","c","h","a","l","p","d","u","f","b","_a","_b","y","v","_","m","g","$","x","T","E","A","C","P","V","N","H","I","L","k","M","R","z","j","B","ExampleButton","LitElement","html","css","__decorateClass","property","customElement","s$1","e$1","callContext","debounce","func","wait","timeout","args","later","VIDEO_READY_TIMEOUT_MS","waitForVideoReady","element","resolve","resolved","done","timeoutId","attachMediaStream","stream","detachMediaStream","CallMedia","changedProperties","video","sub","paddingWrapper","viewportWidth","viewportHeight","containerRect","containerWidth","containerHeight","scaleX","scaleY","scale","maxWidth","maxHeight","videoWidth","videoHeight","videoAspectRatio","availableAspectRatio","finalWidth","finalHeight","visibleLeft","visibleTop","visibleRight","visibleBottom","visibleCenterX","visibleCenterY","containerCenterX","containerCenterY","offsetX","offsetY","provide","getSelfId","call","castParticipants","participants","Participants","value","layers","target","memberId","participant","selfId","layer","isOpen","isSelf","style","classes","consume","state","SelfMedia","videoStyle","AudioLevel","bufferLength","error","updateLevels","analyser","dataArray","levels","binCount","binsPerBar","startBin","endBin","sum","average","level","index","isActive","levelClass","size","DeviceSelector","entries","entry","wasVisible","root","devices","device","videoElement","track","audioLevelComponents","component","audioLevel","deviceId","constraints","event","deviceType","_d","_c","_f","_e","audioContext","oscillator","gainNode","label","selectedDevice","nothing","extendStatics","__extends","__","__awaiter","thisArg","_arguments","generator","adopt","reject","fulfilled","step","rejected","result","__generator","body","verb","op","__values","__read","ar","__spreadArray","to","from","pack","__await","__asyncGenerator","q","awaitReturn","resume","settle","fulfill","__asyncValues","isFunction","createErrorClass","createImpl","_super","instance","ctorFunc","UnsubscriptionError","errors","err","arrRemove","arr","item","Subscription","initialTeardown","e_1","e_2","_parentage","_parentage_1","_parentage_1_1","parent_1","e_1_1","initialFinalizer","_finalizers","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","e_2_1","teardown","parent","empty","EMPTY_SUBSCRIPTION","isSubscription","config","timeoutProvider","handler","_i","handle","reportUnhandledError","noop","errorContext","cb","Subscriber","destination","_this","EMPTY_OBSERVER","next","complete","SafeSubscriber","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","defaultErrorHandler","observable","identity","pipe","fns","pipeFromArray","input","prev","fn","Observable","subscribe","operator","subscriber","isSubscriber","source","sink","promiseCtor","getPromiseCtor","Symbol_observable","operations","isObserver","hasLift","operate","init","liftedSource","createOperatorSubscriber","onNext","onComplete","onError","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","animationFrameProvider","callback","request","cancel","timestamp","ObjectUnsubscribedError","Subject","subject","AnonymousSubject","observer","observers","hasError","isStopped","thrownError","BehaviorSubject","_value","subscription","dateTimestampProvider","ReplaySubject","_bufferSize","_windowTime","_timestampProvider","_buffer","_infiniteTimeWindow","copy","adjustedBufferSize","now","last","Action","scheduler","work","delay","intervalProvider","AsyncAction","id","_id","_scheduler","_delay","errored","errorValue","actions","nextHandle","activeHandles","findAndClearHandle","Immediate","setImmediate","clearImmediate","immediateProvider","AsapAction","Scheduler","schedulerActionCtor","AsyncScheduler","SchedulerAction","action","AsapScheduler","flushId","asapScheduler","asyncScheduler","async","AnimationFrameAction","AnimationFrameScheduler","animationFrameScheduler","EMPTY","isScheduler","popResultSelector","popScheduler","popNumber","defaultValue","isArrayLike","isPromise","isInteropObservable","isAsyncIterable","obj","createInvalidObservableTypeError","getSymbolIterator","iterator","isIterable","Symbol_iterator","readableStreamLikeToAsyncGenerator","readableStream","reader","isReadableStreamLike","innerFrom","fromInteropObservable","fromArrayLike","fromPromise","fromAsyncIterable","fromIterable","fromReadableStreamLike","obs","array","promise","iterable","iterable_1","iterable_1_1","asyncIterable","process","asyncIterable_1","asyncIterable_1_1","executeSchedule","parentSubscription","repeat","scheduleSubscription","observeOn","subscribeOn","scheduleObservable","schedulePromise","scheduleArray","scheduleIterable","scheduleAsyncIterable","scheduleReadableStreamLike","scheduled","of","throwError","errorOrErrorFactory","errorFactory","EmptyError","lastValueFrom","_hasValue","firstValueFrom","isValidDate","TimeoutError","info","schedulerArg","first","each","_with","timeoutErrorFactory","meta","originalSourceSubscription","timerSubscription","lastValue","seen","startTimer","map","project","isArray","callOrApply","mapOneOrManyArgs","getPrototypeOf","objectProto","getKeys","argsArgArrayOrObject","first_1","isPOJO","keys","key","createObject","values","combineLatest","resultSelector","observables","combineLatestInit","valueTransform","maybeSchedule","length","active","remainingFirstValues","_loop_1","hasFirstValue","execute","mergeInternals","concurrent","onBeforeNext","expand","innerSubScheduler","additionalFinalizer","buffer","isComplete","checkComplete","outerNext","doInnerSub","innerComplete","innerValue","bufferedValue","mergeMap","ii","mergeAll","concatAll","concat","defer","observableFactory","timer","dueTime","intervalOrScheduler","intervalDuration","due","interval","period","merge","sources","NEVER","argsOrArgArray","filter","predicate","race","raceInit","subscriptions","audit","durationSelector","hasValue","durationSubscriber","endDuration","cleanupDuration","auditTime","duration","catchError","selector","innerSub","syncUnsub","handledResult","scanInternals","accumulator","seed","hasSeed","emitOnNext","emitBeforeComplete","hasState","reduce","arrReducer","toArray","debounceTime","activeTask","lastTime","emit","emitWhenIdle","targetTime","take","count","distinctUntilChanged","comparator","keySelector","defaultCompare","previousKey","currentKey","exhaustMap","outerValue","scan","share","options","connector","resetOnError","resetOnComplete","resetOnRefCountZero","wrapperSource","connection","resetConnection","refCount","hasCompleted","hasErrored","cancelReset","reset","resetAndUnsubscribe","conn","dest","handleReset","on","onSubscriber","shareReplay","configOrBufferSize","windowTime","bufferSize","skip","skipWhile","taking","startWith","switchMap","innerSubscriber","innerIndex","outerIndex","takeUntil","notifier","tap","tapObserver","isUnsub","withLatestFrom","inputs","len","otherValues","ready","CallControls","nonNullSelf$","self","audioSub","muted","videoSub","screenShareSub","status","caps","capability","willBeMuted","willBeActive","type","onClick","disabled","className","tooltipText","hasSelf","hasSelfCapability","canMuteAudio","canMuteVideo","canScreenShare","CallStatusComponent","statusSub","prevStatus","elapsed","seconds","hours","minutes","secs","_exhaustive","statusText","showDuration","KEYS","DialpadComponent","digit","ClickToCallComponent","selfSub","mins","DirectoryComponent","addressesSub","addresses","loadingSub","loading","hasMoreSub","hasMore","sentinel","query","addr","address","channels","showInitialLoading","showEmptyState","showSearchingState","ParticipantControlsComponent","nameSub","name","version","definition","module","this","undefinedType","isIE","logMethods","_loggersByName","defaultLogger","bindMethod","methodName","method","traceForIE","realMethod","replaceLoggingMethods","enableLoggingWhenConsoleArrives","defaultMethodFactory","_level","_loggerName","Logger","factory","inheritedLevel","defaultLevel","userLevel","storageKey","persistLevelIfPossible","levelNum","levelName","getPersistedLevel","storedLevel","cookie","cookieName","location","clearPersistedLevel","normalizeLevel","persist","childName","initialLevel","logger","_log","UnexpectedError","at","UnimplementedError","reason","InvalidCredentialsError","WebSocketConnectionError","message","TransportConnectionError","WebSocketTimeoutError","RequestTimeoutError","RPCTimeoutError","requestId","timeoutMs","AuthStateHandlerError","StorageNotAvailableError","storageType","SerializationError","originalError","DeserializationError","StorageWriteError","StorageReadError","DependencyError","description","CallCreateError","direction","JSONRPCError","code","data","InvalidParams","ConversationError","VertoInviteHandlerError","VertoAttachHandlerError","ValidationError","VertoPongError","MessageParseError","CollectionFetchError","operation","MediaTrackError","kind","DPoPInitError","PreflightError","phase","DeviceTokenError","TokenRefreshError","datetime","log","originalFactory","logLevel","loggerName","rawMethod","prefixed","defaultLoggerLevel","userLogger","setLogger","logger$1","debugOptions","setDebugOptions","setLogLevel","getLoggerInstance","shouldStringify","payload","wsTraffic","logWsTraffic","loggerInstance","msg","getLogger","_target","prop","_receiver","filterNull","getValueFrom","path","ifIsMap","mapFn","filter$1","map$1","filterAs","resultPath","throwOnRPCError","response","InvalidTokenError","b64DecodeUnicode","str","base64UrlDecode","output","jwtDecode","token","pos","part","decoded","byteToHex","unsafeStringify","offset","getRandomValues","rnds8","rng","native","_v4","buf","rnds","v4","Destroyable","cached","publicKey","initialValue","DEFAULT_MAX_RETRIES","DEFAULT_INITIAL_DELAY","DEFAULT_DELAY_VARIATION","increasingDelay","upperDelayLimit","initialDelay","variation","currentDelay","asyncRetry","asyncCallable","retries","delayFn","validator","expectedErrorHandler","remainingAttempts","promiseAttempt","logger$30","GET_PARAMS","POST_PARAMS","HTTPRequestController","baseURL","getCredential","url","headers","timeout$1","acc","controller","httpResponse","urlString","requestHeaders","credential","sanitized","bodyText","MAX_HISTORY_SIZE","toHistoryEntry","DeviceHistoryManager","current","filtered","top","rest","availableDevices","history","exactMatch","groupMatch","INVITE_VERSION","DEFAULT_ICE_CANDIDATE_TIMEOUT_MS","DEFAULT_ICE_GATHERING_TIMEOUT_MS","DEFAULT_RECONNECT_CALLS_TIMEOUT_MS","DEFAULT_CONNECTION_TIMEOUT_MS","DEFAULT_RECONNECT_DELAY_MIN_MS","DEFAULT_RECONNECT_DELAY_MAX_MS","DEFAULT_DEVICE_DEBOUNCE_TIME_MS","DEFAULT_DEVICE_POLLING_INTERVAL_MS","PREFERENCES_STORAGE_KEY","SAT_REFRESH_SCOPE","DEVICE_TOKEN_ENDPOINT","DEVICE_REFRESH_ENDPOINT","DEVICE_TOKEN_DEFAULT_EXPIRE_IN","DEVICE_TOKEN_REFRESH_BUFFER_MS","DEVICE_TOKEN_REFRESH_MAX_RETRIES","DEVICE_TOKEN_REFRESH_RETRY_BASE_MS","CREDENTIAL_REFRESH_MAX_RETRIES","CREDENTIAL_REFRESH_RETRY_BASE_MS","CREDENTIAL_REFRESH_MAX_DELAY_MS","CREDENTIAL_REFRESH_BUFFER_MS","RPC_ERROR_REQUESTER_VALIDATION_FAILED","RPC_ERROR_INVALID_PARAMS","RPC_ERROR_AUTHENTICATION_FAILED","DEFAULT_STATS_POLLING_INTERVAL_MS","DEFAULT_STATS_BASELINE_SAMPLES","DEFAULT_STATS_NO_PACKET_THRESHOLD_MS","DEFAULT_STATS_RTT_SPIKE_MULTIPLIER","DEFAULT_STATS_PACKET_LOSS_THRESHOLD","DEFAULT_STATS_JITTER_SPIKE_MULTIPLIER","DEFAULT_STATS_HISTORY_SIZE","DEFAULT_KEYFRAME_MAX_BURST$1","DEFAULT_KEYFRAME_BURST_WINDOW_MS$1","DEFAULT_KEYFRAME_COOLDOWN_MS$1","DEFAULT_REINVITE_DEBOUNCE_TIME_MS","DEFAULT_REINVITE_MAX_ATTEMPTS","DEFAULT_REINVITE_TIMEOUT_MS","DEFAULT_RECOVERY_DEBOUNCE_TIME_MS","DEFAULT_RECOVERY_COOLDOWN_MS","DEFAULT_ICE_DISCONNECTED_GRACE_PERIOD_MS","DEFAULT_ICE_RESTART_TIMEOUT_MS$1","DEFAULT_MAX_RECOVERY_ATTEMPTS","ICE_GATHERING_COMPLETE_TIMEOUT_MS","PEER_CONNECTION_RECOVERY_WAIT_MS","PEER_CONNECTION_RECOVERY_POLL_MS","AUDIO_LEVEL_POLL_INTERVAL_MS","VAD_THRESHOLD","VAD_HOLD_MS","DEFAULT_PERSIST_DEVICE_SELECTION","DEFAULT_SYNC_DEVICES_TO_ACTIVE_CALLS","DEVICE_STORAGE_KEY_AUDIO_INPUT","DEVICE_STORAGE_KEY_AUDIO_OUTPUT","DEVICE_STORAGE_KEY_VIDEO_INPUT","DEFAULT_AUTO_MUTE_VIDEO_ON_HIDDEN","DEFAULT_REFRESH_DEVICES_ON_VISIBLE","DEFAULT_CHECK_CONNECTION_ON_VISIBLE","DEFAULT_ENABLE_AUTO_DEGRADATION","DEFAULT_DEGRADATION_BITRATE_THRESHOLD_KBPS","DEFAULT_DEGRADATION_RECOVERY_THRESHOLD_KBPS","DEFAULT_ENABLE_RELAY_FALLBACK","DEFAULT_ENABLE_NETWORK_CHANGE_DETECTION","DEFAULT_ENABLE_SERVER_HANGUP_INTERCEPTION","DEFAULT_STEREO_AUDIO","DEFAULT_STEREO_MAX_AVERAGE_BITRATE","fromSecToMs","fromMsToSec","milliseconds","logger$29","PreferencesContainer","STORED_NUMBER_KEYS","STORED_BOOLEAN_KEYS","collectStoredPreferences","container","applyStoredPreferences","stored","ClientPreferences","storage","toError","logger$28","DEVICE_STORAGE_KEYS","initialDevicesState","initialSelectedDevicesState","NavigatorDeviceController","webRTCApiProvider","storageManager","deviceInfo","device$1","restored","previous","devicesState","currentSelected","newAudioInput","newAudioOutput","newVideoInput","shouldSync","selected","preferred","labelMatches","fromHistory","newDevice","persisted","fromPersisted","preferredDevice","_kind","groupLabelMatch","previousDevice","devicesByKind","capabilities","DefaultLocalStorage","testKey","scope","store","keysToRemove","StorageManager","storageImpl","serialized","DependencyContainer","conversationManager","WebSocketConstructor","ch","firstDot","logger$27","DPOP_DB_NAME","DPOP_DB_VERSION","DPOP_STORE_NAME","DPOP_KEY_ID","base64url","bytes","binary","byte","base64urlEncode","computeJwkThumbprint","jwk","canonical","openDpopDB","db","loadKeyPairFromDB","tx","req","saveKeyPairToDB","keyPair","deleteKeyPairFromDB","CryptoController","testData","params","header","signingInput","logger$26","hasBrowserNetworkEvents","getNetworkType","getNetworkConnection","NetworkMonitor","networkType","detectCodecs","codecs","codec","extractCodecName","mimeType","slashIndex","detectInsertableStreams","detectAudioOutputSelection","detectSimulcast","detectPlatformCapabilities","provider","mediaDevices","getNavigatorMediaDevices","hasGetUserMedia","hasGetDisplayMedia","detectScreenShareAudio","logger$25","DEFAULT_MEDIA_TEST_DURATION_S","ICE_GATHERING_TIMEOUT_MS","SIGNALING_RTT_TIMEOUT_MS","DEVICE_TEST_TIMEOUT_MS","PreflightRunner","deviceController","iceServers","isConnected","transportRttMs","dialFn","warnings","signaling","connectivity","bandwidth","audioDevice","videoDevice","audioOutputDevice","audioWorking","videoWorking","audioStream","pc","peerConnection","candidateTypes","startTime","gatheringComplete","timer$1","candidateStr","offer","rttMs","stunReachable","turnReachable","hasHost","durationMs","metrics","uploadKbps","downloadKbps","latest","totalPackets","logger$24","isVisibilityApiAvailable","getCurrentVisibility","VisibilityController","newState","previousState","changeEvent","Fetchable","fromPath","http","buildRPCRequest","makeRPCResponse","DEFAULT_CONNECT_VERSION","RPCConnect","RPCReauthenticate","dpop_token","authFields","RPCPingResponse","RPCExecute","SDK_TO_VERTO_FIELD_MAP","EXCLUDED_DIALOG_PARAMS","filterVertoParams","sourceDialogParams","filteredDialogParams","mappedKey","buildVertoRPCMessage","WebrtcVerto","VertoInvite","VertoBye","VertoModify","VertoInfo","VertoAnswer","VertoSubscribe","VertoPong","VertoByeCauseCodes","RPCEventAckResponse","logger$23","AttachManager","reconnectCallsTimeout","attachKey","attached","session","mutator","updated","attachment","remaining","callId","succeeded","attempt","audioDirection","videoDirection","audioInputDevice","videoInputDevice","nodeId","receiveAudio","receiveVideo","sendAudio","sendVideo","changed","DEFAULT_ON_OFF","DEFAULT_MEMBER_CAPABILITIES","DEFAULT_CALL_CAPABILITIES","computeOnOffCapability","filteredFlags","flag","filterMemberOnOffFlags","flags","memberType","hasBooleanCapability","computeMemberCapabilities","computeCapabilities","cap","SelfCapabilities","_args","toggleDeafMethod","is","toggleHandraiseMethod","logger$22","initialState","Participant","executeMethod","distinctUntilChanged$1","_meta","SelfParticipant","vertoManager","audio","isSelfParticipant","isObject","hasProperty","isJSONRPCRequest","isJSONRPCResponse","isJSONRPCErrorResponse","createEventMetadataGuard","eventType","isSignalwireMetadata","isSignalwireRequest","isSignalwireCallMetadata","isCallJoinedMetadata","isCallLeftMetadata","isCallUpdatedMetadata","isCallStateMetadata","isCallPlayMetadata","isCallConnectMetadata","isRoomUpdatedMetadata","isMemberUpdatedMetadata","isMemberJoinedMetadata","isMemberLeftMetadata","isMemberTalkingMetadata","isLayoutChangedMetadata","isWebrtcMessageMetadata","isConversationMessageMetadata","isConversationMessageUpdatedMetadata","isSignalwireAuthorizationStateMetadata","isCallJoinedPayload","isLayoutChangedPayload","logger$21","initialSessionState","CallEventsManager","webRtcCallSession","participantsRecord","roomSessionId","callJoinedEvent","sessionState","member","memberLeftEvent","callUpdatedEvent","roomSession","layoutChangedEvent","members","newParticipant","oldValue","SDP_DIRECTIONS","extractMediaDirectionsFromSDP","sdp","lines","currentMediaKind","currentDirection","line","attr","isValidLocalDescription","mediaSectionsValidCandidates","currentSection","typeMatch","reorderCodecs","preferredVideo","preferredAudio","sections","splitIntoMediaSections","section","mLine","reorderSectionCodecs","enableStereoOpus","maxBitrate","opusPayloadType","findOpusPayloadType","updatedLines","fmtpPrefix","foundFmtp","appendStereoParams","rtpmapLine","withFmtp","setCodecPreferences","audioCodecs","videoCodecs","preferredNames","mLineParts","payloadTypes","ptToCodec","match","preferredNamesUpper","pt","codecName","nameA","nameB","reorderedPTs","fmtpLine","logger$20","ICEGatheringController","peerConnectionControllerNegotiating$","iceGatheringState","isNegotiating","validSDP","logger$19","LocalAudioPipeline","initial","clamped","sample","normalized","logger$18","LocalStreamController","tracks","localStream","trackId","logger$17","getDirection","send","recv","TransceiverController","hasAudioTrack","wantsToSendAudio","wantsToReceiveAudio","hasVideoTrack","wantsToSendVideo","wantsToReceiveVideo","rid","transceiver","isAudio","transceiverParams","transceivers","trackKind","newTracks","newTrack","transceiverOfKind","msStreamsNumber","senders","sender","constraintsToApply","fallbackError","oldTrack","mergedConstraints","constraintsWithDevice","logger$16","RTCPeerConnectionController","remoteSessionDescription","iceCandidateState","desc","iceConnectionState","connectionState","track$1","streamTrack","offerDefaults","options$1","localDescription","signalingState","initialized","tcpTransportParam","server","urls","_iceServers","restOptions","deviceConstraints","offerOptions","readyToConnect","mediaOverrides","answerOptions","finalLocal","preferredAudioCodecs","preferredVideoCodecs","stereo","answer","relayOnly","policyChanged","_g","existingTracks","newStream","raw","sender$1","existingTrack","finalRemote","isVertoMethodMessage","isVertoInviteMessage","isVertoByeMessage","isVertoAttachMessage","isVertoAnswerInnerParams","isVertoMediaInnerParams","isVertoMediaParamsInnerParams","isVertoPingInnerParams","logger$15","resolveInviteNodeId","VertoManager","callSession","WebRTCVertoManager","attachManager","vertoModifyMessage","rtcPeerConnection","memberNodeId","callID","mediaParams","rtcPeerConnController","vertoPing","vertoPongMessage","idOverride","videoReceiver","optionals","webrtcVertoMessage","innerResult","vertoMethod","optionalsParams","modifyError","inviteError","vertoByeOrAccepted","vertoAttach","dialogParams","vertoMessageRequest","vertoMessage","rtcPeerConnectionController","attach","deviceKind","mediaDirections","propose","removeTrack","cause","causeParams","dtmf","vertoInfoMessage","logger$14","RemoteAudioMeter","logger$13","DEFAULT_POLLING_INTERVAL_MS","DEFAULT_BASELINE_SAMPLES","DEFAULT_NO_AUDIO_PACKET_THRESHOLD_MS","DEFAULT_NO_VIDEO_PACKET_THRESHOLD_MS","DEFAULT_RTT_SPIKE_WARNING_MULTIPLIER","DEFAULT_RTT_SPIKE_CRITICAL_MULTIPLIER","DEFAULT_PACKET_LOSS_WARNING_PERCENT","DEFAULT_PACKET_LOSS_CRITICAL_PERCENT","DEFAULT_JITTER_SPIKE_MULTIPLIER","DEFAULT_HISTORY_WINDOW_SECONDS","computePacketLossPercent","lost","received","total","isInboundRtpStat","stat","isCandidatePairStat","RTCStatsMonitor","issues","report","samples","baseline","pair","now$1","cutoff","audioPacketsReceived","audioPacketsLost","audioJitter","videoPacketsReceived","videoPacketsLost","roundTripTime","availableOutgoingBitrate","prevSample","audioSilenceMs","videoSilenceMs","rtt","baselineRtt","rttRatio","jitter","baselineJitter","deltaAudioReceived","deltaAudioLost","deltaVideoReceived","deltaVideoLost","totalDeltaReceived","lossPercent","logger$12","DEFAULT_DEBOUNCE_TIME_MS","DEFAULT_COOLDOWN_MS","DEFAULT_ICE_GRACE_PERIOD_MS","DEFAULT_ICE_RESTART_TIMEOUT_MS","DEFAULT_MAX_ATTEMPTS","DEFAULT_KEYFRAME_MAX_BURST","DEFAULT_KEYFRAME_BURST_WINDOW_MS","DEFAULT_KEYFRAME_COOLDOWN_MS","DEFAULT_DEGRADATION_BITRATE_THRESHOLD","DEFAULT_DEGRADATION_RECOVERY_THRESHOLD","DEFAULT_PACKET_LOSS_RECOVERY_DELAY_SEC","DEGRADATION_ONLY_ISSUES","CallRecoveryManager","callbacks","trigger","bitrateKbps","wasConstrained","hasPacketLoss","pcState","signalingReady","delayMs","constrained","tier","ParticipantFactory","E_MODEL_BASE_R","E_MODEL_DELAY_WEIGHT","E_MODEL_LOSS_WEIGHT","R_FACTOR_MIN","R_FACTOR_MAX","MOS_MIN","MOS_MAX","MOS_EXCELLENT_THRESHOLD","MOS_GOOD_THRESHOLD","MOS_FAIR_THRESHOLD","MOS_POOR_THRESHOLD","computeMOS","packetLoss","rawR","mos","mosToQualityLevel","logger$11","RTT_CRITICAL_TO_WARNING_RATIO","fromDestinationParams","WebRTCCall","clientSession","initialization","userVars","managers","networkChange$","callError","variables","prefs","healthy","totalRecv","totalLost","lossPct","issue","deadline","filtered$","layout","positions","pipeline","percent","multiplier","enabled","meter","inferCallErrorKind","RECOVERABLE_RPC_CODES","isFatalError","CallFactory","sessionManager","callInstance","logger$10","Fetcher","endpoint","_item","EntityCollection","fetchController","update$","existing","allKeys","existingVal","newVal","EntityCollectionTransformed","originalCollection","filter$2","mapper","original$","Address","addressId","addressProvider","update","text","logger$9","isRPCConnectResult","PendingRPC","responses$","signal","isSettled","abortHandler","rpcError","onfulfilled","onrejected","onfinally","logger$8","getAddressSearchURI","from$1","ClientSessionManager","transport","authorizationStateKey","dpopManager","calls","directory","authStateEvent","invite","storedState","authorizationState","isRecoverableAuthError","hasStoredState","cleanupError","authorization_state","dpopToken","resolvedDpopToken","persistedParams","hasReconnectState","storedToken","isReconnect","rpcConnectRequest","res","storedOptions","destinationURI","addressURI","remainingCalls","ClientSessionWrapper","clientSessionManager","isString","logger$7","ConversationMessagesFetcher","groupId","ConversationMessageCollection","ConversationsManager","getSubscriberAddressId","subscriberFromAddressId","destinationAddressId","logger$6","resolveExpiresAt","resolveExpireIn","DeviceTokenManager","errorHandler","tokenData","expiresAt","refreshIn","updateCredential","satClaims","rpcProof","dpopProof","currentToken","newTokenData","lastError","logger$5","DEFAULT_MAX_EVENTS","getUserAgent","DiagnosticsCollector","category","details","summary","isEmptyArray","warmup","logger$4","AddressFetcher","AddressStateCollection","DirectoryManager","newStates","found$","logger$3","WebSocketController","outgoingMessages$","currentStatus","oldSocket","socket","_event","jitteredDelay","isSignalwirePingRequest","logger$2","TransportManager","protocolKey","webSocketConstructor","relayHost","eventChannel","currentProtocol","protocol","connectionSub","storedProtocol","buildOptionsFromDestination","queryStartIndex","queryString","channel","SignalWire","credentialProvider","fingerprint","credentials","_fingerprint","_credentials","decodeHeader","refreshInterval","newCredentials","nextAttempt","cred","connected","base","ready$1","reauthError","registerError","computed_options","opts","withSink","audioGranted","videoGranted","selectedAudioDevice","selectedVideoDevice","settings","audioDeviceId","videoDeviceId","StaticCredentialProvider"],"mappings":"2CAAA;AAAA;AAAA;AAAA;AAAA,mBAKA,MAAMA,GAAE,WAAWC,GAAED,GAAE,aAAsBA,GAAE,WAAX,QAAqBA,GAAE,SAAS,eAAe,uBAAuB,SAAS,WAAW,YAAY,cAAc,UAAUE,GAAE,OAAM,EAAGC,GAAE,IAAI,QAAO,IAAAC,GAAC,KAAO,CAAC,YAAY,EAAEH,EAAEE,EAAE,CAAC,GAAG,KAAK,aAAa,GAAGA,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,UACf,KAAK,gBAAgB,KAAK,eAAe,UAAS,EACtD,KAAK,WAAW,QAAO,EACvB,KAAK,eAAe,QAAO,EAC3B,GAAI,EACHyI,EAAA,KAAK,kBAAL,MAAAA,EAAsB,SACvB,MAAQ,CAAC,CACT,GAAI,EACHD,EAAA,KAAK,wBAAL,MAAAA,EAA4B,SAC7B,MAAQ,CAAC,CACT,GAAI,EACHG,EAAA,KAAK,wBAAL,MAAAA,EAA4B,SAC7B,MAAQ,CAAC,CACT,KAAK,gBAAkB,OACvB,KAAK,sBAAwB,OAC7B,KAAK,sBAAwB,OAC7B,MAAM,QAAO,CACd,CACD,EAIeujB,EAAS,EA8ErB,IAACs2B,GAA2B,KAAM,CACpC,YAAYvB,EAAa,CACxB,KAAK,YAAcA,CACpB,CAEA,MAAM,cAAe,CACpB,OAAO,QAAQ,QAAQ,KAAK,WAAW,CACxC,CACD,EAiCA,OANuB,IAAM,CAC5B,GAAI,OAAO,OAAW,IAAa,CAClC,MAAM34C,EAAQ,IAAI,YAAY,sBAAuB,CAAE,OAAQ,CAAE,QAAS,QAAQ,EAAI,EACtF,OAAO,cAAcA,CAAK,CAC3B,CACD,GACc","x_google_ignoreList":[0,1,2,3,4,5,6,8,9,10,11,12,13,14,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,138,140,141,142,143,144]}