app.a700b62e.js 152 KB

1234
  1. (function(t){function e(e){for(var i,s,c=e[0],a=e[1],u=e[2],f=0,p=[];f<c.length;f++)s=c[f],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&p.push(r[s][0]),r[s]=0;for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(t[i]=a[i]);l&&l(e);while(p.length)p.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var t,e=0;e<o.length;e++){for(var n=o[e],i=!0,c=1;c<n.length;c++){var a=n[c];0!==r[a]&&(i=!1)}i&&(o.splice(e--,1),t=s(s.s=n[0]))}return t}var i={},r={app:0},o=[];function s(e){if(i[e])return i[e].exports;var n=i[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=t,s.c=i,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)s.d(n,i,function(e){return t[e]}.bind(null,i));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="";var c=window["webpackJsonp"]=window["webpackJsonp"]||[],a=c.push.bind(c);c.push=e,c=c.slice();for(var u=0;u<c.length;u++)e(c[u]);var l=a;o.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("56d7")},"02e2":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAMCAYAAAC0qUeeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGtmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgKFdpbmRvd3MpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAxOS0xMC0xNFQxNjozNzozMyswODowMCIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAxOS0xMC0xNFQxNjo0NTo0MSswODowMCIgeG1wOk1vZGlmeURhdGU9IjIwMTktMTAtMTRUMTY6NDU6NDErMDg6MDAiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Mzk0OTIzZjAtNjEzZi0yODQxLTljNzMtMjBkYTFmMTUyNzlmIiB4bXBNTTpEb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6MGUzOTdmZDgtNDg1My1jMzRiLThhYTItOWQ2MTYxNjQ0NjRhIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6MTBlNjJiMGEtNmRmZC00MDRiLTljOTUtNmMyZjMzZjcwNDQ3IiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIj4gPHhtcE1NOkhpc3Rvcnk+IDxyZGY6U2VxPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY3JlYXRlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDoxMGU2MmIwYS02ZGZkLTQwNGItOWM5NS02YzJmMzNmNzA0NDciIHN0RXZ0OndoZW49IjIwMTktMTAtMTRUMTY6Mzc6MzMrMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAoV2luZG93cykiLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjdkZGQxYWE2LTdlNmMtOTI0Ni05ZTQzLWRhYzczNDM0NmFiNSIgc3RFdnQ6d2hlbj0iMjAxOS0xMC0xNFQxNjozNzozMyswODowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6Mzk0OTIzZjAtNjEzZi0yODQxLTljNzMtMjBkYTFmMTUyNzlmIiBzdEV2dDp3aGVuPSIyMDE5LTEwLTE0VDE2OjQ1OjQxKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ0MgKFdpbmRvd3MpIiBzdEV2dDpjaGFuZ2VkPSIvIi8+IDwvcmRmOlNlcT4gPC94bXBNTTpIaXN0b3J5PiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PlslVyoAAAC2SURBVCiRfZE9CsJAEIW/DYJoYxGwEGvvYKnMAWxCyjQWHiJnUEvBC4hneBex9w6Wa+EmTGL0wTL7877H7G6IMdJI0hK4Ay+gMrMnTpmk6NYFsAa2QCEp9+aRmYUEXICDOzumemqTAcwsABXf6uxlzcTMpqlXr6VvJUsX20m6DQB5Gp3kGVD+ACZ98zzVIWDVN29ckgcAzq1ZUs3nXRkAArCQtG+Sa2DMt0pJjwRcAYL/7n+SFN8k1EcxX6aCPQAAAABJRU5ErkJggg=="},"2faf":function(t,e,n){t.exports=n.p+"assets/img/face002.c9f88acd.jpg"},"51d6":function(t,e,n){t.exports=n.p+"assets/img/face005.d5784a4b.jpg"},"56d7":function(t,e,n){"use strict";n.r(e);n("e260"),n("e6cf"),n("cca6"),n("a79d");var i=n("2b0e"),r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("index")],1)},o=[],s=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"buju"},[t._m(0),n("div",{staticClass:"buju_right fl"},[n("div",{staticClass:"bri_top"},[n("div",{staticClass:"bri_top_font fl"},[t._v(t._s(t.friend.name))]),n("div",{staticClass:"clear"})]),n("div",{staticClass:"bri_center"},[n("div",{staticClass:"bri_center_scroll",staticStyle:{display:"none"}}),n("div",{staticClass:"bri_center_block"},[n("div",{staticClass:"brce_block_box"},t._l(t.messages,(function(e,i){return n("div",{key:i},[0==i||t.messages[i].timestamp-t.messages[i-1].timestamp>3e5?n("div",{staticClass:"brce_time"},[t._v(" "+t._s(t.formatDate(e.timestamp))+" ")]):t._e(),e.senderId!=t.currentUser.uuid?n("div",{staticClass:"brce_left"},[n("div",{staticClass:"brce_left_face fl"},[n("img",{attrs:{src:t.friend.avatar}})]),n("div",{staticClass:"brce_left_talk fl"},[n("div",{staticClass:"brce_lt_name"},[t._v(t._s(t.friend.name))]),n("div",{staticClass:"brce_lt_jiao fl"}),n("div",{staticClass:"brce_lt_block fl"},[n("div",[t._v(t._s(e.payload.text))])])]),n("div",{staticClass:"clear"})]):n("div",{staticClass:"brce_right"},[n("div",{staticClass:"brce_left_face fr"},[n("img",{attrs:{src:t.currentUser.avatar}})]),n("div",{staticClass:"brce_left_talk fr"},[n("div",{staticClass:"brce_rt_jiao fr"}),n("div",{staticClass:"brce_rt_block fr"},[n("div",[t._v(t._s(e.payload.text))])])]),n("div",{staticClass:"clear"})])])})),0)])]),n("div",{staticClass:"bri_bottom"},[n("div",{staticClass:"bri_bottom_file fl",attrs:{title:"发送文件"}}),n("input",{staticClass:"bri_bottom_files",staticStyle:{display:"none"},attrs:{type:"file"}}),n("div",{staticClass:"clear"}),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.content,expression:"content"}],domProps:{value:t.content},on:{input:function(e){e.target.composing||(t.content=e.target.value)}}}),n("div",{staticClass:"bri_bottom_but fr",on:{click:t.senbox}},[t._v("发送")]),n("div",{staticClass:"bri_bottom_empty",staticStyle:{display:"none"}},[t._v(" 不能发送空白信息 ")])])])])},c=[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"buju_center fl"},[i("div",{staticClass:"bcen_seach fl"},[i("div",{staticClass:"bcen_seach_font fl"},[t._v("搜索")]),i("input",{staticClass:"fl",staticStyle:{display:"none"},attrs:{type:"text"}}),i("div",{staticClass:"bcen_seach_close fr",staticStyle:{display:"none"}},[i("img",{attrs:{src:n("ba76")}})]),i("div",{staticClass:"bcen_seach_but fr"},[i("img",{attrs:{src:n("a9e3"),width:"100%"}})])]),i("div",{staticClass:"bcen_scroll",staticStyle:{position:"absolute",right:"0px",top:"62px",display:"none"}}),i("div",{staticClass:"clear"}),i("div",{staticClass:"bcen_box"},[i("div",{staticClass:"bcen_jilu"},[i("div",{staticClass:"bcen_block bcen_background"},[i("div",{staticClass:"bcen_block_face fl"},[i("img",{attrs:{src:n("2faf")}})]),i("div",{staticClass:"bcen_block_dian"}),i("div",{staticClass:"bcen_block_font fl"},[i("div",{staticClass:"bcen_block_title"},[t._v("单机游戏交流群")]),i("div",{staticClass:"bcen_block_fonts over"},[t._v(" 卖兜的小麦兜:今天有去的吗 ")])]),i("div",{staticClass:"bcen_block_right fr"},[i("div",{staticClass:"bcen_block_time"},[t._v("8:42")]),i("div",{staticClass:"bcen_block_note fr"},[i("img",{attrs:{src:n("02e2"),width:"100%"}})])])]),i("div",{staticClass:"bcen_block"},[i("div",{staticClass:"bcen_block_face fl"},[i("img",{attrs:{src:n("b76e")}})]),i("div",{staticClass:"bcen_block_font fl"},[i("div",{staticClass:"bcen_block_title"},[t._v("冰雪")]),i("div",{staticClass:"bcen_block_fonts over"},[t._v("出去玩吗?")])]),i("div",{staticClass:"bcen_block_right fr"},[i("div",{staticClass:"bcen_block_time"},[t._v("4:44")])])]),i("div",{staticClass:"bcen_block"},[i("div",{staticClass:"bcen_block_face fl"},[i("img",{attrs:{src:n("74f3")}})]),i("div",{staticClass:"bcen_block_font fl"},[i("div",{staticClass:"bcen_block_title"},[t._v("首席铲屎官")]),i("div",{staticClass:"bcen_block_fonts over"},[t._v("拜拜")])]),i("div",{staticClass:"bcen_block_right fr"},[i("div",{staticClass:"bcen_block_time"},[t._v("昨天")])])]),i("div",{staticClass:"bcen_block"},[i("div",{staticClass:"bcen_block_face fl"},[i("img",{attrs:{src:n("51d6")}})]),i("div",{staticClass:"bcen_block_nums"},[t._v("1")]),i("div",{staticClass:"bcen_block_font fl"},[i("div",{staticClass:"bcen_block_title"},[t._v("阿卡姆骑士")]),i("div",{staticClass:"bcen_block_fonts over"},[t._v("出去玩不?")])]),i("div",{staticClass:"bcen_block_right fr"},[i("div",{staticClass:"bcen_block_time"},[t._v("8:42")]),i("div",{staticClass:"bcen_block_note fr"},[i("img",{attrs:{src:n("02e2"),width:"100%"}})])])])]),i("div",{staticClass:"bcen_jilu",staticStyle:{display:"none"}},[i("div",{staticClass:"bsea_first"},[t._v("联系人")]),i("div",{staticClass:"bcen_block"},[i("div",{staticClass:"bcen_block_face fl"},[i("img",{attrs:{src:n("b76e")}})]),i("div",{staticClass:"bcen_block_font fl"},[i("div",{staticClass:"bcen_block_title",staticStyle:{"line-height":"40px"}},[t._v("冰雪")])])]),i("div",{staticClass:"bcen_block"},[i("div",{staticClass:"bcen_block_face fl"},[i("img",{attrs:{src:n("b76e")}})]),i("div",{staticClass:"bcen_block_font fl"},[i("div",{staticClass:"bcen_block_title"},[t._v("冰雪")]),i("div",{staticClass:"bcen_block_fonts over"},[t._v("昵称:劳拉·克劳馥")])])])])])])}],a=(n("7db0"),n("b0c0"),n("b65f"),n("ac1f"),n("5319"),n("1157")),u=n.n(a),l={name:"index",data:function(){return{friend:null,allHistoryLoaded:!1,messages:[],currentUser:null,image:{show:!1,url:""},content:""}},created:function(){this.imService.initData();var t=this.imService.login({uuid:"doctor_1",name:"渣渣宝",avatar:"https://thirdwx.qlogo.cn/mmopen/vi_32/Awmqgg2ZrOhCqc93ORufXddx7QQCibELU88h41ibAv2YlHk7h8vZLbX93ZMC2eW2SAb7YmLQUPdfjYW059OXMeZA/132"});t&&this.imService.connectIM()},beforeMount:function(){this.friend={uuid:"member_19",name:"落雨桐",avatar:"https://thirdwx.qlogo.cn/mmopen/vi_32/vVicEqDDpH8KL0JIJIr0icdicxBzP0iakAdgUKwJtgpqg4J3gSgGSGaH6sYmvLIl2deMoYzGsRetvCzZD4znaDAoRw/132"},this.friend.type=this.GoEasyIM.SCENE.PRIVATE,this.currentUser=this.imService.currentUser,console.log(this.currentUser),this.messages=this.imService.getPrivateMessages(this.friend.uuid),this.initialPrivateListeners(),this.markMessageAsRead(this.friend.uuid)},destroyed:function(){this.imService.onNewPrivateMessageReceive=function(){}},methods:{initialPrivateListeners:function(){var t=this;this.imService.onNewPrivateMessageReceive=function(e){e==t.friend.uuid&&(t.markMessageAsRead(e),t.scrollToBottom())}},markMessageAsRead:function(t){0!=this.messages.length&&this.im.markPrivateMessageAsRead(t).then((function(){console.log("标记为已读成功")})).catch((function(t){console.log("标记为已读失败",t)}))},senbox:function(){var t=this.im.createTextMessage({text:this.content,to:{id:this.friend.uuid,type:this.friend.type,data:{name:this.friend.name,avatar:this.friend.avatar}}});this.imService.sendMessage(t),this.content="",console.log(this.messages)},loadMoreHistoryMessage:function(){var t=this,e=Date.now(),n=this.messages[0];n&&(e=n.timestamp);var i=this.imService.loadPrivateHistoryMessage(this.friend.id,e);i.then((function(e){0==e.length&&(t.allHistoryLoaded=!0)})).catch((function(t){console.log("获取历史消息失败",t)}))},scrollToBottom:function(){var t=this;this.$nextTick((function(){t.$refs.scrollView.scrollTo(0,t.$refs.scrollView.scrollHeight)}))},showImageFullScreen:function(t){this.image.url=t.payload.url,this.image.show=!0}},mounted:function(){u()((function(){function t(){var t=u()(".bcen_block_face").width(),e=u()(".bcen_block_face").height(),n=t/e;u()(".bcen_block_face img").each((function(){var i=u()(this).width(),r=u()(this).height(),o=i/r;if(n<o){u()(this).css("height",e);var s=e*o,c=0-(s-t)/2;u()(this).css("margin-left",c)}else{u()(this).css("width","100%");var a=t/o,l=0-(a-e)/2;u()(this).css("margin-top",l)}}))}function e(){var t=u()(".brce_left_face").width(),e=u()(".brce_left_face").height(),n=t/e;u()(".brce_left_face img").each((function(){var i=u()(this).width(),r=u()(this).height(),o=i/r;if(console.log(o),n<o){u()(this).css("height",e);var s=e*o,c=0-(s-t)/2;u()(this).css("margin-left",c)}else{u()(this).css("width","100%");var a=t/n,l=0-(a-e)/2;u()(this).css("margin-top",l)}}))}function n(){var t=u()(".brce_block_box").height(),e=u()(".brce_block_box").children("div").height();if(e>t){var n=t/e,i=n*t;i=Math.trunc(i),u()(".bri_center_scroll").height(i)}else u()(".bri_center_scroll").css("display","none")}function i(){var t=u()(".bcen_box").height(),e=u()(".bcen_jilu").height();if(e>t){var n=t/e,i=n*t;i=Math.trunc(i),u()(".bcen_scroll").height(i)}else u()(".bcen_scroll").css("display","none")}function r(){var t=u()(window).height(),e=u()(window).width();u()(".buju_left").height(t),u()(".buju_center").height(t),u()(".buju_right").height(t),u()(".yinyings").height(t),u()(".buju_install").height(t-61),u()(".bcen_box").height(t-62),u()(".buju_right").width(e-310),u()(".bri_bottom").width(e-310),u()(".brce_block_box").width(e-310),u()(".buju_right textarea").width(e-360),u()(".bri_center").height(t-205),u()(".brce_block_box").height(t-205)}t(),e(),r(),i(),n(),u()(window).resize((function(){r(),i(),n()})),u()(".bcen_seach_font").click((function(){u()(this).css("display","none"),u()(this).next().css("display","block"),u()(this).next().focus(),u()(".bcen_seach").css("background-color","#f5f2f1")})),u()(".bcen_seach").find(":text").blur((function(){u()(".bcen_seach").css("background-color","#e5e3e2");var t=u()(this).val();""==t&&(u()(this).css("display","none"),u()(this).prev().css("display","block"))})),u()(".bcen_seach").find(":text").keyup((function(){var t=u()(this).val();""!=t?(u()(".bcen_seach_close").css("display","block"),u()(".bcen_seach_but").css("display","none"),u()(".bcen_jilu").eq(0).css("display","none"),u()(".bcen_jilu").eq(1).css("display","block")):(u()(".bcen_seach_close").css("display","none"),u()(".bcen_seach_but").css("display","block"),u()(".bcen_jilu").eq(0).css("display","block"),u()(".bcen_jilu").eq(1).css("display","none"))})),u()("body").on("click",".bcen_seach_close",(function(){u()(".bcen_seach").find(":text").val(""),u()(".bcen_seach").find(":text").css("display","none"),u()(".bcen_seach_font").css("display","block"),u()(".bcen_seach").css("background-color","#e5e3e2"),u()(".bcen_seach_close").css("display","none"),u()(".bcen_seach_but").css("display","block")})),u()(".bcen_block").mouseenter((function(){u()(this).not(".bcen_background").css("background-color","#ddd")})),u()(".bcen_block").mouseleave((function(){u()(this).not(".bcen_background").css("background-color","#e7e8e9")})),u()(".bcen_block").click((function(){u()(this).removeAttr("style"),u()(this).addClass("bcen_background"),u()(".bcen_block").not(this).removeClass("bcen_background"),u()(this).find(".bcen_block_dian").css("display","none"),u()(this).find(".bcen_block_nums").css("display","none")})),u()(".bri_bottom textarea").focus((function(){u()(".bri_bottom").css("background-color","#fff")})),u()(".bri_bottom textarea").blur((function(){u()(".bri_bottom").css("background-color","#f5f5f5")})),u()(".bri_bottom_face").click((function(){u()(".bri_bottom_look").css("display","block")})),u()(document).bind("click",(function(t){0==u()(t.target).closest(".bri_bottom_look").length&&0==u()(t.target).closest(".bri_bottom_face").length&&u()(".bri_bottom_look").css("display","none")})),u()(".bri_bottom_file").click((function(){u()(".bri_bottom_files").click()})),u()(".bri_top_more").click((function(){var t=u()(".buju_install").css("display");"block"==t?u()(".buju_install").css("display","none"):"none"==t&&u()(".buju_install").css("display","block")})),u()(".bin_two_but").click((function(){var t=u()(this).find("img").attr("src");t=t.replace("../assets/common/img/",""),t=t.replace(".png",""),"butclose"==t?u()(this).find("img").attr("src","../assets/common/img/butopen.png"):"butopen"==t&&u()(this).find("img").attr("src","../assets/common/img/butclose.png")})),u()(".bin_three input").focus((function(){u()(".bin_three").css("background-color","#fff")})),u()(".bin_three input").keyup((function(){var t=u()(this).val();""==t?(u()(".bin_three_close").css("display","none"),u()(".bin_three_seach").css("display","block")):""!=t&&(u()(".bin_three_close").css("display","block"),u()(".bin_three_seach").css("display","none"))})),u()(".bin_three_close").click((function(){u()(".bin_three input").val(""),u()(".bin_three_close").css("display","none"),u()(".bin_three_seach").css("display","block"),u()(".bin_three").css("background-color","#f5f5f5")})),u()(".bin_four_more").click((function(){var t=u()(this).find("label").html();"查看更多群成员"==t?(u()(this).find("label").html("收起群成员"),u()(this).find("img").attr("src","../assets/common/img/up001.png")):"收起群成员"==t&&(u()(this).find("label").html("查看更多群成员"),u()(this).find("img").attr("src","../assets/common/img/down001.png"))})),u()(".bin_five_text").mouseenter((function(){u()(this).next("img").css("display","block")})),u()(".bin_five_text").mouseleave((function(){u()(this).next("img").css("display","none")})),u()(".bin_five_text").click((function(){u()(this).next("input").attr("type","text"),u()(this).css("display","none"),u()(this).next("input").focus()})),u()(".bin_five_text").next("input").blur((function(){var t=u()(this).val();""!=t&&u()(this).prev(".bin_five_text").html(t),u()(this).prev(".bin_five_text").css("display","block"),u()(this).attr("type","hidden")})),u()(".bin_five_text").eq(0).next("input").blur((function(){var t=u()(this).val();u()(".bri_top_font").html(t)})),u()(".bin_five_butname").click((function(){var t=u()(this).attr("src");t=t.replace("../assets/common/img/",""),t=t.replace(".png",""),"butclose"==t?(u()(this).attr("src","../assets/common/img/butopen.png"),u()(".brce_lt_name").css("display","block")):"butopen"==t&&(u()(this).attr("src","../assets/common/img/butclose.png"),u()(".brce_lt_name").css("display","none"))})),u()(".bin_five_but").click((function(){var t=u()(this).attr("src");t=t.replace("../assets/common/img/",""),t=t.replace(".png",""),"butclose"==t?u()(this).attr("src","../assets/common/img/butopen.png"):"butopen"==t&&u()(this).attr("src","../assets/common/img/butclose.png")})),u()(".bin_five_note").click((function(){u()(".bin_note").css("display","block")})),u()(".bin_note_close").click((function(){u()(".bin_note").css("display","none")}))}))}},f=l,p=(n("cdf5"),n("2877")),h=Object(p["a"])(f,s,c,!1,null,"b915be1e",null),d=h.exports,y={name:"App",components:{index:d}},v=y,m=Object(p["a"])(v,r,o,!1,null,null,null),g=m.exports,b=(n("d3b7"),n("accb")),k=n.n(b);function w(t,e,n){this.uuid=t,this.name=e,this.avatar=n}function E(t){this.im=t,this.initData(),this.onNewPrivateMessageReceive=function(t,e){},this.onNewGroupMessageReceive=function(t,e){}}E.prototype.initData=function(){this.currentUser=null,this.friends={},this.privateMessages={},this.groupMessages={}},E.prototype.login=function(t){return this.privateMessages={},this.groupMessages={},!!t&&(this.currentUser=new w(t.uuid,t.name,t.avatar),!0)},E.prototype.getPrivateMessages=function(t){return this.privateMessages[t]||(this.privateMessages[t]=[]),this.privateMessages[t]},E.prototype.connectIM=function(){this.initialIMListeners(),this.im.connect({id:this.currentUser.uuid,data:{avatar:this.currentUser.avatar,name:this.currentUser.name}}).then((function(){console.log("connect成功")})).catch((function(t){console.log("connect失败,请确保网络正常,appkey和host正确,code:"+t.code+" content:"+t.content)}))},E.prototype.initialIMListeners=function(){var t=this;this.im.on(k.a.EVENT.CONNECTED,(function(){console.log("连接成功.")})),this.im.on(k.a.EVENT.DISCONNECTED,(function(){console.log("连接断开.")})),this.im.on(k.a.EVENT.CONNECTING,(function(t){console.log("连接中",t)})),this.im.on(k.a.EVENT.PRIVATE_MESSAGE_RECEIVED,(function(e){var n;n=t.currentUser.uuid==e.senderId?e.receiverId:e.senderId;var i=t.getPrivateMessages(n);i.push(e),t.onNewPrivateMessageReceive(n,e)}))},E.prototype.loadPrivateHistoryMessage=function(t,e){var n=this;return new Promise((function(i,r){n.im.history({friendId:t,lastTimestamp:e}).then((function(e){for(var r=e.content,o=n.getPrivateMessages(t),s=r.length-1;s>=0;s--)o.unshift(r[s]);i(r)})).catch((function(t){401==t.code&&console.log("您尚未开通历史消息,请登录GoEasy,查看应用详情里自助启用."),r(t)}))}))},E.prototype.sendMessage=function(t){var e;e=t.to.type===k.a.SCENE.GROUP?this.getGroupMessages(t.to.id):this.getPrivateMessages(t.to.id),e.push(t);var n=this.im.sendMessage(t).then((function(){console.log("发送消息成功")})).catch((function(t){console.log(t)}));return n};var R=E;i["a"].config.productionTip=!1,i["a"].prototype.GoEasyIM=k.a,console.log(i["a"].prototype.GoEasyIM);var _=i["a"].prototype.im=k.a.getInstance({host:"hangzhou.goeasy.io",appkey:"BC-087763b7d212460484b71bffeaecb359"});i["a"].prototype.imService=new R(_),i["a"].prototype.formatDate=function(t){t=t||Date.now();var e=new Date(t),n=e.getMonth()<9?"0"+(e.getMonth()+1):e.getMonth()+1;return n+="-",n+=e.getDate()<10?"0"+e.getDate():e.getDate(),n+=" ",n+=e.getHours(),n+=":",n+=e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes(),n},new i["a"]({render:function(t){return t(g)}}).$mount("#app")},"74f3":function(t,e,n){t.exports=n.p+"assets/img/face004.4a1731fa.jpg"},a9e3:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFwmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgKFdpbmRvd3MpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAxOS0xMC0xNFQxNToxNDoyNiswODowMCIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAxOS0xMC0xNFQxNToxNDoyNiswODowMCIgeG1wOk1vZGlmeURhdGU9IjIwMTktMTAtMTRUMTU6MTQ6MjYrMDg6MDAiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ZDQxNWY0MzktMjRmMy1mNTQzLWFhMzktZjRjNTRjMTUwZDhkIiB4bXBNTTpEb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6Yzk2ODljNDYtZmEyNi01NjQ3LThhYjAtY2ZiNTFkNjVhOTE4IiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6ZWI0Mjc4NTMtOGQ5Mi1hZTQ5LWE1NjItZmU2OWI5N2Y0NTkwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ZWI0Mjc4NTMtOGQ5Mi1hZTQ5LWE1NjItZmU2OWI5N2Y0NTkwIiBzdEV2dDp3aGVuPSIyMDE5LTEwLTE0VDE1OjE0OjI2KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ0MgKFdpbmRvd3MpIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDpkNDE1ZjQzOS0yNGYzLWY1NDMtYWEzOS1mNGM1NGMxNTBkOGQiIHN0RXZ0OndoZW49IjIwMTktMTAtMTRUMTU6MTQ6MjYrMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAoV2luZG93cykiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Y8N8cwAAAKFJREFUGJWFz7EKQVEcx/EP3cVjGOQt3JQ8gs0mDDaLJ5DBZHKzsRmNUlIeQpk8ybWcdFynfOs3nH/ffv1OrSxLMJ1MBFpYoRfeFyzwrPumjTtuaIbcwq2dVeRlyCa6bdDAstrcw8EvO/SzaOtfqs0XDBPeCOfq5hMKlNGcIebI4+Yu1hgjxyskRwePLBKPGOCKfWpzlhA/bIvi54OzlJjiDZVJI1MBrmH7AAAAAElFTkSuQmCC"},accb:function(t,e,n){(function(t,i){var r,o,s;n("a4d3"),n("e01a"),n("d28b"),n("944a"),n("99af"),n("4de4"),n("7db0"),n("c740"),n("4160"),n("c975"),n("a15b"),n("d81d"),n("fb6a"),n("a434"),n("c19f"),n("b0c0"),n("0c47"),n("4ec9"),n("23dc"),n("a9e3d"),n("e439"),n("dbb4"),n("3410"),n("b64b"),n("d3b7"),n("4ae1"),n("5d41"),n("4d63"),n("ac1f"),n("5377"),n("25f0"),n("3ca3"),n("466d"),n("5319"),n("1276"),n("498a"),n("5cc6"),n("9a8c"),n("a975"),n("735e"),n("c1ac"),n("d139"),n("3a7b"),n("d5d6"),n("82f8"),n("e91f"),n("60bd"),n("5f96"),n("3280"),n("3fcc"),n("ca91"),n("25a1"),n("cd26"),n("3c5d"),n("2954"),n("649e"),n("219c"),n("170b"),n("b39a"),n("72f7"),n("159b"),n("ddb0"),n("2b3d"),n("bf19");var c=n("7037");!function(t,n){"object"==c(e)&&"object"==c(i)?i.exports=n():(o=[],r=n,s="function"===typeof r?r.apply(e,o):r,void 0===s||(i.exports=s))}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},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"==c(t)&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},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=58)}([function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}t.exports=function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e,n){var i=n(13);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}},function(t,e,n){var i=n(7),r=n(11);t.exports=function(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?r(t):e}},function(t,e,n){var i=n(38);function r(e,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=r=Reflect.get:t.exports=r=function(t,e,n){var r=i(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}},r(e,n,o||e)}t.exports=r},function(t,e){t.exports=function(){return function(){}}},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==c(Symbol.iterator)?t.exports=n=function(t){return c(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":c(t)},n(e)}t.exports=n},function(t,e,n){var i=n(47),r=n(21),o=n(49),s=n(50);"undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),"undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),e.protocol=3;var c=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},a=i(c),u={type:"error",data:"parser error"},l=n(51);e.encodePacket=function(t,e,n,i){"function"==typeof e&&(i=e,e=!1),"function"==typeof n&&(i=n,n=null),void 0===t.data||t.data.buffer||t.data;var r=c[t.type];return void 0!==t.data&&(r+=n?s.encode(String(t.data),{strict:!1}):String(t.data)),i(""+r)},e.decodePacket=function(t,e,n){if(void 0===t)return u;if("string"==typeof t){if(n&&!1===(t=function(t){try{t=s.decode(t,{strict:!1})}catch(t){return!1}return t}(t)))return u;var i=t.charAt(0);return Number(i)==i&&a[i]?t.length>1?{type:a[i],data:t.substring(1)}:{type:a[i]}:u}i=new Uint8Array(t)[0];var r=sliceBuffer(t,1);return l&&"blob"===e&&(r=new l([r])),{type:a[i],data:r}},e.encodePayload=function(t,n,i){"function"==typeof n&&(i=n,n=null);var s=r(t);if(!t.length)return i("0:");!function(t,e,n){for(var i=new Array(t.length),r=o(t.length,n),s=function(t,n,r){e(n,(function(e,n){i[t]=n,r(e,i)}))},c=0;c<t.length;c++)s(c,t[c],r)}(t,(function(t,i){e.encodePacket(t,!!s&&n,!0,(function(t){i(null,function(t){return t.length+":"+t}(t))}))}),(function(t,e){return i(e.join(""))}))},e.decodePayload=function(t,n,i){var r;if("function"==typeof n&&(i=n,n=null),""===t)return i(u,0,1);for(var o,s,c="",a=0,l=t.length;a<l;a++){var f=t.charAt(a);if(":"===f){if(""===c||c!=(o=Number(c)))return i(u,0,1);if(c!=(s=t.substr(a+1,o)).length)return i(u,0,1);if(s.length){if(r=e.decodePacket(s,n,!0),u.type===r.type&&u.data===r.data)return i(u,0,1);if(!1===i(r,a+o,l))return}a+=o,c=""}else c+=f}return""!==c?i(u,0,1):void 0}},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(7),r=n.n(i),o=n(0),s=n.n(o),c=n(1),a=n.n(c),u=new(function(){function t(){s()(this,t)}return a()(t,[{key:"isWx",value:function(){return!("undefined"==typeof wx||!wx.getLocation)&&("undefined"!=typeof GameGlobal||"function"!=typeof WebSocket||"function"!=typeof XMLHttpRequest)}},{key:"isUni",value:function(){return!("object"!==("undefined"==typeof uni?"undefined":r()(uni))||!uni.getSystemInfo)}},{key:"isTT",value:function(){return!("object"!==("undefined"==typeof tt?"undefined":r()(tt))||!tt.getSystemInfo)}},{key:"isBrowserClient",value:function(){return this.isUni()?"function"==typeof WebSocket&&"function"==typeof XMLHttpRequest&&"object"==("undefined"==typeof localStorage?"undefined":r()(localStorage)):!(this.isReactNative()||this.isWx()||this.isTT())}},{key:"isReactNative",value:function(){return"undefined"!=typeof navigator&&"ReactNative"==navigator.product}}]),t}())},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){e.encode=function(t){var e="";for(var n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e},e.decode=function(t){for(var e={},n=t.split("&"),i=0,r=n.length;i<r;i++){var o=n[i].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}},function(t,e){function n(e,i){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,i)}t.exports=n},function(t,e,n){n(6)("socket.io-parser");var i=n(40),r=n(41);function o(){}e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=o,e.Decoder=c;var s=e.ERROR+'"encode error"';function c(){this.reconstructor=null}function a(t){this.reconPack=t,this.buffers=[]}function u(t){return{type:e.ERROR,data:"parser error: "+t}}o.prototype.encode=function(t,n){n([function(t){var n=""+t.type;if(e.BINARY_EVENT!==t.type&&e.BINARY_ACK!==t.type||(n+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(n+=t.nsp+","),null!=t.id&&(n+=t.id),null!=t.data){var i=function(t){try{return JSON.stringify(t)}catch(t){return!1}}(t.data);if(!1===i)return s;n+=i}return n}(t)])},i(c.prototype),c.prototype.add=function(t){var n;if("string"!=typeof t)throw new Error("Unknown type: "+t);n=function(t){var n=0,i={type:Number(t.charAt(0))};if(null==e.types[i.type])return u("unknown packet type "+i.type);if(e.BINARY_EVENT===i.type||e.BINARY_ACK===i.type){for(var o="";"-"!==t.charAt(++n)&&(o+=t.charAt(n),n!=t.length););if(o!=Number(o)||"-"!==t.charAt(n))throw new Error("Illegal attachments");i.attachments=Number(o)}if("/"===t.charAt(n+1))for(i.nsp="";++n;){if(","===(c=t.charAt(n)))break;if(i.nsp+=c,n===t.length)break}else i.nsp="/";var s=t.charAt(n+1);if(""!==s&&Number(s)==s){for(i.id="";++n;){var c;if(null==(c=t.charAt(n))||Number(c)!=c){--n;break}if(i.id+=t.charAt(n),n===t.length)break}i.id=Number(i.id)}if(t.charAt(++n)){var a=function(t){try{return JSON.parse(t)}catch(t){return!1}}(t.substr(n));if(!1===a||i.type!==e.ERROR&&!r(a))return u("invalid payload");i.data=a}return i}(t),this.emit("decoded",n)},c.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},a.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e=binary.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},a.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(t,e,n){var i=n(8),r=n(22);function o(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.isReactNative=t.isReactNative,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}t.exports=o,r(o.prototype),o.prototype.onError=function(t,e){var n=new Error(t);return n.type="TransportError",n.description=e,this.emit("error",n),this},o.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},o.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},o.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},o.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},o.prototype.onData=function(t){var e=i.decodePacket(t,this.socket.binaryType);this.onPacket(e)},o.prototype.onPacket=function(t){this.emit("packet",t)},o.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e){t.exports=function(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){"use strict";n.r(e),n.d(e,"GoEasyDomainNumber",(function(){return l}));var i=n(0),r=n.n(i),o=n(1),s=n.n(o),c=n(10),a=new(function(){function t(){r()(this,t)}return s()(t,[{key:"getCookie",value:function(){var t,e=new RegExp("(^| )"+name+"=([^;]*)(;|$)");return(t=document.cookie.match(e))?unescape(t[2]):null}},{key:"getData",value:function(t){return window.localStorage?window.localStorage.getItem(t):this.getCookie(t)}},{key:"setCookie",value:function(t,e){var n=new Date;n.setTime(n.getTime()+2592e6),document.cookie=t+"="+escape(e)+";expires="+n.toGMTString()}},{key:"setData",value:function(t,e){window.localStorage?window.localStorage.setItem(t,e):this.setCookie(t,e)}}]),t}()),u=10,l=function(){function t(){r()(this,t)}return s()(t,null,[{key:"refreshNumber",value:function(){var t=Math.floor(Math.random()*(u-1)+1);return c.a.isBrowserClient()&&(t=parseInt(a.getData("goEasyNode"))||t),t>0&&t<u?t+=1:t==u&&(t=1),c.a.isBrowserClient()&&a.setData("goEasyNode",t),t}}]),t}()},function(t,e){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,i=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,r=t.indexOf("["),o=t.indexOf("]");-1!=r&&-1!=o&&(t=t.substring(0,r)+t.substring(r,o).replace(/:/g,";")+t.substring(o,t.length));for(var s=n.exec(t||""),c={},a=14;a--;)c[i[a]]=s[a]||"";return-1!=r&&-1!=o&&(c.source=e,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c}},function(t,e,n){var i=n(42),r=n(25),o=n(26),s=n(14),a=n(27),u=n(28),l=(n(6)("socket.io-client:manager"),n(24)),f=n(57),p=n(17).GoEasyDomainNumber,h=Object.prototype.hasOwnProperty;function d(t,e){if(!(this instanceof d))return new d(t,e);t&&"object"==c(t)&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new f({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=e.parser||s;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=!1!==e.autoConnect,this.autoConnect&&this.open()}t.exports=d,d.prototype.emitAll=function(){for(var t in this.emit.apply(this,arguments),this.nsps)h.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},d.prototype.updateSocketIds=function(){for(var t in this.nsps)h.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))},d.prototype.generateId=function(t){return("/"===t?"":t+"#")+this.engine.id},o(d.prototype),d.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},d.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},d.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},d.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},d.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},d.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},d.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},d.prototype.open=d.prototype.connect=function(t,e){if(~this.readyState.indexOf("open"))return this;this.engine=i(this.uri,this.opts);var n=this.engine,r=this;this.readyState="opening",this.skipReconnect=!1;var o=a(n,"open",(function(){r.onopen(),t&&t()})),s=a(n,"error",(function(e){if("undefined"!=typeof window){var n=parseInt(r.uri.match(/[1-9][0-9]*/g)[0]),i=p.refreshNumber();r.uri=r.uri.replace(n,i)}if(r.cleanup(),r.readyState="closed",r.emitAll("connect_error",e),t){var o=new Error("Connection error");o.data=e,t(o)}else r.maybeReconnectOnOpen()}));if(!1!==this._timeout){var c=this._timeout,u=setTimeout((function(){o.destroy(),n.close(),n.emit("error","timeout"),r.emitAll("connect_timeout",c)}),c);this.subs.push({destroy:function(){clearTimeout(u)}})}return this.subs.push(o),this.subs.push(s),this},d.prototype.onopen=function(){this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(a(t,"data",u(this,"ondata"))),this.subs.push(a(t,"ping",u(this,"onping"))),this.subs.push(a(t,"pong",u(this,"onpong"))),this.subs.push(a(t,"error",u(this,"onerror"))),this.subs.push(a(t,"close",u(this,"onclose"))),this.subs.push(a(this.decoder,"decoded",u(this,"ondecoded")))},d.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},d.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},d.prototype.ondata=function(t){this.decoder.add(t)},d.prototype.ondecoded=function(t){this.emit("packet",t)},d.prototype.onerror=function(t){this.emitAll("error",t)},d.prototype.socket=function(t,e){var n=this.nsps[t];if(!n){n=new r(this,t,e),this.nsps[t]=n;var i=this;n.on("connecting",o),n.on("connect",(function(){n.id=i.generateId(t)})),this.autoConnect&&o()}function o(){~l(i.connecting,n)||i.connecting.push(n)}return n},d.prototype.destroy=function(t){var e=l(this.connecting,t);~e&&this.connecting.splice(e,1),this.connecting.length||this.close()},d.prototype.packet=function(t){var e=this;t.query&&0===t.type&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,(function(n){for(var i=0;i<n.length;i++)e.engine.write(n[i],t.options);e.encoding=!1,e.processPacketQueue()})))},d.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},d.prototype.cleanup=function(){for(var t=this.subs.length,e=0;e<t;e++)this.subs.shift().destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},d.prototype.close=d.prototype.disconnect=function(){this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},d.prototype.onclose=function(t){this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},d.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();this.reconnecting=!0;var n=setTimeout((function(){var e;t.skipReconnect||(t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||(e=!1,"object"==("undefined"===typeof uni?"undefined":c(uni))&&uni.getSystemInfo&&(e=!0),e&&!0===getApp().uniAppRunningBackend?(t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error","Uniapp running backend, skipped reconnect...")):t.open((function(e){e?(t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):t.onreconnect()}))))}),e);this.subs.push({destroy:function(){clearTimeout(n)}})}},d.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e,n){var i=n(44),r=n(54);e.polling=function(t){var e=!1,n=!1;if(t.jsonp,"undefined"!=typeof location){var r="https:"===location.protocol,o=location.port;o||(o=r?443:80),e=t.hostname!==location.hostname||o!==t.port,n=t.secure!==r}return t.xdomain=e,t.xscheme=n,new i(t)},e.websocket=r},function(e,n,i){var r=i(48),o=Object.prototype.toString,s="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===o.call(Blob),a="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===o.call(File);e.exports=function e(n){if(!n||"object"!=c(n))return!1;if(r(n)){for(var i=0,o=n.length;i<o;i++)if(e(n[i]))return!0;return!1}if("function"==typeof t&&t.isBuffer&&t.isBuffer(n)||"function"==typeof ArrayBuffer&&n instanceof ArrayBuffer||s&&n instanceof Blob||a&&n instanceof File)return!0;if(n.toJSON&&"function"==typeof n.toJSON&&1===arguments.length)return e(n.toJSON(),!0);for(var u in n)if(Object.prototype.hasOwnProperty.call(n,u)&&e(n[u]))return!0;return!1}},function(t,e,n){function i(t){if(t)return function(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}(t)}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},i.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,i=this._callbacks["$"+t];if(!i)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var r=0;r<i.length;r++)if((n=i[r])===e||n.fn===e){i.splice(r,1);break}return this},i.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks["$"+t];if(n)for(var i=0,r=(n=n.slice(0)).length;i<r;++i)n[i].apply(this,e);return this},i.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},i.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,n){"use strict";var i,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),o={},s=0,c=0;function a(t){var e="";do{e=r[t%64]+e,t=Math.floor(t/64)}while(t>0);return e}function u(){var t=a(+new Date);return t!==i?(s=0,i=t):t+"."+a(s++)}for(;c<64;c++)o[r[c]]=c;u.encode=a,u.decode=function(t){var e=0;for(c=0;c<t.length;c++)e=64*e+o[t.charAt(c)];return e},t.exports=u},function(t,e){var n=[].indexOf;t.exports=function(t,e){if(n)return t.indexOf(e);for(var i=0;i<t.length;++i)if(t[i]===e)return i;return-1}},function(t,e,n){var i=n(14),r=n(26),o=n(56),s=n(27),a=n(28),u=(n(6)("socket.io-client:socket"),n(12)),l=n(21);t.exports=h;var f={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},p=r.prototype.emit;function h(t,e,n){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}r(h.prototype),h.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[s(t,"open",a(this,"onopen")),s(t,"packet",a(this,"onpacket")),s(t,"close",a(this,"onclose"))]}},h.prototype.open=h.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},h.prototype.send=function(){var t=o(arguments);return t.unshift("message"),this.emit.apply(this,t),this},h.prototype.emit=function(t){if(f.hasOwnProperty(t))return p.apply(this,arguments),this;var e=o(arguments),n={type:(void 0!==this.flags.binary?this.flags.binary:l(e))?i.BINARY_EVENT:i.EVENT,data:e,options:{}};return n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof e[e.length-1]&&(this.acks[this.ids]=e.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),this.flags={},this},h.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},h.prototype.onopen=function(){if("/"!==this.nsp)if(this.query){var t="object"==c(this.query)?u.encode(this.query):this.query;this.packet({type:i.CONNECT,query:t})}else this.packet({type:i.CONNECT})},h.prototype.onclose=function(t){this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},h.prototype.onpacket=function(t){var e=t.nsp===this.nsp,n=t.type===i.ERROR&&"/"===t.nsp;if(e||n)switch(t.type){case i.CONNECT:this.onconnect();break;case i.EVENT:case i.BINARY_EVENT:this.onevent(t);break;case i.ACK:case i.BINARY_ACK:this.onack(t);break;case i.DISCONNECT:this.ondisconnect();break;case i.ERROR:this.emit("error",t.data)}},h.prototype.onevent=function(t){var e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?p.apply(this,e):this.receiveBuffer.push(e)},h.prototype.ack=function(t){var e=this,n=!1;return function(){if(!n){n=!0;var r=o(arguments);e.packet({type:l(r)?i.BINARY_ACK:i.ACK,id:t,data:r})}}},h.prototype.onack=function(t){var e=this.acks[t.id];"function"==typeof e&&(e.apply(this,t.data),delete this.acks[t.id])},h.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},h.prototype.emitBuffered=function(){var t;for(t=0;t<this.receiveBuffer.length;t++)p.apply(this,this.receiveBuffer[t]);for(this.receiveBuffer=[],t=0;t<this.sendBuffer.length;t++)this.packet(this.sendBuffer[t]);this.sendBuffer=[]},h.prototype.ondisconnect=function(){this.destroy(),this.onclose("io server disconnect")},h.prototype.destroy=function(){if(this.subs){for(var t=0;t<this.subs.length;t++)this.subs[t].destroy();this.subs=null}this.io.destroy(this)},h.prototype.close=h.prototype.disconnect=function(){return this.connected&&this.packet({type:i.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},h.prototype.compress=function(t){return this.flags.compress=t,this},h.prototype.binary=function(t){return this.flags.binary=t,this}},function(t,e,n){function i(t){if(t)return function(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}(t)}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},i.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,i=this._callbacks["$"+t];if(!i)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var r=0;r<i.length;r++)if((n=i[r])===e||n.fn===e){i.splice(r,1);break}return this},i.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks["$"+t];if(n)for(var i=0,r=(n=n.slice(0)).length;i<r;++i)n[i].apply(this,e);return this},i.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},i.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e){t.exports=function(t,e,n){return t.on(e,n),{destroy:function(){t.removeListener(e,n)}}}},function(t,e){var n=[].slice;t.exports=function(t,e){if("string"==typeof e&&(e=t[e]),"function"!=typeof e)throw new Error("bind() requires a function");var i=n.call(arguments,2);return function(){return e.apply(t,i.concat(n.call(arguments)))}}},function(t,e,n){var i,r,o=n(33),s=n(34),c=0,a=0;t.exports=function(t,e,n){var u=e&&n||0,l=e||[],f=(t=t||{}).node||i,p=void 0!==t.clockseq?t.clockseq:r;if(null==f||null==p){var h=o();null==f&&(f=i=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==p&&(p=r=16383&(h[6]<<8|h[7]))}var d=void 0!==t.msecs?t.msecs:(new Date).getTime(),y=void 0!==t.nsecs?t.nsecs:a+1,v=d-c+(y-a)/1e4;if(v<0&&void 0===t.clockseq&&(p=p+1&16383),(v<0||d>c)&&void 0===t.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=d,a=y,r=p;var m=(1e4*(268435455&(d+=122192928e5))+y)%4294967296;l[u++]=m>>>24&255,l[u++]=m>>>16&255,l[u++]=m>>>8&255,l[u++]=255&m;var g=d/4294967296*1e4&268435455;l[u++]=g>>>8&255,l[u++]=255&g,l[u++]=g>>>24&15|16,l[u++]=g>>>16&255,l[u++]=p>>>8|128,l[u++]=255&p;for(var b=0;b<6;++b)l[u+b]=f[b];return e||s(l)}},function(t,e,n){var i=n(2),r=n(13),o=n(35),s=n(36);function c(e){var n="function"==typeof Map?new Map:void 0;return t.exports=c=function(t){if(null===t||!o(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return s(t,arguments,i(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r(e,t)},c(e)}t.exports=c},function(t,e,n){var i=n(39),r=n(14),o=n(19);n(6)("socket.io-client"),t.exports=e=a;var s=e.managers={};function a(t,e){"object"==c(t)&&(e=t,t=void 0),e=e||{};var n,r=i(t),a=r.source,u=r.id,l=r.path,f=s[u]&&l in s[u].nsps;return e.forceNew||e["force new connection"]||!1===e.multiplex||f?n=o(a,e):(s[u]||(s[u]=o(a,e)),n=s[u]),r.query&&!e.query&&(e.query=r.query),n.socket(r.path,e)}e.protocol=r.protocol,e.connect=a,e.Manager=n(19),e.Socket=n(25)},function(t){t.exports=JSON.parse('{"name":"goeasy-js","version":"1.4.0","keywords":["realtime","framework","websocket","tcp","events","client"],"dependencies":{"@babel/core":"^7.10.2","@babel/plugin-proposal-class-properties":"^7.10.1","@babel/plugin-proposal-decorators":"^7.10.3","@babel/plugin-transform-runtime":"^7.10.1","@babel/preset-env":"^7.10.2","babel-loader":"^8.1.0","uglifyjs-webpack-plugin":"^2.2.0","webpack":"^4.43.0","webpack-cli":"^3.3.11","webpack-obfuscator":"^1.9.0","socket.io-client-goeasy":"./dependencies/socket.io-client-goeasy"},"scripts":{"build":"npm run build-goeasy & npm run build-goeasy-dev & npm run build-goeasyim & npm run build-goeasyim-dev","build-goeasy":"webpack --config build/webpack.goeasy.config.js --mode production","build-goeasy-dev":"webpack --config build/webpack.goeasy-dev.config.js --mode production","build-goeasyim":"webpack --config build/webpack.goeasyim.config.js","build-goeasyim-dev":"webpack --config build/webpack.goeasyim-dev.config.js"},"license":"MIT","devDependencies":{"uuid":"^3.3.2","strip-loader":"0.1.2"}}')},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 i=new Uint8Array(16);t.exports=function(){return n(i),i}}else{var r=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),r[e]=t>>>((3&e)<<3)&255;return r}}},function(t,e){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(t,e){var i=e||0,r=n;return[r[t[i++]],r[t[i++]],r[t[i++]],r[t[i++]],"-",r[t[i++]],r[t[i++]],"-",r[t[i++]],r[t[i++]],"-",r[t[i++]],r[t[i++]],"-",r[t[i++]],r[t[i++]],r[t[i++]],r[t[i++]],r[t[i++]],r[t[i++]]].join("")}},function(t,e){t.exports=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}},function(t,e,n){var i=n(13),r=n(37);function o(e,n,s){return r()?t.exports=o=Reflect.construct:t.exports=o=function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&i(o,n.prototype),o},o.apply(null,arguments)}t.exports=o},function(t,e){t.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}},function(t,e,n){var i=n(2);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=i(t)););return t}},function(t,e,n){var i=n(18);n(6)("socket.io-client:url"),t.exports=function(t,e){var n=t;e=e||"undefined"!=typeof location&&location,null==t&&(t=e.protocol+"//"+e.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?e.protocol+t:e.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==e?e.protocol+"//"+t:"https://"+t),n=i(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";var r=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+r+":"+n.port,n.href=n.protocol+"://"+r+(e&&e.port===n.port?"":":"+n.port),n}},function(t,e,n){function i(t){if(t)return function(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}(t)}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},i.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,i=this._callbacks["$"+t];if(!i)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var r=0;r<i.length;r++)if((n=i[r])===e||n.fn===e){i.splice(r,1);break}return this},i.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks["$"+t];if(n)for(var i=0,r=(n=n.slice(0)).length;i<r;++i)n[i].apply(this,e);return this},i.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},i.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){t.exports=n(43),t.exports.parser=n(8)},function(t,e,n){var i=n(20),r=n(22),o=(n(6)("engine.io-client:socket"),n(24)),s=n(8),a=n(18),u=n(12);function l(t,e){if(!(this instanceof l))return new l(t,e);e=e||{},t&&"object"==c(t)&&(e=t,t=null),t?(t=a(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=a(e.host).host),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.agent=e.agent||!1,this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.query=e.query||{},"string"==typeof this.query&&(this.query=u.decode(this.query)),this.upgrade=!1!==e.upgrade,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.jsonp=!1!==e.jsonp,this.forceBase64=!!e.forceBase64,this.enablesXDR=!!e.enablesXDR,this.timestampParam=e.timestampParam||"t",this.timestampRequests=e.timestampRequests,this.transports=e.transports||["polling","websocket"],this.transportOptions=e.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=e.policyPort||843,this.rememberUpgrade=e.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=e.onlyBinaryUpgrades,this.perMessageDeflate=!1!==e.perMessageDeflate&&(e.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=e.pfx||null,this.key=e.key||null,this.passphrase=e.passphrase||null,this.cert=e.cert||null,this.ca=e.ca||null,this.ciphers=e.ciphers||null,this.rejectUnauthorized=void 0===e.rejectUnauthorized||e.rejectUnauthorized,this.forceNode=!!e.forceNode,this.isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),("undefined"==typeof self||this.isReactNative)&&(e.extraHeaders&&Object.keys(e.extraHeaders).length>0&&(this.extraHeaders=e.extraHeaders),e.localAddress&&(this.localAddress=e.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}t.exports=l,l.priorWebsocketSuccess=!1,r(l.prototype),l.protocol=s.protocol,l.Socket=l,l.Transport=n(15),l.transports=n(20),l.parser=n(8),l.prototype.createTransport=function(t){var e=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}(this.query);e.EIO=s.protocol,e.transport=t;var n=this.transportOptions[t]||{};return this.id&&(e.sid=this.id),new i[t]({query:e,socket:this,agent:n.agent||this.agent,hostname:n.hostname||this.hostname,port:n.port||this.port,secure:n.secure||this.secure,path:n.path||this.path,forceJSONP:n.forceJSONP||this.forceJSONP,jsonp:n.jsonp||this.jsonp,forceBase64:n.forceBase64||this.forceBase64,enablesXDR:n.enablesXDR||this.enablesXDR,timestampRequests:n.timestampRequests||this.timestampRequests,timestampParam:n.timestampParam||this.timestampParam,policyPort:n.policyPort||this.policyPort,pfx:n.pfx||this.pfx,key:n.key||this.key,passphrase:n.passphrase||this.passphrase,cert:n.cert||this.cert,ca:n.ca||this.ca,ciphers:n.ciphers||this.ciphers,rejectUnauthorized:n.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:n.perMessageDeflate||this.perMessageDeflate,extraHeaders:n.extraHeaders||this.extraHeaders,forceNode:n.forceNode||this.forceNode,localAddress:n.localAddress||this.localAddress,requestTimeout:n.requestTimeout||this.requestTimeout,protocols:n.protocols||void 0,isReactNative:this.isReactNative})},l.prototype.open=function(){var t;if(this.rememberUpgrade&&l.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length){var e=this;return void setTimeout((function(){e.emit("error","No transports available")}),0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},l.prototype.setTransport=function(t){var e=this;this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",(function(){e.onDrain()})).on("packet",(function(t){e.onPacket(t)})).on("error",(function(t){e.onError(t)})).on("close",(function(){e.onClose("transport close")}))},l.prototype.probe=function(t){var e=this.createTransport(t,{probe:1}),n=!1,i=this;function r(){if(i.onlyBinaryUpgrades){var t=!this.supportsBinary&&i.transport.supportsBinary;n=n||t}n||(e.send([{type:"ping",data:"probe"}]),e.once("packet",(function(t){if(!n)if("pong"===t.type&&"probe"===t.data){if(i.upgrading=!0,i.emit("upgrading",e),!e)return;l.priorWebsocketSuccess="websocket"===e.name,i.transport.pause((function(){n||"closed"!==i.readyState&&(f(),i.setTransport(e),e.send([{type:"upgrade"}]),i.emit("upgrade",e),e=null,i.upgrading=!1,i.flush())}))}else{var r=new Error("probe error");r.transport=e.name,i.emit("upgradeError",r)}})))}function o(){n||(n=!0,f(),e.close(),e=null)}function s(t){var n=new Error("probe error: "+t);n.transport=e.name,o(),i.emit("upgradeError",n)}function c(){s("transport closed")}function a(){s("socket closed")}function u(t){e&&t.name!==e.name&&o()}function f(){e.removeListener("open",r),e.removeListener("error",s),e.removeListener("close",c),i.removeListener("close",a),i.removeListener("upgrading",u)}l.priorWebsocketSuccess=!1,e.once("open",r),e.once("error",s),e.once("close",c),this.once("close",a),this.once("upgrading",u),e.open()},l.prototype.onOpen=function(){if(this.readyState="open",l.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause)for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])},l.prototype.onPacket=function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}},l.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},l.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout((function(){"closed"!==e.readyState&&e.onClose("ping timeout")}),t||e.pingInterval+e.pingTimeout)},l.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout((function(){t.ping(),t.onHeartbeat(t.pingTimeout)}),t.pingInterval)},l.prototype.ping=function(){var t=this;this.sendPacket("ping",(function(){t.emit("ping")}))},l.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},l.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},l.prototype.write=l.prototype.send=function(t,e,n){return this.sendPacket("message",t,e,n),this},l.prototype.sendPacket=function(t,e,n,i){if("function"==typeof e&&(i=e,e=void 0),"function"==typeof n&&(i=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var r={type:t,data:e,options:n};this.emit("packetCreate",r),this.writeBuffer.push(r),i&&this.once("flush",i),this.flush()}},l.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var t=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?i():e()})):this.upgrading?i():e()}function e(){t.onClose("forced close"),t.transport.close()}function n(){t.removeListener("upgrade",n),t.removeListener("upgradeError",n),e()}function i(){t.once("upgrade",n),t.once("upgradeError",n)}return this},l.prototype.onError=function(t){l.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)},l.prototype.onClose=function(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)},l.prototype.filterUpgrades=function(t){for(var e=[],n=0,i=t.length;n<i;n++)~o(this.transports,t[n])&&e.push(t[n]);return e}},function(t,e,n){(function(e){var i=n(46),r=n(16);t.exports=l;var o,s=/\n/g,c=/\\n/g;function a(){}function u(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:{}}function l(t){if(i.call(this,t),this.query=this.query||{},!o){var e=u();o=e.___eio=e.___eio||[]}this.index=o.length;var n=this;o.push((function(t){n.onData(t)})),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",(function(){n.script&&(n.script.onerror=a)}),!1)}r(l,i),l.prototype.supportsBinary=!1,l.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),i.prototype.doClose.call(this)},l.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(e,n):(document.head||document.body).appendChild(e),this.script=e,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)}),100)},l.prototype.doWrite=function(t,e){var n=this;if(!this.form){var i,r=document.createElement("form"),o=document.createElement("textarea"),a=this.iframeId="eio_iframe_"+this.index;r.className="socketio",r.style.position="absolute",r.style.top="-1000px",r.style.left="-1000px",r.target=a,r.method="POST",r.setAttribute("accept-charset","utf-8"),o.name="d",r.appendChild(o),document.body.appendChild(r),this.form=r,this.area=o}function u(){l(),e()}function l(){if(n.iframe)try{n.form.removeChild(n.iframe)}catch(t){n.onError("jsonp polling iframe removal error",t)}try{var t='<iframe src="javascript:0" name="'+n.iframeId+'">';i=document.createElement(t)}catch(t){(i=document.createElement("iframe")).name=n.iframeId,i.src="javascript:0"}i.id=n.iframeId,n.form.appendChild(i),n.iframe=i}this.form.action=this.uri(),l(),t=t.replace(c,"\\\n"),this.area.value=t.replace(s,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===n.iframe.readyState&&u()}:this.iframe.onload=u}}).call(this,n(45))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==("undefined"===typeof window?"undefined":c(window))&&(n=window)}t.exports=n},function(t,e,n){var i=n(15),r=n(12),o=n(8),s=n(16),c=n(23);n(6)("engine.io-client:polling"),t.exports=u;var a=null!=new(n(52))({xdomain:!1}).responseType;function u(t){var e=t&&t.forceBase64;a&&!e||(this.supportsBinary=!1),i.call(this,t)}s(u,i),u.prototype.name="polling",u.prototype.doOpen=function(){this.poll()},u.prototype.pause=function(t){var e=this;function n(){e.readyState="paused",t()}if(this.readyState="pausing",this.polling||!this.writable){var i=0;this.polling&&(i++,this.once("pollComplete",(function(){--i||n()}))),this.writable||(i++,this.once("drain",(function(){--i||n()})))}else n()},u.prototype.poll=function(){this.polling=!0,this.doPoll(),this.emit("poll")},u.prototype.onData=function(t){var e=this;o.decodePayload(t,this.socket.binaryType,(function(t,n,i){if("opening"===e.readyState&&e.onOpen(),"close"===t.type)return e.onClose(),!1;e.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState&&this.poll())},u.prototype.doClose=function(){var t=this;function e(){t.write([{type:"close"}])}"open"===this.readyState?e():this.once("open",e)},u.prototype.write=function(t){var e=this;this.writable=!1;var n=function(){e.writable=!0,e.emit("drain")};o.encodePayload(t,this.supportsBinary,(function(t){e.doWrite(t,n)}))},u.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(t[this.timestampParam]=c()),this.supportsBinary||t.sid||(t.b64=1),t=r.encode(t),this.port&&("https"===e&&443!==Number(this.port)||"http"===e&&80!==Number(this.port))&&(n=":"+this.port),t.length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+t}},function(t,e){t.exports=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var i in t)n.call(t,i)&&e.push(i);return e}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e){function n(){}t.exports=function(t,e,i){var r=!1;return i=i||n,o.count=t,0===t?e():o;function o(t,n){if(o.count<=0)throw new Error("after called too many times");--o.count,t?(r=!0,e(t),e=i):0!==o.count||r||e(null,n)}}},function(t,e){
  2. /*! https://mths.be/utf8js v2.1.2 by @mathias */
  3. var n,i,r,o=String.fromCharCode;function s(t){for(var e,n,i=[],r=0,o=t.length;r<o;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<o?56320==(64512&(n=t.charCodeAt(r++)))?i.push(((1023&e)<<10)+(1023&n)+65536):(i.push(e),r--):i.push(e);return i}function c(t,e){if(t>=55296&&t<=57343){if(e)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function a(t,e){return o(t>>e&63|128)}function u(t,e){if(0==(4294967168&t))return o(t);var n="";return 0==(4294965248&t)?n=o(t>>6&31|192):0==(4294901760&t)?(c(t,e)||(t=65533),n=o(t>>12&15|224),n+=a(t,6)):0==(4292870144&t)&&(n=o(t>>18&7|240),n+=a(t,12),n+=a(t,6)),n+o(63&t|128)}function l(){if(r>=i)throw Error("Invalid byte index");var t=255&n[r];if(r++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function f(t){var e,o;if(r>i)throw Error("Invalid byte index");if(r==i)return!1;if(e=255&n[r],r++,0==(128&e))return e;if(192==(224&e)){if((o=(31&e)<<6|l())>=128)return o;throw Error("Invalid continuation byte")}if(224==(240&e)){if((o=(15&e)<<12|l()<<6|l())>=2048)return c(o,t)?o:65533;throw Error("Invalid continuation byte")}if(240==(248&e)&&(o=(7&e)<<18|l()<<12|l()<<6|l())>=65536&&o<=1114111)return o;throw Error("Invalid UTF-8 detected")}t.exports={version:"2.1.2",encode:function(t,e){for(var n=!1!==(e=e||{}).strict,i=s(t),r=i.length,o=-1,c="";++o<r;)c+=u(i[o],n);return c},decode:function(t,e){var c=!1!==(e=e||{}).strict;n=s(t),i=n.length,r=0;for(var a,u=[];!1!==(a=f(c));)u.push(a);return function(t){for(var e,n=t.length,i=-1,r="";++i<n;)(e=t[i])>65535&&(r+=o((e-=65536)>>>10&1023|55296),e=56320|1023&e),r+=o(e);return r}(u)}}},function(t,e){var n=void 0!==n?n:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,i=function(){try{return 2===new Blob(["hi"]).size}catch(t){return!1}}(),r=i&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(t){return!1}}(),o=n&&n.prototype.append&&n.prototype.getBlob;function s(t){return t.map((function(t){if(t.buffer instanceof ArrayBuffer){var e=t.buffer;if(t.byteLength!==e.byteLength){var n=new Uint8Array(t.byteLength);n.set(new Uint8Array(e,t.byteOffset,t.byteLength)),e=n.buffer}return e}return t}))}function c(t,e){e=e||{};var i=new n;return s(t).forEach((function(t){i.append(t)})),e.type?i.getBlob(e.type):i.getBlob()}function a(t,e){return new Blob(s(t),e||{})}"undefined"!=typeof Blob&&(c.prototype=Blob.prototype,a.prototype=Blob.prototype),t.exports=i?r?Blob:a:o?c:void 0},function(t,e,n){var i=n(53);t.exports=function(t){var e=t.xdomain,n=t.xscheme,r=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!e||i))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!n&&r)return new XDomainRequest}catch(t){}if(!e)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}},function(t,e){try{t.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){t.exports=!1}},function(e,n,i){var r,o,s=i(15),a=i(8),u=i(12),l=i(16),f=i(23);if(i(6)("engine.io-client:websocket"),"undefined"==typeof uni&&"undefined"==typeof wx||"undefined"!=typeof WebSocket)if("undefined"!=typeof WebSocket)r=WebSocket;else if("undefined"!=typeof self)r=self.WebSocket||self.MozWebSocket;else try{o=i(55)}catch(e){}var p=r||o;function h(t){t&&t.forceBase64&&(this.supportsBinary=!1),("undefined"==typeof uni&&"undefined"==typeof wx||"undefined"!=typeof WebSocket)&&(this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=r&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(p=o)),s.call(this,t)}"undefined"==typeof uni&&"undefined"==typeof wx||"undefined"!=typeof WebSocket||(p=function(t){var e=this;if(e.onopen=function(){},e.onclose=function(){},e.onmessage=function(t){},e.onerror=function(t){},"object"==("undefined"===typeof tt?"undefined":c(tt))&&tt.getSystemInfo){var n=tt.connectSocket({url:t});e.send=function(t){n.send({data:t})},e.close=function(){n.close()},n.onOpen((function(){e.onopen()})),n.onError((function(t){e.onerror(t)})),n.onMessage((function(t){e.onmessage(t)})),n.onClose((function(){e.onclose()}))}else"undefined"!=typeof uni?(e.send=function(t){uni.sendSocketMessage({data:t})},e.close=function(){uni.closeSocket()},uni.onSocketOpen((function(t){e.onopen()})),uni.onSocketError((function(t){e.onerror(t)})),uni.onSocketMessage((function(t){e.onmessage(t)})),uni.onSocketClose((function(t){e.onclose()})),uni.connectSocket({url:t})):(e.send=function(t){wx.sendSocketMessage({data:t})},e.close=function(){wx.closeSocket()},wx.onSocketOpen((function(t){e.onopen()})),wx.onSocketError((function(t){e.onerror(t)})),wx.onSocketMessage((function(t){e.onmessage(t)})),wx.onSocketClose((function(t){e.onclose()})),wx.connectSocket({url:t}))}),e.exports=h,l(h,s),h.prototype.name="websocket",h.prototype.supportsBinary=!1,h.prototype.doOpen=function(){if(this.check()){var t,e,n=this.uri();("undefined"==typeof uni&&"undefined"==typeof wx||"undefined"!=typeof WebSocket)&&(t=this.protocols),(e="undefined"==typeof uni&&"undefined"==typeof wx||"undefined"!=typeof WebSocket?{agent:this.agent,perMessageDeflate:this.perMessageDeflate}:{agent:this.agent}).pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(e.headers=this.extraHeaders),this.localAddress&&(e.localAddress=this.localAddress);try{"undefined"==typeof uni&&"undefined"==typeof wx||"undefined"!=typeof WebSocket?this.ws=this.usingBrowserWebSocket&&!this.isReactNative?t?new p(n,t):new p(n):new p(n,t,e):this.ws=new p(n)}catch(t){return this.emit("error",t)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},h.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},h.prototype.write=function(e){var n=this;this.writable=!1;for(var i=e.length,r=0,o=i;r<o;r++)!function(e){a.encodePacket(e,n.supportsBinary,(function(r){if("undefined"==typeof uni&&"undefined"==typeof wx||"undefined"!=typeof WebSocket){if(!n.usingBrowserWebSocket){var o={};e.options&&(o.compress=e.options.compress),n.perMessageDeflate&&("string"==typeof r?t.byteLength(r):r.length)<n.perMessageDeflate.threshold&&(o.compress=!1)}try{n.usingBrowserWebSocket?n.ws.send(r):n.ws.send(r,o)}catch(e){}}else try{n.ws.send(r)}catch(e){}--i||s()}))}(e[r]);function s(){n.emit("flush"),setTimeout((function(){n.writable=!0,n.emit("drain")}),0)}},h.prototype.onClose=function(){s.prototype.onClose.call(this)},h.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},h.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",n="";return this.port&&("wss"===e&&443!==Number(this.port)||"ws"===e&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=f()),this.supportsBinary||(t.b64=1),(t=u.encode(t)).length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+t},h.prototype.check=function(){return!(!p||"__initialize"in p&&this.name===h.prototype.name)}},function(t,e){},function(t,e){t.exports=function(t,e){for(var n=[],i=(e=e||0)||0;i<t.length;i++)n[i-e]=t[i];return n}},function(t,e){function n(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=n,n.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t}},function(t,e,n){"use strict";n.r(e);var i=n(0),r=n.n(i),o=n(1),s=n.n(o),c=Object.create(null);c.PRIVATE_MESSAGE_RECEIVED="PRIVATE_MESSAGE_RECEIVED",c.GROUP_MESSAGE_RECEIVED="GROUP_MESSAGE_RECEIVED",c.SYSTEM_MESSAGE_RECEIVED="SYSTEM_MESSAGE_RECEIVED",c.CONVERSATIONS_UPDATED="CONVERSATIONS_UPDATED",c.CONNECTED="CONNECTED",c.CONNECTING="CONNECTING",c.DISCONNECTED="DISCONNECTED",c.USER_PRESENCE="USER_PRESENCE",c.GROUP_PRESENCE="GROUP_PRESENCE";var a=n(7),u=n.n(a),l=new(function(){function t(){r()(this,t)}return s()(t,[{key:"isUndef",value:function(t){return null==t}},{key:"isTrue",value:function(t){return!0===t}},{key:"isFalse",value:function(t){return!1===t}},{key:"isPrimitive",value:function(t){return"string"==typeof t||"number"==typeof t||"symbol"===u()(t)||"boolean"==typeof t}},{key:"isDef",value:function(t){return null!=t}},{key:"isObject",value:function(t){return null!==t&&"object"===u()(t)}},{key:"isPlainObject",value:function(t){return"[object Object]"===Object.prototype.toString.call(t)}},{key:"isRegExp",value:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}},{key:"isValidArrayIndex",value:function(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}},{key:"isStringOrNumber",value:function(t){return"string"==typeof t||"number"==typeof t}},{key:"isString",value:function(t){return"string"==typeof t}},{key:"isNumber",value:function(t){return"number"==typeof t}},{key:"isEmpty",value:function(t){return Array.isArray(t)?0==t.length:this.isObject(t)?!this.isDef(t):!this.isNumber(t)&&(this.isString(t)?""==t.trim():!this.isDef(t))}},{key:"isNative",value:function(t){return"function"==typeof t&&/native code/.test(t.toString())}},{key:"isFunction",value:function(t){return"function"==typeof t}}]),t}()),f=n(29),p=n.n(f),h=function(){function t(){r()(this,t)}return s()(t,null,[{key:"get",value:function(){return p()().replace(/-/g,"")}}]),t}(),d=n(3),y=n.n(d),v=n(4),m=n.n(v),g=n(2),b=n.n(g),k=n(30);function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}new(function(t){y()(n,t);var e=w(n);function n(){return r()(this,n),e.apply(this,arguments)}return s()(n,[{key:"deleteByKey",value:function(t,e,n){var i=t.findIndex((function(t){return t[e]==n}));i>-1&&t.splice(i,1)}},{key:"unshiftGuid",value:function(t){var e=!1,n=this.findIndex((function(e){return e==t}));for(n>-1&&(e=!0,this.splice(n,1)),this.unshift(t);this.length>300;)this.pop();return e}}]),n}(n.n(k)()(Array)));var E=n(10),R=n(17);function _(){}var N=new(function(){function t(){r()(this,t),this.subs=null,this.subs=Object.create(null)}return s()(t,[{key:"on",value:function(t,e){if(!l.isString(t))throw Error("eventType require a string.");if(!l.isDef(c[t]))throw Error("event not found.");if(!l.isFunction(e))throw Error("event require a callback.");this.subs[t]=e}},{key:"notify",value:function(t,e){var n=this.subs[t];n&&n(e)}}]),t}()),O={GROUP:"group",PRIVATE:"private"},I={new:"new",sending:"sending",success:"success",fail:"fail"},C=function(){function t(){r()(this,t)}return s()(t,null,[{key:"assemble",value:function(t){if(!l.isDef(t))return null;try{var e=Object.create(null);return e.type=t.mt,e.timestamp=t.ts,e.senderId=t.s,e.payload=JSON.parse(t.p),e.messageId=t.i,e.status=I.success,t.t==O.GROUP?(e.groupId=t.r,e.senderData=t.d&&JSON.parse(t.d)):e.receiverId=t.r,e}catch(t){throw Error(t)}}}]),t}(),S=function(){function t(){r()(this,t),this.type="",this.lastMessage=null,this.unread=0,this.top=!1,this.data=null,this.lc=0,this.lm=0}return s()(t,null,[{key:"buildByInMessage",value:function(e){var n=new t;return n.type=e.t,n.lastMessage=C.assemble(e),n.lc=n.lastMessage.timestamp-1,n.lm=n.lastMessage.timestamp,n.unread=0,e.t==O.GROUP?n.groupId=e.r:Ke.userId==e.r?n.userId=e.s:n.userId=e.r,n}},{key:"buildByOutMessage",value:function(e,n,i,r){var o=new t;return o.type=n,o.lastMessage=e,o.lm=o.lastMessage.timestamp,o.lc=o.lm,o.unread=0,n==O.GROUP?(o.groupId=i,o.lastMessage.groupId=i):(o.userId=i,o.lastMessage.receiverId=i),o}},{key:"buildByConversation",value:function(e,n){var i=new t;i.type=n.t,n.lmsg.t=n.t,i.lastMessage=C.assemble(n.lmsg),i.unread=0,i.lc=n.lcts,i.lm=i.lastMessage.timestamp,i.top=n.top||!1;var r=n.d?JSON.parse(n.d):{};return i.data=r,n.t==O.GROUP?(i.groupId=n.g,e.putGroupData(i.groupId,r)):(i.userId=n.uid,e.putUserData(i.userId,r),Ke.userId==n.lmsg.s?i.lastMessage.senderData=Ke.userData:i.lastMessage.senderData=r),i}}]),t}(),A={WRITE:"WRITE",READ:"READ",NONE:"NONE"},T=function(){function t(e){var n=this;r()(this,t),this.uuid=null,this.name="",this.params=null,this.success=null,this.fail=null,this.permission=A.NONE,this.singleTimeout=0,this.totalTimeout=0,this.startTime=0,this.complete=!1,this.retried=0,this.uuid=h.get(),this.name=e.name,this.params=e.params,this.permission=e.permission,this.totalTimeout=e.totalTimeout,this.singleTimeout=e.singleTimeout,this.success=function(t){n.complete||(n.complete=!0,e.success(t))},this.fail=function(t){n.complete||(n.complete=!0,e.fail(t))}}return s()(t,[{key:"start",value:function(){this.startTime=Date.now()}},{key:"isTimeout",value:function(){return this.startTime+this.totalTimeout<Date.now()}}]),t}(),M=1500,D=3e3,P=1500,x=1e4,j=2500,B=12e3,G=1700,L=12e3,U="authorize",z="imLastConversations",F="markPrivateMessageAsRead",W="markGroupMessageAsRead",Z="imGroupOnlineCount",Y="imHereNow",V="imGroupHereNow",J="publishIM",Q="imHistory",H="subscribeUserPresence",X="unsubscribeUserPresence",q="subscribeGroupPresence",K="unsubscribeGroupPresence",$="removeConversation",tt="topConversation",et="imData",nt="subscribeGroups",it="unsubscribeGroup",rt=function(){function t(e){r()(this,t),this.im=null,this.list=[],this.synchronized=!1,this.im=e,e._iMReceiver.addIMMessageObserver(this.updateByInMessage.bind(this))}return s()(t,[{key:"onUpdated",value:function(){var t=this;this.latestConversations().then((function(){t.im._event.notify(c.CONVERSATIONS_UPDATED,{unreadTotal:t.getUnreadTotal(t.list),conversations:t.list})}))}},{key:"latestConversations",value:function(){return this.synchronized?this.loadLocalConversations():this.loadServerConversations()}},{key:"updateByInMessage",value:function(t){var e=this,n=null;n=t.t==O.GROUP?t.r:Ke.userId==t.r?t.s:t.r;var i,r=this.list.findIndex((function(e){return t.t==O.GROUP&&n==e.groupId||t.t==O.PRIVATE&&n==e.userId}));function o(t){t.type===O.PRIVATE&&(Ke.userId===t.lastMessage.senderId?t.lastMessage.senderData=Ke.userData:t.lastMessage.senderData=t.data)}r>-1?(i=this.list[r],this.list.splice(r,1),i.lc<t.ts&&(i.lastMessage=C.assemble(t),i.lm=t.ts),Ke.userId!=t.senderId&&(i.unread+=1),o(i),this.insertOne(i),this.onUpdated()):(i=S.buildByInMessage(t),Ke.userId!=t.senderId&&(i.unread+=1),this.insertOne(i),this.im._dataCache.loadData(n,t.t).then((function(t){i.data=t,o(i),e.onUpdated()})).catch((function(t){})))}},{key:"updateByOutMessage",value:function(t,e,n,i){var r={};Object.assign(r,t),delete r.file;var o,s=this.list.findIndex((function(t){return t.type==O.GROUP&&n==t.groupId||t.type==O.PRIVATE&&n==t.userId}));s>-1?(o=this.list[s],this.list.splice(s,1),o.unread=0,o.lc=o.lm,o.lastMessage=r,t.status===I.success&&(o.lc=t.timestamp,o.lm=t.timestamp)):o=S.buildByOutMessage(r,e,n,i),o.data=i;var c=this.im._dataCache;e===O.GROUP?c.putGroupData(o.groupId,i):(c.putUserData(o.userId,i),o.lastMessage.senderData=Ke.userData),this.insertOne(o),this.onUpdated()}},{key:"imLastConversations",value:function(t,e){var n=new T({name:z,params:{},permission:A.READ,singleTimeout:j,totalTimeout:B,fail:e,success:t});this.im._goEasySocket.emit(n)}},{key:"loadServerConversations",value:function(){var t=this,e=this.im;return new Promise((function(n,i){t.imLastConversations((function(r){if(200==r.code){for(var o=r.content,s=function(n,i){var r=o[n],s=t.list.find((function(t){return r.t==O.GROUP&&r.g==t.groupId||r.t==O.PRIVATE&&r.uid==t.userId}));l.isDef(s)?s.top=r.top:(s=S.buildByConversation(e._dataCache,r),t.insertOne(s))},c=0,a=o.length;c<a;c++)s(c);t.synchronized=!0,n({code:200,content:{unreadTotal:t.getUnreadTotal(t.list),conversations:t.list}})}else i(r)}),(function(t){i({code:t.resultCode,content:t.content})}))}))}},{key:"loadLocalConversations",value:function(){var t=this,e=[];return this.list.map((function(n){if(!n.data){var i="private"==n.t?n.userId:n.groupId,r=t.im._dataCache.loadData(i,n.t);r.then((function(t){n.data=t})).catch((function(t){})),e.push(r)}})),0!=e.length?new Promise((function(n,i){Promise.all(e).then((function(){n({code:200,content:{unreadTotal:t.getUnreadTotal(t.list),conversations:t.list}})})).catch((function(t){i({code:408,content:t.message})}))})):Promise.resolve({code:200,content:{unreadTotal:this.getUnreadTotal(this.list),conversations:this.list}})}},{key:"privateMarkAsRead",value:function(t){var e=this.list.find((function(e){return e.userId==t})),n={friendId:t};return this.markAsRead(n,e)}},{key:"groupMarkAsRead",value:function(t){var e=this.list.find((function(e){return e.groupId===t})),n={groupId:t};return this.markAsRead(n,e)}},{key:"markAsRead",value:function(t,e){var n=this;return!e||e.unread<=0?Promise.resolve({code:200,content:"OK"}):(t.lastTimestamp=e.lm,t.lastConsumedTimestamp=e.lc,new Promise((function(i,r){var o=e.type==O.PRIVATE?F:W;n.requestEmit(o,t,(function(t){200==t.code?(n.resetConversation(e,e.lm,t.content.amount),i({code:200,content:"OK"})):r(t)}),(function(t){r(t||{code:t.code||408,content:t.content||"Failed to query message"})}))})))}},{key:"resetConversation",value:function(t,e,n){e<=t.lc||(t.unread-=n,t.lc=e,this.onUpdated())}},{key:"getUnreadTotal",value:function(t){for(var e=0,n=0,i=t.length;n<i;n++)e+=t[n].unread;return e}},{key:"insertOne",value:function(t){var e=this.getPosIndex(t);this.list.splice(e+1,0,t)}},{key:"getPosIndex",value:function(t){if(0==this.list.length)return-1;for(var e,n,i=0,r=this.list.length;r-i>1;){e=Math.floor((i+r)/2),n=this.list[e];var o=this.compares(t,n);if(0==o)return e;o>0?i=e:r=e}return 0==i&&this.compares(this.list[0],t)>0?-1:i}},{key:"compares",value:function(t,e){var n;return(n=t.top==e.top?e.lastMessage.timestamp-t.lastMessage.timestamp:t.top?-1:1)>0?1:0===n?0:-1}},{key:"removeConversation",value:function(t,e){var n=this,i=e==O.PRIVATE?"userId":"groupId";return l.isStringOrNumber(t)?(l.isNumber(t)&&(t=t.toString()),-1==this.findConversationIndex(e,t)?Promise.reject({code:400,content:"Failed to remove conversation, "+i+" does not exists."}):new Promise((function(i,r){var o={targetId:t,type:e};n.requestEmit($,o,(function(o){var s=n.findConversationIndex(e,t);s>-1&&n.list.splice(s,1),n.onUpdated(),200==o.code?i({}):r({code:o.code||408,content:o.content||"Failed to remove conversation"})}),(function(t){r({code:t.code||408,content:t.content||"Failed to remove conversation"})}))}))):Promise.reject({code:400,content:"Failed to remove conversation, "+i+" must be a string or integer."})}},{key:"topConversation",value:function(t,e,n){var i=this,r=n==O.PRIVATE?"userId":"groupId";if(!l.isStringOrNumber(t))return Promise.reject({code:400,content:"Failed to top conversation, "+r+" must be a string or integer."});l.isNumber(t)&&(t=t.toString());var o=this.findConversationIndex(n,t);return-1==o||this.list[o].top==e?Promise.reject({code:400,content:"Failed to top conversation, "+r+" does not exists."}):new Promise((function(r,o){var s={targetId:t,top:e,type:n};i.requestEmit(tt,s,(function(){var o=i.findConversationIndex(n,t),s=i.list[o];s.top=e,i.list.splice(o,1),i.insertOne(s),i.onUpdated(),r({})}),(function(t){o({code:t.code||408,content:t.content||"Failed to top Conversation"})}))}))}},{key:"requestEmit",value:function(t,e,n,i){var r=new T({name:t,params:e,permission:A.WRITE,singleTimeout:G,totalTimeout:L,success:n,fail:i});this.im._goEasySocket.emit(r)}},{key:"findConversationIndex",value:function(t,e){return this.list.findIndex((function(n){return t==O.PRIVATE?n.type==t&&n.userId==e:n.type==t&&n.groupId==e}))}}]),t}(),ot=new(function(){function t(){r()(this,t)}return s()(t,[{key:"fileExtension",value:function(t,e){if(l.isString(t))try{var n=t.split(e);return n[n.length-1]}catch(t){throw Error(t)}}}]),t}()),st=n(5),ct=n.n(st),at={default:"default",text:"text",image:"image",video:"video",audio:"audio",emoji:"emoji",file:"file"},ut=function(){function t(e){r()(this,t),this.type="",this.to={type:null,id:null,data:null},this.timestamp=Date.now(),this.senderId=null,this.payload=null,this.messageId=h.get(),this.status=I.new,this.validate(e),this.setSenderId(),this.setType(e),this.setPayload(e),this.setTo(e),this.setData()}return s()(t,[{key:"validate",value:function(t){if(!l.isObject(t))throw Error("it is an empty message.")}},{key:"setType",value:function(t){throw Error("Abstract method")}},{key:"setPayload",value:function(t){this.payload=Object.create(null)}},{key:"setSenderId",value:function(){if(!Ke.userId)throw Error("please call connect() first.");this.senderId=Ke.userId}},{key:"setTo",value:function(t){this.to=t.to}},{key:"setData",value:function(){this.to&&this.to.type==O.GROUP&&(this.senderData=Ke.userData)}}]),t}();function lt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var ft=function(t){y()(n,t);var e=lt(n);function n(t){var i;return r()(this,n),(i=e.call(this,t)).file=null,i.onProgress=null,i.setFile(t.file),i.setOnProgress(t.onProgress),i}return s()(n,[{key:"validate",value:function(t){ct()(b()(n.prototype),"validate",this).call(this,t)}},{key:"setPayload",value:function(t){ct()(b()(n.prototype),"setPayload",this).call(this,t),this.payload.size="",this.payload.contentType="",this.payload.name="",this.payload.url=""}},{key:"setType",value:function(t){this.type=at.file}},{key:"setFile",value:function(t){this.file=t}},{key:"setOnProgress",value:function(t){this.onProgress=t}}]),n}(ut);function pt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var ht=function(t){y()(n,t);var e=pt(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"validate",value:function(t){if(ct()(b()(n.prototype),"validate",this).call(this,t),!l.isDef(t.file))throw Error("file is empty.")}},{key:"setPayload",value:function(t){ct()(b()(n.prototype),"setPayload",this).call(this,t)}}]),n}(ft);function dt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var yt=function(t){y()(n,t);var e=dt(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"validate",value:function(t){if(ct()(b()(n.prototype),"validate",this).call(this,t),!l.isDef(t.file.tempFiles)||0==t.file.tempFiles[0].length)throw Error("tempFiles is empty.")}},{key:"setType",value:function(t){this.type=at.image}},{key:"setFile",value:function(t){var e="chooseMedia:ok"==t.errMsg?t.tempFiles[0].tempFilePath:t.tempFiles[0].path;t.tempFiles[0].path=e,this.file=t}},{key:"setPayload",value:function(t){ct()(b()(n.prototype),"setPayload",this).call(this,t);var e=this,i=t.file.tempFiles[0],r="chooseMedia:ok"==t.file.errMsg?i.tempFilePath:i.path;this.payload.url=r,this.payload.size=i.size,this.payload.width="",this.payload.height="",this.payload.contentType="";var o=l.isEmpty(i.name)||null==i.name?r:i.name;this.payload.name="wx-image."+ot.fileExtension(o,"."),this.payload.contentType="image/"+ot.fileExtension(o,"."),wx.getImageInfo({src:r,success:function(t){e.payload.width=t.width,e.payload.height=t.height}})}}]),n}(ht);function vt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var mt=function(t){y()(n,t);var e=vt(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"validate",value:function(t){ct()(b()(n.prototype),"validate",this).call(this,t)}},{key:"setType",value:function(t){this.type=at.audio}},{key:"setPayload",value:function(t){ct()(b()(n.prototype),"setPayload",this).call(this,t);var e=t.file.tempFilePath;this.payload.url=e,this.payload.duration=t.file.duration/1e3,this.payload.size=t.file.fileSize;var i=l.isEmpty(t.file.name)||null==t.file.name?e:t.file.name;this.payload.contentType="audio/"+ot.fileExtension(i,"."),this.payload.name="wx-audio."+ot.fileExtension(i,".")}}]),n}(ht);function gt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var bt=function(t){y()(n,t);var e=gt(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"validate",value:function(t){ct()(b()(n.prototype),"validate",this).call(this,t)}},{key:"setType",value:function(t){this.type=at.video}},{key:"setFile",value:function(t){this.file="chooseMedia:ok"==t.errMsg?t.tempFiles[0]:t}},{key:"setPayload",value:function(t){this.payload=Object.create(null);var e=Object.create(null),n=Object.create(null),i="chooseMedia:ok"==t.file.errMsg?t.file.tempFiles[0]:t.file,r=i.duration,o=i.height,s=i.size,c=i.tempFilePath,a=i.thumbTempFilePath,u=i.width,f=i.name,p=void 0===f?"":f,h=l.isEmpty(p)?c:p;e.contentType="video/"+ot.fileExtension(h,"."),e.name="wx-video."+ot.fileExtension(h,"."),e.url=c,e.width=n.width=u,e.height=n.height=o,e.size=s,e.duration=r,n.url=a,n.contentType="image/jpg",n.name="wx-thumbnail.jpg",this.payload.video=e,this.payload.thumbnail=n}}]),n}(ht);function kt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var wt=function(t){y()(n,t);var e=kt(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"validate",value:function(t){if(ct()(b()(n.prototype),"validate",this).call(this,t),!l.isDef(t.file))throw Error("file is empty.")}},{key:"setPayload",value:function(t){ct()(b()(n.prototype),"setPayload",this).call(this,t)}}]),n}(ft);function Et(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var Rt=function(t){y()(n,t);var e=Et(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"validate",value:function(t){ct()(b()(n.prototype),"validate",this).call(this,t)}},{key:"setType",value:function(t){this.type=at.audio}},{key:"setPayload",value:function(t){var e=this;ct()(b()(n.prototype),"setPayload",this).call(this,t);var i=this,r=t.file.tempFilePath;this.payload.url=r;var o=l.isEmpty(t.file.name)||null==t.file.name?r:t.file.name;if(this.payload.contentType="audio/"+ot.fileExtension(o,"."),this.payload.name="uni-audio."+ot.fileExtension(o,"."),l.isDef(t.file.duration))this.payload.duration=t.file.duration/1e3;else{this.payload.duration=0;var s=uni.createInnerAudioContext();s.src=r,s.onCanplay((function(t){i.payload.duration=s.duration,s.destroy()}))}uni.getFileInfo({filePath:r,success:function(t){e.payload.size=t.size}})}}]),n}(wt);function _t(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var Nt=function(t){y()(n,t);var e=_t(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"validate",value:function(t){ct()(b()(n.prototype),"validate",this).call(this,t)}},{key:"setType",value:function(t){this.type=at.video}},{key:"setPayload",value:function(t){var e=Object.create(null),n=Object.create(null);this.payload=Object.create(null);var i=t.file,r=i.duration,o=i.height,s=i.size,c=i.tempFilePath,a=i.width,u=i.name,f=void 0===u?"":u,p=l.isEmpty(f)?c:f;e.contentType="video/"+ot.fileExtension(p,"."),e.name="uni-video."+ot.fileExtension(p,"."),e.size=s,e.duration=r,e.url=n.url=c,e.width=n.width=a,e.height=n.height=o,n.contentType="image/jpg",n.name="wx-thumbnail.jpg",this.payload.video=e,this.payload.thumbnail=n}}]),n}(wt);function Ot(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var It=function(t){y()(n,t);var e=Ot(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"validate",value:function(t){if(ct()(b()(n.prototype),"validate",this).call(this,t),!l.isDef(t.file.tempFiles)||0==t.file.tempFiles[0].length)throw Error("tempFiles is empty.")}},{key:"setType",value:function(t){this.type=at.image}},{key:"setPayload",value:function(t){ct()(b()(n.prototype),"setPayload",this).call(this,t);var e=this,i=t.file.tempFiles[0];this.payload.url=i.path,this.payload.size=i.size,this.payload.width="",this.payload.height="";var r=l.isEmpty(i.name)||null==i.name?i.path:i.name;this.payload.contentType="image/"+ot.fileExtension(r,"."),this.payload.name="uni-image."+ot.fileExtension(r,"."),uni.getImageInfo({src:i.path,success:function(t){e.payload.width=t.width,e.payload.height=t.height}})}}]),n}(wt);function Ct(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var St=function(t){y()(n,t);var e=Ct(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"validate",value:function(t){if(ct()(b()(n.prototype),"validate",this).call(this,t),!(t.file instanceof File))throw Error("wrong file type.");if(0==t.file.size)throw Error("File size is 0.");if(t.file.size>31457280)throw Error("message-length limit 30mib")}},{key:"setPayload",value:function(t){ct()(b()(n.prototype),"setPayload",this).call(this,t),this.payload.contentType=t.file.type,this.payload.name=t.file.name,this.payload.size=t.file.size;var e=(window.URL||window.webkitURL).createObjectURL(t.file);this.payload.url=e}}]),n}(ft);function At(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var Tt=function(t){y()(n,t);var e=At(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"validate",value:function(t){ct()(b()(n.prototype),"validate",this).call(this,t);var e=["gif","jpg","png","jpeg"];if(!e.find((function(e){return e==t.file.type.split("/")[1].toLowerCase()})))throw Error("Only "+e.join(",")+" is supported image.")}},{key:"setType",value:function(t){this.type=at.image}},{key:"setPayload",value:function(t){var e=this;ct()(b()(n.prototype),"setPayload",this).call(this,t);var i=window.URL||window.webkitURL,r=new Image;r.src=i.createObjectURL(t.file),r.onload=function(){e.payload.width=r.width,e.payload.height=r.height,i.revokeObjectURL(r.src)}}}]),n}(St);function Mt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var Dt=function(t){y()(n,t);var e=Mt(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"validate",value:function(t){ct()(b()(n.prototype),"validate",this).call(this,t);var e=["mp3","ogg","wav","wma","ape","acc","mpeg"];if(!e.find((function(e){return e==t.file.type.split("/")[1].toLowerCase()})))throw Error("Only "+e.join(",")+" is supported audio.")}},{key:"setType",value:function(t){this.type=at.audio}},{key:"setPayload",value:function(t){ct()(b()(n.prototype),"setPayload",this).call(this,t);var e=this,i=window.URL||window.webkitURL,r=document.createElement("audio");r.src=i.createObjectURL(t.file),r.onloadedmetadata=function(){e.payload.duration=r.duration,i.revokeObjectURL(r.src)}}}]),n}(St);function Pt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var xt=function(t){y()(n,t);var e=Pt(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"validate",value:function(t){ct()(b()(n.prototype),"validate",this).call(this,t);var e=["avi","mov","rmvb","rm","flv","mp4","3gp","quicktime"];if(!e.find((function(e){return e==t.file.type.split("/")[1].toLowerCase()})))throw Error("Only "+e.join(",")+" is supported video.")}},{key:"setType",value:function(t){this.type=at.video}},{key:"setPayload",value:function(t){this.payload=Object.create(null);var e=Object.create(null),n=Object.create(null);e.contentType=t.file.type,e.size=t.file.size,e.duration=0,e.url=n.url="",e.name=t.file.name,e.width=n.width=0,e.height=n.height=0,n.contentType="image/jpg",this.payload.video=e,this.payload.thumbnail=n;var i=this,r=window.URL||window.webkitURL,o=document.createElement("video"),s=r.createObjectURL(t.file);o.src=s,o.onloadedmetadata=function(){i.payload.video.duration=o.duration,i.payload.video.width=i.payload.thumbnail.width=o.videoWidth,i.payload.video.height=i.payload.thumbnail.height=o.videoHeight,i.payload.video.url=s,i.payload.thumbnail.url=function(t){var e=document.createElement("canvas");return e.width=t.videoWidth,e.height=t.videoHeight,e.getContext("2d").drawImage(t,0,0,e.width,e.height),e.toDataURL("image/png")}(o),r.revokeObjectURL(o.src)}}}]),n}(St),jt=function(){function t(){r()(this,t)}return s()(t,null,[{key:"resolve",value:function(){return E.a.isUni()?"uniApp":E.a.isWx()?"wx":"html"}}]),t}();function Bt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var Gt=function(t){y()(n,t);var e=Bt(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"validate",value:function(t){if(l.isEmpty(t.text)||""==t.text.trim())throw Error("text is empty")}},{key:"setType",value:function(t){this.type=at.text}},{key:"setPayload",value:function(t){ct()(b()(n.prototype),"setPayload",this).call(this,t),this.payload.text=t.text}}]),n}(ut);function Lt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var Ut=function(t){y()(n,t);var e=Lt(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"setType",value:function(t){if(!l.isStringOrNumber(t.type))throw Error("type require a string or number.");if(l.isEmpty(t.type))throw Error("type is empty.");this.type=t.type}},{key:"setPayload",value:function(t){if(l.isEmpty(t.payload))throw Error("payload is empty.");if(!l.isPlainObject(t.payload)&&!l.isStringOrNumber(t.payload))throw Error("payload require object | string | number.");this.payload=t.payload}}]),n}(ut),zt=new(function(){function t(){r()(this,t),this.messageTypes={wx:{image:yt,file:ht,audio:mt,video:bt,text:Gt},uniApp:{image:It,file:wt,audio:Rt,video:Nt,text:Gt},html:{image:Tt,file:St,audio:Dt,video:xt,text:Gt}}}return s()(t,[{key:"create",value:function(t,e){var n=jt.resolve(),i=this.messageTypes[n][t];return i?new i(e):new Ut(e)}}]),t}()),Ft=n(11),Wt=n.n(Ft),Zt={DISCONNECTED:"disconnected",DISCONNECTING:"disconnecting",CONNECTING:"connecting",CONNECTED:"connected",RECONNECTING:"reconnecting",RECONNECTED:"reconnected",EXPIRED_RECONNECTED:"reconnected",CONNECT_FAILED:"connect_failed"},Yt=function(){function t(e){r()(this,t),this.socket=null,this.socket=e}return s()(t,[{key:"emit",value:function(t){this.socket.status!==Zt.CONNECT_FAILED&&this.socket.status!==Zt.DISCONNECTED?(t.start(),this.doEmit(t)):t.fail({resultCode:"409",content:"Please connect first"})}},{key:"doEmit",value:function(t){var e=this;if(t.isTimeout())t.fail({resultCode:408,content:"Host unreachable or timeout"});else if(this.socket.status!==Zt.CONNECT_FAILED)if(this.authenticated())if(this.hasPermission(t))if(this.socket.status===Zt.CONNECTED||this.socket.status===Zt.RECONNECTED||this.socket.status===Zt.EXPIRED_RECONNECTED){if(!t.complete){var n=setTimeout((function(){e.doEmit(t)}),t.singleTimeout);this.socket.doEmit(t.name,t.params,(function(e){clearTimeout(n),200===e.resultCode||200==e.code?t.success(e):t.fail(e)})),t.retried++}}else setTimeout((function(){e.doEmit(t)}),500);else t.fail({resultCode:401,content:"No permission"});else setTimeout((function(){e.doEmit(t)}),500);else t.fail({resultCode:408,content:"Failed to connect GoEasy."})}},{key:"hasPermission",value:function(t){return!!this.socket.permissions.find((function(e){return e===t.permission}))}},{key:"authenticated",value:function(){return this.socket.status===Zt.CONNECTED||this.socket.status===Zt.RECONNECTING||this.socket.status===Zt.RECONNECTED||this.socket.status===Zt.EXPIRED_RECONNECTED}}]),t}(),Vt=n(31),Jt=n.n(Vt),Qt=function(){function t(){r()(this,t),this.io=Jt.a,this.status=Zt.DISCONNECTED,this.permissions=[A.NONE],this.emitter=null,this.connectedObservers=[],this.disconnectedObservers=[],this.emitter=new Yt(this)}return s()(t,[{key:"connect",value:function(){this.status=Zt.CONNECTING}},{key:"emit",value:function(t){this.emitter.emit(t)}},{key:"doEmit",value:function(t,e,n){}},{key:"on",value:function(t,e){this.io.on(t,e)}},{key:"disconnect",value:function(){this.io.disconnect()}},{key:"getStatus",value:function(){return this.status}},{key:"addConnectedObserver",value:function(t){l.isFunction(t)&&this.connectedObservers.push(t)}},{key:"addDisconnectedObserver",value:function(t){l.isFunction(t)&&this.disconnectedObservers.push(t)}},{key:"notify",value:function(t,e){for(var n=0;n<t.length;n++)t[n](e)}}]),t}();function Ht(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var Xt=function(t){y()(n,t);var e=Ht(n);function n(t){var i;return r()(this,n),(i=e.call(this)).reconnectingObservers=[],i.addReconnectingObserver(t.onReconnecting),i.addDisconnectedObserver(t.onDisconnected),i}return s()(n,[{key:"connect",value:function(t){ct()(b()(n.prototype),"connect",this).call(this),this.io=this.io.connect(t.uri,t.opts),this.initListener()}},{key:"doEmit",value:function(t,e,n){this.io.emit(t,e,n)}},{key:"initListener",value:function(){var t=this;this.io.on("reconnecting",(function(e){t.status=Zt.CONNECTING,t.notify(t.reconnectingObservers,e)})),this.io.on("connect",(function(){t.status=Zt.CONNECTED,t.notify(t.connectedObservers)})),this.io.on("disconnect",(function(){t.status=Zt.DISCONNECTED,t.notify(t.disconnectedObservers)})),this.io.on("connect_error",(function(t){}))}},{key:"addReconnectingObserver",value:function(t){this.reconnectingObservers.push(t)}}]),n}(Qt),qt=function(){function t(e){r()(this,t),this.callback=_,this.guidList=[],this.callback=e}return s()(t,[{key:"onMessage",value:function(t,e){"string"==typeof e&&(e=JSON.parse(e)),this.guidList.findIndex((function(t){return t===e.i}))>-1||(this.guidList.unshift(e.i),this.guidList.length>300&&this.guidList.pop(),this.callback(e))}}]),t}(),Kt=new(function(){function t(){r()(this,t),this.overrided=!1}return s()(t,[{key:"overrideUniShowHideMethods",value:function(){if(E.a.isUni()&&!this.overrided&&getApp()&&void 0!==getApp().$options){this.overrided=!0;var t=getApp().$options;if(void 0!==t.onShow){var e=t.onShow[0];t.onShow[0]=function(){getApp().uniAppRunningBackend=!1,e&&e.call(t)}}if(void 0!==t.onHide){var n=t.onHide[0];t.onHide[0]=function(){getApp().uniAppRunningBackend=!0,n&&n.call(t)}}}}}]),t}());function $t(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var te=function(t){y()(n,t);var e=$t(n);function n(t){var i;return r()(this,n),(i=e.call(this)).ioSocket=null,i.sid=null,i.appKey=null,i.userId=null,i.userData=null,i.otp=null,i.artifactVersion="0.0.0",i.imVersion="0.0.0",i.uri=null,i.ioOpts=null,i.type="",i.reconnectingTimes=0,i.messageObservers={},i.connectFailedObservers=[],i.connectingObservers=[],i.expiredReconnectedObservers=[],i.ioSocket=new Xt({onDisconnected:i.onIoDisconnected.bind(Wt()(i)),onReconnecting:i.onIoReconnecting.bind(Wt()(i))}),i.ioSocket.addConnectedObserver(i.onIoReconnected.bind(Wt()(i))),i.appKey=t.appkey,i.userId=t.userId,i.userData=t.userData||"",i.otp=t.otp||null,i.ioOpts=t.opts,i.uri=t.uri,i.imVersion=t.imVersion,i.artifactVersion=t.artifactVersion,i.type=t.type||"",i.addConnectedObserver(t.onConnected),i.addConnectingObserver(t.onConnecting),i.addConnectFailedObserver(t.onConnectFailed),i.addDisconnectedObserver(t.onDisconnected),i}return s()(n,[{key:"onIoReconnected",value:function(){this.status===Zt.RECONNECTING&&this.authorize()}},{key:"emit",value:function(t){ct()(b()(n.prototype),"emit",this).call(this,t)}},{key:"doEmit",value:function(t,e,n){e.sid=this.sid,this.ioSocket.doEmit(t,e,n)}},{key:"sendAck",value:function(t,e){this.ioSocket.io.emit(t,e)}},{key:"connect",value:function(t){ct()(b()(n.prototype),"connect",this).call(this),this.onConnecting(this.reconnectingTimes),this.ioSocket.connect({uri:this.uri,opts:this.ioOpts}),this.authorize()}},{key:"disconnect",value:function(){this.status=Zt.DISCONNECTING,this.ioSocket.disconnect()}},{key:"authorize",value:function(){var t={appkey:this.appKey,userId:this.userId,userData:this.userData,otp:this.otp,artifactVersion:this.artifactVersion,type:this.type,sid:this.sid,imVersion:this.imVersion},e=new T({name:U,params:t,permission:A.NONE,singleTimeout:P,totalTimeout:x,success:this.onAuthorizeSuccess.bind(this),fail:this.onAuthorizeFailed.bind(this)});this.ioSocket.emit(e)}},{key:"onConnecting",value:function(){this.notify(this.connectingObservers,this.reconnectingTimes)}},{key:"onIoReconnecting",value:function(){Kt.overrideUniShowHideMethods(),this.reconnectingTimes++,this.status==Zt.CONNECTED||this.status==Zt.EXPIRED_RECONNECTED||this.status==Zt.RECONNECTING?this.status=Zt.RECONNECTING:this.status=Zt.CONNECTING,this.onConnecting()}},{key:"onIoDisconnected",value:function(){this.status==Zt.DISCONNECTING&&(this.status=Zt.DISCONNECTED,this.notify(this.disconnectedObservers))}},{key:"onAuthorizeSuccess",value:function(t){this.status===Zt.RECONNECTING?this.sid!==t.sid?(this.status=Zt.EXPIRED_RECONNECTED,this.notify(this.expiredReconnectedObservers)):this.status=Zt.RECONNECTED:(this.status=Zt.CONNECTED,this.sid=t.sid),t.enablePublish&&(this.permissions.find((function(t){return t==A.WRITE}))||this.permissions.push(A.WRITE)),t.enableSubscribe&&(this.permissions.find((function(t){return t==A.READ}))||this.permissions.push(A.READ)),this.reconnectingTimes=0,this.notify(this.connectedObservers)}},{key:"onAuthorizeFailed",value:function(t){this.ioSocket.disconnect(),this.status=Zt.CONNECT_FAILED;var e={code:t.resultCode||408,content:t.content||"Host unreachable or timeout"};this.notify(this.connectFailedObservers,e)}},{key:"addConnectingObserver",value:function(t){l.isFunction(t)&&this.connectingObservers.push(t)}},{key:"addConnectFailedObserver",value:function(t){l.isFunction(t)&&this.connectFailedObservers.push(t)}},{key:"addExpiredReconnectedObserver",value:function(t){l.isFunction(t)&&this.expiredReconnectedObservers.push(t)}},{key:"addMessageObserver",value:function(t,e){var n=this;this.ioSocket.io.on(t,(function(e){n.notifyMessageObservers(t,e)})),this.messageObservers[t]||(this.messageObservers[t]=[]),this.messageObservers[t].push(new qt(e))}},{key:"notifyMessageObservers",value:function(t,e){for(var n=this.messageObservers[t],i=0;i<n.length;i++)n[i].onMessage(t,e)}}]),n}(Qt),ee=function(){function t(e){r()(this,t),this.im=null,this.im=e}return s()(t,[{key:"connect",value:function(){var t=this;return new Promise((function(e,n){t.im._goEasySocket.addConnectedObserver((function(){t.im._event.notify(c.CONNECTED),e()})),t.im._goEasySocket.addConnectFailedObserver((function(t){n({code:t.resultCode||408,content:t.content||"Failed to connect GoEasy"})})),t.im._goEasySocket.addConnectingObserver((function(e){t.im._event.notify(c.CONNECTING,e)})),t.im._goEasySocket.addDisconnectedObserver((function(){t.im._event.notify(c.DISCONNECT),n({code:400,content:"GoEasy disconnected."})})),t.im._goEasySocket.connect()}))}},{key:"disconnect",value:function(){var t=this;return new Promise((function(e,n){try{t.im._goEasySocket.disconnect(),e()}catch(t){n({code:t.resultCode||408,content:t.content||"disconnect failed"})}}))}}]),t}(),ne=(new ee,function(){function t(e){r()(this,t),this.mt=null,this.to=null,this.p=null,this.t=null,this.guid=null,this.validate(e.to,e.message),this.mt=e.message.type,this.to=e.to,this.t=e.conversationType,this.guid=e.message.messageId,this.p=e.message.payload}return s()(t,[{key:"validate",value:function(t,e){if(!(e instanceof ut))throw Error("createMessage first.");if(l.isEmpty(t))throw Error("userId is empty.");if(!l.isStringOrNumber(t))throw Error("userId should be a string or number.");if(Ke.userId==t)throw Error("userId can not be the same as your id.");if(e.type==at.text){if(!(e instanceof Gt))throw Error("it is not textMessage");if((l.isObject(e.payload)?JSON.stringify(e.payload).length:e.payload.length)>3072)throw Error("message-length limit 3kb")}}}]),t}()),ie=function(){function t(){r()(this,t)}return s()(t,[{key:"build",value:function(){throw Error("Not implementation yet.")}}]),t}();function re(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var oe=new(function(t){y()(n,t);var e=re(n);function n(){return r()(this,n),e.call(this)}return s()(n,[{key:"build",value:function(t){return new Promise((function(e,n){try{e(t.payload)}catch(t){n(t)}}))}}]),n}(ie)),se=function t(e){r()(this,t)},ce=n(9),ae=n.n(ce),ue=function(){function t(){r()(this,t)}return s()(t,[{key:"upload",value:function(t){throw Error("Not implementation yet.")}}]),t}();function le(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function fe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?le(Object(n),!0).forEach((function(e){ae()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function pe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var he=new(function(t){y()(n,t);var e=pe(n);function n(){return r()(this,n),e.call(this)}return s()(n,[{key:"upload",value:function(t,e){var n=this;try{return new Promise((function(i,r){uni.uploadFile({url:t.host,filePath:n.getTempFilePath(t),name:"file",formData:t.parameters,success:function(e){200===e.statusCode?i({code:200,content:fe(fe({},t.payload),{},{message:e.errMsg})}):r({code:e.statusCode,content:e.errMsg})},fail:function(t){r({code:500,content:t.errMsg})}}).onProgressUpdate((function(t){e&&e(t)}))}))}catch(t){return new Promise((function(e,n){n({code:500,content:t})}))}}},{key:"getTempFilePath",value:function(t){var e=t.file||t.fileRes;return Array.isArray(e.tempFiles)?e.tempFiles[0].path:e.tempFilePath}}]),n}(ue));function de(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function ye(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?de(Object(n),!0).forEach((function(e){ae()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):de(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ve(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var me=new(function(t){y()(n,t);var e=ve(n);function n(){return r()(this,n),e.apply(this,arguments)}return s()(n,[{key:"upload",value:function(t,e){var n=this;try{return new Promise((function(i,r){wx.uploadFile({url:t.host,filePath:n.getTempFilePath(t),name:"file",formData:t.parameters,success:function(e){200===e.statusCode?i({code:200,content:ye(ye({},t.payload),{},{message:e.errMsg})}):r({code:e.statusCode,content:e.errMsg})},fail:function(t){r({code:500,content:t.errMsg})}}).onProgressUpdate((function(t){e&&e(t)}))}))}catch(t){return new Promise((function(e,n){n({code:500,content:t})}))}}},{key:"getTempFilePath",value:function(t){var e=t.file||t.fileRes;return Array.isArray(e.tempFiles)?e.tempFiles[0].path:e.tempFilePath}}]),n}(ue));function ge(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function be(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ge(Object(n),!0).forEach((function(e){ae()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ge(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var we=new(function(t){y()(n,t);var e=ke(n);function n(){return r()(this,n),e.call(this)}return s()(n,[{key:"upload",value:function(t,e){try{return new Promise((function(n,i){var r=new XMLHttpRequest;for(var o in r.open("post",t.host,!0),t.headers)r.setRequestHeader(o,t.headers[o]);r.upload.onprogress=function(t){e&&e(t)},r.upload.onloadstart=function(t){e&&e(t)},r.upload.onloadend=function(t){e&&e(t)};var s=new FormData;for(var c in t.parameters)"fileRes"==c?s.append("file",t.parameters[c]):s.append(c,t.parameters[c]);r.send(s),r.onreadystatechange=function(){4==r.readyState&&(r.status>=200&&r.status<300||304==r.status?n({code:r.status,content:be(be({},t.payload),{},{message:r.responseText})}):i({code:r.status,content:r.responseText}))}}))}catch(t){return new Promise((function(e,n){n({code:500,content:t})}))}}}]),n}(ue)),Ee=new(function(){function t(){r()(this,t),this.uploader={uniApp:he,wx:me,html:we}}return s()(t,[{key:"upload",value:function(t,e){var n=jt.resolve();return this.uploader[n].upload(t,e)}}]),t}()),Re="ALI",_e=function t(e,n,i,o,s){r()(this,t),this.host="",this.headers={},this.parameters={},this.file={},this.payload={},this.host=e,this.headers=n,this.parameters=i,this.file=o,this.payload=s},Ne=function(){function t(){r()(this,t)}return s()(t,[{key:"build",value:function(t,e){}},{key:"newFileName",value:function(t){return t&&t.newFilename||""}}]),t}();function Oe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var Ie=new(function(t){y()(n,t);var e=Oe(n);function n(){return r()(this,n),e.call(this)}return s()(n,[{key:"url",value:function(t){return t.host+"/"+t.dir+"/"+this.newFileName(t)}},{key:"build",value:function(t,e){var n={key:t.dir+"/"+this.newFileName(t),OSSAccessKeyId:t.accessKeyId,policy:t.policy,signature:t.signature,success_action_status:"200",fileRes:e},i={newFileName:this.newFileName(t),url:this.url(t)};return new _e(t.host,null,n,e,i)}}]),n}(Ne));function Ce(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var Se=new(function(t){y()(n,t);var e=Ce(n);function n(){return r()(this,n),e.call(this)}return s()(n,[{key:"url",value:function(t){return t.downloadUrl}},{key:"build",value:function(t,e){var n={key:this.newFileName(t),token:t.token,file:e},i={newFileName:this.newFileName(t),url:this.url(t)};return new _e(t.host,null,n,e,i)}}]),n}(Ne)),Ae=function t(e){return r()(this,t),e==Re?Ie:Se},Te=function(){function t(e){r()(this,t),this.im=null,this.im=e}return s()(t,[{key:"resolve",value:function(t){var e=this;return new Promise((function(n,i){var r=new T({name:"uploadToken",params:{filename:t},permission:A.WRITE,singleTimeout:G,totalTimeout:L,fail:function(t){i(t)},success:function(t){200==t.code?n(t):i(t)}});e.im._goEasySocket.emit(r)}))}}]),t}(),Me=function(){function t(e){r()(this,t),this.uploadTokenResolver=null,this.uploadTokenResolver=new Te(e)}return s()(t,[{key:"build",value:function(t,e){var n=this;return new Promise((function(i,r){n.uploadTokenResolver.resolve(e).then((function(e){var n=e.content;i(new Ae(n.vendor).build(n,t))})).catch((function(t){r(t)}))}))}}]),t}(),De=function(){function t(e){r()(this,t),this.requestBuilder=null,this.fileUploader=Ee,this.requestBuilder=new Me(e)}return s()(t,[{key:"upload",value:function(t,e,n){var i=this;return new Promise((function(r,o){i.requestBuilder.build(t,e).then((function(t){r(i.doUpload(t,n))})).catch((function(t){o(t)}))}))}},{key:"customizeUpload",value:function(t,e){this.doUpload(t,e)}},{key:"doUpload",value:function(t,e){return this.fileUploader.upload(t,e)}}]),t}();function Pe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var xe=function(t){y()(n,t);var e=Pe(n);function n(t){var i;return r()(this,n),(i=e.call(this)).im=null,i.goEasyUploader=new De(t),i}return s()(n,[{key:"build",value:function(t){var e=this;return new Promise((function(n,i){var r=new se;e.upload(t).then((function(e){var i=e.content,o=void 0===i?{}:i;(r=t.payload).url=o.url,r.name=o.newFileName,n(r)})).catch((function(t){i(t)}))}))}},{key:"upload",value:function(t){var e=t.type==at.video?t.payload.video.name:t.payload.name;return this.goEasyUploader.upload(t.file,e,t.onProgress)}}]),n}(ie);function je(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=b()(t);if(e){var r=b()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m()(this,n)}}var Be=function(t){y()(n,t);var e=je(n);function n(t){return r()(this,n),e.call(this,t)}return s()(n,[{key:"build",value:function(t){var e=this;return new Promise((function(n,i){var r=new se;e.upload(t).then((function(e){e.content,r=t.payload;var i="?x-oss-process=video/snapshot,t_0000,f_jpg,w_"+t.payload.video.width+",m_fast,ar_auto";r.video.url=e.content.url,r.thumbnail.url=e.content.url+i,r.video.name=e.content.newFileName,n(r)})).catch((function(t){i(t)}))}))}}]),n}(xe),Ge=function t(e,n){return r()(this,t),e==at.video?new Be(n):e==at.audio||e==at.image||e==at.file?new xe(n):oe},Le=function(){function t(e){r()(this,t),this.im=null,this.im=e}return s()(t,[{key:"build",value:function(t,e,n){var i=this;return new Promise((function(r,o){var s=new ne({to:t,message:e,conversationType:n}),c=e.type;new Ge(c,i.im).build(e).then((function(t){s.p=JSON.stringify(t),r(s)})).catch((function(t){o(t)}))}))}}]),t}(),Ue=function(){function t(e){r()(this,t),this.im=null,this.bulletMessageBuilder=null,this.im=e,this.bulletMessageBuilder=new Le(e)}return s()(t,[{key:"send",value:function(t,e,n){var i=this;return new Promise((function(r,o){e.status===I.new?(e.status=I.sending,i.bulletMessageBuilder.build(t,e,n).then((function(t){var n=new T({name:J,params:t,permission:A.WRITE,singleTimeout:G,totalTimeout:L,fail:function(t){e.status=I.fail,o({code:t.resultCode||408,content:t.content||"Failed to send private message."})},success:function(t){e.status=I.success,200==t.resultCode?r({code:200,content:t.content}):o(t)}});i.im._goEasySocket.emit(n)})).catch((function(t){o({code:t.code||400,content:t.content||t})}))):o({code:400,content:"Please create a new message, a message can only be sent once"})}))}},{key:"sendMessage",value:function(t){var e=this,n=this.im;return new Promise((function(i,r){if(t instanceof ut)if(t.status===I.new){t.status=I.sending;var o=t.to;delete t.to,o?!o.type||o.type!=O.GROUP&&o.type!=O.PRIVATE?r({code:400,content:"message require property to.type"}):o.id?o.data&&l.isFunction(o.data)?r({code:400,content:"to.data can not be function"}):(o.data||(o.data={}),n._conversations.updateByOutMessage(t,o.type,o.id,o.data),e.bulletMessageBuilder.build(o.id,t,o.type).then((function(e){e.d=JSON.stringify(o.data);var s=new T({name:J,params:e,permission:A.WRITE,singleTimeout:G,totalTimeout:L,fail:function(e){t.status=I.fail,r({code:e.resultCode||408,content:e.content||"Failed to send private message."})},success:function(e){t.status=I.success,t.timestamp=e.content.timestamp,i(t),n._conversations.updateByOutMessage(t,o.type,o.id,o.data)}});n._goEasySocket.emit(s)})).catch((function(t){r({code:t.code||400,content:t.content||t})}))):r({code:400,content:"message require property to.id"}):r({code:400,content:"message require property to."})}else r({code:400,content:"Please create a new message, a message can only be sent once"});else r({code:400,content:"it is invalid message"})}))}}]),t}(),ze=function(){function t(e){r()(this,t),this.im=null,this.im=e}return s()(t,[{key:"history",value:function(t){var e=this;return new Promise((function(n,i){e.transformOptions(t);var r=new T({name:Q,params:t,permission:A.READ,singleTimeout:j,totalTimeout:B,fail:function(t){i({code:t.code||408,content:t.content||"Failed to query message"})},success:function(r){if(200==r.code){var o=e.transformHistories(r,t);n({code:200,content:o})}else i(r)}});e.im._goEasySocket.emit(r)}))}},{key:"transformOptions",value:function(t){if(!l.isObject(t)||!l.isDef(t.friendId)&&!l.isDef(t.groupId))throw Error("friendId or groupId is not define.");if(l.isDef(t.friendId)&&l.isDef(t.groupId))throw Error("only contain friendId or groupId.");if(l.isDef(t.limit)||(t.limit=10),t.limit>30&&(t.limit=30),l.isDef(t.friendId)){if(!l.isStringOrNumber(t.friendId))throw Error("TypeError: friendId require string or number.");l.isNumber(t.friendId)&&(t.friendId=t.friendId.toString())}else{if(!l.isStringOrNumber(t.groupId))throw Error("TypeError: groupId require string or number.");l.isNumber(t.groupId)&&(t.groupId=t.groupId.toString())}return t}},{key:"transformHistories",value:function(t,e){var n=[];return t&&t.content&&t.content.map((function(t){var i=Object.create(null);i.timestamp=t.ts,i.senderId=t.s,i.type=t.mt,i.payload="string"==typeof t.p?JSON.parse(t.p):t.p,e.groupId&&t.d&&(i.senderData=JSON.parse(t.d)),n.push(i)})),n}}]),t}(),Fe=function(){function t(e){r()(this,t),this.im=null,this.im=e,e._iMReceiver.addIMMessageObserver(this.newNewMessageReceived.bind(this))}return s()(t,[{key:"newNewMessageReceived",value:function(t){if(t.t===O.GROUP){var e=C.assemble(t);this.im._event.notify(c.GROUP_MESSAGE_RECEIVED,e)}}},{key:"subscribe",value:function(t){var e=this;return new Promise((function(n,i){if(Array.isArray(t)&&0!=t.length){for(var r=0;r<t.length;r++){if(!l.isStringOrNumber(t[r]))return void i({code:400,content:"TypeError: groups item require string or number."});l.isNumber(t[r])&&(t[r]=t[r].toString())}var o=new T({name:nt,params:{groupIds:t},permission:A.WRITE,singleTimeout:G,totalTimeout:L,success:function(){n({code:200,content:"ok"})},fail:function(t){i({code:t.resultCode||408,content:t.content||"Failed to subscribe group message"})}});e.im._goEasySocket.emit(o)}else i({code:400,content:"TypeError: groups require array."})}))}},{key:"unsubscribe",value:function(t){var e=this;return new Promise((function(n,i){if(l.isStringOrNumber(t)){t=t.toString();var r=new T({name:it,params:{groupId:t},permission:A.READ,singleTimeout:G,totalTimeout:L,success:function(){n({code:200,content:"ok"})},fail:function(t){i({code:t.resultCode||408,content:t.content||"Failed to unsubscribe group message"})}});e.im._goEasySocket.emit(r)}else i({code:400,content:"TypeError: channel require string or number."})}))}}]),t}(),We=function(){function t(e){r()(this,t),this.im=null,this.im=e,e._iMReceiver.addIMMessageObserver(this.onNewMessageReceived.bind(this))}return s()(t,[{key:"onNewMessageReceived",value:function(t){if(t.t===O.PRIVATE){var e=C.assemble(t);this.im._event.notify(c.PRIVATE_MESSAGE_RECEIVED,e)}}}]),t}(),Ze=function(){function t(e){r()(this,t),this.im=null,this.im=e}return s()(t,[{key:"get",value:function(t){var e=this;return new Promise((function(n,i){if(l.isStringOrNumber(t)){l.isNumber(t)&&(t=t.toString());var r=new T({name:Z,params:{groupId:t},permission:A.READ,singleTimeout:j,totalTimeout:B,fail:function(t){i(t||{code:408,content:"Failed to query online group users"})},success:function(t){200==t.code?n(t):i(t)}});e.im._goEasySocket.emit(r)}else i({code:400,content:"TypeError: groupId require string or number."})}))}}]),t}(),Ye={message:"message",imMessage:"imMessage",userPresence:"userPresence",groupPresence:"groupPresence"},Ve=function(){function t(e){r()(this,t),this.im=null,this.im=e,e._goEasySocket.addMessageObserver(Ye.groupPresence,this.newMessageReceived.bind(this))}return s()(t,[{key:"presence",value:function(t){var e=this;return new Promise((function(n,i){if(Array.isArray(t)&&0!=t.length){for(var r=0;r<t.length;r++){if(!l.isStringOrNumber(t[r]))return void i({code:400,content:"TypeError: groupIds item require string or number."});if(l.isNumber(t[r])&&(t[r]=t[r].toString()),0==t[r].length)return void i({code:400,content:"TypeError: groupIds has empty item."})}var o={groupIds:t};e.emitRocket(q,o,(function(){n({code:200,content:"ok"})}),(function(t){i({code:t.code||408,content:t.content||"Failed to subscribe group message"})}))}else i({code:400,content:"TypeError: groupIds require array."})}))}},{key:"unPresence",value:function(t){var e=this;return new Promise((function(n,i){if(l.isStringOrNumber(t)){l.isNumber(t)&&(t=t.toString());var r={groupId:t};e.emitRocket(K,r,(function(){n({code:200,content:"ok"})}),(function(t){i({code:t.code||408,content:t.content||"Failed to unsubscribe presence"})}))}else i({code:400,content:"TypeError: groupId require string or number."})}))}},{key:"emitRocket",value:function(t,e,n,i){var r=new T({name:t,params:e,singleTimeout:G,totalTimeout:L,permission:A.WRITE,success:n,fail:i});this.im._goEasySocket.emit(r)}},{key:"newMessageReceived",value:function(t){var e=this,n=null;t.c&&(n=JSON.parse(t.c)),n&&n.events&&n.events.map((function(t){t.groupOnlineCount=n.userAmount,t.groupId=n.channel,"string"==typeof t.userData&&(t.userData=JSON.parse(t.userData)),e.im._event.notify(c.GROUP_PRESENCE,t)}))}}]),t}(),Je=function(){function t(e){r()(this,t),this.im=null,this.im=e,this.im._goEasySocket.addMessageObserver(Ye.userPresence,this.newMessageReceived.bind(this))}return s()(t,[{key:"presence",value:function(t){var e=this;return new Promise((function(n,i){if(Array.isArray(t)&&0!=t.length){for(var r=0;r<t.length;r++){if(!l.isStringOrNumber(t[r]))return void i({code:400,content:"TypeError: userIds item require string or number."});if(l.isNumber(t[r])&&(t[r]=t[r].toString()),0==t[r].length)return void i({code:400,content:"TypeError: userIds has empty item."})}var o={userIds:t};e.emitRocket(H,o,(function(){n({code:200,content:"ok"})}),(function(t){i({code:t.code||408,content:t.content||"Failed to subscribe group message"})}))}else i({code:400,content:"TypeError: userIds require array."})}))}},{key:"unPresence",value:function(t){var e=this;return new Promise((function(n,i){if(l.isStringOrNumber(t)){l.isNumber(t)&&(t=t.toString());var r={userId:t};e.emitRocket(X,r,(function(){n({code:200,content:"ok"})}),(function(t){i({code:t.code||408,content:t.content||"Failed to unsubscribe presence"})}))}else i({code:400,content:"TypeError: id require string or number."})}))}},{key:"emitRocket",value:function(t,e,n,i){var r=new T({name:t,params:e,singleTimeout:G,totalTimeout:L,permission:A.WRITE,success:n,fail:i});this.im._goEasySocket.emit(r)}},{key:"newMessageReceived",value:function(t){var e=this,n=[];t.c&&(n=JSON.parse(t.c).events||[]),n.map((function(t){"string"==typeof t.userData&&(t.userData=JSON.parse(t.userData)),e.im._event.notify(c.USER_PRESENCE,t)}))}}]),t}(),Qe=function(){function t(e){r()(this,t),this.im=null,this.im=e}return s()(t,[{key:"hereNow",value:function(t){var e=this;return new Promise((function(n,i){if(t.userIds&&Array.isArray(t.userIds)&&0!=t.userIds.length){for(var r=0;r<t.userIds.length;r++){if(!l.isStringOrNumber(t.userIds[r]))return void i({code:400,content:"TypeError: userIds item require string or number."});if(l.isNumber(t.userIds[r])&&(t.userIds[r]=t.userIds[r].toString()),0==t.userIds[r].length)return void i({code:400,content:"TypeError: userIds has empty item."})}var o=new T({name:Y,params:t,permission:A.READ,singleTimeout:j,totalTimeout:B,fail:function(t){i({code:t.resultCode||408,content:t.content||"Failed to query online users"})},success:function(t){200==t.code?n(t):i(t)}});e.im._goEasySocket.emit(o)}else i({code:400,content:"TypeError: userIds require array."})}))}}]),t}(),He=function(){function t(e){r()(this,t),this.im=null,this.im=e}return s()(t,[{key:"hereNow",value:function(t){var e=this;return new Promise((function(n,i){if(l.isStringOrNumber(t)){l.isNumber(t)&&(t=t.toString());var r=new T({name:V,params:{groupId:t},permission:A.READ,singleTimeout:j,totalTimeout:B,fail:function(t){i({code:t.resultCode||408,content:t.content||"Failed to query online group users"})},success:function(t){200==t.code?n(t):i(t)}});e.im._goEasySocket.emit(r)}else i({code:400,content:"TypeError: groupId require string or number."})}))}}]),t}(),Xe=function(){function t(e){r()(this,t),this.im=null,this.observers=[],this.im=e,e._goEasySocket.addMessageObserver(Ye.imMessage,this.newNewMessageReceived.bind(this))}return s()(t,[{key:"newNewMessageReceived",value:function(t){this.sendAck(t),this.notify(t)}},{key:"addIMMessageObserver",value:function(t){this.observers.push(t)}},{key:"sendAck",value:function(t){this.im._goEasySocket.sendAck("imAck",{publishGuid:t.i})}},{key:"notify",value:function(t){for(var e=0;e<this.observers.length;e++)this.observers[e](t)}}]),t}(),qe=function(){function t(e,n){r()(this,t),this.im=null,this.userData={},this.groupData={},this.im=e,this.putUserData(n.id,n.data)}return s()(t,[{key:"putData",value:function(t,e,n){n||(n={}),t==O.PRIVATE?this.userData[e]=n:this.groupData[e]=n}},{key:"putUserData",value:function(t,e){this.userData[t]=e}},{key:"putGroupData",value:function(t,e){this.groupData[t]=e}},{key:"loadData",value:function(t,e){var n=this;return new Promise((function(i,r){var o;if((o=O.PRIVATE===e?n.userData:n.groupData)[t]&&0!=Object.keys(o[t]).length)i(o[t]);else{var s=new T({name:et,params:{targetId:t,type:e},permission:A.READ,singleTimeout:j,totalTimeout:B,success:function(e){e.content||(e.content=JSON.stringify({})),o[t]=JSON.parse(e.content),i(o[t])},fail:function(t){r(t)}});n.im._goEasySocket.emit(s)}}))}}]),t}(),Ke=function(){function t(e){r()(this,t),this._appKey=void 0,this._host=void 0,this._supportOldBrowser=!1,this._event=N,this._goEasyUploader=null,this._connection=null,this._goEasySocket=null,this._dataCache=null,this._messageSender=null,this._history=null,this._conversations=null,this._iMReceiver=null,this._groupMessageReceive=null,this._groupPresenceSubscriber=null,this._groupOnlineCount=null,this._groupHereNow=null,this._privateMessageReceive=null,this._userPresenceSubscriber=null,this._userHereNow=null,this._appKey=e.appkey,this._host=e.host,this._supportOldBrowser=e.supportOldBrowser}return s()(t,[{key:"on",value:function(t,e){this._event.on(t,e)}},{key:"initialBeforeConnect",value:function(e){var n=this.setUriAndOpts(e.forceTLS);t.userId=e.id,t.userData=e.data,this._goEasySocket=new te({appkey:this._appKey,host:this._host,userId:e.id,userData:JSON.stringify(e.data),otp:e.otp,artifactVersion:"1.2.2",imVersion:t.version,type:"im",opts:n.opts,uri:n.uri}),this._dataCache=new qe(this,e),this._connection=new ee(this),this._messageSender=new Ue(this),this._history=new ze(this),this._goEasyUploader=new De(this),this._userHereNow=new Qe(this),this._groupHereNow=new He(this),this._groupOnlineCount=new Ze(this)}},{key:"initialAfterConnect",value:function(){this._iMReceiver=new Xe(this),this._conversations=new rt(this),this._groupPresenceSubscriber=new Ve(this),this._groupMessageReceive=new Fe(this),this._userPresenceSubscriber=new Je(this),this._privateMessageReceive=new We(this)}},{key:"connect",value:function(t){if(this.getStatus()!==Zt.DISCONNECTED)return Promise.reject({code:408,content:"IM is connected, don't try again until im.disconnect() is called. "});if(!l.isObject(t))return Promise.reject({code:400,content:"TypeError: user require an object."});if(l.isEmpty(t.id)||!l.isStringOrNumber(t.id))return Promise.reject({code:400,content:"TypeError: id require number or string."});if(l.isNumber(t.id)&&(t.id=t.id.toString()),t.data=l.isDef(t.data)?t.data:{},(l.isObject(t.data)?JSON.stringify(t.data).length:t.data.length)>300)return Promise.reject({code:400,content:"user.data-length limit 300 byte."});this.initialBeforeConnect(t);var e=this._connection.connect(t);return this.initialAfterConnect(),e}},{key:"disconnect",value:function(){return this._connection.disconnect()}},{key:"getStatus",value:function(){return this._goEasySocket?this._goEasySocket.getStatus():Zt.DISCONNECTED}},{key:"createTextMessage",value:function(t){return zt.create(at.text,t)}},{key:"createImageMessage",value:function(t){return zt.create(at.image,t)}},{key:"createFileMessage",value:function(t){return zt.create(at.file,t)}},{key:"createAudioMessage",value:function(t){return zt.create(at.audio,t)}},{key:"createVideoMessage",value:function(t){return zt.create(at.video,t)}},{key:"createCustomMessage",value:function(t){return zt.create(t.type,t)}},{key:"latestConversations",value:function(){return this._conversations?this._conversations.latestConversations():Promise.reject({code:500,content:"Please connect GoEasyIM first."})}},{key:"groupMarkAsRead",value:function(t,e){return this._conversations.groupMarkAsRead(t,e)}},{key:"privateMarkAsRead",value:function(t,e){return this._conversations.privateMarkAsRead(t,e)}},{key:"removePrivateConversation",value:function(t){return this._conversations.removeConversation(t,O.PRIVATE)}},{key:"removeGroupConversation",value:function(t){return this._conversations.removeConversation(t,O.GROUP)}},{key:"topPrivateConversation",value:function(t,e){return this._conversations.topConversation(t,e,O.PRIVATE)}},{key:"topGroupConversation",value:function(t,e){return this._conversations.topConversation(t,e,O.GROUP)}},{key:"history",value:function(t){return this._history.history(t)}},{key:"upload",value:function(t,e,n){return this._goEasyUploader.upload(t,e,n)}},{key:"sendSystemMessage",value:function(t,e){return this._messageSender.send(t,e,O.SYSTEM)}},{key:"sendMessage",value:function(t){return this._messageSender.sendMessage(t)}},{key:"sendPrivateMessage",value:function(t,e){return this._messageSender.send(t,e,O.PRIVATE)}},{key:"subscribeUserPresence",value:function(t){return this._userPresenceSubscriber.presence(t)}},{key:"unsubscribeUserPresence",value:function(t){return this._userPresenceSubscriber.unPresence(t)}},{key:"hereNow",value:function(t){return this._userHereNow.hereNow(t,O.PRIVATE)}},{key:"sendGroupMessage",value:function(t,e){return this._messageSender.send(t,e,O.GROUP)}},{key:"subscribeGroup",value:function(t){return this._groupMessageReceive.subscribe(t)}},{key:"unsubscribeGroup",value:function(t){return this._groupMessageReceive.unsubscribe(t)}},{key:"subscribeGroupPresence",value:function(t){return this._groupPresenceSubscriber.presence(t)}},{key:"unsubscribeGroupPresence",value:function(t){return this._groupPresenceSubscriber.unPresence(t)}},{key:"groupHereNow",value:function(t){return this._groupHereNow.hereNow(t)}},{key:"groupOnlineCount",value:function(t){return this._groupOnlineCount.get(t)}},{key:"setUriAndOpts",value:function(t){var e,n,i="://"+R.GoEasyDomainNumber.refreshNumber()+this._host;return E.a.isBrowserClient()?(e=!1===t?"http"+i+":80":"https"+i+":443",n={transports:!0===this._supportOldBrowser?["polling","websocket"]:["websocket"],timeout:M}):(e="https://wx-"+this._host+":443",n={transports:["websocket"],reconnectionDelayMax:D}),{uri:e,opts:n}}}]),t}();Ke.version=null,Ke.userId=void 0,Ke.userData=null;var $e=null,tn=function(){function t(){if(r()(this,t),!(this instanceof t&&$e&&$e._appKey&&$e._host))throw Error("please call getInstance to structure instance.")}return s()(t,[{key:"on",value:function(t,e){$e.on(t,e)}},{key:"connect",value:function(t){return $e.connect(t)}},{key:"disconnect",value:function(){return $e.disconnect()}},{key:"getStatus",value:function(){return $e.getStatus()}},{key:"createTextMessage",value:function(t){return $e.createTextMessage(t)}},{key:"createImageMessage",value:function(t){return $e.createImageMessage(t)}},{key:"createFileMessage",value:function(t){return $e.createFileMessage(t)}},{key:"createAudioMessage",value:function(t){return $e.createAudioMessage(t)}},{key:"createVideoMessage",value:function(t){return $e.createVideoMessage(t)}},{key:"createCustomMessage",value:function(t){return $e.createCustomMessage(t)}},{key:"latestConversations",value:function(){return $e.latestConversations()}},{key:"removePrivateConversation",value:function(t){return $e.removePrivateConversation(t)}},{key:"removeGroupConversation",value:function(t){return $e.removeGroupConversation(t)}},{key:"history",value:function(t){return $e.history(t)}},{key:"upload",value:function(t,e,n){return $e.upload(t,e,n)}},{key:"sendMessage",value:function(t){return $e.sendMessage(t)}},{key:"markGroupMessageAsRead",value:function(t,e){return $e.groupMarkAsRead(t,e)}},{key:"markPrivateMessageAsRead",value:function(t,e){return $e.privateMarkAsRead(t,e)}},{key:"topPrivateConversation",value:function(t,e){return $e.topPrivateConversation(t,e)}},{key:"topGroupConversation",value:function(t,e){return $e.topGroupConversation(t,e)}},{key:"subscribeUserPresence",value:function(t){return $e.subscribeUserPresence(t)}},{key:"unsubscribeUserPresence",value:function(t){return $e.unsubscribeUserPresence(t)}},{key:"hereNow",value:function(t){return $e.hereNow(t)}},{key:"subscribeGroup",value:function(t){return $e.subscribeGroup(t)}},{key:"unsubscribeGroup",value:function(t){return $e.unsubscribeGroup(t)}},{key:"subscribeGroupPresence",value:function(t){return $e.subscribeGroupPresence(t)}},{key:"unsubscribeGroupPresence",value:function(t){return $e.unsubscribeGroupPresence(t)}},{key:"groupHereNow",value:function(t){return $e.groupHereNow(t)}},{key:"groupOnlineCount",value:function(t){return $e.groupOnlineCount(t)}}],[{key:"getInstance",value:function(e){var n="";if(!l.isObject(e))throw n="options is require an object.",Error(n);if(!l.isPrimitive(e.appkey)||0==e.appkey.length)throw n="Invalid options: 'appkey' is empty.",Error(n);if(!l.isPrimitive(e.appkey)||0==e.appkey.length)throw n="Invalid options:'host' is empty.",Error(n);return null==t.goEasyIM&&(Ke.version=t.version,$e=new Ke(e),this.goEasyIM=new t),this.goEasyIM}}]),t}();tn.goEasyIM=null,tn.EVENT=Object.create(c),tn.SCENE=Object.create(O);var en=n(32);tn.version=en.version,e.default=tn}]).default}))}).call(this,n("b639").Buffer,n("62e4")(t))},b76e:function(t,e,n){t.exports=n.p+"assets/img/face003.5df92cea.jpg"},ba76:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFwmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgKFdpbmRvd3MpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAxOS0xMC0xNFQxNTo0NTowOCswODowMCIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAxOS0xMC0xNFQxNTo0NTowOCswODowMCIgeG1wOk1vZGlmeURhdGU9IjIwMTktMTAtMTRUMTU6NDU6MDgrMDg6MDAiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ZjJmOTVhZDgtY2I5Mi0zNTQxLWIzNjctMzI0NWYzY2Y5NzU0IiB4bXBNTTpEb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6OWQ2OGZhNjEtYTkxNC0wODQxLWFjOTYtODI1OWU3N2YxNDE1IiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6M2FiNzI2MzAtMDNiOS01MzRhLWFkMWMtZjVjODJkYWM4NDllIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6M2FiNzI2MzAtMDNiOS01MzRhLWFkMWMtZjVjODJkYWM4NDllIiBzdEV2dDp3aGVuPSIyMDE5LTEwLTE0VDE1OjQ1OjA4KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ0MgKFdpbmRvd3MpIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDpmMmY5NWFkOC1jYjkyLTM1NDEtYjM2Ny0zMjQ1ZjNjZjk3NTQiIHN0RXZ0OndoZW49IjIwMTktMTAtMTRUMTU6NDU6MDgrMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAoV2luZG93cykiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+CWzmNAAAAYBJREFUKJGFkkFOwkAUhv83MzQ0JY1xQ5oYjVvDLEg5AAfgDi7dueQQLt2x9A4egDVhgTRhiWhIKAtJHVto4rTjxtaiqP/yzfvm/fPmp0S9opAxprOJol6cJF39riUAiJoIGo4zPD46uieicdFLBbjbpVer9fpaZ9kFDkhwPvOazVvbrg9KcLdLr5ar1Y0xxj0ElVOI1Inn9W27PmDGmM5qvb4uIK31D6CoGWPcz94O20RRr7CntcZoNIJSqoTCMMRkMvm6JMsuNlHUY29x3C3fIQRarRaCIIBSCmEYYrFYQEq55yBOki5NHx5esjw/rh4opTCdTsE5h+/7sCxrD+SMbdihJWy3W3DOkec50jQ9uCgmaiKoFgp7vu9DSlnarkrURMAajjOsbm+5XKLdbsOyLLiuCykl5vP5HthwnCHFr1Hn8en57reP/y7B+ez87PSSEdHYazZviUj9BxGR+uwdMwCw7frgxPP6gvPZX5OK1ACVrAJfIX+L426msz9D/gGwpcvaPMGtcAAAAABJRU5ErkJggg=="},cdf5:function(t,e,n){"use strict";n("f142")},f142:function(t,e,n){}});
  4. //# sourceMappingURL=app.a700b62e.js.map