@livelike/custom-widgets 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -0
- package/dist/livelike.css +1 -0
- package/dist/livelike.js +16409 -0
- package/dist/livelike.umd.cjs +1371 -0
- package/package.json +27 -0
|
@@ -0,0 +1,1371 @@
|
|
|
1
|
+
(function(Je,Tn){typeof exports=="object"&&typeof module<"u"?Tn(exports):typeof define=="function"&&define.amd?define(["exports"],Tn):(Je=typeof globalThis<"u"?globalThis:Je||self,Tn(Je.LiveLike={}))})(this,(function(Je){"use strict";const Tn=globalThis,al=Tn.ShadowRoot&&(Tn.ShadyCSS===void 0||Tn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Iu=Symbol(),ku=new WeakMap;let mf=class{constructor(t,n,r){if(this._$cssResult$=!0,r!==Iu)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}get styleSheet(){let t=this.o;const n=this.t;if(al&&t===void 0){const r=n!==void 0&&n.length===1;r&&(t=ku.get(n)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&ku.set(n,t))}return t}toString(){return this.cssText}};const gf=e=>new mf(typeof e=="string"?e:e+"",void 0,Iu),ff=(e,t)=>{if(al)e.adoptedStyleSheets=t.map((n=>n instanceof CSSStyleSheet?n:n.styleSheet));else for(const n of t){const r=document.createElement("style"),o=Tn.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=n.cssText,e.appendChild(r)}},Eu=al?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let n="";for(const r of t.cssRules)n+=r.cssText;return gf(n)})(e):e;const{is:yf,defineProperty:vf,getOwnPropertyDescriptor:bf,getOwnPropertyNames:_f,getOwnPropertySymbols:wf,getPrototypeOf:Cf}=Object,ys=globalThis,Su=ys.trustedTypes,If=Su?Su.emptyScript:"",kf=ys.reactiveElementPolyfillSupport,Qr=(e,t)=>e,vs={toAttribute(e,t){switch(t){case Boolean:e=e?If:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},ll=(e,t)=>!yf(e,t),Pu={attribute:!0,type:String,converter:vs,reflect:!1,useDefault:!1,hasChanged:ll};Symbol.metadata??=Symbol("metadata"),ys.litPropertyMetadata??=new WeakMap;let Yi=class 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,n=Pu){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(t,n),!n.noAccessor){const r=Symbol(),o=this.getPropertyDescriptor(t,r,n);o!==void 0&&vf(this.prototype,t,o)}}static getPropertyDescriptor(t,n,r){const{get:o,set:c}=bf(this.prototype,t)??{get(){return this[n]},set(l){this[n]=l}};return{get:o,set(l){const u=o?.call(this);c?.call(this,l),this.requestUpdate(t,u,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Pu}static _$Ei(){if(this.hasOwnProperty(Qr("elementProperties")))return;const t=Cf(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Qr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Qr("properties"))){const n=this.properties,r=[..._f(n),...wf(n)];for(const o of r)this.createProperty(o,n[o])}const t=this[Symbol.metadata];if(t!==null){const n=litPropertyMetadata.get(t);if(n!==void 0)for(const[r,o]of n)this.elementProperties.set(r,o)}this._$Eh=new Map;for(const[n,r]of this.elementProperties){const o=this._$Eu(n,r);o!==void 0&&this._$Eh.set(o,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const n=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const o of r)n.unshift(Eu(o))}else t!==void 0&&n.push(Eu(t));return n}static _$Eu(t,n){const r=n.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?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),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,n=this.constructor.elementProperties;for(const r of n.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ff(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,n,r){this._$AK(t,r)}_$ET(t,n){const r=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,r);if(o!==void 0&&r.reflect===!0){const c=(r.converter?.toAttribute!==void 0?r.converter:vs).toAttribute(n,r.type);this._$Em=t,c==null?this.removeAttribute(o):this.setAttribute(o,c),this._$Em=null}}_$AK(t,n){const r=this.constructor,o=r._$Eh.get(t);if(o!==void 0&&this._$Em!==o){const c=r.getPropertyOptions(o),l=typeof c.converter=="function"?{fromAttribute:c.converter}:c.converter?.fromAttribute!==void 0?c.converter:vs;this._$Em=o;const u=l.fromAttribute(n,c.type);this[o]=u??this._$Ej?.get(o)??u,this._$Em=null}}requestUpdate(t,n,r){if(t!==void 0){const o=this.constructor,c=this[t];if(r??=o.getPropertyOptions(t),!((r.hasChanged??ll)(c,n)||r.useDefault&&r.reflect&&c===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,r))))return;this.C(t,n,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,n,{useDefault:r,reflect:o,wrapped:c},l){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,l??n??this[t]),c!==!0||l!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(n=void 0),this._$AL.set(t,n)),o===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const t=this.scheduleUpdate();return t!=null&&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[o,c]of this._$Ep)this[o]=c;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[o,c]of r){const{wrapped:l}=c,u=this[o];l!==!0||this._$AL.has(o)||u===void 0||this.C(o,void 0,c,u)}}let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),this._$EO?.forEach((r=>r.hostUpdate?.())),this.update(n)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(n)}willUpdate(t){}_$AE(t){this._$EO?.forEach((n=>n.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((n=>this._$ET(n,this[n]))),this._$EM()}updated(t){}firstUpdated(t){}};Yi.elementStyles=[],Yi.shadowRootOptions={mode:"open"},Yi[Qr("elementProperties")]=new Map,Yi[Qr("finalized")]=new Map,kf?.({ReactiveElement:Yi}),(ys.reactiveElementVersions??=[]).push("2.1.1");const cl=globalThis,bs=cl.trustedTypes,Ou=bs?bs.createPolicy("lit-html",{createHTML:e=>e}):void 0,Ru="$lit$",xn=`lit$${Math.random().toFixed(9).slice(2)}$`,Tu="?"+xn,Ef=`<${Tu}>`,vi=document,Xr=()=>vi.createComment(""),Zr=e=>e===null||typeof e!="object"&&typeof e!="function",dl=Array.isArray,Sf=e=>dl(e)||typeof e?.[Symbol.iterator]=="function",ul=`[
|
|
2
|
+
\f\r]`,Jr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xu=/-->/g,Au=/>/g,bi=RegExp(`>|${ul}(?:([^\\s"'>=/]+)(${ul}*=${ul}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Mu=/'/g,Lu=/"/g,$u=/^(?:script|style|textarea|title)$/i,Pf=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),_s=Pf(1),er=Symbol.for("lit-noChange"),nt=Symbol.for("lit-nothing"),Vu=new WeakMap,_i=vi.createTreeWalker(vi,129);function Du(e,t){if(!dl(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ou!==void 0?Ou.createHTML(t):t}const Of=(e,t)=>{const n=e.length-1,r=[];let o,c=t===2?"<svg>":t===3?"<math>":"",l=Jr;for(let u=0;u<n;u++){const m=e[u];let v,R,k=-1,M=0;for(;M<m.length&&(l.lastIndex=M,R=l.exec(m),R!==null);)M=l.lastIndex,l===Jr?R[1]==="!--"?l=xu:R[1]!==void 0?l=Au:R[2]!==void 0?($u.test(R[2])&&(o=RegExp("</"+R[2],"g")),l=bi):R[3]!==void 0&&(l=bi):l===bi?R[0]===">"?(l=o??Jr,k=-1):R[1]===void 0?k=-2:(k=l.lastIndex-R[2].length,v=R[1],l=R[3]===void 0?bi:R[3]==='"'?Lu:Mu):l===Lu||l===Mu?l=bi:l===xu||l===Au?l=Jr:(l=bi,o=void 0);const D=l===bi&&e[u+1].startsWith("/>")?" ":"";c+=l===Jr?m+Ef:k>=0?(r.push(v),m.slice(0,k)+Ru+m.slice(k)+xn+D):m+xn+(k===-2?u:D)}return[Du(e,c+(e[n]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};let hl=class hf{constructor({strings:t,_$litType$:n},r){let o;this.parts=[];let c=0,l=0;const u=t.length-1,m=this.parts,[v,R]=Of(t,n);if(this.el=hf.createElement(v,r),_i.currentNode=this.el.content,n===2||n===3){const k=this.el.content.firstChild;k.replaceWith(...k.childNodes)}for(;(o=_i.nextNode())!==null&&m.length<u;){if(o.nodeType===1){if(o.hasAttributes())for(const k of o.getAttributeNames())if(k.endsWith(Ru)){const M=R[l++],D=o.getAttribute(k).split(xn),ne=/([.?@])?(.*)/.exec(M);m.push({type:1,index:c,name:ne[2],strings:D,ctor:ne[1]==="."?Tf:ne[1]==="?"?xf:ne[1]==="@"?Af:ws}),o.removeAttribute(k)}else k.startsWith(xn)&&(m.push({type:6,index:c}),o.removeAttribute(k));if($u.test(o.tagName)){const k=o.textContent.split(xn),M=k.length-1;if(M>0){o.textContent=bs?bs.emptyScript:"";for(let D=0;D<M;D++)o.append(k[D],Xr()),_i.nextNode(),m.push({type:2,index:++c});o.append(k[M],Xr())}}}else if(o.nodeType===8)if(o.data===Tu)m.push({type:2,index:c});else{let k=-1;for(;(k=o.data.indexOf(xn,k+1))!==-1;)m.push({type:7,index:c}),k+=xn.length-1}c++}}static createElement(t,n){const r=vi.createElement("template");return r.innerHTML=t,r}};function tr(e,t,n=e,r){if(t===er)return t;let o=r!==void 0?n._$Co?.[r]:n._$Cl;const c=Zr(t)?void 0:t._$litDirective$;return o?.constructor!==c&&(o?._$AO?.(!1),c===void 0?o=void 0:(o=new c(e),o._$AT(e,n,r)),r!==void 0?(n._$Co??=[])[r]=o:n._$Cl=o),o!==void 0&&(t=tr(e,o._$AS(e,t.values),o,r)),t}let Rf=class{constructor(t,n){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:n},parts:r}=this._$AD,o=(t?.creationScope??vi).importNode(n,!0);_i.currentNode=o;let c=_i.nextNode(),l=0,u=0,m=r[0];for(;m!==void 0;){if(l===m.index){let v;m.type===2?v=new pl(c,c.nextSibling,this,t):m.type===1?v=new m.ctor(c,m.name,m.strings,this,t):m.type===6&&(v=new Mf(c,this,t)),this._$AV.push(v),m=r[++u]}l!==m?.index&&(c=_i.nextNode(),l++)}return _i.currentNode=vi,o}p(t){let n=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,n),n+=r.strings.length-2):r._$AI(t[n])),n++}},pl=class pf{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,n,r,o){this.type=2,this._$AH=nt,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=r,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&t?.nodeType===11&&(t=n.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,n=this){t=tr(this,t,n),Zr(t)?t===nt||t==null||t===""?(this._$AH!==nt&&this._$AR(),this._$AH=nt):t!==this._$AH&&t!==er&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Sf(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!==nt&&Zr(this._$AH)?this._$AA.nextSibling.data=t:this.T(vi.createTextNode(t)),this._$AH=t}$(t){const{values:n,_$litType$:r}=t,o=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=hl.createElement(Du(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===o)this._$AH.p(n);else{const c=new Rf(o,this),l=c.u(this.options);c.p(n),this.T(l),this._$AH=c}}_$AC(t){let n=Vu.get(t.strings);return n===void 0&&Vu.set(t.strings,n=new hl(t)),n}k(t){dl(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let r,o=0;for(const c of t)o===n.length?n.push(r=new pf(this.O(Xr()),this.O(Xr()),this,this.options)):r=n[o],r._$AI(c),o++;o<n.length&&(this._$AR(r&&r._$AB.nextSibling,o),n.length=o)}_$AR(t=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},ws=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,r,o,c){this.type=1,this._$AH=nt,this._$AN=void 0,this.element=t,this.name=n,this._$AM=o,this.options=c,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=nt}_$AI(t,n=this,r,o){const c=this.strings;let l=!1;if(c===void 0)t=tr(this,t,n,0),l=!Zr(t)||t!==this._$AH&&t!==er,l&&(this._$AH=t);else{const u=t;let m,v;for(t=c[0],m=0;m<c.length-1;m++)v=tr(this,u[r+m],n,m),v===er&&(v=this._$AH[m]),l||=!Zr(v)||v!==this._$AH[m],v===nt?t=nt:t!==nt&&(t+=(v??"")+c[m+1]),this._$AH[m]=v}l&&!o&&this.j(t)}j(t){t===nt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Tf=class extends ws{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===nt?void 0:t}},xf=class extends ws{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==nt)}},Af=class extends ws{constructor(t,n,r,o,c){super(t,n,r,o,c),this.type=5}_$AI(t,n=this){if((t=tr(this,t,n,0)??nt)===er)return;const r=this._$AH,o=t===nt&&r!==nt||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,c=t!==nt&&(r===nt||o);o&&this.element.removeEventListener(this.name,this,r),c&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},Mf=class{constructor(t,n,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){tr(this,t)}};const Lf=cl.litHtmlPolyfillSupport;Lf?.(hl,pl),(cl.litHtmlVersions??=[]).push("3.3.1");const $f=(e,t,n)=>{const r=n?.renderBefore??t;let o=r._$litPart$;if(o===void 0){const c=n?.renderBefore??null;r._$litPart$=o=new pl(t.insertBefore(Xr(),c),c,void 0,n??{})}return o._$AI(e),o};const ml=globalThis;let nr=class extends Yi{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 n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=$f(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return er}};nr._$litElement$=!0,nr.finalized=!0,ml.litElementHydrateSupport?.({LitElement:nr});const Vf=ml.litElementPolyfillSupport;Vf?.({LitElement:nr}),(ml.litElementVersions??=[]).push("4.2.1");const Nu=e=>(t,n)=>{n!==void 0?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)};const Df={attribute:!0,type:String,converter:vs,reflect:!1,hasChanged:ll},Nf=(e=Df,t,n)=>{const{kind:r,metadata:o}=n;let c=globalThis.litPropertyMetadata.get(o);if(c===void 0&&globalThis.litPropertyMetadata.set(o,c=new Map),r==="setter"&&((e=Object.create(e)).wrapped=!0),c.set(n.name,e),r==="accessor"){const{name:l}=n;return{set(u){const m=t.get.call(this);t.set.call(this,u),this.requestUpdate(l,m,e)},init(u){return u!==void 0&&this.C(l,void 0,e,u),u}}}if(r==="setter"){const{name:l}=n;return function(u){const m=this[l];t.call(this,u),this.requestUpdate(l,m,e)}}throw Error("Unsupported decorator location: "+r)};function pn(e){return(t,n)=>typeof n=="object"?Nf(e,t,n):((r,o,c)=>{const l=o.hasOwnProperty(c);return o.constructor.createProperty(c,r),l?Object.getOwnPropertyDescriptor(o,c):void 0})(e,t,n)}function Cs(e){return pn({...e,state:!0,attribute:!1})}(function(){if(window.Reflect===void 0||window.customElements===void 0||window.customElements.polyfillWrapFlushCallback)return;const e=HTMLElement,t={HTMLElement:function(){return Reflect.construct(e,[],this.constructor)}};window.HTMLElement=t.HTMLElement,HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)})();const Uu=typeof window<"u"&&window.customElements!=null&&window.customElements.polyfillWrapFlushCallback!==void 0,Is=(e,t,n=null)=>{for(;t!==n;){const r=t.nextSibling;e.removeChild(t),t=r}},mn=`{{lit-${String(Math.random()).slice(2)}}}`,ju=`<!--${mn}-->`,Bu=new RegExp(`${mn}|${ju}`),ks="$lit$";class Fu{constructor(t,n){this.parts=[],this.element=n;const r=[],o=[],c=document.createTreeWalker(n.content,133,null,!1);let l=0,u=-1,m=0;const{strings:v,values:{length:R}}=t;for(;m<R;){const k=c.nextNode();if(k!==null){if(u++,k.nodeType===1){if(k.hasAttributes()){const M=k.attributes,{length:D}=M;let ne=0;for(let oe=0;oe<D;oe++)zu(M[oe].name,ks)&&ne++;for(;ne-- >0;){const oe=v[m],me=gl.exec(oe)[2],ce=me.toLowerCase()+ks,ye=k.getAttribute(ce);k.removeAttribute(ce);const Ve=ye.split(Bu);this.parts.push({type:"attribute",index:u,name:me,strings:Ve}),m+=Ve.length-1}}k.tagName==="TEMPLATE"&&(o.push(k),c.currentNode=k.content)}else if(k.nodeType===3){const M=k.data;if(M.indexOf(mn)>=0){const D=k.parentNode,ne=M.split(Bu),oe=ne.length-1;for(let me=0;me<oe;me++){let ce,ye=ne[me];if(ye==="")ce=Kt();else{const Ve=gl.exec(ye);Ve!==null&&zu(Ve[2],ks)&&(ye=ye.slice(0,Ve.index)+Ve[1]+Ve[2].slice(0,-5)+Ve[3]),ce=document.createTextNode(ye)}D.insertBefore(ce,k),this.parts.push({type:"node",index:++u})}ne[oe]===""?(D.insertBefore(Kt(),k),r.push(k)):k.data=ne[oe],m+=oe}}else if(k.nodeType===8)if(k.data===mn){const M=k.parentNode;k.previousSibling!==null&&u!==l||(u++,M.insertBefore(Kt(),k)),l=u,this.parts.push({type:"node",index:u}),k.nextSibling===null?k.data="":(r.push(k),u--),m++}else{let M=-1;for(;(M=k.data.indexOf(mn,M+1))!==-1;)this.parts.push({type:"node",index:-1}),m++}}else c.currentNode=o.pop()}for(const k of r)k.parentNode.removeChild(k)}}const zu=(e,t)=>{const n=e.length-t.length;return n>=0&&e.slice(n)===t},Hu=e=>e.index!==-1,Kt=()=>document.createComment(""),gl=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function qu(e,t){const{element:{content:n},parts:r}=e,o=document.createTreeWalker(n,133,null,!1);let c=Yr(r),l=r[c],u=-1,m=0;const v=[];let R=null;for(;o.nextNode();){u++;const k=o.currentNode;for(k.previousSibling===R&&(R=null),t.has(k)&&(v.push(k),R===null&&(R=k)),R!==null&&m++;l!==void 0&&l.index===u;)l.index=R!==null?-1:l.index-m,c=Yr(r,c),l=r[c]}v.forEach((k=>k.parentNode.removeChild(k)))}const Uf=e=>{let t=e.nodeType===11?0:1;const n=document.createTreeWalker(e,133,null,!1);for(;n.nextNode();)t++;return t},Yr=(e,t=-1)=>{for(let n=t+1;n<e.length;n++){const r=e[n];if(Hu(r))return n}return-1};const Gu=new WeakMap,Wu=e=>(...t)=>{const n=e(...t);return Gu.set(n,!0),n},eo=e=>typeof e=="function"&&Gu.has(e),Vt={},Ku={};class fl{constructor(t,n,r){this.__parts=[],this.template=t,this.processor=n,this.options=r}update(t){let n=0;for(const r of this.__parts)r!==void 0&&r.setValue(t[n]),n++;for(const r of this.__parts)r!==void 0&&r.commit()}_clone(){const t=Uu?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),n=[],r=this.template.parts,o=document.createTreeWalker(t,133,null,!1);let c,l=0,u=0,m=o.nextNode();for(;l<r.length;)if(c=r[l],Hu(c)){for(;u<c.index;)u++,m.nodeName==="TEMPLATE"&&(n.push(m),o.currentNode=m.content),(m=o.nextNode())===null&&(o.currentNode=n.pop(),m=o.nextNode());if(c.type==="node"){const v=this.processor.handleTextExpression(this.options);v.insertAfterNode(m.previousSibling),this.__parts.push(v)}else this.__parts.push(...this.processor.handleAttributeExpressions(m,c.name,c.strings,this.options));l++}else this.__parts.push(void 0),l++;return Uu&&(document.adoptNode(t),customElements.upgrade(t)),t}}const Qu=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:e=>e}),jf=` ${mn} `;class Xu{constructor(t,n,r,o){this.strings=t,this.values=n,this.type=r,this.processor=o}getHTML(){const t=this.strings.length-1;let n="",r=!1;for(let o=0;o<t;o++){const c=this.strings[o],l=c.lastIndexOf("<!--");r=(l>-1||r)&&c.indexOf("-->",l+1)===-1;const u=gl.exec(c);n+=u===null?c+(r?jf:ju):c.substr(0,u.index)+u[1]+u[2]+ks+u[3]+mn}return n+=this.strings[t],n}getTemplateElement(){const t=document.createElement("template");let n=this.getHTML();return Qu!==void 0&&(n=Qu.createHTML(n)),t.innerHTML=n,t}}const Es=e=>e===null||!(typeof e=="object"||typeof e=="function"),yl=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class Zu{constructor(t,n,r){this.dirty=!0,this.element=t,this.name=n,this.strings=r,this.parts=[];for(let o=0;o<r.length-1;o++)this.parts[o]=this._createPart()}_createPart(){return new Ju(this)}_getValue(){const t=this.strings,n=t.length-1,r=this.parts;if(n===1&&t[0]===""&&t[1]===""){const c=r[0].value;if(typeof c=="symbol")return String(c);if(typeof c=="string"||!yl(c))return c}let o="";for(let c=0;c<n;c++){o+=t[c];const l=r[c];if(l!==void 0){const u=l.value;if(Es(u)||!yl(u))o+=typeof u=="string"?u:String(u);else for(const m of u)o+=typeof m=="string"?m:String(m)}}return o+=t[n],o}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class Ju{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===Vt||Es(t)&&t===this.value||(this.value=t,eo(t)||(this.committer.dirty=!0))}commit(){for(;eo(this.value);){const t=this.value;this.value=Vt,t(this)}this.value!==Vt&&this.committer.commit()}}class wi{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(Kt()),this.endNode=t.appendChild(Kt())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=Kt()),t.__insert(this.endNode=Kt())}insertAfterPart(t){t.__insert(this.startNode=Kt()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(this.startNode.parentNode===null)return;for(;eo(this.__pendingValue);){const n=this.__pendingValue;this.__pendingValue=Vt,n(this)}const t=this.__pendingValue;t!==Vt&&(Es(t)?t!==this.value&&this.__commitText(t):t instanceof Xu?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):yl(t)?this.__commitIterable(t):t===Ku?(this.value=Ku,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const n=this.startNode.nextSibling,r=typeof(t=t??"")=="string"?t:String(t);n===this.endNode.previousSibling&&n.nodeType===3?n.data=r:this.__commitNode(document.createTextNode(r)),this.value=t}__commitTemplateResult(t){const n=this.options.templateFactory(t);if(this.value instanceof fl&&this.value.template===n)this.value.update(t.values);else{const r=new fl(n,t.processor,this.options),o=r._clone();r.update(t.values),this.__commitNode(o),this.value=r}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const n=this.value;let r,o=0;for(const c of t)r=n[o],r===void 0&&(r=new wi(this.options),n.push(r),o===0?r.appendIntoPart(this):r.insertAfterPart(n[o-1])),r.setValue(c),r.commit(),o++;o<n.length&&(n.length=o,this.clear(r&&r.endNode))}clear(t=this.startNode){Is(this.startNode.parentNode,t.nextSibling,this.endNode)}}class Bf{constructor(t,n,r){if(this.value=void 0,this.__pendingValue=void 0,r.length!==2||r[0]!==""||r[1]!=="")throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=n,this.strings=r}setValue(t){this.__pendingValue=t}commit(){for(;eo(this.__pendingValue);){const n=this.__pendingValue;this.__pendingValue=Vt,n(this)}if(this.__pendingValue===Vt)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=Vt}}class Ff extends Zu{constructor(t,n,r){super(t,n,r),this.single=r.length===2&&r[0]===""&&r[1]===""}_createPart(){return new zf(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class zf extends Ju{}let Yu=!1;(()=>{try{const e={get capture(){return Yu=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch{}})();class Hf{constructor(t,n,r){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=n,this.eventContext=r,this.__boundHandleEvent=o=>this.handleEvent(o)}setValue(t){this.__pendingValue=t}commit(){for(;eo(this.__pendingValue);){const c=this.__pendingValue;this.__pendingValue=Vt,c(this)}if(this.__pendingValue===Vt)return;const t=this.__pendingValue,n=this.value,r=t==null||n!=null&&(t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive),o=t!=null&&(n==null||r);r&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),o&&(this.__options=qf(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=Vt}handleEvent(t){typeof this.value=="function"?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const qf=e=>e&&(Yu?{capture:e.capture,passive:e.passive,once:e.once}:e.capture);function Gf(e){let t=to.get(e.type);t===void 0&&(t={stringsArray:new WeakMap,keyString:new Map},to.set(e.type,t));let n=t.stringsArray.get(e.strings);if(n!==void 0)return n;const r=e.strings.join(mn);return n=t.keyString.get(r),n===void 0&&(n=new Fu(e,e.getTemplateElement()),t.keyString.set(r,n)),t.stringsArray.set(e.strings,n),n}const to=new Map,ir=new WeakMap;const Wf=new class{handleAttributeExpressions(e,t,n,r){const o=t[0];return o==="."?new Ff(e,t.slice(1),n).parts:o==="@"?[new Hf(e,t.slice(1),r.eventContext)]:o==="?"?[new Bf(e,t.slice(1),n)]:new Zu(e,t,n).parts}handleTextExpression(e){return new wi(e)}};typeof window<"u"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");const I=(e,...t)=>new Xu(e,t,"html",Wf),eh=(e,t)=>`${e}--${t}`;let Ss=!0;window.ShadyCSS===void 0?Ss=!1:window.ShadyCSS.prepareTemplateDom===void 0&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),Ss=!1);const Kf=e=>t=>{const n=eh(t.type,e);let r=to.get(n);r===void 0&&(r={stringsArray:new WeakMap,keyString:new Map},to.set(n,r));let o=r.stringsArray.get(t.strings);if(o!==void 0)return o;const c=t.strings.join(mn);if(o=r.keyString.get(c),o===void 0){const l=t.getTemplateElement();Ss&&window.ShadyCSS.prepareTemplateDom(l,e),o=new Fu(t,l),r.keyString.set(c,o)}return r.stringsArray.set(t.strings,o),o},Qf=["html","svg"],th=new Set,Xf=(e,t,n)=>{th.add(e);const r=n?n.element:document.createElement("template"),o=t.querySelectorAll("style"),{length:c}=o;if(c===0)return void window.ShadyCSS.prepareTemplateStyles(r,e);const l=document.createElement("style");for(let v=0;v<c;v++){const R=o[v];R.parentNode.removeChild(R),l.textContent+=R.textContent}(v=>{Qf.forEach((R=>{const k=to.get(eh(R,v));k!==void 0&&k.keyString.forEach((M=>{const{element:{content:D}}=M,ne=new Set;Array.from(D.querySelectorAll("style")).forEach((oe=>{ne.add(oe)})),qu(M,ne)}))}))})(e);const u=r.content;n?(function(v,R,k=null){const{element:{content:M},parts:D}=v;if(k==null)return void M.appendChild(R);const ne=document.createTreeWalker(M,133,null,!1);let oe=Yr(D),me=0,ce=-1;for(;ne.nextNode();)for(ce++,ne.currentNode===k&&(me=Uf(R),k.parentNode.insertBefore(R,k));oe!==-1&&D[oe].index===ce;){if(me>0){for(;oe!==-1;)D[oe].index+=me,oe=Yr(D,oe);return}oe=Yr(D,oe)}})(n,l,u.firstChild):u.insertBefore(l,u.firstChild),window.ShadyCSS.prepareTemplateStyles(r,e);const m=u.querySelector("style");if(window.ShadyCSS.nativeShadow&&m!==null)t.insertBefore(m.cloneNode(!0),t.firstChild);else if(n){u.insertBefore(l,u.firstChild);const v=new Set;v.add(l),qu(n,v)}};window.JSCompiler_renameProperty=(e,t)=>e;const vl={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return e!==null;case Number:return e===null?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},nh=(e,t)=>t!==e&&(t==t||e==e),bl={attribute:!0,type:String,converter:vl,reflect:!1,hasChanged:nh},_l="finalized";class ih extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach(((n,r)=>{const o=this._attributeNameForProperty(r,n);o!==void 0&&(this._attributeToPropertyMap.set(o,r),t.push(o))})),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;t!==void 0&&t.forEach(((n,r)=>this._classProperties.set(r,n)))}}static createProperty(t,n=bl){if(this._ensureClassProperties(),this._classProperties.set(t,n),n.noAccessor||this.prototype.hasOwnProperty(t))return;const r=typeof t=="symbol"?Symbol():`__${t}`,o=this.getPropertyDescriptor(t,r,n);o!==void 0&&Object.defineProperty(this.prototype,t,o)}static getPropertyDescriptor(t,n,r){return{get(){return this[n]},set(o){const c=this[t];this[n]=o,this.requestUpdateInternal(t,c,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||bl}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty(_l)||t.finalize(),this[_l]=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const n=this.properties,r=[...Object.getOwnPropertyNames(n),...typeof Object.getOwnPropertySymbols=="function"?Object.getOwnPropertySymbols(n):[]];for(const o of r)this.createProperty(o,n[o])}}static _attributeNameForProperty(t,n){const r=n.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}static _valueHasChanged(t,n,r=nh){return r(t,n)}static _propertyValueFromAttribute(t,n){const r=n.type,o=n.converter||vl,c=typeof o=="function"?o:o.fromAttribute;return c?c(t,r):t}static _propertyValueToAttribute(t,n){if(n.reflect===void 0)return;const r=n.type,o=n.converter;return(o&&o.toAttribute||vl.toAttribute)(t,r)}initialize(){this._updateState=0,this._updatePromise=new Promise((t=>this._enableUpdatingResolver=t)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((t,n)=>{if(this.hasOwnProperty(n)){const r=this[n];delete this[n],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(n,r)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((t,n)=>this[n]=t)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){this._enableUpdatingResolver!==void 0&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,n,r){n!==r&&this._attributeToProperty(t,r)}_propertyToAttribute(t,n,r=bl){const o=this.constructor,c=o._attributeNameForProperty(t,r);if(c!==void 0){const l=o._propertyValueToAttribute(n,r);if(l===void 0)return;this._updateState=8|this._updateState,l==null?this.removeAttribute(c):this.setAttribute(c,l),this._updateState=-9&this._updateState}}_attributeToProperty(t,n){if(8&this._updateState)return;const r=this.constructor,o=r._attributeToPropertyMap.get(t);if(o!==void 0){const c=r.getPropertyOptions(o);this._updateState=16|this._updateState,this[o]=r._propertyValueFromAttribute(n,c),this._updateState=-17&this._updateState}}requestUpdateInternal(t,n,r){let o=!0;if(t!==void 0){const c=this.constructor;r=r||c.getPropertyOptions(t),c._valueHasChanged(this[t],n,r.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,n),r.reflect!==!0||16&this._updateState||(this._reflectingProperties===void 0&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,r))):o=!1}!this._hasRequestedUpdate&&o&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,n){return this.requestUpdateInternal(t,n),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch{}const t=this.performUpdate();return t!=null&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const n=this._changedProperties;try{t=this.shouldUpdate(n),t?this.update(n):this._markUpdated()}catch(r){throw t=!1,this._markUpdated(),r}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(n)),this.updated(n))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){this._reflectingProperties!==void 0&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((n,r)=>this._propertyToAttribute(r,this[r],n))),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}ih[_l]=!0;const Zf=(e,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?Object.assign(Object.assign({},t),{finisher(n){n.createProperty(t.key,e)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(n){n.createProperty(t.key,e)}};function C(e){return(t,n)=>n!==void 0?((r,o,c)=>{o.constructor.createProperty(c,r)})(e,t,n):Zf(e,t)}function rh(e,t){return(n,r)=>{const o={get(){return this.renderRoot.querySelector(e)},enumerable:!0,configurable:!0};return r!==void 0?Jf(o,n,r):Yf(o,n)}}const Jf=(e,t,n)=>{Object.defineProperty(t,n,e)},Yf=(e,t)=>({kind:"method",placement:"prototype",key:t.key,descriptor:e}),wl=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,oh=Symbol();class e0{constructor(t,n){if(n!==oh)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return this._styleSheet===void 0&&(wl?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const sh={};class je extends ih{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const n=(c,l)=>c.reduceRight(((u,m)=>Array.isArray(m)?n(m,u):(u.add(m),u)),l),r=n(t,new Set),o=[];r.forEach((c=>o.unshift(c))),this._styles=o}else this._styles=t===void 0?[]:[t];this._styles=this._styles.map((n=>{if(n instanceof CSSStyleSheet&&!wl){const r=Array.prototype.slice.call(n.cssRules).reduce(((o,c)=>o+c.cssText),"");return new e0(String(r),oh)}return n}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const t=this.constructor._styles;t.length!==0&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow?wl?this.renderRoot.adoptedStyleSheets=t.map((n=>n instanceof CSSStyleSheet?n:n.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((n=>n.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&window.ShadyCSS!==void 0&&window.ShadyCSS.styleElement(this)}update(t){const n=this.render();super.update(t),n!==sh&&this.constructor.render(n,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((r=>{const o=document.createElement("style");o.textContent=r.cssText,this.renderRoot.appendChild(o)})))}render(){return sh}}let ah;je.finalized=!0,je.render=(e,t,n)=>{if(!n||typeof n!="object"||!n.scopeName)throw new Error("The `scopeName` option is required.");const r=n.scopeName,o=ir.has(t),c=Ss&&t.nodeType===11&&!!t.host,l=c&&!th.has(r),u=l?document.createDocumentFragment():t;if(((m,v,R)=>{let k=ir.get(v);k===void 0&&(Is(v,v.firstChild),ir.set(v,k=new wi(Object.assign({templateFactory:Gf},R))),k.appendInto(v)),k.setValue(m),k.commit()})(e,u,Object.assign({templateFactory:Kf(r)},n)),l){const m=ir.get(u);ir.delete(u);const v=m.value instanceof fl?m.value.template:void 0;Xf(r,u,v),Is(t,t.firstChild),t.appendChild(u),ir.set(t,m)}!o&&c&&window.ShadyCSS.styleElement(t.host)},je.shadowRootOptions={mode:"open"};const z={eb:null,lang:"en",appResource:{},progResource:{},chatRooms:{},commentBoards:{},comments:{},ready:!1,clientId:null,accessToken:null,storageStrategy:{get:()=>ah,set(e){ah=e}},lsKey:null,logger:!1,pn:null,chatUrlTemplate:null,createChatUrlTemplate:null,programUrlTemplate:null,chatRoomInvitationDetailUrlTemplate:null,chatRoomInvitationsUrl:null,leaderboardUrlTemplate:null,endpoint:"https://cf-blast.livelikecdn.com/api/v1/",profileDetailUrlTemplate:null,profileUrl:null,analyticsProvider:null,pinnedMessagesUrl:null,blockedProfileIds:[],deletedMessageIds:{},reactionSpaces:{},quests:{},userQuests:{},widgets:{},pnConfig:null,pollingInterval:1e4},Ce={access_token:"",badges:null,created_at:"",id:"",nickname:"",points:0,reported_count:0,subscribe_channel:"",url:"",blockList:null,custom_data:null,reactions:null,chat_room_memberships_url:null,badges_url:"",badge_progress_url:"",reward_item_balances_url:null,reward_item_transfer_url:null,block_profile_url:"",blocked_profiles_template_url:"",blocked_profile_ids_url:"",leaderboards_url:"",leaderboard_views_url:""},Cl={version:"1.4.0",ready:!1,apiDocVersion:"1.4.0"},lh=e=>{typeof e.track=="function"?z.analyticsProvider=e:console.error("Error in analyticsProvider: track is not a function")};function ch(e){return`Bearer ${e}`}var We;(function(e){e.MESSAGE_CREATED="message-created",e.IMAGE_CREATED="image-created",e.CUSTOM_MESSAGE_CREATED="custom-message-created",e.MESSAGE_DELETED="message-deleted",e.IMAGE_DELETED="image-deleted",e.CHATROOM_UPDATED="chatroom-updated"})(We||(We={}));const dh=[We.MESSAGE_CREATED,We.IMAGE_CREATED,We.MESSAGE_DELETED,We.IMAGE_DELETED,We.CHATROOM_UPDATED],t0=[We.MESSAGE_CREATED,We.IMAGE_CREATED,We.MESSAGE_DELETED,We.IMAGE_DELETED,We.CHATROOM_UPDATED],vt={DELETED:"messagedeleted",RECEIVED:"messagereceived",UPDATED:"messageupdated",SENT:"messagesent",ADDED:"reactionadded",REMOVED:"reactionremoved"},rr={[We.CHATROOM_UPDATED]:"chatroom-updated",[We.MESSAGE_CREATED]:vt.RECEIVED,[We.IMAGE_CREATED]:vt.RECEIVED,[We.CUSTOM_MESSAGE_CREATED]:vt.RECEIVED,[We.MESSAGE_DELETED]:vt.DELETED,[We.IMAGE_DELETED]:vt.DELETED,"message-updated":vt.UPDATED,"message-sent":vt.SENT,added:vt.ADDED,removed:vt.REMOVED};var no;(function(e){e.READY="ready",e.INTERACTIVE="interactive",e.FINISHED="finished",e.RESULTS="results",e.SUBMITTING="submitting",e.POINTS="points",e.BADGE="badge"})(no||(no={}));const n0=[no.RESULTS,no.FINISHED],Ci={EMOJI_SLIDER:"emoji-slider-results",CHEER_METER:"cheer-meter-results",TEXT_POLL:"text-poll-results",IMAGE_POLL:"image-poll-results",TEXT_QUIZ:"text-quiz-results",IMAGE_QUIZ:"image-quiz-results"};var X,An;(function(e){e.ALERT="alert",e.EMOJI_SLIDER="emoji-slider",e.SOCIAL_EMBED="social-embed",e.RICH_POST="rich-post",e.CHEER_METER="cheer-meter",e.TEXT_POLL="text-poll",e.IMAGE_POLL="image-poll",e.TEXT_QUIZ="text-quiz",e.IMAGE_QUIZ="image-quiz",e.TEXT_PREDICTION="text-prediction",e.TEXT_PREDICTION_FOLLOW_UP="text-prediction-follow-up",e.IMAGE_PREDICTION="image-prediction",e.IMAGE_PREDICTION_FOLLOW_UP="image-prediction-follow-up",e.TEXT_ASK="text-ask",e.VIDEO_ALERT="video-alert",e.TEXT_NUMBER_PREDICTION="text-number-prediction",e.TEXT_NUMBER_PREDICTION_FOLLOW_UP="text-number-prediction-follow-up",e.IMAGE_NUMBER_PREDICTION="image-number-prediction",e.IMAGE_NUMBER_PREDICTION_FOLLOW_UP="image-number-prediction-follow-up"})(X||(X={})),(function(e){e.ALERT="alert-created",e.EMOJI_SLIDER="emoji-slider-created",e.SOCIAL_EMBED="social-embed-created",e.RICH_POST="rich-post-created",e.CHEER_METER="cheer-meter-created",e.TEXT_POLL="text-poll-created",e.IMAGE_POLL="image-poll-created",e.TEXT_QUIZ="text-quiz-created",e.IMAGE_QUIZ="image-quiz-created",e.TEXT_PREDICTION="text-prediction-created",e.TEXT_PREDICTION_FOLLOWUP="text-prediction-follow-up-updated",e.IMAGE_PREDICTION="image-prediction-created",e.IMAGE_PREDICITON_FOLLOWUP="image-prediction-follow-up-updated",e.TEXT_ASK="text-ask-created",e.VIDEO_ALERT="video-alert-created",e.TEXT_NUMBER_PREDICTION="text-number-prediction-created",e.TEXT_NUMBER_PREDICTION_FOLLOWUP="text-number-prediction-follow-up-updated",e.IMAGE_NUMBER_PREDICTION="image-number-prediction-created",e.IMAGE_NUMBER_PREDICTION_FOLLOWUP="image-number-prediction-follow-up-updated"})(An||(An={}));const i0=[Ci.EMOJI_SLIDER,Ci.CHEER_METER,Ci.TEXT_POLL,Ci.IMAGE_POLL,Ci.TEXT_QUIZ,Ci.IMAGE_QUIZ],uh=[X.CHEER_METER,X.EMOJI_SLIDER,X.TEXT_POLL,X.IMAGE_POLL,X.TEXT_QUIZ,X.IMAGE_QUIZ,X.TEXT_PREDICTION,X.TEXT_PREDICTION_FOLLOW_UP,X.IMAGE_PREDICTION,X.IMAGE_PREDICTION_FOLLOW_UP,X.TEXT_ASK,X.TEXT_NUMBER_PREDICTION,X.TEXT_NUMBER_PREDICTION_FOLLOW_UP,X.IMAGE_NUMBER_PREDICTION,X.IMAGE_NUMBER_PREDICTION_FOLLOW_UP],r0=[X.TEXT_ASK,X.EMOJI_SLIDER,X.CHEER_METER,X.TEXT_POLL,X.IMAGE_POLL,X.TEXT_QUIZ,X.IMAGE_QUIZ,X.TEXT_PREDICTION,X.IMAGE_PREDICTION,X.TEXT_NUMBER_PREDICTION,X.IMAGE_NUMBER_PREDICTION],o0=[X.EMOJI_SLIDER,X.TEXT_ASK,X.TEXT_QUIZ,X.IMAGE_QUIZ,X.TEXT_NUMBER_PREDICTION,X.TEXT_NUMBER_PREDICTION_FOLLOW_UP,X.IMAGE_NUMBER_PREDICTION,X.IMAGE_NUMBER_PREDICTION_FOLLOW_UP,X.TEXT_PREDICTION_FOLLOW_UP,X.IMAGE_PREDICTION_FOLLOW_UP],hh=[X.EMOJI_SLIDER,X.TEXT_ASK,X.TEXT_QUIZ,X.IMAGE_QUIZ,X.TEXT_NUMBER_PREDICTION,X.TEXT_NUMBER_PREDICTION_FOLLOW_UP,X.IMAGE_NUMBER_PREDICTION,X.IMAGE_NUMBER_PREDICTION_FOLLOW_UP,X.TEXT_PREDICTION_FOLLOW_UP,X.IMAGE_PREDICTION_FOLLOW_UP],s0=[X.CHEER_METER,X.TEXT_POLL,X.IMAGE_POLL,X.TEXT_PREDICTION,X.IMAGE_PREDICTION],a0=[X.TEXT_QUIZ,X.IMAGE_QUIZ],l0=[X.TEXT_POLL,X.IMAGE_POLL,X.TEXT_PREDICTION,X.TEXT_PREDICTION_FOLLOW_UP,X.IMAGE_PREDICTION,X.IMAGE_PREDICTION_FOLLOW_UP],c0=[X.TEXT_PREDICTION,X.IMAGE_PREDICTION,X.TEXT_NUMBER_PREDICTION,X.IMAGE_NUMBER_PREDICTION],Ps=[X.TEXT_PREDICTION_FOLLOW_UP,X.IMAGE_PREDICTION_FOLLOW_UP,X.TEXT_NUMBER_PREDICTION_FOLLOW_UP,X.IMAGE_NUMBER_PREDICTION_FOLLOW_UP],Os={[X.TEXT_PREDICTION_FOLLOW_UP]:"text_prediction_id",[X.IMAGE_PREDICTION_FOLLOW_UP]:"image_prediction_id",[X.IMAGE_NUMBER_PREDICTION_FOLLOW_UP]:"image_number_prediction_id",[X.TEXT_NUMBER_PREDICTION_FOLLOW_UP]:"text_number_prediction_id"},ph={[X.TEXT_PREDICTION_FOLLOW_UP]:X.TEXT_PREDICTION,[X.IMAGE_PREDICTION_FOLLOW_UP]:X.IMAGE_PREDICTION,[X.IMAGE_NUMBER_PREDICTION_FOLLOW_UP]:X.IMAGE_NUMBER_PREDICTION},d0=[An.TEXT_PREDICTION_FOLLOWUP,An.IMAGE_PREDICITON_FOLLOWUP,An.TEXT_NUMBER_PREDICTION_FOLLOWUP,An.IMAGE_NUMBER_PREDICTION_FOLLOWUP];var gn,Mn,Il,io,kl,ro;(function(e){e.JOIN="join",e.LEAVE="leave",e.TIMEOUT="timeout",e.ATTRIBUTES_UPDATE="attributesUpdate"})(gn||(gn={})),(function(e){e.ADD_NEW_MEMBER="chat-room-add",e.INVITE_NEW_MEMBER="chat-room-invite",e.PIN_MESSAGE="message-pinned",e.UNPIN_MESSAGE="message-unpinned",e.CHATROOM_UPDATED="chatroom-updated"})(Mn||(Mn={})),(Il||(Il={})).REWARD_ITEM_TRANSFER_RECEIVED="reward-item-transfer-received",(function(e){e.BLOCK_PROFILE="block-profile",e.UNBLOCK_PROFILE="unblock-profile"})(io||(io={})),(function(e){e.ADD_REACTION="user-reaction-added",e.REMOVE_REACTION="user-reaction-removed",e.UPDATE_REACTION_SPACE="reaction-space-updated"})(kl||(kl={})),(function(e){e.SHADOW_MUTED="shadow-muted",e.PROFANITY="profanity"})(ro||(ro={}));var Rs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var El={exports:{}};(function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||Rs!==void 0&&Rs,r=(function(){function c(){this.fetch=!1,this.DOMException=n.DOMException}return c.prototype=n,new c})();(function(c){(function(l){var u=c!==void 0&&c||typeof self<"u"&&self||u!==void 0&&u,m="URLSearchParams"in u,v="Symbol"in u&&"iterator"in Symbol,R="FileReader"in u&&"Blob"in u&&(function(){try{return new Blob,!0}catch{return!1}})(),k="FormData"in u,M="ArrayBuffer"in u;if(M)var D=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],ne=ArrayBuffer.isView||function(B){return B&&D.indexOf(Object.prototype.toString.call(B))>-1};function oe(B){if(typeof B!="string"&&(B=String(B)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(B)||B==="")throw new TypeError('Invalid character in header field name: "'+B+'"');return B.toLowerCase()}function me(B){return typeof B!="string"&&(B=String(B)),B}function ce(B){var le={next:function(){var q=B.shift();return{done:q===void 0,value:q}}};return v&&(le[Symbol.iterator]=function(){return le}),le}function ye(B){this.map={},B instanceof ye?B.forEach((function(le,q){this.append(q,le)}),this):Array.isArray(B)?B.forEach((function(le){this.append(le[0],le[1])}),this):B&&Object.getOwnPropertyNames(B).forEach((function(le){this.append(le,B[le])}),this)}function Ve(B){if(B.bodyUsed)return Promise.reject(new TypeError("Already read"));B.bodyUsed=!0}function li(B){return new Promise((function(le,q){B.onload=function(){le(B.result)},B.onerror=function(){q(B.error)}}))}function et(B){var le=new FileReader,q=li(le);return le.readAsArrayBuffer(B),q}function St(B){if(B.slice)return B.slice(0);var le=new Uint8Array(B.byteLength);return le.set(new Uint8Array(B)),le.buffer}function Mt(){return this.bodyUsed=!1,this._initBody=function(B){var le;this.bodyUsed=this.bodyUsed,this._bodyInit=B,B?typeof B=="string"?this._bodyText=B:R&&Blob.prototype.isPrototypeOf(B)?this._bodyBlob=B:k&&FormData.prototype.isPrototypeOf(B)?this._bodyFormData=B:m&&URLSearchParams.prototype.isPrototypeOf(B)?this._bodyText=B.toString():M&&R&&(le=B)&&DataView.prototype.isPrototypeOf(le)?(this._bodyArrayBuffer=St(B.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):M&&(ArrayBuffer.prototype.isPrototypeOf(B)||ne(B))?this._bodyArrayBuffer=St(B):this._bodyText=B=Object.prototype.toString.call(B):this._bodyText="",this.headers.get("content-type")||(typeof B=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):m&&URLSearchParams.prototype.isPrototypeOf(B)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},R&&(this.blob=function(){var B=Ve(this);if(B)return B;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var B=Ve(this);return B||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(et)}),this.text=function(){var B,le,q,st=Ve(this);if(st)return st;if(this._bodyBlob)return B=this._bodyBlob,le=new FileReader,q=li(le),le.readAsText(B),q;if(this._bodyArrayBuffer)return Promise.resolve((function(Fe){for(var Ae=new Uint8Array(Fe),Hi=new Array(Ae.length),at=0;at<Ae.length;at++)Hi[at]=String.fromCharCode(Ae[at]);return Hi.join("")})(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},k&&(this.formData=function(){return this.text().then(Fa)}),this.json=function(){return this.text().then(JSON.parse)},this}ye.prototype.append=function(B,le){B=oe(B),le=me(le);var q=this.map[B];this.map[B]=q?q+", "+le:le},ye.prototype.delete=function(B){delete this.map[oe(B)]},ye.prototype.get=function(B){return B=oe(B),this.has(B)?this.map[B]:null},ye.prototype.has=function(B){return this.map.hasOwnProperty(oe(B))},ye.prototype.set=function(B,le){this.map[oe(B)]=me(le)},ye.prototype.forEach=function(B,le){for(var q in this.map)this.map.hasOwnProperty(q)&&B.call(le,this.map[q],q,this)},ye.prototype.keys=function(){var B=[];return this.forEach((function(le,q){B.push(q)})),ce(B)},ye.prototype.values=function(){var B=[];return this.forEach((function(le){B.push(le)})),ce(B)},ye.prototype.entries=function(){var B=[];return this.forEach((function(le,q){B.push([q,le])})),ce(B)},v&&(ye.prototype[Symbol.iterator]=ye.prototype.entries);var dt=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function De(B,le){if(!(this instanceof De))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var q,st,Fe=(le=le||{}).body;if(B instanceof De){if(B.bodyUsed)throw new TypeError("Already read");this.url=B.url,this.credentials=B.credentials,le.headers||(this.headers=new ye(B.headers)),this.method=B.method,this.mode=B.mode,this.signal=B.signal,Fe||B._bodyInit==null||(Fe=B._bodyInit,B.bodyUsed=!0)}else this.url=String(B);if(this.credentials=le.credentials||this.credentials||"same-origin",!le.headers&&this.headers||(this.headers=new ye(le.headers)),this.method=(q=le.method||this.method||"GET",st=q.toUpperCase(),dt.indexOf(st)>-1?st:q),this.mode=le.mode||this.mode||null,this.signal=le.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&Fe)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(Fe),!(this.method!=="GET"&&this.method!=="HEAD"||le.cache!=="no-store"&&le.cache!=="no-cache")){var Ae=/([?&])_=[^&]*/;Ae.test(this.url)?this.url=this.url.replace(Ae,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function Fa(B){var le=new FormData;return B.trim().split("&").forEach((function(q){if(q){var st=q.split("="),Fe=st.shift().replace(/\+/g," "),Ae=st.join("=").replace(/\+/g," ");le.append(decodeURIComponent(Fe),decodeURIComponent(Ae))}})),le}function _t(B,le){if(!(this instanceof _t))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');le||(le={}),this.type="default",this.status=le.status===void 0?200:le.status,this.ok=this.status>=200&&this.status<300,this.statusText=le.statusText===void 0?"":""+le.statusText,this.headers=new ye(le.headers),this.url=le.url||"",this._initBody(B)}De.prototype.clone=function(){return new De(this,{body:this._bodyInit})},Mt.call(De.prototype),Mt.call(_t.prototype),_t.prototype.clone=function(){return new _t(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new ye(this.headers),url:this.url})},_t.error=function(){var B=new _t(null,{status:0,statusText:""});return B.type="error",B};var Md=[301,302,303,307,308];_t.redirect=function(B,le){if(Md.indexOf(le)===-1)throw new RangeError("Invalid status code");return new _t(null,{status:le,headers:{location:B}})},l.DOMException=u.DOMException;try{new l.DOMException}catch{l.DOMException=function(le,q){this.message=le,this.name=q;var st=Error(le);this.stack=st.stack},l.DOMException.prototype=Object.create(Error.prototype),l.DOMException.prototype.constructor=l.DOMException}function Yo(B,le){return new Promise((function(q,st){var Fe=new De(B,le);if(Fe.signal&&Fe.signal.aborted)return st(new l.DOMException("Aborted","AbortError"));var Ae=new XMLHttpRequest;function Hi(){Ae.abort()}Ae.onload=function(){var at,ci,es={status:Ae.status,statusText:Ae.statusText,headers:(at=Ae.getAllResponseHeaders()||"",ci=new ye,at.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(En){return En.indexOf(`
|
|
4
|
+
`)===0?En.substr(1,En.length):En})).forEach((function(En){var za=En.split(":"),we=za.shift().trim();if(we){var Ke=za.join(":").trim();ci.append(we,Ke)}})),ci)};es.url="responseURL"in Ae?Ae.responseURL:es.headers.get("X-Request-URL");var Ld="response"in Ae?Ae.response:Ae.responseText;setTimeout((function(){q(new _t(Ld,es))}),0)},Ae.onerror=function(){setTimeout((function(){st(new TypeError("Network request failed"))}),0)},Ae.ontimeout=function(){setTimeout((function(){st(new TypeError("Network request failed"))}),0)},Ae.onabort=function(){setTimeout((function(){st(new l.DOMException("Aborted","AbortError"))}),0)},Ae.open(Fe.method,(function(at){try{return at===""&&u.location.href?u.location.href:at}catch{return at}})(Fe.url),!0),Fe.credentials==="include"?Ae.withCredentials=!0:Fe.credentials==="omit"&&(Ae.withCredentials=!1),"responseType"in Ae&&(R?Ae.responseType="blob":M&&Fe.headers.get("Content-Type")&&Fe.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(Ae.responseType="arraybuffer")),!le||typeof le.headers!="object"||le.headers instanceof ye?Fe.headers.forEach((function(at,ci){Ae.setRequestHeader(ci,at)})):Object.getOwnPropertyNames(le.headers).forEach((function(at){Ae.setRequestHeader(at,me(le.headers[at]))})),Fe.signal&&(Fe.signal.addEventListener("abort",Hi),Ae.onreadystatechange=function(){Ae.readyState===4&&Fe.signal.removeEventListener("abort",Hi)}),Ae.send(Fe._bodyInit===void 0?null:Fe._bodyInit)}))}Yo.polyfill=!0,u.fetch||(u.fetch=Yo,u.Headers=ye,u.Request=De,u.Response=_t),l.Headers=ye,l.Request=De,l.Response=_t,l.fetch=Yo})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=n.fetch?n:r;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t})(El,El.exports);var gh=El.exports,u0=mh(gh);const Sl=globalThis.fetch?globalThis.fetch:u0;var Pl,Ol,Rl,oo,fn,Tl,xl,Ts,xs,As,Al,Ml,Ll,$l,Vl,Dl,so;function fh(e){return e.message_event&&dh.includes(e.message_event)}function yh(e){return e.message_event&&e.message_event===We.CUSTOM_MESSAGE_CREATED}function vh(e){return e.quote_message_id!==void 0}function bh(e){return e.hasOwnProperty("answer_url")}function Ms(e){return e.hasOwnProperty("vote_url")}function _h(e){return e.hasOwnProperty("text")}function wh(e){return e.hasOwnProperty("magnitude")}function Ch(e){return e.hasOwnProperty("options")&&Array.isArray(e.options)}(function(e){e.ETHEREUM="ethereum",e.POLYGON="polygon",e.CHILIZ="chiliz",e.HEDERA="hedera"})(Pl||(Pl={})),(function(e){e.FUNGIBLE="fungible",e.NONFUNGIBLE="non-fungible"})(Ol||(Ol={})),(function(e){e.ACCEPTED="accepted",e.PENDING="pending",e.REJECTED="rejected"})(Rl||(Rl={})),(function(e){e.ALLOWED="allowed",e.DISALLOWED="disallowed"})(oo||(oo={})),(function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE"})(fn||(fn={})),(function(e){e.ACTIVE="active",e.NOT_STARTED="not_started",e.EXPIRED="expired"})(Tl||(Tl={})),(function(e){e.INCOMPLETE="incomplete",e.COMPLETED="completed"})(xl||(xl={})),(function(e){e.CLAIMED="claimed",e.UNCLAIMED="unclaimed"})(Ts||(Ts={})),(function(e){e.CHAT_ROOM="chat-room",e.USER_PROFILE="user-profile"})(xs||(xs={})),(As||(As={})).CHAT_MESSAGE="chat-message",(function(e){e.FILTERED="filtered",e.PROFANITY="profanity"})(Al||(Al={})),(function(e){e.OLDEST="created_at",e.NEWEST="-created_at",e.OLDEST_REPLIES="reply",e.NEWEST_REPLIES="-reply"})(Ml||(Ml={})),(function(e){e.SCHEDULED="scheduled",e.PENDING="pending",e.PUBLISHED="published",e.INFLIGHT="inflight"})(Ll||(Ll={})),(function(e){e.SENT="sent",e.RECEIVED="received"})($l||($l={})),(function(e){e.BUILT_IN="built-in",e.CUSTOM="custom",e.SEGMENT="segment",e.MPARTICLE="mparticle"})(Vl||(Vl={})),(function(e){e.PENDING="pending",e.DISMISSED="dismissed"})(Dl||(Dl={})),(function(e){e.ACTIVE="active",e.REDEEMED="redeemed",e.INACTIVE="inactive"})(so||(so={}));const Nl=()=>z.lang,Ih=e=>{z.lang=e},kh={400:"Incorrect data.",401:"Unauthorized. Access token missing from request.",403:"Access Denied. Access token incorrect.",404:"Resource not found.",405:"Method not allowed.",409:"Resource already exists",415:"Unsupported media type.",500:"Server error. Try again."},F=e=>{var t,n;if(!e)return Promise.reject("request options object required");if(!e.url&&!e.path)return console.warn("Need either a url or a path"),Promise.reject("Need either a url or a path");let r=(t=e.method)!==null&&t!==void 0?t:fn.GET,o=(function(m){if(m.url)return m.url;if(m.path)return(function(v){return z.endpoint.endsWith("/")?z.endpoint+(v.startsWith("/")?v.slice(1):v):z.endpoint+(v.startsWith("/")?v:"/"+v)})(m.path)})(e),c=(n=e.auth)!==null&&n!==void 0?n:ch((function(){const m=z.storageStrategy.get();return m?.access_token||z.accessToken||Ce.access_token})());o=(function(m,v){const R=(function(ne={}){const oe=Object.keys(ne);if(!oe.length)return[];let me=[];for(const ce of oe){const ye=ne[ce];ye&&Array.isArray(ye)?me=me.concat(ye.filter(Boolean).map((Ve=>`${ce}=${Ve}`))):ye&&(me=me.concat(`${ce}=${ye}`))}return me})(v);if(!R.length)return m;const k=R.filter(Boolean).join("&"),M=h0.test(m),D=m.indexOf("?")>-1?M?"&":"":"?";return m+D+k})(o,e.queryParams);const{headers:l,data:u}=(function(m,v){const{headers:R={},method:k}=m;let{data:M}=m;const D=new gh.Headers;for(const oe in R)R[oe]&&D.append(oe,R[oe]);v&&D.append("Authorization",v);const ne=Nl();return ne&&D.append("accept-language",ne),k!=="POST"&&k!=="PATCH"&&k!=="PUT"||R.hasOwnProperty("Content-Type")||(D.append("Content-Type","application/json"),m.data&&(M=JSON.stringify(m.data))),{headers:D,data:M}})(e,c);return Sl(o,{method:r,body:u,headers:l}).then((m=>{if(m.status>=300)return(function(v){let R;return v.text().then((k=>{console.error(k),R=k;try{R=JSON.parse(k)}catch(M){console.error("Error while parsing response text as json",M)}})).finally((()=>Promise.reject({status:v.status,message:v.status>=500?kh[500]:kh[v.status],errorDetail:R})))})(m);{const v=m.headers.get("content-type");return!e.returnRawResponse&&v&&v.indexOf("application/json")!==-1?m.json():m}}))},h0=new RegExp(/\?\S+=\S+/),ao=e=>t=>F(Object.assign(Object.assign({},t),{method:e}));F.get=ao(fn.GET),F.post=ao(fn.POST),F.put=ao(fn.PUT),F.patch=ao(fn.PATCH),F.delete=ao(fn.DELETE);const Pe=(e,t)=>t&&encodeURI(t.replace(/{(.*?)}/g,e)),lo=(e,t)=>e?Sl(e).then((n=>{const r=n.status===404,o=n.status===403,c=t==="Room"&&n.status>202;if(r||c||o)return Promise.reject(`${t} resource not found. Check ${t} Id.
|
|
5
|
+
Read more: https://www.npmjs.com/package/@livelike/engagementsdk`);{const l=n.headers.get("content-type");return l&&l.indexOf("application/json")!==-1?n.json():void 0}})):Promise.reject(`${t} url missing.`),Ls={program:e=>lo(Pe(e,z.programUrlTemplate),"Program"),app:e=>lo(encodeURI(`${z.endpoint}applications/${e}/`),"Client"),chatRoom:e=>lo(Pe(e,z.chatUrlTemplate),"Room"),leaderboard:e=>lo(Pe(e,z.leaderboardUrlTemplate),"Leaderboard"),leaderboardEntryDetail:(e,t)=>lo(Pe(t,e),"Leaderboard Entry")},Ul=(e,t,n)=>e[t]?Promise.resolve(e[t]):Ls[n](t).then((r=>(e[t]=r,r))).catch((r=>Promise.reject(r))),pe=()=>Ul(z.appResource,z.clientId,"app"),Rt=e=>Ul(z.chatRooms,e,"chatRoom"),Ii=e=>Ul(z.progResource,e,"program"),jl=e=>new Promise(((t,n)=>z.chatRooms&&z.chatRooms[e]&&z.chatRooms[e].channels?t(z.chatRooms[e].channels.chat.pubnub):Rt(e).then((r=>t(r.channels.chat.pubnub))).catch((r=>n(r))))),p0=e=>new Promise(((t,n)=>z.chatRooms&&z.chatRooms[e]&&z.chatRooms[e].channels?t(z.chatRooms[e].channels.control.pubnub):Rt(e).then((r=>t(r.channels.control.pubnub))).catch((r=>n(r)))));function ke(e,t,n){let r={next:e,prev:null};const o=c=>r[c]?t(r[c]).then((l=>(r={next:l.next,prev:l.previous},Promise.resolve({value:n(l),done:!l.next})))):Promise.resolve({done:!0});return{[Symbol.asyncIterator]:()=>({next:()=>o("next"),previous:()=>o("prev")}),next:()=>o("next"),previous:()=>o("prev")}}const Ee=(e,t)=>t.next().then((n=>{let r={count:n.value.count,iterator:t,next:t.next,previous:t.previous,done:n.done};return e.forEach((o=>{r[o]=n.value[o]})),r})),$s=":";var Eh={exports:{}};Eh.exports=(function(){var e=function(s,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,d){a.__proto__=d}||function(a,d){for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(a[h]=d[h])},e(s,i)};function t(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=s}e(s,i),s.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}var n=function(){return n=Object.assign||function(s){for(var i,a=1,d=arguments.length;a<d;a++)for(var h in i=arguments[a])Object.prototype.hasOwnProperty.call(i,h)&&(s[h]=i[h]);return s},n.apply(this,arguments)};function r(s,i){var a={};for(var d in s)Object.prototype.hasOwnProperty.call(s,d)&&i.indexOf(d)<0&&(a[d]=s[d]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var h=0;for(d=Object.getOwnPropertySymbols(s);h<d.length;h++)i.indexOf(d[h])<0&&Object.prototype.propertyIsEnumerable.call(s,d[h])&&(a[d[h]]=s[d[h]])}return a}function o(s,i,a,d){return new(a||(a=Promise))((function(h,p){function g(_){try{b(d.next(_))}catch(w){p(w)}}function f(_){try{b(d.throw(_))}catch(w){p(w)}}function b(_){var w;_.done?h(_.value):(w=_.value,w instanceof a?w:new a((function(y){y(w)}))).then(g,f)}b((d=d.apply(s,[])).next())}))}function c(s,i){var a,d,h,p,g={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]};return p={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function f(b){return function(_){return(function(w){if(a)throw new TypeError("Generator is already executing.");for(;g;)try{if(a=1,d&&(h=2&w[0]?d.return:w[0]?d.throw||((h=d.return)&&h.call(d),0):d.next)&&!(h=h.call(d,w[1])).done)return h;switch(d=0,h&&(w=[2&w[0],h.value]),w[0]){case 0:case 1:h=w;break;case 4:return g.label++,{value:w[1],done:!1};case 5:g.label++,d=w[1],w=[0];continue;case 7:w=g.ops.pop(),g.trys.pop();continue;default:if(!((h=(h=g.trys).length>0&&h[h.length-1])||w[0]!==6&&w[0]!==2)){g=0;continue}if(w[0]===3&&(!h||w[1]>h[0]&&w[1]<h[3])){g.label=w[1];break}if(w[0]===6&&g.label<h[1]){g.label=h[1],h=w;break}if(h&&g.label<h[2]){g.label=h[2],g.ops.push(w);break}h[2]&&g.ops.pop(),g.trys.pop();continue}w=i.call(s,g)}catch(y){w=[6,y],d=0}finally{a=h=0}if(5&w[0])throw w[1];return{value:w[0]?w[1]:void 0,done:!0}})([b,_])}}}function l(s){var i=typeof Symbol=="function"&&Symbol.iterator,a=i&&s[i],d=0;if(a)return a.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&d>=s.length&&(s=void 0),{value:s&&s[d++],done:!s}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(s,i){var a=typeof Symbol=="function"&&s[Symbol.iterator];if(!a)return s;var d,h,p=a.call(s),g=[];try{for(;(i===void 0||i-- >0)&&!(d=p.next()).done;)g.push(d.value)}catch(f){h={error:f}}finally{try{d&&!d.done&&(a=p.return)&&a.call(p)}finally{if(h)throw h.error}}return g}function m(s,i,a){if(arguments.length===2)for(var d,h=0,p=i.length;h<p;h++)!d&&h in i||(d||(d=Array.prototype.slice.call(i,0,h)),d[h]=i[h]);return s.concat(d||Array.prototype.slice.call(i))}var v=typeof globalThis<"u"?globalThis:typeof window<"u"?window:Rs!==void 0?Rs:typeof self<"u"?self:{};function R(s){if(s.__esModule)return s;var i=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(s).forEach((function(a){var d=Object.getOwnPropertyDescriptor(s,a);Object.defineProperty(i,a,d.get?d:{enumerable:!0,get:function(){return s[a]}})})),i}var k={exports:{}};(function(s){(function(i,a){var d=Math.pow(2,-24),h=Math.pow(2,32),p=Math.pow(2,53),g={encode:function(f){var b,_=new ArrayBuffer(256),w=new DataView(_),y=0;function A(te){for(var Q=_.byteLength,T=y+te;Q<T;)Q*=2;if(Q!==_.byteLength){var N=w;_=new ArrayBuffer(Q),w=new DataView(_);for(var L=y+3>>2,W=0;W<L;++W)w.setUint32(4*W,N.getUint32(4*W))}return b=te,w}function E(){y+=b}function S(te){E(A(1).setUint8(y,te))}function P(te){for(var Q=A(te.length),T=0;T<te.length;++T)Q.setUint8(y+T,te[T]);E()}function O(te,Q){Q<24?S(te<<5|Q):Q<256?(S(te<<5|24),S(Q)):Q<65536?(S(te<<5|25),(function(T){E(A(2).setUint16(y,T))})(Q)):Q<4294967296?(S(te<<5|26),(function(T){E(A(4).setUint32(y,T))})(Q)):(S(te<<5|27),(function(T){var N=T%h,L=(T-N)/h,W=A(8);W.setUint32(y,L),W.setUint32(y+4,N),E()})(Q))}if((function te(Q){var T;if(Q===!1)return S(244);if(Q===!0)return S(245);if(Q===null)return S(246);if(Q===a)return S(247);switch(typeof Q){case"number":if(Math.floor(Q)===Q){if(0<=Q&&Q<=p)return O(0,Q);if(-p<=Q&&Q<0)return O(1,-(Q+1))}return S(251),(function(x){E(A(8).setFloat64(y,x))})(Q);case"string":var N=[];for(T=0;T<Q.length;++T){var L=Q.charCodeAt(T);L<128?N.push(L):L<2048?(N.push(192|L>>6),N.push(128|63&L)):L<55296?(N.push(224|L>>12),N.push(128|L>>6&63),N.push(128|63&L)):(L=(1023&L)<<10,L|=1023&Q.charCodeAt(++T),L+=65536,N.push(240|L>>18),N.push(128|L>>12&63),N.push(128|L>>6&63),N.push(128|63&L))}return O(3,N.length),P(N);default:var W;if(Array.isArray(Q))for(O(4,W=Q.length),T=0;T<W;++T)te(Q[T]);else if(Q instanceof Uint8Array)O(2,Q.length),P(Q);else{var V=Object.keys(Q);for(O(5,W=V.length),T=0;T<W;++T){var U=V[T];te(U),te(Q[U])}}}})(f),"slice"in _)return _.slice(0,y);for(var $=new ArrayBuffer(y),G=new DataView($),re=0;re<y;++re)G.setUint8(re,w.getUint8(re));return $},decode:function(f,b,_){var w=new DataView(f),y=0;function A(T,N){return y+=N,T}function E(T){return A(new Uint8Array(f,y,T),T)}function S(){return A(w.getUint8(y),1)}function P(){return A(w.getUint16(y),2)}function O(){return A(w.getUint32(y),4)}function $(){return w.getUint8(y)===255&&(y+=1,!0)}function G(T){if(T<24)return T;if(T===24)return S();if(T===25)return P();if(T===26)return O();if(T===27)return O()*h+O();if(T===31)return-1;throw"Invalid length encoding"}function re(T){var N=S();if(N===255)return-1;var L=G(31&N);if(L<0||N>>5!==T)throw"Invalid indefinite length element";return L}function te(T,N){for(var L=0;L<N;++L){var W=S();128&W&&(W<224?(W=(31&W)<<6|63&S(),N-=1):W<240?(W=(15&W)<<12|(63&S())<<6|63&S(),N-=2):(W=(15&W)<<18|(63&S())<<12|(63&S())<<6|63&S(),N-=3)),W<65536?T.push(W):(W-=65536,T.push(55296|W>>10),T.push(56320|1023&W))}}typeof b!="function"&&(b=function(T){return T}),typeof _!="function"&&(_=function(){return a});var Q=(function T(){var N,L,W=S(),V=W>>5,U=31&W;if(V===7)switch(U){case 25:return(function(){var qe=new ArrayBuffer(4),Ge=new DataView(qe),Rn=P(),yi=32768&Rn,$t=31744&Rn,hn=1023&Rn;if($t===31744)$t=261120;else if($t!==0)$t+=114688;else if(hn!==0)return hn*d;return Ge.setUint32(0,yi<<16|$t<<13|hn<<13),Ge.getFloat32(0)})();case 26:return A(w.getFloat32(y),4);case 27:return A(w.getFloat64(y),8)}if((L=G(U))<0&&(V<2||6<V))throw"Invalid length";switch(V){case 0:return L;case 1:return-1-L;case 2:if(L<0){for(var x=[],J=0;(L=re(V))>=0;)J+=L,x.push(E(L));var j=new Uint8Array(J),H=0;for(N=0;N<x.length;++N)j.set(x[N],H),H+=x[N].length;return j}return E(L);case 3:var Z=[];if(L<0)for(;(L=re(V))>=0;)te(Z,L);else te(Z,L);return String.fromCharCode.apply(null,Z);case 4:var ie;if(L<0)for(ie=[];!$();)ie.push(T());else for(ie=new Array(L),N=0;N<L;++N)ie[N]=T();return ie;case 5:var Me={};for(N=0;N<L||L<0&&!$();++N)Me[T()]=T();return Me;case 6:return b(T(),L);case 7:switch(L){case 20:return!1;case 21:return!0;case 22:return null;case 23:return a;default:return _(L)}}})();if(y!==f.byteLength)throw"Remaining bytes";return Q}};s.exports?s.exports=g:i.CBOR||(i.CBOR=g)})(v)})(k);var M=k.exports,D={exports:{}};(function(s,i){(function(a){var d="0.1.0",h={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};function p(){var f,b,_="";for(f=0;f<32;f++)b=16*Math.random()|0,f!==8&&f!==12&&f!==16&&f!==20||(_+="-"),_+=(f===12?4:f===16?3&b|8:b).toString(16);return _}function g(f,b){var _=h[b||"all"];return _&&_.test(f)||!1}p.isUUID=g,p.VERSION=d,a.uuid=p,a.isUUID=g})(i),s!==null&&(s.exports=i.uuid)})(D,D.exports);var ne=D.exports,oe=function(){return ne.uuid?ne.uuid():ne()},me=(function(){function s(i){var a,d,h,p,g=i.setup;if(this._PNSDKSuffix={},this.instanceId="pn-".concat(oe()),this.secretKey=g.secretKey||g.secret_key,this.subscribeKey=g.subscribeKey||g.subscribe_key,this.publishKey=g.publishKey||g.publish_key,this.sdkName=g.sdkName,this.sdkFamily=g.sdkFamily,this.partnerId=g.partnerId,this.setAuthKey(g.authKey),this.cryptoModule=g.cryptoModule,this.setFilterExpression(g.filterExpression),typeof g.origin!="string"&&!Array.isArray(g.origin)&&g.origin!==void 0)throw new Error("Origin must be either undefined, a string or a list of strings.");if(this.origin=g.origin||Array.from({length:20},(function(f,b){return"ps".concat(b+1,".pndsn.com")})),this.secure=g.ssl||!1,this.restore=g.restore||!1,this.proxy=g.proxy,this.keepAlive=g.keepAlive,this.keepAliveSettings=g.keepAliveSettings,this.autoNetworkDetection=g.autoNetworkDetection||!1,this.dedupeOnSubscribe=g.dedupeOnSubscribe||!1,this.maximumCacheSize=g.maximumCacheSize||100,this.customEncrypt=g.customEncrypt,this.customDecrypt=g.customDecrypt,this.fileUploadPublishRetryLimit=(a=g.fileUploadPublishRetryLimit)!==null&&a!==void 0?a:5,this.useRandomIVs=(d=g.useRandomIVs)===null||d===void 0||d,this.enableEventEngine=(h=g.enableEventEngine)!==null&&h!==void 0&&h,this.maintainPresenceState=(p=g.maintainPresenceState)===null||p===void 0||p,typeof location<"u"&&location.protocol==="https:"&&(this.secure=!0),this.logVerbosity=g.logVerbosity||!1,this.suppressLeaveEvents=g.suppressLeaveEvents||!1,this.announceFailedHeartbeats=g.announceFailedHeartbeats||!0,this.announceSuccessfulHeartbeats=g.announceSuccessfulHeartbeats||!1,this.useInstanceId=g.useInstanceId||!1,this.useRequestId=g.useRequestId||!1,this.requestMessageCountThreshold=g.requestMessageCountThreshold,g.retryConfiguration&&this._setRetryConfiguration(g.retryConfiguration),this.setTransactionTimeout(g.transactionalRequestTimeout||15e3),this.setSubscribeTimeout(g.subscribeRequestTimeout||31e4),this.setSendBeaconConfig(g.useSendBeacon||!0),g.presenceTimeout?this.setPresenceTimeout(g.presenceTimeout):this._presenceTimeout=300,g.heartbeatInterval!=null&&this.setHeartbeatInterval(g.heartbeatInterval),typeof g.userId=="string"){if(typeof g.uuid=="string")throw new Error("Only one of the following configuration options has to be provided: `uuid` or `userId`");this.setUserId(g.userId)}else{if(typeof g.uuid!="string")throw new Error("One of the following configuration options has to be provided: `uuid` or `userId`");this.setUUID(g.uuid)}this.setCipherKey(g.cipherKey,g)}return s.prototype.getAuthKey=function(){return this.authKey},s.prototype.setAuthKey=function(i){return this.authKey=i,this},s.prototype.setCipherKey=function(i,a,d){var h;return this.cipherKey=i,this.cipherKey&&(this.cryptoModule=(h=a.cryptoModule)!==null&&h!==void 0?h:a.initCryptoModule({cipherKey:this.cipherKey,useRandomIVs:this.useRandomIVs}),d&&(d.cryptoModule=this.cryptoModule)),this},s.prototype.getUUID=function(){return this.UUID},s.prototype.setUUID=function(i){if(!i||typeof i!="string"||i.trim().length===0)throw new Error("Missing uuid parameter. Provide a valid string uuid");return this.UUID=i,this},s.prototype.getUserId=function(){return this.UUID},s.prototype.setUserId=function(i){if(!i||typeof i!="string"||i.trim().length===0)throw new Error("Missing or invalid userId parameter. Provide a valid string userId");return this.UUID=i,this},s.prototype.getFilterExpression=function(){return this.filterExpression},s.prototype.setFilterExpression=function(i){return this.filterExpression=i,this},s.prototype.getPresenceTimeout=function(){return this._presenceTimeout},s.prototype.setPresenceTimeout=function(i){return i>=20?this._presenceTimeout=i:(this._presenceTimeout=20,console.log("WARNING: Presence timeout is less than the minimum. Using minimum value: ",this._presenceTimeout)),this.setHeartbeatInterval(this._presenceTimeout/2-1),this},s.prototype.setProxy=function(i){this.proxy=i},s.prototype.getHeartbeatInterval=function(){return this._heartbeatInterval},s.prototype.setHeartbeatInterval=function(i){return this._heartbeatInterval=i,this},s.prototype.getSubscribeTimeout=function(){return this._subscribeRequestTimeout},s.prototype.setSubscribeTimeout=function(i){return this._subscribeRequestTimeout=i,this},s.prototype.getTransactionTimeout=function(){return this._transactionalRequestTimeout},s.prototype.setTransactionTimeout=function(i){return this._transactionalRequestTimeout=i,this},s.prototype.isSendBeaconEnabled=function(){return this._useSendBeacon},s.prototype.setSendBeaconConfig=function(i){return this._useSendBeacon=i,this},s.prototype.getVersion=function(){return"7.6.3"},s.prototype._setRetryConfiguration=function(i){if(i.minimumdelay<2)throw new Error("Minimum delay can not be set less than 2 seconds for retry");if(i.maximumDelay>150)throw new Error("Maximum delay can not be set more than 150 seconds for retry");if(i.maximumDelay&&maximumRetry>6)throw new Error("Maximum retry for exponential retry policy can not be more than 6");if(i.maximumRetry>10)throw new Error("Maximum retry for linear retry policy can not be more than 10");this.retryConfiguration=i},s.prototype._addPnsdkSuffix=function(i,a){this._PNSDKSuffix[i]=a},s.prototype._getPnsdkSuffix=function(i){var a=this;return Object.keys(this._PNSDKSuffix).reduce((function(d,h){return d+i+a._PNSDKSuffix[h]}),"")},s})();function ce(s){var i=s.replace(/==?$/,""),a=Math.floor(i.length/4*3),d=new ArrayBuffer(a),h=new Uint8Array(d),p=0;function g(){var P=i.charAt(p++),O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(P);if(O===-1)throw new Error("Illegal character at ".concat(p,": ").concat(i.charAt(p-1)));return O}for(var f=0;f<a;f+=3){var b=g(),_=g(),w=g(),y=g(),A=(63&b)<<2|_>>4,E=(15&_)<<4|w>>2,S=(3&w)<<6|y>>0;h[f]=A,w!=64&&(h[f+1]=E),y!=64&&(h[f+2]=S)}return d}function ye(s){for(var i,a="",d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=new Uint8Array(s),p=h.byteLength,g=p%3,f=p-g,b=0;b<f;b+=3)a+=d[(16515072&(i=h[b]<<16|h[b+1]<<8|h[b+2]))>>18]+d[(258048&i)>>12]+d[(4032&i)>>6]+d[63&i];return g==1?a+=d[(252&(i=h[f]))>>2]+d[(3&i)<<4]+"==":g==2&&(a+=d[(64512&(i=h[f]<<8|h[f+1]))>>10]+d[(1008&i)>>4]+d[(15&i)<<2]+"="),a}var Ve,li,et,St,Mt,dt=dt||(function(s,i){var a={},d=a.lib={},h=function(){},p=d.Base={extend:function(E){h.prototype=this;var S=new h;return E&&S.mixIn(E),S.hasOwnProperty("init")||(S.init=function(){S.$super.init.apply(this,arguments)}),S.init.prototype=S,S.$super=this,S},create:function(){var E=this.extend();return E.init.apply(E,arguments),E},init:function(){},mixIn:function(E){for(var S in E)E.hasOwnProperty(S)&&(this[S]=E[S]);E.hasOwnProperty("toString")&&(this.toString=E.toString)},clone:function(){return this.init.prototype.extend(this)}},g=d.WordArray=p.extend({init:function(E,S){E=this.words=E||[],this.sigBytes=S??4*E.length},toString:function(E){return(E||b).stringify(this)},concat:function(E){var S=this.words,P=E.words,O=this.sigBytes;if(E=E.sigBytes,this.clamp(),O%4)for(var $=0;$<E;$++)S[O+$>>>2]|=(P[$>>>2]>>>24-$%4*8&255)<<24-(O+$)%4*8;else if(65535<P.length)for($=0;$<E;$+=4)S[O+$>>>2]=P[$>>>2];else S.push.apply(S,P);return this.sigBytes+=E,this},clamp:function(){var E=this.words,S=this.sigBytes;E[S>>>2]&=4294967295<<32-S%4*8,E.length=s.ceil(S/4)},clone:function(){var E=p.clone.call(this);return E.words=this.words.slice(0),E},random:function(E){for(var S=[],P=0;P<E;P+=4)S.push(4294967296*s.random()|0);return new g.init(S,E)}}),f=a.enc={},b=f.Hex={stringify:function(E){var S=E.words;E=E.sigBytes;for(var P=[],O=0;O<E;O++){var $=S[O>>>2]>>>24-O%4*8&255;P.push(($>>>4).toString(16)),P.push((15&$).toString(16))}return P.join("")},parse:function(E){for(var S=E.length,P=[],O=0;O<S;O+=2)P[O>>>3]|=parseInt(E.substr(O,2),16)<<24-O%8*4;return new g.init(P,S/2)}},_=f.Latin1={stringify:function(E){var S=E.words;E=E.sigBytes;for(var P=[],O=0;O<E;O++)P.push(String.fromCharCode(S[O>>>2]>>>24-O%4*8&255));return P.join("")},parse:function(E){for(var S=E.length,P=[],O=0;O<S;O++)P[O>>>2]|=(255&E.charCodeAt(O))<<24-O%4*8;return new g.init(P,S)}},w=f.Utf8={stringify:function(E){try{return decodeURIComponent(escape(_.stringify(E)))}catch{throw Error("Malformed UTF-8 data")}},parse:function(E){return _.parse(unescape(encodeURIComponent(E)))}},y=d.BufferedBlockAlgorithm=p.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(E){typeof E=="string"&&(E=w.parse(E)),this._data.concat(E),this._nDataBytes+=E.sigBytes},_process:function(E){var S=this._data,P=S.words,O=S.sigBytes,$=this.blockSize,G=O/(4*$);if(E=(G=E?s.ceil(G):s.max((0|G)-this._minBufferSize,0))*$,O=s.min(4*E,O),E){for(var re=0;re<E;re+=$)this._doProcessBlock(P,re);re=P.splice(0,E),S.sigBytes-=O}return new g.init(re,O)},clone:function(){var E=p.clone.call(this);return E._data=this._data.clone(),E},_minBufferSize:0});d.Hasher=y.extend({cfg:p.extend(),init:function(E){this.cfg=this.cfg.extend(E),this.reset()},reset:function(){y.reset.call(this),this._doReset()},update:function(E){return this._append(E),this._process(),this},finalize:function(E){return E&&this._append(E),this._doFinalize()},blockSize:16,_createHelper:function(E){return function(S,P){return new E.init(P).finalize(S)}},_createHmacHelper:function(E){return function(S,P){return new A.HMAC.init(E,P).finalize(S)}}});var A=a.algo={};return a})(Math);(function(s){for(var i=dt,a=(h=i.lib).WordArray,d=h.Hasher,h=i.algo,p=[],g=[],f=function(S){return 4294967296*(S-(0|S))|0},b=2,_=0;64>_;){var w;e:{w=b;for(var y=s.sqrt(w),A=2;A<=y;A++)if(!(w%A)){w=!1;break e}w=!0}w&&(8>_&&(p[_]=f(s.pow(b,.5))),g[_]=f(s.pow(b,1/3)),_++),b++}var E=[];h=h.SHA256=d.extend({_doReset:function(){this._hash=new a.init(p.slice(0))},_doProcessBlock:function(S,P){for(var O=this._hash.words,$=O[0],G=O[1],re=O[2],te=O[3],Q=O[4],T=O[5],N=O[6],L=O[7],W=0;64>W;W++){if(16>W)E[W]=0|S[P+W];else{var V=E[W-15],U=E[W-2];E[W]=((V<<25|V>>>7)^(V<<14|V>>>18)^V>>>3)+E[W-7]+((U<<15|U>>>17)^(U<<13|U>>>19)^U>>>10)+E[W-16]}V=L+((Q<<26|Q>>>6)^(Q<<21|Q>>>11)^(Q<<7|Q>>>25))+(Q&T^~Q&N)+g[W]+E[W],U=(($<<30|$>>>2)^($<<19|$>>>13)^($<<10|$>>>22))+($&G^$&re^G&re),L=N,N=T,T=Q,Q=te+V|0,te=re,re=G,G=$,$=V+U|0}O[0]=O[0]+$|0,O[1]=O[1]+G|0,O[2]=O[2]+re|0,O[3]=O[3]+te|0,O[4]=O[4]+Q|0,O[5]=O[5]+T|0,O[6]=O[6]+N|0,O[7]=O[7]+L|0},_doFinalize:function(){var S=this._data,P=S.words,O=8*this._nDataBytes,$=8*S.sigBytes;return P[$>>>5]|=128<<24-$%32,P[14+($+64>>>9<<4)]=s.floor(O/4294967296),P[15+($+64>>>9<<4)]=O,S.sigBytes=4*P.length,this._process(),this._hash},clone:function(){var S=d.clone.call(this);return S._hash=this._hash.clone(),S}}),i.SHA256=d._createHelper(h),i.HmacSHA256=d._createHmacHelper(h)})(Math),li=(Ve=dt).enc.Utf8,Ve.algo.HMAC=Ve.lib.Base.extend({init:function(s,i){s=this._hasher=new s.init,typeof i=="string"&&(i=li.parse(i));var a=s.blockSize,d=4*a;i.sigBytes>d&&(i=s.finalize(i)),i.clamp();for(var h=this._oKey=i.clone(),p=this._iKey=i.clone(),g=h.words,f=p.words,b=0;b<a;b++)g[b]^=1549556828,f[b]^=909522486;h.sigBytes=p.sigBytes=d,this.reset()},reset:function(){var s=this._hasher;s.reset(),s.update(this._iKey)},update:function(s){return this._hasher.update(s),this},finalize:function(s){var i=this._hasher;return s=i.finalize(s),i.reset(),i.finalize(this._oKey.clone().concat(s))}}),St=(et=dt).lib.WordArray,et.enc.Base64={stringify:function(s){var i=s.words,a=s.sigBytes,d=this._map;s.clamp(),s=[];for(var h=0;h<a;h+=3)for(var p=(i[h>>>2]>>>24-h%4*8&255)<<16|(i[h+1>>>2]>>>24-(h+1)%4*8&255)<<8|i[h+2>>>2]>>>24-(h+2)%4*8&255,g=0;4>g&&h+.75*g<a;g++)s.push(d.charAt(p>>>6*(3-g)&63));if(i=d.charAt(64))for(;s.length%4;)s.push(i);return s.join("")},parse:function(s){var i=s.length,a=this._map;(d=a.charAt(64))&&(d=s.indexOf(d))!=-1&&(i=d);for(var d=[],h=0,p=0;p<i;p++)if(p%4){var g=a.indexOf(s.charAt(p-1))<<p%4*2,f=a.indexOf(s.charAt(p))>>>6-p%4*2;d[h>>>2]|=(g|f)<<24-h%4*8,h++}return St.create(d,h)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},(function(s){function i(y,A,E,S,P,O,$){return((y=y+(A&E|~A&S)+P+$)<<O|y>>>32-O)+A}function a(y,A,E,S,P,O,$){return((y=y+(A&S|E&~S)+P+$)<<O|y>>>32-O)+A}function d(y,A,E,S,P,O,$){return((y=y+(A^E^S)+P+$)<<O|y>>>32-O)+A}function h(y,A,E,S,P,O,$){return((y=y+(E^(A|~S))+P+$)<<O|y>>>32-O)+A}for(var p=dt,g=(b=p.lib).WordArray,f=b.Hasher,b=p.algo,_=[],w=0;64>w;w++)_[w]=4294967296*s.abs(s.sin(w+1))|0;b=b.MD5=f.extend({_doReset:function(){this._hash=new g.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(y,A){for(var E=0;16>E;E++){var S=y[P=A+E];y[P]=16711935&(S<<8|S>>>24)|4278255360&(S<<24|S>>>8)}E=this._hash.words;var P=y[A+0],O=(S=y[A+1],y[A+2]),$=y[A+3],G=y[A+4],re=y[A+5],te=y[A+6],Q=y[A+7],T=y[A+8],N=y[A+9],L=y[A+10],W=y[A+11],V=y[A+12],U=y[A+13],x=y[A+14],J=y[A+15],j=i(j=E[0],ie=E[1],Z=E[2],H=E[3],P,7,_[0]),H=i(H,j,ie,Z,S,12,_[1]),Z=i(Z,H,j,ie,O,17,_[2]),ie=i(ie,Z,H,j,$,22,_[3]);j=i(j,ie,Z,H,G,7,_[4]),H=i(H,j,ie,Z,re,12,_[5]),Z=i(Z,H,j,ie,te,17,_[6]),ie=i(ie,Z,H,j,Q,22,_[7]),j=i(j,ie,Z,H,T,7,_[8]),H=i(H,j,ie,Z,N,12,_[9]),Z=i(Z,H,j,ie,L,17,_[10]),ie=i(ie,Z,H,j,W,22,_[11]),j=i(j,ie,Z,H,V,7,_[12]),H=i(H,j,ie,Z,U,12,_[13]),Z=i(Z,H,j,ie,x,17,_[14]),j=a(j,ie=i(ie,Z,H,j,J,22,_[15]),Z,H,S,5,_[16]),H=a(H,j,ie,Z,te,9,_[17]),Z=a(Z,H,j,ie,W,14,_[18]),ie=a(ie,Z,H,j,P,20,_[19]),j=a(j,ie,Z,H,re,5,_[20]),H=a(H,j,ie,Z,L,9,_[21]),Z=a(Z,H,j,ie,J,14,_[22]),ie=a(ie,Z,H,j,G,20,_[23]),j=a(j,ie,Z,H,N,5,_[24]),H=a(H,j,ie,Z,x,9,_[25]),Z=a(Z,H,j,ie,$,14,_[26]),ie=a(ie,Z,H,j,T,20,_[27]),j=a(j,ie,Z,H,U,5,_[28]),H=a(H,j,ie,Z,O,9,_[29]),Z=a(Z,H,j,ie,Q,14,_[30]),j=d(j,ie=a(ie,Z,H,j,V,20,_[31]),Z,H,re,4,_[32]),H=d(H,j,ie,Z,T,11,_[33]),Z=d(Z,H,j,ie,W,16,_[34]),ie=d(ie,Z,H,j,x,23,_[35]),j=d(j,ie,Z,H,S,4,_[36]),H=d(H,j,ie,Z,G,11,_[37]),Z=d(Z,H,j,ie,Q,16,_[38]),ie=d(ie,Z,H,j,L,23,_[39]),j=d(j,ie,Z,H,U,4,_[40]),H=d(H,j,ie,Z,P,11,_[41]),Z=d(Z,H,j,ie,$,16,_[42]),ie=d(ie,Z,H,j,te,23,_[43]),j=d(j,ie,Z,H,N,4,_[44]),H=d(H,j,ie,Z,V,11,_[45]),Z=d(Z,H,j,ie,J,16,_[46]),j=h(j,ie=d(ie,Z,H,j,O,23,_[47]),Z,H,P,6,_[48]),H=h(H,j,ie,Z,Q,10,_[49]),Z=h(Z,H,j,ie,x,15,_[50]),ie=h(ie,Z,H,j,re,21,_[51]),j=h(j,ie,Z,H,V,6,_[52]),H=h(H,j,ie,Z,$,10,_[53]),Z=h(Z,H,j,ie,L,15,_[54]),ie=h(ie,Z,H,j,S,21,_[55]),j=h(j,ie,Z,H,T,6,_[56]),H=h(H,j,ie,Z,J,10,_[57]),Z=h(Z,H,j,ie,te,15,_[58]),ie=h(ie,Z,H,j,U,21,_[59]),j=h(j,ie,Z,H,G,6,_[60]),H=h(H,j,ie,Z,W,10,_[61]),Z=h(Z,H,j,ie,O,15,_[62]),ie=h(ie,Z,H,j,N,21,_[63]),E[0]=E[0]+j|0,E[1]=E[1]+ie|0,E[2]=E[2]+Z|0,E[3]=E[3]+H|0},_doFinalize:function(){var y=this._data,A=y.words,E=8*this._nDataBytes,S=8*y.sigBytes;A[S>>>5]|=128<<24-S%32;var P=s.floor(E/4294967296);for(A[15+(S+64>>>9<<4)]=16711935&(P<<8|P>>>24)|4278255360&(P<<24|P>>>8),A[14+(S+64>>>9<<4)]=16711935&(E<<8|E>>>24)|4278255360&(E<<24|E>>>8),y.sigBytes=4*(A.length+1),this._process(),A=(y=this._hash).words,E=0;4>E;E++)S=A[E],A[E]=16711935&(S<<8|S>>>24)|4278255360&(S<<24|S>>>8);return y},clone:function(){var y=f.clone.call(this);return y._hash=this._hash.clone(),y}}),p.MD5=f._createHelper(b),p.HmacMD5=f._createHmacHelper(b)})(Math),(function(){var s,i=dt,a=(s=i.lib).Base,d=s.WordArray,h=(s=i.algo).EvpKDF=a.extend({cfg:a.extend({keySize:4,hasher:s.MD5,iterations:1}),init:function(p){this.cfg=this.cfg.extend(p)},compute:function(p,g){for(var f=(y=this.cfg).hasher.create(),b=d.create(),_=b.words,w=y.keySize,y=y.iterations;_.length<w;){A&&f.update(A);var A=f.update(p).finalize(g);f.reset();for(var E=1;E<y;E++)A=f.finalize(A),f.reset();b.concat(A)}return b.sigBytes=4*w,b}});i.EvpKDF=function(p,g,f){return h.create(f).compute(p,g)}})(),dt.lib.Cipher||(function(s){var i=(E=dt).lib,a=i.Base,d=i.WordArray,h=i.BufferedBlockAlgorithm,p=E.enc.Base64,g=E.algo.EvpKDF,f=i.Cipher=h.extend({cfg:a.extend(),createEncryptor:function(P,O){return this.create(this._ENC_XFORM_MODE,P,O)},createDecryptor:function(P,O){return this.create(this._DEC_XFORM_MODE,P,O)},init:function(P,O,$){this.cfg=this.cfg.extend($),this._xformMode=P,this._key=O,this.reset()},reset:function(){h.reset.call(this),this._doReset()},process:function(P){return this._append(P),this._process()},finalize:function(P){return P&&this._append(P),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(P){return{encrypt:function(O,$,G){return(typeof $=="string"?S:A).encrypt(P,O,$,G)},decrypt:function(O,$,G){return(typeof $=="string"?S:A).decrypt(P,O,$,G)}}}});i.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var b=E.mode={},_=function(P,O,$){var G=this._iv;G?this._iv=void 0:G=this._prevBlock;for(var re=0;re<$;re++)P[O+re]^=G[re]},w=(i.BlockCipherMode=a.extend({createEncryptor:function(P,O){return this.Encryptor.create(P,O)},createDecryptor:function(P,O){return this.Decryptor.create(P,O)},init:function(P,O){this._cipher=P,this._iv=O}})).extend();w.Encryptor=w.extend({processBlock:function(P,O){var $=this._cipher,G=$.blockSize;_.call(this,P,O,G),$.encryptBlock(P,O),this._prevBlock=P.slice(O,O+G)}}),w.Decryptor=w.extend({processBlock:function(P,O){var $=this._cipher,G=$.blockSize,re=P.slice(O,O+G);$.decryptBlock(P,O),_.call(this,P,O,G),this._prevBlock=re}}),b=b.CBC=w,w=(E.pad={}).Pkcs7={pad:function(P,O){for(var $,G=($=($=4*O)-P.sigBytes%$)<<24|$<<16|$<<8|$,re=[],te=0;te<$;te+=4)re.push(G);$=d.create(re,$),P.concat($)},unpad:function(P){P.sigBytes-=255&P.words[P.sigBytes-1>>>2]}},i.BlockCipher=f.extend({cfg:f.cfg.extend({mode:b,padding:w}),reset:function(){f.reset.call(this);var P=(O=this.cfg).iv,O=O.mode;if(this._xformMode==this._ENC_XFORM_MODE)var $=O.createEncryptor;else $=O.createDecryptor,this._minBufferSize=1;this._mode=$.call(O,this,P&&P.words)},_doProcessBlock:function(P,O){this._mode.processBlock(P,O)},_doFinalize:function(){var P=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){P.pad(this._data,this.blockSize);var O=this._process(!0)}else O=this._process(!0),P.unpad(O);return O},blockSize:4});var y=i.CipherParams=a.extend({init:function(P){this.mixIn(P)},toString:function(P){return(P||this.formatter).stringify(this)}}),A=(b=(E.format={}).OpenSSL={stringify:function(P){var O=P.ciphertext;return((P=P.salt)?d.create([1398893684,1701076831]).concat(P).concat(O):O).toString(p)},parse:function(P){var O=(P=p.parse(P)).words;if(O[0]==1398893684&&O[1]==1701076831){var $=d.create(O.slice(2,4));O.splice(0,4),P.sigBytes-=16}return y.create({ciphertext:P,salt:$})}},i.SerializableCipher=a.extend({cfg:a.extend({format:b}),encrypt:function(P,O,$,G){G=this.cfg.extend(G);var re=P.createEncryptor($,G);return O=re.finalize(O),re=re.cfg,y.create({ciphertext:O,key:$,iv:re.iv,algorithm:P,mode:re.mode,padding:re.padding,blockSize:P.blockSize,formatter:G.format})},decrypt:function(P,O,$,G){return G=this.cfg.extend(G),O=this._parse(O,G.format),P.createDecryptor($,G).finalize(O.ciphertext)},_parse:function(P,O){return typeof P=="string"?O.parse(P,this):P}})),E=(E.kdf={}).OpenSSL={execute:function(P,O,$,G){return G||(G=d.random(8)),P=g.create({keySize:O+$}).compute(P,G),$=d.create(P.words.slice(O),4*$),P.sigBytes=4*O,y.create({key:P,iv:$,salt:G})}},S=i.PasswordBasedCipher=A.extend({cfg:A.cfg.extend({kdf:E}),encrypt:function(P,O,$,G){return $=(G=this.cfg.extend(G)).kdf.execute($,P.keySize,P.ivSize),G.iv=$.iv,(P=A.encrypt.call(this,P,O,$.key,G)).mixIn($),P},decrypt:function(P,O,$,G){return G=this.cfg.extend(G),O=this._parse(O,G.format),$=G.kdf.execute($,P.keySize,P.ivSize,O.salt),G.iv=$.iv,A.decrypt.call(this,P,O,$.key,G)}})})(),(function(){for(var s=dt,i=s.lib.BlockCipher,a=s.algo,d=[],h=[],p=[],g=[],f=[],b=[],_=[],w=[],y=[],A=[],E=[],S=0;256>S;S++)E[S]=128>S?S<<1:S<<1^283;var P=0,O=0;for(S=0;256>S;S++){var $=($=O^O<<1^O<<2^O<<3^O<<4)>>>8^255&$^99;d[P]=$,h[$]=P;var G=E[P],re=E[G],te=E[re],Q=257*E[$]^16843008*$;p[P]=Q<<24|Q>>>8,g[P]=Q<<16|Q>>>16,f[P]=Q<<8|Q>>>24,b[P]=Q,Q=16843009*te^65537*re^257*G^16843008*P,_[$]=Q<<24|Q>>>8,w[$]=Q<<16|Q>>>16,y[$]=Q<<8|Q>>>24,A[$]=Q,P?(P=G^E[E[E[te^G]]],O^=E[E[O]]):P=O=1}var T=[0,1,2,4,8,16,32,64,128,27,54];a=a.AES=i.extend({_doReset:function(){for(var N=(W=this._key).words,L=W.sigBytes/4,W=4*((this._nRounds=L+6)+1),V=this._keySchedule=[],U=0;U<W;U++)if(U<L)V[U]=N[U];else{var x=V[U-1];U%L?6<L&&U%L==4&&(x=d[x>>>24]<<24|d[x>>>16&255]<<16|d[x>>>8&255]<<8|d[255&x]):(x=d[(x=x<<8|x>>>24)>>>24]<<24|d[x>>>16&255]<<16|d[x>>>8&255]<<8|d[255&x],x^=T[U/L|0]<<24),V[U]=V[U-L]^x}for(N=this._invKeySchedule=[],L=0;L<W;L++)U=W-L,x=L%4?V[U]:V[U-4],N[L]=4>L||4>=U?x:_[d[x>>>24]]^w[d[x>>>16&255]]^y[d[x>>>8&255]]^A[d[255&x]]},encryptBlock:function(N,L){this._doCryptBlock(N,L,this._keySchedule,p,g,f,b,d)},decryptBlock:function(N,L){var W=N[L+1];N[L+1]=N[L+3],N[L+3]=W,this._doCryptBlock(N,L,this._invKeySchedule,_,w,y,A,h),W=N[L+1],N[L+1]=N[L+3],N[L+3]=W},_doCryptBlock:function(N,L,W,V,U,x,J,j){for(var H=this._nRounds,Z=N[L]^W[0],ie=N[L+1]^W[1],Me=N[L+2]^W[2],qe=N[L+3]^W[3],Ge=4,Rn=1;Rn<H;Rn++){var yi=V[Z>>>24]^U[ie>>>16&255]^x[Me>>>8&255]^J[255&qe]^W[Ge++],$t=V[ie>>>24]^U[Me>>>16&255]^x[qe>>>8&255]^J[255&Z]^W[Ge++],hn=V[Me>>>24]^U[qe>>>16&255]^x[Z>>>8&255]^J[255&ie]^W[Ge++];qe=V[qe>>>24]^U[Z>>>16&255]^x[ie>>>8&255]^J[255&Me]^W[Ge++],Z=yi,ie=$t,Me=hn}yi=(j[Z>>>24]<<24|j[ie>>>16&255]<<16|j[Me>>>8&255]<<8|j[255&qe])^W[Ge++],$t=(j[ie>>>24]<<24|j[Me>>>16&255]<<16|j[qe>>>8&255]<<8|j[255&Z])^W[Ge++],hn=(j[Me>>>24]<<24|j[qe>>>16&255]<<16|j[Z>>>8&255]<<8|j[255&ie])^W[Ge++],qe=(j[qe>>>24]<<24|j[Z>>>16&255]<<16|j[ie>>>8&255]<<8|j[255&Me])^W[Ge++],N[L]=yi,N[L+1]=$t,N[L+2]=hn,N[L+3]=qe},keySize:8}),s.AES=i._createHelper(a)})(),dt.mode.ECB=((Mt=dt.lib.BlockCipherMode.extend()).Encryptor=Mt.extend({processBlock:function(s,i){this._cipher.encryptBlock(s,i)}}),Mt.Decryptor=Mt.extend({processBlock:function(s,i){this._cipher.decryptBlock(s,i)}}),Mt);var De=dt;function Fa(s){var i,a=[];for(i=0;i<s.length;i+=1)a[i/4|0]|=s[i]<<24-8*i;return De.lib.WordArray.create(a,s.length)}var _t=(function(){function s(i){var a=i.config;this._config=a,this._iv="0123456789012345",this._allowedKeyEncodings=["hex","utf8","base64","binary"],this._allowedKeyLengths=[128,256],this._allowedModes=["ecb","cbc"],this._defaultOptions={encryptKey:!0,keyEncoding:"utf8",keyLength:256,mode:"cbc"}}return s.prototype.HMACSHA256=function(i){return De.HmacSHA256(i,this._config.secretKey).toString(De.enc.Base64)},s.prototype.SHA256=function(i){return De.SHA256(i).toString(De.enc.Hex)},s.prototype._parseOptions=function(i){var a=i||{};return a.hasOwnProperty("encryptKey")||(a.encryptKey=this._defaultOptions.encryptKey),a.hasOwnProperty("keyEncoding")||(a.keyEncoding=this._defaultOptions.keyEncoding),a.hasOwnProperty("keyLength")||(a.keyLength=this._defaultOptions.keyLength),a.hasOwnProperty("mode")||(a.mode=this._defaultOptions.mode),this._allowedKeyEncodings.indexOf(a.keyEncoding.toLowerCase())===-1&&(a.keyEncoding=this._defaultOptions.keyEncoding),this._allowedKeyLengths.indexOf(parseInt(a.keyLength,10))===-1&&(a.keyLength=this._defaultOptions.keyLength),this._allowedModes.indexOf(a.mode.toLowerCase())===-1&&(a.mode=this._defaultOptions.mode),a},s.prototype._decodeKey=function(i,a){return a.keyEncoding==="base64"?De.enc.Base64.parse(i):a.keyEncoding==="hex"?De.enc.Hex.parse(i):i},s.prototype._getPaddedKey=function(i,a){return i=this._decodeKey(i,a),a.encryptKey?De.enc.Utf8.parse(this.SHA256(i).slice(0,32)):i},s.prototype._getMode=function(i){return i.mode==="ecb"?De.mode.ECB:De.mode.CBC},s.prototype._getIV=function(i){return i.mode==="cbc"?De.enc.Utf8.parse(this._iv):null},s.prototype._getRandomIV=function(){return De.lib.WordArray.random(16)},s.prototype.encrypt=function(i,a,d){return this._config.customEncrypt?this._config.customEncrypt(i):this.pnEncrypt(i,a,d)},s.prototype.decrypt=function(i,a,d){return this._config.customDecrypt?this._config.customDecrypt(i):this.pnDecrypt(i,a,d)},s.prototype.pnEncrypt=function(i,a,d){if(!a&&!this._config.cipherKey)return i;d=this._parseOptions(d);var h=this._getMode(d),p=this._getPaddedKey(a||this._config.cipherKey,d);if(this._config.useRandomIVs){var g=this._getRandomIV(),f=De.AES.encrypt(i,p,{iv:g,mode:h}).ciphertext;return g.clone().concat(f.clone()).toString(De.enc.Base64)}var b=this._getIV(d);return De.AES.encrypt(i,p,{iv:b,mode:h}).ciphertext.toString(De.enc.Base64)||i},s.prototype.pnDecrypt=function(i,a,d){if(!a&&!this._config.cipherKey)return i;d=this._parseOptions(d);var h=this._getMode(d),p=this._getPaddedKey(a||this._config.cipherKey,d);if(this._config.useRandomIVs){var g=Fa((_=new Uint8ClampedArray(ce(i))).slice(0,16)),f=Fa(_.slice(16));try{var b=De.AES.decrypt({ciphertext:f},p,{iv:g,mode:h}).toString(De.enc.Utf8);return JSON.parse(b)}catch{return null}}else{g=this._getIV(d);try{var _=De.enc.Base64.parse(i);return b=De.AES.decrypt({ciphertext:_},p,{iv:g,mode:h}).toString(De.enc.Utf8),JSON.parse(b)}catch{return null}}},s})(),Md=(function(){function s(i){var a=i.timeEndpoint;this._timeEndpoint=a}return s.prototype.onReconnection=function(i){this._reconnectionCallback=i},s.prototype.startPolling=function(){this._timeTimer=setInterval(this._performTimeLoop.bind(this),3e3)},s.prototype.stopPolling=function(){clearInterval(this._timeTimer)},s.prototype._performTimeLoop=function(){var i=this;this._timeEndpoint((function(a){a.error||(clearInterval(i._timeTimer),i._reconnectionCallback())}))},s})(),Yo=(function(){function s(i){var a=i.config;this.hashHistory=[],this._config=a}return s.prototype.getKey=function(i){var a=(function(h){var p=0;if(h.length===0)return p;for(var g=0;g<h.length;g+=1)p=(p<<5)-p+h.charCodeAt(g),p&=p;return p})(JSON.stringify(i.payload)).toString(),d=i.publishMetaData.publishTimetoken;return"".concat(d,"-").concat(a)},s.prototype.isDuplicate=function(i){return this.hashHistory.includes(this.getKey(i))},s.prototype.addEntry=function(i){this.hashHistory.length>=this._config.maximumCacheSize&&this.hashHistory.shift(),this.hashHistory.push(this.getKey(i))},s.prototype.clearHistory=function(){this.hashHistory=[]},s})(),B={PNNetworkUpCategory:"PNNetworkUpCategory",PNNetworkDownCategory:"PNNetworkDownCategory",PNNetworkIssuesCategory:"PNNetworkIssuesCategory",PNTimeoutCategory:"PNTimeoutCategory",PNBadRequestCategory:"PNBadRequestCategory",PNAccessDeniedCategory:"PNAccessDeniedCategory",PNUnknownCategory:"PNUnknownCategory",PNReconnectedCategory:"PNReconnectedCategory",PNConnectedCategory:"PNConnectedCategory",PNRequestMessageCountExceededCategory:"PNRequestMessageCountExceededCategory",PNDisconnectedCategory:"PNDisconnectedCategory",PNConnectionErrorCategory:"PNConnectionErrorCategory",PNDisconnectedUnexpectedlyCategory:"PNDisconnectedUnexpectedlyCategory"},le=(function(){function s(i){var a=i.subscribeEndpoint,d=i.leaveEndpoint,h=i.heartbeatEndpoint,p=i.setStateEndpoint,g=i.timeEndpoint,f=i.getFileUrl,b=i.config,_=i.crypto,w=i.listenerManager,y=i.cryptoModule,A=i.eventEmitter;this._listenerManager=w,this._config=b,this._leaveEndpoint=d,this._heartbeatEndpoint=h,this._setStateEndpoint=p,this._subscribeEndpoint=a,this._getFileUrl=f,this._crypto=_,this._cryptoModule=y,this._channels={},this._presenceChannels={},this._heartbeatChannels={},this._heartbeatChannelGroups={},this._channelGroups={},this._presenceChannelGroups={},this._pendingChannelSubscriptions=[],this._pendingChannelGroupSubscriptions=[],this._currentTimetoken=0,this._lastTimetoken=0,this._storedTimetoken=null,this._subscriptionStatusAnnounced=!1,this._isOnline=!0,this._reconnectionManager=new Md({timeEndpoint:g}),this._dedupingManager=new Yo({config:b}),this._cryptoModule&&(this._decoder=new TextDecoder),this._eventEmitter=A}return s.prototype.adaptStateChange=function(i,a){var d=this,h=i.state,p=i.channels,g=p===void 0?[]:p,f=i.channelGroups,b=f===void 0?[]:f,_=i.withHeartbeat,w=_!==void 0&&_;if(g.forEach((function(A){A in d._channels&&(d._channels[A].state=h)})),b.forEach((function(A){A in d._channelGroups&&(d._channelGroups[A].state=h)})),w){var y={};return g.forEach((function(A){return y[A]=h})),b.forEach((function(A){return y[A]=h})),this._heartbeatEndpoint({channels:g,channelGroups:b,state:y},a)}return this._setStateEndpoint({state:h,channels:g,channelGroups:b},a)},s.prototype.adaptPresenceChange=function(i){var a=this,d=i.connected,h=i.channels,p=h===void 0?[]:h,g=i.channelGroups,f=g===void 0?[]:g;d?(p.forEach((function(b){a._heartbeatChannels[b]={state:{}}})),f.forEach((function(b){a._heartbeatChannelGroups[b]={state:{}}}))):(p.forEach((function(b){b in a._heartbeatChannels&&delete a._heartbeatChannels[b]})),f.forEach((function(b){b in a._heartbeatChannelGroups&&delete a._heartbeatChannelGroups[b]})),this._config.suppressLeaveEvents===!1&&this._leaveEndpoint({channels:p,channelGroups:f},(function(b){a._listenerManager.announceStatus(b)}))),this.reconnect()},s.prototype.adaptSubscribeChange=function(i){var a=this,d=i.timetoken,h=i.channels,p=h===void 0?[]:h,g=i.channelGroups,f=g===void 0?[]:g,b=i.withPresence,_=b!==void 0&&b,w=i.withHeartbeats,y=w!==void 0&&w;this._config.subscribeKey&&this._config.subscribeKey!==""?(d&&(this._lastTimetoken=this._currentTimetoken,this._currentTimetoken=d),this._currentTimetoken!=="0"&&this._currentTimetoken!==0&&(this._storedTimetoken=this._currentTimetoken,this._currentTimetoken=0),p.forEach((function(A){a._channels[A]={state:{}},_&&(a._presenceChannels[A]={}),(y||a._config.getHeartbeatInterval())&&(a._heartbeatChannels[A]={}),a._pendingChannelSubscriptions.push(A)})),f.forEach((function(A){a._channelGroups[A]={state:{}},_&&(a._presenceChannelGroups[A]={}),(y||a._config.getHeartbeatInterval())&&(a._heartbeatChannelGroups[A]={}),a._pendingChannelGroupSubscriptions.push(A)})),this._subscriptionStatusAnnounced=!1,this.reconnect()):console&&console.log&&console.log("subscribe key missing; aborting subscribe")},s.prototype.adaptUnsubscribeChange=function(i,a){var d=this,h=i.channels,p=h===void 0?[]:h,g=i.channelGroups,f=g===void 0?[]:g,b=[],_=[];p.forEach((function(w){w in d._channels&&(delete d._channels[w],b.push(w),w in d._heartbeatChannels&&delete d._heartbeatChannels[w]),w in d._presenceChannels&&(delete d._presenceChannels[w],b.push(w))})),f.forEach((function(w){w in d._channelGroups&&(delete d._channelGroups[w],_.push(w),w in d._heartbeatChannelGroups&&delete d._heartbeatChannelGroups[w]),w in d._presenceChannelGroups&&(delete d._presenceChannelGroups[w],_.push(w))})),b.length===0&&_.length===0||(this._config.suppressLeaveEvents!==!1||a||this._leaveEndpoint({channels:b,channelGroups:_},(function(w){w.affectedChannels=b,w.affectedChannelGroups=_,w.currentTimetoken=d._currentTimetoken,w.lastTimetoken=d._lastTimetoken,d._listenerManager.announceStatus(w)})),Object.keys(this._channels).length===0&&Object.keys(this._presenceChannels).length===0&&Object.keys(this._channelGroups).length===0&&Object.keys(this._presenceChannelGroups).length===0&&(this._lastTimetoken=0,this._currentTimetoken=0,this._storedTimetoken=null,this._region=null,this._reconnectionManager.stopPolling()),this.reconnect())},s.prototype.unsubscribeAll=function(i){this.adaptUnsubscribeChange({channels:this.getSubscribedChannels(),channelGroups:this.getSubscribedChannelGroups()},i)},s.prototype.getHeartbeatChannels=function(){return Object.keys(this._heartbeatChannels)},s.prototype.getHeartbeatChannelGroups=function(){return Object.keys(this._heartbeatChannelGroups)},s.prototype.getSubscribedChannels=function(){return Object.keys(this._channels)},s.prototype.getSubscribedChannelGroups=function(){return Object.keys(this._channelGroups)},s.prototype.reconnect=function(){this._startSubscribeLoop(),this._registerHeartbeatTimer()},s.prototype.disconnect=function(){this._stopSubscribeLoop(),this._stopHeartbeatTimer(),this._reconnectionManager.stopPolling()},s.prototype._registerHeartbeatTimer=function(){this._stopHeartbeatTimer(),this._config.getHeartbeatInterval()!==0&&this._config.getHeartbeatInterval()!==void 0&&(this._performHeartbeatLoop(),this._heartbeatTimer=setInterval(this._performHeartbeatLoop.bind(this),1e3*this._config.getHeartbeatInterval()))},s.prototype._stopHeartbeatTimer=function(){this._heartbeatTimer&&(clearInterval(this._heartbeatTimer),this._heartbeatTimer=null)},s.prototype._performHeartbeatLoop=function(){var i=this,a=this.getHeartbeatChannels(),d=this.getHeartbeatChannelGroups(),h={};a.length===0&&d.length===0||(this.getSubscribedChannels().forEach((function(p){var g=i._channels[p].state;Object.keys(g).length&&(h[p]=g)})),this.getSubscribedChannelGroups().forEach((function(p){var g=i._channelGroups[p].state;Object.keys(g).length&&(h[p]=g)})),this._heartbeatEndpoint({channels:a,channelGroups:d,state:h},(function(p){p.error&&i._config.announceFailedHeartbeats&&i._listenerManager.announceStatus(p),p.error&&i._config.autoNetworkDetection&&i._isOnline&&(i._isOnline=!1,i.disconnect(),i._listenerManager.announceNetworkDown(),i.reconnect()),!p.error&&i._config.announceSuccessfulHeartbeats&&i._listenerManager.announceStatus(p)}).bind(this)))},s.prototype._startSubscribeLoop=function(){var i=this;this._stopSubscribeLoop();var a={},d=[],h=[];if(Object.keys(this._channels).forEach((function(g){var f=i._channels[g].state;Object.keys(f).length&&(a[g]=f),d.push(g)})),Object.keys(this._presenceChannels).forEach((function(g){d.push("".concat(g,"-pnpres"))})),Object.keys(this._channelGroups).forEach((function(g){var f=i._channelGroups[g].state;Object.keys(f).length&&(a[g]=f),h.push(g)})),Object.keys(this._presenceChannelGroups).forEach((function(g){h.push("".concat(g,"-pnpres"))})),d.length!==0||h.length!==0){var p={channels:d,channelGroups:h,state:a,timetoken:this._currentTimetoken,filterExpression:this._config.filterExpression,region:this._region};this._subscribeCall=this._subscribeEndpoint(p,this._processSubscribeResponse.bind(this))}},s.prototype._processSubscribeResponse=function(i,a){var d=this;if(i.error){if(i.errorData&&i.errorData.message==="Aborted")return;i.category===B.PNTimeoutCategory?this._startSubscribeLoop():i.category===B.PNNetworkIssuesCategory?(this.disconnect(),i.error&&this._config.autoNetworkDetection&&this._isOnline&&(this._isOnline=!1,this._listenerManager.announceNetworkDown()),this._reconnectionManager.onReconnection((function(){d._config.autoNetworkDetection&&!d._isOnline&&(d._isOnline=!0,d._listenerManager.announceNetworkUp()),d.reconnect(),d._subscriptionStatusAnnounced=!0;var w={category:B.PNReconnectedCategory,operation:i.operation,lastTimetoken:d._lastTimetoken,currentTimetoken:d._currentTimetoken};d._listenerManager.announceStatus(w)})),this._reconnectionManager.startPolling(),this._listenerManager.announceStatus(i)):i.category===B.PNBadRequestCategory?(this._stopHeartbeatTimer(),this._listenerManager.announceStatus(i)):this._listenerManager.announceStatus(i)}else{if(this._storedTimetoken?(this._currentTimetoken=this._storedTimetoken,this._storedTimetoken=null):(this._lastTimetoken=this._currentTimetoken,this._currentTimetoken=a.metadata.timetoken),!this._subscriptionStatusAnnounced){var h={};h.category=B.PNConnectedCategory,h.operation=i.operation,h.affectedChannels=this._pendingChannelSubscriptions,h.subscribedChannels=this.getSubscribedChannels(),h.affectedChannelGroups=this._pendingChannelGroupSubscriptions,h.lastTimetoken=this._lastTimetoken,h.currentTimetoken=this._currentTimetoken,this._subscriptionStatusAnnounced=!0,this._listenerManager.announceStatus(h),this._pendingChannelSubscriptions=[],this._pendingChannelGroupSubscriptions=[]}var p=a.messages||[],g=this._config,f=g.requestMessageCountThreshold,b=g.dedupeOnSubscribe;if(f&&p.length>=f){var _={};_.category=B.PNRequestMessageCountExceededCategory,_.operation=i.operation,this._listenerManager.announceStatus(_)}p.forEach((function(w){if(w.channel,w.subscriptionMatch,b){if(d._dedupingManager.isDuplicate(w))return;d._dedupingManager.addEntry(w)}d._eventEmitter.emitEvent(w)})),this._region=a.metadata.region,this._startSubscribeLoop()}},s.prototype._stopSubscribeLoop=function(){this._subscribeCall&&(typeof this._subscribeCall.abort=="function"&&this._subscribeCall.abort(),this._subscribeCall=null)},s.prototype._renameEvent=function(i){return i==="set"?"updated":"removed"},s.prototype._renameChannelField=function(i){var a=i.channel,d=r(i,["channel"]);return d.spaceId=a,d},s})(),q={PNTimeOperation:"PNTimeOperation",PNHistoryOperation:"PNHistoryOperation",PNDeleteMessagesOperation:"PNDeleteMessagesOperation",PNFetchMessagesOperation:"PNFetchMessagesOperation",PNMessageCounts:"PNMessageCountsOperation",PNSubscribeOperation:"PNSubscribeOperation",PNUnsubscribeOperation:"PNUnsubscribeOperation",PNPublishOperation:"PNPublishOperation",PNSignalOperation:"PNSignalOperation",PNAddMessageActionOperation:"PNAddActionOperation",PNRemoveMessageActionOperation:"PNRemoveMessageActionOperation",PNGetMessageActionsOperation:"PNGetMessageActionsOperation",PNCreateUserOperation:"PNCreateUserOperation",PNUpdateUserOperation:"PNUpdateUserOperation",PNDeleteUserOperation:"PNDeleteUserOperation",PNGetUserOperation:"PNGetUsersOperation",PNGetUsersOperation:"PNGetUsersOperation",PNCreateSpaceOperation:"PNCreateSpaceOperation",PNUpdateSpaceOperation:"PNUpdateSpaceOperation",PNDeleteSpaceOperation:"PNDeleteSpaceOperation",PNGetSpaceOperation:"PNGetSpacesOperation",PNGetSpacesOperation:"PNGetSpacesOperation",PNGetMembersOperation:"PNGetMembersOperation",PNUpdateMembersOperation:"PNUpdateMembersOperation",PNGetMembershipsOperation:"PNGetMembershipsOperation",PNUpdateMembershipsOperation:"PNUpdateMembershipsOperation",PNListFilesOperation:"PNListFilesOperation",PNGenerateUploadUrlOperation:"PNGenerateUploadUrlOperation",PNPublishFileOperation:"PNPublishFileOperation",PNGetFileUrlOperation:"PNGetFileUrlOperation",PNDownloadFileOperation:"PNDownloadFileOperation",PNGetAllUUIDMetadataOperation:"PNGetAllUUIDMetadataOperation",PNGetUUIDMetadataOperation:"PNGetUUIDMetadataOperation",PNSetUUIDMetadataOperation:"PNSetUUIDMetadataOperation",PNRemoveUUIDMetadataOperation:"PNRemoveUUIDMetadataOperation",PNGetAllChannelMetadataOperation:"PNGetAllChannelMetadataOperation",PNGetChannelMetadataOperation:"PNGetChannelMetadataOperation",PNSetChannelMetadataOperation:"PNSetChannelMetadataOperation",PNRemoveChannelMetadataOperation:"PNRemoveChannelMetadataOperation",PNSetMembersOperation:"PNSetMembersOperation",PNSetMembershipsOperation:"PNSetMembershipsOperation",PNPushNotificationEnabledChannelsOperation:"PNPushNotificationEnabledChannelsOperation",PNRemoveAllPushNotificationsOperation:"PNRemoveAllPushNotificationsOperation",PNWhereNowOperation:"PNWhereNowOperation",PNSetStateOperation:"PNSetStateOperation",PNHereNowOperation:"PNHereNowOperation",PNGetStateOperation:"PNGetStateOperation",PNHeartbeatOperation:"PNHeartbeatOperation",PNChannelGroupsOperation:"PNChannelGroupsOperation",PNRemoveGroupOperation:"PNRemoveGroupOperation",PNChannelsForGroupOperation:"PNChannelsForGroupOperation",PNAddChannelsToGroupOperation:"PNAddChannelsToGroupOperation",PNRemoveChannelsFromGroupOperation:"PNRemoveChannelsFromGroupOperation",PNAccessManagerGrant:"PNAccessManagerGrant",PNAccessManagerGrantToken:"PNAccessManagerGrantToken",PNAccessManagerAudit:"PNAccessManagerAudit",PNAccessManagerRevokeToken:"PNAccessManagerRevokeToken",PNHandshakeOperation:"PNHandshakeOperation",PNReceiveMessagesOperation:"PNReceiveMessagesOperation"},st=(function(){function s(i){this._maximumSamplesCount=100,this._trackedLatencies={},this._latencies={},this._telemetryExcludeOperations=[q.PNSubscribeOperation,q.PNReceiveMessagesOperation,q.PNHandshakeOperation],this._maximumSamplesCount=i.maximumSamplesCount||this._maximumSamplesCount}return s.prototype.operationsLatencyForRequest=function(){var i=this,a={};return Object.keys(this._latencies).forEach((function(d){var h=i._latencies[d],p=i._averageLatency(h);p>0&&(a["l_".concat(d)]=p)})),a},s.prototype.startLatencyMeasure=function(i,a){!this._telemetryExcludeOperations.includes(i)&&a&&(this._trackedLatencies[a]=Date.now())},s.prototype.stopLatencyMeasure=function(i,a){if(!this._telemetryExcludeOperations.includes(i)&&a){var d=this._endpointName(i),h=this._latencies[d],p=this._trackedLatencies[a];h||(this._latencies[d]=[],h=this._latencies[d]),h.push(Date.now()-p),h.length>this._maximumSamplesCount&&h.splice(0,h.length-this._maximumSamplesCount),delete this._trackedLatencies[a]}},s.prototype._averageLatency=function(i){return Math.floor(i.reduce((function(a,d){return a+d}),0)/i.length)},s.prototype._endpointName=function(i){var a=null;switch(i){case q.PNPublishOperation:a="pub";break;case q.PNSignalOperation:a="sig";break;case q.PNHistoryOperation:case q.PNFetchMessagesOperation:case q.PNDeleteMessagesOperation:case q.PNMessageCounts:a="hist";break;case q.PNUnsubscribeOperation:case q.PNWhereNowOperation:case q.PNHereNowOperation:case q.PNHeartbeatOperation:case q.PNSetStateOperation:case q.PNGetStateOperation:a="pres";break;case q.PNAddChannelsToGroupOperation:case q.PNRemoveChannelsFromGroupOperation:case q.PNChannelGroupsOperation:case q.PNRemoveGroupOperation:case q.PNChannelsForGroupOperation:a="cg";break;case q.PNPushNotificationEnabledChannelsOperation:case q.PNRemoveAllPushNotificationsOperation:a="push";break;case q.PNCreateUserOperation:case q.PNUpdateUserOperation:case q.PNDeleteUserOperation:case q.PNGetUserOperation:case q.PNGetUsersOperation:case q.PNCreateSpaceOperation:case q.PNUpdateSpaceOperation:case q.PNDeleteSpaceOperation:case q.PNGetSpaceOperation:case q.PNGetSpacesOperation:case q.PNGetMembersOperation:case q.PNUpdateMembersOperation:case q.PNGetMembershipsOperation:case q.PNUpdateMembershipsOperation:a="obj";break;case q.PNAddMessageActionOperation:case q.PNRemoveMessageActionOperation:case q.PNGetMessageActionsOperation:a="msga";break;case q.PNAccessManagerGrant:case q.PNAccessManagerAudit:a="pam";break;case q.PNAccessManagerGrantToken:case q.PNAccessManagerRevokeToken:a="pamv3";break;default:a="time"}return a},s})(),Fe=(function(){function s(i,a,d){this._payload=i,this._setDefaultPayloadStructure(),this.title=a,this.body=d}return Object.defineProperty(s.prototype,"payload",{get:function(){return this._payload},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"title",{set:function(i){this._title=i},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"subtitle",{set:function(i){this._subtitle=i},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"body",{set:function(i){this._body=i},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"badge",{set:function(i){this._badge=i},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"sound",{set:function(i){this._sound=i},enumerable:!1,configurable:!0}),s.prototype._setDefaultPayloadStructure=function(){},s.prototype.toObject=function(){return{}},s})(),Ae=(function(s){function i(){return s!==null&&s.apply(this,arguments)||this}return t(i,s),Object.defineProperty(i.prototype,"configurations",{set:function(a){a&&a.length&&(this._configurations=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"notification",{get:function(){return this._payload.aps},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this._title},set:function(a){a&&a.length&&(this._payload.aps.alert.title=a,this._title=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"subtitle",{get:function(){return this._subtitle},set:function(a){a&&a.length&&(this._payload.aps.alert.subtitle=a,this._subtitle=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"body",{get:function(){return this._body},set:function(a){a&&a.length&&(this._payload.aps.alert.body=a,this._body=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"badge",{get:function(){return this._badge},set:function(a){a!=null&&(this._payload.aps.badge=a,this._badge=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sound",{get:function(){return this._sound},set:function(a){a&&a.length&&(this._payload.aps.sound=a,this._sound=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"silent",{set:function(a){this._isSilent=a},enumerable:!1,configurable:!0}),i.prototype._setDefaultPayloadStructure=function(){this._payload.aps={alert:{}}},i.prototype.toObject=function(){var a=this,d=n({},this._payload),h=d.aps,p=h.alert;if(this._isSilent&&(h["content-available"]=1),this._apnsPushType==="apns2"){if(!this._configurations||!this._configurations.length)throw new ReferenceError("APNS2 configuration is missing");var g=[];this._configurations.forEach((function(f){g.push(a._objectFromAPNS2Configuration(f))})),g.length&&(d.pn_push=g)}return p&&Object.keys(p).length||delete h.alert,this._isSilent&&(delete h.alert,delete h.badge,delete h.sound,p={}),this._isSilent||Object.keys(p).length?d:null},i.prototype._objectFromAPNS2Configuration=function(a){var d=this;if(!a.targets||!a.targets.length)throw new ReferenceError("At least one APNS2 target should be provided");var h=[];a.targets.forEach((function(b){h.push(d._objectFromAPNSTarget(b))}));var p=a.collapseId,g=a.expirationDate,f={auth_method:"token",targets:h,version:"v2"};return p&&p.length&&(f.collapse_id=p),g&&(f.expiration=g.toISOString()),f},i.prototype._objectFromAPNSTarget=function(a){if(!a.topic||!a.topic.length)throw new TypeError("Target 'topic' undefined.");var d=a.topic,h=a.environment,p=h===void 0?"development":h,g=a.excludedDevices,f=g===void 0?[]:g,b={topic:d,environment:p};return f.length&&(b.excluded_devices=f),b},i})(Fe),Hi=(function(s){function i(){return s!==null&&s.apply(this,arguments)||this}return t(i,s),Object.defineProperty(i.prototype,"backContent",{get:function(){return this._backContent},set:function(a){a&&a.length&&(this._payload.back_content=a,this._backContent=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"backTitle",{get:function(){return this._backTitle},set:function(a){a&&a.length&&(this._payload.back_title=a,this._backTitle=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"count",{get:function(){return this._count},set:function(a){a!=null&&(this._payload.count=a,this._count=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this._title},set:function(a){a&&a.length&&(this._payload.title=a,this._title=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"type",{get:function(){return this._type},set:function(a){a&&a.length&&(this._payload.type=a,this._type=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"subtitle",{get:function(){return this.backTitle},set:function(a){this.backTitle=a},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"body",{get:function(){return this.backContent},set:function(a){this.backContent=a},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"badge",{get:function(){return this.count},set:function(a){this.count=a},enumerable:!1,configurable:!0}),i.prototype.toObject=function(){return Object.keys(this._payload).length?n({},this._payload):null},i})(Fe),at=(function(s){function i(){return s!==null&&s.apply(this,arguments)||this}return t(i,s),Object.defineProperty(i.prototype,"notification",{get:function(){return this._payload.notification},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"data",{get:function(){return this._payload.data},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this._title},set:function(a){a&&a.length&&(this._payload.notification.title=a,this._title=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"body",{get:function(){return this._body},set:function(a){a&&a.length&&(this._payload.notification.body=a,this._body=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sound",{get:function(){return this._sound},set:function(a){a&&a.length&&(this._payload.notification.sound=a,this._sound=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"icon",{get:function(){return this._icon},set:function(a){a&&a.length&&(this._payload.notification.icon=a,this._icon=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"tag",{get:function(){return this._tag},set:function(a){a&&a.length&&(this._payload.notification.tag=a,this._tag=a)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"silent",{set:function(a){this._isSilent=a},enumerable:!1,configurable:!0}),i.prototype._setDefaultPayloadStructure=function(){this._payload.notification={},this._payload.data={}},i.prototype.toObject=function(){var a=n({},this._payload.data),d=null,h={};if(Object.keys(this._payload).length>2){var p=this._payload;p.notification,p.data;var g=r(p,["notification","data"]);a=n(n({},a),g)}return this._isSilent?a.notification=this._payload.notification:d=this._payload.notification,Object.keys(a).length&&(h.data=a),d&&Object.keys(d).length&&(h.notification=d),Object.keys(h).length?h:null},i})(Fe),ci=(function(){function s(i,a){this._payload={apns:{},mpns:{},fcm:{}},this._title=i,this._body=a,this.apns=new Ae(this._payload.apns,i,a),this.mpns=new Hi(this._payload.mpns,i,a),this.fcm=new at(this._payload.fcm,i,a)}return Object.defineProperty(s.prototype,"debugging",{set:function(i){this._debugging=i},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"title",{get:function(){return this._title},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"body",{get:function(){return this._body},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"subtitle",{get:function(){return this._subtitle},set:function(i){this._subtitle=i,this.apns.subtitle=i,this.mpns.subtitle=i,this.fcm.subtitle=i},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"badge",{get:function(){return this._badge},set:function(i){this._badge=i,this.apns.badge=i,this.mpns.badge=i,this.fcm.badge=i},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"sound",{get:function(){return this._sound},set:function(i){this._sound=i,this.apns.sound=i,this.mpns.sound=i,this.fcm.sound=i},enumerable:!1,configurable:!0}),s.prototype.buildPayload=function(i){var a={};if(i.includes("apns")||i.includes("apns2")){this.apns._apnsPushType=i.includes("apns")?"apns":"apns2";var d=this.apns.toObject();d&&Object.keys(d).length&&(a.pn_apns=d)}if(i.includes("mpns")){var h=this.mpns.toObject();h&&Object.keys(h).length&&(a.pn_mpns=h)}if(i.includes("fcm")){var p=this.fcm.toObject();p&&Object.keys(p).length&&(a.pn_gcm=p)}return Object.keys(a).length&&this._debugging&&(a.pn_debug=!0),a},s})(),es=(function(){function s(){this._listeners=[]}return s.prototype.addListener=function(i){this._listeners.includes(i)||this._listeners.push(i)},s.prototype.removeListener=function(i){var a=[];this._listeners.forEach((function(d){d!==i&&a.push(d)})),this._listeners=a},s.prototype.removeAllListeners=function(){this._listeners=[]},s.prototype.announcePresence=function(i){this._listeners.forEach((function(a){a.presence&&a.presence(i)}))},s.prototype.announceStatus=function(i){this._listeners.forEach((function(a){a.status&&a.status(i)}))},s.prototype.announceMessage=function(i){this._listeners.forEach((function(a){a.message&&a.message(i)}))},s.prototype.announceSignal=function(i){this._listeners.forEach((function(a){a.signal&&a.signal(i)}))},s.prototype.announceMessageAction=function(i){this._listeners.forEach((function(a){a.messageAction&&a.messageAction(i)}))},s.prototype.announceFile=function(i){this._listeners.forEach((function(a){a.file&&a.file(i)}))},s.prototype.announceObjects=function(i){this._listeners.forEach((function(a){a.objects&&a.objects(i)}))},s.prototype.announceUser=function(i){this._listeners.forEach((function(a){a.user&&a.user(i)}))},s.prototype.announceSpace=function(i){this._listeners.forEach((function(a){a.space&&a.space(i)}))},s.prototype.announceMembership=function(i){this._listeners.forEach((function(a){a.membership&&a.membership(i)}))},s.prototype.announceNetworkUp=function(){var i={};i.category=B.PNNetworkUpCategory,this.announceStatus(i)},s.prototype.announceNetworkDown=function(){var i={};i.category=B.PNNetworkDownCategory,this.announceStatus(i)},s})(),Ld=(function(){function s(i,a){this._config=i,this._cbor=a}return s.prototype.setToken=function(i){i&&i.length>0?this._token=i:this._token=void 0},s.prototype.getToken=function(){return this._token},s.prototype.extractPermissions=function(i){var a={read:!1,write:!1,manage:!1,delete:!1,get:!1,update:!1,join:!1};return(128&i)==128&&(a.join=!0),(64&i)==64&&(a.update=!0),(32&i)==32&&(a.get=!0),(8&i)==8&&(a.delete=!0),(4&i)==4&&(a.manage=!0),(2&i)==2&&(a.write=!0),(1&i)==1&&(a.read=!0),a},s.prototype.parseToken=function(i){var a=this,d=this._cbor.decodeToken(i);if(d!==void 0){var h=d.res.uuid?Object.keys(d.res.uuid):[],p=Object.keys(d.res.chan),g=Object.keys(d.res.grp),f=d.pat.uuid?Object.keys(d.pat.uuid):[],b=Object.keys(d.pat.chan),_=Object.keys(d.pat.grp),w={version:d.v,timestamp:d.t,ttl:d.ttl,authorized_uuid:d.uuid},y=h.length>0,A=p.length>0,E=g.length>0;(y||A||E)&&(w.resources={},y&&(w.resources.uuids={},h.forEach((function($){w.resources.uuids[$]=a.extractPermissions(d.res.uuid[$])}))),A&&(w.resources.channels={},p.forEach((function($){w.resources.channels[$]=a.extractPermissions(d.res.chan[$])}))),E&&(w.resources.groups={},g.forEach((function($){w.resources.groups[$]=a.extractPermissions(d.res.grp[$])}))));var S=f.length>0,P=b.length>0,O=_.length>0;return(S||P||O)&&(w.patterns={},S&&(w.patterns.uuids={},f.forEach((function($){w.patterns.uuids[$]=a.extractPermissions(d.pat.uuid[$])}))),P&&(w.patterns.channels={},b.forEach((function($){w.patterns.channels[$]=a.extractPermissions(d.pat.chan[$])}))),O&&(w.patterns.groups={},_.forEach((function($){w.patterns.groups[$]=a.extractPermissions(d.pat.grp[$])})))),Object.keys(d.meta).length>0&&(w.meta=d.meta),w.signature=d.sig,w}},s})();function En(s){return encodeURIComponent(s).replace(/[!~*'()]/g,(function(i){return"%".concat(i.charCodeAt(0).toString(16).toUpperCase())}))}function za(s){return(function(i){var a=[];return Object.keys(i).forEach((function(d){return a.push(d)})),a})(s).sort()}var we={signPamFromParams:function(s){return za(s).map((function(i){return"".concat(i,"=").concat(En(s[i]))})).join("&")},endsWith:function(s,i){return s.indexOf(i,this.length-i.length)!==-1},createPromise:function(){var s,i;return{promise:new Promise((function(a,d){s=a,i=d})),reject:i,fulfill:s}},encodeString:En,stringToArrayBuffer:function(s){for(var i=new ArrayBuffer(2*s.length),a=new Uint16Array(i),d=0,h=s.length;d<h;d++)a[d]=s.charCodeAt(d);return i},removeSingleOccurance:function(s,i){var a=Object.fromEntries(i.map((function(d){return[d,!1]})));return s.filter((function(d){return!(i.includes(d)&&!a[d]&&(a[d]=!0,1))}))},findUniqueCommonElements:function(s,i){return __spreadArray([],__read(s),!1).filter((function(a){return i.includes(a)&&s.indexOf(a)===s.lastIndexOf(a)&&i.indexOf(a)===i.lastIndexOf(a)}))}},Ke=(function(s){function i(a,d){var h=this.constructor,p=s.call(this,a)||this;return p.name=p.constructor.name,p.status=d,p.message=a,Object.setPrototypeOf(p,h.prototype),p}return t(i,s),i})(Error);function qi(s){return(i={message:s}).type="validationError",i.error=!0,i;var i}function v2(s,i,a){return s.usePost&&s.usePost(i,a)?s.postURL(i,a):s.usePatch&&s.usePatch(i,a)?s.patchURL(i,a):s.useGetFile&&s.useGetFile(i,a)?s.getFileURL(i,a):s.getURL(i,a)}function Fg(s){if(s.sdkName)return s.sdkName;var i="PubNub-JS-".concat(s.sdkFamily);s.partnerId&&(i+="-".concat(s.partnerId)),i+="/".concat(s.getVersion());var a=s._getPnsdkSuffix(" ");return a.length>0&&(i+=a),i}function ts(s,i,a){return i.usePost&&i.usePost(s,a)?"POST":i.usePatch&&i.usePatch(s,a)?"PATCH":i.useDelete&&i.useDelete(s,a)?"DELETE":i.useGetFile&&i.useGetFile(s,a)?"GETFILE":"GET"}function zg(s,i,a,d,h){var p=s.config,g=s.crypto,f=ts(s,h,d);a.timestamp=Math.floor(new Date().getTime()/1e3),h.getOperation()==="PNPublishOperation"&&h.usePost&&h.usePost(s,d)&&(f="GET"),f==="GETFILE"&&(f="GET");var b="".concat(f,`
|
|
6
|
+
`).concat(p.publishKey,`
|
|
7
|
+
`).concat(i,`
|
|
8
|
+
`).concat(we.signPamFromParams(a),`
|
|
9
|
+
`);if(f==="POST")b+=typeof(_=h.postPayload(s,d))=="string"?_:JSON.stringify(_);else if(f==="PATCH"){var _;b+=typeof(_=h.patchPayload(s,d))=="string"?_:JSON.stringify(_)}var w="v2.".concat(g.HMACSHA256(b));w=(w=(w=w.replace(/\+/g,"-")).replace(/\//g,"_")).replace(/=+$/,""),a.signature=w}function ve(s,i){for(var a=[],d=2;d<arguments.length;d++)a[d-2]=arguments[d];var h=s.networking,p=s.config,g=s.telemetryManager,f=s.tokenManager,b=oe(),_=null,w=null,y={};i.getOperation()===q.PNTimeOperation||i.getOperation()===q.PNChannelGroupsOperation?_=a[0]:(y=a[0],_=a[1]),typeof Promise>"u"||_||(w=we.createPromise());var A=i.validateParams(s,y);if(A)return _?_(qi(A)):w?(w.reject(new Ke("Validation failed, check status for details",qi(A))),w.promise):void 0;var E,S=i.prepareParams(s,y),P=v2(i,s,y),O={url:P,operation:i.getOperation(),timeout:i.getRequestTimeout(s),headers:i.getRequestHeaders?i.getRequestHeaders():{},ignoreBody:typeof i.ignoreBody=="function"&&i.ignoreBody(s),forceBuffered:typeof i.forceBuffered=="function"?i.forceBuffered(s,y):null,abortSignal:typeof i.getAbortSignal=="function"?i.getAbortSignal(s,y):null};S.uuid=p.UUID,S.pnsdk=Fg(p);var $=g.operationsLatencyForRequest();if(Object.keys($).length&&(S=n(n({},S),$)),p.useInstanceId&&(S.instanceid=p.instanceId),p.useRequestId&&(S.requestid=b),i.isAuthSupported()){var G=f.getToken()||p.getAuthKey();G&&(S.auth=G)}p.secretKey&&zg(s,P,S,y,i);var re=function(Q,T){if(Q.error)return i.handleError&&i.handleError(s,y,Q),void(_?_(Q):w&&w.reject(new Ke("PubNub call failed, check status for details",Q)));g.stopLatencyMeasure(i.getOperation(),b);var N=i.handleResponse(s,T,y);typeof N?.then!="function"&&(N=Promise.resolve(N)),N.then((function(L){_?_(Q,L):w&&w.fulfill(L)})).catch((function(L){if(_){var W=L;i.getOperation()===q.PNSubscribeOperation&&(W={statusCode:400,error:!0,operation:i.getOperation(),errorData:L,category:B.PNUnknownCategory}),_(W,null)}else w&&w.reject(new Ke("PubNub call failed, check status for details",L))}))};if(g.startLatencyMeasure(i.getOperation(),b),ts(s,i,y)==="POST"){var te=i.postPayload(s,y);E=h.POST(S,te,O,re)}else ts(s,i,y)==="PATCH"?(te=i.patchPayload(s,y),E=h.PATCH(S,te,O,re)):E=ts(s,i,y)==="DELETE"?h.DELETE(S,O,re):ts(s,i,y)==="GETFILE"?h.GETFILE(S,O,re):h.GET(S,O,re);return i.getOperation()===q.PNSubscribeOperation?E:w?w.promise:void 0}var b2=Object.freeze({__proto__:null,getOperation:function(){return q.PNAddChannelsToGroupOperation},validateParams:function(s,i){var a=i.channels,d=i.channelGroup,h=s.config;return d?a&&a.length!==0?h.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing Channel Group"},getURL:function(s,i){var a=i.channelGroup,d=s.config;return"/v1/channel-registration/sub-key/".concat(d.subscribeKey,"/channel-group/").concat(we.encodeString(a))},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.channels;return{add:(a===void 0?[]:a).join(",")}},handleResponse:function(){return{}}}),_2=Object.freeze({__proto__:null,getOperation:function(){return q.PNRemoveChannelsFromGroupOperation},validateParams:function(s,i){var a=i.channels,d=i.channelGroup,h=s.config;return d?a&&a.length!==0?h.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing Channel Group"},getURL:function(s,i){var a=i.channelGroup,d=s.config;return"/v1/channel-registration/sub-key/".concat(d.subscribeKey,"/channel-group/").concat(we.encodeString(a))},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.channels;return{remove:(a===void 0?[]:a).join(",")}},handleResponse:function(){return{}}}),w2=Object.freeze({__proto__:null,getOperation:function(){return q.PNRemoveGroupOperation},validateParams:function(s,i){var a=i.channelGroup,d=s.config;return a?d.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channel Group"},getURL:function(s,i){var a=i.channelGroup,d=s.config;return"/v1/channel-registration/sub-key/".concat(d.subscribeKey,"/channel-group/").concat(we.encodeString(a),"/remove")},isAuthSupported:function(){return!0},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},prepareParams:function(){return{}},handleResponse:function(){return{}}}),C2=Object.freeze({__proto__:null,getOperation:function(){return q.PNChannelGroupsOperation},validateParams:function(s){if(!s.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(s){var i=s.config;return"/v1/channel-registration/sub-key/".concat(i.subscribeKey,"/channel-group")},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(s,i){return{groups:i.payload.groups}}}),I2=Object.freeze({__proto__:null,getOperation:function(){return q.PNChannelsForGroupOperation},validateParams:function(s,i){var a=i.channelGroup,d=s.config;return a?d.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channel Group"},getURL:function(s,i){var a=i.channelGroup,d=s.config;return"/v1/channel-registration/sub-key/".concat(d.subscribeKey,"/channel-group/").concat(we.encodeString(a))},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(s,i){return{channels:i.payload.channels}}}),k2=Object.freeze({__proto__:null,getOperation:function(){return q.PNPushNotificationEnabledChannelsOperation},validateParams:function(s,i){var a=i.device,d=i.pushGateway,h=i.channels,p=i.topic,g=s.config;return a?d?d!=="apns2"||p?h&&h.length!==0?g.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing APNS2 topic":"Missing GW Type (pushGateway: gcm, apns or apns2)":"Missing Device ID (device)"},getURL:function(s,i){var a=i.device,d=i.pushGateway,h=s.config;return d==="apns2"?"/v2/push/sub-key/".concat(h.subscribeKey,"/devices-apns2/").concat(a):"/v1/push/sub-key/".concat(h.subscribeKey,"/devices/").concat(a)},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.pushGateway,d=i.channels,h=d===void 0?[]:d,p=i.environment,g=p===void 0?"development":p,f=i.topic,b={type:a,add:h.join(",")};return a==="apns2"&&delete(b=n(n({},b),{environment:g,topic:f})).type,b},handleResponse:function(){return{}}}),E2=Object.freeze({__proto__:null,getOperation:function(){return q.PNPushNotificationEnabledChannelsOperation},validateParams:function(s,i){var a=i.device,d=i.pushGateway,h=i.channels,p=i.topic,g=s.config;return a?d?d!=="apns2"||p?h&&h.length!==0?g.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing APNS2 topic":"Missing GW Type (pushGateway: gcm, apns or apns2)":"Missing Device ID (device)"},getURL:function(s,i){var a=i.device,d=i.pushGateway,h=s.config;return d==="apns2"?"/v2/push/sub-key/".concat(h.subscribeKey,"/devices-apns2/").concat(a):"/v1/push/sub-key/".concat(h.subscribeKey,"/devices/").concat(a)},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.pushGateway,d=i.channels,h=d===void 0?[]:d,p=i.environment,g=p===void 0?"development":p,f=i.topic,b={type:a,remove:h.join(",")};return a==="apns2"&&delete(b=n(n({},b),{environment:g,topic:f})).type,b},handleResponse:function(){return{}}}),S2=Object.freeze({__proto__:null,getOperation:function(){return q.PNPushNotificationEnabledChannelsOperation},validateParams:function(s,i){var a=i.device,d=i.pushGateway,h=i.topic,p=s.config;return a?d?d!=="apns2"||h?p.subscribeKey?void 0:"Missing Subscribe Key":"Missing APNS2 topic":"Missing GW Type (pushGateway: gcm, apns or apns2)":"Missing Device ID (device)"},getURL:function(s,i){var a=i.device,d=i.pushGateway,h=s.config;return d==="apns2"?"/v2/push/sub-key/".concat(h.subscribeKey,"/devices-apns2/").concat(a):"/v1/push/sub-key/".concat(h.subscribeKey,"/devices/").concat(a)},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.pushGateway,d=i.environment,h=d===void 0?"development":d,p=i.topic,g=i.start,f=i.count,b={type:a};return a==="apns2"&&delete(b=n(n({},b),{environment:h,topic:p})).type,g&&(b.start=g),f&&f>0&&(b.count=f),b},handleResponse:function(s,i){return{channels:i}}}),P2=Object.freeze({__proto__:null,getOperation:function(){return q.PNRemoveAllPushNotificationsOperation},validateParams:function(s,i){var a=i.device,d=i.pushGateway,h=i.topic,p=s.config;return a?d?d!=="apns2"||h?p.subscribeKey?void 0:"Missing Subscribe Key":"Missing APNS2 topic":"Missing GW Type (pushGateway: gcm, apns or apns2)":"Missing Device ID (device)"},getURL:function(s,i){var a=i.device,d=i.pushGateway,h=s.config;return d==="apns2"?"/v2/push/sub-key/".concat(h.subscribeKey,"/devices-apns2/").concat(a,"/remove"):"/v1/push/sub-key/".concat(h.subscribeKey,"/devices/").concat(a,"/remove")},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.pushGateway,d=i.environment,h=d===void 0?"development":d,p=i.topic,g={type:a};return a==="apns2"&&delete(g=n(n({},g),{environment:h,topic:p})).type,g},handleResponse:function(){return{}}}),Hg=Object.freeze({__proto__:null,getOperation:function(){return q.PNUnsubscribeOperation},validateParams:function(s){if(!s.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(s,i){var a=s.config,d=i.channels,h=d===void 0?[]:d,p=h.length>0?h.join(","):",";return"/v2/presence/sub-key/".concat(a.subscribeKey,"/channel/").concat(we.encodeString(p),"/leave")},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.channelGroups,d=a===void 0?[]:a,h={};return d.length>0&&(h["channel-group"]=d.join(",")),h},handleResponse:function(){return{}}}),O2=Object.freeze({__proto__:null,getOperation:function(){return q.PNWhereNowOperation},validateParams:function(s){if(!s.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(s,i){var a=s.config,d=i.uuid,h=d===void 0?a.UUID:d;return"/v2/presence/sub-key/".concat(a.subscribeKey,"/uuid/").concat(we.encodeString(h))},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(s,i){return i.payload?{channels:i.payload.channels}:{channels:[]}}}),qg=Object.freeze({__proto__:null,getOperation:function(){return q.PNHeartbeatOperation},validateParams:function(s){if(!s.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(s,i){var a=s.config,d=i.channels,h=d===void 0?[]:d,p=h.length>0?h.join(","):",";return"/v2/presence/sub-key/".concat(a.subscribeKey,"/channel/").concat(we.encodeString(p),"/heartbeat")},isAuthSupported:function(){return!0},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},prepareParams:function(s,i){var a=i.channelGroups,d=a===void 0?[]:a,h=i.state,p=s.config,g={};return d.length>0&&(g["channel-group"]=d.join(",")),h&&(g.state=JSON.stringify(h)),g.heartbeat=p.getPresenceTimeout(),g},handleResponse:function(){return{}}}),R2=Object.freeze({__proto__:null,getOperation:function(){return q.PNGetStateOperation},validateParams:function(s){if(!s.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(s,i){var a=s.config,d=i.uuid,h=d===void 0?a.UUID:d,p=i.channels,g=p===void 0?[]:p,f=g.length>0?g.join(","):",";return"/v2/presence/sub-key/".concat(a.subscribeKey,"/channel/").concat(we.encodeString(f),"/uuid/").concat(h)},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.channelGroups,d=a===void 0?[]:a,h={};return d.length>0&&(h["channel-group"]=d.join(",")),h},handleResponse:function(s,i,a){var d=a.channels,h=d===void 0?[]:d,p=a.channelGroups,g=p===void 0?[]:p,f={};return h.length===1&&g.length===0?f[h[0]]=i.payload:f=i.payload,{channels:f}}}),Gg=Object.freeze({__proto__:null,getOperation:function(){return q.PNSetStateOperation},validateParams:function(s,i){var a=s.config,d=i.state,h=i.channels,p=h===void 0?[]:h,g=i.channelGroups,f=g===void 0?[]:g;return d?a.subscribeKey?p.length===0&&f.length===0?"Please provide a list of channels and/or channel-groups":void 0:"Missing Subscribe Key":"Missing State"},getURL:function(s,i){var a=s.config,d=i.channels,h=d===void 0?[]:d,p=h.length>0?h.join(","):",";return"/v2/presence/sub-key/".concat(a.subscribeKey,"/channel/").concat(we.encodeString(p),"/uuid/").concat(we.encodeString(a.UUID),"/data")},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.state,d=i.channelGroups,h=d===void 0?[]:d,p={};return p.state=JSON.stringify(a),h.length>0&&(p["channel-group"]=h.join(",")),p},handleResponse:function(s,i){return{state:i.payload}}}),T2=Object.freeze({__proto__:null,getOperation:function(){return q.PNHereNowOperation},validateParams:function(s){if(!s.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(s,i){var a=s.config,d=i.channels,h=d===void 0?[]:d,p=i.channelGroups,g=p===void 0?[]:p,f="/v2/presence/sub-key/".concat(a.subscribeKey);if(h.length>0||g.length>0){var b=h.length>0?h.join(","):",";f+="/channel/".concat(we.encodeString(b))}return f},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.channelGroups,d=a===void 0?[]:a,h=i.includeUUIDs,p=h===void 0||h,g=i.includeState,f=g!==void 0&&g,b=i.queryParameters,_=b===void 0?{}:b,w={};return p||(w.disable_uuids=1),f&&(w.state=1),d.length>0&&(w["channel-group"]=d.join(",")),n(n({},w),_)},handleResponse:function(s,i,a){var d=a.channels,h=d===void 0?[]:d,p=a.channelGroups,g=p===void 0?[]:p,f=a.includeUUIDs,b=f===void 0||f,_=a.includeState,w=_!==void 0&&_;return h.length>1||g.length>0||g.length===0&&h.length===0?(function(){var y={};return y.totalChannels=i.payload.total_channels,y.totalOccupancy=i.payload.total_occupancy,y.channels={},Object.keys(i.payload.channels).forEach((function(A){var E=i.payload.channels[A],S=[];return y.channels[A]={occupants:S,name:A,occupancy:E.occupancy},b&&E.uuids.forEach((function(P){w?S.push({state:P.state,uuid:P.uuid}):S.push({state:null,uuid:P})})),y})),y})():(function(){var y={},A=[];return y.totalChannels=1,y.totalOccupancy=i.occupancy,y.channels={},y.channels[h[0]]={occupants:A,name:h[0],occupancy:i.occupancy},b&&i.uuids&&i.uuids.forEach((function(E){w?A.push({state:E.state,uuid:E.uuid}):A.push({state:null,uuid:E})})),y})()},handleError:function(s,i,a){a.statusCode!==402||this.getURL(s,i).includes("channel")||(a.errorData.message="You have tried to perform a Global Here Now operation, your keyset configuration does not support that. Please provide a channel, or enable the Global Here Now feature from the Portal.")}}),x2=Object.freeze({__proto__:null,getOperation:function(){return q.PNAddMessageActionOperation},validateParams:function(s,i){var a=s.config,d=i.action,h=i.channel;return i.messageTimetoken?a.subscribeKey?h?d?d.value?d.type?d.type.length>15?"Action.type value exceed maximum length of 15":void 0:"Missing Action.type":"Missing Action.value":"Missing Action":"Missing message channel":"Missing Subscribe Key":"Missing message timetoken"},usePost:function(){return!0},postURL:function(s,i){var a=s.config,d=i.channel,h=i.messageTimetoken;return"/v1/message-actions/".concat(a.subscribeKey,"/channel/").concat(we.encodeString(d),"/message/").concat(h)},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},getRequestHeaders:function(){return{"Content-Type":"application/json"}},isAuthSupported:function(){return!0},prepareParams:function(){return{}},postPayload:function(s,i){return i.action},handleResponse:function(s,i){return{data:i.data}}}),A2=Object.freeze({__proto__:null,getOperation:function(){return q.PNRemoveMessageActionOperation},validateParams:function(s,i){var a=s.config,d=i.channel,h=i.actionTimetoken;return i.messageTimetoken?h?a.subscribeKey?d?void 0:"Missing message channel":"Missing Subscribe Key":"Missing action timetoken":"Missing message timetoken"},useDelete:function(){return!0},getURL:function(s,i){var a=s.config,d=i.channel,h=i.actionTimetoken,p=i.messageTimetoken;return"/v1/message-actions/".concat(a.subscribeKey,"/channel/").concat(we.encodeString(d),"/message/").concat(p,"/action/").concat(h)},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(s,i){return{data:i.data}}}),M2=Object.freeze({__proto__:null,getOperation:function(){return q.PNGetMessageActionsOperation},validateParams:function(s,i){var a=s.config,d=i.channel;return a.subscribeKey?d?void 0:"Missing message channel":"Missing Subscribe Key"},getURL:function(s,i){var a=s.config,d=i.channel;return"/v1/message-actions/".concat(a.subscribeKey,"/channel/").concat(we.encodeString(d))},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.limit,d=i.start,h=i.end,p={};return a&&(p.limit=a),d&&(p.start=d),h&&(p.end=h),p},handleResponse:function(s,i){var a={data:i.data,start:null,end:null};return a.data.length&&(a.end=a.data[a.data.length-1].actionTimetoken,a.start=a.data[0].actionTimetoken),a}}),L2={getOperation:function(){return q.PNListFilesOperation},validateParams:function(s,i){if(!i?.channel)return"channel can't be empty"},getURL:function(s,i){var a=s.config;return"/v1/files/".concat(a.subscribeKey,"/channels/").concat(we.encodeString(i.channel),"/files")},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a={};return i.limit&&(a.limit=i.limit),i.next&&(a.next=i.next),a},handleResponse:function(s,i){return{status:i.status,data:i.data,next:i.next,count:i.count}}},$2={getOperation:function(){return q.PNGenerateUploadUrlOperation},validateParams:function(s,i){return i?.channel?i?.name?void 0:"name can't be empty":"channel can't be empty"},usePost:function(){return!0},postURL:function(s,i){var a=s.config;return"/v1/files/".concat(a.subscribeKey,"/channels/").concat(we.encodeString(i.channel),"/generate-upload-url")},postPayload:function(s,i){return{name:i.name}},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(s,i){return{status:i.status,data:i.data,file_upload_request:i.file_upload_request}}},V2={getOperation:function(){return q.PNPublishFileOperation},validateParams:function(s,i){return i?.channel?i?.fileId?i?.fileName?void 0:"file name can't be empty":"file id can't be empty":"channel can't be empty"},getURL:function(s,i){var a=s.config,d=a.publishKey,h=a.subscribeKey,p=(function(g,f){var b=JSON.stringify(f);if(g.cryptoModule){var _=g.cryptoModule.encrypt(b);b=typeof _=="string"?_:ye(_),b=JSON.stringify(b)}return b||""})(s,{message:i.message,file:{name:i.fileName,id:i.fileId}});return"/v1/files/publish-file/".concat(d,"/").concat(h,"/0/").concat(we.encodeString(i.channel),"/0/").concat(we.encodeString(p))},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a={};return i.ttl&&(a.ttl=i.ttl),i.storeInHistory!==void 0&&(a.store=i.storeInHistory?"1":"0"),i.meta&&typeof i.meta=="object"&&(a.meta=JSON.stringify(i.meta)),a},handleResponse:function(s,i){return{timetoken:i[2]}}},D2=function(s){var i=(function(a){var d=this,h=a.generateUploadUrl,p=a.publishFile,g=a.modules,f=g.PubNubFile,b=g.config,_=g.cryptography,w=g.cryptoModule,y=g.networking;return function(A){var E=A.channel,S=A.file,P=A.message,O=A.cipherKey,$=A.meta,G=A.ttl,re=A.storeInHistory;return o(d,void 0,void 0,(function(){var te,Q,T,N,L,W,V,U,x,J,j,H,Z,ie,Me,qe,Ge,Rn,yi,$t,hn,cf,df,fs,uf,bu,_u,sl,wu;return c(this,(function(Xe){switch(Xe.label){case 0:if(!E)throw new Ke("Validation failed, check status for details",qi("channel can't be empty"));if(!S)throw new Ke("Validation failed, check status for details",qi("file can't be empty"));return te=f.create(S),[4,h({channel:E,name:te.name})];case 1:return Q=Xe.sent(),T=Q.file_upload_request,N=T.url,L=T.form_fields,W=Q.data,V=W.id,U=W.name,f.supportsEncryptFile&&(O||w)?O!=null?[3,3]:[4,w.encryptFile(te,f)]:[3,6];case 2:return x=Xe.sent(),[3,5];case 3:return[4,_.encryptFile(O,te,f)];case 4:x=Xe.sent(),Xe.label=5;case 5:te=x,Xe.label=6;case 6:J=L,te.mimeType&&(J=L.map((function(Cu){return Cu.key==="Content-Type"?{key:Cu.key,value:te.mimeType}:Cu}))),Xe.label=7;case 7:return Xe.trys.push([7,21,,22]),f.supportsFileUri&&S.uri?(Z=(H=y).POSTFILE,ie=[N,J],[4,te.toFileUri()]):[3,10];case 8:return[4,Z.apply(H,ie.concat([Xe.sent()]))];case 9:return j=Xe.sent(),[3,20];case 10:return f.supportsFile?(qe=(Me=y).POSTFILE,Ge=[N,J],[4,te.toFile()]):[3,13];case 11:return[4,qe.apply(Me,Ge.concat([Xe.sent()]))];case 12:return j=Xe.sent(),[3,20];case 13:return f.supportsBuffer?(yi=(Rn=y).POSTFILE,$t=[N,J],[4,te.toBuffer()]):[3,16];case 14:return[4,yi.apply(Rn,$t.concat([Xe.sent()]))];case 15:return j=Xe.sent(),[3,20];case 16:return f.supportsBlob?(cf=(hn=y).POSTFILE,df=[N,J],[4,te.toBlob()]):[3,19];case 17:return[4,cf.apply(hn,df.concat([Xe.sent()]))];case 18:return j=Xe.sent(),[3,20];case 19:throw new Error("Unsupported environment");case 20:return[3,22];case 21:throw(fs=Xe.sent()).response&&typeof fs.response.text=="string"?(uf=fs.response.text,bu=/<Message>(.*)<\/Message>/gi.exec(uf),new Ke(bu?"Upload to bucket failed: ".concat(bu[1]):"Upload to bucket failed.",fs)):new Ke("Upload to bucket failed.",fs);case 22:if(j.status!==204)throw new Ke("Upload to bucket was unsuccessful",j);_u=b.fileUploadPublishRetryLimit,sl=!1,wu={timetoken:"0"},Xe.label=23;case 23:return Xe.trys.push([23,25,,26]),[4,p({channel:E,message:P,fileId:V,fileName:U,meta:$,storeInHistory:re,ttl:G})];case 24:return wu=Xe.sent(),sl=!0,[3,26];case 25:return Xe.sent(),_u-=1,[3,26];case 26:if(!sl&&_u>0)return[3,23];Xe.label=27;case 27:if(sl)return[2,{timetoken:wu.timetoken,id:V,name:U}];throw new Ke("Publish failed. You may want to execute that operation manually using pubnub.publishFile",{channel:E,id:V,name:U})}}))}))}})(s);return function(a,d){var h=i(a);return typeof d=="function"&&h.then((function(p){return d(null,p)})).catch((function(p){return d(p,null)})),h}},$d=function(s,i){var a=i.channel,d=i.id,h=i.name,p=s.config,g=s.networking,f=s.tokenManager;if(!a)throw new Ke("Validation failed, check status for details",qi("channel can't be empty"));if(!d)throw new Ke("Validation failed, check status for details",qi("file id can't be empty"));if(!h)throw new Ke("Validation failed, check status for details",qi("file name can't be empty"));var b="/v1/files/".concat(p.subscribeKey,"/channels/").concat(we.encodeString(a),"/files/").concat(d,"/").concat(h),_={};_.uuid=p.getUUID(),_.pnsdk=Fg(p);var w=f.getToken()||p.getAuthKey();w&&(_.auth=w),p.secretKey&&zg(s,b,_,{},{getOperation:function(){return"PubNubGetFileUrlOperation"}});var y=Object.keys(_).map((function(A){return"".concat(encodeURIComponent(A),"=").concat(encodeURIComponent(_[A]))})).join("&");return y!==""?"".concat(g.getStandardOrigin()).concat(b,"?").concat(y):"".concat(g.getStandardOrigin()).concat(b)},N2={getOperation:function(){return q.PNDownloadFileOperation},validateParams:function(s,i){return i?.channel?i?.name?i?.id?void 0:"id can't be empty":"name can't be empty":"channel can't be empty"},useGetFile:function(){return!0},getFileURL:function(s,i){var a=s.config;return"/v1/files/".concat(a.subscribeKey,"/channels/").concat(we.encodeString(i.channel),"/files/").concat(i.id,"/").concat(i.name)},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},ignoreBody:function(){return!0},forceBuffered:function(){return!0},prepareParams:function(){return{}},handleResponse:function(s,i,a){var d=s.PubNubFile,h=s.config,p=s.cryptography,g=s.cryptoModule;return o(void 0,void 0,void 0,(function(){var f,b,_,w;return c(this,(function(y){switch(y.label){case 0:return f=i.response.body,d.supportsEncryptFile&&(a.cipherKey||g)?a.cipherKey!=null?[3,2]:[4,g.decryptFile(d.create({data:f,name:a.name}),d)]:[3,5];case 1:return b=y.sent().data,[3,4];case 2:return[4,p.decrypt((_=a.cipherKey)!==null&&_!==void 0?_:h.cipherKey,f)];case 3:b=y.sent(),y.label=4;case 4:f=b,y.label=5;case 5:return[2,d.create({data:f,name:(w=i.response.name)!==null&&w!==void 0?w:a.name,mimeType:i.response.type})]}}))}))}},U2={getOperation:function(){return q.PNListFilesOperation},validateParams:function(s,i){return i?.channel?i?.id?i?.name?void 0:"file name can't be empty":"file id can't be empty":"channel can't be empty"},useDelete:function(){return!0},getURL:function(s,i){var a=s.config;return"/v1/files/".concat(a.subscribeKey,"/channels/").concat(we.encodeString(i.channel),"/files/").concat(i.id,"/").concat(i.name)},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(s,i){return{status:i.status}}},j2={getOperation:function(){return q.PNGetAllUUIDMetadataOperation},validateParams:function(){},getURL:function(s){var i=s.config;return"/v2/objects/".concat(i.subscribeKey,"/uuids")},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a,d,h,p,g,f,b,_,w,y={include:["status","type"]};return i?.include&&(!((a=i.include)===null||a===void 0)&&a.customFields)&&y.include.push("custom"),y.include=y.include.join(","),!((d=i?.include)===null||d===void 0)&&d.totalCount&&(y.count=(h=i.include)===null||h===void 0?void 0:h.totalCount),!((p=i?.page)===null||p===void 0)&&p.next&&(y.start=(g=i.page)===null||g===void 0?void 0:g.next),!((f=i?.page)===null||f===void 0)&&f.prev&&(y.end=(b=i.page)===null||b===void 0?void 0:b.prev),i?.filter&&(y.filter=i.filter),y.limit=(_=i?.limit)!==null&&_!==void 0?_:100,i?.sort&&(y.sort=Object.entries((w=i.sort)!==null&&w!==void 0?w:{}).map((function(A){var E=u(A,2),S=E[0],P=E[1];return P==="asc"||P==="desc"?"".concat(S,":").concat(P):S}))),y},handleResponse:function(s,i){return{status:i.status,data:i.data,totalCount:i.totalCount,next:i.next,prev:i.prev}}},B2={getOperation:function(){return q.PNGetUUIDMetadataOperation},validateParams:function(){},getURL:function(s,i){var a,d=s.config;return"/v2/objects/".concat(d.subscribeKey,"/uuids/").concat(we.encodeString((a=i?.uuid)!==null&&a!==void 0?a:d.getUUID()))},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a,d,h=s.config,p={};return p.uuid=(a=i?.uuid)!==null&&a!==void 0?a:h.getUUID(),p.include=["status","type","custom"],i?.include&&((d=i.include)===null||d===void 0?void 0:d.customFields)===!1&&p.include.pop(),p.include=p.include.join(","),p},handleResponse:function(s,i){return{status:i.status,data:i.data}}},F2={getOperation:function(){return q.PNSetUUIDMetadataOperation},validateParams:function(s,i){if(!i?.data)return"Data cannot be empty"},usePatch:function(){return!0},patchURL:function(s,i){var a,d=s.config;return"/v2/objects/".concat(d.subscribeKey,"/uuids/").concat(we.encodeString((a=i.uuid)!==null&&a!==void 0?a:d.getUUID()))},patchPayload:function(s,i){return i.data},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a,d,h=s.config,p={};return p.uuid=(a=i?.uuid)!==null&&a!==void 0?a:h.getUUID(),p.include=["status","type","custom"],i?.include&&((d=i.include)===null||d===void 0?void 0:d.customFields)===!1&&p.include.pop(),p.include=p.include.join(","),p},handleResponse:function(s,i){return{status:i.status,data:i.data}}},z2={getOperation:function(){return q.PNRemoveUUIDMetadataOperation},validateParams:function(){},getURL:function(s,i){var a,d=s.config;return"/v2/objects/".concat(d.subscribeKey,"/uuids/").concat(we.encodeString((a=i?.uuid)!==null&&a!==void 0?a:d.getUUID()))},useDelete:function(){return!0},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a,d=s.config;return{uuid:(a=i?.uuid)!==null&&a!==void 0?a:d.getUUID()}},handleResponse:function(s,i){return{status:i.status,data:i.data}}},H2={getOperation:function(){return q.PNGetAllChannelMetadataOperation},validateParams:function(){},getURL:function(s){var i=s.config;return"/v2/objects/".concat(i.subscribeKey,"/channels")},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a,d,h,p,g,f,b,_,w,y={include:["status","type"]};return i?.include&&(!((a=i.include)===null||a===void 0)&&a.customFields)&&y.include.push("custom"),y.include=y.include.join(","),!((d=i?.include)===null||d===void 0)&&d.totalCount&&(y.count=(h=i.include)===null||h===void 0?void 0:h.totalCount),!((p=i?.page)===null||p===void 0)&&p.next&&(y.start=(g=i.page)===null||g===void 0?void 0:g.next),!((f=i?.page)===null||f===void 0)&&f.prev&&(y.end=(b=i.page)===null||b===void 0?void 0:b.prev),i?.filter&&(y.filter=i.filter),y.limit=(_=i?.limit)!==null&&_!==void 0?_:100,i?.sort&&(y.sort=Object.entries((w=i.sort)!==null&&w!==void 0?w:{}).map((function(A){var E=u(A,2),S=E[0],P=E[1];return P==="asc"||P==="desc"?"".concat(S,":").concat(P):S}))),y},handleResponse:function(s,i){return{status:i.status,data:i.data,totalCount:i.totalCount,prev:i.prev,next:i.next}}},q2={getOperation:function(){return q.PNGetChannelMetadataOperation},validateParams:function(s,i){if(!i?.channel)return"Channel cannot be empty"},getURL:function(s,i){var a=s.config;return"/v2/objects/".concat(a.subscribeKey,"/channels/").concat(we.encodeString(i.channel))},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a,d={include:["status","type","custom"]};return i?.include&&((a=i.include)===null||a===void 0?void 0:a.customFields)===!1&&d.include.pop(),d.include=d.include.join(","),d},handleResponse:function(s,i){return{status:i.status,data:i.data}}},G2={getOperation:function(){return q.PNSetChannelMetadataOperation},validateParams:function(s,i){return i?.channel?i?.data?void 0:"Data cannot be empty":"Channel cannot be empty"},usePatch:function(){return!0},patchURL:function(s,i){var a=s.config;return"/v2/objects/".concat(a.subscribeKey,"/channels/").concat(we.encodeString(i.channel))},patchPayload:function(s,i){return i.data},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a,d={include:["status","type","custom"]};return i?.include&&((a=i.include)===null||a===void 0?void 0:a.customFields)===!1&&d.include.pop(),d.include=d.include.join(","),d},handleResponse:function(s,i){return{status:i.status,data:i.data}}},W2={getOperation:function(){return q.PNRemoveChannelMetadataOperation},validateParams:function(s,i){if(!i?.channel)return"Channel cannot be empty"},getURL:function(s,i){var a=s.config;return"/v2/objects/".concat(a.subscribeKey,"/channels/").concat(we.encodeString(i.channel))},useDelete:function(){return!0},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(s,i){return{status:i.status,data:i.data}}},K2={getOperation:function(){return q.PNGetMembersOperation},validateParams:function(s,i){if(!i?.channel)return"channel cannot be empty"},getURL:function(s,i){var a=s.config;return"/v2/objects/".concat(a.subscribeKey,"/channels/").concat(we.encodeString(i.channel),"/uuids")},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a,d,h,p,g,f,b,_,w,y,A,E,S,P,O={include:[]};return i?.include&&(!((a=i.include)===null||a===void 0)&&a.statusField&&O.include.push("status"),!((d=i.include)===null||d===void 0)&&d.customFields&&O.include.push("custom"),!((h=i.include)===null||h===void 0)&&h.UUIDFields&&O.include.push("uuid"),!((p=i.include)===null||p===void 0)&&p.customUUIDFields&&O.include.push("uuid.custom"),!((g=i.include)===null||g===void 0)&&g.UUIDStatusField&&O.include.push("uuid.status"),!((f=i.include)===null||f===void 0)&&f.UUIDTypeField&&O.include.push("uuid.type")),O.include=O.include.join(","),!((b=i?.include)===null||b===void 0)&&b.totalCount&&(O.count=(_=i.include)===null||_===void 0?void 0:_.totalCount),!((w=i?.page)===null||w===void 0)&&w.next&&(O.start=(y=i.page)===null||y===void 0?void 0:y.next),!((A=i?.page)===null||A===void 0)&&A.prev&&(O.end=(E=i.page)===null||E===void 0?void 0:E.prev),i?.filter&&(O.filter=i.filter),O.limit=(S=i?.limit)!==null&&S!==void 0?S:100,i?.sort&&(O.sort=Object.entries((P=i.sort)!==null&&P!==void 0?P:{}).map((function($){var G=u($,2),re=G[0],te=G[1];return te==="asc"||te==="desc"?"".concat(re,":").concat(te):re}))),O},handleResponse:function(s,i){return{status:i.status,data:i.data,totalCount:i.totalCount,prev:i.prev,next:i.next}}},Wg={getOperation:function(){return q.PNSetMembersOperation},validateParams:function(s,i){return i?.channel?i?.uuids&&i?.uuids.length!==0?void 0:"UUIDs cannot be empty":"Channel cannot be empty"},usePatch:function(){return!0},patchURL:function(s,i){var a=s.config;return"/v2/objects/".concat(a.subscribeKey,"/channels/").concat(we.encodeString(i.channel),"/uuids")},patchPayload:function(s,i){var a;return(a={set:[],delete:[]})[i.type]=i.uuids.map((function(d){return typeof d=="string"?{uuid:{id:d}}:{uuid:{id:d.id},custom:d.custom,status:d.status}})),a},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a,d,h,p,g,f,b,_,w,y={include:["uuid.status","uuid.type","type"]};return i?.include&&(!((a=i.include)===null||a===void 0)&&a.customFields&&y.include.push("custom"),!((d=i.include)===null||d===void 0)&&d.customUUIDFields&&y.include.push("uuid.custom"),!((h=i.include)===null||h===void 0)&&h.UUIDFields&&y.include.push("uuid")),y.include=y.include.join(","),!((p=i?.include)===null||p===void 0)&&p.totalCount&&(y.count=!0),!((g=i?.page)===null||g===void 0)&&g.next&&(y.start=(f=i.page)===null||f===void 0?void 0:f.next),!((b=i?.page)===null||b===void 0)&&b.prev&&(y.end=(_=i.page)===null||_===void 0?void 0:_.prev),i?.filter&&(y.filter=i.filter),i.limit!=null&&(y.limit=i.limit),i?.sort&&(y.sort=Object.entries((w=i.sort)!==null&&w!==void 0?w:{}).map((function(A){var E=u(A,2),S=E[0],P=E[1];return P==="asc"||P==="desc"?"".concat(S,":").concat(P):S}))),y},handleResponse:function(s,i){return{status:i.status,data:i.data,totalCount:i.totalCount,prev:i.prev,next:i.next}}},Q2={getOperation:function(){return q.PNGetMembershipsOperation},validateParams:function(){},getURL:function(s,i){var a,d=s.config;return"/v2/objects/".concat(d.subscribeKey,"/uuids/").concat(we.encodeString((a=i?.uuid)!==null&&a!==void 0?a:d.getUUID()),"/channels")},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a,d,h,p,g,f,b,_,w,y,A,E,S,P,O={include:[]};return i?.include&&(!((a=i.include)===null||a===void 0)&&a.statusField&&O.include.push("status"),!((d=i.include)===null||d===void 0)&&d.customFields&&O.include.push("custom"),!((h=i.include)===null||h===void 0)&&h.channelFields&&O.include.push("channel"),!((p=i.include)===null||p===void 0)&&p.customChannelFields&&O.include.push("channel.custom"),!((g=i.include)===null||g===void 0)&&g.channelStatusField&&O.include.push("channel.status"),!((f=i.include)===null||f===void 0)&&f.channelTypeField&&O.include.push("channel.type")),O.include=O.include.join(","),!((b=i?.include)===null||b===void 0)&&b.totalCount&&(O.count=(_=i.include)===null||_===void 0?void 0:_.totalCount),!((w=i?.page)===null||w===void 0)&&w.next&&(O.start=(y=i.page)===null||y===void 0?void 0:y.next),!((A=i?.page)===null||A===void 0)&&A.prev&&(O.end=(E=i.page)===null||E===void 0?void 0:E.prev),i?.filter&&(O.filter=i.filter),O.limit=(S=i?.limit)!==null&&S!==void 0?S:100,i?.sort&&(O.sort=Object.entries((P=i.sort)!==null&&P!==void 0?P:{}).map((function($){var G=u($,2),re=G[0],te=G[1];return te==="asc"||te==="desc"?"".concat(re,":").concat(te):re}))),O},handleResponse:function(s,i){return{status:i.status,data:i.data,totalCount:i.totalCount,prev:i.prev,next:i.next}}},Kg={getOperation:function(){return q.PNSetMembershipsOperation},validateParams:function(s,i){if(!i?.channels||i?.channels.length===0)return"Channels cannot be empty"},usePatch:function(){return!0},patchURL:function(s,i){var a,d=s.config;return"/v2/objects/".concat(d.subscribeKey,"/uuids/").concat(we.encodeString((a=i.uuid)!==null&&a!==void 0?a:d.getUUID()),"/channels")},patchPayload:function(s,i){var a;return(a={set:[],delete:[]})[i.type]=i.channels.map((function(d){return typeof d=="string"?{channel:{id:d}}:{channel:{id:d.id},custom:d.custom,status:d.status}})),a},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a,d,h,p,g,f,b,_,w,y={include:["channel.status","channel.type","status"]};return i?.include&&(!((a=i.include)===null||a===void 0)&&a.customFields&&y.include.push("custom"),!((d=i.include)===null||d===void 0)&&d.customChannelFields&&y.include.push("channel.custom"),!((h=i.include)===null||h===void 0)&&h.channelFields&&y.include.push("channel")),y.include=y.include.join(","),!((p=i?.include)===null||p===void 0)&&p.totalCount&&(y.count=!0),!((g=i?.page)===null||g===void 0)&&g.next&&(y.start=(f=i.page)===null||f===void 0?void 0:f.next),!((b=i?.page)===null||b===void 0)&&b.prev&&(y.end=(_=i.page)===null||_===void 0?void 0:_.prev),i?.filter&&(y.filter=i.filter),i.limit!=null&&(y.limit=i.limit),i?.sort&&(y.sort=Object.entries((w=i.sort)!==null&&w!==void 0?w:{}).map((function(A){var E=u(A,2),S=E[0],P=E[1];return P==="asc"||P==="desc"?"".concat(S,":").concat(P):S}))),y},handleResponse:function(s,i){return{status:i.status,data:i.data,totalCount:i.totalCount,prev:i.prev,next:i.next}}},X2=Object.freeze({__proto__:null,getOperation:function(){return q.PNAccessManagerAudit},validateParams:function(s){if(!s.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(s){var i=s.config;return"/v2/auth/audit/sub-key/".concat(i.subscribeKey)},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!1},prepareParams:function(s,i){var a=i.channel,d=i.channelGroup,h=i.authKeys,p=h===void 0?[]:h,g={};return a&&(g.channel=a),d&&(g["channel-group"]=d),p.length>0&&(g.auth=p.join(",")),g},handleResponse:function(s,i){return i.payload}}),Z2=Object.freeze({__proto__:null,getOperation:function(){return q.PNAccessManagerGrant},validateParams:function(s,i){var a=s.config;return a.subscribeKey?a.publishKey?a.secretKey?i.uuids==null||i.authKeys?i.uuids==null||i.channels==null&&i.channelGroups==null?void 0:"Both channel/channelgroup and uuid cannot be used in the same request":"authKeys are required for grant request on uuids":"Missing Secret Key":"Missing Publish Key":"Missing Subscribe Key"},getURL:function(s){var i=s.config;return"/v2/auth/grant/sub-key/".concat(i.subscribeKey)},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!1},prepareParams:function(s,i){var a=i.channels,d=a===void 0?[]:a,h=i.channelGroups,p=h===void 0?[]:h,g=i.uuids,f=g===void 0?[]:g,b=i.ttl,_=i.read,w=_!==void 0&&_,y=i.write,A=y!==void 0&&y,E=i.manage,S=E!==void 0&&E,P=i.get,O=P!==void 0&&P,$=i.join,G=$!==void 0&&$,re=i.update,te=re!==void 0&&re,Q=i.authKeys,T=Q===void 0?[]:Q,N=i.delete,L={};return L.r=w?"1":"0",L.w=A?"1":"0",L.m=S?"1":"0",L.d=N?"1":"0",L.g=O?"1":"0",L.j=G?"1":"0",L.u=te?"1":"0",d.length>0&&(L.channel=d.join(",")),p.length>0&&(L["channel-group"]=p.join(",")),T.length>0&&(L.auth=T.join(",")),f.length>0&&(L["target-uuid"]=f.join(",")),(b||b===0)&&(L.ttl=b),L},handleResponse:function(){return{}}});function Qg(s){var i,a,d,h,p=s?.authorizedUserId!==void 0,g=((i=s?.resources)===null||i===void 0?void 0:i.users)!==void 0,f=((a=s?.resources)===null||a===void 0?void 0:a.spaces)!==void 0,b=((d=s?.patterns)===null||d===void 0?void 0:d.users)!==void 0,_=((h=s?.patterns)===null||h===void 0?void 0:h.spaces)!==void 0;return b||g||_||f||p}function Pt(s){var i=0;return s.join&&(i|=128),s.update&&(i|=64),s.get&&(i|=32),s.delete&&(i|=8),s.manage&&(i|=4),s.write&&(i|=2),s.read&&(i|=1),i}function J2(s,i){if(Qg(i))return(function(S,P){var O=P.ttl,$=P.resources,G=P.patterns,re=P.meta,te=P.authorizedUserId,Q={ttl:0,permissions:{resources:{channels:{},groups:{},uuids:{},users:{},spaces:{}},patterns:{channels:{},groups:{},uuids:{},users:{},spaces:{}},meta:{}}};if($){var T=$.users,N=$.spaces,L=$.groups;T&&Object.keys(T).forEach((function(x){Q.permissions.resources.uuids[x]=Pt(T[x])})),N&&Object.keys(N).forEach((function(x){Q.permissions.resources.channels[x]=Pt(N[x])})),L&&Object.keys(L).forEach((function(x){Q.permissions.resources.groups[x]=Pt(L[x])}))}if(G){var W=G.users,V=G.spaces,U=G.groups;W&&Object.keys(W).forEach((function(x){Q.permissions.patterns.uuids[x]=Pt(W[x])})),V&&Object.keys(V).forEach((function(x){Q.permissions.patterns.channels[x]=Pt(V[x])})),U&&Object.keys(U).forEach((function(x){Q.permissions.patterns.groups[x]=Pt(U[x])}))}return(O||O===0)&&(Q.ttl=O),re&&(Q.permissions.meta=re),te&&(Q.permissions.uuid="".concat(te)),Q})(0,i);var a=i.ttl,d=i.resources,h=i.patterns,p=i.meta,g=i.authorized_uuid,f={ttl:0,permissions:{resources:{channels:{},groups:{},uuids:{},users:{},spaces:{}},patterns:{channels:{},groups:{},uuids:{},users:{},spaces:{}},meta:{}}};if(d){var b=d.uuids,_=d.channels,w=d.groups;b&&Object.keys(b).forEach((function(S){f.permissions.resources.uuids[S]=Pt(b[S])})),_&&Object.keys(_).forEach((function(S){f.permissions.resources.channels[S]=Pt(_[S])})),w&&Object.keys(w).forEach((function(S){f.permissions.resources.groups[S]=Pt(w[S])}))}if(h){var y=h.uuids,A=h.channels,E=h.groups;y&&Object.keys(y).forEach((function(S){f.permissions.patterns.uuids[S]=Pt(y[S])})),A&&Object.keys(A).forEach((function(S){f.permissions.patterns.channels[S]=Pt(A[S])})),E&&Object.keys(E).forEach((function(S){f.permissions.patterns.groups[S]=Pt(E[S])}))}return(a||a===0)&&(f.ttl=a),p&&(f.permissions.meta=p),g&&(f.permissions.uuid="".concat(g)),f}var Y2=Object.freeze({__proto__:null,getOperation:function(){return q.PNAccessManagerGrantToken},extractPermissions:Pt,validateParams:function(s,i){var a,d,h,p,g,f,b=s.config;if(!b.subscribeKey)return"Missing Subscribe Key";if(!b.publishKey)return"Missing Publish Key";if(!b.secretKey)return"Missing Secret Key";if(!i.resources&&!i.patterns)return"Missing either Resources or Patterns.";var _=i?.authorized_uuid!==void 0,w=((a=i?.resources)===null||a===void 0?void 0:a.uuids)!==void 0,y=((d=i?.resources)===null||d===void 0?void 0:d.channels)!==void 0,A=((h=i?.resources)===null||h===void 0?void 0:h.groups)!==void 0,E=((p=i?.patterns)===null||p===void 0?void 0:p.uuids)!==void 0,S=((g=i?.patterns)===null||g===void 0?void 0:g.channels)!==void 0,P=((f=i?.patterns)===null||f===void 0?void 0:f.groups)!==void 0,O=_||w||E||y||S||A||P;return Qg(i)&&O?"Cannot mix `users`, `spaces` and `authorizedUserId` with `uuids`, `channels`, `groups` and `authorized_uuid`":(!i.resources||i.resources.uuids&&Object.keys(i.resources.uuids).length!==0||i.resources.channels&&Object.keys(i.resources.channels).length!==0||i.resources.groups&&Object.keys(i.resources.groups).length!==0||i.resources.users&&Object.keys(i.resources.users).length!==0||i.resources.spaces&&Object.keys(i.resources.spaces).length!==0)&&(!i.patterns||i.patterns.uuids&&Object.keys(i.patterns.uuids).length!==0||i.patterns.channels&&Object.keys(i.patterns.channels).length!==0||i.patterns.groups&&Object.keys(i.patterns.groups).length!==0||i.patterns.users&&Object.keys(i.patterns.users).length!==0||i.patterns.spaces&&Object.keys(i.patterns.spaces).length!==0)?void 0:"Missing values for either Resources or Patterns."},postURL:function(s){var i=s.config;return"/v3/pam/".concat(i.subscribeKey,"/grant")},usePost:function(){return!0},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!1},prepareParams:function(){return{}},postPayload:function(s,i){return J2(0,i)},handleResponse:function(s,i){return i.data.token}}),e_={getOperation:function(){return q.PNAccessManagerRevokeToken},validateParams:function(s,i){return s.config.secretKey?i?void 0:"token can't be empty":"Missing Secret Key"},getURL:function(s,i){var a=s.config;return"/v3/pam/".concat(a.subscribeKey,"/grant/").concat(we.encodeString(i))},useDelete:function(){return!0},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!1},prepareParams:function(s){return{uuid:s.config.getUUID()}},handleResponse:function(s,i){return{status:i.status,data:i.data}}};function Xg(s,i){var a=JSON.stringify(i);if(s.cryptoModule){var d=s.cryptoModule.encrypt(a);a=typeof d=="string"?d:ye(d),a=JSON.stringify(a)}return a||""}var t_=Object.freeze({__proto__:null,getOperation:function(){return q.PNPublishOperation},validateParams:function(s,i){var a=s.config,d=i.message;return i.channel?d?a.subscribeKey?void 0:"Missing Subscribe Key":"Missing Message":"Missing Channel"},usePost:function(s,i){var a=i.sendByPost;return a!==void 0&&a},getURL:function(s,i){var a=s.config,d=i.channel,h=Xg(s,i.message);return"/publish/".concat(a.publishKey,"/").concat(a.subscribeKey,"/0/").concat(we.encodeString(d),"/0/").concat(we.encodeString(h))},postURL:function(s,i){var a=s.config,d=i.channel;return"/publish/".concat(a.publishKey,"/").concat(a.subscribeKey,"/0/").concat(we.encodeString(d),"/0")},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},postPayload:function(s,i){return Xg(s,i.message)},prepareParams:function(s,i){var a=i.meta,d=i.replicate,h=d===void 0||d,p=i.storeInHistory,g=i.ttl,f={};return p!=null&&(f.store=p?"1":"0"),g&&(f.ttl=g),h===!1&&(f.norep="true"),a&&typeof a=="object"&&(f.meta=JSON.stringify(a)),f},handleResponse:function(s,i){return{timetoken:i[2]}}}),n_=Object.freeze({__proto__:null,getOperation:function(){return q.PNSignalOperation},validateParams:function(s,i){var a=s.config,d=i.message;return i.channel?d?a.subscribeKey?void 0:"Missing Subscribe Key":"Missing Message":"Missing Channel"},getURL:function(s,i){var a,d=s.config,h=i.channel,p=(a=i.message,JSON.stringify(a));return"/signal/".concat(d.publishKey,"/").concat(d.subscribeKey,"/0/").concat(we.encodeString(h),"/0/").concat(we.encodeString(p))},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(s,i){return{timetoken:i[2]}}}),i_=Object.freeze({__proto__:null,getOperation:function(){return q.PNHistoryOperation},validateParams:function(s,i){var a=i.channel,d=s.config;return a?d.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"},getURL:function(s,i){var a=i.channel,d=s.config;return"/v2/history/sub-key/".concat(d.subscribeKey,"/channel/").concat(we.encodeString(a))},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.start,d=i.end,h=i.reverse,p=i.count,g=p===void 0?100:p,f=i.stringifiedTimeToken,b=f!==void 0&&f,_=i.includeMeta,w=_!==void 0&&_,y={include_token:"true"};return y.count=g,a&&(y.start=a),d&&(y.end=d),b&&(y.string_message_token="true"),h!=null&&(y.reverse=h.toString()),w&&(y.include_meta="true"),y},handleResponse:function(s,i){var a={messages:[],startTimeToken:i[1],endTimeToken:i[2]};return Array.isArray(i[0])&&i[0].forEach((function(d){var h=(function(g,f){var b={};if(!g.cryptoModule)return b.payload=f,b;try{var _=g.cryptoModule.decrypt(f),w=_ instanceof ArrayBuffer?JSON.parse(new TextDecoder().decode(_)):_;return b.payload=w,b}catch(y){g.config.logVerbosity&&console&&console.log&&console.log("decryption error",y.message),b.payload=f,b.error="Error while decrypting message content: ".concat(y.message)}return b})(s,d.message),p={timetoken:d.timetoken,entry:h.payload};d.meta&&(p.meta=d.meta),h.error&&(p.error=h.error),a.messages.push(p)})),a}}),r_=Object.freeze({__proto__:null,getOperation:function(){return q.PNDeleteMessagesOperation},validateParams:function(s,i){var a=i.channel,d=s.config;return a?d.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"},useDelete:function(){return!0},getURL:function(s,i){var a=i.channel,d=s.config;return"/v3/history/sub-key/".concat(d.subscribeKey,"/channel/").concat(we.encodeString(a))},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.start,d=i.end,h={};return a&&(h.start=a),d&&(h.end=d),h},handleResponse:function(s,i){return i.payload}}),o_=Object.freeze({__proto__:null,getOperation:function(){return q.PNMessageCounts},validateParams:function(s,i){var a=i.channels,d=i.timetoken,h=i.channelTimetokens,p=s.config;return a?d&&h?"timetoken and channelTimetokens are incompatible together":h&&h.length>1&&a.length!==h.length?"Length of channelTimetokens and channels do not match":p.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"},getURL:function(s,i){var a=i.channels,d=s.config,h=a.join(",");return"/v3/history/sub-key/".concat(d.subscribeKey,"/message-counts/").concat(we.encodeString(h))},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.timetoken,d=i.channelTimetokens,h={};if(d&&d.length===1){var p=u(d,1)[0];h.timetoken=p}else d?h.channelsTimetoken=d.join(","):a&&(h.timetoken=a);return h},handleResponse:function(s,i){return{channels:i.channels}}}),s_=Object.freeze({__proto__:null,getOperation:function(){return q.PNFetchMessagesOperation},validateParams:function(s,i){var a=i.channels,d=i.includeMessageActions,h=d!==void 0&&d,p=s.config;if(!a||a.length===0)return"Missing channels";if(!p.subscribeKey)return"Missing Subscribe Key";if(h&&a.length>1)throw new TypeError("History can return actions data for a single channel only. Either pass a single channel or disable the includeMessageActions flag.")},getURL:function(s,i){var a=i.channels,d=a===void 0?[]:a,h=i.includeMessageActions,p=h!==void 0&&h,g=s.config,f=p?"history-with-actions":"history",b=d.length>0?d.join(","):",";return"/v3/".concat(f,"/sub-key/").concat(g.subscribeKey,"/channel/").concat(we.encodeString(b))},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=i.channels,d=i.start,h=i.end,p=i.includeMessageActions,g=i.count,f=i.stringifiedTimeToken,b=f!==void 0&&f,_=i.includeMeta,w=_!==void 0&&_,y=i.includeUuid,A=i.includeUUID,E=A===void 0||A,S=i.includeMessageType,P=S===void 0||S,O={};return O.max=g||(a.length>1||p===!0?25:100),d&&(O.start=d),h&&(O.end=h),b&&(O.string_message_token="true"),w&&(O.include_meta="true"),E&&y!==!1&&(O.include_uuid="true"),P&&(O.include_message_type="true"),O},handleResponse:function(s,i){var a={channels:{}};return Object.keys(i.channels||{}).forEach((function(d){a.channels[d]=[],(i.channels[d]||[]).forEach((function(h){var p={},g=(function(f,b){var _={};if(!f.cryptoModule)return _.payload=b,_;try{var w=f.cryptoModule.decrypt(b),y=w instanceof ArrayBuffer?JSON.parse(new TextDecoder().decode(w)):w;return _.payload=y,_}catch(A){f.config.logVerbosity&&console&&console.log&&console.log("decryption error",A.message),_.payload=b,_.error="Error while decrypting message content: ".concat(A.message)}return _})(s,h.message);p.channel=d,p.timetoken=h.timetoken,p.message=g.payload,p.messageType=h.message_type,p.uuid=h.uuid,h.actions&&(p.actions=h.actions,p.data=h.actions),h.meta&&(p.meta=h.meta),g.error&&(p.error=g.error),a.channels[d].push(p)}))})),i.more&&(a.more=i.more),a}}),a_=Object.freeze({__proto__:null,getOperation:function(){return q.PNTimeOperation},getURL:function(){return"/time/0"},getRequestTimeout:function(s){return s.config.getTransactionTimeout()},prepareParams:function(){return{}},isAuthSupported:function(){return!1},handleResponse:function(s,i){return{timetoken:i[0]}},validateParams:function(){}}),l_=Object.freeze({__proto__:null,getOperation:function(){return q.PNSubscribeOperation},validateParams:function(s){if(!s.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(s,i){var a=s.config,d=i.channels,h=d===void 0?[]:d,p=h.length>0?h.join(","):",";return"/v2/subscribe/".concat(a.subscribeKey,"/").concat(we.encodeString(p),"/0")},getRequestTimeout:function(s){return s.config.getSubscribeTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a=s.config,d=i.state,h=i.channelGroups,p=h===void 0?[]:h,g=i.timetoken,f=i.filterExpression,b=i.region,_={heartbeat:a.getPresenceTimeout()};return p.length>0&&(_["channel-group"]=p.join(",")),f&&f.length>0&&(_["filter-expr"]=f),Object.keys(d).length&&(_.state=JSON.stringify(d)),g&&(_.tt=g),b&&(_.tr=b),_},handleResponse:function(s,i){var a=[];i.m.forEach((function(h){var p={timetoken:h.p.t,region:h.p.r},g={shard:parseInt(h.a,10),subscriptionMatch:h.b,channel:h.c,messageType:h.e,payload:h.d,flags:h.f,issuingClientId:h.i,subscribeKey:h.k,originationTimetoken:h.o,userMetadata:h.u,publishMetaData:p};a.push(g)}));var d={timetoken:i.t.t,region:i.t.r};return{messages:a,metadata:d}}}),c_={getOperation:function(){return q.PNHandshakeOperation},validateParams:function(s,i){if(!i?.channels&&!i?.channelGroups)return"channels and channleGroups both should not be empty"},getURL:function(s,i){var a=s.config,d=i.channels,h=d===void 0?[]:d,p=h.length>0?h.join(","):",";return"/v2/subscribe/".concat(a.subscribeKey,"/").concat(we.encodeString(p),"/0")},getRequestTimeout:function(s){return s.config.getSubscribeTimeout()},isAuthSupported:function(){return!0},prepareParams:function(s,i){var a={};return i.channelGroups&&i.channelGroups.length>0&&(a["channel-group"]=i.channelGroups.join(",")),a.tt=0,i.state&&(a.state=JSON.stringify(i.state)),i.filterExpression&&i.filterExpression.length>0&&(a["filter-expr"]=i.filterExpression),a.ee="",a},handleResponse:function(s,i){return{region:i.t.r,timetoken:i.t.t}}},d_={getOperation:function(){return q.PNReceiveMessagesOperation},validateParams:function(s,i){return i?.channels||i?.channelGroups?i?.timetoken?i?.region?void 0:"region can not be empty":"timetoken can not be empty":"channels and channleGroups both should not be empty"},getURL:function(s,i){var a=s.config,d=i.channels,h=d===void 0?[]:d,p=h.length>0?h.join(","):",";return"/v2/subscribe/".concat(a.subscribeKey,"/").concat(we.encodeString(p),"/0")},getRequestTimeout:function(s){return s.config.getSubscribeTimeout()},isAuthSupported:function(){return!0},getAbortSignal:function(s,i){return i.abortSignal},prepareParams:function(s,i){var a={};return i.channelGroups&&i.channelGroups.length>0&&(a["channel-group"]=i.channelGroups.join(",")),i.filterExpression&&i.filterExpression.length>0&&(a["filter-expr"]=i.filterExpression),a.tt=i.timetoken,a.tr=i.region,a.ee="",a},handleResponse:function(s,i){var a=[];return i.m.forEach((function(d){var h={shard:parseInt(d.a,10),subscriptionMatch:d.b,channel:d.c,messageType:d.e,payload:d.d,flags:d.f,issuingClientId:d.i,subscribeKey:d.k,originationTimetoken:d.o,userMetadata:d.u,publishMetaData:{timetoken:d.p.t,region:d.p.r}};a.push(h)})),{messages:a,metadata:{region:i.t.r,timetoken:i.t.t}}}},Zg=(function(){function s(i){i===void 0&&(i=!1),this.sync=i,this.listeners=new Set}return s.prototype.subscribe=function(i){var a=this;return this.listeners.add(i),function(){a.listeners.delete(i)}},s.prototype.notify=function(i){var a=this,d=function(){a.listeners.forEach((function(h){h(i)}))};this.sync?d():setTimeout(d,0)},s})(),ht=(function(){function s(i){this.label=i,this.transitionMap=new Map,this.enterEffects=[],this.exitEffects=[]}return s.prototype.transition=function(i,a){var d;if(this.transitionMap.has(a.type))return(d=this.transitionMap.get(a.type))===null||d===void 0?void 0:d(i,a)},s.prototype.on=function(i,a){return this.transitionMap.set(i,a),this},s.prototype.with=function(i,a){return[this,i,a??[]]},s.prototype.onEnter=function(i){return this.enterEffects.push(i),this},s.prototype.onExit=function(i){return this.exitEffects.push(i),this},s})(),Jg=(function(s){function i(){return s!==null&&s.apply(this,arguments)||this}return t(i,s),i.prototype.describe=function(a){return new ht(a)},i.prototype.start=function(a,d){this.currentState=a,this.currentContext=d,this.notify({type:"engineStarted",state:a,context:d})},i.prototype.transition=function(a){var d,h,p,g,f,b;if(!this.currentState)throw new Error("Start the engine first");this.notify({type:"eventReceived",event:a});var _=this.currentState.transition(this.currentContext,a);if(_){var w=u(_,3),y=w[0],A=w[1],E=w[2];try{for(var S=l(this.currentState.exitEffects),P=S.next();!P.done;P=S.next()){var O=P.value;this.notify({type:"invocationDispatched",invocation:O(this.currentContext)})}}catch(N){d={error:N}}finally{try{P&&!P.done&&(h=S.return)&&h.call(S)}finally{if(d)throw d.error}}var $=this.currentState;this.currentState=y;var G=this.currentContext;this.currentContext=A,this.notify({type:"transitionDone",fromState:$,fromContext:G,toState:y,toContext:A,event:a});try{for(var re=l(E),te=re.next();!te.done;te=re.next())O=te.value,this.notify({type:"invocationDispatched",invocation:O})}catch(N){p={error:N}}finally{try{te&&!te.done&&(g=re.return)&&g.call(re)}finally{if(p)throw p.error}}try{for(var Q=l(this.currentState.enterEffects),T=Q.next();!T.done;T=Q.next())O=T.value,this.notify({type:"invocationDispatched",invocation:O(this.currentContext)})}catch(N){f={error:N}}finally{try{T&&!T.done&&(b=Q.return)&&b.call(Q)}finally{if(f)throw f.error}}}},i})(Zg),Yg=(function(){function s(i){this.dependencies=i,this.instances=new Map,this.handlers=new Map}return s.prototype.on=function(i,a){this.handlers.set(i,a)},s.prototype.dispatch=function(i){if(i.type!=="CANCEL"){var a=this.handlers.get(i.type);if(!a)throw new Error("Unhandled invocation '".concat(i.type,"'"));var d=a(i.payload,this.dependencies);i.managed&&this.instances.set(i.type,d),d.start()}else if(this.instances.has(i.payload)){var h=this.instances.get(i.payload);h?.cancel(),this.instances.delete(i.payload)}},s.prototype.dispose=function(){var i,a;try{for(var d=l(this.instances.entries()),h=d.next();!h.done;h=d.next()){var p=u(h.value,2),g=p[0];p[1].cancel(),this.instances.delete(g)}}catch(f){i={error:f}}finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}},s})();function He(s,i){var a=function(){for(var d=[],h=0;h<arguments.length;h++)d[h]=arguments[h];return{type:s,payload:i?.apply(void 0,m([],u(d),!1))}};return a.type=s,a}function ns(s,i){var a=function(){for(var d=[],h=0;h<arguments.length;h++)d[h]=arguments[h];return{type:s,payload:i.apply(void 0,m([],u(d),!1)),managed:!1}};return a.type=s,a}function Nr(s,i){var a=function(){for(var d=[],h=0;h<arguments.length;h++)d[h]=arguments[h];return{type:s,payload:i.apply(void 0,m([],u(d),!1)),managed:!0}};return a.type=s,a.cancel={type:"CANCEL",payload:s,managed:!1},a}var e1=(function(s){function i(){var a=this.constructor,d=s.call(this,"The operation was aborted.")||this;return d.name="AbortError",Object.setPrototypeOf(d,a.prototype),d}return t(i,s),i})(Error),u_=(function(s){function i(){var a=s!==null&&s.apply(this,arguments)||this;return a._aborted=!1,a}return t(i,s),Object.defineProperty(i.prototype,"aborted",{get:function(){return this._aborted},enumerable:!1,configurable:!0}),i.prototype.throwIfAborted=function(){if(this._aborted)throw new e1},i.prototype.abort=function(){this._aborted=!0,this.notify(new e1)},i})(Zg),h_=(function(s){function i(a,d,h){var p=s.call(this,a,d)||this;return p.asyncFunction=h,p.abortSignal=new u_,p}return t(i,s),i.prototype.start=function(){this.asyncFunction(this.payload,this.abortSignal,this.dependencies).catch((function(a){}))},i.prototype.cancel=function(){this.abortSignal.abort()},i})((function(s,i){this.payload=s,this.dependencies=i})),Ht=function(s){return function(i,a){return new h_(i,a,s)}},Vd=Nr("HANDSHAKE",(function(s,i){return{channels:s,groups:i}})),Dd=Nr("RECEIVE_MESSAGES",(function(s,i,a){return{channels:s,groups:i,cursor:a}})),Nd=ns("EMIT_MESSAGES",(function(s){return s})),Sn=ns("EMIT_STATUS",(function(s){return s})),Ud=Nr("RECEIVE_RECONNECT",(function(s){return s})),jd=Nr("HANDSHAKE_RECONNECT",(function(s){return s})),Lt=He("SUBSCRIPTION_CHANGED",(function(s,i){return{channels:s,groups:i}})),sn=He("SUBSCRIPTION_RESTORED",(function(s,i,a,d){return{channels:s,groups:i,cursor:{timetoken:a,region:d??0}}})),t1=He("HANDSHAKE_SUCCESS",(function(s){return s})),n1=He("HANDSHAKE_FAILURE",(function(s){return s})),i1=He("HANDSHAKE_RECONNECT_SUCCESS",(function(s){return{cursor:s}})),r1=He("HANDSHAKE_RECONNECT_FAILURE",(function(s){return s})),o1=He("HANDSHAKE_RECONNECT_GIVEUP",(function(s){return s})),s1=He("RECEIVE_SUCCESS",(function(s,i){return{cursor:s,events:i}})),a1=He("RECEIVE_FAILURE",(function(s){return s})),l1=He("RECEIVE_RECONNECT_SUCCESS",(function(s,i){return{cursor:s,events:i}})),c1=He("RECEIVE_RECONNECT_FAILURE",(function(s){return s})),d1=He("RECEIVING_RECONNECT_GIVEUP",(function(s){return s})),is=He("DISCONNECT",(function(){return{}})),rs=He("RECONNECT",(function(s,i){return{cursor:{timetoken:s??"",region:i??0}}})),di=He("UNSUBSCRIBE_ALL",(function(){return{}})),p_=(function(s){function i(a,d){var h=s.call(this,d)||this;return h.on(Vd.type,Ht((function(p,g,f){var b=f.handshake,_=f.presenceState,w=f.config;return o(h,void 0,void 0,(function(){var y,A;return c(this,(function(E){switch(E.label){case 0:g.throwIfAborted(),E.label=1;case 1:return E.trys.push([1,3,,4]),[4,b(n({abortSignal:g,channels:p.channels,channelGroups:p.groups,filterExpression:w.filterExpression},w.maintainPresenceState&&{state:_}))];case 2:return y=E.sent(),[2,a.transition(t1(y))];case 3:return(A=E.sent())instanceof Error&&A.message==="Aborted"?[2]:A instanceof Ke?[2,a.transition(n1(A))]:[3,4];case 4:return[2]}}))}))}))),h.on(Dd.type,Ht((function(p,g,f){var b=f.receiveMessages,_=f.config;return o(h,void 0,void 0,(function(){var w,y;return c(this,(function(A){switch(A.label){case 0:g.throwIfAborted(),A.label=1;case 1:return A.trys.push([1,3,,4]),[4,b({abortSignal:g,channels:p.channels,channelGroups:p.groups,timetoken:p.cursor.timetoken,region:p.cursor.region,filterExpression:_.filterExpression})];case 2:return w=A.sent(),a.transition(s1(w.metadata,w.messages)),[3,4];case 3:return(y=A.sent())instanceof Error&&y.message==="Aborted"?[2]:y instanceof Ke&&!g.aborted?[2,a.transition(a1(y))]:[3,4];case 4:return[2]}}))}))}))),h.on(Nd.type,Ht((function(p,g,f){var b=f.emitMessages;return o(h,void 0,void 0,(function(){return c(this,(function(_){return p.length>0&&b(p),[2]}))}))}))),h.on(Sn.type,Ht((function(p,g,f){var b=f.emitStatus;return o(h,void 0,void 0,(function(){return c(this,(function(_){return b(p),[2]}))}))}))),h.on(Ud.type,Ht((function(p,g,f){var b=f.receiveMessages,_=f.delay,w=f.config;return o(h,void 0,void 0,(function(){var y,A;return c(this,(function(E){switch(E.label){case 0:return w.retryConfiguration&&w.retryConfiguration.shouldRetry(p.reason,p.attempts)?(g.throwIfAborted(),[4,_(w.retryConfiguration.getDelay(p.attempts,p.reason))]):[3,6];case 1:E.sent(),g.throwIfAborted(),E.label=2;case 2:return E.trys.push([2,4,,5]),[4,b({abortSignal:g,channels:p.channels,channelGroups:p.groups,timetoken:p.cursor.timetoken,region:p.cursor.region,filterExpression:w.filterExpression})];case 3:return y=E.sent(),[2,a.transition(l1(y.metadata,y.messages))];case 4:return(A=E.sent())instanceof Error&&A.message==="Aborted"?[2]:A instanceof Ke?[2,a.transition(c1(A))]:[3,5];case 5:return[3,7];case 6:return[2,a.transition(d1(new Ke(w.retryConfiguration.getGiveupReason(p.reason,p.attempts))))];case 7:return[2]}}))}))}))),h.on(jd.type,Ht((function(p,g,f){var b=f.handshake,_=f.delay,w=f.presenceState,y=f.config;return o(h,void 0,void 0,(function(){var A,E;return c(this,(function(S){switch(S.label){case 0:return y.retryConfiguration&&y.retryConfiguration.shouldRetry(p.reason,p.attempts)?(g.throwIfAborted(),[4,_(y.retryConfiguration.getDelay(p.attempts,p.reason))]):[3,6];case 1:S.sent(),g.throwIfAborted(),S.label=2;case 2:return S.trys.push([2,4,,5]),[4,b(n({abortSignal:g,channels:p.channels,channelGroups:p.groups,filterExpression:y.filterExpression},y.maintainPresenceState&&{state:w}))];case 3:return A=S.sent(),[2,a.transition(i1(A))];case 4:return(E=S.sent())instanceof Error&&E.message==="Aborted"?[2]:E instanceof Ke?[2,a.transition(r1(E))]:[3,5];case 5:return[3,7];case 6:return[2,a.transition(o1(new Ke(y.retryConfiguration.getGiveupReason(p.reason,p.attempts))))];case 7:return[2]}}))}))}))),h}return t(i,s),i})(Yg),os=new ht("HANDSHAKE_FAILED");os.on(Lt.type,(function(s,i){return Qe.with({channels:i.payload.channels,groups:i.payload.groups,cursor:s.cursor})})),os.on(rs.type,(function(s,i){return Qe.with({channels:s.channels,groups:s.groups,cursor:i.payload.cursor||s.cursor})})),os.on(sn.type,(function(s,i){var a,d;return Qe.with({channels:i.payload.channels,groups:i.payload.groups,cursor:{timetoken:i.payload.cursor.timetoken,region:i.payload.cursor.region?i.payload.cursor.region:(d=(a=s?.cursor)===null||a===void 0?void 0:a.region)!==null&&d!==void 0?d:0}})})),os.on(di.type,(function(s){return wt.with()}));var ui=new ht("HANDSHAKE_STOPPED");ui.on(Lt.type,(function(s,i){return ui.with({channels:i.payload.channels,groups:i.payload.groups,cursor:s.cursor})})),ui.on(rs.type,(function(s,i){return Qe.with(n(n({},s),{cursor:i.payload.cursor||s.cursor}))})),ui.on(sn.type,(function(s,i){var a;return ui.with({channels:i.payload.channels,groups:i.payload.groups,cursor:{timetoken:i.payload.cursor.timetoken,region:i.payload.cursor.region||((a=s?.cursor)===null||a===void 0?void 0:a.region)||0}})})),ui.on(di.type,(function(s){return wt.with()}));var ss=new ht("RECEIVE_FAILED");ss.on(rs.type,(function(s,i){var a;return Qe.with({channels:s.channels,groups:s.groups,cursor:{timetoken:i.payload.cursor.timetoken?(a=i.payload.cursor)===null||a===void 0?void 0:a.timetoken:s.cursor.timetoken,region:i.payload.cursor.region||s.cursor.region}})})),ss.on(Lt.type,(function(s,i){return Qe.with({channels:i.payload.channels,groups:i.payload.groups,cursor:s.cursor})})),ss.on(sn.type,(function(s,i){return Qe.with({channels:i.payload.channels,groups:i.payload.groups,cursor:{timetoken:i.payload.cursor.timetoken,region:i.payload.cursor.region||s.cursor.region}})})),ss.on(di.type,(function(s){return wt.with(void 0)}));var hi=new ht("RECEIVE_STOPPED");hi.on(Lt.type,(function(s,i){return hi.with({channels:i.payload.channels,groups:i.payload.groups,cursor:s.cursor})})),hi.on(sn.type,(function(s,i){return hi.with({channels:i.payload.channels,groups:i.payload.groups,cursor:{timetoken:i.payload.cursor.timetoken,region:i.payload.cursor.region||s.cursor.region}})})),hi.on(rs.type,(function(s,i){var a;return Qe.with({channels:s.channels,groups:s.groups,cursor:{timetoken:i.payload.cursor.timetoken?(a=i.payload.cursor)===null||a===void 0?void 0:a.timetoken:s.cursor.timetoken,region:i.payload.cursor.region||s.cursor.region}})})),hi.on(di.type,(function(){return wt.with(void 0)}));var qt=new ht("RECEIVE_RECONNECTING");qt.onEnter((function(s){return Ud(s)})),qt.onExit((function(){return Ud.cancel})),qt.on(l1.type,(function(s,i){return pt.with({channels:s.channels,groups:s.groups,cursor:i.payload.cursor},[Nd(i.payload.events)])})),qt.on(c1.type,(function(s,i){return qt.with(n(n({},s),{attempts:s.attempts+1,reason:i.payload}))})),qt.on(d1.type,(function(s,i){var a;return ss.with({groups:s.groups,channels:s.channels,cursor:s.cursor,reason:i.payload},[Sn({category:B.PNDisconnectedUnexpectedlyCategory,error:(a=i.payload)===null||a===void 0?void 0:a.message})])})),qt.on(is.type,(function(s){return hi.with({channels:s.channels,groups:s.groups,cursor:s.cursor},[Sn({category:B.PNDisconnectedCategory})])})),qt.on(sn.type,(function(s,i){return pt.with({channels:i.payload.channels,groups:i.payload.groups,cursor:{timetoken:i.payload.cursor.timetoken,region:i.payload.cursor.region||s.cursor.region}})})),qt.on(Lt.type,(function(s,i){return pt.with({channels:i.payload.channels,groups:i.payload.groups,cursor:s.cursor})})),qt.on(di.type,(function(s){return wt.with(void 0,[Sn({category:B.PNDisconnectedCategory})])}));var pt=new ht("RECEIVING");pt.onEnter((function(s){return Dd(s.channels,s.groups,s.cursor)})),pt.onExit((function(){return Dd.cancel})),pt.on(s1.type,(function(s,i){return pt.with({channels:s.channels,groups:s.groups,cursor:i.payload.cursor},[Nd(i.payload.events)])})),pt.on(Lt.type,(function(s,i){return i.payload.channels.length===0&&i.payload.groups.length===0?wt.with(void 0):pt.with({cursor:s.cursor,channels:i.payload.channels,groups:i.payload.groups})})),pt.on(sn.type,(function(s,i){return i.payload.channels.length===0&&i.payload.groups.length===0?wt.with(void 0):pt.with({channels:i.payload.channels,groups:i.payload.groups,cursor:{timetoken:i.payload.cursor.timetoken,region:i.payload.cursor.region||s.cursor.region}})})),pt.on(a1.type,(function(s,i){return qt.with(n(n({},s),{attempts:0,reason:i.payload}))})),pt.on(is.type,(function(s){return hi.with({channels:s.channels,groups:s.groups,cursor:s.cursor},[Sn({category:B.PNDisconnectedCategory})])})),pt.on(di.type,(function(s){return wt.with(void 0,[Sn({category:B.PNDisconnectedCategory})])}));var Gt=new ht("HANDSHAKE_RECONNECTING");Gt.onEnter((function(s){return jd(s)})),Gt.onExit((function(){return jd.cancel})),Gt.on(i1.type,(function(s,i){var a,d,h={timetoken:!((a=s.cursor)===null||a===void 0)&&a.timetoken?(d=s.cursor)===null||d===void 0?void 0:d.timetoken:i.payload.cursor.timetoken,region:i.payload.cursor.region};return pt.with({channels:s.channels,groups:s.groups,cursor:h},[Sn({category:B.PNConnectedCategory})])})),Gt.on(r1.type,(function(s,i){return Gt.with(n(n({},s),{attempts:s.attempts+1,reason:i.payload}))})),Gt.on(o1.type,(function(s,i){var a;return os.with({groups:s.groups,channels:s.channels,cursor:s.cursor,reason:i.payload},[Sn({category:B.PNConnectionErrorCategory,error:(a=i.payload)===null||a===void 0?void 0:a.message})])})),Gt.on(is.type,(function(s){return ui.with({channels:s.channels,groups:s.groups,cursor:s.cursor})})),Gt.on(Lt.type,(function(s,i){return Qe.with({channels:i.payload.channels,groups:i.payload.groups,cursor:s.cursor})})),Gt.on(sn.type,(function(s,i){var a,d;return Qe.with({channels:i.payload.channels,groups:i.payload.groups,cursor:{timetoken:i.payload.cursor.timetoken,region:((a=i.payload.cursor)===null||a===void 0?void 0:a.region)||((d=s?.cursor)===null||d===void 0?void 0:d.region)||0}})})),Gt.on(di.type,(function(s){return wt.with(void 0)}));var Qe=new ht("HANDSHAKING");Qe.onEnter((function(s){return Vd(s.channels,s.groups)})),Qe.onExit((function(){return Vd.cancel})),Qe.on(Lt.type,(function(s,i){return i.payload.channels.length===0&&i.payload.groups.length===0?wt.with(void 0):Qe.with({channels:i.payload.channels,groups:i.payload.groups,cursor:s.cursor})})),Qe.on(t1.type,(function(s,i){var a,d;return pt.with({channels:s.channels,groups:s.groups,cursor:{timetoken:!((a=s?.cursor)===null||a===void 0)&&a.timetoken?(d=s?.cursor)===null||d===void 0?void 0:d.timetoken:i.payload.timetoken,region:i.payload.region}},[Sn({category:B.PNConnectedCategory})])})),Qe.on(n1.type,(function(s,i){return Gt.with({channels:s.channels,groups:s.groups,cursor:s.cursor,attempts:0,reason:i.payload})})),Qe.on(is.type,(function(s){return ui.with({channels:s.channels,groups:s.groups,cursor:s.cursor})})),Qe.on(sn.type,(function(s,i){var a;return Qe.with({channels:i.payload.channels,groups:i.payload.groups,cursor:{timetoken:i.payload.cursor.timetoken,region:i.payload.cursor.region||((a=s?.cursor)===null||a===void 0?void 0:a.region)||0}})})),Qe.on(di.type,(function(s){return wt.with()}));var wt=new ht("UNSUBSCRIBED");wt.on(Lt.type,(function(s,i){return Qe.with({channels:i.payload.channels,groups:i.payload.groups})})),wt.on(sn.type,(function(s,i){return Qe.with({channels:i.payload.channels,groups:i.payload.groups,cursor:i.payload.cursor})}));var m_=(function(){function s(i){var a=this;this.engine=new Jg,this.channels=[],this.groups=[],this.dependencies=i,this.dispatcher=new p_(this.engine,i),this._unsubscribeEngine=this.engine.subscribe((function(d){d.type==="invocationDispatched"&&a.dispatcher.dispatch(d.invocation)})),this.engine.start(wt,void 0)}return Object.defineProperty(s.prototype,"_engine",{get:function(){return this.engine},enumerable:!1,configurable:!0}),s.prototype.subscribe=function(i){var a=this,d=i.channels,h=i.channelGroups,p=i.timetoken,g=i.withPresence;this.channels=m(m([],u(this.channels),!1),u(d??[]),!1),this.groups=m(m([],u(this.groups),!1),u(h??[]),!1),g&&(this.channels.map((function(f){return a.channels.push("".concat(f,"-pnpres"))})),this.groups.map((function(f){return a.groups.push("".concat(f,"-pnpres"))}))),p?this.engine.transition(sn(Array.from(new Set(m(m([],u(this.channels),!1),u(d??[]),!1))),Array.from(new Set(m(m([],u(this.groups),!1),u(h??[]),!1))),p)):this.engine.transition(Lt(Array.from(new Set(m(m([],u(this.channels),!1),u(d??[]),!1))),Array.from(new Set(m(m([],u(this.groups),!1),u(h??[]),!1))))),this.dependencies.join&&this.dependencies.join({channels:Array.from(new Set(this.channels.filter((function(f){return!f.endsWith("-pnpres")})))),groups:Array.from(new Set(this.groups.filter((function(f){return!f.endsWith("-pnpres")}))))})},s.prototype.unsubscribe=function(i){var a=this,d=i.channels,h=d===void 0?[]:d,p=i.channelGroups,g=p===void 0?[]:p,f=we.removeSingleOccurance(this.channels,m(m([],u(h),!1),u(h.map((function(y){return"".concat(y,"-pnpres")}))),!1)),b=we.removeSingleOccurance(this.groups,m(m([],u(g),!1),u(g.map((function(y){return"".concat(y,"-pnpres")}))),!1));if(new Set(this.channels).size!==new Set(f).size||new Set(this.groups).size!==new Set(b).size){var _=we.findUniqueCommonElements(this.channels,h),w=we.findUniqueCommonElements(this.groups,g);this.dependencies.presenceState&&(_?.forEach((function(y){return delete a.dependencies.presenceState[y]})),w?.forEach((function(y){return delete a.dependencies.presenceState[y]}))),this.channels=f,this.groups=b,this.engine.transition(Lt(Array.from(new Set(this.channels.slice(0))),Array.from(new Set(this.groups.slice(0))))),this.dependencies.leave&&this.dependencies.leave({channels:_.slice(0),groups:w.slice(0)})}},s.prototype.unsubscribeAll=function(){this.channels=[],this.groups=[],this.dependencies.presenceState&&(this.dependencies.presenceState={}),this.engine.transition(Lt(this.channels.slice(0),this.groups.slice(0))),this.dependencies.leaveAll&&this.dependencies.leaveAll()},s.prototype.reconnect=function(i){var a=i.timetoken,d=i.region;this.engine.transition(rs(a,d))},s.prototype.disconnect=function(){this.engine.transition(is()),this.dependencies.leaveAll&&this.dependencies.leaveAll()},s.prototype.getSubscribedChannels=function(){return Array.from(new Set(this.channels))},s.prototype.getSubscribedChannelGroups=function(){return Array.from(new Set(this.groups))},s.prototype.dispose=function(){this.disconnect(),this._unsubscribeEngine(),this.dispatcher.dispose()},s})(),u1=He("RECONNECT",(function(){return{}})),Ha=He("DISCONNECT",(function(){return{}})),Gi=He("JOINED",(function(s,i){return{channels:s,groups:i}})),Ur=He("LEFT",(function(s,i){return{channels:s,groups:i}})),jr=He("LEFT_ALL",(function(){return{}})),qa=He("HEARTBEAT_SUCCESS",(function(s){return{statusCode:s}})),Ga=He("HEARTBEAT_FAILURE",(function(s){return s})),h1=He("HEARTBEAT_GIVEUP",(function(){return{}})),p1=He("TIMES_UP",(function(){return{}})),m1=ns("HEARTBEAT",(function(s,i){return{channels:s,groups:i}})),Ot=ns("LEAVE",(function(s,i){return{channels:s,groups:i}})),g_=ns("EMIT_STATUS",(function(s){return s})),Bd=Nr("WAIT",(function(){return{}})),Fd=Nr("DELAYED_HEARTBEAT",(function(s){return s})),f_=(function(s){function i(a,d){var h=s.call(this,d)||this;return h.on(m1.type,Ht((function(p,g,f){var b=f.heartbeat,_=f.presenceState,w=f.config;return o(h,void 0,void 0,(function(){var y;return c(this,(function(A){switch(A.label){case 0:return A.trys.push([0,2,,3]),[4,b(n({channels:p.channels,channelGroups:p.groups},w.maintainPresenceState&&{state:_}))];case 1:return A.sent(),a.transition(qa(200)),[3,3];case 2:return(y=A.sent())instanceof Ke?[2,a.transition(Ga(y))]:[3,3];case 3:return[2]}}))}))}))),h.on(Ot.type,Ht((function(p,g,f){var b=f.leave,_=f.config;return o(h,void 0,void 0,(function(){return c(this,(function(w){switch(w.label){case 0:if(_.suppressLeaveEvents)return[3,4];w.label=1;case 1:return w.trys.push([1,3,,4]),[4,b({channels:p.channels,channelGroups:p.groups})];case 2:case 3:return w.sent(),[3,4];case 4:return[2]}}))}))}))),h.on(Bd.type,Ht((function(p,g,f){var b=f.heartbeatDelay;return o(h,void 0,void 0,(function(){return c(this,(function(_){switch(_.label){case 0:return g.throwIfAborted(),[4,b()];case 1:return _.sent(),g.throwIfAborted(),[2,a.transition(p1())]}}))}))}))),h.on(Fd.type,Ht((function(p,g,f){var b=f.heartbeat,_=f.retryDelay,w=f.presenceState,y=f.config;return o(h,void 0,void 0,(function(){var A;return c(this,(function(E){switch(E.label){case 0:return y.retryConfiguration&&y.retryConfiguration.shouldRetry(p.reason,p.attempts)?(g.throwIfAborted(),[4,_(y.retryConfiguration.getDelay(p.attempts,p.reason))]):[3,6];case 1:E.sent(),g.throwIfAborted(),E.label=2;case 2:return E.trys.push([2,4,,5]),[4,b(n({channels:p.channels,channelGroups:p.groups},y.maintainPresenceState&&{state:w}))];case 3:return E.sent(),[2,a.transition(qa(200))];case 4:return(A=E.sent())instanceof Error&&A.message==="Aborted"?[2]:A instanceof Ke?[2,a.transition(Ga(A))]:[3,5];case 5:return[3,7];case 6:return[2,a.transition(h1())];case 7:return[2]}}))}))}))),h.on(g_.type,Ht((function(p,g,f){var b=f.emitStatus,_=f.config;return o(h,void 0,void 0,(function(){var w;return c(this,(function(y){return _.announceFailedHeartbeats&&((w=p?.status)===null||w===void 0?void 0:w.error)===!0?b(p.status):_.announceSuccessfulHeartbeats&&p.statusCode===200&&b(n(n({},p),{operation:q.PNHeartbeatOperation,error:!1})),[2]}))}))}))),h}return t(i,s),i})(Yg),an=new ht("HEARTBEAT_STOPPED");an.on(Gi.type,(function(s,i){return an.with({channels:m(m([],u(s.channels),!1),u(i.payload.channels),!1),groups:m(m([],u(s.groups),!1),u(i.payload.groups),!1)})})),an.on(Ur.type,(function(s,i){return an.with({channels:s.channels.filter((function(a){return!i.payload.channels.includes(a)})),groups:s.groups.filter((function(a){return!i.payload.groups.includes(a)}))})})),an.on(u1.type,(function(s,i){return tt.with({channels:s.channels,groups:s.groups})})),an.on(jr.type,(function(s,i){return Wi.with(void 0)}));var Pn=new ht("HEARTBEAT_COOLDOWN");Pn.onEnter((function(){return Bd()})),Pn.onExit((function(){return Bd.cancel})),Pn.on(p1.type,(function(s,i){return tt.with({channels:s.channels,groups:s.groups})})),Pn.on(Gi.type,(function(s,i){return tt.with({channels:m(m([],u(s.channels),!1),u(i.payload.channels),!1),groups:m(m([],u(s.groups),!1),u(i.payload.groups),!1)})})),Pn.on(Ur.type,(function(s,i){return tt.with({channels:s.channels.filter((function(a){return!i.payload.channels.includes(a)})),groups:s.groups.filter((function(a){return!i.payload.groups.includes(a)}))},[Ot(i.payload.channels,i.payload.groups)])})),Pn.on(Ha.type,(function(s){return an.with({channels:s.channels,groups:s.groups},[Ot(s.channels,s.groups)])})),Pn.on(jr.type,(function(s,i){return Wi.with(void 0,[Ot(s.channels,s.groups)])}));var Br=new ht("HEARTBEAT_FAILED");Br.on(Gi.type,(function(s,i){return tt.with({channels:m(m([],u(s.channels),!1),u(i.payload.channels),!1),groups:m(m([],u(s.groups),!1),u(i.payload.groups),!1)})})),Br.on(Ur.type,(function(s,i){return tt.with({channels:s.channels.filter((function(a){return!i.payload.channels.includes(a)})),groups:s.groups.filter((function(a){return!i.payload.groups.includes(a)}))},[Ot(i.payload.channels,i.payload.groups)])})),Br.on(u1.type,(function(s,i){return tt.with({channels:s.channels,groups:s.groups})})),Br.on(Ha.type,(function(s,i){return an.with({channels:s.channels,groups:s.groups},[Ot(s.channels,s.groups)])})),Br.on(jr.type,(function(s,i){return Wi.with(void 0,[Ot(s.channels,s.groups)])}));var Wt=new ht("HEARBEAT_RECONNECTING");Wt.onEnter((function(s){return Fd(s)})),Wt.onExit((function(){return Fd.cancel})),Wt.on(Gi.type,(function(s,i){return tt.with({channels:m(m([],u(s.channels),!1),u(i.payload.channels),!1),groups:m(m([],u(s.groups),!1),u(i.payload.groups),!1)})})),Wt.on(Ur.type,(function(s,i){return tt.with({channels:s.channels.filter((function(a){return!i.payload.channels.includes(a)})),groups:s.groups.filter((function(a){return!i.payload.groups.includes(a)}))},[Ot(i.payload.channels,i.payload.groups)])})),Wt.on(Ha.type,(function(s,i){an.with({channels:s.channels,groups:s.groups},[Ot(s.channels,s.groups)])})),Wt.on(qa.type,(function(s,i){return Pn.with({channels:s.channels,groups:s.groups})})),Wt.on(Ga.type,(function(s,i){return Wt.with(n(n({},s),{attempts:s.attempts+1,reason:i.payload}))})),Wt.on(h1.type,(function(s,i){return Br.with({channels:s.channels,groups:s.groups})})),Wt.on(jr.type,(function(s,i){return Wi.with(void 0,[Ot(s.channels,s.groups)])}));var tt=new ht("HEARTBEATING");tt.onEnter((function(s){return m1(s.channels,s.groups)})),tt.on(qa.type,(function(s,i){return Pn.with({channels:s.channels,groups:s.groups})})),tt.on(Gi.type,(function(s,i){return tt.with({channels:m(m([],u(s.channels),!1),u(i.payload.channels),!1),groups:m(m([],u(s.groups),!1),u(i.payload.groups),!1)})})),tt.on(Ur.type,(function(s,i){return tt.with({channels:s.channels.filter((function(a){return!i.payload.channels.includes(a)})),groups:s.groups.filter((function(a){return!i.payload.groups.includes(a)}))},[Ot(i.payload.channels,i.payload.groups)])})),tt.on(Ga.type,(function(s,i){return Wt.with(n(n({},s),{attempts:0,reason:i.payload}))})),tt.on(Ha.type,(function(s){return an.with({channels:s.channels,groups:s.groups},[Ot(s.channels,s.groups)])})),tt.on(jr.type,(function(s,i){return Wi.with(void 0,[Ot(s.channels,s.groups)])}));var Wi=new ht("HEARTBEAT_INACTIVE");Wi.on(Gi.type,(function(s,i){return tt.with({channels:i.payload.channels,groups:i.payload.groups})}));var y_=(function(){function s(i){var a=this;this.engine=new Jg,this.channels=[],this.groups=[],this.dispatcher=new f_(this.engine,i),this.dependencies=i,this._unsubscribeEngine=this.engine.subscribe((function(d){d.type==="invocationDispatched"&&a.dispatcher.dispatch(d.invocation)})),this.engine.start(Wi,void 0)}return Object.defineProperty(s.prototype,"_engine",{get:function(){return this.engine},enumerable:!1,configurable:!0}),s.prototype.join=function(i){var a=i.channels,d=i.groups;this.channels=m(m([],u(this.channels),!1),u(a??[]),!1),this.groups=m(m([],u(this.groups),!1),u(d??[]),!1),this.engine.transition(Gi(this.channels.slice(0),this.groups.slice(0)))},s.prototype.leave=function(i){var a=this,d=i.channels,h=i.groups;this.dependencies.presenceState&&(d?.forEach((function(p){return delete a.dependencies.presenceState[p]})),h?.forEach((function(p){return delete a.dependencies.presenceState[p]}))),this.engine.transition(Ur(d??[],h??[]))},s.prototype.leaveAll=function(){this.engine.transition(jr())},s.prototype.dispose=function(){this._unsubscribeEngine(),this.dispatcher.dispose()},s})(),g1=(function(){function s(){}return s.LinearRetryPolicy=function(i){return{delay:i.delay,maximumRetry:i.maximumRetry,shouldRetry:function(a,d){var h;return((h=a?.status)===null||h===void 0?void 0:h.statusCode)!==403&&this.maximumRetry>d},getDelay:function(a,d){var h;return 1e3*(((h=d.retryAfter)!==null&&h!==void 0?h:this.delay)+Math.random())},getGiveupReason:function(a,d){var h;return this.maximumRetry<=d?"retry attempts exhaused.":((h=a?.status)===null||h===void 0?void 0:h.statusCode)===403?"forbidden operation.":"unknown error"}}},s.ExponentialRetryPolicy=function(i){return{minimumDelay:i.minimumDelay,maximumDelay:i.maximumDelay,maximumRetry:i.maximumRetry,shouldRetry:function(a,d){var h;return((h=a?.status)===null||h===void 0?void 0:h.statusCode)!==403&&this.maximumRetry>d},getDelay:function(a,d){var h;return 1e3*(((h=d.retryAfter)!==null&&h!==void 0?h:Math.min(Math.pow(2,a),this.maximumDelay))+Math.random())},getGiveupReason:function(a,d){var h;return this.maximumRetry<=d?"retry attempts exhaused.":((h=a?.status)===null||h===void 0?void 0:h.statusCode)===403?"forbidden operation.":"unknown error"}}},s})(),v_=(function(){function s(i){var a=i.modules,d=i.listenerManager,h=i.getFileUrl;this.modules=a,this.listenerManager=d,this.getFileUrl=h,this._channelListenerMap=new Map,this._groupListenerMap=new Map,a.cryptoModule&&(this._decoder=new TextDecoder)}return s.prototype.emitEvent=function(i){var a=i.channel,d=i.publishMetaData,h=i.subscriptionMatch;if(a===h&&(h=null),i.channel.endsWith("-pnpres")){var p={channel:null,subscription:null};a&&(p.channel=a.substring(0,a.lastIndexOf("-pnpres"))),h&&(p.subscription=h.substring(0,h.lastIndexOf("-pnpres"))),p.action=i.payload.action,p.state=i.payload.data,p.timetoken=d.timetoken,p.occupancy=i.payload.occupancy,p.uuid=i.payload.uuid,p.timestamp=i.payload.timestamp,i.payload.join&&(p.join=i.payload.join),i.payload.leave&&(p.leave=i.payload.leave),i.payload.timeout&&(p.timeout=i.payload.timeout),p.actualChannel=h!=null?a:null,p.subscribedChannel=h??a,this.listenerManager.announcePresence(p),this._announce("presence",p,p.channel,p.subscription)}else if(i.messageType===1)(p={channel:null,subscription:null}).channel=a,p.subscription=h,p.timetoken=d.timetoken,p.publisher=i.issuingClientId,i.userMetadata&&(p.userMetadata=i.userMetadata),p.message=i.payload,this.listenerManager.announceSignal(p),this._announce("signal",p,p.channel,p.subscription);else if(i.messageType===2){if((p={channel:null,subscription:null}).channel=a,p.subscription=h,p.timetoken=d.timetoken,p.publisher=i.issuingClientId,i.userMetadata&&(p.userMetadata=i.userMetadata),p.message={event:i.payload.event,type:i.payload.type,data:i.payload.data},this.listenerManager.announceObjects(p),this._announce("objects",p,p.channel,p.subscription),i.payload.type==="uuid"){var g=this._renameChannelField(p),f=n(n({},g),{message:n(n({},g.message),{event:this._renameEvent(g.message.event),type:"user"})});this.listenerManager.announceUser(f),this._announce("user",f,p.channel,p.subscription)}else if(i.payload.type==="channel"){g=this._renameChannelField(p);var b=n(n({},g),{message:n(n({},g.message),{event:this._renameEvent(g.message.event),type:"space"})});this.listenerManager.announceSpace(b),this._announce("space",b,p.channel,p.subscription)}else if(i.payload.type==="membership"){var _=(g=this._renameChannelField(p)).message.data,w=_.uuid,y=_.channel,A=r(_,["uuid","channel"]);A.user=w,A.space=y;var E=n(n({},g),{message:n(n({},g.message),{event:this._renameEvent(g.message.event),data:A})});this.listenerManager.announceMembership(E),this._announce("membership",E,p.channel,p.subscription)}}else if(i.messageType===3)(p={}).channel=a,p.subscription=h,p.timetoken=d.timetoken,p.publisher=i.issuingClientId,p.data={messageTimetoken:i.payload.data.messageTimetoken,actionTimetoken:i.payload.data.actionTimetoken,type:i.payload.data.type,uuid:i.issuingClientId,value:i.payload.data.value},p.event=i.payload.event,this.listenerManager.announceMessageAction(p),this._announce("messageAction",p,p.channel,p.subscription);else if(i.messageType===4){(p={}).channel=a,p.subscription=h,p.timetoken=d.timetoken,p.publisher=i.issuingClientId;var S=i.payload;if(this.modules.cryptoModule){var P=void 0;try{P=(O=this.modules.cryptoModule.decrypt(i.payload))instanceof ArrayBuffer?JSON.parse(this._decoder.decode(O)):O}catch($){P=null,p.error="Error while decrypting message content: ".concat($.message)}P!==null&&(S=P)}i.userMetadata&&(p.userMetadata=i.userMetadata),p.message=S.message,p.file={id:S.file.id,name:S.file.name,url:this.getFileUrl({id:S.file.id,name:S.file.name,channel:a})},this.listenerManager.announceFile(p),this._announce("file",p,p.channel,p.subscription)}else{if((p={channel:null,subscription:null}).channel=a,p.subscription=h,p.timetoken=d.timetoken,p.publisher=i.issuingClientId,i.userMetadata&&(p.userMetadata=i.userMetadata),this.modules.cryptoModule){P=void 0;try{var O;P=(O=this.modules.cryptoModule.decrypt(i.payload))instanceof ArrayBuffer?JSON.parse(this._decoder.decode(O)):O}catch($){P=null,p.error="Error while decrypting message content: ".concat($.message)}p.message=P??i.payload}else p.message=i.payload;p.actualChannel=h!=null?a:null,p.subscribedChannel=h??a,this.listenerManager.announceMessage(p),this._announce("message",p,p.channel,p.subscription)}},s.prototype.addListener=function(i,a,d){var h=this;a&&d?(a?.forEach((function(p){h._channelListenerMap[p]?h._channelListenerMap[p].includes(i)||h._channelListenerMap[p].push(i):h._channelListenerMap[p]=[i]})),d?.forEach((function(p){h._groupListenerMap[p]?h._groupListenerMap[p].includes(i)||h._groupListenerMap[p].push(i):h._groupListenerMap[p]=[i]}))):this.listenerManager.addListener(i)},s.prototype.removeListener=function(i,a,d){var h=this;a&&d?(a?.forEach((function(p){var g;h._channelListenerMap[p]=(g=h._channelListenerMap[p])===null||g===void 0?void 0:g.filter((function(f){return f!==i}))})),d?.forEach((function(p){var g;h._groupListenerMap[p]=(g=h._groupListenerMap[p])===null||g===void 0?void 0:g.filter((function(f){return f!==i}))}))):this.listenerManager.removeListener(i)},s.prototype.removeAllListeners=function(){this.listenerManager.removeAllListeners()},s.prototype._renameEvent=function(i){return i==="set"?"updated":"removed"},s.prototype._renameChannelField=function(i){var a=i.channel,d=r(i,["channel"]);return d.spaceId=a,d},s.prototype._announce=function(i,a,d,h){var p,g;(p=this._channelListenerMap[d])===null||p===void 0||p.forEach((function(f){return f[i]&&f[i](a)})),(g=this._groupListenerMap[h])===null||g===void 0||g.forEach((function(f){return f[i]&&f[i](a)}))},s})(),f1=(function(){function s(){}return s.prototype.subscribe=function(){var i,a;this.pubnub.subscribe(n({channels:this.channelNames,channelGroups:this.groupNames},((a=(i=this.options)===null||i===void 0?void 0:i.cursor)===null||a===void 0?void 0:a.timetoken)&&{timetoken:this.options.cursor.timetoken}))},s.prototype.unsubscribe=function(){this.pubnub.unsubscribe({channels:this.channelNames.filter((function(i){return!i.endsWith("-pnpres")})),channelGroups:this.groupNames.filter((function(i){return!i.endsWith("-pnpres")}))})},Object.defineProperty(s.prototype,"onMessage",{set:function(i){this.listener.message=i},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onPresence",{set:function(i){this.listener.presence=i},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onSignal",{set:function(i){this.listener.signal=i},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onObjects",{set:function(i){this.listener.objects=i},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onMessageAction",{set:function(i){this.listener.messageAction=i},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onFile",{set:function(i){this.listener.file=i},enumerable:!1,configurable:!0}),s.prototype.addListener=function(i){this.eventEmitter.addListener(i,this.channelNames.filter((function(a){return!a.endsWith("-pnpres")})),this.groupNames.filter((function(a){return!a.endsWith("-pnpres")})))},s.prototype.removeListener=function(i){this.eventEmitter.removeListener(i,this.channelNames,this.groupNames)},Object.defineProperty(s.prototype,"channels",{get:function(){return this.channelNames.slice(0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"channelGroups",{get:function(){return this.groupNames.slice(0)},enumerable:!1,configurable:!0}),s})(),y1=(function(s){function i(a){var d=a.channels,h=d===void 0?[]:d,p=a.channelGroups,g=p===void 0?[]:p,f=a.subscriptionOptions,b=a.eventEmitter,_=a.pubnub,w=s.call(this)||this;return w.channelNames=[],w.groupNames=[],w.subscriptionList=[],w.options=f,w.eventEmitter=b,w.pubnub=_,h.filter((function(y){return!y.endsWith("-pnpres")})).forEach((function(y){var A=w.pubnub.channel(y).subscription(w.options);w.channelNames=m(m([],u(w.channelNames),!1),u(A.channels),!1),w.subscriptionList.push(A)})),g.filter((function(y){return!y.endsWith("-pnpres")})).forEach((function(y){var A=w.pubnub.channelGroup(y).subscription(w.options);w.groupNames=m(m([],u(w.groupNames),!1),u(A.channelGroups),!1),w.subscriptionList.push(A)})),w.listener={},b.addListener(w.listener,w.channelNames.filter((function(y){return!y.endsWith("-pnpres")})),w.groupNames.filter((function(y){return!y.endsWith("-pnpres")}))),w}return t(i,s),i.prototype.addSubscription=function(a){this.subscriptionList.push(a),this.channelNames=m(m([],u(this.channelNames),!1),u(a.channels),!1),this.groupNames=m(m([],u(this.groupNames),!1),u(a.channelGroups),!1),this.eventEmitter.addListener(this.listener,a.channels,a.channelGroups)},i.prototype.removeSubscription=function(a){var d=a.channels,h=a.channelGroups;this.channelNames=this.channelNames.filter((function(p){return!d.includes(p)})),this.groupNames=this.groupNames.filter((function(p){return!h.includes(p)})),this.subscriptionList=this.subscriptionList.filter((function(p){return p!==a})),this.eventEmitter.removeListener(this.listener,d,h)},i.prototype.addSubscriptionSet=function(a){this.subscriptionList=m(m([],u(this.subscriptionList),!1),u(a.subscriptions),!1),this.channelNames=m(m([],u(this.channelNames),!1),u(a.channels),!1),this.groupNames=m(m([],u(this.groupNames),!1),u(a.channelGroups),!1),this.eventEmitter.addListener(this.listener,a.channels,a.channelGroups)},i.prototype.removeSubscriptionSet=function(a){var d=a.channels,h=a.channelGroups;this.channelNames=this.channelNames.filter((function(p){return!d.includes(p)})),this.groupNames=this.groupNames.filter((function(p){return!h.includes(p)})),this.subscriptionList=this.subscriptionList.filter((function(p){return!a.subscriptions.includes(p)})),this.eventEmitter.removeListener(this.listener,d,h)},Object.defineProperty(i.prototype,"subscriptions",{get:function(){return this.subscriptionList.slice(0)},enumerable:!1,configurable:!0}),i})(f1),Wa=(function(s){function i(a){var d=a.channels,h=a.channelGroups,p=a.subscriptionOptions,g=a.eventEmitter,f=a.pubnub,b=s.call(this)||this;return b.channelNames=[],b.groupNames=[],b.channelNames=d,b.groupNames=h,b.options=p,b.pubnub=f,b.eventEmitter=g,b.listener={},g.addListener(b.listener,b.channelNames.filter((function(_){return!_.endsWith("-pnpres")})),b.groupNames.filter((function(_){return!_.endsWith("-pnpres")}))),b}return t(i,s),i.prototype.addSubscription=function(a){return new y1({channels:m(m([],u(this.channelNames),!1),u(a.channels),!1),channelGroups:m(m([],u(this.groupNames),!1),u(a.channelGroups),!1),subscriptionOptions:n(n({},this.options),a?.options),eventEmitter:this.eventEmitter,pubnub:this.pubnub})},i})(f1),b_=(function(){function s(i,a,d){this.name=i,this.eventEmitter=a,this.pubnub=d}return s.prototype.subscription=function(i){return new Wa({channels:i?.receivePresenceEvents?[this.name,"".concat(this.name,"-pnpres")]:[this.name],channelGroups:[],subscriptionOptions:i,eventEmitter:this.eventEmitter,pubnub:this.pubnub})},s})(),__=(function(){function s(i,a,d){this.name=i,this.eventEmitter=a,this.pubnub=d}return s.prototype.subscription=function(i){return new Wa({channels:[],channelGroups:i?.receivePresenceEvents?[this.name,"".concat(this.name,"-pnpres")]:[this.name],subscriptionOptions:i,eventEmitter:this.eventEmitter,pubnub:this.pubnub})},s})(),w_=(function(){function s(i,a,d){this.id=i,this.eventEmitter=a,this.pubnub=d}return s.prototype.subscription=function(i){return new Wa({channels:[this.id],channelGroups:[],subscriptionOptions:i,eventEmitter:this.eventEmitter,pubnub:this.pubnub})},s})(),C_=(function(){function s(i,a,d){this.id=i,this.eventEmitter=a,this.pubnub=d}return s.prototype.subscription=function(i){return new Wa({channels:[this.id],channelGroups:[],subscriptionOptions:i,eventEmitter:this.eventEmitter,pubnub:this.pubnub})},s})(),I_=(function(){function s(i){var a=this,d=i.networking,h=i.cbor,p=new me({setup:i});this._config=p;var g=new _t({config:p}),f=i.cryptography;d.init(p);var b=new Ld(p,h);this._tokenManager=b;var _=new st({maximumSamplesCount:6e4});this._telemetryManager=_;var w=this._config.cryptoModule,y={config:p,networking:d,crypto:g,cryptography:f,tokenManager:b,telemetryManager:_,PubNubFile:i.PubNubFile,cryptoModule:w};this.File=i.PubNubFile,this.encryptFile=function(T,N){return arguments.length==1&&typeof T!="string"&&y.cryptoModule?(N=T,y.cryptoModule.encryptFile(N,this.File)):f.encryptFile(T,N,this.File)},this.decryptFile=function(T,N){return arguments.length==1&&typeof T!="string"&&y.cryptoModule?(N=T,y.cryptoModule.decryptFile(N,this.File)):f.decryptFile(T,N,this.File)};var A=ve.bind(this,y,a_),E=ve.bind(this,y,Hg),S=ve.bind(this,y,qg),P=ve.bind(this,y,Gg),O=ve.bind(this,y,l_),$=new es;if(this._listenerManager=$,this.iAmHere=ve.bind(this,y,qg),this.iAmAway=ve.bind(this,y,Hg),this.setPresenceState=ve.bind(this,y,Gg),this.handshake=ve.bind(this,y,c_),this.receiveMessages=ve.bind(this,y,d_),this._eventEmitter=new v_({modules:y,listenerManager:this._listenerManager,getFileUrl:function(T){return $d(y,T)}}),p.enableEventEngine===!0){if(p.maintainPresenceState&&(this.presenceState={},this.setState=function(T){var N,L;return(N=T.channels)===null||N===void 0||N.forEach((function(W){return a.presenceState[W]=T.state})),(L=T.channelGroups)===null||L===void 0||L.forEach((function(W){return a.presenceState[W]=T.state})),a.setPresenceState({channels:T.channels,channelGroups:T.channelGroups,state:a.presenceState})}),p.getHeartbeatInterval()){var G=new y_({heartbeat:this.iAmHere,leave:this.iAmAway,heartbeatDelay:function(){return new Promise((function(T){return setTimeout(T,1e3*y.config.getHeartbeatInterval())}))},retryDelay:function(T){return new Promise((function(N){return setTimeout(N,T)}))},config:y.config,presenceState:this.presenceState,emitStatus:function(T){$.announceStatus(T)}});this.presenceEventEngine=G,this.join=this.presenceEventEngine.join.bind(G),this.leave=this.presenceEventEngine.leave.bind(G),this.leaveAll=this.presenceEventEngine.leaveAll.bind(G)}var re=new m_({handshake:this.handshake,receiveMessages:this.receiveMessages,delay:function(T){return new Promise((function(N){return setTimeout(N,T)}))},join:this.join,leave:this.leave,leaveAll:this.leaveAll,presenceState:this.presenceState,config:y.config,emitMessages:function(T){var N,L;try{for(var W=l(T),V=W.next();!V.done;V=W.next()){var U=V.value;a._eventEmitter.emitEvent(U)}}catch(x){N={error:x}}finally{try{V&&!V.done&&(L=W.return)&&L.call(W)}finally{if(N)throw N.error}}},emitStatus:function(T){$.announceStatus(T)}});this.subscribe=re.subscribe.bind(re),this.unsubscribe=re.unsubscribe.bind(re),this.unsubscribeAll=re.unsubscribeAll.bind(re),this.reconnect=re.reconnect.bind(re),this.disconnect=re.disconnect.bind(re),this.destroy=re.dispose.bind(re),this.getSubscribedChannels=re.getSubscribedChannels.bind(re),this.getSubscribedChannelGroups=re.getSubscribedChannelGroups.bind(re),this.eventEngine=re}else{var te=new le({timeEndpoint:A,leaveEndpoint:E,heartbeatEndpoint:S,setStateEndpoint:P,subscribeEndpoint:O,crypto:y.crypto,config:y.config,listenerManager:$,getFileUrl:function(T){return $d(y,T)},cryptoModule:y.cryptoModule,eventEmitter:this._eventEmitter});this.subscribe=te.adaptSubscribeChange.bind(te),this.unsubscribe=te.adaptUnsubscribeChange.bind(te),this.disconnect=te.disconnect.bind(te),this.reconnect=te.reconnect.bind(te),this.unsubscribeAll=te.unsubscribeAll.bind(te),this.getSubscribedChannels=te.getSubscribedChannels.bind(te),this.getSubscribedChannelGroups=te.getSubscribedChannelGroups.bind(te),this.setState=te.adaptStateChange.bind(te),this.presence=te.adaptPresenceChange.bind(te),this.destroy=function(T){te.unsubscribeAll(T),te.disconnect()}}this.addListener=this._eventEmitter.addListener.bind(this._eventEmitter),this.removeListener=this._eventEmitter.removeListener.bind(this._eventEmitter),this.removeAllListeners=this._eventEmitter.removeAllListeners.bind(this._eventEmitter),this.parseToken=b.parseToken.bind(b),this.setToken=b.setToken.bind(b),this.getToken=b.getToken.bind(b),this.channelGroups={listGroups:ve.bind(this,y,C2),listChannels:ve.bind(this,y,I2),addChannels:ve.bind(this,y,b2),removeChannels:ve.bind(this,y,_2),deleteGroup:ve.bind(this,y,w2)},this.push={addChannels:ve.bind(this,y,k2),removeChannels:ve.bind(this,y,E2),deleteDevice:ve.bind(this,y,P2),listChannels:ve.bind(this,y,S2)},this.hereNow=ve.bind(this,y,T2),this.whereNow=ve.bind(this,y,O2),this.getState=ve.bind(this,y,R2),this.grant=ve.bind(this,y,Z2),this.grantToken=ve.bind(this,y,Y2),this.audit=ve.bind(this,y,X2),this.revokeToken=ve.bind(this,y,e_),this.publish=ve.bind(this,y,t_),this.fire=function(T,N){return T.replicate=!1,T.storeInHistory=!1,a.publish(T,N)},this.signal=ve.bind(this,y,n_),this.history=ve.bind(this,y,i_),this.deleteMessages=ve.bind(this,y,r_),this.messageCounts=ve.bind(this,y,o_),this.fetchMessages=ve.bind(this,y,s_),this.addMessageAction=ve.bind(this,y,x2),this.removeMessageAction=ve.bind(this,y,A2),this.getMessageActions=ve.bind(this,y,M2),this.listFiles=ve.bind(this,y,L2);var Q=ve.bind(this,y,$2);this.publishFile=ve.bind(this,y,V2),this.sendFile=D2({generateUploadUrl:Q,publishFile:this.publishFile,modules:y}),this.getFileUrl=function(T){return $d(y,T)},this.downloadFile=ve.bind(this,y,N2),this.deleteFile=ve.bind(this,y,U2),this.channel=function(T){return new b_(T,a._eventEmitter,a)},this.channelGroup=function(T){return new __(T,a._eventEmitter,a)},this.channelMetadata=function(T){return new w_(T,a._eventEmitter,a)},this.userMetadata=function(T){return new C_(T,a._eventEmitter,a)},this.subscriptionSet=function(T){return new y1({channels:T.channels,channelGroups:T.channelGroups,subscriptionOptions:T.subscriptionOptions,eventEmitter:a._eventEmitter,pubnub:a})},this.objects={getAllUUIDMetadata:ve.bind(this,y,j2),getUUIDMetadata:ve.bind(this,y,B2),setUUIDMetadata:ve.bind(this,y,F2),removeUUIDMetadata:ve.bind(this,y,z2),getAllChannelMetadata:ve.bind(this,y,H2),getChannelMetadata:ve.bind(this,y,q2),setChannelMetadata:ve.bind(this,y,G2),removeChannelMetadata:ve.bind(this,y,W2),getChannelMembers:ve.bind(this,y,K2),setChannelMembers:function(T){for(var N=[],L=1;L<arguments.length;L++)N[L-1]=arguments[L];return ve.call.apply(ve,m([a,y,Wg,n({type:"set"},T)],u(N),!1))},removeChannelMembers:function(T){for(var N=[],L=1;L<arguments.length;L++)N[L-1]=arguments[L];return ve.call.apply(ve,m([a,y,Wg,n({type:"delete"},T)],u(N),!1))},getMemberships:ve.bind(this,y,Q2),setMemberships:function(T){for(var N=[],L=1;L<arguments.length;L++)N[L-1]=arguments[L];return ve.call.apply(ve,m([a,y,Kg,n({type:"set"},T)],u(N),!1))},removeMemberships:function(T){for(var N=[],L=1;L<arguments.length;L++)N[L-1]=arguments[L];return ve.call.apply(ve,m([a,y,Kg,n({type:"delete"},T)],u(N),!1))}},this.createUser=function(T){return a.objects.setUUIDMetadata({uuid:T.userId,data:T.data,include:T.include})},this.updateUser=this.createUser,this.removeUser=function(T){return a.objects.removeUUIDMetadata({uuid:T?.userId})},this.fetchUser=function(T){return a.objects.getUUIDMetadata({uuid:T?.userId,include:T?.include})},this.fetchUsers=this.objects.getAllUUIDMetadata,this.createSpace=function(T){return a.objects.setChannelMetadata({channel:T.spaceId,data:T.data,include:T.include})},this.updateSpace=this.createSpace,this.removeSpace=function(T){return a.objects.removeChannelMetadata({channel:T.spaceId})},this.fetchSpace=function(T){return a.objects.getChannelMetadata({channel:T.spaceId,include:T.include})},this.fetchSpaces=this.objects.getAllChannelMetadata,this.addMemberships=function(T){var N,L;return typeof T.spaceId=="string"?a.objects.setChannelMembers({channel:T.spaceId,uuids:(N=T.users)===null||N===void 0?void 0:N.map((function(W){return typeof W=="string"?W:{id:W.userId,custom:W.custom,status:W.status}})),limit:0}):a.objects.setMemberships({uuid:T.userId,channels:(L=T.spaces)===null||L===void 0?void 0:L.map((function(W){return typeof W=="string"?W:{id:W.spaceId,custom:W.custom,status:W.status}})),limit:0})},this.updateMemberships=this.addMemberships,this.removeMemberships=function(T){return typeof T.spaceId=="string"?a.objects.removeChannelMembers({channel:T.spaceId,uuids:T.userIds,limit:0}):a.objects.removeMemberships({uuid:T.userId,channels:T.spaceIds,limit:0})},this.fetchMemberships=function(T){return typeof T.spaceId=="string"?a.objects.getChannelMembers({channel:T.spaceId,filter:T.filter,limit:T.limit,page:T.page,include:{customFields:T.include.customFields,UUIDFields:T.include.userFields,customUUIDFields:T.include.customUserFields,statusField:T.include.statusField,UUIDStatusField:T.include.userStatusField,UUIDTypeField:T.include.userTypeField,totalCount:T.include.totalCount},sort:T.sort!=null?Object.fromEntries(Object.entries(T.sort).map((function(N){var L=u(N,2),W=L[0],V=L[1];return[W.replace("user","uuid"),V]}))):null}).then((function(N){var L;return N.data=(L=N.data)===null||L===void 0?void 0:L.map((function(W){return{user:W.uuid,custom:W.custom,updated:W.updated,eTag:W.eTag}})),N})):a.objects.getMemberships({uuid:T.userId,filter:T.filter,limit:T.limit,page:T.page,include:{customFields:T.include.customFields,channelFields:T.include.spaceFields,customChannelFields:T.include.customSpaceFields,statusField:T.include.statusField,channelStatusField:T.include.spaceStatusField,channelTypeField:T.include.spaceTypeField,totalCount:T.include.totalCount},sort:T.sort!=null?Object.fromEntries(Object.entries(T.sort).map((function(N){var L=u(N,2),W=L[0],V=L[1];return[W.replace("space","channel"),V]}))):null}).then((function(N){var L;return N.data=(L=N.data)===null||L===void 0?void 0:L.map((function(W){return{space:W.channel,custom:W.custom,updated:W.updated,eTag:W.eTag}})),N}))},this.time=A,this.stop=this.destroy,this.encrypt=function(T,N){if(N===void 0&&y.cryptoModule){var L=y.cryptoModule.encrypt(T);return typeof L=="string"?L:ye(L)}return g.encrypt(T,N)},this.decrypt=function(T,N){if(N===void 0&&w){var L=y.cryptoModule.decrypt(T);return L instanceof ArrayBuffer?JSON.parse(new TextDecoder().decode(L)):L}return g.decrypt(T,N)},this.getAuthKey=y.config.getAuthKey.bind(y.config),this.setAuthKey=y.config.setAuthKey.bind(y.config),this.getUUID=y.config.getUUID.bind(y.config),this.setUUID=y.config.setUUID.bind(y.config),this.getUserId=y.config.getUserId.bind(y.config),this.setUserId=y.config.setUserId.bind(y.config),this.getFilterExpression=y.config.getFilterExpression.bind(y.config),this.setFilterExpression=y.config.setFilterExpression.bind(y.config),this.setCipherKey=function(T){return y.config.setCipherKey(T,i,y)},this.setHeartbeatInterval=y.config.setHeartbeatInterval.bind(y.config),d.hasModule("proxy")&&(this.setProxy=function(T){y.config.setProxy(T),a.reconnect()})}return s.prototype.getVersion=function(){return this._config.getVersion()},s.prototype._addPnsdkSuffix=function(i,a){this._config._addPnsdkSuffix(i,a)},s.prototype.networkDownDetected=function(){this._listenerManager.announceNetworkDown(),this._config.restore?this.disconnect():this.destroy(!0)},s.prototype.networkUpDetected=function(){this._listenerManager.announceNetworkUp(),this.reconnect()},s.notificationPayload=function(i,a){return new ci(i,a)},s.generateUUID=function(){return oe()},s.OPERATIONS=q,s.CATEGORIES=B,s.LinearRetryPolicy=g1.LinearRetryPolicy,s.ExponentialRetryPolicy=g1.ExponentialRetryPolicy,s})(),k_=(function(){function s(i){var a=this;this._modules={},Object.keys(i).forEach((function(d){a._modules[d]=i[d].bind(a)}))}return s.prototype.init=function(i){this._config=i,Array.isArray(this._config.origin)?this._currentSubDomain=Math.floor(Math.random()*this._config.origin.length):this._currentSubDomain=0,this._coreParams={},this.shiftStandardOrigin()},s.prototype.nextOrigin=function(){var i=this._config.secure?"https://":"http://";if(typeof this._config.origin=="string")return"".concat(i).concat(this._config.origin);this._currentSubDomain+=1,this._currentSubDomain>=this._config.origin.length&&(this._currentSubDomain=0);var a=this._config.origin[this._currentSubDomain];return"".concat(i).concat(a)},s.prototype.hasModule=function(i){return i in this._modules},s.prototype.shiftStandardOrigin=function(){return this._standardOrigin=this.nextOrigin(),this._standardOrigin},s.prototype.getStandardOrigin=function(){return this._standardOrigin},s.prototype.POSTFILE=function(i,a,d){return this._modules.postfile(i,a,d)},s.prototype.GETFILE=function(i,a,d){return this._modules.getfile(i,a,d)},s.prototype.POST=function(i,a,d,h){return this._modules.post(i,a,d,h)},s.prototype.PATCH=function(i,a,d,h){return this._modules.patch(i,a,d,h)},s.prototype.GET=function(i,a,d){return this._modules.get(i,a,d)},s.prototype.DELETE=function(i,a,d){return this._modules.del(i,a,d)},s.prototype._detectErrorCategory=function(i){if(i.code==="ENOTFOUND"||i.code==="ECONNREFUSED"||i.code==="ECONNRESET"||i.code==="EAI_AGAIN"||i.status===0||i.hasOwnProperty("status")&&i.status===void 0)return B.PNNetworkIssuesCategory;if(i.timeout)return B.PNTimeoutCategory;if(i.code==="ETIMEDOUT")return B.PNNetworkIssuesCategory;if(i.response){if(i.response.badRequest)return B.PNBadRequestCategory;if(i.response.forbidden)return B.PNAccessDeniedCategory}return B.PNUnknownCategory},s})();function v1(s){var i=function(d){return d&&typeof d=="object"&&d.constructor===Object};if(!i(s))return s;var a={};return Object.keys(s).forEach((function(d){var h=(function(f){return typeof f=="string"||f instanceof String})(d),p=d,g=s[d];Array.isArray(d)||h&&d.indexOf(",")>=0?p=(h?d.split(","):d).reduce((function(f,b){return f+String.fromCharCode(b)}),""):((function(f){return typeof f=="number"&&isFinite(f)})(d)||h&&!isNaN(d))&&(p=String.fromCharCode(h?parseInt(d,10):10)),a[p]=i(g)?v1(g):g})),a}var E_=(function(){function s(i,a){this._base64ToBinary=a,this._decode=i}return s.prototype.decodeToken=function(i){var a="";i.length%4==3?a="=":i.length%4==2&&(a="==");var d=i.replace(/-/gi,"+").replace(/_/gi,"/")+a,h=this._decode(this._base64ToBinary(d));if(typeof h=="object")return h},s})(),zd={exports:{}},b1={exports:{}};(function(s){function i(a){if(a)return(function(d){for(var h in i.prototype)d[h]=i.prototype[h];return d})(a)}s.exports=i,i.prototype.on=i.prototype.addEventListener=function(a,d){return this._callbacks=this._callbacks||{},(this._callbacks["$"+a]=this._callbacks["$"+a]||[]).push(d),this},i.prototype.once=function(a,d){function h(){this.off(a,h),d.apply(this,arguments)}return h.fn=d,this.on(a,h),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(a,d){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var h,p=this._callbacks["$"+a];if(!p)return this;if(arguments.length==1)return delete this._callbacks["$"+a],this;for(var g=0;g<p.length;g++)if((h=p[g])===d||h.fn===d){p.splice(g,1);break}return p.length===0&&delete this._callbacks["$"+a],this},i.prototype.emit=function(a){this._callbacks=this._callbacks||{};for(var d=new Array(arguments.length-1),h=this._callbacks["$"+a],p=1;p<arguments.length;p++)d[p-1]=arguments[p];if(h){p=0;for(var g=(h=h.slice(0)).length;p<g;++p)h[p].apply(this,d)}return this},i.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks["$"+a]||[]},i.prototype.hasListeners=function(a){return!!this.listeners(a).length}})(b1);var S_=as;as.default=as,as.stable=C1,as.stableStringify=C1;var Ka="[...]",_1="[Circular]",Ki=[],Qi=[];function w1(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function as(s,i,a,d){var h;d===void 0&&(d=w1()),Hd(s,"",0,[],void 0,0,d);try{h=Qi.length===0?JSON.stringify(s,i,a):JSON.stringify(s,I1(i),a)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ki.length!==0;){var p=Ki.pop();p.length===4?Object.defineProperty(p[0],p[1],p[3]):p[0][p[1]]=p[2]}}return h}function Fr(s,i,a,d){var h=Object.getOwnPropertyDescriptor(d,a);h.get!==void 0?h.configurable?(Object.defineProperty(d,a,{value:s}),Ki.push([d,a,i,h])):Qi.push([i,a,s]):(d[a]=s,Ki.push([d,a,i]))}function Hd(s,i,a,d,h,p,g){var f;if(p+=1,typeof s=="object"&&s!==null){for(f=0;f<d.length;f++)if(d[f]===s)return void Fr(_1,s,i,h);if(g.depthLimit!==void 0&&p>g.depthLimit||g.edgesLimit!==void 0&&a+1>g.edgesLimit)return void Fr(Ka,s,i,h);if(d.push(s),Array.isArray(s))for(f=0;f<s.length;f++)Hd(s[f],f,f,d,s,p,g);else{var b=Object.keys(s);for(f=0;f<b.length;f++){var _=b[f];Hd(s[_],_,f,d,s,p,g)}}d.pop()}}function P_(s,i){return s<i?-1:s>i?1:0}function C1(s,i,a,d){d===void 0&&(d=w1());var h,p=qd(s,"",0,[],void 0,0,d)||s;try{h=Qi.length===0?JSON.stringify(p,i,a):JSON.stringify(p,I1(i),a)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ki.length!==0;){var g=Ki.pop();g.length===4?Object.defineProperty(g[0],g[1],g[3]):g[0][g[1]]=g[2]}}return h}function qd(s,i,a,d,h,p,g){var f;if(p+=1,typeof s=="object"&&s!==null){for(f=0;f<d.length;f++)if(d[f]===s)return void Fr(_1,s,i,h);try{if(typeof s.toJSON=="function")return}catch{return}if(g.depthLimit!==void 0&&p>g.depthLimit||g.edgesLimit!==void 0&&a+1>g.edgesLimit)return void Fr(Ka,s,i,h);if(d.push(s),Array.isArray(s))for(f=0;f<s.length;f++)qd(s[f],f,f,d,s,p,g);else{var b={},_=Object.keys(s).sort(P_);for(f=0;f<_.length;f++){var w=_[f];qd(s[w],w,f,d,s,p,g),b[w]=s[w]}if(h===void 0)return b;Ki.push([h,i,s]),h[i]=b}d.pop()}}function I1(s){return s=s!==void 0?s:function(i,a){return a},function(i,a){if(Qi.length>0)for(var d=0;d<Qi.length;d++){var h=Qi[d];if(h[1]===i&&h[0]===a){a=h[2],Qi.splice(d,1);break}}return s.call(this,i,a)}}var Le,k1=typeof Symbol<"u"&&Symbol,O_=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var s={},i=Symbol("test"),a=Object(i);if(typeof i=="string"||Object.prototype.toString.call(i)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;for(i in s[i]=42,s)return!1;if(typeof Object.keys=="function"&&Object.keys(s).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(s).length!==0)return!1;var d=Object.getOwnPropertySymbols(s);if(d.length!==1||d[0]!==i||!Object.prototype.propertyIsEnumerable.call(s,i))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(s,i);if(h.value!==42||h.enumerable!==!0)return!1}return!0},R_="Function.prototype.bind called on incompatible ",Gd=Array.prototype.slice,T_=Object.prototype.toString,x_="[object Function]",A_=function(s){var i=this;if(typeof i!="function"||T_.call(i)!==x_)throw new TypeError(R_+i);for(var a,d=Gd.call(arguments,1),h=function(){if(this instanceof a){var _=i.apply(this,d.concat(Gd.call(arguments)));return Object(_)===_?_:this}return i.apply(s,d.concat(Gd.call(arguments)))},p=Math.max(0,i.length-d.length),g=[],f=0;f<p;f++)g.push("$"+f);if(a=Function("binder","return function ("+g.join(",")+"){ return binder.apply(this,arguments); }")(h),i.prototype){var b=function(){};b.prototype=i.prototype,a.prototype=new b,b.prototype=null}return a},Wd=Function.prototype.bind||A_,M_=Wd.call(Function.call,Object.prototype.hasOwnProperty),ls=SyntaxError,E1=Function,zr=TypeError,Kd=function(s){try{return E1('"use strict"; return ('+s+").constructor;")()}catch{}},Xi=Object.getOwnPropertyDescriptor;if(Xi)try{Xi({},"")}catch{Xi=null}var Qd=function(){throw new zr},L_=Xi?(function(){try{return Qd}catch{try{return Xi(arguments,"callee").get}catch{return Qd}}})():Qd,Hr=typeof k1=="function"&&typeof Symbol=="function"&&typeof k1("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&O_(),pi=Object.getPrototypeOf||function(s){return s.__proto__},qr={},$_=typeof Uint8Array>"u"?Le:pi(Uint8Array),Gr={"%AggregateError%":typeof AggregateError>"u"?Le:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Le:ArrayBuffer,"%ArrayIteratorPrototype%":Hr?pi([][Symbol.iterator]()):Le,"%AsyncFromSyncIteratorPrototype%":Le,"%AsyncFunction%":qr,"%AsyncGenerator%":qr,"%AsyncGeneratorFunction%":qr,"%AsyncIteratorPrototype%":qr,"%Atomics%":typeof Atomics>"u"?Le:Atomics,"%BigInt%":typeof BigInt>"u"?Le:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Le:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Le:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Le:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Le:FinalizationRegistry,"%Function%":E1,"%GeneratorFunction%":qr,"%Int8Array%":typeof Int8Array>"u"?Le:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Le:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Le:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Hr?pi(pi([][Symbol.iterator]())):Le,"%JSON%":typeof JSON=="object"?JSON:Le,"%Map%":typeof Map>"u"?Le:Map,"%MapIteratorPrototype%":typeof Map<"u"&&Hr?pi(new Map()[Symbol.iterator]()):Le,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Le:Promise,"%Proxy%":typeof Proxy>"u"?Le:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Le:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Le:Set,"%SetIteratorPrototype%":typeof Set<"u"&&Hr?pi(new Set()[Symbol.iterator]()):Le,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Le:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Hr?pi(""[Symbol.iterator]()):Le,"%Symbol%":Hr?Symbol:Le,"%SyntaxError%":ls,"%ThrowTypeError%":L_,"%TypedArray%":$_,"%TypeError%":zr,"%Uint8Array%":typeof Uint8Array>"u"?Le:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Le:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Le:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Le:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Le:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Le:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Le:WeakSet},V_=function s(i){var a;if(i==="%AsyncFunction%")a=Kd("async function () {}");else if(i==="%GeneratorFunction%")a=Kd("function* () {}");else if(i==="%AsyncGeneratorFunction%")a=Kd("async function* () {}");else if(i==="%AsyncGenerator%"){var d=s("%AsyncGeneratorFunction%");d&&(a=d.prototype)}else if(i==="%AsyncIteratorPrototype%"){var h=s("%AsyncGenerator%");h&&(a=pi(h.prototype))}return Gr[i]=a,a},S1={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Qa=Wd,Xa=M_,D_=Qa.call(Function.call,Array.prototype.concat),N_=Qa.call(Function.apply,Array.prototype.splice),P1=Qa.call(Function.call,String.prototype.replace),Za=Qa.call(Function.call,String.prototype.slice),U_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,j_=/\\(\\)?/g,B_=function(s){var i=Za(s,0,1),a=Za(s,-1);if(i==="%"&&a!=="%")throw new ls("invalid intrinsic syntax, expected closing `%`");if(a==="%"&&i!=="%")throw new ls("invalid intrinsic syntax, expected opening `%`");var d=[];return P1(s,U_,(function(h,p,g,f){d[d.length]=g?P1(f,j_,"$1"):p||h})),d},F_=function(s,i){var a,d=s;if(Xa(S1,d)&&(d="%"+(a=S1[d])[0]+"%"),Xa(Gr,d)){var h=Gr[d];if(h===qr&&(h=V_(d)),h===void 0&&!i)throw new zr("intrinsic "+s+" exists, but is not available. Please file an issue!");return{alias:a,name:d,value:h}}throw new ls("intrinsic "+s+" does not exist!")},Xd=function(s,i){if(typeof s!="string"||s.length===0)throw new zr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof i!="boolean")throw new zr('"allowMissing" argument must be a boolean');var a=B_(s),d=a.length>0?a[0]:"",h=F_("%"+d+"%",i),p=h.name,g=h.value,f=!1,b=h.alias;b&&(d=b[0],N_(a,D_([0,1],b)));for(var _=1,w=!0;_<a.length;_+=1){var y=a[_],A=Za(y,0,1),E=Za(y,-1);if((A==='"'||A==="'"||A==="`"||E==='"'||E==="'"||E==="`")&&A!==E)throw new ls("property names with quotes must have matching quotes");if(y!=="constructor"&&w||(f=!0),Xa(Gr,p="%"+(d+="."+y)+"%"))g=Gr[p];else if(g!=null){if(!(y in g)){if(!i)throw new zr("base intrinsic for "+s+" exists, but the property is not available.");return}if(Xi&&_+1>=a.length){var S=Xi(g,y);g=(w=!!S)&&"get"in S&&!("originalValue"in S.get)?S.get:g[y]}else w=Xa(g,y),g=g[y];w&&!f&&(Gr[p]=g)}}return g},O1={exports:{}};(function(s){var i=Wd,a=Xd,d=a("%Function.prototype.apply%"),h=a("%Function.prototype.call%"),p=a("%Reflect.apply%",!0)||i.call(h,d),g=a("%Object.getOwnPropertyDescriptor%",!0),f=a("%Object.defineProperty%",!0),b=a("%Math.max%");if(f)try{f({},"a",{value:1})}catch{f=null}s.exports=function(w){var y=p(i,h,arguments);return g&&f&&g(y,"length").configurable&&f(y,"length",{value:1+b(0,w.length-(arguments.length-1))}),y};var _=function(){return p(i,d,arguments)};f?f(s.exports,"apply",{value:_}):s.exports.apply=_})(O1);var R1=Xd,T1=O1.exports,z_=T1(R1("String.prototype.indexOf")),x1=R(Object.freeze({__proto__:null,default:{}})),Zd=typeof Map=="function"&&Map.prototype,Jd=Object.getOwnPropertyDescriptor&&Zd?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ja=Zd&&Jd&&typeof Jd.get=="function"?Jd.get:null,A1=Zd&&Map.prototype.forEach,Yd=typeof Set=="function"&&Set.prototype,eu=Object.getOwnPropertyDescriptor&&Yd?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ya=Yd&&eu&&typeof eu.get=="function"?eu.get:null,M1=Yd&&Set.prototype.forEach,cs=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap.prototype.has:null,ds=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet.prototype.has:null,L1=typeof WeakRef=="function"&&WeakRef.prototype?WeakRef.prototype.deref:null,H_=Boolean.prototype.valueOf,q_=Object.prototype.toString,G_=Function.prototype.toString,W_=String.prototype.match,tu=String.prototype.slice,mi=String.prototype.replace,K_=String.prototype.toUpperCase,$1=String.prototype.toLowerCase,V1=RegExp.prototype.test,D1=Array.prototype.concat,ln=Array.prototype.join,Q_=Array.prototype.slice,N1=Math.floor,nu=typeof BigInt=="function"?BigInt.prototype.valueOf:null,iu=Object.getOwnPropertySymbols,ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,us=typeof Symbol=="function"&&typeof Symbol.iterator=="object",mt=typeof Symbol=="function"&&Symbol.toStringTag?Symbol.toStringTag:null,U1=Object.prototype.propertyIsEnumerable,j1=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(s){return s.__proto__}:null);function B1(s,i){if(s===1/0||s===-1/0||s!=s||s&&s>-1e3&&s<1e3||V1.call(/e/,i))return i;var a=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof s=="number"){var d=s<0?-N1(-s):N1(s);if(d!==s){var h=String(d),p=tu.call(i,h.length+1);return mi.call(h,a,"$&_")+"."+mi.call(mi.call(p,/([0-9]{3})/g,"$&_"),/_$/,"")}}return mi.call(i,a,"$&_")}var ou=x1,F1=ou.custom,z1=G1(F1)?F1:null;function H1(s,i,a){var d=(a.quoteStyle||i)==="double"?'"':"'";return d+s+d}function X_(s){return mi.call(String(s),/"/g,""")}function su(s){return!(fi(s)!=="[object Array]"||mt&&typeof s=="object"&&mt in s)}function q1(s){return!(fi(s)!=="[object RegExp]"||mt&&typeof s=="object"&&mt in s)}function G1(s){if(us)return s&&typeof s=="object"&&s instanceof Symbol;if(typeof s=="symbol")return!0;if(!s||typeof s!="object"||!ru)return!1;try{return ru.call(s),!0}catch{}return!1}var Z_=Object.prototype.hasOwnProperty||function(s){return s in this};function gi(s,i){return Z_.call(s,i)}function fi(s){return q_.call(s)}function W1(s,i){if(s.indexOf)return s.indexOf(i);for(var a=0,d=s.length;a<d;a++)if(s[a]===i)return a;return-1}function K1(s,i){if(s.length>i.maxStringLength){var a=s.length-i.maxStringLength,d="... "+a+" more character"+(a>1?"s":"");return K1(tu.call(s,0,i.maxStringLength),i)+d}return H1(mi.call(mi.call(s,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,J_),"single",i)}function J_(s){var i=s.charCodeAt(0),a={8:"b",9:"t",10:"n",12:"f",13:"r"}[i];return a?"\\"+a:"\\x"+(i<16?"0":"")+K_.call(i.toString(16))}function hs(s){return"Object("+s+")"}function au(s){return s+" { ? }"}function Q1(s,i,a,d){return s+" ("+i+") {"+(d?lu(a,d):ln.call(a,", "))+"}"}function lu(s,i){if(s.length===0)return"";var a=`
|
|
10
|
+
`+i.prev+i.base;return a+ln.call(s,","+a)+`
|
|
11
|
+
`+i.prev}function el(s,i){var a=su(s),d=[];if(a){d.length=s.length;for(var h=0;h<s.length;h++)d[h]=gi(s,h)?i(s[h],s):""}var p,g=typeof iu=="function"?iu(s):[];if(us){p={};for(var f=0;f<g.length;f++)p["$"+g[f]]=g[f]}for(var b in s)gi(s,b)&&(a&&String(Number(b))===b&&b<s.length||us&&p["$"+b]instanceof Symbol||(V1.call(/[^\w$]/,b)?d.push(i(b,s)+": "+i(s[b],s)):d.push(b+": "+i(s[b],s))));if(typeof iu=="function")for(var _=0;_<g.length;_++)U1.call(s,g[_])&&d.push("["+i(g[_])+"]: "+i(s[g[_]],s));return d}var cu=Xd,Wr=function(s,i){var a=R1(s,!0);return typeof a=="function"&&z_(s,".prototype.")>-1?T1(a):a},Y_=function s(i,a,d,h){var p=a||{};if(gi(p,"quoteStyle")&&p.quoteStyle!=="single"&&p.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(gi(p,"maxStringLength")&&(typeof p.maxStringLength=="number"?p.maxStringLength<0&&p.maxStringLength!==1/0:p.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var g=!gi(p,"customInspect")||p.customInspect;if(typeof g!="boolean"&&g!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(gi(p,"indent")&&p.indent!==null&&p.indent!==" "&&!(parseInt(p.indent,10)===p.indent&&p.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(gi(p,"numericSeparator")&&typeof p.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var f=p.numericSeparator;if(i===void 0)return"undefined";if(i===null)return"null";if(typeof i=="boolean")return i?"true":"false";if(typeof i=="string")return K1(i,p);if(typeof i=="number"){if(i===0)return 1/0/i>0?"0":"-0";var b=String(i);return f?B1(i,b):b}if(typeof i=="bigint"){var _=String(i)+"n";return f?B1(i,_):_}var w=p.depth===void 0?5:p.depth;if(d===void 0&&(d=0),d>=w&&w>0&&typeof i=="object")return su(i)?"[Array]":"[Object]";var y=(function(x,J){var j;if(x.indent===" ")j=" ";else{if(!(typeof x.indent=="number"&&x.indent>0))return null;j=ln.call(Array(x.indent+1)," ")}return{base:j,prev:ln.call(Array(J+1),j)}})(p,d);if(h===void 0)h=[];else if(W1(h,i)>=0)return"[Circular]";function A(x,J,j){if(J&&(h=Q_.call(h)).push(J),j){var H={depth:p.depth};return gi(p,"quoteStyle")&&(H.quoteStyle=p.quoteStyle),s(x,H,d+1,h)}return s(x,p,d+1,h)}if(typeof i=="function"&&!q1(i)){var E=(function(x){if(x.name)return x.name;var J=W_.call(G_.call(x),/^function\s*([\w$]+)/);return J?J[1]:null})(i),S=el(i,A);return"[Function"+(E?": "+E:" (anonymous)")+"]"+(S.length>0?" { "+ln.call(S,", ")+" }":"")}if(G1(i)){var P=us?mi.call(String(i),/^(Symbol\(.*\))_[^)]*$/,"$1"):ru.call(i);return typeof i!="object"||us?P:hs(P)}if((function(x){return!(!x||typeof x!="object")&&(typeof HTMLElement<"u"&&x instanceof HTMLElement||typeof x.nodeName=="string"&&typeof x.getAttribute=="function")})(i)){for(var O="<"+$1.call(String(i.nodeName)),$=i.attributes||[],G=0;G<$.length;G++)O+=" "+$[G].name+"="+H1(X_($[G].value),"double",p);return O+=">",i.childNodes&&i.childNodes.length&&(O+="..."),O+"</"+$1.call(String(i.nodeName))+">"}if(su(i)){if(i.length===0)return"[]";var re=el(i,A);return y&&!(function(x){for(var J=0;J<x.length;J++)if(W1(x[J],`
|
|
12
|
+
`)>=0)return!1;return!0})(re)?"["+lu(re,y)+"]":"[ "+ln.call(re,", ")+" ]"}if((function(x){return!(fi(x)!=="[object Error]"||mt&&typeof x=="object"&&mt in x)})(i)){var te=el(i,A);return"cause"in Error.prototype||!("cause"in i)||U1.call(i,"cause")?te.length===0?"["+String(i)+"]":"{ ["+String(i)+"] "+ln.call(te,", ")+" }":"{ ["+String(i)+"] "+ln.call(D1.call("[cause]: "+A(i.cause),te),", ")+" }"}if(typeof i=="object"&&g){if(z1&&typeof i[z1]=="function"&&ou)return ou(i,{depth:w-d});if(g!=="symbol"&&typeof i.inspect=="function")return i.inspect()}if((function(x){if(!Ja||!x||typeof x!="object")return!1;try{Ja.call(x);try{Ya.call(x)}catch{return!0}return x instanceof Map}catch{}return!1})(i)){var Q=[];return A1&&A1.call(i,(function(x,J){Q.push(A(J,i,!0)+" => "+A(x,i))})),Q1("Map",Ja.call(i),Q,y)}if((function(x){if(!Ya||!x||typeof x!="object")return!1;try{Ya.call(x);try{Ja.call(x)}catch{return!0}return x instanceof Set}catch{}return!1})(i)){var T=[];return M1&&M1.call(i,(function(x){T.push(A(x,i))})),Q1("Set",Ya.call(i),T,y)}if((function(x){if(!cs||!x||typeof x!="object")return!1;try{cs.call(x,cs);try{ds.call(x,ds)}catch{return!0}return x instanceof WeakMap}catch{}return!1})(i))return au("WeakMap");if((function(x){if(!ds||!x||typeof x!="object")return!1;try{ds.call(x,ds);try{cs.call(x,cs)}catch{return!0}return x instanceof WeakSet}catch{}return!1})(i))return au("WeakSet");if((function(x){if(!L1||!x||typeof x!="object")return!1;try{return L1.call(x),!0}catch{}return!1})(i))return au("WeakRef");if((function(x){return!(fi(x)!=="[object Number]"||mt&&typeof x=="object"&&mt in x)})(i))return hs(A(Number(i)));if((function(x){if(!x||typeof x!="object"||!nu)return!1;try{return nu.call(x),!0}catch{}return!1})(i))return hs(A(nu.call(i)));if((function(x){return!(fi(x)!=="[object Boolean]"||mt&&typeof x=="object"&&mt in x)})(i))return hs(H_.call(i));if((function(x){return!(fi(x)!=="[object String]"||mt&&typeof x=="object"&&mt in x)})(i))return hs(A(String(i)));if(typeof window<"u"&&i===window)return"{ [object Window] }";if(i===v)return"{ [object globalThis] }";if(!(function(x){return!(fi(x)!=="[object Date]"||mt&&typeof x=="object"&&mt in x)})(i)&&!q1(i)){var N=el(i,A),L=j1?j1(i)===Object.prototype:i instanceof Object||i.constructor===Object,W=i instanceof Object?"":"null prototype",V=!L&&mt&&Object(i)===i&&mt in i?tu.call(fi(i),8,-1):W?"Object":"",U=(L||typeof i.constructor!="function"?"":i.constructor.name?i.constructor.name+" ":"")+(V||W?"["+ln.call(D1.call([],V||[],W||[]),": ")+"] ":"");return N.length===0?U+"{}":y?U+"{"+lu(N,y)+"}":U+"{ "+ln.call(N,", ")+" }"}return String(i)},e3=cu("%TypeError%"),tl=cu("%WeakMap%",!0),nl=cu("%Map%",!0),t3=Wr("WeakMap.prototype.get"),n3=Wr("WeakMap.prototype.set"),i3=Wr("WeakMap.prototype.has"),r3=Wr("Map.prototype.get"),o3=Wr("Map.prototype.set"),s3=Wr("Map.prototype.has"),du=function(s,i){for(var a,d=s;(a=d.next)!==null;d=a)if(a.key===i)return d.next=a.next,a.next=s.next,s.next=a,a},a3=String.prototype.replace,l3=/%20/g,X1={default:"RFC3986",formatters:{RFC1738:function(s){return a3.call(s,l3,"+")},RFC3986:function(s){return String(s)}},RFC1738:"RFC1738"},c3=X1,uu=Object.prototype.hasOwnProperty,Zi=Array.isArray,cn=(function(){for(var s=[],i=0;i<256;++i)s.push("%"+((i<16?"0":"")+i.toString(16)).toUpperCase());return s})(),Z1=function(s,i){for(var a=i&&i.plainObjects?Object.create(null):{},d=0;d<s.length;++d)s[d]!==void 0&&(a[d]=s[d]);return a},d3={arrayToObject:Z1,assign:function(s,i){return Object.keys(i).reduce((function(a,d){return a[d]=i[d],a}),s)},combine:function(s,i){return[].concat(s,i)},compact:function(s){for(var i=[{obj:{o:s},prop:"o"}],a=[],d=0;d<i.length;++d)for(var h=i[d],p=h.obj[h.prop],g=Object.keys(p),f=0;f<g.length;++f){var b=g[f],_=p[b];typeof _=="object"&&_!==null&&a.indexOf(_)===-1&&(i.push({obj:p,prop:b}),a.push(_))}return(function(w){for(;w.length>1;){var y=w.pop(),A=y.obj[y.prop];if(Zi(A)){for(var E=[],S=0;S<A.length;++S)A[S]!==void 0&&E.push(A[S]);y.obj[y.prop]=E}}})(i),s},decode:function(s,i,a){var d=s.replace(/\+/g," ");if(a==="iso-8859-1")return d.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(d)}catch{return d}},encode:function(s,i,a,d,h){if(s.length===0)return s;var p=s;if(typeof s=="symbol"?p=Symbol.prototype.toString.call(s):typeof s!="string"&&(p=String(s)),a==="iso-8859-1")return escape(p).replace(/%u[0-9a-f]{4}/gi,(function(_){return"%26%23"+parseInt(_.slice(2),16)+"%3B"}));for(var g="",f=0;f<p.length;++f){var b=p.charCodeAt(f);b===45||b===46||b===95||b===126||b>=48&&b<=57||b>=65&&b<=90||b>=97&&b<=122||h===c3.RFC1738&&(b===40||b===41)?g+=p.charAt(f):b<128?g+=cn[b]:b<2048?g+=cn[192|b>>6]+cn[128|63&b]:b<55296||b>=57344?g+=cn[224|b>>12]+cn[128|b>>6&63]+cn[128|63&b]:(f+=1,b=65536+((1023&b)<<10|1023&p.charCodeAt(f)),g+=cn[240|b>>18]+cn[128|b>>12&63]+cn[128|b>>6&63]+cn[128|63&b])}return g},isBuffer:function(s){return!(!s||typeof s!="object"||!(s.constructor&&s.constructor.isBuffer&&s.constructor.isBuffer(s)))},isRegExp:function(s){return Object.prototype.toString.call(s)==="[object RegExp]"},maybeMap:function(s,i){if(Zi(s)){for(var a=[],d=0;d<s.length;d+=1)a.push(i(s[d]));return a}return i(s)},merge:function s(i,a,d){if(!a)return i;if(typeof a!="object"){if(Zi(i))i.push(a);else{if(!i||typeof i!="object")return[i,a];(d&&(d.plainObjects||d.allowPrototypes)||!uu.call(Object.prototype,a))&&(i[a]=!0)}return i}if(!i||typeof i!="object")return[i].concat(a);var h=i;return Zi(i)&&!Zi(a)&&(h=Z1(i,d)),Zi(i)&&Zi(a)?(a.forEach((function(p,g){if(uu.call(i,g)){var f=i[g];f&&typeof f=="object"&&p&&typeof p=="object"?i[g]=s(f,p,d):i.push(p)}else i[g]=p})),i):Object.keys(a).reduce((function(p,g){var f=a[g];return uu.call(p,g)?p[g]=s(p[g],f,d):p[g]=f,p}),h)}},J1=function(){var s,i,a,d={assert:function(h){if(!d.has(h))throw new e3("Side channel does not contain "+Y_(h))},get:function(h){if(tl&&h&&(typeof h=="object"||typeof h=="function")){if(s)return t3(s,h)}else if(nl){if(i)return r3(i,h)}else if(a)return(function(p,g){var f=du(p,g);return f&&f.value})(a,h)},has:function(h){if(tl&&h&&(typeof h=="object"||typeof h=="function")){if(s)return i3(s,h)}else if(nl){if(i)return s3(i,h)}else if(a)return(function(p,g){return!!du(p,g)})(a,h);return!1},set:function(h,p){tl&&h&&(typeof h=="object"||typeof h=="function")?(s||(s=new tl),n3(s,h,p)):nl?(i||(i=new nl),o3(i,h,p)):(a||(a={key:{},next:null}),(function(g,f,b){var _=du(g,f);_?_.value=b:g.next={key:f,next:g.next,value:b}})(a,h,p))}};return d},il=d3,ps=X1,u3=Object.prototype.hasOwnProperty,Y1={brackets:function(s){return s+"[]"},comma:"comma",indices:function(s,i){return s+"["+i+"]"},repeat:function(s){return s}},On=Array.isArray,h3=Array.prototype.push,ef=function(s,i){h3.apply(s,On(i)?i:[i])},p3=Date.prototype.toISOString,tf=ps.default,gt={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:il.encode,encodeValuesOnly:!1,format:tf,formatter:ps.formatters[tf],indices:!1,serializeDate:function(s){return p3.call(s)},skipNulls:!1,strictNullHandling:!1},hu={},m3=function s(i,a,d,h,p,g,f,b,_,w,y,A,E,S,P,O){for(var $,G=i,re=O,te=0,Q=!1;(re=re.get(hu))!==void 0&&!Q;){var T=re.get(i);if(te+=1,T!==void 0){if(T===te)throw new RangeError("Cyclic object value");Q=!0}re.get(hu)===void 0&&(te=0)}if(typeof b=="function"?G=b(a,G):G instanceof Date?G=y(G):d==="comma"&&On(G)&&(G=il.maybeMap(G,(function(Z){return Z instanceof Date?y(Z):Z}))),G===null){if(p)return f&&!S?f(a,gt.encoder,P,"key",A):a;G=""}if(typeof($=G)=="string"||typeof $=="number"||typeof $=="boolean"||typeof $=="symbol"||typeof $=="bigint"||il.isBuffer(G))return f?[E(S?a:f(a,gt.encoder,P,"key",A))+"="+E(f(G,gt.encoder,P,"value",A))]:[E(a)+"="+E(String(G))];var N,L=[];if(G===void 0)return L;if(d==="comma"&&On(G))S&&f&&(G=il.maybeMap(G,f)),N=[{value:G.length>0?G.join(",")||null:void 0}];else if(On(b))N=b;else{var W=Object.keys(G);N=_?W.sort(_):W}for(var V=h&&On(G)&&G.length===1?a+"[]":a,U=0;U<N.length;++U){var x=N[U],J=typeof x=="object"&&x.value!==void 0?x.value:G[x];if(!g||J!==null){var j=On(G)?typeof d=="function"?d(V,x):V:V+(w?"."+x:"["+x+"]");O.set(i,te);var H=J1();H.set(hu,O),ef(L,s(J,j,d,h,p,g,d==="comma"&&S&&On(G)?null:f,b,_,w,y,A,E,S,P,H))}}return L},g3=function(s,i){var a,d=s,h=(function(S){if(!S)return gt;if(S.encoder!==null&&S.encoder!==void 0&&typeof S.encoder!="function")throw new TypeError("Encoder has to be a function.");var P=S.charset||gt.charset;if(S.charset!==void 0&&S.charset!=="utf-8"&&S.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var O=ps.default;if(S.format!==void 0){if(!u3.call(ps.formatters,S.format))throw new TypeError("Unknown format option provided.");O=S.format}var $=ps.formatters[O],G=gt.filter;return(typeof S.filter=="function"||On(S.filter))&&(G=S.filter),{addQueryPrefix:typeof S.addQueryPrefix=="boolean"?S.addQueryPrefix:gt.addQueryPrefix,allowDots:S.allowDots===void 0?gt.allowDots:!!S.allowDots,charset:P,charsetSentinel:typeof S.charsetSentinel=="boolean"?S.charsetSentinel:gt.charsetSentinel,delimiter:S.delimiter===void 0?gt.delimiter:S.delimiter,encode:typeof S.encode=="boolean"?S.encode:gt.encode,encoder:typeof S.encoder=="function"?S.encoder:gt.encoder,encodeValuesOnly:typeof S.encodeValuesOnly=="boolean"?S.encodeValuesOnly:gt.encodeValuesOnly,filter:G,format:O,formatter:$,serializeDate:typeof S.serializeDate=="function"?S.serializeDate:gt.serializeDate,skipNulls:typeof S.skipNulls=="boolean"?S.skipNulls:gt.skipNulls,sort:typeof S.sort=="function"?S.sort:null,strictNullHandling:typeof S.strictNullHandling=="boolean"?S.strictNullHandling:gt.strictNullHandling}})(i);typeof h.filter=="function"?d=(0,h.filter)("",d):On(h.filter)&&(a=h.filter);var p,g=[];if(typeof d!="object"||d===null)return"";p=i&&i.arrayFormat in Y1?i.arrayFormat:i&&"indices"in i?i.indices?"indices":"repeat":"indices";var f=Y1[p];if(i&&"commaRoundTrip"in i&&typeof i.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var b=f==="comma"&&i&&i.commaRoundTrip;a||(a=Object.keys(d)),h.sort&&a.sort(h.sort);for(var _=J1(),w=0;w<a.length;++w){var y=a[w];h.skipNulls&&d[y]===null||ef(g,m3(d[y],y,f,b,h.strictNullHandling,h.skipNulls,h.encode?h.encoder:null,h.filter,h.sort,h.allowDots,h.serializeDate,h.format,h.formatter,h.encodeValuesOnly,h.charset,_))}var A=g.join(h.delimiter),E=h.addQueryPrefix===!0?"?":"";return h.charsetSentinel&&(h.charset==="iso-8859-1"?E+="utf8=%26%2310003%3B&":E+="utf8=%E2%9C%93&"),A.length>0?E+A:""},f3={stringify:g3},Ji={};(function(s){function i(d,h){var p=typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(!p){if(Array.isArray(d)||(p=(function(y,A){if(y){if(typeof y=="string")return a(y,A);var E=Object.prototype.toString.call(y).slice(8,-1);return E==="Object"&&y.constructor&&(E=y.constructor.name),E==="Map"||E==="Set"?Array.from(y):E==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E)?a(y,A):void 0}})(d))||h){p&&(d=p);var g=0,f=function(){};return{s:f,n:function(){return g>=d.length?{done:!0}:{done:!1,value:d[g++]}},e:function(y){throw y},f}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
13
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var b,_=!0,w=!1;return{s:function(){p=p.call(d)},n:function(){var y=p.next();return _=y.done,y},e:function(y){w=!0,b=y},f:function(){try{_||p.return==null||p.return()}finally{if(w)throw b}}}}function a(d,h){(h==null||h>d.length)&&(h=d.length);for(var p=0,g=new Array(h);p<h;p++)g[p]=d[p];return g}s.type=d=>d.split(/ *; */).shift(),s.params=d=>{const h={};var p,g=i(d.split(/ *; */));try{for(g.s();!(p=g.n()).done;){const f=p.value.split(/ *= */),b=f.shift(),_=f.shift();b&&_&&(h[b]=_)}}catch(f){g.e(f)}finally{g.f()}return h},s.parseLinks=d=>{const h={};var p,g=i(d.split(/ *, */));try{for(g.s();!(p=g.n()).done;){const f=p.value.split(/ *; */),b=f[0].slice(1,-1);h[f[1].split(/ *= */)[1].slice(1,-1)]=b}}catch(f){g.e(f)}finally{g.f()}return h},s.cleanHeader=(d,h)=>(delete d["content-type"],delete d["content-length"],delete d["transfer-encoding"],delete d.host,h&&(delete d.authorization,delete d.cookie),d),s.isObject=d=>d!==null&&typeof d=="object",s.hasOwn=Object.hasOwn||function(d,h){if(d==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(new Object(d),h)},s.mixin=(d,h)=>{for(const p in h)s.hasOwn(h,p)&&(d[p]=h[p])}})(Ji);const nf=x1,rl=Ji.isObject,ms=Ji.hasOwn;var y3=$e;function $e(){}$e.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},$e.prototype.parse=function(s){return this._parser=s,this},$e.prototype.responseType=function(s){return this._responseType=s,this},$e.prototype.serialize=function(s){return this._serializer=s,this},$e.prototype.timeout=function(s){if(!s||typeof s!="object")return this._timeout=s,this._responseTimeout=0,this._uploadTimeout=0,this;for(const i in s)if(ms(s,i))switch(i){case"deadline":this._timeout=s.deadline;break;case"response":this._responseTimeout=s.response;break;case"upload":this._uploadTimeout=s.upload;break;default:console.warn("Unknown timeout option",i)}return this},$e.prototype.retry=function(s,i){return arguments.length!==0&&s!==!0||(s=1),s<=0&&(s=0),this._maxRetries=s,this._retries=0,this._retryCallback=i,this};const v3=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),b3=new Set([408,413,429,500,502,503,504,521,522,524]);$e.prototype._shouldRetry=function(s,i){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{const a=this._retryCallback(s,i);if(a===!0)return!0;if(a===!1)return!1}catch(a){console.error(a)}return!!(i&&i.status&&b3.has(i.status)||s&&(s.code&&v3.has(s.code)||s.timeout&&s.code==="ECONNABORTED"||s.crossDomain))},$e.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},$e.prototype.then=function(s,i){if(!this._fullfilledPromise){const a=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(((d,h)=>{a.on("abort",(()=>{if(this._maxRetries&&this._maxRetries>this._retries)return;if(this.timedout&&this.timedoutError)return void h(this.timedoutError);const p=new Error("Aborted");p.code="ABORTED",p.status=this.status,p.method=this.method,p.url=this.url,h(p)})),a.end(((p,g)=>{p?h(p):d(g)}))}))}return this._fullfilledPromise.then(s,i)},$e.prototype.catch=function(s){return this.then(void 0,s)},$e.prototype.use=function(s){return s(this),this},$e.prototype.ok=function(s){if(typeof s!="function")throw new Error("Callback required");return this._okCallback=s,this},$e.prototype._isResponseOK=function(s){return!!s&&(this._okCallback?this._okCallback(s):s.status>=200&&s.status<300)},$e.prototype.get=function(s){return this._header[s.toLowerCase()]},$e.prototype.getHeader=$e.prototype.get,$e.prototype.set=function(s,i){if(rl(s)){for(const a in s)ms(s,a)&&this.set(a,s[a]);return this}return this._header[s.toLowerCase()]=i,this.header[s]=i,this},$e.prototype.unset=function(s){return delete this._header[s.toLowerCase()],delete this.header[s],this},$e.prototype.field=function(s,i,a){if(s==null)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(rl(s)){for(const d in s)ms(s,d)&&this.field(d,s[d]);return this}if(Array.isArray(i)){for(const d in i)ms(i,d)&&this.field(s,i[d]);return this}if(i==null)throw new Error(".field(name, val) val can not be empty");return typeof i=="boolean"&&(i=String(i)),a?this._getFormData().append(s,i,a):this._getFormData().append(s,i),this},$e.prototype.abort=function(){if(this._aborted)return this;if(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req){if(nf.gte(process.version,"v13.0.0")&&nf.lt(process.version,"v14.0.0"))throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes");this.req.abort()}return this.clearTimeout(),this.emit("abort"),this},$e.prototype._auth=function(s,i,a,d){switch(a.type){case"basic":this.set("Authorization",`Basic ${d(`${s}:${i}`)}`);break;case"auto":this.username=s,this.password=i;break;case"bearer":this.set("Authorization",`Bearer ${s}`)}return this},$e.prototype.withCredentials=function(s){return s===void 0&&(s=!0),this._withCredentials=s,this},$e.prototype.redirects=function(s){return this._maxRedirects=s,this},$e.prototype.maxResponseSize=function(s){if(typeof s!="number")throw new TypeError("Invalid argument");return this._maxResponseSize=s,this},$e.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},$e.prototype.send=function(s){const i=rl(s);let a=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(i&&!this._data)Array.isArray(s)?this._data=[]:this._isHost(s)||(this._data={});else if(s&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(i&&rl(this._data))for(const d in s){if(typeof s[d]=="bigint"&&!s[d].toJSON)throw new Error("Cannot serialize BigInt value to json");ms(s,d)&&(this._data[d]=s[d])}else{if(typeof s=="bigint")throw new Error("Cannot send value of type BigInt");typeof s=="string"?(a||this.type("form"),a=this._header["content-type"],a&&(a=a.toLowerCase().trim()),this._data=a==="application/x-www-form-urlencoded"?this._data?`${this._data}&${s}`:s:(this._data||"")+s):this._data=s}return!i||this._isHost(s)||a||this.type("json"),this},$e.prototype.sortQuery=function(s){return this._sort=s===void 0||s,this},$e.prototype._finalizeQueryString=function(){const s=this._query.join("&");if(s&&(this.url+=(this.url.includes("?")?"&":"?")+s),this._query.length=0,this._sort){const i=this.url.indexOf("?");if(i>=0){const a=this.url.slice(i+1).split("&");typeof this._sort=="function"?a.sort(this._sort):a.sort(),this.url=this.url.slice(0,i)+"?"+a.join("&")}}},$e.prototype._appendQueryString=()=>{console.warn("Unsupported")},$e.prototype._timeoutError=function(s,i,a){if(this._aborted)return;const d=new Error(`${s+i}ms exceeded`);d.timeout=i,d.code="ECONNABORTED",d.errno=a,this.timedout=!0,this.timedoutError=d,this.abort(),this.callback(d)},$e.prototype._setTimeouts=function(){const s=this;this._timeout&&!this._timer&&(this._timer=setTimeout((()=>{s._timeoutError("Timeout of ",s._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((()=>{s._timeoutError("Response timeout of ",s._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))};const pu=Ji;var _3=ol;function ol(){}function w3(s,i){var a=typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(!a){if(Array.isArray(s)||(a=(function(b,_){if(b){if(typeof b=="string")return rf(b,_);var w=Object.prototype.toString.call(b).slice(8,-1);return w==="Object"&&b.constructor&&(w=b.constructor.name),w==="Map"||w==="Set"?Array.from(b):w==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(w)?rf(b,_):void 0}})(s))||i){a&&(s=a);var d=0,h=function(){};return{s:h,n:function(){return d>=s.length?{done:!0}:{done:!1,value:s[d++]}},e:function(b){throw b},f:h}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
14
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var p,g=!0,f=!1;return{s:function(){a=a.call(s)},n:function(){var b=a.next();return g=b.done,b},e:function(b){f=!0,p=b},f:function(){try{g||a.return==null||a.return()}finally{if(f)throw p}}}}function rf(s,i){(i==null||i>s.length)&&(i=s.length);for(var a=0,d=new Array(i);a<i;a++)d[a]=s[a];return d}function mu(){this._defaults=[]}ol.prototype.get=function(s){return this.header[s.toLowerCase()]},ol.prototype._setHeaderProperties=function(s){const i=s["content-type"]||"";this.type=pu.type(i);const a=pu.params(i);for(const d in a)Object.prototype.hasOwnProperty.call(a,d)&&(this[d]=a[d]);this.links={};try{s.link&&(this.links=pu.parseLinks(s.link))}catch{}},ol.prototype._setStatusProperties=function(s){const i=Math.trunc(s/100);this.statusCode=s,this.status=this.statusCode,this.statusType=i,this.info=i===1,this.ok=i===2,this.redirect=i===3,this.clientError=i===4,this.serverError=i===5,this.error=(i===4||i===5)&&this.toError(),this.created=s===201,this.accepted=s===202,this.noContent=s===204,this.badRequest=s===400,this.unauthorized=s===401,this.notAcceptable=s===406,this.forbidden=s===403,this.notFound=s===404,this.unprocessableEntity=s===422};for(var gu=0,of=["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"];gu<of.length;gu++){const s=of[gu];mu.prototype[s]=function(){for(var i=arguments.length,a=new Array(i),d=0;d<i;d++)a[d]=arguments[d];return this._defaults.push({fn:s,args:a}),this}}mu.prototype._setDefaults=function(s){var i,a=w3(this._defaults);try{for(a.s();!(i=a.n()).done;){const d=i.value;s[d.fn](...d.args)}}catch(d){a.e(d)}finally{a.f()}};var C3=mu;(function(s,i){function a(V,U){var x=typeof Symbol<"u"&&V[Symbol.iterator]||V["@@iterator"];if(!x){if(Array.isArray(V)||(x=(function(Me,qe){if(Me){if(typeof Me=="string")return d(Me,qe);var Ge=Object.prototype.toString.call(Me).slice(8,-1);return Ge==="Object"&&Me.constructor&&(Ge=Me.constructor.name),Ge==="Map"||Ge==="Set"?Array.from(Me):Ge==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ge)?d(Me,qe):void 0}})(V))||U){x&&(V=x);var J=0,j=function(){};return{s:j,n:function(){return J>=V.length?{done:!0}:{done:!1,value:V[J++]}},e:function(Me){throw Me},f:j}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
15
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H,Z=!0,ie=!1;return{s:function(){x=x.call(V)},n:function(){var Me=x.next();return Z=Me.done,Me},e:function(Me){ie=!0,H=Me},f:function(){try{Z||x.return==null||x.return()}finally{if(ie)throw H}}}}function d(V,U){(U==null||U>V.length)&&(U=V.length);for(var x=0,J=new Array(U);x<U;x++)J[x]=V[x];return J}let h;typeof window<"u"?h=window:typeof self>"u"?(console.warn("Using browser-only version of superagent in non-browser environment"),h=void 0):h=self;const p=b1.exports,g=S_,f=f3,b=y3,_=Ji.isObject,w=Ji.mixin,y=Ji.hasOwn,A=_3,E=C3;function S(){}s.exports=function(V,U){return typeof U=="function"?new i.Request("GET",V).end(U):arguments.length===1?new i.Request("GET",V):new i.Request(V,U)};const P=i=s.exports;i.Request=T,P.getXHR=()=>{if(h.XMLHttpRequest)return new h.XMLHttpRequest;throw new Error("Browser-only version of superagent could not find XHR")};const O="".trim?V=>V.trim():V=>V.replace(/(^\s*|\s*$)/g,"");function $(V){if(!_(V))return V;const U=[];for(const x in V)y(V,x)&&G(U,x,V[x]);return U.join("&")}function G(V,U,x){if(x!==void 0)if(x!==null)if(Array.isArray(x)){var J,j=a(x);try{for(j.s();!(J=j.n()).done;)G(V,U,J.value)}catch(H){j.e(H)}finally{j.f()}}else if(_(x))for(const H in x)y(x,H)&&G(V,`${U}[${H}]`,x[H]);else V.push(encodeURI(U)+"="+encodeURIComponent(x));else V.push(encodeURI(U))}function re(V){const U={},x=V.split("&");let J,j;for(let H=0,Z=x.length;H<Z;++H)J=x[H],j=J.indexOf("="),j===-1?U[decodeURIComponent(J)]="":U[decodeURIComponent(J.slice(0,j))]=decodeURIComponent(J.slice(j+1));return U}function te(V){return/[/+]json($|[^-\w])/i.test(V)}function Q(V){this.req=V,this.xhr=this.req.xhr,this.text=this.req.method!=="HEAD"&&(this.xhr.responseType===""||this.xhr.responseType==="text")||this.xhr.responseType===void 0?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;let U=this.xhr.status;U===1223&&(U=204),this._setStatusProperties(U),this.headers=(function(x){const J=x.split(/\r?\n/),j={};let H,Z,ie,Me;for(let qe=0,Ge=J.length;qe<Ge;++qe)Z=J[qe],H=Z.indexOf(":"),H!==-1&&(ie=Z.slice(0,H).toLowerCase(),Me=O(Z.slice(H+1)),j[ie]=Me);return j})(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),this.text===null&&V._responseType?this.body=this.xhr.response:this.body=this.req.method==="HEAD"?null:this._parseBody(this.text?this.text:this.xhr.response)}function T(V,U){const x=this;this._query=this._query||[],this.method=V,this.url=U,this.header={},this._header={},this.on("end",(()=>{let J,j=null,H=null;try{H=new Q(x)}catch(Z){return j=new Error("Parser is unable to parse the response"),j.parse=!0,j.original=Z,x.xhr?(j.rawResponse=x.xhr.responseType===void 0?x.xhr.responseText:x.xhr.response,j.status=x.xhr.status?x.xhr.status:null,j.statusCode=j.status):(j.rawResponse=null,j.status=null),x.callback(j)}x.emit("response",H);try{x._isResponseOK(H)||(J=new Error(H.statusText||H.text||"Unsuccessful HTTP response"))}catch(Z){J=Z}J?(J.original=j,J.response=H,J.status=J.status||H.status,x.callback(J,H)):x.callback(null,H)}))}P.serializeObject=$,P.parseString=re,P.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},P.serialize={"application/x-www-form-urlencoded":f.stringify,"application/json":g},P.parse={"application/x-www-form-urlencoded":re,"application/json":JSON.parse},w(Q.prototype,A.prototype),Q.prototype._parseBody=function(V){let U=P.parse[this.type];return this.req._parser?this.req._parser(this,V):(!U&&te(this.type)&&(U=P.parse["application/json"]),U&&V&&(V.length>0||V instanceof Object)?U(V):null)},Q.prototype.toError=function(){const V=this.req,U=V.method,x=V.url,J=`cannot ${U} ${x} (${this.status})`,j=new Error(J);return j.status=this.status,j.method=U,j.url=x,j},P.Response=Q,p(T.prototype),w(T.prototype,b.prototype),T.prototype.type=function(V){return this.set("Content-Type",P.types[V]||V),this},T.prototype.accept=function(V){return this.set("Accept",P.types[V]||V),this},T.prototype.auth=function(V,U,x){arguments.length===1&&(U=""),typeof U=="object"&&U!==null&&(x=U,U=""),x||(x={type:typeof btoa=="function"?"basic":"auto"});const J=x.encoder?x.encoder:j=>{if(typeof btoa=="function")return btoa(j);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(V,U,x,J)},T.prototype.query=function(V){return typeof V!="string"&&(V=$(V)),V&&this._query.push(V),this},T.prototype.attach=function(V,U,x){if(U){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(V,U,x||U.name)}return this},T.prototype._getFormData=function(){return this._formData||(this._formData=new h.FormData),this._formData},T.prototype.callback=function(V,U){if(this._shouldRetry(V,U))return this._retry();const x=this._callback;this.clearTimeout(),V&&(this._maxRetries&&(V.retries=this._retries-1),this.emit("error",V)),x(V,U)},T.prototype.crossDomainError=function(){const V=new Error(`Request has been terminated
|
|
16
|
+
Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.`);V.crossDomain=!0,V.status=this.status,V.method=this.method,V.url=this.url,this.callback(V)},T.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},T.prototype.ca=T.prototype.agent,T.prototype.buffer=T.prototype.ca,T.prototype.write=()=>{throw new Error("Streaming is not supported in browser version of superagent")},T.prototype.pipe=T.prototype.write,T.prototype._isHost=function(V){return V&&typeof V=="object"&&!Array.isArray(V)&&Object.prototype.toString.call(V)!=="[object Object]"},T.prototype.end=function(V){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=V||S,this._finalizeQueryString(),this._end()},T.prototype._setUploadTimeout=function(){const V=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((()=>{V._timeoutError("Upload timeout of ",V._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},T.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));const V=this;this.xhr=P.getXHR();const U=this.xhr;let x=this._formData||this._data;this._setTimeouts(),U.addEventListener("readystatechange",(()=>{const j=U.readyState;if(j>=2&&V._responseTimeoutTimer&&clearTimeout(V._responseTimeoutTimer),j!==4)return;let H;try{H=U.status}catch{H=0}if(!H)return V.timedout||V._aborted?void 0:V.crossDomainError();V.emit("end")}));const J=(j,H)=>{H.total>0&&(H.percent=H.loaded/H.total*100,H.percent===100&&clearTimeout(V._uploadTimeoutTimer)),H.direction=j,V.emit("progress",H)};if(this.hasListeners("progress"))try{U.addEventListener("progress",J.bind(null,"download")),U.upload&&U.upload.addEventListener("progress",J.bind(null,"upload"))}catch{}U.upload&&this._setUploadTimeout();try{this.username&&this.password?U.open(this.method,this.url,!0,this.username,this.password):U.open(this.method,this.url,!0)}catch(j){return this.callback(j)}if(this._withCredentials&&(U.withCredentials=!0),!this._formData&&this.method!=="GET"&&this.method!=="HEAD"&&typeof x!="string"&&!this._isHost(x)){const j=this._header["content-type"];let H=this._serializer||P.serialize[j?j.split(";")[0]:""];!H&&te(j)&&(H=P.serialize["application/json"]),H&&(x=H(x))}for(const j in this.header)this.header[j]!==null&&y(this.header,j)&&U.setRequestHeader(j,this.header[j]);this._responseType&&(U.responseType=this._responseType),this.emit("request",this),U.send(x===void 0?null:x)},P.agent=()=>new E;for(var N=0,L=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];N<L.length;N++){const V=L[N];E.prototype[V.toLowerCase()]=function(U,x){const J=new P.Request(V,U);return this._setDefaults(J),x&&J.end(x),J}}function W(V,U,x){const J=P("DELETE",V);return typeof U=="function"&&(x=U,U=null),U&&J.send(U),x&&J.end(x),J}E.prototype.del=E.prototype.delete,P.get=(V,U,x)=>{const J=P("GET",V);return typeof U=="function"&&(x=U,U=null),U&&J.query(U),x&&J.end(x),J},P.head=(V,U,x)=>{const J=P("HEAD",V);return typeof U=="function"&&(x=U,U=null),U&&J.query(U),x&&J.end(x),J},P.options=(V,U,x)=>{const J=P("OPTIONS",V);return typeof U=="function"&&(x=U,U=null),U&&J.send(U),x&&J.end(x),J},P.del=W,P.delete=W,P.patch=(V,U,x)=>{const J=P("PATCH",V);return typeof U=="function"&&(x=U,U=null),U&&J.send(U),x&&J.end(x),J},P.post=(V,U,x)=>{const J=P("POST",V);return typeof U=="function"&&(x=U,U=null),U&&J.send(U),x&&J.end(x),J},P.put=(V,U,x)=>{const J=P("PUT",V);return typeof U=="function"&&(x=U,U=null),U&&J.send(U),x&&J.end(x),J}})(zd,zd.exports);var Kr=zd.exports;function I3(s){var i=new Date().getTime(),a=new Date().toISOString(),d=console&&console.log?console:window&&window.console&&window.console.log?window.console:console;d.log("<<<<<"),d.log("[".concat(a,"]"),`
|
|
17
|
+
`,s.url,`
|
|
18
|
+
`,s.qs),d.log("-----"),s.on("response",(function(h){var p=new Date().getTime()-i,g=new Date().toISOString();d.log(">>>>>>"),d.log("[".concat(g," / ").concat(p,"]"),`
|
|
19
|
+
`,s.url,`
|
|
20
|
+
`,s.qs,`
|
|
21
|
+
`,h.text),d.log("-----")}))}function gs(s,i,a){var d=this;this._config.logVerbosity&&(s=s.use(I3)),this._config.proxy&&this._modules.proxy&&(s=this._modules.proxy.call(this,s)),this._config.keepAlive&&this._modules.keepAlive&&(s=this._modules.keepAlive(s));var h=s;if(i.abortSignal)var p=i.abortSignal.subscribe((function(){h.abort(),p()}));return i.forceBuffered===!0?h=typeof Blob>"u"?h.buffer().responseType("arraybuffer"):h.responseType("arraybuffer"):i.forceBuffered===!1&&(h=h.buffer(!1)),(h=h.timeout(i.timeout)).on("abort",(function(){return a({category:B.PNUnknownCategory,error:!0,operation:i.operation,errorData:new Error("Aborted")},null)})),h.end((function(g,f){var b,_={};if(_.error=g!==null,_.operation=i.operation,f&&f.status&&(_.statusCode=f.status),g){if(g.response&&g.response.text&&!d._config.logVerbosity)try{_.errorData=JSON.parse(g.response.text)}catch{_.errorData=g}else _.errorData=g;return _.category=d._detectErrorCategory(g),a(_,null)}if(i.ignoreBody)b={headers:f.headers,redirects:f.redirects,response:f};else try{b=JSON.parse(f.text)}catch{return _.errorData=f,_.error=!0,a(_,null)}return b.error&&b.error===1&&b.status&&b.message&&b.service?(_.errorData=b,_.statusCode=b.status,_.error=!0,_.category=d._detectErrorCategory(_),a(_,null)):(b.error&&b.error.message&&(_.errorData=b.error),a(_,b))})),h}function k3(s,i,a){return o(this,void 0,void 0,(function(){var d;return c(this,(function(h){switch(h.label){case 0:return d=Kr.post(s),i.forEach((function(p){var g=p.key,f=p.value;d=d.field(g,f)})),d.attach("file",a,{contentType:"application/octet-stream"}),[4,d];case 1:return[2,h.sent()]}}))}))}function E3(s,i,a){var d=Kr.get(this.getStandardOrigin()+i.url).set(i.headers).query(s);return gs.call(this,d,i,a)}function S3(s,i,a){var d=Kr.get(this.getStandardOrigin()+i.url).set(i.headers).query(s);return gs.call(this,d,i,a)}function P3(s,i,a,d){var h=Kr.post(this.getStandardOrigin()+a.url).query(s).set(a.headers).send(i);return gs.call(this,h,a,d)}function O3(s,i,a,d){var h=Kr.patch(this.getStandardOrigin()+a.url).query(s).set(a.headers).send(i);return gs.call(this,h,a,d)}function R3(s,i,a){var d=Kr.delete(this.getStandardOrigin()+i.url).set(i.headers).query(s);return gs.call(this,d,i,a)}function sf(s,i){var a=new Uint8Array(s.byteLength+i.byteLength);return a.set(new Uint8Array(s),0),a.set(new Uint8Array(i),s.byteLength),a.buffer}var dn,af=(function(){function s(){}return Object.defineProperty(s.prototype,"algo",{get:function(){return"aes-256-cbc"},enumerable:!1,configurable:!0}),s.prototype.encrypt=function(i,a){return o(this,void 0,void 0,(function(){var d;return c(this,(function(h){switch(h.label){case 0:return[4,this.getKey(i)];case 1:if(d=h.sent(),a instanceof ArrayBuffer)return[2,this.encryptArrayBuffer(d,a)];if(typeof a=="string")return[2,this.encryptString(d,a)];throw new Error("Cannot encrypt this file. In browsers file encryption supports only string or ArrayBuffer")}}))}))},s.prototype.decrypt=function(i,a){return o(this,void 0,void 0,(function(){var d;return c(this,(function(h){switch(h.label){case 0:return[4,this.getKey(i)];case 1:if(d=h.sent(),a instanceof ArrayBuffer)return[2,this.decryptArrayBuffer(d,a)];if(typeof a=="string")return[2,this.decryptString(d,a)];throw new Error("Cannot decrypt this file. In browsers file decryption supports only string or ArrayBuffer")}}))}))},s.prototype.encryptFile=function(i,a,d){return o(this,void 0,void 0,(function(){var h,p,g;return c(this,(function(f){switch(f.label){case 0:if(a.data.byteLength<=0)throw new Error("encryption error. empty content");return[4,this.getKey(i)];case 1:return h=f.sent(),[4,a.data.arrayBuffer()];case 2:return p=f.sent(),[4,this.encryptArrayBuffer(h,p)];case 3:return g=f.sent(),[2,d.create({name:a.name,mimeType:"application/octet-stream",data:g})]}}))}))},s.prototype.decryptFile=function(i,a,d){return o(this,void 0,void 0,(function(){var h,p,g;return c(this,(function(f){switch(f.label){case 0:return[4,this.getKey(i)];case 1:return h=f.sent(),[4,a.data.arrayBuffer()];case 2:return p=f.sent(),[4,this.decryptArrayBuffer(h,p)];case 3:return g=f.sent(),[2,d.create({name:a.name,data:g})]}}))}))},s.prototype.getKey=function(i){return o(this,void 0,void 0,(function(){var a,d,h;return c(this,(function(p){switch(p.label){case 0:return[4,crypto.subtle.digest("SHA-256",s.encoder.encode(i))];case 1:return a=p.sent(),d=Array.from(new Uint8Array(a)).map((function(g){return g.toString(16).padStart(2,"0")})).join(""),h=s.encoder.encode(d.slice(0,32)).buffer,[2,crypto.subtle.importKey("raw",h,"AES-CBC",!0,["encrypt","decrypt"])]}}))}))},s.prototype.encryptArrayBuffer=function(i,a){return o(this,void 0,void 0,(function(){var d,h,p;return c(this,(function(g){switch(g.label){case 0:return d=crypto.getRandomValues(new Uint8Array(16)),h=sf,p=[d.buffer],[4,crypto.subtle.encrypt({name:"AES-CBC",iv:d},i,a)];case 1:return[2,h.apply(void 0,p.concat([g.sent()]))]}}))}))},s.prototype.decryptArrayBuffer=function(i,a){return o(this,void 0,void 0,(function(){var d;return c(this,(function(h){switch(h.label){case 0:if(d=a.slice(0,16),a.slice(s.IV_LENGTH).byteLength<=0)throw new Error("decryption error: empty content");return[4,crypto.subtle.decrypt({name:"AES-CBC",iv:d},i,a.slice(s.IV_LENGTH))];case 1:return[2,h.sent()]}}))}))},s.prototype.encryptString=function(i,a){return o(this,void 0,void 0,(function(){var d,h,p,g;return c(this,(function(f){switch(f.label){case 0:return d=crypto.getRandomValues(new Uint8Array(16)),h=s.encoder.encode(a).buffer,[4,crypto.subtle.encrypt({name:"AES-CBC",iv:d},i,h)];case 1:return p=f.sent(),g=sf(d.buffer,p),[2,s.decoder.decode(g)]}}))}))},s.prototype.decryptString=function(i,a){return o(this,void 0,void 0,(function(){var d,h,p,g;return c(this,(function(f){switch(f.label){case 0:return d=s.encoder.encode(a).buffer,h=d.slice(0,16),p=d.slice(16),[4,crypto.subtle.decrypt({name:"AES-CBC",iv:h},i,p)];case 1:return g=f.sent(),[2,s.decoder.decode(g)]}}))}))},s.IV_LENGTH=16,s.encoder=new TextEncoder,s.decoder=new TextDecoder,s})(),T3=(dn=(function(){function s(i){if(i instanceof File)this.data=i,this.name=this.data.name,this.mimeType=this.data.type;else if(i.data){var a=i.data;this.data=new File([a],i.name,{type:i.mimeType}),this.name=i.name,i.mimeType&&(this.mimeType=i.mimeType)}if(this.data===void 0)throw new Error("Couldn't construct a file out of supplied options.");if(this.name===void 0)throw new Error("Couldn't guess filename out of the options. Please provide one.")}return s.create=function(i){return new this(i)},s.prototype.toBuffer=function(){return o(this,void 0,void 0,(function(){return c(this,(function(i){throw new Error("This feature is only supported in Node.js environments.")}))}))},s.prototype.toStream=function(){return o(this,void 0,void 0,(function(){return c(this,(function(i){throw new Error("This feature is only supported in Node.js environments.")}))}))},s.prototype.toFileUri=function(){return o(this,void 0,void 0,(function(){return c(this,(function(i){throw new Error("This feature is only supported in react native environments.")}))}))},s.prototype.toBlob=function(){return o(this,void 0,void 0,(function(){return c(this,(function(i){return[2,this.data]}))}))},s.prototype.toArrayBuffer=function(){return o(this,void 0,void 0,(function(){var i=this;return c(this,(function(a){return[2,new Promise((function(d,h){var p=new FileReader;p.addEventListener("load",(function(){if(p.result instanceof ArrayBuffer)return d(p.result)})),p.addEventListener("error",(function(){h(p.error)})),p.readAsArrayBuffer(i.data)}))]}))}))},s.prototype.toString=function(){return o(this,void 0,void 0,(function(){var i=this;return c(this,(function(a){return[2,new Promise((function(d,h){var p=new FileReader;p.addEventListener("load",(function(){if(typeof p.result=="string")return d(p.result)})),p.addEventListener("error",(function(){h(p.error)})),p.readAsBinaryString(i.data)}))]}))}))},s.prototype.toFile=function(){return o(this,void 0,void 0,(function(){return c(this,(function(i){return[2,this.data]}))}))},s})(),dn.supportsFile=typeof File<"u",dn.supportsBlob=typeof Blob<"u",dn.supportsArrayBuffer=typeof ArrayBuffer<"u",dn.supportsBuffer=!1,dn.supportsStream=!1,dn.supportsString=!0,dn.supportsEncryptFile=!0,dn.supportsFileUri=!1,dn),fu=(function(){function s(i){this.config=i,this.cryptor=new _t({config:i}),this.fileCryptor=new af}return Object.defineProperty(s.prototype,"identifier",{get:function(){return""},enumerable:!1,configurable:!0}),s.prototype.encrypt=function(i){var a=typeof i=="string"?i:new TextDecoder().decode(i);return{data:this.cryptor.encrypt(a),metadata:null}},s.prototype.decrypt=function(i){var a=typeof i.data=="string"?i.data:ye(i.data);return this.cryptor.decrypt(a)},s.prototype.encryptFile=function(i,a){var d;return o(this,void 0,void 0,(function(){return c(this,(function(h){return[2,this.fileCryptor.encryptFile((d=this.config)===null||d===void 0?void 0:d.cipherKey,i,a)]}))}))},s.prototype.decryptFile=function(i,a){return o(this,void 0,void 0,(function(){return c(this,(function(d){return[2,this.fileCryptor.decryptFile(this.config.cipherKey,i,a)]}))}))},s})(),yu=(function(){function s(i){this.cipherKey=i.cipherKey,this.CryptoJS=De,this.encryptedKey=this.CryptoJS.SHA256(this.cipherKey)}return Object.defineProperty(s.prototype,"algo",{get:function(){return"AES-CBC"},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"identifier",{get:function(){return"ACRH"},enumerable:!1,configurable:!0}),s.prototype.getIv=function(){return crypto.getRandomValues(new Uint8Array(s.BLOCK_SIZE))},s.prototype.getKey=function(){return o(this,void 0,void 0,(function(){var i,a;return c(this,(function(d){switch(d.label){case 0:return i=s.encoder.encode(this.cipherKey),[4,crypto.subtle.digest("SHA-256",i.buffer)];case 1:return a=d.sent(),[2,crypto.subtle.importKey("raw",a,this.algo,!0,["encrypt","decrypt"])]}}))}))},s.prototype.encrypt=function(i){if((typeof i=="string"?i:s.decoder.decode(i)).length===0)throw new Error("encryption error. empty content");var a=this.getIv();return{metadata:a,data:ce(this.CryptoJS.AES.encrypt(i,this.encryptedKey,{iv:this.bufferToWordArray(a),mode:this.CryptoJS.mode.CBC}).ciphertext.toString(this.CryptoJS.enc.Base64))}},s.prototype.decrypt=function(i){var a=this.bufferToWordArray(new Uint8ClampedArray(i.metadata)),d=this.bufferToWordArray(new Uint8ClampedArray(i.data));return s.encoder.encode(this.CryptoJS.AES.decrypt({ciphertext:d},this.encryptedKey,{iv:a,mode:this.CryptoJS.mode.CBC}).toString(this.CryptoJS.enc.Utf8)).buffer},s.prototype.encryptFileData=function(i){return o(this,void 0,void 0,(function(){var a,d,h;return c(this,(function(p){switch(p.label){case 0:return[4,this.getKey()];case 1:return a=p.sent(),d=this.getIv(),h={},[4,crypto.subtle.encrypt({name:this.algo,iv:d},a,i)];case 2:return[2,(h.data=p.sent(),h.metadata=d,h)]}}))}))},s.prototype.decryptFileData=function(i){return o(this,void 0,void 0,(function(){var a;return c(this,(function(d){switch(d.label){case 0:return[4,this.getKey()];case 1:return a=d.sent(),[2,crypto.subtle.decrypt({name:this.algo,iv:i.metadata},a,i.data)]}}))}))},s.prototype.bufferToWordArray=function(i){var a,d=[];for(a=0;a<i.length;a+=1)d[a/4|0]|=i[a]<<24-8*a;return this.CryptoJS.lib.WordArray.create(d,i.length)},s.BLOCK_SIZE=16,s.encoder=new TextEncoder,s.decoder=new TextDecoder,s})(),lf=(function(){function s(i){var a;this.defaultCryptor=i.default,this.cryptors=(a=i.cryptors)!==null&&a!==void 0?a:[]}return s.legacyCryptoModule=function(i){var a;return new this({default:new fu({cipherKey:i.cipherKey,useRandomIVs:(a=i.useRandomIVs)===null||a===void 0||a}),cryptors:[new yu({cipherKey:i.cipherKey})]})},s.aesCbcCryptoModule=function(i){var a;return new this({default:new yu({cipherKey:i.cipherKey}),cryptors:[new fu({cipherKey:i.cipherKey,useRandomIVs:(a=i.useRandomIVs)===null||a===void 0||a})]})},s.withDefaultCryptor=function(i){return new this({default:i})},s.prototype.getAllCryptors=function(){return m([this.defaultCryptor],u(this.cryptors),!1)},s.prototype.encrypt=function(i){var a=this.defaultCryptor.encrypt(i);if(!a.metadata)return a.data;var d=this.getHeaderData(a);return this.concatArrayBuffer(d,a.data)},s.prototype.decrypt=function(i){var a=typeof i=="string"?ce(i):i,d=un.tryParse(a),h=this.getCryptor(d),p=d.length>0?a.slice(d.length-d.metadataLength,d.length):null;if(a.slice(d.length).byteLength<=0)throw new Error("decryption error. empty content");return h.decrypt({data:a.slice(d.length),metadata:p})},s.prototype.encryptFile=function(i,a){return o(this,void 0,void 0,(function(){var d,h;return c(this,(function(p){switch(p.label){case 0:return this.defaultCryptor.identifier===un.LEGACY_IDENTIFIER?[2,this.defaultCryptor.encryptFile(i,a)]:[4,this.getFileData(i.data)];case 1:return d=p.sent(),[4,this.defaultCryptor.encryptFileData(d)];case 2:return h=p.sent(),[2,a.create({name:i.name,mimeType:"application/octet-stream",data:this.concatArrayBuffer(this.getHeaderData(h),h.data)})]}}))}))},s.prototype.decryptFile=function(i,a){return o(this,void 0,void 0,(function(){var d,h,p,g,f,b,_,w;return c(this,(function(y){switch(y.label){case 0:return[4,i.data.arrayBuffer()];case 1:return d=y.sent(),h=un.tryParse(d),((p=this.getCryptor(h))==null?void 0:p.identifier)===s.LEGACY_IDENTIFIER?[2,p.decryptFile(i,a)]:[4,this.getFileData(d)];case 2:return g=y.sent(),f=g.slice(h.length-h.metadataLength,h.length),_=(b=a).create,w={name:i.name},[4,this.defaultCryptor.decryptFileData({data:d.slice(h.length),metadata:f})];case 3:return[2,_.apply(b,[(w.data=y.sent(),w)])]}}))}))},s.prototype.getCryptor=function(i){if(i===""){var a=this.getAllCryptors().find((function(d){return d.identifier===""}));if(a)return a;throw new Error("unknown cryptor error")}if(i instanceof vu)return this.getCryptorFromId(i.identifier)},s.prototype.getCryptorFromId=function(i){var a=this.getAllCryptors().find((function(d){return i===d.identifier}));if(a)return a;throw Error("unknown cryptor error")},s.prototype.concatArrayBuffer=function(i,a){var d=new Uint8Array(i.byteLength+a.byteLength);return d.set(new Uint8Array(i),0),d.set(new Uint8Array(a),i.byteLength),d.buffer},s.prototype.getHeaderData=function(i){if(i.metadata){var a=un.from(this.defaultCryptor.identifier,i.metadata),d=new Uint8Array(a.length),h=0;return d.set(a.data,h),h+=a.length-i.metadata.byteLength,d.set(new Uint8Array(i.metadata),h),d.buffer}},s.prototype.getFileData=function(i){return o(this,void 0,void 0,(function(){return c(this,(function(a){switch(a.label){case 0:return i instanceof Blob?[4,i.arrayBuffer()]:[3,2];case 1:return[2,a.sent()];case 2:if(i instanceof ArrayBuffer)return[2,i];if(typeof i=="string")return[2,s.encoder.encode(i)];throw new Error("Cannot decrypt/encrypt file. In browsers file encrypt/decrypt supported for string, ArrayBuffer or Blob")}}))}))},s.LEGACY_IDENTIFIER="",s.encoder=new TextEncoder,s.decoder=new TextDecoder,s})(),un=(function(){function s(){}return s.from=function(i,a){if(i!==s.LEGACY_IDENTIFIER)return new vu(i,a.byteLength)},s.tryParse=function(i){var a=new Uint8Array(i),d="";if(a.byteLength>=4&&(d=a.slice(0,4),this.decoder.decode(d)!==s.SENTINEL))return"";if(!(a.byteLength>=5))throw new Error("decryption error. invalid header version");if(a[4]>s.MAX_VERSION)throw new Error("unknown cryptor error");var h="",p=5+s.IDENTIFIER_LENGTH;if(!(a.byteLength>=p))throw new Error("decryption error. invalid crypto identifier");h=a.slice(5,p);var g=null;if(!(a.byteLength>=p+1))throw new Error("decryption error. invalid metadata length");return g=a[p],p+=1,g===255&&a.byteLength>=p+2&&(g=new Uint16Array(a.slice(p,p+2)).reduce((function(f,b){return(f<<8)+b}),0),p+=2),new vu(this.decoder.decode(h),g)},s.SENTINEL="PNED",s.LEGACY_IDENTIFIER="",s.IDENTIFIER_LENGTH=4,s.VERSION=1,s.MAX_VERSION=1,s.decoder=new TextDecoder,s})(),vu=(function(){function s(i,a){this._identifier=i,this._metadataLength=a}return Object.defineProperty(s.prototype,"identifier",{get:function(){return this._identifier},set:function(i){this._identifier=i},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"metadataLength",{get:function(){return this._metadataLength},set:function(i){this._metadataLength=i},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"version",{get:function(){return un.VERSION},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"length",{get:function(){return un.SENTINEL.length+1+un.IDENTIFIER_LENGTH+(this.metadataLength<255?1:3)+this.metadataLength},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"data",{get:function(){var i=0,a=new Uint8Array(this.length),d=new TextEncoder;a.set(d.encode(un.SENTINEL)),a[i+=un.SENTINEL.length]=this.version,i++,this.identifier&&a.set(d.encode(this.identifier),i),i+=un.IDENTIFIER_LENGTH;var h=this.metadataLength;return h<255?a[i]=h:a.set([255,h>>8,255&h],i),a},enumerable:!1,configurable:!0}),s.IDENTIFIER_LENGTH=4,s.SENTINEL="PNED",s})();function x3(s){if(!navigator||!navigator.sendBeacon)return!1;navigator.sendBeacon(s)}var A3=(function(s){function i(a){var d=this,h=a.listenToBrowserNetworkEvents,p=h===void 0||h;return a.sdkFamily="Web",a.networking=new k_({del:R3,get:S3,post:P3,patch:O3,sendBeacon:x3,getfile:E3,postfile:k3}),a.cbor=new E_((function(g){return v1(M.decode(g))}),ce),a.PubNubFile=T3,a.cryptography=new af,a.initCryptoModule=function(g){return new lf({default:new fu({cipherKey:g.cipherKey,useRandomIVs:g.useRandomIVs}),cryptors:[new yu({cipherKey:g.cipherKey})]})},d=s.call(this,a)||this,p&&(window.addEventListener("offline",(function(){d.networkDownDetected()})),window.addEventListener("online",(function(){d.networkUpDetected()}))),d}return t(i,s),i.CryptoModule=lf,i})(I_);return A3})();var Bl=mh(Eh.exports);let ze;const m0=(e,t)=>ze?.getSubscribedChannels&&!ze?.getSubscribedChannels().some((n=>n===e))&&((n,r)=>ze?.subscribe(Object.assign({channels:[n]},r)))(e,t),g0=e=>new Promise(((t,n)=>{ze?.hereNow({channels:[e.channel],includeState:!0,includeUUIDs:!0},((r,o)=>r.error?n(r):t(o)))})),Fl={};function f0(e,t){return Rt(t).then((n=>(function(r,o){const{id:c,chatroom_messages_url:l}=o;return Fl[c]&&(r=Fl[c](r)),F.post({url:l,data:r}).then((u=>u)).catch((u=>(console.error("Error: "+u+" Message failed to send."),Promise.reject(u))))})(e,n)))}const co=e=>({number:!0,string:!isNaN(Date.parse(Sh(e))),object:e instanceof Date&&!isNaN(e.getTime())})[typeof e],Sh=e=>typeof e=="string"&&/^(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2}):(\d{2}(?:[,.]\d*)?)(([+-](\d{2}):(\d{2})|Z)?)$/.test(e)?e.replace(",","."):e,zl=e=>co(e.program_date_time)?new Date(Sh(e.program_date_time)):null,y0=e=>`
|
|
22
|
+
See https://docs.livelike.com/docs/javascript-getting-started for more details.`,Ph=e=>{let t=`https://websdk.livelikecdn.com/javascript-docs/${Cl.apiDocVersion}/index.html`;return e&&(t=`${t}#${e}`),`See ${t} for more details.`},Hl=(e,t="")=>(console.error(e,Ph(t)),e+`
|
|
23
|
+
`+Ph(t)),Oh=(e,t,n)=>{const r=`${e}: ${t} must be of type <${n}>`;return console.error(r),r},uo=(e,t)=>Promise.reject(((n,r)=>Hl("Missing "+n+" argument",r))(e,t)),Rh=()=>Promise.reject(Hl("SDK not initialized","init"));function v0(e){switch(e){case 1:return"1st";case 2:return"2nd";case 3:return"3rd";default:return`${e}th`}}function Th(e,t,n,r){const o=Array.from(e);let c=[];for(const[m,v]of Object.entries(t)){const R=Array.isArray(v),k=v0(parseInt(m,10)+1),M=o[m];if(M!==void 0){if(R){const D=b0(M,v,k);D.length&&(c=c.concat(D))}}else c.push(R?`Missing object as ${k} argument.`:`Missing "${v}" as ${k} argument.`)}const l=r?.();return l&&(c=c.concat(Array.isArray(l)?l:[l])),c.length?Promise.reject((u=n,Hl(c.join(`
|
|
24
|
+
`),u))):Promise.resolve(void 0);var u}function b0(e,t,n){let r=[];for(const o of t)e[o]===void 0&&r.push(`Missing object property "${o}" in ${n} argument object.`);return r}function Y(e,t,n,r){return Th([e],[t],n,r)}const ki=(e,t)=>{let n="channel-"+e;return t&&(n+="-event-"+t),n},he=(function(){let e={};const t=(o,c,l)=>{const u=e[ki(o,l)],m=e[ki(o)];l&&u?.forEach((v=>v({message:c,event:l}))),m?.forEach((v=>v({message:c,event:l})))},n={message:o=>{o.timetoken&&(o.message.payload.timetoken=o.timetoken),t(o.channel,o.message.payload,o.message.event)},messageAction:o=>{t(o.channel,o.data,o.event)},presence:o=>{const c=e[ki(o.channel)];c?.forEach((l=>l({message:o,event:o.action})))}},r=o=>{if(!o?.subscribeKey||!o?.publishKey)return void(z.logger&&console.log("PubNub is not configured for the current application."));var c;z.pn&&(c=n,ze?.removeListener(c));const l=(u=>(z.logger&&console.table(Object.assign(Object.assign({},u),{profileToken:Ce.access_token})),ze=new Bl(Object.assign(Object.assign({},u),{uuid:Ce.id,restore:!0,ssl:!0})),z.logger&&console.log(`PubNub is initialised with uuid: ${Ce.id} and subscribeKey: ${u.subscribeKey}`),ze))(o);(u=>{ze?.addListener(u)})(n),z.pn=l};return{listeners:e,initialisePubnub:r,subscribe:(o,c)=>{!z.pn&&z.pnConfig&&r(z.pnConfig),m0(o,c)},addListener:(o,c,l)=>{const u=ki(o,l);if(e.hasOwnProperty(u)){const m=e[u];c&&m.push(c),e[u]=m}else e[u]=[c]},unsubscribe:o=>{let c=ki(o);!Object.keys(e).some((u=>u.startsWith(c)))&&(u=>{ze?.unsubscribe({channels:[u]})})(o)},removeListener:(o,c,l)=>{const u=ki(o,l);if(e.hasOwnProperty(u)){const m=e[u].filter((v=>v!==c));m&&m.length?e[u]=m:delete e[u]}return e},removeAllListenersForEvent:(o,c)=>(delete e[ki(o,c)],e)}})(),_0={"&":"&","<":"<",">":">",""":'"',"/":"/"},w0=/<|>|&|"|//gi,ql=e=>e?e.replace(w0,(t=>_0[t])):null,xh=(e,t)=>{var n,r;let o=e;var c;return e.message&&e.message.length&&(o=Object.assign(Object.assign({},e),{message:ql(e.message),filtered_message:ql(e.filtered_message),isFiltered:Ah(t,e)}),o.quote_message&&(o.quote_message=Object.assign(Object.assign({},o.quote_message),{message:ql(o.quote_message.message)}))),c=e.message_event,rr[c]===vt.RECEIVED&&(o=Object.assign(Object.assign({},o),{timetoken:(n=e.timetoken)!==null&&n!==void 0?n:e.pubnub_timetoken,reactions:(r=e.reactions)!==null&&r!==void 0?r:{}})),o},Ah=(e,t)=>{const n=t.content_filter&&t.content_filter.indexOf(ro.PROFANITY)>=0,r=t.sender_id===Ce.id;return Ce.nickname!=="Producer"&&!r&&n},Mh=(e,t,n=[],r=!1)=>{const o=t.sender_id===Ce.id,c=t.content_filter&&t.content_filter.indexOf(ro.SHADOW_MUTED)>=0&&!o,l=Ah(e,t)&&!r,u=n.includes(t.sender_id);return!c&&!l&&!u},C0=(e,t,n,r)=>{if(t&&Array.isArray(t)){const o=[];return t.forEach((c=>{Mh(e,c,n,r)&&(rr[c.message_event]===vt.RECEIVED?(c=xh(c,e),o.push(c)):rr[c.message_event]===vt.DELETED&&(({roomId:l,messageId:u})=>{const m=z.deletedMessageIds[l]||new Set;m.add(u),z.deletedMessageIds[l]=m})({roomId:e,messageId:c.id}))})),(c=>z.deletedMessageIds[c]||new Set)(e).forEach((c=>{const l=o.findIndex((u=>u.id===c));l!==-1&&o.splice(l,1)})),o}return[]};function Gl(e){let t,n=[],r=e,o=!1;return{subscribe:function(c){const l=typeof c=="function",u=l?{next:c}:c;return n.push(u),o||(t=(function(){if(r)try{let m,v=!1;o=!0;const R=r({next(k){!v&&n.forEach((M=>{var D;return(D=M.next)===null||D===void 0?void 0:D.call(M,k)}))},error(k){!v&&n.forEach((M=>{var D;return(D=M.error)===null||D===void 0?void 0:D.call(M,k)}))},complete(){v||(v=!0,n.forEach((k=>{var M;return(M=k.complete)===null||M===void 0?void 0:M.call(k)})))}});return m=()=>{R(),v=!0,o=!1},m}catch(m){n.forEach((v=>{var R;return(R=v.error)===null||R===void 0?void 0:R.call(v,m)}))}})()),()=>{const m=n.findIndex((v=>l?v.next===c:v===c));m>-1&&n.splice(m,1),!n.length&&t&&(t(),t=null)}},pipe:function(...c){return c.reduce(((l,u)=>u(l)),this)}}}function Lh(e){z.pollingInterval=e}function $h(){return z.pollingInterval}function I0({getResourceUrl:e,pollingInterval:t,streamInfo:n}){return Gl((r=>{let o;const c=(function({observer:l,getResourceUrl:u}){let m;return()=>{let v;v=m?Promise.resolve(m):u(),v.then((R=>F.get({url:R}))).then((R=>{m=R.next,R.results.forEach((k=>{var M;return(M=l.next)===null||M===void 0?void 0:M.call(l,k)}))})).catch((R=>{var k;let M="Error while polling stream events api";console.error(M,R),(k=l.error)===null||k===void 0||k.call(l,M)}))}})({observer:r,getResourceUrl:e});return z.logger&&console.info(`setting polling interval for ${n}`),o=globalThis.setInterval(c,t),()=>{z.logger&&console.info(`clearing polling interval for ${n}, intervalNumber=${o}`),globalThis.clearInterval(o)}}))}const Wl={},k0=e=>{return(r=>{if(Wl[r.roomId])return Wl[r.roomId];const o=I0({getResourceUrl:()=>pe().then((c=>`${c.chat_room_events_url}?since=${new Date().toISOString()}&chat_room_id=${r.roomId}`)),pollingInterval:$h(),streamInfo:`Topic=${xs.CHAT_ROOM}, chatRoomId=${r.roomId}`});return Wl[r.roomId]=o,o})(e).pipe((n=({category:r})=>r===As.CHAT_MESSAGE,r=>Gl((o=>{const c=r.subscribe({next:l=>{var u;try{n(l)&&((u=o.next)===null||u===void 0||u.call(o,l))}catch(m){console.error("Error while filtering observable data",m)}},error:o.error,complete:o.complete});return()=>{c()}}))),(t=r=>({event:r.payload.message_event,message:r.payload}),r=>Gl((o=>{const c=r.subscribe({next:l=>{var u;(u=o.next)===null||u===void 0||u.call(o,t(l))},error:o.error,complete:o.complete});return()=>{c()}}))));var t,n},Vs=(e,t)=>{let n="channel-"+e;return t&&(n+="-event-"+t),n};let or;function E0(){or=(function(){let e={};return{listeners:e,addPollingListener({channel:t,event:n,listenerFn:r}){const o=Vs(t,n),c=e[o];return c?r&&c.listeners.push(r):e[o]={listeners:[r]},e[o]},subscribe({apiStream$:t,channel:n,event:r}){const o=Vs(n,r),c=e[o];c&&(c.unsubscription||(c.unsubscription=t.subscribe((l=>{c.listeners.forEach((u=>u(l)))}))))},unsubscribe({channel:t,event:n}){const r=Vs(t,n),o=e[r];o&&o.unsubscription&&!o.listeners.length&&(o.unsubscription(),e[r]=Object.assign(Object.assign({},o),{unsubscription:null}))},removePollingListener({channel:t,listenerFn:n,event:r}){const o=Vs(t,r),c=e[o];if(!c)return;const l=c.listeners.filter((u=>u!==n));return e[o]=Object.assign(Object.assign({},c),{listeners:l}),l.length||this.unsubscribe({channel:t,event:r}),e[o]}}})()}function Vh(){var e,t;return!!(!((e=z.pnConfig)===null||e===void 0)&&e.subscribeKey)&&!!(!((t=z.pnConfig)===null||t===void 0)&&t.publishKey)}const Kl=()=>z.chatRoomInvitationsUrl,Dh=e=>Pe(e,z.chatRoomInvitationDetailUrlTemplate);function Nh(e,t=[]){const n=e.widget_kind===X.CHEER_METER;let r=[e];if(n){const o=t.findIndex((c=>c.option_id===e.option_id));r=[...t],o>-1?r.splice(o,1,e):r.push(e)}return r}function Uh(){return!!z.logger}const Ql=(e,t,n)=>F[e]({url:z.profileUrl,data:t,accessToken:n}),ho=e=>e&&(e.accessToken||e.profileId)?e.accessToken?Ql("get",null,e.accessToken).then((t=>(t.access_token=e.accessToken,t))):e.profileId&&F.get({url:Pe(e.profileId,z.profileDetailUrlTemplate)}):uo("accessToken or profileId","fetchUserProfile"),jh=e=>Ql("post",e&&e.nickname&&e,null).then((t=>(Uh()&&console.debug("Unique Profile Created",t.id),t)));function Xl(e,t){he.addListener(Ce.subscribe_channel,t,e),he.subscribe(Ce.subscribe_channel)}let sr={};function po(e,t){sr[e]=(sr[e]||[]).concat(t)}var Zl,Jl,Yl,ec,Ln;(function(e){e.PARTICIPANT_JOIN="PARTICIPANT_JOIN",e.PARTICIPANT_LEFT="PARTICIPANT_LEFT",e.ERROR="ERROR",e.RECONNECTING="RECONNECTING"})(Zl||(Zl={})),(function(e){e.CONNECTED="CONNECTED",e.DISCONNECTED="DISCONNECTED",e.RECONNECTING="RECONNECTING"})(Jl||(Jl={})),(function(e){e.USER_ALREADY_EXIST="USER_ALREADY_EXIST",e.CONNECTION_LOST="CONNECTION_LOST",e.INVALID_VIDEO_ROOM_ID="INVALID_VIDEO_ROOM_ID",e.EXPIRED_VIDEO_ROOM_ID="EXPIRED_VIDEO_ROOM_ID",e.MAX_PARTICIPANT_LIMIT_REACHED="MAX_PARTICIPANT_LIMIT_REACHED",e.VIDEO_PERMISSION_DENIED="VIDEO_PERMISSION_DENIED",e.AUDIO_PERMISSION_DENIED="AUDIO_PERMISSION_DENIED",e.PLUGIN_ERROR="PLUGIN_ERROR",e.UNABLE_TO_CREATE_VIDEO_ROOM="UNABLE_TO_CREATE_VIDEO_ROOM",e.UNABLE_TO_JOIN_VIDEO_ROOM="UNABLE_TO_JOIN_VIDEO_ROOM"})(Yl||(Yl={})),(function(e){e.INFO="INFO",e.ERROR="ERROR",e.WARNING="WARNING"})(ec||(ec={})),(function(e){e.INITIALISED="INITIALISED"})(Ln||(Ln={}));const S0=e=>{var t;(t=Ln.INITIALISED,sr[t]||[]).forEach((n=>{try{n(e)}catch(r){console.error("Error while calling sdk initialised listener",r)}}))},P0=(e,t)=>{var n;if(e)return ho({accessToken:e});{let r=(n=z.storageStrategy)===null||n===void 0?void 0:n.get();return r?ho({accessToken:r.access_token}):jh({nickname:t})}};function Bh(e){let t=z.ready&&z.clientId&&Ce;return z.logger=e.logger||null,t&&z.logger&&console.warn("LiveLike EngagementSDK has already been initialized!"),!e.accessToken&&z.logger&&console.warn(`LiveLike EngagementSDK has been initialized without an accessToken.
|
|
25
|
+
${y0()}`),e.endpoint&&(z.endpoint=e.endpoint),z.ready=!1,z.clientId=e.clientId,z.accessToken=e.accessToken||null,z.storageStrategy=e.storageStrategy||z.storageStrategy,z.lsKey="livelike-user-auth-"+e.clientId,e.lang&&Ih(e.lang),e.analyticsProvider&&lh(e.analyticsProvider),E0(),pe().then((n=>(z.programUrlTemplate=n.program_detail_url_template,z.chatUrlTemplate=n.chat_room_detail_url_template,z.leaderboardUrlTemplate=n.leaderboard_detail_url_template,z.createChatUrlTemplate=n.create_chat_room_url,z.profileDetailUrlTemplate=n.profile_detail_url_template,z.chatRoomInvitationDetailUrlTemplate=n.chat_room_invitation_detail_url_template,z.chatRoomInvitationsUrl=n.chat_rooms_invitations_url,z.profileUrl=n.profile_url,z.pinnedMessagesUrl=n.pinned_messages_url,n.api_polling_interval&&Lh(1e3*n.api_polling_interval),n))).then((n=>P0(e.accessToken,e.nickName).then((r=>({app:n,profile:r}))))).then((({app:n,profile:r})=>{z.storageStrategy.set(r),Object.assign(Ce,r);const o={subscribeKey:n.pubnub_subscribe_key,origin:n.pubnub_origin,authKey:r.access_token,heartbeatInterval:n.pubnub_heartbeat_interval,presenceTimeout:n.pubnub_presence_timeout,publishKey:e.publishKey||n.pubnub_publish_key},c=z.pnConfig&&Object.keys(o).findIndex((m=>z.pnConfig[m]!==o[m]))!==-1,l=z.pn&&c;var u;return z.pnConfig&&!c||(z.pnConfig=o),l&&(u=o,he.initialisePubnub(u)),(z.ready=!0,Cl.ready=!0,Promise.resolve(!0)).then((()=>S0(r))).then((()=>r))}))}var Fh=function(e,t,n,r){return new(n||(n=Promise))((function(o,c){function l(v){try{m(r.next(v))}catch(R){c(R)}}function u(v){try{m(r.throw(v))}catch(R){c(R)}}function m(v){var R;v.done?o(v.value):(R=v.value,R instanceof n?R:new n((function(k){k(R)}))).then(l,u)}m((r=r.apply(e,[])).next())}))};function zh(e){return Y(e,["profileId"],"blockProfile").then((()=>F.post({url:Ce.block_profile_url,data:{blocked_profile_id:e.profileId}}))).then((t=>(Ds(t.blocked_profile_id,"add"),t)))}function Hh(e){return Fh(this,void 0,void 0,(function*(){return Y(e,[],"getProfileBlockInfo",(()=>{if(!e?.profileId&&!e?.blockId)return'Argument object is missing "profileId" or "blockId" property.'})).then((()=>e.profileId?F.get({url:Pe(e.profileId,Ce.blocked_profiles_template_url)}).then((t=>t.results&&t.results[0])):F.get({url:`${Ce.block_profile_url}${e.blockId}/`})))}))}function tc(){return Fh(this,void 0,void 0,(function*(){return Ee(["results"],ke(Ce.blocked_profile_ids_url,(e=>F.get({url:e})),(e=>({count:e.count,results:e.results})))).then((e=>(z.blockedProfileIds=e.results,e)))}))}function O0(e){Ds(e.message.blocked_profile_id,"add")}function R0(e){Ds(e.message.blocked_profile_id,"delete")}let qh=!1;const Ds=(e,t)=>{const n=z.blockedProfileIds.findIndex((r=>r===e));t==="add"&&n===-1?z.blockedProfileIds=[...z.blockedProfileIds,e]:t==="delete"&&n>-1&&z.blockedProfileIds.splice(n,1)},nc=()=>z.blockedProfileIds;function Gh(e,t={},n){const r=[n&&`chat_room_id=${n}`,t.count&&`page_size=${t.count}`,t.start&&`until=${t.start}`,t.end&&`since=${t.end}`].filter((o=>!!o));return`${e}${r.length?`?${r.join("&")}`:""}`}const ic=(e,t={})=>z.ready?(t.count||(t.count=25),t.start&&co(t.start)&&(t.start=new Date(t.start).toISOString()),t.end&&co(t.end)&&(t.end=new Date(t.end).toISOString()),Rt(e).then((n=>{const r=ke(Gh(n.chatroom_messages_url,t,n.id),(o=>Promise.all([tc(),F.get({url:o})]).then((([c,l])=>{const u=c.results,m=l.results;return{results:m.length?C0(e,m,u,t.includeFilteredMessages):[],next:l.previous}}))),(o=>({messages:o.results})));return r.next().then((o=>({messages:o.value.messages,done:o.done,next:r.next})))}))):Rh(),mo=new Map,Wh=(e,t)=>Y(e,["roomId"],"addMessageListener").then((()=>jl(e.roomId))).then((n=>{const r=({message:o,event:c})=>{const l=rr[c]===vt.RECEIVED;(l&&Mh(e.roomId,o,z.blockedProfileIds)||!l)&&t({message:xh(o,e.roomId),roomId:e.roomId,event:rr[c]})};if(mo.set(t,r),Vh())return he.addListener(n,r),he.subscribe(n),z.ready&&Ce?qh?Promise.resolve():tc().then((()=>{qh=!0,Xl(io.BLOCK_PROFILE,O0),Xl(io.UNBLOCK_PROFILE,R0)})):Promise.reject("SDK not initialised");{or.addPollingListener({channel:n,listenerFn:r});const o=k0(e);return or.subscribe({apiStream$:o,channel:n}),Promise.resolve()}})),Ns=(e,t)=>Y(e,["roomId"],"removeMessageListener").then((()=>jl(e.roomId))).then((n=>{if(!mo.has(t))return;const r=mo.get(t);mo.delete(t),Vh()?(he.removeListener(n,r),he.unsubscribe(n)):(or.removePollingListener({channel:n,listenerFn:r}),or.unsubscribe({channel:n})),mo.delete(t)})),Kh=e=>Y(e,["roomId"],"messages").then((()=>f0((t=>({chat_room_id:t.roomId,client_message_id:Bl.generateUUID(),sender_id:Ce.id,sender_nickname:Ce.nickname,sender_image_url:t.sender_image_url||null,sender_profile_url:Ce.url,badge_image_url:null,program_date_time:t.timestamp||null,message:t.message||null,image_width:~~t.image_width||null,image_height:~~t.image_height||null,image_url:t.image_url||null,message_metadata:t.message_metadata||null,message_event:t.image_url?We.IMAGE_CREATED:We.MESSAGE_CREATED}))(e),e.roomId))),rc=e=>Y(e,["roomId","messageId"],"deleteMessage").then((()=>Rt(e.roomId))).then((t=>F.post({url:t.delete_message_url,data:{message_id:e.messageId}}))),Qh=e=>Y(e,["roomId","imageFormData"],"uploadImage").then((()=>Rt(e.roomId))).then((t=>F.post({url:t.upload_url,data:e.imageFormData,headers:{"Content-Type":""}})));var T0=function(e,t,n,r){return new(n||(n=Promise))((function(o,c){function l(v){try{m(r.next(v))}catch(R){c(R)}}function u(v){try{m(r.throw(v))}catch(R){c(R)}}function m(v){var R;v.done?o(v.value):(R=v.value,R instanceof n?R:new n((function(k){k(R)}))).then(l,u)}m((r=r.apply(e,[])).next())}))};const x0=()=>Promise.resolve(!0),Us=e=>e.roomId?Rt(e.roomId):uo("roomId","chatroom"),oc=(e,t,n)=>Us(e).then((r=>F[t]({url:r.memberships_url,data:n}))),sc=e=>({id:e.id,title:e.title,created_at:e.created_at,visibility:e.visibility,content_filter:e.content_filter,token_gates:e.token_gates,chatroom_token_gate_access_url_template:e.chatroom_token_gate_access_url_template}),Xh=e=>({chat_room_id:e.chat_room_id,access:e.access,wallet_details:e.wallet_details,details:e.details}),Zh=e=>Us(e).then(sc);function Jh(e){return Y(e,[],"getReactionSpaceDetail",(()=>{if(!e?.reactionSpaceId&&!e?.targetGroupId)return'Argument object is missing "reactionSpaceId" or "targetGroupId" property.'})).then((()=>pe())).then((t=>e.reactionSpaceId?F.get({url:Pe(e.reactionSpaceId,t.reaction_space_detail_url_template)}):F.get({url:`${t.reaction_spaces_url}?client_id=${t.client_id}&target_group_id=${e.targetGroupId}`}).then((({results:n})=>n?.[0]?n[0]:Promise.reject({message:"Resource not found."}))))).then((t=>(z.reactionSpaces[t.id]=t,t)))}function ar(e,t=!0){const n=z.reactionSpaces[e];return n&&t?Promise.resolve(n):Jh({reactionSpaceId:e})}function Yh(e,t){switch(e){case Mn.ADD_NEW_MEMBER:case Mn.INVITE_NEW_MEMBER:return Promise.resolve(Ce.subscribe_channel);case Mn.PIN_MESSAGE:case Mn.UNPIN_MESSAGE:return p0(t);case Mn.CHATROOM_UPDATED:return jl(t)}}function ep(e){return Y(e,[],"getCommentBoardDetails",(()=>{if(!e?.customId&&!e?.commentBoardId)return'Argument object is missing "commentBoardId" or "customId" property.'})).then((()=>pe())).then((t=>e.customId?F.get({url:`${t.comment_boards_url}?client_id=${t.client_id}&custom_id=${e.customId}`}).then((n=>n&&n.results&&n.results.length&&n.results[0]?n.results[0]:Promise.reject("Resource not found"))):F.get({url:Pe(e.commentBoardId,t.comment_board_detail_url_template)}))).then((t=>(z.commentBoards[t.id]=t,t)))}function Ei(e,t=!0){const n=z.commentBoards[e];return n&&t?Promise.resolve(n):ep({commentBoardId:e})}function ac({search:e,offset:t,rating:n}={}){return`${e?"https://api.giphy.com/v1/gifs/search":"https://api.giphy.com/v1/gifs/trending"}?${[e&&`q=${e}`,t&&`offset=${t}`,`rating=${n??"g"}`,"api_key=jlvX8uZILp5PhutmuW6fdATBP3E5uayi"].filter(Boolean).join("&")}`}const A0=e=>Ii(e.programId).then((t=>{var n,r;const o=t.subscribe_channel,c=[e.sincePlaybackTimeMs!==void 0&&`since_playback_time_ms=${e.sincePlaybackTimeMs}`,e.untilPlaybackTimeMs!==void 0&&`until_playback_time_ms=${e.untilPlaybackTimeMs}`,...(r=(n=e.widgetAttributes)===null||n===void 0?void 0:n.map((l=>`widget_attribute=${l.key+$s+l.value}`)))!==null&&r!==void 0?r:[]].filter(Boolean);return ke(`${t.timeline_url}${c.length?"&"+c.join("&"):""}`,(l=>{const u=[];let m="";return F({url:l,returnRawResponse:!0}).then((v=>{const R=v.headers&&Number(v.headers.get("age"));if(R&&R>0){const k=new Date().getTime()-1e3*R+"0111";((M,D={count:25,end:void 0,start:void 0})=>new Promise(((ne,oe)=>{ze?.fetchMessages({channels:[M],count:D.count,stringifiedTimeToken:!0,start:D.start,end:D.end,includeMessageActions:!0},((me,ce)=>me.error?oe(me):ne(ce)))})))(o,{end:k}).then((M=>M.channels[o]&&M.channels[o].map((D=>{if(D.message&&D.message.payload){u.push(D.message.payload);let oe=(ne=D.message.payload,uh.some((me=>ne.kind===me))?{kind:ne.kind.replace("-follow-up",""),id:ne.kind===X.TEXT_PREDICTION_FOLLOW_UP||ne.kind===X.IMAGE_PREDICTION_FOLLOW_UP||ne.kind===X.TEXT_NUMBER_PREDICTION_FOLLOW_UP||ne.kind===X.IMAGE_NUMBER_PREDICTION_FOLLOW_UP?ne.text_prediction_id||ne.image_prediction_id||ne.text_number_prediction_id||ne.image_number_prediction_id:ne.id}:null);if(oe){const{kind:me,id:ce}=oe;m=m+"&"+me.replace(/-/g,"_")+"_id="+ce}}var ne}))))}return v.json()})).then((v=>(v.results=[...u,...v.results],v.widget_interactions_url_template.includes("?")&&m?v.widget_interactions_url_template=v.widget_interactions_url_template+m:m&&!v.widget_interactions_url_template.includes("?")&&(v.widget_interactions_url_template=v.widget_interactions_url_template+"?"+m),v)))}),(l=>{var u;return(u=l.results)===null||u===void 0||u.forEach((m=>{z.widgets[m.id]=Object.assign(Object.assign({},z.widgets[m.id]),m)})),{count:l.count,widgets:l.results,widget_interactions_url_template:l.widget_interactions_url_template}}))})),bt=e=>Y(e,["widgetId","widgetKind"],"getWidget").then((()=>{const{widgetId:t,widgetKind:n,cache:r=!0}=e;let o=z.widgets[t];return o&&r?(o=Object.assign({},o),delete o.interactions,Promise.resolve(o)):z.ready?pe().then((c=>{const l=tp(c,n);return F.get({url:l+t+"/"})})):Promise.reject('SDK not initialised, use "init" Api')})).then((t=>(z.widgets[t.id]=Object.assign(Object.assign({},z.widgets[t.id]),t),t))),js=new Map,lc=e=>Y(e,[],"getWidgetsInteractions",(()=>e.programId||e.interactionUrl?e.interactionUrl&&!e.interactionUrl.includes("?")?"No interaction found.":void 0:"Argument object is missing interactionUrl or programId + widgetIds/widgetKinds.")).then((()=>{let t="";return e.interactionUrl?(t=e.interactionUrl,F.get({url:Pe(Ce.id,e.interactionUrl)}).then((n=>n.interactions)).catch((n=>Promise.resolve({})))):Ii(e.programId).then((n=>{var r,o;t=Pe(Ce.id,n.widget_interactions_url_template);let c=[];!((r=e.widgets)===null||r===void 0)&&r.length&&(c=[...c,...e.widgets.map((u=>u.kind.replace(/-/g,"_")+"_id="+u.id))]),!((o=e.widgetKinds)===null||o===void 0)&&o.length&&(c=[...c,...e.widgetKinds.map((u=>`widget_kind=${u}`))]);const l=`${t}?${c.join("&")}`;return F.get({url:l}).then((u=>u.interactions)).catch((u=>Promise.resolve({})))}))})).then((t=>(Object.values(t).forEach((n=>{uc(n)})),t))),cc=e=>Y(e,[],"getWidgetInteractions",(()=>{if(!e.widgetId||!e.widgetKind||!e.programId&&!e.interactionUrl)return"Argument object is missing widgetId, widgetKind and programId/interactionUrl"})).then((()=>dc({widgetId:e.widgetId,widgetKind:e.widgetKind}))).then((({widgetId:t,widgetKind:n})=>{var r,o;const{programId:c,cache:l=!0}=e;return!((o=(r=z.widgets[t])===null||r===void 0?void 0:r.interactions)===null||o===void 0)&&o.length&&l?Promise.resolve(z.widgets[t].interactions):(e.interactionUrl?lc({interactionUrl:e.interactionUrl}):lc({programId:c,widgets:[{id:t,kind:n}]})).then((u=>{var m,v;return(v=(m=u[n])===null||m===void 0?void 0:m.filter((R=>R.widget_id===t)))!==null&&v!==void 0?v:[]}))}));function dc(e){return Y(e,[],"getPredictionWidgetIdAndKind",(()=>{if(!(e.widget||e.widgetId&&e.widgetKind))return'Argument object missing "widget" or "widgetId" + "widgetKind" property'})).then((()=>{var t,n;const r=(t=e.widgetKind)!==null&&t!==void 0?t:e.widget.kind;return Ps.includes(r)?(e.widget?Promise.resolve(e.widget):bt({widgetId:e.widgetId,widgetKind:e.widgetKind})).then((o=>({widgetId:o[Os[r]],widgetKind:ph[r]}))):{widgetId:(n=e.widgetId)!==null&&n!==void 0?n:e.widget.id,widgetKind:r}}))}function uc(e){e.forEach((t=>{const n=z.widgets[t.widget_id];z.widgets[t.widget_id]=n?Object.assign(Object.assign({},z.widgets[t.widget_id]),{interactions:Nh(t,n.interactions)}):Object.assign(Object.assign({},z.widgets[t.widget_id]),{interactions:[t]})}))}const M0={[X.TEXT_POLL]:"text_polls_url",[X.IMAGE_POLL]:"image_polls_url",[X.TEXT_PREDICTION]:"text_predictions_url",[X.TEXT_PREDICTION_FOLLOW_UP]:"text_prediction_followUps_url",[X.IMAGE_PREDICTION]:"image_predictions_url",[X.IMAGE_PREDICTION_FOLLOW_UP]:"image_prediction_followUps_url",[X.IMAGE_NUMBER_PREDICTION]:"image_number_predictions_url",[X.IMAGE_NUMBER_PREDICTION_FOLLOW_UP]:"image_number_prediction_followUps_url",[X.CHEER_METER]:"cheer_meters_url",[X.EMOJI_SLIDER]:"emoji_sliders_url",[X.TEXT_QUIZ]:"text_quizzes_url",[X.IMAGE_QUIZ]:"image_quizzes_url",[X.TEXT_ASK]:"text_asks_url",[X.ALERT]:"alerts_url",[X.RICH_POST]:"rich_posts_url",[X.SOCIAL_EMBED]:"social_embeds_url"};function tp(e,t){const n=e[M0[t]];if(!n)throw new Error(`Url not found for widgetKind=${t}`);return n}const Bs=new Map,hc=e=>Y(e,["leaderboardId"],"getLeaderboard").then((()=>Ls.leaderboard(e.leaderboardId))),np=e=>ke(e.badges_url,(t=>F.get({url:t})),(t=>({count:t.count,results:t.results})));function ip(e){return Y(e,["commentBoardId","commentId"],"getComment").then((()=>Ei(e.commentBoardId))).then((t=>F.get({url:Pe(e.commentId,t.comment_detail_url_template)}))).then((t=>(z.comments[t.id]=t,t)))}const L0={asc:"pinned_at",desc:"-pinned_at"},rp=e=>pe().then((t=>{let n=t.quests_url;return e&&e.questIds&&e.questIds.length>0&&e.questIds.forEach((r=>{r&&r.length>0&&(n+=`&id=${r}`)})),e?.status&&(n+=`&status=${e.status}`),Ee(["results"],ke(n,(r=>F.get({url:r})),(r=>({count:r.count,results:r.results}))))})).then((t=>(t.results.forEach((n=>{z.quests[n.id]=n})),t)));function Fs(){return!z.pn&&z.pnConfig&&he.initialisePubnub(z.pnConfig),Promise.resolve()}function pc(e){return Y(e,["channel"],"getPresenceChannelUsers").then(Fs).then((()=>g0({channel:e.channel}))).then((t=>{var n,r;const o=t.channels[e.channel];return{channelUsers:(r=(n=o?.occupants)===null||n===void 0?void 0:n.map((({uuid:c,state:l})=>({userProfileId:c,attributes:l}))))!==null&&r!==void 0?r:[]}}))}const zs=new Map,Hs={};var $0=Object.freeze({__proto__:null,get ApiStreamTopic(){return xs},get BlockchainNetworkType(){return Pl},get BlockchainTokenType(){return Ol},CHOICE_WIDGET_KIND:a0,get ChatMessageEvent(){return We},get ChatRoomAccessStatus(){return oo},get ChatRoomApiStreamCategory(){return As},get ChatRoomEvent(){return Mn},get ChatRoomInvitationStatus(){return Rl},ChatUserMessageEventType:t0,get CommentContentFilter(){return Al},get CommentReportStatus(){return Dl},get CommentSort(){return Ml},Events:vt,FOLLOW_UP_WIDGET_UPDATED_EVENT:d0,get HTTP_METHOD(){return fn},InteractableWidgetKind:r0,MULTI_INTERACTION_WIDGET_KINDS:s0,get MessageContentFilter(){return ro},MessageEvents:rr,OPTION_WIDGET_KIND:l0,PREDICTION_FOLLOW_UP_TO_PREDICTION_WIDGET_KIND:ph,PREDICTION_FOLLOW_UP_WIDGET_KIND:Ps,PREDICTION_WIDGET_ID_PROP:Os,PREDICTION_WIDGET_KIND:c0,get PresenceActionEvent(){return gn},get QuestRewardStatus(){return Ts},get QuestStatus(){return Tl},get ReactionSpaceEvent(){return kl},get RedemptionKeyStatus(){return so},get RewardActionType(){return Vl},get RewardEvent(){return Il},get RewardItemTransferType(){return $l},SINGLE_INTERACTION_WIDGET_KINDS:hh,get SdkEvent(){return Ln},UNSUPPORTED_UPDATE_INTERACTION_WIDGET_KINDS:o0,get UserProfileEvent(){return io},get UserQuestStatus(){return xl},get VideoRoomBannerType(){return ec},get VideoRoomConnectionState(){return Jl},get VideoRoomError(){return Yl},get VideoRoomEvent(){return Zl},WIDGET_RESULTS:Ci,get WidgetCreatedEvent(){return An},get WidgetKind(){return X},get WidgetPhase(){return no},WidgetResults:i0,get WidgetStatus(){return Ll},_$$:z,_config:Cl,addChatRoomEventListener:function(e,t,n){return Yh(e,n?.roomId).then((r=>{he.addListener(r,t,e),he.subscribe(r)}))},addComment:function(e){return Y(e,["commentBoardId"],"addComment").then((()=>Ei(e.commentBoardId))).then((t=>{const n=t.comments_url,{text:r,commentBoardId:o,customData:c,authorImageUrl:l}=e;return F.post({url:n,data:{text:r,custom_data:c,comment_board_id:o,author_image_url:l}})}))},addCommentReply:function(e){return Y(e,["commentBoardId","parentCommentId"]).then((()=>Ei(e.commentBoardId))).then((t=>{const n=t.comments_url,{text:r,commentBoardId:o,customData:c,parentCommentId:l,authorImageUrl:u}=e;return F.post({url:n,data:{text:r,custom_data:c,comment_board_id:o,parent_comment_id:l,author_image_url:u}})}))},addMessageListener:Wh,addNewMemberToChatRoom:function({roomId:e,profileId:t}){return oc({roomId:e},"post",{profile_id:t})},addPresenceListener:function(e,t){return Y(e,["channel"],"addPresenceListener").then((()=>(function(n){return pc({channel:n.channel}).then((r=>{const o=r.channelUsers,c=new Set;o.forEach((({userProfileId:l})=>c.add(l))),Hs[n.channel]=c}))})(e))).then((()=>{const n=({event:r,message:o})=>{let c=r;if(c!=="interval"||o.here_now_refresh)if(c==="interval"&&o.here_now_refresh)(function(l,u){const{channel:m}=l;pc({channel:m}).then((({channelUsers:v})=>{const R=Hs[m],k=new Set;for(const{userProfileId:M,attributes:D}of v)k.add(M),R.has(M)?R.delete(M):R.has(M)||u({event:gn.JOIN,message:{userProfileId:M,attributes:D,channel:m}});for(const M of R)u({event:gn.LEAVE,message:{userProfileId:M,attributes:void 0,channel:m}});Hs[m]=k}))})(o,t);else{c==="state-change"&&(c=gn.ATTRIBUTES_UPDATE);const{uuid:l,channel:u,state:m}=o;t({event:c,message:{userProfileId:l,channel:u,attributes:m}})}else(function(l,u){const{join:m,leave:v,timeout:R,channel:k}=l,M=Hs[k];if(m?.length)for(const D of m)M?.add(D),u({event:gn.JOIN,message:{userProfileId:D,channel:k,attributes:void 0}});if(v?.length)for(const D of v)M?.delete(D),u({event:gn.LEAVE,message:{userProfileId:D,channel:k,attributes:void 0}});if(R?.length)for(const D of R)u({event:gn.TIMEOUT,message:{userProfileId:D,channel:k,attributes:void 0}})})(o,t)};zs.set(t,n),he.addListener(e.channel,n),he.subscribe(e.channel,{withPresence:!0})}))},addProgramListener:(e,t)=>Y(e,["programId"],"addProgramListener").then((()=>Ii(e.programId))).then((n=>{const r=({event:o,message:c})=>{var l;Object.values(An).includes(o)&&(l=c,z.widgets[l.id]=Object.assign(Object.assign({},z.widgets[l.id]),l)),t({event:o,message:c})};Bs.set(t,r),he.addListener(n.subscribe_channel,r),he.subscribe(n.subscribe_channel)})),addReactionSpaceEventListener:function(e,t){return Th([e,t],[["event","reactionSpaceId"],"function"],"addReactionSpaceEventListener").then((()=>ar(e.reactionSpaceId))).then((({reaction_space_channel:n})=>{he.addListener(n,t,e.event),he.subscribe(n)}))},addRewardEventListener:function(e,t){he.addListener(Ce.subscribe_channel,t,e),he.subscribe(Ce.subscribe_channel)},addSdkEventListener:po,addUserProfileEventListener:Xl,addUserReaction:function(e){return Y(e,["targetId","reactionSpaceId","reactionId"],"addUserReaction").then((()=>ar(e.reactionSpaceId))).then((({user_reactions_url:t})=>{const{reactionSpaceId:n,targetId:r,reactionId:o}=e;return F.post({url:t,data:{reaction_space_id:n,target_id:r,reaction_id:o}})}))},addWidgetListener:(e,t)=>Y(e,["widgetId","widgetKind"],"addWidgetListener").then((()=>bt(e))).then((n=>{const r=({event:o,message:c})=>{e.widgetId===c.id&&t({event:o,message:c})};js.set(t,r),he.addListener(n.subscribe_channel,r),he.subscribe(n.subscribe_channel)})),blockProfile:zh,chatUserMessageEvents:dh,claimPredictionWidgetRewards:e=>Y(e,["widgetId","widgetKind"],"claimPredictionRewards").then((()=>Ps.includes(e.widgetKind)?bt({widgetId:e.widgetId,widgetKind:e.widgetKind}):Promise.reject(`Unsupported followUp widget Kind, widgetKind need to be of kind=${Ps.join(", ")}`))).then((t=>dc({widget:t}).then((({widgetId:n,widgetKind:r})=>Promise.all([Promise.resolve(t),Promise.resolve(n),cc({widgetId:n,widgetKind:r,programId:t.program_id})]))))).then((([t,n,r])=>t?r.length&&r[0].claim_token?F.post({url:t.claim_url,data:{claim_token:r[0].claim_token}}).then((o=>((function({widgetId:c,interactions:l}){z.widgets[c]=Object.assign(Object.assign({},z.widgets[c]),{interactions:[Object.assign(Object.assign({},l[0]),{claim_token:null})]})})({widgetId:n,interactions:r}),o))):Promise.reject(`Widget interaction or claim token not found for widgetId=${e.widgetId}`):Promise.reject(`Widget details not found for widgetId=${e.widgetId}`))),claimUserQuestRewards:e=>Y(e,["userQuestId"],"claimUserQuestRewards").then((()=>pe())).then((t=>F.patch({url:Pe(e.userQuestId,t.user_quest_detail_url_template),data:{rewards_status:Ts.CLAIMED}}))),createAlertWidget:function(e){return Y(e,["programId"],"createAlertWidget",(()=>{if(!e.imageUrl&&!e.text)return'Argument object is missing "imageUrl" or "text", either of one is required.'})).then((()=>pe())).then((t=>{const{programId:n,title:r,text:o,imageUrl:c,linkLabel:l,linkUrl:u,playbackTimeMs:m,timeout:v,programDateTime:R,widgetAttributes:k,customData:M,sponsorIds:D}=e;return F.post({url:t.alerts_url,data:{program_id:n,title:r,text:o,image_url:c,link_label:l,link_url:u,playback_time_ms:m,timeout:v,program_date_time:R,widget_attributes:k,custom_data:M,sponsor_ids:D}})})).then((t=>(z.widgets[t.id]=t,t)))},createChatRoom:e=>e&&e.visibility&&e.visibility!=="members"&&e.visibility!=="everyone"?Promise.reject("Invalid value for visibility"):F.post({url:z.createChatUrlTemplate,data:e}).then(sc),createCommentBoard:function(e){return pe().then((t=>{const n=t.comment_boards_url,{customId:r,title:o,allowComments:c,repliesDepth:l,description:u,customData:m,contentFilter:v}=e??{};return F.post({url:n,data:{title:o,custom_id:r,replies_depth:l,allow_comments:c,description:u,custom_data:m,content_filter:v}})}))},createCommentBoardBan:function(e){return Y(e,["profileId"],"createCommentBoardBan").then((()=>pe())).then((t=>{const n=t.comment_board_ban_url,{profileId:r,commentBoardId:o,description:c}=e;return F.post({url:n,data:{profile_id:r,comment_board_id:o,description:c}})}))},createCommentReport:function(e){return Y(e,["commentId"],"createCommentReport").then((()=>pe())).then((t=>{const n=t.comment_report_url,{commentId:r,description:o}=e;return F.post({url:n,data:{comment_id:r,description:o}})}))},createImageNumberPredictionWidget:function(e){return Y(e,["question","programId","options"],"createImageNumberPredictionWidget").then((()=>pe())).then((t=>{const{question:n,programId:r,options:o,interactiveUntil:c,playbackTimeMs:l,timeout:u,programDateTime:m,widgetAttributes:v,customData:R,confirmationMessage:k,sponsorIds:M}=e;return F.post({url:t.image_number_predictions_url,data:{question:n,options:o.map((D=>({description:D.description,image_url:D.imageUrl}))),program_id:r,interactive_until:c,playback_time_ms:l,timeout:u,program_date_time:m,widget_attributes:v,custom_data:R,confirmation_message:k,sponsor_ids:M}})})).then((t=>(z.widgets[t.id]=t,t)))},createImagePollWidget:function(e){return Y(e,["question","programId","options"],"createImagePollWidget").then((()=>pe())).then((t=>{const{question:n,programId:r,options:o,interactiveUntil:c,playbackTimeMs:l,timeout:u,programDateTime:m,widgetAttributes:v,customData:R,sponsorIds:k}=e;return F.post({url:t.image_polls_url,data:{question:n,options:o.map((M=>({description:M.description,image_url:M.imageUrl}))),program_id:r,interactive_until:c,playback_time_ms:l,timeout:u,program_date_time:m,widget_attributes:v,custom_data:R,sponsor_ids:k}})})).then((t=>(z.widgets[t.id]=t,t)))},createImagePredictionWidget:function(e){return Y(e,["question","programId","options"],"createImagePredictionWidget").then((()=>pe())).then((t=>{const{question:n,programId:r,options:o,interactiveUntil:c,playbackTimeMs:l,timeout:u,programDateTime:m,widgetAttributes:v,customData:R,confirmationMessage:k,sponsorIds:M}=e;return F.post({url:t.image_predictions_url,data:{question:n,options:o.map((D=>({description:D.description,image_url:D.imageUrl,reward_item_id:D.rewardItemId,reward_item_amount:D.rewardItemAmount}))),program_id:r,interactive_until:c,playback_time_ms:l,timeout:u,program_date_time:m,widget_attributes:v,custom_data:R,confirmation_message:k,sponsor_ids:M}})})).then((t=>(z.widgets[t.id]=t,t)))},createImageQuizWidget:function(e){return Y(e,["question","programId","choices"],"createImageQuizWidget").then((()=>pe())).then((t=>{const{question:n,programId:r,choices:o,interactiveUntil:c,playbackTimeMs:l,timeout:u,programDateTime:m,widgetAttributes:v,customData:R,sponsorIds:k}=e;return F.post({url:t.image_quizzes_url,data:{question:n,choices:o.map((M=>({description:M.description,image_url:M.imageUrl,is_correct:M.isCorrect}))),program_id:r,interactive_until:c,playback_time_ms:l,timeout:u,program_date_time:m,widget_attributes:v,custom_data:R,sponsor_ids:k}})})).then((t=>(z.widgets[t.id]=t,t)))},createNumberPredictionFollowUpWidget:function(e){return Y(e,["widgetId","widgetKind"],"createNumberPredictionFollowUpWidget",(()=>{if(e.widgetKind!==X.IMAGE_NUMBER_PREDICTION)return`Invalid widget kind, it should be "${X.IMAGE_NUMBER_PREDICTION}".`})).then((()=>bt({widgetId:e.widgetId,widgetKind:e.widgetKind}))).then((t=>{const{follow_up_url:n}=t;return n?F.post({url:n,data:{image_number_prediction_id:e.widgetId,sponsor_ids:e.sponsorIds}}):Promise.reject("Invalid widget type, follow_up_url not found")})).then((t=>{const n=t[Os[t.kind]],r=z.widgets[n];return r&&(z.widgets[r.id]=Object.assign(Object.assign({},r),{follow_ups:[t,...r.follow_ups]})),t}))},createPersonalApiAuth:function(e){return`Token ${e}`},createPredictionFollowUpWidget:function(e){return Y(e,["widgetId","widgetKind","correctOptionId"],"createPredictionFollowUpWidget",(()=>{if(e.widgetKind!==X.TEXT_PREDICTION&&e.widgetKind!==X.IMAGE_PREDICTION)return`Invalid widget kind, it should be "${X.TEXT_PREDICTION}" or "${X.IMAGE_PREDICTION}".`})).then((()=>bt({widgetId:e.widgetId,widgetKind:e.widgetKind}))).then((t=>{const{follow_up_url:n}=t;if(!n)return Promise.reject("Invalid widget type, follow_up_url not found");const r=e.widgetKind===X.TEXT_PREDICTION?"text_prediction_id":"image_prediction_id";return F.post({url:n,data:{[r]:e.widgetId,correct_option_id:e.correctOptionId,sponsor_ids:e.sponsorIds}})})).then((t=>{const n=t[Os[t.kind]],r=z.widgets[n];return r&&(z.widgets[r.id]=Object.assign(Object.assign({},r),{follow_ups:[t,...r.follow_ups]})),t}))},createProfileRelationship:function(e){return Y(e,["fromProfileId","toProfileId","relationshipTypeKey"],"createProfileRelationship").then((()=>pe())).then((t=>{const n=t.profile_relationships_url,{fromProfileId:r,toProfileId:o,relationshipTypeKey:c}=e;return F.post({url:n,data:{client_id:t.client_id,relationship_type_key:c,from_profile_id:r,to_profile_id:o}})}))},createReactionSpace:function(e){return Y(e,["targetGroupId","reactionPackIds"],"createReactionSpace").then((()=>pe())).then((t=>{const n=t.reaction_spaces_url,{name:r,reactionPackIds:o,targetGroupId:c}=e;return F.post({url:n,data:{name:r,target_group_id:c,reaction_pack_ids:o}})}))},createTextAskWidget:function(e){return Y(e,["programId","title","prompt"],"createTextAskWidget").then((()=>pe())).then((t=>{const{programId:n,title:r,prompt:o,confirmationMessage:c,interactiveUntil:l,playbackTimeMs:u,timeout:m,programDateTime:v,widgetAttributes:R,customData:k,sponsorIds:M}=e;return F.post({url:t.text_asks_url,data:{program_id:n,title:r,prompt:o,confirmation_message:c,interactive_until:l,playback_time_ms:u,timeout:m,program_date_time:v,widget_attributes:R,custom_data:k,sponsor_ids:M}})})).then((t=>(z.widgets[t.id]=t,t)))},createTextPollWidget:function(e){return Y(e,["question","programId","options"],"createTextPollWidget").then((()=>pe())).then((t=>{const{question:n,programId:r,options:o,interactiveUntil:c,playbackTimeMs:l,timeout:u,programDateTime:m,widgetAttributes:v,customData:R,sponsorIds:k}=e;return F.post({url:t.text_polls_url,data:{question:n,options:o,program_id:r,interactive_until:c,playback_time_ms:l,timeout:u,program_date_time:m,widget_attributes:v,custom_data:R,sponsor_ids:k}})})).then((t=>(z.widgets[t.id]=t,t)))},createTextPredictionWidget:function(e){return Y(e,["question","programId","options"],"createTextPredictionWidget").then((()=>pe())).then((t=>{const{question:n,programId:r,options:o,interactiveUntil:c,playbackTimeMs:l,timeout:u,programDateTime:m,widgetAttributes:v,customData:R,confirmationMessage:k,sponsorIds:M}=e;return F.post({url:t.text_predictions_url,data:{question:n,options:o,program_id:r,interactive_until:c,playback_time_ms:l,timeout:u,program_date_time:m,widget_attributes:v,custom_data:R,confirmation_message:k,sponsor_ids:M}})})).then((t=>(z.widgets[t.id]=t,t)))},createTextQuizWidget:function(e){return Y(e,["question","programId","choices"],"createTextQuizWidget").then((()=>pe())).then((t=>{const{question:n,programId:r,choices:o,interactiveUntil:c,playbackTimeMs:l,timeout:u,programDateTime:m,widgetAttributes:v,customData:R,sponsorIds:k}=e;return F.post({url:t.text_quizzes_url,data:{question:n,choices:o.map((({description:M,isCorrect:D})=>({description:M,is_correct:D}))),program_id:r,interactive_until:c,playback_time_ms:l,timeout:u,program_date_time:m,widget_attributes:v,custom_data:R,sponsor_ids:k}})})).then((t=>(z.widgets[t.id]=t,t)))},createUserProfile:jh,createUserProfileAuth:ch,createWidgetImpression:e=>Y(e,["widgetId","widgetKind"],"createWidgetImpression").then((()=>bt(e))).then((t=>F.post({url:t.impression_url}))),createWidgetInteraction:e=>Y(e,["widgetId","widgetKind","interactionItem"],"createWidgetInteraction").then((()=>bt({widgetId:e.widgetId,widgetKind:e.widgetKind}))).then((t=>{const{interactionItem:n}=e;if(!t)return Promise.reject(`Widget payload not found for widgetId=${e.widgetId}`);const{kind:r}=t;return r===X.TEXT_ASK&&_h(n)?F.post({url:t.reply_url,data:{text:n.text}}):r===X.EMOJI_SLIDER&&wh(n)?F.post({url:t.vote_url,data:{magnitude:n.magnitude}}):r!==X.IMAGE_NUMBER_PREDICTION&&r!==X.TEXT_NUMBER_PREDICTION||!Ch(n)?r!==X.TEXT_QUIZ&&r!==X.IMAGE_QUIZ||!bh(n)?r===X.CHEER_METER&&Ms(n)?F.post({url:n.vote_url,data:{vote_count:n.vote_count}}):Ms(n)?F.post({url:n.vote_url}):Promise.reject('Invalid "interacionItem" argument property'):F.post({url:n.answer_url}):F.post({url:t.vote_url,data:{votes:n.options.map((o=>({option_id:o.optionId,number:o.number})))}})})).then((t=>(uc([t]),t))),deleteChatRoomInvitation:function(e){return Y(e,["invitationId"],"deleteChatRoomInvite").then((()=>F.delete({url:Dh(e.invitationId)})))},deleteComment:function(e){return Y(e,["commentBoardId","commentId"],"deleteComment").then((()=>Ei(e.commentBoardId))).then((t=>F.delete({url:Pe(e.commentId,t.comment_detail_url_template)})))},deleteCommentBoard:function(e){return Y(e,["commentBoardId"],"deleteCommentBoard").then((()=>pe())).then((t=>F.delete({url:Pe(e.commentBoardId,t.comment_board_detail_url_template)})))},deleteCommentBoardBan:function(e){return Y(e,["commentBoardBanId"],"deleteCommentBoardBan").then((()=>pe())).then((t=>F.delete({url:Pe(e.commentBoardBanId,t.comment_board_ban_detail_url_template)})))},deleteCommentReport:function(e){return Y(e,["commentReportId"],"deleteCommentReport").then((()=>pe())).then((t=>F.delete({url:Pe(e.commentReportId,t.comment_report_detail_url_template)})))},deleteMessage:rc,deleteProfileRelationship:function(e){return Y(e,["relationshipId"],"deleteProfileRelationship").then((()=>pe())).then((t=>F.delete({url:Pe(e.relationshipId,t.profile_relationship_detail_url_template)})))},deleteReactionSpace:function(e){return Y(e,["reactionSpaceId"],"deleteReactionSpace").then((()=>pe())).then((t=>F.delete({url:Pe(e.reactionSpaceId,t.reaction_space_detail_url_template)})))},deleteWidget:function(e){return Y(e,["widgetId","widgetKind"],"deleteWidget").then((()=>pe())).then((t=>{const n=tp(t,e.widgetKind);return F.delete({url:`${n}${e.widgetId}/`})}))},dismissAllCommentReports:function(e){return Y(e,["commentBoardId","commentId"],"dismissCommentReport").then((()=>Ei(e.commentBoardId))).then((t=>F.patch({url:Pe(e.commentId,t.dismiss_reported_comment_url_template),data:{report_status:"dismissed"}})))},dismissCommentReport:function(e){return Y(e,["commentReportId"],"dismissCommentReport").then((()=>pe())).then((t=>F.patch({url:Pe(e.commentReportId,t.comment_report_detail_url_template),data:{report_status:"dismissed"}})))},editComment:function(e){return Y(e,["commentBoardId","commentId"],"editComment").then((()=>Ei(e.commentBoardId))).then((t=>{const n=Pe(e.commentId,t.comment_detail_url_template),{text:r,commentBoardId:o,customData:c}=e;return F.patch({url:n,data:{text:r,custom_data:c,comment_board_id:o}})}))},getAnalyticsProvider:()=>z.analyticsProvider,getApiPollingInterval:$h,getApplicationBadges:()=>pe().then((e=>Ee(["results"],np(e)))),getApplicationRewardItems:e=>pe().then((t=>{let n=t.reward_items_url;return e&&e.attributes&&e.attributes.length&&e.attributes.forEach((r=>{n+=`&attributes=${r.key}${$s}${r.value}`})),Ee(["results"],ke(n,(r=>F.get({url:r})),(r=>({count:r.count,results:r.results}))))})),getApplicationSponsors:()=>pe().then((e=>{const t=e.sponsors_url;return Ee(["results"],ke(t,(n=>F.get({url:n})),(n=>({count:n.count,results:n.results}))))})),getBadgeProfiles:function(e){return Y(e,["badgeId"],"getBadgeProfiles").then((()=>pe())).then((t=>Ee(["results"],ke(`${t.badge_profiles_url}?badge_id=${e.badgeId}`,(n=>F.get({url:n})),(n=>({count:n.count,results:n.results}))))))},getBadgeProgress:e=>Y(e,[],"getBadgeProgress",(()=>e?.profileId?e?.badgeIds&&e?.badgeIds.length?void 0:'Missing "badgeIds" array in argument object':'Missing "profileId" in argument object')).then((()=>ho({profileId:e.profileId}))).then((t=>F.get({url:`${t.badge_progress_url}?${e.badgeIds.map((n=>"badge_id="+n)).join("&")}`}))),getBlockInfoList:function(){return Ee(["results"],ke(Ce.block_profile_url,(e=>F.get({url:e})),(e=>({count:e.count,results:e.results}))))},getBlockProfileIdsResource:nc,getBlockedProfileIds:tc,getChatRoom:Zh,getChatRoomMemberships:e=>Y(e,["roomId"],"getChatRoomMemberships").then((()=>Rt(e.roomId))).then((t=>{const n=[...Array.isArray(e.profileIds)&&e.profileIds.length?e.profileIds.map((o=>`profile_id=${o}`)):[]].filter(Boolean).join("&"),r=`${t.memberships_url}${n?"?"+n:""}`;return Ee(["results"],ke(r,(o=>F.get({url:o})),(o=>({count:o.count,results:o.results}))))})),getChatRoomSponsors:e=>Y(e,["roomId"],"getChatRoomSponsors").then((()=>Rt(e.roomId))).then((t=>{const n=t.sponsors_url;return Ee(["results"],ke(n,(r=>F.get({url:r})),(r=>({count:r.count,results:r.results}))))})),getChatRooms:()=>pe().then((e=>Ee(["results"],ke(e.chat_rooms_url,(t=>F.get({url:t})),(t=>({count:t.count,results:t.results})))))),getChatUserMutedStatus:e=>Us(e).then((t=>Sl(Pe(Ce.id,t.muted_status_url_template)).then((n=>n.json())))),getComment:ip,getCommentBoardBan:function(e){return Y(e,["commentBoardBanId"],"getCommentBoardBan").then((()=>pe())).then((t=>F.get({url:Pe(e.commentBoardBanId,t.comment_board_ban_detail_url_template)})))},getCommentBoardBans:function(e){return pe().then((t=>{const n=t.comment_board_ban_url,r=[];e?.profileId&&r.push(`profile_id=${e.profileId}`),e?.commentBoardId&&r.push(`comment_board_id=${e.commentBoardId}`);const o=r.length?"?"+r.join("&"):"";return Ee(["results"],ke(`${n}${o}`,(c=>F.get({url:c})),(c=>({count:c.count,results:c.results}))))}))},getCommentBoardDetails:ep,getCommentBoards:function(){return pe().then((e=>Ee(["results"],ke(`${e.comment_boards_url}?client_id=${e.client_id}`,(t=>F.get({url:t})),(t=>({count:t.count,results:t.results}))))))},getCommentReplies:function(e){return Y(e,["commentBoardId","commentId"],"getCommentReplies").then((()=>(function(t,n,r=!0){const o=z.comments[n];return o&&r?Promise.resolve(o):ip({commentBoardId:t,commentId:n})})(e.commentBoardId,e.commentId))).then((t=>{let n=t.replies_url;return e.sorting&&(n+=`&ordering=${e.sorting}`),e.excludeDeletedCommentWithNoReplies&&(n+=`&without_deleted_thread=${e.excludeDeletedCommentWithNoReplies}`),e.since&&(n+=`&since=${e.since}`),e.until&&(n+=`&until=${e.until}`),Ee(["results"],ke(n,(r=>F.get({url:r})),(r=>({count:r.count,results:r.results}))))})).then((t=>(t.results.forEach((n=>{z.comments[n.id]=n})),t)))},getCommentReport:function(e){return Y(e,["commentReportId"],"getCommentReport").then((()=>pe())).then((t=>F.get({url:Pe(e.commentReportId,t.comment_report_detail_url_template)})))},getCommentReports:function(e){return pe().then((t=>{let n=t.comment_report_url+`?client_id=${t.client_id}`;return e?.commentBoardId&&(n+=`&comment_board_id=${e.commentBoardId}`),e?.commentId&&(n+=`&comment_id=${e.commentId}`),e?.reportStatus&&(n+=`&report_status=${e.reportStatus}`),Ee(["results"],ke(n,(r=>F.get({url:r})),(r=>({count:r.count,results:r.results}))))}))},getComments:function(e){return Y(e,["commentBoardId"],"getComments").then((()=>Ei(e.commentBoardId))).then((t=>{let n=`${t.comments_url}`;return e.topLevel&&(n+=`&top_level=${e.topLevel}`),e.excludeDeletedCommentWithNoReplies&&(n+=`&without_deleted_thread=${e.excludeDeletedCommentWithNoReplies}`),e.sorting&&(n+=`&ordering=${e.sorting}`),e.repliedSince&&(n+=`&replied_since=${e.repliedSince}`),e.repliedUntil&&(n+=`&replied_until=${e.repliedUntil}`),e.since&&(n+=`&since=${e.since}`),e.until&&(n+=`&until=${e.until}`),e.isReported!==void 0&&(n+=`&is_reported=${e.isReported}`),Ee(["results"],ke(n,(r=>F.get({url:r})),(r=>({count:r.count,results:r.results}))))})).then((t=>(t.results.forEach((n=>{z.comments[n.id]=n})),t)))},getGifs:function(e){return Ee(["results"],ke(ac(e),(t=>F.get({url:t}).then((n=>({next:n.pagination.offset>=n.pagination.total_count?null:ac(Object.assign(Object.assign({},e),{offset:n.pagination.offset+n.pagination.count})),count:n.pagination.count,previous:ac(Object.assign(Object.assign({},e),{offset:Math.max(0,n.pagination.offset-n.pagination.count)})),results:n.data})))),(t=>({count:t.count,results:t.results}))))},getInvokedRewardActions:function(e){return pe().then((t=>{var n,r,o;let c=[];c.push(`client_id=${t.client_id}`),e?.programId&&c.push(`program_id=${e.programId}`),!((n=e?.rewardActionKeys)===null||n===void 0)&&n.length&&e.rewardActionKeys.forEach((m=>c.push(`reward_action_key=${m}`))),!((r=e?.profileIds)===null||r===void 0)&&r.length&&e.profileIds.forEach((m=>c.push(`profile_id=${m}`))),!((o=e?.attributes)===null||o===void 0)&&o.length&&e.attributes.forEach((m=>{c.push(`attributes=${encodeURIComponent(m.key)}${$s}${encodeURIComponent(m.value)}`)}));const l=c.length?"?"+c.join("&"):"",u=`${t.invoked_actions_url}${l}`;return Ee(["results"],ke(u,(m=>F.get({url:m})),(m=>({count:m.count,results:m.results}))))}))},getLanguage:Nl,getLeaderboard:hc,getLeaderboardEntries:e=>Y(e,["leaderboardId"],"getLeaderboardEntries").then((()=>hc(e))).then((t=>{let n=t.entries_url;return e.profileIds&&e.profileIds.length&&(n+="?",e.profileIds.forEach((r=>{r&&(n+=`profile_id=${r}&`)}))),e.pageSize&&(n+=`?page_size=${e.pageSize}`),Ee(["results"],ke(n,(r=>F.get({url:r})),(r=>({count:r.count,results:r.results}))))})),getLeaderboardProfileRank:e=>Y(e,["leaderboardId","profileId"],"getLeaderboardProfileRank").then((()=>hc({leaderboardId:e.leaderboardId}))).then((t=>Ls.leaderboardEntryDetail(t.entry_detail_url_template,e.profileId))),getLeaderboards:e=>Y(e,["programId"],"getLeaderboards").then((()=>Ls.program(e.programId).then((t=>t.leaderboards)))),getMessageCount:(e,t)=>{if(!z.ready)return Rh();if(!e)return uo("roomId","messagecount");if(t||(t={}),t.since){if(!co(t.since))return Promise.reject(Oh("messageCount","since","Date"));t.since=new Date(t.since).toISOString()}if(t.until){if(!co(t.until))return Promise.reject(Oh("messageCount","until","Date"));t.until=new Date(t.until).toISOString()}return Rt(e).then((n=>{const r=Gh(n.chatroom_messages_count_url,{end:t.since,start:t.until});return F.get({url:r})})).then((({count:n})=>({roomId:e,count:n})))},getMessageList:ic,getMilliseconds:e=>{const t=e.match(/(-)?P(?:([.,\d]+)Y)?(?:([.,\d]+)M)?(?:([.,\d]+)W)?(?:([.,\d]+)D)?(?:T(?:([.,\d]+)H)?(?:([.,\d]+)M)?(?:([.,\d]+)S)?)?/);return(t[8]&&1e3*t[8])+(t[7]&&6e4*t[7])+(t[6]&&36e5*t[6])+(t[5]&&864e5*t[5])},getPinMessageInfoList:function(e){return Y(e,["roomId"],"getPinMessageInfoList").then((()=>pe())).then((t=>{const n=e.orderBy?`&ordering=${L0[e.orderBy]}`:"",r=`${t.pinned_messages_url}?chat_room_id=${e.roomId}${n}`;return Ee(["results"],ke(r,(o=>F.get({url:o})),(o=>({count:o.count,results:o.results}))))}))},getPostedWidgets:e=>Y(e,["programId"],"getPostedWidgets").then((()=>A0(e))).then((t=>Ee(["widgets","widget_interactions_url_template"],t))),getPresenceChannelUsers:pc,getPresenceUserAttributes:function(e){return Y(e,["userProfileId","channel"],"getPresenceUserAttributes").then(Fs).then((()=>(({uuid:t,channels:n})=>new Promise(((r,o)=>{ze?.getState({uuid:t,channels:n},((c,l)=>c.error?o(c):r(l)))})))({uuid:e.userProfileId,channels:[e.channel]}))).then((t=>t.channels[e.channel]))},getPresenceUserChannels:function(e){return Y(e,["userProfileId"],"getPresenceUserChannels").then(Fs).then((()=>(t=>new Promise(((n,r)=>{ze?.whereNow(t,((o,c)=>o.error?r(o):n(c)))})))({uuid:e.userProfileId})))},getProfileBadges:e=>Y(e,["profileId"],"getProfileBadges").then((()=>ho({profileId:e.profileId}))).then((t=>Ee(["results"],np(t)))),getProfileBlockInfo:Hh,getProfileChatRoomMemberships:e=>{var t;return!((t=e?.profileIds)===null||t===void 0)&&t.length?pe().then((n=>{const r=[...e.profileIds.map((c=>`profile_id=${c}`))].join("&"),o=`${n.chat_room_memberships_url}${r?"&"+r:""}`;return Ee(["results"],ke(o,(c=>F.get({url:c})),(c=>({count:c.count,results:c.results}))))})):Ee(["results"],ke(Ce.chat_room_memberships_url,(n=>F.get({url:n})),(n=>({count:n.count,results:n.results}))))},getProfileLeaderboardViews:e=>pe().then((t=>{var n;return Ee(["results"],ke(Pe((n=e?.profileId)!==null&&n!==void 0?n:Ce.id,t.profile_leaderboard_views_url_template),(r=>F.get({url:r})),(r=>({count:r.count,results:r.results}))))})),getProfileLeaderboards:e=>pe().then((t=>{var n;return Ee(["results"],ke(Pe((n=e?.profileId)!==null&&n!==void 0?n:Ce.id,t.profile_leaderboards_url_template),(r=>F.get({url:r})),(r=>({count:r.count,results:r.results}))))})),getProfileRelationshipDetails:e=>Y(e,["relationshipId"],"getProfileRelationshipDetails").then((()=>pe())).then((t=>F.get({url:Pe(e.relationshipId,t.profile_relationship_detail_url_template)}))),getProfileRelationshipTypes:function(){return pe().then((e=>Ee(["results"],ke(`${e.profile_relationship_types_url}`,(t=>F.get({url:t})),(t=>({count:t.count,results:t.results}))))))},getProfileRelationships:function(e){return pe().then((t=>{let n=[];e?.relationshipTypeKey&&n.push(`relationship_type_key=${e.relationshipTypeKey}`),e?.fromProfileId&&n.push(`from_profile_id=${e.fromProfileId}`),e?.toProfileId&&n.push(`to_profile_id=${e.toProfileId}`);const r=n.length?"&"+n.join("&"):"",o=`${t.profile_relationships_url}${r}`;return Ee(["results"],ke(o,(c=>F.get({url:c})),(c=>({count:c.count,results:c.results}))))}))},getProgramDateTime:zl,getProgramSponsors:e=>Y(e,["programId"],"getProgramSponsors").then((()=>Ii(e.programId))).then((t=>{const n=t.sponsors_url;return Ee(["results"],ke(n,(r=>F.get({url:r})),(r=>({count:r.count,results:r.results}))))})),getQuestRewards:e=>Y(e,["questId"],"getQuestRewards").then((()=>(function(t,n=!0){const r=z.quests[t];return r&&n?Promise.resolve(r):rp({questIds:[t]}).then((o=>{var c;return((c=o?.results)===null||c===void 0?void 0:c[0])||Promise.reject(`Quest Detail not found for questId=${t}`)}))})(e.questId))).then((t=>{const n=`${t.quest_rewards_url}?quest_id=${e.questId}`;return Ee(["results"],ke(n,(r=>F.get({url:r})),(r=>({count:r.count,results:r.results}))))})),getQuests:rp,getReactionPackDetail:function(e){return Y(e,["reactionPackId"],"getReactionPackDetail").then((()=>pe())).then((t=>F.get({url:Pe(e.reactionPackId,t.reaction_pack_detail_url_template)})))},getReactionPacks:function(){return pe().then((e=>Ee(["results"],ke(e.reaction_packs_url,(t=>F.get({url:t})),(t=>({count:t.count,results:t.results}))))))},getReactionSpaceDetail:Jh,getReactionSpaces:function(){return pe().then((e=>Ee(["results"],ke(`${e.reaction_spaces_url}?client_id=${e.client_id}`,(t=>F.get({url:t})),(t=>({count:t.count,results:t.results}))))))},getReceivedChatRoomInvitations:function(e){return Y(e,["invitationStatus"],"getReceivedChatRoomInvitations").then((()=>{const t=`${Kl()}&invited_profile_id=${Ce.id}&status=${e.invitationStatus}`;return Ee(["results"],ke(t,(n=>F.get({url:n})),(n=>({count:n.count,results:n.results}))))}))},getRedemptionKeys:e=>pe().then((t=>{let n=t.redemption_keys_url;return e?.status&&(n+="&status="+e.status),e?.isAssigned&&(n+=`&is_assigned=${e.isAssigned}`),Ee(["results"],ke(n,(r=>F.get({url:r})),(r=>({count:r.count,results:r.results}))))})),getRewardActions:function(){return pe().then((e=>Ee(["results"],ke(`${e.reward_actions_url}?client_id=${e.client_id}`,(t=>F.get({url:t})),(t=>({count:t.count,results:t.results}))))))},getRewardItemBalances:e=>Y(e,[],"getRewardItemBalances",(()=>{var t;if(!e?.rewardItemIds||!(!((t=e.rewardItemIds)===null||t===void 0)&&t.length))return'Argument object missing "rewardItemIds" property as non empty array'})).then((()=>F.get({url:Ce.reward_item_balances_url+"?reward_item_id="+e.rewardItemIds.join("&reward_item_id=")}))),getRewardItemTransfers:e=>{let t=Ce.reward_item_transfer_url;return e&&e.transferType&&(t+="?transfer_type="+e.transferType),Ee(["results"],ke(t,(n=>F.get({url:n})),(n=>({count:n.count,results:n.results}))))},getRewardTransactions:e=>pe().then((t=>{var n,r,o,c,l;let u=t.reward_transactions_url+"?",m=[];return(n=e?.widgetIds)===null||n===void 0||n.forEach((v=>{m.push("widget_id="+v)})),(r=e?.widgetKinds)===null||r===void 0||r.forEach((v=>{m.push("widget_kind="+v)})),(o=e?.profileIds)===null||o===void 0||o.forEach((v=>{m.push("profile_id="+v)})),(c=e?.rewardItemIds)===null||c===void 0||c.forEach((v=>{m.push("reward_item_id="+v)})),(l=e?.rewardActionKeys)===null||l===void 0||l.forEach((v=>{m.push("reward_action_key="+v)})),e&&e.createdSince&&m.push("created_since="+new Date(e.createdSince).toISOString()),e&&e.createdUntil&&m.push("created_until="+new Date(e.createdUntil).toISOString()),u+=m.join("&"),Ee(["results"],ke(u,(v=>F.get({url:v})),(v=>({count:v.count,results:v.results}))))})),getSentChatRoomInvitations:function(e){return Y(e,["invitationStatus"],"getSentChatRoomInvitations").then((()=>{const t=`${Kl()}&invited_by_id=${Ce.id}&status=${e.invitationStatus}`;return Ee(["results"],ke(t,(n=>F.get({url:n})),(n=>({count:n.count,results:n.results}))))}))},getSmartContracts:()=>pe().then((e=>Ee(["results"],ke(e.saved_contract_addresses_url,(t=>F.get({url:t})),(t=>({count:t.count,results:t.results})))))),getStickerPackDetail:function(e){return Y(e,["stickerPackId"],"getStickerPackDetail").then((()=>pe())).then((t=>F.get({url:Pe(e.stickerPackId,t.sticker_pack_detail_url_template)})))},getStickerPacks:function(){return pe().then((e=>Ee(["results"],ke(e.sticker_packs_url,(t=>F.get({url:t})),(t=>({count:t.count,results:t.results}))))))},getTargetedWidgetIdAndKind:dc,getTokenGatedChatRoomAccessDetails:({walletAddress:e,roomId:t})=>Y({walletAddress:e,roomId:t},["walletAddress","roomId"],"getTokenGatedChatRoomAccessDetails").then((()=>T0(void 0,void 0,void 0,(function*(){return yield Zh({roomId:t})})))).then((({token_gates:n=[],chatroom_token_gate_access_url_template:r=""})=>{const o={chat_room_id:t,access:oo.DISALLOWED,details:"Chat room is not token gated.",wallet_details:{wallet_address:e,contract_balances:null}};return n.length===0?Xh(Object.assign(Object.assign({},o),{access:oo.ALLOWED,details:"Chat room is not token gated."})):r?F.get({url:Pe(e,r)}):Xh(Object.assign(Object.assign({},o),{details:"Token gating access url not found."}))})),getUnclaimedWidgetInteractionsRewards:e=>Y(e,["programId"],"getUnclaimedWidgetInteractionsRewards").then((()=>Ii(e.programId))).then((t=>Ee(["results"],ke(Pe(Ce.id,t.unclaimed_widget_interactions_url_template),(n=>F.get({url:n})),(n=>({count:n.count,results:n.results})))))).catch((t=>Promise.reject(t))),getUpdatedWidgetInteraction:Nh,getUserProfile:ho,getUserQuestRewards:e=>Y(e,[],"getUserQuestRewards",(()=>{var t;if(!e?.userQuestId&&!(!((t=e?.userQuestIds)===null||t===void 0)&&t.length))return'Argument object is missing "userQuestId" or "userQuestIds" property.'})).then((()=>pe())).then((t=>{var n,r;const o=[e.userQuestId&&`user_quest_id=${e.userQuestId}`,...(r=(n=e.userQuestIds)===null||n===void 0?void 0:n.map((l=>l&&`user_quest_id=${l}`)))!==null&&r!==void 0?r:[],e.rewardStatus&&`&reward_status=${e.rewardStatus}`].filter(Boolean),c=`${t.user_quest_rewards_url}?${o.join("&")}`;return Ee(["results"],ke(c,(l=>F.get({url:l})),(l=>({count:l.count,results:l.results}))))})),getUserQuests:e=>Y(e,["profileId"],"getUserQuests").then((()=>pe())).then((t=>{let n=Pe(e.profileId,t.user_quests_url_template);return e.status&&(n+=`&status=${e.status}`),e.rewardStatus&&(n+=`&rewards_status=${e.rewardStatus}`),e.userQuestIds&&e.userQuestIds.length>0&&e.userQuestIds.forEach((r=>{r&&r.length>0&&(n+=`&id=${r}`)})),e.questIds&&e.questIds.length>0&&e.questIds.forEach((r=>{r&&r.length>0&&(n+=`&quest_id=${r}`)})),Ee(["results"],ke(n,(r=>F.get({url:r})),(r=>({count:r.count,results:r.results}))))})).then((t=>(t.results.forEach((n=>{z.userQuests[n.id]=n})),t))),getUserReactions:function(e){return Y(e,["reactionSpaceId"],"getUserReactions",(()=>{if(!e?.targetId&&!e?.reactionId)return'Argument object should contain either "targetId" or "reactionId" property.'})).then((()=>{return t=e.reactionSpaceId,Promise.all([pe(),ar(t)]);var t})).then((([{client_id:t},{user_reactions_url:n}])=>{const{targetId:r,reactionId:o,reactionSpaceId:c}=e,l=[`client_id=${t}`,c&&`reaction_space_id=${c}`,r&&`target_id=${r}`,o&&`reaction_id=${o}`].filter(Boolean).join("&");return Ee(["results"],ke(`${n}?${l}`,(u=>F.get({url:u})),(u=>({count:u.count,results:u.results}))))}))},getUserReactionsCount:function(e){return Y(e,["reactionSpaceId","targetIds"],"getUserReactionsCount",(()=>{if(!Array.isArray(e?.targetIds))return'Argument object "targetIds" property value should be an array.'})).then((()=>ar(e.reactionSpaceId))).then((({user_reactions_count_url:t})=>{const n=[`reaction_space_id=${e.reactionSpaceId}`,...e.targetIds.map((r=>`target_id=${r}`))].join("&");return Ee(["results"],ke(`${t}?${n}`,(r=>F.get({url:r})),(r=>({count:r.count,results:r.results}))))}))},getWidget:bt,getWidgetInteractions:cc,getWidgets:e=>e&&e.programId?Ii(e.programId).then((t=>{var n,r,o,c;let l=t.widgets_url+"?";return l+=[e.status&&`status=${e.status}`,e.ordering&&`ordering=${e.ordering}`,e.interactive!==void 0&&`interactive=${e.interactive}`,e.since&&`since=${e.since}`,...(r=(n=e.widgetKinds)===null||n===void 0?void 0:n.map((u=>"kind="+u)))!==null&&r!==void 0?r:[],...(c=(o=e.widgetAttributes)===null||o===void 0?void 0:o.map((u=>`widget_attribute=${u.key+$s+u.value}`)))!==null&&c!==void 0?c:[]].filter(Boolean).join("&"),Ee(["results"],ke(l,(u=>F.get({url:u})),(u=>(u.results.forEach((m=>{z.widgets[m.id]=Object.assign(Object.assign({},z.widgets[m.id]),m)})),{count:u.count,results:u.results}))))})).catch((t=>Promise.reject(t))):uo("programId","getwidgets"),getWidgetsInteractions:lc,hasDebugLogger:Uh,incrementUserQuestTaskProgress:e=>Y(e,["userQuestTaskId"],"incrementUserQuestTaskProgress").then((()=>pe().then((t=>F.post({url:t.user_quest_task_progress_url,data:{user_quest_task_id:e.userQuestTaskId,custom_increment:e.customIncrement}}).then((n=>n.user_quest)))))),init:Bh,interactiveWidgets:uh,isChatMessageResponsePayload:function(e){return fh(e)||yh(e)},isChatUserMessageResponsePayload:fh,isCustomMessageResponsePayload:yh,isNumberPredictionItem:Ch,isQuoteMessagePayload:vh,isSliderInteractionItem:wh,isTextAskInteractionItem:_h,isWidgetChoiceItem:bh,isWidgetOptionItem:Ms,joinChatRoom:e=>oc(e,"post"),joinPresenceChannel:function(e){return Y(e,["channel"],"joinPresenceChannel").then((()=>{he.subscribe(e.channel,{withPresence:!0})}))},leaveChatRoom:e=>oc(e,"delete").then(x0),leavePresenceChannel:function(e){return Y(e,["channel"],"leavePresenceChannel").then((()=>{he.removeAllListenersForEvent(e.channel),he.unsubscribe(e.channel)}))},pinMessage:function(e){return Y(e,["roomId","messageId","messagePayload"],"pinMessage").then((()=>pe())).then((t=>{const n=t.pinned_messages_url;return F.post({url:`${n}?chat_room_id=${e.roomId}`,data:{chat_room_id:e.roomId,message_id:e.messageId,message_payload:e.messagePayload}})}))},prepareOutgoingChatMessage:(e,t)=>Fl[e]=t,publishWidget:function(e){return Y(e,["widgetId","widgetKind"],"publishWidget").then((()=>bt({widgetId:e.widgetId,widgetKind:e.widgetKind}))).then((t=>F.put({url:t.schedule_url,data:{publish_delay:e.delayDuration,program_date_time:e.programDateTime}})))},redeemKeyByCode:e=>Y(e,["code"],"redeemKeyByCode").then((()=>pe().then((t=>F.patch({url:Pe(e.code,t.redemption_key_detail_by_code_url_template),data:{status:so.REDEEMED}}))))),redeemKeyById:e=>Y(e,["redemptionKeyId"],"redeemKeyById").then((()=>pe().then((t=>F.patch({url:Pe(e.redemptionKeyId,t.redemption_key_detail_url_template),data:{status:so.REDEEMED}}))))),removeChatRoomEventListener:function(e,t,n){return Yh(e,n?.roomId).then((r=>{t?he.removeListener(r,t,e):he.removeAllListenersForEvent(r,e),he.unsubscribe(r)}))},removeMessageListener:Ns,removePresenceListener:function(e,t){return Y(e,["channel"],"removePresenceListener").then((()=>{if(!zs.has(t))return;const n=zs.get(t);zs.delete(t),he.removeListener(e.channel,n)}))},removeProgramListener:(e,t)=>Y(e,["programId"],"removeProgramListener").then((()=>Ii(e.programId))).then((n=>{if(!Bs.has(t))return;const r=Bs.get(t);Bs.delete(t),he.removeListener(n.subscribe_channel,r),he.unsubscribe(n.subscribe_channel)})),removeReactionSpaceEventListener:function(e,t){return Y(e,["event","reactionSpaceId"],"removeReactionSpaceEventListener").then((()=>ar(e.reactionSpaceId))).then((({reaction_space_channel:n})=>{const{event:r}=e;t?he.removeListener(n,t,r):he.removeAllListenersForEvent(n,r),he.unsubscribe(n)}))},removeRewardEventListener:function(e,t){t?he.removeListener(Ce.subscribe_channel,t,e):he.removeAllListenersForEvent(Ce.subscribe_channel,e),he.unsubscribe(Ce.subscribe_channel)},removeSdkEventListener:function(e,t){sr[e]&&(sr[e]=t?sr[e].filter((n=>n!==t)):[])},removeUserProfileEventListener:function(e,t){t?he.removeListener(Ce.subscribe_channel,t,e):he.removeAllListenersForEvent(Ce.subscribe_channel,e),he.unsubscribe(Ce.subscribe_channel)},removeUserReaction:function(e){return Y(e,["userReactionId","reactionSpaceId"],"removeUserReaction").then((()=>ar(e.reactionSpaceId))).then((({user_reaction_detail_url_template:t})=>F.delete({url:Pe(e.userReactionId,t)})))},removeWidgetListener:(e,t)=>Y(e,["widgetId","widgetKind"],"removeWidgetListener").then((()=>bt(e))).then((n=>{if(!js.has(t))return;const r=js.get(t);js.delete(t),he.removeListener(n.subscribe_channel,r),he.unsubscribe(n.subscribe_channel)})),reportMessage:e=>Y(e,["roomId","profileId","nickname","messageId"],"reportChatMessage").then((()=>Rt(e.roomId))).then((t=>F.post({url:t.report_message_url,data:{profile_id:e.profileId,nickname:e.nickname,message_id:e.messageId}}))),request:F,sendChatRoomInviteToProfile:function(e){return Y(e,["roomId","profileId"],"sendChatRoomInviteToProfile").then((()=>F.post({url:Kl(),data:{chat_room_id:e.roomId,invited_profile_id:e.profileId}})))},sendCustomMessage:e=>{const t={program_date_time:e.program_date_time,custom_data:e.custom_data};return Rt(e.roomId).then((n=>F.post({url:n.custom_messages_url,data:t})))},sendMessage:Kh,setAnalyticsProvider:lh,setApiPollingInterval:Lh,setLanguage:Ih,setPresenceUserAttributes:function(e){return Y(e,["channel","attributes"],"setPresenceUserAttributes").then(Fs).then((()=>(({channels:t,state:n})=>new Promise(((r,o)=>{ze?.setState({channels:t,state:n},((c,l)=>c.error?o(c):r(l)))})))({channels:[e.channel],state:e.attributes}))).then((t=>t.state))},setUserQuestTaskProgress:e=>Y(e,["userQuestTaskId","customProgress"],"setUserQuestTaskProgress").then((()=>pe().then((t=>F.post({url:t.user_quest_task_progress_url,data:{user_quest_task_id:e.userQuestTaskId,custom_progress:e.customProgress}}).then((n=>n.user_quest)))))),get shortPollingCoordinator(){return or},startUserQuest:e=>Y(e,["questId"],"startUserQuest").then((()=>pe().then((t=>{let n=t.user_quests_url;return F.post({url:n,data:{quest_id:e.questId,profile_id:Ce.id}})})))),subscriptionCoordinator:he,throttle:function(e,t){let n,r;return function o(...c){const l=Date.now();r=clearTimeout(r),!n||l-n>=t?(e.apply(null,c),n=l):r=setTimeout(o.bind(null,...c),t-(l-n))}},transferRewardItemAmount:e=>Y(e,["rewardItemId","amount","recipientProfileId"],"transferRewardItemAmount").then((()=>F.post({url:Ce.reward_item_transfer_url,data:{reward_item_id:e.rewardItemId,reward_item_amount:e.amount,recipient_profile_id:e.recipientProfileId}}))),unassignRedemptionKey:e=>Y(e,["redemptionKeyId"],"unassignRedemptionKey").then((()=>pe().then((t=>F.patch({url:Pe(e.redemptionKeyId,t.redemption_key_detail_url_template),data:{assigned_to:null}}))))),unblockProfile:function(e){return Y(e,["blockId"],"unblockProfile").then((()=>Hh({blockId:e.blockId}))).then((t=>F.delete({url:`${Ce.block_profile_url}${e.blockId}/`}).then((()=>{Ds(t.blocked_profile_id,"delete")}))))},unpinMessage:function(e){return Y(e,["pinMessageInfoId"],"unpinMessage").then((()=>pe())).then((t=>F.delete({url:`${t.pinned_messages_url}${e.pinMessageInfoId}/`})))},updateChatRoom:(e,t)=>Us({roomId:e}).then((n=>F.patch({url:n.url,data:t}).then(sc))),updateChatRoomInviteStatus:function(e){return Y(e,["invitationId","invitationStatus"],"updateChatRoomInviteStatus").then((()=>F.patch({url:Dh(e.invitationId),data:{status:e.invitationStatus}})))},updateCommentBoard:function(e){return Y(e,["commentBoardId"],"updateCommentBoard").then((()=>pe())).then((t=>{const{commentBoardId:n,customId:r,title:o,allowComments:c,repliesDepth:l,description:u,customData:m,contentFilter:v}=e,R=Pe(n,t.comment_board_detail_url_template);return F.patch({url:R,data:{title:o,custom_id:r,replies_depth:l,allow_comments:c,custom_data:m,description:u,content_filter:v}})}))},updateImageNumberPredictionWidgetOption:function(e){return Y(e,["widgetId","optionId"],"updateImageNumberPredictionWidgetOption").then((()=>bt({widgetId:e.widgetId,widgetKind:X.IMAGE_NUMBER_PREDICTION}))).then((t=>{const{optionId:n,description:r,correctNumber:o,rewardItemId:c,rewardItemAmount:l,imageUrl:u}=e,m=t.options.find((v=>v.id===n));return m?F.patch({url:m.url,data:{description:r,correct_number:o,reward_item_id:c,reward_item_amount:l,image_url:u}}):Promise.reject({message:"Invalid widget option Id"})})).then((t=>{const n=z.widgets[e.widgetId];return n&&(z.widgets[e.widgetId]=Object.assign(Object.assign({},n),{options:n.options.map((r=>r.id===t.id?t:r))})),t}))},updateImagePredictionWidgetOption:function(e){return Y(e,["widgetId","optionId"],"updateImagePredictionWidgetOption").then((()=>bt({widgetId:e.widgetId,widgetKind:X.IMAGE_PREDICTION}))).then((t=>{const{optionId:n,description:r,isCorrect:o,rewardItemId:c,rewardItemAmount:l,imageUrl:u}=e,m=t.options.find((v=>v.id===n));return m?F.patch({url:m.url,data:{description:r,is_correct:o,reward_item_id:c,reward_item_amount:l,image_url:u}}):Promise.reject({message:"Invalid widget option Id"})})).then((t=>{const n=z.widgets[e.widgetId];return n&&(z.widgets[e.widgetId]=Object.assign(Object.assign({},n),{options:n.options.map((r=>r.id===t.id?t:r))})),t}))},updateReactionSpace:function(e){return Y(e,["reactionSpaceId"],"updateReactionSpace",(()=>{if(!e?.reactionPackIds&&!e?.name)return'Argument object is missing "reactionPackIds" or "name".'})).then((()=>pe())).then((t=>{const{name:n,reactionPackIds:r}=e;return F.patch({url:Pe(e.reactionSpaceId,t.reaction_space_detail_url_template),data:{name:n,reaction_pack_ids:r}})}))},updateTextPredictionWidgetOption:function(e){return Y(e,["widgetId","optionId"],"updateTextPredictionWidgetOption").then((()=>bt({widgetId:e.widgetId,widgetKind:X.TEXT_PREDICTION}))).then((t=>{const{optionId:n,description:r,isCorrect:o,rewardItemId:c,rewardItemAmount:l}=e,u=t.options.find((m=>m.id===n));return u?F.patch({url:u.url,data:{description:r,is_correct:o,reward_item_id:c,reward_item_amount:l}}):Promise.reject({message:"Invalid widget option Id"})})).then((t=>{const n=z.widgets[e.widgetId];return n&&(z.widgets[e.widgetId]=Object.assign(Object.assign({},n),{options:n.options.map((r=>r.id===t.id?t:r))})),t}))},updateUserProfile:e=>e&&e.accessToken?Ql("patch",e.options,e.accessToken).then((t=>(t.access_token=e.accessToken,t.id===Ce.id&&(z.storageStrategy.set(t),Ce.nickname=t.nickname,Object.assign(Ce,t)),t))):uo("accessToken","updateuserprofile"),updateUserQuestTasks:e=>Y(e,["userQuestId","userQuestTaskIds","status"],"updateUserQuestTasks").then((()=>pe().then((t=>{let n=Pe(e.userQuestId,t.user_quest_detail_url_template),r=[];return e.userQuestTaskIds.forEach((o=>{o&&o.length>0&&r.push({id:o,status:e.status})})),F.patch({url:n,data:{user_quest_tasks:r}})})))),updateWidgetInteraction:e=>Y(e,["widgetId","widgetKind","interactionItem"],"updateWidgetInteraction").then((()=>bt({widgetId:e.widgetId,widgetKind:e.widgetKind}))).then((t=>cc({widgetId:e.widgetId,widgetKind:e.widgetKind,programId:t.program_id}).then((n=>({widget:t,widgetInteractions:n}))))).then((({widget:t,widgetInteractions:n})=>{if(!n?.length)return Promise.reject(`No widget interaction found for widgetId=${e.widgetId}.
|
|
26
|
+
Try using "createWidgetInteraction" API.`);const{widgetId:r,interactionItem:o}=e;if(hh.includes(t.kind))return Promise.reject(`Interaction already present for widgetId=${r}, updateWidgetInteraction not supported.`);if(t.kind===X.CHEER_METER&&Ms(o)){const l=n.find((u=>u.option_id===o.id));return l?F.patch({url:l.url,data:{vote_count:o.vote_count}}):Promise.reject("No user interaction found for given cheer meter interaction item")}const c=n[0].url;return F.patch({url:c,data:{option_id:e.interactionItem.id}})})).then((t=>(uc([t]),t))),uploadImage:Qh,userProfile:Ce,widgetEndPhase:n0,widgetKindVote:{"emoji-slider":"slider","cheer-meter":"cheer","text-poll":"vote","image-poll":"vote","text-quiz":"answer","image-quiz":"answer","text-prediction":"prediction","image-prediction":"prediction","text-ask":"reply","text-number-prediction":"number-prediction","image-number-prediction":"number-prediction"}});const ee=z;ee.syncStrategy=null,ee.pageVisible=!0,ee.localizedStrings={en:{"chat.inputPlaceholder":"Say something...","chat.messageMenu.quote":"Quote message","chat.messageMenu.blockUser":"Block this user","chat.messageMenu.reportMessage":"Report message","chat.messageMenu.deleteMessage":"Delete message","chat.messageMenu.cancel":"Cancel","chat.messageMenu.ariaLabel":"Message options","chat.blockConfirmation.message":"You will no longer see messages from this user.","chat.reportConfirmation.message":"The message has been reported to the moderators. Thank you.","chat.mutedMessage":"Unable to send message.","chat.errorMessage":"There was an error. Please try again.","chat.messageDeleted":"Message deleted","chat.quoteMessage.deleted":"Message has been deleted by <nickname>","chat.messageSenderBlocked":"Message sender blocked","chat.sendButton.ariaLabel":"Send Message","chat.scrollDownButton.ariaLabel":"Scroll Down","chat.scrollDownButton.label":"Scroll Down","chat.stickerPicker.title":"STICKERS","chat.stickerPicker.openButton.ariaLabel":"Open Stickers","chat.stickerPicker.closeButton.ariaLabel":"Close Stickers","chat.stickerPicker.stickerPackTab.ariaLabel":"Sticker pack <packName>","chat.stickerPicker.stickerSelectionButton.ariaLabel":"<stickerName> Sticker","chat.giphyPicker.title":"GIPHY","chat.giphyPicker.placeholder":"Search GIFs via GIPHY","chat.giphyPicker.openButton.ariaLabel":"Open GIPHY","chat.giphyPicker.closeButton.ariaLabel":"Close GIPHY","chat.giphyPicker.stickerSelectionButton.ariaLabel":"<stickerName> GIF","chat.reactions.openButton.ariaLabel":"Message reactions","chat.reactions.reactionSelectionButton.ariaLabel":"Reaction <reactionName>","widget.quiz.voteButton.label":"Answer","widget.quiz.votedText":"Answered!","widget.slider.voteButton.label":"Vote","widget.slider.votedText":"Voted!","widget.textAsk.placeholder":"Type something...","widget.textAsk.sendButton.label":"SEND","widget.video.playbackError":"Can’t play this video","widget.sponsors.label":"Sponsored by","widget.quiz.tag":"","widget.poll.tag":"","widget.prediction.tag":"","widget.followup.tag":"","widget.numberPrediction.tag":"","widget.numberPredictionFollowUp.tag":"","widget.numberPrediction.voteButton.label":"Predict","widget.numberPrediction.votedText":"Predicted!","widget.timeline.loadMore":"Load More","chat.confirmation.deleteMessage.title":"Are you sure?","chat.confirmation.deleteMessage.description":"This message would be deleted for everyone","chat.confirmation.deleteMessage.accept":"Yes","chat.confirmation.deleteMessage.reject":"No","chat.confirmation.deleteMessage.loadinglabel":"Deleting","comment.deletedMessage":"This comment was deleted!","comment.deletedMessageByOwner":"This comment was deleted by you!","comment.moderationMenu.deleteComment":"Delete Comment","comment.moderationMenu.blockUser":"Block User","comment.moderationMenu.unblockUser":"Unblock User","comment.moderationMenu.reportComment":"Report Comment","comment.moderationMenu.unreportComment":"Unreport Comment","comment.info.deletedComment":"The comment was deleted","comment.info.reportedComment":"The comment was reported","comment.info.unreportedComment":"The comment was unreported","comment.info.blockUser":"<nickname> was blocked","comment.info.unblockUser":"<nickname> was unblocked","comment.error.reportedComment":"Unable to report comment","comment.error.unreportedComment":"Not able to unreport a comment","comment.error.somethingWentWrong":"Something went wrong","comment.error.blockUser":"Unable to block <nickname>","comment.error.unblockUser":"Unable to unblock <nickname>","comment.composer.inputPlaceholder":"Add a comment","comment.reply.composer.inputPlaceholder":"Add a reply","comment.composer.error.genericError":"Unable to post a comment","livechat.userSetting.chatSetting.label":"Chat Setting","livechat.userSetting.username.label":"Username","livechat.userSetting.colorPicker.title":"Global Name Color","livechat.userSetting.colorPicker.description":"Pick a color to represent yourself in the live chat! It may take a couple of minutes to update in the chat room.","livechat.quoteMessageItem.replyTo.label":"Replying to","livechat.loadPreviousMessage.loadingButton.label":"Loading previous messages","livechat.loadPreviousMessage.loadButton.label":"Load previous messages"}};const lr={version:"2.59.0",ready:!1,theme:{},apiDocVersion:"2.59.0"},ae=Ce;var Qt;(function(e){e.READY="ready",e.INTERACTIVE="interactive",e.FINISHED="finished",e.RESULTS="results",e.POINTS="points",e.BADGE="badge"})(Qt||(Qt={}));const V0=[Qt.RESULTS,Qt.FINISHED],op={"emoji-slider":"slider","cheer-meter":"cheer","text-poll":"vote","image-poll":"vote","text-quiz":"answer","image-quiz":"answer","text-prediction":"prediction","image-prediction":"prediction","text-ask":"reply","text-number-prediction":"number-prediction","image-number-prediction":"number-prediction"},D0={alert:"alert","text-poll":"poll","image-poll":"poll","text-quiz":"quiz","image-quiz":"quiz","cheer-meter":"cheerMeter","social-embed":"socialEmbed","rich-post":"richText","text-prediction":"prediction","image-prediction":"prediction","text-prediction-follow-up":"predictionFollowUp","image-prediction-follow-up":"predictionFollowUp","emoji-slider":"imageSlider","text-ask":"textAsk","video-alert":"videoAlert","text-number-prediction":"numberPrediction","image-number-prediction":"numberPrediction","text-number-prediction-follow-up":"numberPredictionFollowUp","image-number-prediction-follow-up":"numberPredictionFollowUp"};var se,mc;(function(e){e.ALERT="alert",e.EMOJI_SLIDER="emoji-slider",e.SOCIAL_EMBED="social-embed",e.RICH_POST="rich-post",e.CHEER_METER="cheer-meter",e.TEXT_POLL="text-poll",e.IMAGE_POLL="image-poll",e.TEXT_QUIZ="text-quiz",e.IMAGE_QUIZ="image-quiz",e.TEXT_PREDICTION="text-prediction",e.TEXT_PREDICITON_FOLLOW_UP="text-prediction-follow-up",e.TEXT_PREDICTION_FOLLOW_UP="text-prediction-follow-up",e.IMAGE_PREDICTION="image-prediction",e.IMAGE_PREDICITON_FOLLOW_UP="image-prediction-follow-up",e.IMAGE_PREDICTION_FOLLOW_UP="image-prediction-follow-up",e.TEXT_ASK="text-ask",e.VIDEO_ALERT="video-alert",e.TEXT_NUMBER_PREDICTION="text-number-prediction",e.TEXT_NUMBER_PREDICTION_FOLLOW_UP="text-number-prediction-follow-up",e.IMAGE_NUMBER_PREDICTION="image-number-prediction",e.IMAGE_NUMBER_PREDICTION_FOLLOW_UP="image-number-prediction-follow-up"})(se||(se={})),(function(e){e.ALERT="alert-created",e.EMOJI_SLIDER="emoji-slider-created",e.SOCIAL_EMBED="social-embed-created",e.RICH_POST="rich-post-created",e.CHEER_METER="cheer-meter-created",e.TEXT_POLL="text-poll-created",e.IMAGE_POLL="image-poll-created",e.TEXT_QUIZ="text-quiz-created",e.IMAGE_QUIZ="image-quiz-created",e.TEXT_PREDICTION="text-prediction-created",e.TEXT_PREDICITON_FOLLOWUP="text-prediction-follow-up-updated",e.IMAGE_PREDICTION="image-prediction-created",e.IMAGE_PREDICITON_FOLLOWUP="image-prediction-follow-up-updated",e.TEXT_ASK="text-ask-created",e.VIDEO_ALERT="video-alert-created",e.TEXT_NUMBER_PREDICTION="text-number-prediction-created",e.TEXT_NUMBER_PREDICTION_FOLLOWUP="text-number-prediction-follow-up-updated",e.IMAGE_NUMBER_PREDICTION="image-number-prediction-created",e.IMAGE_NUMBER_PREDICTION_FOLLOWUP="image-number-prediction-follow-up-updated"})(mc||(mc={}));const N0=Object.values(mc),U0=[se.CHEER_METER,se.EMOJI_SLIDER,se.TEXT_POLL,se.IMAGE_POLL,se.TEXT_QUIZ,se.IMAGE_QUIZ,se.TEXT_PREDICTION,se.TEXT_PREDICITON_FOLLOW_UP,se.IMAGE_PREDICTION,se.IMAGE_PREDICITON_FOLLOW_UP,se.TEXT_ASK,se.TEXT_NUMBER_PREDICTION,se.TEXT_NUMBER_PREDICTION_FOLLOW_UP,se.IMAGE_NUMBER_PREDICTION,se.IMAGE_NUMBER_PREDICTION_FOLLOW_UP];se.TEXT_PREDICTION_FOLLOW_UP,se.IMAGE_PREDICTION_FOLLOW_UP,se.TEXT_NUMBER_PREDICTION_FOLLOW_UP,se.IMAGE_NUMBER_PREDICTION_FOLLOW_UP;const sp={[se.TEXT_PREDICTION_FOLLOW_UP]:"text_prediction_id",[se.IMAGE_PREDICTION_FOLLOW_UP]:"image_prediction_id",[se.IMAGE_NUMBER_PREDICTION_FOLLOW_UP]:"image_number_prediction_id",[se.TEXT_NUMBER_PREDICTION_FOLLOW_UP]:"text_number_prediction_id"},gc=()=>Bl.generateUUID();var $n,fc,cr,Ye,yc,Ze;(function(e){e.ADD_NEW_MEMBER="chat-room-add",e.INVITE_NEW_MEMBER="chat-room-invite",e.PIN_MESSAGE="message-pinned",e.UNPIN_MESSAGE="message-unpinned",e.CHATROOM_UPDATED="chatroom-updated"})($n||($n={})),(function(e){e.REWARD_ITEM_TRANSFER_RECEIVED="reward-item-transfer-received"})(fc||(fc={})),(function(e){e.BLOCK_PROFILE="block-profile",e.UNBLOCK_PROFILE="unblock-profile"})(cr||(cr={})),(function(e){e.ADD_REACTION="user-reaction-added",e.REMOVE_REACTION="user-reaction-removed",e.UPDATE_REACTION_SPACE="reaction-space-updated"})(Ye||(Ye={})),(function(e){e.JOIN="join",e.LEAVE="leave",e.TIMEOUT="timeout",e.ATTRIBUTES_UPDATE="attributesUpdate"})(yc||(yc={})),(function(e){e.MESSAGE_CREATED="message-created",e.IMAGE_CREATED="image-created",e.CUSTOM_MESSAGE_CREATED="custom-message-created",e.MESSAGE_DELETED="message-deleted",e.IMAGE_DELETED="image-deleted",e.CHATROOM_UPDATED="chatroom-updated"})(Ze||(Ze={})),Ze.MESSAGE_CREATED,Ze.IMAGE_CREATED,Ze.MESSAGE_DELETED,Ze.IMAGE_DELETED,Ze.CHATROOM_UPDATED,Ze.MESSAGE_CREATED,Ze.IMAGE_CREATED,Ze.MESSAGE_DELETED,Ze.IMAGE_DELETED,Ze.CHATROOM_UPDATED;const ap="messagedeleted",qs="messagereceived",j0="messageupdated",B0="messagesent",F0="reactionadded",z0="reactionremoved",lp={[Ze.CHATROOM_UPDATED]:"chatroom-updated",[Ze.MESSAGE_CREATED]:qs,[Ze.IMAGE_CREATED]:qs,[Ze.CUSTOM_MESSAGE_CREATED]:qs,[Ze.MESSAGE_DELETED]:ap,[Ze.IMAGE_DELETED]:ap,"message-updated":j0,"message-sent":B0,added:F0,removed:z0};var Vn,vc,bc,cp,_c,wc,Gs,go;function Cc(e){return e.quote_message_id!==void 0&&e.quote_message_id!==null}(function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE"})(Vn||(Vn={})),(function(e){e.ACCEPTED="accepted",e.PENDING="pending",e.REJECTED="rejected"})(vc||(vc={})),(function(e){e.SENT="sent",e.RECEIVED="received"})(bc||(bc={})),(function(e){e.SCHEDULED="scheduled",e.PENDING="pending",e.PUBLISHED="published",e.INFLIGHT="inflight"})(cp||(cp={})),(function(e){e.ETHEREUM="ethereum",e.POLYGON="polygon",e.CHILIZ="chiliz",e.HEDERA="hedera"})(_c||(_c={})),(function(e){e.FUNGIBLE="fungible",e.NONFUNGIBLE="non-fungible"})(wc||(wc={})),(function(e){e.SHADOW_MUTED="shadow-muted",e.PROFANITY="profanity"})(Gs||(Gs={})),(function(e){e.ALLOWED="allowed",e.DISALLOWED="disallowed"})(go||(go={}));const dp={400:"Incorrect data.",401:"Unauthorized. Access token missing from request.",403:"Access Denied. Access token incorrect.",404:"Resource not found.",405:"Method not allowed.",409:"Resource already exists",415:"Unsupported media type.",500:"Server error. Try again."},K=e=>{var t,n;if(!e)return Promise.reject("request options object required");if(!e.url&&!e.path)return console.warn("Need either a url or a path"),Promise.reject("Need either a url or a path");let r=(t=e.method)!==null&&t!==void 0?t:Vn.GET,o=(function(m){if(m.url)return m.url;if(m.path)return(function(v){return ee.endpoint.endsWith("/")?ee.endpoint+(v.startsWith("/")?v.slice(1):v):ee.endpoint+(v.startsWith("/")?v:"/"+v)})(m.path)})(e),c=(n=e.auth)!==null&&n!==void 0?n:`Bearer ${(function(){const m=ee.storageStrategy.get();return m?.access_token||ee.accessToken||ae.access_token})()}`;o=(function(m,v){const R=(function(ne={}){const oe=Object.keys(ne);if(!oe.length)return[];let me=[];for(const ce of oe){const ye=ne[ce];ye&&Array.isArray(ye)?me=me.concat(ye.filter(Boolean).map((Ve=>`${ce}=${Ve}`))):ye&&(me=me.concat(`${ce}=${ye}`))}return me})(v);if(!R.length)return m;const k=R.filter(Boolean).join("&"),M=H0.test(m),D=m.indexOf("?")>-1?M?"&":"":"?";return m+D+k})(o,e.queryParams);const{headers:l,data:u}=(function(m,v){const{headers:R={},method:k}=m;let{data:M}=m;const D=new Headers;for(const oe in R)R[oe]&&D.append(oe,R[oe]);v&&D.append("Authorization",v);const ne=Nl();return ne&&D.append("accept-language",ne),k!=="POST"&&k!=="PATCH"&&k!=="PUT"||R.hasOwnProperty("Content-Type")||(D.append("Content-Type","application/json"),m.data&&(M=JSON.stringify(m.data))),{headers:D,data:M}})(e,c);return fetch(o,{method:r,body:u,headers:l}).then((m=>{if(m.status>=300)return(function(v){let R;return v.text().then((k=>{console.error(k),R=k;try{R=JSON.parse(k)}catch(M){console.error("Error while parsing response text as json",M)}})).finally((()=>Promise.reject({status:v.status,message:v.status>=500?dp[500]:dp[v.status],errorDetail:R})))})(m);{const v=m.headers.get("content-type");return!e.returnRawResponse&&v&&v.indexOf("application/json")!==-1?m.json():m}}))},H0=new RegExp(/\?\S+=\S+/),fo=e=>t=>K(Object.assign(Object.assign({},t),{method:e}));K.get=fo(Vn.GET),K.post=fo(Vn.POST),K.put=fo(Vn.PUT),K.patch=fo(Vn.PATCH),K.delete=fo(Vn.DELETE);const up=(e,t)=>{const n=ee.deletedMessageIds[e];return!!n&&n.has(t)},hp=e=>ee.deletedMessageIds[e]||new Set,pp=(e,t)=>{const n=t.content_filter&&t.content_filter.indexOf(Gs.PROFANITY)>=0,r=t.sender_id===ae.id;return ae.nickname!=="Producer"&&!r&&n},q0={"&":"&","<":"<",">":">",""":'"',"/":"/"},G0=/<|>|&|"|//gi,Ic=e=>e?e.replace(G0,(t=>q0[t])):null,W0=(e,t)=>{var n,r;let o=e;var c;return e.message&&e.message.length&&(o=Object.assign(Object.assign({},e),{message:Ic(e.message),filtered_message:Ic(e.filtered_message),isFiltered:pp(0,e)}),o.quote_message&&(o.quote_message=Object.assign(Object.assign({},o.quote_message),{message:Ic(o.quote_message.message)}))),c=e.message_event,lp[c]===qs&&(o=Object.assign(Object.assign({},o),{timetoken:(n=e.timetoken)!==null&&n!==void 0?n:e.pubnub_timetoken,reactions:(r=e.reactions)!==null&&r!==void 0?r:{}})),o};function mp(e){const t=Math.log10(e)/3|0;if(t==0)return e;const n=e/Math.pow(10,3*t),r=n%1==0||n>=10?0:1;return n.toFixed(r)+["","k","M"][t]}const Ws=e=>{const t=e.match(/(-)?P(?:([.,\d]+)Y)?(?:([.,\d]+)M)?(?:([.,\d]+)W)?(?:([.,\d]+)D)?(?:T(?:([.,\d]+)H)?(?:([.,\d]+)M)?(?:([.,\d]+)S)?)?/);return(t[8]&&1e3*t[8])+(t[7]&&6e4*t[7])+(t[6]&&36e5*t[6])+(t[5]&&864e5*t[5])},Dn=e=>e.split("-").map((t=>t[0].toUpperCase()+t.substr(1).toLowerCase())).join(" ");function kc(e,t){return Object.keys(t).forEach((n=>{!e.hasOwnProperty(n)||typeof e[n]!="object"||e[n]instanceof Array?e[n]=t[n]:kc(e[n],t[n])})),e}const Ec=(e,t)=>{const n=e.slice();return n.splice(e.length,0,t),n},gp=(e,t)=>{const n=t.kind===se.TEXT_PREDICITON_FOLLOW_UP||t.kind===se.IMAGE_PREDICITON_FOLLOW_UP||t.kind===se.TEXT_NUMBER_PREDICTION_FOLLOW_UP||t.kind===se.IMAGE_NUMBER_PREDICTION_FOLLOW_UP;return e.attach(t).then((()=>n?Promise.resolve():t.interactive())).then((()=>t.results({timeout:n&&t.timeout?Ws(t.timeout):5e3})))},fp=({target:e,widget:t})=>gp(e,t).then(t.expire).then((()=>e.detach(t))),K0=({target:e,widget:t})=>{t.hide_dismiss_button=!0,t.initialLoad?e.attach(t,"append").then(t.results).then(t.expire).then(t.finished):gp(e,t).then(t.expire).then(t.finished)},yp=e=>V0.includes(e),vp=e=>e.follow_ups.some((t=>t.status==="published")),bp=e=>{const{target:t,widget:n,timer:r}=e,{widgetPayload:o}=n;let c=!1;switch(n.kind){case se.TEXT_PREDICITON_FOLLOW_UP:case se.IMAGE_PREDICITON_FOLLOW_UP:{const l=o.text_prediction_id||o.image_prediction_id;if(t){let u=t.querySelector(`[widgetid="${l}"]`);!u||u.disabled&&yp(u.phase)||u.results()}c=!0;break}case se.TEXT_PREDICTION:case se.IMAGE_PREDICTION:c=t&&vp(o);break;case se.TEXT_QUIZ:case se.IMAGE_QUIZ:n.interaction||n.addEventListener("answer",(l=>{n.results()})),c=!!n.interaction;break;case se.EMOJI_SLIDER:n.interaction||n.addEventListener("slider",(l=>{setTimeout(n.results,2e3)})),c=!!n.interaction;break;case se.TEXT_ASK:n.interaction||n.addEventListener("reply",(l=>{n.results()})),c=!!n.interaction;break;case se.TEXT_NUMBER_PREDICTION_FOLLOW_UP:case se.IMAGE_NUMBER_PREDICTION_FOLLOW_UP:{const l=o.text_number_prediction_id||o.image_number_prediction_id;if(t){let u=t.querySelector(`[widgetid="${l}"]`);!u||u.disabled&&yp(u.phase)||u.results()}c=!0;break}case se.TEXT_NUMBER_PREDICTION:case se.IMAGE_NUMBER_PREDICTION:c=!!n.interaction||t&&vp(o);break;default:c=!1}return c?Promise.resolve():n.interactive&&n.interactive({timeout:r||null})},_p=e=>{const{target:t,widget:n,timer:r}=e,{widgetPayload:o}=n;n.hide_dismiss_button=!0;const c=n.kind===se.TEXT_PREDICITON_FOLLOW_UP||n.kind===se.IMAGE_PREDICITON_FOLLOW_UP||n.kind===se.TEXT_NUMBER_PREDICTION_FOLLOW_UP||n.kind===se.IMAGE_NUMBER_PREDICTION_FOLLOW_UP;return t.attach(n,n.initialLoad?"append":"prepend").then((()=>bp(e))).then((()=>n.results({timeout:c&&n.timeout?Ws(n.timeout):5e3}))).then(n.expire).then((()=>n.finished({timeout:null})))},Ks=(e,t)=>{let n;return(...r)=>clearTimeout(n,n=setTimeout(e,250,...r))},Sc=({time:e,format:t,lang:n})=>new Date(e).toLocaleDateString(n||"en-US",t),Pc=e=>{if(!e.lang){const t=n=>{const r=n.querySelector("[lang]");r?e.lang=r.getAttribute("lang"):n.parentElement&&t(n.parentElement)};t(e.parentElement)}},wp=(e,t,n=0)=>{const r=e.options||e.choices,o=t.vote_count?"vote_count":"answer_count",c=r.reduce(((l,u)=>l+u[o]),0);return c>0?Math.round(t[o]/c*100):n},Te=(e,t)=>t&&encodeURI(t.replace(/{(.*?)}/g,e)),yo=(e,t)=>e?fetch(e).then((n=>{const r=n.status===404,o=n.status===403,c=t==="Room"&&n.status>202;if(r||c||o)return Promise.reject(`${t} resource not found. Check ${t} Id.
|
|
27
|
+
Read more: https://www.npmjs.com/package/@livelike/engagementsdk`);{const l=n.headers.get("content-type");return l&&l.indexOf("application/json")!==-1?n.json():void 0}})):Promise.reject(`${t} url missing.`),Si={program:e=>yo(Te(e,ee.programUrlTemplate),"Program"),app:e=>yo(encodeURI(`${ee.endpoint}applications/${e}/`),"Client"),chatRoom:e=>yo(Te(e,ee.chatUrlTemplate),"Room"),leaderboard:e=>yo(Te(e,ee.leaderboardUrlTemplate),"Leaderboard"),leaderboardEntryDetail:(e,t)=>yo(Te(t,e),"Leaderboard Entry")},Oc=(e,t,n)=>e[t]?Promise.resolve(e[t]):Si[n](t).then((r=>(e[t]=r,r))).catch((r=>Promise.reject(r))),be=()=>Oc(ee.appResource,ee.clientId,"app"),Pi=e=>Oc(ee.chatRooms,e,"chatRoom"),Oi=e=>Oc(ee.progResource,e,"program"),Q0=e=>new Promise(((t,n)=>ee.chatRooms&&ee.chatRooms[e]&&ee.chatRooms[e].channels?t(ee.chatRooms[e].channels.chat.pubnub):Pi(e).then((r=>t(r.channels.chat.pubnub))).catch((r=>n(r))))),X0=e=>new Promise(((t,n)=>ee.chatRooms&&ee.chatRooms[e]&&ee.chatRooms[e].channels?t(ee.chatRooms[e].channels.control.pubnub):Pi(e).then((r=>t(r.channels.control.pubnub))).catch((r=>n(r)))));function xe(e,t,n){let r={next:e,prev:null};const o=c=>r[c]?t(r[c]).then((l=>(r={next:l.next,prev:l.previous},Promise.resolve({value:n(l),done:!l.next})))):Promise.resolve({done:!0});return{[Symbol.asyncIterator]:()=>({next:()=>o("next"),previous:()=>o("prev")}),next:()=>o("next"),previous:()=>o("prev")}}const Re=(e,t)=>t.next().then((n=>{let r={count:n.value.count,iterator:t,next:t.next,previous:t.previous,done:n.done};return e.forEach((o=>{r[o]=n.value[o]})),r})),Ne=(function(e){e=e||Object.create(null);const t=(n,r)=>(e[n]||(e[n]=[])).push(r);return{on:t,peak:()=>e,uniqueOn:(n,r)=>(!e[n]||e[n].length===0)&&t(n,r),off:(n,r)=>{e[n]&&e[n].splice(e[n].indexOf(r)>>>0,1)},emit:(n,r)=>{(e[n]||[]).slice().map((o=>o(r))),(e["*"]||[]).slice().map((o=>o(n,r)))}}})();ee.eb=Ne.peak;const Ie=(e,t,n)=>{const r=new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0});return e.dispatchEvent(r),r};function Rc(e,t){return Ie(e,t,{}).detail.provider}const Cp=e=>{let t=`https://websdk.livelikecdn.com/docs/${lr.apiDocVersion}/`;return e&&(t=`${t}#${e.toLowerCase()}`),`See ${t} for more details.`},Ip=(e,t="")=>(console.error(e,Cp(t)),e+`
|
|
28
|
+
`+Cp(t)),Dt=(e,t)=>Promise.reject(((n,r)=>Ip("Missing "+n+" argument",r))(e,t)),kp=(e,t)=>console.error(e,`
|
|
29
|
+
See https://docs.livelike.com/docs/getting-started-with-the-web-sdk for more details.`),Ep=e=>e.parentElement&&e.parentElement.localName===e.localName&&console.error(e.localName+" cannot be a child of itself."),Z0={get:()=>JSON.parse(localStorage.getItem(ee.lsKey)),set:e=>localStorage.setItem(ee.lsKey,JSON.stringify(e))},J0=(e,t,n)=>ee.chatRooms[e][n]&&(r=>new Promise((o=>{let c=[],l=!0;setTimeout((()=>l=!1),1e4);const u=m=>K.get({url:m}).then((v=>{v&&v.results?(c=[...c,...v.results],v.next?u(v.next):o(c)):o([])})).catch((()=>l?setTimeout((()=>u(m)),2e3):o([])));u(r)})))(ee.chatRooms[e][n]).then((r=>(ee.chatRooms[e][t]=r,r))),yn=(e,t,n)=>{let r=t&&t.slice(0,2);t&&ee.localizedStrings[r]||(r="en");let o=ee.localizedStrings[r][e]||ee.localizedStrings.en[e];return o&&n&&Object.keys(n).forEach((c=>o=o.replace("<"+c+">",n[c]))),o},Sp=(()=>{const e=[];return{add:(t,n,r,o)=>{e.push({id:n,listener:o,callback:r})},remove:(t,n)=>{const r=e.findIndex((o=>o.id===t&&String(o.callback)===String(n)));r!==-1?(e[r].listener,e.splice(r,1)):console.warn("Listener not removed. Check arguments.")}}})(),Tc=e=>fetch(e).then((t=>t.blob())),Y0=(e,t)=>{var n=new FormData;return n.append("type","file"),n.append("image",t,"image.png"),fetch(e,{method:"POST",body:n}).then((r=>r.json()))},Pp=e=>e&&typeof e=="object"?e:{get currentTimecode(){return null}},Op=(e,t,n)=>{if(!e.isUpdating){e.isUpdating=!0;const r=()=>{if(e.queue&&e.queue.hasNextItem())if(e.queue.isNextItemReady()&&t()){const o=e.queue.dequeueItem();n(o),r()}else setTimeout((()=>{e.isUpdating=!1,r()}),1e3);else e.isUpdating=!1};r()}},Rp=(e,t)=>{let n=0;const r=()=>{n===30||e.syncStrategy&&e.syncStrategy.currentTimecode!==void 0?t():setTimeout((()=>{n++,r()}),100)};r()},xc=e=>({number:!0,string:!isNaN(Date.parse(Qs(e))),object:e instanceof Date&&!isNaN(e.getTime())})[typeof e],Qs=e=>typeof e=="string"&&/^(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2}):(\d{2}(?:[,.]\d*)?)(([+-](\d{2}):(\d{2})|Z)?)$/.test(e)?e.replace(",","."):e,Tp=e=>xc(e.program_date_time)?new Date(Qs(e.program_date_time)):null,xp=(e,t)=>{const n=Tp(e),r=Tp(t);return n?.getTime()===r?.getTime()?0:n?.getTime()>r?.getTime()?1:-1},Ac=e=>U0.some((t=>e.kind===t))?{kind:e.kind.replace("-follow-up",""),id:e.kind===se.TEXT_PREDICITON_FOLLOW_UP||e.kind===se.IMAGE_PREDICITON_FOLLOW_UP||e.kind===se.TEXT_NUMBER_PREDICTION_FOLLOW_UP||e.kind===se.IMAGE_NUMBER_PREDICTION_FOLLOW_UP?e.text_prediction_id||e.image_prediction_id||e.text_number_prediction_id||e.image_number_prediction_id:e.id}:null,Mc=()=>ee.chatRoomInvitationsUrl,Lc=()=>ee.pinnedMessagesUrl;function Xs(){return!!ee.logger}const Ap=(e,t)=>{if(!e&&t||e&&!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=e[n],o=t[n];if(typeof r=="object"&&typeof o=="object"){if(!Mp(r,o))return!1}else if(r!==o)return!1}return!0},Mp=(e,t)=>{if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const c=e[o],l=t[o],u=Array.isArray(c)&&Array.isArray(l),m=typeof c=="object"&&typeof l=="object"&&c!==null&&l!==null;if(u&&!Ap(c,l)||m&&!Mp(c,l)||!m&&!u&&c!==l)return!1}return!0},Lp=e=>class extends e{connectedCallback(){super.connectedCallback()}render(){return this.customTemplate?this.customTemplate():this.defaultTemplate()}},ey=e=>class extends e{constructor(){super(...arguments),this.updateOwnerProps=t=>{this.owner.widgetPayload.id===t.key&&this.owner.dataId===t.owner.dataId&&(this.ownerUpdated(t),t.name!=="disabled"&&t.name!=="changed"||(this[t.name]=t.prop),t.name!=="options"&&t.name!=="choices"||(this[t.name]=t.prop,this.items=t.prop,this.optionListUpdated(t.prop),Ie(this,"options-updated",this.items)))}}static get properties(){return{owner:{type:Object},items:{type:Array},options:{type:Array},choices:{type:Array},disabled:{type:Boolean,reflect:!0},changed:{type:Boolean,reflect:!0}}}ownerUpdated(t){}optionListUpdated(t){}optionUpdated(t){}connectedCallback(){super.connectedCallback(),Ne.on("widget-updated",this.updateOwnerProps),!this.owner&&(this.owner=Rc(this,"widget-provider")),this.items=this.owner.options||this.owner.choices,this.owner.options&&(this.options=this.owner.options),this.owner.choices&&(this.choices=this.owner.choices)}disconnectedCallback(){Ne.off("widget-updated",this.updateOwnerProps),super.disconnectedCallback()}};class $p extends ey(je){}const $c=e=>class extends e{constructor(){super(...arguments),this.appendStyles=t=>{(this.shadowRoot||this).appendChild(t)},this.updateTheme=t=>t.theme&&t.theme.widgets&&this.defaultStyles&&this.updateComplete.then((()=>{const n=this.owner.kind||this.owner.localName.replace("livelike-",""),r=D0[n],o=t.theme.widgets[r],c=document.createElement("style");c.innerHTML+=this.defaultStyles(o),this.appendStyles(c)}))}connectedCallback(){super.connectedCallback(),Ne.on("themeUpdate",this.updateTheme),this.updateTheme({theme:this.owner.theme||lr.theme})}disconnectedCallback(){Ne.off("themeUpdate",this.updateTheme),super.disconnectedCallback()}};class Tt extends Lp($c($p)){}const ty=["selected","correct","incorrect","image","disabled"],ny=e=>class extends e{constructor(){super(...arguments),this.updateItem=t=>{this.item&&this.item.id===t.key&&this.owner.widgetPayload.id===t.owner.widgetPayload.id&&this.owner.dataId===t.owner.dataId&&((t.name==="items"||t.name==="options"||t.name==="choices")&&(this[t.name.slice(0,-1)]=t.prop.find((n=>n.id===this.item.id))),this.requestUpdate(),super.requestUpdate(),this.optionUpdated(this.item),ty.some((n=>n===t.name))&&(this[t.name]=t.prop))}}static get properties(){return{item:{type:Object},option:{type:Object},choice:{type:Object},selected:{type:Boolean,reflect:!0},correct:{type:Boolean,reflect:!0},incorrect:{type:Boolean,reflect:!0},image:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}}}connectedCallback(){Ne.on("option-updated",this.updateItem);const t=Rc(this,"option-provider");t&&(this.item=t.item,t.option&&(this.option=t.option),t.choice&&(this.choice=t.choice)),super.connectedCallback()}disconnectedCallback(){Ne.off("option-updated",this.updateItem),super.disconnectedCallback()}};class dr extends Lp($c(ny($p))){}class Vp extends dr{}const{getMode:Dp,register:iy}=(function(){const e={};return{modeList:e,getMode:t=>typeof t=="function"?t:e[t]?e[t]:kp('Widget mode: "'+t+'" not found.'),register:(t,n)=>e[t]=n}})();function ry(e){switch(e){case 1:return"1st";case 2:return"2nd";case 3:return"3rd";default:return`${e}th`}}function Np(e,t,n,r){const o=Array.from(e);let c=[];for(const[m,v]of Object.entries(t)){const R=Array.isArray(v),k=ry(parseInt(m,10)+1),M=o[m];if(M!==void 0){if(R){const D=oy(M,v,k);D.length&&(c=c.concat(D))}}else c.push(R?`Missing object as ${k} argument.`:`Missing "${v}" as ${k} argument.`)}const l=r?.();return l&&(c=c.concat(Array.isArray(l)?l:[l])),c.length?Promise.reject((u=n,Ip(c.join(`
|
|
30
|
+
`),u))):Promise.resolve(void 0);var u}function oy(e,t,n){let r=[];for(const o of t)e[o]===void 0&&r.push(`Missing object property "${o}" in ${n} argument object.`);return r}function ue(e,t,n,r){return Np([e],[t],n,r)}const Zs=":",Up=e=>e.programId?Oi(e.programId).then((t=>{var n,r;const o=t.subscribe_channel,c=[e.sincePlaybackTimeMs!==void 0&&`since_playback_time_ms=${e.sincePlaybackTimeMs}`,e.untilPlaybackTimeMs!==void 0&&`until_playback_time_ms=${e.untilPlaybackTimeMs}`,...(r=(n=e.widgetAttributes)===null||n===void 0?void 0:n.map((l=>`widget_attribute=${l.key+Zs+l.value}`)))!==null&&r!==void 0?r:[]].filter(Boolean);return xe(`${t.timeline_url}${c.length?"&"+c.join("&"):""}`,(l=>{const u=[];let m="";return K({url:l,returnRawResponse:!0}).then((v=>{const R=v.headers&&Number(v.headers.get("age"));return R&&R>0&&(new Date().getTime(),new Promise(((k,M)=>{})).then((k=>k.channels[o]&&k.channels[o].map((M=>{if(M.message&&M.message.payload){u.push(M.message.payload);let D=Ac(M.message.payload);if(D){const{kind:ne,id:oe}=D;m=m+"&"+ne.replace(/-/g,"_")+"_id="+oe}}}))))),v.json()})).then((v=>(v.results=[...u,...v.results],v.widget_interactions_url_template.includes("?")&&m?v.widget_interactions_url_template=v.widget_interactions_url_template+m:m&&!v.widget_interactions_url_template.includes("?")&&(v.widget_interactions_url_template=v.widget_interactions_url_template+"?"+m),v)))}),(l=>({count:l.count,widgets:l.results,widget_interactions_url_template:l.widget_interactions_url_template})))})):Dt("programId","getwidgets"),Xt=e=>ue(e,["id","kind"],"getWidget").then((()=>{const{id:t,kind:n,cache:r=!0}=e;let o=ee.widgets[t];return o&&r?(o=Object.assign({},o),delete o.interactions,Promise.resolve(o)):be().then((c=>{const l=jp(c,n);return K.get({url:l+t+"/"})}))})).then((t=>(ee.widgets[t.id]=Object.assign(Object.assign({},ee.widgets[t.id]),t),t))),vo=(e,t)=>iy(e,t),bo=e=>{if(e.programId||e.interactionUrl){if(e.interactionUrl&&!e.interactionUrl.includes("?"))return Promise.reject("No Interaction Found");{let t="";return e.interactionUrl?(t=e.interactionUrl,K.get({url:Te(ae.id,e.interactionUrl)}).then((n=>Promise.resolve(n.interactions))).catch((n=>Promise.reject(n)))):Oi(e.programId).then((n=>{var r,o;t=Te(ae.id,n.widget_interactions_url_template);let c=[];!((r=e.widgets)===null||r===void 0)&&r.length&&(c=[...c,...e.widgets.map((u=>u.kind.replace(/-/g,"_")+"_id="+u.id))]),!((o=e.widgetKinds)===null||o===void 0)&&o.length&&(c=[...c,...e.widgetKinds.map((u=>`widget_kind=${u}`))]);const l=`${t}?${c.join("&")}`;return K.get({url:l}).then((u=>Promise.resolve(u.interactions))).catch((u=>Promise.resolve({})))}))}}return Dt("programId or interactionUrl prop in","getWidgetInteractions")},sy={[se.TEXT_POLL]:"text_polls_url",[se.IMAGE_POLL]:"image_polls_url",[se.TEXT_PREDICTION]:"text_predictions_url",[se.TEXT_PREDICTION_FOLLOW_UP]:"text_prediction_followUps_url",[se.IMAGE_PREDICTION]:"image_predictions_url",[se.IMAGE_PREDICTION_FOLLOW_UP]:"image_prediction_followUps_url",[se.IMAGE_NUMBER_PREDICTION]:"image_number_predictions_url",[se.IMAGE_NUMBER_PREDICTION_FOLLOW_UP]:"image_number_prediction_followUps_url",[se.CHEER_METER]:"cheer_meters_url",[se.EMOJI_SLIDER]:"emoji_sliders_url",[se.TEXT_QUIZ]:"text_quizzes_url",[se.IMAGE_QUIZ]:"image_quizzes_url",[se.TEXT_ASK]:"text_asks_url",[se.ALERT]:"alerts_url",[se.RICH_POST]:"rich_posts_url"};function jp(e,t){const n=e[sy[t]];if(!n)throw new Error(`Url not found for widgetKind=${t}`);return n}const Bp=[],Vc=(e,t)=>{customElements.get(e)?console.warn(`${e} has already been registered`):(customElements.define(e,t),Bp.push(e))},de=e=>t=>Vc(e,t),Ct=(e,t,n=null)=>{n&&(t["Program ID"]=n),n&&ee.progResource[n]&&(t=Object.assign(Object.assign({},t),ee.progResource[n].analytics_properties)),ee.logger===!0&&console.log("Analytics track event: ",e);const r=ee.analyticsProvider;r&&r.track(e,t)},Dc=(e,t,n)=>{const{message:r,id:o,image_url:c,messageLink:l}=e,u=r&&r.match(/:([^:]*):/g),m={"Chat Room ID":t,"Chat Message ID":o,"Has External Image":!!c};u&&u.length>0&&(m["Sticker Shortcodes"]=u),l&&(m["Chat Message Link"]=l),Ct(n,m)};var Be=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};class Ue extends je{constructor(){super(...arguments),this.firstInteractionTime=null,this.changed=!1,this.phase=Qt.READY,this.selectedOption={},this.syntheticIncrement=!1,this.vote=null,this.isInteractable=!0,this.interaction=null,this.interactions=null,this.hide_dismiss_button=!1,this.dateTimeFormatter=Sc,this.initialLoad=!1,this.interacted=!1,this._disabled=!1,this.localize=(t,n)=>yn(t,this.lang,n),this.startInteractiveUntilTimer=()=>{var t;const n=(t=this.widgetPayload)===null||t===void 0?void 0:t.interactive_until;if(!n)return;const r=2147483647,o=new Date(n).getTime()-Date.now();o>0?this.interactiveUntilTimerTimeout=o>r?setTimeout((()=>{this.startInteractiveUntilTimer()}),r):setTimeout((()=>{this.disabled=!0,this.interactiveUntilTimerTimeout=null}),o):this.disabled=!0},this.onResults=t=>{if(t.message.id===this.widgetPayload.id)if(this.syntheticIncrement)this.syntheticIncrement=!1;else{let n=null;const r=t.message.options||t.message.choices,o=t.message.options?"vote_count":"answer_count",c=t.message.options?"options":"choices";if(r){const l=this[c].map(((u,m)=>(u[o]!==r[m][o]&&(n=r[m],u[o]=r[m][o]),u)));n&&(this[c]=l,this.changed=!0,o==="vote_count"?this.voteCountChanged(n):this.answerCountChanged(n),Ie(this,o==="vote_count"?"votecountchanged":"answercountchanged",n),Ie(this,t.event,r))}}},this.removeListener=t=>(t&&Ie(this,t,{element:this,widget:this.widgetPayload}),this.channel&&(he.removeListener(this.channel,this.onResults),he.unsubscribe(this.channel)),Promise.resolve()),this.expire=()=>this.removeListener("expire"),this.dismiss=()=>{const t={"Widget Type":Dn(this.widgetPayload.kind),"Widget ID":this.widgetPayload.id};return Ct("Widget Dismissed",t,this.programid),this.removeListener("dismiss")},this.detach=()=>{const t=this.parentElement;t&&t.detach?t.detach(this):this.remove()},this.widgetDismissClick=()=>this.dismiss().then(this.detach),this.interactionTrack=()=>{!this.firstInteractionTime&&(this.firstInteractionTime=new Date),this.interacted=!0},this.interactionEvent=t=>{this.widgetPayload.kind!==se.CHEER_METER&&this.interactionTrack();const n={"Widget Type":Dn(this.widgetPayload.kind),"Widget ID":this.widgetPayload.id};Ct("Widget Interacted",n,this.programid)},this.ready=t=>new Promise((n=>setTimeout((()=>n()),t&&t.timeout||0))),this.interactive=t=>new Promise((n=>{this.phase=Qt.INTERACTIVE,this.disabled=!1;const r={"Widget Type":Dn(this.widgetPayload.kind),"Widget ID":this.widgetPayload.id};this.isInteractable&&Ct("Widget Became Interactive",r,this.programid);let o=t&&t.timeout!==void 0?t.timeout:this.widgetPayload.timeout&&Ws(this.widgetPayload.timeout);this.timeout=o,o!==null&&setTimeout(n,o)})),this.results=t=>new Promise((n=>{this.phase=Qt.RESULTS;const r=t&&t.timeout||8e3;this.changed=!0,this.disabled=!0,this.resultEvent(),setTimeout(n,r)})),this.finished=t=>new Promise((n=>{this.phase=Qt.FINISHED,this.changed=!0,this.disabled=!0,setTimeout(n,t&&t.timeout||0)})),this.rankChanged=(t,n)=>{n&&n.length&&Ie(this,"rankchange",{widget:t,rewards:n,element:this})},this.voteBase=(t,n,r)=>K[n]({url:t,data:r}).then((o=>(this.voteDisable=!1,this.vote=o,this.rankChanged(this.widgetPayload,o.rewards),Promise.resolve(o)))).catch((o=>(this.voteDisable=!1,Promise.reject(o)))),this.updateVote=(t,n)=>this.voteBase(t,"patch",n),this.createVote=(t,n)=>this.voteBase(t,"post",n)}get disabled(){return this._disabled}set disabled(t){const n=this._disabled;this.widgetPayload.interactive_until&&new Date>=new Date(this.widgetPayload.interactive_until)?n||(this._disabled=!0,this.requestUpdate("disabled",n)):(this._disabled=t,this.requestUpdate("disabled",n))}renderWidgetFooter(){return I`<livelike-widget-footer>${this.renderSponsor()}</livelike-widget-footer>`}renderSponsor(){return I`<livelike-sponsor .sponsors="${this.widgetPayload.sponsors}" .sponsorLabel="${this.localize("widget.sponsors.label")}"></livelike-sponsor>`}shouldUpdate(){return!!this.widgetPayload}firstUpdated(){this.widgetPayload.pubnub_enabled&&(this.channel=this.widgetPayload.subscribe_channel),this.channel&&(he.subscribe(this.channel),he.addListener(this.channel,this.onResults)),this.widgetPayload.impression_url&&K.post({url:this.widgetPayload.impression_url}).catch((t=>console.warn("Widget impression request failed")))}connectedCallback(){this.addEventListener("dismiss-clicked",this.widgetDismissClick),this.addEventListener("widget-provider",(t=>{t.detail.provider=this,t.stopPropagation()})),super.connectedCallback()}disconnectedCallback(){this.interactiveUntilTimerTimeout&&(clearTimeout(this.interactiveUntilTimerTimeout),this.interactiveUntilTimerTimeout=null),this.removeListener(),this.removeEventListener("dismiss-clicked",this.widgetDismissClick),super.disconnectedCallback()}updated(t){t.forEach(((n,r)=>{const o=c=>this[c]!==void 0&&Ie(this,c,{widget:this.widgetPayload,element:this,[c]:this[c],item:this.selectedOption});if(r==="interacted"&&o(r),r==="phase"&&(o(r),this.phase!==Qt.RESULTS&&this.phase!==Qt.FINISHED||(this.changed=!0,this.disabled=!0)),r==="vote"&&this.vote&&(this.vote.id||this.vote.votes)&&!this.vote.isHistoryInteraction){this.changed=!0;const c=op[this.kind];Ie(this,c,{[c]:this.vote,element:this,widget:this.widgetPayload})}if(r==="reply"&&this.reply&&this.reply.length>0){this.changed=!0;const c=op[this.kind];Ie(this,c,{[c]:this.reply,element:this,widget:this.widgetPayload})}this[r]!==void 0&&this[r]!==null&&Ne.emit("widget-updated",{name:r,key:this.widgetPayload.id,prop:this[r],owner:this})}))}answerCountChanged(t){}voteCountChanged(t){}resultEvent(){}submitVote(t){}lockInVote(){}}Be([C({type:Boolean})],Ue.prototype,"isStockWidget",void 0),Be([C({type:Boolean,reflect:!0})],Ue.prototype,"changed",void 0),Be([C({type:String,reflect:!0})],Ue.prototype,"lang",void 0),Be([C({type:Boolean})],Ue.prototype,"reactions",void 0),Be([C({type:String})],Ue.prototype,"phase",void 0),Be([C({type:Object})],Ue.prototype,"selectedOption",void 0),Be([C({type:String})],Ue.prototype,"timeout",void 0),Be([C({type:Object})],Ue.prototype,"widgetPayload",void 0),Be([C({type:Object})],Ue.prototype,"mode",void 0),Be([C({type:String})],Ue.prototype,"kind",void 0),Be([C({type:Boolean})],Ue.prototype,"syntheticIncrement",void 0),Be([C({type:Object})],Ue.prototype,"vote",void 0),Be([C({type:Boolean})],Ue.prototype,"voteDisable",void 0),Be([C({type:Array})],Ue.prototype,"options",void 0),Be([C({type:Array})],Ue.prototype,"choices",void 0),Be([C({type:String})],Ue.prototype,"question",void 0),Be([C({type:Boolean})],Ue.prototype,"isInteractable",void 0),Be([C({type:Object})],Ue.prototype,"interaction",void 0),Be([C({type:Array})],Ue.prototype,"interactions",void 0),Be([C({type:Boolean})],Ue.prototype,"authors",void 0),Be([C({type:Boolean})],Ue.prototype,"timestamps",void 0),Be([C({type:Boolean})],Ue.prototype,"timeformat",void 0),Be([C({type:Boolean})],Ue.prototype,"hide_dismiss_button",void 0),Be([C({type:String})],Ue.prototype,"reply",void 0),Be([C({type:Function})],Ue.prototype,"dateTimeFormatter",void 0),Be([C({type:Boolean,hasChanged:()=>!0})],Ue.prototype,"interacted",void 0),Be([C({type:Boolean,reflect:!0})],Ue.prototype,"disabled",null);var ay=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};const ly=e=>class extends e{constructor(){super(...arguments),this.setupWidget=()=>new Promise((t=>{const n=()=>{if(window.LiveLike._config&&window.LiveLike._config.ready&&window.LiveLike._config.theme&&window.LiveLike._config.theme.widgets){const r=this.kind||this.getAttribute("kind")||this.localName.replace("livelike-",""),o=this.widgetId||this.getAttribute("widgetid"),c=this.mode||this.getAttribute("mode"),l=typeof c=="string"?Dp(c):c,u=m=>{this.widgetPayload=m,this.programid=this.widgetPayload.program_id,Object.keys(m).forEach((v=>this[v]=m[v])),this.theme=window.LiveLike._config.theme,l?l({widget:this}):(this.widgetPayload.timeout=null,this.hide_dismiss_button=!0,bp({target:null,widget:this,timer:null}).then((()=>this.results({timeout:5e3}))).then(this.expire).then((()=>this.finished({timeout:null})))),t()};Xt({kind:r,id:o}).then((m=>{let v=Ac(m);v?bo({programId:m.program_id,widgets:[{kind:v.kind,id:v.id}]}).then((R=>{R&&R[v.kind]&&(this.interactions=R[v.kind].filter((k=>k.widget_id===v.id)),this.interactions&&(this.interaction=this.interactions[0])),u(m)})):u(m)}))}else setTimeout(n,50)};n()}))}},cy=e=>class extends e{constructor(){super(...arguments),this.appendStyles=t=>{this.appendChild(t)}}connectedCallback(){super.connectedCallback();const t=()=>(this.startInteractiveUntilTimer(),new Promise((n=>{const r=!!this.customTemplate&&this.customTemplate({widgetPayload:this.widgetPayload});if(r&&!(r instanceof HTMLTemplateElement))return console.error("customTemplateRenderer must return an HTMLTemplateElement");const o=document.querySelector(`template[kind=${this.widgetPayload.kind}]`),c=r||o;this.updateComplete.then((()=>{this.shadowRoot&&this.shadowRoot.appendChild(document.createElement("slot"));const l=this.shadowRoot.querySelector("template");var u;(c||l)&&(c?this.appendChild(document.importNode(c.content,!0)):(u=this.localName,Bp.includes(u)&&(this.isStockWidget=!0),this.appendChild(l.content))),n()}))})));return this.widgetPayload&&Object.keys(this.widgetPayload).length!==0?t():this.setupWidget().then(t)}};class Nt extends cy(ly($c(Ue))){}const dy=e=>class extends e{connectedCallback(){super.connectedCallback(),this.setupWidget()}};let Nc=class extends Ue{render(){return I`<slot></slot>`}};Nc=ay([de("livelike-widget")],Nc);const uy="hlsLevelSwitched",hy="hlsFragChanged";class Fp{get currentTimecode(){return this.programDateTime}get programDateTime(){return null}}class py extends Fp{constructor(t,n){super(),this.hls=t,this.video=n,this.level=null,this.frag=null,this.hls.on(uy,((r,o)=>{this.level=this.hls.levels[o.level]})),this.hls.on(hy,((r,o)=>{this.frag=o.frag}))}get baseProgramDateTimeMs(){return this.frag?this.frag.programDateTime:this.level?this.level.details.fragments[0].programDateTime:void 0}get fragmentStartMs(){return this.frag?1e3*this.frag.start:this.level?1e3*this.level.details.fragments[0].start:void 0}get videoCurrentTimeMs(){return 1e3*this.video.currentTime}get programDateTime(){if(this.level){let t=this.baseProgramDateTimeMs+this.videoCurrentTimeMs-this.fragmentStartMs;return new Date(t)}}}var ft,Zt,Js,zp,Hp,qp,Uc,Nn,ur,Ys;function ea(e){let t=[];return{queueArray:t,hasNextItem:()=>t.length>0,dequeueItem:()=>t.shift(),enqueueItem:(n,r)=>{const{payload:o}=n;(o.id?t.findIndex((l=>l.payload.id===o.id)):-1)===-1&&(t.push(n),e&&e.currentTimecode&&t.sort(((l,u)=>xp(l.payload,u.payload))),r&&r())},isNextItemReady:()=>{if(!e||!e.currentTimecode)return!0;if(e.ready)return e.ready(t[0].payload);const n=t[0].payload.program_date_time&&xc(t[0].payload.program_date_time)&&new Date(Qs(t[0].payload.program_date_time)),r=xc(e.currentTimecode)&&new Date(Qs(e.currentTimecode));return ee.logger&&console.log("syncTime >= pdt",r>=n),!n||!r||r>=n},deleteItem:(n,r)=>{const o=t.find(r);if(o){const c=t.indexOf(o);c!==-1&&t.splice(c,1)}}}}(function(e){e.INFO="info",e.ERROR="error"})(ft||(ft={})),(function(e){e.DELETE_MESSAGE="delete-message"})(Zt||(Zt={})),(function(e){e.ACTIVE="active",e.REDEEMED="redeemed",e.INACTIVE="inactive"})(Js||(Js={})),(function(e){e.BUILT_IN="built-in",e.CUSTOM="custom",e.SEGMENT="segment",e.MPARTICLE="mparticle"})(zp||(zp={})),(function(e){e.CHAT_ROOM="chat-room",e.USER_PROFILE="user-profile"})(Hp||(Hp={})),(function(e){e.CHAT_MESSAGE="chat-message"})(qp||(qp={})),(function(e){e.FILTERED="filtered",e.PROFANITY="profanity"})(Uc||(Uc={})),(function(e){e.OLDEST="created_at",e.NEWEST="-created_at",e.OLDEST_REPLIES="reply",e.NEWEST_REPLIES="-reply"})(Nn||(Nn={})),(function(e){e.FILTER="filter",e.MASK="mask",e.CUSTOM="custom"})(ur||(ur={})),(function(e){e.PENDING="pending",e.DISMISSED="dismissed"})(Ys||(Ys={}));const my=I`<style>:host{overflow:auto}.message-item-container{position:relative;margin:0 0 .5rem 0;display:flex;justify-content:flex-start}.message-item-container>.menu-button-container>.more-icon{opacity:0;transition:opacity ease .3s}.message-item-container:hover>.menu-button-container>.more-icon{opacity:1;transition:opacity ease .3s}.message-item-container .quote-message-item-container{margin:0 0 .3rem 0}.menu-button-container{display:flex;flex-direction:column;justify-content:center}.more-icon:focus{opacity:0;transition:opacity ease .3s}.message-item-container>.menu-button-container>.more-icon.active{opacity:1}.more-icon.active{opacity:1}.message-wrapper{display:inline-grid;opacity:1;transition:all .4s;background:rgba(0,0,0,.4);border-radius:.75rem;padding:.5rem 1rem;max-width:80%;position:relative}.message-wrapper:focus{outline:0}.avatar{display:flex;flex-direction:column;justify-content:flex-start;margin:0 .5rem 0 0}.avatar img,.avatar svg{width:3rem;height:3rem;margin:0;border-radius:50%}.sender-name{font-size:1rem;display:inline-block;color:inherit;margin:0 0 .25rem 0;word-break:break-word;word-wrap:break-word}.sender-message{font-size:1rem;display:flex;word-break:break-word;word-wrap:break-word;color:inherit;line-height:1.3;padding:0 .25rem .25rem 0;flex-wrap:wrap}.sender-message.deleted{font-style:oblique;color:inherit}.word-item{align-self:flex-end}.image-message-container{max-width:480px}.image-message{max-width:100%;height:auto;border-radius:.5rem}.message-timestamp{font-size:.8rem}.more-icon{background:0 0;border:none;margin:1rem 0;display:flex;align-items:center;padding:0 1rem}.more-icon:hover{cursor:pointer}.more-icon svg{fill:#777}.more-icon:hover svg{fill:#555}.no-message-container{height:100%;position:relative;display:flex;justify-content:center}.no-messages{margin:0;color:#fff;position:absolute;top:50%}</style>`,gy=I`<svg width="24" height="24" viewBox="0 0 24 24"><path d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"/></svg>`,fy=I`<svg width="24" height="24" viewBox="0 0 24 24"><path d="M16.67 0l2.83 2.829-9.339 9.175 9.339 9.167-2.83 2.829-12.17-11.996z"/></svg>`,yy=I`<svg viewBox="0 0 512 512" height="12" width="12"><path d="M98.9,184.7l1.8,2.1l136,156.5c4.6,5.3,11.5,8.6,19.2,8.6c7.7,0,14.6-3.4,19.2-8.6L411,187.1l2.3-2.6 c1.7-2.5,2.7-5.5,2.7-8.7c0-8.7-7.4-15.8-16.6-15.8v0H112.6v0c-9.2,0-16.6,7.1-16.6,15.8C96,179.1,97.1,182.2,98.9,184.7z"/></svg>`,Gp=I`<svg width="18" height="18" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.4811 0.337704C11.6892 0.330221 11.8911 0.409621 12.0384 0.55689L23.6059 12.1244C23.7532 12.2717 23.8326 12.4736 23.8251 12.6817C23.5957 19.0616 18.352 24.1628 11.9165 24.1628C5.33518 24.1628 0 18.8276 0 12.2463C0 5.81082 5.10122 0.567075 11.4811 0.337704ZM10.3665 1.94437C5.34895 2.69277 1.5 7.02022 1.5 12.2463C1.5 17.9992 6.16361 22.6628 11.9165 22.6628C17.1426 22.6628 21.47 18.8139 22.2184 13.7963C21.3164 14.0827 20.3561 14.2371 19.3608 14.2371C14.1499 14.2371 9.92574 10.0129 9.92574 4.80204C9.92574 3.80668 10.0801 2.84638 10.3665 1.94437ZM11.7871 2.42693C11.5524 3.17627 11.4257 3.97388 11.4257 4.80204C11.4257 9.18443 14.9784 12.7371 19.3608 12.7371C20.1889 12.7371 20.9865 12.6104 21.7359 12.3757L11.7871 2.42693Z" fill="white"/></svg>`,vy=I`<svg width="4" height="20" viewBox="0 0 3 15"><path fill-rule="nonzero" d="M1.5 12a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm0-6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm0-6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3z"/></svg>`,by=I`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_1464_2598)"><path opacity="0.12" d="M15.109 7.13782L8.84573 4.00621C6.13924 2.65296 4.78599 1.97634 4.07461 2.14899C3.28531 2.34055 2.69025 2.99044 2.5688 3.79352C2.45934 4.51732 3.25229 5.80586 4.83818 8.38294C5.17695 8.93344 5.34634 9.20869 5.42163 9.50078C5.50603 9.82824 5.50603 10.1717 5.42163 10.4992C5.34634 10.7913 5.17695 11.0665 4.83818 11.617C3.25229 14.1941 2.45934 15.4827 2.5688 16.2065C2.69025 17.0095 3.28531 17.6594 4.07461 17.851C4.78599 18.0236 6.13924 17.347 8.84573 15.9938L15.109 12.8622C16.9514 11.9409 17.8726 11.4803 18.1682 10.857C18.4255 10.3146 18.4255 9.68535 18.1682 9.14294C17.8726 8.51964 16.9514 8.05904 15.109 7.13782Z" fill="white"/><path fill-rule="evenodd" clip-rule="evenodd" d="M9.18116 3.3354L9.15069 3.32016C7.82316 2.65639 6.78911 2.13937 5.99875 1.81237C5.59894 1.64695 5.23333 1.51806 4.90356 1.44419C4.57835 1.37134 4.23254 1.3389 3.89774 1.42016C2.81245 1.68356 1.99423 2.57715 1.82725 3.68139C1.77573 4.02203 1.83844 4.36365 1.93959 4.68121C2.04216 5.0032 2.20269 5.35607 2.40261 5.73979C2.79781 6.49835 3.40371 7.48294 4.18159 8.74699L4.19945 8.77602C4.56374 9.36799 4.65506 9.53158 4.69538 9.68799C4.74814 9.89265 4.74814 10.1073 4.69538 10.312C4.65506 10.4684 4.56374 10.632 4.19945 11.224L4.18158 11.253L4.18157 11.253C3.4037 12.5171 2.7978 13.5017 2.40261 14.2602C2.20269 14.6439 2.04216 14.9968 1.93959 15.3188C1.83844 15.6363 1.77573 15.978 1.82725 16.3186C1.99423 17.4228 2.81245 18.3164 3.89774 18.5798C4.23254 18.6611 4.57835 18.6287 4.90357 18.5558C5.23333 18.4819 5.59894 18.353 5.99875 18.1876C6.78907 17.8606 7.82305 17.3437 9.15049 16.6799L9.15063 16.6799L9.18116 16.6646L15.4444 13.533L15.4793 13.5156C16.3709 13.0698 17.0869 12.7118 17.6136 12.3855C18.1375 12.061 18.601 11.6948 18.8459 11.1784C19.1996 10.4326 19.1996 9.56737 18.8459 8.82156C18.601 8.30525 18.1375 7.93904 17.6136 7.61453C17.0869 7.28824 16.3709 6.93026 15.4793 6.48447L15.4444 6.46701L9.18116 3.3354ZM5.52813 8.07296L5.47694 7.98987C4.67752 6.69081 4.10026 5.75186 3.73289 5.04673C3.55002 4.69571 3.43372 4.42966 3.36884 4.22595C3.30253 4.0178 3.30717 3.92693 3.31038 3.90567C3.38629 3.40375 3.7582 2.99757 4.25152 2.87784C4.27241 2.87277 4.36252 2.86017 4.57569 2.90792C4.78431 2.95465 5.05956 3.04711 5.42529 3.19842C6.15998 3.50239 7.14603 3.99489 8.51033 4.67704L14.7736 7.80865C15.7081 8.27594 16.3622 8.6038 16.8237 8.88969C17.2949 9.1816 17.4398 9.35735 17.4906 9.46434C17.6514 9.80335 17.6514 10.1966 17.4906 10.5357C17.4398 10.6426 17.2949 10.8184 16.8237 11.1103C16.3622 11.3962 15.7081 11.7241 14.7736 12.1913L8.51034 15.323C7.14604 16.0051 6.15998 16.4976 5.42529 16.8016C5.05956 16.9529 4.78431 17.0454 4.57569 17.0921C4.36252 17.1398 4.27241 17.1272 4.25152 17.1222C3.7582 17.0024 3.38629 16.5963 3.31038 16.0943C3.30717 16.0731 3.30253 15.9822 3.36884 15.774C3.43372 15.5703 3.55002 15.3043 3.73289 14.9533C4.10026 14.2481 4.67752 13.3092 5.47694 12.0101L5.52813 11.927C5.80184 11.483 6.01967 11.1296 6.13043 10.75H9.16664C9.58085 10.75 9.91664 10.4142 9.91664 10C9.91664 9.58578 9.58085 9.25 9.16664 9.25H6.13043C6.01967 8.87038 5.80184 8.51699 5.52813 8.07297L5.52813 8.07296Z" fill="white"/></g><defs><clipPath id="clip0_1464_2598"><rect width="20" height="20" fill="white"/></clipPath></defs></svg>`,Wp=I`<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1"><g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><circle id="circle" fill="#000000" opacity="0.200000003" cx="9" cy="9" r="9"></circle><path d="M10.1443526,8.99976063 L12.7631923,11.617505 C13.0789359,11.9337699 13.0789359,12.4465365 12.7631923,12.7628014 C12.4474488,13.0790662 11.9355273,13.0790662 11.6197838,12.7628014 L9.00023937,10.1443526 L6.38249497,12.7631923 C6.06623012,13.0789359 5.55346349,13.0789359 5.23719864,12.7631923 C4.92093379,12.4474488 4.92093379,11.9355273 5.23719864,11.6197838 L7.85564741,9.00023937 L5.23680767,6.38249497 C4.92106411,6.06623012 4.92106411,5.55346349 5.23680767,5.23719864 C5.55255122,4.92093379 6.06447267,4.92093379 6.38021623,5.23719864 L8.99976063,7.85564741 L11.617505,5.23680767 C11.9337699,4.92106411 12.4465365,4.92106411 12.7628014,5.23680767 C13.0790662,5.55255122 13.0790662,6.06447267 12.7628014,6.38021623 L10.1443526,8.99976063 Z" id="x" fill="#FFFFFF" fill-rule="nonzero"></path></g></svg>`,_y=I`<svg width="64px" height="64px" viewBox="0 0 64 64"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g><g><rect id="Rectangle" fill="#505A64" x="0" y="0" width="64" height="64"/><path d="M31.9590262,14 C40.9427465,14 44.8185604,18.1297028 43.8568799,26.9807577 C42.8951994,35.8318125 39.1802051,40 31.9730147,40 C26.0823195,40 21.3936793,37.5331739 20.2595234,28.1644789 C19.1253676,18.7957839 21.4756955,14 31.9590262,14 Z" id="Path-2" fill="#8C96A0"/><path d="M8,64 C13.6440504,52.375041 21.5113023,46.3802666 31.6017556,46.0156768 C41.692209,45.651087 49.8249571,51.6458614 56,64 L8,64 Z" id="Path-3" fill="#8C96A0"/></g></g></g></svg>`,wy=I`<svg height="18" width="18" viewBox="0 0 64 64"><g id="Giphy"><rect fill="#00ff92" x="8.61" y="9.09" width="6.31" height="46.75"/><rect fill="#fff24d" x="8.61" y="3.06" width="26.37" height="6.46"/><rect fill="#00c9ff" x="8.73" y="55.23" width="45.68" height="6.46"/><rect fill="#971eff" x="48.1" y="22.62" width="6.31" height="32.62"/><polygon fill="#ff6562" points="47.81 16.2 47.81 9.8 41.28 9.8 41.28 3.05 34.74 3.05 34.74 16.2 34.74 22.62 41.28 22.62 54.41 22.62 54.41 16.2 47.81 16.2"/><polygon fill="#5d1498" points="48.1 22.62 54.41 22.62 48.1 29.09 48.1 22.62"/><polygon fill="#968f2d" points="34.74 9.44 34.74 3.14 28.27 9.44 34.74 9.44"/></g></svg>`,Cy=I`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="none" viewBox="0 0 36 36"><path fill="#fff" d="M24.675 20.215l3.825-2.43L12 7.285v.255l12.675 12.675zM4.215 4l-2.13 2.115L12 16.03v12.255l7.485-4.77 10.17 10.17 2.115-2.115L4.215 4zM15 22.825V19.03l2.325 2.325L15 22.825z"/></svg>`,Iy=I`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.35 5.36475e-08H10.3161C8.66462 -3.88026e-06 7.37922 -6.9797e-06 6.34814 0.084236C5.30124 0.169771 4.45065 0.345875 3.68556 0.735706C2.41547 1.38285 1.38285 2.41547 0.735706 3.68556C0.345875 4.45065 0.169771 5.30124 0.084236 6.34814C-6.9797e-06 7.37922 -3.88026e-06 8.66462 5.36475e-08 10.3161V10.35V13.4756V13.5095C-3.88026e-06 15.161 -6.9797e-06 16.4464 0.084236 17.4774C0.169771 18.5243 0.345875 19.3749 0.735706 20.14C1.38285 21.4101 2.41547 22.4427 3.68556 23.0899C4.45065 23.4797 5.30124 23.6558 6.34814 23.7413C7.37921 23.8256 8.66459 23.8256 10.316 23.8256H10.316H10.35H13.4756H13.5095H13.5096C15.161 23.8256 16.4464 23.8256 17.4774 23.7413C18.5243 23.6558 19.3749 23.4797 20.14 23.0899C21.4101 22.4427 22.4427 21.4101 23.0899 20.14C23.4797 19.3749 23.6558 18.5243 23.7413 17.4774C23.8256 16.4464 23.8256 15.161 23.8256 13.5096V13.5095V13.4756V10.35V10.316V10.316C23.8256 8.66459 23.8256 7.37921 23.7413 6.34814C23.6558 5.30124 23.4797 4.45065 23.0899 3.68556C22.4427 2.41547 21.4101 1.38285 20.14 0.735706C19.3749 0.345875 18.5243 0.169771 17.4774 0.084236C16.4464 -6.9797e-06 15.161 -3.88026e-06 13.5095 5.36475e-08H13.4756H10.35ZM4.36655 2.07222C4.88493 1.80809 5.51615 1.65721 6.47029 1.57925C7.43317 1.50058 8.65747 1.5 10.35 1.5H13.4756C15.1681 1.5 16.3924 1.50058 17.3553 1.57925C18.3094 1.65721 18.9406 1.80809 19.459 2.07222C20.4469 2.57555 21.25 3.3787 21.7534 4.36655C22.0175 4.88493 22.1684 5.51615 22.2463 6.47029C22.325 7.43317 22.3256 8.65747 22.3256 10.35V13.4756C22.3256 15.1681 22.325 16.3924 22.2463 17.3553C22.1684 18.3094 22.0175 18.9406 21.7534 19.459C21.25 20.4469 20.4469 21.25 19.459 21.7534C18.9406 22.0175 18.3094 22.1684 17.3553 22.2463C16.3924 22.325 15.1681 22.3256 13.4756 22.3256H10.35C8.65747 22.3256 7.43317 22.325 6.47029 22.2463C5.51615 22.1684 4.88493 22.0175 4.36655 21.7534C3.3787 21.25 2.57555 20.4469 2.07222 19.459C1.80809 18.9406 1.65721 18.3094 1.57925 17.3553C1.50058 16.3924 1.5 15.1681 1.5 13.4756V10.35C1.5 8.65747 1.50058 7.43317 1.57925 6.47029C1.65721 5.51615 1.80809 4.88493 2.07222 4.36655C2.57555 3.3787 3.3787 2.57555 4.36655 2.07222ZM11.9128 6.69769C12.327 6.69769 12.6628 7.03347 12.6628 7.44769V11.1628H16.3779C16.7921 11.1628 17.1279 11.4986 17.1279 11.9128C17.1279 12.327 16.7921 12.6628 16.3779 12.6628H12.6628V16.3779C12.6628 16.7921 12.327 17.1279 11.9128 17.1279C11.4986 17.1279 11.1628 16.7921 11.1628 16.3779V12.6628H7.44767C7.03346 12.6628 6.69767 12.327 6.69767 11.9128C6.69767 11.4986 7.03346 11.1628 7.44767 11.1628H11.1628V7.44769C11.1628 7.03347 11.4986 6.69769 11.9128 6.69769Z" fill="#E5E6EE"/></svg>`,ky=I`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="comment-2-dots"><path id="Tone" opacity="0.12" d="M9.99999 18.3333C14.6024 18.3333 18.3333 14.6024 18.3333 10C18.3333 5.39763 14.6024 1.66667 9.99999 1.66667C5.39762 1.66667 1.66666 5.39763 1.66666 10C1.66666 11.2492 1.94178 12.4341 2.43449 13.4977C2.82357 14.3376 3.19184 15.0537 2.92044 15.9981C2.7899 16.4524 2.46273 16.8998 2.42388 17.3729C2.37944 17.9139 2.85589 18.3523 3.39136 18.2631C4.48158 18.0815 5.00633 17.2145 6.27126 17.512C6.40835 17.5443 6.76565 17.6721 7.48022 17.9277C8.23627 18.1981 9.05052 18.3333 9.99999 18.3333Z" fill="white"/><path id="Icon" fill-rule="evenodd" clip-rule="evenodd" d="M2.41666 10C2.41666 5.81185 5.81183 2.41667 9.99999 2.41667C14.1882 2.41667 17.5833 5.81185 17.5833 10C17.5833 14.1882 14.1882 17.5833 9.99999 17.5833C9.12517 17.5833 8.3977 17.4593 7.73283 17.2215L7.61191 17.1782C7.00387 16.9606 6.62248 16.8241 6.44296 16.7819L6.44295 16.7819C5.5838 16.5799 4.95512 16.7875 4.44387 17.0305C4.30195 17.0979 4.18092 17.1597 4.07194 17.2154C3.7742 17.3675 3.56635 17.4736 3.2681 17.5233C3.21456 17.5322 3.16692 17.4884 3.17136 17.4343C3.17934 17.3372 3.22088 17.2093 3.32119 16.9874C3.33562 16.9555 3.35224 16.9198 3.37029 16.881L3.37031 16.8809L3.37032 16.8809C3.45499 16.6989 3.57118 16.4492 3.64127 16.2053C3.97977 15.0274 3.54178 14.0933 3.18632 13.3352L3.18625 13.335C3.16203 13.2834 3.13819 13.2325 3.11501 13.1825C2.6671 12.2156 2.41666 11.138 2.41666 10ZM9.99999 0.916672C4.9834 0.916672 0.916656 4.98342 0.916656 10C0.916656 11.3603 1.21645 12.6527 1.75396 13.813L1.76097 13.8281C2.17109 14.7134 2.37981 15.164 2.19962 15.791C2.16477 15.9122 2.11206 16.0265 2.03365 16.1964L2.0336 16.1965C2.00966 16.2484 1.98332 16.3055 1.95436 16.3695C1.84873 16.6032 1.70727 16.9355 1.67639 17.3115C1.59196 18.3395 2.49723 19.1724 3.51462 19.0029C4.06637 18.911 4.54364 18.6641 4.87619 18.4921C4.95518 18.4512 5.026 18.4146 5.08772 18.3853C5.42763 18.2237 5.69378 18.1467 6.09956 18.2421L6.10521 18.2436L6.12336 18.2487C6.13942 18.2534 6.16074 18.2599 6.18843 18.2688C6.24417 18.2867 6.31766 18.3114 6.41333 18.3446C6.60489 18.4111 6.86877 18.5055 7.22761 18.6338C8.07484 18.9369 8.97587 19.0833 9.99999 19.0833C15.0166 19.0833 19.0833 15.0166 19.0833 10C19.0833 4.98342 15.0166 0.916672 9.99999 0.916672ZM6.66666 10.8333C7.12689 10.8333 7.49999 10.4602 7.49999 10C7.49999 9.53977 7.12689 9.16667 6.66666 9.16667C6.20642 9.16667 5.83332 9.53977 5.83332 10C5.83332 10.4602 6.20642 10.8333 6.66666 10.8333ZM10.8333 10C10.8333 10.4602 10.4602 10.8333 9.99999 10.8333C9.53975 10.8333 9.16666 10.4602 9.16666 10C9.16666 9.53977 9.53975 9.16667 9.99999 9.16667C10.4602 9.16667 10.8333 9.53977 10.8333 10ZM13.3333 10.8333C13.7936 10.8333 14.1667 10.4602 14.1667 10C14.1667 9.53977 13.7936 9.16667 13.3333 9.16667C12.8731 9.16667 12.5 9.53977 12.5 10C12.5 10.4602 12.8731 10.8333 13.3333 10.8333Z" fill="white"/></g></svg>`,Ey=I`<svg width="7" height="14" viewBox="0 0 7 14" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="Group 673"><path id="Polygon 1" d="M3.5 0L6.53109 5.25H0.468911L3.5 0Z" fill="white"/><path id="Polygon 2" d="M3.5 13.125L0.468911 7.875L6.53109 7.875L3.5 13.125Z" fill="white"/></g></svg>`,Sy=I`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="Block" clip-path="url(#clip0_923_13315)"><rect id="Tone" opacity="0.12" x="1.66663" y="1.66669" width="16.6667" height="16.6667" rx="8.33333" fill="#212333"/><path id="Icon" fill-rule="evenodd" clip-rule="evenodd" d="M5.19399 4.13336C8.17282 1.68712 12.5797 1.85526 15.3622 4.63778C18.1447 7.4203 18.3129 11.8272 15.8667 14.806L10.5852 9.52458L5.19399 4.13336ZM4.13333 5.19402C1.68711 8.17285 1.85526 12.5797 4.63777 15.3622C7.42029 18.1447 11.8272 18.3129 14.806 15.8667L9.52455 10.5852L4.13333 5.19402ZM16.4229 3.57712C12.8756 0.02986 7.12438 0.02986 3.57711 3.57712C0.0298516 7.12438 0.0298516 12.8756 3.57711 16.4229C7.12438 19.9702 12.8756 19.9702 16.4229 16.4229C19.9701 12.8756 19.9701 7.12438 16.4229 3.57712Z" fill="white"/></g><defs><clipPath id="clip0_923_13315"><rect width="20" height="20" fill="white"/></clipPath></defs></svg>`,Py=I`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="trash-2"><path id="Tone" opacity="0.12" d="M3.82416 12.5101L3.33337 4.16669H16.6667L16.1759 12.5101V12.5101C16.0624 14.4402 16.0056 15.4053 15.6243 16.1521C15.2046 16.9742 14.5135 17.6259 13.6682 17.9966C12.9003 18.3334 11.9335 18.3334 10 18.3334C8.06656 18.3334 7.09982 18.3334 6.3319 17.9966C5.48656 17.6259 4.79544 16.9742 4.37573 16.1521C3.99447 15.4053 3.9377 14.4402 3.82416 12.5101Z" fill="white"/><path id="Icon" fill-rule="evenodd" clip-rule="evenodd" d="M9.22978 0.916656L9.12098 0.916548C8.60838 0.915783 8.15847 0.915111 7.75758 1.07278C7.40705 1.21064 7.09673 1.43431 6.85509 1.72326C6.57874 2.05372 6.43711 2.48075 6.27573 2.96729L6.24143 3.07054L6.12606 3.41666H3.33329H1.66663C1.25241 3.41666 0.916626 3.75244 0.916626 4.16666C0.916626 4.58087 1.25241 4.91666 1.66663 4.91666H2.62611L3.07538 12.5541L3.07708 12.5831C3.1324 13.5236 3.1763 14.27 3.25592 14.873C3.3374 15.4901 3.46231 16.0125 3.70766 16.4931C4.20606 17.4694 5.02677 18.2432 6.03062 18.6834C6.52479 18.9001 7.05366 18.9942 7.67446 19.0393C8.28105 19.0833 9.02873 19.0833 9.97085 19.0833H9.9709H9.99996H10.029H10.0291C10.9712 19.0833 11.7189 19.0833 12.3255 19.0393C12.9463 18.9942 13.4751 18.9001 13.9693 18.6834C14.9731 18.2432 15.7939 17.4694 16.2923 16.4931C16.5376 16.0125 16.6625 15.4901 16.744 14.873C16.8236 14.2701 16.8675 13.5237 16.9228 12.5832L16.9228 12.5831L16.9245 12.5541L17.3738 4.91666H18.3333C18.7475 4.91666 19.0833 4.58087 19.0833 4.16666C19.0833 3.75244 18.7475 3.41666 18.3333 3.41666H16.6666H13.8739L13.7585 3.07054L13.7242 2.96729C13.5628 2.48075 13.4212 2.05372 13.1448 1.72326C12.9032 1.43431 12.5929 1.21064 12.2423 1.07278C11.8414 0.915111 11.3915 0.915783 10.8789 0.916548L10.7701 0.916656H9.22978ZM13.3158 4.91666C13.3274 4.91693 13.339 4.91693 13.3506 4.91666H15.8712L15.4271 12.466C15.3697 13.442 15.3286 14.134 15.2569 14.6766C15.1863 15.2113 15.0922 15.5448 14.9563 15.8111C14.6153 16.479 14.0537 17.0085 13.3669 17.3097C13.0931 17.4298 12.7547 17.5041 12.2168 17.5432C11.6709 17.5829 10.9776 17.5833 9.99996 17.5833C9.02232 17.5833 8.32904 17.5829 7.78315 17.5432C7.24523 17.5041 6.90678 17.4298 6.63303 17.3097C5.94618 17.0085 5.38465 16.479 5.04364 15.8111C4.90772 15.5448 4.81362 15.2113 4.74301 14.6766C4.67137 14.134 4.6302 13.442 4.57279 12.466L4.12871 4.91666H6.64936C6.66097 4.91693 6.67255 4.91693 6.68411 4.91666H13.3158ZM12.2925 3.41666C12.1108 2.87677 12.0585 2.76244 11.9942 2.68552C11.9136 2.58921 11.8102 2.51465 11.6933 2.4687C11.5931 2.42926 11.4562 2.41666 10.7701 2.41666H9.22978C8.54375 2.41666 8.40686 2.42926 8.30659 2.4687C8.18975 2.51465 8.08631 2.58921 8.00576 2.68552C7.94144 2.76244 7.88914 2.87677 7.70739 3.41666H12.2925Z" fill="white"/></g></svg>`,Oy=I`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="flag-2"><path id="Tone" opacity="0.12" d="M4.16663 12.5V3.33333L5.26622 3.05844C6.69646 2.70088 8.21016 2.92612 9.47433 3.68462C10.8658 4.5195 12.5526 4.70467 14.0921 4.19152L16.6666 3.33333V12.5L14.0921 13.3582C12.5526 13.8713 10.8658 13.6862 9.47433 12.8513C8.21016 12.0928 6.69646 11.8675 5.26622 12.2251L4.16663 12.5Z" fill="white"/><path id="Icon" fill-rule="evenodd" clip-rule="evenodd" d="M4.16663 0.916687C4.58084 0.916687 4.91663 1.25247 4.91663 1.66669V2.37277L5.08432 2.33085C6.70753 1.92505 8.42547 2.18068 9.8602 3.04152C11.0639 3.76376 12.5232 3.92394 13.8549 3.48003L16.4295 2.62184C16.6582 2.5456 16.9096 2.58396 17.1052 2.72492C17.3007 2.86589 17.4166 3.09227 17.4166 3.33335V12.5C17.4166 12.8228 17.2101 13.1094 16.9038 13.2115L14.3292 14.0697C12.5821 14.6521 10.6677 14.442 9.08845 13.4944C7.99485 12.8383 6.68539 12.6434 5.44812 12.9527L4.91663 13.0856V18.3334C4.91663 18.7476 4.58084 19.0834 4.16663 19.0834C3.75241 19.0834 3.41663 18.7476 3.41663 18.3334V12.5V3.33335V1.66669C3.41663 1.25247 3.75241 0.916687 4.16663 0.916687ZM4.91663 11.5394L5.08432 11.4975C6.70753 11.0917 8.42547 11.3473 9.8602 12.2082C11.0639 12.9304 12.5232 13.0906 13.8549 12.6467L15.9166 11.9595V4.37392L14.3292 4.90305C12.5821 5.48544 10.6677 5.27529 9.08845 4.32776C7.99485 3.6716 6.68539 3.47675 5.44812 3.78606L4.91663 3.91894V11.5394Z" fill="white"/></g></svg>`,Ry=I`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="More"><g id=". . ."><path d="M15.1535 8.0625C15.5626 8.0625 15.913 8.20644 16.2046 8.49432C16.4925 8.7822 16.6346 9.13068 16.6308 9.53977C16.6346 9.94129 16.4925 10.2841 16.2046 10.5682C15.913 10.8561 15.5626 11 15.1535 11C14.7671 11 14.4262 10.8561 14.1308 10.5682C13.8315 10.2841 13.68 9.94129 13.6762 9.53977C13.68 9.26705 13.752 9.01894 13.8921 8.79545C14.0285 8.57197 14.2084 8.39394 14.4319 8.26136C14.6516 8.12879 14.8921 8.0625 15.1535 8.0625Z" fill="#7A7B7C"/><path d="M9.81539 8.0625C10.2245 8.0625 10.5749 8.20644 10.8665 8.49432C11.1544 8.7822 11.2964 9.13068 11.2927 9.53977C11.2964 9.94129 11.1544 10.2841 10.8665 10.5682C10.5749 10.8561 10.2245 11 9.81539 11C9.42902 11 9.08811 10.8561 8.79266 10.5682C8.49342 10.2841 8.3419 9.94129 8.33811 9.53977C8.3419 9.26705 8.41387 9.01894 8.55402 8.79545C8.69039 8.57197 8.87031 8.39394 9.0938 8.26136C9.31349 8.12879 9.55402 8.0625 9.81539 8.0625Z" fill="#7A7B7C"/><path d="M4.47726 8.0625C4.88635 8.0625 5.23673 8.20644 5.5284 8.49432C5.81628 8.7822 5.95832 9.13068 5.95454 9.53977C5.95832 9.94129 5.81628 10.2841 5.5284 10.5682C5.23673 10.8561 4.88635 11 4.47726 11C4.0909 11 3.74999 10.8561 3.45454 10.5682C3.15529 10.2841 3.00378 9.94129 2.99999 9.53977C3.00378 9.26705 3.07575 9.01894 3.2159 8.79545C3.35226 8.57197 3.53219 8.39394 3.75567 8.26136C3.97537 8.12879 4.2159 8.0625 4.47726 8.0625Z" fill="#7A7B7C"/></g></g></svg>`,Ty=I`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M5 19.29L19.29 5M5 5L19.29 19.29" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,xy=I`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="arrow-left"><path id="Icon" fill-rule="evenodd" clip-rule="evenodd" d="M8.53033 4.46967C8.82323 4.76257 8.82322 5.23744 8.53033 5.53033L2.81067 11.2499H19C19.4142 11.2499 19.75 11.5857 19.75 11.9999C19.75 12.4141 19.4142 12.7499 19 12.7499H2.81066L8.53033 18.4696C8.82322 18.7625 8.82322 19.2374 8.53033 19.5303C8.23744 19.8232 7.76256 19.8232 7.46967 19.5303L0.46967 12.5303C0.329017 12.3896 0.25 12.1988 0.25 11.9999C0.25 11.801 0.329019 11.6102 0.469673 11.4696L7.46967 4.46967C7.76257 4.17678 8.23744 4.17678 8.53033 4.46967Z" fill="white"/></g></svg>`,Ay=I`<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30" fill="none"><g id="Group"><path id="Vector" d="M15 30C23.2843 30 30 23.2843 30 15C30 6.71573 23.2843 0 15 0C6.71573 0 0 6.71573 0 15C0 23.2843 6.71573 30 15 30Z" fill="url(#paint0_linear_832_16721)"/><g id="Group_2"><path id="Vector_2" d="M18.3868 9.83794C18.3868 11.7553 16.83 13.3121 14.9126 13.3121C12.9953 13.3121 11.4385 11.7553 11.4385 9.83794C11.4385 7.92061 12.9953 6.3638 14.9126 6.3638C16.83 6.3638 18.3868 7.91788 18.3868 9.83794Z" fill="white"/><g id="Group_3"><path id="Vector_3" d="M14.5247 23.6335H19.9189C20.2549 23.6335 20.5744 23.4068 20.7956 23.1555C21.0169 22.9015 21.1179 22.4836 21.077 22.1531L20.4706 17.3926C20.2631 15.7648 18.8783 14.5603 17.2341 14.5603H14.522" fill="white"/><path id="Vector_4" d="M14.9127 14.5603H12.7632C11.119 14.5603 9.73422 15.7648 9.52664 17.3926L8.92031 22.1531C8.87934 22.4863 8.98039 22.9042 9.20163 23.1555C9.42286 23.4068 9.74241 23.6335 10.0784 23.6335H14.9127" fill="white"/></g></g></g><defs><linearGradient id="paint0_linear_832_16721" x1="15" y1="1.75073" x2="15" y2="31.7507" gradientUnits="userSpaceOnUse"><stop stop-color="#32C88C"/><stop offset="1" stop-color="#21B7B0"/></linearGradient></defs></svg>`,My=I`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M6.36362 4.46967C6.65652 4.76256 6.65652 5.23744 6.36362 5.53033L3.47729 8.41667H12.9166C12.9623 8.41667 13.0073 8.41666 13.0517 8.41665C14.2397 8.4164 14.9967 8.41624 15.6376 8.59925C17.2161 9.05001 18.4499 10.2839 18.9007 11.8624C19.0837 12.5032 19.0836 13.2603 19.0833 14.4483C19.0833 14.4927 19.0833 14.5377 19.0833 14.5833V15C19.0833 15.4142 18.7475 15.75 18.3333 15.75C17.9191 15.75 17.5833 15.4142 17.5833 15V14.5833C17.5833 13.2142 17.576 12.6863 17.4584 12.2743C17.15 11.1942 16.3057 10.35 15.2257 10.0416C14.8137 9.92393 14.2858 9.91667 12.9166 9.91667H3.47729L6.36362 12.803C6.65652 13.0959 6.65652 13.5708 6.36362 13.8637C6.07073 14.1566 5.59586 14.1566 5.30296 13.8637L1.1363 9.697C0.995644 9.55634 0.916626 9.36558 0.916626 9.16667C0.916626 8.96775 0.995644 8.77699 1.1363 8.63634L5.30296 4.46967C5.59586 4.17678 6.07073 4.17678 6.36362 4.46967Z" fill="#7A7B7C"/></svg>`,Ly=I`<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30" fill="none"><path opacity="0.12" d="M11.25 15.7C11.25 14.5799 11.25 14.0198 11.468 13.592C11.6597 13.2157 11.9657 12.9097 12.342 12.718C12.7698 12.5 13.3299 12.5 14.45 12.5H24.3C25.4201 12.5 25.9802 12.5 26.408 12.718C26.7843 12.9097 27.0903 13.2157 27.282 13.592C27.5 14.0198 27.5 14.5799 27.5 15.7V25.4545C27.5 26.6963 26.0128 27.3336 25.1136 26.4773C24.2383 25.6436 23.0757 25.1786 21.8669 25.1786H14.45C13.3299 25.1786 12.7698 25.1786 12.342 24.9606C11.9657 24.7688 11.6597 24.4629 11.468 24.0866C11.25 23.6587 11.25 23.0987 11.25 21.9786V15.7Z" fill="white"/><path fill-rule="evenodd" clip-rule="evenodd" d="M17.7 1.75L17.7321 1.75C18.5449 1.74999 19.2006 1.74999 19.7315 1.79336C20.2781 1.83803 20.7582 1.93239 21.2025 2.15873C21.9081 2.51825 22.4817 3.09193 22.8413 3.79754C23.0676 4.24175 23.162 4.7219 23.2066 5.26853C23.25 5.79944 23.25 6.45506 23.25 7.2679V7.3V8.75V9.375C23.25 9.78921 22.9142 10.125 22.5 10.125C22.0858 10.125 21.75 9.78921 21.75 9.375V8.75V7.3C21.75 6.44755 21.7494 5.85331 21.7116 5.39068C21.6745 4.9368 21.6054 4.67604 21.5048 4.47852C21.289 4.05516 20.9448 3.71095 20.5215 3.49524C20.324 3.3946 20.0632 3.32547 19.6093 3.28838C19.1467 3.25058 18.5525 3.25 17.7 3.25H7.3C6.44755 3.25 5.85331 3.25058 5.39068 3.28838C4.9368 3.32547 4.67604 3.3946 4.47852 3.49524C4.05516 3.71095 3.71095 4.05516 3.49524 4.47852C3.3946 4.67604 3.32546 4.9368 3.28838 5.39068C3.25058 5.85331 3.25 6.44755 3.25 7.3V17.2321C3.25 17.6748 3.25024 17.9773 3.26205 18.2034C3.27427 18.4373 3.29664 18.5108 3.3023 18.5252C3.4428 18.8814 3.82917 19.0746 4.1985 18.9733C4.21337 18.9692 4.28557 18.943 4.48006 18.8124C4.66801 18.6862 4.91015 18.5049 5.26429 18.2393L5.30024 18.2123C5.71335 17.9025 5.96763 17.7117 6.23837 17.5515C6.94234 17.1349 7.72709 16.8733 8.54021 16.7842C8.85292 16.75 9.17077 16.75 9.68715 16.75H9.68718L9.73214 16.75H10.5V15.7V15.6696C10.5 15.1354 10.5 14.6896 10.5297 14.3253C10.5608 13.9454 10.6279 13.5888 10.7997 13.2515C11.0634 12.7341 11.4841 12.3134 12.0015 12.0497C12.3388 11.8779 12.6954 11.8108 13.0753 11.7797C13.4396 11.75 13.8854 11.75 14.4196 11.75H14.45H24.3H24.3304C24.8646 11.75 25.3104 11.75 25.6747 11.7797C26.0546 11.8108 26.4112 11.8779 26.7485 12.0497C27.2659 12.3134 27.6866 12.7341 27.9503 13.2515C28.1221 13.5888 28.1892 13.9454 28.2203 14.3253C28.25 14.6896 28.25 15.1354 28.25 15.6695V15.7V25.4545C28.25 27.3557 25.9731 28.3315 24.5964 27.0204C23.8605 26.3195 22.8831 25.9286 21.8669 25.9286H14.45H14.4195H14.4194C13.8853 25.9286 13.4395 25.9286 13.0753 25.8988C12.6954 25.8678 12.3388 25.8007 12.0015 25.6288C11.4841 25.3652 11.0634 24.9445 10.7997 24.427C10.6279 24.0898 10.5608 23.7331 10.5297 23.3532C10.5 22.989 10.5 22.5432 10.5 22.009V21.9786V18.25H9.73214C9.15704 18.25 8.92507 18.251 8.70364 18.2753C8.10263 18.3412 7.5226 18.5345 7.00227 18.8424C6.81057 18.9559 6.62437 19.0942 6.16429 19.4393L6.1475 19.4519L6.14738 19.452C5.81428 19.7018 5.54069 19.907 5.31624 20.0577C5.09455 20.2066 4.85557 20.3484 4.59551 20.4198C3.48752 20.7239 2.3284 20.1443 1.90689 19.0755C1.80795 18.8246 1.77802 18.5483 1.7641 18.2816C1.74999 18.0116 1.75 17.6696 1.75 17.2532V17.2532V17.2321V7.3V7.26788C1.74999 6.45505 1.74999 5.79944 1.79336 5.26853C1.83803 4.7219 1.93238 4.24175 2.15873 3.79754C2.51825 3.09193 3.09193 2.51825 3.79754 2.15873C4.24175 1.93239 4.7219 1.83803 5.26853 1.79336C5.79944 1.74999 6.45506 1.74999 7.2679 1.75L7.3 1.75H17.7ZM12 17.5017V21.9786C12 22.551 12.0006 22.9352 12.0248 23.2311C12.0482 23.5182 12.0901 23.6555 12.1362 23.7461C12.2561 23.9813 12.4473 24.1725 12.6825 24.2923C12.7731 24.3385 12.9104 24.3804 13.1975 24.4038C13.4934 24.428 13.8776 24.4286 14.45 24.4286H21.8669C23.2683 24.4286 24.616 24.9677 25.6309 25.9342C26.0526 26.3358 26.75 26.0369 26.75 25.4545V15.7C26.75 15.1276 26.7494 14.7434 26.7252 14.4475C26.7018 14.1604 26.6599 14.0231 26.6138 13.9325C26.4939 13.6973 26.3027 13.5061 26.0675 13.3862C25.9769 13.3401 25.8396 13.2982 25.5525 13.2748C25.2566 13.2506 24.8724 13.25 24.3 13.25H14.45C13.8776 13.25 13.4934 13.2506 13.1975 13.2748C12.9104 13.2982 12.7731 13.3401 12.6825 13.3862C12.4473 13.5061 12.2561 13.6973 12.1362 13.9325C12.0901 14.0231 12.0482 14.1604 12.0248 14.4475C12.0006 14.7434 12 15.1276 12 15.7V17.4983C12 17.4989 12 17.4994 12 17.5C12 17.5006 12 17.5011 12 17.5017Z" fill="white"/></svg>`,$y=I`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="17" viewBox="0 0 18 17" fill="none"><path d="M8.92743 16.1514H4.14864C2.418 16.1514 1 14.7334 1 13.0028V4.14864C1 2.418 2.418 1 4.14864 1H13.0028C14.7334 1 16.1514 2.418 16.1514 4.14864V9.07258" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M5.09778 7.60992C5.74526 7.60992 6.27015 7.08503 6.27015 6.43755C6.27015 5.79007 5.74526 5.26519 5.09778 5.26519C4.4503 5.26519 3.92542 5.79007 3.92542 6.43755C3.92542 7.08503 4.4503 7.60992 5.09778 7.60992Z" fill="white"/><path d="M11.5736 7.60992C12.2211 7.60992 12.746 7.08503 12.746 6.43755C12.746 5.79007 12.2211 5.26519 11.5736 5.26519C10.9261 5.26519 10.4012 5.79007 10.4012 6.43755C10.4012 7.08503 10.9261 7.60992 11.5736 7.60992Z" fill="white"/><path d="M8.33568 12.6008C9.47031 12.6008 10.3901 11.681 10.3901 10.5464C10.3901 9.41178 9.47031 8.49198 8.33568 8.49198C7.20105 8.49198 6.28125 9.41178 6.28125 10.5464C6.28125 11.681 7.20105 12.6008 8.33568 12.6008Z" fill="white"/><path d="M17 13.7397H12.0314" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.51 16.2296V11.261" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,Vy=I`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M5.197 1.21967C5.48989 1.51256 5.48989 1.98744 5.197 2.28033L3.56066 3.91667L5.85275 3.91667H5.88575C6.97698 3.91666 7.84181 3.91666 8.539 3.97366C9.252 4.03195 9.85534 4.15358 10.4065 4.43439C11.3002 4.88979 12.0269 5.61644 12.4823 6.51021C12.7631 7.06142 12.8847 7.6652 12.943 8.37881C13 9.07668 13 9.94255 13 11.0352V11.0682V11.0713V11.0745V11.0776V11.0808V11.0839V11.087V11.0902V11.0933V11.0964V11.0996V11.1027V11.1058V11.1089V11.112V11.1151V11.1182V11.1213V11.1244V11.1275V11.1306V11.1337V11.1368V11.1399V11.143V11.1461V11.1492V11.1522V11.1553V11.1584V11.1615V11.1645V11.1676V11.1706V11.1737V11.1768V11.1798V11.1829V11.1859V11.189V11.192V11.195V11.1981V11.2011V11.2041V11.2072V11.2102V11.2132V11.2162V11.2192V11.2223V11.2253V11.2283V11.2313V11.2343V11.2373V11.2403V11.2433V11.2463V11.2493V11.2522V11.2552V11.2582V11.2612V11.2642V11.2671V11.2701V11.2731V11.276V11.279V11.2819V11.2849V11.2878V11.2908V11.2937V11.2967V11.2996V11.3026V11.3055V11.3084V11.3114V11.3143V11.3172V11.3201V11.323V11.3259V11.3289V11.3318V11.3347V11.3376V11.3405V11.3434V11.3463V11.3491V11.352V11.3549V11.3578V11.3607V11.3635V11.3664V11.3693V11.3722V11.375V11.3779V11.3807V11.3836V11.3864V11.3893V11.3921V11.395V11.3978V11.4006V11.4035V11.4063V11.4091V11.4119V11.4148V11.4176V11.4204V11.4232V11.426V11.4288V11.4316V11.4344V11.4372V11.44V11.4428V11.4456V11.4484V11.4511V11.4539V11.4567V11.4595V11.4622V11.465V11.4678V11.4705V11.4733V11.476V11.4788V11.4815V11.4843V11.487V11.4897V11.4925V11.4952V11.4979V11.5006V11.5034V11.5061V11.5088V11.5115V11.5142V11.5169V11.5196V11.5223V11.525V11.5277V11.5304V11.5331V11.5357V11.5384V11.5411V11.5438V11.5464V11.5491V11.5518V11.5544V11.5571V11.5597V11.5624V11.565V11.5677V11.5703V11.5729V11.5756V11.5782V11.5808V11.5834V11.5861V11.5887V11.5913V11.5939V11.5965V11.5991V11.6017V11.6043V11.6069V11.6095V11.6121V11.6147V11.6172V11.6198V11.6224V11.625V11.6275V11.6301V11.6326V11.6352V11.6377V11.6403V11.6428V11.6454V11.6479V11.6505V11.653V11.6555V11.658V11.6606V11.6631V11.6656V11.6681V11.6706V11.6731V11.6756V11.6781V11.6806V11.6831V11.6856V11.6881V11.6905V11.693V11.6955V11.698V11.7004V11.7029V11.7054V11.7078V11.7103V11.7127V11.7152V11.7176V11.72V11.7225V11.7249V11.7273V11.7297V11.7322V11.7346V11.737V11.7394V11.7418V11.7442V11.7466V11.749V11.7514V11.7538V11.7562V11.7586V11.7609V11.7633V11.7657V11.768V11.7704V11.7728V11.7751V11.7775V11.7798V11.7822V11.7845V11.7868V11.7892V11.7915V11.7938V11.7962V11.7985V11.8008V11.8031V11.8054V11.8077V11.81V11.8123V11.8146V11.8169V11.8192V11.8215V11.8238V11.826V11.8283V11.8306V11.8328V11.8351V11.8374V11.8396V11.8419V11.8441V11.8463V11.8486V11.8508V11.8531V11.8553V11.8575V11.8597V11.8619V11.8642V11.8664V11.8686V11.8708V11.873V11.8752V11.8773V11.8795V11.8817V11.8839V11.8861V11.8882V11.8904V11.8926V11.8947V11.8969V11.899V11.9012V11.9033V11.9055V11.9076V11.9097V11.9119V11.914V11.9161V11.9182V11.9203V11.9225V11.9246V11.9267V11.9288V11.9309V11.9329V11.935V11.9371V11.9392V11.9413V11.9433V11.9454V11.9475V11.9495V11.9516V11.9536V11.9557V11.9577V11.9598V11.9618V11.9638V11.9659V11.9679V11.9699V11.9719V11.9739V11.9759V11.9779V11.9799V11.9819V11.9839V11.9859V11.9879V11.9899V11.9919V11.9938V11.9958V11.9978V11.9997V12.0017V12.0036V12.0056V12.0075V12.0095V12.0114V12.0133V12.0152V12.0172V12.0191V12.021V12.0229V12.0248V12.0267V12.0286V12.0305V12.0324V12.0343V12.0362V12.0381V12.0399V12.0418V12.0437V12.0455V12.0474V12.0493V12.0511V12.0529V12.0548V12.0566V12.0585V12.0603V12.0621V12.0639V12.0658V12.0676V12.0694V12.0712V12.073V12.0748V12.0766V12.0784V12.0801V12.0819V12.0837V12.0855V12.0872V12.089V12.0908V12.0925V12.0943V12.096V12.0978V12.0995V12.1012V12.103V12.1047V12.1064V12.1081V12.1098V12.1115V12.1132V12.1149V12.1166V12.1183V12.12V12.1217V12.1234V12.125V12.1267V12.1284V12.13V12.1317V12.1334V12.135V12.1366V12.1383V12.1399V12.1416V12.1432V12.1448V12.1464V12.148V12.1496V12.1512V12.1528V12.1544V12.156V12.1576V12.1592V12.1608V12.1624V12.1639V12.1655V12.1671V12.1686V12.1702V12.1717V12.1733V12.1748V12.1763V12.1779V12.1794V12.1809V12.1824V12.1839V12.1855V12.187V12.1885V12.19V12.1914V12.1929V12.1944V12.1959V12.1974V12.1988V12.2003V12.2018V12.2032V12.2047V12.2061V12.2075V12.209V12.2104V12.2118V12.2133V12.2147V12.2161V12.2175V12.2189V12.2203V12.2217V12.2231V12.2245V12.2259V12.2273V12.2286V12.23V12.2314V12.2327V12.2341V12.2354V12.2368V12.2381V12.2395V12.2408V12.2421V12.2434V12.2448V12.2461V12.2474V12.2487V12.25C13 12.6642 12.6642 13 12.25 13C11.8358 13 11.5 12.6642 11.5 12.25V12.2487V12.2474V12.2461V12.2448V12.2434V12.2421V12.2408V12.2395V12.2381V12.2368V12.2354V12.2341V12.2327V12.2314V12.23V12.2286V12.2273V12.2259V12.2245V12.2231V12.2217V12.2203V12.2189V12.2175V12.2161V12.2147V12.2133V12.2118V12.2104V12.209V12.2075V12.2061V12.2047V12.2032V12.2018V12.2003V12.1988V12.1974V12.1959V12.1944V12.1929V12.1914V12.19V12.1885V12.187V12.1855V12.1839V12.1824V12.1809V12.1794V12.1779V12.1763V12.1748V12.1733V12.1717V12.1702V12.1686V12.1671V12.1655V12.1639V12.1624V12.1608V12.1592V12.1576V12.156V12.1544V12.1528V12.1512V12.1496V12.148V12.1464V12.1448V12.1432V12.1416V12.1399V12.1383V12.1366V12.135V12.1334V12.1317V12.13V12.1284V12.1267V12.125V12.1234V12.1217V12.12V12.1183V12.1166V12.1149V12.1132V12.1115V12.1098V12.1081V12.1064V12.1047V12.103V12.1012V12.0995V12.0978V12.096V12.0943V12.0925V12.0908V12.089V12.0872V12.0855V12.0837V12.0819V12.0801V12.0784V12.0766V12.0748V12.073V12.0712V12.0694V12.0676V12.0658V12.0639V12.0621V12.0603V12.0585V12.0566V12.0548V12.0529V12.0511V12.0493V12.0474V12.0455V12.0437V12.0418V12.0399V12.0381V12.0362V12.0343V12.0324V12.0305V12.0286V12.0267V12.0248V12.0229V12.021V12.0191V12.0172V12.0152V12.0133V12.0114V12.0095V12.0075V12.0056V12.0036V12.0017V11.9997V11.9978V11.9958V11.9938V11.9919V11.9899V11.9879V11.9859V11.9839V11.9819V11.9799V11.9779V11.9759V11.9739V11.9719V11.9699V11.9679V11.9659V11.9638V11.9618V11.9598V11.9577V11.9557V11.9536V11.9516V11.9495V11.9475V11.9454V11.9433V11.9413V11.9392V11.9371V11.935V11.9329V11.9309V11.9288V11.9267V11.9246V11.9225V11.9203V11.9182V11.9161V11.914V11.9119V11.9097V11.9076V11.9055V11.9033V11.9012V11.899V11.8969V11.8947V11.8926V11.8904V11.8882V11.8861V11.8839V11.8817V11.8795V11.8773V11.8752V11.873V11.8708V11.8686V11.8664V11.8642V11.8619V11.8597V11.8575V11.8553V11.8531V11.8508V11.8486V11.8463V11.8441V11.8419V11.8396V11.8374V11.8351V11.8328V11.8306V11.8283V11.826V11.8238V11.8215V11.8192V11.8169V11.8146V11.8123V11.81V11.8077V11.8054V11.8031V11.8008V11.7985V11.7962V11.7938V11.7915V11.7892V11.7868V11.7845V11.7822V11.7798V11.7775V11.7751V11.7728V11.7704V11.768V11.7657V11.7633V11.7609V11.7586V11.7562V11.7538V11.7514V11.749V11.7466V11.7442V11.7418V11.7394V11.737V11.7346V11.7322V11.7297V11.7273V11.7249V11.7225V11.72V11.7176V11.7152V11.7127V11.7103V11.7078V11.7054V11.7029V11.7004V11.698V11.6955V11.693V11.6905V11.6881V11.6856V11.6831V11.6806V11.6781V11.6756V11.6731V11.6706V11.6681V11.6656V11.6631V11.6606V11.658V11.6555V11.653V11.6505V11.6479V11.6454V11.6428V11.6403V11.6377V11.6352V11.6326V11.6301V11.6275V11.625V11.6224V11.6198V11.6172V11.6147V11.6121V11.6095V11.6069V11.6043V11.6017V11.5991V11.5965V11.5939V11.5913V11.5887V11.5861V11.5834V11.5808V11.5782V11.5756V11.5729V11.5703V11.5677V11.565V11.5624V11.5597V11.5571V11.5544V11.5518V11.5491V11.5464V11.5438V11.5411V11.5384V11.5357V11.5331V11.5304V11.5277V11.525V11.5223V11.5196V11.5169V11.5142V11.5115V11.5088V11.5061V11.5034V11.5006V11.4979V11.4952V11.4925V11.4897V11.487V11.4843V11.4815V11.4788V11.476V11.4733V11.4705V11.4678V11.465V11.4622V11.4595V11.4567V11.4539V11.4511V11.4484V11.4456V11.4428V11.44V11.4372V11.4344V11.4316V11.4288V11.426V11.4232V11.4204V11.4176V11.4148V11.4119V11.4091V11.4063V11.4035V11.4006V11.3978V11.395V11.3921V11.3893V11.3864V11.3836V11.3807V11.3779V11.375V11.3722V11.3693V11.3664V11.3635V11.3607V11.3578V11.3549V11.352V11.3491V11.3463V11.3434V11.3405V11.3376V11.3347V11.3318V11.3289V11.3259V11.323V11.3201V11.3172V11.3143V11.3114V11.3084V11.3055V11.3026V11.2996V11.2967V11.2937V11.2908V11.2878V11.2849V11.2819V11.279V11.276V11.2731V11.2701V11.2671V11.2642V11.2612V11.2582V11.2552V11.2522V11.2493V11.2463V11.2433V11.2403V11.2373V11.2343V11.2313V11.2283V11.2253V11.2223V11.2192V11.2162V11.2132V11.2102V11.2072V11.2041V11.2011V11.1981V11.195V11.192V11.189V11.1859V11.1829V11.1798V11.1768V11.1737V11.1706V11.1676V11.1645V11.1615V11.1584V11.1553V11.1522V11.1492V11.1461V11.143V11.1399V11.1368V11.1337V11.1306V11.1275V11.1244V11.1213V11.1182V11.1151V11.112V11.1089V11.1058V11.1027V11.0996V11.0964V11.0933V11.0902V11.087V11.0839V11.0808V11.0776V11.0745V11.0713V11.0682C11.5 9.93521 11.4994 9.13056 11.448 8.50091C11.3973 7.87999 11.3009 7.49564 11.1458 7.1912C10.8342 6.57967 10.337 6.08249 9.72547 5.7709C9.42093 5.61573 9.03686 5.51937 8.41676 5.46867C7.78786 5.41725 6.98432 5.41667 5.85275 5.41667L3.56066 5.41667L5.197 7.053C5.48989 7.3459 5.48989 7.82077 5.197 8.11366C4.9041 8.40656 4.42923 8.40656 4.13634 8.11366L1.21967 5.197C0.926777 4.9041 0.926777 4.42923 1.21967 4.13634L4.13634 1.21967C4.42923 0.926777 4.9041 0.926777 5.197 1.21967Z" fill="#B6B6B6"/></svg>`,Dy=I`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><rect opacity="0.12" x="1.66675" y="1.6665" width="16.6667" height="16.6667" rx="5" fill="#E5E6EE"/><path fill-rule="evenodd" clip-rule="evenodd" d="M9.66675 19.0835H9.63319C8.26147 19.0835 7.18603 19.0835 6.32168 19.0129C5.44154 18.941 4.71443 18.7921 4.0563 18.4568C2.97437 17.9055 2.09473 17.0259 1.54346 15.9439C1.20813 15.2858 1.05927 14.5587 0.98736 13.6786C0.91674 12.8142 0.916743 11.7388 0.916748 10.367L0.916748 10.3335V9.66683L0.916748 9.63327C0.916743 8.26155 0.91674 7.18611 0.98736 6.32176C1.05927 5.44162 1.20813 4.71451 1.54346 4.05638C2.09473 2.97445 2.97437 2.09481 4.0563 1.54354C4.71443 1.20821 5.44154 1.05935 6.32169 0.98744C7.18602 0.916821 8.26144 0.916824 9.63313 0.916828H9.63317H9.66675H10.3334H10.367H10.367C11.7387 0.916824 12.8141 0.916821 13.6785 0.98744C14.5586 1.05935 15.2857 1.20821 15.9439 1.54354C17.0258 2.09481 17.9054 2.97445 18.4567 4.05638C18.792 4.71451 18.9409 5.44162 19.0128 6.32176C19.0834 7.1861 19.0834 8.26152 19.0834 9.63321V9.63325V9.66683V10.3335V10.3671V10.3671C19.0834 11.7388 19.0834 12.8142 19.0128 13.6786C18.9409 14.5587 18.792 15.2858 18.4567 15.9439C17.9054 17.0259 17.0258 17.9055 15.9439 18.4568C15.2857 18.7921 14.5586 18.941 13.6785 19.0129C12.8141 19.0835 11.7387 19.0835 10.367 19.0835H10.3334H9.66675ZM4.73729 17.1203C5.14872 17.3299 5.65645 17.4535 6.44383 17.5179C7.23997 17.5829 8.25424 17.5835 9.66675 17.5835H10.3334C11.7459 17.5835 12.7602 17.5829 13.5563 17.5179C14.3437 17.4535 14.8514 17.3299 15.2629 17.1203C16.0626 16.7128 16.7127 16.0626 17.1202 15.263C17.3298 14.8515 17.4535 14.3438 17.5178 13.5564C17.5828 12.7603 17.5834 11.746 17.5834 10.3335V9.66683C17.5834 8.25432 17.5828 7.24005 17.5178 6.44391C17.4535 5.65653 17.3298 5.1488 17.1202 4.73737C16.7127 3.93768 16.0626 3.28751 15.2629 2.88005C14.8514 2.67042 14.3437 2.54679 13.5563 2.48246C12.7602 2.41741 11.7459 2.41683 10.3334 2.41683H9.66675C8.25424 2.41683 7.23997 2.41741 6.44383 2.48246C5.65645 2.54679 5.14872 2.67042 4.73729 2.88005C3.9376 3.28751 3.28743 3.93768 2.87997 4.73737C2.67034 5.1488 2.54671 5.65653 2.48238 6.44391C2.41733 7.24005 2.41675 8.25432 2.41675 9.66683V10.3335C2.41675 11.746 2.41733 12.7603 2.48238 13.5564C2.54671 14.3438 2.67034 14.8515 2.87997 15.263C3.28743 16.0626 3.9376 16.7128 4.73729 17.1203ZM8.03041 5.53049C8.3233 5.2376 8.3233 4.76272 8.03041 4.46983C7.73752 4.17694 7.26264 4.17694 6.96975 4.46983L4.46975 6.96983C4.17686 7.26272 4.17686 7.7376 4.46975 8.03049L6.96975 10.5305C7.26264 10.8234 7.73752 10.8234 8.03041 10.5305C8.3233 10.2376 8.3233 9.76272 8.03041 9.46983L6.81074 8.25016H7.76675C8.89923 8.25016 9.70348 8.25074 10.3329 8.30217C10.9535 8.35288 11.3377 8.44925 11.6422 8.60439C12.2537 8.91598 12.7509 9.41317 13.0625 10.0247C13.2177 10.3292 13.314 10.7134 13.3647 11.334C13.4162 11.9634 13.4167 12.7677 13.4167 13.9002V14.1669C13.4167 14.5811 13.7525 14.9169 14.1667 14.9169C14.581 14.9169 14.9167 14.5811 14.9167 14.1669V13.9002V13.8671V13.8671C14.9168 12.775 14.9168 11.9095 14.8598 11.2119C14.8015 10.4985 14.6799 9.89488 14.399 9.34371C13.9436 8.44994 13.217 7.72328 12.3232 7.26788C11.772 6.98704 11.1684 6.86544 10.455 6.80715C9.75739 6.75015 8.89189 6.75016 7.79975 6.75016H7.76675H6.81074L8.03041 5.53049Z" fill="#E5E6EE"/></svg>`,Ny=I`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path opacity="0.12" d="M1.66675 9.1665C1.66675 6.8368 1.66675 5.67194 2.04735 4.75309C2.55482 3.52795 3.52819 2.55458 4.75333 2.04711C5.67219 1.6665 6.83704 1.6665 9.16675 1.6665H10.3334C13.1337 1.6665 14.5338 1.6665 15.6034 2.21147C16.5442 2.69084 17.3091 3.45574 17.7884 4.39655C18.3334 5.46611 18.3334 6.86624 18.3334 9.6665V15.9755C18.3334 16.445 18.3334 16.6797 18.2986 16.8385C18.1074 17.7106 17.2013 18.2236 16.3551 17.9389C16.201 17.8871 15.9997 17.7663 15.5971 17.5247C15.3563 17.3802 15.2358 17.308 15.1136 17.2435C14.4773 16.9081 13.7761 16.7139 13.058 16.6741C12.92 16.6665 12.7795 16.6665 12.4986 16.6665H9.16675C6.83704 16.6665 5.67219 16.6665 4.75333 16.2859C3.52819 15.7784 2.55482 14.8051 2.04735 13.5799C1.66675 12.6611 1.66675 11.4962 1.66675 9.1665Z" fill="#FF4550"/><path fill-rule="evenodd" clip-rule="evenodd" d="M13.5563 2.48213C12.7602 2.41709 11.7459 2.4165 10.3334 2.4165H9.16675C7.99163 2.4165 7.14786 2.41691 6.48202 2.46234C5.82293 2.50731 5.39315 2.59388 5.04034 2.74002C3.99897 3.17137 3.17161 3.99873 2.74026 5.0401C2.59412 5.39291 2.50755 5.82268 2.46258 6.48178C2.41715 7.14761 2.41675 7.99139 2.41675 9.1665C2.41675 10.3416 2.41715 11.1854 2.46258 11.8512C2.50755 12.5103 2.59412 12.9401 2.74026 13.2929C3.17161 14.3343 3.99897 15.1616 5.04034 15.593C5.39315 15.7391 5.82293 15.8257 6.48202 15.8707C7.14786 15.9161 7.99163 15.9165 9.16675 15.9165H12.4986H12.5212C12.7807 15.9165 12.9405 15.9165 13.0994 15.9253C13.9253 15.971 14.7316 16.1943 15.4634 16.5801C15.6041 16.6543 15.7412 16.7365 15.9637 16.8701L15.983 16.8816C16.4281 17.1487 16.5385 17.2093 16.5942 17.2281C17.0174 17.3704 17.4704 17.1139 17.566 16.6779C17.5786 16.6204 17.5834 16.4945 17.5834 15.9755V9.6665C17.5834 8.254 17.5828 7.23972 17.5178 6.44359C17.4535 5.65621 17.3298 5.14847 17.1202 4.73704C16.7127 3.93736 16.0626 3.28719 15.2629 2.87973C14.8514 2.67009 14.3437 2.54647 13.5563 2.48213ZM13.6785 0.987116C14.5586 1.05903 15.2857 1.20788 15.9439 1.54322C17.0258 2.09449 17.9054 2.97413 18.4567 4.05606C18.792 4.71419 18.9409 5.4413 19.0128 6.32144C19.0834 7.18576 19.0834 8.26116 19.0834 9.63283V9.63288V9.63293V9.6665V15.9755L19.0835 16.0662C19.0838 16.4452 19.0841 16.7581 19.0312 16.9991C18.7444 18.3073 17.3852 19.0768 16.1159 18.6497C15.882 18.5711 15.6138 18.4098 15.289 18.2146L15.2113 18.1679C14.9636 18.0192 14.8635 17.9595 14.7638 17.907C14.223 17.6218 13.627 17.4568 13.0165 17.423C12.904 17.4168 12.7875 17.4165 12.4986 17.4165H9.16675H9.1389H9.13874H9.13871C7.99751 17.4165 7.10274 17.4165 6.37992 17.3672C5.64445 17.317 5.03236 17.2133 4.46632 16.9788C3.05741 16.3952 1.93803 15.2758 1.35444 13.8669C1.11998 13.3009 1.01624 12.6888 0.966063 11.9533C0.916742 11.2305 0.916745 10.3356 0.916748 9.19434V9.1665V9.13867C0.916745 7.99737 0.916742 7.10254 0.966063 6.37967C1.01624 5.6442 1.11998 5.03212 1.35444 4.46607C1.93803 3.05716 3.05741 1.93779 4.46632 1.3542C5.03236 1.11973 5.64445 1.016 6.37992 0.965819C7.10278 0.916498 7.99762 0.916501 9.13891 0.916504H9.16675H10.3334L10.367 0.916504C11.7387 0.916499 12.8141 0.916496 13.6785 0.987116ZM10.8334 11.6665C10.8334 12.1267 10.4603 12.4998 10.0001 12.4998C9.53984 12.4998 9.16675 12.1267 9.16675 11.6665C9.16675 11.2063 9.53984 10.8332 10.0001 10.8332C10.4603 10.8332 10.8334 11.2063 10.8334 11.6665ZM10.7501 5.83317C10.7501 5.41896 10.4143 5.08317 10.0001 5.08317C9.58587 5.08317 9.25008 5.41896 9.25008 5.83317V9.1665C9.25008 9.58072 9.58587 9.9165 10.0001 9.9165C10.4143 9.9165 10.7501 9.58072 10.7501 9.1665V5.83317Z" fill="#FF4550"/></svg>`,Uy=I`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path opacity="0.12" d="M11.2501 1.6665H9.16675C6.04197 1.6665 4.47958 1.6665 3.38431 2.46227C3.03058 2.71926 2.71951 3.03034 2.46251 3.38407C1.66675 4.47934 1.66675 6.04173 1.66675 9.1665C1.66675 12.2913 1.66675 13.8537 2.46251 14.9489C2.71951 15.3027 3.03058 15.6137 3.38431 15.8707C3.53064 15.9771 3.68532 16.0692 3.85094 16.149L17.113 2.88689C16.8822 2.65602 16.6242 2.45229 16.3438 2.2805C15.3419 1.6665 13.9779 1.6665 11.2501 1.6665Z" fill="#E5E6EE"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.2804 0.71967C19.5733 1.01256 19.5733 1.48744 19.2804 1.78033L17.6434 3.41739L4.38127 16.6795L2.19708 18.8637C1.90419 19.1566 1.42931 19.1566 1.13642 18.8637C0.843525 18.5708 0.843525 18.0959 1.13642 17.803L2.67304 16.2664C2.36622 16.0089 2.09167 15.7147 1.85575 15.3899C1.3495 14.6931 1.12697 13.8817 1.02058 12.8997C0.916731 11.9412 0.916738 10.7359 0.916748 9.21131L0.916748 9.16667L0.916748 9.12202C0.916738 7.59748 0.916731 6.39214 1.02058 5.4336C1.12697 4.45168 1.3495 3.64019 1.85575 2.94339L2.46251 3.38423L1.85575 2.94339C2.15901 2.52599 2.52607 2.15892 2.94347 1.85567C3.64027 1.34941 4.45176 1.12688 5.43368 1.0205C6.39222 0.916649 7.59756 0.916657 9.1221 0.916667L9.16675 0.916667H11.2501L11.2889 0.916667C12.6199 0.916659 13.6724 0.916653 14.5152 0.996784C15.3773 1.07875 16.0971 1.24984 16.7357 1.64119C16.8512 1.71197 16.9635 1.78735 17.0723 1.86708L18.2198 0.71967C18.5126 0.426777 18.9875 0.426777 19.2804 0.71967ZM15.9934 2.94598C15.9797 2.93727 15.9658 2.92866 15.952 2.92015C15.5886 2.6975 15.1255 2.56158 14.3732 2.49005C13.6097 2.41746 12.6285 2.41667 11.2501 2.41667H9.16675C7.58765 2.41667 6.46358 2.4177 5.59525 2.51177C4.74096 2.60433 4.22363 2.77968 3.82515 3.06919C3.53509 3.27993 3.28001 3.53501 3.06927 3.82507C2.77976 4.22354 2.60441 4.74088 2.51186 5.59517C2.41778 6.4635 2.41675 7.58757 2.41675 9.16667C2.41675 10.7458 2.41778 11.8698 2.51186 12.7382C2.60441 13.5925 2.77976 14.1098 3.06927 14.5083C3.25903 14.7694 3.48473 15.0023 3.73955 15.1999L15.9934 2.94598ZM18.2715 5.08338C18.6857 5.07893 19.025 5.41109 19.0295 5.82528L18.2795 5.83333L17.5296 5.84138C17.5251 5.42719 17.8573 5.08782 18.2715 5.08338ZM18.2795 5.83333L17.5296 5.84144L17.5296 5.8416L17.5296 5.84228L17.5296 5.845L17.5297 5.8558L17.5302 5.89825L17.5319 6.06169L17.538 6.66403C17.543 7.17324 17.5498 7.87799 17.5565 8.66014C17.57 10.2254 17.5834 12.0974 17.5834 13.3333V15.9757C17.5834 16.4141 17.583 16.7043 17.5682 16.9197C17.5537 17.131 17.5289 17.1857 17.529 17.1857C17.529 17.1857 17.5291 17.1856 17.5292 17.1854C17.4381 17.3646 17.2487 17.4718 17.0483 17.4577C17.0485 17.4577 17.0486 17.4577 17.0486 17.4577C17.0486 17.4576 16.989 17.4507 16.8003 17.3545C16.608 17.2563 16.359 17.1074 15.983 16.8818L15.9429 16.8577C15.5438 16.6182 15.2888 16.4652 15.0178 16.3441L14.7119 17.0289L15.0178 16.3441C14.5684 16.1434 14.0915 16.0113 13.6029 15.9522L13.5146 16.6827L13.6029 15.9522C13.3083 15.9166 13.0109 15.9166 12.5454 15.9167L12.4986 15.9167C11.8906 15.9167 11.2857 15.9191 10.6825 15.9215C9.48275 15.9263 8.28974 15.9311 7.09241 15.9167C6.67822 15.9118 6.33843 16.2435 6.33347 16.6577C6.3285 17.0719 6.66024 17.4116 7.07443 17.4166C8.28327 17.4311 9.49778 17.4263 10.7051 17.4214C11.3052 17.4191 11.9036 17.4167 12.4986 17.4167C13.0261 17.4167 13.2288 17.4179 13.4228 17.4414C13.7624 17.4824 14.0938 17.5742 14.4061 17.7137C14.5845 17.7934 14.759 17.8967 15.2113 18.168L15.2339 18.1816C15.5812 18.39 15.8747 18.5661 16.1184 18.6905C16.3631 18.8154 16.6392 18.9326 16.943 18.954C17.7447 19.0104 18.5023 18.5815 18.8664 17.865C19.0044 17.5935 19.0459 17.2964 19.0647 17.0223C19.0834 16.7493 19.0834 16.4071 19.0834 16.0019V15.9757V13.3333C19.0834 12.0902 19.0699 10.2122 19.0564 8.64723C19.0497 7.86426 19.043 7.15883 19.0379 6.64915L19.0318 6.04614L19.0301 5.88241L19.0296 5.83983L19.0295 5.82896L19.0295 5.82622L19.0295 5.82552L19.0295 5.82535L18.2795 5.83333Z" fill="#E5E6EE"/></svg>`,jy=I`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><circle opacity="0.12" cx="10.0001" cy="9.99984" r="8.33333" fill="#FF4550"/><path fill-rule="evenodd" clip-rule="evenodd" d="M5.19432 4.13341C6.50254 3.06045 8.17611 2.4165 10.0001 2.4165C14.1882 2.4165 17.5834 5.81168 17.5834 9.99984C17.5834 11.8238 16.9395 13.4974 15.8665 14.8056L5.19432 4.13341ZM4.13366 5.19407C3.0607 6.5023 2.41675 8.17587 2.41675 9.99984C2.41675 14.188 5.81192 17.5832 10.0001 17.5832C11.8241 17.5832 13.4976 16.9392 14.8058 15.8663L4.13366 5.19407ZM10.0001 0.916504C4.9835 0.916504 0.916748 4.98325 0.916748 9.99984C0.916748 15.0164 4.9835 19.0832 10.0001 19.0832C15.0167 19.0832 19.0834 15.0164 19.0834 9.99984C19.0834 4.98325 15.0167 0.916504 10.0001 0.916504Z" fill="#FF4550"/></svg>`,By=I`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><circle opacity="0.12" cx="9.99984" cy="9.99984" r="8.33333" fill="#E5E6EE"/><path fill-rule="evenodd" clip-rule="evenodd" d="M5.19407 4.13341C6.5023 3.06045 8.17587 2.4165 9.99984 2.4165C14.188 2.4165 17.5832 5.81168 17.5832 9.99984C17.5832 11.8238 16.9392 13.4974 15.8663 14.8056L5.19407 4.13341ZM4.13341 5.19407C3.06045 6.5023 2.4165 8.17587 2.4165 9.99984C2.4165 14.188 5.81168 17.5832 9.99984 17.5832C11.8238 17.5832 13.4974 16.9392 14.8056 15.8663L4.13341 5.19407ZM9.99984 0.916504C4.98325 0.916504 0.916504 4.98325 0.916504 9.99984C0.916504 15.0164 4.98325 19.0832 9.99984 19.0832C15.0164 19.0832 19.0832 15.0164 19.0832 9.99984C19.0832 4.98325 15.0164 0.916504 9.99984 0.916504Z" fill="#E5E6EE"/></svg>`,Kp=I`<svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="19.0005" cy="12.3494" r="1.47778" transform="rotate(90 19.0005 12.3494)" fill="#E5E6EE"/><circle cx="19.0005" cy="18.9993" r="1.47778" transform="rotate(90 19.0005 18.9993)" fill="#E5E6EE"/><circle cx="19.0005" cy="25.6497" r="1.47778" transform="rotate(90 19.0005 25.6497)" fill="#E5E6EE"/><circle opacity="0.12" cx="18.9998" cy="18.9998" r="15.8333" fill="#E5E6EE"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18.9998 3.9165C10.6695 3.9165 3.9165 10.6695 3.9165 18.9998C3.9165 27.3301 10.6695 34.0832 18.9998 34.0832C27.3301 34.0832 34.0832 27.3301 34.0832 18.9998C34.0832 10.6695 27.3301 3.9165 18.9998 3.9165ZM2.4165 18.9998C2.4165 9.84111 9.84111 2.4165 18.9998 2.4165C28.1586 2.4165 35.5832 9.84111 35.5832 18.9998C35.5832 28.1586 28.1586 35.5832 18.9998 35.5832C9.84111 35.5832 2.4165 28.1586 2.4165 18.9998Z" fill="#E5E6EE"/></svg>`,Qp=I`<svg xmlns="http://www.w3.org/2000/svg" width="38" height="38" viewBox="0 0 38 38" fill="none"><circle opacity="0.12" cx="18.9998" cy="18.9998" r="15.8333" fill="#03DAC5"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3.9165 18.9998C3.9165 10.6695 10.6695 3.9165 18.9998 3.9165C27.3301 3.9165 34.0832 10.6695 34.0832 18.9998C34.0832 27.3301 27.3301 34.0832 18.9998 34.0832C10.6695 34.0832 3.9165 27.3301 3.9165 18.9998ZM18.9998 2.4165C9.84111 2.4165 2.4165 9.84111 2.4165 18.9998C2.4165 28.1586 9.84111 35.5832 18.9998 35.5832C28.1586 35.5832 35.5832 28.1586 35.5832 18.9998C35.5832 9.84111 28.1586 2.4165 18.9998 2.4165ZM19.5302 12.1362C19.3895 11.9955 19.1987 11.9165 18.9998 11.9165C18.8009 11.9165 18.6102 11.9955 18.4695 12.1362L13.7195 16.8862C13.4266 17.1791 13.4266 17.6539 13.7195 17.9468C14.0124 18.2397 14.4873 18.2397 14.7802 17.9468L18.2498 14.4772V25.3332C18.2498 25.7474 18.5856 26.0832 18.9998 26.0832C19.4141 26.0832 19.7498 25.7474 19.7498 25.3332V14.4772L23.2195 17.9468C23.5124 18.2397 23.9873 18.2397 24.2802 17.9468C24.5731 17.6539 24.5731 17.1791 24.2802 16.8862L19.5302 12.1362Z" fill="#03DAC5"/></svg>`,ta=I`<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" viewBox="0 0 17 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M4.04084 3.54084C4.2945 3.28717 4.70578 3.28717 4.95944 3.54084L8.50014 7.08153L12.0408 3.54084C12.2945 3.28717 12.7058 3.28717 12.9594 3.54084C13.2131 3.7945 13.2131 4.20578 12.9594 4.45944L9.41875 8.00014L12.9594 11.5408C13.2131 11.7945 13.2131 12.2058 12.9594 12.4594C12.7058 12.7131 12.2945 12.7131 12.0408 12.4594L8.50014 8.91875L4.95944 12.4594C4.70578 12.7131 4.2945 12.7131 4.04084 12.4594C3.78717 12.2058 3.78717 11.7945 4.04084 11.5408L7.58153 8.00014L4.04084 4.45944C3.78717 4.20578 3.78717 3.7945 4.04084 3.54084Z" fill="#E5E6EE"/></svg>`,Fy=I`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" viewBox="0 0 16 15" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M4.96967 5.71967C5.26256 5.42678 5.73744 5.42678 6.03033 5.71967L6.34283 6.03217L8 7.68934L9.65717 6.03217L9.96967 5.71967C10.2626 5.42678 10.7374 5.42678 11.0303 5.71967C11.3232 6.01256 11.3232 6.48744 11.0303 6.78033L10.7178 7.09283L8.53033 9.28033C8.23744 9.57322 7.76256 9.57322 7.46967 9.28033L5.28217 7.09283L4.96967 6.78033C4.67678 6.48744 4.67678 6.01256 4.96967 5.71967Z" fill="#F0F0FF"/></svg>`,zy=I`<style>.reaction-button{border:none;border-radius:.5rem;background:rgba(255,255,255,.1);position:absolute;padding:.125rem .25rem;transform:translate(12px,-2px);right:0;bottom:0;top:auto;height:21px;width:21px;background-image:url('data:image/svg+xml;utf8,${'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 16 16" fill="rgba(150, 150, 150, 0.5)"><path fill-rule="nonzero" d="M2.083 9a6.002 6.002 0 0 0 11.834 0H2.083zM8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16zM5.5 7a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm5 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path></svg>'}');background-repeat:no-repeat;background-size:13px 13px;background-position:center}.reaction-button:hover{cursor:pointer}.reaction-button>svg{fill:rgba(150,150,150,.5);height:13px;width:13px}.reaction-item-container{position:absolute;display:flex;margin:0;transition:opacity ease .3s;opacity:0;z-index:25;left:auto;right:auto;bottom:0;top:auto}.reaction-item-wrap{position:relative;display:inline-flex;padding:0 1.4rem 0 0;height:45px;border-radius:12px;min-height:inherit;width:inherit;background:#282828}.reaction-item{display:inline-block;position:relative;width:2.5rem;height:2.25rem;background:0 0;border-radius:12px;border:none;margin:4.5px 4px;cursor:pointer;padding:0}.reaction-item.selected,.reaction-item:focus,.reaction-item:hover{background:rgba(255,255,255,.2)}.reaction-image{width:25px;height:25px;position:relative;padding:0}.reaction-count{color:#fff;position:absolute;top:0}.mini-reactions{display:flex;position:absolute;right:0}.mini-reaction-image{height:16px;width:16px;margin:0 0 0 -5px;vertical-align:middle}.mini-reaction-count{color:#fff}</style>`,Hy="1",qy="0",Ri=(e,t)=>{e.outsideClick.remove(),e.animation=qy,setTimeout((()=>e[t]=null),300)},Gy=(e,t,n)=>{var r;if(e[t]=n,setTimeout((()=>{e.outsideClick=(function(o,c){function l(u){const m=(o.shadowRoot||document).elementFromPoint(u.x,u.y),v=o.contains(m),R=o.shadowRoot&&o.shadowRoot.contains(m);!v&&!R&&c()}return{register:()=>window.addEventListener("click",l,!1),remove:()=>window.removeEventListener("click",l,!1)}})(e,(()=>Ri(e,t))),e.outsideClick.register(),e.animation=Hy}),50),(r=e.owner)===null||r===void 0?void 0:r.roomid){const o={"Chat Room ID":e.owner.roomid,"Chat Message ID":n};t==="selectedReactions"&&Ct("Chat Reaction Panel Opened",o)}},hr=(e,t,n)=>e[n]===t?Ri(e,n):Gy(e,n,t);function Xp(e){const t=Math.log10(e)/3|0;if(t==0)return e;const n=e/Math.pow(10,3*t),r=n%1==0||n>=10?0:1;return n.toFixed(r)+["","k","M"][t]}const Wy=e=>class extends e{constructor(){super(...arguments),this.updateOwnerProps=t=>{if(this.owner.dataId===t.key){try{this.ownerUpdated(t)}catch(n){console.error("Error inside component ownerUpdated implementation",n)}this.requestUpdate(),super.requestUpdate()}}}static get properties(){return{owner:{type:Object}}}ownerUpdated(t){}connectedCallback(){if(!this.owner&&(this.owner=Rc(this,"chat-provider")),Ne.on("chat-updated",this.updateOwnerProps),this.defaultStyles){const t=document.createElement("style");t.innerHTML+=this.defaultStyles(),this.appendChild(t)}super.connectedCallback()}disconnectedCallback(){Ne.off("chat-updated",this.updateOwnerProps),super.disconnectedCallback()}};class it extends Wy(je){}const Ky=I`<style>.livelike-modal{color:#000;padding:1rem;background:#fff;border-radius:5px;position:absolute;z-index:15;width:50%;top:50%;left:25%;opacity:0}.livelike-modal.showing{transition:all ease .3s;opacity:1}</style>`;var jc=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let _o=class extends it{render(){const e={block:this.owner.localize("chat.blockConfirmation.message",{username:this.data?this.data.nickname:null}),report:this.owner.localize("chat.reportConfirmation.message"),muted:this.owner.localize("chat.mutedMessage"),error:this.owner.localize("chat.errorMessage")};return I`${Ky}<div class="livelike-modal ${this.type!==""?"showing":null}"><div class="modal-body">${e[this.type]}</div></div>`}createRenderRoot(){return this}};jc([C({type:String,reflect:!0})],_o.prototype,"type",void 0),jc([C({type:Object})],_o.prototype,"data",void 0),_o=jc([de("livelike-modal")],_o);const Qy=I`<style>.message-options{z-index:21;background:#fff;border-radius:5px}.menu-button{display:flex;font-size:.75rem;color:#000;padding:.25rem 1rem;width:100%;border:none;background:0 0;transition:background ease .3s;text-align:left}.menu-button:hover{background:rgba(0,0,0,.2);transition:background ease .3s;cursor:pointer}.block-user.blocked{color:gray;cursor:default}.menu-item-label{margin:0 0 0 .5rem}.menu-icon{line-height:1.1rem;font-size:.95rem;width:18px}.sub-item-icon{position:absolute;right:.5rem}</style>`;var pr=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Ti=class extends je{constructor(){super(...arguments),this.subMenuOpen=null,this.renderSubIcon=e=>e.type==="multi"?I`<div class="sub-item-icon">${yy}</div>`:null,this.renderButton=(e,t,n)=>I`<button id="menu-button-${t}" aria-label="${e.label}" @click="${n}" class="button menu-button"><div class="menu-item-label">${e.label}</div>${this.renderSubIcon(e)}</button>`,this.renderCustomHtml=e=>{const t=new DOMParser().parseFromString(e.html,"text/html"),n=[];return t.body.childNodes.forEach((r=>n.push(r))),n.map((r=>I`${r}`))},this.renderItem=(e,t)=>{const n=this.message.id+String(t),r=e.type==="single"?()=>{e.onClick(),this.closeMenu("selectedMessage")}:()=>this.subMenuOpen===n?this.subMenuOpen=null:this.subMenuOpen=n;return I`${e.type==="custom"&&e.html?this.renderCustomHtml(e):this.renderButton(e,t,r)} ${this.subMenuOpen===n&&e.type==="multi"?this.renderSubMenu(e.items):null}`},this.renderSubMenu=e=>I`<div class="sub-menu-container">${this.renderMenu(e,10)}</div>`,this.renderMenu=(e,t)=>e.map(((n,r)=>n.type==="separator"?I`<hr style="margin:0">`:this.renderItem(n,t?r+t:r)))}createRenderRoot(){return this}render(){return I`${Qy}<style>message-menu{position:absolute;width:100%;max-width:10rem;right:2.5rem;display:block;top:50%;margin:auto;top:0;bottom:0;right:1rem;display:flex;align-items:center;justify-content:center;text-align:center}.message-options-anchor{z-index:21;transition:opacity .3s ease;opacity:${this.animation}}</style><div class="message-options-anchor" id="chat_moderation"><div class="message-options">${this.renderMenu(this.menu)}</div></div>`}};pr([C({type:Array})],Ti.prototype,"menu",void 0),pr([C({type:Object})],Ti.prototype,"message",void 0),pr([C({type:Number})],Ti.prototype,"animation",void 0),pr([C({type:String})],Ti.prototype,"subMenuOpen",void 0),pr([C({type:Function})],Ti.prototype,"closeMenu",void 0),Ti=pr([de("message-menu")],Ti);const Xy=I`<style>:host{overflow:auto}.quote-message-item-container{position:relative;display:flex;justify-content:flex-start;width:100%;background:#2a2a2a;padding:.7rem;border-radius:12px}.quote-message-wrapper{display:flex;opacity:1;transition:all .4s;border-radius:.75rem;position:relative}.quote-sender-name{font-size:1rem;display:inline-block;color:#ffff;margin:0 0 .25rem 0;word-break:break-word;word-wrap:break-word}.quote-sender-message{font-size:1rem;display:flex;word-break:break-word;word-wrap:break-word;color:#949494;line-height:1.3;padding:0;flex-wrap:wrap;overflow:hidden}.quote-sender-message .image-message{max-width:6rem}.quote-sender-message.deleted,.quote-sender-message.sender-blocked{font-style:oblique;font-size:.9rem}</style>`;var Zp=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Bc=class extends it{constructor(){super(...arguments),this.senderImageUrl=null,this.avatarImageFailed=()=>{this.senderImageUrl=null}}createRenderRoot(){return this}render(){const e=this.senderImageUrl?I`<img src="${this.senderImageUrl}" alt="Avatar" @error="${this.avatarImageFailed}">`:_y;return I`<div class="avatar">${e}</div>`}};Zp([C({type:String})],Bc.prototype,"senderImageUrl",void 0),Bc=Zp([de("livelike-chat-message-avatar")],Bc);const wo="__$",na=(e,t,n,r)=>{const o=t?t.reduce(((c,l)=>c.concat(l.stickers)),[]):[];if(e.image_url&&!e.isDeleted)return I`<div class="image-message-container"><img class="image-message" width="${e.image_width}" height="${e.image_height}" src="${e.image_url}" alt="Chat image"></div>`;if(e.message){let c=e.isFiltered?e.filtered_message:e.message;const l={};n&&r&&r.length>0&&r.forEach((k=>{c=c.replace(k,(M=>{const D=M.indexOf("http")!==0?"//"+M:M;return l[M]=I`<a class="livelike-message-link" title="${D}" target="_blank" href="${D}">${M}</a>`,`${wo}${M}${wo}`}))}));const u=/:[^\/\/]([^:]*):/g,m=c.indexOf(":")===0,v=(c.match(u)||[]).length>1||c.split(" ").length>1?"22px":"32px";c=c.replace(u,(k=>{const M=o&&o.find((D=>D.shortcode===k.slice(1,-1)));return M?(l[k]=I`<span style="margin:0 4px 0 ${m?"0":"4px"};height:${v}"><img class="word-item" height="100%" src="${M.file}" alt="${M.shortcode}"></span>`,`${wo}${k}${wo}`):k}));const R=c.split(wo).map((k=>l[k]||k));return I`${R}`}},Fc=(e,t,n)=>K[e]({url:ee.profileUrl,data:t,accessToken:n}),zc=e=>e&&(e.accessToken||e.profileId)?e.accessToken?Fc("get",null,e.accessToken).then((t=>(t.access_token=e.accessToken,t))):e.profileId&&K.get({url:Te(e.profileId,ee.profileDetailUrlTemplate)}):Dt("accessToken or profileId","fetchUserProfile"),Jp=e=>e&&e.accessToken?Fc("patch",e.options,e.accessToken).then((t=>(t.access_token=e.accessToken,t.id===ae.id&&(ee.storageStrategy.set(t),ae.nickname=t.nickname,Object.assign(ae,t)),t))):Dt("accessToken","updateuserprofile");function Yp(e,t){he.addListener(ae.subscribe_channel,t,e),he.subscribe(ae.subscribe_channel)}function Hc(e,t){t?he.removeListener(ae.subscribe_channel,t,e):he.removeAllListenersForEvent(ae.subscribe_channel,e),he.unsubscribe(ae.subscribe_channel)}var em=function(e,t,n,r){return new(n||(n=Promise))((function(o,c){function l(v){try{m(r.next(v))}catch(R){c(R)}}function u(v){try{m(r.throw(v))}catch(R){c(R)}}function m(v){var R;v.done?o(v.value):(R=v.value,R instanceof n?R:new n((function(k){k(R)}))).then(l,u)}m((r=r.apply(e,[])).next())}))};function tm(e){return ue(e,["profileId"],"blockProfile").then((()=>K.post({url:ae.block_profile_url,data:{blocked_profile_id:e.profileId}}))).then((t=>(om(t.blocked_profile_id,"add"),t)))}function nm(e){return ue(e,["blockId"],"unblockProfile").then((()=>im({blockId:e.blockId}))).then((t=>K.delete({url:`${ae.block_profile_url}${e.blockId}/`}).then((()=>{om(t.blocked_profile_id,"delete")}))))}function im(e){return em(this,void 0,void 0,(function*(){return ue(e,[],"getProfileBlockInfo",(()=>{if(!e?.profileId&&!e?.blockId)return'Argument object is missing "profileId" or "blockId" property.'})).then((()=>e.profileId?K.get({url:Te(e.profileId,ae.blocked_profiles_template_url)}).then((t=>t.results&&t.results[0])):K.get({url:`${ae.block_profile_url}${e.blockId}/`})))}))}function rm(){return em(this,void 0,void 0,(function*(){return Re(["results"],xe(ae.blocked_profile_ids_url,(e=>K.get({url:e})),(e=>({count:e.count,results:e.results})))).then((e=>(ee.blockedProfileIds=e.results,e)))}))}const qc=()=>ee.blockedProfileIds,om=(e,t)=>{const n=ee.blockedProfileIds.findIndex((r=>r===e));t==="add"&&n===-1?ee.blockedProfileIds=[...ee.blockedProfileIds,e]:t==="delete"&&n>-1&&ee.blockedProfileIds.splice(n,1)};var mr=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Un=class extends it{constructor(){super(...arguments),this.message=null,this.animation=0,this.showavatar=!0,this.isSenderBlocked=!1,this.isDeleted=!1,this.ownerUpdated=e=>{e.name==="blockList"?this.messageBlocked(e.prop):e.name==="deletedMessages"&&this.messageDeleted({message:e.prop[e.prop.length-1]})},this.messageDeleted=e=>{this.message&&e.message&&e.message.id===this.message.id&&(this.isDeleted=!0)},this.messageBlocked=e=>{this.message&&(this.isSenderBlocked=e.indexOf(this.message.sender_id)>-1)},this.renderMessage=()=>{if(this.isDeleted||this.isSenderBlocked){const e=this.isDeleted?this.owner.localize("chat.messageDeleted"):this.owner.localize("chat.messageSenderBlocked");return I`<span>${e}</span>`}return na(this.message,this.owner.stickerPacks,this.owner.messageurls,this.owner.messageUrlPatterns)},this.getQuoteMessageItemClasses=()=>({selfClass:this.message.sender_id===ae.id?"self":"",avatarClass:this.showavatar?"has-avatar":"",deletedClass:this.isDeleted?"deleted":"",senderBlockedClass:this.isSenderBlocked?"sender-blocked":""})}createRenderRoot(){return this}connectedCallback(){if(super.connectedCallback(),!this.message)return;up(this.owner.roomid,this.message.id)&&this.messageDeleted({message:this.message});const e=this.owner.blockList.concat(qc());this.messageBlocked(e)}render(){if(!this.message)return null;const{selfClass:e,avatarClass:t,deletedClass:n,senderBlockedClass:r}=this.getQuoteMessageItemClasses(),o=this.showavatar?I`<livelike-chat-message-avatar .senderImageUrl="${this.message.sender_image_url}"></livelike-chat-message-avatar>`:null,c=this.message.image_url?this.message.image_url:this.message.message;return I`${Xy}<div class="quote-message-item-container ${e}">${o}<div class="quote-message-wrapper ${t}" tabindex="0"><div aria-live="polite" role="log"><div class="quote-sender-name" aria-label="${this.message.sender_nickname}">${this.message.sender_nickname}</div><div @click="${this.trackClickEvent}" aria-label="${c}" id="senderMessage-${this.message.id}" class="quote-sender-message ${n} ${r}">${this.renderMessage()}</div></div></div></div>`}};mr([C({type:Object})],Un.prototype,"message",void 0),mr([C({type:Number})],Un.prototype,"animation",void 0),mr([C({type:Boolean})],Un.prototype,"showavatar",void 0),mr([C({type:Boolean})],Un.prototype,"isSenderBlocked",void 0),mr([C({type:Boolean})],Un.prototype,"isDeleted",void 0),Un=mr([de("livelike-quote-message-item")],Un);var gr=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let jn=class extends it{constructor(){super(...arguments),this.message=null,this.animation=0,this.selectedMessage=null,this.selectedReactions=null,this.isDeleted=!1,this.messageDeleted=e=>{const t=this.owner.localize("chat.messageDeleted");this.message&&e.message&&e.message.id===this.message.id&&(this.isDeleted=!0,this.message=Object.assign(Object.assign({},this.message),{message:t,filtered_message:t}))},this.ownerUpdated=e=>{e.name==="deletedMessages"&&this.messageDeleted({message:e.prop[e.prop.length-1]})},this.renderMessageMenu=e=>I`<message-menu .menu="${this.owner.messageMenuFunc(e)}" .message="${e}" .animation="${this.animation}" .closeMenu="${()=>Ri(this,"selectedMessage")}"></message-menu>`,this.renderMenuButton=(e,t)=>this.owner.messagemenus&&!this.isDeleted&&this.owner.messageMenuFunc(t)&&this.owner.messageMenuFunc(t).length?I`<div class="menu-button-container"><button aria-label="${this.owner.localize("chat.messageMenu.ariaLabel")}" class="more-icon ${e}" @click="${()=>hr(this,t.id,"selectedMessage")}">${vy}</button></div>`:null,this.renderTimestamp=e=>{const t=e.created_at,n=this.owner.dateTimeFormatter({time:t,format:this.owner.timeformat,lang:this.owner.lang});return I`<time aria-label="${n}" class="message-timestamp" datetime="${t}">${n}</time>`},this.reactionAction=e=>{const t=this.message.reactions[e.id]&&this.message.reactions[e.id].find((c=>c.uuid===ae.id)),n=()=>Ri(this,"selectedReactions"),r={value:e.id,uuid:ae.id,messageTimetoken:this.message.timetoken,actionTimetoken:t&&t.actionTimetoken||null},o=(c,l)=>{this.owner[c]({messageId:this.message.id,reactionId:e.id}).then(n),this.owner.updateReaction(r,l)};t?o("removeMessageReaction","reactionremoved"):o("addMessageReaction","reactionadded")},this.getReactionCount=e=>this.message.reactions[e.id]?this.message.reactions[e.id].length:0,this.renderMiniReactions=()=>{const e=Object.entries(this.message.reactions).reduce(((t,[n,r])=>{var o;return!((o=this.owner.reactionPack)===null||o===void 0)&&o.find((c=>c.id===n))&&(t=t.concat(r)),t}),[]);return((t,n,r)=>I`<div class="mini-reactions">${r.map((o=>n(o)>0?I`<img class="mini-reaction-image" src="${o.file}" alt="Reaction ${o.name}">`:null))} ${t>0?I`<span class="mini-reaction-count">${Xp(t)}</span>`:null}</div>`)(e.length,this.getReactionCount,this.owner.reactionPack)},this.renderReactions=()=>{const e=t=>this.message.reactions[t.id]&&this.message.reactions[t.id].find((n=>n.uuid===ae.id));return((t,n,r,o,c,l,u)=>I`<div class="reaction-item-container" style="opacity:${n}"><div class="reaction-item-wrap">${t.map((m=>{const v=o(m);return I`<button aria-label="${yn(l,u||"en-US",{reactionName:m.name})}" class="reaction-item ${r(m)}" @click="${()=>c(m)}"><img class="reaction-image" src="${m.file}" alt=""> ${v>0?I`<span class="reaction-count">${Xp(v)}</span>`:null}</button>`}))}</div></div>`)(this.owner.reactionPack,this.animation,(t=>e(t)?"selected":""),this.getReactionCount,this.reactionAction,"chat.reactions.reactionSelectionButton.ariaLabel",this.owner.lang)},this.trackClickEvent=e=>{if(e.target&&e.target.href){const t=this.message;t.messageLink=e.target.href,Dc(t,this.owner.roomid,"Chat Message Link Clicked")}},this.renderQuoteMessage=()=>this.owner.messagequotes&&Cc(this.message)&&!this.isDeleted?I`<livelike-quote-message-item .message="${this.message.quote_message}" .showavatar="${!1}"></livelike-quote-message-item>`:null,this.getMessageItemClasses=()=>({selfClass:this.message.sender_id===ae.id?"self":"",avatarClass:this.owner.showavatar?"has-avatar":"",deletedClass:this.isDeleted?"deleted":"",filteredClass:this.message.isFiltered?"filtered":""})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),Dc(this.message,this.owner.roomid,"Chat Message Displayed"),this.message.isDeleted&&(this.isDeleted=!0)}render(){const e=this.owner.blockList.find((k=>k===this.message.sender_id)),{selfClass:t,avatarClass:n,deletedClass:r,filteredClass:o}=this.getMessageItemClasses(),c=this.selectedMessage===this.message.id,l=c?"active":"",u=this.owner.showavatar?I`<livelike-chat-message-avatar .senderImageUrl="${this.message.sender_image_url}"></livelike-chat-message-avatar>`:null;return e?null:I`${my} ${zy}<div class="message-item-container ${l} ${t} ${o}">${u}<div class="message-wrapper ${n}" tabindex="0">${this.owner.reactionPack&&this.owner.reactionPack.length>0?this.renderMiniReactions():null}<div aria-live="polite" role="log"><div class="sender-name" aria-label="${this.message.sender_nickname}">${this.message.sender_nickname}</div>${this.renderQuoteMessage()}<div @click="${this.trackClickEvent}" aria-label="${this.message.image_url?this.message.image_url:this.message.message}" id="senderMessage-${this.message.id}" class="sender-message ${r}">${na(this.message,this.owner.stickerPacks,this.owner.messageurls,this.owner.messageUrlPatterns)}</div>${this.owner.timestamps?this.renderTimestamp(this.message):null}</div>${this.owner.reactionPack&&this.owner.reactionPack.length>0&&!this.isDeleted?(m=this,v=this.message.id,R="chat.reactions.openButton.ariaLabel",I`<div class="reaction-button-container"><button class="reaction-button" aria-label="${m.owner.localize(R)}" @click="${()=>hr(m,v,"selectedReactions")}"></button></div>`):null}</div>${this.selectedReactions===this.message.id?this.renderReactions():null} ${c?this.renderMessageMenu(this.message):null} ${this.renderMenuButton(l,this.message)}</div>`;var m,v,R}};gr([C({type:Object})],jn.prototype,"message",void 0),gr([C({type:Number})],jn.prototype,"animation",void 0),gr([C({type:String})],jn.prototype,"selectedMessage",void 0),gr([C({type:String})],jn.prototype,"selectedReactions",void 0),gr([C({type:Boolean})],jn.prototype,"isDeleted",void 0),jn=gr([de("livelike-message-item")],jn);const Zy=I`<style>:host{display:block;overflow:auto}.load-prev-msg-container{display:flex;justify-content:center;padding-bottom:1rem}.load-prev-msg-container button{padding:.5rem;background:#27bf9d;border:0;color:#212333;cursor:pointer}.load-prev-msg-container button:disabled{background:#84858b;cursor:not-allowed}</style>`;var Jy=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let ia=class extends it{constructor(){super(...arguments),this.appendMessage=e=>{const t=e.detail.message,n=e.detail.prevMessage;if(this.hasMessageData(t)){const r=this.createMessageElem(t),o=!n&&this.checkIfAtBottom();this.appendChild(r);const c=r.updateComplete?r:this,l=this.scrollHeight>0?250:750;c.updateComplete.then((()=>!n&&(t.sender_id===ae.id||o)&&this.deferredScrollToBottom(l)))}},this.prependMessages=e=>{const t=e.detail.messages.filter((n=>this.hasMessageData(n))).map((n=>this.createMessageElem(n)));this.prependAndAdjustScroll(t)},this.prependAndAdjustScroll=e=>{const t=this.scrollHeight-this.scrollTop;this.prepend(...e),window.requestAnimationFrame((()=>{this.scrollTop=this.scrollHeight-t}))},this.checkIfAtBottom=()=>{var e;const t=this.children[this.children.length-1];if(!t||!this.scrollHeight)return!0;const n=(e=t.querySelector(".message-item-container"))===null||e===void 0?void 0:e.clientHeight;return Math.abs(this.scrollHeight-(this.scrollTop+this.clientHeight))<.5*n},this.softKeyboardHandler=Ks((()=>this.checkIfAtBottom()&&this.scrollToBottom())),this.scrollListener=Ks((()=>{Ne.emit("userScrolled",{key:this.owner.dataId,scrolled:!this.checkIfAtBottom()})})),this.deferredScrollToBottomTimeOut=0,this.deferredScrollToBottom=e=>{this.deferredScrollToBottomTimeOut&&window.clearTimeout(this.deferredScrollToBottomTimeOut),this.deferredScrollToBottomTimeOut=window.setTimeout((()=>this.scrollToBottom()),e)},this.scrollToBottom=()=>{this.scrollTop=this.scrollHeight+1e4},this.scrollToBottomListener=e=>e.key===this.owner.dataId&&this.scrollToBottom()}hasCustomMessage(e){return(function(t){return t.message_event&&t.message_event===Ze.CUSTOM_MESSAGE_CREATED})(e)&&!!e.custom_data&&this.owner.customMessageRenderer}hasMessageData(e){return!!e.message||!!e.image_url||this.hasCustomMessage(e)}createMessageElem(e){const t=this.hasCustomMessage(e)?this.owner.customMessageRenderer({message:e}):document.createElement("livelike-message-item");return t.message=e,t.owner=this.owner,t}connectedCallback(){this.addEventListener("scroll",this.scrollListener),Ne.on("scrollDown",this.scrollToBottomListener),window.addEventListener("resize",this.softKeyboardHandler),super.connectedCallback(),this.setAttribute("role","log"),this.owner.addEventListener("message-ready",this.appendMessage),this.owner.addEventListener("prev-messages-ready",this.prependMessages)}disconnectedCallback(){Ne.off("scrollDown",this.scrollToBottomListener),this.removeEventListener("scroll",this.scrollListener),this.owner.removeEventListener("message-ready",this.appendMessage),this.owner.addEventListener("prev-messages-ready",this.prependMessages),window.removeEventListener("resize",this.softKeyboardHandler),super.disconnectedCallback()}renderLoadPrevMessageButton(){if(!this.owner||!this.owner.previousMessages)return null;const{loadPrevMessageRenderer:e,prevMessagesLoading:t,onLoadPrevMessageClick:n,hasPrevMessages:r}=this.owner;return r?e&&typeof e=="function"?e({loading:t,onClick:n,hasPrevMessages:r}):I`<div class="load-prev-msg-container"><button @click="${n}" .disabled="${t}">${t?"Loading previous messages":"Load previous messages"}</button></div>`:null}render(){return I`${Zy} ${this.renderLoadPrevMessageButton()}<slot></slot>`}};ia=Jy([de("livelike-message-list")],ia);var Yy=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let sm=class extends it{createRenderRoot(){return this}renderLoadPrevMessageButton(){var e;if(!(!((e=this.owner)===null||e===void 0)&&e.previousMessages))return null;const{loadPrevMessageRenderer:t,prevMessagesLoading:n,onLoadPrevMessageClick:r,hasPrevMessages:o}=this.owner;return o?t&&typeof t=="function"?t({loading:n,onClick:r,hasPrevMessages:o}):I`<div class="load-prev-msg-container"><button @click="${r}" .disabled="${n}">${n?"Loading previous messages":"Load previous messages"}</button></div>`:null}connectedCallback(){super.connectedCallback()}render(){return I`${this.renderLoadPrevMessageButton()}`}};function Co(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l;}sm=Yy([de("livelike-previous-messages-button")],sm);const ra=globalThis,Gc=ra.ShadowRoot&&(ra.ShadyCSS===void 0||ra.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,am=Symbol(),lm=new WeakMap;let ev=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==am)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Gc&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=lm.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&lm.set(t,e))}return e}toString(){return this.cssText}};const cm=Gc?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let n="";for(const r of t.cssRules)n+=r.cssText;return(r=>new ev(typeof r=="string"?r:r+"",void 0,am))(n)})(e):e,{is:tv,defineProperty:nv,getOwnPropertyDescriptor:iv,getOwnPropertyNames:rv,getOwnPropertySymbols:ov,getPrototypeOf:sv}=Object,oa=globalThis,dm=oa.trustedTypes,av=dm?dm.emptyScript:"",lv=oa.reactiveElementPolyfillSupport,Io=(e,t)=>e,sa={toAttribute(e,t){switch(t){case Boolean:e=e?av:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},Wc=(e,t)=>!tv(e,t),um={attribute:!0,type:String,converter:sa,reflect:!1,hasChanged:Wc};Symbol.metadata??=Symbol("metadata"),oa.litPropertyMetadata??=new WeakMap;class fr 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,n=um){if(n.state&&(n.attribute=!1),this._$Ei(),this.elementProperties.set(t,n),!n.noAccessor){const r=Symbol(),o=this.getPropertyDescriptor(t,r,n);o!==void 0&&nv(this.prototype,t,o)}}static getPropertyDescriptor(t,n,r){const{get:o,set:c}=iv(this.prototype,t)??{get(){return this[n]},set(l){this[n]=l}};return{get(){return o?.call(this)},set(l){const u=o?.call(this);c.call(this,l),this.requestUpdate(t,u,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??um}static _$Ei(){if(this.hasOwnProperty(Io("elementProperties")))return;const t=sv(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Io("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Io("properties"))){const n=this.properties,r=[...rv(n),...ov(n)];for(const o of r)this.createProperty(o,n[o])}const t=this[Symbol.metadata];if(t!==null){const n=litPropertyMetadata.get(t);if(n!==void 0)for(const[r,o]of n)this.elementProperties.set(r,o)}this._$Eh=new Map;for(const[n,r]of this.elementProperties){const o=this._$Eu(n,r);o!==void 0&&this._$Eh.set(o,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const n=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const o of r)n.unshift(cm(o))}else t!==void 0&&n.push(cm(t));return n}static _$Eu(t,n){const r=n.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?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),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,n=this.constructor.elementProperties;for(const r of n.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((n,r)=>{if(Gc)n.adoptedStyleSheets=r.map((o=>o instanceof CSSStyleSheet?o:o.styleSheet));else for(const o of r){const c=document.createElement("style"),l=ra.litNonce;l!==void 0&&c.setAttribute("nonce",l),c.textContent=o.cssText,n.appendChild(c)}})(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,n,r){this._$AK(t,r)}_$EC(t,n){const r=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,r);if(o!==void 0&&r.reflect===!0){const c=(r.converter?.toAttribute!==void 0?r.converter:sa).toAttribute(n,r.type);this._$Em=t,c==null?this.removeAttribute(o):this.setAttribute(o,c),this._$Em=null}}_$AK(t,n){const r=this.constructor,o=r._$Eh.get(t);if(o!==void 0&&this._$Em!==o){const c=r.getPropertyOptions(o),l=typeof c.converter=="function"?{fromAttribute:c.converter}:c.converter?.fromAttribute!==void 0?c.converter:sa;this._$Em=o,this[o]=l.fromAttribute(n,c.type),this._$Em=null}}requestUpdate(t,n,r){if(t!==void 0){if(r??=this.constructor.getPropertyOptions(t),!(r.hasChanged??Wc)(this[t],n))return;this.P(t,n,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,n,r){this._$AL.has(t)||this._$AL.set(t,n),r.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const t=this.scheduleUpdate();return t!=null&&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[o,c]of this._$Ep)this[o]=c;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[o,c]of r)c.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],c)}let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),this._$EO?.forEach((r=>r.hostUpdate?.())),this.update(n)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(n)}willUpdate(t){}_$AE(t){this._$EO?.forEach((n=>n.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((n=>this._$EC(n,this[n]))),this._$EU()}updated(t){}firstUpdated(t){}}fr.elementStyles=[],fr.shadowRootOptions={mode:"open"},fr[Io("elementProperties")]=new Map,fr[Io("finalized")]=new Map,lv?.({ReactiveElement:fr}),(oa.reactiveElementVersions??=[]).push("2.0.4");const Kc=globalThis,aa=Kc.trustedTypes,hm=aa?aa.createPolicy("lit-html",{createHTML:e=>e}):void 0,pm="$lit$",Bn=`lit$${(Math.random()+"").slice(9)}$`,mm="?"+Bn,cv=`<${mm}>`,xi=document,ko=()=>xi.createComment(""),Eo=e=>e===null||typeof e!="object"&&typeof e!="function",gm=Array.isArray,Qc=`[
|
|
31
|
+
\f\r]`,So=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,fm=/-->/g,ym=/>/g,Ai=RegExp(`>|${Qc}(?:([^\\s"'>=/]+)(${Qc}*=${Qc}*(?:[^
|
|
32
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),vm=/'/g,bm=/"/g,_m=/^(?:script|style|textarea|title)$/i,wm=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),Fn=Symbol.for("lit-noChange"),rt=Symbol.for("lit-nothing"),Cm=new WeakMap,Mi=xi.createTreeWalker(xi,129);function Im(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return hm!==void 0?hm.createHTML(t):t}class Po{constructor({strings:t,_$litType$:n},r){let o;this.parts=[];let c=0,l=0;const u=t.length-1,m=this.parts,[v,R]=((k,M)=>{const D=k.length-1,ne=[];let oe,me=M===2?"<svg>":"",ce=So;for(let ye=0;ye<D;ye++){const Ve=k[ye];let li,et,St=-1,Mt=0;for(;Mt<Ve.length&&(ce.lastIndex=Mt,et=ce.exec(Ve),et!==null);)Mt=ce.lastIndex,ce===So?et[1]==="!--"?ce=fm:et[1]!==void 0?ce=ym:et[2]!==void 0?(_m.test(et[2])&&(oe=RegExp("</"+et[2],"g")),ce=Ai):et[3]!==void 0&&(ce=Ai):ce===Ai?et[0]===">"?(ce=oe??So,St=-1):et[1]===void 0?St=-2:(St=ce.lastIndex-et[2].length,li=et[1],ce=et[3]===void 0?Ai:et[3]==='"'?bm:vm):ce===bm||ce===vm?ce=Ai:ce===fm||ce===ym?ce=So:(ce=Ai,oe=void 0);const dt=ce===Ai&&k[ye+1].startsWith("/>")?" ":"";me+=ce===So?Ve+cv:St>=0?(ne.push(li),Ve.slice(0,St)+pm+Ve.slice(St)+Bn+dt):Ve+Bn+(St===-2?ye:dt)}return[Im(k,me+(k[D]||"<?>")+(M===2?"</svg>":"")),ne]})(t,n);if(this.el=Po.createElement(v,r),Mi.currentNode=this.el.content,n===2){const k=this.el.content.firstChild;k.replaceWith(...k.childNodes)}for(;(o=Mi.nextNode())!==null&&m.length<u;){if(o.nodeType===1){if(o.hasAttributes())for(const k of o.getAttributeNames())if(k.endsWith(pm)){const M=R[l++],D=o.getAttribute(k).split(Bn),ne=/([.?@])?(.*)/.exec(M);m.push({type:1,index:c,name:ne[2],strings:D,ctor:ne[1]==="."?uv:ne[1]==="?"?hv:ne[1]==="@"?pv:la}),o.removeAttribute(k)}else k.startsWith(Bn)&&(m.push({type:6,index:c}),o.removeAttribute(k));if(_m.test(o.tagName)){const k=o.textContent.split(Bn),M=k.length-1;if(M>0){o.textContent=aa?aa.emptyScript:"";for(let D=0;D<M;D++)o.append(k[D],ko()),Mi.nextNode(),m.push({type:2,index:++c});o.append(k[M],ko())}}}else if(o.nodeType===8)if(o.data===mm)m.push({type:2,index:c});else{let k=-1;for(;(k=o.data.indexOf(Bn,k+1))!==-1;)m.push({type:7,index:c}),k+=Bn.length-1}c++}}static createElement(t,n){const r=xi.createElement("template");return r.innerHTML=t,r}}function yr(e,t,n=e,r){if(t===Fn)return t;let o=r!==void 0?n._$Co?.[r]:n._$Cl;const c=Eo(t)?void 0:t._$litDirective$;return o?.constructor!==c&&(o?._$AO?.(!1),c===void 0?o=void 0:(o=new c(e),o._$AT(e,n,r)),r!==void 0?(n._$Co??=[])[r]=o:n._$Cl=o),o!==void 0&&(t=yr(e,o._$AS(e,t.values),o,r)),t}class dv{constructor(t,n){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:n},parts:r}=this._$AD,o=(t?.creationScope??xi).importNode(n,!0);Mi.currentNode=o;let c=Mi.nextNode(),l=0,u=0,m=r[0];for(;m!==void 0;){if(l===m.index){let v;m.type===2?v=new vr(c,c.nextSibling,this,t):m.type===1?v=new m.ctor(c,m.name,m.strings,this,t):m.type===6&&(v=new mv(c,this,t)),this._$AV.push(v),m=r[++u]}l!==m?.index&&(c=Mi.nextNode(),l++)}return Mi.currentNode=xi,o}p(t){let n=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,n),n+=r.strings.length-2):r._$AI(t[n])),n++}}class vr{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,n,r,o){this.type=2,this._$AH=rt,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=r,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&t?.nodeType===11&&(t=n.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,n=this){t=yr(this,t,n),Eo(t)?t===rt||t==null||t===""?(this._$AH!==rt&&this._$AR(),this._$AH=rt):t!==this._$AH&&t!==Fn&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):(r=>gm(r)||typeof r?.[Symbol.iterator]=="function")(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==rt&&Eo(this._$AH)?this._$AA.nextSibling.data=t:this.T(xi.createTextNode(t)),this._$AH=t}$(t){const{values:n,_$litType$:r}=t,o=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=Po.createElement(Im(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===o)this._$AH.p(n);else{const c=new dv(o,this),l=c.u(this.options);c.p(n),this.T(l),this._$AH=c}}_$AC(t){let n=Cm.get(t.strings);return n===void 0&&Cm.set(t.strings,n=new Po(t)),n}k(t){gm(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let r,o=0;for(const c of t)o===n.length?n.push(r=new vr(this.S(ko()),this.S(ko()),this,this.options)):r=n[o],r._$AI(c),o++;o<n.length&&(this._$AR(r&&r._$AB.nextSibling,o),n.length=o)}_$AR(t=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class la{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,r,o,c){this.type=1,this._$AH=rt,this._$AN=void 0,this.element=t,this.name=n,this._$AM=o,this.options=c,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=rt}_$AI(t,n=this,r,o){const c=this.strings;let l=!1;if(c===void 0)t=yr(this,t,n,0),l=!Eo(t)||t!==this._$AH&&t!==Fn,l&&(this._$AH=t);else{const u=t;let m,v;for(t=c[0],m=0;m<c.length-1;m++)v=yr(this,u[r+m],n,m),v===Fn&&(v=this._$AH[m]),l||=!Eo(v)||v!==this._$AH[m],v===rt?t=rt:t!==rt&&(t+=(v??"")+c[m+1]),this._$AH[m]=v}l&&!o&&this.j(t)}j(t){t===rt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class uv extends la{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===rt?void 0:t}}class hv extends la{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==rt)}}class pv extends la{constructor(t,n,r,o,c){super(t,n,r,o,c),this.type=5}_$AI(t,n=this){if((t=yr(this,t,n,0)??rt)===Fn)return;const r=this._$AH,o=t===rt&&r!==rt||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,c=t!==rt&&(r===rt||o);o&&this.element.removeEventListener(this.name,this,r),c&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class mv{constructor(t,n,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){yr(this,t)}}const gv={I:vr},fv=Kc.litHtmlPolyfillSupport;fv?.(Po,vr),(Kc.litHtmlVersions??=[]).push("3.1.2");let Oo=class extends fr{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((n,r,o)=>{const c=o?.renderBefore??r;let l=c._$litPart$;if(l===void 0){const u=o?.renderBefore??null;c._$litPart$=l=new vr(r.insertBefore(ko(),u),u,void 0,o??{})}return l._$AI(n),l})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Fn}};Oo._$litElement$=!0,Oo.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:Oo});const yv=globalThis.litElementPolyfillSupport;yv?.({LitElement:Oo}),(globalThis.litElementVersions??=[]).push("4.0.4");const vv={attribute:!0,type:String,converter:sa,reflect:!1,hasChanged:Wc},bv=(e=vv,t,n)=>{const{kind:r,metadata:o}=n;let c=globalThis.litPropertyMetadata.get(o);if(c===void 0&&globalThis.litPropertyMetadata.set(o,c=new Map),c.set(n.name,e),r==="accessor"){const{name:l}=n;return{set(u){const m=t.get.call(this);t.set.call(this,u),this.requestUpdate(l,m,e)},init(u){return u!==void 0&&this.P(l,void 0,e),u}}}if(r==="setter"){const{name:l}=n;return function(u){const m=this[l];t.call(this,u),this.requestUpdate(l,m,e)}}throw Error("Unsupported decorator location: "+r)};function Ro(e){return(t,n)=>typeof n=="object"?bv(e,t,n):((r,o,c)=>{const l=o.hasOwnProperty(c);return o.constructor.createProperty(c,l?{...r,wrapped:!0}:r),l?Object.getOwnPropertyDescriptor(o,c):void 0})(e,t,n);}const Xc=2,km=e=>(...t)=>({_$litDirective$:e,values:t});class Em{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,n,r){this._$Ct=t,this._$AM=n,this._$Ci=r}_$AS(t,n){return this.update(t,n)}update(t,n){return this.render(...n)}}const{I:_v}=gv,Sm=()=>document.createComment(""),To=(e,t,n)=>{const r=e._$AA.parentNode,o=t===void 0?e._$AB:t._$AA;if(n===void 0){const c=r.insertBefore(Sm(),o),l=r.insertBefore(Sm(),o);n=new _v(c,l,e,e.options)}else{const c=n._$AB.nextSibling,l=n._$AM,u=l!==e;if(u){let m;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(m=e._$AU)!==l._$AU&&n._$AP(m)}if(c!==o||u){let m=n._$AA;for(;m!==c;){const v=m.nextSibling;r.insertBefore(m,o),m=v}}}return n},Li=(e,t,n=e)=>(e._$AI(t,n),e),wv={},Zc=e=>{e._$AP?.(!1,!0);let t=e._$AA;const n=e._$AB.nextSibling;for(;t!==n;){const r=t.nextSibling;t.remove(),t=r}},xo=(e,t)=>{const n=e._$AN;if(n===void 0)return!1;for(const r of n)r._$AO?.(t,!1),xo(r,t);return!0},ca=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},Pm=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),kv(t)}};function Cv(e){this._$AN!==void 0?(ca(this),this._$AM=e,Pm(this)):this._$AM=e}function Iv(e,t=!1,n=0){const r=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(r))for(let c=n;c<r.length;c++)xo(r[c],!1),ca(r[c]);else r!=null&&(xo(r,!1),ca(r));else xo(this,e)}const kv=e=>{e.type==Xc&&(e._$AP??=Iv,e._$AQ??=Cv)};class Ev extends Em{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,n,r){super._$AT(t,n,r),Pm(this),this.isConnected=t._$AU}_$AO(t,n=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),n&&(xo(this,t),ca(this))}setValue(t){if((n=>n.strings===void 0)(this._$Ct))this._$Ct._$AI(t,this);else{const n=[...this._$Ct._$AH];n[this._$Ci]=t,this._$Ct._$AI(n,this,0)}}disconnected(){}reconnected(){}}const Om=(e,t,n)=>{const r=new Map;for(let o=t;o<=n;o++)r.set(e[o],o);return r},Sv=km(class extends Em{constructor(e){if(super(e),e.type!==Xc)throw Error("repeat() can only be used in text expressions")}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);const o=[],c=[];let l=0;for(const u of e)o[l]=r?r(u,l):l,c[l]=n(u,l),l++;return{values:c,keys:o}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){const o=(oe=>oe._$AH)(e),{values:c,keys:l}=this.dt(t,n,r);if(!Array.isArray(o))return this.ut=l,c;const u=this.ut??=[],m=[];let v,R,k=0,M=o.length-1,D=0,ne=c.length-1;for(;k<=M&&D<=ne;)if(o[k]===null)k++;else if(o[M]===null)M--;else if(u[k]===l[D])m[D]=Li(o[k],c[D]),k++,D++;else if(u[M]===l[ne])m[ne]=Li(o[M],c[ne]),M--,ne--;else if(u[k]===l[ne])m[ne]=Li(o[k],c[ne]),To(e,m[ne+1],o[k]),k++,ne--;else if(u[M]===l[D])m[D]=Li(o[M],c[D]),To(e,o[k],o[M]),M--,D++;else if(v===void 0&&(v=Om(l,D,ne),R=Om(u,k,M)),v.has(u[k]))if(v.has(u[M])){const oe=R.get(l[D]),me=oe!==void 0?o[oe]:null;if(me===null){const ce=To(e,o[k]);Li(ce,c[D]),m[D]=ce}else m[D]=Li(me,c[D]),To(e,o[k],me),o[oe]=null;D++}else Zc(o[M]),M--;else Zc(o[k]),k++;for(;D<=ne;){const oe=To(e,m[ne+1]);Li(oe,c[D]),m[D++]=oe}for(;k<=M;){const oe=o[k++];oe!==null&&Zc(oe)}return this.ut=l,((oe,me=wv)=>{oe._$AH=me})(e,m),Fn}});class da extends Event{constructor(t){super(da.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}}da.eventName="rangeChanged";class ua extends Event{constructor(t){super(ua.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}}ua.eventName="visibilityChanged";class ha extends Event{constructor(){super(ha.eventName,{bubbles:!1})}}ha.eventName="unpinned";class Pv{constructor(t){this._element=null;const n=t??window;this._node=n,t&&(this._element=t)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}}class Ov extends Pv{constructor(t,n){super(n),this._clients=new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);const r=this._node;this._originalScrollTo=r.scrollTo,this._originalScrollBy=r.scrollBy,this._originalScroll=r.scroll,this._attach(t)}get _destination(){return this.__destination}get scrolling(){return this._destination!==null}scrollTo(t,n){const r=typeof t=="number"&&typeof n=="number"?{left:t,top:n}:t;this._scrollTo(r)}scrollBy(t,n){const r=typeof t=="number"&&typeof n=="number"?{left:t,top:n}:t;r.top!==void 0&&(r.top+=this.scrollTop),r.left!==void 0&&(r.left+=this.scrollLeft),this._scrollTo(r)}_nativeScrollTo(t){this._originalScrollTo.bind(this._element||window)(t)}_scrollTo(t,n=null,r=null){this._end!==null&&this._end(),t.behavior==="smooth"?(this._setDestination(t),this._retarget=n,this._end=r):this._resetScrollState(),this._nativeScrollTo(t)}_setDestination(t){let{top:n,left:r}=t;return n=n===void 0?void 0:Math.max(0,Math.min(n,this.maxScrollTop)),r=r===void 0?void 0:Math.max(0,Math.min(r,this.maxScrollLeft)),(this._destination===null||r!==this._destination.left||n!==this._destination.top)&&(this.__destination={top:n,left:r,behavior:"smooth"},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(t){this._destination&&this._setDestination(t)&&this._nativeScrollTo(this._destination)}managedScrollTo(t,n,r){return this._scrollTo(t,n,r),this._updateManagedScrollTo}correctScrollError(t){this.correctingScrollError=!0,requestAnimationFrame((()=>requestAnimationFrame((()=>this.correctingScrollError=!1)))),this._nativeScrollTo(t),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(this._destination!==null){const{scrollTop:t,scrollLeft:n}=this;let{top:r,left:o}=this._destination;r=Math.min(r||0,this.maxScrollTop),o=Math.min(o||0,this.maxScrollLeft);const c=Math.abs(r-t),l=Math.abs(o-n);c<1&&l<1&&(this._end&&this._end(),this._resetScrollState())}}detach(t){return this._clients.delete(t),this._clients.size===0&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(t){this._clients.add(t),this._clients.size===1&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}}let Rm=window?.ResizeObserver;const Jc=Symbol("virtualizerRef"),pa="virtualizer-sizer";let Tm;class Rv{constructor(t){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,!t)throw new Error("Virtualizer constructor requires a configuration object");if(!t.hostElement)throw new Error('Virtualizer configuration requires the "hostElement" property');this._init(t)}set items(t){Array.isArray(t)&&t!==this._items&&(this._itemsChanged=!0,this._items=t,this._schedule(this._updateLayout))}_init(t){this._isScroller=!!t.scroller,this._initHostElement(t);const n=t.layout||{};this._layoutInitialized=this._initLayout(n)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new Rm((()=>this._hostElementSizeChanged())),this._childrenRO=new Rm(this._childrenSizeChanged.bind(this))}_initHostElement(t){const n=this._hostElement=t.hostElement;this._applyVirtualizerStyles(),n[Jc]=this}connected(){this._initObservers();const t=this._isScroller;this._clippingAncestors=(function(n,r=!1){let o=!1;return(function(c,l=!1){const u=[];let m=l?c:xm(c);for(;m!==null;)u.push(m),m=xm(m);return u})(n,r).filter((c=>{if(o)return!1;const l=getComputedStyle(c);return o=l.position==="fixed",l.overflow!=="visible"}))})(this._hostElement,t),this._scrollerController=new Ov(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen()}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach((t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)})),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach((t=>this._childrenRO.observe(t))),this._scrollEventListeners.forEach((t=>t.addEventListener("scroll",this,this._scrollEventListenerOptions)))}disconnected(){this._scrollEventListeners.forEach((t=>t.removeEventListener("scroll",this,this._scrollEventListenerOptions))),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected")}_applyVirtualizerStyles(){const t=this._hostElement.style;t.display=t.display||"block",t.position=t.position||"relative",t.contain=t.contain||"size layout",this._isScroller&&(t.overflow=t.overflow||"auto",t.minHeight=t.minHeight||"150px")}_getSizer(){const t=this._hostElement;if(!this._sizer){let n=t.querySelector(`[${pa}]`);n||(n=document.createElement("div"),n.setAttribute(pa,""),t.appendChild(n)),Object.assign(n.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),n.textContent=" ",n.setAttribute(pa,""),this._sizer=n}return this._sizer}async updateLayoutConfig(t){await this._layoutInitialized;const n=t.type||Tm;if(typeof n=="function"&&this._layout instanceof n){const r={...t};return delete r.type,this._layout.config=r,!0}return!1}async _initLayout(t){let n,r;if(typeof t.type=="function"){r=t.type;const o={...t};delete o.type,n=o}else n=t;r===void 0&&(Tm=r=(await Promise.resolve().then((function(){return t2}))).FlowLayout),this._layout=new r((o=>this._handleLayoutMessage(o)),n),this._layout.measureChildren&&typeof this._layout.updateItemSizes=="function"&&(typeof this._layout.measureChildren=="function"&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){this._benchmarkStart===null&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(this._benchmarkStart!==null){const t=window.performance.now(),n=t-this._benchmarkStart,r=performance.getEntriesByName("uv-virtualizing","measure").filter((o=>o.startTime>=this._benchmarkStart&&o.startTime<t)).reduce(((o,c)=>o+c.duration),0);return this._benchmarkStart=null,{timeElapsed:n,virtualizationTime:r}}return null}_measureChildren(){const t={},n=this._children,r=this._measureChildOverride||this._measureChild;for(let o=0;o<n.length;o++){const c=n[o],l=this._first+o;(this._itemsChanged||this._toBeMeasured.has(c))&&(t[l]=r.call(this,c,this._items[l]))}this._childMeasurements=t,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(t){const{width:n,height:r}=t.getBoundingClientRect();return Object.assign({width:n,height:r},(function(o){const c=window.getComputedStyle(o);return{marginTop:ma(c.marginTop),marginRight:ma(c.marginRight),marginBottom:ma(c.marginBottom),marginLeft:ma(c.marginLeft)}})(t))}async _schedule(t){this._scheduled.has(t)||(this._scheduled.add(t),await Promise.resolve(),this._scheduled.delete(t),t.call(this))}async _updateDOM(t){this._scrollSize=t.scrollSize,this._adjustRange(t.range),this._childrenPos=t.childPositions,this._scrollError=t.scrollError||null;const{_rangeChanged:n,_itemsChanged:r}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(n||r)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._children.forEach((t=>this._childrenRO.observe(t))),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end")}_updateLayout(){this._layout&&this._scrollerController&&(this._layout.items=this._items,this._updateView(),this._childMeasurements!==null&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(t){console.warn("Error measuring performance data: ",t)}window.performance.mark("uv-start")}this._scrollerController.correctingScrollError===!1&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(t){t.type==="scroll"?(t.currentTarget===window||this._clippingAncestors.includes(t.currentTarget))&&this._handleScrollEvent():console.warn("event not handled",t)}_handleLayoutMessage(t){t.type==="stateChanged"?this._updateDOM(t):t.type==="visibilityChanged"?(this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._notifyVisibility()):t.type==="unpinned"&&this._hostElement.dispatchEvent(new ha)}get _children(){const t=[];let n=this._hostElement.firstElementChild;for(;n;)n.hasAttribute(pa)||t.push(n),n=n.nextElementSibling;return t}_updateView(){const t=this._hostElement,n=this._scrollerController?.element,r=this._layout;if(t&&n&&r){let o,c,l,u;const m=t.getBoundingClientRect();o=0,c=0,l=window.innerHeight,u=window.innerWidth;const v=this._clippingAncestors.map((ce=>ce.getBoundingClientRect()));v.unshift(m);for(const ce of v)o=Math.max(o,ce.top),c=Math.max(c,ce.left),l=Math.min(l,ce.bottom),u=Math.min(u,ce.right);const R=n.getBoundingClientRect(),k={left:m.left-R.left,top:m.top-R.top},M={width:n.scrollWidth,height:n.scrollHeight},D=o-m.top+t.scrollTop,ne=c-m.left+t.scrollLeft,oe=l-o,me=u-c;r.viewportSize={width:me,height:oe},r.viewportScroll={top:D,left:ne},r.totalScrollSize=M,r.offsetWithinScroller=k}}_sizeHostElement(t){const r=t&&t.width!==null?Math.min(82e5,t.width):0,o=t&&t.height!==null?Math.min(82e5,t.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${r}px, ${o}px)`;else{const c=this._hostElement.style;c.minWidth=r?`${r}px`:"100%",c.minHeight=o?`${o}px`:"100%"}}_positionChildren(t){t&&t.forEach((({top:n,left:r,width:o,height:c,xOffset:l,yOffset:u},m)=>{const v=this._children[m-this._first];v&&(v.style.position="absolute",v.style.boxSizing="border-box",v.style.transform=`translate(${r}px, ${n}px)`,o!==void 0&&(v.style.width=o+"px"),c!==void 0&&(v.style.height=c+"px"),v.style.left=l===void 0?null:l+"px",v.style.top=u===void 0?null:u+"px")}))}async _adjustRange(t){const{_first:n,_last:r,_firstVisible:o,_lastVisible:c}=this;this._first=t.first,this._last=t.last,this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==n||this._last!==r,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==o||this._lastVisible!==c}_correctScrollError(){if(this._scrollError){const{scrollTop:t,scrollLeft:n}=this._scrollerController,{top:r,left:o}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:t-r,left:n-o})}}element(t){return t===1/0&&(t=this._items.length-1),this._items?.[t]===void 0?void 0:{scrollIntoView:(n={})=>this._scrollElementIntoView({...n,index:t})}}_scrollElementIntoView(t){if(t.index>=this._first&&t.index<=this._last)this._children[t.index-this._first].scrollIntoView(t);else if(t.index=Math.min(t.index,this._items.length-1),t.behavior==="smooth"){const n=this._layout.getScrollIntoViewCoordinates(t),{behavior:r}=t;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(n,{behavior:r}),(()=>this._layout.getScrollIntoViewCoordinates(t)),(()=>this._scrollIntoViewTarget=null)),this._scrollIntoViewTarget=t}else this._layout.pin=t}_checkScrollIntoViewTarget(t){const{index:n}=this._scrollIntoViewTarget||{};n&&t?.has(n)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new da({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new ua({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise(((t,n)=>{this._layoutCompleteResolver=t,this._layoutCompleteRejecter=n}))),this._layoutCompletePromise}_rejectLayoutCompletePromise(t){this._layoutCompleteRejecter!==null&&this._layoutCompleteRejecter(t),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&this._pendingLayoutComplete===null&&(this._pendingLayoutComplete=requestAnimationFrame((()=>requestAnimationFrame((()=>this._resolveLayoutCompletePromise())))))}_resolveLayoutCompletePromise(){this._layoutCompleteResolver!==null&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(t){if(this._layout?.measureChildren){for(const n of t)this._toBeMeasured.set(n.target,n.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function ma(e){const t=e?parseFloat(e):NaN;return Number.isNaN(t)?0:t}function xm(e){if(e.assignedSlot!==null)return e.assignedSlot;if(e.parentElement!==null)return e.parentElement;const t=e.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}const Am=e=>e,Mm=(e,t)=>wm`${t}: ${JSON.stringify(e,null,2)}`,Tv=km(class extends Ev{constructor(e){if(super(e),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(t,n)=>Mm(t,n+this._first),this._keyFunction=(t,n)=>Am(t,this._first),this._items=[],e.type!==Xc)throw new Error("The virtualize directive can only be used in child expressions")}render(e){e&&this._setFunctions(e);const t=[];if(this._first>=0&&this._last>=this._first)for(let n=this._first;n<=this._last;n++)t.push(this._items[n]);return Sv(t,this._keyFunction,this._renderItem)}update(e,[t]){this._setFunctions(t);const n=this._items!==t.items;return this._items=t.items||[],this._virtualizer?this._updateVirtualizerConfig(e,t):this._initialize(e,t),n?Fn:this.render()}async _updateVirtualizerConfig(e,t){if(!await this._virtualizer.updateLayoutConfig(t.layout||{})){const n=e.parentNode;this._makeVirtualizer(n,t)}this._virtualizer.items=this._items}_setFunctions(e){const{renderItem:t,keyFunction:n}=e;t&&(this._renderItem=(r,o)=>t(r,o+this._first)),n&&(this._keyFunction=(r,o)=>n(r,o+this._first))}_makeVirtualizer(e,t){this._virtualizer&&this._virtualizer.disconnected();const{layout:n,scroller:r,items:o}=t;this._virtualizer=new Rv({hostElement:e,layout:n,scroller:r}),this._virtualizer.items=o,this._virtualizer.connected()}_initialize(e,t){const n=e.parentNode;n&&n.nodeType===1&&(n.addEventListener("rangeChanged",(r=>{this._first=r.first,this._last=r.last,this.setValue(this.render())})),this._makeVirtualizer(n,t))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});class br extends Oo{constructor(){super(...arguments),this.items=[],this.renderItem=Mm,this.keyFunction=Am,this.layout={},this.scroller=!1}createRenderRoot(){return this}render(){const{items:t,renderItem:n,keyFunction:r,layout:o,scroller:c}=this;return wm`${Tv({items:t,renderItem:n,keyFunction:r,layout:o,scroller:c})}`}element(t){return this[Jc]?.element(t)}get layoutComplete(){return this[Jc]?.layoutComplete}scrollToIndex(t,n="start"){this.element(t)?.scrollIntoView({block:n})}}Co([Ro({attribute:!1})],br.prototype,"items",void 0),Co([Ro()],br.prototype,"renderItem",void 0),Co([Ro()],br.prototype,"keyFunction",void 0),Co([Ro({attribute:!1})],br.prototype,"layout",void 0),Co([Ro({reflect:!0,type:Boolean})],br.prototype,"scroller",void 0),customElements.define("lit-virtualizer",br);const xv=I`<style>livelike-previous-messages-button{position:relative!important}livelike-message-virtual-list{height:100%}.load-prev-msg-container{display:flex;justify-content:center;padding-bottom:1rem}.load-prev-msg-container button{padding:.5rem;background:#27bf9d;border:0;color:#212333;cursor:pointer}.load-prev-msg-container button:disabled{background:#84858b;cursor:not-allowed}.sender-name{color:#646875}.sender-message{color:#fff}.message-timestamp{color:#646875}</style>`;var Lm=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let ga=class extends ia{constructor(){super(...arguments),this.appendMessage=e=>{const t=e.detail.message,n=e.detail.prevMessage;if(this.hasMessageData(t)){const r=!n&&this.checkIfAtBottom(),o=this.scrollHeight>0?250:750;!n&&(t.sender_id===ae.id||r)&&this.deferredScrollToBottom(o)}},this.prependMessages=e=>{setTimeout((()=>{this.virtualiser.element(e.detail.messages.length+1).scrollIntoView({behavior:"instant",block:"start"})}),0)},this.checkIfAtBottom=()=>{var e;const t=this.children[this.children.length-1];if(!t||!this.scrollHeight)return!0;const n=(e=t.querySelector(".message-item-container"))===null||e===void 0?void 0:e.clientHeight;return Math.abs(this.virtualiser.scrollHeight-(this.virtualiser.scrollTop+this.virtualiser.clientHeight))<.5*n},this.scrollToBottom=()=>{this.virtualiser.element(this.owner.messageList.length).scrollIntoView()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.virtualiser=this.querySelector("lit-virtualizer"),this.virtualiser.addEventListener("scroll",this.scrollListener),this.virtualiser.style.height="100%"}),0)}disconnectedCallback(){super.disconnectedCallback(),this.virtualiser.removeEventListener("scroll",this.scrollListener)}render(){return I`${xv}<lit-virtualizer scroller .items="${[this.renderLoadPrevMessageButton(),...this.owner.messageList]}" .renderItem="${(e,t)=>{const n=t-1;return t===0?document.createElement("livelike-previous-messages-button"):e?this.createMessageElem(this.owner.messageList[n]):null}}"></lit-virtualizer>`}};Lm([C({type:HTMLElement})],ga.prototype,"virtualiser",void 0),ga=Lm([de("livelike-message-virtual-list")],ga);const Av=()=>`
|
|
33
|
+
:host {
|
|
34
|
+
display: flex;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
livelike-chat-composer {
|
|
38
|
+
display: flex;
|
|
39
|
+
position: relative;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
flex-shrink: 0;
|
|
42
|
+
}
|
|
43
|
+
.livelike-composer-quote-message {
|
|
44
|
+
display: flex;
|
|
45
|
+
width: 95%;
|
|
46
|
+
border-radius: 12px;
|
|
47
|
+
background: rgb(0, 0, 0, 0.4);
|
|
48
|
+
padding: 0.5rem;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
livelike-quote-message-item {
|
|
52
|
+
flex-grow: 1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.livelike-compose-quote-message-cancel {
|
|
56
|
+
display: flex;
|
|
57
|
+
padding: 0 0.3rem 0 0.8rem;
|
|
58
|
+
align-items: center;
|
|
59
|
+
color: #808080;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.livelike-compose-quote-message-cancel svg {
|
|
63
|
+
transform: scale(2);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.livelike-compose-quote-message-cancel circle {
|
|
67
|
+
fill: transparent;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.livelike-compose-quote-message-cancel path {
|
|
72
|
+
fill: #808080;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
}
|
|
75
|
+
.livelike-chat-input {
|
|
76
|
+
border: 0;
|
|
77
|
+
background: #fff;
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
border-radius: 0.5rem;
|
|
80
|
+
color: inherit;
|
|
81
|
+
font-size: 1rem;
|
|
82
|
+
font-family: inherit;
|
|
83
|
+
line-height: 1.5rem;
|
|
84
|
+
height: 40px;
|
|
85
|
+
min-height: 2.5rem;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
padding: 0.5rem 5rem 0.5rem 0.5rem;
|
|
88
|
+
resize: none;
|
|
89
|
+
width: 100%;
|
|
90
|
+
border: 1px solid transparent;
|
|
91
|
+
}
|
|
92
|
+
.livelike-chat-input:focus {
|
|
93
|
+
outline: none;
|
|
94
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
95
|
+
}
|
|
96
|
+
.livelike-chat-input::placeholder {
|
|
97
|
+
color: rgba(0, 0, 0, 0.35);
|
|
98
|
+
}
|
|
99
|
+
.send-button {
|
|
100
|
+
background: none;
|
|
101
|
+
border: none;
|
|
102
|
+
padding: 0;
|
|
103
|
+
margin-left: 1rem;
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
transition: all 0.3s ease-out;
|
|
107
|
+
}
|
|
108
|
+
.send-icon {
|
|
109
|
+
border: none;
|
|
110
|
+
background: none;
|
|
111
|
+
}
|
|
112
|
+
.send-icon svg {
|
|
113
|
+
fill: #777;
|
|
114
|
+
}
|
|
115
|
+
.send-icon:hover svg,
|
|
116
|
+
.send-icon:focus svg {
|
|
117
|
+
transition: all 0.3s ease-out;
|
|
118
|
+
}
|
|
119
|
+
.send-icon:hover {
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
}
|
|
122
|
+
.sticker-picker-container {
|
|
123
|
+
position: absolute;
|
|
124
|
+
border: none;
|
|
125
|
+
background: none;
|
|
126
|
+
right: 2rem;
|
|
127
|
+
bottom: 0.5rem;
|
|
128
|
+
transition: all 0.3s ease-out;
|
|
129
|
+
}
|
|
130
|
+
`,Mv=I`<style>.livelike-chat-composer-input{display:flex;position:relative;flex-shrink:0}</style>`,$m=I`<style>.sticker-nav-container{position:relative;background:#282828;height:auto;width:100%;border-radius:0 0 8px 8px;overflow:auto;min-width:15rem}.sticker-nav-wrap{display:flex;list-style-type:none;padding:0;margin:0}.sticker-nav-item{border:none;background:rgba(255,255,255,0);transition:all .2s;padding:10px}.sticker-nav-item.active{background:#141414;border-radius:0 0 8px 8px}.sticker-nav-item:hover{cursor:pointer}.sticker-nav-item img{width:20px;height:20px;vertical-align:middle;border:0}</style>`,Lv=I`<style>@keyframes slideIn{from{opacity:0;transform:translate3d(0,-1rem,0)}to{opacity:1;transform:translate3d(0,-.5rem,0)}}.sticker-icon{border:none;background:0 0;padding:1px 6px}.sticker-icon:hover{cursor:pointer}.sticker-icon svg{fill:#888}.sticker-container{position:absolute;bottom:4rem;opacity:0;transition:all ease .3s;z-index:21;right:0;max-width:20rem}.sticker-container.show{opacity:1;transition:all ease .3s}.sticker-container.hide{opacity:0;transition:all ease .3s}.sticker-container-header{position:relative;border-radius:.5rem .5rem 0 0;background:#141414;padding:.625rem 1rem;color:#fff;font-size:1rem;font-weight:700}.sticker-close-icon{border:none;background:0 0;position:relative;float:right;top:-1px;right:0;background-size:contain;width:1.25rem;height:1.25rem;cursor:pointer}.sticker-body{position:relative;background:#141414;padding:.625rem .3rem;display:flex;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap;overflow-y:auto;min-height:8rem;max-height:8rem}.sticker-wrap{border:none;color:#fff;padding:.325rem;width:3.75rem;background:0 0;border-radius:.75rem;transition:all ease .3s;margin:.425rem}.sticker-wrap:focus,.sticker-wrap:hover{outline:0;background:#818592;cursor:pointer}.sticker-image{width:100%;vertical-align:middle}</style>`;var zn=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Jt=class extends it{constructor(){super(...arguments),this.drawerOpen=!1,this.animation=0,this.keyedLocalize=(e,t)=>this.owner.localize(this.localizationKey+e,t),this.closeDrawer=()=>{Ie(this,"drawer-closed"),Ri(this,"drawerOpen")},this.stickerBody=()=>this.stickers&&this.stickers.map((e=>I`<button tabindex="0" type="button" class="sticker-wrap" aria-label="${this.keyedLocalize(".stickerSelectionButton.ariaLabel",{stickerName:e.shortcode||e.title})}" @click="${()=>{Ie(this,"sticker-selected",{sticker:e}),this.closeDrawer()}}"><span class="sticker-wrap-image"><img class="sticker-image" src="${e.file||e.images.preview_gif.url}" alt="${e.shortcode||e.title}"></span></button>`)),this.renderStickerDrawer=()=>{const e=this.title||this.keyedLocalize(".title");return I`<div class="sticker-container" style="opacity:${this.animation}" aria-label="${e}"><header class="sticker-container-header"><span class="title">${e}</span> <button tabindex="0" type="button" class="sticker-close-icon" aria-label="${this.keyedLocalize(".closeButton.ariaLabel")}" @click="${this.closeDrawer}">${Wp}</button></header><div class="sticker-body">${this.stickerBody()}</div>${this.navFooterTemplate?this.navFooterTemplate():null}</div>`}}createRenderRoot(){return this}render(){return I`${Lv} <button tabindex="0" type="button" class="sticker-icon" aria-label="${this.keyedLocalize(".openButton.ariaLabel")}" @click="${()=>{hr(this,this.owner.dataId,"drawerOpen"),setTimeout((()=>{Ie(this,"drawer-opened")}),50)}}">${this.buttonIcon}</button> ${this.drawerOpen?this.renderStickerDrawer():null}`}};zn([C({type:Array})],Jt.prototype,"stickers",void 0),zn([C({type:String})],Jt.prototype,"buttonIcon",void 0),zn([C({type:Function})],Jt.prototype,"onStickerClick",void 0),zn([C({type:String,reflect:!0})],Jt.prototype,"title",void 0),zn([C({type:Boolean})],Jt.prototype,"drawerOpen",void 0),zn([C({type:String})],Jt.prototype,"animation",void 0),zn([C({type:String})],Jt.prototype,"localizationKey",void 0),Jt=zn([de("livelike-stickers")],Jt);var Yc=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Ao=class extends it{constructor(){super(...arguments),this.selectedPack="",this.changePack=e=>{this.selectedPack=e&&e.id,this.selectedStickers=e&&e.stickers},this.stickerNav=()=>this.owner.stickerPacks&&this.owner.stickerPacks.map((e=>{const t=e.id===this.selectedPack?"active":"";return I`<button tabindex="0" type="button" aria-label="${this.owner.localize("chat.stickerPicker.stickerPackTab.ariaLabel",{packName:e.name})}" class="sticker-nav-item ${t}" @click="${()=>this.changePack(e)}"><img src="${e.file}" alt="${e.name}"></button>`})),this.stickerNavFooter=()=>I`<nav slot="sticker-drawer-footer" class="sticker-nav-container"><div class="sticker-nav-wrap">${this.stickerNav()}</div></nav>`}createRenderRoot(){return this}ownerUpdated(e){!this.selectedStickers&&e.name==="stickerPacks"&&this.owner.stickerPacks&&this.owner.stickerPacks[0]&&this.changePack(this.owner.stickerPacks[0])}render(){return I`${$m} ${this.owner.stickerPacks&&this.owner.stickerPacks.length?I`<livelike-stickers .localizationKey="${"chat.stickerPicker"}" .stickers="${this.selectedStickers}" .buttonIcon="${Gp}" @drawer-opened="${()=>{}}" .navFooterTemplate="${this.stickerNavFooter}"></livelike-stickers>`:null}`}};Yc([C({type:String})],Ao.prototype,"selectedPack",void 0),Yc([C({type:Array})],Ao.prototype,"selectedStickers",void 0),Ao=Yc([de("livelike-sticker-picker")],Ao);var $i=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Hn=class extends it{constructor(){super(...arguments),this.message="",this.giphyList=[],this.offset=0,this.isDoneFetching=!0,this.loading=!1,this.scrollListenerAdded=!1,this.fetchNextPageIfBottom=Ks((()=>{const e=this.querySelector(".sticker-body");!(e&&e.scrollHeight-e.scrollTop===e.clientHeight)||this.isDoneFetching||this.loading||this.fetchGifs()})),this.fetchGifs=()=>{this.loading=!0,fetch(`https://api.giphy.com/v1/gifs/search?q=${this.message}&api_key=jlvX8uZILp5PhutmuW6fdATBP3E5uayi&offset=${this.offset}&rating=g`).then((e=>e.json())).then((e=>{this.loading=!1,this.giphyList=[...this.giphyList,...e.data],this.offset=e.pagination?e.pagination.count+e.pagination.offset:0,this.isDoneFetching=!e.pagination||this.offset===e.pagination.total_count}))},this.onStickerClick=e=>{this.owner.imagePicker?Tc(e.detail.sticker.images.downsized.url).then((t=>{const n={path:e.detail.sticker.images.downsized.url,width:e.detail.sticker.images.downsized.width,height:e.detail.sticker.images.downsized.height,file:t};Ie(this,"giphyselected",n)})):Ie(this,"sendChatMessage",{messageArgs:{image_url:e.detail.sticker.images.downsized.url,image_width:e.detail.sticker.images.downsized.width,image_height:e.detail.sticker.images.downsized.height}})},this.debouncedInputEvent=Ks((()=>{this.offset=0,this.giphyList=[],this.fetchGifs()})),this.handleMessage=e=>{e.stopPropagation(),this.message=e.target.value,this.debouncedInputEvent()},this.handleOpen=e=>{const t=e.target.querySelector(".sticker-body");t&&t.addEventListener("scroll",this.fetchNextPageIfBottom)},this.handleClose=e=>{this.message="",this.giphyList=[],this.offset=0;const t=e.target.querySelector(".sticker-body");t&&t.removeEventListener("scroll",this.fetchNextPageIfBottom)},this.stickerNavFooter=()=>I`<nav slot="sticker-drawer-footer" class="sticker-nav-container"><div class="sticker-nav-wrap"><input type="text" maxlength="25" style="height:25px" class="livelike-chat-input livelike-giphy-input" placeholder="${this.owner.localize("chat.giphyPicker.placeholder")}" @input="${this.handleMessage}" @keydown="${this.handleKeyDown}" .value="${this.message}"></div></nav>`}createRenderRoot(){return this}handleKeyDown(e){e.stopPropagation()}render(){return I`${$m}<livelike-stickers .localizationKey="${"chat.giphyPicker"}" .stickers="${this.giphyList}" .buttonIcon="${wy}" @sticker-selected="${this.onStickerClick}" @drawer-opened="${this.handleOpen}" @drawer-closed="${this.handleClose}" .navFooterTemplate="${this.stickerNavFooter}"></livelike-stickers>`}};$i([C({type:String})],Hn.prototype,"message",void 0),$i([C({type:Array})],Hn.prototype,"giphyList",void 0),$i([C({type:Number})],Hn.prototype,"offset",void 0),$i([C({type:Boolean})],Hn.prototype,"isDoneFetching",void 0),$i([C({type:Boolean})],Hn.prototype,"loading",void 0),$i([C({type:Boolean})],Hn.prototype,"scrollListenerAdded",void 0),Hn=$i([de("livelike-giphy-picker")],Hn);const $v=I`<style>.image-picker-icon-container{display:inline-block}.image-picker-icon{cursor:pointer;background:0 0;border:none}.image-picker-icon label{cursor:inherit}.livelike-file-input{display:none}</style>`;var Vv=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Vm=class extends it{constructor(){super(...arguments),this.handleImageChange=e=>{e.target.files.length>0&&this.dispatchImageSelectedEvent(e.target.files[0])},this.dispatchImageSelectedEvent=e=>{typeof e=="string"?Tc(e).then((t=>{Ie(this,"image-selected",t)})):Ie(this,"image-selected",e)},this.openImageSelectionWindow=()=>this.inputEl.click(),this.handleClick=e=>{if(!this.owner)return!1;const{chatImagePickerRenderer:t}=this.owner;t&&typeof t=="function"&&(e.preventDefault(),t({onImageSelection:this.dispatchImageSelectedEvent}))}}get inputEl(){return this.querySelector("input")}createRenderRoot(){return this}render(){return I`${$v}<div class="image-picker-icon-container"><button class="image-picker-icon" @click="${this.openImageSelectionWindow}">${Iy}</button> <input id="image-picker" class="livelike-file-input" type="file" accept="image/*" @change="${this.handleImageChange}" @click="${this.handleClick}"></div>`}};var It;Vm=Vv([de("livelike-image-picker")],Vm),(function(e){e.QUOTE_MESSAGE="quote-message",e.SHOW_MESSAGE_ITEM_MENU="show-message-item-menu"})(It||(It={}));var _r=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Vi=class extends it{constructor(){super(...arguments),this.defaultStyles=Av,this.message="",this.quoteMessage=void 0,this.ownerUpdated=e=>{e.name==="placeholder"&&(this.placeholder=e.prop),(e.name==="lang"||e.name==="translations")&&this.updateLocalizedPlaceholder()},this.updateLocalizedPlaceholder=()=>{if(!this.placeholder){const e=this.owner.localize("chat.inputPlaceholder");this.inputEl.placeholder=e,this.inputEl.setAttribute("aria-label",e)}this.sendBtn.setAttribute("aria-label",this.owner.localize("chat.sendButton.ariaLabel"))},this.sendClickHandler=()=>{this.imagePicked?(this.sendImage(this.imagePicked,this.quoteMessage),this.removeQuoteMessage(),this.removeImage(),this.resize("40px")):this.message&&(Ie(this,"sendChatMessage",{message:this.message,quoteMessage:this.quoteMessage}),this.message="",this.removeQuoteMessage(),this.inputEl.value="",this.showImagePickerIcon(),this.resize("40px"))},this.sendImage=(e,t)=>{const n=new FormData;n.append("image",e?.file,"image.png"),Qh({roomId:this.owner.roomid,imageFormData:n}).then((r=>{Ie(this,"sendChatMessage",{messageArgs:{image_url:r.image_url,image_width:e.width,image_height:e.height,uploadImage:!1},quoteMessage:t})})).catch((r=>console.error(r)))},this.addSticker=e=>{e.detail.sticker&&e.detail.sticker.shortcode&&this.message.length+e.detail.sticker.shortcode.length<=200&&(this.message=this.message+`:${e.detail.sticker.shortcode}:`,this.inputEl.value=this.message,this.hideImagePickerIcon(),this.inputEl.focus())},this.handleMessage=e=>{e.target.value!==void 0&&(this.message=e.target.value,this.imagePicker&&(this.message.length?this.hideImagePickerIcon():this.showImagePickerIcon())),this.resize(e.target.value===""?"40px":null)},this.setInputElRightPadding=e=>{this.inputContainerEl?this.inputContainerEl.style.paddingRight=e:this.inputEl.style.paddingRight=e},this.showImagePickerIcon=()=>{var e;!this.imagePicker||!((e=this.inputEl.value)===null||e===void 0)&&e.length||this.imagePicked||(this.imagePickerEl.style.display="inline-block",this.setInputElRightPadding("6.5rem"))},this.hideImagePickerIcon=()=>{this.imagePicker&&(this.imagePickerEl.style.display="none",this.setInputElRightPadding("5rem"))},this.handleKeyDown=e=>{e.which!==13||e.shiftKey||(e.preventDefault(),this.sendClickHandler(),this.inputEl.focus())},this.resize=e=>{this.inputEl.style.height=e||`${this.inputEl.scrollHeight}px`},this.handleQuoteEvent=e=>{const t=e.detail.status;t==="add"&&this.owner.messagequotes?(this.quoteMessage=e.detail.message,this.toggleQuoteMessageEl("show"),this.inputEl.focus()):t!=="remove"||!this.quoteMessage||e.detail.senderId!==this.quoteMessage.sender_id&&e.detail.messageId!==this.quoteMessage.id||this.removeQuoteMessage()},this.removeQuoteMessage=()=>{this.quoteMessage=void 0,this.toggleQuoteMessageEl("hide")},this.toggleQuoteMessageEl=e=>{if(e==="show"){this.querySelector(".livelike-composer-quote-message").style.display="flex";const t=this.querySelector("livelike-quote-message-item");t.message=this.quoteMessage,t.showavatar=this.owner.showavatar}else this.querySelector(".livelike-composer-quote-message").style.display="none",this.querySelector("livelike-quote-message-item").message=void 0},this.handleImagePaste=e=>{var t;if(e.clipboardData.types.includes("text/plain"))return;e.preventDefault();const n=[...e.clipboardData.files],r=/image/.test((t=n[0])===null||t===void 0?void 0:t.type)?n[0]:null;r&&this.loadAndRenderImage(r)},this.renderImageInChatInputContainer=e=>{var t,n;this.removeImage(),this.imagePicked=e,this.inputEl.value="",this.message="",this.inputEl.style.display="none",this.insertAdjacentHTML("afterbegin",`<div slot="body" class="livelike-chat-input-container" tabindex="0">
|
|
131
|
+
<div class="livelike-image-preview-container">
|
|
132
|
+
<img class="livelike-image-preview" src="${this.imagePicked.path}"/>
|
|
133
|
+
<button class="livelike-image-close-button">
|
|
134
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
135
|
+
<circle cx="8" cy="8" r="7.25" fill="black" stroke="white" stroke-width="1.5"/>
|
|
136
|
+
<path d="M5.09088 10.9091L10.9091 5.09091M5.09088 5.09091L10.9091 10.9091" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
137
|
+
</svg>
|
|
138
|
+
</button>
|
|
139
|
+
</div>
|
|
140
|
+
</div>`),(t=this.imagePreviewContainerEl)===null||t===void 0||t.focus(),(n=this.imageCloseButton)===null||n===void 0||n.addEventListener("click",this.removeImage),this.stickerPickerContainerEl.style.display="none"},this.loadAndRenderImage=e=>{this.removeImage();const t=URL.createObjectURL(e),n=new Image;n.addEventListener("load",(()=>{const r={path:t,file:e,height:n.height,width:n.width};this.renderImageInChatInputContainer(r)})),n.src=t},this.showStickerPickerContainer=()=>{this.stickerPickerContainerEl.style.display="block",this.setInputElRightPadding("5rem"),this.showImagePickerIcon()},this.removeImage=()=>{var e,t;this.imagePreviewEl&&(this.querySelector(".livelike-file-input").value="",this.imagePicked=null,(e=this.imageCloseButton)===null||e===void 0||e.removeEventListener("click",this.removeImage),(t=this.inputContainerEl)===null||t===void 0||t.remove(),this.inputEl.style.display="block",this.showStickerPickerContainer())}}get localizedPlaceholder(){return this.placeholder||this.owner.placeholder||this.owner.localize("chat.inputPlaceholder")}get inputContainerEl(){return this.querySelector(".livelike-chat-input-container")}get inputEl(){return this.querySelector("[slot=body]")}get sendBtn(){return this.querySelector("[slot=send]")}get imagePickerEl(){return this.querySelector("livelike-image-picker")}get imagePreviewContainerEl(){return this.querySelector(".livelike-image-preview-container")}get imageCloseButton(){return this.querySelector(".livelike-image-close-button")}get imagePreviewEl(){return this.querySelector(".livelike-image-preview")}get stickerPickerContainerEl(){return this.querySelector(".sticker-picker-container")}updated(e){e.forEach(((t,n)=>{n==="placeholder"&&(this.inputEl.placeholder=this.placeholder,this.inputEl.setAttribute("aria-label",this.placeholder))}))}connectedCallback(){this.defaultStyles=()=>`
|
|
141
|
+
:host {
|
|
142
|
+
display: flex;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
livelike-chat-composer {
|
|
146
|
+
display: flex;
|
|
147
|
+
position: relative;
|
|
148
|
+
flex-direction: column;
|
|
149
|
+
flex-shrink: 0;
|
|
150
|
+
}
|
|
151
|
+
.livelike-composer-quote-message {
|
|
152
|
+
display: flex;
|
|
153
|
+
width: 95%;
|
|
154
|
+
border-radius: 12px;
|
|
155
|
+
background: rgb(0, 0, 0, 0.4);
|
|
156
|
+
padding: 0.5rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
livelike-quote-message-item {
|
|
160
|
+
flex-grow: 1;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.livelike-compose-quote-message-cancel {
|
|
164
|
+
display: flex;
|
|
165
|
+
padding: 0 0.3rem 0 0.8rem;
|
|
166
|
+
align-items: center;
|
|
167
|
+
color: #808080;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.livelike-compose-quote-message-cancel svg {
|
|
171
|
+
transform: scale(2);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.livelike-compose-quote-message-cancel circle {
|
|
175
|
+
fill: transparent;
|
|
176
|
+
cursor: pointer;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.livelike-compose-quote-message-cancel path {
|
|
180
|
+
fill: #808080;
|
|
181
|
+
cursor: pointer;
|
|
182
|
+
}
|
|
183
|
+
.livelike-chat-input {
|
|
184
|
+
border: 0;
|
|
185
|
+
background: #fff;
|
|
186
|
+
box-sizing: border-box;
|
|
187
|
+
border-radius: 0.5rem;
|
|
188
|
+
color: inherit;
|
|
189
|
+
font-size: 1rem;
|
|
190
|
+
font-family: inherit;
|
|
191
|
+
line-height: 1.5rem;
|
|
192
|
+
height: 40px;
|
|
193
|
+
min-height: 2.5rem;
|
|
194
|
+
overflow: hidden;
|
|
195
|
+
padding: 0.5rem 5rem 0.5rem 0.5rem;
|
|
196
|
+
resize: none;
|
|
197
|
+
width: 100%;
|
|
198
|
+
border: 1px solid transparent;
|
|
199
|
+
}
|
|
200
|
+
.livelike-chat-input:focus {
|
|
201
|
+
outline: none;
|
|
202
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
203
|
+
}
|
|
204
|
+
.livelike-chat-input::placeholder {
|
|
205
|
+
color: rgba(0, 0, 0, 0.35);
|
|
206
|
+
}
|
|
207
|
+
.send-button {
|
|
208
|
+
background: none;
|
|
209
|
+
border: none;
|
|
210
|
+
padding: 0;
|
|
211
|
+
margin-left: 1rem;
|
|
212
|
+
display: flex;
|
|
213
|
+
align-items: center;
|
|
214
|
+
transition: all 0.3s ease-out;
|
|
215
|
+
}
|
|
216
|
+
.send-icon {
|
|
217
|
+
border: none;
|
|
218
|
+
background: none;
|
|
219
|
+
}
|
|
220
|
+
.send-icon svg {
|
|
221
|
+
fill: #777;
|
|
222
|
+
}
|
|
223
|
+
.send-icon:hover svg,
|
|
224
|
+
.send-icon:focus svg {
|
|
225
|
+
transition: all 0.3s ease-out;
|
|
226
|
+
}
|
|
227
|
+
.send-icon:hover {
|
|
228
|
+
cursor: pointer;
|
|
229
|
+
}
|
|
230
|
+
.sticker-picker-container {
|
|
231
|
+
position: absolute;
|
|
232
|
+
border: none;
|
|
233
|
+
background: none;
|
|
234
|
+
right: 2rem;
|
|
235
|
+
bottom: 0.5rem;
|
|
236
|
+
transition: all 0.3s ease-out;
|
|
237
|
+
}
|
|
238
|
+
`+(this.imagePicker?`
|
|
239
|
+
.livelike-chat-input{
|
|
240
|
+
padding-right: 6.5rem;
|
|
241
|
+
}
|
|
242
|
+
.livelike-chat-input-container{
|
|
243
|
+
border: 0;
|
|
244
|
+
background: #fff;
|
|
245
|
+
box-sizing: border-box;
|
|
246
|
+
border-radius: 0.5rem;
|
|
247
|
+
min-height: 2.5rem;
|
|
248
|
+
padding: 0.5rem 0.5rem 0.5rem 0.5rem;
|
|
249
|
+
width: 100%;
|
|
250
|
+
border: 1px solid transparent;
|
|
251
|
+
}
|
|
252
|
+
.livelike-chat-input-container:focus-within{
|
|
253
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
254
|
+
}
|
|
255
|
+
.livelike-image-preview{
|
|
256
|
+
height: 52px;
|
|
257
|
+
width: 52px;
|
|
258
|
+
object-fit: cover;
|
|
259
|
+
display: flex;
|
|
260
|
+
}
|
|
261
|
+
.livelike-image-preview-container{
|
|
262
|
+
position: relative;
|
|
263
|
+
width: fit-content;
|
|
264
|
+
}
|
|
265
|
+
.livelike-image-close-button{
|
|
266
|
+
background: none;
|
|
267
|
+
border: none;
|
|
268
|
+
position: absolute;
|
|
269
|
+
top: 0;
|
|
270
|
+
right: 0;
|
|
271
|
+
padding: 0;
|
|
272
|
+
transform: translate(13px, -10px);
|
|
273
|
+
cursor: pointer;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.livelike-image-close-button svg{
|
|
277
|
+
margin: 0.3rem;
|
|
278
|
+
}
|
|
279
|
+
`:""),super.connectedCallback(),this.addEventListener("sticker-selected",this.addSticker),this.owner.addEventListener(It.QUOTE_MESSAGE,this.handleQuoteEvent),this.insertAdjacentHTML("beforeend",`<div slot="quote-message" class="livelike-composer-quote-message" style="display: none;">
|
|
280
|
+
<livelike-quote-message-item></livelike-quote-message-item>
|
|
281
|
+
<div class="livelike-compose-quote-message-cancel">
|
|
282
|
+
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1">
|
|
283
|
+
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
284
|
+
<circle id="circle" fill="#000000" opacity="0.200000003" cx="9" cy="9" r="9"></circle>
|
|
285
|
+
<path d="M10.1443526,8.99976063 L12.7631923,11.617505 C13.0789359,11.9337699 13.0789359,12.4465365 12.7631923,12.7628014 C12.4474488,13.0790662 11.9355273,13.0790662 11.6197838,12.7628014 L9.00023937,10.1443526 L6.38249497,12.7631923 C6.06623012,13.0789359 5.55346349,13.0789359 5.23719864,12.7631923 C4.92093379,12.4474488 4.92093379,11.9355273 5.23719864,11.6197838 L7.85564741,9.00023937 L5.23680767,6.38249497 C4.92106411,6.06623012 4.92106411,5.55346349 5.23680767,5.23719864 C5.55255122,4.92093379 6.06447267,4.92093379 6.38021623,5.23719864 L8.99976063,7.85564741 L11.617505,5.23680767 C11.9337699,4.92106411 12.4465365,4.92106411 12.7628014,5.23680767 C13.0790662,5.55255122 13.0790662,6.06447267 12.7628014,6.38021623 L10.1443526,8.99976063 Z" id="x" fill="#FFFFFF" fill-rule="nonzero"></path>
|
|
286
|
+
</g>
|
|
287
|
+
</svg></div>
|
|
288
|
+
</div>`),this.insertAdjacentHTML("beforeend",`<textarea slot="body" class="livelike-chat-input" maxlength="200" placeholder="${this.localizedPlaceholder}" aria-label="${this.localizedPlaceholder}"></textarea>`),this.insertAdjacentHTML("beforeend",`<div slot="body" class="sticker-picker-container">
|
|
289
|
+
${this.imagePicker?"<livelike-image-picker></livelike-image-picker>":""}
|
|
290
|
+
<livelike-sticker-picker></livelike-sticker-picker>
|
|
291
|
+
<livelike-giphy-picker></livelike-giphy-picker>
|
|
292
|
+
</div>`),this.insertAdjacentHTML("beforeend",`<button slot="send" aria-label="${this.owner.localize("chat.sendButton.ariaLabel")}" class="send-icon">
|
|
293
|
+
|
|
294
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
295
|
+
<g clip-path="url(#clip0_1464_2598)">
|
|
296
|
+
<path opacity="0.12" d="M15.109 7.13782L8.84573 4.00621C6.13924 2.65296 4.78599 1.97634 4.07461 2.14899C3.28531 2.34055 2.69025 2.99044 2.5688 3.79352C2.45934 4.51732 3.25229 5.80586 4.83818 8.38294C5.17695 8.93344 5.34634 9.20869 5.42163 9.50078C5.50603 9.82824 5.50603 10.1717 5.42163 10.4992C5.34634 10.7913 5.17695 11.0665 4.83818 11.617C3.25229 14.1941 2.45934 15.4827 2.5688 16.2065C2.69025 17.0095 3.28531 17.6594 4.07461 17.851C4.78599 18.0236 6.13924 17.347 8.84573 15.9938L15.109 12.8622C16.9514 11.9409 17.8726 11.4803 18.1682 10.857C18.4255 10.3146 18.4255 9.68535 18.1682 9.14294C17.8726 8.51964 16.9514 8.05904 15.109 7.13782Z" fill="white"/>
|
|
297
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.18116 3.3354L9.15069 3.32016C7.82316 2.65639 6.78911 2.13937 5.99875 1.81237C5.59894 1.64695 5.23333 1.51806 4.90356 1.44419C4.57835 1.37134 4.23254 1.3389 3.89774 1.42016C2.81245 1.68356 1.99423 2.57715 1.82725 3.68139C1.77573 4.02203 1.83844 4.36365 1.93959 4.68121C2.04216 5.0032 2.20269 5.35607 2.40261 5.73979C2.79781 6.49835 3.40371 7.48294 4.18159 8.74699L4.19945 8.77602C4.56374 9.36799 4.65506 9.53158 4.69538 9.68799C4.74814 9.89265 4.74814 10.1073 4.69538 10.312C4.65506 10.4684 4.56374 10.632 4.19945 11.224L4.18158 11.253L4.18157 11.253C3.4037 12.5171 2.7978 13.5017 2.40261 14.2602C2.20269 14.6439 2.04216 14.9968 1.93959 15.3188C1.83844 15.6363 1.77573 15.978 1.82725 16.3186C1.99423 17.4228 2.81245 18.3164 3.89774 18.5798C4.23254 18.6611 4.57835 18.6287 4.90357 18.5558C5.23333 18.4819 5.59894 18.353 5.99875 18.1876C6.78907 17.8606 7.82305 17.3437 9.15049 16.6799L9.15063 16.6799L9.18116 16.6646L15.4444 13.533L15.4793 13.5156C16.3709 13.0698 17.0869 12.7118 17.6136 12.3855C18.1375 12.061 18.601 11.6948 18.8459 11.1784C19.1996 10.4326 19.1996 9.56737 18.8459 8.82156C18.601 8.30525 18.1375 7.93904 17.6136 7.61453C17.0869 7.28824 16.3709 6.93026 15.4793 6.48447L15.4444 6.46701L9.18116 3.3354ZM5.52813 8.07296L5.47694 7.98987C4.67752 6.69081 4.10026 5.75186 3.73289 5.04673C3.55002 4.69571 3.43372 4.42966 3.36884 4.22595C3.30253 4.0178 3.30717 3.92693 3.31038 3.90567C3.38629 3.40375 3.7582 2.99757 4.25152 2.87784C4.27241 2.87277 4.36252 2.86017 4.57569 2.90792C4.78431 2.95465 5.05956 3.04711 5.42529 3.19842C6.15998 3.50239 7.14603 3.99489 8.51033 4.67704L14.7736 7.80865C15.7081 8.27594 16.3622 8.6038 16.8237 8.88969C17.2949 9.1816 17.4398 9.35735 17.4906 9.46434C17.6514 9.80335 17.6514 10.1966 17.4906 10.5357C17.4398 10.6426 17.2949 10.8184 16.8237 11.1103C16.3622 11.3962 15.7081 11.7241 14.7736 12.1913L8.51034 15.323C7.14604 16.0051 6.15998 16.4976 5.42529 16.8016C5.05956 16.9529 4.78431 17.0454 4.57569 17.0921C4.36252 17.1398 4.27241 17.1272 4.25152 17.1222C3.7582 17.0024 3.38629 16.5963 3.31038 16.0943C3.30717 16.0731 3.30253 15.9822 3.36884 15.774C3.43372 15.5703 3.55002 15.3043 3.73289 14.9533C4.10026 14.2481 4.67752 13.3092 5.47694 12.0101L5.52813 11.927C5.80184 11.483 6.01967 11.1296 6.13043 10.75H9.16664C9.58085 10.75 9.91664 10.4142 9.91664 10C9.91664 9.58578 9.58085 9.25 9.16664 9.25H6.13043C6.01967 8.87038 5.80184 8.51699 5.52813 8.07297L5.52813 8.07296Z" fill="white"/>
|
|
298
|
+
</g>
|
|
299
|
+
<defs>
|
|
300
|
+
<clipPath id="clip0_1464_2598">
|
|
301
|
+
<rect width="20" height="20" fill="white"/>
|
|
302
|
+
</clipPath>
|
|
303
|
+
</defs>
|
|
304
|
+
</svg>
|
|
305
|
+
|
|
306
|
+
</button>`),this.querySelector(".livelike-compose-quote-message-cancel").onclick=this.removeQuoteMessage,this.imagePicker&&this.addEventListener("image-selected",(e=>this.loadAndRenderImage(e.detail))),this.imagePicker&&this.inputEl.addEventListener("paste",this.handleImagePaste),this.imagePicker&&this.addEventListener("giphyselected",(e=>this.renderImageInChatInputContainer(e.detail)))}disconnectedCallback(){this.removeEventListener("sticker-selected",this.addSticker),this.owner.removeEventListener(It.QUOTE_MESSAGE,this.handleQuoteEvent),super.disconnectedCallback()}render(){return I`${Mv}<slot name="quote-message"></slot><div class="livelike-chat-composer-input"><slot name="body" @input="${this.handleMessage}" @keydown="${this.handleKeyDown}"></slot><slot @click="${this.sendClickHandler}" name="send"></slot></div><slot></slot>`}};_r([C({type:String,reflect:!0})],Vi.prototype,"placeholder",void 0),_r([C({type:String})],Vi.prototype,"message",void 0),_r([C({type:Object})],Vi.prototype,"quoteMessage",void 0),_r([C({type:Boolean})],Vi.prototype,"imagePicker",void 0),_r([C({type:Object})],Vi.prototype,"imagePicked",void 0),Vi=_r([de("livelike-chat-composer")],Vi);const Dv=()=>`
|
|
307
|
+
<style>
|
|
308
|
+
@keyframes slideDown {
|
|
309
|
+
from {
|
|
310
|
+
opacity: 0;
|
|
311
|
+
transform: translate3d(0, -3rem, 0);
|
|
312
|
+
}
|
|
313
|
+
to {
|
|
314
|
+
opacity: 1;
|
|
315
|
+
transform: translate3d(0, 0rem, 0);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
@keyframes slideUp {
|
|
320
|
+
from {
|
|
321
|
+
opacity: 0;
|
|
322
|
+
transform: translate3d(0, 0rem, 0);
|
|
323
|
+
}
|
|
324
|
+
to {
|
|
325
|
+
opacity: 1;
|
|
326
|
+
transform: translate3d(0, -2rem, 0);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.down-icon {
|
|
331
|
+
z-index: 15;
|
|
332
|
+
position: absolute;
|
|
333
|
+
border: none;
|
|
334
|
+
right: 3.75rem;
|
|
335
|
+
bottom: 5.5rem;
|
|
336
|
+
padding: 0;
|
|
337
|
+
border-radius: 50%;
|
|
338
|
+
height: auto;
|
|
339
|
+
width: auto;
|
|
340
|
+
display: none;
|
|
341
|
+
flex-direction: column;
|
|
342
|
+
animation: slideDown 0.5s ease forwards;
|
|
343
|
+
transition: all 0.3s ease;
|
|
344
|
+
}
|
|
345
|
+
.down-icon.show {
|
|
346
|
+
display: flex;
|
|
347
|
+
animation: slideUp 0.5s ease forwards;
|
|
348
|
+
}
|
|
349
|
+
.down-icon:hover {
|
|
350
|
+
cursor: pointer;
|
|
351
|
+
transition: all 0.3s ease;
|
|
352
|
+
}
|
|
353
|
+
.down-icon svg > rect {
|
|
354
|
+
fill: #b0b0b0;
|
|
355
|
+
}
|
|
356
|
+
.down-icon svg > path {
|
|
357
|
+
fill: #fff;
|
|
358
|
+
}
|
|
359
|
+
</style>
|
|
360
|
+
`;var Dm=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let fa=class extends it{constructor(){super(...arguments),this.defaultStyles=Dv,this.userScrolled=!1,this.ownerUpdated=e=>{(e.name==="translations"||e.name==="lang")&&this.updateLocalizedStrings()},this.setScrolled=e=>{if(e.key===this.owner.dataId){const t=this.querySelector(".down-icon"),n=e.scrolled?"down-icon show":"down-icon";t&&t.setAttribute("class",n)}},this.scrollDown=()=>Ne.emit("scrollDown",{key:this.owner.dataId}),this.updateLocalizedStrings=()=>{this.querySelector("button.down-icon").setAttribute("aria-label",this.owner.localize("chat.scrollDownButton.ariaLabel"))}}connectedCallback(){super.connectedCallback(),Ne.on("userScrolled",this.setScrolled),this.addEventListener("click",this.scrollDown),this.insertAdjacentHTML("beforeend",`<button tabindex="0" aria-label="${this.owner.localize("chat.scrollDownButton.ariaLabel")}" class="down-icon">
|
|
361
|
+
<svg width="25px" height="25px" viewBox="0 0 30 30">
|
|
362
|
+
<rect id="snap-to-live-button" fill="#FFFFFF" x="0" y="0" width="30" height="30" rx="15"></rect>
|
|
363
|
+
<path d="M15.0326453,21 C14.7426596,21 14.4527097,20.8852999 14.2316216,20.6563819 L7.2744003,13.4491933 C6.83183015,12.9907267 6.83183015,12.2787537 7.97485699,11.4850649 C9.11788383,10.6913761 9.53369152,11.0267838 9.97629747,11.4850649 L15.0326453,16.7405562 L20.0890468,11.4850649 C20.5316169,11.0267838 21.1431577,10.6735312 22.0549346,11.4850649 C22.9667115,12.2965986 23.2335678,12.9909492 22.7907828,13.4494158 L15.8336689,20.6566045 C15.6124734,20.8855596 15.3225235,21 15.0326453,21 Z" id="ic_arrowDown" fill="#23282D"></path>
|
|
364
|
+
</svg></button>`)}render(){return I`<slot></slot>`}};Dm([C({type:Boolean})],fa.prototype,"userScrolled",void 0),fa=Dm([de("livelike-scroll-down")],fa);const Nv=I`<style>.confirmation-overlay,.confirmation-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0}.confirmation-overlay-backdrop{background-color:#000;opacity:.5;z-index:2000}.confirmation-overlay{display:flex;justify-content:center;align-items:center}.confirmation-action-pending{padding:10px 28px;display:flex;justify-content:center;align-items:center}.confirmation-content{display:flex;flex-direction:column;max-width:400px;background-color:#fff;border-radius:10px;z-index:2001;transition:width 1s ease-in}.confirmation-header{align-self:center;padding-top:16px;font-weight:700;font-size:20px}.confirmation-body{align-self:center;padding:0 30px;font-size:14px}.confirmation-footer{display:flex;justify-content:space-around;height:30px;margin:0 15px 10px 15px}.confirmation-accept-btn,.confirmation-reject-btn{color:#0084ff;border:0;background-color:transparent;cursor:pointer}</style>`;var Nm=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let ed=class extends it{createRenderRoot(){return this}render(){return I`${(({animationduration:e})=>I`<style>.spinner-outer-container{height:15px;width:15px;padding:3px;display:inline-block;border-radius:50%;background-image:linear-gradient(0deg,#2a87ff,#e8e8e8);animation:spin ${e}}.spinner-inner-container{height:100%;width:100%;display:inline-block;background-color:#fff;border-radius:50%}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}</style>`)({animationduration:this.animationduration})} <span class="spinner-outer-container"><span class="spinner-inner-container"></span></span>`}};Nm([C({type:Number})],ed.prototype,"animationduration",void 0),ed=Nm([de("livelike-spinner")],ed);var vn=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Ut=class extends it{constructor(){super(...arguments),this.isLoading=!1,this.onAcceptHandler=()=>{this.isLoading=!0,Ie(this,"onaccept")}}createRenderRoot(){return this}renderOnActionPending(){return I`<div class="confirmation-action-pending"><livelike-spinner animationduration="${2}"></livelike-spinner><span>${this.actionpendinglabel}</span></div>`}renderConfirmationDialog(){return I`<span class="confirmation-header">${this.confirmationtitle}</span><p class="confirmation-body">${this.description}</p><div class="confirmation-footer"><button class="confirmation-accept-btn" @click="${this.onAcceptHandler}">${this.acceptlabel}</button> <button class="confirmation-reject-btn" @click="${()=>Ie(this,"onreject")}">${this.rejectlabel}</button></div>`}render(){return I`${Nv}<div class="confirmation-overlay"><div class="confirmation-overlay-backdrop"></div><div class="confirmation-content">${this.isLoading?this.renderOnActionPending():this.renderConfirmationDialog()}</div></div>`}};vn([C({type:String})],Ut.prototype,"confirmationtitle",void 0),vn([C({type:String})],Ut.prototype,"description",void 0),vn([C({type:String})],Ut.prototype,"acceptlabel",void 0),vn([C({type:String})],Ut.prototype,"rejectlabel",void 0),vn([C({type:Function})],Ut.prototype,"actionpendinglabel",void 0),vn([C({type:Function})],Ut.prototype,"onaccept",void 0),vn([C({type:Function})],Ut.prototype,"onreject",void 0),vn([C({type:Boolean})],Ut.prototype,"isLoading",void 0),Ut=vn([de("livelike-confirmation")],Ut);const xt={direction:0,format:"uniformGradient"},ya={background:Object.assign(Object.assign({},xt),{colors:["003264","0096c8"]})},va={background:{format:"fill",color:"111111"}},Um={correctOptionBar:{background:Object.assign(Object.assign({},xt),{colors:["81ca00","429321"]})},incorrectOptionBar:{background:Object.assign(Object.assign({},xt),{colors:["dc0028","d0021b"]})},correctOption:{borderWidth:2,borderColor:"81ca00"},incorrectOption:{borderWidth:2,borderColor:"dc0028"}},Uv={widgets:{alert:{body:{},header:{background:Object.assign(Object.assign({},xt),{colors:["9f041b","f5515f"]})}},imageSlider:{header:Object.assign({},va),body:{},interactiveTrackRight:{background:{format:"fill",color:"888"}},interactiveTrackLeft:{background:{format:"fill",color:"ff6a13"}},resultsTrackRight:{},resultsTrackLeft:{}},prediction:{header:Object.assign({},ya),selectedOption:{borderColor:"0096c8"},selectedOptionBar:{borderColor:"0096c8",background:Object.assign(Object.assign({},xt),{colors:["003264","0096c8"]})}},predictionFollowUp:Object.assign(Object.assign({},Um),{header:Object.assign({},ya),selectedOption:{borderColor:"0096c8"},selectedOptionBar:{borderColor:"c96dd7",background:Object.assign(Object.assign({},xt),{colors:["003264","0096c8"]})}}),poll:{header:{background:Object.assign(Object.assign({},xt),{colors:["3123ae","c96dd7"]})},selectedOption:{borderColor:"c86dd7"},selectedOptionBar:{borderColor:"c96dd7",background:Object.assign(Object.assign({},xt),{colors:["3123ae","c86dd7"]})}},quiz:Object.assign(Object.assign({},Um),{header:{background:Object.assign(Object.assign({},xt),{colors:["f76b1c","ffb400"]})},selectedOption:{borderColor:"ffb400"},selectedOptionBar:{borderColor:"c96dd7",background:Object.assign(Object.assign({},xt),{colors:["f76b1c","ffb400"]})}}),socialEmbed:{header:Object.assign({},va),body:{}},richText:{header:Object.assign({},va),body:{}},cheerMeter:{header:Object.assign({},va),body:{}},videoAlert:{body:{},header:{background:Object.assign(Object.assign({},xt),{colors:["9f041b","f5515f"]})}},textAsk:{header:{background:Object.assign(Object.assign({},xt),{colors:["9f041b","f5515f"]})},body:{}},numberPrediction:{header:Object.assign({},ya)},numberPredictionFollowUp:{header:Object.assign({},ya)}},version:1};function jv(e){return parseInt(e.repeat(2/e.length),16)}const jm=e=>/^([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function ba(e){if(jm(e)){const t=Math.floor(e.length/3),n=e.match(new RegExp(`.{${t}}`,"g")).map(jv),r=n[3]||n[3]===0?(n[3]/255).toFixed(2):1;return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${r})`}return e}function Bm(e){return Object.keys(e).forEach((t=>{const n=e[t]instanceof Array;if(t==="fontFamily")e[t]=n?e[t].join(" "):e[t];else if(typeof e[t]!="object"||n)if(n){const r=e[t].map((o=>o+"px"));e[t]=r.join(" ")}else t.toLowerCase().indexOf("color")!==-1?e[t]=e[t].slice(0,3)==="rgb"?e[t]:ba(e[t]):t!=="fontSize"&&t!=="borderWidth"||String(e[t]).match(/px/gi)||(e[t]=`${e[t]}px`);else t==="background"?(function(r,o){const c=r[o];c.format==="fill"?r[o]=jm(c.color)?ba(c.color):c.color:c.format==="uniformGradient"&&(r[o]=`linear-gradient(90deg, ${ba(c.colors[0])}, ${ba(c.colors[1])})`)})(e,t):Bm(e[t])})),e}function _e(e){if(e){let t="";return Object.keys(e).forEach((n=>{let r=n.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase();n==="fontColor"&&(r="color"),t+=`${r}: ${e[n]};
|
|
365
|
+
`})),t}return""}const Fm=e=>new Promise((t=>{const n=Bm(kc(Uv,e));lr.theme=n,Ne.emit("themeUpdate",{theme:n}),(function r(){n&&n.version?t():setTimeout(r,1e3)})()})),zm=e=>(ee.localizedStrings=kc(ee.localizedStrings,e),Ne.emit("localizationUpdate",{localizedStrings:ee.localizedStrings}),Promise.resolve(!0)),Hm=e=>xe(e.badges_url,(t=>K.get({url:t})),(t=>({count:t.count,results:t.results}))),td=e=>({id:e.id,title:e.title,created_at:e.created_at,visibility:e.visibility,content_filter:e.content_filter,token_gates:e.token_gates,chatroom_token_gate_access_url_template:e.chatroom_token_gate_access_url_template}),qm=e=>({chat_room_id:e.chat_room_id,access:e.access,wallet_details:e.wallet_details,details:e.details}),Bv=()=>Promise.resolve(!0),_a=e=>e.roomId?Pi(e.roomId):Dt("roomId","chatroom"),nd=(e,t,n)=>_a(e).then((r=>K[t]({url:r.memberships_url,data:n}))),Gm=e=>_a(e).then(td);function Wm(e,t){switch(e){case $n.ADD_NEW_MEMBER:case $n.INVITE_NEW_MEMBER:return Promise.resolve(ae.subscribe_channel);case $n.PIN_MESSAGE:case $n.UNPIN_MESSAGE:return X0(t);case $n.CHATROOM_UPDATED:return Q0(t)}}const Fv={asc:"pinned_at",desc:"-pinned_at"},Km={};function Qm(e,t){const{id:n,chatroom_messages_url:r}=t;return Km[n]&&(e=Km[n](e)),Dc(e,n,"Chat Message Sent"),K.post({url:r,data:e}).then((o=>o)).catch((o=>(console.error("Error: "+o+" Message failed to send."),Promise.reject(o))))}function zv(e,t,n=!0){return Pi(t).then((r=>e.image_url&&n?(function(o,c){return Tc(o.image_url).then((l=>Y0(c.upload_url,l))).then((function(l){return o.image_url=l.image_url,Qm(o,c)})).catch((function(l){return console.error((l.message,l.message)),Promise.reject(l)}))})(e,r):Qm(e,r)))}const Xm=e=>ue(e,["roomId","quoteMessage"],"quoteMessage").then((()=>(Cc(e.quoteMessage)&&delete e.quoteMessage.quote_message,delete e.quoteMessage.reactions,zv(Object.assign(Object.assign({},(t=>({chat_room_id:t.roomId,client_message_id:gc(),sender_id:ae.id,sender_nickname:ae.nickname,sender_image_url:t.sender_image_url||null,sender_profile_url:ae.url,badge_image_url:null,program_date_time:t.timestamp||null,message:t.message||null,image_width:~~t.image_width||null,image_height:~~t.image_height||null,image_url:t.image_url||null,message_metadata:t.message_metadata||null,message_event:t.image_url?Ze.IMAGE_CREATED:Ze.MESSAGE_CREATED}))(e)),{quote_message:e.quoteMessage,quote_message_id:e.quoteMessage.id}),e.roomId))));function wa(e){return ue(e,[],"getReactionSpaceDetail",(()=>{if(!e?.reactionSpaceId&&!e?.targetGroupId)return'Argument object is missing "reactionSpaceId" or "targetGroupId" property.'})).then((()=>be())).then((t=>e.reactionSpaceId?K.get({url:Te(e.reactionSpaceId,t.reaction_space_detail_url_template)}):K.get({url:`${t.reaction_spaces_url}?client_id=${t.client_id}&target_group_id=${e.targetGroupId}`}).then((({results:n})=>n?.[0]?n[0]:Promise.reject({message:"Resource not found."}))))).then((t=>(ee.reactionSpaces[t.id]=t,t)))}function wr(e,t){return Np([e,t],[["event","reactionSpaceId"],"function"],"addReactionSpaceEventListener").then((()=>Ir(e.reactionSpaceId))).then((({reaction_space_channel:n})=>{he.addListener(n,t,e.event),he.subscribe(n)}))}function Cr(e,t){return ue(e,["event","reactionSpaceId"],"removeReactionSpaceEventListener").then((()=>Ir(e.reactionSpaceId))).then((({reaction_space_channel:n})=>{const{event:r}=e;t?he.removeListener(n,t,r):he.removeAllListenersForEvent(n,r),he.unsubscribe(n)}))}function Ir(e,t=!0){const n=ee.reactionSpaces[e];return n&&t?Promise.resolve(n):wa({reactionSpaceId:e})}function id(e){return ue(e,["targetId","reactionSpaceId","reactionId"],"addUserReaction").then((()=>Ir(e.reactionSpaceId))).then((({user_reactions_url:t})=>{const{reactionSpaceId:n,targetId:r,reactionId:o,programDateTime:c}=e;return K.post({url:t,data:{reaction_space_id:n,target_id:r,reaction_id:o,custom_data:c}})}))}function rd(e){return ue(e,["userReactionId","reactionSpaceId"],"removeUserReaction").then((()=>Ir(e.reactionSpaceId))).then((({user_reaction_detail_url_template:t})=>K.delete({url:Te(e.userReactionId,t)})))}function Zm(e){return ue(e,["reactionSpaceId","targetIds"],"getUserReactionsCount",(()=>{if(!Array.isArray(e?.targetIds))return'Argument object "targetIds" property value should be an array.'})).then((()=>Ir(e.reactionSpaceId))).then((({user_reactions_count_url:t})=>{const n=[`reaction_space_id=${e.reactionSpaceId}`,...e.targetIds.map((r=>`target_id=${r}`))].join("&");return Re(["results"],xe(`${t}?${n}`,(r=>K.get({url:r})),(r=>({count:r.count,results:r.results}))))}))}function od(e){return ue(e,["reactionPackId"],"getReactionPackDetail").then((()=>be())).then((t=>K.get({url:Te(e.reactionPackId,t.reaction_pack_detail_url_template)})))}function Jm(e){return ue(e,[],"getCommentBoardDetails",(()=>{if(!e?.customId&&!e?.commentBoardId)return'Argument object is missing "commentBoardId" or "customId" property.'})).then((()=>be())).then((t=>e.customId?K.get({url:`${t.comment_boards_url}?client_id=${t.client_id}&custom_id=${e.customId}`}).then((n=>n&&n.results&&n.results.length&&n.results[0]?n.results[0]:Promise.reject("Resource not found"))):K.get({url:Te(e.commentBoardId,t.comment_board_detail_url_template)}))).then((t=>(ee.commentBoards[t.id]=t,t)))}function qn(e,t=!0){const n=ee.commentBoards[e];return n&&t?Promise.resolve(n):Jm({commentBoardId:e})}function Ym(e){return ue(e,["commentBoardId"],"addComment").then((()=>qn(e.commentBoardId))).then((t=>{const n=t.comments_url,{text:r,commentBoardId:o,customData:c,authorImageUrl:l}=e;return K.post({url:n,data:{text:r,custom_data:c,comment_board_id:o,author_image_url:l}})}))}function eg(e){return ue(e,["commentBoardId","parentCommentId"]).then((()=>qn(e.commentBoardId))).then((t=>{const n=t.comments_url,{text:r,commentBoardId:o,customData:c,parentCommentId:l,authorImageUrl:u}=e;return K.post({url:n,data:{text:r,custom_data:c,comment_board_id:o,parent_comment_id:l,author_image_url:u}})}))}function tg(e){return ue(e,["commentBoardId","commentId"],"getComment").then((()=>qn(e.commentBoardId))).then((t=>K.get({url:Te(e.commentId,t.comment_detail_url_template)}))).then((t=>(ee.comments[t.id]=t,t)))}function ng(e){return ue(e,["commentBoardId"],"getComments").then((()=>qn(e.commentBoardId))).then((t=>{let n=`${t.comments_url}`;return e.topLevel&&(n+=`&top_level=${e.topLevel}`),e.excludeDeletedCommentWithNoReplies&&(n+=`&without_deleted_thread=${e.excludeDeletedCommentWithNoReplies}`),e.sorting&&(n+=`&ordering=${e.sorting}`),e.repliedSince&&(n+=`&replied_since=${e.repliedSince}`),e.repliedUntil&&(n+=`&replied_until=${e.repliedUntil}`),e.since&&(n+=`&since=${e.since}`),e.until&&(n+=`&until=${e.until}`),e.isReported!==void 0&&(n+=`&is_reported=${e.isReported}`),Re(["results"],xe(n,(r=>K.get({url:r})),(r=>({count:r.count,results:r.results}))))})).then((t=>(t.results.forEach((n=>{ee.comments[n.id]=n})),t)))}function ig(e){return ue(e,["commentBoardId","commentId"],"getCommentReplies").then((()=>(function(t,n,r=!0){const o=ee.comments[n];return o&&r?Promise.resolve(o):tg({commentBoardId:t,commentId:n})})(e.commentBoardId,e.commentId))).then((t=>{let n=t.replies_url;return e.sorting&&(n+=`&ordering=${e.sorting}`),e.excludeDeletedCommentWithNoReplies&&(n+=`&without_deleted_thread=${e.excludeDeletedCommentWithNoReplies}`),e.since&&(n+=`&since=${e.since}`),e.until&&(n+=`&until=${e.until}`),Re(["results"],xe(n,(r=>K.get({url:r})),(r=>({count:r.count,results:r.results}))))})).then((t=>(t.results.forEach((n=>{ee.comments[n.id]=n})),t)))}function sd(e){return ue(e,["commentBoardId","commentId"],"deleteComment").then((()=>qn(e.commentBoardId))).then((t=>K.delete({url:Te(e.commentId,t.comment_detail_url_template)})))}function rg(e){return ue(e,["commentId"],"createCommentReport").then((()=>be())).then((t=>{const n=t.comment_report_url,{commentId:r,description:o}=e;return K.post({url:n,data:{comment_id:r,description:o}})}))}function og(e){return be().then((t=>{let n=t.comment_report_url+`?client_id=${t.client_id}`;return e?.commentBoardId&&(n+=`&comment_board_id=${e.commentBoardId}`),e?.commentId&&(n+=`&comment_id=${e.commentId}`),e?.reportStatus&&(n+=`&report_status=${e.reportStatus}`),Re(["results"],xe(n,(r=>K.get({url:r})),(r=>({count:r.count,results:r.results}))))}))}function sg(e){return ue(e,["commentReportId"],"deleteCommentReport").then((()=>be())).then((t=>K.delete({url:Te(e.commentReportId,t.comment_report_detail_url_template)})))}const ag=[Zt.DELETE_MESSAGE];var Oe=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Se=class extends je{constructor(){super(...arguments),this.dataId=gc(),this.hasPrevMessages=!1,this.deletedMessages=[],this.hidecomposer=!1,this.loaded=!1,this.timestamps=!1,this.messagemenus=!1,this.blockList=ae.blockList||[],this.messageList=[],this.timeformat={month:"short",day:"numeric",hour:"numeric",minute:"numeric"},this.messagequotes=!1,this.previousMessages=!1,this.prevMessagesLoading=!1,this.messagesLoading=!0,this.imagePicker=!1,this.messageUrlPatterns=[/((https?):\/\/|www\.)?([-A-Z0-9._\+~#=]*)\.[a-z]{2,}\b([@%_\+.~#?&:\/\/=]+[-A-Z0-9\/]+)*/gi],this.showFilteredMessages=!1,this.deletemessages=!0,this.confirmation=null,this.confirmActions=ag,this.dateTimeFormatter=Sc,this.virtualList=!1,this.translations=ee.localizedStrings,this.messageItemQuerySelector="livelike-message-item",this.onLoadPrevMessageClick=()=>{if(!this.prevMessagesLoading){if(this.prevMessagesLoading=!0,this.maxThresholdMessagesCount){const e=this.messageList[0];return ic(this.roomid,{includeFilteredMessages:this.showFilteredMessages,start:e.created_at}).then((t=>(this.appendPrevLoadedMessages(t.messages,t.done),t))).finally((()=>{this.prevMessagesLoading=!1}))}return this.messageIterator().then((e=>{var t;return this.appendPrevLoadedMessages((t=e.value)===null||t===void 0?void 0:t.messages,e.done),e})).finally((()=>{this.prevMessagesLoading=!1}))}},this.appendPrevLoadedMessages=(e,t)=>{if(this.hasPrevMessages=!t,e?.length){const n=this.messageList[0],r=[],o=[],c=n&&zl(n);e.forEach((l=>{const u=zl(l);c&&u&&c<u?o.push(l):r.push(l)})),r.length&&(r.sort(xp),this.messageList=[...r,...this.messageList],Ie(this,"prev-messages-ready",{messages:r,element:this})),o.length&&(o.forEach((l=>this.messageReceived({message:l,prevMessage:!0}))),this.updateEl())}},this.addReactionSpaceListener=e=>{wr({event:Ye.ADD_REACTION,reactionSpaceId:e},this.onUserReactionEvent),wr({event:Ye.REMOVE_REACTION,reactionSpaceId:e},this.onUserReactionEvent),wr({event:Ye.UPDATE_REACTION_SPACE,reactionSpaceId:e},this.onReactionSpaceUpdateEvent)},this.removeReactionSpaceListener=e=>{Cr({event:Ye.ADD_REACTION,reactionSpaceId:e},this.onUserReactionEvent),Cr({event:Ye.REMOVE_REACTION,reactionSpaceId:e},this.onUserReactionEvent),Cr({event:Ye.UPDATE_REACTION_SPACE,reactionSpaceId:e},this.onReactionSpaceUpdateEvent)},this.addBlockProfileId=e=>{Ie(this,It.QUOTE_MESSAGE,{status:"remove",senderId:e.message.blocked_profile_id})},this.updateLocalization=e=>this.translations=e.localizedStrings,this.sendChatMessage=e=>{const t=(o,c)=>Ie(this,o,{message:e.detail.message,quoteMessage:e.detail.quoteMessage,roomId:this.roomid,resPayload:c}),n=Object.assign({message:e.detail.message,quoteMessage:e.detail.quoteMessage,roomId:this.roomid,sender_image_url:this.avatarurl,timestamp:this.syncStrategy&&this.syncStrategy.currentTimecode?this.syncStrategy.currentTimecode:null},e.detail.messageArgs),r=this.messagequotes&&e.detail.quoteMessage?Xm:Kh;(n.message&&n.message.match(/([^\n]+\n)*[^\n]+/g)||n.image_url)&&r(n).then((o=>{t("messagesent",o),this.demultiplex({message:W0(o,this.roomid),roomId:this.roomid,event:lp[o.message_event]})})).catch((()=>{this.displayModal("muted"),t("messagefailed")}))},this.updateChangedProps=e=>{var t;e==="syncStrategy"&&(t=this.syncStrategy,Object.keys(t).length!==0)&&(this.queue=ea(this.syncStrategy)),this[e]!==void 0&&this[e]!==null&&Ne.emit("chat-updated",{name:e,key:this.dataId,prop:this[e],owner:this})},this.connectChat=()=>{const e=()=>{Hc(cr.BLOCK_PROFILE,this.addBlockProfileId),Yp(cr.BLOCK_PROFILE,this.addBlockProfileId),this.loaded=!1,this.hasPrevMessages=!1,this.syncStrategy?this.queue=ea(this.syncStrategy):this.syncStrategy=Pp(ee.syncStrategy),Pi(this.roomid).then((t=>{var n;return this.channel=t.channels.chat.pubnub,this.reactionSpaceId=t.reaction_space_id,wa({reactionSpaceId:t.reaction_space_id}).then(this.updateReactionEmojis),(n=this.roomid,J0(n,"stickerPacks","sticker_packs_url")).then((r=>this.stickerPacks=r)),this.loaded=!0,Ie(this,"roomentered",{room:this,roomId:this.roomid}),this.addReactionSpaceListener(this.reactionSpaceId),Wh({roomId:this.roomid},this.demultiplex)})).then((()=>this.getMessages()))};ee.ready&&ae&&ae.id?e():po(Ln.INITIALISED,e)},this.demultiplex=e=>{const t=e.event;t==="messagereceived"&&this.messageReceived(e,this.updateEl),t==="messagedeleted"&&this.messageDeleted(e),Ie(this,t,{message:e.message,roomId:this.roomid})},this.getMessages=()=>{const e=this.querySelector(this.messageListQuerySelector);return e&&e.remove(),ic(this.roomid,{includeFilteredMessages:this.showFilteredMessages}).then((t=>{this.messageIterator=!t.done&&t.next,this.hasPrevMessages=this.messageIterator&&t.messages.length===0,this.messageList=[],this.messagesLoading=!1,this.appendElements((()=>{t.messages&&t.messages.length>0&&Rp(this,(()=>{t.messages.forEach((n=>this.messageReceived({message:n}))),this.updateEl()}))})),Ie(this,"messagehistory",{messages:t.messages})}))},this.updateReactionList=(e,t)=>{const n=[...this.messageList],{messageTimetoken:r,actionTimetoken:o,uuid:c,value:l,user_reaction_id:u,message_id:m}=e,v=n.findIndex((R=>R.timetoken===r||R.id===m));if(v!==-1){n[v].reactions[l]||(n[v].reactions[l]=[]);const R=n[v].reactions[l].findIndex((k=>k.uuid===c||o&&k.actionTimetoken===o||u&&k.user_reaction_id===u));t==="reactionadded"?R===-1?n[v].reactions[l].push({uuid:c,actionTimetoken:o,user_reaction_id:u}):(o&&(n[v].reactions[l][R].actionTimetoken=o),u&&(n[v].reactions[l][R].user_reaction_id=u)):t==="reactionremoved"&&R!==-1&&n[v].reactions[l].splice(R,1),this.messageList=n}else{const R=k=>k.payload.message_id===e.message_id&&k.payload.user_reaction_id===e.user_reaction_id&&k.payload.uuid===e.uuid&&k.payload.value===e.value;t==="reactionremoved"&&this.queue.deleteItem(e,R)}},this.updateReaction=(e,t)=>{this.messageList&&(e.uuid===ae.id?this.updateReactionList(e,t):this.queue.enqueueItem({payload:Object.assign(Object.assign({},e),{program_date_time:e.custom_data,event:t}),type:"reaction"},this.updateEl))},this.onUserReactionEvent=({event:e,message:t})=>{const n={uuid:t.reacted_by_id,value:t.reaction_id,user_reaction_id:t.id,message_id:t.target_id,custom_data:t.custom_data};e===Ye.ADD_REACTION?this.updateReaction(n,"reactionadded"):e===Ye.REMOVE_REACTION&&this.updateReaction(n,"reactionremoved")},this.onReactionSpaceUpdateEvent=e=>{this.updateReactionEmojis(e.message)},this.updateReactionEmojis=({reaction_pack_ids:e})=>Promise.all(e.map((t=>od({reactionPackId:t})))).then((t=>{const n=t.reduce(((r,o)=>[...r,...o.emojis]),[]);this.reactionPack=n})),this.handleMessageReaction=(e,t,n)=>new Promise(((r,o)=>{var c;const l=k=>o(console.error(k)),u={"Chat Room ID":this.roomid,"Chat Message ID":e,"Chat Reaction ID":t},m=this.messageList.find((k=>k.id===e));!m&&l("Could not find message for reaction action.");const v=k=>{Ct("Chat Reaction Added",u),r(k)},R=k=>{Ct("Chat Reaction Removed",u),r(k)};if(n==="remove"){const k="Reaction not deleted. Reaction not found.";!m.reactions[t]&&l(k);let M,D=m.reactions[t].find((ne=>ne.uuid===ae.id));if(!D)return l(k);D.user_reaction_id?M=rd({reactionSpaceId:this.reactionSpaceId,userReactionId:D.user_reaction_id,programDateTime:(c=this.syncStrategy)===null||c===void 0?void 0:c.currentTimecode}):D.actionTimetoken&&(this.channel,m.timetoken,D.actionTimetoken,M=new Promise(((ne,oe)=>{}))),M||l("Error while removing reaction"),M.then((ne=>R(ne))).catch((()=>l("Error while removing reaction")))}else{if(!this.reactionPack.find((M=>M.id===t)))return l("Reaction not added. Reaction not found");id({reactionSpaceId:this.reactionSpaceId,reactionId:t,targetId:e,programDateTime:this.syncStrategy.currentTimecode}).then((M=>v(M))).catch((()=>l("Error while adding reaction")))}})),this.addMessageReaction=({messageId:e,reactionId:t})=>this.handleMessageReaction(e,t,"add"),this.removeMessageReaction=({messageId:e,reactionId:t})=>this.handleMessageReaction(e,t,"remove"),this.messageReceived=(e,t)=>{const n=Array.from(this.querySelectorAll(this.messageItemQuerySelector)),r=n.findIndex((c=>c.message.id===e.message.id)),o=this.messageList.findIndex((c=>c.id===e.message.id));r===-1&&o===-1&&((c,l,u=[],m=!1)=>{const v=l.sender_id===ae.id,R=l.content_filter&&l.content_filter.indexOf(Gs.SHADOW_MUTED)>=0&&!v,k=pp(0,l)&&!m,M=u.includes(l.sender_id);return!R&&!k&&!M})(this.roomid,e.message,nc(),this.showFilteredMessages)&&this.queue&&this.queue.enqueueItem({payload:e.message,prevMessage:e.prevMessage,type:"message"},t),r!==-1&&(n[r].message=e.message),o!==-1&&(this.messageList=[...this.messageList.slice(0,o),e.message,...this.messageList.slice(o+1)])},this.messageDeleted=e=>{if(hp(this.roomid).has(e.message.id))return;(({roomId:n,messageId:r})=>{const o=ee.deletedMessageIds[n]||new Set;o.add(r),ee.deletedMessageIds[n]=o})({roomId:this.roomid,messageId:String(e.message.id)}),Ie(this,It.QUOTE_MESSAGE,{status:"remove",messageId:e.message.id}),this.messageList.findIndex((n=>String(e.message.id)===String(n.id)||vh(n)&&e.message.id===n.quote_message_id))!==-1&&(this.deletedMessages=Ec(this.deletedMessages,e.message),Ie(this,e.event,{message:e.message,roomId:this.roomid})),this.updateDeletedMessage(e)},this.updateDeletedMessage=e=>{const t=this.messageList.find((n=>n.id===e.message.id));t&&(t.message=this.localize("chat.messageDeleted"),t.isDeleted=!0)},this.updateEl=()=>{Op(this,(()=>!0),(e=>{e.type==="message"&&this.updateMessageList(e),e.type==="reaction"&&this.updateReactionList(e.payload,e.payload.event)}))},this.updateMessageList=e=>{let t=e.payload;if(hp(this.roomid).has(t.id)||nc().includes(t.sender_id))return;const n=this.messageList&&this.messageList.length===0&&!this.messagesLoading;if(this.messageIterator&&!this.hasPrevMessages&&n&&(this.hasPrevMessages=!0),this.maxThresholdMessagesCount){const r=this.trimMessagesExceedingThreshold();this.messageList=Ec(r,t)}else this.messageList=Ec(this.messageList,t);Ie(this,"message-ready",{message:t,element:this,prevMessage:e.prevMessage})},this.trimMessagesExceedingThreshold=()=>{const e=this.messageList.length+1-this.maxThresholdMessagesCount,t=e>0;if(!this.virtualList){const n=t?this.messageList.slice(0,e):[],r=this.messageItemQuerySelector,o=Array.from(this.querySelectorAll(r));n.forEach((c=>{const l=o.find((u=>u.message.id===c.id));l&&l.remove()}))}return t&&(this.hasPrevMessages=!0),t?this.messageList.slice(e):this.messageList},this.registerMessageMenu=e=>{let t=!1;if(e({}).forEach((n=>n.items&&n.items.forEach((r=>r.items&&(t=!0))))),t)return kp("Message menu currently supports submenus only one level deep.");this.messageMenuFunc=e},this.appendElements=e=>{this.updateComplete.then((()=>{const t=this.shadowRoot.querySelector("slot[name=message-list]");!(t&&t.assignedNodes({flatten:!0}).filter((n=>n.nodeType===1)).length>0)&&this.insertAdjacentHTML("afterbegin",this.renderMessageList()),this.insertAdjacentHTML("beforeend",'<livelike-scroll-down slot="snap-to-live"></livelike-scroll-down>'),e&&e()}))},this.localize=(e,t)=>yn(e,this.lang,t),this.hideConfirmation=()=>{this.confirmation=null},this.reportUser=e=>this.sendReport(e).then((t=>this.displayModal("report",t))),this.sendReport=e=>K.post({url:ee.chatRooms[this.roomid].report_message_url,data:{channel:this.channel,user_id:e.sender_id,nickname:e.sender_nickname,message_id:e.id,message:e.image_url?e.image_url:e.message,profile_id:e.sender_id,pubnub_timetoken:e.timetoken}}),this.onDeleteMessage=e=>{const t=()=>rc({messageId:e.id,roomId:this.roomid}).then((()=>{this.messageDeleted({message:e})}));this.confirmActions.includes(Zt.DELETE_MESSAGE)?this.confirmation={type:Zt.DELETE_MESSAGE,message:e,onAccept:()=>t().then((()=>{this.hideConfirmation()})),onReject:this.hideConfirmation}:t()},this.blockUser=e=>{zh({profileId:e.sender_id}).then((t=>this.displayModal("block",t.blocked_profile)))},this.onQuoteAction=e=>{Ie(this,It.QUOTE_MESSAGE,{message:Object.assign({},e),status:"add"})},this.displayModal=(e,t)=>{const n=this.createLivelikeModal();n.type=e,n.data=t;const r=this.messageListQuerySelector;this.querySelector(r).append(n),setTimeout((()=>n.remove()),4e3)},this.defaultMessageMenuFunc=e=>{const t=e.sender_id===ae.id;return[this.messagequotes&&{label:this.localize("chat.messageMenu.quote"),type:"single",onClick:()=>this.onQuoteAction(e)},!t&&{label:this.localize("chat.messageMenu.reportMessage"),type:"single",onClick:()=>this.reportUser(e)},t&&this.deletemessages&&{label:this.localize("chat.messageMenu.deleteMessage"),type:"single",onClick:()=>this.onDeleteMessage(e)},!t&&{label:this.localize("chat.messageMenu.blockUser"),type:"single",onClick:()=>this.blockUser(e)},{label:this.localize("chat.messageMenu.cancel"),type:"single",onClick:()=>{}}].filter(Boolean)}}get chatComposerEl(){return this.querySelector("livelike-chat-composer")}get messageListQuerySelector(){return this.virtualList?"livelike-message-virtual-list":"livelike-message-list"}connectedCallback(){Ne.on("localizationUpdate",this.updateLocalization),this.addEventListener("sendChatMessage",this.sendChatMessage),this.addEventListener("chat-provider",(e=>{e.detail.provider=this,e.stopPropagation()})),super.connectedCallback()}disconnectedCallback(){this.removeEventListener("sendChatMessage",this.sendChatMessage),this.roomid&&Ns({roomId:this.roomid},this.demultiplex),Hc(cr.BLOCK_PROFILE,this.addBlockProfileId),Ne.off("localizationUpdate",this.updateLocalization)}firstUpdated(){this.messageMenuFunc=this.defaultMessageMenuFunc,Ep(this),Pc(this),this.style+="display:flex; display: -webkit-box; display: -webkit-flex;display: -ms-flexbox;"}updated(e){e.forEach(((t,n)=>{if(n==="hidecomposer"){const r=this.querySelector("livelike-chat-composer"),o=this.shadowRoot.querySelector("slot[name=composer]"),c=o&&o.assignedNodes().length>0;this.hidecomposer?r&&r.remove():!c&&this.insertAdjacentHTML("beforeend",this.renderComposer())}n==="roomid"&&this.roomid&&(t!=null&&(Ns({roomId:t},this.demultiplex),this.removeReactionSpaceListener(this.reactionSpaceId),Ie(this,"roomexited",{roomId:this.roomid})),this.connectChat()),this.updateChangedProps(n)}))}renderComposer(){return`<livelike-chat-composer ${this.imagePicker?"imagePicker":""} slot="composer"></livelike-chat-composer>`}renderMessageList(){return this.virtualList?'<livelike-message-virtual-list slot="message-list"></livelike-message-virtual-list>':'<livelike-message-list slot="message-list"></livelike-message-list>'}createLivelikeModal(){return document.createElement("livelike-modal")}renderEmptyListMessage(){return this.messageList&&this.messageList.length===0&&!this.messagesLoading?I`<slot name="message-list-empty"></slot>`:null}renderMessageListLoading(){return this.messageList.length===0&&this.messagesLoading?I`<slot name="message-list-loading"></slot>`:null}renderConfirmation(){return this.confirmation&&this.confirmation.type===Zt.DELETE_MESSAGE?this.confirmationRenderer&&this.confirmationRenderer(this.confirmation)||I`<livelike-confirmation confirmationtitle="${this.localize("chat.confirmation.deleteMessage.title")}" description="${this.localize("chat.confirmation.deleteMessage.description")}" actionpendinglabel="${this.localize("chat.confirmation.deleteMessage.loadinglabel")}" acceptlabel="${this.localize("chat.confirmation.deleteMessage.accept")}" rejectlabel="${this.localize("chat.confirmation.deleteMessage.reject")}" @onaccept="${this.confirmation.onAccept}" @onreject="${this.confirmation.onReject}"></livelike-confirmation>`:null}render(){return I`<style>:host{display:flex;flex-direction:column;height:100%}</style>${this.loaded&&ae&&ae.id&&this.dataId&&this.roomid?I`${this.renderConfirmation()} ${this.renderEmptyListMessage()}<slot name="message-list">${this.renderMessageListLoading()}</slot><slot name="composer"></slot><slot name="snap-to-live"></slot>`:I`<slot name="chat-element-loading"></slot>`}`}};Oe([C({type:Array})],Se.prototype,"deletedMessages",void 0),Oe([C({type:String})],Se.prototype,"channel",void 0),Oe([C({type:String})],Se.prototype,"reactionSpaceId",void 0),Oe([C({type:String,reflect:!0})],Se.prototype,"roomid",void 0),Oe([C({type:String,reflect:!0})],Se.prototype,"lang",void 0),Oe([C({type:String})],Se.prototype,"placeholder",void 0),Oe([C({type:Boolean})],Se.prototype,"hidecomposer",void 0),Oe([C({type:Boolean})],Se.prototype,"loaded",void 0),Oe([C({type:Boolean})],Se.prototype,"timestamps",void 0),Oe([C({type:Boolean})],Se.prototype,"messagemenus",void 0),Oe([C({type:Function})],Se.prototype,"messageMenuFunc",void 0),Oe([C({type:Array})],Se.prototype,"blockList",void 0),Oe([C({type:Array})],Se.prototype,"messageList",void 0),Oe([C({type:Object})],Se.prototype,"syncStrategy",void 0),Oe([C({type:Object})],Se.prototype,"queue",void 0),Oe([C({type:Array})],Se.prototype,"stickerPacks",void 0),Oe([C({type:Array})],Se.prototype,"reactionPack",void 0),Oe([C({type:Object})],Se.prototype,"timeformat",void 0),Oe([C({type:String})],Se.prototype,"avatarurl",void 0),Oe([C({type:Boolean})],Se.prototype,"showavatar",void 0),Oe([C({type:Boolean})],Se.prototype,"messagequotes",void 0),Oe([C({type:Function})],Se.prototype,"customMessageRenderer",void 0),Oe([C({type:Function})],Se.prototype,"loadPrevMessageRenderer",void 0),Oe([C({type:Function})],Se.prototype,"confirmationRenderer",void 0),Oe([C({type:Boolean})],Se.prototype,"previousMessages",void 0),Oe([C({type:Boolean})],Se.prototype,"prevMessagesLoading",void 0),Oe([C({type:Boolean})],Se.prototype,"messagesLoading",void 0),Oe([C({type:Boolean})],Se.prototype,"imagePicker",void 0),Oe([C({type:Function})],Se.prototype,"chatImagePickerRenderer",void 0),Oe([C({type:Boolean})],Se.prototype,"messageurls",void 0),Oe([C({type:Array})],Se.prototype,"messageUrlPatterns",void 0),Oe([C({type:Boolean})],Se.prototype,"showFilteredMessages",void 0),Oe([C({type:Boolean,reflect:!0})],Se.prototype,"deletemessages",void 0),Oe([C({type:Object})],Se.prototype,"confirmation",void 0),Oe([C({type:Object})],Se.prototype,"confirmActions",void 0),Oe([C({type:Function})],Se.prototype,"dateTimeFormatter",void 0),Oe([C({type:Boolean})],Se.prototype,"virtualList",void 0),Oe([C({type:Number})],Se.prototype,"maxThresholdMessagesCount",void 0),Oe([C({type:Object,hasChanged:()=>!0})],Se.prototype,"translations",void 0),Se=Oe([de("livelike-chat")],Se);var ad=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Ca=class extends je{constructor(){super(...arguments),this.owner=document.querySelector(this.getAttribute("for"))||this.parentElement,this.loaded=!0,this.localize=(e,t)=>yn(e,this.lang,t),this.loadPage=()=>{this.loaded&&(this.loaded=!1,this.buttonEl.innerHTML='<div class="loading-spinner"></div>',this.owner.loadNextPage().then((e=>{this.loaded=!0,e&&this.buttonEl.remove(),this.buttonEl&&(this.buttonEl.innerHTML=this.localize("widget.timeline.loadMore"))})))}}connectedCallback(){super.connectedCallback(),Pc(this);const e=document.createElement("style");e.innerHTML=`
|
|
366
|
+
livelike-load-more-button button{
|
|
367
|
+
display: flex;
|
|
368
|
+
justify-content: center;
|
|
369
|
+
width:100%;
|
|
370
|
+
height: auto;
|
|
371
|
+
border: none;
|
|
372
|
+
border-radius: 0.25rem;
|
|
373
|
+
background: #086fac;
|
|
374
|
+
font-size: 1rem;
|
|
375
|
+
color: #fff;
|
|
376
|
+
padding: 0.75rem;
|
|
377
|
+
margin:1rem 0 0 0;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
livelike-load-more-button button:hover {
|
|
381
|
+
cursor: pointer;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
livelike-load-more-button .loading-spinner {
|
|
385
|
+
position: relative;
|
|
386
|
+
border-radius: 50%;
|
|
387
|
+
width: 20px;
|
|
388
|
+
height: 20px;
|
|
389
|
+
border: 4px solid rgba(255, 255, 255, 0.1);
|
|
390
|
+
border-top: 4px solid #fff;
|
|
391
|
+
animation: rotating 1.2s infinite cubic-bezier(0.785, 0.135, 0.15, 0.86);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
@keyframes rotating {
|
|
395
|
+
100% {
|
|
396
|
+
transform: rotate(360deg);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
`,this.appendChild(e);const t=document.createElement("button");t.addEventListener("click",this.loadPage),t.setAttribute("class","livelike-load-more-button"),t.setAttribute("aria-label","Load more widgets"),t.innerHTML=this.localize("widget.timeline.loadMore"),this.buttonEl=t,this.appendChild(t)}render(){return I`<slot></slot>`}};ad([C({type:Boolean})],Ca.prototype,"loaded",void 0),ad([C({type:String,reflect:!0})],Ca.prototype,"lang",void 0),Ca=ad([de("livelike-load-more-button")],Ca);const Hv=I`<style>.sponsorship{padding:16px 8px;font-size:14px;display:flex;align-items:center;justify-content:center}.sponsor{width:fit-content;cursor:pointer}.sponsor img{height:25px;vertical-align:middle;margin-left:8px}</style>`;var ld=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Mo=class extends je{createRenderRoot(){return this}handleSponsorClick(){var e,t;!((t=(e=this.sponsors)===null||e===void 0?void 0:e[0])===null||t===void 0)&&t.clickthrough_url&&window.open(this.sponsors[0].clickthrough_url,"_self")}render(){var e;return!((e=this.sponsors)===null||e===void 0)&&e.length?I`${Hv}<div class="sponsorship"><div class="sponsor" @click="${this.handleSponsorClick}">${this.sponsorLabel} <img src="${this.sponsors[0].logo_url}" alt="${this.sponsors[0].name}"></div></div>`:null}};ld([C({type:Array})],Mo.prototype,"sponsors",void 0),ld([C({type:Function})],Mo.prototype,"sponsorLabel",void 0),Mo=ld([de("livelike-sponsor")],Mo);var lt=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let ot=class extends je{constructor(){super(...arguments),this.dataId=gc(),this.updating=!1,this.hasWidgetAttached=!1,this.mode="pop-up",this.loaded=!1,this.authors=!1,this.timestamps=!1,this.reactions=!1,this.timeformat={month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric"},this.hide_dismiss_button=!1,this.dateTimeFormatter=Sc,this.widgetListener=e=>{if(N0.some((t=>e.event===t))){let t=this.onWidgetReceived(e.message);t&&this.enqueueWidget({mode:this.mode,widgetPayload:t})}},this.connectWidget=()=>{if(ee.ready)return this.loaded=!1,this.syncStrategy?this.queue=ea(this.syncStrategy):this.syncStrategy=Pp(ee.syncStrategy),Oi(this.programid).then((e=>{this.channel=e.pubnub_enabled?e.subscribe_channel:null,this.channel&&he.subscribe(this.channel),this.mode.includes("timeline")?this.loadTimeline(this.programid):this.loaded=!0}));setTimeout(this.connectWidget,1e3)},this.onInitialWidgetsLoaded=({widgets:e})=>e,this.afterWidgetsLoaded=({widgets:e,interactionUrl:t})=>bo({interactionUrl:t}).then((n=>{(({widgets:r,interactions:o})=>r.map((c=>{let l=Ac(c);if(l){const{kind:u,id:m}=l;return{widgetPayload:c,interactions:o&&o[u]?o[u].filter((v=>v.widget_id===m)):null}}return{widgetPayload:c,interactions:null}})))({widgets:e,interactions:n}).map((({widgetPayload:r,interactions:o})=>{this.enqueueWidget({mode:this.mode,widgetPayload:r,initialLoad:!0,interactions:o})}))})).catch((n=>{e.map((r=>{this.enqueueWidget({mode:this.mode,widgetPayload:r,initialLoad:!0})}))})),this.loadTimeline=e=>Up({programId:e}).then((t=>{this.widgetPaginator=t,this.widgetPaginator.next().then((n=>{Rp(this,(()=>{let r=this.onInitialWidgetsLoaded({widgets:n.value.widgets});this.afterWidgetsLoaded({widgets:r,interactionUrl:n.value.widget_interactions_url_template})})),this.loaded=!0,!n.done&&this.insertAdjacentHTML("beforeend",'<livelike-load-more-button slot="load-more-button"></livelike-load-more-button>')}))})),this.onMoreWidgetsLoaded=({widgets:e})=>e,this.loadNextPage=()=>this.widgetPaginator.next().then((e=>{let t=this.onMoreWidgetsLoaded({widgets:e.value.widgets});return this.afterWidgetsLoaded({widgets:t,interactionUrl:e.value.widget_interactions_url_template}),e.done})),this.updateEl=()=>{Op(this,(()=>this.mode!=="pop-up"||!this.hasWidgetAttached),(e=>{e.payload&&!this.querySelector(`[widgetid="${e.payload.id}"]`)&&(this.hasWidgetAttached=!0,this.showWidget({mode:e.mode,widgetPayload:e.payload,initialLoad:e.initialLoad,interactions:e.interactions}))}))},this.registerWidgetMode=(e,t)=>vo(e,t),this.showWidget=e=>this.start(e),this.enqueueWidget=e=>this.queue.enqueueItem({payload:e.widgetPayload,mode:e.mode,initialLoad:e.initialLoad,interactions:e.interactions},this.updateEl),this.createWidgetElement=e=>Xt({id:e.id,kind:e.kind}).then((t=>this.showWidget({widgetPayload:t,mode:e.mode,interactions:e.interactions}))),this.createSyncWidget=e=>Xt({id:e.id,kind:e.kind}).then((t=>this.enqueueWidget({widgetPayload:t,mode:e.mode,interactions:e.interactions}))),this.overRideTimer=({widget:e})=>null,this.start=e=>{Ie(this,"beforewidgetattached",{widget:e.widgetPayload});const t=Dp(e.mode||this.mode);return this.createWidget(e).then((n=>n&&t({target:this,widget:n,timer:this.overRideTimer({widget:n})})))},this.attach=(e,t)=>{const n=t==="append"?"beforeend":"afterbegin";if(this.insertAdjacentElement(n,e),Ie(this,"widgetattached",{element:e,widget:e.widgetPayload}),e.widgetPayload){const r={"Widget Type":Dn(e.widgetPayload.kind),"Widget ID":e.widgetPayload.id};e.widgetPayload.kind!==se.ALERT&&e.widgetPayload.kind!==se.VIDEO_ALERT||(r["Link URL"]=e.widgetPayload.link_url),Ct("Widget Displayed",r,this.programid)}return Promise.resolve()},this.detach=e=>{const t={element:e,widget:e.widgetPayload};return e&&this.contains(e)&&(Ie(this,"beforewidgetdetached",t),e.remove(),Ie(this,"widgetdetached",t),this.hasWidgetAttached=!1),Promise.resolve()},this.createWidget=e=>{const{widgetPayload:t,interactions:n}=e,r=this.customWidgetRenderer&&typeof this.customWidgetRenderer=="function"&&this.customWidgetRenderer({widgetPayload:t});let o=r instanceof Element||r instanceof Node?r:document.createElement("livelike-"+t.kind);for(let c in t)c!=="id"&&c!=="attributes"&&(o[c]=t[c]);return o.widgetId=t.id,o.setAttribute("widgetid",t.id),o.widgetPayload=t,o.interactions=n,n&&(o.interaction=n[0]),o.reactions=this.reactions,o.dataId=this.dataId,o.programid=this.programid,o.authors=this.authors,o.timestamps=this.timestamps,o.timeformat=this.timeformat,o.lang=this.lang,o.dateTimeFormatter=this.dateTimeFormatter,this.customTemplateRenderer&&(typeof this.customTemplateRenderer=="function"?o.customTemplate=this.customTemplateRenderer:((c,l,u)=>{const m=`${c}: ${l} must be of type <${u}>`;console.error(m)})(this.localName,"customTemplateRenderer","Function")),o.theme=lr.theme,o.hide_dismiss_button=this.hide_dismiss_button,e.initialLoad&&(o.initialLoad=e.initialLoad),Promise.resolve(o)},this.getUnclaimedRewards=()=>{return(e={programId:this.programid},Oi(e.programId).then((t=>xe(Te(ae.id,t.unclaimed_widget_interactions_url_template),(n=>K.get({url:n})),(n=>({count:n.count,results:n.results}))))).catch((t=>Promise.reject(t)))).then((t=>Re(["results"],t)));var e}}firstUpdated(){Ep(this),Pc(this),vo("pop-up",fp),vo("timeline",K0),vo("interactive-timeline",_p)}onWidgetReceived(e){return e}disconnectedCallback(){super.disconnectedCallback(),this.channel&&he.removeListener(this.channel,this.widgetListener)}updated(e){e.forEach(((t,n)=>{n==="syncStrategy"&&this.syncStrategy&&(this.queue=ea(this.syncStrategy)),(n==="hasWidgetAttached"||n==="loaded")&&(c=>{this[c]!==void 0&&Ie(this,c,{[c]:!0})})(n),n==="channel"&&this.channel&&(t&&(he.removeListener(t,this.widgetListener),he.unsubscribe(t)),he.addListener(this.channel,this.widgetListener));const r=n==="programid"&&this.programid&&this.programid!==t,o=n==="mode"&&t!==void 0&&this.mode!==t;if(this.programid){if(r&&t!==void 0||o){for(;this.firstChild;)this.removeChild(this.firstChild);!this.firstChild&&(this.hasWidgetAttached=!1)}this.mode?(r||o)&&this.connectWidget():this.mode="pop-up"}}))}render(){const e=this.loaded?I`<slot></slot><slot name="load-more-button"></slot>`:I`<slot name="widgets-loading"></slot>`;return I`<style>:host{display:block}livelike-widgets{display:block}</style>${e}`}};lt([C({type:Object})],ot.prototype,"widgetPaginator",void 0),lt([C({type:String})],ot.prototype,"channel",void 0),lt([C({type:String,reflect:!0})],ot.prototype,"programid",void 0),lt([C({type:String,reflect:!0})],ot.prototype,"lang",void 0),lt([C({type:String})],ot.prototype,"mode",void 0),lt([C({type:Boolean})],ot.prototype,"loaded",void 0),lt([C({type:Boolean})],ot.prototype,"authors",void 0),lt([C({type:Boolean})],ot.prototype,"timestamps",void 0),lt([C({type:Boolean})],ot.prototype,"reactions",void 0),lt([C({type:Function})],ot.prototype,"customWidgetRenderer",void 0),lt([C({type:Function})],ot.prototype,"customTemplateRenderer",void 0),lt([C({type:Object})],ot.prototype,"queue",void 0),lt([C({type:Object})],ot.prototype,"syncStrategy",void 0),lt([C({type:Object})],ot.prototype,"timeformat",void 0),lt([C({type:Boolean})],ot.prototype,"hide_dismiss_button",void 0),lt([C({type:Function})],ot.prototype,"dateTimeFormatter",void 0),ot=lt([de("livelike-widgets")],ot);const qv=I`<style>:host{display:flex}livelike-livechat-composer{display:flex;position:relative;flex-direction:column;flex-shrink:0}.livelike-livechat-composer-quote-message{display:flex;justify-content:space-between;align-items:flex-start;width:100%;border-radius:4px 4px 0 0;border-top:.5px solid rgba(100,100,100,.3);padding:.75rem .5rem}livelike-livechat-quote-message-item{flex-grow:1;overflow:hidden}.livelike-livechat-compose-quote-message-cancel{display:flex;padding:0 .3rem 0 .8rem;align-items:center;color:grey}.livelike-livechat-compose-quote-message-cancel svg{height:16px;width:16px}.livelike-livechat-compose-quote-message-cancel circle{fill:transparent;cursor:pointer}.livelike-livechat-compose-quote-message-cancel path{fill:grey;cursor:pointer}.livelike-livechat-input-container{position:relative;width:100%}.livelike-livechat-input{border-radius:20px;background:#363636;border:0;box-sizing:border-box;color:#f0f0ff;font-size:1rem;font-family:inherit;line-height:1.5rem;height:40px;min-height:2.5rem;overflow:hidden;padding:.5rem 3rem .5rem .875rem;resize:none;width:100%;border:1px solid transparent}.livelike-livechat-input:focus{outline:0;border:1px solid rgba(255,255,255,.2)}.livelike-livechat-input::placeholder{color:rgba(240,240,255,.6)}.livechat-composer-send-icon{border:none;background:0 0;padding:0;margin:0 0 0 .5rem}.livechat-composer-send-icon svg{fill:#777}.livechat-composer-send-icon:focus svg,.livechat-composer-send-icon:hover svg{transition:all .3s ease-out}.livechat-composer-send-icon:hover{cursor:pointer}.livechat-sticker-picker-container{position:absolute;border:none;background:0 0;top:50%;right:.875rem;transform:translate(0,-50%);transition:all .3s ease-out}</style>`,Gv=I`<style>.livelike-livechat-composer-input{display:flex;position:relative;flex-shrink:0;padding:8px 8px 0}</style>`,Wv=I`<style>.livechat-sticker-nav-container{position:relative;background:#252525;height:auto;width:100%;border-radius:0 0 8px 8px;overflow:auto;min-width:15rem}.livechat-sticker-nav-wrap{display:flex;list-style-type:none;padding:0;margin:0}.livechat-sticker-nav-item{border:none;transition:all .2s;padding:.625rem;background:#252525;border-right:1px solid rgba(240,240,255,.2);border-top:1px solid rgba(240,240,255,.2)}.livechat-sticker-nav-item.active{background:#363636;border-radius:0;border-top:none}.livechat-sticker-nav-item:hover{cursor:pointer}.livechat-sticker-nav-item img{width:20px;height:20px;vertical-align:middle;border:0}</style>`,Kv=I`<style>@keyframes slideIn{from{opacity:0;transform:translate3d(0,-1rem,0)}to{opacity:1;transform:translate3d(0,-.5rem,0)}}.livechat-sticker-icon{border:none;background:0 0;padding:0;margin:0}.livechat-sticker-icon:hover{cursor:pointer}.livechat-sticker-icon svg{fill:#888;height:20px;width:20px}.livechat-sticker-container{position:absolute;opacity:0;transition:all ease .3s;z-index:21;max-width:20rem;border-radius:8px;border:1px solid rgba(240,240,255,.2);right:0;bottom:3.5rem}.livechat-sticker-container.show{opacity:1;transition:all ease .3s}.livechat-sticker-container.hide{opacity:0;transition:all ease .3s}.livechat-sticker-container-header{position:relative;border-radius:.5rem .5rem 0 0;background:#141414;padding:.5rem .75rem;background:#363636}.livechat-sticker-header-title{color:#fff;font-size:.875rem;font-style:normal;font-weight:600;line-height:1.125rem;letter-spacing:-.14px}.sticker-close-icon{border:none;background:0 0;position:relative;float:right;top:-1px;right:0;background-size:contain;width:1.25rem;height:1.25rem;cursor:pointer}.livechat-sticker-body{position:relative;display:flex;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap;overflow-y:auto;min-height:8rem;max-height:8rem;background:#363636;padding:0 .875rem .5rem}.livechat-sticker-wrap{border:none;color:#fff;padding:.325rem 0;width:3rem;background:0 0;border-radius:.75rem;transition:all ease .3s;margin:.425rem}.livechat-sticker-wrap:focus,.livechat-sticker-wrap:hover{outline:0;background:#818592;cursor:pointer}.sticker-image{width:100%;vertical-align:middle}</style>`;var Qv=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let lg=class extends Jt{constructor(){super(...arguments),this.liveChatKeyedLocalize=(e,t)=>this.owner.localize(this.localizationKey+e,t),this.stickerBody=()=>{var e;return(e=this.stickers)===null||e===void 0?void 0:e.map((t=>I`<button tabindex="0" type="button" class="livechat-sticker-wrap" aria-label="${this.liveChatKeyedLocalize(".stickerSelectionButton.ariaLabel",{stickerName:t.shortcode||t.title})}" @click="${()=>{Ie(this,"sticker-selected",{sticker:t}),this.closeDrawer()}}"><span class="sticker-wrap-image"><img class="sticker-image" src="${t.file||t.images.preview_gif.url}" alt="${t.shortcode||t.title}"></span></button>`))},this.renderStickerDrawer=()=>{const e=this.title||this.liveChatKeyedLocalize(".title");return I`<div class="livechat-sticker-container" style="opacity:${this.animation}" aria-label="${e}"><header class="livechat-sticker-container-header"><span class="livechat-sticker-header-title">${e}</span> <button tabindex="0" type="button" class="sticker-close-icon" aria-label="${this.liveChatKeyedLocalize(".closeButton.ariaLabel")}" @click="${this.closeDrawer}">${ta}</button></header><div class="livechat-sticker-body">${this.stickerBody()}</div>${this.navFooterTemplate?this.navFooterTemplate():null}</div>`}}createRenderRoot(){return this}render(){return I`${Kv} <button tabindex="0" type="button" class="livechat-sticker-icon" aria-label="${this.liveChatKeyedLocalize(".openButton.ariaLabel")}" @click="${()=>{hr(this,this.owner.dataId,"drawerOpen"),setTimeout((()=>{Ie(this,"drawer-opened")}),50)}}">${this.buttonIcon}</button> ${this.drawerOpen?this.renderStickerDrawer():null}`}};lg=Qv([de("livelike-livechat-stickers")],lg);var Xv=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let cg=class extends Ao{constructor(){super(...arguments),this.stickerNav=()=>{var e;return(e=this.owner.stickerPacks)===null||e===void 0?void 0:e.map((t=>{const n=t.id===this.selectedPack?"active":"";return I`<button tabindex="0" type="button" aria-label="${this.owner.localize("chat.stickerPicker.stickerPackTab.ariaLabel",{packName:t.name})}" class="livechat-sticker-nav-item ${n}" @click="${()=>this.changePack(t)}"><img src="${t.file}" alt="${t.name}"></button>`}))},this.stickerNavFooter=()=>I`<nav slot="sticker-drawer-footer" class="livechat-sticker-nav-container"><div class="livechat-sticker-nav-wrap">${this.stickerNav()}</div></nav>`}createRenderRoot(){return this}render(){var e,t;return I`${Wv} ${!((t=(e=this.owner)===null||e===void 0?void 0:e.stickerPacks)===null||t===void 0)&&t.length?I`<livelike-livechat-stickers .localizationKey="${"chat.stickerPicker"}" .stickers="${this.selectedStickers}" .buttonIcon="${Gp}" @drawer-opened="${()=>{}}" .navFooterTemplate="${this.stickerNavFooter}"></livelike-livechat-stickers>`:null}`}};cg=Xv([de("livelike-livechat-sticker-picker")],cg);const Zv=I`<style>:host{overflow:auto}.livechat-quote-message-item-container{position:relative}.livechat-quote-message-wrapper{display:flex;opacity:1;transition:all .4s;position:relative}.livechat-quote-message-text{display:flex;align-items:center;column-gap:4px;overflow:hidden;margin-bottom:4px}.livechat-quote-message-text.composer-quote-msg{flex-direction:column;row-gap:.75rem;align-items:flex-start;margin-bottom:0}.livechat-quote-sender-text{display:flex;align-items:center;column-gap:.25rem}.livechat-quote-message-wrapper svg{min-width:14px}.livechat-quote-sender-name-label{color:#b6b6b6;font-size:.875rem;font-style:normal;font-weight:500;line-height:1rem;letter-spacing:-.42px;white-space:nowrap}.livechat-composer-quote-sender-name{font-weight:600}.livechat-quote-sender-message{color:#b6b6b6;font-size:.875rem;font-style:normal;font-weight:500;line-height:1rem;letter-spacing:-.42px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.livechat-quote-sender-message.composer-quote-msg{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;word-break:break-word}</style>`;function Di(e){const t={value:e,listeners:[],set:n=>{t.value=n,t.notify()},get:()=>t.value,notify:()=>{if(t.listeners.length){const n=t.get();try{t.listeners.forEach((r=>r(n)))}catch(r){console.error("Error while calling banner subscribers",r)}}},subscribe:n=>{const r=t.listeners.findIndex((o=>o===n));return r<0?t.listeners=[...t.listeners,n]:(t.listeners=[...t.listeners],t.listeners.splice(r,1,n)),()=>{t.listeners=t.listeners.filter((o=>o!==n))}}};return t}const jt=Di({}),cd={setBannerStateAction({bannerGroupId:e,newState:t}){jt.set(Object.assign(Object.assign({},jt.get()),{[e]:t}))},addBannerAction({bannerGroupId:e,newBanner:t}){const n=jt.get()[e];if(n){const r=[...n.banners];jt.set(Object.assign(Object.assign({},jt.get()),{[e]:Object.assign(Object.assign({},r),{banners:[t,...r]})}))}else jt.set({[e]:{banners:[t]}})},removeBannerAction({bannerGroupId:e,targetId:t}){const n=jt.get()[e].banners.filter((r=>r.targetId!==t));jt.set(Object.assign(Object.assign({},jt.get()),{[e]:{banners:n}}))}},Gn={getState:e=>jt.get()[e],setState:e=>cd.setBannerStateAction(e),subscribe:(e,t)=>jt.subscribe((()=>{const n=Gn.getState(e);t(n)})),addBanner(e,t){cd.addBannerAction({bannerGroupId:e,newBanner:t})},removeBannerById(e,t){cd.removeBannerAction({bannerGroupId:e,targetId:t})}},Lo=Di({}),Jv={updateReactionPackAction({reactionSpaceId:e,reactionPacks:t}){Lo.set(Object.assign(Object.assign({},Lo.get()),{[e]:t}))}},Wn={getState:e=>Lo.get()[e],subscribe:(e,t)=>Lo.subscribe((()=>{const n=Wn.getState(e);t(n)})),loadReactionPackFromReactionSpace:e=>Promise.all(e.reaction_pack_ids.map((t=>od({reactionPackId:t})))).then((t=>(Jv.updateReactionPackAction({reactionSpaceId:e.id,reactionPacks:t}),t))),getReactionPacks:({reactionSpaceId:e})=>Lo.get()[e]||[],getReactions({reactionSpaceId:e}){const t=Wn.getReactionPacks({reactionSpaceId:e});return t.length?t.reduce(((n,r)=>[...n,...r.emojis]),[]):[]}},dd=Di({}),Yv={updateReactionSpaceAction({targetGroupId:e,reactionSpace:t}){dd.set(Object.assign(Object.assign({},dd.get()),{[e]:t}))}},$o={loadReactionSpaceDetail:({targetGroupId:e})=>wa({targetGroupId:e}).then((t=>(Yv.updateReactionSpaceAction({targetGroupId:e,reactionSpace:t}),t))),getReactionSpaceDetail:({targetGroupId:e})=>dd.get()[e]},Bt=Di({}),Yt={setUserReactionAction({reactionSpaceId:e,targetUserReactions:t}){var n;Bt.set(Object.assign(Object.assign({},Bt.get()),{[e]:Object.assign(Object.assign({},(n=Bt.get()[e])!==null&&n!==void 0?n:{}),t)}))},addUserReactionAction({reactionSpaceId:e,userReaction:t,profileId:n}){var r,o,c;const l=(r=Bt.get())===null||r===void 0?void 0:r[e],{target_id:u,reaction_id:m,reacted_by_id:v,id:R}=t,k=n===v,M=(o=l?.[u])===null||o===void 0?void 0:o[m],D=k&&M&&!!M?.self_reacted_user_reaction_id,ne=Object.assign(Object.assign({},l),{[u]:Object.assign(Object.assign({},l?.[u]),{[m]:{reaction_id:m,self_reacted_user_reaction_id:k?R:M?.self_reacted_user_reaction_id,count:D?M?.count:((c=M?.count)!==null&&c!==void 0?c:0)+1}})});Bt.set(Object.assign(Object.assign({},Bt.get()),{[e]:ne}))},removeUserReactionAction({reactionSpaceId:e,userReaction:t,profileId:n}){var r,o,c;const l=(r=Bt.get())===null||r===void 0?void 0:r[e],{target_id:u,reaction_id:m,reacted_by_id:v}=t,R=n===v,k=(o=l?.[u])===null||o===void 0?void 0:o[m],M=R&&k&&!k?.self_reacted_user_reaction_id,D=Object.assign(Object.assign({},l),{[u]:Object.assign(Object.assign({},l?.[u]),{[m]:{reaction_id:m,self_reacted_user_reaction_id:R?null:k?.self_reacted_user_reaction_id,count:M?k?.count:((c=k?.count)!==null&&c!==void 0?c:0)-1}})});Bt.set(Object.assign(Object.assign({},Bt.get()),{[e]:D}))}},eb=[],kt={_reactionSpaceListeners:{},getState(e,t){var n;return(n=Bt.get()[e])===null||n===void 0?void 0:n[t]},setState(e){Yt.setUserReactionAction(e)},subscribe:(e,t,n)=>Bt.subscribe((()=>{const r=kt.getState(e,t);n(r)})),loadUserReactions:({targetIds:e,reactionSpaceId:t})=>e.length!==0&&t?Zm({targetIds:e,reactionSpaceId:t}).then((({results:n})=>{const r=n.reduce(((o,c)=>(o[c.target_id]=c.reactions.reduce(((l,u)=>(l[u.reaction_id]=u,l)),{}),o)),{});return Yt.setUserReactionAction({reactionSpaceId:t,targetUserReactions:r}),r})):Promise.resolve({}),getValidUserReactions({reactionPacks:e,userReactions:t}){if(!e.length||!Object.keys(t).length)return eb;const n=e.reduce(((r,o)=>[...r,...o.emojis]),[]);return Object.values(t).map((r=>{const o=n.find((({id:c})=>c===r.reaction_id));if(o)return Object.assign(Object.assign({},r),{imageSrc:o.file})})).filter(Boolean)},onReactionClick({reactionId:e,reactionSpaceId:t,targetId:n}){var r,o;const c=(o=(r=kt.getState(t,n))===null||r===void 0?void 0:r[e])===null||o===void 0?void 0:o.self_reacted_user_reaction_id,l={reactionSpaceId:t,userReaction:{target_id:n,reaction_id:e,reacted_by_id:ae.id,id:"DUMMY_USER_REACTION_ID"},profileId:ae.id};return c?(Yt.removeUserReactionAction(l),rd({reactionSpaceId:t,userReactionId:c}).then((u=>{Yt.removeUserReactionAction({reactionSpaceId:t,userReaction:u,profileId:ae.id})})).catch((()=>{Yt.addUserReactionAction(l)}))):(Yt.addUserReactionAction(l),id({reactionSpaceId:t,targetId:n,reactionId:e}).then((u=>{Yt.addUserReactionAction({reactionSpaceId:t,userReaction:u,profileId:ae.id})})).catch((()=>{Yt.removeUserReactionAction(l)})))},setReactionSpaceListeners(e,t,n){this._reactionSpaceListeners[`${e}-${t}`]=n},getReactionSpaceListeners(e,t){return this._reactionSpaceListeners[`${e}-${t}`]},unSubscribeToUserReactionEvents(e){Cr({event:Ye.ADD_REACTION,reactionSpaceId:e},this.getReactionSpaceListeners(Ye.ADD_REACTION,e)),Cr({event:Ye.REMOVE_REACTION,reactionSpaceId:e},this.getReactionSpaceListeners(Ye.ADD_REACTION,e))},subscribeToUserReactionEvents(e){const t=({event:r,message:o})=>{const c={reacted_by_id:o.reacted_by_id,id:o.id,reaction_id:o.reaction_id,target_id:o.target_id,custom_data:o.custom_data};Yt.addUserReactionAction({reactionSpaceId:e,userReaction:c,profileId:ae.id})},n=({event:r,message:o})=>{const c={reacted_by_id:o.reacted_by_id,id:o.id,reaction_id:o.reaction_id,target_id:o.target_id,custom_data:o.custom_data};Yt.removeUserReactionAction({reactionSpaceId:e,userReaction:c,profileId:ae.id})};this.setReactionSpaceListeners(Ye.ADD_REACTION,e,t),wr({event:Ye.ADD_REACTION,reactionSpaceId:e},t),this.setReactionSpaceListeners(Ye.REMOVE_REACTION,e,n),wr({event:Ye.REMOVE_REACTION,reactionSpaceId:e},n)}},ge=Di({}),ut={setCommentBoardStateAction({commentBoardId:e,newState:t}){ge.set(Object.assign(Object.assign({},ge.get()),{[e]:t}))},updateCommentConfigAction({commentBoardId:e,commentBoardConfig:t}){ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign({},ge.get()[e]),t)}))},initialiseCommentListAction({commentBoardId:e,comments:t,commentTotalCount:n,iterator:r,maxReplyDepth:o,commentReports:c}){ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign({},ge.get()[e]),{comments:t,commentTotalCount:n,iterator:r,replyStack:[],maxReplyDepth:o,commentReports:c})}))},updateCommentsNextStateAction({commentBoardId:e,totalCommentCount:t,comments:n,iterator:r}){const o=ge.get()[e].commentTotalCount,c=Ia({existingCount:o,totalCount:t,filteredCount:n.length});ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign({},ge.get()[e]),{comments:[...ge.get()[e].comments,...n],commentTotalCount:c,iterator:r})}))},addReplyStackAction({commentBoardId:e,commentId:t}){var n;const r=ge.get()[e];ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign({},r),{replyStack:[...(n=r.replyStack)!==null&&n!==void 0?n:[],t]})}))},updateReplyListCacheAction({cachedReplies:e,parentCommentId:t,commentBoardId:n}){const r=ge.get()[n];ge.set(Object.assign(Object.assign({},ge.get()),{[n]:Object.assign(Object.assign({},r),{cachedReplies:Object.assign(Object.assign({},r?.cachedReplies),{[t]:Object.assign({},e)})})}))},loadCommentRepliesListAction({commentBoardId:e,parentCommentId:t,comments:n,replyTotalCount:r,iterator:o}){const c=ge.get()[e];ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign({},c),{commentReplies:Object.assign(Object.assign({},c.commentReplies),{[t]:{replies:n,replyTotalCount:r,iterator:o}})})}))},updateCommentRepliesNextStateAction({commentBoardId:e,parentCommentId:t,comments:n,totalReplyCount:r,iterator:o}){const c=ge.get()[e],l=c.commentReplies[t].replyTotalCount,u=Ia({existingCount:l,totalCount:r,filteredCount:n.length});ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign({},c),{commentReplies:Object.assign(Object.assign({},c.commentReplies),{[t]:Object.assign(Object.assign({},c.commentReplies[t]),{iterator:o,replies:[...c.commentReplies[t].replies,...n],replyTotalCount:u})})})}))},removeReplyStackTopAction({commentBoardId:e}){const t=ge.get()[e],n=[...t.replyStack];n.pop(),ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign({},t),{replyStack:n})}))},emptyReplyStackAction({commentBoardId:e}){const t=ge.get()[e];ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign({},t),{replyStack:[]})}))},addCommentAction({commentBoardId:e,comment:t}){const n=ge.get()[e];ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign({},n),{comments:[t,...n.comments],commentTotalCount:n.commentTotalCount+1})}))},addCommentReplyAction({commentBoardId:e,parentCommentId:t,comment:n}){const r=ge.get()[e],o=r.commentReplies[t];ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign({},r),{commentReplies:Object.assign(Object.assign({},r.commentReplies),{[t]:Object.assign(Object.assign({},o),{replyTotalCount:o.replyTotalCount+1,replies:[n,...o.replies]})})})}))},deleteCommentAction({commentBoardId:e,commentId:t}){const n=ge.get()[e],r=n.comments.map((o=>o.id===t?Object.assign(Object.assign({},o),{is_deleted:!0,deleted_by:ae.id}):o));ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign({},n),{comments:r})}))},deleteCommentReplyAction({commentBoardId:e,parentCommentId:t,commentId:n}){var r,o;const c=(r=ge.get()[e])===null||r===void 0?void 0:r.commentReplies[t],l=((o=c?.replies)!==null&&o!==void 0?o:[]).map((m=>m.id===n?Object.assign(Object.assign({},m),{is_deleted:!0,deleted_by:ae.id}):m)),u=c.replyTotalCount;ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign({},ge.get()[e]),{commentReplies:Object.assign(Object.assign({},ge.get()[e].commentReplies),{[t]:Object.assign(Object.assign({},ge.get()[e].commentReplies[t]),{replies:l,replyTotalCount:u-1})})})}))},loadCommentReportsAction({commentBoardId:e,commentReports:t}){ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign({},ge.get()[e]),{commentReports:Object.assign(Object.assign({},ge.get()[e].commentReports),t)})}))},addCommentReportAction({commentBoardId:e,commentId:t,commentReport:n}){const r=ge.get()[e],o=!!r.replyStack.length,c=o?r.replyStack[r.replyStack.length-1]:void 0,l=(o?r.commentReplies[c].replies:r.comments).map((u=>u.id===t?Object.assign(Object.assign({},u),{is_self_reported:!0}):u));ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign(Object.assign({},r),o?{commentReplies:Object.assign(Object.assign({},r.commentReplies),{[c]:Object.assign(Object.assign({},r.commentReplies[c]),{replies:l})})}:{comments:l}),{commentReports:Object.assign(Object.assign({},ge.get()[e].commentReports),{[t]:n})})}))},removeCommentReportAction({commentBoardId:e,commentId:t}){const n=ge.get()[e],r=!!n.replyStack.length,o=r?n.replyStack[n.replyStack.length-1]:void 0,c=(r?n.commentReplies[o].replies:n.comments).map((u=>u.id===t?Object.assign(Object.assign({},u),{is_self_reported:!1}):u)),l=Object.assign({},ge.get()[e].commentReports);delete l[t],ge.set(Object.assign(Object.assign({},ge.get()),{[e]:Object.assign(Object.assign(Object.assign({},n),r?{commentReplies:Object.assign(Object.assign({},n.commentReplies),{[o]:Object.assign(Object.assign({},n.commentReplies[o]),{replies:c})})}:{comments:c}),{commentReports:l})}))}},fe={getState:e=>ge.get()[e],setState:e=>ut.setCommentBoardStateAction(e),updateCommentConfig:e=>ut.updateCommentConfigAction(e),subscribe:(e,t)=>ge.subscribe((()=>{const n=fe.getState(e);t(n)})),loadCommentList:({commentBoardId:e,sorting:t=Nn.NEWEST,topLevel:n=!0,excludeDeletedCommentWithNoReplies:r=!0})=>qn(e).then((o=>Promise.all([Promise.resolve(o),rm(),ng({commentBoardId:e,sorting:t,topLevel:n,excludeDeletedCommentWithNoReplies:r}),og({commentBoardId:e,reportStatus:Ys.PENDING}),$o.loadReactionSpaceDetail({targetGroupId:e}).catch((c=>{Xs()&&console.error("Error when getting reaction space detail",c)}))]))).then((([o,c,l,u,m])=>Promise.all([Promise.resolve(o),Promise.resolve(c),Promise.resolve(l),Promise.resolve(u),Promise.resolve(m),m&&Wn.loadReactionPackFromReactionSpace(m),m&&kt.loadUserReactions({reactionSpaceId:m.id,targetIds:l.results.map((({id:v})=>v))})].filter(Boolean)))).then((o=>{const[c,l,u,m,v,R,k]=o,M=l.results,D=u.results,ne=fe.filterComments({blockedProfileIds:new Set(M),comments:D,commentBoardId:e}),oe=m.results.reduce(((ce,ye)=>(ce[ye.comment_id]=ye,ce)),{}),me=Ia({existingCount:u.count,totalCount:u.results.length,filteredCount:ne.length});return ut.initialiseCommentListAction({commentBoardId:e,comments:ne,commentTotalCount:me,iterator:u.done?void 0:u.iterator,maxReplyDepth:c.replies_depth,commentReports:oe}),o})).catch((o=>{Xs()&&console.error(`Error when initialising comment board id=${e}`,o)})),loadNextComments(e){var t;const n=(t=fe.getState(e))===null||t===void 0?void 0:t.iterator;if(n)return n.next().then((r=>{var o;const c=r?.value,l=fe.filterComments({blockedProfileIds:new Set(qc()),comments:(o=c?.results)!==null&&o!==void 0?o:[],commentBoardId:e});return ut.updateCommentsNextStateAction({commentBoardId:e,comments:l,totalCommentCount:c.results.length,iterator:r.done?void 0:n}),{state:fe.getState(e),iterator:n,response:r}}));Xs()&&console.debug(`No comment list iterator found for commentBoardId=${e}`)},addReplyStack({commentBoardId:e,commentId:t}){ut.addReplyStackAction({commentBoardId:e,commentId:t})},loadCommentReplies:({commentBoardId:e,commentId:t,sorting:n=Nn.NEWEST,excludeDeletedCommentWithNoReplies:r=!0})=>Promise.all([rm(),ig({commentBoardId:e,commentId:t,sorting:n,excludeDeletedCommentWithNoReplies:r})]).then((([o,c])=>{var l,u;const m=(l=$o.getReactionSpaceDetail({targetGroupId:e}))===null||l===void 0?void 0:l.id,v=(u=c.results)===null||u===void 0?void 0:u.map((({id:k})=>k)),R=[Promise.resolve(o),Promise.resolve(c),m?kt.loadUserReactions({targetIds:v,reactionSpaceId:m}):Promise.resolve({})];return Promise.all(R)})).then((([o,c,l])=>{var u;const m=(u=fe.getState(e).cachedReplies)===null||u===void 0?void 0:u[t],v=fe.isCommentListEqual(m?.results,c.results),R=o.results,k=c.results,M=fe.filterComments({blockedProfileIds:new Set(R),comments:k,commentBoardId:e}),D=Ia({existingCount:c.count,totalCount:c.results.length,filteredCount:M.length});return v||(ut.updateReplyListCacheAction({cachedReplies:c,parentCommentId:t,commentBoardId:e}),ut.loadCommentRepliesListAction({commentBoardId:e,parentCommentId:t,comments:M,replyTotalCount:D,iterator:c.done?void 0:c.iterator})),{blockedProfilesIdsRes:o,repliesRes:c,userReactionsRes:l,filteredReplies:M}})),loadNextCommentReplies({commentBoardId:e,parentCommentId:t}){var n;const r=(n=fe.getState(e))===null||n===void 0?void 0:n.commentReplies[t].iterator;if(r)return r.next().then((o=>{var c;const l=o?.value,u=fe.filterComments({blockedProfileIds:new Set(qc()),comments:(c=l?.results)!==null&&c!==void 0?c:[],commentBoardId:e});return ut.updateCommentRepliesNextStateAction({commentBoardId:e,parentCommentId:t,comments:u,totalReplyCount:l.results.length,iterator:o.done?void 0:r}),{state:fe.getState(e),iterator:r,response:o}}));Xs()&&console.debug(`No reply list iterator found for commentId=${t}`)},removeReplyStackTop(e){ut.removeReplyStackTopAction({commentBoardId:e})},emptyReplyStack(e){ut.emptyReplyStackAction({commentBoardId:e})},addComment:({commentBoardId:e,text:t,customData:n,authorImageUrl:r})=>Ym({commentBoardId:e,text:t,customData:n,authorImageUrl:r}).then((o=>(ut.addCommentAction({commentBoardId:e,comment:o}),{state:fe.getState(e),response:o}))),filterComments({blockedProfileIds:e,comments:t,commentBoardId:n}){var r,o,c;const l=(o=(r=fe.getState(n))===null||r===void 0?void 0:r.profaneComment)!==null&&o!==void 0?o:ur.FILTER,u=(c=fe.getState(n))===null||c===void 0?void 0:c.profaneCommentFilterFunction;return t.filter((m=>{const v=e.has(m.author.id),R=m.author.id===ae.id;if(v)return!1;if(m.content_filter.includes(Uc.PROFANITY)){if(l===ur.CUSTOM)return u(m);if(R)return!0;if(l===ur.FILTER)return!1;l===ur.MASK&&(m.text=m.filtered_text)}return!0}))},addCommentReply:({commentBoardId:e,text:t,customData:n,parentCommentId:r,authorImageUrl:o})=>eg({commentBoardId:e,text:t,customData:n,parentCommentId:r,authorImageUrl:o}).then((c=>(ut.addCommentReplyAction({commentBoardId:e,comment:c,parentCommentId:r}),{state:fe.getState(e),response:c}))),getParentCommentForReply(e){const t=fe.getState(e),n=t?.replyStack;if(!n?.length)return null;const r=n[n.length-1];if(n.length===1)return t.comments.find((({id:c})=>c===r));const o=n[n.length-2];return t.commentReplies[o].replies.find((({id:c})=>c===r))},deleteComment:e=>sd({commentBoardId:e.comment_board_id,commentId:e.id}).then((t=>(ut.deleteCommentAction({commentBoardId:e.comment_board_id,commentId:e.id}),{state:fe.getState(e.comment_board_id),response:t}))),deleteCommentReply:e=>sd({commentBoardId:e.comment_board_id,commentId:e.id}).then((t=>(ut.deleteCommentReplyAction({commentBoardId:e.comment_board_id,parentCommentId:e.parent_comment_id,commentId:e.id}),{state:fe.getState(e.comment_board_id),response:t}))),reportComment:({commentBoardId:e,commentId:t})=>rg({commentId:t}).then((n=>(ut.addCommentReportAction({commentBoardId:e,commentId:t,commentReport:n}),n))),deleteCommentReport:({commentBoardId:e,commentId:t,commentReportId:n})=>sg({commentReportId:n}).then((()=>{ut.removeCommentReportAction({commentBoardId:e,commentId:t})})),blockUserProfile:({profileId:e})=>tm({profileId:e}),unblockUserProfile:({blockId:e})=>nm({blockId:e}),isCommentListEqual:(e,t)=>Ap(e,t)},Ia=({existingCount:e,totalCount:t,filteredCount:n})=>n<t?e-(t-n):e,ka=Di({messageSelected:null}),tb={setMessageSelectedAction(e){ka.set(Object.assign(Object.assign({},ka.get()),{messageSelected:e}))}},kr={setMessageSelected(e){tb.setMessageSelectedAction(e)},getMessageSelected:()=>ka.get().messageSelected,subscribe:e=>ka.subscribe(e)},Kn=Di({usernameColor:"",usernameColorList:[]}),dg={setUsernameColorAction(e){Kn.set(Object.assign(Object.assign({},Kn.get()),{usernameColor:e}))},setUsernameColorListAction(e){Kn.set(Object.assign(Object.assign({},Kn.get()),{usernameColorList:e}))}},At={setUsernameColor(e){dg.setUsernameColorAction(e)},getUsernameColor:()=>Kn.get().usernameColor,subscribe:e=>Kn.subscribe(e),setUsernameColorList(e){dg.setUsernameColorListAction(e)},getUsernameColorList:()=>Kn.get().usernameColorList,getRandomUsernameColor(e){const t=Kn.get().usernameColorList;return t[e.length%t.length]}};var ud=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Ea=class extends Un{constructor(){super(...arguments),this.isComposerQuoteMsg=!1,this.lang="en",this.localize=(e,t)=>yn(e,this.lang,t),this.renderMessage=()=>{if(this.isDeleted=up(this.owner.roomid,this.message.id),this.isDeleted||this.isSenderBlocked){const e=this.isDeleted?this.owner.localize("chat.quoteMessage.deleted",{nickname:this.message.sender_nickname}):this.owner.localize("chat.messageSenderBlocked");return I`<span>${e}</span>`}return na(this.message,this.owner.stickerPacks,this.owner.messageurls,this.owner.messageUrlPatterns)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback()}render(){var e;if(!this.message)return null;const{selfClass:t,deletedClass:n,senderBlockedClass:r}=this.getQuoteMessageItemClasses(),o=this.isComposerQuoteMsg?"composer-quote-msg":"",c=this.isComposerQuoteMsg?"livechat-composer-quote-sender-name":"",l=this.message.sender_id===ae.id?At.getUsernameColor():At.getRandomUsernameColor((e=this.message.sender_nickname)!==null&&e!==void 0?e:""),u=this.message.image_url?this.message.image_url:this.message.message,m=this.isComposerQuoteMsg?`color: ${l}`:"",v=this.owner.localize("livechat.quoteMessageItem.replyTo.label");return I`${Zv}<div class="livechat-quote-message-item-container ${t}"><div class="livechat-quote-message-wrapper" tabindex="0"><div class="livechat-quote-message-text ${o}" aria-live="polite" role="log"><div class="livechat-quote-sender-text">${Vy} ${this.isDeleted||this.isSenderBlocked?null:I`<div class="livechat-quote-sender-name-label" aria-label="${this.message.sender_nickname}">${v} <span class="${c}" style="${m}">${this.message.sender_nickname}</span>:</div>`}</div><div @click="${this.trackClickEvent}" aria-label="${u}" id="senderMessage-${this.message.id}" class="livechat-quote-sender-message ${n} ${r} ${o}">${this.renderMessage()}</div></div></div></div>`}};ud([C({type:Boolean})],Ea.prototype,"isComposerQuoteMsg",void 0),ud([C({type:String})],Ea.prototype,"lang",void 0),Ea=ud([de("livelike-livechat-quote-message-item")],Ea);var Qn=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let bn=class extends it{constructor(){super(...arguments),this.sendChatIcon=Qp,this.chatSettingIcon=Kp,this.message="",this.quoteMessage=void 0,this.sendClickHandler=()=>{this.message.trim().length?(Ie(this,"sendChatMessage",{message:this.message,quoteMessage:this.quoteMessage}),this.message="",this.removeQuoteMessage(),this.inputEl.value="",this.resize("40px")):this.showChatUserSetting()},this.addSticker=e=>{var t,n;!((n=(t=e?.detail)===null||t===void 0?void 0:t.sticker)===null||n===void 0)&&n.shortcode&&this.message.length+e.detail.sticker.shortcode.length<=200&&(this.message=this.message+`:${e.detail.sticker.shortcode}:`,this.inputEl.value=this.message,this.adjustInputElementHeight(),this.inputEl.focus())},this.adjustInputElementHeight=()=>{this.inputEl.scrollHeight>this.inputEl.offsetHeight&&this.resize(null)},this.handleMessage=e=>{e.target.value!==void 0&&(this.message=e.target.value),this.resize(e.target.value===""?"40px":null)},this.handleKeyDown=e=>{e.which!==13||e.shiftKey||(e.preventDefault(),this.message.trim().length&&this.sendClickHandler(),this.inputEl.focus())},this.resize=e=>{this.inputEl.style.height=e||`${this.inputEl.scrollHeight}px`},this.handleQuoteEvent=e=>{const t=e.detail.status;t==="add"&&this.owner.messagequotes?(this.quoteMessage=e.detail.message,this.toggleQuoteMessageEl("show"),this.inputEl.focus()):t!=="remove"||!this.quoteMessage||e.detail.senderId!==this.quoteMessage.sender_id&&e.detail.messageId!==this.quoteMessage.id||this.removeQuoteMessage()},this.removeQuoteMessage=()=>{this.quoteMessage=void 0,this.toggleQuoteMessageEl("hide")},this.toggleQuoteMessageEl=e=>{if(e==="show"){this.querySelector(".livelike-livechat-composer-quote-message").style.display="flex";const t=this.querySelector("livelike-livechat-quote-message-item");t.message=this.quoteMessage,t.isComposerQuoteMsg=!0}else this.querySelector(".livelike-livechat-composer-quote-message").style.display="none",this.querySelector("livelike-livechat-quote-message-item").message=void 0,this.removeMessageSelected()},this.showStickerPickerContainer=()=>{this.stickerPickerContainerEl.style.display="block"}}createRenderRoot(){return this}get localizedPlaceholder(){return this.placeholder||this.owner.placeholder||this.owner.localize("chat.inputPlaceholder")}get inputEl(){return this.querySelector(".livelike-livechat-input")}get stickerPickerContainerEl(){return this.querySelector(".livechat-sticker-picker-container")}updated(e){e.forEach(((t,n)=>{n==="placeholder"&&(this.inputEl.placeholder=this.placeholder,this.inputEl.setAttribute("aria-label",this.placeholder))}))}connectedCallback(){super.connectedCallback(),this.addEventListener("sticker-selected",this.addSticker),this.owner.addEventListener(It.QUOTE_MESSAGE,this.handleQuoteEvent)}disconnectedCallback(){this.removeEventListener("sticker-selected",this.addSticker),this.owner.removeEventListener(It.QUOTE_MESSAGE,this.handleQuoteEvent),super.disconnectedCallback()}renderQuoteMessage(){return I`<div class="livelike-livechat-composer-quote-message" style="display:none"><livelike-livechat-quote-message-item></livelike-livechat-quote-message-item><div class="livelike-livechat-compose-quote-message-cancel" @click="${this.removeQuoteMessage}">${ta}</div></div>`}renderComposerInput(){const e=this.message.trim().length?this.sendChatIcon:this.chatSettingIcon;return I`<div class="livelike-livechat-composer-input"><div class="livelike-livechat-input-container"><textarea class="livelike-livechat-input" maxlength="200" placeholder="${this.localizedPlaceholder}" aria-label="${this.localizedPlaceholder}" @input="${this.handleMessage}" @keydown="${this.handleKeyDown}"></textarea><div class="livechat-sticker-picker-container"><livelike-livechat-sticker-picker></livelike-livechat-sticker-picker></div></div><button aria-label="${this.owner.localize("chat.sendButton.ariaLabel")}" class="livechat-composer-send-icon" @click="${this.sendClickHandler}">${e}</button></div>`}render(){return I`${qv} ${Gv} ${this.renderQuoteMessage()} ${this.renderComposerInput()}`}};Qn([C({type:String})],bn.prototype,"sendChatIcon",void 0),Qn([C({type:String})],bn.prototype,"chatSettingIcon",void 0),Qn([C({type:String,reflect:!0})],bn.prototype,"placeholder",void 0),Qn([C({type:String})],bn.prototype,"message",void 0),Qn([C({type:Object})],bn.prototype,"quoteMessage",void 0),Qn([C({type:Function})],bn.prototype,"showChatUserSetting",void 0),Qn([C({type:Function})],bn.prototype,"removeMessageSelected",void 0),bn=Qn([de("livelike-livechat-chat-composer")],bn);const nb=I`<style>@keyframes slideDown{from{opacity:0;transform:translate3d(0,-3rem,0)}to{opacity:1;transform:translate3d(0,0,0)}}@keyframes slideUp{from{opacity:0;transform:translate3d(-50%,2rem,0)}to{opacity:1;transform:translate3d(-50%,0,0)}}.livechat-new-messages-icon{z-index:15;position:absolute;border:none;left:50%;transform:translateX(-50%);bottom:8.5rem;padding:6px 10px;border-radius:20px;border:1px solid rgba(255,255,255,.12);background:rgba(46,46,46,.95);box-shadow:0 4px 4px 0 rgba(0,0,0,.15);display:none;align-items:center;gap:4px;animation:slideDown .5s ease forwards;transition:all .3s ease;color:#f0f0ff;font-size:.875rem;font-style:normal;font-weight:600;line-height:normal}.livechat-new-messages-icon:hover{cursor:pointer}.livechat-new-messages-icon.show{display:flex;animation:slideUp .5s ease forwards}</style>`;var ug=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let hd=class extends fa{constructor(){super(...arguments),this.userScrolled=!1,this.ownerUpdated=e=>{(e.name==="translations"||e.name==="lang")&&this.updateLocalizedStrings()},this.toggleScrollBtnVisibility=e=>{if(e.key===this.owner.dataId){const t=this.querySelector(".livechat-new-messages-icon"),n=e.scrolled?"livechat-new-messages-icon show":"livechat-new-messages-icon";t?.setAttribute("class",n)}},this.liveChatScrollDown=()=>Ne.emit("scrollDown",{key:this.owner.dataId}),this.updateLocalizedStrings=()=>{this.querySelector("button.livechat-new-messages-icon").setAttribute("aria-label",this.owner.localize("chat.scrollDownButton.ariaLabel"))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),Ne.on("userScrolled",this.toggleScrollBtnVisibility),this.addEventListener("click",this.liveChatScrollDown)}renderLiveChatScrollDownButton(){return I`<button tabindex="0" aria-label="${this.owner.localize("chat.scrollDownButton.ariaLabel")}" class="livechat-new-messages-icon">${Fy} ${this.owner.localize("chat.scrollDownButton.label")}</button>`}render(){return I`${nb}${this.renderLiveChatScrollDownButton()}`}};ug([C({type:Boolean})],hd.prototype,"userScrolled",void 0),hd=ug([de("livelike-livechat-scroll-down")],hd);const ib=I`<style>.confirmation-overlay,.livechat-confirmation-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0}.livechat-confirmation-overlay-backdrop{background-color:transparent;opacity:1;z-index:2000}.confirmation-overlay{display:flex;justify-content:center;align-items:center}.confirmation-action-pending{padding:.625rem 1.75rem;display:flex;justify-content:center;align-items:center}.livechat-confirmation-action-pending{color:#fff}.livechat-confirmation-action-pending .spinner-inner-container{background-color:#363636}.livechat-confirmation-content{display:flex;flex-direction:column;align-items:center;max-width:400px;z-index:2001;transition:width 1s ease-in;border-radius:7px;border:1px solid rgba(240,240,255,.2);background:#363636;box-shadow:0 4px 4px 0 rgba(0,0,0,.05);padding:.875rem}.livechat-confirmation-header{align-self:center;font-weight:700;padding-top:0;font-size:1rem;font-weight:600;line-height:1.25rem;letter-spacing:-.48px;color:#f0f0ff}.livechat-confirmation-body{align-self:center;padding:0 30px;font-size:14px;margin:0;margin-top:4px;color:#fff;font-weight:500;line-height:20px;letter-spacing:-.42px}.livechat-confirmation-footer{display:flex;flex-direction:column;align-items:center;height:auto;margin:.75rem 0 0;width:80%;gap:.5rem}.livechat-confirmation-footer-seperator{width:100%;border:none;border-top:.5px solid rgba(255,255,255,.5);height:0;margin:0}.livechat-confirmation-accept-btn,.livechat-confirmation-reject-btn{color:#0084ff;border:0;background-color:transparent;cursor:pointer;width:100%;padding:.375rem;color:#e5e6ee;font-size:.875rem;font-weight:600;letter-spacing:-.42px}</style>`;var rb=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let hg=class extends Ut{createRenderRoot(){return this}renderOnActionPending(){return I`<div class="livechat-confirmation-action-pending"><livelike-spinner animationduration="${2}"></livelike-spinner><span>${this.actionpendinglabel}</span></div>`}renderConfirmationDialog(){return I`<span class="livechat-confirmation-header">${this.confirmationtitle}</span><p class="livechat-confirmation-body">${this.description}</p><div class="livechat-confirmation-footer"><button class="livechat-confirmation-accept-btn" @click="${this.onAcceptHandler}">${this.acceptlabel}</button><hr class="livechat-confirmation-footer-seperator"><button class="livechat-confirmation-reject-btn" @click="${()=>Ie(this,"onreject")}">${this.rejectlabel}</button></div>`}render(){return I`${ib}<div class="confirmation-overlay"><div class="livechat-confirmation-overlay-backdrop"></div><div class="livechat-confirmation-content">${this.isLoading?this.renderOnActionPending():this.renderConfirmationDialog()}</div></div>`}};hg=rb([de("livelike-livechat-confirmation")],hg);const ob=I`<style>.message-item-menu-bottom-sheet-container{background:0 0;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;z-index:100;align-items:flex-end}.message-item-menu-bottom-sheet-content{width:100%;background:#363636;color:#fff}.message-item-menu-container{padding:.75rem 1rem 1.125rem;border-radius:4px 4px 0 0;border-top:1px solid rgba(240,240,255,.2);background:#363636;display:flex;flex-direction:column;gap:1.125rem}.message-item-menu-header{display:flex;justify-content:space-between;align-items:center}.message-sender-name{color:#f0f0ff;font-size:1.125rem;font-style:normal;font-weight:600;line-height:1.25rem;letter-spacing:-.54px;margin:0}.message-item-menu-close-btn{background:0 0;border:0;margin:0;padding:0}.message-item-menu-close-btn:hover{cursor:pointer}.message-item-menu-close-btn svg{height:16px;width:16px}.message-item-menu-options-container{display:flex;flex-direction:column;gap:.875rem}.message-item-menu-option-item{display:flex;align-items:center;column-gap:.75rem;cursor:pointer;background:0 0;border:0;margin:0;padding:.188rem;border-radius:4px;width:100%;color:#f0f0ff;font-size:.875rem;font-style:normal;font-weight:500;line-height:1.25rem;letter-spacing:-.42px}.message-item-menu-option-item:hover{background:#252525}.message-item-menu-option-item.block-user,.message-item-menu-option-item.report-message{color:#ff4550}@media (max-width:500px){.message-item-menu-close-btn{display:none}}</style>`;var Sa=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Vo=class extends it{constructor(){super(...arguments),this.messageSelected=null,this.renderMenuOptionIcon=e=>I`${e||""}`,this.renderMenuOptionButton=({key:e,icon:t,label:n,onClick:r})=>I`<button class="message-item-menu-option-item ${e}" @click="${()=>{r(),this.onClose()}}">${this.renderMenuOptionIcon(t)} ${n}</button>`}createRenderRoot(){return this}handleContentClick(e){e.stopPropagation()}onClose(){Ne.emit(It.SHOW_MESSAGE_ITEM_MENU,!1),this.removeMessageSelected()}render(){if(!this.messageSelected)return null;const e=this.messageSelected,t=this.messageMenuFunc(e);return I`${ob}<div class="message-item-menu-bottom-sheet-container" @click="${()=>this.onClose()}"><div class="message-item-menu-bottom-sheet-content" @click="${this.handleContentClick}"><div class="message-item-menu-container"><div class="message-item-menu-header"><p class="message-sender-name">${e.sender_nickname}</p><button class="message-item-menu-close-btn" @click="${()=>this.onClose()}">${ta}</button></div><div class="message-item-menu-options-container">${t.map((n=>this.renderMenuOptionButton({key:n.key,icon:n.icon,label:n.label,onClick:n.onClick})))}</div></div></div></div>`}};Sa([C({type:Object})],Vo.prototype,"messageSelected",void 0),Sa([C({type:Function})],Vo.prototype,"messageMenuFunc",void 0),Sa([C({type:Function})],Vo.prototype,"removeMessageSelected",void 0),Vo=Sa([de("livelike-livechat-message-item-menu")],Vo);const sb=I`<style>.chat-user-setting-bottom-sheet-container{background:0 0;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;z-index:100;align-items:flex-end}.chat-user-setting-bottom-sheet-content{width:100%;background:#363636;color:#fff}.chat-user-setting-container{padding:1rem;border-radius:4px 4px 0 0;border-top:1px solid rgba(240,240,255,.3);background:#363636}.chat-user-setting-header{display:flex;justify-content:space-between;align-items:center}.chat-user-setting-title{color:#f0f0ff;font-size:1rem;font-weight:600;line-height:1.25rem;letter-spacing:-.48px}.chat-user-setting-close-btn{background:0 0;border:0;margin:0;padding:0}.chat-user-setting-close-btn:hover{cursor:pointer}.chat-user-setting-close-btn svg{height:16px;width:16px}.chat-user-setting-username-container{display:flex;justify-content:space-between;align-items:center;margin-top:.75rem}.chat-user-setting-username,.chat-user-setting-username-label{color:#f0f0ff;font-size:.75rem;font-weight:500;line-height:1.25rem;letter-spacing:-.36px}.username-color-picker-container{margin-top:.5rem}.username-color-picker-title{color:#f0f0ff;font-size:.75rem;font-weight:500;line-height:1.25rem;letter-spacing:-.36px}.username-color-picker-description{margin:0;color:#b6b6b6;font-size:.75rem;font-weight:500;line-height:1rem;letter-spacing:-.33px}.username-color-picker-list-container{margin-top:.5rem;display:flex;align-items:center;flex-wrap:wrap;gap:.5rem}.username-color-picker-item-container{border:.5px solid rgba(190,190,190,.5);border-radius:50%;padding:0;background:0 0;width:36px;height:36px;display:flex;align-items:center;justify-content:center}.username-color-picker-item-container.selected{border:1px solid #27bf9d}.username-color-picker-item-container:hover{cursor:pointer}.username-color-picker-item{height:28px;width:28px;border-radius:50%}@media (max-width:500px){.chat-user-setting-close-btn{display:none}}</style>`;var Pa=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Do=class extends it{constructor(){super(...arguments),this.pickedUsernameColor="",this.lang="en",this.localize=(e,t)=>yn(e,this.lang,t),this.saveSelectedUsernameColorToProfile=()=>{var e;const t=JSON.parse((e=ae.custom_data)!==null&&e!==void 0?e:"{}"),n={custom_data:JSON.stringify(Object.assign(Object.assign({},t),{selectedUsernameColor:this.pickedUsernameColor}))};Jp({accessToken:ae.access_token,options:n})},this.handleUsernameColorClick=e=>{this.pickedUsernameColor=e},this.renderUsernameColorItem=e=>{const t=e===this.pickedUsernameColor?"selected":"";return I`<button class="username-color-picker-item-container ${t}" @click="${()=>this.handleUsernameColorClick(e)}"><div class="username-color-picker-item" style="background:${e}"></div></button>`},this.renderColorPicker=e=>{const t=this.owner.localize("livechat.userSetting.colorPicker.title"),n=this.owner.localize("livechat.userSetting.colorPicker.description");return I`<div class="username-color-picker-container"><span class="username-color-picker-title">${t}</span><p class="username-color-picker-description">${n}</p><div class="username-color-picker-list-container">${e.map((r=>this.renderUsernameColorItem(r)))}</div></div>`}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.pickedUsernameColor=At.getUsernameColor()}handleContentClick(e){e.stopPropagation()}onClose(){this.hideChatUserSetting();const e=At.getUsernameColor();this.pickedUsernameColor!==e&&(At.setUsernameColor(this.pickedUsernameColor),this.saveSelectedUsernameColorToProfile())}render(){const e=At.getUsernameColorList(),t=this.pickedUsernameColor,n=this.owner.localize("livechat.userSetting.chatSetting.label"),r=this.owner.localize("livechat.userSetting.username.label");return I`${sb}<div class="chat-user-setting-bottom-sheet-container" @click="${this.onClose}"><div class="chat-user-setting-bottom-sheet-content" @click="${this.handleContentClick}"><div class="chat-user-setting-container"><div class="chat-user-setting-header"><div class="chat-user-setting-title">${n}</div><button class="chat-user-setting-close-btn" @click="${this.onClose}">${ta}</button></div><div class="chat-user-setting-username-container"><span class="chat-user-setting-username-label">${r}</span> <span class="chat-user-setting-username" style="color:${t}">${ae.nickname}</span></div>${this.renderColorPicker(e)}</div></div></div>`}};Pa([C({type:String})],Do.prototype,"pickedUsernameColor",void 0),Pa([C({type:Function})],Do.prototype,"hideChatUserSetting",void 0),Pa([C({type:String})],Do.prototype,"lang",void 0),Do=Pa([de("livelike-chat-user-setting")],Do);const ab=I`<style>:host{overflow:auto;width:100%}livelike-livechat-message-item{width:100%}.livechat-message-item-container{position:relative;margin:0 .5rem .875rem;display:flex;justify-content:flex-start;padding:.125rem .375rem;border-radius:4px}.livechat-message-item-container.active{background:#363636}.livechat-message-item-container.deleted:hover{background:0 0;cursor:not-allowed}.livechat-message-item-container .quote-message-item-container{margin:0 0 .3rem 0}.livechat-message-wrapper{display:flex;flex-direction:column;background:0 0;max-width:95%;position:relative;flex-grow:1}.livechat-message-wrapper:focus{outline:0}.livechat-sender-message-delete-icon svg{vertical-align:text-bottom}.message-separator{color:#f0f0ff;margin-right:2px}.livechat-sender-name{color:#f89a43;font-size:.875rem;font-style:normal;font-weight:700;line-height:1.25rem;letter-spacing:-.42px;white-space:nowrap}.livechat-sender-message{color:#f0f0ff;font-size:.875rem;font-style:normal;font-weight:500;line-height:1.25rem;letter-spacing:-.42px;word-break:break-word}.livechat-sender-message.deleted{color:#f0f0ff;font-size:.875rem;font-style:italic;font-weight:400;line-height:1.25rem;vertical-align:text-bottom}.word-item{height:32px;vertical-align:middle}.no-message-container{height:100%;position:relative;display:flex;justify-content:center}.no-messages{margin:0;color:#fff;position:absolute;top:50%}@media (min-width:501px){.livechat-message-item-container:hover{background:#363636;cursor:pointer}}</style>`,lb=I`<style>.livelike-livechat-modal{color:#000;position:absolute;z-index:15;width:60%;left:25%;top:auto;bottom:20%;opacity:0;border-radius:20px;border:1px solid rgba(255,255,255,.12);background:rgba(46,46,46,.95);box-shadow:0 4px 4px 0 rgba(0,0,0,.15);padding:.375rem .75rem}.livelike-livechat-modal.showing{transition:all ease .3s;opacity:1}.livechat-modal-body{color:#f0f0ff;font-size:14px;font-weight:600;text-align:center}</style>`;var cb=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let pg=class extends _o{createRenderRoot(){return this}render(){const e={block:this.owner.localize("chat.blockConfirmation.message"),report:this.owner.localize("chat.reportConfirmation.message"),muted:this.owner.localize("chat.mutedMessage"),error:this.owner.localize("chat.errorMessage")};return I`${lb}<div class="livelike-livechat-modal ${this.type!==""?"showing":null}"><div class="livechat-modal-body">${e[this.type]}</div></div>`}};pg=cb([de("livelike-livechat-modal")],pg);var Oa=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let No=class extends jn{constructor(){super(...arguments),this.myUsernameColor="",this.isMyMessage=!1,this.setMessageSelected=()=>{this.messageSelected=kr.getMessageSelected()},this.setMyUsernameColor=()=>{this.myUsernameColor=At.getUsernameColor()},this.renderQuoteMessage=()=>this.owner.messagequotes&&Cc(this.message)&&!this.message.isDeleted?I`<livelike-livechat-quote-message-item .message="${this.message.quote_message}"></livelike-livechat-quote-message-item>`:null,this.renderSenderName=e=>this.message.isDeleted?I`<span class="livechat-sender-message-delete-icon">${By}</span>`:I`<span class="livechat-sender-name" style="color:${e}" aria-label="${this.message.sender_nickname}">${this.message.sender_nickname}<span class="message-separator">:</span></span>`,this.handleMessageItemClick=()=>{this.message.isDeleted||(kr.setMessageSelected(this.message),Ne.emit(It.SHOW_MESSAGE_ITEM_MENU,!0))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.isMyMessage=this.message.sender_id===ae.id,this.setup()}disconnectedCallback(){var e,t;super.disconnectedCallback(),(e=this.unsubscribeLiveChatStore)===null||e===void 0||e.call(this),(t=this.unsubscribeChatUserSettingStore)===null||t===void 0||t.call(this)}setup(){this.setMessageSelected(),this.setMyUsernameColor(),this.unsubscribeLiveChatStore=kr.subscribe(this.setMessageSelected),this.isMyMessage&&(this.unsubscribeChatUserSettingStore=At.subscribe(this.setMyUsernameColor))}render(){var e,t,n;const r=this.owner.blockList.find((v=>v===this.message.sender_id)),{selfClass:o,deletedClass:c,filteredClass:l}=this.getMessageItemClasses(),u=((e=this.messageSelected)===null||e===void 0?void 0:e.id)===this.message.id?"active":"",m=this.isMyMessage?this.myUsernameColor:At.getRandomUsernameColor((t=this.message.sender_nickname)!==null&&t!==void 0?t:"");return r?null:I`${ab}<div class="livechat-message-item-container ${u} ${o} ${l} ${c}" @click="${this.handleMessageItemClick}"><div class="livechat-message-wrapper" tabindex="0" aria-live="polite" role="log">${this.renderQuoteMessage()}<div class="livechat-sender-message-wrapper">${this.renderSenderName(m)} <span @click="${this.trackClickEvent}" aria-label="${(n=this.message.image_url)!==null&&n!==void 0?n:this.message.message}" id="senderMessage-${this.message.id}" class="livechat-sender-message ${c}">${na(this.message,this.owner.stickerPacks,this.owner.messageurls,this.owner.messageUrlPatterns)}</span></div></div></div>`}};Oa([C({type:String})],No.prototype,"messageSelected",void 0),Oa([C({type:String})],No.prototype,"myUsernameColor",void 0),Oa([C({type:Boolean})],No.prototype,"isMyMessage",void 0),No=Oa([de("livelike-livechat-message-item")],No);var db=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let mg=class extends ia{constructor(){super(...arguments),this.checkIfAtBottom=()=>{var e;const t=this.children[this.children.length-1];if(!t||!this.scrollHeight)return!0;const n=(e=t.querySelector(".livechat-message-item-container"))===null||e===void 0?void 0:e.clientHeight;return Math.abs(this.scrollHeight-(this.scrollTop+this.clientHeight))<.5*n}}createMessageElem(e){const t=document.createElement("livelike-livechat-message-item"),n=this.hasCustomMessage(e)?this.owner.customMessageRenderer({message:e}):t;return n.message=e,n.owner=this.owner,n}};mg=db([de("livelike-livechat-message-list")],mg);var ub=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let gg=class extends ga{constructor(){super(...arguments),this.checkIfAtBottom=()=>{var e;const t=this.children[this.children.length-1];if(!t||!this.scrollHeight)return!0;const n=(e=t.querySelector(".livechat-message-item-container"))===null||e===void 0?void 0:e.clientHeight;return Math.abs(this.virtualiser.scrollHeight-(this.virtualiser.scrollTop+this.virtualiser.clientHeight))<.5*n}}createRenderRoot(){return this}createMessageElem(e){const t=document.createElement("livelike-livechat-message-item"),n=this.hasCustomMessage(e)?this.owner.customMessageRenderer({message:e}):t;return n.message=e,n.owner=this.owner,n}};gg=ub([de("livelike-livechat-message-virtual-list")],gg);const hb=I`<style>.livechat-load-prev-msg-container{width:100%;display:flex;justify-content:center;padding-bottom:14px}.livechat-load-prev-msg-container button{border-radius:8px;border:1px solid #fff;background:#2b2b2c;color:#fff;padding:8px 16px;cursor:pointer;font-size:10px;font-style:normal;font-weight:700;line-height:normal;letter-spacing:-.3px}</style>`;var Ra=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Uo=class extends it{constructor(){super(...arguments),this.loading=!1,this.hasPrevMessages=!1}createRenderRoot(){return this}connectedCallback(){super.connectedCallback()}render(){const e=this.owner.localize("livechat.loadPreviousMessage.loadingButton.label"),t=this.owner.localize("livechat.loadPreviousMessage.loadButton.label"),n=this.loading?e:t;return I`${hb}<div class="livechat-load-prev-msg-container"><button @click="${this.onClick}" .disabled="${this.loading}">${n}</button></div>`}};Ra([C({type:Boolean})],Uo.prototype,"loading",void 0),Ra([C({type:Boolean})],Uo.prototype,"hasPrevMessages",void 0),Ra([C({type:Function})],Uo.prototype,"onClick",void 0),Uo=Ra([de("load-previous-message")],Uo);const pb=["#FE0002","#1D90FF","#007E00","#B12023","#D17474","#9ACD34","#FF4300","#2D8A55","#EDBC3D","#F89A43","#5F9EA3","#1D90FD"];var Ni=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Xn=class extends Se{constructor(){super(...arguments),this.messageSelected=null,this.showMessageItemMenu=!1,this.showChatUserSetting=!1,this.sendChatIcon=Qp,this.chatSettingIcon=Kp,this.usernameColorList=pb,this.messageItemQuerySelector="livelike-livechat-message-item",this.setMessageSelected=()=>{this.messageSelected=kr.getMessageSelected()},this.showMessageItemMenuCb=e=>{this.showMessageItemMenu=e},this.getRandomUsernameColor=e=>{const t=this.usernameColorList;return t[e.length%t.length]},this.removeMessageSelectedClass=()=>{const e=this.querySelector(".livechat-message-item-container.active");e&&e.classList.remove("active")},this.removeMessageSelected=()=>{this.removeMessageSelectedClass(),kr.setMessageSelected(null)},this.connectLiveChat=()=>{const e=()=>{this.setInitialUsernameColor()};ee.ready&&ae?.id?e():po(Ln.INITIALISED,e),this.connectChat()},this.updateDeletedMessage=e=>{const t=this.messageList.find((n=>n.id===e.message.id));t&&(t.message=this.localize("chat.messageDeleted"),t.isDeleted=!0)},this.appendElements=e=>{this.updateComplete.then((()=>{const t=this.shadowRoot.querySelector("slot[name=message-list]");!(t&&t.assignedNodes({flatten:!0}).filter((n=>n.nodeType===1)).length>0)&&this.insertAdjacentHTML("afterbegin",`${this.renderMessageList()}`),this.insertAdjacentHTML("beforeend",'<livelike-livechat-scroll-down slot="snap-to-live"></livelike-livechat-scroll-down>'),e?.()}))},this.onDeleteMessage=e=>{const t=()=>rc({messageId:e.id,roomId:this.roomid}).then((()=>{this.messageDeleted({message:e})}));this.confirmActions.includes(Zt.DELETE_MESSAGE)?this.confirmation={type:Zt.DELETE_MESSAGE,message:e,onAccept:()=>t().then((()=>{this.hideConfirmation()})),onReject:()=>{this.hideConfirmation()}}:t()},this.displayModal=(e,t)=>{const n=this.createLivelikeModal();n.type=e,n.data=t;const r=this.messageListQuerySelector;this.querySelector(r).append(n),setTimeout((()=>n.remove()),4e3)},this.defaultMessageMenuFunc=e=>{const t=e.sender_id===ae.id;return[this.messagequotes&&{label:this.localize("chat.messageMenu.quote"),key:"quote-message",type:"single",icon:Dy,onClick:()=>this.onQuoteAction(e)},!t&&{label:this.localize("chat.messageMenu.reportMessage"),key:"report-message",type:"single",icon:Ny,onClick:()=>{this.reportUser(e)}},t&&this.deletemessages&&{label:this.localize("chat.messageMenu.deleteMessage"),key:"delete-message",type:"single",icon:Uy,onClick:()=>this.onDeleteMessage(e)},!t&&{label:this.localize("chat.messageMenu.blockUser"),key:"block-user",type:"single",icon:jy,onClick:()=>{this.blockUser(e)}}].filter(Boolean)}}get messageListQuerySelector(){return this.virtualList?"livelike-livechat-message-virtual-list":"livelike-livechat-message-list"}connectedCallback(){this.loadPrevMessageRenderer||(this.loadPrevMessageRenderer=this.loadPrevMessageButton),super.connectedCallback(),this.setup(),Ne.on(It.SHOW_MESSAGE_ITEM_MENU,this.showMessageItemMenuCb)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.unsubscribeLiveChatStore)===null||e===void 0||e.call(this),Ne.off(It.SHOW_MESSAGE_ITEM_MENU,this.showMessageItemMenuCb)}setup(){At.setUsernameColorList(this.usernameColorList),this.setMessageSelected(),this.unsubscribeLiveChatStore=kr.subscribe(this.setMessageSelected)}setInitialUsernameColor(){var e;const t=JSON.parse((e=ae.custom_data)!==null&&e!==void 0?e:"{}").selectedUsernameColor,n=t??At.getRandomUsernameColor(ae.nickname);At.setUsernameColor(n)}updated(e){e.forEach(((t,n)=>{if(n==="hidecomposer"){const r=this.querySelector("livelike-livechat-chat-composer"),o=this.shadowRoot.querySelector("slot[name=composer]"),c=o&&o.assignedNodes().length>0;if(this.hidecomposer)r&&r.remove();else if(!c){this.insertAdjacentHTML("beforeend",`${this.renderComposer()}`);const l=this.querySelector("livelike-livechat-chat-composer");l.chatSettingIcon=this.chatSettingIcon,l.sendChatIcon=this.sendChatIcon,l.showChatUserSetting=()=>this.showChatUserSetting=!0,l.removeMessageSelected=this.removeMessageSelected}}if(n==="roomid"&&this.roomid&&(t!=null&&(Ns({roomId:t},this.demultiplex),this.removeReactionSpaceListener(this.reactionSpaceId),Ie(this,"roomexited",{roomId:this.roomid})),this.connectLiveChat()),this.updateChangedProps(n),n==="showMessageItemMenu")if(this.showMessageItemMenu){this.insertAdjacentHTML("beforeend",`${this.renderMessageItemMenu()}`);const r=this.querySelector("livelike-livechat-message-item-menu");r.messageSelected=this.messageSelected,r.messageMenuFunc=this.messageMenuFunc,r.removeMessageSelected=this.removeMessageSelected,this.removeMessageSelectedTimeoutId&&clearTimeout(this.removeMessageSelectedTimeoutId),this.removeMessageSelectedTimeoutId=setTimeout((()=>{this.removeMessageSelectedClass()}),200)}else{const r=this.querySelector("livelike-livechat-message-item-menu");r&&r.remove()}if(n==="showChatUserSetting")if(this.showChatUserSetting)this.insertAdjacentHTML("beforeend",`${this.renderChatUserSetting()}`),this.querySelector("livelike-chat-user-setting").hideChatUserSetting=()=>this.showChatUserSetting=!1;else{const r=this.querySelector("livelike-chat-user-setting");r&&r.remove()}}))}renderComposer(){return'<livelike-livechat-chat-composer slot="composer"></livelike-livechat-chat-composer>'}renderMessageList(){return this.virtualList?'<livelike-livechat-message-virtual-list slot="message-list"></livelike-livechat-message-virtual-list>':'<livelike-livechat-message-list slot="message-list"></livelike-livechat-message-list>'}createLivelikeModal(){return document.createElement("livelike-livechat-modal")}renderConfirmation(){var e;return this.confirmation&&this.confirmation.type===Zt.DELETE_MESSAGE?((e=this.confirmationRenderer)===null||e===void 0?void 0:e.call(this,this.confirmation))||I`<livelike-livechat-confirmation confirmationtitle="${this.localize("chat.confirmation.deleteMessage.title")}" description="${this.localize("chat.confirmation.deleteMessage.description")}" actionpendinglabel="${this.localize("chat.confirmation.deleteMessage.loadinglabel")}" acceptlabel="${this.localize("chat.confirmation.deleteMessage.accept")}" rejectlabel="${this.localize("chat.confirmation.deleteMessage.reject")}" @onaccept="${this.confirmation.onAccept}" @onreject="${this.confirmation.onReject}"></livelike-livechat-confirmation>`:null}renderMessageItemMenu(){return this.showMessageItemMenu?`
|
|
400
|
+
<livelike-livechat-message-item-menu
|
|
401
|
+
slot="message-item-menu-slot"
|
|
402
|
+
>
|
|
403
|
+
</livelike-livechat-message-item-menu>
|
|
404
|
+
`:null}renderChatUserSetting(){return this.showChatUserSetting?`
|
|
405
|
+
<livelike-chat-user-setting
|
|
406
|
+
slot="chat-user-setting-slot"
|
|
407
|
+
>
|
|
408
|
+
</livelike-chat-user-setting>
|
|
409
|
+
`:null}loadPrevMessageButton({loading:e,onClick:t,hasPrevMessages:n}){return n?I`<load-previous-message .loading="${e}" .hasPrevMessages="${n}" .onClick="${t}"></load-previous-message>`:null}render(){return I`<style>:host{display:flex;flex-direction:column;height:100%;background:#252525}</style>${this.loaded&&ae?.id&&this.dataId&&this.roomid?I`${this.renderConfirmation()} ${this.renderEmptyListMessage()}<slot name="message-list">${this.renderMessageListLoading()}</slot><slot name="composer"></slot><slot name="snap-to-live"></slot><slot name="message-item-menu-slot"></slot><slot name="chat-user-setting-slot"></slot>`:I`<slot name="chat-element-loading"></slot>`}`}};Ni([C({type:Object})],Xn.prototype,"messageSelected",void 0),Ni([C({type:Boolean})],Xn.prototype,"showMessageItemMenu",void 0),Ni([C({type:Boolean})],Xn.prototype,"showChatUserSetting",void 0),Ni([C({type:String})],Xn.prototype,"sendChatIcon",void 0),Ni([C({type:String})],Xn.prototype,"chatSettingIcon",void 0),Ni([C({type:Array})],Xn.prototype,"usernameColorList",void 0),Xn=Ni([de("livelike-live-chat")],Xn);const _n=I`<livelike-widget-header slot="header"><livelike-title slot="title"></livelike-title><livelike-dismiss-button slot="dismiss"></livelike-dismiss-button><livelike-timer></livelike-timer></livelike-widget-header>`,mb=e=>`
|
|
410
|
+
.widget-captioned-media {
|
|
411
|
+
align-items: center;
|
|
412
|
+
display: flex;
|
|
413
|
+
margin: 0;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.widget-caption-container {
|
|
417
|
+
padding: 1rem;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.widget-caption {
|
|
421
|
+
word-break: break-word;
|
|
422
|
+
word-wrap: break-word;
|
|
423
|
+
padding: 0;
|
|
424
|
+
width: 100%;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.widget-caption.media-caption {
|
|
428
|
+
padding: 1rem;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.widget-media {
|
|
432
|
+
font-size: 0;
|
|
433
|
+
text-align: center;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.widget-media img {
|
|
437
|
+
max-height: 90px;
|
|
438
|
+
max-width: 100%;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.widget-captioned-media .widget-caption {
|
|
442
|
+
order: 1;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.widget-caption ~ .widget-media {
|
|
446
|
+
order: 2;
|
|
447
|
+
max-height: 90px;
|
|
448
|
+
max-width: 35%;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.widget-link {
|
|
452
|
+
word-wrap: break-word;
|
|
453
|
+
background-color: #444;
|
|
454
|
+
display: block;
|
|
455
|
+
font-weight: bolder;
|
|
456
|
+
padding: 0.5rem 1rem;
|
|
457
|
+
position: relative;
|
|
458
|
+
text-decoration: none;
|
|
459
|
+
border-radius: 0 0 6px 6px;
|
|
460
|
+
}
|
|
461
|
+
.widget-link:after {
|
|
462
|
+
content: '';
|
|
463
|
+
background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2280px%22%20height%3D%22100px%22%20viewBox%3D%220%200%2080%20100%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%0A%20%20%20%20%3C!--%20Generator%3A%20Sketch%2050%20(54983)%20-%20http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%20--%3E%0A%20%20%20%20%3Ctitle%3Esort-down%3C%2Ftitle%3E%0A%20%20%20%20%3Cdesc%3ECreated%20with%20Sketch.%3C%2Fdesc%3E%0A%20%20%20%20%3Cdefs%3E%3C%2Fdefs%3E%0A%20%20%20%20%3Cg%20id%3D%22Page-1%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%20%20%20%20%3Cg%20id%3D%22sort-down%22%20transform%3D%22translate(40.000000%2C%2050.000000)%20rotate(-90.000000)%20translate(-40.000000%2C%20-50.000000)%20translate(-10.000000%2C%2010.000000)%22%20fill%3D%22%23FFFFFF%22%20fill-rule%3D%22nonzero%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M98.1437396%2C2.63850125%20C96.9076009%2C0.879013967%2095.4422941%2C0%2093.7491877%2C0%20L6.25047031%2C0%20C4.55667973%2C0%203.09239915%2C0.879013967%201.85523426%2C2.63850125%20C0.61806938%2C4.39993433%200%2C6.48242398%200%2C8.88986179%20C0%2C11.2968131%200.61806938%2C13.3793028%201.85523426%2C15.1392765%20L45.604764%2C77.359553%20C46.843297%2C79.1190402%2048.3075776%2C80%2050%2C80%20C51.6924224%2C80%2053.1580712%2C79.1190402%2054.3942099%2C77.359553%20L98.1437396%2C15.1387901%20C99.3795363%2C13.3793028%20100%2C11.2968131%20100%2C8.88937534%20C100%2C6.48242398%2099.3795363%2C4.39993433%2098.1437396%2C2.63850125%20Z%22%20id%3D%22Shape%22%3E%3C%2Fpath%3E%0A%20%20%20%20%20%20%20%20%3C%2Fg%3E%0A%20%20%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E');
|
|
464
|
+
background-position: center right 0.5rem;
|
|
465
|
+
background-size: 0.5rem;
|
|
466
|
+
background-repeat: no-repeat;
|
|
467
|
+
position: absolute;
|
|
468
|
+
width: calc(100% - 2rem);
|
|
469
|
+
height: calc(100% - 1rem);
|
|
470
|
+
left: 0;
|
|
471
|
+
top: 0;
|
|
472
|
+
z-index: 0;
|
|
473
|
+
padding: 0.5rem 1rem;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
*[dir="rtl"] .widget-link {
|
|
477
|
+
background-position: center left 0.5rem;
|
|
478
|
+
}
|
|
479
|
+
*[dir="rtl"] .widget-link:after {
|
|
480
|
+
transform: scaleX(-1);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
`;var Er=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Zn=class extends Nt{constructor(){super(...arguments),this.kind=se.ALERT,this.owner=this,this.defaultStyles=mb,this.trackLinkOpened=()=>{this.interactionEvent();let e={"Alert Id":this.widgetPayload&&this.widgetPayload.id,"Program ID":this.widgetPayload&&this.widgetPayload.program_id,"Widget Type":Dn(this.widgetPayload.kind),"Link URL":this.link_url};Ct("Alert Link Opened",e,this.programid)}}firstUpdated(){this.isInteractable=this.link_url&&this.link_url.length,super.firstUpdated()}render(){const e=!!this.text&&!!this.image_url,t=!this.text&&!!this.image_url,n=!!this.text&&!this.image_url;return I`<template><livelike-widget-root>${_n}<livelike-widget-body>${e?I`<figure class="widget-captioned-media">${this.text&&I`<figcaption class="widget-caption media-caption">${this.text}</figcaption>`} ${this.image_url&&I`<img class="widget-media" src="${this.image_url}" alt="${this.text}">`}</figure>`:t?I`<div class="widget-media"><img src="${this.image_url}"></div>`:n?I`<div class="widget-caption-container"><span class="widget-caption">${this.text}</span></div>`:null} ${this.link_url&&I`<livelike-footer><a class="widget-link" href="${this.link_url}" target="_blank" @click="${this.trackLinkOpened}">${this.link_label}</a></livelike-footer>`} ${this.owner.renderWidgetFooter()}</livelike-widget-body></livelike-widget-root></template>`}};Er([C({type:String})],Zn.prototype,"title",void 0),Er([C({type:String})],Zn.prototype,"text",void 0),Er([C({type:String})],Zn.prototype,"image_url",void 0),Er([C({type:String})],Zn.prototype,"link_url",void 0),Er([C({type:String})],Zn.prototype,"link_label",void 0),Zn=Er([de("livelike-alert")],Zn);const gb=e=>`
|
|
484
|
+
@keyframes image0 {
|
|
485
|
+
0% { transform: scale(1); }
|
|
486
|
+
50% { transform: scale(1.2); }
|
|
487
|
+
100% { transform: scale(1); }
|
|
488
|
+
}
|
|
489
|
+
@keyframes image1 {
|
|
490
|
+
0% { transform: scale(1.2); }
|
|
491
|
+
50% { transform: scale(1); }
|
|
492
|
+
100% { transform: scale(1.2); }
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.cheer-image-body {
|
|
496
|
+
position: relative;
|
|
497
|
+
display: flex;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
.cheer-image-body livelike-vote-count {
|
|
501
|
+
position: absolute;
|
|
502
|
+
top: 50%;
|
|
503
|
+
left: 50%;
|
|
504
|
+
transform: translate(-50%, -50%);
|
|
505
|
+
font-size: 2rem;
|
|
506
|
+
z-index: 100;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.cheer-item-container {
|
|
510
|
+
display: flex;
|
|
511
|
+
flex-direction: column;
|
|
512
|
+
width: 50%;
|
|
513
|
+
position: relative;
|
|
514
|
+
overflow: hidden;
|
|
515
|
+
padding: 0 1.5rem;
|
|
516
|
+
margin: auto;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.cheer-image-wrap {
|
|
520
|
+
text-align: center;
|
|
521
|
+
padding: 20px 0;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
.cheer-image {
|
|
525
|
+
position: relative;
|
|
526
|
+
max-height: 80px;
|
|
527
|
+
max-width: 85%;
|
|
528
|
+
z-index: 5;
|
|
529
|
+
top: 0;
|
|
530
|
+
transition: all 0.2s;
|
|
531
|
+
vertical-align: middle;
|
|
532
|
+
}
|
|
533
|
+
.cheer-image:hover {
|
|
534
|
+
cursor: pointer;
|
|
535
|
+
}
|
|
536
|
+
.cheer-image.disabled:hover {
|
|
537
|
+
cursor: default;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.button0.initial.enabled {
|
|
541
|
+
animation: image0 2s linear 0s infinite normal;
|
|
542
|
+
}
|
|
543
|
+
.button1.initial.enabled {
|
|
544
|
+
animation: image1 2s linear 0s infinite normal;
|
|
545
|
+
}
|
|
546
|
+
.cheer-image-wrap.enabled:after {
|
|
547
|
+
content: '';
|
|
548
|
+
position: absolute;
|
|
549
|
+
display: block;
|
|
550
|
+
z-index: 1;
|
|
551
|
+
width: 100px;
|
|
552
|
+
height: 100px;
|
|
553
|
+
border-radius: 100%;
|
|
554
|
+
top: 10px;
|
|
555
|
+
left: 50%;
|
|
556
|
+
margin-left: -50px;
|
|
557
|
+
opacity: 0;
|
|
558
|
+
transition: all 0.2s;
|
|
559
|
+
}
|
|
560
|
+
.cheer-image-wrap.enabled:active:after {
|
|
561
|
+
opacity: 1;
|
|
562
|
+
width: 200px;
|
|
563
|
+
height: 200px;
|
|
564
|
+
top: -40px;
|
|
565
|
+
margin-left: -100px;
|
|
566
|
+
}
|
|
567
|
+
.button0{
|
|
568
|
+
${_e(e.sideAButton)}
|
|
569
|
+
}
|
|
570
|
+
.button1{
|
|
571
|
+
${_e(e.sideBButton)}
|
|
572
|
+
}
|
|
573
|
+
.cheer-image.enabled:active {
|
|
574
|
+
-webkit-transform: scale(0.9);
|
|
575
|
+
-webkit-transform: rotate(10deg);
|
|
576
|
+
}
|
|
577
|
+
.button0.enabled:after {
|
|
578
|
+
border: 2px solid rgba(80, 160, 250, 0.6);
|
|
579
|
+
background: rgba(80, 160, 250, 0.4);
|
|
580
|
+
}
|
|
581
|
+
.button1.enabled:after {
|
|
582
|
+
border: 2px solid rgba(250, 80, 100, 0.6);
|
|
583
|
+
background: rgba(250, 80, 100, 0.4);
|
|
584
|
+
}
|
|
585
|
+
`,fb=e=>{let t=`
|
|
586
|
+
:host {
|
|
587
|
+
display: flex;
|
|
588
|
+
position: relative;
|
|
589
|
+
cursor: pointer;
|
|
590
|
+
transition: border ease 0.3s;
|
|
591
|
+
align-items: center;
|
|
592
|
+
border: 2px solid transparent;
|
|
593
|
+
border-radius: 6px;
|
|
594
|
+
padding: 0.5rem;
|
|
595
|
+
${_e(e.unselectedOption)}
|
|
596
|
+
}
|
|
597
|
+
:host([selected]) {
|
|
598
|
+
${_e(e.selectedOption)}
|
|
599
|
+
}
|
|
600
|
+
:host([disabled]) {
|
|
601
|
+
cursor: default;
|
|
602
|
+
}
|
|
603
|
+
`;return e.correctOption&&(t+=`
|
|
604
|
+
:host([correct]) {
|
|
605
|
+
${_e(e.correctOption)}
|
|
606
|
+
}
|
|
607
|
+
:host([incorrect]) {
|
|
608
|
+
${_e(e.incorrectOption)}
|
|
609
|
+
}
|
|
610
|
+
`),t};var en=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Et=class extends Tt{constructor(){super(...arguments),this.defaultStyles=fb,this.image=null,this.selected=null,this.correct=null,this.incorrect=null,this.disabled=null,this.optionSelected=()=>{this.disabled||(this.parentElement.querySelectorAll("livelike-option").forEach((e=>e!==this&&(e.selected=!1))),this.selected=!0,this.owner.submitVote(this.item),Ie(this,"option-clicked",{item:this.item}))},this.handleResults=e=>{this.item.hasOwnProperty("is_correct")&&(!this.owner.hideVoteInResults||this.owner.selectedOption&&this.owner.selectedOption.id)?this.item.is_correct?this.correct=!0:this.selected&&(this.incorrect=!0):this.item.hasOwnProperty("correct_number")&&(this.item.number===this.item.correct_number?this.correct=!0:this.item.number&&(this.incorrect=!0))},this.ownerUpdated=e=>{e.name==="voteDisable"&&this.owner.waitForResponse&&(this.disabled=this.owner.disabled||e.prop)}}updated(e){e.forEach(((t,n)=>{if(this[n]!==void 0&&this[n]!==null&&this.item){const r={name:n,prop:this[n],key:this.item.id,owner:this.owner};if(Ne.emit("option-updated",r),Ie(this,"option-updated",r),n==="options"||n==="choices"||n==="items"){const o=this.items[this.optionIndex].vote_count;o!==this.voteCount&&(this.voteCount=o),Ie(this,"option-vote-updated",this.items[this.optionIndex])}}}))}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.optionSelected);const e=this.parentElement;!this.owner&&(this.owner=e.owner);const t=this.getAttribute("index");this.optionIndex=t,this.removeAttribute("index");const n=this.owner.options||this.owner.choices;this.item=n[t],this.voteCount=n[t].vote_count,this.disabled=this.owner.disabled,this.value=this.item.id,this.image=!!this.item.image_url,this.owner.options&&(this.option=this.owner.options[t]),this.owner.choices&&(this.choice=this.owner.choices[t]),this.owner.selectedOption&&this.owner.selectedOption.id&&this.owner.selectedOption.id===this.value&&(this.selected=!0),(this.owner.phase==="results"||this.owner.phase==="finished")&&this.handleResults(),this.owner.addEventListener("results",this.handleResults),this.addEventListener("option-provider",(r=>{r.detail.provider=this,r.stopPropagation()}))}disconnectedCallback(){this.removeEventListener("click",this.optionSelected),super.disconnectedCallback()}render(){return I`<slot></slot>`}};en([C({reflect:!0,type:Boolean})],Et.prototype,"image",void 0),en([C({reflect:!0,type:Boolean})],Et.prototype,"selected",void 0),en([C({reflect:!0,type:Boolean})],Et.prototype,"correct",void 0),en([C({reflect:!0,type:Boolean})],Et.prototype,"incorrect",void 0),en([C({reflect:!0,type:Boolean})],Et.prototype,"disabled",void 0),en([C({type:Object})],Et.prototype,"option",void 0),en([C({type:Object})],Et.prototype,"choice",void 0),en([C({type:Object})],Et.prototype,"item",void 0),en([C({type:String})],Et.prototype,"value",void 0),Et=en([de("livelike-option")],Et);const yb=e=>{let t=`
|
|
611
|
+
:host {
|
|
612
|
+
display: flex;
|
|
613
|
+
flex-direction: column;
|
|
614
|
+
justify-content: center;
|
|
615
|
+
align-items: center;
|
|
616
|
+
position: relative;
|
|
617
|
+
${_e(e.unselectedOptionImage)}
|
|
618
|
+
}
|
|
619
|
+
::slotted(img) {
|
|
620
|
+
object-fit: contain;
|
|
621
|
+
}
|
|
622
|
+
img {
|
|
623
|
+
max-width: 90px;
|
|
624
|
+
display: block;
|
|
625
|
+
margin: 0 auto;
|
|
626
|
+
}
|
|
627
|
+
:host([selected]) {
|
|
628
|
+
${_e(e.selectedOptionImage)}
|
|
629
|
+
}
|
|
630
|
+
`;return e.correctOption&&(t+=`
|
|
631
|
+
:host([correct]) {
|
|
632
|
+
${_e(e.correctOptionImage)}
|
|
633
|
+
}
|
|
634
|
+
:host([incorrect]) {
|
|
635
|
+
${_e(e.incorrectOptionImage)}
|
|
636
|
+
}
|
|
637
|
+
`),t};var jo=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Ui=class extends dr{constructor(){super(...arguments),this.defaultStyles=yb}connectedCallback(){super.connectedCallback();let e=this.src||this.item&&this.item.image_url||this.owner.image_url;if(e){const t=document.createElement("img");t.setAttribute("height",this.height),t.setAttribute("width",this.width),t.setAttribute("src",e),t.setAttribute("alt",this.alt||this.item&&this.item.description),this.appendChild(t)}}defaultTemplate(){return I`<slot></slot>`}};jo([C({type:String,reflect:!0})],Ui.prototype,"src",void 0),jo([C({type:String,reflect:!0})],Ui.prototype,"alt",void 0),jo([C({type:String,reflect:!0})],Ui.prototype,"height",void 0),jo([C({type:String,reflect:!0})],Ui.prototype,"width",void 0),Ui=jo([de("livelike-image")],Ui);var pd=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Bo=class extends Nt{constructor(){super(...arguments),this.kind=se.CHEER_METER,this.owner=this,this.defaultStyles=gb,this.cheerVote={},this.count=0,this.submitVote=e=>{this.disabled||(this.cheerVote[e.id]?this.cheerVote[e.id].count++:this.cheerVote[e.id]={createUrl:e.vote_url,count:1},this.selectedOption=e,this.interactionTrack(),this.sendVote())},this.sendVote=((e,t)=>{let n,r;return function o(...c){const l=Date.now();r=clearTimeout(r),!n||l-n>=t?(e.apply(null,c),n=l):r=setTimeout(o.bind(null,...c),t-(l-n))}})((()=>{for(const e in this.cheerVote)if(this.cheerVote[e].count){this.interactionEvent(this.cheerVote[e].count);const t={vote_count:this.cheerVote[e].count};this.cheerVote[e].count=0;const n=r=>r.url&&(this.cheerVote[e].updateUrl=r.url);this.cheerVote[e].updateUrl?this.updateVote(this.cheerVote[e].updateUrl,t).then(n):this.createVote(this.cheerVote[e].createUrl,t).then(n)}}),3e3),this.updateTotalVoteCount=()=>{this.count=this.options.reduce(((e,t)=>e+t.vote_count),0)}}voteCountChanged(e){this.updateTotalVoteCount()}firstUpdated(){super.firstUpdated(),this.updateTotalVoteCount()}render(){return I`<template><livelike-widget-root>${_n}<livelike-widget-body><livelike-dueling-progress></livelike-dueling-progress><div class="cheer-image-body"><livelike-vote-count></livelike-vote-count>${this.options.map(((e,t)=>{const n=this.disabled?"disabled":"enabled";return I`<div class="cheer-item-container"><livelike-option index="${t}" style="display:contents"><div class="cheer-image-wrap button${t} ${this.interacted?"":"initial"} ${n}"><img class="cheer-image ${n}" src="${e.image_url}"></div></livelike-option></div>`}))}</div>${this.owner.renderWidgetFooter()}</livelike-widget-body></livelike-widget-root></template>`}};pd([C({type:Object})],Bo.prototype,"cheerVote",void 0),pd([C({type:Number})],Bo.prototype,"count",void 0),Bo=pd([de("livelike-cheer-meter")],Bo);const vb=e=>`
|
|
638
|
+
.text-ask-prompt-container {
|
|
639
|
+
padding: 1rem;
|
|
640
|
+
${_e(e.prompt)}
|
|
641
|
+
}
|
|
642
|
+
.text-ask-prompt {
|
|
643
|
+
word-break: break-word;
|
|
644
|
+
word-wrap: break-word;
|
|
645
|
+
padding: 0;
|
|
646
|
+
width: 100%;
|
|
647
|
+
}
|
|
648
|
+
.text-ask-form {
|
|
649
|
+
padding: 0 16px 16px 16px;
|
|
650
|
+
}
|
|
651
|
+
.text-ask-input-container {
|
|
652
|
+
padding: 15px 3px 17px 15px;
|
|
653
|
+
border-radius: 4px;
|
|
654
|
+
background-color: rgb(40,40,40);
|
|
655
|
+
border-color: rgb(63,63,63);
|
|
656
|
+
position: relative;
|
|
657
|
+
}
|
|
658
|
+
.text-ask-input {
|
|
659
|
+
border: none;
|
|
660
|
+
background-color: rgb(40,40,40);
|
|
661
|
+
color: rgb(255,255,255);
|
|
662
|
+
font-size: 12px;
|
|
663
|
+
line-height: 20px;
|
|
664
|
+
resize: none;
|
|
665
|
+
width: 100%;
|
|
666
|
+
box-sizing: border-box;
|
|
667
|
+
padding: 0;
|
|
668
|
+
padding-right: 8px;
|
|
669
|
+
font-family: "HelveticaNeue-Regular";
|
|
670
|
+
${_e(e.replyEnabled)}
|
|
671
|
+
}
|
|
672
|
+
.text-ask-input::placeholder {
|
|
673
|
+
color: rgb(171,171,171);
|
|
674
|
+
${_e(e.replyPlaceholder)}
|
|
675
|
+
}
|
|
676
|
+
.text-ask-input:focus {
|
|
677
|
+
outline: none;
|
|
678
|
+
}
|
|
679
|
+
.text-ask-input[disabled] {
|
|
680
|
+
color: rgb(171,171,171);
|
|
681
|
+
${_e(e.replyDisabled)}
|
|
682
|
+
}
|
|
683
|
+
.text-ask-input::-webkit-scrollbar {
|
|
684
|
+
width: 4px;
|
|
685
|
+
}
|
|
686
|
+
.text-ask-input::-webkit-scrollbar-track {
|
|
687
|
+
margin-right: 3px;
|
|
688
|
+
}
|
|
689
|
+
.text-ask-input::-webkit-scrollbar-thumb {
|
|
690
|
+
-webkit-border-radius: 100px;
|
|
691
|
+
border-radius: 100px;
|
|
692
|
+
background: rgb(84,84,84);
|
|
693
|
+
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
|
|
694
|
+
}
|
|
695
|
+
.text-ask-input-counter {
|
|
696
|
+
font-size: 10px;
|
|
697
|
+
color: rgb(171,171,171);
|
|
698
|
+
position: absolute;
|
|
699
|
+
right: 5px;
|
|
700
|
+
bottom: 2px;
|
|
701
|
+
}
|
|
702
|
+
.text-ask-button {
|
|
703
|
+
width: fit-content;
|
|
704
|
+
padding: 12px 16px;
|
|
705
|
+
border: none;
|
|
706
|
+
border-radius: 4px;
|
|
707
|
+
font-size: 10px;
|
|
708
|
+
font-family: "HelveticaNeue-Bold";
|
|
709
|
+
cursor: pointer;
|
|
710
|
+
${_e(e.submitButtonEnabled)}
|
|
711
|
+
}
|
|
712
|
+
.text-ask-button[disabled] {
|
|
713
|
+
background-color: rgb(84,84,84);
|
|
714
|
+
color: rgb(171,171,171);
|
|
715
|
+
cursor: default;
|
|
716
|
+
${_e(e.submitButtonDisabled)}
|
|
717
|
+
}
|
|
718
|
+
.confirmation-message-container {
|
|
719
|
+
padding: 0;
|
|
720
|
+
padding-left: 11px;
|
|
721
|
+
}
|
|
722
|
+
.text-ask-footer .confirmation-message-container.hidden {
|
|
723
|
+
opacity: 0;
|
|
724
|
+
}
|
|
725
|
+
.confirmation-message {
|
|
726
|
+
color: rgb(0,240,120);
|
|
727
|
+
font-size: 12px;
|
|
728
|
+
text-align: left;
|
|
729
|
+
word-break: break-word;
|
|
730
|
+
word-wrap: break-word;
|
|
731
|
+
padding: 0;
|
|
732
|
+
${_e(e.confirmation)}
|
|
733
|
+
}
|
|
734
|
+
.text-ask-footer {
|
|
735
|
+
padding: 0 16px 16px 16px;
|
|
736
|
+
display: flex;
|
|
737
|
+
align-items: center;
|
|
738
|
+
}
|
|
739
|
+
`;var Sr=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Jn=class extends Nt{constructor(){super(...arguments),this.kind=se.TEXT_ASK,this.owner=this,this.defaultStyles=vb,this.text="",this.maxlength=240,this.replyDisable=!0,this.firstUpdated=()=>{super.firstUpdated(),this.interaction&&(this.text=this.interaction.text,this.disabled=!0,this.showConfirmation=!0)},this.submitReply=()=>{this.replyDisable=!0,this.interactionEvent(),K.post({url:this.widgetPayload.reply_url,data:{text:this.text}}).then((e=>{this.disabled=!0,this.replyDisable=!1,this.reply=this.text,this.showConfirmation=!0})).catch((e=>{this.replyDisable=!1}))},this.inputHandler=e=>{this.text=e.target.value.trimLeft(),this.inputEl.value=this.text,this.counter.textContent=this.maxlength-this.text.length,this.replyDisable=!(this.text.length>0)}}get counter(){return this.querySelector(".text-ask-input-counter")}get inputEl(){return this.querySelector(".text-ask-input")}render(){const e=this.disabled?null:I`<span class="text-ask-input-counter">${this.maxlength}</span>`;return I`<template><livelike-widget-root>${_n}<livelike-widget-body><div class="text-ask-prompt-container"><span class="text-ask-prompt">${this.prompt}</span></div><form class="text-ask-form"><div class="text-ask-input-container"><textarea class="text-ask-input" type="text" name="reply" rows="2" .value="${this.text}" maxlength="${this.maxlength}" ?disabled="${this.disabled}" placeholder="${this.owner.localize("widget.textAsk.placeholder")}" @input="${this.inputHandler}"></textarea> ${e}</div></form><div class="text-ask-footer"><button class="text-ask-button" @click="${this.submitReply}" ?disabled="${this.disabled||this.replyDisable}"><span class="text-ask-button-label">${this.owner.localize("widget.textAsk.sendButton.label")}</span></button><div class="confirmation-message-container ${this.showConfirmation?"":"hidden"}"><span class="confirmation-message">${this.confirmation_message}</span></div></div>${this.owner.renderWidgetFooter()}</livelike-widget-body></livelike-widget-root></template>`}};Sr([C({type:String})],Jn.prototype,"title",void 0),Sr([C({type:String})],Jn.prototype,"prompt",void 0),Sr([C({type:String})],Jn.prototype,"confirmation_message",void 0),Sr([C({type:Boolean})],Jn.prototype,"replyDisable",void 0),Sr([C({type:Boolean})],Jn.prototype,"showConfirmation",void 0),Jn=Sr([de("livelike-text-ask")],Jn);const fg=new WeakMap,bb=Wu((e=>t=>{if(!(t instanceof wi))throw new Error("unsafeHTML can only be used in text bindings");const n=fg.get(t);if(n!==void 0&&Es(e)&&e===n.value&&t.value===n.fragment)return;const r=document.createElement("template");r.innerHTML=e;const o=document.importNode(r.content,!0);t.setValue(o),fg.set(t,{value:e,fragment:o})}));var yg=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Ta=class extends Nt{constructor(){super(...arguments),this.owner=this,this.kind=se.RICH_POST,this.isInteractable=!1}render(){return I`<template><livelike-widget-root>${_n}<livelike-widget-body style="display:flex"><section>${bb(this.content)}</section></livelike-widget-body></livelike-widget-root></template>`}};yg([C({type:String})],Ta.prototype,"content",void 0),Ta=yg([de("livelike-rich-post")],Ta);const _b=e=>{const t=`
|
|
740
|
+
border: none;
|
|
741
|
+
width: 100%;
|
|
742
|
+
height: 1.125rem;
|
|
743
|
+
border-radius: 1.5rem;
|
|
744
|
+
background: ${e.interactiveTrackRight.background};
|
|
745
|
+
background-image: linear-gradient(
|
|
746
|
+
90deg,
|
|
747
|
+
${e.interactiveTrackLeft.background},
|
|
748
|
+
${e.interactiveTrackRight.background} var(--x),
|
|
749
|
+
transparent 0
|
|
750
|
+
);
|
|
751
|
+
`,n=`
|
|
752
|
+
border: none;
|
|
753
|
+
width: var(--thumb-width);
|
|
754
|
+
height: 1em;
|
|
755
|
+
border-radius: 50%;
|
|
756
|
+
margin-top: 0;
|
|
757
|
+
`;return`
|
|
758
|
+
.input-form {
|
|
759
|
+
--x: calc(var(--val) / 100 * (100% - var(--thumb-width)));
|
|
760
|
+
position: relative;
|
|
761
|
+
width: 90%;
|
|
762
|
+
margin: 0px auto;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.input-container {
|
|
766
|
+
display: block;
|
|
767
|
+
position: relative;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.slider-input {
|
|
771
|
+
-webkit-appearance: none;
|
|
772
|
+
width: 100%;
|
|
773
|
+
display: block;
|
|
774
|
+
height: 5em;
|
|
775
|
+
background: none;
|
|
776
|
+
cursor: pointer;
|
|
777
|
+
position: relative;
|
|
778
|
+
margin: 0;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
.slider-input:focus {
|
|
782
|
+
outline: none;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.slider-input::-webkit-slider-runnable-track {
|
|
786
|
+
${t}
|
|
787
|
+
}
|
|
788
|
+
.slider-input::-moz-range-track {
|
|
789
|
+
${t}
|
|
790
|
+
}
|
|
791
|
+
.slider-input::-ms-track {
|
|
792
|
+
${t}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
.slider-input::-webkit-slider-thumb {
|
|
796
|
+
${n}
|
|
797
|
+
}
|
|
798
|
+
.slider-input::-moz-range-thumb {
|
|
799
|
+
${n}
|
|
800
|
+
}
|
|
801
|
+
.slider-input::-ms-thumb {
|
|
802
|
+
${n}
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
.slider-input:disabled {
|
|
806
|
+
cursor: default;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
.slider-image {
|
|
810
|
+
height: 50px;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
.slider-thumb {
|
|
814
|
+
position: absolute;
|
|
815
|
+
bottom: 0.1em;
|
|
816
|
+
left: var(--x);
|
|
817
|
+
pointer-events: none;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
.result-mark {
|
|
821
|
+
background: rgb(233, 0, 0);
|
|
822
|
+
width: 1rem;
|
|
823
|
+
height: 1rem;
|
|
824
|
+
bottom: 1.1rem;
|
|
825
|
+
position: absolute;
|
|
826
|
+
background: #d23a3a;
|
|
827
|
+
border: 3px solid white;
|
|
828
|
+
border-radius: 1rem;
|
|
829
|
+
bottom: 1.5rem;
|
|
830
|
+
z-index: 1;
|
|
831
|
+
${_e(e.marker)}
|
|
832
|
+
}
|
|
833
|
+
livelike-emoji-slider livelike-footer{
|
|
834
|
+
background-color: transparent;
|
|
835
|
+
font-weight: normal;
|
|
836
|
+
}
|
|
837
|
+
livelike-emoji-slider .vote-button{
|
|
838
|
+
margin: 0.5rem 0.5rem 0.5rem 1rem;
|
|
839
|
+
padding: 8px 16px;
|
|
840
|
+
border-radius: 5px;
|
|
841
|
+
border: none;
|
|
842
|
+
color: #fff;
|
|
843
|
+
background: rgba(128, 0, 128, 1);
|
|
844
|
+
cursor: pointer;
|
|
845
|
+
${_e(e.submitButtonEnabled)}
|
|
846
|
+
}
|
|
847
|
+
livelike-emoji-slider .vote-button[disabled]{
|
|
848
|
+
background: rgba(128, 0, 128, 0.5);
|
|
849
|
+
color: rgba(255, 255, 255, 0.5);
|
|
850
|
+
cursor: default;
|
|
851
|
+
${_e(e.submitButtonDisabled)}
|
|
852
|
+
}
|
|
853
|
+
livelike-emoji-slider .voted-text{
|
|
854
|
+
font-family: Arial;
|
|
855
|
+
${_e(e.confirmation)}
|
|
856
|
+
}
|
|
857
|
+
`};var xa=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Pr=class extends Nt{constructor(){super(...arguments),this.owner=this,this.kind=se.EMOJI_SLIDER,this.defaultStyles=_b,this.val=null,this.sliderVoteSubmitted=!1,this.setThumbWidth=()=>{this.imageEl&&this.imageEl.offsetWidth>0?this.inputContainer.style.setProperty("--thumb-width",this.imageEl.offsetWidth+"px"):setTimeout(this.setThumbWidth,10)},this.changeVal=()=>{this.interactionEvent(),this.updateVal()},this.updateVal=()=>{if(this.inputEl){let e=+this.inputEl.value;if(this.val!==e){this.inputContainer.style.setProperty("--val",this.val=e);for(let t of this.options)this.val>=t.max&&this.imageEl.src!==t.image_url&&(this.imageEl.src=t.image_url,this.setThumbWidth())}}},this.resultEvent=()=>{super.resultEvent(),this.updateComplete.then((()=>{this.interacted&&!this.sliderVoteSubmitted&&this.lockInVote(this.val/100)}))},this.onResults=e=>{e.message.average_magnitude&&(this.average_magnitude=e.message.average_magnitude,Ie(this,e.event,e.message.average_magnitude))},this.interactive=e=>new Promise((t=>this.updateComplete.then((()=>{this.phase="interactive",this.disabled=!1;const n={"Widget Type":Dn(this.widgetPayload.kind),"Widget ID":this.widgetPayload.id};Ct("Widget Became Interactive",n,this.programid);let r=e&&e.timeout!==void 0?e.timeout:this.widgetPayload.timeout&&Ws(this.widgetPayload.timeout);this.timeout=r,r!==null&&setTimeout((()=>{this.interacted&&!this.sliderVoteSubmitted?this.lockInVote(this.val/100).then((()=>setTimeout(t,2e3))):(this.interacted||this.sliderVoteSubmitted||(this.val=null),setTimeout(t,2e3))}),this.timeout)}))))}get inputContainer(){return this.querySelector(".input-form")}get inputEl(){return this.querySelector(".slider-input")}get imageEl(){return this.querySelector(".slider-image")}connectedCallback(){super.connectedCallback().then((()=>{this.interaction&&this.interaction.magnitude&&(this.sliderVoteSubmitted=!0),this.updateComplete.then((()=>{this.inputEl&&(this.inputEl.addEventListener("change",this.changeVal),this.inputEl.addEventListener("input",this.updateVal)),this.options=this.options.map(((e,t)=>Object.assign(Object.assign({},e),{mag:t===0?0:t/(this.options.length-1)*100,max:t/this.options.length*100}))),this.updateVal()}))}))}updated(e){super.updated(e),e.has("isStockWidget")&&this.showUserVoteInstantly===void 0&&(this.showUserVoteInstantly=this.isStockWidget)}lockInVote(e){return new Promise(((t,n)=>{!this.voteDisable&&e>=0&&e<=1?(this.showUserVoteInstantly&&this.updateAverageMagnitude(e),this.voteDisable=!0,this.createVote(this.widgetPayload.vote_url,{magnitude:e.toString()}).then((()=>{this.sliderVoteSubmitted=!0,this.disabled=!0,t(!0)}))):n(new Error("Magnitude not a number between 0 and 1."))}))}updateAverageMagnitude(e){const t=(this.engagement_count*parseFloat(this.average_magnitude)+e)/(this.engagement_count+1);this.average_magnitude=t}render(){const e=Math.round(100*(this.interaction?this.interaction.magnitude:this.widgetPayload.initial_magnitude)),t=this.phase!=="ready"&&this.phase!=="interactive"&&String(this.val)!=="null"?I`<div class="result-mark" style="left:calc(${Math.round(100*this.average_magnitude)}% - .5rem)"></div>`:null,n=this.sliderVoteSubmitted?I`<span class="voted-text">${this.owner.localize("widget.slider.votedText")}</span>`:null;return I`<template><livelike-widget-root>${_n}<livelike-widget-body><form style="--val:${e}" class="input-form"><div class="input-container"><input type="range" class="slider-input" value="${e}" ?disabled="${this.disabled}"> ${t}</div><output class="slider-thumb"><img class="slider-image"></output></form><livelike-footer><button class="vote-button" @click="${()=>this.lockInVote(this.val/100)}" ?disabled="${this.sliderVoteSubmitted||this.voteDisable||this.disabled}">${this.owner.localize("widget.slider.voteButton.label")}</button> ${n} ${this.owner.renderWidgetFooter()}</livelike-footer></livelike-widget-body></livelike-widget-root></template>`}};xa([C({type:Number})],Pr.prototype,"val",void 0),xa([C({type:String})],Pr.prototype,"average_magnitude",void 0),xa([C({type:Boolean})],Pr.prototype,"sliderVoteSubmitted",void 0),Pr=xa([de("livelike-emoji-slider")],Pr);var Yn=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let vg=[];class wn extends Nt{constructor(){super(),this.owner=this,this.moving=!1,this.slide=0,this.slides=null,this.totalSlides=0,this.scriptsLoaded=!1,this.finalLoad=!1,this.forceScriptLoad=()=>{window.instgrm&&window.instgrm.Embeds.process(),window.FB&&window.FB.XFBML.parse(),window.twttr&&window.twttr.widgets.load()},this.initSlider=()=>new Promise((t=>{const n=this.querySelector("#dot0");n&&(n.checked=!0),this.slides=this.querySelectorAll(".slide");const r=this.slides.length;this.totalSlides=r,this.slide=0,this.slides&&this.slides[0]&&(this.slides[0].className+=" active"),r>1&&(this.slides[1].className+=" next"),r>2&&(this.slides[r-1].className+=" prev"),t(void 0)})),this.insertHTML=()=>new Promise((t=>{this.items.forEach(((n,r)=>{const o=this.querySelector(`#embed${r}`),c=document.createElement("div");c.innerHTML=n.oembed&&n.oembed.html;const l=m=>{if(m.nodeName==="SCRIPT"){const v=m.src.replace("file://","https://");if(!vg.includes(v)){vg.push(v);const R=document.createElement("script");R.src=v,document.body.insertAdjacentElement("beforeend",R)}}},u=m=>{for(let v=0;v<m.childNodes.length;v++){const R=m.childNodes[v];l(R),m.hasChildNodes()&&u(R)}};u(c),o&&(o.innerHTML=n.oembed&&n.oembed.html),setTimeout((()=>{if(this.forceScriptLoad(),n.oembed&&n.oembed.provider_name==="Twitter"){let m=function(v){const R=v.querySelector("twitter-widget");R&&R.shadowRoot&&R.shadowRoot.querySelector(".TweetInfo")?(R.shadowRoot.querySelector(".TweetInfo").style.display="none",R.shadowRoot.querySelector(".CallToAction").style.display="none"):setTimeout((()=>m(v)),100)};m(this)}setTimeout((()=>{this.scriptsLoaded=!0}),1500)}),500)})),t(void 0)})),this.moveCarouselTo=(t,n)=>{this.checkDot();const r="slide";let o=t-1,c=t+1;t===0?o=n-1:t===n-1&&(o=t-1,c=0),this.items.forEach(((l,u)=>{this.slides[u].className=r})),this.slides[o].className=r+" prev",this.slides[t].className=r+" active",this.slides[c].className=r+" next"},this.moveNext=()=>{this.slide===this.totalSlides-1?this.slide=0:this.slide++,this.moveCarouselTo(this.slide,this.totalSlides)},this.movePrev=()=>{this.slide===0?this.slide=this.totalSlides-1:this.slide--,this.moveCarouselTo(this.slide,this.totalSlides)},this.moveToSlide=t=>{this.slide=t,this.moveCarouselTo(this.slide,this.totalSlides)},this.checkDot=()=>{this.items.forEach(((t,n)=>{this.querySelector(`#dot${n}`).checked=this.slide===n}))},this.disableInteraction=()=>{this.moving=!0,setTimeout((()=>{this.moving=!1}),500)},this.moving=!1,this.slide=0,this.slides=null,this.totalSlides=0,this.scriptsLoaded=!1,this.finalLoad=!1}updated(t){t.forEach(((n,r)=>{r==="scriptsLoaded"&&this.scriptsLoaded===!0&&this.forceScriptLoad(),r==="finalLoad"&&this.finalLoad===!0&&this.forceScriptLoad()}))}connectedCallback(){super.connectedCallback().then((()=>{this.updateComplete.then((()=>{this.insertHTML().then((()=>this.initSlider())).then((()=>setTimeout((()=>{this.finalLoad=!0}),3e3)))}))}))}}Yn([C({type:Array})],wn.prototype,"items",void 0),Yn([C({type:String})],wn.prototype,"comment",void 0),Yn([C({type:Boolean})],wn.prototype,"moving",void 0),Yn([C({type:Number})],wn.prototype,"slide",void 0),Yn([C({type:Array})],wn.prototype,"slides",void 0),Yn([C({type:Number})],wn.prototype,"totalSlides",void 0),Yn([C({type:Boolean})],wn.prototype,"scriptsLoaded",void 0),Yn([C({type:Boolean})],wn.prototype,"finalLoad",void 0);const wb=I`<style>.slider-wrapper{overflow:hidden;margin:auto}.slider-wrapper *{box-sizing:border-box;display:flex;justify-content:center}.slider{-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;transform-style:preserve-3d}.slide{opacity:0;position:absolute;top:0;width:100%;display:none;margin:auto;z-index:100;transition:transform .5s,opacity .5s,z-index .5s}.slide.active,.slide.initial{opacity:1;position:relative;z-index:900;display:flex}.slide.next,.slide.prev{z-index:800;display:flex}.slide.prev{transform:translateX(-100%)}.slide.next{transform:translateX(100%)}.slide-button{background:0 0;position:absolute;top:50%;width:3rem;height:3rem;transform:translateY(-50%);border-radius:50%;cursor:pointer;z-index:20;border:none}.slide-button>svg{fill:#fff;filter:drop-shadow(3px 3px 2px rgba(20, 20, 20, .7))}.left-button{left:0}.right-button{right:0}.dot-nav-container{z-index:20;margin-top:1rem}.dot-item{border:none;height:15px;width:15px;border-radius:1rem}</style>`;var Cb=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let md=class extends wn{constructor(){super(...arguments),this.kind=se.SOCIAL_EMBED,this.isInteractable=!1}render(){const e=this.items.length>1,t=I`<div class="button-wrapper"><button class="left-button slide-button" @click="${this.movePrev}">${fy}</button> <button class="right-button slide-button" @click="${this.moveNext}">${gy}</button></div>`,n=I`<form class="dot-nav-container">${this.items.map(((r,o)=>I`<input class="dot-input" id="dot${o}" name="dot" type="radio" @click="${()=>this.moveToSlide(o)}">`))}</form>`;return I`<template>${wb}<livelike-widget-root style="opacity:${this.scriptsLoaded&&this.finalLoad?1:0}">${_n}<livelike-widget-body><div class="slider-wrapper">${e?t:null}<div class="slider">${this.items.length>0&&this.items.map(((r,o)=>I`<div id="embed${o}" class="slide ${o===0?"initial":""}"></div>`))}</div>${e?n:null}</div></livelike-widget-body></livelike-widget-root></template>`}};md=Cb([de("livelike-social-embed")],md);const Ib=e=>`
|
|
858
|
+
.only-media{
|
|
859
|
+
border-radius: 6px;
|
|
860
|
+
}
|
|
861
|
+
.no-header{
|
|
862
|
+
border-top-right-radius: 6px;
|
|
863
|
+
border-top-left-radius: 6px;
|
|
864
|
+
}
|
|
865
|
+
.no-footer{
|
|
866
|
+
border-bottom-right-radius: 6px;
|
|
867
|
+
border-bottom-left-radius: 6px;
|
|
868
|
+
}
|
|
869
|
+
.video-alert-caption-container {
|
|
870
|
+
padding: 0.6rem 0.8rem;
|
|
871
|
+
}
|
|
872
|
+
.video-alert-caption {
|
|
873
|
+
word-break: break-word;
|
|
874
|
+
word-wrap: break-word;
|
|
875
|
+
padding: 0;
|
|
876
|
+
width: 100%;
|
|
877
|
+
}
|
|
878
|
+
.video-alert-link {
|
|
879
|
+
word-wrap: break-word;
|
|
880
|
+
background-color: #444;
|
|
881
|
+
display: block;
|
|
882
|
+
font-weight: bolder;
|
|
883
|
+
padding: 0.5rem 1rem;
|
|
884
|
+
position: relative;
|
|
885
|
+
text-decoration: none;
|
|
886
|
+
border-radius: 0 0 6px 6px;
|
|
887
|
+
${_e(e.footer)}
|
|
888
|
+
}
|
|
889
|
+
.video-alert-link:after {
|
|
890
|
+
content: '';
|
|
891
|
+
background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2280px%22%20height%3D%22100px%22%20viewBox%3D%220%200%2080%20100%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%0A%20%20%20%20%3C!--%20Generator%3A%20Sketch%2050%20(54983)%20-%20http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%20--%3E%0A%20%20%20%20%3Ctitle%3Esort-down%3C%2Ftitle%3E%0A%20%20%20%20%3Cdesc%3ECreated%20with%20Sketch.%3C%2Fdesc%3E%0A%20%20%20%20%3Cdefs%3E%3C%2Fdefs%3E%0A%20%20%20%20%3Cg%20id%3D%22Page-1%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%20%20%20%20%3Cg%20id%3D%22sort-down%22%20transform%3D%22translate(40.000000%2C%2050.000000)%20rotate(-90.000000)%20translate(-40.000000%2C%20-50.000000)%20translate(-10.000000%2C%2010.000000)%22%20fill%3D%22%23FFFFFF%22%20fill-rule%3D%22nonzero%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M98.1437396%2C2.63850125%20C96.9076009%2C0.879013967%2095.4422941%2C0%2093.7491877%2C0%20L6.25047031%2C0%20C4.55667973%2C0%203.09239915%2C0.879013967%201.85523426%2C2.63850125%20C0.61806938%2C4.39993433%200%2C6.48242398%200%2C8.88986179%20C0%2C11.2968131%200.61806938%2C13.3793028%201.85523426%2C15.1392765%20L45.604764%2C77.359553%20C46.843297%2C79.1190402%2048.3075776%2C80%2050%2C80%20C51.6924224%2C80%2053.1580712%2C79.1190402%2054.3942099%2C77.359553%20L98.1437396%2C15.1387901%20C99.3795363%2C13.3793028%20100%2C11.2968131%20100%2C8.88937534%20C100%2C6.48242398%2099.3795363%2C4.39993433%2098.1437396%2C2.63850125%20Z%22%20id%3D%22Shape%22%3E%3C%2Fpath%3E%0A%20%20%20%20%20%20%20%20%3C%2Fg%3E%0A%20%20%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E');
|
|
892
|
+
background-position: center right 0.5rem;
|
|
893
|
+
background-size: 0.5rem;
|
|
894
|
+
background-repeat: no-repeat;
|
|
895
|
+
position: absolute;
|
|
896
|
+
width: calc(100% - 2rem);
|
|
897
|
+
height: calc(100% - 1rem);
|
|
898
|
+
left: 0;
|
|
899
|
+
top: 0;
|
|
900
|
+
z-index: 0;
|
|
901
|
+
padding: 0.5rem 1rem;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
*[dir="rtl"] .video-alert-link {
|
|
905
|
+
background-position: center left 0.5rem;
|
|
906
|
+
}
|
|
907
|
+
*[dir="rtl"] .video-alert-link:after {
|
|
908
|
+
transform: scaleX(-1);
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
`,kb=e=>`
|
|
912
|
+
:host {
|
|
913
|
+
display: block;
|
|
914
|
+
}
|
|
915
|
+
livelike-video{
|
|
916
|
+
position: relative;
|
|
917
|
+
}
|
|
918
|
+
livelike-video video {
|
|
919
|
+
width: 100%;
|
|
920
|
+
max-height: 210px;
|
|
921
|
+
border-radius: inherit;
|
|
922
|
+
vertical-align: middle;
|
|
923
|
+
}
|
|
924
|
+
.video-playback-error {
|
|
925
|
+
position: absolute;
|
|
926
|
+
width: 100%;
|
|
927
|
+
text-align: center;
|
|
928
|
+
top: 50%;
|
|
929
|
+
right:50%;
|
|
930
|
+
transform: translate(50%,-50%);
|
|
931
|
+
display: flex;
|
|
932
|
+
align-items: center;
|
|
933
|
+
padding: 0.5rem;
|
|
934
|
+
justify-content: center;
|
|
935
|
+
}
|
|
936
|
+
`;var yt=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let ct=class extends Tt{constructor(){super(...arguments),this.defaultStyles=kb,this.videoAttrs=["autoplay","controls","muted","loop","disablepictureinpicture"],this.preload="metadata",this.controlslist="nodownload",this.controls=!0,this.disablepictureinpicture=!0,this.onVideoPlay=e=>Ie(this,e.type),this.onVideoPlayError=e=>{this.error="Playback Failed"}}createRenderRoot(){return this}disconnectedCallback(){this.scrollObserver.disconnect(),this.videoEl.removeEventListener("play",this.onVideoPlay),super.disconnectedCallback()}firstUpdated(){super.firstUpdated(),this.videoAttrs.forEach((e=>this.videoEl[e]=!!this[e])),window.IntersectionObserver&&(this.scrollObserver=new IntersectionObserver((e=>e.forEach((t=>{t.intersectionRatio==1||this.videoEl.paused||this.videoEl.pause()}))),{threshold:.1}),this.scrollObserver.observe(this.videoEl)),this.videoEl.addEventListener("play",this.onVideoPlay)}updated(e){this.videoEl&&e.forEach(((t,n)=>{this.videoAttrs.some((r=>r===n))&&(this.videoEl[n]=!!this[n])}))}defaultTemplate(){return I`<video id="video" poster="${this.poster?this.poster:""}" preload="${this.preload}" controlslist="${this.controlslist}"><source src="${this.src}" type="video/mp4" @error="${this.onVideoPlayError}">${this.tracksrc?I`<track src="${this.tracksrc}" label="${this.tracklabel}" kind="${this.trackkind}" default>`:null}</video>${this.error?I`<div class="video-playback-error">${Cy} <span class="video-playback-error-text">${this.owner.localize("widget.video.playbackError")}</span></div>`:null}`}};yt([rh("video")],ct.prototype,"videoEl",void 0),yt([C({type:String,reflect:!0})],ct.prototype,"src",void 0),yt([C({type:String})],ct.prototype,"error",void 0),yt([C({type:String})],ct.prototype,"poster",void 0),yt([C({type:String})],ct.prototype,"preload",void 0),yt([C({type:String})],ct.prototype,"controlslist",void 0),yt([C({type:String})],ct.prototype,"tracksrc",void 0),yt([C({type:String})],ct.prototype,"tracklabel",void 0),yt([C({type:String})],ct.prototype,"trackkind",void 0),yt([C({type:Boolean})],ct.prototype,"autoplay",void 0),yt([C({type:Boolean})],ct.prototype,"controls",void 0),yt([C({type:Boolean})],ct.prototype,"muted",void 0),yt([C({type:Boolean})],ct.prototype,"loop",void 0),yt([C({type:Boolean})],ct.prototype,"disablepictureinpicture",void 0),ct=yt([de("livelike-video")],ct);var ji=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Cn=class extends Nt{constructor(){super(...arguments),this.kind=se.VIDEO_ALERT,this.owner=this,this.defaultStyles=Ib,this.trackLinkOpened=()=>{this.interactionEvent();const e={"Alert Id":this.widgetPayload&&this.widgetPayload.id,Nickname:ae&&ae.nickname,"Program ID":this.widgetPayload&&this.widgetPayload.program_id,"Widget Type":Dn(this.widgetPayload.kind),"Link URL":this.link_url};Ct("Alert Link Opened",e,this.programid)},this.onVideoPlayStarted=()=>{this.interactionEvent();const e={"Alert Id":this.widgetPayload&&this.widgetPayload.id,"Program ID":this.widgetPayload&&this.widgetPayload.program_id,"Widget Type":Dn(this.widgetPayload.kind),"Video URL":this.video_url};Ct("Video Alert Play Started",e,this.programid)},this.getBorderClass=()=>{const e=this.title||this.text;return e&&this.link_url?"":this.link_url?"no-header":e?"no-footer":"only-media"}}firstUpdated(){super.firstUpdated(),this.isInteractable=this.video_url&&this.video_url.length||this.link_url&&this.link_url.length}render(){const e=this.getBorderClass(),t=this.text&&I`<div class="video-alert-caption-container"><span class="video-alert-caption">${this.text}</span></div>`,n=this.link_url&&I`<livelike-widget-footer><a class="video-alert-link" href="${this.link_url}" target="_blank" @click="${this.trackLinkOpened}">${this.link_label}</a></livelike-widget-footer>`;return I`<template><livelike-widget-root>${this.title?_n:null}<livelike-widget-body class="${this.title?"":"no-header"}">${t}<livelike-video class="${e}" .src="${this.src||this.video_url}" @play="${this.onVideoPlayStarted}"></livelike-video>${n}</livelike-widget-body></livelike-widget-root></template>`}};ji([C({type:String})],Cn.prototype,"title",void 0),ji([C({type:String})],Cn.prototype,"text",void 0),ji([C({type:String})],Cn.prototype,"video_url",void 0),ji([C({type:String})],Cn.prototype,"link_url",void 0),ji([C({type:String})],Cn.prototype,"link_label",void 0),ji([rh("video")],Cn.prototype,"videoEl",void 0),Cn=ji([de("livelike-video-alert")],Cn);const bg=I`<style>livelike-option::slotted(.container){width:75%;max-width:75%;position:relative}livelike-progress[image]{top:0;height:1.5rem;margin-top:.5rem}.livelike-voting-image-container{width:100%;position:relative}livelike-footer{background-color:#444;display:block;font-weight:bolder;border-radius:0 0 6px 6px}</style>`,Eb=e=>`
|
|
937
|
+
livelike-text-quiz .vote-button,
|
|
938
|
+
livelike-image-quiz .vote-button{
|
|
939
|
+
margin: 0.5rem 0.5rem 0.5rem 1rem;
|
|
940
|
+
padding: 8px 16px;
|
|
941
|
+
border-radius: 5px;
|
|
942
|
+
border: none;
|
|
943
|
+
color: #fff;
|
|
944
|
+
background: rgba(128, 0, 128, 1);
|
|
945
|
+
cursor: pointer;
|
|
946
|
+
${_e(e.submitButtonEnabled)}
|
|
947
|
+
}
|
|
948
|
+
livelike-text-quiz .vote-button[disabled],
|
|
949
|
+
livelike-image-quiz .vote-button[disabled]{
|
|
950
|
+
background: rgba(128, 0, 128, 0.5);
|
|
951
|
+
color: rgba(255, 255, 255, 0.5);
|
|
952
|
+
cursor: default;
|
|
953
|
+
${_e(e.submitButtonDisabled)}
|
|
954
|
+
}
|
|
955
|
+
livelike-text-quiz .voted-text,
|
|
956
|
+
livelike-image-quiz .voted-text{
|
|
957
|
+
font-family: Arial;
|
|
958
|
+
${_e(e.confirmation)}
|
|
959
|
+
}
|
|
960
|
+
`,_g=e=>`
|
|
961
|
+
.livelike-voting-input-container{
|
|
962
|
+
position: relative;
|
|
963
|
+
display: flex;
|
|
964
|
+
justify-content: end;
|
|
965
|
+
width: 100%;
|
|
966
|
+
}
|
|
967
|
+
.livelike-voting-number-input{
|
|
968
|
+
padding: 4px;
|
|
969
|
+
border-radius: 4px;
|
|
970
|
+
font-size: 20px;
|
|
971
|
+
width: 45%;
|
|
972
|
+
text-align: center;
|
|
973
|
+
outline: none;
|
|
974
|
+
max-width: 54px;
|
|
975
|
+
min-width: 22px;
|
|
976
|
+
}
|
|
977
|
+
.user-number-input{
|
|
978
|
+
border: 1px solid rgb(92,92,92);
|
|
979
|
+
color: rgb(27,198,255);
|
|
980
|
+
background: rgb(51,51,51);
|
|
981
|
+
caret-color: white;
|
|
982
|
+
${_e(e.optionInputFieldEnabled)}
|
|
983
|
+
}
|
|
984
|
+
.user-number-input::placeholder{
|
|
985
|
+
color: rgb(95,95,95);
|
|
986
|
+
${_e(e.optionInputFieldPlaceholder)}
|
|
987
|
+
}
|
|
988
|
+
.user-number-input:focus{
|
|
989
|
+
border: 1px solid white;
|
|
990
|
+
}
|
|
991
|
+
.user-number-input:focus::placeholder{
|
|
992
|
+
color: transparent;
|
|
993
|
+
}
|
|
994
|
+
.user-number-input[disabled]{
|
|
995
|
+
color: rgba(27,198,255,0.5);
|
|
996
|
+
${_e(e.optionInputFieldDisabled)}
|
|
997
|
+
}
|
|
998
|
+
.livelike-voting-number-input::-webkit-inner-spin-button,
|
|
999
|
+
.livelike-voting-number-input::-webkit-outer-spin-button {
|
|
1000
|
+
-webkit-appearance: none;
|
|
1001
|
+
-moz-appearance: none;
|
|
1002
|
+
appearance: none;
|
|
1003
|
+
margin: 0;
|
|
1004
|
+
}
|
|
1005
|
+
.incorrect-number-input{
|
|
1006
|
+
border: 1px solid rgb(92,92,92);
|
|
1007
|
+
color: rgb(27,198,255);
|
|
1008
|
+
background: rgb(51,51,51);
|
|
1009
|
+
margin-right: 5px;
|
|
1010
|
+
}
|
|
1011
|
+
.incorrect-number-input::placeholder{
|
|
1012
|
+
color: rgb(95,95,95);
|
|
1013
|
+
}
|
|
1014
|
+
livelike-option[incorrect] .incorrect-number-input{
|
|
1015
|
+
background: rgba(240, 0, 60, 0.2);
|
|
1016
|
+
color: rgb(240, 0, 60);
|
|
1017
|
+
border: none;
|
|
1018
|
+
${_e(e.optionInputFieldIncorrect)}
|
|
1019
|
+
}
|
|
1020
|
+
livelike-option[incorrect] .incorrect-number-input::placeholder{
|
|
1021
|
+
color: rgb(240, 0, 60);
|
|
1022
|
+
}
|
|
1023
|
+
.correct-number-input{
|
|
1024
|
+
background: rgba(0, 240, 120, 0.2);
|
|
1025
|
+
color: rgb(0, 240, 120);
|
|
1026
|
+
border: none;
|
|
1027
|
+
${_e(e.optionInputFieldCorrect)}
|
|
1028
|
+
}
|
|
1029
|
+
.correct-number-input::placeholder{
|
|
1030
|
+
color: rgb(0, 240, 120);
|
|
1031
|
+
}
|
|
1032
|
+
.predict-button{
|
|
1033
|
+
margin: 0.5rem 0.5rem 0.5rem 1rem;
|
|
1034
|
+
padding: 8px 16px;
|
|
1035
|
+
border-radius: 5px;
|
|
1036
|
+
border: none;
|
|
1037
|
+
color: black;
|
|
1038
|
+
background: white;
|
|
1039
|
+
cursor: pointer;
|
|
1040
|
+
${_e(e.submitButtonEnabled)}
|
|
1041
|
+
}
|
|
1042
|
+
.predict-button[disabled]{
|
|
1043
|
+
color: rgb(171,171,171);
|
|
1044
|
+
background: rgb(84,84,84);
|
|
1045
|
+
cursor: pointer;
|
|
1046
|
+
${_e(e.submitButtonDisabled)}
|
|
1047
|
+
}
|
|
1048
|
+
livelike-text-number-prediction .voted-text,
|
|
1049
|
+
livelike-image-number-prediction .voted-text{
|
|
1050
|
+
font-family: Arial;
|
|
1051
|
+
${_e(e.confirmation)}
|
|
1052
|
+
}
|
|
1053
|
+
`,ei=(e,t)=>{Vc(e,class extends t{constructor(){super(...arguments),this.waitForResponse=!0}render(){const n=I`<div style="position:relative;width:100%;display:flex"><livelike-progress></livelike-progress><livelike-description></livelike-description><livelike-percentage></livelike-percentage></div>`,r=I`<div class="livelike-voting-image-container"><div class="image-description-wrapper"><livelike-description></livelike-description><livelike-progress></livelike-progress></div><livelike-percentage></livelike-percentage></div><livelike-image height="80px" width="80px"></livelike-image>`,o=this.quizVoteSubmitted?I`<span class="voted-text">${this.owner.localize("widget.quiz.votedText")}</span>`:null,c=e.indexOf("quiz")!==-1?I`<livelike-footer><button class="vote-button" @click="${this.lockInVote}" ?disabled="${!this.selectedOption||!this.selectedOption.id||this.quizVoteSubmitted||this.voteDisable||this.disabled}">${this.owner.localize("widget.quiz.voteButton.label")}</button> ${o}</livelike-footer>`:null;return I`<template><livelike-widget-root>${bg} ${_n}<livelike-widget-body><livelike-select><template><livelike-option>${e.indexOf("image")!==-1?r:n}</livelike-option></template></livelike-select>${c} ${this.owner.renderWidgetFooter()}</livelike-widget-body></livelike-widget-root></template>`}})},wg=e=>class extends e{constructor(){super(...arguments),this.resultEvent=()=>{super.resultEvent();let t="unattempted";this.selectedOption&&this.selectedOption.id&&this.selectedOption.hasOwnProperty("is_correct")&&(t=this.selectedOption.is_correct?"correct":"incorrect"),Ie(this,"results",{result:t,element:this,widget:this.widgetPayload,selectedOption:this.selectedOption}),this.localName.indexOf("quiz")!==-1&&!this.quizVoteSubmitted&&!this.vote&&this.selectedOption&&this.selectedOption.id&&this.lockInVote(this.selectedOption.answer_url)}}};class Fo extends Nt{constructor(){super(...arguments),this.owner=this,this.hideVoteInResults=!0}firstUpdated(){super.firstUpdated(),this.interaction&&(this.selectedOption=this.options.find((t=>t.id===this.interaction.option_id))),this.interaction&&(this.vote={id:this.interaction.id,url:this.interaction.url,isHistoryInteraction:!0})}updated(t){super.updated(t),t.has("isStockWidget")&&this.showUserVoteInstantly===void 0&&(this.showUserVoteInstantly=this.isStockWidget)}submitVote(t){this.disabled||t.id===this.selectedOption.id||this.voteDisable||(this.showUserVoteInstantly&&this.updateVoteCount(t),this.selectedOption=t,this.interactionEvent(),this.voteDisable=!0,this.vote&&this.vote.id?this.updateVote(this.vote.url,{option_id:t.id}):this.createVote(t.vote_url))}updateVoteCount(t){let n=!0;const r=this.options.map((o=>{const c=o.id===this.selectedOption.id?-1:0,l=o.id===t.id?1:0,u=o.vote_count+l+c;return u<0&&(n=!1),Object.assign(Object.assign({},o),{vote_count:u})}));n&&(this.options=r)}}ei("livelike-text-poll",Fo),ei("livelike-image-poll",Fo);const Or={};class Cg extends Nt{constructor(){super(...arguments),this.claimRewards=(t,n)=>{t.claim_token&&K.post({url:this.widgetPayload.claim_url,data:{claim_token:t.claim_token}}).then((r=>{Or[n]&&(Or[n].claim_token=null),this.rankChanged(this.widgetPayload,r.rewards)})).catch((r=>console.warn(r.message)))},this.interactive=()=>Promise.resolve()}}class gd extends Fo{constructor(){super(...arguments),this.defaultVoteHide=!0,this.hideVoteInResults=!0}firstUpdated(){super.firstUpdated(),this.addEventListener("prediction",(t=>{Or[t.detail.widget.id]={option_id:t.detail.prediction.option_id,claim_token:t.detail.prediction.claim_token}}))}}ei("livelike-text-prediction",gd),ei("livelike-image-prediction",gd);class fd extends wg(Cg){constructor(){super(...arguments),this.owner=this}firstUpdated(){super.firstUpdated(),this.updateComplete.then((()=>this.disabled=!0));const t=this.widgetPayload.text_prediction_id||this.widgetPayload.image_prediction_id,n=this.widgetPayload.text_prediction_id?se.TEXT_PREDICTION:se.IMAGE_PREDICTION,r=Or[t]||this.interaction;r?(this.selectedOption={id:r.option_id},this.claimRewards(r,t)):bo({programId:this.programid,widgets:[{kind:n,id:t}]}).then((o=>{o&&o[n]&&o[n][0]&&(this.selectedOption={id:o[n][0].option_id},this.claimRewards(o[n][0],t))}))}}ei("livelike-image-prediction-follow-up",fd),ei("livelike-text-prediction-follow-up",fd);var Sb=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};const Aa=(e,t)=>{Vc(e,class extends t{render(){const n=I`<div style="position:relative;width:100%;display:flex"><livelike-description></livelike-description></div>`,r=I`<livelike-image height="64px" width="64px"></livelike-image><div class="livelike-voting-image-container"><livelike-description></livelike-description></div>`,o=e.indexOf("follow")!==-1,c=(v,R)=>{const k=R?null:I`<input class="livelike-voting-number-input incorrect-number-input" type="number" placeholder="-" value="${v.number}" disabled="disabled">`;return o?I`<div class="livelike-voting-input-container">${k} <input class="livelike-voting-number-input correct-number-input" type="number" placeholder="-" value="${v.correct_number}" disabled="disabled"></div>`:I`<div class="livelike-voting-input-container"><input class="livelike-voting-number-input user-number-input" type="number" placeholder="-" .value="${v.number}" @input="${M=>this.inputHandler(v,M)}" @keypress="${this.keypressHandler}" ?disabled="${this.disabled||this.voteDisable}"></div>`},l=this.options.map(((v,R)=>{const k=v.number===v.correct_number;return I`<livelike-option index="${R}">${e.indexOf("image")!==-1?r:n} ${c(v,k)}</livelike-option>`})),u=this.disabled&&(this.vote||this.interaction)?I`<span class="voted-text">${this.owner.localize("widget.numberPrediction.votedText")}</span>`:null,m=o?null:I`<livelike-widget-footer><button class="predict-button" @click="${()=>this.lockInVote(this.options)}" ?disabled="${this.disabled||this.voteDisable||this.voteButtonDisabled}">${this.owner.localize("widget.numberPrediction.voteButton.label")}</button> ${u}</livelike-widget-footer>`;return I`<template><livelike-widget-root>${bg} ${_n}<livelike-widget-body>${l} ${m} ${this.owner.renderWidgetFooter()}</livelike-widget-body></livelike-widget-root></template>`}})};class Ma extends Nt{constructor(){super(...arguments),this.defaultStyles=_g,this.owner=this,this.voteButtonDisabled=!0,this.isVoteValid=()=>!this.options.some((t=>t.number==null)),this.inputHandler=(t,n)=>{n.target.value.indexOf(".")!==-1&&(n.target.value=n.target.value.replace(/[.][0-9]+$/,""));const r=n.target.value?+n.target.value:null;this.updateOption(t,r)},this.keypressHandler=t=>t.which===46&&(t.returnValue=!1),this.updateOption=(t,n)=>{if(!this.disabled)if(Number.isInteger(n)||n==null){const r=this.options.findIndex((o=>o.id===t.id));this.options[r].number=n,this.voteButtonDisabled=!this.isVoteValid(),this.interactionEvent()}else console.error(`${n} is not an integer`)},this.lockInVote=t=>{if(!this.voteDisable){this.voteDisable=!0;const n={votes:t&&t instanceof Array&&t.map((r=>({option_id:r.id,number:r.number})))};this.createVote(this.vote_url,n).then((r=>{this.disabled=!0,Or[r.widget_id]={votes:r.votes,claim_token:r.claim_token}}))}},this.resultEvent=()=>{super.resultEvent(),!this.interaction&&!this.vote&&this.options&&this.isVoteValid()&&this.lockInVote(this.options)}}firstUpdated(){super.firstUpdated(),this.interaction&&(this.interaction.votes.forEach((t=>{const n=this.options.findIndex((r=>r.id===t.option_id));this.options[n].number=t.number})),this.requestUpdate())}}Sb([C({type:Boolean})],Ma.prototype,"voteButtonDisabled",void 0),Aa("livelike-text-number-prediction",Ma),Aa("livelike-image-number-prediction",Ma);class yd extends Cg{constructor(){super(...arguments),this.defaultStyles=_g,this.owner=this,this.updateOptions=t=>{t.votes.forEach((n=>{const r=this.options.findIndex((o=>o.id===n.option_id));this.options[r].number=n.number})),this.requestUpdate()},this.resultEvent=()=>{super.resultEvent();let t="unattempted",n=!0,r=!0;this.options.forEach((o=>{o.number!==o.correct_number&&(n=!1),o.number===void 0&&(r=!1)})),this.options&&r&&(t=n?"correct":"incorrect"),Ie(this,"results",{result:t,element:this,widget:this.widgetPayload,votes:this.options})}}firstUpdated(){super.firstUpdated(),this.updateComplete.then((()=>this.disabled=!0));const t=this.widgetPayload.text_number_prediction_id||this.widgetPayload.image_number_prediction_id,n=this.widgetPayload.text_number_prediction_id?se.TEXT_NUMBER_PREDICTION:se.IMAGE_NUMBER_PREDICTION,r=Or[t]||this.interaction;r?(this.updateOptions(r),this.claimRewards(r,t)):bo({programId:this.programid,widgets:[{kind:n,id:t}]}).then((o=>{o&&o[n]&&o[n][0]&&(this.updateOptions(o[n][0]),this.claimRewards(o[n][0],t))}))}}Aa("livelike-image-number-prediction-follow-up",yd),Aa("livelike-text-number-prediction-follow-up",yd);class vd extends wg(Nt){constructor(){super(...arguments),this.defaultVoteHide=!0,this.quizVoteSubmitted=!1,this.hideVoteInResults=!0,this.owner=this,this.defaultStyles=Eb,this.submitVote=t=>{this.disabled||t.id===this.selectedOption.id||(this.selectedOption=t,this.syntheticIncrement=!0,this.interactionEvent())},this.lockInVote=t=>{var n;!this.voteDisable&&(!((n=this.selectedOption)===null||n===void 0)&&n.id)&&(this.updateAnswerCount(this.selectedOption),this.voteDisable=!0,this.createVote(this.selectedOption.answer_url).then((()=>{this.quizVoteSubmitted=!0,this.disabled=!0})))}}firstUpdated(){super.firstUpdated(),this.interaction&&(this.selectedOption=this.choices.find((t=>t.id===this.interaction.choice_id)),this.quizVoteSubmitted=!0,this.disabled=!0)}updateAnswerCount(t){this.choices=this.choices.map((n=>{const r=n.id===t.id?1:0;return Object.assign(Object.assign({},n),{answer_count:n.answer_count+r})}))}}ei("livelike-text-quiz",vd),ei("livelike-image-quiz",vd);const Pb=e=>{let t=`
|
|
1054
|
+
:host {
|
|
1055
|
+
display: block;
|
|
1056
|
+
flex-grow: 1;
|
|
1057
|
+
z-index: 10;
|
|
1058
|
+
padding: 0.5rem;
|
|
1059
|
+
word-break: break-word;
|
|
1060
|
+
position: relative;
|
|
1061
|
+
${_e(e.unselectedOptionDescription)}
|
|
1062
|
+
}
|
|
1063
|
+
:host([image]) {
|
|
1064
|
+
padding: 0.75rem 0.5rem 0.25rem 0.5rem;
|
|
1065
|
+
}
|
|
1066
|
+
:host([selected]) {
|
|
1067
|
+
${_e(e.selectedOptionDescription)}
|
|
1068
|
+
}
|
|
1069
|
+
`;return e.correctOption&&(t+=`
|
|
1070
|
+
:host([correct]) {
|
|
1071
|
+
${_e(e.correctOptionDescription)}
|
|
1072
|
+
}
|
|
1073
|
+
:host([incorrect]) {
|
|
1074
|
+
${_e(e.incorrectOptionDescription)}
|
|
1075
|
+
}`),t};var Ig=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let La=class extends dr{constructor(){super(...arguments),this.defaultStyles=Pb}defaultTemplate(){return I`<slot>${this.description||this.item&&this.item.description||this.owner.text}</slot>`}};Ig([C({type:String})],La.prototype,"description",void 0),La=Ig([de("livelike-description")],La);const Ob=e=>`
|
|
1076
|
+
.widget-dismiss {
|
|
1077
|
+
z-index: 1;
|
|
1078
|
+
border: none;
|
|
1079
|
+
background:none;
|
|
1080
|
+
height: 18px;
|
|
1081
|
+
margin: 0.5rem;
|
|
1082
|
+
display: block;
|
|
1083
|
+
${_e(e.dismiss)}
|
|
1084
|
+
}
|
|
1085
|
+
.widget-dismiss:hover {
|
|
1086
|
+
cursor: pointer;
|
|
1087
|
+
}
|
|
1088
|
+
`;var Rb=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let bd=class extends Tt{constructor(){super(...arguments),this.defaultStyles=Ob,this.dismissClicked=()=>Ie(this,"dismiss-clicked")}defaultTemplate(){return I`${this.owner.hide_dismiss_button?null:I`<button class="widget-dismiss" aria-label="Dismiss" @click="${this.dismissClicked}">${Wp}</button>`}`}};bd=Rb([de("livelike-dismiss-button")],bd);const Tb=["text-quiz","image-quiz","text-prediction","image-prediction","text-poll","image-poll"],kg=e=>e.value=wp(e.owner,e.item),Eg=e=>{let t=e.owner.phase;e.owner.defaultVoteHide?Tb.some((n=>n===e.owner.widgetPayload.kind))&&(e.style.visibility=t!=="results"&&t!=="finished"||!(n=>!n.owner.hideVoteInResults||!!n.owner.selectedOption&&!!n.owner.selectedOption.id)(e)?"hidden":"visible"):e.style.visibility=t!=="ready"&&(t!=="interactive"&&!e.owner.hideVoteInResults||e.owner.selectedOption&&e.owner.selectedOption.id)?"visible":"hidden"},Sg=e=>class extends e{constructor(){super(...arguments),this.ownerUpdated=t=>(t.name==="phase"||t.name==="selectedOption")&&Eg(this),this.optionUpdated=t=>{kg(this)}}static get properties(){return{value:{type:Number,reflect:!0}}}firstUpdated(){kg(this),Eg(this)}},xb=e=>{let t=`
|
|
1089
|
+
:host {
|
|
1090
|
+
display: block;
|
|
1091
|
+
position: relative;
|
|
1092
|
+
padding: 0.5rem;
|
|
1093
|
+
z-index: 10;
|
|
1094
|
+
${_e(e.unselectedOptionPercentage)}
|
|
1095
|
+
}
|
|
1096
|
+
:host([selected]) {
|
|
1097
|
+
${_e(e.selectedOptionPercentage)}
|
|
1098
|
+
}
|
|
1099
|
+
`;return e.correctOption&&(t+=`
|
|
1100
|
+
:host([correct]) {
|
|
1101
|
+
${_e(e.correctOptionPercentage)}
|
|
1102
|
+
}
|
|
1103
|
+
:host([incorrect]) {
|
|
1104
|
+
${_e(e.incorrectOptionPercentage)}
|
|
1105
|
+
}
|
|
1106
|
+
`),t};var Ab=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let _d=class extends Sg(dr){constructor(){super(...arguments),this.defaultStyles=xb}defaultTemplate(){return I`${this.value}%`}};_d=Ab([de("livelike-percentage")],_d);const Mb=e=>{let t=`
|
|
1107
|
+
:host {
|
|
1108
|
+
height: 2rem;
|
|
1109
|
+
position: absolute;
|
|
1110
|
+
border-radius: 3px;
|
|
1111
|
+
transition: ease width 0.4s;
|
|
1112
|
+
background: rgba(255, 255, 255, 0.12);
|
|
1113
|
+
${_e(e.unselectedOptionBar)}
|
|
1114
|
+
}
|
|
1115
|
+
:host([selected]) {
|
|
1116
|
+
${_e(e.selectedOptionBar)}
|
|
1117
|
+
}
|
|
1118
|
+
:host([hidden]) {
|
|
1119
|
+
display: none;
|
|
1120
|
+
}
|
|
1121
|
+
`;return e.correctOption&&(t+=`
|
|
1122
|
+
:host([correct]) {
|
|
1123
|
+
${_e(e.correctOptionBar)}
|
|
1124
|
+
}
|
|
1125
|
+
:host([incorrect]) {
|
|
1126
|
+
${_e(e.incorrectOptionBar)}
|
|
1127
|
+
}
|
|
1128
|
+
`),t};var wd=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let zo=class extends Sg(dr){constructor(){super(...arguments),this.defaultStyles=Mb,this.max=100,this.min=0}updated(e){super.updated(e),e.has("value")&&(this.style.width=this.value+"%")}defaultTemplate(){return I`<slot></slot>`}};wd([C({type:Number,reflect:!0})],zo.prototype,"max",void 0),wd([C({type:Number,reflect:!0})],zo.prototype,"min",void 0),zo=wd([de("livelike-progress")],zo);const Lb=()=>`
|
|
1129
|
+
:host{
|
|
1130
|
+
display: block;
|
|
1131
|
+
}
|
|
1132
|
+
`;var Pg=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let $a=class extends Tt{constructor(){super(...arguments),this.defaultStyles=Lb}firstUpdated(){this.items=this.items||this.owner.options||this.owner.choices;const e=this.querySelector("template");this.items.map(((t,n)=>{const r=e.content.firstElementChild;r.setAttribute("index",n);const o=(function(c){let l=c.cloneNode(!0);return Object.keys(c).forEach((u=>l[u]=c[u])),l})(r);this.appendChild(o)})),e.remove(),super.firstUpdated()}defaultTemplate(){return I`<slot></slot>`}};Pg([C({type:Array})],$a.prototype,"items",void 0),$a=Pg([de("livelike-select")],$a);const $b=e=>`
|
|
1133
|
+
:host {
|
|
1134
|
+
width: 0%;
|
|
1135
|
+
display: block;
|
|
1136
|
+
background: white;
|
|
1137
|
+
height: 2px;
|
|
1138
|
+
position: absolute;
|
|
1139
|
+
bottom: 0;
|
|
1140
|
+
transition-timing-function: linear;
|
|
1141
|
+
${_e(e.timer)}
|
|
1142
|
+
}
|
|
1143
|
+
`;var Cd=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Ho=class extends Tt{constructor(){super(...arguments),this.started=!1,this.defaultStyles=$b,this.start=()=>{if(!this.started){this.started=!0;const e=new Date().getTime(),t=()=>{const n=this.time||this.owner.timeout,r=new Date().getTime()-e,o=100*(1-(n-r)/n);this.style.width=`${o>100?100:o}%`,r<n&&this.owner.phase==="interactive"&&requestAnimationFrame(t)};t()}},this.ownerUpdated=e=>{e.name==="phase"&&(e.prop==="interactive"?this.start():this.style.display="none")}}firstUpdated(){this.owner.phase==="interactive"&&this.start(),this.pageVisible=!document.hidden,Ne.on("pageVisibilityChange",(e=>this.pageVisible=e.pageVisible))}render(){return I`<slot></slot>`}};Cd([C({type:Number,reflect:!0})],Ho.prototype,"time",void 0),Cd([C({type:Boolean})],Ho.prototype,"pageVisible",void 0),Ho=Cd([de("livelike-timer")],Ho);const Vb=e=>`
|
|
1144
|
+
:host {
|
|
1145
|
+
padding: 0.5rem 1rem;
|
|
1146
|
+
flex-grow: 1;
|
|
1147
|
+
overflow-wrap: break-word;
|
|
1148
|
+
width: 85%;
|
|
1149
|
+
margin: 0;
|
|
1150
|
+
${_e(e.title)}
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
.widget-tag{
|
|
1154
|
+
font-size: 12px;
|
|
1155
|
+
color: rgba(255,255,255,0.5);
|
|
1156
|
+
font-family: "HelveticaNeue-Bold";
|
|
1157
|
+
${_e(e.tag)}
|
|
1158
|
+
}
|
|
1159
|
+
`;var Og=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Va=class extends Tt{constructor(){super(...arguments),this.defaultStyles=Vb,this.getTag=()=>{switch(this.kind||this.owner.kind){case"text-quiz":case"image-quiz":return this.owner.localize("widget.quiz.tag");case"text-poll":case"image-poll":return this.owner.localize("widget.poll.tag");case"text-prediction":case"image-prediction":return this.owner.localize("widget.prediction.tag");case"text-prediction-follow-up":case"image-prediction-follow-up":return this.owner.localize("widget.followup.tag");case"text-number-prediction":case"image-number-prediction":return this.owner.localize("widget.numberPrediction.tag");case"text-number-prediction-follow-up":case"image-number-prediction-follow-up":return this.owner.localize("widget.numberPredictionFollowUp.tag");default:return""}}}defaultTemplate(){const e=this.getTag().trim();return I`<slot>${e.length>0?I`<div class="widget-tag">${e}</div>`:null}<div>${this.title||this.owner.question||this.owner.title||this.owner.comment}</div></slot>`}};Og([C({type:String})],Va.prototype,"title",void 0),Va=Og([de("livelike-title")],Va);const Db=e=>`
|
|
1160
|
+
:host {
|
|
1161
|
+
|
|
1162
|
+
}
|
|
1163
|
+
`;var Rg=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let qo=class extends dr{constructor(){super(...arguments),this.defaultStyles=Db,this.updateCount=e=>{const t=e&&(String(e.vote_count)||String(e.answer_count));this.count=t||this.owner.count||0},this.ownerUpdated=e=>{e.name!=="options"&&e.name!=="choices"&&e.name!=="count"||this.updateCount(this.item)}}connectedCallback(){super.connectedCallback(),this.updateCount(this.item)}defaultTemplate(){return I`${this.count}`}};Rg([C({type:String,reflect:!0})],qo.prototype,"count",void 0),qo=Rg([de("livelike-vote-count")],qo);const Nb=e=>`
|
|
1164
|
+
:host {
|
|
1165
|
+
display: block;
|
|
1166
|
+
border-radius: 0 0 6px 6px;
|
|
1167
|
+
background: rgba(0,0,0,6);
|
|
1168
|
+
${_e(e.body)}
|
|
1169
|
+
}
|
|
1170
|
+
`;var Ub=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Id=class extends Tt{constructor(){super(...arguments),this.defaultStyles=Nb}defaultTemplate(){return I`<slot></slot>`}};Id=Ub([de("livelike-widget-body")],Id);const jb=()=>`
|
|
1171
|
+
:host {
|
|
1172
|
+
display:flex;
|
|
1173
|
+
justify-content: center;
|
|
1174
|
+
margin: 0.5rem;
|
|
1175
|
+
}
|
|
1176
|
+
`;var Bb=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let kd=class extends Tt{constructor(){super(...arguments),this.defaultStyles=jb}firstUpdated(){let e="";const t=`
|
|
1177
|
+
<time datetime="${this.owner.published_at}">
|
|
1178
|
+
${this.owner.dateTimeFormatter({time:this.owner.published_at,format:this.owner.timeformat,lang:this.owner.lang})}
|
|
1179
|
+
</time>
|
|
1180
|
+
`;this.owner.authors&&this.owner.created_by.name&&(e+=`<span>${this.owner.created_by.name}</span>`,this.owner.timestamps&&(e+=" – ")),this.owner.timestamps&&(e+=t),this.insertAdjacentHTML("afterbegin",e)}defaultTemplate(){return I`<slot></slot>`}};kd=Bb([de("livelike-widget-bylines")],kd);const Fb=e=>`
|
|
1181
|
+
:host {
|
|
1182
|
+
${_e(e.footer)}
|
|
1183
|
+
}
|
|
1184
|
+
`;var zb=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Ed=class extends Tt{constructor(){super(...arguments),this.defaultStyles=Fb}defaultTemplate(){return I`<slot></slot>`}};Ed=zb([de("livelike-widget-footer")],Ed);const Hb=e=>`
|
|
1185
|
+
:host {
|
|
1186
|
+
display: flex;
|
|
1187
|
+
position: relative;
|
|
1188
|
+
border-radius: 6px 6px 0 0;
|
|
1189
|
+
${_e(e.header)}
|
|
1190
|
+
}
|
|
1191
|
+
`;var qb=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Sd=class extends Tt{constructor(){super(...arguments),this.defaultStyles=Hb}defaultTemplate(){return I`<slot name="title"></slot><slot name="dismiss"></slot><slot></slot>`}};Sd=qb([de("livelike-widget-header")],Sd);const Gb=e=>`
|
|
1192
|
+
:host {
|
|
1193
|
+
color: #fff;
|
|
1194
|
+
position: relative;
|
|
1195
|
+
display: block;
|
|
1196
|
+
${_e(e.root)}
|
|
1197
|
+
}
|
|
1198
|
+
`;var Wb=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Pd=class extends Tt{constructor(){super(...arguments),this.defaultStyles=Gb}defaultTemplate(){return I`<livelike-widget-bylines></livelike-widget-bylines><slot name="header"></slot><slot name="timer"></slot><slot name="body"></slot><slot></slot><livelike-widget-reactions></livelike-widget-reactions>`}};Pd=Wb([de("livelike-widget-root")],Pd);const Kb=e=>`
|
|
1199
|
+
:host {
|
|
1200
|
+
display:flex;
|
|
1201
|
+
}
|
|
1202
|
+
.bar-container {
|
|
1203
|
+
font-size: 14px;
|
|
1204
|
+
padding: .25rem 0;
|
|
1205
|
+
transition: all 0.4s ease;
|
|
1206
|
+
text-align: center;
|
|
1207
|
+
}
|
|
1208
|
+
.bar0{
|
|
1209
|
+
background: linear-gradient(to left, #3023ae, #53a0fd);
|
|
1210
|
+
${_e(e.sideABar)}
|
|
1211
|
+
}
|
|
1212
|
+
.bar1{
|
|
1213
|
+
background: linear-gradient(to right, #9f041b, #f5515f);
|
|
1214
|
+
${_e(e.sideBBar)}
|
|
1215
|
+
}
|
|
1216
|
+
`;var Tg=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Da=class extends Tt{constructor(){super(...arguments),this.defaultStyles=Kb,this.ownerUpdated=e=>{e.name!=="options"&&e.name!=="choices"||(this.items=e.prop)}}connectedCallback(){super.connectedCallback(),this.items=this.items||this.owner.options||this.owner.choices}defaultTemplate(){const e=Math.round(1/this.items.length*100);return I`${this.items.map(((t,n)=>{const r=`width:${wp(this.owner,t,e)}%`;return I`<div class="bar-container bar${n}" style="${r}">${t.description?I`<div>${t.description}</div>`:null}</div>`}))}`}};Tg([C({type:Array})],Da.prototype,"items",void 0),Da=Tg([de("livelike-dueling-progress")],Da);var ti=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Ft=class extends je{constructor(){super(...arguments),this.commentsLoading=!0,this.replyStack=[],this.updateCommentStack=e=>{this.replyStack!=e.replyStack&&(this.replyStack=e.replyStack)},this.displayModal=(e,t)=>{const n=document.createElement("livelike-modal");n.type=e,n.data=t,this.querySelector("livelike-comment-list").append(n),setTimeout((()=>n.remove()),4e3)}}createRenderRoot(){return this}get topReplyStackNode(){var e;return this.replyStack?(e=this.replyStack)===null||e===void 0?void 0:e[this.replyStack.length-1]:null}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.unsubscribeCommentStore)===null||e===void 0||e.call(this)}updated(e){super.updated(e),e.forEach(((t,n)=>{var r;n==="boardId"?((r=this.unsubscribeCommentStore)===null||r===void 0||r.call(this),this.unsubscribeCommentStore=fe.subscribe(this.boardId,this.updateCommentStack),this.loadComments({sorting:Nn.NEWEST})):n==="profaneComment"||n==="profaneCommentFilterFunction"?fe.updateCommentConfig({commentBoardId:this.boardId,commentBoardConfig:{profaneComment:this.profaneComment,profaneCommentFilterFunction:this.profaneCommentFilterFunction}}):n==="authorImageUrl"&&fe.updateCommentConfig({commentBoardId:this.boardId,commentBoardConfig:{authorImageUrl:this.authorImageUrl}})}))}loadComments(e){const t=()=>{fe.loadCommentList({commentBoardId:this.boardId,sorting:e.sorting}).finally((()=>{this.commentsLoading=!1}))};ee.ready&&ae&&ae.id?t():po(Ln.INITIALISED,t)}renderCommentLoading(){return I`<style>livelike-spinner .spinner-outer-container{width:1.5rem;height:1.5rem;background-image:linear-gradient(0deg,var(--ll-comment-primary),var(--ll-comment-text-primary))}livelike-spinner .spinner-inner-container{background-color:var(--ll-comment-primary)}</style><div class="comment-loading-container"><livelike-spinner animationduration="${2}"></livelike-spinner></div>`}renderCommentBoardHeader(){return I`<livelike-comment-board-header .boardId="${this.boardId}" .replyHeader="${!!this.topReplyStackNode}"></livelike-comment-board-header>`}renderCommentList(){return this.topReplyStackNode?I`<livelike-reply-list .boardId="${this.boardId}"></livelike-reply-list>`:I`<livelike-comment-list .boardId="${this.boardId}"></livelike-comment-list>`}renderCommentComposer(){return I`<livelike-comment-composer .boardId="${this.boardId}"></livelike-comment-composer>`}render(){return this.boardId?I`<style>:root{--ll-comment-primary:#131524;--ll-comment-secondary:#202233;--ll-comment-on-primary:#1e90ff;--ll-comment-on-secondary:#383d57;--ll-comment-ascent:#27bf9d;--ll-comment-border:#474e55;--ll-comment-text-primary:#ffffff;--ll-comment-text-secondary:#7a7b7c;--ll-comment-dropdown-background:#383d57;--ll-comment-dropdown-hover:rgba(0, 0, 0, 0.2)}livelike-comments{height:100%}.comments-container{background:var(--ll-comment-primary);color:var(--ll-comment-text-primary);height:100%;display:flex;flex-direction:column;position:relative}.comments-container button,.comments-container textarea,.comments-container textarea::placeholder{font-family:inherit}.comment-loading-container{height:100%;display:flex;justify-content:center;align-items:center}livelike-comment-list{flex:1;overflow-y:auto}livelike-reply-list{flex:1;overflow-y:auto;display:flex;flex-direction:column}</style><div class="comments-container"><livelike-banner .bannerGroupId="${this.boardId}"></livelike-banner>${this.commentsLoading?this.renderCommentLoading():null} ${this.commentsLoading?null:I`${this.renderCommentBoardHeader()}${this.renderCommentList()}${this.renderCommentComposer()}`}</div>`:I``}};ti([C({type:String})],Ft.prototype,"boardId",void 0),ti([C({type:String})],Ft.prototype,"authorImageUrl",void 0),ti([C({type:Object})],Ft.prototype,"boardResource",void 0),ti([C({type:Boolean})],Ft.prototype,"commentsLoading",void 0),ti([C({type:Array})],Ft.prototype,"replyStack",void 0),ti([C({type:String})],Ft.prototype,"profaneComment",void 0),ti([C({type:Function})],Ft.prototype,"profaneCommentFilterFunction",void 0),Ft=ti([de("livelike-comments")],Ft);var ni=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let tn=class extends je{constructor(){super(...arguments),this.menuOpen=null,this.animation=0,this.commentTotalCount=0,this.commentSort="Newest",this.replyHeader=!1,this.commentSortingMenus=()=>[{label:"Newest",type:"single",onClick:()=>{this.commentSort="Newest",fe.loadCommentList({commentBoardId:this.boardId,sorting:Nn.NEWEST})}},{label:"Oldest",type:"single",onClick:()=>{this.commentSort="Oldest",fe.loadCommentList({commentBoardId:this.boardId,sorting:Nn.OLDEST})}}].filter(Boolean),this.renderCommentSortingMenu=()=>I`<livelike-comment-menu .menu="${this.commentSortingMenus()}" .id="123" .animation="${this.animation}" .closeMenu="${()=>Ri(this,"menuOpen")}"></livelike-comment-menu>`,this.updateCommentCount=e=>{var t;this.commentTotalCount=e.commentTotalCount,this.replyToAuthorName=(t=fe.getParentCommentForReply(this.boardId))===null||t===void 0?void 0:t.author.nickname},this.backClickHandler=()=>{fe.removeReplyStackTop(this.boardId)},this.closeReplyView=()=>{fe.emptyReplyStack(this.boardId)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.commentTotalCount=fe.getState(this.boardId).commentTotalCount,this.unsubscribeCommentStore=fe.subscribe(this.boardId,this.updateCommentCount)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.unsubscribeCommentStore)===null||e===void 0||e.call(this)}updated(e){super.updated(e),e.forEach(((t,n)=>{var r;n==="boardId"&&(this.commentTotalCount=fe.getState(this.boardId).commentTotalCount,(r=this.unsubscribeCommentStore)===null||r===void 0||r.call(this),this.unsubscribeCommentStore=fe.subscribe(this.boardId,this.updateCommentCount))}))}renderReplyHeader(){return I`<style>.reply-header-container{display:flex;justify-content:flex-start;padding:1rem .75rem;position:relative;align-items:center}.reply-header-back-button{border:none;background:0 0;cursor:pointer;padding:0;width:1.25rem;height:1.25rem;padding:0}.reply-header-label{display:flex;align-items:center;column-gap:10px;text-align:center;font-size:1rem;font-weight:400;line-height:normal;flex:1;margin-left:.5rem}.reply-close-icon{border:none;background:0 0;cursor:pointer;width:1.25rem;height:1.25rem;padding:0;margin-right:.25rem}</style><div class="reply-header-container"><button class="reply-header-back-button" @click="${this.backClickHandler}">${xy}</button><div class="reply-header-label">Replies to ${this.replyToAuthorName}</div><button class="reply-close-icon" @click="${this.closeReplyView}">${Ty}</button></div>`}renderCommentBoardHeader(){return I`<style>.comment-board-header-container{display:flex;justify-content:space-between;padding:1rem .75rem;position:relative}.comment-header-label-container{display:flex;align-items:center;column-gap:.4rem}.comment-header-label-text{text-align:center;font-size:1rem;font-weight:400;line-height:normal}.comment-sorting-container{display:flex;align-items:center;column-gap:.44rem;color:var(--ll-comment-text-primary);text-align:right;font-size:.875rem;font-weight:400;line-height:normal;margin-right:.5rem}.more-icon{background:0 0;border:none;margin:0;display:flex;align-items:center;color:#fff;padding:0}</style><div class="comment-board-header-container"><div class="comment-header-label-container">${ky} <span class="comment-header-label-text">Comments (${this.commentTotalCount})</span></div><div class="comment-sorting-container"><button class="more-icon active" @click="${()=>hr(this,"123","menuOpen")}"><div class="comment-sorting-container">${Ey}<div>${this.commentSort}</div></div></button> ${this.menuOpen?this.renderCommentSortingMenu():null}</div></div>`}render(){return this.replyHeader?this.renderReplyHeader():this.renderCommentBoardHeader()}};ni([C({type:String})],tn.prototype,"menuOpen",void 0),ni([C({type:Number})],tn.prototype,"animation",void 0),ni([C({type:Number})],tn.prototype,"commentTotalCount",void 0),ni([C({type:String})],tn.prototype,"commentSort",void 0),ni([C({type:String})],tn.prototype,"boardId",void 0),ni([C({type:String})],tn.prototype,"replyToAuthorName",void 0),ni([C({type:Boolean})],tn.prototype,"replyHeader",void 0),tn=ni([de("livelike-comment-board-header")],tn);const xg=(e,t)=>{const n=e.startNode.parentNode,r=t===void 0?e.endNode:t.startNode,o=n.insertBefore(Kt(),r);n.insertBefore(Kt(),r);const c=new wi(e.options);return c.insertAfterNode(o),c},Bi=(e,t)=>(e.setValue(t),e.commit(),e),Od=(e,t,n)=>{const r=e.startNode.parentNode,o=n?n.startNode:e.endNode,c=t.endNode.nextSibling;c!==o&&((l,u,m=null,v=null)=>{for(;u!==m;){const R=u.nextSibling;l.insertBefore(u,v),u=R}})(r,t.startNode,c,o)},Rd=e=>{Is(e.startNode.parentNode,e.startNode,e.endNode.nextSibling)},Ag=(e,t,n)=>{const r=new Map;for(let o=t;o<=n;o++)r.set(e[o],o);return r},Mg=new WeakMap,Lg=new WeakMap,Go=Wu(((e,t,n)=>{let r;return n===void 0?n=t:t!==void 0&&(r=t),o=>{if(!(o instanceof wi))throw new Error("repeat can only be used in text bindings");const c=Mg.get(o)||[],l=Lg.get(o)||[],u=[],m=[],v=[];let R,k,M=0;for(const ce of e)v[M]=r?r(ce,M):M,m[M]=n(ce,M),M++;let D=0,ne=c.length-1,oe=0,me=m.length-1;for(;D<=ne&&oe<=me;)if(c[D]===null)D++;else if(c[ne]===null)ne--;else if(l[D]===v[oe])u[oe]=Bi(c[D],m[oe]),D++,oe++;else if(l[ne]===v[me])u[me]=Bi(c[ne],m[me]),ne--,me--;else if(l[D]===v[me])u[me]=Bi(c[D],m[me]),Od(o,c[D],u[me+1]),D++,me--;else if(l[ne]===v[oe])u[oe]=Bi(c[ne],m[oe]),Od(o,c[ne],c[D]),ne--,oe++;else if(R===void 0&&(R=Ag(v,oe,me),k=Ag(l,D,ne)),R.has(l[D]))if(R.has(l[ne])){const ce=k.get(v[oe]),ye=ce!==void 0?c[ce]:null;if(ye===null){const Ve=xg(o,c[D]);Bi(Ve,m[oe]),u[oe]=Ve}else u[oe]=Bi(ye,m[oe]),Od(o,ye,c[D]),c[ce]=null;oe++}else Rd(c[ne]),ne--;else Rd(c[D]),D++;for(;oe<=me;){const ce=xg(o,u[me+1]);Bi(ce,m[oe]),u[oe++]=ce}for(;D<=ne;){const ce=c[D++];ce!==null&&Rd(ce)}Mg.set(o,u),Lg.set(o,v)}}));var Rr=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let ii=class extends je{constructor(){super(...arguments),this.commentList=[],this.isMoreCommentLoading=!1,this.hasMoreComment=!1,this.maxReplyDepth=1,this.updateCommentList=e=>{this.commentList=e.comments},this.loadMore=()=>{this.isMoreCommentLoading=!0,fe.loadNextComments(this.boardId).then((e=>{this.hasMoreComment=!e.response.done})).finally((()=>{this.isMoreCommentLoading=!1}))},this.renderCommentItem=e=>I`<livelike-comment-item .comment="${e}" .replyTo="${e.comment_depth<this.maxReplyDepth}"></livelike-comment-item>`}connectedCallback(){var e,t;super.connectedCallback();const n=fe.getState(this.boardId);n&&(this.maxReplyDepth=(t=(e=fe.getState(this.boardId))===null||e===void 0?void 0:e.maxReplyDepth)!==null&&t!==void 0?t:1,this.commentList=n.comments,this.hasMoreComment=!!n.iterator,this.unsubscribeCommentStore=fe.subscribe(this.boardId,this.updateCommentList))}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.unsubscribeCommentStore)===null||e===void 0||e.call(this)}createRenderRoot(){return this}renderCommentLoadMoreButton(){return this.hasMoreComment?I`<style>.comment-load-more-container{display:flex;align-items:center;justify-content:center}.comment-load-more-button{width:60%;min-width:16rem;height:2.5rem;background-color:var(--ll-comment-ascent);color:var(--ll-comment-text-primary);border:none;border-radius:.5rem;font-size:.875rem;display:flex;justify-content:center;align-items:center;cursor:pointer}livelike-spinner .spinner-outer-container{width:1.5rem;height:1.5rem;background-image:linear-gradient(0deg,var(--ll-comment-ascent),var(--ll-comment-text-primary))}livelike-spinner .spinner-inner-container{background-color:var(--ll-comment-ascent)}</style><div class="comment-load-more-container"><button class="comment-load-more-button" @click="${this.loadMore}">${this.isMoreCommentLoading?I`<livelike-spinner animationduration="${2}"></livelike-spinner><span class="comment-load-more-button-label">Loading Comments</span>`:I`<span class="comment-load-more-button-label">Load More</span>`}</button></div>`:I``}renderEmptyComment(){return I`<livelike-comment-empty></livelike-comment-empty>`}render(){return I`<style>.comment-list{display:flex;padding:0 .7rem .7rem .7rem;gap:.7rem;flex-direction:column;position:relative}livelike-comment-empty{display:flex;justify-content:center;align-items:center;height:80%}</style><div class="comment-list">${Go(this.commentList,(e=>e.id),this.renderCommentItem)} ${this.renderCommentLoadMoreButton()}</div>${this.commentList.length!==0||this.hasMoreComment?null:this.renderEmptyComment()}`}};Rr([C({type:String})],ii.prototype,"boardId",void 0),Rr([C({type:Object})],ii.prototype,"commentList",void 0),Rr([C({type:Boolean})],ii.prototype,"isMoreCommentLoading",void 0),Rr([C({type:Boolean})],ii.prototype,"hasMoreComment",void 0),Rr([C({type:Number})],ii.prototype,"maxReplyDepth",void 0),ii=Rr([de("livelike-comment-list")],ii);var ri=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};const $g=[];let nn=class extends je{constructor(){super(...arguments),this.replyList=$g,this.repliesLoading=!0,this.isMoreReplyLoading=!1,this.hasMoreComment=!1,this.maxReplyDepth=0,this.loadReplies=e=>{this.repliesLoading=!0,fe.loadCommentReplies({commentBoardId:this.boardId,commentId:e}).finally((()=>{this.repliesLoading=!1}))},this.updateCommentReplyDetails=e=>{var t,n,r;const o=fe.getState(this.boardId),c=(t=o?.replyStack)!==null&&t!==void 0?t:[],l=c[c.length-1];if(!l)return;this.comment=fe.getParentCommentForReply(this.boardId);const u=(n=o?.commentReplies)===null||n===void 0?void 0:n[l];u&&(this.replyList=(r=u.replies)!==null&&r!==void 0?r:$g,this.hasMoreComment=!!u.iterator)},this.loadMore=()=>{this.comment&&this.hasMoreComment&&(this.isMoreReplyLoading=!0,fe.loadNextCommentReplies({commentBoardId:this.comment.comment_board_id,parentCommentId:this.comment.id}).finally((()=>{this.isMoreReplyLoading=!1})))},this.renderCommentReplyItem=e=>I`<livelike-comment-item .comment="${e}" .replyItem="${!0}" .replyTo="${e.comment_depth<this.maxReplyDepth}"></livelike-comment-item>`}connectedCallback(){var e,t;super.connectedCallback();const n=fe.getState(this.boardId);this.maxReplyDepth=(t=(e=fe.getState(this.boardId))===null||e===void 0?void 0:e.maxReplyDepth)!==null&&t!==void 0?t:1,this.updateCommentReplyDetails(n),this.unsubscribeCommentStore=fe.subscribe(this.boardId,this.updateCommentReplyDetails)}disconnectedCallback(){var e;(e=this.unsubscribeCommentStore)===null||e===void 0||e.call(this)}createRenderRoot(){return this}updated(e){e.forEach(((t,n)=>{n!=="comment"||t&&t.id===this.comment.id||this.loadReplies(this.comment.id)}))}renderComment(){return this.comment?I`<livelike-comment-item .comment="${this.comment}" .replyTo="${!1}"></livelike-comment-item>`:I``}renderRepliesLoading(){return I`<style>livelike-spinner .spinner-outer-container{width:1.5rem;height:1.5rem;background-image:linear-gradient(0deg,var(--ll-comment-primary),var(--ll-comment-text-primary))}livelike-spinner .spinner-inner-container{background-color:var(--ll-comment-primary)}.reply-loading-container{display:flex;flex:2;justify-content:center;align-items:center}</style><div class="reply-loading-container"><livelike-spinner animationduration="${2}"></livelike-spinner></div>`}renderEmptyComment(){return I`<livelike-comment-empty title="No Replies Yet"></livelike-comment-empty>`}renderReplyLoadMoreButton(){return this.hasMoreComment?I`<style>.comment-load-more-container{display:flex;align-items:center;justify-content:center;margin-bottom:1rem}.comment-load-more-button{width:60%;min-width:16rem;height:2.5rem;background-color:var(--ll-comment-ascent);color:var(--ll-comment-text-primary);border:none;border-radius:.5rem;font-size:.875rem;display:flex;justify-content:center;align-items:center;cursor:pointer}.comment-load-more-button livelike-spinner .spinner-outer-container{width:1.5rem;height:1.5rem;background-image:linear-gradient(0deg,var(--ll-comment-ascent),var(--ll-comment-text-primary))}.comment-load-more-button livelike-spinner .spinner-inner-container{background-color:var(--ll-comment-ascent)}</style><div class="comment-load-more-container"><button class="comment-load-more-button" @click="${this.loadMore}">${this.isMoreReplyLoading?I`<livelike-spinner animationduration="${2}"></livelike-spinner><span class="comment-load-more-button-label">Loading Replies</span>`:I`<span class="comment-load-more-button-label">Load More</span>`}</button></div>`:I``}render(){return I`<style>.reply-list-container{background:var(--ll-comment-secondary);margin:0 .7rem .7rem .7rem;margin-top:0;border-radius:8px;display:flex;flex-direction:column}.reply-list{padding:0 2rem;display:flex;flex-direction:column}livelike-comment-empty{display:flex;justify-content:center;align-items:center;flex:2}</style><div class="reply-list-container">${this.renderComment()} ${!this.repliesLoading&&this.replyList.length>0?I`<div class="reply-list">${Go(this.replyList,(e=>e.id),this.renderCommentReplyItem)}</div>`:null}</div>${this.repliesLoading?this.renderRepliesLoading():this.renderReplyLoadMoreButton()} ${this.repliesLoading||this.replyList.length!==0||this.hasMoreComment?null:this.renderEmptyComment()}`}};ri([C({type:String})],nn.prototype,"boardId",void 0),ri([C({type:Object})],nn.prototype,"comment",void 0),ri([C({type:Array})],nn.prototype,"replyList",void 0),ri([C({type:Boolean})],nn.prototype,"repliesLoading",void 0),ri([C({type:Boolean})],nn.prototype,"isMoreReplyLoading",void 0),ri([C({type:Boolean})],nn.prototype,"hasMoreComment",void 0),ri([C({type:Number})],nn.prototype,"maxReplyDepth",void 0),nn=ri([de("livelike-reply-list")],nn);var In=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let zt=class extends je{constructor(){super(...arguments),this.textInput="",this.isSending=!1,this.lang="en",this.initialHeight="2.8125rem",this.localize=(e,t)=>yn(e,this.lang,t),this.updateStackComment=e=>{this.stackComment=fe.getParentCommentForReply(this.boardId),this.authorImageUrl!==e.authorImageUrl&&(this.authorImageUrl=e.authorImageUrl)},this.sendComment=()=>{var e;if(!((e=this.textInput)===null||e===void 0)&&e.trim()&&!this.isSending)return this.isSending=!0,(this.isReply?fe.addCommentReply({commentBoardId:this.boardId,text:this.textInput,parentCommentId:this.stackComment.id,authorImageUrl:this.authorImageUrl}):fe.addComment({commentBoardId:this.boardId,text:this.textInput,authorImageUrl:this.authorImageUrl})).then((()=>{this.textInput="",this.resize(this.initialHeight);const t=this.isReply?"livelike-reply-list":"livelike-comment-list";document.querySelector(`${t}`).scrollTop=0})).catch((t=>{const n=this.boardId,r={targetId:this.isReply?this.stackComment.id:"DUMMY_TARGET_ID",message:this.localize("comment.composer.error.genericError"),type:ft.ERROR};Gn.addBanner(n,r)})).finally((()=>{var t;this.isSending=!1,(t=this.inputEl)===null||t===void 0||t.focus()}))},this.handleMessage=e=>{e.target.value!==void 0&&(this.textInput=e.target.value),this.resize(e.target.value===""?this.initialHeight:void 0)},this.handleKeyDown=e=>{e.which!==13||e.shiftKey||(e.preventDefault(),this.sendComment())},this.resize=e=>{this.inputEl&&(this.inputEl.style.height=e||`${this.inputEl.scrollHeight}px`)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback();const e=fe.getState(this.boardId);this.authorImageUrl=e.authorImageUrl,this.unsubscribeCommentStore=fe.subscribe(this.boardId,this.updateStackComment)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.unsubscribeCommentStore)===null||e===void 0||e.call(this)}updated(e){super.updated(e),e.forEach(((t,n)=>{var r;n==="boardId"&&((r=this.unsubscribeCommentStore)===null||r===void 0||r.call(this),this.unsubscribeCommentStore=fe.subscribe(this.boardId,this.updateStackComment))}))}get isReply(){return!!this.stackComment}get inputEl(){return this.querySelector("#commment-composer-text-input-id")}renderInput(){const e=this.isReply?this.localize("comment.reply.composer.inputPlaceholder"):this.localize("comment.composer.inputPlaceholder");return I`<textarea id="commment-composer-text-input-id" class="comment-composer-text-area" placeholder="${e}" aria-label="${e}" @input="${this.handleMessage}" @keydown="${this.handleKeyDown}" .disabled="${this.isSending}" .value="${this.textInput}" maxlength="${this.inputMaxLength}"></textarea>`}renderSendButton(){const e=I`${by}`;return I`<button class="comment-composer-send-button" @click="${this.sendComment}" .disabled="${this.isSending}">${e}</button>`}render(){return I`<style>.comment-composer-container{display:flex;flex-direction:row;align-items:center;padding:.5rem;background:var(--ll-comment-secondary)}.comment-composer-send-button{width:2.8125rem;height:2.8125rem;border:0;cursor:pointer;border-radius:.5rem;margin-left:.5rem;display:flex;justify-content:center;align-items:center;background-color:var(--ll-comment-ascent)}.comment-composer-text-area{flex:1;border:0;outline:0;border-radius:.5rem;padding:.75rem;box-sizing:border-box;height:2.8125rem;background:var(--ll-comment-primary);color:var(--ll-comment-text-primary)}</style><div class="comment-composer-container">${this.renderInput()}${this.renderSendButton()}</div>`}};In([C({type:String,reflect:!0})],zt.prototype,"placeholder",void 0),In([C({type:String})],zt.prototype,"boardId",void 0),In([C({type:String})],zt.prototype,"textInput",void 0),In([C({type:Boolean})],zt.prototype,"isSending",void 0),In([C({type:Object})],zt.prototype,"stackComment",void 0),In([C({type:Number})],zt.prototype,"inputMaxLength",void 0),In([C({type:String})],zt.prototype,"authorImageUrl",void 0),In([C({type:String})],zt.prototype,"lang",void 0),zt=In([de("livelike-comment-composer")],zt);var Td=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Wo=class extends je{constructor(){super(...arguments),this.title="No Comments Yet",this.description="Start the conversation"}createRenderRoot(){return this}renderEmptyIcon(){const e=I`${Ly}`;return I`${e}`}renderTitle(){return I`<div class="comment-empty-title">${this.title}</div>`}renderDescription(){return I`<div class="comment-empty-description">${this.description}</div>`}render(){return I`<style>.comment-empty-container{display:flex;flex-direction:column;justify-content:center;align-items:center;align-self:center}.comment-empty-icon{align-self:center}.comment-empty-title{align-self:center;color:var(--ll-comment-text-primary);font-size:.875rem;line-height:1.375rem}.comment-empty-description{align-self:center;color:var(--ll-comment-text-secondary);font-size:.75rem;line-height:1.375rem}</style><div class="comment-empty-container"><div class="comment-empty-icon">${this.renderEmptyIcon()}</div>${this.renderTitle()} ${this.renderDescription()}</div>`}};Td([C({type:String})],Wo.prototype,"title",void 0),Td([C({type:String})],Wo.prototype,"description",void 0),Wo=Td([de("livelike-comment-empty")],Wo);var Na=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Tr=class extends je{constructor(){super(...arguments),this.getReplies=()=>{fe.addReplyStack({commentBoardId:this.boardId,commentId:this.commentId})}}createRenderRoot(){return this}render(){return I`<style>.reply-count-button{border-radius:4px;background:var(--ll-comment-on-secondary);color:var(--ll-comment-ascent);cursor:pointer;font-size:.75rem;font-weight:600;padding:.25rem .5rem;border:0;margin-top:.75rem}</style><button class="reply-count-button" @click="${this.getReplies}">${this.replyCount} replies</button>`}};Na([C({type:Number})],Tr.prototype,"replyCount",void 0),Na([C({type:String})],Tr.prototype,"boardId",void 0),Na([C({type:String})],Tr.prototype,"commentId",void 0),Tr=Na([de("livelike-comment-reply-count-preview")],Tr);var Ua=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let xr=class extends je{constructor(){super(...arguments),this.replyTo=!0,this.replyItem=!1}createRenderRoot(){return this}get commentReplyCount(){var e,t,n;const r=(t=(e=fe.getState(this.comment.comment_board_id))===null||e===void 0?void 0:e.commentReplies)===null||t===void 0?void 0:t[this.comment.id];return(n=r?.replyTotalCount)!==null&&n!==void 0?n:this.comment.replies_count}get commentIsReported(){return!!fe.getState(this.comment.comment_board_id).commentReports[this.comment.id]}get commentSelfAuthor(){return ae.id===this.comment.author.id}renderCommentHeader(){return I`<livelike-comment-header .comment="${this.comment}" .replyTo="${this.replyTo}"></livelike-comment-header>`}renderCommentBody(){var e,t;return I`<livelike-comment-body .text="${(e=this.comment)===null||e===void 0?void 0:e.text}" .isDeleted="${(t=this.comment)===null||t===void 0?void 0:t.is_deleted}" .selfDelete="${ae.id===this.comment.deleted_by}"></livelike-comment-body>`}renderCommentFooter(){return I`<livelike-comment-footer .replyTo="${this.replyTo}" .commentId="${this.comment.id}" .isDeleted="${this.comment.is_deleted}" .boardId="${this.comment.comment_board_id}" .replyCount="${this.commentReplyCount}"></livelike-comment-footer>`}render(){const e=[this.commentSelfAuthor&&"comment-item-self-author",this.comment.is_deleted&&"comment-item-deleted",this.replyItem&&"comment-reply-item-container",(this.comment.is_self_reported||this.commentIsReported)&&"comment-item-reported"].filter(Boolean).join(" ").padStart(1," ");return I`<style>.comment-item-container{background:var(--ll-comment-secondary);border-radius:.5rem;padding:1rem;display:flex;flex-direction:column}.comment-reply-item-container{background:var(--ll-comment-secondary);border-top:1px solid var(--ll-comment-border);border-radius:0;padding:1rem .5rem 1rem 0}livelike-comment-body{margin-top:.5rem}</style><div class="comment-item-container ${e}">${this.renderCommentHeader()} ${this.renderCommentBody()} ${this.renderCommentFooter()}</div>`}};Ua([C({type:Object})],xr.prototype,"comment",void 0),Ua([C({type:Boolean})],xr.prototype,"replyTo",void 0),Ua([C({type:Boolean})],xr.prototype,"replyItem",void 0),xr=Ua([de("livelike-comment-item")],xr);var oi=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let rn=class extends je{constructor(){super(...arguments),this.animation=0,this.replyTo=!0,this.menu=!0,this.timeformat={month:"short",day:"numeric",hour:"numeric",minute:"numeric"},this.lang="en-US",this.blockId=null,this.blockUser=e=>{fe.blockUserProfile({profileId:e.author.id}).then((t=>{this.blockId=t.id,this.triggerBanner({targetId:e.id,message:this.localize("comment.info.blockUser",{nickname:e.author.nickname}),type:ft.INFO})})).catch((t=>{this.triggerBanner({targetId:e.id,message:this.localize("comment.error.blockUser",{nickname:e.author.nickname}),type:ft.ERROR})}))},this.unblockUser=e=>{this.blockId&&fe.unblockUserProfile({blockId:this.blockId}).then((t=>{this.triggerBanner({targetId:e.id,message:this.localize("comment.info.unblockUser",{nickname:e.author.nickname}),type:ft.INFO})})).catch((t=>{this.triggerBanner({targetId:e.id,message:this.localize("comment.error.unblockUser",{nickname:e.author.nickname}),type:ft.ERROR})})).finally((()=>this.blockId=null))},this.reportComment=e=>{fe.reportComment({commentBoardId:e.comment_board_id,commentId:e.id}).then((()=>{this.triggerBanner({targetId:e.id,message:this.localize("comment.info.reportedComment"),type:ft.INFO})})).catch((t=>{let n=this.localize("comment.error.reportedComment");this.triggerBanner({targetId:e.id,message:n,type:ft.ERROR})}))},this.unreportComment=(e,t)=>{fe.deleteCommentReport({commentBoardId:e.comment_board_id,commentId:e.id,commentReportId:t}).then((()=>{this.triggerBanner({targetId:e.id,message:this.localize("comment.info.unreportedComment"),type:ft.INFO})})).catch((n=>{let r=this.localize("comment.error.unreportedComment");this.triggerBanner({targetId:e.id,message:r,type:ft.ERROR})}))},this.deleteComment=e=>{e.comment_depth===0?fe.deleteComment(e).then((t=>{this.triggerBanner({targetId:e.id,message:this.localize("comment.info.deletedComment"),type:ft.INFO}),this.menu=!1})).catch((t=>{let n=this.localize("comment.error.somethingWentWrong");this.triggerBanner({targetId:e.id,message:n,type:ft.ERROR})})):fe.deleteCommentReply(e).then((t=>{this.triggerBanner({targetId:e.id,message:this.localize("comment.info.deletedComment"),type:ft.INFO}),this.menu=!1})).catch((t=>{let n=this.localize("comment.error.somethingWentWrong");this.triggerBanner({targetId:e.id,message:n,type:ft.ERROR})}))},this.triggerBanner=({targetId:e,message:t,type:n})=>{const r=this.comment.comment_board_id,o={targetId:e,message:t,type:n};Gn.addBanner(r,o)},this.getReplies=()=>{fe.addReplyStack({commentBoardId:this.comment.comment_board_id,commentId:this.comment.id})},this.selfCommentMenu=e=>[{label:this.localize("comment.moderationMenu.deleteComment"),icon:Py,type:"single",onClick:()=>this.deleteComment(e)}],this.commentMenu=(e,t)=>{var n,r;const o=this.blockId?"comment.moderationMenu.unblockUser":"comment.moderationMenu.blockUser",c=(r=(n=fe.getState(e.comment_board_id))===null||n===void 0?void 0:n.commentReports)===null||r===void 0?void 0:r[e.id],l=[{label:this.localize(o),icon:Sy,type:"single",onClick:()=>this.blockId?this.unblockUser(e):this.blockUser(e)}];if(!t){const u=c?"comment.moderationMenu.unreportComment":"comment.moderationMenu.reportComment";l.push({label:this.localize(u),icon:Oy,type:"single",onClick:()=>c?this.unreportComment(e,c.id):this.reportComment(e)})}return l},this.commentModerationMenus=e=>{const t=ae.id===e.author.id,n=e.is_deleted;return t&&!n?this.selfCommentMenu(e):t?void 0:this.commentMenu(e,n)},this.localize=(e,t)=>yn(e,this.lang,t)}createRenderRoot(){return this}renderSenderAvatar(){const e=this.comment.author_image_url?I`<img class="comment-avatar-image" src="${this.comment.author_image_url}" alt="Avatar">`:Ay;return I`<div class="comment-sender-avatar">${e}</div>`}renderSenderName(){return I`<span class="comment-sender-name">${this.comment.author.nickname}</span>`}renderCommentedTime(){return I`<span class="comment-creation-time">${new Date(this.comment.created_at).toLocaleDateString(this.lang,this.timeformat)}</span>`}renderSenderDetails(){return I`<div class="comment-sender-details">${this.renderSenderAvatar()}<div class="comment-author-details">${this.renderSenderName()}${this.renderCommentedTime()}</div></div>`}renderHeaderActions(){return I`<div class="comment-header-actions">${this.renderReplyIcon()}${this.renderHeaderMenu()}</div>`}renderReplyIcon(){return this.replyTo?I`<button class="comment-header-reply-button" @click="${this.getReplies}">${My}</button>`:I``}renderHeaderMenu(){var e;if(this.comment.is_deleted&&this.comment.author.id===ae.id||!this.menu)return I``;const t=this.selectedCommentId===((e=this.comment)===null||e===void 0?void 0:e.id);return I`<button class="comment-header-menu-button active" @click="${()=>hr(this,this.comment.id,"selectedCommentId")}">${Ry}</button> ${t?this.renderCommentModerationMenu(this.comment):null}`}renderCommentModerationMenu(e){return I`<livelike-comment-menu .menu="${this.commentModerationMenus(e)}" .id="123" .animation="${this.animation}" .closeMenu="${()=>Ri(this,"selectedCommentId")}"></livelike-comment-menu>`}render(){return I`<style>.comment-header{display:flex;align-items:center;justify-content:space-between}.comment-info-container{display:flex;align-items:center}.comment-sender-details{display:flex;align-items:center;margin:0 5px 0 0;flex:1;max-width:75%}.comment-author-details{display:flex;align-items:baseline;flex:1;max-width:90%}.comment-sender-avatar{width:1.875rem;height:1.875rem;min-width:1.875rem;min-height:1.875rem;display:flex;margin-right:.62rem}.comment-avatar-image{width:1.875rem;height:1.875rem;border-radius:1rem}.comment-sender-avatar svg{width:100%;height:100%;border-radius:1rem}.comment-sender-name{font-weight:700;font-size:.75rem;line-height:normal;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.comment-creation-time{color:var(--ll-comment-text-secondary);font-size:.625rem;font-weight:400;margin-left:.5rem;white-space:nowrap}.comment-header-actions{position:relative;display:flex}.comment-header-reply-button{background:0 0;border:none;margin-left:.94rem;cursor:pointer;padding:0}.comment-header-menu-button{background:0 0;border:none;margin:0;display:flex;align-items:center;color:#fff;padding:0;margin-left:.94rem;cursor:pointer}</style><div class="comment-header">${this.renderSenderDetails()} ${this.renderHeaderActions()}</div>`}};oi([C({type:Object})],rn.prototype,"comment",void 0),oi([C({type:Number})],rn.prototype,"animation",void 0),oi([C({type:String})],rn.prototype,"selectedCommentId",void 0),oi([C({type:Boolean})],rn.prototype,"replyTo",void 0),oi([C({type:Boolean})],rn.prototype,"menu",void 0),oi([C({type:Object})],rn.prototype,"timeformat",void 0),oi([C({type:String,reflect:!0})],rn.prototype,"lang",void 0),rn=oi([de("livelike-comment-header")],rn);var Ko=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Fi=class extends je{constructor(){super(...arguments),this.text="",this.isDeleted=!1,this.selfDelete=!1,this.lang="en-US",this.translations=ee.localizedStrings,this.localize=(e,t)=>yn(e,this.lang,t)}createRenderRoot(){return this}render(){const e=this.isDeleted&&this.selfDelete?this.localize("comment.deletedMessageByOwner"):this.isDeleted&&!this.selfDelete?this.localize("comment.deletedMessage"):this.text;return I`<style>.comment-body-container{font-size:.875rem;font-weight:400;line-height:1.375rem;word-wrap:break-word}.comment-body-container.deleted{font-style:italic;color:#a6a7ad}</style><div class="comment-body-container ${this.isDeleted?"deleted":""}">${e}</div>`}};Ko([C({type:String})],Fi.prototype,"text",void 0),Ko([C({type:Boolean})],Fi.prototype,"isDeleted",void 0),Ko([C({type:Boolean})],Fi.prototype,"selfDelete",void 0),Ko([C({type:String,reflect:!0})],Fi.prototype,"lang",void 0),Fi=Ko([de("livelike-comment-body")],Fi);var Ar=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let si=class extends je{constructor(){super(...arguments),this.replyTo=!0}createRenderRoot(){return this}renderReplyCount(){return this.replyCount&&this.replyTo?I`<livelike-comment-reply-count-preview .commentId="${this.commentId}" .boardId="${this.boardId}" .replyCount="${this.replyCount}"></livelike-comment-reply-count-preview>`:null}renderReactions(){return this.isDeleted?I``:I`<livelike-reaction .targetGroupId="${this.boardId}" .targetId="${this.commentId}"></livelike-reaction>`}render(){return I`<style>.comment-footer-container{display:flex;flex-direction:column}</style><div class="comment-footer-container">${this.renderReplyCount()}${this.renderReactions()}</div>`}};Ar([C({type:Boolean})],si.prototype,"replyTo",void 0),Ar([C({type:Number})],si.prototype,"replyCount",void 0),Ar([C({type:String})],si.prototype,"boardId",void 0),Ar([C({type:String})],si.prototype,"commentId",void 0),Ar([C({type:Boolean})],si.prototype,"isDeleted",void 0),si=Ar([de("livelike-comment-footer")],si);var Mr=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let ai=class extends je{constructor(){super(...arguments),this.subMenuOpen=null,this.renderButton=(e,t,n)=>{var r;return I`<button id="menu-button-${t}" aria-label="${e.label}" @click="${n}" class="button menu-button">${(r=e.icon)!==null&&r!==void 0?r:null}<div class="menu-item-label">${e.label}</div></button>`},this.renderCustomHtml=e=>{const t=new DOMParser().parseFromString(e.html,"text/html"),n=[];return t.body.childNodes.forEach((r=>n.push(r))),n.map((r=>I`${r}`))},this.renderItem=(e,t)=>{const n=this.id+String(t),r=e.type==="single"?()=>{e.onClick(),this.closeMenu()}:()=>{this.subMenuOpen===n?this.subMenuOpen=null:this.subMenuOpen=n};return I`${e.type==="custom"&&e.html?this.renderCustomHtml(e):this.renderButton(e,t,r)} ${this.subMenuOpen===n&&e.type==="multi"?this.renderSubMenu(e.items):null}`},this.renderSubMenu=e=>I`<div class="sub-menu-container">${this.renderMenu(e,10)}</div>`,this.renderMenu=(e,t)=>e.map(((n,r)=>n.type==="separator"?I`<hr style="margin:0">`:this.renderItem(n,t?r+t:r)))}createRenderRoot(){return this}render(){return I`<style>livelike-comment-menu{position:absolute;width:100%;max-width:10rem;margin:auto;top:1.5rem;right:0;display:flex;align-items:center;justify-content:flex-end;text-align:center}.message-options-anchor{z-index:21;transition:opacity .3s ease;opacity:${this.animation}}.message-options{z-index:21;background:var(--ll-comment-dropdown-background);border-radius:5px;width:10rem}.menu-button{display:flex;font-size:12px;font-weight:400;color:#fff;padding:.5rem;width:100%;border:none;background:0 0;transition:background ease .3s;text-align:left;line-height:22px;align-items:center;position:relative}.menu-button:not(:last-child)::after{content:'';width:90%;border-bottom:1px solid var(--ll-comment-border);position:absolute;bottom:0}.menu-button:hover{background:var(--ll-comment-dropdown-hover);transition:background ease .3s;cursor:pointer}.block-user.blocked{color:gray;cursor:default}.menu-button svg{margin-right:10px}</style><div class="message-options-anchor" id="chat_moderation"><div class="message-options">${this.renderMenu(this.menu)}</div></div>`}};Mr([C({type:Array})],ai.prototype,"menu",void 0),Mr([C({type:Object})],ai.prototype,"id",void 0),Mr([C({type:Number})],ai.prototype,"animation",void 0),Mr([C({type:String})],ai.prototype,"subMenuOpen",void 0),Mr([C({type:Function})],ai.prototype,"closeMenu",void 0),ai=Mr([de("livelike-comment-menu")],ai);var zi=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};const Qb=[];let on=class extends je{constructor(){super(...arguments),this.userReactions=[],this.reactions=[],this.setUserReactions=()=>{var e;this.userReactions=kt.getValidUserReactions({userReactions:(e=kt.getState(this.reactionSpaceId,this.targetId))!==null&&e!==void 0?e:{},reactionPacks:Wn.getReactionPacks({reactionSpaceId:this.reactionSpaceId})})},this.setReactions=()=>{var e;this.reactions=(e=Wn.getReactions({reactionSpaceId:this.reactionSpaceId}))!==null&&e!==void 0?e:Qb},this.toggleReactionPicker=()=>{this.showReactionPicker=!this.showReactionPicker},this.hideReactionPicker=()=>{this.showReactionPicker&&(this.showReactionPicker=!1)},this.renderUserReaction=e=>I`<span class="user-reaction-container ${e.self_reacted_user_reaction_id?"self-user-reaction":""}" @click="${()=>this.handleReactionClick(e)}"><img class="user-reaction-img" src="${e.imageSrc}" alt="${"user reaction"}"><span class="user-reaction-count">${mp(e.count)}</span></span>`}createRenderRoot(){return this}connectedCallback(){var e;super.connectedCallback();const t=(e=$o.getReactionSpaceDetail({targetGroupId:this.targetGroupId}))===null||e===void 0?void 0:e.id;this.setup(t)}setup(e){e&&(this.reactionSpaceId=e,this.setUserReactions(),this.setReactions(),this.unsubscribeUserReactionStore=kt.subscribe(this.reactionSpaceId,this.targetId,this.setUserReactions),this.unsubscribeReactionPackStore=Wn.subscribe(this.reactionSpaceId,this.setReactions))}updated(e){e.forEach(((t,n)=>{n==="targetId"&&t!==this.targetId&&this.setUserReactions()}))}disconnectedCallback(){var e,t;super.disconnectedCallback(),(e=this.unsubscribeUserReactionStore)===null||e===void 0||e.call(this),(t=this.unsubscribeReactionPackStore)===null||t===void 0||t.call(this),document.removeEventListener("click",this.hideReactionPicker)}renderAddReactionIcon(){return I`<span class="reaction-add-icon" @click="${this.toggleReactionPicker}">${$y}</span>`}handleReactionClick(e){kt.onReactionClick({targetId:this.targetId,reactionSpaceId:this.reactionSpaceId,reactionId:e.reaction_id})}renderUserReactions(){return Go(Object.values(this.userReactions).filter((({count:e})=>e>0)),(e=>e.reaction_id),this.renderUserReaction)}renderReactionPicker(){return I`<livelike-reaction-picker .reactions="${this.reactions}" .targetId="${this.targetId}" .reactionSpaceId="${this.reactionSpaceId}" .onHideReactionPicker="${this.hideReactionPicker}"></livelike-reaction-picker>`}render(){var e;return!((e=this.reactions)===null||e===void 0)&&e.length?I`<style>.reaction-container{position:relative;display:flex;flex-wrap:wrap;gap:.31rem;min-height:1.375rem;align-items:center;margin-top:1rem}.user-reaction-container{display:flex;align-items:center;padding:.19rem .31rem .19rem .19rem;border-radius:.25rem;cursor:pointer;background:var(--ll-comment-on-secondary)}.self-user-reaction{background:var(--ll-comment-ascent)}.user-reaction-img{width:1rem;height:1rem}.reaction-add-icon{display:flex;cursor:pointer}.user-reaction-count{font-size:.625rem;font-style:normal;font-weight:600;line-height:normal;letter-spacing:.00625rem;margin-left:.19rem}livelike-reaction-picker{position:absolute;top:-2.8125rem}</style><div class="reaction-container">${this.showReactionPicker?this.renderReactionPicker():null} ${this.renderAddReactionIcon()}${this.renderUserReactions()}</div>`:I``}};zi([C({type:String})],on.prototype,"targetGroupId",void 0),zi([C({type:String})],on.prototype,"reactionSpaceId",void 0),zi([C({type:String})],on.prototype,"targetId",void 0),zi([C({type:Boolean})],on.prototype,"showReactionPicker",void 0),zi([C({type:Array})],on.prototype,"userReactions",void 0),zi([C({type:Array})],on.prototype,"reactions",void 0),on=zi([de("livelike-reaction")],on);var Qo=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let Lr=class extends je{constructor(){super(...arguments),this.toggleReaction=e=>{kt.onReactionClick({reactionId:e.id,reactionSpaceId:this.reactionSpaceId,targetId:this.targetId})},this.renderReaction=e=>I`<span class="reaction-picker-reaction" @click="${()=>this.toggleReaction(e)}"><img class="reaction-picker-reaction-img" src="${e.file}" alt="${e.name}"></span>`}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),setTimeout((()=>{document.addEventListener("click",this.onHideReactionPicker)}))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onHideReactionPicker)}render(){return I`<style>.reaction-picker-container{padding:.65rem;background:var(--ll-comment-on-secondary);display:flex;flex-wrap:wrap;border-radius:.5rem;gap:.7rem}.reaction-picker-reaction{display:flex;align-items:center;gap:.95rem}.reaction-picker-reaction-img{width:1.125rem;height:1.125rem;cursor:pointer}</style><div class="reaction-picker-container">${Go(this.reactions,(e=>e.id),this.renderReaction)}</div>`}};Qo([C({type:String})],Lr.prototype,"reactionSpaceId",void 0),Qo([C({type:String})],Lr.prototype,"targetId",void 0),Qo([C({type:Array})],Lr.prototype,"reactions",void 0),Qo([C({type:Function})],Lr.prototype,"onHideReactionPicker",void 0),Lr=Qo([de("livelike-reaction-picker")],Lr);var Xb=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let xd=class extends on{constructor(){super(...arguments),this.loadReactionDetails=()=>{$o.loadReactionSpaceDetail({targetGroupId:this.targetGroupId}).then((e=>{Wn.loadReactionPackFromReactionSpace(e).then((t=>{kt.loadUserReactions({reactionSpaceId:e.id,targetIds:[this.targetId]}).then((()=>{this.setup(e.id)}))}))}))},this.renderReaction=e=>{const t=this.getUserReactionsDetails(e);return I`<span class="embed-user-reaction-container ${t.self_reacted_user_reaction_id?"embed-self-user-reaction":""}" @click="${()=>this.handleReactionClick(t)}"><img class="embed-user-reaction-img" src="${e.file}" alt="${"user reaction"}"><span class="embed-user-reaction-count">${mp(t.count)}</span></span>`}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),ee.ready&&ae&&ae.id?this.loadReactionDetails():po(Ln.INITIALISED,this.loadReactionDetails)}setup(e){e&&(super.setup(e),kt.subscribeToUserReactionEvents(e))}disconnectedCallback(){super.disconnectedCallback(),kt.unSubscribeToUserReactionEvents(this.reactionSpaceId)}getUserReactionsDetails(e){const t=this.userReactions.filter((({reaction_id:n})=>n===e.id));return t&&t.length>0?t[0]:{targetId:this.targetId,reactionSpaceId:this.reactionSpaceId,reaction_id:e.id,self_reacted_user_reaction_id:"",count:0,imageSrc:e.file}}renderReactions(){return Go(this.reactions,(e=>e.id),this.renderReaction)}renderReactionstLoading(){return I`<style>livelike-spinner .spinner-outer-container{width:1.5rem;height:1.5rem;background-image:linear-gradient(0deg,var(--embed-reaction-primary),var(--embed-reaction-text-primary))}livelike-spinner .spinner-inner-container{background-color:var(--embed-reaction-primary)}</style><div class="emded-loading-container"><livelike-spinner animationduration="${2}"></livelike-spinner></div>`}render(){var e;return!((e=this.reactions)===null||e===void 0)&&e.length?I`<style>.embed-reaction-container{position:relative;display:flex;flex-wrap:wrap;gap:.31rem;min-height:1.375rem;align-items:center;margin-top:1rem}.embed-user-reaction-container{display:flex;align-items:center;padding:.19rem .31rem .19rem .19rem;border-radius:.25rem;cursor:pointer;background:var(--ll-embed-reaction-secondary)}.embed-self-user-reaction{background:var(--ll-embed-reaction-ascent)}.embed-user-reaction-img{width:1rem;height:1rem}.embed-reaction-add-icon{display:flex;cursor:pointer}.embed-user-reaction-count{font-size:.625rem;font-style:normal;font-weight:600;line-height:normal;letter-spacing:.00625rem;margin-left:.19rem}.emded-loading-container{height:100%;display:flex;justify-content:center;align-items:center}</style><div class="embed-reaction-container">${this.renderReactions()}</div>`:I`${this.renderReactionstLoading()}`}};xd=Xb([de("livelike-embed-reaction")],xd);var Xo=function(e,t,n,r){var o,c=arguments.length,l=c<3?t:r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(l=(c<3?o(l):c>3?o(t,n,l):o(t,n))||l);return c>3&&l&&Object.defineProperty(t,n,l),l};let $r=class extends je{constructor(){super(...arguments),this.banners=[],this.defaultTimeout=4e3,this.bannerGroupId=null,this.updateBanners=e=>{this.banners=e.banners}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback();const e=Gn.getState(this.bannerGroupId);e&&(this.banners=e.banners,this.unsubscribeBannerStore=Gn.subscribe(this.bannerGroupId,this.updateBanners))}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.unsubscribeBannerStore)===null||e===void 0||e.call(this)}updated(e){e.forEach(((t,n)=>{var r;n==="banners"?this.banners.length&&!this.currentTimeout?this.currentTimeout=setInterval((()=>{Gn.removeBannerById(this.bannerGroupId,this.banners[this.banners.length-1].targetId)}),this.defaultTimeout):!this.banners.length&&this.currentTimeout&&(clearInterval(this.currentTimeout),this.currentTimeout=void 0):n==="bannerGroupId"&&((r=this.unsubscribeBannerStore)===null||r===void 0||r.call(this),this.unsubscribeBannerStore=Gn.subscribe(this.bannerGroupId,this.updateBanners))}))}renderBannerItem(e){return I`<style>:root{--ll-banner-info:#27bf9d;--ll-banner-error:#a00d32}.livelike-banner-item{background-color:var(--ll-comment-dropdown-background);border-left:.25rem solid ${e.type==="info"?"var(--ll-banner-info)":"var(--ll-banner-error)"};padding:1rem;width:100%;margin-bottom:1rem;font-weight:400;font-size:.875rem}</style><div class="livelike-banner-item">${e.message}</div>`}render(){return I`<style>.livelike-banner{position:absolute;left:0;top:3rem;padding:.7rem;z-index:2;width:70%;box-sizing:border-box}</style><div class="livelike-banner">${this.banners.map((e=>this.renderBannerItem(e)))}</div>`}};Xo([C({type:String,reflect:!0})],$r.prototype,"message",void 0),Xo([C({type:Array})],$r.prototype,"banners",void 0),Xo([C({type:Number})],$r.prototype,"defaultTimeout",void 0),Xo([C({type:String})],$r.prototype,"bannerGroupId",void 0),$r=Xo([de("livelike-banner")],$r);const Zo=Object.assign(Object.assign({},$0),{_$$:ee,_config:lr,userProfile:ae,interactiveTimelineMode:_p,popupMode:fp,applyTheme:Fm,createUserProfile:e=>Fc("post",e&&e.nickname&&e,null).then((t=>(Ct("Unique Profile Created",{"Profile ID":t.id}),t))),getUserProfile:zc,init:function(e){var t;return ee.ready&&ee.clientId&&Ce||((function(){var n=document.createElement("script");n.type="text/javascript",n.src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs@2.4.4/webcomponents-loader.js",document.body.append(n)})(),ee.pageVisible=!document.hidden,document.addEventListener("visibilitychange",(()=>{ee.pageVisible=!document.hidden,Ne.emit("pageVisibilityChange",{pageVisible:!document.hidden})}),!1)),e.syncStrategy&&(ee.syncStrategy=e.syncStrategy),e.localizedStrings&&zm(e.localizedStrings),e.storageStrategy=(t=e.storageStrategy)!==null&&t!==void 0?t:Z0,Fm(e.theme||{}).then((()=>Bh(e))).then((n=>(lr.ready=!0,window.SCPEAK=()=>he.listeners,n)))},updateUserProfile:Jp,registerWidgetMode:vo,WidgetKind:se,getPostedWidgets:e=>Up(e).then((t=>Re(["widgets","widget_interactions_url_template"],t))),getWidgets:e=>e&&e.programId?Oi(e.programId).then((t=>{var n,r,o,c;let l=t.widgets_url+"?";return l+=[e.status&&`status=${e.status}`,e.ordering&&`ordering=${e.ordering}`,e.interactive!==void 0&&`interactive=${e.interactive}`,e.since&&`since=${e.since}`,...(r=(n=e.widgetKinds)===null||n===void 0?void 0:n.map((u=>"kind="+u)))!==null&&r!==void 0?r:[],...(c=(o=e.widgetAttributes)===null||o===void 0?void 0:o.map((u=>`widget_attribute=${u.key+Zs+u.value}`)))!==null&&c!==void 0?c:[]].filter(Boolean).join("&"),Re(["results"],xe(l,(u=>K.get({url:u})),(u=>({count:u.count,results:u.results}))))})).catch((t=>Promise.reject(t))):Dt("programId","getwidgets"),createTextPollWidget:function(e){return ue(e,["question","programId","options"],"createTextPollWidget").then((()=>be())).then((t=>{const{question:n,programId:r,options:o,interactiveUntil:c,playbackTimeMs:l,timeout:u,programDateTime:m,widgetAttributes:v,customData:R,sponsorIds:k}=e;return K.post({url:t.text_polls_url,data:{question:n,options:o,program_id:r,interactive_until:c,playback_time_ms:l,timeout:u,program_date_time:m,widget_attributes:v,custom_data:R,sponsor_ids:k}})})).then((t=>(ee.widgets[t.id]=t,t)))},createImagePollWidget:function(e){return ue(e,["question","programId","options"],"createImagePollWidget").then((()=>be())).then((t=>{const{question:n,programId:r,options:o,interactiveUntil:c,playbackTimeMs:l,timeout:u,programDateTime:m,widgetAttributes:v,customData:R,sponsorIds:k}=e;return K.post({url:t.image_polls_url,data:{question:n,options:o.map((M=>({description:M.description,image_url:M.imageUrl}))),program_id:r,interactive_until:c,playback_time_ms:l,timeout:u,program_date_time:m,widget_attributes:v,custom_data:R,sponsor_ids:k}})})).then((t=>(ee.widgets[t.id]=t,t)))},createTextPredictionWidget:function(e){return ue(e,["question","programId","options"],"createTextPredictionWidget").then((()=>be())).then((t=>{const{question:n,programId:r,options:o,interactiveUntil:c,playbackTimeMs:l,timeout:u,programDateTime:m,widgetAttributes:v,customData:R,confirmationMessage:k,sponsorIds:M}=e;return K.post({url:t.text_predictions_url,data:{question:n,options:o,program_id:r,interactive_until:c,playback_time_ms:l,timeout:u,program_date_time:m,widget_attributes:v,custom_data:R,confirmation_message:k,sponsor_ids:M}})})).then((t=>(ee.widgets[t.id]=t,t)))},createImagePredictionWidget:function(e){return ue(e,["question","programId","options"],"createImagePredictionWidget").then((()=>be())).then((t=>{const{question:n,programId:r,options:o,interactiveUntil:c,playbackTimeMs:l,timeout:u,programDateTime:m,widgetAttributes:v,customData:R,confirmationMessage:k,sponsorIds:M}=e;return K.post({url:t.image_predictions_url,data:{question:n,options:o.map((D=>({description:D.description,image_url:D.imageUrl,reward_item_id:D.rewardItemId,reward_item_amount:D.rewardItemAmount}))),program_id:r,interactive_until:c,playback_time_ms:l,timeout:u,program_date_time:m,widget_attributes:v,custom_data:R,confirmation_message:k,sponsor_ids:M}})})).then((t=>(ee.widgets[t.id]=t,t)))},updateImagePredictionWidgetOption:function(e){return ue(e,["widgetId","optionId"],"updateImagePredictionWidgetOption").then((()=>Xt({id:e.widgetId,kind:se.IMAGE_PREDICTION}))).then((t=>{const{optionId:n,description:r,isCorrect:o,rewardItemId:c,rewardItemAmount:l,imageUrl:u}=e,m=t.options.find((v=>v.id===n));return m?K.patch({url:m.url,data:{description:r,is_correct:o,reward_item_id:c,reward_item_amount:l,image_url:u}}):Promise.reject({message:"Invalid widget option Id"})})).then((t=>{const n=ee.widgets[e.widgetId];return n&&(ee.widgets[e.widgetId]=Object.assign(Object.assign({},n),{options:n.options.map((r=>r.id===t.id?t:r))})),t}))},updateTextPredictionWidgetOption:function(e){return ue(e,["widgetId","optionId"],"updateTextPredictionWidgetOption").then((()=>Xt({id:e.widgetId,kind:se.TEXT_PREDICTION}))).then((t=>{const{optionId:n,description:r,isCorrect:o,rewardItemId:c,rewardItemAmount:l}=e,u=t.options.find((m=>m.id===n));return u?K.patch({url:u.url,data:{description:r,is_correct:o,reward_item_id:c,reward_item_amount:l}}):Promise.reject({message:"Invalid widget option Id"})})).then((t=>{const n=ee.widgets[e.widgetId];return n&&(ee.widgets[e.widgetId]=Object.assign(Object.assign({},n),{options:n.options.map((r=>r.id===t.id?t:r))})),t}))},createPredictionFollowUpWidget:function(e){return ue(e,["widgetId","widgetKind","correctOptionId"],"createPredictionFollowUpWidget",(()=>{if(e.widgetKind!==se.TEXT_PREDICTION&&e.widgetKind!==se.IMAGE_PREDICTION)return`Invalid widget kind, it should be "${se.TEXT_PREDICTION}" or "${se.IMAGE_PREDICTION}".`})).then((()=>Xt({id:e.widgetId,kind:e.widgetKind}))).then((t=>{const{follow_up_url:n}=t;if(!n)return Promise.reject("Invalid widget type, follow_up_url not found");const r=e.widgetKind===se.TEXT_PREDICTION?"text_prediction_id":"image_prediction_id";return K.post({url:n,data:{[r]:e.widgetId,correct_option_id:e.correctOptionId,sponsor_ids:e.sponsorIds}})})).then((t=>{const n=t[sp[t.kind]],r=ee.widgets[n];return r&&(ee.widgets[r.id]=Object.assign(Object.assign({},r),{follow_ups:[t,...r.follow_ups]})),t}))},createImageNumberPredictionWidget:function(e){return ue(e,["question","programId","options"],"createImageNumberPredictionWidget").then((()=>be())).then((t=>{const{question:n,programId:r,options:o,interactiveUntil:c,playbackTimeMs:l,timeout:u,programDateTime:m,widgetAttributes:v,customData:R,confirmationMessage:k,sponsorIds:M}=e;return K.post({url:t.image_number_predictions_url,data:{question:n,options:o.map((D=>({description:D.description,image_url:D.imageUrl}))),program_id:r,interactive_until:c,playback_time_ms:l,timeout:u,program_date_time:m,widget_attributes:v,custom_data:R,confirmation_message:k,sponsor_ids:M}})})).then((t=>(ee.widgets[t.id]=t,t)))},updateImageNumberPredictionWidgetOption:function(e){return ue(e,["widgetId","optionId"],"updateImageNumberPredictionWidgetOption").then((()=>Xt({id:e.widgetId,kind:se.IMAGE_NUMBER_PREDICTION}))).then((t=>{const{optionId:n,description:r,correctNumber:o,rewardItemId:c,rewardItemAmount:l,imageUrl:u}=e,m=t.options.find((v=>v.id===n));return m?K.patch({url:m.url,data:{description:r,correct_number:o,reward_item_id:c,reward_item_amount:l,image_url:u}}):Promise.reject({message:"Invalid widget option Id"})})).then((t=>{const n=ee.widgets[e.widgetId];return n&&(ee.widgets[e.widgetId]=Object.assign(Object.assign({},n),{options:n.options.map((r=>r.id===t.id?t:r))})),t}))},createNumberPredictionFollowUpWidget:function(e){return ue(e,["widgetId","widgetKind"],"createNumberPredictionFollowUpWidget",(()=>{if(e.widgetKind!==se.IMAGE_NUMBER_PREDICTION)return`Invalid widget kind, it should be "${se.IMAGE_NUMBER_PREDICTION}".`})).then((()=>Xt({id:e.widgetId,kind:e.widgetKind}))).then((t=>{const{follow_up_url:n}=t;return n?K.post({url:n,data:{image_number_prediction_id:e.widgetId,sponsor_ids:e.sponsorIds}}):Promise.reject("Invalid widget type, follow_up_url not found")})).then((t=>{const n=t[sp[t.kind]],r=ee.widgets[n];return r&&(ee.widgets[r.id]=Object.assign(Object.assign({},r),{follow_ups:[t,...r.follow_ups]})),t}))},createTextQuizWidget:function(e){return ue(e,["question","programId","choices"],"createTextQuizWidget").then((()=>be())).then((t=>{const{question:n,programId:r,choices:o,interactiveUntil:c,playbackTimeMs:l,timeout:u,programDateTime:m,widgetAttributes:v,customData:R}=e;return K.post({url:t.text_quizzes_url,data:{question:n,choices:o.map((({description:k,isCorrect:M})=>({description:k,is_correct:M}))),program_id:r,interactive_until:c,playback_time_ms:l,timeout:u,program_date_time:m,widget_attributes:v,custom_data:R}})})).then((t=>(ee.widgets[t.id]=t,t)))},createImageQuizWidget:function(e){return ue(e,["question","programId","choices"],"createImageQuizWidget").then((()=>be())).then((t=>{const{question:n,programId:r,choices:o,interactiveUntil:c,playbackTimeMs:l,timeout:u,programDateTime:m,widgetAttributes:v,customData:R}=e;return K.post({url:t.image_quizzes_url,data:{question:n,choices:o.map((k=>({description:k.description,image_url:k.imageUrl,is_correct:k.isCorrect}))),program_id:r,interactive_until:c,playback_time_ms:l,timeout:u,program_date_time:m,widget_attributes:v,custom_data:R}})})).then((t=>(ee.widgets[t.id]=t,t)))},createAlertWidget:function(e){return ue(e,["programId"],"createAlertWidget",(()=>{if(!e.imageUrl&&!e.text)return'Argument object is missing "imageUrl" or "text", either of one is required.'})).then((()=>be())).then((t=>{const{programId:n,title:r,text:o,imageUrl:c,linkLabel:l,linkUrl:u,playbackTimeMs:m,timeout:v,programDateTime:R,widgetAttributes:k,customData:M,sponsorIds:D}=e;return K.post({url:t.alerts_url,data:{program_id:n,title:r,text:o,image_url:c,link_label:l,link_url:u,playback_time_ms:m,timeout:v,program_date_time:R,widget_attributes:k,custom_data:M,sponsor_ids:D}})})).then((t=>(ee.widgets[t.id]=t,t)))},createTextAskWidget:function(e){return ue(e,["programId","title","prompt"],"createTextAskWidget").then((()=>be())).then((t=>{const{programId:n,title:r,prompt:o,confirmationMessage:c,interactiveUntil:l,playbackTimeMs:u,timeout:m,programDateTime:v,widgetAttributes:R,customData:k,sponsorIds:M}=e;return K.post({url:t.text_asks_url,data:{program_id:n,title:r,prompt:o,confirmation_message:c,interactive_until:l,playback_time_ms:u,timeout:m,program_date_time:v,widget_attributes:R,custom_data:k,sponsor_ids:M}})})).then((t=>(ee.widgets[t.id]=t,t)))},getWidget:Xt,publishWidget:function(e){return ue(e,["widgetId","widgetKind"],"publishWidget").then((()=>Xt({id:e.widgetId,kind:e.widgetKind}))).then((t=>K.put({url:t.schedule_url,data:{publish_delay:e.delayDuration,program_date_time:e.programDateTime}})))},deleteWidget:function(e){return ue(e,["widgetId","widgetKind"],"deleteWidget").then((()=>be())).then((t=>{const n=jp(t,e.widgetKind);return K.delete({url:`${n}${e.widgetId}/`})}))},addWidgetListener:(e,t)=>Oi(e.programId).then((n=>Sp.add(n.subscribe_channel,e.programId,t,{message:r=>r.channel===n.subscribe_channel&&t({event:r.message.event,widgetPayload:r.message.payload,programId:e.programId})}))),removeWidgetListener:(e,t)=>Sp.remove(e.programId,t),createChatRoom:e=>e&&e.visibility&&e.visibility!=="members"&&e.visibility!=="everyone"?Promise.reject("Invalid value for visibility"):K.post({url:ee.createChatUrlTemplate,data:e}).then(td),updateChatRoom:(e,t)=>_a({roomId:e}).then((n=>K.patch({url:n.url,data:t}).then(td))),getChatRoom:Gm,joinChatRoom:e=>nd(e,"post"),leaveChatRoom:e=>nd(e,"delete").then(Bv),getChatUserMutedStatus:e=>_a(e).then((t=>fetch(Te(ae.id,t.muted_status_url_template)).then((n=>n.json())))),getChatRoomMemberships:e=>ue(e,["roomId"],"getChatRoomMemberships").then((()=>Pi(e.roomId))).then((t=>{const n=[...Array.isArray(e.profileIds)&&e.profileIds.length?e.profileIds.map((o=>`profile_id=${o}`)):[]].filter(Boolean).join("&"),r=`${t.memberships_url}${n?"?"+n:""}`;return Re(["results"],xe(r,(o=>K.get({url:o})),(o=>({count:o.count,results:o.results}))))})),addNewMemberToChatRoom:function({roomId:e,profileId:t}){return nd({roomId:e},"post",{profile_id:t})},getProfileChatRoomMemberships:e=>{var t;return!((t=e?.profileIds)===null||t===void 0)&&t.length?be().then((n=>{const r=[...e.profileIds.map((c=>`profile_id=${c}`))].join("&"),o=`${n.chat_room_memberships_url}${r?"&"+r:""}`;return Re(["results"],xe(o,(c=>K.get({url:c})),(c=>({count:c.count,results:c.results}))))})):Re(["results"],xe(ae.chat_room_memberships_url,(n=>K.get({url:n})),(n=>({count:n.count,results:n.results}))))},getLeaderboards:e=>ue(e,["programId"],"getLeaderboards").then((()=>Si.program(e.programId).then((t=>t.leaderboards)))),getLeaderboard:e=>ue(e,["leaderboardId"],"getLeaderboard").then((()=>Si.leaderboard(e.leaderboardId))),getLeaderboardEntries:e=>(t=>ue(t,["leaderboardId"],"getPaginatedLeaderboardEntries").then((()=>Si.leaderboard(t.leaderboardId).then((n=>{let r=n.entries_url;return t.profileIds&&t.profileIds.length&&(r+="?",t.profileIds.forEach((o=>{o&&(r+=`profile_id=${o}&`)}))),t.pageSize&&(r+=`?page_size=${t.pageSize}`),xe(r,(o=>K.get({url:o})),(o=>({count:o.count,entries:o.results})))})))))(e).then((t=>Re(["entries"],t))),getLeaderboardProfileRank:e=>ue(e,["leaderboardId","profileId"],"getLeaderboardProfileRank").then((()=>Si.leaderboard(e.leaderboardId).then((t=>Si.leaderboardEntryDetail(t.entry_detail_url_template,e.profileId))))),getProfileLeaderboards:e=>be().then((t=>{var n;return Re(["results"],xe(Te((n=e?.profileId)!==null&&n!==void 0?n:ae.id,t.profile_leaderboards_url_template),(r=>K.get({url:r})),(r=>({count:r.count,results:r.results}))))})),getProfileLeaderboardViews:e=>be().then((t=>{var n;return Re(["results"],xe(Te((n=e?.profileId)!==null&&n!==void 0?n:ae.id,t.profile_leaderboard_views_url_template),(r=>K.get({url:r})),(r=>({count:r.count,results:r.results}))))})),applyLocalization:zm,getWidgetInteractions:bo,getSponsors:e=>(console.warn('getSponsors is depreacted since 2.15.0, use "getProgramSponsors" API instead.'),e&&e.programId?Si.program(e.programId).then((t=>t.sponsors)):Dt("programId","sponsor")),getApplicationSponsors:()=>be().then((e=>{const t=e.sponsors_url;return Re(["results"],xe(t,(n=>K.get({url:n})),(n=>({count:n.count,results:n.results}))))})),getProgramSponsors:e=>ue(e,["programId"],"sponsor").then((()=>Oi(e.programId))).then((t=>{const n=t.sponsors_url;return Re(["results"],xe(n,(r=>K.get({url:r})),(r=>({count:r.count,results:r.results}))))})),getChatRoomSponsors:e=>ue(e,["roomId"],"sponsor").then((()=>Pi(e.roomId))).then((t=>{const n=t.sponsors_url;return Re(["results"],xe(n,(r=>K.get({url:r})),(r=>({count:r.count,results:r.results}))))})),getProfileBadges:e=>e&&e.profileId?(t=>zc(t).then(Hm))(e).then((t=>Re(["results"],t))):Dt("profileId","getProfileBadges"),getApplicationBadges:()=>be().then((e=>Re(["results"],Hm(e)))),getBadgeProgress:e=>e&&e.profileId&&e.badgeIds&&e.badgeIds.length>0?zc(e).then((t=>K.get({url:t.badge_progress_url+"?badge_id="+e.badgeIds.join("&badge_id=")}))):e&&e.profileId?Dt("badgeIds","getBadgeProgress"):Dt("profileId","getBadgeProgress"),getBadgeProfiles:function(e){return ue(e,["badgeId"],"getBadgeProfiles").then((()=>be())).then((t=>Re(["results"],xe(`${t.badge_profiles_url}?badge_id=${e.badgeId}`,(n=>K.get({url:n})),(n=>({count:n.count,results:n.results}))))))},getApplicationRewardItems:e=>be().then((t=>{let n=t.reward_items_url;return e&&e.attributes&&e.attributes.length&&e.attributes.forEach((r=>{n+=`&attributes=${r.key}${Zs}${r.value}`})),Re(["results"],xe(n,(r=>K.get({url:r})),(r=>({count:r.count,results:r.results}))))})),getRewardItemBalances:e=>e&&e.rewardItemIds&&e.rewardItemIds.length>0?K.get({url:ae.reward_item_balances_url+"?reward_item_id="+e.rewardItemIds.join("&reward_item_id=")}):Dt("rewardItemIds","getRewardItemBalances"),transferRewardItemAmount:e=>ue(e,["rewardItemId","amount","recipientProfileId"],"transferRewardItemAmount").then((()=>K.post({url:ae.reward_item_transfer_url,data:{reward_item_id:e.rewardItemId,reward_item_amount:e.amount,recipient_profile_id:e.recipientProfileId}}))),getRewardItemTransfers:e=>{let t=ae.reward_item_transfer_url;return e&&e.transferType&&(t+="?transfer_type="+e.transferType),Re(["results"],xe(t,(n=>K.get({url:n})),(n=>({count:n.count,results:n.results}))))},sendChatRoomInviteToProfile:function(e){return ue(e,["roomId","profileId"],"sendChatRoomInviteToProfile").then((()=>K.post({url:Mc(),data:{chat_room_id:e.roomId,invited_profile_id:e.profileId}})))},updateChatRoomInviteStatus:function(e){return ue(e,["invitationId","invitationStatus"],"updateChatRoomInviteStatus").then((()=>{return K.patch({url:(t=e.invitationId,Te(t,ee.chatRoomInvitationDetailUrlTemplate)),data:{status:e.invitationStatus}});var t}))},getSentChatRoomInvitations:function(e){return ue(e,["invitationStatus"],"getSentChatRoomInvitations").then((()=>{const t=`${Mc()}&invited_by_id=${ae.id}&status=${e.invitationStatus}`;return Re(["results"],xe(t,(n=>K.get({url:n})),(n=>({count:n.count,results:n.results}))))}))},getReceivedChatRoomInvitations:function(e){return ue(e,["invitationStatus"],"getReceivedChatRoomInvitations").then((()=>{const t=`${Mc()}&invited_profile_id=${ae.id}&status=${e.invitationStatus}`;return Re(["results"],xe(t,(n=>K.get({url:n})),(n=>({count:n.count,results:n.results}))))}))},addChatRoomEventListener:function(e,t,n){return Wm(e,n?.roomId).then((r=>{he.addListener(r,t,e),he.subscribe(r)}))},removeChatRoomEventListener:function(e,t,n){return Wm(e,n?.roomId).then((r=>{t?he.removeListener(r,t,e):he.removeAllListenersForEvent(r,e),he.unsubscribe(r)}))},ChatRoomInvitationStatus:vc,ChatRoomEvent:$n,RewardItemTransferType:bc,RewardEvent:fc,addRewardEventListener:function(e,t){he.addListener(ae.subscribe_channel,t,e),he.subscribe(ae.subscribe_channel)},removeRewardEventListener:function(e,t){t?he.removeListener(ae.subscribe_channel,t,e):he.removeAllListenersForEvent(ae.subscribe_channel,e),he.unsubscribe(ae.subscribe_channel)},getRewardTransactions:e=>be().then((t=>{var n,r,o,c,l;let u=t.reward_transactions_url+"?",m=[];return(n=e?.widgetIds)===null||n===void 0||n.forEach((v=>{m.push("widget_id="+v)})),(r=e?.widgetKinds)===null||r===void 0||r.forEach((v=>{m.push("widget_kind="+v)})),(o=e?.profileIds)===null||o===void 0||o.forEach((v=>{m.push("profile_id="+v)})),(c=e?.rewardItemIds)===null||c===void 0||c.forEach((v=>{m.push("reward_item_id="+v)})),(l=e?.rewardActionKeys)===null||l===void 0||l.forEach((v=>{m.push("reward_action_key="+v)})),e&&e.createdSince&&m.push("created_since="+new Date(e.createdSince).toISOString()),e&&e.createdUntil&&m.push("created_until="+new Date(e.createdUntil).toISOString()),u+=m.join("&"),Re(["results"],xe(u,(v=>K.get({url:v})),(v=>({count:v.count,results:v.results}))))})),blockProfile:tm,unblockProfile:nm,getBlockInfoList:function(){return Re(["results"],xe(ae.block_profile_url,(e=>K.get({url:e})),(e=>({count:e.count,results:e.results}))))},getProfileBlockInfo:im,UserProfileEvent:cr,addUserProfileEventListener:Yp,removeUserProfileEventListener:Hc,pinMessage:function(e){return ue(e,["roomId","messageId","messagePayload"],"pinMessage").then((()=>{const t=Lc();return K.post({url:`${t}?chat_room_id=${e.roomId}`,data:{chat_room_id:e.roomId,message_id:e.messageId,message_payload:e.messagePayload}})}))},unpinMessage:function(e){return ue(e,["pinMessageInfoId"],"unpinMessage").then((()=>K.delete({url:`${Lc()}${e.pinMessageInfoId}/`})))},getPinMessageInfoList:function(e){return ue(e,["roomId"],"getPinMessageInfoList").then((()=>{const t=e.orderBy?`&ordering=${Fv[e.orderBy]}`:"",n=`${Lc()}?chat_room_id=${e.roomId}${t}`;return Re(["results"],xe(n,(r=>K.get({url:r})),(r=>({count:r.count,results:r.results}))))}))},redeemKeyById:e=>ue(e,["redemptionKeyId"],"redeemKeyById").then((()=>be().then((t=>K.patch({url:Te(e.redemptionKeyId,t.redemption_key_detail_url_template),data:{status:Js.REDEEMED}}))))),redeemKeyByCode:e=>ue(e,["code"],"redeemKeyByCode").then((()=>be().then((t=>K.patch({url:Te(e.code,t.redemption_key_detail_by_code_url_template),data:{status:Js.REDEEMED}}))))),getRedemptionKeys:e=>be().then((t=>{let n=t.redemption_keys_url;return e?.status&&(n+="&status="+e.status),e?.isAssigned!==void 0&&(n+=`&is_assigned=${e.isAssigned}`),Re(["results"],xe(n,(r=>K.get({url:r})),(r=>({count:r.count,results:r.results}))))})),unassignRedemptionKey:e=>ue(e,["redemptionKeyId"],"unassignRedemptionKey").then((()=>be().then((t=>K.patch({url:Te(e.redemptionKeyId,t.redemption_key_detail_url_template),data:{assigned_to:null}}))))),quoteMessage:Xm,createVideoRoom:function(e){return be().then((t=>{const n={client_id:t.client_id,name:e?.videoRoomName};return K.post({url:t.video_room_url,data:n})}))},getVideoRoom:function(e){return ue(e,["videoRoomId"],"getVideoRoom").then((()=>be())).then((t=>K.get({url:Te(e.videoRoomId,t.video_room_detail_url_template)})))},createReactionSpace:function(e){return ue(e,["targetGroupId","reactionPackIds"],"createReactionSpace").then((()=>be())).then((t=>{const n=t.reaction_spaces_url,{name:r,reactionPackIds:o,targetGroupId:c}=e;return K.post({url:n,data:{name:r,target_group_id:c,reaction_pack_ids:o}})}))},updateReactionSpace:function(e){return ue(e,["reactionSpaceId"],"updateReactionSpace",(()=>{if(!e?.reactionPackIds&&!e?.name)return'Argument object is missing "reactionPackIds" or "name".'})).then((()=>be())).then((t=>{const{name:n,reactionPackIds:r}=e;return K.patch({url:Te(e.reactionSpaceId,t.reaction_space_detail_url_template),data:{name:n,reaction_pack_ids:r}})}))},deleteReactionSpace:function(e){return ue(e,["reactionSpaceId"],"deleteReactionSpace").then((()=>be())).then((t=>K.delete({url:Te(e.reactionSpaceId,t.reaction_space_detail_url_template)})))},getReactionSpaces:function(){return be().then((e=>Re(["results"],xe(`${e.reaction_spaces_url}?client_id=${e.client_id}`,(t=>K.get({url:t})),(t=>({count:t.count,results:t.results}))))))},getReactionSpaceDetail:wa,ReactionSpaceEvent:Ye,addReactionSpaceEventListener:wr,removeReactionSpaceEventListener:Cr,addUserReaction:id,removeUserReaction:rd,getUserReactions:function(e){return ue(e,["reactionSpaceId"],"getUserReactions",(()=>{if(!e?.targetId&&!e?.reactionId)return'Argument object should contain either "targetId" or "reactionId" property.'})).then((()=>{return t=e.reactionSpaceId,Promise.all([be(),Ir(t)]);var t})).then((([{client_id:t},{user_reactions_url:n}])=>{const{targetId:r,reactionId:o,reactionSpaceId:c}=e,l=[`client_id=${t}`,c&&`reaction_space_id=${c}`,r&&`target_id=${r}`,o&&`reaction_id=${o}`].filter(Boolean).join("&");return Re(["results"],xe(`${n}?${l}`,(u=>K.get({url:u})),(u=>({count:u.count,results:u.results}))))}))},getUserReactionsCount:Zm,getReactionPacks:function(){return be().then((e=>Re(["results"],xe(e.reaction_packs_url,(t=>K.get({url:t})),(t=>({count:t.count,results:t.results}))))))},getReactionPackDetail:od,getRewardActions:function(){return be().then((e=>Re(["results"],xe(`${e.reward_actions_url}?client_id=${e.client_id}`,(t=>K.get({url:t})),(t=>({count:t.count,results:t.results}))))))},getInvokedRewardActions:function(e){return be().then((t=>{var n,r,o;let c=[];c.push(`client_id=${t.client_id}`),e?.programId&&c.push(`program_id=${e.programId}`),!((n=e?.rewardActionKeys)===null||n===void 0)&&n.length&&e.rewardActionKeys.forEach((m=>c.push(`reward_action_key=${m}`))),!((r=e?.profileIds)===null||r===void 0)&&r.length&&e.profileIds.forEach((m=>c.push(`profile_id=${m}`))),!((o=e?.attributes)===null||o===void 0)&&o.length&&e.attributes.forEach((m=>{c.push(`attributes=${encodeURIComponent(m.key)}${Zs}${encodeURIComponent(m.value)}`)}));const l=c.length?"?"+c.join("&"):"",u=`${t.invoked_actions_url}${l}`;return Re(["results"],xe(u,(m=>K.get({url:m})),(m=>({count:m.count,results:m.results}))))}))},ConfirmationType:Zt,DEFAULT_CONFIRM_ACTIONS:ag,createCommentBoard:function(e){return be().then((t=>{const n=t.comment_boards_url,{customId:r,title:o,allowComments:c,repliesDepth:l,description:u,customData:m,contentFilter:v}=e??{};return K.post({url:n,data:{title:o,custom_id:r,replies_depth:l,allow_comments:c,description:u,custom_data:m,content_filter:v}})}))},updateCommentBoard:function(e){return ue(e,["commentBoardId"],"updateCommentBoard").then((()=>be())).then((t=>{const{commentBoardId:n,customId:r,title:o,allowComments:c,repliesDepth:l,description:u,customData:m,contentFilter:v}=e,R=Te(n,t.comment_board_detail_url_template);return K.patch({url:R,data:{title:o,custom_id:r,replies_depth:l,allow_comments:c,description:u,custom_data:m,content_filter:v}})}))},deleteCommentBoard:function(e){return ue(e,["commentBoardId"],"deleteCommentBoard").then((()=>be())).then((t=>K.delete({url:Te(e.commentBoardId,t.comment_board_detail_url_template)})))},getCommentBoards:function(){return be().then((e=>Re(["results"],xe(`${e.comment_boards_url}?client_id=${e.client_id}`,(t=>K.get({url:t})),(t=>({count:t.count,results:t.results}))))))},getCommentBoardDetails:Jm,createCommentBoardBan:function(e){return ue(e,["profileId"],"createCommentBoardBan").then((()=>be())).then((t=>{const n=t.comment_board_ban_url,{profileId:r,commentBoardId:o,description:c}=e;return K.post({url:n,data:{profile_id:r,comment_board_id:o,description:c}})}))},getCommentBoardBans:function(e){return be().then((t=>{const n=t.comment_board_ban_url,r=[];e?.profileId&&r.push(`profile_id=${e.profileId}`),e?.commentBoardId&&r.push(`comment_board_id=${e.commentBoardId}`);const o=r.length?"?"+r.join("&"):"";return Re(["results"],xe(`${n}${o}`,(c=>K.get({url:c})),(c=>({count:c.count,results:c.results}))))}))},getCommentBoardBan:function(e){return ue(e,["commentBoardBanId"],"getCommentBoardBan").then((()=>be())).then((t=>K.get({url:Te(e.commentBoardBanId,t.comment_board_ban_detail_url_template)})))},deleteCommentBoardBan:function(e){return ue(e,["commentBoardBanId"],"deleteCommentBoardBan").then((()=>be())).then((t=>K.delete({url:Te(e.commentBoardBanId,t.comment_board_ban_detail_url_template)})))},addComment:Ym,addCommentReply:eg,getComments:ng,getCommentReplies:ig,deleteComment:sd,editComment:function(e){return ue(e,["commentBoardId","commentId"],"editComment").then((()=>qn(e.commentBoardId))).then((t=>{const n=Te(e.commentId,t.comment_detail_url_template),{text:r,commentBoardId:o,customData:c}=e;return K.patch({url:n,data:{text:r,custom_data:c,comment_board_id:o}})}))},CommentSort:Nn,getComment:tg,getProfileRelationshipTypes:function(){return be().then((e=>Re(["results"],xe(`${e.profile_relationship_types_url}`,(t=>K.get({url:t})),(t=>({count:t.count,results:t.results}))))))},getProfileRelationships:function(e){return be().then((t=>{let n=[];e?.relationshipTypeKey&&n.push(`relationship_type_key=${e.relationshipTypeKey}`),e?.fromProfileId&&n.push(`from_profile_id=${e.fromProfileId}`),e?.toProfileId&&n.push(`to_profile_id=${e.toProfileId}`);const r=n.length?"&"+n.join("&"):"",o=`${t.profile_relationships_url}${r}`;return Re(["results"],xe(o,(c=>K.get({url:c})),(c=>({count:c.count,results:c.results}))))}))},createProfileRelationship:function(e){return ue(e,["fromProfileId","toProfileId","relationshipTypeKey"],"createProfileRelationship").then((()=>be())).then((t=>{const n=t.profile_relationships_url,{fromProfileId:r,toProfileId:o,relationshipTypeKey:c}=e;return K.post({url:n,data:{client_id:t.client_id,relationship_type_key:c,from_profile_id:r,to_profile_id:o}})}))},deleteProfileRelationship:function(e){return ue(e,["relationshipId"],"deleteProfileRelationship").then((()=>be())).then((t=>K.delete({url:Te(e.relationshipId,t.profile_relationship_detail_url_template)})))},getProfileRelationshipDetails:e=>ue(e,["relationshipId"],"getProfileRelationshipDetails").then((()=>be())).then((t=>K.get({url:Te(e.relationshipId,t.profile_relationship_detail_url_template)}))),getTokenGatedChatRoomAccessDetails:({walletAddress:e,roomId:t})=>ue({walletAddress:e,roomId:t},["walletAddress","roomId"],"getTokenGatedChatRoomAccessDetails").then((()=>Gm({roomId:t}))).then((({token_gates:n,chatroom_token_gate_access_url_template:r})=>{const o={chat_room_id:t,access:go.DISALLOWED,details:"",wallet_details:{wallet_address:e,contract_balances:null}};return n.length===0?qm(Object.assign(Object.assign({},o),{access:go.ALLOWED,details:"Chat room is not token gated."})):r?K.get({url:Te(e,r)}):qm(Object.assign(Object.assign({},o),{details:"Token gating access url not found."}))})),ChatRoomAccessStatus:go,PresenceActionEvent:yc,createCommentReport:rg,getCommentReport:function(e){return ue(e,["commentReportId"],"getCommentReport").then((()=>be())).then((t=>K.get({url:Te(e.commentReportId,t.comment_report_detail_url_template)})))},getCommentReports:og,dismissCommentReport:function(e){return ue(e,["commentReportId"],"dismissCommentReport").then((()=>be())).then((t=>K.patch({url:Te(e.commentReportId,t.comment_report_detail_url_template),data:{report_status:"dismissed"}})))},dismissAllCommentReports:function(e){return ue(e,["commentBoardId","commentId"],"dismissCommentReport").then((()=>qn(e.commentBoardId))).then((t=>K.patch({url:Te(e.commentId,t.dismiss_reported_comment_url_template),data:{report_status:"dismissed"}})))},deleteCommentReport:sg,CommentReportStatus:Ys,BlockchainNetworkType:_c,BlockchainTokenType:wc,getSmartContracts:()=>be().then((e=>Re(["results"],xe(e.saved_contract_addresses_url,(t=>K.get({url:t})),(t=>({count:t.count,results:t.results})))))),commentController:fe,bannerController:Gn,reactionPackController:Wn,reactionSpaceController:$o,userReactionController:kt});window.LiveLike=Zo,window.ProgramDateTimeSyncStrategy=Fp,window.HlsJsSyncStrategy=py,window.html=I,window.property=C,window.LitElement=je,window.LiveLikeWidgetElement=Vp,window.LiveLikeWidget=Nc,window.LiveLikeWidgetMixin=dy,window.LiveLikePoll=Fo,window.LiveLikeQuiz=vd,window.LiveLikePrediction=gd,window.LiveLikeFollowUp=fd,window.LiveLikeAlert=Zn,window.LiveLikeEmojiSlider=Pr,window.LiveLikeSocialEmbed=md,window.LiveLikeRichPost=Ta,window.LiveLikeCheerMeter=Bo,window.LiveLikeVideoAlert=Cn,window.LiveLikeDescription=La,window.LiveLikeDismissButton=bd,window.LiveLikeImage=Ui,window.LiveLikeOption=Et,window.LiveLikePercentage=_d,window.LiveLikeProgress=zo,window.LiveLikeSelect=$a,window.LiveLikeTimer=Ho,window.LiveLikeTitle=Va,window.LiveLikeVoteCount=qo,window.LiveLikeWidgetBody=Id,window.LiveLikeWidgetBylines=kd,window.LiveLikeWidgetFooter=Ed,window.LiveLikeWidgetHeader=Sd,window.LiveLikeWidgetRoot=Pd,window.LiveLikeSponsor=Mo,window.LiveLikeDuelingProgress=Da,window.LiveLikeTextAsk=Jn,window.LiveLikeVideo=ct,window.LiveLikeNumberPrediction=Ma,window.LiveLikeNumberFollowUp=yd,window.LiveLikeComments=Ft,window.LiveLikeComments=Ft,window.LiveLikeCommentBoardHeader=tn,window.LiveLikeCommentList=ii,window.LiveLikeReplyList=nn,window.LiveLikeCommentComposer=zt,window.LiveLikeCommentEmpty=Wo,window.LiveLikeCommentItem=xr,window.LiveLikeCommentHeader=rn,window.LiveLikeCommentBody=Fi,window.LiveLikeCommentFooter=si,window.LiveLikeCommentMenu=ai,window.LiveLikeCommentReplyCountPreview=Tr,window.LiveLikeReaction=on,window.LiveLikeEmbedReaction=xd;class Vg{constructor(t){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,t?.roundAverageSize===!0&&(this._roundAverageSize=!0)}set(t,n){const r=this._map.get(t)||0;this._map.set(t,n),this.totalSize+=n-r}get averageSize(){if(this._map.size>0){const t=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(t):t}return 0}getSize(t){return this._map.get(t)}clear(){this._map.clear(),this.totalSize=0}}function Dg(e){return e==="horizontal"?"width":"height"}class Zb{_getDefaultConfig(){return{direction:"vertical"}}constructor(t,n){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=t,Promise.resolve().then((()=>this.config=n||this._getDefaultConfig()))}set config(t){Object.assign(this,Object.assign({},this._getDefaultConfig(),t))}get config(){return{direction:this.direction}}get items(){return this._items}set items(t){this._setItems(t)}_setItems(t){t!==this._items&&(this._items=t,this._scheduleReflow())}get direction(){return this._direction}set direction(t){(t=t==="horizontal"?t:"vertical")!==this._direction&&(this._direction=t,this._sizeDim=t==="horizontal"?"width":"height",this._secondarySizeDim=t==="horizontal"?"height":"width",this._positionDim=t==="horizontal"?"left":"top",this._secondaryPositionDim=t==="horizontal"?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(t){const{_viewDim1:n,_viewDim2:r}=this;Object.assign(this._viewportSize,t),r!==this._viewDim2?this._scheduleLayoutUpdate():n!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(t){Object.assign(this._latestCoords,t);const n=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim],Math.abs(n-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(t=!1){(t||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(t){this._pin=t,this._triggerReflow()}get pin(){if(this._pin!==null){const{index:t,block:n}=this._pin;return{index:Math.max(0,Math.min(t,this.items.length-1)),block:n}}return null}_clampScrollPosition(t){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(t,this.totalScrollSize[Dg(this.direction)]-this._viewDim1))}unpin(){this._pin!==null&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then((()=>this.reflowIfNeeded()))}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(this.pin!==null){const t=this._scrollPosition,{index:n,block:r}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:n,block:r||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=t-this._scrollPosition}}_calculateScrollIntoViewPosition(t){const{block:n}=t,r=Math.min(this.items.length,Math.max(0,t.index)),o=this._getItemPosition(r)[this._positionDim];let c=o;if(n!=="start"){const l=this._getItemSize(r)[this._sizeDim];if(n==="center")c=o-.5*this._viewDim1+.5*l;else{const u=o-this._viewDim1+l;if(n==="end")c=u;else{const m=this._scrollPosition;c=Math.abs(m-o)<Math.abs(m-u)?o:u}}}return c+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(c)}getScrollIntoViewCoordinates(t){return{[this._positionDim]:this._calculateScrollIntoViewPosition(t)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const t=new Map;if(this._first!==-1&&this._last!==-1)for(let r=this._first;r<=this._last;r++)t.set(r,this._getItemPosition(r));const n={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:t};this._scrollError&&(n.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(n)}get _num(){return this._first===-1||this._last===-1?0:this._last-this._first+1}_checkThresholds(){if(this._viewDim1===0&&this._num>0||this._pin!==null)this._scheduleReflow();else{const t=Math.max(0,this._scrollPosition-this._overhang),n=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>t||this._physicalMax<n?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(t){if(this._first===-1||this._last===-1)return;let n=this._first;for(;n<this._last&&Math.round(this._getItemPosition(n)[this._positionDim]+this._getItemSize(n)[this._sizeDim])<=Math.round(this._scrollPosition);)n++;let r=this._last;for(;r>this._first&&Math.round(this._getItemPosition(r)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)r--;n===this._firstVisible&&r===this._lastVisible||(this._firstVisible=n,this._lastVisible=r,t&&t.emit&&this._sendVisibilityChangedMessage())}}function Ng(e){return e==="horizontal"?"marginLeft":"marginTop"}function Jb(e){return e==="horizontal"?"marginRight":"marginBottom"}function Yb(e,t){const n=[e,t].sort();return n[1]<=0?Math.min(...n):n[0]>=0?Math.max(...n):n[0]+n[1]}class e2{constructor(){this._childSizeCache=new Vg,this._marginSizeCache=new Vg,this._metricsCache=new Map}update(t,n){const r=new Set;Object.keys(t).forEach((o=>{const c=Number(o);this._metricsCache.set(c,t[c]),this._childSizeCache.set(c,t[c][Dg(n)]),r.add(c),r.add(c+1)}));for(const o of r){const c=this._metricsCache.get(o)?.[Ng(n)]||0,l=this._metricsCache.get(o-1)?.[Jb(n)]||0;this._marginSizeCache.set(o,Yb(c,l))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(t,n){return this._metricsCache.get(t)?.[Ng(n)]||0}getChildSize(t){return this._childSizeCache.getSize(t)}getMarginSize(t){return this._marginSizeCache.getSize(t)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}var t2=Object.freeze({__proto__:null,FlowLayout:class extends Zb{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new e2,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(e){this._metricsCache.update(e,this.direction),this._scheduleReflow()}_getPhysicalItem(e){return this._newPhysicalItems.get(e)??this._physicalItems.get(e)}_getSize(e){return this._getPhysicalItem(e)&&this._metricsCache.getChildSize(e)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(e){const t=this._metricsCache;if(this._first===-1||this._last===-1)return t.averageMarginSize+e*(t.averageMarginSize+this._getAverageSize());if(e<this._first){const n=this._first-e;return this._getPhysicalItem(this._first).pos-(t.getMarginSize(this._first-1)||t.averageMarginSize)-(n*t.averageChildSize+(n-1)*t.averageMarginSize)}{const n=e-this._last;return this._getPhysicalItem(this._last).pos+(t.getChildSize(this._last)||t.averageChildSize)+(t.getMarginSize(this._last)||t.averageMarginSize)+n*(t.averageChildSize+t.averageMarginSize)}}_getPosition(e){const t=this._getPhysicalItem(e),{averageMarginSize:n}=this._metricsCache;return e===0?this._metricsCache.getMarginSize(0)??n:t?t.pos:this._estimatePosition(e)}_calculateAnchor(e,t){return e<=0?0:t>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((e+t)/2/this._delta)))}_getAnchor(e,t){if(this._physicalItems.size===0)return this._calculateAnchor(e,t);if(this._first<0)return this._calculateAnchor(e,t);if(this._last<0)return this._calculateAnchor(e,t);const n=this._getPhysicalItem(this._first),r=this._getPhysicalItem(this._last),o=n.pos;if(r.pos+this._metricsCache.getChildSize(this._last)<e)return this._calculateAnchor(e,t);if(o>t)return this._calculateAnchor(e,t);let c=this._firstVisible-1,l=-1/0;for(;l<e;)l=this._getPhysicalItem(++c).pos+this._metricsCache.getChildSize(c);return c}_getActiveItems(){this._viewDim1===0||this.items.length===0?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const e=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=e,this._stable=!0}_getItems(){const e=this._newPhysicalItems;let t,n;if(this._stable=!0,this.pin!==null){const{index:m}=this.pin;this._anchorIdx=m,this._anchorPos=this._getPosition(m)}if(t=this._scrollPosition-this._overhang,n=this._scrollPosition+this._viewDim1+this._overhang,n<0||t>this._scrollSize)return void this._clearItems();this._anchorIdx!==null&&this._anchorPos!==null||(this._anchorIdx=this._getAnchor(t,n),this._anchorPos=this._getPosition(this._anchorIdx));let r=this._getSize(this._anchorIdx);r===void 0&&(this._stable=!1,r=this._getAverageSize());const o=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,c=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;this._anchorIdx===0&&(this._anchorPos=o),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-c-r);let l=0;for(this._anchorPos+r+c<t&&(l=t-(this._anchorPos+r+c)),this._anchorPos-o>n&&(l=n-(this._anchorPos-o)),l&&(this._scrollPosition-=l,t-=l,n-=l,this._scrollError+=l),e.set(this._anchorIdx,{pos:this._anchorPos,size:r}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-o,this._physicalMax=this._anchorPos+r+c;this._physicalMin>t&&this._first>0;){let m=this._getSize(--this._first);m===void 0&&(this._stable=!1,m=this._getAverageSize());let v=this._metricsCache.getMarginSize(this._first);v===void 0&&(this._stable=!1,v=this._metricsCache.averageMarginSize),this._physicalMin-=m;const R=this._physicalMin;if(e.set(this._first,{pos:R,size:m}),this._physicalMin-=v,this._stable===!1&&this._estimate===!1)break}for(;this._physicalMax<n&&this._last<this.items.length-1;){let m=this._getSize(++this._last);m===void 0&&(this._stable=!1,m=this._getAverageSize());let v=this._metricsCache.getMarginSize(this._last);v===void 0&&(this._stable=!1,v=this._metricsCache.averageMarginSize);const R=this._physicalMax;if(e.set(this._last,{pos:R,size:m}),this._physicalMax+=m+v,!this._stable&&!this._estimate)break}const u=this._calculateError();u&&(this._physicalMin-=u,this._physicalMax-=u,this._anchorPos-=u,this._scrollPosition-=u,e.forEach((m=>m.pos-=u)),this._scrollError+=u),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=e)}_calculateError(){return this._first===0?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){const{_first:e,_last:t}=this;super._reflow(),(this._first===-1&&this._last==-1||this._first===e&&this._last===t)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){const{averageMarginSize:e}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(e+this._getAverageSize())+e)}get _delta(){const{averageMarginSize:e}=this._metricsCache;return this._getAverageSize()+e}_getItemPosition(e){return{[this._positionDim]:this._getPosition(e),[this._secondaryPositionDim]:0,[(t=this.direction,t==="horizontal"?"xOffset":"yOffset")]:-(this._metricsCache.getLeadingMarginValue(e,this.direction)??this._metricsCache.averageMarginSize)};var t}_getItemSize(e){return{[this._sizeDim]:this._getSize(e)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}}),n2=Object.defineProperty,i2=Object.getOwnPropertyDescriptor,Jo=(e,t,n,r)=>{for(var o=r>1?void 0:r?i2(t,n):t,c=e.length-1,l;c>=0;c--)(l=e[c])&&(o=(r?l(t,n,o):l(o))||o);return r&&o&&n2(t,n,o),o};let Vr=class extends nr{constructor(){super(...arguments),this.range={min:0,max:10,step:1},this.value=0,this.disabled=!1,this.hasInteracted=!1,this.center=98.5,this.radius=93.5,this.onMouseDown=e=>{this.disableScroll(),this.updateValue(e),window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onMouseUp)},this.onMouseUp=()=>{this.enableScroll(),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp)},this.onTouchStart=e=>{this.disableScroll(),this.updateValue(e.touches[0]),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd)},this.onTouchMove=e=>{e.preventDefault(),this.updateValue(e.touches[0])},this.onTouchEnd=()=>{this.enableScroll(),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},this.onMouseMove=e=>{this.updateValue(e)},this.getDisplayScoreValue=(e,t)=>t?e:"-"}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.value===-1?(this.hasInteracted=!1,this.value=Number(this.range.min)):this.hasInteracted=!0}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd),this.enableScroll()}render(){let e;this.range&&(e=this.valueToAngle(this.value));const[t,n]=this.angleToCoordinates(e||0);return _s`
|
|
1217
|
+
<svg
|
|
1218
|
+
width="197"
|
|
1219
|
+
height="197"
|
|
1220
|
+
@mousedown="${!this.disabled&&this.onMouseDown}"
|
|
1221
|
+
@touchstart="${!this.disabled&&this.onTouchStart}"
|
|
1222
|
+
>
|
|
1223
|
+
<circle
|
|
1224
|
+
class="slider-background"
|
|
1225
|
+
style="stroke: #F8F4F1"
|
|
1226
|
+
cx="${this.center}"
|
|
1227
|
+
cy="${this.center}"
|
|
1228
|
+
r="${this.radius}"
|
|
1229
|
+
stroke-width="15.175"
|
|
1230
|
+
/>
|
|
1231
|
+
<path
|
|
1232
|
+
class="slider-progress"
|
|
1233
|
+
style="stroke: #00E8DA;"
|
|
1234
|
+
d="${this.describeArc(this.center,this.center,this.radius,1,e||1)}"
|
|
1235
|
+
stroke-width="15.175"
|
|
1236
|
+
stroke-linecap="round"
|
|
1237
|
+
/>
|
|
1238
|
+
<circle
|
|
1239
|
+
class="slider-handle"
|
|
1240
|
+
style="fill: #225696;"
|
|
1241
|
+
cx="${t}"
|
|
1242
|
+
cy="${n}"
|
|
1243
|
+
r="15"
|
|
1244
|
+
/>
|
|
1245
|
+
<text
|
|
1246
|
+
class="slider-value"
|
|
1247
|
+
style="fill: #02235C;"
|
|
1248
|
+
x="${this.center}"
|
|
1249
|
+
y="${this.center}"
|
|
1250
|
+
text-anchor="middle"
|
|
1251
|
+
dominant-baseline="central"
|
|
1252
|
+
>
|
|
1253
|
+
${this.getDisplayScoreValue(this.value,this.hasInteracted)}
|
|
1254
|
+
</text>
|
|
1255
|
+
</svg>
|
|
1256
|
+
`}valueToAngle(e){return(e-Number(this.range.min))/(Number(this.range.max)-Number(this.range.min))*360}angleToCoordinates(e){const t=(e-90)*(Math.PI/180);return[this.center+this.radius*Math.cos(t),this.center+this.radius*Math.sin(t)]}describeArc(e,t,n,r,o){const c=this.angleToCoordinates(r),l=this.angleToCoordinates(o),u=o-r<=180?0:1;return`M ${c[0]} ${c[1]} A ${n} ${n} 0 ${u} 1 ${l[0]} ${l[1]}`}disableScroll(){const e=document.getElementById("ll-predictor-game-scroll");e&&(e.style.overflow="hidden",e.style.touchAction="none")}enableScroll(){const e=document.getElementById("ll-predictor-game-scroll");e&&(e.style.overflow="",e.style.touchAction="")}updateValue(e){this.hasInteracted=!0;const t=this.getBoundingClientRect(),n=e.clientX-t.left-this.center,r=e.clientY-t.top-this.center;let o=Math.atan2(r,n)*(180/Math.PI)+90;o<0&&(o+=360);const c=o/360;let l=Number(this.range.min)+c*(this.range.max-this.range.min);l=Math.round(l/this.range.step)*this.range.step,this.value=Math.min(Math.max(l,this.range.min),this.range.max),this.dispatchEvent(new CustomEvent("change",{detail:this.value}))}};Jo([pn({type:Object})],Vr.prototype,"range",2),Jo([pn({type:Number})],Vr.prototype,"value",2),Jo([pn()],Vr.prototype,"disabled",2),Jo([Cs()],Vr.prototype,"hasInteracted",2),Vr=Jo([Nu("sa-circular-slider")],Vr);var r2=Object.defineProperty,o2=Object.getOwnPropertyDescriptor,kn=(e,t,n,r)=>{for(var o=r>1?void 0:r?o2(t,n):t,c=e.length-1,l;c>=0;c--)(l=e[c])&&(o=(r?l(t,n,o):l(o))||o);return r&&o&&r2(t,n,o),o};Je.CircularPredictor=class extends nr{constructor(){super(...arguments),this.widgetid="",this.isFollowupPublished=!1,this.hasInteracted=!1,this.isUserCorrect=!1,this.range={min:0,max:10,step:1},this.handleSliderChange=t=>{this.widgetValue=t.detail},this.handleSubmitButtonClicked=async()=>{const t=this.widgetPayload.options.find(n=>Number(n.description)===this.widgetValue);try{const n=await Zo.createWidgetInteraction({widgetId:this.widgetPayload.id,widgetKind:this.widgetPayload.kind,interactionItem:t})}catch(n){console.log("Error while Submitting response",n)}this.hasInteracted=!0,this.interactedValue=this.widgetValue}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.initializeWidget()}async initializeWidget(){try{this.widgetPayload=await Zo.getWidget({id:this.widgetid,kind:"text-prediction"}),this.isFollowupPublished=this.widgetPayload.follow_ups[0].status==="published";const t=await Zo.getWidgetsInteractions({programId:this.widgetPayload.program_id,widgets:[{kind:this.widgetPayload.kind,id:this.widgetPayload.id}]});this.hasInteracted=Object.keys(t).length>0,this.hasInteracted&&(this.isUserCorrect=t[this.widgetPayload.kind][0].is_correct===!0,this.interactedValue=Number(this.widgetPayload.options.find(n=>n.id===t[this.widgetPayload.kind][0].option_id)?.description)),this.setWidgetRange()}catch(t){console.log("Error while widget initializing",t)}}setWidgetRange(){const t=Number(this.widgetPayload.options[0].description),n=Number(this.widgetPayload.options[1].description),r=this.widgetPayload.options.length,o=n-t;this.range={min:t,max:t+o*(r-1),step:o}}renderWidgetText(){return this.isFollowupPublished?this.hasInteracted?this.isUserCorrect?"Correct!":"Incorrect!":"Missed!":this.hasInteracted?_s`<button class="predictor-footer-buton disabled">
|
|
1257
|
+
Submitted
|
|
1258
|
+
</button>`:_s`<button
|
|
1259
|
+
class="predictor-footer-buton ${this.widgetValue!==void 0?"":"disabled"}"
|
|
1260
|
+
@click=${this.handleSubmitButtonClicked}
|
|
1261
|
+
>
|
|
1262
|
+
Submit
|
|
1263
|
+
</button>`}render(){return _s`
|
|
1264
|
+
<div class="title-container">${this.widgetPayload?.question}</div>
|
|
1265
|
+
<sa-circular-slider
|
|
1266
|
+
.range=${this.range}
|
|
1267
|
+
.value=${this.hasInteracted?this.interactedValue:0}
|
|
1268
|
+
@change=${this.handleSliderChange}
|
|
1269
|
+
.disabled=${this.isFollowupPublished||this.hasInteracted}
|
|
1270
|
+
.hasInteracted=${this.hasInteracted}
|
|
1271
|
+
></sa-circular-slider>
|
|
1272
|
+
<div class="widget-footer">${this.renderWidgetText()}</div>
|
|
1273
|
+
`}},kn([pn({type:Object})],Je.CircularPredictor.prototype,"widgetPayload",2),kn([pn({type:String})],Je.CircularPredictor.prototype,"widgetid",2),kn([Cs()],Je.CircularPredictor.prototype,"isFollowupPublished",2),kn([Cs()],Je.CircularPredictor.prototype,"hasInteracted",2),kn([Cs()],Je.CircularPredictor.prototype,"isUserCorrect",2),kn([pn({type:Number})],Je.CircularPredictor.prototype,"widgetValue",2),kn([pn({type:Number})],Je.CircularPredictor.prototype,"interactedValue",2),kn([pn({type:Object})],Je.CircularPredictor.prototype,"range",2),Je.CircularPredictor=kn([Nu("circular-predictor")],Je.CircularPredictor);var s2=Object.defineProperty,a2=(e,t,n,r)=>{for(var o=void 0,c=e.length-1,l;c>=0;c--)(l=e[c])&&(o=l(t,n,o)||o);return o&&s2(t,n,o),o};const l2=window.html;class Ug extends Et{constructor(){super(...arguments),this.setOptionSelected=()=>{},this.optionSelected=()=>{this.disabled||(this.parentElement.querySelectorAll("image-poll-option").forEach(t=>{t!==this&&(t.selected=!1)}),this.selected=!0,this.setOptionSelected(this.item))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.optionSelected)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.optionSelected)}render(){return l2`
|
|
1274
|
+
<livelike-image height="48px" width="48px"></livelike-image>
|
|
1275
|
+
<div class="livelike-voting-image-container">
|
|
1276
|
+
<div class="image-description-wrapper">
|
|
1277
|
+
<livelike-description></livelike-description>
|
|
1278
|
+
</div>
|
|
1279
|
+
</div>
|
|
1280
|
+
<livelike-percentage></livelike-percentage>
|
|
1281
|
+
`}}a2([window.property({type:Function})],Ug.prototype,"setOptionSelected"),customElements.define("image-poll-option",Ug);var c2=Object.defineProperty,Ad=(e,t,n,r)=>{for(var o=void 0,c=e.length-1,l;c>=0;c--)(l=e[c])&&(o=l(t,n,o)||o);return o&&c2(t,n,o),o};const ja=window.html,d2={};class Ba extends Fo{constructor(){super(...arguments),this.optionSelected={},this.isExpired=!1,this.isUserInteracted=!1,this.setOptionSelected=t=>{this.disabled||(this.optionSelected=t)},this.submitVote=t=>{!this.disabled&&t.id!==this.selectedOption.id&&(this.updateVoteCount(t),this.selectedOption=t,this.interactionEvent())},this.lockInVote=()=>{!this.disabled&&this.optionSelected?.id&&(this.voteDisable=!0,this.submitVote(this.optionSelected),this.createVote(this.optionSelected.vote_url).then(()=>{this.disabled=!0,this.isUserInteracted=!0}))}}connectedCallback(){super.connectedCallback(),this.isUserInteracted=!!this.interaction;const t=this.widgetPayload?.interactive_until;this.isExpired=t?Date.now()>new Date(t).getTime():!1}firstUpdated(){super.firstUpdated(),this.updateComplete.then(()=>{this.interaction&&(this.disabled=!0,this.isUserInteracted=!0)}),this.addEventListener("prediction",t=>{d2[t.detail.widget.id]={option_id:t.detail.prediction.option_id,claim_token:t.detail.prediction.claim_token}})}render(){const t=()=>this.isUserInteracted?ja`
|
|
1282
|
+
<livelike-select>
|
|
1283
|
+
<template>
|
|
1284
|
+
<livelike-option>
|
|
1285
|
+
<livelike-image height="48px" width="48px"></livelike-image>
|
|
1286
|
+
<div class="livelike-voting-image-container">
|
|
1287
|
+
<div class="image-description-wrapper">
|
|
1288
|
+
<livelike-description></livelike-description>
|
|
1289
|
+
</div>
|
|
1290
|
+
<livelike-percentage></livelike-percentage>
|
|
1291
|
+
</div>
|
|
1292
|
+
<livelike-progress></livelike-progress>
|
|
1293
|
+
</livelike-option>
|
|
1294
|
+
</template>
|
|
1295
|
+
</livelike-select>
|
|
1296
|
+
`:ja`
|
|
1297
|
+
<livelike-select>
|
|
1298
|
+
<template>
|
|
1299
|
+
<image-poll-option .setOptionSelected=${this.setOptionSelected}>
|
|
1300
|
+
</image-poll-option>
|
|
1301
|
+
</template>
|
|
1302
|
+
</livelike-select>
|
|
1303
|
+
`,n=()=>this.isExpired?this.interaction?"Submitted":"Expired":this.disabled?"Submitted":"Submit",r=()=>ja`
|
|
1304
|
+
<livelike-footer>
|
|
1305
|
+
<button
|
|
1306
|
+
?notInteractedExpire=${this.isExpired&&!this.isUserInteracted}
|
|
1307
|
+
?interactedExpire=${this.isExpired&&this.isUserInteracted}
|
|
1308
|
+
class=${`widget-button ${this.isExpired?"widget-expired":this.optionSelected?.id?"option-selected":""}`}
|
|
1309
|
+
@click=${this.lockInVote}
|
|
1310
|
+
?disabled=${this.disabled}
|
|
1311
|
+
>
|
|
1312
|
+
${n()}
|
|
1313
|
+
</button>
|
|
1314
|
+
</livelike-footer>
|
|
1315
|
+
`;return ja`
|
|
1316
|
+
<template kind="image-poll">
|
|
1317
|
+
<livelike-widget-root class="custom-widget">
|
|
1318
|
+
<livelike-widget-header class="widget-header" slot="header">
|
|
1319
|
+
<livelike-title class="custom-title"></livelike-title>
|
|
1320
|
+
</livelike-widget-header>
|
|
1321
|
+
<livelike-widget-body>
|
|
1322
|
+
${t()} ${r()}
|
|
1323
|
+
</livelike-widget-body>
|
|
1324
|
+
</livelike-widget-root>
|
|
1325
|
+
</template>
|
|
1326
|
+
`}}Ad([window.property({type:Object})],Ba.prototype,"optionSelected"),Ad([window.property({type:Boolean})],Ba.prototype,"isExpired"),Ad([window.property({type:Boolean})],Ba.prototype,"isUserInteracted"),customElements.define("image-poll",Ba);const u2=window.html;class h2 extends Vp{constructor(){super(...arguments),this.votePercentage=()=>{const t=this.items.reduce((n,r)=>n+r.vote_count,0);return t>0?Math.round(this.item.vote_count/t*100):0},this.optionVoteUpdated=()=>{const t=this.shadowRoot.querySelector("livelike-image");t&&t.style.setProperty("background",`linear-gradient(0deg, #0096ff ${this.votePercentage()}%, transparent 0)`)}}createRenderRoot(){return this}render(){return u2`
|
|
1327
|
+
<style>
|
|
1328
|
+
livelike-image {
|
|
1329
|
+
height="48px"
|
|
1330
|
+
width="48px"
|
|
1331
|
+
padding: 10px;
|
|
1332
|
+
|
|
1333
|
+
border-radius: 6px;
|
|
1334
|
+
}
|
|
1335
|
+
livelike-image img {
|
|
1336
|
+
border-radius: 4px;
|
|
1337
|
+
}
|
|
1338
|
+
</style>
|
|
1339
|
+
<div
|
|
1340
|
+
style="background: linear-gradient(0deg, #00E8DA ${this.votePercentage()}%, #F8F4F1 0);"
|
|
1341
|
+
class="cheer-image-container"
|
|
1342
|
+
>
|
|
1343
|
+
<livelike-image
|
|
1344
|
+
height="48px"
|
|
1345
|
+
width="48px"
|
|
1346
|
+
class="cheer-image"
|
|
1347
|
+
></livelike-image>
|
|
1348
|
+
</div>
|
|
1349
|
+
`}}customElements.define("cheer-option",h2);class p2 extends qo{updated(t){t.forEach((n,r)=>{r==="count"&&n>this.count&&(this.count=n)})}}customElements.define("vote-count",p2);const jg=window.html,Bg=window.LiveLikeCheerMeter;class m2 extends Bg{constructor(){super(...arguments),this.widgetInteractedCallback=t=>{const{widget:n,element:r,item:o}=t.detail,c=o.id,l=r.widgetPayload;r.widgetPayload={...l};const u=n.options.findIndex(R=>R.id===c);u!==-1&&(n.options[u].vote_count+=1);const m=[...n.options];r.options=m;const v=m.reduce((R,k)=>R+k.vote_count,0);r.count=v}}connectedCallback(){console.log("Cheer Meter connectedCallback",Bg),super.connectedCallback(),this.addEventListener("interacted",this.widgetInteractedCallback)}render(){return jg`
|
|
1350
|
+
<template kind="cheer-meter" id="custom-cheer">
|
|
1351
|
+
<livelike-widget-root class="custom-widget">
|
|
1352
|
+
<livelike-widget-header class="widget-header" slot="header">
|
|
1353
|
+
<livelike-title class="custom-title"></livelike-title>
|
|
1354
|
+
</livelike-widget-header>
|
|
1355
|
+
<livelike-widget-body>
|
|
1356
|
+
<div class="cheer-image-body">
|
|
1357
|
+
<vote-count></vote-count>
|
|
1358
|
+
<livelike-select class="image-grid">
|
|
1359
|
+
<template>
|
|
1360
|
+
<livelike-option>
|
|
1361
|
+
<cheer-option></cheer-option>
|
|
1362
|
+
<livelike-description></livelike-description>
|
|
1363
|
+
</livelike-option>
|
|
1364
|
+
</template>
|
|
1365
|
+
</livelike-select>
|
|
1366
|
+
</div>
|
|
1367
|
+
</livelike-widget-body>
|
|
1368
|
+
${this.widgetPayload.interactive_until&&Date.now()>new Date(this.widgetPayload.interactive_until).getTime()?jg`<div class="expire-text">Expired</div>`:null}
|
|
1369
|
+
</livelike-widget-root>
|
|
1370
|
+
</template>
|
|
1371
|
+
`}}customElements.define("cheer-meter",m2);let Dr=null;function g2(e){return Dr||(Dr=new Zo.init(e)),Dr}function f2(){if(!Dr)throw new Error("SDK not initialized");return Dr}function y2(e){return Dr=e,!0}Je.LiveLikeInit=g2,Je.getLiveLiveInstance=f2,Je.setLiveLikeInstance=y2,Object.defineProperty(Je,Symbol.toStringTag,{value:"Module"})}));
|