window.qqMiniGame=function(e,t){"use strict";class i{static isLocalNativeFile(e){for(var t=0,i=l.nativefiles.length;t=52428800&&(t.size>l.minClearSize&&(l.minClearSize=t.size),i.onClearCacheRes()),i.deleteFile(e,a,n,o,t.size)},fail:function(e){null!=n&&n.runWith([1,e])}}):null!=n&&n.runWith([0]):i.fs.getFileInfo({filePath:e,success:function(t){s&&f+4194304+t.size>=52428800&&(t.size>l.minClearSize&&(l.minClearSize=t.size),i.onClearCacheRes()),i.fs.copyFile({srcPath:e,destPath:h,success:function(e){i.onSaveFile(a,d,!0,o,n,t.size)},fail:function(e){null!=n&&n.runWith([1,e])}})},fail:function(e){null!=n&&n.runWith([1,e])}})}static onClearCacheRes(){var e=l.minClearSize,t=[];for(var a in i.filesListObj)"fileUsedSize"!=a&&t.push(i.filesListObj[a]);i.sortOn(t,"times",i.NUMERIC);for(var n=0,o=1,s=t.length;o=e)break;n+=r.size,i.deleteFile("",r.readyUrl)}}static sortOn(e,t,a=0){return a==i.NUMERIC?e.sort((function(e,i){return e[t]-i[t]})):a==(i.NUMERIC|i.DESCENDING)?e.sort((function(e,i){return i[t]-e[t]})):e.sort((function(e,i){return e[t]-i[t]}))}static getFileNativePath(e){return i.fileNativeDir+"/"+e}static deleteFile(e,t="",a=null,n="",o=0){var s=i.getFileInfo(t),r=i.getFileNativePath(s.md5),l=""!=e;i.onSaveFile(t,e,l,n,a,o),i.fs.unlink({filePath:r,success:function(t){if(""!=e){var n=i.getFileNativePath(e);i.fs.copyFile({srcPath:e,destPath:n,success:function(e){},fail:function(e){null!=a&&a.runWith([1,e])}})}},fail:function(e){}})}static deleteAll(){var e=[];for(var t in i.filesListObj)"fileUsedSize"!=t&&e.push(i.filesListObj[t]);for(var a=1,n=e.length;a0&&this.loops--,this.startTime=0,this.play()}play(){this.isStopped=!1,t.SoundManager.addChannel(this),this._audio.play()}set startTime(e){this._audio&&(this._audio.startTime=e)}set autoplay(e){this._audio.autoplay=e}get autoplay(){return this._audio.autoplay}get position(){return this._audio?this._audio.currentTime:0}get duration(){return this._audio?this._audio.duration:0}stop(){this.isStopped=!0,t.SoundManager.removeChannel(this),this.completeHandler=null,this._audio&&(this._audio.stop(),this.loop||(this._audio.offEnded(null),this._miniSound.dispose(),this._audio=null,this._miniSound=null,this._onEnd=null))}pause(){this.isStopped=!0,this._audio.pause()}get loop(){return this._audio.loop}set loop(e){this._audio.loop=e}resume(){this._audio&&(this.isStopped=!1,t.SoundManager.addChannel(this),this._audio.play())}set volume(e){this._audio&&(this._audio.volume=e)}get volume(){return this._audio?this._audio.volume:1}}class n extends t.EventDispatcher{constructor(){super(),this.loaded=!1}static _createSound(){return n._id++,l.window.qq.createInnerAudioContext()}load(e){if(n._musicAudio||(n._musicAudio=n._createSound()),i.isLocalNativeFile(e)){if(-1!=e.indexOf("http://")||-1!=e.indexOf("https://"))if(""!=i.loadPath)e=e.split(i.loadPath)[1];else{var a=""!=t.URL.rootPath?t.URL.rootPath:t.URL._basePath;""!=a&&(e=e.split(a)[1])}}else e=t.URL.formatURL(e);if(this.url=e,this.readyUrl=e,n._audioCache[this.readyUrl])this.event(t.Event.COMPLETE);else if(l.autoCacheFile&&i.getFileInfo(e))this.onDownLoadCallBack(e,0);else if(l.autoCacheFile)if(i.isLocalNativeFile(e)){var o=e;if(""!=(a=""!=t.URL.rootPath?t.URL.rootPath:t.URL._basePath)&&(e=e.split(a)[1]),e||(e=o),l.subNativeFiles&&0==l.subNativeheads.length)for(var s in l.subNativeFiles){var r=l.subNativeFiles[s];l.subNativeheads=l.subNativeheads.concat(r);for(var d=0;d=0?"/":"\\",o=e.lastIndexOf(n),s=o>=0?e.substr(0,o+1):"",r=0,d=a.length;r\s+<");try{t=(new l.window.Parser.DOMParser).parseFromString(e,"text/xml")}catch(e){throw"需要引入xml解析库文件"}return t},l.idx=1;class d extends t.EventDispatcher{constructor(){super()}static __init__(){try{var e;if(!(e=t.Accelerator))return;e.prototype.on=d.prototype.on,e.prototype.off=d.prototype.off}catch(e){}}static startListen(e){if(d._callBack=e,!d._isListening){d._isListening=!0;try{l.window.qq.onAccelerometerChange(d.onAccelerometerChange)}catch(e){}}}static stopListen(){d._isListening=!1;try{l.window.qq.stopAccelerometer({})}catch(e){}}static onAccelerometerChange(e){var t;(t={}).acceleration=e,t.accelerationIncludingGravity=e,t.rotationRate={},null!=d._callBack&&d._callBack(t)}on(e,t,i,a=null){return super.on(e,t,i,a),d.startListen(this.onDeviceOrientationChange),this}off(e,t,i,a=!1){return this.hasListener(e)||d.stopListen(),super.off(e,t,i,a)}}d._isListening=!1;class u{_loadImage(e){if(l.isZiYu)u.onCreateImage(e,this,!0);else{var a;if(i.isLocalNativeFile(e)){if(-1==e.indexOf(l.window.qq.env.USER_DATA_PATH)&&(-1!=e.indexOf("http://")||-1!=e.indexOf("https://")))if(""!=i.loadPath)e=e.split(i.loadPath)[1];else{var n=""!=t.URL.rootPath?t.URL.rootPath:t.URL._basePath,o=e;""!=n&&(e=e.split(n)[1]),e||(e=o)}if(l.subNativeFiles&&0==l.subNativeheads.length)for(var s in l.subNativeFiles){var r=l.subNativeFiles[s];l.subNativeheads=l.subNativeheads.concat(r);for(var d=0;d