UNPKG

@veltdev/sdk

Version:

Velt is an SDK to add collaborative features to your product within minutes. Example: Comments like Figma, Frame.io, Google docs or sheets, Recording like Loom, Huddles like Slack and much more.

37 lines (36 loc) 7.65 MB
var SNIPPYLY_VERSION = '4.7.0'; (function(c,E){"use strict";function U(){var e=X.splice(0,X.length);for(ue=0;e.length;)e.shift().call(null,e.shift())}function fe(e,t){for(var n=0,r=e.length;n<r;n++)Le(e[n],t)}function ot(e){for(var t,n=0,r=e.length;n<r;n++)t=e[n],_(t,B[pe(t)])}function de(e){return function(t){Lt(t)&&(Le(t,e),L.length&&fe(t.querySelectorAll(L),e))}}function pe(e){var t=ae.call(e,"is"),n=e.nodeName.toUpperCase(),r=H.call(D,t?J+t.toUpperCase():q+n);return t&&-1<r&&!Ie(n,t)?-1:r}function Ie(e,t){return-1<L.indexOf(e+'[is="'+t+'"]')}function Fe(e){var t=e.currentTarget,n=e.attrChange,r=e.attrName,o=e.target,l=e[Y]||2,a=e[ge]||3;!se||o&&o!==t||!t[C]||r==="style"||e.prevValue===e.newValue&&(e.newValue!==""||n!==l&&n!==a)||t[C](r,n===l?null:e.prevValue,n===a?null:e.newValue)}function Se(e){var t=de(e);return function(n){X.push(t,n.target),ue&&clearTimeout(ue),ue=setTimeout(U,1)}}function he(e){rt&&(rt=!1,e.currentTarget.removeEventListener(Ze,he)),L.length&&fe((e.target||u).querySelectorAll(L),e.detail===v?v:y),R&&at()}function lt(e,t){var n=this;Je.call(n,e,t),Ee.call(n,{target:n})}function Pe(e,t,n){var r=t.apply(e,n),o=pe(r);return-1<o&&_(r,B[o]),n.pop()&&L.length&&ot(r.querySelectorAll(L)),r}function Te(e,t){Tt(e,t),Q?Q.observe(e,gt):(ce&&(e.setAttribute=lt,e[g]=ve(e),e[b](st,Ee)),e[b](N,Fe)),e[x]&&se&&(e.created=!0,e[x](),e.created=!1)}function at(){for(var e,t=0,n=z.length;t<n;t++)e=z[t],P.contains(e)||(n--,z.splice(t--,1),Le(e,v))}function Ve(e){throw new Error("A "+e+" type is already registered")}function Le(e,t){var n,r,o=pe(e);-1<o&&!Mt.call(e,"TEMPLATE")&&(W(e,B[o]),o=0,t!==y||e[y]?t!==v||e[v]||(e[y]=!1,e[v]=!0,r="disconnected",o=1):(e[v]=!1,e[y]=!0,r="connected",o=1,R&&H.call(z,e)<0&&z.push(e)),o&&(n=e[t+O]||e[r+O])&&n.call(e))}function K(){}function Re(e,t,n){var r=n&&n[k]||"",o=t.prototype,l=we(o),a=t.observedAttributes||Ce,m={prototype:l};le(l,x,{value:function(){if(ne)ne=!1;else if(!this[j]){this[j]=!0,new t(this),o[x]&&o[x].call(this);var i=G[re.get(t)];(!Z||i.create.length>1)&&ke(this)}}}),le(l,C,{value:function(i){-1<H.call(a,i)&&o[C]&&o[C].apply(this,arguments)}}),o[Be]&&le(l,ut,{value:o[Be]}),o[je]&&le(l,ct,{value:o[je]}),r&&(m[k]=r),e=e.toUpperCase(),G[e]={constructor:t,create:r?[r,oe(e)]:[e]},re.set(t,e),u[S](e.toLowerCase(),m),Me(e),V[e].r()}function Ue(e){var t=G[e.toUpperCase()];return t&&t.constructor}function _e(e){return typeof e=="string"?e:e&&e.is||""}function ke(e){for(var t,n=e[C],r=n?e.attributes:Ce,o=r.length;o--;)t=r[o],n.call(e,t.name||t.nodeName,null,t.value||t.nodeValue)}function Me(e){return e=e.toUpperCase(),e in V||(V[e]={},V[e].p=new $e(function(t){V[e].r=t})),V[e].p}function xe(){w&&delete c.customElements,I(c,"customElements",{configurable:!0,value:new K}),I(c,"CustomElementRegistry",{configurable:!0,value:K});for(var e=it.get(/^HTML[A-Z]*[a-z]/),t=e.length;t--;(function(n){var r=c[n];if(r){c[n]=function(o){var l,a;return o||(o=this),o[j]||(ne=!0,l=G[re.get(o.constructor)],a=Z&&l.create.length===1,o=a?Reflect.construct(r,Ce,l.constructor):u.createElement.apply(u,l.create),o[j]=!0,ne=!1,a||ke(o)),o},c[n].prototype=r.prototype;try{r.prototype.constructor=c[n]}catch{pt=!0,I(r,j,{value:c[n]})}}})(e[t]));u.createElement=function(n,r){var o=_e(r);return o?Oe.call(this,n,oe(o)):Oe.call(this,n)},tt||(Ne=!0,u[S](""))}var u=c.document,T=c.Object,it=(function(e){var t,n,r,o,l=/^[A-Z]+[a-z]/,a=function(d){var f,h=[];for(f in i)d.test(f)&&h.push(f);return h},m=function(d,f){(f=f.toLowerCase())in i||(i[d]=(i[d]||[]).concat(f),i[f]=i[f.toUpperCase()]=d)},i=(T.create||T)(null),s={};for(n in e)for(o in e[n])for(r=e[n][o],i[o]=r,t=0;t<r.length;t++)i[r[t].toLowerCase()]=i[r[t].toUpperCase()]=o;return s.get=function(d){return typeof d=="string"?i[d]||(l.test(d)?[]:""):a(d)},s.set=function(d,f){return l.test(d)?m(d,f):m(f,d),s},s})({collections:{HTMLAllCollection:["all"],HTMLCollection:["forms"],HTMLFormControlsCollection:["elements"],HTMLOptionsCollection:["options"]},elements:{Element:["element"],HTMLAnchorElement:["a"],HTMLAppletElement:["applet"],HTMLAreaElement:["area"],HTMLAttachmentElement:["attachment"],HTMLAudioElement:["audio"],HTMLBRElement:["br"],HTMLBaseElement:["base"],HTMLBodyElement:["body"],HTMLButtonElement:["button"],HTMLCanvasElement:["canvas"],HTMLContentElement:["content"],HTMLDListElement:["dl"],HTMLDataElement:["data"],HTMLDataListElement:["datalist"],HTMLDetailsElement:["details"],HTMLDialogElement:["dialog"],HTMLDirectoryElement:["dir"],HTMLDivElement:["div"],HTMLDocument:["document"],HTMLElement:["element","abbr","address","article","aside","b","bdi","bdo","cite","code","command","dd","dfn","dt","em","figcaption","figure","footer","header","i","kbd","mark","nav","noscript","rp","rt","ruby","s","samp","section","small","strong","sub","summary","sup","u","var","wbr"],HTMLEmbedElement:["embed"],HTMLFieldSetElement:["fieldset"],HTMLFontElement:["font"],HTMLFormElement:["form"],HTMLFrameElement:["frame"],HTMLFrameSetElement:["frameset"],HTMLHRElement:["hr"],HTMLHeadElement:["head"],HTMLHeadingElement:["h1","h2","h3","h4","h5","h6"],HTMLHtmlElement:["html"],HTMLIFrameElement:["iframe"],HTMLImageElement:["img"],HTMLInputElement:["input"],HTMLKeygenElement:["keygen"],HTMLLIElement:["li"],HTMLLabelElement:["label"],HTMLLegendElement:["legend"],HTMLLinkElement:["link"],HTMLMapElement:["map"],HTMLMarqueeElement:["marquee"],HTMLMediaElement:["media"],HTMLMenuElement:["menu"],HTMLMenuItemElement:["menuitem"],HTMLMetaElement:["meta"],HTMLMeterElement:["meter"],HTMLModElement:["del","ins"],HTMLOListElement:["ol"],HTMLObjectElement:["object"],HTMLOptGroupElement:["optgroup"],HTMLOptionElement:["option"],HTMLOutputElement:["output"],HTMLParagraphElement:["p"],HTMLParamElement:["param"],HTMLPictureElement:["picture"],HTMLPreElement:["pre"],HTMLProgressElement:["progress"],HTMLQuoteElement:["blockquote","q","quote"],HTMLScriptElement:["script"],HTMLSelectElement:["select"],HTMLShadowElement:["shadow"],HTMLSlotElement:["slot"],HTMLSourceElement:["source"],HTMLSpanElement:["span"],HTMLStyleElement:["style"],HTMLTableCaptionElement:["caption"],HTMLTableCellElement:["td","th"],HTMLTableColElement:["col","colgroup"],HTMLTableElement:["table"],HTMLTableRowElement:["tr"],HTMLTableSectionElement:["thead","tbody","tfoot"],HTMLTemplateElement:["template"],HTMLTextAreaElement:["textarea"],HTMLTimeElement:["time"],HTMLTitleElement:["title"],HTMLTrackElement:["track"],HTMLUListElement:["ul"],HTMLUnknownElement:["unknown","vhgroupv","vkeygen"],HTMLVideoElement:["video"]},nodes:{Attr:["node"],Audio:["audio"],CDATASection:["node"],CharacterData:["node"],Comment:["#comment"],Document:["#document"],DocumentFragment:["#document-fragment"],DocumentType:["node"],HTMLDocument:["#document"],Image:["img"],Option:["option"],ProcessingInstruction:["node"],ShadowRoot:["#shadow-root"],Text:["#text"],XMLDocument:["xml"]}});typeof E!="object"&&(E={type:E||"auto"});var X,Ee,$,ve,Q,He,W,_,A,S="registerElement",qe=1e5*c.Math.random()>>0,g="__"+S+qe,b="addEventListener",y="attached",O="Callback",v="detached",k="extends",C="attributeChanged"+O,ut=y+O,Be="connected"+O,je="disconnected"+O,x="created"+O,ct=v+O,Y="ADDITION",ge="REMOVAL",N="DOMAttrModified",Ze="DOMContentLoaded",st="DOMSubtreeModified",q="<",J="=",mt=/^[A-Z][._A-Z0-9]*-[-._A-Z0-9]*$/,ft=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],D=[],B=[],L="",P=u.documentElement,H=D.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},be=T.prototype,ye=be.hasOwnProperty,ee=be.isPrototypeOf,I=T.defineProperty,Ce=[],te=T.getOwnPropertyDescriptor,Ge=T.getOwnPropertyNames,dt=T.getPrototypeOf,ze=T.setPrototypeOf,Ke=!!T.__proto__,pt=!1,j="__dreCEv1",w=c.customElements,Z=!/^force/.test(E.type)&&!!(w&&w.define&&w.get&&w.whenDefined),Xe=T.create||T,ht=c.Map||function(){var e,t=[],n=[];return{get:function(r){return n[H.call(t,r)]},set:function(r,o){e=H.call(t,r),e<0?n[t.push(r)-1]=o:n[e]=o}}},$e=c.Promise||function(e){function t(l){for(r=!0;n.length;)n.shift()(l)}var n=[],r=!1,o={catch:function(){return o},then:function(l){return n.push(l),r&&setTimeout(t,1),o}};return e(t),o},ne=!1,G=Xe(null),V=Xe(null),re=new ht,oe=function(e){return e.toLowerCase()},we=T.create||function e(t){return t?(e.prototype=t,new e):this},Tt=ze||(Ke?function(e,t){return e.__proto__=t,e}:Ge&&te?(function(){function e(t,n){for(var r,o=Ge(n),l=0,a=o.length;l<a;l++)r=o[l],ye.call(t,r)||I(t,r,te(n,r))}return function(t,n){do e(t,n);while((n=dt(n))&&!ee.call(n,t));return t}})():function(e,t){for(var n in t)e[n]=t[n];return e}),F=c.MutationObserver||c.WebKitMutationObserver,Qe=c.HTMLAnchorElement,p=(c.HTMLElement||c.Element||c.Node).prototype,R=!ee.call(p,P),le=R?function(e,t,n){return e[t]=n.value,e}:I,Lt=R?function(e){return e.nodeType===1}:function(e){return ee.call(p,e)},z=R&&[],We=p.attachShadow,Ye=p.cloneNode,Mt=p.closest||function(e){for(var t=this;t&&t.nodeName!==e;)t=t.parentNode;return t},Ae=p.dispatchEvent,ae=p.getAttribute,Et=p.hasAttribute,vt=p.removeAttribute,Je=p.setAttribute,ie=u.createElement,Ht=u.importNode,Oe=ie,gt=F&&{attributes:!0,characterData:!0,attributeOldValue:!0},et=F||function(e){ce=!1,P.removeEventListener(N,et)},ue=0,tt=S in u&&!/^force-all/.test(E.type),nt=!0,Ne=!1,ce=!0,rt=!0,se=!0;if(F&&(A=u.createElement("div"),A.innerHTML="<div><div></div></div>",new F(function(e,t){if(e[0]&&e[0].type=="childList"&&!e[0].removedNodes[0].childNodes.length){A=te(p,"innerHTML");var n=A&&A.set;n&&I(p,"innerHTML",{set:function(r){for(;this.lastChild;)this.removeChild(this.lastChild);n.call(this,r)}})}t.disconnect(),A=null}).observe(A,{childList:!0,subtree:!0}),A.innerHTML=""),tt||(ze||Ke?(W=function(e,t){ee.call(t,e)||Te(e,t)},_=Te):(W=function(e,t){e[g]||(e[g]=T(!0),Te(e,t))},_=W),R?(ce=!1,(function(){var e=te(p,b),t=e.value,n=function(l){var a=new CustomEvent(N,{bubbles:!0});a.attrName=l,a.prevValue=ae.call(this,l),a.newValue=null,a[ge]=a.attrChange=2,vt.call(this,l),Ae.call(this,a)},r=function(l,a){var m=Et.call(this,l),i=m&&ae.call(this,l),s=new CustomEvent(N,{bubbles:!0});Je.call(this,l,a),s.attrName=l,s.prevValue=m?i:null,s.newValue=a,m?s.MODIFICATION=s.attrChange=1:s[Y]=s.attrChange=0,Ae.call(this,s)},o=function(l){var a,m=l.currentTarget,i=m[g],s=l.propertyName;i.hasOwnProperty(s)&&(i=i[s],a=new CustomEvent(N,{bubbles:!0}),a.attrName=i.name,a.prevValue=i.value||null,a.newValue=i.value=m[s]||null,a.prevValue==null?a[Y]=a.attrChange=0:a.MODIFICATION=a.attrChange=1,Ae.call(m,a))};e.value=function(l,a,m){l===N&&this[C]&&this.setAttribute!==r&&(this[g]={className:{name:"class",value:this.className}},this.setAttribute=r,this.removeAttribute=n,t.call(this,"propertychange",o)),t.call(this,l,a,m)},I(p,b,e)})()):F||(P[b](N,et),P.setAttribute(g,1),P.removeAttribute(g),ce&&(Ee=function(e){var t,n,r,o=this;if(o===e.target){t=o[g],o[g]=n=ve(o);for(r in n){if(!(r in t))return $(0,o,r,t[r],n[r],Y);if(n[r]!==t[r])return $(1,o,r,t[r],n[r],"MODIFICATION")}for(r in t)if(!(r in n))return $(2,o,r,t[r],n[r],ge)}},$=function(e,t,n,r,o,l){var a={attrChange:e,currentTarget:t,attrName:n,prevValue:r,newValue:o};a[l]=e,Fe(a)},ve=function(e){for(var t,n,r={},o=e.attributes,l=0,a=o.length;l<a;l++)t=o[l],(n=t.name)!=="setAttribute"&&(r[n]=t.value);return r})),u[S]=function(e,t){if(n=e.toUpperCase(),nt&&(nt=!1,F?(Q=(function(i,s){function d(f,h){for(var M=0,me=f.length;M<me;h(f[M++]));}return new F(function(f){for(var h,M,me,De=0,bt=f.length;De<bt;De++)h=f[De],h.type==="childList"?(d(h.addedNodes,i),d(h.removedNodes,s)):(M=h.target,se&&M[C]&&h.attributeName!=="style"&&(me=ae.call(M,h.attributeName))!==h.oldValue&&M[C](h.attributeName,h.oldValue,me))})})(de(y),de(v)),He=function(i){return Q.observe(i,{childList:!0,subtree:!0}),i},He(u),We&&(p.attachShadow=function(){return He(We.apply(this,arguments))})):(X=[],u[b]("DOMNodeInserted",Se(y)),u[b]("DOMNodeRemoved",Se(v))),u[b](Ze,he),u[b]("readystatechange",he),u.importNode=function(i,s){switch(i.nodeType){case 1:return Pe(u,Ht,[i,!!s]);case 11:for(var d=u.createDocumentFragment(),f=i.childNodes,h=f.length,M=0;M<h;M++)d.appendChild(u.importNode(f[M],!!s));return d;default:return Ye.call(i,!!s)}},p.cloneNode=function(i){return Pe(this,Ye,[!!i])}),Ne)return Ne=!1;if(-2<H.call(D,J+n)+H.call(D,q+n)&&Ve(e),!mt.test(n)||-1<H.call(ft,n))throw new Error("The type "+e+" is invalid");var n,r,o=function(){return a?u.createElement(m,n):u.createElement(m)},l=t||be,a=ye.call(l,k),m=a?t[k].toUpperCase():n;return a&&-1<H.call(D,q+m)&&Ve(m),r=D.push((a?J:q)+n)-1,L=L.concat(L.length?",":"",a?m+'[is="'+e.toLowerCase()+'"]':m),o.prototype=B[r]=ye.call(l,"prototype")?l.prototype:we(p),L.length&&fe(u.querySelectorAll(L),y),o},u.createElement=Oe=function(e,t){var n=_e(t),r=n?ie.call(u,e,oe(n)):ie.call(u,e),o=""+e,l=H.call(D,(n?J:q)+(n||o).toUpperCase()),a=-1<l;return n&&(r.setAttribute("is",n=n.toLowerCase()),a&&(a=Ie(o.toUpperCase(),n))),se=!u.createElement.innerHTMLHelper,a&&_(r,B[l]),r}),addEventListener("beforeunload",function(){delete u.createElement,delete u.importNode,delete u[S]},!1),K.prototype={constructor:K,define:Z?function(e,t,n){if(n)Re(e,t,n);else{var r=e.toUpperCase();G[r]={constructor:t,create:[r]},re.set(t,r),w.define(e,t)}}:Re,get:Z?function(e){return w.get(e)||Ue(e)}:Ue,whenDefined:Z?function(e){return $e.race([w.whenDefined(e),Me(e)])}:Me},!w||/^force/.test(E.type))xe();else if(!E.noBuiltIn)try{(function(e,t,n){var r=new RegExp(`^<a\\s+is=('|")`+n+"\\1></a>$");if(t[k]="a",e.prototype=we(Qe.prototype),e.prototype.constructor=e,c.customElements.define(n,e,t),!r.test(u.createElement("a",{is:n}).outerHTML)||!r.test(new e().outerHTML))throw t})(function e(){return Reflect.construct(Qe,[],e)},{},"document-register-element-a"+qe)}catch{xe()}if(!E.noBuiltIn)try{if(ie.call(u,"a","a").outerHTML.indexOf("is")<0)throw{}}catch{oe=function(t){return{is:t.toLowerCase()}}}})(window);Promise.allSettled||(Promise.allSettled=function(c){return Promise.all(c.map(function(E){return Promise.resolve(E).then(function(U){return{status:"fulfilled",value:U}}).catch(function(U){return{status:"rejected",reason:U}})}))}); var YSe=Object.create;var l4=Object.defineProperty,KSe=Object.defineProperties,ZSe=Object.getOwnPropertyDescriptor,XSe=Object.getOwnPropertyDescriptors,QSe=Object.getOwnPropertyNames,s4=Object.getOwnPropertySymbols,cK=Object.getPrototypeOf,P8=Object.prototype.hasOwnProperty,dK=Object.prototype.propertyIsEnumerable,JSe=Reflect.get;var lK=(i,o,n)=>o in i?l4(i,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[o]=n,E=(i,o)=>{for(var n in o||={})P8.call(o,n)&&lK(i,n,o[n]);if(s4)for(var n of s4(o))dK.call(o,n)&&lK(i,n,o[n]);return i},D=(i,o)=>KSe(i,XSe(o));var yy=(i,o)=>{var n={};for(var e in i)P8.call(i,e)&&o.indexOf(e)<0&&(n[e]=i[e]);if(i!=null&&s4)for(var e of s4(i))o.indexOf(e)<0&&dK.call(i,e)&&(n[e]=i[e]);return n};var ebe=(i,o)=>()=>(o||i((o={exports:{}}).exports,o),o.exports),c4=(i,o)=>{for(var n in o)l4(i,n,{get:o[n],enumerable:!0})},tbe=(i,o,n,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of QSe(o))!P8.call(i,t)&&t!==n&&l4(i,t,{get:()=>o[t],enumerable:!(e=ZSe(o,t))||e.enumerable});return i};var mK=(i,o,n)=>(n=i!=null?YSe(cK(i)):{},tbe(o||!i||!i.__esModule?l4(n,"default",{value:i,enumerable:!0}):n,i));var jp=(i,o,n)=>JSe(cK(i),n,o);var Q=(i,o,n)=>new Promise((e,t)=>{var r=c=>{try{s(n.next(c))}catch(p){t(p)}},a=c=>{try{s(n.throw(c))}catch(p){t(p)}},s=c=>c.done?e(c.value):Promise.resolve(c.value).then(r,a);s((n=n.apply(i,o)).next())});var wY=ebe((UOo,DY)=>{"use strict";var Ot={};Ot.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)};Ot.localCName=Ot.generateIdentifier();Ot.splitLines=function(i){return i.trim().split(` `).map(o=>o.trim())};Ot.splitSections=function(i){return i.split(` m=`).map((n,e)=>(e>0?"m="+n:n).trim()+`\r `)};Ot.getDescription=function(i){let o=Ot.splitSections(i);return o&&o[0]};Ot.getMediaSections=function(i){let o=Ot.splitSections(i);return o.shift(),o};Ot.matchPrefix=function(i,o){return Ot.splitLines(i).filter(n=>n.indexOf(o)===0)};Ot.parseCandidate=function(i){let o;i.indexOf("a=candidate:")===0?o=i.substring(12).split(" "):o=i.substring(10).split(" ");let n={foundation:o[0],component:{1:"rtp",2:"rtcp"}[o[1]]||o[1],protocol:o[2].toLowerCase(),priority:parseInt(o[3],10),ip:o[4],address:o[4],port:parseInt(o[5],10),type:o[7]};for(let e=8;e<o.length;e+=2)switch(o[e]){case"raddr":n.relatedAddress=o[e+1];break;case"rport":n.relatedPort=parseInt(o[e+1],10);break;case"tcptype":n.tcpType=o[e+1];break;case"ufrag":n.ufrag=o[e+1],n.usernameFragment=o[e+1];break;default:n[o[e]]===void 0&&(n[o[e]]=o[e+1]);break}return n};Ot.writeCandidate=function(i){let o=[];o.push(i.foundation);let n=i.component;n==="rtp"?o.push(1):n==="rtcp"?o.push(2):o.push(n),o.push(i.protocol.toUpperCase()),o.push(i.priority),o.push(i.address||i.ip),o.push(i.port);let e=i.type;return o.push("typ"),o.push(e),e!=="host"&&i.relatedAddress&&i.relatedPort&&(o.push("raddr"),o.push(i.relatedAddress),o.push("rport"),o.push(i.relatedPort)),i.tcpType&&i.protocol.toLowerCase()==="tcp"&&(o.push("tcptype"),o.push(i.tcpType)),(i.usernameFragment||i.ufrag)&&(o.push("ufrag"),o.push(i.usernameFragment||i.ufrag)),"candidate:"+o.join(" ")};Ot.parseIceOptions=function(i){return i.substring(14).split(" ")};Ot.parseRtpMap=function(i){let o=i.substring(9).split(" "),n={payloadType:parseInt(o.shift(),10)};return o=o[0].split("/"),n.name=o[0],n.clockRate=parseInt(o[1],10),n.channels=o.length===3?parseInt(o[2],10):1,n.numChannels=n.channels,n};Ot.writeRtpMap=function(i){let o=i.payloadType;i.preferredPayloadType!==void 0&&(o=i.preferredPayloadType);let n=i.channels||i.numChannels||1;return"a=rtpmap:"+o+" "+i.name+"/"+i.clockRate+(n!==1?"/"+n:"")+`\r `};Ot.parseExtmap=function(i){let o=i.substring(9).split(" ");return{id:parseInt(o[0],10),direction:o[0].indexOf("/")>0?o[0].split("/")[1]:"sendrecv",uri:o[1],attributes:o.slice(2).join(" ")}};Ot.writeExtmap=function(i){return"a=extmap:"+(i.id||i.preferredId)+(i.direction&&i.direction!=="sendrecv"?"/"+i.direction:"")+" "+i.uri+(i.attributes?" "+i.attributes:"")+`\r `};Ot.parseFmtp=function(i){let o={},n,e=i.substring(i.indexOf(" ")+1).split(";");for(let t=0;t<e.length;t++)n=e[t].trim().split("="),o[n[0].trim()]=n[1];return o};Ot.writeFmtp=function(i){let o="",n=i.payloadType;if(i.preferredPayloadType!==void 0&&(n=i.preferredPayloadType),i.parameters&&Object.keys(i.parameters).length){let e=[];Object.keys(i.parameters).forEach(t=>{i.parameters[t]!==void 0?e.push(t+"="+i.parameters[t]):e.push(t)}),o+="a=fmtp:"+n+" "+e.join(";")+`\r `}return o};Ot.parseRtcpFb=function(i){let o=i.substring(i.indexOf(" ")+1).split(" ");return{type:o.shift(),parameter:o.join(" ")}};Ot.writeRtcpFb=function(i){let o="",n=i.payloadType;return i.preferredPayloadType!==void 0&&(n=i.preferredPayloadType),i.rtcpFeedback&&i.rtcpFeedback.length&&i.rtcpFeedback.forEach(e=>{o+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+`\r `}),o};Ot.parseSsrcMedia=function(i){let o=i.indexOf(" "),n={ssrc:parseInt(i.substring(7,o),10)},e=i.indexOf(":",o);return e>-1?(n.attribute=i.substring(o+1,e),n.value=i.substring(e+1)):n.attribute=i.substring(o+1),n};Ot.parseSsrcGroup=function(i){let o=i.substring(13).split(" ");return{semantics:o.shift(),ssrcs:o.map(n=>parseInt(n,10))}};Ot.getMid=function(i){let o=Ot.matchPrefix(i,"a=mid:")[0];if(o)return o.substring(6)};Ot.parseFingerprint=function(i){let o=i.substring(14).split(" ");return{algorithm:o[0].toLowerCase(),value:o[1].toUpperCase()}};Ot.getDtlsParameters=function(i,o){return{role:"auto",fingerprints:Ot.matchPrefix(i+o,"a=fingerprint:").map(Ot.parseFingerprint)}};Ot.writeDtlsParameters=function(i,o){let n="a=setup:"+o+`\r `;return i.fingerprints.forEach(e=>{n+="a=fingerprint:"+e.algorithm+" "+e.value+`\r `}),n};Ot.parseCryptoLine=function(i){let o=i.substring(9).split(" ");return{tag:parseInt(o[0],10),cryptoSuite:o[1],keyParams:o[2],sessionParams:o.slice(3)}};Ot.writeCryptoLine=function(i){return"a=crypto:"+i.tag+" "+i.cryptoSuite+" "+(typeof i.keyParams=="object"?Ot.writeCryptoKeyParams(i.keyParams):i.keyParams)+(i.sessionParams?" "+i.sessionParams.join(" "):"")+`\r `};Ot.parseCryptoKeyParams=function(i){if(i.indexOf("inline:")!==0)return null;let o=i.substring(7).split("|");return{keyMethod:"inline",keySalt:o[0],lifeTime:o[1],mkiValue:o[2]?o[2].split(":")[0]:void 0,mkiLength:o[2]?o[2].split(":")[1]:void 0}};Ot.writeCryptoKeyParams=function(i){return i.keyMethod+":"+i.keySalt+(i.lifeTime?"|"+i.lifeTime:"")+(i.mkiValue&&i.mkiLength?"|"+i.mkiValue+":"+i.mkiLength:"")};Ot.getCryptoParameters=function(i,o){return Ot.matchPrefix(i+o,"a=crypto:").map(Ot.parseCryptoLine)};Ot.getIceParameters=function(i,o){let n=Ot.matchPrefix(i+o,"a=ice-ufrag:")[0],e=Ot.matchPrefix(i+o,"a=ice-pwd:")[0];return n&&e?{usernameFragment:n.substring(12),password:e.substring(10)}:null};Ot.writeIceParameters=function(i){let o="a=ice-ufrag:"+i.usernameFragment+`\r a=ice-pwd:`+i.password+`\r `;return i.iceLite&&(o+=`a=ice-lite\r `),o};Ot.parseRtpParameters=function(i){let o={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},e=Ot.splitLines(i)[0].split(" ");o.profile=e[2];for(let r=3;r<e.length;r++){let a=e[r],s=Ot.matchPrefix(i,"a=rtpmap:"+a+" ")[0];if(s){let c=Ot.parseRtpMap(s),p=Ot.matchPrefix(i,"a=fmtp:"+a+" ");switch(c.parameters=p.length?Ot.parseFmtp(p[0]):{},c.rtcpFeedback=Ot.matchPrefix(i,"a=rtcp-fb:"+a+" ").map(Ot.parseRtcpFb),o.codecs.push(c),c.name.toUpperCase()){case"RED":case"ULPFEC":o.fecMechanisms.push(c.name.toUpperCase());break;default:break}}}Ot.matchPrefix(i,"a=extmap:").forEach(r=>{o.headerExtensions.push(Ot.parseExtmap(r))});let t=Ot.matchPrefix(i,"a=rtcp-fb:* ").map(Ot.parseRtcpFb);return o.codecs.forEach(r=>{t.forEach(a=>{r.rtcpFeedback.find(c=>c.type===a.type&&c.parameter===a.parameter)||r.rtcpFeedback.push(a)})}),o};Ot.writeRtpDescription=function(i,o){let n="";n+="m="+i+" ",n+=o.codecs.length>0?"9":"0",n+=" "+(o.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=o.codecs.map(t=>t.preferredPayloadType!==void 0?t.preferredPayloadType:t.payloadType).join(" ")+`\r `,n+=`c=IN IP4 0.0.0.0\r `,n+=`a=rtcp:9 IN IP4 0.0.0.0\r `,o.codecs.forEach(t=>{n+=Ot.writeRtpMap(t),n+=Ot.writeFmtp(t),n+=Ot.writeRtcpFb(t)});let e=0;return o.codecs.forEach(t=>{t.maxptime>e&&(e=t.maxptime)}),e>0&&(n+="a=maxptime:"+e+`\r `),o.headerExtensions&&o.headerExtensions.forEach(t=>{n+=Ot.writeExtmap(t)}),n};Ot.parseRtpEncodingParameters=function(i){let o=[],n=Ot.parseRtpParameters(i),e=n.fecMechanisms.indexOf("RED")!==-1,t=n.fecMechanisms.indexOf("ULPFEC")!==-1,r=Ot.matchPrefix(i,"a=ssrc:").map(g=>Ot.parseSsrcMedia(g)).filter(g=>g.attribute==="cname"),a=r.length>0&&r[0].ssrc,s,c=Ot.matchPrefix(i,"a=ssrc-group:FID").map(g=>g.substring(17).split(" ").map(I=>parseInt(I,10)));c.length>0&&c[0].length>1&&c[0][0]===a&&(s=c[0][1]),n.codecs.forEach(g=>{if(g.name.toUpperCase()==="RTX"&&g.parameters.apt){let f={ssrc:a,codecPayloadType:parseInt(g.parameters.apt,10)};a&&s&&(f.rtx={ssrc:s}),o.push(f),e&&(f=JSON.parse(JSON.stringify(f)),f.fec={ssrc:a,mechanism:t?"red+ulpfec":"red"},o.push(f))}}),o.length===0&&a&&o.push({ssrc:a});let p=Ot.matchPrefix(i,"b=");return p.length&&(p[0].indexOf("b=TIAS:")===0?p=parseInt(p[0].substring(7),10):p[0].indexOf("b=AS:")===0?p=parseInt(p[0].substring(5),10)*1e3*.95-2e3*8:p=void 0,o.forEach(g=>{g.maxBitrate=p})),o};Ot.parseRtcpParameters=function(i){let o={},n=Ot.matchPrefix(i,"a=ssrc:").map(r=>Ot.parseSsrcMedia(r)).filter(r=>r.attribute==="cname")[0];n&&(o.cname=n.value,o.ssrc=n.ssrc);let e=Ot.matchPrefix(i,"a=rtcp-rsize");o.reducedSize=e.length>0,o.compound=e.length===0;let t=Ot.matchPrefix(i,"a=rtcp-mux");return o.mux=t.length>0,o};Ot.writeRtcpParameters=function(i){let o="";return i.reducedSize&&(o+=`a=rtcp-rsize\r `),i.mux&&(o+=`a=rtcp-mux\r `),i.ssrc!==void 0&&i.cname&&(o+="a=ssrc:"+i.ssrc+" cname:"+i.cname+`\r `),o};Ot.parseMsid=function(i){let o,n=Ot.matchPrefix(i,"a=msid:");if(n.length===1)return o=n[0].substring(7).split(" "),{stream:o[0],track:o[1]};let e=Ot.matchPrefix(i,"a=ssrc:").map(t=>Ot.parseSsrcMedia(t)).filter(t=>t.attribute==="msid");if(e.length>0)return o=e[0].value.split(" "),{stream:o[0],track:o[1]}};Ot.parseSctpDescription=function(i){let o=Ot.parseMLine(i),n=Ot.matchPrefix(i,"a=max-message-size:"),e;n.length>0&&(e=parseInt(n[0].substring(19),10)),isNaN(e)&&(e=65536);let t=Ot.matchPrefix(i,"a=sctp-port:");if(t.length>0)return{port:parseInt(t[0].substring(12),10),protocol:o.fmt,maxMessageSize:e};let r=Ot.matchPrefix(i,"a=sctpmap:");if(r.length>0){let a=r[0].substring(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:e}}};Ot.writeSctpDescription=function(i,o){let n=[];return i.protocol!=="DTLS/SCTP"?n=["m="+i.kind+" 9 "+i.protocol+" "+o.protocol+`\r `,`c=IN IP4 0.0.0.0\r `,"a=sctp-port:"+o.port+`\r `]:n=["m="+i.kind+" 9 "+i.protocol+" "+o.port+`\r `,`c=IN IP4 0.0.0.0\r `,"a=sctpmap:"+o.port+" "+o.protocol+` 65535\r `],o.maxMessageSize!==void 0&&n.push("a=max-message-size:"+o.maxMessageSize+`\r `),n.join("")};Ot.generateSessionId=function(){return Math.random().toString().substr(2,22)};Ot.writeSessionBoilerplate=function(i,o,n){let e,t=o!==void 0?o:2;return i?e=i:e=Ot.generateSessionId(),`v=0\r o=`+(n||"thisisadapterortc")+" "+e+" "+t+` IN IP4 127.0.0.1\r s=-\r t=0 0\r `};Ot.getDirection=function(i,o){let n=Ot.splitLines(i);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substring(2);default:}return o?Ot.getDirection(o):"sendrecv"};Ot.getKind=function(i){return Ot.splitLines(i)[0].split(" ")[0].substring(2)};Ot.isRejected=function(i){return i.split(" ",2)[1]==="0"};Ot.parseMLine=function(i){let n=Ot.splitLines(i)[0].substring(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}};Ot.parseOLine=function(i){let n=Ot.matchPrefix(i,"o=")[0].substring(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}};Ot.isValidSDP=function(i){if(typeof i!="string"||i.length===0)return!1;let o=Ot.splitLines(i);for(let n=0;n<o.length;n++)if(o[n].length<2||o[n].charAt(1)!=="=")return!1;return!0};typeof DY=="object"&&(DY.exports=Ot)});var M8;function d4(){return M8}function Md(i){let o=M8;return M8=i,o}var pK=Symbol("NotFound");function Zf(i){return i===pK||i?.name==="\u0275NotFound"}var za=null,m4=!1,k8=1,nbe=null,Ls=Symbol("SIGNAL");function kn(i){let o=za;return za=i,o}function h4(){return za}var ju={version:0,lastCleanEpoch:0,dirty:!1,producers:void 0,producersTail:void 0,consumers:void 0,consumersTail:void 0,recomputing:!1,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function f4(i){if(m4)throw new Error("");if(za===null)return;za.consumerOnSignalRead(i);let o=za.producersTail;if(o!==void 0&&o.producer===i)return;let n,e=za.recomputing;if(e&&(n=o!==void 0?o.nextProducer:za.producers,n!==void 0&&n.producer===i)){za.producersTail=n,n.lastReadVersion=i.version;return}let t=i.consumersTail;if(t!==void 0&&t.consumer===za&&(!e||obe(t,za)))return;let r=Jf(za),a={producer:i,consumer:za,nextProducer:n,prevConsumer:t,lastReadVersion:i.version,nextConsumer:void 0};za.producersTail=a,o!==void 0?o.nextProducer=a:za.producers=a,r&&fK(i,a)}function gK(){k8++}function v4(i){if(!(Jf(i)&&!i.dirty)&&!(!i.dirty&&i.lastCleanEpoch===k8)){if(!i.producerMustRecompute(i)&&!Iy(i)){u4(i);return}i.producerRecomputeValue(i),u4(i)}}function R8(i){if(i.consumers===void 0)return;let o=m4;m4=!0;try{for(let n=i.consumers;n!==void 0;n=n.nextConsumer){let e=n.consumer;e.dirty||ibe(e)}}finally{m4=o}}function N8(){return za?.consumerAllowSignalWrites!==!1}function ibe(i){i.dirty=!0,R8(i),i.consumerMarkedDirty?.(i)}function u4(i){i.dirty=!1,i.lastCleanEpoch=k8}function Xf(i){return i&&uK(i),kn(i)}function uK(i){i.producersTail=void 0,i.recomputing=!0}function by(i,o){kn(o),i&&hK(i)}function hK(i){i.recomputing=!1;let o=i.producersTail,n=o!==void 0?o.nextProducer:i.producers;if(n!==void 0){if(Jf(i))do n=F8(n);while(n!==void 0);o!==void 0?o.nextProducer=void 0:i.producers=void 0}}function Iy(i){for(let o=i.producers;o!==void 0;o=o.nextProducer){let n=o.producer,e=o.lastReadVersion;if(e!==n.version||(v4(n),e!==n.version))return!0}return!1}function Qf(i){if(Jf(i)){let o=i.producers;for(;o!==void 0;)o=F8(o)}i.producers=void 0,i.producersTail=void 0,i.consumers=void 0,i.consumersTail=void 0}function fK(i,o){let n=i.consumersTail,e=Jf(i);if(n!==void 0?(o.nextConsumer=n.nextConsumer,n.nextConsumer=o):(o.nextConsumer=void 0,i.consumers=o),o.prevConsumer=n,i.consumersTail=o,!e)for(let t=i.producers;t!==void 0;t=t.nextProducer)fK(t.producer,t)}function F8(i){let o=i.producer,n=i.nextProducer,e=i.nextConsumer,t=i.prevConsumer;if(i.nextConsumer=void 0,i.prevConsumer=void 0,e!==void 0?e.prevConsumer=t:o.consumersTail=t,t!==void 0)t.nextConsumer=e;else if(o.consumers=e,!Jf(o)){let r=o.producers;for(;r!==void 0;)r=F8(r)}return n}function Jf(i){return i.consumerIsAlwaysLive||i.consumers!==void 0}function C4(i){nbe?.(i)}function obe(i,o){let n=o.producersTail;if(n!==void 0){let e=o.producers;do{if(e===i)return!0;if(e===n)break;e=e.nextProducer}while(e!==void 0)}return!1}function _4(i,o){return Object.is(i,o)}function y4(i,o){let n=Object.create(rbe);n.computation=i,o!==void 0&&(n.equal=o);let e=()=>{if(v4(n),f4(n),n.value===Sy)throw n.error;return n.value};return e[Ls]=n,C4(n),e}var p4=Symbol("UNSET"),g4=Symbol("COMPUTING"),Sy=Symbol("ERRORED"),rbe=D(E({},ju),{value:p4,dirty:!0,error:null,equal:_4,kind:"computed",producerMustRecompute(i){return i.value===p4||i.value===g4},producerRecomputeValue(i){if(i.value===g4)throw new Error("");let o=i.value;i.value=g4;let n=Xf(i),e,t=!1;try{e=i.computation(),kn(null),t=o!==p4&&o!==Sy&&e!==Sy&&i.equal(o,e)}catch(r){e=Sy,i.error=r}finally{by(i,n)}if(t){i.value=o;return}i.value=e,i.version++}});function abe(){throw new Error}var vK=abe;function CK(i){vK(i)}function L8(i){vK=i}var sbe=null;function B8(i,o){let n=Object.create(yK);n.value=i,o!==void 0&&(n.equal=o);let e=()=>_K(n);return e[Ls]=n,C4(n),[e,a=>S4(n,a),a=>V8(n,a)]}function _K(i){return f4(i),i.value}function S4(i,o){N8()||CK(i),i.equal(i.value,o)||(i.value=o,lbe(i))}function V8(i,o){N8()||CK(i),S4(i,o(i.value))}var yK=D(E({},ju),{equal:_4,value:void 0,kind:"signal"});function lbe(i){i.version++,gK(),R8(i),sbe?.(i)}function Tn(i){return typeof i=="function"}function $p(i){let n=i(e=>{Error.call(e),e.stack=new Error().stack});return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var b4=$p(i=>function(n){i(this),this.message=n?`${n.length} errors occurred during unsubscription: ${n.map((e,t)=>`${t+1}) ${e.toString()}`).join(` `)}`:"",this.name="UnsubscriptionError",this.errors=n});function $u(i,o){if(i){let n=i.indexOf(o);0<=n&&i.splice(n,1)}}var Dn=class i{constructor(o){this.initialTeardown=o,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let o;if(!this.closed){this.closed=!0;let{_parentage:n}=this;if(n)if(this._parentage=null,Array.isArray(n))for(let r of n)r.remove(this);else n.remove(this);let{initialTeardown:e}=this;if(Tn(e))try{e()}catch(r){o=r instanceof b4?r.errors:[r]}let{_finalizers:t}=this;if(t){this._finalizers=null;for(let r of t)try{SK(r)}catch(a){o=o??[],a instanceof b4?o=[...o,...a.errors]:o.push(a)}}if(o)throw new b4(o)}}add(o){var n;if(o&&o!==this)if(this.closed)SK(o);else{if(o instanceof i){if(o.closed||o._hasParent(this))return;o._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(o)}}_hasParent(o){let{_parentage:n}=this;return n===o||Array.isArray(n)&&n.includes(o)}_addParent(o){let{_parentage:n}=this;this._parentage=Array.isArray(n)?(n.push(o),n):n?[n,o]:o}_removeParent(o){let{_parentage:n}=this;n===o?this._parentage=null:Array.isArray(n)&&$u(n,o)}remove(o){let{_finalizers:n}=this;n&&$u(n,o),o instanceof i&&o._removeParent(this)}};Dn.EMPTY=(()=>{let i=new Dn;return i.closed=!0,i})();var U8=Dn.EMPTY;function I4(i){return i instanceof Dn||i&&"closed"in i&&Tn(i.remove)&&Tn(i.add)&&Tn(i.unsubscribe)}function SK(i){Tn(i)?i():i.unsubscribe()}var Ac={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var ev={setTimeout(i,o,...n){let{delegate:e}=ev;return e?.setTimeout?e.setTimeout(i,o,...n):setTimeout(i,o,...n)},clearTimeout(i){let{delegate:o}=ev;return(o?.clearTimeout||clearTimeout)(i)},delegate:void 0};function E4(i){ev.setTimeout(()=>{let{onUnhandledError:o}=Ac;if(o)o(i);else throw i})}function Hu(){}var bK=j8("C",void 0,void 0);function IK(i){return j8("E",void 0,i)}function EK(i){return j8("N",i,void 0)}function j8(i,o,n){return{kind:i,value:o,error:n}}var zu=null;function tv(i){if(Ac.useDeprecatedSynchronousErrorHandling){let o=!zu;if(o&&(zu={errorThrown:!1,error:null}),i(),o){let{errorThrown:n,error:e}=zu;if(zu=null,n)throw e}}else i()}function xK(i){Ac.useDeprecatedSynchronousErrorHandling&&zu&&(zu.errorThrown=!0,zu.error=i)}var Gu=class extends Dn{constructor(o){super(),this.isStopped=!1,o?(this.destination=o,I4(o)&&o.add(this)):this.destination=mbe}static create(o,n,e){return new Pc(o,n,e)}next(o){this.isStopped?H8(EK(o),this):this._next(o)}error(o){this.isStopped?H8(IK(o),this):(this.isStopped=!0,this._error(o))}complete(){this.isStopped?H8(bK,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(o){this.destination.next(o)}_error(o){try{this.destination.error(o)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},cbe=Function.prototype.bind;function $8(i,o){return cbe.call(i,o)}var z8=class{constructor(o){this.partialObserver=o}next(o){let{partialObserver:n}=this;if(n.next)try{n.next(o)}catch(e){x4(e)}}error(o){let{partialObserver:n}=this;if(n.error)try{n.error(o)}catch(e){x4(e)}else x4(o)}complete(){let{partialObserver:o}=this;if(o.complete)try{o.complete()}catch(n){x4(n)}}},Pc=class extends Gu{constructor(o,n,e){super();let t;if(Tn(o)||!o)t={next:o??void 0,error:n??void 0,complete:e??void 0};else{let r;this&&Ac.useDeprecatedNextContext?(r=Object.create(o),r.unsubscribe=()=>this.unsubscribe(),t={next:o.next&&$8(o.next,r),error:o.error&&$8(o.error,r),complete:o.complete&&$8(o.complete,r)}):t=o}this.destination=new z8(t)}};function x4(i){Ac.useDeprecatedSynchronousErrorHandling?xK(i):E4(i)}function dbe(i){throw i}function H8(i,o){let{onStoppedNotification:n}=Ac;n&&ev.setTimeout(()=>n(i,o))}var mbe={closed:!0,next:Hu,error:dbe,complete:Hu};var nv=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Mc(i){return i}function TK(i){return i.length===0?Mc:i.length===1?i[0]:function(n){return i.reduce((e,t)=>t(e),n)}}var $t=(()=>{class i{constructor(n){n&&(this._subscribe=n)}lift(n){let e=new i;return e.source=this,e.operator=n,e}subscribe(n,e,t){let r=gbe(n)?n:new Pc(n,e,t);return tv(()=>{let{operator:a,source:s}=this;r.add(a?a.call(r,s):s?this._subscribe(r):this._trySubscribe(r))}),r}_trySubscribe(n){try{return this._subscribe(n)}catch(e){n.error(e)}}forEach(n,e){return e=DK(e),new e((t,r)=>{let a=new Pc({next:s=>{try{n(s)}catch(c){r(c),a.unsubscribe()}},error:r,complete:t});this.subscribe(a)})}_subscribe(n){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(n)}[nv](){return this}pipe(...n){return TK(n)(this)}toPromise(n){return n=DK(n),new n((e,t)=>{let r;this.subscribe(a=>r=a,a=>t(a),()=>e(r))})}}return i.create=o=>new i(o),i})();function DK(i){var o;return(o=i??Ac.Promise)!==null&&o!==void 0?o:Promise}function pbe(i){return i&&Tn(i.next)&&Tn(i.error)&&Tn(i.complete)}function gbe(i){return i&&i instanceof Gu||pbe(i)&&I4(i)}function G8(i){return Tn(i?.lift)}function Vn(i){return o=>{if(G8(o))return o.lift(function(n){try{return i(n,this)}catch(e){this.error(e)}});throw new TypeError("Unable to lift unknown Observable type")}}function On(i,o,n,e,t){return new W8(i,o,n,e,t)}var W8=class extends Gu{constructor(o,n,e,t,r,a){super(o),this.onFinalize=r,this.shouldUnsubscribe=a,this._next=n?function(s){try{n(s)}catch(c){o.error(c)}}:super._next,this._error=t?function(s){try{t(s)}catch(c){o.error(c)}finally{this.unsubscribe()}}:super._error,this._complete=e?function(){try{e()}catch(s){o.error(s)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var o;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:n}=this;super.unsubscribe(),!n&&((o=this.onFinalize)===null||o===void 0||o.call(this))}}};function wK(){return Vn((i,o)=>{let n=null;i._refCount++;let e=On(o,void 0,void 0,void 0,()=>{if(!i||i._refCount<=0||0<--i._refCount){n=null;return}let t=i._connection,r=n;n=null,t&&(!r||t===r)&&t.unsubscribe(),o.unsubscribe()});i.subscribe(e),e.closed||(n=i.connect())})}var Ey=class extends $t{constructor(o,n){super(),this.source=o,this.subjectFactory=n,this._subject=null,this._refCount=0,this._connection=null,G8(o)&&(this.lift=o.lift)}_subscribe(o){return this.getSubject().subscribe(o)}getSubject(){let o=this._subject;return(!o||o.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;let{_connection:o}=this;this._subject=this._connection=null,o?.unsubscribe()}connect(){let o=this._connection;if(!o){o=this._connection=new Dn;let n=this.getSubject();o.add(this.source.subscribe(On(n,void 0,()=>{this._teardown(),n.complete()},e=>{this._teardown(),n.error(e)},()=>this._teardown()))),o.closed&&(this._connection=null,o=Dn.EMPTY)}return o}refCount(){return wK()(this)}};var iv={schedule(i){let o=requestAnimationFrame,n=cancelAnimationFrame,{delegate:e}=iv;e&&(o=e.requestAnimationFrame,n=e.cancelAnimationFrame);let t=o(r=>{n=void 0,i(r)});return new Dn(()=>n?.(t))},requestAnimationFrame(...i){let{delegate:o}=iv;return(o?.requestAnimationFrame||requestAnimationFrame)(...i)},cancelAnimationFrame(...i){let{delegate:o}=iv;return(o?.cancelAnimationFrame||cancelAnimationFrame)(...i)},delegate:void 0};var OK=$p(i=>function(){i(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Xe=(()=>{class i extends $t{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(n){let e=new T4(this,this);return e.operator=n,e}_throwIfClosed(){if(this.closed)throw new OK}next(n){tv(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let e of this.currentObservers)e.next(n)}})}error(n){tv(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=n;let{observers:e}=this;for(;e.length;)e.shift().error(n)}})}complete(){tv(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:n}=this;for(;n.length;)n.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0}_trySubscribe(n){return this._throwIfClosed(),super._trySubscribe(n)}_subscribe(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)}_innerSubscribe(n){let{hasError:e,isStopped:t,observers:r}=this;return e||t?U8:(this.currentObservers=null,r.push(n),new Dn(()=>{this.currentObservers=null,$u(r,n)}))}_checkFinalizedStatuses(n){let{hasError:e,thrownError:t,isStopped:r}=this;e?n.error(t):r&&n.complete()}asObservable(){let n=new $t;return n.source=this,n}}return i.create=(o,n)=>new T4(o,n),i})(),T4=class extends Xe{constructor(o,n){super(),this.destination=o,this.source=n}next(o){var n,e;(e=(n=this.destination)===null||n===void 0?void 0:n.next)===null||e===void 0||e.call(n,o)}error(o){var n,e;(e=(n=this.destination)===null||n===void 0?void 0:n.error)===null||e===void 0||e.call(n,o)}complete(){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.complete)===null||n===void 0||n.call(o)}_subscribe(o){var n,e;return(e=(n=this.source)===null||n===void 0?void 0:n.subscribe(o))!==null&&e!==void 0?e:U8}};var Ce=class extends Xe{constructor(o){super(),this._value=o}get value(){return this.getValue()}_subscribe(o){let n=super._subscribe(o);return!n.closed&&o.next(this._value),n}getValue(){let{hasError:o,thrownError:n,_value:e}=this;if(o)throw n;return this._throwIfClosed(),e}next(o){super.next(this._value=o)}};var Wu={now(){return(Wu.delegate||Date).now()},delegate:void 0};var Hp=class extends Xe{constructor(o=1/0,n=1/0,e=Wu){super(),this._bufferSize=o,this._windowTime=n,this._timestampProvider=e,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=n===1/0,this._bufferSize=Math.max(1,o),this._windowTime=Math.max(1,n)}next(o){let{isStopped:n,_buffer:e,_infiniteTimeWindow:t,_timestampProvider:r,_windowTime:a}=this;n||(e.push(o),!t&&e.push(r.now()+a)),this._trimBuffer(),super.next(o)}_subscribe(o){this._throwIfClosed(),this._trimBuffer();let n=this._innerSubscribe(o),{_infiniteTimeWindow:e,_buffer:t}=this,r=t.slice();for(let a=0;a<r.length&&!o.closed;a+=e?1:2)o.next(r[a]);return this._checkFinalizedStatuses(o),n}_trimBuffer(){let{_bufferSize:o,_timestampProvider:n,_buffer:e,_infiniteTimeWindow:t}=this,r=(t?1:2)*o;if(o<1/0&&r<e.length&&e.splice(0,e.length-r),!t){let a=n.now(),s=0;for(let c=1;c<e.length&&e[c]<=a;c+=2)s=c;s&&e.splice(0,s+1)}}};var D4=class extends Dn{constructor(o,n){super()}schedule(o,n=0){return this}};var xy={setInterval(i,o,...n){let{delegate:e}=xy;return e?.setInterval?e.setInterval(i,o,...n):setInterval(i,o,...n)},clearInterval(i){let{delegate:o}=xy;return(o?.clearInterval||clearInterval)(i)},delegate:void 0};var kd=class extends D4{constructor(o,n){super(o,n),this.scheduler=o,this.work=n,this.pending=!1}schedule(o,n=0){var e;if(this.closed)return this;this.state=o;let t=this.id,r=this.scheduler;return t!=null&&(this.id=this.recycleAsyncId(r,t,n)),this.pending=!0,this.delay=n,this.id=(e=this.id)!==null&&e!==void 0?e:this.requestAsyncId(r,this.id,n),this}requestAsyncId(o,n,e=0){return xy.setInterval(o.flush.bind(o,this),e)}recycleAsyncId(o,n,e=0){if(e!=null&&this.delay===e&&this.pending===!1)return n;n!=null&&xy.clearInterval(n)}execute(o,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let e=this._execute(o,n);if(e)return e;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(o,n){let e=!1,t;try{this.work(o)}catch(r){e=!0,t=r||new Error("Scheduled action threw falsy error")}if(e)return this.unsubscribe(),t}unsubscribe(){if(!this.closed){let{id:o,scheduler:n}=this,{actions:e}=n;this.work=this.state=this.scheduler=null,this.pending=!1,$u(e,this),o!=null&&(this.id=this.recycleAsyncId(n,o,null)),this.delay=null,super.unsubscribe()}}};var ube=1,q8,Y8={};function AK(i){return i in Y8?(delete Y8[i],!0):!1}var PK={setImmediate(i){let o=ube++;return Y8[o]=!0,q8||(q8=Promise.resolve()),q8.then(()=>AK(o)&&i()),o},clearImmediate(i){AK(i)}};var{setImmediate:hbe,clearImmediate:fbe}=PK,Ty={setImmediate(...i){let{delegate:o}=Ty;return(o?.setImmediate||hbe)(...i)},clearImmediate(i){let{delegate:o}=Ty;return(o?.clearImmediate||fbe)(i)},delegate:void 0};var w4=class extends kd{constructor(o,n){super(o,n),this.scheduler=o,this.work=n}requestAsyncId(o,n,e=0){return e!==null&&e>0?super.requestAsyncId(o,n,e):(o.actions.push(this),o._scheduled||(o._scheduled=Ty.setImmediate(o.flush.bind(o,void 0))))}recycleAsyncId(o,n,e=0){var t;if(e!=null?e>0:this.delay>0)return super.recycleAsyncId(o,n,e);let{actions:r}=o;n!=null&&((t=r[r.length-1])===null||t===void 0?void 0:t.id)!==n&&(Ty.clearImmediate(n),o._scheduled===n&&(o._scheduled=void 0))}};var ov=class i{constructor(o,n=i.now){this.schedulerActionCtor=o,this.now=n}schedule(o,n=0,e){return new this.schedulerActionCtor(this,o).schedule(e,n)}};ov.now=Wu.now;var Rd=class extends ov{constructor(o,n=ov.now){super(o,n),this.actions=[],this._active=!1}flush(o){let{actions:n}=this;if(this._active){n.push(o);return}let e;this._active=!0;do if(e=o.execute(o.state,o.delay))break;while(o=n.shift());if(this._active=!1,e){for(;o=n.shift();)o.unsubscribe();throw e}}};var O4=class extends Rd{flush(o){this._active=!0;let n=this._scheduled;this._scheduled=void 0;let{actions:e}=this,t;o=o||e.shift();do if(t=o.execute(o.state,o.delay))break;while((o=e[0])&&o.id===n&&e.shift());if(this._active=!1,t){for(;(o=e[0])&&o.id===n&&e.shift();)o.unsubscribe();throw t}}};var K8=new O4(w4);var Ga=new Rd(kd),Z8=Ga;var A4=class extends kd{constructor(o,n){super(o,n),this.scheduler=o,this.work=n}schedule(o,n=0){return n>0?super.schedule(o,n):(this.delay=n,this.state=o,this.scheduler.flush(this),this)}execute(o,n){return n>0||this.closed?super.execute(o,n):this._execute(o,n)}requestAsyncId(o,n,e=0){return e!=null&&e>0||e==null&&this.delay>0?super.requestAsyncId(o,n,e):(o.flush(this),0)}};var P4=class extends Rd{};var X8=new P4(A4);var M4=class extends kd{constructor(o,n){super(o,n),this.scheduler=o,this.work=n}requestAsyncId(o,n,e=0){return e!==null&&e>0?super.requestAsyncId(o,n,e):(o.actions.push(this),o._scheduled||(o._scheduled=iv.requestAnimationFrame(()=>o.flush(void 0))))}recycleAsyncId(o,n,e=0){var t;if(e!=null?e>0:this.delay>0)return super.recycleAsyncId(o,n,e);let{actions:r}=o;n!=null&&n===o._scheduled&&((t=r[r.length-1])===null||t===void 0?void 0:t.id)!==n&&(iv.cancelAnimationFrame(n),o._scheduled=void 0)}};var k4=class extends Rd{flush(o){this._active=!0;let n;o?n=o.id:(n=this._scheduled,this._scheduled=void 0);let{actions:e}=this,t;o=o||e.shift();do if(t=o.execute(o.state,o.delay))break;while((o=e[0])&&o.id===n&&e.shift());if(this._active=!1,t){for(;(o=e[0])&&o.id===n&&e.shift();)o.unsubscribe();throw t}}};var $m=new k4(M4);var jl=new $t(i=>i.complete());function R4(i){return i&&Tn(i.schedule)}function Q8(i){return i[i.length-1]}function N4(i){return Tn(Q8(i))?i.pop():void 0}function Nd(i){return R4(Q8(i))?i.pop():void 0}function MK(i,o){return typeof Q8(i)=="number"?i.pop():o}function J8(i,o){var n={};for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.indexOf(e)<0&&(n[e]=i[e]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,e=Object.getOwnPropertySymbols(i);t<e.length;t++)o.indexOf(e[t])<0&&Object.prototype.propertyIsEnumerable.call(i,e[t])&&(n[e[t]]=i[e[t]]);return n}function RK(i,o,n,e){function t(r){return r instanceof n?r:new n(function(a){a(r)})}return new(n||(n=Promise))(function(r,a){function s(g){try{p(e.next(g))}catch(f){a(f)}}function c(g){try{p(e.throw(g))}catch(f){a(f)}}function p(g){g.done?r(g.value):t(g.value).then(s,c)}p((e=e.apply(i,o||[])).next())})}function kK(i){var o=typeof Symbol=="function"&&Symbol.iterator,n=o&&i[o],e=0;if(n)return n.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&e>=i.length&&(i=void 0),{value:i&&i[e++],done:!i}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")}function qu(i){return this instanceof qu?(this.v=i,this):new qu(i)}function NK(i,o,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n.apply(i,o||[]),t,r=[];return t=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),t[Symbol.asyncIterator]=function(){return this},t;function a(x){return function(B){return Promise.resolve(B).then(x,f)}}function s(x,B){e[x]&&(t[x]=function(z){return new Promise(function(G,J){r.push([x,z,G,J])>1||c(x,z)})},B&&(t[x]=B(t[x])))}function c(x,B){try{p(e[x](B))}catch(z){I(r[0][3],z)}}function p(x){x.value instanceof qu?Promise.resolve(x.value.v).then(g,f):I(r[0][2],x)}function g(x){c("next",x)}function f(x){c("throw",x)}function I(x,B){x(B),r.shift(),r.length&&c(r[0][0],r[0][1])}}function FK(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i[Symbol.asyncIterator],n;return o?o.call(i):(i=typeof kK=="function"?kK(i):i[Symbol.iterator](),n={},e("next"),e("throw"),e("return"),n[Symbol.asyncIterator]=function(){return this},n);function e(r){n[r]=i[r]&&function(a){return new Promise(function(s,c){a=i[r](a),t(s,c,a.done,a.value)})}}function t(r,a,s,c){Promise.resolve(c).then(function(p){r({value:p,done:s})},a)}}var rv=i=>i&&typeof i.length=="number"&&typeof i!="function";function F4(i){return Tn(i?.then)}function L4(i){return Tn(i[nv])}function B4(i){return Symbol.asyncIterator&&Tn(i?.[Symbol.asyncIterator])}function V4(i){return new TypeError(`You provided ${i!==null&&typeof i=="object"?"an invalid object":`'${i}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function vbe(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var U4=vbe();function j4(i){return Tn(i?.[U4])}function $4(i){return NK(this,arguments,function*(){let n=i.getReader();try{for(;;){let{value:e,done:t}=yield qu(n.read());if(t)return yield qu(void 0);yield yield qu(e)}}finally{n.releaseLock()}})}function H4(i){return Tn(i?.getReader)}function xi(i){if(i instanceof $t)return i;if(i!=null){if(L4(i))return Cbe(i);if(rv(i))return _be(i);if(F4(i))return ybe(i);if(B4(i))return LK(i);if(j4(i))return Sbe(i);if(H4(i))return bbe(i)}throw V4(i)}function Cbe(i){return new $t(o=>{let n=i[nv]();if(Tn(n.subscribe))return n.subscribe(o);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function _be(i){return new $t(o=>{for(let n=0;n<i.length&&!o.closed;n++)o.next(i[n]);o.complete()})}function ybe(i){return new $t(o=>{i.then(n=>{o.closed||(o.next(n),o.complete())},n=>o.error(n)).then(null,E4)})}function Sbe(i){return new $t(o=>{for(let n of i)if(o.next(n),o.closed)return;o.complete()})}function LK(i){return new $t(o=>{Ibe(i,o).catch(n=>o.error(n))})}function bbe(i){return LK($4(i))}function Ibe(i,o){var n,e,t,r;return RK(this,void 0,void 0,function*(){try{for(n=FK(i);e