handler-playable-sdk 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/AssetEditorModal-DBAGQINC.js +1 -0
  2. package/dist/AssetTextures-AZY5VKWH.js +1 -0
  3. package/dist/ConfigOverride-DFTDUTRQ.js +1 -0
  4. package/dist/chunk-C2CEUBBT.js +1325 -0
  5. package/dist/chunk-DEUORFXE.js +1 -0
  6. package/dist/chunk-DHSGG7NF.js +1 -0
  7. package/dist/chunk-E6WJCS24.js +46 -0
  8. package/dist/chunk-PWGHKK3J.js +1 -0
  9. package/dist/chunk-Q7FPWOA3.js +1 -0
  10. package/dist/config-7DI6U2YD.js +1 -0
  11. package/dist/index.cjs +1360 -0
  12. package/dist/index.css +4537 -1
  13. package/dist/index.d.cts +892 -0
  14. package/dist/index.d.ts +494 -39
  15. package/dist/index.js +1 -1
  16. package/dist/{loader-object-centric-C1QteFfG.d.mts → loader-object-centric-Ce6MVkQw.d.cts} +1 -1
  17. package/dist/{loader-object-centric-C1QteFfG.d.ts → loader-object-centric-Ce6MVkQw.d.ts} +1 -1
  18. package/dist/pixi/index.cjs +256 -0
  19. package/dist/pixi/index.css +4537 -1
  20. package/dist/pixi/{index.d.mts → index.d.cts} +156 -144
  21. package/dist/pixi/index.d.ts +156 -144
  22. package/dist/pixi/index.js +1 -27
  23. package/dist/three/index.cjs +363 -0
  24. package/dist/three/index.css +4537 -1
  25. package/dist/three/index.js +1 -134
  26. package/package.json +29 -18
  27. package/dist/ConfigOverride-6YH2ILBJ.mjs +0 -1
  28. package/dist/chunk-BDZGKN5O.mjs +0 -1
  29. package/dist/chunk-GYW3GFXA.mjs +0 -830
  30. package/dist/chunk-HN7I4BLB.mjs +0 -1
  31. package/dist/config-QLS2MDB6.mjs +0 -1
  32. package/dist/index.d.mts +0 -437
  33. package/dist/index.mjs +0 -1
  34. package/dist/pixi/index.mjs +0 -1
  35. package/dist/three/index.mjs +0 -118
  36. /package/dist/three/{index.d.mts → index.d.cts} +0 -0
@@ -0,0 +1,256 @@
1
+ "use strict";var Rf=Object.create;var Mn=Object.defineProperty;var Mf=Object.getOwnPropertyDescriptor;var jf=Object.getOwnPropertyNames;var Df=Object.getPrototypeOf,zf=Object.prototype.hasOwnProperty;var He=(e,t)=>()=>(e&&(t=e(e=0)),t);var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),nl=(e,t)=>{for(var i in t)Mn(e,i,{get:t[i],enumerable:!0})},rl=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of jf(t))!zf.call(e,r)&&r!==i&&Mn(e,r,{get:()=>t[r],enumerable:!(n=Mf(t,r))||n.enumerable});return e};var jn=(e,t,i)=>(i=e!=null?Rf(Df(e)):{},rl(t||!e||!e.__esModule?Mn(i,"default",{value:e,enumerable:!0}):i,e)),Bf=e=>rl(Mn({},"__esModule",{value:!0}),e);var Ff,st=He(()=>{"use strict";Ff="handler_preview_override_mode";if(typeof window!="undefined"){let e=window.localStorage.getItem(Ff);window.__enableConfigOverrides=e===null?!0:e==="true"}});var Ll,St,My,ra=He(()=>{"use strict";st();Ll=null,St="dev";if(typeof window!="undefined"){let e=window.__BUILD_SETTINGS__;if(e!=null&&e.buildMode)Ll=e,St=e.buildMode,console.log("[CONFIG] Loaded inline build settings:",e,"buildMode:",St);else try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let i=JSON.parse(t.responseText);Ll=i,St=i.buildMode||"dev",console.log("[CONFIG] Loaded build settings:",i,"buildMode:",St)}else console.log("[CONFIG] No build-settings.json found, using default buildMode:",St)}catch(t){console.log("[CONFIG] Failed to load build-settings.json:",t instanceof Error?t.message:String(t))}}console.log("[CONFIG] Final buildMode:",St);My=St==="dev"||typeof window!="undefined"&&window.location.search.includes("hot-reload")});var aa=He(()=>{"use strict"});var Il=He(()=>{"use strict";aa();ra()});var sa=He(()=>{"use strict";ra();aa();Il()});var ji=E((Gx,oa)=>{"use strict";typeof process=="undefined"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?oa.exports={nextTick:Kf}:oa.exports=process;function Kf(e,t,i,n){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var r=arguments.length,a,s;switch(r){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,i)});case 4:return process.nextTick(function(){e.call(null,t,i,n)});default:for(a=new Array(r-1),s=0;s<a.length;)a[s++]=arguments[s];return process.nextTick(function(){e.apply(null,a)})}}});var jl=E((Wx,Ml)=>{"use strict";var Xf={}.toString;Ml.exports=Array.isArray||function(e){return Xf.call(e)=="[object Array]"}});var la=E((Yx,Dl)=>{"use strict";Dl.exports=require("stream")});var Di=E((ca,Bl)=>{"use strict";var Nn=require("buffer"),Ue=Nn.Buffer;function zl(e,t){for(var i in e)t[i]=e[i]}Ue.from&&Ue.alloc&&Ue.allocUnsafe&&Ue.allocUnsafeSlow?Bl.exports=Nn:(zl(Nn,ca),ca.Buffer=Wt);function Wt(e,t,i){return Ue(e,t,i)}zl(Ue,Wt);Wt.from=function(e,t,i){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Ue(e,t,i)};Wt.alloc=function(e,t,i){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=Ue(e);return t!==void 0?typeof i=="string"?n.fill(t,i):n.fill(t):n.fill(0),n};Wt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Ue(e)};Wt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Nn.SlowBuffer(e)}});var Yt=E(te=>{"use strict";function Zf(e){return Array.isArray?Array.isArray(e):Fn(e)==="[object Array]"}te.isArray=Zf;function Jf(e){return typeof e=="boolean"}te.isBoolean=Jf;function Qf(e){return e===null}te.isNull=Qf;function eh(e){return e==null}te.isNullOrUndefined=eh;function th(e){return typeof e=="number"}te.isNumber=th;function ih(e){return typeof e=="string"}te.isString=ih;function nh(e){return typeof e=="symbol"}te.isSymbol=nh;function rh(e){return e===void 0}te.isUndefined=rh;function ah(e){return Fn(e)==="[object RegExp]"}te.isRegExp=ah;function sh(e){return typeof e=="object"&&e!==null}te.isObject=sh;function oh(e){return Fn(e)==="[object Date]"}te.isDate=oh;function lh(e){return Fn(e)==="[object Error]"||e instanceof Error}te.isError=lh;function ch(e){return typeof e=="function"}te.isFunction=ch;function dh(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e=="undefined"}te.isPrimitive=dh;te.isBuffer=require("buffer").Buffer.isBuffer;function Fn(e){return Object.prototype.toString.call(e)}});var Nl=E((Kx,da)=>{"use strict";typeof Object.create=="function"?da.exports=function(t,i){i&&(t.super_=i,t.prototype=Object.create(i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:da.exports=function(t,i){if(i){t.super_=i;var n=function(){};n.prototype=i.prototype,t.prototype=new n,t.prototype.constructor=t}}});var Vt=E((Xx,pa)=>{"use strict";try{if(ua=require("util"),typeof ua.inherits!="function")throw"";pa.exports=ua.inherits}catch{pa.exports=Nl()}var ua});var $l=E((Zx,fa)=>{"use strict";function uh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Fl=Di().Buffer,zi=require("util");function ph(e,t,i){e.copy(t,i)}fa.exports=(function(){function e(){uh(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(i){var n={data:i,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},e.prototype.unshift=function(i){var n={data:i,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},e.prototype.shift=function(){if(this.length!==0){var i=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,i}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(i){if(this.length===0)return"";for(var n=this.head,r=""+n.data;n=n.next;)r+=i+n.data;return r},e.prototype.concat=function(i){if(this.length===0)return Fl.alloc(0);for(var n=Fl.allocUnsafe(i>>>0),r=this.head,a=0;r;)ph(r.data,n,a),a+=r.data.length,r=r.next;return n},e})();zi&&zi.inspect&&zi.inspect.custom&&(fa.exports.prototype[zi.inspect.custom]=function(){var e=zi.inspect({length:this.length});return this.constructor.name+" "+e})});var ha=E((Jx,Hl)=>{"use strict";var $n=ji();function fh(e,t){var i=this,n=this._readableState&&this._readableState.destroyed,r=this._writableState&&this._writableState.destroyed;return n||r?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,$n.nextTick(Hn,this,e)):$n.nextTick(Hn,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?i._writableState?i._writableState.errorEmitted||(i._writableState.errorEmitted=!0,$n.nextTick(Hn,i,a)):$n.nextTick(Hn,i,a):t&&t(a)}),this)}function hh(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Hn(e,t){e.emit("error",t)}Hl.exports={destroy:fh,undestroy:hh}});var ql=E((Qx,Ul)=>{"use strict";Ul.exports=require("util").deprecate});var ma=E((ew,Jl)=>{"use strict";var At=ji();Jl.exports=V;function Wl(e){var t=this;this.next=null,this.entry=null,this.finish=function(){Ph(t,e)}}var gh=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:At.nextTick,Kt;V.WritableState=Ni;var Yl=Object.create(Yt());Yl.inherits=Vt();var mh={deprecate:ql()},Vl=la(),qn=Di().Buffer,bh=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function vh(e){return qn.from(e)}function yh(e){return qn.isBuffer(e)||e instanceof bh}var Kl=ha();Yl.inherits(V,Vl);function xh(){}function Ni(e,t){Kt=Kt||Ct(),e=e||{};var i=t instanceof Kt;this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,r=e.writableHighWaterMark,a=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:i&&(r||r===0)?this.highWaterMark=r:this.highWaterMark=a,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=e.decodeStrings===!1;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){Th(t,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Wl(this)}Ni.prototype.getBuffer=function(){for(var t=this.bufferedRequest,i=[];t;)i.push(t),t=t.next;return i};(function(){try{Object.defineProperty(Ni.prototype,"buffer",{get:mh.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Un;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Un=Function.prototype[Symbol.hasInstance],Object.defineProperty(V,Symbol.hasInstance,{value:function(e){return Un.call(this,e)?!0:this!==V?!1:e&&e._writableState instanceof Ni}})):Un=function(e){return e instanceof this};function V(e){if(Kt=Kt||Ct(),!Un.call(V,this)&&!(this instanceof Kt))return new V(e);this._writableState=new Ni(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),Vl.call(this)}V.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function wh(e,t){var i=new Error("write after end");e.emit("error",i),At.nextTick(t,i)}function _h(e,t,i,n){var r=!0,a=!1;return i===null?a=new TypeError("May not write null values to stream"):typeof i!="string"&&i!==void 0&&!t.objectMode&&(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),At.nextTick(n,a),r=!1),r}V.prototype.write=function(e,t,i){var n=this._writableState,r=!1,a=!n.objectMode&&yh(e);return a&&!qn.isBuffer(e)&&(e=vh(e)),typeof t=="function"&&(i=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof i!="function"&&(i=xh),n.ended?wh(this,i):(a||_h(this,n,e,i))&&(n.pendingcb++,r=Sh(this,n,a,e,t,i)),r};V.prototype.cork=function(){var e=this._writableState;e.corked++};V.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&Xl(this,e))};V.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function Eh(e,t,i){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=qn.from(t,i)),t}Object.defineProperty(V.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Sh(e,t,i,n,r,a){if(!i){var s=Eh(t,n,r);n!==s&&(i=!0,r="buffer",n=s)}var o=t.objectMode?1:n.length;t.length+=o;var d=t.length<t.highWaterMark;if(d||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:r,isBuf:i,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else ga(e,t,!1,o,n,r,a);return d}function ga(e,t,i,n,r,a,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,i?e._writev(r,t.onwrite):e._write(r,a,t.onwrite),t.sync=!1}function Ah(e,t,i,n,r){--t.pendingcb,i?(At.nextTick(r,n),At.nextTick(Bi,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(r(n),e._writableState.errorEmitted=!0,e.emit("error",n),Bi(e,t))}function Ch(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function Th(e,t){var i=e._writableState,n=i.sync,r=i.writecb;if(Ch(i),t)Ah(e,i,n,t,r);else{var a=Zl(i);!a&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest&&Xl(e,i),n?gh(Gl,e,i,a,r):Gl(e,i,a,r)}}function Gl(e,t,i,n){i||kh(e,t),t.pendingcb--,n(),Bi(e,t)}function kh(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function Xl(e,t){t.bufferProcessing=!0;var i=t.bufferedRequest;if(e._writev&&i&&i.next){var n=t.bufferedRequestCount,r=new Array(n),a=t.corkedRequestsFree;a.entry=i;for(var s=0,o=!0;i;)r[s]=i,i.isBuf||(o=!1),i=i.next,s+=1;r.allBuffers=o,ga(e,t,!0,t.length,r,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new Wl(t),t.bufferedRequestCount=0}else{for(;i;){var d=i.chunk,l=i.encoding,c=i.callback,f=t.objectMode?1:d.length;if(ga(e,t,!1,f,d,l,c),i=i.next,t.bufferedRequestCount--,t.writing)break}i===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=i,t.bufferProcessing=!1}V.prototype._write=function(e,t,i){i(new Error("_write() is not implemented"))};V.prototype._writev=null;V.prototype.end=function(e,t,i){var n=this._writableState;typeof e=="function"?(i=e,e=null,t=null):typeof t=="function"&&(i=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||Ih(this,n,i)};function Zl(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function Lh(e,t){e._final(function(i){t.pendingcb--,i&&e.emit("error",i),t.prefinished=!0,e.emit("prefinish"),Bi(e,t)})}function Oh(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,At.nextTick(Lh,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function Bi(e,t){var i=Zl(t);return i&&(Oh(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),i}function Ih(e,t,i){t.ending=!0,Bi(e,t),i&&(t.finished?At.nextTick(i):e.once("finish",i)),t.ended=!0,e.writable=!1}function Ph(e,t,i){var n=e.entry;for(e.entry=null;n;){var r=n.callback;t.pendingcb--,r(i),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(V.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});V.prototype.destroy=Kl.destroy;V.prototype._undestroy=Kl.undestroy;V.prototype._destroy=function(e,t){this.end(),t(e)}});var Ct=E((tw,ic)=>{"use strict";var Ql=ji(),Rh=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};ic.exports=qe;var ec=Object.create(Yt());ec.inherits=Vt();var tc=ya(),va=ma();ec.inherits(qe,tc);for(ba=Rh(va.prototype),Gn=0;Gn<ba.length;Gn++)Wn=ba[Gn],qe.prototype[Wn]||(qe.prototype[Wn]=va.prototype[Wn]);var ba,Wn,Gn;function qe(e){if(!(this instanceof qe))return new qe(e);tc.call(this,e),va.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",Mh)}Object.defineProperty(qe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Mh(){this.allowHalfOpen||this._writableState.ended||Ql.nextTick(jh,this)}function jh(e){e.end()}Object.defineProperty(qe.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});qe.prototype._destroy=function(e,t){this.push(null),this.end(),Ql.nextTick(t,e)}});var _a=E(rc=>{"use strict";var wa=Di().Buffer,nc=wa.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Dh(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function zh(e){var t=Dh(e);if(typeof t!="string"&&(wa.isEncoding===nc||!nc(e)))throw new Error("Unknown encoding: "+e);return t||e}rc.StringDecoder=Fi;function Fi(e){this.encoding=zh(e);var t;switch(this.encoding){case"utf16le":this.text=Uh,this.end=qh,t=4;break;case"utf8":this.fillLast=Fh,t=4;break;case"base64":this.text=Gh,this.end=Wh,t=3;break;default:this.write=Yh,this.end=Vh;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=wa.allocUnsafe(t)}Fi.prototype.write=function(e){if(e.length===0)return"";var t,i;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<e.length?t?t+this.text(e,i):this.text(e,i):t||""};Fi.prototype.end=Hh;Fi.prototype.text=$h;Fi.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function xa(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function Bh(e,t,i){var n=t.length-1;if(n<i)return 0;var r=xa(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||r===-2?0:(r=xa(t[n]),r>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||r===-2?0:(r=xa(t[n]),r>=0?(r>0&&(r===2?r=0:e.lastNeed=r-3),r):0))}function Nh(e,t,i){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function Fh(e){var t=this.lastTotal-this.lastNeed,i=Nh(this,e,t);if(i!==void 0)return i;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function $h(e,t){var i=Bh(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var n=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function Hh(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function Uh(e,t){if((e.length-t)%2===0){var i=e.toString("utf16le",t);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function qh(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}function Gh(e,t){var i=(e.length-t)%3;return i===0?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-i))}function Wh(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Yh(e){return e.toString(this.encoding)}function Vh(e){return e&&e.length?this.write(e):""}});var ya=E((rw,mc)=>{"use strict";var Zt=ji();mc.exports=F;var Kh=jl(),$i;F.ReadableState=uc;var nw=require("events").EventEmitter,lc=function(e,t){return e.listeners(t).length},Ta=la(),Hi=Di().Buffer,Xh=(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function Zh(e){return Hi.from(e)}function Jh(e){return Hi.isBuffer(e)||e instanceof Xh}var cc=Object.create(Yt());cc.inherits=Vt();var Ea=require("util"),j=void 0;Ea&&Ea.debuglog?j=Ea.debuglog("stream"):j=function(){};var Qh=$l(),dc=ha(),Xt;cc.inherits(F,Ta);var Sa=["error","close","destroy","pause","resume"];function eg(e,t,i){if(typeof e.prependListener=="function")return e.prependListener(t,i);!e._events||!e._events[t]?e.on(t,i):Kh(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]}function uc(e,t){$i=$i||Ct(),e=e||{};var i=t instanceof $i;this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,r=e.readableHighWaterMark,a=this.objectMode?16:16*1024;n||n===0?this.highWaterMark=n:i&&(r||r===0)?this.highWaterMark=r:this.highWaterMark=a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Qh,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Xt||(Xt=_a().StringDecoder),this.decoder=new Xt(e.encoding),this.encoding=e.encoding)}function F(e){if($i=$i||Ct(),!(this instanceof F))return new F(e);this._readableState=new uc(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Ta.call(this)}Object.defineProperty(F.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});F.prototype.destroy=dc.destroy;F.prototype._undestroy=dc.undestroy;F.prototype._destroy=function(e,t){this.push(null),t(e)};F.prototype.push=function(e,t){var i=this._readableState,n;return i.objectMode?n=!0:typeof e=="string"&&(t=t||i.defaultEncoding,t!==i.encoding&&(e=Hi.from(e,t),t=""),n=!0),pc(this,e,t,!1,n)};F.prototype.unshift=function(e){return pc(this,e,null,!0,!1)};function pc(e,t,i,n,r){var a=e._readableState;if(t===null)a.reading=!1,rg(e,a);else{var s;r||(s=tg(a,t)),s?e.emit("error",s):a.objectMode||t&&t.length>0?(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==Hi.prototype&&(t=Zh(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):Aa(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!i?(t=a.decoder.write(t),a.objectMode||t.length!==0?Aa(e,a,t,!1):fc(e,a)):Aa(e,a,t,!1))):n||(a.reading=!1)}return ig(a)}function Aa(e,t,i,n){t.flowing&&t.length===0&&!t.sync?(e.emit("data",i),e.read(0)):(t.length+=t.objectMode?1:i.length,n?t.buffer.unshift(i):t.buffer.push(i),t.needReadable&&Yn(e)),fc(e,t)}function tg(e,t){var i;return!Jh(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(i=new TypeError("Invalid non-string/buffer chunk")),i}function ig(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}F.prototype.isPaused=function(){return this._readableState.flowing===!1};F.prototype.setEncoding=function(e){return Xt||(Xt=_a().StringDecoder),this._readableState.decoder=new Xt(e),this._readableState.encoding=e,this};var ac=8388608;function ng(e){return e>=ac?e=ac:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function sc(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=ng(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}F.prototype.read=function(e){j("read",e),e=parseInt(e,10);var t=this._readableState,i=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return j("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?Ca(this):Yn(this),null;if(e=sc(e,t),e===0&&t.ended)return t.length===0&&Ca(this),null;var n=t.needReadable;j("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,j("length less than watermark",n)),t.ended||t.reading?(n=!1,j("reading or ended",n)):n&&(j("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=sc(i,t)));var r;return e>0?r=hc(e,t):r=null,r===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&Ca(this)),r!==null&&this.emit("data",r),r};function rg(e,t){if(!t.ended){if(t.decoder){var i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,Yn(e)}}function Yn(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(j("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Zt.nextTick(oc,e):oc(e))}function oc(e){j("emit readable"),e.emit("readable"),ka(e)}function fc(e,t){t.readingMore||(t.readingMore=!0,Zt.nextTick(ag,e,t))}function ag(e,t){for(var i=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(j("maybeReadMore read 0"),e.read(0),i!==t.length);)i=t.length;t.readingMore=!1}F.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};F.prototype.pipe=function(e,t){var i=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,j("pipe count=%d opts=%j",n.pipesCount,t);var r=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=r?o:x;n.endEmitted?Zt.nextTick(a):i.once("end",a),e.on("unpipe",s);function s(g,h){j("onunpipe"),g===i&&h&&h.hasUnpiped===!1&&(h.hasUnpiped=!0,c())}function o(){j("onend"),e.end()}var d=sg(i);e.on("drain",d);var l=!1;function c(){j("cleanup"),e.removeListener("close",v),e.removeListener("finish",b),e.removeListener("drain",d),e.removeListener("error",p),e.removeListener("unpipe",s),i.removeListener("end",o),i.removeListener("end",x),i.removeListener("data",u),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&d()}var f=!1;i.on("data",u);function u(g){j("ondata"),f=!1;var h=e.write(g);h===!1&&!f&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&gc(n.pipes,e)!==-1)&&!l&&(j("false write response, pause",n.awaitDrain),n.awaitDrain++,f=!0),i.pause())}function p(g){j("onerror",g),x(),e.removeListener("error",p),lc(e,"error")===0&&e.emit("error",g)}eg(e,"error",p);function v(){e.removeListener("finish",b),x()}e.once("close",v);function b(){j("onfinish"),e.removeListener("close",v),x()}e.once("finish",b);function x(){j("unpipe"),i.unpipe(e)}return e.emit("pipe",i),n.flowing||(j("pipe resume"),i.resume()),e};function sg(e){return function(){var t=e._readableState;j("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&lc(e,"data")&&(t.flowing=!0,ka(e))}}F.prototype.unpipe=function(e){var t=this._readableState,i={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,i),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<r;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=gc(t.pipes,e);return s===-1?this:(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,i),this)};F.prototype.on=function(e,t){var i=Ta.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var n=this._readableState;!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&Yn(this):Zt.nextTick(og,this))}return i};F.prototype.addListener=F.prototype.on;function og(e){j("readable nexttick read 0"),e.read(0)}F.prototype.resume=function(){var e=this._readableState;return e.flowing||(j("resume"),e.flowing=!0,lg(this,e)),this};function lg(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Zt.nextTick(cg,e,t))}function cg(e,t){t.reading||(j("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),ka(e),t.flowing&&!t.reading&&e.read(0)}F.prototype.pause=function(){return j("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(j("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function ka(e){var t=e._readableState;for(j("flow",t.flowing);t.flowing&&e.read()!==null;);}F.prototype.wrap=function(e){var t=this,i=this._readableState,n=!1;e.on("end",function(){if(j("wrapped end"),i.decoder&&!i.ended){var s=i.decoder.end();s&&s.length&&t.push(s)}t.push(null)}),e.on("data",function(s){if(j("wrapped data"),i.decoder&&(s=i.decoder.write(s)),!(i.objectMode&&s==null)&&!(!i.objectMode&&(!s||!s.length))){var o=t.push(s);o||(n=!0,e.pause())}});for(var r in e)this[r]===void 0&&typeof e[r]=="function"&&(this[r]=(function(s){return function(){return e[s].apply(e,arguments)}})(r));for(var a=0;a<Sa.length;a++)e.on(Sa[a],this.emit.bind(this,Sa[a]));return this._read=function(s){j("wrapped _read",s),n&&(n=!1,e.resume())},this};Object.defineProperty(F.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});F._fromList=hc;function hc(e,t){if(t.length===0)return null;var i;return t.objectMode?i=t.buffer.shift():!e||e>=t.length?(t.decoder?i=t.buffer.join(""):t.buffer.length===1?i=t.buffer.head.data:i=t.buffer.concat(t.length),t.buffer.clear()):i=dg(e,t.buffer,t.decoder),i}function dg(e,t,i){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?n=t.shift():n=i?ug(e,t):pg(e,t),n}function ug(e,t){var i=t.head,n=1,r=i.data;for(e-=r.length;i=i.next;){var a=i.data,s=e>a.length?a.length:e;if(s===a.length?r+=a:r+=a.slice(0,e),e-=s,e===0){s===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=a.slice(s));break}++n}return t.length-=n,r}function pg(e,t){var i=Hi.allocUnsafe(e),n=t.head,r=1;for(n.data.copy(i),e-=n.data.length;n=n.next;){var a=n.data,s=e>a.length?a.length:e;if(a.copy(i,i.length-e,0,s),e-=s,e===0){s===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(s));break}++r}return t.length-=r,i}function Ca(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Zt.nextTick(fg,t,e))}function fg(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function gc(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1}});var La=E((aw,yc)=>{"use strict";yc.exports=Ge;var Vn=Ct(),vc=Object.create(Yt());vc.inherits=Vt();vc.inherits(Ge,Vn);function hg(e,t){var i=this._transformState;i.transforming=!1;var n=i.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));i.writechunk=null,i.writecb=null,t!=null&&this.push(t),n(e);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}function Ge(e){if(!(this instanceof Ge))return new Ge(e);Vn.call(this,e),this._transformState={afterTransform:hg.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",gg)}function gg(){var e=this;typeof this._flush=="function"?this._flush(function(t,i){bc(e,t,i)}):bc(this,null,null)}Ge.prototype.push=function(e,t){return this._transformState.needTransform=!1,Vn.prototype.push.call(this,e,t)};Ge.prototype._transform=function(e,t,i){throw new Error("_transform() is not implemented")};Ge.prototype._write=function(e,t,i){var n=this._transformState;if(n.writecb=i,n.writechunk=e,n.writeencoding=t,!n.transforming){var r=this._readableState;(n.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}};Ge.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Ge.prototype._destroy=function(e,t){var i=this;Vn.prototype._destroy.call(this,e,function(n){t(n),i.emit("close")})};function bc(e,t,i){if(t)return e.emit("error",t);if(i!=null&&e.push(i),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var Ec=E((sw,_c)=>{"use strict";_c.exports=Ui;var xc=La(),wc=Object.create(Yt());wc.inherits=Vt();wc.inherits(Ui,xc);function Ui(e){if(!(this instanceof Ui))return new Ui(e);xc.call(this,e)}Ui.prototype._transform=function(e,t,i){i(null,e)}});var Oa=E((Q,Kn)=>{"use strict";var Oe=require("stream");process.env.READABLE_STREAM==="disable"&&Oe?(Kn.exports=Oe,Q=Kn.exports=Oe.Readable,Q.Readable=Oe.Readable,Q.Writable=Oe.Writable,Q.Duplex=Oe.Duplex,Q.Transform=Oe.Transform,Q.PassThrough=Oe.PassThrough,Q.Stream=Oe):(Q=Kn.exports=ya(),Q.Stream=Oe||Q,Q.Readable=Q,Q.Writable=ma(),Q.Duplex=Ct(),Q.Transform=La(),Q.PassThrough=Ec())});var We=E(ce=>{"use strict";ce.base64=!0;ce.array=!0;ce.string=!0;ce.arraybuffer=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined";ce.nodebuffer=typeof Buffer!="undefined";ce.uint8array=typeof Uint8Array!="undefined";if(typeof ArrayBuffer=="undefined")ce.blob=!1;else{Ia=new ArrayBuffer(0);try{ce.blob=new Blob([Ia],{type:"application/zip"}).size===0}catch{try{Sc=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,Pa=new Sc,Pa.append(Ia),ce.blob=Pa.getBlob("application/zip").size===0}catch{ce.blob=!1}}}var Ia,Sc,Pa;try{ce.nodestream=!!Oa().Readable}catch{ce.nodestream=!1}});var Ma=E(Ra=>{"use strict";var mg=H(),bg=We(),Ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";Ra.encode=function(e){for(var t=[],i,n,r,a,s,o,d,l=0,c=e.length,f=c,u=mg.getTypeOf(e)!=="string";l<e.length;)f=c-l,u?(i=e[l++],n=l<c?e[l++]:0,r=l<c?e[l++]:0):(i=e.charCodeAt(l++),n=l<c?e.charCodeAt(l++):0,r=l<c?e.charCodeAt(l++):0),a=i>>2,s=(i&3)<<4|n>>4,o=f>1?(n&15)<<2|r>>6:64,d=f>2?r&63:64,t.push(Ie.charAt(a)+Ie.charAt(s)+Ie.charAt(o)+Ie.charAt(d));return t.join("")};Ra.decode=function(e){var t,i,n,r,a,s,o,d=0,l=0,c="data:";if(e.substr(0,c.length)===c)throw new Error("Invalid base64 input, it looks like a data url.");e=e.replace(/[^A-Za-z0-9+/=]/g,"");var f=e.length*3/4;if(e.charAt(e.length-1)===Ie.charAt(64)&&f--,e.charAt(e.length-2)===Ie.charAt(64)&&f--,f%1!==0)throw new Error("Invalid base64 input, bad content length.");var u;for(bg.uint8array?u=new Uint8Array(f|0):u=new Array(f|0);d<e.length;)r=Ie.indexOf(e.charAt(d++)),a=Ie.indexOf(e.charAt(d++)),s=Ie.indexOf(e.charAt(d++)),o=Ie.indexOf(e.charAt(d++)),t=r<<2|a>>4,i=(a&15)<<4|s>>2,n=(s&3)<<6|o,u[l++]=t,s!==64&&(u[l++]=i),o!==64&&(u[l++]=n);return u}});var qi=E((cw,Ac)=>{"use strict";Ac.exports={isNode:typeof Buffer!="undefined",newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if(typeof e=="number")throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&typeof e.on=="function"&&typeof e.pause=="function"&&typeof e.resume=="function"}}});var Lc=E((dw,kc)=>{"use strict";var Cc=global.MutationObserver||global.WebKitMutationObserver,Jt;process.browser?Cc?(ja=0,Tc=new Cc(Gi),Da=global.document.createTextNode(""),Tc.observe(Da,{characterData:!0}),Jt=function(){Da.data=ja=++ja%2}):!global.setImmediate&&typeof global.MessageChannel!="undefined"?(za=new global.MessageChannel,za.port1.onmessage=Gi,Jt=function(){za.port2.postMessage(0)}):"document"in global&&"onreadystatechange"in global.document.createElement("script")?Jt=function(){var e=global.document.createElement("script");e.onreadystatechange=function(){Gi(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},global.document.documentElement.appendChild(e)}:Jt=function(){setTimeout(Gi,0)}:Jt=function(){process.nextTick(Gi)};var ja,Tc,Da,za,Ba,Wi=[];function Gi(){Ba=!0;for(var e,t,i=Wi.length;i;){for(t=Wi,Wi=[],e=-1;++e<i;)t[e]();i=Wi.length}Ba=!1}kc.exports=vg;function vg(e){Wi.push(e)===1&&!Ba&&Jt()}});var Dc=E((uw,jc)=>{"use strict";var Oc=Lc();function Qt(){}var ie={},Ic=["REJECTED"],Na=["FULFILLED"],Pc=["PENDING"];process.browser||(Yi=["UNHANDLED"]);var Yi;jc.exports=ot;function ot(e){if(typeof e!="function")throw new TypeError("resolver must be a function");this.state=Pc,this.queue=[],this.outcome=void 0,process.browser||(this.handled=Yi),e!==Qt&&Rc(this,e)}ot.prototype.finally=function(e){if(typeof e!="function")return this;var t=this.constructor;return this.then(i,n);function i(r){function a(){return r}return t.resolve(e()).then(a)}function n(r){function a(){throw r}return t.resolve(e()).then(a)}};ot.prototype.catch=function(e){return this.then(null,e)};ot.prototype.then=function(e,t){if(typeof e!="function"&&this.state===Na||typeof t!="function"&&this.state===Ic)return this;var i=new this.constructor(Qt);if(process.browser||this.handled===Yi&&(this.handled=null),this.state!==Pc){var n=this.state===Na?e:t;Fa(i,n,this.outcome)}else this.queue.push(new Vi(i,e,t));return i};function Vi(e,t,i){this.promise=e,typeof t=="function"&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),typeof i=="function"&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}Vi.prototype.callFulfilled=function(e){ie.resolve(this.promise,e)};Vi.prototype.otherCallFulfilled=function(e){Fa(this.promise,this.onFulfilled,e)};Vi.prototype.callRejected=function(e){ie.reject(this.promise,e)};Vi.prototype.otherCallRejected=function(e){Fa(this.promise,this.onRejected,e)};function Fa(e,t,i){Oc(function(){var n;try{n=t(i)}catch(r){return ie.reject(e,r)}n===e?ie.reject(e,new TypeError("Cannot resolve promise with itself")):ie.resolve(e,n)})}ie.resolve=function(e,t){var i=Mc(yg,t);if(i.status==="error")return ie.reject(e,i.value);var n=i.value;if(n)Rc(e,n);else{e.state=Na,e.outcome=t;for(var r=-1,a=e.queue.length;++r<a;)e.queue[r].callFulfilled(t)}return e};ie.reject=function(e,t){e.state=Ic,e.outcome=t,process.browser||e.handled===Yi&&Oc(function(){e.handled===Yi&&process.emit("unhandledRejection",t,e)});for(var i=-1,n=e.queue.length;++i<n;)e.queue[i].callRejected(t);return e};function yg(e){var t=e&&e.then;if(e&&(typeof e=="object"||typeof e=="function")&&typeof t=="function")return function(){t.apply(e,arguments)}}function Rc(e,t){var i=!1;function n(o){i||(i=!0,ie.reject(e,o))}function r(o){i||(i=!0,ie.resolve(e,o))}function a(){t(r,n)}var s=Mc(a);s.status==="error"&&n(s.value)}function Mc(e,t){var i={};try{i.value=e(t),i.status="success"}catch(n){i.status="error",i.value=n}return i}ot.resolve=xg;function xg(e){return e instanceof this?e:ie.resolve(new this(Qt),e)}ot.reject=wg;function wg(e){var t=new this(Qt);return ie.reject(t,e)}ot.all=_g;function _g(e){var t=this;if(Object.prototype.toString.call(e)!=="[object Array]")return this.reject(new TypeError("must be an array"));var i=e.length,n=!1;if(!i)return this.resolve([]);for(var r=new Array(i),a=0,s=-1,o=new this(Qt);++s<i;)d(e[s],s);return o;function d(l,c){t.resolve(l).then(f,function(u){n||(n=!0,ie.reject(o,u))});function f(u){r[c]=u,++a===i&&!n&&(n=!0,ie.resolve(o,r))}}}ot.race=Eg;function Eg(e){var t=this;if(Object.prototype.toString.call(e)!=="[object Array]")return this.reject(new TypeError("must be an array"));var i=e.length,n=!1;if(!i)return this.resolve([]);for(var r=-1,a=new this(Qt);++r<i;)s(e[r]);return a;function s(o){t.resolve(o).then(function(d){n||(n=!0,ie.resolve(a,d))},function(d){n||(n=!0,ie.reject(a,d))})}}});var ei=E((pw,zc)=>{"use strict";var $a=null;typeof Promise!="undefined"?$a=Promise:$a=Dc();zc.exports={Promise:$a}});var Nc=E(Bc=>{"use strict";(function(e,t){"use strict";if(e.setImmediate)return;var i=1,n={},r=!1,a=e.document,s;function o(h){typeof h!="function"&&(h=new Function(""+h));for(var w=new Array(arguments.length-1),y=0;y<w.length;y++)w[y]=arguments[y+1];var m={callback:h,args:w};return n[i]=m,s(i),i++}function d(h){delete n[h]}function l(h){var w=h.callback,y=h.args;switch(y.length){case 0:w();break;case 1:w(y[0]);break;case 2:w(y[0],y[1]);break;case 3:w(y[0],y[1],y[2]);break;default:w.apply(t,y);break}}function c(h){if(r)setTimeout(c,0,h);else{var w=n[h];if(w){r=!0;try{l(w)}finally{d(h),r=!1}}}}function f(){s=function(h){process.nextTick(function(){c(h)})}}function u(){if(e.postMessage&&!e.importScripts){var h=!0,w=e.onmessage;return e.onmessage=function(){h=!1},e.postMessage("","*"),e.onmessage=w,h}}function p(){var h="setImmediate$"+Math.random()+"$",w=function(y){y.source===e&&typeof y.data=="string"&&y.data.indexOf(h)===0&&c(+y.data.slice(h.length))};e.addEventListener?e.addEventListener("message",w,!1):e.attachEvent("onmessage",w),s=function(y){e.postMessage(h+y,"*")}}function v(){var h=new MessageChannel;h.port1.onmessage=function(w){var y=w.data;c(y)},s=function(w){h.port2.postMessage(w)}}function b(){var h=a.documentElement;s=function(w){var y=a.createElement("script");y.onreadystatechange=function(){c(w),y.onreadystatechange=null,h.removeChild(y),y=null},h.appendChild(y)}}function x(){s=function(h){setTimeout(c,0,h)}}var g=Object.getPrototypeOf&&Object.getPrototypeOf(e);g=g&&g.setTimeout?g:e,{}.toString.call(e.process)==="[object process]"?f():u()?p():e.MessageChannel?v():a&&"onreadystatechange"in a.createElement("script")?b():x(),g.setImmediate=o,g.clearImmediate=d})(typeof self=="undefined"?typeof global=="undefined"?Bc:global:self)});var H=E(K=>{"use strict";var lt=We(),Sg=Ma(),ti=qi(),Ha=ei();Nc();function Ag(e){var t=null;return lt.uint8array?t=new Uint8Array(e.length):t=new Array(e.length),Zn(e,t)}K.newBlob=function(e,t){K.checkSupport("blob");try{return new Blob([e],{type:t})}catch{try{var i=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,n=new i;return n.append(e),n.getBlob(t)}catch{throw new Error("Bug : can't construct the Blob.")}}};function Ki(e){return e}function Zn(e,t){for(var i=0;i<e.length;++i)t[i]=e.charCodeAt(i)&255;return t}var Xn={stringifyByChunk:function(e,t,i){var n=[],r=0,a=e.length;if(a<=i)return String.fromCharCode.apply(null,e);for(;r<a;)t==="array"||t==="nodebuffer"?n.push(String.fromCharCode.apply(null,e.slice(r,Math.min(r+i,a)))):n.push(String.fromCharCode.apply(null,e.subarray(r,Math.min(r+i,a)))),r+=i;return n.join("")},stringifyByChar:function(e){for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return t},applyCanBeUsed:{uint8array:(function(){try{return lt.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return lt.nodebuffer&&String.fromCharCode.apply(null,ti.allocBuffer(1)).length===1}catch{return!1}})()}};function Xi(e){var t=65536,i=K.getTypeOf(e),n=!0;if(i==="uint8array"?n=Xn.applyCanBeUsed.uint8array:i==="nodebuffer"&&(n=Xn.applyCanBeUsed.nodebuffer),n)for(;t>1;)try{return Xn.stringifyByChunk(e,i,t)}catch{t=Math.floor(t/2)}return Xn.stringifyByChar(e)}K.applyFromCharCode=Xi;function Jn(e,t){for(var i=0;i<e.length;i++)t[i]=e[i];return t}var ct={};ct.string={string:Ki,array:function(e){return Zn(e,new Array(e.length))},arraybuffer:function(e){return ct.string.uint8array(e).buffer},uint8array:function(e){return Zn(e,new Uint8Array(e.length))},nodebuffer:function(e){return Zn(e,ti.allocBuffer(e.length))}};ct.array={string:Xi,array:Ki,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return ti.newBufferFrom(e)}};ct.arraybuffer={string:function(e){return Xi(new Uint8Array(e))},array:function(e){return Jn(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:Ki,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return ti.newBufferFrom(new Uint8Array(e))}};ct.uint8array={string:Xi,array:function(e){return Jn(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:Ki,nodebuffer:function(e){return ti.newBufferFrom(e)}};ct.nodebuffer={string:Xi,array:function(e){return Jn(e,new Array(e.length))},arraybuffer:function(e){return ct.nodebuffer.uint8array(e).buffer},uint8array:function(e){return Jn(e,new Uint8Array(e.length))},nodebuffer:Ki};K.transformTo=function(e,t){if(t||(t=""),!e)return t;K.checkSupport(e);var i=K.getTypeOf(t),n=ct[i][e](t);return n};K.resolve=function(e){for(var t=e.split("/"),i=[],n=0;n<t.length;n++){var r=t[n];r==="."||r===""&&n!==0&&n!==t.length-1||(r===".."?i.pop():i.push(r))}return i.join("/")};K.getTypeOf=function(e){if(typeof e=="string")return"string";if(Object.prototype.toString.call(e)==="[object Array]")return"array";if(lt.nodebuffer&&ti.isBuffer(e))return"nodebuffer";if(lt.uint8array&&e instanceof Uint8Array)return"uint8array";if(lt.arraybuffer&&e instanceof ArrayBuffer)return"arraybuffer"};K.checkSupport=function(e){var t=lt[e.toLowerCase()];if(!t)throw new Error(e+" is not supported by this platform")};K.MAX_VALUE_16BITS=65535;K.MAX_VALUE_32BITS=-1;K.pretty=function(e){var t="",i,n;for(n=0;n<(e||"").length;n++)i=e.charCodeAt(n),t+="\\x"+(i<16?"0":"")+i.toString(16).toUpperCase();return t};K.delay=function(e,t,i){setImmediate(function(){e.apply(i||null,t||[])})};K.inherits=function(e,t){var i=function(){};i.prototype=t.prototype,e.prototype=new i};K.extend=function(){var e={},t,i;for(t=0;t<arguments.length;t++)for(i in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],i)&&typeof e[i]=="undefined"&&(e[i]=arguments[t][i]);return e};K.prepareContent=function(e,t,i,n,r){var a=Ha.Promise.resolve(t).then(function(s){var o=lt.blob&&(s instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(s))!==-1);return o&&typeof FileReader!="undefined"?new Ha.Promise(function(d,l){var c=new FileReader;c.onload=function(f){d(f.target.result)},c.onerror=function(f){l(f.target.error)},c.readAsArrayBuffer(s)}):s});return a.then(function(s){var o=K.getTypeOf(s);return o?(o==="arraybuffer"?s=K.transformTo("uint8array",s):o==="string"&&(r?s=Sg.decode(s):i&&n!==!0&&(s=Ag(s))),s):Ha.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}});var de=E((gw,$c)=>{"use strict";function Fc(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}Fc.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return this.isFinished?!1:(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var i=0;i<this._listeners[e].length;i++)this._listeners[e][i].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(i){t.processChunk(i)}),e.on("end",function(){t.end()}),e.on("error",function(i){t.error(i)}),this},pause:function(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var e=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}};$c.exports=Fc});var ni=E(dt=>{"use strict";var ii=H(),Tt=We(),Cg=qi(),Qn=de(),Zi=new Array(256);for(Ye=0;Ye<256;Ye++)Zi[Ye]=Ye>=252?6:Ye>=248?5:Ye>=240?4:Ye>=224?3:Ye>=192?2:1;var Ye;Zi[254]=Zi[254]=1;var Tg=function(e){var t,i,n,r,a,s=e.length,o=0;for(r=0;r<s;r++)i=e.charCodeAt(r),(i&64512)===55296&&r+1<s&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(i=65536+(i-55296<<10)+(n-56320),r++)),o+=i<128?1:i<2048?2:i<65536?3:4;for(Tt.uint8array?t=new Uint8Array(o):t=new Array(o),a=0,r=0;a<o;r++)i=e.charCodeAt(r),(i&64512)===55296&&r+1<s&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(i=65536+(i-55296<<10)+(n-56320),r++)),i<128?t[a++]=i:i<2048?(t[a++]=192|i>>>6,t[a++]=128|i&63):i<65536?(t[a++]=224|i>>>12,t[a++]=128|i>>>6&63,t[a++]=128|i&63):(t[a++]=240|i>>>18,t[a++]=128|i>>>12&63,t[a++]=128|i>>>6&63,t[a++]=128|i&63);return t},kg=function(e,t){var i;for(t=t||e.length,t>e.length&&(t=e.length),i=t-1;i>=0&&(e[i]&192)===128;)i--;return i<0||i===0?t:i+Zi[e[i]]>t?i:t},Lg=function(e){var t,i,n,r,a=e.length,s=new Array(a*2);for(i=0,t=0;t<a;){if(n=e[t++],n<128){s[i++]=n;continue}if(r=Zi[n],r>4){s[i++]=65533,t+=r-1;continue}for(n&=r===2?31:r===3?15:7;r>1&&t<a;)n=n<<6|e[t++]&63,r--;if(r>1){s[i++]=65533;continue}n<65536?s[i++]=n:(n-=65536,s[i++]=55296|n>>10&1023,s[i++]=56320|n&1023)}return s.length!==i&&(s.subarray?s=s.subarray(0,i):s.length=i),ii.applyFromCharCode(s)};dt.utf8encode=function(t){return Tt.nodebuffer?Cg.newBufferFrom(t,"utf-8"):Tg(t)};dt.utf8decode=function(t){return Tt.nodebuffer?ii.transformTo("nodebuffer",t).toString("utf-8"):(t=ii.transformTo(Tt.uint8array?"uint8array":"array",t),Lg(t))};function er(){Qn.call(this,"utf-8 decode"),this.leftOver=null}ii.inherits(er,Qn);er.prototype.processChunk=function(e){var t=ii.transformTo(Tt.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(Tt.uint8array){var i=t;t=new Uint8Array(i.length+this.leftOver.length),t.set(this.leftOver,0),t.set(i,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var n=kg(t),r=t;n!==t.length&&(Tt.uint8array?(r=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(r=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:dt.utf8decode(r),meta:e.meta})};er.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:dt.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)};dt.Utf8DecodeWorker=er;function Ua(){Qn.call(this,"utf-8 encode")}ii.inherits(Ua,Qn);Ua.prototype.processChunk=function(e){this.push({data:dt.utf8encode(e.data),meta:e.meta})};dt.Utf8EncodeWorker=Ua});var Gc=E((bw,qc)=>{"use strict";var Hc=de(),Uc=H();function qa(e){Hc.call(this,"ConvertWorker to "+e),this.destType=e}Uc.inherits(qa,Hc);qa.prototype.processChunk=function(e){this.push({data:Uc.transformTo(this.destType,e.data),meta:e.meta})};qc.exports=qa});var Vc=E((vw,Yc)=>{"use strict";var Wc=Oa().Readable,Og=H();Og.inherits(Ga,Wc);function Ga(e,t,i){Wc.call(this,t),this._helper=e;var n=this;e.on("data",function(r,a){n.push(r)||n._helper.pause(),i&&i(a)}).on("error",function(r){n.emit("error",r)}).on("end",function(){n.push(null)})}Ga.prototype._read=function(){this._helper.resume()};Yc.exports=Ga});var Wa=E((yw,Zc)=>{"use strict";var kt=H(),Ig=Gc(),Pg=de(),Rg=Ma(),Mg=We(),jg=ei(),Kc=null;if(Mg.nodestream)try{Kc=Vc()}catch{}function Dg(e,t,i){switch(e){case"blob":return kt.newBlob(kt.transformTo("arraybuffer",t),i);case"base64":return Rg.encode(t);default:return kt.transformTo(e,t)}}function zg(e,t){var i,n=0,r=null,a=0;for(i=0;i<t.length;i++)a+=t[i].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(r=new Uint8Array(a),i=0;i<t.length;i++)r.set(t[i],n),n+=t[i].length;return r;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}function Bg(e,t){return new jg.Promise(function(i,n){var r=[],a=e._internalType,s=e._outputType,o=e._mimeType;e.on("data",function(d,l){r.push(d),t&&t(l)}).on("error",function(d){r=[],n(d)}).on("end",function(){try{var d=Dg(s,zg(a,r),o);i(d)}catch(l){n(l)}r=[]}).resume()})}function Xc(e,t,i){var n=t;switch(t){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string";break}try{this._internalType=n,this._outputType=t,this._mimeType=i,kt.checkSupport(n),this._worker=e.pipe(new Ig(n)),e.lock()}catch(r){this._worker=new Pg("error"),this._worker.error(r)}}Xc.prototype={accumulate:function(e){return Bg(this,e)},on:function(e,t){var i=this;return e==="data"?this._worker.on(e,function(n){t.call(i,n.data,n.meta)}):this._worker.on(e,function(){kt.delay(t,arguments,i)}),this},resume:function(){return kt.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(kt.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new Kc(this,{objectMode:this._outputType!=="nodebuffer"},e)}};Zc.exports=Xc});var Ya=E(Ee=>{"use strict";Ee.base64=!1;Ee.binary=!1;Ee.dir=!1;Ee.createFolders=!0;Ee.date=null;Ee.compression=null;Ee.compressionOptions=null;Ee.comment=null;Ee.unixPermissions=null;Ee.dosPermissions=null});var Va=E((ww,Jc)=>{"use strict";var tr=H(),ir=de(),Ng=16*1024;function ri(e){ir.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(i){t.dataIsReady=!0,t.data=i,t.max=i&&i.length||0,t.type=tr.getTypeOf(i),t.isPaused||t._tickAndRepeat()},function(i){t.error(i)})}tr.inherits(ri,ir);ri.prototype.cleanUp=function(){ir.prototype.cleanUp.call(this),this.data=null};ri.prototype.resume=function(){return ir.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,tr.delay(this._tickAndRepeat,[],this)),!0):!1};ri.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(tr.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))};ri.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=Ng,t=null,i=Math.min(this.max,this.index+e);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,i);break;case"uint8array":t=this.data.subarray(this.index,i);break;case"array":case"nodebuffer":t=this.data.slice(this.index,i);break}return this.index=i,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})};Jc.exports=ri});var nr=E((_w,ed)=>{"use strict";var Fg=H();function $g(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[i]=e}return t}var Qc=$g();function Hg(e,t,i,n){var r=Qc,a=n+i;e=e^-1;for(var s=n;s<a;s++)e=e>>>8^r[(e^t[s])&255];return e^-1}function Ug(e,t,i,n){var r=Qc,a=n+i;e=e^-1;for(var s=n;s<a;s++)e=e>>>8^r[(e^t.charCodeAt(s))&255];return e^-1}ed.exports=function(t,i){if(typeof t=="undefined"||!t.length)return 0;var n=Fg.getTypeOf(t)!=="string";return n?Hg(i|0,t,t.length,0):Ug(i|0,t,t.length,0)}});var Xa=E((Ew,id)=>{"use strict";var td=de(),qg=nr(),Gg=H();function Ka(){td.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}Gg.inherits(Ka,td);Ka.prototype.processChunk=function(e){this.streamInfo.crc32=qg(e.data,this.streamInfo.crc32||0),this.push(e)};id.exports=Ka});var rd=E((Sw,nd)=>{"use strict";var Wg=H(),Za=de();function Ja(e){Za.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}Wg.inherits(Ja,Za);Ja.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}Za.prototype.processChunk.call(this,e)};nd.exports=Ja});var rr=E((Aw,od)=>{"use strict";var ad=ei(),sd=Va(),Yg=Xa(),Qa=rd();function es(e,t,i,n,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=i,this.compression=n,this.compressedContent=r}es.prototype={getContentWorker:function(){var e=new sd(ad.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new Qa("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new sd(ad.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};es.createWorkerFrom=function(e,t,i){return e.pipe(new Yg).pipe(new Qa("uncompressedSize")).pipe(t.compressWorker(i)).pipe(new Qa("compressedSize")).withStreamInfo("compression",t)};od.exports=es});var ud=E((Cw,dd)=>{"use strict";var Vg=Wa(),Kg=Va(),ts=ni(),is=rr(),ld=de(),ns=function(e,t,i){this.name=e,this.dir=i.dir,this.date=i.date,this.comment=i.comment,this.unixPermissions=i.unixPermissions,this.dosPermissions=i.dosPermissions,this._data=t,this._dataBinary=i.binary,this.options={compression:i.compression,compressionOptions:i.compressionOptions}};ns.prototype={internalStream:function(e){var t=null,i="string";try{if(!e)throw new Error("No output type specified.");i=e.toLowerCase();var n=i==="string"||i==="text";(i==="binarystring"||i==="text")&&(i="string"),t=this._decompressWorker();var r=!this._dataBinary;r&&!n&&(t=t.pipe(new ts.Utf8EncodeWorker)),!r&&n&&(t=t.pipe(new ts.Utf8DecodeWorker))}catch(a){t=new ld("error"),t.error(a)}return new Vg(t,i,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof is&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new ts.Utf8EncodeWorker)),is.createWorkerFrom(i,e,t)},_decompressWorker:function(){return this._data instanceof is?this._data.getContentWorker():this._data instanceof ld?this._data:new Kg(this._data)}};var cd=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Xg=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(ar=0;ar<cd.length;ar++)ns.prototype[cd[ar]]=Xg;var ar;dd.exports=ns});var Ve=E(se=>{"use strict";var Zg=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function Jg(e,t){return Object.prototype.hasOwnProperty.call(e,t)}se.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if(typeof i!="object")throw new TypeError(i+"must be non-object");for(var n in i)Jg(i,n)&&(e[n]=i[n])}}return e};se.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var Qg={arraySet:function(e,t,i,n,r){if(t.subarray&&e.subarray){e.set(t.subarray(i,i+n),r);return}for(var a=0;a<n;a++)e[r+a]=t[i+a]},flattenChunks:function(e){var t,i,n,r,a,s;for(n=0,t=0,i=e.length;t<i;t++)n+=e[t].length;for(s=new Uint8Array(n),r=0,t=0,i=e.length;t<i;t++)a=e[t],s.set(a,r),r+=a.length;return s}},em={arraySet:function(e,t,i,n,r){for(var a=0;a<n;a++)e[r+a]=t[i+a]},flattenChunks:function(e){return[].concat.apply([],e)}};se.setTyped=function(e){e?(se.Buf8=Uint8Array,se.Buf16=Uint16Array,se.Buf32=Int32Array,se.assign(se,Qg)):(se.Buf8=Array,se.Buf16=Array,se.Buf32=Array,se.assign(se,em))};se.setTyped(Zg)});var Md=E(oi=>{"use strict";var tm=Ve(),im=4,pd=0,fd=1,nm=2;function si(e){for(var t=e.length;--t>=0;)e[t]=0}var rm=0,yd=1,am=2,sm=3,om=258,ds=29,rn=256,Qi=rn+1+ds,ai=30,us=19,xd=2*Qi+1,Lt=15,rs=16,lm=7,ps=256,wd=16,_d=17,Ed=18,ls=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],sr=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],cm=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Sd=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],dm=512,Ke=new Array((Qi+2)*2);si(Ke);var Ji=new Array(ai*2);si(Ji);var en=new Array(dm);si(en);var tn=new Array(om-sm+1);si(tn);var fs=new Array(ds);si(fs);var or=new Array(ai);si(or);function as(e,t,i,n,r){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=n,this.max_length=r,this.has_stree=e&&e.length}var Ad,Cd,Td;function ss(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function kd(e){return e<256?en[e]:en[256+(e>>>7)]}function nn(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function le(e,t,i){e.bi_valid>rs-i?(e.bi_buf|=t<<e.bi_valid&65535,nn(e,e.bi_buf),e.bi_buf=t>>rs-e.bi_valid,e.bi_valid+=i-rs):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)}function Pe(e,t,i){le(e,i[t*2],i[t*2+1])}function Ld(e,t){var i=0;do i|=e&1,e>>>=1,i<<=1;while(--t>0);return i>>>1}function um(e){e.bi_valid===16?(nn(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function pm(e,t){var i=t.dyn_tree,n=t.max_code,r=t.stat_desc.static_tree,a=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,d=t.stat_desc.max_length,l,c,f,u,p,v,b=0;for(u=0;u<=Lt;u++)e.bl_count[u]=0;for(i[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<xd;l++)c=e.heap[l],u=i[i[c*2+1]*2+1]+1,u>d&&(u=d,b++),i[c*2+1]=u,!(c>n)&&(e.bl_count[u]++,p=0,c>=o&&(p=s[c-o]),v=i[c*2],e.opt_len+=v*(u+p),a&&(e.static_len+=v*(r[c*2+1]+p)));if(b!==0){do{for(u=d-1;e.bl_count[u]===0;)u--;e.bl_count[u]--,e.bl_count[u+1]+=2,e.bl_count[d]--,b-=2}while(b>0);for(u=d;u!==0;u--)for(c=e.bl_count[u];c!==0;)f=e.heap[--l],!(f>n)&&(i[f*2+1]!==u&&(e.opt_len+=(u-i[f*2+1])*i[f*2],i[f*2+1]=u),c--)}}function Od(e,t,i){var n=new Array(Lt+1),r=0,a,s;for(a=1;a<=Lt;a++)n[a]=r=r+i[a-1]<<1;for(s=0;s<=t;s++){var o=e[s*2+1];o!==0&&(e[s*2]=Ld(n[o]++,o))}}function fm(){var e,t,i,n,r,a=new Array(Lt+1);for(i=0,n=0;n<ds-1;n++)for(fs[n]=i,e=0;e<1<<ls[n];e++)tn[i++]=n;for(tn[i-1]=n,r=0,n=0;n<16;n++)for(or[n]=r,e=0;e<1<<sr[n];e++)en[r++]=n;for(r>>=7;n<ai;n++)for(or[n]=r<<7,e=0;e<1<<sr[n]-7;e++)en[256+r++]=n;for(t=0;t<=Lt;t++)a[t]=0;for(e=0;e<=143;)Ke[e*2+1]=8,e++,a[8]++;for(;e<=255;)Ke[e*2+1]=9,e++,a[9]++;for(;e<=279;)Ke[e*2+1]=7,e++,a[7]++;for(;e<=287;)Ke[e*2+1]=8,e++,a[8]++;for(Od(Ke,Qi+1,a),e=0;e<ai;e++)Ji[e*2+1]=5,Ji[e*2]=Ld(e,5);Ad=new as(Ke,ls,rn+1,Qi,Lt),Cd=new as(Ji,sr,0,ai,Lt),Td=new as(new Array(0),cm,0,us,lm)}function Id(e){var t;for(t=0;t<Qi;t++)e.dyn_ltree[t*2]=0;for(t=0;t<ai;t++)e.dyn_dtree[t*2]=0;for(t=0;t<us;t++)e.bl_tree[t*2]=0;e.dyn_ltree[ps*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Pd(e){e.bi_valid>8?nn(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function hm(e,t,i,n){Pd(e),n&&(nn(e,i),nn(e,~i)),tm.arraySet(e.pending_buf,e.window,t,i,e.pending),e.pending+=i}function hd(e,t,i,n){var r=t*2,a=i*2;return e[r]<e[a]||e[r]===e[a]&&n[t]<=n[i]}function os(e,t,i){for(var n=e.heap[i],r=i<<1;r<=e.heap_len&&(r<e.heap_len&&hd(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!hd(t,n,e.heap[r],e.depth));)e.heap[i]=e.heap[r],i=r,r<<=1;e.heap[i]=n}function gd(e,t,i){var n,r,a=0,s,o;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],r=e.pending_buf[e.l_buf+a],a++,n===0?Pe(e,r,t):(s=tn[r],Pe(e,s+rn+1,t),o=ls[s],o!==0&&(r-=fs[s],le(e,r,o)),n--,s=kd(n),Pe(e,s,i),o=sr[s],o!==0&&(n-=or[s],le(e,n,o)));while(a<e.last_lit);Pe(e,ps,t)}function cs(e,t){var i=t.dyn_tree,n=t.stat_desc.static_tree,r=t.stat_desc.has_stree,a=t.stat_desc.elems,s,o,d=-1,l;for(e.heap_len=0,e.heap_max=xd,s=0;s<a;s++)i[s*2]!==0?(e.heap[++e.heap_len]=d=s,e.depth[s]=0):i[s*2+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=d<2?++d:0,i[l*2]=1,e.depth[l]=0,e.opt_len--,r&&(e.static_len-=n[l*2+1]);for(t.max_code=d,s=e.heap_len>>1;s>=1;s--)os(e,i,s);l=a;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],os(e,i,1),o=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=o,i[l*2]=i[s*2]+i[o*2],e.depth[l]=(e.depth[s]>=e.depth[o]?e.depth[s]:e.depth[o])+1,i[s*2+1]=i[o*2+1]=l,e.heap[1]=l++,os(e,i,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],pm(e,t),Od(i,d,e.bl_count)}function md(e,t,i){var n,r=-1,a,s=t[1],o=0,d=7,l=4;for(s===0&&(d=138,l=3),t[(i+1)*2+1]=65535,n=0;n<=i;n++)a=s,s=t[(n+1)*2+1],!(++o<d&&a===s)&&(o<l?e.bl_tree[a*2]+=o:a!==0?(a!==r&&e.bl_tree[a*2]++,e.bl_tree[wd*2]++):o<=10?e.bl_tree[_d*2]++:e.bl_tree[Ed*2]++,o=0,r=a,s===0?(d=138,l=3):a===s?(d=6,l=3):(d=7,l=4))}function bd(e,t,i){var n,r=-1,a,s=t[1],o=0,d=7,l=4;for(s===0&&(d=138,l=3),n=0;n<=i;n++)if(a=s,s=t[(n+1)*2+1],!(++o<d&&a===s)){if(o<l)do Pe(e,a,e.bl_tree);while(--o!==0);else a!==0?(a!==r&&(Pe(e,a,e.bl_tree),o--),Pe(e,wd,e.bl_tree),le(e,o-3,2)):o<=10?(Pe(e,_d,e.bl_tree),le(e,o-3,3)):(Pe(e,Ed,e.bl_tree),le(e,o-11,7));o=0,r=a,s===0?(d=138,l=3):a===s?(d=6,l=3):(d=7,l=4)}}function gm(e){var t;for(md(e,e.dyn_ltree,e.l_desc.max_code),md(e,e.dyn_dtree,e.d_desc.max_code),cs(e,e.bl_desc),t=us-1;t>=3&&e.bl_tree[Sd[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function mm(e,t,i,n){var r;for(le(e,t-257,5),le(e,i-1,5),le(e,n-4,4),r=0;r<n;r++)le(e,e.bl_tree[Sd[r]*2+1],3);bd(e,e.dyn_ltree,t-1),bd(e,e.dyn_dtree,i-1)}function bm(e){var t=4093624447,i;for(i=0;i<=31;i++,t>>>=1)if(t&1&&e.dyn_ltree[i*2]!==0)return pd;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return fd;for(i=32;i<rn;i++)if(e.dyn_ltree[i*2]!==0)return fd;return pd}var vd=!1;function vm(e){vd||(fm(),vd=!0),e.l_desc=new ss(e.dyn_ltree,Ad),e.d_desc=new ss(e.dyn_dtree,Cd),e.bl_desc=new ss(e.bl_tree,Td),e.bi_buf=0,e.bi_valid=0,Id(e)}function Rd(e,t,i,n){le(e,(rm<<1)+(n?1:0),3),hm(e,t,i,!0)}function ym(e){le(e,yd<<1,3),Pe(e,ps,Ke),um(e)}function xm(e,t,i,n){var r,a,s=0;e.level>0?(e.strm.data_type===nm&&(e.strm.data_type=bm(e)),cs(e,e.l_desc),cs(e,e.d_desc),s=gm(e),r=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=r&&(r=a)):r=a=i+5,i+4<=r&&t!==-1?Rd(e,t,i,n):e.strategy===im||a===r?(le(e,(yd<<1)+(n?1:0),3),gd(e,Ke,Ji)):(le(e,(am<<1)+(n?1:0),3),mm(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),gd(e,e.dyn_ltree,e.dyn_dtree)),Id(e),n&&Pd(e)}function wm(e,t,i){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=i&255,e.last_lit++,t===0?e.dyn_ltree[i*2]++:(e.matches++,t--,e.dyn_ltree[(tn[i]+rn+1)*2]++,e.dyn_dtree[kd(t)*2]++),e.last_lit===e.lit_bufsize-1}oi._tr_init=vm;oi._tr_stored_block=Rd;oi._tr_flush_block=xm;oi._tr_tally=wm;oi._tr_align=ym});var hs=E((Lw,jd)=>{"use strict";function _m(e,t,i,n){for(var r=e&65535|0,a=e>>>16&65535|0,s=0;i!==0;){s=i>2e3?2e3:i,i-=s;do r=r+t[n++]|0,a=a+r|0;while(--s);r%=65521,a%=65521}return r|a<<16|0}jd.exports=_m});var gs=E((Ow,Dd)=>{"use strict";function Em(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[i]=e}return t}var Sm=Em();function Am(e,t,i,n){var r=Sm,a=n+i;e^=-1;for(var s=n;s<a;s++)e=e>>>8^r[(e^t[s])&255];return e^-1}Dd.exports=Am});var lr=E((Iw,zd)=>{"use strict";zd.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Wd=E(je=>{"use strict";var oe=Ve(),me=Md(),$d=hs(),ut=gs(),Cm=lr(),Rt=0,Tm=1,km=3,mt=4,Bd=5,Me=0,Nd=1,be=-2,Lm=-3,ms=-5,Om=-1,Im=1,cr=2,Pm=3,Rm=4,Mm=0,jm=2,fr=8,Dm=9,zm=15,Bm=8,Nm=29,Fm=256,vs=Fm+1+Nm,$m=30,Hm=19,Um=2*vs+1,qm=15,R=3,ht=258,Se=ht+R+1,Gm=32,hr=42,ys=69,dr=73,ur=91,pr=103,Ot=113,sn=666,J=1,on=2,It=3,di=4,Wm=3;function gt(e,t){return e.msg=Cm[t],t}function Fd(e){return(e<<1)-(e>4?9:0)}function ft(e){for(var t=e.length;--t>=0;)e[t]=0}function pt(e){var t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),i!==0&&(oe.arraySet(e.output,t.pending_buf,t.pending_out,i,e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,t.pending===0&&(t.pending_out=0))}function ee(e,t){me._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,pt(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function an(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function Ym(e,t,i,n){var r=e.avail_in;return r>n&&(r=n),r===0?0:(e.avail_in-=r,oe.arraySet(t,e.input,e.next_in,r,i),e.state.wrap===1?e.adler=$d(e.adler,t,r,i):e.state.wrap===2&&(e.adler=ut(e.adler,t,r,i)),e.next_in+=r,e.total_in+=r,r)}function Hd(e,t){var i=e.max_chain_length,n=e.strstart,r,a,s=e.prev_length,o=e.nice_match,d=e.strstart>e.w_size-Se?e.strstart-(e.w_size-Se):0,l=e.window,c=e.w_mask,f=e.prev,u=e.strstart+ht,p=l[n+s-1],v=l[n+s];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do if(r=t,!(l[r+s]!==v||l[r+s-1]!==p||l[r]!==l[n]||l[++r]!==l[n+1])){n+=2,r++;do;while(l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&n<u);if(a=ht-(u-n),n=u-ht,a>s){if(e.match_start=t,s=a,a>=o)break;p=l[n+s-1],v=l[n+s]}}while((t=f[t&c])>d&&--i!==0);return s<=e.lookahead?s:e.lookahead}function Pt(e){var t=e.w_size,i,n,r,a,s;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Se)){oe.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,i=n;do r=e.head[--i],e.head[i]=r>=t?r-t:0;while(--n);n=t,i=n;do r=e.prev[--i],e.prev[i]=r>=t?r-t:0;while(--n);a+=t}if(e.strm.avail_in===0)break;if(n=Ym(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=n,e.lookahead+e.insert>=R)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+R-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<R)););}while(e.lookahead<Se&&e.strm.avail_in!==0)}function Vm(e,t){var i=65535;for(i>e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Pt(e),e.lookahead===0&&t===Rt)return J;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+i;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,ee(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Se&&(ee(e,!1),e.strm.avail_out===0))return J}return e.insert=0,t===mt?(ee(e,!0),e.strm.avail_out===0?It:di):(e.strstart>e.block_start&&(ee(e,!1),e.strm.avail_out===0),J)}function bs(e,t){for(var i,n;;){if(e.lookahead<Se){if(Pt(e),e.lookahead<Se&&t===Rt)return J;if(e.lookahead===0)break}if(i=0,e.lookahead>=R&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),i!==0&&e.strstart-i<=e.w_size-Se&&(e.match_length=Hd(e,i)),e.match_length>=R)if(n=me._tr_tally(e,e.strstart-e.match_start,e.match_length-R),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=R){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=me._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(ee(e,!1),e.strm.avail_out===0))return J}return e.insert=e.strstart<R-1?e.strstart:R-1,t===mt?(ee(e,!0),e.strm.avail_out===0?It:di):e.last_lit&&(ee(e,!1),e.strm.avail_out===0)?J:on}function li(e,t){for(var i,n,r;;){if(e.lookahead<Se){if(Pt(e),e.lookahead<Se&&t===Rt)return J;if(e.lookahead===0)break}if(i=0,e.lookahead>=R&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=R-1,i!==0&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-Se&&(e.match_length=Hd(e,i),e.match_length<=5&&(e.strategy===Im||e.match_length===R&&e.strstart-e.match_start>4096)&&(e.match_length=R-1)),e.prev_length>=R&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-R,n=me._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-R),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=r&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=R-1,e.strstart++,n&&(ee(e,!1),e.strm.avail_out===0))return J}else if(e.match_available){if(n=me._tr_tally(e,0,e.window[e.strstart-1]),n&&ee(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return J}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=me._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<R-1?e.strstart:R-1,t===mt?(ee(e,!0),e.strm.avail_out===0?It:di):e.last_lit&&(ee(e,!1),e.strm.avail_out===0)?J:on}function Km(e,t){for(var i,n,r,a,s=e.window;;){if(e.lookahead<=ht){if(Pt(e),e.lookahead<=ht&&t===Rt)return J;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=R&&e.strstart>0&&(r=e.strstart-1,n=s[r],n===s[++r]&&n===s[++r]&&n===s[++r])){a=e.strstart+ht;do;while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<a);e.match_length=ht-(a-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=R?(i=me._tr_tally(e,1,e.match_length-R),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=me._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(ee(e,!1),e.strm.avail_out===0))return J}return e.insert=0,t===mt?(ee(e,!0),e.strm.avail_out===0?It:di):e.last_lit&&(ee(e,!1),e.strm.avail_out===0)?J:on}function Xm(e,t){for(var i;;){if(e.lookahead===0&&(Pt(e),e.lookahead===0)){if(t===Rt)return J;break}if(e.match_length=0,i=me._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(ee(e,!1),e.strm.avail_out===0))return J}return e.insert=0,t===mt?(ee(e,!0),e.strm.avail_out===0?It:di):e.last_lit&&(ee(e,!1),e.strm.avail_out===0)?J:on}function Re(e,t,i,n,r){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=n,this.func=r}var ci;ci=[new Re(0,0,0,0,Vm),new Re(4,4,8,4,bs),new Re(4,5,16,8,bs),new Re(4,6,32,32,bs),new Re(4,4,16,16,li),new Re(8,16,32,32,li),new Re(8,16,128,128,li),new Re(8,32,128,256,li),new Re(32,128,258,1024,li),new Re(32,258,258,4096,li)];function Zm(e){e.window_size=2*e.w_size,ft(e.head),e.max_lazy_match=ci[e.level].max_lazy,e.good_match=ci[e.level].good_length,e.nice_match=ci[e.level].nice_length,e.max_chain_length=ci[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=R-1,e.match_available=0,e.ins_h=0}function Jm(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=fr,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new oe.Buf16(Um*2),this.dyn_dtree=new oe.Buf16((2*$m+1)*2),this.bl_tree=new oe.Buf16((2*Hm+1)*2),ft(this.dyn_ltree),ft(this.dyn_dtree),ft(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new oe.Buf16(qm+1),this.heap=new oe.Buf16(2*vs+1),ft(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new oe.Buf16(2*vs+1),ft(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Ud(e){var t;return!e||!e.state?gt(e,be):(e.total_in=e.total_out=0,e.data_type=jm,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?hr:Ot,e.adler=t.wrap===2?0:1,t.last_flush=Rt,me._tr_init(t),Me)}function qd(e){var t=Ud(e);return t===Me&&Zm(e.state),t}function Qm(e,t){return!e||!e.state||e.state.wrap!==2?be:(e.state.gzhead=t,Me)}function Gd(e,t,i,n,r,a){if(!e)return be;var s=1;if(t===Om&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>Dm||i!==fr||n<8||n>15||t<0||t>9||a<0||a>Rm)return gt(e,be);n===8&&(n=9);var o=new Jm;return e.state=o,o.strm=e,o.wrap=s,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=r+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+R-1)/R),o.window=new oe.Buf8(o.w_size*2),o.head=new oe.Buf16(o.hash_size),o.prev=new oe.Buf16(o.w_size),o.lit_bufsize=1<<r+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new oe.Buf8(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=a,o.method=i,qd(e)}function eb(e,t){return Gd(e,t,fr,zm,Bm,Mm)}function tb(e,t){var i,n,r,a;if(!e||!e.state||t>Bd||t<0)return e?gt(e,be):be;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===sn&&t!==mt)return gt(e,e.avail_out===0?ms:be);if(n.strm=e,i=n.last_flush,n.last_flush=t,n.status===hr)if(n.wrap===2)e.adler=0,M(n,31),M(n,139),M(n,8),n.gzhead?(M(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),M(n,n.gzhead.time&255),M(n,n.gzhead.time>>8&255),M(n,n.gzhead.time>>16&255),M(n,n.gzhead.time>>24&255),M(n,n.level===9?2:n.strategy>=cr||n.level<2?4:0),M(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(M(n,n.gzhead.extra.length&255),M(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=ut(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=ys):(M(n,0),M(n,0),M(n,0),M(n,0),M(n,0),M(n,n.level===9?2:n.strategy>=cr||n.level<2?4:0),M(n,Wm),n.status=Ot);else{var s=fr+(n.w_bits-8<<4)<<8,o=-1;n.strategy>=cr||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,s|=o<<6,n.strstart!==0&&(s|=Gm),s+=31-s%31,n.status=Ot,an(n,s),n.strstart!==0&&(an(n,e.adler>>>16),an(n,e.adler&65535)),e.adler=1}if(n.status===ys)if(n.gzhead.extra){for(r=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(e.adler=ut(e.adler,n.pending_buf,n.pending-r,r)),pt(e),r=n.pending,n.pending===n.pending_buf_size));)M(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>r&&(e.adler=ut(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=dr)}else n.status=dr;if(n.status===dr)if(n.gzhead.name){r=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(e.adler=ut(e.adler,n.pending_buf,n.pending-r,r)),pt(e),r=n.pending,n.pending===n.pending_buf_size)){a=1;break}n.gzindex<n.gzhead.name.length?a=n.gzhead.name.charCodeAt(n.gzindex++)&255:a=0,M(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>r&&(e.adler=ut(e.adler,n.pending_buf,n.pending-r,r)),a===0&&(n.gzindex=0,n.status=ur)}else n.status=ur;if(n.status===ur)if(n.gzhead.comment){r=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(e.adler=ut(e.adler,n.pending_buf,n.pending-r,r)),pt(e),r=n.pending,n.pending===n.pending_buf_size)){a=1;break}n.gzindex<n.gzhead.comment.length?a=n.gzhead.comment.charCodeAt(n.gzindex++)&255:a=0,M(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>r&&(e.adler=ut(e.adler,n.pending_buf,n.pending-r,r)),a===0&&(n.status=pr)}else n.status=pr;if(n.status===pr&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&pt(e),n.pending+2<=n.pending_buf_size&&(M(n,e.adler&255),M(n,e.adler>>8&255),e.adler=0,n.status=Ot)):n.status=Ot),n.pending!==0){if(pt(e),e.avail_out===0)return n.last_flush=-1,Me}else if(e.avail_in===0&&Fd(t)<=Fd(i)&&t!==mt)return gt(e,ms);if(n.status===sn&&e.avail_in!==0)return gt(e,ms);if(e.avail_in!==0||n.lookahead!==0||t!==Rt&&n.status!==sn){var d=n.strategy===cr?Xm(n,t):n.strategy===Pm?Km(n,t):ci[n.level].func(n,t);if((d===It||d===di)&&(n.status=sn),d===J||d===It)return e.avail_out===0&&(n.last_flush=-1),Me;if(d===on&&(t===Tm?me._tr_align(n):t!==Bd&&(me._tr_stored_block(n,0,0,!1),t===km&&(ft(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),pt(e),e.avail_out===0))return n.last_flush=-1,Me}return t!==mt?Me:n.wrap<=0?Nd:(n.wrap===2?(M(n,e.adler&255),M(n,e.adler>>8&255),M(n,e.adler>>16&255),M(n,e.adler>>24&255),M(n,e.total_in&255),M(n,e.total_in>>8&255),M(n,e.total_in>>16&255),M(n,e.total_in>>24&255)):(an(n,e.adler>>>16),an(n,e.adler&65535)),pt(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Me:Nd)}function ib(e){var t;return!e||!e.state?be:(t=e.state.status,t!==hr&&t!==ys&&t!==dr&&t!==ur&&t!==pr&&t!==Ot&&t!==sn?gt(e,be):(e.state=null,t===Ot?gt(e,Lm):Me))}function nb(e,t){var i=t.length,n,r,a,s,o,d,l,c;if(!e||!e.state||(n=e.state,s=n.wrap,s===2||s===1&&n.status!==hr||n.lookahead))return be;for(s===1&&(e.adler=$d(e.adler,t,i,0)),n.wrap=0,i>=n.w_size&&(s===0&&(ft(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new oe.Buf8(n.w_size),oe.arraySet(c,t,i-n.w_size,n.w_size,0),t=c,i=n.w_size),o=e.avail_in,d=e.next_in,l=e.input,e.avail_in=i,e.next_in=0,e.input=t,Pt(n);n.lookahead>=R;){r=n.strstart,a=n.lookahead-(R-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+R-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++;while(--a);n.strstart=r,n.lookahead=R-1,Pt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=R-1,n.match_available=0,e.next_in=d,e.input=l,e.avail_in=o,n.wrap=s,Me}je.deflateInit=eb;je.deflateInit2=Gd;je.deflateReset=qd;je.deflateResetKeep=Ud;je.deflateSetHeader=Qm;je.deflate=tb;je.deflateEnd=ib;je.deflateSetDictionary=nb;je.deflateInfo="pako deflate (from Nodeca project)"});var xs=E(ui=>{"use strict";var gr=Ve(),Yd=!0,Vd=!0;try{String.fromCharCode.apply(null,[0])}catch{Yd=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Vd=!1}var ln=new gr.Buf8(256);for(Xe=0;Xe<256;Xe++)ln[Xe]=Xe>=252?6:Xe>=248?5:Xe>=240?4:Xe>=224?3:Xe>=192?2:1;var Xe;ln[254]=ln[254]=1;ui.string2buf=function(e){var t,i,n,r,a,s=e.length,o=0;for(r=0;r<s;r++)i=e.charCodeAt(r),(i&64512)===55296&&r+1<s&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(i=65536+(i-55296<<10)+(n-56320),r++)),o+=i<128?1:i<2048?2:i<65536?3:4;for(t=new gr.Buf8(o),a=0,r=0;a<o;r++)i=e.charCodeAt(r),(i&64512)===55296&&r+1<s&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(i=65536+(i-55296<<10)+(n-56320),r++)),i<128?t[a++]=i:i<2048?(t[a++]=192|i>>>6,t[a++]=128|i&63):i<65536?(t[a++]=224|i>>>12,t[a++]=128|i>>>6&63,t[a++]=128|i&63):(t[a++]=240|i>>>18,t[a++]=128|i>>>12&63,t[a++]=128|i>>>6&63,t[a++]=128|i&63);return t};function Kd(e,t){if(t<65534&&(e.subarray&&Vd||!e.subarray&&Yd))return String.fromCharCode.apply(null,gr.shrinkBuf(e,t));for(var i="",n=0;n<t;n++)i+=String.fromCharCode(e[n]);return i}ui.buf2binstring=function(e){return Kd(e,e.length)};ui.binstring2buf=function(e){for(var t=new gr.Buf8(e.length),i=0,n=t.length;i<n;i++)t[i]=e.charCodeAt(i);return t};ui.buf2string=function(e,t){var i,n,r,a,s=t||e.length,o=new Array(s*2);for(n=0,i=0;i<s;){if(r=e[i++],r<128){o[n++]=r;continue}if(a=ln[r],a>4){o[n++]=65533,i+=a-1;continue}for(r&=a===2?31:a===3?15:7;a>1&&i<s;)r=r<<6|e[i++]&63,a--;if(a>1){o[n++]=65533;continue}r<65536?o[n++]=r:(r-=65536,o[n++]=55296|r>>10&1023,o[n++]=56320|r&1023)}return Kd(o,n)};ui.utf8border=function(e,t){var i;for(t=t||e.length,t>e.length&&(t=e.length),i=t-1;i>=0&&(e[i]&192)===128;)i--;return i<0||i===0?t:i+ln[e[i]]>t?i:t}});var ws=E((Mw,Xd)=>{"use strict";function rb(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}Xd.exports=rb});var eu=E(un=>{"use strict";var cn=Wd(),dn=Ve(),Es=xs(),Ss=lr(),ab=ws(),Qd=Object.prototype.toString,sb=0,_s=4,pi=0,Zd=1,Jd=2,ob=-1,lb=0,cb=8;function Mt(e){if(!(this instanceof Mt))return new Mt(e);this.options=dn.assign({level:ob,method:cb,chunkSize:16384,windowBits:15,memLevel:8,strategy:lb,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ab,this.strm.avail_out=0;var i=cn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==pi)throw new Error(Ss[i]);if(t.header&&cn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=Es.string2buf(t.dictionary):Qd.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,i=cn.deflateSetDictionary(this.strm,n),i!==pi)throw new Error(Ss[i]);this._dict_set=!0}}Mt.prototype.push=function(e,t){var i=this.strm,n=this.options.chunkSize,r,a;if(this.ended)return!1;a=t===~~t?t:t===!0?_s:sb,typeof e=="string"?i.input=Es.string2buf(e):Qd.call(e)==="[object ArrayBuffer]"?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(i.avail_out===0&&(i.output=new dn.Buf8(n),i.next_out=0,i.avail_out=n),r=cn.deflate(i,a),r!==Zd&&r!==pi)return this.onEnd(r),this.ended=!0,!1;(i.avail_out===0||i.avail_in===0&&(a===_s||a===Jd))&&(this.options.to==="string"?this.onData(Es.buf2binstring(dn.shrinkBuf(i.output,i.next_out))):this.onData(dn.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||i.avail_out===0)&&r!==Zd);return a===_s?(r=cn.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===pi):(a===Jd&&(this.onEnd(pi),i.avail_out=0),!0)};Mt.prototype.onData=function(e){this.chunks.push(e)};Mt.prototype.onEnd=function(e){e===pi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=dn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function As(e,t){var i=new Mt(t);if(i.push(e,!0),i.err)throw i.msg||Ss[i.err];return i.result}function db(e,t){return t=t||{},t.raw=!0,As(e,t)}function ub(e,t){return t=t||{},t.gzip=!0,As(e,t)}un.Deflate=Mt;un.deflate=As;un.deflateRaw=db;un.gzip=ub});var iu=E((Dw,tu)=>{"use strict";var mr=30,pb=12;tu.exports=function(t,i){var n,r,a,s,o,d,l,c,f,u,p,v,b,x,g,h,w,y,m,T,A,S,C,P,_;n=t.state,r=t.next_in,P=t.input,a=r+(t.avail_in-5),s=t.next_out,_=t.output,o=s-(i-t.avail_out),d=s+(t.avail_out-257),l=n.dmax,c=n.wsize,f=n.whave,u=n.wnext,p=n.window,v=n.hold,b=n.bits,x=n.lencode,g=n.distcode,h=(1<<n.lenbits)-1,w=(1<<n.distbits)-1;e:do{b<15&&(v+=P[r++]<<b,b+=8,v+=P[r++]<<b,b+=8),y=x[v&h];t:for(;;){if(m=y>>>24,v>>>=m,b-=m,m=y>>>16&255,m===0)_[s++]=y&65535;else if(m&16){T=y&65535,m&=15,m&&(b<m&&(v+=P[r++]<<b,b+=8),T+=v&(1<<m)-1,v>>>=m,b-=m),b<15&&(v+=P[r++]<<b,b+=8,v+=P[r++]<<b,b+=8),y=g[v&w];i:for(;;){if(m=y>>>24,v>>>=m,b-=m,m=y>>>16&255,m&16){if(A=y&65535,m&=15,b<m&&(v+=P[r++]<<b,b+=8,b<m&&(v+=P[r++]<<b,b+=8)),A+=v&(1<<m)-1,A>l){t.msg="invalid distance too far back",n.mode=mr;break e}if(v>>>=m,b-=m,m=s-o,A>m){if(m=A-m,m>f&&n.sane){t.msg="invalid distance too far back",n.mode=mr;break e}if(S=0,C=p,u===0){if(S+=c-m,m<T){T-=m;do _[s++]=p[S++];while(--m);S=s-A,C=_}}else if(u<m){if(S+=c+u-m,m-=u,m<T){T-=m;do _[s++]=p[S++];while(--m);if(S=0,u<T){m=u,T-=m;do _[s++]=p[S++];while(--m);S=s-A,C=_}}}else if(S+=u-m,m<T){T-=m;do _[s++]=p[S++];while(--m);S=s-A,C=_}for(;T>2;)_[s++]=C[S++],_[s++]=C[S++],_[s++]=C[S++],T-=3;T&&(_[s++]=C[S++],T>1&&(_[s++]=C[S++]))}else{S=s-A;do _[s++]=_[S++],_[s++]=_[S++],_[s++]=_[S++],T-=3;while(T>2);T&&(_[s++]=_[S++],T>1&&(_[s++]=_[S++]))}}else if((m&64)===0){y=g[(y&65535)+(v&(1<<m)-1)];continue i}else{t.msg="invalid distance code",n.mode=mr;break e}break}}else if((m&64)===0){y=x[(y&65535)+(v&(1<<m)-1)];continue t}else if(m&32){n.mode=pb;break e}else{t.msg="invalid literal/length code",n.mode=mr;break e}break}}while(r<a&&s<d);T=b>>3,r-=T,b-=T<<3,v&=(1<<b)-1,t.next_in=r,t.next_out=s,t.avail_in=r<a?5+(a-r):5-(r-a),t.avail_out=s<d?257+(d-s):257-(s-d),n.hold=v,n.bits=b}});var cu=E((zw,lu)=>{"use strict";var nu=Ve(),fi=15,ru=852,au=592,su=0,Cs=1,ou=2,fb=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],hb=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],gb=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],mb=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];lu.exports=function(t,i,n,r,a,s,o,d){var l=d.bits,c=0,f=0,u=0,p=0,v=0,b=0,x=0,g=0,h=0,w=0,y,m,T,A,S,C=null,P=0,_,O=new nu.Buf16(fi+1),k=new nu.Buf16(fi+1),I=null,D=0,z,ne,$e;for(c=0;c<=fi;c++)O[c]=0;for(f=0;f<r;f++)O[i[n+f]]++;for(v=l,p=fi;p>=1&&O[p]===0;p--);if(v>p&&(v=p),p===0)return a[s++]=1<<24|64<<16|0,a[s++]=1<<24|64<<16|0,d.bits=1,0;for(u=1;u<p&&O[u]===0;u++);for(v<u&&(v=u),g=1,c=1;c<=fi;c++)if(g<<=1,g-=O[c],g<0)return-1;if(g>0&&(t===su||p!==1))return-1;for(k[1]=0,c=1;c<fi;c++)k[c+1]=k[c]+O[c];for(f=0;f<r;f++)i[n+f]!==0&&(o[k[i[n+f]]++]=f);if(t===su?(C=I=o,_=19):t===Cs?(C=fb,P-=257,I=hb,D-=257,_=256):(C=gb,I=mb,_=-1),w=0,f=0,c=u,S=s,b=v,x=0,T=-1,h=1<<v,A=h-1,t===Cs&&h>ru||t===ou&&h>au)return 1;for(;;){z=c-x,o[f]<_?(ne=0,$e=o[f]):o[f]>_?(ne=I[D+o[f]],$e=C[P+o[f]]):(ne=96,$e=0),y=1<<c-x,m=1<<b,u=m;do m-=y,a[S+(w>>x)+m]=z<<24|ne<<16|$e|0;while(m!==0);for(y=1<<c-1;w&y;)y>>=1;if(y!==0?(w&=y-1,w+=y):w=0,f++,--O[c]===0){if(c===p)break;c=i[n+o[f]]}if(c>v&&(w&A)!==T){for(x===0&&(x=v),S+=u,b=c-x,g=1<<b;b+x<p&&(g-=O[b+x],!(g<=0));)b++,g<<=1;if(h+=1<<b,t===Cs&&h>ru||t===ou&&h>au)return 1;T=w&A,a[T]=v<<24|b<<16|S-s|0}}return w!==0&&(a[S+w]=c-x<<24|64<<16|0),d.bits=v,0}});var qu=E(Ae=>{"use strict";var ue=Ve(),Ps=hs(),De=gs(),bb=iu(),pn=cu(),vb=0,ju=1,Du=2,du=4,yb=5,br=6,jt=0,xb=1,wb=2,ve=-2,zu=-3,Rs=-4,_b=-5,uu=8,Bu=1,pu=2,fu=3,hu=4,gu=5,mu=6,bu=7,vu=8,yu=9,xu=10,xr=11,Ze=12,Ts=13,wu=14,ks=15,_u=16,Eu=17,Su=18,Au=19,vr=20,yr=21,Cu=22,Tu=23,ku=24,Lu=25,Ou=26,Ls=27,Iu=28,Pu=29,$=30,Ms=31,Eb=32,Sb=852,Ab=592,Cb=15,Tb=Cb;function Ru(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function kb(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new ue.Buf16(320),this.work=new ue.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Nu(e){var t;return!e||!e.state?ve:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Bu,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new ue.Buf32(Sb),t.distcode=t.distdyn=new ue.Buf32(Ab),t.sane=1,t.back=-1,jt)}function Fu(e){var t;return!e||!e.state?ve:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,Nu(e))}function $u(e,t){var i,n;return!e||!e.state||(n=e.state,t<0?(i=0,t=-t):(i=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?ve:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,Fu(e))}function Hu(e,t){var i,n;return e?(n=new kb,e.state=n,n.window=null,i=$u(e,t),i!==jt&&(e.state=null),i):ve}function Lb(e){return Hu(e,Tb)}var Mu=!0,Os,Is;function Ob(e){if(Mu){var t;for(Os=new ue.Buf32(512),Is=new ue.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(pn(ju,e.lens,0,288,Os,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;pn(Du,e.lens,0,32,Is,0,e.work,{bits:5}),Mu=!1}e.lencode=Os,e.lenbits=9,e.distcode=Is,e.distbits=5}function Uu(e,t,i,n){var r,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new ue.Buf8(a.wsize)),n>=a.wsize?(ue.arraySet(a.window,t,i-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>n&&(r=n),ue.arraySet(a.window,t,i-n,r,a.wnext),n-=r,n?(ue.arraySet(a.window,t,i-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0}function Ib(e,t){var i,n,r,a,s,o,d,l,c,f,u,p,v,b,x=0,g,h,w,y,m,T,A,S,C=new ue.Buf8(4),P,_,O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return ve;i=e.state,i.mode===Ze&&(i.mode=Ts),s=e.next_out,r=e.output,d=e.avail_out,a=e.next_in,n=e.input,o=e.avail_in,l=i.hold,c=i.bits,f=o,u=d,S=jt;e:for(;;)switch(i.mode){case Bu:if(i.wrap===0){i.mode=Ts;break}for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(i.wrap&2&&l===35615){i.check=0,C[0]=l&255,C[1]=l>>>8&255,i.check=De(i.check,C,2,0),l=0,c=0,i.mode=pu;break}if(i.flags=0,i.head&&(i.head.done=!1),!(i.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",i.mode=$;break}if((l&15)!==uu){e.msg="unknown compression method",i.mode=$;break}if(l>>>=4,c-=4,A=(l&15)+8,i.wbits===0)i.wbits=A;else if(A>i.wbits){e.msg="invalid window size",i.mode=$;break}i.dmax=1<<A,e.adler=i.check=1,i.mode=l&512?xu:Ze,l=0,c=0;break;case pu:for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(i.flags=l,(i.flags&255)!==uu){e.msg="unknown compression method",i.mode=$;break}if(i.flags&57344){e.msg="unknown header flags set",i.mode=$;break}i.head&&(i.head.text=l>>8&1),i.flags&512&&(C[0]=l&255,C[1]=l>>>8&255,i.check=De(i.check,C,2,0)),l=0,c=0,i.mode=fu;case fu:for(;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.head&&(i.head.time=l),i.flags&512&&(C[0]=l&255,C[1]=l>>>8&255,C[2]=l>>>16&255,C[3]=l>>>24&255,i.check=De(i.check,C,4,0)),l=0,c=0,i.mode=hu;case hu:for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.head&&(i.head.xflags=l&255,i.head.os=l>>8),i.flags&512&&(C[0]=l&255,C[1]=l>>>8&255,i.check=De(i.check,C,2,0)),l=0,c=0,i.mode=gu;case gu:if(i.flags&1024){for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.length=l,i.head&&(i.head.extra_len=l),i.flags&512&&(C[0]=l&255,C[1]=l>>>8&255,i.check=De(i.check,C,2,0)),l=0,c=0}else i.head&&(i.head.extra=null);i.mode=mu;case mu:if(i.flags&1024&&(p=i.length,p>o&&(p=o),p&&(i.head&&(A=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),ue.arraySet(i.head.extra,n,a,p,A)),i.flags&512&&(i.check=De(i.check,n,p,a)),o-=p,a+=p,i.length-=p),i.length))break e;i.length=0,i.mode=bu;case bu:if(i.flags&2048){if(o===0)break e;p=0;do A=n[a+p++],i.head&&A&&i.length<65536&&(i.head.name+=String.fromCharCode(A));while(A&&p<o);if(i.flags&512&&(i.check=De(i.check,n,p,a)),o-=p,a+=p,A)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=vu;case vu:if(i.flags&4096){if(o===0)break e;p=0;do A=n[a+p++],i.head&&A&&i.length<65536&&(i.head.comment+=String.fromCharCode(A));while(A&&p<o);if(i.flags&512&&(i.check=De(i.check,n,p,a)),o-=p,a+=p,A)break e}else i.head&&(i.head.comment=null);i.mode=yu;case yu:if(i.flags&512){for(;c<16;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l!==(i.check&65535)){e.msg="header crc mismatch",i.mode=$;break}l=0,c=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=Ze;break;case xu:for(;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}e.adler=i.check=Ru(l),l=0,c=0,i.mode=xr;case xr:if(i.havedict===0)return e.next_out=s,e.avail_out=d,e.next_in=a,e.avail_in=o,i.hold=l,i.bits=c,wb;e.adler=i.check=1,i.mode=Ze;case Ze:if(t===yb||t===br)break e;case Ts:if(i.last){l>>>=c&7,c-=c&7,i.mode=Ls;break}for(;c<3;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}switch(i.last=l&1,l>>>=1,c-=1,l&3){case 0:i.mode=wu;break;case 1:if(Ob(i),i.mode=vr,t===br){l>>>=2,c-=2;break e}break;case 2:i.mode=Eu;break;case 3:e.msg="invalid block type",i.mode=$}l>>>=2,c-=2;break;case wu:for(l>>>=c&7,c-=c&7;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if((l&65535)!==(l>>>16^65535)){e.msg="invalid stored block lengths",i.mode=$;break}if(i.length=l&65535,l=0,c=0,i.mode=ks,t===br)break e;case ks:i.mode=_u;case _u:if(p=i.length,p){if(p>o&&(p=o),p>d&&(p=d),p===0)break e;ue.arraySet(r,n,a,p,s),o-=p,a+=p,d-=p,s+=p,i.length-=p;break}i.mode=Ze;break;case Eu:for(;c<14;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(i.nlen=(l&31)+257,l>>>=5,c-=5,i.ndist=(l&31)+1,l>>>=5,c-=5,i.ncode=(l&15)+4,l>>>=4,c-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=$;break}i.have=0,i.mode=Su;case Su:for(;i.have<i.ncode;){for(;c<3;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.lens[O[i.have++]]=l&7,l>>>=3,c-=3}for(;i.have<19;)i.lens[O[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,P={bits:i.lenbits},S=pn(vb,i.lens,0,19,i.lencode,0,i.work,P),i.lenbits=P.bits,S){e.msg="invalid code lengths set",i.mode=$;break}i.have=0,i.mode=Au;case Au:for(;i.have<i.nlen+i.ndist;){for(;x=i.lencode[l&(1<<i.lenbits)-1],g=x>>>24,h=x>>>16&255,w=x&65535,!(g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(w<16)l>>>=g,c-=g,i.lens[i.have++]=w;else{if(w===16){for(_=g+2;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l>>>=g,c-=g,i.have===0){e.msg="invalid bit length repeat",i.mode=$;break}A=i.lens[i.have-1],p=3+(l&3),l>>>=2,c-=2}else if(w===17){for(_=g+3;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=g,c-=g,A=0,p=3+(l&7),l>>>=3,c-=3}else{for(_=g+7;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=g,c-=g,A=0,p=11+(l&127),l>>>=7,c-=7}if(i.have+p>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=$;break}for(;p--;)i.lens[i.have++]=A}}if(i.mode===$)break;if(i.lens[256]===0){e.msg="invalid code -- missing end-of-block",i.mode=$;break}if(i.lenbits=9,P={bits:i.lenbits},S=pn(ju,i.lens,0,i.nlen,i.lencode,0,i.work,P),i.lenbits=P.bits,S){e.msg="invalid literal/lengths set",i.mode=$;break}if(i.distbits=6,i.distcode=i.distdyn,P={bits:i.distbits},S=pn(Du,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,P),i.distbits=P.bits,S){e.msg="invalid distances set",i.mode=$;break}if(i.mode=vr,t===br)break e;case vr:i.mode=yr;case yr:if(o>=6&&d>=258){e.next_out=s,e.avail_out=d,e.next_in=a,e.avail_in=o,i.hold=l,i.bits=c,bb(e,u),s=e.next_out,r=e.output,d=e.avail_out,a=e.next_in,n=e.input,o=e.avail_in,l=i.hold,c=i.bits,i.mode===Ze&&(i.back=-1);break}for(i.back=0;x=i.lencode[l&(1<<i.lenbits)-1],g=x>>>24,h=x>>>16&255,w=x&65535,!(g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(h&&(h&240)===0){for(y=g,m=h,T=w;x=i.lencode[T+((l&(1<<y+m)-1)>>y)],g=x>>>24,h=x>>>16&255,w=x&65535,!(y+g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=y,c-=y,i.back+=y}if(l>>>=g,c-=g,i.back+=g,i.length=w,h===0){i.mode=Ou;break}if(h&32){i.back=-1,i.mode=Ze;break}if(h&64){e.msg="invalid literal/length code",i.mode=$;break}i.extra=h&15,i.mode=Cu;case Cu:if(i.extra){for(_=i.extra;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.length+=l&(1<<i.extra)-1,l>>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=Tu;case Tu:for(;x=i.distcode[l&(1<<i.distbits)-1],g=x>>>24,h=x>>>16&255,w=x&65535,!(g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if((h&240)===0){for(y=g,m=h,T=w;x=i.distcode[T+((l&(1<<y+m)-1)>>y)],g=x>>>24,h=x>>>16&255,w=x&65535,!(y+g<=c);){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=y,c-=y,i.back+=y}if(l>>>=g,c-=g,i.back+=g,h&64){e.msg="invalid distance code",i.mode=$;break}i.offset=w,i.extra=h&15,i.mode=ku;case ku:if(i.extra){for(_=i.extra;c<_;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}i.offset+=l&(1<<i.extra)-1,l>>>=i.extra,c-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=$;break}i.mode=Lu;case Lu:if(d===0)break e;if(p=u-d,i.offset>p){if(p=i.offset-p,p>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=$;break}p>i.wnext?(p-=i.wnext,v=i.wsize-p):v=i.wnext-p,p>i.length&&(p=i.length),b=i.window}else b=r,v=s-i.offset,p=i.length;p>d&&(p=d),d-=p,i.length-=p;do r[s++]=b[v++];while(--p);i.length===0&&(i.mode=yr);break;case Ou:if(d===0)break e;r[s++]=i.length,d--,i.mode=yr;break;case Ls:if(i.wrap){for(;c<32;){if(o===0)break e;o--,l|=n[a++]<<c,c+=8}if(u-=d,e.total_out+=u,i.total+=u,u&&(e.adler=i.check=i.flags?De(i.check,r,u,s-u):Ps(i.check,r,u,s-u)),u=d,(i.flags?l:Ru(l))!==i.check){e.msg="incorrect data check",i.mode=$;break}l=0,c=0}i.mode=Iu;case Iu:if(i.wrap&&i.flags){for(;c<32;){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l!==(i.total&4294967295)){e.msg="incorrect length check",i.mode=$;break}l=0,c=0}i.mode=Pu;case Pu:S=xb;break e;case $:S=zu;break e;case Ms:return Rs;case Eb:default:return ve}return e.next_out=s,e.avail_out=d,e.next_in=a,e.avail_in=o,i.hold=l,i.bits=c,(i.wsize||u!==e.avail_out&&i.mode<$&&(i.mode<Ls||t!==du))&&Uu(e,e.output,e.next_out,u-e.avail_out)?(i.mode=Ms,Rs):(f-=e.avail_in,u-=e.avail_out,e.total_in+=f,e.total_out+=u,i.total+=u,i.wrap&&u&&(e.adler=i.check=i.flags?De(i.check,r,u,e.next_out-u):Ps(i.check,r,u,e.next_out-u)),e.data_type=i.bits+(i.last?64:0)+(i.mode===Ze?128:0)+(i.mode===vr||i.mode===ks?256:0),(f===0&&u===0||t===du)&&S===jt&&(S=_b),S)}function Pb(e){if(!e||!e.state)return ve;var t=e.state;return t.window&&(t.window=null),e.state=null,jt}function Rb(e,t){var i;return!e||!e.state||(i=e.state,(i.wrap&2)===0)?ve:(i.head=t,t.done=!1,jt)}function Mb(e,t){var i=t.length,n,r,a;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==xr)?ve:n.mode===xr&&(r=1,r=Ps(r,t,i,0),r!==n.check)?zu:(a=Uu(e,t,i,i),a?(n.mode=Ms,Rs):(n.havedict=1,jt))}Ae.inflateReset=Fu;Ae.inflateReset2=$u;Ae.inflateResetKeep=Nu;Ae.inflateInit=Lb;Ae.inflateInit2=Hu;Ae.inflate=Ib;Ae.inflateEnd=Pb;Ae.inflateGetHeader=Rb;Ae.inflateSetDictionary=Mb;Ae.inflateInfo="pako inflate (from Nodeca project)"});var js=E((Nw,Gu)=>{"use strict";Gu.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var Yu=E((Fw,Wu)=>{"use strict";function jb(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Wu.exports=jb});var Ku=E(hn=>{"use strict";var hi=qu(),fn=Ve(),wr=xs(),Y=js(),Ds=lr(),Db=ws(),zb=Yu(),Vu=Object.prototype.toString;function Dt(e){if(!(this instanceof Dt))return new Dt(e);this.options=fn.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Db,this.strm.avail_out=0;var i=hi.inflateInit2(this.strm,t.windowBits);if(i!==Y.Z_OK)throw new Error(Ds[i]);if(this.header=new zb,hi.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=wr.string2buf(t.dictionary):Vu.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=hi.inflateSetDictionary(this.strm,t.dictionary),i!==Y.Z_OK)))throw new Error(Ds[i])}Dt.prototype.push=function(e,t){var i=this.strm,n=this.options.chunkSize,r=this.options.dictionary,a,s,o,d,l,c=!1;if(this.ended)return!1;s=t===~~t?t:t===!0?Y.Z_FINISH:Y.Z_NO_FLUSH,typeof e=="string"?i.input=wr.binstring2buf(e):Vu.call(e)==="[object ArrayBuffer]"?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(i.avail_out===0&&(i.output=new fn.Buf8(n),i.next_out=0,i.avail_out=n),a=hi.inflate(i,Y.Z_NO_FLUSH),a===Y.Z_NEED_DICT&&r&&(a=hi.inflateSetDictionary(this.strm,r)),a===Y.Z_BUF_ERROR&&c===!0&&(a=Y.Z_OK,c=!1),a!==Y.Z_STREAM_END&&a!==Y.Z_OK)return this.onEnd(a),this.ended=!0,!1;i.next_out&&(i.avail_out===0||a===Y.Z_STREAM_END||i.avail_in===0&&(s===Y.Z_FINISH||s===Y.Z_SYNC_FLUSH))&&(this.options.to==="string"?(o=wr.utf8border(i.output,i.next_out),d=i.next_out-o,l=wr.buf2string(i.output,o),i.next_out=d,i.avail_out=n-d,d&&fn.arraySet(i.output,i.output,o,d,0),this.onData(l)):this.onData(fn.shrinkBuf(i.output,i.next_out))),i.avail_in===0&&i.avail_out===0&&(c=!0)}while((i.avail_in>0||i.avail_out===0)&&a!==Y.Z_STREAM_END);return a===Y.Z_STREAM_END&&(s=Y.Z_FINISH),s===Y.Z_FINISH?(a=hi.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Y.Z_OK):(s===Y.Z_SYNC_FLUSH&&(this.onEnd(Y.Z_OK),i.avail_out=0),!0)};Dt.prototype.onData=function(e){this.chunks.push(e)};Dt.prototype.onEnd=function(e){e===Y.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=fn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function zs(e,t){var i=new Dt(t);if(i.push(e,!0),i.err)throw i.msg||Ds[i.err];return i.result}function Bb(e,t){return t=t||{},t.raw=!0,zs(e,t)}hn.Inflate=Dt;hn.inflate=zs;hn.inflateRaw=Bb;hn.ungzip=zs});var Ju=E((Hw,Zu)=>{"use strict";var Nb=Ve().assign,Fb=eu(),$b=Ku(),Hb=js(),Xu={};Nb(Xu,Fb,$b,Hb);Zu.exports=Xu});var ep=E(Er=>{"use strict";var Ub=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Uint32Array!="undefined",qb=Ju(),Qu=H(),_r=de(),Gb=Ub?"uint8array":"array";Er.magic="\b\0";function zt(e,t){_r.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}Qu.inherits(zt,_r);zt.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(Qu.transformTo(Gb,e.data),!1)};zt.prototype.flush=function(){_r.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)};zt.prototype.cleanUp=function(){_r.prototype.cleanUp.call(this),this._pako=null};zt.prototype._createPako=function(){this._pako=new qb[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};Er.compressWorker=function(e){return new zt("Deflate",e)};Er.uncompressWorker=function(){return new zt("Inflate",{})}});var Ns=E(Bs=>{"use strict";var tp=de();Bs.STORE={magic:"\0\0",compressWorker:function(){return new tp("STORE compression")},uncompressWorker:function(){return new tp("STORE decompression")}};Bs.DEFLATE=ep()});var Fs=E(Bt=>{"use strict";Bt.LOCAL_FILE_HEADER="PK";Bt.CENTRAL_FILE_HEADER="PK";Bt.CENTRAL_DIRECTORY_END="PK";Bt.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07";Bt.ZIP64_CENTRAL_DIRECTORY_END="PK";Bt.DATA_DESCRIPTOR="PK\x07\b"});var ap=E((Ww,rp)=>{"use strict";var gi=H(),mi=de(),$s=ni(),ip=nr(),Sr=Fs(),B=function(e,t){var i="",n;for(n=0;n<t;n++)i+=String.fromCharCode(e&255),e=e>>>8;return i},Wb=function(e,t){var i=e;return e||(i=t?16893:33204),(i&65535)<<16},Yb=function(e){return(e||0)&63},np=function(e,t,i,n,r,a){var s=e.file,o=e.compression,d=a!==$s.utf8encode,l=gi.transformTo("string",a(s.name)),c=gi.transformTo("string",$s.utf8encode(s.name)),f=s.comment,u=gi.transformTo("string",a(f)),p=gi.transformTo("string",$s.utf8encode(f)),v=c.length!==s.name.length,b=p.length!==f.length,x,g,h="",w="",y="",m=s.dir,T=s.date,A={crc32:0,compressedSize:0,uncompressedSize:0};(!t||i)&&(A.crc32=e.crc32,A.compressedSize=e.compressedSize,A.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),!d&&(v||b)&&(S|=2048);var C=0,P=0;m&&(C|=16),r==="UNIX"?(P=798,C|=Wb(s.unixPermissions,m)):(P=20,C|=Yb(s.dosPermissions,m)),x=T.getUTCHours(),x=x<<6,x=x|T.getUTCMinutes(),x=x<<5,x=x|T.getUTCSeconds()/2,g=T.getUTCFullYear()-1980,g=g<<4,g=g|T.getUTCMonth()+1,g=g<<5,g=g|T.getUTCDate(),v&&(w=B(1,1)+B(ip(l),4)+c,h+="up"+B(w.length,2)+w),b&&(y=B(1,1)+B(ip(u),4)+p,h+="uc"+B(y.length,2)+y);var _="";_+=`
2
+ \0`,_+=B(S,2),_+=o.magic,_+=B(x,2),_+=B(g,2),_+=B(A.crc32,4),_+=B(A.compressedSize,4),_+=B(A.uncompressedSize,4),_+=B(l.length,2),_+=B(h.length,2);var O=Sr.LOCAL_FILE_HEADER+_+l+h,k=Sr.CENTRAL_FILE_HEADER+B(P,2)+_+B(u.length,2)+"\0\0\0\0"+B(C,4)+B(n,4)+l+h+u;return{fileRecord:O,dirRecord:k}},Vb=function(e,t,i,n,r){var a="",s=gi.transformTo("string",r(n));return a=Sr.CENTRAL_DIRECTORY_END+"\0\0\0\0"+B(e,2)+B(e,2)+B(t,4)+B(i,4)+B(s.length,2)+s,a},Kb=function(e){var t="";return t=Sr.DATA_DESCRIPTOR+B(e.crc32,4)+B(e.compressedSize,4)+B(e.uncompressedSize,4),t};function Ce(e,t,i,n){mi.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=i,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}gi.inherits(Ce,mi);Ce.prototype.push=function(e){var t=e.meta.percent||0,i=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,mi.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:i?(t+100*(i-n-1))/i:100}}))};Ce.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var i=np(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0};Ce.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,i=np(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),t)this.push({data:Kb(e),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null};Ce.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var i=this.bytesWritten-e,n=Vb(this.dirRecords.length,i,e,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})};Ce.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()};Ce.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(i){t.processChunk(i)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(i){t.error(i)}),this};Ce.prototype.resume=function(){if(!mi.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};Ce.prototype.error=function(e){var t=this._sources;if(!mi.prototype.error.call(this,e))return!1;for(var i=0;i<t.length;i++)try{t[i].error(e)}catch{}return!0};Ce.prototype.lock=function(){mi.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()};rp.exports=Ce});var op=E(sp=>{"use strict";var Xb=Ns(),Zb=ap(),Jb=function(e,t){var i=e||t,n=Xb[i];if(!n)throw new Error(i+" is not a valid compression method !");return n};sp.generateWorker=function(e,t,i){var n=new Zb(t.streamFiles,i,t.platform,t.encodeFileName),r=0;try{e.forEach(function(a,s){r++;var o=Jb(s.options.compression,t.compression),d=s.options.compressionOptions||t.compressionOptions||{},l=s.dir,c=s.date;s._compressWorker(o,d).withStreamInfo("file",{name:a,dir:l,date:c,comment:s.comment||"",unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions}).pipe(n)}),n.entriesCount=r}catch(a){n.error(a)}return n}});var cp=E((Vw,lp)=>{"use strict";var Qb=H(),Ar=de();function gn(e,t){Ar.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}Qb.inherits(gn,Ar);gn.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",function(i){t.push({data:i,meta:{percent:0}})}).on("error",function(i){t.isPaused?this.generatedError=i:t.error(i)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})};gn.prototype.pause=function(){return Ar.prototype.pause.call(this)?(this._stream.pause(),!0):!1};gn.prototype.resume=function(){return Ar.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1};lp.exports=gn});var yp=E((Kw,vp)=>{"use strict";var ev=ni(),mn=H(),fp=de(),tv=Wa(),hp=Ya(),dp=rr(),iv=ud(),nv=op(),up=qi(),rv=cp(),gp=function(e,t,i){var n=mn.getTypeOf(t),r,a=mn.extend(i||{},hp);a.date=a.date||new Date,a.compression!==null&&(a.compression=a.compression.toUpperCase()),typeof a.unixPermissions=="string"&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&a.unixPermissions&16384&&(a.dir=!0),a.dosPermissions&&a.dosPermissions&16&&(a.dir=!0),a.dir&&(e=mp(e)),a.createFolders&&(r=av(e))&&bp.call(this,r,!0);var s=n==="string"&&a.binary===!1&&a.base64===!1;(!i||typeof i.binary=="undefined")&&(a.binary=!s);var o=t instanceof dp&&t.uncompressedSize===0;(o||a.dir||!t||t.length===0)&&(a.base64=!1,a.binary=!0,t="",a.compression="STORE",n="string");var d=null;t instanceof dp||t instanceof fp?d=t:up.isNode&&up.isStream(t)?d=new rv(e,t):d=mn.prepareContent(e,t,a.binary,a.optimizedBinaryString,a.base64);var l=new iv(e,d,a);this.files[e]=l},av=function(e){e.slice(-1)==="/"&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},mp=function(e){return e.slice(-1)!=="/"&&(e+="/"),e},bp=function(e,t){return t=typeof t!="undefined"?t:hp.createFolders,e=mp(e),this.files[e]||gp.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function pp(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var sv={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,i,n;for(t in this.files)n=this.files[t],i=t.slice(this.root.length,t.length),i&&t.slice(0,this.root.length)===this.root&&e(i,n)},filter:function(e){var t=[];return this.forEach(function(i,n){e(i,n)&&t.push(n)}),t},file:function(e,t,i){if(arguments.length===1)if(pp(e)){var n=e;return this.filter(function(a,s){return!s.dir&&n.test(a)})}else{var r=this.files[this.root+e];return r&&!r.dir?r:null}else e=this.root+e,gp.call(this,e,t,i);return this},folder:function(e){if(!e)return this;if(pp(e))return this.filter(function(r,a){return a.dir&&e.test(r)});var t=this.root+e,i=bp.call(this,t),n=this.clone();return n.root=i.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||(e.slice(-1)!=="/"&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var i=this.filter(function(r,a){return a.name.slice(0,e.length)===e}),n=0;n<i.length;n++)delete this.files[i[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,i={};try{if(i=mn.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:ev.utf8encode}),i.type=i.type.toLowerCase(),i.compression=i.compression.toUpperCase(),i.type==="binarystring"&&(i.type="string"),!i.type)throw new Error("No output type specified.");mn.checkSupport(i.type),(i.platform==="darwin"||i.platform==="freebsd"||i.platform==="linux"||i.platform==="sunos")&&(i.platform="UNIX"),i.platform==="win32"&&(i.platform="DOS");var n=i.comment||this.comment||"";t=nv.generateWorker(this,i,n)}catch(r){t=new fp("error"),t.error(r)}return new tv(t,i.type||"string",i.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return e=e||{},e.type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};vp.exports=sv});var Hs=E((Xw,wp)=>{"use strict";var ov=H();function xp(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}xp.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t=0,i;for(this.checkOffset(e),i=this.index+e-1;i>=this.index;i--)t=(t<<8)+this.byteAt(i);return this.index+=e,t},readString:function(e){return ov.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1))}};wp.exports=xp});var Us=E((Zw,Ep)=>{"use strict";var _p=Hs(),lv=H();function bi(e){_p.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=e[t]&255}lv.inherits(bi,_p);bi.prototype.byteAt=function(e){return this.data[this.zero+e]};bi.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),i=e.charCodeAt(1),n=e.charCodeAt(2),r=e.charCodeAt(3),a=this.length-4;a>=0;--a)if(this.data[a]===t&&this.data[a+1]===i&&this.data[a+2]===n&&this.data[a+3]===r)return a-this.zero;return-1};bi.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),i=e.charCodeAt(1),n=e.charCodeAt(2),r=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&i===a[1]&&n===a[2]&&r===a[3]};bi.prototype.readData=function(e){if(this.checkOffset(e),e===0)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Ep.exports=bi});var Cp=E((Jw,Ap)=>{"use strict";var Sp=Hs(),cv=H();function vi(e){Sp.call(this,e)}cv.inherits(vi,Sp);vi.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)};vi.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero};vi.prototype.readAndCheckSignature=function(e){var t=this.readData(4);return e===t};vi.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Ap.exports=vi});var Gs=E((Qw,kp)=>{"use strict";var Tp=Us(),dv=H();function qs(e){Tp.call(this,e)}dv.inherits(qs,Tp);qs.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};kp.exports=qs});var Ip=E((e0,Op)=>{"use strict";var Lp=Gs(),uv=H();function Ws(e){Lp.call(this,e)}uv.inherits(Ws,Lp);Ws.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Op.exports=Ws});var Ys=E((t0,Rp)=>{"use strict";var Cr=H(),Pp=We(),pv=Us(),fv=Cp(),hv=Ip(),gv=Gs();Rp.exports=function(e){var t=Cr.getTypeOf(e);return Cr.checkSupport(t),t==="string"&&!Pp.uint8array?new fv(e):t==="nodebuffer"?new hv(e):Pp.uint8array?new gv(Cr.transformTo("uint8array",e)):new pv(Cr.transformTo("array",e))}});var zp=E((i0,Dp)=>{"use strict";var Vs=Ys(),bt=H(),mv=rr(),Mp=nr(),Tr=ni(),kr=Ns(),bv=We(),vv=0,yv=3,xv=function(e){for(var t in kr)if(Object.prototype.hasOwnProperty.call(kr,t)&&kr[t].magic===e)return kr[t];return null};function jp(e,t){this.options=e,this.loadOptions=t}jp.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function(e){var t,i;if(e.skip(22),this.fileNameLength=e.readInt(2),i=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(i),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(t=xv(this.compressionMethod),t===null)throw new Error("Corrupted zip : compression "+bt.pretty(this.compressionMethod)+" unknown (inner file : "+bt.transformTo("string",this.fileName)+")");this.decompressed=new mv(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),e===vv&&(this.dosPermissions=this.externalFileAttributes&63),e===yv&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=Vs(this.extraFields[1].value);this.uncompressedSize===bt.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===bt.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===bt.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===bt.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t=e.index+this.extraFieldsLength,i,n,r;for(this.extraFields||(this.extraFields={});e.index+4<t;)i=e.readInt(2),n=e.readInt(2),r=e.readData(n),this.extraFields[i]={id:i,length:n,value:r};e.setIndex(t)},handleUTF8:function(){var e=bv.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=Tr.utf8decode(this.fileName),this.fileCommentStr=Tr.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else{var i=bt.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var n=this.findExtraFieldUnicodeComment();if(n!==null)this.fileCommentStr=n;else{var r=bt.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(r)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=Vs(e.value);return t.readInt(1)!==1||Mp(this.fileName)!==t.readInt(4)?null:Tr.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=Vs(e.value);return t.readInt(1)!==1||Mp(this.fileComment)!==t.readInt(4)?null:Tr.utf8decode(t.readData(e.length-5))}return null}};Dp.exports=jp});var Fp=E((n0,Np)=>{"use strict";var wv=Ys(),Je=H(),Te=Fs(),_v=zp(),Ev=We();function Bp(e){this.files=[],this.loadOptions=e}Bp.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+Je.pretty(t)+", expected "+Je.pretty(e)+")")}},isSignature:function(e,t){var i=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4),r=n===t;return this.reader.setIndex(i),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=Ev.uint8array?"uint8array":"array",i=Je.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e=this.zip64EndOfCentralSize-44,t=0,i,n,r;t<e;)i=this.reader.readInt(2),n=this.reader.readInt(4),r=this.reader.readData(n),this.zip64ExtensibleData[i]={id:i,length:n,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(Te.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(Te.CENTRAL_FILE_HEADER);)e=new _v({zip64:this.zip64},this.loadOptions),e.readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(Te.CENTRAL_DIRECTORY_END);if(e<0){var t=!this.isSignature(0,Te.LOCAL_FILE_HEADER);throw t?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(e);var i=e;if(this.checkSignature(Te.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===Je.MAX_VALUE_16BITS||this.diskWithCentralDirStart===Je.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===Je.MAX_VALUE_16BITS||this.centralDirRecords===Je.MAX_VALUE_16BITS||this.centralDirSize===Je.MAX_VALUE_32BITS||this.centralDirOffset===Je.MAX_VALUE_32BITS){if(this.zip64=!0,e=this.reader.lastIndexOfSignature(Te.ZIP64_CENTRAL_DIRECTORY_LOCATOR),e<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(Te.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,Te.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(Te.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(Te.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=i-n;if(r>0)this.isSignature(i,Te.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=wv(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};Np.exports=Bp});var Up=E((r0,Hp)=>{"use strict";var Ks=H(),Lr=ei(),Sv=ni(),Av=Fp(),Cv=Xa(),$p=qi();function Tv(e){return new Lr.Promise(function(t,i){var n=e.decompressed.getContentWorker().pipe(new Cv);n.on("error",function(r){i(r)}).on("end",function(){n.streamInfo.crc32!==e.decompressed.crc32?i(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}Hp.exports=function(e,t){var i=this;return t=Ks.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:Sv.utf8decode}),$p.isNode&&$p.isStream(e)?Lr.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):Ks.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(n){var r=new Av(t);return r.load(n),r}).then(function(r){var a=[Lr.Promise.resolve(r)],s=r.files;if(t.checkCRC32)for(var o=0;o<s.length;o++)a.push(Tv(s[o]));return Lr.Promise.all(a)}).then(function(r){for(var a=r.shift(),s=a.files,o=0;o<s.length;o++){var d=s[o],l=d.fileNameStr,c=Ks.resolve(d.fileNameStr);i.file(c,d.decompressed,{binary:!0,optimizedBinaryString:!0,date:d.date,dir:d.dir,comment:d.fileCommentStr.length?d.fileCommentStr:null,unixPermissions:d.unixPermissions,dosPermissions:d.dosPermissions,createFolders:t.createFolders}),d.dir||(i.file(c).unsafeOriginalName=l)}return a.zipComment.length&&(i.comment=a.zipComment),i})}});var Gp=E((a0,qp)=>{"use strict";function ye(){if(!(this instanceof ye))return new ye;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new ye;for(var t in this)typeof this[t]!="function"&&(e[t]=this[t]);return e}}ye.prototype=yp();ye.prototype.loadAsync=Up();ye.support=We();ye.defaults=Ya();ye.version="3.10.1";ye.loadAsync=function(e,t){return new ye().loadAsync(e,t)};ye.external=ei();qp.exports=ye});var ze,Js=He(()=>{"use strict";ze=class{static get(t){var i;return(i=this.store.get(t))==null?void 0:i.data}static set(t,i){this.store.set(t,{data:i})}static has(t){return this.store.has(t)}static clear(){this.store.clear()}};ze.store=new Map});function Pv(){var e,t;try{let i=typeof window!="undefined"&&(document.querySelector('script[src*="inline-assets.js"]')||((t=(e=document.querySelector("script"))==null?void 0:e.textContent)==null?void 0:t.includes("inline-assets.js"))||window.INLINE_ASSETS),n=typeof window!="undefined"&&document.querySelector('link[href*="assets/"], script[src*="assets/"]');return!!(i&&!n)}catch{return!1}}async function Rv(){try{if(typeof window!="undefined"){let e=await fetch("./build-settings.json");if(e.ok){let t=await e.json();return console.log("[AssetLoader] Loaded build settings:",t),t}}}catch{}return null}function Mv(){try{if(typeof window!="undefined"){let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let t=JSON.parse(e.responseText);return console.log("[AssetLoader] Loaded build settings (sync):",t),t}}}catch{}return null}async function jv(){if(console.log(`[AssetLoader] getInlineAssets() called - Effective mode: ${U}`),Object.keys(Qe).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(Qe)),Qe;if(typeof window!="undefined"&&window.INLINE_ASSETS)return console.log("[AssetLoader] Using pre-loaded INLINE_ASSETS from window:",Object.keys(window.INLINE_ASSETS)),Qe={...window.INLINE_ASSETS},Qe;if(!(U==="publish"&&Be!==!1))return console.log("[AssetLoader] Inline assets disabled for this build mode."),Qe;if(!Qs){let t=typeof window!="undefined"?new URL("inline-assets.js",window.location.href).href:"./inline-assets.js";console.log("[AssetLoader] Loading inline assets from:",t),Qs=(async()=>{try{try{let a=await fetch(t+"?t="+Date.now());if(a.ok){let o=(await a.text()).match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(o){let d=new Function("return "+o[1])();return console.log("[AssetLoader] Loaded INLINE_ASSETS via fetch:",Object.keys(d)),d}}}catch(a){console.warn("[AssetLoader] Fetch loading failed, trying text parse:",a)}let i=await fetch(t);if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);let n=await i.text();console.log("[AssetLoader] Received JS code, length:",n.length);let r=n.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(r)try{let a=r[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let s=new Function("return "+a)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(s)),s}catch(a){return console.warn("[AssetLoader] Failed to parse inline assets:",a),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",n.substring(0,500)),{}}catch(i){return console.warn("[AssetLoader] Failed to load inline assets:",i),{}}})()}return Qe=await Qs,console.log("[AssetLoader] Final inline assets cache:",Object.keys(Qe)),Qe}function eo(e){return e===null||typeof e!="object"||(Object.freeze(e),Object.values(e).forEach(t=>eo(t))),e}function Dv(e=64,t=64,i=16711680){let n=document.createElement("canvas");n.width=e,n.height=t;let r=n.getContext("2d");return r.fillStyle=`#${i.toString(16).padStart(6,"0")}`,r.fillRect(0,0,e,t),r.strokeStyle="#000",r.strokeRect(0,0,e,t),r.fillStyle="#fff",r.font="10px sans-serif",r.textAlign="center",r.fillText("MISSING",e/2,t/2),et.Texture.from(n)}function Pr(e,t){Zp.set(e,t)}var et,Kp,Xp,Nt,U,Be,vt,Qe,Qs,Zp,yt,Rr=He(()=>{"use strict";et=require("pixi.js");Js();Kp=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Xp=Pv(),Nt=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,U=Xp?"publish":Kp,Be=Nt==null?void 0:Nt.assetsInlined;Nt!=null&&Nt.buildMode&&(U=Nt.buildMode,console.log(`[AssetLoader] Build mode overridden by inline settings: ${U}`));vt=Mv();vt!=null&&vt.buildMode&&(U=vt.buildMode,console.log(`[AssetLoader] Build mode overridden by sync settings: ${U}`));(vt==null?void 0:vt.assetsInlined)!==void 0&&(Be=vt.assetsInlined);Rv().then(e=>{e!=null&&e.buildMode&&e.buildMode!==U&&(U=e.buildMode,console.log(`[AssetLoader] Build mode overridden by settings: ${U}`)),(e==null?void 0:e.assetsInlined)!==void 0&&(Be=e.assetsInlined)}).catch(()=>{});console.log(`[AssetLoader] MODULE LOADED - Compile: ${Kp}, Runtime: ${Xp?"publish":"dev"}, Effective: ${U}`);Qe={},Qs=null;Zp=new Map;yt=class{static async load(t,i,n,r){let a=`${t}:${i.path}`,s=ze.get(a);if(s!==void 0)return s;console.log(`[AssetLoader] Loading asset: ${t}, type: ${i.type}, Effective mode: ${U}`),console.log(`[AssetLoader] Window defined: ${typeof window!="undefined"}, INLINE_ASSETS exists: ${!!(typeof window!="undefined"&&window.INLINE_ASSETS)}, keys: ${typeof window!="undefined"&&window.INLINE_ASSETS?Object.keys(window.INLINE_ASSETS).length:"N/A"}`);let o=await jv(),d=o[t];if(!d&&r&&(d=o[r],d&&console.log(`[AssetLoader] Found inline data for ${t} using configId: ${r}`)),!d&&i.path){let f=i.path.split("/");if(f.length>=2){let u=f[f.length-1].split(".")[0];o[u]&&(d=o[u],console.log(`[AssetLoader] Found inline data for ${t} using assetName: ${u}`))}}if(console.log("[AssetLoader] Inline data for",t,":",d?"FOUND":"NOT FOUND"),U==="publish"&&Be!==!1&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!d))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${t}, path: ${i.path}`);let c=Zp.get(i.type);if(c)try{let f=await c(i.path,d,t,n);return ze.set(a,f),f}catch(f){return this.handleFailure(t,i.type,f)}try{let f;switch(i.type){case"image":f=await this.loadImage(i.path,d);break;case"json":f=await this.loadJSON(i.path,d),f=eo(f);break;default:throw new Error(`Unknown asset type: ${i.type}`)}return ze.set(a,f),f}catch(f){return this.handleFailure(t,i.type,f)}}static async loadImage(t,i){let n=U==="publish",r=n&&Be!==!1;if(console.log(`[AssetLoader] loadImage - Effective mode: ${U}, isPublishMode: ${n}, inlineData: ${i?"EXISTS":"MISSING"}`),r){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!i)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for object. Path: ${t}`);if(typeof i!="string"||!i.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof i}`);try{return await et.Assets.load(i)}catch(a){throw console.error("[AssetLoader] Failed to load texture from data URI:",a),a}}if(i&&typeof i=="string"&&i.startsWith("data:"))try{return await et.Assets.load(i)}catch(a){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",a),await et.Assets.load(t)}return await et.Assets.load(t)}static async loadJSON(t,i){let n=U==="publish",r=n&&Be!==!1;if(console.log(`[AssetLoader] loadJSON - Effective mode: ${U}, isPublishMode: ${n}, inlineData: ${i?"EXISTS":"MISSING"}`),r){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!i)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);if(typeof i=="object"&&i!==null)return i;if(typeof i=="string"&&i.startsWith("data:")){let s=atob(i.split(",")[1]);return JSON.parse(s)}return JSON.parse(i)}if(i){if(typeof i=="object"&&i!==null)return i;if(typeof i=="string"&&i.startsWith("data:")){let s=atob(i.split(",")[1]);return JSON.parse(s)}return JSON.parse(i)}let a=await fetch(t);if(!a.ok)throw new Error(`JSON fetch failed: ${t}`);return a.json()}static handleFailure(t,i,n){if(U==="dev"){let a=i==="image"?Dv():eo({__placeholder:!0,type:i});return ze.set(t+":"+((n==null?void 0:n.path)||"missing"),a),a}throw n}};Pr("image",async(e,t)=>{let i=U==="publish",n=i&&Be!==!1,r=U==="brand",a=i&&Be===!1;if(console.log(`[AssetLoader] registerType('image') - Effective mode: ${U}, isPublishMode: ${i}, isBrandMode: ${r}, inlineData: ${t?"EXISTS":"MISSING"}`),n){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!t)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);if(typeof t!="string"||!t.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof t}`);return et.Assets.load(t)}let s=e;return(r||a)&&e&&!e.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(s=e,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${e}" as-is`)):(s=`assets/${e}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${e}" -> "${s}"`))),et.Assets.load(t||s)});Pr("json",async(e,t)=>{let i=U==="publish",n=i&&Be!==!1,r=U==="brand",a=i&&Be===!1;if(console.log(`[AssetLoader] registerType('json') - Effective mode: ${U}, isPublishMode: ${i}, isBrandMode: ${r}, inlineData: ${t?"EXISTS":"MISSING"}`),n){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!t)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);return typeof t=="object"&&t!==null?t:typeof t=="string"&&t.startsWith("data:")?JSON.parse(atob(t.split(",")[1])):JSON.parse(t)}let s=e;if((r||a)&&e&&!e.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(s=e,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${e}" as-is`)):(s=`assets/${e}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${e}" -> "${s}"`))),t)return typeof t=="object"&&t!==null?t:typeof t=="string"&&t.startsWith("data:")?JSON.parse(atob(t.split(",")[1])):JSON.parse(t);let o=await fetch(s);if(!o.ok)throw new Error(`JSON fetch failed: ${e}`);return o.json()})});function Mr(e,t){Jp.init(e,t),typeof window!="undefined"&&(window.__AssetTextures=xt)}var to,Jp,xt,bn=He(()=>{"use strict";Rr();to=class{constructor(){this.textures=new Map;this.readyPromise=null;this.config=null;this.app=null}init(t,i){this.textures.clear(),this.readyPromise=null,this.config=t,this.app=i,console.log("[AssetTextures] Initialized with config, cleared previous textures")}async ready(){if(this.readyPromise){await this.readyPromise;return}if(!this.config)throw new Error("[AssetTextures] Must call init() before ready() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before ready() - app is null");let t=this.config,i=this.app;return this.readyPromise=(async()=>{var r;console.log("[AssetTextures] Loading all assets...");let n=[];for(let[a,s]of t.objects.entries()){let o=(r=s.render)==null?void 0:r.asset;if(!o)continue;let d=(async()=>{var l;try{let c=(l=s.identity)==null?void 0:l.id;console.log(`[AssetTextures] Loading ${o.type}: ${a} (${c})`);let f=await yt.load(a,o,i,c);this.textures.set(a,f),console.log(`[AssetTextures] \u2713 Loaded: ${a}`)}catch(c){console.error(`[AssetTextures] \u2717 Failed to load: ${a}`,c)}})();n.push(d)}await Promise.all(n),console.log("[AssetTextures] All textures loaded:",Array.from(this.textures.keys()))})(),this.readyPromise}get(t){return this.textures.get(t)}set(t,i){this.textures.set(t,i),console.log(`[AssetTextures] Updated texture: ${t}`)}clear(){this.textures.clear(),this.readyPromise=null,console.log("[AssetTextures] Cleared all textures")}getAllIds(){return Array.from(this.textures.keys())}},Jp=new to,xt=new Proxy(Jp,{get(e,t){return t in e&&typeof e[t]=="function"?e[t].bind(e):e.get(t)},set(e,t,i){return e.set(t,i),!0}})});var tf={};nl(tf,{AssetEditorModal:()=>so});var so,oo=He(()=>{"use strict";so=class{constructor(){this.modal=null;this.currentObjectId=null;this.currentPath=null;this.currentAsset="";this.onApplyCallback=null}show(t,i,n,r){this.currentObjectId=t,this.currentPath=i,this.currentAsset=n,this.onApplyCallback=r,this.createModal(t,n),document.body.appendChild(this.modal),this.attachModalListeners()}createModal(t,i){let n=document.createElement("div");n.className="asset-editor-modal",n.innerHTML=`
3
+ <div class="asset-editor-card">
4
+ <div class="asset-editor-header">
5
+ <div>
6
+ <div class="asset-editor-title">Edit Asset: ${t}</div>
7
+ <div class="asset-editor-subtitle">Current: ${i||"None"}</div>
8
+ </div>
9
+ <button class="asset-editor-close" data-modal-close>\xD7</button>
10
+ </div>
11
+
12
+ <div class="asset-editor-tabs">
13
+ <button class="asset-editor-tab active" data-tab="library">\u{1F4DA} Library</button>
14
+ <button class="asset-editor-tab" data-tab="ai">\u2728 AI Edit</button>
15
+ <button class="asset-editor-tab" data-tab="upload">\u{1F4E4} Upload</button>
16
+ </div>
17
+
18
+ <div class="asset-editor-body">
19
+ <div class="asset-editor-tab-panel active" data-tab-panel="library">
20
+ <p class="asset-editor-hint">Library tab - Select from existing assets</p>
21
+ <p class="asset-editor-hint">TODO: Integrate with LibraryPanel</p>
22
+ </div>
23
+
24
+ <div class="asset-editor-tab-panel" data-tab-panel="ai">
25
+ <div class="asset-editor-ai-controls">
26
+ <button class="debug-btn primary" data-ai-generate>
27
+ \u2728 Generate New Image
28
+ </button>
29
+ <button class="debug-btn" data-ai-edit>
30
+ \u{1F3A8} Edit Current Image
31
+ </button>
32
+ </div>
33
+ </div>
34
+
35
+ <div class="asset-editor-tab-panel" data-tab-panel="upload">
36
+ <p class="asset-editor-hint">Upload tab - Upload new file</p>
37
+ <input type="file" accept="image/*" data-file-upload />
38
+ <p class="asset-editor-hint">TODO: Implement file upload</p>
39
+ </div>
40
+ </div>
41
+
42
+ <div class="asset-editor-actions">
43
+ <button class="debug-btn" data-modal-close>Cancel</button>
44
+ <button class="debug-btn primary" data-modal-apply>Apply</button>
45
+ </div>
46
+ </div>
47
+ `,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let r=this.modal.querySelector("[data-ai-edit]");r==null||r.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(t){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab")===t)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab-panel")===t)})}openAiEditor(t){let i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";t==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:r=>{this.onApplyCallback&&this.onApplyCallback(r),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Ay={};nl(Ay,{AssetCache:()=>ze,AssetLoader:()=>yt,AssetSystem:()=>qr,AssetTextures:()=>xt,Assets:()=>Tf,BaseSystem:()=>Li,GameEngine:()=>Ur,GameObject:()=>kn,GameObjectManager:()=>Ti,ObjectFactory:()=>wt,Renderer:()=>Tn,RuntimeObjectRegistry:()=>Oi,Transform:()=>Cn,applyScreenAnchor:()=>Yr,basePixi:()=>Ef,clearResponsiveElements:()=>Lf,createPixiBase:()=>$r,getRegisteredFontIds:()=>xf,globalResponsiveMultipliers:()=>On,initAssetTextures:()=>Mr,initAssets:()=>kf,layout:()=>If,playLottieOverlay:()=>wf,registerFont:()=>yf,registerType:()=>Pr,resolveAnchorVec2:()=>In,resolveFont:()=>bf,resolveFontWeight:()=>vf,resolveScreenAnchorPoint:()=>Ii,resolveScreenRatioPoint:()=>Pi,runInitSequence:()=>Pf,setLottieInstance:()=>jr,spawnSceneFromConfig:()=>Af,updateScreenState:()=>Wr});module.exports=Bf(Ay);var mf=require("pixi.js");var at={};function Dn(e,t,i=!1){at[e]||(at[e]=[]),at[e].push({fn:t,once:i})}function ea(e,t){if(at[e]){if(!t){delete at[e];return}at[e]=at[e].filter(i=>i.fn!==t)}}function zn(e,...t){let i=at[e];if(i)for(let n of[...i])n.fn(...t),n.once&&ea(e,n.fn)}function he(e,t){Dn(e,t,!0)}var X=null,_e=[],Ut=null;function ol(e){X=e,_e=[],Ut!==null&&(clearTimeout(Ut),Ut=null)}function ll(){var e,t,i;return{endpoint:(X==null?void 0:X.endpoint)||"",transport:(X==null?void 0:X.transport)||"beacon",batchSize:(e=X==null?void 0:X.batchSize)!=null?e:10,flushIntervalMs:(t=X==null?void 0:X.flushIntervalMs)!=null?t:300,maxQueue:(i=X==null?void 0:X.maxQueue)!=null?i:200,debug:!!(X!=null&&X.debug)}}async function al(e,t,i,n){let r=JSON.stringify(t);if(i==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(e,new Blob([r],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",a,t);return}catch(a){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:r,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",t)}catch(a){n&&console.warn("[handler.telemetry] fetch failed",a)}}function ta(e,t){let i=ll();if(t&&i.endpoint){if(_e.push(e),_e.length>i.maxQueue&&(_e=_e.slice(_e.length-i.maxQueue)),_e.length>=i.batchSize){sl();return}Ut===null&&(Ut=window.setTimeout(()=>{Ut=null,sl()},i.flushIntervalMs))}}async function sl(){let e=ll();if(!e.endpoint||_e.length===0)return;let t=_e.splice(0,e.batchSize);await al(e.endpoint,{events:t},e.transport,e.debug),_e.length>0&&await al(e.endpoint,{events:_e.splice(0,e.batchSize)},e.transport,e.debug)}var ge=0,Nf=ge++,cl=ge++,dl=ge++,ul=ge++,pl=ge++,fl=ge++,hl=ge++,gl=ge++,ml=ge++,bl=ge++,vl=ge++,yl=ge++,q=Nf;function xl(){return q===cl}function wl(){return q===dl}function _l(){return q===ul}function El(){return q===pl}function qt(){return q===fl}function Gt(){return q===hl}function Sl(){return q===gl}function Al(){return q===ml}function Cl(){return q===bl}function ia(){return q===vl}function na(){return q===yl}function Tl(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),q=cl;return}catch{}else if(e==="dapi")try{dapi.isReady(),q=dl;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(q=ul)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(q=pl)}catch{}else if(t==="mintegral")window.gameReady&&(q=fl);else if(t==="tapjoy")window.TJ_API&&(q=hl);else if(t==="tiktok")window.openAppStore&&(q=gl);else if(t==="smadex")try{window.smxTracking&&(q=ml)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(q=bl)}catch{}else t==="vungle"?q=vl:(e==="nucleo"||t==="nucleo")&&(q=yl)}var Bn=jn(require("lottie-web"),1),kl=Bn.default;typeof window!="undefined"&&(window.lottie=Bn.default,window.__baseLottie=Bn.default);sa();function Z(e,t){let i=(r,a)=>a===0?r:i(a,r%a),n=i(e,t);return`${e/n}:${t/n}`}var ex=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:Z(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:Z(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:Z(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:Z(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:Z(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:Z(360,780)}],tx=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:Z(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:Z(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:Z(412,915)}],ix=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:Z(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:Z(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:Z(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:Z(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:Z(800,1280)}],Pl=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:Z(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:Z(768,1024),mraidScale:.7}];var nx=[...Pl];var Yf=Pl[0];st();var Iv=jn(Gp(),1);function kv(e){return new Promise((t,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>t(String(n.result||"")),n.readAsDataURL(e)})}function Lv(e){var r;let[t,i]=e.split(","),n=t==null?void 0:t.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(r=n==null?void 0:n[1])!=null?r:"image/png"}}async function Ov(e){return await new Promise(t=>{let i=new Image;i.onload=()=>t({width:i.naturalWidth||i.width,height:i.naturalHeight||i.height}),i.onerror=()=>t(null),i.src=e})}async function Xs(e){var t,i;try{console.log("[ImageUtils] Fetching image data from URL:",e);let n=await fetch(e);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,e),null;let r=await n.blob();console.log("[ImageUtils] Blob received, size:",r.size,"type:",r.type);let a=await kv(r),s=await Ov(a),o=Lv(a);return console.log("[ImageUtils] Success resolution:",s==null?void 0:s.width,"x",s==null?void 0:s.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:a,width:(t=s==null?void 0:s.width)!=null?t:0,height:(i=s==null?void 0:s.height)!=null?i:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function Or(e,t=30){try{console.log("[ImageUtils] Removing background color...");let i=await new Promise((f,u)=>{let p=new Image;p.onload=()=>f(p),p.onerror=()=>u(new Error("Failed to load image")),p.src=e}),n=document.createElement("canvas");n.width=i.width,n.height=i.height;let r=n.getContext("2d");if(!r)return console.error("[ImageUtils] Failed to get canvas context"),e;r.drawImage(i,0,0);let a=r.getImageData(0,0,n.width,n.height),s=a.data,d=[{name:"top-left",offset:0},{name:"top-right",offset:(n.width-1)*4},{name:"bottom-left",offset:(n.height-1)*n.width*4},{name:"bottom-right",offset:((n.height-1)*n.width+(n.width-1))*4}].map(f=>({r:s[f.offset],g:s[f.offset+1],b:s[f.offset+2]})),l=0;for(let f=0;f<s.length;f+=4){let u=s[f],p=s[f+1],v=s[f+2],b=!1;for(let x of d)if(Math.sqrt(Math.pow(u-x.r,2)+Math.pow(p-x.g,2)+Math.pow(v-x.b,2))<t){b=!0;break}b&&(s[f+3]=0,l++)}return console.log(`[ImageUtils] Removed background from ${l} pixels (4-corner sampling, tolerance: ${t})`),r.putImageData(a,0,0),n.toDataURL("image/png")}catch(i){return console.error("[ImageUtils] Error removing background:",i),e}}var Wp=require("@google/genai");async function Zs(e,t,i=[],n={}){var r,a,s,o,d,l,c;try{if(!(e!=null&&e.trim()))throw new Error("Gemini API key is required");if(!(t!=null&&t.trim()))throw new Error("Prompt is required");for(let g=0;g<i.length;g++){let h=i[g];if(!h.base64||!h.mimeType)throw new Error(`Image ${g+1} is missing required data`);if(h.base64.length<1e3&&console.warn(`Image ${g+1} data appears very small, may be corrupted`),!h.mimeType.startsWith("image/"))throw new Error(`Image ${g+1} has invalid MIME type: ${h.mimeType}`)}let f=new Wp.GoogleGenAI({apiKey:e}),u="gemini-2.5-flash",p=[t];i.length>0&&i.forEach((g,h)=>{p.push({inlineData:{data:g.base64,mimeType:g.mimeType}}),console.log(`[Gemini] Added image ${h+1}: ${g.mimeType}, size: ${Math.round(g.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${i.length} images and prompt length: ${t.length}`);let v=await f.models.generateContent({model:u,contents:p}),b="",x=(s=(a=(r=v.candidates)==null?void 0:r[0])==null?void 0:a.content)==null?void 0:s.parts;if(x)for(let g of x)g.text&&(b+=g.text);if(!b.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${b.length}`),b}catch(f){throw console.error("[Gemini] API error:",f),(o=f.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(d=f.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(l=f.message)!=null&&l.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(c=f.message)!=null&&c.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):f}}var Yp=require("@google/genai");async function Ir(e,t,i=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let r=new Yp.GoogleGenAI({apiKey:e}),a=[{text:t}];i.length>0&&i.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),a.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let s=await r.models.generateContent({model:"gemini-2.5-flash-image",contents:a});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!s.candidates||!s.candidates[0]||!s.candidates[0].content||!s.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of s.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let d=o.inlineData.data,l=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${l};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(r){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(r,Object.getOwnPropertyNames(r),2)),r}}var zv=require("pixi.js");bn();st();var Qp=require("pixi.js");var Bv=require("pixi.js");st();function Gv(e){return new Promise((t,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>t(String(n.result||"")),n.readAsDataURL(e)})}function Wv(e){var r;let[t,i]=e.split(","),n=t==null?void 0:t.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(r=n==null?void 0:n[1])!=null?r:"image/png"}}function Yv(e){return`
48
+ Analyze these screenshots of a brand or game and extract its "Brand DNA".
49
+
50
+ Provide a concise summary (2-3 sentences) covering:
51
+ 1. Primary and secondary brand colors.
52
+ 2. The overall aesthetic "vibe" (e.g., minimalist, neon, glossy, retro, corporate).
53
+ 3. Common UI patterns (e.g., rounded buttons, flat icons).
54
+
55
+ Then, list the exact hex color codes (#RRGGBB) found in the screenshots.
56
+
57
+ FORMAT:
58
+ Summary: [Your summary here]
59
+ Palette: [#RRGGBB, #RRGGBB, ...]
60
+
61
+ ${e?`
62
+ ADDITIONAL RULES/NOTES:
63
+ ${e}`:""}
64
+ `.trim()}function ef(){let e=[],t="",i=null;return{async addSources(n){let r=[];for(let a of n){let s=await Gv(a),o=Wv(s),d={id:`${Date.now()}-${Math.random().toString(16).slice(2)}`,name:a.name,base64:o.base64,mimeType:o.mimeType,dataUrl:s};e.push(d),r.push(d)}return r},getSources(){return e.slice()},async analyze(n,r,a){if(e.length===0)throw new Error("No screenshots to analyze.");let s=Yv(r),o=e.map(u=>({base64:u.base64,mimeType:u.mimeType})),d=await Zs(n,s,o,{model:a}),l=t,c=[],f=d.split(`
65
+ `);for(let u of f)if(u.toLowerCase().startsWith("summary:"))l=u.slice(8).trim();else if(u.toLowerCase().includes("palette:")){let p=u.match(/#[0-9A-Fa-f]{6}/g);p&&p.forEach(v=>{c.includes(v.toUpperCase())||c.push(v.toUpperCase())})}return(!l||l===t)&&(l=d.split(`
66
+ Palette:`)[0].replace(/^Summary:\s*/i,"").trim()),i={summary:l,palette:c.slice(0,10)},i},setSummary(n){t=n,i&&(i={...i,summary:n})},getResult(){return i}}}var Ft="handler_api_key_";var yi=class{static setKey(t,i,n){try{let r={key:this.encryptKey(i),created:Date.now(),lastUsed:Date.now(),label:n||t},a=`${Ft}${t}`;localStorage.setItem(a,JSON.stringify(r))}catch(r){console.error("[ApiKeyStorage] Failed to store API key:",r)}}static getKey(t){try{let i=`${Ft}${t}`,n=localStorage.getItem(i);if(!n)return null;let r=JSON.parse(n);return r.lastUsed=Date.now(),localStorage.setItem(i,JSON.stringify(r)),this.decryptKey(r.key)}catch(i){return console.error("[ApiKeyStorage] Failed to retrieve API key:",i),null}}static hasKey(t){let i=`${Ft}${t}`;return localStorage.getItem(i)!==null}static removeKey(t){try{let i=`${Ft}${t}`;localStorage.removeItem(i)}catch(i){console.error("[ApiKeyStorage] Failed to remove API key:",i)}}static getStoredServices(){let t=[];try{for(let i=0;i<localStorage.length;i++){let n=localStorage.key(i);if(n&&n.startsWith(Ft)){let r=n.substring(Ft.length),a=localStorage.getItem(n);if(a){let s=JSON.parse(a);t.push({service:r,label:s.label,created:s.created,lastUsed:s.lastUsed})}}}}catch(i){console.error("[ApiKeyStorage] Failed to get stored services:",i)}return t.sort((i,n)=>n.lastUsed-i.lastUsed)}static clearAll(){try{let t=[];for(let i=0;i<localStorage.length;i++){let n=localStorage.key(i);n&&n.startsWith(Ft)&&t.push(n)}t.forEach(i=>localStorage.removeItem(i))}catch(t){console.error("[ApiKeyStorage] Failed to clear API keys:",t)}}static encryptKey(t){try{let n="handler_preview_salt_2024"+t;return btoa(n)}catch(i){return console.warn("[ApiKeyStorage] Encryption failed, storing as-is:",i),t}}static decryptKey(t){try{let i=atob(t),n="handler_preview_salt_2024";return i.startsWith(n)?i.substring(n.length):i}catch(i){return console.warn("[ApiKeyStorage] Decryption failed, returning as-is:",i),t}}},io=()=>yi.getKey("gemini"),no=(e,t)=>yi.setKey("gemini",e,t),Vv=()=>yi.hasKey("gemini");window.ApiKeyStorage=yi;window.getGeminiApiKey=io;window.setGeminiApiKey=no;window.hasGeminiApiKey=Vv;var ao=class{constructor(){this.modal=null;this.options=null;this.analyzer=ef();this.currentPrompt="";this.isGenerating=!1;this.generatedImages=[];this.selectedImageIndex=-1;this.promptInput=null;this.generateBtn=null;this.loadingEl=null;this.galleryEl=null;this.previewEl=null}open(t){this.options=t,this.currentPrompt=t.initialPrompt||"",this.generatedImages=[],this.selectedImageIndex=-1,this.isGenerating=!1,this.createModal(),document.body.appendChild(this.modal),setTimeout(()=>{var i,n;(i=this.promptInput)==null||i.focus(),(n=this.promptInput)==null||n.select()},100)}createModal(){var i;let t=document.createElement("div");t.className="ai-modal",t.innerHTML=`
67
+ <div class="ai-modal-card">
68
+ <div class="ai-modal-header">
69
+ <div class="ai-modal-actions">
70
+ <button class="ai-modal-gallery" type="button" data-action="gallery">
71
+ \u{1F5BC}\uFE0F Gallery
72
+ </button>
73
+ </div>
74
+ <div>
75
+ <div class="ai-modal-title">AI Image Editor</div>
76
+ <div class="ai-modal-subtitle">${((i=this.options)==null?void 0:i.objectId)||"Unknown Object"}</div>
77
+ </div>
78
+ <button class="ai-modal-close" type="button" data-action="close">\xD7</button>
79
+ </div>
80
+
81
+ <div class="ai-modal-body">
82
+ <!-- PROMPT INPUT -->
83
+ <div class="ai-section">
84
+ <label class="ai-label">Prompt</label>
85
+ <textarea
86
+ class="ai-textarea"
87
+ placeholder="Describe the image you want to generate..."
88
+ rows="3"
89
+ >${this.currentPrompt}</textarea>
90
+ </div>
91
+
92
+ <!-- STRENGTH CONTROLS -->
93
+ <div class="ai-section">
94
+ <div class="ai-row ai-strength">
95
+ <label class="ai-label">Creativity</label>
96
+ <input
97
+ type="range"
98
+ class="ai-input"
99
+ min="0.1"
100
+ max="1.0"
101
+ step="0.1"
102
+ value="0.8"
103
+ data-strength="creativity"
104
+ />
105
+ <span class="ai-strength-value">0.8</span>
106
+ </div>
107
+ </div>
108
+
109
+ <!-- BRAND DNA -->
110
+ <div class="ai-section">
111
+ <div class="ai-row">
112
+ <input type="checkbox" id="ai-use-dna" checked />
113
+ <label for="ai-use-dna" class="ai-label">Apply Brand DNA</label>
114
+ </div>
115
+ </div>
116
+
117
+ <!-- PREVIEW AREA -->
118
+ <div class="ai-section">
119
+ <div class="ai-preview" data-preview>
120
+ <div class="ai-preview-placeholder">
121
+ Generated images will appear here
122
+ </div>
123
+ </div>
124
+ </div>
125
+
126
+ <!-- LOADING INDICATOR -->
127
+ <div class="ai-loading hidden" data-loading>
128
+ <div class="ai-loading-ring"></div>
129
+ <div class="ai-loading-text">Generating image...</div>
130
+ </div>
131
+
132
+ <!-- GALLERY (hidden by default) -->
133
+ <div class="ai-gallery hidden" data-gallery>
134
+ <div class="ai-gallery-grid" data-gallery-grid></div>
135
+ </div>
136
+ </div>
137
+
138
+ <!-- ACTION BUTTONS -->
139
+ <div class="ai-modal-actions">
140
+ <button class="ai-btn" data-action="cancel">Cancel</button>
141
+ <button class="ai-btn" data-action="generate" disabled>Generate</button>
142
+ <button class="ai-btn primary" data-action="apply" disabled>Apply</button>
143
+ </div>
144
+ </div>
145
+ `,this.modal=t,this.attachEventListeners(),this.updatePromptFromDna()}attachEventListeners(){var n;if(!this.modal)return;this.promptInput=this.modal.querySelector(".ai-textarea"),this.generateBtn=this.modal.querySelector('[data-action="generate"]'),this.loadingEl=this.modal.querySelector("[data-loading]"),this.galleryEl=this.modal.querySelector("[data-gallery]"),this.previewEl=this.modal.querySelector("[data-preview]"),(n=this.promptInput)==null||n.addEventListener("input",()=>{var r;this.currentPrompt=((r=this.promptInput)==null?void 0:r.value)||"",this.updateGenerateButton()});let t=this.modal.querySelector('[data-strength="creativity"]'),i=this.modal.querySelector(".ai-strength-value");t==null||t.addEventListener("input",()=>{i.textContent=t.value}),this.modal.addEventListener("click",r=>{var o;let a=r.target;switch(a.dataset.action||((o=a.closest("[data-action]"))==null?void 0:o.getAttribute("data-action"))){case"generate":this.generateImage();break;case"apply":this.applySelectedImage();break;case"gallery":this.toggleGallery();break;case"close":case"cancel":this.close();break}}),this.modal.addEventListener("click",r=>{let a=r.target;if(a.classList.contains("ai-gallery-item")||a.closest(".ai-gallery-item")){let s=a.closest(".ai-gallery-item"),o=parseInt(s.dataset.index||"-1");o>=0&&this.selectImage(o)}}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()}),this.updateGenerateButton()}updateGenerateButton(){if(!this.generateBtn)return;let t=this.currentPrompt.trim().length>0;this.generateBtn.disabled=!t||this.isGenerating}async updatePromptFromDna(){var i;let t=(i=this.modal)==null?void 0:i.querySelector("#ai-use-dna");if(t!=null&&t.checked)try{let n=this.analyzer.getResult();if(n!=null&&n.summary&&this.promptInput){let r=`${this.currentPrompt}
146
+
147
+ Style guidelines: ${n.summary}`;this.promptInput.value=r,this.currentPrompt=r}}catch(n){console.warn("[AiEditorModal] Failed to apply brand DNA:",n)}}async generateImage(){var t,i,n,r;if(!(!this.options||this.isGenerating)){this.isGenerating=!0,this.updateGenerateButton(),(t=this.loadingEl)==null||t.classList.remove("hidden"),(i=this.previewEl)==null||i.classList.add("hidden");try{let a=this.getApiKey();if(!a){alert("Please set your Gemini API key first. You can do this in the AI Creative Suite panel.");return}let s=[];if(this.options.currentValue&&this.options.currentValue.startsWith("data:"))try{let l=await Xs(this.options.currentValue);l&&(s=[{base64:l.base64,mimeType:l.mimeType}])}catch(l){console.warn("[AiEditorModal] Failed to load current image:",l)}let o=await Ir(a,this.currentPrompt,s,{aspectRatio:"1:1"}),d=await Or(o);this.generatedImages.push(d||o),this.selectedImageIndex=this.generatedImages.length-1,this.updateGallery(),this.updatePreview(),this.updateApplyButton()}catch(a){console.error("[AiEditorModal] Generation failed:",a),alert(`Generation failed: ${a instanceof Error?a.message:"Unknown error"}`)}finally{this.isGenerating=!1,(n=this.loadingEl)==null||n.classList.add("hidden"),(r=this.previewEl)==null||r.classList.remove("hidden"),this.updateGenerateButton()}}}updateGallery(){if(!this.galleryEl)return;let t=this.galleryEl.querySelector("[data-gallery-grid]");t&&(t.innerHTML=this.generatedImages.map((i,n)=>`
148
+ <div class="ai-gallery-item ${n===this.selectedImageIndex?"active":""}" data-index="${n}">
149
+ <img class="ai-gallery-thumb" src="${i}" alt="Generated ${n+1}" />
150
+ <div class="ai-gallery-label">#${n+1}</div>
151
+ </div>
152
+ `).join(""))}updatePreview(){if(!this.previewEl||this.selectedImageIndex<0)return;let t=this.generatedImages[this.selectedImageIndex];this.previewEl.innerHTML=`<img src="${t}" alt="Selected image" />`}selectImage(t){t<0||t>=this.generatedImages.length||(this.selectedImageIndex=t,this.updateGallery(),this.updatePreview(),this.updateApplyButton())}toggleGallery(){this.galleryEl&&this.galleryEl.classList.toggle("hidden")}updateApplyButton(){var i;let t=(i=this.modal)==null?void 0:i.querySelector('[data-action="apply"]');t&&(t.disabled=this.selectedImageIndex<0)}applySelectedImage(){var i;if(this.selectedImageIndex<0||!((i=this.options)!=null&&i.onApply))return;let t=this.generatedImages[this.selectedImageIndex];this.options.onApply(t),this.close()}getApiKey(){let t=io();if(t)return t;try{let i=this.analyzer.getResult();if(i&&i.apiKey)return no(i.apiKey,"From Brand DNA"),i.apiKey}catch(i){console.warn("[AiEditorModal] Failed to get API key from brand DNA:",i)}return null}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.options=null}},ro=null;window.__openAiEditor=function(e,t,i,n){ro||(ro=new ao),ro.open({objectId:e,initialPrompt:t,currentValue:i,path:n==null?void 0:n.path,onApply:r=>{if(n!=null&&n.path){let a=window.updateManager;if(a)a.updateProperty(e,n.path,r);else{let s=window.getEditableObjectConfig,o=s==null?void 0:s(e);if(o){let d=n.path.split("."),l=o;for(let c=0;c<d.length-1;c++)l[d[c]]||(l[d[c]]={}),l=l[d[c]];l[d[d.length-1]]=r}}}window.dispatchEvent(new CustomEvent("inspector:refresh"))}})};oo();var lo=class{constructor(){this.modal=null;this.options=null}open(t){this.options=t,this.createModal(),document.body.appendChild(this.modal)}createModal(){if(!this.options)return;let{assetPath:t,assetType:i,objectId:n}=this.options,r=n||"Asset Preview",a=document.createElement("div");a.className="asset-preview-modal",a.innerHTML=`
153
+ <div class="asset-preview-card">
154
+ <div class="asset-preview-header">
155
+ <div class="asset-preview-title">${r}</div>
156
+ <button class="asset-preview-close" data-action="close">\xD7</button>
157
+ </div>
158
+
159
+ <div class="asset-preview-meta">
160
+ <div>Type: ${i.toUpperCase()}</div>
161
+ <div>Path: ${t||"None"}</div>
162
+ </div>
163
+
164
+ <div class="asset-preview-body">
165
+ ${this.renderAssetContent(t,i)}
166
+ </div>
167
+
168
+ <div class="asset-preview-actions">
169
+ <button class="asset-preview-change" data-action="change">Change Asset</button>
170
+ ${i==="image"?'<button class="asset-preview-ai" data-action="edit">\u2728 AI Edit</button>':""}
171
+ </div>
172
+ </div>
173
+ `,this.modal=a,this.attachEventListeners()}renderAssetContent(t,i){if(!t)return'<div class="asset-preview-placeholder">No asset selected</div>';switch(i){case"image":return`<img src="${this.resolveAssetUrl(t)}" alt="Asset preview" style="max-width: 100%; max-height: 400px; object-fit: contain;" />`;case"audio":let r=this.resolveAssetUrl(t);return`
174
+ <audio controls style="width: 100%;">
175
+ <source src="${r}" type="audio/mpeg">
176
+ <source src="${r}" type="audio/wav">
177
+ Your browser does not support the audio element.
178
+ </audio>
179
+ `;case"text":return`<pre style="background: rgba(0,0,0,0.2); padding: 16px; border-radius: 8px; max-height: 300px; overflow-y: auto; white-space: pre-wrap;">${t}</pre>`;default:return`<div class="asset-preview-placeholder">Cannot preview ${i} assets</div>`}}resolveAssetUrl(t){return t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("/")?t:`/raw/${t}`}attachEventListeners(){if(!this.modal)return;this.modal.addEventListener("click",n=>{let r=n.target;(r.dataset.action==="close"||r===this.modal)&&this.close()});let t=this.modal.querySelector('[data-action="change"]');t&&t.addEventListener("click",()=>{this.openAssetEditor()});let i=this.modal.querySelector('[data-action="edit"]');i&&i.addEventListener("click",()=>{this.openAiEditor(),this.close()})}openAssetEditor(){this.options&&Promise.resolve().then(()=>(oo(),tf)).then(({AssetEditorModal:t})=>{new t().show(this.options.objectId||"unknown",this.options.propertyPath||"",this.options.assetPath,n=>{var r;(r=this.options)!=null&&r.onChange&&this.options.onChange(n),this.close()})})}openAiEditor(){if(!this.options||this.options.assetType!=="image")return;let t=window.__openAiEditor;typeof t=="function"&&t(this.options.objectId||"asset","Edit this image asset",this.options.assetPath,{path:this.options.propertyPath,onApply:i=>{var n;(n=this.options)!=null&&n.onChange&&this.options.onChange(i)}})}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.options=null}};window.openAssetPreview=function(e){new lo().open(e)};var co=class{constructor(){this.modal=null;this.canvas=null;this.ctx=null;this.image=null;this.options=null;this.cropX=0;this.cropY=0;this.cropWidth=100;this.cropHeight=100;this.scale=1;this.panX=0;this.panY=0;this.isDragging=!1;this.dragStartX=0;this.dragStartY=0;this.lastPanX=0;this.lastPanY=0}open(t){this.options=t,this.createModal(),this.loadImage(),document.body.appendChild(this.modal)}createModal(){let t=document.createElement("div");t.className="asset-crop-modal",t.innerHTML=`
180
+ <div class="asset-crop-card">
181
+ <div class="asset-crop-header">
182
+ <div>
183
+ <div class="asset-crop-title">Crop Image</div>
184
+ <div class="asset-crop-subtitle">Drag to reposition, scroll to zoom</div>
185
+ </div>
186
+ <button class="asset-crop-close" data-action="close">\xD7</button>
187
+ </div>
188
+
189
+ <div class="asset-crop-body">
190
+ <div class="asset-crop-column">
191
+ <div class="asset-crop-canvas-container">
192
+ <canvas class="asset-crop-canvas"></canvas>
193
+ </div>
194
+
195
+ <div class="asset-crop-controls">
196
+ <div class="asset-crop-zoom">
197
+ <label class="asset-crop-label">Zoom</label>
198
+ <input type="range" min="0.1" max="3" step="0.1" value="1" class="asset-crop-zoom-slider" />
199
+ <span class="asset-crop-zoom-value">1.0x</span>
200
+ </div>
201
+
202
+ <div class="asset-crop-aspect">
203
+ <label class="asset-crop-label">Aspect Ratio</label>
204
+ <select class="asset-crop-aspect-select">
205
+ <option value="free">Free</option>
206
+ <option value="1:1">Square (1:1)</option>
207
+ <option value="4:3">Standard (4:3)</option>
208
+ <option value="16:9">Widescreen (16:9)</option>
209
+ <option value="3:2">Photo (3:2)</option>
210
+ </select>
211
+ </div>
212
+
213
+ <button class="asset-crop-reset" data-action="reset">Reset</button>
214
+ </div>
215
+ </div>
216
+
217
+ <div class="asset-crop-column">
218
+ <div class="asset-crop-preview">
219
+ <div class="asset-crop-preview-label">Preview</div>
220
+ <canvas class="asset-crop-preview-canvas"></canvas>
221
+ </div>
222
+ </div>
223
+ </div>
224
+
225
+ <div class="asset-crop-actions">
226
+ <button class="asset-crop-apply" data-action="cancel">Cancel</button>
227
+ <button class="asset-crop-apply primary" data-action="apply">Apply Crop</button>
228
+ </div>
229
+ </div>
230
+ `,this.modal=t,this.attachEventListeners(),this.initializeCanvas()}initializeCanvas(){this.modal&&(this.canvas=this.modal.querySelector(".asset-crop-canvas"),this.canvas&&(this.ctx=this.canvas.getContext("2d"),this.canvas.width=400,this.canvas.height=300))}loadImage(){this.options&&(this.image=new Image,this.image.crossOrigin="anonymous",this.image.onload=()=>{this.initializeCrop(),this.render()},this.image.src=this.options.imageSrc)}initializeCrop(){var n;if(!this.image||!this.canvas)return;let t=this.image.width/this.image.height,i=this.canvas.width/this.canvas.height;t>i?(this.cropHeight=this.image.height,this.cropWidth=this.cropHeight*i,this.cropX=(this.image.width-this.cropWidth)/2,this.cropY=0):(this.cropWidth=this.image.width,this.cropHeight=this.cropWidth/i,this.cropX=0,this.cropY=(this.image.height-this.cropHeight)/2),(n=this.options)!=null&&n.aspectRatio&&this.applyAspectRatio(this.options.aspectRatio),this.fitToCanvas()}applyAspectRatio(t){if(!this.image)return;let i=this.image.width/this.image.height,n=this.cropX+this.cropWidth/2,r=this.cropY+this.cropHeight/2;t>i?(this.cropWidth=Math.min(this.image.width,this.cropHeight*t),this.cropHeight=this.cropWidth/t):(this.cropHeight=Math.min(this.image.height,this.cropWidth/t),this.cropWidth=this.cropHeight*t),this.cropX=Math.max(0,Math.min(this.image.width-this.cropWidth,n-this.cropWidth/2)),this.cropY=Math.max(0,Math.min(this.image.height-this.cropHeight,r-this.cropHeight/2))}fitToCanvas(){if(!this.image||!this.canvas)return;let t=this.canvas.width/this.cropWidth,i=this.canvas.height/this.cropHeight;this.scale=Math.min(t,i)*.9,this.panX=(this.canvas.width-this.cropWidth*this.scale)/2,this.panY=(this.canvas.height-this.cropHeight*this.scale)/2}render(){!this.ctx||!this.image||!this.canvas||(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.save(),this.ctx.translate(this.panX,this.panY),this.ctx.scale(this.scale,this.scale),this.ctx.drawImage(this.image,-this.cropX,-this.cropY,this.image.width,this.image.height),this.ctx.restore(),this.drawCropOverlay(),this.updatePreview())}drawCropOverlay(){if(!this.ctx||!this.canvas)return;let t=this.panX,i=this.panY,n=this.cropWidth*this.scale,r=this.cropHeight*this.scale;this.ctx.fillStyle="rgba(0, 0, 0, 0.5)",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.ctx.clearRect(t,i,n,r),this.ctx.strokeStyle="#ffffff",this.ctx.lineWidth=2,this.ctx.strokeRect(t,i,n,r),this.ctx.fillStyle="#ffffff";let a=8;[[t,i],[t+n-a,i],[t,i+r-a],[t+n-a,i+r-a]].forEach(([o,d])=>{var l;(l=this.ctx)==null||l.fillRect(o,d,a,a)})}updatePreview(){if(!this.modal||!this.image)return;let t=this.modal.querySelector(".asset-crop-preview-canvas");if(!t)return;let i=t.getContext("2d");if(!i)return;let n=150;t.width=n,t.height=n;let r=n/this.cropWidth,a=n/this.cropHeight,s=Math.min(r,a),o=this.cropWidth*s,d=this.cropHeight*s,l=(n-o)/2,c=(n-d)/2;i.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,l,c,o,d)}attachEventListeners(){if(!this.modal||!this.canvas)return;this.canvas.addEventListener("mousedown",this.handleMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.handleMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.handleMouseUp.bind(this)),this.canvas.addEventListener("wheel",this.handleWheel.bind(this)),this.canvas.addEventListener("touchstart",this.handleTouchStart.bind(this)),this.canvas.addEventListener("touchmove",this.handleTouchMove.bind(this)),this.canvas.addEventListener("touchend",this.handleTouchEnd.bind(this));let t=this.modal.querySelector(".asset-crop-zoom-slider");t==null||t.addEventListener("input",n=>{let r=parseFloat(n.target.value);this.setZoom(r)});let i=this.modal.querySelector(".asset-crop-aspect-select");i==null||i.addEventListener("change",n=>{let r=n.target.value;this.setAspectRatio(r)}),this.modal.addEventListener("click",n=>{switch(n.target.dataset.action){case"reset":this.reset();break;case"apply":this.applyCrop();break;case"cancel":case"close":this.close();break}}),this.modal.addEventListener("click",n=>{n.target===this.modal&&this.close()})}handleMouseDown(t){this.isDragging=!0,this.dragStartX=t.clientX,this.dragStartY=t.clientY,this.lastPanX=this.panX,this.lastPanY=this.panY,this.canvas.style.cursor="grabbing"}handleMouseMove(t){if(!this.isDragging)return;let i=t.clientX-this.dragStartX,n=t.clientY-this.dragStartY;this.panX=this.lastPanX+i,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleMouseUp(){this.isDragging=!1,this.canvas.style.cursor="grab"}handleWheel(t){t.preventDefault();let i=t.deltaY>0?.9:1.1;this.setZoom(this.scale*i)}handleTouchStart(t){t.touches.length===1&&(this.isDragging=!0,this.dragStartX=t.touches[0].clientX,this.dragStartY=t.touches[0].clientY,this.lastPanX=this.panX,this.lastPanY=this.panY)}handleTouchMove(t){if(!this.isDragging||t.touches.length!==1)return;t.preventDefault();let i=t.touches[0].clientX-this.dragStartX,n=t.touches[0].clientY-this.dragStartY;this.panX=this.lastPanX+i,this.panY=this.lastPanY+n,this.constrainPan(),this.render()}handleTouchEnd(){this.isDragging=!1}setZoom(t){this.scale=Math.max(.1,Math.min(3,t)),this.updateZoomUI(),this.constrainPan(),this.render()}setAspectRatio(t){let i;switch(t){case"1:1":i=1;break;case"4:3":i=4/3;break;case"16:9":i=16/9;break;case"3:2":i=3/2;break;default:i=void 0}i&&this.applyAspectRatio(i),this.fitToCanvas(),this.render()}updateZoomUI(){if(!this.modal)return;let t=this.modal.querySelector(".asset-crop-zoom-value"),i=this.modal.querySelector(".asset-crop-zoom-slider");t&&(t.textContent=`${this.scale.toFixed(1)}x`),i&&(i.value=this.scale.toString())}constrainPan(){if(!this.canvas)return;let t=this.cropWidth*this.scale,i=this.cropHeight*this.scale;this.panX=Math.max(this.canvas.width-t,Math.min(0,this.panX)),this.panY=Math.max(this.canvas.height-i,Math.min(0,this.panY))}reset(){this.initializeCrop(),this.render()}applyCrop(){var r;if(!this.image||!((r=this.options)!=null&&r.onCrop))return;let t=document.createElement("canvas"),i=t.getContext("2d");if(!i)return;t.width=this.cropWidth,t.height=this.cropHeight,i.drawImage(this.image,this.cropX,this.cropY,this.cropWidth,this.cropHeight,0,0,this.cropWidth,this.cropHeight);let n=t.toDataURL("image/png");this.options.onCrop(n),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal);let t=this.options;this.modal=null,this.canvas=null,this.ctx=null,this.image=null,this.options=null,t!=null&&t.onCancel&&t.onCancel()}};window.openAssetCrop=function(e){new co().open(e)};st();var vn=require("pixi.js");Rr();var Kv=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",uo=Kv;if(typeof window!="undefined")try{let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let t=JSON.parse(e.responseText);t!=null&&t.buildMode&&(uo=t.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${uo}`))}}catch{}var wt=class{static async create(t,i,n){var d,l,c,f,u,p,v;console.log(`[ObjectFactory] create() called for: ${t}, __BUILD_MODE__: ${uo}`);let r=(d=i==null?void 0:i.render)==null?void 0:d.asset;if(!r){console.log(`[ObjectFactory] No asset definition for: ${t}, returning empty container`);let b=new vn.Container;return this.applyTransform(b,i==null?void 0:i.transform),b}let a=(l=i==null?void 0:i.identity)==null?void 0:l.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${t}, configId: ${a}, type: ${r.type}, path: ${r.path}`);let s=await yt.load(t,r,n,a);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${t}, rawAsset type: ${(c=s==null?void 0:s.constructor)==null?void 0:c.name}`);let o;if(r.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",t),o=new vn.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(f=o==null?void 0:o.constructor)==null?void 0:f.name),this.applyTransform(o,i==null?void 0:i.transform);else if(r.type==="json")if(console.log("[ObjectFactory] JSON asset for",t,"rawAsset type:",(u=s==null?void 0:s.constructor)==null?void 0:u.name,s),s&&(((p=s.constructor)==null?void 0:p.name)==="Container"||s instanceof vn.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let b=[r.path,`/assets/${r.path}`,`assets/${r.path}`,`../assets/${r.path}`],x=!1;for(let g of b)try{let h=await fetch(g);if(h.ok){o=await h.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",g,"type:",(v=o==null?void 0:o.constructor)==null?void 0:v.name),x=!0;break}}catch{continue}x||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=s)}else o=s;else o=s,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,i==null?void 0:i.transform);return o}static applyTransform(t,i){var n,r,a,s;!i||!t||(i.position&&("x"in t&&"y"in t?(t.x=(n=i.position.x)!=null?n:0,t.y=(r=i.position.y)!=null?r:0):"position"in t&&t.position&&t.position.set((a=i.position.x)!=null?a:0,(s=i.position.y)!=null?s:0)),i.scale!==void 0&&"scale"in t&&t.scale&&(typeof t.scale=="object"&&"set"in t.scale?t.scale.set(i.scale):t.scale=i.scale),i.rotation!==void 0&&"rotation"in t&&(t.rotation=i.rotation),i.anchor&&"anchor"in t&&t.anchor&&Array.isArray(i.anchor)&&("set"in t.anchor?t.anchor.set(i.anchor[0],i.anchor[1]):(t.anchor.x=i.anchor[0],t.anchor.y=i.anchor[1])))}};st();var nf=jn(require("lottie-web"),1);jr(kl);typeof window!="undefined"&&!window.lottie&&(window.lottie=nf.default);sa();st();var po="0.3.1",Xv=new Set(["init","boot","view","ready","start","pause","resume","complete","error","engagement","first_interaction","retry","cta_show","cta_click","cta_dismiss","clickout","conversion","session_time","level_time","load_time","level_start","level_complete","level_fail","checkpoint","reward","tutorial_start","tutorial_complete","tutorial_skip","ab_assign","fps","memory","asset_load_start","asset_load_complete"]),df={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},uf=Math.random().toString(36).slice(2),_i=null,xi={...df},pf="web_embed",mo={},wn,fo=!1,xn=!1,En=!1,ff=!1,xo=1,zr=0,Fr=!1,tt=!1,wi="",Ei=Math.floor(window.innerWidth),Si=Math.floor(window.innerHeight),bo=Ei>Si,it=!1,_n=!1,rf=!1,af=!1,ho=!1,Br=null,$t=null,vo=!1,yo=!1,Dr=new Map;function hf(){if(!$t)return null;let e=Date.now()-$t;return!Number.isFinite(e)||e<0?null:e}function go(e){if(vo)return;let t=hf();t!==null&&(vo=!0,L("session_time",{duration_ms:t,reason:e}))}function sf(){if(_i)return _i;let e=document.createElement("div");return e.id="handler-root",e.setAttribute("data-handler-root","true"),document.body.appendChild(e),_i=e,e}function Nr(e){switch(e){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return e}}function gf(e,t){return{event_name:e,ts:Date.now(),session_id:uf,deployment_id:xi.deployment_id,variant_id:xi.variant_id,export_profile_id:xi.profile_id,instance_id:xi.instance_id||"default",env:pf==="mraid"?"mraid":"web",attribution:wn,payload:t}}function L(e,t){let i=Nr(e),n=gf(i,t);ta(n,!!mo.analytics),zn(i,n),i!==e&&zn(e,n)}function Sn(){Br&&(Br(Ei,Si),Br=null)}function Ai(e){xo=e,L("volume",e)}function Ci(e){e&&(ff=!0),!En&&(En=!0,L("pause"),Ai(0))}function An(e){!e&&ff||En&&(En=!1,L("resume"),Ai(xo))}function _t(e,t){Ei=Math.floor(e||window.innerWidth),Si=Math.floor(t||window.innerHeight),bo=Ei>Si,L("resize",{width:Ei,height:Si})}function Zv(){if(xl())try{let e=mraid.getMaxSize();_t(e.width,e.height);let t=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?An():Ci()};if(mraid.addEventListener("viewableChange",t),mraid.addEventListener("stateChange",t),mraid.addEventListener("sizeChange",()=>{let i=mraid.getMaxSize();_t(i.width,i.height)}),mraid.getAudioVolume){let i=mraid.getAudioVolume();Ai(i?1:0)}if(mraid.addEventListener("audioVolumeChange",i=>{i!==null&&Ai(i>0?1:0)}),mraid.addEventListener("error",(i,n)=>{console.warn("mraid error:",i,"action:",n)}),Fr=!0,mraid.isViewable()&&mraid.getState()!=="hidden")it=!0,L("boot"),L("view"),L("ready"),tt=!0,Sn();else{let i=()=>{it=!0,L("boot"),L("view"),L("ready"),tt=!0,Sn()};mraid.addEventListener("ready",i)}}catch(e){console.warn("MRAID hook skipped",e)}}function Jv(){if(wl())try{let e=dapi.getScreenSize();_t(e.width,e.height),dapi.addEventListener("viewableChange",i=>{i.isViewable?An():Ci()}),dapi.addEventListener("adResized",i=>{let n=dapi.getScreenSize();_t(i.width||n.width,i.height||n.height)});let t=dapi.getAudioVolume();if(Ai(t?1:0),dapi.addEventListener("audioVolumeChange",i=>Ai(i?1:0)),Fr=!0,dapi.isViewable())it=!0,L("boot"),L("view"),L("ready"),tt=!0,Sn();else{let i=()=>{it=!0,L("boot"),L("view"),L("ready"),tt=!0,Sn()};dapi.addEventListener("ready",i)}}catch(e){console.warn("DAPI hook skipped",e)}}function of(){let e=()=>{it||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(it=!0,L("boot"),L("view"),L("ready"),tt=!0,Sn(),_n&&(_n=!1,Ne.start()))};window.addEventListener("resize",()=>_t()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(An(),e()):Ci()}),document.readyState==="complete"||document.readyState==="interactive"?e():window.addEventListener("load",e),Fr=!0}function Qv(){let e=t=>{typeof TouchEvent!="undefined"&&t instanceof TouchEvent&&(rf=!0),!(rf&&t instanceof MouseEvent)&&(zr+=1,yo||(yo=!0,L("first_interaction",{count:zr})),L("interaction",zr))};document.addEventListener("mousedown",e),document.addEventListener("touchstart",e)}function lf(e){var n,r,a,s,o,d,l,c,f,u,p,v;let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(n=window.ExitApi)==null||n.exit();return}catch{}if(t==="mraid"&&typeof mraid!="undefined")mraid.open(e||"");else if(t==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(Gt())(a=(r=window.TJ_API)==null?void 0:r.click)==null||a.call(r);else if(_l())(o=(s=window.FbPlayableAd)==null?void 0:s.onCTAClick)==null||o.call(s);else if(Cl())(l=(d=window.ScPlayableAd)==null?void 0:d.onCTAClick)==null||l.call(d);else if(Al())try{(f=(c=window.smxTracking)==null?void 0:c.redirect)==null||f.call(c)}catch(b){console.warn("Smadex redirect failed",b)}else if(El()){let b=window.ExitApi;b&&typeof b.exit=="function"?b.exit(e||wi||""):e&&window.open(e)}else qt()?(u=window.install)==null||u.call(window):Sl()?(p=window.openAppStore)==null||p.call(window):ia()?(v=parent==null?void 0:parent.postMessage)==null||v.call(parent,"download","*"):e&&window.open(e)}function ey(){let e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",t=i=>{if(!i)return;let n=new Image;n.src=i};if(e==="bigabid"){let i=window.BIGABID_BIDTIMEMACROS;if(!i)return;he("view",()=>t(i.mraid_viewable)),he("start",()=>t(i.game_viewable)),he("engagement",()=>t(i.engagement));let n=()=>t(i.complete);he("complete",n),Dn("engagement",r=>{var a;((a=r==null?void 0:r.payload)==null?void 0:a.count)>3&&n()}),he("cta_click",()=>t(i.click))}else if(e==="inmobi"){let i=window.INMOBI_DSPMACROS;if(!i)return;he("view",()=>t(i.Ad_Load_Start)),he("start",()=>t(i.Ad_Viewable)),he("engagement",()=>t(i.First_Engagement)),he("complete",()=>t(i.Gameplay_Complete)),he("cta_click",()=>t(i.DSP_Click)),he("start",()=>{[5,10,15,20,25,30].forEach(n=>setTimeout(()=>t(i[`Spent_${n}_Seconds`]),n*1e3))})}}function ty(){if(!Gt())return;let e=window.TJ_API;e&&e.setPlayableAPI&&e.setPlayableAPI({skipAd:()=>{try{Ne.finish()}catch(t){console.warn("Tapjoy skip failed",t)}}})}function cf(){var t,i,n;let e=window.TJ_API;(t=e==null?void 0:e.objectiveComplete)==null||t.call(e),(i=e==null?void 0:e.playableFinished)==null||i.call(e),(n=e==null?void 0:e.gameplayFinished)==null||n.call(e)}function iy(){qt()&&(window.mintGameStart=()=>{An(!0),_t()},window.mintGameClose=()=>{Ci(!0)})}function ny(){if(!na())return;let e=window.NUC;!e||!e.trigger||(Ne.on("cta_click",()=>{var t,i;return(i=(t=e.trigger).convert)==null?void 0:i.call(t,wi)}),Ne.on("complete",()=>{var t,i;return(i=(t=e.trigger).tryAgain)==null?void 0:i.call(t)}))}var Ne={init(e={},t){var i;if(pf=e.profile||"web_embed",mo=e.consent||{},xi={...df,...e.ids||{}},_i=e.rootEl||_i,wn=void 0,ol((i=e.telemetry)!=null&&i.endpoint?e.telemetry:null),$t=null,vo=!1,yo=!1,Dr.clear(),wi=e.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),t&&(Br=t),L("init"),document.body.oncontextmenu=()=>!1,sf(),ay(_i),Tl(),Zv(),Jv(),!Fr){if(document.readyState==="complete")of();else if(!af){af=!0;let n=()=>{of(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}Qv(),ey(),ty(),iy(),ny(),console.log(`%c @handler/playable-sdk %c v${po} `,"background: #007acc; color: #fff; font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: #e1e4e8; color: #333; font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),it&&!tt&&(L("boot"),L("view"),L("ready"),_n&&(_n=!1,Ne.start()),tt=!0),tt=it},getRoot(){return sf()},get version(){return po},get maxWidth(){return Ei},get maxHeight(){return Si},get isLandscape(){return bo},get isReady(){return tt},get isStarted(){return fo},get isPaused(){return En},get isFinished(){return xn},get volume(){return xo},get interactions(){return zr},on(e,t){Dn(Nr(e),t)},off(e,t){ea(Nr(e),t)},start(){var e,t;if(!fo){if(!it){_n=!0;return}if(fo=!0,$t||($t=Date.now()),L("start"),_t(),qt())Ci(),(e=window.gameReady)==null||e.call(window);else if(Gt()){let i=window.TJ_API;(t=i==null?void 0:i.setPlayableBuild)==null||t.call(i,{orientation:bo?"landscape":"portrait",buildID:po})}}},finish(){var e,t;xn||(xn=!0,L("complete"),go("complete"),qt()?(e=window.gameEnd)==null||e.call(window):ia()?(t=parent==null?void 0:parent.postMessage)==null||t.call(parent,"complete","*"):Gt()&&cf())},install(e){if(!xn){xn=!0,Gt()?(cf(),setTimeout(()=>Ne.install(e),300)):(L("complete"),setTimeout(()=>Ne.install(e),0));return}ho||(ho=!0,setTimeout(()=>ho=!1,500),L("cta_click"),L("conversion"),go("cta"),lf(e||wi))},emit(e,t){let i=Nr(e);if(!Xv.has(i)&&i!=="resize"&&i!=="volume"&&!i.startsWith("custom."))throw new Error(`Event ${e} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let n=gf(i,t);ta(n,!!mo.analytics),zn(i,n)},gameStart(){Ne.start()},gameEnd(){Ne.finish()},ctaClick(e,t){L("cta_click",{url:e||wi,manual:!0}),(t==null?void 0:t.open)!==!1&&lf(e||wi)},ctaShow(e){L("cta_show",e)},ctaDismiss(e){L("cta_dismiss",e)},getGameTimeMs(){return hf()},endSession(e="manual"){go(e)},setAttribution(e){wn=e},abTest(e,t){if(!e)throw new Error("abTest requires experimentId");if(!Array.isArray(t)||t.length<2)throw new Error("abTest requires at least 2 variants");let i=Math.abs(ry(`${uf}:${e}`))%t.length,n=t[i];return wn={...wn||{},experiment_id:e},xi.variant_id=n,L("ab_assign",{experiment_id:e,variant_id:n}),n},levelStart(e,t){$t||($t=Date.now()),L("level_start",{level_id:e,...t})},levelComplete(e,t){L("level_complete",{level_id:e,...t})},levelFail(e,t){L("level_fail",{level_id:e,...t})},checkpoint(e,t){L("checkpoint",{checkpoint_id:e,...t})},reward(e,t){L("reward",{reward_id:e,...t})},tutorialStart(e,t){L("tutorial_start",{step_id:e,...t})},tutorialComplete(e,t){L("tutorial_complete",{step_id:e,...t})},tutorialSkip(e,t){L("tutorial_skip",{step_id:e,...t})},timerStart(e){e&&Dr.set(e,Date.now())},timerEnd(e,t="custom",i){if(!e)return;let n=Dr.get(e);if(!n)return;Dr.delete(e);let r=Date.now()-n;if(!(!Number.isFinite(r)||r<0)){if(t==="custom"){L("engagement",{action:"timer",key:e,duration_ms:r,...i});return}L(t,{key:e,duration_ms:r,...i})}},fps(e,t){L("fps",{value:e,...t})},memory(e,t){L("memory",{bytes:e,...t})},assetLoadStart(e,t){L("asset_load_start",{asset_id:e,...t})},assetLoadComplete(e,t){L("asset_load_complete",{asset_id:e,...t})},reportError(e,t,i){L("error",{code:e,message:t,...i})},retry(){var e,t,i;if(qt())(e=window.gameRetry)==null||e.call(window);else if(na()){let n=window.NUC;(i=(t=n==null?void 0:n.trigger)==null?void 0:t.tryAgain)==null||i.call(t)}L("engagement",{action:"retry"})},pause(){Ci(!0)},resume(){An(!0)},resize(e,t){_t(e,t)}},yn=Ne;function ry(e){let t=2166136261;for(let i=0;i<e.length;i++)t^=e.charCodeAt(i),t=Math.imul(t,16777619);return t|0}function ay(e){let t=document.createElement("script");t.type="text/javascript",t.textContent=`
231
+ (function(){
232
+ var events = ['touchstart','touchend','mousedown','keydown'];
233
+ function unlock(){
234
+ if(window.AudioContext && AudioContext.prototype.resume){
235
+ if(!window.__handler_audio_ctx){
236
+ window.__handler_audio_ctx = new AudioContext();
237
+ }
238
+ if(window.__handler_audio_ctx.state === 'suspended'){
239
+ window.__handler_audio_ctx.resume();
240
+ }
241
+ }
242
+ events.forEach(function(e){ document.removeEventListener(e, unlock); });
243
+ }
244
+ events.forEach(function(e){ document.addEventListener(e, unlock, false); });
245
+ })();
246
+ `,e.appendChild(t)}async function $r(e,t={}){let i=new mf.Application;await i.init({resizeTo:e,autoDensity:!0,resolution:window.devicePixelRatio||1,antialias:!0,backgroundAlpha:0});let n=s=>{var f,u,p,v;if(!i.renderer)return;let o=(f=s==null?void 0:s.width)!=null?f:e.clientWidth,d=(u=s==null?void 0:s.height)!=null?u:e.clientHeight,l=o&&o>0?o:(p=window.innerWidth)!=null?p:320,c=d&&d>0?d:(v=window.innerHeight)!=null?v:480;i.renderer.resize(l,c)};e.innerHTML="",e.style.position="relative",e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="stretch",e.style.width="100%",e.style.height="100dvh",e.style.minHeight="100vh",e.style.maxWidth="100%",e.style.maxHeight="100%",e.style.boxSizing="border-box",e.style.overflow="hidden",t.background&&(e.style.background=t.background),e.appendChild(i.canvas),n();let r=document.createElement("div");return r.setAttribute("style",["position:absolute","inset:0","display:flex","flex-direction:column","align-items:center","justify-content:flex-start","gap:12px","pointer-events:none","font-family:Arial,sans-serif","padding:20px 16px","padding-bottom:clamp(24px, 6vh, 96px)","box-sizing:border-box","z-index:2"].join(";")),e.appendChild(r),yn.on("pause",()=>{i.ticker.stop(),document.querySelectorAll("audio").forEach(o=>o.pause())}),yn.on("resume",()=>{i.ticker.start(),document.querySelectorAll("audio").forEach(o=>{o.currentTime>0&&!o.ended&&o.play().catch(()=>{})})}),yn.on("resize",({payload:s})=>{n({width:s==null?void 0:s.width,height:s==null?void 0:s.height})}),window.addEventListener("resize",()=>n()),requestAnimationFrame(()=>n()),new ResizeObserver(s=>{let o=s[0];if(o&&o.contentRect.width>0&&o.contentRect.height>0){let d=Math.round(o.contentRect.width),l=Math.round(o.contentRect.height);if(n({width:d,height:l}),typeof window!="undefined"&&window.gameApp&&window.gameObjectManager){let c={width:d,height:l,dpr:Math.max(1,Math.floor(window.devicePixelRatio||1)),presetId:"auto-resize",isLandscape:d>l};window.dispatchEvent(new CustomEvent("handler-preview:screen",{detail:c}))}}}).observe(e),{app:i,stage:i.stage,overlay:r,applySize:n}}var pe=require("pixi.js"),Cn=class{constructor(t){var i,n;this.position=(t==null?void 0:t.position)||(t==null?void 0:t.offset)||{x:0,y:0},this.scale=(i=t==null?void 0:t.scale)!=null?i:1,this.rotation=(n=t==null?void 0:t.rotation)!=null?n:0}update(t){let i=t.position||t.offset;i!==void 0&&(this.position={...i}),t.scale!==void 0&&(this.scale=t.scale),t.rotation!==void 0&&(this.rotation=t.rotation)}syncToPixi(t){t&&(t.position.set(this.position.x,this.position.y),t.scale.set(this.scale),t.rotation=this.rotation)}},Tn=class{constructor(t){var i,n,r,a;this.z_index=(i=t==null?void 0:t.z_index)!=null?i:0,this.alpha=(n=t==null?void 0:t.alpha)!=null?n:1,this.visible=(r=t==null?void 0:t.visible)!=null?r:!0,this.tint=(a=t==null?void 0:t.tint)!=null?a:null}update(t){t.z_index!==void 0&&(this.z_index=t.z_index),t.alpha!==void 0&&(this.alpha=t.alpha),t.visible!==void 0&&(this.visible=t.visible),t.tint!==void 0&&(this.tint=t.tint)}syncToPixi(t,i){if(!t)return;if(t.zIndex=this.z_index,i!=null&&i.startsWith("ui_endgame_")||(t.alpha=this.alpha),t.visible=this.visible,this.tint!==null&&"tint"in t&&(t.tint=this.tint),i&&"texture"in t)try{let{AssetTextures:r}=require("handler-playable-sdk/pixi");if(r&&r[i]){let a=r[i];a&&(t.texture=a)}}catch{}}},kn=class{constructor(t,i,n,r){this._tickerCleanup=null;this.onRebuildRequired=null;this.instanceId=t,this.objectConfig=i,this.pixiObject=n,this._config=r,this.transform=new Cn(r.transform),this.renderer=new Tn(r.render),this.sync()}sync(){this.transform.syncToPixi(this.pixiObject),this.renderer.syncToPixi(this.pixiObject,this.instanceId),this.applyAnchor(),this.applyEffectsScale(),this.applyEffects(),this.syncTextProperties(),(!this._initialized||this._shouldReplayIntro)&&(this.applyIntro(),this._initialized=!0,this._shouldReplayIntro=!1),this.applyMotion()}syncTextProperties(){var i;if(!this.pixiObject||!("text"in this.pixiObject))return;let t=(i=this._config)==null?void 0:i.ui;t&&(t.text!==void 0&&this.pixiObject.text!==t.text&&(this.pixiObject.text=t.text),this.pixiObject.style&&(t.fontSize!==void 0&&(this.pixiObject.style.fontSize=t.fontSize),t.color!==void 0&&(this.pixiObject.style.fill=t.color),t.align!==void 0&&(this.pixiObject.style.align=t.align)))}destroy(){this._tickerCleanup&&(this._tickerCleanup(),this._tickerCleanup=null),this._introTicker&&(pe.Ticker.shared.remove(this._introTicker),this._introTicker=null),this.pixiObject&&this.pixiObject.parent&&this.pixiObject.parent.removeChild(this.pixiObject)}updateConfig(t){var d,l,c,f,u,p,v,b,x,g,h;let i=(l=(d=this._config)==null?void 0:d.motion)==null?void 0:l.intro,n=(c=t==null?void 0:t.motion)==null?void 0:c.intro;n!=null&&n.enabled&&JSON.stringify(i)!==JSON.stringify(n)&&(this._shouldReplayIntro=!0);let r=(p=(u=(f=this._config)==null?void 0:f.render)==null?void 0:u.asset)==null?void 0:p.type,a=(b=(v=t==null?void 0:t.render)==null?void 0:v.asset)==null?void 0:b.type,s=(g=(x=this._config)==null?void 0:x.ui)==null?void 0:g.renderMode,o=(h=t==null?void 0:t.ui)==null?void 0:h.renderMode;if((r!==a||s!==o)&&(console.log(`[GameObject] Rebuild required for ${this.instanceId}: type changed from ${r}/${s} to ${a}/${o}`),this.onRebuildRequired)){this.onRebuildRequired(this,t);return}this._config=t,t.transform&&this.transform.update(t.transform),t.render&&this.renderer.update(t.render),this.sync()}applyAnchor(){var r,a,s,o;if(!this.pixiObject||!("anchor"in this.pixiObject)||!this.pixiObject.anchor)return;let t=(a=(r=this._config)==null?void 0:r.render)==null?void 0:a.anchor,i=(o=(s=this._config)==null?void 0:s.transform)==null?void 0:o.anchor,n=t&&typeof t=="object"?t:i&&typeof i=="object"?i:null;n&&typeof n.x=="number"&&typeof n.y=="number"&&this.pixiObject.anchor.set(n.x,n.y)}applyEffectsScale(){var a,s,o;if(!((a=this.pixiObject)!=null&&a.scale))return;let t=(s=this._config)==null?void 0:s.effects,i=typeof(t==null?void 0:t.scale_x)=="number"?t.scale_x:1,n=typeof(t==null?void 0:t.scale_y)=="number"?t.scale_y:1;if(i===1&&n===1)return;let r=(o=this.transform.scale)!=null?o:1;typeof this.pixiObject.scale.set=="function"?this.pixiObject.scale.set(r*i,r*n):(this.pixiObject.scale.x=r*i,this.pixiObject.scale.y=r*n)}applyEffects(){var n,r,a,s,o,d,l,c,f;if(!this.pixiObject)return;let t=(n=this._config)==null?void 0:n.effects;if(!t||t.enabled===!1){this.pixiObject.filters=null;return}let i=[];if((r=t.blur)!=null&&r.enabled){let u=new pe.BlurFilter;u.blur=(a=t.blur.strength)!=null?a:4,i.push(u)}if((s=t.shadow)!=null&&s.enabled){let u=t.shadow,p=new pe.BlurFilter;p.blur=(o=u.blur)!=null?o:4,p.blendMode="multiply",i.push(p),(u.offsetX!==0||u.offsetY!==0)&&console.warn("[Effects] Drop shadow offset requires pixi-filters. Install: npm install pixi-filters")}if((d=t.glow)!=null&&d.enabled){let u=t.glow,p=new pe.BlurFilter;if(p.blur=(l=u.blur)!=null?l:8,i.push(p),u.color){let v=new pe.ColorMatrixFilter,b=typeof u.color=="string"?parseInt(u.color.replace("#",""),16):u.color;v.tint(b),i.push(v)}}(c=t.stroke)!=null&&c.enabled&&console.warn("[Effects] Stroke/outline effect requires pixi-filters. Install: npm install pixi-filters"),(f=t.distortion)!=null&&f.enabled&&console.warn("[Effects] Distortion effect requires pixi-filters or a displacement map. Install: npm install pixi-filters"),this.pixiObject.filters=i.length>0?i:null}applyIntro(){var c,f,u,p,v,b,x;let t=(c=this._config)==null?void 0:c.motion;if(!t||!((f=t.intro)!=null&&f.enabled)||!this.pixiObject)return;let i=t.intro,n=(i.duration||0)/1e3,r=(i.delay||0)/1e3,a=this.transform.position.y,s=this.transform.scale*(((p=(u=this._config)==null?void 0:u.effects)==null?void 0:p.scale_x)||1),o=this.transform.scale*(((b=(v=this._config)==null?void 0:v.effects)==null?void 0:b.scale_y)||1);if(this.pixiObject.alpha=(x=i.startAlpha)!=null?x:0,i.startScale!==void 0&&this.pixiObject.scale.set(s*i.startScale,o*i.startScale),i.startYOffset!==void 0&&(this.pixiObject.y=a+(i.startYOffset||0)),this._introTicker&&pe.Ticker.shared.remove(this._introTicker),n<=0&&r<=0){this.pixiObject.alpha=this.renderer.alpha,this.pixiObject.y=this.transform.position.y,this.pixiObject.scale.set(s,o);return}let d=0,l=g=>{var C,P,_,O,k,I;if(d+=g.deltaTime/60,d<r)return;let h=n>0?Math.min(1,(d-r)/n):1,w=1-Math.pow(1-h,3),y=this.renderer.alpha,m=this.transform.scale*(((P=(C=this._config)==null?void 0:C.effects)==null?void 0:P.scale_x)||1),T=this.transform.scale*(((O=(_=this._config)==null?void 0:_.effects)==null?void 0:O.scale_y)||1),A=this.transform.position.y,S=this.transform.position.x;if(this.pixiObject.alpha=((k=i.startAlpha)!=null?k:0)+(y-((I=i.startAlpha)!=null?I:0))*w,i.startScale!==void 0){let D=i.startScale+(1-i.startScale)*w;this.pixiObject.scale.set(m*D,T*D)}i.startYOffset!==void 0&&(this.pixiObject.y=A+i.startYOffset+(A-(A+i.startYOffset))*w),h>=1&&(pe.Ticker.shared.remove(l),this._introTicker=null,this.pixiObject.alpha=y,this.pixiObject.x=S,this.pixiObject.y=A,this.pixiObject.scale.set(m,T))};this._introTicker=l,pe.Ticker.shared.add(l)}applyMotion(){var r,a,s;let t=(r=this._config)==null?void 0:r.motion,i=t&&t.enabled!==!1,n=JSON.stringify(t);if(!(this._lastMotionStr===n&&this._tickerCleanup)){if(this._lastMotionStr=n,!i){this._tickerCleanup&&(this._tickerCleanup(),this._tickerCleanup=null);return}if(this._tickerCleanup&&this._tickerCleanup(),(a=t.pulse)!=null&&a.enabled||(s=t.swing)!=null&&s.enabled){let o=0,d=l=>{var b,x,g,h,w,y,m,T,A,S,C;o+=l.deltaTime*.05;let c=this.transform.scale,f=c*(((x=(b=this._config)==null?void 0:b.effects)==null?void 0:x.scale_x)||1),u=c*(((h=(g=this._config)==null?void 0:g.effects)==null?void 0:h.scale_y)||1),p=this.transform.position.x,v=this.transform.position.y;if((w=t.pulse)!=null&&w.enabled){let P=(y=t.pulse.intensity)!=null?y:.1,_=(m=t.pulse.speed)!=null?m:1,k=1+Math.sin(o*_)*P;(T=this.pixiObject.scale)!=null&&T.set?this.pixiObject.scale.set(f*k,u*k):this.pixiObject.scale&&(this.pixiObject.scale.x=f*k,this.pixiObject.scale.y=u*k)}if((A=t.swing)!=null&&A.enabled){let P=(S=t.swing.amplitude)!=null?S:10,_=(C=t.swing.speed)!=null?C:1,O=Math.sin(o*_)*P;t.swing.axis==="vertical"?this.pixiObject.y=v+O:t.swing.axis==="both"?(this.pixiObject.x=p+O,this.pixiObject.y=v+O):this.pixiObject.x=p+O}};pe.Ticker.shared.add(d),this._tickerCleanup=()=>{var l,c,f,u,p;if(pe.Ticker.shared.remove(d),this.pixiObject){let v=this.transform.scale*(((c=(l=this._config)==null?void 0:l.effects)==null?void 0:c.scale_x)||1),b=this.transform.scale*(((u=(f=this._config)==null?void 0:f.effects)==null?void 0:u.scale_y)||1);this.pixiObject.x=this.transform.position.x,this.pixiObject.y=this.transform.position.y,(p=this.pixiObject.scale)!=null&&p.set?this.pixiObject.scale.set(v,b):this.pixiObject.scale&&(this.pixiObject.scale.x=v,this.pixiObject.scale.y=b)}}}}}getComponent(t){return this._config[t]}getPosition(){return{...this.transform.position}}setPosition(t,i){this.transform.position={x:t,y:i},this.transform.syncToPixi(this.pixiObject)}getAlpha(){return this.renderer.alpha}setAlpha(t){this.renderer.alpha=t,this.renderer.syncToPixi(this.pixiObject)}getVisible(){return this.renderer.visible}setVisible(t){this.renderer.visible=t,this.renderer.syncToPixi(this.pixiObject)}},Ti=class{constructor(t){this.objects=new Map;this.onObjectRebuildRequired=null;this.config=t}create(t,i){let n=this.config.objects.get(t);if(!n)throw new Error(`Object config not found: ${t}`);let r=new kn(t,n.object_config||t,i,n);return this.objects.set(t,r),r.onRebuildRequired=async(a,s)=>{if(this.onObjectRebuildRequired){console.log(`[GameObjectManager] Triggering rebuild for ${t}`);let o=await this.onObjectRebuildRequired(t,s);o&&this.objects.get(t)===o&&console.log(`[GameObjectManager] \u2705 Rebuilt ${t} successfully`)}else console.warn(`[GameObjectManager] Rebuild required for ${t} but no factory provided`),a.updateConfig(s)},r}get(t){return this.objects.get(t)}updateConfig(t){this.config=t;for(let[i,n]of this.objects.entries()){let r=t.objects.get(i);r&&n.updateConfig(r)}}getAll(){return Array.from(this.objects.values())}remove(t){let i=this.objects.get(t);i&&i.destroy(),this.objects.delete(t)}clear(){for(let t of this.objects.values())t.destroy();this.objects.clear()}};var Hr={"brand.primary":{family:"Arial, sans-serif",weight:"400"},"brand.warning":{family:"Arial Black, Arial, sans-serif",weight:"900"},"brand.heading":{family:"Arial Black, Arial, sans-serif",weight:"800"},"brand.body":{family:"Arial, sans-serif",weight:"400"}};function bf(e){let t=Hr[e];return t?t.family:(console.warn(`Font ID "${e}" not found in registry, using fallback`),"Arial, sans-serif")}function vf(e){var i;let t=Hr[e];return t&&(i=t.weight)!=null?i:"400"}function yf(e,t){Hr[e]=t}function xf(){return Object.keys(Hr)}var ki=null;function sy(){return console.log("[LottieOverlay] getLottie called, lottieLib cached?",!!ki),console.log("[LottieOverlay] window.lottie exists?",typeof window!="undefined"&&!!window.lottie),ki||(typeof window!="undefined"&&window.lottie?(ki=window.lottie,console.log("[LottieOverlay] \u2705 Found window.lottie, cached it")):(console.warn("[LottieOverlay] \u274C lottie-web is not available globally. Make sure it is loaded before using Lottie animations."),console.log("[LottieOverlay] window keys:",typeof window!="undefined"?Object.keys(window).filter(e=>e.toLowerCase().includes("lottie")):"no window"),ki=null)),ki}function jr(e){ki=e}function wf(e,t,i,n){var m,T,A,S,C,P,_,O,k,I,D,z,ne;let r=i.objects.get(e);if(!r)return console.warn(`[LottieOverlay] Object config not found: ${e}`),null;let a=((m=r.effects)==null?void 0:m.lottie)||{},s=r.transform||{},o=r.render||{};if(a.enabled===!1||o.visible===!1)return null;let d=n[e];if(!d||typeof d!="object")return console.warn(`[LottieOverlay] Asset data not found or invalid for: ${e}`),null;let l=sy();if(!l)return console.warn(`[LottieOverlay] lottie-web is not available. Cannot play animation: ${e}`),null;let c=(T=a.width)!=null?T:300,f=(A=a.height)!=null?A:300,u=(S=s.scale)!=null?S:1,p=(P=(C=s.position)==null?void 0:C.x)!=null?P:0,v=(O=(_=s.position)==null?void 0:_.y)!=null?O:0,b=(k=s.rotation)!=null?k:0,x=(I=o.z_index)!=null?I:100,g=(D=o.alpha)!=null?D:1,h=document.createElement("div");h.style.cssText=`
247
+ position: absolute;
248
+ top: calc(50% + ${v}px);
249
+ left: calc(50% + ${p}px);
250
+ transform: translate(-50%, -50%) scale(${u}) rotate(${b}deg);
251
+ width: ${c}px;
252
+ height: ${f}px;
253
+ pointer-events: none;
254
+ z-index: ${x};
255
+ opacity: ${g};
256
+ `,t.appendChild(h);let w=l.loadAnimation({container:h,renderer:a.renderer||"svg",loop:(z=a.loop)!=null?z:!1,autoplay:(ne=a.autoplay)!=null?ne:!0,animationData:d});a.speed!==void 0&&w.setSpeed(a.speed);let y=()=>{w.destroy(),h.parentNode&&h.parentNode.removeChild(h)};return a.loop||w.addEventListener("complete",y),{animation:w,cleanup:y}}Rr();Js();var Ur=class{constructor(t,i,n){this.systems=[];this.totalTime=0;this.root=t,this.config=i,this.destinationUrl=n}async init(t){let{app:i,stage:n}=await $r(this.root,{background:t.background_color,text:t.text_color,primary:t.cta_background,cta_text:t.cta_text});this.app=i,this.stage=n,this.gameObjectManager=new Ti(this.config),this.stage.eventMode="passive",this.stage.interactive=!1,this.stage.interactiveChildren=!0,this.stage.sortableChildren=!0;let r={app:this.app,stage:this.stage,config:this.config,gameObjectManager:this.gameObjectManager,destinationUrl:this.destinationUrl,root:this.root,engine:this};for(let a of this.systems)a.setContext(r),a.init&&await a.init();return{app:this.app,gameObjectManager:this.gameObjectManager}}registerSystems(t){this.systems.push(...t)}async start(){for(let t of this.systems)t.onStart&&await t.onStart();this.app.ticker.add(this.update.bind(this)),window.addEventListener("handler-preview:screen",t=>{let{width:i,height:n}=t.detail;this.resize(i,n)})}update(t){let i=t.deltaTime/60;this.totalTime+=i;for(let n of this.systems)n.update&&n.update(i,this.totalTime)}resize(t,i){for(let n of this.systems)n.onResize&&n.onResize(t,i)}updateConfig(t){this.config=t;for(let i of this.systems)i.context.config=t,i.onConfigUpdate&&i.onConfigUpdate(t)}destroy(){for(let t of this.systems)t.onDestroy&&t.onDestroy();this.app.ticker.remove(this.update.bind(this)),this.app.destroy(!0,{children:!0,texture:!1})}getApp(){return this.app}getGameObjectManager(){return this.gameObjectManager}getTotalTime(){return this.totalTime}getSystem(t){let i=this.systems.find(n=>n instanceof t);if(!i)throw new Error(`System ${t.name} not found!`);return i}};var Li=class{setContext(t){this.context=t}};var Oi=class{constructor(){this.config=null}init(t){this.config=t}get(t){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(t)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(t){return this.config?this.config.objects.has(t):!1}};var _f=jn(require("pixi.js"),1),Ef=_f;typeof window!="undefined"&&(window.__basePixi=_f);bn();var nt=require("pixi.js");bn();var Sf=e=>e*Math.PI/180;function oy(e,t){var s,o,d,l,c;let i=t.ui;if(!(i!=null&&i.text))return null;let n="#ffffff";(s=t.render)!=null&&s.tint&&(n=t.render.tint);let r=new nt.TextStyle({fontFamily:(o=i.font)!=null?o:"Arial",fontSize:(d=i.fontSize)!=null?d:16,fill:n,align:(l=i.align)!=null?l:"center",letterSpacing:(c=i.letterSpacing)!=null?c:0}),a=new nt.Text({text:i.text,style:r});return a.label=e,a}function Af(e){var c,f,u,p,v,b,x,g,h,w;let{stage:t,mainContainer:i,activeConfig:n,gameObjectManager:r,allowList:a,denyList:s}=e,o={},d={},l={};i.sortableChildren=!0;for(let[y,m]of n.objects.entries()){if(s!=null&&s.has(y)||a&&!a.has(y)||(m==null?void 0:m.enabled)===!1)continue;let T=(f=(c=m==null?void 0:m.render)==null?void 0:c.asset)==null?void 0:f.path,A=(p=(u=m==null?void 0:m.render)==null?void 0:u.asset)==null?void 0:p.type,S=!!(T&&A==="image"),C=!!((v=m==null?void 0:m.ui)!=null&&v.text),P=C?(b=m==null?void 0:m.ui)==null?void 0:b.renderMode:void 0,_;if(P==="png"&&S?_="png":P==="text"&&C?_="text":S?_="png":C?_="text":_="skip",_!=="skip"){if(_==="text"){let O=oy(y,m);if(!O)continue;let k=m.render;O.alpha=typeof(k==null?void 0:k.alpha)=="number"?k.alpha:1,O.visible=(k==null?void 0:k.visible)!==!1,O.zIndex=typeof(k==null?void 0:k.z_index)=="number"?k.z_index:0,k!=null&&k.anchor&&typeof k.anchor.x=="number"&&typeof k.anchor.y=="number"?O.anchor.set(k.anchor.x,k.anchor.y):O.anchor.set(.5,.5);let I=m.transform,D=(I==null?void 0:I.position)||(I==null?void 0:I.offset);D&&O.position.set((x=D.x)!=null?x:0,(g=D.y)!=null?g:0);let z=typeof(I==null?void 0:I.scale)=="number"?I.scale:1;O.scale.set(z,z);let ne=typeof(I==null?void 0:I.rotation)=="number"?I.rotation:0;O.rotation=Sf(ne),O.parent||i.addChild(O);try{r.create(y,O)}catch{}o[y]=O,l[y]=O}else if(_==="png"){let O=xt[y]||(typeof nt.Texture!="undefined"?nt.Texture.EMPTY:void 0),k=new nt.Sprite(O);k.label=y;let I=m.render;k.alpha=typeof(I==null?void 0:I.alpha)=="number"?I.alpha:1,k.visible=(I==null?void 0:I.visible)!==!1,k.zIndex=typeof(I==null?void 0:I.z_index)=="number"?I.z_index:0,I!=null&&I.anchor&&typeof I.anchor.x=="number"&&typeof I.anchor.y=="number"&&k.anchor.set(I.anchor.x,I.anchor.y);let D=m.transform,z=(D==null?void 0:D.position)||(D==null?void 0:D.offset);z&&k.position.set((h=z.x)!=null?h:0,(w=z.y)!=null?w:0);let ne=typeof(D==null?void 0:D.scale)=="number"?D.scale:1;k.scale.set(ne,ne);let $e=typeof(D==null?void 0:D.rotation)=="number"?D.rotation:0;k.rotation=Sf($e),k.parent||i.addChild(k);try{r.create(y,k)}catch{}o[y]=k,d[y]=k}}}return i.parent||t.addChild(i),{objects:o,sprites:d,texts:l}}var wo=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Oi}init(t,i){this.registry.init(t),this.app=i}updateConfig(t){this.registry.init(t),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let i=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));if(i.length===0)return;let n=async r=>{r.length&&(console.log("[Assets] Loading objects:",r),await Promise.all(r.map(async a=>{var o;let s=this.registry.get(a);if(!s){console.warn("[Assets] No config found for object:",a);return}try{let d=await wt.create(a,s,this.app);this.instanceCache.set(a,d),console.log("[Assets] Loaded object:",a,(o=d==null?void 0:d.constructor)==null?void 0:o.name)}catch(d){console.error("[Assets] Failed to load object:",a,d)}})))};return this.readyPromise=(async()=>{await n(i);let r=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));r.length>0&&(console.warn("[Assets] Retrying missing assets:",r),await n(r)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(t){let i=this.registry.get(t);if(i){let n=await wt.create(t,i,this.app);this.instanceCache.set(t,n)}}get(t){return this.instanceCache.get(t)}},Cf=new wo,Tf=new Proxy(Cf,{get(e,t){if(t in e&&typeof e[t]=="function")return e[t].bind(e);if(e.get(t))return e.get(t)}});function kf(e,t){Cf.init(e,t)}bn();var qr=class extends Li{async init(){Mr(this.context.config,this.context.app),await xt.ready(),console.log("[AssetSystem] All assets preloaded and ready")}async onStart(){}onConfigUpdate(){console.log("[AssetSystem] Config updated - systems will refresh textures")}};var Vr=require("pixi.js"),rt={width:400,height:600,designWidth:400,scaleFactor:1},On={scale:1,position:1},Kr=[];function ly(e,t,i,n,r,a,s){Kr.push({element:e,originalScale:a,positionHelper:t,heightPercent:r}),t(e,i,n,r,a,s,!1)}function cy(){Kr.forEach(({element:e,originalScale:t,positionHelper:i,heightPercent:n})=>{let r=t*rt.scaleFactor;i(e,rt.width,rt.height,n,r,!0,!1)})}function Lf(){Kr.length=0,console.log("[LAYOUT] Cleared all responsive elements")}function Wr(e,t){console.log(`[SCREEN] updateScreenState called: ${e}x${t}`),rt.width=e,rt.height=t,rt.scaleFactor=Math.min(e/rt.designWidth,1.15),On.scale=rt.scaleFactor,On.position=1,console.log(`[SCREEN] Global multipliers - scale: ${On.scale.toFixed(3)}`),cy()}var G={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function dy(e,t,i){let n=G[e];n&&n[t]!==void 0&&(n[t]=i,console.log(`Updated ${e}.${t} = ${i}`))}function uy(){return G}var py={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function Gr(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function In(e,t={x:.5,y:.5}){var i;if(Array.isArray(e))return{x:Gr(e[0],t.x),y:Gr(e[1],t.y)};if(e&&typeof e=="object"){let n=e;return{x:Gr(n.x,t.x),y:Gr(n.y,t.y)}}if(typeof e=="string"){let n=e.trim().toLowerCase();return(i=py[n])!=null?i:t}return t}function Ii(e,t,i,n={}){var p,v,b,x,g,h;let r=In(i),a=(p=n.inset)!=null?p:{},s=(v=n.padding)!=null?v:{x:0,y:0},o=((b=a.left)!=null?b:0)+s.x,d=((x=a.right)!=null?x:0)+s.x,l=((g=a.top)!=null?g:0)+s.y,c=((h=a.bottom)!=null?h:0)+s.y,f=Math.max(0,e-o-d),u=Math.max(0,t-l-c);return{x:o+f*r.x,y:l+u*r.y}}function Pi(e,t,i,n={}){var b,x,g,h,w,y;let r=(b=n.inset)!=null?b:{},a=(x=n.padding)!=null?x:{x:0,y:0},s=((g=r.left)!=null?g:0)+a.x,o=((h=r.right)!=null?h:0)+a.x,d=((w=r.top)!=null?w:0)+a.y,l=((y=r.bottom)!=null?y:0)+a.y,c=Math.max(0,e-s-o),f=Math.max(0,t-d-l),u=In(i,{x:.5,y:.5}),p=Math.min(Math.max(u.x,0),1),v=Math.min(Math.max(u.y,0),1);return{x:s+c*p,y:d+f*v}}function Yr(e,t,i,n={}){var c,f,u;if(!e)return;let r=n.positionRatio?Pi(t,i,n.positionRatio,{inset:n.inset,padding:n.screenPadding}):Ii(t,i,n.anchor,{inset:n.inset,padding:n.screenPadding}),a=(c=n.offset)!=null?c:{x:0,y:0},s=r.x+a.x,o=r.y+a.y;e.anchor&&n.renderAnchor&&e.anchor.set(n.renderAnchor.x,n.renderAnchor.y),ke(e,s,o);let d=(f=n.scale)!=null?f:1,l=(u=n.scaleMultiplier)!=null?u:1;(n.scale!==void 0||n.scaleMultiplier!==void 0)&&Fe(e,d*l)}if(typeof window!="undefined"){let e=window.innerWidth,t=window.innerHeight,i=()=>{let n=window.innerWidth,r=window.innerHeight;(n!==e||r!==t)&&(e=n,t=r,Wr(n,r))};window.addEventListener("resize",i),window.addEventListener("orientationchange",()=>{setTimeout(i,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",i),window.mraid.addEventListener("sizeChange",i)),Wr(window.innerWidth,window.innerHeight),window.updateDebugConfig=dy,window.getDebugConfig=uy,window.copyConfig=Ey,window.applyConfig=Ln,window.applyConfigForRatio=Sy,window.positionAtBottom=Of,window.positionAtTop=gy,window.positionAtCenter=my,window.positionAtLeft=by,window.positionAtRight=vy,window.positionAtBottomLeft=yy,window.positionAtBottomRight=xy,window.positionAtTopLeft=wy,window.positionAtTopRight=_y,window.applyPositionContract=hy,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Xr(e,t,i=0){return e*t+i}function Zr(e,t,i=0){return e*(1-t)+i}function Jr(e,t,i=0){return e*t+i}function Qr(e,t,i=0){return e*(1-t)+i}function xe(e,t=0){return e/2+t}function fy(e,t){return e*t}function hy(e,t,i,n){var s,o,d,l,c,f,u,p,v,b,x,g,h,w,y,m,T,A,S,C;let r=0,a=0;switch(n.type){case"top":r=xe(t,(o=(s=n.offset)==null?void 0:s.x)!=null?o:0),a=Xr(i,n.percent,(l=(d=n.offset)==null?void 0:d.y)!=null?l:0);break;case"bottom":r=xe(t,(f=(c=n.offset)==null?void 0:c.x)!=null?f:0),a=Zr(i,n.percent,(p=(u=n.offset)==null?void 0:u.y)!=null?p:0);break;case"left":r=Jr(t,n.percent,(b=(v=n.offset)==null?void 0:v.x)!=null?b:0),a=xe(i,(g=(x=n.offset)==null?void 0:x.y)!=null?g:0);break;case"right":r=Qr(t,n.percent,(w=(h=n.offset)==null?void 0:h.x)!=null?w:0),a=xe(i,(m=(y=n.offset)==null?void 0:y.y)!=null?m:0);break;case"center":r=xe(t,(A=(T=n.offset)==null?void 0:T.x)!=null?A:0),a=xe(i,(C=(S=n.offset)==null?void 0:S.y)!=null?C:0);break}e.position?e.position.set(r,a):(e.x=r,e.y=a),n.scale!==void 0&&n.scale!==1&&e.scale&&(typeof e.scale.set=="function"?e.scale.set(n.scale,n.scale):(e.scale.x=n.scale,e.scale.y=n.scale))}function Of(e,t,i,n=.2,r=1,a=!0,s=!1){let o=fy(i,n),d=Zr(i,n/2);ke(e,xe(t),d);let l=a?r*rt.scaleFactor:r;Fe(e,l),s&&!Kr.find(c=>c.element===e)&&ly(e,Of,t,i,n,r,a)}function gy(e,t,i,n=.1,r=1){ke(e,xe(t),Xr(i,n)),Fe(e,r)}function my(e,t,i,n=0,r=0,a=1){ke(e,xe(t,n),xe(i,r)),Fe(e,a)}function by(e,t,i,n=.1,r=1){ke(e,Jr(t,n),xe(i)),Fe(e,r)}function vy(e,t,i,n=.1,r=1){ke(e,Qr(t,n),xe(i)),Fe(e,r)}function yy(e,t,i,n=.05,r=.05,a=1){ke(e,Jr(t,r),Zr(i,n)),Fe(e,a)}function xy(e,t,i,n=.05,r=.05,a=1){ke(e,Qr(t,r),Zr(i,n)),Fe(e,a)}function wy(e,t,i,n=.05,r=.05,a=1){ke(e,Jr(t,r),Xr(i,n)),Fe(e,a)}function _y(e,t,i,n=.05,r=.05,a=1){ke(e,Qr(t,r),Xr(i,n)),Fe(e,a)}function ke(e,t,i){e&&e.position?typeof e.position.set=="function"?e.position.set(t,i):(e.position.x=t,e.position.y=i):e&&(e.x=t,e.y=i)}function Fe(e,t){t!==1&&e&&e.scale&&(typeof e.scale.set=="function"?e.scale.set(t,t):e.scale.x!==void 0&&e.scale.y!==void 0&&(e.scale.x=t,e.scale.y=t))}var Ht={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function Ey(e){return e&&Ht[e]?JSON.parse(JSON.stringify(Ht[e])):JSON.parse(JSON.stringify(G))}function Ln(e){Object.keys(e).forEach(t=>{let i=t;G[i]&&e[i]&&Object.assign(G[i],e[i])}),console.log("Config applied:",e)}function Sy(e,t){let i=e/t;i>1.6?(Ln(Ht.wide),console.log("Applied WIDE config for ratio:",i)):i<.7?(Ln(Ht.tall),console.log("Applied TALL config for ratio:",i)):i>.8&&i<1.2?(Ln(Ht.square),console.log("Applied SQUARE config for ratio:",i)):(Ln(Ht.default),console.log("Applied DEFAULT config for ratio:",i))}if(typeof window!="undefined"){let e=window;e.configPresets=Ht,e.resolveAnchorVec2=e.resolveAnchorVec2||In,e.resolveScreenAnchorPoint=e.resolveScreenAnchorPoint||Ii,e.resolveScreenRatioPoint=e.resolveScreenRatioPoint||Pi}var fe=null;function If(e,t,i,n,r,a={}){var ne,$e,_o,Eo,So,Ao,Co,To,ko,Lo,Oo,Io,Po,Ro,Mo,jo,Do,zo,Bo,No,Fo,$o,Ho,Uo,qo,Go,Wo,Yo,Vo,Ko,Xo,Zo,Jo,Qo,el,tl,il;let s=(ne=a.enableDebugLogs)!=null?ne:!1;s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== STARTING LAYOUT CALCULATION ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Screen dimensions:",{width:n.width,height:n.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Time:",i),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Options:",a));let{mainContainer:o,label:d,background:l,backgroundTexture:c,app:f}=e;if(!f||!f.renderer){s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] \u274C No app or renderer, skipping layout");return}s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] App renderer dimensions:",{width:f.renderer.width,height:f.renderer.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] App screen dimensions:",{width:f.screen.width,height:f.screen.height}));let u=n.width,p=n.height;s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Base dimensions:",{baseWidth:u,baseHeight:p});let v=u*G.layout.screen_scale_x,b=p*G.layout.screen_scale_y,x=u/2,g=t.engine.runtime||{},h=g.layout||{};s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug config:",{screen_scale_x:G.layout.screen_scale_x,screen_scale_y:G.layout.screen_scale_y}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Calculated dimensions:",{width:v,height:b,midX:x}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Engine runtime:",g),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Layout config:",h));let w=h.design_width_portrait||400,y=v/w;y=Math.min(y,1.15);let m=y*(($e=G.engine.scale)!=null?$e:1),T=(_o=a.skipMainContainerTransform)!=null?_o:!1;!T&&o&&o.scale&&(typeof o.scale.set=="function"?o.scale.set(m):(o.scale.x=m,o.scale.y=m));let A=(Eo=h.main_container_anchor)!=null?Eo:"center",S=(So=h.main_container_position_ratio)!=null?So:{x:.5,y:.5},C=(Ao=h.main_container_offset)!=null?Ao:{x:0,y:0},P=h.main_container_position_ratio?Pi(u,p,S):Ii(u,p,A),_=P.x+C.x+G.layout.position_offset.x,O=P.y+C.y+G.layout.position_offset.y;if(!T&&o&&o.position&&(typeof o.position.set=="function"?o.position.set(_,O):(o.position.x=_,o.position.y=O)),r&&(o!=null&&o.toLocal))for(let[re,ae]of t.objects.entries()){let W=ae==null?void 0:ae.transform;if(!W||((Co=W.position_mode)!=null?Co:"static")!=="static")continue;let N=(To=r.get)==null?void 0:To.call(r,re),Le=((ko=N==null?void 0:N.getDisplayObject)==null?void 0:ko.call(N))||(N==null?void 0:N.pixiObject)||N;if(!Le||Le.parent!==o)continue;let Ri=W.position_ratio!=null?Pi(u,p,W.position_ratio):Ii(u,p,(Lo=W.anchor)!=null?Lo:"center"),Pn=o.toLocal(new Vr.Point(Ri.x,Ri.y)),Rn=(Oo=W.position)!=null?Oo:{x:0,y:0},Mi=Pn.x+Rn.x,Et=Pn.y+Rn.y;typeof(N==null?void 0:N.setPosition)=="function"?N.setPosition(Mi,Et):(ke(Le,Mi,Et),(Io=N==null?void 0:N.transform)!=null&&Io.position&&(N.transform.position.x=Mi,N.transform.position.y=Et))}let k=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,D=((k==null?void 0:k.buildMode)||(typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"dev"))==="dev";if(G.layout.debug_rect_visible&&D){(!fe||fe.parent!==f.stage)&&(fe==null||fe.destroy(),fe=new Vr.Graphics,fe.zIndex=9999,f.stage.addChild(fe)),fe.clear();let re=G.layout.debug_rect_scale_x,ae=G.layout.debug_rect_scale_y,W=(u-4)*re,we=(p-4)*ae,N=(u-W)/2,Le=(p-we)/2;s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== DEBUG RECT POSITIONING ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect calculations:",{baseWidth:u,baseHeight:p,rectW:W,rectH:we,offsetX:N,offsetY:Le}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect final position:",{x:2+N,y:2+Le,width:W,height:we})),fe.rect(2+N,2+Le,W,we).stroke({width:G.layout.debug_rect_thickness,color:G.layout.debug_rect_color})}else fe&&(fe.destroy(),fe=null);let z=((Po=e.label)==null?void 0:Po.config)||t.objects.get("label_1")||t.objects.get("ui_tutorial_1");if(d&&d.position&&z){let re=(Ro=z==null?void 0:z.render)==null?void 0:Ro.anchor,ae=(jo=(Mo=z==null?void 0:z.transform)==null?void 0:Mo.anchor)!=null?jo:"center",W=(Do=z==null?void 0:z.transform)==null?void 0:Do.position_ratio,we=((zo=z==null?void 0:z.transform)==null?void 0:zo.offset)||{x:0,y:0};Yr(d,u,p,{anchor:ae,positionRatio:W,offset:{x:we.x*m,y:we.y*m},renderAnchor:re})}if(d&&d.alpha>0){let re=1+Math.sin(i*G.engine.label_pulse_speed)*G.engine.label_pulse_intensity,ae=(No=(Bo=z==null?void 0:z.transform)==null?void 0:Bo.scale)!=null?No:1,W=re*m*ae;d.scale&&(typeof d.scale.set=="function"?d.scale.set(W):(d.scale.x=W,d.scale.y=W))}if(s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== BACKGROUND POSITIONING ====="),l){s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background object exists:",!!l),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background type:",(Fo=l.constructor)==null?void 0:Fo.name)),l.alpha=((Ho=($o=g.background)==null?void 0:$o.alpha)!=null?Ho:.98)*G.engine.background_alpha,s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background alpha set to:",l.alpha);let re=t.objects.get("background_1");s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background config:",re);let ae=(re==null?void 0:re.transform)||{};s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background transform:",ae);let W=ae.offset||{x:0,y:0},we=((qo=(Uo=g.background)==null?void 0:Uo.offset_y)!=null?qo:0)+G.engine.background_offset_y,N=(Wo=(Go=re==null?void 0:re.render)==null?void 0:Go.anchor)!=null?Wo:{x:.5,y:.5},Le=(Yo=ae.anchor)!=null?Yo:"center",Ri=ae.position_ratio;if(s&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background positioning params:",{bgOffset:W,bgRuntimeOffsetY:we,bgRenderAnchor:N,bgScreenAnchor:Le,bgPositionRatio:Ri,baseWidth:u,baseHeight:p,finalScale:m}),Yr(l,u,p,{anchor:Le,positionRatio:Ri,offset:{x:W.x*m,y:W.y*m+we},renderAnchor:N}),s&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background position after applyScreenAnchor:",{x:l.x,y:l.y,scaleX:(Vo=l.scale)==null?void 0:Vo.x,scaleY:(Ko=l.scale)==null?void 0:Ko.y,anchorX:(Xo=l.anchor)==null?void 0:Xo.x,anchorY:(Zo=l.anchor)==null?void 0:Zo.y,pivotX:(Jo=l.pivot)==null?void 0:Jo.x,pivotY:(Qo=l.pivot)==null?void 0:Qo.y,width:l.width,height:l.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background texture dimensions:",{textureWidth:c==null?void 0:c.width,textureHeight:c==null?void 0:c.height})),c){let Pn=Math.max(v/c.width,b/c.height),Rn=(tl=(el=g.background)==null?void 0:el.scale_multiplier)!=null?tl:1.05,Mi=(il=ae.scale)!=null?il:1,Et=Pn*Rn*G.engine.background_scale*Mi;l.scale&&(typeof l.scale.set=="function"?l.scale.set(Et):(l.scale.x=Et,l.scale.y=Et))}else l&&typeof l.clear=="function"&&(l.clear(),l.rect(-v/2,-b/2,v,b).fill({color:1444375}))}}function Pf(e){var o,d,l;let{setState:t,updateLabelAlpha:i,updateHandAlpha:n,config:r,states:a}=e,s=((d=(o=r.engine)==null?void 0:o.runtime)==null?void 0:d.timeline)||{};t(a.showHook),setTimeout(()=>{i(1),n(1),t(a.waitInput),console.log("[GAME] \u23F3 Game ready for user input - tutorial shown")},(l=s.tutorial_delay_ms)!=null?l:1500)}0&&(module.exports={AssetCache,AssetLoader,AssetSystem,AssetTextures,Assets,BaseSystem,GameEngine,GameObject,GameObjectManager,ObjectFactory,Renderer,RuntimeObjectRegistry,Transform,applyScreenAnchor,basePixi,clearResponsiveElements,createPixiBase,getRegisteredFontIds,globalResponsiveMultipliers,initAssetTextures,initAssets,layout,playLottieOverlay,registerFont,registerType,resolveAnchorVec2,resolveFont,resolveFontWeight,resolveScreenAnchorPoint,resolveScreenRatioPoint,runInitSequence,setLottieInstance,spawnSceneFromConfig,updateScreenState});