"use strict";
var _this=this;!function(e){const r="undefined";if("object"==typeof exports&&r!=typeof ǃHr)ǃHr.exports=e();else if("function"==typeof ǃHT&&ǃHT.ǃHv)ǃHT([],e);else{var t;t=r==typeof window?r==typeof global?r==typeof self?this:self:global:window,t.localforage=e()}}(function(){return function r(t,n,o){function i(d,a){if(!n[d]){if(!t[d]){var s="function"==typeof require&&require;if(!a&&s)return s(d,!0);if(e)return e(d,!0);var T=new Error("Cannot find module '"+d+"'");throw T.code="MODULE_NOT_FOUND",T}var l=n[d]={exports:{}};t[d][0].call(l.exports,function(e){var r=t[d][1][e];return i(r||e)},l,l.exports,r,t,n,o)}return n[d].exports}for(var e="function"==typeof require&&require,d=0;d=t.oldVersion&&n.createObjectStore(z)}catch(e){if("ConstraintError"!==e.name)throw e;console.warn("The database \""+r.name+"\" has been upgraded from version "+t.oldVersion+" to version "+t.newVersion+", but the storage \""+r.ǃHt+"\" already exists.")}}),e.onerror=function(r){r.preventDefault(),o(e.error)},e.onsuccess=function(){i(e.result),n(r)}})}function h(e){return p(e,!1)}function r(e){return p(e,!0)}function s(r,t){if(!r.db)return!0;var n=!r.db.objectStoreNames.contains(r.ǃHt),i=r.versionr.db.version;if(i&&(r.version!==t&&console.warn("The database \""+r.name+"\" can't be downgraded from version "+r.db.version+" to version "+r.version+"."),r.version=r.db.version),o||n){if(n){var e=r.db.version+1;e>r.version&&(r.version=e)}return!0}return!1}function t(e){return new P(function(r,t){var n=new FileReader;n.onerror=t,n.onloadend=function(t){var n=btoa(t.target.result||"");r({ǃH$:!0,data:n,type:e.type})},n.readAsBinaryString(e)})}function u(e){return U([d(atob(e.data))],{type:e.type})}function v(e){return e&&e.ǃH$}function k(e){var r=this,t=r.ǃHf().then(function(){var e=me[r.ǃHz.name];if(e&&e.ǃHl)return e.ǃHl});return E(t,e,e),t}function f(e){m(e);for(var r=me[e.name],t=r.ǃHF,n=0;n>4,l[o++]=(15&s)<<4|d>>2,l[o++]=(3&d)<<6|63&e;return T}function x(e){var r=new Uint8Array(e),t="",n;for(n=0;n>2],t+=j[(3&r[n])<<4|r[n+1]>>4],t+=j[(15&r[n+1])<<2|r[n+2]>>6],t+=j[63&r[n+2]];return 2==r.length%3?t=t.substring(0,t.length-1)+"=":1==r.length%3&&(t=t.substring(0,t.length-2)+"=="),t}function S(r,t,n,o){var d=this;r=i(r);var e=new P(function(e,s){d.ǃHm().then(function(){void 0===t&&(t=null);var a=t,T=d.ǃHz;T.ǃHV.ǃHB(t,function(t,i){i?s(i):T.db.transaction(function(n){n.ǃHn("INSERT OR REPLACE INTO "+T.ǃHt+" (key, value) VALUES (?, ?)",[r,t],function(){e(a)},function(e,r){s(r)})},function(t){if(t.code===t.QUOTA_ERR){if(0e?void r(null):void t.ǃHm().then(function(){y(t.ǃHz,W,function(o,d){if(o)return n(o);try{var a=d.objectStore(t.ǃHz.ǃHt),s=!1,T=a.openCursor();T.onsuccess=function(){var t=T.result;return t?void(0===e?r(t.key):s?r(t.key):(s=!0,t.advance(e))):void r(null)},T.onerror=function(){n(T.error)}}catch(e){n(e)}})}).catch(n)});return g(n,r),n},keys:function(e){var r=this,t=new P(function(e,t){r.ǃHm().then(function(){y(r.ǃHz,W,function(n,i){if(n)return t(n);try{var o=i.objectStore(r.ǃHz.ǃHt),d=o.openCursor(),a=[];d.onsuccess=function(){var r=d.result;return r?void(a.push(r.key),r.continue()):void e(a)},d.onerror=function(){t(d.error)}}catch(e){t(e)}})}).catch(t)});return g(t,e),t}},j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",B=/^~~local_forage_type~([^~]+)~/,V="__lfsc__:",J=V.length,N="arbf",F="blob",M="si08",Z="ui08",D="uic8",Y="si16",X="si32",G="ur16",Q="ui32",H="fl32",ee="fl64",re=J+N.length,te=Object.prototype.toString,ne={ǃHB:function(r,t){var n="";if(r&&(n=te.call(r)),r&&("[object ArrayBuffer]"===n||r.buffer&&"[object ArrayBuffer]"===te.call(r.buffer))){var i=V,e;r instanceof ArrayBuffer?(e=r,i+=N):(e=r.buffer,"[object Int8Array]"==n?i+=M:"[object Uint8Array]"==n?i+=Z:"[object Uint8ClampedArray]"==n?i+=D:"[object Int16Array]"==n?i+=Y:"[object Uint16Array]"==n?i+=G:"[object Int32Array]"==n?i+=X:"[object Uint32Array]"==n?i+=Q:"[object Float32Array]"==n?i+=H:"[object Float64Array]"==n?i+=ee:t(new Error("Failed to get type for BinaryArray"))),t(i+x(e))}else if("[object Blob]"===n){var o=new FileReader;o.onload=function(){var e="~~local_forage_type~"+r.type+"~"+x(this.result);t(V+F+e)},o.readAsArrayBuffer(r)}else try{t(JSON.stringify(r))}catch(e){console.error("Couldn't convert value into a JSON string: ",r),t(null,e)}},ǃHp:function(r){if(r.substring(0,J)!==V)return JSON.parse(r);var t=r.substring(re),n=r.substring(J,re),i;if(n===F&&B.test(t)){var o=t.match(B);i=o[1],t=t.substring(o[0].length)}var e=w(t);switch(n){case N:return e;case F:return U([e],{type:i});case M:return new Int8Array(e);case Z:return new Uint8Array(e);case D:return new Uint8ClampedArray(e);case Y:return new Int16Array(e);case G:return new Uint16Array(e);case X:return new Int32Array(e);case Q:return new Uint32Array(e);case H:return new Float32Array(e);case ee:return new Float64Array(e);default:throw new Error("Unkown type: "+n);}},ǃHD:w,ǃHY:x},ie={ǃHc:"webSQLStorage",_initStorage:function(r){var t=this,n={db:null};if(r)for(var i in r)n[i]="string"==typeof r[i]?r[i]:r[i].toString();var o=new P(function(e,r){try{n.db=openDatabase(n.name,n.version+"",n.description,n.size)}catch(e){return r(e)}n.db.transaction(function(i){i.ǃHn("CREATE TABLE IF NOT EXISTS "+n.ǃHt+" (id INTEGER PRIMARY KEY, key unique, value)",[],function(){t.ǃHz=n,e()},function(e,t){r(t)})})});return n.ǃHV=ne,o},ǃHH:function(){return"function"==typeof openDatabase}(),iterate:function(r,e){var t=this,n=new P(function(n,e){t.ǃHm().then(function(){var o=t.ǃHz;o.db.transaction(function(t){t.ǃHn("SELECT * FROM "+o.ǃHt,[],function(e,t){for(var d=t.rows,a=d.length,s=0;sr[5]&r[0]>r[10]?(n=2*o(1+r[0]-r[5]-r[10]),e[3]=(r[6]-r[9])/n,e[0]=0.25*n,e[1]=(r[1]+r[4])/n,e[2]=(r[8]+r[2])/n):r[5]>r[10]?(n=2*o(1+r[5]-r[0]-r[10]),e[3]=(r[8]-r[2])/n,e[0]=(r[1]+r[4])/n,e[1]=0.25*n,e[2]=(r[6]+r[9])/n):(n=2*o(1+r[10]-r[0]-r[5]),e[3]=(r[1]-r[4])/n,e[0]=(r[8]+r[2])/n,e[1]=(r[6]+r[9])/n,e[2]=0.25*n),e},a.ǃUGr=function(e,r,t,n){var i=r[0],o=r[1],d=r[2],a=r[3],s=i+i,T=o+o,l=d+d,u=i*s,U=i*T,c=i*l,v=o*T,p=o*l,m=d*l,f=a*s,h=a*T,g=a*l,y=n[0],b=n[1],L=n[2];return e[0]=(1-(v+m))*y,e[1]=(U+g)*y,e[2]=(c-h)*y,e[3]=0,e[4]=(U-g)*b,e[5]=(1-(u+m))*b,e[6]=(p+f)*b,e[7]=0,e[8]=(c+h)*L,e[9]=(p-f)*L,e[10]=(1-(u+v))*L,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e},a.ǃUGT=function(e,r,t,n,i){var o=r[0],d=r[1],a=r[2],s=r[3],T=o+o,l=d+d,u=a+a,U=o*T,c=o*l,v=o*u,p=d*l,m=d*u,f=a*u,h=s*T,g=s*l,y=s*u,b=n[0],L=n[1],E=n[2],k=i[0],w=i[1],x=i[2];return e[0]=(1-(p+f))*b,e[1]=(c+y)*b,e[2]=(v-g)*b,e[3]=0,e[4]=(c-y)*L,e[5]=(1-(U+f))*L,e[6]=(m+h)*L,e[7]=0,e[8]=(v+g)*E,e[9]=(m-h)*E,e[10]=(1-(U+p))*E,e[11]=0,e[12]=t[0]+k-(e[0]*k+e[4]*w+e[8]*x),e[13]=t[1]+w-(e[1]*k+e[5]*w+e[9]*x),e[14]=t[2]+x-(e[2]*k+e[6]*w+e[10]*x),e[15]=1,e},a.ǃUWg=function(e,r){var t=r[0],n=r[1],i=r[2],o=r[3],d=t+t,a=n+n,s=i+i,T=t*d,l=n*d,u=n*a,U=i*d,c=i*a,v=i*s,p=o*d,m=o*a,f=o*s;return e[0]=1-u-v,e[1]=l+f,e[2]=U-m,e[3]=0,e[4]=l-f,e[5]=1-T-v,e[6]=c+p,e[7]=0,e[8]=U+m,e[9]=c-p,e[10]=1-T-u,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},a.ǃUGv=function(e,r,t,n,i,o,d){var a=1/(t-r),s=1/(i-n),T=1/(o-d);return e[0]=2*o*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*s,e[6]=0,e[7]=0,e[8]=(t+r)*a,e[9]=(i+n)*s,e[10]=(d+o)*T,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*(d*o)*T,e[15]=0,e},a.perspective=function(e,r,t,i,o){var d=1/n(r/2),a=1/(i-o);return e[0]=d/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=d,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(o+i)*a,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*o*i*a,e[15]=0,e},a.ǃUGJ=function(e,r,t,i){var o=n(r.ǃUGL*U/180),d=n(r.ǃUGs*U/180),a=n(r.ǃUGX*U/180),s=n(r.ǃUGi*U/180),T=2/(a+s),l=2/(o+d);return e[0]=T,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=l,e[6]=0,e[7]=0,e[8]=-(0.5*((a-s)*T)),e[9]=0.5*((o-d)*l),e[10]=i/(t-i),e[11]=-1,e[12]=0,e[13]=0,e[14]=i*t/(t-i),e[15]=0,e},a.ǃUG_=function(e,r,t,n,i,o,d){var a=1/(r-t),s=1/(n-i),T=1/(o-d);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*T,e[11]=0,e[12]=(r+t)*a,e[13]=(i+n)*s,e[14]=(d+o)*T,e[15]=1,e},a.ǃUGl=function(e,r,t,n){var d=r[0],s=r[1],T=r[2],l=n[0],U=n[1],c=n[2],v=t[0],p=t[1],m=t[2],f,h,g,y,b,L,E,k,w,x;return u(d-v)d?(s.ǃUGf(e,r,i),1e-6>s.length(e)&&s.ǃUGf(e,t,i),s.normalize(e,e),U.ǃUGz(n,e,Math.PI),n):0.999999p&&(p=-p,T=-T,u=-u,U=-U,c=-c),1e-6<1-p?(v=i(p),m=l(v),f=l((1-o)*v)/m,h=l(o*v)/m):(f=1-o,h=o),e[0]=f*t+h*T,e[1]=f*d+h*u,e[2]=f*a+h*U,e[3]=f*s+h*c,e},U.ǃUGp=function(){var e=U.create(),r=U.create();return function(n,i,o,a,s,d){return U.ǃUGV(e,i,s,d),U.ǃUGV(r,o,a,d),U.ǃUGV(n,e,r,2*d*(1-d)),n}}(),U.ǃUWp=function(e,r){var t=r[0],n=r[1],i=r[2],o=r[3],d=t*t+n*n+i*i+o*o,a=d?1/d:0;return e[0]=-t*a,e[1]=-n*a,e[2]=-i*a,e[3]=o*a,e},U.ǃUGB=function(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=r[3],e},U.length=a.length,U.ǃUGd=U.length,U.ǃUGc=a.ǃUGc,U.ǃUGH=U.ǃUGc,U.normalize=a.normalize,U.ǃUGm=function(e,r){var t=r[0]+r[4]+r[8],n;if(0r[0]&&(d=1),r[8]>r[3*d+d]&&(d=2);var i=(d+1)%3,a=(d+2)%3;n=o(r[3*d+d]-r[3*i+i]-r[3*a+a]+1),e[d]=0.5*n,n=0.5/n,e[3]=(r[3*i+a]-r[3*a+i])*n,e[i]=(r[3*i+d]+r[3*d+i])*n,e[a]=(r[3*a+d]+r[3*d+a])*n}return e},U.ǃUWY=function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},U.ǃUWW=a.ǃUWW,U.ǃav=a.ǃav,e.exports=U},function(d,a,c){var v=c(1),p={};p.create=function(){var e=new v.ǃUWt(3);return e[0]=0,e[1]=0,e[2]=0,e},p.clone=function(e){var r=new v.ǃUWt(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r},p.ǃUWn=function(e,r,t){var n=new v.ǃUWt(3);return n[0]=e,n[1]=r,n[2]=t,n},p.ǃze=function(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e},p.set=function(e,r,t,n){return e[0]=r,e[1]=t,e[2]=n,e},p.add=function(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e},p.ǃUWA=function(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e},p.sub=p.ǃUWA,p.multiply=function(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e},p.ǃUWc=p.multiply,p.ǃUTv=function(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e},p.ǃUGD=p.ǃUTv,p.ceil=function(e,r){return e[0]=n(r[0]),e[1]=n(r[1]),e[2]=n(r[2]),e},p.floor=function(e,r){return e[0]=t(r[0]),e[1]=t(r[1]),e[2]=t(r[2]),e},p.min=function(e,t,n){return e[0]=r(t[0],n[0]),e[1]=r(t[1],n[1]),e[2]=r(t[2],n[2]),e},p.max=function(e,r,t){return e[0]=s(r[0],t[0]),e[1]=s(r[1],t[1]),e[2]=s(r[2],t[2]),e},p.round=function(r,t){return r[0]=e(t[0]),r[1]=e(t[1]),r[2]=e(t[2]),r},p.scale=function(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e},p.ǃUGY=function(e,r,t,n){return e[0]=r[0]+t[0]*n,e[1]=r[1]+t[1]*n,e[2]=r[2]+t[2]*n,e},p.ǃUGa=function(e,r){var t=r[0]-e[0],n=r[1]-e[1],i=r[2]-e[2];return o(t*t+n*n+i*i)},p.ǃUGq=p.ǃUGa,p.ǃUGA=function(e,r){var t=r[0]-e[0],n=r[1]-e[1],i=r[2]-e[2];return t*t+n*n+i*i},p.ǃUGW=p.ǃUGA,p.length=function(e){var r=e[0],t=e[1],n=e[2];return o(r*r+t*t+n*n)},p.ǃUGd=p.length,p.ǃUGc=function(e){var r=e[0],t=e[1],n=e[2];return r*r+t*t+n*n},p.ǃUGH=p.ǃUGc,p.ǃUGG=function(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e},p.inverse=function(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e},p.normalize=function(e,r){var t=r[0],n=r[1],i=r[2],d=t*t+n*n+i*i;return 0>>18,n[1]=128|(258048&i)>>>12,n[2]=128|(4032&i)>>>6,n[3]=128|63&i):2048>>12,n[1]=128|(4032&i)>>>6,n[2]=128|63&i):128>>6,n[1]=128|63&i):n[0]=i,this.ǃUGC.push(n)}this.ǃUGC=Array.prototype.concat.apply([],this.ǃUGC),this.ǃUGC.length!=this.data.length&&(this.ǃUGC.unshift(191),this.ǃUGC.unshift(187),this.ǃUGC.unshift(239))}function r(e,r){this.ǃUGb=e,this.ǃUGS=r,this.ǃhi=null,this.ǃUGo=0,this.ǃUGj=null,this.ǃUGe=[]}function t(e,r){if(e.length==void 0)throw new Error(e.length+"/"+r);for(var t=0;th.length)throw new Error("Too long data");return t}function a(e){var r=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return r.length+(r.length==e?0:3)}var s=Math.round,T=Math.floor,l=Math.ceil,u=Math.max;e.prototype={ǃUGy:function(){return this.ǃUGC.length},write:function(e){for(var r=0,t=this.ǃUGC.length;re||this.ǃUGo<=e||0>r||this.ǃUGo<=r)throw new Error(e+","+r);return this.ǃhi[e][r]},ǃUGP:function(){return this.ǃUGo},ǃUGw:function(){this.ǃUGQ(!1,this.ǃUGZ())},ǃUGQ:function(e,t){this.ǃUGo=4*this.ǃUGb+17,this.ǃhi=Array(this.ǃUGo);for(var n=0;n=n;n++)if(!(-1>=e+n||this.ǃUGo<=e+n))for(var r=-1;7>=r;r++)-1>=t+r||this.ǃUGo<=t+r||(this.ǃhi[e+n][t+r]=0<=n&&6>=n&&(0==r||6==r)||0<=r&&6>=r&&(0==n||6==n)||2<=n&&4>=n&&2<=r&&4>=r)},ǃUGZ:function(){for(var e=0,r=0,t=0;8>t;t++){this.ǃUGQ(!0,t);var n=p.ǃUks(this);(0==t||e>n)&&(e=n,r=t)}return r},ǃUkX:function(e,r,t){var n=e.ǃUki(r,t),i=1;this.ǃUGw();for(var o=0,d;o=d;d++)for(var r=-2;2>=r;r++)this.ǃhi[i+d][o+r]=-2==d||2==d||-2==r||2==r||0==d&&0==r}},ǃUkv:function(e){for(var r=p.ǃUk$(this.ǃUGb),t=0,n;18>t;t++)n=!e&&1==(1&r>>t),this.ǃhi[T(t/3)][t%3+this.ǃUGo-8-3]=n;for(var t=0,n;18>t;t++)n=!e&&1==(1&r>>t),this.ǃhi[t%3+this.ǃUGo-8-3][T(t/3)]=n},ǃUkT:function(e,r){for(var t=this.ǃUGS<<3|r,n=p.ǃUkf(t),o=0,i;15>o;o++)i=!e&&1==(1&n>>o),6>o?this.ǃhi[o][8]=i:8>o?this.ǃhi[o+1][8]=i:this.ǃhi[this.ǃUGo-15+o][8]=i;for(var o=0,i;15>o;o++)i=!e&&1==(1&n>>o),8>o?this.ǃhi[8][this.ǃUGo-o-1]=i:9>o?this.ǃhi[8][15-o-1+1]=i:this.ǃhi[8][15-o-1]=i;this.ǃhi[this.ǃUGo-8][8]=!e},ǃUkL:function(e,r){for(var t=-1,n=this.ǃUGo-1,i=7,o=0,d=this.ǃUGo-1;0a;a++)if(null==this.ǃhi[n][d-a]){var s=!1;o>>i));var T=p.ǃUkz(r,n,d-a);T&&(s=!s),this.ǃhi[n][d-a]=s,i--,-1==i&&(o++,i=7)}if(n+=t,0>n||this.ǃUGo<=n){n-=t,t=-t;break}}}},r.ǃUkF=236,r.ǃUkm=17,r.ǃUkJ=function(e,t,d){for(var a=n.ǃUkh(e,t),s=new o,T=0,i;T8*l)throw new Error("code length overflow. ("+s.ǃUkn()+">"+8*l+")");for(s.ǃUkn()+4<=8*l&&s.put(0,4);0!=s.ǃUkn()%8;)s.ǃUkp(!1);for(;!(s.ǃUkn()>=8*l)&&!(s.put(r.ǃUkF,8),s.ǃUkn()>=8*l);)s.put(r.ǃUkm,8);return r.ǃUkB(s,a)},r.ǃUkB=function(e,n){for(var o=0,d=0,a=0,s=Array(n.length),T=Array(n.length),l=0;l>>=1;return r},ǃUkt:function(e){return p.ǃUkE[e-1]},ǃUkz:function(e,r,t){switch(e){case v.ǃUkG:return 0==(r+t)%2;case v.ǃUkk:return 0==r%2;case v.ǃUkM:return 0==t%3;case v.ǃUkx:return 0==(r+t)%3;case v.ǃUkR:return 0==(T(r/2)+T(t/3))%2;case v.ǃUkg:return 0==r*t%2+r*t%3;case v.ǃUkO:return 0==(r*t%2+r*t%3)%2;case v.ǃUkI:return 0==(r*t%3+(r+t)%2)%2;default:throw new Error("bad maskPattern:"+e);}},ǃUkc:function(e){for(var r=new t([1],0),n=0;nr)switch(e){case U.ǃUkD:return 10;case U.ǃUkY:return 9;case U.ǃUGE:return 8;case U.ǃUka:return 8;default:throw new Error("mode:"+e);}else if(27>r)switch(e){case U.ǃUkD:return 12;case U.ǃUkY:return 11;case U.ǃUGE:return 16;case U.ǃUka:return 10;default:throw new Error("mode:"+e);}else if(41>r)switch(e){case U.ǃUkD:return 14;case U.ǃUkY:return 13;case U.ǃUGE:return 16;case U.ǃUka:return 12;default:throw new Error("mode:"+e);}else throw new Error("type:"+r)},ǃUks:function(e){for(var t=e.ǃUGP(),n=0,i=0;i=s;s++)if(!(0>i+s||t<=i+s))for(var r=-1;1>=r;r++)0>o+r||t<=o+r||(0!=s||0!=r)&&a==e.ǃUGK(i+s,o+r)&&d++;5e)throw new Error("glog("+e+")");return m.ǃUke[e]},ǃUko:function(e){for(;0>e;)e+=255;for(;256<=e;)e-=255;return m.ǃUkN[e]},ǃUkN:Array(256),ǃUke:Array(256)},f=0;8>f;f++)m.ǃUkN[f]=1<f;f++)m.ǃUkN[f]=m.ǃUkN[f-4]^m.ǃUkN[f-5]^m.ǃUkN[f-6]^m.ǃUkN[f-8];for(var f=0;255>f;f++)m.ǃUke[m.ǃUkN[f]]=f;t.prototype={get:function(e){return this.ǃUkK[e]},ǃUGy:function(){return this.ǃUkK.length},multiply:function(r){for(var e=Array(this.ǃUGy()+r.ǃUGy()-1),n=0;nthis.ǃUGy()-r.ǃUGy())return this;for(var e=m.ǃUkj(this.get(0))-m.ǃUkj(r.get(0)),n=Array(this.ǃUGy()),o=0;o>>7-e%8)},put:function(e,r){for(var t=0;t>>r-t-1))},ǃUkn:function(){return this.length},ǃUkp:function(e){var r=T(this.length/8);this.buffer.length<=r&&this.buffer.push(0),e&&(this.buffer[r]|=128>>>this.length%8),this.length++}};var h=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],g=function(){var e=function(e,r){this.ǃUkQ=e,this.ǃUkZ=r};return e.prototype.ǃUku=function(e){function r(e,r){var t=document.createElementNS("http://www.w3.org/2000/svg",e);for(var n in r)r.hasOwnProperty(n)&&t.setAttribute(n,r[n]);return t}var t=this.ǃUkZ,n=this.ǃUkQ,i=e.ǃUGP(),o=T(t.width/i),d=T(t.height/i);this.clear();var a=r("svg",{viewBox:"0 0 "+(i+"")+" "+(i+""),width:"100%",height:"100%",fill:t.ǃUMU});a.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),n.appendChild(a),a.appendChild(r("rect",{fill:t.ǃUMU,width:"100%",height:"100%"})),a.appendChild(r("rect",{fill:t.ǃUMr,width:"1",height:"1",id:"template"}));for(var s=0;s"],a=0;a");for(var s=0;s");d.push("")}d.push(""),t.innerHTML=d.join("");var l=t.childNodes[0],u=(r.width-l.offsetWidth)/2,U=(r.height-l.offsetHeight)/2;0r||0>t||r+t>e.size)throw new RangeError("offset:"+r+", length:"+t+", size:"+e.size);return e.slice?e.slice(r,r+t):e.webkitSlice?e.webkitSlice(r,r+t):e.ǃUMn?e.ǃUMn(r,r+t):e.ǃUMV?e.ǃUMV(r,r+t):void 0}function o(e,r){var t,n;return t=new ArrayBuffer(e),n=new Uint8Array(t),r&&n.set(r,0),{buffer:t,ǃUMp:n,view:new DataView(t)}}function i(){}function d(e){var r=this,t;r.size=0,r.init=function(n,i){var o=new Blob([e],{type:N});t=new s(o),t.init(function(){r.size=t.size,n()},i)},r.ǃUMB=function(e,r,n,i){t.ǃUMB(e,r,n,i)}}function a(r){var t=this,n;t.size=0,t.init=function(e){for(var i=r.length;"="==r.charAt(i-1);)i--;n=r.indexOf(",")+1,t.size=O(0.75*(i-n)),e()},t.ǃUMB=function(t,d,a){var s=o(d),T=4*O(t/3),l=4*Math.ceil((t+d)/3),u=e.atob(r.substring(T+n,l+n)),U=t-3*O(T/4),c;for(c=U;c>16,t=65535&e;try{return new Date(1980+((65024&r)>>9),((480&r)>>5)-1,31&r,(63488&t)>>11,(2016&t)>>5,2*(31&t),0)}catch(r){}}function L(e,r,t,n,i){return(e.version=r.view.getUint16(t,!0),e.ǃUMH=r.view.getUint16(t+2,!0),e.ǃUMD=r.view.getUint16(t+4,!0),e.ǃUMY=r.view.getUint32(t+6,!0),e.ǃUMa=b(e.ǃUMY),1==(1&e.ǃUMH))?void i(_):((n||8!=(8&e.ǃUMH))&&(e.ǃUMq=r.view.getUint32(t+10,!0),e.ǃUMA=r.view.getUint32(t+14,!0),e.ǃUMW=r.view.getUint32(t+18,!0)),4294967295===e.ǃUMA||4294967295===e.ǃUMW?void i(W):void(e.ǃUMG=r.view.getUint16(t+22,!0),e.ǃUMk=r.view.getUint16(t+24,!0)))}function E(r,t,n){function i(){}function d(e){function t(t,d){r.ǃUMB(r.size-t,t,function(r){for(var t=r.length-o;0<=t;t--)if(80===r[t]&&75===r[t+1]&&5===r[t+2]&&6===r[t+3])return void e(new DataView(r.buffer,t,o));d()},function(){n(A)})}var o=22;if(r.sizea||a>=r.size?void n(P):void r.ǃUMB(a,r.size-a,function(r){var d=0,a=[],T=o(r.length,r),l,u,U,c;for(l=0;l>>8^t[255&(r^e[n])];this.crc=r},r.prototype.get=function(){return~this.crc},r.prototype.table=function(){var e=[],r,n,i;for(r=0;256>r;r++){for(i=r,n=0;8>n;n++)1&i?i=3988292384^i>>>1:i>>>=1;e[r]=i}return e}(),t.prototype.append=function(e){return e},t.prototype.flush=function(){},d.prototype=new i,d.prototype.constructor=d,a.prototype=new i,a.prototype.constructor=a,s.prototype=new i,s.prototype.constructor=s,T.prototype.getData=function(e){e(this.data)},l.prototype=new T,l.prototype.constructor=l,u.prototype=new T,u.prototype.constructor=u,U.prototype=new T,U.prototype.constructor=U;var M={ǃUMy:["z-worker.js","deflate.js"],inflater:["z-worker.js","inflate.js"]};e.zip={ǃUMo:i,ǃUMj:T,ǃUMe:s,ǃUMN:a,ǃUMK:d,ǃUMP:U,ǃUMw:u,ǃUMQ:l,ǃUMZ:function(e,r,t){t=t||q,e.init(function(){E(e,r,t)},t)},ǃUMu:function(e,r,t,n){t=t||q,n=!!n,e.init(function(){x(e,r,t,n)},t)},ǃUMc:!0,ǃUMS:null,ǃUMb:null}}(this),"use strict",zip.ǃUMb={deflater:["3rdparty/zipjs/z-worker.js","3rdparty/zipjs/zlib-asm/zlib.js","3rdparty/zipjs/zlib-asm/codecs.js"],inflater:["3rdparty/zipjs/z-worker.js","3rdparty/zipjs/zlib-asm/zlib.js","3rdparty/zipjs/zlib-asm/codecs.js"]},!function(r,e){"function"==typeof ǃHT&&ǃHT.ǃHv?ǃHT(r):"undefined"!=typeof ǃHr&&"object"==typeof exports?ǃHr.exports=r():e.rangy=r()}(function(){function U(r,i){var t=typeof r[i];return t==C||t==h&&r[i]||"unknown"==t}function d(r,e){return typeof r[e]==h&&r[e]}function v(r,e){return typeof r[e]!=R}function g(i){return function(e,t){for(var n=t.length;n--;)if(!i(e,t[n]))return!1;return!0}}function $(r){return r&&T(r,w)&&V(r,y)}function q(r){return d(r,"body")?r.body:r.getElementsByTagName("body")[0]}function z(e){typeof console!=R&&U(console,"log")&&console.log(e)}function r(r,e){F&&e?alert(r):z(r)}function a(t){Y.ǃUxU=!0,Y.ǃUxr=!1,r("Rangy is not supported in this environment. Reason: "+t,Y.ǃHI.ǃUxT)}function s(r){return r.message||r.description||r+""}function c(){if(F&&!Y.ǃUxU){var e=!1,i=!1,o;U(document,"createRange")&&(o=document.createRange(),T(o,S)&&V(o,E)&&(e=!0));var t=q(document);if(!t||"body"!=t.nodeName.toLowerCase())return void a("No body element found");if(t&&U(t,"createTextRange")&&(o=t.createTextRange(),$(o)&&(i=!0)),!e&&!i)return void a("Neither Range nor TextRange are available");Y.ǃUxU=!0,Y.ǃUHS={ǃUxJ:e,ǃUxL:i};var c,d;for(var v in N)(c=N[v])instanceof f&&c.init(c,Y);for(var l=0,p=K.length;p>l;++l)try{K[l](Y)}catch(e){d="Rangy init listener threw an exception. Continuing. Detail: "+s(e),z(d)}}}function u(r,e,t){t&&(r+=" in module "+t.name),Y.warn("DEPRECATED: "+r+" is deprecated. Please use "+e+" instead.")}function l(i,e,t,n){i[e]=function(){return u(e,t,n),i[t].apply(i,Z.toArray(arguments))}}function f(r,e,t){this.name=r,this.ǃUxs=e,this.ǃUxU=!1,this.ǃUxr=!1,this.ǃUxX=t}function p(i,e,o){var t=new f(i,e,function(e){if(!e.ǃUxU){e.ǃUxU=!0;try{o(Y,e),e.ǃUxr=!0}catch(e){var t="Module '"+i+"' failed to load: "+s(e);z(t),e.stack&&z(e.stack)}}});return N[i]=t,t}function m(){}var h="object",C="function",R="undefined",E=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],S=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],y=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],w=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"],T=g(U),j=g(d),V=g(v),J=[].forEach?function(r,e){r.forEach(e)}:function(i,e){for(var t=0,n=i.length;n>t;++t)e(i[t],t)},N={},F=typeof window!=R&&typeof document!=R,Z={ǃUxi:U,ǃUx_:d,ǃUxl:v,ǃUxt:T,ǃUx$:j,ǃUxf:V,ǃUxz:$,ǃUxF:q,forEach:J},Y={version:"1.3.0",ǃUxU:!1,ǃUxm:F,ǃUxr:!0,ǃUxh:Z,ǃUHS:{},ǃhi:N,ǃHI:{ǃUxT:!1,ǃUxv:!1,ǃUxn:!1,ǃUxV:!(typeof ǃUxp!=R)||ǃUxp}};Y.ǃUxB=a,Y.warn=function(t){r("Rangy warning: "+t,Y.ǃHI.ǃUxv)};var I;({}).hasOwnProperty?(Z.extend=I=function(d,e,t){var n,a;for(var s in e)e.hasOwnProperty(s)&&(n=d[s],a=e[s],t&&null!==n&&"object"==typeof n&&null!==a&&"object"==typeof a&&I(n,a,!0),d[s]=a);return e.hasOwnProperty("toString")&&(d.toString=e.toString),d},Z.ǃUxd=function(r,e){var t={};return I(t,e),r&&I(t,r),t}):a("hasOwnProperty not supported"),F||a("Rangy can only run in a browser"),function(){var r;if(F){var e=document.createElement("div");e.appendChild(document.createElement("span"));var t=[].slice;try{1==t.call(e.childNodes,0)[0].nodeType&&(r=function(r){return t.call(r,0)})}catch(e){}}r||(r=function(i){for(var e=[],t=0,n=i.length;n>t;++t)e[t]=i[t];return e}),Z.toArray=r}();var B;F&&(U(document,"addEventListener")?B=function(r,e,t){r.addEventListener(e,t,!1)}:U(document,"attachEvent")?B=function(r,e,t){r.attachEvent("on"+e,t)}:a("Document does not have required addEventListener or attachEvent method"),Z.addListener=B);var K=[];Z.ǃUxc=u,Z.ǃUxH=l,Y.init=c,Y.ǃUxD=function(r){Y.ǃUxU?r(Y):K.push(r)};var M=[];Y.ǃUxY=function(r){M.push(r)},F&&(Y.ǃUxa=Y.ǃUxq=function(r){r=r||window,c();for(var e=0,t=M.length;t>e;++e)M[e](r)},l(Y,"createMissingNativeApi","shim")),f.prototype={init:function(){for(var i=this.ǃUxs||[],n=0,r=i.length,o,e;r>n;++n){if(e=i[n],o=N[e],!(o&&o instanceof f))throw new Error("required module '"+e+"' not found");if(o.init(),!o.ǃUxr)throw new Error("required module '"+e+"' not supported")}this.ǃUxX(this)},ǃUxB:function(r){throw this.ǃUxU=!0,this.ǃUxr=!1,new Error(r)},warn:function(r){Y.warn("Module "+this.name+": "+r)},ǃUxc:function(r,e){Y.warn("DEPRECATED: "+r+" in module "+this.name+" is deprecated. Please use "+e+" instead")},ǃUxA:function(r){return new Error("Error in Rangy "+this.name+" module: "+r)}},Y.ǃUxW=function(i){var e,t;2==arguments.length?(e=arguments[1],t=[]):(e=arguments[2],t=arguments[1]);var n=p(i,t,e);Y.ǃUxU&&Y.ǃUxr&&n.init()},Y.ǃUxG=function(r,e,t){p(r,e,t)},Y.ǃUxk=m,Y.ǃUxM=new m,Y.ǃUxx=new function(){},Y.ǃUxG("DomUtil",[],function(r,T){function U(r){for(var e=0;r=r.previousSibling;)++e;return e}function t(i,e){var t=[],r;for(r=i;r;r=r.parentNode)t.push(r);for(r=e;r;r=r.parentNode)if(R(t,r))return r;return null}function n(i,e,t){for(var n=t?e:e.parentNode;n;){if(n===i)return!0;n=n.parentNode}return!1}function h(i,e,t){for(var n=t?i:i.parentNode,o;n;){if(o=n.parentNode,o===e)return n;n=o}return null}function i(r){var e=r.nodeType;return 3==e||4==e||8==e}function u(i,e){var t=e.nextSibling,n=e.parentNode;return t?n.insertBefore(i,t):n.appendChild(i),i}function c(r){if(9==r.nodeType)return r;if(typeof r.ownerDocument!=x)return r.ownerDocument;if(typeof r.document!=x)return r.document;if(r.parentNode)return c(r.parentNode);throw T.ǃUxA("getDocument: no document found for node")}function E(r){var e=c(r);if(typeof e.defaultView!=x)return e.defaultView;if(typeof e.parentWindow!=x)return e.parentWindow;throw T.ǃUxA("Cannot get a window object for node")}function w(r){if(typeof r.contentDocument!=x)return r.contentDocument;if(typeof r.contentWindow!=x)return r.contentWindow.document;throw T.ǃUxA("getIframeDocument: No Document object found for iframe element")}function $(r){return r&&b.ǃUxi(r,"setTimeout")&&b.ǃUx_(r,"document")}function q(r){var e;try{return e=r.parentNode,!1}catch(e){return!0}}function e(r){if(!r)return"[No node]";if(j&&q(r))return"[Broken node]";if(i(r))return"\""+r.data+"\"";if(1==r.nodeType){var n=r.id?" id=\""+r.id+"\"":"";return"<"+r.nodeName+n+">[index:"+U(r)+",length:"+r.childNodes.length+"]["+(r.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return r.nodeName}function C(r){this.root=r,this.ǃUxR=r}function O(r,e){this.node=r,this.offset=e}function z(r){this.code=this[r],this.ǃUxg=r,this.message="DOMException: "+this.ǃUxg}var x="undefined",b=r.ǃUxh,P=b.ǃUxF;b.ǃUxt(document,["createDocumentFragment","createElement","createTextNode"])||T.ǃUxB("document missing a Node creation method"),b.ǃUxi(document,"getElementsByTagName")||T.ǃUxB("document missing getElementsByTagName method");var _=document.createElement("div");b.ǃUxt(_,["insertBefore","appendChild","cloneNode"])||T.ǃUxB("Incomplete Element implementation"),b.ǃUxl(_,"innerHTML")||T.ǃUxB("Element is missing innerHTML property");var W=document.createTextNode("test");b.ǃUxt(W,["splitText","deleteData","insertData","appendData","cloneNode"])||T.ǃUxB("Incomplete Text Node implementation");var R=function(r,e){for(var t=r.length;t--;)if(r[t]===e)return!0;return!1},j=!1;!function(){var e=document.createElement("b");e.innerHTML="1";var t=e.firstChild;e.innerHTML="
",j=q(t),r.ǃUHS.ǃUxO=j}();var k;typeof window.getComputedStyle==x?typeof document.documentElement.currentStyle==x?T.ǃUxB("No means of obtaining computed style properties found"):k=function(r,e){return r.currentStyle?r.currentStyle[e]:""}:k=function(r,e){return E(r).getComputedStyle(r,null)[e]},C.prototype={ǃUxI:null,ǃUxE:function(){return!!this.ǃUxR},next:function(){var r=this.ǃUxI=this.ǃUxR,n,e;if(this.ǃUxI)if(n=r.firstChild)this.ǃUxR=n;else{for(e=null;r!==this.root&&!(e=r.nextSibling);)r=r.parentNode;this.ǃUxR=e}return this.ǃUxI},detach:function(){this.ǃUxI=this.ǃUxR=this.root=null}},O.prototype={ǃav:function(r){return!!r&&this.node===r.node&&this.offset==r.offset},ǃUxC:function(){return"[DomPosition("+e(this.node)+":"+this.offset+")]"},toString:function(){return this.ǃUxC()}},z.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},z.prototype.toString=function(){return this.message},r.ǃUxy={ǃUxb:R,ǃUxS:function(r){var e;return typeof r.namespaceURI==x||null===(e=r.namespaceURI)||"http://www.w3.org/1999/xhtml"==e},parentElement:function(r){var e=r.parentNode;return 1==e.nodeType?e:null},ǃUxo:U,ǃUxj:function(r){switch(r.nodeType){case 7:case 10:return 0;case 3:case 8:return r.length;default:return r.childNodes.length;}},ǃUxe:t,ǃUxN:n,ǃUxK:function(r,e){return n(r,e,!0)},ǃUxP:h,ǃUxw:i,ǃUxQ:function(r){if(!r)return!1;var n=r.nodeType;return 3==n||8==n},ǃUxZ:u,ǃUxu:function(o,e,t){var n=o.cloneNode(!1);if(n.deleteData(0,e),o.deleteData(e,o.length-e),u(n,o),t)for(var r=0,d;d=t[r++];)d.node==o&&d.offset>e?(d.node=n,d.offset-=e):d.node==o.parentNode&&d.offset>U(o)&&++d.offset;return n},ǃURU:c,ǃURr:E,ǃURT:function(r){if(typeof r.contentWindow!=x)return r.contentWindow;if(typeof r.contentDocument!=x)return r.contentDocument.defaultView;throw T.ǃUxA("getIframeWindow: No Window object found for iframe element")},ǃURv:w,ǃUxF:P,ǃURJ:$,ǃURL:function(i,e,t){var n;if(i?b.ǃUxl(i,"nodeType")?n=1==i.nodeType&&"iframe"==i.tagName.toLowerCase()?w(i):c(i):$(i)&&(n=i.document):n=document,!n)throw e.ǃUxA(t+"(): Parameter must be a Window object or DOM node");return n},ǃURs:function(r){for(var e;e=r.parentNode;)r=e;return r},ǃURX:function(o,e,n,r){var i,d,a,s,u;if(o==n)return e===r?0:r>e?-1:1;if(i=h(n,o,!0))return e<=U(i)?-1:1;if(i=h(o,n,!0))return U(i)=e.childNodes.length?e.appendChild(i):e.insertBefore(i,e.childNodes[t]),n}function t(n,e,t){if(y(n),y(e),re(e)!=re(n))throw new M("WRONG_DOCUMENT_ERR");var r=j(n.startContainer,n.startOffset,e.endContainer,e.endOffset),o=j(n.endContainer,n.endOffset,e.startContainer,e.startOffset);return t?0>=r&&0<=o:0>r&&0e||e>(k(r)?r.length:r.childNodes.length))throw new M("INDEX_SIZE_ERR")}function c(r,e){if(de(r,!0)!==de(e,!0))throw new M("WRONG_DOCUMENT_ERR")}function v(r){if(ae(r,!0))throw new M("NO_MODIFICATION_ALLOWED_ERR")}function m(r,n){if(!r)throw new M(n)}function E(r,e){return e<=(k(r)?r.length:r.childNodes.length)}function S(r){return!!r.startContainer&&!!r.endContainer&&!(Q&&(I.ǃURi(r.startContainer)||I.ǃURi(r.endContainer)))&&Y(r.startContainer)==Y(r.endContainer)&&E(r.startContainer,r.startOffset)&&E(r.endContainer,r.endOffset)}function y(r){if(!S(r))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+r.ǃUxC()+")")}function w(d,e){y(d);var t=d.startContainer,n=d.startOffset,r=d.endContainer,o=d.endOffset,i=t===r;k(r)&&0=L(t)&&o++,n=0),d.ǃURY(t,n,r,o)}function T(r){y(r);var e=r.commonAncestorContainer.parentNode.cloneNode(!1);return e.appendChild(r.cloneContents()),e.innerHTML}function C(r){r.START_TO_START=ce,r.START_TO_END=ve,r.END_TO_END=pe,r.END_TO_START=me,r.NODE_BEFORE=fe,r.NODE_AFTER=he,r.NODE_BEFORE_AND_AFTER=ge,r.NODE_INSIDE=ye}function _(r){C(r),C(r.prototype)}function R(i,e){return function(){y(this);var t=this.startContainer,o=this.startOffset,a=this.commonAncestorContainer,s=new d(this,!0),T,n;t!==a&&(T=U(t,a,!0),n=ie(T),t=n.node,o=n.offset),oe(s,v),s.reset();var r=i(s);return s.detach(),e(this,t,o,t,o),r}}function A(e,T){function r(i,e){return function(t){u(t,X),u(Y(t),Z);var n=(i?ne:ie)(t);(e?o:a)(this,n.node,n.offset)}}function o(r,e,t){var n=r.endContainer,o=r.endOffset;(e!==r.startContainer||t!==r.startOffset)&&((Y(e)!=Y(n)||1==j(e,t,n,o))&&(n=e,o=t),T(r,e,t,n,o))}function a(r,e,t){var n=r.startContainer,o=r.startOffset;(e!==r.endContainer||t!==r.endOffset)&&((Y(e)!=Y(n)||-1==j(e,t,n,o))&&(n=e,o=t),T(r,n,o,e,t))}var t=function(){};t.prototype=J.ǃUxM,e.prototype=new t,B.extend(e.prototype,{setStart:function(r,e){l(r,!0),p(r,e),o(this,r,e)},setEnd:function(r,e){l(r,!0),p(r,e),a(this,r,e)},ǃURY:function(){var r=arguments,e=r[0],t=r[1],n=e,o=t;switch(r.length){case 3:o=r[2];break;case 4:n=r[2],o=r[3];}T(this,e,t,n,o)},ǃURa:function(r,e,t){this["set"+(t?"Start":"End")](r,e)},setStartBefore:r(!0,!0),setStartAfter:r(!1,!0),setEndBefore:r(!0,!1),setEndAfter:r(!1,!1),collapse:function(r){y(this),r?T(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):T(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(r){l(r,!0),T(this,r,0,r,V(r))},selectNode:function(r){l(r,!1),u(r,X);var e=ne(r),t=ie(r);T(this,e.node,e.offset,t.node,t.offset)},extractContents:R(f,T),deleteContents:R(i,T),ǃURq:function(){y(this),v(this.startContainer),v(this.endContainer);var r=new d(this,!0),e=r.ǃURH&&ee(r.ǃURH,this)||r.ǃURD&&ee(r.ǃURD,this);return r.detach(),!e},ǃURA:function(){w(this)},ǃURW:function(r){w(this,r)},ǃURG:function(){y(this);var l=this.startContainer,t=this.startOffset,n=this.endContainer,o=this.endOffset,r=function(r){var e=r.nextSibling;e&&e.nodeType==r.nodeType&&(n=r,o=r.length,r.appendData(e.data),G(e))},i=function(i){var e=i.previousSibling;if(e&&e.nodeType==i.nodeType){l=i;var r=i.length;if(t=e.length,i.insertData(0,e.data),G(e),l==n)o+=t,n=l;else if(n==i.parentNode){var d=L(i);o==d?(n=i,o=r):o>d&&o--}}},a=!0,s;if(k(n))o==n.length?r(n):0==o&&(s=n.previousSibling,s&&s.nodeType==n.nodeType&&(o=s.length,l==n&&(a=!1),s.appendData(n.data),G(n),n=s));else{if(0x",le=3==Te.firstChild.nodeType}catch(e){}J.ǃUHS.ǃURM=le;var ue=le?function(i){var e=this.startContainer,o=F(e);if(!e)throw new M("INVALID_STATE_ERR");var n=null;return 1==e.nodeType?n=e:k(e)&&(n=I.parentElement(e)),n=null===n||"HTML"==n.nodeName&&I.ǃUxS(F(n).documentElement)&&I.ǃUxS(n)?o.createElement("body"):n.cloneNode(!1),n.innerHTML=i,I.ǃUR$(n)}:function(n){var e=re(this),t=e.createElement("body");return t.innerHTML=n,I.ǃUR$(t)},Ue=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],ce=0,ve=1,pe=2,me=3,fe=0,he=1,ge=2,ye=3;B.extend(J.ǃUxM,{compareBoundaryPoints:function(d,e){y(this),c(this.startContainer,e.startContainer);var t=d==me||d==ce?"start":"end",a=d==ve||d==ce?"start":"end",s,n,r,o;return s=this[t+"Container"],n=this[t+"Offset"],r=e[a+"Container"],o=e[a+"Offset"],j(s,n,r,o)},insertNode:function(n){if(y(this),u(n,$),v(this.startContainer),W(n,this.startContainer))throw new M("HIERARCHY_REQUEST_ERR");var e=r(n,this.startContainer,this.startOffset);this.setStartBefore(e)},cloneContents:function(){y(this);var n,e;if(this.collapsed)return re(this).createDocumentFragment();if(this.startContainer===this.endContainer&&k(this.startContainer))return n=this.startContainer.cloneNode(!0),n.data=n.data.slice(this.startOffset,this.endOffset),e=re(this).createDocumentFragment(),e.appendChild(n),e;var t=new d(this,!0);return n=a(t),t.detach(),n},ǃURq:function(){y(this),v(this.startContainer),v(this.endContainer);var r=new d(this,!0),e=r.ǃURH&&ee(r.ǃURH,this)||r.ǃURD&&ee(r.ǃURD,this);return r.detach(),!e},surroundContents:function(n){if(u(n,K),!this.ǃURq())throw new M("INVALID_STATE_ERR");var e=this.extractContents();if(n.hasChildNodes())for(;n.lastChild;)n.removeChild(n.lastChild);r(n,this.startContainer,this.startOffset),n.appendChild(e),this.selectNode(n)},cloneRange:function(){y(this);for(var n=new P(re(this)),t=Ue.length,r;t--;)r=Ue[t],n[r]=this[r];return n},toString:function(){y(this);var r=this.startContainer;if(r===this.endContainer&&k(r))return 3==r.nodeType||4==r.nodeType?r.data.slice(this.startOffset,this.endOffset):"";var i=[],e=new d(this,!0);return oe(e,function(r){(3==r.nodeType||4==r.nodeType)&&i.push(r.data)}),e.detach(),i.join("")},compareNode:function(i){y(this);var e=i.parentNode,d=L(i);if(!e)throw new M("NOT_FOUND_ERR");var n=this.comparePoint(e,d),r=this.comparePoint(e,d+1);return 0>n?0j(r,e,this.startContainer,this.startOffset)?-1:0=o&&0<=i:0>o&&0=j(r,e,this.endContainer,this.endOffset)},ǃURR:function(r){return t(this,r,!1)},ǃURg:function(r){return t(this,r,!0)},ǃURO:function(i){if(this.ǃURR(i)){var e=j(this.startContainer,this.startOffset,i.startContainer,i.startOffset),t=j(this.endContainer,this.endOffset,i.endContainer,i.endOffset),n=this.cloneRange();return-1==e&&n.setStart(i.startContainer,i.startOffset),1==t&&n.setEnd(i.endContainer,i.endOffset),n}return null},ǃURI:function(r){if(this.ǃURg(r)){var e=this.cloneRange();return-1==j(r.startContainer,r.startOffset,this.startContainer,this.startOffset)&&e.setStart(r.startContainer,r.startOffset),1==j(r.endContainer,r.endOffset,this.endContainer,this.endOffset)&&e.setEnd(r.endContainer,r.endOffset),e}throw new M("Ranges do not intersect")},containsNode:function(r,e){return e?this.intersectsNode(r,!1):this.compareNode(r)==ye},ǃURE:function(r){return 0<=this.comparePoint(r,0)&&0>=this.comparePoint(r,V(r))},ǃURC:function(r){var e=this.ǃURO(r);return null!==e&&r.ǃav(e)},ǃURy:function(i){var e=this.cloneRange();e.selectNode(i);var t=e.ǃURb([3]);if(0=t&&T.start<=r&&(this.setStart(u,T.start-t),s=!0),s&&T.end>=t&&T.end<=r&&(this.setEnd(u,T.end-t),l=!0),t=r;else for(i=u.childNodes,o=i.length;o--;)n.push(i[o])},ǃURh:function(){return"DomRange"},ǃav:function(r){return P.ǃURe(this,r)},ǃURN:function(){return S(this)},ǃUxC:function(){return e(this)},detach:function(){}}),A(P,b),B.extend(P,{ǃURK:Ue,ǃURP:d,ǃURw:_,ǃURQ:A,ǃUxC:e,ǃURx:T,ǃURZ:re,ǃURe:function(r,e){return r.startContainer===e.startContainer&&r.startOffset===e.startOffset&&r.endContainer===e.endContainer&&r.endOffset===e.endOffset}}),J.ǃURu=P}),Y.ǃUxG("WrappedRange",["DomRange"],function(T,U){var b=T.ǃUxy,e=T.ǃUxh,o=b.ǃURz,i=T.ǃURu,y=b.ǃUxF,t=b.ǃURL,L=b.ǃUxw,d,n;if(T.ǃUHS.ǃUxJ&&!function(){function o(r){for(var e=a.length,n;e--;)n=a[e],r[n]=r.ǃUgU[n];r.collapsed=r.startContainer===r.endContainer&&r.startOffset===r.endOffset}function r(d,e,t,n,r){var o=d.startContainer!==e||d.startOffset!=t,i=d.endContainer!==n||d.endOffset!=r,T=!d.ǃav(d.ǃUgU);(o||i||T)&&(d.setEnd(n,r),d.setStart(e,t))}var a=i.ǃURK,n,s;d=function(r){if(!r)throw U.ǃUxA("WrappedRange: Range must be specified");this.ǃUgU=r,o(this)},i.ǃURQ(d,r),n=d.prototype,n.selectNode=function(r){this.ǃUgU.selectNode(r),o(this)},n.cloneContents=function(){return this.ǃUgU.cloneContents()},n.surroundContents=function(r){this.ǃUgU.surroundContents(r),o(this)},n.collapse=function(r){this.ǃUgU.collapse(r),o(this)},n.cloneRange=function(){return new d(this.ǃUgU.cloneRange())},n.refresh=function(){o(this)},n.toString=function(){return this.ǃUgU.toString()};var l=document.createTextNode("test");y(document).appendChild(l);var u=document.createRange();u.setStart(l,0),u.setEnd(l,0);try{u.setStart(l,1),n.setStart=function(r,e){this.ǃUgU.setStart(r,e),o(this)},n.setEnd=function(r,e){this.ǃUgU.setEnd(r,e),o(this)},s=function(r){return function(e){this.ǃUgU[r](e),o(this)}}}catch(e){n.setStart=function(r,e){try{this.ǃUgU.setStart(r,e)}catch(t){this.ǃUgU.setEnd(r,e),this.ǃUgU.setStart(r,e)}o(this)},n.setEnd=function(r,e){try{this.ǃUgU.setEnd(r,e)}catch(t){this.ǃUgU.setStart(r,e),this.ǃUgU.setEnd(r,e)}o(this)},s=function(r,e){return function(t){try{this.ǃUgU[r](t)}catch(n){this.ǃUgU[e](t),this.ǃUgU[r](t)}o(this)}}}n.setStartBefore=s("setStartBefore","setEndBefore"),n.setStartAfter=s("setStartAfter","setEndAfter"),n.setEndBefore=s("setEndBefore","setStartBefore"),n.setEndAfter=s("setEndAfter","setStartAfter"),n.selectNodeContents=function(r){this.ǃURY(r,0,b.ǃUxj(r))},u.selectNodeContents(l),u.setEnd(l,3);var c=document.createRange();c.selectNodeContents(l),c.setEnd(l,4),c.setStart(l,2),n.compareBoundaryPoints=-1==u.compareBoundaryPoints(u.START_TO_END,c)&&1==u.compareBoundaryPoints(u.END_TO_START,c)?function(r,e){return e=e.ǃUgU||e,r==e.START_TO_END?r=e.END_TO_START:r==e.END_TO_START&&(r=e.START_TO_END),this.ǃUgU.compareBoundaryPoints(r,e)}:function(r,e){return this.ǃUgU.compareBoundaryPoints(r,e.ǃUgU||e)};var p=document.createElement("div");p.innerHTML="123";var m=p.firstChild,v=y(document);v.appendChild(p),u.setStart(m,1),u.setEnd(m,2),u.deleteContents(),"13"==m.data&&(n.deleteContents=function(){this.ǃUgU.deleteContents(),o(this)},n.extractContents=function(){var r=this.ǃUgU.extractContents();return o(this),r}),v.removeChild(p),v=null,e.ǃUxi(u,"createContextualFragment")&&(n.createContextualFragment=function(r){return this.ǃUgU.createContextualFragment(r)}),y(document).removeChild(l),n.ǃURh=function(){return"WrappedRange"},T.ǃUgr=d,T.ǃUgT=function(r){return r=t(r,U,"createNativeRange"),r.createRange()}}(),T.ǃUHS.ǃUxL){var a=function(o){var e=o.parentElement(),t=o.duplicate();t.collapse(!0);var n=t.parentElement();t=o.duplicate(),t.collapse(!1);var r=t.parentElement(),i=n==r?n:b.ǃUxe(n,r);return i==e?i:b.ǃUxe(e,i)},s=function(r){return 0==r.compareEndPoints("StartToEnd",r)},l=function(a,e,t,T,r){var i=a.duplicate();i.collapse(t);var s=i.parentElement();if(b.ǃUxK(e,s)||(s=e),!s.canHaveHTML){var U=new o(s.parentNode,b.ǃUxo(s));return{ǃUgv:U,ǃUgJ:{ǃUgL:U.offset,ǃUgs:U.node}}}var f=b.ǃURU(s).createElement("span");f.parentNode&&b.removeNode(f);for(var u=t?"StartToStart":"StartToEnd",k=r&&r.ǃUgs==s?r.ǃUgL:0,v=s.childNodes.length,x=v,$=x,q,l,h,g,C;;){if($==v?s.appendChild(f):s.insertBefore(f,s.childNodes[$]),i.moveToElementText(f),q=i.compareEndPoints(u,a),0==q||k==x)break;if(-1==q){if(x==k+1)break;k=$}else x=x==k+1?k:$;$=Math.floor((k+x)/2),s.removeChild(f)}if(C=f.nextSibling,-1==q&&C&&L(C)){i.setEndPoint(t?"EndToStart":"EndToEnd",a);var m;if(/[\r\n]/.test(C.data)){var S=i.duplicate(),y=S.text.replace(/\r\n/g,"\r").length;for(m=S.moveStart("character",y);-1==(q=S.compareEndPoints("StartToEnd",S));)m++,S.moveStart("character",1)}else m=i.text.length;g=new o(C,m)}else l=(T||!t)&&f.previousSibling,h=(T||t)&&f.nextSibling,g=h&&L(h)?new o(h,0):l&&L(l)?new o(l,l.data.length):new o(s,b.ǃUxo(f));return b.removeNode(f),{ǃUgv:g,ǃUgJ:{ǃUgL:$,ǃUgs:s}}},u=function(o,e){var T=o.offset,s=b.ǃURU(o.node),d=y(s).createTextRange(),u=L(o.node),l,n,r,i;return u?(l=o.node,n=l.parentNode):(i=o.node.childNodes,l=Te;++e)if(!O.ǃUxN(r[0],r[e]))return!1;return!0}function u(r){var e=r.ǃURb();if(!t(e))throw re.ǃUxA("getSingleElementFromRange: range "+r.ǃUxC()+" did not consist of a single element");return e[0]}function l(r){return!!r&&"undefined"!=typeof r.text}function c(r,e){var t=new b(e);r.ǃUgz=[t],a(r,t,!1),r.rangeCount=1,r.isCollapsed=t.collapsed}function f(e){if(e.ǃUgz.length=0,"None"==e.ǃUgF.type)s(e);else{var t=e.ǃUgF.createRange();if(l(t))c(e,t);else{e.rangeCount=t.length;for(var n=N(t.item(0)),o=0,i;od;++d)i.add(n.item(d));try{i.add(r)}catch(e){throw re.ǃUxA("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}i.select(),f(t)}function p(r,e,t){this.ǃUgf=r,this.ǃUgF=e,this.ǃUgz=[],this.ǃUg$=t,this.refresh()}function m(r){r.ǃUg$=r.anchorNode=r.focusNode=r.ǃUgz=null,r.rangeCount=r.anchorOffset=r.focusOffset=0,r.ǃUgm=!0}function v(i,e){for(var t=oe.length,o,n;t--;)if(o=oe[t],n=o.selection,"deleteAll"==e)m(n);else if(o.ǃUg$==i)return"delete"==e?(oe.splice(t,1),!0):n;return"deleteAll"==e&&(oe.length=0),null}function h(t,e){for(var n=N(e[0].startContainer),o=k(n).createControlRange(),i=0,d=e.length,a;d>i;++i){a=u(e[i]);try{o.add(a)}catch(e){throw re.ǃUxA("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}o.select(),f(t)}function g(r,e){if(r.ǃUg$.document!=N(e))throw new P("WRONG_DOCUMENT_ERR")}function E(e){return function(t,n){var r;this.rangeCount?(r=this.getRangeAt(0),r["set"+(e?"Start":"End")](t,n)):(r=ee.createRange(this.ǃUg$.document),r.ǃURY(t,n)),this.ǃUgh(r,this.ǃUgn())}}function S(d){var e=[],t=new I(d.anchorNode,d.anchorOffset),n=new I(d.focusNode,d.focusOffset),r="function"==typeof d.ǃURh?d.ǃURh():"Selection";if("undefined"!=typeof d.rangeCount)for(var o=0,i=d.rangeCount;i>o;++o)e[o]=x.ǃUxC(d.getRangeAt(o));return"["+r+"(Ranges: "+e.join(", ")+")(anchor: "+t.ǃUxC()+", focus: "+n.ǃUxC()+"]"}ee.ǃHI.ǃUgV=!0;var y="boolean",C="number",O=ee.ǃUxy,_=ee.ǃUxh,A=_.ǃUxi,x=ee.ǃURu,b=ee.ǃUgr,P=ee.DOMException,I=O.ǃURz,R=ee.ǃUHS,B="Control",N=O.ǃURU,k=O.ǃUxF,L=x.ǃURe,W=A(window,"getSelection"),M=_.ǃUx_(document,"selection"),j,w;R.ǃUgp=W,R.ǃUgB=M;var T=M&&(!W||ee.ǃHI.ǃUxn);if(T)j=r,ee.ǃUgd=function(r){var e=ne(r,"isSelectionValid").document,t=e.selection;return"None"!=t.type||N(t.createRange().parentElement())==e};else{if(!W)return re.ǃUxB("Neither document.selection or window.getSelection() detected."),!1;j=e,ee.ǃUgd=function(){return!0}}ee.ǃUgc=j;var D=j();if(!D)return re.ǃUxB("Native selection was null (possibly issue 138?)"),!1;var H=ee.ǃUgT(document),V=k(document),q=_.ǃUxf(D,["anchorNode","focusNode","anchorOffset","focusOffset"]);R.ǃUgH=q;var ie=A(D,"extend");R.ǃUgD=ie;var Q=typeof D.rangeCount==C;R.ǃUgY=Q;var G=!1,X=!0,Z=ie?function(e,t){var n=x.ǃURZ(t),r=ee.createRange(n);r.ǃURk(t.endContainer,t.endOffset),e.addRange(d(r)),e.extend(t.startContainer,t.startOffset)}:null;_.ǃUxt(D,["addRange","getRangeAt","removeAllRanges"])&&typeof D.rangeCount==C&&R.ǃUxJ&&!function(){var e=window.getSelection();if(e){for(var t=e.rangeCount,n=1T;++T)a[T]=e.getRangeAt(T);var s=O.ǃURt(document,"",!1),U=s.appendChild(document.createTextNode("\xA0\xA0\xA0")),d=document.createRange();if(d.setStart(U,1),d.collapse(!0),e.removeAllRanges(),e.addRange(d),X=1==e.rangeCount,e.removeAllRanges(),!n){var c=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(c&&36<=parseInt(c[1]))G=!1;else{var u=d.cloneRange();d.setStart(U,0),u.setEnd(U,3),u.setStart(U,2),e.addRange(d),e.addRange(u),G=2==e.rangeCount}}for(O.removeNode(s),e.removeAllRanges(),T=0;t>T;++T)0==T&&o?Z?Z(e,a[T]):(ee.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),e.addRange(a[T])):e.addRange(a[T])}}(),R.ǃUga=G,R.ǃUgq=X;var $=!1,K;V&&A(V,"createControlRange")&&(K=V.createControlRange(),_.ǃUxf(K,["item","add"])&&($=!0)),R.ǃUgA=$,w=q?function(r){return r.anchorNode===r.focusNode&&r.anchorOffset===r.focusOffset}:function(r){return!!r.rangeCount&&r.getRangeAt(r.rangeCount-1).collapsed};var J;A(D,"getRangeAt")?J=function(r,e){try{return r.getRangeAt(e)}catch(e){return null}}:q&&(J=function(e){var t=N(e.anchorNode),n=ee.createRange(t);return n.ǃURY(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset),n.collapsed!==this.isCollapsed&&n.ǃURY(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset),n}),p.prototype=ee.ǃUxx;var oe=[],de=function(i){if(i&&i instanceof p)return i.refresh(),i;i=ne(i,"getNativeSelection");var d=v(i),a=j(i),n=M?r(i):null;return d?(d.ǃUgf=a,d.ǃUgF=n,d.refresh()):(d=new p(a,n,i),oe.push({ǃUg$:i,selection:d})),d};ee.getSelection=de,_.ǃUxH(ee,"getIframeSelection","getSelection");var ae=p.prototype;if(!T&&q&&_.ǃUxt(D,["removeAllRanges","addRange"])){ae.removeAllRanges=function(){this.ǃUgf.removeAllRanges(),s(this)};var se=function(r,e){Z(r.ǃUgf,e),r.refresh()};ae.addRange=Q?function(e,t){if($&&M&&this.ǃUgF.type==B)n(this,e);else if(te(t)&&ie)se(this,e);else{var r;G?r=this.rangeCount:(this.removeAllRanges(),r=0);var o=d(e).cloneRange();try{this.ǃUgf.addRange(o)}catch(e){}if(this.rangeCount=this.ǃUgf.rangeCount,this.rangeCount==r+1){if(ee.ǃHI.ǃUgV){var i=J(this.ǃUgf,this.rangeCount-1);i&&!L(i,e)&&(e=new b(i))}this.ǃUgz[this.rangeCount-1]=e,a(this,e,ue(this.ǃUgf)),this.isCollapsed=w(this)}else this.refresh()}}:function(r,e){te(e)&&ie?se(this,r):(this.ǃUgf.addRange(d(r)),this.refresh())},ae.ǃUgW=function(r){if($&&M&&1e;++e)this.addRange(r[e])}}}else{if(!(A(D,"empty")&&A(H,"select")&&$&&T))return re.ǃUxB("No means of selecting a Range or TextRange was found"),!1;ae.removeAllRanges=function(){try{if(this.ǃUgF.empty(),"None"!=this.ǃUgF.type){var r;if(this.anchorNode)r=N(this.anchorNode);else if(this.ǃUgF.type==B){var e=this.ǃUgF.createRange();e.length&&(r=N(e.item(0)))}if(r){var t=k(r).createTextRange();t.select(),this.ǃUgF.empty()}}}catch(e){}s(this)},ae.addRange=function(e){this.ǃUgF.type==B?n(this,e):(ee.ǃUgl.ǃUgi(e).select(),this.ǃUgz[0]=e,this.rangeCount=1,this.isCollapsed=this.ǃUgz[0].collapsed,a(this,e,!1))},ae.ǃUgW=function(r){this.removeAllRanges();var e=r.length;1r||r>=this.rangeCount)throw new P("INDEX_SIZE_ERR");return this.ǃUgz[r].cloneRange()};var Te;if(T)Te=function(e){var r;ee.ǃUgd(e.ǃUg$)?r=e.ǃUgF.createRange():(r=k(e.ǃUg$.document).createTextRange(),r.collapse(!0)),e.ǃUgF.type==B?f(e):l(r)?c(e,r):s(e)};else if(A(D,"getRangeAt")&&typeof D.rangeCount==C)Te=function(e){if($&&M&&e.ǃUgF.type==B)f(e);else if(e.ǃUgz.length=e.rangeCount=e.ǃUgf.rangeCount,e.rangeCount){for(var t=0,n=e.rangeCount;n>t;++t)e.ǃUgz[t]=new ee.ǃUgr(e.ǃUgf.getRangeAt(t));a(e,e.ǃUgz[e.rangeCount-1],ue(e.ǃUgf)),e.isCollapsed=w(e)}else s(e)};else{if(!q||typeof D.isCollapsed!=y||typeof H.collapsed!=y||!R.ǃUxJ)return re.ǃUxB("No means of obtaining a Range or TextRange from the user's selection was found"),!1;Te=function(r){var e=r.ǃUgf,n;e.anchorNode?(n=J(e,0),r.ǃUgz=[n],r.rangeCount=1,o(r),r.isCollapsed=w(r)):s(r)}}ae.refresh=function(i){var e=i?this.ǃUgz.slice(0):null,t=this.anchorNode,n=this.anchorOffset;if(Te(this),i){var r=e.length;if(r!=this.ǃUgz.length)return!0;if(this.anchorNode!=t||this.anchorOffset!=n)return!0;for(;r--;)if(!L(e[r],this.ǃUgz[r]))return!0;return!1}};var le=function(i,e){var t=i.ǃUgG();i.removeAllRanges();for(var n=0,r=t.length;r>n;++n)L(e,t[n])||i.addRange(t[n]);i.rangeCount||s(i)};ae.removeRange=$&&M?function(d){if(this.ǃUgF.type==B){for(var e=this.ǃUgF.createRange(),n=u(d),r=N(e.item(0)),o=k(r).createControlRange(),i=!1,a=0,s=e.length,T;s>a;++a)T=e.item(a),T!==n||i?o.add(e.item(a)):i=!0;o.select(),f(this)}else le(this,d)}:function(r){le(this,r)};var ue;!T&&q&&R.ǃUxJ?(ue=i,ae.ǃUgn=function(){return ue(this)}):ue=ae.ǃUgn=function(){return!1},ae.ǃUgk=ae.ǃUgn,ae.toString=function(){for(var r=[],e=0,t=this.rangeCount;t>e;++e)r[e]=""+this.ǃUgz[e];return r.join("")},ae.collapse=function(e,t){g(this,e);var n=ee.createRange(e);n.ǃURk(e,t),this.ǃUgh(n),this.isCollapsed=!0},ae.collapseToStart=function(){if(!this.rangeCount)throw new P("INVALID_STATE_ERR");var r=this.ǃUgz[0];this.collapse(r.startContainer,r.startOffset)},ae.collapseToEnd=function(){if(!this.rangeCount)throw new P("INVALID_STATE_ERR");var r=this.ǃUgz[this.rangeCount-1];this.collapse(r.endContainer,r.endOffset)},ae.selectAllChildren=function(e){g(this,e);var r=ee.createRange(e);r.selectNodeContents(e),this.ǃUgh(r)},ae.deleteFromDocument=function(){if($&&M&&this.ǃUgF.type==B){for(var i=this.ǃUgF.createRange(),t;i.length;)t=i.item(0),i.remove(t),O.removeNode(t);this.refresh()}else if(this.rangeCount){var e=this.ǃUgG();if(e.length){this.removeAllRanges();for(var n=0,r=e.length;r>n;++n)e[n].deleteContents();this.addRange(e[r-1])}}},ae.ǃUgM=function(i,e){for(var t=0,n=this.ǃUgz.length;n>t;++t)if(i(this.getRangeAt(t)))return e},ae.ǃUgG=function(){var r=[];return this.ǃUgM(function(e){r.push(e)}),r},ae.ǃUgh=function(r,e){this.removeAllRanges(),this.addRange(r,e)},ae.ǃUgx=function(i,e){var t=[];return this.ǃUgM(function(n){t.push(n[i].apply(n,e||[]))}),t},ae.setStart=E(!0),ae.setEnd=E(!1),ee.ǃUxM.select=function(r){de(this.ǃURU()).ǃUgh(this,r)},ae.ǃUgR=function(r){var e=[],t=this.ǃUgn();this.ǃUgM(function(t){r(t),e.push(t)}),this.removeAllRanges(),t&&1==e.length?this.addRange(e[0],"backward"):this.ǃUgW(e)},ae.containsNode=function(r,e){return this.ǃUgM(function(t){return t.containsNode(r,e)},!0)||!1},ae.getBookmark=function(r){return{ǃUgg:this.ǃUgn(),ǃUgO:this.ǃUgx("getBookmark",[r])}},ae.moveToBookmark=function(e){for(var t=[],o=0,i,n;i=e.ǃUgO[o++];)n=ee.createRange(this.ǃUg$),n.moveToBookmark(i),t.push(n);e.ǃUgg?this.ǃUgh(t[0],"backward"):this.ǃUgW(t)},ae.ǃUgI=function(){return{ǃUgg:this.ǃUgn(),ǃUgE:this.ǃUgx("cloneRange")}},ae.ǃUgC=function(r){this.removeAllRanges();for(var e=0,n;n=r.ǃUgE[e];++e)this.addRange(n,r.ǃUgg&&0==e)},ae.ǃURx=function(){var r=[];return this.ǃUgM(function(e){r.push(x.ǃURx(e))}),r.join("")},R.ǃUxL&&(ae.ǃUgy=function(){var e;if(e=this.ǃUgF){var t=e.createRange();if(l(t))return t;throw re.ǃUxA("getNativeTextRange: selection is a control selection")}if(0s&&t(s,r,!1),e.ǃUge)for(;Q.test(d[i]);)++i;t(r,i,!0),s=i}return ss;++s)t[s].ǃUgK=a;return a}function ee(r,e,t){for(var n=t(r,e),o=[],d=0,a;a=n[d++];)o.push(l(r,a));return o}function re(r){var e=r||"",i="string"==typeof e?e.split(""):e;return i.sort(function(r,e){return r.charCodeAt(0)-e.charCodeAt(0)}),i.join("").replace(/(.)\1+/g,"$1")}function r(r){var e,t;return r?(e=r.language||X,t={},D(t,ae[e]||ae[X]),D(t,r),t):ae[X]}function te(i,e){var t=K(i,e);return e.hasOwnProperty("wordOptions")&&(t.wordOptions=r(t.wordOptions)),e.hasOwnProperty("characterOptions")&&(t.characterOptions=K(t.characterOptions,oe)),t}function i(i,e){var t=Ue(i,"display",e),n=i.tagName.toLowerCase();return"block"==t&&ce&&ve.hasOwnProperty(n)?ve[n]:t}function o(o){for(var e=s(o),t=0,n=e.length;n>t;++t)if(1==e[t].nodeType&&"none"==i(e[t]))return!0;return!1}function a(r){var e;return 3==r.nodeType&&(e=r.parentNode)&&"hidden"==Ue(e,"visibility")}function d(r){for(var e=[];r.parentNode;)e.unshift(r.parentNode),r=r.parentNode;return e}function s(r){return d(r).concat([r])}function u(r){for(;r&&!r.nextSibling;)r=r.parentNode;return r?r.nextSibling:null}function c(r,e){return!e&&r.hasChildNodes()?r.firstChild:u(r)}function p(r){var e=r.previousSibling;if(e){for(r=e;r.hasChildNodes();)r=r.lastChild;return r}var t=r.parentNode;return t&&1==t.nodeType?t:null}function f(i){if(!i||3!=i.nodeType)return!1;var o=i.data;if(""===o)return!0;var t=i.parentNode;if(!t||1!=t.nodeType)return!1;var d=Ue(i.parentNode,"whiteSpace");return /^[\t\n\r ]+$/.test(o)&&/^(normal|nowrap)$/.test(d)||/^[\t\r ]+$/.test(o)&&"pre-line"==d}function h(r){if(""===r.data)return!0;if(!f(r))return!1;var e=r.parentNode;return!e||!!o(r)}function g(r){var e=r.nodeType;return 7==e||8==e||o(r)||/^(script|style)$/i.test(r.nodeName)||a(r)||h(r)}function y(r,e){var t=r.nodeType;return 7==t||8==t||1==t&&"none"==i(r,e)}function m(){this.ǃUWb={}}function x(d,e,t){return function(n){var r=this.cache;if(r.hasOwnProperty(d))return pe++,r[d];me++;var i=e.call(this,t?this[t]:this,n);return r[d]=i,i}}function T(r,e){this.node=r,this.session=e,this.cache=new m,this.positions=new m}function C(r,e){this.offset=e,this.ǃUgP=r,this.node=r.node,this.session=r.session,this.cache=new m}function b(){return E(),Se=new qe}function P(){return Se||b()}function E(){Se&&Se.detach(),Se=null}function R(t,d,n,r){function i(){var r=null;return d?(r=o,T||(o=o.ǃUgw(),T=!o||n&&o.ǃav(n))):T||(r=o=o.ǃUgQ(),T=!o||n&&o.ǃav(n)),T&&(o=null),r}n&&(d?g(n.node)&&(n=t.ǃUgw()):g(n.node)&&(n=n.ǃUgQ()));var o=t,T=!1,l=!1,u;return{next:function(){if(l)return l=!1,u;for(var n,e;n=i();)if(e=n.ǃUgZ(r))return u=n,n;return null},ǃUgu:function(){if(!u)throw e.ǃUxA("createCharacterIterator: cannot rewind. Only one position can be rewound.");l=!0},ǃUOU:function(){t=n=null}}}function O(i,e,T){function n(d){for(var e=[],a=d?U:o,i=!1,s=!1,T,t;T=a.next();){if(t=T.ǃUOr,J.test(t))s&&(s=!1,i=!0);else{if(i){a.ǃUgu();break}s=!0}e.push(T)}return e}var U=R(i,!1,null,e),o=R(i,!0,null,e),r=T.ǃUOT,t=n(!0),a=n(!1).reverse(),s=ee(a.concat(t),T,r),d=t.length?s.slice(Ce(s,t[0].ǃUgK)):[],l=a.length?s.slice(0,Ce(s,a.pop().ǃUgK)+1):[];return{ǃUOv:function(){for(var i,e;1==d.length&&!(i=d[0]).ǃUgo&&0<(e=n(!0)).length;)d=ee(i.ǃUgN.concat(e),T,r);return d.shift()},ǃUOJ:function(){for(var i,e;1==l.length&&!(i=l[0]).ǃUgo&&0<(e=n(!1)).length;)l=ee(e.reverse().concat(i.ǃUgN),T,r);return l.pop()},ǃUOU:function(){U.ǃUOU(),o.ǃUOU(),d=l=null}}}function k(T,e,t,n,r){var i=0,U=T,v=Math.abs(t),l,o,a,s;if(0!==t){var c=0>t;switch(e){case q:for(o=R(T,c,null,n);(l=o.next())&&v>i;)++i,U=l;a=l,o.ǃUOU();break;case M:for(var m=O(T,n,r),p=c?m.ǃUOJ:m.ǃUOv;(s=p())&&v>i;)s.ǃUgo&&(++i,U=c?s.ǃUgN[0]:s.ǃUgN[s.ǃUgN.length-1]);break;default:throw new Error("movePositionBy: unit '"+e+"' not implemented");}c?(U=U.ǃUgw(),i=-i):U&&U.ǃUOL&&!U.ǃUOs&&(e==M&&(o=R(T,!1,null,n),a=o.next(),o.ǃUOU()),a&&(U=a.ǃUgw()))}return{position:U,ǃUOX:i}}function L(d,e,t,n){var T=d.ǃUOi(e,!0),i=d.ǃUOi(e,!1),o=n?i:T,a=n?T:i;return R(o,!!n,a,t)}function I(d,e,t){for(var n=[],i=L(d,e,t),o;o=i.next();)n.push(o);return i.ǃUOU(),n}function A(e,t,n){var o=w.createRange(e.node);return o.ǃURY(e.node,e.offset,t.node,t.offset),!o.expand("word",{wordOptions:n})}function W(T,e,t,n,U){function r(i,e){var t=m[i].ǃUgw(),d=m[e-1],a=!U.ǃUO_||A(t,d,U.wordOptions);return{ǃUOl:t,ǃUOt:d,valid:a}}for(var i=Z(U.direction),o=R(T,i,T.session.ǃUOi(n,i),U.characterOptions),p="",m=[],f=null,v,a,s,c,u,d;v=o.next();)if(a=v.ǃUOr,t||U.ǃUO$||(a=a.toLowerCase()),i?(m.unshift(v),p=a+p):(m.push(v),p+=a),t){if(u=e.exec(p))if(s=u.index,c=s+u[0].length,!d)d=!0;else if(!i&&c1
",!0),t=e.firstChild,n=w.getSelection();n.collapse(t.lastChild,2),n.setStart(t.firstChild,0),H=1==(""+n).length,e.innerHTML="1
",n.collapse(e,2),n.setStart(e.firstChild,0),ne=1==(""+n).length,e.innerHTML="1 1
",n.collapse(e,2),n.setStart(e.firstChild,0),ie=1==(""+n).length,j.removeNode(e),n.removeAllRanges()}();var oe={ǃUOf:!0,ǃUOz:!0,ǃUOF:!0,ǃUOm:!0,ǃUOh:""},de={ǃUOf:!!0,ǃUOz:!ne,ǃUOF:!ie,ǃUOm:!0},ae={ǃUOn:{ǃUgj:/[a-z0-9]+('[a-z0-9]+)*/gi,ǃUge:!1,ǃUOT:t}},se={ǃUO$:!1,ǃUOV:null,ǃUO_:!1,wrap:!1,direction:"forward",wordOptions:null,characterOptions:null},Te={wordOptions:null,characterOptions:null},le={wordOptions:null,characterOptions:null,trim:!1,trimStart:!0,trimEnd:!0},ue={wordOptions:null,characterOptions:null,direction:"forward"},Ue=j.ǃURl,ce;!function(){var r=document.createElement("table"),e=z(document);e.appendChild(r),ce="block"==Ue(r,"display"),e.removeChild(r)}();var ve={table:"table",caption:"table-caption",ǃUOp:"table-column-group",ǃUOB:"table-column",ǃUOd:"table-header-group",ǃUOc:"table-row-group",ǃUOH:"table-footer-group",ǃUOD:"table-row",ǃUOY:"table-cell",ǃUOa:"table-cell"};m.prototype={get:function(r){return this.ǃUWb.hasOwnProperty(r)?this.ǃUWb[r]:null},set:function(r,e){return this.ǃUWb[r]=e}};var pe=0,me=0,fe={ǃUOq:function(r){var e=this.positions;return e.get(r)||e.set(r,new C(this,r))},toString:function(){return"[NodeWrapper("+j.ǃUR_(this.node)+")]"}};T.prototype=fe;var he="EMPTY",ge="NON_SPACE",ye="UNCOLLAPSIBLE_SPACE",be="COLLAPSIBLE_SPACE",Le="TRAILING_SPACE_BEFORE_BLOCK",Ee="TRAILING_SPACE_IN_BLOCK",ke="TRAILING_SPACE_BEFORE_BR",we="PRE_LINE_TRAILING_SPACE_BEFORE_LINE_BREAK",xe="INCLUDED_TRAILING_LINE_BREAK_AFTER_BR";D(fe,{ǃUxw:x("isCharacterDataNode",j.ǃUxw,"node"),ǃUxo:x("nodeIndex",j.ǃUxo,"node"),ǃUGy:x("nodeLength",j.ǃUxj,"node"),ǃUOA:x("containsPositions",function(r){return j.ǃUxw(r)||!/^(area|base|basefont|br|col|frame|hr|img|input|isindex|link|meta|param)$/i.test(r.nodeName)},"node"),ǃUOW:x("isWhitespace",f,"node"),ǃUOG:x("isCollapsedWhitespace",h,"node"),ǃUOk:x("computedDisplay",i,"node"),isCollapsed:x("collapsed",g,"node"),ǃUOM:x("ignored",y,"node"),next:x("nextPos",c,"node"),ǃUOx:x("previous",p,"node"),ǃUOR:x("textNodeInfo",function(o){var d=null,a=!1,s=Ue(o.parentNode,"whiteSpace"),r="pre-line"==s;return r?(d=Y,a=!0):("normal"==s||"nowrap"==s)&&(d=G,a=!0),{node:o,text:o.data,ǃUOg:d,ǃUOO:a,ǃUOI:r}},"node"),ǃUOE:x("hasInnerText",function(d,e){for(var t=this.session,n=t.ǃUOq(d.parentNode,this.ǃUxo()+1),r=t.ǃUOq(d,0),i=e?n:r,o=e?r:n;i!==o;){if(i.ǃUOC(),i.ǃUOy())return!0;i=e?i.ǃUgw():i.ǃUgQ()}return!1},"node"),ǃUOb:x("isRenderedBlock",function(i){for(var e=i.getElementsByTagName("br"),t=0,n=e.length;n>t;++t)if(!g(e[t]))return!0;return this.ǃUOE()},"node"),ǃUOS:x("trailingSpace",function(r){if("br"==r.tagName.toLowerCase())return"";switch(this.ǃUOk()){case"inline":for(var e=r.lastChild;e;){if(!y(e))return 1==e.nodeType?this.session.ǃUOo(e).ǃUOS():"";e=e.previousSibling}break;case"inline-block":case"inline-table":case"none":case"table-column":case"table-column-group":break;case"table-cell":return"\t";default:return this.ǃUOb(!0)?"\n":"";}return""},"node"),ǃUOj:x("leadingSpace",function(){switch(this.ǃUOk()){case"inline":case"inline-block":case"inline-table":case"none":case"table-column":case"table-column-group":case"table-cell":break;default:return this.ǃUOb(!1)?"\n":"";}return""},"node")});var $e={ǃUOr:"",ǃUOe:he,ǃUON:!1,ǃUOC:function(){var T=this;if(!T.ǃUOK){var e=T.node,t=T.offset,n="",U=he,i=!1;if(0t;++t)if(i[t]===e)return t;return-1};D(w.ǃUxM,{moveStart:B(!0,!1),moveEnd:B(!1,!1),move:B(!0,!0),trimStart:F(!0),trimEnd:F(!1),trim:_(function(i,e){var t=this.trimStart(e),n=this.trimEnd(e);return t||n}),expand:_(function(s,e,t){var n=!1;t=te(t,le);var r=t.characterOptions;if(e||(e=q),e==M){var i=t.wordOptions,T=s.ǃUOi(this,!0),u=s.ǃUOi(this,!1),d=O(T,r,i),l=d.ǃUOv(),U=l.ǃUgN[0].ǃUgw(),c,o;if(this.collapsed)c=l;else{var a=O(u,r,i);c=a.ǃUOJ()}return o=c.ǃUgN[c.ǃUgN.length-1],U.ǃav(T)||(this.setStart(U.node,U.offset),n=!0),o&&!o.ǃav(u)&&(this.setEnd(o.node,o.offset),n=!0),t.trim&&(t.trimStart&&(n=this.trimStart(r)||n),t.trimEnd&&(n=this.trimEnd(r)||n)),n}return this.moveEnd(q,1,t)}),text:_(function(r,e){return this.collapsed?"":I(r,this,K(e,oe)).join("")}),ǃUIL:_(function(d,e,t,n,r){var a={characterOptions:r};e||(e=z(this.ǃURU())),this.selectNodeContents(e),this.collapse(!0),this.moveStart("character",t,a),this.collapse(!0),this.moveEnd("character",n-t,a)}),ǃUIs:_(function(d,e,t){e||(e=z(this.ǃURU()));var n=e.parentNode,o=j.ǃUxo(e),a=-1==j.ǃURX(this.startContainer,this.endContainer,n,o),s=this.cloneRange(),T,l;return a?(s.ǃURY(this.startContainer,this.startOffset,n,o),T=-s.text(t).length):(s.ǃURY(n,o,this.startContainer,this.startOffset),T=s.text(t).length),l=T+this.text(t).length,{start:T,end:l}}),findText:_(function(e,t,n){n=te(n,se),n.ǃUO_&&(n.wordOptions.ǃUge=!1);var r=Z(n.direction),s=n.ǃUOV;s||(s=w.createRange(),s.selectNodeContents(this.ǃURU()));var o=t,T=!1;"string"==typeof o?n.ǃUO$||(o=o.toLowerCase()):T=!0;var U=e.ǃUOi(this,!r),u=s.comparePoint(U.node,U.offset);-1===u?U=e.ǃUOi(s,!0):1===u&&(U=e.ǃUOi(s,!1));for(var d=U,c=!1,v;;)if(v=W(d,o,T,s,n)){if(v.valid)return this.ǃURY(v.ǃUOl.node,v.ǃUOl.offset,v.ǃUOt.node,v.ǃUOt.offset),!0;d=r?v.ǃUOl:v.ǃUOt}else{if(!n.wrap||c)return!1;s=s.cloneRange(),d=e.ǃUOi(s,!r),s.ǃURa(U.node,U.offset,r),c=!0}}),ǃUIX:function(r){if(this.deleteContents(),r){var e=this.createContextualFragment(r),t=e.lastChild;this.insertNode(e),this.ǃURo(t)}}}),D(w.ǃUxx,{expand:_(function(r,i,t){this.ǃUgR(function(r){r.expand(i,t)})}),move:_(function(d,e,t,n){var r=0;if(this.focusNode){this.collapse(this.focusNode,this.focusOffset);var i=this.getRangeAt(0);n||(n={}),n.characterOptions=K(n.characterOptions,de),r=i.move(e,t,n),this.ǃUgh(i)}return r}),trimStart:V("trimStart"),trimEnd:V("trimEnd"),trim:V("trim"),ǃUIL:_(function(e,t,n,r,i,o){var d=w.createRange(t);d.ǃUIL(t,n,r,o),this.ǃUgh(d,i)}),ǃUIi:_(function(d,e,t){for(var T=this.ǃUgG(),r=T.length,i=[],o=1==r&&this.ǃUgn(),l=0,s=T.length;s>l;++l)i[l]={ǃUI_:T[l].ǃUIs(e,t),ǃUgg:o,characterOptions:t};return i}),ǃUIl:_(function(e,t,n){this.removeAllRanges();for(var r=0,d=n.length,s,i,o;d>r;++r)i=n[r],o=i.ǃUI_,s=w.createRange(t),s.ǃUIL(t,o.start,o.end,i.characterOptions),this.addRange(s,i.ǃUgg)}),text:_(function(o,e){for(var t=[],n=0,r=this.rangeCount;r>n;++n)t[n]=this.getRangeAt(n).text(e);return t.join("")})}),w.innerText=function(e,t){var n=w.createRange(e);n.selectNodeContents(e);var r=n.text(t);return r},w.ǃUIt=function(d,e,t){var n=P();t=te(t,ue);var r=n.ǃUOq(d,e),i=O(r,t.characterOptions,t.wordOptions),o=Z(t.direction);return{next:function(){return o?i.ǃUOJ():i.ǃUOv()},ǃUOU:function(){i.ǃUOU(),this.next=function(){}}}},w.ǃUI$=function(r){var e=P();r(e),E()},w.ǃUI$.ǃUIf=_,w.ǃUgX={ǃUIz:function(r){return r&&(1==r.nodeType&&!/^(inline(-block|-table)?|none)$/.test(i(r))||9==r.nodeType||11==r.nodeType)},ǃUIF:h,ǃUIm:_(function(r,e,t){return r.ǃUOq(e,t)})}}),r},this),!function(r,e){"function"==typeof ǃHT&&ǃHT.ǃHv?ǃHT(["./rangy-core"],r):"undefined"!=typeof ǃHr&&"object"==typeof exports?ǃHr.exports=r(require("rangy")):r(e.rangy)}(function(r){return r.ǃUxW("ClassApplier",["WrappedSelection"],function(i,e){function _(r,e){for(var t in r)if(r.hasOwnProperty(t)&&!1===e(t,r[t]))return!1;return!0}function j(r){return r.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function V(r,n){return!!r&&new RegExp("(?:^|\\s)"+n+"(?:\\s|$)").test(r)}function s(r,e){if("object"==typeof r.classList)return r.classList.contains(e);var t="string"==typeof r.className,n=t?r.className:r.getAttribute("class");return V(n,e)}function ee(r,e){if("object"==typeof r.classList)r.classList.add(e);else{var t="string"==typeof r.className,n=t?r.className:r.getAttribute("class");n?V(n,e)||(n+=" "+e):n=e,t?r.className=n:r.setAttribute("class",n)}}function r(r){var e="string"==typeof r.className;return e?r.className:r.getAttribute("class")}function re(r){return r&&r.split(/\s+/).sort().join(" ")}function n(t){return re(r(t))}function u(r,e){return n(r)==n(e)}function f(o,e){for(var t=e.split(/\s+/),n=0,r=t.length;r>n;++n)if(!s(o,j(t[n])))return!1;return!0}function te(r){var e=r.parentNode;return e&&1==e.nodeType&&!/^(textarea|style|script|select|iframe)$/i.test(e.nodeName)}function d(d,e,t,n,s){var r=d.node,i=d.offset,o=r,a=i;r==n&&i>s&&++a,r!=e||i!=t&&i!=t+1||(o=n,a+=s-t),r==e&&i>t+1&&--a,d.node=o,d.offset=a}function t(r,e,t){r.node==e&&r.offset>t&&--r.offset}function m(o,a,t,e){-1==t&&(t=a.childNodes.length);var n=o.parentNode,r=H.ǃUxo(o);D(e,function(i){d(i,n,r,a,t)}),a.childNodes.length==t?a.appendChild(o):a.insertBefore(o,a.childNodes[t])}function h(r,e){var i=r.parentNode,n=H.ǃUxo(r);D(e,function(r){t(r,i,n)}),H.removeNode(r)}function g(d,e,t,n,a){for(var r=[],o;o=d.firstChild;)m(o,e,t++,a),r.push(o);return n&&h(d,a),r}function v(r,e){return g(r,r.parentNode,H.ǃUxo(r),!0,e)}function N(i,e){var t=i.cloneRange();t.selectNodeContents(e);var n=t.ǃURO(i),o=n?n.toString():"";return""!=o}function C(i){for(var e=i.ǃURb([3]),n=0,o;(o=e[n])&&!N(i,o);)++n;for(var t=e.length-1;(o=e[t])&&!N(i,o);)--t;return e.slice(n,t+1)}function T(d,e){if(d.attributes.length!=e.attributes.length)return!1;for(var t=0,i=d.attributes.length,o,n,a;i>t;++t)if(o=d.attributes[t],a=o.name,"class"!=a){if(n=e.attributes.getNamedItem(a),null===o!=(null===n))return!1;if(o.specified!=n.specified)return!1;if(o.specified&&o.nodeValue!==n.nodeValue)return!1}return!0}function ne(i,e){for(var o=0,d=i.attributes.length,r;d>o;++o)if(r=i.attributes[o].name,(!e||!z(e,r))&&i.attributes[o].specified&&"class"!=r)return!0;return!1}function ie(r){var e;return r&&1==r.nodeType&&((e=r.parentNode)&&9==e.nodeType&&"on"==e.designMode||F(r)&&!F(r.parentNode))}function oe(r){return(F(r)||1!=r.nodeType&&F(r.parentNode))&&!ie(r)}function de(r){return r&&1==r.nodeType&&!Te.test(se(r,"display"))}function x(r){if(0==r.data.length)return!0;if(J.test(r.data))return!1;var e=se(r.parentNode,"whiteSpace");switch(e){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(r.data))return!1;}return de(r.previousSibling)||de(r.nextSibling)}function R(r){var e=[],i,t;for(i=0;t=r[i++];)e.push(new $(t.startContainer,t.startOffset),new $(t.endContainer,t.endOffset));return e}function P(d,e){for(var t=0,i=d.length,o,n,a;i>t;++t)o=d[t],n=e[2*t],a=e[2*t+1],o.ǃURY(n.node,n.offset,a.node,a.offset)}function w(r,e){return H.ǃUxw(r)?0==e?!!r.previousSibling:e!=r.length||!!r.nextSibling:0U;++U)"*"==s[U]?T.ǃUIa=!0:T.ǃUIB.push(s[U].toLowerCase());else T.ǃUIB=[T.ǃUIp]}var H=i.ǃUxy,$=H.ǃURz,z=H.ǃUxb,B=i.ǃUxh,D=B.forEach,U=B.ǃUxi(document,"createElementNS"),k=function(){function i(r,i,t){return i&&t?" ":""}return function(e,t){if("object"==typeof e.classList)e.classList.remove(t);else{var n="string"==typeof e.className,o=n?e.className:e.getAttribute("class");o=o.replace(new RegExp("(^|\\s)"+t+"(\\s|$)"),i),n?e.className=o:e.setAttribute("class",o)}}}(),se=H.ǃURl,F=function(){var r=document.createElement("div");return"boolean"==typeof r.isContentEditable?function(r){return r&&1==r.nodeType&&r.isContentEditable}:function(r){return r&&1==r.nodeType&&"false"!=r.contentEditable&&("true"==r.contentEditable||F(r.parentNode))}}(),Te=/^inline(-block|-table)?$/i,J=/[^\r\n\t\f \u200B]/,K=W(!1),Q=W(!0);L.prototype={ǃUIq:function(d){var e=this.ǃUIn,T=e[0];if(1n&&(--r.offset,r.offset==n+1&&ǃUGd-1>t&&(r.node=T,r.offset=i))})),r[t]=s.data,i+=s.data.length}),T.data=r.join("")}return T.data},ǃUGy:function(){for(var r=this.ǃUIn.length,e=0;r--;)e+=this.ǃUIn[r].length;return e},toString:function(){var r=[];return D(this.ǃUIn,function(e,t){r[t]="'"+e.data+"'"}),"[Merge("+r.join(",")+")]"}};var X=["elementTagName","ignoreWhiteSpace","applyToEditableOnly","useExistingElements","removeEmptyElements","onElementCreate"],Y={};M.prototype={ǃUIp:"span",ǃUId:{},ǃUIc:{},ǃUIA:!0,ǃUIW:!1,ǃUIG:!0,ǃUIk:!0,ǃUIM:null,ǃUID:function(d,e,t){var n={},a,s,r,i,o,T;for(var l in d)if(d.hasOwnProperty(l))if(i=d[l],o=e[l],"className"==l)ee(e,i),ee(e,this.className),e[l]=re(e[l]),t&&(n[l]=i);else if("style"==l){for(a in s=o,t&&(n[l]=r={}),d[l])d[l].hasOwnProperty(a)&&(s[a]=i[a],t&&(r[a]=s[a]));this.ǃUIH.push(l)}else e[l]=i,t&&(n[l]=e[l],T=Y.hasOwnProperty(l)?Y[l]:l,this.ǃUIH.push(T));return t?n:""},ǃUIx:function(r,e){for(var t in r)r.hasOwnProperty(t)&&!/^class(?:Name)?$/i.test(t)&&e.setAttribute(t,r[t])},ǃUIR:function(r){return z(this.ǃUIB,r.tagName.toLowerCase())},ǃUIg:function(r){var n=this;return r.ǃURb([1],function(r){return n.ǃUIR(r)&&!r.hasChildNodes()})},ǃUIO:function(r){return 1==r.nodeType&&(this.ǃUIa||this.ǃUIR(r))&&s(r,this.className)},ǃUII:function(r){for(;r;){if(this.ǃUIO(r))return r;r=r.parentNode}return null},ǃUIE:function(r){return!this.ǃUIW||oe(r)},ǃUIC:function(r){return this.ǃUIA&&r&&3==r.nodeType&&x(r)},ǃUIy:function(T,e,t,n){var U=T[0],a=T[T.length-1],l=[],u=U,v=a,c=0,p=a.length,d,r;D(T,function(t){r=K(t,!n),r?(d||(d=new L(r),l.push(d)),d.ǃUIn.push(t),t===U&&(u=d.ǃUIn[0],c=u.length),t===a&&(v=d.ǃUIn[0],p=d.ǃUGy())):d=null});var o=Q(a,!n);if(o&&(d||(d=new L(a),l.push(d)),d.ǃUIn.push(o)),l.length){for(var m=0,i=l.length;i>m;++m)l[m].ǃUIq(t);e.ǃURY(u,c,v,p)}},ǃUIb:function(r){var e=H.ǃURU(r),n=U&&!H.ǃUxS(r)&&(i=r.namespaceURI)?e.createElementNS(r.namespaceURI,this.ǃUIp):e.createElement(this.ǃUIp),i;return this.ǃUID(this.ǃUId,n,!1),this.ǃUIx(this.ǃUIc,n),ee(n,this.className),this.ǃUIM&&this.ǃUIM(n,this),n},ǃUIS:function(r,e){var i=this;return _(e,function(e,t){if("className"==e)return f(r,t);if("object"==typeof t){if(!i.ǃUIS(r[e],t))return!1;}else if(r[e]!==t)return!1})},ǃUIo:function(r,e){return _(e,function(e,t){return!(r.getAttribute(e)!==t)&&void 0})},ǃUIj:function(r){if(te(r)){var e=r.parentNode;if(1==e.childNodes.length&&this.ǃUIG&&this.ǃUIR(e)&&this.ǃUIS(e,this.ǃUId)&&this.ǃUIo(e,this.ǃUIc))ee(e,this.className);else{var t=r.parentNode,n=this.ǃUIb(t);t.insertBefore(n,r),n.appendChild(r)}}},ǃUIe:function(r){return r.tagName.toLowerCase()==this.ǃUIp&&n(r)==this.ǃUIY&&this.ǃUIS(r,this.ǃUId)&&!ne(r,this.ǃUIH)&&this.ǃUIo(r,this.ǃUIc)&&this.ǃUIE(r)},ǃUIN:function(r){var e=r.childNodes.length;return 1==r.nodeType&&this.ǃUIe(r)&&(0==e||1==e&&this.ǃUIN(r.firstChild))},ǃUIK:function(i){var o=this,e=i.ǃURb([1],function(r){return o.ǃUIN(r)}),t=[i],n=R(t);D(e,function(r){h(r,n)}),P(t,n)},ǃUIP:function(i,e,t,n){if(!e.containsNode(t)){var o=e.cloneRange();o.selectNode(t),o.isPointInRange(e.endContainer,e.endOffset)&&(O(t,e.endContainer,e.endOffset,n),e.setEndAfter(t)),o.isPointInRange(e.startContainer,e.startOffset)&&(t=O(t,e.startContainer,e.startOffset,n))}this.ǃUIe(t)?v(t,n):k(t,this.className)},ǃUIw:function(r,e,t){var n=this.ǃUII(r);n&&O(n,r,e,t)},ǃUIQ:function(r,e){this.ǃUIe(r)?v(r,e):k(r,this.className)},ǃUIZ:function(d,e){var t=this;e=e||[];var n=R(e||[]);d.ǃURW(n),t.ǃUIk&&t.ǃUIK(d);var a=C(d);if(a.length){D(a,function(r){t.ǃUIC(r)||t.ǃUII(r)||!t.ǃUIE(r)||t.ǃUIj(r,n)});var r=a[a.length-1];d.ǃURY(a[0],0,r,r.length),t.normalize&&t.ǃUIy(a,d,n,!1),P(e,n)}var i=t.ǃUIg(d);D(i,function(r){ee(r,t.className)})},ǃUIu:function(r){for(var e=r.length;e--;)this.ǃUIZ(r[e],r);return r},ǃUEU:function(e){var r=i.getSelection(e);r.ǃUgW(this.ǃUIu(r.ǃUgG()))},ǃUEr:function(d,e){var t=this;e=e||[];var n=R(e);d.ǃURW(n),t.ǃUIk&&t.ǃUIK(d,n);var s=C(d),o=s[s.length-1],a,r;if(s.length){t.ǃUIw(d.endContainer,d.endOffset,n),t.ǃUIw(d.startContainer,d.startOffset,n);for(var i=0,T=s.length;T>i;++i)a=s[i],r=t.ǃUII(a),r&&t.ǃUIE(a)&&t.ǃUIQ(r,n);d.ǃURY(s[0],0,o,o.length),t.normalize&&t.ǃUIy(s,d,n,!0),P(e,n)}var l=t.ǃUIg(d);D(l,function(r){k(r,t.className)})},ǃUET:function(r){for(var e=r.length;e--;)this.ǃUEr(r[e],r);return r},ǃUEv:function(e){var r=i.getSelection(e),t=i.getSelection(e).ǃUgG();this.ǃUET(t),r.ǃUgW(t)},ǃUEJ:function(r){if(r.collapsed||""==r.toString())return!!this.ǃUII(r.commonAncestorContainer);var e=r.ǃURb([3]);if(e.length)for(var t=0,i;i=e[t++];)if(!this.ǃUIC(i)&&N(r,i)&&this.ǃUIE(i)&&!this.ǃUII(i))return!1;return!0},ǃUEL:function(r){var e=r.length;if(0==e)return!1;for(;e--;)if(!this.ǃUEJ(r[e]))return!1;return!0},ǃUEs:function(e){var r=i.getSelection(e);return this.ǃUEL(r.ǃUgG())},ǃUEX:function(r){this.ǃUEJ(r)?this.ǃUEr(r):this.ǃUIZ(r)},ǃUEi:function(r){this.ǃUEs(r)?this.ǃUEv(r):this.ǃUEU(r)},ǃUE_:function(r){var i=[],t=this;return r.ǃURb([3],function(r){var e=t.ǃUII(r);e&&!z(i,e)&&i.push(e)}),i},detach:function(){}},M.ǃUxh={ǃUIO:s,ǃUEl:ee,ǃUEt:k,ǃUE$:r,ǃUEf:u,ǃUEz:f,ǃUEF:v,ǃUEm:T,ǃUEh:ne,ǃUEn:O,ǃUEV:F,ǃUEp:ie,ǃUEB:oe},i.ǃUEd=i.ǃUEc=M,i.ǃUEH=function(r,e,t){return new M(r,e,t)},B.ǃUxH(i,"createCssClassApplier","createClassApplier",e)}),r},this),"use strict";{let e=!1,r=!1,t="dev";self.ǃr=class{constructor(){throw TypeError("static class can't be instantiated")}static ǃUED(){e=!0}static ǃUEY(){return e}static ǃUEa(){r=!0}static ǃUEq(){return r}static ǃUEA(e){t=e}static ǃUEW(){return t}static ǃUEG(){return"final"===t}},ǃr.ǃvE=!1,ǃr.ǃUEk=!1,ǃr.hardwareConcurrency=navigator.hardwareConcurrency||2}"use strict",ǃr.ǃUEM=class{constructor(e){this.ǃUEx=e,this.ǃUER=new Map,this.ǃUEg()}ǃUEg(){let e=this.ǃUEx;(e.startsWith("?")||e.startsWith("#"))&&(e=e.substr(1));const r=e.split("&");for(const e of r)this.ǃUEO(e)}ǃUEO(e){if(e){if(!e.includes("="))return void this.ǃUER.set(e,null);const r=e.indexOf("="),t=decodeURIComponent(e.substring(0,r)),n=decodeURIComponent(e.substring(r+1));this.ǃUER.set(t,n)}}ǃUEI(){for(const r of this.ǃUER)console.log("[QueryParser] Parameter '"+r[0]+"' = "+(null===r[1]?"null":"'"+r[1]+"'"))}ǃIh(e){return this.ǃUER.has(e)}ǃb(e){const r=this.ǃUER.get(e);return"undefined"==typeof r?null:r}ǃzF(){history.replaceState("",document.title,location.pathname+location.search)}ǃUEE(e){this.ǃUEx=e,this.ǃUER.clear(),this.ǃUEg()}},ǃr.ǃIn=new ǃr.ǃUEM(location.search),ǃr.ǃzf=new ǃr.ǃUEM(location.hash),"dev"!==ǃr.ǃIn.ǃb("mode")&&ǃr.ǃUEA("final"),"use strict";{function e(e,r,t){if(!0===r){t();p.set(e,!0)}else if(r&&r.length){t(r[0]);p.set(e,!0)}else;}const r="(unknown)",t=navigator.userAgent;let n={ǃUEC:/linux|openbsd|freebsd|netbsd/i.test(t),ǃUEy:/CrOS/.test(t),ǃUEb:/trident|iemobile|msie|tizen/i.test(t),ǃUES:/trident|iemobile|msie|edge\//i.test(t),opera:/OPR\//.test(t),ǃUEo:/bb10/i.test(t),ǃUEj:/edge\//i.test(t),ǃUEe:/trident/i.test(t),ǃUEN:/webkit/i.test(t),safari:/safari\//i.test(t),chrome:/chrome\//i.test(t),ǃUEK:/chromium\//i.test(t),ǃUEP:/crosswalk|xwalk/i.test(t),ǃUEw:/nwjs/i.test(t),ǃUEQ:/amazonwebappplatform/i.test(t),ǃUEZ:/wv\)/.test(t),ǃUEu:/android/i.test(t),ǃUCU:/nokiabrowser\/[0-9.]+/i.test(t)},i={ǃUCr:/windows\s+nt\s+\d+\.\d+/i.exec(t),ǃUCT:/mac\s+os\s+x\s+[0-9_]+/i.exec(t),ǃUEu:/android\s+[0-9.]+/i.exec(t),opera:/OPR\/[0-9.]+/.exec(t),ǃUCv:/tizen\s+[0-9.]+/i.exec(t),ǃUCJ:/iphone\s+os\s+[0-9_]+/i.exec(t),ǃUCL:/ipad[^)]*os\s+[0-9_]+/i.exec(t),ǃUCs:/windows\s+phone\s+[0-9.]+/i.exec(t),ǃUCX:/windows\s+phone\s+os\s+[0-9.]+/i.exec(t),chrome:/chrome\/[0-9.]+/i.exec(t),ǃUEK:/chromium\/[0-9.]+/i.exec(t),ǃUEw:/nwjs\/[0-9.]+/i.exec(t),ǃUCi:/firefox\/[0-9.]+/i.exec(t),ǃUC_:/msie\s+[0-9.]+/i.exec(t),ǃUEj:/edge\/[0-9.]+/i.exec(t),ǃUCl:/silk\/[0-9.]+/i.exec(t)},o=r,d=r,a=r,s=r,T=r,l=r,u=r,U="browser",c=!1,v=!1,p=new Map;e("isWindows",i.ǃUCr,(e)=>{o="Windows";const r=e.split(" ")[2];r&&("5.0"===r?d="2000":"5.1"===r?d="XP":"5.2"===r?d="XP":"6.0"===r?d="Vista":"6.1"===r?d="7":"6.2"===r?d="8":"6.3"===r?d="8.1":"10.0"===r?d="10":void 0)}),e("isOSX",i.ǃUCT,(e)=>{o="Mac OS X";const r=e.split(" ")[3];r&&(d=r.replace("_","."))}),e("isLinux",n.ǃUEC,()=>{o="Linux"}),e("isChromeOS",n.ǃUEy,()=>{o="Chrome OS"}),e("isAndroid",!n.ǃUEb&&i.ǃUEu,(e)=>{o="Android";const r=e.split(" ")[1];r&&(d=r)}),e("isTizen",i.ǃUCv,(e)=>{o="Tizen";const r=e.split(" ")[1];r&&(d=r)}),e("isIPhone",!n.ǃUEb&&i.ǃUCJ,(e)=>{o="iOS";const r=e.split(" ")[2];r&&(d=r.replace("_","."))}),e("isIPad",!n.ǃUEb&&i.ǃUCL,(e)=>{o="iOS";const r=e.split(" ")[3];r&&(d=r.replace("_","."))}),e("isWindowsPhone",i.ǃUCs,(e)=>{o="Windows Phone";const r=e.split(" ")[2];r&&(d=r)}),e("isWindowsPhoneOS",i.ǃUCX,(e)=>{o="Windows Phone";const r=e.split(" ")[3];r&&(d=r)}),e("isBlackberry",n.ǃUEo,()=>{o="Blackberry",d="10",s="stock",u="webkit"}),e("isChrome",!n.ǃUEj&&!n.opera&&i.chrome,(e)=>{s="Chrome",u="Blink";const r=e.split("/")[1];r&&(T=r)}),e("isOpera",i.opera,(e)=>{s="Opera",u="Blink";const r=e.split("/")[1];r&&(T=r)}),e("isChromium",i.ǃUEK,(e)=>{s="Chromium",u="Blink";const r=e.split("/")[1];r&&(T=r)}),e("isFirefox",i.ǃUCi,(e)=>{s="Firefox",u="Gecko";const r=e.split("/")[1];r&&(T=r)}),e("isInternetExplorer",i.ǃUC_,(e)=>{s="Internet Explorer",u="Trident";const r=e.split(" ")[1];r&&(T=r)}),e("isTrident","Internet Explorer"!=s&&n.ǃUEe,()=>{u="Trident";const e=/rv:[0-9.]+/i.exec(t);if(e&&e.length){s="Internet Explorer";const r=e[0].split(":")[1];r&&(T=r)}}),e("isEdge",i.ǃUEj,(e)=>{s="Edge",u="Edge";const r=e.split("/")[1];r&&(T=r)}),e("isSafari",n.safari&&!n.ǃUCU&&!n.chrome&&!n.ǃUEK&&!n.ǃUCt&&!n.ǃUEo,()=>{s="Safari",u="WebKit";const e=/version\/[0-9.]+/i.exec(t),r=/crios\/[0-9.]+/i.exec(t),n=/fxios\/[0-9.]+/i.exec(t);if(e&&e.length){const r=e[0].split("/")[1];r&&(T=r)}if(r&&r.length){s="Chrome for iOS";const e=r[0].split("/")[1];e&&(T=e)}if(n&&n.length){s="Firefox for iOS";const e=n[0].split("/")[1];e&&(T=e)}}),e("isSilk",i.ǃUCl,(e)=>{s="Silk";const r=e.split("/")[1];r&&(T=r)}),e("isCrosswalk",n.ǃUEP,()=>U="crosswalk"),e("isCordova",self.device&&(self.device.cordova||self.device.phonegap),()=>U="cordova"),e("isNWJS",i.ǃUEw,(e)=>{U="nwjs",s="NW.js",u="Chromium";const r=e.split("/")[1];r&&(T=r)}),e("isAmazonWebApp",n.ǃUEQ,()=>U="webapp"),e("isHomeScreenWebApp","nwjs"!=U&&"undefined"!=typeof window&&(window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches||navigator.standalone),()=>U="webapp"),e("isFalseSafari","Safari"==s&&("Android"==o||"Tizen"==o||"Blackberry"==o),()=>s="stock"),e("isAndroidWebview","Chrome"==s&&"browser"==U&&n.ǃUEZ,()=>U="webview"),e("isFirefoxOS","Firefox"==s&&o==r,()=>o="Firefox OS"),e("isAndroidFallback",o==r&&!n.ǃUEb&&n.ǃUEu,()=>o="Android"),e("isTridentFallback",o==r&&n.ǃUEe,()=>u="Trident"),e("isWebkitFallback",o==r&&n.ǃUEN,()=>u="WebKit"),e("is64Bit",((e)=>e.test(t)||e.test(navigator.platform)||"x64"===navigator.cpuClass)(/x86_64|x86-64|win64|x64;|x64\)|x64_|amd64|wow64|ia64|arm64|arch64|sparc64|ppc64|irix64/i),()=>a="64-bit"),e("is32Bit",((e)=>e.test(t)||e.test(navigator.platform)||"x86"===navigator.cpuClass)(/x86;|x86\)|i86|i386|i486|i586|i686|armv1|armv2|armv3|armv4|armv5|armv6|armv7/i),()=>a="32-bit"),e("is64BitFallback",a==r&&"Mac OS X"==o&&10.7<=parseFloat(d),()=>a="64-bit"),e("is32BitFallback",a==r&&"Windows"==o||"Android"==o&&5>parseFloat(d),()=>a="32-bit"),e("is32BitBrowser","32-bit"==a||/wow64/i.test(t),()=>l="32-bit"),e("is64BitBrowser",/win64/i.test(t),()=>l="64-bit"),e("isDesktop",(()=>"Windows"==o||"Mac OS X"==o||"Linux"==o||"Chrome OS"==o||"nwjs"==U)(),()=>c=!0),"Edge"==u&&"undefined"!=typeof Windows&&"undefined"!=typeof Windows.System&&(U="windows-store"),v="nwjs"==U||"windows-store"==U,ǃr.ǃrd={ǃzD:o,ǃUC$:d,ǃUCf:a,ǃzc:s,ǃUCz:T,ǃUCF:l,ǃUCm:u,ǃvo:U,ǃJP:c,ǃvq:!c,ǃvl:v,ǃUCh:!!(self.chrome&&self.chrome.runtime&&self.chrome.runtime.id),ǃrB:"Mac OS X"==o||"iOS"==o}}{function e(){return t=!1,console.log("(testing if dev tools open, which requires a log)",n),t}function r(r){let t=ǃr.ǃUCn();if(console.error("Assertion failure: "+r+"\n\nStack trace:\n"+t),!ǃr.ǃvE&&!i&&!e()){i=!0;let e=ǃr.ǃo.ǃS.ǃb("CrashReport");e.ǃy("assertion failure",{stack:t,message:r},document.body)}}ǃr.ǃvE=!ǃr.ǃUEG()&&ǃr.ǃIn.ǃIh("debug"),ǃr.ǃUEk=!ǃr.ǃUEG()&&ǃr.ǃIn.ǃIh("debug-defend"),ǃr.ǃUEk&&(ǃr.ǃvE=!0);let t=!1,n=new Image;n.__defineGetter__("id",function(){t=!0});let i=!1;window.assert=function(e,t){e||r(t)}}{if(!String.prototype.trimStart){const e=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*/;String.prototype.trimStart=function(){return this.replace(e,"")}}if(!String.prototype.trimEnd){const e=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*$/;String.prototype.trimEnd=function(){return this.replace(e,"")}}Array.prototype.values||(Array.prototype.values=function*(){for(const e of this)yield e}),RegExp.escape||(RegExp.escape=function(e){return(e+"").replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")}),navigator.storage&&!navigator.storage.estimate&&navigator.webkitTemporaryStorage&&navigator.webkitTemporaryStorage.queryUsageAndQuota&&(navigator.storage.estimate=function(){return new Promise((e,r)=>navigator.webkitTemporaryStorage.queryUsageAndQuota((r,t)=>e({usage:r,quota:t}),r))}),"undefined"==typeof HTMLCollection||HTMLCollection.prototype[Symbol.iterator]||(HTMLCollection.prototype[Symbol.iterator]=function(){let e=0;return{next:()=>({done:e>=this.length,value:this.item(e++)})}});"undefined"==typeof NodeList||NodeList.prototype[Symbol.iterator]||(NodeList.prototype[Symbol.iterator]=function(){let e=0;return{next:()=>({done:e>=this.length,value:this.item(e++)})}});"undefined"==typeof DOMTokenList||DOMTokenList.prototype[Symbol.iterator]||(DOMTokenList.prototype[Symbol.iterator]=function(){let e=0;return{next:()=>({done:e>=this.length,value:this.item(e++)})}});"undefined"==typeof self.isSecureContext&&(self.isSecureContext="https:"===location.protocol)}{ǃr.ǃUCV={},ǃr.ǃUCV.ǃUCp=(()=>{try{const r=document.createElement("div"),e=r.animate([{opacity:"0"},{opacity:"1"}],1e3);return"undefined"!=typeof e.reverse}catch(r){return!1}})(),ǃr.ǃUCV.ǃUCB="undefined"!=typeof document&&"import"in document.createElement("link"),ǃr.ǃUCV.ǃUCd="undefined"!=typeof HTMLDialogElement,ǃr.ǃUCV.ǃUCc=!!self.requestIdleCallback,ǃr.ǃUCV.ǃUCH=!1;try{self.createImageBitmap(new ImageData(32,32),{ǃUCD:"none"}).then(()=>{ǃr.ǃUCV.ǃUCH=!0}).catch(()=>{ǃr.ǃUCV.ǃUCH=!1})}catch(r){ǃr.ǃUCV.ǃUCH=!1}ǃr.ǃUCV.ǃUCY="undefined"!=typeof Proxy,ǃr.ǃUCV.ǃUCa=(()=>{if("undefined"==typeof document)return!1;const e=document.createElement("a");return"undefined"!=typeof e.download})(),ǃr.ǃUCV.ǃRa=(()=>"undefined"!=typeof HTMLCanvasElement&&HTMLCanvasElement.prototype.toBlob)(),ǃr.ǃUCV.ImageBitmap=!!self.createImageBitmap,ǃr.ǃUCV.ǃUCq="undefined"!=typeof CSS&&CSS.supports("background","element(#test)"),ǃr.ǃUCV.ǃUCA="function"==typeof fetch,ǃr.ǃUCV.ǃUCW=!!(self.isSecureContext&&"Opera"!==ǃr.ǃrd.ǃzc&&navigator.storage&&navigator.storage.persist),ǃr.ǃUCV.ǃUCG=!!(self.isSecureContext&&navigator.storage&&navigator.storage.estimate)}"use strict",ǃr.ǃUCk=function(e){return"number"==typeof e},ǃr.ǃtU=function(e){return ǃr.ǃUCk(e)&&isFinite(e)},ǃr.ǃhn=function(e){if(!ǃr.ǃUCk(e))throw new TypeError("expected number")},ǃr.ǃUCM=function(e){ǃr.ǃ$h(e)||ǃr.ǃhn(e)},ǃr.ǃUCx=function(e,r,t){if(!ǃr.ǃUCk(e)||isNaN(e)||r>e||t","|"]),t=new Set(["."]),n=new Set(["."," "]),i=200;ǃr.ǃUym=function(e){if(ǃr.ǃk(e),!e)return!1;if(e.length>=i)return!1;let o=[...e];return!o.some((e)=>r.has(e))&&!t.has(o[0])&&!n.has(o[o.length-1])&&!ǃr.ǃUyh(e)},ǃr.ǃUyn=function(e){ǃr.ǃk(e),ǃr.ǃk(name);let o=[...e];for(ǃr.ǃU$D(o,(e)=>r.has(e));o.length&&n.has(o[o.length-1]);)o.pop();for(;o.length&&t.has(o[0]);)o.shift();return o.length>i&&ǃr.ǃdR(o,i),o.join("")},ǃr.ǃUyh=function(r){return ǃr.ǃk(r),e.has(r.toLowerCase())}}{let e=null,r="";if("undefined"!=typeof document){e=document;const t=document.querySelector("base");r=t&&t.hasAttribute("href")?t.getAttribute("href"):"",r&&(r.startsWith("/")&&(r=r.substr(1)),!r.endsWith("/")&&(r+="/"))}ǃr.ǃfp=function(){if(!e)return"";const t=e.location;return ǃr.ǃT(t.origin+t.pathname)+r},ǃr.ǃT=function(e){if(ǃr.ǃk(e),!e.length)return e;if(e.endsWith("/")||e.endsWith("\\"))return e;const r=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return-1===r?"":e.substr(0,r+1)},ǃr.ǃUyV=function(e){if(ǃr.ǃk(e),!e.length)return e;e.charAt(e.length-1);if(e.endsWith("/")||e.endsWith("\\"))return"";const r=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return-1===r?e:e.substr(r+1)},ǃr.ǃkU=function(e){if(ǃr.ǃ$(e,DataTransfer),e.types)for(let r=0;rr?"":e.substr(r)},ǃr.ǃU_R=function(e){let r=e.lastIndexOf(".");return 1>r?e:e.substr(0,r)},ǃr.ǃrs=function(e,r){return ǃr.ǃ$t(e),new Promise((t)=>{self.setTimeout(t,e,r)})},ǃr.ǃUyB=function(e){ǃr.ǃ_u(e);try{e()}catch(r){ǃr.ǃvE&&console.warn("Swallowed exception: ",r)}},ǃr.ǃUyd=function(r){assert(!1,r||"Unknown error")},ǃr.ǃUyc=function(){},ǃr.ǃNu=function(e,r){return ǃr.ǃz(e),ǃr.ǃz(r),"string"!=typeof e||"string"!=typeof r?!1:e.length===r.length&&(e===r||e.toLowerCase()===r.toLowerCase())},ǃr.ǃov=function(e,r){ǃr.ǃre(e),ǃr.ǃ_u(r);const t=e.map((e,r)=>[e,r]);t.sort((e,t)=>{const n=r(e[0],t[0]);return 0===n?e[1]-t[1]:n});for(let n=0,i=e.length;nn&&ǃr.ǃUyD(e,r,t)},ǃr.ǃUnO=function(e,r){ǃr.ǃre(e),ǃr.ǃre(r),ǃr.ǃXk(e),ǃr.ǃdx(e,r)},ǃr.ǃdx=function(e,r){ǃr.ǃre(e),ǃr.ǃre(r),e.push(...r)},ǃr.ǃUyY=function(e,r){ǃr.ǃre(e);let t=e.indexOf(r);0<=t&&e.splice(t,1)},ǃr.ǃUzP=function(e,r){ǃr.ǃre(e),ǃr.ǃre(r);let t=e.length;if(r.length!==t)return!1;for(let n=0;nt:5===r?e>=t:(assert(!1,"Invalid comparison value: "+r),!1)},ǃr.ǃUyx=function(e){for(let r in ǃr.ǃyd(e),e)if(e.hasOwnProperty(r))return!0;return!1},ǃr.ǃUyR=function(e,r){return ǃr.ǃXR(e,Promise),ǃr.ǃ_u(r),e.length?new Promise((t,n)=>{const o=[];let d=0,a=!1;for(let s=0,i=e.length;s{a||(o[s]=n,++d,d===e.length?t(o):r(d,e.length))}).catch((e)=>{a=!0,n(e)})}):Promise.resolve([])};let t=[];ǃr.ǃUyg=function(e){ǃr.ǃ_u(e),t.push(e)},ǃr.ǃUyO=function(){let e=0;for(let r of t){let t=r();ǃr.ǃ$t(t),e+=t}return Math.floor(e)}}{function e(r){r.clipboardData.setData("text/plain",i),r.stopPropagation(),r.preventDefault()}ǃr.ǃU=function(){let e=window.getImportDocument(),r=window.c3_releaseMainImportDoc;return e===document&&r&&(e=r),e},ǃr.ǃJr=function(e){ǃr.ǃk(e),ǃr.ǃrd.ǃvl?ǃr.ǃSd.ǃUyI(e):window.open(e)},ǃr.ǃzd=function(){return"nwjs"===ǃr.ǃrd.ǃvo||"windows-store"===ǃr.ǃrd.ǃvo?ǃr.ǃrd.ǃvo:window.matchMedia("(display-mode: fullscreen)").matches?"fullscreen":window.matchMedia("(display-mode: standalone)").matches?"standalone":window.matchMedia("(display-mode: minimal-ui)").matches?"minimal-ui":navigator.standalone?"standalone":"browser"},ǃr.ǃUyE=function(e,r){for(ǃr.ǃUyr(e),ǃr.ǃk(r),r=r.toUpperCase();e.parentNode;)if(e=e.parentNode,e.tagName===r)return e;return null},ǃr.ǃE_=function(e,r){for(ǃr.ǃoF(e),ǃr.ǃre(r);e;){for(const t of r)if(e.classList.contains(t))return e;e=e.parentElement}return null},ǃr.ǃCZ=function(e,r){return ǃr.ǃoF(e),ǃr.ǃre(r),!!ǃr.ǃE_(e,r)},ǃr.ǃEh=function(e,r){for(ǃr.ǃoF(e),ǃr.ǃre(r);e;){const n=e.tagName;for(const i of r)if(ǃr.ǃNu(n,i))return e;e=e.parentElement}return null},ǃr.ǃUyC=function(e,r){return ǃr.ǃoF(e),ǃr.ǃre(r),!!ǃr.ǃEh(e,r)},ǃr.ǃyC=function(e,r){for(ǃr.ǃIO(e),ǃr.ǃIO(r);e.parentNode;){if(e.parentNode===r)return!0;e=e.parentNode}return!1},ǃr.ǃoR=function(e){ǃr.ǃIO(e);const r=e.childNodes;for(let t=0,n=r.length,i;t{if(!ǃr.ǃUCV.ǃUCa)return void n("browser does not support downloading local content");let i=document.createElement("a");i.textContent=e,i.href=r,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.setTimeout(t,16)})},ǃr.ǃRA=function(e,r){ǃr.ǃk(e),ǃr.ǃ$(r,Blob);let t=URL.createObjectURL(r);return setTimeout(()=>URL.revokeObjectURL(t),6e4),ǃr.ǃUtJ(e,t)},ǃr.ǃUyj=function(e){performance.mark(e+"-Start")},ǃr.ǃUye=function(e){performance.mark(e+"-End"),performance.measure(e,e+"-Start",e+"-End")},ǃr.ǃUyN=function(e){console.log(performance.getEntriesByName(e,"measure"))};let t=document.createElement("input");t.setAttribute("type","color"),t.className="hiddenColorPicker",t.style.opacity="0",t.addEventListener("change",function(){n&&(n(t.value),n=null)}),window.C3_IsPopupWindow||document.body.appendChild(t);let n=null;ǃr.ǃjR=function(e){ǃr.ǃk(e),t.value=e;let r=new Promise((e)=>{n=e});return t.click(),r};let i="",o="";ǃr.ǃzt=function(r){if(ǃr.ǃk(r),o=r,ǃr.ǃrd.ǃvl)return ǃr.ǃSd.ǃUyK(r),!0;let t=document.createElement("textarea");t.value="x",document.body.appendChild(t),t.select();let n;window.addEventListener("copy",e,!0),i=r;try{n=document.execCommand("copy")}catch(e){n=!1}return i="",window.removeEventListener("copy",e,!0),document.body.removeChild(t),n},ǃr.ǃSh=function(e){ǃr.ǃk(e),o=e},ǃr.ǃSc=function(){return o},ǃr.ǃUyP=function(e){e.reverse(),window.setTimeout(()=>{"pending"===e.playState&&e.finish()},50)},ǃr.ǃUyw=function(e){e.playbackRate*=-1,window.setTimeout(()=>{"pending"===e.playState&&e.finish()},50)};const d=document.createElement,a=document.appendChild,s=MessageChannel,T=MessagePort.prototype.postMessage;ǃr.ǃUyQ=function(e){ǃr.ǃyd(e),ǃr.ǃk(e.src),ǃr.ǃk(e.ǃUyZ),ǃr.ǃzO(e.ǃUyu),ǃr.ǃz(e.sandbox);const r=d.call(document,"iframe"),t=new s,n=t.port1,i=t.port2;e.ǃUyu&&(n.onmessage=e.ǃUyu);const o=new Promise((t,o)=>{r.addEventListener("load",()=>{try{r.contentWindow.postMessage({type:"init"},e.ǃUyZ,[i])}catch(e){return void o(e)}t({ǃUbU:r,ǃUbr:function(e,r){try{T.call(n,e,r)}catch(e){console.error("[Analytics] Failed to post message: ",e)}}})}),r.addEventListener("error",(e)=>{o(e)})});return"string"==typeof e.sandbox&&r.setAttribute("sandbox",e.sandbox),r.style.display="none",r.src=e.src,a.call(e.parent||document.body,r),o}}{function e(e){const r=[];for(let t in e)e[t]&&r.push(t+"="+encodeURIComponent(e[t]));return r.join("&")}function r(e,r,t,n,i,o,d){return new Promise((a,s)=>{const T=new XMLHttpRequest;if(T.open(e,r),T.responseType="json"===i?"text":i,o&&T.overrideMimeType(o),t)for(const[e,r]of Object.entries(t))T.setRequestHeader(e,r);T.onload=()=>{if(!(300>T.status&&200<=T.status))s(new Error(`error fetching ${r} (${T.status} ${T.statusText})`));else if("json"===i)try{a(JSON.parse(T.response))}catch(r){s(r)}else a(T.response)},d&&(T.onprogress=d),T.onerror=()=>s(new Error(`error fetching ${r} (${T.status} ${T.statusText})`)),T.send(n)})}async function t(e,r,t,n,i){const o={method:e};n&&(o.body=n),t&&(ǃUbT.headers=t);let d=null;try{d=await fetch(r,o)}catch(e){throw e&&"string"==typeof e.message&&"failed to fetch"===e.message.toLowerCase()&&(e.message+=` (url: ${r})`),e}if(!d.ok)throw new Error(`error fetching ${r} (${d.status} ${d.statusText})`);return d[i]()}const n=new Set(["text","blob","json","arraybuffer"]),i=new Set(["text","blob","json","arraybuffer","document"]);ǃr.ǃUCA=function(o){o=ǃr.ǃFL(o)?{url:o}:o,ǃr.ǃyd(o),ǃr.ǃk(o.url),ǃr.ǃz(o.method),ǃr.ǃVg(o.arguments),ǃr.ǃVg(o.ǃUbv),ǃr.ǃz(o.response),ǃr.ǃVg(o.headers),ǃr.ǃz(o.encode),ǃr.ǃz(o.ǃUbJ),ǃr.ǃzO(o.onprogress);let d=o.url,a=o.data;const s=o.ǃUbJ,T=o.onprogress,l=o.headers,u=o.method||"GET",U=e(o.arguments)||"",c=o.response||"text";U&&(d+=d.includes("?")?"&":"?",d+=U),a&&("json"===o.encode?a=JSON.stringify(o.data):"url"===o.encode&&(a=e(o.data)));const v=ǃr.ǃUCV.ǃUCA&&n.has(c),p=i.has(c);if(v&&!T)return t(u,d,l,a,c);if(p)return r(u,d,l,a,c,s,T);throw new TypeError(`invalid response type '${c}'`)},ǃr.ǃUam=function(e){return ǃr.ǃk(e),ǃr.ǃUCA({url:e,mimeType:"text/plain; charset=utf-8"})},ǃr.ǃUHA=function(e,r){return ǃr.ǃk(e),ǃr.ǃz(r),ǃr.ǃUCA({url:e,response:"document",ǃUbJ:r})},ǃr.ǃfV=function(e){return ǃr.ǃk(e),ǃr.ǃUCA({url:e,response:"json"})},ǃr.ǃPD=function(e,r){return ǃr.ǃk(e),ǃr.ǃzO(r),ǃr.ǃUCA({url:e,onprogress:r,response:"blob"})},ǃr.ǃUL=function(e,r=!0){return ǃr.ǃk(e),window.addImport(e,r)},ǃr.ǃUbL=function(e){return ǃr.ǃk(e),new Promise((r,t)=>{let n=document.createElement("link");n.onload=function(){r(n)},n.onerror=function(r){t(r)},n.rel="stylesheet",n.href=e,document.head.appendChild(n)})},ǃr.ǃUbs=function(e){return ǃr.ǃk(e),new Promise((r,t)=>{let n=document.createElement("script");n.onload=function(){r(n)},n.onerror=function(r){t(r)},n.async=!1,n.src=e,document.head.appendChild(n)})},ǃr.ǃsm=function(e){return ǃr.ǃk(e),new Promise((r,t)=>{let n=new Image;n.onload=function(){r(n)},n.onerror=function(r){t(r)},n.src=e})}}{function e(){l||(l=new ǃr.ǃPG(r,5)),l.ǃtF();s||(s=document.createElement("canvas"),s.width=32,s.height=32,T=s.getContext("2d"))}function r(){s.width=32,s.height=32}function t(r){ǃr.ǃUyJ(r),e(),s.width=r.width,s.height=r.height,T.drawImage(r,0,0)}function n(e,r,t,n){var i=Math.floor;ǃr.ǃUyJ(e),ǃr.ǃ$t(r),assert(1<=r,"step count must be greater or equal to 1");let d,a;0==r%2?(d=n.canvas,a=n):(d=t.canvas,a=t);let s=i(0.5*e.width),T=i(0.5*e.height);return 0===s&&(s=1),0===T&&(T=1),d.width=s,d.height=T,a.scale(0.5,0.5),a.drawImage(e,0,0),o(a,s,T,0.1),d}function i(e,r,t){ǃr.ǃUyJ(e),ǃr.ǃ$t(r),ǃr.ǃ$t(t);let i=e;const o=i.width,d=i.height;let a=1,s=o>d?o:d;for(const T=o>d?r:t;s>T;)s*=0.5,1==a?u=ǃr.ǃUbh().getContext("2d"):2==a&&(U=ǃr.ǃUbh().getContext("2d")),i=n(i,a,u,U),a++;return i}function o(e,t,n,i){try{const o=[0,-1,0,-1,5,-1,0,-1,0],r=e.createImageData(t,n),d=r.data,s=e.getImageData(0,0,t,n).data;for(let e=n;e;){e--;for(let T=t;T;){T--;let l=e,u=T,U=4*(e*t+T),c=0,r=0,v=0,p=0;for(let e=0;3>e;e++)for(let i=0;3>i;i++){let d=l+e-1,a=u+i-1;if(0<=d&&dJSON.parse(e))},ǃr.ǃUbX=function(e){if(ǃr.ǃk(e),"data:"!==e.substr(0,5))throw new URIError("expected data: uri");let r=e.indexOf(",");if(0>r)throw new URIError("expected comma in data: uri");let t=e.substring(5,r),n=e.substring(r+1),i=t.split(";"),o=i[0]||"",d=i[1],a=i[2],s;return s="base64"===d||"base64"===a?atob(n):decodeURIComponent(n),{ǃUbi:o,data:s}},ǃr.ǃUb_=function(e){ǃr.ǃk(e);const r=ǃr.ǃUbX(e);return ǃr.ǃUbl(r.data,r.ǃUbi)},ǃr.ǃUrL=function(e){return ǃr.ǃ$(e,Blob),new Promise((r,t)=>{let n=new FileReader;n.onload=(t)=>r(t.target.result),n.onerror=(e)=>t(e),n.readAsDataURL(e)})},ǃr.ǃUbl=function(e,r){ǃr.ǃk(e),ǃr.ǃz(r);let t=e.length,n=t>>2,o=new Uint8Array(t),d=new Uint32Array(o.buffer,0,n),a,i;for(a=0,i=0;a{let n=new FileReader;n.onload=()=>r(n.result),n.onerror=()=>t(n.error),n.readAsArrayBuffer(e)})},ǃr.ǃPL=function(e){return ǃr.ǃ$(e,Blob),ǃr.ǃUbt(e).then((r)=>new Blob([r],{type:e.type}))},ǃr.ǃUb$=function(e){return ǃr.ǃUCy(e),ǃr.ǃUbt(e).then((r)=>ǃr.ǃW([r],e.name,{type:e.type,ǃUbf:e.ǃUbf}))},ǃr.ǃW=function(e,r="",{type:t="",ǃUbf:n=Date.now()}={}){if(ǃr.ǃre(e),ǃr.ǃk(r),ǃr.ǃk(t),ǃr.ǃ$t(n),"Edge"!=ǃr.ǃrd.ǃzc)return new File(e,r,{type:t,ǃUbf:n});const i=new Blob(e,{type:t});return i.name=r,i.dateModified=n,i},ǃr.ǃUbz=function(e){return ǃr.ǃt_(e,FileList,Array),new Promise((r,t)=>{let n=[];for(let o=0,i;o{e.ǃUrY=i,t(e)}));return Promise.all(n).then(r)})},ǃr.ǃUbF=function(e,r,t){return ǃr.ǃIO(e,"canvas"),ǃr.ǃz(r),ǃr.ǃ$f(t),"number"!=typeof t&&(t=1),r=r||"image/png",t=ǃr.ǃsP(t,0,1),ǃr.ǃUb_(e.toDataURL(r,t))},ǃr.ǃRa=function(e,r,t){return ǃr.ǃIO(e,"canvas"),ǃr.ǃz(r),ǃr.ǃ$f(t),"number"!=typeof t&&(t=1),r=r||"image/png",t=ǃr.ǃsP(t,0,1),ǃr.ǃUCV.ǃRa?new Promise((n)=>{e.toBlob(n,r,t)}):ǃr.ǃfB(()=>ǃr.ǃUbF(e,r,t))},ǃr.ǃUbm=function(e,r,t,n,i){ǃr.ǃIO(e,"canvas");let o=ǃr.ǃUbh(e.width,e.height);if(ǃr.ǃtU(r)&&ǃr.ǃtU(t)&&ǃr.ǃtU(n)&&ǃr.ǃtU(i)){let d=n-r,a=i-t;o.getContext("2d").drawImage(e,r,t,d,a,0,0,d,a)}else o.getContext("2d").drawImage(e,0,0);return o},ǃr.ǃUbh=function(e=1,r=1){ǃr.ǃ$t(e),ǃr.ǃ$t(r);let t=document.createElement("canvas");return t.width=e,t.height=r,t};let s=null,T=null,l=null;ǃr.ǃUyg(()=>s?4*(s.width*s.height):0);ǃr.ǃUrD=function(e){ǃr.ǃ$(e,Blob);let r=URL.createObjectURL(e);return ǃr.ǃsm(r).then((e)=>(URL.revokeObjectURL(r),e)).catch((e)=>{throw URL.revokeObjectURL(r),e})},ǃr.ǃPs=function(e,r=!1){return ǃr.ǃ$(e,Blob),r=!!r,ǃr.ǃUCV.ImageBitmap&&!r?createImageBitmap(e):ǃr.ǃUrD(e)},ǃr.ǃY=function(e){return ǃr.ǃ$(e,Blob),new Promise((r,t)=>{let n=new FileReader;n.onload=(t)=>r(t.target.result),n.onerror=(e)=>t(e),n.readAsText(e)})},ǃr.ǃUbn=function(e){return ǃr.ǃ$(e,Blob),ǃr.ǃY(e).then(ǃr.ǃmE)},ǃr.ǃUbV=function(e,r){let t=r?JSON.stringify(e,null,4):JSON.stringify(e);return new Blob([t],{type:"application/json"})};ǃr.ǃUbp=function(e){return ǃr.ǃ$(e,ImageBitmap),t(e),T.getImageData(0,0,e.width,e.height)},ǃr.ǃUbB=function(e){ǃr.ǃUyJ(e),t(e);let r=T.getImageData(0,0,e.width,e.height);return s.width=1,s.height=1,r},ǃr.ǃUbd=function(e,r,n){return ǃr.ǃUyJ(e),ǃr.ǃz(r),ǃr.ǃ$f(n),t(e),ǃr.ǃRa(s,r,n)},ǃr.ǃUbc=function(e,r,n){return ǃr.ǃUyJ(e),ǃr.ǃz(r),ǃr.ǃ$f(n),t(e),s.toDataURL(r||"image/png",n)},ǃr.ǃUbH=function(e,r=!1){return ǃr.ǃ$(e,Blob),r=!!r,ǃr.ǃUCV.ImageBitmap&&!r?createImageBitmap(e).then(ǃr.ǃUbp):ǃr.ǃUrD(e).then((e)=>ǃr.ǃUbD(e))},ǃr.ǃUbY=function(e){return ǃr.ǃ$(e,Image),t(e),T.getImageData(0,0,e.width,e.height)},ǃr.ǃUbD=function(e){return ǃr.ǃUCV.ImageBitmap?(ǃr.ǃt_(e,Image,ImageBitmap),createImageBitmap(e).then(ǃr.ǃUbp)):(ǃr.ǃ$(e,Image),ǃr.ǃfB(()=>ǃr.ǃUbY(e)))},ǃr.ǃUba=function(r,t,n){return ǃr.ǃ$(r,ImageData),ǃr.ǃz(t),ǃr.ǃ$f(n),e(),s.width=r.width,s.height=r.height,T.putImageData(r,0,0),ǃr.ǃUbF(s,t,n)},ǃr.ǃUbq=function(r,t,n){return ǃr.ǃ$(r,ImageData),ǃr.ǃz(t),ǃr.ǃ$f(n),ǃr.ǃUCV.ǃRa?ǃr.ǃUCV.ImageBitmap?createImageBitmap(r).then((e)=>ǃr.ǃUbd(e,t,n)):ǃr.ǃfB(()=>(e(),s.width=r.width,s.height=r.height,T.putImageData(r,0,0),ǃr.ǃRa(s,t,n))):ǃr.ǃfB(()=>ǃr.ǃUba(r,t,n))},ǃr.ǃUbA=function(r,t,n){return ǃr.ǃ$(r,ImageData),ǃr.ǃz(t),ǃr.ǃ$f(n),"number"!=typeof n&&(n=1),t=t||"image/png",n=ǃr.ǃsP(n,0,1),e(),s.width=r.width,s.height=r.height,T.putImageData(r,0,0),s.toDataURL(t,n)},ǃr.ǃUbW=function(r,t,n,i="columns"){var o=Math.floor;if(ǃr.ǃUyJ(r),ǃr.ǃ$t(t),ǃr.ǃ$t(n),ǃr.ǃz(i),"columns"!=i&&"rows"!=i)throw new Error("unexpected slicing mode. Supported values are 'columns' and 'rows'.");e(),s.width=r.width,s.height=r.height,T.drawImage(r,0,0);let d=o(r.width/t),a=o(r.height/n),l=[],u=0,U=0;if("columns"===i)for(u=0;ur||0>t)throw new Error("invalid target size");const d=n.context?n.context:ǃr.ǃUbh().getContext("2d");let a=n.quality?n.quality:"high";if(d.canvas.width=r,d.canvas.height=t,0===r||0===t)return d.canvas;if(!(e.width>r||e.height>t))d.drawImage(e,0,0,r,t),"high"===a&&o(d,r,t,0.1);else if((e.width/2r||r>=o||0>t||t>=d||r+n>o||t+i>d)throw new Error("invalid sub image");let a=new ImageData(n,i),s=new Uint32Array(e.data.buffer),T=new Uint32Array(a.data.buffer);return ǃr.ǃUbk(s,o,T,n,r,t,0,0,n,i),a},ǃr.ǃUbg=function(e,r,t,n){ǃr.ǃ$(e,ImageData),ǃr.ǃ$(r,ImageData),ǃr.ǃ$t(t),ǃr.ǃ$t(n),t|=0,n|=0;let i=0|e.width,o=0|e.height,d=0|r.width,a=0|r.height;if(0>t||0>n||t>i-d||n>o-a)throw new Error("invalid sub image");let s=new Uint32Array(r.data.buffer),T=new Uint32Array(e.data.buffer);ǃr.ǃUbk(s,d,T,i,0,0,t,n,d,a)};ǃr.ǃUbO=function(e,r,t,n,i){ǃr.ǃ$(e,ImageData),ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃ$t(n),ǃr.ǃ$t(i),r|=0,t|=0,n|=0,i|=0;let o=0|e.width,a=0|e.height;if(0>r||r>=o||0>t||t>=a||r+n>o||t+i>a)throw new Error("invalid sub image");let s=new Uint32Array(e.data.buffer);d(s,o,r,t,n,i,0)};ǃr.ǃUbI=function(e,r,t,n,i,o,s,T,l,u,U){if(ǃr.ǃ$(e,Uint32Array),ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃ$t(n),ǃr.ǃ$t(i),ǃr.ǃ$t(o),ǃr.ǃ$t(s),ǃr.ǃ$t(T),ǃr.ǃ$t(l),ǃr.ǃ$t(u),ǃr.ǃ$t(U),o>r||u>r||s>t||U>t)throw new Error("rectangle larger than destination");if(o>u||s>U)throw new Error("inner size larger than outer size");if(nT+u||i+s>l+U)throw new Error("inner rectange not inside outer rectangle");if(o===u&&s===U)return;let c=n+o,v=c-1,p=T+u,m=i+s,f=m-1,h=l+U,g=a(e,r,n,i);d(e,r,T,l,n-T,i-l,g);for(let d=l;dn&&(n=e.byteLength);let i=new Uint8Array(e,t,n);return ǃr.ǃUbC(i,r)},ǃr.ǃUbC=function(e,r){ǃr.ǃ$(e.buffer,ArrayBuffer),ǃr.ǃz(r);let t=new TextDecoder(r||"utf-8");return t.decode(e)},ǃr.ǃUby=function(e){ǃr.ǃk(e);let r=new TextEncoder("utf-8");return r.encode(e).buffer},ǃr.ǃUbb=function(e,r,t){ǃr.ǃ$(e,ArrayBuffer),ǃr.ǃ_u(r),ǃr.ǃhn(t);let n=0,i=e.byteLength,o=[];for(;nr>>18],c[63&e>>>12],c[63&e>>>6],c[63&e])}for(;o--;)n.push("=");return n.join("")},ǃr.ǃUbo=function(e){const r=e.indexOf("="),t=e.length-r,n=Math.round(0.75*r)-t,o=new Uint8Array(n),d=(r)=>{const t=e.charCodeAt(r);if(64t)return t-65;if(96t)return t-71;if(47t)return t+4;if(43===t)return 62;if(47===t)return 63;throw new Error(`Invalid character at column ${r}`)},a=(e)=>s>>16),a(255&e>>>8),a(255&e)}return o}}{function e(e,r){let t=ǃr.ǃUbe(e),n=ǃr.ǃUbe(r);return"null"===t||"null"===n||("undefined"===t||"undefined"===n?!1:t===n)}function r(e){console.warn("[Defence] "+e+" @",ǃr.ǃUCn())}function t(){if(l=-1,0ǃr.ǃURh(e))),r=[...e].join(",");console.warn(`An object derived from DefendedBase was not protected with debugDefend(). This will disable some checks. See the coding guidelines! Possible affected class names: ${r}`),d.clear(),a.clear()}}function n(e){let r=new Set;for(let t in e)r.add(t);return r}function i(e,r){let t=n(r),i=u.get(e);if(i){let r=[];for(let e of i.values())t.has(e)?t.delete(e):r.push(e);ǃr.ǃdx(r,[...t]),r.length&&console.warn(`[Defence] '${ǃr.ǃURh(e)}' constructor creates inconsistent properties: ${r.join(", ")}`)}else u.set(e,t)}ǃr.ǃUCn=function(){return new Error().stack},ǃr.ǃUbj=function(){debugger},ǃr.cast=function(e,r){return e&&e instanceof r?e:null},ǃr.ǃURh=function(e){return"undefined"==typeof e?"undefined":null===e?"null":"boolean"==typeof e?"":ǃr.ǃUCk(e)?"":ǃr.ǃFL(e)?"":ǃr.ǃFJ(e)?"":"symbol"==typeof e?"<"+e.toString()+">":ǃr.ǃUCj(e)?e.name&&"Function"!==e.name?e.name:"":"object"==typeof e?e.constructor&&e.constructor.name&&"Object"!==e.constructor.name?e.constructor.name:"":""},ǃr.ǃUbe=function(e){return null===e?"null":Array.isArray(e)?"array":typeof e};let d=new Map,a=new Map,s=new WeakMap,T=new WeakMap;ǃr.ǃUbN={};const o=new Set(["then","splice"]);ǃr.ǃUbN.get=function(e,t){return t in e||"symbol"==typeof t||o.has(t)||r(`Accessed missing property '${t}' from defended object '${ǃr.ǃURh(e)}', returning undefined`),T.has(e)&&"symbol"!=typeof t&&!o.has(t)&&r(`Accessed property '${t}' on a released object '${ǃr.ǃURh(e)}'\nObject was originally released at: ${T.get(e)})\nCall stack at access: `),e[t]},ǃr.ǃUbN.set=function(t,n,i){return n in t||d.has(t)||r(`Set non-existent property '${n}' to '${i}' on defended object '${ǃr.ǃURh(t)}'`),e(t[n],i)||d.has(t)||r(`Set '${ǃr.ǃUbe(t[n])}' property '${n}' to type '${ǃr.ǃUbe(i)}' on defended object '${ǃr.ǃURh(t)}'`),T.has(t)&&r(`Set property '${n}' on a released object '${ǃr.ǃURh(t)}'\nObject was originally released at: ${T.get(t)})\nCall stack at access: `),t[n]=i,!0},ǃr.ǃUbN.ǃUbK=function(e,r){throw new ReferenceError(`Cannot delete property '${r}' from defended object '${ǃr.ǃURh(e)}'`)},ǃr.ǃUbN.defineProperty=function(e,r){throw new ReferenceError(`Cannot define property '${r}' on defended object '${ǃr.ǃURh(e)}'`)},ǃr.ǃUbN.enumerate=function(e){throw new ReferenceError(`Cannot enumerate defended object '${ǃr.ǃURh(e)}'`)};let l=-1;ǃr.ǃT_=class{constructor(){if(ǃr.ǃUEk&&ǃr.ǃUCV.ǃUCY){let e=new.target,r=Object.create(e.prototype),n=new Proxy(r,ǃr.ǃUbN);return d.set(r,n),a.set(n,r),s.set(n,r),-1==l&&(l=requestAnimationFrame(t)),n}}},ǃr.ǃUbP=function(e){if(ǃr.ǃyd(e),ǃr.ǃUEk&&ǃr.ǃUCV.ǃUCY&&e instanceof ǃr.ǃT_){if(!a.has(e))return e;let r=a.get(e);return a.delete(e),d.delete(r),e}return ǃr.ǃvE?Object.seal(e):e},ǃr.ǃq=function(e,...r){ǃr.ǃ_u(e);let t;try{t=new e(...r)}catch(r){throw a.clear(),d.clear(),r}return ǃr.ǃUEk&&i(e,t),ǃr.ǃUbP(t)},ǃr.ǃTq=function(e){let r=s.get(e);r&&T.set(r,ǃr.ǃUCn())},ǃr.ǃ_W=function(e){let r=s.get(e);return!!r&&!!T.get(r)};let u=new Map}{const e=2*Math.PI,r=Math.PI/180,t=180/Math.PI;ǃr.wrap=function(e,t,n){var r=Math.floor;if(e=r(e),t=r(t),n=r(n),et?t:e},ǃr.ǃULk=function(r){return r%=e,0>r&&(r+=e),r},ǃr.ǃB$=function(e){return e*r},ǃr.ǃULh=function(e){return e*t},ǃr.ǃyp=function(e,r,t,n){return Math.hypot(t-e,n-r)},ǃr.ǃUbQ=function(e,r,t,n){const i=t-e,o=n-r;return i*i+o*o},ǃr.ǃULn=function(e,r,t,n){return Math.atan2(n-r,t-e)},ǃr.ǃUXH=function(e,r){var t=Math.cos,i=Math.sin;if(e===r)return 0;let o=i(e),d=t(e),a=i(r),s=t(r),T=o*a+d*s;return 1<=T?0:-1>=T?Math.PI:Math.acos(T)},ǃr.ǃUXY=function(e,r,t){var n=Math.cos,i=Math.sin;let o=i(e),d=n(e),a=i(r),s=n(r);return Math.acos(o*a+d*s)>t?0=o*d-i*a},ǃr.ǃUXD=function(e,r,t){let n=ǃr.ǃUXH(e,r);return ǃr.ǃUbZ(r,e)?ǃr.ǃULk(e+n*t):ǃr.ǃULk(e-n*t)},ǃr.ǃUvE=function(e,r,t){return e+t*(r-e)},ǃr.ǃUXp=function(e,r,t){return e===r?0:(t-e)/(r-e)},ǃr.ǃsj=function(e,r,t,n,i){return ǃr.ǃUvE(n,i,ǃr.ǃUXp(e,r,t))},ǃr.ǃUXB=function(e,r,t,n){return ǃr.ǃUvE(ǃr.ǃUvE(e,r,n),ǃr.ǃUvE(r,t,n),n)},ǃr.ǃUXd=function(e,r,t,n,i){return ǃr.ǃUvE(ǃr.ǃUXB(e,r,t,i),ǃr.ǃUXB(r,t,n,i),i)},ǃr.ǃUXc=function(e,r,t){return(e+r+(e-r)*Math.cos(t*Math.PI))/2},ǃr.ǃUbu=function(e){return 0r;r<<=1)e|=e>>r;return e+1},ǃr.ǃZP=function(e,r){return Math.round(e*r)/r},ǃr.ǃUSU=function(e){return Math.round(1e6*e)/1e6},ǃr.toFixed=function(e,r){ǃr.ǃhn(e),ǃr.ǃ$t(r);let t=e.toFixed(r),n=t.length-1;for(;0<=n&&"0"===t.charAt(n);--n);return 0<=n&&"."===t.charAt(n)&&--n,0>n?t:t.substr(0,n+1)},ǃr.ǃUXA=function(e,r,t){return ǃr.ǃsP(e,0,255)|ǃr.ǃsP(r,0,255)<<8|ǃr.ǃsP(t,0,255)<<16};const n=131072,i=65535,o=-65536;ǃr.ǃUXW=function(e,r,t){var d=Math.floor;return e=ǃr.ǃsP(d(1024*e),o,i),r=ǃr.ǃsP(d(1024*r),o,i),t=ǃr.ǃsP(d(1024*t),o,i),0>e&&(e+=n),0>r&&(r+=n),0>t&&(t+=n),-(e*n*n+r*n+t)},ǃr.ǃUSr=function(e){if(0<=e)return(255&e)/255;else{let r=Math.floor(-e/(n*n));return r>i&&(r-=n),r/1024}},ǃr.ǃUST=function(e){if(0<=e)return((65280&e)>>8)/255;else{let r=Math.floor(-e%(n*n)/n);return r>i&&(r-=n),r/1024}},ǃr.ǃUSv=function(e){if(0<=e)return((16711680&e)>>16)/255;else{let r=Math.floor(-e%n);return r>i&&(r-=n),r/1024}},ǃr.ǃUSJ=function(e,r){var t=Math.floor;for(ǃr.ǃ$t(e),ǃr.ǃ$t(r),e=t(e),r=t(r);0!==r;){let n=r;r=e%r,e=n}return e};const d=[[3,2],[4,3],[5,4],[5,3],[6,5],[14,9],[16,9],[16,10],[21,9]];ǃr.ǃUfB=function(e,r){var t=Math.floor,n=Math.abs;if(ǃr.ǃ$t(e),ǃr.ǃ$t(r),e=t(e),r=t(r),e===r)return[1,1];for(let t of d){let i=e/t[0]*t[1];if(1>n(r-i))return t.slice(0);if(i=e/t[1]*t[0],1>n(r-i))return[t[1],t[0]]}let i=ǃr.ǃUSJ(e,r);return[e/i,r/i]},ǃr.ǃUSL=function(e,r,t,n,i,o,a,s){var T=Math.abs;let l=0,u=0,U=0,c=0,v=0,p=0,m=0,f=0;if(ev)return!1;if(rm)return!1;let h=i-e+a-t,g=o-r+s-n,y=t-e,b=n-r,L=a-i,E=s-o,k=T(b*L-E*y);if(T(L*g-E*h)>k)return!1;return T(y*g-b*h)<=k},ǃr.ǃUSs=function(e,r,t,n,i,o,a,s,T,l,u,U){var c=Math.abs;let v=0,p=0,m=0,f=0;if(Tv)return!1;if(lm)return!1;let h=T-e+u-t,g=l-r+U-n,y=t-e,b=n-r,L=u-T,E=U-l,k=c(b*L-E*y);if(c(L*g-E*h)>k)return!1;return c(y*g-b*h)<=k},ǃr.ǃUSX=function(e,r,t,n,i){let o=0,d=0,a=0,s=0;en&&(n+=1),1r.length)return!1;const t=parseInt(r[0].trim(),10)/255,n=parseInt(r[1].trim(),10)/255,i=parseInt(r[2].trim(),10)/255;return isFinite(t)&&this.ǃUSB(t),isFinite(n)&&this.ǃUSc(n),isFinite(i)&&this.ǃUSD(i),this.ǃUdk(1),!0}ǃUSO(e){if("string"!=typeof e)return!1;e=e.replace(/^rgb\(|\)|%/,"");const r=e.split(",");if(3>r.length)return!1;const t=parseInt(r[0].trim(),10)/100,n=parseInt(r[1].trim(),10)/100,i=parseInt(r[2].trim(),10)/100;return isFinite(t)&&this.ǃUSB(t),isFinite(n)&&this.ǃUSc(n),isFinite(i)&&this.ǃUSD(i),this.ǃUdk(1),!0}ǃUSI(e){if("string"!=typeof e)return!1;e=e.replace(/^rgba\(|\)|%/,"");const r=e.split(",");if(4>r.length)return!1;const t=parseInt(r[0].trim(),10)/255,n=parseInt(r[1].trim(),10)/255,i=parseInt(r[2].trim(),10)/255,o=parseFloat(r[3].trim());return isFinite(t)&&this.ǃUSB(t),isFinite(n)&&this.ǃUSc(n),isFinite(i)&&this.ǃUSD(i),isFinite(o)&&this.ǃUdk(o),!0}ǃUSE(e){if("string"!=typeof e)return!1;e=e.replace(/^rgba\(|\)|%/,"");const r=e.split(",");if(4>r.length)return!1;const t=parseInt(r[0].trim(),10)/100,n=parseInt(r[1].trim(),10)/100,i=parseInt(r[2].trim(),10)/100,o=parseFloat(r[3].trim());return isFinite(t)&&this.ǃUSB(t),isFinite(n)&&this.ǃUSc(n),isFinite(i)&&this.ǃUSD(i),isFinite(o)&&this.ǃUdk(o),!0}ǃUrx(e){if("string"!=typeof e)return!1;if(e=e.replace(/\s+/,""),e.includes(",")){if(e.match(/^rgb\(/))return e.includes("%")?this.ǃUSO(e):this.ǃUSg(e);if(e.match(/^rgba\(/))return e.includes("%")?this.ǃUSE(e):this.ǃUSI(e);if(e.match(/^hsl|hsla\(/))return this.ǃUSC(e);else{const r=e.split(",");return e.includes("%")?3===r.length?this.ǃUSO(e):4===r.length&&this.ǃUSE(e):3===r.length?this.ǃUSg(e):4===r.length&&this.ǃUSI(e)}}else return this.ǃjg(e)}toJSON(){return[this.ǃUSF,this.ǃUSm,this.ǃUSh,this.ǃUSn]}ǃUSy(e,n,i,o){let d,r,a;if(ǃr.ǃUCx(e,0,360),ǃr.ǃUCx(n,0,100),ǃr.ǃUCx(i,0,100),ǃr.ǃUCx(o,0,1),e/=360,n/=100,i/=100,0===n)d=r=a=i;else{const o=0.5>i?i*(1+n):i+n-i*n,s=2*i-o;d=t(s,o,e+1/3),r=t(s,o,e),a=t(s,o,e-1/3)}return this.ǃUSB(d),this.ǃUSc(r),this.ǃUSD(a),this.ǃUdk(o),this}ǃUSC(e){const t=e.replace(/ |hsl|hsla|\(|\)|;/gi,""),i=r.exec(t),o=n.exec(t);return i&&4===i.length?(this.ǃUSy(+i[1],+i[2],+i[3],1),!0):o&&5===o.length&&(this.ǃUSy(+i[1],+i[2],+i[3],+i[4]),!0)}ǃUSb(){var e=Math.round;const t=this.ǃUSF,r=this.ǃUSm,n=this.ǃUSh,i=this.ǃUSn,o=Math.max(t,r,n),a=Math.min(t,r,n);let T=(o+a)/2,l,u;if(o===a)l=u=0;else{const e=o-a;u=0.5e.length||(this.ǃUSF=e[0],this.ǃUSm=e[1],this.ǃUSh=e[2],this.ǃUSn=4<=e.length?e[3]:1)}set r(e){this.ǃUSB(e)}get r(){return this.ǃUSd()}set ǃUSS(e){this.ǃUSc(e)}get ǃUSS(){return this.ǃUSH()}set b(e){this.ǃUSD(e)}get b(){return this.ǃUSY()}set a(e){this.ǃUdk(e)}get a(){return this.ǃUdx()}ǃUSo(e,r){switch(e){case 0:this.ǃUSB(r);break;case 1:this.ǃUSc(r);break;case 2:this.ǃUSD(r);break;case 3:this.ǃUdk(r);break;default:throw new RangeError("invalid color index");}}ǃUSj(e){switch(e){case 0:return this.ǃUSd();case 1:return this.ǃUSH();case 2:return this.ǃUSY();case 3:return this.ǃUdx();default:throw new RangeError("invalid color index");}}},ǃr.ǃBL.ǃUSe=Object.freeze(ǃr.ǃq(ǃr.ǃBL,1,1,1,1)),ǃr.ǃBL.ǃUSN=Object.freeze(ǃr.ǃq(ǃr.ǃBL,0,0,0,1)),ǃr.ǃBL.ǃUSK=Object.freeze(ǃr.ǃq(ǃr.ǃBL,0,0,0,0))}"use strict",ǃr.Rect=class{constructor(e,r,t,n){this.ǃUSP=0,this.ǃUSw=0,this.ǃUSQ=0,this.ǃUSZ=0,e instanceof ǃr.Rect?this.ǃze(e):this.set(e||0,r||0,t||0,n||0)}set(e,r,t,n){this.ǃUSP=+e,this.ǃUSw=+r,this.ǃUSQ=+t,this.ǃUSZ=+n}ǃUSu(e,r,t,n){this.ǃUSP=+e,this.ǃUSw=+r,this.ǃUSQ=this.ǃUSP+t,this.ǃUSZ=this.ǃUSw+n}ǃze(e){this.ǃUSP=e.ǃUSP,this.ǃUSw=e.ǃUSw,this.ǃUSQ=e.ǃUSQ,this.ǃUSZ=e.ǃUSZ}clone(){return new ǃr.Rect(this.ǃUSP,this.ǃUSw,this.ǃUSQ,this.ǃUSZ)}static ǃUoU(e,r){var t=Math.min,n=Math.max;ǃr.ǃ$(e,ǃr.Rect),ǃr.ǃ$(r,ǃr.Rect);const i=new ǃr.Rect;return i.ǃbr(t(e.ǃUSP,r.ǃUSP)),i.ǃUsS(t(e.ǃUSw,r.ǃUSw)),i.ǃ_T(n(e.ǃUSQ,r.ǃUSQ)),i.ǃ_J(n(e.ǃUSZ,r.ǃUSZ)),i}static ǃj$(e){return ǃr.ǃyd(e),new ǃr.Rect(e.left,e.top,e.right,e.bottom)}ǃav(e){return this.ǃUSP===e.ǃUSP&&this.ǃUSw===e.ǃUSw&&this.ǃUSQ===e.ǃUSQ&&this.ǃUSZ===e.ǃUSZ}ǃbr(e){this.ǃUSP=+e}ǃsS(){return this.ǃUSP}ǃUsS(e){this.ǃUSw=+e}ǃtq(){return this.ǃUSw}ǃ_T(e){this.ǃUSQ=+e}ǃso(){return this.ǃUSQ}ǃ_J(e){this.ǃUSZ=+e}ǃzN(){return this.ǃUSZ}toArray(){return[this.ǃUSP,this.ǃUSw,this.ǃUSQ,this.ǃUSZ]}ǃUSt(){return new Float64Array(this.toArray())}ǃUS$(e,r){e[r++]=this.ǃUSP,e[r++]=this.ǃUSw,e[r++]=this.ǃUSQ,e[r]=this.ǃUSZ}ǃUor(e,r){e[r++]=this.ǃUSP,e[r++]=this.ǃUSw,e[r++]=this.ǃUSQ,e[r++]=this.ǃUSw,e[r++]=this.ǃUSQ,e[r++]=this.ǃUSZ,e[r++]=this.ǃUSP,e[r]=this.ǃUSZ}width(){return this.ǃUSQ-this.ǃUSP}height(){return this.ǃUSZ-this.ǃUSw}ǃs_(){return(this.ǃUSP+this.ǃUSQ)/2}ǃsl(){return(this.ǃUSw+this.ǃUSZ)/2}offset(e,r){this.ǃUSP+=+e,this.ǃUSw+=+r,this.ǃUSQ+=+e,this.ǃUSZ+=+r}offsetLeft(e){this.ǃUSP+=+e}offsetTop(e){this.ǃUSw+=+e}ǃzK(e){this.ǃUSQ+=+e}ǃUoT(e){this.ǃUSZ+=+e}ǃUov(e){if(ǃr.ǃk(e),"x"!==e)throw new Error("invalid axis, only 'x' supported");this.ǃUSZ=this.ǃUSwt&&(this.ǃUSQ=t),this.ǃUSZ>r&&(this.ǃUSZ=r)}ǃUT$(e,n,t,r){this.ǃUSPn&&(this.ǃUSw=n),this.ǃUSQ>t&&(this.ǃUSQ=t),this.ǃUSZthis.ǃUSQ&&this.ǃUos(),this.ǃUSw>this.ǃUSZ&&this.ǃUTJ()}ǃdQ(e){return!(e.ǃUSQthis.ǃUSQ||e.ǃUSw>this.ǃUSZ)}ǃUoi(e,r,t){return!(e.ǃUSQ+rthis.ǃUSQ||e.ǃUSw+t>this.ǃUSZ)}ǃUJL(e,r){return e>=this.ǃUSP&&e<=this.ǃUSQ&&r>=this.ǃUSw&&r<=this.ǃUSZ}ǃUUA(e){return e.ǃUSP>=this.ǃUSP&&e.ǃUSw>=this.ǃUSw&&e.ǃUSQ<=this.ǃUSQ&&e.ǃUSZ<=this.ǃUSZ}ǃdP(e){e.ǃUSPthis.ǃUSQ&&(this.ǃUSQ=e.ǃUSQ),e.ǃUSZ>this.ǃUSZ&&(this.ǃUSZ=e.ǃUSZ)}ǃUBu(e){this.ǃUSP=ǃr.ǃUvE(e.ǃUSP,e.ǃUSQ,this.ǃUSP),this.ǃUSw=ǃr.ǃUvE(e.ǃUSw,e.ǃUSZ,this.ǃUSw),this.ǃUSQ=ǃr.ǃUvE(e.ǃUSP,e.ǃUSQ,this.ǃUSQ),this.ǃUSZ=ǃr.ǃUvE(e.ǃUSw,e.ǃUSZ,this.ǃUSZ)}},"use strict";{function e(e,n,i,o){eo?n:o):(r=ei?n:i):io?e:o):(r=ni?e:i)}let r=0,t=0;ǃr.ǃLG=class{constructor(e,r,t,n,i,o,d,a){this.ǃUo_=0,this.ǃUol=0,this.ǃUot=0,this.ǃUo$=0,this.ǃUof=0,this.ǃUoz=0,this.ǃUoF=0,this.ǃUom=0,e instanceof ǃr.ǃLG?this.ǃze(e):this.set(e||0,r||0,t||0,n||0,i||0,o||0,d||0,a||0)}set(e,r,t,n,i,o,d,a){this.ǃUo_=+e,this.ǃUol=+r,this.ǃUot=+t,this.ǃUo$=+n,this.ǃUof=+i,this.ǃUoz=+o,this.ǃUoF=+d,this.ǃUom=+a}ǃse(e,r,t,n){this.set(e,r,t,r,t,n,e,n)}ǃze(e){this.ǃUo_=e.ǃUo_,this.ǃUol=e.ǃUol,this.ǃUot=e.ǃUot,this.ǃUo$=e.ǃUo$,this.ǃUof=e.ǃUof,this.ǃUoz=e.ǃUoz,this.ǃUoF=e.ǃUoF,this.ǃUom=e.ǃUom}ǃav(e){return this.ǃUo_===e.ǃUo_&&this.ǃUol===e.ǃUol&&this.ǃUot===e.ǃUot&&this.ǃUo$===e.ǃUo$&&this.ǃUof===e.ǃUof&&this.ǃUoz===e.ǃUoz&&this.ǃUoF===e.ǃUoF&&this.ǃUom===e.ǃUom}ǃUoh(e){this.ǃUo_=+e}ǃLZ(){return this.ǃUo_}ǃUon(e){this.ǃUol=+e}ǃLu(){return this.ǃUol}ǃUoV(e){this.ǃUot=+e}ǃsT(){return this.ǃUot}ǃUop(e){this.ǃUo$=+e}ǃsv(){return this.ǃUo$}ǃUoB(e){this.ǃUof=+e}ǃsU(){return this.ǃUof}ǃUod(e){this.ǃUoz=+e}ǃsr(){return this.ǃUoz}ǃUoc(e){this.ǃUoF=+e}ǃsJ(){return this.ǃUoF}ǃUoH(e){this.ǃUom=+e}ǃsL(){return this.ǃUom}toArray(){return[this.ǃUo_,this.ǃUol,this.ǃUot,this.ǃUo$,this.ǃUof,this.ǃUoz,this.ǃUoF,this.ǃUom]}ǃUSt(){return new Float64Array(this.toArray())}ǃUS$(e,r){e[r++]=this.ǃUo_,e[r++]=this.ǃUol,e[r++]=this.ǃUot,e[r++]=this.ǃUo$,e[r++]=this.ǃUof,e[r++]=this.ǃUoz,e[r++]=this.ǃUoF,e[r]=this.ǃUom}offset(e,r){this.ǃUo_+=+e,this.ǃUol+=+r,this.ǃUot+=+e,this.ǃUo$+=+r,this.ǃUof+=+e,this.ǃUoz+=+r,this.ǃUoF+=+e,this.ǃUom+=+r}round(){var e=Math.round;this.ǃUo_=e(this.ǃUo_),this.ǃUol=e(this.ǃUol),this.ǃUot=e(this.ǃUot),this.ǃUo$=e(this.ǃUo$),this.ǃUof=e(this.ǃUof),this.ǃUoz=e(this.ǃUoz),this.ǃUoF=e(this.ǃUoF),this.ǃUom=e(this.ǃUom)}floor(){var e=Math.floor;this.ǃUo_=e(this.ǃUo_),this.ǃUol=e(this.ǃUol),this.ǃUot=e(this.ǃUot),this.ǃUo$=e(this.ǃUo$),this.ǃUof=e(this.ǃUof),this.ǃUoz=e(this.ǃUoz),this.ǃUoF=e(this.ǃUoF),this.ǃUom=e(this.ǃUom)}ceil(){var e=Math.ceil;this.ǃUo_=e(this.ǃUo_),this.ǃUol=e(this.ǃUol),this.ǃUot=e(this.ǃUot),this.ǃUo$=e(this.ǃUo$),this.ǃUof=e(this.ǃUof),this.ǃUoz=e(this.ǃUoz),this.ǃUoF=e(this.ǃUoF),this.ǃUom=e(this.ǃUom)}ǃs$(e){this.ǃUo_=e.ǃUSP,this.ǃUol=e.ǃUSw,this.ǃUot=e.ǃUSQ,this.ǃUo$=e.ǃUSw,this.ǃUof=e.ǃUSQ,this.ǃUoz=e.ǃUSZ,this.ǃUoF=e.ǃUSP,this.ǃUom=e.ǃUSZ}ǃpu(e,r){0===r?this.ǃs$(e):this.ǃUdM(e,Math.sin(r),Math.cos(r))}ǃUdM(e,r,t){const n=e.ǃUSP*r,i=e.ǃUSw*r,o=e.ǃUSQ*r,d=e.ǃUSZ*r,a=e.ǃUSP*t,s=e.ǃUSw*t,T=e.ǃUSQ*t,l=e.ǃUSZ*t;this.ǃUo_=a-i,this.ǃUol=s+n,this.ǃUot=T-i,this.ǃUo$=s+o,this.ǃUof=T-d,this.ǃUoz=l+o,this.ǃUoF=a-d,this.ǃUom=l+n}ǃUoD(n){e(this.ǃUo_,this.ǃUot,this.ǃUof,this.ǃUoF),n.ǃUSP=r,n.ǃUSQ=t,e(this.ǃUol,this.ǃUo$,this.ǃUoz,this.ǃUom),n.ǃUSw=r,n.ǃUSZ=t}ǃUJL(e,r){let t=this.ǃUot-this.ǃUo_,n=this.ǃUo$-this.ǃUol;const i=this.ǃUof-this.ǃUo_,o=this.ǃUoz-this.ǃUol,d=e-this.ǃUo_,a=r-this.ǃUol;let s=t*t+n*n,T=t*i+n*o,l=t*d+n*a;const U=i*i+o*o,c=i*d+o*a;let p=1/(s*U-T*T),m=(U*l-T*c)*p,u=(s*c-T*l)*p;return 0<=m&&0m+u||(t=this.ǃUoF-this.ǃUo_,n=this.ǃUom-this.ǃUol,s=t*t+n*n,T=t*i+n*o,l=t*d+n*a,p=1/(s*U-T*T),m=(U*l-T*c)*p,u=(s*c-T*l)*p,0<=m&&0m+u)}ǃs_(){return(this.ǃUo_+this.ǃUot+this.ǃUof+this.ǃUoF)/4}ǃsl(){return(this.ǃUol+this.ǃUo$+this.ǃUoz+this.ǃUom)/4}ǃUoY(e,r,t,n){return this.ǃUJL(e,r)||this.ǃUJL(t,n)||ǃr.ǃUSX(e,r,t,n,this)}ǃUoa(e){let r=e.ǃs_(),t=e.ǃsl();if(this.ǃUJL(r,t))return!0;if(r=this.ǃs_(),t=this.ǃsl(),e.ǃUJL(r,t))return!0;const n=this.ǃUo_,i=this.ǃUol,o=this.ǃUot,d=this.ǃUo$,a=this.ǃUof,s=this.ǃUoz,T=this.ǃUoF,l=this.ǃUom;return ǃr.ǃUSX(n,i,o,d,e)||ǃr.ǃUSX(o,d,a,s,e)||ǃr.ǃUSX(a,s,T,l,e)||ǃr.ǃUSX(T,l,n,i,e)}ǃtQ(){this.ǃUoq(0,2),this.ǃUoq(1,3),this.ǃUoq(6,4),this.ǃUoq(7,5)}ǃtu(){this.ǃUoq(0,6),this.ǃUoq(1,7),this.ǃUoq(2,4),this.ǃUoq(3,5)}ǃtP(){this.ǃUoq(2,6),this.ǃUoq(3,7)}ǃUoq(e,r){const t=this.ǃUoA(e);this.ǃUoW(e,this.ǃUoA(r)),this.ǃUoW(r,t)}ǃUoA(e){switch(e){case 0:return this.ǃUo_;case 1:return this.ǃUol;case 2:return this.ǃUot;case 3:return this.ǃUo$;case 4:return this.ǃUof;case 5:return this.ǃUoz;case 6:return this.ǃUoF;case 7:return this.ǃUom;default:throw new RangeError("invalid quad point index");}}ǃUoW(e,r){switch(r=+r,e){case 0:this.ǃUo_=r;break;case 1:this.ǃUol=r;break;case 2:this.ǃUot=r;break;case 3:this.ǃUo$=r;break;case 4:this.ǃUof=r;break;case 5:this.ǃUoz=r;break;case 6:this.ǃUoF=r;break;case 7:this.ǃUom=r;break;default:throw new RangeError("invalid quad point index");}}}}{const e="loaded",r=localforage.ǃHS({name:"PersistantMap"});ǃr.ǃUoG=class extends Map{constructor(e){super(),this.state="loading",this.ǃUok=e,this.ǃUoM=[],this.ǃUox=ǃr.ǃq(ǃr.ǃXA,()=>this.ǃUoR(e),500),this.ǃUog=this.ǃUoO(e)}ǃUoI(){if(!this.ǃUoE())throw new Error("PersistantMap not ready for access")}ǃUoC(){if(0this.ǃUoC()).catch((e)=>app.ǃfQ(e))}ǃUoO(t){return r.getItem(t).then((r)=>{r=r||[];for(let e of r)super.set(e[0],e[1]);return this.state=e,this},(e)=>{throw this.state="failed",`Failed to load PersistantMap with id "${t}" Error => "${e}"`})}release(){this.clear(),this.ǃUox.ǃTq()}ǃUoy(e,...r){if(!e||!e in this||"async"===e||"onReady"===e||"force"===e)throw new Error(`Cannot execute invalid method "${e}" asychronously`);return this.ǃUog.then(()=>new Promise((t)=>{let n=this[e](...r);this.ǃUoM.push(()=>t(n)),this.ǃUoR(this.ǃUok)}))}async(e,...r){if(!e||!e in this||"async"===e||"onReady"===e||"force"===e)throw new Error(`Cannot execute invalid method "${e}" asychronously`);return this.ǃUog.then(()=>new Promise((t)=>{let n=this[e](...r);this.ǃUoM.push(()=>t(n))}))}ǃUob(e){return e?this.ǃUog.then(e):this.ǃUog}ǃUoE(){return this.state===e}set(e,r){return ǃr.ǃk(e),this.ǃUoI(),this.ǃUox.ǃU_(),super.set(e,r)}get(e){return this.ǃUoI(),super.get(e)}has(e){return this.ǃUoI(),super.has(e)}clear(){return this.ǃUoI(),this.ǃUox.ǃU_(),super.clear()}delete(e){return this.ǃUoI(),this.ǃUox.ǃU_(),super.delete(e)}entries(){return this.ǃUoI(),super.entries()}forEach(e,r){return this.ǃUoI(),super.forEach(e,r)}keys(){return this.ǃUoI(),super.keys()}values(){return this.ǃUoI(),super.values()}[Symbol.iterator](){return this.ǃUoI(),super[Symbol.iterator]()}}}{const e="00";ǃr.Crypto={},ǃr.Crypto.ǃUoo=function(r){let t="";const n=new DataView(r);for(let o=0;o(e/=n/2)?t/2*e*e+r:-t/2*(--e*(e-2)-1)+r}static ǃUjT(e,r,t,n){return t*(e/=n)*e*e+r}static ǃUjv(e,r,t,n){return t*((e=e/n-1)*e*e+1)+r}static ǃUjJ(e,r,t,n){return 1>(e/=n/2)?t/2*e*e*e+r:t/2*((e-=2)*e*e+2)+r}static ǃUjL(e,r,t,n){return t*(e/=n)*e*e*e+r}static ǃUjs(e,r,t,n){return-t*((e=e/n-1)*e*e*e-1)+r}static ǃUjX(e,r,t,n){return 1>(e/=n/2)?t/2*e*e*e*e+r:-t/2*((e-=2)*e*e*e-2)+r}static ǃUji(e,r,t,n){return t*(e/=n)*e*e*e*e+r}static ǃUj_(e,r,t,n){return t*((e=e/n-1)*e*e*e*e+1)+r}static ǃUjl(e,r,t,n){return 1>(e/=n/2)?t/2*e*e*e*e*e+r:t/2*((e-=2)*e*e*e*e+2)+r}static ǃUjt(e,r,t,n){return-t*i(e/n*(l/2))+t+r}static ǃUj$(e,r,t,n){return t*o(e/n*(l/2))+r}static ǃUjf(e,r,t,n){return-t/2*(i(l*e/n)-1)+r}static ǃUjz(e,r,t,i){return 0===e?r:t*n(2,10*(e/i-1))+r}static ǃUjF(e,r,t,i){return e===i?r+t:t*(-n(2,-10*e/i)+1)+r}static ǃUjm(e,r,t,i){return 0===e?r:e===i?r+t:1>(e/=i/2)?t/2*n(2,10*(e-1))+r:t/2*(-n(2,-10*--e)+2)+r}static ǃUjh(e,t,n,i){return-n*(r(1-(e/=i)*e)-1)+t}static ǃUjn(e,t,n,i){return n*r(1-(e=e/i-1)*e)+t}static ǃUjV(e,t,n,i){return 1>(e/=i/2)?-n/2*(r(1-e*e)-1)+t:n/2*(r(1-(e-=2)*e)+1)+t}static ǃUjp(r,t,i,u){let d=1.70158,s=0,U=i;return 0===r?t:1===(r/=u)?t+i:(s||(s=0.3*u),Ur?-0.5*(U*n(2,10*(r-=1))*o((r*u-d)*(2*l)/s))+t:0.5*(U*n(2,-10*(r-=1))*o((r*u-d)*(2*l)/s))+i+t)}static ǃUjc(e,r,t,n,i){return void 0===i&&(i=1.70158),t*(e/=n)*e*((i+1)*e-i)+r}static ǃUjH(e,r,t,n,i){return void 0===i&&(i=1.70158),t*((e=e/n-1)*e*((i+1)*e+i)+1)+r}static ǃUjD(e,r,t,n,i){return void 0===i&&(i=1.70158),1>(e/=n/2)?t/2*(e*e*(((i*=1.525)+1)*e-i))+r:t/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+r}static ǃUjY(e,r,t,n){return t-this.ǃUja(n-e,0,t,n)+r}static ǃUja(e,r,t,n){return(e/=n)<1/2.75?t*(7.5625*e*e)+r:e<2/2.75?t*(7.5625*(e-=1.5/2.75)*e+0.75)+r:e<2.5/2.75?t*(7.5625*(e-=2.25/2.75)*e+0.9375)+r:t*(7.5625*(e-=2.625/2.75)*e+0.984375)+r}static ǃUjq(e,r,t,n){return e{let e=ǃr.ǃUjA.ǃUjG,n=e.fontCandidateList,i=new Set(e.fontAlwaysShowList),o=[];u=document.createElement("canvas"),u.width=s,u.height=T,U=u.getContext("2d"),U.textBaseline="top",U.fillStyle="black",c=r("unknownFontName948958658");for(let e of n){if(i.has(e)){d.push(e);continue}o.push(ǃr.ǃfB(()=>{t(e)&&d.push(e)}))}return Promise.all(o)}).then(()=>(o=!0,u.width=32,u.height=32,u=null,U=null,c=null,a=null,d.sort(),d)).catch((e)=>{throw a=null,e}),a)}}}"use strict",ǃr.ǃUjA.ǃUjG={fontCandidateList:["Algerian","Andale Mono","Arial","Avant Garde","Baskerville","Big Caslon","Bitstream Vera","Bodoni MT","Book Antiqua","Bookman","Bookman Old Style","Bradley Hand ITC TT","Broadway","Brush Script MT","Calibri","Calisto MT","Candara","Cambria","Cardo","Carrois Gothic SC","Caslon Roman","Century Gothic","Century Schoolbook","Comic Sans MS","Consolas","Copperplate","Copperplate Gothic","Courier New","Cutive Mono","Dancing Script","Diavlo","Didot","Droid","Droid Sans","Droid Sans Mono","Droid Serif","Franklin Gothic","Futura","Garamond","Geneva","Gentium","Georgia","Ghostscript","Gill Sans","Goudy","Goudy Old Style","Haettenschweiler","Helvetica","Hoefler Text","Impact","ITC Stone Serif","Junicode","Latin Modern","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Grande","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Mistral","Moire","Monaco","MS Mincho","MS Sans Serif","New Athena Unicode","New York","Noto","Noto Sans","Noto Serif","Old Standard TT","Onyx","Optima","Oxygen","Palatino","Palatino Linotype","Papyrus","Perpetua","Perpetua Titling MT","Playbill","Roboto","Rockwell","San Francisco","Segoe UI","Snap ITC","Source Sans Pro","Source Code Pro","Stencil","Symbol","Symbola","Tahoma","Times","Times New Roman","Trebuchet MS","Tw Cen MT","UniFraktur","Verdana","Webdings","Wide Latin","Wingdings"],fontAlwaysShowList:["Arial","Times New Roman"]},"use strict";{function e(e){return i.get(e)}ǃr.ǃUWU="\uFEFF";const r=new Set([..."0123456789"]);ǃr.ǃUjk=function(e){return ǃr.ǃk(e),r.has(e)};const t=new Set([..." \t\n\r\xA0\x85\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u200B\u2028\u2029\u202F\u205F\u3000"]);ǃr.ǃUjM=function(e){return ǃr.ǃk(e),t.has(e)},ǃr.ǃUjx=function(e){return[...e].filter((e)=>!ǃr.ǃUjM(e)).join("")},ǃr.ǃUdG=function(e){for(const r of e)if(!ǃr.ǃUjM(r))return!1;return!0},ǃr.ǃUjR=function(e){return ǃr.ǃk(e),1===e.length&&32>e.charCodeAt(0)},ǃr.ǃUjg=function(e){return[...e].filter((e)=>!ǃr.ǃUjR(e)).join("")};const n=new Set([..."0123456789.+-e"]);ǃr.ǃUjO=function(e){if(ǃr.ǃk(e),e=e.trim(),!e.length)return!1;let t=e.charAt(0);if("-"!==t&&!r.has(t))return!1;for(let r of e)if(!n.has(r))return!1;return!0},ǃr.ǃUrv=function(e){ǃr.ǃk(e);let r=e.length;for(;0",">"],["\"","""],["'","'"]]);const o=/[&<>"']/g;ǃr.ǃUjE=function(r){return ǃr.ǃzg(r),r.replace(o,e)},ǃr.ǃUjC=function(e){let r=ǃr.ǃUAy(e,"\\","\\\\");return r=ǃr.ǃUAy(r,"\"","\\\""),r=ǃr.ǃUAy(r,"\t","\\t"),r=ǃr.ǃUAy(r,"\r",""),ǃr.ǃUAy(r,"\n","\\n")},ǃr.ǃUA_=function(e){let r=ǃr.ǃUAy(e,"&","&");return r=ǃr.ǃUAy(r,"<","<"),r=ǃr.ǃUAy(r,">",">"),ǃr.ǃUAy(r,"\"",""")};const d=/[-[\]{}()*+?.,\\^$|#\s]/g;ǃr.ǃUjy=function(e){return ǃr.ǃzg(e),e.replace(d,"\\$&")},ǃr.ǃUjb=function(e,r,t=!1){if(ǃr.ǃk(e),ǃr.ǃk(r),!r)return[];t||(e=e.toLowerCase(),r=r.toLowerCase());const n=r.length;let i=0,o=0,d=[];for(;-1<(o=e.indexOf(r,i));)d.push(o),i=o+n;return d},ǃr.ǃUAy=function(e,r,t){return ǃr.ǃk(e),ǃr.ǃk(r),ǃr.ǃk(t),e.replace(new RegExp(ǃr.ǃUjy(r),"g"),t)},ǃr.ǃUXa=function(e,r,t){return ǃr.ǃk(e),ǃr.ǃk(r),ǃr.ǃk(t),e.replace(new RegExp(ǃr.ǃUjy(r),"gi"),t)};let a=new WeakMap;ǃr.ǃzL=function(e,r,t){ǃr.ǃIO(e),ǃr.ǃzg(r);let n=a.get(e);if("string"==typeof r){if(!t&&r===n)return;e.textContent=r,a.set(e,r)}else{if(!t&&r.ǃav(n))return;if(r.ǃUjS()){let t=r.toString();e.textContent=t,a.set(e,t)}else e.innerHTML=r.ǃjK(),r instanceof ǃr.ǃXP&&r.ǃUjo(e),a.set(e,r.toString())}},ǃr.ǃUjj=function(e,r){return e instanceof ǃr.ǃUy_||e instanceof ǃr.ǃXP?e.ǃav(r):r instanceof ǃr.ǃUy_||r instanceof ǃr.ǃXP?r.ǃav(e):e===r},ǃr.ǃUje=function(e,...r){ǃr.ǃk(e);let t=e;for(let n=0,i=r.length,o;nn?1:tr?t(10*r)/10:t(r),ǃj(n+"kilobytes",r)}if(er?t(10*r)/10:t(r),ǃj(n+"megabytes",r)}if(er?t(10*r)/10:t(r),ǃj(n+"gigabytes",r)}else{let r=e/u;return r=10>r?t(10*r)/10:t(r),ǃj(n+"terabytes",r)}};const U={ǃUjK:!1,ǃUjP:!0,ǃUjw:!0,ǃUjQ:!0,ǃUjZ:!0};ǃr.ǃUju=function(e,r){var t=Math.floor;r=Object.assign({},U,r),ǃr.ǃJ.ǃrx("common.time");const n=[];if(r.ǃUjP){const r=t(e/(24*3600));0e?"-":"";e=Math.abs(e);let n=e.toString(),o=r-n.length;for(let n=0;ne.toUpperCase())},ǃr.ǃUAB=function(e,r){let t=e.split(".").map((e)=>e.trim()),n=r.split(".").map((e)=>e.trim());ǃr.ǃtN(t,4,"0"),ǃr.ǃtN(n,4,"0"),t=t.map((e)=>parseInt(e,10)),n=n.map((e)=>parseInt(e,10));for(let o=0;4>o;++o){const e=t[o]-n[o];if(0!=e)return 0>e?-1:1}return 0},ǃr.ǃUAS=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e)=>{const t=Math.floor(16*Math.random()),r="x"===e?t:8|3&t;return r.toString(16)})}}"use strict",ǃr.ǃUy_=class{constructor(e){ǃr.ǃk(e),this.ǃUeU=e,this.ǃUer=!this.ǃUeU.includes("<")&&!this.ǃUeU.includes("&")}toString(){return this.ǃUeU}valueOf(){return this.ǃUeU}ǃUjS(){return this.ǃUer}ǃjK(){return this.ǃUeU}ǃav(e){return e instanceof ǃr.ǃUy_?this.ǃUeU===e.ǃUeU:e instanceof ǃr.ǃXP?this.ǃUeU===e.ǃjK():this.ǃUeU===e}},"use strict";{function e(e,t,n){const o=r.get(n);if(!o)return e;else if("string"!=typeof o){if(Array.isArray(o)){assert(2===o.length,"invalid bbcode entry");let e=o[0],r=o[1];return t?""+e+">":`<${e} class="${r}">`}assert(!1,"invalid bbcode entry")}else if("a"===o&&!t){const e=parseInt(n.substring(1),10)-1;if(0>e||e>=i.length)throw new Error("invalid bbcode link substitution");const r=i[e];if("string"==typeof r)return``;if("function"==typeof r)return``;throw new TypeError("invalid bbcode link action")}else return"<"+t+o+">"}const r=new Map([["b","strong"],["i","em"],["s","s"],["u","u"],["sub","sub"],["sup","sup"],["small","small"],["mark","mark"],["a1","a"],["a2","a"],["a3","a"],["a4","a"],["a5","a"],["a6","a"],["a7","a"],["a8","a"],["a9","a"],["bad",["span","bbCodeBad"]],["good",["span","bbCodeGood"]],["info",["span","bbCodeInfo"]],["h1",["span","bbCodeH1"]],["h2",["span","bbCodeH2"]],["h3",["span","bbCodeH3"]],["h4",["span","bbCodeH4"]],["item",["span","bbCodeItem"]]]),t=/\[(\/?)([a-zA-Z0-9]+)\]/g,n=/\[(\/?)(.*?)\]/g;let i=null;const o=/\n/g;ǃr.ǃXP=class{constructor(e,r){if(ǃr.ǃk(e),ǃr.ǃVg(r),this.ǃUeT=r&&r.ǃUdH?e:ǃr.ǃUjE(e),this.ǃUev="",this.ǃUeJ=!1,this.ǃUeL=[],r&&(this.ǃUeJ=!!r.ǃzs,r.links)){if(ǃr.ǃre(r.links),9")),this.ǃUev=r}return this.ǃUev}ǃUjo(e){if(this.ǃUeL.length)for(let r=0,t=this.ǃUeL.length;rt)return;if(1===e.length){const n=e[0],i=n.text,o=n.ǃUdW;if(100>=i.length&&!i.includes("\n")){const e=r(i,o);if(e.width<=t){const r=[];return this.ǃUeN(r,i,o,e.width,e.height),void this.ǃUee(r,e.width,e.height)}}}let i;i="word"===n?e.map((e)=>({ǃUeK:this.ǃUeP(e.text),ǃUdW:e.ǃUdW})):e.map((e)=>({ǃUeK:[...e.text],ǃUdW:e.ǃUdW})),this.ǃUew(i,r,t)}ǃUeP(e){const r=[...e],t=[];let n="",i=!1;for(const o of r)if("\n"===o)n&&t.push(n),t.push("\n"),n="";else if(!n)n=o,i=ǃr.ǃUjM(o);else{const e=ǃr.ǃUjM(o);e===i?n+=o:(t.push(n),n=o,i=e)}return n&&t.push(n),t}ǃUew(e,r,t){var n=Math.max;let i="",o=0,d=0,a=0,s=0,T=[];for(const l of e){const e=l.ǃUdW,u=l.ǃUeK;for(const l of u){if("\n"===l){0==a&&(a=r(" ",e).height),i&&this.ǃUeN(T,i,e,o,d||a),this.ǃUee(T,s+o,a),T=[],i="",o=0,d=0,s=0,a=0;continue}const u=i+l,U=r(u,e),c=U.width,v=U.height;if(!(s+c>=t))i=u,o=c,d=n(d,v),a=n(a,v);else if(i&&this.ǃUeN(T,i,e,o,d),T.length&&(this.ǃUee(T,s+o,a),T=[]),s=0,ǃr.ǃUdG(l))i="",o=0,d=0,a=0;else{i=l;const t=r(l,e);o=t.width,d=t.height,a=t.height}}i&&(this.ǃUeN(T,i,e,o,d),s+=o,i="",o=0,d=0)}T.length&&this.ǃUee(T,s+o,a);for(const n of this.ǃUej){const e=n.ǃUdq;if(!e.length)continue;const t=e[e.length-1],i=t.text,o=i.trimEnd();if(!o)n.width-=t.width,e.pop();else if(o.lengthǃr.ǃo.ǃUNJ(e.ǃUNL()))}static ǃUNs(e,r){return r?r.startsWith("http:")||r.startsWith("https:")?r:(console.warn(`[LANG] Failed to find '${t}' string ${e}'`),`[${r}]`):r}static ǃb(t){if(ǃr.ǃk(t),assert(r,"English language not initialised"),e){let n=e.ǃUNX(t);return n===d?(n=r.ǃUNX(t),n===d?n:ǃr.ǃJ.ǃUNs(t,n)):n}return r.ǃUNX(t)}static ǃUNi(t,n){return ǃr.ǃk(t),ǃr.ǃ$t(n),e?e.ǃUN_(n):r.ǃUN_(n)}static ǃUNl(e){return ǃr.ǃk(e),new ǃr.ǃXP(ǃr.ǃJ.ǃb(e))}static ǃUNt(e){return!!ǃr.ǃJ.ǃb(e).match(/{\d+}|\{{1}.+\}{1}/g)}static ǃUN$(e){ǃr.ǃre(e);const r=[];for(const t of e)"number"==typeof t?r.push(ǃr.ǃJ.ǃUUn(t)):r.push(t);return r}static ǃUUn(t,n){return ǃr.ǃhn(t),n=Object.assign({},a,n),t.toLocaleString((e||r).ǃUnY(),n)}static ǃUNf(e,...r){return ǃr.ǃk(e),1===r.length&&ǃr.ǃmg(r[0])?ǃr.ǃUjN(ǃr.ǃJ.ǃb(e),r[0]):ǃr.ǃUje(ǃr.ǃJ.ǃb(e),...ǃr.ǃJ.ǃUN$(r))}static ǃUNz(e,...r){return ǃr.ǃk(e),new ǃr.ǃXP(ǃr.ǃUje(ǃr.ǃJ.ǃb(e),...ǃr.ǃJ.ǃUN$(r)))}static ǃUNF(e,r,...t){ǃr.ǃk(e),ǃr.ǃVg(r);const n=r&&"number"==typeof r.ǃXj?Math.floor(r.ǃXj):0;if(0>n||n>=t.length)throw new RangeError("invalid plural index");const i=t[n];if("number"!=typeof i)throw new TypeError("expected number for pluralising string");const o=ǃr.ǃJ.ǃUNi(e,i),d=ǃr.ǃUje(ǃr.ǃJ.ǃb(e+"."+o),...ǃr.ǃJ.ǃUN$(t));return r&&r.ǃUmC?new ǃr.ǃXP(d):d}static ǃAM(){let e=o.length,r=e-1;for(;0<=r&&!("."!==o[r][0]);--r);0>r&&(r=0);let t="";for(;ro.length,"language context stack reached 100 items - is this right?"),ǃr.ǃJ.ǃUNm()}static ǃrR(){assert(0{const t=await ǃr.ǃfV(r);this.ǃUEg(t,e)})),this}ǃUEg(e,r){ǃr.ǃyd(e);let t=e.languageTag;if(!this.ǃUNA)this.ǃUNA=t,"undefined"!=typeof Intl.PluralRules&&(this.ǃUNk=new Intl.PluralRules(this.ǃUNA));else if(this.ǃUNA!==t)throw new Error(`language file has wrong language tag (has '${t}', expected '${this.ǃUNA}')`);if(e.main){this.ǃUNa=e.englishName,this.ǃUNq=e.nativeName;const r=e.rightToLeft;this.ǃUNW="string"==typeof r?"true"==r:!!r,this.ǃUNY=!0}this.ǃUNM(e.text,"",r)}ǃUNM(e,r,t){ǃr.ǃyd(e),ǃr.ǃk(r),r&&(r+=".");for(let[n,i]of Object.entries(e)){let e=r+n;if("object"==typeof i)this.ǃUNM(i,e,t);else if("string"==typeof i){if(!t&&this.ǃUNG.has(e))throw new Error(`key name '${e}' already exists in language string map`);this.ǃUNG.set(e,i)}}}ǃUNh(e){ǃr.ǃk(e),this.ǃqf=e}ǃUNX(e){if(ǃr.ǃk(e),!this.ǃUNY)throw new Error("language not loaded");if(!e)throw new Error("cannot lookup empty key");if(e.startsWith(".")){if(!this.ǃqf)throw new Error("relative language string used with no context set");e=this.ǃqf+e}let r=this.ǃUNG.get(e);return"undefined"==typeof r?ǃr.ǃJ.ǃUNc:r}ǃUN_(e){return ǃr.ǃ$t(e),this.ǃUNk?this.ǃUNk.select(e):"other"}ǃUNL(){if(!this.ǃUNY)throw new Error("language not loaded");return this.ǃUNW}ǃUNB(e){const r=[];for(const t of this.ǃUNG.keys())t.startsWith(e)&&r.push(t.substr(e.length));return r}ǃUNd(){let r={};for(let[t,n]of this.ǃUNG)e(r,t,n);return r}}}{function e(e){return e===ǃr.ǃJ.ǃUNc||e.startsWith("http:")||e.startsWith("https:")}function r(e,r){if(!r)return e;let t="",n=!1,o=!1;for(let d=0,i=e.length,a;dr(e,t)}let l=new Set([" ","\n","\t","-",".",":",";","'","\"","(",")","+","=","[","]","{","}","!","?","|","\\","/","<",">","@","#","~","%","&","*"]);let u="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",U=new Map;for(let e=0,r=u.length;et&&(this.ǃUPB=!0),r>n&&(this.ǃUPd=!0)}ǃUPH(){return!!this.ǃUPh.ownerDocument.defaultView}ǃUPD(){if(!this.ǃUPc){const e=Date.now();if(e-this.ǃUPn>=500&&!this.ǃUPd&&ǃr.ǃyp(this.ǃUJM,this.ǃUJx,this.ǃUPV,this.ǃUPp)i(e)));for(let t=0,n=this.ǃUPP.length,i;ti(e)));return Promise.all(r).then(()=>!e.defaultPrevented)}},"use strict";{let r=[];ǃr.ǃke=class{constructor(){throw new TypeError("static class")}static ǃkK(t){let e=t.which;for(;r.length<=e;)r.push(!1);e===ǃr.ǃrO.ǃnX&&r[e]&&t.preventDefault(),r[e]=!0}static ǃkP(t){let e=t.which;0>e||e>=r.length||(r[e]=!1)}static ǃUwL(){for(let e=0,t=r.length;ee||e>=r.length?!1:r[e]}},window.addEventListener("keydown",ǃr.ǃke.ǃkK),window.addEventListener("keyup",ǃr.ǃke.ǃkP),window.addEventListener("blur",ǃr.ǃke.ǃUwL)}{let e=new Set;ǃr.ǃUvm=class{constructor(){throw new TypeError("static class")}static ǃUvF(r){if(ǃr.ǃ$t(r),e.has(r))throw new Error("pointer already captured");e.add(r)}static ǃTq(r){if(ǃr.ǃ$t(r),!e.has(r))throw new Error("pointer not captured");e.delete(r)}static ǃUwX(r){return ǃr.ǃ$t(r),e.has(r)}}}{function e(e){s=d&&0==T?requestIdleCallback(r,{timeout:o}):setTimeout(r,e)}function r(r){if(s=-1,!a.length)return;let o=performance.now(),l=o,u=0,U=0;do t(a.shift()),l=performance.now(),++u,U=1.1*((l-o)/u);while(a.length&&(d&&0==T&&"undefined"!=typeof r?U(a.push({ǃUwi:r,resolve:o,reject:d,stack:n}),l?void t(a.pop()):void(-1===s&&e(i))))},ǃr.ǃfB.ǃgN=function(e){if(e)++T;else if(--T,0>T)throw new Error("already turned off high throughput mode")}}{function e(){r&&(t=!r.charging)}let r=null,t=!1;navigator.getBattery&&navigator.getBattery().then((t)=>{r=t,e(),t.addEventListener("chargingchange",e)}),ǃr.ǃUw_=class{constructor(){throw new Error("static class")}static ǃUwl(){return t}}}"use strict",ǃr.ǃUl=class e{constructor(e){ǃr.ǃzO(e),this.ǃUwt=!1,this.ǃUw$=e}ǃrU(){this.ǃUwt||(this.ǃUwt=!0,this.ǃUw$&&(this.ǃUw$(),this.ǃUw$=null))}ǃUwf(){return this.ǃUwt}ǃTq(){this.ǃrU()}static ǃTq(r){return new e(()=>r.ǃTq())}static ǃrY(e,r,t,n,i){if(ǃr.ǃt_(e,EventTarget,ǃr.Event.ǃUU),ǃr.ǃk(r),ǃr.ǃ_u(t),"undefined"==typeof n||null===n)n=!1;else if("boolean"!=typeof n&&"object"!=typeof n)throw new TypeError("invalid event listener options");if(i&&(t=t.bind(i)),r.includes(" ")){r=r.split(" ");const i=new ǃr.ǃUR;for(let o of r)e.addEventListener(o,t,n),i.ǃrD(ǃr.ǃq(ǃr.ǃUl,()=>e.removeEventListener(o,t,n)));return i}return e.addEventListener(r,t,n),ǃr.ǃq(ǃr.ǃUl,()=>e.removeEventListener(r,t,n))}},ǃr.ǃUwz=class extends ǃr.ǃUl{ǃUwF(e){ǃr.ǃ_u(e),this.ǃUw$=e}},ǃr.ǃUR=class extends ǃr.ǃUl{constructor(...e){super(),this.ǃUx=new Set;for(let r of e)this.ǃrD(r)}ǃrD(...e){if(ǃr.ǃXR(e,ǃr.ǃUl),this.ǃUwt)throw new Error("already disposed");for(let r of e)this.ǃUx.add(r)}ǃP(e){if(ǃr.ǃ$(e,ǃr.ǃUl),this.ǃUwt)throw new Error("already disposed");this.ǃUx.delete(e)}ǃUwm(){if(this.ǃUwt)throw new Error("already disposed");if(this.ǃUx){for(let e of this.ǃUx)e.ǃrU();this.ǃUx.clear()}}ǃUwf(){return this.ǃUwt}ǃrU(){if(this.ǃUwt)throw new Error("already disposed");this.ǃUwt=!0;for(let e of this.ǃUx)e.ǃrU();this.ǃUx.clear(),this.ǃUx=null}ǃTq(){this.ǃrU()}},"use strict";{function e(){i=-1}function r(){o=-1,d=-1;let e=Date.now();for(let r of a)if(r.ǃUwn(e)){let e=r.ǃUwV();(-1==d||ee+t&&(self.clearTimeout(o),d=this.ǃUwB,o=self.setTimeout(r,this.ǃdq+n))}ǃUwn(e){return!(e>=this.ǃUwB)||(this.ǃUwp()?(this.ǃUwB=e+this.ǃdq,!0):(this.ǃcD=!1,!1))}ǃUwV(){return this.ǃUwB}ǃBA(){this.ǃcD&&(a.delete(this),this.ǃcD=!1,0===a.size&&-1!==o&&(self.clearTimeout(o),o=-1,d=-1))}ǃTq(){this.ǃBA(),this.ǃUwp=null}}}{function e(){i=-1;let e=performance.now()-n;for(let n of t.values())n.ǃUwd++,n.ǃUwc.push(e);0i&&(i=e);if(3<=n.ǃUwc.length){n.ǃUwc.pop(),n.ǃUwc.shift();for(let e of n.ǃUwc)e>o&&(o=e)}console.log(`[JankMeasurement] '${this.ǃUwD}' ended. Duration: ${e(10*r)/10} ms, frame count: ${n.ǃUwd}, max dt: ${e(10*i)/10}ms, max dt exclusive: ${e(10*o)/10}ms`)}}}{function e(){return o}function r(e,r,t,n){let i=new ǃr.MimeType(e,r,t,n);d.set(e,i)}const t=1<<0,n=1<<1,i=1<<2;let o=null,d=new Map;ǃr.MimeType=class{constructor(e,r,o,d){if(ǃr.ǃk(e),ǃr.ǃz(o),ǃr.ǃ$f(d),!e)throw new Error("invalid MIME type");if(this.ǃUwY=e,this.ǃUwa=e.split("/")[0],this.ǃUwq=[],this.ǃUwA=o||e,this.ǃUwW=!1,this.ǃUwG=!1,this.ǃUwk=!1,"string"==typeof r)this.ǃUwq.push(r);else if(Array.isArray(r))this.ǃUwq=r;else throw new TypeError("expected string or array");"number"==typeof d&&(this.ǃUwW=!!(d&t),this.ǃUwG=!!(d&n),this.ǃUwk=!!(d&i))}ǃrG(){return this.ǃUwY}ǃUwM(){return this.ǃUwa}ǃUwx(){return this.ǃUwq}ǃUwR(){return this.ǃUwA}ǃUwg(){return this.ǃUwW}ǃUt(){return this.ǃUwG||"text"===this.ǃUwM()}ǃUtT(){return this.ǃUwk}static ǃb(r){return ǃr.ǃk(r),d.get(r)||e()}static ǃUt$(r){ǃr.ǃ$(r,Blob);const t=r.name?ǃr.ǃM(r.name).slice(1):"",n=r.type;if(!t)return n?ǃr.MimeType.ǃb(n):e();if(!n)return ǃr.MimeType.ǃUwO(t);for(let e of d.values())if(e.ǃrG()===n)for(let r of e.ǃUwx())if(r===t)return e;return ǃr.MimeType.ǃUwO(t)}static ǃx(e){return ǃr.MimeType.ǃUwO(e).ǃrG()}static ǃUwO(r,t){ǃr.ǃk(r),ǃr.ǃz(t),r.length&&"."===r[0]&&(r=r.substr(1)),r=r.toLowerCase();const n=[];for(const e of d.values())for(const t of e.ǃUwx())t===r&&n.push(e);if(!n.length)return e();if(1===n.length||!t)return n[0];for(const e of n)if(e.ǃrG().toLowerCase().includes(t.toLowerCase()))return e;return n[0]}},o=new ǃr.MimeType("application/octet-stream",[],"Binary");r("text/html",["html","htm"],"HTML"),r("application/javascript","js","Javascript",n),r("text/css","css","CSS"),r("application/json",["json","scon"],"JSON",n),r("text/xml",["xml","scml"],"XML"),r("text/csv","csv","CSV"),r("text/plain","txt","Text"),r("image/png","png","PNG",t),r("image/jpeg",["jpg","jpeg"],"JPEG",t),r("image/svg+xml","svg","SVG",n),r("image/webp","webp","WebP",t),r("image/gif","gif","GIF",t),r("image/tiff",["tif","tiff"],"TIFF"),r("image/bmp","bmp","Bitmap"),r("image/x-icon","ico","Icon"),r("audio/ogg; codecs=opus","opus","Ogg Opus",t),r("audio/ogg; codecs=vorbis","ogg","Ogg Vorbis",t),r("audio/webm; codecs=opus","webm","WebM Opus",t),r("audio/mp4","m4a","MPEG-4 AAC",t),r("audio/wav","wav","WAV"),r("audio/flac","flac","FLAC",t),r("audio/mpeg","mp3","MP3",t),r("audio/midi",["mid","midi","kar"],"MIDI"),r("video/webm","webm","WebM",t),r("video/ogg","ogv","Ogg video",t),r("video/mp4","mp4","MPEG-4 video",t),r("video/mpeg",["mpg","mpeg"],"MPEG video",t),r("video/quicktime",["mov","qt"],"Quicktime movie",t),r("video/avi","avi","AVI"),r("application/font-woff","woff","Web font",i|t),r("font/woff2","woff2","Web font",i|t),r("application/font-sfnt",["ttf","otf"],"TrueType/OpenType font",i),r("application/vnd.ms-fontobject","eot","Embedded OpenType",i),r("application/pdf","pdf","PDF"),r("application/zip",["zip","c3p","nw"],"ZIP",t),r("application/wasm","wasm","WebAssembly"),r("application/octet-stream","mem","asm.js memory"),r("application/x-construct3-addon","c3addon","Construct 3 addon",t)}"use strict",ǃr.ǃUwI=class{constructor(e=ǃr.hardwareConcurrency){ǃr.ǃ$t(e),this.ǃUwE=e,this.ǃUwC=[],this.ǃUwy=0}ǃrD(e){return ǃr.ǃ_u(e),new Promise((r,t)=>{this.ǃUwC.push({ǃUwi:e,resolve:r,reject:t}),this.ǃUwb()})}ǃUwS(e){ǃr.ǃ_u(e);for(let r=0,t=this.ǃUwC.length;r=this.ǃUwE)return;this.ǃUwy++;const e=this.ǃUwC.shift();e.ǃUwi().then((r)=>{e.resolve(r),this.ǃUwy--,this.ǃUwb()}).catch((r)=>{e.reject(r),this.ǃUwy--,this.ǃUwb()})}},"use strict",ǃr.ǃXA=class{constructor(e,r,t){ǃr.ǃ_u(e),ǃr.ǃ$t(r),ǃr.ǃ$f(t),this.ǃUwp=e,this.ǃUwe=r,this.ǃUwN=t||2*r,this.ǃUwK=-1,this.ǃUwP=-Infinity,this.ǃUww=()=>this.ǃUwQ(),this.ǃUwZ=!1,this.ǃUwu=!1,this.ǃUQU=null}ǃRQ(e){this.ǃUwu=!!e}ǃUQr(){return ǃr.ǃUw_.ǃUwl()?this.ǃUwN:this.ǃUwe}ǃU_(...e){if(-1===this.ǃUwK){this.ǃUQU=e;let r=ǃr.ǃUwh(),t=r-this.ǃUwP,n=this.ǃUQr();t>=n&&this.ǃUwu?(this.ǃUwP=r,this.ǃUQT()):this.ǃUwK=window.setTimeout(this.ǃUww,Math.max(n-t,4))}}ǃUQT(){this.ǃUwZ=!0,this.ǃUwp(...this.ǃUQU),this.ǃUwZ=!1}ǃtF(){this.ǃUwZ||(this.ǃUQv(),this.ǃUwP=ǃr.ǃUwh())}ǃUwQ(){this.ǃUwK=-1,this.ǃUwP=ǃr.ǃUwh(),this.ǃUQT()}ǃUQv(){-1!==this.ǃUwK&&(window.clearTimeout(this.ǃUwK),this.ǃUwK=-1)}ǃTq(){this.ǃUQv(),this.ǃUwp=null,this.ǃUQU=null,this.ǃUww=null}},"use strict",ǃr.ǃti={},ǃr.ǃti.Document=class{constructor(){this.ǃUQJ=null,this.ǃUQL=null}static ǃRc(e){ǃr.ǃk(e);let r=new ǃr.ǃti.Document;return r.ǃUQs(e)}static ǃkz(e){return new Promise((r)=>{let t=new FileReader;t.onload=(t)=>ǃr.ǃti.Document.ǃRc(t.target.result).then(r),t.readAsText(e)})}ǃUQs(e,r){return ǃr.ǃk(e),ǃr.ǃz(r),ǃr.ǃfB(()=>{const t=new DOMParser;return this.ǃUQJ=t.parseFromString(e,r||"text/xml"),this.ǃUQL=new ǃr.ǃti.Element(this.ǃUQJ.documentElement,this.ǃUQJ),this})}ǃam(){return this.ǃUQJ}ǃtf(){return this.ǃUQL}ǃRY(){return new Blob([this.ǃUQX(!0)],{type:"text/xml"})}ǃUQi(){return new XMLSerializer().serializeToString(this.ǃUQJ)}ǃUQX(e){e=!!e;let r="",t=/(>)(<)(\/*)/g,n=0,i=this.ǃUQi().replace(t,"$1\r\n$2$3");for(let t of i.split("\r\n")){let e=0;t.match(/.+<\/\w[^>]*>$/)?e=0:t.match(/^<\/\w/)?0!=n&&(n-=1):t.match(/^<\w[^>]*[^\/]>.*$/)?e=1:e=0;let o="";for(let e=0;e{zip.ǃUMZ(new zip.ǃUMe(r),(r)=>{this.ǃUQY=r,this.ǃUQY.getEntries((r)=>{for(let t=0,n=r.length,i;tn(e))})}ǃUQg(r){return ǃr.ǃk(r),this.ǃUQa.has(e(r))}ǃkm(r){return ǃr.ǃk(r),this.ǃUQa.get(e(r))||null}ǃUQO(){return this.ǃUQa.values()}ǃUQI(){return this.ǃUQa.keys()}ǃk$(e){ǃr.ǃk(e);let r=e.toLowerCase();for(let t of this.ǃUQa.values())if(t.filename.toLowerCase().endsWith(r))return t;return null}ǃUQE(e){ǃr.ǃyd(e);let r=e.ǃUMA;return new Promise((t)=>{let n={ǃUQC:0};this.ǃUQW.add(n),e.getData(new zip.ǃUMQ,(e)=>{this.ǃUQW.delete(n),this.ǃUQA+=r,t(e)},(e,t)=>{n.ǃUQC=e/t*r})})}ǃUQy(e){ǃr.ǃyd(e);let r=e.ǃUMA;return new Promise((t)=>{let n={ǃUQC:0};this.ǃUQW.add(n),e.getData(new zip.ǃUMQ,(e)=>{this.ǃUQW.delete(n),this.ǃUQA+=r,t(ǃr.ǃmE(e))},(e,t)=>{n.ǃUQC=e/t*r})})}ǃkf(e,r){ǃr.ǃyd(e),ǃr.ǃz(r);let t=r||ǃr.MimeType.ǃUwO(ǃr.ǃM(e.filename)).ǃrG(),n=e.ǃUMA;return new Promise((r)=>{let i={ǃUQC:0};this.ǃUQW.add(i),e.getData(new zip.ǃUMP(t),(e)=>{this.ǃUQW.delete(i),this.ǃUQA+=n,r(e)},(e,r)=>{i.ǃUQC=e/r*n})})}ǃkl(){return this.ǃUQq}ǃk_(){return this.ǃUQA+this.ǃUQb()}ǃUQb(){let e=0;for(let r of this.ǃUQW)e+=r.ǃUQC;return e}ǃkn(){this.ǃUQY&&(this.ǃUQY.close(),this.ǃUQY=null)}ǃUQS(e){if(ǃr.ǃ$t(e),-1>e||95*r?1:e>2*r?2:e>1*r?3:e>0.5*r?4:5}ǃRq(e,r){return ǃr.ǃVm(r,Map),this.ǃUQG.length=0,this.ǃUQk=0,this.ǃUQM=0,this.ǃUQx=0,new Promise((t,n)=>{zip.ǃUMu(new zip.ǃUMP("application/zip"),(n)=>{this.ǃUQj(n,e,r).then(()=>n.close(t))},(e)=>n(e))})}ǃUQj(e,r,t){for(let n of r){this.ǃUQG.push(n);let e=n[1],r=null;if(r=ǃr.ǃmg(e)?e.data:e,"string"==typeof r)this.ǃUQk+=r.length;else if(ǃr.ǃQ(r,Blob))this.ǃUQk+=r.size;else throw new Error("unknown file content")}return this.ǃUQe(e,t)}ǃUQe(e,r){if(!this.ǃUQG.length)return Promise.resolve(!0);let t=this.ǃUQG.pop(),n=t[0],i=t[1],o=null,d=0,a=null,s=null,T=null;return ǃr.ǃmg(i)?(o=i.data,d=i.ǃUQN||0,a=i.ǃUMC||null,s="number"==typeof i.ǃUMI?i.ǃUMI:null,T="number"==typeof i.ǃUQK?i.ǃUQK:null):o=i,new Promise((t,i)=>{let l=5,u=0,U;if("string"==typeof o)U=new zip.ǃUMK(o),u=o.length,l=this.ǃUQo(u);else if(ǃr.ǃQ(o,Blob)){U=new zip.ǃUMe(o),u=o.size,l=this.ǃUQo(u);let e=o.type;e||(e=ǃr.MimeType.ǃUwO(ǃr.ǃM(n)).ǃrG()),ǃr.MimeType.ǃb(e).ǃUwg()&&(l=0)}else return void i("unknown file content");this.ǃUQx=0;let c={level:l,ǃUME:d,ǃUMC:a};null!==s&&(c.ǃUMI=s),null!==T&&(c.version=T),e.add(n,U,(i)=>{this.ǃUQM+=u,this.ǃUQx=0,r&&r.set(n,i),t(this.ǃUQe(e,r))},(e,r)=>{this.ǃUQx=e/r*u},c)})}ǃUQP(){return this.ǃUQk}ǃUQw(){return this.ǃUQM+this.ǃUQx}}}{let e=class{constructor(e,r,t,n){if(ǃr.ǃk(e),ǃr.ǃ$t(r),!ǃr.ǃtU(t)&&!ǃr.ǃUlr(t,ArrayBuffer))throw new Error("unsupported data");this.ǃUQQ=e,this.ǃUQZ=r,this.ǃUQu=t,this.ǃUZU=!!n}ǃUZr(){return this.ǃUQQ}ǃUZT(){return this.ǃUQZ}ǃUZv(){return this.ǃUQu}ǃUZJ(){return this.ǃUZU}};ǃr.DataView=class{constructor(e){ǃr.ǃVm(e,ArrayBuffer),this.ǃUZL=null,this.ǃUZs=[],e&&(this.ǃUZL=new DataView(e)),this.ǃUZX=0,this.ǃUZi=0}ǃRY(){return new Blob([this.ǃUZ_()])}ǃUZl(){if(!this.ǃUZL)throw new Error("missing DataView");return this.ǃUZL}ǃUZ_(){if(!this.ǃUZL)throw new Error("missing DataView");return this.ǃUZL.buffer}ǃUZt(){this.ǃUZi=0}ǃTq(){this.ǃUZL=null,this.ǃUZs=null}ǃUZ$(){if(this.ǃUZL)throw new Error("data already commited");let e=0;for(let r of this.ǃUZs)e+=r.ǃUZT();this.ǃUZL=new DataView(new ArrayBuffer(e));for(let e of this.ǃUZs){switch(e.ǃUZr()){case"setInt8":this.ǃUZL.setInt8(this.ǃUZX,e.ǃUZv());break;case"setUint8":this.ǃUZL.setUint8(this.ǃUZX,e.ǃUZv());break;case"setInt16":this.ǃUZL.setInt16(this.ǃUZX,e.ǃUZv(),e.ǃUZJ());break;case"setUint16":this.ǃUZL.setUint16(this.ǃUZX,e.ǃUZv(),e.ǃUZJ());break;case"setInt32":this.ǃUZL.setInt32(this.ǃUZX,e.ǃUZv(),e.ǃUZJ());break;case"setUint32":this.ǃUZL.setUint32(this.ǃUZX,e.ǃUZv(),e.ǃUZJ());break;case"setFloat32":this.ǃUZL.setFloat32(this.ǃUZX,e.ǃUZv(),e.ǃUZJ());break;case"setFloat64":this.ǃUZL.setFloat64(this.ǃUZX,e.ǃUZv(),e.ǃUZJ());break;case"setArrayBuffer":let r=new Uint8Array(this.ǃUZL.buffer),t=new Uint8Array(e.ǃUZv());r.set(t,this.ǃUZX),this.ǃUZL=new DataView(r.buffer);}this.ǃUZX+=e.ǃUZT()}this.ǃUZs=null}ǃkf(e){let r=this.ǃUZf("raw");return e||(e={}),e.type||(e.type="application/octet-stream"),new Blob([r],e)}ǃUZz(r){ǃr.ǃ$(r,ArrayBuffer),this.ǃUZF(r.byteLength),this.ǃUZs.push(new e("setArrayBuffer",r.byteLength,r))}ǃUZf(e){switch(ǃr.ǃk(e),e){case"int8":return this.ǃUZm();case"uint8":return this.ǃUZh();case"clampedUint8":return this.ǃUZn();case"int16":return this.ǃUZV();case"uint16":return this.ǃUZp();case"int32":return this.ǃUZB();case"uint32":return this.ǃUZd();case"float32":return this.ǃUZc();case"float64":return this.ǃUZH();case"raw":return this.ǃUZh().buffer;default:throw new Error("unsupported return type. supported types are 'int8, uint8, clampedUint8, int16, uint16, int32, uint32, float32, float64, raw'");}}ǃUZD(e){this.ǃUZY(JSON.stringify(e))}ǃUZa(e){return JSON.parse(this.ǃUZq(e))}ǃUZY(e,r){ǃr.ǃk(e);let t=Array.prototype.map.call(e,(r,t)=>e.charCodeAt(t));this.ǃUZA(t,r)}ǃUZq(e){return Array.prototype.map.call(this.ǃUZp(e),(e)=>String.fromCharCode(e)).join("")}ǃUZW(e){this.ǃUZG(!e?0:1)}ǃUZk(){return!!this.ǃUZM()}ǃUZx(r){if(this.ǃUZL)throw new Error("data already commited");this.ǃUZs.push(new e("setInt8",Int8Array.BYTES_PER_ELEMENT,r))}ǃUZG(r){if(this.ǃUZL)throw new Error("data already commited");this.ǃUZs.push(new e("setUint8",Uint8Array.BYTES_PER_ELEMENT,r))}ǃUZR(r,t){if(this.ǃUZL)throw new Error("data already commited");this.ǃUZs.push(new e("setInt16",Int16Array.BYTES_PER_ELEMENT,r,!!t))}ǃUZg(r,t){if(this.ǃUZL)throw new Error("data already commited");this.ǃUZs.push(new e("setUint16",Uint16Array.BYTES_PER_ELEMENT,r,!!t))}ǃUZO(r,t){if(this.ǃUZL)throw new Error("data already commited");this.ǃUZs.push(new e("setInt32",Int32Array.BYTES_PER_ELEMENT,r,!!t))}ǃUZF(r,t){if(this.ǃUZL)throw new Error("data already commited");this.ǃUZs.push(new e("setUint32",Uint32Array.BYTES_PER_ELEMENT,r,!!t))}ǃUZI(r,t){if(this.ǃUZL)throw new Error("data already commited");this.ǃUZs.push(new e("setFloat32",Float32Array.BYTES_PER_ELEMENT,r,!!t))}ǃUZE(r,t){if(this.ǃUZL)throw new Error("data already commited");this.ǃUZs.push(new e("setFloat64",Float64Array.BYTES_PER_ELEMENT,r,!!t))}ǃUZC(e,r){this.ǃUZF(e.length,!!r),this.ǃUZy(e,"setInt8")}ǃUZb(e,r){this.ǃUZF(e.length,!!r),this.ǃUZy(e,"setUint8")}ǃUZS(e,r){this.ǃUZF(e.length,!!r),this.ǃUZy(e,"setInt16",!!r)}ǃUZA(e,r){this.ǃUZF(e.length,!!r),this.ǃUZy(e,"setUint16",!!r)}ǃUZo(e,r){this.ǃUZF(e.length,!!r),this.ǃUZy(e,"setInt32",!!r)}ǃUZj(e,r){this.ǃUZF(e.length,!!r),this.ǃUZy(e,"setUint32",!!r)}ǃUZe(e,r){this.ǃUZF(e.length,!!r),this.ǃUZy(e,"setFloat32",!!r)}ǃUZN(e,r){this.ǃUZF(e.length,!!r),this.ǃUZy(e,"setFloat64",!!r)}ǃUZK(){let e=this.ǃUZL.getInt8(this.ǃUZi);return this.ǃUZi+=Int8Array.BYTES_PER_ELEMENT,e}ǃUZM(){let e=this.ǃUZL.getUint8(this.ǃUZi);return this.ǃUZi+=Uint8Array.BYTES_PER_ELEMENT,e}ǃUZP(e){let r=this.ǃUZL.getInt16(this.ǃUZi,!!e);return this.ǃUZi+=Int16Array.BYTES_PER_ELEMENT,r}ǃUZw(e){let r=this.ǃUZL.getUint16(this.ǃUZi,!!e);return this.ǃUZi+=Uint16Array.BYTES_PER_ELEMENT,r}ǃUZQ(e){let r=this.ǃUZL.getInt32(this.ǃUZi,!!e);return this.ǃUZi+=Int32Array.BYTES_PER_ELEMENT,r}ǃUZZ(e){let r=this.ǃUZL.getUint32(this.ǃUZi,!!e);return this.ǃUZi+=Uint32Array.BYTES_PER_ELEMENT,r}ǃUZu(e){let r=this.ǃUZL.getFloat32(this.ǃUZi,!!e);return this.ǃUZi+=Float32Array.BYTES_PER_ELEMENT,r}ǃUuU(e){let r=this.ǃUZL.getFloat64(this.ǃUZi,!!e);return this.ǃUZi+=Float64Array.BYTES_PER_ELEMENT,r}ǃUZm(e){return this.ǃUur(this.ǃUZZ(!!e),"getInt8",Int8Array)}ǃUZh(e){return this.ǃUur(this.ǃUZZ(!!e),"getUint8",Uint8Array)}ǃUZn(e){return this.ǃUur(this.ǃUZZ(!!e),"getUint8",Uint8ClampedArray)}ǃUZV(e){return this.ǃUur(this.ǃUZZ(!!e),"getInt16",Int16Array,!!e)}ǃUZp(e){return this.ǃUur(this.ǃUZZ(!!e),"getUint16",Uint16Array,!!e)}ǃUZB(e){return this.ǃUur(this.ǃUZZ(!!e),"getInt32",Int32Array,!!e)}ǃUZd(e){return this.ǃUur(this.ǃUZZ(!!e),"getUint32",Uint32Array,!!e)}ǃUZc(e){return this.ǃUur(this.ǃUZZ(!!e),"getFloat32",Float32Array,!!e)}ǃUZH(e){return this.ǃUur(this.ǃUZZ(!!e),"getFloat64",Float64Array,!!e)}ǃUZy(r,t,n){let o=r.length;for(let d=0;d{if(!s)return;const e=parseFloat(r.value);if(e!==d)return v();const i=Math.round(a-t.detail.clientY),T=""===r.min?-Infinity:parseFloat(r.min),l=""===r.max?Infinity:parseFloat(r.max),u=""===r.step?1:parseFloat(r.step);t.preventDefault();let c=i*u;c=n?o-c:o+c,d=ǃr.ǃsP(c,T,l),r.value=d,r.select(),U.ǃU_()},v=()=>{s=!1,o=null,a=0,ǃr.ǃo.ǃad(i),i=null,l.ǃrU(),u.ǃrU(),T.ǃP(l),T.ǃP(u),l=null,u=null},p=(n)=>{n.target!==r&&n.preventDefault(),n.stopPropagation(),v();let e=new Event("change");r.dispatchEvent(e),t&&t()};return U=ǃr.ǃq(ǃr.ǃXA,()=>{let e=new Event("input");r.dispatchEvent(e)},60),T.ǃrD(ǃr.ǃUl.ǃrY(r,"dragstart",(t)=>{s||(t.preventDefault(),s=!0,a=t.clientY,o=parseFloat(r.value),d=o,i=ǃr.ǃo.ǃaF("ns-resize",r.ownerDocument),l=ǃr.ǃUl.ǃrY(r.ownerDocument,"UIPointerMove",c),u=ǃr.ǃUl.ǃrY(r.ownerDocument,"UIPointerUp ",p),T.ǃrD(l),T.ǃrD(u))})),T.ǃrD(ǃr.ǃUl.ǃrY(r,"focus",()=>r.select())),T.ǃrD(ǃr.ǃq(ǃr.ǃUl,()=>{r=null,t=null,l=null,u=null,T=null,ǃr.ǃo.ǃad(i),i=null,U.ǃTq()})),T}}"use strict",ǃr.ǃUuv=class{constructor(e,r,t,n){ǃr.ǃ_u(e),ǃr.ǃ$t(r),ǃr.ǃVg(t),n=!!n,this.ǃUuJ=null,this.ǃUuL=e,this.ǃUus=t,this.ǃUuX=r,n||this.ǃUcY()}get ǃUui(){return!!this.ǃUuJ}ǃTq(){this.ǃUu_(),this.ǃUuL=null,this.ǃUus=null,this.ǃUul=null}ǃtF(){this.ǃUu_(),this.ǃUcY()}ǃUcY(){if(!this.ǃUui){let e=this.ǃUus,r=this.ǃUuL,t=this.ǃUuX,n=e?r.bind(e):r;this.ǃUuJ=setInterval(n,t)}}ǃUu_(){this.ǃUui&&(clearInterval(this.ǃUuJ),this.ǃUuJ=null)}ǃUut(e){ǃr.ǃ$t(e),this.ǃUuX=e,this.ǃtF()}ǃUu$(e){ǃr.ǃ_u(e),this.ǃUuL=e,this.ǃtF()}ǃUNh(e){ǃr.ǃVg(e),this.ǃUus=e,this.ǃtF()}},"use strict",ǃr.ǃUuf=function(e,r,t,n="tree-edit-text"){function i(){if(U)return Promise.resolve("");const i=r.getBoundingClientRect(),d=e.getBoundingClientRect(),a=d.left-i.left,l=d.top-i.top+r.scrollTop;return U=ǃr.ǃo.ǃUd("input",r,null,n),U.type="text",U.style.left=`${a}px`,U.style.top=`${l}px`,U.style.width=`${u(d.right-d.left,30)}px`,U.style.maxWidth=`${u(d.right-d.left,30)}px`,U.style.height=`${d.bottom-d.top}px`,U.setAttribute("spellcheck","false"),p=()=>o(),U.addEventListener("blur",p),m=()=>T(),U.addEventListener("input",m),f=(r)=>s(r),U.addEventListener("keydown",f,!0),r.addEventListener("scroll",h),U.value=t(),U.focus(),e.textContent=".",new Promise((e,r)=>{c=e,v=r})}function o(){if(U){let e=U.value;d(e),c&&c(e),c=null,v=null}}function d(n=null){U&&(e.textContent=n?n:t(),r.removeEventListener("scroll",h,{passive:!0}),U.removeEventListener("keydown",f,!0),f=null,U.removeEventListener("input",m),m=null,U.removeEventListener("blur",p),p=null,ǃr.ǃo.ǃrv(U),U=null)}function a(){U&&(d(),c&&c(null),c=null,v=null)}function s(r){r.which===ǃr.ǃrO.ǃrg?(r.preventDefault(),r.stopPropagation(),o()):r.which===ǃr.ǃrO.ǃns&&(r.preventDefault(),r.stopPropagation(),a())}function T(){e.textContent=U.value;const r=e.getBoundingClientRect();U.style.width=`${u(r.right-r.left,30)}px`,e.textContent="."}function l(){const t=r.getBoundingClientRect(),n=e.getBoundingClientRect();U.style.left=`${n.left-t.left+r.scrollLeft}px`,U.style.top=`${n.top-t.top+r.scrollTop}px`;const i=U.getBoundingClientRect();(i.bottom>t.bottom+1||i.topl();return{ǃbf:()=>i(),ǃTq:()=>{d(),c=null,v=null}}},"use strict",ǃr.ǃUuz=class{constructor(e,r,t,n){ǃr.ǃ$t(r),ǃr.ǃ_u(n),ǃr.ǃz(t),this.ǃUuF=e,this.ǃUum=r,this.ǃUuh=t||null,this.ǃUwp=n,this.ǃUun=!1}ǃXG(){this.ǃUuF=null,this.ǃUwp=null}ǃTq(){!this.ǃUuF||this.ǃUun||this.ǃUuF.ǃUuV(this)}ǃUup(){return this.ǃUum}ǃii(){return this.ǃUuh}ǃUuB(){this.ǃUwp&&(this.ǃUun=!0,this.ǃUwp(),this.ǃUun=!1)}},"use strict";{ǃr.ǃUuW=ǃr.ǃq(class{constructor(){this.ǃUvD=!1,this.ǃUud=[],this.ǃUuc=0,this.ǃUum=0,this.ǃUuH=0,this.ǃUuD=[],this.ǃUuY=!1}ǃWC(){if(this.ǃUvD)throw new Error("already enabled");this.ǃUvD=!0,window.addEventListener("popstate",(r)=>this.ǃUua(r));for(const e of this.ǃUud)history.pushState({sequence:e.ǃUup()},e.ǃii(),location.toString())}ǃUua(r){if(0this.ǃUuq()));if(this.ǃUud.length&&this.ǃUvD){if(this.ǃUuY=!0,r.state){const e=r.state.sequence;this.ǃUuH=e}const e=this.ǃUud.pop();e.ǃUuB(),e.ǃXG(),this.ǃUuY=!1}}ǃUuq(){for(const e of this.ǃUuD)e();ǃr.ǃXk(this.ǃUuD)}ǃrD(e,r){ǃr.ǃ_u(e),ǃr.ǃz(r);const t=this.ǃUum++;if(this.ǃUuH=t,this.ǃUvD){const e=()=>history.pushState({sequence:t},r||null,location.toString());0history.back()):this.ǃUuY?Promise.resolve().then(()=>history.back()):history.back())}})}{let e=new Set;ǃr.ǃUuG=class{constructor(e){ǃr.ǃ$(e,Blob),this.ǃUuk=e}ǃUuM(){return this.ǃUux().then((e)=>this.ǃUuR(e))}ǃUux(){return new Promise((r,e)=>{let t=this.ǃUuk.slice(0,Math.min(1024,this.ǃUuk.size));this.ǃUuk=null;let n=new FileReader;n.onload=(t)=>r(t.target.result),n.onerror=e,n.readAsArrayBuffer(t)})}ǃUuR(r){for(let t of e){let e=t(r);if(e)return e}return null}static ǃUug(r){ǃr.ǃ_u(r),e.add(r)}}}{let e=new Set;e.add((e,r)=>{let t=e.subarray(1,7);if("vorbis"!==ǃr.ǃUbC(t,"ascii"))return null;let n={type:"audio",ǃUuO:"vorbis"},i=e[0];if(1===i){let e=7;n.version=r.getUint32(e,!0),e+=4,n.ǃUuI=r.getUint8(e),e+=1,n.sampleRate=r.getUint32(e,!0),e+=4,n.ǃUuE=r.getUint32(e,!0),e+=4,n.ǃUuC=r.getUint32(e,!0),e+=4,n.ǃUuy=r.getUint32(e,!0),e+=4}return n}),e.add((e,r)=>{let t=e.subarray(0,8);if("OpusHead"!==ǃr.ǃUbC(t,"ascii"))return null;let n={type:"audio",ǃUuO:"opus"},i=8;return n.version=r.getUint8(i),i+=1,n.ǃUuI=r.getUint8(i),i+=1,i+=2,n.ǃUub=r.getUint32(i,!0),i+=4,n.sampleRate=48000,n}),ǃr.ǃUuG.ǃUug((r)=>{if("OggS"!==ǃr.ǃUbE(r,"ascii",0,4))return null;let t="",n=[],i=new Uint8Array(r),o=i[26],d=27+o;for(let a=0;athis.ǃUuj(),10,null,!0),this.ǃUue=new ǃr.ǃUR(ǃr.ǃUl.ǃrY(this.ǃUuS,"open",(r)=>this.ǃUDh(r)),ǃr.ǃUl.ǃrY(this.ǃUuS,"close",(r)=>this.ǃUDn(r)),ǃr.ǃUl.ǃrY(this.ǃUuS,"message",(r)=>this.ǃUDp(r)),ǃr.ǃUl.ǃrY(this.ǃUuS,"error",(r)=>this.ǃUDV(r)),ǃr.ǃUl.ǃTq(this.ǃUs)),this.ǃUuN=null,this.ǃUuK=[],this.ǃUuP=new Map,this.ǃUuw=null,this.ǃUuQ=null}ǃTq(){this.ǃrL(),this.ǃUuN=null,this.ǃUue.ǃrU(),this.ǃUuK.length=0,this.ǃUuP.forEach((e)=>e.ǃTq()),this.ǃUuP.clear()}ǃUuZ(){if(this.ǃUuS.readyState!==WebSocket.CLOSED)throw new Error("Websocket is not closed");return this.ǃUue.ǃrU(),this.ǃUuS=new WebSocket(this.ǃUuo),this.ǃUuS.binaryType="arraybuffer",this.ǃUs=new ǃr.ǃUuv(()=>this.ǃUuj(),10,null,!0),this.ǃUue=new ǃr.ǃUR(ǃr.ǃUl.ǃrY(this.ǃUuS,"open",(r)=>this.ǃUDh(r)),ǃr.ǃUl.ǃrY(this.ǃUuS,"close",(r)=>this.ǃUDn(r)),ǃr.ǃUl.ǃrY(this.ǃUuS,"message",(r)=>this.ǃUDp(r)),ǃr.ǃUl.ǃrY(this.ǃUuS,"error",(r)=>this.ǃUDV(r)),ǃr.ǃUl.ǃTq(this.ǃUs)),new Promise((e,r)=>{this.ǃUuw=e,this.ǃUuQ=r})}ǃUEY(){return this.ǃHR}ǃUuu(e,r,t=ǃr.WebSocket.ǃUuu.ǃrUU){ǃr.ǃk(e),ǃr.ǃk(t),ǃr.ǃzO(r);let n=this.ǃUuP.get(e);if(n||(n=new ǃr.WebSocket.ǃUuu(this,e,t),this.ǃUuP.set(e,n)),!n.ǃrUr(t))throw new Error(`Requested channel is not requested type "${t}"`);return r?n.ǃrUT(r):n}ǃrUv(e,r){return this.ǃUuu(e,r,ǃr.WebSocket.ǃUuu.ǃrUJ)}ǃrUL(e,r){return this.ǃUuu(e,r,ǃr.WebSocket.ǃUuu.JSON)}ǃrUs(e){ǃr.ǃk(e);let r=this.ǃUuP.get(e);r&&r.ǃTq()}ǃrUX(e){this.ǃUuP.delete(e)}ǃrL(e,r){this.ǃUuS.close(e,r)}ǃrUi(e,r=ǃr.WebSocket.ǃUuu.ǃrUU){return new Promise((t,n)=>{const i=this.ǃUuu(e,(e)=>{i.ǃTq(),o.ǃrU(),t(e)},r),o=ǃr.ǃUl.ǃrY(this,"close",()=>{i.ǃTq(),o.ǃrU(),n()})})}ǃrU_(e){return this.ǃrUi(e,ǃr.WebSocket.ǃUuu.JSON)}ǃrUl(e){return this.ǃrUi(e,ǃr.WebSocket.ǃUuu.ǃrUJ)}ǃrUt(e,t,n){ǃr.ǃ$(t,Uint8Array);const o=new Uint8Array(t.length+r);for(let d=0;d{let i={data:e,resolve:t,reject:n};r?this.ǃUuK.unshift(i):this.ǃUuK.push(i),this.ǃUEY()&&!this.ǃUs.ǃUui&&(this.ǃUuj(),this.ǃUs.ǃUcY())})}ǃUDp({data:e}){let t=new Uint8Array(e,0,r),n=[,,,];for(let o=0;o{const n=ǃr.ǃUl.ǃrY(r,"open",()=>{n.ǃrU(),i.ǃrU(),e()}),i=ǃr.ǃUl.ǃrY(r,"close",()=>{n.ǃrU(),i.ǃrU(),t()})}),r}catch(t){throw r.ǃTq(),t}}}}{const e="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");ǃr.WebSocket.ǃUuu=class r{constructor(e,t,n){if(n!==r.ǃrUU&&n!==r.ǃrUJ&&n!==r.JSON)throw new Error(`Invalid channel type ${n}`);ǃr.ǃ$(e,ǃr.WebSocket),ǃr.ǃk(t),this.ǃrUm=t,this.ǃUPe=n,this.ǃrUh=e,this.ǃUPP=new Set}ǃTq(){this.ǃrUh.ǃrUX(this.ǃrUm),this.ǃUPP.clear()}ǃrUr(e){return e===this.ǃUPe}ǃUYH(e,t){switch(this.ǃUPe){case r.JSON:return this.ǃrUh.ǃrUz(this.ǃrUm,e,t);case r.ǃrUU:return this.ǃrUh.ǃrU$(this.ǃrUm,e,t);case r.ǃrUJ:return this.ǃrUh.ǃrUt(this.ǃrUm,e,t);}}ǃrUT(e){return ǃr.ǃ_u(e),this.ǃUPP.add(e),new ǃr.ǃUl(()=>this.ǃUPP.delete(e))}ǃrUF(t){let n;switch(this.ǃUPe){case r.ǃrUU:n=e.decode(t);break;case r.JSON:n=JSON.parse(e.decode(t));break;case r.ǃrUJ:n=t;}for(let e of this.ǃUPP)e(n)}},ǃr.WebSocket.ǃUuu.ǃrUJ="binary",ǃr.WebSocket.ǃUuu.JSON="json",ǃr.WebSocket.ǃUuu.ǃrUU="text"}{function e(){if(!t)throw new Error("requires NW.js")}function r(e,r){return new Promise((t,i)=>{n.rename(e,r,(e)=>{e?i(e):t()})})}ǃr.ǃJX={};const t="nwjs"===ǃr.ǃrd.ǃvo;let n=null,i=null,o=null,d=null,a=null,s=null,T=null,l=null,u=null;t&&(n=require("fs"),i=require("path"),o=require("os"),d=nw.Clipboard.get(),a=require("child_process"),s=document.createElement("input"),s.style.display="none",s.setAttribute("type","file"),s.setAttribute("nwdirectory",""),s.onchange=()=>{T&&(T(s.value),T=null);try{s.value=null}catch(e){}},s.oncancel=()=>{T&&(T(null),T=null)},document.body.appendChild(s),l=document.createElement("input"),l.style.display="none",l.setAttribute("type","file"),l.setAttribute("nwsaveas",""),l.onchange=()=>{u&&(u(l.value),u=null);try{l.value=null}catch(e){}},l.oncancel=()=>{u&&(u(null),u=null)},document.body.appendChild(l)),ǃr.ǃJX.ǃUV_=function(r){e(),nw.Shell.openExternal(r)},ǃr.ǃJX.ǃUyI=function(r){e(),nw.Shell.openExternal(r)},ǃr.ǃJX.ǃrUn=function(r,t){return e(),new Promise((e,n)=>{a.execFile(r,t,(r)=>{r?n(r):e()})})},ǃr.ǃJX.ǃrUV=function(){return e(),new Promise((e)=>{T=e,s.click()})},ǃr.ǃJX.ǃrUp=function(r){return ǃr.ǃz(r),e(),l.setAttribute("accept",r||""),new Promise((e)=>{u=e,l.click()})},ǃr.ǃJX.ǃUyK=function(r){return e(),d.set(r,"text"),Promise.resolve()},ǃr.ǃJX.ǃrUB=function(r){e();const t=ǃr.ǃUbc(r);return d.set(t,"png"),Promise.resolve()},ǃr.ǃJX.ǃrUd=function(){return!!d.get("text")},ǃr.ǃJX.ǃrUc=function(){return!!d.get("png")},ǃr.ǃJX.ǃSB=function(){return e(),Promise.resolve(d.get("text"))},ǃr.ǃJX.ǃrUH=function(){e();const r=d.get("png");return ǃr.ǃsm(r)},ǃr.ǃJX.ǃrUD=function(){return e(),o.homedir()},ǃr.ǃJX.ǃrUY=function(){return e(),i.join(ǃr.ǃJX.ǃrUD(),"Desktop")},ǃr.ǃJX.ǃrUa=function(){return e(),o.tmpdir()},ǃr.ǃJX.ǃrUq=function(...r){return e(),i.join(...r)},ǃr.ǃJX.ǃrUA=function(r){return e(),i.dirname(r)},ǃr.ǃJX.ǃrUW=function(r){return ǃr.ǃk(r),e(),new Promise((e,t)=>{n.stat(r,(r,n)=>{r?"ENOENT"===r.code?e(!1):t(r):e(n.isFile())})})},ǃr.ǃJX.ǃrUG=function(r){return ǃr.ǃk(r),e(),new Promise((e,t)=>{n.stat(r,(r,n)=>{r?"ENOENT"===r.code?e(!1):t(r):e(n.isDirectory())})})},ǃr.ǃJX.ǃrUk=function(r){return ǃr.ǃk(r),e(),new Promise((e,t)=>{n.mkdir(r,(r)=>{r?t(r):e()})})},ǃr.ǃJX.ǃrUM=function(r,t){return ǃr.ǃk(r),ǃr.ǃk(t),e(),new Promise((e,i)=>{n.writeFile(r,t,"utf8",(r)=>{r?i(r):e()})})},ǃr.ǃJX.ǃrUx=function(r,t){return ǃr.ǃk(r),ǃr.ǃ$(t,Blob),e(),ǃr.ǃUbt(t).then((e)=>new Promise((t,i)=>{n.writeFile(r,Buffer.from(new Uint8Array(e)),{encoding:null},(e)=>{e?i(e):t()})}))},ǃr.ǃJX.ǃrUR=async function(r,t){ǃr.ǃk(r),e();const n=r+".tmp";await ǃr.ǃSd.ǃrUg(n,t),await ǃr.ǃJX.ǃrUO(n,r)},ǃr.ǃJX.ǃrUI=function(r,t){return ǃr.ǃk(r),e(),new Promise((e,i)=>{n.readFile(r,t,(r,t)=>{r?i(r):e(t)})})},ǃr.ǃJX.ǃrUE=function(e){return ǃr.ǃJX.ǃrUI(e,{encoding:"utf8"})},ǃr.ǃJX.ǃrUC=function(e,r){return ǃr.ǃJX.ǃrUI(e).then((e)=>new Blob([Uint8Array.from(e)],{type:r||""}))},ǃr.ǃJX.ǃrUy=function(r){return ǃr.ǃk(r),e(),new Promise((e,t)=>{n.unlink(r,(r)=>{r?"ENOENT"===r.code?e():t(r):e()})})};ǃr.ǃJX.ǃrUO=async function(t,n){ǃr.ǃk(t),ǃr.ǃk(n),e(),await ǃr.ǃJX.ǃrUy(n),await r(t,n)},ǃr.ǃJX.ǃrUb=function(){return e(),nw.Window.get()},ǃr.ǃJX.ǃJs=function(r){e(),ǃr.ǃJX.ǃrUb().close(r)},ǃr.ǃJX.ǃrUS=function(){return e(),nw.App.argv}}"use strict",function(){function e(){if(!a)throw new Error("requires WinRT")}function r(e){return e.endsWith("/")||e.endsWith("\\")?e.substr(0,e.length-1):e}function t(e){return e.startsWith("/")||e.startsWith("\\")?e.substr(0,e.length-1):e}function n(e){return ǃr.ǃUAy(e,"/","\\")}async function i(e,r){const t=await U.getFolderFromPathAsync(n(e));return await t.createFileAsync(r,T.CreationCollisionOption.openIfExists)}async function o(e,r){const t=await U.getFolderFromPathAsync(n(e));return await t.getFileAsync(r)}async function d(e,r){const t=await c.readBufferAsync(e),n=new Uint8Array(t.length),i=h.DataReader.fromBuffer(t);i.readBytes(n),i.close();const o=new Blob([n],{type:r});return o.name=ǃr.ǃUyV(e.path),o.path=e.path,o}const a="windows-store"===ǃr.ǃrd.ǃvo;if(!a)return;ǃr.ǃrUo={};const s=Windows.System.Launcher,T=Windows.Storage,l=T.Pickers,u=T.StorageFile,U=T.StorageFolder,c=T.FileIO,v=T.AccessCache.StorageApplicationPermissions.futureAccessList,p=Windows.ApplicationModel.DataTransfer,m=p.Clipboard,f=p.StandardDataFormats,h=T.Streams;ǃr.ǃrUo.ǃUV_=async function(r){e();const t=await U.getFolderFromPathAsync(n(r));s.launchFolderAsync(t)},ǃr.ǃrUo.ǃUyI=function(r){e();const t=new Windows.Foundation.Uri(r);s.launchUriAsync(t)},ǃr.ǃrUo.ǃrUn=function(){e(),ǃr.ǃUy$()},ǃr.ǃrUo.ǃrUj=async function(r){ǃr.ǃz(r),e();const t=r?r.split(","):["*"],n=new l.FileOpenPicker;n.fileTypeFilter.replaceAll(t);const i=await n.pickSingleFileAsync();return i?(v.checkAccess(i)||v.add(i),await d(i,"")):null},ǃr.ǃrUo.ǃrUp=async function(r){ǃr.ǃz(r),e();const t=r?r.split(","):["*"],n=new l.FileSavePicker;n.fileTypeChoices.insert("Construct 3 project files",t);const i=await n.pickSaveFileAsync();return i?(v.checkAccess(i)||v.add(i),i.path):null},ǃr.ǃrUo.ǃrUV=async function(){e();const r=new l.FolderPicker;r.fileTypeFilter.replaceAll(["*"]);const t=await r.pickSingleFolderAsync();return t?(v.checkAccess(t)||v.add(t),t.path):null},ǃr.ǃrUo.ǃUyK=function(r){e();const t=new p.DataPackage;return t.requestedOperation=p.DataPackageOperation.copy,t.setText(r),m.setContent(t),Promise.resolve()},ǃr.ǃrUo.ǃrUB=async function(r){e();const t=new p.DataPackage;t.requestedOperation=p.DataPackageOperation.copy;const n=await ǃr.ǃUbd(r),i=await ǃr.ǃUbt(n),o=new h.InMemoryRandomAccessStream,d=o.getOutputStreamAt(0),a=new h.DataWriter(d);a.writeBytes(new Uint8Array(i)),await a.storeAsync(),await a.flushAsync();const s=h.RandomAccessStreamReference.createFromStream(o);t.setBitmap(s),m.setContent(t)},ǃr.ǃrUo.ǃrUd=function(){const e=m.getContent();return e.contains(f.text)},ǃr.ǃrUo.ǃrUc=function(){const e=m.getContent();return e.contains(f.bitmap)},ǃr.ǃrUo.ǃSB=function(){e();const r=m.getContent();return r.contains(f.text)?r.getTextAsync():Promise.resolve("")},ǃr.ǃrUo.ǃrUH=async function(){e();const r=m.getContent();if(r.contains(f.bitmap)){const e=await r.getBitmapAsync(),t=await e.openReadAsync();if(!t)return null;const n=MSApp.createBlobFromRandomAccessStream(t.contentType,t);return ǃr.ǃUrD(n)}return null},ǃr.ǃrUo.ǃrUD=function(){return e(),T.UserDataPaths.getDefault().profile},ǃr.ǃrUo.ǃrUY=function(){return e(),T.UserDataPaths.getDefault().desktop},ǃr.ǃrUo.ǃrUa=function(){return e(),T.ApplicationData.current.temporaryFolder.path},ǃr.ǃrUo.ǃrUq=function(...e){let n=e[0];for(let o=1,i=e.length,d;o{a=window.innerWidth,s=window.innerHeight},!0);let T=NaN,l=NaN,u=NaN;const U=new WeakMap;class c{constructor(e,r){ǃr.ǃk(e),ǃr.ǃoF(r),this.ǃrUK=e,this.ǃrUP="",this.ǃqi=r,this.ǃrUw=r.ownerDocument}ǃam(){return this.ǃrUw}Set(e){if(ǃr.ǃk(e),e!==t&&!r.has(e))throw new RangeError(`invalid mouse cursor name '${e}'`);this.ǃrUK===e||(this.ǃrUK=e,ǃr.ǃo.ǃrUQ(this)&&this.ǃrUZ(!1))}ǃrUZ(e){if(this.ǃrUK===t)return void this.ǃrUu();let n=r.get(this.ǃrUK);assert(n,"invalid cursor attribute");(this.ǃrUP!==n||e)&&(this.ǃrUu(),this.ǃqi.setAttribute(n,""),this.ǃrUP=n)}ǃrUu(){this.ǃrUP&&this.ǃqi.removeAttribute(this.ǃrUP),this.ǃrUP=""}ǃTq(){this.ǃrUu(),this.ǃqi=null,this.ǃrUw=null}}ǃr.ǃo=class{constructor(){throw new TypeError("static class can't be instantiated")}static ǃrrU(){return o}static ǃUNJ(e){e=!!e;e===o||(o=e,document.getElementsByTagName("body")[0].dir=e?"rtl":"ltr")}static ǃrrr(e){ǃr.ǃUyr(e,"#document");let r=U.get(e);return r||(r=[],U.set(e,r)),r}static ǃrUQ(e){ǃr.ǃ$(e,c);const r=ǃr.ǃo.ǃrrr(e.ǃam());let t=r.length;return t&&r[t-1]===e}static ǃaF(e,n){ǃr.ǃk(e);let i=null,o=null;if(n?n.nodeName&&"#document"===n.nodeName?(i=n,o=i.body):(ǃr.ǃIO(n),o=n,i=o.ownerDocument):(i=document,o=document.body),e!==t&&!r.has(e))throw new RangeError(`invalid mouse cursor name '${e}'`);const d=ǃr.ǃo.ǃrrr(i);if(100<=d.length)throw new Error("pushed too many mouse cursors");d.length&&d[d.length-1].ǃrUu();let a=ǃr.ǃq(c,e,o);return d.push(a),a.ǃrUZ(!1),a}static ǃad(e){if(ǃr.ǃVm(e,c),!!e){const r=ǃr.ǃo.ǃrrr(e.ǃam());e.ǃTq();const t=r.indexOf(e);0>t||(r.splice(t,1),r.length&&r[r.length-1].ǃrUZ(!0))}}static ǃrv(e){ǃr.ǃoF(e),e&&e.parentElement&&e.parentElement.removeChild(e)}static ǃrrT(e){ǃr.ǃk(e),ǃr.ǃo.ǃrv(document.getElementById(e))}static ǃrrv(e){ǃr.ǃk(e);let r=document.querySelectorAll(e);for(let t=0,n=r.length;t=o?r.insertBefore(a,s[0]):0r)return!1;if(0===r)return!0;let t=e.toLowerCase();for(let r=0,i=n.length;ro.bottom&&(e.scrollIntoView(!1),r.scrollTop+=5):"top"===t?(e.scrollIntoView(!0),r.scrollTop-=5):"bottom"===t?(e.scrollIntoView(!1),r.scrollTop+=5):void 0}static ǃrrF(e,r){ǃr.ǃIO(e),ǃr.ǃk(r),r=r.trim();let t=r.lastIndexOf(" ");if(0>=t)return void(e.textContent=r);let n=r.lastIndexOf(" ",t-1);if(0>=n)return void(e.textContent=r);e.textContent=r.substring(0,n+1);let i=ǃr.ǃo.ǃUd("span",e,null,"nowrap");i.textContent=r.substring(n+1)}static ǃUrM(e,r){if(ǃr.ǃVg(r),r||(r={}),!ǃr.ǃFL(e)&&!ǃr.ǃFJ(e))throw new Error("unexpected argument");let t=r.parent||document.body,n=r.tag||"div",i=r.ǃfk||null,o=r.ǃrrm,d=r.className,a=r.id,s=!1;i||(i=document.createElement(n),s=!0),o&&i.setAttribute(o,""),d&&(i.className=d),a&&(i.id=a),s&&t.appendChild(i);let T=window.getComputedStyle(i),l;if(ǃr.ǃFL(e))l=T.getPropertyValue(e);else if(ǃr.ǃFJ(e))for(let r of e)if(l=T.getPropertyValue(r),l)break;return s&&t.removeChild(i),l}static ǃJQ(){if(isNaN(T)){let e=ǃr.ǃo.ǃUrM("width",{className:"width100em"});if(!e.endsWith("px"))throw new Error("expected em size in px");T=parseFloat(e)/100}return T}static ǃrrh(){if(isNaN(l)){const e=ǃr.ǃo.ǃUrM("--window-border-size");if(!e.endsWith("px"))throw new Error("--window-border-size must specify size in units of 'px'");l=parseFloat(e)||7}return l}static ǃrrn(){if(isNaN(u)){let e=ǃr.ǃo.ǃUrM("--window-thin-border-size");if(!e.endsWith("px"))throw new Error("--window-border-size must specify size in units of 'px'");u=parseFloat(e)||1}return u}static ǃrrV(){return ǃr.ǃo.ǃrrh()}static ǃMf(r){r.preventDefault()}static ǃrrp(r){r.stopPropagation()}static ǃku(r){r.preventDefault(),r.stopPropagation()}static ǃuL(e,r,t,n){return ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃVm(t,ǃr.ǃo.ǃu.ǃZ),t&&!n&&(n=t.ǃAt()),ǃr.ǃo.ǃr$.ǃrrB(e,r,n)||ǃr.ǃo.ǃut.ǃrrB(e,r,n)||ǃr.ǃo.ǃQv.ǃrrd(e,r,t)}},ǃr.ǃo.devicePixelRatio=window.devicePixelRatio||1;if("loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):(e(),function(){CSS.supports("contain","content")||document.body.parentElement.setAttribute("no-containment","")}()),!ǃr.ǃvE){let r=new Set(["input","textarea","datalist"]);document.addEventListener("contextmenu",(n)=>{let e=n.target,t=e.tagName.toLowerCase();r.has(t)||ǃr.ǃUyy(e)||n.preventDefault()}),document.addEventListener("mousewheel",(r)=>{(ǃr.ǃke.ǃkQ(r)||r.ctrlKey)&&r.preventDefault()}),document.addEventListener("wheel",(r)=>{(ǃr.ǃke.ǃkQ(r)||r.ctrlKey)&&r.preventDefault()})}}{let e="",r=!1,t=null,n=null;const i=new Map;ǃr.ǃo.ǃfl=class{constructor(){throw new TypeError("static class can't be instantiated")}static ǃAJ(t){ǃr.ǃk(t);const n=`theme/${t}/import.html`;return window.addImport(n,!0).then((t)=>{if(r)throw new Error("can't change theme at runtime yet");e=ǃr.ǃT(t.URL),r=!0})}static ǃrrc(){if(!r)throw new Error("theme not loaded yet");return e}static ǃrrH(){if(!r)throw new Error("theme not loaded yet");return e+"icons/"}static ǃrrD(){return n?Promise.resolve(n):t?t:(t=ǃr.ǃfV(ǃr.ǃo.ǃfl.ǃrrH()+"precompiled-icons.json").then((e)=>(n=e,t=null,n)),t)}static ǃrrY(){return ǃr.ǃo.ǃfl.ǃf_("--default-icon-color")}static ǃf_(e,r){ǃr.ǃk(e),ǃr.ǃoF(r);let t=i.get(e);return t?t:(t=ǃr.ǃo.ǃUrM(e,r?{ǃfk:r}:null),i.set(e,t),t)}}}{const e=new Map;let r=ǃr.ǃq(ǃr.ǃUoG,"UI_STATE"),t=ǃr.ǃq(ǃr.ǃUoG,"UI_USERDATA");ǃr.ǃIn.ǃIh("default-layout")&&(r.ǃUoy("clear"),t.ǃUoy("clear")),ǃr.ǃo.Window=class extends ǃr.Event.ǃUU{constructor(e,r){ǃr.ǃIO(e),ǃr.ǃz(r),super(),this.ǃqi=e,this.ǃqi.addEventListener("focusin",(r)=>{r.stopPropagation(),ǃr.ǃo.ǃJe.ǃyJ(this)}),this.ǃrUm=r||"",this.ǃrra=null,this.ǃrrq=!1,this.ǃrrA=-1,this.ǃrrW=null,this.ǃrrG=!1,this.ǃOh=0,this.ǃOn=0,this.ǃrrk=0,this.ǃrrM=0,this.ǃrrx="",this.ǃULI=0,this.ǃULE=0,this.ǃULC=0,this.ǃULy=0,this.ǃrrR=!1,ǃr.ǃo.ǃJe.ǃrrg(this)}ǃP(){assert(!this.ǃrrR,"window already removed"),ǃr.ǃo.ǃJe.ǃUu(this),ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null,this.ǃrrR=!0,this.ǃrra&&e.delete(this.ǃrra),this.ǃrra=null,super.ǃTq()}ǃUh(){return assert(!this.ǃrrR,"using removed window"),this.ǃqi}ǃam(){return this.ǃqi.ownerDocument}ǃAt(){const e=this.ǃam();return e?e.defaultView:null}ǃTi(){return this.ǃrUm}ǃTz(e){ǃr.ǃk(e),this.ǃrUm=e}ǃrrO(r){if(ǃr.ǃk(r),e.has(r))throw new Error("Identifier already in use");e.set(r,this),this.ǃrra=r}ǃrrI(){return this.ǃrra}ǃrrE(e){let r=this.ǃrra;r&&t&&t.set(r,e)}ǃrrC(){t&&t.ǃUoy("clear").then(()=>t.release()).then(()=>t=null)}ǃrry(){let e=this.ǃrra;return e&&t&&t.get(e)}ǃrrb(){let e=this.ǃrra;return e&&t&&t.has(e)}ǃrrS(e){let t=this.ǃrra;t&&r&&r.set(t,e)}ǃrro(){r&&r.ǃUoy("clear").then(()=>r.release()).then(()=>r=null)}ǃrrj(){let e=this.ǃrra;return e&&r&&r.get(e)}ǃrre(){let e=this.ǃrra;return e&&r&&r.has(e)}ǃrrN(){throw new Error("derived class must override")}ǃVB(){this.ǃrrN()&&ǃr.ǃo.ǃJe.ǃVB(this)}ǃrrK(e){ǃr.ǃ$t(e);let r=this.ǃUh();r.style.zIndex=0>e?"":e,this.ǃrrA=e}ǃrrP(){return this.ǃrrA}static ǃaq(e,r){return e.ǃrrP()-r.ǃrrP()}ǃXI(){return!0}ǃVq(){return this.ǃrrq}ǃrrw(e){e=!!e;this.ǃrrq===e||(this.ǃrrq=e,ǃr.ǃo.ǃbL(this.ǃqi,"active",this.ǃrrq))}ǃfN(){this.ǃrrW=null}ǃrrQ(){this.ǃrrW=this.ǃUh().getBoundingClientRect()}ǃEf(){return assert(!this.ǃrrR,"using removed window"),this.ǃrrW||this.ǃrrQ(),this.ǃrrW}ǃhR(e,r){ǃr.ǃ$t(e),ǃr.ǃ$t(r);let t=this.ǃEf();return e>=t.left&&e=t.top&&r{let e=t.detail;ǃr.ǃo.ǃJe.ǃrTz(r,e.clientX,e.clientY,e.id,e.ǃnT)&&(t.preventDefault(),t.stopPropagation())}),r.document.addEventListener("keydown",(r)=>{ǃr.ǃo.ǃJe.ǃkK(r)}),r.document.addEventListener("keypress",(r)=>{ǃr.ǃo.ǃJe.ǃMZ(r)}),r.document.addEventListener("keyup",(r)=>{ǃr.ǃo.ǃJe.ǃkP(r)}),r.document.addEventListener("cut",(r)=>{ǃr.ǃo.ǃJe.ǃOK(r)}),r.document.addEventListener("copy",(r)=>{ǃr.ǃo.ǃJe.ǃOP(r)}),r.document.addEventListener("paste",(r)=>{ǃr.ǃo.ǃJe.ǃOw(r)}),r.addEventListener("blur",()=>{e=n,ǃr.ǃo.ǃJe.ǃyJ(null)}),r.addEventListener("focus",()=>{!n&&e&&ǃr.ǃo.ǃJe.ǃyJ(e),e=null})}(window);class d extends ǃr.Event.ǃUU{constructor(){super()}ǃfo(e){ǃr.ǃIO(e);for(const r of t)if(r.ǃUh()===e)return r;return null}ǃrrg(e){ǃr.ǃ$(e,ǃr.ǃo.Window),t.push(e)}ǃUu(r){ǃr.ǃ$(r,ǃr.ǃo.Window),this.ǃrTF(r),e===r&&(e=null);let n=t.indexOf(r);assert(0<=n,"cannot find window"),t.splice(n,1),this.ǃrTm()}*ǃfP(e){for(let r=t.length-1;0<=r;--r){const n=t[r];e&&n.ǃAt()!==e||(yield n)}}ǃrTz(e,r,t,n){ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃ$t(n);let i=ǃr.ǃo.ǃut.ǃrTh();if(i&&i.ǃYN()){for(let e of i.ǃrTn())if(e.ǃhR(r,t))return this.ǃyJ(e.ǃrrZ()),!1;if(i.ǃhR(r,t))return this.ǃyJ(i.ǃrrZ()),!1}else for(let n of this.ǃfP(e))if(n.ǃhR(r,t)&&(!i||n===i))return this.ǃyJ(n.ǃrrZ()),!1}ǃVB(e){ǃr.ǃ$(e,ǃr.ǃo.Window);let r=t.indexOf(e);0>r||(t.splice(r,1),t.push(e),this.ǃrTm())}ǃrTm(){let r=[];for(let e of t)e.ǃrrN()||(e.ǃrrK(-1),r.push(e));let e=1;for(let n of t)n.ǃrrN()&&(n.ǃrrK(e++),r.push(n));if(!ǃr.ǃUzP(r,t)){ǃr.ǃUnO(t,r);let n=new ǃr.Event("zindexchanged");this.dispatchEvent(n)}}ǃyJ(r,t){if(ǃr.ǃVm(r,ǃr.ǃo.Window),n!==r){i="",-1!=o&&(window.clearTimeout(o),o=-1),n&&n.ǃrrw(!1),n=r,n&&(!t&&this.ǃVB(n),n.ǃrrw(!0));let d=new ǃr.Event("activewindowchange");this.dispatchEvent(d)}}ǃLn(){return n}ǃkK(r){return r.which===ǃr.ǃrO.ǃns&&ǃr.ǃo.ǃut.ǃrTV()?void r.preventDefault():void(n&&n.ǃkK(r))}ǃkP(r){n&&n.ǃkP(r)}ǃMZ(t){if(t.key&&n){const e=n.ǃUh().ownerDocument;if(!ǃr.ǃkw(e)){i+=t.key,-1!=o&&window.clearTimeout(o),o=window.setTimeout(r,1e3);const e=new ǃr.Event("searchinput");e.ǃUXe=i,n.dispatchEvent(e)}}}ǃOK(r){n&&n.ǃOK(r)}ǃOP(r){n&&n.ǃOP(r)}ǃOw(r){n&&n.ǃOw(r)}ǃrTF(e){if(ǃr.ǃ$(e,ǃr.ǃo.Window),e===n){for(let r=t.length-1,n;0<=r;--r)if(n=t[r],n!==e&&n.ǃXI())return void this.ǃyJ(n,!0);this.ǃyJ(null)}}ǃrrB(e,r,t,n){ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃVm(t,ǃr.ǃo.Window);let i=ǃr.ǃo.ǃut.ǃrTh();if(i&&i.ǃYN()){for(let n of i.ǃrTn())if(n!==t&&n.ǃhR(e,r))return!0;if(i===t)return!1;if(i.ǃhR(e,r))return!0}else for(let i of this.ǃfP(n))if(i!==t&&i.ǃhR(e,r))return!0;return!1}ǃrTp(e,r,t,n){ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃ$(t,ǃr.ǃo.Window);let i=ǃr.ǃo.ǃut.ǃrTh();if(i&&i.ǃYN()){for(let n of i.ǃrTn()){if(n===t)return!1;if(n.ǃhR(e,r))return!0}if(i===t)return!1;if(i.ǃhR(e,r))return!0}else for(let i of this.ǃfP(n)){if(i===t)return!1;if(i.ǃhR(e,r))return!0}throw new Error("couldn't find window")}}ǃr.ǃo.ǃJe=ǃr.ǃq(d)}{const e=!!window.C3_IsPopupWindow;e?(window.addEventListener("cut",()=>{window.opener.postMessage({type:"clipboard",event:"cut"},location.origin)}),window.addEventListener("copy",()=>{window.opener.postMessage({type:"clipboard",event:"copy"},location.origin)}),window.addEventListener("paste",()=>{window.opener.postMessage({type:"clipboard",event:"paste"},location.origin)})):window.addEventListener("message",(r)=>{r.origin!==location.origin||ǃr.ǃo.ǃUHb.ǃUDp(r.source,r.data)});let r=new Set,t=new Map;const n={ǃUHS:"",name:null,ǃrTB:null,ǃrTd:!1,ǃrTc:!0};ǃr.ǃo.ǃUHb=class{constructor(){throw new TypeError("static class can't be instantiated")}static ǃrTH(e,r,n,i,o,d){ǃr.ǃk(e),ǃr.ǃk(r),ǃr.ǃ$t(n),ǃr.ǃ$t(i),ǃr.ǃ$f(o),ǃr.ǃ$f(d);let a,s;a="number"==typeof o?o:window.screenX+window.outerWidth/2-n/2,s="number"==typeof d?d:window.screenY+window.outerHeight/2-i/2;let T=`width=${n},height=${i},left=${a},top=${s},menubar=no,toolbar=no,location=no,personalbar=no,status=no,dependent=yes,dialog=yes,resizable=yes,scrollbars=no`,l=window.open(e,r,T);return new Promise((e,r)=>l?void t.set(l,{resolve:e,reject:r}):void r())}static ǃUDp(e,r){if(r&&"object"==typeof r&&"string"==typeof r.type)switch(r.type){case"ready":ǃr.ǃo.ǃUHb.ǃrTD(e);break;case"keydown-event":ǃr.ǃo.ǃUHb.ǃrTY(r.event);break;case"clipboard":ǃr.ǃo.ǃUHb.ǃrTa(r.event);break;case"closed":ǃr.ǃo.ǃUHb.ǃrTq(e);}}static ǃrTD(e){r.add(e);let n=t.get(e);n&&n.resolve(e),t.delete(e);let i=[];const o=ǃr.ǃrTW.ǃrTA();o&&(i=o.ǃrTG()),ǃr.ǃo.ǃUHb.ǃrTk(e,"init-settings",{uiEffectsEnabled:app.ǃUvS(),themeStyles:i}),ǃr.ǃo.ǃut.ǃrTM(e)}static ǃrTq(e){r.delete(e);let n=t.get(e);n&&n.reject(e),t.delete(e)}static ǃrTk(e,r,t){e.postMessage({type:r,param:t},location.origin)}static ǃrTY(e){e.preventDefault=function(){},e.stopPropagation=function(){};const r=new ǃr.Event("external-keydown");r.ǃcN=e,app.dispatchEvent(r);const t=ǃr.ǃo.ǃJe.ǃLn();t&&t.ǃkK(e)}static ǃrTa(e){const r={clipboardData:null,preventDefault(){},stopPropagation(){}},t=ǃr.ǃo.ǃJe.ǃLn();t&&("cut"===e?t.ǃOK(r):"copy"===e?t.ǃOP(r):t.ǃOw(r))}static ǃrTx(e){e=!!e;for(let t of r)ǃr.ǃo.ǃUHb.ǃrTk(t,"show-dimmer",e)}static ǃUHy(e,r){ǃr.ǃk(e),ǃr.ǃVg(r),r=Object.assign({},n,r),ǃr.ǃk(r.ǃUHS),ǃr.ǃz(r.name),ǃr.ǃoF(r.ǃrTB);const t=!!r.ǃrTd,i=!!r.ǃrTc;let o=null;if(t?(o=window.open(null,r.name,r.ǃUHS),o&&(o.opener=null,o.location=e)):o=window.open(e,r.name,r.ǃUHS),o)return Promise.resolve({window:o});if(i){const t=ǃr.ǃo.ǃS.ǃb("OpenPopupWindow");return t.ǃy(e,r)}return Promise.resolve(null)}}}{function e(r){r.document.addEventListener("UIPointerDown",(t)=>{let e=t.detail;ǃr.ǃo.ǃut.ǃrTz(r,e.clientX,e.clientY,e.id,e.ǃnT)&&(t.preventDefault(),t.stopPropagation())}),r.document.addEventListener("UIPointerMove",(t)=>{let e=t.detail;ǃr.ǃo.ǃut.ǃrTR(r,e.clientX,e.clientY,e.id)&&(t.preventDefault(),t.stopPropagation())}),r.document.addEventListener("UIPointerUp",(t)=>{let e=t.detail;ǃr.ǃo.ǃut.ǃrTg(r,e.clientX,e.clientY,e.screenX,e.screenY,e.id)&&(t.preventDefault(),t.stopPropagation())})}let r=new Map,t=new Set,n=new Set,i=new Map,o=new Map,a=new Map,s=new Map,d=!1,T=null;window.C3_IsPopupWindow||e(window),window.addEventListener("focus",()=>{let e=ǃr.ǃo.ǃut.ǃrTh();e&&ǃr.ǃo.ǃJe.ǃyJ(e)});let l=null,u=ǃr.ǃq(ǃr.Event.ǃUU);ǃr.ǃo.ǃut=class{constructor(){throw new TypeError("static class can't be instantiated")}static ǃrTO(e,t){if(ǃr.ǃk(e),ǃr.ǃ_u(t),r.has(e))throw new Error(`dialog name '${e}' already in use`);r.set(e,{ǃrTI:t,ǃ_Q:[]})}static ǃrTE(e,t){ǃr.ǃk(e);let n=r.get(e);if(!n)throw new Error(`dialog name '${e}' not found`);let o=null;if(t){for(let e of n.ǃ_Q)if(!e.ǃvy()){o=e;break}}else n.ǃ_Q.length&&(o=n.ǃ_Q[0]);return o||(d=t,o=ǃr.ǃq(n.ǃrTI,t),n.ǃ_Q.push(o),o.ǃTz(e),o.ǃrrO("DIALOG_"+e+n.ǃ_Q.length),o.ǃrTC(),d=!1),o}static ǃrTy(){return d}static ǃrTb(){return!!this.ǃrTh()}static ǃrTh(){const e=[...n];return e.length?e[e.length-1]:null}static ǃrTS(){const e=[...t];return e.reverse(),e}static ǃrTo(e){const r=[];for(const n of t)e===n.ǃam()&&r.push(n);return r}static ǃrTj(e){const r=[];for(const n of t)e&&e!==n.ǃAt()||r.push(n);return r}static ǃrTe(e){let r=ǃr.ǃo.ǃut.ǃrTh(),t=ǃr.ǃo.ǃut.ǃrTS();return r?(ǃr.ǃU$D(t,(t)=>!t.ǃrTN()||!t.ǃaB()===r||e&&t.ǃAt()!==e),(!e||r.ǃAt()===e)&&t.push(r)):ǃr.ǃU$D(t,(r)=>r.ǃrTK()||e&&r.ǃAt()!==e),t}static ǃrTP(){let e=ǃr.ǃo.ǃJe.ǃLn();return e instanceof ǃr.ǃo.ǃS?e:null}static ǃrTM(r){e(r)}static ǃrTw(e,r){ǃr.ǃ$(e,ǃr.ǃo.ǃS),r?(t.add(e),e.ǃrTQ()&&(n.add(e),this.ǃrTZ("showmodal",e)),ǃr.ǃo.ǃJe.ǃyJ(e)):(t.delete(e),e.ǃrTQ()&&(n.delete(e),this.ǃrTZ("hidemodal",e)))}static ǃrrB(e,r,t){ǃr.ǃ$t(e),ǃr.ǃ$t(r);for(const n of ǃr.ǃo.ǃut.ǃrTj(t))if(n.ǃhR(e,r))return!0;return!1}static ǃrTu(e){ǃr.ǃ$(e,ǃr.ǃo.ǃS);const r=e.ǃtd(),t=e.ǃtc();for(const n of ǃr.ǃo.ǃut.ǃrTj(e.ǃAt()))if(e!==n&&n.ǃtd()===r&&n.ǃtc()===t)return!0;return!1}static ǃCL(){return 0"Progress"!==e.ǃTi()).length}static ǃrvT(e){return ǃr.ǃ$(e,ǃr.ǃo.ǃS),!!o.get(e)}static ǃUsG(e){return ǃr.ǃ$(e,ǃr.ǃo.ǃS),!!s.get(e)}static ǃrvv(e){return ǃr.ǃ$(e,ǃr.ǃrvJ),T=e,ǃr.ǃo.ǃut.ǃrvL()}static ǃrvL(){const e=new ǃr.Event("load");return e.app=T,ǃr.ǃo.ǃut.ǃUVt.ǃUPS(e).then(()=>{ǃr.ǃo.ǃut.ǃUVt.ǃUPO("load")})}static ǃrvs(e,r,t,n){(ǃr.ǃ$(e,ǃr.ǃo.ǃS),ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃ$t(n),!(o.has(e)||s.has(e)))&&(ǃr.ǃo.ǃr$.ǃrrB(r,t,e.ǃAt())||(ǃr.ǃo.ǃut.ǃrTz(e.ǃAt(),r,t,n),s.has(e)||(i.set(n,e),o.set(e,n),e.ǃrru(r,t),e.ǃrTT(e.ǃtd()-r,e.ǃtc()-t),e.ǃrvX("startdragging"))))}static ǃrTz(e,r,t,n,T){if(ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃ$t(n),i.has(n)||a.has(n)||ǃr.ǃo.ǃr$.ǃrrB(r,t,e))return!1;for(const i of ǃr.ǃo.ǃut.ǃrTe(e)){const d=i.ǃrvi(r,t);if("m"===d)return!1;if(d&&T===ǃr.ǃGV.ǃxp){if(o.has(i))return!1;if(ǃr.ǃo.ǃJe.ǃrTp(r,t,i,e))break;return a.set(n,i),s.set(i,n),i.ǃrvX("startresizing"),i.ǃrTL(d),i.ǃrru(r,t),i.ǃrTX(i.ǃtd(),i.ǃtc()),i.ǃrTl(i.ǃ_v(),i.ǃ_L()),i.ǃrv_(),!0}}return!1}static ǃrTR(e,r,t,n){if(ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃ$t(n),ǃr.ǃUvm.ǃUwX(n))return!1;if(i.has(n))return ǃr.ǃo.ǃut.ǃrvl(r,t,n,i.get(n)),!0;if(a.has(n))return ǃr.ǃo.ǃut.ǃrvt(r,t,n,a.get(n)),!0;if(ǃr.ǃo.ǃr$.ǃrrB(r,t,e))return l&&l.Set("default"),!1;for(const i of ǃr.ǃo.ǃut.ǃrTe(e)){const n=i.ǃrvi(r,t);if(n){if(ǃr.ǃo.ǃJe.ǃrTp(r,t,i,e))break;if(l)"e"===n||"w"===n?l.Set("ew-resize"):"n"===n||"s"===n?l.Set("ns-resize"):"nw"===n||"se"===n?l.Set("nwse-resize"):"ne"===n||"sw"===n?l.Set("nesw-resize"):"m"===n&&(ǃr.ǃo.ǃad(l),l=null);else{const e=i.ǃam();"e"===n||"w"===n?l=ǃr.ǃo.ǃaF("ew-resize",e):"n"===n||"s"===n?l=ǃr.ǃo.ǃaF("ns-resize",e):"nw"===n||"se"===n?l=ǃr.ǃo.ǃaF("nwse-resize",e):("ne"===n||"sw"===n)&&(l=ǃr.ǃo.ǃaF("nesw-resize",e))}return!!l}}return ǃr.ǃo.ǃad(l),l=null,!1}static ǃrvl(e,r,t,n){ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃ$(n,ǃr.ǃo.ǃS),n.ǃlN(e+n.ǃrTv()),n.ǃlK(r+n.ǃrTJ())}static ǃrvt(e,r,t,n){var i=Math.min;ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃ$(n,ǃr.ǃo.ǃS);let o=e-n.ǃrTU(),d=r-n.ǃrTr(),a=n.ǃrTi(),s=n.ǃrT_(),T=n.ǃrTt(),l=n.ǃrT$(),u=n.ǃrTs();if("e"===u||"se"===u||"ne"===u)n.ǃlP(T+o);else if("w"===u||"sw"===u||"nw"===u){let e=a+T-n.ǃrv$();n.ǃlN(i(a+o,e)),n.ǃlP(T-o)}if("s"===u||"sw"===u||"se"===u)n.ǃlw(l+d);else if("n"===u||"nw"===u||"ne"===u){let e=s+l-n.ǃrvf();n.ǃlK(i(s+d,e)),n.ǃlw(l-d)}}static ǃrTg(e,r,t,n,d,T){if(ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃ$t(T),i.has(T)){let e=i.get(T);if(ǃr.ǃo.ǃut.ǃrvl(r,t,T,e),(0>r||0>t||r>window.innerWidth||t>window.innerHeight)&&e.ǃrvz()){let r=ǃr.ǃo.devicePixelRatio;e.ǃIa(n/r+e.ǃrTv(),d/r+e.ǃrTJ()).catch(()=>e.ǃrvF())}else e.ǃrvF();return i.delete(T),o.delete(e),e.ǃrvm(),e.ǃrvX("finishdragging"),!0}if(a.has(T)){let e=a.get(T);ǃr.ǃo.ǃut.ǃrvt(r,t,T,e),e.ǃrvF(),a.delete(T),s.delete(e),e.ǃrvh(),e.ǃrvm(),e.ǃrvX("finishresizing")}return!1}static ǃrTZ(e,r){ǃr.ǃk(e),ǃr.ǃVm(r,ǃr.ǃo.ǃS);let t=new ǃr.Event(e);t.ǃrvn=r,this.dispatchEvent(t)}static addEventListener(e,r,t){u.addEventListener(e,r,t)}static removeEventListener(e,r,t){u.removeEventListener(e,r,t)}static dispatchEvent(r){return u.dispatchEvent(r)}},ǃr.ǃo.ǃut.ǃUVt=ǃr.ǃq(ǃr.Event.ǃUU)}{const e={duration:200,easing:"ease-out"},r=30,t=ǃr.ǃq(ǃr.ǃUwI,1);let n=new Map;ǃr.ǃo.ǃS=class extends ǃr.ǃo.Window{constructor(e){if(ǃr.ǃIO(e,"dialog"),ǃr.ǃo.ǃut.ǃrTy()&&(e=e.cloneNode(!0)),super(e),n.has(e))throw new Error("dialog class already created");n.set(e,this),this.ǃrvV=e.querySelector("ui-dialog-caption"),this.ǃrvp=e.querySelector("ui-dialog-contents"),this.ǃrvB=e.querySelector("ui-dialog-footer"),this.ǃrvd=this.ǃqi.ownerDocument,this.ǃrvc=null,this.ǃqi.hasAttribute("role")||this.ǃqi.setAttribute("role","dialog"),this.ǃrvH=this.ǃqi.hasAttribute("resizable"),this.ǃrvD=!0,this.ǃrvY=!1,this.ǃrva=null,this.ǃrvq=!1,this.ǃrvA=null,this.ǃrvW=null,this.ǃrvG=null,this.ǃrvk=null,this.ǃrvM=this.ǃqi.querySelector("ui-dialog-caption"),this.ǃrvx=null,this.ǃrvR=!1,this.ǃrvg=null,this.ǃrvO=!1,this.ǃrvI=!1,this.ǃfX=!0,this.ǃrvE=!1,this.ǃrvC="",this.ǃcY=0,this.ǃca=0,this.ǃUBa=0,this.ǃUBq=0,this.ǃrvy=0,this.ǃrvb=0,this.ǃ$k=()=>this.ǃrvF(),this.ǃSw=null,this.ǃrvS=null,this.ǃrvo=!1,this.ǃrvj=!1,this.ǃUHz=null,this.ǃrve=()=>this.ǃIJ(),this.ǃrvN=null,this.ǃrvK=null,this.ǃrvP=null,this.ǃrvw=!0,this.ǃrvM&&(this.ǃrvC=this.ǃrvM.textContent,ǃr.ǃo.ǃfZ(this.ǃrvM),this.ǃrvx=ǃr.ǃo.ǃUd("span",this.ǃrvM,null,"dialog-caption-text"),this.ǃrvx.textContent=this.ǃrvC,this.ǃSw=(r)=>{r.detail.ǃnT!==ǃr.ǃGV.ǃxp||this.ǃrvQ(r.detail.clientX,r.detail.clientY,r.detail.id)},this.ǃrvS=(r)=>this.ǃrvZ(r),this.ǃrvM.addEventListener("contextmenu",this.ǃrvS),this.ǃqi.hasAttribute("closebutton")&&(this.ǃrvN=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃzC,this.ǃrvM),this.ǃrvN.onclick=()=>this.ǃrvu()),this.ǃqi.hasAttribute("backbutton")&&(this.ǃrvK=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrJU,this.ǃrvM),this.ǃrvK.onclick=()=>this.ǃrJr())),this.ǃrJT=null,this.ǃrJv=[],this.ǃrJJ=[],this.ǃrJL=0,this.ǃrJs=0,this.ǃrJX=null,this.ǃrJi=null,this.ǃrJ_=(r)=>this.ǃrJl(r),this.ǃrJt=(r)=>this.ǃrJ$(r),this.ǃrJf=(r)=>this.ǃrJz(r),this.ǃrJF=!1}ǃrTC(){}ǃrre(){if(super.ǃrre()){let e=this.ǃrrj();return e.devicePixelRatio===window.devicePixelRatio}return!1}ǃrvm(...e){if(!(this.ǃrvT()||this.ǃUsG())&&!this.ǃrJF&&this.ǃrUm&&this.ǃrvD&&ǃr.ǃo.ǃS.ǃb(this.ǃrUm)===this){let r=this.ǃrvc&&this.ǃrvc.defaultView,t={popup:this.ǃrJm(),nested:this.ǃrTN(),width:this.ǃUBa,height:this.ǃUBq,resizable:this.ǃrvH,devicePixelRatio:window.devicePixelRatio,xRatio:r&&this.ǃcY/r.innerWidth,yRatio:r&&this.ǃca/r.innerHeight,xParentRatio:r&&this.ǃrJh()/r.innerWidth,yParentRatio:r&&this.ǃrJn()/r.innerHeight};Object.assign(t,...e),this.ǃrrS(t)}}ǃrJV(){var e=Number.isFinite;this.ǃrJF=!0;let r=this.ǃrrj();if((this.ǃrvj||this.ǃUHz)&&(r=null),this.ǃrvD&&r)if(r.popup)this.ǃIa(screen.width/2,screen.height/2);else{const t=this.ǃrvc?this.ǃrvc.defaultView:null,n=r.xRatio,i=r.yRatio,o=r.xParentRatio,d=r.yParentRatio,a=r.nested;if(t&&e(n)&&e(i))if(a&&e(o)&&e(d)){let e=this.ǃrJh(),r=this.ǃrJn(),a=o*t.innerWidth,s=d*t.innerHeight;this.ǃrJp(n*t.innerWidth-(e-a),i*t.innerHeight-(r-s))}else this.ǃrJp(n*t.innerWidth,i*t.innerHeight);r.resizable&&(this.ǃlP(r.width),this.ǃlw(r.height)),this.ǃrvF()}this.ǃrJF=!1}static ǃUV$(e,r){ǃr.ǃo.ǃut.ǃrTO(e,r)}static ǃb(e,r){return ǃr.ǃo.ǃut.ǃrTE(e,r)}static ǃrJB(e){return n.get(e)||null}ǃFH(e){if(ǃr.ǃz(e),this.ǃrvx){let r=e||window.app.ǃTi();this.ǃrvC!==r&&(this.ǃrvx.textContent=r,this.ǃrvC=r)}}ǃrJd(){return!0}ǃrJc(){return!1}ǃrrN(){return this.ǃvy()}ǃvy(){return this.ǃrvO||this.ǃrvI||this.ǃrvg||(ǃr.ǃUCV.ǃUCd?this.ǃqi.open:this.ǃrvR)}ǃXI(){return ǃr.ǃUCV.ǃUCd?this.ǃqi.open&&!this.ǃrvI:this.ǃrvR&&!this.ǃrvI}ǃrJH(){return!!(this.ǃrvO||this.ǃrvI||this.ǃrvg)}ǃrJD(){return this.ǃrvO}ǃrvU(){return this.ǃrvI}ǃrJm(){return!!this.ǃUHz}ǃrJY(){return this.ǃrvc===document}ǃrvT(){return ǃr.ǃo.ǃut.ǃrvT(this)}ǃUsG(){return ǃr.ǃo.ǃut.ǃUsG(this)}ǃaB(){return this.ǃrJT||this.ǃrJX}ǃrTN(){return!!this.ǃrJT||!!this.ǃrJX}ǃrJa(){return!!this.ǃrTN()&&-1!==this.ǃaB().ǃrJq().indexOf(this)}ǃrJA(){return!!this.ǃrTN()&&-1!==this.ǃaB().ǃrJW().indexOf(this)}ǃjU(){return app.ǃjU()}ǃrJG(){return this.ǃrvV}ǃrJk(){return this.ǃrvp}ǃrJM(){return this.ǃrvB}ǃUnj(e){ǃr.ǃk(e);let r=this.ǃqi.querySelector("."+e);if(!r)throw new Error(`missing dialog element with class name: ${e}`);return r}ǃrJx(e){ǃr.ǃk(e);let r=this.ǃqi.querySelector("#"+e);if(!r)throw new Error(`missing dialog element with id: ${e}`);return r}ǃrJR(e){ǃr.ǃk(e);let r=this.ǃqi.getElementsByTagName(e);if(!r)throw new Error(`tag '${e}' does not match any element`);return r}ǃrJg(e,r=!1){ǃr.ǃk(e),r=!!r;let t;if(r){if(t=this.ǃqi.querySelectorAll(e),!t)throw new Error(`CSS selector '${e}' does not match any element`);if(!t.length)throw new Error(`CSS selector '${e}' does not match any element`)}else if(t=this.ǃqi.querySelector(e),!t)throw new Error(`CSS selector '${e}' does not match any element`);return t}ǃIv(){return this.ǃUHz}ǃrJO(e){this.ǃrvc=e?e.ownerDocument:this.ǃUHz?this.ǃUHz.document:document,assert(this.ǃrvc,"no display document for dialog")}ǃrJI(e){ǃr.ǃ$(e,ǃr.ǃo.ǃS);let r=this.ǃrJJ.indexOf(e);assert(-1===r,"child popup window is already part of parent dialog"),this.ǃrJJ.push(e),e.addEventListener("afterpopupclose",this.ǃrJf)}ǃrJE(e){ǃr.ǃ$(e,ǃr.ǃo.ǃS);let r=this.ǃrJJ.indexOf(e);assert(-1!==r,"child popup window is not part of parent dialog"),this.ǃrJJ.splice(r,1),e.removeEventListener("afterpopupclose",this.ǃrJf)}ǃrJz(e){let r=e.ǃrvn,t=r.ǃaB();assert(t,"parent can not be null when a child popup is closed"),t.ǃrJE(r)}ǃrJC(e){ǃr.ǃ$(e,ǃr.ǃo.ǃS);let r=this.ǃrJv.indexOf(e);assert(-1===r,"child dialog is already part of parent dialog"),e.ǃrJT=this,this.ǃrJv.length||(this.addEventListener("positionchange",this.ǃrJt),this.addEventListener("widthchange",this.ǃrJt),this.addEventListener("heightchange",this.ǃrJt),this.addEventListener("startdragging",this.ǃrJ_),this.addEventListener("startresizing",this.ǃrJ_)),this.ǃrJv.push(e)}ǃrJy(e){ǃr.ǃ$(e,ǃr.ǃo.ǃS);let r=this.ǃrJv.indexOf(e);assert(-1!==r,"child dialog is not part of parent dialog"),this.ǃrJv.splice(r,1),e.ǃrJT=null,this.ǃrJv.length||(this.removeEventListener("positionchange",this.ǃrJt),this.removeEventListener("widthchange",this.ǃrJt),this.removeEventListener("heightchange",this.ǃrJt),this.removeEventListener("startdragging",this.ǃrJ_),this.removeEventListener("startresizing",this.ǃrJ_))}ǃrJb(){for(let e of this.ǃrJv)if(e.ǃrvj||e.ǃkV(),e.ǃrJT){let r=e.ǃrJT.ǃrJv.indexOf(e);e.ǃrJT.ǃrJv.splice(r,1),e.ǃrJT=null}if(ǃr.ǃXk(this.ǃrJv),!this.ǃrvj){for(let e of this.ǃrJJ)e.ǃrvj||e.ǃkV(),e.removeEventListener("afterpopupclose",this.ǃrJf),e.ǃrJX=null;ǃr.ǃXk(this.ǃrJJ)}this.removeEventListener("positionchange",this.ǃrJt),this.removeEventListener("widthchange",this.ǃrJt),this.removeEventListener("heightchange",this.ǃrJt),this.removeEventListener("startdragging",this.ǃrJ_),this.removeEventListener("startresizing",this.ǃrJ_)}ǃYN(){return!!this.ǃrJv.length}ǃrJS(){return!!this.ǃrJJ.length}ǃrJq(){return this.ǃrJv}ǃrJW(){return this.ǃrJJ}*ǃrTn(){for(let e=this.ǃrJv.length-1;0<=e;--e)yield this.ǃrJv[e]}ǃrJh(){let e=this.ǃrJT;return e?e.ǃcY+e.ǃrJo():0}ǃrJn(){let e=this.ǃrJT;return e?e.ǃca+e.ǃrJo():0}ǃrJ$(){let e=this.ǃtd()-this.ǃrJL,r=this.ǃtc()-this.ǃrJs;for(let t of this.ǃrJv)t.ǃrJp(t.ǃrJL-e,t.ǃrJs-r)}ǃrJl(){this.ǃrJL=this.ǃtd(),this.ǃrJs=this.ǃtc();for(let e of this.ǃrJv)e.ǃrJL=e.ǃtd(),e.ǃrJs=e.ǃtc()}ǃy(e){return this.ǃrJj(),this.ǃrJe(!0,e)}ǃvS(e){return this.ǃrJj(),this.ǃrJe(!1,e)}ǃrJj(){assert(!1===this.ǃrvj,"_isPopupTransfer must be false"),assert(null===this.ǃrJT,"_parent must be null"),assert(null===this.ǃrJX,"_parentBeforeDetach must be null")}ǃrJe(r,t){if(r=!!r,ǃr.ǃoF(t),this.ǃrvG=null,ǃr.ǃrd.ǃvq&&(r=!0),this.ǃvy()&&this.ǃrTQ()!==r)throw new Error("dialog already showing with different modal setting");this.ǃrvY=r;let n=this.ǃrJN();if(n)return n;if(this.ǃrvI&&(this.ǃrvg.cancel(),this.ǃrvg=null,this.ǃrJK()),this.ǃrvk=null,this.ǃrJO(t),this.ǃvy())return this.ǃrJi;if(ǃr.ǃo.ǃbL(this.ǃqi,"modal",this.ǃrvY),ǃr.ǃo.ǃbL(this.ǃqi,"non-modal",!this.ǃrvY),this.ǃfX&&this.ǃrJP(),this.ǃrvY&&(ǃr.ǃo.ǃrJw.ǃvS(t),this.ǃrva=ǃr.ǃo.ǃaF("default",this.ǃrvc),this.ǃrvw&&(this.ǃrvP=ǃr.ǃUuW.ǃrD(()=>{this.ǃrvK?this.ǃrJr():this.ǃrvN?this.ǃrvu():this.ǃUne()},this.ǃrvC))),this.ǃrvq?this.ǃqi.style.display="":this.ǃrvd!==this.ǃrvc&&(ǃr.ǃo.ǃrv(this.ǃqi),this.ǃrvc.body.appendChild(this.ǃqi)),ǃr.ǃUCV.ǃUCd?this.ǃrvY?this.ǃqi.showModal():this.ǃqi.show():this.ǃqi.setAttribute("polyfill",""),this.ǃrvR=!0,this.ǃrJQ(),ǃr.ǃo.ǃut.ǃrTw(this,!0),this.ǃfX?(this.ǃrJZ(),this.ǃrJu()):this.ǃrvE?(this.ǃqi.style.width=`${this.ǃUBa}px`,this.ǃqi.style.height=`${this.ǃUBq}px`,this.ǃrJZ()):ǃr.ǃrd.ǃvq&&this.ǃrLU(),!this.ǃrvE&&this.ǃrre()&&this.ǃrJV(),this.ǃfX=!1,this.ǃrvE=!1,this.ǃrLr(),this.ǃrTK()||this.ǃrLT(),this.ǃrTK()||this.ǃrvc.defaultView.addEventListener("resize",this.ǃ$k),!this.ǃrvM||ǃr.ǃrd.ǃvq||this.ǃrTK()||this.ǃrvM.addEventListener("UIPointerDown",this.ǃSw),this.ǃrvO=!this.ǃrTK(),this.ǃjU()&&!this.ǃrvj&&!this.ǃrTK()){let r=this.ǃEf(),t=r.left+r.width/2-this.ǃrJh(),n=r.top+r.height/2-this.ǃrJn(),i=[{transform:`perspective(600px) translate3d(${this.ǃcY}px, ${this.ǃca}px, -20px)`,transformOrigin:`${t}px ${n}px`,opacity:"0"},{transform:`perspective(600px) translate3d(${this.ǃcY}px, ${this.ǃca}px, 0)`,transformOrigin:`${t}px ${n}px`,opacity:"1"}];this.ǃqi.style.transform="",this.ǃrvg=this.ǃqi.animate(i,e),this.ǃrvg.onfinish=()=>this.ǃrJK()}else this.ǃrJK();return this.ǃrvj?this.ǃrJi:(this.ǃrvp&&(this.ǃrvp.scrollTop=0),this.ǃrTK()||this.ǃrvm(),this.ǃrJi?this.ǃrJi:this.ǃrLv())}ǃrJQ(){if(!this.ǃrvY&&!this.ǃrJm()){let e=ǃr.ǃo.ǃut.ǃrTh();if(e&&!e.ǃrJm()&&e.ǃXI()){if(this.ǃrvq)throw new Error("not supported");ǃr.ǃo.ǃrv(this.ǃqi),e.ǃUh().appendChild(this.ǃqi),e.ǃrJC(this)}}}ǃrJN(){if(!this.ǃrvY&&!this.ǃrJm()){let e=ǃr.ǃo.ǃut.ǃrTh();if(e&&e.ǃrJm()){if(this.ǃrJX=e,this.ǃrre()){let e=this.ǃrrj();this.ǃlP(e.width),this.ǃlw(e.height)}else this.ǃrJu();return this.ǃIa().then(()=>this.ǃrLv())}}}ǃrLv(){return this.ǃrJi=new Promise((e,r)=>{this.ǃrvA=e,this.ǃrvW=r}),this.ǃrJi}ǃrJP(){this.ǃrvC||this.ǃFH(null),this.ǃFC()}ǃFC(){}ǃrLJ(r=!1){if(!this.ǃvy())return this.ǃrvG?void(this.ǃrvG=null):void console.warn(`[Dialog] Closing dialog '${this.ǃrvC}' which is not currently open`);if(this.ǃrvG=null,ǃr.ǃo.ǃr$.ǃrLL(),ǃr.ǃo.ǃsZ.ǃyy.ǃrLs(this),!this.ǃrTN()&&this.ǃrJm()&&ǃr.ǃo.ǃut.ǃrTo(this.ǃam()).forEach((e)=>{e===this||e.ǃkV(!0)}),ǃr.ǃo.ǃJe.ǃrTF(this),this.ǃrvc.defaultView.removeEventListener("resize",this.ǃ$k),this.ǃrvM&&this.ǃrvM.removeEventListener("UIPointerDown",this.ǃSw),this.ǃrvY&&ǃr.ǃo.ǃrJw.ǃvb(),this.ǃrvg)if(r)this.ǃrvg=null;else return void(this.ǃrvO&&(this.ǃrvO=!1,this.ǃrvI=!0,ǃr.ǃUyw(this.ǃrvg)));if(this.ǃrvI=!0,(this.ǃYN()||this.ǃrJS())&&this.ǃrJb(),this.ǃrvm(),this.ǃrJa()&&this.ǃaB().ǃrJy(this),this.ǃjU()&&!this.ǃrvj&&!this.ǃUHz&&!r){let r=this.ǃEf(),t=r.left+r.width/2-this.ǃrJh(),n=r.top+r.height/2-this.ǃrJn(),i=[{transform:`perspective(600px) translate3d(${this.ǃcY}px, ${this.ǃca}px, 0)`,transformOrigin:`${t}px ${n}px`,opacity:"1"},{transform:`perspective(600px) translate3d(${this.ǃcY}px, ${this.ǃca}px, -20px)`,transformOrigin:`${t}px ${n}px`,opacity:"0"}];this.ǃqi.style.transform="",this.ǃrvg=this.ǃqi.animate(i,e),this.ǃrvg.onfinish=()=>this.ǃrJK()}else this.ǃrJK()}ǃrTK(){return this.ǃrvI||!this.ǃvy()}ǃUne(){this.ǃkh(!0)}ǃrvu(){this.ǃkV()}ǃrJr(){this.ǃrvu()}ǃkh(e){this.ǃrvI||(this.ǃrLX(e),this.ǃrLJ())}ǃrLX(e){return this.ǃrvG?void t.ǃUwo(this.ǃrvG,e):void(this.ǃrvA&&this.ǃrvA(e),this.ǃrJi=null)}ǃkV(e=!1){e=!!e;this.ǃrvI||(this.ǃrLi(),this.ǃrLJ(e))}ǃrLi(){return this.ǃrvG?void t.ǃUwo(this.ǃrvG,null):void(this.ǃrvA&&this.ǃrvA(null),this.ǃrJi=null)}ǃrL_(e){this.ǃrvI||(this.ǃrLl(e),this.ǃrLJ())}ǃrLl(e){return this.ǃrvG?void t.ǃUwj(this.ǃrvG,e):void(this.ǃrvW&&this.ǃrvW(e),this.ǃrJi=null)}ǃrLt(){}ǃrL$(){}ǃrJK(){this.ǃrvI&&(!this.ǃrvj&&(this.ǃUu(),ǃr.ǃo.ǃut.ǃrTw(this,!1),ǃr.ǃo.ǃad(this.ǃrva),this.ǃrva=null,this.ǃrvP&&(this.ǃrvP.ǃTq(),this.ǃrvP=null)),ǃr.ǃUCV.ǃUCd&&this.ǃqi.close(),this.ǃrvR=!1,!this.ǃrvj&&this.ǃUHz&&(this.ǃIJ(),this.ǃrvE=!0),this.ǃrvq?this.ǃqi.style.display="none":this.ǃrvd!==this.ǃrvc&&(ǃr.ǃo.ǃrv(this.ǃqi),this.ǃrvd.body.appendChild(this.ǃqi)),this.ǃrvc=null,this.ǃrvk&&(this.ǃrvk(),this.ǃrvk=null),this.ǃrL$()),this.ǃrvO&&this.ǃrLt();let e=this.ǃrvO;this.ǃrvO=!1,this.ǃrvI=!1,this.ǃrvg=null,e&&!this.ǃrvj&&(ǃr.ǃrd.ǃvq?this.ǃrLU():this.ǃrLf()),this.ǃfN()}ǃUu(){}ǃUlb(){return new Promise((e)=>{this.ǃrvk=e})}ǃam(){return this.ǃrvc}ǃrTQ(){return this.ǃrvY}ǃrvz(){return this.ǃUsM()&&this.ǃrTf()}ǃrvZ(r){r.preventDefault(),ǃr.ǃJ.ǃrx("ui.dialogs.caption-menu");let e=ǃr.ǃq(ǃr.ǃo.ǃr$,this.ǃrvM);this.ǃrvz()&&e.ǃrz("open-popup",lang(".open-to-popup-window"),()=>this.ǃIa(),{ǃvv:!0}),e.ǃrz("close",lang(".close"),()=>this.ǃrvu()),e.ǃrp(r.clientX,r.clientY),ǃr.ǃJ.ǃrR()}ǃIa(e,r){if(ǃr.ǃ$f(e),ǃr.ǃ$f(r),this.ǃrvo)throw new Error("already awaiting popup window");if(this.ǃUHz)throw new Error("already in popup window");return this.ǃrvz()?(this.ǃrvo=!0,this.ǃrvX("beforepopupopen"),ǃr.ǃo.ǃUHb.ǃrTH("window.html",this.ǃrUm,this.ǃ_v(),this.ǃ_L(),e,r).then((e)=>(e.addEventListener("unload",()=>this.ǃrLz(e)),this.ǃrLF(e))).catch(()=>{this.ǃrvo=!1,this.ǃrvm();let e=ǃr.ǃo.ǃS.ǃb("OK");e.ǃy(lang("ui.cannot-open-popup")),this.ǃrvX("afterpopupclose")})):void 0}ǃrLm(){return this.ǃYN()?Promise.resolve().then(()=>Promise.all(this.ǃrJq().map((e)=>(this.ǃrJI(e),e.ǃIa())))):Promise.resolve()}ǃrLF(e){return Promise.resolve().then(()=>this.ǃrLm()).then(()=>{if(this.ǃrvj=!0,this.ǃrJX=this.ǃaB(),this.ǃrTN()&&!this.ǃrJA()&&this.ǃrJX.ǃrJI(this),this.ǃvy())return this.ǃrLJ()}).then(()=>(this.ǃrvo=!1,this.ǃUHz=e,window.addEventListener("unload",this.ǃrve),this.ǃqi.setAttribute("inPopupWindow",""),this.ǃqi.style.transform="",this.ǃqi.style.width="",this.ǃqi.style.height="",this.ǃrJe(this.ǃrvY),this.ǃrvj=!1,e.document.title=this.ǃrvC,this.ǃrvX("afterpopupopen"),ǃr.ǃo.ǃUHb.ǃrTk(e,"dialog-transferred",null),this.ǃrvm(),e))}ǃrLz(e){this.ǃUHz&&(ǃr.ǃo.ǃut.ǃrTj(e).forEach((e)=>{e===this||e.ǃkV(!0)}),this.ǃrvX("beforepopupclose"),this.ǃrvj=!0,this.ǃUBa=ǃr.ǃsP(this.ǃUHz.innerWidth,this.ǃrvy,ǃr.ǃUyo(0.9*window.innerWidth)),this.ǃUBq=ǃr.ǃsP(this.ǃUHz.innerHeight,this.ǃrvb,ǃr.ǃUyo(0.9*window.innerHeight)),window.removeEventListener("unload",this.ǃrve),this.ǃrLJ(),this.ǃUHz=null,this.ǃqi.removeAttribute("inPopupWindow"),this.ǃrvE=!0,this.ǃrTN()&&(!this.ǃrTN()||this.ǃaB().ǃrJm())?this.ǃrLi():this.ǃrJe(this.ǃrvY),this.ǃrvX("afterpopupclose"),this.ǃrvj=!1,this.ǃrJX=null,this.ǃrvm())}ǃIJ(){if(this.ǃUHz){this.ǃUBa=ǃr.ǃsP(this.ǃUHz.innerWidth,this.ǃrvy,ǃr.ǃUyo(0.9*window.innerWidth)),this.ǃUBq=ǃr.ǃsP(this.ǃUHz.innerHeight,this.ǃrvb,ǃr.ǃUyo(0.9*window.innerHeight));let e=this.ǃUHz;this.ǃUHz=null,e.close(),this.ǃqi.removeAttribute("inPopupWindow"),this.ǃrvo=!1}}ǃrrQ(){if(this.ǃvy()){super.ǃrrQ(),this.ǃcY=ǃr.ǃUyo(this.ǃrrW.left),this.ǃca=ǃr.ǃUyo(this.ǃrrW.top);let e=2*this.ǃrJo();this.ǃUBa=this.ǃrrW.right-this.ǃrrW.left-e,this.ǃUBq=this.ǃrrW.bottom-this.ǃrrW.top-e}}ǃrJZ(){this.ǃrLU(),this.ǃqi.style.margin="0",this.ǃqi.style.position="absolute",this.ǃqi.style.left="0px",this.ǃqi.style.top="0px",this.ǃfN()}ǃrLr(){}ǃrLU(){if(this.ǃrvc&&this.ǃrvc.defaultView){this.ǃfN(),super.ǃEf();let e=2*this.ǃrJo(),r=(this.ǃUBa+e)/2,t=(this.ǃUBq+e)/2,n=this.ǃrvc.defaultView.innerWidth/2,i=this.ǃrvc.defaultView.innerHeight/2;this.ǃcY=ǃr.ǃUyo(n-r-this.ǃrJh()),this.ǃca=ǃr.ǃUyo(i-t-this.ǃrJn()),this.ǃrLf()}}ǃrJu(){let e=ǃr.ǃo.ǃUrM("min-width",{ǃfk:this.ǃqi});if(!e.endsWith("px"))throw new Error("CSS style for dialog min-width must specify the size in units of 'px'");let r=parseInt(e,10);isFinite(r)||(r=this.ǃUsM()?300:125),this.ǃrvy=r;let t=ǃr.ǃo.ǃUrM("min-height",{ǃfk:this.ǃqi});if(!t.endsWith("px"))throw new Error("CSS style for dialog min-height must specify the size in units of 'px'");let n=parseInt(t,10);isFinite(n)||(n=this.ǃUsM()?200:50),this.ǃrvb=n}ǃEf(){if(!this.ǃfX||this.ǃrTN()){let e=2*this.ǃrJo(),r=this.ǃrJh(),t=this.ǃrJn();return{left:this.ǃcY+r,top:this.ǃca+t,right:this.ǃcY+this.ǃUBa+e+r,bottom:this.ǃca+this.ǃUBq+e+t,width:this.ǃUBa+e,height:this.ǃUBq+e}}return super.ǃEf()}ǃrLf(){this.ǃrvO||this.ǃrvI||(this.ǃrJm()?this.ǃqi.style.transform="":this.ǃqi.style.transform=`translate(${this.ǃcY}px,${this.ǃca}px)`)}ǃrJp(e,r){ǃr.ǃ$t(e),ǃr.ǃ$t(r),e=ǃr.ǃUyo(e),r=ǃr.ǃUyo(r);this.ǃcY===e&&this.ǃca===r||this.ǃUHz||(this.ǃcY=e,this.ǃca=r,this.ǃrLf(),this.ǃfN(),this.ǃrvX("positionchange"),this.ǃrvm())}ǃlN(e){ǃr.ǃ$t(e),e=ǃr.ǃUyo(e);this.ǃcY===e||this.ǃUHz||(this.ǃcY=e,this.ǃrLf(),this.ǃfN(),this.ǃrvX("positionchange"),this.ǃrvm())}ǃtd(){return this.ǃEf(),this.ǃcY}ǃrLh(){return this.ǃtd()+this.ǃrJo()+this.ǃrJh()}ǃlK(e){ǃr.ǃ$t(e),e=ǃr.ǃUyo(e);this.ǃca===e||this.ǃUHz||(this.ǃca=e,this.ǃrLf(),this.ǃfN(),this.ǃrvX("positionchange"),this.ǃrvm())}ǃtc(){return this.ǃEf(),this.ǃca}ǃrLn(){return this.ǃtc()+this.ǃrJo()+this.ǃrJn()}ǃlP(e){ǃr.ǃ$t(e),e=ǃr.ǃUyo(e),ee&&this.ǃlP(e-t),this.ǃUBq+t>r&&this.ǃlw(r-t);let n=-this.ǃrJh(),i=-this.ǃrJn();this.ǃcYe&&this.ǃlN(e-this.ǃUBa-t+n),this.ǃcar&&this.ǃlK(r-this.ǃUBq-t+i)}this.ǃrvX("resize")}}ǃrLT(){if(!ǃr.ǃrd.ǃvq&&!this.ǃrJm())for(;ǃr.ǃo.ǃut.ǃrTu(this);)this.ǃrJp(this.ǃtd()+r,this.ǃtc()+r)}ǃhR(e,r){return ǃr.ǃ$t(e),ǃr.ǃ$t(r),!!this.ǃvy()&&super.ǃhR(e,r)}ǃrvQ(e,r,t){ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃ$f(t),ǃr.ǃo.ǃut.ǃrvs(this,e,r,t)}ǃkK(r){const e=r.which;return this.ǃrvI?(r.preventDefault(),void r.stopPropagation()):void(e===ǃr.ǃrO.ǃns?(r.preventDefault(),r.stopPropagation(),this.ǃrvu()):e!==ǃr.ǃrO.ǃrg||r.shiftKey||(r.preventDefault(),r.stopPropagation(),this.ǃUne()))}ǃrv_(){}ǃrvh(){}ǃrJo(){return this.ǃrJm()?0:this.ǃUsM()?ǃr.ǃo.ǃrrV():ǃr.ǃo.ǃrrn()}ǃrvi(e,t){if(ǃr.ǃ$t(e),ǃr.ǃ$t(t),!this.ǃUsM())return"";if(ǃr.ǃrd.ǃvq)return"";let n=this.ǃEf(),r=this.ǃrJo(),i=2*r,o="";return e>n.left+r&&en.top+r&&t=n.left&&e<=n.left+i?t>=n.top&&t<=n.top+i?o="nw":t<=n.bottom&&t>=n.bottom-i?o="sw":t>n.top+i&&t=n.right-i?t>=n.top&&t<=n.top+i?o="ne":t<=n.bottom&&t>=n.bottom-i?o="se":t>n.top+i&&t=n.right-r&&(o="e"):e>n.left+i&&e=n.top&&t<=n.top+r?o="n":t<=n.bottom&&t>=n.bottom-r&&(o="s")),o}ǃrvX(e){ǃr.ǃk(e);let r=new ǃr.Event(e);r.ǃrvn=this,this.dispatchEvent(r)}ǃrLV(){if(this.ǃrvq)throw new Error("already keeping in main document");this.ǃrvq=!0,this.ǃrvd=document,document.body.appendChild(this.ǃqi),this.ǃqi.style.display="none"}ǃrLp(e){this.ǃrvK&&this.ǃrvK.ǃJB(e)}}}{const e=[{opacity:"0"},{opacity:"1"}],r={duration:200,easing:"ease-out"},t={duration:200,easing:"ease-out",direction:"reverse"};let n=null,i=null,o=!1,d=!1,a=null,s=0;ǃr.ǃo.ǃrJw=class{constructor(){throw new TypeError("static class can't be instantiated")}static ǃvS(t){return a=t?t.ownerDocument:document,assert(a,"no display document for dimmer"),++s,i?void(d&&(d=!1,o=!0,ǃr.ǃUyw(i))):void(n||(!window.C3_IsPopupWindow&&ǃr.ǃo.ǃUHb.ǃrTx(!0),n=ǃr.ǃo.ǃUd("div",a.body,null,"c3-dimmer"),o=!0,!ǃr.ǃUCV.ǃUCd&&n.setAttribute("polyfill",""),app.ǃjU()?(i=n.animate(e,r),i.onfinish=ǃr.ǃo.ǃrJw.ǃrJK):ǃr.ǃo.ǃrJw.ǃrJK()))}static ǃvb(){if(0!=s)return(--s,!(0{this.ǃrLD=()=>{this.ǃrLH=!0,this.ǃrLc.files.length?t?e(this.ǃrLc.files):e(this.ǃrLc.files[0]):e(null),this.ǃUu()},this.ǃrLc.addEventListener("change",this.ǃrLD),this.ǃrLc.click()})}ǃUu(){this.ǃrLc.removeEventListener("change",this.ǃrLD),this.ǃrLD=null,this.ǃUQJ.defaultView.removeEventListener("focus",this.ǃrLY),this.ǃrLY=null,ǃr.ǃo.ǃrv(this.ǃrLc),this.ǃrLc=null,this.ǃUQJ=null}},"use strict";{const e=ǃr.ǃU(),r=e.getElementById("okDialog"),t={message:"",align:"center",ǃrLa:!1},n=ǃr.ǃo.ǃS.ǃrLq=class extends ǃr.ǃo.ǃS{constructor(){super(r),this.ǃrLA=this.ǃUnj("okMessage"),this.ǃUno=this.ǃUnj("okButton"),this.ǃUno.onclick=()=>this.ǃUne(),this.ǃrvD=!1}ǃFC(){this.ǃUno.textContent=lang("common.ok")}ǃy(e,r){let n;ǃr.ǃUyi(e)?(n=Object.assign({},t),n.message=e):(ǃr.ǃyd(e),n=Object.assign({},t,e));let i=n.message;return ǃr.ǃo.ǃbL(this.ǃrJk(),"alignleft","left"===n.align),ǃr.ǃo.ǃbL(this.ǃrJk(),"selectable",n.ǃrLa),"string"==typeof i||i.ǃUjS()?ǃr.ǃo.ǃrrF(this.ǃrLA,i.toString()):ǃr.ǃzL(this.ǃrLA,i),super.ǃy(r)}ǃUu(){this.ǃFH(null)}};ǃr.ǃo.ǃut.ǃUVt.addEventListener("load",function(){ǃr.ǃo.ǃS.ǃUV$("OK",n)})}{const e=ǃr.ǃU(),r=e.getElementById("confirmDialog"),t=ǃr.ǃo.ǃS.ǃrLW=class extends ǃr.ǃo.ǃS{constructor(){super(r),this.ǃUUu=null,this.ǃrLG=this.ǃUnj("confirmMessage"),this.ǃrLk=this.ǃUnj("confirmButton"),this.ǃrvD=!1,this.ǃrLk.onclick=()=>(this.ǃUUu&&this.ǃUUu(),this.ǃUne()),this.ǃrLM=this.ǃUnj("cancelConfirmButton"),this.ǃrLM.onclick=()=>this.ǃrvu()}ǃFC(){}ǃy(e,r){ǃr.ǃFX(e),ǃr.ǃoF(r);let t=e.caption||"",n=e.message||"",i=e.ǃP_||lang("common.ok"),o=e.ǃPl||lang("common.cancel");return t&&this.ǃFH(t),"string"==typeof n||n.ǃUjS()?ǃr.ǃo.ǃrrF(this.ǃrLG,n.toString()):ǃr.ǃzL(this.ǃrLG,n),this.ǃrLk.textContent=i,this.ǃrLM.textContent=o,this.ǃrvw=!e.ǃrLx,super.ǃy(r)}ǃUu(){this.ǃUUu=null}};ǃr.ǃo.ǃut.ǃUVt.addEventListener("load",function(){ǃr.ǃo.ǃS.ǃUV$("Confirm",t)})}{const e=ǃr.ǃU(),r=e.getElementById("confirmMultipleDialog"),t=ǃr.ǃo.ǃS.ǃrLR=class extends ǃr.ǃo.ǃS{constructor(){super(r),this.ǃUUu=null,this.ǃrLG=this.ǃUnj("confirmMultipleMessage"),this.ǃrLg=this.ǃUnj("confirmMultipleButtonWrap"),this.ǃrLO=""}ǃFC(){}ǃy(e,r){ǃr.ǃFX(e),ǃr.ǃoF(r),ǃr.ǃre(e.options),e.ǃUlo&&e.options.push({text:lang("common.cancel"),tag:"cancel"});const t=e.caption||"",n=e.message||"";t&&this.ǃFH(t),"string"==typeof n||n.ǃUjS()?ǃr.ǃo.ǃrrF(this.ǃrLG,n.toString()):ǃr.ǃzL(this.ǃrLG,n);const i=super.ǃy(r);for(let t=0,n=e.options.length;tthis.ǃUne(o),0===t&&(this.ǃrLO=o,d.setAttribute("main","")),tthis.ǃrvu()}ǃFC(){}ǃy(e,r,t){ǃr.ǃz(e),this.ǃrLy=0,this.ǃrLb=e?e:`${lang("ui.dialogs.progress.titleBase")} ({0}%)...`,this.ǃrLM.textContent=lang("ui.dialogs.progress.cancelButton"),this.onprogress?(this.ǃrLo(!1),this.ǃrLj(!0),this.ǃUwK=window.setInterval(()=>this.ǃrLj(),100)):(this.ǃrLo(!0),this.ǃFH(this.ǃrLb)),t?(this.ǃrLS=t,this.ǃrLM.style.display=""):(this.ǃrLS=null,this.ǃrLM.style.display="none"),this.ǃrvw=!!t;const n=super.ǃy(r);return this.ǃOi||(this.ǃOi=ǃr.ǃo.ǃaF("wait")),n}ǃrLo(e){e=!!e;this.ǃrLC===e||(this.ǃrLC=e,this.ǃrLC?(this.ǃrLE.removeAttribute("value"),this.ǃrLE.removeAttribute("max")):(this.ǃrLE.value=this.ǃrLy,this.ǃrLE.max=1))}ǃrLj(e){if(this.onprogress){let r=this.onprogress();(this.ǃrLy!==r||e)&&(this.ǃrLy=r,null===this.ǃrLy?(this.ǃrLo(!0),this.ǃFH(this.ǃrLb.replace("{0}","0"))):(!isFinite(this.ǃrLy)&&(this.ǃrLy=0),this.ǃrLy=ǃr.ǃsP(this.ǃrLy,0,1),this.ǃrLo(!1),this.ǃrLE.value=this.ǃrLy,this.ǃFH(this.ǃrLb.replace("{0}",Math.round(1e3*r)/10))))}}ǃrLJ(){-1!==this.ǃUwK&&(window.clearInterval(this.ǃUwK),this.ǃUwK=-1),ǃr.ǃo.ǃad(this.ǃOi),this.ǃOi=null,this.onprogress=null,this.ǃrLy=0,super.ǃrLJ()}ǃUne(){}ǃrvu(){this.ǃrLS&&(this.ǃrLS(),super.ǃrvu())}};ǃr.ǃo.ǃut.ǃUVt.addEventListener("load",function(){ǃr.ǃo.ǃS.ǃUV$("Progress",n)})}{const e=ǃr.ǃU(),r=e.getElementById("downloadDialog"),t=ǃr.ǃT(e.URL);ǃr.ǃJ.ǃv(t+"lang");const n=ǃr.ǃo.ǃS.ǃUtJ=class extends ǃr.ǃo.ǃS{constructor(){super(r),this.ǃrLE=this.ǃUnj("downloadProgressBar"),this.ǃrLe=this.ǃUnj("downloadDetails"),this.ǃUwK=-1,this.ǃrLN="",this.ǃrLK="",this.ǃrLP=0,this.ǃrLw=0,this.ǃrLQ=0,this.ǃrLZ=[],this.ǃrLu=0,this.ǃrsU=!1,this.ǃOi=null,this.ǃrvD=!1}ǃFC(){}ǃy(e,r){ǃr.ǃk(e),this.ǃrLN=e,this.ǃrLP=0,this.ǃrLw=0,this.ǃrLu=0,this.ǃrLQ=0,ǃr.ǃXk(this.ǃrLZ),this.ǃrsU=!0;let t=this.ǃrLN.lastIndexOf("/");this.ǃrLK=this.ǃrLN.substring(t+1),this.ǃFH(lang("ui.dialogs.download.caption")),this.ǃrvw=!1;let n=super.ǃy(r);return this.ǃOi||(this.ǃOi=ǃr.ǃo.ǃaF("progress")),ǃr.ǃPD(e,(r)=>this.ǃrsr(r)).then((e)=>{ǃr.ǃo.ǃad(this.ǃOi),this.ǃOi=null,this.ǃkh(e)}).catch((e)=>{ǃr.ǃo.ǃad(this.ǃOi),this.ǃOi=null,this.ǃrL_(e)}),this.ǃUwK=window.setInterval(()=>this.ǃrsT(!0),1e3),this.ǃrsT(),n}ǃrsr(r){if(r.lengthComputable){this.ǃrLu=r.total,this.ǃrLw=r.loaded,this.ǃrsU&&(this.ǃrsU=!1,this.ǃrsT(!1));let e=100*this.ǃrLw/this.ǃrLu;this.ǃrLE.value=e,this.ǃFH(ǃj("ui.dialogs.download.caption-progress",Math.round(e)))}}ǃrsv(e){ǃr.ǃ$t(e),this.ǃrLZ.length>=10&&this.ǃrLZ.shift(),this.ǃrLZ.push(e)}ǃrsJ(){if(0===this.ǃrLZ.length)return 0;let e=0;for(let t of this.ǃrLZ)e+=t;return e/this.ǃrLZ.length}ǃrsT(e){e&&(this.ǃrLQ=this.ǃrLw-this.ǃrLP,this.ǃrsv(this.ǃrLQ),this.ǃrLP=this.ǃrLw),ǃr.ǃJ.ǃrx("ui.dialogs.download");let r=lang(".downloading-label")+this.ǃrLK;0",r+=lang(".speed-label"),r+=0===this.ǃrLQ?lang(".calculating"):ǃr.ǃUqE(this.ǃrLQ,!0);let t=navigator.connection||navigator.ǃrsL||navigator.ǃrss,n=t?t.type:"";n&&"other"!==n&&"unknown"!==n&&(r+=" ("+n+")"),r+="
",r+=lang(".time-remaining-label");let i=-1;if(2>this.ǃrLZ.length)r+=lang(".calculating");else{let e=this.ǃrsJ();0===e?r+=lang(".stalled"):(i=(this.ǃrLu-this.ǃrLw)/e,i=5*Math.round(i/5),r+=5>i?lang("common.time.a-few-seconds"):ǃr.ǃUju(i,{ǃUjK:!0}))}this.ǃrLe.innerHTML=r,ǃr.ǃJ.ǃrR(),this.ǃrLU()}ǃrLJ(){window.clearInterval(this.ǃUwK),this.ǃUwK=-1,super.ǃrLJ()}ǃUne(){}ǃrvu(){}};ǃr.ǃo.ǃut.ǃUVt.addEventListener("load",function(){ǃr.ǃo.ǃS.ǃUV$("Download",n)})}{const e=ǃr.ǃU(),r=e.getElementById("openPopupWindowDialog"),t=ǃr.ǃT(e.URL);ǃr.ǃJ.ǃv(t+"lang");const n=ǃr.ǃo.ǃS.ǃrsX=class extends ǃr.ǃo.ǃS{constructor(){super(r),this.ǃrLG=this.ǃUnj("openPopupWindowMessage"),this.ǃrsi=this.ǃUnj("openPopupWindowTryAgain"),this.ǃrsi.onclick=()=>this.ǃUne(),this.ǃrLM=this.ǃUnj("openPopupWindowCancel"),this.ǃrLM.onclick=()=>this.ǃrvu(),this.ǃrLN="",this.ǃrs_=null,this.ǃrvD=!1}ǃFC(){this.ǃFH(lang("ui.dialogs.openPopupWindow.caption")),ǃr.ǃJ.ǃrx("ui.dialogs.openPopupWindow"),this.ǃrLG.textContent=lang(".body"),this.ǃrLM.textContent=lang("common.cancel"),this.ǃrsi.textContent=lang(".try-again"),ǃr.ǃJ.ǃrR()}ǃy(e,r){return this.ǃrLN=e,this.ǃrs_=r,super.ǃy(r.ǃrTB)}ǃUne(){const e=Object.assign({},this.ǃrs_);e.ǃrTc=!1,ǃr.ǃo.ǃUHb.ǃUHy(this.ǃrLN,e).then((e)=>{e&&this.ǃkh(e)})}};ǃr.ǃo.ǃut.ǃUVt.addEventListener("load",function(){ǃr.ǃo.ǃS.ǃUV$("OpenPopupWindow",n)})}{const e=ǃr.ǃU(),r=e.getElementById("fontPickerDialog"),t=250,n={ǃUFP:"",ǃUFw:"",ǃUFQ:20,ǃUFZ:[],ǃUFu:""},i=ǃr.ǃo.ǃS.ǃrsl=class extends ǃr.ǃo.ǃS{constructor(){super(r),this.ǃUno=this.ǃUnj("okButton"),this.ǃUno.onclick=()=>this.ǃUne(),this.ǃrLM=this.ǃUnj("cancelButton"),this.ǃrLM.onclick=()=>this.ǃrvu(),this.ǃrst=this.ǃUnj("fontPickerLocalHeaderText"),this.ǃrs$=this.ǃUnj("localFontSelect"),this.ǃrs$.addEventListener("change",()=>this.ǃrsf()),this.ǃrsz=this.ǃUnj("additionalFontSection"),this.ǃrsF=this.ǃUnj("fontPickerAdditionalHeaderText"),this.ǃrsm=this.ǃUnj("additionalFontSelect"),this.ǃrsm.addEventListener("change",()=>this.ǃrsh()),this.ǃrsn=this.ǃUnj("sampleTextHeader"),this.ǃrsV=this.ǃUnj("sampleText"),this.ǃrsp="",this.ǃrsB=this.ǃUnj("fontPickerMorePreview"),this.ǃrsB.onclick=()=>this.ǃrsd(),this.ǃrsc="",this.ǃrsH="",this.ǃrsD=!1,this.ǃpk=!1,this.ǃrvD=!1}ǃFC(){ǃr.ǃJ.ǃrx("ui.dialogs.std.font-picker"),this.ǃFH(lang(".caption")),this.ǃrst.textContent=lang(".loading-message"),this.ǃUno.textContent=lang("common.ok"),this.ǃrLM.textContent=lang("common.cancel"),this.ǃrsB.textContent=lang(".more-preview"),ǃr.ǃJ.ǃrR()}ǃy(e,r){ǃr.ǃyd(e),e=Object.assign({},n,e),ǃr.ǃk(e.ǃUFP),ǃr.ǃk(e.ǃUFw),ǃr.ǃre(e.ǃUFZ),ǃr.ǃk(e.ǃUFu),this.ǃrsD||this.ǃpk||this.ǃrsY(),this.ǃrsc=e.ǃUFP||"",this.ǃrsH=this.ǃrsc,this.ǃrsp=e.ǃUFw||"";let i=e.ǃUFQ;return 72t&&(this.ǃrsp=this.ǃrsp.substr(0,t)+"..."),e.ǃUFZ.length?(this.ǃrsz.removeAttribute("hidden"),this.ǃrsF.textContent=e.ǃUFu||lang("ui.dialogs.std.font-picker.default-additional-fonts-header"),this.ǃrsa(e.ǃUFZ)):this.ǃrsz.setAttribute("hidden",""),this.ǃrsD&&(this.ǃrsV.textContent=this.ǃrsp||lang("ui.dialogs.std.font-picker.default-sample-text"),this.ǃrsq()),super.ǃy(r)}ǃrsY(){this.ǃpk=!0;let e=this.ǃUh().ownerDocument,r=e.createElement("option");r.value="",r.textContent=lang("ui.dialogs.std.font-picker.none-selected"),this.ǃrs$.appendChild(r),ǃr.ǃUjA.ǃUjW().then((e)=>this.ǃrsA(e))}ǃrsA(e){this.ǃpk=!1,this.ǃrsD=!0;let r=this.ǃUh().ownerDocument;for(let t of e){let e=r.createElement("option");e.value=t,e.textContent=t,e.style.fontFamily=t,e.setAttribute("title",t),e.addEventListener("UIDoubleTap",()=>this.ǃkh(t)),this.ǃrs$.appendChild(e)}this.ǃrsq(),ǃr.ǃJ.ǃrx("ui.dialogs.std.font-picker"),this.ǃrst.textContent=lang(".local-font-header"),this.ǃrsn.textContent=lang(".sample-text-header"),this.ǃrsV.textContent=this.ǃrsp||lang(".default-sample-text"),ǃr.ǃJ.ǃrR()}ǃrsa(e){let r=this.ǃUh().ownerDocument,t=r.createElement("option");t.value="",t.textContent=lang("ui.dialogs.std.font-picker.none-selected"),this.ǃrsm.appendChild(t);for(let t of e){let e=r.createElement("option");e.value=t,e.textContent=t,e.style.fontFamily=t,e.setAttribute("title",t),e.addEventListener("UIDoubleTap",()=>this.ǃkh(t)),this.ǃrsm.appendChild(e)}}ǃrsq(){this.ǃrsc&&(this.ǃrs$.value=this.ǃrsc,-1===this.ǃrs$.selectedIndex?(this.ǃrsm.value=this.ǃrsc,-1===this.ǃrsm.selectedIndex?(this.ǃrs$.selectedIndex=0,this.ǃrsf()):this.ǃrsh()):this.ǃrsf())}ǃrsf(){return 0===this.ǃrs$.selectedIndex?void(this.ǃrs$.style.fontFamily=""):void(this.ǃrsH=this.ǃrs$.value,this.ǃrs$.style.fontFamily=this.ǃrsH,this.ǃrsm.selectedIndex=0,this.ǃrsm.style.fontFamily="",this.ǃrsW())}ǃrsh(){return 0===this.ǃrsm.selectedIndex?void(this.ǃrsm.style.fontFamily=""):void(this.ǃrsH=this.ǃrsm.value,this.ǃrsm.style.fontFamily=this.ǃrsH,this.ǃrs$.selectedIndex=0,this.ǃrs$.style.fontFamily="",this.ǃrsW())}ǃrsW(){this.ǃrsV.style.fontFamily=this.ǃrsH}ǃrsd(){let e=ǃr.ǃo.ǃS.ǃb("FontPreview");e.ǃy(this.ǃrsH,this.ǃUh())}ǃUne(){this.ǃkh(this.ǃrsH)}ǃUu(){ǃr.ǃo.ǃfZ(this.ǃrsm)}};ǃr.ǃo.ǃut.ǃUVt.addEventListener("load",function(){ǃr.ǃo.ǃS.ǃUV$("FontPicker",i)})}{const e=ǃr.ǃU(),r=e.getElementById("fontPreviewDialog"),t=ǃr.ǃT(e.URL);ǃr.ǃJ.ǃv(t+"lang");const n=[5,8,11,14,20,36,48,72],i=ǃr.ǃo.ǃS.ǃrsG=class extends ǃr.ǃo.ǃS{constructor(){super(r),this.ǃUno=this.ǃUnj("okButton"),this.ǃUno.onclick=()=>this.ǃUne(),this.ǃrsk=this.ǃUnj("fontPreviewBody"),this.ǃrvD=!1}ǃFC(){this.ǃUno.textContent=lang("common.close-dialog")}ǃy(e,r){ǃr.ǃk(e),ǃr.ǃJ.ǃrx("ui.dialogs.fontPreview"),this.ǃFH(ǃj(".caption",e));let t=lang(".example-text");ǃr.ǃJ.ǃrR();for(let o=0,i;o{ǃr.ǃo.ǃS.ǃUV$("FontPreview",i)})}{const e=ǃr.ǃU(),r=e.getElementById("inputDialog"),t={caption:"",message:"",label:"",ǃrsM:"text",ǃUAI:"",ǃUAE:"",ǃP_:"",ǃPl:""},n=ǃr.ǃo.ǃS.ǃrsx=class extends ǃr.ǃo.ǃS{constructor(){super(r),this.ǃrLG=this.ǃUnj("inputMessage"),this.ǃUwD=this.ǃUnj("inputLabel"),this.ǃrLc=this.ǃUnj("input"),this.ǃUno=this.ǃUnj("okButton"),this.ǃUno.onclick=()=>this.ǃUne(),this.ǃrLM=this.ǃUnj("cancelButton"),this.ǃrLM.onclick=()=>this.ǃrvu(),this.ǃrvD=!1}ǃFC(){}ǃy(e,r){return ǃr.ǃyd(e),e=Object.assign({},t,e),ǃr.ǃk(e.caption),ǃr.ǃzg(e.message),ǃr.ǃzg(e.label),ǃr.ǃz(e.ǃrsM),ǃr.ǃz(e.ǃUAI),ǃr.ǃz(e.ǃUAE),ǃr.ǃz(e.ǃP_),ǃr.ǃz(e.ǃPl),this.ǃFH(e.caption),ǃr.ǃzL(this.ǃrLG,e.message),ǃr.ǃzL(this.ǃUwD,e.label),this.ǃrLc.setAttribute("type",e.ǃrsM||"text"),this.ǃrLc.setAttribute("placeholder",e.ǃUAI||""),this.ǃrLc.value=e.ǃUAE||"",this.ǃUno.textContent=e.ǃP_||lang("common.ok"),this.ǃrLM.textContent=e.ǃPl||lang("common.cancel"),super.ǃy(r)}ǃUne(){this.ǃkh(this.ǃrLc.value)}ǃUu(){this.ǃFH(null)}};ǃr.ǃo.ǃut.ǃUVt.addEventListener("load",function(){ǃr.ǃo.ǃS.ǃUV$("Input",n)})}"use strict",ǃr.ǃo.ǃu=class extends ǃr.ǃT_{constructor(e,r,t){ǃr.ǃk(e),ǃr.ǃVm(t,ǃr.ǃo.ǃu.ǃZ),super(),this.ǃUPm=e,this.ǃrsR=r,this.ǃrsg=t||null,this.ǃrsO=!1,this.ǃrsg?(this.ǃqi=this.ǃrsg.ǃqi,this.ǃqi.id=e,this.ǃrsO=t.ǃrsO):(this.ǃqi=ǃr.ǃo.ǃUd("ui-pane",null,e),document.body.appendChild(this.ǃqi),ǃr.ǃo.ǃrrs(this)),this.ǃrsI=[],this.ǃrsE=!0,this.ǃqi.removeAttribute(this.ǃrsR?"vgrid":"hgrid"),this.ǃqi.setAttribute(this.ǃrsR?"hgrid":"vgrid",""),this.ǃrsC=null,this.ǃrsy=!0,this.ǃ_a=!1}ǃP(){if(this.ǃ_a)throw new Error("layout has already been released");if(ǃr.ǃo.ǃrri(this))throw new Error("main layout can not be removed");this.ǃ_a=!0,this.ǃqi=null,this.ǃrsg=null,this.ǃrsC=null,ǃr.ǃTq(this)}ǃrsb(e){e?(this.ǃqi.style.position="relative",this.ǃqi.style.top=window.innerHeight+100+"px"):(this.ǃqi.style.position="",this.ǃqi.style.top="")}ǃux(){return this.ǃUPm}ǃrsS(){return this.ǃrsR}ǃrso(){return this.ǃrsg}ǃrsj(e){return this.ǃrsI.includes(e)}ǃUh(){return this.ǃqi}ǃrse(){return this.ǃrsI}ǃrsN(){return this.ǃrsO}ǃrsK(e){if(e=!!e,this.ǃrsO!==e){this.ǃrsO=e;for(let r=0,t=this.ǃrsI.length;r=t.left&&e=t.top&&rr&&this.ǃrXb(r,t);for(let e=0,r=this.ǃrsI.length;en;++n)t+=e.charAt(Math.floor(Math.random()*r));super.ǃrrO("PANE_"+t)}else super.ǃrrO("PANE_"+e)}ǃri$(){const e=this instanceof ǃr.ǃo.ǃu.ǃrXU&&this.ǃUHz,r=this.ǃPM&&this.ǃPM.ǃrsg,t=this.ǃrif(),n="main"!==this.ǃUPm&&(this instanceof ǃr.ǃo.ǃu.ǃrsZ&&"undefined"!=typeof this.ǃrXa?this.ǃrXa:!0);if(!(!e&&n&&(r||t))){let e=this.ǃriz((e,r)=>{const t={id:e.ǃUPm,size:e.ǃck,name:e.ǃrUm,devicePixelRatio:window.devicePixelRatio,popup:"CaptionPane"===e.constructor.name&&!!e.ǃUHz,type:null,activeTab:e.ǃriF()};switch(e.constructor){case ǃr.ǃo.ǃu.ǃrXr:t.side=e.ǃrXF,t.type="TabPane",t.docked="main"!==e.ǃUPm&&e.ǃrXa;break;case ǃr.ǃo.ǃu.ǃrXU:t.caption=e.ǃrim,t.side=e.ǃrXF,t.type="CaptionPane",t.docked="main"!==e.ǃUPm&&e.ǃrXa;break;case ǃr.ǃo.ǃu.ǃrsZ:t.side=e.ǃrXF,t.type="DockingPane",t.docked="main"!==e.ǃUPm&&e.ǃrXa;break;default:t.type="Pane";}return"main"!==e.ǃUPm&&!1===e.ǃrXa&&(t.position={x:e.ǃrih,y:e.ǃrin,width:e.ǃriV,height:e.ǃrip}),e.ǃriU?t.layout={tabSide:!1,size:e.ǃriU.ǃrsR?e.ǃ_v():e.ǃ_L(),id:e.ǃriU.ǃux(),isHorizontal:e.ǃriU.ǃrsR,children:[]}:"TabPane"===t.type&&(t.layout={tabSide:e.ǃrid.ǃriB,children:[]}),r&&r.layout&&r.layout.children.push(t),t});return e}}ǃric(){return this.ǃrrj()}ǃP(){if(!this.ǃqi)throw new Error("removing pane which has already been removed");let t=new ǃr.Event("remove");t.ǃVy=this,this.dispatchEvent(t),this.ǃriU&&(this.ǃriU.ǃP(),this.ǃriU=null),r.delete(this),super.ǃP()}ǃle(){return this.ǃPM}ǃriH(){if(this.ǃrXH())throw new Error("pane has flex size");return parseInt(this.ǃck,10)}ǃrX_(){return this.ǃck}ǃrXk(e){if(ǃr.ǃk(e),e=e.toLowerCase(),!ǃr.ǃo.ǃrrz(e))throw new Error(`invalid CSS length: '${e}'`);this.ǃck=e}ǃrXH(){return this.ǃck.includes("fr")}ǃrXi(){return this.ǃrXH()||this.ǃrXt()}ǃrXt(){return this.ǃrXZ}ǃrXl(e){e=!!e,this.ǃrXZ=e}ǃfM(){this.ǃriT=!1}ǃriz(e,r){if(this.ǃriT){const t=e(this,r);if(this.ǃriU&&this.ǃriU.ǃrsI)for(let r of this.ǃriU.ǃrsI)r.ǃriz(e,t);else if(this.constructor===ǃr.ǃo.ǃu.ǃrXr)for(let r of this.ǃrid.ǃriD)r.ǃriY.ǃriz(e,t);return t}}ǃrrN(){return!1}ǃrXz(){return!1}ǃrsN(){return this.ǃrsO}ǃrsK(e){e=!!e;this.ǃrsO===e||(this.ǃrsO=e,this.ǃriU&&this.ǃriU.ǃrsK(e))}ǃrXG(e){this.ǃrXu=e}ǃria(){return this.ǃrXu}ǃrif(){return!!this.ǃrXu}ǃriF(){return this.ǃrXu&&this.ǃrXu.ǃriq()===this}ǃrXQ(){this.ǃPM&&(this.ǃPM.ǃrXT(this),this.ǃPM.ǃm_(),this.ǃPM=null),ǃr.ǃo.ǃrv(this.ǃqi),this.ǃriA(),this.ǃriW(),this.ǃfN()}ǃQV(){return!!this.ǃqi.parentElement}ǃJc(){return this.ǃQV()}ǃrXD(e,r){if(ǃr.ǃk(e),r=!!r,this.ǃriU)throw new Error("cannot create a sub-grid on a pane which already has one");return this.ǃriU=ǃr.ǃq(ǃr.ǃo.ǃu,e,r,this),this.ǃriU}ǃrXd(e){if(ǃr.ǃ$(e,ǃr.ǃo.ǃu),this.ǃriU)throw new Error("cannot attach a sub grid on a pane which already has one");this.ǃriU=e,this.ǃriU.ǃrsg=this;let r=e.ǃrsS();this.ǃqi.removeAttribute(r?"vgrid":"hgrid"),this.ǃqi.setAttribute(r?"hgrid":"vgrid","")}ǃrXB(r){ǃr.ǃ$(r,ǃr.ǃo.ǃu),assert(this.ǃriU,"Should not replace a sub grid on a pane which does not already have one"),assert(this.ǃriU!==r,"Should not replace a sub grid with the same grid"),this.ǃriU=r,this.ǃriU.ǃrsg=this;let t=new ǃr.Event("replacesubgrid");t.ǃVy=this,t.ǃriG=r,this.dispatchEvent(t)}ǃrXV(){return this.ǃriU}ǃrXn(){return!!this.ǃriU}ǃhR(e,r,t){return ǃr.ǃ$t(e),ǃr.ǃ$t(r),!t&&this.ǃrXn()?!1:super.ǃhR(e,r)}ǃvb(){this.ǃqi.setAttribute("hide","")}ǃvS(){this.ǃqi.removeAttribute("hide")}ǃfj(){if(this.ǃris){this.ǃris=!1;let e=this.ǃqi.style.gridTemplateColumns;if(e)this.ǃri_=e,this.ǃrit=!0;else{let e=this.ǃqi.style.gridTemplateRows;e&&(this.ǃri_=e,this.ǃrit=!1)}this.ǃril=this.ǃrX_(),this.ǃrik(!1),this.ǃVz(!1)}}ǃfK(){this.ǃris||(this.ǃris=!0,this.ǃrik(!0),this.ǃVz(!0),this.ǃri_&&(this.ǃrit?this.ǃqi.style.gridTemplateColumns=this.ǃri_:this.ǃqi.style.gridTemplateRows=this.ǃri_),this.ǃril&&this.ǃrXk(this.ǃril),this.ǃri_="",this.ǃril="",this.ǃfN())}ǃrik(r){r=!!r;r===this.ǃriX||(this.ǃriX=r,r?this.ǃqi.removeAttribute("disablegridtemplates"):this.ǃqi.setAttribute("disablegridtemplates",""))}ǃVz(r){r=!!r;r===this.ǃrii||(this.ǃrii=r,r?this.ǃqi.removeAttribute("disablegridstartandend"):this.ǃqi.setAttribute("disablegridstartandend",""))}ǃriA(){this.ǃqi.style.gridColumn="",this.ǃqi.style.gridRow=""}ǃriW(){this.ǃrir&&(this.ǃqi.removeAttribute(this.ǃrir),this.ǃfN()),this.ǃrir=""}ǃrXf(e){ǃr.ǃ$t(e),assert(1<=e&&20>=e,"Invalid grid row number, must be 1-20");let r="row"+e;this.ǃrir===r||(this.ǃriW(),this.ǃrir=r,this.ǃqi.setAttribute(this.ǃrir,""),this.ǃfN())}ǃrX$(e){ǃr.ǃ$t(e),assert(1<=e&&20>=e,"Invalid grid column number, must be 1-20");let r="col"+e;this.ǃrir===r||(this.ǃriW(),this.ǃrir=r,this.ǃqi.setAttribute(this.ǃrir,""),this.ǃfN())}ǃfN(){super.ǃfN(),this.ǃriU&&this.ǃriU.ǃfN()}ǃtd(){return this.ǃEf().left}ǃtc(){return this.ǃEf().top}ǃ_v(){let e=this.ǃEf();return e.right-e.left}ǃ_L(){let e=this.ǃEf();return e.bottom-e.top}ǃrv$(){return this.ǃrXn()?this.ǃriU.ǃrv$():this.ǃrvy}ǃrvf(){return this.ǃrXn()?this.ǃriU.ǃrvf():this.ǃrvb}ǃriM(){"PANE_main"===this.ǃrra&&this.ǃrro()}ǃrix(){if("PANE_main"===this.ǃrra){let e=[],t;for(let n of r)t=n.ǃri$(),t&&e.push(t);ǃr.ǃIn.ǃIh("log-pane")&&console.info("Saving layout",JSON.stringify(e,null,4)),this.ǃrrS(e)}}ǃrXM(){if(!this.ǃrrR){let r=this.ǃ_v(),t=this.ǃ_L();if(r!==this.ǃriv||t!==this.ǃriJ){this.ǃriv=r,this.ǃriJ=t;let n=new ǃr.Event("resize");n.ǃVy=this,this.dispatchEvent(n),this.ǃriU&&this.ǃriU.ǃrXo()}}}ǃgg(e){ǃr.ǃVm(e,ǃr.ǃBL),this.ǃriL=e}ǃgO(){return this.ǃriL?this.ǃriL.clone():null}static ǃriR(e){return!!r.has(e)&&this.ǃriT}}}{const e=["left","top","right","bottom"],r=300,t=350;ǃr.ǃo.ǃu.ǃrsZ=class extends ǃr.ǃo.ǃu.ǃZ{constructor(e,r,t,n){super(e,r,t,n),this.ǃqi.setAttribute("role","section"),this.ǃrXa=!0,this.ǃrig=!1,this.ǃriO=!1,this.ǃriI=!1,this.ǃriE=!0,this.ǃriC=0,this.ǃrXF="",this.ǃrvg=null,this.ǃSw=()=>this.ǃVB(),this.ǃqi.addEventListener("UIPointerDown",this.ǃSw),this.ǃriy=100,this.ǃrib=100,this.ǃrih=0,this.ǃrin=0,this.ǃriV=0,this.ǃrip=0,this.ǃrvy=100,this.ǃrvb=100,this.ǃriS=!0,this.ǃrio=null,this.ǃrij=0,ǃr.ǃo.ǃQv.ǃrie(this)}ǃrsu(e){ǃr.ǃz(e),this.ǃrXa=!1,this.ǃrXZ=!1,this.ǃrXF=this.ǃPM.ǃrsS()?"left":"top";const n=parseInt(e,10)||r;this.ǃrXk(`${n}px`),this.ǃriA(),this.ǃriW(),this.ǃriN(),this.ǃriK(this.ǃrib,this.ǃriy,n,t),document.body.appendChild(this.ǃqi),this.ǃfN(),this.ǃVB()}ǃP(){this.ǃriS=!1,this.ǃqi.removeEventListener("UIPointerDown",this.ǃSw),this.ǃSw=null,ǃr.ǃo.ǃQv.ǃriP(this),super.ǃP()}ǃrXz(){return!0}ǃrXm(r){return ǃr.ǃk(r),assert(e.includes(r),"Invalid dock side parameter"),this.ǃrXF===r?void 0:this.ǃriw()&&this.ǃrXt()?void(this.ǃrXF=r):void(this.ǃrXN(),this.ǃriQ(r),this.ǃPM&&this.ǃPM.ǃfN())}ǃriZ(){return this.ǃrig}ǃriu(){return this.ǃriE}ǃGH(){this.ǃriE=!1}ǃGD(){this.ǃriE=!0}ǃr_U(){assert(!this.ǃrXu&&!this.ǃrXa,"should not be tabbed or docked to go in swipe-in mode"),this.ǃrig=!0,this.ǃqi.setAttribute("swipe-in-"+this.ǃrXF,""),this.ǃqi.removeAttribute("floating"),this.ǃqi.setAttribute("role","complementary"),this.ǃr_r(!0),this.ǃr_T(),ǃr.ǃo.ǃQv.ǃr_v(this)}ǃr_J(){for(let e=document.activeElement;e;)if(e=e.parentElement,e===this.ǃqi)return void document.activeElement.blur()}ǃr_L(e){e=!!e,this.ǃr_s();let r=ǃr.ǃo.ǃrr_();this.ǃriO=e,this.ǃriO&&this.ǃr_r(!1),this.ǃriO?(this.ǃr_X("left"===this.ǃrXF?0:r-this.ǃ_v()),ǃr.ǃo.ǃJe.ǃyJ(this)):(this.ǃr_X("left"===this.ǃrXF?-this.ǃ_v():r),this.ǃr_J())}ǃr_s(){this.ǃrvg&&(this.ǃrvg.cancel(),this.ǃrJK())}ǃr_X(e){if(ǃr.ǃ$t(e),this.ǃrih===e)return void this.ǃrJK();let r=this.ǃrih;this.ǃlN(e),app.ǃjU()?(this.ǃrvg=this.ǃqi.animate([{transform:`translate(${r}px,${this.ǃrin}px)`},{transform:`translate(${e}px,${this.ǃrin}px)`}],{duration:200,easing:"ease"}),this.ǃrvg.onfinish=()=>this.ǃrJK()):this.ǃrJK()}ǃrJK(){this.ǃrvg=null,this.ǃriO||this.ǃr_r(!0)}ǃr_r(e){e=!!e;this.ǃriI===e||(e?(this.ǃEf(),this.ǃriI=!0,this.ǃqi.style.display="none",this.ǃqi.setAttribute("aria-hidden","true")):(this.ǃqi.style.display="",this.ǃqi.removeAttribute("aria-hidden"),this.ǃriI=!1,this.ǃfN()),this.ǃr_i(!e))}ǃfN(){this.ǃriI||super.ǃfN()}ǃEf(){return this.ǃrrN()?{left:this.ǃrih,top:this.ǃrin,right:this.ǃrih+this.ǃriV,bottom:this.ǃrin+this.ǃrip,width:this.ǃriV,height:this.ǃrip}:super.ǃEf()}ǃhR(e,r,t){return this.ǃrig&&!this.ǃriO?!1:super.ǃhR(e,r,t)}ǃr__(e){ǃr.ǃ$t(e),e=ǃr.ǃsP(e,0,1),this.ǃr_s();let r=ǃr.ǃo.ǃrr_(),t="left"===this.ǃrXF?-this.ǃ_v():r,n="left"===this.ǃrXF?0:r-this.ǃ_v(),i=ǃr.ǃUyo(ǃr.ǃUvE(t,n,e));this.ǃlN(i),this.ǃr_r(!1)}ǃr_l(){return"left"===this.ǃrXF?(this.ǃtd()+this.ǃ_v()+this.ǃriC)/2:(this.ǃtd()+this.ǃriC-ǃr.ǃo.ǃrr_())/2}ǃr_T(){var e=Math.min;this.ǃlK(0),this.ǃlw(e(ǃr.ǃo.ǃrrl())),this.ǃlP(e(ǃr.ǃo.ǃrr_()-50,375)),this.ǃr_L(this.ǃriO)}ǃrXN(){this.ǃrXF&&this.ǃqi.removeAttribute(`dock${this.ǃrXF}`)}ǃriQ(e){e&&(this.ǃrXF=e),""!==this.ǃrXF&&this.ǃqi.setAttribute(`dock${this.ǃrXF}`,"")}ǃrXl(e){e=!!e;e===this.ǃrXt()||(super.ǃrXl(e),this.ǃriw()&&(e?this.ǃrXN():this.ǃriQ(),this.ǃPM.ǃfN()))}ǃrXJ(){return this.ǃrXu?this.ǃrXu.ǃrXF:this.ǃrXF}ǃriw(){return this.ǃrXa&&!this.ǃrig}ǃrrN(){return!this.ǃrXa||this.ǃrig}ǃJB(e){e=!!e;this.ǃriS===e||(this.ǃriS=e,this.ǃriS?(this.ǃqi.style.display="",this.ǃfN()):this.ǃqi.style.display="none")}ǃJc(){return this.ǃrig?this.ǃriO:this.ǃriS&&super.ǃJc()}ǃr_t(){return!!this.ǃrXz()&&(this.ǃrrN()||"right"===this.ǃrXF)}ǃr_$(){return!!this.ǃrXz()&&(this.ǃrrN()||"left"===this.ǃrXF)}ǃr_f(){return!!this.ǃrXz()&&(this.ǃrrN()||"bottom"===this.ǃrXF)}ǃr_z(){return!!this.ǃrXz()&&(this.ǃrrN()||"top"===this.ǃrXF)}ǃrLf(){this.ǃqi.style.transform=`translate(${this.ǃrih}px, ${this.ǃrin}px)`}ǃlN(e,r){if(ǃr.ǃ$t(e),e=ǃr.ǃUyo(e),r=!!r,this.ǃriw())throw new Error("cannot set the position of a docked pane");this.ǃrih=e,this.ǃrLf(),this.ǃfN(),r||(this.ǃriy=e)}ǃlK(e,r){if(ǃr.ǃ$t(e),e=ǃr.ǃUyo(e),r=!!r,this.ǃriw())throw new Error("cannot set the position of a docked pane");this.ǃrin=e,this.ǃrLf(),this.ǃfN(),r||(this.ǃrib=e)}ǃr_F(e){if(e=!!e,e?++this.ǃrij:--this.ǃrij,0>this.ǃrij)throw new Error("invalid unlock");0===this.ǃrij&&this.ǃrXM()}ǃrXM(){0r&&(e=r)}this.ǃrXk(`${e}px`),this.ǃPM.ǃm_(!0),this.ǃPM.ǃfN()}else this.ǃriV=e,this.ǃqi.style.width=`${e}px`,this.ǃfN();this.ǃrXM()}ǃlw(e,r){if(ǃr.ǃ$t(e),e=ǃr.ǃUyo(e),r=!!r,this.ǃriw()&&("left"===this.ǃrXF||"right"===this.ǃrXF))throw new Error("cannot set height of horizontally docked bar");let t=this.ǃrvf();if(er&&(e=r)}this.ǃrXk(`${e}px`),this.ǃPM.ǃm_(!0),this.ǃPM.ǃfN()}else this.ǃrip=e,this.ǃqi.style.height=`${e}px`,this.ǃfN();this.ǃrXM()}ǃrXQ(){super.ǃrXQ(),this.ǃrrK(-1),this.ǃrXF&&(this.ǃrXN(),this.ǃrXF=""),this.ǃr_m(),this.ǃPM&&this.ǃPM.ǃfN(),ǃr.ǃo.ǃJe.ǃrTm()}ǃrXG(e){super.ǃrXG(e),e&&(this.ǃrXF=e.ǃrXJ(),this.ǃrXa=!0,e.ǃrXA()&&(this.ǃrio=e))}ǃK(){if(!this.ǃrXa)return;const e=new ǃr.Event("beforeundock");e.ǃVy=this,this.dispatchEvent(e),this.ǃr_F(!0);let n=null,i=null;this.ǃrif()&&(i=this.ǃrXu.ǃEf(),this.ǃPM=this.ǃrXu.ǃle(),this.ǃrXF=this.ǃrXu.ǃrXJ(),this.ǃrXu.ǃriP(this),1===this.ǃrXu.ǃVW()&&(n=this.ǃrXu),this.ǃrXu=null);let o="left"===this.ǃrXF||"right"===this.ǃrXF;""===this.ǃrXF&&(o=this.ǃPM.ǃrsS());let d=this.ǃPM.ǃrso();if(d&&d.ǃrXz()){let e=d.ǃrXJ();o="left"===e||"right"===e}i||(i=this.ǃEf());let a;o?(a=i.right-i.left,a>window.innerWidth/2&&(a=window.innerWidth/2)):(a=i.bottom-i.top,a>window.innerHeight/2&&(a=window.innerHeight/2)),0>=a&&(a=r),this.ǃPM.ǃrXT(this),this.ǃriA(),this.ǃPM.ǃm_(),this.ǃriW(),this.ǃrXN(),this.ǃriN(),this.ǃriK(this.ǃrib,this.ǃriy,a,t),this.ǃrXk(`${a}px`),d&&d.ǃrXz()&&d.ǃrXF?this.ǃrXF=d.ǃrXF:!this.ǃrXF&&(this.ǃrXF=o?"left":"top"),document.body.appendChild(this.ǃqi),this.ǃrXa=!1,this.ǃrXZ=!1,this.ǃfN(),this.ǃPM=this.ǃPM.ǃrXg(),this.ǃPM.ǃrXE(),n&&!n.ǃrXA()&&(n.ǃriw()?this.ǃPM.ǃrXq(n):ǃr.ǃo.ǃu.ǃrXr.ǃr_h(n)),this.ǃVB(),this.ǃr_F(!1),this.ǃPM.ǃrXo();const s=new ǃr.Event("afterundock");s.ǃVy=this,this.dispatchEvent(s),this.ǃqi.setAttribute("role","complementary")}ǃiW(e,r,t){var n=Math.min,i=Math.max;if(ǃr.ǃVm(e,ǃr.ǃo.ǃu),ǃr.ǃz(r),ǃr.ǃVm(t,ǃr.ǃo.ǃu.ǃZ),this.ǃrXa)return;if(ǃr.ǃrd.ǃvq)return this.ǃrXF="left"===r||"top"===r?"left":"right",void this.ǃr_U();if(!e&&!r&&!t&&this.ǃrio)return this.ǃrio.ǃVh(this),void this.ǃrio.ǃVn(this);const o=new ǃr.Event("beforedock");o.ǃVy=this,this.dispatchEvent(o),this.ǃr_F(!0),e||(e=this.ǃPM),e.ǃUh()||(e=ǃr.ǃo.ǃQv.ǃr_n(),assert(e&&e.ǃUh(),"Nowhere to dock this pane to"));let d=r;if(r||(this.ǃrXF=""),t&&t.ǃrXz()){let e=t.ǃrXJ();e&&(d=e)}e.ǃrsS()?"top"===d?d="left":"bottom"===d&&(d="right"):"left"===d?d="top":"right"===d&&(d="bottom");let a=this.ǃEf(),s=a.right-a.left;this.ǃPM=e,t&&t.ǃrXz()?"left"===d||"right"===d?t.ǃrXH()?s=n(t.ǃ_v()/2,i(s,this.ǃrv$())):(s=i(t.ǃ_v()/2,this.ǃrv$()),t.ǃlP(t.ǃ_v()/2)):("top"===d||"bottom"===d)&&(t.ǃrXH()?s=n(t.ǃ_L()/2,i(s,this.ǃrvf())):(s=i(t.ǃ_L()/2,this.ǃrvf()),t.ǃlw(t.ǃ_L()/2))):!t&&("left"===d||"right"===d?s=n(this.ǃPM.ǃ_v()/2,s):("top"===d||"bottom"===d)&&(s=n(this.ǃPM.ǃ_L()/2,s))),this.ǃriQ(d),this.ǃrXa=!0,document.body.removeChild(this.ǃqi),r&&this.ǃrXk(`${s}px`),this.ǃr_m(),this.ǃPM.ǃrXv(this,t,r),this.ǃPM.ǃm_(),ǃr.ǃo.ǃJe.ǃrTm(),this.ǃr_F(!1);const T=new ǃr.Event("afterdock");T.ǃVy=this,this.dispatchEvent(T),this.ǃqi.setAttribute("role","section")}ǃrL(){this.ǃK(),this.ǃP()}ǃVB(){this.ǃrif()?(this.ǃrXu.ǃVn(this),this.ǃrXu.ǃVB()):super.ǃVB()}ǃr_V(e){var r=Math.max;if(e=!!e,!(!this.ǃrXz()||this.ǃriw()||this.ǃriZ())){e&&(this.ǃlN(this.ǃriy,!0),this.ǃlK(this.ǃrib,!0));let t=this.ǃEf(),n=window.innerWidth,i=window.innerHeight;t.right>n&&this.ǃlN(r(this.ǃtd()-(t.right-n),0),!0),0>t.left&&this.ǃlN(this.ǃtd()-t.left,!0),t.bottom>i&&this.ǃlK(r(this.ǃtc()-(t.bottom-i),0),!0),0>t.top&&this.ǃlK(this.ǃtc()-t.top,!0)}}ǃr_p(){let r=new ǃr.Event("activate");r.ǃVy=this,this.dispatchEvent(r)}ǃr_i(r){let t=new ǃr.Event("displaystylechange");t.ǃVy=this,t.visible=r,this.dispatchEvent(t)}ǃrvi(e,t){if(ǃr.ǃ$t(e),ǃr.ǃ$t(t),this.ǃrif()||!this.ǃrXF)return"";let n=this.ǃEf(),r=ǃr.ǃo.ǃrrh(),i=2*r,o="";if(e>n.left+r&&en.top+r&&t=n.left&&e<=n.left+i?t>=n.top&&t<=n.top+i?o="nw":t<=n.bottom&&t>=n.bottom-i?o="sw":t>n.top+i&&t=n.right-i?t>=n.top&&t<=n.top+i?o="ne":t<=n.bottom&&t>=n.bottom-i?o="se":t>n.top+i&&t=n.right-r&&(o="e"):e>n.left+i&&e=n.top&&t<=n.top+r?o="n":t<=n.bottom&&t>=n.bottom-r&&(o="s"))),this.ǃriw())if("left"===this.ǃrXF)o="ne"==o||"se"==o||"e"==o?"e":"";else if("right"===this.ǃrXF)o="nw"==o||"sw"==o||"w"==o?"w":"";else if("top"===this.ǃrXF)o="sw"==o||"se"==o||"s"==o?"s":"";else if("bottom"===this.ǃrXF)o="nw"==o||"ne"==o||"n"==o?"n":"";else if("tab"===this.ǃrXF)return"";return o}ǃriN(){let e=ǃr.ǃo.ǃQv.ǃr_B(this.ǃriy,this.ǃrib);this.ǃriy=e.x,this.ǃrib=e.y}ǃriK(e,r,t,n){this.ǃqi.setAttribute("floating",""),this.ǃrih=r,this.ǃrin=e,this.ǃrLf(),this.ǃriV=t,this.ǃrip=n,this.ǃqi.style.width=`${t}px`,this.ǃqi.style.height=`${n}px`}ǃr_m(){this.ǃqi.style.transform="",this.ǃqi.style.width="",this.ǃqi.style.height="",this.ǃqi.removeAttribute("floating")}static ǃr_d(e){ǃr.ǃ$(e,ǃr.ǃo.ǃu.ǃZ),assert(!(e instanceof ǃr.ǃo.ǃu.ǃrXr),"cannot replace tabbed pane with another tabbed pane"),assert(e.ǃrXz()&&e.ǃrrN(),"expected floating docking pane");let r=ǃr.ǃUjI(e.ǃUPm),t=ǃr.ǃq(ǃr.ǃo.ǃu.ǃrXr,e.ǃle(),e.ǃrX_(),r);return t.ǃK(),t.ǃrXm(e.ǃrXJ()),t.ǃlP(e.ǃ_v()),t.ǃlw(e.ǃ_L()),t.ǃlN(e.ǃtd()),t.ǃlK(e.ǃtc()),ǃr.ǃo.ǃrv(e.ǃUh()),e.ǃfN(),ǃr.ǃo.ǃJe.ǃrTm(),t}}}{ǃr.ǃo.ǃu.ǃrXU=class extends ǃr.ǃo.ǃu.ǃrsZ{constructor(e,r,t,n){super(e,r,t,n),this.ǃrvM=ǃr.ǃo.ǃUd("ui-caption",this.ǃqi),this.ǃrim=this.ǃTi(),this.ǃrvx=ǃr.ǃo.ǃUd("span",this.ǃrvM,null,"pane-caption-text"),this.ǃrvx.textContent=this.ǃrim,this.ǃr_c="",this.ǃrvN=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃzC,this.ǃrvM),this.ǃrvN.onclick=()=>this.ǃrL(),this.ǃHP=ǃr.ǃo.ǃUd("ui-body",this.ǃqi),this.ǃHP.setAttribute("row2",""),this.ǃqi.setAttribute("captioned",""),this.ǃr_H=!1,this.ǃr_D=!1,this.ǃUHz=null,this.ǃrvo=!1,this.ǃr_Y=!0,this.ǃrve=()=>this.ǃIJ(),this.ǃr_a=()=>this.ǃrXM(),this.ǃr_q=()=>this.ǃr_A(),this.ǃSw=(r)=>{let e=r.detail;e.ǃnT!==ǃr.ǃGV.ǃxp||this.ǃr_W(e.clientX,e.clientY,e.id)},this.ǃrvM.addEventListener("UIPointerDown",this.ǃSw),this.ǃSQ=()=>this.ǃr_G(),this.ǃrvM.addEventListener("UIDoubleTap",this.ǃSQ),this.ǃSZ=(r)=>{r.preventDefault(),this.ǃr_k(r.clientX,r.clientY)},this.ǃrvM.addEventListener("contextmenu",this.ǃSZ)}ǃrJG(){return this.ǃrvM}ǃUc(){return this.ǃHP}ǃP(){this.ǃrvM.removeEventListener("UIPointerDown",this.ǃSw),this.ǃrvM.removeEventListener("UIDoubleTap",this.ǃSQ),this.ǃrvM.removeEventListener("contextmenu",this.ǃSZ),this.ǃSw=null,this.ǃSQ=null,this.ǃSZ=null,this.ǃrvN.ǃTq(),this.ǃrvN=null,ǃr.ǃo.ǃrv(this.ǃrvx),ǃr.ǃo.ǃrv(this.ǃrvM),ǃr.ǃo.ǃrv(this.ǃHP),this.ǃrvx=null,this.ǃrvM=null,this.ǃHP=null,super.ǃP()}ǃr_U(){super.ǃr_U(),this.ǃrvN.ǃTq(),this.ǃrvN=null}ǃr_W(e,r,t){ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃo.ǃQv.ǃrvs(this,e,r,t)}ǃr_G(){this.ǃriZ()||(this.ǃrrN()?this.ǃr_M():this.ǃK())}ǃIa(r,t){if(ǃr.ǃ$f(r),ǃr.ǃ$f(t),this.ǃrvo)throw new Error("already awaiting popup window");if(this.ǃUHz)throw new Error("already in popup window");if(!this.ǃrTf())throw new Error("opening to popup window disabled for this pane");this.ǃrvo=!0;let n=new ǃr.Event("beforepopupopen");return n.ǃVy=this,this.dispatchEvent(n),ǃr.ǃo.ǃUHb.ǃrTH("window.html",this.ǃUPm,this.ǃ_v(),350,r,t).then((e)=>(this.ǃrLF(e),app.ǃJd(),e.addEventListener("unload",()=>this.ǃrLz(e)),e)).catch(()=>{this.ǃrvo=!1;let r=ǃr.ǃo.ǃS.ǃb("OK");r.ǃy(lang("ui.cannot-open-popup"));let t=new ǃr.Event("afterpopupclose");t.ǃVy=this,this.dispatchEvent(t)})}ǃrLF(r){this.ǃriw()?(this.ǃr_Y=!0,this.ǃK()):this.ǃr_Y=!1,this.ǃJB(!1),ǃr.ǃo.ǃrv(this.ǃHP),r.document.body.appendChild(this.ǃHP),this.ǃrvo=!1,this.ǃUHz=r,window.addEventListener("unload",this.ǃrve),r.addEventListener("resize",this.ǃr_a),r.addEventListener("focus",this.ǃr_q),r.document.title=this.ǃrim,this.ǃrXM(),this.ǃr_A();let t=new ǃr.Event("afterpopupopen");t.ǃVy=this,this.dispatchEvent(t)}ǃrLz(r){let t=new ǃr.Event("beforepopupclose");t.ǃVy=this,this.dispatchEvent(t),ǃr.ǃo.ǃrv(this.ǃHP),this.ǃqi.appendChild(this.ǃHP),this.ǃUHz=null,r.removeEventListener("resize",this.ǃr_a),r.removeEventListener("focus",this.ǃr_q),window.removeEventListener("unload",this.ǃrve),this.ǃrvx.textContent=this.ǃrim,this.ǃJB(!0),this.ǃr_Y?this.ǃr_M():this.ǃr_V(),t=new ǃr.Event("afterpopupclose"),t.ǃVy=this,this.dispatchEvent(t)}ǃIJ(){this.ǃUHz&&(this.ǃUHz.close(),this.ǃUHz=null,this.ǃrvo=!1)}ǃCQ(){return!!this.ǃUHz}ǃIv(){return this.ǃUHz}ǃr_A(){ǃr.ǃo.ǃJe.ǃyJ(this)}ǃJc(){return super.ǃJc()||this.ǃCQ()}ǃ_v(){return this.ǃUHz?this.ǃUHz.innerWidth:super.ǃ_v()}ǃ_L(){return this.ǃUHz?this.ǃUHz.innerHeight:super.ǃ_L()}ǃUUv(){return this.ǃHP.clientWidth}ǃUUJ(){return this.ǃHP.clientHeight}ǃr_k(e,r){if(ǃr.ǃ$t(e),ǃr.ǃ$t(r),!this.ǃriZ()){ǃr.ǃJ.ǃrx("ui.bars.captionMenu");let t=ǃr.ǃq(ǃr.ǃo.ǃr$,this.ǃrvM);ǃr.ǃrd.ǃJP&&(t.ǃrz(null,this.ǃriw()?lang(".undock"):lang(".dock"),this.ǃSQ),this.ǃrTf()&&t.ǃrz("open-popup",lang(".open-to-popup-window"),()=>this.ǃIa(),{ǃvv:!0})),t.ǃrz("close",lang(".close"),()=>this.ǃrL()),t.ǃrp(e,r),ǃr.ǃJ.ǃrR()}}ǃUn(){this.ǃr_H=!0}ǃr_x(e){e=!!e,e&&!this.ǃr_D?(this.ǃqi.setAttribute("caption-hidden",""),this.ǃrvM.setAttribute("hidden","")):!e&&this.ǃr_D&&(this.ǃqi.removeAttribute("caption-hidden"),this.ǃrvM.removeAttribute("hidden")),this.ǃr_D=e}ǃrXG(e){super.ǃrXG(e),this.ǃr_H&&(e?this.ǃr_x(e.ǃrXA()):this.ǃr_x(!1))}ǃTv(e){if(ǃr.ǃk(e),this.ǃrim!==e){this.ǃrim=e,this.ǃUHz?this.ǃUHz.document.title=e:this.ǃrvx.textContent=e;let r=this.ǃria();r&&r.ǃr_R(this,this.ǃrim)}}ǃr_g(){return this.ǃrim}ǃTX(e){if(ǃr.ǃk(e),this.ǃr_c!==e){this.ǃr_c=e;let r=this.ǃria();r&&r.ǃr_O(this,this.ǃr_c)}}ǃr_I(){return this.ǃr_c}ǃK(){this.ǃr_x(!1),super.ǃK()}ǃiW(e,r,t){this.ǃr_H||(this.ǃrio=null),super.ǃiW(e,r,t)}ǃr_M(){let e=this.ǃrio?null:this.ǃrXJ();this.ǃiW(null,e)}}}{const e=new Set(["top","bottom"]);ǃr.ǃo.ǃu.ǃrXr=class extends ǃr.ǃo.ǃu.ǃrsZ{constructor(e,r,t,n){super(e,r,t,n),this.ǃriB="",this.ǃHP=ǃr.ǃo.ǃUd("ui-body",this.ǃqi),this.ǃrid=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃr_E,this.ǃqi,{ǃr_C:!0,ǃr_y:!0}),this.ǃr_b=!1,this.ǃr_S=null,this.ǃr_o=(r)=>this.ǃr_j(r),this.ǃrid.addEventListener("activetabchanged",this.ǃr_o),this.ǃr_e=(r)=>this.ǃr_N(r),this.ǃrid.addEventListener("tearofftab",this.ǃr_e),this.ǃr_K=(r)=>this.ǃr_P(r.ǃr_w),this.ǃrid.addEventListener("tabmiddleclick",this.ǃr_K),this.ǃr_Q=(r)=>{r.preventDefault(),this.ǃr_Z(r.ǃr_w,r.clientX,r.clientY)},this.ǃrid.addEventListener("tabcontextmenu",this.ǃr_Q),this.ǃr_u=(r)=>this.ǃVk(r.ǃr_w),this.ǃrid.addEventListener("tabclose",this.ǃr_u),this.ǃrlU=-1,this.ǃnM("bottom"),this.ǃrlr=()=>this.ǃSx(),ǃr.ǃo.ǃJe.addEventListener("activewindowchange",this.ǃrlr)}ǃP(){-1!==this.ǃrlU&&(window.clearTimeout(this.ǃrlU),this.ǃrlU=-1),ǃr.ǃo.ǃJe.removeEventListener("activewindowchange",this.ǃrlr),this.ǃrlr=null,ǃr.ǃo.ǃrv(this.ǃHP),this.ǃHP=null,this.ǃrid.removeEventListener("tabclose",this.ǃr_u),this.ǃr_u=null,this.ǃrid.removeEventListener("tabcontextmenu",this.ǃr_Q),this.ǃr_Q=null,this.ǃrid.removeEventListener("tabmiddleclick",this.ǃr_K),this.ǃr_K=null,this.ǃrid.removeEventListener("tearofftab",this.ǃr_e),this.ǃr_e=null,this.ǃrid.removeEventListener("activetabchanged",this.ǃr_o),this.ǃr_o=null,this.ǃrid.ǃTq(),this.ǃrid=null,super.ǃP()}ǃUc(){return this.ǃHP}ǃTZ(){return this.ǃrid}ǃVW(){return this.ǃrid.ǃVW()}ǃnx(){this.ǃr_b=!0}ǃrXA(){return this.ǃr_b}ǃnM(r){if(!e.has(r))throw new Error(`invalid tab side '${r}'`);this.ǃriB===r||("bottom"===this.ǃriB?(this.ǃqi.removeAttribute("tabbed-bottom"),this.ǃHP.removeAttribute("row1"),this.ǃrid.ǃUh().removeAttribute("row2")):(this.ǃqi.removeAttribute("tabbed-top"),this.ǃHP.removeAttribute("row2"),this.ǃrid.ǃUh().removeAttribute("row1")),this.ǃriB=r,this.ǃqi.setAttribute("tabbed-"+this.ǃriB,""),"bottom"===this.ǃriB?(this.ǃHP.setAttribute("row1",""),this.ǃrid.ǃUh().setAttribute("row2","")):(this.ǃHP.setAttribute("row2",""),this.ǃrid.ǃUh().setAttribute("row1","")),this.ǃrid.ǃnM(this.ǃriB))}ǃrXW(){return assert(1===this.ǃrid.ǃVW(),"should have only one tab"),this.ǃrid.ǃrlT(0).ǃih()}ǃVh(e,r){if(ǃr.ǃ$(e,ǃr.ǃo.ǃu.ǃZ),e instanceof ǃr.ǃo.ǃu.ǃrXr){let t=e.ǃrid;for(let e of t.ǃfe()){let t=e.ǃih();t.ǃrXQ();let n=this.ǃrid.ǃVF(t.ǃTi(),r);n.ǃrlv(t),n.ǃjC(t.ǃgO()),t.ǃrXG(this)}e.ǃP(),this.ǃrid.ǃVG(this.ǃrid.ǃVW()-1)}else{e.ǃrXQ(),e.ǃrXG(this);let t=e instanceof ǃr.ǃo.ǃu.ǃrXU?e.ǃr_g():e.ǃTi();let n=this.ǃrid.ǃVF(t,r);n.ǃrlv(e),n.ǃjC(e.ǃgO());const i=e.ǃr_I();i&&n.ǃrlJ(i),this.ǃr_S||this.ǃrlL(e)}this.ǃrXM()}ǃrls(e){ǃr.ǃ$(e,ǃr.ǃo.ǃu.ǃZ);for(let r of this.ǃrid.ǃfe())if(r.ǃih()===e)return r;return null}ǃrlX(e){ǃr.ǃ$(e,ǃr.ǃo.ǃu.ǃZ);let r=0;for(let n of this.ǃrid.ǃfe()){if(n.ǃih()===e)return r;++r}return-1}ǃriP(e){ǃr.ǃ$(e,ǃr.ǃo.ǃu.ǃZ);let r=this.ǃrlX(e);assert(-1{if(ǃr.ǃvE){if(ǃr.ǃ_W(e))return;}else if(e.ǃ_W())return;e.ǃr_p()},5)}else this.ǃr_S.ǃr_p();ǃr.ǃo.ǃJe.ǃyJ(this.ǃr_S)}}ǃrXM(){super.ǃrXM(),this.ǃr_S&&this.ǃr_S.ǃrXM()}ǃVn(e){ǃr.ǃ$(e,ǃr.ǃo.ǃu.ǃZ);let r=this.ǃrlX(e);0>r||this.ǃrid.ǃVG(r)}ǃr_R(e,r){ǃr.ǃ$(e,ǃr.ǃo.ǃu.ǃZ),ǃr.ǃk(r);let t=this.ǃrls(e);t&&t.ǃbD(r)}ǃr_O(e,r){ǃr.ǃ$(e,ǃr.ǃo.ǃu.ǃZ),ǃr.ǃk(r);const t=this.ǃrls(e);t&&t.ǃrlJ(r)}ǃr_j(r){let e=r.ǃr_w.ǃih();e&&this.ǃrlL(e,r.ǃrll)}ǃr_N(r){let e=r.ǃr_w,t=e.ǃih();t.ǃrXz()&&(t.ǃrTT(-30,-16),ǃr.ǃo.ǃQv.ǃrlt(t,r.pointerId),ǃr.ǃo.ǃQv.ǃrTR(r.clientX,r.clientY,r.pointerId),ǃr.ǃo.ǃJe.ǃyJ(t))}ǃr_Z(e,r,t){ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃrl$),ǃr.ǃ$t(r),ǃr.ǃ$t(t);let n=e.ǃrlf(),i=e.ǃrlz(),o=e.ǃrlF();if(n||i||o){ǃr.ǃJ.ǃrx("ui.bars.tabPaneMenu");let d=ǃr.ǃq(ǃr.ǃo.ǃr$,this.ǃHP);ǃr.ǃrd.ǃJP&&n&&d.ǃrz(null,lang(".undock"),()=>{let r=e.ǃih();r.ǃK()}),i&&d.ǃrz("close",lang(".close"),()=>this.ǃVk(e)),1this.ǃrlm(e)),d.ǃrp(r,t),ǃr.ǃJ.ǃrR()}}ǃVk(e){let r=e.ǃih();r.ǃrL()}ǃr_P(e){this.ǃVk(e)}ǃrlm(e){ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃrl$);let r=e.ǃih(),n=[];for(let i of this.ǃrid.ǃfe()){let e=i.ǃih();e!==r&&n.push(e)}for(let r of n)r.ǃrL()}ǃfN(){super.ǃfN(),this.ǃr_S&&this.ǃr_S.ǃfN()}ǃrlh(){for(let e of this.ǃrid.ǃfe()){let r=e.ǃih();if(!r.ǃrXz())return!0}return!1}ǃrrZ(){return this.ǃr_S||this}ǃVq(){return this.ǃqi.hasAttribute("active")}ǃSx(){let e=ǃr.ǃo.ǃJe.ǃLn()===this.ǃr_S;ǃr.ǃo.ǃbL(this.ǃqi,"active",e)}static ǃr_h(e){ǃr.ǃ$(e,ǃr.ǃo.ǃu.ǃrXr),assert(!e.ǃrXA(),"should keep tabbed pane"),ǃr.ǃ$(e,ǃr.ǃo.ǃu.ǃrXr),assert(1===e.ǃVW(),"expected tab pane with a single tab");let r=e.ǃrXW();r.ǃK(),r.ǃrXm(e.ǃrXJ()),r.ǃlP(e.ǃ_v()),r.ǃlw(e.ǃ_L()),r.ǃlN(e.ǃtd()),r.ǃlK(e.ǃtc()),e.ǃP()}}}{function e(){if(isNaN(h)){let e=ǃr.ǃo.ǃUrM("width",{className:"dockIndicator"});if(!e.endsWith("px"))throw new Error("CSS style for dock indicators must specify the size in units of 'px'");h=parseInt(e,10)||o}return h}function r(){return 600>=window.innerWidth?30:50}function t(e){let r=e.ǃrXJ(),t=b.indexOf(e);assert(-1!==t,"cannot find swipe-in pane");for(let n=1,i=b.length;n{let e=r.detail;e.ǃnT!==ǃr.ǃGV.ǃxp||!a||ǃr.ǃo.ǃQv.ǃrTz(e.clientX,e.clientY,e.id)&&(r.preventDefault(),r.stopPropagation())}),document.addEventListener("UIPointerMove",(r)=>{if(a){let e=r.detail;ǃr.ǃo.ǃQv.ǃrTR(e.clientX,e.clientY,e.id)&&(r.preventDefault(),r.stopPropagation())}}),document.addEventListener("UIPointerUp",(r)=>{if(a){let e=r.detail;ǃr.ǃo.ǃQv.ǃrTg(e.clientX,e.clientY,e.screenX,e.screenY,e.id)&&(r.preventDefault(),r.stopPropagation()),app.ǃJd()}}),window.addEventListener("resize",()=>{let e=ǃr.ǃo.ǃrrX();e&&e.ǃrr$(),ǃr.ǃo.ǃQv.ǃrln(),ǃr.ǃo.ǃQv.ǃrrf(!0),app.ǃJd()}),ǃr.ǃo.ǃJe.addEventListener("zindexchanged",()=>ǃr.ǃo.ǃQv.ǃrlV());class x extends ǃr.Event.ǃUU{constructor(){if(a)throw new Error("already created DockManager");super(),a=!0}ǃrlp(){return!!(d.size||c.size)}ǃrie(e){ǃr.ǃ$(e,ǃr.ǃo.ǃu.ǃrsZ),assert(!g.includes(e),"Docking pane already exists in dock manager, don't try to add again"),g.push(e)}ǃriP(e){ǃr.ǃ$(e,ǃr.ǃo.ǃu.ǃrsZ);let r=g.indexOf(e);assert(0<=r,"Cannot find docking pane to remove"),g.splice(r,1)}ǃr_v(e){ǃr.ǃ$(e,ǃr.ǃo.ǃu.ǃrsZ),assert(e.ǃriZ(),"should be in swipe-in mode"),b.push(e),y||"left"!==e.ǃrXJ()?!L&&"right"===e.ǃrXJ()&&(L=e):y=e}ǃrlV(){g.sort(ǃr.ǃo.Window.ǃaq)}ǃrlB(e,r){ǃr.ǃ$t(e),ǃr.ǃ$t(r);for(let t=0,n=g.length,i;t=ǃr.ǃo.ǃrr_()-r()}ǃus(e){return ǃr.ǃ$t(e),this.ǃrld(e)||this.ǃrlc(e)}ǃrTz(e,r,n){if(ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃ$t(n),d.has(n)||c.has(n)||ǃr.ǃo.ǃut.ǃul()||ǃr.ǃo.ǃr$.ǃrrB(e,r,window))return!1;if(b.length&&-2==w){if(this.ǃrld(e)&&y)return k&&!k.ǃriu()?!1:(k&&"left"===k.ǃrXJ()&&(y=t(k)),y!==k&&(E=y,E.ǃVB(),w=n,$=0),!0);if(this.ǃrlc(e)&&L)return k&&!k.ǃriu()?!1:(k&&"right"===k.ǃrXJ()&&(L=t(k)),L!==k&&(E=L,E.ǃVB(),w=n,$=0),!0)}for(let t=g.length-1;0<=t;--t){let i=g[t],o=i.ǃrvi(e,r);if("m"===o)return i!==k||-2!==w||ǃr.ǃo.ǃuL(e,r,i)||(S=n,q=e,C=r,$="left"===k.ǃrXJ()?k.ǃ_v()-e:k.ǃtd()-e),!1;if(o&&!i.ǃriZ()){if(s.has(i))return!1;if(ǃr.ǃo.ǃJe.ǃrTp(e,r,i,window))break;return c.set(n,i),v.set(i,n),i.ǃrTL(o),i.ǃrru(e,r),i.ǃrTX(i.ǃtd(),i.ǃtc()),i.ǃrTl(i.ǃ_v(),i.ǃ_L()),i.ǃr_p(),!0}}return!1}ǃrlH(e,r){ǃr.ǃ$t(e),ǃr.ǃ$t(r);for(let t=0,n=p.length,i;t=q+i)&&!ǃr.ǃo.ǃuL(e,r,k)&&(w=S,S=-2,E=k,k=null),Math.abs(C-r)>=30&&(S=-2),!0;if(E&&w===t)return ǃr.ǃo.ǃQv.ǃrlY(e+$,r),!0;if(d.has(t))return ǃr.ǃo.ǃQv.ǃrla(e,r,t,d.get(t),n),!0;if(c.has(t))return ǃr.ǃo.ǃQv.ǃrlq(e,r,t,c.get(t)),!0;for(let o=g.length-1,i;0<=o;--o){if(i=g[o],i.ǃriZ())continue;let t=i.ǃrvi(e,r);if(t){if(ǃr.ǃo.ǃJe.ǃrTp(e,r,i,window))break;return f?"e"===t||"w"===t?f.Set("ew-resize"):"n"===t||"s"===t?f.Set("ns-resize"):"nw"===t||"se"===t?f.Set("nwse-resize"):"ne"===t||"sw"===t?f.Set("nesw-resize"):"m"===t&&(ǃr.ǃo.ǃad(f),f=null):"e"===t||"w"===t?f=ǃr.ǃo.ǃaF("ew-resize"):"n"===t||"s"===t?f=ǃr.ǃo.ǃaF("ns-resize"):"nw"===t||"se"===t?f=ǃr.ǃo.ǃaF("nwse-resize"):("ne"===t||"sw"===t)&&(f=ǃr.ǃo.ǃaF("nesw-resize")),!!f}}return ǃr.ǃo.ǃad(f),f=null,!1}ǃrlt(e,r){ǃr.ǃ$(e,ǃr.ǃo.ǃu.ǃrsZ),ǃr.ǃ$t(r),e.ǃVB();let t=e.ǃrXJ();e.ǃK(),("top"===t||"bottom"===t)&&e.ǃrTT(e.ǃ_v()/-2,e.ǃrTJ()),d.set(r,e),s.set(e,r),1===d.size?ǃr.ǃo.ǃQv.ǃrlA():ǃr.ǃo.ǃQv.ǃrlW()}ǃrlY(e,r){ǃr.ǃ$t(e),ǃr.ǃ$t(r);let t=ǃr.ǃo.ǃrr_(),n=E.ǃ_v(),i=E.ǃrXJ(),o=0;if("left"===i){let r=e-n;080&&ǃr.ǃo.ǃQv.ǃrlt(n,t),n.ǃrrN()){n.ǃlN(e+n.ǃrTv()),n.ǃlK(r+n.ǃrTJ());const t=new ǃr.Event("move");t.ǃVy=n,n.dispatchEvent(t);let o=ǃr.ǃo.ǃQv.ǃrlH(e,r);i||1!==d.size?ǃr.ǃo.ǃQv.ǃrlW():(n.ǃrTU()!==e||n.ǃrTr()!==r)&&ǃr.ǃo.ǃQv.ǃrlA(),o!==l&&(l&&ǃr.ǃo.ǃQv.ǃrlk(),o&&ǃr.ǃo.ǃQv.ǃrlM(o,n),l=o);let a=ǃr.ǃo.ǃrrX();if(a&&1===d.size){let t=ǃr.ǃo.ǃQv.ǃrlD(e,r,n);t||(t=a.ǃrXh(e,r,!0)),t&&!t.ǃrsN()&&(t=null),v.has(t)&&(t=null),t!==u&&(u&&ǃr.ǃo.ǃQv.ǃrlx(),t&&ǃr.ǃo.ǃQv.ǃrlR(t),u=t)}}}ǃrlq(e,r,t,n){var i=Math.min;ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃ$(n,ǃr.ǃo.ǃu.ǃrsZ);let o=e-n.ǃrTU(),d=r-n.ǃrTr(),a=n.ǃrTi(),s=n.ǃrT_(),T=n.ǃrTt(),l=n.ǃrT$(),u=n.ǃrTs();if("e"===u||"se"===u||"ne"===u)n.ǃlP(T+o);else if("w"===u||"sw"===u||"nw"===u){if(n.ǃrrN()){let e=a+T-n.ǃrv$();n.ǃlN(i(a+o,e))}n.ǃlP(T-o)}if("s"===u||"sw"===u||"se"===u)n.ǃlw(l+d);else if("n"===u||"nw"===u||"ne"===u){if(n.ǃrrN()){let e=s+l-n.ǃrvf();n.ǃlK(i(s+d,e))}n.ǃlw(l-d)}}ǃrTg(e,r,t,n,i){if(ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃ$t(n),ǃr.ǃ$t(i),S===i&&(S=-2),E&&w===i)return e+=$,"left"===E.ǃrXJ()?eǃr.ǃo.ǃrr_()-E.ǃ_v()/2?(E.ǃr_L(!1),k&&k!==E&&k.ǃr_L(!0),k===E&&(k=null)):(E.ǃr_L(!0),k&&k!==E&&k.ǃr_L(!1),k=E),E=null,w=-2,this.ǃrlG(),!0;if(d.has(i)){let o=d.get(i);if(ǃr.ǃo.ǃQv.ǃrla(e,r,i,o,!0),l)ǃr.ǃo.ǃQv.ǃrlg(o);else{let e=o.ǃEf();if(o instanceof ǃr.ǃo.ǃu.ǃrXU&&o.ǃrTf()&&(0>=e.right||0>=e.bottom||e.left>ǃr.ǃo.ǃrr_()||e.top>ǃr.ǃo.ǃrrl())){let e=ǃr.ǃo.devicePixelRatio;o.ǃIa(t/e+o.ǃrTv(),n/e+o.ǃrTJ()).catch(()=>{o.ǃr_V()})}else o.ǃr_V()}return d.delete(i),s.delete(o),ǃr.ǃo.ǃQv.ǃrlx(),ǃr.ǃo.ǃQv.ǃrlW(),ǃr.ǃo.ǃQv.ǃrlk(),l=null,u=null,!0}if(c.has(i)){let t=c.get(i);return ǃr.ǃo.ǃQv.ǃrTR(e,r,i),t.ǃr_V(),c.delete(i),v.delete(t),!0}return!1}ǃrln(){for(let e=0,r=g.length;ed)&&e.ǃlw(i/2):(!r.ǃrXH()||e.ǃ_v()>o)&&e.ǃlP(i/2);n.ǃm_(!0)}r.ǃr_F(!1),e.ǃr_F(!1)}}ǃrlx(){for(let e=0,r=m.length,t;ethis.ǃrtT()}ǃrlC(){app.ǃjU()?this.ǃrtr(!1):this.ǃrtT()}ǃrly(){assert(!this.ǃrtU,"Animating out dock indicator which is already animating out"),this.ǃrtU=!0,this.ǃqi.style.transform="",app.ǃjU()?this.ǃrvg?ǃr.ǃUyw(this.ǃrvg):this.ǃrtr(!0):(this.ǃrtv(),window.setTimeout(()=>this.ǃrtT(),10))}ǃrtT(){this.ǃrvg=null,this.ǃrtU?this.ǃP():this.ǃrtv()}ǃrtv(){this.ǃqi.style.transform=`translate(${this.ǃcY}px, ${this.ǃca}px)`}ǃP(){this.ǃrvg=null,this.ǃrlP.removeChild(this.ǃqi),this.ǃqi=null,this.ǃrlP=null,this.ǃrlw=null,ǃr.ǃTq(this)}ǃhR(e,r){return ǃr.ǃ$t(e),ǃr.ǃ$t(r),e>=this.ǃcY&&r>=this.ǃca&&e<=this.ǃcY+this.ǃUBa&&r<=this.ǃca+this.ǃUBq}ǃrlS(){return this.ǃrlQ}ǃrlb(){return this.ǃrlw}}}{const e="0.5",r=[{transform:"scale(0.9)",opacity:"0"},{transform:"scale(1)",opacity:e}];let t={duration:300,easing:"ease",fill:"forwards",direction:null};ǃr.ǃo.ǃrlo=class extends ǃr.ǃT_{constructor(e,r,t,n,i){ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃ$t(n),ǃr.ǃk(i),super(),this.ǃrlP=document.body,this.ǃqi=ǃr.ǃo.ǃUd("div",this.ǃrlP,null,"dockGhost"),this.ǃrvg=null,this.ǃrtU=!1;"left"===i?this.ǃqi.classList.add("originLeft"):"top"===i?this.ǃqi.classList.add("originTop"):"right"===i?this.ǃqi.classList.add("originRight"):"bottom"===i?this.ǃqi.classList.add("originBottom"):"tab"===i?this.ǃqi.classList.add("originMiddle"):void 0;this.ǃrtJ(e,r,t,n)}ǃrtr(e){e=!!e,assert(!this.ǃrvg,"Should not start new dock ghost animation if already playing animation"),t.direction=e?"reverse":"normal",this.ǃrvg=this.ǃqi.animate(r,t),this.ǃrvg.onfinish=()=>this.ǃrtL()}ǃrlC(){app.ǃjU()?this.ǃrtr(!1):this.ǃqi.style.opacity=e}ǃrly(){this.ǃrtU=!0,app.ǃjU()?this.ǃrvg?ǃr.ǃUyw(this.ǃrvg):this.ǃrtr(!0):this.ǃrtL()}ǃrtL(){this.ǃrvg=null,this.ǃrtU&&this.ǃP()}ǃP(){this.ǃrvg=null,this.ǃrlP.removeChild(this.ǃqi),this.ǃqi=null,this.ǃrlP=null,ǃr.ǃTq(this)}ǃrtJ(e,r,t,n){ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃ$t(n),this.ǃqi.style.left=`${e}px`,this.ǃqi.style.top=`${r}px`,this.ǃqi.style.width=`${t}px`,this.ǃqi.style.height=`${n}px`}}}{const e=ǃr.ǃo.devicePixelRatio;let r=new Map;const t={name:null,source:null,ǃsp:!1};ǃr.ǃo.ǃVK=class extends ǃr.ǃT_{constructor(r,t,n,i,o){ǃr.ǃ$(r,ǃr.ǃo.ǃrts),ǃr.ǃ$t(t),ǃr.ǃ$t(n),ǃr.ǃz(i),ǃr.ǃz(o),super(),this.ǃrtX=r,this.ǃrti=t,this.ǃrt_=n,this.ǃrtl=t/e,this.ǃrtt=n/e,this.ǃrt$=null,this.ǃrsD=!1,this.ǃrtf=null,this.ǃ$Z=null,this.ǃrtz=!1,this.ǃrtF=!1,this.ǃrUm="",this.ǃrtm="",this.ǃrth(i,o)}ǃrth(e,t){if(this.ǃrUm=e||"",this.ǃrtm=t||"",this.ǃrtz=!1,this.ǃrtF=!1,this.ǃ$Z=new Promise((e)=>this.ǃrtf=e),this.ǃrtm){let e=`${this.ǃrtX.ǃrtn()},${this.ǃrtm}`;assert(!r.has(e),"icon already cached"),r.set(e,this)}}ǃTq(){if(!this.ǃrtz){if(this.ǃrtz=!0,this.ǃrtF=!1,this.ǃrtX.ǃrtV(this),this.ǃrtm){let e=`${this.ǃrtX.ǃrtn()},${this.ǃrtm}`;r.delete(e)}this.ǃrsD=!1,this.ǃrtf=null,this.ǃ$Z=null,this.ǃrUm="",this.ǃrtm=""}}ǃrtp(){return this.ǃrtn()<=app.ǃRK()}ǃrtB(){return this.ǃrtn()>app.ǃRK()&&this.ǃrtn()<=app.ǃvJ()}ǃrtd(){return this.ǃrtn()>app.ǃvJ()}ǃrtc(){return this.ǃrtz}ǃrtH(){return this.ǃrtF}ǃUTF(){return this.ǃrtX}ǃrtD(){return this.ǃrtX.ǃrtD()}ǃrtY(){return this.ǃrtX.ǃrtY()}ǃrta(){return this.ǃrtX.ǃrta()}ǃrtq(){return this.ǃrtX.ǃUaK()}ǃrtn(){return this.ǃrtX.ǃrtn()}ǃrtA(){return this.ǃrtl}ǃrtW(){return this.ǃrtt}ǃrtG(){return this.ǃrtX.ǃrtG()}ǃrtk(){return this.ǃrti}ǃrtM(){return this.ǃrt_}ǃrtx(e){ǃr.ǃVm(e,ǃr.ǃo.ǃrtR),this.ǃrt$=e}ǃzI(){return this.ǃrt$}ǃrtg(){return this.ǃrsD}ǃrtO(){this.ǃrsD||(this.ǃrsD=!0,this.ǃrtf&&(this.ǃrtf(),this.ǃrtf=null))}ǃrtI(){return this.ǃ$Z}addEventListener(e,r,t){return this.ǃrtX.addEventListener(e,r,t)}removeEventListener(e,r,t){return this.ǃrtX.removeEventListener(e,r,t)}async ǃrtE(e,r){ǃr.ǃk(e),ǃr.ǃVg(r),this.ǃrtX.ǃrtC();try{if(ǃr.ǃUCV.ImageBitmap&&!r.ǃsp){const t=await ǃr.ǃPD(e),n=await createImageBitmap(t);this.ǃm_(n,r)}else{const t=await ǃr.ǃsm(e);this.ǃm_(t,r)}}catch(r){console.error(`Error updating icon from URL '${e}': `,r),this.ǃrtF=!0}finally{this.ǃrtX.ǃrty()}}ǃm_(e,r){ǃr.ǃUyJ(e),ǃr.ǃVg(r),r&&r.ǃsp&&(0>=e.width||0>=e.height)&&(r.width=this.ǃrtn(),r.height=this.ǃrtn()),this.ǃrtX.ǃrtb(this,e,r)}async ǃrtS(e){ǃr.ǃXR(e,ǃr.ǃo.ǃVK);for(const r of e)if(r.ǃrtn()!==this.ǃrtn())throw new Error("overlay icons must be same size");const r=e.map((e)=>e.ǃrtI());await Promise.all(r);for(const r of e)this.ǃrto(r)}ǃrto(e){ǃr.ǃ$(e,ǃr.ǃo.ǃVK),this.ǃUTF().ǃrto(this,e)}static ǃrtj(e,n,i){ǃr.ǃk(e),ǃr.ǃo.ǃVK.ǃrte(n),ǃr.ǃVg(i),i=Object.assign({},t,i);let o=r.get(`${n},${e}`);if(o)return o;let d=ǃr.ǃo.ǃrtK.ǃrtN(n,i.name,i.source||e);return d.ǃrtE(e,{ǃrtP:!0,ǃsp:i.ǃsp}),d}static ǃJV(e,r,n){ǃr.ǃ_g(e),ǃr.ǃo.ǃVK.ǃrte(r),ǃr.ǃVg(n),n=Object.assign({},t,n);let i=ǃr.ǃo.ǃrtK.ǃrtN(r,n.name,n.source);return e&&i.ǃm_(e,{ǃrtP:!0,ǃsp:n.ǃsp}),i}static ǃrte(e){if(ǃr.ǃ$t(e),e<1||e>2048)throw new RangeError("invalid icon size")}}}{const e=ǃr.ǃo.devicePixelRatio,r=2048,t={ǃrtP:!1,ǃsp:!1,width:0,height:0,ǃrtw:!1};let n=new Set;ǃr.ǃo.ǃrts=class extends ǃr.Event.ǃUU{constructor(t,i){var o=Math.floor,d=Math.ceil;super(),ǃr.ǃo.ǃVK.ǃrte(t),ǃr.ǃ$t(i),this.ǃrtQ=t,this.ǃrtZ=d(t*e),this.ǃrtu=o(t*e),this.ǃr$U=2,this.ǃr$r=0,this.ǃr$T=0,this.ǃr$v=i,this.ǃq$=null,this.ǃPQ=null,this.ǃr$J=!1,this.ǃUuk=null,this.ǃrLN="",this.ǃr$L=!1,this.ǃr$s=0,this.ǃr$X=-1,this.ǃr$i=-1,this.ǃr$_=()=>{this.ǃr$X=-1,this.ǃr$l()},this.ǃr$t=[],this.ǃr$$=[],this.ǃr$f=[],this.ǃr$z=[],this.ǃr$F=0,this.ǃr$m=0,this.ǃr$h=!1,this.ǃr$r=this.ǃrtQ<=24?128:this.ǃrtQ<=48?256:this.ǃrtQ<=96?512:1024,this.ǃr$r*e>r&&(this.ǃr$r=o(r/e));let a=this.ǃr$r/this.ǃrtQ;this.ǃr$T=d((this.ǃrtZ+this.ǃr$U)*a),n.add(this)}ǃrtn(){return this.ǃrtQ}ǃrtG(){return this.ǃrtZ}ǃrtD(){return this.ǃr$r}ǃrtY(){return this.ǃr$T/e}ǃrta(){return this.ǃr$T}ǃr$n(){return this.ǃq$}ǃr$V(){return this.ǃr$f.length-this.ǃr$z.length}ǃr$p(){return this.ǃr$h&&0===this.ǃr$z.length}ǃrtC(){this.ǃr$s++}ǃrty(){if(this.ǃr$s--,0>this.ǃr$s)throw new Error("too many pending icons removed")}ǃr$l(){if(!this.ǃq$)return;if(this.ǃr$J||this.ǃrLN&&!this.ǃr$L)return;this.ǃr$J=!0,this.ǃr$L=!1,ǃr.ǃUnO(this.ǃr$$,this.ǃr$t),ǃr.ǃXk(this.ǃr$t),this.ǃr$i=Date.now();let e=this.ǃrLN;ǃr.ǃRa(this.ǃq$).then((e)=>(this.ǃUuk=e,this.ǃrLN=URL.createObjectURL(e),ǃr.ǃsm(this.ǃrLN))).then(()=>{this.ǃr$J=!1,this.ǃr$B(),e&&URL.revokeObjectURL(e)})}ǃr$B(){for(let e of this.ǃr$$)e.ǃrtO();ǃr.ǃXk(this.ǃr$$),this.dispatchEvent(new ǃr.Event("change")),this.ǃr$L&&this.ǃr$d()}ǃUaK(){return this.ǃrLN}ǃr$d(){if(this.ǃr$J||-1!==this.ǃr$X)return;let e=app.ǃUvS()&&ǃr.ǃrd.ǃJP?250:500;Date.now()-this.ǃr$i>=e&&(e=50),this.ǃr$X=window.setTimeout(this.ǃr$_,e)}ǃr$c(){if(!this.ǃPQ&&(this.ǃq$=document.createElement("canvas"),this.ǃq$.width=this.ǃr$T,this.ǃq$.height=this.ǃr$T,this.ǃPQ=this.ǃq$.getContext("2d"),this.ǃPQ.imageSmoothingEnabled=!0,this.ǃPQ.imageSmoothingQuality="high",!this.ǃPQ))throw new Error("failed to create 2d context")}ǃr$H(){if(this.ǃr$h)throw new Error("no icon spaces left");const e=this.ǃrtZ+this.ǃr$U;this.ǃr$F+=e,this.ǃr$F>this.ǃr$T-e&&(this.ǃr$m+=e,this.ǃr$F=0,this.ǃr$m>this.ǃr$T-e&&(this.ǃr$h=!0))}ǃrtV(e){if(ǃr.ǃ$(e,ǃr.ǃo.ǃVK),e.ǃUTF()!==this)throw new Error("icon from wrong sheet");assert(!this.ǃr$z.includes(e),"icon already removed"),this.ǃr$z.push(e),this.ǃPQ&&this.ǃPQ.clearRect(e.ǃrtk(),e.ǃrtM(),this.ǃrtZ,this.ǃrtZ)}ǃr$D(e,r){if(ǃr.ǃz(e),ǃr.ǃz(r),this.ǃr$p())throw new Error("icon sheet is already full");if(this.ǃr$z.length){let t=this.ǃr$z.pop();return t.ǃrth(e,r),t}else{let t=ǃr.ǃq(ǃr.ǃo.ǃVK,this,this.ǃr$F,this.ǃr$m,e,r);return this.ǃr$f.push(t),this.ǃr$H(),t}}ǃrtb(r,n,i){var o=Math.min,d=Math.floor,a=Math.max;if(ǃr.ǃ$(r,ǃr.ǃo.ǃVK),ǃr.ǃUyJ(n),ǃr.ǃVg(i),i=Object.assign({},t,i),r.ǃrtc())return;if(r.ǃUTF()!==this)throw new Error("updating icon from wrong sheet");if(n instanceof Image&&!n.complete)throw new Error("image is not complete");const s=n.width||i.width,T=n.height||i.height;if(!isFinite(s)||0>=s||!isFinite(T)||0>=T)throw new Error("invalid size");let l,u;if(sthis.ǃr$I(),ǃr.ǃUCk(n.ǃr$q)?(ǃr.ǃo.ǃVK.ǃrte(n.ǃr$q),this.ǃrtQ=n.ǃr$q):this.ǃr$E(n.icon),this.ǃr$C(),this.ǃr$I(),r&&r.appendChild(this.ǃqi)}ǃTq(){this.ǃrtV(),this.ǃr$O=null,this.ǃr$x=null,ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null,ǃr.ǃTq(this)}ǃr$y(e){const r=this.ǃrtQ;this.ǃqi.parentElement.insertBefore(e,this.ǃqi),this.ǃTq(),e.setAttribute("width",r),e.setAttribute("height",r)}ǃUlq(e){if(ǃr.ǃ_u(e),this.ǃr$W)throw new Error("already got an icon");this.ǃr$x=e,this.ǃr$R=!0}ǃUlw(){if(this.ǃr$x){let e=this.ǃr$x();ǃr.ǃVm(e,ǃr.ǃo.ǃVK),e&&(!e.ǃrtg()&&(this.ǃr$g=!0),this.ǃVP(e))}}ǃr$b(){return this.ǃrtQ}ǃr$S(){return this.ǃr$W}ǃVP(e){this.ǃr$x=null;this.ǃr$W===e||(this.ǃrtV(),this.ǃr$E(e),this.ǃr$C(),this.ǃr$I())}ǃeZ(e){return this.ǃqi.parentElement?this.ǃqi.parentElement===e?void 0:(ǃr.ǃo.ǃrv(this.ǃqi),void e.appendChild(this.ǃqi)):void e.appendChild(this.ǃqi)}ǃUh(){return this.ǃqi}ǃPr(e){e=!!e;this.ǃr$G===e||(this.ǃr$G=e,this.ǃr$C(!0))}ǃr$o(){return this.ǃr$G}ǃJB(e){e=!!e;this.ǃriS===e||(this.ǃriS=e,ǃr.ǃo.ǃbL(this.ǃqi,"hidden",!this.ǃriS))}ǃvb(){this.ǃJB(!1)}ǃvS(){this.ǃJB(!0)}ǃr$E(e){ǃr.ǃVm(e,ǃr.ǃo.ǃVK),this.ǃr$j(),this.ǃr$W=e;this.ǃr$W&&(this.ǃrtQ=this.ǃr$W.ǃrtn(),this.ǃr$W.addEventListener("change",this.ǃr$O))}ǃrtV(){this.ǃr$W&&(this.ǃr$j(),this.ǃr$W.removeEventListener("change",this.ǃr$O),this.ǃr$W=null)}ǃr$C(e){(e||this.ǃrtQ!==this.ǃr$M)&&(this.ǃqi.style.width=`${this.ǃrtQ}px`,this.ǃqi.style.height=`${this.ǃrtQ}px`,this.ǃr$G&&(this.ǃqi.style.borderRadius=`${this.ǃrtQ/2}px`),this.ǃr$M=this.ǃrtQ)}ǃr$I(){let e=this.ǃr$k;this.ǃr$W&&this.ǃr$W.ǃrtg()?(this.ǃr$g&&(this.ǃr$e(),this.ǃr$g=!1),e=`url("${this.ǃr$W.ǃrtq()}") ${-this.ǃr$W.ǃrtA()}px ${-this.ǃr$W.ǃrtW()}px`,1!==ǃr.ǃo.devicePixelRatio&&(e+=` / ${this.ǃr$W.ǃrtY()}px ${this.ǃr$W.ǃrtY()}px`),e+=" no-repeat"):!this.ǃr$W&&(e=""),e!==this.ǃr$k&&(this.ǃqi.style.background=e,this.ǃr$k=e)}ǃr$e(){ǃr.ǃUCV.ǃUCp&&(this.ǃrvg=this.ǃqi.animate(e,r),this.ǃrvg.onfinish=()=>this.ǃr$N())}ǃr$j(){this.ǃrvg&&(this.ǃrvg.cancel(),this.ǃrvg=null)}ǃr$N(){this.ǃrvg=null}}}"use strict",ǃr.ǃo.ǃrtR=class extends ǃr.ǃT_{constructor(e,r,t){super(),ǃr.ǃ$(e,ǃr.ǃrvJ),ǃr.ǃk(r),ǃr.ǃyd(t),ǃr.ǃz(t.name),ǃr.ǃz(t.source),this.ǃr$K=e,this.ǃr$P=r,this.ǃr$w="",this.ǃr$Q=null,this.ǃr$Z=null,this.ǃrUm=t.name,this.ǃrtm=t.source,this.ǃdM=t.color,this.ǃr$u=null,this.ǃrfU=null,this.ǃrfr=null,this.ǃrfT=new Map,this.ǃrfv=null,this.ǃrfJ=!1}ǃTq(){this.ǃr$u&&this.ǃr$u.ǃTq(),this.ǃrfU&&this.ǃrfU.ǃTq(),this.ǃrfr&&this.ǃrfr.ǃTq();for(const e of this.ǃrfT.values())e.ǃTq();this.ǃrfT.clear(),this.ǃrfT=null,this.ǃrfL(),this.ǃr$u=null,this.ǃrfU=null,this.ǃrfr=null,this.ǃr$K=null,this.ǃr$P="",this.ǃr$w="",this.ǃr$Q=null,this.ǃr$Z=null,this.ǃrUm="",this.ǃrfv=null,ǃr.ǃTq(this)}ǃsm(){return this.ǃr$Z?Promise.resolve(this.ǃr$Z):this.ǃrfv?this.ǃrfv:this.ǃrfJ?Promise.resolve(null):(this.ǃrfv=this.ǃrfs(),this.ǃrfv)}async ǃrfs(){try{const e=await app.ǃrfX(this.ǃr$P);this.ǃrfL(),this.ǃr$w=e;const r=ǃr.ǃq(ǃr.ǃti.Document);await r.ǃUQs(this.ǃr$w,"image/svg+xml"),this.ǃr$Q=r.ǃtf().ǃUQl(),await this.ǃrfi();const t=new Blob([this.ǃr$w],{type:"image/svg+xml"}),n=await ǃr.ǃUrD(t);await ǃr.ǃfB(()=>this.ǃrf_(n))}catch(e){return console.error("Error fetching icon: ",e),this.ǃrfJ=!0,this.ǃr$Q=document.createElement("svg"),null}}ǃrfL(){this.ǃr$P.match(/^blob:.+$/)&&URL.revokeObjectURL(this.ǃr$P)}ǃrfi(e){const r=this.ǃdM||app.ǃrfl();return r&&("#000000"!==r||e)?ǃr.ǃfB(()=>{this.ǃr$Q.setAttribute("fill",r),this.ǃr$Q.hasAttribute("stroke")&&"none"!==this.ǃr$Q.getAttribute("stroke")&&this.ǃr$Q.setAttribute("stroke",r);const e=new XMLSerializer;this.ǃr$w=e.serializeToString(this.ǃr$Q.ownerDocument)}):Promise.resolve()}async ǃrft(){if(!this.ǃrfJ){await this.ǃrfi(!0);const e=new Blob([this.ǃr$w],{type:"image/svg+xml"}),r=await ǃr.ǃUrD(e);this.ǃr$Z=r,this.ǃrf$({ǃrtP:!1,ǃsp:!0})}}ǃrf_(e){return this.ǃr$Z=e,this.ǃrfv=null,this.ǃrf$({ǃrtP:!0,ǃsp:!0}),this.ǃr$Z}ǃrf$(e){this.ǃr$u&&this.ǃr$u.ǃm_(this.ǃr$Z,e),this.ǃrfU&&this.ǃrfU.ǃm_(this.ǃr$Z,e),this.ǃrfr&&this.ǃrfr.ǃm_(this.ǃr$Z,e);for(const r of this.ǃrfT.values())r.ǃm_(this.ǃr$Z,e)}ǃLl(){return this.ǃr$u||(this.ǃr$u=ǃr.ǃo.ǃVK.ǃJV(this.ǃr$Z,this.ǃr$K.ǃRK(),{name:this.ǃrUm,source:this.ǃrtm,ǃsp:!0}),this.ǃr$u.ǃrtx(this),ǃr.ǃUEq()&&this.ǃsm()),this.ǃr$u}ǃrff(){return this.ǃrfU||(this.ǃrfU=ǃr.ǃo.ǃVK.ǃJV(this.ǃr$Z,this.ǃr$K.ǃvJ(),{name:this.ǃrUm,source:this.ǃrtm,ǃsp:!0}),this.ǃrfU.ǃrtx(this),ǃr.ǃUEq()&&this.ǃsm()),this.ǃrfU}ǃrfz(){return this.ǃrfr||(this.ǃrfr=ǃr.ǃo.ǃVK.ǃJV(this.ǃr$Z,this.ǃr$K.ǃKK(),{name:this.ǃrUm,source:this.ǃrtm,ǃsp:!0}),this.ǃrfr.ǃrtx(this),ǃr.ǃUEq()&&this.ǃsm()),this.ǃrfr}ǃr$S(e){ǃr.ǃ$t(e),assert(0{r.detail.ǃnT!==ǃr.ǃGV.ǃxp||(this.ǃUtc.ǃYa(this)&&r.preventDefault(),this.ǃrfB())},this.ǃKd.addEventListener("UIPointerDown",this.ǃrfx),this.ǃUB=ǃr.ǃo.ǃUd("div",this.ǃKd,null,"propname-wrap"),this.ǃrfR=ǃr.ǃo.ǃUd("label",this.ǃUB,null,"propname-label"),this.ǃrfR.textContent=this.ǃrUm,this.ǃrfR.setAttribute("for",this.ǃUPm),this.ǃrfg=ǃr.ǃo.ǃUd("ui-propvalue",this.ǃqi),this.ǃUvD=!0}ǃMI(){this.ǃKd.removeEventListener("UIPointerDown",this.ǃrfx),this.ǃrfx=null,ǃr.ǃo.ǃrv(this.ǃrfR),this.ǃrfR=null,ǃr.ǃo.ǃrv(this.ǃUB),this.ǃUB=null,ǃr.ǃo.ǃrv(this.ǃKd),this.ǃKd=null,ǃr.ǃo.ǃrv(this.ǃrfg),this.ǃrfg=null,super.ǃMI()}ǃrfB(){super.ǃrfB(),ǃr.ǃo.ǃYl(this.ǃKd,this.ǃUtc.ǃrfO())}ǃrfI(){return this.ǃKd}ǃrfE(){return this.ǃrfg}ǃbh(r){r=!!r;this.ǃUvD===r||(ǃr.ǃo.ǃbL(this.ǃrfR,"disabled",!r),ǃr.ǃo.ǃbL(this.ǃrfg,"disabled",!r),!r&&this.ǃUtc.ǃrfp(this),this.ǃUvD=r,this.ǃrfC(r))}ǃAB(){return this.ǃUvD}ǃrfC(){}},"use strict";{let r=null;const t=new Map([["text","text"],["integer","number"],["float","number"],["percent","text"],["angle","text"],["email","email"],["password","password"],["tel","tel"],["url","url"]]);ǃr.ǃo.ǃsZ.ǃrfy=class extends ǃr.ǃo.ǃsZ.ǃrfM{constructor(e,r,n,i,o,d,a,s,T){if(super(e,r,n,o),ǃr.ǃz(i),ǃr.ǃzO(d),ǃr.ǃzO(a),ǃr.ǃzO(s),i=i||"text",!t.has(i))throw new Error(`invalid InputProperty type '${i}'`);this.ǃUPe=i,this.ǃrLc=ǃr.ǃo.ǃUd("input",this.ǃrfg),this.ǃrLc.id=this.ǃux(),this.ǃrfb=!0;let l=t.get(this.ǃUPe);this.ǃrfS()&&this.ǃrfo()&&(l="text"),this.ǃrLc.type=l,"text"===l&&this.ǃrLc.setAttribute("spellcheck","false"),this.ǃrfj=d,this.ǃrfe=a,this.ǃrfN=s,this.ǃrfK=this.ǃUtc.ǃrfP(),this.ǃrfw=!1,this.ǃrfQ=T,this.ǃrfZ=!1,this.ǃrfu=null,this.ǃrzU=!1,this.ǃrzr=!0,this.ǃrzT=!1,this.ǃrzv=!1,this.ǃrzJ=!1,this.ǃrzL=NaN,this.ǃrzs=!1,this.ǃrzX=NaN,this.ǃrzi=!0,this.ǃrz_=3,this.ǃrzl="",this.ǃrzt=!1,this.ǃrz$=()=>this.ǃrH(),this.ǃrLc.addEventListener("change",this.ǃrz$),this.ǃrzf=(r)=>ǃr.ǃo.ǃQv.ǃrlp()?(r.preventDefault(),void this.ǃrLc.blur()):void(window.setTimeout(()=>{this.ǃrLc&&ǃr.ǃo.ǃYl(this.ǃKd,this.ǃUtc.ǃrfO())},300),this.ǃrfB(),this.ǃrzr=!1),this.ǃrLc.addEventListener("focus",this.ǃrzf),this.ǃrzz=()=>{this.ǃUtc.ǃrfp(this),this.ǃrzr=!0,this.ǃrzT=!1},this.ǃrLc.addEventListener("blur",this.ǃrzz),this.ǃrzF=-1,this.ǃrzm=()=>{if(!this.ǃrzh){let e=this.ǃrzn();e!==this.ǃrfu&&(!this.ǃrzv&&(this.ǃaH(),this.ǃrzv=!0),this.ǃrfw=!0,this.ǃrH(e),this.ǃrfw=!1),this.ǃrzF=requestAnimationFrame(this.ǃrzm)}},this.ǃrzV=()=>{this.ǃrzr&&(this.ǃrzT=!0,this.ǃrzr=!1),this.ǃrzp()&&-1===this.ǃrzF&&(this.ǃrzv=!1,this.ǃrzF=requestAnimationFrame(this.ǃrzm),this.ǃrLc.ownerDocument.addEventListener("UIPointerUp",this.ǃrzB))},this.ǃrLc.addEventListener("UIPointerDown",this.ǃrzV),this.ǃrzd=(r)=>{this.ǃrzT&&(this.ǃrzT=!1,this.ǃrzp()?requestAnimationFrame(()=>this.ǃrLc.select()):r.preventDefault())},this.ǃrLc.addEventListener("UIPointerUp",this.ǃrzd),this.ǃrzB=null,this.ǃrzc=(r)=>{r.preventDefault(),this.ǃrzH(r.clientX,r.clientY)},this.ǃrLc.addEventListener("dragstart",this.ǃrzc),this.ǃrzD=(r)=>this.ǃkK(r),this.ǃrLc.addEventListener("keydown",this.ǃrzD),this.ǃOI=null,this.ǃOC=null,this.ǃrzh=!1,this.ǃrzY=0,this.ǃrza=0,this.ǃrzq=0,this.ǃrzA=1,this.ǃrfS()&&(this.ǃOI=(r)=>this.ǃOE(r),this.ǃOC=(r)=>this.ǃMQ(r),this.ǃrzB=()=>{-1!==this.ǃrzF&&(cancelAnimationFrame(this.ǃrzF),this.ǃrzF=-1),this.ǃrLc.ownerDocument.removeEventListener("UIPointerUp",this.ǃrzB)}),this.ǃrfj&&(this.ǃrfu=this.ǃrzW(),this.ǃrzG(this.ǃrfu))}ǃrzW(){return this.ǃrfj?this.ǃrfQ?this.ǃUtc.ǃrzk(this.ǃrfj,this):this.ǃrfj(this):null}ǃrzM(e){this.ǃrfe&&(this.ǃrfQ?this.ǃUtc.ǃrzx(this.ǃrfe,e,this):this.ǃrfe(e,this))}ǃaH(){if(this.ǃrfK){if(this.ǃrfS()&&ǃr.ǃtU(this.ǃrfu)){let e,r,t,n,i;if("integer"===this.ǃUPe?(e=parseInt(this.ǃrLc.value),r=this.ǃrzs,t=this.ǃrzJ,n=this.ǃrzL,i=this.ǃrzX):"float"===this.ǃUPe?(e=parseFloat(this.ǃrLc.value),r=this.ǃrzs,t=this.ǃrzJ,n=this.ǃrzL,i=this.ǃrzX):"percent"===this.ǃUPe?(e=parseFloat(this.ǃrLc.value)/100,r=!0,t=!0,n=ǃr.ǃtU(this.ǃrzL)?this.ǃrzL:0,i=ǃr.ǃtU(this.ǃrzX)?this.ǃrzX:1):"angle"===this.ǃUPe&&(e=parseFloat(this.ǃrLc.value),r=!0,t=!0,n=ǃr.ǃtU(this.ǃrzL)?this.ǃrzL:0,i=ǃr.ǃtU(this.ǃrzX)?this.ǃrzX:360),r&&ei&&this.ǃrfu===i)return}this.ǃrfK(this.ǃTi())}}ǃrzG(e){this.ǃrzU=!0,this.ǃrzR(e),this.ǃrzU=!1}ǃMI(){-1!==this.ǃrzF&&cancelAnimationFrame(this.ǃrzF),this.ǃrzm=null,this.ǃrfj=null,this.ǃrfe=null,this.ǃrfN=null,this.ǃrfK=null,this.ǃrfu=null,this.ǃrfS()&&(this.ǃrLc.ownerDocument.removeEventListener("UIPointerMove",this.ǃOI),this.ǃOI=null,this.ǃrLc.ownerDocument.removeEventListener("UIPointerUp",this.ǃOC),this.ǃOC=null,this.ǃrLc.ownerDocument.removeEventListener("UIPointerUp",this.ǃrzB),this.ǃrzB=null),this.ǃrLc.removeEventListener("keydown",this.ǃrzD),this.ǃrzD=null,this.ǃrLc.removeEventListener("dragstart",this.ǃrzc),this.ǃrzc=null,this.ǃrLc.removeEventListener("change",this.ǃrz$),this.ǃrz$=null,this.ǃrLc.removeEventListener("blur",this.ǃrzz),this.ǃrzz=null,this.ǃrLc.removeEventListener("focus",this.ǃrzf),this.ǃrzf=null,this.ǃrLc.removeEventListener("UIPointerDown",this.ǃrzV),this.ǃrzV=null,this.ǃrLc.removeEventListener("UIPointerUp",this.ǃrzd),this.ǃrzd=null,ǃr.ǃo.ǃrv(this.ǃrLc),this.ǃrLc=null,super.ǃMI()}ǃUFJ(){this.ǃrfZ=!0}ǃrzg(){return this.ǃrfZ}ǃrfS(){return"integer"===this.ǃUPe||"float"===this.ǃUPe||"percent"===this.ǃUPe||"angle"===this.ǃUPe}ǃrzp(){return"integer"===this.ǃUPe||"float"===this.ǃUPe}ǃUzt(e){ǃr.ǃ$t(e),this.ǃrzA=e}ǃUzf(e){if(ǃr.ǃ$t(e),!this.ǃrfS())throw new Error("cannot set minimum value on this property type");if("integer"===this.ǃUPe&&(e=Math.floor(e)),this.ǃrzs&&e>this.ǃrzX)throw new Error("cannot set a minimum value greater than the maximum value");return this.ǃrzJ=!0,this.ǃrzL=e,this.ǃrLc.setAttribute("min",e.toString()),this}ǃUFo(e){if(ǃr.ǃ$t(e),!this.ǃrfS())throw new Error("cannot set maximum value on this property type");if("integer"===this.ǃUPe&&(e=Math.floor(e)),this.ǃrzJ&&ee||20e?this.ǃrLc.removeAttribute("maxlength"):this.ǃrLc.setAttribute("maxlength",e.toString()),this}ǃU$b(e){if(ǃr.ǃk(e),this.ǃrfS())throw new Error("cannot set a placeholder on this property type");return this.ǃrzl=e,this.ǃrzt||this.ǃrLc.setAttribute("placeholder",e),this}ǃrzE(){this.ǃrzt&&(this.ǃrzl?this.ǃrLc.setAttribute("placeholder",this.ǃrzl):this.ǃrLc.removeAttribute("placeholder"),this.ǃrzt=!1)}ǃrfo(){return this.ǃrfb&&ǃr.ǃrd.ǃJP&&this.ǃUtc.ǃrzC()}ǃUFq(r){if(r=!!r,this.ǃrfb===r)return;this.ǃrfb=r;let n=t.get(this.ǃUPe);if(this.ǃrfS()&&this.ǃrfo()&&(n="text"),this.ǃrLc.type!==n){let e=this.ǃrLc.value;this.ǃrLc.type=n,this.ǃrLc.value=e}}ǃrzR(e){return null===e?(this.ǃrLc.value="",this.ǃrLc.setAttribute("placeholder",lang("ui.bars.properties.multiple-placeholder")),void(this.ǃrzt=!0)):void(this.ǃrzE(),"integer"===this.ǃUPe?(ǃr.ǃhn(e),e=Math.floor(e),this.ǃrzs&&e>this.ǃrzX&&(e=this.ǃrzX),this.ǃrzJ&ðis.ǃrzX&&(e=this.ǃrzX),this.ǃrzJ&ðis.ǃrzX&&(e=this.ǃrzX),this.ǃrzJ&ðis.ǃrzX&&(e=this.ǃrzX),this.ǃrzJ&&ee&&(e+=360),this.ǃrLc.value=ǃr.toFixed(e,1)+lang("ui.bars.properties.angle-suffix")):(ǃr.ǃk(e),this.ǃrLc.value=e))}ǃrzy(e){if((ǃr.ǃk(e),this.ǃrLc.value!==e)&&(!this.ǃrfS()||e)){if(this.ǃrfS()&&this.ǃrfo()){let r=this.ǃrzb(e);return"number"==typeof r&&isFinite(r)&&this.ǃrzR(r),this.ǃrfw=!0,this.ǃrH(),void(this.ǃrfw=!1)}if("integer"===this.ǃUPe){let r=parseInt(e,10);if(!isFinite(r))return;this.ǃrzR(r)}else if("float"===this.ǃUPe||"angle"===this.ǃUPe){let r=parseFloat(e);if(!isFinite(r))return;this.ǃrzR(r)}else if("percent"===this.ǃUPe){let r=parseFloat(e);if(!isFinite(r))return;r/=100,this.ǃrzR(r)}else this.ǃrLc.value=e;this.ǃrfw=!0,this.ǃrH(),this.ǃrfw=!1}}ǃrzS(e){return!!isFinite(e)&&("percent"===this.ǃUPe?e/=100:"angle"===this.ǃUPe&&(e%=360,0>e&&(e+=360)),this.ǃrzs&&e>this.ǃrzX||this.ǃrzJ&ðis.ǃrzX&&(r=this.ǃrzX),this.ǃrzJ&&rthis.ǃrzX&&(r=this.ǃrzX),this.ǃrzJ&&rthis.ǃrzX&&(r=this.ǃrzX),this.ǃrzJ&&rr&&(r+=360),this.ǃrzs&&r>this.ǃrzX&&(r=this.ǃrzX),this.ǃrzJ&&rthis.ǃrzX&&(e=this.ǃrzX))):(t=this.ǃrzo(),e=this.ǃrzn()));let n=!("number"==typeof e&&isNaN(e));if(n&&(!this.ǃrzh&&!this.ǃrfw&&!this.ǃrzv&&this.ǃaH(),!this.ǃrfw&&(this.ǃrzv=!1),this.ǃrzM(e),this.ǃrfu=e),this.ǃrzE(),this.ǃrfj){let e=this.ǃrzW();(!n||r||t||e!==this.ǃrfu)&&(this.ǃrfu=e,this.ǃrzG(this.ǃrfu))}n&&(this.ǃrzN(),this.ǃUtc.ǃUtC())}ǃrzN(){this.ǃrJT&&this.ǃrJT instanceof ǃr.ǃo.ǃsZ.ǃrzK&&this.ǃrJT.ǃrzP()}ǃU$C(){return this.ǃrLc}ǃrzH(e,t){ǃr.ǃ$t(e),ǃr.ǃ$t(t);!this.ǃrfS()||this.ǃrzh||null===this.ǃrfu||(this.ǃrzh=!0,this.ǃrzY=e,this.ǃrza=t,this.ǃrzq=0,r=ǃr.ǃo.ǃaF("ns-resize",this.ǃrLc.ownerDocument),this.ǃaH(),this.ǃrLc.ownerDocument.addEventListener("UIPointerMove",this.ǃOI),this.ǃrLc.ownerDocument.addEventListener("UIPointerUp",this.ǃOC))}ǃOE(r){if(!this.ǃrzh)return;r.preventDefault();let e=r.detail,t=e.clientX,n=e.clientY,i=ǃr.ǃke.ǃkQ(e),o=e.shiftKey,d=this.ǃrza-n;d*=this.ǃrzA,i?d*=10:o&&(d/=10),"integer"===this.ǃUPe&&(this.ǃrzq+=d,d=0|this.ǃrzq,this.ǃrzq-=d),"percent"===this.ǃUPe?d/=1e3:"angle"===this.ǃUPe&&(d/=5),0!==d&&(this.ǃrfu+=d,this.ǃrzJ&&this.ǃrfuthis.ǃrzX&&(this.ǃrfu=this.ǃrzX),this.ǃrzG(this.ǃrfu),this.ǃrH(this.ǃrfu)),this.ǃrLc.select(),this.ǃrzY=t,this.ǃrza=n}ǃMQ(t){this.ǃrzh&&(t.preventDefault(),this.ǃOE(t),this.ǃrzh=!1,ǃr.ǃo.ǃad(r),r=null,this.ǃrLc.ownerDocument.removeEventListener("UIPointerMove",this.ǃOI),this.ǃrLc.ownerDocument.removeEventListener("UIPointerUp",this.ǃOC))}ǃkK(r){r.which===ǃr.ǃrO.ǃrg&&(r.preventDefault(),this.ǃrLc.blur(),this.ǃUtc.ǃrzw(this))}ǃrfG(){!this.ǃrfN||this.ǃrzh||(this.ǃrfQ?this.ǃbh(this.ǃUtc.ǃrzQ(this.ǃrfN)):this.ǃbh(this.ǃrfN()))}ǃrfC(r){this.ǃrLc.disabled=!r,this.ǃrLc.readOnly=!r}ǃrfk(){if(!this.ǃrzh&&this.ǃrfj){let e=this.ǃrzW();e===this.ǃrfu||(this.ǃrfu=e,this.ǃrzG(this.ǃrfu),this.ǃrzN())}}}}{function e(e){let r=e.replace(t,"\\\\");return r=r.replace(i,"\\t"),r.replace(n,"\\n")}function r(e){let r=[];for(let t of e)r.push(t);let t="";for(let n=0,i=r.length,o;nthis.ǃrFT(),this.ǃrFU.addEventListener("click",this.ǃrFr),this.ǃrFv=null,this.ǃrz$=()=>this.ǃrH(),this.ǃrLc.addEventListener("change",this.ǃrz$),this.ǃrzf=()=>{window.setTimeout(()=>{this.ǃrLc&&ǃr.ǃo.ǃYl(this.ǃKd,this.ǃUtc.ǃrfO())},300),this.ǃrfB(),this.ǃrzr=!1},this.ǃrLc.addEventListener("focus",this.ǃrzf),this.ǃrzz=()=>{this.ǃUtc.ǃrfp(this),this.ǃrzr=!0,this.ǃrzT=!1},this.ǃrLc.addEventListener("blur",this.ǃrzz),this.ǃrzV=()=>{this.ǃrzr&&(this.ǃrzT=!0,this.ǃrzr=!1)},this.ǃrLc.addEventListener("UIPointerDown",this.ǃrzV),this.ǃrzd=(r)=>{this.ǃrzT&&(r.preventDefault(),this.ǃrzT=!1)},this.ǃrLc.addEventListener("UIPointerUp",this.ǃrzd),this.ǃrzD=(r)=>this.ǃkK(r),this.ǃrLc.addEventListener("keydown",this.ǃrzD),this.ǃrLc.addEventListener("dragstart",ǃr.ǃo.ǃMf),this.ǃrfj&&(this.ǃrfu=this.ǃrzW(),this.ǃrzG(this.ǃrfu))}ǃrzW(){return this.ǃrfj?this.ǃrfQ?this.ǃUtc.ǃrzk(this.ǃrfj,this):this.ǃrfj(this):null}ǃrzM(e){this.ǃrfe&&(this.ǃrfQ?this.ǃUtc.ǃrzx(this.ǃrfe,e,this):this.ǃrfe(e,this))}ǃaH(){this.ǃrfK&&this.ǃrfK(this.ǃTi())}ǃMI(){this.ǃrfj=null,this.ǃrfe=null,this.ǃrfN=null,this.ǃrfK=null,this.ǃrfu=null,this.ǃrLc.removeEventListener("change",this.ǃrz$),this.ǃrz$=null,this.ǃrLc.removeEventListener("blur",this.ǃrzz),this.ǃrzz=null,this.ǃrLc.removeEventListener("focus",this.ǃrzf),this.ǃrzf=null,this.ǃrLc.removeEventListener("UIPointerDown",this.ǃrzV),this.ǃrzV=null,this.ǃrLc.removeEventListener("UIPointerUp",this.ǃrzd),this.ǃrzd=null,this.ǃrLc.removeEventListener("keydown",this.ǃrzD),this.ǃrzD=null,this.ǃrLc.removeEventListener("dragstart",ǃr.ǃo.ǃMf),ǃr.ǃo.ǃrv(this.ǃrLc),this.ǃrLc=null,this.ǃrFU.removeEventListener("click",this.ǃrFr),this.ǃrFr=null,this.ǃrFv=null,ǃr.ǃo.ǃrv(this.ǃrFU),this.ǃrFU=null,ǃr.ǃo.ǃrv(this.ǃrzu),this.ǃrzu=null,super.ǃMI()}ǃUFN(e){ǃr.ǃ_u(e),this.ǃrFv=e}ǃUFe(e){ǃr.ǃk(e),this.ǃrFU.textContent=e}ǃrzI(e){return ǃr.ǃ$t(e),e=Math.floor(e),0>e?this.ǃrLc.removeAttribute("maxlength"):this.ǃrLc.setAttribute("maxlength",e.toString()),this}ǃU$b(e){return ǃr.ǃk(e),this.ǃrzl=e,this.ǃrzt||this.ǃrLc.setAttribute("placeholder",e),this}ǃrzE(){this.ǃrzt&&(this.ǃrzl?this.ǃrLc.setAttribute("placeholder",this.ǃrzl):this.ǃrLc.removeAttribute("placeholder"),this.ǃrzt=!1)}ǃrfB(){this.ǃrLc.select(),super.ǃrfB()}ǃEv(){this.ǃrLc.focus()}ǃrzG(e){this.ǃrzU=!0,this.ǃrzR(e),this.ǃrzU=!1}ǃrzR(r){return null===r?(this.ǃrLc.value="",this.ǃrLc.setAttribute("placeholder",lang("ui.bars.properties.multiple-placeholder")),void(this.ǃrzt=!0)):void(this.ǃrzE(),this.ǃrLc.value=e(r))}ǃrzn(){return r(this.ǃrLc.value)}ǃrH(){if(!this.ǃrzU&&this.ǃrfe){this.ǃaH();let r=this.ǃrzn();if(this.ǃrzM(r),this.ǃrfu=r,this.ǃrfj){let r=this.ǃrzW();(r!==this.ǃrfu||e(r)!==this.ǃrLc.value)&&(this.ǃrfu=r,this.ǃrzG(this.ǃrfu))}this.ǃUtc.ǃUtC()}}ǃrFT(){if(this.ǃrfB(),this.ǃrFv){let e=this.ǃrFv(this);return void(e.then&&e.then((e)=>{"string"!=typeof e||(this.ǃrzR(e),this.ǃrH())}))}let e=ǃr.ǃo.ǃS.ǃb("LongTextPropertyDialog");e.ǃFH(this.ǃrUm),e.ǃy(this.ǃrzn()).then((e)=>{null!==e&&(e||null!==this.ǃrfu)&&(this.ǃrzR(e),this.ǃrH())})}ǃkK(r){r.which===ǃr.ǃrO.ǃrg&&(r.preventDefault(),this.ǃrLc.blur(),this.ǃUtc.ǃrzw(this))}ǃU$C(){return this.ǃrLc}ǃrfG(){this.ǃrfN&&(this.ǃrfQ?this.ǃbh(this.ǃUtc.ǃrzQ(this.ǃrfN)):this.ǃbh(this.ǃrfN()))}ǃrfC(r){this.ǃrLc.disabled=!r,this.ǃrLc.readOnly=!r,this.ǃrFU.disabled=!r}ǃrfk(){if(this.ǃrfj){let e=this.ǃrzW();e===this.ǃrfu||(this.ǃrfu=e,this.ǃrzG(this.ǃrfu))}}}}{const e="__multiple__";ǃr.ǃo.ǃsZ.ǃrFJ=class extends ǃr.ǃo.ǃsZ.ǃrfM{constructor(e,r,t,n,i,o,d,a){super(e,r,t,n),ǃr.ǃzO(i),ǃr.ǃzO(o),ǃr.ǃzO(d),this.ǃrFL=ǃr.ǃo.ǃUd("select",this.ǃrfg),this.ǃrFL.id=this.ǃux(),this.ǃrfj=i,this.ǃrfe=o,this.ǃrfN=d,this.ǃrfK=this.ǃUtc.ǃrfP(),this.ǃrfQ=a,this.ǃrFs=!1,this.ǃrFX=null,this.ǃrzU=!1,this.ǃrfu=null,this.ǃrfj&&(this.ǃrfu=this.ǃrzW(),null===this.ǃrfu&&this.ǃrFi()),this.ǃrz$=()=>this.ǃrH(),this.ǃrFL.addEventListener("change",this.ǃrz$),this.ǃrzf=()=>this.ǃrfB(),this.ǃrFL.addEventListener("focus",this.ǃrzf),this.ǃrzz=()=>this.ǃUtc.ǃrfp(this),this.ǃrFL.addEventListener("blur",this.ǃrzz)}ǃMI(){this.ǃrfj=null,this.ǃrfe=null,this.ǃrfN=null,this.ǃrfK=null,this.ǃrFL.removeEventListener("change",this.ǃrz$),this.ǃrz$=null,this.ǃrFL.removeEventListener("focus",this.ǃrzf),this.ǃrzf=null,this.ǃrFL.removeEventListener("blur",this.ǃrzz),this.ǃrzz=null,ǃr.ǃo.ǃrv(this.ǃrFL),this.ǃrFL=null,super.ǃMI()}ǃrzW(){return this.ǃrfj?this.ǃrfQ?this.ǃUtc.ǃrzk(this.ǃrfj,this):this.ǃrfj(this):null}ǃrzM(e){this.ǃrfe&&(this.ǃrfQ?this.ǃUtc.ǃrzx(this.ǃrfe,e,this):this.ǃrfe(e,this))}ǃaH(e){this.ǃrfK&&this.ǃrfK(this.ǃTi(),e)}ǃrF_(e){this.ǃrzU=!0,null===e?this.ǃrFi():this.ǃrFL.value=e,this.ǃrzU=!1}ǃrFi(){this.ǃrFs||(this.ǃrz(lang("ui.bars.properties.multiple-placeholder"),e),this.ǃrFs=!0),this.ǃrFL.value=e}ǃrFl(){this.ǃrFX&&(ǃr.ǃo.ǃrv(this.ǃrFX),this.ǃrFs=!1)}ǃrH(){this.ǃrzU||!this.ǃrfe||this.ǃrFL.value===e||(this.ǃaH(this.ǃrFL.value),this.ǃrzM(this.ǃrFL.value),this.ǃrfj&&(this.ǃrfu=this.ǃrzW(),null!==this.ǃrfu&&this.ǃrFl(),this.ǃrFL.value!==this.ǃrfu&&this.ǃrF_(this.ǃrfu)),this.ǃUtc.ǃUtC())}ǃrFt(){return this.ǃrFL}ǃrz(r,t,n=!1){ǃr.ǃk(r),ǃr.ǃz(t),n=!!n,("undefined"==typeof t||null===t)&&(t=r);let i=ǃr.ǃo.ǃUd("option",this.ǃrFL);return i.text=r,i.value=t,n&&i.setAttribute("hidden",""),t===this.ǃrfu&&(i.selected=!0),t===e&&(this.ǃrFX=i),this}ǃEv(){this.ǃrFL.focus()}ǃrfG(){this.ǃrfN&&(this.ǃrfQ?this.ǃbh(this.ǃUtc.ǃrzQ(this.ǃrfN)):this.ǃbh(this.ǃrfN()))}ǃrfC(r){this.ǃrFL.disabled=!r}ǃrfk(){if(this.ǃrfj){let e=this.ǃrzW();e===this.ǃrfu||(this.ǃrfu=e,this.ǃrF_(this.ǃrfu))}}}}{let e=function(r){r.preventDefault();let e=this.getAttribute("for"),t=this.ownerDocument.getElementById(e);t&&t.focus()};ǃr.ǃo.ǃsZ.ǃrF$=class extends ǃr.ǃo.ǃsZ.ǃrfM{constructor(r,t,n,i,o,d,a,s){if(super(r,t,n,i),ǃr.ǃzO(o),ǃr.ǃzO(d),ǃr.ǃzO(a),this.ǃrzu=ǃr.ǃo.ǃUd("div",this.ǃrfg,null,"flexVstretch"),this.ǃrFf=ǃr.ǃo.ǃUd("input",this.ǃrzu,null,"colorProperty"),this.ǃrFf.type="color",this.ǃrFf.id=this.ǃux(),this.ǃrFz=ǃr.ǃo.ǃUd("input",this.ǃrzu,null,"colorProperty"),this.ǃrFz.type="text",this.ǃrFz.setAttribute("spellcheck","false"),this.ǃrfj=o,this.ǃrfe=d,this.ǃrfN=a,this.ǃrfK=this.ǃUtc.ǃrfP(),this.ǃrfQ=s,this.ǃrzU=!1,this.ǃrFF=ǃr.ǃq(ǃr.ǃBL,0,0,0,1),this.ǃrFm=!1,this.ǃrfj){let e=this.ǃrzW();null===e?this.ǃrFm=!0:e instanceof ǃr.ǃBL&&this.ǃrFF.set(e)}this.ǃrFf.value=this.ǃrFF.ǃUab(),this.ǃrFm?(this.ǃrFz.value="",this.ǃrFz.setAttribute("placeholder",lang("ui.bars.properties.multiple-placeholder"))):this.ǃrFz.value=this.ǃrFF.ǃUSx(),this.ǃrfR.addEventListener("click",e),this.ǃrFh=()=>this.ǃrFn(),this.ǃrFf.addEventListener("change",this.ǃrFh),this.ǃrFV=()=>this.ǃrfB(),this.ǃrFf.addEventListener("focus",this.ǃrFV),this.ǃrFp=()=>this.ǃUtc.ǃrfp(this),this.ǃrFf.addEventListener("blur",this.ǃrFp),this.ǃrFB=()=>this.ǃrFd(),this.ǃrFz.addEventListener("change",this.ǃrFB),this.ǃrFc=(r)=>ǃr.ǃo.ǃQv.ǃrlp()?(r.preventDefault(),void this.ǃrFz.blur()):void this.ǃrfB(),this.ǃrFz.addEventListener("focus",this.ǃrFc),this.ǃrFH=()=>this.ǃUtc.ǃrfp(this),this.ǃrFz.addEventListener("blur",this.ǃrFH),this.ǃrFD=(r)=>this.ǃkK(r),this.ǃrFz.addEventListener("keydown",this.ǃrFD),this.ǃrFz.addEventListener("dragstart",ǃr.ǃo.ǃMf)}ǃMI(){this.ǃrfR.removeEventListener("click",e),this.ǃrfj=null,this.ǃrfe=null,this.ǃrfN=null,this.ǃrfK=null,this.ǃrFf.removeEventListener("change",this.ǃrFh),this.ǃrFh=null,this.ǃrFf.removeEventListener("focus",this.ǃrFV),this.ǃrFV=null,this.ǃrFf.removeEventListener("blur",this.ǃrFp),this.ǃrFp=null,ǃr.ǃo.ǃrv(this.ǃrFf),this.ǃrFf=null,this.ǃrFz.removeEventListener("change",this.ǃrFB),this.ǃrFB=null,this.ǃrFz.removeEventListener("focus",this.ǃrFc),this.ǃrFc=null,this.ǃrFz.removeEventListener("blur",this.ǃrFH),this.ǃrFH=null,this.ǃrFz.removeEventListener("keydown",this.ǃrFD),this.ǃrFD=null,this.ǃrFz.removeEventListener("dragstart",ǃr.ǃo.ǃMf),ǃr.ǃo.ǃrv(this.ǃrFz),this.ǃrFz=null,ǃr.ǃo.ǃrv(this.ǃrzu),this.ǃrzu=null,super.ǃMI()}ǃrzM(){if(this.ǃrfe){let e=ǃr.ǃq(ǃr.ǃBL,this.ǃrFF);this.ǃrfQ?this.ǃUtc.ǃrzx(this.ǃrfe,e,this):this.ǃrfe(e,this),this.ǃUtc.ǃUtC()}}ǃrzW(){return this.ǃrfj?this.ǃrfQ?this.ǃUtc.ǃrzk(this.ǃrfj,this):this.ǃrfj(this):null}ǃaH(){this.ǃrfK&&this.ǃrfK(this.ǃTi())}ǃrFn(){this.ǃrzU||!this.ǃrfe||(this.ǃrFF.ǃjg(this.ǃrFf.value),this.ǃrzU=!0,this.ǃrFz.value=this.ǃrFF.ǃUSx(),this.ǃrzU=!1,this.ǃrFY(),this.ǃrFf.focus())}ǃrFd(){return this.ǃrzU||!this.ǃrfe?void 0:this.ǃrFF.ǃUrx(this.ǃrFz.value)?void(this.ǃrzU=!0,this.ǃrFf.value=this.ǃrFF.ǃUab(),this.ǃrFz.value=this.ǃrFF.ǃUSx(),this.ǃrzU=!1,this.ǃrFY()):(this.ǃrzU=!0,this.ǃrFm?(this.ǃrFz.value="",this.ǃrFz.setAttribute("placeholder",lang("ui.bars.properties.multiple-placeholder"))):(this.ǃrFz.value=this.ǃrFF.ǃUSx(),this.ǃrFz.removeAttribute("placeholder")),void(this.ǃrzU=!1))}ǃrFY(){if(this.ǃaH(),this.ǃrzM(),this.ǃrFm=!1,this.ǃrFz.removeAttribute("placeholder"),this.ǃrfj){let e=this.ǃrzW();null===e?(this.ǃrFm=!0,this.ǃrFF.ǃUSp(0,0,0),this.ǃrzU=!0,this.ǃrFf.value=this.ǃrFF.ǃUab(),this.ǃrFz.value="",this.ǃrFz.setAttribute("placeholder",lang("ui.bars.properties.multiple-placeholder")),this.ǃrzU=!1):!this.ǃrFF.ǃUSa(e)&&(this.ǃrFm=!1,this.ǃrzU=!0,this.ǃrFF.ǃUSp(e.r,e.ǃUSS,e.b),this.ǃrFf.value=this.ǃrFF.ǃUab(),this.ǃrFz.value=this.ǃrFF.ǃUSx(),this.ǃrzU=!1)}}ǃkK(r){r.which===ǃr.ǃrO.ǃrg&&(r.preventDefault(),this.ǃrFz.blur(),this.ǃUtc.ǃrzw(this))}ǃEv(){return this.ǃrFf.focus()}ǃrFa(){return this.ǃrFf}ǃrfG(){this.ǃrfN&&(this.ǃrfQ?this.ǃbh(this.ǃUtc.ǃrzQ(this.ǃrfN)):this.ǃbh(this.ǃrfN()))}ǃrfC(r){this.ǃrFf.disabled=!r,this.ǃrFz.disabled=!r,this.ǃrFz.readOnly=!r}ǃrfk(){if(this.ǃrfj){let e=this.ǃrzW();this.ǃrFm&&null===e||!this.ǃrFm&&null!==e&&e.ǃUSa(this.ǃrFF)||(this.ǃrFm=null===e,this.ǃrFm?(this.ǃrFF.ǃUSp(0,0,0),this.ǃrFf.value=this.ǃrFF.ǃUab(),this.ǃrFz.value="",this.ǃrFz.setAttribute("placeholder",lang("ui.bars.properties.multiple-placeholder"))):(this.ǃrFF.ǃUSp(e.r,e.ǃUSS,e.b),this.ǃrFf.value=this.ǃrFF.ǃUab(),this.ǃrFz.value=this.ǃrFF.ǃUSx(),this.ǃrFz.removeAttribute("placeholder")))}}}}{function e(r){r.preventDefault();let e=this.getAttribute("for"),t=this.ownerDocument.getElementById(e);t&&t.focus()}ǃr.ǃo.ǃsZ.ǃrFq=class extends ǃr.ǃo.ǃsZ.ǃrfM{constructor(r,t,n,i,o,d,a,s){super(r,t,n,i),ǃr.ǃzO(o),ǃr.ǃzO(d),ǃr.ǃzO(a),this.ǃrFA=ǃr.ǃo.ǃUd("input",this.ǃrfg),this.ǃrFA.type="checkbox",this.ǃrFA.id=this.ǃux(),this.ǃrfR.addEventListener("click",e),this.ǃrfj=o,this.ǃrfe=d,this.ǃrfN=a,this.ǃrfK=this.ǃUtc.ǃrfP(),this.ǃrfu=null,this.ǃrfQ=s,this.ǃrzU=!1,this.ǃrfj&&(this.ǃrfu=this.ǃrzW(),this.ǃrFW(this.ǃrfu)),this.ǃrz$=()=>this.ǃrH(),this.ǃrFA.addEventListener("change",this.ǃrz$),this.ǃrzf=()=>this.ǃrfB(),this.ǃrFA.addEventListener("focus",this.ǃrzf),this.ǃrzz=()=>this.ǃUtc.ǃrfp(this),this.ǃrFA.addEventListener("blur",this.ǃrzz),this.ǃrFG=!1,this.ǃSw=(r)=>{r.detail.ǃnT!==ǃr.ǃGV.ǃxp||r.target===this.ǃrfg&&(!r.detail.ǃyF&&r.preventDefault(),this.ǃrFG=!0,this.ǃrFA.focus())},this.ǃrfg.addEventListener("UIPointerDown",this.ǃSw),this.ǃUJr=(r)=>{r.target===this.ǃrfg&&this.ǃrFG&&(r.preventDefault(),this.ǃrFA.click()),this.ǃrFG=!1},this.ǃrfg.addEventListener("UITap",this.ǃUJr)}ǃMI(){this.ǃrfR.removeEventListener("click",e),this.ǃrfj=null,this.ǃrfe=null,this.ǃrfN=null,this.ǃrfK=null,this.ǃrfu=null,this.ǃrFA.removeEventListener("change",this.ǃrz$),this.ǃrz$=null,this.ǃrFA.removeEventListener("focus",this.ǃrzf),this.ǃrzf=null,this.ǃrFA.removeEventListener("blur",this.ǃrzz),this.ǃrzz=null,this.ǃrfg.removeEventListener("UIPointerDown",this.ǃSw),this.ǃSw=null,this.ǃrfg.removeEventListener("UITap",this.ǃUJr),this.ǃUJr=null,ǃr.ǃo.ǃrv(this.ǃrFA),this.ǃrFA=null,super.ǃMI()}ǃrzW(){return this.ǃrfj?this.ǃrfQ?this.ǃUtc.ǃrzk(this.ǃrfj,this):this.ǃrfj(this):null}ǃrzM(e){this.ǃrfe&&(e=!!e,this.ǃrfQ?this.ǃUtc.ǃrzx(this.ǃrfe,e,this):this.ǃrfe(e,this))}ǃaH(){this.ǃrfK&&this.ǃrfK(this.ǃTi())}ǃrFW(e){this.ǃrzU=!0,null===e?this.ǃrFA.indeterminate=!0:(this.ǃrFA.indeterminate=!1,this.ǃrFA.checked=!!e),this.ǃrzU=!1}ǃrH(){this.ǃrzU||!this.ǃrfe||(this.ǃaH(),this.ǃrzM(!!this.ǃrFA.checked),this.ǃrfj&&(this.ǃrfu=this.ǃrzW(),!!this.ǃrFA.checked!==this.ǃrfu&&this.ǃrFW(this.ǃrfu)),this.ǃUtc.ǃUtC())}ǃEv(){this.ǃrFA.focus()}ǃrFk(){return this.ǃrFA}ǃrfG(){this.ǃrfN&&(this.ǃrfQ?this.ǃbh(this.ǃUtc.ǃrzQ(this.ǃrfN)):this.ǃbh(this.ǃrfN()))}ǃrfC(r){this.ǃrFA.disabled=!r}ǃrfk(){if(this.ǃrfj){let e=this.ǃrzW();e===this.ǃrfu||(this.ǃrfu=e,this.ǃrFW(this.ǃrfu))}}}}"use strict",ǃr.ǃo.ǃsZ.ǃrFM=class extends ǃr.ǃo.ǃsZ.ǃrfM{constructor(e,r,t,n,i,o,d){super(e,r,t,n),ǃr.ǃzO(i),this.ǃrFx=ǃr.ǃo.ǃUd("span",this.ǃrfg,null,"infoProperty"),this.ǃrFx.setAttribute("tabindex","-1"),this.ǃrFR=i,this.ǃrfu=null,this.ǃrfN=o,this.ǃrfQ=d,this.ǃrfk(),this.ǃbh(!1)}ǃrzW(){return this.ǃrFR?this.ǃrfQ?this.ǃUtc.ǃrzk(this.ǃrFR,this):this.ǃrFR(this):null}ǃrfk(){if(!this.ǃrFR)return;let e=this.ǃrzW();null===e?e=lang("ui.bars.properties.multiple-placeholder"):!ǃr.ǃUyi(e)&&(e=e.toString());ǃr.ǃUjj(this.ǃrfu,e)||(this.ǃrfu=e,ǃr.ǃzL(this.ǃrFx,this.ǃrfu))}ǃEv(){this.ǃrFx.focus()}ǃMI(){ǃr.ǃo.ǃrv(this.ǃrFx),this.ǃrFx=null,this.ǃrFR=null,this.ǃrfN=null,this.ǃrfu=null,super.ǃMI()}ǃrFg(){return this.ǃrFx}ǃrfG(){this.ǃrfN&&(this.ǃrfQ?this.ǃbh(this.ǃUtc.ǃrzQ(this.ǃrfN)):this.ǃbh(this.ǃrfN()))}},"use strict",ǃr.ǃo.ǃsZ.ǃrFO=class extends ǃr.ǃo.ǃsZ.ǃrfM{constructor(e,r,t,n,i,o){if(super(e,r,t,n),ǃr.ǃk(i),this.ǃrFI=ǃr.ǃo.ǃUd("a",this.ǃrfg),this.ǃi_()&&this.ǃrFI.setAttribute("title",this.ǃi_()),this.ǃrFE=null,"string"==typeof o)this.ǃrFI.href=o,this.ǃrFI.target="_blank";else if("function"==typeof o)this.ǃrFE=o,this.ǃrFI.addEventListener("click",this.ǃrFE);else throw new TypeError("expected string or function");this.ǃrFI.textContent=i,this.ǃrzf=()=>this.ǃrfB(),this.ǃrFI.addEventListener("focus",this.ǃrzf),this.ǃrzz=()=>this.ǃUtc.ǃrfp(this),this.ǃrFI.addEventListener("blur",this.ǃrzz)}ǃMI(){this.ǃrFI.removeEventListener("focus",this.ǃrzf),this.ǃrzf=null,this.ǃrFI.removeEventListener("blur",this.ǃrzz),this.ǃrzz=null,this.ǃrFE&&(this.ǃrFI.removeEventListener("click",this.ǃrFE),this.ǃrFE=null),ǃr.ǃo.ǃrv(this.ǃrFI),this.ǃrFI=null,super.ǃMI()}ǃEv(){this.ǃrFI.focus()}ǃrFC(){return this.ǃrFI}ǃrFy(e){if(ǃr.ǃk(e),this.ǃrFE)throw new Error("not an external link");this.ǃrFI.href=e}ǃrFb(e){ǃr.ǃk(e),this.ǃrFI.textContent=e}},"use strict",ǃr.ǃo.ǃsZ.ǃrFS=class extends ǃr.ǃo.ǃsZ.ǃrfm{constructor(e,r,t,n){super(e,r,t,n),this.ǃe_=ǃr.ǃo.ǃUd("td",this.ǃqi),this.ǃe_.setAttribute("colspan","2"),this.ǃe_.setAttribute("tabindex","-1"),this.ǃe_.setAttribute("propgroup",""),this.ǃUB=ǃr.ǃo.ǃUd("div",this.ǃe_,null,"propgroup-wrap");let i=this.ǃrfc();0this.ǃrfB(),this.ǃe_.addEventListener("focus",this.ǃrFN),this.ǃrFK=()=>this.ǃUtc.ǃrfp(this),this.ǃe_.addEventListener("blur",this.ǃrFK),this.ǃrFP=()=>this.ǃoZ(!0),this.ǃrfR.addEventListener("UIDoubleTap",this.ǃrFP),this.ǃrFo.ǃUh().addEventListener("UIPointerDown",this.ǃrFP)}ǃMI(){this.ǃrFo.ǃUh().removeEventListener("UIPointerDown",this.ǃrFP),this.ǃrFo.ǃTq(),this.ǃrFo=null,this.ǃrfR.removeEventListener("UIDoubleTap",this.ǃrFP),this.ǃrFP=null,ǃr.ǃo.ǃrv(this.ǃrfR),this.ǃrfR=null,ǃr.ǃo.ǃrv(this.ǃUB),this.ǃUB=null,this.ǃe_.removeEventListener("blur",this.ǃrFK),this.ǃrFK=null,this.ǃe_.removeEventListener("focus",this.ǃrFN),this.ǃrFN=null,ǃr.ǃo.ǃrv(this.ǃe_),this.ǃe_=null,super.ǃMI()}ǃEv(){this.ǃe_.focus()}ǃrfI(){return this.ǃe_}ǃrFw(){if(2>=this.ǃrFe.length){for(let e of this.ǃrFe)if(e instanceof ǃr.ǃo.ǃsZ.ǃrFS)return!0;return!1}return!0}ǃYP(){return this.ǃrFj}ǃaQ(r,t){r=!!r,t=!!t;this.ǃrFj===r||(!this.ǃrFw()&&(t=!1),this.ǃrFj=r,this.ǃrFo.ǃVP(app.ǃJW(this.ǃrFj?"expanded":"collapsed")),this.ǃrFQ(t))}ǃoZ(e){e=!!e,this.ǃaQ(!this.ǃYP(),e)}ǃrfD(e,r){e=!!e,r=!!r,super.ǃrfD(e,r),this.ǃrFQ(r)}ǃrFQ(e){let r=this.ǃrFj&&this.ǃCG();for(let t of this.ǃrFe)t.ǃrfD(r,e)}ǃU$E(e,r,t,n,i,o,d){let a=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrfy,this.ǃUtc,e,r,t,this,n,i,o,!!d);return a.ǃrfD(this.ǃrFj&&this.ǃCG()),this.ǃUtc.ǃrFZ.push(a),this.ǃrFe.push(a),a}ǃU$o(e,r,t,n,i,o){let d=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrzZ,this.ǃUtc,e,r,this,t,n,i,!!o);return d.ǃrfD(this.ǃrFj&&this.ǃCG()),this.ǃUtc.ǃrFZ.push(d),this.ǃrFe.push(d),d}ǃUfs(e,r,t,n,i,o){let d=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrFJ,this.ǃUtc,e,r,this,t,n,i,!!o);return d.ǃrfD(this.ǃrFj&&this.ǃCG()),this.ǃUtc.ǃrFZ.push(d),this.ǃrFe.push(d),d}ǃU$Z(e,r,t,n,i,o){let d=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrF$,this.ǃUtc,e,r,this,t,n,i,!!o);return d.ǃrfD(this.ǃrFj&&this.ǃCG()),this.ǃUtc.ǃrFZ.push(d),this.ǃrFe.push(d),d}ǃUfT(e,r,t,n,i,o){let d=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrFq,this.ǃUtc,e,r,this,t,n,i,!!o);return d.ǃrfD(this.ǃrFj&&this.ǃCG()),this.ǃUtc.ǃrFZ.push(d),this.ǃrFe.push(d),d}ǃUfp(e,r,t,n,i){let o=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrFM,this.ǃUtc,e,r,this,t,n,i);return o.ǃrfD(this.ǃrFj&&this.ǃCG()),this.ǃUtc.ǃrFZ.push(o),this.ǃrFe.push(o),o}ǃUfZ(e,r,t,n){let i=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrFO,this.ǃUtc,e,r,this,t,n);return i.ǃrfD(this.ǃrFj&&this.ǃCG()),this.ǃUtc.ǃrFZ.push(i),this.ǃrFe.push(i),i}ǃU$O(e,r){let t=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrFS,this.ǃUtc,e,r,this);return t.ǃrfD(this.ǃrFj&&this.ǃCG()),this.ǃUtc.ǃrFZ.push(t),this.ǃrFe.push(t),t}ǃUfF(e,r,t){let n=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrzK,this.ǃUtc,e,r,t,this);return n.ǃrfD(this.ǃrFj&&this.ǃCG()),this.ǃUtc.ǃrFZ.push(n),this.ǃrFe.push(n),n}*children(){for(let e of this.ǃrFe)yield e}ǃIB(){return{name:this.ǃTi(),expanded:this.ǃYP(),children:this.ǃrFe.map((e)=>e.ǃIB()).filter((e)=>e)}}ǃIp(e){if(e){for(let r of e.children){let e=this.ǃrFu(r.name);e&&e.ǃIp(r)}this.ǃaQ(e.expanded)}}ǃrFu(e){ǃr.ǃk(e);for(let r of this.ǃrFe)if(r.ǃTi()===e)return r}},"use strict";{ǃr.ǃo.ǃsZ.ǃrzK=class extends ǃr.ǃo.ǃsZ.ǃrfM{constructor(e,r,t,n,i){if(super(e,r,t,i),ǃr.ǃk(n),!n)throw new Error("non-empty separator required");this.ǃrmU=n,this.ǃrmr="",this.ǃrmT=ǃr.ǃo.ǃUd("input",this.ǃrfg),this.ǃrmT.type="text",this.ǃrmT.id=this.ǃux(),this.ǃrmT.setAttribute("spellcheck","false"),this.ǃrFo=ǃr.ǃq(ǃr.ǃo.ǃnI,app.ǃJW("collapsed"),this.ǃUB),this.ǃrmv=()=>this.ǃoZ(!0),this.ǃrFo.ǃUh().addEventListener("UIPointerDown",this.ǃrmv),this.ǃrzU=!1,this.ǃrzr=!0,this.ǃrzT=!1,this.ǃrfK=this.ǃUtc.ǃrfP(),this.ǃrFj=!1,this.ǃrFe=[],this.ǃrz$=()=>this.ǃrH(),this.ǃrmT.addEventListener("change",this.ǃrz$),this.ǃrzf=(r)=>ǃr.ǃo.ǃQv.ǃrlp()?(r.preventDefault(),void this.ǃrmT.blur()):void(window.setTimeout(()=>{this.ǃrmT&&ǃr.ǃo.ǃYl(this.ǃKd,this.ǃUtc.ǃrfO())},300),this.ǃrfB(),this.ǃrzr=!1),this.ǃrmT.addEventListener("focus",this.ǃrzf),this.ǃrzz=()=>{this.ǃUtc.ǃrfp(this),this.ǃrzr=!0,this.ǃrzT=!1},this.ǃrmT.addEventListener("blur",this.ǃrzz),this.ǃSw=()=>{this.ǃrzr&&(this.ǃrzT=!0,this.ǃrzr=!1)},this.ǃrmT.addEventListener("UIPointerDown",this.ǃSw),this.ǃOC=(r)=>{this.ǃrzT&&(r.preventDefault(),this.ǃrzT=!1)},this.ǃrmT.addEventListener("UIPointerUp",this.ǃOC),this.ǃjd=(r)=>this.ǃkK(r),this.ǃrmT.addEventListener("keydown",this.ǃjd),this.ǃrmT.addEventListener("dragstart",ǃr.ǃo.ǃMf),this.ǃrFP=()=>this.ǃoZ(!0),this.ǃrfR.addEventListener("UIDoubleTap",this.ǃrFP)}ǃMI(){this.ǃrfK=null,this.ǃrfR.removeEventListener("UIDoubleTap",this.ǃrFP),this.ǃrFP=null,this.ǃrmT.removeEventListener("change",this.ǃrz$),this.ǃrz$=null,this.ǃrmT.removeEventListener("focus",this.ǃrzf),this.ǃrzf=null,this.ǃrmT.removeEventListener("blur",this.ǃrzz),this.ǃrzz=null,this.ǃrmT.removeEventListener("UIPointerDown",this.ǃSw),this.ǃSw=null,this.ǃrmT.removeEventListener("UIPointerUp",this.ǃOC),this.ǃOC=null,this.ǃrmT.removeEventListener("keydown",this.ǃjd),this.ǃjd=null,this.ǃrmT.removeEventListener("dragstart",ǃr.ǃo.ǃMf),ǃr.ǃo.ǃrv(this.ǃrmT),this.ǃrmT=null,this.ǃrFo.ǃUh().removeEventListener("UIPointerDown",this.ǃrmv),this.ǃrmv=null,this.ǃrFo.ǃTq(),this.ǃrFo=null,super.ǃMI()}ǃrfB(){this.ǃrmT.select(),super.ǃrfB()}ǃEv(){this.ǃrmT.focus()}ǃaH(){this.ǃrfK&&this.ǃrfK(this.ǃTi())}ǃrmJ(){let e=[];for(let r of this.ǃrFe)r.ǃrzg()||e.push(r);return e}ǃUfm(e){ǃr.ǃk(e),this.ǃrmr=e}ǃrH(){if(this.ǃrzU)return;this.ǃaH(),this.ǃrzU=!0;let e=this.ǃrmT.value.trim(),r=this.ǃrmU.trim(),t=e.split(r);if(1===t.length&&this.ǃrmr&&this.ǃrmr!==this.ǃrmU){let r=this.ǃrmr.trim(),n=e.split(r);2<=n.length&&(t=n)}let n=this.ǃrmJ(),o=Math.min(t.length,n.length);for(let e=0;ee.ǃIB()).filter((e)=>e)}}ǃIp(e){if(e){for(let r of e.children){let e=this.ǃrFu(r.name);e&&e.ǃIp(r)}this.ǃaQ(e.expanded)}}ǃrFu(e){ǃr.ǃk(e);for(let r of this.ǃrFe)if(r.ǃTi()===e)return r}}}{const e={ǃUtD:!1};ǃr.ǃo.ǃsZ.ǃUtH=class extends ǃr.Event.ǃUU{constructor(r,t){super(),ǃr.ǃVg(t),t=Object.assign({},e,t),this.ǃrJT=r,this.ǃqi=ǃr.ǃo.ǃUd("ui-propertygrid",this.ǃrJT),this.ǃrms=ǃr.ǃo.ǃUd("ui-propertygrid-container",this.ǃqi),this.ǃrmX=ǃr.ǃo.ǃUd("ui-propertygrid-table",this.ǃrms),this.ǃrmi=ǃr.ǃo.ǃUd("tr",this.ǃrmX),this.ǃrm_=ǃr.ǃo.ǃUd("td",this.ǃrmi,null,"firstRow"),this.ǃrm_.style.width="50%",this.ǃrm_.classList.add("firstRow"),this.ǃrml=ǃr.ǃo.ǃUd("td",this.ǃrmi,null,"firstRow"),this.ǃrmt=ǃr.ǃo.ǃUd("ui-propertygrid-footer",this.ǃqi),this.ǃrmt.style.display="none",this.ǃrm$=ǃr.ǃo.ǃUd("span",this.ǃrmt,null,"property-footer-title"),this.ǃrmf=ǃr.ǃo.ǃUd("span",this.ǃrmt,null,"property-footer-description"),this.ǃrmz=!!t.ǃUtD,this.ǃrFZ=[],this.ǃrfK=null,this.ǃrmF=null,this.ǃrmm=null,this.ǃrmh=0,this.ǃrmn=null,this.ǃrmV=0,this.ǃrmp=[],this.ǃrmB=-1,this.ǃrmd=[],this.ǃrmc=()=>this.ǃrmH(!1),this.ǃrmD=-1,this.ǃrmY=[],this.ǃrma=()=>this.ǃrmq(!1),this.ǃrmA=!0,this.ǃrmW=1,this.ǃSw=(r)=>this.ǃMe(r),this.ǃOI=(r)=>this.ǃOE(r),this.ǃrmG=(r)=>this.ǃrmk(r),this.ǃrzB=(r)=>this.ǃrmM(r),this.ǃOi=null,this.ǃrmx=!1,this.ǃOl=0,this.ǃOt=null,this.ǃrmz&&(this.ǃrmX.addEventListener("UIPointerDown",this.ǃSw,!0),this.ǃrmX.addEventListener("UIPointerMove",this.ǃOI),this.ǃam().addEventListener("UIPointerMove",this.ǃrmG),this.ǃam().addEventListener("UIPointerUp",this.ǃrzB))}ǃTq(){this.ǃXG(),this.ǃID(),this.ǃrmX.removeEventListener("UIPointerDown",this.ǃSw,!0),this.ǃSw=null,this.ǃrmX.removeEventListener("UIPointerMove",this.ǃOI),this.ǃOI=null,this.ǃam().removeEventListener("UIPointerMove",this.ǃrmG),this.ǃrmG=null,this.ǃam().removeEventListener("UIPointerUp",this.ǃrzB),this.ǃrzB=null,ǃr.ǃo.ǃrv(this.ǃOt),this.ǃOt=null,ǃr.ǃo.ǃrv(this.ǃrml),this.ǃrml=null,ǃr.ǃo.ǃrv(this.ǃrm_),this.ǃrm_=null,ǃr.ǃo.ǃrv(this.ǃrmi),this.ǃrmi=null,ǃr.ǃo.ǃrv(this.ǃrmX),this.ǃrmX=null,ǃr.ǃo.ǃrv(this.ǃrms),this.ǃrms=null,ǃr.ǃo.ǃrv(this.ǃrmt),this.ǃrmt=null,ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null,this.ǃrJT=null,this.ǃrmc=null,this.ǃrma=null,this.ǃrmm=null,super.ǃTq()}ǃXG(){this.ǃr_J(),ǃr.ǃXk(this.ǃrmp),this.ǃrmR("",""),-1!==this.ǃrmB&&(this.ǃAt().cancelAnimationFrame(this.ǃrmB),this.ǃrmB=-1),ǃr.ǃXk(this.ǃrmd),-1!==this.ǃrmD&&(this.ǃAt().cancelAnimationFrame(this.ǃrmD),this.ǃrmD=-1),ǃr.ǃXk(this.ǃrmY);for(let e=this.ǃrFZ.length-1;0<=e;--e)this.ǃrFZ[e].ǃMI();this.ǃrfK=null,this.ǃrmF=null,ǃr.ǃXk(this.ǃrFZ),this.ǃrmh=0}ǃID(){ǃr.ǃo.ǃad(this.ǃOi),this.ǃOi=null}ǃr_J(){for(let e=document.activeElement;e;)if(e=e.parentElement,e===this.ǃrmX)return void document.activeElement.blur()}ǃUh(){return this.ǃqi}ǃrfn(){return"propid"+this.ǃrmh++}ǃrfV(){return this.ǃrmX}ǃrfO(){return this.ǃrms}ǃam(){return this.ǃUh().ownerDocument}ǃAt(){return this.ǃam().defaultView}ǃrmR(e,r){ǃr.ǃk(e),ǃr.ǃk(r);let t=this.ǃrms.scrollTop;if(e&&"\xA0"!==e){let r=lang("ui.bars.properties.footer-title-prefix"),t=lang("ui.bars.properties.footer-title-suffix");this.ǃrm$.textContent=r+e+t}else ǃr.ǃo.ǃfZ(this.ǃrm$);r?this.ǃrmf.textContent=r:ǃr.ǃo.ǃfZ(this.ǃrmf),this.ǃrmt.style.display=e||r?"":"none",this.ǃrms.scrollTop=t}ǃUzw(e){if(ǃr.ǃre(e),!e.length)throw new Error("cannot set empty item array");ǃr.ǃUnO(this.ǃrmp,e)}ǃeZ(e){ǃr.ǃIO(e),this.ǃrJT!==e&&(this.ǃrJT&&this.ǃrJT.removeChild(this.ǃqi),this.ǃrJT=e,this.ǃrJT.appendChild(this.ǃqi))}ǃU$I(e){ǃr.ǃzO(e),this.ǃrfK=e}ǃrfP(){return this.ǃrfK}ǃUzU(e){ǃr.ǃzO(e),this.ǃrmF=e}ǃrfA(){return this.ǃrmF}ǃrzk(e,r){if(!this.ǃrmp.length)throw new Error("no item array available");let t=e(this.ǃrmp[0],r),n=t instanceof ǃr.ǃBL;for(let o=1,i=this.ǃrmp.length,d;or)){++r;for(let e=this.ǃrFZ.length,t;rthis.ǃUne(),this.ǃrLM=e.getElementById("cancelButton"),this.ǃrLM.onclick=()=>this.ǃrvu()}ǃFC(){this.ǃUno.textContent=lang("common.ok"),this.ǃrLM.textContent=lang("common.cancel")}ǃy(e,r){return ǃr.ǃk(e),this.ǃrmE.value=e,super.ǃy(r)}ǃUne(){this.ǃkh(this.ǃrmE.value)}};ǃr.ǃo.ǃut.ǃUVt.addEventListener("load",function(){ǃr.ǃo.ǃS.ǃUV$("LongTextPropertyDialog",t)})}{const e={title:"",ǃvi:"",ǃrmC:!1,ǃfg:!0,ǃfO:!0,ǃrmy:!0,ǃfI:!0};ǃr.ǃo.ǃsZ.ǃrl$=class extends ǃr.ǃT_{constructor(r,t){super(),ǃr.ǃVg(t),t=Object.assign({},e,t),ǃr.ǃk(t.title),this.ǃrid=r,this.ǃqi=ǃr.ǃo.ǃUd("ui-tab",this.ǃrid.ǃUh()),this.ǃqi.setAttribute("role","tab"),this.ǃrmb=ǃr.ǃo.ǃUd("span",this.ǃqi),this.ǃrmb.textContent=t.title,this.ǃcD=!1,this.ǃUuh=t.title,this.ǃrmS=t.ǃvi,this.ǃrvN=null,this.ǃrmS&&this.ǃqi.setAttribute("title",this.ǃrmS),this.ǃrzh=!1,this.ǃOh=0,this.ǃOn=0,this.ǃrmo=!1,this.ǃriY=null,this.ǃSw=(r)=>this.ǃMe(r),this.ǃqi.addEventListener("UIPointerDown",this.ǃSw),this.ǃSZ=(r)=>this.ǃrt(r),this.ǃqi.addEventListener("contextmenu",this.ǃSZ),this.ǃOI=(r)=>this.ǃOE(r),this.ǃOC=(r)=>this.ǃMQ(r),t.ǃrmC&&(this.ǃqi.setAttribute("closebutton",""),this.ǃrvN=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃzC,this.ǃqi),this.ǃrvN.onclick=()=>this.ǃrid.ǃrmj(this,"tabclose")),this.ǃrme=!1,this.ǃrmN=!1,this.ǃrmK=!1,this.ǃrmP=!1,this.ǃrme=ǃr.ǃUCj(t.ǃfg)?t.ǃfg:!!t.ǃfg,this.ǃrmN=ǃr.ǃUCj(t.ǃfO)?t.ǃfO:!!t.ǃfO,this.ǃrmK=ǃr.ǃUCj(t.ǃrmy)?t.ǃrmy:!!t.ǃrmy,this.ǃrmP=ǃr.ǃUCj(t.ǃfI)?t.ǃfI:!!t.ǃfI}ǃMI(){this.ǃqi.removeEventListener("contextmenu",this.ǃSZ),this.ǃSZ=null,this.ǃqi.ownerDocument.removeEventListener("UIPointerUp",this.ǃOC),this.ǃOC=null,this.ǃqi.ownerDocument.removeEventListener("UIPointerMove",this.ǃOI),this.ǃOI=null,this.ǃqi.removeEventListener("UIPointerDown",this.ǃSw),this.ǃSw=null,this.ǃrvN&&(this.ǃrvN.ǃTq(),this.ǃrvN=null),ǃr.ǃo.ǃrv(this.ǃrmb),this.ǃrmb=null,ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null,this.ǃriY=null,this.ǃrid=null,ǃr.ǃTq(this)}ǃrmw(){return ǃr.ǃUCj(this.ǃrme)?this.ǃrme():this.ǃrme}ǃrlf(){return ǃr.ǃUCj(this.ǃrmN)?this.ǃrmN():this.ǃrmN}ǃrlz(){return ǃr.ǃUCj(this.ǃrmK)?this.ǃrmK():this.ǃrmK}ǃrlF(){return ǃr.ǃUCj(this.ǃrmP)?this.ǃrmP():this.ǃrmP}ǃvb(){this.ǃqi&&this.ǃqi.setAttribute("hide","")}ǃvS(){this.ǃqi&&this.ǃqi.removeAttribute("hide")}ǃMe(r){let e=r.detail.clientX,t=r.detail.clientY;return this.ǃrzh?void 0:1===r.detail.ǃnT?void this.ǃTZ().ǃrmj(this,"tabmiddleclick"):void(this.ǃrid.ǃrl_(this),this.ǃrmw()&&(this.ǃrzh=!0,this.ǃOh=e,this.ǃOn=t,this.ǃrmo=!1,this.ǃqi.ownerDocument.addEventListener("UIPointerMove",this.ǃOI),this.ǃqi.ownerDocument.addEventListener("UIPointerUp",this.ǃOC)))}ǃOE(r){let e=r.detail,t=e.clientX,n=e.clientY,i=e.id;if(this.ǃrzh){if(this.ǃrid.ǃrmQ()&&Math.abs(t-this.ǃOh)>=10&&(this.ǃrmo=!0),this.ǃrmo){let e=this.ǃrid.ǃrmZ(t,n);if(e&&e!==this){let r=this.ǃ_v(),i=e.ǃ_v(),o=i-r,d=!0;return 0=r.left-o&&n>=r.top-o&&t<=r.right+o&&n<=r.bottom+o;ǃr.ǃyp(this.ǃOh,this.ǃOn,t,n)>80&&!d&&ǃr.ǃrd.ǃJP&&(this.ǃMQ(),this.ǃTZ().ǃr_N(this,t,n,i))}}ǃMQ(){this.ǃrzh=!1,this.ǃrmo=!1,this.ǃqi.ownerDocument.removeEventListener("UIPointerUp",this.ǃOC),this.ǃqi.ownerDocument.removeEventListener("UIPointerMove",this.ǃOI)}ǃrt(r){this.ǃrid.ǃr_Z(this,r.clientX,r.clientY)||r.preventDefault()}ǃrhU(e){e=!!e;this.ǃcD===e||(ǃr.ǃo.ǃbL(this.ǃqi,"active",e),this.ǃcD=e)}ǃtd(){return this.ǃqi.getBoundingClientRect().left}ǃ_v(){let e=this.ǃqi.getBoundingClientRect();return e.right-e.left}ǃhR(e,r){ǃr.ǃ$t(e),ǃr.ǃ$t(r);let t=this.ǃqi.getBoundingClientRect();return e>=t.left&&r>=t.top&&ee||e>=this.ǃriD.length?null:this.ǃriD[e]}*ǃfe(){for(let e=0,r=this.ǃriD.length;ee||e>=this.ǃriD.length)throw new RangeError("tab index out of range");let r=this.ǃriD[e];r.ǃMI(),this.ǃriD.splice(e,1),this.ǃrhJ===r&&(this.ǃriD.length?this.ǃrl_(this.ǃriD[0],!0):this.ǃrhJ=null),this.ǃrmj(null,"tabremove")}ǃVG(e){if(ǃr.ǃ$t(e),e=Math.floor(e),0>e||e>=this.ǃriD.length)throw new RangeError("tab index out of range");this.ǃrl_(this.ǃriD[e])}ǃrmZ(e,r){ǃr.ǃ$t(e),ǃr.ǃ$t(r);for(let t of this.ǃriD)if(t.ǃhR(e,r))return t;return null}ǃrl_(e,r=!1){if(ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃrl$),this.ǃrhJ!==e){if(!this.ǃriD.includes(e))throw new Error("tab does not belong to this tab bar");this.ǃrhJ=e,this.ǃrhL(),this.ǃrmj(e,"activetabchanged",r)}}ǃrhL(){for(let e=0,r=this.ǃriD.length,t;et||0>n)throw new Error("cannot find tab");this.ǃriD[t]=r,this.ǃriD[n]=e,this.ǃrhs()}ǃrhs(){for(let e of this.ǃriD)ǃr.ǃo.ǃrv(e.ǃUh());for(let e of this.ǃriD)this.ǃqi.appendChild(e.ǃUh())}ǃr_N(r,t,n,i){ǃr.ǃ$(r,ǃr.ǃo.ǃsZ.ǃrl$),ǃr.ǃ$t(t),ǃr.ǃ$t(n),ǃr.ǃ$t(i);let o=new ǃr.Event("tearofftab");o.ǃr_w=r,o.clientX=t,o.clientY=n,o.pointerId=i,this.dispatchEvent(o)}ǃr_Z(r,t,n){ǃr.ǃ$(r,ǃr.ǃo.ǃsZ.ǃrl$),ǃr.ǃ$t(t),ǃr.ǃ$t(n);let i=new ǃr.Event("tabcontextmenu",!0);return i.ǃr_w=r,i.clientX=t,i.clientY=n,this.dispatchEvent(i)}ǃrmj(r,t,n=!1){ǃr.ǃVm(r,ǃr.ǃo.ǃsZ.ǃrl$),ǃr.ǃk(t);let i=new ǃr.Event(t);i.ǃr_w=r,i.ǃrll=n?"removal":"",this.dispatchEvent(i)}}}{const e={ǃrhX:-1,ǃUXS:!1,ǃHu:!1,ǃDU:!1,ǃHZ:!1,ǃUmZ:!1,ǃrhi:!0},r=400;ǃr.ǃo.ǃsZ.ǃHQ=class extends ǃr.Event.ǃUU{constructor(r,t){super(),ǃr.ǃIO(r),ǃr.ǃVg(t),t=Object.assign({},e,t),ǃr.ǃ$t(t.ǃrhX),this.ǃrJT=r,this.ǃrh_=t.ǃrhX,0>this.ǃrh_&&(this.ǃrh_=app.ǃRK()),this.ǃrhl=!!t.ǃUXS&&ǃr.ǃrd.ǃJP,this.ǃrht=!!t.ǃHu,this.ǃrh$=!!t.ǃHZ,this.ǃrhf=!!t.ǃUmZ,this.ǃrhz=!!t.ǃDU,this.ǃrhF=!!t.ǃrhi,this.ǃqi=ǃr.ǃo.ǃUd("ui-tree",this.ǃrJT),this.ǃqi.setAttribute("role","tree"),this.ǃqi.setAttribute("tabindex",0),this.ǃrzf=()=>this.ǃrhm(),this.ǃrzz=()=>this.ǃrhh(),this.ǃqi.addEventListener("focus",this.ǃrzf),this.ǃqi.addEventListener("blur",this.ǃrzz),this.ǃjd=(r)=>this.ǃkK(r),this.ǃrhf?this.ǃqi.setAttribute("fullrowselect",""):this.ǃqi.setAttribute("itemselect",""),this.ǃrhF&&this.ǃqi.setAttribute("wraplongitems",""),this.ǃUQL=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃYI,this,null,null,""),this.ǃrhn=app.ǃJW("expanded"),this.ǃrhV=app.ǃJW("collapsed"),this.ǃrhp=new Set,this.ǃrhB=null,this.ǃOB=ǃr.ǃo.ǃUd("div",null,null,"tree-insert-mark"),this.ǃrhd=null,this.ǃOc="",this.ǃrhc=!1,this.ǃqA=-1,this.ǃrhH=()=>this.ǃrhD(),this.ǃrhY=0,this.ǃrha=0,this.ǃrhq=0,this.ǃrhA=0}ǃTq(){this.ǃam().removeEventListener("keydown",this.ǃjd),this.ǃjd=null,this.ǃrhp.clear(),this.ǃrhB=null,this.ǃan(),this.ǃOB=null,this.ǃrhW(),this.ǃrhH=null,this.ǃUQL.ǃTq(!0),this.ǃUQL=null,this.ǃqi.removeEventListener("focus",this.ǃrzf),this.ǃqi.removeEventListener("blur",this.ǃrzz),this.ǃrzf=null,this.ǃrzz=null,ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null,this.ǃrJT=null,super.ǃTq()}ǃUiA(e){e=!!e,this.ǃUQL.ǃrhG(e)}ǃUiG(e,r,t){let n=e instanceof ǃr.ǃo.ǃsZ.ǃYI?e:this.ǃY_((r)=>r.ǃih()===e);n&&(r=!!r,t=!!t,t?n.ǃrhG(r):n.ǃaQ(!1,r))}ǃUiW(e){e=!!e,this.ǃUQL.ǃrhk(e)}ǃUik(e,r,t){let n;n=e instanceof ǃr.ǃo.ǃsZ.ǃYI?e:this.ǃY_((r)=>r.ǃih()===e),r=!!r,t=!!t,t?n.ǃrhk(r):n.ǃaQ(!0,r)}ǃrhM(e){if(ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃYI),e.ǃYX()!==this)throw new Error("item from different tree")}ǃrhx(e){if(ǃr.ǃVm(e,ǃr.ǃo.ǃsZ.ǃYI),e&&e.ǃYX()!==this)throw new Error("item from different tree")}ǃY_(e){return this.ǃUQL.ǃY_(e)}ǃXG(){this.ǃan(),this.ǃUQL.ǃYn()}ǃrhR(){return this.ǃrh_}ǃYV(){return this.ǃUQL}ǃUh(){return this.ǃqi}ǃam(){return this.ǃqi.ownerDocument}ǃAt(){return this.ǃam().defaultView}ǃrhg(){return this.ǃrhn}ǃrhO(){return this.ǃrhV}ǃrhI(){return this.ǃrhl}ǃrhE(){return this.ǃrht}ǃrhC(){return this.ǃrhz}ǃrhy(){return this.ǃrh$}ǃrhb(){return this.ǃrhf}ǃrhS(e){this.ǃrhM(e),this.ǃrhp.add(e),this.ǃrho(e,"itemselect")}ǃrhj(e){this.ǃrhM(e),this.ǃrhp.delete(e)}ǃUio(){return this.ǃrhp.size}ǃYp(e=!1){const r=this.ǃrhB;for(let r of this.ǃrhp)r.ǃYq(!1);this.ǃrhB=e?r:null,assert(0===this.ǃrhp.size,"should have deleted all selected items")}ǃat(){return this.ǃrhp.values()}ǃUij(){return ǃr.ǃV(this.ǃrhp)}ǃUlT(){let e=[];for(let r of this.ǃat())e.push(r);return this.ǃrhe(e),e}ǃrhN(e){this.ǃrhx(e),this.ǃrhB=e}ǃrhK(){return this.ǃrhB}ǃU_C(){return this.ǃUQL.ǃU_C()}ǃrhP(){return this.ǃUQL.ǃrhP()}ǃU_n(e,r){ǃr.ǃk(e);const t=e.toLowerCase();for(const n of this.ǃU_C())if((r||n.ǃCG())&&n.ǃYK().toLowerCase().startsWith(t))return n;return null}ǃrhw(e,r){if(this.ǃrhM(e),this.ǃrhM(r),e===r)return void e.ǃYq(!0);let t=!1,n=null,o=[];for(let d of this.ǃU_C())if(t||(d===e?(t=!0,n=r):d===r&&(t=!0,n=e)),t&&(o.push(d),d===n))break;n===e&&o.reverse();for(let t of o)t.ǃYq(!0)}ǃrhm(){this.ǃam().addEventListener("keydown",this.ǃjd)}ǃrhh(){this.ǃam().removeEventListener("keydown",this.ǃjd)}ǃkK(r){if(1===this.ǃUio()){const e=r.which;if(e===ǃr.ǃrO.ǃn$||e===ǃr.ǃrO.ǃnl){const t=this.ǃUij(),n=[...this.ǃrhP()];let i=n.indexOf(t);0>i||(e===ǃr.ǃrO.ǃn$?--i:++i,0>i||i>=n.length||(n[i].ǃqK(),n[i].ǃYl(),r.preventDefault()))}}}ǃhR(e,r,t,n){ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃz(t),t=t||"full",n=!!n;let i=this.ǃqi.getBoundingClientRect();if(ei.right||r>i.bottom)return null;for(let o of this.ǃU_C()){let n=o.ǃhR(e,r,t);if(n)return{item:o,ǃap:n.ǃap,ǃE$:n.ǃE$}}return n&&e>i.left&&r>i.top&&e=o.left&&this.ǃrha<=o.right)if(this.ǃrhqo.bottom){let t=this.ǃqi.scrollTop,n=t+r*i+this.ǃrhA;this.ǃrhA=n-e(n),n=e(n),this.ǃqi.scrollTop=n}this.ǃqA=this.ǃAt().requestAnimationFrame(this.ǃrhH)}}ǃrhW(){this.ǃrhc=!1,-1!==this.ǃqA&&this.ǃAt()&&(this.ǃAt().cancelAnimationFrame(this.ǃqA),this.ǃqA=-1)}ǃrhe(e){ǃr.ǃre(e);for(let r of e)this.ǃrhM(r);this.ǃrhQ(),e.sort(ǃr.ǃo.ǃsZ.ǃYI.ǃrhZ)}ǃrhQ(){let e=0;for(let r of this.ǃU_C())r.ǃrhu(e++)}ǃrnU(e){ǃr.ǃk(e);let r=new ǃr.Event(e,!0);return r.ǃrnr=this,this.dispatchEvent(r)}ǃrho(e,r){this.ǃrhM(e),ǃr.ǃk(r);let t=new ǃr.Event(r,!0);return t.item=e,this.dispatchEvent(t)}ǃrnT(e,r,t,n){this.ǃrhM(e),ǃr.ǃk(r),ǃr.ǃ$t(t),ǃr.ǃ$t(n);let i=new ǃr.Event(r,!0);return i.item=e,i.clientX=t,i.clientY=n,this.dispatchEvent(i)}ǃfD(r,t){this.ǃrhM(r);let e=new ǃr.Event("itemcontextmenu",!0);return e.item=r,e.clientX=t.clientX,e.clientY=t.clientY,this.dispatchEvent(e)}ǃIB(){return{name:this.ǃUQL.ǃYK(),children:[...this.ǃUQL.children()].map((e)=>e.ǃIB())}}ǃIp(e){if(ǃr.ǃMd(e),!!e){let r=[...this.ǃUQL.children()],t=e.children.length;for(let n=0;nthis.ǃrni(),this.ǃrn_=!0,this.ǃrnl=(r)=>this.ǃrnt(r),this.ǃrn$=0,this.ǃrnf=0,this.ǃOm=-1,this.ǃOh=0,this.ǃOn=0,this.ǃrzh=!1,this.ǃOI=null,this.ǃOC=null,this.ǃrnz=null,this.ǃrnF=0,this.ǃrnm=0,this.ǃSQ=(r)=>this.ǃOZ(r),this.ǃez=(r)=>this.ǃeF(r),this.ǃoo=()=>this.ǃoj(),this.ǃrnh=null,this.ǃSP=!1,this.ǃSZ=(r)=>this.ǃrt(r),this.ǃrnn=null,this.ǃrnV=null,this.ǃjS=null,this.ǃrnp=null,this.ǃrnB=null,this.ǃrLc=null,this.ǃrnd=null,this.ǃrnc=null,this.ǃrzD=null,this.ǃrnH=null,this.ǃrnD=null,this.ǃrnY=null,this.ǃrna=-1,this.ǃop()||(this.ǃqi=ǃr.ǃo.ǃUd("ui-treeitem",this.ǃrJT.ǃrnq(),null,null,null,d),this.ǃqi.setAttribute("role","treeitem"),this.ǃqi.addEventListener("contextmenu",this.ǃSZ),!this.enable&&this.ǃqi.setAttribute("disable",""),this.ǃef=ǃr.ǃq(ǃr.ǃo.ǃnI,this.ǃHw.ǃrhg().ǃrtn(),this.ǃqi),this.ǃrnh=ǃr.ǃo.ǃUd("div",this.ǃqi,null,"tree-item-wrap"),this.ǃrnA().addEventListener("UIDoubleTap",this.ǃSQ),this.ǃjS=ǃr.ǃq(ǃr.ǃo.ǃnI,this.ǃr$W||this.ǃHw.ǃrhR(),this.ǃrnh),this.ǃrnp=(r)=>this.ǃrnW(r),this.ǃjS.ǃUh().addEventListener("UIPointerDown",this.ǃrnp),this.ǃrnB=ǃr.ǃo.ǃUd("span",this.ǃrnh,null,"tree-item-name"),this.ǃrnB.textContent=this.ǃUdL,this.ǃrnH=()=>this.ǃrnG(),this.ǃSw=(r)=>this.ǃMe(r),this.ǃrnA().addEventListener("UIPointerDown",this.ǃSw),this.ǃOI=(r)=>this.ǃOE(r),this.ǃOC=(r)=>this.ǃMQ(r)),this.ǃVl=!1}ǃrnk(e){e=!!e,this.ǃrnJ=e}ǃU_B(){return this.ǃrnJ}ǃYn(){this.ǃow(),this.ǃrnv=!0;for(let e=this.ǃrJv.length-1,r;0<=e;--e)r=this.ǃrJv[e],r.ǃrnk(!0),r.ǃTq();ǃr.ǃXk(this.ǃrJv),this.ǃrnv=!1,this.ǃrnM()}ǃrJy(e){if(ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃYI),!this.ǃrnv){let r=this.ǃrJv.indexOf(e);assert(0<=r,"cannot find child to remove"),this.ǃrJv.splice(r,1),this.ǃrJv.length||this.ǃrnM()}}ǃTq(e){if(this.ǃop()&&!e)throw new Error("root item cannot be removed");this.ǃrnx(),this.ǃrnl=null,this.ǃrnR(),this.ǃow(),this.ǃYq(!1),this.ǃHw.ǃrhK()===this&&(1<=this.ǃHw.ǃUio()?this.ǃHw.ǃrhN(this.ǃHw.ǃUij()):this.ǃHw.ǃrhN(null)),this.ǃYn(),this.ǃoo=null,this.ǃrnH=null,this.ǃop()||(this.ǃrnA().removeEventListener("UIDoubleTap",this.ǃSQ),this.ǃrnA().removeEventListener("UIPointerDown",this.ǃSw),this.ǃam().removeEventListener("UIPointerMove",this.ǃOI),this.ǃam().removeEventListener("UIPointerUp",this.ǃOC)),this.ǃef&&(this.ǃef.ǃUh().removeEventListener("UITap",this.ǃez),this.ǃef.ǃTq(),this.ǃef=null),this.ǃrnL&&(ǃr.ǃo.ǃrv(this.ǃrnL),this.ǃrnL=null),this.ǃrnB&&(ǃr.ǃo.ǃrv(this.ǃrnB),this.ǃrnB=null),this.ǃrnz&&(ǃr.ǃo.ǃrv(this.ǃrnz),this.ǃrnz=null),this.ǃrnn&&(this.ǃrnn.removeEventListener("change",this.ǃrnV),this.ǃrnV=null,ǃr.ǃo.ǃrv(this.ǃrnn),this.ǃrnn=null),this.ǃjS&&(this.ǃjS.ǃUh().removeEventListener("UIPointerDown",this.ǃrnp),this.ǃrnp=null,this.ǃjS.ǃTq(),this.ǃjS=null),this.ǃrnh&&(ǃr.ǃo.ǃrv(this.ǃrnh),this.ǃrnh=null),this.ǃqi&&(this.ǃqi.removeEventListener("contextmenu",this.ǃSZ),ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null),this.ǃSZ=null,this.ǃSQ=null,this.ǃSw=null,this.ǃOI=null,this.ǃOC=null,this.ǃrnX=null,this.ǃez=null,this.ǃrJT&&this.ǃrJT.ǃrJy(this),this.ǃop()||this.ǃHw.ǃrho(this,"itemremove"),this.ǃr$W=null,this.ǃriY=null,this.ǃHw=null,this.ǃrJT=null,ǃr.ǃTq(this)}ǃUh(){return this.ǃqi}ǃUiO(){return this.ǃrnh}ǃrnA(){return this.ǃHw.ǃrhb()?this.ǃqi:this.ǃrnh}ǃYX(){return this.ǃHw}ǃam(){return this.ǃqi.ownerDocument}ǃbh(e){e=!!e;this.enable===e||(this.enable=e,this.enable?this.ǃqi.setAttribute("disable",""):this.ǃqi.removeAttribute("disable"))}ǃAB(){return this.enable}*ǃU_C(){this.ǃop()||(yield this);for(const e of this.ǃrJv)yield*e.ǃU_C()}*ǃrhP(){if(this.ǃop()||(yield this),this.ǃYP())for(const e of this.ǃrJv)yield*e.ǃrhP()}*children(){for(let e of this.ǃrJv)yield e}ǃMe(r){let e=r.detail;e.ǃnT!==ǃr.ǃGV.ǃxp||(this.ǃHw.ǃrho(this,"itemdown"),this.ǃrnA().setAttribute("pointerheld",""),this.ǃam().addEventListener("UIPointerMove",this.ǃOI),this.ǃam().addEventListener("UIPointerUp",this.ǃOC),this.ǃOm=e.id,this.ǃOh=e.clientX,this.ǃOn=e.clientY,this.ǃrzh=!1)}ǃOE(r){let e=r.detail;if(e.id===this.ǃOm){if(this.ǃHw.ǃrhy()&&!this.ǃrzh&&ǃr.ǃyp(this.ǃOh,this.ǃOn,e.clientX,e.clientY)>=10)if(this.ǃrnA().removeAttribute("pointerheld",""),this.ǃHw.ǃrho(this,"dragstart")){this.ǃrzh=!0,this.ǃrnx(),this.ǃHw.ǃrhN(this),this.ǃYa()||this.ǃqK();for(let e of this.ǃHw.ǃat())e.ǃrnA().setAttribute("dragged","");1===this.ǃHw.ǃUio()?(this.ǃrnz=this.ǃrnh.cloneNode(!0),this.ǃrnz.removeAttribute("selected"),this.ǃrnz.setAttribute("drag-thumbnail","")):(this.ǃrnz=this.ǃrnB.cloneNode(!0),this.ǃrnz.setAttribute("drag-thumbnail",""),this.ǃrnz.textContent=ǃrQ("ui.controls.tree.multi-select-drag-tooltip",null,this.ǃHw.ǃUio()));let e=ǃr.ǃUyE(this.ǃqi,"dialog");if(e){e.appendChild(this.ǃrnz);let r=ǃr.ǃo.ǃS.ǃrJB(e);this.ǃrnF=r.ǃrLh(),this.ǃrnm=r.ǃrLn()}else this.ǃam().body.appendChild(this.ǃrnz);this.ǃHw.ǃDI()}else return this.ǃOm=-1,this.ǃam().removeEventListener("UIPointerMove",this.ǃOI),this.ǃam().removeEventListener("UIPointerUp",this.ǃOC),void(this.ǃYa()||this.ǃqK());this.ǃrzh&&(r.preventDefault(),this.ǃHw.ǃrnT(this,"dragmove",e.clientX,e.clientY),this.ǃrnz.style.left=`${e.clientX-this.ǃrnF}px`,this.ǃrnz.style.top=`${e.clientY-this.ǃrnm}px`,this.ǃHw.ǃDC(e.clientX,e.clientY))}}ǃrnt(r){this.ǃrn$=r.detail.clientX,this.ǃrnf=r.detail.clientY}ǃMQ(r){let e=r.detail;if(e.id===this.ǃOm)if(this.ǃrnA().removeAttribute("pointerheld",""),this.ǃam().removeEventListener("UIPointerMove",this.ǃOI),this.ǃam().removeEventListener("UIPointerUp",this.ǃOC),this.ǃrzh){this.ǃrzh=!1,this.ǃOm=-1;for(let e of this.ǃHw.ǃat())e.ǃrnA().removeAttribute("dragged");ǃr.ǃo.ǃrv(this.ǃrnz),this.ǃrnz=null,this.ǃHw.ǃrhW(),this.ǃHw.ǃrnT(this,"drop",e.clientX,e.clientY)}else{if(r.target===this.ǃrnn)return;this.ǃHw.ǃrhI()&&this.ǃYa()&&1===this.ǃHw.ǃUio()&&this.ǃhR(e.clientX,e.clientY,"label")&&(this.ǃrnx(),r.target!==this.ǃjS.ǃUh()&&(this.ǃrn$=e.clientX,this.ǃrnf=e.clientY,this.ǃam().addEventListener("UIPointerMove",this.ǃrnl),this.ǃrns=setTimeout(this.ǃrnX,700))),this.ǃHw.ǃrho(this,"itemclick");let t=this.ǃHw.ǃrhK();if(this.ǃHw.ǃrhE()){let e=ǃr.ǃke.ǃkQ(),r=ǃr.ǃke.ǃkj(ǃr.ǃrO.ǃMu);if(e&&r&&t)return this.ǃHw.ǃrhw(this,t),this.ǃYa()&&this.ǃHw.ǃrhN(this),this.ǃHw.ǃrhC()&&this.ǃrng(!0),void this.ǃHw.ǃrho(this,"afteritemclick");if(e){let e=!this.ǃYa();return this.ǃYq(e),this.ǃYa()&&this.ǃHw.ǃrhN(this),this.ǃHw.ǃrhC()&&this.ǃrng(e),void this.ǃHw.ǃrho(this,"afteritemclick")}if(r&&t)return this.ǃHw.ǃYp(!0),this.ǃHw.ǃrhw(this,t),this.ǃHw.ǃrhC()&&(this.ǃrng(!0),t.ǃrng(!0)),void this.ǃHw.ǃrho(this,"afteritemclick")}this.ǃHw.ǃrhN(this),this.ǃrnO(!1),this.ǃHw.ǃYp(),this.ǃYq(!0),this.ǃrnO(!0),this.ǃHw.ǃrhC()&&this.ǃrng(!0),this.ǃHw.ǃrho(this,"afteritemclick")}}ǃrng(e){if(e=!!e,this.ǃYN())for(let r of this.children())r.ǃYq(e)}ǃOZ(){this.ǃrnx(),this.ǃHw.ǃrho(this,"itemdoubletap")&&this.ǃrnL&&this.ǃoZ(!0)}ǃrnW(r){this.ǃrnx(),r.detail.ǃnT!==ǃr.ǃGV.ǃxp||this.ǃHw.ǃrho(this,"itemiconclick")||r.stopPropagation()}ǃY_(e){if(ǃr.ǃ_u(e),e(this))return this;for(let r=0,t;rn.right||rn.bottom)return null;let i=n.bottom-n.top,o=n.top+i/4,d=n.bottom-i/4,a=n.top+i/2,s=r>=a,T=r>o&&r<=d;return s&&!T&&this.ǃYP()&&this.ǃYN()&&(T=!0),{ǃap:s?"after":"before",ǃE$:T}}ǃrnE(){if(this.ǃUlw(),this.ǃrFj)for(let e of this.ǃrJv)e.ǃrnE()}ǃVP(e){if(!ǃr.ǃFL(e)&&!(e instanceof ǃr.ǃo.ǃVK))throw new TypeError("invalid icon");ǃr.ǃFL(e)?this.ǃjS.ǃVP(app.ǃJW(e)):this.ǃjS.ǃVP(e)}ǃUlq(e){ǃr.ǃ_u(e),this.ǃjS.ǃUlq(e),this.ǃCG()&&this.ǃUlw()}ǃUlw(){this.ǃjS.ǃUlw()}ǃCG(){for(let e=this.ǃrJT;e;){if(!e.ǃYP())return!1;e=e.ǃrJT}return!0}ǃeF(r){r.detail.ǃnT!==ǃr.ǃGV.ǃxp||this.ǃoZ(!0)}ǃYP(){return this.ǃrFj}ǃaQ(t,n){if(this.ǃop())throw new Error("cannot change expanded state of root item");if(t=!!t,n=!!(n&&this.ǃCG()&&app.ǃjU()),!this.ǃrnL)return void(this.ǃrFj=t);if((!n||n&&this.ǃjr())&&(this.ǃow(),n=!1),t&&!this.ǃrFj){if(this.ǃrFj=!0,this.ǃrnL.removeAttribute("collapsed"),this.ǃef.ǃVP(this.ǃHw.ǃrhg()),this.ǃrhV&&this.ǃjS.ǃVP(this.ǃr$W),this.ǃrnC(),this.ǃCG()&&this.ǃrnE(),n){let t=this.ǃrnL.getBoundingClientRect(),n=t.bottom-t.top;e[0].height="0px",e[1].height=`${n}px`,this.ǃrnL.style.overflow="hidden",this.ǃoS=this.ǃrnL.animate(e,r),this.ǃoS.onfinish=this.ǃoo}}else if(!t&&this.ǃrFj)if(this.ǃrFj=!1,this.ǃef.ǃVP(this.ǃHw.ǃrhO()),this.ǃrhV&&this.ǃjS.ǃVP(this.ǃrhV),this.ǃrnC(),n){let t=this.ǃrnL.getBoundingClientRect(),n=t.bottom-t.top;e[0].height=`${n}px`,e[1].height="0px",this.ǃrnL.style.overflow="hidden",this.ǃoS=this.ǃrnL.animate(e,r),this.ǃoS.onfinish=this.ǃoo}else this.ǃrnL.setAttribute("collapsed","")}ǃrnC(){this.ǃVl||this.ǃHw.ǃrho(this,"itemexpand")}ǃrhk(e){this.ǃop()||this.ǃaQ(!0,e);let r=this.ǃrJv.length;for(let t=0;tn?this.ǃrJv.unshift(o):this.ǃrJv.splice(n,0,o):this.ǃrJv.push(o),o}ǃUiu(e){e?this.ǃqi.setAttribute("fade",""):this.ǃqi.removeAttribute("fade","")}ǃU_Y(e){ǃr.ǃ$(e,ǃr.ǃo.ǃVK);this.ǃop()||(this.ǃrhV=e,this.ǃrnL&&!this.ǃrFj&&this.ǃjS.ǃVP(this.ǃrhV))}ǃU_D(e){ǃr.ǃ$(e,ǃr.ǃo.ǃVK);this.ǃop()||(this.ǃr$W=e,this.ǃrnL&&this.ǃrFj&&this.ǃjS.ǃVP(this.ǃr$W))}ǃrt(r){this.ǃYa()||this.ǃqK(),this.ǃrnx(),this.ǃHw.ǃfD(this,r)||(r.preventDefault(),r.stopPropagation())}ǃai(e){e=!!e;for(let r=this.ǃrJT;r;)r.ǃop()||r.ǃaQ(!0,e),r=r.ǃaB()}ǃYl(){ǃr.ǃo.ǃYl(this.ǃqi,this.ǃHw.ǃUh())}ǃUig(e){e=!!e,this.ǃai(e),this.ǃYl()}ǃrni(){this.ǃrns=-1,this.ǃqi&&this.ǃam().removeEventListener("UIPointerMove",this.ǃrnl);this.ǃhR(this.ǃrn$,this.ǃrnf,"label")&&this.ǃHw.ǃrho(this,"itemedit")}ǃrnO(e){this.ǃrn_=!!e}ǃrnx(){this.ǃrn_&&(this.ǃqi&&this.ǃam().removeEventListener("UIPointerMove",this.ǃrnl),-1!==this.ǃrns&&(clearTimeout(this.ǃrns),this.ǃrns=-1))}ǃrnS(){return!!this.ǃrLc}ǃU_M(e=this.ǃYK(),r=0,t=e.length){var n=Math.max;if(ǃr.ǃz(e),this.ǃrLc)return Promise.resolve("");this.ǃqK(),this.ǃUig();let i=this.ǃHw.ǃUh(),o=i.getBoundingClientRect(),d=this.ǃrnB.getBoundingClientRect(),a=d.left-o.left,s=d.top-o.top+i.scrollTop;return this.ǃrLc=ǃr.ǃo.ǃUd("input",this.ǃHw.ǃUh(),null,"tree-edit-text"),this.ǃrLc.type="text",this.ǃrLc.style.left=`${a}px`,this.ǃrLc.style.top=`${s}px`,this.ǃrLc.style.width=`${n(d.right-d.left,30)}px`,this.ǃrLc.style.maxWidth=`${n(d.right-d.left,30)}px`,this.ǃrLc.style.height=`${d.bottom-d.top}px`,this.ǃrLc.setAttribute("spellcheck","false"),this.ǃrnd=()=>this.ǃrno(),this.ǃrLc.addEventListener("blur",this.ǃrnd),this.ǃrnc=()=>this.ǃrnj(),this.ǃrLc.addEventListener("input",this.ǃrnc),this.ǃrzD=(r)=>this.ǃrne(r),this.ǃrLc.addEventListener("keydown",this.ǃrzD,!0),this.ǃHw.ǃUh().addEventListener("scroll",this.ǃrnH),this.ǃrLc.value=e,this.ǃrLc.focus(),this.ǃrLc.setSelectionRange(r,t),this.ǃrnB.textContent=".",new Promise((e,r)=>{this.ǃrnD=e,this.ǃrnY=r})}ǃrne(r){r.which===ǃr.ǃrO.ǃrg?(r.preventDefault(),r.stopPropagation(),this.ǃrno()):r.which===ǃr.ǃrO.ǃns&&(r.preventDefault(),r.stopPropagation(),this.ǃrnR())}ǃrnj(){this.ǃrnB.textContent=this.ǃrLc.value;let e=this.ǃrnB.getBoundingClientRect();this.ǃrLc.style.width=`${Math.max(e.right-e.left,30)}px`,this.ǃrnB.textContent="."}ǃrnG(){let e=this.ǃHw.ǃUh().getBoundingClientRect(),r=this.ǃrnB.getBoundingClientRect();this.ǃrLc.style.left=`${r.left-e.left}px`,this.ǃrLc.style.top=`${r.top-e.top+this.ǃHw.ǃUh().scrollTop}px`;let t=this.ǃrLc.getBoundingClientRect();(t.bottom>e.bottom+1||t.topthis.ǃrnK(),this.ǃrnn.addEventListener("change",this.ǃrnV),this.ǃrnh.insertBefore(this.ǃrnn,this.ǃrnh.firstChild))}ǃrnK(){this.ǃrnx(),this.ǃHw.ǃrho(this,"itemcheckchange")}ǃUhl(e){if(!this.ǃrnn)throw new Error("no checkbox added");this.ǃrnn.checked=!!e}ǃUh$(){if(!this.ǃrnn)throw new Error("no checkbox added");return!!this.ǃrnn.checked}ǃrhu(e){ǃr.ǃ$t(e),this.ǃrna=e}ǃrnP(){return this.ǃrna}static ǃrhZ(e,r){return e.ǃrnP()-r.ǃrnP()}ǃIB(){return{name:this.ǃYK(),expanded:this.ǃYP(),children:[...this.children()].map((e)=>e.ǃIB())}}ǃIp(e){if(e){this.ǃVl=!0,this.ǃaQ(e.expanded);let r=[...this.children()];if(r.length){const t=Math.min(e.children.length,r.length);for(let n=0;nthis.ǃrh_&&(this.ǃrh_=app.ǃvJ()),this.ǃrnu=i.itemType,this.ǃrVU=i.ǃrnw,this.ǃrht=!!i.ǃHu,this.ǃrVr=[],this.ǃrhp=new Set,this.ǃrVT=[],r&&"ui-iconview"===r.tagName.toLowerCase()?(this.ǃrJT=r.parentElement,this.ǃqi=r):(this.ǃrJT=r,this.ǃqi=ǃr.ǃo.ǃUd("ui-iconview",this.ǃrJT)),this.ǃqi.setAttribute(this.ǃrVU,""),this.ǃSw=(r)=>this.ǃMe(r),this.ǃqi.addEventListener("UIPointerDown",this.ǃSw),this.ǃqi.setAttribute("tabindex",0),this.ǃrzf=()=>this.ǃrhm(),this.ǃrzz=()=>this.ǃrhh(),this.ǃqi.addEventListener("focus",this.ǃrzf),this.ǃqi.addEventListener("blur",this.ǃrzz),this.ǃjd=(r)=>this.ǃkK(r),this.ǃrVv="",this.ǃrVJ=null,this.ǃ$S=new ǃr.ǃXA(()=>this.ǃrVL(),100),this.ǃ$S.ǃRQ(!0),this.ǃrVs=!1,this.ǃrVX=ǃr.ǃo.ǃUd("div",null,null,"iconViewNoSearchResults"),this.ǃrVi=!1,this.ǃrV_=ǃr.ǃo.ǃUd("div",this.ǃqi,null,"iconViewNoItems"),this.ǃrV_.textContent=i.ǃrnQ||lang("ui.controls.icon-view.no-items-showing"),this.ǃrVl=!0,this.ǃrsC=null}ǃTq(){this.ǃXG(),this.ǃam().removeEventListener("keydown",this.ǃjd),this.ǃjd=null,this.ǃrVJ=null,this.ǃ$S.ǃTq(),this.ǃ$S=null,this.ǃqi.removeEventListener("UIPointerDown",this.ǃSw),this.ǃSw=null,ǃr.ǃo.ǃrv(this.ǃrV_),this.ǃrV_=null,ǃr.ǃo.ǃrv(this.ǃrVX),this.ǃrVX=null,this.ǃqi.removeEventListener("focus",this.ǃrzf),this.ǃqi.removeEventListener("blur",this.ǃrzz),this.ǃrzf=null,this.ǃrzz=null,ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null,this.ǃrJT=null,super.ǃTq()}ǃeZ(e){ǃr.ǃIO(e),this.ǃrJT!==e&&(this.ǃrJT&&this.ǃrJT.removeChild(this.ǃqi),this.ǃrJT=e,this.ǃrJT.appendChild(this.ǃqi))}ǃam(){return this.ǃqi.ownerDocument}ǃrVt(e){if(ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃrV$),e.ǃrVf()!==this)throw new Error("item from different icon view")}ǃXG(){for(let e of this.ǃrVT)e.ǃMI();ǃr.ǃXk(this.ǃrVT);for(let e of this.ǃrVr)e.ǃMI();ǃr.ǃXk(this.ǃrVr),this.ǃrhp.clear(),this.ǃrVz()}ǃrVF(e){this.ǃrVt(e),e.ǃMI(),this.ǃrVr.splice(this.ǃrVr.indexOf(e),1),this.ǃrVz()}ǃrhR(){return this.ǃrh_}ǃrVm(){return this.ǃrVU}ǃrhE(){return this.ǃrht}ǃrVh(e){e=!!e;this.ǃrht===e||(!e&&this.ǃYp(),this.ǃrht=e)}ǃUh(){return this.ǃqi}ǃEf(){return this.ǃrsC||(this.ǃrsC=this.ǃqi.getBoundingClientRect()),this.ǃrsC}ǃaB(){return this.ǃrJT}ǃsA(){return this.ǃrVr}*ǃrhP(){for(const e of this.ǃrVr)e.ǃot()||(yield e)}ǃrVn(){return this.ǃrVr.length}ǃrVV(e){return ǃr.ǃ$t(e),e=Math.floor(e),0>e||e>=this.ǃrVr.length?null:this.ǃrVr[e]}ǃrVp(){return ǃr.ǃV(this.ǃsA())}ǃrVB(e){this.ǃrVt(e);let r=this.ǃrVd(e)-1;return ǃr.ǃUyq(r,this.ǃrVr)?this.ǃrVr[r]:null}ǃrVc(e){this.ǃrVt(e);let r=this.ǃrVd(e)+1;return ǃr.ǃUyq(r,this.ǃrVr)?this.ǃrVr[r]:null}ǃrVH(){return"static"===this.ǃrnu?ǃr.ǃo.ǃsZ.ǃrV$:"sortable"===this.ǃrnu?ǃr.ǃo.ǃsZ.ǃrVD:void 0}ǃrVY(e){ǃr.ǃ_u(e);for(let r of this.ǃrVr)if(e(r))return r;return null}ǃrVa(){this.ǃrVr.reverse();let e=this.ǃqi.firstChild;for(let r=this.ǃqi.children.length-1,t;0e||e>=this.ǃrVr.length)throw new Error("invalid item index");if(0>r||r>=this.ǃrVr.length)throw new Error("invalid item index");if(e!==r){let t=this.ǃrVr[e],n=t.ǃUh();this.ǃqi.removeChild(n);let i=this.ǃrVr[r],o=i.ǃUh();en)){if(e===ǃr.ǃrO.ǃnf)do--n;while(0<=n&&this.ǃrVr[n].ǃot());else if(e===ǃr.ǃrO.ǃnz)do++n;while(nr.right)&&(1==i&&t.top>r.bottom||-1==i&&t.bottomn||n>=this.ǃrVr.length||(this.ǃrVr[n].ǃqK(),this.ǃrVr[n].ǃYl(),r.preventDefault())}}ǃMe(r){r.target!==this.ǃqi||ǃr.ǃke.ǃkQ(r)||r.shiftKey||this.ǃYp()}ǃrho(e,r){this.ǃrVt(e),ǃr.ǃk(r);let t=new ǃr.Event(r,!0);return t.item=e,this.dispatchEvent(t)}ǃfD(r,t){this.ǃrVt(r);let e=new ǃr.Event("itemcontextmenu",!0);return e.item=r,e.clientX=t.clientX,e.clientY=t.clientY,this.dispatchEvent(e)}ǃrVd(e){return this.ǃrVt(e),this.ǃrVr.indexOf(e)}ǃrVW(e){return this.ǃrVt(e),Array.prototype.indexOf.call(this.ǃqi.children,e.ǃUh())}ǃrVG(e,t,n){this.ǃrVt(e),ǃr.ǃ$t(t),ǃr.ǃk(n);let i=this.ǃrVr;if(0>t||t>=i.length)throw new Error("new index is out of bounds");if(!r.includes(n))throw new Error(`invalid position, '${n}' was used. Only ${r.toString()} are valid positions.`);let o=this.ǃrVr[t];this.ǃUh().removeChild(e.ǃUh()),"left"===n&&this.ǃUh().insertBefore(e.ǃUh(),o.ǃUh()),"right"===n&&o.ǃUh().parentNode.insertBefore(e.ǃUh(),o.ǃUh().nextSibling);let d=this.ǃrVd(e),a=0;return t>d?("left"===n&&(a=0n?this.ǃrVr.unshift(o):this.ǃrVr.splice(n,0,o):this.ǃrVr.push(o),this.ǃrVz(),o}ǃCc(e){if(ǃr.ǃk(e),"sortable"===this.ǃrnu)throw new Error("not yet implemented: groups for sortable icon views");let r=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrVR,this,e);return this.ǃrVT.push(r),this.ǃrVz(),r}ǃrVg(e,r){ǃr.ǃk(e),ǃr.ǃVg(r),this.ǃrVs=!1,r&&(this.ǃrVs=!!r.ǃrVO),this.ǃrVv=e,this.ǃrVJ=null,this.ǃ$S.ǃU_()}ǃrVI(e,r,t){ǃr.ǃ_u(e),ǃr.ǃz(r),ǃr.ǃVg(t),this.ǃrVs=!1,t&&(this.ǃrVs=!!t.ǃrVO),this.ǃrVv=r||"",this.ǃrVJ=e,this.ǃ$S.ǃU_()}ǃrVL(){let e=this.ǃrVv.toLowerCase(),r=!1,t=this.ǃrVJ,n=!0;for(let i of this.ǃsA())if(t){let e=t(i);i.ǃol(!e),e&&(n&&(this.ǃrVs&&i.ǃqK(),n=!1),r=!0)}else if(e){let t=i.ǃrVE(e);i.ǃol(!t),t&&(n&&(this.ǃrVs&&i.ǃqK(),n=!1),r=!0)}else i.ǃol(!1),r=!0;this.ǃrVC(!r),this.ǃrVJ=null;const i=new ǃr.Event("searchresultsupdate");this.dispatchEvent(i)}ǃrVz(){let e=!this.ǃrVr.length&&!this.ǃrVT.length;this.ǃrVl===e||(this.ǃrVl=e,this.ǃrVl?this.ǃqi.appendChild(this.ǃrV_):ǃr.ǃo.ǃrv(this.ǃrV_))}ǃrVC(e){return this.ǃrVl?void 0:this.ǃrVi===e?void(this.ǃrVi&&(this.ǃrVJ&&!this.ǃrVv?this.ǃrVX.textContent=lang("ui.controls.icon-view.no-search-results"):this.ǃrVX.textContent=ǃj("ui.controls.icon-view.no-text-search-results",this.ǃrVv))):void(this.ǃrVi=e,this.ǃrVi?(this.ǃqi.appendChild(this.ǃrVX),this.ǃrVX.textContent=this.ǃrVJ&&!this.ǃrVv?lang("ui.controls.icon-view.no-search-results"):ǃj("ui.controls.icon-view.no-text-search-results",this.ǃrVv)):ǃr.ǃo.ǃrv(this.ǃrVX))}}}"use strict",ǃr.ǃo.ǃsZ.ǃrV$=class extends ǃr.ǃT_{constructor(e,r,t,n,i,o){ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃrnZ),ǃr.ǃVm(r,ǃr.ǃo.ǃVK),ǃr.ǃzg(t),ǃr.ǃ$f(i),ǃr.ǃVm(o,ǃr.ǃo.ǃsZ.ǃrVR),super(),this.ǃrVy=e,this.ǃr$W=r||null,this.ǃUdL=t,this.ǃriY=n,this.ǃSP=!1,this.ǃrVb=o,this.ǃrVS=!1,this.ǃOm=-1,this.ǃOh=0,this.ǃOn=0,this.ǃrsC=null,this.ǃqi=null,this.ǃqi=ǃr.ǃtU(i)?ǃr.ǃo.ǃUd("ui-iconviewitem",this.ǃrVy.ǃUh(),null,null,null,i):ǃr.ǃo.ǃUd("ui-iconviewitem",this.ǃrVb?this.ǃrVb.ǃrVo():this.ǃrVy.ǃUh()),this.ǃUB=ǃr.ǃo.ǃUd("div",this.ǃqi,null,"iconViewItemWrap"),this.ǃjS=ǃr.ǃq(ǃr.ǃo.ǃnI,this.ǃr$W||this.ǃrVy.ǃrhR(),this.ǃUB),this.ǃrnB=ǃr.ǃo.ǃUd("span",this.ǃUB,null,"iconViewItemText"),ǃr.ǃzL(this.ǃrnB,this.ǃUdL),this.ǃSQ=()=>this.ǃrVy.ǃrho(this,"itemdoubletap"),this.ǃqi.addEventListener("UIDoubleTap",this.ǃSQ),this.ǃSZ=(r)=>this.ǃrt(r),this.ǃqi.addEventListener("contextmenu",this.ǃSZ),this.ǃSw=(r)=>this.ǃMe(r),this.ǃqi.addEventListener("UIPointerDown",this.ǃSw),this.ǃOI=(r)=>this.ǃOE(r),this.ǃOC=(r)=>this.ǃMQ(r)}ǃMI(){this.ǃYq(!1),this.ǃqi.removeEventListener("UIPointerDown",this.ǃSw),this.ǃSw=null,this.ǃam().removeEventListener("UIPointerMove",this.ǃOI),this.ǃOI=null,this.ǃam().removeEventListener("UIPointerUp",this.ǃOC),this.ǃOC=null,this.ǃqi.removeEventListener("UIDoubleTap",this.ǃSQ),this.ǃSQ=null,this.ǃqi.removeEventListener("contextmenu",this.ǃSZ),this.ǃSZ=null,ǃr.ǃo.ǃrv(this.ǃrnB),this.ǃrnB=null,this.ǃjS.ǃTq(),this.ǃjS=null,ǃr.ǃo.ǃrv(this.ǃUB),this.ǃUB=null,ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null,this.ǃrVy=null,this.ǃr$W=null,this.ǃriY=null,ǃr.ǃTq(this)}ǃam(){return this.ǃqi.ownerDocument}ǃAt(){return this.ǃam().defaultView}ǃVP(e){ǃr.ǃ$(e,ǃr.ǃo.ǃVK),this.ǃjS.ǃVP(e)}ǃUlq(e){ǃr.ǃ_u(e),this.ǃjS.ǃUlq(e)}ǃUlw(){this.ǃjS.ǃUlw()}ǃMe(r){let e=r.detail;e.ǃnT!==ǃr.ǃGV.ǃxp||(this.ǃrrQ(),this.ǃqi.setAttribute("pointerheld",""),this.ǃam().addEventListener("UIPointerMove",this.ǃOI),this.ǃam().addEventListener("UIPointerUp",this.ǃOC),this.ǃOm=e.id,this.ǃOh=e.clientX,this.ǃOn=e.clientY)}ǃOE(r){let e=r.detail;e.id!==this.ǃOm}ǃMQ(r){let e=r.detail;if(this.ǃqi&&e.id===this.ǃOm){if(this.ǃqi.removeAttribute("pointerheld",""),this.ǃam().removeEventListener("UIPointerMove",this.ǃOI),this.ǃam().removeEventListener("UIPointerUp",this.ǃOC),this.ǃrVy.ǃrho(this,"itemclick"),this.ǃrVy.ǃrhE()){let e=ǃr.ǃke.ǃkQ(),r=ǃr.ǃke.ǃkj(ǃr.ǃrO.ǃMu);if(e)return void this.ǃYq(!this.ǃYa())}this.ǃrVj(e.clientX,e.clientY)&&this.ǃqK()}}ǃqK(){this.ǃYa()&&1===this.ǃrVy.ǃUio()||(this.ǃrVy.ǃYp(),this.ǃYq(!0))}ǃU_j(){this.ǃYq(!1)}ǃYa(){return this.ǃSP}ǃYq(e){e=!!e;this.ǃSP===e||(e?(this.ǃrVy.ǃrho(this,"beforeitemselect"),this.ǃqi.setAttribute("selected",""),this.ǃrVy.ǃrhS(this)):(this.ǃqi.removeAttribute("selected"),this.ǃrVy.ǃrhj(this)),this.ǃSP=e)}ǃUh(){return this.ǃqi}ǃrVf(){return this.ǃrVy}ǃrlv(e){this.ǃriY=e}ǃih(){return this.ǃriY}ǃEf(){return this.ǃrsC}ǃFT(e){ǃr.ǃzg(e);ǃr.ǃUjj(this.ǃUdL,e)||(this.ǃUdL=e,ǃr.ǃzL(this.ǃrnB,this.ǃUdL))}ǃYK(){return this.ǃUdL}ǃol(e){e=!!e;this.ǃrVS===e||(this.ǃrVS=e,this.ǃrVS?(this.ǃYq(!1),this.ǃqi.setAttribute("hidden",""),this.ǃrVb&&this.ǃrVb.ǃrVe(this,!0)):(this.ǃqi.removeAttribute("hidden"),this.ǃrVb&&this.ǃrVb.ǃrVe(this,!1)))}ǃot(){return this.ǃrVS}ǃYl(){ǃr.ǃo.ǃYl(this.ǃqi,this.ǃrVy.ǃUh())}ǃrVE(e){return this.ǃUdL.toLowerCase().includes(e)}ǃrrQ(){this.ǃrsC=this.ǃqi.getBoundingClientRect()}ǃrt(r){this.ǃqK(),this.ǃrVy.ǃfD(this,r)||(r.preventDefault(),r.stopPropagation())}ǃrVj(e,r){if(ǃr.ǃ$t(e),ǃr.ǃ$t(r),!this.ǃrsC)return!1;let t=this.ǃrsC;return e>=t.left&&r>=t.top&&e{if(b=-1,!U)return;let s=U.ǃUh(),T=U.ǃEf(),l=T.width,u=T.height,c=r-T.left,v=t-T.top,p=0,m=0;g&&(c<=i||c>=l-i)&&(c<=i?p=-n(c-i):c>=l-i&&(p=n(c-(l-i)))),y&&(v<=i||v>=u-i)&&(v<=i?m=-n(v-i):v>=u-i&&(m=n(v-(u-i)))),(0!==p||0!==m)&&(0!==p&&0!==m&&(p/=o,m/=o),0!==p&&(s.scrollLeft+=p/ǃr.ǃo.devicePixelRatio),0!==m&&(s.scrollTop+=m/ǃr.ǃo.devicePixelRatio),U.ǃrVk(),e(d,a))}))}function r(r){var t=Math.abs;d=r.detail.clientX,a=r.detail.clientY;let i=t(s-d),o=t(T-a);if(!(i*i+o*o=t.left&&r>=t.top&&e=t.left&&e<=t.left+t.width/2?"left":"right"}ǃrVw(){let e=this.ǃUh();e.removeAttribute("drop-target"),e.removeAttribute("hit-side")}static ǃrVK(e,r){if(ǃr.ǃ$t(e),ǃr.ǃ$t(r),l){let t=-m+e-h-p.width/2,n=-f+r-h-p.height/2,i=ǃr.ǃUyE(l,"dialog");if(i){let e=ǃr.ǃo.ǃS.ǃrJB(i);t-=e.ǃtd(),n-=e.ǃtc()}l.style.transform=`translateX(${t}px) translateY(${n}px)`}}static ǃrpr(e){ǃr.ǃIO(e);let r=ǃr.ǃo.ǃUrM(["border-width","border-left-width","border-right-width","border-bottom-width","border-top-width"],{ǃfk:e});if(!r.endsWith("px"))throw new Error("CSS style for menu border-width must be in units of 'px'");return parseFloat(r)||0}static ǃrVN(e,r){ǃr.ǃk(e);let t=new ǃr.Event(e);t.item=r,r.ǃrVf().dispatchEvent(t)}static ǃrVQ(e,r,t){ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃ$(t,ǃr.ǃo.ǃsZ.ǃrV$);let n=new ǃr.Event("itemsorted");n.ǃrpT=e,n.ǃrpv=r,n.item=t,t.ǃrVf().dispatchEvent(n)}}}"use strict",ǃr.ǃo.ǃsZ.ǃrVR=class extends ǃr.ǃT_{constructor(e,r){ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃrnZ),ǃr.ǃk(r),super(),this.ǃrVy=e,this.ǃrUm=r,this.ǃe_=ǃr.ǃo.ǃUd("div",this.ǃrVy.ǃUh(),null,"iconview-group"),this.ǃe$=ǃr.ǃo.ǃUd("div",this.ǃe_,null,"iconview-grouptitle"),this.ǃKd=ǃr.ǃo.ǃUd("span",this.ǃe$,null,"iconview-groupname"),this.ǃrpJ=ǃr.ǃo.ǃUd("span",this.ǃe$,null,"iconview-grouprule"),this.ǃrpL=ǃr.ǃo.ǃUd("div",this.ǃe_,null,"iconview-groupcontent"),this.ǃrVr=[],this.ǃrps=0,this.ǃrVS=!1,this.ǃKd.textContent=this.ǃrUm}ǃrVo(){return this.ǃrpL}ǃMI(){ǃr.ǃXk(this.ǃrVr),ǃr.ǃo.ǃrv(this.ǃrpL),this.ǃrpL=null,ǃr.ǃo.ǃrv(this.ǃrpJ),this.ǃrpJ=null,ǃr.ǃo.ǃrv(this.ǃKd),this.ǃKd=null,ǃr.ǃo.ǃrv(this.ǃe$),this.ǃe$=null,ǃr.ǃo.ǃrv(this.ǃe_),this.ǃe_=null,this.ǃrVy=null,ǃr.ǃTq(this)}ǃrz(e,r,t,n){let i=this.ǃrVy.ǃrz(e,r,t,n,this);return this.ǃrVr.push(i),i}ǃrVe(e,r){ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃrV$),r=!!r,r?this.ǃrps++:this.ǃrps--,this.ǃol(this.ǃrps===this.ǃrVr.length)}ǃol(e){e=!!e;this.ǃrVS===e||(this.ǃrVS=e,ǃr.ǃo.ǃbL(this.ǃe_,"hidden",this.ǃrVS))}ǃot(){return this.ǃrVS}},"use strict";{const e={wrap:!0};ǃr.ǃo.ǃJK=class extends ǃr.Event.ǃUU{constructor(r,t){ǃr.ǃIO(r),ǃr.ǃMd(t),super(),t=Object.assign({},e,t),this.ǃrJT=r,this.ǃrpX=[],this.ǃrpi=new Map,this.ǃrp_=!1,this.ǃrpl=null,this.ǃMH=t,this.ǃrJT.style.display="flex"}ǃTq(){for(let e=0;e{ǃr.ǃo.ǃrv(r)}),Array.prototype.forEach.call(this.ǃrJT.getElementsByTagName("ui-toolbar-container"),(r)=>{ǃr.ǃo.ǃrv(r)}),this.ǃrJT.style.display="",this.ǃrJT=null,this.ǃrpX=null,this.ǃrpl=null,this.ǃrpi=null,super.ǃTq()}ǃmM(){return this.ǃrpl}ǃW_(){if(!this.ǃrJT)throw new Error("missing parent element");let e=this.ǃrJT.querySelector("ui-toolbar-container[level='0']");if(!e)throw new Error("missing root container element");return e}ǃLT(e,r,t){ǃr.ǃk(e),ǃr.ǃ$t(r),ǃr.ǃre(t);let n=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrp$,this,this.ǃrJT,e,r,"horizontal","required",this.ǃMH);return this.ǃrpX.push(n),this.ǃrp_=!0,this.ǃrpf(n,t),n}ǃrpz(e,r,t){ǃr.ǃk(e),ǃr.ǃ$t(r),ǃr.ǃre(t);let n=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrp$,this,this.ǃrJT,e,r,"vertical","required",this.ǃMH);return this.ǃrpX.push(n),this.ǃrp_=!0,this.ǃrpf(n,t),n}ǃrpF(e,r,t){ǃr.ǃk(e),ǃr.ǃ$t(r),ǃr.ǃre(t);let n=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrp$,this,this.ǃrJT,e,r,"horizontal","optional",this.ǃMH);this.ǃrpi.set(e,n),this.ǃrpf(n,t)}ǃrpm(e,r,t){ǃr.ǃk(e),ǃr.ǃ$t(r),ǃr.ǃre(t);let n=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃrp$,this,this.ǃrJT,e,r,"vertical","optional",this.ǃMH);this.ǃrpi.set(e,n),this.ǃrpf(n,t)}ǃrph(e,r){ǃr.ǃk(e),r=!!r;let t=this.ǃrpi.get(e);if(assert(t,"optional toolbar is not present in this toolbar layout"),r){if(-1!==this.ǃrpX.indexOf(t))return;this.ǃrpX.push(t)}else{if(-1===this.ǃrpX.indexOf(t))return;this.ǃrpX.splice(this.ǃrpX.indexOf(t),1)}t.ǃJB(r),this.ǃrp_=!0}ǃrpn(e){e=!!e;for(let r of this.ǃrpi.keys())this.ǃrph(r,e)}ǃrpV(){for(let e=0,r;ethis.ǃIr(r),this.ǃqi.addEventListener("scroll",this.ǃrpZ)),this.ǃJB(!1),this.ǃrBU=0,this.ǃjl=0}ǃTq(){this.ǃqi.removeEventListener("scroll",this.ǃrpZ),this.ǃrpZ=null;for(let e=0;ethis.ǃrFn(r),this.ǃqi=ǃr.ǃo.ǃUd("ui-toolbar-color-picker",this.ǃrBV.ǃUh()),this.ǃrBa=ǃr.ǃo.ǃUd("input",this.ǃqi,null,null,{type:"color"}),this.ǃrBa.addEventListener("change",this.ǃrBY),this.ǃUwD=ǃr.ǃo.ǃUd("span",this.ǃqi),this.ǃUwD.innerHTML=this.ǃrBa.value,this.ǃrBc()}ǃTq(){this.ǃrBa.removeEventListener("change",this.ǃrBY),ǃr.ǃo.ǃrv(this.ǃrBa),ǃr.ǃo.ǃrv(this.ǃUwD),this.ǃrBY=null,this.ǃrBa=null,this.ǃUwD=null,super.ǃTq()}ǃm_(r){ǃr.ǃFX(r),this.ǃrBD(r,e),r.hasOwnProperty("color")&&ǃr.ǃFL(r.color)&&(this.ǃrBa.value=r.color)}ǃtF(){}ǃrpc(){this.ǃrBq()}ǃrBm(){}ǃrFn(){this.ǃUwD.innerHTML=this.ǃrBa.value,this.ǃrBq()}ǃrBq(){let e=new ǃr.Event("colorchange");e.ǃrBA=this.ǃrBV.ǃUAh(),e.ǃrBW=this.ǃUPm.toLowerCase(),e.color=this.ǃrBa.value,this.ǃrBV.ǃrBv().dispatchEvent(e),this.ǃrBH(this.ǃrBa.value)}}}{const e=["min","max","step","value","label"];ǃr.ǃo.ǃsZ.ǃrp$.ǃrBs=class extends ǃr.ǃo.ǃsZ.ǃrp$.Element{constructor(e,r,t,n,i,o,d,a,s){ǃr.ǃ$t(t),ǃr.ǃ$t(n),ǃr.ǃ$t(i),ǃr.ǃ$f(o),ǃr.ǃz(d),super(e,r,a),this.ǃrBG=t,this.ǃrBk=n,this.ǃrBM=i?i:1,this.ǃrBx=o?o:0,this.ǃrBR=this.ǃrBx,this.ǃqi=ǃr.ǃo.ǃUd("ui-toolbar-slider",this.ǃrBV.ǃUh()),this.ǃrBa=ǃr.ǃo.ǃUd("input",this.ǃqi,null,null,{type:"range",min:t.toString(),max:n.toString(),step:this.ǃrBM.toString(),value:this.ǃrBx.toString()}),this.ǃrBg=ǃr.ǃo.ǃUd("input",this.ǃqi,null,null,{type:"number",min:t.toString(),max:n.toString(),step:this.ǃrBM.toString(),value:this.ǃrBa.value.toString()}),this.ǃUwD=ǃr.ǃo.ǃUd("span"),s?(this.ǃUwD.setAttribute("side","right"),this.ǃqi.appendChild(this.ǃUwD)):(this.ǃUwD.setAttribute("side","left"),this.ǃqi.insertBefore(this.ǃUwD,this.ǃrBa)),this.ǃUwD.textContent=d?d:r.charAt(0).toUpperCase()+r.slice(1),this.ǃUx=null,this.ǃrBO=null,this.ǃrBI(),this.ǃrBE(),this.ǃrBc()}ǃTq(){ǃr.ǃo.ǃrv(this.ǃrBa),ǃr.ǃo.ǃrv(this.ǃUwD),ǃr.ǃo.ǃrv(this.ǃrBg),this.ǃUx&&(this.ǃUx.ǃrU(),this.ǃUx=null),this.ǃrBO&&(this.ǃrBO.ǃrU(),this.ǃrBO=null),this.ǃrBa=null,this.ǃUwD=null,this.ǃrBg=null,super.ǃTq()}ǃm_(r){if(ǃr.ǃFX(r),this.ǃrBD(r,e),r.hasOwnProperty("min")&&ǃr.ǃtU(r.min)&&(this.ǃrBG=r.min,this.ǃrBa.min=this.ǃrBG.toString(),this.ǃrBg.min=this.ǃrBG.toString()),r.hasOwnProperty("max")&&ǃr.ǃtU(r.max)&&(this.ǃrBk=r.max,this.ǃrBa.max=this.ǃrBk.toString(),this.ǃrBg.max=this.ǃrBG.toString()),r.hasOwnProperty("step")&&ǃr.ǃtU(r.step)&&(this.ǃrBM=r.step,this.ǃrBa.step=r.step.toString(),this.ǃrBg.step=r.step.toString()),r.hasOwnProperty("value")&&ǃr.ǃtU(r.value)){let e=r.value.toString();this.ǃrBa.value=e,this.ǃrBg.value=e}r.hasOwnProperty("label")&&ǃr.ǃFL(r.label)&&(this.ǃrBa.label=r.label)}ǃtF(){}ǃrpc(){this.ǃrBC("sliderchange")}ǃrBm(){}ǃrBI(){this.ǃUx=ǃr.ǃq(ǃr.ǃUR,ǃr.ǃUl.ǃrY(this.ǃrBa,"input change",(r)=>this.ǃrBy(r)),ǃr.ǃUl.ǃrY(this.ǃrBg,"keypress",(r)=>this.ǃrBb(r)),ǃr.ǃUl.ǃrY(this.ǃrBg,"change input",(r)=>this.ǃrBS(r)),ǃr.ǃUl.ǃrY(this.ǃrBg,"blur",()=>this.ǃrhh()))}ǃrBE(){this.ǃrBO=ǃr.ǃUuT(this.ǃrBg)}ǃrBy(e){this.ǃrBg.value=this.ǃrBa.value,this.ǃrBR=+this.ǃrBa.value,"change"===e.type&&this.ǃrBC("sliderchange"),"input"===e.type&&this.ǃrBC("sliderinput")}ǃrBb(e){e.key.match(/[0-9.e\-]/)||e.preventDefault()}ǃrBS(){let e=this.ǃrBg.value;if(e.length&&(e=+e,!isNaN(e))){let r=this.ǃrBo(),t=this.ǃrBj();if((e>t||ethis.ǃrBy(r)),ǃr.ǃUl.ǃrY(this.ǃrBg,"keypress",(r)=>this.ǃrBb(r)),ǃr.ǃUl.ǃrY(this.ǃrBg,"change input",(r)=>this.ǃrBS(r)))}ǃrBQ(e){ǃr.ǃre(e),assert(e.length,"no steps defined for the step slider"),ǃr.ǃXk(this.ǃrBw);let t=0;for(var n=0;n=i.ǃrdT,"percentage slice of a step can not be larger than 100%"),assert(0t||et||n=r.ǃrdv&&e<=r.ǃrdJ)return r}ǃrdi(){let e=this.ǃrBg.value;for(let r of this.ǃrBw)if(e>=r.ǃrBZ&&e<=r.ǃrBu)return r}ǃrd_(e){for(let r=0,t;rthis.ǃrdh(r),this.ǃMW=(r)=>this.ǃrdn(r),this.ǃrdV=()=>{},this.ǃrdp=(r)=>this.ǃrdB(r),this.ǃrdd=(r)=>this.ǃrdc(r)),"check"===o&&(this.ǃMq=(r)=>this.ǃrdH(r),this.ǃMW=()=>{},this.ǃrdV=(r)=>this.ǃrdD(r),this.ǃrdp=(r)=>this.ǃrdY(r),this.ǃrdd=(r)=>this.ǃrda(r)),this.ǃrdq=(r)=>this.ǃrt(r),this.ǃrdA=(r)=>this.ǃrdW(r),this.ǃqi.addEventListener("UIPointerDown",this.ǃMq),this.ǃqi.addEventListener("UIPointerUp",this.ǃMW),this.ǃqi.addEventListener("UIPointerUp",this.ǃrdV),this.ǃqi.addEventListener("contextmenu",this.ǃrdq),this.ǃqi.addEventListener("mouseout",this.ǃrdp),this.ǃqi.addEventListener("mouseover",this.ǃrdd),this.ǃrBc()}ǃTq(){this.ǃqi.removeEventListener("UIPointerDown",this.ǃMq),this.ǃqi.removeEventListener("UIPointerUp",this.ǃMW),this.ǃqi.removeEventListener("UIPointerUp",this.ǃrdV),this.ǃqi.removeEventListener("mouseout",this.ǃrdp),this.ǃqi.removeEventListener("mouseover",this.ǃrdd),ǃr.ǃo.ǃrv(this.ǃqi),this.ǃjS.ǃTq(),this.ǃjS=null,this.ǃMq=null,this.ǃMW=null,this.ǃrdp=null,this.ǃrdd=null,clearTimeout(this.ǃrdf),this.ǃrdf=-1,clearTimeout(this.ǃrdz),this.ǃrdz=-1,super.ǃTq()}ǃm_(r){ǃr.ǃFX(r),this.ǃrBD(r,e)}ǃtF(){this.ǃqi.removeAttribute("mouse-down"),this.ǃqi.removeAttribute("mouse-over"),this.ǃrdt&&!this.ǃrdF&&(this.ǃrdt=!1,this.ǃqi.addEventListener("UIPointerUp",this.ǃMW),this.ǃqi.addEventListener("mouseout",this.ǃrdp),this.ǃqi.addEventListener("mouseover",this.ǃrdd)),clearTimeout(this.ǃrdf),this.ǃrdf=-1,clearTimeout(this.ǃrdz),this.ǃrdz=-1}ǃrpc(){}ǃrBm(e=!0){if(e=!!e,!this.ǃrdt){if("click"===this.ǃUPe){if(this.ǃrdm)return;this.ǃqi.setAttribute("mouse-down",""),this.ǃrdz=setTimeout(()=>{this.ǃqi.removeAttribute("mouse-down",""),e&&this.ǃrdG(),this.ǃrdm=!1},100),this.ǃrdm=!0}"check"===this.ǃUPe&&this.ǃrdk(e),this.ǃqi.removeEventListener("UIPointerUp",this.ǃMW),this.ǃqi.removeEventListener("mouseout",this.ǃrdp),this.ǃqi.removeEventListener("mouseover",this.ǃrdd)}}ǃmt(e){super.ǃmt(e),e||this.ǃtF()}ǃrBF(e){"check"===this.ǃUPe&&("check"===e?this.ǃrdk(!1):"uncheck"===e?this.ǃtF():void 0)}ǃrdh(e){this.ǃrBV.ǃrBn(),t=e.detail.ǃyF;!t&&e.detail.ǃnT!==ǃr.ǃGV.ǃxp||this.ǃrdm||(this.ǃrd$=!1,this.ǃqi.setAttribute("mouse-down",""))}ǃrdn(e){(t||e.detail.ǃnT===ǃr.ǃGV.ǃxp)&&this.ǃqi.hasAttribute("mouse-down")&&!this.ǃrdm&&(!this.ǃrd$&&!this.ǃrBV.ǃrBh()&&this.ǃrdG(),this.ǃqi.removeAttribute("mouse-down"))}ǃrdB(){t||this.ǃrdm||(this.ǃqi.removeAttribute("mouse-down"),this.ǃqi.removeAttribute("mouse-over"))}ǃrdc(){t||this.ǃrdm||this.ǃqi.setAttribute("mouse-over","")}ǃrdH(e){this.ǃrBV.ǃrBn(),t=e.detail.ǃyF,this.ǃrd$=!1;(t||e.detail.ǃnT===ǃr.ǃGV.ǃxp)&&-1===this.ǃrdf&&(t?this.ǃrdf=setTimeout(this.ǃrdA,1e3):this.ǃrdf=setTimeout(this.ǃrdA,5))}ǃrdD(){-1!==this.ǃrdf&&(clearTimeout(this.ǃrdf),this.ǃrdf=-1,this.ǃrdk())}ǃrdY(){this.ǃqi.removeAttribute("mouse-down"),this.ǃqi.removeAttribute("mouse-over")}ǃrda(){t||this.ǃqi.setAttribute("mouse-over","")}ǃrt(e){e.preventDefault();this.ǃrBV.ǃrBh()||(this.ǃrd$=!0,this.ǃrdM(e))}ǃrdk(e=!0){this.ǃrd$||this.ǃrBV.ǃrBh()||(this.ǃrdF=!0,this.ǃrdt=!this.ǃrdt,e&&this.ǃrdx(),this.ǃrdt?(this.ǃqi.setAttribute("mouse-down",""),this.ǃqi.removeAttribute("mouse-over"),this.ǃqi.removeEventListener("UIPointerUp",this.ǃMW),this.ǃqi.removeEventListener("mouseout",this.ǃrdp),this.ǃqi.removeEventListener("mouseover",this.ǃrdd)):(this.ǃqi.removeAttribute("mouse-down"),!t&&this.ǃqi.setAttribute("mouse-over",""),this.ǃqi.addEventListener("UIPointerUp",this.ǃMW),this.ǃqi.addEventListener("mouseout",this.ǃrdp),this.ǃqi.addEventListener("mouseover",this.ǃrdd)),this.ǃrdF=!1)}ǃrdW(){this.ǃrdk(),this.ǃrdf=-1}ǃrdG(){let e=new ǃr.Event("click");e.ǃrBA=this.ǃrBV.ǃUAh(),e.ǃWY=this.ǃUPm,this.ǃrBV.ǃrBv().dispatchEvent(e),this.ǃrBH()}ǃrdx(){let e=new ǃr.Event("check");e.ǃrBA=this.ǃrBV.ǃUAh(),e.ǃWY=this.ǃUPm,e.checked=this.ǃrdt,this.ǃrBV.ǃrBv().dispatchEvent(e),this.ǃrBH(this.ǃrdt)}ǃrdM(e){let r=new ǃr.Event("buttoncontextmenu");r.ǃrBA=this.ǃrBV.ǃUAh(),r.ǃWY=this.ǃUPm,r.clientX=e.clientX,r.clientY=e.clientY,this.ǃrBV.ǃrBv().dispatchEvent(r)}ǃUh(){return this.ǃqi}}}{const e=["checked"];ǃr.ǃo.ǃsZ.ǃrp$.ǃrB_=class extends ǃr.ǃo.ǃsZ.ǃrp$.Element{constructor(e,r,t,n){ǃr.ǃz(t),super(e,r,n),this.ǃqi=ǃr.ǃo.ǃUd("ui-toolbar-checkbox",this.ǃrBV.ǃUh()),this.ǃrdR=ǃr.ǃo.ǃUd("div",this.ǃqi,null,"checkboxWrapper"),this.ǃrBa=ǃr.ǃo.ǃUd("input",this.ǃrdR,null,null,{type:"checkbox"}),this.ǃrdg=()=>this.ǃrdx(this.ǃrBa.checked),this.ǃrdO=()=>{this.ǃrBm(),this.ǃrdg()},this.ǃUwD=ǃr.ǃo.ǃUd("span",this.ǃqi),this.ǃUwD.innerHTML=t?t:r.charAt(0).toUpperCase()+r.slice(1),this.ǃrBa.addEventListener("change",this.ǃrdg),this.ǃUwD.addEventListener("UIPointerUp",this.ǃrdO),this.ǃqi.style.height=`${this.ǃrBV.ǃr$b()}px`;let i=this.ǃrBV.ǃUVL();i.wrap&&this.ǃqi.setAttribute("wrap","")}ǃTq(){this.ǃrBa.removeEventListener("change",this.ǃrdg),this.ǃUwD.removeEventListener("UIPointerUp",this.ǃrdO),ǃr.ǃo.ǃrv(this.ǃrBa),ǃr.ǃo.ǃrv(this.ǃrdR),ǃr.ǃo.ǃrv(this.ǃUwD),ǃr.ǃo.ǃrv(this.ǃqi),this.ǃrdg=null,this.ǃrBV=null,this.ǃqi=null,this.ǃrdR=null,this.ǃrBa=null,this.ǃUwD=null}ǃm_(r){ǃr.ǃFX(r),this.ǃrBD(r,e),r.hasOwnProperty("checked")&&(this.ǃrBa.checked=!!r.checked)}ǃtF(){}ǃrpc(){this.ǃrdx()}ǃrBm(){this.ǃrBa.checked=!this.ǃrBa.checked}ǃrdx(){let e=new ǃr.Event("checkboxchecked");e.ǃrBA=this.ǃrBV.ǃUAh(),e.ǃrdI=this.ǃUPm,e.checked=this.ǃrBa.checked,this.ǃrBV.ǃrBv().dispatchEvent(e),this.ǃrBH(this.ǃrBa.checked)}}}{const e=["min","max","step","value","label"];ǃr.ǃo.ǃsZ.ǃrp$.ǃrBl=class extends ǃr.ǃo.ǃsZ.ǃrp$.Element{constructor(e,r,t,n,i,o,d,a,s){ǃr.ǃ$f(t),ǃr.ǃ$f(n),ǃr.ǃ$f(i),ǃr.ǃ$f(o),ǃr.ǃz(d),super(e,r,a),this.ǃrBG=t,this.ǃrBk=n,this.ǃrBM=i?i:1,this.ǃrBx=o?o:0,this.ǃrdE=null,this.ǃrdC=!0,this.ǃqM=!1,this.ǃrdy="",this.ǃrdb=!1,this.ǃrdS=!1,this.ǃqi=ǃr.ǃo.ǃUd("ui-toolbar-spinner",this.ǃrBV.ǃUh());let T={};T.type="number",T.step=this.ǃrBM.toString(),T.value=this.ǃrBx.toString(),ǃr.ǃtU(t)&&(T.min=t.toString()),ǃr.ǃtU(n)&&(T.max=n.toString()),this.ǃrdo=T,this.ǃrBa=ǃr.ǃo.ǃUd("input",this.ǃqi,null,null,this.ǃrdo),this.ǃrdj=null,this.ǃrde=null,this.ǃrdN=d||r.charAt(0).toUpperCase()+r.slice(1),this.ǃUwD=document.createElement("span"),this.ǃUwD.textContent=this.ǃrdN,s?this.ǃqi.appendChild(this.ǃUwD):this.ǃqi.insertBefore(this.ǃUwD,this.ǃrBa),this.ǃrdK=(r)=>this.ǃrdP(r),this.ǃrdw=(r)=>this.ǃrdQ(r),this.ǃrdZ=(r)=>this.ǃrdu(r),this.ǃrcU=(r)=>this.ǃrcr(r),this.ǃUx=ǃr.ǃq(ǃr.ǃUR,ǃr.ǃUl.ǃrY(this.ǃrBa,"focus",(r)=>this.ǃrhm(r)),ǃr.ǃUl.ǃrY(this.ǃrBa,"UIPointerDown",(r)=>this.ǃMe(r)),ǃr.ǃUl.ǃrY(this.ǃrBa,"UIPointerUp",(r)=>this.ǃMQ(r)),ǃr.ǃUl.ǃrY(this.ǃrBa,"change",this.ǃrdK),ǃr.ǃUl.ǃrY(this.ǃrBa,"input",this.ǃrdw),ǃr.ǃUuT(this.ǃrBa)),this.ǃrBc()}ǃrcT(){return+this.ǃrBa.value}ǃTq(){this.ǃrcv(),ǃr.ǃo.ǃrv(this.ǃrBa),ǃr.ǃo.ǃrv(this.ǃUwD),this.ǃUx.ǃrU(),this.ǃUx=null,this.ǃrdS=null,this.ǃrde&&this.ǃrde.ǃrU(),this.ǃrde=null,this.ǃrBa=null,this.ǃUwD=null,super.ǃTq()}ǃm_(r){if(ǃr.ǃFX(r),this.ǃrBD(r,e),r.hasOwnProperty("min")&&ǃr.ǃtU(r.min)){let e=r.min;this.ǃrBG=e,this.ǃrdo.min=e.toString(),this.ǃrBa.min=e.toString(),this.ǃrdj&&(this.ǃrdj.min=e.toString())}if(r.hasOwnProperty("max")&&ǃr.ǃtU(r.max)){let e=r.max;this.ǃrBk=e,this.ǃrdo.max=e.toString(),this.ǃrBa.max=e.toString(),this.ǃrdj&&(this.ǃrdj.max=e.toString())}if(r.hasOwnProperty("step")&&ǃr.ǃtU(r.step)){let e=r.step;this.ǃrBM=e,this.ǃrdo.step=e.toString(),this.ǃrBa.step=e.toString(),this.ǃrdj&&(this.ǃrdj.step=e.toString())}if(r.hasOwnProperty("value")&&ǃr.ǃtU(r.value)){let e=r.value;this.ǃrBx=e,this.ǃrdo.value=e.toString(),this.ǃrBa.value=e.toString(),this.ǃrdj&&this.ǃrcJ(e.toString())}r.hasOwnProperty("label")&&ǃr.ǃFL(r.label)&&(this.ǃrdN=r.label,this.ǃUwD.textContent=this.ǃrdN)}ǃtF(){}ǃrpc(){this.ǃrcL("spinnerchange")}ǃrBm(){}ǃrcs(e){ǃr.ǃk(e);this.ǃrdN===e||(this.ǃrdN=e,this.ǃUwD.textContent=e)}ǃrcX(){return this.ǃrdN}ǃMe(){this.ǃrdb=!0,this.ǃrBV.ǃrBn(),this.ǃqM=!0}ǃMQ(){this.ǃqM&&(this.ǃqM=!1,this.ǃrhm(),this.ǃrdj&&this.ǃrdb&&this.ǃrdj.ownerDocument.execCommand("selectAll",!1))}ǃrhm(){this.ǃqM||(this.ǃrdy=this.ǃrBa.value,this.ǃrBa.style.display="none",this.ǃrdo.value=this.ǃrBa.value,this.ǃrdj=ǃr.ǃo.ǃUd("input",this.ǃqi,"spinnerEditInput",null,this.ǃrdo,1),this.ǃrde=ǃr.ǃUuT(this.ǃrdj),this.ǃrdj.addEventListener("change",this.ǃrdK),this.ǃrdj.addEventListener("input",this.ǃrdw),this.ǃrdj.addEventListener("blur",this.ǃrcU),this.ǃrdj.addEventListener("focus",this.ǃrdZ),this.ǃrdj.focus())}ǃrdP(){if(!this.ǃrdS){this.ǃrdj&&this.ǃsN(this.ǃrdj.value),this.ǃrdC=!0;const e=this.ǃrcT(),r=new ǃr.Event("spinnerchange");r.ǃrBA=this.ǃrBV.ǃUAh(),r.ǃFO=this.ǃUPm.toLowerCase(),r.ǃFE=this.ǃrcT(),this.ǃrBV.ǃrBv().dispatchEvent(r),this.ǃrdb=!1}}ǃrdQ(){this.ǃrdS||(this.ǃrdj&&this.ǃsN(this.ǃrdj.value),this.ǃrdC&&(this.ǃrdC=!1,this.ǃrci()),this.ǃrcL("spinnerinput"),this.ǃrdb=!1)}ǃrdu(){this.ǃrdj.value=this.ǃrdy,this.ǃrdj.removeEventListener("focus",this.ǃrdZ)}ǃrcr(){this.ǃrBa.style.display="",this.ǃrBa.value=this.ǃrdj.value,this.ǃsN(this.ǃrdj.value),this.ǃrcv()}ǃrcv(){this.ǃrdj&&(this.ǃrde.ǃrU(),this.ǃrde=null,this.ǃrdj.removeEventListener("change",this.ǃrdK),this.ǃrdj.removeEventListener("input",this.ǃrdw),this.ǃrdj.removeEventListener("focus",this.ǃrdZ),this.ǃrdj.removeEventListener("blur",this.ǃrcU),ǃr.ǃo.ǃrv(this.ǃrdj),this.ǃrdj=null)}ǃsN(e){this.ǃrBa.value=""===e?"0":this.ǃrBG&&+ethis.ǃrBk?this.ǃrBk.toString():e}ǃrcJ(e){if(this.ǃrdj){let r=this.ǃrdj.ownerDocument;this.ǃrdS=!0,r.execCommand("selectAll",!1),r.execCommand("delete",!1),r.execCommand("insertText",!1,e),this.ǃrdS=!1}}ǃrci(){let e=new ǃr.Event("firstspinnerinput");e.ǃrBA=this.ǃrBV.ǃUAh(),e.ǃFO=this.ǃUPm.toLowerCase(),e.ǃFE=this.ǃrcT(),this.ǃrBV.ǃrBv().dispatchEvent(e)}ǃrcL(e){ǃr.ǃk(e);let r=this.ǃrcT();if(r!==this.ǃrdE){let t=new ǃr.Event(e);t.ǃrBA=this.ǃrBV.ǃUAh(),t.ǃFO=this.ǃUPm.toLowerCase(),t.ǃFE=this.ǃrcT(),this.ǃrdE=r,this.ǃrBV.ǃrBv().dispatchEvent(t),this.ǃrBH(this.ǃrcT())}}}}{const e=["value","label"];ǃr.ǃo.ǃsZ.ǃrp$.ǃrBt=class extends ǃr.ǃo.ǃsZ.ǃrp$.Element{constructor(e,r,t,n,i,o){ǃr.ǃz(n),ǃr.ǃz(t),super(e,r,i),this.ǃrdC=!0,this.ǃqi=ǃr.ǃo.ǃUd("ui-toolbar-textbox",this.ǃrBV.ǃUh());({}).type="text",this.ǃrBa=document.createElement("input"),this.ǃrBa.type="text",this.ǃqi.appendChild(this.ǃrBa),this.ǃUwD=document.createElement("span"),o?this.ǃqi.insertBefore(this.ǃUwD,this.ǃrBa):this.ǃqi.appendChild(this.ǃUwD),this.ǃUx=ǃr.ǃUl.ǃrY(this.ǃrBa,"input",(r)=>this.ǃrc_(r)),this.ǃUwD.innerHTML=n?n:r.charAt(0).toUpperCase()+r.slice(1),this.ǃrBc()}ǃmW(){return this.ǃrBa.value}ǃmm(e){ǃr.ǃk(e),this.ǃrBa.value=e}ǃTq(){ǃr.ǃo.ǃrv(this.ǃrBa),ǃr.ǃo.ǃrv(this.ǃUwD),this.ǃUx.ǃrU(),this.ǃUx=null,this.ǃrBa=null,this.ǃUwD=null,super.ǃTq()}ǃm_(r){ǃr.ǃFX(r),this.ǃrBD(r,e),r.hasOwnProperty("value")&&ǃr.ǃFL(r.value)&&(this.ǃrBa.value=r.value.toString()),r.hasOwnProperty("label")&&ǃr.ǃFL(r.label)&&(this.ǃrBa.label=r.label)}ǃtF(){}ǃrpc(){this.ǃrc_()}ǃrBm(){}ǃrc_(){let e=new ǃr.Event("textinput");e.ǃrBA=this.ǃrBV.ǃUAh(),e.ǃrcl=this.ǃUPm.toLowerCase(),e.ǃrct=this.ǃmW(),this.ǃrBV.ǃrBv().dispatchEvent(e),this.ǃrBH(this.ǃmW())}}}{const e=["value","label","values"];ǃr.ǃo.ǃsZ.ǃrp$.ǃrB$=class extends ǃr.ǃo.ǃsZ.ǃrp$.Element{constructor(e,r,t,n,i,o){ǃr.ǃz(n),ǃr.ǃre(t),super(e,r,i),this.ǃrdC=!0,this.ǃqi=ǃr.ǃo.ǃUd("ui-toolbar-dropdown",this.ǃrBV.ǃUh());({}).type="text",this.ǃrBa=document.createElement("select"),this.ǃqi.appendChild(this.ǃrBa),this.ǃMH=new Map;for(let d of t){let e=document.createElement("option");this.ǃrBa.appendChild(e),this.ǃMH.set(d.value,e),e.value=d.value,e.textContent=d.label,d.selected&&e.setAttribute("selected",""),d.disabled&&e.setAttribute("disabled","")}this.ǃUwD=document.createElement("span"),o?this.ǃqi.insertBefore(this.ǃUwD,this.ǃrBa):this.ǃqi.appendChild(this.ǃUwD),this.ǃUx=ǃr.ǃUl.ǃrY(this.ǃrBa,"change",(r)=>this.ǃrc_(r)),this.ǃUwD.innerHTML=n?n:r.charAt(0).toUpperCase()+r.slice(1),this.ǃrBc()}ǃmW(){return this.ǃrBa.value}ǃrc$(e){ǃr.ǃ$t(e),this.ǃrBa.selectedIndex=e}ǃrcf(e){ǃr.ǃk(e),this.ǃrBa.value=e}ǃTq(){ǃr.ǃo.ǃrv(this.ǃrBa),ǃr.ǃo.ǃrv(this.ǃUwD),this.ǃUx.ǃrU(),this.ǃUx=null,this.ǃrBa=null,this.ǃUwD=null,super.ǃTq()}ǃm_(r){if(ǃr.ǃFX(r),this.ǃrBD(r,e),r.hasOwnProperty("value")&&ǃr.ǃFL(r.value)&&(this.ǃrBa.value=r.value.toString()),r.hasOwnProperty("label")&&ǃr.ǃFL(r.label)&&(this.ǃrBa.label=r.label),r.hasOwnProperty("values")&&ǃr.ǃFJ(r.values)){for(;this.ǃrBa.firstChild;)this.ǃrBa.removeChild(this.ǃrBa.firstChild);let e=r.values;for(let r of e){let e=document.createElement("option");this.ǃrBa.appendChild(e),this.ǃMH.set(r.value,e),e.value=r.value,e.textContent=r.label,r.selected&&e.setAttribute("selected",""),r.disabled&&e.setAttribute("disabled","")}}}ǃtF(){}ǃrpc(){this.ǃrc_()}ǃrBm(){}ǃrc_(){let e=new ǃr.Event("optionselected");e.ǃrBA=this.ǃrBV.ǃUAh(),e.ǃrcz=this.ǃUPm.toLowerCase(),e.ǃrcF=this.ǃmW(),this.ǃrBV.ǃrBv().dispatchEvent(e),this.ǃrBH(this.ǃmW())}}}{const e=[];let r=!1;ǃr.ǃo.ǃsZ.ǃrp$.ǃrBJ=class extends ǃr.ǃo.ǃsZ.ǃrp$.Element{constructor(e,r,t,n,i,o,d){ǃr.ǃ$(t,ǃr.ǃo.ǃVK),ǃr.ǃz(n),ǃr.ǃz(i),ǃr.ǃzO(d),super(e,r,o),this.ǃrcm=d,this.ǃrd$=!1,this.ǃqi=ǃr.ǃo.ǃUd("ui-toolbar-split-button",this.ǃrBV.ǃUh()),this.ǃqi.style.height=`${this.ǃrBV.ǃr$b()}px`,this.ǃqi.setAttribute("type","split"),this.ǃrch=ǃr.ǃo.ǃUd("div",this.ǃqi),this.ǃrcn=ǃr.ǃo.ǃUd("div",this.ǃqi),this.ǃrch.setAttribute("primary",""),this.ǃrcn.setAttribute("secondary",""),n&&this.ǃrch.setAttribute("title",n),i&&this.ǃrcn.setAttribute("title",i),this.ǃrcV=ǃr.ǃq(ǃr.ǃo.ǃnI,t,this.ǃrch),this.ǃrcp=ǃr.ǃo.ǃUd("div",this.ǃrcn,null,"arrow"),this.ǃqi.style.setProperty("--arrow-size",`${app.ǃRK()/2}px`),this.ǃqi.style.setProperty("--arrow-color",app.ǃrfl()),this.ǃUx=ǃr.ǃq(ǃr.ǃUR,ǃr.ǃUl.ǃrY(this.ǃrch,"UIPointerDown",(r)=>this.ǃMe(r)),ǃr.ǃUl.ǃrY(this.ǃrch,"UIPointerUp",(r)=>this.ǃMQ(r)),ǃr.ǃUl.ǃrY(this.ǃrch,"contextmenu",(r)=>this.ǃrt(r)),ǃr.ǃUl.ǃrY(this.ǃrch,"mouseout",(r)=>this.ǃrcB(r)),ǃr.ǃUl.ǃrY(this.ǃrch,"mouseover",(r)=>this.ǃrcd(r)),ǃr.ǃUl.ǃrY(this.ǃrcn,"UIPointerDown",(r)=>this.ǃMe(r)),ǃr.ǃUl.ǃrY(this.ǃrcn,"UIPointerUp",(r)=>this.ǃMQ(r)),ǃr.ǃUl.ǃrY(this.ǃrcn,"contextmenu",(r)=>this.ǃrt(r)),ǃr.ǃUl.ǃrY(this.ǃrcn,"mouseout",(r)=>this.ǃrcB(r)),ǃr.ǃUl.ǃrY(this.ǃrcn,"mouseover",(r)=>this.ǃrcd(r)),ǃr.ǃUl.ǃrY(app,"settingschange",(r)=>this.ǃrcc(r))),this.ǃrBc()}ǃTq(){this.ǃUx.ǃrU(),this.ǃUx=null,this.ǃrcV.ǃTq(),this.ǃrcV=null,ǃr.ǃo.ǃrv(this.ǃrcp),this.ǃrcp=null,ǃr.ǃo.ǃrv(this.ǃrch),this.ǃrch=null,ǃr.ǃo.ǃrv(this.ǃrcn),this.ǃrcn=null,super.ǃTq()}ǃm_(r){ǃr.ǃFX(r),this.ǃrBD(r,e)}ǃmt(e){super.ǃmt(e),e||this.ǃtF()}ǃFy(e,r){ǃr.ǃz(e),ǃr.ǃz(r),e&&this.ǃrch.setAttribute("title",e),r&&this.ǃrcn.setAttribute("title",r)}ǃtF(){this.ǃrch.removeAttribute("mouse-down"),this.ǃrch.removeAttribute("mouse-down-light"),this.ǃrch.removeAttribute("mouse-over"),this.ǃrcn.removeAttribute("mouse-down"),this.ǃrcn.removeAttribute("mouse-down-light"),this.ǃrcn.removeAttribute("mouse-over")}ǃrpc(){}ǃrBm(){this.ǃrch.setAttribute("mouse-down",""),this.ǃrch.removeAttribute("mouse-down-light"),this.ǃrcn.removeAttribute("mouse-down",""),this.ǃrcn.removeAttribute("mouse-down-light"),this.ǃrcH()}ǃrcD(){this.ǃqi.setAttribute("type","single"),this.ǃqi.style.width=`${this.ǃrBV.ǃr$b()}px`,this.ǃqi.style.padding="",this.ǃrcn.setAttribute("hide","")}ǃrcY(){this.ǃqi.setAttribute("type","split"),this.ǃqi.style.width="",this.ǃqi.style.padding="",this.ǃrcn.removeAttribute("hide")}ǃrca(){this.ǃqi.setAttribute("type","wide"),this.ǃqi.style.width="",this.ǃqi.style.padding=`0 ${app.ǃRK()/4+1}px`,this.ǃrcn.setAttribute("hide","")}ǃMe(e){this.ǃrBV.ǃrBn(),r=e.detail.ǃyF;(r||e.detail.ǃnT===ǃr.ǃGV.ǃxp)&&(this.ǃrd$=!1,this.ǃqi.setAttribute("mouse-down",""),e.target===this.ǃrch&&(this.ǃrch.setAttribute("mouse-down",""),this.ǃrcn.removeAttribute("mouse-down")),e.target===this.ǃrcn&&(this.ǃrch.removeAttribute("mouse-down"),this.ǃrcn.setAttribute("mouse-down","")))}ǃMQ(e){(r||e.detail.ǃnT===ǃr.ǃGV.ǃxp)&&this.ǃqi.hasAttribute("mouse-down")&&(!this.ǃrd$&&!this.ǃrBV.ǃrBh()&&(e.target===this.ǃrch&&this.ǃrcH(e),e.target===this.ǃrcn&&this.ǃrcq(e)),this.ǃqi.removeAttribute("mouse-down"),this.ǃrch.removeAttribute("mouse-down"),this.ǃrch.removeAttribute("mouse-down-light"),this.ǃrcn.removeAttribute("mouse-down"),this.ǃrcn.removeAttribute("mouse-down-light"))}ǃrcB(){r||(this.ǃqi.removeAttribute("mouse-down"),this.ǃrch.removeAttribute("mouse-down"),this.ǃrcn.removeAttribute("mouse-down"),this.ǃqi.removeAttribute("mouse-over"),this.ǃrch.removeAttribute("mouse-over"),this.ǃrcn.removeAttribute("mouse-over"))}ǃrcd(e){r||(this.ǃqi.setAttribute("mouse-over",""),e.target===this.ǃrch&&(this.ǃrch.setAttribute("mouse-over",""),this.ǃrcn.setAttribute("mouse-over-light",""),this.ǃrch.removeAttribute("mouse-over-light",""),this.ǃrcn.removeAttribute("mouse-over")),e.target===this.ǃrcn&&(this.ǃrch.setAttribute("mouse-over-light",""),this.ǃrcn.setAttribute("mouse-over",""),this.ǃrch.removeAttribute("mouse-over"),this.ǃrcn.removeAttribute("mouse-over-light")))}ǃrt(e){e.preventDefault();this.ǃrBV.ǃrBh()||(this.ǃrd$=!0,this.ǃrdM(e))}ǃrcc(){this.ǃqi.style.setProperty("--arrow-color",app.ǃrfl())}ǃrcH(e){let r=new ǃr.Event("primaryclick");r.ǃrBA=this.ǃrBV.ǃUAh(),r.ǃWY=this.ǃUPm,r.clientX=e?e.detail.clientX:0,r.clientY=e?e.detail.clientY:0,this.ǃrBV.ǃrBv().dispatchEvent(r),this.ǃrBH()}ǃrcq(e){let r=new ǃr.Event("secondaryclick");r.ǃrBA=this.ǃrBV.ǃUAh(),r.ǃWY=this.ǃUPm,r.clientX=e.detail.clientX,r.clientY=e.detail.clientY,this.ǃrBV.ǃrBv().dispatchEvent(r),this.ǃrcm&&this.ǃrcm()}ǃrdM(e){let r=new ǃr.Event("splitbuttoncontextmenu");r.ǃrBA=this.ǃrBV.ǃUAh(),r.ǃWY=this.ǃUPm,r.clientX=e.detail.clientX,r.clientY=e.detail.clientY,this.ǃrBV.ǃrBv().dispatchEvent(r)}}}{ǃr.ǃo.ǃsZ.ǃrcA=class extends ǃr.Event.ǃUU{constructor(){super(),this.ǃqi=null,this.ǃrcW=[],this.ǃrcG=-1,this.ǃrck=()=>this.ǃrcM()}ǃTq(){ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null;for(let e of this.ǃrcW)e.ǃTq();ǃr.ǃXk(this.ǃrcW),-1=100)throw new Error("too much content added to status indicator");if(this.ǃrcW.includes(e))throw new Error("already added");this.ǃrcW.push(e),this.ǃrcR()}ǃrcg(e){let r=this.ǃrcW.indexOf(e);if(0>r)throw new Error("content not added to status indicator");this.ǃrcW.splice(r,1),this.ǃrcR()}ǃrcR(){-1"),e+=this.ǃrcW[r].ǃrcO();ǃr.ǃzL(this.ǃqi,new ǃr.ǃUy_(e))}else this.ǃrfD(!1)}ǃrfD(e){e=!!e;!!this.ǃqi===e||(e?(this.ǃqi=ǃr.ǃo.ǃUd("ui-statusIndicator",document.body),this.ǃqi.setAttribute("role","status")):(ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null))}}}"use strict",ǃr.ǃo.ǃsZ.ǃrcI=class{constructor(e,r){ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃrcA),ǃr.ǃk(r),this.ǃrcE=e,this.ǃrcC=r,this.ǃr$s=0}ǃTq(){0=this.ǃr$s)throw new Error("removed too many times");this.ǃr$s--,0===this.ǃr$s?this.ǃrcE.ǃrcg(this):this.ǃrcE.ǃrcR()}ǃrcO(){return ǃr.ǃUje(this.ǃrcC,this.ǃr$s)}},"use strict",ǃr.ǃo.ǃsZ.ǃrcy=class{constructor(e,r){ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃrcA),ǃr.ǃk(r),this.ǃrcE=e,this.ǃrcC=r,this.ǃrcb=0,this.ǃcD=!1}ǃTq(){this.ǃcD&&(this.ǃrcE.ǃrcg(this),this.ǃcD=!1),this.ǃrcE=null}ǃrcS(e){ǃr.ǃ$t(e),e=ǃr.ǃsP(e,0,1),this.ǃcD||(this.ǃrcE.ǃrcx(this),this.ǃcD=!0);this.ǃrcb===e||(this.ǃrcb=e,this.ǃrcE.ǃrcR())}ǃQj(){this.ǃcD&&(this.ǃrcE.ǃrcg(this),this.ǃcD=!1,this.ǃrcb=0)}ǃrcO(){return ǃr.ǃUje(this.ǃrcC,Math.round(1e3*this.ǃrcb)/10)}},"use strict",ǃr.ǃo.ǃsZ.ǃrco=class{constructor(e,r){ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃrcA),ǃr.ǃk(r),this.ǃrcE=e,this.ǃUdL=r,this.ǃcD=!1}ǃTq(){this.ǃcD&&(this.ǃrcE.ǃrcg(this),this.ǃcD=!1),this.ǃrcE=null}ǃvS(){this.ǃcD||(this.ǃrcE.ǃrcx(this),this.ǃcD=!0)}ǃFT(e){ǃr.ǃk(e),this.ǃvS();this.ǃUdL===e||(this.ǃUdL=e,this.ǃrcE.ǃrcR())}ǃrcO(){return this.ǃUdL}},"use strict";{const e=[{opacity:"1"},{opacity:"0"}],r=[{transform:"scale(0.85)",opacity:"0"},{transform:"scale(1)",opacity:"1"}],t={duration:100,easing:"ease-out"},n={ǃUYE:1e4,maxWidth:"300px",align:"center",clientX:null,clientY:null},i=5,o=new Set(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]);let d=null;ǃr.ǃo.ǃsZ.ǃyy=class extends ǃr.ǃT_{constructor(e,i,a,s,T){var l=Number.isFinite;ǃr.ǃt_(e,HTMLElement,Range),ǃr.ǃzg(a),ǃr.ǃzg(s),ǃr.ǃVg(T),super(),"string"==typeof i&&(i=app.ǃvL(i)),ǃr.ǃVm(i,ǃr.ǃo.ǃVK),this.ǃrcj=e,this.ǃrce=a,this.ǃrcN=s,this.ǃ_a=!1,T=Object.assign({},n,T),ǃr.ǃk(T.maxWidth),ǃr.ǃ$t(T.ǃUYE),ǃr.ǃk(T.align),ǃr.ǃ$f(T.clientX),ǃr.ǃ$f(T.clientY);let u=T.clientX,U=T.clientY,c=l(u)&&l(U);if(!o.has(T.align))throw new Error("invalid alignment");d&&d.ǃrcK(),d=this,this.ǃrcP=T.maxWidth,this.ǃrcw=T.ǃUYE,this.ǃrcQ=T.align,this.ǃqi=null,this.ǃrcZ=-1,this.ǃSw=()=>this.ǃMe(),this.ǃrcu=!1;let v=this.ǃrcj;v instanceof Range&&(v=this.ǃrcj.commonAncestorContainer);let p=ǃr.ǃUyE(v,"dialog"),m=0,f=0;if(p){let e=ǃr.ǃo.ǃS.ǃrJB(p);e.ǃrJm()||(m=e.ǃrLh(),f=e.ǃrLn()),this.ǃqi=ǃr.ǃo.ǃUd("ui-balloontip",p)}else m=0,f=0,this.ǃqi=ǃr.ǃo.ǃUd("ui-balloontip",v.ownerDocument.body);this.ǃrHU=ǃr.ǃo.ǃUd("ui-balloontip-icon",this.ǃqi),this.ǃrHr=ǃr.ǃo.ǃUd("ui-balloontip-text",this.ǃqi),this.ǃN$=ǃr.ǃq(ǃr.ǃo.ǃnI,i||app.ǃvJ()),this.ǃrHU.appendChild(this.ǃN$.ǃUh()),this.ǃe$=ǃr.ǃo.ǃUd("ui-balloontip-title",this.ǃrHr),this.ǃHP=ǃr.ǃo.ǃUd("ui-balloontip-body",this.ǃrHr),ǃr.ǃzL(this.ǃe$,this.ǃrce),ǃr.ǃzL(this.ǃHP,this.ǃrcN),this.ǃe$.style.maxWidth=this.ǃrcP,this.ǃHP.style.maxWidth=this.ǃrcP;let h=this.ǃrHU.getBoundingClientRect(),g=this.ǃrHr.getBoundingClientRect();this.ǃqi.style.width=`${h.width+g.width}px`;let y=this.ǃrcj.getBoundingClientRect(),b=0,L=0;switch(this.ǃrcQ){case"top-left":b=0,L=0;break;case"top":b=y.width/2,L=0;break;case"top-right":b=y.width,L=0;break;case"left":b=0,L=y.height/2;break;case"center":b=y.width/2,L=y.height/2;break;case"right":b=y.width,L=y.height/2;break;case"bottom-left":b=0,L=y.height;break;case"bottom":b=y.width/2,L=y.height;break;case"bottom-right":b=y.width,L=y.height;break;default:throw new Error("invalid alignment");}let E=y.left+b,k=y.top+L;c&&(E=u-m,k=U-f);let w=this.ǃqi.ownerDocument.defaultView.getComputedStyle(this.ǃqi);const x=parseInt(w.getPropertyValue("--balloontip-padding"));let $=x,S=x,q=E-2*$-m,C=k+S-f,I=this.ǃqi.ownerDocument.defaultView.getComputedStyle(this.ǃqi),O=parseInt(I.width),P=parseInt(I.height),z=O+4*$,_=P+4*S;this.ǃrHT=ǃr.ǃo.ǃsZ.ǃyy.ǃrHv(),this.ǃrHT.setAttributeNS(null,"width",z),this.ǃrHT.setAttributeNS(null,"height",_),this.ǃqi.style.setProperty("--balloontip-left",`${-$}px`),this.ǃqi.style.setProperty("--balloontip-top",`${-S}px`),this.ǃrHJ=this.ǃrHT.querySelector(".balloontipPath"),this.ǃqi.insertBefore(this.ǃrHT,this.ǃrHU);let W=null;if(this.ǃrHL(q+2*$,O-$,m))this.ǃrHs(C+S,P,f)?(this.ǃqi.style.top=`${C}px`,this.ǃqi.style.left=`${q}px`,this.ǃqi.style.transformOrigin=`${E-q-m}px 0%`,W=this.ǃrHX):(this.ǃqi.style.top=`${C-P-4*S}px`,this.ǃqi.style.left=`${q}px`,this.ǃqi.style.transformOrigin=`${E-q-m}px 100%`,W=this.ǃrHi);else if(this.ǃrHs(C+S,P,f)){let e=q-O+2*$;this.ǃqi.style.top=`${C}px`,this.ǃqi.style.left=`${e}px`,this.ǃqi.style.transformOrigin=`${E-e-m}px 0%`,W=this.ǃrH_}else{let e=q-O+2*$;this.ǃqi.style.top=`${C-P-4*S}px`,this.ǃqi.style.left=`${e}px`,this.ǃqi.style.transformOrigin=`${E-e-m}px 100%`,W=this.ǃrHl}this.ǃrHJ.setAttributeNS(null,"d",W($,S,z-$,_-S,$,S)),this.ǃrtr(r,t,"show")}ǃrHt(){let e=this.ǃrcj;return e instanceof Range&&(e=this.ǃrcj.commonAncestorContainer),e.ownerDocument}ǃrH$(){return this.ǃrHt().defaultView}ǃrtr(e,r,t){let n;"show"===t&&(n=this.ǃrHf),"hide"===t&&(n=this.ǃrHz),app.ǃjU()?(this.ǃrvg=this.ǃqi.animate(e,r),this.ǃrvg.onfinish=()=>n.call(this)):n.call(this)}ǃrHf(){ǃr.ǃ_W(this)||this.ǃ_a||(this.ǃrcZ=setTimeout(()=>this.ǃrcK(),this.ǃrcw),this.ǃrHt().addEventListener("UIPointerDown",this.ǃSw))}ǃrHz(){this.ǃMI()}ǃMe(){this.ǃrcK()}ǃrcK(){this.ǃrcu||(d===this&&(d=null),this.ǃrcu=!0,this.ǃrtr(e,t,"hide"))}ǃMI(){ǃr.ǃ_W(this)||this.ǃ_a||(this.ǃ_a=!0,d===this&&(d=null),-1!==this.ǃrcZ&&(clearTimeout(this.ǃrcZ),this.ǃrcZ=-1),this.ǃrHt().removeEventListener("UIPointerDown",this.ǃSw),this.ǃSw=null,this.ǃN$&&this.ǃN$.ǃTq(),ǃr.ǃo.ǃrv(this.ǃe$),ǃr.ǃo.ǃrv(this.ǃe$),ǃr.ǃo.ǃrv(this.ǃe$),ǃr.ǃo.ǃrv(this.ǃrHT),ǃr.ǃo.ǃrv(this.ǃrHU),ǃr.ǃo.ǃrv(this.ǃrHr),ǃr.ǃo.ǃrv(this.ǃqi),this.ǃrHU=null,this.ǃrHr=null,this.ǃN$=null,this.ǃrHT=null,this.ǃe$=null,this.ǃHP=null,this.ǃrcj=null,this.ǃqi=null,ǃr.ǃTq(this))}ǃrHX(e,r,t,n,o,d){return`M ${e+i} ${r}
L ${e+o} ${r}
L ${e+2*o} ${r-d}
L ${e+2*o} ${r}
L ${t-i} ${r}
A ${i} ${i} 0 0 1 ${t} ${r+i}
L ${t} ${n-i}
A ${i} ${i} 0 0 1 ${t-i} ${n}
L ${e+i} ${n}
A ${i} ${i} 0 0 1 ${e} ${n-i}
L ${e} ${r+i}
A ${i} ${i} 0 0 1 ${e+i} ${r}
Z`}ǃrH_(e,r,t,n,o,d){return`M ${t/2} ${r}
L ${e+t-4*o} ${r}
L ${e+t-4*o+o} ${r-d}
L ${e+t-4*o+o} ${r}
L ${t-i} ${r}
A ${i} ${i} 0 0 1 ${t} ${r+i}
L ${t} ${n-i}
A ${i} ${i} 0 0 1 ${t-i} ${n}
L ${e+i} ${n}
A ${i} ${i} 0 0 1 ${e} ${n-i}
L ${e} ${r+i}
A ${i} ${i} 0 0 1 ${e+i} ${r}
Z`}ǃrHi(e,r,t,n,o,d){return`M ${e+i} ${r}
L ${t-i} ${r}
A ${i} ${i} 0 0 1 ${t} ${r+i}
L ${t} ${n-i}
A ${i} ${i} 0 0 1 ${t-i} ${n}
L ${e+2*o} ${n}
L ${e+2*o} ${n+d}
L ${e+o} ${n}
L ${e+i} ${n}
A ${i} ${i} 0 0 1 ${e} ${n-i}
L ${e} ${r+i}
A ${i} ${i} 0 0 1 ${e+i} ${r}
Z`}ǃrHl(e,r,t,n,o,d){return`M ${e+i} ${r}
L ${t-i} ${r}
A ${i} ${i} 0 0 1 ${t} ${r+i}
L ${t} ${n-i}
A ${i} ${i} 0 0 1 ${t-i} ${n}
L ${e+t-4*o+o} ${n}
L ${e+t-4*o+o} ${n+d}
L ${e+t-4*o} ${n}
L ${e+i} ${n}
A ${i} ${i} 0 0 1 ${e} ${n-i}
L ${e} ${r+i}
A ${i} ${i} 0 0 1 ${e+i} ${r}
Z`}ǃrHL(e,r,t){return e+r+t
`,r=new DOMParser;return r.parseFromString(e,"image/svg+xml").getElementById("balloontip-svg")}}}{const e={ǃHZ:!1,border:!1,ǃrHn:!0},r=400;ǃr.ǃo.ǃsZ.ǃsQ=class extends ǃr.Event.ǃUU{constructor(r,t){super(),ǃr.ǃIO(r),ǃr.ǃVg(t),t=Object.assign({},e,t),this.ǃrJT=r,this.ǃrh$=!!t.ǃHZ,this.ǃrHV=!!t.ǃrHn,this.ǃrHp=ǃr.ǃo.ǃUd("ui-table",this.ǃrJT),t.border&&this.ǃrHp.setAttribute("own-border",""),this.ǃrHB=null,this.ǃrHd=[],this.ǃrHc=new Set,this.ǃPR=null,this.ǃrHH=(r)=>this.ǃIr(r),this.ǃrHD=()=>this.ǃrHY(),this.ǃrHa=0,this.ǃOR=0,this.ǃqA=-1,this.ǃOB=ǃr.ǃo.ǃUd("div",null,null,"table-insert-mark"),this.ǃrHq=null,this.ǃOc="",this.ǃrHA=!1,this.ǃqA=-1,this.ǃrhH=()=>this.ǃrhD(),this.ǃrhY=0,this.ǃrha=0,this.ǃrhq=0,this.ǃrhA=0,this.ǃrHW=!1,this.ǃrHG=null,this.ǃrHk=null,this.ǃriS=!0,this.ǃrHM=0}ǃTq(){this.ǃXG(),this.ǃan(),this.ǃOB=null,this.ǃrHx(),this.ǃrhH=null,this.ǃrHB&&(this.ǃrHB.ǃTq(),this.ǃrHB=null),this.ǃrHk&&(ǃr.ǃo.ǃrv(this.ǃrHk),this.ǃrHk=null),this.ǃrHG&&(this.ǃrHG.ǃTq(),this.ǃrHG=null),-1!==this.ǃqA&&(this.ǃAt().cancelAnimationFrame(this.ǃqA),this.ǃqA=-1),this.ǃPR&&(this.ǃPR.removeEventListener("scroll",this.ǃrHH,{passive:!0}),this.ǃrHH=null,ǃr.ǃo.ǃrv(this.ǃPR),this.ǃPR=null),ǃr.ǃo.ǃrv(this.ǃrHp),this.ǃrHp=null,this.ǃrHD=null,this.ǃrJT=null,super.ǃTq()}ǃXG(){this.ǃrHc.clear(),this.ǃan();for(let e of this.ǃrHd)e.ǃTq();for(const e of this.ǃrHB.ǃrHR())e.ǃrHg();ǃr.ǃXk(this.ǃrHd)}ǃUh(){return this.ǃrHp}ǃam(){return this.ǃUh().ownerDocument}ǃAt(){return this.ǃam().defaultView}ǃrhy(){return this.ǃrh$}ǃrHO(){return this.ǃrHV}ǃrHI(e){this.ǃrHW=e}ǃrHE(){return this.ǃrHW}ǃrHC(e){this.ǃrHy(e),this.ǃrHc.add(e)}ǃrHb(e){this.ǃrHy(e),this.ǃrHc.delete(e)}ǃUio(){return this.ǃrHc.size}ǃYp(){this.ǃrHS();for(let e of this.ǃrHc)e.ǃYq(!1);this.ǃrHo(),this.ǃrHj("allunselected"),assert(0===this.ǃrHc.size,"should have deleted all selected row")}ǃgA(){return this.ǃrHc.values()}ǃrHe(){return ǃr.ǃV(this.ǃrHc)}ǃrHN(){return 0r)throw new Error("cannot find row");this.ǃrHd[r].ǃTq(),this.ǃrHd.splice(r,1)}ǃrnR(){for(let e of this.ǃrHd)e.ǃrnR()}ǃIr(){let e=this.ǃPR.scrollLeft,r=this.ǃPR.scrollTop;if((this.ǃrHa!==e||this.ǃOR!==r)&&(this.ǃrHa=e,this.ǃOR=r,-1===this.ǃqA)){const e=this.ǃAt();e&&(this.ǃqA=this.ǃAt().requestAnimationFrame(this.ǃrHD))}}ǃrHY(){const e=this.ǃrHB.ǃUh(),r=`${this.ǃrHa}px`;e.style.marginLeft=`-${r}`,e.style.paddingRight=r;for(const e of this.rows())e.ǃUh().style.paddingRight=r;this.ǃqA=-1}ǃrHy(e){if(ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃsQ.ǃim),e.ǃrDT()!==this)throw new Error("row from different table")}*rows(){for(let e of this.ǃrHd)yield e}ǃhR(e,t){ǃr.ǃ$t(e),ǃr.ǃ$t(t);let r=this.ǃrHp.getBoundingClientRect();if(er.right||t>r.bottom)return null;for(let n of this.rows()){let i=n.ǃhR(e,t);if(i)return{ǃXJ:n,ǃap:i.ǃap}}return null}ǃaV(e,r){if(this.ǃrHy(e),ǃr.ǃk(r),"before"!==r&&"after"!==r)throw new Error("invalid insert mark type");if(e!==this.ǃrHq||r!==this.ǃOc){this.ǃan();let t=e.ǃUh(),n=t.parentElement;n.insertBefore(this.ǃOB,"before"===r?t:t.nextSibling),this.ǃrHq=e,this.ǃOc=r}}ǃan(){this.ǃOc&&(ǃr.ǃo.ǃrv(this.ǃOB),this.ǃrHq=null,this.ǃOc="")}ǃrDv(){this.ǃrHA||!this.ǃAt()||(this.ǃrHA=!0,this.ǃrhA=0,this.ǃrhY=performance.now(),this.ǃqA=this.ǃAt().requestAnimationFrame(this.ǃrhH))}ǃrDJ(e,r){this.ǃrHA&&(this.ǃrha=e,this.ǃrhq=r)}ǃrhD(){var e=Math.floor,t=Math.ceil;if(this.ǃqA=-1,this.ǃrHA&&this.ǃAt()){let n=performance.now(),i=(n-this.ǃrhY)/1e3;this.ǃrhY=n;let o=this.ǃrHp.getBoundingClientRect();if(this.ǃrha>=o.left&&this.ǃrha<=o.right)if(this.ǃrhqo.bottom){let t=this.ǃPR.scrollTop,n=t+r*i+this.ǃrhA;this.ǃrhA=n-e(n),n=e(n),this.ǃXS(n)}this.ǃqA=this.ǃAt().requestAnimationFrame(this.ǃrhH)}}ǃrDL(){return this.ǃPR.scrollTop}ǃrDs(e){ǃr.ǃ$t(e),this.ǃPR.scrollLeft=e,this.ǃrHa=this.ǃPR.scrollLeft}ǃXb(){return this.ǃPR.scrollTop}ǃXS(e){ǃr.ǃ$t(e),this.ǃPR.scrollTop=e,this.ǃOR=this.ǃPR.scrollTop}ǃrHx(){this.ǃrHA=!1,-1!==this.ǃqA&&this.ǃAt()&&(this.ǃAt().cancelAnimationFrame(this.ǃqA),this.ǃqA=-1)}ǃrDX(e,r,t,n,i){if(this.ǃrHP())return;let o=new ǃr.Event(r),d=null;if(!(t&&(d=t.getAttribute("columnName"),!d)))return o.ǃXJ=e,o.ǃrDi=d,"undefined"!=typeof n&&"undefined"!=typeof i&&(o.clientX=n,o.clientY=i),o.ǃrD_=t?e.ǃrDl(o.ǃrDi):null,this.dispatchEvent(o)}ǃrHj(e,r,t){if(!this.ǃrHP()){let n=new ǃr.Event(e);return n.table=this,"undefined"!=typeof r&&"undefined"!=typeof t&&(n.clientX=r,n.clientY=t),this.dispatchEvent(n)}}ǃJc(){return this.ǃriS}ǃJB(e){e=!!e;this.ǃriS===e||(this.ǃriS=e,this.ǃrHp.style.display=this.ǃriS?"":"none")}ǃIB(){const e={scrollLeft:this.ǃrHa,scrollTop:this.ǃOR};if(!this.ǃrHc.size)e.selectedRows=null;else{const r=[];for(let e of this.ǃrHc.values())r.push({number:e.ǃrDt(),selected:e.ǃYa()});e.selectedRows=r}return e.columnsUIStateJson=this.ǃrHB.ǃrHR().map((e)=>e.ǃIB()),e}ǃIp(e){if(e){if(ǃr.ǃtU(e.scrollLeft)&&(this.ǃPR.scrollLeft=e.scrollLeft,this.ǃrHa=e.scrollLeft),ǃr.ǃtU(e.scrollTop)&&(this.ǃPR.scrollTop=e.scrollTop,this.ǃOR=e.scrollTop),e.selectedRows&&e.selectedRows.length){this.ǃrHS();for(let r of e.selectedRows)for(let e of this.rows())e.ǃrDt()===r.number&&r.selected&&e.ǃqK();this.ǃrHo(),this.ǃrHN()&&this.ǃrHj("rowsselected")}if(e.columnsUIStateJson&&e.columnsUIStateJson.length)for(const r of e.columnsUIStateJson){const e=this.ǃrHB.ǃrD$(r.id);e&&e.ǃIp(r)}this.ǃrHY()}}}}{ǃr.ǃo.ǃsZ.ǃsQ.ǃim=class extends ǃr.Event.ǃUU{constructor(e,r,t){ǃr.ǃ$(r,ǃr.ǃo.ǃsZ.ǃsQ),t=!!t,super(),this.ǃsw=r,this.ǃriY=e,this.ǃrDf=t,this.ǃSP=!1,this.ǃriS=!0,this.ǃrHB=r.ǃrHK(),this.ǃrDz=ǃr.ǃo.ǃUd("ui-table-row"),this.ǃrDz.setAttribute("tabindex",-1),this.ǃrDf&&this.ǃrDz.setAttribute("filler",""),this.ǃrDf?this.ǃsw.ǃrHw().appendChild(this.ǃrDz):this.ǃsw.ǃrHQ(this.ǃrDz),this.ǃrDF=[],this.ǃrDm=new Set,this.ǃrDh=this.ǃrHB.ǃrHR(),this.ǃrDn=[];for(let n=0;nthis.ǃQT(r),this.ǃSQ=(r)=>this.ǃOZ(r),this.ǃSZ=(r)=>this.ǃrt(r),this.ǃrzf=(r)=>this.ǃrhm(r),this.ǃrzz=(r)=>this.ǃrhh(r),this.ǃOm=-1,this.ǃOh=0,this.ǃOn=0,this.ǃrzh=!1,this.ǃSw=null,this.ǃOI=null,this.ǃOC=null,this.ǃrDz.addEventListener("UIDoubleTap",this.ǃSQ),this.ǃrDf||(this.ǃrDz.addEventListener("focus",this.ǃrzf),this.ǃrDz.addEventListener("UITap",this.ǃUJr),this.ǃsw.ǃrHO()&&this.ǃrDz.addEventListener("blur",this.ǃrzz),this.ǃsw.ǃrhy()&&(this.ǃSw=(r)=>this.ǃMe(r),this.ǃOI=(r)=>this.ǃOE(r),this.ǃOC=(r)=>this.ǃMQ(r),this.ǃrDz.addEventListener("UIPointerDown",this.ǃSw))),this.ǃrDz.addEventListener("contextmenu",this.ǃSZ)}ǃTq(){for(let e of this.ǃrDF)e.ǃTq();for(let e of this.ǃrDn)e.ǃTq();ǃr.ǃXk(this.ǃrDn),ǃr.ǃXk(this.ǃrDF),this.ǃrDm.clear(),this.ǃYq(!1),ǃr.ǃo.ǃrv(this.ǃrDz),this.ǃrDz.removeEventListener("focus",this.ǃrzf),this.ǃrzf=null,this.ǃrDz.removeEventListener("blur",this.ǃrzz),this.ǃrzz=null,this.ǃrDz.removeEventListener("UITap",this.ǃUJr),this.ǃUJr=null,this.ǃrDz.removeEventListener("UIDoubleTap",this.ǃSQ),this.ǃSQ=null,this.ǃrDz.removeEventListener("UIPointerDown",this.ǃSw),this.ǃSw=null,this.ǃam().removeEventListener("UIPointerMove",this.ǃOI),this.ǃOI=null,this.ǃam().removeEventListener("UIPointerUp",this.ǃOC),this.ǃOC=null,this.ǃrDz.removeEventListener("contextmenu",this.ǃSZ),this.ǃSZ=null,this.ǃrDm=null,this.ǃrDF=null,this.ǃrDz=null,this.ǃrDh=null,this.ǃsw=null,this.ǃriY=null,this.ǃrHB=null,this.ǃrDn=null,super.ǃTq()}ǃih(){return this.ǃriY}ǃrDT(){return this.ǃsw}ǃUh(){return this.ǃrDz}ǃam(){return this.ǃUh().ownerDocument}ǃrDt(){return Array.prototype.indexOf.call(this.ǃrDz.parentElement.children,this.ǃrDz)}ǃrDl(e){ǃr.ǃk(e);for(let r of this.ǃrDF)if(r.ǃrDB()===e)return r;return null}ǃrnR(){for(let e of this.ǃrDF)e.ǃrDd()&&e.ǃrnR()}ǃiz(e,r){ǃr.ǃk(e),ǃr.ǃVm(r,ǃr.ǃo.ǃVK),this.ǃrDc(e);let t=this.ǃrDz.querySelector(`[columnName="${e}"]`);return this.ǃrDF.push(ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃsQ.ǃrDH,t,r)),this}ǃrDD(e,r){ǃr.ǃk(e),ǃr.ǃk(r),this.ǃrDc(e);let t=this.ǃrDz.querySelector(`[columnName="${e}"]`);return this.ǃrDF.push(ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃsQ.ǃrDY,t,r)),this}ǃrDa(e,r){ǃr.ǃk(e),ǃr.ǃ$t(r),this.ǃrDc(e);let t=this.ǃrDz.querySelector(`[columnName="${e}"]`);return this.ǃrDF.push(ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃsQ.ǃrDq,t,r)),this}ǃif(e,r){ǃr.ǃk(e),ǃr.ǃzg(r),this.ǃrDc(e);let t=this.ǃrDz.querySelector(`[columnName="${e}"]`);return this.ǃrDF.push(ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃsQ.ǃrDA,t,r)),this}ǃgD(e,r){ǃr.ǃk(e),r&&ǃr.ǃ$(r,r.ownerDocument.defaultView.DocumentFragment),this.ǃrDc(e);let t=this.ǃrDz.querySelector(`[columnName="${e}"]`);return this.ǃrDF.push(ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃsQ.ǃrDW,t,r)),this}ǃrDc(e){if(this.ǃrDm.has(e))throw new Error(`field '${e}' has already been set`);if(!this.ǃrDh.some((r)=>r.ǃUAh()===e))throw new Error(`field '${e}' does not exist`);this.ǃrDm.add(e)}ǃQT(r){this.ǃsw.ǃrDX(this,"rowtapped",r.target,r.clientX,r.clientY)}ǃOZ(r){this.ǃrDf?this.ǃsw.ǃrHj("tablespacedoubletap",r.clientX,r.clientY):this.ǃsw.ǃrDX(this,"rowdoubletapped",r.target,r.clientX,r.clientY)}ǃrt(r){r.preventDefault(),this.ǃrDf?this.ǃsw.ǃrHj("tablecontextmenu",r.clientX,r.clientY):this.ǃsw.ǃrDX(this,"rowcontextmenu",r.target,r.clientX,r.clientY)}ǃJB(e){e=!!e;this.ǃriS===e||(this.ǃriS=e,this.ǃrDz.style.display=this.ǃriS?"":"none")}ǃqK(){this.ǃYa()||(this.ǃsw.ǃYp(),this.ǃYq(!0))}ǃU_j(){this.ǃYq(!1)}ǃYq(e){e=!!e;this.ǃSP===e||(e?(this.ǃrDz.setAttribute("selected",""),this.ǃsw.ǃrDX(this,"rowselected"),this.ǃsw.ǃrHC(this)):(this.ǃrDz.removeAttribute("selected"),this.ǃsw.ǃrDX(this,"rowunselected"),this.ǃsw.ǃrHb(this)),this.ǃSP=e)}ǃYa(){return this.ǃSP}ǃrhm(){this.ǃqK()}ǃrhh(){this.ǃYq(!1)}ǃhR(e,r){if(ǃr.ǃ$t(e),ǃr.ǃ$t(r),this.ǃrDf)return null;let t=this.ǃrDz.getBoundingClientRect();if(et.right||rt.bottom)return null;let n=t.bottom-t.top,i=t.top+n/2;return{ǃap:r>=i?"after":"before"}}ǃMe(r){let e=r.detail;e.ǃnT!==ǃr.ǃGV.ǃxp||this.ǃsw.ǃrHE()||-1===this.ǃOm&&(this.ǃam().addEventListener("UIPointerMove",this.ǃOI),this.ǃam().addEventListener("UIPointerUp",this.ǃOC),this.ǃOm=e.id,this.ǃOh=e.clientX,this.ǃOn=e.clientY,this.ǃrzh=!1)}ǃOE(r){r.preventDefault();let e=r.detail;if(e.id===this.ǃOm&&!this.ǃsw.ǃrHE()){if(this.ǃsw.ǃrhy()&&!this.ǃrzh&&ǃr.ǃyp(this.ǃOh,this.ǃOn,e.clientX,e.clientY)>=10)if(this.ǃsw.ǃrDX(this,"dragstart",r.target))this.ǃrzh=!0,this.ǃsw.ǃrDv();else return this.ǃOm=-1,this.ǃam().removeEventListener("UIPointerMove",this.ǃOI),void this.ǃam().removeEventListener("UIPointerUp",this.ǃOC);this.ǃrzh&&(this.ǃsw.ǃrDX(this,"dragmove",null,e.clientX,e.clientY),this.ǃsw.ǃrDJ(e.clientX,e.clientY))}}ǃMQ(r){let e=r.detail;e.id!==this.ǃOm||(this.ǃam().removeEventListener("UIPointerMove",this.ǃOI),this.ǃam().removeEventListener("UIPointerUp",this.ǃOC),this.ǃrzh&&(this.ǃrzh=!1,this.ǃOm=-1,this.ǃsw.ǃrHx(),this.ǃsw.ǃrDX(this,"drop",null,e.clientX,e.clientY)))}}}{const e=2;ǃr.ǃo.ǃsZ.ǃsQ.ǃmi=class extends ǃr.Event.ǃUU{constructor(e,r,t,n){ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃsQ),ǃr.ǃIO(r),ǃr.ǃ$t(t),ǃr.ǃz(n),super(),this.ǃsw=e,this.ǃrJT=r,this.ǃck=t,this.ǃUPm=n,this.ǃqi=null,this.ǃrDG=null,this.ǃrDk=null,this.ǃrDM=null,this.ǃrDx=null,this.ǃrDn=null,this.ǃrDR=0,this.ǃrDg=0,this.ǃrDO=0,this.ǃrDI=-1,this.ǃrDE=-1,this.ǃrDC="",this.ǃqi=n?ǃr.ǃo.ǃUd("ui-table-column",r,null,null,{columnName:n}):ǃr.ǃo.ǃUd("ui-table-column",r),t&&-1!==t&&(this.ǃqi.style.width=`${t}px`,this.ǃqi.style.maxWidth=`${t}px`,this.ǃqi.style.minWidth=`${t}px`),this.ǃrDy=-1,this.ǃMq=(r)=>this.ǃMe(r),this.ǃMk=(r)=>this.ǃOE(r),this.ǃMW=(r)=>this.ǃMQ(r),this.ǃrDb=(r)=>this.ǃrDS(r),this.ǃqi.addEventListener("UIPointerDown",this.ǃMq),this.ǃqi.addEventListener("UIPointerMove",this.ǃrDb)}ǃTq(){this.ǃqi.removeEventListener("UIPointerDown",this.ǃMq),this.ǃqi.removeEventListener("UIPointerMove",this.ǃrDb),this.ǃsw.ǃam().removeEventListener("UIPointerMove",this.ǃMk),this.ǃsw.ǃam().removeEventListener("UIPointerUp",this.ǃMW),ǃr.ǃo.ǃrv(this.ǃqi),this.ǃrDG&&ǃr.ǃXk(this.ǃrDG),this.ǃrDk&&ǃr.ǃXk(this.ǃrDk),this.ǃrDn&&ǃr.ǃXk(this.ǃrDn),this.ǃMq=null,this.ǃMk=null,this.ǃMW=null,this.ǃrDb=null,this.ǃrDG=null,this.ǃrDM=null,this.ǃrDk=null,this.ǃrDx=null,this.ǃrDn=null,this.ǃsw=null,this.ǃrJT=null,this.ǃqi=null,super.ǃTq()}ǃrHg(){this.ǃrDn&&ǃr.ǃXk(this.ǃrDn)}ǃUh(){return this.ǃqi}ǃrDV(){return-1===this.ǃck}ǃrDo(){return 0===this.ǃrDj(this.ǃqi)}ǃrDe(){return this.ǃrDj(this.ǃqi)===this.ǃsw.ǃrHK().ǃrHR().length-1}ǃUAh(){return this.ǃUPm}ǃrDN(){this.ǃrDy=-1}ǃrDK(){return parseFloat(this.ǃqi.style.width)}ǃrDP(e){ǃr.ǃ$t(e),this.ǃrDG=this.ǃrDw(0);for(let r of this.ǃrDG){const t=`${e}px`;r.style.width=t,this.ǃrDV()||(r.style.maxWidth=t,r.style.minWidth=t)}if(this.ǃLg(e),this.ǃrDQ())for(const r of this.ǃrDQ())r.ǃLg(e);ǃr.ǃXk(this.ǃrDG),this.ǃrDG=null}ǃr$b(){if(-1!==this.ǃrDy)return this.ǃrDy;if(-1===this.ǃck){let e=getComputedStyle(this.ǃqi),r=parseInt(e.width);return this.ǃrDy=r,this.ǃrDy}return this.ǃck}ǃLg(e){ǃr.ǃ$t(e);-1===this.ǃck||(this.ǃck=e)}ǃrDp(e){ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃsQ.ǃmi),this.ǃrDn||(this.ǃrDn=[]),this.ǃrDn.push(e)}ǃrDQ(){return this.ǃrDn}ǃrDj(e){const r=Array.prototype.filter.call(e.parentNode.childNodes,(e)=>"ui-table-column"===e.tagName.toLowerCase());return Array.prototype.indexOf.call(r,e)}ǃrDw(e){ǃr.ǃ$t(e);let r=this.ǃrDj(this.ǃqi)+e,t=this.ǃsw.ǃUh(),n=t.getElementsByTagName("ui-table-column");return 0===e?this.ǃrDM=this.ǃsw.ǃrHK().ǃrHR()[r]:this.ǃrDx=this.ǃsw.ǃrHK().ǃrHR()[r],Array.prototype.filter.call(n,(e)=>this.ǃrDj(e)===r)}ǃMe(r){let t=r.target,n=t.getBoundingClientRect(),i=r.detail.clientX-n.left,o=parseInt(getComputedStyle(t).padding);return(this.ǃrDR=r.detail.clientX,this.ǃrDg=n.width-2*o,i<=e)?this.ǃrDo()?void 0:(this.ǃsw.ǃrHI(!0),this.ǃrDC="left",this.ǃrDG=this.ǃrDw(0),this.ǃrDk=this.ǃrDw(-1),this.ǃrDx&&(this.ǃrDx.ǃrDN(),this.ǃrDO=this.ǃrDx.ǃr$b()),this.ǃsw.ǃam().addEventListener("UIPointerMove",this.ǃMk),this.ǃsw.ǃam().addEventListener("UIPointerUp",this.ǃMW),void this.ǃqi.removeEventListener("UIPointerMove",this.ǃrDb)):i>=n.width-e?(this.ǃsw.ǃrHI(!0),this.ǃrDC="right",this.ǃrDG=this.ǃrDw(0),this.ǃrDk=this.ǃrDw(1),this.ǃrDx&&(this.ǃrDx.ǃrDN(),this.ǃrDO=this.ǃrDx.ǃr$b()),this.ǃsw.ǃam().addEventListener("UIPointerMove",this.ǃMk),this.ǃsw.ǃam().addEventListener("UIPointerUp",this.ǃMW),void this.ǃqi.removeEventListener("UIPointerMove",this.ǃrDb)):void 0}ǃOE(e){let r=e.detail.clientX-this.ǃrDR;if(("left"===this.ǃrDC&&(r*=-1),this.ǃrDI=this.ǃrDg+r,!(0>this.ǃrDI))&&!(this.ǃrDx&&(this.ǃrDE=this.ǃrDO-r,!this.ǃrDx.ǃrDV()&&0>this.ǃrDE))){for(let e of this.ǃrDG)e.style.width=`${this.ǃrDI}px`,e.style.maxWidth&&(e.style.maxWidth=`${this.ǃrDI}px`),e.style.minWidth&&(e.style.minWidth=`${this.ǃrDI}px`);for(let e of this.ǃrDk)e.style.width=`${this.ǃrDE}px`,e.style.maxWidth&&(e.style.maxWidth=`${this.ǃrDE}px`),e.style.minWidth&&(e.style.minWidth=`${this.ǃrDE}px`)}}ǃrDS(r){let t=r.target,n=t.getBoundingClientRect(),i=r.detail.clientX-n.left;return i<=e?0===this.ǃrDj(t)?void this.ǃsw.ǃUh().removeAttribute("resizing-column"):void this.ǃsw.ǃUh().setAttribute("resizing-column",""):i>=n.width-e?this.ǃrDV()&&this.ǃrDe()?void this.ǃsw.ǃUh().removeAttribute("resizing-column"):void this.ǃsw.ǃUh().setAttribute("resizing-column",""):void this.ǃsw.ǃUh().removeAttribute("resizing-column")}ǃMQ(){if(this.ǃrDM&&-1!==this.ǃrDI){let e=0{r.preventDefault(),this.ǃsw.ǃrHj("tablecontextmenu",r.clientX,r.clientY)},this.ǃqi.addEventListener("contextmenu",this.ǃrDu)}ǃTq(){this.ǃqi.removeEventListener("contextmenu",this.ǃrDu),this.ǃrDu=null,ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null;for(let e of this.ǃrDh)e.ǃTq();ǃr.ǃXk(this.ǃrDh),this.ǃrDh=null,this.ǃsw=null,this.ǃrDZ=!1,super.ǃTq()}ǃUh(){return this.ǃqi}ǃrHR(){return this.ǃrDh}ǃrD$(e){ǃr.ǃk(e);for(const r of this.ǃrDh)if(r.ǃUAh()===e)return r}ǃrYU(e){return ǃr.ǃ$(e,ǃr.ǃo.ǃsZ.ǃsQ.ǃmi),-1!==this.ǃrDh.indexOf(e)}ǃXU(e,r,t){if(ǃr.ǃk(e),ǃr.ǃ$t(r),ǃr.ǃz(t),this.ǃrDZ)throw new Error("only one auto sizing column at the end of the table is allowed");let n=ǃr.ǃq(ǃr.ǃo.ǃsZ.ǃsQ.ǃmi,this.ǃsw,this.ǃqi,r,e);if(n.ǃUh().classList.add("top-row-column"),t){let e=ǃr.ǃo.ǃUd("div",n.ǃUh());e.textContent=t}return this.ǃrDh.push(n),this}ǃXr(e,r){ǃr.ǃk(e),ǃr.ǃz(r),this.ǃXU(e,-1,r),this.ǃsw.ǃUh().setAttribute("flex-filler",""),this.ǃrDZ=!0}},"use strict",ǃr.ǃo.ǃsZ.ǃsQ.ǃrYr=class{constructor(){this.ǃrYT=!1}ǃrDB(){ǃr.ǃo_()}ǃTq(){ǃr.ǃo_()}ǃrDd(){return this.ǃrYT}},"use strict",ǃr.ǃo.ǃsZ.ǃsQ.ǃrDH=class extends ǃr.ǃo.ǃsZ.ǃsQ.ǃrYr{constructor(e,r){ǃr.ǃIO(e),ǃr.ǃVm(r,ǃr.ǃo.ǃVK),super(),this.ǃjS=ǃr.ǃq(ǃr.ǃo.ǃnI,r?r:{},e),this.ǃjS.ǃUh().classList.add("table-column-content"),this.ǃrJT=e,this.ǃrJT.setAttribute("icon","")}ǃrDB(){return this.ǃrJT.getAttribute("columnName")}ǃTq(){this.ǃjS.ǃTq(),this.ǃjS=null,this.ǃrJT=null}},"use strict",ǃr.ǃo.ǃsZ.ǃsQ.ǃrDA=class extends ǃr.ǃo.ǃsZ.ǃsQ.ǃrYr{constructor(e,r){ǃr.ǃIO(e),ǃr.ǃzg(r),super(),this.ǃUdL=ǃr.ǃo.ǃUd("div",e,null,"table-column-content"),ǃr.ǃzL(this.ǃUdL,r),this.ǃrJT=e}ǃrDB(){return this.ǃrJT.getAttribute("columnName")}ǃTq(){ǃr.ǃo.ǃrv(this.ǃUdL),this.ǃUdL=null,this.ǃrJT=null}ǃFT(e){ǃr.ǃzg(e),ǃr.ǃzL(this.ǃUdL,e)}},"use strict",ǃr.ǃo.ǃsZ.ǃsQ.ǃrDq=class extends ǃr.ǃo.ǃsZ.ǃsQ.ǃrYr{constructor(e,r){ǃr.ǃIO(e),ǃr.ǃ$t(r),super(),this.ǃrYv=ǃr.ǃo.ǃUd("div",e,null,"table-column-content"),ǃr.ǃzL(this.ǃrYv,r.toString()),this.ǃrJT=e}ǃrDB(){return this.ǃrJT.getAttribute("columnName")}ǃTq(){ǃr.ǃo.ǃrv(this.ǃrYv),this.ǃrYv=null,this.ǃrJT=null}},"use strict";{ǃr.ǃo.ǃsZ.ǃsQ.ǃrDY=class extends ǃr.ǃo.ǃsZ.ǃsQ.ǃrYr{constructor(e,r){ǃr.ǃIO(e),ǃr.ǃk(r),super(),this.ǃrJT=e,this.ǃrYJ=r,this.ǃUdL=ǃr.ǃo.ǃUd("div",this.ǃrJT,null,"table-column-content"),ǃr.ǃzL(this.ǃUdL,this.ǃrYJ),this.ǃrLc=null,this.ǃrnD=null,this.ǃrnY=null,this.ǃrnd=null,this.ǃrnc=null,this.ǃrzD=null,this.ǃrYL=null,this.ǃrYs=()=>this.ǃrnG(),this.ǃrYT=!0}ǃTq(){this.ǃrnN(),ǃr.ǃo.ǃrv(this.ǃUdL),this.ǃrYJ=null,this.ǃUdL=null,this.ǃrJT=null,this.ǃrnD=null,this.ǃrnY=null,this.ǃrnd=null,this.ǃrnc=null,this.ǃrzD=null,this.ǃrYL=null,this.ǃrYs=null}ǃrDB(){return this.ǃrJT.getAttribute("columnName")}ǃUh(){return this.ǃUdL}ǃFT(e){ǃr.ǃk(e),this.ǃrYJ=e,this.ǃUdL.textContent=this.ǃrYJ}ǃYK(){return this.ǃrYJ}ǃU_M(){if(!this.ǃrLc)return this.ǃrLc=ǃr.ǃo.ǃUd("input",this.ǃrJT,null,"table-edit-text"),this.ǃrLc.classList.add("table-column-input"),this.ǃrLc.type="text",this.ǃrLc.setAttribute("spellcheck","false"),this.ǃrnc=()=>this.ǃrnj(),this.ǃrLc.addEventListener("input",this.ǃrnc),this.ǃrLc.addEventListener("UITap",ǃr.ǃo.ǃrrp),this.ǃrLc.addEventListener("UIDoubleTap",ǃr.ǃo.ǃrrp),window.setTimeout(()=>{this.ǃrnd=()=>this.ǃrno(),this.ǃrLc.addEventListener("blur",this.ǃrnd),this.ǃrLc.select()},30),this.ǃrzD=(r)=>this.ǃrne(r),this.ǃrLc.addEventListener("keydown",this.ǃrzD,!0),this.ǃrJT.addEventListener("scroll",this.ǃrYs,{passive:!0}),this.ǃrLc.value=this.ǃrYJ,this.ǃrLc.focus(),this.ǃUdL.textContent=".",new Promise((e,r)=>{this.ǃrnD=e,this.ǃrnY=r})}ǃrne(r){r.which===ǃr.ǃrO.ǃrg?(r.preventDefault(),r.stopPropagation(),this.ǃrno()):r.which===ǃr.ǃrO.ǃns&&(r.preventDefault(),r.stopPropagation(),this.ǃrnR())}ǃrno(){if(this.ǃrLc){let e=this.ǃrLc.value;this.ǃrnN(),this.ǃrnD&&this.ǃrnD(e),this.ǃrnD=null,this.ǃrnY=null}}ǃrnR(){this.ǃrLc&&(this.ǃrnN(),this.ǃrnD&&this.ǃrnD(null),this.ǃrnD=null,this.ǃrnY=null)}ǃrnN(){this.ǃrLc&&(this.ǃUdL.textContent=this.ǃrYJ,this.ǃrJT.removeEventListener("scroll",this.ǃrYs,{passive:!0}),this.ǃrLc.removeEventListener("keydown",this.ǃrzD,!0),this.ǃrLc.removeEventListener("input",this.ǃrnc),this.ǃrLc.removeEventListener("blur",this.ǃrnd),this.ǃrLc.removeEventListener("contextmenu",this.ǃrYL),this.ǃrLc.removeEventListener("UITap",ǃr.ǃo.ǃrrp),this.ǃrLc.removeEventListener("UIDoubleTap",ǃr.ǃo.ǃrrp),ǃr.ǃo.ǃrv(this.ǃrLc),this.ǃrzD=null,this.ǃrnc=null,this.ǃrnd=null,this.ǃrLc=null)}ǃrnj(){this.ǃUdL.textContent=this.ǃrLc.value;let e=this.ǃUdL.getBoundingClientRect();this.ǃrLc.style.width=`${Math.max(e.right-e.left,30)}px`,this.ǃUdL.textContent="."}ǃrnG(){this.ǃrLc.style.left=`${this.ǃUdL.offsetLeft}px`,this.ǃrLc.style.top=`${this.ǃUdL.offsetTop-this.ǃrJT.scrollTop}px`;let e=this.ǃrJT.getBoundingClientRect(),r=this.ǃrLc.getBoundingClientRect();(r.bottom>e.bottom||r.tope.right)&&this.ǃrnR()}}}"use strict",ǃr.ǃo.ǃsZ.ǃsQ.ǃrDW=class extends ǃr.ǃo.ǃsZ.ǃsQ.ǃrYr{constructor(e,r){if(ǃr.ǃIO(e),r&&ǃr.ǃVm(r,r.ownerDocument.defaultView.DocumentFragment),super(),this.ǃrJT=e,r){let e=r.childNodes;for(let r=0,t=e.length;r{ǃr.ǃ_W(this)||this.ǃrYi(e)}),this.onclick=null,this.ǃSw=(r)=>this.ǃMe(r),this.ǃqi.addEventListener("UIPointerDown",this.ǃSw),this.ǃ_a=!1}ǃTq(){this.ǃ_a=!0,ǃr.ǃo.ǃrv(this.ǃr$Q),this.ǃr$Q=null,this.ǃqi.removeEventListener("UIPointerDown",this.ǃSw),this.ǃSw=null,this.onclick=null,ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null,super.ǃTq()}ǃrYi(e){this.ǃ_a||(this.ǃr$Q=e,this.ǃqi.appendChild(this.ǃr$Q))}ǃUh(){return this.ǃqi}ǃMe(r){0!==r.detail.ǃnT||(r.stopPropagation(),this.onclick&&this.onclick())}},"use strict",ǃr.ǃo.ǃsZ.ǃrJU=class extends ǃr.Event.ǃUU{constructor(e){super(),ǃr.ǃIO(e),this.ǃqi=ǃr.ǃo.ǃUd("ui-back-button"),e.insertBefore(this.ǃqi,e.firstChild),this.ǃqi.setAttribute("title",lang("ui.controls.back-button.back-tooltip")),this.ǃr$Q=null,app.ǃrYX("back").ǃzE().then((e)=>this.ǃrYi(e)),this.onclick=null,this.ǃSw=(r)=>this.ǃMe(r),this.ǃqi.addEventListener("UIPointerDown",this.ǃSw),this.ǃrBB=!0,this.ǃ_a=!1}ǃTq(){this.ǃ_a=!0,ǃr.ǃo.ǃrv(this.ǃr$Q),this.ǃr$Q=null,this.ǃqi.removeEventListener("UIPointerDown",this.ǃSw),this.ǃSw=null,this.onclick=null,ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null,super.ǃTq()}ǃrYi(e){this.ǃ_a||(this.ǃr$Q=e,this.ǃqi.appendChild(this.ǃr$Q))}ǃJB(e){this.ǃrBB===e||(this.ǃqi.style.visibility=e?"visible":"hidden",this.ǃrBB=e)}ǃUh(){return this.ǃqi}ǃMe(r){0!==r.detail.ǃnT||(r.stopPropagation(),this.onclick&&this.onclick())}},"use strict";{function e(r){T&&T.ǃOE(r)}const r=[{opacity:"1"},{opacity:"0"}],t=[{transform:"scale(0.85)",opacity:"0"},{transform:"scale(1)",opacity:"1"}],n=[{opacity:"0"},{opacity:"1"}],i={duration:100,easing:"ease-out"},o=["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"],d=["right","left"],a=4,s={ǃrY_:null};let T=null,l=NaN;ǃr.ǃo.ǃr$=class extends ǃr.ǃT_{constructor(e,r,t,n){ǃr.ǃIO(e),ǃr.ǃ$f(r),ǃr.ǃVm(t,ǃr.ǃo.ǃr$.ǃrYl),ǃr.ǃVg(n),super(),n=Object.assign({},s,n),this.ǃrYt=e,this.ǃUQJ=null,this.ǃrY$=n.ǃrY_||null,this.ǃrYf=!1,this.ǃqi=ǃr.ǃo.ǃUd("ui-menu"),this.ǃqi.setAttribute("role","menu"),this.ǃrVr=[],this.ǃrsC=null,this.ǃrYz=[],this.ǃrYF=null,this.ǃrvg=null,this.ǃrvO=!1,this.ǃrvI=!1,this.ǃcD=!1,this.ǃrYm=t,this.ǃriS=!0,this.ǃrYh(!1),this.ǃrYn=0,this.ǃrYV=!1,this.ǃrYp=0,this.ǃrYB=0,this.ǃrYd="right",this.ǃrvA=null,this.ǃrYc=ǃr.ǃrd.ǃvq&&window.matchMedia("(max-width: 500px), (max-height: 500px)").matches,this.ǃrYH=!1,this.ǃrvP=null,this.ǃrYc&&this.ǃqi.setAttribute("compact",""),this.ǃrpZ=(r)=>this.ǃIr(r),this.ǃqi.addEventListener("scroll",this.ǃrpZ,{passive:!0}),this.ǃrYD=()=>ǃr.ǃo.ǃr$.ǃrHm(),app.addEventListener("projectobjectdelete",this.ǃrYD),this.ǃrh_=r||(this.ǃrYc?app.ǃvJ():app.ǃRK()),this.ǃ_a=!1}ǃTq(){assert(!this.ǃ_a,"already released"),app.removeEventListener("projectobjectdelete",this.ǃrYD),this.ǃrYD=null,this.ǃrYY(),this.ǃrvg&&(this.ǃrvg.finish(),this.ǃrvg=null);for(let e of this.ǃrVr)e.ǃMI();ǃr.ǃXk(this.ǃrVr);for(let r of this.ǃrYz)ǃr.ǃo.ǃrv(r);ǃr.ǃXk(this.ǃrYz),this.ǃrYF=null,this.ǃqi&&(this.ǃqi.removeEventListener("scroll",this.ǃrpZ),this.ǃrpZ=null,ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null),this.ǃrsC=null,this.ǃrvg=null,this.ǃrYt=null,this.ǃrYm=null,this.ǃ_a=!0,ǃr.ǃTq(this)}ǃ_W(){return this.ǃ_a}ǃUh(){return this.ǃqi}ǃam(){return this.ǃqi.ownerDocument}ǃAt(){return this.ǃam().defaultView}ǃrYa(){return this.ǃrYF||this.ǃqi}ǃrhR(){return this.ǃrh_}ǃrYq(){return this.ǃrYm}ǃrYA(){if(isNaN(l)){let e=ǃr.ǃo.ǃUrM("padding-top",{ǃfk:this.ǃqi});if(!e.endsWith("px"))throw new Error("CSS style for menu padding-top must be in units of 'px'");l=parseFloat(e)||0}return l}ǃXI(){return this.ǃcD}ǃrYW(){return this.ǃrYV}ǃIr(){this.ǃrYV=!0}ǃrYG(){this.ǃrYV=!1}ǃrYk(){this.ǃrYG();for(let e of this.ǃrVr){if(!e.ǃrYM())continue;if(!e.ǃrYx())continue;let r=e.ǃrYR();r&&r.ǃrYg().ǃrYk()}}ǃrz(e,r,t,n){"string"==typeof e&&(e=app.ǃrYO(e,this.ǃrh_)),ǃr.ǃVm(e,ǃr.ǃo.ǃVK),ǃr.ǃk(r),ǃr.ǃzO(t),ǃr.ǃVg(n),this.ǃrYH||(this.ǃrYH=!0,this.ǃrYc&&this.ǃrYI()&&this.ǃrYE());let i=ǃr.ǃq(ǃr.ǃo.ǃr$.ǃrYl,this,e,r,t,n);return this.ǃrVr.push(i),this.ǃrYC(),i}ǃv$(){let e=ǃr.ǃq(ǃr.ǃo.ǃr$.ǃrBL,this);return this.ǃrVr.push(e),this.ǃrYC(),e}ǃvs(e,r,t,n){"string"==typeof e&&(e=app.ǃrYO(e,this.ǃrh_)),ǃr.ǃVm(e,ǃr.ǃo.ǃVK),ǃr.ǃk(r),ǃr.ǃVg(t),ǃr.ǃVg(n);let i=this.ǃrz(e,r,null,t);return i.ǃrYy(n),i.ǃrYR()}ǃjW(){if(!this.ǃrYb()){if(this.ǃrYS())throw new Error("already in a group");this.ǃrYF=ǃr.ǃo.ǃUd("div",this.ǃUh(),null,"menuitemgroup"),this.ǃrYz.push(this.ǃrYF)}}ǃjG(){if(!this.ǃrYb()){if(!this.ǃrYS())throw new Error("not in a group");this.ǃrYF=null}}ǃrYo(){if(!this.ǃrYS())throw new Error("not in a group");ǃr.ǃo.ǃrv(this.ǃrYF),this.ǃrYF=null,this.ǃrYz.pop()}ǃrYS(){return!!this.ǃrYF}ǃrYE(){this.ǃrvP=ǃr.ǃUuW.ǃrD(()=>this.ǃvb());const e=this.ǃrYS();e&&this.ǃrYo(),this.ǃrz(app.ǃrYO("close",this.ǃrhR()),lang("common.close-menu"),ǃr.ǃUyc),this.ǃv$(),e&&this.ǃjW()}ǃrYj(e){ǃr.ǃ_u(e),assert(!this.ǃrvP,"already set back stack entry"),this.ǃrvP=ǃr.ǃUuW.ǃrD(e)}ǃrYC(){null===this.ǃrY$||this.ǃrVr.length>this.ǃrY$&&(this.ǃrYf=!0)}ǃrp(r,t,n){if(ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃ$f(n),assert(!this.ǃ_a,"menu was released"),assert(!this.ǃcD,"showing already active menu"),this.ǃrYF)throw new Error("group not finished");if(this.ǃrYI()){ǃr.ǃo.ǃr$.ǃrHm(),T=this;let n=new Promise((e)=>this.ǃrvA=e);return this.ǃrYc&&ǃr.ǃo.ǃrJw.ǃvS(this.ǃrYt),this.ǃrYe(r,t),this.ǃrYN(),this.ǃUQJ.addEventListener("UIPointerDown",ǃr.ǃo.ǃr$.ǃMe,!0),this.ǃUQJ.addEventListener("keydown",ǃr.ǃo.ǃr$.ǃkK),this.ǃUQJ.defaultView.addEventListener("resize",ǃr.ǃo.ǃr$.ǃrHm),this.ǃUQJ.defaultView.addEventListener("unload",ǃr.ǃo.ǃr$.ǃrHm),this.ǃUQJ.addEventListener("UIPointerMove",e),this.ǃrYf||this.ǃUQJ.addEventListener("wheel",ǃr.ǃo.ǃr$.ǃrYK,!0),ǃr.ǃvE||this.ǃUQJ.defaultView.addEventListener("blur",ǃr.ǃo.ǃr$.ǃrHm),n}this.ǃrYP()&&(this.ǃrYw()?this.ǃrYq().ǃrYg().ǃrYW()&&this.ǃrYe(r,t,n):this.ǃrYe(r,t,n),this.ǃrYN())}ǃJi(e="top-left",r=0,t=0,n="right"){if(ǃr.ǃk(e),ǃr.ǃ$t(r),ǃr.ǃ$t(t),ǃr.ǃk(n),!o.includes(e))throw new Error("invalid alignment");if(!d.includes(n))throw new Error("invalid preferred expand direction");this.ǃrYd=n;const i=this.ǃrYt.getBoundingClientRect();return"top-left"===e?this.ǃrp(i.left+r,i.top+t):"top"===e?this.ǃrp(i.left+i.width/2+r,i.top+t):"top-right"===e?this.ǃrp(i.right+r,i.top+t):"left"===e?this.ǃrp(i.left+r,i.top+i.height/2+t):"center"===e?this.ǃrp(i.left+i.width/2+r,i.top+i.height/2+t):"right"===e?this.ǃrp(i.right+r,i.top+i.height/2+t):"bottom-left"===e?this.ǃrp(i.left+r,i.bottom+t):"bottom"===e?this.ǃrp(i.left+i.width/2+r,i.bottom+t):"bottom-right"===e?this.ǃrp(i.right+r,i.bottom+t):void 0}ǃvb(r){!r&&(this.ǃrvI||this.ǃrYQ()||!this.ǃcD)||(this.ǃcD=!1,this.ǃrYZ(),this.ǃrvP&&(this.ǃrvP.ǃTq(),this.ǃrvP=null),this.ǃrYI()&&(T===this&&(T=null),this.ǃrYc&&ǃr.ǃo.ǃrJw.ǃvb(),this.ǃUQJ&&(this.ǃUQJ.removeEventListener("UIPointerDown",ǃr.ǃo.ǃr$.ǃMe,!0),this.ǃUQJ.removeEventListener("keydown",ǃr.ǃo.ǃr$.ǃkK),this.ǃUQJ.removeEventListener("wheel",ǃr.ǃo.ǃr$.ǃrYK,!0),this.ǃUQJ.defaultView.removeEventListener("resize",ǃr.ǃo.ǃr$.ǃrHm),this.ǃUQJ.defaultView.removeEventListener("unload",ǃr.ǃo.ǃr$.ǃrHm),this.ǃUQJ.removeEventListener("UIPointerMove",e),!ǃr.ǃvE&&this.ǃUQJ.defaultView.removeEventListener("blur",ǃr.ǃo.ǃr$.ǃrHm)),this.ǃrYY()),this.ǃUQJ=null,this.ǃrYu())}ǃrYY(){this.ǃrvA&&(this.ǃrvA(),this.ǃrvA=null)}ǃhR(e,r){if(ǃr.ǃ$t(e),ǃr.ǃ$t(r),assert(!this.ǃ_a,"menu was released"),this.ǃrvI||!this.ǃcD||this.ǃrYQ())return!1;let t=this.ǃrsC;return t?e>=t.left&&r>=t.top&&eo?(e=0,ǃr.ǃrd.ǃvq&&(r=t),d="100%"):(e=T-i,d="0%")}let v="number"==typeof t?t:r;r+o+a<=l?s="0%":0<=v-o?(r=v-o,s="100%"):(s=100*r/l+"%",r=0,this.ǃqi.style.height=Math.min(o,l-5)+"px"),this.ǃqi.style.transformOrigin=`${d} ${s}`;const p=ǃr.ǃUyo(e-this.ǃrYp),m=ǃr.ǃUyo(r-this.ǃrYB);this.ǃqi.style.left=`${p}px`,this.ǃqi.style.top=`${m}px`,"DIALOG"===this.ǃrar().tagName&&(this.ǃqi.style.width=`${i}px`),this.ǃrsC=this.ǃqi.getBoundingClientRect()}ǃrYN(){assert(!this.ǃ_a,"menu was released"),assert(!this.ǃrvO,"already fading in"),this.ǃrvI&&this.ǃrvg&&(this.ǃrvI=!1,this.ǃrvg.onfinish=null,this.ǃrvg.finish(),this.ǃrvg=null),this.ǃrvO=!0,this.ǃcD=!0,this.ǃrYQ()?(this.ǃrYh(!0),this.ǃrtr(this.ǃrYc?n:t,i)):this.ǃrJK()}ǃrYu(){return assert(!this.ǃrvI,"already animating out"),assert(T!==this,"should not be current menu"),this.ǃrvI=!0,this.ǃrvO&&(this.ǃrvO=!1,this.ǃrvg)?void ǃr.ǃUyP(this.ǃrvg):void(this.ǃraT()?this.ǃrtr(r,i):this.ǃrJK())}ǃrtr(e,r){app.ǃjU()?(assert(!this.ǃrvg,"already animating"),this.ǃrvg=this.ǃqi.animate(e,r),this.ǃrvg.onfinish=()=>this.ǃrJK()):this.ǃrJK()}ǃrJK(){if(ǃr.ǃ_W(this)||this.ǃ_a)return;let e=!1;this.ǃrvI&&(assert(T!==this,"should not be current menu"),this.ǃrYI()&&(e=!0),this.ǃrYP()&&this.ǃrYh(!1)),this.ǃrvO=!1,this.ǃrvI=!1,this.ǃrvg=null,e&&this.ǃTq()}ǃrav(e){ǃr.ǃVm(e,ǃr.ǃo.ǃr$.ǃrYl);for(let r of this.ǃrVr)r.ǃYq(r===e)}ǃrYZ(){for(let e of this.ǃrVr){if(!e.ǃrYM())continue;let r=e.ǃrYR();r&&r.ǃrYg().ǃvb()}}ǃraJ(){for(let e of this.ǃrVr){if(!e.ǃrYM())continue;let r=e.ǃrYR();r&&r.ǃrYg().ǃTq()}}ǃraL(e,r){for(let t of this.ǃrVr){if(!t.ǃrYM())continue;let n=t.ǃrYR();if(n&&n.ǃrYg().ǃras(e,r))return!0}return!1}ǃras(e,r){return this.ǃhR(e,r)||this.ǃraL(e,r)}ǃrYh(e){if((e=!!e,this.ǃriS!==e)&&(this.ǃriS=e,this.ǃqi.setAttribute("visible",this.ǃriS?"true":"false"),!this.ǃriS))for(let e of this.ǃrVr)e.ǃYq(!1)}ǃraX(){return this.ǃrvI}ǃrai(){return this.ǃcD}ǃrYQ(){return!this.ǃriS}ǃraT(){return this.ǃriS}ǃrYP(){return!!this.ǃrYm}ǃrYI(){return!this.ǃrYm}ǃrYb(){return this.ǃrYc}ǃra_(e){this.ǃrYc&&(this.ǃcD=!!e,this.ǃrYh(this.ǃcD))}ǃral(){return this.ǃqi.scrollHeight>this.ǃqi.clientHeight}ǃrYw(){return!!this.ǃqi.parentNode}ǃrar(){return this.ǃqi.parentNode}static ǃCL(){return!!T}static ǃrHm(){T&&(assert(!T.ǃ_W(),"menu was released"),T.ǃvb(T.ǃrYb()),T=null)}static ǃrLL(){T&&(assert(!T.ǃ_W(),"menu was released"),T.ǃraJ(),T.ǃTq(),T=null)}static ǃrrB(e,r,t){return!!T&&(assert(!T.ǃ_W(),"menu was released"),t&&T.ǃAt()!==t?!1:T.ǃras(e,r))}static ǃMe(r){T&&(assert(!T.ǃ_W(),"menu was released"),T.ǃrYk(),!T.ǃras(r.detail.clientX,r.detail.clientY)&&(T.ǃrYb()&&(r.stopPropagation(),r.preventDefault()),ǃr.ǃo.ǃr$.ǃrHm()))}ǃOE(r){if(!this.ǃ_W())for(let e of this.ǃrVr){if(!e.ǃrYM())continue;if(e.ǃOE(r),!e.ǃrYx())continue;let t=e.ǃrYR();t.ǃrat()&&(t.ǃOE(r),t.ǃrYg().ǃOE(r))}}static ǃkK(r){T&&(r.which!==ǃr.ǃrO.ǃns||ǃr.ǃo.ǃr$.ǃrHm())}static ǃrYK(r){ǃr.ǃo.ǃr$.ǃCL()&&(r.preventDefault(),r.stopPropagation())}}}{const e={ǃvv:!1,bold:!1,ǃvi:"",ǃvw:!1,ǃra$:!1};ǃr.ǃo.ǃr$.ǃrYl=class extends ǃr.ǃT_{constructor(r,t,n,i,o){if(ǃr.ǃ$(r,ǃr.ǃo.ǃr$),ǃr.ǃVm(t,ǃr.ǃo.ǃVK),ǃr.ǃk(n),ǃr.ǃzO(i),ǃr.ǃVg(o),o=Object.assign({},e,o),ǃr.ǃk(o.ǃvi),super(),this.ǃraf=r,this.ǃraz=null,this.ǃqi=ǃr.ǃo.ǃUd("ui-menuitem",this.ǃraf.ǃrYa()),this.ǃqi.setAttribute("role","menuitem"),this.ǃrsC=null,this.ǃSP=!1,this.ǃrDR=0,this.ǃraF=0,this.ǃram=!1,this.ǃrah=!0,this.ǃjS=null,this.ǃr$Q=null,t){this.ǃjS=ǃr.ǃq(ǃr.ǃo.ǃnI,{icon:t,ǃr$A:o.ǃvw},this.ǃqi);let e=t.ǃzI();e&&e.ǃzE().then((e)=>{this.ǃjS&&(this.ǃjS.ǃr$y(e),this.ǃjS=null,this.ǃr$Q=e)})}else this.ǃjS=ǃr.ǃq(ǃr.ǃo.ǃnI,this.ǃraf.ǃrhR(),this.ǃqi);this.ǃran=ǃr.ǃo.ǃUd("span",this.ǃqi,null,"menu-item-text"),this.ǃran.textContent=n,this.ǃrFE=i,this.ǃraV=!!o.ǃvv,this.ǃrap=!!o.ǃra$,o.bold&&this.ǃqi.setAttribute("bold",""),o.ǃvi&&this.ǃqi.setAttribute("title",o.ǃvi),this.ǃSw=(r)=>this.ǃMe(r),this.ǃqi.addEventListener("UIPointerDown",this.ǃSw),this.ǃOC=(r)=>this.ǃMQ(r),this.ǃqi.addEventListener("UIPointerUp",this.ǃOC,!0),this.ǃraB=null,this.ǃrad=new Promise((e)=>{this.ǃraB=e}),this.ǃrac=!1,this.ǃraH=(r)=>this.ǃrt(r),this.ǃqi.addEventListener("contextmenu",this.ǃraH,!0)}ǃMI(){this.ǃraz&&(this.ǃraz.ǃTq(),this.ǃraz=null),this.ǃjS&&(this.ǃjS.ǃTq(),this.ǃjS=null),ǃr.ǃo.ǃrv(this.ǃr$Q),this.ǃr$Q=null,this.ǃran&&(ǃr.ǃo.ǃrv(this.ǃran),this.ǃran=null),this.ǃqi&&(this.ǃqi.removeEventListener("contextmenu",this.ǃraH,!0),this.ǃqi.removeEventListener("UIPointerUp",this.ǃOC,!0),this.ǃOC=null,this.ǃqi.removeEventListener("UIPointerDown",this.ǃSw),this.ǃSw=null,ǃr.ǃo.ǃrv(this.ǃqi),this.ǃqi=null),this.ǃraB=null,this.ǃrad=null,this.ǃraf=null,this.ǃrFE=null,this.ǃrsC=null,ǃr.ǃTq(this)}ǃUh(){return this.ǃqi}ǃrYR(){return this.ǃraz}ǃrYg(){return this.ǃraf}ǃXE(){let e=this.ǃrYg();do{if(e.ǃrYI())return e;e=e.ǃrYq().ǃrYg()}while(e);throw new Error("unable to get root menu")}ǃrYM(){return!0}ǃrYx(){return!!this.ǃrYR()}ǃraU(e){return(e=!!e,e)?(this.ǃrsC=this.ǃqi.getBoundingClientRect(),this.ǃrsC):(this.ǃrsC||(this.ǃrsC=this.ǃqi.getBoundingClientRect()),this.ǃrsC)}ǃrYy(e){ǃr.ǃVg(e);this.ǃraz||(assert(!this.ǃrFE,"submenu items should not have a callback function"),this.ǃraz=ǃr.ǃq(ǃr.ǃo.ǃr$.ǃraD,this,this.ǃraf.ǃrhR(),e))}ǃraY(){}ǃraa(){}ǃMe(r){this.ǃraf.ǃXI()&&(this.ǃrac=r.detail.ǃnT!==ǃr.ǃGV.ǃxV||this.ǃXE().ǃrYb()?!1:!0,!this.ǃraf.ǃral()&&(r.preventDefault(),r.stopPropagation()),this.ǃrDR=r.detail.clientX,this.ǃraF=r.detail.clientY,r.detail.ǃyF&&this.ǃraf.ǃrav(this))}ǃOE(r){if(!ǃr.ǃ_W(this)&&!this.ǃXE().ǃrYb()){let e=this.ǃrah||this.ǃraf.ǃrYW(),t=this.ǃhR(r.detail.clientX,r.detail.clientY,e);!this.ǃram&&t?(this.ǃram=!0,this.ǃrah=!1,this.ǃraY(r)):this.ǃram&&!t&&(this.ǃram=!1,this.ǃraa(r))}}ǃMQ(r){if(this.ǃraf.ǃXI()&&(r.preventDefault(),r.detail.ǃnT!==ǃr.ǃGV.ǃGn)){if(r.detail.ǃyF){let e=this.ǃrYg();if(!this.ǃhR(r.detail.clientX,r.detail.clientY))return void e.ǃrav(null);if(e.ǃrYW())return void e.ǃrav(null)}if(this.ǃrYx())return void((!this.ǃraz.ǃXI()||r.detail.ǃyF)&&this.ǃraf.ǃrYZ());let e=r.detail.clientX,t=r.detail.clientY;return ǃr.ǃyp(this.ǃrDR,this.ǃraF,e,t)>=25?void this.ǃraf.ǃrav(null):void(this.ǃrFE&&(this.ǃraV?this.ǃrFE():window.setTimeout(this.ǃrFE,16)),!this.ǃrap&&(this.ǃrac?this.ǃrad.then(()=>{ǃr.ǃo.ǃr$.ǃrHm()}):ǃr.ǃo.ǃr$.ǃrHm()))}}ǃrt(r){r.preventDefault(),r.stopPropagation(),this.ǃraB()}ǃhR(e,r,t){ǃr.ǃ$t(e),ǃr.ǃ$t(r);let n=this.ǃrYg();return n.ǃraX()||!n.ǃrai()||n.ǃrYQ()?!1:(t=!!t,this.ǃrsC=this.ǃraU(t),e>=this.ǃrsC.left&&r>=this.ǃrsC.top&ðis.ǃMQ(r),this.ǃSw=(r)=>this.ǃMe(r),this.ǃrvP=null,this.ǃraf=ǃr.ǃq(ǃr.ǃo.ǃr$,this.ǃrYt,this.ǃrh_,this.ǃraq,t)}ǃTq(){this.ǃraI(),this.ǃraE(),this.ǃrYt.removeEventListener("UIPointerUp",this.ǃOC),this.ǃrYt.removeEventListener("UIPointerDown",this.ǃSw),this.ǃrYt.removeEventListener("contextmenu",ǃr.ǃo.ǃku,!0),this.ǃjS&&(this.ǃjS.ǃTq(),this.ǃjS=null),ǃr.ǃo.ǃrv(this.ǃr$Q),this.ǃr$Q=null,this.ǃraf&&!ǃr.ǃ_W(this.ǃraf)&&this.ǃraf.ǃUh()&&this.ǃraf.ǃTq(),this.ǃraf=null,this.ǃOC=null,this.ǃSw=null,this.ǃrYt=null,this.ǃraq=null,ǃr.ǃTq(this)}ǃrYg(){return this.ǃraf}ǃrat(){return this.ǃraA}ǃXE(){let e=this.ǃraq.ǃrYg();do{if(e.ǃrYI())return e;e=e.ǃrYq().ǃrYg()}while(e);throw new Error("unable to get root menu")}ǃrz(e,r,t,n){return this.ǃraC(),this.ǃrYg().ǃrz(e,r,t,n)}ǃv$(){return this.ǃraC(),this.ǃrYg().ǃv$()}ǃvs(e,r){return this.ǃraC(),this.ǃrYg().ǃvs(e,r)}ǃjW(){this.ǃrYg().ǃjW()}ǃjG(){this.ǃrYg().ǃjG()}ǃrYS(){this.ǃrYg().ǃrYS()}ǃMe(){this.ǃraW=!1,this.ǃraG=!1}ǃMQ(r){if(!(r.detail.ǃyF&&this.ǃraf.ǃraX())&&r.detail.ǃnT!==ǃr.ǃGV.ǃGn){if(r.detail.ǃyF){let e=this.ǃraq.ǃrYg();if(this.ǃraq.ǃhR(r.detail.clientX,r.detail.clientY)){if(this.ǃXE().ǃrYb()&&(this.ǃraW||this.ǃraG))return void e.ǃrav(null);if(e.ǃrYW())return void e.ǃrav(null)}else return void e.ǃrav(null)}this.ǃray()}}ǃraY(){this.ǃraI(),this.ǃraE(),this.ǃraO=setTimeout(()=>{this.ǃrab()},300)}ǃraa(){this.ǃrak=!1,this.ǃraM=!1,this.ǃraI(),this.ǃraE(),this.ǃrcZ=setTimeout(()=>{this.ǃraS(this.ǃraR,this.ǃrag)},500)}ǃOE(r){if(ǃr.ǃ_W(this))return;this.ǃraR=r.detail.clientX,this.ǃrag=r.detail.clientY;let e=this.ǃrax||!this.ǃraf.ǃrYW(),t=this.ǃraq.ǃhR(this.ǃraR,this.ǃrag,e);!this.ǃrak&&t?(this.ǃrak=!0,this.ǃrax=!1,this.ǃXE().ǃrYb()||this.ǃraY(r)):this.ǃrak&&!t&&(this.ǃrak=!1,this.ǃXE().ǃrYb()?this.ǃraW=!0:this.ǃraa(r)),t=this.ǃraf.ǃhR(this.ǃraR,this.ǃrag),!this.ǃraM&&t?this.ǃraM=!0:this.ǃraM&&!t&&(this.ǃraM=!1,this.ǃXE().ǃrYb()?this.ǃraG=!0:this.ǃraa(r))}ǃraI(){-1!==this.ǃraO&&(clearTimeout(this.ǃraO),this.ǃraO=-1)}ǃraE(){-1!==this.ǃrcZ&&(clearTimeout(this.ǃrcZ),this.ǃrcZ=-1)}ǃXI(){return this.ǃrYg().ǃXI()}ǃray(){this.ǃraq.ǃrYg().ǃra_(!1);let e=this.ǃrYg();if(!e.ǃXI()){this.ǃraI(),this.ǃraE();let r=this.ǃraq.ǃrYg();if(0===this.ǃUSP&&0===this.ǃUSw&&0===this.ǃUSZ){let e=r.ǃrYA(),t=this.ǃraq.ǃraU(!0);this.ǃUSP=t.left+t.width,this.ǃUSw=t.top-e,this.ǃUSZ=t.bottom+e}else if(r.ǃrYW()){let e=r.ǃrYA(),t=this.ǃraq.ǃraU(!0);this.ǃUSP=t.left+t.width,this.ǃUSw=t.top-e,this.ǃUSZ=t.bottom+e}e.ǃrp(this.ǃUSP,this.ǃUSw,this.ǃUSZ),this.ǃXE().ǃrYb()&&e.ǃrYj(()=>this.ǃrao())}}ǃrab(){this.ǃraO=-1;this.ǃrYg().ǃXI()||(this.ǃraq.ǃrYg().ǃrYZ(),this.ǃray())}ǃraS(e,r){ǃr.ǃ$t(e),ǃr.ǃ$t(r),this.ǃrcZ=-1;let t=this.ǃrYg();t.ǃXI()&&!t.ǃras(e,r)&&t.ǃvb()}ǃraC(){if(!this.ǃraA){this.ǃrYt.setAttribute("sub-menu","full");let e=app.ǃJW("menu-submenu");this.ǃjS=ǃr.ǃq(ǃr.ǃo.ǃnI,e,this.ǃrYt);let r=e.ǃzI();r&&r.ǃzE().then((e)=>{this.ǃjS&&(this.ǃjS.ǃr$y(e),this.ǃjS=null,this.ǃr$Q=e)}),this.ǃrYt.addEventListener("UIPointerUp",this.ǃOC),this.ǃrYt.addEventListener("UIPointerDown",this.ǃSw),this.ǃrYt.addEventListener("contextmenu",ǃr.ǃo.ǃku,!0),this.ǃraA=!0;const t=this.ǃXE();if(t.ǃrYb()){const e=this.ǃrYg(),r=e.ǃrYS();r&&e.ǃrYo(),e.ǃrz(app.ǃrYO("back",t.ǃrhR()),lang("common.back"),()=>this.ǃrao(),{ǃra$:!0}),e.ǃv$(),r&&e.ǃjW()}}}ǃrao(){this.ǃraq&&(this.ǃraq.ǃrYg().ǃra_(!0),this.ǃraf.ǃvb())}}}{function r(e,r){return!!e==!!r}ǃr.ǃo.ǃraj=class{constructor(...e){if(2>e.length)throw new Error("missing arguments");this.ǃrFE=null,this.ǃUwD="",this.ǃrae=e[e.length-2],this.ǃraN=!1,this.ǃraK=!1,this.ǃraP=!1,this.ǃraw=!1,this.ǃraQ=!1;let r=[];for(let t=0,n=e.length-2,i;tthis.ǃkK(r,!1)),e.addEventListener("external-keydown",(r)=>this.ǃkK(r.ǃcN,!0))}ǃrqL(e){ǃr.ǃXR(e,ǃr.ǃo.ǃraj),ǃr.ǃdx(this.ǃrqv,e)}ǃrqs(){this.ǃrqJ=!1}ǃkK(r,e){if(window.C3_IsPopupWindow)return void window.opener.postMessage({type:"keydown-event",event:{key:r.key,keyCode:r.keyCode,keyIdentifier:r.keyIdentifier,keyLocation:r.keyLocation,code:r.code,location:r.location,char:r.char,charCode:r.charCode,which:r.which,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,altKey:r.altKey,metaKey:r.metaKey}},location.origin);const t=ǃr.ǃkw();for(let n of this.ǃrqv)if((!t||n.ǃrau())&&n.ǃrqU(r))return this.ǃrqJ=!0,n.ǃrqr(this.ǃr$K),ǃr.ǃo.ǃr$.ǃrHm(),void(!e&&this.ǃrqJ&&r.preventDefault())}},"use strict",ǃr.ǃrqX=class extends ǃr.ǃT_{constructor(e,r){super(),ǃr.ǃ$(e,ǃr.ǃQL.constructor),ǃr.ǃk(r),this.ǃrUh=e,this.ǃrUm=r,this.ǃrqi=`@font-face {
font-family: '${this.ǃrUm}';
src: `,this.ǃrq_=null,this.ǃrql="",this.ǃrqt=[],this.ǃrq$=null}ǃTi(){return this.ǃrUm}ǃrrg(e,r,t,n){ǃr.ǃ$(e,Blob),ǃr.ǃk(r),ǃr.ǃk(t);let i=URL.createObjectURL(e);this.ǃrqt.push(i),this.ǃrqi+=`url('${i}')`;let o=ǃr.ǃQL.ǃrqf(r,t);o&&(this.ǃrqi+=` format('${o}')`),this.ǃrqi+=n?";\n}":", "}ǃrqz(){return this.ǃrq_=new Blob([this.ǃrqi],{type:"text/css"}),this.ǃrql=URL.createObjectURL(this.ǃrq_),ǃr.ǃUbL(this.ǃrql).then((e)=>(this.ǃrq$=e,this.ǃrq$.setAttribute("data-comment","webfont-"+this.ǃrUm),document.fonts.load("1em '"+this.ǃrUm+"'"))).then(()=>(ǃr.ǃQL.ǃrqF(this),this))}ǃTq(){if(this.ǃrUh){this.ǃrUh.ǃrqm(this),this.ǃrUh=null;for(let e of this.ǃrqt)URL.revokeObjectURL(e);ǃr.ǃXk(this.ǃrqt),this.ǃrql&&(URL.revokeObjectURL(this.ǃrql),this.ǃrql=""),this.ǃrq_=null,ǃr.ǃo.ǃrv(this.ǃrq$),this.ǃrq$=null}}},"use strict";{class e extends ǃr.Event.ǃUU{constructor(){super(),this.ǃrqh=new Map}ǃrqn(e,r){if(ǃr.ǃk(e),ǃr.ǃre(r),this.ǃrqh.has(e.toLowerCase()))return Promise.resolve(this.ǃrqh.get(e.toLowerCase()));let t=ǃr.ǃq(ǃr.ǃrqX,this,e);r=this.ǃrqV(r);for(let n=0,i=r.length,o;n{r.ǃrvn.ǃrTQ()&&!r.ǃrvn.ǃrJc()||ǃr.ǃo.ǃrqd.ǃrqB()}),ǃr.ǃo.ǃut.addEventListener("hidemodal",(r)=>{r.ǃrvn.ǃrTQ()&&!r.ǃrvn.ǃrJc()||ǃr.ǃo.ǃrqd.ǃTq()}),ǃr.ǃo.ǃrqd=class{constructor(){}static ǃTq(){for(let e of this.ǃrqc.values()){for(let r of e)r.ǃMI(!1);ǃr.ǃXk(e)}}static ǃrqH(e){ǃr.ǃ$(e,ǃr.ǃo.Notification);let r=this.ǃrqc.get(e.ǃrqD());r.unshift(e);for(let t=0;t=this.ǃrqa+1){let e=r[r.length-1];this.ǃrqq(e),e.ǃrcK()}}static ǃrqA(e){ǃr.ǃ$(e,ǃr.ǃo.Notification),this.ǃrqq(e)}static ǃrqW(e){ǃr.ǃ$(e,ǃr.ǃo.Notification);let r=this.ǃrqc.get(e.ǃrqD());for(let t=0,i;tthis.ǃrqC(),this.ǃrqy=()=>this.ǃrqb(),this.ǃrqS=()=>this.ǃrqo(),this.ǃrqj=()=>this.ǃrcK(),this.ǃrqe=(r)=>this.ǃrqN(r),this.ǃrqK=(r)=>this.ǃrqP(r),this.ǃqi=ǃr.ǃo.ǃUd("ui-notification"),this.ǃrqw=null,this.ǃrqg&&(this.ǃrqw=ǃr.ǃo.ǃut.ǃrTh()),this.ǃrqw?(this.ǃrqw.ǃUh().appendChild(this.ǃqi),this.ǃrqw.addEventListener("positionchange",this.ǃrqE),this.ǃrqw.addEventListener("widthchange",this.ǃrqE),this.ǃrqw.addEventListener("heightchange",this.ǃrqE),this.ǃrqw.addEventListener("startdragging",this.ǃrqS),this.ǃrqw.addEventListener("finishdragging",this.ǃrqy),this.ǃrqw.addEventListener("startresizing",this.ǃrqS),this.ǃrqw.addEventListener("finishresizing",this.ǃrqy)):(document.body.appendChild(this.ǃqi),this.ǃqi.setAttribute("document-parent","")),this.ǃqi.setAttribute("align",this.ǃrcQ),this.ǃqi.style.transitionDuration=d.duration,this.ǃrHU=ǃr.ǃo.ǃUd("ui-notification-icon",this.ǃqi),this.ǃrHr=ǃr.ǃo.ǃUd("ui-notification-text",this.ǃqi),this.ǃN$=ǃr.ǃq(ǃr.ǃo.ǃnI,n),this.ǃrHU.appendChild(this.ǃN$.ǃUh()),this.ǃe$=ǃr.ǃo.ǃUd("ui-notification-title",this.ǃrHr),this.ǃHP=ǃr.ǃo.ǃUd("ui-notification-body",this.ǃrHr),ǃr.ǃzL(this.ǃe$,this.ǃrce),ǃr.ǃzL(this.ǃHP,this.ǃrcN),this.ǃUBq=this.ǃqi.getBoundingClientRect().height,ǃr.ǃo.ǃrqd.ǃrqH(this),app.ǃjU()||(this.ǃqi.style.transition="none"),this.ǃrqQ()}ǃMI(e=!0){ǃr.ǃ_W(this)||this.ǃ_a||(clearTimeout(this.ǃrqR),this.ǃ_a=!0,e=!!e,e&&ǃr.ǃo.ǃrqd.ǃrqA(this),this.ǃrqw&&(this.ǃrqw.removeEventListener("positionchange",this.ǃrqE),this.ǃrqw.removeEventListener("widthchange",this.ǃrqE),this.ǃrqw.removeEventListener("heightchange",this.ǃrqE),this.ǃrqw.removeEventListener("startdragging",this.ǃrqS),this.ǃrqw.removeEventListener("finishdragging",this.ǃrqy),this.ǃrqw.removeEventListener("startresizing",this.ǃrqS),this.ǃrqw.removeEventListener("finishresizing",this.ǃrqy),this.ǃrqw=null,this.ǃrqE=null,this.ǃrqS=null,this.ǃrqy=null),this.ǃqi.removeEventListener("transitionend",this.ǃrqe),this.ǃrqe=null,this.ǃqi.removeEventListener("transitionend",this.ǃrqK),this.ǃrqK=null,this.ǃraE(),this.ǃN$&&this.ǃN$.ǃTq(),ǃr.ǃo.ǃrv(this.ǃe$),ǃr.ǃo.ǃrv(this.ǃrHU),ǃr.ǃo.ǃrv(this.ǃrHr),ǃr.ǃo.ǃrv(this.ǃqi),this.ǃrHU=null,this.ǃrHr=null,this.ǃN$=null,this.ǃe$=null,this.ǃHP=null,this.ǃqi=null,ǃr.ǃTq(this))}ǃrqD(){return this.ǃrcQ}ǃrqZ(){return this.ǃrcw}ǃrqM(){return this.ǃUBq+5}ǃrqY(e){ǃr.ǃ$t(e),e>=ǃr.ǃo.ǃrqd.ǃrqa-1&&(e=ǃr.ǃo.ǃrqd.ǃrqa-1);this.ǃrqO===e||(this.ǃrqO=e,this.ǃrqC())}ǃrqQ(){this.ǃrqC(),this.ǃqi.setAttribute("showing",this.ǃrcQ),app.ǃjU()?this.ǃqi.addEventListener("transitionend",this.ǃrqe):ǃr.ǃo.ǃrqd.ǃrqW(this)}ǃrqN(e){ǃr.ǃ_W(this)||this.ǃ_a||"transform"!==e.propertyName||(this.ǃqi.removeEventListener("transitionend",this.ǃrqe),ǃr.ǃo.ǃrqd.ǃrqW(this))}ǃrqu(){this.ǃrqI||(this.ǃrqI=!0,this.ǃqi.removeAttribute("showing"),("top-left"===this.ǃrcQ||"bottom-left"===this.ǃrcQ)&&this.ǃqi.setAttribute("hiding-left",""),("top-right"===this.ǃrcQ||"bottom-right"===this.ǃrcQ)&&this.ǃqi.setAttribute("hiding-right",""),app.ǃjU()?(this.ǃqi.addEventListener("transitionend",this.ǃrqK),this.ǃrqR=setTimeout(()=>{this.ǃMI()},5e3)):this.ǃMI())}ǃrqP(e){ǃr.ǃ_W(this)||this.ǃ_a||"transform"!==e.propertyName||(this.ǃqi.removeEventListener("transitionend",this.ǃrqK),this.ǃMI())}ǃraE(){clearTimeout(this.ǃrcZ)}ǃrqG(){this.ǃrcZ=setTimeout(this.ǃrqj,this.ǃrcw)}ǃrAU(){this.ǃqi.setAttribute("no-position-transitions","")}ǃrqo(){this.ǃqi.setAttribute("no-transitions","")}ǃrqb(){this.ǃqi.removeAttribute("no-transitions")}ǃrAr(){return!this.ǃqi.hasAttribute("no-transitions")}ǃrcK(){this.ǃraE(),this.ǃrAr()||(this.ǃrqb(),this.ǃrAU()),this.ǃrqu()}ǃrqC(){let e=this.ǃqi.style,r=ǃr.ǃo.ǃrqd.ǃrqk(this);if(this.ǃrqw&&!this.ǃrqw.ǃrJm()){let t=this.ǃqi.ownerDocument,n=t.defaultView,i=n.innerWidth||t.documentElement.clientWidth||t.body.clientWidth,o=n.innerHeight||t.documentElement.clientHeight||t.body.clientHeight,d=this.ǃrqw.ǃrLh(),a=this.ǃrqw.ǃrLn(),s=i-(d+this.ǃrqw.ǃ_v()),T=o-(a+this.ǃrqw.ǃ_L());"top-left"===this.ǃrcQ?(e.left=`${-d}px`,e.top=`${-a+r}px`):"top-right"===this.ǃrcQ?(e.right=`${-s}px`,e.top=`${-a+r}px`):"bottom-left"===this.ǃrcQ?(e.left=`${-d}px`,e.bottom=`${-T+r}px`):"bottom-right"===this.ǃrcQ&&(e.right=`${-s}px`,e.bottom=`${-T+r}px`)}else"top-left"===this.ǃrcQ?(e.left=`${0}px`,e.top=`${r}px`):"top-right"===this.ǃrcQ?(e.right=`${0}px`,e.top=`${r}px`):"bottom-left"===this.ǃrcQ?(e.left=`${0}px`,e.bottom=`${r}px`):"bottom-right"===this.ǃrcQ&&(e.right=`${0}px`,e.bottom=`${r}px`)}static ǃrp(e,r,n,i){if(app.ǃrAT()){let o=ǃr.ǃo.ǃut.ǃrTh();o&&o.ǃrTQ()&&!i.ǃrqx&&!o.ǃrJd()||ǃr.ǃq(ǃr.ǃo.Notification,e,r,n,i,t)}}}}{const e=ǃr.ǃU(),r=e.getElementById("ui-loader-template");ǃr.ǃo.ǃrX=class{constructor(e){ǃr.ǃVm(e,HTMLElement),this.ǃmb=document.createElement("ui-loader");const t=r.content.cloneNode(!0);this.ǃmb.appendChild(t),e&&e.appendChild(this.ǃmb)}ǃJB(e){e?this.ǃmb.removeAttribute("hidden",""):this.ǃmb.setAttribute("hidden","")}ǃrl(){this.ǃmb.setAttribute("pause","")}ǃrAv(){this.ǃmb.removeAttribute("pause")}get ǃri(){return this.ǃmb.getElementsByTagName("ui-loader-message")[0].innerHTML}set ǃri(e){this.ǃmb.getElementsByTagName("ui-loader-message")[0].innerHTML=e}remove(){this.ǃmb.remove()}}}"use strict",ǃr.ǃUr=ǃr.ǃq(ǃr.Event.ǃUU),ǃr.ǃrAJ=class{constructor(e,r,t){if(ǃr.ǃk(e),ǃr.ǃyd(r),ǃr.ǃUyr(t,"#document"),t===document)throw new Error("component cannot reference main document");this.ǃUPm=e,this.ǃrAL=r,this.ǃrAs=t,this.ǃrAX=t.documentURI}ǃTq(){this.ǃUPm=null,this.ǃrAL=null,this.ǃrAs=null,this.ǃrAX=null}ǃux(){return this.ǃUPm}ǃB(){return this.ǃrAL}ǃU(){return this.ǃrAs}ǃrAi(){return this.ǃrAX}},"use strict";{const e="c3-user-settings",r=["account","account-access-code","account-login","account-logout","account-register","add","add-folder","addon","align-bottom","align-top","align-left","align-vcenter","align-hcenter","align-right","align-edge-left","align-edge-top","align-edge-right","align-edge-bottom","ambiguous","animation","array","arrow-pointer","archive","audio","back","bar","bookmark","breakpoint","breakpoint-active-left","breakpoint-active-right","brush","bucket","build","c3-mono","check","clear","cloud","close","closed-folder","code","collapsed","color","copy","crop","cross","cut","debug","delete","delete-all","delete-column","delete-row","dictionary","disabled","dot","download","dpad","dropbox","duplicate","edit","ellipse","eraser","error","event-comment","event-sheet","exit-fullscreen","expanded","export","external","eye-dropper","file","font","frame","fullscreen","generic-file","globe","global-variable","google-drive","goto","grid","hand","help","home","html","image","import","import-files","insert-row-before","insert-row-after","insert-column-before","insert-column-after","instance-variable","info","invisible","javascript","json","language","layers","layout","line","link","local-variable","location-pin","locked","loop-condition","menu-submenu","mirror-h","mirror-v","move-down","move-up","new","offline","onedrive","open","open-folder","open-popup","origin","paste","pause","play","polygon","preview","preview-debug","print","skip-previous","skip-next","rectangle","rectangle-select","redo","reload","remote-preview","remove","replace","resize","reverse","rotate-acw","rotate-cw","save","scirra-store","scroll","search","security-shield","select-all","send-to-back","send-to-front","settings","shopping-cart","sound","space-horiz","space-vert","star","statistics","style","thumbnail","timer","toggle-background","tools","touch","trigger-condition","undo","unlocked","update","upload","up-arrow","video","videogame","view","visible","warning","wrap-selection","xml","z-order","zoom-in","zoom-out","zoom-reset",{name:"effect",color:"--effect-icon-color"},{name:"family-overlay",color:"--family-overlay-icon-color"},{name:"image-point",color:"#FF0000"},{name:"invert",color:"--invert-icon-color"},{ǃrA_:"origin",name:"origin-cursor",color:"#FFFFFF"},{ǃrA_:"image-point",name:"image-point-cursor",color:"#00FFFF"}],t=new Set(["save","undo","redo","preview","preview-debug","menu-submenu","account"]),n=new Set(["animation","event-sheet","instance-variable","layout","loop-condition","trigger-condition"]),i=new Set(["effect"]),o=!!window.C3_IsPopupWindow;let d=!1;ǃr.ǃrvJ=class extends ǃr.Event.ǃUU{constructor(){var e=Math.round;if(super(),d)throw new Error("only one C3.App should be instantiated");d=!0,this.ǃrUm="MyApp",this.ǃrAl=new Map,this.ǃrAt=o,this.ǃrA$=null,this.ǃrAf=0,this.ǃrAz=0,this.ǃrAF=0,this.ǃrAm={},this.ǃrAh=!1,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{this.ǃrAf=e(1.54*ǃr.ǃo.ǃJQ()),this.ǃrAz=2*this.ǃrAf,this.ǃrAF=2*this.ǃrAz}):(this.ǃrAf=e(1.54*ǃr.ǃo.ǃJQ()),this.ǃrAz=2*this.ǃrAf,this.ǃrAF=2*this.ǃrAz),this.ǃrAn=new Map,this.ǃrAV=new Map,o||window.addEventListener("beforeunload",(r)=>this.ǃrAp(r)),window.app=this}ǃrAB(){this.ǃrAt||(this.ǃrA$=ǃr.ǃq(ǃr.ǃo.ǃu,"main",!1),this.ǃrA$.ǃrsb(!0))}ǃrAd(){C3_HideLoader(),ǃr.ǃo.ǃrrT("supportMessage"),ǃr.ǃo.ǃrrv("noscript"),ǃr.ǃo.ǃrrv("script[src$='supportCheck.js']"),ǃr.ǃo.ǃrrv("script[src$='es2015check.js']"),this.ǃrA$.ǃrsb(!1)}ǃTi(){return this.ǃrUm}ǃrrX(){return this.ǃrA$}ǃRK(){return this.ǃrAf}ǃvJ(){return this.ǃrAz}ǃKK(){return this.ǃrAF}ǃrhR(e){switch(ǃr.ǃk(e),e){case"small":return this.ǃrAf;case"medium":return this.ǃrAz;case"large":return this.ǃrAF;default:throw new Error("invalid icon size specifier");}}ǃrJm(){return this.ǃrAt}ǃrAc(){let r=new ǃr.Event("load");return r.app=this,r.ǃUT=this.ǃrAt,ǃr.ǃUr.ǃUPS(r)}ǃd(e){return ǃr.ǃk(e),this.ǃrAl.get(e)}ǃrAH(e){return ǃr.ǃk(e),this.ǃrAl.has(e)}ǃUv(r,t,n){if(ǃr.ǃk(r),ǃr.ǃyd(t),ǃr.ǃUyr(n,"#document"),n===document)throw new Error("cannot register component with main document");if(this.ǃrAH(r))throw new Error(`component id '${r}' already registered`);let i=ǃr.ǃq(ǃr.ǃrAJ,r,t,n);this.ǃrAl.set(r,i);let o=new ǃr.Event("registercomponent");o.app=this,o.ǃrAD=i,ǃr.ǃUr.dispatchEvent(o)}ǃrAY(r){if(ǃr.ǃk(r),!this.ǃrAH(r))throw new Error(`component id '${r}' is not registered`);let t=this.ǃrAl.get(r),n=new ǃr.Event("unregistercomponent");n.app=this,n.ǃrAD=t,ǃr.ǃUr.dispatchEvent(n),t.ǃTq(),this.ǃrAl.delete(r)}ǃvK(e){const r=this.ǃd(e);return r?r.ǃB():null}ǃrAa(){return{}}async ǃrAq(){const r=await localforage.getItem(e);return this.ǃrAm=Object.assign({},this.ǃrAa(),r),this.ǃrAh=!0,this.ǃrAm}ǃrAA(){return this.ǃrAh}ǃSk(){return this.ǃrAm}ǃrAW(){return localforage.setItem(e,this.ǃrAm).catch((e)=>this.ǃfQ(e))}ǃrAG(e){ǃr.ǃk(e);let r=new ǃr.Event(e);r.ǃrAk=this.ǃrAm,this.dispatchEvent(r)}ǃjU(){return!0}ǃUvS(){return!0}ǃrAM(){let e=document.body.parentElement,r=this.ǃUvS()?"highgfxmode":"lowgfxmode",t=this.ǃUvS()?"lowgfxmode":"highgfxmode";e.removeAttribute(t),e.setAttribute(r,"")}ǃrAx(){this.ǃrAM(),ǃr.ǃUEa();const e=[];for(const r of t)e.push(this.ǃrAn.get(r).ǃsm());return Promise.all(e)}ǃrAR(){const e=[];for(const[r,n]of this.ǃrAn.entries())t.has(r)||e.push(n.ǃsm());return Promise.all(e)}ǃrAg(){let e=ǃr.ǃo.ǃfl.ǃrrH();for(let t of r){let r=null,o=null,d;"object"==typeof t?(d=t.name,r=t.color,o=t.ǃrA_,r.startsWith("--")&&(r=ǃr.ǃo.ǃfl.ǃf_(r))):(d=t,n.has(t)&&(r=ǃr.ǃo.ǃfl.ǃf_("--project-item-icon-color")));let a=o?o:d,s=ǃr.ǃq(ǃr.ǃo.ǃrtR,this,`${e}${a}.svg`,{name:d,color:r});this.ǃrAn.set(d,s)}}ǃJW(e){ǃr.ǃk(e);let r=this.ǃrAn.get(e);if(r)return r.ǃLl();throw new Error(`common small icon '${e}' not found`)}ǃvL(e){ǃr.ǃk(e);let r=this.ǃrAn.get(e);if(r)return r.ǃrff();throw new Error(`common medium icon '${e}' not found`)}ǃPA(e){ǃr.ǃk(e);let r=this.ǃrAn.get(e);if(r)return r.ǃrfz();throw new Error(`common large icon '${e}' not found`)}ǃrAO(e,r){switch(ǃr.ǃk(e),ǃr.ǃk(r),r){case"small":return this.ǃJW(e);case"medium":return this.ǃvL(e);case"large":return this.ǃPA(e);default:throw new Error("invalid icon size");}}ǃrYO(e,r){return ǃr.ǃk(e),ǃr.ǃ$t(r),r<=this.ǃRK()?this.ǃJW(e):r<=this.ǃvJ()?this.ǃvL(e):this.ǃPA(e)}async ǃrfX(e){const r=ǃr.ǃo.ǃfl.ǃrrH();if(e.startsWith(r)){const r=ǃr.ǃUyV(e).toLowerCase(),t=await ǃr.ǃo.ǃfl.ǃrrD();return t.hasOwnProperty(r)?t[r]:ǃr.ǃUam(e)}return ǃr.ǃUam(e)}ǃrYX(e){return ǃr.ǃk(e),this.ǃrAn.get(e)||null}ǃLt(e){if(ǃr.ǃk(e),this.ǃrAV.has(e))return this.ǃrAV.get(e);let r=``,t=new Blob([r],{type:"image/svg+xml"}),n=URL.createObjectURL(t),i=ǃr.ǃq(ǃr.ǃo.ǃrtR,app,n,{});return this.ǃrAV.set(e,i),i}ǃrAI(){return this.ǃrAn.values()}ǃrAp(){}ǃfQ(e){console.warn("Storage write error:",e)}}}"use strict",ǃr.ǃzw={},"use strict";{function e(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]&&e[9]===r[9]&&e[10]===r[10]&&e[11]===r[11]&&e[12]===r[12]&&e[13]===r[13]&&e[14]===r[14]&&e[15]===r[15]}const r=new Map([["float",1],["percent",1],["sampler",1],["vec2",2],["vec3",3],["color",3],["vec4",4],["mat4",16]]);ǃr.ǃzw.ǃrAE=class{constructor(e,t,n){if(!r.has(n))throw new Error("invalid uniform type");this.ǃrAC=e,this.ǃrAy=this.ǃrAC.ǃrAb(),this.ǃrUm=t,this.ǃUPe=n,this.ǃrAS="color"===this.ǃUPe,this.ǃrAo=this.ǃrAy.getUniformLocation(this.ǃrAC.ǃUru(),t),this.ǃrAj=!!this.ǃrAo;const i=r.get(n);this.ǃrfu=new Float32Array(i),this.ǃrAe=new Float32Array(i)}ǃTq(){this.ǃrAC=null,this.ǃrAy=null,this.ǃrAo=null}ǃrAN(){return this.ǃrAj}ǃNZ(){return this.ǃUPe}ǃrAK(){return this.ǃrAS}ǃrAP(e){this.ǃrAN()&&(this.ǃrfu[0]=e,this.ǃrAe.set(this.ǃrfu),this.ǃrAy.uniform1f(this.ǃrAo,e))}ǃrAw(e){this.ǃrAN()&&(this.ǃrfu[0]=e,this.ǃrAe.set(this.ǃrfu),this.ǃrAy.uniform1i(this.ǃrAo,e))}ǃrAQ(e,r){this.ǃrAN()&&(this.ǃrfu[0]=e,this.ǃrfu[1]=r,this.ǃrAe.set(this.ǃrfu),this.ǃrAy.uniform2f(this.ǃrAo,e,r))}ǃrAZ(e,r,t){this.ǃrAN()&&(this.ǃrfu[0]=e,this.ǃrfu[1]=r,this.ǃrfu[2]=t,this.ǃrAe.set(this.ǃrfu),this.ǃrAy.uniform3f(this.ǃrAo,e,r,t))}ǃrAu(e,r,t,n){this.ǃrAN()&&(this.ǃrfu[0]=e,this.ǃrfu[1]=r,this.ǃrfu[2]=t,this.ǃrfu[3]=n,this.ǃrAe.set(this.ǃrfu),this.ǃrAy.uniform4f(this.ǃrAo,e,r,t,n))}ǃrWU(e){const r=this.ǃrfu;r[0]===e||(r[0]=e,this.ǃrAy.uniform1f(this.ǃrAo,e))}ǃrWr(e){const r=this.ǃrfu;r[0]===e||(r[0]=e,this.ǃrAy.uniform1i(this.ǃrAo,e))}ǃrWT(e,r){const t=this.ǃrfu;t[0]===e&&t[1]===r||(t[0]=e,t[1]=r,this.ǃrAy.uniform2f(this.ǃrAo,e,r))}ǃrWv(e,r,t){const n=this.ǃrfu;n[0]===e&&n[1]===r&&n[2]===t||(n[0]=e,n[1]=r,n[2]=t,this.ǃrAy.uniform3f(this.ǃrAo,e,r,t))}ǃrWJ(e,r,t,n){const i=this.ǃrfu;i[0]===e&&i[1]===r&&i[2]===t&&i[3]===n||(i[0]=e,i[1]=r,i[2]=t,i[3]=n,this.ǃrAy.uniform4f(this.ǃrAo,e,r,t,n))}ǃrWL(r){const t=this.ǃrfu;e(t,r)||(ǃr.ǃUyH(t,r,0),this.ǃrAy.uniformMatrix4fv(this.ǃrAo,!1,r))}ǃrWs(e){var r=Math.fround;const t=this.ǃrAe;return this.ǃrAK()?t[0]===r(e.ǃUSd())&&t[1]===r(e.ǃUSH())&&t[2]===r(e.ǃUSY()):t[0]===r(e)}ǃrWX(e){const r=this.ǃrAe;this.ǃrAK()?(r[0]=e.ǃUSd(),r[1]=e.ǃUSH(),r[2]=e.ǃUSY()):r[0]=e}ǃrWi(e){return this.ǃrAe[0]===Math.fround(e)}ǃrW_(e,r){var t=Math.fround;const n=this.ǃrAe;return n[0]===t(e)&&n[1]===t(r)}ǃrWl(e){this.ǃrAe[0]=e}ǃrWt(e,r){const t=this.ǃrAe;t[0]=e,t[1]=r}}}"use strict",ǃr.ǃzw.ǃrW$=class{static ǃrWf(e,r,t,n){const i=e.createShader(e.FRAGMENT_SHADER);if(e.shaderSource(i,r),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)){const r=e.getShaderInfoLog(i);throw e.deleteShader(i),new Error("Error compiling fragment shader: "+r)}const o=e.createShader(e.VERTEX_SHADER);if(e.shaderSource(o,t),e.compileShader(o),!e.getShaderParameter(o,e.COMPILE_STATUS)){const r=e.getShaderInfoLog(o);throw e.deleteShader(i),e.deleteShader(o),new Error("Error compiling vertex shader: "+r)}const d=e.createProgram();if(e.attachShader(d,i),e.attachShader(d,o),e.bindAttribLocation(d,0,"aPos"),e.bindAttribLocation(d,1,"aTex"),e.bindAttribLocation(d,2,"aPoints"),e.linkProgram(d),!e.getProgramParameter(d,e.LINK_STATUS)){const r=e.getProgramInfoLog(d);throw e.deleteShader(i),e.deleteShader(o),e.deleteProgram(d),new Error("Error linking shader program: "+r)}e.useProgram(d);const a=ǃr.ǃUjg(e.getProgramInfoLog(d)||"").trim();return a&&!ǃr.ǃUdG(a)&&console.info("[WebGL] Shader program '"+n+"' compilation log: "+a),e.deleteShader(i),e.deleteShader(o),d}constructor(e,r,t,n){const i=e.ǃAM(),o=ǃr.ǃzw.ǃrW$.ǃrWf(i,r.src,t,n);this.ǃrAy=i,this.ǃrUm=n,this.ǃrWz=o,this.ǃrWF=""===n;const d=i.getAttribLocation(o,"aPos"),a=i.getAttribLocation(o,"aTex"),s=i.getAttribLocation(o,"aPoints");-1!==d&&(i.bindBuffer(i.ARRAY_BUFFER,e.ǃrWm),i.vertexAttribPointer(d,2,i.FLOAT,!1,0,0),i.enableVertexAttribArray(d)),-1!==a&&(i.bindBuffer(i.ARRAY_BUFFER,e.ǃrWh),i.vertexAttribPointer(a,2,i.FLOAT,!1,0,0),i.enableVertexAttribArray(a)),-1!==s&&(i.bindBuffer(i.ARRAY_BUFFER,e.ǃrWn),i.vertexAttribPointer(s,4,i.FLOAT,!1,0,0),i.enableVertexAttribArray(s)),i.bindBuffer(i.ARRAY_BUFFER,null),this.ǃrWV=new ǃr.ǃzw.ǃrAE(this,"matP","mat4"),this.ǃrWp=new ǃr.ǃzw.ǃrAE(this,"matMV","mat4"),this.ǃrWB=new ǃr.ǃzw.ǃrAE(this,"color","vec4"),this.ǃrWd=new ǃr.ǃzw.ǃrAE(this,"samplerFront","sampler"),this.ǃrWc=new ǃr.ǃzw.ǃrAE(this,"pointTexStart","vec2"),this.ǃrWH=new ǃr.ǃzw.ǃrAE(this,"pointTexEnd","vec2"),this.ǃrWD=new ǃr.ǃzw.ǃrAE(this,"tileSize","vec2"),this.ǃrWY=new ǃr.ǃzw.ǃrAE(this,"tileSpacing","vec2"),this.ǃrWa=new ǃr.ǃzw.ǃrAE(this,"samplerBack","sampler"),this.ǃrWq=new ǃr.ǃzw.ǃrAE(this,"destStart","vec2"),this.ǃrWA=new ǃr.ǃzw.ǃrAE(this,"destEnd","vec2"),this.ǃrWW=new ǃr.ǃzw.ǃrAE(this,"srcStart","vec2"),this.ǃrWG=new ǃr.ǃzw.ǃrAE(this,"srcEnd","vec2"),this.ǃrWk=new ǃr.ǃzw.ǃrAE(this,"srcOriginStart","vec2"),this.ǃrWM=new ǃr.ǃzw.ǃrAE(this,"srcOriginEnd","vec2"),this.ǃrWx=new ǃr.ǃzw.ǃrAE(this,"pixelSize","vec2"),this.ǃrWR=new ǃr.ǃzw.ǃrAE(this,"seconds","float"),this.ǃrWg=new ǃr.ǃzw.ǃrAE(this,"layerScale","float"),this.ǃrWO=new ǃr.ǃzw.ǃrAE(this,"layerAngle","float"),this.ǃrWI=new ǃr.ǃzw.ǃrAE(this,"layoutStart","vec2"),this.ǃrWE=new ǃr.ǃzw.ǃrAE(this,"layoutEnd","vec2"),this.ǃrWC=!!(this.ǃrWx.ǃrAN()||this.ǃrWR.ǃrAN()||this.ǃrWa.ǃrAN()||this.ǃrWq.ǃrAN()||this.ǃrWA.ǃrAN()||this.ǃrWW.ǃrAN()||this.ǃrWG.ǃrAN()||this.ǃrWk.ǃrAN()||this.ǃrWM.ǃrAN()||this.ǃrWg.ǃrAN()||this.ǃrWO.ǃrAN()||this.ǃrWI.ǃrAN()||this.ǃrWE.ǃrAN()),this.ǃrWy=r.ǃrWb||0,this.ǃrWS=r.ǃrWo||0,this.ǃrWj=!!r.ǃrWe,this.ǃrWN=!!r.ǃrWK,this.ǃrWP=!!r.ǃrWw,this.ǃrWQ=!!r.ǃrWZ;const T=r.ǃby||[];this.ǃrWu=[],this.ǃrGU=this.ǃrWq.ǃrAN()||this.ǃrWA.ǃrAN(),this.ǃrGr=this.ǃrWx.ǃrAN()||this.ǃrWW.ǃrAN()||this.ǃrWG.ǃrAN()||this.ǃrWk.ǃrAN()||this.ǃrWM.ǃrAN(),this.ǃrGT=this.ǃrWj||this.ǃrGU||0!==this.ǃrWy||0!==this.ǃrWS,this.ǃrGv=!1,this.ǃrWB.ǃrAu(1,1,1,1),this.ǃrWd.ǃrAw(0),this.ǃrWa.ǃrAw(1),this.ǃrWc.ǃrAQ(0,0),this.ǃrWH.ǃrAQ(1,1),this.ǃrWD.ǃrAQ(0,0),this.ǃrWY.ǃrAQ(0,0),this.ǃrWq.ǃrAQ(0,0),this.ǃrWA.ǃrAQ(1,1),this.ǃrWW.ǃrAQ(0,0),this.ǃrWG.ǃrAQ(0,0),this.ǃrWk.ǃrAQ(0,0),this.ǃrWM.ǃrAQ(0,0),this.ǃrWx.ǃrAQ(0,0),this.ǃrWg.ǃrAP(1),this.ǃrWO.ǃrAP(0),this.ǃrWR.ǃrAP(0),this.ǃrWI.ǃrAQ(0,0),this.ǃrWE.ǃrAQ(0,0);for(const i of T){const e=i[0],r=i[2],t=new ǃr.ǃzw.ǃrAE(this,e,r);"color"===r?t.ǃrAZ(0,0,0):t.ǃrAP(0),this.ǃrWu.push(t)}}ǃTq(){this.ǃrAy.deleteProgram(this.ǃrWz),this.ǃrWz=null,this.ǃrAy=null}ǃTi(){return this.ǃrUm}ǃrAb(){return this.ǃrAy}ǃUru(){return this.ǃrWz}ǃrGJ(){return this.ǃrGU}ǃUro(){return this.ǃrWj}ǃUrb(){return this.ǃrWN}ǃrGL(){return this.ǃrWP}ǃrGs(){return 0!==this.ǃrWy||0!==this.ǃrWS}ǃUTU(){return this.ǃrWy}ǃUTr(){return this.ǃrWS}ǃrGX(){return this.ǃrGr}ǃrGi(){return this.ǃrGT}ǃrG_(e){return this.ǃrWu[e].ǃNZ()}ǃrGl(e){for(let r=0,t=e.length;r=this.ǃUBa||0>=this.ǃUBq)throw new Error("invalid texture data size");if(d.ǃsp){const e=document.createElement("canvas");e.width=this.ǃUBa,e.height=this.ǃUBq;const r=e.getContext("2d");r.drawImage(i,0,0,this.ǃUBa,this.ǃUBq),i=e}const a=ǃr.ǃUbu(this.ǃUBa)&&ǃr.ǃUbu(this.ǃUBq),s=this.ǃpW.ǃrkj();if(this.ǃUBa>s||this.ǃUBq>s)throw new Error("texture data exceeds maximum texture size");const T=this.ǃpW.ǃAM(),l=this.ǃpW.ǃUTe();this.ǃpd=T.createTexture(),T.bindTexture(T.TEXTURE_2D,this.ǃpd),T.pixelStorei(T.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d.ǃUCD);const u=e(this.ǃrkC,T);if(!this.ǃpW.ǃQu()&&!a&&this.ǃrkO){if(null===i)throw new Error("cannot pass null data when creating a NPOT tiled texture without NPOT support");if(i instanceof ArrayBuffer&&(i=new ImageData(new Uint8ClampedArray(i),this.ǃUBa,this.ǃUBq)),i instanceof ImageData){const e=document.createElement("canvas");e.width=this.ǃUBa,e.height=this.ǃUBq;const r=e.getContext("2d");r.putImageData(i,0,0),i=e}const e=document.createElement("canvas");e.width=ǃr.ǃFr(this.ǃUBa),e.height=ǃr.ǃFr(this.ǃUBq);const r=e.getContext("2d");r.imageSmoothingEnabled=this.ǃrkE,r.drawImage(i,0,0,this.ǃUBa,this.ǃUBq,0,0,e.width,e.height),T.texImage2D(T.TEXTURE_2D,0,u.ǃrkk,u.format,u.type,e)}else if(2<=l){let e;e=this.ǃrky?Math.floor(Math.log2(Math.max(this.ǃUBa,this.ǃUBq))+1):1,T.texStorage2D(T.TEXTURE_2D,e,u.ǃrkG,this.ǃUBa,this.ǃUBq),i instanceof ArrayBuffer?T.texSubImage2D(T.TEXTURE_2D,0,0,0,this.ǃUBa,this.ǃUBq,u.format,u.type,new Uint8Array(i)):null!==i&&T.texSubImage2D(T.TEXTURE_2D,0,0,0,u.format,u.type,i)}else i instanceof ArrayBuffer?T.texImage2D(T.TEXTURE_2D,0,u.ǃrkk,this.ǃUBa,this.ǃUBq,0,u.format,u.type,new Uint8Array(i)):null===i?T.texImage2D(T.TEXTURE_2D,0,u.ǃrkk,this.ǃUBa,this.ǃUBq,0,u.format,u.type,null):T.texImage2D(T.TEXTURE_2D,0,u.ǃrkk,u.format,u.type,i);null!==i&&this.ǃrke(T),T.bindTexture(T.TEXTURE_2D,null),this.ǃpW.ǃrkN(),this.ǃrkS=1,o.add(this)}ǃrkK(t,i,d){var a=Math.floor;if(ǃr.ǃ$t(t),ǃr.ǃ$t(i),ǃr.ǃVg(d),d=Object.assign({},n,d),this.ǃpd)throw new Error("already created texture");if(ǃr.ǃk(d.ǃpy),ǃr.ǃk(d.ǃrkM),this.ǃrkO=!!d.ǃpI,this.ǃrkI=d.ǃpy,this.ǃrkE=!!d.ǃpE,this.ǃrkC=d.ǃrkM,this.ǃrky=!!d.ǃZr,!r.has(this.ǃrkC))throw new Error("invalid pixel format");this.ǃrkg=!1,this.ǃUBa=a(t),this.ǃUBq=a(i);const s=ǃr.ǃUbu(this.ǃUBa)&&ǃr.ǃUbu(this.ǃUBq),T=this.ǃpW.ǃrkj();if(0>=this.ǃUBa||0>=this.ǃUBq)throw new Error("invalid texture size");if(this.ǃUBa>T||this.ǃUBq>T)throw new Error("texture exceeds maximum texture size");if(!this.ǃpW.ǃQu()&&this.ǃrkO&&!s)throw new Error("non-power-of-two tiled textures not supported");const l=this.ǃpW.ǃAM(),u=this.ǃpW.ǃUTe();this.ǃpd=l.createTexture(),l.bindTexture(l.TEXTURE_2D,this.ǃpd),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d.ǃUCD);const U=e(this.ǃrkC,l),c=2<=u?U.ǃrkG:U.ǃrkk;l.texImage2D(l.TEXTURE_2D,0,c,this.ǃUBa,this.ǃUBq,0,U.format,U.type,null),this.ǃrke(l),l.bindTexture(l.TEXTURE_2D,null),this.ǃpW.ǃrkN(),this.ǃrkS=1,o.add(this)}ǃrkP(e){if("default"===this.ǃrkb)return this.ǃrkg?e.NICEST:e.FASTEST;if("low"===this.ǃrkb)return e.FASTEST;if("high"===this.ǃrkb)return e.NICEST;throw new Error("invalid mipmap quality")}ǃrke(e){const r=ǃr.ǃUbu(this.ǃUBa)&&ǃr.ǃUbu(this.ǃUBq);if(!this.ǃrkO)e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);else if("repeat-x"===this.ǃrkI)e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);else if("repeat-y"===this.ǃrkI)e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT);else if("repeat"===this.ǃrkI)e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT);else throw new Error("invalid tile type");this.ǃrkE?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),(r||this.ǃpW.ǃQu())&&this.ǃrky?(e.hint(e.GENERATE_MIPMAP_HINT,this.ǃrkP(e)),e.generateMipmap(e.TEXTURE_2D),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),this.ǃrky=!1)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),this.ǃrky=!1)}ǃrkw(r,t){if(("undefined"==typeof HTMLImageElement||!(r instanceof HTMLImageElement))&&("undefined"==typeof HTMLCanvasElement||!(r instanceof HTMLCanvasElement))&&("undefined"==typeof ImageBitmap||!(r instanceof ImageBitmap))&&("undefined"==typeof ǃUTE||!(r instanceof ǃUTE))&&!(r instanceof ImageData))throw new Error("invalid texture source");if(!this.ǃpd||0>=this.ǃrkS)throw new Error("texture not created");if(this.ǃrkg)throw new Error("cannot update static texture");ǃr.ǃVg(t),t=Object.assign({},i,t),"undefined"!=typeof ǃUTE&&r instanceof ǃUTE&&(r=r.ǃQK());const n=r.width,o=r.height,d=this.ǃpW.ǃUTe(),a=this.ǃpW.ǃAM();a.bindTexture(a.TEXTURE_2D,this.ǃpd),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.ǃUCD);const s=e(this.ǃrkC,a),T=2<=d?s.ǃrkG:s.ǃrkk;try{if(this.ǃUBa===n&&this.ǃUBq===o){const e=ǃr.ǃUbu(this.ǃUBa)&&ǃr.ǃUbu(this.ǃUBq);a.texSubImage2D(a.TEXTURE_2D,0,0,0,s.format,s.type,r),(e||this.ǃpW.ǃQu())&&this.ǃrky&&(a.hint(a.GENERATE_MIPMAP_HINT,this.ǃrkP(a)),a.generateMipmap(a.TEXTURE_2D))}else{this.ǃUBa=n,this.ǃUBq=o;const e=ǃr.ǃUbu(this.ǃUBa)&&ǃr.ǃUbu(this.ǃUBq);if(!this.ǃpW.ǃQu()&&this.ǃrkO&&!e)throw new Error("non-power-of-two tiled textures not supported");a.texImage2D(a.TEXTURE_2D,0,T,s.format,s.type,r),(e||this.ǃpW.ǃQu())&&this.ǃrky&&(a.hint(a.GENERATE_MIPMAP_HINT,this.ǃrkP(a)),a.generateMipmap(a.TEXTURE_2D))}}catch(r){console.error("Error updating WebGL texture: ",r)}a.bindTexture(a.TEXTURE_2D,null),this.ǃpW.ǃrkN()}ǃrkQ(){if(0=this.ǃrkS)throw new Error("no more references");this.ǃrkS--}ǃrMv(){return this.ǃrkS}ǃ_v(){return this.ǃUBa}ǃ_L(){return this.ǃUBq}ǃrMJ(){return this.ǃrkg}ǃUUh(){const e=this.ǃUBa*this.ǃUBq;switch(this.ǃrkC){case"rgba8":e*=4;break;case"rgb8":e*=3;break;case"rgba4":case"rgb5_a1":case"rgb565":e*=2;}return this.ǃrky&&(e+=Math.floor(e/3)),e}static ǃLM(){o.clear()}static ǃrML(){return o.values()}}}{const e={ǃpE:!0,alpha:!0,ǃrMs:!0,ǃrMX:!0},r=new Set;ǃr.ǃzw.ǃUrC=class{constructor(e){ǃr.ǃ$(e,ǃr.ǃzw.ǃUrK),this.ǃpW=e,this.ǃrMi=null,this.ǃpd=null,this.ǃrM_=null,this.ǃUBa=0,this.ǃUBq=0,this.ǃrMl=!0,this.ǃrkE=!0,this.ǃrMt=!0,this.ǃrM$=!0}ǃTQ(t,n,i){if(ǃr.ǃ$t(t),ǃr.ǃ$t(n),ǃr.ǃVg(i),i=Object.assign({},e,i),this.ǃpd||this.ǃrM_)throw new Error("already created render target");if(this.ǃrkE=!!i.ǃpE,this.ǃrMt=!!i.alpha,this.ǃrM$=!!i.ǃrMs,this.ǃrMl=!!i.ǃrMX,2>this.ǃpW.ǃUTe()&&(this.ǃrM$=!0),this.ǃUBa=t,this.ǃUBq=n,0>=this.ǃUBa||0>=this.ǃUBq)throw new Error("invalid render target size");const o=this.ǃpW.ǃAM();if(this.ǃrMi=o.createFramebuffer(),o.bindFramebuffer(o.FRAMEBUFFER,this.ǃrMi),this.ǃrM$){this.ǃpd=this.ǃpW.ǃZU(this.ǃUBa,this.ǃUBq,{ǃpE:this.ǃrkE,ǃrkM:this.ǃrMt?"rgba8":"rgb8",ǃZr:!1});const e=this.ǃpd.ǃrku();o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,e,0)}else this.ǃrM_=o.createRenderbuffer(),o.bindRenderbuffer(o.RENDERBUFFER,this.ǃrM_),o.renderbufferStorage(o.RENDERBUFFER,this.ǃrMt?o.RGBA8:o.RGB8,this.ǃUBa,this.ǃUBq),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.RENDERBUFFER,this.ǃrM_),o.bindRenderbuffer(o.RENDERBUFFER,null);assert(o.checkFramebufferStatus(o.FRAMEBUFFER)===o.FRAMEBUFFER_COMPLETE,"WebGLRenderTarget framebuffer is incomplete"),o.bindFramebuffer(o.FRAMEBUFFER,null),r.add(this)}ǃrMf(e,r){if(this.ǃUBa!==e||this.ǃUBq!==r){this.ǃUBa=e,this.ǃUBq=r;const t=this.ǃpW.ǃAM();t.bindFramebuffer(t.FRAMEBUFFER,this.ǃrMi),this.ǃpd?this.ǃpd.ǃrkw(new ImageData(this.ǃUBa,this.ǃUBq)):(t.bindRenderbuffer(t.RENDERBUFFER,this.ǃrM_),t.renderbufferStorage(t.RENDERBUFFER,this.ǃrMt?t.RGBA8:t.RGB8,this.ǃUBa,this.ǃUBq),t.bindRenderbuffer(t.RENDERBUFFER,null)),assert(t.checkFramebufferStatus(t.FRAMEBUFFER)===t.FRAMEBUFFER_COMPLETE,"WebGLRenderTarget framebuffer is incomplete"),t.bindFramebuffer(t.FRAMEBUFFER,null)}}ǃrkQ(){if(!this.ǃpd&&!this.ǃrM_)throw new Error("already deleted render target");r.delete(this);const e=this.ǃpW.ǃAM();e.bindFramebuffer(e.FRAMEBUFFER,this.ǃrMi),this.ǃpd?(e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0),this.ǃpW.ǃpM(this.ǃpd),this.ǃpd=null):this.ǃrM_&&(e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,null),e.deleteRenderbuffer(this.ǃrM_),this.ǃrM_=null),e.bindFramebuffer(e.FRAMEBUFFER,null),2<=this.ǃpW.ǃUTe()&&(e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null)),e.deleteFramebuffer(this.ǃrMi),this.ǃpW.ǃrkr=null,this.ǃrMi=null}ǃrkU(){return this.ǃrMi}ǃsi(){return this.ǃpd}ǃUTP(){return this.ǃrkE}ǃrMz(){return this.ǃrMt}ǃrMF(){return this.ǃrM$}ǃ_v(){return this.ǃUBa}ǃ_L(){return this.ǃUBq}ǃrMm(){return this.ǃrMl}ǃUVL(){const e={ǃpE:this.ǃrkE,alpha:this.ǃrMt,ǃrMs:this.ǃrM$};return this.ǃrMl||(e.width=this.ǃUBa,e.height=this.ǃUBq),e}ǃrMh(r){return r=Object.assign({},e,r),!!r.ǃpE===this.ǃUTP()&&!!r.alpha===this.ǃrMz()&&!!r.ǃrMs===this.ǃrMF()&&("number"==typeof r.width||"number"==typeof r.height?!this.ǃrMm()&&this.ǃ_v()===r.width&&this.ǃ_L()===r.height:this.ǃrMm())}ǃrMn(){return this.ǃpd?this.ǃpd.ǃrku():null}ǃUUh(){return this.ǃpd?this.ǃpd.ǃUUh():this.ǃUBa*this.ǃUBq*(this.ǃrMt?4:3)}static ǃUrE(e,r){e.ǃrMV();const t=e.ǃUT_();let n,i,o;r?(n=r.ǃUBa,i=r.ǃUBq,o=r.ǃrMi):(n=e.ǃ_v(),i=e.ǃ_L(),o=null);const d=e.ǃAM();d.bindFramebuffer(d.FRAMEBUFFER,o);const a=new ImageData(n,i);d.readPixels(0,0,n,i,d.RGBA,d.UNSIGNED_BYTE,new Uint8Array(a.data.buffer));const s=ǃr.ǃUba(a);return d.bindFramebuffer(d.FRAMEBUFFER,null),e.ǃrMp=null,e.ǃrkr=null,e.ǃQI(t),s}static ǃLM(){r.clear()}static ǃrMB(){return r.values()}static ǃrMd(e,t){for(const n of r)n.ǃrMm()&&n.ǃrMf(e,t)}}}"use strict",ǃr.ǃzw.ǃrMc=class{constructor(e){this.ǃrAy=e.ǃAM(),this.ǃrMH=e.ǃUTe(),this.ǃrMD=e.ǃrMY(),this.ǃrMa=e.ǃrMq(),this.ǃrMA=null,this.ǃcD=!1,this.ǃrMW=!1,this.ǃrMG=0,this.ǃrMA=1===this.ǃrMH?this.ǃrMD.createQueryEXT():this.ǃrAy.createQuery()}ǃTq(){this.ǃrMk(),this.ǃrAy=null,this.ǃrMD=null,this.ǃrMW=!1}ǃrMk(){this.ǃrMA&&(1===this.ǃrMH?this.ǃrMD.deleteQueryEXT(this.ǃrMA):this.ǃrAy.deleteQuery(this.ǃrMA),this.ǃrMA=null)}ǃrMM(){if(this.ǃcD)throw new Error("query already active");1===this.ǃrMH?this.ǃrMD.beginQueryEXT(this.ǃrMD.TIME_ELAPSED_EXT,this.ǃrMA):this.ǃrAy.beginQuery(this.ǃrMD.TIME_ELAPSED_EXT,this.ǃrMA),this.ǃcD=!0}ǃrMx(){if(!this.ǃcD)throw new Error("query not active");1===this.ǃrMH?this.ǃrMD.endQueryEXT(this.ǃrMD.TIME_ELAPSED_EXT):this.ǃrAy.endQuery(this.ǃrMD.TIME_ELAPSED_EXT),this.ǃcD=!1}ǃrMR(){if(!this.ǃrMA||this.ǃrMW||this.ǃcD)return;let e=!1;e=1===this.ǃrMH?this.ǃrMD.getQueryObjectEXT(this.ǃrMA,this.ǃrMD.QUERY_RESULT_AVAILABLE_EXT):this.ǃrAy.getQueryParameter(this.ǃrMA,this.ǃrAy.QUERY_RESULT_AVAILABLE);const r=this.ǃrAy.getParameter(this.ǃrMD.GPU_DISJOINT_EXT);e&&!r&&(this.ǃrMG=1===this.ǃrMH?this.ǃrMD.getQueryObjectEXT(this.ǃrMA,this.ǃrMD.QUERY_RESULT_EXT):this.ǃrAy.getQueryParameter(this.ǃrMA,this.ǃrAy.QUERY_RESULT),this.ǃrMG/=1e9,this.ǃrMW=!0),(e||r)&&this.ǃrMk()}ǃrMg(){return this.ǃrMW}ǃrMO(){if(!this.ǃrMW)throw new Error("no result available");return this.ǃrMG}ǃrMq(){return this.ǃrMa}},"use strict",ǃr.ǃzw.ǃrMI=class{constructor(e,r=1e3){this.ǃpW=e,this.ǃrME=r,this.ǃUuK=[]}ǃTq(){this.ǃXG(),this.ǃpW=null}ǃXG(){for(const e of this.ǃUuK)e.ǃTq();ǃr.ǃXk(this.ǃUuK)}ǃrD(){const e=new ǃr.ǃzw.ǃrMc(this.ǃpW);if(this.ǃUuK.push(e),this.ǃUuK.length>this.ǃrME){const e=this.ǃUuK.shift();e.ǃTq()}return e}ǃrMC(e){for(const r of this.ǃUuK){if(r.ǃrMq()>=e)return;r.ǃrMR()}}ǃrMy(e,r){if(r<=e)return NaN;let t=0,n=0;for(const i of this.ǃUuK){if(i.ǃrMq()>=r)break;if(!(i.ǃrMq()"),this.ǃrx$=this.ǃrxb({src:r.ǃrGH()},t,""),this.ǃrkm=this.ǃrxb({src:r.ǃrGa()},r.ǃrGY(),""),this.ǃrxf=this.ǃrxb({src:r.ǃrGq()},t,""),this.ǃrxz=this.ǃrxb({src:r.ǃrGA()},t,""),this.ǃrxF=this.ǃrxb({src:r.ǃrGD()},t,""),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,null),this.ǃrxW=e.getParameter(e.MAX_TEXTURE_SIZE);const n=e.getParameter(e.ALIASED_POINT_SIZE_RANGE);this.ǃrxG=n[0],this.ǃrxk=n[1],2048=2*n-8&&(this.ǃrMV(),e=0),1===this.ǃrxn)this.ǃrxm[this.ǃrxh-1].ǃrGk+=6;else{const r=this.ǃrxP();r.ǃrGI(3*(e/2),6),this.ǃrxn=1}}ǃLG(e){this.ǃrRT(),e.ǃUS$(this.ǃrxT,this.ǃrxs),a.ǃUS$(this.ǃrxJ,this.ǃrxX),this.ǃrxs+=8,this.ǃrxX+=8}ǃrRr(e,r,t,n,i,o,d,s){this.ǃrRT();const T=this.ǃrxT;let l=this.ǃrxs;T[l++]=e,T[l++]=r,T[l++]=t,T[l++]=n,T[l++]=i,T[l++]=o,T[l++]=d,T[l++]=s,this.ǃrxs=l,a.ǃUS$(this.ǃrxJ,this.ǃrxX),this.ǃrxX+=8}ǃ_s(e,r){this.ǃrRT(),e.ǃUS$(this.ǃrxT,this.ǃrxs),r.ǃUor(this.ǃrxJ,this.ǃrxX),this.ǃrxs+=8,this.ǃrxX+=8}ǃ$U(e,r){this.ǃrRT(),e.ǃUS$(this.ǃrxT,this.ǃrxs),r.ǃUS$(this.ǃrxJ,this.ǃrxX),this.ǃrxs+=8,this.ǃrxX+=8}ǃrRv(){if(mat4.ǃze(u,this.ǃrxU),vec3.ǃze(T,this.ǃrMw),vec3.ǃze(l,this.ǃrMQ),this.ǃrMw[0]=0,this.ǃrMw[1]=0,this.ǃrMw[2]=100*d,this.ǃrMQ[0]=0,this.ǃrMQ[1]=0,this.ǃrMQ[2]=0,this.ǃQq(),this.ǃQW(),this.ǃrks){const e=this.ǃrk_/2,r=this.ǃrkl/2;c.set(-e,r,-e+this.ǃrk_,r-this.ǃrkl),U.ǃs$(c),c.set(0,0,this.ǃrk_/this.ǃUBa,this.ǃrkl/this.ǃUBq),this.ǃ_s(U,c)}else{const e=this.ǃUBa/2,r=this.ǃUBq/2;this.ǃUJe(-e,r,e,-r)}mat4.ǃze(this.ǃrMu,u),vec3.ǃze(this.ǃrMw,T),vec3.ǃze(this.ǃrMQ,l),this.ǃQW()}ǃUnA(e){const r=e.length/2;if(3>r)throw new Error("need at least 3 points");const t=r-2,n=e[0],o=e[1];for(let r=0;r=this.ǃrxH.length)throw new Error("cannot pop last line width - check push/pop pairs");this.ǃrxH.pop(),this.ǃrxc=this.ǃrxH[this.ǃrxH.length-1]}ǃrRn(){this.ǃrxD=0,this.ǃrxY[this.ǃrxY.length-1]=0}ǃrRV(){this.ǃrxD=1,this.ǃrxY[this.ǃrxY.length-1]=0}ǃrRp(){this.ǃrxD=2,this.ǃrxY[this.ǃrxY.length-1]=0}ǃrRB(){if(100<=this.ǃrxY.length)throw new Error("pushed too many line caps - check push/pop pairs");this.ǃrxY.push(0),this.ǃrxD=0}ǃBf(){if(100<=this.ǃrxY.length)throw new Error("pushed too many line caps - check push/pop pairs");this.ǃrxY.push(1),this.ǃrxD=1}ǃUJf(){if(100<=this.ǃrxY.length)throw new Error("pushed too many line caps - check push/pop pairs");this.ǃrxY.push(2),this.ǃrxD=2}ǃBz(){if(1>=this.ǃrxY.length)throw new Error("cannot pop last line cap - check push/pop pairs");this.ǃrxY.pop(),this.ǃrxD=this.ǃrxY[this.ǃrxY.length-1]}ǃQO(e){this.ǃrxa=e,this.ǃrxq[this.ǃrxq.length-1]=e}ǃrRd(){return this.ǃrxa}ǃLP(e){if(100<=this.ǃrxq.length)throw new Error("pushed too many line offsets - check push/pop pairs");this.ǃrxq.push(e),this.ǃrxa=e}ǃsX(){if(1>=this.ǃrxq.length)throw new Error("cannot pop last line offset - check push/pop pairs");this.ǃrxq.pop(),this.ǃrxa=this.ǃrxq[this.ǃrxq.length-1]}ǃdw(e){if(!this.ǃrxA.ǃav(e)){this.ǃrxA.ǃze(e);const r=this.ǃrxP();r.ǃrkt(e),this.ǃrxn=0}}ǃcb(e,r,t,n){this.ǃrxi>=i-4&&this.ǃrMV();let o=this.ǃrxi;if(2===this.ǃrxn)this.ǃrxm[this.ǃrxh-1].ǃrGk++;else{const e=this.ǃrxP();e.ǃrkz(o),this.ǃrxn=2}const d=this.ǃrxL;d[o++]=e,d[o++]=r,d[o++]=t,d[o++]=n,this.ǃrxi=o}ǃUrZ(e){if(this.ǃrxl!==e){const r=this.ǃrxP();r.ǃrkh(e),this.ǃrxl=e,this.ǃrxn=0}}ǃsf(){this.ǃUrZ(this.ǃrxt)}ǃrRc(){this.ǃUrZ(this.ǃrx$)}ǃLy(){this.ǃUrZ(this.ǃrxf)}ǃLw(){this.ǃUrZ(this.ǃrxz)}ǃtY(){this.ǃUrZ(this.ǃrxF)}ǃta(e,r,t,n,i,o,d){if(this.ǃrxl!==this.ǃrxF)throw new Error("must set tilemap fill mode first");const a=this.ǃrxP();a.ǃrkq(e,r,t,n,i,o,d),this.ǃrxn=0}ǃUTm(e,r,t,n,i,o,d,a,T,l,u){const U=this.ǃrxl,s=U.ǃrWC,c=!!u.length;if(s&&!U.ǃrG$(r,t,n,i,o,d,a,T,l)||c&&!U.ǃrGl(u)){const v=this.ǃrxP();if(v.ǃrkV(),s){U.ǃrGf(r,t,n,i,o,d,a,T,l);const s=v.ǃrGx;s[0]=o,s[1]=d,r.ǃUS$(s,2),s[6]=a,s[7]=T,t.ǃUS$(s,12);const u=v.ǃrGR;i.ǃUS$(u,0);const c=u[1];u[1]=u[3],u[3]=c,n.ǃUS$(v.ǃrGg,0),v.ǃrGG=l,U.ǃrWa.ǃrAN()?(e&&(e=e.ǃrMn()),assert(!e||!this.ǃrMp||e!==this.ǃrMp.ǃrMn(),"Warning: setting texture1 to current render texture"),v.ǃrGM=e):v.ǃrGM=null}c&&(U.ǃrGt(u),ǃr.ǃUnO(v.ǃrGO,u)),this.ǃrxn=0}}ǃUTs(e,r,t,n){const i=this.ǃrxP();i.ǃrkv(e,r,t,n),this.ǃrxn=0}ǃXG(e){const r=this.ǃrxP();r.ǃrkT(e),this.ǃrxn=0}ǃrRH(e,r,t,n){if(!(0>t||0>n)){const i=this.ǃrxP();i.ǃrkX(e,r,t,n),this.ǃrxn=0}}ǃUTX(e){this.ǃrRH(e.ǃsS(),e.ǃtq(),e.width(),e.height())}ǃQj(){this.ǃrMV(),this.ǃrRD(),this.ǃrAy.flush(),this.ǃrxE&&this.ǃrxE.ǃrMC(this.ǃrMa),this.ǃrMa++}ǃUZ$(){return this.ǃrAy.ǃrRY()}ǃsn(){return!this.ǃrAy||this.ǃrAy.isContextLost()}ǃLM(){ǃr.ǃzw.ǃrkR.ǃLM(),ǃr.ǃzw.ǃUrC.ǃLM(),ǃr.ǃzw.ǃzP.ǃLM(),this.ǃrxE&&this.ǃrxE.ǃXG(),this.ǃrMD=null}ǃUvr(){this.ǃrxy(),this.ǃLg(this.ǃUBa,this.ǃUBq,!0)}ǃrxw(){this.ǃrxI||!this.ǃrMD||(this.ǃrxI=this.ǃrxE.ǃrD(),this.ǃrxI.ǃrMM())}ǃrRD(){this.ǃrxI&&(this.ǃrxI.ǃrMx(),this.ǃrxI=null)}ǃrRa(e,r){return this.ǃrxE?this.ǃrxE.ǃrMy(e,r):NaN}ǃrRq(e){this.ǃrxE&&this.ǃrxE.ǃrMb(e)}ǃsV(e,r){if(this.ǃsn())throw new Error("context lost");this.ǃrMV();const t=ǃr.ǃq(ǃr.ǃzw.ǃrkR,this);return t.ǃrko(e,r),t}ǃrRA(e,r){return this.ǃsn()?Promise.reject("context lost"):(r=Object.assign({},r),ǃr.ǃUCV.ǃUCH?(r.ǃUCD=!1,createImageBitmap(e,{premultiplyAlpha:"premultiply"}).then((e)=>this.ǃsV(e,r))):ǃr.ǃUCV.ImageBitmap?createImageBitmap(e).then((e)=>this.ǃsV(e,r)):e instanceof Blob?ǃr.ǃUrD(e).then((e)=>this.ǃrRA(e,r)):e instanceof HTMLImageElement&&"function"==typeof e.decode?e.decode().then(()=>ǃr.ǃfB(()=>this.ǃsV(e,r))):ǃr.ǃfB(()=>this.ǃsV(e,r)))}ǃZU(e,r,t){this.ǃrMV();const n=ǃr.ǃq(ǃr.ǃzw.ǃrkR,this);return n.ǃrkK(e,r,t),n}ǃZT(e,r,t){this.ǃrMV(),r.ǃrkw(e,t)}ǃpM(e){if(e&&(e.ǃrMT(),!(0=r||0>=t)throw new Error("invalid size");this.ǃrMV();const i=ǃr.ǃq(ǃr.ǃzw.ǃUrC,this);return i.ǃTQ(r,t,Object.assign({ǃrMX:n},e)),this.ǃrMp=null,this.ǃrkr=null,i}ǃQI(e){if(e!==this.ǃrMp){const r=this.ǃrxP();r.ǃrGZ(e),this.ǃrMp=e,this.ǃrxn=0}}ǃUT_(){return this.ǃrMp}ǃrRW(e){if(assert(e!==this.ǃrMp,"copying render target to itself"),2>this.ǃrMH)this.ǃUrQ(),this.ǃUTl(e);else{const r=this.ǃrxP();r.ǃrkY(e,this.ǃrMp),this.ǃrxn=0}}ǃUTl(e){assert(e!==this.ǃrMp,"drawing render target to itself");const r=e.ǃsi();if(!r)throw new Error("not a texture-backed render target");this.ǃLS(r),this.ǃrRv()}ǃUTt(e){if(!(2>this.ǃrMH)){const r=this.ǃrxP();r.ǃrkH(e.ǃrkU()),this.ǃrxn=0}}ǃrRG(){return this.ǃUBa*this.ǃUBq*(this.ǃrMN.alpha?4:3)}ǃrRk(){let e=0;for(const r of ǃr.ǃzw.ǃUrC.ǃrMB())r.ǃsi()||(e+=r.ǃUUh());return e}ǃrRM(){let e=0;for(const r of ǃr.ǃzw.ǃrkR.ǃrML())e+=r.ǃUUh();return e}ǃrRx(){return this.ǃrRG()+this.ǃrRk()+this.ǃrRM()}ǃrRR(){return this.ǃrMK}ǃUTe(){return this.ǃrMH}ǃQu(){return this.ǃrMP}ǃrkj(){return this.ǃrxW}ǃcC(){return this.ǃrxG}ǃcE(){return this.ǃrxk}ǃrRg(){return this.ǃrxM}ǃrRO(){return this.ǃrxx}ǃrRI(){return this.ǃrxR}ǃUTN(){return this.ǃrxg}ǃrRE(){return!!this.ǃrMD}ǃrMY(){return this.ǃrMD}ǃrMq(){return this.ǃrMa}ǃAM(){return this.ǃrAy}ǃUTn(e){const r=this.ǃrAy;let t=r.ONE,n=r.ONE_MINUS_SRC_ALPHA;switch(e){case"normal":t=r.ONE,n=r.ONE_MINUS_SRC_ALPHA;break;case"additive":t=r.ONE,n=r.ONE;break;case"copy":t=r.ONE,n=r.ZERO;break;case"destination-over":t=r.ONE_MINUS_DST_ALPHA,n=r.ONE;break;case"source-in":t=r.DST_ALPHA,n=r.ZERO;break;case"destination-in":t=r.ZERO,n=r.SRC_ALPHA;break;case"source-out":t=r.ONE_MINUS_DST_ALPHA,n=r.ZERO;break;case"destination-out":t=r.ZERO,n=r.ONE_MINUS_SRC_ALPHA;break;case"source-atop":t=r.DST_ALPHA,n=r.ONE_MINUS_SRC_ALPHA;break;case"destination-atop":t=r.ONE_MINUS_DST_ALPHA,n=r.SRC_ALPHA;break;default:throw new Error("invalid blend name");}return{ǃUTB:t,ǃUTd:n}}ǃrRC(e){const r=this.ǃrAy;let t=r.ONE,n=r.ONE_MINUS_SRC_ALPHA;switch(e){case 0:t=r.ONE,n=r.ONE_MINUS_SRC_ALPHA;break;case 1:t=r.ONE,n=r.ONE;break;case 3:t=r.ONE,n=r.ZERO;break;case 4:t=r.ONE_MINUS_DST_ALPHA,n=r.ONE;break;case 5:t=r.DST_ALPHA,n=r.ZERO;break;case 6:t=r.ZERO,n=r.SRC_ALPHA;break;case 7:t=r.ONE_MINUS_DST_ALPHA,n=r.ZERO;break;case 8:t=r.ZERO,n=r.ONE_MINUS_SRC_ALPHA;break;case 9:t=r.DST_ALPHA,n=r.ONE_MINUS_SRC_ALPHA;break;case 10:t=r.ONE_MINUS_DST_ALPHA,n=r.SRC_ALPHA;break;default:throw new Error("invalid blend index");}return{ǃUTB:t,ǃUTd:n}}}}{function e(e,r,t,n,i,o){r?"Gecko"===ǃr.ǃrd.ǃUCm?e.strokeText(t,n,i,o):e.strokeText(t,n,i):"Gecko"===ǃr.ǃrd.ǃUCm?e.fillText(t,n,i,o):e.fillText(t,n,i)}function r(e,r,t,n,i,o){r?e.strokeRect(t,n,i,o):e.fillRect(t,n,i,o)}function t(e){return e*(4/3)}const n=self.devicePixelRatio||1,i={timeout:60},o=new ǃr.ǃBL(0,0,0,1),d=new Set(["left","center","right"]),a=new Set(["top","center","bottom"]),s=new Set(["word","character"]),T=new Set;ǃr.ǃQL&&ǃr.ǃQL.addEventListener("fontload",(r)=>{const e=r.font.ǃTi();for(const t of T)(t.ǃUdR()||ǃr.ǃNu(t.ǃrRy(),e))&&t.ǃrRb()}),ǃr.ǃzw.ǃzP=class{constructor(e,r){ǃr.ǃ$(e,ǃr.ǃzw.ǃUrK),ǃr.ǃVg(r),r=Object.assign({},i,r),this.ǃpW=e,this.ǃrRS="Arial",this.ǃrRo=16,this.ǃUdm=0,this.ǃrRj=!1,this.ǃrRe=!1,this.ǃrRN="black",this.ǃUds=!1,this.ǃUcS=null,this.ǃrRK=new Set,this.ǃUd$="left",this.ǃUdf="top",this.ǃUdL="",this.ǃUdX=null,this.ǃUdi=ǃr.ǃq(ǃr.ǃUd_),this.ǃUdl="word",this.ǃrRP=!1,this.ǃrRw=!1,this.ǃrRQ=!0,this.ǃUdv=0,this.ǃUdJ=0,this.ǃUBa=0,this.ǃUBq=0,this.ǃrRZ=1,this.ǃr$L=!1,this.ǃrRu=null,this.ǃrgU=null,this.ǃrgr=null,this.ǃrgT=-1,this.ǃrgv=-1,this.ǃrgJ="",this.ǃrgL="",this.ǃrgs="",this.ǃrgX=1,this.ǃrgi=1,this.ǃUdh=(e,r)=>this.ǃUdn(e,r),this.ǃpd=null,this.ǃrg_=0,this.ǃrgl=0,this.ǃrgt=new ǃr.Rect,this.ǃrg$=1,this.ǃrgf=!1,this.ǃrgz=new ǃr.ǃPG(()=>{this.ǃrgF(),this.ǃrgm(8,8)},r.timeout),this.ǃzQ=null,this.ǃ_a=!1,T.add(this)}ǃTq(){this.ǃUcS=null,this.ǃrRK.clear(),this.ǃUdX=null,this.ǃrRu=null,this.ǃrgU=null,this.ǃrgr=null,this.ǃUdh=null,this.ǃrgz.ǃTq(),this.ǃzQ=null,this.ǃrgF(),this.ǃUdi.ǃXG(),this.ǃUdi=null,this.ǃpW=null,this.ǃ_a=!0,T.delete(this)}ǃrgh(){this.ǃr$L=!0}ǃrRb(){this.ǃrgh(),this.ǃUdi.ǃXG(),this.ǃrRP=!0}ǃrgn(e){this.ǃrRQ=!!e}ǃrgV(){return this.ǃrRQ}ǃUBn(r){r=!!r;this.ǃUds===r||(this.ǃUds=r,this.ǃrgU&&(this.ǃrgU.textBaseline=this.ǃUds?"alphabetic":"top"),this.ǃrRb())}ǃUdR(){return this.ǃUds}ǃUce(e){ǃr.ǃk(e),e||(e="serif");this.ǃrRS===e||(this.ǃrRS=e,this.ǃrRb())}ǃrRy(){return this.ǃrRS}ǃzZ(e){ǃr.ǃ$t(e),0.1>e&&(e=0.1);this.ǃrRo===e||(this.ǃrRo=e,this.ǃrRb())}ǃUBH(e){ǃr.ǃ$t(e);this.ǃUdm===e||(this.ǃUdm=e,this.ǃrgh())}ǃUco(e){e=!!e;this.ǃrRj===e||(this.ǃrRj=e,this.ǃrRb())}ǃUcj(e){e=!!e;this.ǃrRe===e||(this.ǃrRe=e,this.ǃrRb())}ǃUdV(e,r){for(let t=e.length-1;0<=t;--t){const n=e[t];if(n.tag===r)return n}return null}ǃUdd(e,r){return!!this.ǃUdV(e,r)}ǃrgp(e,r){let t="";(this.ǃrRj||this.ǃUdd(r,"b"))&&(t+="bold"),(this.ǃrRe||this.ǃUdd(r,"i"))&&(t+=" italic");const i=this.ǃUdV(r,"size"),o=i?parseFloat(i.ǃUdp):this.ǃrRo;t+=e?" "+o+"pt":" "+o*this.ǃrg$*this.ǃrRZ*n+"pt";let d=this.ǃrRS;const a=this.ǃUdV(r,"font");return a&&a.ǃUdp&&(d=a.ǃUdp,this.ǃUcS&&!this.ǃrRK.has(d)&&(this.ǃUcS(d),this.ǃrRK.add(d))),d&&(t+=" \""+d+"\""),t}ǃ_U(e){e instanceof ǃr.ǃBL&&(e=e.ǃUSk()),ǃr.ǃk(e);this.ǃrRN===e||(this.ǃrRN=e,this.ǃrgh())}ǃFv(e,r,t){ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃ$t(t),o.ǃUSp(e,r,t),this.ǃ_U(o)}ǃzu(e){if(ǃr.ǃk(e),!d.has(e))throw new Error("invalid horizontal alignment");this.ǃUd$===e||(this.ǃUd$=e,this.ǃrgh())}ǃFU(e){if(ǃr.ǃk(e),!a.has(e))throw new Error("invalid vertical alignment");this.ǃUdf===e||(this.ǃUdf=e,this.ǃrgh())}ǃUBV(e){if(ǃr.ǃk(e),!s.has(e))throw new Error("invalid word wrap mode");this.ǃUdl===e||(this.ǃUdl=e,this.ǃrRb())}ǃFT(e){ǃr.ǃk(e);this.ǃUdL===e||(this.ǃUdL=e,this.ǃrRb())}ǃLg(e,r,t){var i=Math.min;if(ǃr.ǃ$t(e),ǃr.ǃ$t(r),ǃr.ǃ$f(t),"undefined"==typeof t&&(t=1),0>=e||0>=e)return;if(this.ǃUdv===e&&this.ǃUdJ===r&&this.ǃrRZ===t)return;1===this.ǃrRZ!=(1===t)&&(this.ǃrgf=!0);const o=this.ǃUdv,d=this.ǃrRZ;this.ǃUdv=e,this.ǃUdJ=r,this.ǃrRZ=t,this.ǃUBa=this.ǃUdv*this.ǃrRZ*n,this.ǃUBq=this.ǃUdJ*this.ǃrRZ*n;const a=Math.max(this.ǃUBa,this.ǃUBq),s=i(this.ǃpW.ǃrkj(),2048);let T=1;a>s&&(T=s/a,this.ǃUBa=i(this.ǃUBa*T,s),this.ǃUBq=i(this.ǃUBq*T,s)),this.ǃrg$=T,0=this.ǃUBa||0>=this.ǃUBq||(this.ǃr$L=!1,this.ǃrRw=!0,this.ǃrRQ?ǃr.ǃfB(()=>this.ǃrgd()):this.ǃrgd())}ǃrgd(){var e=Math.ceil;this.ǃ_a||(this.ǃrgm(e(this.ǃUBa),e(this.ǃUBq)),this.ǃUdc(),this.ǃrgc(),this.ǃrgH(),this.ǃrgz.ǃtF(),this.ǃrRw=!1)}ǃrgm(e,r){this.ǃrRu||(this.ǃrRu=ǃr.ǃUbh(16,16));let t=!1;(this.ǃrgT!==e||this.ǃrgv!==r)&&(this.ǃrgT=e,this.ǃrgv=r,this.ǃrRu.width=e,this.ǃrRu.height=r,t=!0),this.ǃrgU||(this.ǃrgU=this.ǃrRu.getContext("2d"),t=!0),t?(this.ǃrgU.textBaseline=this.ǃUds?"alphabetic":"top",this.ǃrgU.font=this.ǃrgJ,this.ǃrgU.fillStyle=this.ǃrgs,this.ǃrgU.strokeStyle=this.ǃrgs):this.ǃrgU.clearRect(0,0,e,r)}ǃrgD(){this.ǃrgr||(this.ǃrgr=ǃr.ǃUbh(16,16).getContext("2d"))}ǃrgY(e){this.ǃrgL===e||(this.ǃrgL=e,this.ǃrgr.font=e)}ǃUdc(){this.ǃrRP&&(this.ǃrgD(),this.ǃUds&&(!this.ǃUdX||this.ǃUdX.toString()!==this.ǃUdL)&&(this.ǃUdX=new ǃr.ǃXP(this.ǃUdL,{ǃUdH:!0})),this.ǃUdi.ǃUd_(this.ǃUds?this.ǃUdX.ǃUdD():this.ǃUdL,this.ǃUdh,this.ǃUdv,this.ǃUdl),this.ǃrRP=!1)}ǃUdn(e,r){this.ǃrgY(this.ǃrgp(!0,r));const n=this.ǃUdV(r,"size"),i=n?parseFloat(n.ǃUdp):this.ǃrRo;return{width:this.ǃrgr.measureText(e).width,height:t(i)}}ǃrga(e){this.ǃrgJ===e||(this.ǃrgJ=e,this.ǃrgU.font=e)}ǃrgq(e){this.ǃrgs===e||(this.ǃrgs=e,this.ǃrgU.fillStyle=e,this.ǃrgU.strokeStyle=e)}ǃrgA(e){this.ǃrgX===e||(this.ǃrgX=e,this.ǃrgU.globalAlpha=e)}ǃrgW(e){this.ǃrgi===e||(this.ǃrgi=e,this.ǃrgU.lineWidth=e)}ǃrgc(){var e=Math.max;const r=this.ǃrg$*this.ǃrRZ*n,i=t(this.ǃrRo)*r,o=(4+this.ǃUdm)*r,d=i+o;let a=0;const s=this.ǃUdi.ǃUdY();"center"===this.ǃUdf?a=e(this.ǃUBq/2-s.length*d/2,0):"bottom"===this.ǃUdf&&(a=e(this.ǃUBq-s.length*d-2,0));for(let e=0,t=s.length;ethis.ǃUBq-o)break;}else if(0this.ǃUBq-n)break;let i=0;"center"===this.ǃUd$?i=(this.ǃUBa-t.width*r)/2:"right"===this.ǃUd$&&(i=this.ǃUBa-t.width*r),this.ǃrgG(t,i,a,r),this.ǃUds||(a+=n),a+=o}}ǃrgG(e,r,t,n){for(const i of e.ǃUdq)this.ǃrgk(i,r,t,n,e.height),r+=i.width*n}ǃrgk(t,n,i,o,d){const a=this.ǃrgU,s=d/16,T=t.width*o,l=t.height*o,u=t.height/16,U=(4+this.ǃUdm)*o,c=t.text,v=t.ǃUdW,p=this.ǃUdV(v,"background"),m=this.ǃUdd(v,"u"),f=this.ǃUdd(v,"s");if((!ǃr.ǃUdG(c)||p||m||f)&&!this.ǃUdd(v,"hide")){const t=this.ǃUdV(v,"offsetx");n+=t?parseFloat(t.ǃUdp)*o:0;const d=this.ǃUdV(v,"offsety");i+=d?parseFloat(d.ǃUdp)*o:0,p&&(this.ǃrgq(p.ǃUdp),a.fillRect(n,i-l,T,l+U));const h=this.ǃUdV(v,"color");this.ǃrgq(h?h.ǃUdp:this.ǃrRN);const g=this.ǃUdV(v,"opacity");this.ǃrgA(g?parseFloat(g.ǃUdp)/100:1);const y=this.ǃUdd(v,"stroke");if(y&&this.ǃrgW(u*this.ǃrg$*this.ǃrRZ),m&&r(a,y,n,i+o*s,T,o*s),f&&r(a,y,n,i-l/4,T,o*u),this.ǃrga(this.ǃrgp(!1,v)),e(a,y,c,n,i,T),!y){this.ǃrgW(u*this.ǃrg$*this.ǃrRZ);const r=this.ǃUdV(v,"outline");r&&(this.ǃrgq(r.ǃUdp),e(a,!0,c,n,i,T))}}}ǃrgH(){var e=Math.ceil;this.ǃpW.ǃsn()||(this.ǃrg_=e(this.ǃUBa),this.ǃrgl=e(this.ǃUBq),this.ǃrgt.set(0,0,this.ǃUBa/this.ǃrg_,this.ǃUBq/this.ǃrgl),this.ǃrgf&&(this.ǃrgF(),this.ǃrgf=!1),!this.ǃpd&&(this.ǃpd=this.ǃpW.ǃZU(this.ǃrg_,this.ǃrgl,{ǃZr:1===this.ǃrRZ,ǃrkx:"high"})),this.ǃpW.ǃZT(this.ǃrRu,this.ǃpd),this.ǃzQ&&this.ǃzQ())}ǃtD(){return this.ǃrgt}ǃrgF(){this.ǃpd&&(!this.ǃpW.ǃsn()&&this.ǃpW.ǃpM(this.ǃpd),this.ǃpd=null)}static ǃLM(){for(const e of T)e.ǃrgF()}static ǃrgM(){return T.values()}}}"use strict",ǃr.ǃJv={},ǃr.ǃJv.ǃUHx=8900,ǃr.ǃJv.ǃrgx=!1,ǃr.ǃJv.ǃrgR=!0,ǃr.ǃJv.URL={ǃPX:"https://www.construct.net/register",ǃJJ:"https://www.scirra.com/store",ǃrgg:"https://www.construct.net/make-games/manuals/construct-3",ǃrgO:"https://www.construct.net/make-games/releases/",ǃrgI:"https://www.construct.net/profile/edit",ǃIe:"https://www.construct.net/make-games/buy-construct-3",ǃrgE:"https://www.construct.net/make-games/features",ǃJT:"https://www.construct.net/make-games/addons",ǃzA:"https://www.scirra.com/forum/how-to-help-translate-construct-3_t195902"},ǃr.ǃrgC=function(e){ǃr.ǃ$t(e);const r=Math.floor(e/100),t=e%100;let n="r"+r;return 0!=t&&(n+="."+t),n},ǃr.ǃrgy=function(e){ǃr.ǃk(e),e=e.toLowerCase().trim(),e.startsWith("r")&&(e=e.substr(1));const r=e.split(".");let t=-1;return 1===r.length?t=100*parseInt(r[0],10):2===r.length&&(t=100*parseInt(r[0],10)+parseInt(r[1],10)),isFinite(t)||(t=-1),t},ǃr.ǃJv.ǃUWs=ǃr.ǃrgC(ǃr.ǃJv.ǃUHx),ǃr.ǃJv.ǃrgb=ǃr.ǃUAy(ǃr.ǃJv.ǃUWs,".","-"),ǃr.ǃo.ǃu.ǃrgS=[{id:"main",size:"1fr",name:"Main area",popup:!1,type:"Pane",layout:{tabSide:!1,id:"middle",isHorizontal:!0,children:[{id:"propertiesBar",size:"300px",name:"\u1E56\u1E5B\xF6\u1E57\xEB\u1E5B\u1E97\xEF\xEB\u1E61",popup:!1,docked:!0,type:"CaptionPane",caption:"\u1E56\u1E5B\xF6\u1E57\xEB\u1E5B\u1E97\xEF\xEB\u1E61",side:"left"},{id:"midPane",size:"1fr",name:"Mid pane",popup:!1,docked:!0,type:"TabPane",side:"",layout:{tabSide:"top",children:[]}},{size:"300px",name:"middle2",popup:!1,docked:!0,type:"DockingPane",side:"right",layout:{tabSide:!1,id:"middle3",isHorizontal:!1,children:[{id:"projectBar",size:"477.5px",name:"\u1E56\u1E5B\xF6j\xEB\u010B\u1E97",popup:!1,docked:!0,type:"CaptionPane",caption:"\u1E56\u1E5B\xF6j\xEB\u010B\u1E97",side:"top"},{size:"300px",name:"middle4",popup:!1,docked:!0,type:"TabPane",side:"bottom",layout:{tabSide:"bottom",children:[{id:"layersBar",size:"300px",name:"\u1E36\xE4\xFF\xEB\u1E5B\u1E61",popup:!1,docked:!0,type:"CaptionPane",caption:"\u1E36\xE4\xFF\xEB\u1E5B\u1E61",side:""},{id:"tilemapBar",size:"300px",name:"\u1E6A\xEF\u1E37\xEB\u1E41\xE4\u1E57: \u1E44\xF6 \u1E60\xEB\u1E37\xEB\u010B\u1E97\xEF\xF6\u1E45",popup:!1,docked:!0,type:"CaptionPane",caption:"\u1E6A\xEF\u1E37\xEB\u1E41\xE4\u1E57: \u1E44\xF6 \u1E60\xEB\u1E37\xEB\u010B\u1E97\xEF\xF6\u1E45",side:""}]}}]}}]}}],"use strict";{const e=ǃr.ǃU(),r="workers/";class t extends ǃr.ǃT_{constructor(){super(),this.ǃrgo=ǃr.ǃIn.ǃIh("oneworker")?1:ǃr.hardwareConcurrency,this.ǃrgj=null,this.ǃrge=[],this.ǃrgN=new Map,this.ǃrgK=0,this.ǃrgP=!1,this.ǃ$Z=null,this.ǃ$Q=null}ǃdE(){if(this.ǃrgP)throw new Error("already initialised");return this.ǃrgj=new Worker(r+"dispatchWorker.js"),this.ǃrgj.addEventListener("message",(r)=>this.ǃrgw(r)),this.ǃrgQ(),this.ǃrgP=!0,this.ǃ$Z=new Promise((e)=>{this.ǃ$Q=e}),this.ǃ$Z}ǃrgQ(){const e=new Worker(r+"jobWorker.js");e.addEventListener("message",(r)=>this.ǃrgZ(r));const t=new MessageChannel;this.ǃrgj.postMessage({type:"_addJobWorker",port:t.port1},[t.port1]),e.postMessage({type:"init",number:this.ǃrge.length,port:t.port2},[t.port2]),this.ǃrge.push(e)}ǃrgu(e,r,t,n,i){if(ǃr.ǃk(e),ǃr.ǃMd(r),ǃr.ǃEQ(t),ǃr.ǃzO(n),ǃr.ǃVm(i,ǃr.ǃUwz),!this.ǃrgP)throw new Error("not yet initialised");t||(t=[]);const o=this.ǃrgK++,d={type:e,jobId:o,params:r,transferables:t},a=new Promise((e,r)=>{this.ǃrgN.set(o,{resolve:e,ǃUQC:n,reject:r,ǃrOU:!1})});return i&&i.ǃUwF(()=>this.ǃrOr(o)),this.ǃrgj.postMessage(d,t),a}ǃrOr(e){ǃr.ǃ$t(e);const r=this.ǃrgN.get(e);r&&(r.ǃrOU=!0,r.resolve=null,r.ǃUQC=null,r.reject=null,this.ǃrgj.postMessage({type:"_cancel",jobId:e}))}ǃrgw(r){const e=r.data,t=e.type;switch(t){case"error":console.error("[Dispatch worker] Error: "+e.error);break;default:throw new Error(`unknown message from dispatch worker '${t}'`);}}ǃrgZ(r){const e=r.data,t=e.type,n=e.jobId;switch(t){case"result":this.ǃrOT(n,e.result);break;case"progress":this.ǃrOv(n,e.progress);break;case"error":this.ǃrOJ(n,e.error);break;case"ready":this.ǃrOL();break;default:throw new Error(`unknown message from worker '${t}'`);}}ǃrOT(e,r){const t=this.ǃrgN.get(e);if(!t)throw new Error("invalid job ID");t.ǃrOU||t.resolve(r),this.ǃrgN.delete(e)}ǃrOv(e,r){const t=this.ǃrgN.get(e);if(!t)throw new Error("invalid job ID");!t.ǃrOU&&t.ǃUQC&&t.ǃUQC(r)}ǃrOJ(e,r){const t=this.ǃrgN.get(e);if(!t)throw new Error("invalid job ID");t.ǃrOU||t.reject(r),this.ǃrgN.delete(e)}ǃrOL(){this.ǃ$Q&&(this.ǃ$Q(),this.ǃ$Q=null,this.ǃ$Z=null),this.ǃrge.lengththis.ǃrOq(),this.ǃrOA=()=>this.ǃrOq(),app.addEventListener("projectclose",this.ǃUto),app.addEventListener("projectnamechange",this.ǃrOA)}ǃTq(){app.removeEventListener("projectclose",this.ǃUto),this.ǃUto=null,app.removeEventListener("projectnamechange",this.ǃrOA),this.ǃrOA=null,this.ǃUf=null,this.ǃrOm=null,this.ǃrOn=null,this.ǃrOV=null,this.ǃrOp=null}ǃO(){return this.ǃUf}ǃUtV(){return this.ǃrOH}ǃUtn(){return-1!==this.ǃrOH}ǃrOW(r){r=!!r;this.ǃrOY===r||(this.ǃrOY=r,this.ǃIW(!0))}ǃrOG(){return this.ǃrOY}ǃrOk(e){if(ǃr.ǃk(e),!o.has(e))throw new Error(`invalid preview browser '${e}'`);this.ǃrOa===e||(this.ǃrOa=e,this.ǃIW(!0))}ǃrOM(){return this.ǃrOa}ǃrOx(r){r=!!r;this.ǃrOD===r||(this.ǃrOD=r,this.ǃIW(!0))}ǃrOR(){return this.ǃrOD}ǃVb(r,t){if(ǃr.ǃk(r),!i.includes(r))throw new Error("invalid ui state key");if(r===e.ǃUmi){if(this.ǃrOc)return;this.ǃrOc=!0,this.ǃrOg(t),this.ǃrOc=!1}if(r===e.ǃUth){if(this.ǃrOB)return;this.ǃrOB=!0,this.ǃrOO(t),this.ǃrOB=!1}if(r===e.ǃVS){if(this.ǃrOd)return;this.ǃrOd=!0,this.ǃrOI(t),this.ǃrOd=!1}}ǃVe(r){if(ǃr.ǃk(r),!i.includes(r))throw new Error("invalid ui state key");return r===e.ǃUmi?this.ǃrOm:r===e.ǃUth?this.ǃrOn:r===e.ǃVS?this.ǃrOV:r===e.ǃUmh?this.ǃrOp:void 0}ǃrOf(){this.ǃrOl()&&app.ǃrOE(this.ǃUf,"projectuichange")}ǃ$p(){let e={propertiesBar:this.ǃrOm,openTabs:this.ǃrOV,previewEffects:this.ǃrOY,previewBrowser:this.ǃrOa,pauseOnUnfocus:this.ǃrOD};if(app.ǃUmw()){let r=app.ǃvM(),t=r.ǃUiq(this.ǃUf),n=r.ǃIB();n.children=n.children.filter((e,r)=>t===r),e.projectBar=n}if(app.ǃVO()){let r=app.ǃvk().ǃU$c();e.propertiesBarActiveObject={},r instanceof ǃg?(e.propertiesBarActiveObject.name=r.ǃTi(),e.propertiesBarActiveObject.type="project"):r instanceof ǃu?(e.propertiesBarActiveObject.name=r.ǃTi(),e.propertiesBarActiveObject.type="layout"):r instanceof ǃYx?(e.propertiesBarActiveObject.name=r.ǃTi(),e.propertiesBarActiveObject.type="layer"):r instanceof Array&&(e.propertiesBarActiveObject.name="instances",e.propertiesBarActiveObject.type="array")}return e}ǃ$d(e){if(this.ǃrOF(e)){if(this.ǃrOm=e.propertiesBar,this.ǃrOV=e.openTabs,this.ǃrOY=!!e.previewEffects,this.ǃrOD=!!e.pauseOnUnfocus,this.ǃrOa=e.previewBrowser||"default",this.ǃrOp=e.propertiesBarActiveObject,e.projectBar)if(app.ǃfE()){let t=app.ǃvT(),n=t.ǃVe(r);n?1===e.projectBar.children.length?(n.children.push(e.projectBar.children[0]),this.ǃrOn=n,this.ǃrOH=this.ǃrOn.children.length-1):this.ǃrOH=-1:(this.ǃrOn=e.projectBar,this.ǃrOH=1===this.ǃrOn.children.length?0:-1)}else this.ǃrOn=e.projectBar,this.ǃrOH=1===this.ǃrOn.children.length?0:-1;this.ǃUf.ǃtb()||this.ǃrOl()&&app.ǃrOE(this.ǃUf,"projectuichange")}}ǃrOg(e){!this.ǃrOF(e)||this.ǃrOz(this.ǃrOm,e)||(this.ǃrOm=e,this.ǃIW(!0))}ǃrOO(r){if(this.ǃrOF(r)&&!this.ǃrOz(this.ǃrOn,r)){this.ǃrOn=r,app.ǃUmw()&&(this.ǃrOH=app.ǃvM().ǃUiq(this.ǃUf));for(let t of app.ǃLh())t.ǃVb(e.ǃUth,r);this.ǃIW(!0)}}ǃrOI(e){!this.ǃrOF(e)||this.ǃrOz(this.ǃrOV,e)||(this.ǃrOV=e,this.ǃIW(!0))}ǃrOq(){app.ǃUmw()&&(this.ǃrOn=app.ǃvM().ǃIB())}},window.ǃVo.ǃUmi=e,window.ǃVo.ǃUth=r,window.ǃVo.ǃVS=t,window.ǃVo.ǃUmh=n}{const e="propertiesBar",r="instanceCollectionProperties",t="layoutView",n="layoutViewInstanceCollection",i=[e,r,t,n];window.ǃUUm=class e extends ǃrOX{constructor(e){ǃr.ǃ$(e,ǃu),super(),this.ǃPM=e,this.ǃrOC=null,this.ǃrOy=!1,this.ǃrOb=!1,this.ǃrOS=32,this.ǃrOo=32,this.ǃrOj=1e3,this.ǃrOe=1e3,this.ǃrON=!1,this.ǃrOK=!1,this.ǃrOP=null,this.ǃriL=this.ǃPM.ǃO().ǃrOw(),this.ǃrOm=null,this.ǃrOQ=new Map,this.ǃrOZ=null,this.ǃrOu=null,this.ǃrIU=null,this.ǃrIr=(r)=>this.ǃrIT(r.ǃDm),this.ǃrIv=(r)=>this.ǃrIJ(r.ǃDD),app.addEventListener("layeractive",this.ǃrIr),app.addEventListener("objectinstanceadd",this.ǃrIv),app.addEventListener("objectinstanceremove",this.ǃrIv)}ǃTq(){app.removeEventListener("layeractive",this.ǃrIr),this.ǃrIr=null,app.removeEventListener("objectinstanceadd",this.ǃrIv),app.removeEventListener("objectinstanceremove",this.ǃrIv),this.ǃrIv=null,this.ǃrOQ&&this.ǃrOQ.clear(),ǃr.ǃXk(this.ǃrOu),ǃr.ǃXk(this.ǃrIU),this.ǃPM=null,this.ǃrOC=null,this.ǃrOm=null,this.ǃrOQ=null,this.ǃrOZ=null,this.ǃrOu=null,this.ǃrIU=null,this.ǃriL=null}ǃO(){return this.ǃPM.ǃO()}ǃWe(){return app.ǃsd().ǃas(this.ǃPM)}ǃYH(){return this.ǃrOC||(this.ǃrOC=this.ǃPM.ǃrIL()),this.ǃrOC.ǃXI()||(this.ǃrOC=this.ǃPM.ǃrIL()),this.ǃrOC}ǃuG(e){if(ǃr.ǃ$(e,ǃYx),e!==this.ǃrOC){this.ǃrOC=e;let r=this.ǃWe();r&&r.ǃQX(),app.ǃrIs(e,"layeractive"),this.ǃIW(!0)}}ǃPE(){return this.ǃrOj}ǃUzz(e){if(ǃr.ǃ$t(e),e=Math.floor(e),0>e)throw new Error("invalid margin width");this.ǃrOj===e||(this.ǃrOj=e,this.ǃIW(!0))}ǃPy(){return this.ǃrOe}ǃUzF(e){if(ǃr.ǃ$t(e),e=Math.floor(e),0>e)throw new Error("invalid margin height");this.ǃrOe===e||(this.ǃrOe=e,this.ǃIW(!0))}ǃrIX(){return this.ǃrOy}ǃUzm(e){this.ǃrIX()===e||(this.ǃrOy=e,this.ǃIW(!0))}ǃrIi(){return this.ǃrOb}ǃUzh(e){this.ǃrIi()===e||(this.ǃrOb=e,this.ǃIW(!0))}ǃQQ(){return this.ǃrOS}ǃUzn(e){ǃr.ǃ$t(e),e=ǃr.ǃsP(e,1,1e3);this.ǃQQ()===e||(this.ǃrOS=e,this.ǃIW(!0))}ǃQZ(){return this.ǃrOo}ǃUzV(e){ǃr.ǃ$t(e),e=ǃr.ǃsP(e,1,1e3);this.ǃQZ()===e||(this.ǃrOo=e,this.ǃIW(!0))}ǃUzp(r){r=!!r;this.ǃrON===r||(this.ǃrON=r,this.ǃrI_(),this.ǃIW(!0))}ǃQy(){return this.ǃrON}ǃrI_(){if(this.ǃrON){let e=this.ǃWe();e&&e.ǃWv()}}ǃUzd(r){r=!!r;this.ǃrOK===r||(this.ǃrOK=r,this.ǃrIl(),this.ǃIW(!0))}ǃUzB(){return this.ǃrOK}ǃgO(){return this.ǃriL?this.ǃriL.clone():null}ǃrIl(){let e=this.ǃWe();if(e)for(let r of this.ǃPM.ǃuW())this.ǃrOK?e.ǃYH()===r?r.ǃrIt(!1):r.ǃrIt(!0):r.ǃrIt(!1)}ǃVb(r,t,n){if(ǃr.ǃk(r),!!this.ǃAB()){if(!i.includes(r))throw new Error("invalid ui state key");r===e.ǃUmi&&this.ǃrOg(t),r===e.ǃUmm&&this.ǃrI$(t,n),r===e.ǃUUF&&this.ǃrIf()}}ǃVe(r,t){if(ǃr.ǃk(r),ǃr.ǃEQ(t),!i.includes(r))throw new Error("invalid ui state key");return r===e.ǃUmi?this.ǃrOm:r===e.ǃUmm?this.ǃrIz(t):r===e.ǃUUF?this.ǃrOZ:r===e.ǃUmn?this.ǃrOu:void 0}ǃiG(){this.ǃrIU=[...this.ǃPM.ǃuv()].sort(ǃ_A.ǃUzK),this.ǃrIF(),this.ǃUzB()&&this.ǃrIl()}ǃrOf(){this.ǃrOl()&&app.ǃrIm(this.ǃPM,"layoutuichange")}ǃ$p(e){ǃr.ǃVg(e);let r=e&&e.mode||"",t={propertiesBar:Object.assign({},this.ǃrOm),grid:{show:this.ǃrOy,snap:this.ǃrOb,width:this.ǃrOS,height:this.ǃrOo},marginWidth:this.ǃrOj,marginHeight:this.ǃrOe,showCollisionPolygons:this.ǃrON,showTranslucentInactiveLayers:this.ǃrOK,tabColor:this.ǃriL?this.ǃriL.toJSON():null,layers:[...this.ǃPM.ǃuW()].map((e)=>e.ǃIB())},n=this.ǃWe();if(n&&(t.view={},t.view.x=n.ǃuS(),t.view.y=n.ǃuo(),t.view.z=n.ǃuq(),t.view.activeLayer=this.ǃYH().ǃTi(),"copy"!==r&&(t.selectedInstances=[...n.ǃYm().ǃa_()].map((e)=>e.ǃqr()))),this.ǃrOQ&&"copy"!==r){t.instanceCollections=[];for(let[e,r]of this.ǃrOQ)e&&r&&e.length&&(this.ǃrIh(e)?t.instanceCollections.push({uids:e,properties:r}):this.ǃrIn(e)&&t.instanceCollections.push({uids:e.map((e)=>e.ǃqr()),properties:r}))}return t}ǃ$d(e){if(this.ǃrOF(e)){this.ǃrOm=e.propertiesBar,this.ǃrOu=e.selectedInstances?e.selectedInstances:null,this.ǃrOP=e.instanceCollections,this.ǃrOy=!!e.grid.show,this.ǃrOb=!!e.grid.snap,this.ǃrOS=e.grid.width,this.ǃrOo=e.grid.height,this.ǃrOj=e.marginWidth,this.ǃrOe=e.marginHeight,this.ǃrON=!!e.showCollisionPolygons,this.ǃrOK=!!e.showTranslucentInactiveLayers,e.tabColor?this.ǃriL.ǃcI(e.tabColor):this.ǃriL=null,this.ǃrOZ=e.view;for(let r of e.layers){let e=this.ǃPM.ǃUFF(r.name);e&&e.ǃIp(r)}this.ǃrOl()&&app.ǃrIm(this.ǃPM,"layoutuichange")}}ǃrOg(e){!this.ǃrOF(e)||this.ǃrOz(this.ǃrOm,e)||(this.ǃrOm=e,this.ǃIW(!0))}ǃrI$(e,r){let t=[...r],n=null;if(0!==t.length){if(ǃr.ǃtU(t[0]))n=this.ǃrIV(t,this.ǃrIU);else if(t[0]instanceof ǃ_A)n=t,n=n.sort(ǃ_A.ǃUzK);else throw new Error("unexpected instance collection ui state arguments");let r=this.ǃrIp(n);r&&ǃr.ǃ$h(e)?this.ǃrOQ.set(r.ǃrIB,r.value):r&&!ǃr.ǃ$h(e)?this.ǃrOQ.set(r.ǃrIB,e):!r&&ǃr.ǃ$h(e)?this.ǃrOQ.set(n,null):!r&&!ǃr.ǃ$h(e)&&this.ǃrOQ.set(n,e),this.ǃrOu=ǃr.ǃ$h(e)?null:n,this.ǃIW(!0)}}ǃrIf(){let e=this.ǃWe();if(!e)return;let r=!1;if(this.ǃrOu){let t=e.ǃYm();this.ǃrIh(this.ǃrOu)?(this.ǃrOu=this.ǃrOu.map((e)=>+e).sort(),this.ǃrOu=this.ǃrIV(this.ǃrOu,this.ǃrIU),t.ǃEY(this.ǃrOu.filter((e)=>e.ǃXI()))):this.ǃrIn(this.ǃrOu)&&t.ǃEY(this.ǃrOu.filter((e)=>e.ǃXI())),app.ǃVO()&&!ǃr.ǃrd.ǃvq&&app.ǃvk().ǃYu(this.ǃrOu,null,{ǃUUz:!1}),this.ǃrOu=null,r=!0}if(this.ǃrOZ){e.ǃh$(this.ǃrOZ.x,this.ǃrOZ.y),e.ǃuw(this.ǃrOZ.z);let t=this.ǃrOZ.activeLayer;if(t){let r=this.ǃPM.ǃUFF(t);r&&e.ǃuG(r)}this.ǃrOZ=null,r=!0}r&&this.ǃIW(!0)}ǃrIp(e){if(ǃr.ǃUCQ(e,ǃYR),!e)return;let r=[],t=e.sort(ǃ_A.ǃUzK),n;for(let i of this.ǃrOQ.keys()){if(t.length!==i.length)continue;let o;if(this.ǃrIh(i)){let t=i.map((e)=>+e).sort();o=this.ǃrIV(t,this.ǃrIU),r.push({ǃrId:e,ǃrIB:o,value:this.ǃrOQ.get(i)})}else this.ǃrIn(i)&&(o=i);if(ǃr.ǃUzP(t,o)){n={ǃrIB:o,value:this.ǃrOQ.get(i)},this.ǃrOQ.delete(i);break}}for(let t of r)this.ǃrOQ.has(t.ǃrId)&&(this.ǃrOQ.set(t.ǃrIB,t.value),this.ǃrOQ.delete(t.ǃrId));return n}ǃrIz(e){if(ǃr.ǃUCQ(e,ǃYR),!this.ǃrOQ)return;let r=[],t=e.sort(ǃ_A.ǃUzK),n;for(let[i,o]of this.ǃrOQ){if(t.length!==i.length)continue;let e;if(this.ǃrIh(i)){let t=i.map((e)=>+e).sort();e=this.ǃrIV(t,this.ǃrIU),r.push({ǃrId:i,ǃrIB:e,value:o})}else this.ǃrIn(i)&&(e=i);if(ǃr.ǃUzP(t,e)){n=o;break}}for(let t of r)this.ǃrOQ.set(t.ǃrIB,t.value),this.ǃrOQ.delete(t.ǃrId);if(n)return n}ǃrIF(){if(this.ǃrOP){this.ǃrOQ.clear();for(let e of this.ǃrOP){let r=e.uids,t=e.properties;r&&t&&(ǃr.ǃFL(r)&&(r=JSON.parse(r)),this.ǃrOQ.set(r,t))}}}ǃrIV(e,r){let t=[],n=0;for(let o=0,i;oe.ǃIB()),bookmark:this.ǃrIC}}ǃ$d(e){this.ǃrOF(e)&&(this.ǃrIN(e.viewsUIState),this.ǃgl(e.bookmark))}ǃrIo(e){ǃr.ǃ$(e,ǃEH);let r=[...this.ǃSS.ǃS_()],t=r.indexOf(e);if(-1!==t)return this.ǃrIE[t]}ǃrIN(e){ǃr.ǃre(e);this.ǃrOz(e,this.ǃrIE)||(this.ǃrIE=ǃr.ǃLL(e),this.ǃIW(!0))}},window.ǃrII.ǃrIS=e}"use strict",window.ǃSe=class extends ǃrOX{constructor(e){super(),this.ǃrIK=e,this.ǃrIP=!0,this.ǃrAl=new Map}ǃoK(e,r){r.ǃeZ(this),this.ǃrAl.set(e,r)}ǃjT(e,r){if(!this.ǃrAl.has(e))throw new Error("missing id");this.ǃrAl.get(e).Set(r)}ǃou(e){if(!this.ǃrAl.has(e))throw new Error("missing id");return this.ǃrAl.get(e).ǃb()}ǃTq(){this.ǃrIK=null}ǃiL(){return this.ǃXo().ǃiL()}ǃXo(){return this.ǃrIK.ǃXo()}ǃO(){return this.ǃXo().ǃO()}ǃVe(){return this.ǃrIP?(this.ǃrIP=!1,this.ǃXo().ǃVe(this.ǃrIK)):this.ǃ$p()}ǃrOf(){this.ǃrOl()&&app.ǃrIe(this.ǃiL(),"eventsheetuichange")}ǃ$p(){let e={};for(let r of this.ǃrAl.values())r.ǃ$p(e);return e}ǃ$d(e){if(this.ǃrOF(e))for(let r of this.ǃrAl.values())r.ǃ$d(e)}},"use strict",window.ǃoP=class{constructor(e){this.ǃrIw=e,this.ǃrJT=null,this.ǃrFj=!0}ǃeZ(e){ǃr.ǃ$(e,ǃSe),this.ǃrJT=e}ǃb(){return this.ǃrFj}Set(r){r=!!r;this.ǃrFj===r||(r&&!this.ǃrFj?(this.ǃrFj=!0,this.ǃrIQ(),this.ǃrJT.ǃIW(!0)):!r&&this.ǃrFj&&(this.ǃrFj=!1,this.ǃrIQ(),this.ǃrJT.ǃIW(!0)))}ǃrIQ(){let e=this.ǃrJT.ǃXo(),r=e.ǃVe(this.ǃrIw);if(r)r.expanded=this.ǃrFj;else{let r=e.ǃIB();e.ǃIp(r)}}ǃ$p(e){e.expanded=this.ǃrFj}ǃ$d(e){!this.ǃrJT.ǃrOF(e)||e.hasOwnProperty("expanded")&&(assert(ǃr.ǃUCj(this.ǃrIw.ǃaQ),"missing 'SetExpanded' method"),this.ǃrIw.ǃaQ(e.expanded,!1),this.ǃrFj=e.expanded)}},"use strict",ǃr.ǃrIZ=class extends ǃr.ǃT_{constructor(){super()}ǃTq(){}ǃrIu(){ǃr.ǃo_()}ǃUQE(){ǃr.ǃo_()}ǃUQy(){ǃr.ǃo_()}ǃkf(){ǃr.ǃo_()}},"use strict",ǃr.ǃrEU=class extends ǃr.ǃrIZ{constructor(e){super(),ǃr.ǃ$(e,ǃr.ǃki),this.ǃrEr=e}ǃTq(){this.ǃrEr=null,super.ǃTq()}ǃrIu(e){return ǃr.ǃk(e),Promise.resolve(this.ǃrEr.ǃUQg(e))}ǃUQE(e){ǃr.ǃk(e);const r=this.ǃrEr.ǃkm(e);if(!r)throw new Error(`missing file path '${e}'`);return this.ǃrEr.ǃUQE(r)}ǃUQy(e){ǃr.ǃk(e);const r=this.ǃrEr.ǃkm(e);if(!r)throw new Error(`missing file path '${e}'`);return this.ǃrEr.ǃUQy(r)}ǃkf(e,r){ǃr.ǃk(e),ǃr.ǃz(r);const t=this.ǃrEr.ǃkm(e);if(!t)throw new Error(`missing file path '${e}'`);return this.ǃrEr.ǃkf(t,r)}},"use strict",ǃr.ǃrET=class extends ǃr.ǃrIZ{constructor(e){if(super(),ǃr.ǃk(e),!ǃr.ǃrd.ǃvl)throw new Error("only supported in desktop app mode");this.ǃrEv=e}ǃTq(){super.ǃTq()}ǃrIu(e){const r=ǃr.ǃSd.ǃrUq(this.ǃrEv,e);return ǃr.ǃSd.ǃrUW(r)}ǃUQE(e){const r=ǃr.ǃSd.ǃrUq(this.ǃrEv,e);return ǃr.ǃSd.ǃrUE(r)}ǃUQy(e){const r=ǃr.ǃSd.ǃrUq(this.ǃrEv,e);return ǃr.ǃSd.ǃrUE(r).then((e)=>ǃr.ǃmE(e))}ǃkf(e,r){const t=ǃr.ǃSd.ǃrUq(this.ǃrEv,e);return ǃr.ǃSd.ǃrUC(t,r)}},"use strict",window.ǃia=class e extends ǃr.Event.ǃUU{constructor(e){super(),ǃr.ǃ$(e,ǃg),this.ǃUf=e,this.ǃrEJ=this.ǃUf.ǃrEL(),this.ǃrEs=0}ǃTq(){this.ǃUf=null,super.ǃTq()}ǃlk(){return"project-object"}ǃO(){return this.ǃUf}ǃXI(){return 0===this.ǃrEs}ǃrEX(){return this.ǃrEJ}static ǃrEi(e){return"number"==typeof e&&Math.floor(e)===e&&0<=e&&1e16>=e}ǃrE_(r){if(ǃr.ǃ$t(r),!e.ǃrEi(r))throw new Error("invalid SID");this.ǃrEJ=r}ǃyY(){this.ǃrEl()}ǃyq(){this.ǃrEt()}ǃrEl(){let e=this.ǃXI();++this.ǃrEs,e&&!this.ǃXI()&&(app.ǃrE$(this,"projectobjectdelete"),this.ǃrEf())}ǃrEt(){if(0===this.ǃrEs)throw new Error("cannot undelete active project object");--this.ǃrEs,this.ǃXI()&&(this.ǃrEz(),app.ǃrE$(this,"projectobjectundelete"))}ǃrEz(){}ǃrEf(){}ǃiG(){}static ǃUla(e,r){let t=e.ǃTi().toLowerCase(),n=r.ǃTi().toLowerCase();return t>n?1:td)throw new Error("item not in this folder");if(this.ǃrVr.splice(d,1),assert(!t.ǃrVr.includes(r),"item should not already be in destination folder"),n){if(!t.ǃrVr.includes(n))throw new Error("relative item not in destination folder");if(!n.ǃXI())throw new Error("relative item is deleted");if(d=t.ǃrVr.indexOf(n),"after"===o)++d;else if("before"!==o)throw new Error("invalid insert position");t.ǃrVr.splice(d,0,r)}else t.ǃrVr.push(r);r.ǃrER(t),this.ǃIW()}ǃUlf(r,t,n,o){if(ǃr.ǃ$(r,e),ǃr.ǃ$(t,e),ǃr.ǃVm(n,e),ǃr.ǃz(o),t.ǃNZ()!==this.ǃUPe)throw new Error("other folder is different type");if(!r.ǃXI())throw new Error("cannot move deleted subfolder");let d=this.ǃrEF.indexOf(r);if(0>d)throw new Error("subfolder not in this folder");if(this.ǃrEF.splice(d,1),assert(!t.ǃrEF.includes(r),"subfolder should not already be in destination folder"),n){if(!t.ǃrEF.includes(n))throw new Error("relative subfolder not in destination folder");if(!n.ǃXI())throw new Error("relative subfolder is deleted");if(d=t.ǃrEF.indexOf(n),"after"===o)++d;else if("before"!==o)throw new Error("invalid insert position");t.ǃrEF.splice(d,0,r)}else t.ǃrEF.push(r);r.ǃrJT=t,this.ǃIW()}ǃP(e){ǃr.ǃ$(e,this.ǃUPe);let r=this.ǃrVr.indexOf(e);assert(-1!==r,"item does not belong to folder");-1===r||this.ǃrVr.splice(r,1)}ǃrEI(r){ǃr.ǃ$(r,e);let t=this.ǃrEF.indexOf(r);assert(-1!==t,"sub folder does not belong to folder");-1===t||(r.ǃrJT=null,this.ǃrEF.splice(t,1))}ǃrEE(e,r){return e.ǃ$p(r)}ǃ$p(e){ǃr.ǃVg(e);let r=[];for(let t of this.ǃsA())r.push(this.ǃrEE(t,e));let t=[];for(let r of this.ǃUlY())t.push(r.ǃ$p(e));let n={items:r,subfolders:t};return this.ǃop()||(n.name=this.ǃrUm),n}},"use strict";{function e(){const e=c.length;let r="";for(let t=0;11>t;++t)r+=c.charAt(Math.floor(Math.random()*e));return r}const r=ǃr.ǃU(),t=ǃr.ǃT(r.URL);ǃr.ǃJ.ǃv(t+"lang");const n=1,i=new Set(["default","cloud","local-single-file","local-folder"]),o=new Set(["off","scale-inner","scale-outer","letterbox-scale","letterbox-integer-scale"]),d=new Set(["low","high"]),a=new Set(["any","portrait","landscape"]),s=new Set(["auto","cover"]),T=new Set(["linear","point"]),l=new Set(["low","medium","high"]),u=new Set(["splash","progress-logo","progress","percent","none"]),U=new Set(["c2","c3"]),c="abcdefghijklmnopqrstuvwxyz0123456789";const v=["loading-logo.png","icon-16.png","icon-32.png","icon-64.png","icon-128.png","icon-256.png","icon-512.png"],p=new Map([["audio/webm; codecs=opus",1],["audio/ogg; codecs=opus",2],["audio/webm; codecs=vorbis",3],["audio/ogg; codecs=vorbis",4],["audio/mp4",5],["audio/mpeg",6],["audio/wav",7]]),m={ǃrEC:!1},f=[[0,"A 0"],[1,"B 1-10"],[11,"C 11-25"],[26,"D 26-40"],[41,"E 41-50"],[51,"F 51-99"],[100,"G 100-249"],[250,"H 250-499"],[500,"I 500-999"],[1e3,"J 1000-2499"],[2500,"K 2500-4999"],[5e3,"L 5000+"]];window.ǃg=class r extends ǃr.ǃT_{constructor(){super(),this.ǃrUm=lang("model.project.new-project-name"),this.ǃrFZ=ǃr.ǃUbP({description:"",version:"1.0.0.0",ǃrEy:"",ǃrEb:"",ǃrES:"",ǃrEo:"",ǃrEj:!1,ǃrEe:!1,ǃrEN:"letterbox-scale",ǃrEK:"high",ǃrEP:"auto",backgroundColor:ǃr.ǃq(ǃr.ǃBL,0,0,0),ǃrEw:ǃr.ǃq(ǃr.ǃBL,1,1,1),ǃrEQ:!1,ǃrEZ:ǃr.ǃq(ǃr.ǃBL,1,1,1),ǃrEu:!0,ǃrCU:"any",ǃrCr:!0,ǃrCT:"linear",ǃrCv:"medium",ǃrCJ:"splash",ǃrCL:!0,ǃrCs:!0,ǃrCX:!0}),this.ǃrCi=e(),this.ǃrC_="{}",this.ǃrCl="default",this.ǃrCt=null,this.ǃrC$=null,this.ǃrCf=!1,this.ǃrCz="user",this.ǃrCF=854,this.ǃrCm=480,this.ǃrCh=!1,this.ǃrCn=!1,this.ǃpk=!0,this.ǃrCV=!1,this.ǃrCp=ǃr.ǃIn.ǃIh("forcec3")?"c3":"c2",this.ǃrCB=!1,this.ǃrCd=null,this.ǃrCc=!1,this.ǃrCH={plugin:new Set,behavior:new Set,effect:new Set},this.ǃrCD=ǃr.ǃq(ǃud,this,null),this.ǃrCY=new Map,this.ǃrCa=new Map,this.ǃrCq=new Set,this.ǃrCA=ǃr.ǃq(ǃUiS,this,null),this.ǃrCW=[],this.ǃrCG=new Map,this.ǃrCk=[],this.ǃrCM=0,this.ǃrCx=new Set,this.ǃrCR=0,this.ǃrCg=!1,this.ǃrCO=ǃr.ǃq(ǃUiy,this,null),this.ǃrCI=null,this.ǃrCE="",this.ǃrCC=ǃr.ǃq(ǃUib,this,null),this.ǃrCy=0,this.ǃrCb=[],this.ǃrCS=null,this.ǃrCo=ǃr.ǃq(ǃG,this,null,"sound"),this.ǃrCj=ǃr.ǃq(ǃG,this,null,"music"),this.ǃrCe=ǃr.ǃq(ǃG,this,null,"video"),this.ǃrCN=ǃr.ǃq(ǃG,this,null,"font"),this.ǃrCK=ǃr.ǃq(ǃG,this,null,"icon"),this.ǃrCP=ǃr.ǃq(ǃG,this,null,"general"),this.ǃrCw=0,this.ǃrCQ=0,this.ǃrCK.ǃU_V(!1),this.ǃrCZ=new ǃrCu(this),this.ǃrCd=ǃr.ǃTc.ǃryU().ǃUrl(this,"System"),this.ǃryr=0,this.ǃryT=ǃr.ǃq(ǃr.ǃXA,()=>this.ǃryv(),1e3),this.ǃryJ=ǃr.ǃq(ǃVo,this),this.ǃryL=new window.SDK.IProject(this)}ǃTq(){this.ǃrys(),this.ǃryT.ǃTq(),this.ǃryT=null,this.ǃrCd.ǃTq(),this.ǃrCd=null,this.ǃrCZ.ǃTq(),this.ǃrCZ=null,this.ǃryJ.ǃTq(),this.ǃryJ=null,this.ǃrCl=null,this.ǃrCt=null,this.ǃrCY.clear(),this.ǃrCa.clear(),this.ǃrCq.clear(),this.ǃrCS=null;for(let e of this.ǃryX())e.ǃTq();for(let e of this.ǃryi())e.ǃTq();for(let e of this.ǃry_())e.ǃTq();for(let e of this.ǃryl())e.ǃTq();for(let e of this.ǃrCW)e.ǃTq(!0);ǃr.ǃXk(this.ǃrCW),ǃr.ǃXk(this.ǃrCb),ǃr.ǃTq(this)}ǃryt(e,r){if(ǃr.ǃk(e),!i.has(e))throw new Error("invalid origin filesystem mode");this.ǃrCl=e,this.ǃrCt=r,ǃvc.ǃm_(this,this.ǃrC$||this.ǃrUm)}ǃU_c(){return this.ǃrCl}ǃU_H(){return this.ǃrCt}ǃry$(e){ǃr.ǃk(e),this.ǃrC$=e,app.ǃrOE(this,"projectlocationchange")}ǃUiE(){return this.ǃrC$||null}ǃlk(){return"project"}ǃUlA(){return this.ǃrCh}ǃIW(){this.ǃtb()||this.ǃrCh||(this.ǃrCh=!0,this.ǃxl(!0),app.ǃrOE(this,"projectmarkchanged"))}ǃryf(){this.ǃrCh=!1,app.ǃrOE(this,"projectunmarkchanged")}ǃryz(){this.ǃryf();for(let e of this.ǃSL())e.ǃryF();for(let e of this.ǃET())e.ǃryF();for(let e of this.ǃg$())e.ǃryF();for(let e of this.ǃUao()){e.ǃryF();for(let r of e.ǃp())r.ǃryF()}this.ǃxl(!1)}ǃrym(){this.ǃtb()||(this.ǃIW(),this.ǃryh(),this.ǃryn(),this.ǃryV())}ǃryh(){if(!this.ǃtb())for(let e of this.ǃSL())e.ǃIW()}ǃryn(){if(!this.ǃtb())for(let e of this.ǃET())e.ǃIW()}ǃryV(){if(!this.ǃtb())for(let e of this.ǃg$())e.ǃIW()}ǃxl(e){e=!!e;this.ǃrCn===e||(this.ǃrCn=e,app.ǃrOE(this,"projectanychange"))}ǃLF(){return this.ǃrCn}ǃtb(){return this.ǃpk}ǃfw(){return this.ǃrCV}ǃrys(){this.ǃrCV=!0}ǃryp(e=!1){this.ǃrCE&&(this.ǃrCI=this.ǃnD(this.ǃrCE)),this.ǃrCE="",this.ǃryB(),this.ǃryd();for(let r of this.ǃUAQ())r.ǃiG();for(let r of this.ǃET())r.ǃiG();for(let r of this.ǃUao())r.ǃiG();this.ǃryc(),this.ǃryJ.ǃiG(),this.ǃpk=!1,this.ǃryH(),this.ǃryD(e),this.ǃrCb=this.ǃryY();let r=this.ǃrCb.length,t=performance.now(),n=ǃr.ǃIn.ǃIh("perf");this.ǃrya().then(()=>{if(n&&console.log(`[Project] Finished background parsing ${r} expressions over duration of ${performance.now()-t} ms`),!ǃr.ǃUEG())return app.ǃryq()})}ǃryc(){for(const e of this.ǃSL())ǃaN.ǃUrH(e.ǃTi(),this)&&e.ǃTz(this.ǃUrT(e.ǃTi()))}ǃryD(e){if(this.ǃrCf||e)return;const r=this.ǃIj(!0).ǃIo,t=f;let n=t[0][1];for(const[i,o]of t){if(i>=r)break;n=o}app.ǃzi("OpenProjectEventCount",n,r),app.ǃzi("OpenProjectUniqueID",this.ǃrCi,r)}ǃrya(){return ǃr.ǃfB(()=>{if(this.ǃryA(),this.ǃrCb.length)return this.ǃrya()})}ǃryA(){let e=this.ǃrCb;for(let r=0,t=Math.min(50,e.length);r{this.ǃrCS=null,app.ǃvp(this,!0)})),this.ǃrCS.ǃrD(e))}ǃryk(){this.ǃrCa.clear()}ǃUiL(e){let r=e.ǃTi().toLowerCase();if(this.ǃrCY.has(r))throw new Error("object class name already in use");this.ǃrCY.set(r,e)}ǃUis(e){let r=e.ǃTi().toLowerCase();if(!this.ǃrCY.has(r))throw new Error("expected object class name to exist");this.ǃrCY.delete(r)}ǃDA(e,r){let t=r.toLowerCase(),n=e.ǃTi().toLowerCase();if(!this.ǃrCY.has(t))throw new Error("expected object class name to exist");if(t!==n&&this.ǃrCY.has(n))throw new Error("object class name already in use");this.ǃrCY.delete(t),this.ǃrCY.set(n,e),this.ǃSi()}ǃryM(e){if(ǃr.ǃ$(e,ǃ_A),this.ǃrCMr)throw new Error("invalid uid");assert(r>=this.ǃrCk.length||null===this.ǃrCk[r],"reserving UID that is already in use");for(let t=this.ǃrCk.length-1;te)throw new Error("invalid uid");assert(ee)throw new Error("invalid uid");return!!this.ǃUUQ(e)}ǃUUQ(e){if(ǃr.ǃ$t(e),e=Math.floor(e),0>e)throw new Error("invalid uid");return e>=this.ǃrCk.length?null:this.ǃrCk[e]}ǃryI(){return this.ǃrCk.length}ǃrEL(){var e=Math.floor;let r=0;for(let t=0,n;15>t;++t){if(n=e(10*Math.random()),0===t)for(;0===n;)n=e(10*Math.random());r*=10,r+=n}return r}ǃrO$(){return this.ǃrCi}ǃryE(e){ǃr.ǃFX(e);let r=JSON.stringify(e);this.ǃrC_===r||(this.ǃrC_=r,this.ǃIW())}ǃryC(){try{return JSON.parse(this.ǃrC_)}catch(r){return console.warn("Corrupt cloud meta data found in project"),this.ǃryE({}),{}}}ǃryy(){return this.ǃrCz}ǃz_(e){ǃr.ǃk(e),this.ǃrCz=e}ǃCf(){return ǃr.ǃUVV.ǃryb()?ǃr.ǃUVV.ǃryo().ǃryS().ǃUqn(this,!1):null}ǃTz(e){if((ǃr.ǃk(e),e=ǃr.ǃUyn(e),!!e.length)&&this.ǃrUm!==e){if(!ǃr.ǃUym(e))throw new Error("name has invalid characters");this.ǃrUm=e,this.ǃIW(),app.ǃryj(),app.ǃrOE(this,"projectnamechange")}}ǃU_g(e,r){if(ǃr.ǃk(e),ǃr.ǃIO(r),ǃr.ǃJ.ǃrx("model.project.errors"),e=ǃr.ǃUyn(e),!ǃr.ǃUym(e)){let e=lang(".name-invalid.title"),t=lang(".name-invalid.message");return ǃr.ǃo.ǃsZ.ǃyy.ǃrp(r,"warning",e,t,{align:"bottom"}),void ǃr.ǃJ.ǃrR()}ǃr.ǃJ.ǃrR(),this.ǃTz(e)}ǃTi(){return this.ǃrUm}ǃTF(e){ǃr.ǃk(e);this.ǃrFZ.description===e||(this.ǃrFZ.description=e,this.ǃIW())}ǃi_(){return this.ǃrFZ.description}ǃTm(e){ǃr.ǃk(e);this.ǃrFZ.version===e||(this.ǃrFZ.version=e,this.ǃIW())}ǃU$S(){return this.ǃrFZ.version}ǃTn(e){ǃr.ǃk(e);this.ǃrFZ.ǃrEy===e||(this.ǃrFZ.ǃrEy=e,this.ǃIW())}ǃU$N(){return this.ǃrFZ.ǃrEy}ǃU$P(e){ǃr.ǃk(e);this.ǃrFZ.ǃrEb===e||(this.ǃrFZ.ǃrEb=e,this.ǃIW())}ǃU$K(){return this.ǃrFZ.ǃrEb}ǃU$Q(e){ǃr.ǃk(e);this.ǃrFZ.ǃrES===e||(this.ǃrFZ.ǃrES=e,this.ǃIW())}ǃU$w(){return this.ǃrFZ.ǃrES}ǃU$e(e){ǃr.ǃk(e);this.ǃrFZ.ǃrEo===e||(this.ǃrFZ.ǃrEo=e,this.ǃIW())}ǃU$j(){return this.ǃrFZ.ǃrEo}ǃUfn(e){if(ǃr.ǃ$t(e),e=Math.floor(e),2>e)throw new Error("invalid viewport width");this.ǃrCF===e||(this.ǃrCF=e,this.ǃIW())}ǃQz(){return this.ǃrCF}ǃUfV(e){if(ǃr.ǃ$t(e),e=Math.floor(e),2>e)throw new Error("invalid viewport height");this.ǃrCm===e||(this.ǃrCm=e,this.ǃIW())}ǃQF(){return this.ǃrCm}ǃUfG(r){r=!!r;this.ǃrFZ.ǃrEj===r||(this.ǃrFZ.ǃrEj=r,this.ǃIW())}ǃBO(){return this.ǃrFZ.ǃrEj}ǃUfi(e){if(ǃr.ǃVm(e,ǃu),e&&e.ǃO()!==this)throw new Error("layout from wrong project");this.ǃrCI===e||(this.ǃrCI=e||null,this.ǃIW())}ǃUfX(){return this.ǃrCI&&this.ǃrCI.ǃXI()?this.ǃrCI:null}ǃUfl(r){r=!!r;this.ǃrFZ.ǃrEe===r||(this.ǃrFZ.ǃrEe=r,this.ǃIW())}ǃUf_(){return this.ǃrFZ.ǃrEe}ǃUfD(e){if(ǃr.ǃk(e),!o.has(e))throw new Error(`invalid fullscreen mode '${e}'`);this.ǃrFZ.ǃrEN===e||(this.ǃrFZ.ǃrEN=e,this.ǃIW())}ǃUfH(){return this.ǃrFZ.ǃrEN}ǃrye(){return"off"!==this.ǃUfH()}ǃryN(){switch(this.ǃUfH()){case"off":return 0;case"scale-inner":return 2;case"scale-outer":return 3;case"letterbox-scale":return 4;case"letterbox-integer-scale":return 5;default:throw new Error("invalid fullscreen mode");}}ǃUfa(e){if(ǃr.ǃk(e),!d.has(e))throw new Error(`invalid fullscreen quality '${e}'`);this.ǃrFZ.ǃrEK===e||(this.ǃrFZ.ǃrEK=e,this.ǃIW())}ǃUfY(){return this.ǃrFZ.ǃrEK}ǃUfc(e){if(ǃr.ǃk(e),!s.has(e))throw new Error(`invalid viewport fit '${e}'`);this.ǃrFZ.ǃrEP===e||(this.ǃrFZ.ǃrEP=e,this.ǃIW())}ǃUfd(){return this.ǃrFZ.ǃrEP}ǃjC(e){ǃr.ǃ$(e,ǃr.ǃBL);this.ǃrFZ.backgroundColor.ǃUSa(e)||(this.ǃrFZ.backgroundColor.ǃUhj(e),this.ǃIW())}ǃU$u(){return this.ǃrFZ.backgroundColor.clone()}ǃUfr(e){ǃr.ǃ$(e,ǃr.ǃBL);this.ǃrFZ.ǃrEw.ǃUSa(e)||(this.ǃrFZ.ǃrEw.ǃUhj(e),this.ǃIW())}ǃUfU(){return this.ǃrFZ.ǃrEw.clone()}ǃUfJ(e){e=!!e;this.ǃrFZ.ǃrEQ===e||(this.ǃrFZ.ǃrEQ=e,this.ǃIW())}ǃUfv(){return this.ǃrFZ.ǃrEQ}ǃUfL(e){ǃr.ǃ$(e,ǃr.ǃBL);this.ǃrFZ.ǃrEZ.ǃUSa(e)||(this.ǃrFZ.ǃrEZ.ǃUhj(e),this.ǃIW())}ǃUrk(){return this.ǃrFZ.ǃrEZ.clone()}ǃUfE(r){if(r=!!r,this.ǃrFZ.ǃrEu!==r){if(!r&&"c3"===this.ǃUfk())throw new Error("cannot disable high-DPI in C3 runtime");this.ǃrFZ.ǃrEu=r,this.ǃIW()}}ǃUfI(){return this.ǃrFZ.ǃrEu||"c3"===this.ǃUfk()}ǃUfA(e){if(ǃr.ǃk(e),!a.has(e))throw new Error(`invalid orientation '${e}'`);this.ǃrFZ.ǃrCU===e||(this.ǃrFZ.ǃrCU=e,this.ǃIW())}ǃUfq(){return this.ǃrFZ.ǃrCU}ǃryK(){switch(this.ǃUfq()){case"any":return 0;case"portrait":return 1;case"landscape":return 2;default:throw new Error("invalid orientation");}}ǃUfO(r){if(r=!!r,this.ǃrFZ.ǃrCr!==r){if(!r&&"c3"===this.ǃUfk()){if(this.ǃtb())return;throw new Error("cannot disable WebGL in C3 runtime")}this.ǃrFZ.ǃrCr=r,this.ǃIW()}}ǃUfg(){return this.ǃrFZ.ǃrCr||"c3"===this.ǃUfk()}ǃUfW(e){if(ǃr.ǃk(e),!T.has(e))throw new Error(`invalid sampling mode '${e}'`);this.ǃrFZ.ǃrCT===e||(this.ǃrFZ.ǃrCT=e,this.ǃIW(),this.ǃryP(),app.ǃsd().ǃsB())}ǃpO(){return this.ǃrFZ.ǃrCT}ǃUfS(e){if(ǃr.ǃk(e),!l.has(e))throw new Error(`invalid downscaling quality '${e}'`);this.ǃrFZ.ǃrCv===e||(this.ǃrFZ.ǃrCv=e,this.ǃIW(),this.ǃryw(),app.ǃsd().ǃsB())}ǃUfb(){return this.ǃrFZ.ǃrCv}ǃryQ(){switch(this.ǃUfb()){case"low":return 0;case"medium":return 1;case"high":return 2;default:throw new Error("invalid downscaling quality");}}ǃUf$(e){if(ǃr.ǃk(e),!u.has(e))throw new Error(`invalid loader style '${e}'`);return this.ǃrFZ.ǃrCJ===e?void 0:app.ǃF()&&"splash"!==e?void(this.ǃtb()||app.ǃm(5)):void(this.ǃrFZ.ǃrCJ=e,this.ǃIW())}ǃUft(){return app.ǃF()?"splash":this.ǃrFZ.ǃrCJ}ǃryZ(){switch(this.ǃUft()){case"progress-logo":return 0;case"progress":return 1;case"percent":return 2;case"none":return 3;case"splash":return 4;default:throw new Error("invalid loader style");}}ǃUfz(r){r=!!r;this.ǃrFZ.ǃrCL===r||(this.ǃrFZ.ǃrCL=r,this.ǃIW())}ǃUff(){return this.ǃrFZ.ǃrCL}ǃUfj(r){r=!!r;this.ǃrFZ.ǃrCs===r||(this.ǃrFZ.ǃrCs=r,this.ǃIW())}ǃUfo(){return this.ǃrFZ.ǃrCs}ǃryu(e){if(ǃr.ǃk(e),!U.has(e))throw new Error("invalid runtime");if(this.ǃrCp===e)return!0;const r=ǃr.ǃq(ǃrbU,this,e);return this.ǃrbr(r),r.ǃXy()}ǃrbT(e){if(ǃr.ǃk(e),!U.has(e))throw new Error("invalid runtime");this.ǃrCp===e||(this.ǃrCp=e,this.ǃIW())}ǃUfM(e){const r=this.ǃryu(e);if(r.length){const t=ǃr.ǃo.ǃS.ǃb("SwitchRuntime");t.ǃy(e,r)}else this.ǃrbT(e)}ǃUfk(){return this.ǃrCp}ǃUfR(e){if(e=!!e,e&&"c3"!==this.ǃUfk())throw new Error("requires c3 runtime");this.ǃrCB===e||(this.ǃrCB=e,this.ǃIW())}ǃUfx(){return"c3"===this.ǃUfk()&&this.ǃrCB}ǃrbv(r){return r=!!r,this.ǃrCc===r?void 0:app.ǃF()&&r?void(this.ǃtb()||app.ǃm(19)):void(this.ǃrCc=r,this.ǃIW())}ǃUfw(){return!app.ǃF()&&this.ǃrCc}ǃUfy(r){r=!!r;this.ǃrFZ.ǃrCX===r||(this.ǃrFZ.ǃrCX=r,this.ǃIW())}ǃUfC(){return this.ǃrFZ.ǃrCX}*ǃuW(){for(let e of this.ǃET())for(let r of e.ǃuW())yield r}*ǃrbJ(){for(let e of this.ǃuW())e.ǃaz()||(yield e)}*ǃrbL(){for(let e of this.ǃuW())e.ǃaz()&&(yield e)}ǃUlX(){return this.ǃrCO}ǃET(){return this.ǃrCO.ǃU_C()}ǃryX(){return this.ǃrCO.ǃrEY()}ǃnD(e){ǃr.ǃk(e),e=e.toLowerCase();for(let r of this.ǃET())if(ǃr.ǃNu(e,r.ǃTi()))return r;return null}ǃrbs(e){return ǃr.ǃk(e),!!this.ǃnD(e)}ǃrbX(){let e=1,r="",t=lang("model.project.new-layout-name");do r=t.replace("{0}",e),++e;while(this.ǃrbs(r));return r}ǃUlC(){return ǃr.ǃV(this.ǃET())}ǃrbi(){return ǃr.ǃV(this.ǃg$())}ǃUli(){return this.ǃrCC}ǃg$(){return this.ǃrCC.ǃU_C()}ǃrb_(){return this.ǃrCC.ǃrEY()}ǃnY(e){ǃr.ǃk(e),e=e.toLowerCase();for(let r of this.ǃg$())if(ǃr.ǃNu(e,r.ǃTi()))return r;return null}ǃrbl(e){return ǃr.ǃk(e),!!this.ǃnY(e)}ǃrbt(){let e=1,r="",t=lang("model.project.new-event-sheet-name");do r=t.replace("{0}",e),++e;while(this.ǃrbl(r));return r}ǃryB(){this.ǃrbr(ǃr.ǃq(ǃrb$))}ǃIj(e){let r=ǃr.ǃq(ǃrbf,e);return this.ǃrbr(r),r.ǃXy()}ǃSi(){this.ǃtb()||this.ǃrbr(ǃr.ǃq(ǃrbz))}ǃyD(e){e?this.ǃrCy++:(assert(0e):Promise.resolve(!1)}ǃrm(){return this.ǃrCZ.ǃLp()?this.ǃrCZ.ǃrm().then((e)=>e):Promise.resolve(!1)}ǃLV(){return this.ǃrCZ.ǃLV()}ǃLp(){return this.ǃrCZ.ǃLp()}ǃUUx(){let e=this.ǃrCZ.ǃUUx();e&&app.ǃrOE(this,"projectundopointsremoved")}ǃULW(){return this.ǃrCZ.ǃULW()}ǃrSJ(e){this.ǃrCZ.ǃmt(!!e)}ǃNT(){return this.ǃrCd}ǃUUB(){let e=0;for(let r of this.ǃUAQ())for(let t of r.ǃ_Q())e++;return e}ǃUrV(){return this.ǃrCD}ǃUAF(e){ǃr.ǃ$(e,ǃr.ǃTd);for(const r of this.ǃUAQ())if(r.ǃ_K().ǃB()==e)return r.ǃUiZ()}ǃUAQ(){return this.ǃrCD.ǃU_C()}ǃry_(){return this.ǃrCD.ǃrEY()}*ǃSL(){yield*this.ǃUAQ(),yield*this.ǃUlM()}ǃrSL(e){return ǃr.ǃk(e),this.ǃrCY.get(e.toLowerCase())||null}ǃUri(e){ǃr.ǃk(e);let r=this.ǃrCY.get(e.toLowerCase())||null;return r instanceof ǃuF||(r=null),r}ǃrSs(e){return ǃr.ǃk(e),!!this.ǃUri(e)}ǃrSX(e){return ǃr.ǃk(e),this.ǃrCY.has(e.toLowerCase())}ǃUrT(e){if(ǃr.ǃk(e),e=ǃaN.ǃUrc(e,!0),!this.ǃrSX(e)&&!ǃaN.ǃUrH(e,this))return e;let r=2,t="";do t=e+r,++r;while(this.ǃrSX(t)&&!ǃaN.ǃUrH(t,this));return t}ǃrSi(e){ǃr.ǃ$(e,ǃuF);for(let r of this.ǃrCW)if(r.ǃU_Z(e))throw new Error("object type already in shared collection");for(let r of this.ǃrCW)if(!r.ǃr$p())return r.ǃUrf(e),r.ǃrS_();let r=ǃr.ǃq(ǃrSl,this,this.ǃrSt());return r.ǃUrf(e),this.ǃrCW.push(r),r.ǃrS_()}ǃrS$(e){ǃr.ǃ$(e,ǃuF);for(let r of this.ǃrCW)if(r.ǃUlR(e))return void(r.ǃUll()&&(r.ǃTq(),ǃr.ǃUyY(this.ǃrCW,r)));throw new Error("could not find collection to remove from")}*ǃrSf(){for(let e of this.ǃrCW)yield e}*ǃrSz(){for(let e of this.ǃrSf())yield e.ǃrS_();for(let e of this.ǃUAQ())(e.ǃqL()||e.ǃqT())&&(e.ǃrSF()||(yield e.ǃrSm()))}*ǃrSh(){for(let e of this.ǃrSz())for(let r of e.ǃrSn())yield r}ǃrSV(e){return ǃr.ǃk(e),this.ǃrCG.has(e)}ǃrSp(e){if(ǃr.ǃ$(e,ǃrSB),this.ǃrSV(e.ǃTi()))throw new Error(`sprite sheet collection name '${e.ǃTi()}' already in use`);this.ǃrCG.set(e.ǃTi(),e)}ǃrSd(e){if(ǃr.ǃ$(e,ǃrSB),!this.ǃrSV(e.ǃTi())){if(this.ǃfw())return;throw new Error("expected name to be in use")}this.ǃrCG.delete(e.ǃTi())}ǃrSt(){let e=0,r="";do r="shared-"+e,++e;while(this.ǃrSV(r));return r}ǃrSc(){let e=this.ǃrCR;for(;this.ǃrCx.has(e);)e++;return this.ǃrCx.add(e),this.ǃrCR=e+1,e}ǃrSH(e){if(ǃr.ǃ$t(e),0>e)throw new Error("invalid id");if(this.ǃrCx.has(e))throw new Error("id already in use");this.ǃrCx.add(e)}ǃrSD(e){if(ǃr.ǃ$t(e),0>e)throw new Error("invalid id");if(!this.ǃrCx.has(e))throw new Error("id not in use");this.ǃrCx.delete(e)}ǃrSY(){return"c2"===this.ǃUfk()?2048:4096}ǃrSa(){let e=new Set;for(let r of this.ǃUAQ())e.add(r.ǃ_K());return e}ǃUWL(){let e=new Set,r=new Set,t=new Set;for(let n of this.ǃSL()){if(e.add(n.ǃ_K()),n.ǃ_K().ǃZH())for(let e of n.ǃrSq())r.add(e.ǃNa());if(n.ǃ_K().ǃZD())for(let e of n.ǃrSA())t.add(e.ǃUry())}for(let e of this.ǃET()){for(let r of e.ǃrSA())t.add(r.ǃUry());for(let r of e.ǃuW())for(let e of r.ǃrSA())t.add(e.ǃUry())}return{ǃUWX:e,ǃUWi:r,ǃrSW:t}}ǃrSG(){const e=this.ǃUWL(),r=[];for(const t of e.ǃUWX)"built-in"===t.ǃUAV()||t.ǃrSk()||r.push({type:"plugin",name:t.ǃTi(),id:t.ǃux(),author:t.ǃU$N()});for(const t of e.ǃUWi)"built-in"===t.ǃUAV()||t.ǃrSk()||r.push({type:"behavior",name:t.ǃTi(),id:t.ǃux(),author:t.ǃU$N()});return r}ǃUfQ(r){r=!!r,!this.ǃUfw()&&r&&this.ǃrSM(),this.ǃrbv(r)}ǃrSM(){const e=this.ǃrSG();if(e.length){ǃr.ǃJ.ǃrx("model.project.errors.unbundlable-addons-warning");const r={ǃrSx:e,caption:lang(".title"),ǃrSR:lang(".message")};ǃr.ǃJ.ǃrR();const t=ǃr.ǃo.ǃS.ǃb("MissingAddons");t.ǃy(r)}}ǃrSg(){this.ǃrCg=!0}ǃrSO(){return this.ǃrCg}ǃryP(){for(let e of this.ǃrCG.values())for(let r of e.ǃrSI())r.ǃrgF()}ǃryw(){for(let e of this.ǃrCG.values())for(let r of e.ǃrSI())r.ǃrgF(),r.ǃrSE();for(let e of this.ǃUAQ())e.ǃryw()}*ǃUhI(e){ǃr.ǃ$(e,ǃrbc);for(let r of this.ǃUAQ())if(r.ǃ_K().ǃZH())for(let t of r.ǃrSq())t.ǃNa()===e&&(yield*t.ǃuv())}ǃrSC(e){this.ǃrCH[e.ǃNZ()].add(e.ǃux()),this.ǃIW()}ǃrSy(e){return!!this.ǃUr$(e)}ǃUr$(e){ǃr.ǃk(e);let r=this.ǃrCY.get(e.toLowerCase())||null;return r instanceof ǃUUH||(r=null),r}ǃUlG(){let e=1,r="";do r=ǃj("model.object-class.new-family-name",e),++e;while(this.ǃrSX(r));return r}ǃUlk(e){if(ǃr.ǃ$(e,ǃUUH),0===e.ǃUlx())throw new Error("cannot add empty family");this.ǃrCA.ǃrD(e),this.ǃIW()}ǃU_S(){return this.ǃrCA}ǃUlM(){return this.ǃrCA.ǃU_C()}ǃryi(){return this.ǃrCA.ǃrEY()}*ǃU_a(e){ǃr.ǃ$(e,ǃuF);let r=this.ǃrCa.get(e);r||(r=this.ǃrSb(e));for(let t of r)t.ǃXI()&&(yield t)}*ǃrSS(e){ǃr.ǃ$(e,ǃuF);let r=this.ǃrCa.get(e);r||(r=this.ǃrSb(e));for(let t of r)yield t}ǃrSb(e){ǃr.ǃ$(e,ǃuF);let r=[];for(let t of this.ǃryi())t.ǃU_Z(e)&&r.push(t);return assert(!this.ǃrCa.has(e),"overwriting families for type cache entry"),this.ǃrCa.set(e,r),r}ǃUlV(){return this.ǃrCo}ǃUlp(){return this.ǃrCj}ǃUlB(){return this.ǃrCe}ǃUld(){return this.ǃrCN}ǃUlc(){return this.ǃrCK}ǃUlH(){return this.ǃrCP}*ǃrSo(){yield this.ǃrCo,yield this.ǃrCj,yield this.ǃrCe,yield this.ǃrCN,yield this.ǃrCK,yield this.ǃrCP}*ǃrSj(){yield*this.ǃrCo.ǃU_C(),yield*this.ǃrCj.ǃU_C()}*ǃrSe(){yield*this.ǃrCe.ǃU_C(),yield*this.ǃrCN.ǃU_C(),yield*this.ǃrCK.ǃU_C(),yield*this.ǃrCP.ǃU_C()}*ǃrSN(){for(let e of this.ǃrSe())yield*e.ǃp()}ǃrSK(e){ǃr.ǃk(e);for(let t of this.ǃrSo())if(t.ǃUlU()===e)return t;throw new Error("invalid folder kind")}*ǃUao(){for(let e of this.ǃrSo())yield*e.ǃU_C()}*ǃryl(){for(let e of this.ǃrSo())yield*e.ǃrEY()}*ǃrSP(){for(let e of this.ǃUao())yield*e.ǃp()}*ǃrSw(){for(const e of this.ǃryl())yield*e.ǃrSQ()}ǃrSZ(){return this.ǃrCN.ǃU_C()}ǃUFK(){let e=[];for(let r of this.ǃrSZ())e.push(r.ǃUtF().catch(()=>null));return Promise.all(e)}ǃUcb(e){ǃr.ǃk(e);const r=[];for(let t of this.ǃrCN.ǃU_C())t.ǃUtT()&&ǃr.ǃNu(e,t.ǃTi())&&r.push(t.ǃUtF().catch(ǃr.ǃUyc));return Promise.all(r)}ǃna(e){ǃr.ǃk(e);let r=e.toLowerCase();for(let t of this.ǃUao())if(ǃr.ǃNu(t.ǃTi(),r))return t;return null}ǃrSu(e){return ǃr.ǃk(e),!!this.ǃna(e)}ǃnq(e){ǃr.ǃk(e);let r=ǃr.ǃU_R(e),t=ǃr.ǃM(e),n=this.ǃna(r);return n?n.ǃroU(t):null}ǃror(e){return ǃr.ǃk(e),!!this.ǃnq(e)}ǃroT(){return Promise.all(v.map(async(e)=>{const r=await ǃr.ǃPD("media/"+e);this.ǃUlc().ǃrov(r,e)}))}ǃUAl(){const e=/icon\-\d+\.png/i,r=[];for(const t of this.ǃrCK.ǃU_C())for(const n of t.ǃp())e.test(n.ǃe())&&r.push(n);return r.sort((e,r)=>{const t=e.ǃe(),n=r.ǃe(),i=parseInt(t.substr(5,t.length-9),10),o=parseInt(n.substr(5,n.length-9),10);return i-o}),r}ǃroJ(){for(const e of this.ǃrSj())for(const r of e.ǃp())if("audio/webm; codecs=opus"===r.ǃrk().ǃrG())return!0;return!1}async ǃryH(){if(!this.ǃtb()){const e=await app.ǃuT();e&&this.ǃryT.ǃU_()}}ǃryv(){this.ǃyB()&&app.ǃVN("info",lang("model.project.exceeds-free-limits"))}ǃyB(){if(!app.ǃF())return!1;const e=this.ǃIj(!0).ǃIo;if(e>app.ǃzG())return!0;let r=0;const t=app.ǃroL(),n=app.ǃUhf();for(const e of this.ǃET()){r+=e.ǃros();let i=0;for(const t of e.ǃuW())++i,r+=t.ǃros();if(i>n||r>t)return!0}for(const e of this.ǃSL())if(r+=e.ǃros(),r>t)return!0;return!!(this.ǃUtX()>app.ǃUti())}ǃUtX(){let e=0;for(const r of this.ǃrSZ())++e;return e}ǃroX(){let e=0;for(const r of this.ǃET()){e+=r.ǃros();for(const t of r.ǃuW())e+=t.ǃros()}for(const r of this.ǃSL())e+=r.ǃros();return e}ǃroi(e,r){ǃr.ǃ$(e,ǃUVJ),ǃr.ǃt_(r,Plugin,ǃrbc);let t=r.ǃro_();t.length&&e.ǃrol(r,t)}ǃrot(r){ǃr.ǃ$(r,ǃUVJ);let e=this.ǃUWL(),t=e.ǃUWX,n=e.ǃUWi,i=e.ǃrSW,o=[];"c3"===this.ǃUfk()&&r.ǃro$(this.ǃNT().ǃ_K());for(let e of t)r.ǃro$(e),this.ǃroi(r,e),o.push([r.ǃrof(e.ǃux()),e.ǃbK(),"world"===e.ǃuc(),e.ǃroz(),e.ǃroF(),e.ǃrom(),e.ǃroh(),e.ǃron(),e.ǃZD(),e.ǃUrb()]);for(let e of n)r.ǃroV(e),this.ǃroi(r,e);for(let t of i)r.ǃrop(t.ǃux(),t.ǃroB(r.ǃO()));return o}ǃrod(e){ǃr.ǃ$(e,ǃUVJ);let r=[];for(let t of this.ǃUlM()){let n=[e.ǃroc(t)];for(let r of t.ǃUJh())n.push(e.ǃroc(r));r.push(n)}return r}ǃroH(e){ǃr.ǃ$(e,ǃUVJ),this.ǃrCQ=0,this.ǃrCw=0;let t=[];for(let n of this.ǃrSj()){const i="music"===n.ǃUlU();let o=[],d=[...n.ǃp()].filter((r)=>e.ǃUqW(r)).sort(r.ǃUaj);for(let e of d)o.push([e.ǃrk().ǃrG(),e.ǃM().toLowerCase(),e.ǃa().size]);o.length&&(i?this.ǃrCQ+=d[0].ǃa().size:this.ǃrCw+=d[0].ǃa().size,t.push([n.ǃTi().toLowerCase(),o,i]))}return t}static ǃroD(e){let r=p.get(e.ǃrk().ǃrG());return r?r:99}static ǃUaj(e,t){return r.ǃroD(e)-r.ǃroD(t)}ǃroY(){const e=[];for(const r of this.ǃrSZ()){let t="";for(const e of r.ǃp()){const r=e.ǃrk().ǃrG(),n=e.ǃM().toLowerCase();if("application/font-woff"===r||n.endsWith("woff")||"font/woff2"===r||n.endsWith("woff2")){t=e.ǃe();break}}e.push([r.ǃTi(),t])}return e}async ǃroB(r){ǃr.ǃ$(r,ǃUVJ);const e=[...this.ǃSL()].map((e)=>ǃr.ǃfB(()=>e.ǃroB(r))),t=await Promise.all(e),n=[...this.ǃET()].map((e)=>ǃr.ǃfB(()=>e.ǃroB(r))),i=[...this.ǃg$()].map((t)=>ǃr.ǃfB(()=>t.ǃroB(r))),o=await Promise.all([Promise.all(n),Promise.all(i)]),d=o[0],a=o[1],s=r.ǃUfX(),T=[...ǃroq.ǃroa(this)].map((e)=>e.ǃroB(r)),l=this.ǃroY();let u=this.ǃUf_();return r.ǃroA()&&s!==this.ǃUfX()&&(u=!1),{project:[this.ǃTi(),s?s.ǃTi():null,this.ǃrot(r),t,this.ǃrod(r),d,a,this.ǃroH(r),r.ǃUqa(),this.ǃBO(),this.ǃQz(),this.ǃQF(),this.ǃryN(),this.ǃUfg(),"linear"===this.ǃpO(),this.ǃUfo(),this.ǃU$S(),this.ǃUfI(),u,this.ǃryZ(),this.ǃryK(),this.ǃryI(),this.ǃUfK(),"high"===this.ǃUfY(),this.ǃryQ(),this.ǃUff(),!1,T,r.ǃUqq(),l,this.ǃUfC(),this.ǃrO$()]}}ǃroW(){return this.ǃrCQ}ǃroG(){return this.ǃrCw}ǃrok(){return{properties:{description:this.ǃrFZ.description,version:this.ǃrFZ.version,author:this.ǃrFZ.ǃrEy,authorEmail:this.ǃrFZ.ǃrEb,authorWebsite:this.ǃrFZ.ǃrES,appId:this.ǃrFZ.ǃrEo,pixelRounding:this.ǃrFZ.ǃrEj,useLoaderLayout:this.ǃrFZ.ǃrEe,fullscreenMode:this.ǃrFZ.ǃrEN,fullscreenQuality:this.ǃrFZ.ǃrEK,viewportFit:this.ǃrFZ.ǃrEP,backgroundColor:this.ǃrFZ.backgroundColor.toJSON(),splashColor:this.ǃrFZ.ǃrEw.toJSON(),useThemeColor:this.ǃrFZ.ǃrEQ,themeColor:this.ǃrFZ.ǃrEZ.toJSON(),useHighDpi:this.ǃrFZ.ǃrEu,orientations:this.ǃrFZ.ǃrCU,enableWebGL:this.ǃrFZ.ǃrCr,sampling:this.ǃrFZ.ǃrCT,downscaling:this.ǃrFZ.ǃrCv,loaderStyle:this.ǃrFZ.ǃrCJ,preloadSounds:this.ǃrFZ.ǃrCL,clearBackground:this.ǃrFZ.ǃrCs,enhancedAccelerationPrecision:this.ǃrFZ.ǃrCX,previewEffects:this.ǃrFZ.ǃroM,previewBrowser:this.ǃrFZ.ǃrox,pauseOnUnfocus:this.ǃrFZ.ǃroR},viewportWidth:this.ǃrCF,viewportHeight:this.ǃrCm,firstLayout:this.ǃUfX()?this.ǃUfX().ǃTi():null}}ǃrog(){let e={};for(let t of this.ǃrSo())e[t.ǃUlU()]=t.ǃ$p();return e}ǃroO(e){const r=e.ǃNZ(),t=e.ǃux();if(this.ǃrCH[r].has(t)&&ǃr.ǃrTW.ǃroI(r,t,null)){const e=ǃr.ǃrTW.ǃUr_(r,t,null);return e.ǃroE()}return e.ǃroE()}ǃroC(e){const r=[],t=this.ǃUWL();for(const n of t.ǃUWX){const t=("addon"===n.ǃUAV()||"project"===n.ǃUAV())&&this.ǃUfw()&&n.ǃrSk();t&&e.set(`addons/plugin/${n.ǃux()}.c3addon`,this.ǃroO(n)),r.push({type:"plugin",id:n.ǃux(),name:n.ǃTi(),author:n.ǃU$N(),version:n.ǃU$S(),bundled:t})}for(const n of t.ǃUWi){const t=("addon"===n.ǃUAV()||"project"===n.ǃUAV())&&this.ǃUfw()&&n.ǃrSk();t&&e.set(`addons/behavior/${n.ǃux()}.c3addon`,this.ǃroO(n)),r.push({type:"behavior",id:n.ǃux(),name:n.ǃTi(),author:n.ǃU$N(),version:n.ǃU$S(),bundled:t})}for(const n of t.ǃrSW){const t=("addon"===n.ǃUAV()||"project"===n.ǃUAV())&&this.ǃUfw();t&&e.set(`addons/effect/${n.ǃux()}.c3addon`,this.ǃroO(n)),r.push({type:"effect",id:n.ǃux(),name:n.ǃTi(),author:n.ǃU$N(),version:n.ǃU$S(),bundled:t})}return this.ǃrCH.plugin.clear(),this.ǃrCH.behavior.clear(),this.ǃrCH.effect.clear(),r}ǃ$p(e){let r={projectFormatVersion:n,savedWithRelease:ǃr.ǃJv.ǃUHx,name:this.ǃrUm,runtime:this.ǃrCp,useWorker:this.ǃrCB,bundleAddons:this.ǃUfw(),usedAddons:this.ǃroC(e),uniqueId:this.ǃrCi,cloudId:this.ǃrC_,objectTypes:this.ǃrCD.ǃ$p(),containers:[...ǃroq.ǃroa(this)].map((e)=>e.ǃ$p()),families:this.ǃrCA.ǃ$p(),layouts:this.ǃrCO.ǃ$p(),eventSheets:this.ǃrCC.ǃ$p(),rootFileFolders:this.ǃrog()};return Object.assign(r,this.ǃrok())}ǃroy(e){let r=e.properties;this.ǃTF(r.description),this.ǃTm(r.version),this.ǃTn(r.author),this.ǃU$P(r.authorEmail),this.ǃU$Q(r.authorWebsite),this.ǃU$e(r.appId),this.ǃUfG(r.pixelRounding),this.ǃUfl(r.useLoaderLayout),this.ǃUfD(r.fullscreenMode),this.ǃUfa(r.fullscreenQuality),this.ǃUfc(r.viewportFit||"auto"),this.ǃrFZ.backgroundColor.ǃcI(r.backgroundColor),this.ǃrFZ.ǃrEw.ǃcI(r.splashColor),this.ǃUfJ(r.useThemeColor),this.ǃrFZ.ǃrEZ.ǃcI(r.themeColor),this.ǃUfE(r.useHighDpi),this.ǃUfA(r.orientations),this.ǃUfO(r.enableWebGL),this.ǃUfW(r.sampling),this.ǃUfS(r.downscaling),this.ǃUf$(r.loaderStyle),this.ǃUfz(r.preloadSounds),this.ǃUfj(r.clearBackground),r.hasOwnProperty("enhancedAccelerationPrecision")&&this.ǃUfy(r.enhancedAccelerationPrecision),this.ǃUfn(e.viewportWidth),this.ǃUfV(e.viewportHeight),this.ǃpk||(this.ǃrCI=e.firstLayout?this.ǃnD(e.firstLayout):null)}ǃ$d(e){if(e.projectFormatVersion>n)throw new Error("project from a future version of C3");if(e.hasOwnProperty("savedWithRelease")&&e.savedWithRelease>ǃr.ǃJv.ǃUHx){const r=new Error("project saved with future release of C3");throw r.type="saved-with-future-release",r.ǃrob=e.savedWithRelease,r}this.ǃrUm=e.name,this.ǃrCp=e.runtime||"c2","c3"===this.ǃrCp&&(this.ǃrCB=!!e.useWorker),this.ǃrCi=e.uniqueId,this.ǃrC_=e.cloudId||"{}",this.ǃrCc=!!e.bundleAddons,this.ǃrCE=e.firstLayout,this.ǃroy(e)}ǃroS(){return this.ǃryJ.ǃ$p()}ǃroo(e){this.ǃUfN(e.previewEffects),this.ǃrOk(e.previewBrowser),this.ǃUfP(e.pauseOnUnfocus)}ǃIB(){return this.ǃryJ.ǃ$p()}ǃIp(e){this.ǃryJ.ǃ$d(e)}ǃoD(){return this.ǃryJ}ǃVb(e,r){ǃr.ǃk(e),this.ǃryJ.ǃVb(e,r)}ǃVe(e){return ǃr.ǃk(e),this.ǃryJ.ǃVe(e)}ǃoY(r){r=!!r,this.ǃryJ.ǃoa(r)}ǃUfN(r){this.ǃryJ.ǃrOW(r)}ǃUfe(){return this.ǃryJ.ǃrOG()}ǃQE(){return this.ǃUfe()&&this.ǃUfg()}ǃrOk(e){this.ǃryJ.ǃrOk(e)}ǃrOM(){return this.ǃryJ.ǃrOM()}ǃUfP(r){this.ǃryJ.ǃrOx(r)}ǃUfK(){return this.ǃryJ.ǃrOR()}ǃroj(e){ǃr.ǃVg(e),e=Object.assign({},m,e);const r=new Map,t=new Set;e.ǃroe=t;const n=!!e.ǃrEC;r.set("project.c3proj",JSON.stringify(this.ǃ$p(r),null,"\t")),r.set("project.uistate.json",JSON.stringify(this.ǃIB()));for(let i of this.ǃUAQ())n&&i.ǃroN(t),(!n||i.ǃUlA())&&r.set(i.ǃroK(),JSON.stringify(i.ǃ$p(),null,"\t")),i.ǃroP(r,e);for(let i of this.ǃUlM()){if(n){if(!i.ǃUlA())continue;i.ǃroN(t)}r.set(i.ǃroK(),JSON.stringify(i.ǃ$p(),null,"\t"))}for(let i of this.ǃET()){if(n){if(!i.ǃUlA())continue;i.ǃroN(t)}r.set(i.ǃroK(i.ǃTi()),JSON.stringify(i.ǃ$p(),null,"\t")),r.set(i.ǃroK(i.ǃTi()+".uistate"),JSON.stringify(i.ǃIB()))}for(let i of this.ǃrSP()){if(n){if(!i.ǃUlA())continue;i.ǃroN(t)}r.set(i.ǃroK(),i.ǃa())}for(let i of this.ǃg$()){if(n){if(!i.ǃUlA())continue;i.ǃroN(t)}r.set(i.ǃroK(i.ǃTi()),JSON.stringify(i.ǃ$p(),null,"\t")),r.set(i.ǃroK(i.ǃTi()+".uistate"),JSON.stringify(i.ǃIB()))}n&&this.ǃrow(t);return Promise.resolve({ǃroQ:r,ǃroZ:t})}ǃrow(e){for(let r of this.ǃry_())r.ǃrow(e);for(let r of this.ǃryi())r.ǃrow(e);for(let r of this.ǃryX())r.ǃrow(e);for(let r of this.ǃrSw())r.ǃrow(e);for(let r of this.ǃrb_())r.ǃrow(e)}static async ǃrou(t,n){ǃr.ǃyd(t);const i=ǃr.ǃq(ǃr.ǃrEU,t),d=await i.ǃUQy("project.c3proj"),o=ǃr.ǃq(r),a=o.ǃrjU(d),s=a.ǃrSx,T=a.ǃrjr;return s.length?Promise.reject({type:"missing-addons",ǃrSx:s}):(await o.ǃrjT(T,i),n.duplicate&&(d.uniqueId=e(),d.cloudId=""),o.ǃrjv(d,i,n))}ǃrjU(e){const r=e.usedAddons,t={ǃrSx:[],ǃrjr:[]};if(!r)return t;for(const n of r)if(n.bundled)t.ǃrjr.push(n);else{const e="plugin"===n.type&&ǃr.ǃTc.ǃroI(n.id,this)||"behavior"===n.type&&ǃr.ǃsk.ǃroI(n.id,this)||"effect"===n.type&&ǃr.ǃrjJ.ǃroI(n.id,this);e||t.ǃrSx.push(n)}return t}async ǃrjT(e,r){const t=[];for(const n of e){const e=n.id,i=n.type;t.push(r.ǃkf(`addons/${i}/${e}.c3addon`))}const n=await Promise.all(t);for(const t of n)await ǃr.ǃrTW.ǃrjL(t,this);await ǃr.ǃJ.ǃAJ(!0),await ǃr.ǃrTW.ǃrjs(this),await ǃr.ǃrTW.ǃrjX(this),await ǃr.ǃTc.ǃAJ(),await ǃr.ǃsk.ǃAJ(),await ǃr.ǃrTW.ǃrjX(null)}static async ǃrji(t,n,i){ǃr.ǃ$(t,Blob),ǃr.ǃk(n);const d=ǃr.ǃq(ǃr.ǃrET,n),a=await ǃr.ǃUbn(t),o=ǃr.ǃq(r),s=o.ǃrjU(a),T=s.ǃrSx,l=s.ǃrjr;return T.length?Promise.reject({type:"missing-addons",ǃrSx:T}):(await o.ǃrjT(l,d),i.duplicate&&(a.uniqueId=e(),a.cloudId=""),o.ǃrjv(a,d,i))}async ǃrjv(e,r,t){return ǃr.ǃyd(e),ǃr.ǃ$(r,ǃr.ǃrIZ),t&&(this.ǃrCf=!!t.duplicate),this.ǃ$d(e),await this.ǃrCD.ǃrj_(e.objectTypes,r),t.indeterminate=!0,await this.ǃrjl(e.containers),await this.ǃrCA.ǃrjt(e.families,r),await this.ǃrCO.ǃrj$(e.layouts,r),await this.ǃrjf(e.rootFileFolders,r),await this.ǃrCC.ǃrjz(e.eventSheets,r),await this.ǃrjF(r),this.ǃryp(),this}async ǃrjF(e){ǃr.ǃyd(e);const r=await e.ǃrIu("project.uistate.json");if(!r)return this;const t=await e.ǃUQy("project.uistate.json");return this.ǃIp(t),this}ǃrjl(e){ǃr.ǃre(e);for(const r of e)ǃroq.ǃrjm(this,r)}ǃrjf(e,r){if(ǃr.ǃ$(r,ǃr.ǃrIZ),!!e){const t=[];for(const[n,i]of Object.entries(e)){const e=this.ǃrSK(n);t.push(e.ǃrjh(i,r))}return Promise.all(t)}}static async ǃrjn(e,t){ǃr.ǃyd(e);const n=e.ǃk$(".caproj");if(!n)throw new Error("missing .caproj file");const i=await e.ǃUQE(n),o=await ǃr.ǃti.Document.ǃRc(i),d=r.ǃrjV(o);if(d.length)return Promise.reject({type:"missing-addons",ǃrSx:d});const a=ǃr.ǃq(r);return await a.ǃrjp(o,e,t),a.ǃryp(),a}static ǃrjV(e){const r=e.ǃtf(),t=[],n=r.ǃUQF("used-plugins");if(n)for(const e of n.children("plugin")){const r=e.ǃkF("id");ǃr.ǃTc.ǃroI(r)||t.push({type:"plugin",id:r,name:e.ǃYK(),author:e.ǃkF("author")})}const i=r.ǃUQF("used-behaviors");if(i)for(const e of i.children("behavior")){const r=e.ǃkF("id");ǃr.ǃsk.ǃroI(r)||t.push({type:"behavior",id:r,name:e.ǃYK(),author:e.ǃkF("author")})}const o=r.ǃUQF("used-effects");if(o)for(const e of o.children("effect")){const r=e.ǃkF("id");ǃr.ǃrjJ.ǃroI(r)||t.push({type:"effect",id:r,name:e.ǃYK(),author:e.ǃkF("author")})}return t}async ǃrjp(r,t,n){ǃr.ǃ$(r,ǃr.ǃti.Document),ǃr.ǃyd(t);const i=r.ǃtf();if("c2project"!==i.ǃUQf())throw new Error("expected c2project tag");this.ǃrCf=!!n;const o=n?e():i.ǃUQz("unique-id");o&&(this.ǃrCi=o),this.ǃrUm=i.ǃYK("name"),this.ǃTF(i.ǃUQz("description")),this.ǃTm(i.ǃUQz("version")),this.ǃTn(i.ǃUQz("author")),this.ǃU$P(i.ǃUQz("author-email")),this.ǃU$Q(i.ǃUQz("author-website")),this.ǃU$e(i.ǃUQz("app-id")),this.ǃUfG(i.ǃUQB("pixel-rounding",!1)),this.ǃUfN(i.ǃUQB("preview-effects",!0)),this.ǃUfl(i.ǃUQB("use-loader-layout",!1)),i.ǃUQD("first-layout")&&(this.ǃrCE=i.ǃYK("first-layout"));const d=i.ǃtz("window-size");this.ǃUfn(d.ǃUQm("width")),this.ǃUfV(d.ǃUQm("height"));const a=i.ǃtz("configuration-settings"),s=new Map;for(const e of a.children("prop"))s.set(e.ǃkF("name"),e.ǃYK());this.ǃrOk(ǃRS.ǃrjB(s.get("Preview browser"))),this.ǃUfD(ǃRS.ǃrjd(s.get("Fullscreen in browser"))),this.ǃUfa(ǃRS.ǃrjc(s.get("Fullscreen scaling"))),this.ǃUfE("No"!==s.get("Use high-DPI display")),this.ǃUfA(ǃRS.ǃrjH(s.get("Orientations"))),this.ǃUfO("Off"!==s.get("Enable WebGL")),this.ǃUfW(ǃRS.ǃrjD(s.get("Sampling"))),this.ǃUfS(ǃRS.ǃrjY(s.get("Downscaling"))),this.ǃUf$(ǃRS.ǃrja(s.get("Loader style"))),this.ǃUfz("No"!==s.get("Preload sounds")),this.ǃUfP("Yes"===s.get("Pause on unfocus")),this.ǃUfj("No"!==s.get("Clear background"));const T=i.ǃtz("object-folder"),l=i.ǃUQF("families"),u=i.ǃtz("layout-folder"),U=i.ǃtz("event-folder");return await this.ǃrCD.ǃrjq(T,t),await this.ǃrjA(),await this.ǃrjW(l),await this.ǃrjG(i.ǃUQF("global-instances")),await this.ǃrjk(i,t),await this.ǃrCO.ǃrjM(u,t),await this.ǃrCC.ǃrjx(U,t),this}ǃrjR(e){if(ǃr.ǃre(e),2>e.length)throw new Error("container needs at least 2 objects");e.sort(ǃr.ǃUrd),this.ǃrCq.add(e.join(","))}ǃrjA(){for(let e of this.ǃrCq){let r=e.split(","),t=[];for(let e of r){let r=this.ǃUri(e);if(!r)throw new Error(`missing object type name '${e}' in container`);t.push(r)}if(2>t.length)throw new Error("invalid container");t[0].ǃUFC(t)}this.ǃrCq.clear()}ǃrjW(e){if(e)for(let r of e.children("family")){let e=ǃUUH.ǃrjg(r,this);this.ǃrCA.ǃrD(e)}}ǃrjG(e){if(e)for(let r of e.children("global-instance")){let e=r.ǃkF("type"),t=this.ǃUri(e);if(!t)throw new Error(`cannot find object type named '${e}'`);t.ǃUiZ().ǃrjO(r)}}async ǃrjk(e,r){const t=[],n=e.ǃUQF("sounds-folder");n&&t.push(this.ǃrCo.ǃrjI(n,r));const i=e.ǃUQF("music-folder");i&&t.push(this.ǃrCj.ǃrjI(i,r));const o=e.ǃUQF("files-folder");o&&t.push(this.ǃrCP.ǃrjI(o,r)),await Promise.all(t);const d=this.ǃrCP.ǃrEc("Icons",!1);return d&&d.ǃUll()&&d.ǃyY(),this}ǃryd(){const e=[...this.ǃrbL()],r=[...this.ǃrbJ()];for(let t of r){t.ǃrjE();let r=t.ǃTi();for(let n of e)if(r===n.ǃTi()){t.ǃrjC(n);continue}}app.ǃrOE(this,"refreshgloballayers")}ǃrOw(){let e=ǃr.ǃq(ǃr.ǃBL),r=Math.floor(this.ǃryr/8),t=this.ǃryr%8,n=45*t;return 0!==r&&(n+=45/(r+1)),e.ǃUSy(n%360,100,90,1),this.ǃryr++,e}ǃrjy(){return this.ǃryL}},ǃg.ǃrjb=new Map([["normal",0],["additive",1],["copy",3],["destination-over",4],["source-in",5],["destination-in",6],["source-out",7],["destination-out",8],["source-atop",9],["destination-atop",10]])}{function e(){return c||(c=new Map([["event-block",ǃgT],["comment",ǃXV],["event-group",ǃXh],["variable",ǃXB],["include",ǃXc]])),c}const r=["normal","additive","normal","copy","destination-over","source-in","destination-in","source-out","destination-out","source-atop","destination-atop"],t=new Set(["1","True","true","On","on","Yes","yes","Enabled","enabled"]),n=new Set(["0","False","false","Off","off","No","no","Disabled","disabled"]),i=/ /g,o=/icon\-[0-9]*\.png/,d=new Map([["(default)","default"],["Chrome","chrome"],["Edge","edge"],["Internet Explorer","internet-explorer"],["Firefox","firefox"],["Opera","opera"],["Safari","default"],["Node-Webkit","nwjs"],["NW.js","nwjs"],["Custom","custom"]]),a=new Map([["Off","off"],["No","off"],["","off"],["Crop","off"],["Yes","off"],["On (crop mode)","off"],["Scale inner","scale-inner"],["Scale outer","scale-outer"],["On (scale mode)","scale-outer"],["Scale","scale-outer"],["Letterbox scale","letterbox-scale"],["Letterbox integer scale","letterbox-integer-scale"]]),s=new Map([["Low quality","low"],["High quality","high"]]),T=new Map([["Any","any"],["Portrait","portrait"],["Landscape","landscape"]]),l=new Map([["Point","point"],["Linear","linear"]]),u=new Map([["Low quality","low"],["Medium quality","medium"],["High quality","high"]]),U=new Map([["Progress bar & logo","progress-logo"],["","progress-logo"],["Progress bar only","progress"],["Percentage text","percent"],["Nothing (not recommended)","none"]]);let c=null;window.ǃRS=class c{constructor(){throw new TypeError("static class can't be instantiated")}static ǃRb(e){return ǃr.ǃk(e),e.toLowerCase().replace(i,"-")}static ǃrjS(e){return isFinite(e)?(e=Math.floor(e),0>e||e>=r.length?"normal":r[e]):"normal"}static ǃrjB(e){return d.get(e)||"default"}static ǃrjd(e){return a.get(e)||"letterbox-scale"}static ǃrjc(e){return s.get(e)||"high"}static ǃrjH(e){return T.get(e)||"any"}static ǃrjD(e){return l.get(e)||"linear"}static ǃrjY(e){return u.get(e)||"medium"}static ǃrja(e){return U.get(e)||"progress-logo"}static ǃUpZ(e){return e&&"(none)"!==e?c.ǃRb(e):"normal"}static ǃrjo(e){let r=e.toString();return 0===r.length?"000":1===r.length?"00"+r:2===r.length?"0"+r:r}static ǃUcN(e){let r=e.split(","),t={name:"Arial",size:12,bold:!1,ǃUcK:!1};if(0e&&(e=72*-e/96),t.size=e||16}return 2"===T){let t=o.ǃ_N(r);if(!("combo"===t.ǃNZ()))e.ǃsR(r,i);else if(t.ǃrjN(i))e.ǃsR(r,i);else if(i=c.ǃRb(i),t.ǃrjN(i))e.ǃsR(r,i);else{let e=t.ǃUFA().map((e)=>"\""+e.value+"\"").join(",");console.warn(`[C2 compat] Could not load ${d} '${a}' property '${r}' from a Construct 2 project: the value '${i}' could not be automatically recognised as one of the valid combo items [${e}]. Handle it with LoadC2Property().`)}return}if(""===T){let t=parseFloat(i);return void(ǃr.ǃUjO(i)&&isFinite(t)?e.ǃsR(r,t):console.warn(`[C2 compat] Could not load ${d} '${a}' property '${r}' from a Construct 2 project: the value '${i}' could not be recognised as a number. Handle it with LoadC2Property().`))}if(""===T){let o=!1;if(t.has(i))o=!0;else if(n.has(i))o=!1;else return void console.warn(`[C2 compat] Could not load ${d} '${a}' property '${r}' from a Construct 2 project: the value '${i}' could not be recognised as a boolean. Handle it with LoadC2Property().`);return void e.ǃsR(r,o)}if(s instanceof ǃr.ǃBL){let t=new ǃr.ǃBL;return void(t.ǃUrx(i)?e.ǃsR(r,t):console.warn(`[C2 compat] Could not load ${d} '${a}' property '${r}' from a Construct 2 project: the value '${i}' could not be recognised as a color. Handle it with LoadC2Property().`))}return void console.warn(`[C2 compat] Could not load ${d} '${a}' property '${r}' from a Construct 2 project: the value '${i}' could not be converted to '${T}'. Handle it with LoadC2Property().`)}console.warn(`[C2 compat] Could not load ${d} '${a}' property '${r}' from a Construct 2 project, because the property name is not recognised. The value '${i}' has been ignored. Handle it with LoadC2Property().`)}static ǃrjK(e,r,t,n){const i=r.ǃrjP(t);if(i&&("float"===i.ǃNZ()||"percent"===i.ǃNZ())){const r=parseFloat(n);if(isFinite(r))return void e.ǃUzl(t,r)}const o=r.ǃrjw(t);if(o){const r=o.ǃUdp;if("color"===r.ǃNZ()){const t=o.ǃrAD,i=parseFloat(n);if(isFinite(i)&&0<=t&&4>t){const n=e.ǃUzi(r.ǃux());return n.ǃUSo(t,i),void e.ǃUzl(r.ǃux(),n)}}else{const r=parseFloat(n);if(isFinite(r))return void e.ǃUzl(t,r)}}console.warn(`[C2 compat] Could not load effect '${r.ǃux()}' parameter '${t}' value '${n}' from a Construct 2 project.`)}static ǃrjQ(e){return ǃr.ǃk(e),o.test(e)||"loading-logo.png"===e}static ǃrjZ(r){return ǃr.ǃk(r),e().get(r)||null}}}"use strict",window.ǃrSB=class extends ǃr.ǃT_{constructor(e,r,t){ǃr.ǃ$(e,ǃg),ǃr.ǃk(r),super(),this.ǃUf=e,this.ǃrUm=r,this.ǃrkO=!!t,this.ǃrju=[],this.ǃreU=new Map,this.ǃrCh=!1,this.ǃrer=null,this.ǃUf.ǃrSp(this)}ǃTq(e){this.ǃrer=null,this.ǃUf.ǃrSd(this);for(let r of this.ǃrju)r.ǃTq(e);if(ǃr.ǃXk(this.ǃrju),!e){for(let e of this.ǃreU.values())e.ǃTq();this.ǃreU.clear()}ǃr.ǃTq(this)}ǃIW(){this.ǃrCh=!0}ǃUlA(){return this.ǃrCh}ǃTz(e){ǃr.ǃk(e);this.ǃrUm===e||(this.ǃUf.ǃrSd(this),this.ǃrUm=e,this.ǃUf.ǃrSp(this))}ǃTi(){return this.ǃrUm}ǃO(){return this.ǃUf}ǃreT(){return this.ǃrkO}ǃrev(e){if(ǃr.ǃ$(e,ǃreJ),this.ǃreU.has(e.ǃUAh()))throw new Error("id already in use");this.ǃreU.set(e.ǃUAh(),e),this.ǃrCh=!0}ǃreL(e){ǃr.ǃ$(e,ǃreJ);let r=e.ǃUAh();if(!this.ǃreU.has(r))throw new Error("cannot find id");this.ǃreU.delete(r);let t=e.ǃUTF();t&&t.ǃreL(e),this.ǃrCh=!0}ǃres(e){ǃr.ǃ$t(e);let r=this.ǃreU.get(e);if("undefined"==typeof r)throw new Error("cannot find id");return r}ǃreX(e){return ǃr.ǃ$t(e),this.ǃreU.has(e)}ǃrei(){return!!this.ǃrer}ǃre_(){if(!this.ǃrei())throw new Error("not busy");return this.ǃrer.then(()=>this)}ǃrel(){return this.ǃrCh?this.ǃrer?this.ǃrer:(this.ǃrer=this.ǃret(),this.ǃrer):Promise.resolve(this)}async ǃret(){try{app.ǃre$().ǃrD();const e=await this.ǃref();return this.ǃrez(e),this}finally{app.ǃre$().ǃP(),this.ǃrer=null}}ǃreF(){this.ǃrCh=!1;const e=[];for(const r of this.ǃreU.values())!r.ǃrem()&&r.ǃreh()&&e.push(r.ǃren());if(0===e.length)return Promise.resolve([]);if(1===e.length){const t=e[0];return Promise.resolve([{width:t.w,height:t.h,rects:[{id:t.id,x:0,y:0}]}])}return ǃr.ǃrOs.ǃrgu("BuildSpriteSheets",{rects:e,maxSize:this.ǃUf.ǃrSY()})}ǃref(){return this.ǃreF().then((e)=>this.ǃrCh?this.ǃref():e)}ǃrez(e){for(let r=this.ǃrju.length,t=e.length;re.length;){let e=this.ǃrju.pop();e.ǃTq()}for(let r=0,t=e.length;rthis.ǃrgF(),300),this.ǃreW=()=>this.ǃQl(),app.ǃsd().addEventListener("webglcontextlost",this.ǃreW)}ǃTq(e){if(this.ǃ_a)throw new Error("spritesheet was already released");this.ǃ_a=!0,this.ǃreH=null,app.ǃsd().removeEventListener("webglcontextlost",this.ǃreW),this.ǃreW=null,e?this.ǃreU.clear():this.ǃreG(),this.ǃrgF(),this.ǃreY=null,this.ǃrSE(),this.ǃrgz.ǃTq(),this.ǃrgz=null,this.ǃrep=null,ǃr.ǃTq(this)}ǃrSE(){this.ǃUnP&&(URL.revokeObjectURL(this.ǃUnP),this.ǃUnP=""),this.ǃrea=null}ǃQl(){this.ǃrgF()}ǃXN(){return assert(0<=this.ǃreB,"invalid sprite sheet index"),this.ǃreB}ǃUqc(){return(this.ǃrep.ǃTi()+"-sheet"+this.ǃXN()+("jpeg"===this.ǃreq?".jpg":".png")).toLowerCase()}ǃ_v(){if(0>=this.ǃUBa)throw new Error("sheet not yet created");return this.ǃUBa}ǃ_L(){if(0>=this.ǃUBq)throw new Error("sheet not yet created");return this.ǃUBq}ǃO(){return this.ǃrep.ǃO()}ǃrek(){return this.ǃreU.size}ǃreM(){return this.ǃreq}ǃrex(r){if(r=!!r,this.ǃrep.ǃUlA())throw new Error("sprite sheet collection changed");if(this.ǃrea)return Promise.resolve(this.ǃrea);if(this.ǃreY)return this.ǃreY;const t=this.ǃO();return app.ǃreR().ǃrD(),this.ǃreY=e.ǃrD(async()=>{try{const e=await this.ǃreg(r,!0);if(app.ǃreR().ǃP(),t.ǃfw())return null;app.ǃreO().ǃrD();const n="jpeg"===this.ǃreq?"image/jpeg":"image/png",i=await ǃr.ǃUbq(e,n,this.ǃreA);return app.ǃreO().ǃP(),this.ǃrSE(),this.ǃrea=i,this.ǃrea}finally{this.ǃreY=null}}),this.ǃreY}ǃreI(){return assert(this.ǃrea,"no pre-rendered sprite sheet blob available"),this.ǃrea}ǃreE(){return this.ǃUnP||(this.ǃUnP=URL.createObjectURL(this.ǃreI())),this.ǃUnP}ǃreC(){return this.ǃreI().size}ǃrey(){return this.ǃrep.ǃUlA()?(this.ǃrep.ǃrel(),this.ǃreD):(this.ǃreD&&this.ǃrgz.ǃtF(),this.ǃreD)}ǃreb(e,r){return(this.ǃrgz.ǃtF(),this.ǃreD)?Promise.resolve(this.ǃreD):this.ǃreH?this.ǃreH:(e=!!e,r=!!r,this.ǃreH=this.ǃreS(e,r),this.ǃreH)}async ǃreS(e,r){try{const t=await this.ǃreo(e,r);return ǃr.ǃ_W(this)||this.ǃ_a||!t?null:(this.ǃrgz.ǃtF(),this.ǃreD&&app.ǃpG().ǃpM(this.ǃreD),this.ǃreD=t,app.ǃsd().ǃsB(),this.ǃreD)}finally{this.ǃreH=null}}async ǃrej(e,r){if(this.ǃrec=!1,this.ǃrep.ǃUlA()&&(await this.ǃrep.ǃrel()),ǃr.ǃ_W(this)||this.ǃ_a||this.ǃrec)return null;const t=await this.ǃreg();if(ǃr.ǃ_W(this)||this.ǃ_a||this.ǃrec||app.ǃpG().ǃsn())return null;app.ǃree().ǃrD();const n=await app.ǃpG().ǃrRA(t,{ǃpI:e,ǃpE:r,ǃZr:"low"!==this.ǃO().ǃUfb(),width:this.ǃUBa,height:this.ǃUBq});return app.ǃree().ǃP(),app.ǃpG().ǃsn()?null:ǃr.ǃ_W(this)||this.ǃ_a||this.ǃrec?(app.ǃpG().ǃpM(n),null):n}async ǃreo(e,r){const t=this.ǃrej(e,r);return ǃr.ǃ_W(this)||this.ǃ_a?null:this.ǃrec?this.ǃreo(e,r):t}async ǃreN(e,r,t){const n=await e.ǃreK(r);return t&&e.ǃreP(),n}async ǃreg(e,r){e=!!e,r||app.ǃreR().ǃrD();const t=this.ǃUBa*this.ǃUBq>128*128,n=[...this.ǃreU.values()].filter((e)=>!ǃr.ǃ_W(e)&&!e.ǃ_W());let i=!1;if(1===n.length){const e=n[0];i=0===e.ǃrew()&&0===e.ǃreQ()&&e.ǃ_v()===this.ǃUBa&&e.ǃ_L()===this.ǃUBq}const o=t&&!i,d=n.map((r)=>this.ǃreN(r,e,o));if(i){const e=await d[0];return r||app.ǃreR().ǃP(),e}const a=await Promise.all(d);return this.ǃreZ(n,a,{ǃreu:r,ǃrNU:t})}ǃreZ(e,r,t){return ǃr.ǃ_W(this)||this.ǃ_a||!e.length?null:(assert(e.length===r.length,"should have same number of ImageSprite and ImageData"),t.ǃrNU?this.ǃrNr(e,r,t):this.ǃrNT(e,r,t))}ǃrNT(e,r,t){const n=this.ǃUBa,o=this.ǃUBq,i=new ImageData(n,o),d=new Uint32Array(i.data.buffer);for(let a=0,i=e.length;athis.ǃrNd(),30),this.ǃUBa=0,this.ǃUBq=0,this.ǃrNc=0,this.ǃrNH=0,this.ǃUBg=new ǃr.Rect,this.ǃrND=new window.SDK.Rect(this.ǃUBg),this.ǃrNY=n,this.ǃrNa=0,this.ǃrNq=0,this.ǃrNA=0,this.ǃrNW=0,this.ǃrNG=0,this.ǃrNk=0,this.ǃreq="png",this.ǃreA=1,this.ǃrNM="",this.ǃrNx=null,this.ǃrep.ǃrev(this),t.add(this),this.ǃ_a=!1}ǃTq(){if(ǃr.ǃ_W(this))throw new Error("imageSprite was already released");if(this.ǃ_a)throw new Error("imageSprite was already released");this.ǃ_a=!0,this.ǃrNp=0,this.ǃrep.ǃreX(this.ǃUPm)&&this.ǃrep.ǃreL(this),this.ǃrNn=null,this.ǃrNV=null,t.delete(this),this.ǃUf.ǃrSD(this.ǃUPm),this.ǃUPm=-1,this.ǃrep=null,this.ǃUf=null,this.ǃrtX=null,this.ǃUuk=null,this.ǃrNF=null,this.ǃrNm=null,this.ǃrNh=null,this.ǃUBg=null,this.ǃrND=null,this.ǃrNx=null,this.ǃrNB.ǃTq(),this.ǃrNB=null,ǃr.ǃTq(this)}ǃ_W(){return this.ǃ_a}ǃrei(){return 0=e||0>=r)throw new Error("invalid size");if(this.ǃUBa=e,this.ǃUBq=r,this.ǃrNz=!0,this.ǃrep.ǃIW(),"none-own-sheet"===this.ǃrNY)this.ǃrNA=this.ǃUBa,this.ǃrNW=this.ǃUBq;else if("border"===this.ǃrNY)this.ǃrNA=this.ǃUBa+2,this.ǃrNW=this.ǃUBq+2;else if("power-of-two"===this.ǃrNY)this.ǃrNA=ǃr.ǃFr(this.ǃUBa+2),this.ǃrNW=ǃr.ǃFr(this.ǃUBq+2),4>this.ǃrNA&&(this.ǃrNA=4),4>this.ǃrNW&&(this.ǃrNW=4);else throw new Error("invalid pad type");this.ǃrNG=this.ǃrNA,this.ǃrNk=this.ǃrNW}ǃreh(){return this.ǃrNz}ǃrNl(e,r){if(ǃr.ǃ$t(e),ǃr.ǃ$t(r),this.ǃUBa>e||this.ǃUBq>r)throw new Error("cannot clamp padding to smaller than content size");this.ǃrNA>e&&(this.ǃrNA=e),this.ǃrNW>r&&(this.ǃrNW=r)}ǃrN_(){return this.ǃrNY}ǃrNg(e,r,t){if(ǃr.ǃ$(e,Blob),ǃr.ǃ$t(r),ǃr.ǃ$t(t),this.ǃrNf)throw new Error("already set content");if(!e.size)throw new Error("blob is empty");this.ǃrNf=!0,this.ǃrNR(r,t),this.ǃUuk=e}async ǃrNO(e){if(ǃr.ǃ$(e,Blob),this.ǃrNf)throw new Error("already set content");if(!e.size)throw new Error("blob is empty");this.ǃrNf=!0,this.ǃUuk=e,this.ǃrNp++;const r=await this.ǃ_i();return ǃr.ǃ_W(this)||this.ǃ_a?null:(this.ǃrNR(r.width,r.height),this.ǃrNp--,this)}async ǃrNI(e){if(ǃr.ǃIO(e,"canvas"),this.ǃrNf)throw new Error("already set content");if(0>=e.width||0>=e.height)throw new Error("invalid canvas size");this.ǃrNf=!0,this.ǃrNR(e.width,e.height),this.ǃrNp++;const r=await ǃr.ǃRa(e);if(ǃr.ǃ_W(this)||this.ǃ_a)return null;if(!r.size)throw new Error("content blob is empty");return this.ǃUuk=r,this.ǃrNp--,this}ǃUAh(){return this.ǃUPm}ǃ_v(){return this.ǃUBa}ǃ_L(){return this.ǃUBq}ǃrNL(){return this.ǃrNA}ǃrNs(){return this.ǃrNW}ǃrew(){return this.ǃrNc}ǃreQ(){return this.ǃrNH}ǃrNv(){return this.ǃrNa}ǃrNJ(){return this.ǃrNq}ǃrNt(e){return assert(this.ǃrtX,"should already be on a sheet"),this.ǃrNa!==e.x||this.ǃrNq!==e.y}ǃa(){if(!this.ǃUuk)throw new Error("no content set");if(!this.ǃUuk.size)throw new Error("image sprite has empty blob");return this.ǃUuk}ǃPL(){if(!this.ǃUuk)throw new Error("no content set");if(!this.ǃUuk.size)throw new Error("image sprite has empty blob");return this.ǃUuk.slice(0,this.ǃUuk.size,this.ǃUuk.type)}ǃ_i(e){if(e=!!e,!this.ǃUuk)throw new Error("no content set");if(!this.ǃUuk.size)throw new Error("image sprite has empty blob");return(this.ǃrNB.ǃtF(),this.ǃrNF)?Promise.resolve(this.ǃrNF):this.ǃrNn?this.ǃrNn:(this.ǃrNn=this.ǃrNE(e),this.ǃrNn)}async ǃrNE(e){try{this.ǃrNp++;const r=await ǃr.ǃUrD(this.ǃUuk);return ǃr.ǃ_W(this)||this.ǃ_a?r:(this.ǃrNB.ǃtF(),e||(this.ǃrNF=r),r)}finally{this.ǃrNn=null,this.ǃrNp--}}ǃrNC(e){if(e=!!e,!this.ǃUuk)throw new Error("no content set");if(!this.ǃUuk.size)throw new Error("image sprite has empty blob");if(!ǃr.ǃUCV.ImageBitmap)throw new Error("imagebitmap not supported");return(this.ǃrNB.ǃtF(),this.ǃrNm)?Promise.resolve(this.ǃrNm):this.ǃrNV?this.ǃrNV:(this.ǃrNV=this.ǃrNy(e),this.ǃrNV)}async ǃrNy(e){try{this.ǃrNp++;const r=await createImageBitmap(this.ǃUuk);return ǃr.ǃ_W(this)||this.ǃ_a?r:(this.ǃrNB.ǃtF(),e||(this.ǃrNm=r),r)}finally{this.ǃrNV=null,this.ǃrNp--}}ǃpR(e){return ǃr.ǃUCV.ImageBitmap?this.ǃrNC(e):this.ǃ_i(e)}async ǃreK(e){if(e=!!e,!this.ǃUuk)throw new Error("no content set");if(!this.ǃUuk.size)throw new Error("image sprite has empty blob");if(this.ǃrNB.ǃtF(),this.ǃrNh)return Promise.resolve(this.ǃrNh);try{this.ǃrNp++;const r=await ǃr.ǃUbH(this.ǃUuk);return ǃr.ǃ_W(this)||this.ǃ_a?r:(this.ǃrNB.ǃtF(),e||(this.ǃrNh=r),r)}finally{this.ǃrNp--}}ǃreP(){this.ǃrNh=null}ǃrNX(){this.ǃrtX=null}ǃUTF(){return this.ǃrtX}ǃrkw(e,r,t){var n=Math.floor;this.ǃrtX=r,this.ǃrNa=e.x,this.ǃrNq=e.y;const i=this.ǃUBa,o=this.ǃUBq,d=this.ǃrtX.ǃ_v(),a=this.ǃrtX.ǃ_L();if(t){this.ǃrNA=this.ǃrNG,this.ǃrNW=this.ǃrNk;let e=0,r=0;"border"===this.ǃrNY?(e=1,r=1):"power-of-two"===this.ǃrNY&&(e=n((this.ǃrNA-i)/2),r=n((this.ǃrNW-o)/2)),this.ǃrNc=this.ǃrNa+e,this.ǃrNH=this.ǃrNq+r}else this.ǃrNc=0,this.ǃrNH=0,this.ǃrNa=0,this.ǃrNq=0;this.ǃUBg.set(this.ǃrNc/d,this.ǃrNH/a,(this.ǃrNc+i)/d,(this.ǃrNH+o)/a)}ǃrey(){if(ǃr.ǃ_W(this))throw new Error("imagesprite was released");if(this.ǃ_a)throw new Error("imagesprite was released");if(!this.ǃUuk)throw new Error("no content set");if(!this.ǃUuk.size)throw new Error("image sprite has empty blob");return this.ǃrtX?this.ǃrtX.ǃrey():null}async ǃreb(e,r){if(!this.ǃUuk)throw new Error("no content set");if(!this.ǃUuk.size)throw new Error("image sprite has empty blob");if(!this.ǃrtX&&this.ǃrem())return null;try{if(this.ǃrNp++,(!this.ǃrtX||this.ǃrep.ǃUlA())&&(await this.ǃrep.ǃrel(),ǃr.ǃ_W(this)||this.ǃ_a))return null;const t=await this.ǃrtX.ǃreb(e,r);return ǃr.ǃ_W(this)||this.ǃ_a?null:t}finally{this.ǃrNp--}}ǃUTz(){return!ǃr.ǃ_W(this)&&this.ǃUuk&&this.ǃrtX&&this.ǃrep&&!this.ǃrep.ǃUlA()}ǃtD(){if(ǃr.ǃ_W(this))throw new Error("imagesprite was released");if(this.ǃ_a)throw new Error("imagesprite was released");if(!this.ǃUuk)throw new Error("no content set");if(!this.ǃUuk.size)throw new Error("image sprite has empty blob");if(!this.ǃrtX)throw new Error("image sprite not on a sheet");if(this.ǃrep&&this.ǃrep.ǃUlA())throw new Error("image sprite collection needs rebuilding");return this.ǃUBg}ǃrNb(){return this.ǃrND}ǃren(){if(ǃr.ǃ_W(this))throw new Error("imagesprite was released");if(this.ǃ_a)throw new Error("imagesprite was released");if(!this.ǃrNz)throw new Error("not yet loaded size");if(0>=this.ǃUBa||0>=this.ǃUBq||0>=this.ǃrNA||0>=this.ǃrNW)throw new Error("invalid size");return{w:this.ǃrNG,h:this.ǃrNk,ow:this.ǃUBa,oh:this.ǃUBq,id:this.ǃUPm,own:"none-own-sheet"===this.ǃrNY}}ǃreM(){return this.ǃreq}ǃrNi(){return this.ǃreA}ǃrNS(e,r){ǃr.ǃk(e),ǃr.ǃ$t(r),this.ǃreq=e,this.ǃreA=r}async ǃrNo(){return this.ǃrNM?this.ǃrNM:r.ǃrD(async()=>{const e=await this.ǃreK(!0),r=await ǃr.Crypto.ǃUoj(e.data.buffer);return this.ǃrNM=r,r})}ǃrNj(e){ǃr.ǃVm(e,n);this.ǃrNx===e||(this.ǃrNx=e,this.ǃrep.ǃIW())}ǃrNe(){return this.ǃrNx}ǃrem(){return!!this.ǃrNx}ǃrNN(){return this.ǃUuk?this.ǃUuk.size:0}ǃrNK(){return this.ǃrNF||this.ǃrNh||this.ǃrNm?4*(this.ǃUBa*this.ǃUBq):0}static all(){return t.values()}}}{window.ǃrSl=class extends ǃr.ǃT_{constructor(e,r){ǃr.ǃ$(e,ǃg),ǃr.ǃk(r),super(),this.ǃrep=ǃr.ǃq(ǃrSB,e,r,!1),this.ǃrNP=new Set}ǃTq(e){this.ǃrep.ǃTq(e),this.ǃrep=null,this.ǃrNP.clear(),this.ǃrNP=null,ǃr.ǃTq(this)}ǃrS_(){return this.ǃrep}ǃrNw(){return this.ǃrNP.size}ǃTi(){return this.ǃrep.ǃTi()}ǃUll(){return 0===this.ǃrNP.size}ǃrNQ(){let e=0;for(let r of this.ǃrNP)r.ǃqT()?e+=r.ǃrNZ():e++;return e}ǃr$p(){return this.ǃrNQ()>=100}ǃUrf(e){if(ǃr.ǃ$(e,ǃuF),this.ǃr$p())throw new Error("shared sprite sheet collection is full");if(this.ǃrNP.has(e))throw new Error("object already added");this.ǃrNP.add(e)}ǃUlR(e){return(ǃr.ǃ$(e,ǃuF),!!this.ǃrNP.has(e))&&(this.ǃrNP.delete(e),!0)}ǃU_Z(e){return ǃr.ǃ$(e,ǃuF),this.ǃrNP.has(e)}ǃrel(){return this.ǃrep.ǃrel()}}}{const e=new Set(["boolean","number","string"]);window.ǃU$W=class r extends ǃia{constructor(r,t,n){if(ǃr.ǃ$(r,ǃaN),ǃr.ǃk(t),ǃr.ǃk(n),super(r.ǃO()),!e.has(n))throw new Error("invalid type");if(this.ǃrNu=r,this.ǃrKU=null,t=ǃaN.ǃUrc(t,!1),!t)throw new Error("invalid name");if(this.ǃrNu.ǃrKr(t))throw new Error("name already in object class namespace");this.ǃrUm=t,this.ǃUPe=n,this.ǃrfh="",this.ǃrKT=new Map}ǃTq(){this.ǃrNu=null,this.ǃrKT.clear()}ǃlk(){return"instance-variable"}ǃU_W(){if(!this.ǃrKU)throw new Error("instance var not yet added to folder");return this.ǃrKU}ǃrER(e){ǃr.ǃ$(e,ǃrKv),this.ǃrKU=e}ǃiT(){return this.ǃrNu}ǃyY(){super.ǃyY(),this.ǃO().ǃyO()}ǃyq(){super.ǃyq(),this.ǃO().ǃyO()}ǃrEz(){app.ǃrKJ(this,"instancevariableadd"),this.ǃO().ǃrym()}ǃrEf(){this.ǃO().ǃrym(),app.ǃrKJ(this,"instancevariableremove")}ǃTz(e){if(ǃr.ǃk(e),e=ǃaN.ǃUrc(e,!1),!e)throw new Error("invalid name");if(this.ǃrUm!==e){if(!ǃr.ǃNu(this.ǃrUm,e)&&this.ǃrNu.ǃrKr(e))throw new Error("name already in object class namespace");this.ǃrUm=e;const r=this.ǃO();r.ǃSi(),r.ǃrym(),app.ǃrE$(this,"projectobjectnamechange")}}ǃTi(){return this.ǃrUm}ǃrKL(r){if(ǃr.ǃk(r),this.ǃUPe!==r){if(!e.has(r))throw new Error("invalid type");this.ǃUPe=r;for(let e of this.ǃrKT.keys()){let r;switch(this.ǃUPe){case"boolean":r=!1;break;case"number":r=0;break;case"string":r="";}this.ǃrKT.set(e,r)}this.ǃiT().ǃIW(),this.ǃiT().ǃrKs(),app.ǃrKJ(this,"instancevariablechange"),app.ǃrKJ(this,"instancevariabletypechange")}}ǃNZ(){return this.ǃUPe}ǃTF(e){ǃr.ǃk(e);this.ǃrfh===e||(this.ǃrfh=e,this.ǃiT().ǃIW(),app.ǃrKJ(this,"instancevariablechange"))}ǃi_(){return this.ǃrfh}ǃUFV(e,r){switch(ǃr.ǃ$(e,ǃ_A),this.ǃUPe){case"boolean":r=!!r;break;case"number":ǃr.ǃhn(r);break;case"string":ǃr.ǃk(r);}this.ǃrKT.set(e,r),app.ǃrKJ(this,"instancevariablechange"),e instanceof ǃYR?e.ǃle().ǃIW():e.ǃrKX()?e.ǃrKX().ǃIW():e.ǃO().ǃIW()}ǃrKi(e,r){ǃr.ǃ$(e,ǃ_A),ǃr.ǃk(r);let t;switch(this.ǃUPe){case"boolean":t="true"===r.toLowerCase();break;case"number":t=parseFloat(r);break;case"string":t=r;break;default:throw new TypeError("invalid type");}this.ǃUFV(e,t)}ǃrK_(e){return ǃr.ǃ$(e,ǃ_A),this.ǃrKT.has(e)}ǃUFn(e){ǃr.ǃ$(e,ǃ_A);let r=this.ǃrKT.get(e);if("undefined"==typeof r)throw new Error("missing instance variable value");return r}ǃrKl(e){ǃr.ǃVm(e,ǃuF);let r=null,t=null;for(let[n,i]of this.ǃrKT){if(!n.ǃXI()){null==t&&(t=i);continue}if(null==r&&(r=i),e&&n.ǃiQ()===e)return i}if(null!==r)return r;if(null!==t)return t;switch(this.ǃUPe){case"boolean":return!1;case"number":return 0;case"string":return"";default:throw new TypeError("invalid type");}}ǃrKt(){if(0===this.ǃrKT.size)return this.ǃrKl();let e=null;for(let r of this.ǃrKT.values())if(null==e)e=r;else if(e!==r)return null;return e}ǃrK$(e){ǃr.ǃ$(e,ǃaN);let r=[...e.ǃUFm()],t=r.indexOf(this);return assert(-1!==t,"cannot find instance variable export index"),t}ǃ$p(e){ǃr.ǃVg(e);const r=e&&e.mode||"",t={name:this.ǃTi(),type:this.ǃNZ(),desc:this.ǃi_()};return"copy"!==r&&(t.sid=this.ǃrEX()),t}static ǃSa(e,t){const n=ǃr.ǃq(r,e,t.name,t.type);return n.ǃrfh=t.desc,t.hasOwnProperty("sid")&&n.ǃrE_(t.sid),n}static ǃrKf(e,r){ǃr.ǃ$(e,ǃaN);let t=r.ǃkF("name"),n=r.ǃkF("type"),i=e.ǃZZ(t,n);return i.ǃTF(r.ǃkF("comment")||""),r.ǃUQd("sid")&&i.ǃrE_(r.ǃUQc("sid")),i}}}"use strict",window.ǃrKv=class extends ǃUie{constructor(e,r){ǃr.ǃ$(e,ǃaN),super(e.ǃO(),r,ǃU$W),this.ǃrNu=e,this.ǃop()&&(this.ǃrUm="")}ǃIW(){this.ǃrNu.ǃIW()}ǃrD(e){if(ǃr.ǃ$(e,ǃU$W),e.ǃrKU)throw new Error("instance variable already belongs to folder");e.ǃrKU=this,super.ǃrD(e),app.ǃrKJ(e,"instancevariableadd")}ǃrEz(){this.ǃIW()}ǃrEf(){this.ǃIW()}},"use strict",window.ǃU$G=class extends ǃia{constructor(e,r,t){if(ǃr.ǃ$(e,ǃaN),ǃr.ǃ$(r,ǃrbc),ǃr.ǃk(t),super(e.ǃO()),this.ǃrNu=e,this.ǃrKz=r,this.ǃrKU=null,this.ǃ__=null,t=ǃaN.ǃUrc(t,!0),!t)throw new Error("invalid name");if(this.ǃrNu.ǃrKr(t))throw new Error("name already in object class namespace");this.ǃrUm=t,this.ǃrKF=new Map}ǃTq(){this.ǃ__.ǃTq(),this.ǃrKF.clear(),this.ǃ__=null,this.ǃrNu=null,this.ǃrKz=null}ǃlk(){return"behavior-type"}ǃU_W(){if(!this.ǃrKU)throw new Error("behavior type not yet added to folder");return this.ǃrKU}ǃrER(e){ǃr.ǃ$(e,ǃrKm),this.ǃrKU=e}ǃiT(){return this.ǃrNu}ǃNa(){return this.ǃrKz}ǃyY(){super.ǃyY(),this.ǃO().ǃyO()}ǃyq(){super.ǃyq(),this.ǃO().ǃyO()}ǃrEl(){for(let e of this.ǃrKF.values())e.ǃrEl();super.ǃrEl()}ǃrEt(){super.ǃrEt();for(let e of this.ǃrKF.values())e.ǃrEt()}ǃrEz(){app.ǃrKh(this,"behaviortypeadd"),this.ǃO().ǃrym()}ǃrEf(){app.ǃZo(),this.ǃO().ǃrym(),app.ǃrKh(this,"behaviortyperemove")}ǃrKn(e){ǃr.ǃ$(e,ǃ_A);let r=ǃr.ǃq(ǃrje,this,e);return r.ǃrKV=this.ǃ__.ǃ_q(r),r}ǃrKp(e,r){ǃr.ǃ$(e,ǃ_A),ǃr.ǃVm(r,ǃ_A);let t=this.ǃrKF.get(e);if(t)return t;r&&(t=this.ǃrKF.get(r));const n=this.ǃrKn(e);return t&&n.ǃrKB(t),this.ǃrKF.set(e,n),n}ǃUFD(e){ǃr.ǃ$(e,ǃ_A);const r=this.ǃrKF.get(e);if(!r)throw new Error("object instance does not have associated behavior instance");return r}ǃrKd(e){return ǃr.ǃ$(e,ǃ_A),this.ǃrKF.has(e)}ǃrKc(){return ǃr.ǃV(this.ǃrKF.values())}*ǃuv(){for(let e of this.ǃrKF.values())e.ǃXI()&&(yield e)}ǃTz(e){if(ǃr.ǃk(e),e=ǃaN.ǃUrc(e,!0),!e||ǃr.ǃUyh(e))throw new Error("invalid name");if(this.ǃrUm!==e){if(!ǃr.ǃNu(this.ǃrUm,e)&&this.ǃrNu.ǃrKr(e))throw new Error("name already in object class namespace");this.ǃrUm=e;const r=this.ǃO();r.ǃSi(),r.ǃrym(),app.ǃrE$(this,"projectobjectnamechange")}}ǃU_g(e,r){return ǃr.ǃk(e),ǃr.ǃIO(r),name=ǃaN.ǃUrc(e,!0),ǃr.ǃJ.ǃrx("model.object-class.behavior-types.errors"),!name||ǃr.ǃUyh(name)?(ǃr.ǃo.ǃsZ.ǃyy.ǃrp(r,"warning",lang(".name-invalid.title"),lang(".name-invalid.message"),{align:"bottom"}),void ǃr.ǃJ.ǃrR()):!ǃr.ǃNu(name,this.ǃTi())&&this.ǃrNu.ǃrKr(name)?(ǃr.ǃo.ǃsZ.ǃyy.ǃrp(r,"warning",lang(".name-used.title"),ǃMp(".name-used.message",name),{align:"bottom"}),void ǃr.ǃJ.ǃrR()):void(!ǃr.ǃNu(name,e)&&ǃr.ǃo.ǃsZ.ǃyy.ǃrp(r,"warning",lang(".name-changed.title"),lang(".name-changed.message"),{align:"bottom"}),ǃr.ǃJ.ǃrR(),this.ǃTz(name))}ǃTi(){return this.ǃrUm}ǃroB(e){ǃr.ǃ$(e,ǃUVJ);let r=e.ǃrKH(this.ǃNa().ǃux());return[this.ǃTi(),r,this.ǃrEX()]}ǃ$p(e){ǃr.ǃVg(e);let r=e&&e.mode||"",t={behaviorId:this.ǃNa().ǃux(),name:this.ǃTi()};return"copy"!==r&&(t.sid=this.ǃrEX()),t}static ǃSa(e,r){let t=r.behaviorId;const n=e.ǃO();if(!ǃr.ǃsk.ǃroI(t,n))throw new Error(`missing behavior id '${t}'`);let i=ǃr.ǃsk.ǃUr_(t,n),o=i.ǃrKD(e,r.name);return r.hasOwnProperty("sid")&&o.ǃrE_(r.sid),o}static ǃrKf(e,r){ǃr.ǃ$(e,ǃaN);let t=r.ǃtz("behavior").ǃkF("id");if(!ǃr.ǃsk.ǃroI(t))throw new Error(`missing behavior id '${t}'`);let n=ǃr.ǃsk.ǃUr_(t),i=r.ǃkF("name"),o=e.ǃrKY(n,i);return r.ǃUQd("sid")&&o.ǃrE_(r.ǃt$("sid")),o}},"use strict",window.ǃrKm=class extends ǃUie{constructor(e,r){ǃr.ǃ$(e,ǃaN),super(e.ǃO(),r,ǃU$G),this.ǃrNu=e,this.ǃop()&&(this.ǃrUm="")}ǃIW(){this.ǃrNu.ǃIW()}ǃrD(e){if(ǃr.ǃ$(e,ǃU$G),e.ǃrKU)throw new Error("behavior already belongs to folder");e.ǃrKU=this,super.ǃrD(e),app.ǃrKh(e,"behaviortypeadd")}ǃrEz(){this.ǃIW()}ǃrEf(){this.ǃIW()}},"use strict";{let e=!1;window.ǃrje=class r extends ǃia{constructor(e,r){ǃr.ǃ$(e,ǃU$G),ǃr.ǃ$(r,ǃ_A),super(e.ǃO()),this.ǃrKV=null,this.ǃrKa=e,this.ǃLO=r,this.ǃrKq=new Map,this.ǃrKA=new Map,this.ǃrKW=!1,this.ǃrKG()}ǃTq(){this.ǃrKV.ǃTq();for(const e of this.ǃrKA.values())e.ǃTq();this.ǃrKA.clear(),this.ǃrKq.clear(),this.ǃrKV=null,this.ǃrKa=null,this.ǃLO=null}ǃiG(){this.ǃTA()}ǃTA(){if(this.ǃrKW)throw new Error("already called OnCreate");this.ǃrKV.ǃTA(),this.ǃrKW=!0}ǃIW(){this.ǃO().ǃtb()||this.ǃLO.ǃIW()}ǃrKB(e){if(ǃr.ǃ$(e,r),this.ǃNa()!==e.ǃNa())throw new Error("instance from different behavior");for(const r of e.ǃrKq)this.ǃrKq.set(r[0],r[1])}ǃNn(){return this.ǃrKa}ǃNa(){return this.ǃrKa.ǃNa()}ǃtL(){return this.ǃrKV}ǃUhE(){return this.ǃLO}ǃrKG(){this.ǃrKq.clear();let e=this.ǃNa().ǃUFd();for(let r of e)r.ǃNQ()&&this.ǃrKq.set(r.ǃux(),r.ǃ_e())}ǃqv(e){return ǃr.ǃk(e),this.ǃrKq.has(e)}ǃsK(e){ǃr.ǃk(e);let r=this.ǃrKq.get(e);if("undefined"==typeof r)throw new Error(`invalid property id '${e}'`);return r instanceof ǃr.ǃBL?ǃr.ǃq(ǃr.ǃBL,r):r}ǃsb(e){ǃr.ǃk(e);let r=this.ǃsK(e);const t=this.ǃrKA.get(e);if(r instanceof ǃr.ǃBL){const e=ǃr.ǃq(ǃr.ǃBL,r);return"undefined"==typeof t||t.ǃrKk()&&t.ǃrKM()||e.add(t.ǃmW()),e}if("undefined"!=typeof t&&!(t.ǃrKk()&&t.ǃrKM())){const e=ǃr.ǃURh(r);if(""===e)return r+t.ǃmW();if(""===e)return t.ǃmW();if(""===e)return t.ǃmW()}return r}ǃsR(r,t){ǃr.ǃk(r);let n=ǃr.ǃURh(t),i=t instanceof ǃr.ǃBL;if(""!==n&&""!==n&&""!==n&&!i)throw new Error(`cannot store '${n}' in a property value`);let o=this.ǃrKq.get(r);if("undefined"==typeof o)throw new Error(`invalid property id '${r}'`);let d=ǃr.ǃURh(o);if(n!==d)throw new Error(`cannot change property '${r}' from '${d}' to '${n}'`);if(i){if(t.ǃav(o))return;t=ǃr.ǃq(ǃr.ǃBL,t)}else if(t===o)return;this.ǃrKq.set(r,t),e||this.ǃUf.ǃtb()||(e=!0,i?this.ǃrKV.ǃTW(r,ǃr.ǃq(ǃr.ǃBL,t)):this.ǃrKV.ǃTW(r,t),e=!1),e||this.ǃIW()}ǃrKx(){for(const e of this.ǃrKq.keys())if(this.ǃrKR(e))return!0;return!1}ǃrKR(e){ǃr.ǃk(e);const r=this.ǃrKA.get(e);return!!r&&(r.ǃrKk()&&r.ǃrKM()?!1:!0)}ǃrKg(r,t,n){ǃr.ǃk(r);const i=ǃr.ǃURh(t),o=t instanceof ǃr.ǃBL;if(""!==i&&""!==i&&""!==i&&!o)throw new Error(`cannot store '${i}' in a property value`);const d=this.ǃrKq.get(r);if("undefined"==typeof d)throw new Error(`invalid property id '${r}'`);const a=ǃr.ǃURh(d);if(i!==a)throw new Error(`cannot change property '${r}' from '${a}' to '${i}'`);if(o&&(t=ǃr.ǃq(ǃr.ǃBL,t)),this.ǃrKA.has(r)){const e=this.ǃrKA.get(r);e.ǃmm(t),e.ǃrKO(n)}else this.ǃrKA.set(r,ǃr.ǃq(ǃrKI,t,n));if(!e){e=!0;const t=this.ǃrKq.get(r);o?this.ǃrKV.ǃTW(r,ǃr.ǃq(ǃr.ǃBL,t)):this.ǃrKV.ǃTW(r,t),e=!1}}ǃrKE(e){ǃr.ǃk(e);const r=this.ǃNa().ǃUFd().filter((e)=>!!e.ǃNQ()&&"live-preview"!==e.ǃux()).map((e)=>e.ǃux()).indexOf(e);return assert(-1!==r,"missing property"),r}ǃroB(){let e=[];for(let r of this.ǃNa().ǃUFd()){if(!r.ǃNQ())continue;if("live-preview"===r.ǃux())continue;let t=r.ǃNZ(),n=this.ǃsK(r.ǃux());"combo"===t?n=r.ǃrKC(n):"color"===t&&(n=`rgb(${n.ǃUSx()})`),e.push(n)}return e}ǃ$p(){let e={};for(let[r,t]of this.ǃrKq)t instanceof ǃr.ǃBL&&(t=t.toJSON()),e[r]=t;return{properties:e}}ǃ$d(e){let r=e.properties;for(let[t,n]of Object.entries(r))Array.isArray(n)&&(n=new ǃr.ǃBL,n.ǃcI(r[t])),this.ǃsR(t,n)}ǃrjO(e){if(ǃr.ǃ$(e,ǃr.ǃti.Element),"behavior-instance"!==e.ǃUQf())throw new Error("unexpected tag name");let r=e.ǃUQF("properties");if(r)for(let e of r.children()){let r=e.ǃUQf(),t=e.ǃYK();ǃRS.ǃrjj(this,r,t)}}}}"use strict",window.ǃU$k=class extends ǃia{constructor(e,r,t){if(ǃr.ǃ$(e,ǃUrP),ǃr.ǃ$(r,ǃrbD),ǃr.ǃk(t),super(e.ǃO()),this.ǃrKy=e,this.ǃrKb=r,this.ǃrKU=null,t=ǃaN.ǃUrc(t,!0),!t)throw new Error("invalid name");if(this.ǃrKy instanceof ǃaN&&this.ǃrKy.ǃrKr(t))throw new Error("name already in object class namespace");this.ǃrUm=t,this.ǃrKF=new Map,this.ǃrKS=null,this.ǃrKy instanceof ǃaN||(this.ǃrKS=ǃr.ǃq(ǃrKo,this,null)),this.ǃrKb.ǃUrS()&&this.ǃO().ǃrSg()}ǃTq(){this.ǃrKF.clear(),this.ǃrKS=null,this.ǃrKU=null,this.ǃrKb=null,this.ǃrKy=null}ǃlk(){return"effect-type"}ǃU_W(){if(!this.ǃrKU)throw new Error("effect type not yet added to folder");return this.ǃrKU}ǃrER(e){ǃr.ǃ$(e,ǃrKj),this.ǃrKU=e}ǃUFG(){return this.ǃrKy}ǃUry(){return this.ǃrKb}ǃyY(){super.ǃyY(),this.ǃO().ǃyO()}ǃyq(){super.ǃyq(),this.ǃO().ǃyO()}ǃrEl(){for(let e of this.ǃrKF.values())e.ǃrEl();this.ǃrKS&&this.ǃrKS.ǃrEl(),super.ǃrEl()}ǃrEt(){super.ǃrEt(),this.ǃrKS&&this.ǃrKS.ǃrEt();for(let e of this.ǃrKF.values())e.ǃrEt()}ǃrEz(){this.ǃrKy.ǃrKe(),app.ǃrKN(this,"effecttypeadd"),this.ǃO().ǃrym(),app.ǃsd().ǃsB()}ǃrEf(){this.ǃO().ǃrym(),this.ǃrKy.ǃrKe(),app.ǃrKN(this,"effecttyperemove"),app.ǃsd().ǃsB()}ǃrKK(e,r){if(ǃr.ǃ$(e,ǃYR),ǃr.ǃVm(e,ǃYR),!(this.ǃrKy instanceof ǃaN))throw new Error("effect type not for an ObjectClass");let t=this.ǃrKF.get(e);if(t)return t;r&&(t=this.ǃrKF.get(r));const n=ǃr.ǃq(ǃrKo,this,e);return t&&n.ǃrKB(t),this.ǃrKF.set(e,n),n}ǃUFM(e){if(ǃr.ǃ$(e,ǃYR),!(this.ǃrKy instanceof ǃaN))throw new Error("effect type not for an ObjectClass");const r=this.ǃrKF.get(e);if(!r)throw new Error("object instance does not have associated effect instance");return r}ǃrKP(e){if(ǃr.ǃ$(e,ǃYR),!(this.ǃrKy instanceof ǃaN))throw new Error("effect type not for an ObjectClass");return this.ǃrKF.has(e)}ǃrKw(){return this.ǃrKS||ǃr.ǃV(this.ǃrKF.values())}ǃrKQ(){return!!this.ǃrKS}ǃUz_(){if(this.ǃrKy instanceof ǃaN)throw new Error("effect type not for a Layout or Layer");return this.ǃrKS}ǃUTh(e){ǃr.ǃVm(e,ǃYR);let r=this.ǃrKS||this.ǃrKF.get(e);return r.ǃUTh()}ǃTz(e){if(ǃr.ǃk(e),e=ǃaN.ǃUrc(e,!0),!e||ǃr.ǃUyh(e))throw new Error("invalid name");if(this.ǃrUm!==e){if(!ǃr.ǃNu(this.ǃrUm,e))if(this.ǃrKy instanceof ǃaN&&this.ǃrKy.ǃrKr(e))throw new Error("name already in object class namespace");else if(!(this.ǃrKy instanceof ǃaN)&&this.ǃrKy.ǃrKZ(e))throw new Error("name already used");this.ǃrUm=e,this.ǃO().ǃrym(),app.ǃrE$(this,"projectobjectnamechange")}}ǃU_g(e,r){if(ǃr.ǃk(e),ǃr.ǃIO(r),name=ǃaN.ǃUrc(e,!0),ǃr.ǃJ.ǃrx("model.object-class.effect-types.errors"),!name||ǃr.ǃUyh(name))return ǃr.ǃo.ǃsZ.ǃyy.ǃrp(r,"warning",lang(".name-invalid.title"),lang(".name-invalid.message"),{align:"bottom"}),void ǃr.ǃJ.ǃrR();if(!ǃr.ǃNu(name,this.ǃTi()))if(this.ǃrKy instanceof ǃaN){if(this.ǃrKy.ǃrKr(name))return ǃr.ǃo.ǃsZ.ǃyy.ǃrp(r,"warning",lang(".name-used.title"),ǃMp(".name-used.message",name),{align:"bottom"}),void ǃr.ǃJ.ǃrR();}else if(this.ǃrKy.ǃrKZ(name))return ǃr.ǃo.ǃsZ.ǃyy.ǃrp(r,"warning",lang(".name-used.title"),ǃMp(".name-used.message",name),{align:"bottom"}),void ǃr.ǃJ.ǃrR();ǃr.ǃNu(name,e)||ǃr.ǃo.ǃsZ.ǃyy.ǃrp(r,"warning",lang(".name-changed.title"),lang(".name-changed.message"),{align:"bottom"}),ǃr.ǃJ.ǃrR(),this.ǃTz(name)}ǃTi(){return this.ǃrUm}ǃroB(e=!1){let r=[this.ǃUry().ǃux(),this.ǃTi()];return e&&r.push(this.ǃUz_().ǃroB()),r}ǃ$p(){let e={effectId:this.ǃUry().ǃux(),name:this.ǃTi()};return this.ǃrKQ()&&(e.instance=this.ǃUz_().ǃ$p()),e}static ǃSa(e,r){let t=r.effectId;const n=e.ǃO();if(!ǃr.ǃrjJ.ǃroI(t,n))throw new Error(`missing effect id '${t}'`);let i=ǃr.ǃrjJ.ǃUr_(t,n),o=i.ǃrKu(e,r.name);return o.ǃrKQ()&&o.ǃUz_().ǃ$d(r.instance),e.ǃrKe(),o}static ǃrKf(e,r){ǃr.ǃ$(e,ǃUrP);let t=r.ǃtz("effect").ǃkF("id");if(!ǃr.ǃrjJ.ǃroI(t))throw new Error(`missing effect id '${t}'`);let n=ǃr.ǃrjJ.ǃUr_(t),i=r.ǃkF("name"),o=e.ǃur(n,i);return o}},"use strict",window.ǃrKj=class extends ǃUie{constructor(e,r){ǃr.ǃ$(e,ǃUrP),super(e.ǃO(),r,ǃU$k),this.ǃrKy=e,this.ǃop()&&(this.ǃrUm="")}ǃIW(){this.ǃrKy.ǃIW()}ǃrD(e){if(ǃr.ǃ$(e,ǃU$k),e.ǃrKU)throw new Error("effect already belongs to folder");e.ǃrKU=this,super.ǃrD(e),app.ǃrKN(e,"effecttypeadd")}ǃUl$(e,r,t,n){super.ǃUl$(e,r,t,n),this.ǃrKy.ǃrKe(),app.ǃsd().ǃsB()}ǃrEz(){this.ǃIW()}ǃrEf(){this.ǃIW()}},"use strict",window.ǃrKo=class e extends ǃia{constructor(e,r){ǃr.ǃ$(e,ǃU$k),ǃr.ǃVm(r,ǃYR),super(e.ǃO()),this.ǃrPU=e,this.ǃLO=r,this.ǃrPr=new Map,this.ǃrPT=new Map,this.ǃrPv=[],this.ǃrPJ=!0,this.ǃrPL=[],this.ǃrPs=!0,this.ǃrPX()}ǃTq(){for(const e of this.ǃrPT.values())e.ǃTq();this.ǃrPT.clear(),this.ǃrPr.clear(),this.ǃrPU=null,this.ǃLO=null}ǃrKB(r){if(ǃr.ǃ$(r,e),this.ǃUry()!==r.ǃUry())throw new Error("instance from different effect");for(let e of r.ǃrPr)this.ǃrPr.set(e[0],e[1])}ǃrPi(){return this.ǃrPU}ǃUry(){return this.ǃrPU.ǃUry()}ǃrP_(){return this.ǃLO}ǃIW(){this.ǃO().ǃtb()||(this.ǃLO?this.ǃLO.ǃIW():this.ǃrPU.ǃUFG().ǃIW())}ǃrPX(){this.ǃrPr.clear();let e=this.ǃUry().ǃUzL();for(let r of e)this.ǃrPr.set(r.ǃux(),r.ǃ_e())}ǃrPl(e){return ǃr.ǃk(e),this.ǃrPr.has(e)}ǃUzi(e){ǃr.ǃk(e);let r=this.ǃrPr.get(e);if("undefined"==typeof r)throw new Error(`invalid parameter id '${e}'`);return r instanceof ǃr.ǃBL?ǃr.ǃq(ǃr.ǃBL,r):r}ǃrPt(e){ǃr.ǃk(e);let r=this.ǃUzi(e);const t=this.ǃrPT.get(e);if(r instanceof ǃr.ǃBL){const e=ǃr.ǃq(ǃr.ǃBL,r);return"undefined"==typeof t||t.ǃrKk()&&t.ǃrKM()||e.add(t.ǃmW()),e}if("undefined"!=typeof t&&!(t.ǃrKk()&&t.ǃrKM())){const e=ǃr.ǃURh(r);if(""===e)return r+t.ǃmW();if(""===e)return t.ǃmW();if(""===e)return t.ǃmW()}return r}ǃUzl(e,r){ǃr.ǃk(e);let t=ǃr.ǃURh(r),n=r instanceof ǃr.ǃBL;if(""!==t&&""!==t&&""!==t&&!n)throw new Error(`cannot store '${t}' in a parameter value`);let i=this.ǃrPr.get(e);if("undefined"==typeof i)throw new Error(`invalid parameter id '${e}'`);let o=ǃr.ǃURh(i);if(t!==o)throw new Error(`cannot change parameter '${e}' from '${o}' to '${t}'`);if(n){if(r.ǃav(i))return;r=ǃr.ǃq(ǃr.ǃBL,r)}else if(r===i)return;this.ǃrPr.set(e,r),this.ǃrPJ=!0,this.ǃIW()}ǃrKx(){for(const e of this.ǃrPr.keys())if(this.ǃrKR(e))return!0;return!1}ǃrKR(e){ǃr.ǃk(e);const r=this.ǃrPT.get(e);return!!r&&(r.ǃrKk()&&r.ǃrKM()?!1:!0)}ǃrP$(e,r,t){ǃr.ǃk(e);const n=ǃr.ǃURh(r),i=r instanceof ǃr.ǃBL;if(""!==n&&""!==n&&""!==n&&!i)throw new Error(`cannot store '${n}' in a parameter value`);const o=this.ǃrPr.get(e);if("undefined"==typeof o)throw new Error(`invalid parameter id '${e}'`);const d=ǃr.ǃURh(o);if(n!==d)throw new Error(`cannot change parameter '${e}' from '${d}' to '${n}'`);if(i&&(r=ǃr.ǃq(ǃr.ǃBL,r)),this.ǃrPT.has(e)){const n=this.ǃrPT.get(e);n.ǃmm(r),n.ǃrKO(t)}else this.ǃrPT.set(e,ǃr.ǃq(ǃrKI,r,t));this.ǃrPs=!0}ǃrPf(){if(!this.ǃrPJ)return this.ǃrPv;ǃr.ǃXk(this.ǃrPv);for(const e of this.ǃUry().ǃUzL()){const r=e.ǃux(),t=this.ǃUzi(r);this.ǃrPv.push(t)}return this.ǃrPJ=!1,this.ǃrPv}ǃrPz(){if(!this.ǃrPs)return this.ǃrPL;ǃr.ǃXk(this.ǃrPL);for(const e of this.ǃUry().ǃUzL()){const r=e.ǃux(),t=this.ǃrPt(r);this.ǃrPL.push(t)}return this.ǃrPs=!1,this.ǃrPL}ǃUTh(){return this.ǃrKx()?this.ǃrPz():this.ǃrPf()}ǃrPF(e){ǃr.ǃk(e);const r=this.ǃUry().ǃUzL().filter((e)=>!!e.ǃNQ()).map((e)=>e.ǃux()).indexOf(e);return assert(-1!==r,"missing property"),r}ǃroB(){let e=[];for(let r of this.ǃUry().ǃUzL()){if(!r.ǃNQ())continue;let t=r.ǃNZ(),n=this.ǃUzi(r.ǃux());"color"===t&&(n=[n.r,n.ǃUSS,n.b]),e.push(n)}return e}ǃ$p(){let e={};for(let[r,t]of this.ǃrPr)t instanceof ǃr.ǃBL&&(t=t.toJSON()),e[r]=t;return{parameters:e}}ǃ$d(e){let r=e.parameters;for(let[t,n]of Object.entries(r))Array.isArray(n)&&(n=new ǃr.ǃBL,n.ǃcI(r[t])),this.ǃUzl(t,n)}ǃrjO(e){if(ǃr.ǃ$(e,ǃr.ǃti.Element),"effect-instance"!==e.ǃUQf())throw new Error("unexpected tag name");let r=e.ǃUQF("parameters");if(r){let e=this.ǃUry();for(let t of r.children()){let r=t.ǃUQf(),n=t.ǃYK();ǃRS.ǃrjK(this,e,r.toLowerCase(),n)}}}},"use strict";{const e=new Set(["normal","all","wrap"]);let r=new Set;window.ǃroq=class extends ǃr.ǃT_{constructor(e){if(ǃr.ǃXR(e,ǃuF),super(),2>e.length)throw new Error("need at least 2 objects to create a container");this.ǃrPm=[],this.ǃrPh="normal",this.ǃUf=null,ǃr.ǃUnO(this.ǃrPm,e),this.ǃrPm.sort(ǃaN.ǃrPn),this.ǃUf=this.ǃrPm[0].ǃO(),r.add(this)}ǃMI(){for(let e of this.ǃrPm)e.ǃrPV(null);ǃr.ǃXk(this.ǃrPm),r.delete(this),ǃr.ǃTq(this)}ǃO(){return this.ǃUf}ǃXI(e){let r=0;for(let t of this.ǃrPm)if(t.ǃXI()&&(e||t.ǃrPp()===this)&&(++r,2<=r))return!0;return!1}ǃrPB(){if(ǃr.ǃvE)for(let e of this.ǃrPm)e.ǃXI()&&assert(e.ǃrPp()===this,"wrong container linkage")}ǃUFR(r){if(ǃr.ǃk(r),!e.has(r))throw new Error("invalid select mode");this.ǃrPh===r||(this.ǃrPh=r,this.ǃO().ǃIW())}ǃUJc(){return this.ǃrPh}*ǃUJh(){for(let e of this.ǃrPm)e.ǃXI()&&(yield e)}ǃU_Z(e){if(ǃr.ǃ$(e,ǃuF),!e.ǃXI())throw new Error("object type is deleted");return this.ǃrPm.includes(e)}ǃUrf(e){this.ǃrPd(e),this.ǃrPm.sort(ǃaN.ǃrPn),app.ǃrPc(this,e,"containerchange"),this.ǃO().ǃIW()}ǃUFE(e){for(let r of e)this.ǃrPd(r);this.ǃrPm.sort(ǃaN.ǃrPn),app.ǃrPc(this,ǃr.ǃV(this.ǃUJh()),"containerchange"),this.ǃO().ǃIW()}ǃrPd(e){if(ǃr.ǃ$(e,ǃuF),!e.ǃXI())throw new Error("object type is deleted");if(e.ǃUJi()||this.ǃrPm.includes(e))throw new Error("object type already in a container");this.ǃrPm.push(e),e.ǃrPV(this)}ǃUlR(e){if(ǃr.ǃ$(e,ǃuF),!e.ǃXI())throw new Error("object type is deleted");let r=this.ǃrPm.indexOf(e);if(e.ǃUJF()!==this||0>r)throw new Error("object type not in this container");this.ǃrPm.splice(r,1),e.ǃrPV(null),app.ǃrPc(this,e,"containerchange"),this.ǃO().ǃIW()}ǃrPH(e){ǃr.ǃXR(e,ǃuF);let r=this.ǃXI(),t=ǃr.ǃV(this.ǃUJh());for(let r of this.ǃrPm)-1===e.indexOf(r)&&r.ǃrPV(null);ǃr.ǃUnO(this.ǃrPm,e),!r&&this.ǃXI(!0)?this.ǃrEz():r&&!this.ǃXI()&&this.ǃrEf(),this.ǃrPB()}ǃrPD(){return this.ǃrPm.slice(0)}ǃrPY(){for(let e of this.ǃrPm)e.ǃrPV(this)}ǃrEz(){this.ǃrPY(),app.ǃrPc(this,ǃr.ǃV(this.ǃUJh()),"containerchange"),this.ǃO().ǃIW()}ǃrEf(){this.ǃO().ǃIW(),app.ǃrPc(this,null,"containerchange")}ǃ$p(){return{members:[...this.ǃUJh()].map((e)=>e.ǃTi()),selectMode:this.ǃUJc()}}static ǃrjm(e,r){let t=[];for(let n of r.members){let r=e.ǃUri(n);if(!r)throw new Error(`cannot find object type name '${n}'`);t.push(r)}if(2>t.length)throw new Error("need at least 2 types in container");let n=t[0].ǃUFC(t);r.hasOwnProperty("selectMode")&&n.ǃUFR(r.selectMode)}static*ǃroa(e){ǃr.ǃ$(e,ǃg);for(let t of r)t.ǃXI()&&t.ǃO()===e&&(yield t)}ǃroB(e){return ǃr.ǃ$(e,ǃUVJ),[...this.ǃUJh()].map((r)=>e.ǃroc(r))}}}"use strict",window.ǃUrP=class extends ǃia{constructor(e){super(e),this.ǃrPa=ǃr.ǃq(ǃrKj,this,null)}ǃrEl(){this.ǃrPa.ǃrEl(),super.ǃrEl()}ǃrEt(){super.ǃrEt(),this.ǃrPa.ǃrEt()}ǃur(e,r){ǃr.ǃ$(e,ǃrbD),ǃr.ǃk(r);let t=this instanceof ǃaN?this:null;if(t&&!t.ǃ_K().ǃZD())throw new Error("effects not supported");if(r=ǃaN.ǃUrc(r,!0),!r)throw new Error("invalid name");if(t&&t.ǃrKr(r))throw new Error("name already in object class namespace");let n=e.ǃrKu(this,r);if(this.ǃrPa.ǃrD(n),this.ǃrKe(),t){for(let e of t.ǃrPq())n.ǃrKK(e);t.ǃrKs()}return this.ǃIW(),n}ǃrSA(){return this.ǃrPa.ǃU_C()}ǃrPA(){return this.ǃrPa.ǃrEY()}*ǃUzJ(){yield*this.ǃrSA()}ǃros(){let e=0;for(const r of this.ǃrSA())++e;return e}ǃrKe(){}ǃrPW(){return!!ǃr.ǃV(this.ǃUzJ())}ǃrPG(){return this.ǃrPa}ǃrPk(e){ǃr.ǃk(e);for(let r of this.ǃUzJ())if(ǃr.ǃNu(e,r.ǃTi()))return r;return null}ǃrKZ(e){return ǃr.ǃk(e),!!this.ǃrPk(e)}ǃuU(e){ǃr.ǃk(e),e=ǃaN.ǃUrc(e,!0);let r=this instanceof ǃaN?this:null;if(r?!r.ǃrKr(e):!this.ǃrKZ(e))return e;let t=2,n="";do n=e+t,++t;while(r?r.ǃrKr(n):this.ǃrKZ(n));return n}ǃrPM(){let e=new Set;for(let r of this.ǃUzJ())e.add(r.ǃUry());return e}ǃrPx(e){let r=[];for(let t of this.ǃrSA())r.push(t.ǃ$p());e.effectTypes=r}ǃrPR(e){if(e.effectTypes){let r=e.effectTypes;for(let e of r)this.ǃrPa.ǃrD(ǃU$k.ǃSa(this,e))}}ǃrPg(e,r=!1){let t=e.ǃtz("effects");for(let n of t.children("effect-type")){let e=ǃU$k.ǃrKf(this,n);if(r){let r=n.ǃUQF("effect-instance");r&&e.ǃUz_().ǃrjO(r)}}}},"use strict";{const e=new Set([..."\\/:;*?\"|.,'-`!\xAC\xA3$%^&+=<>{}()[]@#~\xAD"]),r=new Set(["self","true","false","system"]);window.ǃaN=class t extends ǃUrP{constructor(e,r,n){if(super(e),ǃr.ǃk(n),n=t.ǃUrc(n,!0),!n)throw new Error("invalid name");if("System"!==n&&!e.ǃtb()&&t.ǃUrH(n,e))throw new Error("name is reserved");if(this.ǃO().ǃrSX(n))throw new Error(`object class name '${n}' already used`);ǃr.ǃ$(r,Plugin),this.ǃiP=r,this.ǃrUm=n,this.ǃrPO=n,this.ǃrPI=ǃr.ǃq(ǃrKv,this,null),this.ǃrPE=ǃr.ǃq(ǃrKm,this,null),this.ǃr$L=!1,this.ǃO().ǃUiL(this)}ǃTq(){}ǃUlA(){return this.ǃr$L}ǃIW(){this.ǃO().ǃtb()||this.ǃr$L||(this.ǃr$L=!0,this.ǃO().ǃxl(!0),app.ǃrPC(this,"objectclassmarkchanged"))}ǃryF(){this.ǃr$L&&(this.ǃr$L=!1,app.ǃrPC(this,"objectclassunmarkchanged"))}ǃyY(){super.ǃyY(),this.ǃXI()||app.ǃrPC(this,"objectclassremove"),this.ǃO().ǃyO()}ǃyq(){super.ǃyq(),this.ǃXI()&&app.ǃrPC(this,"objectclassadd"),this.ǃO().ǃyO()}ǃrEl(){this.ǃrPI.ǃrEl(),this.ǃrPE.ǃrEl(),super.ǃrEl()}ǃrEt(){super.ǃrEt(),this.ǃrPE.ǃrEt(),this.ǃrPI.ǃrEt()}ǃrEz(){this.ǃO().ǃUiL(this),this.ǃO().ǃryk(),this.ǃO().ǃrym(),app.ǃsB()}ǃrEf(){app.ǃZo(),this.ǃO().ǃrym(),this.ǃO().ǃryk(),this.ǃO().ǃUis(this),app.ǃsB()}ǃrKs(){throw new Error("should be overridden")}*ǃ_Q(){throw new Error("should be overridden")}*ǃrPq(){throw new Error("should be overridden")}ǃrPy(e){ǃr.ǃk(e);const r=this.ǃ_K();return r.ǃZc()&&this.ǃrPb(e)||r.ǃZH()&&this.ǃrPS(e)||this.ǃ_K().ǃrPo(e)||this.ǃiP.ǃZD()&&this.ǃrKZ(e)}ǃrKr(e){throw ǃr.ǃk(e),new Error("should be overridden")}ǃrPj(){return!1}static ǃUrc(e,r){ǃr.ǃk(e),r=!!r;let n=[...e];for(let t=0,i=n.length;t!t.ǃrPe(e)),r){for(;n.length&&"_"===n[0];)n.shift();let e=!0;for(let r of n)if(!ǃr.ǃUjk(r)){e=!1;break}e&&ǃr.ǃXk(n)}else for(;n.length&&(ǃr.ǃUjk(n[0])||"_"===n[0]);)n.shift();return n.join("")}static ǃrPe(r){return ǃr.ǃk(r),!e.has(r)&&!ǃr.ǃUjM(r)}static ǃUrH(e,t){return ǃr.ǃk(e),ǃr.ǃ$(t,ǃg),!!ǃr.ǃUyh(e)||!!r.has(e.toLowerCase())||!!t.ǃNT().ǃ_K().ǃrPo(e)}ǃTi(){return this.ǃrUm}ǃir(){return"system"===this.ǃiP.ǃux()?this.ǃiP.ǃTi():this.ǃTi()}ǃTz(e){if(ǃr.ǃk(e),e=t.ǃUrc(e,!0),this.ǃrUm!==e){if(!e)throw new Error("invalid name");if(!ǃr.ǃNu(this.ǃrUm,e)&&this.ǃO().ǃrSX(e))throw new Error(`object class name '${e}' already used`);if(t.ǃUrH(e,this.ǃO()))throw new Error("name is reserved");let r=this.ǃrUm;this.ǃrUm=e,this.ǃO().ǃtb()&&(this.ǃrPO=e),this.ǃO().ǃSi(),this.ǃO().ǃrym(),this.ǃO().ǃDA(this,r),app.ǃrPC(this,"objectclassnamechange"),app.ǃrE$(this,"projectobjectnamechange")}}ǃU_g(e,r){return ǃr.ǃk(e),ǃr.ǃIO(r),name=t.ǃUrc(e,!0),ǃr.ǃJ.ǃrx("model.object-class.errors"),name?t.ǃUrH(name,this.ǃO())?(ǃr.ǃo.ǃsZ.ǃyy.ǃrp(r,"warning",lang(".name-reserved.title"),ǃMp(".name-reserved.message",name),{align:"bottom"}),void ǃr.ǃJ.ǃrR()):!ǃr.ǃNu(name,this.ǃTi())&&this.ǃO().ǃrSX(name)?(ǃr.ǃo.ǃsZ.ǃyy.ǃrp(r,"warning",lang(".name-used.title"),ǃMp(".name-used.message",name),{align:"bottom"}),void ǃr.ǃJ.ǃrR()):void(this.ǃTz(name),!ǃr.ǃNu(name,e)&&ǃr.ǃo.ǃsZ.ǃyy.ǃrp(r,"warning",lang(".name-changed.title"),lang(".name-changed.message"),{align:"bottom"}),ǃr.ǃJ.ǃrR()):(ǃr.ǃo.ǃsZ.ǃyy.ǃrp(r,"warning",lang(".name-invalid.title"),lang(".name-invalid.message"),{align:"bottom"}),void ǃr.ǃJ.ǃrR())}ǃroK(){ǃr.ǃo_()}ǃroN(e){this.ǃrPO===this.ǃTi()||(this.ǃrPO&&e.add(this.ǃroK(this.ǃrPO)),this.ǃrPO=this.ǃTi())}ǃrow(e){!this.ǃXI()&&this.ǃrPO&&(e.add(this.ǃroK(this.ǃrPO)),this.ǃrPO="")}ǃ_K(){return this.ǃiP}ǃLl(){return this.ǃiP.ǃLl()}ǃrff(){return this.ǃiP.ǃrff()}ǃrfz(){return this.ǃiP.ǃrfz()}ǃaz(){return!1}ǃSs(e){if(ǃr.ǃyd(e),ǃr.ǃ$(e.ǃDW,t),ǃr.ǃXR(e.ǃbu,ǃrPN),ǃr.ǃXR(e.ǃSr,ǃrPK),ǃr.ǃXR(e.ǃSv,ǃrPP),e.ǃDW===this)return!1;if(e.ǃDW.ǃ_K()!==this.ǃ_K())return!1;for(let r of e.ǃbu){let e=this.ǃrPw(r.ǃTi());if(!e||e.ǃNZ()!==r.ǃNZ())return!1}for(let r of e.ǃSr){let e=this.ǃrPQ(r.ǃTi());if(!e||e.ǃNa()!==r.ǃNa())return!1}for(let r of e.ǃSv){let e=this.ǃrPk(r.ǃTi());if(!e||e.ǃUry()!==r.ǃUry())return!1}return!0}ǃZZ(e,r,n){if(!this.ǃiP.ǃZc())throw new Error("instance variables not supported");if(ǃr.ǃk(e),ǃr.ǃk(r),e=t.ǃUrc(e,!1),!e)throw new Error("invalid name");if(this.ǃrKr(e))throw new Error("name already in object class namespace");if("undefined"==typeof n)switch(r){case"boolean":n=!1;break;case"number":n=0;break;case"string":n="";break;default:throw new TypeError("invalid initial value");}let i=ǃr.ǃq(ǃU$W,this,e,r);for(let t of this.ǃrPq())i.ǃUFV(t,n);return this.ǃrPI.ǃrD(i),this.ǃIW(),this.ǃrKs(),i}ǃrPZ(){if(!this.ǃiP.ǃZc())throw new Error("instance variables not supported");return this.ǃrPI.ǃU_C()}ǃrPu(){if(!this.ǃiP.ǃZc())throw new Error("instance variables not supported");return this.ǃrPI.ǃrEY()}*ǃUFm(){if(!this.ǃiP.ǃZc())throw new Error("instance variables not supported");yield*this.ǃrPZ()}*ǃrwU(e){if(!this.ǃiP.ǃZc())throw new Error("instance variables not supported");for(let r of this.ǃUFm())"boolean"===r.ǃNZ()?e&&(yield r):e||(yield r)}ǃrwr(){if(!this.ǃiP.ǃZc())throw new Error("instance variables not supported");return this.ǃrPI}ǃrPw(e){if(!this.ǃiP.ǃZc())throw new Error("instance variables not supported");ǃr.ǃk(e);for(let r of this.ǃUFm())if(ǃr.ǃNu(e,r.ǃTi()))return r;return null}ǃrPb(e){if(!this.ǃiP.ǃZc())throw new Error("instance variables not supported");return ǃr.ǃk(e),!!this.ǃrPw(e)}ǃrwT(){if(!this.ǃiP.ǃZc())throw new Error("instance variables not supported");let e=1,r;do r=ǃj("model.object-class.instance-variables.new-variable-name",e++);while(this.ǃrKr(r));return r}ǃrKY(e,r){if(!this.ǃiP.ǃZH())throw new Error("behaviors not supported");if(ǃr.ǃ$(e,ǃrbc),ǃr.ǃk(r),r=t.ǃUrc(r,!0),!r)throw new Error("invalid name");if(this.ǃrKr(r))throw new Error("name already in object class namespace");let n=e.ǃrKD(this,r);this.ǃrPE.ǃrD(n);for(let t of this.ǃrPq())n.ǃrKp(t);return this.ǃIW(),this.ǃrKs(),n}ǃrSq(){if(!this.ǃiP.ǃZH())throw new Error("behaviors not supported");return this.ǃrPE.ǃU_C()}ǃrwv(){if(!this.ǃiP.ǃZH())throw new Error("behaviors not supported");return this.ǃrPE.ǃrEY()}*ǃUFB(){if(!this.ǃiP.ǃZH())throw new Error("behaviors not supported");yield*this.ǃrSq()}ǃrwJ(){if(!this.ǃiP.ǃZH())throw new Error("behaviors not supported");return this.ǃrPE}ǃrPQ(e){if(!this.ǃiP.ǃZH())throw new Error("behaviors not supported");ǃr.ǃk(e);for(let r of this.ǃUFB())if(ǃr.ǃNu(e,r.ǃTi()))return r;return null}ǃrPS(e){if(!this.ǃiP.ǃZH())throw new Error("behaviors not supported");return ǃr.ǃk(e),!!this.ǃrPQ(e)}ǃrwL(e){if(ǃr.ǃk(e),e=t.ǃUrc(e,!0),!this.ǃrKr(e))return e;let r=2,n="";do n=e+r,++r;while(this.ǃrKr(n));return n}ǃrws(){if(!this.ǃiP.ǃZH())throw new Error("behaviors not supported");let e=new Set;for(let r of this.ǃUFB())e.add(r.ǃNa());return e}ǃroB(e){ǃr.ǃ$(e,ǃUVJ),e.ǃrwX(this);let r=e.ǃrof(this.ǃ_K().ǃux()),t=this instanceof ǃUUH,n=null,i=null;t||(this.ǃ_K().ǃqL()?n=this.ǃrwi(e):this.ǃ_K().ǃqT()&&(i=this.ǃrw_(e)));let o=[],d=[],a=0,s=[],T=0,l=null;this.ǃ_K().ǃZc()&&(o=[...this.ǃUFm()].map((e)=>e.ǃrEX())),this.ǃ_K().ǃZH()&&(d=[...this.ǃrSq()].map((r)=>r.ǃroB(e)),a=d.length),this.ǃ_K().ǃZD()&&(s=[...this.ǃrSA()].map((r)=>r.ǃroB()),T=s.length),!t&&this.ǃ_K().ǃrwl()&&(l=this.ǃrwt());let u=[this.ǃTi(),r,t,o,a,T,n,i,d,this.ǃaz(),this.ǃrPj(),this.ǃrEX(),s,l];return!t&&this.ǃ_K().ǃbK()&&u.push(this.ǃUiZ().ǃrw$()),u}ǃrok(){return{}}ǃroy(){}ǃ$p(e){ǃr.ǃVg(e);let r=e&&e.mode||"",t=this.ǃrUm;e&&e.ǃUrr&&(t=e.ǃUrr);let n={name:t,"plugin-id":this.ǃ_K().ǃux()};if("copy"!==r&&(n.sid=this.ǃrEX()),Object.assign(n,this.ǃrok()),this.ǃ_K().ǃZc()){let r=[];for(let t of this.ǃrPZ())r.push(t.ǃ$p(e));n.instanceVariables=r}if(this.ǃ_K().ǃZH()){let r=[];for(let t of this.ǃrSq())r.push(t.ǃ$p(e));n.behaviorTypes=r}return this.ǃ_K().ǃZD()&&this.ǃrPx(n),n}ǃ$d(e){e.hasOwnProperty("sid")&&this.ǃrE_(e.sid),this.ǃroy(e)}ǃUrt(e){if(this.ǃ_K().ǃZc()&&e.instanceVariables){let r=e.instanceVariables;for(let e of r)this.ǃrPI.ǃrD(ǃU$W.ǃSa(this,e))}if(this.ǃ_K().ǃZH()&&e.behaviorTypes){let r=e.behaviorTypes;for(let e of r)this.ǃrPE.ǃrD(ǃU$G.ǃSa(this,e))}this.ǃ_K().ǃZD()&&e.effectTypes&&this.ǃrPR(e)}static ǃrPn(e,r){let t=e.ǃTi().toLowerCase(),n=r.ǃTi().toLowerCase();return t>n?1:t