Skip to content
Permalink
5f7b913b7f
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 1 lines (1 sloc) 20.3 KB
"use strict";window.g_a=class{constructor(c,a){this.g_b=c,this.g_c=a,this.g_d=!1,this.g_e=()=>this.g_f()}g_g(){}g_h(e,a,b,c){this.g_b.g_i(this.g_c,e,a,!!b,c)}g_j(e,a,b,c){return this.g_b.g_k(this.g_c,e,a,!!b,c)}g_l(d,a,b){this.g_b.g_m()?this.g_h(d,a,b):this.g_b.g_n()._OnMessageFromDOM({type:"event",component:this.g_c,handler:d,dispatchRuntimeEvent:b,data:a,responseId:null})}g_o(c,a){this.g_b.g_p(this.g_c,c,a)}g_q(d){for(const[a,b]of d)this.g_o(a,b)}g_r(){return this.g_b}g_s(){return this.g_c}g_t(){this.g_d||(this.g_b.g_u(this.g_e),this.g_d=!0)}g_v(){this.g_d&&(this.g_b.g_w(this.g_e),this.g_d=!1)}g_f(){}},"use strict",window.g_x=class extends g_a{constructor(c,a){super(c,a),this.g_y=new Map,this.g_z=!0,this.g_o("create",b=>this.g_A(b)),this.g_o("destroy",b=>this.g_B(b)),this.g_o("set-visible",b=>this.g_C(b)),this.g_o("update-position",b=>this.g_D(b)),this.g_o("update-state",b=>this.g_E(b)),this.g_o("focus",b=>this.g_F(b)),this.g_o("set-css-style",b=>this.g_G(b))}g_H(b){this.g_z=!!b}g_I(c,e){this.g_o(c,b=>{const a=b.elementId,c=this.g_y.get(a);return e(c,b)})}g_A(d){const a=d.elementId,b=this.g_J(a,d);this.g_y.set(a,b),this.g_z&&document.body.appendChild(b)}g_J(){throw new Error("required override")}g_K(){}g_B(d){const a=d.elementId,b=this.g_y.get(a);this.g_K(b),this.g_z&&b.parentElement.removeChild(b),this.g_y.delete(a)}g_L(d,a,b){b||(b={}),b.elementId=a,this.g_h(d,b)}g_M(d,a,b){b||(b={}),b.elementId=a,this.g_l(d,b)}g_C(c){if(this.g_z){const a=this.g_y.get(c.elementId);a.style.display=c.isVisible?"":"none"}}g_D(d){if(this.g_z){const a=this.g_y.get(d.elementId);a.style.left=d.left+"px",a.style.top=d.top+"px",a.style.width=d.width+"px",a.style.height=d.height+"px";const b=d.fontSize;null!==b&&(a.style.fontSize=b+"em")}}g_E(c){const a=this.g_y.get(c.elementId);this.g_N(a,c)}g_N(){throw new Error("required override")}g_F(c){const a=this.g_y.get(c.elementId);c.focus?a.focus():a.blur()}g_G(c){const a=this.g_y.get(c.elementId);a.style[c.prop]=c.val}g_O(b){return this.g_y.get(b)}},"use strict";{function p(e){return new Promise((a,b)=>{const c=document.createElement("script");c.onload=a,c.onerror=b,c.async=!1,c.src=e,document.head.appendChild(c)})}function q(e){return new Promise((f,b)=>{const a=new FileReader;a.onload=b=>f(b.target.result),a.onerror=c=>b(c),a.readAsText(e)})}function r(e){return new Promise((f,b)=>{const a=new FileReader;a.onload=b=>f(b.target.result),a.onerror=c=>b(c),a.readAsArrayBuffer(e)})}function s(d){if(!d)return"";const a=d.split(".");if(2>a.length)return"";const b=a[a.length-1].toLowerCase();return g.get(b)||""}const a=/(iphone|ipod|ipad)/i.test(navigator.userAgent);let b=new Audio;const c={"audio/webm; codecs=opus":!!b.canPlayType("audio/webm; codecs=opus"),"audio/ogg; codecs=opus":!!b.canPlayType("audio/ogg; codecs=opus"),"audio/webm; codecs=vorbis":!!b.canPlayType("audio/webm; codecs=vorbis"),"audio/ogg; codecs=vorbis":!!b.canPlayType("audio/ogg; codecs=vorbis"),"audio/mp4":!!b.canPlayType("audio/mp4"),"audio/mpeg":!!b.canPlayType("audio/mpeg")};b=null;const d=[];let e=0;const f=Math.max(navigator.hardwareConcurrency||0,8),g=new Map([["mp4","video/mp4"],["webm","video/webm"],["m4a","audio/mp4"],["mp3","audio/mpeg"],["js","application/javascript"],["wasm","application/wasm"]]),h=[],i=new Map,j=new Map;let k=0;window.g_P=class b{constructor(b){this.g_Q=b.g_R,this.g_S=null,this.g_T="",this.g_U={},this.g_V=null,this.g_W=null,this.g_X=[],this.g_Y=null,this.g_Z=null,this.g__=null,this.g_$=-1,this.g_aa=()=>this.g_ab(),this.g_ac=[],this.g_ad=b.g_ae,this.g_af=!1,"html5"===this.g_ad&&"file"===location.protocol.substr(0,4)&&alert("Exported games won't work until you upload them. (When running on the file: protocol, browsers block many features from working for security reasons.)"),this.g_p("runtime","cordova-fetch-local-file",b=>this.g_ag(b)),this.g_p("runtime","create-job-worker",b=>this.g_ah(b)),"cordova"===this.g_ad?document.addEventListener("deviceready",()=>this.g_ai(b)):this.g_ai(b)}g_aj(){this.g_ak(),this.g_S&&(this.g_S.onmessage=null,this.g_S=null),this.g_V&&(this.g_V.terminate(),this.g_V=null),this.g_W&&(this.g_W.g_aj(),this.g_W=null),this.g_Z&&(this.g_Z.parentElement.removeChild(this.g_Z),this.g_Z=null)}g_al(){return this.g_Z}g_am(){return this.g_T}g_m(){return this.g_Q}g_an(){return this.g_ad}g_ao(){return"cordova"===this.g_ad&&a}g_ap(){if(!this.g_ao())return!1;const d=window.devicePixelRatio,a=window.screen.width*d,b=window.screen.height*d;return 1125==a&&2436==b}async g_ai(d){if(d.g_aq)this.g_T=d.g_aq;else{this.g_T=location.origin+location.pathname;const b=this.g_T.lastIndexOf("/");-1!==b&&(this.g_T=this.g_T.substr(0,b+1))}if(d.g_ar)for(const[a,b]of Object.entries(d.g_ar))this.g_U[a]=URL.createObjectURL(b);const a=new MessageChannel;this.g_S=a.port1,this.g_S.onmessage=b=>this._OnMessageFromRuntime(b.data),window.c3_addPortMessageHandler&&window.c3_addPortMessageHandler(b=>this.g_as(b)),this.g__=new self.g_at(this),await this.g__.g_au(),this.g_av(),"object"==typeof window.StatusBar&&window.StatusBar.hide(),await this.g_aw(),this.g_Q?await this.g_ax(d,a.port2):await this.g_ay(d,a.port2)}g_az(b){return this.g_U.hasOwnProperty(b)?this.g_U[b]:b}async g_aA(f,a,g){if(f.startsWith("blob:"))return new Worker(f,g);if(this.g_ao()){const a=await this.g_aB("scripts/"+f);return new Worker(URL.createObjectURL(a),g)}const c=new URL(f,a),b=location.origin!==c.origin;if(b){const d=await fetch(c);if(!d.ok)throw new Error("failed to fetch worker script");const a=await d.blob();return new Worker(URL.createObjectURL(a),g)}return new Worker(c,g)}g_av(){if(this.g_ap()){const d=window.innerWidth>window.innerHeight,a=document.documentElement.style,b=document.body.style;d?(b.height=a.height="375px",b.width=a.width="812px"):(b.width=a.width="375px",b.height=a.height="812px")}}g_aC(d){return{baseUrl:this.g_T,windowInnerWidth:window.innerWidth,windowInnerHeight:window.innerHeight,devicePixelRatio:window.devicePixelRatio,isFullscreen:b.g_aD(),projectData:d.g_aE,previewImageBlobs:window.cr_previewImageBlobs,previewProjectFileBlobs:window.cr_previewProjectFileBlobs,shaders:self.C3_Shaders,exportType:d.g_ae,isDebug:-1<self.location.search.indexOf("debug"),ife:!!self.g_aF,jobScheduler:this.g__.g_aG(),supportedAudioFormats:c,opusWasmScriptUrl:window.cr_opusWasmScriptUrl||"scripts/opus.wasm.js",opusWasmBinaryUrl:window.cr_opusWasmBinaryUrl||"scripts/opus.wasm.wasm",isWKWebView:this.g_ao(),isFBInstantAvailable:"undefined"!=typeof self.FBInstant}}async g_ax(e,a){let b=e.g_aH;this.g_U.hasOwnProperty("workerMain.js")&&(b=this.g_U["workerMain.js"]),this.g_V=await this.g_aA(b,this.g_T,{name:"Runtime"}),this.g_Z=document.createElement("canvas"),this.g_Z.style.display="none";const f=this.g_Z.transferControlToOffscreen();document.body.appendChild(this.g_Z),this.g_V.postMessage(Object.assign(this.g_aC(e),{type:"init-runtime",isInWorker:!0,messagePort:a,canvas:f,workerDependencyScripts:e.g_aI||[],engineScripts:e.g_aJ}),[a,f,...this.g__.g_aK()]),this.g_X=h.map(b=>new b(this)),this.g_aL()}async g_ay(a,b){this.g_Z=document.createElement("canvas"),this.g_Z.style.display="none",document.body.appendChild(this.g_Z),this.g_X=h.map(b=>new b(this)),this.g_aL();const c=a.g_aJ.map(b=>new URL(b,this.g_T).toString());await Promise.all(c.map(a=>p(a)));const d=Object.assign(this.g_aC(a),{isInWorker:!1,messagePort:b,canvas:this.g_Z});this.g_W=self.C3_CreateRuntime(d),await self.C3_InitRuntime(this.g_W,d)}async g_ah(){const b=await this.g__.g_aM();return{outputPort:b,transferables:[b]}}g_n(){if(this.g_Q)throw new Error("not available in worker mode");return this.g_W}g_i(f,a,b,c,d){this.g_S.postMessage({type:"event",component:f,handler:a,dispatchRuntimeEvent:c,data:b,responseId:null},this.g_af?void 0:d)}g_k(h,a,b,c,d){const e=k++,f=new Promise((c,a)=>{j.set(e,{resolve:c,reject:a})});return this.g_S.postMessage({type:"event",component:h,handler:a,dispatchRuntimeEvent:c,data:b,responseId:e},this.g_af?void 0:d),f}["_OnMessageFromRuntime"](c){const a=c.type;if("event"===a)this.g_aO(c);else if("result"===a)this.g_aP(c);else if("runtime-ready"===a)this.g_aQ();else throw new Error(`unknown message '${a}'`)}g_aO(j){const k=j.component,b=j.handler,a=j.data,c=j.responseId,d=i.get(k);if(!d)return void console.warn(`[DOM] No event handlers for component '${k}'`);const e=d.get(b);if(!e)return void console.warn(`[DOM] No handler '${b}' for component '${k}'`);let f=null;try{f=e(a)}catch(d){return console.error(`Exception in '${k}' handler '${b}':`,d),void(null!==c&&this.g_aR(c,!1,d.toString()))}null!==c&&(f&&f.then?f.then(b=>this.g_aR(c,!0,b)).catch(d=>{console.error(`Rejection from '${k}' handler '${b}':`,d),this.g_aR(c,!1,d.toString())}):this.g_aR(c,!0,f))}g_aR(e,a,b){let c;b&&b.transferables&&(c=b.transferables),this.g_S.postMessage({type:"result",responseId:e,isOk:a,result:b},c)}g_aP(f){const a=f.responseId,b=f.isOk,c=f.result,d=j.get(a);b?d.resolve(c):d.reject(c),j.delete(a)}g_p(e,a,b){let c=i.get(e);if(c||(c=new Map,i.set(e,c)),c.has(a))throw new Error(`[DOM] Component '${e}' already has handler '${a}'`);c.set(a,b)}static g_aS(b){if(h.includes(b))throw new Error("DOM handler already added");h.push(b)}g_aL(){for(const b of this.g_X)if("runtime"===b.g_s())return void(this.g_Y=b);throw new Error("cannot find runtime DOM handler")}g_as(b){this.g_i("debugger","message",b)}g_aQ(){for(const b of this.g_X)b.g_g()}static g_aD(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement)}g_u(b){this.g_ac.push(b),this.g_aT()}g_w(c){const a=this.g_ac.indexOf(c);if(-1===a)throw new Error("invalid callback");this.g_ac.splice(a,1),this.g_ac.length||this.g_ak()}g_aT(){-1===this.g_$&&this.g_ac.length&&(this.g_$=requestAnimationFrame(this.g_aa))}g_ak(){-1!==this.g_$&&(cancelAnimationFrame(this.g_$),this.g_$=-1)}g_ab(){this.g_$=-1;for(const b of this.g_ac)b();this.g_aT()}g_aU(b){this.g_Y.g_aU(b)}g_aV(b){this.g_Y.g_aV(b)}g_aW(){this.g_Y.g_aW()}g_aX(b){this.g_Y.g_aX(b)}g_aY(b){return!!c[b]}async g_aZ(c){const a=await this.g_k("runtime","opus-decode",{arrayBuffer:c},!1,[c]);return new Float32Array(a)}g_a_(b){return /^(?:[a-z]+:)?\/\//.test(b)||"data:"===b.substr(0,5)||"blob:"===b.substr(0,5)}g_a$(b){return!this.g_a_(b)}async g_ag(c){const a=c.filename;switch(c.as){case"text":return await this.g_ba(a);case"blob":return await this.g_aB(a);case"blob-url":return await this.g_bb(a);case"buffer":return await this.g_bc(a);default:throw new Error("unsupported type");}}g_bd(c){const d=window.cordova.file.applicationDirectory+"www/"+c;return new Promise((e,a)=>{window.resolveLocalFileSystemURL(d,c=>{c.file(e,a)},a)})}async g_ba(b){const a=await this.g_bd(b);return await q(a)}g_be(){if(d.length&&!(e>=f)){e++;const b=d.shift();this.g_bf(b.filename,b.g_bg,b.g_bh)}}g_bc(f){return new Promise((g,b)=>{d.push({filename:f,g_bg:b=>{e--,this.g_be(),g(b)},g_bh:c=>{e--,this.g_be(),b(c)}}),this.g_be()})}async g_bf(c,a,b){try{const b=await this.g_bd(c),d=await r(b);a(d)}catch(c){b(c)}}async g_aB(d,a){a||(a=s(d));const e=await this.g_bc(d);return new Blob([e],{type:a})}async g_bb(c){const a=await this.g_aB(c);return URL.createObjectURL(a)}g_aw(){let e=null;const f=new Promise(a=>e=a),b=new ArrayBuffer(1),c=new MessageChannel;return c.port2.onmessage=a=>{a.data&&a.data.arrayBuffer||(this.g_af=!0,console.warn("MessageChannel transfers determined to be broken. Disabling transferables.")),e()},c.port1.postMessage({arrayBuffer:b},[b]),f}}}{function g(b){return b.sourceCapabilities&&b.sourceCapabilities.firesTouchEvents||b.originalEvent&&b.originalEvent.sourceCapabilities&&b.originalEvent.sourceCapabilities.firesTouchEvents}function a(e){return new Promise((a,b)=>{const c=new Image;c.onload=()=>a(c),c.onerror=c=>b(c),c.src=e})}async function h(b){const d=URL.createObjectURL(b);try{return await a(d)}finally{URL.revokeObjectURL(d)}}function b(){return window.parent&&window.parent.document.hasFocus()}self.C3_RasterSvgImage=async function(f,a,b){const c=document.createElement("canvas");c.width=a,c.height=b;const d=c.getContext("2d");return d.drawImage(f,0,0,a,b),c};let c=!1;document.addEventListener("pause",()=>c=!0),document.addEventListener("resume",()=>c=!1);const d=class extends g_a{constructor(c){super(c,"runtime"),this.g_bi=!0,this.g_bj="any",this.g_bk=null,c.g_p("canvas","update-size",b=>this.g_bl(b)),c.g_p("runtime","invoke-download",b=>this.g_bm(b)),c.g_p("runtime","raster-svg-image",b=>this.g_bn(b)),c.g_p("runtime","set-target-orientation",b=>this.g_bo(b)),c.g_p("runtime","register-sw",()=>this.g_bp()),c.g_p("runtime","post-to-debugger",b=>this.g_bq(b)),c.g_p("runtime","before-start-ticking",()=>this.g_br()),c.g_p("runtime","debug-highlight",b=>this.g_bs(b));const a=c.g_al();a.addEventListener("contextmenu",b=>b.preventDefault()),a.addEventListener("selectstart",b=>b.preventDefault()),a.addEventListener("gesturehold",b=>b.preventDefault()),a.addEventListener("touchstart",b=>b.preventDefault()),window.addEventListener("mousedown",b=>{1===b.button&&b.preventDefault()}),window.addEventListener("resize",()=>this.g_bt()),this.g_bu=new Set,this.g_bv=new WeakSet,this.g_bw=!1}g_br(){return window.addEventListener("visibilitychange",()=>this.g_bx(document.hidden)),document.addEventListener("pause",()=>this.g_bx(!0)),document.addEventListener("resume",()=>this.g_bx(!1)),{isSuspended:!!(document.hidden||c)}}g_g(){window.addEventListener("focus",()=>this.g_by("window-focus")),window.addEventListener("blur",()=>this.g_by("window-blur",{parentHasFocus:b()})),window.addEventListener("fullscreenchange",()=>this.g_bz()),window.addEventListener("webkitfullscreenchange",()=>this.g_bz()),window.addEventListener("mozfullscreenchange",()=>this.g_bz()),window.addEventListener("fullscreenerror",b=>this.g_bA(b)),window.addEventListener("webkitfullscreenerror",b=>this.g_bA(b)),window.addEventListener("mozfullscreenerror",b=>this.g_bA(b)),window.addEventListener("keydown",b=>this.g_bB("keydown",b)),window.addEventListener("keyup",b=>this.g_bB("keyup",b)),window.addEventListener("mousemove",b=>this.g_bC("mousemove",b)),window.addEventListener("mousedown",b=>this.g_bC("mousedown",b)),window.addEventListener("mouseup",b=>this.g_bC("mouseup",b)),window.addEventListener("dblclick",b=>this.g_bC("dblclick",b)),window.addEventListener("wheel",b=>this.g_bD("wheel",b)),"undefined"==typeof g_bE?(window.addEventListener("touchstart",b=>this.g_bF("pointerdown",b)),window.addEventListener("touchmove",b=>this.g_bF("pointermove",b)),window.addEventListener("touchend",b=>this.g_bF("pointerup",b)),window.addEventListener("touchcancel",b=>this.g_bF("pointercancel",b))):(window.addEventListener("pointerdown",b=>this.g_bG("pointerdown",b)),window.addEventListener("pointermove",b=>this.g_bG("pointermove",b)),window.addEventListener("pointerup",b=>this.g_bG("pointerup",b)),window.addEventListener("pointercancel",b=>this.g_bG("pointercancel",b))),window.addEventListener("deviceorientation",b=>this.g_bH(b)),window.addEventListener("devicemotion",b=>this.g_bI(b));const c=()=>this.g_aW();window.addEventListener("pointerup",c,!0),window.addEventListener("touchend",c,!0),window.addEventListener("click",c,!0),window.addEventListener("keydown",c,!0),window.addEventListener("gamepadconnected",c,!0)}g_by(c,a){this.g_h(c,a||null,!0)}g_bt(){this.g_h("window-resize",{innerWidth:window.innerWidth,innerHeight:window.innerHeight,devicePixelRatio:window.devicePixelRatio},!0)}g_bo(b){this.g_bj=b.targetOrientation}g_bJ(){const c=this.g_bj;if(screen.orientation&&screen.orientation.lock)screen.orientation.lock(c).catch(b=>console.warn("[Construct 3] Failed to lock orientation: ",b));else try{let a=!1;screen.lockOrientation?a=screen.lockOrientation(c):screen.webkitLockOrientation?a=screen.webkitLockOrientation(c):screen.mozLockOrientation?a=screen.mozLockOrientation(c):screen.msLockOrientation&&(a=screen.msLockOrientation(c)),a||console.warn("[Construct 3] Failed to lock orientation")}catch(b){console.warn("[Construct 3] Failed to lock orientation: ",b)}}g_bz(){const b=g_P.g_aD();b&&"any"!==this.g_bj&&this.g_bJ(),this.g_h("fullscreenchange",{isFullscreen:b,innerWidth:window.innerWidth,innerHeight:window.innerHeight})}g_bA(b){console.warn("[Construct 3] Fullscreen request failed: ",b),this.g_h("fullscreenerror",{isFullscreen:g_P.g_aD(),innerWidth:window.innerWidth,innerHeight:window.innerHeight})}g_bx(b){b?this.g_b.g_ak():this.g_b.g_aT(),this.g_h("visibilitychange",{hidden:b})}g_bB(c,a){this.g_l(c,{code:a.code,key:a.key,which:a.which,repeat:a.repeat,altKey:a.altKey,ctrlKey:a.ctrlKey,metaKey:a.metaKey,shiftKey:a.shiftKey,timeStamp:a.timeStamp},!0)}g_bC(a,b){g(b)||("mousedown"===a&&window!==window.top&&window.focus(),this.g_l(a,{button:b.button,clientX:b.clientX,clientY:b.clientY,timeStamp:b.timeStamp},!0))}g_bD(c,a){this.g_h(c,{clientX:a.clientX,clientY:a.clientY,deltaX:a.deltaX,deltaY:a.deltaY,deltaZ:a.deltaZ,deltaMode:a.deltaMode,timeStamp:a.timeStamp},!0)}g_bG(c,a){"pointerdown"===c&&window!==window.top&&window.focus(),this.g_l(c,{pointerId:a.pointerId,pointerType:a.pointerType,clientX:a.clientX,clientY:a.clientY,width:a.width||0,height:a.height||0,pressure:a.pressure||0,tangentialPressure:a.tangentialPressure||0,tiltX:a.tiltX||0,tiltY:a.tiltY||0,twist:a.twist||0,timeStamp:a.timeStamp},!0)}g_bF(e,a){"pointerdown"===e&&window!==window.top&&window.focus();for(let b=0,c=a.changedTouches.length;b<c;++b){const c=a.changedTouches[b];this.g_l(e,{pointerId:c.identifier,pointerType:"touch",clientX:c.clientX,clientY:c.clientY,width:2*(c.radiusX||c.webkitRadiusX||c.mozRadiusX||c.msRadiusX||0),height:2*(c.radiusY||c.webkitRadiusY||c.mozRadiusY||c.msRadiusY||0),pressure:c.force||c.webkitForce||c.mozForce||c.msForce||0,tangentialPressure:0,tiltX:0,tiltY:0,twist:c.rotationAngle||0,timeStamp:a.timeStamp},!0)}}g_bH(b){this.g_h("deviceorientation",{alpha:b.alpha||0,beta:b.beta||0,gamma:b.gamma||0,timeStamp:b.timeStamp},!0)}g_bI(j){let a=0,k=0,l=0,m=0,n=0,o=0;const p=j.accelerationIncludingGravity;p&&(a=p.x||0,k=p.y||0,l=p.z||0);const h=j.acceleration;h&&(m=h.x||0,n=h.y||0,o=h.z||0),this.g_h("devicemotion",{acceleration:{x:m,y:n,z:o},accelerationWithG:{x:a,y:k,z:l},timeStamp:j.timeStamp},!0)}g_bl(d){const a=this.g_r(),b=a.g_al();b.style.width=d.styleWidth+"px",b.style.height=d.styleHeight+"px",b.style.marginLeft=d.marginLeft+"px",b.style.marginTop=d.marginTop+"px",a.g_av(),this.g_bi&&(b.style.display="",this.g_bi=!1)}g_bm(f){const b=f.url,c=f.filename,d=document.createElement("a"),e=document.body;d.textContent=c,d.href=b,d.download=c,e.appendChild(d),d.click(),e.removeChild(d)}async g_bn(c){const a=c.blob,b=c.width,d=c.height,e=await h(a),f=await self.C3_RasterSvgImage(e,b,d);return await createImageBitmap(f)}g_aW(){const c=[...this.g_bu];if(this.g_bu.clear(),!this.g_bw)for(const d of c){const b=d.play();b&&b.catch(()=>{this.g_bv.has(d)||this.g_bu.add(d)})}}g_aU(c){if("function"!=typeof c.play)throw new Error("missing play function");this.g_bv.delete(c);let a;try{a=c.play()}catch(a){return void this.g_bu.add(c)}a&&a.catch(()=>{this.g_bv.has(c)||this.g_bu.add(c)})}g_aV(b){this.g_bu.delete(b),this.g_bv.add(b)}g_aX(b){this.g_bw=!!b}g_bs(d){const a=d.show;if(!a)return void(this.g_bk&&(this.g_bk.style.display="none"));this.g_bk||(this.g_bk=document.createElement("div"),this.g_bk.id="inspectOutline",document.body.appendChild(this.g_bk));const b=this.g_bk;b.style.display="",b.style.left=d.left-1+"px",b.style.top=d.top-1+"px",b.style.width=d.width+2+"px",b.style.height=d.height+2+"px",b.textContent=d.name}g_bp(){window.C3_RegisterSW&&window.C3_RegisterSW()}g_bq(b){window.c3_postToMessagePort&&(b.from="runtime",window.c3_postToMessagePort(b))}};g_P.g_aS(d)}{const c=document.currentScript.src;self.g_at=class{constructor(a){this.g_bK=a,this.g_T=c.substr(0,c.lastIndexOf("/")+1),this.g_bL=Math.min(navigator.hardwareConcurrency||2,16),this.g_bM=null,this.g_bN=[],this.g_bO=null,this.g_bP=null}async g_au(){if(this.g_bQ)throw new Error("already initialised");this.g_bQ=!0;const c=this.g_bK.g_az("dispatchWorker.js");this.g_bM=await this.g_bK.g_aA(c,this.g_T,{name:"DispatchWorker"});const a=new MessageChannel;this.g_bO=a.port1,this.g_bM.postMessage({type:"_init","in-port":a.port2},[a.port2]),this.g_bP=await this.g_aM()}async g_aM(){const f=this.g_bN.length,a=this.g_bK.g_az("jobWorker.js"),b=await this.g_bK.g_aA(a,this.g_T,{name:"JobWorker"+f}),c=new MessageChannel,d=new MessageChannel;return this.g_bM.postMessage({type:"_addJobWorker",port:c.port1},[c.port1]),b.postMessage({type:"init",number:f,"dispatch-port":c.port2,"output-port":d.port2},[c.port2,d.port2]),this.g_bN.push(b),d.port1}g_aG(){return{inputPort:this.g_bO,outputPort:this.g_bP,maxNumWorkers:this.g_bL}}g_aK(){return[this.g_bO,this.g_bP]}}}if("use strict",window.C3_IsSupported){"undefined"!=typeof OffscreenCanvas;window.c3_runtimeInterface=new g_P({g_R:!1,g_aH:"workerMain.js",g_aJ:["scripts/c3runtime.js"],g_ae:"html5"})}