"use strict";(self.webpackChunkkeplergl_jupyter=self.webpackChunkkeplergl_jupyter||[]).push([[3607],{57345:(e,t,s)=>{function r(e,t,s){if(s=s||e.byteLength,e.byteLength<s||t.byteLength<s)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let e=0;e<r.length;++e)if(r[e]!==i[e])return!1;return!0}function i(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];const r=t.map((e=>e instanceof ArrayBuffer?new Uint8Array(e):e)),i=r.reduce(((e,t)=>e+t.byteLength),0),n=new Uint8Array(i);let u=0;for(const e of r)n.set(e,u),u+=e.byteLength;return n.buffer}function n(e,t,s){const r=void 0!==s?new Uint8Array(e).subarray(t,t+s):new Uint8Array(e).subarray(t);return new Uint8Array(r).buffer}s.d(t,{AQ:()=>i,YV:()=>r,_m:()=>n})},17243:(e,t,s)=>{function r(e,t){if(!e)throw new Error(t||"loader assertion failed.")}s.d(t,{v:()=>r})},83921:(e,t,s)=>{s.d(t,{Al:()=>a,Bd:()=>l,Sf:()=>o,bg:()=>n,x:()=>u,xD:()=>d});var r=s(65606);const i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==s.g&&s.g,document:"undefined"!=typeof document&&document},n=i.self||i.window||i.global||{},u=i.window||i.self||i.global||{},o=i.global||i.self||i.window||{},a=i.document||{},l=Boolean("object"!=typeof r||"[object process]"!==String(r)||r.browser),d="function"==typeof importScripts,h=void 0!==r&&r.version&&/v([0-9]*)/.exec(r.version);h&&parseFloat(h[1])},16562:(e,t,s)=>{function r(e){const t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function i(e){const t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}s.d(t,{iW:()=>r,pD:()=>i})},31726:(e,t,s)=>{s.d(t,{A:()=>u});var r=s(67136),i=s(35520);const n={id:"request-scheduler",throttleRequests:!0,maxRequests:6};class u{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r.A)(this,"props",void 0),(0,r.A)(this,"stats",void 0),(0,r.A)(this,"activeRequestCount",0),(0,r.A)(this,"requestQueue",[]),(0,r.A)(this,"requestMap",new Map),(0,r.A)(this,"deferredUpdate",null),this.props={...n,...e},this.stats=new i.Uz({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}scheduleRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>0;if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(e))return this.requestMap.get(e);const s={handle:e,priority:0,getPriority:t},r=new Promise((e=>(s.resolve=e,s)));return this.requestQueue.push(s),this.requestMap.set(e,r),this._issueNewRequests(),r}_issueRequest(e){const{handle:t,resolve:s}=e;let r=!1;const i=()=>{r||(r=!0,this.requestMap.delete(t),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,s?s({done:i}):Promise.resolve({done:i})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout((()=>this._issueNewRequestsAsync()),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;const e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==e){this._updateAllRequests();for(let t=0;t<e;++t){const e=this.requestQueue.shift();e&&this._issueRequest(e)}}}_updateAllRequests(){const e=this.requestQueue;for(let t=0;t<e.length;++t){const s=e[t];this._updateRequest(s)||(e.splice(t,1),this.requestMap.delete(s.handle),t--)}e.sort(((e,t)=>e.priority-t.priority))}_updateRequest(e){return e.priority=e.getPriority(e.handle),!(e.priority<0&&(e.resolve(null),1))}}}}]);