Comparing version 0.5.3 to 0.6.0
@@ -1,2 +0,2 @@ | ||
!function(t,e){for(var n in e)t[n]=e[n]}(exports,function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){"use strict";e.__esModule=!0;var r=n(11);e.TsrpcPtl=r.default;var o=n(12);e.TsrpcError=o.default,e.default=r.default},function(t,e,n){"use strict";e.__esModule=!0,n(7),n(8),n(9),"undefined"==typeof window||window.console||(window.console={},console.log=console.debug=console.info=console.warn=console.error=console.time=console.timeEnd=function(){}),console.debug||(console.debug=console.log)},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o,i=r(n(21)),u=r(n(22));if("object"==typeof wx&&wx.setStorage)o=i.default;else{if("undefined"==typeof localStorage)throw new Error("Can not find a implement for LocalStorage at current platfor.");o=u.default}e.default=o},function(t,e,n){"use strict";e.__esModule=!0;var r=function(){function t(t){var e=this;this.isDone=!1,this.isCanceled=!1,this._alwaysFunc=[],this._promise=new Promise(function(n,r){e._promiseRj=r;t(function(t){e.isCanceled||(e.isDone=!0,e._alwaysFunc.forEach(function(t){t.call(e)}),n(t),e._cancelFunc=void 0,e._alwaysFunc=void 0)},function(t){e.isCanceled||(e.isDone=!0,e._alwaysFunc.forEach(function(t){t.call(e)}),r(t),e._cancelFunc=void 0,e._alwaysFunc=void 0)})})}return t.prototype.onCancel=function(t){return this._cancelFunc?this._cancelFunc.push(t):this._cancelFunc=[t],this},t.prototype.cancel=function(){if(this.isDone)return!1;if(this.isCanceled)return!0;if(this.isCanceled=!0,this._cancelFunc){for(var t=0,e=this._cancelFunc;t<e.length;t++){(0,e[t])()}this._cancelFunc=void 0}return this._promise=this._promise.catch(function(){}),this._promiseRj(),this._promiseRj=void 0,this._promise=void 0,this._alwaysFunc=void 0,!0},t.prototype.always=function(t){return this.isCanceled||(this.isDone?t.call(this):this._alwaysFunc.push(t)),this},t.prototype.then=function(t,e){return this.isCanceled||(this._promise=this._promise.then(t,e)),this},t.prototype.catch=function(t){return this.isCanceled||(this._promise=this._promise.catch(t)),this},t.all=function(e){var n=new t(function(t,n){Promise.all(e).then(function(e){t(e)}).catch(function(t){n(t)})});return n.onCancel(function(){e.forEach(function(t){t.cancel()})}),n},t}();e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(5)),a=i(n(6)),c=i(n(15)),s=i(n(19)),l=i(n(2)),f=i(n(23)),h=i(n(27)),p=i(n(32)),d=i(n(33)),y="undefined"==typeof wx?c.default:a.default,g=function(){function t(t,e,n){void 0===e&&(e="Browser");var i=this;this.apiClient=new y({serverUrl:p.default.serverUrl}),this._cookie=l.default.getItem("hhgame_cookie")||{},this.currentUser=null,this.user=new s.default(this),this.valuePackage=new f.default(this),this.rank=new u.default(this),this.stat=new h.default(this),this.task=new d.default(this),this.appId=t,this.platform=e,n&&(this.apiClient.config.serverUrl=n),this.apiClient.onRequest=function(t){i.cookie&&(t.req.__cookie=i.cookie,t.req.__appId=i.appId)},this.apiClient.onResponse=function(t){return r(i,void 0,void 0,function(){return o(this,function(e){return t.res.__cookie&&(this.cookie=t.res.__cookie),[2]})})}}return Object.defineProperty(t.prototype,"cookie",{get:function(){return this._cookie},set:function(t){l.default.setItem("hhgame_cookie123",t),this._cookie=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isWeappOrWegame",{get:function(){return"Weapp"===this.platform||"Wegame"===this.platform},enumerable:!0,configurable:!0}),t}();e.default=g},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){this.hhGame=t}return t.prototype.getUserRankList=function(t,e,n,i){return r(this,void 0,void 0,function(){return o(this,function(t){throw new Error("TODO")})})},t}();e.default=i},function(t,e,n){"use strict"; | ||
!function(t,e){for(var n in e)t[n]=e[n]}(exports,function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){"use strict";e.__esModule=!0;var r=n(11);e.TsrpcPtl=r.default;var o=n(12);e.TsrpcError=o.default,e.default=r.default},function(t,e,n){"use strict";e.__esModule=!0,n(7),n(8),n(9),"undefined"==typeof window||window.console||(window.console={},console.log=console.debug=console.info=console.warn=console.error=console.time=console.timeEnd=function(){}),console.debug||(console.debug=console.log)},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o,i=r(n(21)),u=r(n(22));if("object"==typeof wx&&wx.setStorage)o=i.default;else{if("undefined"==typeof localStorage)throw new Error("Can not find a implement for LocalStorage at current platfor.");o=u.default}e.default=o},function(t,e,n){"use strict";e.__esModule=!0;var r=function(){function t(t){var e=this;this.isDone=!1,this.isCanceled=!1,this._alwaysFunc=[],this._promise=new Promise(function(n,r){e._promiseRj=r;t(function(t){e.isCanceled||(e.isDone=!0,e._alwaysFunc.forEach(function(t){t.call(e)}),n(t),e._cancelFunc=void 0,e._alwaysFunc=void 0)},function(t){e.isCanceled||(e.isDone=!0,e._alwaysFunc.forEach(function(t){t.call(e)}),r(t),e._cancelFunc=void 0,e._alwaysFunc=void 0)})})}return t.prototype.onCancel=function(t){return this._cancelFunc?this._cancelFunc.push(t):this._cancelFunc=[t],this},t.prototype.cancel=function(){if(this.isDone)return!1;if(this.isCanceled)return!0;if(this.isCanceled=!0,this._cancelFunc){for(var t=0,e=this._cancelFunc;t<e.length;t++){(0,e[t])()}this._cancelFunc=void 0}return this._promise=this._promise.catch(function(){}),this._promiseRj(),this._promiseRj=void 0,this._promise=void 0,this._alwaysFunc=void 0,!0},t.prototype.always=function(t){return this.isCanceled||(this.isDone?t.call(this):this._alwaysFunc.push(t)),this},t.prototype.then=function(t,e){return this.isCanceled||(this._promise=this._promise.then(t,e)),this},t.prototype.catch=function(t){return this.isCanceled||(this._promise=this._promise.catch(t)),this},t.all=function(e){var n=new t(function(t,n){Promise.all(e).then(function(e){t(e)}).catch(function(t){n(t)})});return n.onCancel(function(){e.forEach(function(t){t.cancel()})}),n},t}();e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(5)),a=i(n(6)),c=i(n(15)),s=i(n(19)),l=i(n(2)),f=i(n(23)),h=i(n(27)),p=i(n(32)),d=i(n(33)),y="undefined"==typeof wx?c.default:a.default,v=function(){function t(t,e,n){void 0===e&&(e="Browser");var i=this;this.apiClient=new y({serverUrl:p.default.serverUrl}),this._cookie=l.default.getItem("hhgame_cookie")||{},this.currentUser=null,this.user=new s.default(this),this.valuePackage=new f.default(this),this.rank=new u.default(this),this.stat=new h.default(this),this.task=new d.default(this),this.appId=t,this.platform=e,n&&(this.apiClient.config.serverUrl=n),this.apiClient.onRequest=function(t){i.cookie&&(t.req.__cookie=i.cookie,t.req.__appId=i.appId)},this.apiClient.onResponse=function(t){return r(i,void 0,void 0,function(){return o(this,function(e){return t.res.__cookie&&(this.cookie=t.res.__cookie),[2]})})}}return Object.defineProperty(t.prototype,"cookie",{get:function(){return this._cookie},set:function(t){l.default.setItem("hhgame_cookie123",t),this._cookie=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isWeappOrWegame",{get:function(){return"Weapp"===this.platform||"Wegame"===this.platform},enumerable:!0,configurable:!0}),t}();e.default=v},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){this.hhGame=t}return t.prototype.getUserRankList=function(t,e,n,i){return r(this,void 0,void 0,function(){return o(this,function(t){throw new Error("TODO")})})},t}();e.default=i},function(t,e,n){"use strict"; | ||
/** | ||
@@ -15,2 +15,2 @@ * TSRPC Browser Client | ||
* @license Apache-2.0 | ||
*/e.__esModule=!0,n(1);var r=n(16);e.default=r.default},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};e.__esModule=!0;var i=n(0),u=n(3),a=n(17);n(1);var c=function(){function t(t){this.config=Object.merge({},a.DefaultClientConfig,t),this.config.serverUrl=this.config.serverUrl.replace(/\/$/,""),this.config.protocolPath=this.config.protocolPath.replace(/\\/g,"/").replace(/\/+$/,"")}return t.getLastReqSn=function(){return this._sn},t.prototype.callApi=function(e,n,i){var a=this;void 0===n&&(n={}),void 0===i&&(i={});var c=++t._sn,s=this.getPtlUrl(e);this.config.showDebugLog&&console.debug("%cApiReq%c #"+c+"%c "+s,"border:solid 1px #4ea85f; color: #4ea85f; line-height: 1.5em; padding: 1px 3px;","color: #1b63bd;","color: #999;",n),this.onRequest&&this.onRequest({ptl:e,req:n});var l,f=!1,h=new u.default(function(t,i){return r(a,void 0,void 0,function(){var u,a,h,p,d=this;return o(this,function(y){switch(y.label){case 0:return l=new XMLHttpRequest,navigator.userAgent.indexOf("MSIE 8.0;")>-1?l.onreadystatechange=function(){return r(d,void 0,void 0,function(){var r=this;return o(this,function(o){if(4==l.readyState&&!f){if(0==l.status||null==l.response&&null==l.responseText)return setTimeout(function(){r._throwApiError(e,n,c,s,i)},0),[2];this._resolveApiRes(l,n,e,c,s,t,i)}return[2]})})}:(l.onabort=function(){l.onload=l.onerror=null},l.onerror=function(){d._throwApiError(e,n,c,s,i)},l.onload=function(){return r(d,void 0,void 0,function(){return o(this,function(r){return this._resolveApiRes(l,n,e,c,s,t,i),[2]})})}),l.open("POST",this.config.hideApiPath?this.config.serverUrl:this.config.serverUrl+s,!0),l.responseType=this.config.binaryTransport?"arraybuffer":"text",this.config.hideApiPath&&(n.__tsrpc_url__=s),a=(u=l).send,this.config.binaryTransport?(p=Blob.bind,[4,this.config.binaryEncoder(n)]):[3,2];case 1:return h=new(p.apply(Blob,[void 0,[y.sent()]])),[3,4];case 2:return[4,this.config.ptlEncoder(n)];case 3:h=y.sent(),y.label=4;case 4:return a.apply(u,[h]),[2]}})})});return h.onCancel(function(){a.config.showDebugLog&&console.debug("%cApiCancel%c #"+c+"%c "+s,"background: #999; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;"),f=!0,l.abort()}),h},t.prototype.getPtlUrl=function(t){var e=t.filename.replace(/\\/g,"/");if(this.config.protocolPath){if(0!==e.indexOf(this.config.protocolPath))throw console.log("PTL_PATH_ERR",t.name,e,this.config.protocolPath),new Error("Protocol "+t.name+" not in protocolPath.");e=e.substr(this.config.protocolPath.length)}return"/"!==(e=e.replace(/Ptl([^\/]+)\.[tj]s$/,"$1"))[0]&&(e="/"+e),e},t.prototype._throwApiError=function(t,e,n,r,o){this.config.showDebugLog&&console.debug("%cApiErr%c #"+n+"%c "+r,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,"Network error"),this._resReject(t,e,o,new i.TsrpcError("Network error","NETWORK_ERROR"))},t.prototype._resReject=function(t,e,n,r){n(r),this.onError&&this.onError({ptl:t,req:e,err:r})},t.prototype._resolveApiRes=function(t,e,n,u,a,c,s){return r(this,void 0,void 0,function(){var r,l;return o(this,function(o){switch(o.label){case 0:if(12029==t.status)return this._throwApiError(n,e,u,a,s),[2];o.label=1;case 1:return o.trys.push([1,6,,7]),this.config.binaryTransport?[4,this.config.binaryDecoder(t.response)]:[3,3];case 2:return l=o.sent(),[3,5];case 3:return[4,this.config.ptlDecoder(t.responseText||t.response)];case 4:l=o.sent(),o.label=5;case 5:return r=l,[3,7];case 6:return o.sent(),this.config.showDebugLog&&console.debug("%cApiErr%c #"+u+"%c "+a,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,"Response cannot be resolved"),this._resReject(n,e,s,new i.TsrpcError("Response cannot be resolved","RES_CANNOT_BE_RESOLVED")),[2];case 7:return null!=r.errmsg?(this.config.showDebugLog&&console.debug("%cApiErr%c #"+u+"%c "+a,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,r),this._resReject(n,e,s,new i.TsrpcError(r.errmsg,r.errinfo))):(this.config.showDebugLog&&console.debug("%cApiRes%c #"+u+"%c "+a,"background: #4ea85f; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,r),c(r),this.onResponse&&this.onResponse({ptl:n,req:e,res:r})),[2]}})})},t._sn=0,t}();e.default=c},function(t,e,n){"use strict";e.__esModule=!0;var r=n(18);e.DefaultClientConfig={serverUrl:"",protocolPath:"",hideApiPath:!1,ptlEncoder:JSON.stringify,ptlDecoder:JSON.parse,binaryTransport:!1,binaryEncoder:r.default.encode,binaryDecoder:r.default.decode,showDebugLog:!0}},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};e.__esModule=!0;var i=function(){function t(){}return t.encode=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){return[2,new Promise(function(e){var n=new Blob([JSON.stringify(t)],{type:"application/octet-stream"}),r=new FileReader;r.onload=function(){e(r.result)},r.readAsArrayBuffer(n)})]})})},t.decode=function(t){return new Promise(function(e){var n=new Blob([t]),r=new FileReader;r.onload=function(){e(JSON.parse(r.result))},r.readAsText(n)})},t}();e.default=i},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(20)),a=function(){function t(t){this.hhGame=t}return t.prototype.login=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,this.hhGame.apiClient.callApi(u.default,{ticket:t})];case 1:return e=n.sent(),t.fromUid&&this.hhGame.task.doTaskInviteGift(t.fromUid),[2,e]}})})},t.prototype.logout=function(){this.hhGame.currentUser=null,this.hhGame.cookie.ssoToken=void 0,this.hhGame.cookie=this.hhGame.cookie},t}();e.default=a},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/user/PtlLogin.ts");e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={setItem:function(t,e){return wx.setStorageSync(t,e)},getItem:function(t){return wx.getStorageSync(t)},removeItem:function(t){wx.removeStorageSync(t)},clear:function(){wx.clearStorageSync()},setItemAsync:function(t,e){return new Promise(function(n,r){wx.setStorage({key:t,data:e,success:function(t){n(t)},fail:function(t){r(t)}})})},getItemAsync:function(t){return new Promise(function(e,n){wx.getStorage({key:t,success:function(t){e(t)},fail:function(t){n(t)}})})},removeItemAsync:function(t){return new Promise(function(e,n){wx.removeStorage({key:t,success:function(t){e(t)},fail:function(t){n(t)}})})},clearAsync:function(){return wx.clearStorage()}};e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={setItem:function(t,e){localStorage.setItem(t,JSON.stringify(e))},getItem:function(t){try{var e=localStorage.getItem(t);return null==e?null:JSON.parse(e)}catch(e){return console.warn("Parse JSON Error when getItem from localStorage: "+t,localStorage.getItem(t),e),null}},removeItem:function(t){localStorage.removeItem(t)},clear:function(){localStorage.clear()},setItemAsync:function(t,e){return new Promise(function(n,o){try{r.setItem(t,e),n()}catch(t){o(t)}})},getItemAsync:function(t){return new Promise(function(e,n){try{e(r.getItem(t))}catch(t){n(t)}})},removeItemAsync:function(t){return new Promise(function(e,n){try{r.removeItem(t),e()}catch(t){n(t)}})},clearAsync:function(){return new Promise(function(t,e){try{r.clear(),t()}catch(t){e(t)}})}};e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(24)),a=i(n(25)),c=i(n(26)),s=function(){function t(t){this.hhGame=t}return t.prototype.getValues=function(t,e,n,i){return void 0===t&&(t={}),void 0===e&&(e=!0),void 0===n&&(n=!0),r(this,void 0,void 0,function(){var r;return o(this,function(o){switch(o.label){case 0:return[4,this.hhGame.apiClient.callApi(u.default,{ids:t.ids,tags:t.tags,cond:i,withTags:e,withConf:n})];case 1:return r=o.sent(),[2,r.values.map(function(t){return Object.assign({id:t.id,value:t.value},e?{tags:t.tags}:void 0,n?{name:t.conf.name,desc:t.conf.desc,icon:t.conf.icon}:void 0)})]}})})},t.prototype.getValue=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,this.getValues({ids:[t]},!1,!1)];case 1:return(e=n.sent()).length?[2,e[0].value]:[2,null]}})})},t.prototype.getConfigs=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.hhGame.apiClient.callApi(a.default,{ids:t.ids,tags:t.tags})];case 1:return[2,e.sent().configs]}})})},t.prototype.executeCommand=function(t,e,n,i){return r(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this.hhGame.apiClient.callApi(c.default,{command:{valueId:t,commandId:e,changeValue:n,meta:i}})];case 1:return[2,r.sent()]}})})},t}();e.default=s},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlGetValues.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlGetValueConfigs.ts");e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlExecuteValueCommand.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(28)),a=i(n(2)),c=i(n(29)),s=function(){function t(t){this.hhGame=t;var e=a.default.getItem("__deviceId");e||(e=c.default(),a.default.setItem("__deviceId",e)),this.deviceId=e,this.updateVisitId()}return Object.defineProperty(t.prototype,"visitId",{get:function(){return this._visitId},enumerable:!0,configurable:!0}),t.prototype.updateVisitId=function(){this._visitId=c.default()},t.prototype.submitAction=function(t,e){return r(this,void 0,void 0,function(){var n,r,i,a,c;return o(this,function(o){switch(o.label){case 0:n={url:void 0,referer:void 0,action:t,data:e,deviceId:this.deviceId,visitId:this._visitId,platform:this.hhGame.platform,windowSize:"Unknown",screenSize:"Unknown"};try{"Browser"===this.hhGame.platform?(n.url=window.location.href,n.referer=document.referrer,n.browser={userAgent:window.navigator.userAgent},n.windowSize=window.innerWidth+"x"+window.innerHeight,r=window.devicePixelRatio||1,n.screenSize=window.screen.width*r+"x"+window.screen.height*r):"Weapp"!==this.hhGame.platform&&"Wegame"!==this.hhGame.platform||(i="Weapp"===this.hhGame.platform?this.hhGame.weapp:this.hhGame.wegame,a=wx.getSystemInfoSync(),n.weapp={systemInfo:a,scene:i.launchOptions.scene,launchQuery:i.launchOptions.query},n.windowSize=a.windowWidth+"x"+a.windowHeight,n.screenSize=a.screenWidth*a.pixelRatio+"x"+a.screenHeight*a.pixelRatio,"Weapp"===this.hhGame.platform&&(c=getCurrentPages(),n.url=c.last().route,c.length>1&&(n.referer=c[c.length-2].route)))}catch(t){console.error("SubmitAction 设置平台信息失败",t)}return[4,this.hhGame.apiClient.callApi(u.default,n)];case 1:return o.sent(),[2]}})})},t}();e.default=s},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/stat/PtlSubmitAction.ts");e.default=o},function(t,e,n){var r=n(30),o=n(31);t.exports=function(t,e,n){var i=e&&n||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var u=(t=t||{}).random||(t.rng||r)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,e)for(var a=0;a<16;++a)e[i+a]=u[a];return e||o(u)}},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);t.exports=function(){return n(r),r}}else{var o=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}},function(t,e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);t.exports=function(t,e){var r=e||0,o=n;return[o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]]].join("")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={serverUrl:"https://honghegame.cn/hh/"};e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(34),a=i(n(2)),c=i(n(35)),s=i(n(36)),l=i(n(37)),f=i(n(38)),h=function(){function t(t){this.hhGame=t}return t.prototype.getTaskList=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.hhGame.apiClient.callApi(s.default,{})];case 1:return[2,t.sent()]}})})},t.prototype.doTask=function(t,e){return r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this.hhGame.apiClient.callApi(l.default,{taskId:t,doAmount:e,token:"xxx"})];case 1:return[2,n.sent()]}})})},t.prototype.getTaskAward=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.hhGame.apiClient.callApi(f.default,{taskId:t})];case 1:return[2,e.sent().award]}})})},t.prototype.getAwardNum=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.getTaskList()];case 1:return[2,t.sent().tasks.filter(function(t){return t.state==u.TaskState.completeTask}).length]}})})},t.prototype.doTaskInviteGift=function(t){if(this.hhGame.currentUser){var e=a.default.getItem("inviteGiftHistory");e&&e[t]||this.hhGame.apiClient.callApi(c.default,{fromUid:t}).then(function(n){var r;console.debug("触发邀请有礼成功",t),a.default.setItem("inviteGiftHistory",Object.assign({},e,((r={})[t]=1,r)))}).catch(function(e){console.warn("触发邀请有礼失败",t,e)})}},t}();e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.cannotAccept="cannotAccept",t.canAccept="canAccept",t.doTasking="doTasking",t.completeTask="completeTask",t.finishTask="finishTask",t.finishAll="finishAll"}(e.TaskState||(e.TaskState={}))},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlDoTaskInviteGift.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlGetTaskList.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlDoTask.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlGetTaskAward.ts");e.default=o}])); | ||
*/e.__esModule=!0,n(1);var r=n(16);e.default=r.default},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};e.__esModule=!0;var i=n(0),u=n(3),a=n(17);n(1);var c=function(){function t(t){this.config=Object.merge({},a.DefaultClientConfig,t),this.config.serverUrl=this.config.serverUrl.replace(/\/$/,""),this.config.protocolPath=this.config.protocolPath.replace(/\\/g,"/").replace(/\/+$/,"")}return t.getLastReqSn=function(){return this._sn},t.prototype.callApi=function(e,n,i){var a=this;void 0===n&&(n={}),void 0===i&&(i={});var c=++t._sn,s=this.getPtlUrl(e);this.config.showDebugLog&&console.debug("%cApiReq%c #"+c+"%c "+s,"border:solid 1px #4ea85f; color: #4ea85f; line-height: 1.5em; padding: 1px 3px;","color: #1b63bd;","color: #999;",n),this.onRequest&&this.onRequest({ptl:e,req:n});var l,f=!1,h=new u.default(function(t,i){return r(a,void 0,void 0,function(){var u,a,h,p,d=this;return o(this,function(y){switch(y.label){case 0:return l=new XMLHttpRequest,navigator.userAgent.indexOf("MSIE 8.0;")>-1?l.onreadystatechange=function(){return r(d,void 0,void 0,function(){var r=this;return o(this,function(o){if(4==l.readyState&&!f){if(0==l.status||null==l.response&&null==l.responseText)return setTimeout(function(){r._throwApiError(e,n,c,s,i)},0),[2];this._resolveApiRes(l,n,e,c,s,t,i)}return[2]})})}:(l.onabort=function(){l.onload=l.onerror=null},l.onerror=function(){d._throwApiError(e,n,c,s,i)},l.onload=function(){return r(d,void 0,void 0,function(){return o(this,function(r){return this._resolveApiRes(l,n,e,c,s,t,i),[2]})})}),l.open("POST",this.config.hideApiPath?this.config.serverUrl:this.config.serverUrl+s,!0),l.responseType=this.config.binaryTransport?"arraybuffer":"text",this.config.hideApiPath&&(n.__tsrpc_url__=s),a=(u=l).send,this.config.binaryTransport?(p=Blob.bind,[4,this.config.binaryEncoder(n)]):[3,2];case 1:return h=new(p.apply(Blob,[void 0,[y.sent()]])),[3,4];case 2:return[4,this.config.ptlEncoder(n)];case 3:h=y.sent(),y.label=4;case 4:return a.apply(u,[h]),[2]}})})});return h.onCancel(function(){a.config.showDebugLog&&console.debug("%cApiCancel%c #"+c+"%c "+s,"background: #999; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;"),f=!0,l.abort()}),h},t.prototype.getPtlUrl=function(t){var e=t.filename.replace(/\\/g,"/");if(this.config.protocolPath){if(0!==e.indexOf(this.config.protocolPath))throw console.log("PTL_PATH_ERR",t.name,e,this.config.protocolPath),new Error("Protocol "+t.name+" not in protocolPath.");e=e.substr(this.config.protocolPath.length)}return"/"!==(e=e.replace(/Ptl([^\/]+)\.[tj]s$/,"$1"))[0]&&(e="/"+e),e},t.prototype._throwApiError=function(t,e,n,r,o){this.config.showDebugLog&&console.debug("%cApiErr%c #"+n+"%c "+r,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,"Network error"),this._resReject(t,e,o,new i.TsrpcError("Network error","NETWORK_ERROR"))},t.prototype._resReject=function(t,e,n,r){n(r),this.onError&&this.onError({ptl:t,req:e,err:r})},t.prototype._resolveApiRes=function(t,e,n,u,a,c,s){return r(this,void 0,void 0,function(){var r,l;return o(this,function(o){switch(o.label){case 0:if(12029==t.status)return this._throwApiError(n,e,u,a,s),[2];o.label=1;case 1:return o.trys.push([1,6,,7]),this.config.binaryTransport?[4,this.config.binaryDecoder(t.response)]:[3,3];case 2:return l=o.sent(),[3,5];case 3:return[4,this.config.ptlDecoder(t.responseText||t.response)];case 4:l=o.sent(),o.label=5;case 5:return r=l,[3,7];case 6:return o.sent(),this.config.showDebugLog&&console.debug("%cApiErr%c #"+u+"%c "+a,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,"Response cannot be resolved"),this._resReject(n,e,s,new i.TsrpcError("Response cannot be resolved","RES_CANNOT_BE_RESOLVED")),[2];case 7:return null!=r.errmsg?(this.config.showDebugLog&&console.debug("%cApiErr%c #"+u+"%c "+a,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,r),this._resReject(n,e,s,new i.TsrpcError(r.errmsg,r.errinfo))):(this.config.showDebugLog&&console.debug("%cApiRes%c #"+u+"%c "+a,"background: #4ea85f; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,r),c(r),this.onResponse&&this.onResponse({ptl:n,req:e,res:r})),[2]}})})},t._sn=0,t}();e.default=c},function(t,e,n){"use strict";e.__esModule=!0;var r=n(18);e.DefaultClientConfig={serverUrl:"",protocolPath:"",hideApiPath:!1,ptlEncoder:JSON.stringify,ptlDecoder:JSON.parse,binaryTransport:!1,binaryEncoder:r.default.encode,binaryDecoder:r.default.decode,showDebugLog:!0}},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};e.__esModule=!0;var i=function(){function t(){}return t.encode=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){return[2,new Promise(function(e){var n=new Blob([JSON.stringify(t)],{type:"application/octet-stream"}),r=new FileReader;r.onload=function(){e(r.result)},r.readAsArrayBuffer(n)})]})})},t.decode=function(t){return new Promise(function(e){var n=new Blob([t]),r=new FileReader;r.onload=function(){e(JSON.parse(r.result))},r.readAsText(n)})},t}();e.default=i},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(20)),a=function(){function t(t){this.hhGame=t}return t.prototype.login=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,this.hhGame.apiClient.callApi(u.default,{ticket:t})];case 1:return e=n.sent(),t.fromUid&&this.hhGame.task.doTaskInviteGift(t.fromUid),[2,e]}})})},t.prototype.logout=function(){this.hhGame.currentUser=null,this.hhGame.cookie.ssoToken=void 0,this.hhGame.cookie=this.hhGame.cookie},t}();e.default=a},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/user/PtlLogin.ts");e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={setItem:function(t,e){return wx.setStorageSync(t,e)},getItem:function(t){return wx.getStorageSync(t)},removeItem:function(t){wx.removeStorageSync(t)},clear:function(){wx.clearStorageSync()},setItemAsync:function(t,e){return new Promise(function(n,r){wx.setStorage({key:t,data:e,success:function(t){n(t)},fail:function(t){r(t)}})})},getItemAsync:function(t){return new Promise(function(e,n){wx.getStorage({key:t,success:function(t){e(t)},fail:function(t){n(t)}})})},removeItemAsync:function(t){return new Promise(function(e,n){wx.removeStorage({key:t,success:function(t){e(t)},fail:function(t){n(t)}})})},clearAsync:function(){return wx.clearStorage()}};e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={setItem:function(t,e){localStorage.setItem(t,JSON.stringify(e))},getItem:function(t){try{var e=localStorage.getItem(t);return null==e?null:JSON.parse(e)}catch(e){return console.warn("Parse JSON Error when getItem from localStorage: "+t,localStorage.getItem(t),e),null}},removeItem:function(t){localStorage.removeItem(t)},clear:function(){localStorage.clear()},setItemAsync:function(t,e){return new Promise(function(n,o){try{r.setItem(t,e),n()}catch(t){o(t)}})},getItemAsync:function(t){return new Promise(function(e,n){try{e(r.getItem(t))}catch(t){n(t)}})},removeItemAsync:function(t){return new Promise(function(e,n){try{r.removeItem(t),e()}catch(t){n(t)}})},clearAsync:function(){return new Promise(function(t,e){try{r.clear(),t()}catch(t){e(t)}})}};e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(24)),a=i(n(25)),c=i(n(26)),s=function(){function t(t){this.hhGame=t}return t.prototype.getValues=function(t,e,n,i){return void 0===t&&(t={}),void 0===e&&(e=!0),void 0===n&&(n=!0),r(this,void 0,void 0,function(){var r;return o(this,function(o){switch(o.label){case 0:return[4,this.hhGame.apiClient.callApi(u.default,{ids:t.ids,tags:t.tags,cond:i,withTags:e,withConf:n})];case 1:return r=o.sent(),[2,r.values.map(function(t){return Object.assign({id:t.id,value:t.value},e?{tags:t.tags}:void 0,n?{name:t.conf.name,desc:t.conf.desc,icon:t.conf.icon}:void 0)})]}})})},t.prototype.getValue=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,this.getValues({ids:[t]},!1,!1)];case 1:return(e=n.sent()).length?[2,e[0].value]:[2,null]}})})},t.prototype.getConfigs=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.hhGame.apiClient.callApi(a.default,{ids:t.ids,tags:t.tags})];case 1:return[2,e.sent().configs]}})})},t.prototype.executeCommand=function(t,e,n,i){return r(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this.hhGame.apiClient.callApi(c.default,{command:{valueId:t,commandId:e,changeValue:n,meta:i}})];case 1:return[2,r.sent()]}})})},t}();e.default=s},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlGetValues.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlGetValueConfigs.ts");e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlExecuteValueCommand.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(28)),a=i(n(2)),c=i(n(29)),s=function(){function t(t){this.hhGame=t;var e=a.default.getItem("__deviceId");e||(e=c.default(),a.default.setItem("__deviceId",e)),this.deviceId=e,this.updateVisitId()}return Object.defineProperty(t.prototype,"visitId",{get:function(){return this._visitId},enumerable:!0,configurable:!0}),t.prototype.updateVisitId=function(){this._visitId=c.default()},t.prototype.submitAction=function(t,e){return r(this,void 0,void 0,function(){var n,r,i,a,c;return o(this,function(o){switch(o.label){case 0:n={url:void 0,referer:void 0,action:t,data:e,deviceId:this.deviceId,visitId:this._visitId,platform:this.hhGame.platform,windowSize:"Unknown",screenSize:"Unknown"};try{"Browser"===this.hhGame.platform?(n.url=window.location.href,n.referer=document.referrer,n.browser={userAgent:window.navigator.userAgent},n.windowSize=window.innerWidth+"x"+window.innerHeight,r=window.devicePixelRatio||1,n.screenSize=window.screen.width*r+"x"+window.screen.height*r):"Weapp"!==this.hhGame.platform&&"Wegame"!==this.hhGame.platform||(i="Weapp"===this.hhGame.platform?this.hhGame.weapp:this.hhGame.wegame,a=wx.getSystemInfoSync(),n.weapp={systemInfo:a,scene:i.launchOptions.scene,launchQuery:i.launchOptions.query},n.windowSize=a.windowWidth+"x"+a.windowHeight,n.screenSize=a.screenWidth*a.pixelRatio+"x"+a.screenHeight*a.pixelRatio,"Weapp"===this.hhGame.platform&&(c=getCurrentPages(),n.url=c.last().route,c.length>1&&(n.referer=c[c.length-2].route)))}catch(t){console.error("SubmitAction 设置平台信息失败",t)}return[4,this.hhGame.apiClient.callApi(u.default,n)];case 1:return o.sent(),[2]}})})},t}();e.default=s},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/stat/PtlSubmitAction.ts");e.default=o},function(t,e,n){var r=n(30),o=n(31);t.exports=function(t,e,n){var i=e&&n||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var u=(t=t||{}).random||(t.rng||r)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,e)for(var a=0;a<16;++a)e[i+a]=u[a];return e||o(u)}},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);t.exports=function(){return n(r),r}}else{var o=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}},function(t,e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);t.exports=function(t,e){var r=e||0,o=n;return[o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]]].join("")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={serverUrl:"https://honghegame.cn/hh/"};e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(34),a=i(n(2)),c=i(n(35)),s=i(n(36)),l=i(n(37)),f=i(n(38)),h=i(n(39)),p=i(n(40)),d=function(){function t(t){this.hhGame=t}return t.prototype.getTaskList=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.hhGame.apiClient.callApi(c.default,{})];case 1:return[2,t.sent()]}})})},t.prototype.doTask=function(t,e){return r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this.hhGame.apiClient.callApi(s.default,{taskId:t,doAmount:e,token:"xxx"})];case 1:return[2,n.sent()]}})})},t.prototype.getTaskAward=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.hhGame.apiClient.callApi(l.default,{taskId:t})];case 1:return[2,e.sent().award]}})})},t.prototype.getAwardNum=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.getTaskList()];case 1:return[2,t.sent().tasks.filter(function(t){return t.state==u.TaskState.completeTask}).length]}})})},t.prototype.doTaskInviteGift=function(t){if(this.hhGame.currentUser){var e=a.default.getItem("inviteGiftHistory");e&&e[t]||this.hhGame.apiClient.callApi(p.default,{fromUid:t}).then(function(n){var r;console.debug("触发邀请有礼成功",t),a.default.setItem("inviteGiftHistory",Object.assign({},e,((r={})[t]=1,r)))}).catch(function(e){console.warn("触发邀请有礼失败",t,e)})}},t.prototype.getInviteGiftData=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:if(!this.hhGame.currentUser)throw new Error("您还未登录");return[4,this.hhGame.apiClient.callApi(f.default,{})];case 1:return[2,t.sent()]}})})},t.prototype.getSingleInviteAward=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:if(!this.hhGame.currentUser)throw new Error("您还未登录");return[4,this.hhGame.apiClient.callApi(h.default,{friendUid:t})];case 1:return[2,e.sent().award]}})})},t}();e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.cannotAccept="cannotAccept",t.canAccept="canAccept",t.doTasking="doTasking",t.completeTask="completeTask",t.finishTask="finishTask",t.finishAll="finishAll"}(e.TaskState||(e.TaskState={}))},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlGetTaskList.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlDoTask.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlGetTaskAward.ts");e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/inviteGift/PtlGetInviteGiftData.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/inviteGift/PtlGetSingleInviteAward.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/inviteGift/PtlDoTaskInviteGift.ts",{needLogin:!0});e.default=o}])); |
{ | ||
"name": "hhgame", | ||
"version": "0.5.3", | ||
"version": "0.6.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,3 +11,3 @@ export default interface TaskListItem { | ||
award: { | ||
valueId: number; | ||
valueId: string; | ||
amount: number; | ||
@@ -20,5 +20,4 @@ name: string; | ||
state: TaskState; | ||
/** 距离下一次开启剩余的时间(毫秒),为undefined代表当前可用 */ | ||
/** 恢复的时间,为undefined代表当前可用 */ | ||
recoverTime?: number; | ||
firstCompletion?: boolean; | ||
} | ||
@@ -25,0 +24,0 @@ export declare enum TaskState { |
import TsRpcPtl from "tsrpc-protocol"; | ||
import TaskListItem from '../../models/TaskListItem'; | ||
import BaseRequest from '../BaseRequest'; | ||
declare const PtlGetTask: TsRpcPtl<ReqGetTask, ResGetTask>; | ||
export default PtlGetTask; | ||
export interface ReqGetTask { | ||
export interface ReqGetTask extends BaseRequest { | ||
taskId: string; | ||
@@ -7,0 +8,0 @@ } |
@@ -5,2 +5,4 @@ import HHGame from "../.."; | ||
import { ResDoTask } from '../../shared/protocols/task/PtlDoTask'; | ||
import { ResGetInviteGiftData } from '../../shared/protocols/task/inviteGift/PtlGetInviteGiftData'; | ||
import { ResGetSingleInviteAward } from '../../shared/protocols/task/inviteGift/PtlGetSingleInviteAward'; | ||
/** | ||
@@ -33,2 +35,11 @@ * 任务系统 API | ||
doTaskInviteGift(fromUid: string): void; | ||
/** | ||
* 邀请有礼,获取界面显示相关的数据 | ||
*/ | ||
getInviteGiftData(): Promise<ResGetInviteGiftData>; | ||
/** | ||
* 邀请有礼,领取单人的邀请奖励 | ||
* @param friendUid | ||
*/ | ||
getSingleInviteAward(friendUid: string): Promise<ResGetSingleInviteAward['award']>; | ||
} |
@@ -1,2 +0,2 @@ | ||
!function(t,e){for(var n in e)t[n]=e[n]}(exports,function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=43)}([function(t,e,n){"use strict";e.__esModule=!0;var r=n(11);e.TsrpcPtl=r.default;var o=n(12);e.TsrpcError=o.default,e.default=r.default},function(t,e,n){"use strict";e.__esModule=!0,n(7),n(8),n(9),"undefined"==typeof window||window.console||(window.console={},console.log=console.debug=console.info=console.warn=console.error=console.time=console.timeEnd=function(){}),console.debug||(console.debug=console.log)},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o,i=r(n(21)),u=r(n(22));if("object"==typeof wx&&wx.setStorage)o=i.default;else{if("undefined"==typeof localStorage)throw new Error("Can not find a implement for LocalStorage at current platfor.");o=u.default}e.default=o},function(t,e,n){"use strict";e.__esModule=!0;var r=function(){function t(t){var e=this;this.isDone=!1,this.isCanceled=!1,this._alwaysFunc=[],this._promise=new Promise(function(n,r){e._promiseRj=r;t(function(t){e.isCanceled||(e.isDone=!0,e._alwaysFunc.forEach(function(t){t.call(e)}),n(t),e._cancelFunc=void 0,e._alwaysFunc=void 0)},function(t){e.isCanceled||(e.isDone=!0,e._alwaysFunc.forEach(function(t){t.call(e)}),r(t),e._cancelFunc=void 0,e._alwaysFunc=void 0)})})}return t.prototype.onCancel=function(t){return this._cancelFunc?this._cancelFunc.push(t):this._cancelFunc=[t],this},t.prototype.cancel=function(){if(this.isDone)return!1;if(this.isCanceled)return!0;if(this.isCanceled=!0,this._cancelFunc){for(var t=0,e=this._cancelFunc;t<e.length;t++){(0,e[t])()}this._cancelFunc=void 0}return this._promise=this._promise.catch(function(){}),this._promiseRj(),this._promiseRj=void 0,this._promise=void 0,this._alwaysFunc=void 0,!0},t.prototype.always=function(t){return this.isCanceled||(this.isDone?t.call(this):this._alwaysFunc.push(t)),this},t.prototype.then=function(t,e){return this.isCanceled||(this._promise=this._promise.then(t,e)),this},t.prototype.catch=function(t){return this.isCanceled||(this._promise=this._promise.catch(t)),this},t.all=function(e){var n=new t(function(t,n){Promise.all(e).then(function(e){t(e)}).catch(function(t){n(t)})});return n.onCancel(function(){e.forEach(function(t){t.cancel()})}),n},t}();e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(5)),a=i(n(6)),c=i(n(15)),s=i(n(19)),l=i(n(2)),f=i(n(23)),h=i(n(27)),p=i(n(32)),d=i(n(33)),y="undefined"==typeof wx?c.default:a.default,v=function(){function t(t,e,n){void 0===e&&(e="Browser");var i=this;this.apiClient=new y({serverUrl:p.default.serverUrl}),this._cookie=l.default.getItem("hhgame_cookie")||{},this.currentUser=null,this.user=new s.default(this),this.valuePackage=new f.default(this),this.rank=new u.default(this),this.stat=new h.default(this),this.task=new d.default(this),this.appId=t,this.platform=e,n&&(this.apiClient.config.serverUrl=n),this.apiClient.onRequest=function(t){i.cookie&&(t.req.__cookie=i.cookie,t.req.__appId=i.appId)},this.apiClient.onResponse=function(t){return r(i,void 0,void 0,function(){return o(this,function(e){return t.res.__cookie&&(this.cookie=t.res.__cookie),[2]})})}}return Object.defineProperty(t.prototype,"cookie",{get:function(){return this._cookie},set:function(t){l.default.setItem("hhgame_cookie123",t),this._cookie=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isWeappOrWegame",{get:function(){return"Weapp"===this.platform||"Wegame"===this.platform},enumerable:!0,configurable:!0}),t}();e.default=v},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){this.hhGame=t}return t.prototype.getUserRankList=function(t,e,n,i){return r(this,void 0,void 0,function(){return o(this,function(t){throw new Error("TODO")})})},t}();e.default=i},function(t,e,n){"use strict"; | ||
!function(t,e){for(var n in e)t[n]=e[n]}(exports,function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=45)}([function(t,e,n){"use strict";e.__esModule=!0;var r=n(11);e.TsrpcPtl=r.default;var o=n(12);e.TsrpcError=o.default,e.default=r.default},function(t,e,n){"use strict";e.__esModule=!0,n(7),n(8),n(9),"undefined"==typeof window||window.console||(window.console={},console.log=console.debug=console.info=console.warn=console.error=console.time=console.timeEnd=function(){}),console.debug||(console.debug=console.log)},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o,i=r(n(21)),u=r(n(22));if("object"==typeof wx&&wx.setStorage)o=i.default;else{if("undefined"==typeof localStorage)throw new Error("Can not find a implement for LocalStorage at current platfor.");o=u.default}e.default=o},function(t,e,n){"use strict";e.__esModule=!0;var r=function(){function t(t){var e=this;this.isDone=!1,this.isCanceled=!1,this._alwaysFunc=[],this._promise=new Promise(function(n,r){e._promiseRj=r;t(function(t){e.isCanceled||(e.isDone=!0,e._alwaysFunc.forEach(function(t){t.call(e)}),n(t),e._cancelFunc=void 0,e._alwaysFunc=void 0)},function(t){e.isCanceled||(e.isDone=!0,e._alwaysFunc.forEach(function(t){t.call(e)}),r(t),e._cancelFunc=void 0,e._alwaysFunc=void 0)})})}return t.prototype.onCancel=function(t){return this._cancelFunc?this._cancelFunc.push(t):this._cancelFunc=[t],this},t.prototype.cancel=function(){if(this.isDone)return!1;if(this.isCanceled)return!0;if(this.isCanceled=!0,this._cancelFunc){for(var t=0,e=this._cancelFunc;t<e.length;t++){(0,e[t])()}this._cancelFunc=void 0}return this._promise=this._promise.catch(function(){}),this._promiseRj(),this._promiseRj=void 0,this._promise=void 0,this._alwaysFunc=void 0,!0},t.prototype.always=function(t){return this.isCanceled||(this.isDone?t.call(this):this._alwaysFunc.push(t)),this},t.prototype.then=function(t,e){return this.isCanceled||(this._promise=this._promise.then(t,e)),this},t.prototype.catch=function(t){return this.isCanceled||(this._promise=this._promise.catch(t)),this},t.all=function(e){var n=new t(function(t,n){Promise.all(e).then(function(e){t(e)}).catch(function(t){n(t)})});return n.onCancel(function(){e.forEach(function(t){t.cancel()})}),n},t}();e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(5)),a=i(n(6)),c=i(n(15)),s=i(n(19)),l=i(n(2)),f=i(n(23)),h=i(n(27)),p=i(n(32)),d=i(n(33)),y="undefined"==typeof wx?c.default:a.default,v=function(){function t(t,e,n){void 0===e&&(e="Browser");var i=this;this.apiClient=new y({serverUrl:p.default.serverUrl}),this._cookie=l.default.getItem("hhgame_cookie")||{},this.currentUser=null,this.user=new s.default(this),this.valuePackage=new f.default(this),this.rank=new u.default(this),this.stat=new h.default(this),this.task=new d.default(this),this.appId=t,this.platform=e,n&&(this.apiClient.config.serverUrl=n),this.apiClient.onRequest=function(t){i.cookie&&(t.req.__cookie=i.cookie,t.req.__appId=i.appId)},this.apiClient.onResponse=function(t){return r(i,void 0,void 0,function(){return o(this,function(e){return t.res.__cookie&&(this.cookie=t.res.__cookie),[2]})})}}return Object.defineProperty(t.prototype,"cookie",{get:function(){return this._cookie},set:function(t){l.default.setItem("hhgame_cookie123",t),this._cookie=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isWeappOrWegame",{get:function(){return"Weapp"===this.platform||"Wegame"===this.platform},enumerable:!0,configurable:!0}),t}();e.default=v},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){this.hhGame=t}return t.prototype.getUserRankList=function(t,e,n,i){return r(this,void 0,void 0,function(){return o(this,function(t){throw new Error("TODO")})})},t}();e.default=i},function(t,e,n){"use strict"; | ||
/** | ||
@@ -15,2 +15,2 @@ * TSRPC Browser Client | ||
* @license Apache-2.0 | ||
*/e.__esModule=!0,n(1);var r=n(16);e.default=r.default},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};e.__esModule=!0;var i=n(0),u=n(3),a=n(17);n(1);var c=function(){function t(t){this.config=Object.merge({},a.DefaultClientConfig,t),this.config.serverUrl=this.config.serverUrl.replace(/\/$/,""),this.config.protocolPath=this.config.protocolPath.replace(/\\/g,"/").replace(/\/+$/,"")}return t.getLastReqSn=function(){return this._sn},t.prototype.callApi=function(e,n,i){var a=this;void 0===n&&(n={}),void 0===i&&(i={});var c=++t._sn,s=this.getPtlUrl(e);this.config.showDebugLog&&console.debug("%cApiReq%c #"+c+"%c "+s,"border:solid 1px #4ea85f; color: #4ea85f; line-height: 1.5em; padding: 1px 3px;","color: #1b63bd;","color: #999;",n),this.onRequest&&this.onRequest({ptl:e,req:n});var l,f=!1,h=new u.default(function(t,i){return r(a,void 0,void 0,function(){var u,a,h,p,d=this;return o(this,function(y){switch(y.label){case 0:return l=new XMLHttpRequest,navigator.userAgent.indexOf("MSIE 8.0;")>-1?l.onreadystatechange=function(){return r(d,void 0,void 0,function(){var r=this;return o(this,function(o){if(4==l.readyState&&!f){if(0==l.status||null==l.response&&null==l.responseText)return setTimeout(function(){r._throwApiError(e,n,c,s,i)},0),[2];this._resolveApiRes(l,n,e,c,s,t,i)}return[2]})})}:(l.onabort=function(){l.onload=l.onerror=null},l.onerror=function(){d._throwApiError(e,n,c,s,i)},l.onload=function(){return r(d,void 0,void 0,function(){return o(this,function(r){return this._resolveApiRes(l,n,e,c,s,t,i),[2]})})}),l.open("POST",this.config.hideApiPath?this.config.serverUrl:this.config.serverUrl+s,!0),l.responseType=this.config.binaryTransport?"arraybuffer":"text",this.config.hideApiPath&&(n.__tsrpc_url__=s),a=(u=l).send,this.config.binaryTransport?(p=Blob.bind,[4,this.config.binaryEncoder(n)]):[3,2];case 1:return h=new(p.apply(Blob,[void 0,[y.sent()]])),[3,4];case 2:return[4,this.config.ptlEncoder(n)];case 3:h=y.sent(),y.label=4;case 4:return a.apply(u,[h]),[2]}})})});return h.onCancel(function(){a.config.showDebugLog&&console.debug("%cApiCancel%c #"+c+"%c "+s,"background: #999; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;"),f=!0,l.abort()}),h},t.prototype.getPtlUrl=function(t){var e=t.filename.replace(/\\/g,"/");if(this.config.protocolPath){if(0!==e.indexOf(this.config.protocolPath))throw console.log("PTL_PATH_ERR",t.name,e,this.config.protocolPath),new Error("Protocol "+t.name+" not in protocolPath.");e=e.substr(this.config.protocolPath.length)}return"/"!==(e=e.replace(/Ptl([^\/]+)\.[tj]s$/,"$1"))[0]&&(e="/"+e),e},t.prototype._throwApiError=function(t,e,n,r,o){this.config.showDebugLog&&console.debug("%cApiErr%c #"+n+"%c "+r,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,"Network error"),this._resReject(t,e,o,new i.TsrpcError("Network error","NETWORK_ERROR"))},t.prototype._resReject=function(t,e,n,r){n(r),this.onError&&this.onError({ptl:t,req:e,err:r})},t.prototype._resolveApiRes=function(t,e,n,u,a,c,s){return r(this,void 0,void 0,function(){var r,l;return o(this,function(o){switch(o.label){case 0:if(12029==t.status)return this._throwApiError(n,e,u,a,s),[2];o.label=1;case 1:return o.trys.push([1,6,,7]),this.config.binaryTransport?[4,this.config.binaryDecoder(t.response)]:[3,3];case 2:return l=o.sent(),[3,5];case 3:return[4,this.config.ptlDecoder(t.responseText||t.response)];case 4:l=o.sent(),o.label=5;case 5:return r=l,[3,7];case 6:return o.sent(),this.config.showDebugLog&&console.debug("%cApiErr%c #"+u+"%c "+a,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,"Response cannot be resolved"),this._resReject(n,e,s,new i.TsrpcError("Response cannot be resolved","RES_CANNOT_BE_RESOLVED")),[2];case 7:return null!=r.errmsg?(this.config.showDebugLog&&console.debug("%cApiErr%c #"+u+"%c "+a,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,r),this._resReject(n,e,s,new i.TsrpcError(r.errmsg,r.errinfo))):(this.config.showDebugLog&&console.debug("%cApiRes%c #"+u+"%c "+a,"background: #4ea85f; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,r),c(r),this.onResponse&&this.onResponse({ptl:n,req:e,res:r})),[2]}})})},t._sn=0,t}();e.default=c},function(t,e,n){"use strict";e.__esModule=!0;var r=n(18);e.DefaultClientConfig={serverUrl:"",protocolPath:"",hideApiPath:!1,ptlEncoder:JSON.stringify,ptlDecoder:JSON.parse,binaryTransport:!1,binaryEncoder:r.default.encode,binaryDecoder:r.default.decode,showDebugLog:!0}},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};e.__esModule=!0;var i=function(){function t(){}return t.encode=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){return[2,new Promise(function(e){var n=new Blob([JSON.stringify(t)],{type:"application/octet-stream"}),r=new FileReader;r.onload=function(){e(r.result)},r.readAsArrayBuffer(n)})]})})},t.decode=function(t){return new Promise(function(e){var n=new Blob([t]),r=new FileReader;r.onload=function(){e(JSON.parse(r.result))},r.readAsText(n)})},t}();e.default=i},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(20)),a=function(){function t(t){this.hhGame=t}return t.prototype.login=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,this.hhGame.apiClient.callApi(u.default,{ticket:t})];case 1:return e=n.sent(),t.fromUid&&this.hhGame.task.doTaskInviteGift(t.fromUid),[2,e]}})})},t.prototype.logout=function(){this.hhGame.currentUser=null,this.hhGame.cookie.ssoToken=void 0,this.hhGame.cookie=this.hhGame.cookie},t}();e.default=a},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/user/PtlLogin.ts");e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={setItem:function(t,e){return wx.setStorageSync(t,e)},getItem:function(t){return wx.getStorageSync(t)},removeItem:function(t){wx.removeStorageSync(t)},clear:function(){wx.clearStorageSync()},setItemAsync:function(t,e){return new Promise(function(n,r){wx.setStorage({key:t,data:e,success:function(t){n(t)},fail:function(t){r(t)}})})},getItemAsync:function(t){return new Promise(function(e,n){wx.getStorage({key:t,success:function(t){e(t)},fail:function(t){n(t)}})})},removeItemAsync:function(t){return new Promise(function(e,n){wx.removeStorage({key:t,success:function(t){e(t)},fail:function(t){n(t)}})})},clearAsync:function(){return wx.clearStorage()}};e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={setItem:function(t,e){localStorage.setItem(t,JSON.stringify(e))},getItem:function(t){try{var e=localStorage.getItem(t);return null==e?null:JSON.parse(e)}catch(e){return console.warn("Parse JSON Error when getItem from localStorage: "+t,localStorage.getItem(t),e),null}},removeItem:function(t){localStorage.removeItem(t)},clear:function(){localStorage.clear()},setItemAsync:function(t,e){return new Promise(function(n,o){try{r.setItem(t,e),n()}catch(t){o(t)}})},getItemAsync:function(t){return new Promise(function(e,n){try{e(r.getItem(t))}catch(t){n(t)}})},removeItemAsync:function(t){return new Promise(function(e,n){try{r.removeItem(t),e()}catch(t){n(t)}})},clearAsync:function(){return new Promise(function(t,e){try{r.clear(),t()}catch(t){e(t)}})}};e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(24)),a=i(n(25)),c=i(n(26)),s=function(){function t(t){this.hhGame=t}return t.prototype.getValues=function(t,e,n,i){return void 0===t&&(t={}),void 0===e&&(e=!0),void 0===n&&(n=!0),r(this,void 0,void 0,function(){var r;return o(this,function(o){switch(o.label){case 0:return[4,this.hhGame.apiClient.callApi(u.default,{ids:t.ids,tags:t.tags,cond:i,withTags:e,withConf:n})];case 1:return r=o.sent(),[2,r.values.map(function(t){return Object.assign({id:t.id,value:t.value},e?{tags:t.tags}:void 0,n?{name:t.conf.name,desc:t.conf.desc,icon:t.conf.icon}:void 0)})]}})})},t.prototype.getValue=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,this.getValues({ids:[t]},!1,!1)];case 1:return(e=n.sent()).length?[2,e[0].value]:[2,null]}})})},t.prototype.getConfigs=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.hhGame.apiClient.callApi(a.default,{ids:t.ids,tags:t.tags})];case 1:return[2,e.sent().configs]}})})},t.prototype.executeCommand=function(t,e,n,i){return r(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this.hhGame.apiClient.callApi(c.default,{command:{valueId:t,commandId:e,changeValue:n,meta:i}})];case 1:return[2,r.sent()]}})})},t}();e.default=s},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlGetValues.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlGetValueConfigs.ts");e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlExecuteValueCommand.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(28)),a=i(n(2)),c=i(n(29)),s=function(){function t(t){this.hhGame=t;var e=a.default.getItem("__deviceId");e||(e=c.default(),a.default.setItem("__deviceId",e)),this.deviceId=e,this.updateVisitId()}return Object.defineProperty(t.prototype,"visitId",{get:function(){return this._visitId},enumerable:!0,configurable:!0}),t.prototype.updateVisitId=function(){this._visitId=c.default()},t.prototype.submitAction=function(t,e){return r(this,void 0,void 0,function(){var n,r,i,a,c;return o(this,function(o){switch(o.label){case 0:n={url:void 0,referer:void 0,action:t,data:e,deviceId:this.deviceId,visitId:this._visitId,platform:this.hhGame.platform,windowSize:"Unknown",screenSize:"Unknown"};try{"Browser"===this.hhGame.platform?(n.url=window.location.href,n.referer=document.referrer,n.browser={userAgent:window.navigator.userAgent},n.windowSize=window.innerWidth+"x"+window.innerHeight,r=window.devicePixelRatio||1,n.screenSize=window.screen.width*r+"x"+window.screen.height*r):"Weapp"!==this.hhGame.platform&&"Wegame"!==this.hhGame.platform||(i="Weapp"===this.hhGame.platform?this.hhGame.weapp:this.hhGame.wegame,a=wx.getSystemInfoSync(),n.weapp={systemInfo:a,scene:i.launchOptions.scene,launchQuery:i.launchOptions.query},n.windowSize=a.windowWidth+"x"+a.windowHeight,n.screenSize=a.screenWidth*a.pixelRatio+"x"+a.screenHeight*a.pixelRatio,"Weapp"===this.hhGame.platform&&(c=getCurrentPages(),n.url=c.last().route,c.length>1&&(n.referer=c[c.length-2].route)))}catch(t){console.error("SubmitAction 设置平台信息失败",t)}return[4,this.hhGame.apiClient.callApi(u.default,n)];case 1:return o.sent(),[2]}})})},t}();e.default=s},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/stat/PtlSubmitAction.ts");e.default=o},function(t,e,n){var r=n(30),o=n(31);t.exports=function(t,e,n){var i=e&&n||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var u=(t=t||{}).random||(t.rng||r)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,e)for(var a=0;a<16;++a)e[i+a]=u[a];return e||o(u)}},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);t.exports=function(){return n(r),r}}else{var o=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}},function(t,e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);t.exports=function(t,e){var r=e||0,o=n;return[o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]]].join("")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={serverUrl:"https://honghegame.cn/hh/"};e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(34),a=i(n(2)),c=i(n(35)),s=i(n(36)),l=i(n(37)),f=i(n(38)),h=function(){function t(t){this.hhGame=t}return t.prototype.getTaskList=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.hhGame.apiClient.callApi(s.default,{})];case 1:return[2,t.sent()]}})})},t.prototype.doTask=function(t,e){return r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this.hhGame.apiClient.callApi(l.default,{taskId:t,doAmount:e,token:"xxx"})];case 1:return[2,n.sent()]}})})},t.prototype.getTaskAward=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.hhGame.apiClient.callApi(f.default,{taskId:t})];case 1:return[2,e.sent().award]}})})},t.prototype.getAwardNum=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.getTaskList()];case 1:return[2,t.sent().tasks.filter(function(t){return t.state==u.TaskState.completeTask}).length]}})})},t.prototype.doTaskInviteGift=function(t){if(this.hhGame.currentUser){var e=a.default.getItem("inviteGiftHistory");e&&e[t]||this.hhGame.apiClient.callApi(c.default,{fromUid:t}).then(function(n){var r;console.debug("触发邀请有礼成功",t),a.default.setItem("inviteGiftHistory",Object.assign({},e,((r={})[t]=1,r)))}).catch(function(e){console.warn("触发邀请有礼失败",t,e)})}},t}();e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.cannotAccept="cannotAccept",t.canAccept="canAccept",t.doTasking="doTasking",t.completeTask="completeTask",t.finishTask="finishTask",t.finishAll="finishAll"}(e.TaskState||(e.TaskState={}))},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlDoTaskInviteGift.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlGetTaskList.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlDoTask.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlGetTaskAward.ts");e.default=o},,,,,function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=o(n(4)),u=o(n(44)),a=function(t){function e(e,n){var r=t.call(this,e,"Weapp",n)||this;return r.weapp=new u.default(r),r}return r(e,t),e}(i.default);e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this._launchOptions={scene:0,path:"",query:{}},this.hhGame=t}return Object.defineProperty(t.prototype,"launchOptions",{get:function(){return this._launchOptions},enumerable:!0,configurable:!0}),t.prototype.onShow=function(t){this._launchOptions=t,this.hhGame.stat.updateVisitId()},t}();e.default=r}])); | ||
*/e.__esModule=!0,n(1);var r=n(16);e.default=r.default},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};e.__esModule=!0;var i=n(0),u=n(3),a=n(17);n(1);var c=function(){function t(t){this.config=Object.merge({},a.DefaultClientConfig,t),this.config.serverUrl=this.config.serverUrl.replace(/\/$/,""),this.config.protocolPath=this.config.protocolPath.replace(/\\/g,"/").replace(/\/+$/,"")}return t.getLastReqSn=function(){return this._sn},t.prototype.callApi=function(e,n,i){var a=this;void 0===n&&(n={}),void 0===i&&(i={});var c=++t._sn,s=this.getPtlUrl(e);this.config.showDebugLog&&console.debug("%cApiReq%c #"+c+"%c "+s,"border:solid 1px #4ea85f; color: #4ea85f; line-height: 1.5em; padding: 1px 3px;","color: #1b63bd;","color: #999;",n),this.onRequest&&this.onRequest({ptl:e,req:n});var l,f=!1,h=new u.default(function(t,i){return r(a,void 0,void 0,function(){var u,a,h,p,d=this;return o(this,function(y){switch(y.label){case 0:return l=new XMLHttpRequest,navigator.userAgent.indexOf("MSIE 8.0;")>-1?l.onreadystatechange=function(){return r(d,void 0,void 0,function(){var r=this;return o(this,function(o){if(4==l.readyState&&!f){if(0==l.status||null==l.response&&null==l.responseText)return setTimeout(function(){r._throwApiError(e,n,c,s,i)},0),[2];this._resolveApiRes(l,n,e,c,s,t,i)}return[2]})})}:(l.onabort=function(){l.onload=l.onerror=null},l.onerror=function(){d._throwApiError(e,n,c,s,i)},l.onload=function(){return r(d,void 0,void 0,function(){return o(this,function(r){return this._resolveApiRes(l,n,e,c,s,t,i),[2]})})}),l.open("POST",this.config.hideApiPath?this.config.serverUrl:this.config.serverUrl+s,!0),l.responseType=this.config.binaryTransport?"arraybuffer":"text",this.config.hideApiPath&&(n.__tsrpc_url__=s),a=(u=l).send,this.config.binaryTransport?(p=Blob.bind,[4,this.config.binaryEncoder(n)]):[3,2];case 1:return h=new(p.apply(Blob,[void 0,[y.sent()]])),[3,4];case 2:return[4,this.config.ptlEncoder(n)];case 3:h=y.sent(),y.label=4;case 4:return a.apply(u,[h]),[2]}})})});return h.onCancel(function(){a.config.showDebugLog&&console.debug("%cApiCancel%c #"+c+"%c "+s,"background: #999; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;"),f=!0,l.abort()}),h},t.prototype.getPtlUrl=function(t){var e=t.filename.replace(/\\/g,"/");if(this.config.protocolPath){if(0!==e.indexOf(this.config.protocolPath))throw console.log("PTL_PATH_ERR",t.name,e,this.config.protocolPath),new Error("Protocol "+t.name+" not in protocolPath.");e=e.substr(this.config.protocolPath.length)}return"/"!==(e=e.replace(/Ptl([^\/]+)\.[tj]s$/,"$1"))[0]&&(e="/"+e),e},t.prototype._throwApiError=function(t,e,n,r,o){this.config.showDebugLog&&console.debug("%cApiErr%c #"+n+"%c "+r,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,"Network error"),this._resReject(t,e,o,new i.TsrpcError("Network error","NETWORK_ERROR"))},t.prototype._resReject=function(t,e,n,r){n(r),this.onError&&this.onError({ptl:t,req:e,err:r})},t.prototype._resolveApiRes=function(t,e,n,u,a,c,s){return r(this,void 0,void 0,function(){var r,l;return o(this,function(o){switch(o.label){case 0:if(12029==t.status)return this._throwApiError(n,e,u,a,s),[2];o.label=1;case 1:return o.trys.push([1,6,,7]),this.config.binaryTransport?[4,this.config.binaryDecoder(t.response)]:[3,3];case 2:return l=o.sent(),[3,5];case 3:return[4,this.config.ptlDecoder(t.responseText||t.response)];case 4:l=o.sent(),o.label=5;case 5:return r=l,[3,7];case 6:return o.sent(),this.config.showDebugLog&&console.debug("%cApiErr%c #"+u+"%c "+a,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,"Response cannot be resolved"),this._resReject(n,e,s,new i.TsrpcError("Response cannot be resolved","RES_CANNOT_BE_RESOLVED")),[2];case 7:return null!=r.errmsg?(this.config.showDebugLog&&console.debug("%cApiErr%c #"+u+"%c "+a,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,r),this._resReject(n,e,s,new i.TsrpcError(r.errmsg,r.errinfo))):(this.config.showDebugLog&&console.debug("%cApiRes%c #"+u+"%c "+a,"background: #4ea85f; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,r),c(r),this.onResponse&&this.onResponse({ptl:n,req:e,res:r})),[2]}})})},t._sn=0,t}();e.default=c},function(t,e,n){"use strict";e.__esModule=!0;var r=n(18);e.DefaultClientConfig={serverUrl:"",protocolPath:"",hideApiPath:!1,ptlEncoder:JSON.stringify,ptlDecoder:JSON.parse,binaryTransport:!1,binaryEncoder:r.default.encode,binaryDecoder:r.default.decode,showDebugLog:!0}},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};e.__esModule=!0;var i=function(){function t(){}return t.encode=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){return[2,new Promise(function(e){var n=new Blob([JSON.stringify(t)],{type:"application/octet-stream"}),r=new FileReader;r.onload=function(){e(r.result)},r.readAsArrayBuffer(n)})]})})},t.decode=function(t){return new Promise(function(e){var n=new Blob([t]),r=new FileReader;r.onload=function(){e(JSON.parse(r.result))},r.readAsText(n)})},t}();e.default=i},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(20)),a=function(){function t(t){this.hhGame=t}return t.prototype.login=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,this.hhGame.apiClient.callApi(u.default,{ticket:t})];case 1:return e=n.sent(),t.fromUid&&this.hhGame.task.doTaskInviteGift(t.fromUid),[2,e]}})})},t.prototype.logout=function(){this.hhGame.currentUser=null,this.hhGame.cookie.ssoToken=void 0,this.hhGame.cookie=this.hhGame.cookie},t}();e.default=a},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/user/PtlLogin.ts");e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={setItem:function(t,e){return wx.setStorageSync(t,e)},getItem:function(t){return wx.getStorageSync(t)},removeItem:function(t){wx.removeStorageSync(t)},clear:function(){wx.clearStorageSync()},setItemAsync:function(t,e){return new Promise(function(n,r){wx.setStorage({key:t,data:e,success:function(t){n(t)},fail:function(t){r(t)}})})},getItemAsync:function(t){return new Promise(function(e,n){wx.getStorage({key:t,success:function(t){e(t)},fail:function(t){n(t)}})})},removeItemAsync:function(t){return new Promise(function(e,n){wx.removeStorage({key:t,success:function(t){e(t)},fail:function(t){n(t)}})})},clearAsync:function(){return wx.clearStorage()}};e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={setItem:function(t,e){localStorage.setItem(t,JSON.stringify(e))},getItem:function(t){try{var e=localStorage.getItem(t);return null==e?null:JSON.parse(e)}catch(e){return console.warn("Parse JSON Error when getItem from localStorage: "+t,localStorage.getItem(t),e),null}},removeItem:function(t){localStorage.removeItem(t)},clear:function(){localStorage.clear()},setItemAsync:function(t,e){return new Promise(function(n,o){try{r.setItem(t,e),n()}catch(t){o(t)}})},getItemAsync:function(t){return new Promise(function(e,n){try{e(r.getItem(t))}catch(t){n(t)}})},removeItemAsync:function(t){return new Promise(function(e,n){try{r.removeItem(t),e()}catch(t){n(t)}})},clearAsync:function(){return new Promise(function(t,e){try{r.clear(),t()}catch(t){e(t)}})}};e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(24)),a=i(n(25)),c=i(n(26)),s=function(){function t(t){this.hhGame=t}return t.prototype.getValues=function(t,e,n,i){return void 0===t&&(t={}),void 0===e&&(e=!0),void 0===n&&(n=!0),r(this,void 0,void 0,function(){var r;return o(this,function(o){switch(o.label){case 0:return[4,this.hhGame.apiClient.callApi(u.default,{ids:t.ids,tags:t.tags,cond:i,withTags:e,withConf:n})];case 1:return r=o.sent(),[2,r.values.map(function(t){return Object.assign({id:t.id,value:t.value},e?{tags:t.tags}:void 0,n?{name:t.conf.name,desc:t.conf.desc,icon:t.conf.icon}:void 0)})]}})})},t.prototype.getValue=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,this.getValues({ids:[t]},!1,!1)];case 1:return(e=n.sent()).length?[2,e[0].value]:[2,null]}})})},t.prototype.getConfigs=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.hhGame.apiClient.callApi(a.default,{ids:t.ids,tags:t.tags})];case 1:return[2,e.sent().configs]}})})},t.prototype.executeCommand=function(t,e,n,i){return r(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this.hhGame.apiClient.callApi(c.default,{command:{valueId:t,commandId:e,changeValue:n,meta:i}})];case 1:return[2,r.sent()]}})})},t}();e.default=s},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlGetValues.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlGetValueConfigs.ts");e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlExecuteValueCommand.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(28)),a=i(n(2)),c=i(n(29)),s=function(){function t(t){this.hhGame=t;var e=a.default.getItem("__deviceId");e||(e=c.default(),a.default.setItem("__deviceId",e)),this.deviceId=e,this.updateVisitId()}return Object.defineProperty(t.prototype,"visitId",{get:function(){return this._visitId},enumerable:!0,configurable:!0}),t.prototype.updateVisitId=function(){this._visitId=c.default()},t.prototype.submitAction=function(t,e){return r(this,void 0,void 0,function(){var n,r,i,a,c;return o(this,function(o){switch(o.label){case 0:n={url:void 0,referer:void 0,action:t,data:e,deviceId:this.deviceId,visitId:this._visitId,platform:this.hhGame.platform,windowSize:"Unknown",screenSize:"Unknown"};try{"Browser"===this.hhGame.platform?(n.url=window.location.href,n.referer=document.referrer,n.browser={userAgent:window.navigator.userAgent},n.windowSize=window.innerWidth+"x"+window.innerHeight,r=window.devicePixelRatio||1,n.screenSize=window.screen.width*r+"x"+window.screen.height*r):"Weapp"!==this.hhGame.platform&&"Wegame"!==this.hhGame.platform||(i="Weapp"===this.hhGame.platform?this.hhGame.weapp:this.hhGame.wegame,a=wx.getSystemInfoSync(),n.weapp={systemInfo:a,scene:i.launchOptions.scene,launchQuery:i.launchOptions.query},n.windowSize=a.windowWidth+"x"+a.windowHeight,n.screenSize=a.screenWidth*a.pixelRatio+"x"+a.screenHeight*a.pixelRatio,"Weapp"===this.hhGame.platform&&(c=getCurrentPages(),n.url=c.last().route,c.length>1&&(n.referer=c[c.length-2].route)))}catch(t){console.error("SubmitAction 设置平台信息失败",t)}return[4,this.hhGame.apiClient.callApi(u.default,n)];case 1:return o.sent(),[2]}})})},t}();e.default=s},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/stat/PtlSubmitAction.ts");e.default=o},function(t,e,n){var r=n(30),o=n(31);t.exports=function(t,e,n){var i=e&&n||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var u=(t=t||{}).random||(t.rng||r)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,e)for(var a=0;a<16;++a)e[i+a]=u[a];return e||o(u)}},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);t.exports=function(){return n(r),r}}else{var o=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}},function(t,e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);t.exports=function(t,e){var r=e||0,o=n;return[o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]]].join("")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={serverUrl:"https://honghegame.cn/hh/"};e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(34),a=i(n(2)),c=i(n(35)),s=i(n(36)),l=i(n(37)),f=i(n(38)),h=i(n(39)),p=i(n(40)),d=function(){function t(t){this.hhGame=t}return t.prototype.getTaskList=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.hhGame.apiClient.callApi(c.default,{})];case 1:return[2,t.sent()]}})})},t.prototype.doTask=function(t,e){return r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this.hhGame.apiClient.callApi(s.default,{taskId:t,doAmount:e,token:"xxx"})];case 1:return[2,n.sent()]}})})},t.prototype.getTaskAward=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.hhGame.apiClient.callApi(l.default,{taskId:t})];case 1:return[2,e.sent().award]}})})},t.prototype.getAwardNum=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.getTaskList()];case 1:return[2,t.sent().tasks.filter(function(t){return t.state==u.TaskState.completeTask}).length]}})})},t.prototype.doTaskInviteGift=function(t){if(this.hhGame.currentUser){var e=a.default.getItem("inviteGiftHistory");e&&e[t]||this.hhGame.apiClient.callApi(p.default,{fromUid:t}).then(function(n){var r;console.debug("触发邀请有礼成功",t),a.default.setItem("inviteGiftHistory",Object.assign({},e,((r={})[t]=1,r)))}).catch(function(e){console.warn("触发邀请有礼失败",t,e)})}},t.prototype.getInviteGiftData=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:if(!this.hhGame.currentUser)throw new Error("您还未登录");return[4,this.hhGame.apiClient.callApi(f.default,{})];case 1:return[2,t.sent()]}})})},t.prototype.getSingleInviteAward=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:if(!this.hhGame.currentUser)throw new Error("您还未登录");return[4,this.hhGame.apiClient.callApi(h.default,{friendUid:t})];case 1:return[2,e.sent().award]}})})},t}();e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.cannotAccept="cannotAccept",t.canAccept="canAccept",t.doTasking="doTasking",t.completeTask="completeTask",t.finishTask="finishTask",t.finishAll="finishAll"}(e.TaskState||(e.TaskState={}))},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlGetTaskList.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlDoTask.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlGetTaskAward.ts");e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/inviteGift/PtlGetInviteGiftData.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/inviteGift/PtlGetSingleInviteAward.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/inviteGift/PtlDoTaskInviteGift.ts",{needLogin:!0});e.default=o},,,,,function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=o(n(4)),u=o(n(46)),a=function(t){function e(e,n){var r=t.call(this,e,"Weapp",n)||this;return r.weapp=new u.default(r),r}return r(e,t),e}(i.default);e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this._launchOptions={scene:0,path:"",query:{}},this.hhGame=t}return Object.defineProperty(t.prototype,"launchOptions",{get:function(){return this._launchOptions},enumerable:!0,configurable:!0}),t.prototype.onShow=function(t){this._launchOptions=t,this.hhGame.stat.updateVisitId()},t}();e.default=r}])); |
@@ -1,2 +0,2 @@ | ||
!function(t,e){for(var n in e)t[n]=e[n]}(exports,function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=39)}([function(t,e,n){"use strict";e.__esModule=!0;var r=n(11);e.TsrpcPtl=r.default;var o=n(12);e.TsrpcError=o.default,e.default=r.default},function(t,e,n){"use strict";e.__esModule=!0,n(7),n(8),n(9),"undefined"==typeof window||window.console||(window.console={},console.log=console.debug=console.info=console.warn=console.error=console.time=console.timeEnd=function(){}),console.debug||(console.debug=console.log)},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o,i=r(n(21)),u=r(n(22));if("object"==typeof wx&&wx.setStorage)o=i.default;else{if("undefined"==typeof localStorage)throw new Error("Can not find a implement for LocalStorage at current platfor.");o=u.default}e.default=o},function(t,e,n){"use strict";e.__esModule=!0;var r=function(){function t(t){var e=this;this.isDone=!1,this.isCanceled=!1,this._alwaysFunc=[],this._promise=new Promise(function(n,r){e._promiseRj=r;t(function(t){e.isCanceled||(e.isDone=!0,e._alwaysFunc.forEach(function(t){t.call(e)}),n(t),e._cancelFunc=void 0,e._alwaysFunc=void 0)},function(t){e.isCanceled||(e.isDone=!0,e._alwaysFunc.forEach(function(t){t.call(e)}),r(t),e._cancelFunc=void 0,e._alwaysFunc=void 0)})})}return t.prototype.onCancel=function(t){return this._cancelFunc?this._cancelFunc.push(t):this._cancelFunc=[t],this},t.prototype.cancel=function(){if(this.isDone)return!1;if(this.isCanceled)return!0;if(this.isCanceled=!0,this._cancelFunc){for(var t=0,e=this._cancelFunc;t<e.length;t++){(0,e[t])()}this._cancelFunc=void 0}return this._promise=this._promise.catch(function(){}),this._promiseRj(),this._promiseRj=void 0,this._promise=void 0,this._alwaysFunc=void 0,!0},t.prototype.always=function(t){return this.isCanceled||(this.isDone?t.call(this):this._alwaysFunc.push(t)),this},t.prototype.then=function(t,e){return this.isCanceled||(this._promise=this._promise.then(t,e)),this},t.prototype.catch=function(t){return this.isCanceled||(this._promise=this._promise.catch(t)),this},t.all=function(e){var n=new t(function(t,n){Promise.all(e).then(function(e){t(e)}).catch(function(t){n(t)})});return n.onCancel(function(){e.forEach(function(t){t.cancel()})}),n},t}();e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(5)),a=i(n(6)),s=i(n(15)),c=i(n(19)),l=i(n(2)),f=i(n(23)),h=i(n(27)),p=i(n(32)),d=i(n(33)),y="undefined"==typeof wx?s.default:a.default,v=function(){function t(t,e,n){void 0===e&&(e="Browser");var i=this;this.apiClient=new y({serverUrl:p.default.serverUrl}),this._cookie=l.default.getItem("hhgame_cookie")||{},this.currentUser=null,this.user=new c.default(this),this.valuePackage=new f.default(this),this.rank=new u.default(this),this.stat=new h.default(this),this.task=new d.default(this),this.appId=t,this.platform=e,n&&(this.apiClient.config.serverUrl=n),this.apiClient.onRequest=function(t){i.cookie&&(t.req.__cookie=i.cookie,t.req.__appId=i.appId)},this.apiClient.onResponse=function(t){return r(i,void 0,void 0,function(){return o(this,function(e){return t.res.__cookie&&(this.cookie=t.res.__cookie),[2]})})}}return Object.defineProperty(t.prototype,"cookie",{get:function(){return this._cookie},set:function(t){l.default.setItem("hhgame_cookie123",t),this._cookie=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isWeappOrWegame",{get:function(){return"Weapp"===this.platform||"Wegame"===this.platform},enumerable:!0,configurable:!0}),t}();e.default=v},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){this.hhGame=t}return t.prototype.getUserRankList=function(t,e,n,i){return r(this,void 0,void 0,function(){return o(this,function(t){throw new Error("TODO")})})},t}();e.default=i},function(t,e,n){"use strict"; | ||
!function(t,e){for(var n in e)t[n]=e[n]}(exports,function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=41)}([function(t,e,n){"use strict";e.__esModule=!0;var r=n(11);e.TsrpcPtl=r.default;var o=n(12);e.TsrpcError=o.default,e.default=r.default},function(t,e,n){"use strict";e.__esModule=!0,n(7),n(8),n(9),"undefined"==typeof window||window.console||(window.console={},console.log=console.debug=console.info=console.warn=console.error=console.time=console.timeEnd=function(){}),console.debug||(console.debug=console.log)},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o,i=r(n(21)),u=r(n(22));if("object"==typeof wx&&wx.setStorage)o=i.default;else{if("undefined"==typeof localStorage)throw new Error("Can not find a implement for LocalStorage at current platfor.");o=u.default}e.default=o},function(t,e,n){"use strict";e.__esModule=!0;var r=function(){function t(t){var e=this;this.isDone=!1,this.isCanceled=!1,this._alwaysFunc=[],this._promise=new Promise(function(n,r){e._promiseRj=r;t(function(t){e.isCanceled||(e.isDone=!0,e._alwaysFunc.forEach(function(t){t.call(e)}),n(t),e._cancelFunc=void 0,e._alwaysFunc=void 0)},function(t){e.isCanceled||(e.isDone=!0,e._alwaysFunc.forEach(function(t){t.call(e)}),r(t),e._cancelFunc=void 0,e._alwaysFunc=void 0)})})}return t.prototype.onCancel=function(t){return this._cancelFunc?this._cancelFunc.push(t):this._cancelFunc=[t],this},t.prototype.cancel=function(){if(this.isDone)return!1;if(this.isCanceled)return!0;if(this.isCanceled=!0,this._cancelFunc){for(var t=0,e=this._cancelFunc;t<e.length;t++){(0,e[t])()}this._cancelFunc=void 0}return this._promise=this._promise.catch(function(){}),this._promiseRj(),this._promiseRj=void 0,this._promise=void 0,this._alwaysFunc=void 0,!0},t.prototype.always=function(t){return this.isCanceled||(this.isDone?t.call(this):this._alwaysFunc.push(t)),this},t.prototype.then=function(t,e){return this.isCanceled||(this._promise=this._promise.then(t,e)),this},t.prototype.catch=function(t){return this.isCanceled||(this._promise=this._promise.catch(t)),this},t.all=function(e){var n=new t(function(t,n){Promise.all(e).then(function(e){t(e)}).catch(function(t){n(t)})});return n.onCancel(function(){e.forEach(function(t){t.cancel()})}),n},t}();e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(5)),a=i(n(6)),s=i(n(15)),c=i(n(19)),l=i(n(2)),f=i(n(23)),h=i(n(27)),p=i(n(32)),d=i(n(33)),y="undefined"==typeof wx?s.default:a.default,v=function(){function t(t,e,n){void 0===e&&(e="Browser");var i=this;this.apiClient=new y({serverUrl:p.default.serverUrl}),this._cookie=l.default.getItem("hhgame_cookie")||{},this.currentUser=null,this.user=new c.default(this),this.valuePackage=new f.default(this),this.rank=new u.default(this),this.stat=new h.default(this),this.task=new d.default(this),this.appId=t,this.platform=e,n&&(this.apiClient.config.serverUrl=n),this.apiClient.onRequest=function(t){i.cookie&&(t.req.__cookie=i.cookie,t.req.__appId=i.appId)},this.apiClient.onResponse=function(t){return r(i,void 0,void 0,function(){return o(this,function(e){return t.res.__cookie&&(this.cookie=t.res.__cookie),[2]})})}}return Object.defineProperty(t.prototype,"cookie",{get:function(){return this._cookie},set:function(t){l.default.setItem("hhgame_cookie123",t),this._cookie=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isWeappOrWegame",{get:function(){return"Weapp"===this.platform||"Wegame"===this.platform},enumerable:!0,configurable:!0}),t}();e.default=v},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){this.hhGame=t}return t.prototype.getUserRankList=function(t,e,n,i){return r(this,void 0,void 0,function(){return o(this,function(t){throw new Error("TODO")})})},t}();e.default=i},function(t,e,n){"use strict"; | ||
/** | ||
@@ -15,2 +15,2 @@ * TSRPC Browser Client | ||
* @license Apache-2.0 | ||
*/e.__esModule=!0,n(1);var r=n(16);e.default=r.default},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};e.__esModule=!0;var i=n(0),u=n(3),a=n(17);n(1);var s=function(){function t(t){this.config=Object.merge({},a.DefaultClientConfig,t),this.config.serverUrl=this.config.serverUrl.replace(/\/$/,""),this.config.protocolPath=this.config.protocolPath.replace(/\\/g,"/").replace(/\/+$/,"")}return t.getLastReqSn=function(){return this._sn},t.prototype.callApi=function(e,n,i){var a=this;void 0===n&&(n={}),void 0===i&&(i={});var s=++t._sn,c=this.getPtlUrl(e);this.config.showDebugLog&&console.debug("%cApiReq%c #"+s+"%c "+c,"border:solid 1px #4ea85f; color: #4ea85f; line-height: 1.5em; padding: 1px 3px;","color: #1b63bd;","color: #999;",n),this.onRequest&&this.onRequest({ptl:e,req:n});var l,f=!1,h=new u.default(function(t,i){return r(a,void 0,void 0,function(){var u,a,h,p,d=this;return o(this,function(y){switch(y.label){case 0:return l=new XMLHttpRequest,navigator.userAgent.indexOf("MSIE 8.0;")>-1?l.onreadystatechange=function(){return r(d,void 0,void 0,function(){var r=this;return o(this,function(o){if(4==l.readyState&&!f){if(0==l.status||null==l.response&&null==l.responseText)return setTimeout(function(){r._throwApiError(e,n,s,c,i)},0),[2];this._resolveApiRes(l,n,e,s,c,t,i)}return[2]})})}:(l.onabort=function(){l.onload=l.onerror=null},l.onerror=function(){d._throwApiError(e,n,s,c,i)},l.onload=function(){return r(d,void 0,void 0,function(){return o(this,function(r){return this._resolveApiRes(l,n,e,s,c,t,i),[2]})})}),l.open("POST",this.config.hideApiPath?this.config.serverUrl:this.config.serverUrl+c,!0),l.responseType=this.config.binaryTransport?"arraybuffer":"text",this.config.hideApiPath&&(n.__tsrpc_url__=c),a=(u=l).send,this.config.binaryTransport?(p=Blob.bind,[4,this.config.binaryEncoder(n)]):[3,2];case 1:return h=new(p.apply(Blob,[void 0,[y.sent()]])),[3,4];case 2:return[4,this.config.ptlEncoder(n)];case 3:h=y.sent(),y.label=4;case 4:return a.apply(u,[h]),[2]}})})});return h.onCancel(function(){a.config.showDebugLog&&console.debug("%cApiCancel%c #"+s+"%c "+c,"background: #999; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;"),f=!0,l.abort()}),h},t.prototype.getPtlUrl=function(t){var e=t.filename.replace(/\\/g,"/");if(this.config.protocolPath){if(0!==e.indexOf(this.config.protocolPath))throw console.log("PTL_PATH_ERR",t.name,e,this.config.protocolPath),new Error("Protocol "+t.name+" not in protocolPath.");e=e.substr(this.config.protocolPath.length)}return"/"!==(e=e.replace(/Ptl([^\/]+)\.[tj]s$/,"$1"))[0]&&(e="/"+e),e},t.prototype._throwApiError=function(t,e,n,r,o){this.config.showDebugLog&&console.debug("%cApiErr%c #"+n+"%c "+r,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,"Network error"),this._resReject(t,e,o,new i.TsrpcError("Network error","NETWORK_ERROR"))},t.prototype._resReject=function(t,e,n,r){n(r),this.onError&&this.onError({ptl:t,req:e,err:r})},t.prototype._resolveApiRes=function(t,e,n,u,a,s,c){return r(this,void 0,void 0,function(){var r,l;return o(this,function(o){switch(o.label){case 0:if(12029==t.status)return this._throwApiError(n,e,u,a,c),[2];o.label=1;case 1:return o.trys.push([1,6,,7]),this.config.binaryTransport?[4,this.config.binaryDecoder(t.response)]:[3,3];case 2:return l=o.sent(),[3,5];case 3:return[4,this.config.ptlDecoder(t.responseText||t.response)];case 4:l=o.sent(),o.label=5;case 5:return r=l,[3,7];case 6:return o.sent(),this.config.showDebugLog&&console.debug("%cApiErr%c #"+u+"%c "+a,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,"Response cannot be resolved"),this._resReject(n,e,c,new i.TsrpcError("Response cannot be resolved","RES_CANNOT_BE_RESOLVED")),[2];case 7:return null!=r.errmsg?(this.config.showDebugLog&&console.debug("%cApiErr%c #"+u+"%c "+a,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,r),this._resReject(n,e,c,new i.TsrpcError(r.errmsg,r.errinfo))):(this.config.showDebugLog&&console.debug("%cApiRes%c #"+u+"%c "+a,"background: #4ea85f; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,r),s(r),this.onResponse&&this.onResponse({ptl:n,req:e,res:r})),[2]}})})},t._sn=0,t}();e.default=s},function(t,e,n){"use strict";e.__esModule=!0;var r=n(18);e.DefaultClientConfig={serverUrl:"",protocolPath:"",hideApiPath:!1,ptlEncoder:JSON.stringify,ptlDecoder:JSON.parse,binaryTransport:!1,binaryEncoder:r.default.encode,binaryDecoder:r.default.decode,showDebugLog:!0}},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};e.__esModule=!0;var i=function(){function t(){}return t.encode=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){return[2,new Promise(function(e){var n=new Blob([JSON.stringify(t)],{type:"application/octet-stream"}),r=new FileReader;r.onload=function(){e(r.result)},r.readAsArrayBuffer(n)})]})})},t.decode=function(t){return new Promise(function(e){var n=new Blob([t]),r=new FileReader;r.onload=function(){e(JSON.parse(r.result))},r.readAsText(n)})},t}();e.default=i},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(20)),a=function(){function t(t){this.hhGame=t}return t.prototype.login=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,this.hhGame.apiClient.callApi(u.default,{ticket:t})];case 1:return e=n.sent(),t.fromUid&&this.hhGame.task.doTaskInviteGift(t.fromUid),[2,e]}})})},t.prototype.logout=function(){this.hhGame.currentUser=null,this.hhGame.cookie.ssoToken=void 0,this.hhGame.cookie=this.hhGame.cookie},t}();e.default=a},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/user/PtlLogin.ts");e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={setItem:function(t,e){return wx.setStorageSync(t,e)},getItem:function(t){return wx.getStorageSync(t)},removeItem:function(t){wx.removeStorageSync(t)},clear:function(){wx.clearStorageSync()},setItemAsync:function(t,e){return new Promise(function(n,r){wx.setStorage({key:t,data:e,success:function(t){n(t)},fail:function(t){r(t)}})})},getItemAsync:function(t){return new Promise(function(e,n){wx.getStorage({key:t,success:function(t){e(t)},fail:function(t){n(t)}})})},removeItemAsync:function(t){return new Promise(function(e,n){wx.removeStorage({key:t,success:function(t){e(t)},fail:function(t){n(t)}})})},clearAsync:function(){return wx.clearStorage()}};e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={setItem:function(t,e){localStorage.setItem(t,JSON.stringify(e))},getItem:function(t){try{var e=localStorage.getItem(t);return null==e?null:JSON.parse(e)}catch(e){return console.warn("Parse JSON Error when getItem from localStorage: "+t,localStorage.getItem(t),e),null}},removeItem:function(t){localStorage.removeItem(t)},clear:function(){localStorage.clear()},setItemAsync:function(t,e){return new Promise(function(n,o){try{r.setItem(t,e),n()}catch(t){o(t)}})},getItemAsync:function(t){return new Promise(function(e,n){try{e(r.getItem(t))}catch(t){n(t)}})},removeItemAsync:function(t){return new Promise(function(e,n){try{r.removeItem(t),e()}catch(t){n(t)}})},clearAsync:function(){return new Promise(function(t,e){try{r.clear(),t()}catch(t){e(t)}})}};e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(24)),a=i(n(25)),s=i(n(26)),c=function(){function t(t){this.hhGame=t}return t.prototype.getValues=function(t,e,n,i){return void 0===t&&(t={}),void 0===e&&(e=!0),void 0===n&&(n=!0),r(this,void 0,void 0,function(){var r;return o(this,function(o){switch(o.label){case 0:return[4,this.hhGame.apiClient.callApi(u.default,{ids:t.ids,tags:t.tags,cond:i,withTags:e,withConf:n})];case 1:return r=o.sent(),[2,r.values.map(function(t){return Object.assign({id:t.id,value:t.value},e?{tags:t.tags}:void 0,n?{name:t.conf.name,desc:t.conf.desc,icon:t.conf.icon}:void 0)})]}})})},t.prototype.getValue=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,this.getValues({ids:[t]},!1,!1)];case 1:return(e=n.sent()).length?[2,e[0].value]:[2,null]}})})},t.prototype.getConfigs=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.hhGame.apiClient.callApi(a.default,{ids:t.ids,tags:t.tags})];case 1:return[2,e.sent().configs]}})})},t.prototype.executeCommand=function(t,e,n,i){return r(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this.hhGame.apiClient.callApi(s.default,{command:{valueId:t,commandId:e,changeValue:n,meta:i}})];case 1:return[2,r.sent()]}})})},t}();e.default=c},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlGetValues.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlGetValueConfigs.ts");e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlExecuteValueCommand.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(28)),a=i(n(2)),s=i(n(29)),c=function(){function t(t){this.hhGame=t;var e=a.default.getItem("__deviceId");e||(e=s.default(),a.default.setItem("__deviceId",e)),this.deviceId=e,this.updateVisitId()}return Object.defineProperty(t.prototype,"visitId",{get:function(){return this._visitId},enumerable:!0,configurable:!0}),t.prototype.updateVisitId=function(){this._visitId=s.default()},t.prototype.submitAction=function(t,e){return r(this,void 0,void 0,function(){var n,r,i,a,s;return o(this,function(o){switch(o.label){case 0:n={url:void 0,referer:void 0,action:t,data:e,deviceId:this.deviceId,visitId:this._visitId,platform:this.hhGame.platform,windowSize:"Unknown",screenSize:"Unknown"};try{"Browser"===this.hhGame.platform?(n.url=window.location.href,n.referer=document.referrer,n.browser={userAgent:window.navigator.userAgent},n.windowSize=window.innerWidth+"x"+window.innerHeight,r=window.devicePixelRatio||1,n.screenSize=window.screen.width*r+"x"+window.screen.height*r):"Weapp"!==this.hhGame.platform&&"Wegame"!==this.hhGame.platform||(i="Weapp"===this.hhGame.platform?this.hhGame.weapp:this.hhGame.wegame,a=wx.getSystemInfoSync(),n.weapp={systemInfo:a,scene:i.launchOptions.scene,launchQuery:i.launchOptions.query},n.windowSize=a.windowWidth+"x"+a.windowHeight,n.screenSize=a.screenWidth*a.pixelRatio+"x"+a.screenHeight*a.pixelRatio,"Weapp"===this.hhGame.platform&&(s=getCurrentPages(),n.url=s.last().route,s.length>1&&(n.referer=s[s.length-2].route)))}catch(t){console.error("SubmitAction 设置平台信息失败",t)}return[4,this.hhGame.apiClient.callApi(u.default,n)];case 1:return o.sent(),[2]}})})},t}();e.default=c},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/stat/PtlSubmitAction.ts");e.default=o},function(t,e,n){var r=n(30),o=n(31);t.exports=function(t,e,n){var i=e&&n||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var u=(t=t||{}).random||(t.rng||r)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,e)for(var a=0;a<16;++a)e[i+a]=u[a];return e||o(u)}},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);t.exports=function(){return n(r),r}}else{var o=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}},function(t,e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);t.exports=function(t,e){var r=e||0,o=n;return[o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]]].join("")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={serverUrl:"https://honghegame.cn/hh/"};e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(34),a=i(n(2)),s=i(n(35)),c=i(n(36)),l=i(n(37)),f=i(n(38)),h=function(){function t(t){this.hhGame=t}return t.prototype.getTaskList=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.hhGame.apiClient.callApi(c.default,{})];case 1:return[2,t.sent()]}})})},t.prototype.doTask=function(t,e){return r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this.hhGame.apiClient.callApi(l.default,{taskId:t,doAmount:e,token:"xxx"})];case 1:return[2,n.sent()]}})})},t.prototype.getTaskAward=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.hhGame.apiClient.callApi(f.default,{taskId:t})];case 1:return[2,e.sent().award]}})})},t.prototype.getAwardNum=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.getTaskList()];case 1:return[2,t.sent().tasks.filter(function(t){return t.state==u.TaskState.completeTask}).length]}})})},t.prototype.doTaskInviteGift=function(t){if(this.hhGame.currentUser){var e=a.default.getItem("inviteGiftHistory");e&&e[t]||this.hhGame.apiClient.callApi(s.default,{fromUid:t}).then(function(n){var r;console.debug("触发邀请有礼成功",t),a.default.setItem("inviteGiftHistory",Object.assign({},e,((r={})[t]=1,r)))}).catch(function(e){console.warn("触发邀请有礼失败",t,e)})}},t}();e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.cannotAccept="cannotAccept",t.canAccept="canAccept",t.doTasking="doTasking",t.completeTask="completeTask",t.finishTask="finishTask",t.finishAll="finishAll"}(e.TaskState||(e.TaskState={}))},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlDoTaskInviteGift.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlGetTaskList.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlDoTask.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlGetTaskAward.ts");e.default=o},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=o(n(4)),u=o(n(40)),a=function(t){function e(e,n){var r=t.call(this,e,"Wegame",n)||this;return r.wegame=new u.default(r),r}return r(e,t),e}(i.default);e.default=a},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(41)),a=i(n(42)),s=function(){function t(t){var e=this;this.hhGame=t,"undefined"!=typeof wx?(this._launchOptions=wx.getLaunchOptionsSync(),this.hhGame.stat.updateVisitId(),wx.onShow(function(t){console.log("wx.onShow",t),e._launchOptions=t,e.hhGame.stat.updateVisitId(),e.hhGame.stat.submitAction("启动游戏",{from:e._launchOptions.query.from,fromUid:e._launchOptions.query.fromUid}),e._launchOptions.query.fromUid&&e.hhGame.task.doTaskInviteGift(e._launchOptions.query.fromUid)}),wx.onHide(function(){console.log("wx.onHide"),e.hhGame.stat.submitAction("退出游戏")})):console.error("平台错误:非微信小游戏平台却使用了微信小游戏版HHGameSDK")}return Object.defineProperty(t.prototype,"launchOptions",{get:function(){return this._launchOptions},enumerable:!0,configurable:!0}),t.prototype.autoLogin=function(){return r(this,void 0,void 0,function(){var t,e;return o(this,function(n){switch(n.label){case 0:return[4,this._wxLogin()];case 1:return(t=n.sent()).code?[4,this.hhGame.user.login({type:"weapp",code:t.code,from:this._launchOptions.query.from,fromUid:this._launchOptions.query.fromUid})]:[3,3];case 2:return e=n.sent(),this.hhGame.currentUser=e,[2,e];case 3:throw console.error("wx.login失败",t),new Error("没有找到Code")}})})},t.prototype.createUserInfoButton=function(t,e){var n=this;if(wx.createUserInfoButton){var i=wx.createUserInfoButton(Object.merge({type:"text",text:"获取用户信息",style:{left:0,top:0,width:320,height:320,lineHeight:16,backgroundColor:"#0000ff",color:"#ffffff",textAlign:"center",fontSize:16},withCredentials:!0,lang:"zh_CN"},t));return i.onTap(function(t){return r(n,void 0,void 0,function(){var n;return o(this,function(r){switch(r.label){case 0:if(this.hhGame.currentUser)return[3,8];wx.showLoading({title:"自动登录中...",mask:!0}),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,this.autoLogin()];case 2:return r.sent(),[3,5];case 3:return r.sent(),[3,5];case 4:return wx.hideLoading(),[7];case 5:return(n=!this.hhGame.currentUser)?[4,u.default.confirm("你的网络有点问题,请稍后再试。","登录失败",{confirmText:"重试",cancelText:"取消"})]:[3,7];case 6:n=!r.sent(),r.label=7;case 7:return n?[2,null]:[3,0];case 8:return[4,this._handleUserInfoRes(t,e)];case 9:return r.sent(),i.destroy(),[2]}})})}),i}return this._getUserInfo(e),{destroy:function(){},onTap:function(){}}},t.prototype._getUserInfo=function(t){return r(this,void 0,void 0,function(){var e=this;return o(this,function(n){switch(n.label){case 0:if(this.hhGame.currentUser)return[3,8];wx.showLoading({title:"自动登录中...",mask:!0}),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,this.autoLogin()];case 2:return n.sent(),[3,5];case 3:return n.sent(),[3,5];case 4:return wx.hideLoading(),[7];case 5:return this.hhGame.currentUser?[3,7]:[4,u.default.alert("你的网络有点问题,请稍后再试。","登录失败","重试")];case 6:n.sent(),n.label=7;case 7:return[3,0];case 8:return wx.getUserInfo({withCredentials:!0,lang:"zh_CN",success:function(n){e._handleUserInfoRes(n,t)},fail:function(n){console.warn("getUserInfo failed",n),e._handleUserInfoRes({},t)}}),[2]}})})},t.prototype._handleUserInfoRes=function(t,e){return r(this,void 0,void 0,function(){var n;return o(this,function(r){switch(r.label){case 0:if(!this.hhGame.currentUser)throw new Error("NotLogined");if(!t.encryptedData||!t.iv)return[3,6];console.log("用户允许了授权"),r.label=1;case 1:return r.trys.push([1,3,4,5]),wx.showLoading({title:"更新个人信息中...",mask:!0}),[4,this.hhGame.apiClient.callApi(a.default,{encryptedData:t.encryptedData,iv:t.iv}).catch(function(t){console.error("UpdateWxUserInfo failed",t),wx.showToast({title:"更新个人信息失败",icon:"none"})})];case 2:return(n=r.sent())&&(this.hhGame.currentUser=n),[3,5];case 3:return r.sent(),[3,5];case 4:return wx.hideLoading(),[7];case 5:return[3,7];case 6:console.log("用户拒绝了授权",t),this.hhGame.currentUser.platform.wechatUnionId||wx.showToast({title:"您拒绝了授权,将以游客身份进入。",icon:"none"}),r.label=7;case 7:return e(this.hhGame.currentUser),[2]}})})},t.prototype._wxLogin=function(){return r(this,void 0,void 0,function(){return o(this,function(t){return[2,new Promise(function(t,e){wx.login({success:function(e){t(e)},fail:function(t){e(t)}})})]})})},t}();e.default=s},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){}return t.alert=function(t,e,n){void 0===e&&(e=""),void 0===n&&(n="确定");var r=function(r,o){wx.showModal({title:e,content:t,showCancel:!1,confirmText:n,success:function(){r()},fail:function(t){o(t)}})};return this._lastToastPromise?this._lastToastPromise=this._lastToastPromise.then(function(){return new Promise(r)}):this._lastToastPromise=new Promise(r),this._lastToastPromise},t.confirm=function(t,e,n){void 0===e&&(e="");var r=function(r,o){wx.showModal(Object.assign({title:e,content:t,success:function(t){t.confirm?r(!0):t.cancel&&r(!1)},fail:function(t){o(t)}},n))};return this._lastToastPromise?this._lastToastPromise=this._lastToastPromise.then(function(){return new Promise(r)}):this._lastToastPromise=new Promise(r),this._lastToastPromise},t.downloadFile=function(t){return new Promise(function(e,n){wx.downloadFile({url:t,success:function(t){e(t.tempFilePath)},fail:function(e){wx.showModal({title:"图片下载失败",content:JSON.stringify(e)+",url:"+t}),n(e)}})})},t.getLocation=function(){return r(this,void 0,void 0,function(){return o(this,function(t){return[2,new Promise(function(t,e){wx.getLocation({type:"wgs84",success:function(e){t({latitude:e.latitude,longitude:e.longitude,speed:e.speed,accuracy:e.accuracy})},fail:function(t){e(t)}})})]})})},t}();e.default=i},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/platform/weapp/PtlUpdateWxUserInfo.ts",{needLogin:!0});e.default=o}])); | ||
*/e.__esModule=!0,n(1);var r=n(16);e.default=r.default},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};e.__esModule=!0;var i=n(0),u=n(3),a=n(17);n(1);var s=function(){function t(t){this.config=Object.merge({},a.DefaultClientConfig,t),this.config.serverUrl=this.config.serverUrl.replace(/\/$/,""),this.config.protocolPath=this.config.protocolPath.replace(/\\/g,"/").replace(/\/+$/,"")}return t.getLastReqSn=function(){return this._sn},t.prototype.callApi=function(e,n,i){var a=this;void 0===n&&(n={}),void 0===i&&(i={});var s=++t._sn,c=this.getPtlUrl(e);this.config.showDebugLog&&console.debug("%cApiReq%c #"+s+"%c "+c,"border:solid 1px #4ea85f; color: #4ea85f; line-height: 1.5em; padding: 1px 3px;","color: #1b63bd;","color: #999;",n),this.onRequest&&this.onRequest({ptl:e,req:n});var l,f=!1,h=new u.default(function(t,i){return r(a,void 0,void 0,function(){var u,a,h,p,d=this;return o(this,function(y){switch(y.label){case 0:return l=new XMLHttpRequest,navigator.userAgent.indexOf("MSIE 8.0;")>-1?l.onreadystatechange=function(){return r(d,void 0,void 0,function(){var r=this;return o(this,function(o){if(4==l.readyState&&!f){if(0==l.status||null==l.response&&null==l.responseText)return setTimeout(function(){r._throwApiError(e,n,s,c,i)},0),[2];this._resolveApiRes(l,n,e,s,c,t,i)}return[2]})})}:(l.onabort=function(){l.onload=l.onerror=null},l.onerror=function(){d._throwApiError(e,n,s,c,i)},l.onload=function(){return r(d,void 0,void 0,function(){return o(this,function(r){return this._resolveApiRes(l,n,e,s,c,t,i),[2]})})}),l.open("POST",this.config.hideApiPath?this.config.serverUrl:this.config.serverUrl+c,!0),l.responseType=this.config.binaryTransport?"arraybuffer":"text",this.config.hideApiPath&&(n.__tsrpc_url__=c),a=(u=l).send,this.config.binaryTransport?(p=Blob.bind,[4,this.config.binaryEncoder(n)]):[3,2];case 1:return h=new(p.apply(Blob,[void 0,[y.sent()]])),[3,4];case 2:return[4,this.config.ptlEncoder(n)];case 3:h=y.sent(),y.label=4;case 4:return a.apply(u,[h]),[2]}})})});return h.onCancel(function(){a.config.showDebugLog&&console.debug("%cApiCancel%c #"+s+"%c "+c,"background: #999; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;"),f=!0,l.abort()}),h},t.prototype.getPtlUrl=function(t){var e=t.filename.replace(/\\/g,"/");if(this.config.protocolPath){if(0!==e.indexOf(this.config.protocolPath))throw console.log("PTL_PATH_ERR",t.name,e,this.config.protocolPath),new Error("Protocol "+t.name+" not in protocolPath.");e=e.substr(this.config.protocolPath.length)}return"/"!==(e=e.replace(/Ptl([^\/]+)\.[tj]s$/,"$1"))[0]&&(e="/"+e),e},t.prototype._throwApiError=function(t,e,n,r,o){this.config.showDebugLog&&console.debug("%cApiErr%c #"+n+"%c "+r,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,"Network error"),this._resReject(t,e,o,new i.TsrpcError("Network error","NETWORK_ERROR"))},t.prototype._resReject=function(t,e,n,r){n(r),this.onError&&this.onError({ptl:t,req:e,err:r})},t.prototype._resolveApiRes=function(t,e,n,u,a,s,c){return r(this,void 0,void 0,function(){var r,l;return o(this,function(o){switch(o.label){case 0:if(12029==t.status)return this._throwApiError(n,e,u,a,c),[2];o.label=1;case 1:return o.trys.push([1,6,,7]),this.config.binaryTransport?[4,this.config.binaryDecoder(t.response)]:[3,3];case 2:return l=o.sent(),[3,5];case 3:return[4,this.config.ptlDecoder(t.responseText||t.response)];case 4:l=o.sent(),o.label=5;case 5:return r=l,[3,7];case 6:return o.sent(),this.config.showDebugLog&&console.debug("%cApiErr%c #"+u+"%c "+a,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,"Response cannot be resolved"),this._resReject(n,e,c,new i.TsrpcError("Response cannot be resolved","RES_CANNOT_BE_RESOLVED")),[2];case 7:return null!=r.errmsg?(this.config.showDebugLog&&console.debug("%cApiErr%c #"+u+"%c "+a,"background: #d81e06; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,r),this._resReject(n,e,c,new i.TsrpcError(r.errmsg,r.errinfo))):(this.config.showDebugLog&&console.debug("%cApiRes%c #"+u+"%c "+a,"background: #4ea85f; color: #fff; line-height: 1.5em; padding: 2px 4px;","color: #1b63bd;","color: #999;",e,r),s(r),this.onResponse&&this.onResponse({ptl:n,req:e,res:r})),[2]}})})},t._sn=0,t}();e.default=s},function(t,e,n){"use strict";e.__esModule=!0;var r=n(18);e.DefaultClientConfig={serverUrl:"",protocolPath:"",hideApiPath:!1,ptlEncoder:JSON.stringify,ptlDecoder:JSON.parse,binaryTransport:!1,binaryEncoder:r.default.encode,binaryDecoder:r.default.decode,showDebugLog:!0}},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};e.__esModule=!0;var i=function(){function t(){}return t.encode=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){return[2,new Promise(function(e){var n=new Blob([JSON.stringify(t)],{type:"application/octet-stream"}),r=new FileReader;r.onload=function(){e(r.result)},r.readAsArrayBuffer(n)})]})})},t.decode=function(t){return new Promise(function(e){var n=new Blob([t]),r=new FileReader;r.onload=function(){e(JSON.parse(r.result))},r.readAsText(n)})},t}();e.default=i},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(20)),a=function(){function t(t){this.hhGame=t}return t.prototype.login=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,this.hhGame.apiClient.callApi(u.default,{ticket:t})];case 1:return e=n.sent(),t.fromUid&&this.hhGame.task.doTaskInviteGift(t.fromUid),[2,e]}})})},t.prototype.logout=function(){this.hhGame.currentUser=null,this.hhGame.cookie.ssoToken=void 0,this.hhGame.cookie=this.hhGame.cookie},t}();e.default=a},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/user/PtlLogin.ts");e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={setItem:function(t,e){return wx.setStorageSync(t,e)},getItem:function(t){return wx.getStorageSync(t)},removeItem:function(t){wx.removeStorageSync(t)},clear:function(){wx.clearStorageSync()},setItemAsync:function(t,e){return new Promise(function(n,r){wx.setStorage({key:t,data:e,success:function(t){n(t)},fail:function(t){r(t)}})})},getItemAsync:function(t){return new Promise(function(e,n){wx.getStorage({key:t,success:function(t){e(t)},fail:function(t){n(t)}})})},removeItemAsync:function(t){return new Promise(function(e,n){wx.removeStorage({key:t,success:function(t){e(t)},fail:function(t){n(t)}})})},clearAsync:function(){return wx.clearStorage()}};e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={setItem:function(t,e){localStorage.setItem(t,JSON.stringify(e))},getItem:function(t){try{var e=localStorage.getItem(t);return null==e?null:JSON.parse(e)}catch(e){return console.warn("Parse JSON Error when getItem from localStorage: "+t,localStorage.getItem(t),e),null}},removeItem:function(t){localStorage.removeItem(t)},clear:function(){localStorage.clear()},setItemAsync:function(t,e){return new Promise(function(n,o){try{r.setItem(t,e),n()}catch(t){o(t)}})},getItemAsync:function(t){return new Promise(function(e,n){try{e(r.getItem(t))}catch(t){n(t)}})},removeItemAsync:function(t){return new Promise(function(e,n){try{r.removeItem(t),e()}catch(t){n(t)}})},clearAsync:function(){return new Promise(function(t,e){try{r.clear(),t()}catch(t){e(t)}})}};e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(24)),a=i(n(25)),s=i(n(26)),c=function(){function t(t){this.hhGame=t}return t.prototype.getValues=function(t,e,n,i){return void 0===t&&(t={}),void 0===e&&(e=!0),void 0===n&&(n=!0),r(this,void 0,void 0,function(){var r;return o(this,function(o){switch(o.label){case 0:return[4,this.hhGame.apiClient.callApi(u.default,{ids:t.ids,tags:t.tags,cond:i,withTags:e,withConf:n})];case 1:return r=o.sent(),[2,r.values.map(function(t){return Object.assign({id:t.id,value:t.value},e?{tags:t.tags}:void 0,n?{name:t.conf.name,desc:t.conf.desc,icon:t.conf.icon}:void 0)})]}})})},t.prototype.getValue=function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,this.getValues({ids:[t]},!1,!1)];case 1:return(e=n.sent()).length?[2,e[0].value]:[2,null]}})})},t.prototype.getConfigs=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.hhGame.apiClient.callApi(a.default,{ids:t.ids,tags:t.tags})];case 1:return[2,e.sent().configs]}})})},t.prototype.executeCommand=function(t,e,n,i){return r(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this.hhGame.apiClient.callApi(s.default,{command:{valueId:t,commandId:e,changeValue:n,meta:i}})];case 1:return[2,r.sent()]}})})},t}();e.default=c},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlGetValues.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlGetValueConfigs.ts");e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/valuePackage/PtlExecuteValueCommand.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(28)),a=i(n(2)),s=i(n(29)),c=function(){function t(t){this.hhGame=t;var e=a.default.getItem("__deviceId");e||(e=s.default(),a.default.setItem("__deviceId",e)),this.deviceId=e,this.updateVisitId()}return Object.defineProperty(t.prototype,"visitId",{get:function(){return this._visitId},enumerable:!0,configurable:!0}),t.prototype.updateVisitId=function(){this._visitId=s.default()},t.prototype.submitAction=function(t,e){return r(this,void 0,void 0,function(){var n,r,i,a,s;return o(this,function(o){switch(o.label){case 0:n={url:void 0,referer:void 0,action:t,data:e,deviceId:this.deviceId,visitId:this._visitId,platform:this.hhGame.platform,windowSize:"Unknown",screenSize:"Unknown"};try{"Browser"===this.hhGame.platform?(n.url=window.location.href,n.referer=document.referrer,n.browser={userAgent:window.navigator.userAgent},n.windowSize=window.innerWidth+"x"+window.innerHeight,r=window.devicePixelRatio||1,n.screenSize=window.screen.width*r+"x"+window.screen.height*r):"Weapp"!==this.hhGame.platform&&"Wegame"!==this.hhGame.platform||(i="Weapp"===this.hhGame.platform?this.hhGame.weapp:this.hhGame.wegame,a=wx.getSystemInfoSync(),n.weapp={systemInfo:a,scene:i.launchOptions.scene,launchQuery:i.launchOptions.query},n.windowSize=a.windowWidth+"x"+a.windowHeight,n.screenSize=a.screenWidth*a.pixelRatio+"x"+a.screenHeight*a.pixelRatio,"Weapp"===this.hhGame.platform&&(s=getCurrentPages(),n.url=s.last().route,s.length>1&&(n.referer=s[s.length-2].route)))}catch(t){console.error("SubmitAction 设置平台信息失败",t)}return[4,this.hhGame.apiClient.callApi(u.default,n)];case 1:return o.sent(),[2]}})})},t}();e.default=c},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/stat/PtlSubmitAction.ts");e.default=o},function(t,e,n){var r=n(30),o=n(31);t.exports=function(t,e,n){var i=e&&n||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var u=(t=t||{}).random||(t.rng||r)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,e)for(var a=0;a<16;++a)e[i+a]=u[a];return e||o(u)}},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);t.exports=function(){return n(r),r}}else{var o=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}},function(t,e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);t.exports=function(t,e){var r=e||0,o=n;return[o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],"-",o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]],o[t[r++]]].join("")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={serverUrl:"https://honghegame.cn/hh/"};e.default=r},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(34),a=i(n(2)),s=i(n(35)),c=i(n(36)),l=i(n(37)),f=i(n(38)),h=i(n(39)),p=i(n(40)),d=function(){function t(t){this.hhGame=t}return t.prototype.getTaskList=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.hhGame.apiClient.callApi(s.default,{})];case 1:return[2,t.sent()]}})})},t.prototype.doTask=function(t,e){return r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return[4,this.hhGame.apiClient.callApi(c.default,{taskId:t,doAmount:e,token:"xxx"})];case 1:return[2,n.sent()]}})})},t.prototype.getTaskAward=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.hhGame.apiClient.callApi(l.default,{taskId:t})];case 1:return[2,e.sent().award]}})})},t.prototype.getAwardNum=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.getTaskList()];case 1:return[2,t.sent().tasks.filter(function(t){return t.state==u.TaskState.completeTask}).length]}})})},t.prototype.doTaskInviteGift=function(t){if(this.hhGame.currentUser){var e=a.default.getItem("inviteGiftHistory");e&&e[t]||this.hhGame.apiClient.callApi(p.default,{fromUid:t}).then(function(n){var r;console.debug("触发邀请有礼成功",t),a.default.setItem("inviteGiftHistory",Object.assign({},e,((r={})[t]=1,r)))}).catch(function(e){console.warn("触发邀请有礼失败",t,e)})}},t.prototype.getInviteGiftData=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:if(!this.hhGame.currentUser)throw new Error("您还未登录");return[4,this.hhGame.apiClient.callApi(f.default,{})];case 1:return[2,t.sent()]}})})},t.prototype.getSingleInviteAward=function(t){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:if(!this.hhGame.currentUser)throw new Error("您还未登录");return[4,this.hhGame.apiClient.callApi(h.default,{friendUid:t})];case 1:return[2,e.sent().award]}})})},t}();e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.cannotAccept="cannotAccept",t.canAccept="canAccept",t.doTasking="doTasking",t.completeTask="completeTask",t.finishTask="finishTask",t.finishAll="finishAll"}(e.TaskState||(e.TaskState={}))},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlGetTaskList.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlDoTask.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/PtlGetTaskAward.ts");e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/inviteGift/PtlGetInviteGiftData.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/inviteGift/PtlGetSingleInviteAward.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/task/inviteGift/PtlDoTaskInviteGift.ts",{needLogin:!0});e.default=o},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=o(n(4)),u=o(n(42)),a=function(t){function e(e,n){var r=t.call(this,e,"Wegame",n)||this;return r.wegame=new u.default(r),r}return r(e,t),e}(i.default);e.default=a;new a("APPID")},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(n(43)),a=i(n(44)),s=function(){function t(t){var e=this;this.hhGame=t,"undefined"!=typeof wx?(this._launchOptions=wx.getLaunchOptionsSync(),this.hhGame.stat.updateVisitId(),wx.onShow(function(t){console.log("wx.onShow",t),e._launchOptions=t,e.hhGame.stat.updateVisitId(),e.hhGame.stat.submitAction("启动游戏",{from:e._launchOptions.query.from,fromUid:e._launchOptions.query.fromUid}),e._launchOptions.query.fromUid&&e.hhGame.task.doTaskInviteGift(e._launchOptions.query.fromUid)}),wx.onHide(function(){console.log("wx.onHide"),e.hhGame.stat.submitAction("退出游戏")})):console.error("平台错误:非微信小游戏平台却使用了微信小游戏版HHGameSDK")}return Object.defineProperty(t.prototype,"launchOptions",{get:function(){return this._launchOptions},enumerable:!0,configurable:!0}),t.prototype.autoLogin=function(){return r(this,void 0,void 0,function(){var t,e;return o(this,function(n){switch(n.label){case 0:return[4,this._wxLogin()];case 1:return(t=n.sent()).code?[4,this.hhGame.user.login({type:"weapp",code:t.code,from:this._launchOptions.query.from,fromUid:this._launchOptions.query.fromUid})]:[3,3];case 2:return e=n.sent(),this.hhGame.currentUser=e,[2,e];case 3:throw console.error("wx.login失败",t),new Error("没有找到Code")}})})},t.prototype.createUserInfoButton=function(t,e){var n=this;if(wx.createUserInfoButton){var i=wx.createUserInfoButton(Object.merge({type:"text",text:"获取用户信息",style:{left:0,top:0,width:320,height:320,lineHeight:16,backgroundColor:"#0000ff",color:"#ffffff",textAlign:"center",fontSize:16},withCredentials:!0,lang:"zh_CN"},t));return i.onTap(function(t){return r(n,void 0,void 0,function(){var n;return o(this,function(r){switch(r.label){case 0:if(this.hhGame.currentUser)return[3,8];wx.showLoading({title:"自动登录中...",mask:!0}),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,this.autoLogin()];case 2:return r.sent(),[3,5];case 3:return r.sent(),[3,5];case 4:return wx.hideLoading(),[7];case 5:return(n=!this.hhGame.currentUser)?[4,u.default.confirm("你的网络有点问题,请稍后再试。","登录失败",{confirmText:"重试",cancelText:"取消"})]:[3,7];case 6:n=!r.sent(),r.label=7;case 7:return n?[2,null]:[3,0];case 8:return[4,this._handleUserInfoRes(t,e)];case 9:return r.sent(),i.destroy(),[2]}})})}),i}return this._getUserInfo(e),{destroy:function(){},onTap:function(){}}},t.prototype._getUserInfo=function(t){return r(this,void 0,void 0,function(){var e=this;return o(this,function(n){switch(n.label){case 0:if(this.hhGame.currentUser)return[3,8];wx.showLoading({title:"自动登录中...",mask:!0}),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,this.autoLogin()];case 2:return n.sent(),[3,5];case 3:return n.sent(),[3,5];case 4:return wx.hideLoading(),[7];case 5:return this.hhGame.currentUser?[3,7]:[4,u.default.alert("你的网络有点问题,请稍后再试。","登录失败","重试")];case 6:n.sent(),n.label=7;case 7:return[3,0];case 8:return wx.getUserInfo({withCredentials:!0,lang:"zh_CN",success:function(n){e._handleUserInfoRes(n,t)},fail:function(n){console.warn("getUserInfo failed",n),e._handleUserInfoRes({},t)}}),[2]}})})},t.prototype._handleUserInfoRes=function(t,e){return r(this,void 0,void 0,function(){var n;return o(this,function(r){switch(r.label){case 0:if(!this.hhGame.currentUser)throw new Error("NotLogined");if(!t.encryptedData||!t.iv)return[3,6];console.log("用户允许了授权"),r.label=1;case 1:return r.trys.push([1,3,4,5]),wx.showLoading({title:"更新个人信息中...",mask:!0}),[4,this.hhGame.apiClient.callApi(a.default,{encryptedData:t.encryptedData,iv:t.iv}).catch(function(t){console.error("UpdateWxUserInfo failed",t),wx.showToast({title:"更新个人信息失败",icon:"none"})})];case 2:return(n=r.sent())&&(this.hhGame.currentUser=n),[3,5];case 3:return r.sent(),[3,5];case 4:return wx.hideLoading(),[7];case 5:return[3,7];case 6:console.log("用户拒绝了授权",t),this.hhGame.currentUser.platform.wechatUnionId||wx.showToast({title:"您拒绝了授权,将以游客身份进入。",icon:"none"}),r.label=7;case 7:return e(this.hhGame.currentUser),[2]}})})},t.prototype._wxLogin=function(){return r(this,void 0,void 0,function(){return o(this,function(t){return[2,new Promise(function(t,e){wx.login({success:function(e){t(e)},fail:function(t){e(t)}})})]})})},t}();e.default=s},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){}return t.alert=function(t,e,n){void 0===e&&(e=""),void 0===n&&(n="确定");var r=function(r,o){wx.showModal({title:e,content:t,showCancel:!1,confirmText:n,success:function(){r()},fail:function(t){o(t)}})};return this._lastToastPromise?this._lastToastPromise=this._lastToastPromise.then(function(){return new Promise(r)}):this._lastToastPromise=new Promise(r),this._lastToastPromise},t.confirm=function(t,e,n){void 0===e&&(e="");var r=function(r,o){wx.showModal(Object.assign({title:e,content:t,success:function(t){t.confirm?r(!0):t.cancel&&r(!1)},fail:function(t){o(t)}},n))};return this._lastToastPromise?this._lastToastPromise=this._lastToastPromise.then(function(){return new Promise(r)}):this._lastToastPromise=new Promise(r),this._lastToastPromise},t.downloadFile=function(t){return new Promise(function(e,n){wx.downloadFile({url:t,success:function(t){e(t.tempFilePath)},fail:function(e){wx.showModal({title:"图片下载失败",content:JSON.stringify(e)+",url:"+t}),n(e)}})})},t.getLocation=function(){return r(this,void 0,void 0,function(){return o(this,function(t){return[2,new Promise(function(t,e){wx.getLocation({type:"wgs84",success:function(e){t({latitude:e.latitude,longitude:e.longitude,speed:e.speed,accuracy:e.accuracy})},fail:function(t){e(t)}})})]})})},t}();e.default=i},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=new(r(n(0)).default)("/platform/weapp/PtlUpdateWxUserInfo.ts",{needLogin:!0});e.default=o}])); |
174995
41
1088