var as=Object.defineProperty;var is=(e,r,t)=>r in e?as(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var D=(e,r,t)=>is(e,typeof r!="symbol"?r+"":r,t);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=t(a);fetch(a.href,i)}})();var De=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function os(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bg(e){if(e.__esModule)return e;var r=e.default;if(typeof r=="function"){var t=function n(){return this instanceof n?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),t}const ss={"filter:api.trending-videos.videos.list.params":!0,"filter:api.trending-videos.videos.list.result":!0,"filter:api.most-liked-videos.videos.list.params":!0,"filter:api.most-liked-videos.videos.list.result":!0,"filter:api.local-videos.videos.list.params":!0,"filter:api.local-videos.videos.list.result":!0,"filter:api.recently-added-videos.videos.list.params":!0,"filter:api.recently-added-videos.videos.list.result":!0,"filter:api.user-subscriptions-videos.videos.list.params":!0,"filter:api.user-subscriptions-videos.videos.list.result":!0,"filter:api.video-watch.video.get.params":!0,"filter:api.video-watch.video.get.result":!0,"filter:api.video-watch.video-playlist-elements.get.params":!0,"filter:api.video-watch.video-playlist-elements.get.result":!0,"filter:api.video-watch.video-threads.list.params":!0,"filter:api.video-watch.video-threads.list.result":!0,"filter:api.video-watch.video-thread-replies.list.params":!0,"filter:api.video-watch.video-thread-replies.list.result":!0,"filter:api.search.videos.list.params":!0,"filter:api.search.videos.list.result":!0,"filter:api.search.video-channels.list.params":!0,"filter:api.search.video-channels.list.result":!0,"filter:api.search.video-playlists.list.params":!0,"filter:api.search.video-playlists.list.result":!0,"filter:api.signup.registration.create.params":!0,"filter:api.my-library.video-playlist-elements.list.params":!0,"filter:api.my-library.video-playlist-elements.list.result":!0,"filter:internal.video-watch.player.build-options.params":!0,"filter:internal.video-watch.player.build-options.result":!0,"filter:internal.video-watch.player.load-options.params":!0,"filter:internal.video-watch.player.load-options.result":!0,"filter:internal.common.svg-icons.get-content.params":!0,"filter:internal.common.svg-icons.get-content.result":!0,"filter:left-menu.links.create.result":!0,"filter:upload.messages.create.result":!0,"filter:login.instance-about-plugin-panels.create.result":!0,"filter:signup.instance-about-plugin-panels.create.result":!0,"filter:share.video-embed-code.build.params":!0,"filter:share.video-embed-code.build.result":!0,"filter:share.video-playlist-embed-code.build.params":!0,"filter:share.video-playlist-embed-code.build.result":!0,"filter:share.video-embed-url.build.params":!0,"filter:share.video-embed-url.build.result":!0,"filter:share.video-playlist-embed-url.build.params":!0,"filter:share.video-playlist-embed-url.build.result":!0,"filter:share.video-url.build.params":!0,"filter:share.video-url.build.result":!0,"filter:share.video-playlist-url.build.params":!0,"filter:share.video-playlist-url.build.result":!0,"filter:video-watch.video-plugin-metadata.result":!0,"filter:internal.player.videojs.options.result":!0,"filter:internal.player.p2p-media-loader.options.result":!0},us={"action:application.init":!0,"action:video-watch.init":!0,"action:video-watch.video.loaded":!0,"action:video-watch.player.loaded":!0,"action:video-watch.video-threads.loaded":!0,"action:video-watch.video-thread-replies.loaded":!0,"action:video-channel-create.init":!0,"action:video-channel-update.init":!0,"action:video-channel-update.video-channel.loaded":!0,"action:video-channel-videos.init":!0,"action:video-channel-videos.video-channel.loaded":!0,"action:video-channel-videos.videos.loaded":!0,"action:video-channel-playlists.init":!0,"action:video-channel-playlists.video-channel.loaded":!0,"action:video-channel-playlists.playlists.loaded":!0,"action:video-edit.init":!0,"action:video-edit.form.updated":!0,"action:login.init":!0,"action:search.init":!0,"action:router.navigation-end":!0,"action:signup.register.init":!0,"action:admin-plugin-settings.init":!0,"action:video-upload.init":!0,"action:video-url-import.init":!0,"action:video-torrent-import.init":!0,"action:go-live.init":!0,"action:auth-user.logged-in":!0,"action:auth-user.logged-out":!0,"action:auth-user.information-loaded":!0,"action:modal.video-download.shown":!0,"action:modal.share.shown":!0,"action:embed.player.loaded":!0},cs=Object.assign({},ss,us),ls={"filter:api.videos.list.params":!0,"filter:api.videos.list.result":!0,"filter:api.video-playlist.videos.list.params":!0,"filter:api.video-playlist.videos.list.result":!0,"filter:api.accounts.videos.list.params":!0,"filter:api.accounts.videos.list.result":!0,"filter:api.video-channels.videos.list.params":!0,"filter:api.video-channels.videos.list.result":!0,"filter:api.user.me.videos.list.params":!0,"filter:api.user.me.videos.list.result":!0,"filter:api.overviews.videos.list.params":!0,"filter:api.overviews.videos.list.result":!0,"filter:api.user.me.subscription-videos.list.params":!0,"filter:api.user.me.subscription-videos.list.result":!0,"filter:api.search.videos.local.list.params":!0,"filter:api.search.videos.local.list.result":!0,"filter:api.search.videos.index.list.params":!0,"filter:api.search.videos.index.list.result":!0,"filter:api.search.video-channels.local.list.params":!0,"filter:api.search.video-channels.local.list.result":!0,"filter:api.search.video-channels.index.list.params":!0,"filter:api.search.video-channels.index.list.result":!0,"filter:api.search.video-playlists.local.list.params":!0,"filter:api.search.video-playlists.local.list.result":!0,"filter:api.search.video-playlists.index.list.params":!0,"filter:api.search.video-playlists.index.list.result":!0,"filter:api.video.get.result":!0,"filter:api.video-channels.list.params":!0,"filter:api.video-channels.list.result":!0,"filter:api.video-channel.get.result":!0,"filter:api.video.upload.accept.result":!0,"filter:api.live-video.create.accept.result":!0,"filter:api.video.pre-import-url.accept.result":!0,"filter:api.video.pre-import-torrent.accept.result":!0,"filter:api.video.post-import-url.accept.result":!0,"filter:api.video.post-import-torrent.accept.result":!0,"filter:api.video.update-file.accept.result":!0,"filter:api.video.user-import.accept.result":!0,"filter:api.video-thread.create.accept.result":!0,"filter:api.video-comment-reply.create.accept.result":!0,"filter:api.video.upload.video-attribute.result":!0,"filter:api.video.import-url.video-attribute.result":!0,"filter:api.video.import-torrent.video-attribute.result":!0,"filter:api.video.live.video-attribute.result":!0,"filter:api.video.user-import.video-attribute.result":!0,"filter:api.video-threads.list.params":!0,"filter:api.video-threads.list.result":!0,"filter:api.video-thread-comments.list.params":!0,"filter:api.video-thread-comments.list.result":!0,"filter:api.server.stats.get.result":!0,"filter:video.auto-blacklist.result":!0,"filter:api.user.signup.allowed.result":!0,"filter:api.user.request-signup.allowed.result":!0,"filter:api.download.video.allowed.result":!0,"filter:api.download.generated-video.allowed.result":!0,"filter:api.download.torrent.allowed.result":!0,"filter:html.embed.video.allowed.result":!0,"filter:html.embed.video-playlist.allowed.result":!0,"filter:html.client.json-ld.result":!0,"filter:job-queue.process.params":!0,"filter:job-queue.process.result":!0,"filter:transcoding.manual.resolutions-to-transcode.result":!0,"filter:transcoding.auto.resolutions-to-transcode.result":!0,"filter:activity-pub.remote-video-comment.create.accept.result":!0,"filter:activity-pub.activity.context.build.result":!0,"filter:activity-pub.video.json-ld.build.result":!0,"filter:feed.podcast.rss.create-custom-xmlns.result":!0,"filter:feed.podcast.channel.create-custom-tags.result":!0,"filter:feed.podcast.video.create-custom-tags.result":!0,"filter:api.user.me.get.result":!0},fs={"action:application.listening":!0,"action:notifier.notification.created":!0,"action:api.video.updated":!0,"action:api.video.deleted":!0,"action:api.video.uploaded":!0,"action:api.video.viewed":!0,"action:api.video.file-updated":!0,"action:api.video-channel.created":!0,"action:api.video-channel.updated":!0,"action:api.video-channel.deleted":!0,"action:api.live-video.created":!0,"action:live.video.state.updated":!0,"action:api.video-thread.created":!0,"action:api.video-comment-reply.created":!0,"action:api.video-comment.deleted":!0,"action:api.video-caption.created":!0,"action:api.video-caption.deleted":!0,"action:api.user.blocked":!0,"action:api.user.unblocked":!0,"action:api.user.registered":!0,"action:api.user.requested-registration":!0,"action:api.user.created":!0,"action:api.user.deleted":!0,"action:api.user.updated":!0,"action:api.user.oauth2-got-token":!0,"action:api.video-playlist-element.created":!0,"action:activity-pub.remote-video.created":!0,"action:activity-pub.remote-video.updated":!0};Object.assign({},ls,fs);const Ee={STATIC:1,ACTION:2,FILTER:3},bn={PLUGIN:1,THEME:2};function gn(e){return e&&typeof e.then=="function"}function vs(e){return e&&typeof e.catch=="function"}const ds={"en-US":"English",ar:"العربية","ca-ES":"Català","cs-CZ":"Čeština","de-DE":"Deutsch","el-GR":"ελληνικά",eo:"Esperanto","es-ES":"Español","eu-ES":"Euskara","fa-IR":"فارسی","fi-FI":"Suomi","fr-FR":"Français",gd:"Gàidhlig","gl-ES":"Galego",hr:"Hrvatski","hu-HU":"Magyar",is:"Íslenska","it-IT":"Italiano","ja-JP":"日本語",kab:"Taqbaylit","nb-NO":"Norsk bokmål","nl-NL":"Nederlands",nn:"Norsk nynorsk",oc:"Occitan","pl-PL":"Polski","pt-BR":"Português (Brasil)","pt-PT":"Português (Portugal)","ru-RU":"Pусский",sq:"Shqip","sv-SE":"Svenska","th-TH":"ไทย",tok:"Toki Pona","tr-TR":"Türkçe","uk-UA":"украї́нська мо́ва","vi-VN":"Tiếng Việt","zh-Hans-CN":"简体中文（中国）","zh-Hant-TW":"繁體中文（台灣）"},Ya={"ar-001":"ar",ca:"ca-ES",cs:"cs-CZ",de:"de-DE",el:"el-GR",en:"en-US",es:"es-ES",eu:"eu-ES",fa:"fa-IR",fi:"fi-FI",fr:"fr-FR",gl:"gl-ES",hu:"hu-HU",it:"it-IT",ja:"ja-JP",nb:"nb-NO",nl:"nl-NL",pl:"pl-PL",pt:"pt-BR",ru:"ru-RU",sv:"sv-SE",th:"th-TH",tr:"tr-TR",uk:"uk-UA",vi:"vi-VN","zh-CN":"zh-Hans-CN","zh-Hans":"zh-Hans-CN","zh-Hant":"zh-Hant-TW","zh-TW":"zh-Hant-TW",zh:"zh-Hans-CN"},Za=Object.keys(ds).concat(Object.keys(Ya));function ps(){return"en-US"}function gg(e){return mn(e)===mn(ps())}function mg(e,r){return r!=null&&r[e]?r[e]:e}Za.map(e=>"/"+e);function wg(e){return Za.includes(e)}function mn(e){return e&&(Ya[e]||e)}function $g(e){return e.includes("-")===!1?e:e.split("-")[0]}function hs(e){return e.startsWith("filter:")?Ee.FILTER:e.startsWith("action:")?Ee.ACTION:Ee.STATIC}async function ys(e){const{handler:r,hookType:t,result:n,params:a,onError:i}=e;try{if(t===Ee.FILTER){const l=r(n,a);return gn(l)?await l:l}const s=r(a);if(t===Ee.STATIC){gn(s)&&await s;return}if(t===Ee.ACTION){vs(s)&&s.catch(l=>i(l));return}}catch(s){i(s)}return n}function bs(e,r){return e+"/plugins/".concat(r.name,"/").concat(r.version,"/auth/").concat(r.authName)}const ce=new Map;function wn(e){return new Proxy(e,{set:function(r,t,n){return Object.prototype.hasOwnProperty.call(dt,t)?e[t]=n:e.setItem(t,n),!0},get:function(r,t){if(typeof e[t]=="function")return e[t];if(ce.has(t))return e.getItem(t)}})}class dt{getItem(r){const t=String(r);return ce.has(r)?String(ce.get(t)):null}setItem(r,t){ce.set(String(r),String(t))}removeItem(r){ce.delete(r)}clear(){ce.clear()}key(r){if(arguments.length===0)throw new TypeError('Failed to execute "key" on "Storage": 1 argument required, but only 0 present.');return Array.from(ce.keys())[r]}get length(){return ce.size}}let Sr,jt;function Xa(){const e=new dt,r=new dt;Sr=wn(e),jt=wn(r)}try{Sr=localStorage,jt=sessionStorage}catch{Xa()}(!Sr||!jt)&&Xa();const Sg={ID:"id",USERNAME:"username",ROLE:"role",EMAIL:"email",NSFW_POLICY:"nsfw_policy",P2P_ENABLED:"peertube-videojs-webtorrent_enabled",AUTO_PLAY_VIDEO:"auto_play_video",AUTO_PLAY_NEXT_VIDEO:"auto_play_next_video",AUTO_PLAY_VIDEO_PLAYLIST:"auto_play_video_playlist",THEME:"theme",LAST_ACTIVE_THEME:"last_active_theme",VIDEO_LANGUAGES:"video_languages"},te={ACCESS_TOKEN:"access_token",REFRESH_TOKEN:"refresh_token",TOKEN_TYPE:"token_type"};class Ft{constructor(r){D(this,"accessToken");D(this,"refreshToken");D(this,"tokenType");r&&(this.accessToken=r.accessToken,this.refreshToken=r.refreshToken,r.tokenType==="bearer"?this.tokenType="Bearer":this.tokenType=r.tokenType)}static getUserTokens(r){const t=r.getItem(te.ACCESS_TOKEN),n=r.getItem(te.REFRESH_TOKEN),a=r.getItem(te.TOKEN_TYPE);return!t||!n||!a?null:new Ft({accessToken:t,refreshToken:n,tokenType:a})}static saveToLocalStorage(r,t){r.setItem(te.ACCESS_TOKEN,t.accessToken),r.setItem(te.REFRESH_TOKEN,t.refreshToken),r.setItem(te.TOKEN_TYPE,t.tokenType)}static flushLocalStorage(r){r.removeItem(te.ACCESS_TOKEN),r.removeItem(te.REFRESH_TOKEN),r.removeItem(te.TOKEN_TYPE)}}class gs{constructor(){D(this,"hooks",[])}info(r,t){this.runHooks("info",r,t),t?console.log(r,t):console.log(r)}warn(r,t){this.runHooks("warn",r,t),this.clientWarn(r,t)}clientWarn(r,t){t?console.warn(r,t):console.warn(r)}error(r,t){this.runHooks("error",r,t),this.clientError(r,t)}clientError(r,t){t?console.error(r,t):console.error(r)}addHook(r,t){this.hooks.push({level:r,hook:t})}registerServerSending(r){this.addHook("warn",(t,n)=>this.sendClientLog(r,this.buildServerLogPayload("warn",t,n))),this.addHook("error",(t,n)=>this.sendClientLog(r,this.buildServerLogPayload("error",t,n)))}sendClientLog(r,t){if(!t)return;const n=new Headers({Accept:"application/json","Content-Type":"application/json"});try{const a=Ft.getUserTokens(Sr);a&&n.set("Authorization","".concat(a.tokenType," ").concat(a.accessToken))}catch(a){console.error("Cannot set tokens to client log sender.",{err:a})}fetch(r+"/api/v1/server/logs/client",{headers:n,method:"POST",body:JSON.stringify(t)}).catch(a=>console.error("Cannot send client warn/error to server.",a))}buildServerLogPayload(r,t,n){return t?{message:this.buildMessageServerLogPayload(t),userAgent:navigator.userAgent,url:window.location.href,level:r,stackTrace:this.buildStackServerLogPayload(t,n),meta:this.buildMetaServerLogPayload(n)}:null}buildMessageServerLogPayload(r){return typeof r=="string"?r:r instanceof Error?r.message:JSON.stringify(r)}buildStackServerLogPayload(r,t){if(r instanceof Error)return this.buildStack(r);if(t instanceof Error)return this.buildStack(t);if((t==null?void 0:t.err)instanceof Error)return this.buildStack(t.err)}buildMetaServerLogPayload(r){if(!r||r instanceof Error)return;let t;try{t=JSON.stringify(r,(n,a)=>{if(n!=="err")return a})}catch(n){console.error("Cannot stringify meta.",n)}return t}runHooks(r,t,n){for(const a of this.hooks)a.level===r&&a.hook(t,n)}buildStack(r){return"".concat(r.message,"\n").concat(r.stack||"")}}const le=window.logger||new gs;window.logger=le;function ms(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qa={exports:{}},_=Qa.exports={},Y,Z;function pt(){throw new Error("setTimeout has not been defined")}function ht(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Y=setTimeout:Y=pt}catch{Y=pt}try{typeof clearTimeout=="function"?Z=clearTimeout:Z=ht}catch{Z=ht}})();function ei(e){if(Y===setTimeout)return setTimeout(e,0);if((Y===pt||!Y)&&setTimeout)return Y=setTimeout,setTimeout(e,0);try{return Y(e,0)}catch{try{return Y.call(null,e,0)}catch{return Y.call(this,e,0)}}}function ws(e){if(Z===clearTimeout)return clearTimeout(e);if((Z===ht||!Z)&&clearTimeout)return Z=clearTimeout,clearTimeout(e);try{return Z(e)}catch{try{return Z.call(null,e)}catch{return Z.call(this,e)}}}var ne=[],Te=!1,he,ur=-1;function $s(){!Te||!he||(Te=!1,he.length?ne=he.concat(ne):ur=-1,ne.length&&ri())}function ri(){if(!Te){var e=ei($s);Te=!0;for(var r=ne.length;r;){for(he=ne,ne=[];++ur<r;)he&&he[ur].run();ur=-1,r=ne.length}he=null,Te=!1,ws(e)}}_.nextTick=function(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];ne.push(new ti(e,r)),ne.length===1&&!Te&&ei(ri)};function ti(e,r){this.fun=e,this.array=r}ti.prototype.run=function(){this.fun.apply(null,this.array)};_.title="browser";_.browser=!0;_.env={};_.argv=[];_.version="";_.versions={};function oe(){}_.on=oe;_.addListener=oe;_.once=oe;_.off=oe;_.removeListener=oe;_.removeAllListeners=oe;_.emit=oe;_.prependListener=oe;_.prependOnceListener=oe;_.listeners=function(e){return[]};_.binding=function(e){throw new Error("process.binding is not supported")};_.cwd=function(){return"/"};_.chdir=function(e){throw new Error("process.chdir is not supported")};_.umask=function(){return 0};var Ss=Qa.exports;const $n=ms(Ss);var yt={exports:{}},kr,Sn;function Os(){if(Sn)return kr;Sn=1;var e=1e3,r=e*60,t=r*60,n=t*24,a=n*7,i=n*365.25;kr=function(o,u){u=u||{};var v=typeof o;if(v==="string"&&o.length>0)return s(o);if(v==="number"&&isFinite(o))return u.long?f(o):l(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))};function s(o){if(o=String(o),!(o.length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(u){var v=parseFloat(u[1]),d=(u[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return v*i;case"weeks":case"week":case"w":return v*a;case"days":case"day":case"d":return v*n;case"hours":case"hour":case"hrs":case"hr":case"h":return v*t;case"minutes":case"minute":case"mins":case"min":case"m":return v*r;case"seconds":case"second":case"secs":case"sec":case"s":return v*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return v;default:return}}}}function l(o){var u=Math.abs(o);return u>=n?Math.round(o/n)+"d":u>=t?Math.round(o/t)+"h":u>=r?Math.round(o/r)+"m":u>=e?Math.round(o/e)+"s":o+"ms"}function f(o){var u=Math.abs(o);return u>=n?c(o,u,n,"day"):u>=t?c(o,u,t,"hour"):u>=r?c(o,u,r,"minute"):u>=e?c(o,u,e,"second"):o+" ms"}function c(o,u,v,d){var h=u>=v*1.5;return Math.round(o/v)+" "+d+(h?"s":"")}return kr}function Es(e){t.debug=t,t.default=t,t.coerce=f,t.disable=i,t.enable=a,t.enabled=s,t.humanize=Os(),t.destroy=c,Object.keys(e).forEach(o=>{t[o]=e[o]}),t.names=[],t.skips=[],t.formatters={};function r(o){let u=0;for(let v=0;v<o.length;v++)u=(u<<5)-u+o.charCodeAt(v),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=r;function t(o){let u,v=null,d,h;function y(...b){if(!y.enabled)return;const m=y,w=Number(new Date),S=w-(u||w);m.diff=S,m.prev=u,m.curr=w,u=w,b[0]=t.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let O=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(q,we)=>{if(q==="%%")return"%";O++;const de=t.formatters[we];if(typeof de=="function"){const re=b[O];q=de.call(m,re),b.splice(O,1),O--}return q}),t.formatArgs.call(m,b),(m.log||t.log).apply(m,b)}return y.namespace=o,y.useColors=t.useColors(),y.color=t.selectColor(o),y.extend=n,y.destroy=t.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>v!==null?v:(d!==t.namespaces&&(d=t.namespaces,h=t.enabled(o)),h),set:b=>{v=b}}),typeof t.init=="function"&&t.init(y),y}function n(o,u){const v=t(this.namespace+(typeof u>"u"?":":u)+o);return v.log=this.log,v}function a(o){t.save(o),t.namespaces=o,t.names=[],t.skips=[];let u;const v=(typeof o=="string"?o:"").split(/[\s,]+/),d=v.length;for(u=0;u<d;u++)v[u]&&(o=v[u].replace(/\*/g,".*?"),o[0]==="-"?t.skips.push(new RegExp("^"+o.slice(1)+"$")):t.names.push(new RegExp("^"+o+"$")))}function i(){const o=[...t.names.map(l),...t.skips.map(l).map(u=>"-"+u)].join(",");return t.enable(""),o}function s(o){if(o[o.length-1]==="*")return!0;let u,v;for(u=0,v=t.skips.length;u<v;u++)if(t.skips[u].test(o))return!1;for(u=0,v=t.names.length;u<v;u++)if(t.names[u].test(o))return!0;return!1}function l(o){return o.toString().substring(2,o.toString().length-2).replace(/\.\*\?$/,"*")}function f(o){return o instanceof Error?o.stack||o.message:o}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}var Ts=Es;(function(e,r){var t={};r.formatArgs=a,r.save=i,r.load=s,r.useColors=n,r.storage=l(),r.destroy=(()=>{let c=!1;return()=>{c||(c=!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`."))}})(),r.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"];function n(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let c;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(c=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(c[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const o="color: "+this.color;c.splice(1,0,o,"color: inherit");let u=0,v=0;c[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(u++,d==="%c"&&(v=u))}),c.splice(v,0,o)}r.log=console.debug||console.log||(()=>{});function i(c){try{c?r.storage.setItem("debug",c):r.storage.removeItem("debug")}catch{}}function s(){let c;try{c=r.storage.getItem("debug")}catch{}return!c&&typeof $n<"u"&&"env"in $n&&(c=t.DEBUG),c}function l(){try{return localStorage}catch{}}e.exports=Ts(r);const{formatters:f}=e.exports;f.j=function(c){try{return JSON.stringify(c)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}}})(yt,yt.exports);var Is=yt.exports;const Cs=os(Is);var bt=function(e,r){return bt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])},bt(e,r)};function _e(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");bt(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}function Ps(e,r,t,n){function a(i){return i instanceof t?i:new t(function(s){s(i)})}return new(t||(t=Promise))(function(i,s){function l(o){try{c(n.next(o))}catch(u){s(u)}}function f(o){try{c(n.throw(o))}catch(u){s(u)}}function c(o){o.done?i(o.value):a(o.value).then(l,f)}c((n=n.apply(e,r||[])).next())})}function ni(e,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(c){return function(o){return f([c,o])}}function f(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(t=0)),t;)try{if(n=1,a&&(i=c[0]&2?a.return:c[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,c[1])).done)return i;switch(a=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,a=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1],i=c;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(c);break}i[2]&&t.ops.pop(),t.trys.pop();continue}c=r.call(e,t)}catch(o){c=[6,o],a=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ce(e){var r=typeof Symbol=="function"&&Symbol.iterator,t=r&&e[r],n=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function br(e,r){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var n=t.call(e),a,i=[],s;try{for(;(r===void 0||r-- >0)&&!(a=n.next()).done;)i.push(a.value)}catch(l){s={error:l}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(s)throw s.error}}return i}function gr(e,r,t){if(t||arguments.length===2)for(var n=0,a=r.length,i;n<a;n++)(i||!(n in r))&&(i||(i=Array.prototype.slice.call(r,0,n)),i[n]=r[n]);return e.concat(i||Array.prototype.slice.call(r))}function Ie(e){return this instanceof Ie?(this.v=e,this):new Ie(e)}function _s(e,r,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(e,r||[]),a,i=[];return a={},l("next"),l("throw"),l("return",s),a[Symbol.asyncIterator]=function(){return this},a;function s(d){return function(h){return Promise.resolve(h).then(d,u)}}function l(d,h){n[d]&&(a[d]=function(y){return new Promise(function(b,m){i.push([d,y,b,m])>1||f(d,y)})},h&&(a[d]=h(a[d])))}function f(d,h){try{c(n[d](h))}catch(y){v(i[0][3],y)}}function c(d){d.value instanceof Ie?Promise.resolve(d.value.v).then(o,u):v(i[0][2],d)}function o(d){f("next",d)}function u(d){f("throw",d)}function v(d,h){d(h),i.shift(),i.length&&f(i[0][0],i[0][1])}}function Rs(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e[Symbol.asyncIterator],t;return r?r.call(e):(e=typeof Ce=="function"?Ce(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(s){return new Promise(function(l,f){s=e[i](s),a(l,f,s.done,s.value)})}}function a(i,s,l,f){Promise.resolve(f).then(function(c){i({value:c,done:l})},s)}}function k(e){return typeof e=="function"}function Mt(e){var r=function(n){Error.call(n),n.stack=new Error().stack},t=e(r);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Lr=Mt(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(n,a){return a+1+") "+n.toString()}).join("\n  "):"",this.name="UnsubscriptionError",this.errors=t}});function gt(e,r){if(e){var t=e.indexOf(r);0<=t&&e.splice(t,1)}}var Or=function(){function e(r){this.initialTeardown=r,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var r,t,n,a,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var l=Ce(s),f=l.next();!f.done;f=l.next()){var c=f.value;c.remove(this)}}catch(y){r={error:y}}finally{try{f&&!f.done&&(t=l.return)&&t.call(l)}finally{if(r)throw r.error}}else s.remove(this);var o=this.initialTeardown;if(k(o))try{o()}catch(y){i=y instanceof Lr?y.errors:[y]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var v=Ce(u),d=v.next();!d.done;d=v.next()){var h=d.value;try{On(h)}catch(y){i=i!=null?i:[],y instanceof Lr?i=gr(gr([],br(i)),br(y.errors)):i.push(y)}}}catch(y){n={error:y}}finally{try{d&&!d.done&&(a=v.return)&&a.call(v)}finally{if(n)throw n.error}}}if(i)throw new Lr(i)}},e.prototype.add=function(r){var t;if(r&&r!==this)if(this.closed)On(r);else{if(r instanceof e){if(r.closed||r._hasParent(this))return;r._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(r)}},e.prototype._hasParent=function(r){var t=this._parentage;return t===r||Array.isArray(t)&&t.includes(r)},e.prototype._addParent=function(r){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(r),t):t?[t,r]:r},e.prototype._removeParent=function(r){var t=this._parentage;t===r?this._parentage=null:Array.isArray(t)&&gt(t,r)},e.prototype.remove=function(r){var t=this._finalizers;t&&gt(t,r),r instanceof e&&r._removeParent(this)},e.EMPTY=function(){var r=new e;return r.closed=!0,r}(),e}(),ai=Or.EMPTY;function ii(e){return e instanceof Or||e&&"closed"in e&&k(e.remove)&&k(e.add)&&k(e.unsubscribe)}function On(e){k(e)?e():e.unsubscribe()}var oi={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},si={setTimeout:function(e,r){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,gr([e,r],br(t)))},clearTimeout:function(e){var r=si.delegate;return((r==null?void 0:r.clearTimeout)||clearTimeout)(e)},delegate:void 0};function ui(e){si.setTimeout(function(){throw e})}function En(){}function cr(e){e()}var At=function(e){_e(r,e);function r(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,ii(t)&&t.add(n)):n.destination=As,n}return r.create=function(t,n,a){return new Pe(t,n,a)},r.prototype.next=function(t){this.isStopped||this._next(t)},r.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(t){this.destination.next(t)},r.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(Or),js=Function.prototype.bind;function Nr(e,r){return js.call(e,r)}var Fs=function(){function e(r){this.partialObserver=r}return e.prototype.next=function(r){var t=this.partialObserver;if(t.next)try{t.next(r)}catch(n){Ve(n)}},e.prototype.error=function(r){var t=this.partialObserver;if(t.error)try{t.error(r)}catch(n){Ve(n)}else Ve(r)},e.prototype.complete=function(){var r=this.partialObserver;if(r.complete)try{r.complete()}catch(t){Ve(t)}},e}(),Pe=function(e){_e(r,e);function r(t,n,a){var i=e.call(this)||this,s;if(k(t)||!t)s={next:t!=null?t:void 0,error:n!=null?n:void 0,complete:a!=null?a:void 0};else{var l;i&&oi.useDeprecatedNextContext?(l=Object.create(t),l.unsubscribe=function(){return i.unsubscribe()},s={next:t.next&&Nr(t.next,l),error:t.error&&Nr(t.error,l),complete:t.complete&&Nr(t.complete,l)}):s=t}return i.destination=new Fs(s),i}return r}(At);function Ve(e){ui(e)}function Ms(e){throw e}var As={closed:!0,next:En,error:Ms,complete:En},xt=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function ci(e){return e}function xs(e){return e.length===0?ci:e.length===1?e[0]:function(t){return e.reduce(function(n,a){return a(n)},t)}}var ae=function(){function e(r){r&&(this._subscribe=r)}return e.prototype.lift=function(r){var t=new e;return t.source=this,t.operator=r,t},e.prototype.subscribe=function(r,t,n){var a=this,i=Ls(r)?r:new Pe(r,t,n);return cr(function(){var s=a,l=s.operator,f=s.source;i.add(l?l.call(i,f):f?a._subscribe(i):a._trySubscribe(i))}),i},e.prototype._trySubscribe=function(r){try{return this._subscribe(r)}catch(t){r.error(t)}},e.prototype.forEach=function(r,t){var n=this;return t=Tn(t),new t(function(a,i){var s=new Pe({next:function(l){try{r(l)}catch(f){i(f),s.unsubscribe()}},error:i,complete:a});n.subscribe(s)})},e.prototype._subscribe=function(r){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(r)},e.prototype[xt]=function(){return this},e.prototype.pipe=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return xs(r)(this)},e.prototype.toPromise=function(r){var t=this;return r=Tn(r),new r(function(n,a){var i;t.subscribe(function(s){return i=s},function(s){return a(s)},function(){return n(i)})})},e.create=function(r){return new e(r)},e}();function Tn(e){var r;return(r=e!=null?e:oi.Promise)!==null&&r!==void 0?r:Promise}function ks(e){return e&&k(e.next)&&k(e.error)&&k(e.complete)}function Ls(e){return e&&e instanceof At||ks(e)&&ii(e)}function Ns(e){return k(e==null?void 0:e.lift)}function Er(e){return function(r){if(Ns(r))return r.lift(function(t){try{return e(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function kt(e,r,t,n,a){return new Ds(e,r,t,n,a)}var Ds=function(e){_e(r,e);function r(t,n,a,i,s,l){var f=e.call(this,t)||this;return f.onFinalize=s,f.shouldUnsubscribe=l,f._next=n?function(c){try{n(c)}catch(o){t.error(o)}}:e.prototype._next,f._error=i?function(c){try{i(c)}catch(o){t.error(o)}finally{this.unsubscribe()}}:e.prototype._error,f._complete=a?function(){try{a()}catch(c){t.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,f}return r.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},r}(At),Bs=Mt(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Lt=function(e){_e(r,e);function r(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return r.prototype.lift=function(t){var n=new In(this,this);return n.operator=t,n},r.prototype._throwIfClosed=function(){if(this.closed)throw new Bs},r.prototype.next=function(t){var n=this;cr(function(){var a,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var s=Ce(n.currentObservers),l=s.next();!l.done;l=s.next()){var f=l.value;f.next(t)}}catch(c){a={error:c}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(a)throw a.error}}}})},r.prototype.error=function(t){var n=this;cr(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var a=n.observers;a.length;)a.shift().error(t)}})},r.prototype.complete=function(){var t=this;cr(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},r.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(r.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),r.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},r.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},r.prototype._innerSubscribe=function(t){var n=this,a=this,i=a.hasError,s=a.isStopped,l=a.observers;return i||s?ai:(this.currentObservers=null,l.push(t),new Or(function(){n.currentObservers=null,gt(l,t)}))},r.prototype._checkFinalizedStatuses=function(t){var n=this,a=n.hasError,i=n.thrownError,s=n.isStopped;a?t.error(i):s&&t.complete()},r.prototype.asObservable=function(){var t=new ae;return t.source=this,t},r.create=function(t,n){return new In(t,n)},r}(ae),In=function(e){_e(r,e);function r(t,n){var a=e.call(this)||this;return a.destination=t,a.source=n,a}return r.prototype.next=function(t){var n,a;(a=(n=this.destination)===null||n===void 0?void 0:n.next)===null||a===void 0||a.call(n,t)},r.prototype.error=function(t){var n,a;(a=(n=this.destination)===null||n===void 0?void 0:n.error)===null||a===void 0||a.call(n,t)},r.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},r.prototype._subscribe=function(t){var n,a;return(a=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&a!==void 0?a:ai},r}(Lt),li={now:function(){return(li.delegate||Date).now()},delegate:void 0},U=function(e){_e(r,e);function r(t,n,a){t===void 0&&(t=1/0),n===void 0&&(n=1/0),a===void 0&&(a=li);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=a,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return r.prototype.next=function(t){var n=this,a=n.isStopped,i=n._buffer,s=n._infiniteTimeWindow,l=n._timestampProvider,f=n._windowTime;a||(i.push(t),!s&&i.push(l.now()+f)),this._trimBuffer(),e.prototype.next.call(this,t)},r.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(t),a=this,i=a._infiniteTimeWindow,s=a._buffer,l=s.slice(),f=0;f<l.length&&!t.closed;f+=i?1:2)t.next(l[f]);return this._checkFinalizedStatuses(t),n},r.prototype._trimBuffer=function(){var t=this,n=t._bufferSize,a=t._timestampProvider,i=t._buffer,s=t._infiniteTimeWindow,l=(s?1:2)*n;if(n<1/0&&l<i.length&&i.splice(0,i.length-l),!s){for(var f=a.now(),c=0,o=1;o<i.length&&i[o]<=f;o+=2)c=o;c&&i.splice(0,c+1)}},r}(Lt),Gs=new ae(function(e){return e.complete()}),Ks=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function Us(e){return k(e==null?void 0:e.then)}function zs(e){return k(e[xt])}function Hs(e){return Symbol.asyncIterator&&k(e==null?void 0:e[Symbol.asyncIterator])}function Ws(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Vs(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var qs=Vs();function Js(e){return k(e==null?void 0:e[qs])}function Ys(e){return _s(this,arguments,function(){var t,n,a,i;return ni(this,function(s){switch(s.label){case 0:t=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,Ie(t.read())];case 3:return n=s.sent(),a=n.value,i=n.done,i?[4,Ie(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,Ie(a)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function Zs(e){return k(e==null?void 0:e.getReader)}function fi(e){if(e instanceof ae)return e;if(e!=null){if(zs(e))return Xs(e);if(Ks(e))return Qs(e);if(Us(e))return eu(e);if(Hs(e))return vi(e);if(Js(e))return ru(e);if(Zs(e))return tu(e)}throw Ws(e)}function Xs(e){return new ae(function(r){var t=e[xt]();if(k(t.subscribe))return t.subscribe(r);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Qs(e){return new ae(function(r){for(var t=0;t<e.length&&!r.closed;t++)r.next(e[t]);r.complete()})}function eu(e){return new ae(function(r){e.then(function(t){r.closed||(r.next(t),r.complete())},function(t){return r.error(t)}).then(null,ui)})}function ru(e){return new ae(function(r){var t,n;try{for(var a=Ce(e),i=a.next();!i.done;i=a.next()){var s=i.value;if(r.next(s),r.closed)return}}catch(l){t={error:l}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}r.complete()})}function vi(e){return new ae(function(r){nu(e,r).catch(function(t){return r.error(t)})})}function tu(e){return vi(Ys(e))}function nu(e,r){var t,n,a,i;return Ps(this,void 0,void 0,function(){var s,l;return ni(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),t=Rs(e),f.label=1;case 1:return[4,t.next()];case 2:if(n=f.sent(),!!n.done)return[3,4];if(s=n.value,r.next(s),r.closed)return[2];f.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=f.sent(),a={error:l},[3,11];case 6:return f.trys.push([6,,9,10]),n&&!n.done&&(i=t.return)?[4,i.call(t)]:[3,8];case 7:f.sent(),f.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return r.complete(),[2]}})})}var Nt=Mt(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function au(e,r){return new Promise(function(t,n){var a=new Pe({next:function(i){t(i),a.unsubscribe()},error:n,complete:function(){n(new Nt)}});e.subscribe(a)})}function iu(e){return Er(function(r,t){var n=!1;r.subscribe(kt(t,function(a){n=!0,t.next(a)},function(){n||t.next(e),t.complete()}))})}function ou(e){return e<=0?function(){return Gs}:Er(function(r,t){var n=0;r.subscribe(kt(t,function(a){++n<=e&&(t.next(a),e<=n&&t.complete())}))})}function su(e){return e===void 0&&(e=uu),Er(function(r,t){var n=!1;r.subscribe(kt(t,function(a){n=!0,t.next(a)},function(){return n?t.complete():t.error(e())}))})}function uu(){return new Nt}function cu(e,r){var t=arguments.length>=2;return function(n){return n.pipe(ci,ou(1),t?iu(r):su(function(){return new Nt}))}}function lu(e){e===void 0&&(e={});var r=e.connector,t=r===void 0?function(){return new Lt}:r,n=e.resetOnError,a=n===void 0?!0:n,i=e.resetOnComplete,s=i===void 0?!0:i,l=e.resetOnRefCountZero,f=l===void 0?!0:l;return function(c){var o,u,v,d=0,h=!1,y=!1,b=function(){u==null||u.unsubscribe(),u=void 0},m=function(){b(),o=v=void 0,h=y=!1},w=function(){var S=o;m(),S==null||S.unsubscribe()};return Er(function(S,O){d++,!y&&!h&&b();var ee=v=v!=null?v:t();O.add(function(){d--,d===0&&!y&&!h&&(u=Dr(w,f))}),ee.subscribe(O),!o&&d>0&&(o=new Pe({next:function(q){return ee.next(q)},error:function(q){y=!0,b(),u=Dr(m,a,q),ee.error(q)},complete:function(){h=!0,b(),u=Dr(m,s),ee.complete()}}),fi(S).subscribe(o))})(c)}}function Dr(e,r){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];if(r===!0){e();return}if(r!==!1){var a=new Pe({next:function(){a.unsubscribe(),e()}});return fi(r.apply(void 0,gr([],br(t)))).subscribe(a)}}function fu(e,r,t){var n,a=!1;return n=1/0,lu({connector:function(){return new U(n,r,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}var Fe=function(e){return e&&e.Math===Math&&e},B=Fe(typeof globalThis=="object"&&globalThis)||Fe(typeof window=="object"&&window)||Fe(typeof self=="object"&&self)||Fe(typeof De=="object"&&De)||Fe(typeof De=="object"&&De)||function(){return this}()||Function("return this")(),di={exports:{}},Cn=B,vu=Object.defineProperty,Dt=function(e,r){try{vu(Cn,e,{value:r,configurable:!0,writable:!0})}catch{Cn[e]=r}return r},du=B,pu=Dt,Pn="__core-js_shared__",_n=di.exports=du[Pn]||pu(Pn,{});(_n.versions||(_n.versions=[])).push({version:"3.38.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Bt=di.exports,Rn=Bt,Gt=function(e,r){return Rn[e]||(Rn[e]=r||{})},R=function(e){try{return!!e()}catch{return!0}},hu=R,Ge=!hu(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),pi=Ge,hi=Function.prototype,mt=hi.call,yu=pi&&hi.bind.bind(mt,mt),C=pi?yu:function(e){return function(){return mt.apply(e,arguments)}},be=function(e){return e==null},bu=be,gu=TypeError,Kt=function(e){if(bu(e))throw new gu("Can't call method on "+e);return e},mu=Kt,wu=Object,Tr=function(e){return wu(mu(e))},$u=C,Su=Tr,Ou=$u({}.hasOwnProperty),K=Object.hasOwn||function(r,t){return Ou(Su(r),t)},Eu=C,Tu=0,Iu=Math.random(),Cu=Eu(1 .toString),Ut=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Cu(++Tu+Iu,36)},Pu=B,jn=Pu.navigator,Fn=jn&&jn.userAgent,_u=Fn?String(Fn):"",yi=B,Br=_u,Mn=yi.process,An=yi.Deno,xn=Mn&&Mn.versions||An&&An.version,kn=xn&&xn.v8,W,mr;kn&&(W=kn.split("."),mr=W[0]>0&&W[0]<4?1:+(W[0]+W[1]));!mr&&Br&&(W=Br.match(/Edge\/(\d+)/),(!W||W[1]>=74)&&(W=Br.match(/Chrome\/(\d+)/),W&&(mr=+W[1])));var Ru=mr,Ln=Ru,ju=R,Fu=B,Mu=Fu.String,bi=!!Object.getOwnPropertySymbols&&!ju(function(){var e=Symbol("symbol detection");return!Mu(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ln&&Ln<41}),Au=bi,gi=Au&&!Symbol.sham&&typeof Symbol.iterator=="symbol",xu=B,ku=Gt,Nn=K,Lu=Ut,Nu=bi,Du=gi,Oe=xu.Symbol,Gr=ku("wks"),Bu=Du?Oe.for||Oe:Oe&&Oe.withoutSetter||Lu,V=function(e){return Nn(Gr,e)||(Gr[e]=Nu&&Nn(Oe,e)?Oe[e]:Bu("Symbol."+e)),Gr[e]},Gu=V,Ku=Gu("toStringTag"),mi={};mi[Ku]="z";var zt=String(mi)==="[object z]",Kr=typeof document=="object"&&document.all,x=typeof Kr>"u"&&Kr!==void 0?function(e){return typeof e=="function"||e===Kr}:function(e){return typeof e=="function"},X={},Uu=R,z=!Uu(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),zu=x,M=function(e){return typeof e=="object"?e!==null:zu(e)},Hu=B,Dn=M,wt=Hu.document,Wu=Dn(wt)&&Dn(wt.createElement),wi=function(e){return Wu?wt.createElement(e):{}},Vu=z,qu=R,Ju=wi,$i=!Vu&&!qu(function(){return Object.defineProperty(Ju("div"),"a",{get:function(){return 7}}).a!==7}),Yu=z,Zu=R,Si=Yu&&Zu(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Xu=M,Qu=String,ec=TypeError,E=function(e){if(Xu(e))return e;throw new ec(Qu(e)+" is not an object")},rc=Ge,qe=Function.prototype.call,Q=rc?qe.bind(qe):function(){return qe.apply(qe,arguments)},Ur=B,tc=x,nc=function(e){return tc(e)?e:void 0},fe=function(e,r){return arguments.length<2?nc(Ur[e]):Ur[e]&&Ur[e][r]},ac=C,Ht=ac({}.isPrototypeOf),ic=fe,oc=x,sc=Ht,uc=gi,cc=Object,Oi=uc?function(e){return typeof e=="symbol"}:function(e){var r=ic("Symbol");return oc(r)&&sc(r.prototype,cc(e))},lc=String,Ir=function(e){try{return lc(e)}catch{return"Object"}},fc=x,vc=Ir,dc=TypeError,ge=function(e){if(fc(e))return e;throw new dc(vc(e)+" is not a function")},pc=ge,hc=be,Wt=function(e,r){var t=e[r];return hc(t)?void 0:pc(t)},zr=Q,Hr=x,Wr=M,yc=TypeError,bc=function(e,r){var t,n;if(r==="string"&&Hr(t=e.toString)&&!Wr(n=zr(t,e))||Hr(t=e.valueOf)&&!Wr(n=zr(t,e))||r!=="string"&&Hr(t=e.toString)&&!Wr(n=zr(t,e)))return n;throw new yc("Can't convert object to primitive value")},gc=Q,Bn=M,Gn=Oi,mc=Wt,wc=bc,$c=V,Sc=TypeError,Oc=$c("toPrimitive"),Ec=function(e,r){if(!Bn(e)||Gn(e))return e;var t=mc(e,Oc),n;if(t){if(r===void 0&&(r="default"),n=gc(t,e,r),!Bn(n)||Gn(n))return n;throw new Sc("Can't convert object to primitive value")}return r===void 0&&(r="number"),wc(e,r)},Tc=Ec,Ic=Oi,Vt=function(e){var r=Tc(e,"string");return Ic(r)?r:r+""},Cc=z,Pc=$i,_c=Si,Je=E,Kn=Vt,Rc=TypeError,Vr=Object.defineProperty,jc=Object.getOwnPropertyDescriptor,qr="enumerable",Jr="configurable",Yr="writable";X.f=Cc?_c?function(r,t,n){if(Je(r),t=Kn(t),Je(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Yr in n&&!n[Yr]){var a=jc(r,t);a&&a[Yr]&&(r[t]=n.value,n={configurable:Jr in n?n[Jr]:a[Jr],enumerable:qr in n?n[qr]:a[qr],writable:!1})}return Vr(r,t,n)}:Vr:function(r,t,n){if(Je(r),t=Kn(t),Je(n),Pc)try{return Vr(r,t,n)}catch{}if("get"in n||"set"in n)throw new Rc("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var Ei={exports:{}},$t=z,Fc=K,Ti=Function.prototype,Mc=$t&&Object.getOwnPropertyDescriptor,qt=Fc(Ti,"name"),Ac=qt&&function(){}.name==="something",xc=qt&&(!$t||$t&&Mc(Ti,"name").configurable),Ii={EXISTS:qt,PROPER:Ac,CONFIGURABLE:xc},kc=C,Lc=x,St=Bt,Nc=kc(Function.toString);Lc(St.inspectSource)||(St.inspectSource=function(e){return Nc(e)});var Ci=St.inspectSource,Dc=B,Bc=x,Un=Dc.WeakMap,Pi=Bc(Un)&&/native code/.test(String(Un)),Cr=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},Gc=z,Kc=X,Uc=Cr,Jt=Gc?function(e,r,t){return Kc.f(e,r,Uc(1,t))}:function(e,r,t){return e[r]=t,e},zc=Gt,Hc=Ut,zn=zc("keys"),Yt=function(e){return zn[e]||(zn[e]=Hc(e))},Pr={},Wc=Pi,_i=B,Vc=M,qc=Jt,Zr=K,Xr=Bt,Jc=Yt,Yc=Pr,Hn="Object already initialized",Ot=_i.TypeError,Zc=_i.WeakMap,wr,Be,$r,Xc=function(e){return $r(e)?Be(e):wr(e,{})},Qc=function(e){return function(r){var t;if(!Vc(r)||(t=Be(r)).type!==e)throw new Ot("Incompatible receiver, "+e+" required");return t}};if(Wc||Xr.state){var J=Xr.state||(Xr.state=new Zc);J.get=J.get,J.has=J.has,J.set=J.set,wr=function(e,r){if(J.has(e))throw new Ot(Hn);return r.facade=e,J.set(e,r),r},Be=function(e){return J.get(e)||{}},$r=function(e){return J.has(e)}}else{var $e=Jc("state");Yc[$e]=!0,wr=function(e,r){if(Zr(e,$e))throw new Ot(Hn);return r.facade=e,qc(e,$e,r),r},Be=function(e){return Zr(e,$e)?e[$e]:{}},$r=function(e){return Zr(e,$e)}}var _r={set:wr,get:Be,has:$r,enforce:Xc,getterFor:Qc},Zt=C,el=R,rl=x,Ye=K,Et=z,tl=Ii.CONFIGURABLE,nl=Ci,Ri=_r,al=Ri.enforce,il=Ri.get,Wn=String,lr=Object.defineProperty,ol=Zt("".slice),sl=Zt("".replace),ul=Zt([].join),cl=Et&&!el(function(){return lr(function(){},"length",{value:8}).length!==8}),ll=String(String).split("String"),fl=Ei.exports=function(e,r,t){ol(Wn(r),0,7)==="Symbol("&&(r="["+sl(Wn(r),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(r="get "+r),t&&t.setter&&(r="set "+r),(!Ye(e,"name")||tl&&e.name!==r)&&(Et?lr(e,"name",{value:r,configurable:!0}):e.name=r),cl&&t&&Ye(t,"arity")&&e.length!==t.arity&&lr(e,"length",{value:t.arity});try{t&&Ye(t,"constructor")&&t.constructor?Et&&lr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=al(e);return Ye(n,"source")||(n.source=ul(ll,typeof r=="string"?r:"")),e};Function.prototype.toString=fl(function(){return rl(this)&&il(this).source||nl(this)},"toString");var ji=Ei.exports,vl=x,dl=X,pl=ji,hl=Dt,Re=function(e,r,t,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:r;if(vl(t)&&pl(t,i,n),n.global)a?e[r]=t:hl(r,t);else{try{n.unsafe?e[r]&&(a=!0):delete e[r]}catch{}a?e[r]=t:dl.f(e,r,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Fi=C,yl=Fi({}.toString),bl=Fi("".slice),je=function(e){return bl(yl(e),8,-1)},gl=zt,ml=x,fr=je,wl=V,$l=wl("toStringTag"),Sl=Object,Ol=fr(function(){return arguments}())==="Arguments",El=function(e,r){try{return e[r]}catch{}},Xt=gl?fr:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=El(r=Sl(e),$l))=="string"?t:Ol?fr(r):(n=fr(r))==="Object"&&ml(r.callee)?"Arguments":n},Tl=zt,Il=Xt,Cl=Tl?{}.toString:function(){return"[object "+Il(this)+"]"},Pl=zt,_l=Re,Rl=Cl;Pl||_l(Object.prototype,"toString",Rl,{unsafe:!0});var me={},Mi={},Ai={}.propertyIsEnumerable,xi=Object.getOwnPropertyDescriptor,jl=xi&&!Ai.call({1:2},1);Mi.f=jl?function(r){var t=xi(this,r);return!!t&&t.enumerable}:Ai;var Fl=C,Ml=R,Al=je,Qr=Object,xl=Fl("".split),ki=Ml(function(){return!Qr("z").propertyIsEnumerable(0)})?function(e){return Al(e)==="String"?xl(e,""):Qr(e)}:Qr,kl=ki,Ll=Kt,Ke=function(e){return kl(Ll(e))},Nl=z,Dl=Q,Bl=Mi,Gl=Cr,Kl=Ke,Ul=Vt,zl=K,Hl=$i,Vn=Object.getOwnPropertyDescriptor;me.f=Nl?Vn:function(r,t){if(r=Kl(r),t=Ul(t),Hl)try{return Vn(r,t)}catch{}if(zl(r,t))return Gl(!Dl(Bl.f,r,t),r[t])};var Rr={},Wl=Math.ceil,Vl=Math.floor,ql=Math.trunc||function(r){var t=+r;return(t>0?Vl:Wl)(t)},Jl=ql,Li=function(e){var r=+e;return r!==r||r===0?0:Jl(r)},Yl=Li,Zl=Math.max,Xl=Math.min,Ql=function(e,r){var t=Yl(e);return t<0?Zl(t+r,0):Xl(t,r)},ef=Li,rf=Math.min,tf=function(e){var r=ef(e);return r>0?rf(r,9007199254740991):0},nf=tf,jr=function(e){return nf(e.length)},af=Ke,of=Ql,sf=jr,qn=function(e){return function(r,t,n){var a=af(r),i=sf(a);if(i===0)return!e&&-1;var s=of(n,i),l;if(e&&t!==t){for(;i>s;)if(l=a[s++],l!==l)return!0}else for(;i>s;s++)if((e||s in a)&&a[s]===t)return e||s||0;return!e&&-1}},uf={includes:qn(!0),indexOf:qn(!1)},cf=C,et=K,lf=Ke,ff=uf.indexOf,vf=Pr,Jn=cf([].push),Ni=function(e,r){var t=lf(e),n=0,a=[],i;for(i in t)!et(vf,i)&&et(t,i)&&Jn(a,i);for(;r.length>n;)et(t,i=r[n++])&&(~ff(a,i)||Jn(a,i));return a},Qt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],df=Ni,pf=Qt,hf=pf.concat("length","prototype");Rr.f=Object.getOwnPropertyNames||function(r){return df(r,hf)};var Di={};Di.f=Object.getOwnPropertySymbols;var yf=fe,bf=C,gf=Rr,mf=Di,wf=E,$f=bf([].concat),Bi=yf("Reflect","ownKeys")||function(r){var t=gf.f(wf(r)),n=mf.f;return n?$f(t,n(r)):t},Yn=K,Sf=Bi,Of=me,Ef=X,Tf=function(e,r,t){for(var n=Sf(r),a=Ef.f,i=Of.f,s=0;s<n.length;s++){var l=n[s];!Yn(e,l)&&!(t&&Yn(t,l))&&a(e,l,i(r,l))}},If=R,Cf=x,Pf=/#|\.prototype\./,Ue=function(e,r){var t=Rf[_f(e)];return t===Ff?!0:t===jf?!1:Cf(r)?If(r):!!r},_f=Ue.normalize=function(e){return String(e).replace(Pf,".").toLowerCase()},Rf=Ue.data={},jf=Ue.NATIVE="N",Ff=Ue.POLYFILL="P",Gi=Ue,Ze=B,Mf=me.f,Af=Jt,xf=Re,kf=Dt,Lf=Tf,Nf=Gi,T=function(e,r){var t=e.target,n=e.global,a=e.stat,i,s,l,f,c,o;if(n?s=Ze:a?s=Ze[t]||kf(t,{}):s=Ze[t]&&Ze[t].prototype,s)for(l in r){if(c=r[l],e.dontCallGetSet?(o=Mf(s,l),f=o&&o.value):f=s[l],i=Nf(n?l:t+(a?".":"#")+l,e.forced),!i&&f!==void 0){if(typeof c==typeof f)continue;Lf(c,f)}(e.sham||f&&f.sham)&&Af(c,"sham",!0),xf(s,l,c,e)}},Df=Ge,Ki=Function.prototype,Zn=Ki.apply,Xn=Ki.call,Ui=typeof Reflect=="object"&&Reflect.apply||(Df?Xn.bind(Zn):function(){return Xn.apply(Zn,arguments)}),Bf=T,Gf=Ui,Kf=ge,Uf=E,zf=R,Hf=!zf(function(){Reflect.apply(function(){})});Bf({target:"Reflect",stat:!0,forced:Hf},{apply:function(r,t,n){return Gf(Kf(r),t,Uf(n))}});var Wf=C,zi=Wf([].slice),Hi=C,Vf=ge,qf=M,Jf=K,Qn=zi,Yf=Ge,Wi=Function,Zf=Hi([].concat),Xf=Hi([].join),rt={},Qf=function(e,r,t){if(!Jf(rt,r)){for(var n=[],a=0;a<r;a++)n[a]="a["+a+"]";rt[r]=Wi("C,a","return new C("+Xf(n,",")+")")}return rt[r](e,t)},ev=Yf?Wi.bind:function(r){var t=Vf(this),n=t.prototype,a=Qn(arguments,1),i=function(){var l=Zf(a,Qn(arguments));return this instanceof i?Qf(t,l.length,l):t.apply(r,l)};return qf(n)&&(i.prototype=n),i},rv=C,tv=R,Vi=x,nv=Xt,av=fe,iv=Ci,qi=function(){},Ji=av("Reflect","construct"),en=/^\s*(?:class|function)\b/,ov=rv(en.exec),sv=!en.test(qi),Me=function(r){if(!Vi(r))return!1;try{return Ji(qi,[],r),!0}catch{return!1}},Yi=function(r){if(!Vi(r))return!1;switch(nv(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return sv||!!ov(en,iv(r))}catch{return!0}};Yi.sham=!0;var Zi=!Ji||tv(function(){var e;return Me(Me.call)||!Me(Object)||!Me(function(){e=!0})||e})?Yi:Me,uv=Zi,cv=Ir,lv=TypeError,fv=function(e){if(uv(e))return e;throw new lv(cv(e)+" is not a constructor")},Xi={},vv=Ni,dv=Qt,pv=Object.keys||function(r){return vv(r,dv)},hv=z,yv=Si,bv=X,gv=E,mv=Ke,wv=pv;Xi.f=hv&&!yv?Object.defineProperties:function(r,t){gv(r);for(var n=mv(t),a=wv(t),i=a.length,s=0,l;i>s;)bv.f(r,l=a[s++],n[l]);return r};var $v=fe,Sv=$v("document","documentElement"),Ov=E,Ev=Xi,ea=Qt,Tv=Pr,Iv=Sv,Cv=wi,Pv=Yt,ra=">",ta="<",Tt="prototype",It="script",Qi=Pv("IE_PROTO"),tt=function(){},eo=function(e){return ta+It+ra+e+ta+"/"+It+ra},na=function(e){e.write(eo("")),e.close();var r=e.parentWindow.Object;return e=null,r},_v=function(){var e=Cv("iframe"),r="java"+It+":",t;return e.style.display="none",Iv.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(eo("document.F=Object")),t.close(),t.F},Xe,vr=function(){try{Xe=new ActiveXObject("htmlfile")}catch{}vr=typeof document<"u"?document.domain&&Xe?na(Xe):_v():na(Xe);for(var e=ea.length;e--;)delete vr[Tt][ea[e]];return vr()};Tv[Qi]=!0;var rn=Object.create||function(r,t){var n;return r!==null?(tt[Tt]=Ov(r),n=new tt,tt[Tt]=null,n[Qi]=r):n=vr(),t===void 0?n:Ev.f(n,t)},Rv=T,jv=fe,nt=Ui,Fv=ev,aa=fv,Mv=E,ia=M,Av=rn,ro=R,tn=jv("Reflect","construct"),xv=Object.prototype,kv=[].push,to=ro(function(){function e(){}return!(tn(function(){},[],e)instanceof e)}),no=!ro(function(){tn(function(){})}),oa=to||no;Rv({target:"Reflect",stat:!0,forced:oa,sham:oa},{construct:function(r,t){aa(r),Mv(t);var n=arguments.length<3?r:aa(arguments[2]);if(no&&!to)return tn(r,t,n);if(r===n){switch(t.length){case 0:return new r;case 1:return new r(t[0]);case 2:return new r(t[0],t[1]);case 3:return new r(t[0],t[1],t[2]);case 4:return new r(t[0],t[1],t[2],t[3])}var a=[null];return nt(kv,a,t),new(nt(Fv,r,a))}var i=n.prototype,s=Av(ia(i)?i:xv),l=nt(r,s,t);return ia(l)?l:s}});var Lv=T,Nv=z,sa=E,Dv=Vt,ao=X,Bv=R,Gv=Bv(function(){Reflect.defineProperty(ao.f({},1,{value:1}),1,{value:2})});Lv({target:"Reflect",stat:!0,forced:Gv,sham:!Nv},{defineProperty:function(r,t,n){sa(r);var a=Dv(t);sa(n);try{return ao.f(r,a,n),!0}catch{return!1}}});var Kv=T,Uv=E,zv=me.f;Kv({target:"Reflect",stat:!0},{deleteProperty:function(r,t){var n=zv(Uv(r),t);return n&&!n.configurable?!1:delete r[t]}});var ua=K,io=function(e){return e!==void 0&&(ua(e,"value")||ua(e,"writable"))},Hv=R,oo=!Hv(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Wv=K,Vv=x,qv=Tr,Jv=Yt,Yv=oo,ca=Jv("IE_PROTO"),Ct=Object,Zv=Ct.prototype,ve=Yv?Ct.getPrototypeOf:function(e){var r=qv(e);if(Wv(r,ca))return r[ca];var t=r.constructor;return Vv(t)&&r instanceof t?t.prototype:r instanceof Ct?Zv:null},Xv=T,Qv=Q,ed=M,rd=E,td=io,nd=me,ad=ve;function so(e,r){var t=arguments.length<3?e:arguments[2],n,a;if(rd(e)===t)return e[r];if(n=nd.f(e,r),n)return td(n)?n.value:n.get===void 0?void 0:Qv(n.get,t);if(ed(a=ad(e)))return so(a,r,t)}Xv({target:"Reflect",stat:!0},{get:so});var id=T,od=z,sd=E,ud=me;id({target:"Reflect",stat:!0,sham:!od},{getOwnPropertyDescriptor:function(r,t){return ud.f(sd(r),t)}});var cd=T,ld=E,fd=ve,vd=oo;cd({target:"Reflect",stat:!0,sham:!vd},{getPrototypeOf:function(r){return fd(ld(r))}});var dd=T;dd({target:"Reflect",stat:!0},{has:function(r,t){return t in r}});var pd=R,hd=pd(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),yd=R,bd=M,gd=je,la=hd,dr=Object.isExtensible,md=yd(function(){dr(1)}),uo=md||la?function(r){return!bd(r)||la&&gd(r)==="ArrayBuffer"?!1:dr?dr(r):!0}:dr,wd=T,$d=E,Sd=uo;wd({target:"Reflect",stat:!0},{isExtensible:function(r){return $d(r),Sd(r)}});var Od=T,Ed=Bi;Od({target:"Reflect",stat:!0},{ownKeys:Ed});var Td=R,nn=!Td(function(){return Object.isExtensible(Object.preventExtensions({}))}),Id=T,Cd=fe,Pd=E,_d=nn;Id({target:"Reflect",stat:!0,sham:!_d},{preventExtensions:function(r){Pd(r);try{var t=Cd("Object","preventExtensions");return t&&t(r),!0}catch{return!1}}});var Rd=T,jd=Q,Fd=E,fa=M,Md=io,Ad=R,Pt=X,va=me,xd=ve,da=Cr;function co(e,r,t){var n=arguments.length<4?e:arguments[3],a=va.f(Fd(e),r),i,s,l;if(!a){if(fa(s=xd(e)))return co(s,r,t,n);a=da(0)}if(Md(a)){if(a.writable===!1||!fa(n))return!1;if(i=va.f(n,r)){if(i.get||i.set||i.writable===!1)return!1;i.value=t,Pt.f(n,r,i)}else Pt.f(n,r,da(0,t))}else{if(l=a.set,l===void 0)return!1;jd(l,n,t)}return!0}var kd=Ad(function(){var e=function(){},r=Pt.f(new e,"a",{configurable:!0});return Reflect.set(e.prototype,"a",1,r)!==!1});Rd({target:"Reflect",stat:!0,forced:kd},{set:co});var Ld=M,Nd=function(e){return Ld(e)||e===null},Dd=Nd,Bd=String,Gd=TypeError,lo=function(e){if(Dd(e))return e;throw new Gd("Can't set "+Bd(e)+" as a prototype")},Kd=C,Ud=ge,zd=function(e,r,t){try{return Kd(Ud(Object.getOwnPropertyDescriptor(e,r)[t]))}catch{}},Hd=zd,Wd=M,Vd=Kt,qd=lo,an=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,r={},t;try{t=Hd(Object.prototype,"__proto__","set"),t(r,[]),e=r instanceof Array}catch{}return function(a,i){return Vd(a),qd(i),Wd(a)&&(e?t(a,i):a.__proto__=i),a}}():void 0),Jd=T,Yd=E,Zd=lo,pa=an;pa&&Jd({target:"Reflect",stat:!0},{setPrototypeOf:function(r,t){Yd(r),Zd(t);try{return pa(r,t),!0}catch{return!1}}});var Xd=X.f,Qd=K,ep=V,ha=ep("toStringTag"),Fr=function(e,r,t){e&&!t&&(e=e.prototype),e&&!Qd(e,ha)&&Xd(e,ha,{configurable:!0,value:r})},rp=T,tp=B,np=Fr;rp({global:!0},{Reflect:{}});np(tp.Reflect,"Reflect",!0);var ap=B,ip=ap,op=ip;op.Reflect;var fo={exports:{}},vo={},sp=je,up=Ke,po=Rr.f,cp=zi,ho=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],lp=function(e){try{return po(e)}catch{return cp(ho)}};vo.f=function(r){return ho&&sp(r)==="Window"?lp(r):po(up(r))};var fp=T,vp=C,dp=Pr,pp=M,on=K,hp=X.f,ya=Rr,yp=vo,sn=uo,bp=Ut,gp=nn,yo=!1,ie=bp("meta"),mp=0,un=function(e){hp(e,ie,{value:{objectID:"O"+mp++,weakData:{}}})},wp=function(e,r){if(!pp(e))return typeof e=="symbol"?e:(typeof e=="string"?"S":"P")+e;if(!on(e,ie)){if(!sn(e))return"F";if(!r)return"E";un(e)}return e[ie].objectID},$p=function(e,r){if(!on(e,ie)){if(!sn(e))return!0;if(!r)return!1;un(e)}return e[ie].weakData},Sp=function(e){return gp&&yo&&sn(e)&&!on(e,ie)&&un(e),e},Op=function(){Ep.enable=function(){},yo=!0;var e=ya.f,r=vp([].splice),t={};t[ie]=1,e(t).length&&(ya.f=function(n){for(var a=e(n),i=0,s=a.length;i<s;i++)if(a[i]===ie){r(a,i,1);break}return a},fp({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:yp.f}))},Ep=fo.exports={enable:Op,fastKey:wp,getWeakData:$p,onFreeze:Sp};dp[ie]=!0;var Mr=fo.exports,Tp=je,Ip=C,Cp=function(e){if(Tp(e)==="Function")return Ip(e)},ba=Cp,Pp=ge,_p=Ge,Rp=ba(ba.bind),cn=function(e,r){return Pp(e),r===void 0?e:_p?Rp(e,r):function(){return e.apply(r,arguments)}},Ar={},jp=V,Fp=Ar,Mp=jp("iterator"),Ap=Array.prototype,xp=function(e){return e!==void 0&&(Fp.Array===e||Ap[Mp]===e)},kp=Xt,ga=Wt,Lp=be,Np=Ar,Dp=V,Bp=Dp("iterator"),bo=function(e){if(!Lp(e))return ga(e,Bp)||ga(e,"@@iterator")||Np[kp(e)]},Gp=Q,Kp=ge,Up=E,zp=Ir,Hp=bo,Wp=TypeError,Vp=function(e,r){var t=arguments.length<2?Hp(e):r;if(Kp(t))return Up(Gp(t,e));throw new Wp(zp(e)+" is not iterable")},qp=Q,ma=E,Jp=Wt,Yp=function(e,r,t){var n,a;ma(e);try{if(n=Jp(e,"return"),!n){if(r==="throw")throw t;return t}n=qp(n,e)}catch(i){a=!0,n=i}if(r==="throw")throw t;if(a)throw n;return ma(n),t},Zp=cn,Xp=Q,Qp=E,eh=Ir,rh=xp,th=jr,wa=Ht,nh=Vp,ah=bo,$a=Yp,ih=TypeError,pr=function(e,r){this.stopped=e,this.result=r},Sa=pr.prototype,ln=function(e,r,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),i=!!(t&&t.IS_RECORD),s=!!(t&&t.IS_ITERATOR),l=!!(t&&t.INTERRUPTED),f=Zp(r,n),c,o,u,v,d,h,y,b=function(w){return c&&$a(c,"normal",w),new pr(!0,w)},m=function(w){return a?(Qp(w),l?f(w[0],w[1],b):f(w[0],w[1])):l?f(w,b):f(w)};if(i)c=e.iterator;else if(s)c=e;else{if(o=ah(e),!o)throw new ih(eh(e)+" is not iterable");if(rh(o)){for(u=0,v=th(e);v>u;u++)if(d=m(e[u]),d&&wa(Sa,d))return d;return new pr(!1)}c=nh(e,o)}for(h=i?e.next:c.next;!(y=Xp(h,c)).done;){try{d=m(y.value)}catch(w){$a(c,"throw",w)}if(typeof d=="object"&&d&&wa(Sa,d))return d}return new pr(!1)},oh=Ht,sh=TypeError,fn=function(e,r){if(oh(r,e))return e;throw new sh("Incorrect invocation")},uh=V,go=uh("iterator"),mo=!1;try{var ch=0,Oa={next:function(){return{done:!!ch++}},return:function(){mo=!0}};Oa[go]=function(){return this},Array.from(Oa,function(){throw 2})}catch{}var lh=function(e,r){try{if(!r&&!mo)return!1}catch{return!1}var t=!1;try{var n={};n[go]=function(){return{next:function(){return{done:t=!0}}}},e(n)}catch{}return t},fh=x,vh=M,Ea=an,dh=function(e,r,t){var n,a;return Ea&&fh(n=r.constructor)&&n!==t&&vh(a=n.prototype)&&a!==t.prototype&&Ea(e,a),e},ph=T,hh=B,yh=C,Ta=Gi,bh=Re,gh=Mr,mh=ln,wh=fn,$h=x,Sh=be,at=M,it=R,Oh=lh,Eh=Fr,Th=dh,wo=function(e,r,t){var n=e.indexOf("Map")!==-1,a=e.indexOf("Weak")!==-1,i=n?"set":"add",s=hh[e],l=s&&s.prototype,f=s,c={},o=function(m){var w=yh(l[m]);bh(l,m,m==="add"?function(O){return w(this,O===0?0:O),this}:m==="delete"?function(S){return a&&!at(S)?!1:w(this,S===0?0:S)}:m==="get"?function(O){return a&&!at(O)?void 0:w(this,O===0?0:O)}:m==="has"?function(O){return a&&!at(O)?!1:w(this,O===0?0:O)}:function(O,ee){return w(this,O===0?0:O,ee),this})},u=Ta(e,!$h(s)||!(a||l.forEach&&!it(function(){new s().entries().next()})));if(u)f=t.getConstructor(r,e,n,i),gh.enable();else if(Ta(e,!0)){var v=new f,d=v[i](a?{}:-0,1)!==v,h=it(function(){v.has(1)}),y=Oh(function(m){new s(m)}),b=!a&&it(function(){for(var m=new s,w=5;w--;)m[i](w,w);return!m.has(-0)});y||(f=r(function(m,w){wh(m,l);var S=Th(new s,m,f);return Sh(w)||mh(w,S[i],{that:S,AS_ENTRIES:n}),S}),f.prototype=l,l.constructor=f),(h||b)&&(o("delete"),o("has"),n&&o("get")),(b||d)&&o(i),a&&l.clear&&delete l.clear}return c[e]=f,ph({global:!0,constructor:!0,forced:f!==s},c),Eh(f,e),a||t.setStrong(f,e,n),f},Ia=ji,Ih=X,$o=function(e,r,t){return t.get&&Ia(t.get,r,{getter:!0}),t.set&&Ia(t.set,r,{setter:!0}),Ih.f(e,r,t)},Ch=Re,vn=function(e,r,t){for(var n in r)Ch(e,n,r[n],t);return e},Ph=R,_h=x,Rh=M,Ca=ve,jh=Re,Fh=V,_t=Fh("iterator"),So=!1,ye,ot,st;[].keys&&(st=[].keys(),"next"in st?(ot=Ca(Ca(st)),ot!==Object.prototype&&(ye=ot)):So=!0);var Mh=!Rh(ye)||Ph(function(){var e={};return ye[_t].call(e)!==e});Mh&&(ye={});_h(ye[_t])||jh(ye,_t,function(){return this});var Oo={IteratorPrototype:ye,BUGGY_SAFARI_ITERATORS:So},Ah=Oo.IteratorPrototype,xh=rn,kh=Cr,Lh=Fr,Nh=Ar,Dh=function(){return this},Bh=function(e,r,t,n){var a=r+" Iterator";return e.prototype=xh(Ah,{next:kh(+!n,t)}),Lh(e,a,!1),Nh[a]=Dh,e},Gh=T,Kh=Q,Eo=Ii,Uh=x,zh=Bh,Pa=ve,_a=an,Hh=Fr,Wh=Jt,ut=Re,Vh=V,qh=Ar,To=Oo,Jh=Eo.PROPER,Yh=Eo.CONFIGURABLE,Ra=To.IteratorPrototype,Qe=To.BUGGY_SAFARI_ITERATORS,Ae=Vh("iterator"),ja="keys",xe="values",Fa="entries",Zh=function(){return this},Xh=function(e,r,t,n,a,i,s){zh(t,r,n);var l=function(m){if(m===a&&v)return v;if(!Qe&&m&&m in o)return o[m];switch(m){case ja:return function(){return new t(this,m)};case xe:return function(){return new t(this,m)};case Fa:return function(){return new t(this,m)}}return function(){return new t(this)}},f=r+" Iterator",c=!1,o=e.prototype,u=o[Ae]||o["@@iterator"]||a&&o[a],v=!Qe&&u||l(a),d=r==="Array"&&o.entries||u,h,y,b;if(d&&(h=Pa(d.call(new e)),h!==Object.prototype&&h.next&&(Pa(h)!==Ra&&(_a?_a(h,Ra):Uh(h[Ae])||ut(h,Ae,Zh)),Hh(h,f,!0))),Jh&&a===xe&&u&&u.name!==xe&&(Yh?Wh(o,"name",xe):(c=!0,v=function(){return Kh(u,this)})),a)if(y={values:l(xe),keys:i?v:l(ja),entries:l(Fa)},s)for(b in y)(Qe||c||!(b in o))&&ut(o,b,y[b]);else Gh({target:r,proto:!0,forced:Qe||c},y);return o[Ae]!==v&&ut(o,Ae,v,{name:a}),qh[r]=v,y},Qh=function(e,r){return{value:e,done:r}},ey=fe,ry=$o,ty=V,ny=z,Ma=ty("species"),ay=function(e){var r=ey(e);ny&&r&&!r[Ma]&&ry(r,Ma,{configurable:!0,get:function(){return this}})},Aa=rn,iy=$o,xa=vn,oy=cn,sy=fn,uy=be,cy=ln,ly=Xh,er=Qh,fy=ay,ke=z,ka=Mr.fastKey,Io=_r,La=Io.set,ct=Io.getterFor,vy={getConstructor:function(e,r,t,n){var a=e(function(c,o){sy(c,i),La(c,{type:r,index:Aa(null),first:void 0,last:void 0,size:0}),ke||(c.size=0),uy(o)||cy(o,c[n],{that:c,AS_ENTRIES:t})}),i=a.prototype,s=ct(r),l=function(c,o,u){var v=s(c),d=f(c,o),h,y;return d?d.value=u:(v.last=d={index:y=ka(o,!0),key:o,value:u,previous:h=v.last,next:void 0,removed:!1},v.first||(v.first=d),h&&(h.next=d),ke?v.size++:c.size++,y!=="F"&&(v.index[y]=d)),c},f=function(c,o){var u=s(c),v=ka(o),d;if(v!=="F")return u.index[v];for(d=u.first;d;d=d.next)if(d.key===o)return d};return xa(i,{clear:function(){for(var o=this,u=s(o),v=u.first;v;)v.removed=!0,v.previous&&(v.previous=v.previous.next=void 0),v=v.next;u.first=u.last=void 0,u.index=Aa(null),ke?u.size=0:o.size=0},delete:function(c){var o=this,u=s(o),v=f(o,c);if(v){var d=v.next,h=v.previous;delete u.index[v.index],v.removed=!0,h&&(h.next=d),d&&(d.previous=h),u.first===v&&(u.first=d),u.last===v&&(u.last=h),ke?u.size--:o.size--}return!!v},forEach:function(o){for(var u=s(this),v=oy(o,arguments.length>1?arguments[1]:void 0),d;d=d?d.next:u.first;)for(v(d.value,d.key,this);d&&d.removed;)d=d.previous},has:function(o){return!!f(this,o)}}),xa(i,t?{get:function(o){var u=f(this,o);return u&&u.value},set:function(o,u){return l(this,o===0?0:o,u)}}:{add:function(o){return l(this,o=o===0?0:o,o)}}),ke&&iy(i,"size",{configurable:!0,get:function(){return s(this).size}}),a},setStrong:function(e,r,t){var n=r+" Iterator",a=ct(r),i=ct(n);ly(e,r,function(s,l){La(this,{type:n,target:s,state:a(s),kind:l,last:void 0})},function(){for(var s=i(this),l=s.kind,f=s.last;f&&f.removed;)f=f.previous;return!s.target||!(s.last=f=f?f.next:s.state.first)?(s.target=void 0,er(void 0,!0)):er(l==="keys"?f.key:l==="values"?f.value:[f.key,f.value],!1)},t?"entries":"values",!t,!0),fy(r)}},dy=wo,py=vy;dy("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},py);var hy=je,yy=Array.isArray||function(r){return hy(r)==="Array"},Na=yy,by=Zi,gy=M,my=V,wy=my("species"),Da=Array,$y=function(e){var r;return Na(e)&&(r=e.constructor,by(r)&&(r===Da||Na(r.prototype))?r=void 0:gy(r)&&(r=r[wy],r===null&&(r=void 0))),r===void 0?Da:r},Sy=$y,Oy=function(e,r){return new(Sy(e))(r===0?0:r)},Ey=cn,Ty=C,Iy=ki,Cy=Tr,Py=jr,_y=Oy,Ba=Ty([].push),ue=function(e){var r=e===1,t=e===2,n=e===3,a=e===4,i=e===6,s=e===7,l=e===5||i;return function(f,c,o,u){for(var v=Cy(f),d=Iy(v),h=Py(d),y=Ey(c,o),b=0,m=u||_y,w=r?m(f,h):t||s?m(f,0):void 0,S,O;h>b;b++)if((l||b in d)&&(S=d[b],O=y(S,b,v),e))if(r)w[b]=O;else if(O)switch(e){case 3:return!0;case 5:return S;case 6:return b;case 2:Ba(w,S)}else switch(e){case 4:return!1;case 7:Ba(w,S)}return i?-1:n||a?a:w}},Ry={forEach:ue(0),map:ue(1),filter:ue(2),some:ue(3),every:ue(4),find:ue(5),findIndex:ue(6),filterReject:ue(7)},jy=C,Ga=vn,rr=Mr.getWeakData,Fy=fn,My=E,Ay=be,lt=M,xy=ln,Co=Ry,Ka=K,Po=_r,ky=Po.set,Ly=Po.getterFor,Ny=Co.find,Dy=Co.findIndex,By=jy([].splice),Gy=0,tr=function(e){return e.frozen||(e.frozen=new _o)},_o=function(){this.entries=[]},ft=function(e,r){return Ny(e.entries,function(t){return t[0]===r})};_o.prototype={get:function(e){var r=ft(this,e);if(r)return r[1]},has:function(e){return!!ft(this,e)},set:function(e,r){var t=ft(this,e);t?t[1]=r:this.entries.push([e,r])},delete:function(e){var r=Dy(this.entries,function(t){return t[0]===e});return~r&&By(this.entries,r,1),!!~r}};var Ky={getConstructor:function(e,r,t,n){var a=e(function(f,c){Fy(f,i),ky(f,{type:r,id:Gy++,frozen:void 0}),Ay(c)||xy(c,f[n],{that:f,AS_ENTRIES:t})}),i=a.prototype,s=Ly(r),l=function(f,c,o){var u=s(f),v=rr(My(c),!0);return v===!0?tr(u).set(c,o):v[u.id]=o,f};return Ga(i,{delete:function(f){var c=s(this);if(!lt(f))return!1;var o=rr(f);return o===!0?tr(c).delete(f):o&&Ka(o,c.id)&&delete o[c.id]},has:function(c){var o=s(this);if(!lt(c))return!1;var u=rr(c);return u===!0?tr(o).has(c):u&&Ka(u,o.id)}}),Ga(i,t?{get:function(c){var o=s(this);if(lt(c)){var u=rr(c);return u===!0?tr(o).get(c):u?u[o.id]:void 0}},set:function(c,o){return l(this,c,o)}}:{add:function(c){return l(this,c,!0)}}),a}},Uy=nn,Ua=B,hr=C,za=vn,zy=Mr,Hy=wo,Ro=Ky,nr=M,ar=_r.enforce,Wy=R,Vy=Pi,ze=Object,qy=Array.isArray,ir=ze.isExtensible,jo=ze.isFrozen,Jy=ze.isSealed,Fo=ze.freeze,Yy=ze.seal,Zy=!Ua.ActiveXObject&&"ActiveXObject"in Ua,Le,Mo=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},Ao=Hy("WeakMap",Mo,Ro),Se=Ao.prototype,yr=hr(Se.set),Xy=function(){return Uy&&Wy(function(){var e=Fo([]);return yr(new Ao,e,1),!jo(e)})};if(Vy)if(Zy){Le=Ro.getConstructor(Mo,"WeakMap",!0),zy.enable();var Ha=hr(Se.delete),or=hr(Se.has),Wa=hr(Se.get);za(Se,{delete:function(e){if(nr(e)&&!ir(e)){var r=ar(this);return r.frozen||(r.frozen=new Le),Ha(this,e)||r.frozen.delete(e)}return Ha(this,e)},has:function(r){if(nr(r)&&!ir(r)){var t=ar(this);return t.frozen||(t.frozen=new Le),or(this,r)||t.frozen.has(r)}return or(this,r)},get:function(r){if(nr(r)&&!ir(r)){var t=ar(this);return t.frozen||(t.frozen=new Le),or(this,r)?Wa(this,r):t.frozen.get(r)}return Wa(this,r)},set:function(r,t){if(nr(r)&&!ir(r)){var n=ar(this);n.frozen||(n.frozen=new Le),or(this,r)?yr(this,r,t):n.frozen.set(r,t)}else yr(this,r,t);return this}})}else Xy()&&za(Se,{set:function(r,t){var n;return qy(r)&&(jo(r)?n=Fo:Jy(r)&&(n=Yy)),yr(this,r,t),n&&n(r),this}});var xo=fe,Qy=C,eb=Gt,Va=xo("Map"),rb=xo("WeakMap"),tb=Qy([].push),qa=eb("metadata"),Rt=qa.store||(qa.store=new rb),He=function(e,r,t){var n=Rt.get(e);if(!n){if(!t)return;Rt.set(e,n=new Va)}var a=n.get(r);if(!a){if(!t)return;n.set(r,a=new Va)}return a},nb=function(e,r,t){var n=He(r,t,!1);return n===void 0?!1:n.has(e)},ab=function(e,r,t){var n=He(r,t,!1);return n===void 0?void 0:n.get(e)},ib=function(e,r,t,n){He(t,n,!0).set(e,r)},ob=function(e,r){var t=He(e,r,!1),n=[];return t&&t.forEach(function(a,i){tb(n,i)}),n},sb=function(e){return e===void 0||typeof e=="symbol"?e:String(e)},se={store:Rt,getMap:He,has:nb,get:ab,set:ib,keys:ob,toKey:sb},ub=T,ko=se,cb=E,lb=ko.toKey,fb=ko.set;ub({target:"Reflect",stat:!0},{defineMetadata:function(r,t,n){var a=arguments.length<4?void 0:lb(arguments[3]);fb(r,t,cb(n),a)}});var vb=T,dn=se,db=E,pb=dn.toKey,hb=dn.getMap,Ja=dn.store;vb({target:"Reflect",stat:!0},{deleteMetadata:function(r,t){var n=arguments.length<3?void 0:pb(arguments[2]),a=hb(db(t),n,!1);if(a===void 0||!a.delete(r))return!1;if(a.size)return!0;var i=Ja.get(t);return i.delete(n),!!i.size||Ja.delete(t)}});var yb=T,pn=se,bb=E,gb=ve,mb=pn.has,wb=pn.get,$b=pn.toKey,Lo=function(e,r,t){var n=mb(e,r,t);if(n)return wb(e,r,t);var a=gb(r);return a!==null?Lo(e,a,t):void 0};yb({target:"Reflect",stat:!0},{getMetadata:function(r,t){var n=arguments.length<3?void 0:$b(arguments[2]);return Lo(r,bb(t),n)}});var sr=C,Ne=Map.prototype,No={Map,set:sr(Ne.set),get:sr(Ne.get),has:sr(Ne.has),remove:sr(Ne.delete),proto:Ne},Sb=Q,Ob=function(e,r,t){for(var n=t?e:e.iterator,a=e.next,i,s;!(i=Sb(a,n)).done;)if(s=r(i.value),s!==void 0)return s},Do=C,Eb=Ob,Bo=No,Tb=Bo.Map,Go=Bo.proto,Ib=Do(Go.forEach),Ko=Do(Go.entries),Cb=Ko(new Tb).next,Pb=function(e,r,t){return t?Eb({iterator:Ko(e),next:Cb},function(n){return r(n[1],n[0])}):Ib(e,r)},_b=C,Rb=ge,jb=be,Fb=jr,Mb=Tr,hn=No,Ab=Pb,xb=hn.Map,kb=hn.has,Lb=hn.set,Nb=_b([].push),Db=function(r){var t=Mb(this),n=Fb(t),a=[],i=new xb,s=jb(r)?function(o){return o}:Rb(r),l,f,c;for(l=0;l<n;l++)f=t[l],c=s(f),kb(i,c)||Lb(i,c,f);return Ab(i,function(o){Nb(a,o)}),a},Bb=T,Uo=C,zo=se,Gb=E,Kb=ve,Ub=Db,zb=Uo(Ub),Hb=Uo([].concat),Wb=zo.keys,Vb=zo.toKey,Ho=function(e,r){var t=Wb(e,r),n=Kb(e);if(n===null)return t;var a=Ho(n,r);return a.length?t.length?zb(Hb(t,a)):a:t};Bb({target:"Reflect",stat:!0},{getMetadataKeys:function(r){var t=arguments.length<2?void 0:Vb(arguments[1]);return Ho(Gb(r),t)}});var qb=T,Wo=se,Jb=E,Yb=Wo.get,Zb=Wo.toKey;qb({target:"Reflect",stat:!0},{getOwnMetadata:function(r,t){var n=arguments.length<3?void 0:Zb(arguments[2]);return Yb(r,Jb(t),n)}});var Xb=T,Vo=se,Qb=E,eg=Vo.keys,rg=Vo.toKey;Xb({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(r){var t=arguments.length<2?void 0:rg(arguments[1]);return eg(Qb(r),t)}});var tg=T,qo=se,ng=E,ag=ve,ig=qo.has,og=qo.toKey,Jo=function(e,r,t){var n=ig(e,r,t);if(n)return!0;var a=ag(r);return a!==null?Jo(e,a,t):!1};tg({target:"Reflect",stat:!0},{hasMetadata:function(r,t){var n=arguments.length<3?void 0:og(arguments[2]);return Jo(r,ng(t),n)}});var sg=T,Yo=se,ug=E,cg=Yo.has,lg=Yo.toKey;sg({target:"Reflect",stat:!0},{hasOwnMetadata:function(r,t){var n=arguments.length<3?void 0:lg(arguments[2]);return cg(r,ug(t),n)}});var fg=T,Zo=se,vg=E,dg=Zo.toKey,pg=Zo.set;fg({target:"Reflect",stat:!0},{metadata:function(r,t){return function(a,i){pg(r,t,vg(a),dg(i))}}});const vt=Cs("peertube:plugins");class Xo{constructor(r){D(this,"hooks",{});D(this,"scopes",{});D(this,"loadedScripts",{});D(this,"loadedScopes",[]);D(this,"loadingScopes",{});D(this,"pluginsLoaded",{common:new U(1),"admin-plugin":new U(1),search:new U(1),"video-watch":new U(1),signup:new U(1),login:new U(1),"video-edit":new U(1),embed:new U(1),"my-library":new U(1),"video-channel":new U(1),"my-account":new U(1)});D(this,"peertubeHelpersFactory");D(this,"onFormFields");D(this,"onSettingsScripts");D(this,"onClientRoute");this.peertubeHelpersFactory=r.peertubeHelpersFactory,this.onFormFields=r.onFormFields,this.onSettingsScripts=r.onSettingsScripts,this.onClientRoute=r.onClientRoute}static getPluginPathPrefix(r){return r?"/themes":"/plugins"}static getDefaultLoginHref(r,t){if(!t||t.client.menu.login.redirectOnSingleExternalAuth!==!0)return;const n=t.plugin.registeredExternalAuths;if(n.length===1)return bs(r,n[0])}loadPluginsList(r){for(const t of r.plugin.registered)this.addPlugin(t)}async runHook(r,t,n){if(!this.hooks[r])return await t;const a=hs(r);let i=await t;for(const s of this.hooks[r])le.info("Running hook ".concat(r," of plugin ").concat(s.plugin.name)),i=await ys({handler:s.handler,hookType:a,result:i,params:n,onError:l=>{le.error("Cannot run hook ".concat(r," of script ").concat(s.clientScript.script," of plugin ").concat(s.plugin.name),l)}});return i}ensurePluginsAreLoaded(r){this.loadPluginsByScope(r);const t=this.pluginsLoaded[r].asObservable().pipe(cu(),fu());return au(t)}async reloadLoadedScopes(){for(const r of this.loadedScopes)await this.loadPluginsByScope(r,!0)}addPlugin(r,t=!1){const n=Xo.getPluginPathPrefix(t);for(const a of Object.keys(r.clientScripts)){const i=r.clientScripts[a];for(const s of i.scopes)this.scopes[s]||(this.scopes[s]=[]),this.scopes[s].push({plugin:r,clientScript:{script:"".concat(n,"/").concat(r.name,"/").concat(r.version,"/client-scripts/").concat(i.script),scopes:i.scopes},pluginType:t?bn.THEME:bn.PLUGIN,isTheme:t}),this.loadedScripts[i.script]=!1}}removePlugin(r){for(const t of Object.keys(this.scopes))this.scopes[t]=this.scopes[t].filter(n=>n.plugin.name!==r.name)}async loadPluginsByScope(r,t=!1){if(!this.loadingScopes[r]&&!(!t&&this.loadedScopes.includes(r))){this.loadingScopes[r]=!0,vt("Loading scope %s",r);try{t||this.loadedScopes.push(r);const n=this.scopes[r];if(!Array.isArray(n)){this.loadingScopes[r]=!1,this.pluginsLoaded[r].next(!0),vt("Nothing to load for scope %s",r);return}const a=[];for(const i of n){const s=i.clientScript;this.loadedScripts[s.script]||(a.push(this.loadPlugin(i)),this.loadedScripts[s.script]=!0)}await Promise.all(a),this.pluginsLoaded[r].next(!0),this.loadingScopes[r]=!1,vt("Scope %s loaded",r)}catch(n){le.error("Cannot load plugins by scope ".concat(r),n)}}}loadPlugin(r){const{plugin:t,clientScript:n}=r,a=o=>{if(cs[o.target]!==!0){le.error("Unknown hook ".concat(o.target," of plugin ").concat(t.name,". Skipping."));return}this.hooks[o.target]||(this.hooks[o.target]=[]),this.hooks[o.target].push({plugin:t,clientScript:n,target:o.target,handler:o.handler,priority:o.priority||0})},i=(o,u)=>{if(!this.onFormFields)throw new Error("Video field registration is not supported");return this.onFormFields(r,o,u)},s=o=>{if(!this.onSettingsScripts)throw new Error("Registering settings script is not supported");return this.onSettingsScripts(r,o)},l=o=>{if(!this.onClientRoute)throw new Error("Registering client route is not supported");return this.onClientRoute(o)},f=this.peertubeHelpersFactory(r);le.info("Loading script ".concat(n.script," of plugin ").concat(t.name));const c=window.location.origin+n.script;return hg(c).then(o=>o.register({registerHook:a,registerVideoField:i,registerSettingsScript:s,registerClientRoute:l,peertubeHelpers:f})).then(()=>this.sortHooksByPriority()).catch(o=>le.error("Cannot import or register plugin ".concat(r.plugin.name),o))}sortHooksByPriority(){for(const r of Object.keys(this.hooks))this.hooks[r].sort((t,n)=>n.priority-t.priority)}}async function hg(e){try{return new Function("return import('".concat(e,"')"))()}catch{return le.info("Fallback to import polyfill"),new Promise((r,t)=>{const n="$importModule$"+Math.random().toString(32).slice(2),a=document.createElement("script"),i=()=>{delete window[n],a.onerror=null,a.onload=null,a.remove(),URL.revokeObjectURL(a.src),a.src=""};a.defer=!0,a.type="module",a.onerror=()=>{t(new Error("Failed to import: ".concat(e))),i()},a.onload=()=>{r(window[n]),i()};const s='import * as m from "'.concat(e,'"; window.').concat(n," = m;"),l=new Blob([s],{type:"text/javascript"});a.src=URL.createObjectURL(l),document.head.appendChild(a)})}}var Qo={exports:{}};(function(e,r){(function(t,n){e.exports=n()})(De,function(){var t=function(){var n=Math.floor(Math.random()*1000001),a={};function i(o,u,v,d){function h(m){for(var w=0;w<m.length;w++)if(m[w].win===o)return!0;return!1}var y=!1;if(u==="*"){for(var b in a)if(a.hasOwnProperty(b)&&b!=="*"&&typeof a[b][v]=="object"&&(y=h(a[b][v]),y))break}else a["*"]&&a["*"][v]&&(y=h(a["*"][v])),!y&&a[u]&&a[u][v]&&(y=h(a[u][v]));if(y)throw"A channel is already bound to the same window which overlaps with origin '"+u+"' and has scope '"+v+"'";typeof a[u]!="object"&&(a[u]={}),typeof a[u][v]!="object"&&(a[u][v]=[]),a[u][v].push({win:o,handler:d})}function s(o,u,v){for(var d=a[u][v],h=0;h<d.length;h++)d[h].win===o&&d.splice(h,1);a[u][v].length===0&&delete a[u][v]}function l(o){return Array.isArray?Array.isArray(o):o.constructor.toString().indexOf("Array")!=-1}var f={},c=function(o){try{var u=JSON.parse(o.data);if(typeof u!="object"||u===null)throw"malformed"}catch{return}var v=o.source,d=o.origin,h,y,b;if(typeof u.method=="string"){var m=u.method.split("::");m.length==2?(h=m[0],b=m[1]):b=u.method}if(typeof u.id<"u"&&(y=u.id),typeof b=="string"){var w=!1;if(a[d]&&a[d][h]){for(var S=0;S<a[d][h].length;S++)if(a[d][h][S].win===v){a[d][h][S].handler(d,b,u),w=!0;break}}if(!w&&a["*"]&&a["*"][h]){for(var S=0;S<a["*"][h].length;S++)if(a["*"][h][S].win===v){a["*"][h][S].handler(d,b,u);break}}}else typeof y<"u"&&f[y]&&f[y](d,b,u)};return window.addEventListener?window.addEventListener("message",c,!1):window.attachEvent&&window.attachEvent("onmessage",c),{build:function(o){var u=function(p){if(o.debugOutput&&window.console&&window.console.log){try{typeof p!="string"&&(p=JSON.stringify(p))}catch{}window.console.log("["+h+"] "+p)}};if(!window.postMessage)throw"jschannel cannot run this browser, no postMessage";if(!window.JSON||!window.JSON.stringify||!window.JSON.parse)throw"jschannel cannot run this browser, no JSON parsing/serialization";if(typeof o!="object")throw"Channel build invoked without a proper object argument";if(!o.window||!o.window.postMessage)throw"Channel.build() called without a valid window argument";window===o.window&&u("target window is same as present window -- use at your own risk");var v=!1;if(typeof o.origin=="string"){var d;o.origin==="*"?v=!0:(d=o.origin.match(/^https?:\/\/(?:[-a-zA-Z0-9_\.])+(?::\d+)?/))!==null&&(o.origin=d[0].toLowerCase(),v=!0)}if(!v)throw"Channel.build() called with an invalid origin";if(typeof o.scope<"u"){if(typeof o.scope!="string")throw"scope, when specified, must be a string";if(o.scope.split("::").length>1)throw"scope may not contain double colons: '::'"}else o.scope="__default";var h=function(){for(var p="",$="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",g=0;g<5;g++)p+=$.charAt(Math.floor(Math.random()*$.length));return p}(),y={},b={},m={},w=!1,S=[],O=[],ee=function(p,$,g){var j=!1,G=!1;return{origin:$,invoke:function(F,L){if(!m[p])throw"attempting to invoke a callback of a nonexistent transaction: "+p;for(var P=!1,N=0;N<g.length;N++)if(F===g[N]){P=!0;break}if(!P)throw"request supports no such callback '"+F+"'";re({id:p,callback:F,params:L})},error:function(F,L){if(G=!0,!m[p])throw"error called for nonexistent message: "+p;delete m[p],re({id:p,error:F,message:L})},complete:function(F){if(G=!0,!m[p])throw"complete called for nonexistent message: "+p;delete m[p],re({id:p,result:F})},delayReturn:function(F){return typeof F=="boolean"&&(j=F===!0),j},completed:function(){return G}}},q=function(p,$,g){return window.setTimeout(function(){if(b[p]){var j="timeout ("+$+"ms) exceeded on method '"+g+"'";b[p].error&&b[p].error("timeout_error",j),delete b[p],delete f[p]}},$)},we=function(p,$,g){if(typeof o.gotMessageObserver=="function")try{o.gotMessageObserver(p,g)}catch(I){u("gotMessageObserver() raised an exception: "+I.toString())}if(g.id&&$){m[g.id]={};var j=ee(g.id,p,g.callbacks?g.callbacks:[]);if(y[$])try{if(g.callbacks&&l(g.callbacks)&&g.callbacks.length>0)for(var G=0;G<g.callbacks.length;G++){for(var F=g.callbacks[G],L=g.params,P=F.split("/"),N=0;N<P.length-1;N++){var pe=P[N];typeof L[pe]!="object"&&(L[pe]={}),L=L[pe]}L[P[P.length-1]]=function(){var I=F;return function(yn){return j.invoke(I,yn)}}()}var ns=y[$](j,g.params);!j.delayReturn()&&!j.completed()&&j.complete(ns)}catch(I){var We="runtime_error",H=null;if(typeof I=="string"?H=I:typeof I=="object"&&(I instanceof Error?(We=I.constructor.name,H=I.message):I&&l(I)&&I.length==2?(We=I[0],H=I[1]):typeof I.error=="string"&&(We=I.error,I.message?typeof I.message=="string"?H=I.message:I=I.message:H="")),H===null)try{H=JSON.stringify(I),typeof H>"u"&&(H=I.toString())}catch{H=I.toString()}j.error(We,H)}else j.error("method_not_found","No method '"+$+"' was (yet) bound by the provider")}else g.id&&g.callback?!b[g.id]||!b[g.id].callbacks||!b[g.id].callbacks[g.callback]?u("ignoring invalid callback, id:"+g.id+" ("+g.callback+")"):b[g.id].callbacks[g.callback](g.params):g.id?b[g.id]?(g.error?b[g.id].error&&b[g.id].error(g.error,g.message):g.result!==void 0?b[g.id].success(g.result):b[g.id].success(),delete b[g.id],delete f[g.id]):u("ignoring invalid response: "+g.id):$&&y[$]&&y[$]({origin:p},g.params)};i(o.window,o.origin,o.scope,we);var de=function(p){return[o.scope,p].join("::")},re=function(p,$){if(!p)throw"postMessage called with null message";if(!$&&!w)u("queue message: "+JSON.stringify(p)),S.push(p);else{if(typeof o.postMessageObserver=="function")try{o.postMessageObserver(o.origin,p)}catch(g){u("postMessageObserver() raised an exception: "+g.toString())}u("post message: "+JSON.stringify(p)+" with origin "+o.origin),o.window.postMessage(JSON.stringify(p),o.origin)}},es=function(p,$){if(u("ready msg received"),w&&!o.reconnect)throw"received ready message while in ready state.";w=!0,h.length<6&&($.type==="publish-request"?h+="-R":h+="-L"),u("ready msg accepted."),$.type==="publish-request"&&A.notify({method:"__ready",params:{type:"publish-reply",publish:O}});for(var g=0;g<$.publish.length;g++)$.publish[g].action==="bind"?xr([$.publish[g].method],A.remote):delete A.remote[$.publish[g].method];for(o.reconnect||A.unbind("__ready",!0);S.length;)re(S.splice(0,1)[0]);O=[],typeof o.onReady=="function"&&o.onReady(A)},xr=function(p,$){p=[].concat(p);for(var g,j=0;j<p.length;j++)g=p[j].toString(),$[g]=function(G){return function(F,L,P){L?A.call({method:G,params:F,success:L,error:P}):A.notify({method:G,params:F})}}(g)},rs=function(p,$){xr([$],A.remote)},ts=function(p,$){A.remote[$]&&delete A.remote[$]},A={remote:{},unbind:function(p,$){if(y[p]){if(!delete y[p])throw"can't delete method: "+p;return o.publish&&!$&&(w?A.notify({method:"__unbind",params:p}):O.push({action:"unbind",method:p})),!0}return!1},bind:function(p,$,g){if(!p||typeof p!="string")throw"'method' argument to bind must be string";if(!$||typeof $!="function")throw"callback missing from bind params";if(y[p])throw"method '"+p+"' is already bound!";return y[p]=$,o.publish&&!g&&(w?A.notify({method:"__bind",params:p}):O.push({action:"bind",method:p})),this},call:function(p){if(!p)throw"missing arguments to call function";if(!p.method||typeof p.method!="string")throw"'method' argument to call must be string";if(!p.success||typeof p.success!="function")throw"'success' callback missing from call";var $={},g=[],j=[],G=function(L,P){if(j.indexOf(P)>=0)throw"params cannot be a recursive data structure";if(P&&j.push(P),typeof P=="object"){for(var N in P)if(P.hasOwnProperty(N)){var pe=L+(L.length?"/":"")+N;typeof P[N]=="function"?($[pe]=P[N],g.push(pe),delete P[N]):typeof P[N]=="object"&&G(pe,P[N])}}};G("",p.params);var F={id:n,method:de(p.method),params:p.params};g.length&&(F.callbacks=g),p.timeout&&q(n,p.timeout,de(p.method)),b[n]={callbacks:$,error:p.error,success:p.success},f[n]=we,n++,re(F)},notify:function(p){if(!p)throw"missing arguments to notify function";if(!p.method||typeof p.method!="string")throw"'method' argument to notify must be string";re({method:de(p.method),params:p.params})},destroy:function(){s(o.window,o.origin,o.scope),window.removeEventListener?window.removeEventListener("message",we,!1):window.detachEvent&&window.detachEvent("onmessage",we),w=!1,y={},m={},b={},o.origin=null,S=[],u("channel destroyed"),h=""}};return A.bind("__ready",es,!0),A.bind("__bind",rs,!0),A.bind("__unbind",ts,!0),o.remote&&xr(o.remote,A.remote),setTimeout(function(){h.length>0&&re({method:de("__ready"),params:{type:"publish-request",publish:O}},!0)},0),A}}}();return t})})(Qo);var Og=Qo.exports;export{Ft as O,Xo as P,Sg as U,os as a,mn as b,De as c,$g as d,gg as e,mg as f,bg as g,jt as h,wg as i,Og as j,Cs as k,le as l,$n as m,Sr as p};
