2023-03-21 10:49:35 +08:00

1 line
141 KiB
JavaScript

!function(i){function r(t){var e;return(o[t]||(e=o[t]={i:t,l:!1,exports:{}},i[t].call(e.exports,e,e.exports,r),e.l=!0,e)).exports}var o={};r.m=i,r.c=o,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=4)}([function(t,e,i){"use strict";function r(){this.live2DModel=null,this.modelMatrix=null,this.eyeBlink=null,this.physics=null,this.pose=null,this.debugMode=!1,this.initialized=!1,this.updating=!1,this.alpha=1,this.accAlpha=0,this.lipSync=!1,this.lipSyncValue=0,this.accelX=0,this.accelY=0,this.accelZ=0,this.dragX=0,this.dragY=0,this.startTimeMSec=null,this.mainMotionManager=new _,this.expressionManager=new _,this.motions={},this.expressions={},this.isTexLoaded=!1}function l(){AMotion.prototype.constructor.call(this),this.paramList=new Array}function $(){this.id="",this.type=-1,this.value=null}function o(){this.nextBlinkTime=null,this.stateStartTime=null,this.blinkIntervalMsec=null,this.eyeState=p.STATE_FIRST,this.blinkIntervalMsec=4e3,this.closingMotionMsec=100,this.closedMotionMsec=50,this.openingMotionMsec=150,this.closeIfZero=!0,this.eyeID_L="PARAM_EYE_L_OPEN",this.eyeID_R="PARAM_EYE_R_OPEN"}function n(){this.tr=new Float32Array(16),this.identity()}function s(t,e){n.prototype.constructor.call(this),this.width=t,this.height=e}function _(){MotionQueueManager.prototype.constructor.call(this),this.currentPriority=null,this.reservePriority=null,this.super=MotionQueueManager.prototype}function P(){this.physicsList=new Array,this.startTimeMSec=UtSystem.getUserTimeMSec()}function f(){this.lastTime=0,this.lastModel=null,this.partsGroups=new Array}function d(t){this.paramIndex=-1,this.partsIndex=-1,this.link=null,this.id=t}function a(){this.EPSILON=.01,this.faceTargetX=0,this.faceTargetY=0,this.faceX=0,this.faceY=0,this.faceVX=0,this.faceVY=0,this.lastTimeSec=0}function h(){n.prototype.constructor.call(this),this.screenLeft=null,this.screenRight=null,this.screenTop=null,this.screenBottom=null,this.maxLeft=null,this.maxRight=null,this.maxTop=null,this.maxBottom=null,this.max=Number.MAX_VALUE,this.min=0}function L(){}var u=0,p=(r.prototype.getModelMatrix=function(){return this.modelMatrix},r.prototype.setAlpha=function(t){this.alpha=t=(t=.999<t?1:t)<.001?0:t},r.prototype.getAlpha=function(){return this.alpha},r.prototype.isInitialized=function(){return this.initialized},r.prototype.setInitialized=function(t){this.initialized=t},r.prototype.isUpdating=function(){return this.updating},r.prototype.setUpdating=function(t){this.updating=t},r.prototype.getLive2DModel=function(){return this.live2DModel},r.prototype.setLipSync=function(t){this.lipSync=t},r.prototype.setLipSyncValue=function(t){this.lipSyncValue=t},r.prototype.setAccel=function(t,e,i){this.accelX=t,this.accelY=e,this.accelZ=i},r.prototype.setDrag=function(t,e){this.dragX=t,this.dragY=e},r.prototype.getMainMotionManager=function(){return this.mainMotionManager},r.prototype.getExpressionManager=function(){return this.expressionManager},r.prototype.loadModelData=function(t,e){var i=L.getPlatformManager(),r=(this.debugMode&&i.log("Load model : "+t),this);i.loadLive2DModel(t,function(t){r.live2DModel=t,r.live2DModel.saveParam(),0!=Live2D.getError()?console.error("Error : Failed to loadModelData()."):(r.modelMatrix=new s(r.live2DModel.getCanvasWidth(),r.live2DModel.getCanvasHeight()),r.modelMatrix.setWidth(2),r.modelMatrix.setCenterPosition(0,0),e(r.live2DModel))})},r.prototype.loadTexture=function(t,e,i){u++;var r=L.getPlatformManager(),o=(this.debugMode&&r.log("Load Texture : "+e),this);r.loadTexture(this.live2DModel,t,e,function(){0==--u&&(o.isTexLoaded=!0),"function"==typeof i&&i()})},r.prototype.loadMotion=function(e,t,i){var r,o=L.getPlatformManager(),n=(this.debugMode&&o.log("Load Motion : "+t),this);o.loadBytes(t,function(t){r=Live2DMotion.loadMotion(t),null!=e&&(n.motions[e]=r),i(r)})},r.prototype.loadExpression=function(e,t,i){var r=L.getPlatformManager(),o=(this.debugMode&&r.log("Load Expression : "+t),this);r.loadBytes(t,function(t){null!=e&&(o.expressions[e]=l.loadJson(t)),"function"==typeof i&&i()})},r.prototype.loadPose=function(t,e){var i=L.getPlatformManager(),r=(this.debugMode&&i.log("Load Pose : "+t),this);try{i.loadBytes(t,function(t){r.pose=f.load(t),"function"==typeof e&&e()})}catch(t){console.warn(t)}},r.prototype.loadPhysics=function(t){var e=L.getPlatformManager(),i=(this.debugMode&&e.log("Load Physics : "+t),this);try{e.loadBytes(t,function(t){i.physics=P.load(t)})}catch(t){console.warn(t)}},r.prototype.hitTestSimple=function(t,e,i){if(null===this.live2DModel)return!1;t=this.live2DModel.getDrawDataIndex(t);if(t<0)return!1;for(var r=this.live2DModel.getTransformedPoints(t),o=this.live2DModel.getCanvasWidth(),n=0,s=this.live2DModel.getCanvasHeight(),_=0,a=0;a<r.length;a+=2){var h=r[a],l=r[a+1];h<o&&(o=h),n<h&&(n=h),l<s&&(s=l),_<l&&(_=l)}t=this.modelMatrix.invertTransformX(e),e=this.modelMatrix.invertTransformY(i);return o<=t&&t<=n&&s<=e&&e<=_},r.prototype.hitTestSimpleCustom=function(t,e,i,r){return null!==this.live2DModel&&i>=t[0]&&i<=e[0]&&r<=t[1]&&r>=e[1]},l.prototype=new AMotion,l.EXPRESSION_DEFAULT="DEFAULT",l.TYPE_SET=0,l.TYPE_ADD=1,l.TYPE_MULT=2,l.loadJson=function(t){var e=new l,t=L.getPlatformManager().jsonParseFromBytes(t);if(e.setFadeIn(0<parseInt(t.fade_in)?parseInt(t.fade_in):1e3),e.setFadeOut(0<parseInt(t.fade_out)?parseInt(t.fade_out):1e3),null!=t.params){var i=t.params,r=i.length;e.paramList=[];for(var o=0;o<r;o++){var n,s=i[o],_=s.id.toString(),a=parseFloat(s.val),h=null!=s.calc?s.calc.toString():"add",s=((h="add"===h?l.TYPE_ADD:"mult"===h?l.TYPE_MULT:"set"===h?l.TYPE_SET:l.TYPE_ADD)==l.TYPE_ADD?a-=n=null==s.def?0:parseFloat(s.def):h==l.TYPE_MULT&&(a/=n=0==(n=null==s.def?1:parseFloat(s.def))?1:n),new $);s.id=_,s.type=h,s.value=a,e.paramList.push(s)}}return e},l.prototype.updateParamExe=function(t,e,i,r){for(var o=this.paramList.length-1;0<=o;--o){var n=this.paramList[o];n.type==l.TYPE_ADD?t.addToParamFloat(n.id,n.value,i):n.type==l.TYPE_MULT?t.multParamFloat(n.id,n.value,i):n.type==l.TYPE_SET&&t.setParamFloat(n.id,n.value,i)}},o.prototype.calcNextBlink=function(){return UtSystem.getUserTimeMSec()+Math.random()*(2*this.blinkIntervalMsec-1)},o.prototype.setInterval=function(t){this.blinkIntervalMsec=t},o.prototype.setEyeMotion=function(t,e,i){this.closingMotionMsec=t,this.closedMotionMsec=e,this.openingMotionMsec=i},o.prototype.updateParam=function(t){var e,i=UtSystem.getUserTimeMSec(),r=0;switch(this.eyeState){case p.STATE_CLOSING:1<=(r=(i-this.stateStartTime)/this.closingMotionMsec)&&(r=1,this.eyeState=p.STATE_CLOSED,this.stateStartTime=i),e=1-r;break;case p.STATE_CLOSED:1<=(r=(i-this.stateStartTime)/this.closedMotionMsec)&&(this.eyeState=p.STATE_OPENING,this.stateStartTime=i),e=0;break;case p.STATE_OPENING:1<=(r=(i-this.stateStartTime)/this.openingMotionMsec)&&(r=1,this.eyeState=p.STATE_INTERVAL,this.nextBlinkTime=this.calcNextBlink()),e=r;break;case p.STATE_INTERVAL:this.nextBlinkTime<i&&(this.eyeState=p.STATE_CLOSING,this.stateStartTime=i),e=1;break;default:p.STATE_FIRST;this.eyeState=p.STATE_INTERVAL,this.nextBlinkTime=this.calcNextBlink(),e=1}this.closeIfZero||(e=-e),t.setParamFloat(this.eyeID_L,e),t.setParamFloat(this.eyeID_R,e)},function(){});p.STATE_FIRST="STATE_FIRST",p.STATE_INTERVAL="STATE_INTERVAL",p.STATE_CLOSING="STATE_CLOSING",p.STATE_CLOSED="STATE_CLOSED",p.STATE_OPENING="STATE_OPENING",n.mul=function(t,e,i){for(var r,o,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=0;s<4;s++)for(r=0;r<4;r++)for(o=0;o<4;o++)n[s+4*r]+=t[s+4*o]*e[o+4*r];for(s=0;s<16;s++)i[s]=n[s]},n.prototype.identity=function(){for(var t=0;t<16;t++)this.tr[t]=t%5==0?1:0},n.prototype.getArray=function(){return this.tr},n.prototype.getCopyMatrix=function(){return new Float32Array(this.tr)},n.prototype.setMatrix=function(t){if(null!=this.tr&&this.tr.length==this.tr.length)for(var e=0;e<16;e++)this.tr[e]=t[e]},n.prototype.getScaleX=function(){return this.tr[0]},n.prototype.getScaleY=function(){return this.tr[5]},n.prototype.transformX=function(t){return this.tr[0]*t+this.tr[12]},n.prototype.transformY=function(t){return this.tr[5]*t+this.tr[13]},n.prototype.invertTransformX=function(t){return(t-this.tr[12])/this.tr[0]},n.prototype.invertTransformY=function(t){return(t-this.tr[13])/this.tr[5]},n.prototype.multTranslate=function(t,e){n.mul([1,0,0,0,0,1,0,0,0,0,1,0,t,e,0,1],this.tr,this.tr)},n.prototype.translate=function(t,e){this.tr[12]=t,this.tr[13]=e},n.prototype.translateX=function(t){this.tr[12]=t},n.prototype.translateY=function(t){this.tr[13]=t},n.prototype.multScale=function(t,e){n.mul([t,0,0,0,0,e,0,0,0,0,1,0,0,0,0,1],this.tr,this.tr)},n.prototype.scale=function(t,e){this.tr[0]=t,this.tr[5]=e},(s.prototype=new n).setPosition=function(t,e){this.translate(t,e)},s.prototype.setCenterPosition=function(t,e){var i=this.width*this.getScaleX(),r=this.height*this.getScaleY();this.translate(t-i/2,e-r/2)},s.prototype.top=function(t){this.setY(t)},s.prototype.bottom=function(t){var e=this.height*this.getScaleY();this.translateY(t-e)},s.prototype.left=function(t){this.setX(t)},s.prototype.right=function(t){var e=this.width*this.getScaleX();this.translateX(t-e)},s.prototype.centerX=function(t){var e=this.width*this.getScaleX();this.translateX(t-e/2)},s.prototype.centerY=function(t){var e=this.height*this.getScaleY();this.translateY(t-e/2)},s.prototype.setX=function(t){this.translateX(t)},s.prototype.setY=function(t){this.translateY(t)},s.prototype.setHeight=function(t){t/=this.height;this.scale(t,-t)},s.prototype.setWidth=function(t){t/=this.width;this.scale(t,-t)},(_.prototype=new MotionQueueManager).getCurrentPriority=function(){return this.currentPriority},_.prototype.getReservePriority=function(){return this.reservePriority},_.prototype.reserveMotion=function(t){return!(this.reservePriority>=t||this.currentPriority>=t||(this.reservePriority=t,0))},_.prototype.setReservePriority=function(t){this.reservePriority=t},_.prototype.updateParam=function(t){t=MotionQueueManager.prototype.updateParam.call(this,t);return this.isFinished()&&(this.currentPriority=0),t},_.prototype.startMotionPrio=function(t,e){return e==this.reservePriority&&(this.reservePriority=0),this.currentPriority=e,this.startMotion(t,!1)},P.load=function(t){for(var e=new P,i=L.getPlatformManager().jsonParseFromBytes(t).physics_hair,r=i.length,o=0;o<r;o++){var n=i[o],s=new PhysicsHair,_=n.setup,a=parseFloat(_.length),h=parseFloat(_.regist),_=parseFloat(_.mass);s.setup(a,h,_);for(var l=n.src,$=l.length,u=0;u<$;u++){var p=l[u],c=p.id,f=PhysicsHair.Src.SRC_TO_X,d=("x"===(T=p.ptype)?f=PhysicsHair.Src.SRC_TO_X:"y"===T?f=PhysicsHair.Src.SRC_TO_Y:"angle"===T?f=PhysicsHair.Src.SRC_TO_G_ANGLE:UtDebug.error("live2d","Invalid parameter:PhysicsHair.Src"),parseFloat(p.scale)),g=parseFloat(p.weight);s.addSrcParam(f,c,d,g)}for(var y=n.targets,m=y.length,u=0;u<m;u++){var T,S=y[u],c=S.id,f=PhysicsHair.Target.TARGET_FROM_ANGLE,d=("angle"===(T=S.ptype)?f=PhysicsHair.Target.TARGET_FROM_ANGLE:"angle_v"===T?f=PhysicsHair.Target.TARGET_FROM_ANGLE_V:UtDebug.error("live2d","Invalid parameter:PhysicsHair.Target"),parseFloat(S.scale)),g=parseFloat(S.weight);s.addTargetParam(f,c,d,g)}e.physicsList.push(s)}return e},P.prototype.updateParam=function(t){for(var e=UtSystem.getUserTimeMSec()-this.startTimeMSec,i=0;i<this.physicsList.length;i++)this.physicsList[i].update(t,e)},f.load=function(t){for(var e=new f,i=L.getPlatformManager().jsonParseFromBytes(t).parts_visible,r=i.length,o=0;o<r;o++){for(var n=i[o].group,s=n.length,_=new Array,a=0;a<s;a++){var h=n[a],l=new d(h.id);if(_[a]=l,null!=h.link){var $=h.link,u=$.length;l.link=new Array;for(var p=0;p<u;p++){var c=new d($[p]);l.link.push(c)}}}e.partsGroups.push(_)}return e},f.prototype.updateParam=function(t){if(null!=t){t!=this.lastModel&&this.initParam(t),this.lastModel=t;var e=UtSystem.getUserTimeMSec(),i=0==this.lastTime?0:(e-this.lastTime)/1e3;this.lastTime=e,i<0&&(i=0);for(var r=0;r<this.partsGroups.length;r++)this.normalizePartsOpacityGroup(t,this.partsGroups[r],i),this.copyOpacityOtherParts(t,this.partsGroups[r])}},f.prototype.initParam=function(t){if(null!=t)for(var e=0;e<this.partsGroups.length;e++)for(var i=this.partsGroups[e],r=0;r<i.length;r++){i[r].initIndex(t);var o=i[r].partsIndex,n=i[r].paramIndex;if(!(o<0)){var s=0!=t.getParamFloat(n);if(t.setPartsOpacity(o,s?1:0),t.setParamFloat(n,s?1:0),null!=i[r].link)for(var _=0;_<i[r].link.length;_++)i[r].link[_].initIndex(t)}}},f.prototype.normalizePartsOpacityGroup=function(t,e,i){for(var r=-1,o=1,n=0;n<e.length;n++){var s=e[n].partsIndex,_=e[n].paramIndex;if(!(s<0)&&0!=t.getParamFloat(_)){if(0<=r)break;r=n,o=t.getPartsOpacity(s),1<(o+=i/.5)&&(o=1)}}r<0&&(r=0,o=1);for(var a,h,n=0;n<e.length;n++)(s=e[n].partsIndex)<0||(r==n?t.setPartsOpacity(s,o):((h=.15<(1-(h=o<.5?-.5*o/.5+1:.5*(1-o)/.5))*(1-o)?1-.15/(1-o):h)<(a=t.getPartsOpacity(s))&&(a=h),t.setPartsOpacity(s,a)))},f.prototype.copyOpacityOtherParts=function(t,e){for(var i=0;i<e.length;i++){var r=e[i];if(null!=r.link&&!(r.partsIndex<0))for(var o=t.getPartsOpacity(r.partsIndex),n=0;n<r.link.length;n++){var s=r.link[n];s.partsIndex<0||t.setPartsOpacity(s.partsIndex,o)}}},d.prototype.initIndex=function(t){this.paramIndex=t.getParamIndex("VISIBLE:"+this.id),this.partsIndex=t.getPartsDataIndex(PartsDataID.getID(this.id)),t.setParamFloat(this.paramIndex,1)},a.FRAME_RATE=30,a.prototype.setPoint=function(t,e){this.faceTargetX=t,this.faceTargetY=e},a.prototype.getX=function(){return this.faceX},a.prototype.getY=function(){return this.faceY},a.prototype.update=function(){var t,e,i,r,o=40/7.5/a.FRAME_RATE;0==this.lastTimeSec?this.lastTimeSec=UtSystem.getUserTimeMSec():(e=((t=UtSystem.getUserTimeMSec())-this.lastTimeSec)*a.FRAME_RATE/1e3,this.lastTimeSec=t,t=e*o/(.15*a.FRAME_RATE),e=this.faceTargetX-this.faceX,i=this.faceTargetY-this.faceY,Math.abs(e)<=this.EPSILON&&Math.abs(i)<=this.EPSILON||(r=o*e/(e=Math.sqrt(e*e+i*i))-this.faceVX,o=o*i/e-this.faceVY,((i=Math.sqrt(r*r+o*o))<-t||t<i)&&(r*=t/i,o*=t/i,i=t),this.faceVX+=r,this.faceVY+=o,(i=.5*(Math.sqrt(t*t+16*t*e-8*t*e)-t))<(r=Math.sqrt(this.faceVX*this.faceVX+this.faceVY*this.faceVY))&&(this.faceVX*=i/r,this.faceVY*=i/r),this.faceX+=this.faceVX,this.faceY+=this.faceVY))},(h.prototype=new n).getMaxScale=function(){return this.max},h.prototype.getMinScale=function(){return this.min},h.prototype.setMaxScale=function(t){this.max=t},h.prototype.setMinScale=function(t){this.min=t},h.prototype.isMaxScale=function(){return this.getScaleX()==this.max},h.prototype.isMinScale=function(){return this.getScaleX()==this.min},h.prototype.adjustTranslate=function(t,e){this.tr[0]*this.maxLeft+(this.tr[12]+t)>this.screenLeft&&(t=this.screenLeft-this.tr[0]*this.maxLeft-this.tr[12]),this.tr[0]*this.maxRight+(this.tr[12]+t)<this.screenRight&&(t=this.screenRight-this.tr[0]*this.maxRight-this.tr[12]),this.tr[5]*this.maxTop+(this.tr[13]+e)<this.screenTop&&(e=this.screenTop-this.tr[5]*this.maxTop-this.tr[13]),this.tr[5]*this.maxBottom+(this.tr[13]+e)>this.screenBottom&&(e=this.screenBottom-this.tr[5]*this.maxBottom-this.tr[13]),n.mul([1,0,0,0,0,1,0,0,0,0,1,0,t,e,0,1],this.tr,this.tr)},h.prototype.adjustScale=function(t,e,i){var r=i*this.tr[0],r=(r<this.min?0<this.tr[0]&&(i=this.min/this.tr[0]):r>this.max&&0<this.tr[0]&&(i=this.max/this.tr[0]),[1,0,0,0,0,1,0,0,0,0,1,0,t,e,0,1]),i=[i,0,0,0,0,i,0,0,0,0,1,0,0,0,0,1];n.mul([1,0,0,0,0,1,0,0,0,0,1,0,-t,-e,0,1],this.tr,this.tr),n.mul(i,this.tr,this.tr),n.mul(r,this.tr,this.tr)},h.prototype.setScreenRect=function(t,e,i,r){this.screenLeft=t,this.screenRight=e,this.screenTop=r,this.screenBottom=i},h.prototype.setMaxScreenRect=function(t,e,i,r){this.maxLeft=t,this.maxRight=e,this.maxTop=r,this.maxBottom=i},h.prototype.getScreenLeft=function(){return this.screenLeft},h.prototype.getScreenRight=function(){return this.screenRight},h.prototype.getScreenBottom=function(){return this.screenBottom},h.prototype.getScreenTop=function(){return this.screenTop},h.prototype.getMaxLeft=function(){return this.maxLeft},h.prototype.getMaxRight=function(){return this.maxRight},h.prototype.getMaxBottom=function(){return this.maxBottom},h.prototype.getMaxTop=function(){return this.maxTop},L.platformManager=null,L.getPlatformManager=function(){return L.platformManager},L.setPlatformManager=function(t){L.platformManager=t},t.exports={L2DTargetPoint:a,Live2DFramework:L,L2DViewMatrix:h,L2DPose:f,L2DPartsParam:d,L2DPhysics:P,L2DMotionManager:_,L2DModelMatrix:s,L2DMatrix44:n,EYE_STATE:p,L2DEyeBlink:o,L2DExpressionParam:$,L2DExpressionMotion:l,L2DBaseModel:r}},function(t,e,i){"use strict";t.exports={DEBUG_LOG:!1,DEBUG_MOUSE_LOG:!1,DEBUG_DRAW_HIT_AREA:!1,DEBUG_DRAW_ALPHA_MODEL:!1,VIEW_MAX_SCALE:2,VIEW_MIN_SCALE:.8,VIEW_LOGICAL_LEFT:-1,VIEW_LOGICAL_RIGHT:1,VIEW_LOGICAL_MAX_LEFT:-2,VIEW_LOGICAL_MAX_RIGHT:2,VIEW_LOGICAL_MAX_BOTTOM:-2,VIEW_LOGICAL_MAX_TOP:2,PRIORITY_NONE:0,PRIORITY_IDLE:1,PRIORITY_SLEEPY:2,PRIORITY_NORMAL:3,PRIORITY_FORCE:4,MOTION_GROUP_IDLE:"idle",MOTION_GROUP_SLEEPY:"sleepy",MOTION_GROUP_TAP_BODY:"tap_body",MOTION_GROUP_FLICK_HEAD:"flick_head",MOTION_GROUP_PINCH_IN:"pinch_in",MOTION_GROUP_PINCH_OUT:"pinch_out",MOTION_GROUP_SHAKE:"shake",HIT_AREA_HEAD:"head",HIT_AREA_BODY:"body"}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setContext=function(t){r=t},e.getContext=function(){return r};var r=void 0},function(t,e,i){"use strict";function r(){}r.matrixStack=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],r.depth=0,r.currentMatrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],r.tmp=new Array(16),r.reset=function(){this.depth=0},r.loadIdentity=function(){for(var t=0;t<16;t++)this.currentMatrix[t]=t%5==0?1:0},r.push=function(){this.depth;var t=16*(this.depth+1);this.matrixStack.length<16+t&&(this.matrixStack.length=16+t);for(var e=0;e<16;e++)this.matrixStack[t+e]=this.currentMatrix[e];this.depth++},r.pop=function(){--this.depth<0&&(myError("Invalid matrix stack."),this.depth=0);for(var t=16*this.depth,e=0;e<16;e++)this.currentMatrix[e]=this.matrixStack[t+e]},r.getMatrix=function(){return this.currentMatrix},r.multMatrix=function(t){for(var e,i,r=0;r<16;r++)this.tmp[r]=0;for(r=0;r<4;r++)for(e=0;e<4;e++)for(i=0;i<4;i++)this.tmp[r+4*e]+=this.currentMatrix[r+4*i]*t[i+4*e];for(r=0;r<16;r++)this.currentMatrix[r]=this.tmp[r]},t.exports=r},function(t,e,i){t.exports=i(5)},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){var e=L.width,i=L.height,r=(M=new f.L2DTargetPoint,i/e),o=g.default.VIEW_LOGICAL_LEFT,n=g.default.VIEW_LOGICAL_RIGHT,s=-r;if(window.Live2D.captureFrame=!1,(E=new f.L2DViewMatrix).setScreenRect(o,n,s,r),E.setMaxScreenRect(g.default.VIEW_LOGICAL_MAX_LEFT,g.default.VIEW_LOGICAL_MAX_RIGHT,g.default.VIEW_LOGICAL_MAX_BOTTOM,g.default.VIEW_LOGICAL_MAX_TOP),E.setMaxScale(g.default.VIEW_MAX_SCALE),E.setMinScale(g.default.VIEW_MIN_SCALE),(v=new f.L2DMatrix44).multScale(1,e/i),(A=new f.L2DMatrix44).multTranslate(-e/2,-i/2),A.multScale(2/e,-2/e),P=function(){for(var t=["webgl","experimental-webgl","webkit-3d","moz-webgl"],e=0;e<t.length;e++)try{var i=L.getContext(t[e],{premultipliedAlpha:!0});if(i)return i}catch(t){}return null}(),(0,m.setContext)(P),!P)return console.error("Failed to create WebGL context."),window.WebGLRenderingContext&&console.error("Your browser don't support WebGL, check https://get.webgl.org/ for futher information.");window.Live2D.setGL(P),P.clearColor(0,0,0,0),o=t,T.reloadFlg=!0,T.count++,T.changeModel(P,o),S||(S=!0,function t(){!function(){y.default.reset(),y.default.loadIdentity(),M.update(),T.setDrag(M.getX(),M.getY()),P.clear(P.COLOR_BUFFER_BIT),y.default.multMatrix(v.getArray()),y.default.multMatrix(E.getArray()),y.default.push();for(var t=0;t<T.numModels();t++){var e=T.getModel(t);if(null==e)return;e.initialized&&!e.updating&&(e.update(),e.draw(P))}y.default.pop()}();var e,i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;window.Live2D.captureFrame&&(window.Live2D.captureFrame=!1,e=document.createElement("a"),document.body.appendChild(e),e.setAttribute("type","hidden"),e.href=L.toDataURL(),e.download=window.Live2D.captureName||"live2d.png",e.click()),i(t,L)}())}function _(t,e,i){function r(t,e){return 180*Math.acos((i={x:0,y:1},t=t,e=e,r=Math.sqrt(t*t+e*e),t={x:t/r,y:e/r},i.x*t.x+i.y*t.y))/Math.PI;var i,r}var o,n,s,_,a,h;return e.x<i.left+i.width&&e.y<i.top+i.height&&e.x>i.left&&e.y>i.top?e:(o=r(_=t.x-e.x,s=t.y-e.y),e.x<t.x&&(o=360-o),e=360-r(i.left-t.x,-1*(i.top-t.y)),n=360-r(i.left-t.x,-1*(i.top+i.height-t.y)),h=r(i.left+i.width-t.x,-1*(i.top-t.y)),a=r(i.left+i.width-t.x,-1*(i.top+i.height-t.y)),s=s/_,o<h?(_=i.top-t.y,{y:t.y+_,x:t.x+_/s}):o<a?(h=i.left+i.width-t.x,{y:t.y+h*s,x:t.x+h}):o<n?(_=i.top+i.height-t.y,{y:t.y+_,x:t.x+_/s}):o<e?(a=t.x-i.left,{y:t.y-a*s,x:t.x-a}):(h=i.top-t.y,{y:t.y+h,x:t.x+h/s}))}function a(t){x=!0;var e=L.getBoundingClientRect(),i=p(t.clientX-e.left),r=c(t.clientY-e.top),o=_({x:e.left+e.width/2,y:e.top+e.height*I},{x:t.clientX,y:t.clientY},e),n=$(o.x-e.left),o=u(o.y-e.top);g.default.DEBUG_MOUSE_LOG&&console.log("onMouseMove device( x:"+t.clientX+" y:"+t.clientY+" ) view( x:"+n+" y:"+o+")"),M.setPoint(n,o)}function h(){x=x&&!1,M.setPoint(0,0)}function l(){g.default.DEBUG_LOG&&console.log("Set Session Storage."),sessionStorage.setItem("Sleepy","1")}function n(t){var e,i,r,o,n,s;"mousewheel"!=t.type&&("mousedown"==t.type?(e=t,x=!0,i=L.getBoundingClientRect(),r=p(e.clientX-i.left),o=c(e.clientY-i.top),n=$((s=_({x:i.left+i.width/2,y:i.top+i.height*I},{x:e.clientX,y:e.clientY},i)).x-i.left),s=u(s.y-i.top),g.default.DEBUG_MOUSE_LOG&&console.log("onMouseDown device( x:"+e.clientX+" y:"+e.clientY+" ) view( x:"+n+" y:"+s+")"),T.tapEvent(n,s)):"mousemove"==t.type?("1"===sessionStorage.getItem("Sleepy")&&sessionStorage.setItem("Sleepy","0"),a(t)):"mouseup"==t.type?"button"in t&&t.button:"mouseout"==t.type&&(g.default.DEBUG_LOG&&console.log("Mouse out Window."),h(),i=sessionStorage.getItem("SleepyTimer"),window.clearTimeout(i),i=window.setTimeout(l,5e4),sessionStorage.setItem("SleepyTimer",i)))}function s(t){var e,i,r,o,n,s=t.touches[0];"touchstart"==t.type?1==t.touches.length&&a(s):"touchmove"==t.type?(s=s,e=L.getBoundingClientRect(),i=p(s.clientX-e.left),r=c(s.clientY-e.top),o=$((n=_({x:e.left+e.width/2,y:e.top+e.height*I},{x:s.clientX,y:s.clientY},e)).x-e.left),n=u(n.y-e.top),g.default.DEBUG_MOUSE_LOG&&console.log("onMouseMove device( x:"+s.clientX+" y:"+s.clientY+" ) view( x:"+o+" y:"+n+")"),x&&M.setPoint(o,n)):"touchend"==t.type&&h()}function $(t){t=A.transformX(t);return E.invertTransformX(t)}function u(t){t=A.transformY(t);return E.invertTransformY(t)}function p(t){return A.transformX(t)}function c(t){return A.transformY(t)}i(6);var f=i(0),d=r(i(8)),g=r(i(1)),y=r(i(3)),m=i(2),T=(window.navigator.platform.toLowerCase(),new d.default),S=!1,P=null,L=null,M=null,E=null,v=null,A=null,x=!1,I=.5;window.loadlive2d=function(t,e,i){I=void 0===i?.5:i,(L=document.getElementById(t)).addEventListener&&(window.addEventListener("click",n),window.addEventListener("mousedown",n),window.addEventListener("mousemove",n),window.addEventListener("mouseup",n),document.addEventListener("mouseout",n),window.addEventListener("touchstart",s),window.addEventListener("touchend",s),window.addEventListener("touchmove",s)),o(e)}},function(t,e,i){"use strict";!function(Y){function $(){O||(this._$MT=null,this._$5S=null,this._$NP=0,$._$42++,this._$5S=new d(this))}function L(t){if(!O){this.clipContextList=new Array,this.glcontext=t.gl,this.dp_webgl=t,this.curFrameNo=0,this.firstError_clipInNotUpdate=!0,this.colorBuffer=0,this.isInitGLFBFunc=!1,this.tmpBoundsOnModel=new H,ot.glContext.length>ot.frameBuffers.length&&(this.curFrameNo=this.getMaskRenderTexture()),this.tmpModelToViewMatrix=new i,this.tmpMatrix2=new i,this.tmpMatrixForMask=new i,this.tmpMatrixForDraw=new i,this.CHANNEL_COLORS=new Array;t=new j;(t=new j).r=0,t.g=0,t.b=0,t.a=1,this.CHANNEL_COLORS.push(t),(t=new j).r=1,t.g=0,t.b=0,t.a=0,this.CHANNEL_COLORS.push(t),(t=new j).r=0,t.g=1,t.b=0,t.a=0,this.CHANNEL_COLORS.push(t),(t=new j).r=0,t.g=0,t.b=1,t.a=0,this.CHANNEL_COLORS.push(t);for(var e=0;e<this.CHANNEL_COLORS.length;e++)this.dp_webgl.setChannelFlagAsColor(e,this.CHANNEL_COLORS[e])}}function D(t,e,i){this.clipIDList=new Array,this.clipIDList=i,this.clippingMaskDrawIndexList=new Array;for(var r=0;r<i.length;r++)this.clippingMaskDrawIndexList.push(e.getDrawDataIndex(i[r]));this.clippedDrawContextList=new Array,this.isUsing=!0,this.layoutChannelNo=0,this.layoutBounds=new H,this.allClippedDrawRect=new H,this.matrixForMask=new Float32Array(16),this.matrixForDraw=new Float32Array(16),this.owner=t}function R(t,e){this._$gP=t,this.drawDataIndex=e}function b(){O||(this.color=null)}function t(){O||(this._$dP=null,this._$eo=null,this._$V0=null,this._$dP=1e3,this._$eo=1e3,this._$V0=1,this._$a0())}function it(){}function F(){this._$r=null,this._$0S=null}function C(){O||(this.x=null,this.y=null,this.width=null,this.height=null)}function n(t){O||at.prototype.constructor.call(this,t)}function s(t){O||at.prototype.constructor.call(this,t)}function N(){O||(this._$vo=null,this._$F2=null,this._$ao=400,this._$1S=400,N._$42++)}function _(){O||(this.p1=new B,this.p2=new B,this._$Fo=0,this._$Db=0,this._$L2=0,this._$M2=0,this._$ks=0,this._$9b=0,this._$iP=0,this._$iT=0,this._$lL=new Array,this._$qP=new Array,this.setup(.3,.5,.1))}function B(){this._$p=1,this.x=0,this.y=0,this.vx=0,this.vy=0,this.ax=0,this.ay=0,this.fx=0,this.fy=0,this._$s0=0,this._$70=0,this._$7L=0,this._$HL=0}function U(t,e,i){this._$wL=null,this.scale=null,this._$V0=null,this._$wL=t,this.scale=e,this._$V0=i}function G(t,e,i,r){U.prototype.constructor.call(this,e,i,r),this._$tL=null,this._$tL=t}function k(t,e,i){this._$wL=null,this.scale=null,this._$V0=null,this._$wL=t,this.scale=e,this._$V0=i}function V(t,e,i,r){k.prototype.constructor.call(this,e,i,r),this._$YP=null,this._$YP=t}function X(){O||(this._$fL=0,this._$gL=0,this._$B0=1,this._$z0=1,this._$qT=0,this.reflectX=!1,this.reflectY=!1)}function H(){O||(this.x=null,this.y=null,this.width=null,this.height=null)}function W(){}function q(){O||(this.x=null,this.y=null)}function r(){O||(this._$gP=null,this._$dr=null,this._$GS=null,this._$qb=null,this._$Lb=null,this._$mS=null,this.clipID=null,this.clipIDList=new Array)}function e(){O||(this._$Eb=e._$ps,this._$lT=1,this._$C0=1,this._$tT=1,this._$WL=1,this.culling=!1,this.matrix4x4=new Float32Array(16),this.premultipliedAlpha=!1,this.anisotropy=0,this.clippingProcess=e.CLIPPING_PROCESS_NONE,this.clipBufPre_clipContextMask=null,this.clipBufPre_clipContextDraw=null,this.CHANNEL_COLORS=new Array)}function j(){O||(this.a=1,this.r=1,this.g=1,this.b=1,this.scale=1,this._$ho=1,this.blendMode=ot.L2D_COLOR_BLEND_MODE_MULT)}function a(){O||(this._$kP=null,this._$dr=null,this._$Ai=!0,this._$mS=null)}function Rt(){}function g(){O||(this._$VP=0,this._$wL=null,this._$GP=null,this._$8o=g._$ds,this._$2r=-1,this._$O2=0,this._$ri=0)}function c(){}function J(){O||(this._$Ob=null)}function i(){this.m=new Float32Array(16),this.identity()}function Q(t){O||at.prototype.constructor.call(this,t)}function p(){O||(this._$7=1,this._$f=0,this._$H=0,this._$g=1,this._$k=0,this._$w=0,this._$hi=STATE_IDENTITY,this._$Z=_$pS)}function f(){this._$4P=null,this._$I0=null,this._$RP=null}function T(){}function u(){}function d(t){O||(this._$QT=!0,this._$co=-1,this._$qo=0,this._$pb=new Array(d._$is),this._$_2=new Float32Array(d._$is),this._$vr=new Float32Array(d._$is),this._$Rr=new Float32Array(d._$is),this._$Or=new Float32Array(d._$is),this._$fs=new Float32Array(d._$is),this._$Js=new Array(d._$is),this._$3S=new Array,this._$aS=new Array,this._$Bo=null,this._$F2=new Array,this._$db=new Array,this._$8b=new Array,this._$Hr=new Array,this._$Ws=null,this._$Vs=null,this._$Er=null,this._$Es=new Int16Array(T._$Qb),this._$ZP=new Float32Array(2*T._$1r),this._$Ri=t,this._$b0=d._$HP++,this.clipManager=null,this.dp_webgl=null)}function Z(){}function o(){O||(e.prototype.constructor.call(this),this._$sb=new Int32Array(o._$As),this._$U2=new Array,this.transform=null,(this.gl=null)==o._$NT&&(o._$NT=o._$9r(256),o._$vS=o._$9r(256),o._$no=o._$vb(256)))}function z(){O||(a.prototype.constructor.call(this),this._$GS=null,this._$Y0=null)}function K(t){P.prototype.constructor.call(this,t),this._$8r=a._$ur,this._$Yr=null,this._$Wr=null}function y(){O||(r.prototype.constructor.call(this),this._$gP=null,this._$dr=null,this._$GS=null,this._$qb=null,this._$Lb=null,this._$mS=null)}function tt(){O||(this._$NL=null,this._$3S=null,this._$aS=null,tt._$42++)}function h(){O||($.prototype.constructor.call(this),this._$zo=new o)}function S(){O||(t.prototype.constructor.call(this),this.motions=new Array,this._$o2=null,this._$7r=S._$Co++,this._$D0=30,this._$yT=0,this._$E=!1,this.loopFadeIn=!0,this._$rr=-1,this._$eP=0)}function et(t,e){return String.fromCharCode(t.getUint8(e))}function f(){this._$4P=null,this._$I0=null,this._$RP=null}function nt(){O||(a.prototype.constructor.call(this),this._$o=0,this._$A=0,this._$GS=null,this._$Eo=null)}function st(t){P.prototype.constructor.call(this,t),this._$8r=a._$ur,this._$Cr=null,this._$hr=null}function l(){O||(this.visible=!0,this._$g0=!1,this._$NL=null,this._$3S=null,this._$aS=null,l._$42++)}function _t(t){this._$VS=null,this._$e0=null,this._$e0=t}function at(t){O||(this.id=t)}function ht(){O||(this._$4S=null)}function rt(t,e){this.canvas=t,this.context=e,this.viewport=new Array(0,0,t.width,t.height),this._$6r=1,this._$xP=0,this._$3r=1,this._$uP=0,this._$Qo=-1,this.cacheImages={}}function lt(){O||(this._$TT=null,this._$LT=null,this._$FS=null,this._$wL=null)}function P(t){O||(this._$e0=null,this._$IP=null,this._$JS=!1,this._$AT=!0,this._$e0=t,this.totalScale=1,this._$7s=1,this.totalOpacity=1)}function ot(){}function $t(){}function ut(t){O||(this._$ib=t)}function M(){O||(y.prototype.constructor.call(this),this._$LP=-1,this._$d0=0,this._$Yo=0,this._$JP=null,this._$5P=null,this._$BP=null,this._$Eo=null,this._$Qi=null,this._$6s=M._$ms,this.culling=!0,this.gl_cacheImage=null,this.instanceNo=M._$42++)}function pt(t){Tt.prototype.constructor.call(this,t),this._$8r=y._$ur,this._$Cr=null,this._$hr=null}function ct(){O||(this.x=null,this.y=null)}function E(t){O||($.prototype.constructor.call(this),this.drawParamWebGL=new A(t),this.drawParamWebGL.setGL(ot.getGL(t)))}function ft(){O||(this.motions=null,this._$eb=!1,this.motions=new Array)}function dt(){this._$w0=null,this._$AT=!0,this._$9L=!1,this._$z2=-1,this._$bs=-1,this._$Do=-1,this._$sr=null,this._$sr=dt._$Gs++}function gt(){this.m=new Array(1,0,0,0,1,0,0,0,1)}function v(t){O||at.prototype.constructor.call(this,t)}function A(t){O||(e.prototype.constructor.call(this),this.textures=new Array,this.transform=null,this.gl=null,this.glno=t,this.firstDraw=!0,this.anisotropyExt=null,this.maxAnisotropy=0,this._$As=32,this._$Gr=!1,this._$NT=null,this._$vS=null,this._$no=null,this.vertShader=null,this.fragShader=null,this.vertShaderOff=null,this.fragShaderOff=null)}function yt(t,e,i){return null==e&&(e=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,e),t.bufferData(t.ARRAY_BUFFER,i,t.DYNAMIC_DRAW),e}function mt(t,e,i){return null==e&&(e=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),t.bufferData(t.ELEMENT_ARRAY_BUFFER,i,t.DYNAMIC_DRAW),e}function x(t){O||(this._$P=new Int8Array(8),this._$R0=new DataView(this._$P.buffer),this._$3i=new Int8Array(1e3),this._$hL=0,this._$v0=0,this._$S2=0,this._$Ko=new Array,this._$T=t,this._$F=0)}function I(){}function Tt(t){O||(this._$e0=null,this._$IP=null,this._$Us=null,this._$7s=null,this._$IS=[!1],this._$VS=null,this._$AT=!0,this.baseOpacity=1,this.clipBufPre_clipContext=null,this._$e0=t)}function w(){}function St(){}var O,Pt,Lt;O=!0,$._$0s=1,$._$4s=2,$._$42=0,$._$62=function(t,e){try{if(!((e=e instanceof ArrayBuffer?new DataView(e):e)instanceof DataView))throw new ut("_$SS#loadModel(b) / b _$x be DataView or ArrayBuffer");var i,r=new x(e),o=r._$ST(),n=r._$ST(),s=r._$ST();if(109!=o||111!=n||99!=s)throw new ut("_$gi _$C _$li , _$Q0 _$P0.");if(i=r._$ST(),r._$gr(i),u._$T7<i)throw t._$NP|=$._$4s,new ut("_$gi _$C _$li , _$n0 _$_ version _$li ( SDK : "+u._$T7+" < _$f0 : "+i+" )@_$SS#loadModel()\n");var _=r._$nP();if(u._$s7<=i){var a=r._$9T(),h=r._$9T();if(-30584!=a||-30584!=h)throw t._$NP|=$._$0s,new ut("_$gi _$C _$li , _$0 _$6 _$Ui.")}t._$KS(_);var l=t.getModelContext();l.setDrawParam(t.getDrawParam()),l.init()}catch(t){it._$Rb(t)}},$.prototype._$KS=function(t){this._$MT=t},$.prototype.getModelImpl=function(){return null==this._$MT&&(this._$MT=new N,this._$MT._$zP()),this._$MT},$.prototype.getCanvasWidth=function(){return null==this._$MT?0:this._$MT.getCanvasWidth()},$.prototype.getCanvasHeight=function(){return null==this._$MT?0:this._$MT.getCanvasHeight()},$.prototype.getParamFloat=function(t){return"number"!=typeof t&&(t=this._$5S.getParamIndex(s.getID(t))),this._$5S.getParamFloat(t)},$.prototype.setParamFloat=function(t,e,i){"number"!=typeof t&&(t=this._$5S.getParamIndex(s.getID(t))),arguments.length<3&&(i=1),this._$5S.setParamFloat(t,this._$5S.getParamFloat(t)*(1-i)+e*i)},$.prototype.addToParamFloat=function(t,e,i){"number"!=typeof t&&(t=this._$5S.getParamIndex(s.getID(t))),arguments.length<3&&(i=1),this._$5S.setParamFloat(t,this._$5S.getParamFloat(t)+e*i)},$.prototype.multParamFloat=function(t,e,i){"number"!=typeof t&&(t=this._$5S.getParamIndex(s.getID(t))),arguments.length<3&&(i=1),this._$5S.setParamFloat(t,this._$5S.getParamFloat(t)*(1+(e-1)*i))},$.prototype.getParamIndex=function(t){return this._$5S.getParamIndex(s.getID(t))},$.prototype.loadParam=function(){this._$5S.loadParam()},$.prototype.saveParam=function(){this._$5S.saveParam()},$.prototype.init=function(){this._$5S.init()},$.prototype.update=function(){this._$5S.update()},$.prototype._$Rs=function(){return it._$li("_$60 _$PT _$Rs()"),-1},$.prototype._$Ds=function(t){it._$li("_$60 _$PT _$SS#_$Ds() \n")},$.prototype._$K2=function(){},$.prototype.draw=function(){},$.prototype.getModelContext=function(){return this._$5S},$.prototype._$s2=function(){return this._$NP},$.prototype._$P7=function(t,e,i,r){var o=-1,n=0,s=this;if(0!=i)if(1==t.length){var _=t[0],a=0!=s.getParamFloat(_),h=e[0],l=s.getPartsOpacity(h),$=i/r;a?1<(l+=$)&&(l=1):(l-=$)<0&&(l=0),s.setPartsOpacity(h,l)}else{for(var u=0;u<t.length;u++){_=t[u];if(f=0!=s.getParamFloat(_)){if(0<=o)break;o=u,h=e[u],n=s.getPartsOpacity(h);1<(n+=i/r)&&(n=1)}}o<0&&(console.log("No _$wi _$q0/ _$U default[%s]",t[0]),o=0,n=1,s.loadParam(),s.setParamFloat(t[o],n),s.saveParam());for(u=0;u<t.length;u++){var p,c,h=e[u];o==u?s.setPartsOpacity(h,n):((c=.15<(1-(c=n<.5?-.5*n/.5+1:.5*(1-n)/.5))*(1-n)?1-.15/(1-n):c)<(p=s.getPartsOpacity(h))&&(p=c),s.setPartsOpacity(h,p))}}else for(u=0;u<t.length;u++){var _=t[u],h=e[u],f=0!=s.getParamFloat(_);s.setPartsOpacity(h,f?1:0)}},$.prototype.setPartsOpacity=function(t,e){"number"!=typeof t&&(t=this._$5S.getPartsDataIndex(n.getID(t))),this._$5S.setPartsOpacity(t,e)},$.prototype.getPartsDataIndex=function(t){return t instanceof n||(t=n.getID(t)),this._$5S.getPartsDataIndex(t)},$.prototype.getPartsOpacity=function(t){return(t="number"!=typeof t?this._$5S.getPartsDataIndex(n.getID(t)):t)<0?0:this._$5S.getPartsOpacity(t)},$.prototype.getDrawParam=function(){},$.prototype.getDrawDataIndex=function(t){return this._$5S.getDrawDataIndex(Q.getID(t))},$.prototype.getDrawData=function(t){return this._$5S.getDrawData(t)},$.prototype.getTransformedPoints=function(t){t=this._$5S._$C2(t);return t instanceof pt?t.getTransformedPoints():null},$.prototype.getIndexArray=function(t){return!(t<0||t>=this._$5S._$aS.length)&&null!=(t=this._$5S._$aS[t])&&t.getType()==y._$wb&&t instanceof M?t.getIndexArray():null},L.CHANNEL_COUNT=4,L.RENDER_TEXTURE_USE_MIPMAP=!1,L.NOT_USED_FRAME=-100,L.prototype._$L7=function(){if(this.tmpModelToViewMatrix&&(this.tmpModelToViewMatrix=null),this.tmpMatrix2&&(this.tmpMatrix2=null),this.tmpMatrixForMask&&(this.tmpMatrixForMask=null),this.tmpMatrixForDraw&&(this.tmpMatrixForDraw=null),this.tmpBoundsOnModel&&(this.tmpBoundsOnModel=null),this.CHANNEL_COLORS){for(var t=this.CHANNEL_COLORS.length-1;0<=t;--t)this.CHANNEL_COLORS.splice(t,1);this.CHANNEL_COLORS=[]}this.releaseShader()},L.prototype.releaseShader=function(){for(var t=ot.frameBuffers.length,e=0;e<t;e++)this.gl.deleteFramebuffer(ot.frameBuffers[e].framebuffer);ot.frameBuffers=[],ot.glContext=[]},L.prototype.init=function(t,e,i){for(var r=0;r<e.length;r++){var o,n,s=e[r].getClipIDList();null!=s&&(null==(o=this.findSameClip(s))&&(o=new D(this,t,s),this.clipContextList.push(o)),s=e[r].getDrawDataID(),n=t.getDrawDataIndex(s),o.addClippedDrawData(s,n),i[r].clipBufPre_clipContext=o)}},L.prototype.getMaskRenderTexture=function(){var t=this.dp_webgl.createFramebuffer();return ot.frameBuffers[this.dp_webgl.glno]=t,this.dp_webgl.glno},L.prototype.setupClip=function(t,e){for(var i=0,r=0;r<this.clipContextList.length;r++){var o=this.clipContextList[r];this.calcClippedDrawTotalBounds(t,o),o.isUsing&&i++}if(0<i){var n=e.gl.getParameter(e.gl.FRAMEBUFFER_BINDING),s=new Array(4);s[0]=0,s[1]=0,s[2]=e.gl.canvas.width,s[3]=e.gl.canvas.height,e.gl.viewport(0,0,ot.clippingMaskBufferSize,ot.clippingMaskBufferSize),this.setupLayoutBounds(i),e.gl.bindFramebuffer(e.gl.FRAMEBUFFER,ot.frameBuffers[this.curFrameNo].framebuffer),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT);for(r=0;r<this.clipContextList.length;r++){var _=(o=this.clipContextList[r]).allClippedDrawRect,a=(o.layoutChannelNo,o.layoutBounds),_=(this.tmpBoundsOnModel._$jL(_),this.tmpBoundsOnModel.expand(.05*_.width,.05*_.height),a.width/this.tmpBoundsOnModel.width),h=a.height/this.tmpBoundsOnModel.height;this.tmpMatrix2.identity(),this.tmpMatrix2.translate(-1,-1,0),this.tmpMatrix2.scale(2,2,1),this.tmpMatrix2.translate(a.x,a.y,0),this.tmpMatrix2.scale(_,h,1),this.tmpMatrix2.translate(-this.tmpBoundsOnModel.x,-this.tmpBoundsOnModel.y,0),this.tmpMatrixForMask.setMatrix(this.tmpMatrix2.m),this.tmpMatrix2.identity(),this.tmpMatrix2.translate(a.x,a.y,0),this.tmpMatrix2.scale(_,h,1),this.tmpMatrix2.translate(-this.tmpBoundsOnModel.x,-this.tmpBoundsOnModel.y,0),this.tmpMatrixForDraw.setMatrix(this.tmpMatrix2.m);for(var l=this.tmpMatrixForMask.getArray(),$=0;$<16;$++)o.matrixForMask[$]=l[$];for(var u=this.tmpMatrixForDraw.getArray(),$=0;$<16;$++)o.matrixForDraw[$]=u[$];for(var p=o.clippingMaskDrawIndexList.length,c=0;c<p;c++){var f=o.clippingMaskDrawIndexList[c],d=t.getDrawData(f),f=t._$C2(f);e.setClipBufPre_clipContextForMask(o),d.draw(e,t,f)}}e.gl.bindFramebuffer(e.gl.FRAMEBUFFER,n),e.setClipBufPre_clipContextForMask(null),e.gl.viewport(s[0],s[1],s[2],s[3])}},L.prototype.getColorBuffer=function(){return this.colorBuffer},L.prototype.findSameClip=function(t){for(var e=0;e<this.clipContextList.length;e++){var i=this.clipContextList[e],r=i.clipIDList.length;if(r==t.length){for(var o=0,n=0;n<r;n++)for(var s=i.clipIDList[n],_=0;_<r;_++)if(t[_]==s){o++;break}if(o==r)return i}}return null},L.prototype.calcClippedDrawTotalBounds=function(t,e){for(var i=t._$Ri.getModelImpl().getCanvasWidth(),r=t._$Ri.getModelImpl().getCanvasHeight(),i=r<i?i:r,o=i,n=i,s=0,_=0,a=e.clippedDrawContextList.length,h=0;h<a;h++){var l=e.clippedDrawContextList[h].drawDataIndex,l=t._$C2(l);if(l._$yo()){for(var $=l.getTransformedPoints(),u=$.length,p=[],c=[],f=0,d=T._$i2;d<u;d+=T._$No)p[f]=$[d],c[f]=$[d+1],f++;var l=Math.min.apply(null,p),g=Math.min.apply(null,c),y=Math.max.apply(null,p),m=Math.max.apply(null,c);l<o&&(o=l),g<n&&(n=g),s<y&&(s=y),_<m&&(_=m)}}o==i?(e.allClippedDrawRect.x=0,e.allClippedDrawRect.y=0,e.allClippedDrawRect.width=0,e.allClippedDrawRect.height=0,e.isUsing=!1):(r=s-o,i=_-n,e.allClippedDrawRect.x=o,e.allClippedDrawRect.y=n,e.allClippedDrawRect.width=r,e.allClippedDrawRect.height=i,e.isUsing=!0)},L.prototype.setupLayoutBounds=function(t){for(var e=~~(t/L.CHANNEL_COUNT),i=~~(t%L.CHANNEL_COUNT),r=0,o=0;o<L.CHANNEL_COUNT;o++){var n=e+(o<i?1:0);if(0!=n)if(1==n)(a=this.clipContextList[r++]).layoutChannelNo=o,a.layoutBounds.x=0,a.layoutBounds.y=0,a.layoutBounds.width=1,a.layoutBounds.height=1;else if(2==n)for(var s=0;s<n;s++){var _,a,h=0;_=~~(_=s%2),(a=this.clipContextList[r++]).layoutChannelNo=o,a.layoutBounds.x=.5*_,a.layoutBounds.y=0,a.layoutBounds.width=.5,a.layoutBounds.height=1}else if(n<=4)for(s=0;s<n;s++)_=~~(_=s%2),h=~~(h=s/2),(a=this.clipContextList[r++]).layoutChannelNo=o,a.layoutBounds.x=.5*_,a.layoutBounds.y=.5*h,a.layoutBounds.width=.5,a.layoutBounds.height=.5;else if(n<=9)for(s=0;s<n;s++)_=~~(_=s%3),h=~~(h=s/3),(a=this.clipContextList[r++]).layoutChannelNo=o,a.layoutBounds.x=_/3,a.layoutBounds.y=h/3,a.layoutBounds.width=1/3,a.layoutBounds.height=1/3;else it._$li("_$6 _$0P mask count : %d",n)}},D.prototype.addClippedDrawData=function(t,e){t=new R(t,e);this.clippedDrawContextList.push(t)},t._$JT=function(t,e,i){var t=t/e,i=i/e,e=1-(1-i)*(1-i),r=1-(1-i)*(1-i),e=1/3*(1-i)*e+(2/3*i+1/3*(1-i))*(1-e),i=(i+2/3*(1-i))*r+(1/3*i+2/3*(1-i))*(1-r);return t<=0?0:1<=t?1:t*(r=t*t)*(1-3*i+3*e)+(3*i-6*e+0)*r+3*e*t},t.prototype._$a0=function(){},t.prototype.setFadeIn=function(t){this._$dP=t},t.prototype.setFadeOut=function(t){this._$eo=t},t.prototype._$pT=function(t){this._$V0=t},t.prototype.getFadeOut=function(){return this._$eo},t.prototype._$4T=function(){return this._$eo},t.prototype._$mT=function(){return this._$V0},t.prototype.getDurationMSec=function(){return-1},t.prototype.getLoopDurationMSec=function(){return-1},t.prototype.updateParam=function(t,e){var i,r;e._$AT&&!e._$9L&&(i=Rt.getUserTimeMSec(),e._$z2<0&&(e._$z2=i,e._$bs=i,r=this.getDurationMSec(),e._$Do<0)&&(e._$Do=r<=0?-1:e._$z2+r),0<=(r=this._$V0*(0==this._$dP?1:$t._$r2((i-e._$bs)/this._$dP))*(0==this._$eo||e._$Do<0?1:$t._$r2((e._$Do-i)/this._$eo)))&&r<=1||console.log("### assert!! ### "),this.updateParamExe(t,i,r,e),0<e._$Do)&&e._$Do<i&&(e._$9L=!0)},t.prototype.updateParamExe=function(t,e,i,r){},it._$8s=0,it._$fT=new Object,it.start=function(t){var e=it._$fT[t];null==e&&((e=new F)._$r=t,it._$fT[t]=e),e._$0S=Rt.getSystemTimeMSec()},it.dump=function(t){var e=it._$fT[t];return null!=e?(e=Rt.getSystemTimeMSec()-e._$0S,console.log(t+" : "+e+"ms"),e):-1},it.end=function(t){t=it._$fT[t];return null!=t?Rt.getSystemTimeMSec()-t._$0S:-1},it._$li=function(t,e){console.log("_$li : "+t+"\n",e)},it._$Ji=function(t,e){console.log(t,e)},it._$dL=function(t,e){console.log(t,e),console.log("\n")},it._$KL=function(t,e){for(var i=0;i<e;i++)i%16==0&&0<i?console.log("\n"):i%8==0&&0<i&&console.log(" "),console.log("%02X ",255&t[i]);console.log("\n")},it._$nr=function(t,e,i){console.log("%s\n",t);for(var r=e.length,o=0;o<r;++o)console.log("%5d",e[o]),console.log("%s\n",i),console.log(",");console.log("\n")},it._$Rb=function(t){console.log("dump exception : "+t),console.log("stack :: "+t.stack)},C.prototype._$8P=function(){return.5*(this.x+this.x+this.width)},C.prototype._$6P=function(){return.5*(this.y+this.y+this.height)},C.prototype._$EL=function(){return this.x+this.width},C.prototype._$5T=function(){return this.y+this.height},C.prototype._$jL=function(t,e,i,r){this.x=t,this.y=e,this.width=i,this.height=r},C.prototype._$jL=function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},n.prototype=new at,n._$tP=new Object,n._$27=function(){n._$tP.clear()},n.getID=function(t){var e=n._$tP[t];return null==e&&(e=new n(t),n._$tP[t]=e),e},n.prototype._$3s=function(){return new n},s.prototype=new at,s._$tP=new Object,s._$27=function(){s._$tP.clear()},s.getID=function(t){var e=s._$tP[t];return null==e&&(e=new s(t),s._$tP[t]=e),e},s.prototype._$3s=function(){return new s},N._$42=0,N.prototype._$zP=function(){null==this._$vo&&(this._$vo=new ht),null==this._$F2&&(this._$F2=new Array)},N.prototype.getCanvasWidth=function(){return this._$ao},N.prototype.getCanvasHeight=function(){return this._$1S},N.prototype._$F0=function(t){this._$vo=t._$nP(),this._$F2=t._$nP(),this._$ao=t._$6L(),this._$1S=t._$6L()},N.prototype._$6S=function(t){this._$F2.push(t)},N.prototype._$Xr=function(){return this._$F2},N.prototype._$E2=function(){return this._$vo},_.prototype.setup=function(t,e,i){this._$ks=this._$Yb(),this.p2._$xT(),3==arguments.length&&(this._$Fo=t,this._$L2=e,this.p1._$p=i,this.p2._$p=i,this.p2.y=t,this.setup())},_.prototype.getPhysicsPoint1=function(){return this.p1},_.prototype.getPhysicsPoint2=function(){return this.p2},_.prototype._$qr=function(){return this._$Db},_.prototype._$pr=function(t){this._$Db=t},_.prototype._$5r=function(){return this._$M2},_.prototype._$Cs=function(){return this._$9b},_.prototype._$Yb=function(){return-180*Math.atan2(this.p1.x-this.p2.x,-(this.p1.y-this.p2.y))/Math.PI},_.prototype.addSrcParam=function(t,e,i,r){t=new G(t,e,i,r);this._$lL.push(t)},_.prototype.addTargetParam=function(t,e,i,r){t=new V(t,e,i,r);this._$qP.push(t)},_.prototype.update=function(t,e){if(0==this._$iP)this._$iP=this._$iT=e,this._$Fo=Math.sqrt((this.p1.x-this.p2.x)*(this.p1.x-this.p2.x)+(this.p1.y-this.p2.y)*(this.p1.y-this.p2.y));else{var i=(e-this._$iT)/1e3;if(0!=i){for(var r=this._$lL.length-1;0<=r;--r)this._$lL[r]._$oP(t,this);this._$oo(t,i),this._$M2=this._$Yb(),this._$9b=(this._$M2-this._$ks)/i,this._$ks=this._$M2}for(r=this._$qP.length-1;0<=r;--r)this._$qP[r]._$YS(t,this);this._$iT=e}},_.prototype._$oo=function(t,e){var i=1/(e=e<.033?.033:e);this.p1.vx=(this.p1.x-this.p1._$s0)*i,this.p1.vy=(this.p1.y-this.p1._$70)*i,this.p1.ax=(this.p1.vx-this.p1._$7L)*i,this.p1.ay=(this.p1.vy-this.p1._$HL)*i,this.p1.fx=this.p1.ax*this.p1._$p,this.p1.fy=this.p1.ay*this.p1._$p,this.p1._$xT();var r=-Math.atan2(this.p1.y-this.p2.y,this.p1.x-this.p2.x),o=Math.cos(r),n=Math.sin(r),s=9.8*this.p2._$p,_=this._$Db*I._$bS,s=s*Math.cos(r-_),r=s*o,_=-this.p1.fx*n*n,o=-this.p1.fy*n*o,a=-this.p2.vx*this._$L2,h=-this.p2.vy*this._$L2,s=(this.p2.fx=s*n+_+a,this.p2.fy=r+o+h,this.p2.ax=this.p2.fx/this.p2._$p,this.p2.ay=this.p2.fy/this.p2._$p,this.p2.vx+=this.p2.ax*e,this.p2.vy+=this.p2.ay*e,this.p2.x+=this.p2.vx*e,this.p2.y+=this.p2.vy*e,Math.sqrt((this.p1.x-this.p2.x)*(this.p1.x-this.p2.x)+(this.p1.y-this.p2.y)*(this.p1.y-this.p2.y)));this.p2.x=this.p1.x+this._$Fo*(this.p2.x-this.p1.x)/s,this.p2.y=this.p1.y+this._$Fo*(this.p2.y-this.p1.y)/s,this.p2.vx=(this.p2.x-this.p2._$s0)*i,this.p2.vy=(this.p2.y-this.p2._$70)*i,this.p2._$xT()},B.prototype._$xT=function(){this._$s0=this.x,this._$70=this.y,this._$7L=this.vx,this._$HL=this.vy},U.prototype._$oP=function(t,e){},(G.prototype=new U)._$oP=function(t,e){var i=this.scale*t.getParamFloat(this._$wL),r=e.getPhysicsPoint1();switch(this._$tL){default:case _.Src.SRC_TO_X:r.x=r.x+(i-r.x)*this._$V0;break;case _.Src.SRC_TO_Y:r.y=r.y+(i-r.y)*this._$V0;break;case _.Src.SRC_TO_G_ANGLE:var o=e._$qr();o+=(i-o)*this._$V0,e._$pr(o)}},k.prototype._$YS=function(t,e){},(V.prototype=new k)._$YS=function(t,e){switch(this._$YP){default:case _.Target.TARGET_FROM_ANGLE:t.setParamFloat(this._$wL,this.scale*e._$5r(),this._$V0);break;case _.Target.TARGET_FROM_ANGLE_V:t.setParamFloat(this._$wL,this.scale*e._$Cs(),this._$V0)}},(_.Src=function(){}).SRC_TO_X="SRC_TO_X",_.Src.SRC_TO_Y="SRC_TO_Y",_.Src.SRC_TO_G_ANGLE="SRC_TO_G_ANGLE",(_.Target=function(){}).TARGET_FROM_ANGLE="TARGET_FROM_ANGLE",_.Target.TARGET_FROM_ANGLE_V="TARGET_FROM_ANGLE_V",X.prototype.init=function(t){this._$fL=t._$fL,this._$gL=t._$gL,this._$B0=t._$B0,this._$z0=t._$z0,this._$qT=t._$qT,this.reflectX=t.reflectX,this.reflectY=t.reflectY},X.prototype._$F0=function(t){this._$fL=t._$_T(),this._$gL=t._$_T(),this._$B0=t._$_T(),this._$z0=t._$_T(),this._$qT=t._$_T(),t.getFormatVersion()>=u.LIVE2D_FORMAT_VERSION_V2_10_SDK2&&(this.reflectX=t._$po(),this.reflectY=t._$po())},X.prototype._$e=function(){},St._$ni=function(t,e,i,r,o,n,s,_,a){var h,l=s*n-_*o;return 0==l?null:(l=((t-i)*n-(e-r)*o)/l,h=0!=o?(t-i-l*s)/o:(e-r-l*_)/n,isNaN(h)&&(h=(t-i-l*s)/o,isNaN(h)&&(h=(e-r-l*_)/n),isNaN(h))&&(console.log("a is NaN @UtVector#_$ni() "),console.log("v1x : "+o),console.log("v1x != 0 ? "+(0!=o))),null==a?new Array(h,l):(a[0]=h,a[1]=l,a))},H.prototype._$8P=function(){return this.x+.5*this.width},H.prototype._$6P=function(){return this.y+.5*this.height},H.prototype._$EL=function(){return this.x+this.width},H.prototype._$5T=function(){return this.y+this.height},H.prototype._$jL=function(t,e,i,r){this.x=t,this.y=e,this.width=i,this.height=r},H.prototype._$jL=function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},H.prototype.contains=function(t,e){return this.x<=this.x&&this.y<=this.y&&this.x<=this.x+this.width&&this.y<=this.y+this.height},H.prototype.expand=function(t,e){this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e},W._$Z2=function(t,e,i,r){var o,n,s,_,a,h,C,l,N,$,B,u,U,p,c,f,d,g,y,m,T,S,P,L,M,E,v,A,x,I=e._$Q2(t,i),w=t._$vs(),O=t._$Tr();if(e._$zr(w,O,I),I<=0)return r[w[0]];if(1==I)return(M=r[w[0]])+((E=r[w[1]])-M)*(p=O[0])|0;if(2==I)return M=r[w[0]],E=r[w[1]],v=r[w[2]],A=r[w[3]],(x=M+(E-M)*(p=O[0])|0)+((v+(A-v)*p|0)-x)*(c=O[1])|0;if(3==I)return d=r[w[0]],g=r[w[1]],y=r[w[2]],m=r[w[3]],T=r[w[4]],S=r[w[5]],P=r[w[6]],L=r[w[7]],(x=(M=d+(g-d)*(p=O[0])|0)+((E=y+(m-y)*p|0)-M)*(c=O[1])|0)+(((v=T+(S-T)*p|0)+((A=P+(L-P)*p|0)-v)*c|0)-x)*(f=O[2])|0;if(4==I)return i=r[w[0]],t=r[w[1]],e=r[w[2]],o=r[w[3]],n=r[w[4]],s=r[w[5]],_=r[w[6]],a=r[w[7]],h=r[w[8]],C=r[w[9]],l=r[w[10]],N=r[w[11]],$=r[w[12]],B=r[w[13]],u=r[w[14]],U=r[w[15]],(x=(M=(d=i+(t-i)*(p=O[0])|0)+((g=e+(o-e)*p|0)-d)*(c=O[1])|0)+((E=(y=n+(s-n)*p|0)+((m=_+(a-_)*p|0)-y)*c|0)-M)*(f=O[2])|0)+(((v=(T=h+(C-h)*p|0)+((S=l+(N-l)*p|0)-T)*c|0)+((A=(P=$+(B-$)*p|0)+((L=u+(U-u)*p|0)-P)*c|0)-v)*f|0)-x)*O[3]|0;for(var D=1<<I,G=new Float32Array(D),R=0;R<D;R++){for(var Y=R,k=1,b=0;b<I;b++)k*=Y%2==0?1-O[b]:O[b],Y/=2;G[R]=k}for(var V=new Float32Array(D),F=0;F<D;F++)V[F]=r[w[F]];for(var X=0,F=0;F<D;F++)X+=G[F]*V[F];return X+.5|0},W._$br=function(t,e,i,r){var o,n,s,_,a,h,l,$,u,p,c,f,d,g,y,m,T,S=e._$Q2(t,i),P=t._$vs(),L=t._$Tr();if(e._$zr(P,L,S),S<=0)return r[P[0]];if(1==S)return(n=r[P[0]])+((o=r[P[1]])-n)*(g=L[0]);if(2==S)return n=r[P[0]],o=r[P[1]],i=r[P[2]],t=r[P[3]],g=L[0],(1-(y=L[1]))*(n+(o-n)*g)+y*(i+(t-i)*g);if(3==S)return e=r[P[0]],o=r[P[1]],n=r[P[2]],t=r[P[3]],i=r[P[4]],s=r[P[5]],a=r[P[6]],_=r[P[7]],g=L[0],y=L[1],(1-(m=L[2]))*((1-y)*(e+(o-e)*g)+y*(n+(t-n)*g))+m*((1-y)*(i+(s-i)*g)+y*(a+(_-a)*g));if(4==S)return o=r[P[0]],e=r[P[1]],t=r[P[2]],n=r[P[3]],s=r[P[4]],i=r[P[5]],_=r[P[6]],a=r[P[7]],h=r[P[8]],l=r[P[9]],$=r[P[10]],u=r[P[11]],p=r[P[12]],c=r[P[13]],f=r[P[14]],d=r[P[15]],g=L[0],y=L[1],m=L[2],(1-(T=L[3]))*((1-m)*((1-y)*(o+(e-o)*g)+y*(t+(n-t)*g))+m*((1-y)*(s+(i-s)*g)+y*(_+(a-_)*g)))+T*((1-m)*((1-y)*(h+(l-h)*g)+y*($+(u-$)*g))+m*((1-y)*(p+(c-p)*g)+y*(f+(d-f)*g)));for(var M=1<<S,E=new Float32Array(M),v=0;v<M;v++){for(var A=v,x=1,I=0;I<S;I++)x*=A%2==0?1-L[I]:L[I],A/=2;E[v]=x}for(var w=new Float32Array(M),O=0;O<M;O++)w[O]=r[P[O]];for(var D=0,O=0;O<M;O++)D+=E[O]*w[O];return D},W._$Vr=function(t,e,i,C,r,o,n,s){var _=e._$Q2(t,i),a=t._$vs(),h=t._$Tr(),l=(e._$zr(a,h,_),2*C),$=n;if(_<=0){var u=r[a[0]];if(2==s&&0==n)Rt._$jT(u,0,o,0,l);else for(var p=0;p<l;)o[$]=u[p++],o[$+1]=u[p++],$+=s}else if(1==_)for(var u=r[a[0]],c=r[a[1]],f=1-(y=h[0]),p=0;p<l;)o[$]=u[p]*f+c[p]*y,o[$+1]=u[++p]*f+c[p]*y,++p,$+=s;else if(2==_)for(var u=r[a[0]],c=r[a[1]],d=r[a[2]],g=r[a[3]],y=h[0],m=1-(A=h[1]),T=m*(f=1-y),S=m*y,P=A*f,L=A*y,p=0;p<l;)o[$]=T*u[p]+S*c[p]+P*d[p]+L*g[p],o[$+1]=T*u[++p]+S*c[p]+P*d[p]+L*g[p],++p,$+=s;else if(3==_)for(var M=r[a[0]],E=r[a[1]],v=r[a[2]],N=r[a[3]],B=r[a[4]],U=r[a[5]],G=r[a[6]],Y=r[a[7]],y=h[0],A=h[1],x=1-(I=h[2]),k=x*(m=1-A)*(f=1-y),V=x*m*y,X=x*A*f,H=x*A*y,z=I*m*f,W=I*m*y,q=I*A*f,j=I*A*y,p=0;p<l;)o[$]=k*M[p]+V*E[p]+X*v[p]+H*N[p]+z*B[p]+W*U[p]+q*G[p]+j*Y[p],o[$+1]=k*M[++p]+V*E[p]+X*v[p]+H*N[p]+z*B[p]+W*U[p]+q*G[p]+j*Y[p],++p,$+=s;else if(4==_)for(var J=r[a[0]],Q=r[a[1]],Z=r[a[2]],K=r[a[3]],tt=r[a[4]],et=r[a[5]],it=r[a[6]],rt=r[a[7]],ot=r[a[8]],nt=r[a[9]],st=r[a[10]],_t=r[a[11]],at=r[a[12]],ht=r[a[13]],lt=r[a[14]],$t=r[a[15]],y=h[0],A=h[1],I=h[2],i=h[3],t=1-i,ut=t*(x=1-I)*(m=1-A)*(f=1-y),pt=t*x*m*y,ct=t*x*A*f,ft=t*x*A*y,dt=t*I*m*f,gt=t*I*m*y,yt=t*I*A*f,mt=t*I*A*y,Tt=i*x*m*f,St=i*x*m*y,Pt=i*x*A*f,Lt=i*x*A*y,Mt=i*I*m*f,Et=i*I*m*y,vt=i*I*A*f,At=i*I*A*y,p=0;p<l;)o[$]=ut*J[p]+pt*Q[p]+ct*Z[p]+ft*K[p]+dt*tt[p]+gt*et[p]+yt*it[p]+mt*rt[p]+Tt*ot[p]+St*nt[p]+Pt*st[p]+Lt*_t[p]+Mt*at[p]+Et*ht[p]+vt*lt[p]+At*$t[p],o[$+1]=ut*J[++p]+pt*Q[p]+ct*Z[p]+ft*K[p]+dt*tt[p]+gt*et[p]+yt*it[p]+mt*rt[p]+Tt*ot[p]+St*nt[p]+Pt*st[p]+Lt*_t[p]+Mt*at[p]+Et*ht[p]+vt*lt[p]+At*$t[p],++p,$+=s;else{for(var w=1<<_,O=new Float32Array(w),D=0;D<w;D++){for(var xt=D,It=1,R=0;R<_;R++)It*=xt%2==0?1-h[R]:h[R],xt/=2;O[D]=It}for(var b=new Float32Array(w),F=0;F<w;F++)b[F]=r[a[F]];for(p=0;p<l;){for(var wt=0,Ot=0,Dt=p+1,F=0;F<w;F++)wt+=O[F]*b[F][p],Ot+=O[F]*b[F][Dt];p+=2,o[$]=wt,o[$+1]=Ot,$+=s}}},q.prototype._$HT=function(t,e){this.x=t,this.y=e},q.prototype._$HT=function(t){this.x=t.x,this.y=t.y},r._$ur=-2,r._$ES=500,r._$wb=2,r._$8S=3,r._$52=r._$ES,r._$R2=r._$ES,r._$or=function(){return r._$52},r._$Pr=function(){return r._$R2},r.prototype.convertClipIDForV2_11=function(t){var e=[];return null==t||0==t.length?null:/,/.test(t)?t.id.split(","):(e.push(t.id),e)},r.prototype._$F0=function(t){this._$gP=t._$nP(),this._$dr=t._$nP(),this._$GS=t._$nP(),this._$qb=t._$6L(),this._$Lb=t._$cS(),this._$mS=t._$Tb(),t.getFormatVersion()>=u._$T7?(this.clipID=t._$nP(),this.clipIDList=this.convertClipIDForV2_11(this.clipID)):this.clipIDList=[],this._$MS(this._$Lb)},r.prototype.getClipIDList=function(){return this.clipIDList},r.prototype.init=function(t){},r.prototype._$Nr=function(t,e){e._$IS[0]=!1,e._$Us=W._$Z2(t,this._$GS,e._$IS,this._$Lb),!ot._$Zs&&e._$IS[0]||(e._$7s=W._$br(t,this._$GS,e._$IS,this._$mS))},r.prototype._$2b=function(t,e){},r.prototype.getDrawDataID=function(){return this._$gP},r.prototype._$j2=function(t){this._$gP=t},r.prototype.getOpacity=function(t,e){return e._$7s},r.prototype._$zS=function(t,e){return e._$Us},r.prototype._$MS=function(t){for(var e=t.length-1;0<=e;--e){var i=t[e];i<r._$52?r._$52=i:r._$R2<i&&(r._$R2=i)}},r.prototype.getTargetBaseDataID=function(){return this._$dr},r.prototype._$gs=function(t){this._$dr=t},r.prototype._$32=function(){return null!=this._$dr&&this._$dr!=v._$2o()},r.prototype.preDraw=function(t,e,i){},r.prototype.draw=function(t,e,i){},r.prototype.getType=function(){},r.prototype._$B2=function(t,e,i){},e._$ps=32,e.CLIPPING_PROCESS_NONE=0,e.CLIPPING_PROCESS_OVERWRITE_ALPHA=1,e.CLIPPING_PROCESS_MULTIPLY_ALPHA=2,e.CLIPPING_PROCESS_DRAW=3,e.CLIPPING_PROCESS_CLEAR_ALPHA=4,e.prototype.setChannelFlagAsColor=function(t,e){this.CHANNEL_COLORS[t]=e},e.prototype.getChannelFlagAsColor=function(t){return this.CHANNEL_COLORS[t]},e.prototype._$ZT=function(){},e.prototype._$Uo=function(t,e,i,r,o,n,s){},e.prototype._$Rs=function(){return-1},e.prototype._$Ds=function(t){},e.prototype.setBaseColor=function(t,e,i,r){t<0?t=0:1<t&&(t=1),e<0?e=0:1<e&&(e=1),i<0?i=0:1<i&&(i=1),r<0?r=0:1<r&&(r=1),this._$lT=t,this._$C0=e,this._$tT=i,this._$WL=r},e.prototype._$WP=function(t){this.culling=t},e.prototype.setMatrix=function(t){for(var e=0;e<16;e++)this.matrix4x4[e]=t[e]},e.prototype._$IT=function(){return this.matrix4x4},e.prototype.setPremultipliedAlpha=function(t){this.premultipliedAlpha=t},e.prototype.isPremultipliedAlpha=function(){return this.premultipliedAlpha},e.prototype.setAnisotropy=function(t){this.anisotropy=t},e.prototype.getAnisotropy=function(){return this.anisotropy},e.prototype.getClippingProcess=function(){return this.clippingProcess},e.prototype.setClippingProcess=function(t){this.clippingProcess=t},e.prototype.setClipBufPre_clipContextForMask=function(t){this.clipBufPre_clipContextMask=t},e.prototype.getClipBufPre_clipContextMask=function(){return this.clipBufPre_clipContextMask},e.prototype.setClipBufPre_clipContextForDraw=function(t){this.clipBufPre_clipContextDraw=t},e.prototype.getClipBufPre_clipContextDraw=function(){return this.clipBufPre_clipContextDraw},a._$ur=-2,a._$c2=1,a._$_b=2,a.prototype._$F0=function(t){this._$kP=t._$nP(),this._$dr=t._$nP()},a.prototype.readV2_opacity=function(t){t.getFormatVersion()>=u.LIVE2D_FORMAT_VERSION_V2_10_SDK2&&(this._$mS=t._$Tb())},a.prototype.init=function(t){},a.prototype._$Nr=function(t,e){},a.prototype.interpolateOpacity=function(t,e,i,r){null==this._$mS?i.setInterpolatedOpacity(1):i.setInterpolatedOpacity(W._$br(t,e,r,this._$mS))},a.prototype._$2b=function(t,e){},a.prototype._$nb=function(t,e,i,r,o,n,s){},a.prototype.getType=function(){},a.prototype._$gs=function(t){this._$dr=t},a.prototype._$a2=function(t){this._$kP=t},a.prototype.getTargetBaseDataID=function(){return this._$dr},a.prototype.getBaseDataID=function(){return this._$kP},a.prototype._$32=function(){return null!=this._$dr&&this._$dr!=v._$2o()},Rt._$CS=Rt._$W2=0,Rt._$Mo=function(){return!0},Rt._$XP=function(t){try{for(var e=getTimeMSec();getTimeMSec()-e<t;);}catch(t){t._$Rb()}},Rt.getUserTimeMSec=function(){return Rt._$CS==Rt._$W2?Rt.getSystemTimeMSec():Rt._$CS},Rt.setUserTimeMSec=function(t){Rt._$CS=t},Rt.updateUserTimeMSec=function(){return Rt._$CS=Rt.getSystemTimeMSec()},Rt.getTimeMSec=function(){return(new Date).getTime()},Rt.getSystemTimeMSec=function(){return(new Date).getTime()},Rt._$Q=function(t){},Rt._$jT=function(t,e,i,r,o){for(var n=0;n<o;n++)i[r+n]=t[e+n]},g._$ds=-2,g.prototype._$F0=function(t){this._$wL=t._$nP(),this._$VP=t._$6L(),this._$GP=t._$nP()},g.prototype.getParamIndex=function(t){return this._$2r!=t&&(this._$8o=g._$ds),this._$8o},g.prototype._$Pb=function(t,e){this._$8o=t,this._$2r=e},g.prototype.getParamID=function(){return this._$wL},g.prototype._$yP=function(t){this._$wL=t},g.prototype._$N2=function(){return this._$VP},g.prototype._$d2=function(){return this._$GP},g.prototype._$t2=function(t,e){this._$VP=t,this._$GP=e},g.prototype._$Lr=function(){return this._$O2},g.prototype._$wr=function(t){this._$O2=t},g.prototype._$SL=function(){return this._$ri},g.prototype._$AL=function(t){this._$ri=t},c.startsWith=function(t,e,i){var r=e+i.length;if(r>=t.length)return!1;for(var o=e;o<r;o++)if(c.getChar(t,o)!=i.charAt(o-e))return!1;return!0},c.getChar=function(t,e){return String.fromCharCode(t.getUint8(e))},c.createString=function(t,e,i){for(var r=new ArrayBuffer(2*i),o=new Uint16Array(r),n=0;n<i;n++)o[n]=t.getUint8(e+n);return String.fromCharCode.apply(null,o)},c._$LS=function(t,e,i,r){t instanceof ArrayBuffer&&(t=new DataView(t));var o=i,i=!1,n=!1,s=0,_=c.getChar(t,o);"-"==_&&(i=!0,o++);for(var a=!1;o<e;o++){switch(_=c.getChar(t,o)){case"0":s*=10;break;case"1":s=10*s+1;break;case"2":s=10*s+2;break;case"3":s=10*s+3;break;case"4":s=10*s+4;break;case"5":s=10*s+5;break;case"6":s=10*s+6;break;case"7":s=10*s+7;break;case"8":s=10*s+8;break;case"9":s=10*s+9;break;case".":o++,a=n=!0;break;default:a=!0}if(a)break}if(n)for(var h=.1,l=!1;o<e;o++){switch(_=c.getChar(t,o)){case"0":break;case"1":s+=+h;break;case"2":s+=2*h;break;case"3":s+=3*h;break;case"4":s+=4*h;break;case"5":s+=5*h;break;case"6":s+=6*h;break;case"7":s+=7*h;break;case"8":s+=8*h;break;case"9":s+=9*h;break;default:l=!0}if(h*=.1,l)break}return i&&(s=-s),r[0]=o,s},J.prototype._$zP=function(){this._$Ob=new Array},J.prototype._$F0=function(t){this._$Ob=t._$nP()},J.prototype._$Ur=function(t){if(t._$WS())return!0;for(var e=t._$v2(),i=this._$Ob.length-1;0<=i;--i){var r=this._$Ob[i].getParamIndex(e);if(r==g._$ds&&(r=t.getParamIndex(this._$Ob[i].getParamID())),t._$Xb(r))return!0}return!1},J.prototype._$Q2=function(t,e){for(var i=this._$Ob.length,r=t._$v2(),o=0,n=0;n<i;n++){var s,_=this._$Ob[n];if((s=_.getParamIndex(r))==g._$ds&&(s=t.getParamIndex(_.getParamID()),_._$Pb(s,r)),s<0)throw new Exception("err 23242 : "+_.getParamID());var a,h,l=s<0?0:t.getParamFloat(s),$=_._$N2(),u=_._$d2(),p=-1,c=0;if(!($<1))if(1==$)(a=u[0])-T._$J<l&&l<a+T._$J?c=p=0:e[p=0]=!0;else if(l<(a=u[0])-T._$J)e[p=0]=!0;else if(l<a+T._$J)p=0;else{for(var f=!1,d=1;d<$;++d){if(l<(h=u[d])+T._$J){h-T._$J<l?p=d:(p=d-1,c=(l-a)/(h-a),o++),f=!0;break}a=h}f||(p=$-1,e[c=0]=!0)}_._$wr(p),_._$AL(c)}return o},J.prototype._$zr=function(t,e,i){var r=1<<i;T._$Qb<1+r&&console.log("err 23245\n");for(var o=this._$Ob.length,n=1,s=1,_=0,a=0;a<r;++a)t[a]=0;for(var h=0;h<o;++h){var l=this._$Ob[h];if(0==l._$SL()){if(($=l._$Lr()*n)<0&&ot._$3T)throw new Exception("err 23246");for(a=0;a<r;++a)t[a]+=$}else{for(var $=n*l._$Lr(),u=n*(l._$Lr()+1),a=0;a<r;++a)t[a]+=(a/s|0)%2==0?$:u;e[_++]=l._$SL(),s*=2}n*=l._$N2()}t[r]=65535,e[_]=-1},J.prototype._$h2=function(t,e,i){for(var r=new Float32Array(e),o=0;o<e;++o)r[o]=i[o];var n=new g;n._$yP(t),n._$t2(e,r),this._$Ob.push(n)},J.prototype._$J2=function(t){for(var e=t,i=this._$Ob.length,r=0;r<i;++r){var o=this._$Ob[r],n=o._$N2(),s=e%o._$N2(),_=o._$d2()[s];console.log("%s[%d]=%7.2f / ",o.getParamID(),s,_),e/=n}console.log("\n")},J.prototype.getParamCount=function(){return this._$Ob.length},J.prototype._$zs=function(){return this._$Ob},i.prototype.identity=function(){for(var t=0;t<16;t++)this.m[t]=t%5==0?1:0},i.prototype.getArray=function(){return this.m},i.prototype.getCopyMatrix=function(){return new Float32Array(this.m)},i.prototype.setMatrix=function(t){if(null!=t&&16==t.length)for(var e=0;e<16;e++)this.m[e]=t[e]},i.prototype.mult=function(t,e,i){return null==e?null:(this==e?this.mult_safe(this.m,t.m,e.m,i):this.mult_fast(this.m,t.m,e.m,i),e)},i.prototype.mult_safe=function(t,e,i,r){if(t==i){var o=new Array(16);this.mult_fast(t,e,o,r);for(var n=15;0<=n;--n)i[n]=o[n]}else this.mult_fast(t,e,i,r)},i.prototype.mult_fast=function(t,e,i,r){r?(i[0]=t[0]*e[0]+t[4]*e[1]+t[8]*e[2],i[4]=t[0]*e[4]+t[4]*e[5]+t[8]*e[6],i[8]=t[0]*e[8]+t[4]*e[9]+t[8]*e[10],i[12]=t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12],i[1]=t[1]*e[0]+t[5]*e[1]+t[9]*e[2],i[5]=t[1]*e[4]+t[5]*e[5]+t[9]*e[6],i[9]=t[1]*e[8]+t[5]*e[9]+t[9]*e[10],i[13]=t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13],i[2]=t[2]*e[0]+t[6]*e[1]+t[10]*e[2],i[6]=t[2]*e[4]+t[6]*e[5]+t[10]*e[6],i[10]=t[2]*e[8]+t[6]*e[9]+t[10]*e[10],i[14]=t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14],i[3]=i[7]=i[11]=0,i[15]=1):(i[0]=t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],i[4]=t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],i[8]=t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],i[12]=t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],i[1]=t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],i[5]=t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],i[9]=t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],i[13]=t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],i[2]=t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],i[6]=t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],i[10]=t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],i[14]=t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],i[3]=t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],i[7]=t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],i[11]=t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],i[15]=t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15])},i.prototype.translate=function(t,e,i){this.m[12]=this.m[0]*t+this.m[4]*e+this.m[8]*i+this.m[12],this.m[13]=this.m[1]*t+this.m[5]*e+this.m[9]*i+this.m[13],this.m[14]=this.m[2]*t+this.m[6]*e+this.m[10]*i+this.m[14],this.m[15]=this.m[3]*t+this.m[7]*e+this.m[11]*i+this.m[15]},i.prototype.scale=function(t,e,i){this.m[0]*=t,this.m[4]*=e,this.m[8]*=i,this.m[1]*=t,this.m[5]*=e,this.m[9]*=i,this.m[2]*=t,this.m[6]*=e,this.m[10]*=i,this.m[3]*=t,this.m[7]*=e,this.m[11]*=i},i.prototype.rotateX=function(t){var e=I.fcos(t),t=I._$9(t),i=this.m[4];this.m[4]=i*e+this.m[8]*t,this.m[8]=i*-t+this.m[8]*e,i=this.m[5],this.m[5]=i*e+this.m[9]*t,this.m[9]=i*-t+this.m[9]*e,i=this.m[6],this.m[6]=i*e+this.m[10]*t,this.m[10]=i*-t+this.m[10]*e,i=this.m[7],this.m[7]=i*e+this.m[11]*t,this.m[11]=i*-t+this.m[11]*e},i.prototype.rotateY=function(t){var e=I.fcos(t),t=I._$9(t),i=this.m[0];this.m[0]=i*e+this.m[8]*-t,this.m[8]=i*t+this.m[8]*e,i=this.m[1],this.m[1]=i*e+this.m[9]*-t,this.m[9]=i*t+this.m[9]*e,i=m[2],this.m[2]=i*e+this.m[10]*-t,this.m[10]=i*t+this.m[10]*e,i=m[3],this.m[3]=i*e+this.m[11]*-t,this.m[11]=i*t+this.m[11]*e},i.prototype.rotateZ=function(t){var e=I.fcos(t),t=I._$9(t),i=this.m[0];this.m[0]=i*e+this.m[4]*t,this.m[4]=i*-t+this.m[4]*e,i=this.m[1],this.m[1]=i*e+this.m[5]*t,this.m[5]=i*-t+this.m[5]*e,i=this.m[2],this.m[2]=i*e+this.m[6]*t,this.m[6]=i*-t+this.m[6]*e,i=this.m[3],this.m[3]=i*e+this.m[7]*t,this.m[7]=i*-t+this.m[7]*e},Q.prototype=new at,Q._$tP=new Object,Q._$27=function(){Q._$tP.clear()},Q.getID=function(t){var e=Q._$tP[t];return null==e&&(e=new Q(t),Q._$tP[t]=e),e},Q.prototype._$3s=function(){return new Q},p._$kS=-1,p._$pS=0,p._$hb=1,p.STATE_IDENTITY=0,p._$gb=1,p._$fo=2,p._$go=4,p.prototype.transform=function(t,e,i){var r,o,n,s,_,a,h=0,l=0;switch(this._$hi){default:return;case p._$go|p._$fo|p._$gb:for(r=this._$7,o=this._$H,n=this._$k,s=this._$f,_=this._$g,a=this._$w;0<=--i;){var $=t[h++],u=t[h++];e[l++]=r*$+o*u+n,e[l++]=s*$+_*u+a}return;case p._$go|p._$fo:for(r=this._$7,o=this._$H,s=this._$f,_=this._$g;0<=--i;){$=t[h++],u=t[h++];e[l++]=r*$+o*u,e[l++]=s*$+_*u}return;case p._$go|p._$gb:for(o=this._$H,n=this._$k,s=this._$f,a=this._$w;0<=--i;){$=t[h++];e[l++]=o*t[h++]+n,e[l++]=s*$+a}return;case p._$go:for(o=this._$H,s=this._$f;0<=--i;){$=t[h++];e[l++]=o*t[h++],e[l++]=s*$}return;case p._$fo|p._$gb:for(r=this._$7,n=this._$k,_=this._$g,a=this._$w;0<=--i;)e[l++]=r*t[h++]+n,e[l++]=_*t[h++]+a;return;case p._$fo:for(r=this._$7,_=this._$g;0<=--i;)e[l++]=r*t[h++],e[l++]=_*t[h++];return;case p._$gb:for(n=this._$k,a=this._$w;0<=--i;)e[l++]=t[h++]+n,e[l++]=t[h++]+a;return;case p.STATE_IDENTITY:return void(t==e&&h==l||Rt._$jT(t,h,e,l,2*i))}},p.prototype.update=function(){0==this._$H&&0==this._$f?1==this._$7&&1==this._$g?0==this._$k&&0==this._$w?(this._$hi=p.STATE_IDENTITY,this._$Z=p._$pS):(this._$hi=p._$gb,this._$Z=p._$hb):(0==this._$k&&0==this._$w?this._$hi=p._$fo:this._$hi=p._$fo|p._$gb,this._$Z=p._$kS):(0==this._$7&&0==this._$g?0==this._$k&&0==this._$w?this._$hi=p._$go:this._$hi=p._$go|p._$gb:0==this._$k&&0==this._$w?this._$hi=p._$go|p._$fo:this._$hi=p._$go|p._$fo|p._$gb,this._$Z=p._$kS)},p.prototype._$RT=function(t){this._$IT(t);var e=t[0],i=t[2],r=t[1],o=t[3],n=Math.sqrt(e*e+r*r),s=e*o-i*r;0==n?ot._$so&&console.log("affine._$RT() / rt==0"):(t[0]=n,t[1]=s/n,t[2]=(r*o+e*i)/s,t[3]=Math.atan2(r,e))},p.prototype._$ho=function(t,e,i,r){var o=new Float32Array(6),n=new Float32Array(6),t=(t._$RT(o),e._$RT(n),new Float32Array(6));t[0]=o[0]+(n[0]-o[0])*i,t[1]=o[1]+(n[1]-o[1])*i,t[2]=o[2]+(n[2]-o[2])*i,t[3]=o[3]+(n[3]-o[3])*i,t[4]=o[4]+(n[4]-o[4])*i,t[5]=o[5]+(n[5]-o[5])*i,r._$CT(t)},p.prototype._$CT=function(t){var e=Math.cos(t[3]),i=Math.sin(t[3]);this._$7=t[0]*e,this._$f=t[0]*i,this._$H=t[1]*(t[2]*e-i),this._$g=t[1]*(t[2]*i+e),this._$k=t[4],this._$w=t[5],this.update()},p.prototype._$IT=function(t){t[0]=this._$7,t[1]=this._$f,t[2]=this._$H,t[3]=this._$g,t[4]=this._$k,t[5]=this._$w},new t,f._$Fr=0,f._$hs=1,f._$ws=100,f._$Ns=101,f._$xs=102,f._$us=103,f._$qs=104,f._$Ys=105,T._$Ms=1,T._$Qs=2,T._$i2=0,T._$No=2,T._$do=T._$Ms,T._$Ls=!0,T._$1r=5,T._$Qb=65,T._$J=1e-4,T._$FT=.001,T._$Ss=3,u._$o7=6,u._$S7=7,u._$s7=8,u._$77=9,u.LIVE2D_FORMAT_VERSION_V2_10_SDK2=10,u._$T7=u.LIVE2D_FORMAT_VERSION_V2_11_SDK2_1=11,u._$Is=-2004318072,u._$h0=0,u._$4L=23,u._$7P=33,u._$uT=function(t){console.log("_$bo :: _$6 _$mo _$E0 : %d\n",t)},u._$9o=function(t){if(!(t<40||t<50||t<60))if(t<100)switch(t){case 65:return new nt;case 66:return new J;case 67:return new g;case 68:return new z;case 69:return new X;case 70:return new M;default:return u._$uT(t),null}else if(t<150)switch(t){case 131:return new lt;case 133:return new l;case 136:return new N;case 137:return new ht;case 142:return new tt}return u._$uT(t),null},d._$HP=0,d._$_0=!0,d._$V2=-1,d._$W0=-1,d._$jr=!1,d._$ZS=!0,d._$tr=-1e6,d._$lr=1e6,d._$is=32,d._$e=!1,d.prototype.getDrawDataIndex=function(t){for(var e=this._$aS.length-1;0<=e;--e)if(null!=this._$aS[e]&&this._$aS[e].getDrawDataID()==t)return e;return-1},d.prototype.getDrawData=function(t){if(t instanceof Q){if(null==this._$Bo){this._$Bo=new Object;for(var e=this._$aS.length,i=0;i<e;i++){var r=this._$aS[i],o=r.getDrawDataID();null!=o&&(this._$Bo[o]=r)}}return this._$Bo[id]}return t<this._$aS.length?this._$aS[t]:null},d.prototype.release=function(){this._$3S.clear(),this._$aS.clear(),this._$F2.clear(),null!=this._$Bo&&this._$Bo.clear(),this._$db.clear(),this._$8b.clear(),this._$Hr.clear()},d.prototype.init=function(){this._$co++,0<this._$F2.length&&this.release();for(var t=this._$Ri.getModelImpl(),e=t._$Xr(),i=e.length,r=new Array,o=new Array,n=0;n<i;++n){var s=e[n];this._$F2.push(s),this._$Hr.push(s.init(this));for(var _=s.getBaseData(),a=_.length,h=0;h<a;++h)r.push(_[h]);for(h=0;h<a;++h){var l=_[h].init(this);l._$l2(n),o.push(l)}for(var $=s.getDrawData(),u=$.length,h=0;h<u;++h){var p=$[h],c=p.init(this);c._$IP=n,this._$aS.push(p),this._$8b.push(c)}}for(var f=r.length,d=v._$2o();;){for(var g=!1,n=0;n<f;++n){var y,m=r[n];null!=m&&(null==(y=m.getTargetBaseDataID())||y==d||0<=this.getBaseDataIndex(y))&&(this._$3S.push(m),this._$db.push(o[n]),g=!(r[n]=null))}if(!g)break}t=t._$E2();if(null!=t){var T=t._$1s();if(null!=T)for(var S=T.length,n=0;n<S;++n){var P=T[n];null!=P&&this._$02(P.getParamID(),P.getDefaultValue(),P.getMinValue(),P.getMaxValue())}}this.clipManager=new L(this.dp_webgl),this.clipManager.init(this,this._$aS,this._$8b),this._$QT=!0},d.prototype.update=function(){d._$e&&it.start("_$zL");for(var t=this._$_2.length,e=0;e<t;e++)this._$_2[e]!=this._$vr[e]&&(this._$Js[e]=d._$ZS,this._$vr[e]=this._$_2[e]);var i=this._$3S.length,r=this._$aS.length,o=y._$or(),n=y._$Pr()-o+1;(null==this._$Ws||this._$Ws.length<n)&&(this._$Ws=new Int16Array(n),this._$Vs=new Int16Array(n));for(e=0;e<n;e++)this._$Ws[e]=d._$V2,this._$Vs[e]=d._$V2;(null==this._$Er||this._$Er.length<r)&&(this._$Er=new Int16Array(r));for(e=0;e<r;e++)this._$Er[e]=d._$W0;d._$e&&it.dump("_$zL"),d._$e&&it.start("_$UL");for(var s=null,_=0;_<i;++_){var a=this._$3S[_],h=this._$db[_];try{a._$Nr(this,h),a._$2b(this,h)}catch(t){null==s&&(s=t)}}null!=s&&d._$_0&&it._$Rb(s),d._$e&&it.dump("_$UL"),d._$e&&it.start("_$DL");for(var l=null,$=0;$<r;++$){var u=this._$aS[$],p=this._$8b[$];try{if(u._$Nr(this,p),!p._$u2()){u._$2b(this,p);var c,f=Math.floor(u._$zS(this,p)-o);try{c=this._$Vs[f]}catch(t){console.log("_$li :: %s / %s \t\t\t\t@@_$fS\n",t.toString(),u.getDrawDataID().toString()),f=Math.floor(u._$zS(this,p)-o);continue}c==d._$V2?this._$Ws[f]=$:this._$Er[c]=$,this._$Vs[f]=$}}catch(t){null==l&&(l=t,ot._$sT(ot._$H7))}}null!=l&&d._$_0&&it._$Rb(l),d._$e&&it.dump("_$DL"),d._$e&&it.start("_$eL");for(e=this._$Js.length-1;0<=e;e--)this._$Js[e]=d._$jr;return this._$QT=!1,d._$e&&it.dump("_$eL"),!1},d.prototype.preDraw=function(t){null!=this.clipManager&&(t._$ZT(),this.clipManager.setupClip(this,t))},d.prototype.draw=function(t){if(null==this._$Ws)it._$li("call _$Ri.update() before _$Ri.draw() ");else{var e=this._$Ws.length;t._$ZT();for(var i=0;i<e;++i){var r=this._$Ws[i];if(r!=d._$V2)for(;;){var o=this._$aS[r],n=this._$8b[r],s=(n._$yo()&&(s=n._$IP,s=this._$Hr[s],n._$VS=s.getPartsOpacity(),o.draw(t,this,n)),this._$Er[r]);if(s<=r||s==d._$W0)break;r=s}}}},d.prototype.getParamIndex=function(t){for(var e=this._$pb.length-1;0<=e;--e)if(this._$pb[e]==t)return e;return this._$02(t,0,d._$tr,d._$lr)},d.prototype._$BS=function(t){return this.getBaseDataIndex(t)},d.prototype.getBaseDataIndex=function(t){for(var e=this._$3S.length-1;0<=e;--e)if(null!=this._$3S[e]&&this._$3S[e].getBaseDataID()==t)return e;return-1},d.prototype._$UT=function(t,e){e=new Float32Array(e);return Rt._$jT(t,0,e,0,t.length),e},d.prototype._$02=function(t,e,i,r){var o,n;return this._$qo>=this._$pb.length&&(o=this._$pb.length,n=new Array(2*o),Rt._$jT(this._$pb,0,n,0,o),this._$pb=n,this._$_2=this._$UT(this._$_2,2*o),this._$vr=this._$UT(this._$vr,2*o),this._$Rr=this._$UT(this._$Rr,2*o),this._$Or=this._$UT(this._$Or,2*o),n=new Array,Rt._$jT(this._$Js,0,n,0,o),this._$Js=n),this._$pb[this._$qo]=t,this._$_2[this._$qo]=e,this._$vr[this._$qo]=e,this._$Rr[this._$qo]=i,this._$Or[this._$qo]=r,this._$Js[this._$qo]=d._$ZS,this._$qo++},d.prototype._$Zo=function(t,e){this._$3S[t]=e},d.prototype.setParamFloat=function(t,e){(e=e<this._$Rr[t]?this._$Rr[t]:e)>this._$Or[t]&&(e=this._$Or[t]),this._$_2[t]=e},d.prototype.loadParam=function(){var t=this._$_2.length;t>this._$fs.length&&(t=this._$fs.length),Rt._$jT(this._$fs,0,this._$_2,0,t)},d.prototype.saveParam=function(){var t=this._$_2.length;t>this._$fs.length&&(this._$fs=new Float32Array(t)),Rt._$jT(this._$_2,0,this._$fs,0,t)},d.prototype._$v2=function(){return this._$co},d.prototype._$WS=function(){return this._$QT},d.prototype._$Xb=function(t){return this._$Js[t]==d._$ZS},d.prototype._$vs=function(){return this._$Es},d.prototype._$Tr=function(){return this._$ZP},d.prototype.getBaseData=function(t){return this._$3S[t]},d.prototype.getParamFloat=function(t){return this._$_2[t]},d.prototype.getParamMax=function(t){return this._$Or[t]},d.prototype.getParamMin=function(t){return this._$Rr[t]},d.prototype.setPartsOpacity=function(t,e){this._$Hr[t].setPartsOpacity(e)},d.prototype.getPartsOpacity=function(t){return this._$Hr[t].getPartsOpacity()},d.prototype.getPartsDataIndex=function(t){for(var e=this._$F2.length-1;0<=e;--e)if(null!=this._$F2[e]&&this._$F2[e]._$p2()==t)return e;return-1},d.prototype._$q2=function(t){return this._$db[t]},d.prototype._$C2=function(t){return this._$8b[t]},d.prototype._$Bb=function(t){return this._$Hr[t]},d.prototype._$5s=function(t,e){for(var i=this._$Ws.length,r=t,o=0;o<i;++o){var n=this._$Ws[o];if(n!=d._$V2)for(;;){var s=this._$8b[n],s=(s._$yo()&&(s._$GT()._$B2(this,s,r),r+=e),this._$Er[n]);if(s<=n||s==d._$W0)break;n=s}}},d.prototype.setDrawParam=function(t){this.dp_webgl=t},d.prototype.getDrawParam=function(){return this.dp_webgl},Z._$0T=function(t){return Z._$0T(new _$5(t))},Z._$0T=function(t){if(!t.exists())throw new _$ls(t._$3b());for(var e,i=t.length(),r=new Int8Array(i),o=new _$Xs(new _$kb(t),8192),n=0;0<(e=o.read(r,n,i-n));)n+=e;return r},Z._$C=function(t){var e=null,i=null;try{for(var r,e=t instanceof Array?t:new _$Xs(t,8192),i=new _$js,o=new Int8Array(1e3);0<(r=e.read(o));)i.write(o,0,r);return i._$TS()}finally{null!=t&&t.close(),null!=i&&(i.flush(),i.close())}},(Pt=function(){}).STATE_FIRST="STATE_FIRST",Pt.STATE_INTERVAL="STATE_INTERVAL",Pt.STATE_CLOSING="STATE_CLOSING",Pt.STATE_CLOSED="STATE_CLOSED",Pt.STATE_OPENING="STATE_OPENING",o.prototype=new e,o._$As=32,o._$Gr=!1,o._$NT=null,o._$vS=null,o._$no=null,o._$9r=function(t){return new Float32Array(t)},o._$vb=function(t){return new Int16Array(t)},o._$cr=function(t,e){return null==t||t._$yL()<e.length?t=o._$9r(2*e.length):t.clear(),t.put(e),t._$oT(0),t},o._$mb=function(t,e){return null==t||t._$yL()<e.length?t=o._$vb(2*e.length):t.clear(),t.put(e),t._$oT(0),t},o._$Hs=function(){return o._$Gr},o._$as=function(t){o._$Gr=t},o.prototype.setGL=function(t){this.gl=t},o.prototype.setTransform=function(t){this.transform=t},o.prototype._$ZT=function(){},o.prototype._$Uo=function(t,e,i,r,o,n,s,_){n<.01||(t=this._$U2[t],this.gl.drawElements(t,i,r,o,n,.9<n?ot.EXPAND_W:0,this.transform,_))},o.prototype._$Rs=function(){throw new Error("_$Rs")},o.prototype._$Ds=function(t){throw new Error("_$Ds")},o.prototype._$K2=function(){for(var t=0;t<this._$sb.length;t++)0!=this._$sb[t]&&(this.gl._$Sr(1,this._$sb,t),this._$sb[t]=0)},o.prototype.setTexture=function(t,e){this._$sb.length<t+1&&this._$nS(t),this._$sb[t]=e},o.prototype.setTexture=function(t,e){this._$sb.length<t+1&&this._$nS(t),this._$U2[t]=e},o.prototype._$nS=function(t){t=Math.max(2*this._$sb.length,t+1+10),t=new Int32Array(t),Rt._$jT(this._$sb,0,t,0,this._$sb.length),this._$sb=t,t=new Array;Rt._$jT(this._$U2,0,t,0,this._$U2.length),this._$U2=t},z.prototype=new a,z._$Xo=new Float32Array(2),z._$io=new Float32Array(2),z._$0o=new Float32Array(2),z._$Lo=new Float32Array(2),z._$To=new Float32Array(2),z._$Po=new Float32Array(2),z._$gT=new Array,z.prototype._$zP=function(){this._$GS=new J,this._$GS._$zP(),this._$Y0=new Array},z.prototype.getType=function(){return a._$c2},z.prototype._$F0=function(t){a.prototype._$F0.call(this,t),this._$GS=t._$nP(),this._$Y0=t._$nP(),a.prototype.readV2_opacity.call(this,t)},z.prototype.init=function(t){var e=new K(this);return e._$Yr=new X,this._$32()&&(e._$Wr=new X),e},z.prototype._$Nr=function(t,e){this!=e._$GT()&&console.log("### assert!! ### ");var i=e;if(this._$GS._$Ur(t)){var r=z._$gT,o=(r[0]=!1,this._$GS._$Q2(t,r)),n=(e._$Ib(r[0]),this.interpolateOpacity(t,this._$GS,e,r),t._$vs()),s=t._$Tr();if(this._$GS._$zr(n,s,o),o<=0){var _=this._$Y0[n[0]];i._$Yr.init(_)}else if(1==o){var _=this._$Y0[n[0]],a=this._$Y0[n[1]],h=s[0];i._$Yr._$fL=_._$fL+(a._$fL-_._$fL)*h,i._$Yr._$gL=_._$gL+(a._$gL-_._$gL)*h,i._$Yr._$B0=_._$B0+(a._$B0-_._$B0)*h,i._$Yr._$z0=_._$z0+(a._$z0-_._$z0)*h,i._$Yr._$qT=_._$qT+(a._$qT-_._$qT)*h}else if(2==o){var _=this._$Y0[n[0]],a=this._$Y0[n[1]],e=this._$Y0[n[2]],r=this._$Y0[n[3]],h=s[0],l=s[1],$=_._$fL+(a._$fL-_._$fL)*h,u=e._$fL+(r._$fL-e._$fL)*h;i._$Yr._$fL=$+(u-$)*l,$=_._$gL+(a._$gL-_._$gL)*h,u=e._$gL+(r._$gL-e._$gL)*h,i._$Yr._$gL=$+(u-$)*l,$=_._$B0+(a._$B0-_._$B0)*h,u=e._$B0+(r._$B0-e._$B0)*h,i._$Yr._$B0=$+(u-$)*l,$=_._$z0+(a._$z0-_._$z0)*h,u=e._$z0+(r._$z0-e._$z0)*h,i._$Yr._$z0=$+(u-$)*l,$=_._$qT+(a._$qT-_._$qT)*h,u=e._$qT+(r._$qT-e._$qT)*h,i._$Yr._$qT=$+(u-$)*l}else if(3==o){var t=this._$Y0[n[0]],a=this._$Y0[n[1]],r=this._$Y0[n[2]],e=this._$Y0[n[3]],p=this._$Y0[n[4]],c=this._$Y0[n[5]],f=this._$Y0[n[6]],d=this._$Y0[n[7]],h=s[0],l=s[1],g=s[2],$=t._$fL+(a._$fL-t._$fL)*h,u=r._$fL+(e._$fL-r._$fL)*h,y=p._$fL+(c._$fL-p._$fL)*h,m=f._$fL+(d._$fL-f._$fL)*h;i._$Yr._$fL=(1-g)*($+(u-$)*l)+g*(y+(m-y)*l),$=t._$gL+(a._$gL-t._$gL)*h,u=r._$gL+(e._$gL-r._$gL)*h,y=p._$gL+(c._$gL-p._$gL)*h,m=f._$gL+(d._$gL-f._$gL)*h,i._$Yr._$gL=(1-g)*($+(u-$)*l)+g*(y+(m-y)*l),$=t._$B0+(a._$B0-t._$B0)*h,u=r._$B0+(e._$B0-r._$B0)*h,y=p._$B0+(c._$B0-p._$B0)*h,m=f._$B0+(d._$B0-f._$B0)*h,i._$Yr._$B0=(1-g)*($+(u-$)*l)+g*(y+(m-y)*l),$=t._$z0+(a._$z0-t._$z0)*h,u=r._$z0+(e._$z0-r._$z0)*h,y=p._$z0+(c._$z0-p._$z0)*h,m=f._$z0+(d._$z0-f._$z0)*h,i._$Yr._$z0=(1-g)*($+(u-$)*l)+g*(y+(m-y)*l),$=t._$qT+(a._$qT-t._$qT)*h,u=r._$qT+(e._$qT-r._$qT)*h,y=p._$qT+(c._$qT-p._$qT)*h,m=f._$qT+(d._$qT-f._$qT)*h,i._$Yr._$qT=(1-g)*($+(u-$)*l)+g*(y+(m-y)*l)}else if(4==o){var a=this._$Y0[n[0]],t=this._$Y0[n[1]],e=this._$Y0[n[2]],r=this._$Y0[n[3]],c=this._$Y0[n[4]],p=this._$Y0[n[5]],d=this._$Y0[n[6]],f=this._$Y0[n[7]],T=this._$Y0[n[8]],S=this._$Y0[n[9]],P=this._$Y0[n[10]],L=this._$Y0[n[11]],M=this._$Y0[n[12]],E=this._$Y0[n[13]],v=this._$Y0[n[14]],A=this._$Y0[n[15]],h=s[0],l=s[1],g=s[2],x=s[3],$=a._$fL+(t._$fL-a._$fL)*h,u=e._$fL+(r._$fL-e._$fL)*h,y=c._$fL+(p._$fL-c._$fL)*h,m=d._$fL+(f._$fL-d._$fL)*h,I=T._$fL+(S._$fL-T._$fL)*h,w=P._$fL+(L._$fL-P._$fL)*h,O=M._$fL+(E._$fL-M._$fL)*h,D=v._$fL+(A._$fL-v._$fL)*h;i._$Yr._$fL=(1-x)*((1-g)*($+(u-$)*l)+g*(y+(m-y)*l))+x*((1-g)*(I+(w-I)*l)+g*(O+(D-O)*l)),$=a._$gL+(t._$gL-a._$gL)*h,u=e._$gL+(r._$gL-e._$gL)*h,y=c._$gL+(p._$gL-c._$gL)*h,m=d._$gL+(f._$gL-d._$gL)*h,I=T._$gL+(S._$gL-T._$gL)*h,w=P._$gL+(L._$gL-P._$gL)*h,O=M._$gL+(E._$gL-M._$gL)*h,D=v._$gL+(A._$gL-v._$gL)*h,i._$Yr._$gL=(1-x)*((1-g)*($+(u-$)*l)+g*(y+(m-y)*l))+x*((1-g)*(I+(w-I)*l)+g*(O+(D-O)*l)),$=a._$B0+(t._$B0-a._$B0)*h,u=e._$B0+(r._$B0-e._$B0)*h,y=c._$B0+(p._$B0-c._$B0)*h,m=d._$B0+(f._$B0-d._$B0)*h,I=T._$B0+(S._$B0-T._$B0)*h,w=P._$B0+(L._$B0-P._$B0)*h,O=M._$B0+(E._$B0-M._$B0)*h,D=v._$B0+(A._$B0-v._$B0)*h,i._$Yr._$B0=(1-x)*((1-g)*($+(u-$)*l)+g*(y+(m-y)*l))+x*((1-g)*(I+(w-I)*l)+g*(O+(D-O)*l)),$=a._$z0+(t._$z0-a._$z0)*h,u=e._$z0+(r._$z0-e._$z0)*h,y=c._$z0+(p._$z0-c._$z0)*h,m=d._$z0+(f._$z0-d._$z0)*h,I=T._$z0+(S._$z0-T._$z0)*h,w=P._$z0+(L._$z0-P._$z0)*h,O=M._$z0+(E._$z0-M._$z0)*h,D=v._$z0+(A._$z0-v._$z0)*h,i._$Yr._$z0=(1-x)*((1-g)*($+(u-$)*l)+g*(y+(m-y)*l))+x*((1-g)*(I+(w-I)*l)+g*(O+(D-O)*l)),$=a._$qT+(t._$qT-a._$qT)*h,u=e._$qT+(r._$qT-e._$qT)*h,y=c._$qT+(p._$qT-c._$qT)*h,m=d._$qT+(f._$qT-d._$qT)*h,I=T._$qT+(S._$qT-T._$qT)*h,w=P._$qT+(L._$qT-P._$qT)*h,O=M._$qT+(E._$qT-M._$qT)*h,D=v._$qT+(A._$qT-v._$qT)*h,i._$Yr._$qT=(1-x)*((1-g)*($+(u-$)*l)+g*(y+(m-y)*l))+x*((1-g)*(I+(w-I)*l)+g*(O+(D-O)*l))}else{for(var C=0|Math.pow(2,o),R=new Float32Array(C),N=0;N<C;N++){for(var B=N,U=1,G=0;G<o;G++)U*=B%2==0?1-s[G]:s[G],B/=2;R[N]=U}for(var b=new Array,F=0;F<C;F++)b[F]=this._$Y0[n[F]];for(var Y=0,k=0,V=0,X=0,H=0,F=0;F<C;F++)Y+=R[F]*b[F]._$fL,k+=R[F]*b[F]._$gL,V+=R[F]*b[F]._$B0,X+=R[F]*b[F]._$z0,H+=R[F]*b[F]._$qT;i._$Yr._$fL=Y,i._$Yr._$gL=k,i._$Yr._$B0=V,i._$Yr._$z0=X,i._$Yr._$qT=H}_=this._$Y0[n[0]];i._$Yr.reflectX=_.reflectX,i._$Yr.reflectY=_.reflectY}},z.prototype._$2b=function(t,e){this!=e._$GT()&&console.log("### assert!! ### ");var i,r,o,n,s;e._$hS(!0),this._$32()?(s=this.getTargetBaseDataID(),e._$8r==a._$ur&&(e._$8r=t.getBaseDataIndex(s)),e._$8r<0?(ot._$so&&it._$li("_$L _$0P _$G :: %s",s),e._$hS(!1)):null!=(s=t.getBaseData(e._$8r))?(i=t._$q2(e._$8r),(r=z._$Xo)[0]=e._$Yr._$fL,r[1]=e._$Yr._$gL,(o=z._$io)[0]=0,o[1]=-.1,i._$GT().getType()==a._$c2?o[1]=-10:o[1]=-.1,this._$Jr(t,s,i,r,o,n=z._$0o),o=I._$92(o,n),s._$nb(t,i,r,r,1,0,2),e._$Wr._$fL=r[0],e._$Wr._$gL=r[1],e._$Wr._$B0=e._$Yr._$B0,e._$Wr._$z0=e._$Yr._$z0,e._$Wr._$qT=e._$Yr._$qT-o*I._$NS,n=i.getTotalScale(),e.setTotalScale_notForClient(n*e._$Wr._$B0),s=i.getTotalOpacity(),e.setTotalOpacity(s*e.getInterpolatedOpacity()),e._$Wr.reflectX=e._$Yr.reflectX,e._$Wr.reflectY=e._$Yr.reflectY,e._$hS(i._$yo())):e._$hS(!1)):(e.setTotalScale_notForClient(e._$Yr._$B0),e.setTotalOpacity(e.getInterpolatedOpacity()))},z.prototype._$nb=function(t,e,i,r,o,n,s){this!=e._$GT()&&console.log("### assert!! ### ");for(var _,a,h=null!=e._$Wr?e._$Wr:e._$Yr,l=Math.sin(I._$bS*h._$qT),$=Math.cos(I._$bS*h._$qT),e=e.getTotalScale(),u=h.reflectX?-1:1,p=h.reflectY?-1:1,c=$*e*u,f=-l*e*p,d=l*e*u,g=$*e*p,y=h._$fL,m=h._$gL,T=o*s,S=n;S<T;S+=s)_=i[S],a=i[S+1],r[S]=c*_+f*a+y,r[S+1]=d*_+g*a+m},z.prototype._$Jr=function(t,e,i,r,o,n){e!=i._$GT()&&console.log("### assert!! ### ");var s=z._$Lo;z._$Lo[0]=r[0],z._$Lo[1]=r[1],e._$nb(t,i,s,s,1,0,2);for(var _=z._$To,a=z._$Po,h=1,l=0;l<10;l++){if(a[0]=r[0]+h*o[0],a[1]=r[1]+h*o[1],e._$nb(t,i,a,_,1,0,2),_[0]-=s[0],_[1]-=s[1],0!=_[0]||0!=_[1])return n[0]=_[0],void(n[1]=_[1]);if(a[0]=r[0]-h*o[0],a[1]=r[1]-h*o[1],e._$nb(t,i,a,_,1,0,2),_[0]-=s[0],_[1]-=s[1],0!=_[0]||0!=_[1])return _[0]=-_[0],_[0]=-_[0],n[0]=_[0],void(n[1]=_[1]);h*=.1}ot._$so&&console.log("_$L0 to transform _$SP\n")},K.prototype=new P,y.prototype=new r,y._$ur=-2,y._$ES=500,y._$wb=2,y._$8S=3,y._$os=4,y._$52=y._$ES,y._$R2=y._$ES,y._$Sb=function(t){for(var e=t.length-1;0<=e;--e){var i=t[e];i<y._$52?y._$52=i:y._$R2<i&&(y._$R2=i)}},y._$or=function(){return y._$52},y._$Pr=function(){return y._$R2},y.prototype._$F0=function(t){this._$gP=t._$nP(),this._$dr=t._$nP(),this._$GS=t._$nP(),this._$qb=t._$6L(),this._$Lb=t._$cS(),this._$mS=t._$Tb(),t.getFormatVersion()>=u._$T7?(this.clipID=t._$nP(),this.clipIDList=this.convertClipIDForV2_11(this.clipID)):this.clipIDList=null,y._$Sb(this._$Lb)},y.prototype.getClipIDList=function(){return this.clipIDList},y.prototype._$Nr=function(t,e){e._$IS[0]=!1,e._$Us=W._$Z2(t,this._$GS,e._$IS,this._$Lb),!ot._$Zs&&e._$IS[0]||(e._$7s=W._$br(t,this._$GS,e._$IS,this._$mS))},y.prototype._$2b=function(t){},y.prototype.getDrawDataID=function(){return this._$gP},y.prototype._$j2=function(t){this._$gP=t},y.prototype.getOpacity=function(t,e){return e._$7s},y.prototype._$zS=function(t,e){return e._$Us},y.prototype.getTargetBaseDataID=function(){return this._$dr},y.prototype._$gs=function(t){this._$dr=t},y.prototype._$32=function(){return null!=this._$dr&&this._$dr!=v._$2o()},y.prototype.getType=function(){},tt._$42=0,tt.prototype._$1b=function(){return this._$3S},tt.prototype.getDrawDataList=function(){return this._$aS},tt.prototype._$F0=function(t){this._$NL=t._$nP(),this._$aS=t._$nP(),this._$3S=t._$nP()},tt.prototype._$kr=function(t){t._$Zo(this._$3S),t._$xo(this._$aS),this._$3S=null,this._$aS=null},h.prototype=new $,h.loadModel=function(t){var e=new h;return $._$62(e,t),e},h.loadModel=function(t){var e=new h;return $._$62(e,t),e},h._$to=function(){return new h},h._$er=function(t){var e=new _$5("../_$_r/_$t0/_$Ri/_$_P._$d");if(0==e.exists())throw new _$ls("_$t0 _$_ _$6 _$Ui :: "+e._$PL());for(var i=["../_$_r/_$t0/_$Ri/_$_P.512/_$CP._$1","../_$_r/_$t0/_$Ri/_$_P.512/_$vP._$1","../_$_r/_$t0/_$Ri/_$_P.512/_$EP._$1","../_$_r/_$t0/_$Ri/_$_P.512/_$pP._$1"],r=h.loadModel(e._$3b()),o=0;o<i.length;o++){var n=new _$5(i[o]);if(0==n.exists())throw new _$ls("_$t0 _$_ _$6 _$Ui :: "+n._$PL());r.setTexture(o,_$nL._$_o(t,n._$3b()))}return r},h.prototype.setGL=function(t){this._$zo.setGL(t)},h.prototype.setTransform=function(t){this._$zo.setTransform(t)},h.prototype.draw=function(){this._$5S.draw(this._$zo)},h.prototype._$K2=function(){this._$zo._$K2()},h.prototype.setTexture=function(t,e){null==this._$zo&&it._$li("_$Yi for QT _$ki / _$XS() is _$6 _$ui!!"),this._$zo.setTexture(t,e)},h.prototype.setTexture=function(t,e){null==this._$zo&&it._$li("_$Yi for QT _$ki / _$XS() is _$6 _$ui!!"),this._$zo.setTexture(t,e)},h.prototype._$Rs=function(){return this._$zo._$Rs()},h.prototype._$Ds=function(t){this._$zo._$Ds(t)},h.prototype.getDrawParam=function(){return this._$zo},S.prototype=new t,S._$cs="VISIBLE:",S._$ar="LAYOUT:",S.MTN_PREFIX_FADEIN="FADEIN:",S.MTN_PREFIX_FADEOUT="FADEOUT:",S._$Co=0,S._$1T=1,S.loadMotion=function(t){t=Z._$C(t);return S.loadMotion(t)},S.loadMotion=function(t){t instanceof ArrayBuffer&&(t=new DataView(t));for(var e=new S,i=[0],r=t.byteLength,o=e._$yT=0;o<r;++o){var n=et(t,o),s=n.charCodeAt(0);if("\n"!=n&&"\r"!=n)if("#"!=n)if("$"!=n){if(97<=s&&s<=122||65<=s&&s<=90||"_"==n){for(var _=o,a=-1;o<r&&"\r"!=(n=et(t,o))&&"\n"!=n;++o)if("="==n){a=o;break}if(0<=a){for(var s=new f,h=(c.startsWith(t,_,S._$cs)?(s._$RP=f._$hs,s._$4P=c.createString(t,_,a-_)):c.startsWith(t,_,S._$ar)?(s._$4P=c.createString(t,_+7,a-_-7),c.startsWith(t,_+7,"ANCHOR_X")?s._$RP=f._$xs:c.startsWith(t,_+7,"ANCHOR_Y")?s._$RP=f._$us:c.startsWith(t,_+7,"SCALE_X")?s._$RP=f._$qs:c.startsWith(t,_+7,"SCALE_Y")?s._$RP=f._$Ys:c.startsWith(t,_+7,"X")?s._$RP=f._$ws:c.startsWith(t,_+7,"Y")&&(s._$RP=f._$Ns)):(s._$RP=f._$Fr,s._$4P=c.createString(t,_,a-_)),e.motions.push(s),0),l=[],o=a+1;o<r&&"\r"!=(n=et(t,o))&&"\n"!=n;++o)if(","!=n&&" "!=n&&"\t"!=n){var $=c._$LS(t,r,o,i);if(0<i[0]){l.push($),h++;var u=i[0];if(u<o){console.log("_$n0 _$hi . @Live2DMotion loadMotion()\n");break}o=u-1}}s._$I0=new Float32Array(l),h>e._$yT&&(e._$yT=h)}}}else{for(_=o,a=-1;o<r&&"\r"!=(n=et(t,o))&&"\n"!=n;++o)if("="==n){a=o;break}var p=!1;if(0<=a)for(a==_+4&&"f"==et(t,_+1)&&"p"==et(t,_+2)&&"s"==et(t,_+3)&&(p=!0),o=a+1;o<r&&"\r"!=(n=et(t,o))&&"\n"!=n;++o)","!=n&&" "!=n&&"\t"!=n&&($=c._$LS(t,r,o,i),0<i[0]&&p&&5<$&&$<121&&(e._$D0=$),o=i[0]);for(;o<r&&"\n"!=et(t,o)&&"\r"!=et(t,o);++o);}else for(;o<r&&"\n"!=et(t,o)&&"\r"!=et(t,o);++o);}return e._$rr=1e3*e._$yT/e._$D0|0,e},S.prototype.getDurationMSec=function(){return this._$E?-1:this._$rr},S.prototype.getLoopDurationMSec=function(){return this._$rr},S.prototype.dump=function(){for(var t=0;t<this.motions.length;t++){var e=this.motions[t];console.log("_$wL[%s] [%d]. ",e._$4P,e._$I0.length);for(var i=0;i<e._$I0.length&&i<10;i++)console.log("%5.2f ,",e._$I0[i]);console.log("\n")}},S.prototype.updateParamExe=function(t,e,i,r){for(var o=(e-r._$z2)*this._$D0/1e3,n=0|o,s=o-n,_=0;_<this.motions.length;_++){var a,h,l,$,u=this.motions[_],p=u._$I0.length,c=u._$4P;u._$RP==f._$hs?(a=u._$I0[p<=n?p-1:n],t.setParamFloat(c,a)):f._$ws<=u._$RP&&u._$RP<=f._$Ys||(a=t.getParamIndex(c),h=.4*((l=t.getModelContext()).getParamMax(a)-l.getParamMin(a)),l=l.getParamFloat(a),$=u._$I0[p<=n?p-1:n],u=u._$I0[p<=1+n?p-1:1+n],t.setParamFloat(c,l+(($<u&&h<u-$||u<$&&h<$-u?$:$+(u-$)*s)-l)*i))}n>=this._$yT&&(this._$E?(r._$z2=e,this.loopFadeIn&&(r._$bs=e)):r._$9L=!0),this._$eP=i},S.prototype._$r0=function(){return this._$E},S.prototype._$aL=function(t){this._$E=t},S.prototype._$S0=function(){return this._$D0},S.prototype._$U0=function(t){this._$D0=t},S.prototype.isLoopFadeIn=function(){return this.loopFadeIn},S.prototype.setLoopFadeIn=function(t){this.loopFadeIn=t},f._$Fr=0,f._$hs=1,f._$ws=100,f._$Ns=101,f._$xs=102,f._$us=103,f._$qs=104,f._$Ys=105,nt.prototype=new a,nt._$gT=new Array,nt.prototype._$zP=function(){this._$GS=new J,this._$GS._$zP()},nt.prototype._$F0=function(t){a.prototype._$F0.call(this,t),this._$A=t._$6L(),this._$o=t._$6L(),this._$GS=t._$nP(),this._$Eo=t._$nP(),a.prototype.readV2_opacity.call(this,t)},nt.prototype.init=function(t){var e=new st(this),i=(this._$o+1)*(this._$A+1);return null!=e._$Cr&&(e._$Cr=null),e._$Cr=new Float32Array(2*i),null!=e._$hr&&(e._$hr=null),this._$32()?e._$hr=new Float32Array(2*i):e._$hr=null,e},nt.prototype._$Nr=function(t,e){var i,r,o=e;this._$GS._$Ur(t)&&(i=this._$VT(),(r=nt._$gT)[0]=!1,W._$Vr(t,this._$GS,r,i,this._$Eo,o._$Cr,0,2),e._$Ib(r[0]),this.interpolateOpacity(t,this._$GS,e,r))},nt.prototype._$2b=function(t,e){var i,r,o;e._$hS(!0),this._$32()?(i=this.getTargetBaseDataID(),e._$8r==a._$ur&&(e._$8r=t.getBaseDataIndex(i)),e._$8r<0?(ot._$so&&it._$li("_$L _$0P _$G :: %s",i),e._$hS(!1)):(i=t.getBaseData(e._$8r),r=t._$q2(e._$8r),null!=i&&r._$yo()?(o=r.getTotalScale(),e.setTotalScale_notForClient(o),o=r.getTotalOpacity(),e.setTotalOpacity(o*e.getInterpolatedOpacity()),i._$nb(t,r,e._$Cr,e._$hr,this._$VT(),0,2),e._$hS(!0)):e._$hS(!1))):e.setTotalOpacity(e.getInterpolatedOpacity())},nt.prototype._$nb=function(t,e,i,r,o,n,s){e=null!=e._$hr?e._$hr:e._$Cr;nt.transformPoints_sdk2(i,r,o,n,s,e,this._$o,this._$A)},nt.transformPoints_sdk2=function(t,e,C,N,B,i,r,o){for(var U=C*B,n=0,s=0,_=0,a=0,h=0,l=0,G=!1,$=N;$<U;$+=B){var u,p,c,f,d,g,y,m,T,S,P,L,M,E,v,A,x,I,w,O,D,R,b=t[$],F=(p=t[$+1])*o;(u=b*r)<0||F<0||r<=u||o<=F?(c=r+1,G||(G=!0,n=.25*(i[2*(0+0*c)]+i[2*(r+0*c)]+i[2*(0+o*c)]+i[2*(r+o*c)]),s=.25*(i[2*(0+0*c)+1]+i[2*(r+0*c)+1]+i[2*(0+o*c)+1]+i[2*(r+o*c)+1]),g=i[2*(r+o*c)]-i[2*(0+0*c)],f=i[2*(r+o*c)+1]-i[2*(0+0*c)+1],n-=.5*((_=.5*(g+(d=i[2*(r+0*c)]-i[2*(0+o*c)])))+(h=.5*(g-d))),s-=.5*((a=.5*(f+(g=i[2*(r+0*c)+1]-i[2*(0+o*c)+1])))+(l=.5*(f-g)))),-2<b&&b<3&&-2<p&&p<3?b<=0?p<=0?(D=i[2*(0+0*c)],R=i[2*(0+0*c)+1],x=n-2*h,I=s-2*l,v=(w=n-2*_)-2*h,A=(O=s-2*a)-2*l,(P=.5*(b- -2))+(L=.5*(p- -2))<=1?(e[$]=v+(x-v)*P+(w-v)*L,e[$+1]=A+(I-A)*P+(O-A)*L):(e[$]=D+(w-D)*(1-P)+(x-D)*(1-L),e[$+1]=R+(O-R)*(1-P)+(I-R)*(1-L))):1<=p?(x=i[2*(0+o*c)],I=i[2*(0+o*c)+1],v=n-2*_+ +h,A=s-2*a+ +l,D=n+3*h,R=s+3*l,w=n-2*_+3*h,O=s-2*a+3*l,(P=.5*(b- -2))+(L=.5*(p-1))<=1?(e[$]=v+(x-v)*P+(w-v)*L,e[$+1]=A+(I-A)*P+(O-A)*L):(e[$]=D+(w-D)*(1-P)+(x-D)*(1-L),e[$+1]=R+(O-R)*(1-P)+(I-R)*(1-L))):(L=F-(y=(y=0|F)==o?o-1:y),x=i[2*(0+y*c)],I=i[2*(0+y*c)+1],D=i[2*(0+(y+1)*c)],R=i[2*(0+(y+1)*c)+1],v=n-2*_+(m=y/o)*h,A=s-2*a+m*l,w=n-2*_+(T=(y+1)/o)*h,O=s-2*a+T*l,(P=.5*(b- -2))+L<=1?(e[$]=v+(x-v)*P+(w-v)*L,e[$+1]=A+(I-A)*P+(O-A)*L):(e[$]=D+(w-D)*(1-P)+(x-D)*(1-L),e[$+1]=R+(O-R)*(1-P)+(I-R)*(1-L))):1<=b?p<=0?(w=i[2*(r+0*c)],O=i[2*(r+0*c)+1],v=n+ +_-2*h,A=s+ +a-2*l,x=(D=n+3*_)-2*h,I=(R=s+3*a)-2*l,(P=.5*(b-1))+(L=.5*(p- -2))<=1?(e[$]=v+(x-v)*P+(w-v)*L,e[$+1]=A+(I-A)*P+(O-A)*L):(e[$]=D+(w-D)*(1-P)+(x-D)*(1-L),e[$+1]=R+(O-R)*(1-P)+(I-R)*(1-L))):1<=p?(v=i[2*(r+o*c)],A=i[2*(r+o*c)+1],x=n+3*_+ +h,I=s+3*a+ +l,w=n+ +_+3*h,O=s+ +a+3*l,D=n+3*_+3*h,R=s+3*a+3*l,(P=.5*(b-1))+(L=.5*(p-1))<=1?(e[$]=v+(x-v)*P+(w-v)*L,e[$+1]=A+(I-A)*P+(O-A)*L):(e[$]=D+(w-D)*(1-P)+(x-D)*(1-L),e[$+1]=R+(O-R)*(1-P)+(I-R)*(1-L))):(L=F-(y=(y=0|F)==o?o-1:y),v=i[2*(r+y*c)],A=i[2*(r+y*c)+1],w=i[2*(r+(y+1)*c)],O=i[2*(r+(y+1)*c)+1],x=n+3*_+(m=y/o)*h,I=s+3*a+m*l,D=n+3*_+(T=(y+1)/o)*h,R=s+3*a+T*l,(P=.5*(b-1))+L<=1?(e[$]=v+(x-v)*P+(w-v)*L,e[$+1]=A+(I-A)*P+(O-A)*L):(e[$]=D+(w-D)*(1-P)+(x-D)*(1-L),e[$+1]=R+(O-R)*(1-P)+(I-R)*(1-L))):p<=0?(P=u-(S=(S=0|u)==r?r-1:S),w=i[2*(S+0*c)],O=i[2*(S+0*c)+1],D=i[2*(S+1+0*c)],R=i[2*(S+1+0*c)+1],v=n+(M=S/r)*_-2*h,A=s+M*a-2*l,x=n+(E=(S+1)/r)*_-2*h,I=s+E*a-2*l,P+(L=.5*(p- -2))<=1?(e[$]=v+(x-v)*P+(w-v)*L,e[$+1]=A+(I-A)*P+(O-A)*L):(e[$]=D+(w-D)*(1-P)+(x-D)*(1-L),e[$+1]=R+(O-R)*(1-P)+(I-R)*(1-L))):1<=p?(P=u-(S=(S=0|u)==r?r-1:S),v=i[2*(S+o*c)],A=i[2*(S+o*c)+1],x=i[2*(S+1+o*c)],I=i[2*(S+1+o*c)+1],w=n+(M=S/r)*_+3*h,O=s+M*a+3*l,D=n+(E=(S+1)/r)*_+3*h,R=s+E*a+3*l,P+(L=.5*(p-1))<=1?(e[$]=v+(x-v)*P+(w-v)*L,e[$+1]=A+(I-A)*P+(O-A)*L):(e[$]=D+(w-D)*(1-P)+(x-D)*(1-L),e[$+1]=R+(O-R)*(1-P)+(I-R)*(1-L))):Y.err.printf("_$li calc : %.4f , %.4f\t\t\t\t\t@@BDBoxGrid\n",b,p):(e[$]=n+b*_+p*h,e[$+1]=s+b*a+p*l)):(d=2*((0|u)+(0|F)*(r+1)),(f=u-(0|u))+(g=F-(0|F))<1?(e[$]=i[d]*(1-f-g)+i[2+d]*f+i[d+2*(r+1)]*g,e[$+1]=i[1+d]*(1-f-g)+i[3+d]*f+i[d+2*(r+1)+1]*g):(e[$]=i[d+2*(r+1)+2]*(f-1+g)+i[d+2*(r+1)]*(1-f)+i[2+d]*(1-g),e[$+1]=i[d+2*(r+1)+3]*(f-1+g)+i[d+2*(r+1)+1]*(1-f)+i[3+d]*(1-g)))}},nt.prototype.transformPoints_sdk1=function(t,e,i,r,o,n,s){for(var _,a,h,l,$,u,p=this._$o,c=this._$A,f=o*s,d=null!=e._$hr?e._$hr:e._$Cr,g=n;g<f;g+=s)l=ot._$ts?((_=i[g])<0?_=0:1<_&&(_=1),(a=i[g+1])<0?a=0:1<a&&(a=1),$=(_*=p)-(l=p-1<(l=0|_)?p-1:l),u=(a*=c)-(h=c-1<(h=0|a)?c-1:h),2*(l+h*(p+1))):($=(_=i[g]*p)-(0|_),u=(a=i[g+1]*c)-(0|a),2*((0|_)+(0|a)*(p+1))),$+u<1?(r[g]=d[l]*(1-$-u)+d[l+2]*$+d[l+2*(p+1)]*u,r[g+1]=d[l+1]*(1-$-u)+d[l+3]*$+d[l+2*(p+1)+1]*u):(r[g]=d[l+2*(p+1)+2]*($-1+u)+d[l+2*(p+1)]*(1-$)+d[l+2]*(1-u),r[g+1]=d[l+2*(p+1)+3]*($-1+u)+d[l+2*(p+1)+1]*(1-$)+d[l+3]*(1-u))},nt.prototype._$VT=function(){return(this._$o+1)*(this._$A+1)},nt.prototype.getType=function(){return a._$_b},st.prototype=new P,l._$42=0,l.prototype._$zP=function(){this._$3S=new Array,this._$aS=new Array},l.prototype._$F0=function(t){this._$g0=t._$8L(),this.visible=t._$8L(),this._$NL=t._$nP(),this._$3S=t._$nP(),this._$aS=t._$nP()},l.prototype.init=function(t){var e=new _t(this);return e.setPartsOpacity(this.isVisible()?1:0),e},l.prototype._$6o=function(t){if(null==this._$3S)throw new Error("_$3S _$6 _$Wo@_$6o");this._$3S.push(t)},l.prototype._$3o=function(t){if(null==this._$aS)throw new Error("_$aS _$6 _$Wo@_$3o");this._$aS.push(t)},l.prototype._$Zo=function(t){this._$3S=t},l.prototype._$xo=function(t){this._$aS=t},l.prototype.isVisible=function(){return this.visible},l.prototype._$uL=function(){return this._$g0},l.prototype._$KP=function(t){this.visible=t},l.prototype._$ET=function(t){this._$g0=t},l.prototype.getBaseData=function(){return this._$3S},l.prototype.getDrawData=function(){return this._$aS},l.prototype._$p2=function(){return this._$NL},l.prototype._$ob=function(t){this._$NL=t},l.prototype.getPartsID=function(){return this._$NL},l.prototype._$MP=function(t){this._$NL=t},(_t.prototype=new function(){}).getPartsOpacity=function(){return this._$VS},_t.prototype.setPartsOpacity=function(t){this._$VS=t},at._$L7=function(){s._$27(),v._$27(),Q._$27(),n._$27()},at.prototype.toString=function(){return this.id},ht.prototype._$1s=function(){return this._$4S},ht.prototype._$zP=function(){this._$4S=new Array},ht.prototype._$F0=function(t){this._$4S=t._$nP()},ht.prototype._$Ks=function(t){this._$4S.push(t)},rt.tr=new gt,rt._$50=new gt,rt._$Ti=new Array(0,0),rt._$Pi=new Array(0,0),rt._$B=new Array(0,0),rt.prototype._$lP=function(t,e,i,r){this.viewport=new Array(t,e,i,r)},rt.prototype._$bL=function(){this.context.save();var t=this.viewport;null!=t&&(this.context.beginPath(),this.context._$Li(t[0],t[1],t[2],t[3]),this.context.clip())},rt.prototype._$ei=function(){this.context.restore()},rt.prototype.drawElements=function(t,e,i,r,C,o,n,N){try{C!=this._$Qo&&(this._$Qo=C,this.context.globalAlpha=C);for(var B=e.length,s=t.width,_=t.height,a=this.context,U=this._$xP,G=this._$uP,Y=this._$6r,k=this._$3r,h=rt.tr,l=rt._$Ti,V=rt._$Pi,$=rt._$B,u=0;u<B;u+=3){a.save();var p,X,c,f=e[u],d=e[u+1],g=e[u+2],y=U+Y*i[2*f],m=G+k*i[2*f+1],T=U+Y*i[2*d],S=G+k*i[2*d+1],P=U+Y*i[2*g],L=G+k*i[2*g+1],M=(n&&(n._$PS(y,m,$),y=$[0],m=$[1],n._$PS(T,S,$),T=$[0],S=$[1],n._$PS(P,L,$),P=$[0],L=$[1]),s*r[2*f]),E=_-_*r[2*f+1],v=s*r[2*d],A=_-_*r[2*d+1],x=s*r[2*g],I=_-_*r[2*g+1],H=Math.atan2(A-E,v-M),z=Math.atan2(S-m,T-y),W=T-y,q=S-m,j=Math.sqrt(W*W+q*q),J=v-M,Q=A-E,Z=j/Math.sqrt(J*J+Q*Q),K=(St._$ni(x,I,M,E,v-M,A-E,-(A-E),v-M,l),St._$ni(P,L,y,m,T-y,S-m,-(S-m),T-y,V),(V[0]-l[0])/l[1]),w=Math.min(M,v,x),O=Math.max(M,v,x),D=Math.min(E,A,I),R=Math.max(E,A,I),b=Math.floor(w),F=Math.floor(D),tt=Math.ceil(O),et=Math.ceil(R);h.identity(),h.translate(y,m),h.rotate(z),h.scale(1,V[1]/l[1]),h.shear(K,0),h.scale(Z,Z),h.rotate(-H),h.translate(-M,-E),h.setContext(a),o=ot.IGNORE_EXPAND?0:o||1.2,ot.USE_CACHED_POLYGON_IMAGE?((p=N._$e0).gl_cacheImage=p.gl_cacheImage||{},p.gl_cacheImage[u]||(X=rt.createCanvas(tt-b,et-F),ot.DEBUG_DATA.LDGL_CANVAS_MB=ot.DEBUG_DATA.LDGL_CANVAS_MB||0,ot.DEBUG_DATA.LDGL_CANVAS_MB+=(tt-b)*(et-F)*4,(c=X.getContext("2d")).translate(-b,-F),rt.clip(c,h,o,j,M,E,v,A,x,I,y,m,T,S,P,L),c.drawImage(t,0,0),p.gl_cacheImage[u]={cacheCanvas:X,cacheContext:c}),a.drawImage(p.gl_cacheImage[u].cacheCanvas,b,F)):(ot.IGNORE_CLIP||rt.clip(a,h,o,j,M,E,v,A,x,I,y,m,T,S,P,L),ot.USE_ADJUST_TRANSLATION&&(O=s,D=w=0,R=_),a.drawImage(t,w,D,O-w,R-D,w,D,O-w,R-D)),a.restore()}}catch(t){it._$Rb(t)}},rt.clip=function(t,e,i,r,o,n,s,_,a,h,l,$,u,p,c,f){.02<i?rt.expandClip(t,e,i,r,l,$,u,p,c,f):rt.clipWithTransform(t,null,o,n,s,_,a,h)},rt.expandClip=function(t,e,i,r,o,n,s,_,a,h){var l=s-o,$=_-n,u=a-o,p=h-n,i=0<l*p-$*u?i:-i,$=-$,c=a-s,f=h-_,d=-f,g=c,c=Math.sqrt(c*c+f*f),f=-p,y=u,u=Math.sqrt(u*u+p*p),p=o-i*$/r,m=n-i*l/r,$=s-i*$/r,l=_-i*l/r,r=s-i*d/c,s=_-i*g/c,_=a-i*d/c,d=h-i*g/c,g=o+i*f/u,c=n+i*y/u,o=a+i*f/u,n=h+i*y/u,a=rt._$50;return null!=e._$P2(a)&&(rt.clipWithTransform(t,a,p,m,$,l,r,s,_,d,o,n,g,c),!0)},rt.clipWithTransform=function(t,e,i,r,o,n,s,_){if(arguments.length<7)it._$li("err : @LDGL.clip()");else if(e instanceof gt){var a=rt._$B,h=e,l=arguments;if(t.beginPath(),h){h._$PS(l[2],l[3],a),t.moveTo(a[0],a[1]);for(var $=4;$<l.length;$+=2)h._$PS(l[$],l[$+1],a),t.lineTo(a[0],a[1])}else{t.moveTo(l[2],l[3]);for($=4;$<l.length;$+=2)t.lineTo(l[$],l[$+1])}t.clip()}else it._$li("err : a[0] is _$6 LDTransform @LDGL.clip()")},rt.createCanvas=function(t,e){var i=document.createElement("canvas");return i.setAttribute("width",t),i.setAttribute("height",e),i||it._$li("err : "+i),i},rt.dumpValues=function(){for(var t="",e=0;e<arguments.length;e++)t+="["+e+"]= "+arguments[e].toFixed(3)+" , ";console.log(t)},lt.prototype._$F0=function(t){this._$TT=t._$_T(),this._$LT=t._$_T(),this._$FS=t._$_T(),this._$wL=t._$nP()},lt.prototype.getMinValue=function(){return this._$TT},lt.prototype.getMaxValue=function(){return this._$LT},lt.prototype.getDefaultValue=function(){return this._$FS},lt.prototype.getParamID=function(){return this._$wL},P.prototype._$yo=function(){return this._$AT&&!this._$JS},P.prototype._$hS=function(t){this._$AT=t},P.prototype._$GT=function(){return this._$e0},P.prototype._$l2=function(t){this._$IP=t},P.prototype.getPartsIndex=function(){return this._$IP},P.prototype._$x2=function(){return this._$JS},P.prototype._$Ib=function(t){this._$JS=t},P.prototype.getTotalScale=function(){return this.totalScale},P.prototype.setTotalScale_notForClient=function(t){this.totalScale=t},P.prototype.getInterpolatedOpacity=function(){return this._$7s},P.prototype.setInterpolatedOpacity=function(t){this._$7s=t},P.prototype.getTotalOpacity=function(t){return this.totalOpacity},P.prototype.setTotalOpacity=function(t){this.totalOpacity=t},ot._$2s="2.1.00_1",ot._$Kr=201001e3,ot._$sP=!0,ot._$so=!0,ot._$cb=!1,ot._$3T=!0,ot._$Ts=!0,ot._$fb=!0,ot._$ts=!0,ot.L2D_DEFORMER_EXTEND=!0,ot._$Wb=!1,ot._$yr=!1,ot._$Zs=!1,ot.L2D_NO_ERROR=0,ot._$i7=1e3,ot._$9s=1001,ot._$es=1100,ot._$r7=2e3,ot._$07=2001,ot._$b7=2002,ot._$H7=4e3,ot.L2D_COLOR_BLEND_MODE_MULT=0,ot.L2D_COLOR_BLEND_MODE_ADD=1,ot.L2D_COLOR_BLEND_MODE_INTERPOLATE=2,ot._$6b=!0,ot._$cT=0,ot.clippingMaskBufferSize=256,ot.glContext=new Array,ot.frameBuffers=new Array,ot.fTexture=new Array,ot.IGNORE_CLIP=!1,ot.IGNORE_EXPAND=!1,ot.EXPAND_W=2,ot.USE_ADJUST_TRANSLATION=!0,ot.USE_CANVAS_TRANSFORM=!0,ot.USE_CACHED_POLYGON_IMAGE=!1,ot.DEBUG_DATA={},ot.PROFILE_IOS_SPEED={PROFILE_NAME:"iOS Speed",USE_ADJUST_TRANSLATION:!0,USE_CACHED_POLYGON_IMAGE:!0,EXPAND_W:4},ot.PROFILE_IOS_DEFAULT=ot.PROFILE_IOS_QUALITY={PROFILE_NAME:"iOS HiQ",USE_ADJUST_TRANSLATION:!0,USE_CACHED_POLYGON_IMAGE:!1,EXPAND_W:2},ot.PROFILE_ANDROID={PROFILE_NAME:"Android",USE_ADJUST_TRANSLATION:!1,USE_CACHED_POLYGON_IMAGE:!1,EXPAND_W:2},ot.PROFILE_DESKTOP={PROFILE_NAME:"Desktop",USE_ADJUST_TRANSLATION:!1,USE_CACHED_POLYGON_IMAGE:!1,EXPAND_W:2},ot.initProfile=function(){w.isIOS()?ot.setupProfile(ot.PROFILE_IOS_DEFAULT):w.isAndroid()?ot.setupProfile(ot.PROFILE_ANDROID):ot.setupProfile(ot.PROFILE_DESKTOP)},ot.setupProfile=function(t,e){if("number"==typeof t)switch(t){case 9901:t=ot.PROFILE_IOS_SPEED;break;case 9902:t=ot.PROFILE_IOS_QUALITY;break;case 9903:t=ot.PROFILE_IOS_DEFAULT;break;case 9904:t=ot.PROFILE_ANDROID;break;case 9905:t=ot.PROFILE_DESKTOP;break;default:alert("profile _$6 _$Ui : "+t)}for(var i in(e=arguments.length<2?!0:e)&&console.log("profile : "+t.PROFILE_NAME),t)ot[i]=t[i],e&&console.log(" ["+i+"] = "+t[i])},ot.init=function(){ot._$6b&&(console.log("Live2D %s",ot._$2s),ot._$6b=!1,ot.initProfile())},ot.getVersionStr=function(){return ot._$2s},ot.getVersionNo=function(){return ot._$Kr},ot._$sT=function(t){ot._$cT=t},ot.getError=function(){var t=ot._$cT;return ot._$cT=0,t},ot.dispose=function(){ot.glContext=[],ot.frameBuffers=[],ot.fTexture=[]},ot.setGL=function(t,e){ot.glContext[e||0]=t},ot.getGL=function(t){return ot.glContext[t]},ot.setClippingMaskBufferSize=function(t){ot.clippingMaskBufferSize=t},ot.getClippingMaskBufferSize=function(){return ot.clippingMaskBufferSize},ot.deleteBuffer=function(t){ot.getGL(t).deleteFramebuffer(ot.frameBuffers[t].framebuffer),delete ot.frameBuffers[t],delete ot.glContext[t]},$t._$r2=function(t){return t<0?0:1<t?1:.5-.5*Math.cos(t*I.PI_F)},ut._$fr=-1,ut.prototype.toString=function(){return this._$ib},M.prototype=new y,M._$42=0,M._$Os=30,M._$ms=0,M._$ns=1,M._$_s=2,M._$gT=new Array,M.prototype._$_S=function(t){this._$LP=t},M.prototype.getTextureNo=function(){return this._$LP},M.prototype._$ZL=function(){return this._$Qi},M.prototype._$H2=function(){return this._$JP},M.prototype.getNumPoints=function(){return this._$d0},M.prototype.getType=function(){return y._$wb},M.prototype._$B2=function(t,e,i){var r=null!=e._$hr?e._$hr:e._$Cr;switch(T._$do){default:case T._$Ms:throw new Error("_$L _$ro ");case T._$Qs:for(var o=this._$d0-1;0<=o;--o)r[o*T._$No+4]=i}},M.prototype._$zP=function(){this._$GS=new J,this._$GS._$zP()},M.prototype._$F0=function(t){y.prototype._$F0.call(this,t),this._$LP=t._$6L(),this._$d0=t._$6L(),this._$Yo=t._$6L();var e=t._$nP();this._$BP=new Int16Array(3*this._$Yo);for(var i=3*this._$Yo-1;0<=i;--i)this._$BP[i]=e[i];this._$Eo=t._$nP(),this._$Qi=t._$nP(),t.getFormatVersion()>=u._$s7?(this._$JP=t._$6L(),0!=this._$JP&&(0!=(1&this._$JP)&&(t=t._$6L(),null==this._$5P&&(this._$5P=new Object),this._$5P._$Hb=parseInt(t)),0!=(this._$JP&M._$Os)?this._$6s=(this._$JP&M._$Os)>>1:this._$6s=M._$ms,0!=(32&this._$JP))&&(this.culling=!1)):this._$JP=0},M.prototype.init=function(t){var e=new pt(this),i=this._$d0*T._$No,r=this._$32();switch(null!=e._$Cr&&(e._$Cr=null),e._$Cr=new Float32Array(i),null!=e._$hr&&(e._$hr=null),e._$hr=r?new Float32Array(i):null,T._$do){default:case T._$Ms:if(T._$Ls)for(var o=this._$d0-1;0<=o;--o){var n=o<<1;this._$Qi[n+1]=1-this._$Qi[n+1]}break;case T._$Qs:for(o=this._$d0-1;0<=o;--o){var n=o<<1,s=o*T._$No,_=this._$Qi[n],a=this._$Qi[n+1];e._$Cr[s]=_,e._$Cr[1+s]=a,e._$Cr[4+s]=0,r&&(e._$hr[s]=_,e._$hr[1+s]=a,e._$hr[4+s]=0)}}return e},M.prototype._$Nr=function(t,e){var i;this!=e._$GT()&&console.log("### assert!! ### "),this._$GS._$Ur(t)&&(y.prototype._$Nr.call(this,t,e),!e._$IS[0])&&((i=M._$gT)[0]=!1,W._$Vr(t,this._$GS,i,this._$d0,this._$Eo,e._$Cr,T._$i2,T._$No))},M.prototype._$2b=function(t,e){try{this!=e._$GT()&&console.log("### assert!! ### ");var i,r,o,n=!1,s=(e._$IS[0]&&(n=!0),e);!n&&(y.prototype._$2b.call(this,t),this._$32())&&(i=this.getTargetBaseDataID(),s._$8r==y._$ur&&(s._$8r=t.getBaseDataIndex(i)),s._$8r<0?ot._$so&&it._$li("_$L _$0P _$G :: %s",i):(r=t.getBaseData(s._$8r),o=t._$q2(s._$8r),null==r||o._$x2()?s._$AT=!1:(r._$nb(t,o,s._$Cr,s._$hr,this._$d0,T._$i2,T._$No),s._$AT=!0),s.baseOpacity=o.getTotalOpacity()))}catch(t){throw t}},M.prototype.draw=function(t,e,i){var r,o,n;this!=i._$GT()&&console.log("### assert!! ### "),i._$IS[0]||((r=this._$LP)<0&&(r=1),o=this.getOpacity(e,e=i)*i._$VS*i.baseOpacity,n=null!=e._$hr?e._$hr:e._$Cr,t.setClipBufPre_clipContextForDraw(i.clipBufPre_clipContext),t._$WP(this.culling),t._$Uo(r,3*this._$Yo,this._$BP,n,this._$Qi,o,this._$6s,e))},M.prototype.dump=function(){console.log(" _$yi( %d ) , _$d0( %d ) , _$Yo( %d ) \n",this._$LP,this._$d0,this._$Yo),console.log(" _$Oi _$di = { ");for(var t=0;t<this._$BP.length;t++)console.log("%5d ,",this._$BP[t]);console.log("\n _$5i _$30");for(t=0;t<this._$Eo.length;t++){console.log("\n _$30[%d] = ",t);for(var e=this._$Eo[t],i=0;i<e.length;i++)console.log("%6.2f, ",e[i])}console.log("\n")},M.prototype._$72=function(t){return null==this._$5P?null:this._$5P[t]},M.prototype.getIndexArray=function(){return this._$BP},(pt.prototype=new Tt).getTransformedPoints=function(){return null!=this._$hr?this._$hr:this._$Cr},ct.prototype._$HT=function(t){this.x=t.x,this.y=t.y},ct.prototype._$HT=function(t,e){this.x=t,this.y=e},E.prototype=new $,E.loadModel=function(t){var e=new E;return $._$62(e,t),e},E.loadModel=function(t,e){e=new E(e||0);return $._$62(e,t),e},E._$to=function(){return new E},E._$er=function(t){var e=new _$5("../_$_r/_$t0/_$Ri/_$_P._$d");if(0==e.exists())throw new _$ls("_$t0 _$_ _$6 _$Ui :: "+e._$PL());for(var i=["../_$_r/_$t0/_$Ri/_$_P.512/_$CP._$1","../_$_r/_$t0/_$Ri/_$_P.512/_$vP._$1","../_$_r/_$t0/_$Ri/_$_P.512/_$EP._$1","../_$_r/_$t0/_$Ri/_$_P.512/_$pP._$1"],r=E.loadModel(e._$3b()),o=0;o<i.length;o++){var n=new _$5(i[o]);if(0==n.exists())throw new _$ls("_$t0 _$_ _$6 _$Ui :: "+n._$PL());r.setTexture(o,_$nL._$_o(t,n._$3b()))}return r},E.prototype.setGL=function(t){ot.setGL(t)},E.prototype.setTransform=function(t){this.drawParamWebGL.setTransform(t)},E.prototype.update=function(){this._$5S.update(),this._$5S.preDraw(this.drawParamWebGL)},E.prototype.draw=function(){this._$5S.draw(this.drawParamWebGL)},E.prototype._$K2=function(){this.drawParamWebGL._$K2()},E.prototype.setTexture=function(t,e){null==this.drawParamWebGL&&it._$li("_$Yi for QT _$ki / _$XS() is _$6 _$ui!!"),this.drawParamWebGL.setTexture(t,e)},E.prototype.setTexture=function(t,e){null==this.drawParamWebGL&&it._$li("_$Yi for QT _$ki / _$XS() is _$6 _$ui!!"),this.drawParamWebGL.setTexture(t,e)},E.prototype._$Rs=function(){return this.drawParamWebGL._$Rs()},E.prototype._$Ds=function(t){this.drawParamWebGL._$Ds(t)},E.prototype.getDrawParam=function(){return this.drawParamWebGL},E.prototype.setMatrix=function(t){this.drawParamWebGL.setMatrix(t)},E.prototype.setPremultipliedAlpha=function(t){this.drawParamWebGL.setPremultipliedAlpha(t)},E.prototype.isPremultipliedAlpha=function(){return this.drawParamWebGL.isPremultipliedAlpha()},E.prototype.setAnisotropy=function(t){this.drawParamWebGL.setAnisotropy(t)},E.prototype.getAnisotropy=function(){return this.drawParamWebGL.getAnisotropy()},ft.prototype._$tb=function(){return this.motions},ft.prototype.startMotion=function(t,e){for(var i=null,r=this.motions.length,o=0;o<r;++o)null!=(i=this.motions[o])&&(i._$qS(i._$w0.getFadeOut()),this._$eb)&&it._$Ji("MotionQueueManager[size:%2d]->startMotion() / start _$K _$3 (m%d)\n",r,i._$sr);if(null==t)return-1;(i=new dt)._$w0=t,this.motions.push(i);t=i._$sr;return this._$eb&&it._$Ji("MotionQueueManager[size:%2d]->startMotion() / new _$w0 (m%d)\n",r,t),t},ft.prototype.updateParam=function(t){try{for(var e=!1,i=0;i<this.motions.length;i++){var r,o=this.motions[i];null!=o?null!=(r=o._$w0)?(r.updateParam(t,o),e=!0,o.isFinished()&&(this._$eb&&it._$Ji("MotionQueueManager[size:%2d]->updateParam() / _$T0 _$w0 (m%d)\n",this.motions.length-1,o._$sr),this.motions.splice(i,1),i--)):(this.motions=this.motions.splice(i,1),i--):(this.motions.splice(i,1),i--)}return e}catch(t){return it._$li(t),!0}},ft.prototype.isFinished=function(t){if(1<=arguments.length){for(var e=0;e<this.motions.length;e++)if(null!=(i=this.motions[e])&&i._$sr==t&&!i.isFinished())return!1}else for(var i,e=0;e<this.motions.length;e++)if(null!=(i=this.motions[e]))if(null!=i._$w0){if(!i.isFinished())return!1}else this.motions.splice(e,1),e--;else this.motions.splice(e,1),e--;return!0},ft.prototype.stopAllMotions=function(){for(var t=0;t<this.motions.length;t++){var e=this.motions[t];null!=e&&e._$w0,this.motions.splice(t,1),t--}},ft.prototype._$Zr=function(t){this._$eb=t},ft.prototype._$e=function(){console.log("-- _$R --\n");for(var t=0;t<this.motions.length;t++){var e=this.motions[t]._$w0;console.log("MotionQueueEnt[%d] :: %s\n",this.motions.length,e.toString())}},dt._$Gs=0,dt.prototype.isFinished=function(){return this._$9L},dt.prototype._$qS=function(t){t=Rt.getUserTimeMSec()+t;(this._$Do<0||t<this._$Do)&&(this._$Do=t)},dt.prototype._$Bs=function(){return this._$sr},gt.prototype.setContext=function(t){var e=this.m;t.transform(e[0],e[1],e[3],e[4],e[6],e[7])},gt.prototype.toString=function(){for(var t="LDTransform { ",e=0;e<9;e++)t+=this.m[e].toFixed(2)+" ,";return t+" }"},gt.prototype.identity=function(){var t=this.m;t[0]=t[4]=t[8]=1,t[1]=t[2]=t[3]=t[5]=t[6]=t[7]=0},gt.prototype._$PS=function(t,e,i){null==i&&(i=new Array(0,0));var r=this.m;return i[0]=r[0]*t+r[3]*e+r[6],i[1]=r[1]*t+r[4]*e+r[7],i},gt.prototype._$P2=function(t){t=t||new gt;var e=this.m,i=e[0],r=e[1],o=e[2],n=e[3],s=e[4],_=e[5],a=e[6],h=e[7],e=e[8],l=i*s*e+r*_*a+o*n*h-i*_*h-o*s*a-r*n*e;return 0==l?null:(t.m[0]=(l=1/l)*(s*e-h*_),t.m[1]=l*(h*o-r*e),t.m[2]=l*(r*_-s*o),t.m[3]=l*(a*_-n*e),t.m[4]=l*(i*e-a*o),t.m[5]=l*(n*o-i*_),t.m[6]=l*(n*h-a*s),t.m[7]=l*(a*r-i*h),t.m[8]=l*(i*s-n*r),t)},gt.prototype.transform=function(t,e,i){null==i&&(i=new Array(0,0));var r=this.m;return i[0]=r[0]*t+r[3]*e+r[6],i[1]=r[1]*t+r[4]*e+r[7],i},gt.prototype.translate=function(t,e){var i=this.m;i[6]=i[0]*t+i[3]*e+i[6],i[7]=i[1]*t+i[4]*e+i[7],i[8]=i[2]*t+i[5]*e+i[8]},gt.prototype.scale=function(t,e){var i=this.m;i[0]*=t,i[1]*=t,i[2]*=t,i[3]*=e,i[4]*=e,i[5]*=e},gt.prototype.shear=function(t,e){var i=this.m,r=i[0]+i[3]*e,o=i[1]+i[4]*e,e=i[2]+i[5]*e;i[3]=i[0]*t+i[3],i[4]=i[1]*t+i[4],i[5]=i[2]*t+i[5],i[0]=r,i[1]=o,i[2]=e},gt.prototype.rotate=function(t){var e=this.m,i=Math.cos(t),t=Math.sin(t),r=e[0]*i+e[3]*t,o=e[1]*i+e[4]*t,n=e[2]*i+e[5]*t;e[3]=-e[0]*t+e[3]*i,e[4]=-e[1]*t+e[4]*i,e[5]=-e[2]*t+e[5]*i,e[0]=r,e[1]=o,e[2]=n},gt.prototype.concatenate=function(t){var e=this.m,t=t.m,i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],r=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],n=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],_=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],a=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],h=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],e=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];m[0]=i,m[1]=r,m[2]=o,m[3]=n,m[4]=s,m[5]=_,m[6]=a,m[7]=h,m[8]=e},v.prototype=new at,v._$eT=null,v._$tP=new Object,v._$2o=function(){return v._$eT=null==v._$eT?v.getID("DST_BASE"):v._$eT},v._$27=function(){v._$tP.clear(),v._$eT=null},v.getID=function(t){var e=v._$tP[t];return null==e&&(e=new v(t),v._$tP[t]=e),e},v.prototype._$3s=function(){return new v},A.prototype=new e,A._$9r=function(t){return new Float32Array(t)},A._$vb=function(t){return new Int16Array(t)},A._$cr=function(t,e){return null==t||t._$yL()<e.length?t=A._$9r(2*e.length):t.clear(),t.put(e),t._$oT(0),t},A._$mb=function(t,e){return null==t||t._$yL()<e.length?t=A._$vb(2*e.length):t.clear(),t.put(e),t._$oT(0),t},A._$Hs=function(){return this._$Gr},A._$as=function(t){this._$Gr=t},A.prototype.getGL=function(){return this.gl},A.prototype.setGL=function(t){this.gl=t},A.prototype.setTransform=function(t){this.transform=t},A.prototype._$ZT=function(){var t=this.gl;this.firstDraw&&(this.initShader(),this.firstDraw=!1,this.anisotropyExt=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic"),this.anisotropyExt)&&(this.maxAnisotropy=t.getParameter(this.anisotropyExt.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.DEPTH_TEST),t.frontFace(t.CW),t.enable(t.BLEND),t.colorMask(1,1,1,1),t.bindBuffer(t.ARRAY_BUFFER,null),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)},A.prototype._$Uo=function(t,e,i,r,o,n,s,_){if(!(n<.01&&null==this.clipBufPre_clipContextMask)){var a=this.gl;if(null==this.gl)throw new Error("gl is null");var h,l,$,u,p,c,f=+this._$C0*n,d=+this._$tT*n,g=+this._$WL*n,n=this._$lT*n;if(null!=this.clipBufPre_clipContextMask?(a.frontFace(a.CCW),a.useProgram(this.shaderProgram),this._$vS=yt(a,this._$vS,r),this._$no=mt(a,this._$no,i),a.enableVertexAttribArray(this.a_position_Loc),a.vertexAttribPointer(this.a_position_Loc,2,a.FLOAT,!1,0,0),this._$NT=yt(a,this._$NT,o),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,this.textures[t]),a.uniform1i(this.s_texture0_Loc,1),a.enableVertexAttribArray(this.a_texCoord_Loc),a.vertexAttribPointer(this.a_texCoord_Loc,2,a.FLOAT,!1,0,0),a.uniformMatrix4fv(this.u_matrix_Loc,!1,this.getClipBufPre_clipContextMask().matrixForMask),h=this.getClipBufPre_clipContextMask().layoutChannelNo,l=this.getChannelFlagAsColor(h),a.uniform4f(this.u_channelFlag,l.r,l.g,l.b,l.a),y=this.getClipBufPre_clipContextMask().layoutBounds,a.uniform4f(this.u_baseColor_Loc,2*y.x-1,2*y.y-1,2*y._$EL()-1,2*y._$5T()-1),a.uniform1i(this.u_maskFlag_Loc,!0)):null!=this.getClipBufPre_clipContextDraw()?(a.useProgram(this.shaderProgramOff),this._$vS=yt(a,this._$vS,r),this._$no=mt(a,this._$no,i),a.enableVertexAttribArray(this.a_position_Loc_Off),a.vertexAttribPointer(this.a_position_Loc_Off,2,a.FLOAT,!1,0,0),this._$NT=yt(a,this._$NT,o),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,this.textures[t]),a.uniform1i(this.s_texture0_Loc_Off,1),a.enableVertexAttribArray(this.a_texCoord_Loc_Off),a.vertexAttribPointer(this.a_texCoord_Loc_Off,2,a.FLOAT,!1,0,0),a.uniformMatrix4fv(this.u_clipMatrix_Loc_Off,!1,this.getClipBufPre_clipContextDraw().matrixForDraw),a.uniformMatrix4fv(this.u_matrix_Loc_Off,!1,this.matrix4x4),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,ot.fTexture[this.glno]),a.uniform1i(this.s_texture1_Loc_Off,2),h=this.getClipBufPre_clipContextDraw().layoutChannelNo,l=this.getChannelFlagAsColor(h),a.uniform4f(this.u_channelFlag_Loc_Off,l.r,l.g,l.b,l.a),a.uniform4f(this.u_baseColor_Loc_Off,f,d,g,n)):(a.useProgram(this.shaderProgram),this._$vS=yt(a,this._$vS,r),this._$no=mt(a,this._$no,i),a.enableVertexAttribArray(this.a_position_Loc),a.vertexAttribPointer(this.a_position_Loc,2,a.FLOAT,!1,0,0),this._$NT=yt(a,this._$NT,o),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,this.textures[t]),a.uniform1i(this.s_texture0_Loc,1),a.enableVertexAttribArray(this.a_texCoord_Loc),a.vertexAttribPointer(this.a_texCoord_Loc,2,a.FLOAT,!1,0,0),a.uniformMatrix4fv(this.u_matrix_Loc,!1,this.matrix4x4),a.uniform4f(this.u_baseColor_Loc,f,d,g,n),a.uniform1i(this.u_maskFlag_Loc,!1)),this.culling?this.gl.enable(a.CULL_FACE):this.gl.disable(a.CULL_FACE),this.gl.enable(a.BLEND),null!=this.clipBufPre_clipContextMask)$=a.ONE,u=a.ONE_MINUS_SRC_ALPHA,p=a.ONE,c=a.ONE_MINUS_SRC_ALPHA;else switch(s){case M._$ms:$=a.ONE,u=a.ONE_MINUS_SRC_ALPHA,p=a.ONE,c=a.ONE_MINUS_SRC_ALPHA;break;case M._$ns:$=a.ONE,u=a.ONE,p=a.ZERO,c=a.ONE;break;case M._$_s:$=a.DST_COLOR,u=a.ONE_MINUS_SRC_ALPHA,p=a.ZERO,c=a.ONE}a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate($,u,p,c),this.anisotropyExt&&a.texParameteri(a.TEXTURE_2D,this.anisotropyExt.TEXTURE_MAX_ANISOTROPY_EXT,this.maxAnisotropy);var y=i.length;a.drawElements(a.TRIANGLES,y,a.UNSIGNED_SHORT,0),a.bindTexture(a.TEXTURE_2D,null)}},A.prototype._$Rs=function(){throw new Error("_$Rs")},A.prototype._$Ds=function(t){throw new Error("_$Ds")},A.prototype._$K2=function(){for(var t=0;t<this.textures.length;t++)0!=this.textures[t]&&(this.gl._$K2(1,this.textures,t),this.textures[t]=null)},A.prototype.setTexture=function(t,e){this.textures[t]=e},A.prototype.initShader=function(){var t=this.gl;this.loadShaders2(),this.a_position_Loc=t.getAttribLocation(this.shaderProgram,"a_position"),this.a_texCoord_Loc=t.getAttribLocation(this.shaderProgram,"a_texCoord"),this.u_matrix_Loc=t.getUniformLocation(this.shaderProgram,"u_mvpMatrix"),this.s_texture0_Loc=t.getUniformLocation(this.shaderProgram,"s_texture0"),this.u_channelFlag=t.getUniformLocation(this.shaderProgram,"u_channelFlag"),this.u_baseColor_Loc=t.getUniformLocation(this.shaderProgram,"u_baseColor"),this.u_maskFlag_Loc=t.getUniformLocation(this.shaderProgram,"u_maskFlag"),this.a_position_Loc_Off=t.getAttribLocation(this.shaderProgramOff,"a_position"),this.a_texCoord_Loc_Off=t.getAttribLocation(this.shaderProgramOff,"a_texCoord"),this.u_matrix_Loc_Off=t.getUniformLocation(this.shaderProgramOff,"u_mvpMatrix"),this.u_clipMatrix_Loc_Off=t.getUniformLocation(this.shaderProgramOff,"u_ClipMatrix"),this.s_texture0_Loc_Off=t.getUniformLocation(this.shaderProgramOff,"s_texture0"),this.s_texture1_Loc_Off=t.getUniformLocation(this.shaderProgramOff,"s_texture1"),this.u_channelFlag_Loc_Off=t.getUniformLocation(this.shaderProgramOff,"u_channelFlag"),this.u_baseColor_Loc_Off=t.getUniformLocation(this.shaderProgramOff,"u_baseColor")},A.prototype.disposeShader=function(){var t=this.gl;this.shaderProgram&&(t.deleteProgram(this.shaderProgram),this.shaderProgram=null),this.shaderProgramOff&&(t.deleteProgram(this.shaderProgramOff),this.shaderProgramOff=null)},A.prototype.compileShader=function(t,e){var i=this.gl,t=i.createShader(t);return null==t?(it._$Ji("_$L0 to create shader"),null):(i.shaderSource(t,e),i.compileShader(t),i.getShaderParameter(t,i.COMPILE_STATUS)?t:(e=i.getShaderInfoLog(t),it._$Ji("_$L0 to compile shader : "+e),i.deleteShader(t),null))},A.prototype.loadShaders2=function(){var t,e=this.gl;return this.shaderProgram=e.createProgram(),!(!this.shaderProgram||(this.shaderProgramOff=e.createProgram(),!this.shaderProgramOff)||(this.vertShader=this.compileShader(e.VERTEX_SHADER,"attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_ClipPos;uniform mat4 u_mvpMatrix;void main(){ gl_Position = u_mvpMatrix * a_position; v_ClipPos = u_mvpMatrix * a_position; v_texCoord = a_texCoord;}"),this.vertShader?(this.vertShaderOff=this.compileShader(e.VERTEX_SHADER,"attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_ClipPos;uniform mat4 u_mvpMatrix;uniform mat4 u_ClipMatrix;void main(){ gl_Position = u_mvpMatrix * a_position; v_ClipPos = u_ClipMatrix * a_position; v_texCoord = a_texCoord ;}"),this.vertShaderOff?(this.fragShader=this.compileShader(e.FRAGMENT_SHADER,"precision mediump float;varying vec2 v_texCoord;varying vec4 v_ClipPos;uniform sampler2D s_texture0;uniform vec4 u_channelFlag;uniform vec4 u_baseColor;uniform bool u_maskFlag;void main(){ vec4 smpColor; if(u_maskFlag){ float isInside = step(u_baseColor.x, v_ClipPos.x/v_ClipPos.w) * step(u_baseColor.y, v_ClipPos.y/v_ClipPos.w) * step(v_ClipPos.x/v_ClipPos.w, u_baseColor.z) * step(v_ClipPos.y/v_ClipPos.w, u_baseColor.w); smpColor = u_channelFlag * texture2D(s_texture0 , v_texCoord).a * isInside; }else{ smpColor = texture2D(s_texture0 , v_texCoord) * u_baseColor; } gl_FragColor = smpColor;}"),this.fragShader?(this.fragShaderOff=this.compileShader(e.FRAGMENT_SHADER,"precision mediump float ;varying vec2 v_texCoord;varying vec4 v_ClipPos;uniform sampler2D s_texture0;uniform sampler2D s_texture1;uniform vec4 u_channelFlag;uniform vec4 u_baseColor ;void main(){ vec4 col_formask = texture2D(s_texture0, v_texCoord) * u_baseColor; vec4 clipMask = texture2D(s_texture1, v_ClipPos.xy / v_ClipPos.w) * u_channelFlag; float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a; col_formask = col_formask * maskVal; gl_FragColor = col_formask;}"),this.fragShaderOff?(e.attachShader(this.shaderProgram,this.vertShader),e.attachShader(this.shaderProgram,this.fragShader),e.attachShader(this.shaderProgramOff,this.vertShaderOff),e.attachShader(this.shaderProgramOff,this.fragShaderOff),e.linkProgram(this.shaderProgram),e.linkProgram(this.shaderProgramOff),!e.getProgramParameter(this.shaderProgram,e.LINK_STATUS)&&(t=e.getProgramInfoLog(this.shaderProgram),it._$Ji("_$L0 to link program: "+t),this.vertShader&&(e.deleteShader(this.vertShader),this.vertShader=0),this.fragShader&&(e.deleteShader(this.fragShader),this.fragShader=0),this.shaderProgram&&(e.deleteProgram(this.shaderProgram),this.shaderProgram=0),this.vertShaderOff&&(e.deleteShader(this.vertShaderOff),this.vertShaderOff=0),this.fragShaderOff&&(e.deleteShader(this.fragShaderOff),this.fragShaderOff=0),this.shaderProgramOff&&(e.deleteProgram(this.shaderProgramOff),this.shaderProgramOff=0),1)):(it._$Ji("OffFragment shader compile _$li!"),1)):(it._$Ji("Fragment shader compile _$li!"),1)):(it._$Ji("OffVertex shader compile _$li!"),1)):(it._$Ji("Vertex shader compile _$li!"),1)))},A.prototype.createFramebuffer=function(){var t=this.gl,e=ot.clippingMaskBufferSize,i=t.createFramebuffer(),r=(t.bindFramebuffer(t.FRAMEBUFFER,i),t.createRenderbuffer()),o=(t.bindRenderbuffer(t.RENDERBUFFER,r),t.renderbufferStorage(t.RENDERBUFFER,t.RGBA4,e,e),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,r),t.createTexture());return t.bindTexture(t.TEXTURE_2D,o),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,e,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,o,0),t.bindTexture(t.TEXTURE_2D,null),t.bindRenderbuffer(t.RENDERBUFFER,null),t.bindFramebuffer(t.FRAMEBUFFER,null),ot.fTexture[this.glno]=o,{framebuffer:i,renderbuffer:r,texture:ot.fTexture[this.glno]}},x.prototype._$fP=function(){var t,e,i,r=this._$ST();if(0==(128&r))return 255&r;if(0==(128&(t=this._$ST())))return(127&r)<<7|127&t;if(0==(128&(e=this._$ST())))return(127&r)<<14|(127&t)<<7|255&e;if(0==(128&(i=this._$ST())))return(127&r)<<21|(127&t)<<14|(127&e)<<7|255&i;throw new ut("_$L _$0P _")},x.prototype.getFormatVersion=function(){return this._$S2},x.prototype._$gr=function(t){this._$S2=t},x.prototype._$3L=function(){return this._$fP()},x.prototype._$mP=function(){return this._$zT(),this._$F+=8,this._$T.getFloat64(this._$F-8)},x.prototype._$_T=function(){return this._$zT(),this._$F+=4,this._$T.getFloat32(this._$F-4)},x.prototype._$6L=function(){return this._$zT(),this._$F+=4,this._$T.getInt32(this._$F-4)},x.prototype._$ST=function(){return this._$zT(),this._$T.getInt8(this._$F++)},x.prototype._$9T=function(){return this._$zT(),this._$F+=2,this._$T.getInt16(this._$F-2)},x.prototype._$2T=function(){throw this._$zT(),this._$F+=8,new ut("_$L _$q read long")},x.prototype._$po=function(){return this._$zT(),0!=this._$T.getInt8(this._$F++)},Lt=!0,x.prototype._$bT=function(){this._$zT();var t=this._$3L(),e=null;if(Lt)try{for(var i=new ArrayBuffer(2*t),e=new Uint16Array(i),r=0;r<t;++r)e[r]=this._$T.getUint8(this._$F++);return String.fromCharCode.apply(null,e)}catch(t){Lt=!1}try{var o=new Array;if(null==e)for(r=0;r<t;++r)o[r]=this._$T.getUint8(this._$F++);else for(r=0;r<t;++r)o[r]=e[r];return String.fromCharCode.apply(null,o)}catch(t){console.log("read utf8 / _$rT _$L0 !! : "+t)}},x.prototype._$cS=function(){this._$zT();for(var t=this._$3L(),e=new Int32Array(t),i=0;i<t;i++)e[i]=this._$T.getInt32(this._$F),this._$F+=4;return e},x.prototype._$Tb=function(){this._$zT();for(var t=this._$3L(),e=new Float32Array(t),i=0;i<t;i++)e[i]=this._$T.getFloat32(this._$F),this._$F+=4;return e},x.prototype._$5b=function(){this._$zT();for(var t=this._$3L(),e=new Float64Array(t),i=0;i<t;i++)e[i]=this._$T.getFloat64(this._$F),this._$F+=8;return e},x.prototype._$nP=function(){return this._$Jb(-1)},x.prototype._$Jb=function(t){if(this._$zT(),(t=t<0?this._$3L():t)==u._$7P){var e=this._$6L();if(0<=e&&e<this._$Ko.length)return this._$Ko[e];throw new ut("_$sL _$4i @_$m0")}e=this._$4b(t);return this._$Ko.push(e),e},x.prototype._$4b=function(t){if(0==t)return null;var e;if(50==t)return e=this._$bT(),Q.getID(e);if(51==t)return e=this._$bT(),v.getID(e);if(134==t)return e=this._$bT(),n.getID(e);if(60==t)return e=this._$bT(),s.getID(e);if(48<=t)return null!=(e=u._$9o(t))?(e._$F0(this),e):null;switch(t){case 1:return this._$bT();case 10:return new b(this._$6L());case 11:return new H(this._$mP(),this._$mP(),this._$mP(),this._$mP());case 12:return new H(this._$_T(),this._$_T(),this._$_T(),this._$_T());case 13:return new q(this._$mP(),this._$mP());case 14:return new q(this._$_T(),this._$_T());case 15:for(var i=this._$3L(),r=new Array(i),o=0;o<i;o++)r[o]=this._$nP();return r;case 17:return r=new p(this._$mP(),this._$mP(),this._$mP(),this._$mP(),this._$mP(),this._$mP());case 21:return new C(this._$6L(),this._$6L(),this._$6L(),this._$6L());case 22:return new ct(this._$6L(),this._$6L());case 23:throw new Error("_$L _$ro ");case 16:case 25:return this._$cS();case 26:return this._$5b();case 27:return this._$Tb();case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 18:case 19:case 20:case 24:case 28:throw new ut("_$6 _$q : _$nP() of 2-9 ,18,19,20,24,28 : "+t);default:throw new ut("_$6 _$q : _$nP() NO _$i : "+t)}},x.prototype._$8L=function(){return 0==this._$hL?this._$v0=this._$ST():8==this._$hL&&(this._$v0=this._$ST(),this._$hL=0),1==(this._$v0>>7-this._$hL++&1)},x.prototype._$zT=function(){0!=this._$hL&&(this._$hL=0)},I._$2S=Math.PI/180,I._$bS=Math.PI/180,I._$wS=180/Math.PI,I._$NS=180/Math.PI,I.PI_F=Math.PI,I._$kT=[0,.012368,.024734,.037097,.049454,.061803,.074143,.086471,.098786,.111087,.12337,.135634,.147877,.160098,.172295,.184465,.196606,.208718,.220798,.232844,.244854,.256827,.268761,.280654,.292503,.304308,.316066,.327776,.339436,.351044,.362598,.374097,.385538,.396921,.408243,.419502,.430697,.441826,.452888,.463881,.474802,.485651,.496425,.507124,.517745,.528287,.538748,.549126,.559421,.56963,.579752,.589785,.599728,.609579,.619337,.629,.638567,.648036,.657406,.666676,.675843,.684908,.693867,.70272,.711466,.720103,.72863,.737045,.745348,.753536,.76161,.769566,.777405,.785125,.792725,.800204,.807561,.814793,.821901,.828884,.835739,.842467,.849066,.855535,.861873,.868079,.874153,.880093,.885898,.891567,.897101,.902497,.907754,.912873,.917853,.922692,.92739,.931946,.936359,.940629,.944755,.948737,.952574,.956265,.959809,.963207,.966457,.96956,.972514,.97532,.977976,.980482,.982839,.985045,.987101,.989006,.990759,.992361,.993811,.995109,.996254,.997248,.998088,.998776,.999312,.999694,.999924,1],I._$92=function(t,e){t=Math.atan2(t[1],t[0]),e=Math.atan2(e[1],e[0]);return I._$tS(t,e)},I._$tS=function(t,e){for(var i=t-e;i<-Math.PI;)i+=2*Math.PI;for(;i>Math.PI;)i-=2*Math.PI;return i},I._$9=function(t){return Math.sin(t)},I.fcos=function(t){return Math.cos(t)},Tt.prototype._$u2=function(){return this._$IS[0]},Tt.prototype._$yo=function(){return this._$AT&&!this._$IS[0]},Tt.prototype._$GT=function(){return this._$e0},w._$W2=0,w.SYSTEM_INFO=null,w.USER_AGENT=navigator.userAgent,w.isIPhone=function(){return w.SYSTEM_INFO||w.setup(),w.SYSTEM_INFO._isIPhone},w.isIOS=function(){return w.SYSTEM_INFO||w.setup(),w.SYSTEM_INFO._isIPhone||w.SYSTEM_INFO._isIPad},w.isAndroid=function(){return w.SYSTEM_INFO||w.setup(),w.SYSTEM_INFO._isAndroid},w.getOSVersion=function(){return w.SYSTEM_INFO||w.setup(),w.SYSTEM_INFO.version},w.getOS=function(){return w.SYSTEM_INFO||w.setup(),w.SYSTEM_INFO._isIPhone||w.SYSTEM_INFO._isIPad?"iOS":w.SYSTEM_INFO._isAndroid?"Android":"_$Q0 OS"},w.setup=function(){function t(t,e){for(var i=t.substring(e).split(/[ _,;\.]/),r=0,o=0;o<=2&&!isNaN(i[o]);o++){var n=parseInt(i[o]);if(n<0||999<n){it._$li("err : "+n+" @UtHtml5.setup()"),r=0;break}r+=n*Math.pow(1e3,2-o)}return r}var e,i=w.USER_AGENT,r=w.SYSTEM_INFO={userAgent:i};0<=(e=i.indexOf("iPhone OS "))?(r.os="iPhone",r._isIPhone=!0,r.version=t(i,e+"iPhone OS ".length)):0<=(e=i.indexOf("iPad"))?(e=i.indexOf("CPU OS"))<0?it._$li(" err : "+i+" @UtHtml5.setup()"):(r.os="iPad",r._isIPad=!0,r.version=t(i,e+"CPU OS ".length)):0<=(e=i.indexOf("Android"))?(r.os="Android",r._isAndroid=!0,r.version=t(i,e+"Android ".length)):(r.os="-",r.version=-1)},window.UtSystem=Rt,window.UtDebug=it,window.LDTransform=gt,window.LDGL=rt,window.Live2D=ot,window.Live2DModelWebGL=E,window.Live2DModelJS=h,window.Live2DMotion=S,window.MotionQueueManager=ft,window.PhysicsHair=_,window.AMotion=t,window.PartsDataID=n,window.DrawDataID=Q,window.BaseDataID=v,window.ParamID=s,ot.init(),O=!1}.call(e,i(7))},function(t,e){t.exports={import:function(){throw new Error("System.import cannot be used indirectly")}}},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(){this.models=[],this.count=-1,this.reloadFlg=!1,Live2D.init(),n.Live2DFramework.setPlatformManager(new s.default)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=i(0),s=r(i(9)),_=r(i(10)),a=r(i(1));o.prototype.createModel=function(){var t=new _.default;return this.models.push(t),t},o.prototype.changeModel=function(t,e){this.reloadFlg&&(this.reloadFlg=!1,this.releaseModel(0,t),this.createModel(),this.models[0].load(t,e))},o.prototype.getModel=function(t){return t>=this.models.length?null:this.models[t]},o.prototype.releaseModel=function(t,e){this.models.length<=t||(this.models[t].release(e),delete this.models[t],this.models.splice(t,1))},o.prototype.numModels=function(){return this.models.length},o.prototype.setDrag=function(t,e){for(var i=0;i<this.models.length;i++)this.models[i].setDrag(t,e)},o.prototype.maxScaleEvent=function(){a.default.DEBUG_LOG&&console.log("Max scale event.");for(var t=0;t<this.models.length;t++)this.models[t].startRandomMotion(a.default.MOTION_GROUP_PINCH_IN,a.default.PRIORITY_NORMAL)},o.prototype.minScaleEvent=function(){a.default.DEBUG_LOG&&console.log("Min scale event.");for(var t=0;t<this.models.length;t++)this.models[t].startRandomMotion(a.default.MOTION_GROUP_PINCH_OUT,a.default.PRIORITY_NORMAL)},o.prototype.tapEvent=function(t,e){a.default.DEBUG_LOG&&console.log("tapEvent view x:"+t+" y:"+e);for(var i=0;i<this.models.length;i++)this.models[i].hitTest(a.default.HIT_AREA_HEAD,t,e)?(a.default.DEBUG_LOG&&console.log("Tap face."),this.models[i].setRandomExpression()):this.models[i].hitTest(a.default.HIT_AREA_BODY,t,e)?(a.default.DEBUG_LOG&&console.log("Tap body. models["+i+"]"),this.models[i].startRandomMotion(a.default.MOTION_GROUP_TAP_BODY,a.default.PRIORITY_NORMAL)):this.models[i].hitTestCustom("head",t,e)?(a.default.DEBUG_LOG&&console.log("Tap face."),this.models[i].startRandomMotion(a.default.MOTION_GROUP_FLICK_HEAD,a.default.PRIORITY_NORMAL)):this.models[i].hitTestCustom("body",t,e)&&(a.default.DEBUG_LOG&&console.log("Tap body. models["+i+"]"),this.models[i].startRandomMotion(a.default.MOTION_GROUP_TAP_BODY,a.default.PRIORITY_NORMAL));return!0}},function(t,e,i){"use strict";function r(){}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var s=i(2),o={};r.prototype.loadBytes=function(t,e){var i;void 0!==o[t]?e(o[t]):((i=new XMLHttpRequest).open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(){200===i.status?(o[t]=i.response,e(i.response)):console.error("Failed to load ("+i.status+") : "+t)},i.send(null))},r.prototype.loadString=function(t){this.loadBytes(t,function(t){return t})},r.prototype.loadLive2DModel=function(t,e){var i;this.loadBytes(t,function(t){i=Live2DModelWebGL.loadModel(t),e(i)})},r.prototype.loadTexture=function(i,r,t,o){var n=new Image;n.crossOrigin="Anonymous",n.src=t,n.onload=function(){var t=(0,s.getContext)(),e=t.createTexture();if(!e)return console.error("Failed to generate gl texture name."),-1;0==i.isPremultipliedAlpha()&&t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.generateMipmap(t.TEXTURE_2D),i.setTexture(r,e),"function"==typeof o&&o()},n.onerror=function(){console.error("Failed to load image : "+t)}},r.prototype.jsonParseFromBytes=function(t){var e=new Uint8Array(t,0,3),e=239==e[0]&&187==e[1]&&191==e[2]?String.fromCharCode.apply(null,new Uint8Array(t,3)):String.fromCharCode.apply(null,new Uint8Array(t));return JSON.parse(e)},r.prototype.log=function(t){}},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(){n.L2DBaseModel.prototype.constructor.call(this),this.modelHomeDir="",this.modelSetting=null,this.tmpMatrix=[]}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=i(0),s=r(i(11)),_=r(i(1)),a=r(i(3));(o.prototype=new n.L2DBaseModel).load=function(t,e,o){this.setUpdating(!0),this.setInitialized(!1),this.modelHomeDir=e.substring(0,e.lastIndexOf("/")+1),this.modelSetting=new s.default;var n=this;this.modelSetting.loadModelSetting(e,function(){var t=n.modelHomeDir+n.modelSetting.getModelFile();n.loadModelData(t,function(t){for(var e,i=0;i<n.modelSetting.getTextureNum();i++)e=/^https?:\/\/|^\/\//i.test(n.modelSetting.getTextureFile(i))?n.modelSetting.getTextureFile(i):n.modelHomeDir+n.modelSetting.getTextureFile(i),n.loadTexture(i,e,function(){if(n.isTexLoaded){if(0<n.modelSetting.getExpressionNum()){n.expressions={};for(var t=0;t<n.modelSetting.getExpressionNum();t++){var e=n.modelSetting.getExpressionName(t),i=n.modelHomeDir+n.modelSetting.getExpressionFile(t);n.loadExpression(e,i)}}else n.expressionManager=null,n.expressions={};var r;n.eyeBlink,null!=n.modelSetting.getPhysicsFile()?n.loadPhysics(n.modelHomeDir+n.modelSetting.getPhysicsFile()):n.physics=null,null!=n.modelSetting.getPoseFile()?n.loadPose(n.modelHomeDir+n.modelSetting.getPoseFile(),function(){n.pose.updateParam(n.live2DModel)}):n.pose=null,null!=n.modelSetting.getLayout()&&(null!=(r=n.modelSetting.getLayout()).width&&n.modelMatrix.setWidth(r.width),null!=r.height&&n.modelMatrix.setHeight(r.height),null!=r.x&&n.modelMatrix.setX(r.x),null!=r.y&&n.modelMatrix.setY(r.y),null!=r.center_x&&n.modelMatrix.centerX(r.center_x),null!=r.center_y&&n.modelMatrix.centerY(r.center_y),null!=r.top&&n.modelMatrix.top(r.top),null!=r.bottom&&n.modelMatrix.bottom(r.bottom),null!=r.left&&n.modelMatrix.left(r.left),null!=r.right)&&n.modelMatrix.right(r.right),null!=n.modelSetting.getHitAreasCustom()&&(null!=(r=n.modelSetting.getHitAreasCustom()).head_x&&(_.default.hit_areas_custom_head_x=r.head_x),null!=r.head_y&&(_.default.hit_areas_custom_head_y=r.head_y),null!=r.body_x&&(_.default.hit_areas_custom_body_x=r.body_x),null!=r.body_y)&&(_.default.hit_areas_custom_body_y=r.body_y);for(t=0;t<n.modelSetting.getInitParamNum();t++)n.live2DModel.setParamFloat(n.modelSetting.getInitParamID(t),n.modelSetting.getInitParamValue(t));for(t=0;t<n.modelSetting.getInitPartsVisibleNum();t++)n.live2DModel.setPartsOpacity(n.modelSetting.getInitPartsVisibleID(t),n.modelSetting.getInitPartsVisibleValue(t));n.live2DModel.saveParam(),n.preloadMotionGroup(_.default.MOTION_GROUP_IDLE),n.preloadMotionGroup(_.default.MOTION_GROUP_SLEEPY),n.mainMotionManager.stopAllMotions(),n.setUpdating(!1),n.setInitialized(!0),"function"==typeof o&&o()}})})})},o.prototype.release=function(t){var e=n.Live2DFramework.getPlatformManager();t.deleteTexture(e.texture)},o.prototype.preloadMotionGroup=function(e){for(var i=this,r=0;r<this.modelSetting.getMotionNum(e);r++){var t=this.modelSetting.getMotionFile(e,r);this.loadMotion(t,this.modelHomeDir+t,function(t){t.setFadeIn(i.modelSetting.getMotionFadeIn(e,r)),t.setFadeOut(i.modelSetting.getMotionFadeOut(e,r))})}},o.prototype.update=function(){var t;null==this.live2DModel?_.default.DEBUG_LOG&&console.error("Failed to update."):(t=2*((UtSystem.getUserTimeMSec()-this.startTimeMSec)/1e3)*Math.PI,this.mainMotionManager.isFinished()&&("1"===sessionStorage.getItem("Sleepy")?this.startRandomMotion(_.default.MOTION_GROUP_SLEEPY,_.default.PRIORITY_SLEEPY):this.startRandomMotion(_.default.MOTION_GROUP_IDLE,_.default.PRIORITY_IDLE)),this.live2DModel.loadParam(),this.mainMotionManager.updateParam(this.live2DModel)||null!=this.eyeBlink&&this.eyeBlink.updateParam(this.live2DModel),this.live2DModel.saveParam(),null==this.expressionManager||null==this.expressions||this.expressionManager.isFinished()||this.expressionManager.updateParam(this.live2DModel),this.live2DModel.addToParamFloat("PARAM_ANGLE_X",30*this.dragX,1),this.live2DModel.addToParamFloat("PARAM_ANGLE_Y",30*this.dragY,1),this.live2DModel.addToParamFloat("PARAM_ANGLE_Z",this.dragX*this.dragY*-30,1),this.live2DModel.addToParamFloat("PARAM_BODY_ANGLE_X",10*this.dragX,1),this.live2DModel.addToParamFloat("PARAM_EYE_BALL_X",this.dragX,1),this.live2DModel.addToParamFloat("PARAM_EYE_BALL_Y",this.dragY,1),this.live2DModel.addToParamFloat("PARAM_ANGLE_X",Number(15*Math.sin(t/6.5345)),.5),this.live2DModel.addToParamFloat("PARAM_ANGLE_Y",Number(8*Math.sin(t/3.5345)),.5),this.live2DModel.addToParamFloat("PARAM_ANGLE_Z",Number(10*Math.sin(t/5.5345)),.5),this.live2DModel.addToParamFloat("PARAM_BODY_ANGLE_X",Number(4*Math.sin(t/15.5345)),.5),this.live2DModel.setParamFloat("PARAM_BREATH",Number(.5+.5*Math.sin(t/3.2345)),1),null!=this.physics&&this.physics.updateParam(this.live2DModel),null==this.lipSync&&this.live2DModel.setParamFloat("PARAM_MOUTH_OPEN_Y",this.lipSyncValue),null!=this.pose&&this.pose.updateParam(this.live2DModel),this.live2DModel.update())},o.prototype.setRandomExpression=function(){var t,e=[];for(t in this.expressions)e.push(t);var i=parseInt(Math.random()*e.length);this.setExpression(e[i])},o.prototype.startRandomMotion=function(t,e){var i=this.modelSetting.getMotionNum(t),i=parseInt(Math.random()*i);this.startMotion(t,i,e)},o.prototype.startMotion=function(e,i,r){var t=this.modelSetting.getMotionFile(e,i);if(null==t||""==t)_.default.DEBUG_LOG&&console.error("Failed to motion.");else{if(r==_.default.PRIORITY_FORCE)this.mainMotionManager.setReservePriority(r);else if(!this.mainMotionManager.reserveMotion(r))return void(_.default.DEBUG_LOG&&console.log("Motion is running."));var o,n=this;null==this.motions[e]?this.loadMotion(null,this.modelHomeDir+t,function(t){o=t,n.setFadeInFadeOut(e,i,r,o)}):(o=this.motions[e],n.setFadeInFadeOut(e,i,r,o))}},o.prototype.setFadeInFadeOut=function(t,e,i,r){var o=this.modelSetting.getMotionFile(t,e);r.setFadeIn(this.modelSetting.getMotionFadeIn(t,e)),r.setFadeOut(this.modelSetting.getMotionFadeOut(t,e)),_.default.DEBUG_LOG&&console.log("Start motion : "+o),null!=this.modelSetting.getMotionSound(t,e)&&(o=this.modelSetting.getMotionSound(t,e),(t=document.createElement("audio")).src=this.modelHomeDir+o,_.default.DEBUG_LOG&&console.log("Start sound : "+o),t.play()),this.mainMotionManager.startMotionPrio(r,i)},o.prototype.setExpression=function(t){var e=this.expressions[t];_.default.DEBUG_LOG&&console.log("Expression : "+t),this.expressionManager.startMotion(e,!1)},o.prototype.draw=function(t){a.default.push(),a.default.multMatrix(this.modelMatrix.getArray()),this.tmpMatrix=a.default.getMatrix(),this.live2DModel.setMatrix(this.tmpMatrix),this.live2DModel.draw(),a.default.pop()},o.prototype.hitTest=function(t,e,i){for(var r,o=this.modelSetting.getHitAreaNum(),n=0;n<o;n++)if(t==this.modelSetting.getHitAreaName(n))return r=this.modelSetting.getHitAreaID(n),this.hitTestSimple(r,e,i);return!1},o.prototype.hitTestCustom=function(t,e,i){return"head"==t?this.hitTestSimpleCustom(_.default.hit_areas_custom_head_x,_.default.hit_areas_custom_head_y,e,i):"body"==t&&this.hitTestSimpleCustom(_.default.hit_areas_custom_body_x,_.default.hit_areas_custom_body_y,e,i)}},function(t,e,i){"use strict";function r(){this.NAME="name",this.ID="id",this.MODEL="model",this.TEXTURES="textures",this.HIT_AREAS="hit_areas",this.PHYSICS="physics",this.POSE="pose",this.EXPRESSIONS="expressions",this.MOTION_GROUPS="motions",this.SOUND="sound",this.FADE_IN="fade_in",this.FADE_OUT="fade_out",this.LAYOUT="layout",this.HIT_AREAS_CUSTOM="hit_areas_custom",this.INIT_PARAM="init_param",this.INIT_PARTS_VISIBLE="init_parts_visible",this.VALUE="val",this.FILE="file",this.json={}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var o=i(0);r.prototype.loadModelSetting=function(t,e){var i=this;o.Live2DFramework.getPlatformManager().loadBytes(t,function(t){t=String.fromCharCode.apply(null,new Uint8Array(t));i.json=JSON.parse(t),e()})},r.prototype.getTextureFile=function(t){return null==this.json[this.TEXTURES]||null==this.json[this.TEXTURES][t]?null:this.json[this.TEXTURES][t]},r.prototype.getModelFile=function(){return this.json[this.MODEL]},r.prototype.getTextureNum=function(){return null==this.json[this.TEXTURES]?0:this.json[this.TEXTURES].length},r.prototype.getHitAreaNum=function(){return null==this.json[this.HIT_AREAS]?0:this.json[this.HIT_AREAS].length},r.prototype.getHitAreaID=function(t){return null==this.json[this.HIT_AREAS]||null==this.json[this.HIT_AREAS][t]?null:this.json[this.HIT_AREAS][t][this.ID]},r.prototype.getHitAreaName=function(t){return null==this.json[this.HIT_AREAS]||null==this.json[this.HIT_AREAS][t]?null:this.json[this.HIT_AREAS][t][this.NAME]},r.prototype.getPhysicsFile=function(){return this.json[this.PHYSICS]},r.prototype.getPoseFile=function(){return this.json[this.POSE]},r.prototype.getExpressionNum=function(){return null==this.json[this.EXPRESSIONS]?0:this.json[this.EXPRESSIONS].length},r.prototype.getExpressionFile=function(t){return null==this.json[this.EXPRESSIONS]?null:this.json[this.EXPRESSIONS][t][this.FILE]},r.prototype.getExpressionName=function(t){return null==this.json[this.EXPRESSIONS]?null:this.json[this.EXPRESSIONS][t][this.NAME]},r.prototype.getLayout=function(){return this.json[this.LAYOUT]},r.prototype.getHitAreasCustom=function(){return this.json[this.HIT_AREAS_CUSTOM]},r.prototype.getInitParamNum=function(){return null==this.json[this.INIT_PARAM]?0:this.json[this.INIT_PARAM].length},r.prototype.getMotionNum=function(t){return null==this.json[this.MOTION_GROUPS]||null==this.json[this.MOTION_GROUPS][t]?0:this.json[this.MOTION_GROUPS][t].length},r.prototype.getMotionFile=function(t,e){return null==this.json[this.MOTION_GROUPS]||null==this.json[this.MOTION_GROUPS][t]||null==this.json[this.MOTION_GROUPS][t][e]?null:this.json[this.MOTION_GROUPS][t][e][this.FILE]},r.prototype.getMotionSound=function(t,e){return null==this.json[this.MOTION_GROUPS]||null==this.json[this.MOTION_GROUPS][t]||null==this.json[this.MOTION_GROUPS][t][e]||null==this.json[this.MOTION_GROUPS][t][e][this.SOUND]?null:this.json[this.MOTION_GROUPS][t][e][this.SOUND]},r.prototype.getMotionFadeIn=function(t,e){return null==this.json[this.MOTION_GROUPS]||null==this.json[this.MOTION_GROUPS][t]||null==this.json[this.MOTION_GROUPS][t][e]||null==this.json[this.MOTION_GROUPS][t][e][this.FADE_IN]?1e3:this.json[this.MOTION_GROUPS][t][e][this.FADE_IN]},r.prototype.getMotionFadeOut=function(t,e){return null==this.json[this.MOTION_GROUPS]||null==this.json[this.MOTION_GROUPS][t]||null==this.json[this.MOTION_GROUPS][t][e]||null==this.json[this.MOTION_GROUPS][t][e][this.FADE_OUT]?1e3:this.json[this.MOTION_GROUPS][t][e][this.FADE_OUT]},r.prototype.getInitParamID=function(t){return null==this.json[this.INIT_PARAM]||null==this.json[this.INIT_PARAM][t]?null:this.json[this.INIT_PARAM][t][this.ID]},r.prototype.getInitParamValue=function(t){return null==this.json[this.INIT_PARAM]||null==this.json[this.INIT_PARAM][t]?NaN:this.json[this.INIT_PARAM][t][this.VALUE]},r.prototype.getInitPartsVisibleNum=function(){return null==this.json[this.INIT_PARTS_VISIBLE]?0:this.json[this.INIT_PARTS_VISIBLE].length},r.prototype.getInitPartsVisibleID=function(t){return null==this.json[this.INIT_PARTS_VISIBLE]||null==this.json[this.INIT_PARTS_VISIBLE][t]?null:this.json[this.INIT_PARTS_VISIBLE][t][this.ID]},r.prototype.getInitPartsVisibleValue=function(t){return null==this.json[this.INIT_PARTS_VISIBLE]||null==this.json[this.INIT_PARTS_VISIBLE][t]?NaN:this.json[this.INIT_PARTS_VISIBLE][t][this.VALUE]}}]);