UNPKG

@xysfe/memento

Version:

``` npm install ```

1 lines 107 kB
import e from"@babel/runtime-corejs3/helpers/classCallCheck";import t from"@babel/runtime-corejs3/helpers/createClass";import r from"@babel/runtime-corejs3/core-js/get-iterator";import n from"@babel/runtime-corejs3/core-js-stable/array/is-array";import o from"@babel/runtime-corejs3/core-js/get-iterator-method";import i from"@babel/runtime-corejs3/core-js-stable/symbol";import a from"@babel/runtime-corejs3/core-js-stable/array/from";import u from"@babel/runtime-corejs3/regenerator";import c from"@babel/runtime-corejs3/helpers/asyncToGenerator";import s from"@babel/runtime-corejs3/core-js-stable/instance/values";import f from"@babel/runtime-corejs3/helpers/toConsumableArray";import l from"@babel/runtime-corejs3/core-js-stable/object/values";import d from"@babel/runtime-corejs3/helpers/slicedToArray";import h from"@babel/runtime-corejs3/core-js-stable/instance/slice";import p from"@babel/runtime-corejs3/core-js-stable/instance/index-of";import v from"@babel/runtime-corejs3/core-js-stable/instance/concat";import m from"@babel/runtime-corejs3/core-js-stable/map";import y from"@babel/runtime-corejs3/core-js-stable/set";import g from"js-md5";import b from"@babel/runtime-corejs3/core-js-stable/set-timeout";import w from"@babel/runtime-corejs3/core-js-stable/promise";import S from"axios";import j from"@babel/runtime-corejs3/core-js-stable/object/keys";import _ from"@babel/runtime-corejs3/core-js-stable/json/stringify";import E from"localforage";import{deflate as O,inflate as k}from"pako";import I from"@babel/runtime-corejs3/core-js-stable/parse-int";import x from"@babel/runtime-corejs3/core-js-stable/object/define-property";import N from"@babel/runtime-corejs3/core-js-stable/object/define-properties";import T from"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";import A from"@babel/runtime-corejs3/core-js-stable/instance/for-each";import R from"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";import C from"@babel/runtime-corejs3/core-js-stable/instance/filter";import P from"@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";import L from"@babel/runtime-corejs3/core-js-stable/instance/map";import D from"@babel/runtime-corejs3/core-js-stable/date/now";import F from"@babel/runtime-corejs3/helpers/defineProperty";import{EventType as M,record as B,takeFullSnapshot as U,mirror as z}from"@xysfe/memento-core";import H from"fingerprintjs2";function q(e){var t=e.url,r=e.param,n=e.timeout,o=void 0===n?8e3:n,i=e.requestHeader,a={method:"post",url:t,data:r,timeout:o,headers:{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/octet-stream;charset=UTF-8"}};if(i)for(var u in i)a.headers[u]=i[u];return new w((function(e,t){S(a).then((function(t){e(t.data)})).catch((function(){t("系统繁忙,请稍后重试")}))}))}var W,G=function(){function r(t){var n=t.reportUrl,o=t.retryNum;e(this,r),this.retryStack=new m,this.reportUrl=n,this.retryNum=o}var n,o;return t(r,[{key:"retry",value:(o=c(u.mark((function e(t){var r,n,o,i,a,c,s,f=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.sign,n=t.postData,o=t.requestHeader,i=t.failFn,a=t.preResolve,c=t.preReject,s=t.errmsg,e.next=3,new w((function(e,t){var u=a||e,l=c||t,d=f.retryStack.get(r);if(d){if(d.num<0)return f.retryClear(r),l(s)}else f.retryStack.set(r,{num:f.retryNum,interval:1,timer:null}),d=f.retryStack.get(r);var h=(f.retryNum-d.num)*d.interval*1e3;d.timer=b((function(){q({url:f.reportUrl,param:n,requestHeader:o}).then((function(e){0===e.ret?(f.retryClear(r),u(e)):(i&&i(),f.retry({sign:r,postData:n,requestHeader:o,failFn:i,preResolve:u,preReject:l,errmsg:e.errmsg}))})).catch((function(e){i&&i(),f.retry({sign:r,postData:n,requestHeader:o,failFn:i,preResolve:u,preReject:l,errmsg:e})}))}),h),d.num--}));case 3:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})},{key:"retryClear",value:function(e){var t=this.retryStack.get(e);t&&(clearTimeout(t.timer),this.retryStack.delete(e))}},{key:"send",value:(n=c(u.mark((function e(t){var r,n,o,i;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.sign,n=t.postData,o=t.requestHeader,i=t.failFn,e.abrupt("return",this.retry({sign:r,postData:n,requestHeader:o,failFn:i}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}]),r}(),V=function(e){try{var t=k(e,{to:"string"});return JSON.parse(t)}catch(e){return console.log(e),null}},Y=function(e){var t=_(e);return O(t)},J="undefined"!=typeof window&&window.navigator.userAgent.toLowerCase(),K=(J&&/msie|trident/.test(J),J&&p(J).call(J,"msie 9.0"),J&&p(J).call(J,"edge/")>0),X=(J&&p(J).call(J,"android"),J&&/iphone|ipad|ipod|ios/.test(J),J&&/chrome\/\d+/.test(J),J&&/MicroMessenger/i.test(J),J&&/wxwork/i.test(J),J&&/mucxiaoyusan/i.test(J),J&&/muckacabao/i.test(J),J&&/AlipayClient.*MiniProgram$/i.test(J),J&&/phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(J),/MucWebAutoTester/.test(window.navigator.userAgent),W="Uint8Array",function(e){return Object.prototype.toString.call(e)==="[object ".concat(W,"]")}),Q=function(e){var t=new RegExp("(?:^|;+|\\s+)"+e+"=([^;]*)"),r=document.cookie.match(t);return r?r[1]:""};function $(e,t){window.localStorage?window.localStorage.setItem(e,t):function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"/",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=new Date;r&&a.setMinutes(a.getMinutes()+I(r)),document.cookie=e+"="+escape(t)+(r?";expires="+a.toGMTString():"")+(n?";path="+n:"")+(o?";domain="+o:"")+(i?";secure":"")}(e,t)}function Z(e){return window.localStorage?window.localStorage.getItem(e):Q(e)}function ee(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefhijklmnopqrstuvwxyz0123456789",r=t.length,n="",o=0;o<e;o++)n+=t.charAt(Math.floor(Math.random()*r));return n}function te(e,t){var u;if(void 0===i||null==o(e)){if(n(e)||(u=function(e,t){var r;if(!e)return;if("string"==typeof e)return re(e,t);var n=h(r=Object.prototype.toString.call(e)).call(r,8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return a(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return re(e,t)}(e))||t&&e&&"number"==typeof e.length){u&&(e=u);var c=0,s=function(){};return{s:s,n:function(){return c>=e.length?{done:!0}:{done:!1,value:e[c++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,l=!0,d=!1;return{s:function(){u=r(e)},n:function(){var e=u.next();return l=e.done,e},e:function(e){d=!0,f=e},f:function(){try{l||null==u.return||u.return()}finally{if(d)throw f}}}}function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ne=function(){function r(t){var n=this;e(this,r),this.memory={},this.debounceMap=new m,this.hasInited=!1,this.openWorker=t.openWorker,E.config({name:"memento",storeName:"memento-table",description:""}),this.maxSend=t.maxSend,this.expires=864e5*t.expires,this.getLocal().then((function(e){if(n.hasInited=!0,n.memory=n.filterOverdue(e),null==t?void 0:t.mounted){var r=JSON.parse(_(n.memory));t.mounted(r)}}))}var n,o;return t(r,[{key:"filterOverdue",value:function(e){var t={},r=(new Date).getTime();for(var n in e){var o=e[n],i=o.state,a=o.source,u={state:{},source:{}},c=!1;for(var s in i){Number(i[s].timestamp)+this.expires>r?(u.state[s]=i[s],u.source[s]=a[s]):c=!0}c&&this.setLocal(n,u),j(u.source).length&&(t[n]=u)}return t}},{key:"getLocal",value:(o=c(u.mark((function e(){var t,r;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,E.length();case 2:if(t=e.sent,r={},t){e.next=6;break}return e.abrupt("return",r);case 6:return e.abrupt("return",E.iterate((function(e,t){/^memento/.test(t)&&X(e)&&(r[t]=V(e))})).then((function(){return r})));case 7:case"end":return e.stop()}}),e)}))),function(){return o.apply(this,arguments)})},{key:"setLocal",value:(n=c(u.mark((function e(t,r){var n,o,i,a,c;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r||this.memory[t],o=this.getDebounce(t),i=o.forageAdd,a=o.forageRemove,j(n.source).length?(c=Y(n),i(t,c)):a(t);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getDebounce",value:function(e){var t=this;return this.debounceMap.has(e)||this.debounceMap.set(e,{forageAdd:this.debounce((function(e,r){t.openWorker?window.sendMessage({event:"store",data:{type:"setItem",info:{key:e,value:r}}}):E.setItem(e,r)}),300),forageRemove:this.debounce((function(e){t.openWorker?window.sendMessage({event:"store",data:{type:"removeItem",info:{key:e}}}):E.removeItem(e)}),300)}),this.debounceMap.get(e)}},{key:"debounce",value:function(e,t){var r,n=this,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var i=arguments.length,a=new Array(i),u=0;u<i;u++)a[u]=arguments[u];if(o)return e.apply(n,a),void(o=!1);r&&clearTimeout(r),r=b((function(){e.apply(n,a),r=null}),t)}}},{key:"setItem",value:function(e,t){if(this.hasInited){var r=t.sub_trans,n={source:{},state:{}};this.memory.hasOwnProperty(e)&&(n=this.memory[e]),n.source[r]=t,n.state[r]={sendNum:0,timestamp:(new Date).getTime()},this.memory[e]=n,this.setLocal(e)}}},{key:"removeItems",value:function(e,t){if(this.memory.hasOwnProperty(e)&&this.hasInited){var r,n=this.memory[e],o=n.source,i=n.state,a=te(t);try{for(a.s();!(r=a.n()).done;){var u=r.value.sub_trans;o.hasOwnProperty(u)&&(delete o[u],delete i[u])}}catch(e){a.e(e)}finally{a.f()}this.setLocal(e)}}},{key:"sendItems",value:function(e,t){if(this.memory.hasOwnProperty(e)&&this.hasInited){var r,n=this.memory[e].state,o=[],i=te(t);try{for(i.s();!(r=i.n()).done;){var a=r.value,u=a.sub_trans;n.hasOwnProperty(u)&&(n[u].sendNum+=1,n[u].sendNum===this.maxSend&&o.push(a))}}catch(e){i.e(e)}finally{i.f()}o.length?this.removeItems(e,o):this.setLocal(e)}}}]),r}(),oe=function(){function r(t,n){e(this,r),this.interval=n||2e3,this.callback=t||null,this.timer=null}return t(r,[{key:"set",value:function(e){var t=e.callback,r=e.interval;this.interval=r,this.callback=t}},{key:"start",value:function(e,t){var r=this,n=e||this.callback,o=t||this.interval;n&&(this.timer=b((function(){n(),r.start(n,o)}),o))}},{key:"stop",value:function(){clearTimeout(this.timer)}},{key:"reset",value:function(){clearTimeout(this.timer),this.start()}}]),r}();function ie(e,t){var r=j(e);if(P){var n=P(e);t&&(n=C(n).call(n,(function(t){return R(e,t).enumerable}))),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r,n=null!=arguments[t]?arguments[t]:{};if(t%2)A(r=ie(Object(n),!0)).call(r,(function(t){F(e,t,n[t])}));else if(T)N(e,T(n));else{var o;A(o=ie(Object(n))).call(o,(function(t){x(e,t,R(n,t))}))}}return e}var ue=function(){function r(){var t,n=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e(this,r),this.deviceId="",this.transNo="",this.preTransNo="",this.pageRouteNo=1,this.pageRouteEventCount=0,this.pageSnapshotCount=0,this.incrementalSnapshotSubTrans="";var i=o.emit;this.recordOptions=ae(ae({},o),{},{emit:function(e,r){if((Z("__memento_track")||"")!==n.trackId&&e.type===M.IncrementalSnapshot)return n.start().then((function(){e.timestamp=D(),n.handleEvent(e,i,r)}));n.handleEvent(e,i,r),e.type===M.PageChange&&(n.stop(),n.recordCleaning=B(n.recordOptions)),n.pageSnapshotCount>1e4&&(t&&clearTimeout(t),t=b((function(){n.start()})))}}),window.__memento_record={mirror:z,record:{getTrackId:function(){return n.trackId},getUdid:function(){return n.udid},increment:function(){return n.incrementalSnapshotSubTrans}}}}return t(r,[{key:"genTransNo",value:function(){function e(e){var t,r;return{deviceId:e,transNo:g(v(t=v(r="".concat(e,"-")).call(r,ee(16),"-")).call(t,D()))}}return new w((function(t){var r=Z("__memento_device_id")||"";r?t(e(r)):window.requestIdleCallback?window.requestIdleCallback((function(){H.get((function(n){var o=L(n).call(n,(function(e){return e.value}));$("__memento_device_id",r=H.x64hash128(o.join(""),31)),t(e(r))}))})):b((function(){H.get((function(n){var o=L(n).call(n,(function(e){return e.value}));$("__memento_device_id",r=H.x64hash128(o.join(""),31)),t(e(r))}))}),500)}))}},{key:"translateEvent",value:function(e){var t,r,n=v(t=v(r="".concat(this.pageNo,"-")).call(r,this.pageRouteNo,"-")).call(t,this.pageRouteEventCount),o=e.type,i="";return 2===o?i=n:3===o&&(i=this.incrementalSnapshotSubTrans),ae(ae({},e),{},{trans_no:this.transNo,pre_trans_no:this.preTransNo,sub_trans:n,base_sub_trans:i,url:location.href})}},{key:"handleEvent",value:function(e,t,r){e.type===M.PageChange&&(this.pageRouteNo++,this.pageRouteEventCount=0),this.pageRouteEventCount++,this.pageSnapshotCount++;var n=this.translateEvent(e);e.type===M.FullSnapshot&&(this.incrementalSnapshotSubTrans=n.sub_trans),t&&t(n,r)}},{key:"start",value:function(){var e=this;return new w((function(t){e.pageSnapshotCount=0,e.pageNo=ee(4),e.pageRouteNo=1,e.pageRouteEventCount=0,e.recordCleaning&&e.recordCleaning();var r=Z("__memento_track")||"";e.genTransNo().then((function(n){var o=n.deviceId,i=n.transNo;e.transNo=i,e.deviceId=o,e.preTransNo=r,$("__memento_track",i),r&&$("__memento_pretrack",r),e.recordCleaning=B(e.recordOptions),t(e)}))}))}},{key:"setTag",value:function(e){var t=this;return new w((function(r,n){if(!t.transNo)return n("please set tag after start recording");U(ae(ae({},t.recordOptions),{},{emit:function(e){r(t.translateEvent(e))}}),e)}))}},{key:"stop",value:function(){this.recordCleaning&&this.recordCleaning()}},{key:"trackId",get:function(){return this.transNo}},{key:"udid",get:function(){return this.deviceId}}]),r}(),ce={type:"type",timestamp:"timestamp",data:"data",sub_trans:"sub_trans",base_sub_trans:"base_sub_trans",tag:"tag",url:"url"},se={bussi_no:"bussi_no",trans_no:"trans_no",pre_trans_no:"pre_trans_no"},fe="/go/report/receiveDataPoint",le=20,de=3,he=10,pe=15;function ve(e,t){var u;if(void 0===i||null==o(e)){if(n(e)||(u=function(e,t){var r;if(!e)return;if("string"==typeof e)return me(e,t);var n=h(r=Object.prototype.toString.call(e)).call(r,8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return a(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return me(e,t)}(e))||t&&e&&"number"==typeof e.length){u&&(e=u);var c=0,s=function(){};return{s:s,n:function(){return c>=e.length?{done:!0}:{done:!1,value:e[c++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,l=!0,d=!1;return{s:function(){u=r(e)},n:function(){var e=u.next();return l=e.done,e},e:function(e){d=!0,f=e},f:function(){try{l||null==u.return||u.return()}finally{if(d)throw f}}}}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ye=function(e,t){var r,n={bussi_no:t.bizId,xys_id:t.xysId},o=[],i=ve(e);try{for(i.s();!(r=i.n()).done;){var a=r.value,u={},c=!1;for(var s in a){if(ce.hasOwnProperty(s))u[ce[s]]=a[s];if(!c)if(se.hasOwnProperty(s))n[se[s]]=a[s]}c=!0,o.push(u)}}catch(e){i.e(e)}finally{i.f()}return{version:"v1",logs:o,common:n}};function ge(e,t){var u;if(void 0===i||null==o(e)){if(n(e)||(u=function(e,t){var r;if(!e)return;if("string"==typeof e)return be(e,t);var n=h(r=Object.prototype.toString.call(e)).call(r,8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return a(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return be(e,t)}(e))||t&&e&&"number"==typeof e.length){u&&(e=u);var c=0,s=function(){};return{s:s,n:function(){return c>=e.length?{done:!0}:{done:!1,value:e[c++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,l=!0,d=!1;return{s:function(){u=r(e)},n:function(){var e=u.next();return l=e.done,e},e:function(e){d=!0,f=e},f:function(){try{l||null==u.return||u.return()}finally{if(d)throw f}}}}function be(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var we=function(){function r(t){var n,o=this;e(this,r),this.lazyFuncs=new y,this.storeInited=!1,window&&(window.__memento_log=window.__memento_log||!1),this.traceMap=new m,this.timing=new oe;var i=location.host.match(/(beta|alpha|dev).xinhulu.com/i);n="localhost"===location.hostname?location.host:i?i[0]:"www.xiaoyusan.com";var a={reportUrl:location.protocol+"//"+n+fe,retryNum:de};this.initWorker(a),this.worker||(this.report=new G(a)),this.size=le,this.external={bizId:(null==t?void 0:t.bizId)||"",drive:Q("xxid")||Q("cps_xxid")||Q("niubao_xxid")||"",xysId:Q("_xys_s_id")||""},this.store=new ne({maxSend:he,expires:pe,openWorker:!!this.worker,mounted:function(e){o.print("storeData:",e),o.storeInited=!0,o.storeSend(e),o.triggerLazy(),o.startTiming()}})}var n;return t(r,[{key:"initWorker",value:function(e){var t=this;if(this.worker=null,window.Worker&&!/msie|trident|firefox/.test(navigator.userAgent.toLowerCase()))try{this.worker=this.createWorker('!function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return r(null==t&&n.path)}},n.exports),n.exports}function r(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var n=function(e){return e&&e.Math==Math&&e},o=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")(),i=function(e){try{return!!e()}catch(e){return!0}},a=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),u={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,f={f:c&&!u.call({1:2},1)?function(e){var t=c(this,e);return!!t&&t.enumerable}:u},s=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},l={}.toString,d=function(e){return l.call(e).slice(8,-1)},h="".split,p=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==d(e)?h.call(e,""):Object(e)}:Object,v=function(e){if(null==e)throw TypeError("Can\'t call method on "+e);return e},y=function(e){return p(v(e))},m=function(e){return"object"==typeof e?null!==e:"function"==typeof e},g=function(e,t){if(!m(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!m(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!m(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!m(n=r.call(e)))return n;throw TypeError("Can\'t convert object to primitive value")},b={}.hasOwnProperty,w=function(e,t){return b.call(e,t)},S=o.document,E=m(S)&&m(S.createElement),_=function(e){return E?S.createElement(e):{}},j=!a&&!i((function(){return 7!=Object.defineProperty(_("div"),"a",{get:function(){return 7}}).a})),O=Object.getOwnPropertyDescriptor,x={f:a?O:function(e,t){if(e=y(e),t=g(t,!0),j)try{return O(e,t)}catch(e){}if(w(e,t))return s(!f.f.call(e,t),e[t])}},I=/#|\\.prototype\\./,A=function(e,t){var r=N[T(e)];return r==R||r!=k&&("function"==typeof t?i(t):!!t)},T=A.normalize=function(e){return String(e).replace(I,".").toLowerCase()},N=A.data={},k=A.NATIVE="N",R=A.POLYFILL="P",L=A,P={},C=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},D=function(e,t,r){if(C(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}},F=function(e){if(!m(e))throw TypeError(String(e)+" is not an object");return e},B=Object.defineProperty,M={f:a?B:function(e,t,r){if(F(e),t=g(t,!0),F(r),j)try{return B(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},U=a?function(e,t,r){return M.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e},z=x.f,q=function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t},H=function(e,t){var r,n,i,a,u,c,f,s,l=e.target,d=e.global,h=e.stat,p=e.proto,v=d?o:h?o[l]:(o[l]||{}).prototype,y=d?P:P[l]||(P[l]={}),m=y.prototype;for(i in t)r=!L(d?i:l+(h?".":"#")+i,e.forced)&&v&&w(v,i),u=y[i],r&&(c=e.noTargetGet?(s=z(v,i))&&s.value:v[i]),a=r&&c?c:t[i],r&&typeof u==typeof a||(f=e.bind&&r?D(a,o):e.wrap&&r?q(a):p&&"function"==typeof a?D(Function.call,a):a,(e.sham||a&&a.sham||u&&u.sham)&&U(f,"sham",!0),y[i]=f,p&&(w(P,n=l+"Prototype")||U(P,n,{}),P[n][i]=a,e.real&&m&&!m[i]&&U(m,i,a)))};H({target:"Object",stat:!0,forced:!a,sham:!a},{defineProperty:M.f});var G=t((function(e){var t=P.Object,r=e.exports=function(e,r,n){return t.defineProperty(e,r,n)};t.defineProperty.sham&&(r.sham=!0)})),W=G,V=Math.ceil,K=Math.floor,X=function(e){return isNaN(e=+e)?0:(e>0?K:V)(e)},J=Math.min,Q=function(e){return e>0?J(X(e),9007199254740991):0},Y=Math.max,$=Math.min,Z=function(e){return function(t,r,n){var o,i=y(t),a=Q(i.length),u=function(e,t){var r=X(e);return r<0?Y(r+t,0):$(r,t)}(n,a);if(e&&r!=r){for(;a>u;)if((o=i[u++])!=o)return!0}else for(;a>u;u++)if((e||u in i)&&i[u]===r)return e||u||0;return!e&&-1}},ee={includes:Z(!0),indexOf:Z(!1)},te={},re=ee.indexOf,ne=function(e,t){var r,n=y(e),o=0,i=[];for(r in n)!w(te,r)&&w(n,r)&&i.push(r);for(;t.length>o;)w(n,r=t[o++])&&(~re(i,r)||i.push(r));return i},oe=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ie=Object.keys||function(e){return ne(e,oe)},ae=a?Object.defineProperties:function(e,t){F(e);for(var r,n=ie(t),o=n.length,i=0;o>i;)M.f(e,r=n[i++],t[r]);return e};H({target:"Object",stat:!0,forced:!a,sham:!a},{defineProperties:ae});var ue=t((function(e){var t=P.Object,r=e.exports=function(e,r){return t.defineProperties(e,r)};t.defineProperties.sham&&(r.sham=!0)})),ce=function(e){return"function"==typeof e?e:void 0},fe=function(e,t){return arguments.length<2?ce(P[e])||ce(o[e]):P[e]&&P[e][t]||o[e]&&o[e][t]},se=oe.concat("length","prototype"),le={f:Object.getOwnPropertyNames||function(e){return ne(e,se)}},de={f:Object.getOwnPropertySymbols},he=fe("Reflect","ownKeys")||function(e){var t=le.f(F(e)),r=de.f;return r?t.concat(r(e)):t},pe=function(e,t,r){var n=g(t);n in e?M.f(e,n,s(0,r)):e[n]=r};H({target:"Object",stat:!0,sham:!a},{getOwnPropertyDescriptors:function(e){for(var t,r,n=y(e),o=x.f,i=he(n),a={},u=0;i.length>u;)void 0!==(r=o(n,t=i[u++]))&&pe(a,t,r);return a}});var ve=P.Object.getOwnPropertyDescriptors,ye={},me=o["__core-js_shared__"]||function(e,t){try{U(o,e,t)}catch(r){o[e]=t}return t}("__core-js_shared__",{}),ge=Function.toString;"function"!=typeof me.inspectSource&&(me.inspectSource=function(e){return ge.call(e)});var be,we,Se,Ee=me.inspectSource,_e=o.WeakMap,je="function"==typeof _e&&/native code/.test(Ee(_e)),Oe=t((function(e){(e.exports=function(e,t){return me[e]||(me[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.4",mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),xe=0,Ie=Math.random(),Ae=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++xe+Ie).toString(36)},Te=Oe("keys"),Ne=function(e){return Te[e]||(Te[e]=Ae(e))},ke=o.WeakMap;if(je){var Re=new ke,Le=Re.get,Pe=Re.has,Ce=Re.set;be=function(e,t){return Ce.call(Re,e,t),t},we=function(e){return Le.call(Re,e)||{}},Se=function(e){return Pe.call(Re,e)}}else{var De=Ne("state");te[De]=!0,be=function(e,t){return U(e,De,t),t},we=function(e){return w(e,De)?e[De]:{}},Se=function(e){return w(e,De)}}var Fe,Be,Me,Ue={set:be,get:we,has:Se,enforce:function(e){return Se(e)?we(e):be(e,{})},getterFor:function(e){return function(t){var r;if(!m(t)||(r=we(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}}},ze=function(e){return Object(v(e))},qe=!i((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),He=Ne("IE_PROTO"),Ge=Object.prototype,We=qe?Object.getPrototypeOf:function(e){return e=ze(e),w(e,He)?e[He]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Ge:null},Ve=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())})),Ke=Ve&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Xe=Oe("wks"),Je=o.Symbol,Qe=Ke?Je:Je&&Je.withoutSetter||Ae,Ye=function(e){return w(Xe,e)||(Ve&&w(Je,e)?Xe[e]=Je[e]:Xe[e]=Qe("Symbol."+e)),Xe[e]},$e=(Ye("iterator"),!1);[].keys&&("next"in(Me=[].keys())?(Be=We(We(Me)))!==Object.prototype&&(Fe=Be):$e=!0),null==Fe&&(Fe={});var Ze,et={IteratorPrototype:Fe,BUGGY_SAFARI_ITERATORS:$e},tt=fe("document","documentElement"),rt=Ne("IE_PROTO"),nt=function(){},ot=function(e){return"<script>"+e+"<\\/script>"},it=function(){try{Ze=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;it=Ze?function(e){e.write(ot("")),e.close();var t=e.parentWindow.Object;return e=null,t}(Ze):((t=_("iframe")).style.display="none",tt.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ot("document.F=Object")),e.close(),e.F);for(var r=oe.length;r--;)delete it.prototype[oe[r]];return it()};te[rt]=!0;var at=Object.create||function(e,t){var r;return null!==e?(nt.prototype=F(e),r=new nt,nt.prototype=null,r[rt]=e):r=it(),void 0===t?r:ae(r,t)},ut={};ut[Ye("toStringTag")]="z";var ct="[object z]"===String(ut),ft=Ye("toStringTag"),st="Arguments"==d(function(){return arguments}()),lt=ct?d:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),ft))?r:st?d(t):"Object"==(n=d(t))&&"function"==typeof t.callee?"Arguments":n},dt=ct?{}.toString:function(){return"[object "+lt(this)+"]"},ht=M.f,pt=Ye("toStringTag"),vt=function(e,t,r,n){if(e){var o=r?e:e.prototype;w(o,pt)||ht(o,pt,{configurable:!0,value:t}),n&&!ct&&U(o,"toString",dt)}},yt=et.IteratorPrototype,mt=function(){return this},gt=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return F(r),function(e){if(!m(e)&&null!==e)throw TypeError("Can\'t set "+String(e)+" as a prototype")}(n),t?e.call(r,n):r.__proto__=n,r}}():void 0),bt=function(e,t,r,n){n&&n.enumerable?e[t]=r:U(e,t,r)},wt=et.IteratorPrototype,St=et.BUGGY_SAFARI_ITERATORS,Et=Ye("iterator"),_t=function(){return this},jt=function(e,t,r,n,o,i,a){!function(e,t,r){var n=t+" Iterator";e.prototype=at(yt,{next:s(1,r)}),vt(e,n,!1,!0),ye[n]=mt}(r,t,n);var u,c,f,l=function(e){if(e===o&&y)return y;if(!St&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",h=!1,p=e.prototype,v=p[Et]||p["@@iterator"]||o&&p[o],y=!St&&v||l(o),m="Array"==t&&p.entries||v;if(m&&(u=We(m.call(new e)),wt!==Object.prototype&&u.next&&(vt(u,d,!0,!0),ye[d]=_t)),"values"==o&&v&&"values"!==v.name&&(h=!0,y=function(){return v.call(this)}),a&&p[Et]!==y&&U(p,Et,y),ye[t]=y,o)if(c={values:l("values"),keys:i?y:l("keys"),entries:l("entries")},a)for(f in c)(St||h||!(f in p))&&bt(p,f,c[f]);else H({target:t,proto:!0,forced:St||h},c);return c},Ot=Ue.set,xt=Ue.getterFor("Array Iterator");jt(Array,"Array",(function(e,t){Ot(this,{type:"Array Iterator",target:y(e),index:0,kind:t})}),(function(){var e=xt(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");ye.Arguments=ye.Array;var It=Ye("toStringTag");for(var At in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var Tt=o[At],Nt=Tt&&Tt.prototype;Nt&&lt(Nt)!==It&&U(Nt,It,At),ye[At]=ye.Array}var kt,Rt,Lt=Array.isArray||function(e){return"Array"==d(e)},Pt=Ye("species"),Ct=function(e,t){var r;return Lt(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!Lt(r.prototype)?m(r)&&null===(r=r[Pt])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===t?0:t)},Dt=[].push,Ft=function(e){var t=1==e,r=2==e,n=3==e,o=4==e,i=6==e,a=5==e||i;return function(u,c,f,s){for(var l,d,h=ze(u),v=p(h),y=D(c,f,3),m=Q(v.length),g=0,b=s||Ct,w=t?b(u,m):r?b(u,0):void 0;m>g;g++)if((a||g in v)&&(d=y(l=v[g],g,h),e))if(t)w[g]=d;else if(d)switch(e){case 3:return!0;case 5:return l;case 6:return g;case 2:Dt.call(w,l)}else if(o)return!1;return i?-1:n||o?o:w}},Bt={forEach:Ft(0),map:Ft(1),filter:Ft(2),some:Ft(3),every:Ft(4),find:Ft(5),findIndex:Ft(6)},Mt=Object.defineProperty,Ut={},zt=function(e){throw e},qt=function(e,t){if(w(Ut,e))return Ut[e];t||(t={});var r=[][e],n=!!w(t,"ACCESSORS")&&t.ACCESSORS,o=w(t,0)?t[0]:zt,u=w(t,1)?t[1]:void 0;return Ut[e]=!!r&&!i((function(){if(n&&!a)return!0;var e={length:-1};n?Mt(e,1,{enumerable:!0,get:zt}):e[1]=1,r.call(e,o,u)}))},Ht=Bt.forEach,Gt=!!(Rt=[]["forEach"])&&i((function(){Rt.call(null,kt||function(){throw 1},1)})),Wt=qt("forEach"),Vt=Gt&&Wt?[].forEach:function(e){return Ht(this,e,arguments.length>1?arguments[1]:void 0)};H({target:"Array",proto:!0,forced:[].forEach!=Vt},{forEach:Vt});var Kt=function(e){return P[e+"Prototype"]},Xt=Kt("Array").forEach,Jt=Array.prototype,Qt={DOMTokenList:!0,NodeList:!0},Yt=function(e){var t=e.forEach;return e===Jt||e instanceof Array&&t===Jt.forEach||Qt.hasOwnProperty(lt(e))?Xt:t},$t=x.f,Zt=i((function(){$t(1)}));H({target:"Object",stat:!0,forced:!a||Zt,sham:!a},{getOwnPropertyDescriptor:function(e,t){return $t(y(e),t)}});var er,tr,rr=t((function(e){var t=P.Object,r=e.exports=function(e,r){return t.getOwnPropertyDescriptor(e,r)};t.getOwnPropertyDescriptor.sham&&(r.sham=!0)})),nr=fe("navigator","userAgent")||"",or=o.process,ir=or&&or.versions,ar=ir&&ir.v8;ar?tr=(er=ar.split("."))[0]+er[1]:nr&&(!(er=nr.match(/Edge\\/(\\d+)/))||er[1]>=74)&&(er=nr.match(/Chrome\\/(\\d+)/))&&(tr=er[1]);var ur=tr&&+tr,cr=Ye("species"),fr=Bt.filter,sr=function(e){return ur>=51||!i((function(){var t=[];return(t.constructor={})[cr]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}("filter"),lr=qt("filter");H({target:"Array",proto:!0,forced:!sr||!lr},{filter:function(e){return fr(this,e,arguments.length>1?arguments[1]:void 0)}});var dr=Kt("Array").filter,hr=Array.prototype,pr=function(e){var t=e.filter;return e===hr||e instanceof Array&&t===hr.filter?dr:t},vr=le.f,yr={}.toString,mr="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],gr={f:function(e){return mr&&"[object Window]"==yr.call(e)?function(e){try{return vr(e)}catch(e){return mr.slice()}}(e):vr(y(e))}},br={f:Ye},wr=M.f,Sr=Bt.forEach,Er=Ne("hidden"),_r=Ye("toPrimitive"),jr=Ue.set,Or=Ue.getterFor("Symbol"),xr=Object.prototype,Ir=o.Symbol,Ar=fe("JSON","stringify"),Tr=x.f,Nr=M.f,kr=gr.f,Rr=f.f,Lr=Oe("symbols"),Pr=Oe("op-symbols"),Cr=Oe("string-to-symbol-registry"),Dr=Oe("symbol-to-string-registry"),Fr=Oe("wks"),Br=o.QObject,Mr=!Br||!Br.prototype||!Br.prototype.findChild,Ur=a&&i((function(){return 7!=at(Nr({},"a",{get:function(){return Nr(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Tr(xr,t);n&&delete xr[t],Nr(e,t,r),n&&e!==xr&&Nr(xr,t,n)}:Nr,zr=function(e,t){var r=Lr[e]=at(Ir.prototype);return jr(r,{type:"Symbol",tag:e,description:t}),a||(r.description=t),r},qr=Ke?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof Ir},Hr=function(e,t,r){e===xr&&Hr(Pr,t,r),F(e);var n=g(t,!0);return F(r),w(Lr,n)?(r.enumerable?(w(e,Er)&&e[Er][n]&&(e[Er][n]=!1),r=at(r,{enumerable:s(0,!1)})):(w(e,Er)||Nr(e,Er,s(1,{})),e[Er][n]=!0),Ur(e,n,r)):Nr(e,n,r)},Gr=function(e,t){F(e);var r=y(t),n=ie(r).concat(Xr(r));return Sr(n,(function(t){a&&!Wr.call(r,t)||Hr(e,t,r[t])})),e},Wr=function(e){var t=g(e,!0),r=Rr.call(this,t);return!(this===xr&&w(Lr,t)&&!w(Pr,t))&&(!(r||!w(this,t)||!w(Lr,t)||w(this,Er)&&this[Er][t])||r)},Vr=function(e,t){var r=y(e),n=g(t,!0);if(r!==xr||!w(Lr,n)||w(Pr,n)){var o=Tr(r,n);return!o||!w(Lr,n)||w(r,Er)&&r[Er][n]||(o.enumerable=!0),o}},Kr=function(e){var t=kr(y(e)),r=[];return Sr(t,(function(e){w(Lr,e)||w(te,e)||r.push(e)})),r},Xr=function(e){var t=e===xr,r=kr(t?Pr:y(e)),n=[];return Sr(r,(function(e){!w(Lr,e)||t&&!w(xr,e)||n.push(Lr[e])})),n};if(Ve||(bt((Ir=function(){if(this instanceof Ir)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=Ae(e),r=function(e){this===xr&&r.call(Pr,e),w(this,Er)&&w(this[Er],t)&&(this[Er][t]=!1),Ur(this,t,s(1,e))};return a&&Mr&&Ur(xr,t,{configurable:!0,set:r}),zr(t,e)}).prototype,"toString",(function(){return Or(this).tag})),bt(Ir,"withoutSetter",(function(e){return zr(Ae(e),e)})),f.f=Wr,M.f=Hr,x.f=Vr,le.f=gr.f=Kr,de.f=Xr,br.f=function(e){return zr(Ye(e),e)},a&&Nr(Ir.prototype,"description",{configurable:!0,get:function(){return Or(this).description}})),H({global:!0,wrap:!0,forced:!Ve,sham:!Ve},{Symbol:Ir}),Sr(ie(Fr),(function(e){!function(e){var t=P.Symbol||(P.Symbol={});w(t,e)||wr(t,e,{value:br.f(e)})}(e)})),H({target:"Symbol",stat:!0,forced:!Ve},{for:function(e){var t=String(e);if(w(Cr,t))return Cr[t];var r=Ir(t);return Cr[t]=r,Dr[r]=t,r},keyFor:function(e){if(!qr(e))throw TypeError(e+" is not a symbol");if(w(Dr,e))return Dr[e]},useSetter:function(){Mr=!0},useSimple:function(){Mr=!1}}),H({target:"Object",stat:!0,forced:!Ve,sham:!a},{create:function(e,t){return void 0===t?at(e):Gr(at(e),t)},defineProperty:Hr,defineProperties:Gr,getOwnPropertyDescriptor:Vr}),H({target:"Object",stat:!0,forced:!Ve},{getOwnPropertyNames:Kr,getOwnPropertySymbols:Xr}),H({target:"Object",stat:!0,forced:i((function(){de.f(1)}))},{getOwnPropertySymbols:function(e){return de.f(ze(e))}}),Ar){var Jr=!Ve||i((function(){var e=Ir();return"[null]"!=Ar([e])||"{}"!=Ar({a:e})||"{}"!=Ar(Object(e))}));H({target:"JSON",stat:!0,forced:Jr},{stringify:function(e,t,r){for(var n,o=[e],i=1;arguments.length>i;)o.push(arguments[i++]);if(n=t,(m(t)||void 0!==e)&&!qr(e))return Lt(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!qr(t))return t}),o[1]=t,Ar.apply(null,o)}})}Ir.prototype[_r]||U(Ir.prototype,_r,Ir.prototype.valueOf),vt(Ir,"Symbol"),te[Er]=!0;var Qr=P.Object.getOwnPropertySymbols,Yr=i((function(){ie(1)}));H({target:"Object",stat:!0,forced:Yr},{keys:function(e){return ie(ze(e))}});var $r=P.Object.keys,Zr=G;var en=function(e,t,r){return t in e?Zr(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},tn=t((function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof l?t:l,i=Object.create(o.prototype),a=new _(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=w(a,r);if(u){if(u===s)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=f(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===s)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(e,r,a),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var s={};function l(){}function d(){}function h(){}var p={};p[o]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(j([])));y&&y!==t&&r.call(y,o)&&(p=y);var m=h.prototype=l.prototype=Object.create(p);function g(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var n;this._invoke=function(o,i){function a(){return new t((function(n,a){!function n(o,i,a,u){var c=f(e[o],e,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(l).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function w(e,t){var r=e.iterator[t.method];if(undefined===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=undefined,w(e,t),"throw"===t.method))return s;t.method="throw",t.arg=new TypeError("The iterator does not provide a \'throw\' method")}return s}var n=f(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,s;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=undefined),t.delegate=null,s):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function j(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=undefined,t.done=!0,t};return i.next=i}}return{next:O}}function O(){return{value:undefined,done:!0}}return d.prototype=m.constructor=h,h.constructor=d,d.displayName=u(h,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,u(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},g(b.prototype),b.prototype[i]=function(){return this},e.AsyncIterator=b,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new b(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(m),u(m,a,"Generator"),m[o]=function(){return this},m.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=j,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=undefined)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=undefined),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),s}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:j(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=undefined),s}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}})),rn=[].slice,nn=/MSIE .\\./.test(nr),on=function(e){return function(t,r){var n=arguments.length>2,o=n?rn.call(arguments,2):void 0;return e(n?function(){("function"==typeof t?t:Function(t)).apply(this,o)}:t,r)}};H({global:!0,bind:!0,forced:nn},{setTimeout:on(o.setTimeout),setInterval:on(o.setInterval)});var an=P.setTimeout,un=function(e){return function(t,r){var n,o,i=String(v(t)),a=X(r),u=i.length;return a<0||a>=u?e?"":void 0:(n=i.charCodeAt(a))<55296||n>56319||a+1===u||(o=i.charCodeAt(a+1))<56320||o>57343?e?i.charAt(a):n:e?i.slice(a,a+2):o-56320+(n-55296<<10)+65536}},cn={codeAt:un(!1),charAt:un(!0)}.charAt,fn=Ue.set,sn=Ue.getterFor("String Iterator");jt(String,"String",(function(e){fn(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=sn(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=cn(r,n),t.index+=e.length,{value:e,done:!1})}));var ln=o.Promise,dn=function(e,t,r){for(var n in t)r&&r.unsafe&&e[n]?e[n]=t[n]:bt(e,n,t[n],r);return e},hn=Ye("species"),pn=function(e){var t=fe(e),r=M.f;a&&t&&!t[hn]&&r(t,hn,{configurable:!0,get:function(){return this}})},vn=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e},yn=Ye("iterator"),mn=Array.prototype,gn=Ye("iterator"),bn=function(e,t,r,n){try{return n?t(F(r)[0],r[1]):t(r)}catch(t){var o=e.return;throw void 0!==o&&F(o.call(e)),t}},wn=t((function(e){var t=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,r,n,o,i){var a,u,c,f,s,l,d,h,p=D(r,n,o?2:1);if(i)a=e;else{if("function"!=typeof(u=function(e){if(null!=e)return e[gn]||e["@@iterator"]||ye[lt(e)]}(e)))throw TypeError("Target is not iterable");if(void 0!==(h=u)&&(ye.Array===h||mn[yn]===h)){for(c=0,f=Q(e.length);f>c;c++)if((s=o?p(F(d=e[c])[0],d[1]):p(e[c]))&&s instanceof t)return s;return new t(!1)}a=u.call(e)}for(l=a.next;!(d=l.call(a)).done;)if("object"==typeof(s=bn(a,p,d.value,o))&&s&&s instanceof t)return s;return new t(!1)}).stop=function(e){return new t(!0,e)}})),Sn=Ye("iterator"),En=!1;try{var _n=0,jn={next:function(){return{done:!!_n++}},return:function(){En=!0}};jn[Sn]=function(){return this},Array.from(jn,(function(){throw 2}))}catch(e){}var On,xn,In,An=Ye("species"),Tn=function(e,t){var r,n=F(e).constructor;return void 0===n||null==(r=F(n)[An])?t:C(r)},Nn=/(iphone|ipod|ipad).*applewebkit/i.test(nr),kn=o.location,Rn=o.setImmediate,Ln=o.clearImmediate,Pn=o.process,Cn=o.MessageChannel,Dn=o.Dispatch,Fn=0,Bn={},Mn=function(e){if(Bn.hasOwnProperty(e)){var t=Bn[e];delete Bn[e],t()}},Un=function(e){return function(){Mn(e)}},zn=function(e){Mn(e.data)},qn=function(e){o.postMessage(e+"",kn.protocol+"//"+kn.host)};Rn&&Ln||(Rn=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return Bn[++Fn]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},On(Fn),Fn},Ln=function(e){delete Bn[e]},"process"==d(Pn)?On=function(e){Pn.nextTick(Un(e))}:Dn&&Dn.now?On=function(e){Dn.now(Un(e))}:Cn&&!Nn?(In=(xn=new Cn).port2,xn.port1.onmessage=zn,On=D(In.postMessage,In,1)):!o.addEventListener||"function"!=typeof postMessage||o.importScripts||i(qn)||"file:"===kn.protocol?On="onreadystatechange"in _("script")?function(e){tt.appendChild(_("script")).onreadystatechange=function(){tt.removeChild(this),Mn(e)}}:function(e){setTimeout(Un(e),0)}:(On=qn,o.addEventListener("message",zn,!1)));var Hn,Gn,Wn,Vn,Kn,Xn,Jn,Qn,Yn={set:Rn,clear:Ln},$n=x.f,Zn=Yn.set,eo=o.MutationObserver||o.WebKitMutationObserver,to=o.process,ro=o.Promise,no="process"==d(to),oo=$n(o,"queueMicrotask"),io=oo&&oo.value;io||(Hn=function(){var e,t;for(no&&(e=to.domain)&&e.exit();Gn;){t=Gn.fn,Gn=Gn.next;try{t()}catch(e){throw Gn?Vn():Wn=void 0,e}}Wn=void 0,e&&e.enter()},no?Vn=function(){to.nextTick(Hn)}:eo&&!Nn?(Kn=!0,Xn=document.createTextNode(""),new eo(Hn).observe(Xn,{characterData:!0}),Vn=function(){Xn.data=Kn=!Kn}):ro&&ro.resolve?(Jn=ro.resolve(void 0),Qn=Jn.then,Vn=function(){Qn.call(Jn,Hn)}):Vn=function(){Zn.call(o,Hn)});var ao,uo,co,fo=io||function(e){var t={fn:e,next:void 0};Wn&&(Wn.next=t),Gn||(Gn=t,Vn()),Wn=t},so=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=C(t),this.reject=C(r)},lo={f:function(e){return new so(e)}},ho=function(e,t){if(F(e),m(t)&&t.constructor===e)return t;var r=lo.f(e);return(0,r.resolve)(t),r.promise},po=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},vo=Yn.set,yo=Ye("species"),mo="Promise",go=Ue.get,bo=Ue.set,wo=Ue.getterFor(mo),So=ln,Eo=o.TypeError,_o=o.document,jo=o.process,Oo=(fe("fetch"),lo.f),xo=Oo,Io="process"==d(jo),Ao=!!(_o&&_o.createEvent&&o.dispatchEvent),To=L(mo,(function(){if(!(Ee(So)!==String(So))){if(66===ur)return!0;if(!Io&&"function"!=typeof PromiseRejectionEvent)return!0}if(!So.prototype.finally)return!0;if(ur>=51&&/native code/.test(So))return!1;var e=So.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[yo]=t,!(e.then((function(){}))instanceof t)})),No=To||!function(e,t){if(!t&&!En)return!1;var r=!1;try{var n={};n[Sn]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r}((function(e){So.all(e).catch((function(){}))})),ko=function(e){var t;return!(!m(e)||"function"!=typeof(t=e.then))&&t},Ro=function(e,t,r){if(!t.notified){t.notified=!0;var n=t.reactions;fo((function(){for(var o=t.value,i=1==t.state,a=0;n.length>a;){var u,c,f,s=n[a++],l=i?s.ok:s.fail,d=s.resolve,h=s.reject,p=s.domain;try{l?(i||(2===t.rejection&&Do(e,t),t.rejection=1),!0===l?u=o:(p&&p.enter(),u=l(o),p&&(p.exit(),f=!0)),u===s.promise?h(Eo("Promise-chain cycle")):(c=ko(u))?c.call(u,d,h):d(u)):h(o)}catch(e){p&&!f&&p.exit(),h(e)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&Po(e,t)}))}},Lo=function(e,t,r){var n,i;Ao?((n=_o.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),o.dispatchEvent(n)):n={promise:t,reason:r},(i=o["on"+e])?i(n):"unhandledrejection"===e&&function(e,t){var r=o.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}("Unhandled promise rejection",r)},Po=function(e,t){vo.call(o,(function(){var r,n=t.value;if(Co(t)&&(r=po((function(){Io?jo.emit("unhandledRejection",n,e):Lo("unhandledrejection",e,n)})),t.rejection=Io||Co(t)?2:1,r.error))throw r.value}))},Co=function(e){return 1!==e.rejection&&!e.parent},Do=function(e,t){vo.call(o,(function(){Io?jo.emit("rejectionHandled",e):Lo("rejectionhandled",e,t.value)}))},Fo=function(e,t,r,n){return function(o){e(t,r,o,n)}},Bo=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=2,Ro(e,t,!0))},Mo=function(e,t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(e===r)throw Eo("Promise can\'t be resolved itself");var o=ko(r);o?fo((function(){var n={done:!1};try{o.call(r,Fo(Mo,e,n,t),Fo(Bo,e,n,t))}catch(r){Bo(e,n,r,t)}})):(t.value=r,t.state=1,Ro(e,t,!1))}catch(r){Bo(e,{done:!1},r,t)}}};To&&(So=function(e){vn(this,So,mo),C(e),ao.call(this);var t=go(this);try{e(Fo(Mo,this,t),Fo(Bo,this,t))}catch(e){Bo(this,t,e)}},(ao=function(e){bo(this,{type:mo,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=dn(So.prototype,{then:function(e,t){var r=wo(this),n=Oo(Tn(this,So));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=Io?jo.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&Ro(this,r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),uo=function(){var e=new ao,t=go(e);this.promise=e,this.resolve=Fo(Mo,e,t),this.reject=Fo(Bo,e,t)},lo.f=Oo=function(e){return e===So||e===co?new uo(e):xo(e)}),H({global:!0,wrap:!0,forced:To},{Promise:So}),vt(So,mo,!1,!0),pn(mo),co=fe(mo),H({target:mo,stat:!0,forced:To},{reject:function(e){var t=Oo(this);return t.reject.call(void 0,e),t.promise}}),H({target:mo,stat:!0,forced:!0},{resolve:function(e){return ho(this===co?So:this,e)}}),H({target:mo,stat:!0,forced:No},{all:function(e){var t=this,r=Oo(t),n=r.resolve,o=r.reject,i=po((function(){var r=C(t.resolve),i=[],a=0,u=1;wn(e,(function(e){var c=a++,f=!1;i.push(void 0),u++,r.call(t,e).then((function(e){f||(f=!0,i[c]=e,--u||n(i))}),o)})),--u||n(i)}));return i.error&&o(i.value),r.promise},race:function(e)