poad 2.1.1 → 2.5.2
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/package.json +10 -72
- package/poad.js +52 -0
- package/LICENSE +0 -21
- package/README.md +0 -63
- package/dist/main/OmneediaClient.d.ts +0 -28
- package/dist/main/OmneediaClient.d.ts.map +0 -1
- package/dist/main/OmneediaClient.js +0 -58
- package/dist/main/OmneediaClient.js.map +0 -1
- package/dist/main/env/prefix-dev.d.ts +0 -7
- package/dist/main/env/prefix-dev.d.ts.map +0 -1
- package/dist/main/env/prefix-dev.js +0 -8
- package/dist/main/env/prefix-dev.js.map +0 -1
- package/dist/main/env/prefix-prod.d.ts +0 -7
- package/dist/main/env/prefix-prod.d.ts.map +0 -1
- package/dist/main/env/prefix-prod.js +0 -8
- package/dist/main/env/prefix-prod.js.map +0 -1
- package/dist/main/env/prefix.d.ts +0 -7
- package/dist/main/env/prefix.d.ts.map +0 -1
- package/dist/main/env/prefix.js +0 -8
- package/dist/main/env/prefix.js.map +0 -1
- package/dist/main/index.d.ts +0 -11
- package/dist/main/index.d.ts.map +0 -1
- package/dist/main/index.js +0 -19
- package/dist/main/index.js.map +0 -1
- package/dist/main/lib/auth.d.ts +0 -22
- package/dist/main/lib/auth.d.ts.map +0 -1
- package/dist/main/lib/auth.js +0 -352
- package/dist/main/lib/auth.js.map +0 -1
- package/dist/main/lib/constants.d.ts +0 -8
- package/dist/main/lib/constants.d.ts.map +0 -1
- package/dist/main/lib/constants.js +0 -11
- package/dist/main/lib/constants.js.map +0 -1
- package/dist/main/lib/db.d.ts +0 -45
- package/dist/main/lib/db.d.ts.map +0 -1
- package/dist/main/lib/db.js +0 -252
- package/dist/main/lib/db.js.map +0 -1
- package/dist/main/lib/error-codes.d.ts +0 -7
- package/dist/main/lib/error-codes.d.ts.map +0 -1
- package/dist/main/lib/error-codes.js +0 -3
- package/dist/main/lib/error-codes.js.map +0 -1
- package/dist/main/lib/errors.d.ts +0 -96
- package/dist/main/lib/errors.d.ts.map +0 -1
- package/dist/main/lib/errors.js +0 -127
- package/dist/main/lib/errors.js.map +0 -1
- package/dist/main/lib/realtime.d.ts +0 -9
- package/dist/main/lib/realtime.d.ts.map +0 -1
- package/dist/main/lib/realtime.js +0 -36
- package/dist/main/lib/realtime.js.map +0 -1
- package/dist/main/lib/request.d.ts +0 -40
- package/dist/main/lib/request.d.ts.map +0 -1
- package/dist/main/lib/request.js +0 -237
- package/dist/main/lib/request.js.map +0 -1
- package/dist/main/lib/types.d.ts +0 -408
- package/dist/main/lib/types.d.ts.map +0 -1
- package/dist/main/lib/types.js +0 -11
- package/dist/main/lib/types.js.map +0 -1
- package/dist/main/lib/util.d.ts +0 -7
- package/dist/main/lib/util.d.ts.map +0 -1
- package/dist/main/lib/util.js +0 -90
- package/dist/main/lib/util.js.map +0 -1
- package/dist/main/lib copy/auth.d.ts +0 -22
- package/dist/main/lib copy/auth.d.ts.map +0 -1
- package/dist/main/lib copy/auth.js +0 -283
- package/dist/main/lib copy/auth.js.map +0 -1
- package/dist/main/lib copy/auth_api.d.ts +0 -23
- package/dist/main/lib copy/auth_api.d.ts.map +0 -1
- package/dist/main/lib copy/auth_api.js +0 -90
- package/dist/main/lib copy/auth_api.js.map +0 -1
- package/dist/main/lib copy/constants.d.ts +0 -8
- package/dist/main/lib copy/constants.d.ts.map +0 -1
- package/dist/main/lib copy/constants.js +0 -11
- package/dist/main/lib copy/constants.js.map +0 -1
- package/dist/main/lib copy/cookies.d.ts +0 -20
- package/dist/main/lib copy/cookies.d.ts.map +0 -1
- package/dist/main/lib copy/cookies.js +0 -144
- package/dist/main/lib copy/cookies.js.map +0 -1
- package/dist/main/lib copy/db.d.ts +0 -45
- package/dist/main/lib copy/db.d.ts.map +0 -1
- package/dist/main/lib copy/db.js +0 -252
- package/dist/main/lib copy/db.js.map +0 -1
- package/dist/main/lib copy/realtime.d.ts +0 -9
- package/dist/main/lib copy/realtime.d.ts.map +0 -1
- package/dist/main/lib copy/realtime.js +0 -36
- package/dist/main/lib copy/realtime.js.map +0 -1
- package/dist/main/lib copy/request.d.ts +0 -40
- package/dist/main/lib copy/request.d.ts.map +0 -1
- package/dist/main/lib copy/request.js +0 -206
- package/dist/main/lib copy/request.js.map +0 -1
- package/dist/main/lib copy/types.d.ts +0 -124
- package/dist/main/lib copy/types.d.ts.map +0 -1
- package/dist/main/lib copy/types.js +0 -3
- package/dist/main/lib copy/types.js.map +0 -1
- package/dist/main/lib copy/util.d.ts +0 -7
- package/dist/main/lib copy/util.d.ts.map +0 -1
- package/dist/main/lib copy/util.js +0 -90
- package/dist/main/lib copy/util.js.map +0 -1
- package/dist/module/OmneediaClient.d.ts +0 -28
- package/dist/module/OmneediaClient.d.ts.map +0 -1
- package/dist/module/OmneediaClient.js +0 -52
- package/dist/module/OmneediaClient.js.map +0 -1
- package/dist/module/env/prefix-dev.d.ts +0 -7
- package/dist/module/env/prefix-dev.d.ts.map +0 -1
- package/dist/module/env/prefix-dev.js +0 -6
- package/dist/module/env/prefix-dev.js.map +0 -1
- package/dist/module/env/prefix-prod.d.ts +0 -7
- package/dist/module/env/prefix-prod.d.ts.map +0 -1
- package/dist/module/env/prefix-prod.js +0 -6
- package/dist/module/env/prefix-prod.js.map +0 -1
- package/dist/module/env/prefix.d.ts +0 -7
- package/dist/module/env/prefix.d.ts.map +0 -1
- package/dist/module/env/prefix.js +0 -6
- package/dist/module/env/prefix.js.map +0 -1
- package/dist/module/index.d.ts +0 -11
- package/dist/module/index.d.ts.map +0 -1
- package/dist/module/index.js +0 -12
- package/dist/module/index.js.map +0 -1
- package/dist/module/lib/auth.d.ts +0 -22
- package/dist/module/lib/auth.d.ts.map +0 -1
- package/dist/module/lib/auth.js +0 -349
- package/dist/module/lib/auth.js.map +0 -1
- package/dist/module/lib/constants.d.ts +0 -8
- package/dist/module/lib/constants.d.ts.map +0 -1
- package/dist/module/lib/constants.js +0 -8
- package/dist/module/lib/constants.js.map +0 -1
- package/dist/module/lib/db.d.ts +0 -45
- package/dist/module/lib/db.d.ts.map +0 -1
- package/dist/module/lib/db.js +0 -246
- package/dist/module/lib/db.js.map +0 -1
- package/dist/module/lib/error-codes.d.ts +0 -7
- package/dist/module/lib/error-codes.d.ts.map +0 -1
- package/dist/module/lib/error-codes.js +0 -2
- package/dist/module/lib/error-codes.js.map +0 -1
- package/dist/module/lib/errors.d.ts +0 -96
- package/dist/module/lib/errors.d.ts.map +0 -1
- package/dist/module/lib/errors.js +0 -108
- package/dist/module/lib/errors.js.map +0 -1
- package/dist/module/lib/realtime.d.ts +0 -9
- package/dist/module/lib/realtime.d.ts.map +0 -1
- package/dist/module/lib/realtime.js +0 -33
- package/dist/module/lib/realtime.js.map +0 -1
- package/dist/module/lib/request.d.ts +0 -40
- package/dist/module/lib/request.d.ts.map +0 -1
- package/dist/module/lib/request.js +0 -231
- package/dist/module/lib/request.js.map +0 -1
- package/dist/module/lib/types.d.ts +0 -408
- package/dist/module/lib/types.d.ts.map +0 -1
- package/dist/module/lib/types.js +0 -8
- package/dist/module/lib/types.js.map +0 -1
- package/dist/module/lib/util.d.ts +0 -7
- package/dist/module/lib/util.d.ts.map +0 -1
- package/dist/module/lib/util.js +0 -81
- package/dist/module/lib/util.js.map +0 -1
- package/dist/module/lib copy/auth.d.ts +0 -22
- package/dist/module/lib copy/auth.d.ts.map +0 -1
- package/dist/module/lib copy/auth.js +0 -277
- package/dist/module/lib copy/auth.js.map +0 -1
- package/dist/module/lib copy/auth_api.d.ts +0 -23
- package/dist/module/lib copy/auth_api.d.ts.map +0 -1
- package/dist/module/lib copy/auth_api.js +0 -87
- package/dist/module/lib copy/auth_api.js.map +0 -1
- package/dist/module/lib copy/constants.d.ts +0 -8
- package/dist/module/lib copy/constants.d.ts.map +0 -1
- package/dist/module/lib copy/constants.js +0 -8
- package/dist/module/lib copy/constants.js.map +0 -1
- package/dist/module/lib copy/cookies.d.ts +0 -20
- package/dist/module/lib copy/cookies.d.ts.map +0 -1
- package/dist/module/lib copy/cookies.js +0 -137
- package/dist/module/lib copy/cookies.js.map +0 -1
- package/dist/module/lib copy/db.d.ts +0 -45
- package/dist/module/lib copy/db.d.ts.map +0 -1
- package/dist/module/lib copy/db.js +0 -246
- package/dist/module/lib copy/db.js.map +0 -1
- package/dist/module/lib copy/realtime.d.ts +0 -9
- package/dist/module/lib copy/realtime.d.ts.map +0 -1
- package/dist/module/lib copy/realtime.js +0 -33
- package/dist/module/lib copy/realtime.js.map +0 -1
- package/dist/module/lib copy/request.d.ts +0 -40
- package/dist/module/lib copy/request.d.ts.map +0 -1
- package/dist/module/lib copy/request.js +0 -200
- package/dist/module/lib copy/request.js.map +0 -1
- package/dist/module/lib copy/types.d.ts +0 -124
- package/dist/module/lib copy/types.d.ts.map +0 -1
- package/dist/module/lib copy/types.js +0 -2
- package/dist/module/lib copy/types.js.map +0 -1
- package/dist/module/lib copy/util.d.ts +0 -7
- package/dist/module/lib copy/util.d.ts.map +0 -1
- package/dist/module/lib copy/util.js +0 -81
- package/dist/module/lib copy/util.js.map +0 -1
- package/dist/umd/941.omneedia.js +0 -1
- package/dist/umd/omneedia.js +0 -2
- package/dist/umd/omneedia.js.LICENSE.txt +0 -1
- package/src/OmneediaClient.ts +0 -65
- package/src/env/prefix-dev.ts +0 -5
- package/src/env/prefix-prod.ts +0 -5
- package/src/env/prefix.ts +0 -5
- package/src/index.ts +0 -26
- package/src/lib/auth.ts +0 -306
- package/src/lib/constants.ts +0 -7
- package/src/lib/db.ts +0 -216
- package/src/lib/error-codes.ts +0 -71
- package/src/lib/errors.ts +0 -153
- package/src/lib/realtime.ts +0 -21
- package/src/lib/request.ts +0 -198
- package/src/lib/types.ts +0 -512
- package/src/lib/util.ts +0 -83
package/dist/umd/omneedia.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see omneedia.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.omneedia=t():e.omneedia=t()}(self,(()=>(()=>{var e,t,r={911:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Browser:()=>s});const s=(0,r(546).registerPlugin)("Browser",{web:()=>r.e(941).then(r.bind(r,941)).then((e=>new e.BrowserWeb))})},546:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Capacitor:()=>c,CapacitorCookies:()=>g,CapacitorException:()=>a,CapacitorHttp:()=>w,CapacitorPlatforms:()=>s,ExceptionCode:()=>i,Plugins:()=>u,WebPlugin:()=>d,WebView:()=>p,addPlatform:()=>n,buildRequestInit:()=>b,registerPlugin:()=>h,registerWebPlugin:()=>l,setPlatform:()=>o});const s=(e=>e.CapacitorPlatforms=(e=>{const t=new Map;t.set("web",{name:"web"});const r=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t};return r.addPlatform=(e,t)=>{r.platforms.set(e,t)},r.setPlatform=e=>{r.platforms.has(e)&&(r.currentPlatform=r.platforms.get(e))},r})(e))("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:{}),n=s.addPlatform,o=s.setPlatform;var i;!function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"}(i||(i={}));class a extends Error{constructor(e,t,r){super(e),this.message=e,this.code=t,this.data=r}}const c=(e=>e.Capacitor=(e=>{var t,r,s,n,o;const c=e.CapacitorCustomPlatform||null,h=e.Capacitor||{},u=h.Plugins=h.Plugins||{},l=e.CapacitorPlatforms,d=(null===(t=null==l?void 0:l.currentPlatform)||void 0===t?void 0:t.getPlatform)||(()=>null!==c?c.name:(e=>{var t,r;return(null==e?void 0:e.androidBridge)?"android":(null===(r=null===(t=null==e?void 0:e.webkit)||void 0===t?void 0:t.messageHandlers)||void 0===r?void 0:r.bridge)?"ios":"web"})(e)),p=(null===(r=null==l?void 0:l.currentPlatform)||void 0===r?void 0:r.isNativePlatform)||(()=>"web"!==d()),f=(null===(s=null==l?void 0:l.currentPlatform)||void 0===s?void 0:s.isPluginAvailable)||(e=>{const t=m.get(e);return!!(null==t?void 0:t.platforms.has(d()))||!!y(e)}),y=(null===(n=null==l?void 0:l.currentPlatform)||void 0===n?void 0:n.getPluginHeader)||(e=>{var t;return null===(t=h.PluginHeaders)||void 0===t?void 0:t.find((t=>t.name===e))}),m=new Map,g=(null===(o=null==l?void 0:l.currentPlatform)||void 0===o?void 0:o.registerPlugin)||((e,t={})=>{const r=m.get(e);if(r)return console.warn(`Capacitor plugin "${e}" already registered. Cannot register plugins twice.`),r.proxy;const s=d(),n=y(e);let o;const l=r=>{let u;const l=(...l)=>{const d=(async()=>(!o&&s in t?o=o="function"==typeof t[s]?await t[s]():t[s]:null!==c&&!o&&"web"in t&&(o=o="function"==typeof t.web?await t.web():t.web),o))().then((t=>{const o=((t,r)=>{var o,c;if(!n){if(t)return null===(c=t[r])||void 0===c?void 0:c.bind(t);throw new a(`"${e}" plugin is not implemented on ${s}`,i.Unimplemented)}{const s=null==n?void 0:n.methods.find((e=>r===e.name));if(s)return"promise"===s.rtype?t=>h.nativePromise(e,r.toString(),t):(t,s)=>h.nativeCallback(e,r.toString(),t,s);if(t)return null===(o=t[r])||void 0===o?void 0:o.bind(t)}})(t,r);if(o){const e=o(...l);return u=null==e?void 0:e.remove,e}throw new a(`"${e}.${r}()" is not implemented on ${s}`,i.Unimplemented)}));return"addListener"===r&&(d.remove=async()=>u()),d};return l.toString=()=>`${r.toString()}() { [capacitor code] }`,Object.defineProperty(l,"name",{value:r,writable:!1,configurable:!1}),l},p=l("addListener"),f=l("removeListener"),g=(e,t)=>{const r=p({eventName:e},t),s=async()=>{const s=await r;f({eventName:e,callbackId:s},t)},n=new Promise((e=>r.then((()=>e({remove:s})))));return n.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await s()},n},b=new Proxy({},{get(e,t){switch(t){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return n?g:p;case"removeListener":return f;default:return l(t)}}});return u[e]=b,m.set(e,{name:e,proxy:b,platforms:new Set([...Object.keys(t),...n?[s]:[]])}),b});return h.convertFileSrc||(h.convertFileSrc=e=>e),h.getPlatform=d,h.handleError=t=>e.console.error(t),h.isNativePlatform=p,h.isPluginAvailable=f,h.pluginMethodNoop=(e,t,r)=>Promise.reject(`${r} does not have an implementation of "${t}".`),h.registerPlugin=g,h.Exception=a,h.DEBUG=!!h.DEBUG,h.isLoggingEnabled=!!h.isLoggingEnabled,h.platform=h.getPlatform(),h.isNative=h.isNativePlatform(),h})(e))("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:{}),h=c.registerPlugin,u=c.Plugins,l=e=>((e,t)=>{var r;const s=t.config,n=e.Plugins;if(!(null==s?void 0:s.name))throw new Error('Capacitor WebPlugin is using the deprecated "registerWebPlugin()" function, but without the config. Please use "registerPlugin()" instead to register this web plugin."');console.warn(`Capacitor plugin "${s.name}" is using the deprecated "registerWebPlugin()" function`),n[s.name]&&!(null===(r=null==s?void 0:s.platforms)||void 0===r?void 0:r.includes(e.getPlatform()))||(n[s.name]=t)})(c,e);class d{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t);const r=this.windowListeners[e];r&&!r.registered&&this.addWindowListener(r);const s=async()=>this.removeListener(e,t),n=Promise.resolve({remove:s});return Object.defineProperty(n,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await s()}}),n}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,t){const r=this.listeners[e];r&&r.forEach((e=>e(t)))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:e=>{this.notifyListeners(t,e)}}}unimplemented(e="not implemented"){return new c.Exception(e,i.Unimplemented)}unavailable(e="not available"){return new c.Exception(e,i.Unavailable)}async removeListener(e,t){const r=this.listeners[e];if(!r)return;const s=r.indexOf(t);this.listeners[e].splice(s,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}}const p=h("WebView"),f=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),y=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class m extends d{async getCookies(){const e=document.cookie,t={};return e.split(";").forEach((e=>{if(e.length<=0)return;let[r,s]=e.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=y(r).trim(),s=y(s).trim(),t[r]=s})),t}async setCookie(e){try{const t=f(e.key),r=f(e.value),s=`; expires=${(e.expires||"").replace("expires=","")}`,n=(e.path||"/").replace("path=",""),o=null!=e.url&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${t}=${r||""}${s}; path=${n}; ${o};`}catch(e){return Promise.reject(e)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(e){return Promise.reject(e)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const t of e)document.cookie=t.replace(/^ +/,"").replace(/=.*/,`=;expires=${(new Date).toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}const g=h("CapacitorCookies",{web:()=>new m}),b=(e,t={})=>{const r=Object.assign({method:e.method||"GET",headers:e.headers},t),s=((e={})=>{const t=Object.keys(e);return Object.keys(e).map((e=>e.toLocaleLowerCase())).reduce(((r,s,n)=>(r[s]=e[t[n]],r)),{})})(e.headers)["content-type"]||"";if("string"==typeof e.data)r.body=e.data;else if(s.includes("application/x-www-form-urlencoded")){const t=new URLSearchParams;for(const[r,s]of Object.entries(e.data||{}))t.set(r,s);r.body=t.toString()}else if(s.includes("multipart/form-data")){const t=new FormData;if(e.data instanceof FormData)e.data.forEach(((e,r)=>{t.append(r,e)}));else for(const r of Object.keys(e.data))t.append(r,e.data[r]);r.body=t;const s=new Headers(r.headers);s.delete("content-type"),r.headers=s}else(s.includes("application/json")||"object"==typeof e.data)&&(r.body=JSON.stringify(e.data));return r};class v extends d{async request(e){const t=b(e,e.webFetchExtra),r=((e,t=!0)=>e?Object.entries(e).reduce(((e,r)=>{const[s,n]=r;let o,i;return Array.isArray(n)?(i="",n.forEach((e=>{o=t?encodeURIComponent(e):e,i+=`${s}=${o}&`})),i.slice(0,-1)):(o=t?encodeURIComponent(n):n,i=`${s}=${o}`),`${e}&${i}`}),"").substr(1):null)(e.params,e.shouldEncodeUrlParams),s=r?`${e.url}?${r}`:e.url,n=await fetch(s,t),o=n.headers.get("content-type")||"";let i,a,{responseType:c="text"}=n.ok?e:{};switch(o.includes("application/json")&&(c="json"),c){case"arraybuffer":case"blob":a=await n.blob(),i=await(async e=>new Promise(((t,r)=>{const s=new FileReader;s.onload=()=>{const e=s.result;t(e.indexOf(",")>=0?e.split(",")[1]:e)},s.onerror=e=>r(e),s.readAsDataURL(e)})))(a);break;case"json":i=await n.json();break;default:i=await n.text()}const h={};return n.headers.forEach(((e,t)=>{h[t]=e})),{data:i,headers:h,status:n.status,url:n.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}const w=h("CapacitorHttp",{web:()=>new v})},326:(e,t,r)=>{var s="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r.g&&r.g,n=function(){function e(){this.fetch=!1,this.DOMException=s.DOMException}return e.prototype=s,new e}();!function(e){!function(t){var r=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==r&&r,s="URLSearchParams"in r,n="Symbol"in r&&"iterator"in Symbol,o="FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in r,a="ArrayBuffer"in r;if(a)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function y(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function m(e){var t=new FileReader,r=y(t);return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:s&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||h(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=f(this);if(e)return e;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(){return this._bodyArrayBuffer?f(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(m)}),this.text=function(){var e,t,r,s=f(this);if(s)return s;if(this._bodyBlob)return e=this._bodyBlob,r=y(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),s=0;s<t.length;s++)r[s]=String.fromCharCode(t[s]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(E)}),this.json=function(){return this.text().then(JSON.parse)},this}p.prototype.append=function(e,t){e=u(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},p.prototype.delete=function(e){delete this.map[u(e)]},p.prototype.get=function(e){return e=u(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(u(e))},p.prototype.set=function(e,t){this.map[u(e)]=l(t)},p.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),d(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),d(e)},n&&(p.prototype[Symbol.iterator]=p.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(e,t){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,s,n=(t=t||{}).body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(s=(r=t.method||this.method||"GET").toUpperCase(),v.indexOf(s)>-1?s:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function E(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),s=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(s),decodeURIComponent(n))}})),t}function k(e,t){if(!(this instanceof k))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},b.call(w.prototype),b.call(k.prototype),k.prototype.clone=function(){return new k(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},k.error=function(){var e=new k(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];k.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new k(null,{status:t,headers:{location:e}})},t.DOMException=r.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function C(e,s){return new Promise((function(n,i){var c=new w(e,s);if(c.signal&&c.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var h=new XMLHttpRequest;function u(){h.abort()}h.onload=function(){var e,t,r={status:h.status,statusText:h.statusText,headers:(e=h.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),s=r.shift().trim();if(s){var n=r.join(":").trim();t.append(s,n)}})),t)};r.url="responseURL"in h?h.responseURL:r.headers.get("X-Request-URL");var s="response"in h?h.response:h.responseText;setTimeout((function(){n(new k(s,r))}),0)},h.onerror=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},h.ontimeout=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},h.onabort=function(){setTimeout((function(){i(new t.DOMException("Aborted","AbortError"))}),0)},h.open(c.method,function(e){try{return""===e&&r.location.href?r.location.href:e}catch(t){return e}}(c.url),!0),"include"===c.credentials?h.withCredentials=!0:"omit"===c.credentials&&(h.withCredentials=!1),"responseType"in h&&(o?h.responseType="blob":a&&c.headers.get("Content-Type")&&-1!==c.headers.get("Content-Type").indexOf("application/octet-stream")&&(h.responseType="arraybuffer")),!s||"object"!=typeof s.headers||s.headers instanceof p?c.headers.forEach((function(e,t){h.setRequestHeader(t,e)})):Object.getOwnPropertyNames(s.headers).forEach((function(e){h.setRequestHeader(e,l(s.headers[e]))})),c.signal&&(c.signal.addEventListener("abort",u),h.onreadystatechange=function(){4===h.readyState&&c.signal.removeEventListener("abort",u)}),h.send(void 0===c._bodyInit?null:c._bodyInit)}))}C.polyfill=!0,r.fetch||(r.fetch=C,r.Headers=p,r.Request=w,r.Response=k),t.Headers=p,t.Request=w,t.Response=k,t.fetch=C}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var o=s.fetch?s:n;(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},833:(e,t,r)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let s=0,n=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(s++,"%c"===e&&(n=s))})),t.splice(n,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&typeof process/browser!=="undefined"&&"env"in process/browser&&(e=process/browser.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(736)(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},736:(e,t,r)=>{e.exports=function(e){function t(e){let r,n,o,i=null;function a(...e){if(!a.enabled)return;const s=a,n=Number(new Date),o=n-(r||n);s.diff=o,s.prev=r,s.curr=n,r=n,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,n)=>{if("%%"===r)return"%";i++;const o=t.formatters[n];if("function"==typeof o){const t=e[i];r=o.call(s,t),e.splice(i,1),i--}return r})),t.formatArgs.call(s,e),(s.log||t.log).apply(s,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=s,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(n!==t.namespaces&&(n=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function s(e,r){const s=t(this.namespace+(void 0===r?":":r)+e);return s.log=this.log,s}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const s=("string"==typeof e?e:"").split(/[\s,]+/),n=s.length;for(r=0;r<n;r++)s[r]&&("-"===(e=s[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,s;for(r=0,s=t.skips.length;r<s;r++)if(t.skips[r].test(e))return!1;for(r=0,s=t.names.length;r<s;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(585),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},585:e=>{var t=1e3,r=60*t,s=60*r,n=24*s,o=7*n;function i(e,t,r,s){var n=t>=1.5*r;return Math.round(e/r)+" "+s+(n?"s":"")}e.exports=function(e,a){a=a||{};var c,h,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(i){var a=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*o;case"days":case"day":case"d":return a*n;case"hours":case"hour":case"hrs":case"hr":case"h":return a*s;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===u&&isFinite(e))return a.long?(c=e,(h=Math.abs(c))>=n?i(c,h,n,"day"):h>=s?i(c,h,s,"hour"):h>=r?i(c,h,r,"minute"):h>=t?i(c,h,t,"second"):c+" ms"):function(e){var o=Math.abs(e);return o>=n?Math.round(e/n)+"d":o>=s?Math.round(e/s)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},323:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(7),o=s(r(56)),i=s(r(587)),a=s(r(368)),c=s(r(945)),h=s(r(558));t.default=class{headers(){return{"Content-Type":"application/json",Authorization:"Basic "+this.KEY,apikey:this.KEY}}constructor(e,t,r){if(this.omneediaUrl=e,this.omneediaKey=t,this.PREFIX=h.default,this.KEY="",this.URI="",this.socket=null,!e)throw new Error("omneediaUrl is required.");if(!t)throw new Error("omneediaKey is required.");this.URI=e,this.KEY=t,this.request=new c.default(this),this.auth=new a.default(this,r),this.options=r}from(e){return new o.default(e,this)}channel(e){return this.socket=(0,n.io)(String(this.URI),{path:this.PREFIX.REALTIME,withCredentials:!0,extraHeaders:{apikey:`${this.KEY}`,Authorization:`Bearer ${this.KEY}`}}),this.socket.on("connect_error",(function(e){if(401==e.description)throw"Invalid authentication credentials (401)";throw"unhandled exception"})),new i.default(e,this)}}},558:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={REST:"/rest/v1",AUTH:"/auth/v1",REALTIME:"/realtime/v1"}},440:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createClient=t.OmneediaClient=t.omneediaClient=void 0;const n=s(r(323));t.omneediaClient=n.default,t.OmneediaClient=n.default,t.createClient=(e,t,r)=>new n.default(e,t,r)},368:function(e,t,r){"use strict";var s=this&&this.__awaiter||function(e,t,r,s){return new(r||(r=Promise))((function(n,o){function i(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=r(170),o=r(546);r(911),t.default=class{constructor(e,t){this.tokenListener=null,this.session=this.getSession,this.options=t,this.ref=e,this.tokenListener=setInterval((()=>s(this,void 0,void 0,(function*(){if((0,n.isBrowser)()){let e=yield this.session().getUser();if(!e)return;let t=localStorage.getItem("omneedia.auth.refresh_token");if(!t)return localStorage.removeItem("omneedia.auth.token"),localStorage.removeItem("omneedia.auth.refresh_token"),location.href=`#new_token=${t}`;if(new Date(1e3*e.exp)<new Date){let e=yield this.getNewToken(t);return!1===e?(localStorage.removeItem("omneedia.auth.token"),localStorage.removeItem("omneedia.auth.refresh_token"),location.href=`#new_token=${t}`):(localStorage.setItem("omneedia.auth.token",e),location.href=`#new_token=${t}`)}}else if(!(yield this.session().getUser()))return}))),1e3)}getNewToken(e){return s(this,void 0,void 0,(function*(){let{data:t}=yield this.ref.request.post(this.ref.PREFIX.AUTH+"/token?grant_type=refresh_token",{refresh_token:e});return!t.error&&t.access_token}))}_setUserData(e){this.options.cookies.setAll([{name:"omneedia.auth.token",value:e.access_token,lifetime:1728e3,domain:"",path:"/",sameSite:"None"}])}signInWithPassword(e){return s(this,void 0,void 0,(function*(){let{data:t}=yield this.ref.request.post(this.ref.PREFIX.AUTH+"/token?grant_type=password",{props:e});if(!(0,n.isBrowser)())return t.error?{data:{user:null,session:null},error:{message:t.error}}:(this._setUserData(t),this.getUser(t.access_token));if(t.error)r=[`#error=${t.error}`];else{var r=[];for(var s in t)r.push(`${s}=${t[s]}`)}location.href="#"+r.join("&")}))}signUp(e){return s(this,void 0,void 0,(function*(){let{data:t}=yield this.ref.request.post(this.ref.PREFIX.AUTH+"/signup",{props:e});if(console.log(t),!(0,n.isBrowser)())return t.error?{data:{user:null,session:null},error:{message:t.error}}:(this._setUserData(t),this.getUser(t.access_token));if(t.error)r=[`#error=${t.error}`];else{var r=[];for(var s in t)r.push(`${s}=${t[s]}`)}t.waiting&&(r=["#waiting"]),location.href="#"+r.join("&")}))}signInWithProvider(e){var t;return s(this,void 0,void 0,(function*(){return(null===(t=e.config)||void 0===t?void 0:t.callback)?location.href=`${this.ref.URI}${this.ref.PREFIX.AUTH}/authorize?provider=${e.provider}&callback=${e.config.callback}`:(yield o.Capacitor.getPlatform(),!0)}))}updateUser(e){return s(this,void 0,void 0,(function*(){const t=new URLSearchParams(window.location.search).get("token");t&&(e.token=t);let{data:r}=yield this.ref.request.put(this.ref.PREFIX.AUTH+"/user",e);return r}))}onAuthStateChange(e){if((0,n.isBrowser)()){var t=()=>{if(location.href.indexOf("access_token")>-1){var t=(0,n.getHashParams)();return window.location.hash="",localStorage.setItem("omneedia.auth.token",t.access_token),localStorage.setItem("omneedia.auth.refresh_token",t.refresh_token),e("SIGNED_IN",t)}if(location.href.indexOf("#waiting")>-1)return window.location.hash="",e("WAITING_FOR_CONFIRMATION",{});if(location.href.indexOf("#logout")>-1)return localStorage.removeItem("omneedia.auth.token"),localStorage.removeItem("omneedia.auth.refresh_token"),window.location.hash="",e("SIGNED_OUT",{});if(location.href.indexOf("#error")>-1){var r=decodeURIComponent(location.href).split("#error=")[1];return e("ERROR",r),window.location.hash="",!1}if(location.href.indexOf("#new_token")>-1)return r=decodeURIComponent(location.href).split("#new_token=")[1],e("REFRESH_TOKEN",localStorage.getItem("omneedia.auth.token")),window.location.hash="",!1;localStorage.getItem("omneedia.auth.token")&&e("AUTHENTICATED",localStorage.getItem("omneedia.auth.token"))};window.addEventListener("hashchange",t),window.addEventListener("load",t),t()}}resetPasswordForEmail(e){return s(this,void 0,void 0,(function*(){let{data:t}=yield this.ref.request.post(this.ref.PREFIX.AUTH+"/recover",e);if(t.error)r=[`error=${t.error}`];else{var r=[];for(var s in t)r.push(`${s}=${t[s]}`)}t.waiting&&(r=["waiting"]),location.href="#"+r.join("&")}))}signInWithEmail(e){return s(this,void 0,void 0,(function*(){let{data:t}=yield this.ref.request.post(this.ref.PREFIX.AUTH+"/magiclink",e);if(t.error)r=[`error=${t.error}`];else{var r=[];for(var s in t)r.push(`${s}=${t[s]}`)}t.waiting&&(r=["waiting"]),location.href="#"+r.join("&")}))}getSession(){var e=!1;if((0,n.isBrowser)()&&localStorage.getItem("omneedia.auth.token")){let t=localStorage.getItem("omneedia.auth.token");e=(0,n.parseJwt)(t)}return{getUser:()=>e}}getUser(e){return s(this,void 0,void 0,(function*(){if(e){if(!(0,n.isBrowser)()){const t=(0,n.urlBase64Decode)(e);return t?"anon"==t.role?{data:{user:null,session:null},error:{message:"anonymous"}}:{data:{user:t,session:e},error:null}:{data:{user:null,session:null},error:null}}try{return e=(0,n.urlBase64Decode)(e)}catch(e){return null}}let{data:t}=yield this.ref.request.get(this.ref.PREFIX.AUTH+"/user");return t?"anon"==t.role?{data:{user:null,session:null},error:{message:"anonymous"}}:(!1===t&&((0,n.isBrowser)()?(localStorage.removeItem("omneedia.auth.token"),localStorage.removeItem("omneedia.auth.refresh_token")):this.options.cookies.deleteAll()),(0,n.isBrowser)()?t:{data:{user:t},error:null}):{data:{user:null,session:null},error:{message:"anonymous"}}}))}isAuthenticated(){if((0,n.isBrowser)())return!!window.localStorage.getItem("omneedia.auth.token")}signOut(){return s(this,void 0,void 0,(function*(){if((0,n.isBrowser)())return yield this.ref.request.get(this.ref.PREFIX.AUTH+"/signout"),void(location.hash="#logout");{const{data:e}=yield this.ref.request.get(this.ref.PREFIX.AUTH+"/signout");this.options.cookies.setAll([{name:"omneedia.auth.token",value:e.token,lifetime:new Date(0),domain:"",path:"/",sameSite:"lax"}])}}))}}},56:function(e,t,r){"use strict";var s=this&&this.__awaiter||function(e,t,r,s){return new(r||(r=Promise))((function(n,o){function i(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((s=s.apply(e,t||[])).next())}))},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(945));t.default=class{constructor(e,t){this.SELECT=[],this.INSERT={},this.UPDATE={},this.DELETE=!1,this.WHERE=[],this.ref={},this.FilterOperator=["eq","neq","gt","gte","lt","lte","like","ilike","is","in","cs","cd","sl","sr","nxl","nxr","adj","ov","fts","plfts","phfts","wfts"],this.TABLE=e,this.ref=t,this.request=new o.default(this)}rangeLt(e,t){return this.WHERE.push(`${e}=sl.${t}`),this}rangeGt(e,t){return this.WHERE.push(`${e}=sr.${t}`),this}rangeLte(e,t){return this.WHERE.push(`${e}=nxr.${t}`),this}rangeGte(e,t){return this.WHERE.push(`${e}=nxl.${t}`),this}rangeAdjacent(e,t){return this.WHERE.push(`${e}=adj.${t}`),this}overlaps(e,t){return Array.isArray(t)||(t=[t]),t=`[${t.join(",")}]`,this.WHERE.push(`${e}=ov.${t}`),this}not(e,t,r){return-1==this.FilterOperator.indexOf(t)||this.WHERE.push(`${e}=not.${t}.${r}`),this}is(e,t){return this.WHERE.push(`${e}=is.${t}`),this}contains(e,t){return Array.isArray(t)||(t=[t]),t=`{${t.join(",")}}`,this.WHERE.push(`${e}=cs.${t}`),this}containedBy(e,t){return Array.isArray(t)||(t=[t]),t=`{${t.join(",")}}`,this.WHERE.push(`${e}=cd.${t}`),this}or(e){return Array.isArray(e)||(e=[e]),1==e.length&&(e=e[0].split(",")),this.WHERE.push(`or=(${e.join(",")})`),this}and(e){return Array.isArray(e)||(e=[e]),1==e.length&&(e=e[0].split(",")),this.WHERE.push(`and=(${e.join(",")})`),this}textSearch(e,t,r){let s="";r&&("plain"===r.type?s="pl":"phrase"===r.type?s="ph":"websearch"===r.type&&(s="w"));let n=`${s}fts`;return this.WHERE.push(`${e}=${n}.${t}`),this}in(e,t){return Array.isArray(t)||(t=[t]),t=`(${t.join(",")})`,this.WHERE.push(`${e}=in.${t}`),this}nxr(e,t){return Array.isArray(t)||(t=[t]),t=`(${t.join(",")})`,this.WHERE.push(`${e}=nxr.${t}`),this}sl(e,t){return Array.isArray(t)||(t=[t]),t=`(${t.join(",")})`,this.WHERE.push(`${e}=sl.${t}`),this}adj(e,t){return Array.isArray(t)||(t=[t]),t=`(${t.join(",")})`,this.WHERE.push(`${e}=adj.${t}`),this}imatch(e){for(var t in e)this.WHERE.push(`${t}=eq.${e[t]}`);return this}match(e){for(var t in e)this.WHERE.push(`${t}=eq.${e[t]}`);return this}gt(e,t){return this.WHERE.push(`${e}=gt.${t}`),this}gte(e,t){return this.WHERE.push(`${e}=gte.${t}`),this}lt(e,t){return this.WHERE.push(`${e}=lt.${t}`),this}lte(e,t){return this.WHERE.push(`${e}=lte.${t}`),this}neq(e,t){return this.WHERE.push(`${e}=neq.${t}`),this}like(e,t){return this.WHERE.push(`${e}=like.${t}`),this}ilike(e,t){return this.WHERE.push(`${e}=ilike.${t}`),this}eq(e,t){return this.WHERE.push(`${e}=eq.${t}`),this}select(...e){return e||(e=[""]),1==e.length&&(e=e[0].split(",")),this.SELECT=e,this}insert(e){return this.INSERT=e,this}update(e){return this.UPDATE=e,this}delete(){return this.DELETE=!0,this}then(e,t){return s(this,void 0,void 0,(function*(){var t=`/${this.TABLE}?`;if(Object.keys(this.INSERT).length>0){var r=this.ref.PREFIX.REST+t;return e(this.request.post(r,this.INSERT))}this.SELECT.length>0&&(t+=`select=${this.SELECT.join(",")}&`),this.WHERE.length>0&&(t+=this.WHERE.join("&")),r=this.ref.PREFIX.REST+t;var s="get";!0===this.DELETE&&(s="delete"),Object.keys(this.UPDATE).length>0?e(this.request.patch(r,this.UPDATE)):e(this.request[s](r))}))}}},587:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,s){return new(r||(r=Promise))((function(n,o){function i(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e,t){this.Channel="",this.ref=null,this.Channel=e,this.ref=t}send(e){return r(this,void 0,void 0,(function*(){return this.ref.socket.emit(this.Channel+"::"+e.type+"::"+e.event,e.payload),this}))}on(e,t,r){return this.ref.socket.on(`${this.Channel}::${e}::${t.event}`,r),this}subscribe(e){return this.ref.socket.on(`${this.Channel}:SUBSCRIBED`,e),this.ref.socket.emit("subscribe",this.Channel),this}}},945:function(e,t,r){"use strict";var s=this&&this.__awaiter||function(e,t,r,s){return new(r||(r=Promise))((function(n,o){function i(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((s=s.apply(e,t||[])).next())}))},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(170),i=n(r(326));t.default=class{constructor(e){this.url="",this.ref=e,(0,o.isBrowser)()?this.fetch=globalThis.fetch.bind(globalThis):this.fetch=i.default}get(e,t){return s(this,void 0,void 0,(function*(){if(e.indexOf("://")>-1)var t=`${e}`;else t=`${this.ref.omneediaUrl}${e}`;let r=this.ref.headers();if((0,o.isBrowser)())localStorage.getItem("omneedia.auth.token")&&(r.Authorization="Bearer "+localStorage.getItem("omneedia.auth.token")),r.redirect_to=window.location.origin+window.location.pathname;else{const e=this.ref.options.cookies.getAll();if(e){const t=e.find((e=>"omneedia.auth.token"===e.name));t&&(r.Authorization="Bearer "+t.value)}}var s=yield this.fetch(t,{headers:r,credentials:"include"}),n=yield s.json(),i={data:null,error:null,statusText:s.statusText,status:s.status};return s.ok?i.data=n:i.error=n,i}))}delete(e,t){return s(this,void 0,void 0,(function*(){let t=[];if(e.indexOf("://")>-1)var r=`${e}`;else r=`${this.ref.omneediaUrl}${e}`;let s=this.ref.headers();if((0,o.isBrowser)())localStorage.getItem("omneedia.auth.token")&&(s.Authorization="Bearer "+localStorage.getItem("omneedia.auth.token")),s.redirect_to=window.location.origin+window.location.pathname;else{const e=this.ref.options.cookies.getAll();if(e){const t=e.find((e=>"omneedia.auth.token"===e.name));t&&(s.Authorization="Bearer "+t.value)}}var n=yield this.fetch(r,{method:"DELETE",credentials:"include",headers:s});try{t=yield n.json()}catch(e){t=[]}return{data:t,statusText:n.statusText,status:n.status}}))}patch(e,t){return s(this,void 0,void 0,(function*(){let r=[];if(e.indexOf("://")>-1)var s=`${e}`;else s=`${this.ref.omneediaUrl}${e}`;let n=this.ref.headers();if((0,o.isBrowser)())n.redirect_to=window.location.origin+window.location.pathname,localStorage.getItem("omneedia.auth.token")&&(n.Authorization="Bearer "+localStorage.getItem("omneedia.auth.token"));else{const e=this.ref.options.cookies.getAll();if(e){const t=e.find((e=>"omneedia.auth.token"===e.name));t&&(n.Authorization="Bearer "+t.value)}}var i=yield this.fetch(s,{method:"PATCH",credentials:"include",headers:n,body:JSON.stringify(t)});try{r=yield i.json()}catch(e){r=[]}return{data:yield r,statusText:i.statusText,status:i.status}}))}put(e,t){return s(this,void 0,void 0,(function*(){let r=[];if(e.indexOf("://")>-1)var s=`${e}`;else s=`${this.ref.omneediaUrl}${e}`;let n=this.ref.headers();if((0,o.isBrowser)())n.redirect_to=window.location.origin+window.location.pathname,localStorage.getItem("omneedia.auth.token")&&(n.Authorization="Bearer "+localStorage.getItem("omneedia.auth.token"));else{const e=this.ref.options.cookies.getAll();if(e){const t=e.find((e=>"omneedia.auth.token"===e.name));t&&(n.Authorization="Bearer "+t.value)}}var i=yield this.fetch(s,{method:"PUT",credentials:"include",headers:n,body:JSON.stringify(t)});try{r=yield i.json()}catch(e){r=[]}return{data:yield r,statusText:i.statusText,status:i.status}}))}post(e,t){return s(this,void 0,void 0,(function*(){let r=[];if(e.indexOf("://")>-1)var s=`${e}`;else s=`${this.ref.omneediaUrl}${e}`;let n=this.ref.headers();if((0,o.isBrowser)())n.redirect_to=window.location.origin+window.location.pathname,localStorage.getItem("omneedia.auth.token")&&(n.Authorization="Bearer "+localStorage.getItem("omneedia.auth.token"));else{const e=this.ref.options.cookies.getAll();if(e){const t=e.find((e=>"omneedia.auth.token"===e.name));t&&(n.Authorization="Bearer "+t.value)}}var i=yield this.fetch(s,{method:"POST",credentials:"include",headers:n,body:JSON.stringify(t)});try{r=yield i.json()}catch(e){r=[]}return{data:r,statusText:i.statusText,status:i.status}}))}}},170:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getHash=t.urlBase64Decode=t.parseJwt=t.getHashParams=t.isBrowser=t.uuid=void 0,t.uuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},t.isBrowser=()=>"undefined"!=typeof document,t.getHashParams=function(){let e=location.href.substring(location.href.indexOf("#")+1,location.href.length).split("&"),t={};for(let r in e)t[e[r].split("=")[0]]=e[r].split("=")[1];return t},t.parseJwt=function(e){if((0,t.isBrowser)()){var r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(window.atob(r).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));const t=Math.floor(Date.now()/1e3);return JSON.parse(s).exp<t?(localStorage.removeItem("omneedia.auth.token"),localStorage.removeItem("omneedia.auth.refresh_token"),!1):JSON.parse(s)}return JSON.parse(Buffer.from(e.split(".")[1],"base64").toString())},t.urlBase64Decode=function(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="="}if(!(0,t.isBrowser)())return JSON.parse(Buffer.from(r.split(".")[1],"base64").toString());{const e=window.atob(r);try{return JSON.parse(decodeURIComponent(escape(e)))}catch(t){return e}}},t.getHash=function(){if(""==location.hash)return{};let e,t=location.hash.split("&");for(let n=0;n<t.length;n++){var r=t[n].split("=")[0],s=t[n].split("=")[1];e[r]=s}return e}},110:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasCORS=void 0;let r=!1;try{r="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}t.hasCORS=r},661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0,t.encode=function(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t},t.decode=function(e){let t={},r=e.split("&");for(let e=0,s=r.length;e<s;e++){let s=r[e].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}},15:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,s=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.parse=function(e){const t=e,n=e.indexOf("["),o=e.indexOf("]");-1!=n&&-1!=o&&(e=e.substring(0,n)+e.substring(n,o).replace(/:/g,";")+e.substring(o,e.length));let i=r.exec(e||""),a={},c=14;for(;c--;)a[s[c]]=i[c]||"";return-1!=n&&-1!=o&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=function(e,t){const r=t.replace(/\/{2,9}/g,"/").split("/");return"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1),"/"==t.slice(-1)&&r.splice(r.length-1,1),r}(0,a.path),a.queryKey=function(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,s){t&&(r[t]=s)})),r}(0,a.query),a}},732:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.yeast=t.decode=t.encode=void 0;const r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),s={};let n,o=0,i=0;function a(e){let t="";do{t=r[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}for(t.encode=a,t.decode=function(e){let t=0;for(i=0;i<e.length;i++)t=64*t+s[e.charAt(i)];return t},t.yeast=function(){const e=a(+new Date);return e!==n?(o=0,n=e):e+"."+a(o++)};i<64;i++)s[r[i]]=i},235:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalThisShim=void 0,t.globalThisShim="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},956:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nextTick=t.parse=t.installTimerFunctions=t.transports=t.Transport=t.protocol=t.Socket=void 0;const s=r(223);Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return s.Socket}}),t.protocol=s.Socket.protocol;var n=r(689);Object.defineProperty(t,"Transport",{enumerable:!0,get:function(){return n.Transport}});var o=r(419);Object.defineProperty(t,"transports",{enumerable:!0,get:function(){return o.transports}});var i=r(374);Object.defineProperty(t,"installTimerFunctions",{enumerable:!0,get:function(){return i.installTimerFunctions}});var a=r(15);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return a.parse}});var c=r(87);Object.defineProperty(t,"nextTick",{enumerable:!0,get:function(){return c.nextTick}})},223:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;const n=r(419),o=r(374),i=r(661),a=r(15),c=s(r(833)),h=r(285),u=r(376),l=(0,c.default)("engine.io-client:socket");class d extends h.Emitter{constructor(e,t={}){super(),e&&"object"==typeof e&&(t=e,e=null),e?(e=(0,a.parse)(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=(0,a.parse)(t.host).host),(0,o.installTimerFunctions)(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=(0,i.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){l('creating transport "%s"',e);const t=Object.assign({},this.opts.query);t.EIO=u.protocol,t.transport=e,this.id&&(t.sid=this.id);const r=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return l("options: %j",r),new n.transports[e](r)}open(){let e;if(this.opts.rememberUpgrade&&d.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return l("error while creating transport: %s",e),this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){l("setting transport %s",e.name),this.transport&&(l("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){l('probing transport "%s"',e);let t=this.createTransport(e),r=!1;d.priorWebsocketSuccess=!1;const s=()=>{r||(l('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(s=>{if(!r)if("pong"===s.type&&"probe"===s.data){if(l('probe transport "%s" pong',e),this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;d.priorWebsocketSuccess="websocket"===t.name,l('pausing current transport "%s"',this.transport.name),this.transport.pause((()=>{r||"closed"!==this.readyState&&(l("changing transport and sending upgrade packet"),h(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{l('probe transport "%s" failed',e);const r=new Error("probe error");r.transport=t.name,this.emitReserved("upgradeError",r)}})))};function n(){r||(r=!0,h(),t.close(),t=null)}const o=r=>{const s=new Error("probe error: "+r);s.transport=t.name,n(),l('probe transport "%s" failed because of error: %s',e,r),this.emitReserved("upgradeError",s)};function i(){o("transport closed")}function a(){o("socket closed")}function c(e){t&&e.name!==t.name&&(l('"%s" works - aborting "%s"',e.name,t.name),n())}const h=()=>{t.removeListener("open",s),t.removeListener("error",o),t.removeListener("close",i),this.off("close",a),this.off("upgrading",c)};t.once("open",s),t.once("error",o),t.once("close",i),this.once("close",a),this.once("upgrading",c),t.open()}onOpen(){if(l("socket open"),this.readyState="open",d.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){l("starting upgrade probes");let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(l('socket receive: type "%s", data "%s"',e.type,e.data),this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}else l('packet received with socket readyState "%s"',this.readyState)}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();l("flushing %d packets in socket",e.length),this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const r=this.writeBuffer[t].data;if(r&&(e+=(0,o.byteLength)(r)),t>0&&e>this.maxPayload)return l("only send %d out of %d packets",t,this.writeBuffer.length),this.writeBuffer.slice(0,t);e+=2}return l("payload size is %d (max: %d)",e,this.maxPayload),this.writeBuffer}write(e,t,r){return this.sendPacket("message",e,t,r),this}send(e,t,r){return this.sendPacket("message",e,t,r),this}sendPacket(e,t,r,s){if("function"==typeof t&&(s=t,t=void 0),"function"==typeof r&&(s=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;const n={type:e,data:t,options:r};this.emitReserved("packetCreate",n),this.writeBuffer.push(n),s&&this.once("flush",s),this.flush()}close(){const e=()=>{this.onClose("forced close"),l("socket closing - telling transport to close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},r=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?r():e()})):this.upgrading?r():e()),this}onError(e){l("socket error %j",e),d.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(l('socket close with reason: "%s"',e),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let r=0;const s=e.length;for(;r<s;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}t.Socket=d,d.protocol=u.protocol},689:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Transport=void 0;const n=r(376),o=r(285),i=r(374),a=(0,s(r(833)).default)("engine.io-client:transport");class c extends Error{constructor(e,t,r){super(e),this.description=t,this.context=r,this.type="TransportError"}}class h extends o.Emitter{constructor(e){super(),this.writable=!1,(0,i.installTimerFunctions)(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t,r){return super.emitReserved("error",new c(e,t,r)),this}open(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState?this.write(e):a("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=(0,n.decodePacket)(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}t.Transport=h},419:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transports=void 0;const s=r(528),n=r(716);t.transports={websocket:n.WS,polling:s.Polling}},528:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Request=t.Polling=void 0;const n=r(689),o=s(r(833)),i=r(732),a=r(661),c=r(376),h=r(519),u=r(285),l=r(374),d=r(235),p=(0,o.default)("engine.io-client:polling");function f(){}const y=null!=new h.XHR({xdomain:!1}).responseType;class m extends n.Transport{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let r=location.port;r||(r=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||r!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=y&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{p("paused"),this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(p("we are currently polling - waiting to pause"),e++,this.once("pollComplete",(function(){p("pre-pause polling complete"),--e||t()}))),this.writable||(p("we are currently writing - waiting to pause"),e++,this.once("drain",(function(){p("pre-pause writing complete"),--e||t()})))}else t()}poll(){p("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){p("polling got data %s",e),(0,c.decodePayload)(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState?this.poll():p('ignoring poll - transport state "%s"',this.readyState))}doClose(){const e=()=>{p("writing close packet"),this.write([{type:"close"}])};"open"===this.readyState?(p("transport open - closing"),e()):(p("transport not open - deferring close"),this.once("open",e))}write(e){this.writable=!1,(0,c.encodePayload)(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let r="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=(0,i.yeast)()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(r=":"+this.opts.port);const s=(0,a.encode)(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(s.length?"?"+s:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new g(this.uri(),e)}doWrite(e,t){const r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){p("xhr poll");const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}t.Polling=m;class g extends u.Emitter{constructor(e,t){super(),(0,l.installTimerFunctions)(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=(0,l.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new h.XHR(e);try{p("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},p("xhr data %s",this.data),t.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=g.requestsCount++,g.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=f,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete g.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(t.Request=g,g.requestsCount=0,g.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",b);else if("function"==typeof addEventListener){const e="onpagehide"in d.globalThisShim?"pagehide":"unload";addEventListener(e,b,!1)}function b(){for(let e in g.requests)g.requests.hasOwnProperty(e)&&g.requests[e].abort()}},87:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultBinaryType=t.usingBrowserWebSocket=t.WebSocket=t.nextTick=void 0;const s=r(235);t.nextTick="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),t.WebSocket=s.globalThisShim.WebSocket||s.globalThisShim.MozWebSocket,t.usingBrowserWebSocket=!0,t.defaultBinaryType="arraybuffer"},716:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WS=void 0;const n=r(689),o=r(661),i=r(732),a=r(374),c=r(87),h=s(r(833)),u=r(376),l=(0,h.default)("engine.io-client:websocket"),d="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class p extends n.Transport{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,r=d?{}:(0,a.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=c.usingBrowserWebSocket&&!d?t?new c.WebSocket(e,t):new c.WebSocket(e):new c.WebSocket(e,t,r)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType||c.defaultBinaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],s=t===e.length-1;(0,u.encodePacket)(r,this.supportsBinary,(e=>{const t={};!c.usingBrowserWebSocket&&(r.options&&(t.compress=r.options.compress),this.opts.perMessageDeflate)&&("string"==typeof e?Buffer.byteLength(e):e.length)<this.opts.perMessageDeflate.threshold&&(t.compress=!1);try{c.usingBrowserWebSocket?this.ws.send(e):this.ws.send(e,t)}catch(e){l("websocket closed before onclose event")}s&&(0,c.nextTick)((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let r="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(r=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=(0,i.yeast)()),this.supportsBinary||(e.b64=1);const s=(0,o.encode)(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(s.length?"?"+s:"")}check(){return!!c.WebSocket}}t.WS=p},519:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHR=void 0;const s=r(110),n=r(235);t.XHR=function(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||s.hasCORS))return new XMLHttpRequest}catch(e){}if(!t)try{return new(n.globalThisShim[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}},374:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.byteLength=t.installTimerFunctions=t.pick=void 0;const s=r(235);t.pick=function(e,...t){return t.reduce(((t,r)=>(e.hasOwnProperty(r)&&(t[r]=e[r]),t)),{})};const n=setTimeout,o=clearTimeout;t.installTimerFunctions=function(e,t){t.useNativeTimers?(e.setTimeoutFn=n.bind(s.globalThisShim),e.clearTimeoutFn=o.bind(s.globalThisShim)):(e.setTimeoutFn=setTimeout.bind(s.globalThisShim),e.clearTimeoutFn=clearTimeout.bind(s.globalThisShim))},t.byteLength=function(e){return"string"==typeof e?function(e){let t=0,r=0;for(let s=0,n=e.length;s<n;s++)t=e.charCodeAt(s),t<128?r+=1:t<2048?r+=2:t<55296||t>=57344?r+=3:(s++,r+=4);return r}(e):Math.ceil(1.33*(e.byteLength||e.size))}},46:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_PACKET=t.PACKET_TYPES_REVERSE=t.PACKET_TYPES=void 0;const r=Object.create(null);t.PACKET_TYPES=r,r.open="0",r.close="1",r.ping="2",r.pong="3",r.message="4",r.upgrade="5",r.noop="6";const s=Object.create(null);t.PACKET_TYPES_REVERSE=s,Object.keys(r).forEach((e=>{s[r[e]]=e})),t.ERROR_PACKET={type:"error",data:"parser error"}},745:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0;const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)s[r.charCodeAt(e)]=e;t.encode=e=>{let t,s=new Uint8Array(e),n=s.length,o="";for(t=0;t<n;t+=3)o+=r[s[t]>>2],o+=r[(3&s[t])<<4|s[t+1]>>4],o+=r[(15&s[t+1])<<2|s[t+2]>>6],o+=r[63&s[t+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o},t.decode=e=>{let t,r,n,o,i,a=.75*e.length,c=e.length,h=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const u=new ArrayBuffer(a),l=new Uint8Array(u);for(t=0;t<c;t+=4)r=s[e.charCodeAt(t)],n=s[e.charCodeAt(t+1)],o=s[e.charCodeAt(t+2)],i=s[e.charCodeAt(t+3)],l[h++]=r<<2|n>>4,l[h++]=(15&n)<<4|o>>2,l[h++]=(3&o)<<6|63&i;return u}},662:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(46),n=r(745),o="function"==typeof ArrayBuffer,i=(e,t)=>{if(o){const r=(0,n.decode)(e);return a(r,t)}return{base64:!0,data:e}},a=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e;t.default=(e,t)=>{if("string"!=typeof e)return{type:"message",data:a(e,t)};const r=e.charAt(0);return"b"===r?{type:"message",data:i(e.substring(1),t)}:s.PACKET_TYPES_REVERSE[r]?e.length>1?{type:s.PACKET_TYPES_REVERSE[r],data:e.substring(1)}:{type:s.PACKET_TYPES_REVERSE[r]}:s.ERROR_PACKET}},686:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=r(46),n="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),o="function"==typeof ArrayBuffer,i=(e,t)=>{const r=new FileReader;return r.onload=function(){const e=r.result.split(",")[1];t("b"+e)},r.readAsDataURL(e)};t.default=({type:e,data:t},r,a)=>{return n&&t instanceof Blob?r?a(t):i(t,a):o&&(t instanceof ArrayBuffer||(c=t,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(c):c&&c.buffer instanceof ArrayBuffer))?r?a(t):i(new Blob([t]),a):a(s.PACKET_TYPES[e]+(t||""));var c}},376:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodePayload=t.decodePacket=t.encodePayload=t.encodePacket=t.protocol=void 0;const s=r(686);t.encodePacket=s.default;const n=r(662);t.decodePacket=n.default;const o=String.fromCharCode(30);t.encodePayload=(e,t)=>{const r=e.length,n=new Array(r);let i=0;e.forEach(((e,a)=>{(0,s.default)(e,!1,(e=>{n[a]=e,++i===r&&t(n.join(o))}))}))},t.decodePayload=(e,t)=>{const r=e.split(o),s=[];for(let e=0;e<r.length;e++){const o=(0,n.default)(r[e],t);if(s.push(o),"error"===o.type)break}return s},t.protocol=4},743:(e,t)=>{"use strict";function r(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Object.defineProperty(t,"__esModule",{value:!0}),t.Backoff=void 0,t.Backoff=r,r.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+r:e-r}return 0|Math.min(e,this.max)},r.prototype.reset=function(){this.attempts=0},r.prototype.setMin=function(e){this.ms=e},r.prototype.setMax=function(e){this.max=e},r.prototype.setJitter=function(e){this.jitter=e}},7:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const n=r(894),o=r(776);Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return o.Manager}});const i=r(214);Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return i.Socket}});const a=s(r(833)).default("socket.io-client"),c={};function h(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};const r=n.url(e,t.path||"/socket.io"),s=r.source,i=r.id,h=r.path,u=c[i]&&h in c[i].nsps;let l;return t.forceNew||t["force new connection"]||!1===t.multiplex||u?(a("ignoring socket cache for %s",s),l=new o.Manager(s,t)):(c[i]||(a("new io instance for %s",s),c[i]=new o.Manager(s,t)),l=c[i]),r.query&&!t.query&&(t.query=r.queryKey),l.socket(r.path,t)}t.io=h,t.connect=h,t.default=h,Object.assign(h,{Manager:o.Manager,Socket:i.Socket,io:h,connect:h});var u=r(627);Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return u.protocol}}),e.exports=h},776:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return n(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Manager=void 0;const a=r(956),c=r(214),h=o(r(627)),u=r(942),l=r(743),d=r(285),p=i(r(833)).default("socket.io-client:manager");class f extends d.Emitter{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,a.installTimerFunctions(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=t.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new l.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const s=t.parser||h;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(p("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;p("opening %s",this.uri),this.engine=new a.Socket(this.uri,this.opts);const t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=u.on(t,"open",(function(){r.onopen(),e&&e()})),n=u.on(t,"error",(t=>{p("error"),r.cleanup(),r._readyState="closed",this.emitReserved("error",t),e?e(t):r.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;p("connect attempt will timeout after %d",e),0===e&&s();const r=this.setTimeoutFn((()=>{p("connect attempt timed out after %d",e),s(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&r.unref(),this.subs.push((function(){clearTimeout(r)}))}return this.subs.push(s),this.subs.push(n),this}connect(e){return this.open(e)}onopen(){p("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(u.on(e,"ping",this.onping.bind(this)),u.on(e,"data",this.ondata.bind(this)),u.on(e,"error",this.onerror.bind(this)),u.on(e,"close",this.onclose.bind(this)),u.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){a.nextTick((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){p("error",e),this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r||(r=new c.Socket(this,e,t),this.nsps[e]=r),r}_destroy(e){const t=Object.keys(this.nsps);for(const e of t)if(this.nsps[e].active)return void p("socket %s is still active, skipping close",e);this._close()}_packet(e){p("writing packet %j",e);const t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){p("cleanup"),this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){p("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){p("closed due to %s",e),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)p("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();p("will wait %dms before reconnect attempt",t),this._reconnecting=!0;const r=this.setTimeoutFn((()=>{e.skipReconnect||(p("attempting reconnect"),this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(p("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):(p("reconnect success"),e.onreconnect())})))}),t);this.opts.autoUnref&&r.unref(),this.subs.push((function(){clearTimeout(r)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}t.Manager=f},942:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.on=void 0,t.on=function(e,t,r){return e.on(t,r),function(){e.off(t,r)}}},214:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;const n=r(627),o=r(942),i=r(285),a=s(r(833)).default("socket.io-client:socket"),c=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class h extends i.Emitter{constructor(e,t,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[o.on(e,"open",this.onopen.bind(this)),o.on(e,"packet",this.onpacket.bind(this)),o.on(e,"error",this.onerror.bind(this)),o.on(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(c.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');t.unshift(e);const r={type:n.PacketType.EVENT,data:t,options:{}};if(r.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++;a("emitting packet with ack id %d",e);const s=t.pop();this._registerAckCallback(e,s),r.id=e}const s=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return!this.flags.volatile||s&&this.connected?this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r):a("discard packet as the transport is not currently writable"),this.flags={},this}_registerAckCallback(e,t){const r=this.flags.timeout;if(void 0===r)return void(this.acks[e]=t);const s=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&(a("removing packet with ack id %d from the buffer",e),this.sendBuffer.splice(t,1));a("event with ack id %d has timed out after %d ms",e,r),t.call(this,new Error("operation has timed out"))}),r);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(s),t.apply(this,[null,...e])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){a("transport is open - connecting"),"function"==typeof this.auth?this.auth((e=>{this.packet({type:n.PacketType.CONNECT,data:e})})):this.packet({type:n.PacketType.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){a("close (%s)",e),this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case n.PacketType.CONNECT:if(e.data&&e.data.sid){const t=e.data.sid;this.onconnect(t)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case n.PacketType.EVENT:case n.PacketType.BINARY_EVENT:this.onevent(e);break;case n.PacketType.ACK:case n.PacketType.BINARY_ACK:this.onack(e);break;case n.PacketType.DISCONNECT:this.ondisconnect();break;case n.PacketType.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];a("emitting event %j",t),null!=e.id&&(a("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const r of t)r.apply(this,e)}super.emit.apply(this,e)}ack(e){const t=this;let r=!1;return function(...s){r||(r=!0,a("sending ack %j",s),t.packet({type:n.PacketType.ACK,id:e,data:s}))}}onack(e){const t=this.acks[e.id];"function"==typeof t?(a("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):a("bad ack %s",e.id)}onconnect(e){a("socket connected with id %s",e),this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){a("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(a("performing disconnect (%s)",this.nsp),this.packet({type:n.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const r of t)r.apply(this,e.data)}}}t.Socket=h},894:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.url=void 0;const n=r(956),o=s(r(833)).default("socket.io-client:url");t.url=function(e,t="",r){let s=e;r=r||"undefined"!=typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(o("protocol-less url %s",e),e=void 0!==r?r.protocol+"//"+e:"https://"+e),o("parse %s",e),s=n.parse(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const i=-1!==s.host.indexOf(":")?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+i+":"+s.port+t,s.href=s.protocol+"://"+i+(r&&r.port===s.port?"":":"+s.port),s}},926:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reconstructPacket=t.deconstructPacket=void 0;const s=r(133);function n(e,t){if(!e)return e;if(s.isBinary(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}if(Array.isArray(e)){const r=new Array(e.length);for(let s=0;s<e.length;s++)r[s]=n(e[s],t);return r}if("object"==typeof e&&!(e instanceof Date)){const r={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=n(e[s],t));return r}return e}function o(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=o(e[r],t);else if("object"==typeof e)for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=o(e[r],t));return e}t.deconstructPacket=function(e){const t=[],r=e.data,s=e;return s.data=n(r,t),s.attachments=t.length,{packet:s,buffers:t}},t.reconstructPacket=function(e,t){return e.data=o(e.data,t),e.attachments=void 0,e}},627:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.PacketType=t.protocol=void 0;const s=r(285),n=r(926),o=r(133),i=r(833).default("socket.io-parser");var a;t.protocol=5,function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(a=t.PacketType||(t.PacketType={})),t.Encoder=class{constructor(e){this.replacer=e}encode(e){return i("encoding packet %j",e),e.type!==a.EVENT&&e.type!==a.ACK||!o.hasBinary(e)?[this.encodeAsString(e)]:(e.type=e.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,this.encodeAsBinary(e))}encodeAsString(e){let t=""+e.type;return e.type!==a.BINARY_EVENT&&e.type!==a.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),i("encoded %j as %s",e,t),t}encodeAsBinary(e){const t=n.deconstructPacket(e),r=this.encodeAsString(t.packet),s=t.buffers;return s.unshift(r),s}};class c extends s.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e),t.type===a.BINARY_EVENT||t.type===a.BINARY_ACK?(this.reconstructor=new h(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!o.isBinary(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const r={type:Number(e.charAt(0))};if(void 0===a[r.type])throw new Error("unknown packet type "+r.type);if(r.type===a.BINARY_EVENT||r.type===a.BINARY_ACK){const s=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const n=e.substring(s,t);if(n!=Number(n)||"-"!==e.charAt(t))throw new Error("Illegal attachments");r.attachments=Number(n)}if("/"===e.charAt(t+1)){const s=t+1;for(;++t&&","!==e.charAt(t)&&t!==e.length;);r.nsp=e.substring(s,t)}else r.nsp="/";const s=e.charAt(t+1);if(""!==s&&Number(s)==s){const s=t+1;for(;++t;){const r=e.charAt(t);if(null==r||Number(r)!=r){--t;break}if(t===e.length)break}r.id=Number(e.substring(s,t+1))}if(e.charAt(++t)){const s=this.tryParse(e.substr(t));if(!c.isPayloadValid(r.type,s))throw new Error("invalid payload");r.data=s}return i("decoded %s as %j",e,r),r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case a.CONNECT:return"object"==typeof t;case a.DISCONNECT:return void 0===t;case a.CONNECT_ERROR:return"string"==typeof t||"object"==typeof t;case a.EVENT:case a.BINARY_EVENT:return Array.isArray(t)&&t.length>0;case a.ACK:case a.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}t.Decoder=c;class h{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=n.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},133:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasBinary=t.isBinary=void 0;const r="function"==typeof ArrayBuffer,s=Object.prototype.toString,n="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===s.call(Blob),o="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===s.call(File);function i(e){return r&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||n&&e instanceof Blob||o&&e instanceof File}t.isBinary=i,t.hasBinary=function e(t,r){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let r=0,s=t.length;r<s;r++)if(e(t[r]))return!0;return!1}if(i(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return!0;return!1}},285:(e,t,r)=>{"use strict";function s(e){if(e)return function(e){for(var t in s.prototype)e[t]=s.prototype[t];return e}(e)}r.r(t),r.d(t,{Emitter:()=>s}),s.prototype.on=s.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},s.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},s.prototype.off=s.prototype.removeListener=s.prototype.removeAllListeners=s.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,s=this._callbacks["$"+e];if(!s)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var n=0;n<s.length;n++)if((r=s[n])===t||r.fn===t){s.splice(n,1);break}return 0===s.length&&delete this._callbacks["$"+e],this},s.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],s=1;s<arguments.length;s++)t[s-1]=arguments[s];if(r){s=0;for(var n=(r=r.slice(0)).length;s<n;++s)r[s].apply(this,t)}return this},s.prototype.emitReserved=s.prototype.emit,s.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},s.prototype.hasListeners=function(e){return!!this.listeners(e).length}}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return r[e].call(o.exports,o,o.exports,n),o.exports}return n.m=r,n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".omneedia.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="omneedia:",n.l=(r,s,o,i)=>{if(e[r])e[r].push(s);else{var a,c;if(void 0!==o)for(var h=document.getElementsByTagName("script"),u=0;u<h.length;u++){var l=h[u];if(l.getAttribute("src")==r||l.getAttribute("data-webpack")==t+o){a=l;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,n.nc&&a.setAttribute("nonce",n.nc),a.setAttribute("data-webpack",t+o),a.src=r),e[r]=[s];var d=(t,s)=>{a.onerror=a.onload=null,clearTimeout(p);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(s))),t)return t(s)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),c&&document.head.appendChild(a)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var s=r.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=r[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={792:0};n.f.j=(t,r)=>{var s=n.o(e,t)?e[t]:void 0;if(0!==s)if(s)r.push(s[2]);else{var o=new Promise(((r,n)=>s=e[t]=[r,n]));r.push(s[2]=o);var i=n.p+n.u(t),a=new Error;n.l(i,(r=>{if(n.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,s[1](a)}}),"chunk-"+t,t)}};var t=(t,r)=>{var s,o,[i,a,c]=r,h=0;if(i.some((t=>0!==e[t]))){for(s in a)n.o(a,s)&&(n.m[s]=a[s]);c&&c(n)}for(t&&t(r);h<i.length;h++)o=i[h],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=self.webpackChunkomneedia=self.webpackChunkomneedia||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),n(440)})()));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! Capacitor: https://capacitorjs.com/ - MIT License */
|
package/src/OmneediaClient.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { io } from 'socket.io-client'
|
|
2
|
-
import OmneediaQueryDB from './lib/db'
|
|
3
|
-
import OmneediaRealtime from './lib/realtime'
|
|
4
|
-
import OmneediaAuth from './lib/auth'
|
|
5
|
-
import OmneediaRequest from './lib/request'
|
|
6
|
-
import prefix from './env/prefix'
|
|
7
|
-
import type { GenericSchema } from './lib/types'
|
|
8
|
-
|
|
9
|
-
export default class OmneediaClient<
|
|
10
|
-
Database = any,
|
|
11
|
-
SchemaName extends string & keyof Database = 'public' extends keyof Database
|
|
12
|
-
? 'public'
|
|
13
|
-
: string & keyof Database,
|
|
14
|
-
Schema extends GenericSchema = Database[SchemaName] extends GenericSchema
|
|
15
|
-
? Database[SchemaName]
|
|
16
|
-
: any
|
|
17
|
-
> {
|
|
18
|
-
protected PREFIX = prefix
|
|
19
|
-
|
|
20
|
-
public auth: OmneediaAuth
|
|
21
|
-
public options: any
|
|
22
|
-
|
|
23
|
-
protected KEY: String = ''
|
|
24
|
-
protected URI: String = ''
|
|
25
|
-
protected request: any
|
|
26
|
-
protected socket: any = null
|
|
27
|
-
|
|
28
|
-
protected headers() {
|
|
29
|
-
return {
|
|
30
|
-
'Content-Type': 'application/json',
|
|
31
|
-
Authorization: 'Basic ' + this.KEY,
|
|
32
|
-
apikey: this.KEY,
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
constructor(protected omneediaUrl: String, protected omneediaKey: String, options?: any) {
|
|
37
|
-
if (!omneediaUrl) throw new Error('omneediaUrl is required.')
|
|
38
|
-
if (!omneediaKey) throw new Error('omneediaKey is required.')
|
|
39
|
-
this.URI = omneediaUrl
|
|
40
|
-
this.KEY = omneediaKey
|
|
41
|
-
this.request = new OmneediaRequest(this)
|
|
42
|
-
this.auth = new OmneediaAuth(this, options)
|
|
43
|
-
this.options = options
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
public from(table: string) {
|
|
47
|
-
return new OmneediaQueryDB(table, this)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public channel(channel: string) {
|
|
51
|
-
this.socket = io(String(this.URI), {
|
|
52
|
-
path: this.PREFIX.REALTIME,
|
|
53
|
-
withCredentials: true,
|
|
54
|
-
extraHeaders: {
|
|
55
|
-
apikey: `${this.KEY}`,
|
|
56
|
-
Authorization: `Bearer ${this.KEY}`,
|
|
57
|
-
},
|
|
58
|
-
})
|
|
59
|
-
this.socket.on('connect_error', function (e: any) {
|
|
60
|
-
if (e.description == 401) throw `Invalid authentication credentials (401)`
|
|
61
|
-
throw `unhandled exception`
|
|
62
|
-
})
|
|
63
|
-
return new OmneediaRealtime(channel, this)
|
|
64
|
-
}
|
|
65
|
-
}
|
package/src/env/prefix-dev.ts
DELETED
package/src/env/prefix-prod.ts
DELETED
package/src/env/prefix.ts
DELETED
package/src/index.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import OmneediaClient from './OmneediaClient'
|
|
2
|
-
import { GenericSchema } from './lib/types'
|
|
3
|
-
export { OmneediaClient as omneediaClient }
|
|
4
|
-
export { OmneediaClient as OmneediaClient }
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Omneedia Client.
|
|
8
|
-
*
|
|
9
|
-
* An isomorphic Javascript client for interacting with Postgres.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
export const createClient = <
|
|
13
|
-
Database = any,
|
|
14
|
-
SchemaName extends string & keyof Database = 'public' extends keyof Database
|
|
15
|
-
? 'public'
|
|
16
|
-
: string & keyof Database,
|
|
17
|
-
Schema extends GenericSchema = Database[SchemaName] extends GenericSchema
|
|
18
|
-
? Database[SchemaName]
|
|
19
|
-
: any
|
|
20
|
-
>(
|
|
21
|
-
omneediaUrl: string,
|
|
22
|
-
omneediaKey: string,
|
|
23
|
-
options?: any
|
|
24
|
-
): OmneediaClient => {
|
|
25
|
-
return new OmneediaClient(omneediaUrl, omneediaKey, options)
|
|
26
|
-
}
|