UNPKG

phaser3-rex-plugins

Version:
1 lines 160 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).rexlive2dplugin=e();}(undefined,(function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r);}}function r(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e);}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return !1}}();return function(){var i,r=a(t);if(e){var n=a(this).constructor;i=Reflect.construct(r,arguments,n);}else i=r.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return s(t)}(this,i)}}function l(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var r=l(t,e);if(r){var n=Object.getOwnPropertyDescriptor(r,e);return n.get?n.get.call(arguments.length<3?t:i):n.value}},h.apply(this,arguments)}function p(t,e,i,r){return p="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,i,r){var n,a=l(t,e);if(a){if((n=Object.getOwnPropertyDescriptor(a,e)).set)return n.set.call(r,i),!0;if(!n.writable)return !1}if(n=Object.getOwnPropertyDescriptor(r,e)){if(!n.writable)return !1;n.value=i,Object.defineProperty(r,e,n);}else !function(t,e,i){(e=c(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;}(r,e,i);return !0},p(t,e,i,r)}function g(t,e,i,r,n){if(!p(t,e,i,r||t)&&n)throw new TypeError("failed to set property");return i}function c(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===e?String:Number)(t)}(t,"string");return "symbol"==typeof e?e:String(e)}var d,_=!1;_||(void 0===d&&(d=60),parseInt(Phaser.VERSION.match(/\.(\d+)\./)[1])<d&&console.error("Minimum supported version : 3.".concat(d)),_=!0);var m=function(t){n(a,Phaser.GameObjects.GameObject);var i=u(a);function a(){return e(this,a),i.apply(this,arguments)}return r(a)}(),f=Phaser.GameObjects.Components;Phaser.Class.mixin(m,[f.AlphaSingle,f.BlendMode,f.ComputedSize,f.Depth,f.GetBounds,f.Origin,f.ScrollFactor,f.Transform,f.Visible]);var y,v=Phaser.GameObjects.GetCalcMatrix,S={renderWebGL:function(t,e,i,r){t.newType&&t.pipelines.clear(),i.addToRenderList(e);var n=v(e,i,r).calc;e.model.draw(n),t.nextTypeMatch||t.pipelines.rebind();},renderCanvas:function(t,e,i,r){}},x=function(){function t(t){void 0===t&&(t=0),t<1?(this._ptr=[],this._capacity=0,this._size=0):(this._ptr=new Array(t),this._capacity=t,this._size=0);}return t.prototype.at=function(t){return this._ptr[t]},t.prototype.set=function(t,e){this._ptr[t]=e;},t.prototype.get=function(t){void 0===t&&(t=0);for(var e=new Array,i=t;i<this._size;i++)e.push(this._ptr[i]);return e},t.prototype.pushBack=function(e){this._size>=this._capacity&&this.prepareCapacity(0==this._capacity?t.s_defaultSize:2*this._capacity),this._ptr[this._size++]=e;},t.prototype.clear=function(){this._ptr.length=0,this._size=0;},t.prototype.getSize=function(){return this._size},t.prototype.assign=function(t,e){this._size<t&&this.prepareCapacity(t);for(var i=0;i<t;i++)this._ptr[i]=e;this._size=t;},t.prototype.resize=function(t,e){void 0===e&&(e=null),this.updateSize(t,e,!0);},t.prototype.updateSize=function(t,e,i){if(void 0===e&&(e=null),void 0===i&&(i=!0),this._size<t)if(this.prepareCapacity(t),i)for(var r=this._size;r<t;r++)this._ptr[r]="function"==typeof e?JSON.parse(JSON.stringify(new e)):e;else for(r=this._size;r<t;r++)this._ptr[r]=e;else {var n=this._size-t;this._ptr.splice(this._size-n,n);}this._size=t;},t.prototype.insert=function(t,e,i){var r=t._index,n=e._index,a=i._index,o=a-n;this.prepareCapacity(this._size+o);var s=this._size-r;if(s>0)for(var u=0;u<s;u++)this._ptr.splice(r+u,0,null);for(u=n;u<a;u++,r++)this._ptr[r]=e._vector._ptr[u];this._size=this._size+o;},t.prototype.remove=function(t){return !(t<0||this._size<=t)&&(this._ptr.splice(t,1),--this._size,!0)},t.prototype.erase=function(t){var e=t._index;return e<0||this._size<=e?t:(this._ptr.splice(e,1),--this._size,new P(this,e))},t.prototype.prepareCapacity=function(t){t>this._capacity&&(0==this._capacity?(this._ptr=new Array(t),this._capacity=t):(this._ptr.length=t,this._capacity=t));},t.prototype.begin=function(){return 0==this._size?this.end():new P(this,0)},t.prototype.end=function(){return new P(this,this._size)},t.prototype.getOffset=function(e){var i=new t;return i._ptr=this.get(e),i._size=this.get(e).length,i._capacity=this.get(e).length,i},t.s_defaultSize=10,t}(),P=function(){function t(t,e){this._vector=null!=t?t:null,this._index=null!=e?e:0;}return t.prototype.set=function(t){return this._index=t._index,this._vector=t._vector,this},t.prototype.preIncrement=function(){return ++this._index,this},t.prototype.preDecrement=function(){return --this._index,this},t.prototype.increment=function(){return new t(this._vector,this._index++)},t.prototype.decrement=function(){return new t(this._vector,this._index--)},t.prototype.ptr=function(){return this._vector._ptr[this._index]},t.prototype.substitution=function(t){return this._index=t._index,this._vector=t._vector,this},t.prototype.notEqual=function(t){return this._index!=t._index||this._vector!=t._vector},t}();!function(t){t.csmVector=x,t.iterator=P;}(y||(y={}));var B,C=function(){function t(t){this.s=t;}return t.prototype.append=function(t,e){return this.s+=void 0!==e?t.substr(0,e):t,this},t.prototype.expansion=function(t,e){for(var i=0;i<t;i++)this.append(e);return this},t.prototype.getBytes=function(){return encodeURIComponent(this.s).replace(/%../g,"x").length},t.prototype.getLength=function(){return this.s.length},t.prototype.isLess=function(t){return this.s<t.s},t.prototype.isGreat=function(t){return this.s>t.s},t.prototype.isEqual=function(t){return this.s==t},t.prototype.isEmpty=function(){return 0==this.s.length},t}();!function(t){t.csmString=C;}(B||(B={}));var M,b=function(){function t(t){this._id="string"!=typeof t?t:new C(t);}return t.prototype.getString=function(){return this._id},t.prototype.isEqual=function(e){return "string"==typeof e?this._id.isEqual(e):e instanceof C?this._id.isEqual(e.s):e instanceof t&&this._id.isEqual(e._id.s)},t.prototype.isNotEqual=function(e){return "string"==typeof e?!this._id.isEqual(e):e instanceof C?!this._id.isEqual(e.s):e instanceof t&&!this._id.isEqual(e._id.s)},t}();!function(t){t.CubismId=b;}(M||(M={}));var V,I=function(){function t(){this._ids=new x;}return t.prototype.release=function(){for(var t=0;t<this._ids.getSize();++t)this._ids.set(t,void 0);this._ids=null;},t.prototype.registerIds=function(t){for(var e=0;e<t.length;e++)this.registerId(t[e]);},t.prototype.registerId=function(t){var e=null;return "string"!=typeof t?this.registerId(t.s):(null!=(e=this.findId(t))||(e=new b(t),this._ids.pushBack(e)),e)},t.prototype.getId=function(t){return this.registerId(t)},t.prototype.isExist=function(t){return "string"==typeof t?null!=this.findId(t):this.isExist(t.s)},t.prototype.findId=function(t){for(var e=0;e<this._ids.getSize();++e)if(this._ids.at(e).getString().isEqual(t))return this._ids.at(e);return null},t}();!function(t){t.CubismIdManager=I;}(V||(V={}));var w,F=function(){function t(){this._tr=new Float32Array(16),this.loadIdentity();}return t.multiply=function(t,e,i){for(var r=new Float32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),n=0;n<4;++n)for(var a=0;a<4;++a)for(var o=0;o<4;++o)r[a+4*n]+=t[o+4*n]*e[a+4*o];for(n=0;n<16;++n)i[n]=r[n];},t.prototype.loadIdentity=function(){var t=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);this.setMatrix(t);},t.prototype.setMatrix=function(t){for(var e=0;e<16;++e)this._tr[e]=t[e];},t.prototype.getArray=function(){return this._tr},t.prototype.getScaleX=function(){return this._tr[0]},t.prototype.getScaleY=function(){return this._tr[5]},t.prototype.getTranslateX=function(){return this._tr[12]},t.prototype.getTranslateY=function(){return this._tr[13]},t.prototype.transformX=function(t){return this._tr[0]*t+this._tr[12]},t.prototype.transformY=function(t){return this._tr[5]*t+this._tr[13]},t.prototype.invertTransformX=function(t){return (t-this._tr[12])/this._tr[0]},t.prototype.invertTransformY=function(t){return (t-this._tr[13])/this._tr[5]},t.prototype.translateRelative=function(e,i){var r=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,e,i,0,1]);t.multiply(r,this._tr,this._tr);},t.prototype.translate=function(t,e){this._tr[12]=t,this._tr[13]=e;},t.prototype.translateX=function(t){this._tr[12]=t;},t.prototype.translateY=function(t){this._tr[13]=t;},t.prototype.scaleRelative=function(e,i){var r=new Float32Array([e,0,0,0,0,i,0,0,0,0,1,0,0,0,0,1]);t.multiply(r,this._tr,this._tr);},t.prototype.scale=function(t,e){this._tr[0]=t,this._tr[5]=e;},t.prototype.multiplyByMatrix=function(e){t.multiply(e.getArray(),this._tr,this._tr);},t.prototype.clone=function(){for(var e=new t,i=0;i<this._tr.length;i++)e._tr[i]=this._tr[i];return e},t}();!function(t){t.CubismMatrix44=F;}(w||(w={}));var T,E=function(){function t(){this._isCulling=!1,this._isPremultipliedAlpha=!1,this._anisortopy=0,this._model=null,this._modelColor=new L,this._mvpMatrix4x4=new F,this._mvpMatrix4x4.loadIdentity();}return t.create=function(){return null},t.delete=function(t){},t.prototype.initialize=function(t){this._model=t;},t.prototype.drawModel=function(){null!=this.getModel()&&this.doDrawModel();},t.prototype.setMvpMatrix=function(t){this._mvpMatrix4x4.setMatrix(t.getArray());},t.prototype.getMvpMatrix=function(){return this._mvpMatrix4x4},t.prototype.setModelColor=function(t,e,i,r){t<0?t=0:t>1&&(t=1),e<0?e=0:e>1&&(e=1),i<0?i=0:i>1&&(i=1),r<0?r=0:r>1&&(r=1),this._modelColor.R=t,this._modelColor.G=e,this._modelColor.B=i,this._modelColor.A=r;},t.prototype.getModelColor=function(){return JSON.parse(JSON.stringify(this._modelColor))},t.prototype.setIsPremultipliedAlpha=function(t){this._isPremultipliedAlpha=t;},t.prototype.isPremultipliedAlpha=function(){return this._isPremultipliedAlpha},t.prototype.setIsCulling=function(t){this._isCulling=t;},t.prototype.isCulling=function(){return this._isCulling},t.prototype.setAnisotropy=function(t){this._anisortopy=t;},t.prototype.getAnisotropy=function(){return this._anisortopy},t.prototype.getModel=function(){return this._model},t}();!function(t){t[t.CubismBlendMode_Normal=0]="CubismBlendMode_Normal",t[t.CubismBlendMode_Additive=1]="CubismBlendMode_Additive",t[t.CubismBlendMode_Multiplicative=2]="CubismBlendMode_Multiplicative";}(T||(T={}));var R,L=function(){this.R=1,this.G=1,this.B=1,this.A=1;};!function(t){t.CubismBlendMode=T,t.CubismRenderer=E,t.CubismTextureColor=L;}(R||(R={}));var D=function(t,e){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e;}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);},D(t,e)};function A(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t;}D(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i);}var k,N="Error: type mismatch",O=function(){function t(){}return t.prototype.getRawString=function(t,e){return this.getString(t,e)},t.prototype.toInt=function(t){return void 0===t&&(t=0),t},t.prototype.toFloat=function(t){return void 0===t&&(t=0),t},t.prototype.toBoolean=function(t){return void 0===t&&(t=!1),t},t.prototype.getSize=function(){return 0},t.prototype.getArray=function(t){return void 0===t&&(t=null),t},t.prototype.getVector=function(t){return void 0===t&&(t=new x),t},t.prototype.getMap=function(t){return t},t.prototype.getValueByIndex=function(e){return t.errorValue.setErrorNotForClientCall(N)},t.prototype.getValueByString=function(e){return t.nullValue.setErrorNotForClientCall(N)},t.prototype.getKeys=function(){return t.s_dummyKeys},t.prototype.isError=function(){return !1},t.prototype.isNull=function(){return !1},t.prototype.isBool=function(){return !1},t.prototype.isFloat=function(){return !1},t.prototype.isString=function(){return !1},t.prototype.isArray=function(){return !1},t.prototype.isMap=function(){return !1},t.prototype.equals=function(t){return !1},t.prototype.isStatic=function(){return !1},t.prototype.setErrorNotForClientCall=function(t){return Y.errorValue},t.staticInitializeNotForClientCall=function(){j.trueValue=new j(!0),j.falseValue=new j(!1),t.errorValue=new Y("ERROR",!0),t.nullValue=new G,t.s_dummyKeys=new x;},t.staticReleaseNotForClientCall=function(){j.trueValue=null,j.falseValue=null,t.errorValue=null,t.nullValue=null,t.s_dummyKeys=null;},t}(),z=function(){function t(t,e){this._error=null,this._lineCount=0,this._root=null,null!=t&&this.parseBytes(t,e);}return t.create=function(e,i){var r=new t;return r.parseBytes(e,i)?r:(t.delete(r),null)},t.delete=function(t){},t.prototype.getRoot=function(){return this._root},t.prototype.arrayBufferToString=function(t){for(var e=new Uint8Array(t),i="",r=0,n=e.length;r<n;++r)i+="%"+this.pad(e[r].toString(16));return i=decodeURIComponent(i)},t.prototype.pad=function(t){return t.length<2?"0"+t:t},t.prototype.parseBytes=function(t,e){var i=new Array(1),r=this.arrayBufferToString(t);if(this._root=this.parseValue(r,e,0,i),this._error){var n;return n="Json parse error : @line "+(this._lineCount+1)+"\n",this._root=new X(n),ot("{0}",this._root.getRawString()),!1}return null!=this._root||(this._root=new Y(new C(this._error),!1),!1)},t.prototype.getParseError=function(){return this._error},t.prototype.checkEndOfFile=function(){return this._root.getArray()[1].equals("EOF")},t.prototype.parseValue=function(t,e,i,r){if(this._error)return null;for(var n,a=null,o=i;o<e;o++){switch(t[o]){case"-":case".":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":var s=new Array(1);return n=W(t.slice(o),s),r[0]=t.indexOf(s[0]),new U(n);case'"':return new X(this.parseString(t,e,o+1,r));case"[":return a=this.parseArray(t,e,o+1,r);case"{":return a=this.parseObject(t,e,o+1,r);case"n":return o+3<e?(a=new G,r[0]=o+4):this._error="parse null",a;case"t":return o+3<e?(a=j.trueValue,r[0]=o+4):this._error="parse true",a;case"f":return o+4<e?(a=j.falseValue,r[0]=o+5):this._error="illegal ',' position",a;case",":return this._error="illegal ',' position",null;case"]":return r[0]=o,null;case"\n":this._lineCount++;}}return this._error="illegal end of value",null},t.prototype.parseString=function(t,e,i,r){if(this._error)return null;for(var n=i,a=new C(""),o=i;n<e;n++)switch(t[n]){case'"':return r[0]=n+1,a.append(t.slice(o),n-o),a.s;case"//":if(++n-1>o&&a.append(t.slice(o),n-o),o=n+1,n<e)switch(t[n]){case"\\":a.expansion(1,"\\");break;case'"':a.expansion(1,'"');break;case"/":a.expansion(1,"/");break;case"b":a.expansion(1,"\b");break;case"f":a.expansion(1,"\f");break;case"n":a.expansion(1,"\n");break;case"r":a.expansion(1,"\r");break;case"t":a.expansion(1,"\t");break;case"u":this._error="parse string/unicord escape not supported";}else this._error="parse string/escape error";}return this._error="parse string/illegal end",null},t.prototype.parseObject=function(t,e,i,r){if(this._error)return null;for(var n=new H,a="",o=i,s=Array(1),u=!1;o<e;o++){t:for(;o<e;o++)switch(t[o]){case'"':if(a=this.parseString(t,e,o+1,s),this._error)return null;o=s[0],u=!0;break t;case"}":return r[0]=o+1,n;case":":this._error="illegal ':' position";break;case"\n":this._lineCount++;}if(!u)return this._error="key not found",null;u=!1;t:for(;o<e;o++)switch(t[o]){case":":u=!0,o++;break t;case"}":this._error="illegal '}' position";break;case"\n":this._lineCount++;}if(!u)return this._error="':' not found",null;var l=this.parseValue(t,e,o,s);if(this._error)return null;o=s[0],n.put(a,l);t:for(;o<e;o++)switch(t[o]){case",":break t;case"}":return r[0]=o+1,n;case"\n":this._lineCount++;}}return this._error="illegal end of perseObject",null},t.prototype.parseArray=function(t,e,i,r){if(this._error)return null;for(var n=new q,a=i,o=new Array(1);a<e;a++){var s=this.parseValue(t,e,a,o);if(this._error)return null;a=o[0],s&&n.add(s);t:for(;a<e;a++)switch(t[a]){case",":break t;case"]":return r[0]=a+1,n;case"\n":++this._lineCount;}}return n=void 0,this._error="illegal end of parseObject",null},t}(),U=function(t){function e(e){var i=t.call(this)||this;return i._value=e,i}return A(e,t),e.prototype.isFloat=function(){return !0},e.prototype.getString=function(t,e){return this._value=parseFloat("\0"),this._stringBuffer="\0",this._stringBuffer},e.prototype.toInt=function(t){return parseInt(this._value.toString())},e.prototype.toFloat=function(t){return this._value},e.prototype.equals=function(t){return "number"==typeof t&&(!Math.round(t)&&t==this._value)},e}(O),j=function(t){function e(e){var i=t.call(this)||this;return i._boolValue=e,i}return A(e,t),e.prototype.isBool=function(){return !0},e.prototype.toBoolean=function(t){return this._boolValue},e.prototype.getString=function(t,e){return this._stringBuffer=this._boolValue?"true":"false",this._stringBuffer},e.prototype.equals=function(t){return "boolean"==typeof t&&t==this._boolValue},e.prototype.isStatic=function(){return !0},e}(O),X=function(t){function e(e){var i=t.call(this)||this;return "string"==typeof e&&(i._stringBuffer=e),e instanceof C&&(i._stringBuffer=e.s),i}return A(e,t),e.prototype.isString=function(){return !0},e.prototype.getString=function(t,e){return this._stringBuffer},e.prototype.equals=function(t){return "string"==typeof t?this._stringBuffer==t:t instanceof C&&this._stringBuffer==t.s},e}(O),Y=function(t){function e(e,i){var r=this;return (r=t.call(this,e)||this)._isStatic=i,r}return A(e,t),e.prototype.isStatic=function(){return this._isStatic},e.prototype.setErrorNotForClientCall=function(t){return this._stringBuffer=t,this},e.prototype.isError=function(){return !0},e}(X),G=function(t){function e(){var e=t.call(this)||this;return e._stringBuffer="NullValue",e}return A(e,t),e.prototype.isNull=function(){return !0},e.prototype.getString=function(t,e){return this._stringBuffer},e.prototype.isStatic=function(){return !0},e.prototype.setErrorNotForClientCall=function(t){return this._stringBuffer=t,Y.nullValue},e}(O),q=function(t){function e(){var e=t.call(this)||this;return e._array=new x,e}return A(e,t),e.prototype.release=function(){for(var t=this._array.begin();t.notEqual(this._array.end());t.preIncrement()){var e=t.ptr();e&&!e.isStatic()&&(e=void 0,e=null);}},e.prototype.isArray=function(){return !0},e.prototype.getValueByIndex=function(t){if(t<0||this._array.getSize()<=t)return O.errorValue.setErrorNotForClientCall("Error: index out of bounds");var e=this._array.at(t);return null==e?O.nullValue:e},e.prototype.getValueByString=function(t){return O.errorValue.setErrorNotForClientCall(N)},e.prototype.getString=function(t,e){for(var i=e+"[\n",r=this._array.begin();r.notEqual(this._array.end());r.increment()){var n=r.ptr();this._stringBuffer+=e+""+n.getString(e+" ")+"\n";}return this._stringBuffer=i+e+"]\n",this._stringBuffer},e.prototype.add=function(t){this._array.pushBack(t);},e.prototype.getVector=function(t){return this._array},e.prototype.getSize=function(){return this._array.getSize()},e}(O),H=function(t){function e(){var e=t.call(this)||this;return e._map=new _t,e}return A(e,t),e.prototype.release=function(){for(var t=this._map.begin();t.notEqual(this._map.end());){var e=t.ptr().second;e&&!e.isStatic()&&(e=void 0,e=null),t.preIncrement();}},e.prototype.isMap=function(){return !0},e.prototype.getValueByString=function(t){if(t instanceof C){var e=this._map.getValue(t.s);return null==e?O.nullValue:e}for(var i=this._map.begin();i.notEqual(this._map.end());i.preIncrement())if(i.ptr().first==t)return null==i.ptr().second?O.nullValue:i.ptr().second;return O.nullValue},e.prototype.getValueByIndex=function(t){return O.errorValue.setErrorNotForClientCall(N)},e.prototype.getString=function(t,e){this._stringBuffer=e+"{\n";for(var i=this._map.begin();i.notEqual(this._map.end());){var r=i.ptr().first,n=i.ptr().second;this._stringBuffer+=e+" "+r+" : "+n.getString(e+" ")+" \n",i.preIncrement();}return this._stringBuffer+=e+"}\n",this._stringBuffer},e.prototype.getMap=function(t){return this._map},e.prototype.put=function(t,e){this._map.setValue(t,e);},e.prototype.getKeys=function(){if(!this._keys){this._keys=new x;for(var t=this._map.begin();t.notEqual(this._map.end());){var e=t.ptr().first;this._keys.pushBack(e),t.preIncrement();}}return this._keys},e.prototype.getSize=function(){return this._keys.getSize()},e}(O);function W(t,e){for(var i=0,r=1;;r++){var n=t.slice(r-1,r);if("e"!=n&&"-"!=n&&"E"!=n){var a=t.substring(0,r),o=Number(a);if(isNaN(o))break;i=r;}}var s=parseFloat(t);return isNaN(s)&&(s=NaN),e[0]=t.slice(i),s}!function(t){t.CubismJson=z,t.JsonArray=q,t.JsonBoolean=j,t.JsonError=Y,t.JsonFloat=U,t.JsonMap=H,t.JsonNullvalue=G,t.JsonString=X,t.Value=O;}(k||(k={}));var J=!1,Z=!1,K=null,Q=null,$=Object.freeze({vertexOffset:0,vertexStep:2});function tt(t){}var et,it,rt=function(){function t(){}return t.startUp=function(t){if(void 0===t&&(t=null),J)return ot("CubismFramework.startUp() is already done."),J;if(null!=(K=t)&&Live2DCubismCore.Logging.csmSetLogFunction(K.logFunction),J=!0){var e=Live2DCubismCore.Version.csmGetVersion(),i=(16711680&e)>>16,r=65535&e,n=e;ot("Live2D Cubism Core version: {0}.{1}.{2} ({3})",("00"+((4278190080&e)>>24)).slice(-2),("00"+i).slice(-2),("0000"+r).slice(-4),n);}return ot("CubismFramework.startUp() is complete."),J},t.cleanUp=function(){J=!1,Z=!1,K=null,Q=null;},t.initialize=function(){ht(J),J?Z?st("CubismFramework.initialize() skipped, already initialized."):(O.staticInitializeNotForClientCall(),Q=new I,Z=!0,ot("CubismFramework.initialize() is complete.")):st("CubismFramework is not started.");},t.dispose=function(){ht(J),J?Z?(O.staticReleaseNotForClientCall(),Q.release(),Q=null,E.staticRelease(),Z=!1,ot("CubismFramework.dispose() is complete.")):st("CubismFramework.dispose() skipped, not initialized."):st("CubismFramework is not started.");},t.isStarted=function(){return J},t.isInitialized=function(){return Z},t.coreLogFunction=function(t){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(t);},t.getLoggingLevel=function(){return null!=K?K.loggingLevel:et.LogLevel_Off},t.getIdManager=function(){return Q},t}(),nt=function(){};!function(t){t[t.LogLevel_Verbose=0]="LogLevel_Verbose",t[t.LogLevel_Debug=1]="LogLevel_Debug",t[t.LogLevel_Info=2]="LogLevel_Info",t[t.LogLevel_Warning=3]="LogLevel_Warning",t[t.LogLevel_Error=4]="LogLevel_Error",t[t.LogLevel_Off=5]="LogLevel_Off";}(et||(et={})),function(t){t.Constant=$,t.csmDelete=tt,t.CubismFramework=rt;}(it||(it={}));var at,ot,st,ut,lt=function(t,e,i){!function(t,e,i){gt.print(t,"[CSM]"+e,i);}(t,e+"\n",i);},ht=function(t){console.assert(t);};at=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];lt(et.LogLevel_Debug,"[D]"+t,e);},ot=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];lt(et.LogLevel_Info,"[I]"+t,e);},st=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];lt(et.LogLevel_Warning,"[W]"+t,e);},ut=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];lt(et.LogLevel_Error,"[E]"+t,e);};var pt,gt=function(){function t(){}return t.print=function(t,e,i){if(!(t<rt.getLoggingLevel())){var r=rt.coreLogFunction;if(r)r(e.replace(/\{(\d+)\}/g,(function(t,e){return i[e]})));}},t.dumpBytes=function(t,e,i){for(var r=0;r<i;r++)r%16==0&&r>0?this.print(t,"\n"):r%8==0&&r>0&&this.print(t," "),this.print(t,"{0} ",[255&e[r]]);this.print(t,"\n");},t}();!function(t){t.CubismDebug=gt;}(pt||(pt={}));var ct,dt=function(t,e){this.first=null==t?null:t,this.second=null==e?null:e;},_t=function(){function t(t){null!=t?t<1?(this._keyValues=[],this._dummyValue=null,this._size=0):(this._keyValues=new Array(t),this._size=t):(this._keyValues=[],this._dummyValue=null,this._size=0);}return t.prototype.release=function(){this.clear();},t.prototype.appendKey=function(t){this.prepareCapacity(this._size+1,!1),this._keyValues[this._size]=new dt(t),this._size+=1;},t.prototype.getValue=function(t){for(var e=-1,i=0;i<this._size;i++)if(this._keyValues[i].first==t){e=i;break}return e>=0?this._keyValues[e].second:(this.appendKey(t),this._keyValues[this._size-1].second)},t.prototype.setValue=function(t,e){for(var i=-1,r=0;r<this._size;r++)if(this._keyValues[r].first==t){i=r;break}i>=0?this._keyValues[i].second=e:(this.appendKey(t),this._keyValues[this._size-1].second=e);},t.prototype.isExist=function(t){for(var e=0;e<this._size;e++)if(this._keyValues[e].first==t)return !0;return !1},t.prototype.clear=function(){this._keyValues=void 0,this._keyValues=null,this._keyValues=[],this._size=0;},t.prototype.getSize=function(){return this._size},t.prototype.prepareCapacity=function(e,i){e>this._keyValues.length&&(0==this._keyValues.length?(!i&&e<t.DefaultSize&&(e=t.DefaultSize),this._keyValues.length=e):(!i&&e<2*this._keyValues.length&&(e=2*this._keyValues.length),this._keyValues.length=e));},t.prototype.begin=function(){return new mt(this,0)},t.prototype.end=function(){return new mt(this,this._size)},t.prototype.erase=function(t){var e=t._index;return e<0||this._size<=e?t:(this._keyValues.splice(e,1),--this._size,new mt(this,e))},t.prototype.dumpAsInt=function(){for(var t=0;t<this._size;t++)at("{0} ,",this._keyValues[t]),at("\n");},t.DefaultSize=10,t}(),mt=function(){function t(t,e){this._map=null!=t?t:new _t,this._index=null!=e?e:0;}return t.prototype.set=function(t){return this._index=t._index,this._map=t._map,this},t.prototype.preIncrement=function(){return ++this._index,this},t.prototype.preDecrement=function(){return --this._index,this},t.prototype.increment=function(){return new t(this._map,this._index++)},t.prototype.decrement=function(){var e=new t(this._map,this._index);return this._map=e._map,this._index=e._index,this},t.prototype.ptr=function(){return this._map._keyValues[this._index]},t.prototype.notEqual=function(t){return this._index!=t._index||this._map!=t._map},t}();!function(t){t.csmMap=_t,t.csmPair=dt,t.iterator=mt;}(ct||(ct={}));var ft,yt=function(){function t(){this._currentTime=0;}return t.create=function(){return new t},t.delete=function(t){},t.prototype.setParameters=function(t){this._breathParameters=t;},t.prototype.getParameters=function(){return this._breathParameters},t.prototype.updateParameters=function(t,e){this._currentTime+=e;for(var i=2*this._currentTime*3.14159,r=0;r<this._breathParameters.getSize();++r){var n=this._breathParameters.at(r);t.addParameterValueById(n.parameterId,n.offset+n.peak*Math.sin(i/n.cycle),n.weight);}},t}(),vt=function(t,e,i,r,n){this.parameterId=null==t?null:t,this.offset=null==e?0:e,this.peak=null==i?0:i,this.cycle=null==r?0:r,this.weight=null==n?0:n;};!function(t){t.BreathParameterData=vt,t.CubismBreath=yt;}(ft||(ft={}));var St,xt,Pt=function(){function t(t){if(this._blinkingState=St.EyeState_First,this._nextBlinkingTime=0,this._stateStartTimeSeconds=0,this._blinkingIntervalSeconds=4,this._closingSeconds=.1,this._closedSeconds=.05,this._openingSeconds=.15,this._userTimeSeconds=0,this._parameterIds=new x,null!=t)for(var e=0;e<t.getEyeBlinkParameterCount();++e)this._parameterIds.pushBack(t.getEyeBlinkParameterId(e));}return t.create=function(e){return void 0===e&&(e=null),new t(e)},t.delete=function(t){},t.prototype.setBlinkingInterval=function(t){this._blinkingIntervalSeconds=t;},t.prototype.setBlinkingSetting=function(t,e,i){this._closingSeconds=t,this._closedSeconds=e,this._openingSeconds=i;},t.prototype.setParameterIds=function(t){this._parameterIds=t;},t.prototype.getParameterIds=function(){return this._parameterIds},t.prototype.updateParameters=function(e,i){var r;this._userTimeSeconds+=i;var n=0;switch(this._blinkingState){case St.EyeState_Closing:(n=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closingSeconds)>=1&&(n=1,this._blinkingState=St.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),r=1-n;break;case St.EyeState_Closed:(n=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds)>=1&&(this._blinkingState=St.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),r=0;break;case St.EyeState_Opening:(n=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds)>=1&&(n=1,this._blinkingState=St.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),r=n;break;case St.EyeState_Interval:this._nextBlinkingTime<this._userTimeSeconds&&(this._blinkingState=St.EyeState_Closing,this._stateStartTimeSeconds=this._userTimeSeconds),r=1;break;case St.EyeState_First:default:this._blinkingState=St.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming(),r=1;}t.CloseIfZero||(r=-r);for(var a=0;a<this._parameterIds.getSize();++a)e.setParameterValueById(this._parameterIds.at(a),r);},t.prototype.determinNextBlinkingTiming=function(){var t=Math.random();return this._userTimeSeconds+t*(2*this._blinkingIntervalSeconds-1)},t.CloseIfZero=!0,t}();!function(t){t[t.EyeState_First=0]="EyeState_First",t[t.EyeState_Interval=1]="EyeState_Interval",t[t.EyeState_Closing=2]="EyeState_Closing",t[t.EyeState_Closed=3]="EyeState_Closed",t[t.EyeState_Opening=4]="EyeState_Opening";}(St||(St={})),function(t){t.CubismEyeBlink=Pt,t.EyeState=St;}(xt||(xt={}));var Bt,Ct="FadeInTime",Mt="Link",bt=function(){function t(){this._fadeTimeSeconds=.5,this._lastModel=null,this._partGroups=new x,this._partGroupCounts=new x;}return t.create=function(e,i){var r=new t,n=z.create(e,i),a=n.getRoot();a.getValueByString(Ct).isNull()||(r._fadeTimeSeconds=a.getValueByString(Ct).toFloat(.5),r._fadeTimeSeconds<=0&&(r._fadeTimeSeconds=.5));for(var o=a.getValueByString("Groups"),s=o.getSize(),u=0;u<s;++u){for(var l=o.getValueByIndex(u),h=l.getSize(),p=0,g=0;g<h;++g){var c=l.getValueByIndex(g),d=new Vt,_=rt.getIdManager().getId(c.getValueByString("Id").getRawString());if(d.partId=_,!c.getValueByString(Mt).isNull())for(var m=c.getValueByString(Mt),f=m.getSize(),y=0;y<f;++y){var v=new Vt,S=rt.getIdManager().getId(m.getValueByIndex(y).getString());v.partId=S,d.link.pushBack(v);}r._partGroups.pushBack(d.clone()),++p;}r._partGroupCounts.pushBack(p);}return z.delete(n),r},t.delete=function(t){},t.prototype.updateParameters=function(t,e){t!=this._lastModel&&this.reset(t),this._lastModel=t,e<0&&(e=0);for(var i=0,r=0;r<this._partGroupCounts.getSize();r++){var n=this._partGroupCounts.at(r);this.doFade(t,e,i,n),i+=n;}this.copyPartOpacities(t);},t.prototype.reset=function(t){for(var e=0,i=0;i<this._partGroupCounts.getSize();++i){for(var r=this._partGroupCounts.at(i),n=e;n<e+r;++n){this._partGroups.at(n).initialize(t);var a=this._partGroups.at(n).partIndex,o=this._partGroups.at(n).parameterIndex;if(!(a<0)){t.setPartOpacityByIndex(a,n==e?1:0),t.setParameterValueByIndex(o,n==e?1:0);for(var s=0;s<this._partGroups.at(n).link.getSize();++s)this._partGroups.at(n).link.at(s).initialize(t);}}e+=r;}},t.prototype.copyPartOpacities=function(t){for(var e=0;e<this._partGroups.getSize();++e){var i=this._partGroups.at(e);if(0!=i.link.getSize())for(var r=this._partGroups.at(e).partIndex,n=t.getPartOpacityByIndex(r),a=0;a<i.link.getSize();++a){var o=i.link.at(a).partIndex;o<0||t.setPartOpacityByIndex(o,n);}}},t.prototype.doFade=function(t,e,i,r){for(var n=-1,a=1,o=.5,s=i;s<i+r;++s){var u=this._partGroups.at(s).partIndex,l=this._partGroups.at(s).parameterIndex;if(t.getParameterValueByIndex(l)>.001){if(n>=0)break;n=s,a=t.getPartOpacityByIndex(u),(a+=e/this._fadeTimeSeconds)>1&&(a=1);}}n<0&&(n=0,a=1);for(s=i;s<i+r;++s){var h=this._partGroups.at(s).partIndex;if(n==s)t.setPartOpacityByIndex(h,a);else {var p=t.getPartOpacityByIndex(h),g=void 0;(1-(g=a<o?-.5*a/o+1:(1-a)*o/.5))*(1-a)>.15&&(g=1-.15/(1-a)),p>g&&(p=g),t.setPartOpacityByIndex(h,p);}}},t}(),Vt=function(){function t(t){if(this.parameterIndex=0,this.partIndex=0,this.link=new x,null!=t){this.partId=t.partId;for(var e=t.link.begin();e.notEqual(t.link.end());e.preIncrement())this.link.pushBack(e.ptr().clone());}}return t.prototype.assignment=function(t){this.partId=t.partId;for(var e=t.link.begin();e.notEqual(t.link.end());e.preIncrement())this.link.pushBack(e.ptr().clone());return this},t.prototype.initialize=function(t){this.parameterIndex=t.getParameterIndex(this.partId),this.partIndex=t.getPartIndex(this.partId),t.setParameterValueByIndex(this.parameterIndex,1);},t.prototype.clone=function(){var e=new t;e.partId=this.partId,e.parameterIndex=this.parameterIndex,e.partIndex=this.partIndex,e.link=new x;for(var i=this.link.begin();i.notEqual(this.link.end());i.increment())e.link.pushBack(i.ptr().clone());return e},t}();!function(t){t.CubismPose=bt,t.PartData=Vt;}(Bt||(Bt={}));var It,wt=function(t){function e(e,i){var r=t.call(this)||this;return r._width=void 0!==e?e:0,r._height=void 0!==i?i:0,r.setHeight(2),r}return A(e,t),e.prototype.setWidth=function(t){var e=t/this._width,i=e;this.scale(e,i);},e.prototype.setHeight=function(t){var e=t/this._height,i=e;this.scale(e,i);},e.prototype.setPosition=function(t,e){this.translate(t,e);},e.prototype.setCenterPosition=function(t,e){this.centerX(t),this.centerY(e);},e.prototype.top=function(t){this.setY(t);},e.prototype.bottom=function(t){var e=this._height*this.getScaleY();this.translateY(t-e);},e.prototype.left=function(t){this.setX(t);},e.prototype.right=function(t){var e=this._width*this.getScaleX();this.translateX(t-e);},e.prototype.centerX=function(t){var e=this._width*this.getScaleX();this.translateX(t-e/2);},e.prototype.setX=function(t){this.translateX(t);},e.prototype.centerY=function(t){var e=this._height*this.getScaleY();this.translateY(t-e/2);},e.prototype.setY=function(t){this.translateY(t);},e.prototype.setupFromLayout=function(t){for(var e=t.begin();e.notEqual(t.end());e.preIncrement()){var i=e.ptr().first,r=e.ptr().second;"width"==i?this.setWidth(r):"height"==i&&this.setHeight(r);}for(e=t.begin();e.notEqual(t.end());e.preIncrement()){i=e.ptr().first,r=e.ptr().second;"x"==i?this.setX(r):"y"==i?this.setY(r):"center_x"==i?this.centerX(r):"center_y"==i?this.centerY(r):"top"==i?this.top(r):"bottom"==i?this.bottom(r):"left"==i?this.left(r):"right"==i&&this.right(r);}},e}(F);!function(t){t.CubismModelMatrix=wt;}(It||(It={}));var Ft,Tt=function(){function t(t,e){this.x=t,this.y=e,this.x=null==t?0:t,this.y=null==e?0:e;}return t.prototype.add=function(e){var i=new t(0,0);return i.x=this.x+e.x,i.y=this.y+e.y,i},t.prototype.substract=function(e){var i=new t(0,0);return i.x=this.x-e.x,i.y=this.y-e.y,i},t.prototype.multiply=function(e){var i=new t(0,0);return i.x=this.x*e.x,i.y=this.y*e.y,i},t.prototype.multiplyByScaler=function(e){return this.multiply(new t(e,e))},t.prototype.division=function(e){var i=new t(0,0);return i.x=this.x/e.x,i.y=this.y/e.y,i},t.prototype.divisionByScalar=function(e){return this.division(new t(e,e))},t.prototype.getLength=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.getDistanceWith=function(t){return Math.sqrt((this.x-t.x)*(this.x-t.x)+(this.y-t.y)*(this.y-t.y))},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.normalize=function(){var t=Math.pow(this.x*this.x+this.y*this.y,.5);this.x=this.x/t,this.y=this.y/t;},t.prototype.isEqual=function(t){return this.x==t.x&&this.y==t.y},t.prototype.isNotEqual=function(t){return !this.isEqual(t)},t}();!function(t){t.CubismVector2=Tt;}(Ft||(Ft={}));var Et,Rt=function(){function t(){}return t.range=function(t,e,i){return t<e?t=e:t>i&&(t=i),t},t.sin=function(t){return Math.sin(t)},t.cos=function(t){return Math.cos(t)},t.abs=function(t){return Math.abs(t)},t.sqrt=function(t){return Math.sqrt(t)},t.cbrt=function(t){if(0===t)return t;var e,i=t,r=i<0;return r&&(i=-i),e=i===1/0?1/0:(i/((e=Math.exp(Math.log(i)/3))*e)+2*e)/3,r?-e:e},t.getEasingSine=function(t){return t<0?0:t>1?1:.5-.5*this.cos(t*Math.PI)},t.max=function(t,e){return t>e?t:e},t.min=function(t,e){return t>e?e:t},t.degreesToRadian=function(t){return t/180*Math.PI},t.radianToDegrees=function(t){return 180*t/Math.PI},t.directionToRadian=function(t,e){for(var i=Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x);i<-Math.PI;)i+=2*Math.PI;for(;i>Math.PI;)i-=2*Math.PI;return i},t.directionToDegrees=function(t,e){var i=this.directionToRadian(t,e),r=this.radianToDegrees(i);return e.x-t.x>0&&(r=-r),r},t.radianToDirection=function(t){var e=new Tt;return e.x=this.sin(t),e.y=this.cos(t),e},t.quadraticEquation=function(e,i,r){return this.abs(e)<t.Epsilon?this.abs(i)<t.Epsilon?-r:-r/i:-(i+this.sqrt(i*i-4*e*r))/(2*e)},t.cardanoAlgorithmForBezier=function(e,i,r,n){if(this.sqrt(e)<t.Epsilon)return this.range(this.quadraticEquation(i,r,n),0,1);var a=i/e,o=r/e,s=(3*o-a*a)/3,u=s/3,l=(2*a*a*a-9*a*o+27*(n/e))/27,h=l/2,p=h*h+u*u*u,g=.5,c=.51;if(p<0){var d=-s/3,_=d*d*d,m=this.sqrt(_),f=-l/(2*m),y=this.range(f,-1,1),v=Math.acos(y),S=2*this.cbrt(m),x=S*this.cos(v/3)-a/3;if(this.abs(x-g)<c)return this.range(x,0,1);var P=S*this.cos((v+2*Math.PI)/3)-a/3;if(this.abs(P-g)<c)return this.range(P,0,1);var B=S*this.cos((v+4*Math.PI)/3)-a/3;return this.range(B,0,1)}if(0==p){var C,M=2*(C=h<0?this.cbrt(-h):-this.cbrt(h))-a/3;if(this.abs(M-g)<c)return this.range(M,0,1);P=-C-a/3;return this.range(P,0,1)}var b=this.sqrt(p),V=this.cbrt(b-h)-this.cbrt(b+h)-a/3;return this.range(V,0,1)},t.Epsilon=1e-5,t}();!function(t){t.CubismMath=Rt;}(Et||(Et={}));var Lt,Dt=function(){function t(){this._faceTargetX=0,this._faceTargetY=0,this._faceX=0,this._faceY=0,this._faceVX=0,this._faceVY=0,this._lastTimeSeconds=0,this._userTimeSeconds=0;}return t.prototype.update=function(t){this._userTimeSeconds+=t;var e=4/30;if(0!=this._lastTimeSeconds){var i=30*(this._userTimeSeconds-this._lastTimeSeconds);this._lastTimeSeconds=this._userTimeSeconds;var r=i*e/4.5,n=this._faceTargetX-this._faceX,a=this._faceTargetY-this._faceY;if(!(Rt.abs(n)<=.01&&Rt.abs(a)<=.01)){var o=Rt.sqrt(n*n+a*a),s=e*a/o,u=e*n/o-this._faceVX,l=s-this._faceVY,h=Rt.sqrt(u*u+l*l);(h<-r||h>r)&&(u*=r/h,l*=r/h),this._faceVX+=u,this._faceVY+=l;var p=.5*(Rt.sqrt(r*r+16*r*o-8*r*o)-r),g=Rt.sqrt(this._faceVX*this._faceVX+this._faceVY*this._faceVY);g>p&&(this._faceVX*=p/g,this._faceVY*=p/g),this._faceX+=this._faceVX,this._faceY+=this._faceVY;}}else this._lastTimeSeconds=this._userTimeSeconds;},t.prototype.getX=function(){return this._faceX},t.prototype.getY=function(){return this._faceY},t.prototype.set=function(t,e){this._faceTargetX=t,this._faceTargetY=e;},t}();!function(t){t.CubismTargetPoint=Dt;}(Lt||(Lt={}));var At,kt=function(){function t(){var t=this;this.setFinishedMotionHandler=function(e){return t._onFinishedMotion=e},this.getFinishedMotionHandler=function(){return t._onFinishedMotion},this._fadeInSeconds=-1,this._fadeOutSeconds=-1,this._weight=1,this._offsetSeconds=0,this._firedEventValues=new x;}return t.delete=function(t){t.release(),t=null;},t.prototype.release=function(){this._weight=0;},t.prototype.updateParameters=function(t,e,i){if(e.isAvailable()&&!e.isFinished()){if(!e.isStarted()){e.setIsStarted(!0),e.setStartTime(i-this._offsetSeconds),e.setFadeInStartTime(i);var r=this.getDuration();e.getEndTime()<0&&e.setEndTime(r<=0?-1:e.getStartTime()+r);}var n=this._weight;n=n*(0==this._fadeInSeconds?1:Rt.getEasingSine((i-e.getFadeInStartTime())/this._fadeInSeconds))*(0==this._fadeOutSeconds||e.getEndTime()<0?1:Rt.getEasingSine((e.getEndTime()-i)/this._fadeOutSeconds)),e.setState(i,n),ht(0<=n&&n<=1),this.doUpdateParameters(t,i,n,e),e.getEndTime()>0&&e.getEndTime()<i&&e.setIsFinished(!0);}},t.prototype.setFadeInTime=function(t){this._fadeInSeconds=t;},t.prototype.setFadeOutTime=function(t){this._fadeOutSeconds=t;},t.prototype.getFadeOutTime=function(){return this._fadeOutSeconds},t.prototype.getFadeInTime=function(){return this._fadeInSeconds},t.prototype.setWeight=function(t){this._weight=t;},t.prototype.getWeight=function(){return this._weight},t.prototype.getDuration=function(){return -1},t.prototype.getLoopDuration=function(){return -1},t.prototype.setOffsetTime=function(t){this._offsetSeconds=t;},t.prototype.getFiredEvent=function(t,e){return this._firedEventValues},t}();!function(t){t.ACubismMotion=kt;}(At||(At={}));var Nt,Ot="Parameters",zt="Blend",Ut=function(t){function e(){var e=t.call(this)||this;return e._parameters=new x,e}return A(e,t),e.create=function(t,i){var r=new e,n=z.create(t,i),a=n.getRoot();r.setFadeInTime(a.getValueByString("FadeInTime").toFloat(1)),r.setFadeOutTime(a.getValueByString("FadeOutTime").toFloat(1));var o=a.getValueByString(Ot).getSize();r._parameters.prepareCapacity(o);for(var s=0;s<o;++s){var u=a.getValueByString(Ot).getValueByIndex(s),l=rt.getIdManager().getId(u.getValueByString("Id").getRawString()),h=u.getValueByString("Value").toFloat(),p=void 0;p=u.getValueByString(zt).isNull()||"Add"==u.getValueByString(zt).getString()?Nt.ExpressionBlendType_Add:"Multiply"==u.getValueByString(zt).getString()?Nt.ExpressionBlendType_Multiply:"Overwrite"==u.getValueByString(zt).getString()?Nt.ExpressionBlendType_Overwrite:Nt.ExpressionBlendType_Add;var g=new Gt;g.parameterId=l,g.blendType=p,g.value=h,r._parameters.pushBack(g);}return z.delete(n),r},e.prototype.doUpdateParameters=function(t,e,i,r){for(var n=0;n<this._parameters.getSize();++n){var a=this._parameters.at(n);switch(a.blendType){case Nt.ExpressionBlendType_Add:t.addParameterValueById(a.parameterId,a.value,i);break;case Nt.ExpressionBlendType_Multiply:t.multiplyParameterValueById(a.parameterId,a.value,i);break;case Nt.ExpressionBlendType_Overwrite:t.setParameterValueById(a.parameterId,a.value,i);}}},e}(kt);!function(t){t[t.ExpressionBlendType_Add=0]="ExpressionBlendType_Add",t[t.ExpressionBlendType_Multiply=1]="ExpressionBlendType_Multiply",t[t.ExpressionBlendType_Overwrite=2]="ExpressionBlendType_Overwrite";}(Nt||(Nt={}));var jt,Xt,Yt,Gt=function(){};!function(t){t.CubismExpressionMotion=Ut,t.ExpressionBlendType=Nt,t.ExpressionParameter=Gt;}(jt||(jt={})),function(t){t[t.CubismMotionCurveTarget_Model=0]="CubismMotionCurveTarget_Model",t[t.CubismMotionCurveTarget_Parameter=1]="CubismMotionCurveTarget_Parameter",t[t.CubismMotionCurveTarget_PartOpacity=2]="CubismMotionCurveTarget_PartOpacity";}(Xt||(Xt={})),function(t){t[t.CubismMotionSegmentType_Linear=0]="CubismMotionSegmentType_Linear",t[t.CubismMotionSegmentType_Bezier=1]="CubismMotionSegmentType_Bezier",t[t.CubismMotionSegmentType_Stepped=2]="CubismMotionSegmentType_Stepped",t[t.CubismMotionSegmentType_InverseStepped=3]="CubismMotionSegmentType_InverseStepped";}(Yt||(Yt={}));var qt,Ht=function(){this.time=0,this.value=0;},Wt=function(){this.evaluate=null,this.basePointIndex=0,this.segmentType=0;},Jt=function(){this.type=Xt.CubismMotionCurveTarget_Model,this.segmentCount=0,this.baseSegmentIndex=0,this.fadeInTime=0,this.fadeOutTime=0;},Zt=function(){this.fireTime=0;},Kt=function(){this.duration=0,this.loop=!1,this.curveCount=0,this.eventCount=0,this.fps=0,this.curves=new x,this.segments=new x,this.points=new x,this.events=new x;};!function(t){t.CubismMotionCurve=Jt,t.CubismMotionCurveTarget=Xt,t.CubismMotionData=Kt,t.CubismMotionEvent=Zt,t.CubismMotionPoint=Ht,t.CubismMotionSegment=Wt,t.CubismMotionSegmentType=Yt;}(qt||(qt={}));var Qt,$t,te="Meta",ee="Curves",ie="FadeInTime",re="FadeOutTime",ne="Segments",ae="UserData",oe=function(){function t(t,e){this._json=z.create(t,e);}return t.prototype.release=function(){z.delete(this._json);},t.prototype.getMotionDuration=function(){return this._json.getRoot().getValueByString(te).getValueByString("Duration").toFloat()},t.prototype.isMotionLoop=function(){return this._json.getRoot().getValueByString(te).getValueByString("Loop").toBoolean()},t.prototype.getEvaluationOptionFlag=function(t){return Qt.EvaluationOptionFlag_AreBeziersRistricted==t&&this._json.getRoot().getValueByString(te).getValueByString("AreBeziersRestricted").toBoolean()},t.prototype.getMotionCurveCount=function(){return this._json.getRoot().getValueByString(te).getValueByString("CurveCount").toInt()},t.prototype.getMotionFps=function(){return this._json.getRoot().getValueByString(te).getValueByString("Fps").toFloat()},t.prototype.getMotionTotalSegmentCount=function(){return this._json.getRoot().getValueByString(te).getValueByString("TotalSegmentCount").toInt()},t.prototype.getMotionTotalPointCount=function(){return this._json.getRoot().getValueByString(te).getValueByString("TotalPointCount").toInt()},t.prototype.isExistMotionFadeInTime=function(){return !this._json.getRoot().getValueByString(te).getValueByString(ie).isNull()},t.prototype.isExistMotionFadeOutTime=function(){return !this._json.getRoot().getValueByString(te).getValueByString(re).isNull()},t.prototype.getMotionFadeInTime=function(){return this._json.getRoot().getValueByString(te).getValueByString(ie).toFloat()},t.prototype.getMotionFadeOutTime=function(){return this._json.getRoot().getValueByString(te).getValueByString(re).toFloat()},t.prototype.getMotionCurveTarget=function(t){return this._json.getRoot().getValueByString(ee).getValueByIndex(t).getValueByString("Target").getRawString()},t.prototype.getMotionCurveId=function(t){return rt.getIdManager().getId(this._json.getRoot().getValueByString(ee).getValueByIndex(t).getValueByString("Id").getRawString())},t.prototype.isExistMotionCurveFadeInTime=function(t){return !this._json.getRoot().getValueByString(ee).getValueByIndex(t).getValueByString(ie).isNull()},t.prototype.isExistMotionCurveFadeOutTime=function(t){return !this._json.getRoot().getValueByString(ee).getValueByIndex(t).getValueByString(re).isNull()},t.prototype.getMotionCurveFadeInTime=function(t){return this._json.getRoot().getValueByString(ee).getValueByIndex(t).getValueByString(ie).toFloat()},t.prototype.getMotionCurveFadeOutTime=function(t){return this._json.getRoot().getValueByString(ee).getValueByIndex(t).getValueByString(re).toFloat()},t.prototype.getMotionCurveSegmentCount=function(t){return this._json.getRoot().getValueByString(ee).getValueByIndex(t).getValueByString(ne).getVector().getSize()},t.prototype.getMotionCurveSegment=function(t,e){return this._json.getRoot().getValueByString(ee).getValueByIndex(t).getValueByString(ne).getValueByIndex(e).toFloat()},t.prototype.getEventCount=function(){return this._json.getRoot().getValueByString(te).getValueByString("UserDataCount").toInt()},t.prototype.getTotalEventValueSize=function(){return this._json.getRoot().getValueByString(te).getValueByString("TotalUserDataSize").toInt()},t.prototype.getEventTime=function(t){return this._json.getRoot().getValueByString(ae).getValueByIndex(t).getValueByString("Time").toFloat()},t.prototype.getEventValue=function(t){return new C(this._json.getRoot().getValueByString(ae).getValueByIndex(t).getValueByString("Value").getRawString())},t}();!function(t){t[t.EvaluationOptionFlag_AreBeziersRistricted=0]="EvaluationOptionFlag_AreBeziersRistricted";}(Qt||(Qt={})),function(t){t.CubismMotionJson=oe;}($t||($t={}));function se(t,e,i){var r=new Ht;return r.time=t.time+(e.time-t.time)*i,r.value=t.value+(e.value-t.value)*i,r}function ue(t,e){var i=(e-t[0].time)/(t[1].time-t[0].time);return i<0&&(i=0),t[0].value+(t[1].value-t[0].value)*i}function le(t,e){var i=(e-t[0].time)/(t[3].time-t[0].time);i<0&&(i=0);var r=se(t[0],t[1],i),n=se(t[1],t[2],i),a=se(t[2],t[3],i),o=se(r,n,i),s=se(n,a,i);return se(o,s,i).value}function he(t,e){var i=e,r=t[0].time,n=t[3].time,a=t[1].time,o=t[2].time,s=n-3*o+3*a-r,u=3*o-6*a+3*r,l=3*a-3*r,h=r-i,p=Rt.cardanoAlgorithmForBezier(s,u,l,h),g=se(t[0],t[1],p),c=se(t[1],t[2],p),d=se(t[2],t[3],p),_=se(g,c,p),m=se(c,d,p);return se(_,m,p).value}function pe(t,e){return t[0].value}function ge(t,e){return t[1].value}function ce(t,e,i){for(var r=t.curves.at(e),n=-1,a=r.baseSegmentIndex+r.segmentCount,o=0,s=r.baseSegmentIndex;s<a;++s)if(o=t.segments.at(s).basePointIndex+(t.segments.at(s).segmentType==Yt.CubismMotionSegmentType_Bezier?3:1),t.points.at(o).time>i){n=s;break}if(-1==n)return t.points.at(o).value;var u=t.segments.at(n);return u.evaluate(t.points.get(u.basePointIndex),i)}var de,_e=function(t){function e(){var e=t.call(this)||this;return e._sourceFrameRate=30,e._loopDurationSeconds=-1,e._isLoop=!1,e._isLoopFadeIn=!0,e._lastWeight=0,e._motionData=null,e._modelCurveIdEyeBlink=null,e._modelCurveIdLipSync=null,e._eyeBlinkParameterIds=null,e._lipSyncParameterIds=null,e}return A(e,t),e.create=function(t,i,r){var n=new e;return n.parse(t,i),n._sourceFrameRate=n._motionData.fps,n._loopDurationSeconds=n._motionData.duration,n._onFinishedMotion=r,n},e.prototype.doUpdateParameters=function(t,e,i,r){null==this._modelCurveIdEyeBlink&&(this._modelCurveIdEyeBlink=rt.getIdManager().getId(