UNPKG

mazey-wechat-launch-app

Version:
7 lines (6 loc) 34.3 kB
/*! * mazey-wechat-launch-app v2.3.6 https://www.npmjs.com/package/mazey-wechat-launch-app * (c) 2018-2025 Cheng * Released under the MIT License. */ import{genCustomConsole as t,addStyle as e,generateRndNum as n,getQueryParam as r}from"mazey";import o from"jquery";import i from"js-sha1";var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(t,e){return t(e={exports:{}},e.exports),e.exports}var u,s,f=function(t){return t&&t.Math===Math&&t},l=f("object"==typeof globalThis&&globalThis)||f("object"==typeof window&&window)||f("object"==typeof self&&self)||f("object"==typeof a&&a)||f("object"==typeof a&&a)||function(){return this}()||Function("return this")(),p=function(t){try{return!!t()}catch(t){return!0}},h=!p(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),d=!p(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}),v=Function.prototype.call,y=d?v.bind(v):function(){return v.apply(v,arguments)},g={}.propertyIsEnumerable,m=Object.getOwnPropertyDescriptor,w=m&&!g.call({1:2},1)?function(t){var e=m(this,t);return!!e&&e.enumerable}:g,b={f:w},S=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},O=Function.prototype,A=O.call,E=d&&O.bind.bind(A,A),P=d?E:function(t){return function(){return A.apply(t,arguments)}},T=P({}.toString),_=P("".slice),L=function(t){return _(T(t),8,-1)},j=Object,x=P("".split),C=p(function(){return!j("z").propertyIsEnumerable(0)})?function(t){return"String"===L(t)?x(t,""):j(t)}:j,I=function(t){return null==t},R=TypeError,k=function(t){if(I(t))throw new R("Can't call method on "+t);return t},N=function(t){return C(k(t))},M="object"==typeof document&&document.all,U=void 0===M&&void 0!==M?function(t){return"function"==typeof t||t===M}:function(t){return"function"==typeof t},D=function(t){return"object"==typeof t?null!==t:U(t)},B=function(t,e){return arguments.length<2?(n=l[t],U(n)?n:void 0):l[t]&&l[t][e];var n},H=P({}.isPrototypeOf),W=l.navigator,F=W&&W.userAgent,z=F?String(F):"",G=l.process,q=l.Deno,V=G&&G.versions||q&&q.version,X=V&&V.v8;X&&(s=(u=X.split("."))[0]>0&&u[0]<4?1:+(u[0]+u[1])),!s&&z&&(!(u=z.match(/Edge\/(\d+)/))||u[1]>=74)&&(u=z.match(/Chrome\/(\d+)/))&&(s=+u[1]);var J=s,Y=l.String,K=!!Object.getOwnPropertySymbols&&!p(function(){var t=Symbol("symbol detection");return!Y(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&J&&J<41}),Q=K&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,$=Object,Z=Q?function(t){return"symbol"==typeof t}:function(t){var e=B("Symbol");return U(e)&&H(e.prototype,$(t))},tt=String,et=function(t){try{return tt(t)}catch(t){return"Object"}},nt=TypeError,rt=function(t){if(U(t))return t;throw new nt(et(t)+" is not a function")},ot=function(t,e){var n=t[e];return I(n)?void 0:rt(n)},it=TypeError,at=Object.defineProperty,ct=function(t,e){try{at(l,t,{value:e,configurable:!0,writable:!0})}catch(n){l[t]=e}return e},ut=c(function(t){var e="__core-js_shared__",n=t.exports=l[e]||ct(e,{});(n.versions||(n.versions=[])).push({version:"3.45.0",mode:"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.45.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),st=function(t,e){return ut[t]||(ut[t]=e||{})},ft=Object,lt=function(t){return ft(k(t))},pt=P({}.hasOwnProperty),ht=Object.hasOwn||function(t,e){return pt(lt(t),e)},dt=0,vt=Math.random(),yt=P(1.1.toString),gt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+yt(++dt+vt,36)},mt=l.Symbol,wt=st("wks"),bt=Q?mt.for||mt:mt&&mt.withoutSetter||gt,St=function(t){return ht(wt,t)||(wt[t]=K&&ht(mt,t)?mt[t]:bt("Symbol."+t)),wt[t]},Ot=TypeError,At=St("toPrimitive"),Et=function(t,e){if(!D(t)||Z(t))return t;var n,r=ot(t,At);if(r){if(void 0===e&&(e="default"),n=y(r,t,e),!D(n)||Z(n))return n;throw new Ot("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var n,r;if("string"===e&&U(n=t.toString)&&!D(r=y(n,t)))return r;if(U(n=t.valueOf)&&!D(r=y(n,t)))return r;if("string"!==e&&U(n=t.toString)&&!D(r=y(n,t)))return r;throw new it("Can't convert object to primitive value")}(t,e)},Pt=function(t){var e=Et(t,"string");return Z(e)?e:e+""},Tt=l.document,_t=D(Tt)&&D(Tt.createElement),Lt=function(t){return _t?Tt.createElement(t):{}},jt=!h&&!p(function(){return 7!==Object.defineProperty(Lt("div"),"a",{get:function(){return 7}}).a}),xt=Object.getOwnPropertyDescriptor,Ct={f:h?xt:function(t,e){if(t=N(t),e=Pt(e),jt)try{return xt(t,e)}catch(t){}if(ht(t,e))return S(!y(b.f,t,e),t[e])}},It=h&&p(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),Rt=String,kt=TypeError,Nt=function(t){if(D(t))return t;throw new kt(Rt(t)+" is not an object")},Mt=TypeError,Ut=Object.defineProperty,Dt=Object.getOwnPropertyDescriptor,Bt="enumerable",Ht="configurable",Wt="writable",Ft={f:h?It?function(t,e,n){if(Nt(t),e=Pt(e),Nt(n),"function"==typeof t&&"prototype"===e&&"value"in n&&Wt in n&&!n[Wt]){var r=Dt(t,e);r&&r[Wt]&&(t[e]=n.value,n={configurable:Ht in n?n[Ht]:r[Ht],enumerable:Bt in n?n[Bt]:r[Bt],writable:!1})}return Ut(t,e,n)}:Ut:function(t,e,n){if(Nt(t),e=Pt(e),Nt(n),jt)try{return Ut(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new Mt("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},zt=h?function(t,e,n){return Ft.f(t,e,S(1,n))}:function(t,e,n){return t[e]=n,t},Gt=Function.prototype,qt=h&&Object.getOwnPropertyDescriptor,Vt=ht(Gt,"name"),Xt={EXISTS:Vt,PROPER:Vt&&"something"===function(){}.name,CONFIGURABLE:Vt&&(!h||h&&qt(Gt,"name").configurable)},Jt=P(Function.toString);U(ut.inspectSource)||(ut.inspectSource=function(t){return Jt(t)});var Yt,Kt,Qt,$t=ut.inspectSource,Zt=l.WeakMap,te=U(Zt)&&/native code/.test(String(Zt)),ee=st("keys"),ne=function(t){return ee[t]||(ee[t]=gt(t))},re={},oe="Object already initialized",ie=l.TypeError,ae=l.WeakMap;if(te||ut.state){var ce=ut.state||(ut.state=new ae);ce.get=ce.get,ce.has=ce.has,ce.set=ce.set,Yt=function(t,e){if(ce.has(t))throw new ie(oe);return e.facade=t,ce.set(t,e),e},Kt=function(t){return ce.get(t)||{}},Qt=function(t){return ce.has(t)}}else{var ue=ne("state");re[ue]=!0,Yt=function(t,e){if(ht(t,ue))throw new ie(oe);return e.facade=t,zt(t,ue,e),e},Kt=function(t){return ht(t,ue)?t[ue]:{}},Qt=function(t){return ht(t,ue)}}var se={set:Yt,get:Kt,has:Qt,enforce:function(t){return Qt(t)?Kt(t):Yt(t,{})},getterFor:function(t){return function(e){var n;if(!D(e)||(n=Kt(e)).type!==t)throw new ie("Incompatible receiver, "+t+" required");return n}}},fe=c(function(t){var e=Xt.CONFIGURABLE,n=se.enforce,r=se.get,o=String,i=Object.defineProperty,a=P("".slice),c=P("".replace),u=P([].join),s=h&&!p(function(){return 8!==i(function(){},"length",{value:8}).length}),f=String(String).split("String"),l=t.exports=function(t,r,l){"Symbol("===a(o(r),0,7)&&(r="["+c(o(r),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),l&&l.getter&&(r="get "+r),l&&l.setter&&(r="set "+r),(!ht(t,"name")||e&&t.name!==r)&&(h?i(t,"name",{value:r,configurable:!0}):t.name=r),s&&l&&ht(l,"arity")&&t.length!==l.arity&&i(t,"length",{value:l.arity});try{l&&ht(l,"constructor")&&l.constructor?h&&i(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var p=n(t);return ht(p,"source")||(p.source=u(f,"string"==typeof r?r:"")),t};Function.prototype.toString=l(function(){return U(this)&&r(this).source||$t(this)},"toString")}),le=function(t,e,n,r){r||(r={});var o=r.enumerable,i=void 0!==r.name?r.name:e;if(U(n)&&fe(n,i,r),r.global)o?t[e]=n:ct(e,n);else{try{r.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=n:Ft.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},pe=Math.ceil,he=Math.floor,de=Math.trunc||function(t){var e=+t;return(e>0?he:pe)(e)},ve=function(t){var e=+t;return e!=e||0===e?0:de(e)},ye=Math.max,ge=Math.min,me=Math.min,we=function(t){return e=t.length,(n=ve(e))>0?me(n,9007199254740991):0;var e,n},be=function(t){return function(e,n,r){var o=N(e),i=we(o);if(0===i)return!t&&-1;var a,c=function(t,e){var n=ve(t);return n<0?ye(n+e,0):ge(n,e)}(r,i);if(t&&n!=n){for(;i>c;)if((a=o[c++])!=a)return!0}else for(;i>c;c++)if((t||c in o)&&o[c]===n)return t||c||0;return!t&&-1}},Se={includes:be(!0),indexOf:be(!1)}.indexOf,Oe=P([].push),Ae=function(t,e){var n,r=N(t),o=0,i=[];for(n in r)!ht(re,n)&&ht(r,n)&&Oe(i,n);for(;e.length>o;)ht(r,n=e[o++])&&(~Se(i,n)||Oe(i,n));return i},Ee=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Pe=Ee.concat("length","prototype"),Te={f:Object.getOwnPropertyNames||function(t){return Ae(t,Pe)}},_e={f:Object.getOwnPropertySymbols},Le=P([].concat),je=B("Reflect","ownKeys")||function(t){var e=Te.f(Nt(t)),n=_e.f;return n?Le(e,n(t)):e},xe=function(t,e,n){for(var r=je(e),o=Ft.f,i=Ct.f,a=0;a<r.length;a++){var c=r[a];ht(t,c)||n&&ht(n,c)||o(t,c,i(e,c))}},Ce=/#|\.prototype\./,Ie=function(t,e){var n=ke[Re(t)];return n===Me||n!==Ne&&(U(e)?p(e):!!e)},Re=Ie.normalize=function(t){return String(t).replace(Ce,".").toLowerCase()},ke=Ie.data={},Ne=Ie.NATIVE="N",Me=Ie.POLYFILL="P",Ue=Ie,De=Ct.f,Be=function(t,e){var n,r,o,i,a,c=t.target,u=t.global,s=t.stat;if(n=u?l:s?l[c]||ct(c,{}):l[c]&&l[c].prototype)for(r in e){if(i=e[r],o=t.dontCallGetSet?(a=De(n,r))&&a.value:n[r],!Ue(u?r:c+(s?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;xe(i,o)}(t.sham||o&&o.sham)&&zt(i,"sham",!0),le(n,r,i,t)}},He=Array.isArray||function(t){return"Array"===L(t)},We=TypeError,Fe=function(t){if(t>9007199254740991)throw We("Maximum allowed index exceeded");return t},ze=function(t,e,n){h?Ft.f(t,e,S(0,n)):t[e]=n},Ge={};Ge[St("toStringTag")]="z";var qe="[object z]"===String(Ge),Ve=St("toStringTag"),Xe=Object,Je="Arguments"===L(function(){return arguments}()),Ye=qe?L:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Xe(t),Ve))?n:Je?L(e):"Object"===(r=L(e))&&U(e.callee)?"Arguments":r},Ke=function(){},Qe=B("Reflect","construct"),$e=/^\s*(?:class|function)\b/,Ze=P($e.exec),tn=!$e.test(Ke),en=function(t){if(!U(t))return!1;try{return Qe(Ke,[],t),!0}catch(t){return!1}},nn=function(t){if(!U(t))return!1;switch(Ye(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return tn||!!Ze($e,$t(t))}catch(t){return!0}};nn.sham=!0;var rn,on=!Qe||p(function(){var t;return en(en.call)||!en(Object)||!en(function(){t=!0})||t})?nn:en,an=St("species"),cn=Array,un=function(t,e){return new(function(t){var e;return He(t)&&(e=t.constructor,(on(e)&&(e===cn||He(e.prototype))||D(e)&&null===(e=e[an]))&&(e=void 0)),void 0===e?cn:e}(t))(0===e?0:e)},sn=St("species"),fn=St("isConcatSpreadable"),ln=J>=51||!p(function(){var t=[];return t[fn]=!1,t.concat()[0]!==t}),pn=function(t){if(!D(t))return!1;var e=t[fn];return void 0!==e?!!e:He(t)},hn=!(ln&&(rn="concat",J>=51||!p(function(){var t=[];return(t.constructor={})[sn]=function(){return{foo:1}},1!==t[rn](Boolean).foo})));Be({target:"Array",proto:!0,arity:1,forced:hn},{concat:function(t){var e,n,r,o,i,a=lt(this),c=un(a,0),u=0;for(e=-1,r=arguments.length;e<r;e++)if(pn(i=-1===e?a:arguments[e]))for(o=we(i),Fe(u+o),n=0;n<o;n++,u++)n in i&&ze(c,u,i[n]);else Fe(u+1),ze(c,u++,i);return c.length=u,c}});var dn,vn=Object.keys||function(t){return Ae(t,Ee)},yn=h&&!It?Object.defineProperties:function(t,e){Nt(t);for(var n,r=N(e),o=vn(e),i=o.length,a=0;i>a;)Ft.f(t,n=o[a++],r[n]);return t},gn={f:yn},mn=B("document","documentElement"),wn="prototype",bn="script",Sn=ne("IE_PROTO"),On=function(){},An=function(t){return"<"+bn+">"+t+"</"+bn+">"},En=function(t){t.write(An("")),t.close();var e=t.parentWindow.Object;return t=null,e},Pn=function(){try{dn=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;Pn="undefined"!=typeof document?document.domain&&dn?En(dn):(e=Lt("iframe"),n="java"+bn+":",e.style.display="none",mn.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(An("document.F=Object")),t.close(),t.F):En(dn);for(var r=Ee.length;r--;)delete Pn[wn][Ee[r]];return Pn()};re[Sn]=!0;var Tn=Object.create||function(t,e){var n;return null!==t?(On[wn]=Nt(t),n=new On,On[wn]=null,n[Sn]=t):n=Pn(),void 0===e?n:gn.f(n,e)},_n=Ft.f,Ln=St("unscopables"),jn=Array.prototype;void 0===jn[Ln]&&_n(jn,Ln,{configurable:!0,value:Tn(null)});var xn,Cn,In,Rn=function(t){jn[Ln][t]=!0},kn={},Nn=!p(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),Mn=ne("IE_PROTO"),Un=Object,Dn=Un.prototype,Bn=Nn?Un.getPrototypeOf:function(t){var e=lt(t);if(ht(e,Mn))return e[Mn];var n=e.constructor;return U(n)&&e instanceof n?n.prototype:e instanceof Un?Dn:null},Hn=St("iterator"),Wn=!1;[].keys&&("next"in(In=[].keys())?(Cn=Bn(Bn(In)))!==Object.prototype&&(xn=Cn):Wn=!0);var Fn=!D(xn)||p(function(){var t={};return xn[Hn].call(t)!==t});Fn&&(xn={}),U(xn[Hn])||le(xn,Hn,function(){return this});var zn={IteratorPrototype:xn,BUGGY_SAFARI_ITERATORS:Wn},Gn=Ft.f,qn=St("toStringTag"),Vn=function(t,e,n){t&&!n&&(t=t.prototype),t&&!ht(t,qn)&&Gn(t,qn,{configurable:!0,value:e})},Xn=zn.IteratorPrototype,Jn=function(){return this},Yn=String,Kn=TypeError,Qn=function(t){if(function(t){return D(t)||null===t}(t))return t;throw new Kn("Can't set "+Yn(t)+" as a prototype")},$n=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=function(t,e,n){try{return P(rt(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}}(Object.prototype,"__proto__","set"),t(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return k(n),Qn(r),D(n)?(e?t(n,r):n.__proto__=r,n):n}}():void 0),Zn=Xt.PROPER,tr=Xt.CONFIGURABLE,er=zn.IteratorPrototype,nr=zn.BUGGY_SAFARI_ITERATORS,rr=St("iterator"),or="keys",ir="values",ar="entries",cr=function(){return this},ur=function(t,e,n,r,o,i,a){!function(t,e,n,r){var o=e+" Iterator";t.prototype=Tn(Xn,{next:S(+!r,n)}),Vn(t,o,!1),kn[o]=Jn}(n,e,r);var c,u,s,f=function(t){if(t===o&&v)return v;if(!nr&&t&&t in h)return h[t];switch(t){case or:case ir:case ar:return function(){return new n(this,t)}}return function(){return new n(this)}},l=e+" Iterator",p=!1,h=t.prototype,d=h[rr]||h["@@iterator"]||o&&h[o],v=!nr&&d||f(o),g="Array"===e&&h.entries||d;if(g&&(c=Bn(g.call(new t)))!==Object.prototype&&c.next&&(Bn(c)!==er&&($n?$n(c,er):U(c[rr])||le(c,rr,cr)),Vn(c,l,!0)),Zn&&o===ir&&d&&d.name!==ir&&(tr?zt(h,"name",ir):(p=!0,v=function(){return y(d,this)})),o)if(u={values:f(ir),keys:i?v:f(or),entries:f(ar)},a)for(s in u)(nr||p||!(s in h))&&le(h,s,u[s]);else Be({target:e,proto:!0,forced:nr||p},u);return h[rr]!==v&&le(h,rr,v,{name:o}),kn[e]=v,u},sr=function(t,e){return{value:t,done:e}},fr=Ft.f,lr="Array Iterator",pr=se.set,hr=se.getterFor(lr),dr=ur(Array,"Array",function(t,e){pr(this,{type:lr,target:N(t),index:0,kind:e})},function(){var t=hr(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=null,sr(void 0,!0);switch(t.kind){case"keys":return sr(n,!1);case"values":return sr(e[n],!1)}return sr([n,e[n]],!1)},"values"),vr=kn.Arguments=kn.Array;if(Rn("keys"),Rn("values"),Rn("entries"),h&&"values"!==vr.name)try{fr(vr,"name",{value:"values"})}catch(t){}var yr=Object.assign,gr=Object.defineProperty,mr=P([].concat),wr=!yr||p(function(){if(h&&1!==yr({b:1},yr(gr({},"a",{enumerable:!0,get:function(){gr(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol("assign detection"),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!==yr({},t)[n]||vn(yr({},e)).join("")!==r})?function(t,e){for(var n=lt(t),r=arguments.length,o=1,i=_e.f,a=b.f;r>o;)for(var c,u=C(arguments[o++]),s=i?mr(vn(u),i(u)):vn(u),f=s.length,l=0;f>l;)c=s[l++],h&&!y(a,u,c)||(n[c]=u[c]);return n}:yr;Be({target:"Object",stat:!0,arity:2,forced:Object.assign!==wr},{assign:wr});var br=qe?{}.toString:function(){return"[object "+Ye(this)+"]"};qe||le(Object.prototype,"toString",br,{unsafe:!0});var Sr,Or,Ar,Er,Pr=function(t){return z.slice(0,t.length)===t},Tr=Pr("Bun/")?"BUN":Pr("Cloudflare-Workers")?"CLOUDFLARE":Pr("Deno/")?"DENO":Pr("Node.js/")?"NODE":l.Bun&&"string"==typeof Bun.version?"BUN":l.Deno&&"object"==typeof Deno.version?"DENO":"process"===L(l.process)?"NODE":l.window&&l.document?"BROWSER":"REST",_r="NODE"===Tr,Lr=l,jr=St("species"),xr=TypeError,Cr=TypeError,Ir=St("species"),Rr=function(t,e){var n,r=Nt(t).constructor;return void 0===r||I(n=Nt(r)[Ir])?e:function(t){if(on(t))return t;throw new Cr(et(t)+" is not a constructor")}(n)},kr=Function.prototype,Nr=kr.apply,Mr=kr.call,Ur="object"==typeof Reflect&&Reflect.apply||(d?Mr.bind(Nr):function(){return Mr.apply(Nr,arguments)}),Dr=function(t){if("Function"===L(t))return P(t)},Br=Dr(Dr.bind),Hr=function(t,e){return rt(t),void 0===e?t:d?Br(t,e):function(){return t.apply(e,arguments)}},Wr=P([].slice),Fr=TypeError,zr=/(?:ipad|iphone|ipod).*applewebkit/i.test(z),Gr=l.setImmediate,qr=l.clearImmediate,Vr=l.process,Xr=l.Dispatch,Jr=l.Function,Yr=l.MessageChannel,Kr=l.String,Qr=0,$r={},Zr="onreadystatechange";p(function(){Sr=l.location});var to=function(t){if(ht($r,t)){var e=$r[t];delete $r[t],e()}},eo=function(t){return function(){to(t)}},no=function(t){to(t.data)},ro=function(t){l.postMessage(Kr(t),Sr.protocol+"//"+Sr.host)};Gr&&qr||(Gr=function(t){!function(t,e){if(t<e)throw new Fr("Not enough arguments")}(arguments.length,1);var e=U(t)?t:Jr(t),n=Wr(arguments,1);return $r[++Qr]=function(){Ur(e,void 0,n)},Or(Qr),Qr},qr=function(t){delete $r[t]},_r?Or=function(t){Vr.nextTick(eo(t))}:Xr&&Xr.now?Or=function(t){Xr.now(eo(t))}:Yr&&!zr?(Er=(Ar=new Yr).port2,Ar.port1.onmessage=no,Or=Hr(Er.postMessage,Er)):l.addEventListener&&U(l.postMessage)&&!l.importScripts&&Sr&&"file:"!==Sr.protocol&&!p(ro)?(Or=ro,l.addEventListener("message",no,!1)):Or=Zr in Lt("script")?function(t){mn.appendChild(Lt("script"))[Zr]=function(){mn.removeChild(this),to(t)}}:function(t){setTimeout(eo(t),0)});var oo={set:Gr,clear:qr},io=Object.getOwnPropertyDescriptor,ao=function(){this.head=null,this.tail=null};ao.prototype={add:function(t){var e={item:t,next:null},n=this.tail;n?n.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}};var co,uo,so,fo,lo,po=ao,ho=/ipad|iphone|ipod/i.test(z)&&"undefined"!=typeof Pebble,vo=/web0s(?!.*chrome)/i.test(z),yo=oo.set,go=l.MutationObserver||l.WebKitMutationObserver,mo=l.document,wo=l.process,bo=l.Promise,So=function(t){if(!h)return l[t];var e=io(l,t);return e&&e.value}("queueMicrotask");if(!So){var Oo=new po,Ao=function(){var t,e;for(_r&&(t=wo.domain)&&t.exit();e=Oo.get();)try{e()}catch(t){throw Oo.head&&co(),t}t&&t.enter()};zr||_r||vo||!go||!mo?!ho&&bo&&bo.resolve?((fo=bo.resolve(void 0)).constructor=bo,lo=Hr(fo.then,fo),co=function(){lo(Ao)}):_r?co=function(){wo.nextTick(Ao)}:(yo=Hr(yo,l),co=function(){yo(Ao)}):(uo=!0,so=mo.createTextNode(""),new go(Ao).observe(so,{characterData:!0}),co=function(){so.data=uo=!uo}),So=function(t){Oo.head||co(),Oo.add(t)}}var Eo=So,Po=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},To=l.Promise;To&&To.prototype;var _o,Lo,jo,xo,Co,Io,Ro,ko,No=St("species"),Mo=!1,Uo=U(l.PromiseRejectionEvent),Do=Ue("Promise",function(){var t=$t(To),e=t!==String(To);if(!e&&66===J)return!0;if(!J||J<51||!/native code/.test(t)){var n=new To(function(t){t(1)}),r=function(t){t(function(){},function(){})};if((n.constructor={})[No]=r,!(Mo=n.then(function(){})instanceof r))return!0}return!(e||"BROWSER"!==Tr&&"DENO"!==Tr||Uo)}),Bo={CONSTRUCTOR:Do,REJECTION_EVENT:Uo,SUBCLASSING:Mo},Ho=TypeError,Wo=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw new Ho("Bad Promise constructor");e=t,n=r}),this.resolve=rt(e),this.reject=rt(n)},Fo={f:function(t){return new Wo(t)}},zo=oo.set,Go="Promise",qo=Bo.CONSTRUCTOR,Vo=Bo.REJECTION_EVENT,Xo=Bo.SUBCLASSING,Jo=se.getterFor(Go),Yo=se.set,Ko=To&&To.prototype,Qo=To,$o=Ko,Zo=l.TypeError,ti=l.document,ei=l.process,ni=Fo.f,ri=ni,oi=!!(ti&&ti.createEvent&&l.dispatchEvent),ii="unhandledrejection",ai=function(t){var e;return!(!D(t)||!U(e=t.then))&&e},ci=function(t,e){var n,r,o,i=e.value,a=1===e.state,c=a?t.ok:t.fail,u=t.resolve,s=t.reject,f=t.domain;try{c?(a||(2===e.rejection&&pi(e),e.rejection=1),!0===c?n=i:(f&&f.enter(),n=c(i),f&&(f.exit(),o=!0)),n===t.promise?s(new Zo("Promise-chain cycle")):(r=ai(n))?y(r,n,u,s):u(n)):s(i)}catch(t){f&&!o&&f.exit(),s(t)}},ui=function(t,e){t.notified||(t.notified=!0,Eo(function(){for(var n,r=t.reactions;n=r.get();)ci(n,t);t.notified=!1,e&&!t.rejection&&fi(t)}))},si=function(t,e,n){var r,o;oi?((r=ti.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),l.dispatchEvent(r)):r={promise:e,reason:n},!Vo&&(o=l["on"+t])?o(r):t===ii&&function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}}("Unhandled promise rejection",n)},fi=function(t){y(zo,l,function(){var e,n=t.facade,r=t.value;if(li(t)&&(e=Po(function(){_r?ei.emit("unhandledRejection",r,n):si(ii,n,r)}),t.rejection=_r||li(t)?2:1,e.error))throw e.value})},li=function(t){return 1!==t.rejection&&!t.parent},pi=function(t){y(zo,l,function(){var e=t.facade;_r?ei.emit("rejectionHandled",e):si("rejectionhandled",e,t.value)})},hi=function(t,e,n){return function(r){t(e,r,n)}},di=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,ui(t,!0))},vi=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw new Zo("Promise can't be resolved itself");var r=ai(e);r?Eo(function(){var n={done:!1};try{y(r,e,hi(vi,n,t),hi(di,n,t))}catch(e){di(n,e,t)}}):(t.value=e,t.state=1,ui(t,!1))}catch(e){di({done:!1},e,t)}}};if(qo&&($o=(Qo=function(t){!function(t,e){if(H(e,t))return t;throw new xr("Incorrect invocation")}(this,$o),rt(t),y(_o,this);var e=Jo(this);try{t(hi(vi,e),hi(di,e))}catch(t){di(e,t)}}).prototype,(_o=function(t){Yo(this,{type:Go,done:!1,notified:!1,parent:!1,reactions:new po,rejection:!1,state:0,value:null})}).prototype=le($o,"then",function(t,e){var n=Jo(this),r=ni(Rr(this,Qo));return n.parent=!0,r.ok=!U(t)||t,r.fail=U(e)&&e,r.domain=_r?ei.domain:void 0,0===n.state?n.reactions.add(r):Eo(function(){ci(r,n)}),r.promise}),Lo=function(){var t=new _o,e=Jo(t);this.promise=t,this.resolve=hi(vi,e),this.reject=hi(di,e)},Fo.f=ni=function(t){return t===Qo||t===jo?new Lo(t):ri(t)},U(To)&&Ko!==Object.prototype)){xo=Ko.then,Xo||le(Ko,"then",function(t,e){var n=this;return new Qo(function(t,e){y(xo,n,t,e)}).then(t,e)},{unsafe:!0});try{delete Ko.constructor}catch(t){}$n&&$n(Ko,$o)}Be({global:!0,constructor:!0,wrap:!0,forced:qo},{Promise:Qo}),jo=Lr.Promise,Vn(Qo,Go,!1),ko=B(Go),h&&ko&&!ko[jr]&&(Co=ko,Io=jr,(Ro={configurable:!0,get:function(){return this}}).get&&fe(Ro.get,Io,{getter:!0}),Ro.set&&fe(Ro.set,Io,{setter:!0}),Ft.f(Co,Io,Ro));var yi=St("iterator"),gi=Array.prototype,mi=St("iterator"),wi=function(t){if(!I(t))return ot(t,mi)||ot(t,"@@iterator")||kn[Ye(t)]},bi=TypeError,Si=function(t,e,n){var r,o;Nt(t);try{if(!(r=ot(t,"return"))){if("throw"===e)throw n;return n}r=y(r,t)}catch(t){o=!0,r=t}if("throw"===e)throw n;if(o)throw r;return Nt(r),n},Oi=TypeError,Ai=function(t,e){this.stopped=t,this.result=e},Ei=Ai.prototype,Pi=function(t,e,n){var r,o,i,a,c,u,s,f,l=n&&n.that,p=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_RECORD),d=!(!n||!n.IS_ITERATOR),v=!(!n||!n.INTERRUPTED),g=Hr(e,l),m=function(t){return r&&Si(r,"normal"),new Ai(!0,t)},w=function(t){return p?(Nt(t),v?g(t[0],t[1],m):g(t[0],t[1])):v?g(t,m):g(t)};if(h)r=t.iterator;else if(d)r=t;else{if(!(o=wi(t)))throw new Oi(et(t)+" is not iterable");if(void 0!==(f=o)&&(kn.Array===f||gi[yi]===f)){for(i=0,a=we(t);a>i;i++)if((c=w(t[i]))&&H(Ei,c))return c;return new Ai(!1)}r=function(t,e){var n=arguments.length<2?wi(t):e;if(rt(n))return Nt(y(n,t));throw new bi(et(t)+" is not iterable")}(t,o)}for(u=h?t.next:r.next;!(s=y(u,r)).done;){try{c=w(s.value)}catch(t){Si(r,"throw",t)}if("object"==typeof c&&c&&H(Ei,c))return c}return new Ai(!1)},Ti=St("iterator"),_i=!1;try{var Li=0,ji={next:function(){return{done:!!Li++}},return:function(){_i=!0}};ji[Ti]=function(){return this},Array.from(ji,function(){throw 2})}catch(t){}var xi=Bo.CONSTRUCTOR||!function(t,e){try{if(!e&&!_i)return!1}catch(t){return!1}var n=!1;try{var r={};r[Ti]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}(function(t){To.all(t).then(void 0,function(){})});Be({target:"Promise",stat:!0,forced:xi},{all:function(t){var e=this,n=Fo.f(e),r=n.resolve,o=n.reject,i=Po(function(){var n=rt(e.resolve),i=[],a=0,c=1;Pi(t,function(t){var u=a++,s=!1;c++,y(n,e,t).then(function(t){s||(s=!0,i[u]=t,--c||r(i))},o)}),--c||r(i)});return i.error&&o(i.value),n.promise}});var Ci=Bo.CONSTRUCTOR,Ii=To&&To.prototype;if(Be({target:"Promise",proto:!0,forced:Ci,real:!0},{catch:function(t){return this.then(void 0,t)}}),U(To)){var Ri=B("Promise").prototype.catch;Ii.catch!==Ri&&le(Ii,"catch",Ri,{unsafe:!0})}Be({target:"Promise",stat:!0,forced:xi},{race:function(t){var e=this,n=Fo.f(e),r=n.reject,o=Po(function(){var o=rt(e.resolve);Pi(t,function(t){y(o,e,t).then(n.resolve,r)})});return o.error&&r(o.value),n.promise}}),Be({target:"Promise",stat:!0,forced:Bo.CONSTRUCTOR},{reject:function(t){var e=Fo.f(this);return(0,e.reject)(t),e.promise}});var ki=Bo.CONSTRUCTOR;B("Promise"),Be({target:"Promise",stat:!0,forced:ki},{resolve:function(t){return function(t,e){if(Nt(t),D(e)&&e.constructor===t)return e;var n=Fo.f(t);return(0,n.resolve)(e),n.promise}(this,t)}});var Ni=String,Mi=function(t){if("Symbol"===Ye(t))throw new TypeError("Cannot convert a Symbol value to a string");return Ni(t)},Ui=P("".charAt),Di=P("".charCodeAt),Bi=P("".slice),Hi=function(t){return function(e,n){var r,o,i=Mi(k(e)),a=ve(n),c=i.length;return a<0||a>=c?t?"":void 0:(r=Di(i,a))<55296||r>56319||a+1===c||(o=Di(i,a+1))<56320||o>57343?t?Ui(i,a):r:t?Bi(i,a,a+2):o-56320+(r-55296<<10)+65536}},Wi={codeAt:Hi(!1),charAt:Hi(!0)}.charAt,Fi="String Iterator",zi=se.set,Gi=se.getterFor(Fi);ur(String,"String",function(t){zi(this,{type:Fi,string:Mi(t),index:0})},function(){var t,e=Gi(this),n=e.string,r=e.index;return r>=n.length?sr(void 0,!0):(t=Wi(n,r),e.index+=t.length,sr(t,!1))});var qi={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},Vi=Lt("span").classList,Xi=Vi&&Vi.constructor&&Vi.constructor.prototype,Ji=Xi===Object.prototype?void 0:Xi,Yi=St("iterator"),Ki=dr.values,Qi=function(t,e){if(t){if(t[Yi]!==Ki)try{zt(t,Yi,Ki)}catch(e){t[Yi]=Ki}if(Vn(t,e,!0),qi[e])for(var n in dr)if(t[n]!==dr[n])try{zt(t,n,dr[n])}catch(e){t[n]=dr[n]}}};for(var $i in qi)Qi(l[$i]&&l[$i].prototype,$i);Qi(Ji,"DOMTokenList");var Zi=function(){return Zi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Zi.apply(this,arguments)},ta={weixinJsSdkTicket:"",launchContainerQuery:".mazey-launch-app-selector",launchShowWeixinToBrowserImgUrl:"",canShowWeixinToBrowser:!1,extInfo:"",serviceAccountAppId:"",wexinServiceAccountAppId:"",openPlatformMobileAppId:"",genTagPrefixStr:"mazey-launch-app-btn-prefix-",launchShowWeixinToBrowserClassName:"mazey-launch-app-wx-to-browser",launchBtnClassName:"mazey-launch-app-inner-btn",launchBtnStyle:"",launchBtnText:"Launch App <br /><br /><br />",launchErrorLink:"",canContinuousUpdating:!1,onMenuShareTimelineOptions:void 0,onMenuShareAppMessageOptions:void 0,isConClosed:!0,isWxDebug:!1,openTagList:["wx-open-launch-app"],canLaunchApp:function(){return!0},canFireErrorLinkDirectly:function(){return!1},launchBtnClick:function(){},launchReady:function(){}},ea=function(a){void 0===a&&(a=ta);var c=Object.assign(ta,a),u=c.weixinJsSdkTicket,s=c.launchContainerQuery,f=c.genTagPrefixStr,l=c.launchShowWeixinToBrowserImgUrl,p=c.canShowWeixinToBrowser,h=c.launchShowWeixinToBrowserClassName,d=c.launchBtnClassName,v=c.launchBtnStyle,y=c.launchBtnText,g=c.launchErrorLink,m=c.wexinServiceAccountAppId,w=c.openPlatformMobileAppId,b=c.canContinuousUpdating,S=c.onMenuShareTimelineOptions,O=c.onMenuShareAppMessageOptions,A=c.isConClosed,E=c.isWxDebug,P=c.openTagList,T=c.canLaunchApp,_=c.canFireErrorLinkDirectly,L=c.launchBtnClick,j=c.launchReady,x=c.serviceAccountAppId,C=c.extInfo,I=t("LaunchCon:",{isClosed:A}),R=window.wx;R||console.error("Launch App: wx is not found");var k=function(){};I.log("Launch App");var N={title:"",link:"",imgUrl:"",success:function(){},cancel:function(){}},M={title:"",desc:"",link:"",imgUrl:"",type:"",dataUrl:"",success:function(){},cancel:function(){}},U={title:document.title,link:location.href};N=Zi(Zi({},N),U),M=Zi(Zi({},M),U);var D=function(t,e,n){return void 0===t&&(t=""),void 0===e&&(e=""),void 0===n&&(n="button"),"<style>.".concat(d,"{")+"opacity: 0;width: 100%;height: 100%;backgroud: transparent;color: #300f54;border: none;box-sizing: border-box;text-align: center;vertical-align: middle;"+v+e+"}</style>"+"<".concat(n,' class="').concat(d,'"')+(t&&"button"===n?' onclick="'.concat(t,'"'):"")+(t&&"a"===n?' target="_self" href="'.concat(t,'"'):"")+">"+y+"</".concat(n,">")},B=D();function H(){e('.mazey-launch-app-mask{position:fixed;top:0;right:0;bottom:0;left:0;background-color:rgba(0, 0, 0, .5);text-align:right;font-size:0;white-space:nowrap;overflow:auto;z-index:999;}.mazey-launch-app-img{display:inline-block;vertical-align:middle;text-align:left;font-size:14px;white-space:normal;width:50vw;margin:0.5rem 0.5rem 0 0;}.mazey-launch-app-img:after{content:"";display:inline-block;height:100%;vertical-align:middle;}',{id:"mazey-launch-app-mask-style"}),window.LAUNCH_APP_HIDE_WEIXIN_BROWSER||(window.LAUNCH_APP_HIDE_WEIXIN_BROWSER=function(){o(".mazey-launch-app-mask").hide()}),0===o(".mazey-launch-app-mask").length?o("body").append("<div class='mazey-launch-app-mask' onclick='window.LAUNCH_APP_HIDE_WEIXIN_BROWSER()'><img "+"class='mazey-launch-app-img ".concat(h,"' ")+"src='".concat(l,"' ")+"alt='Launch App' /></div>"):o(".mazey-launch-app-mask").show()}function W(){I.log("renderWeixinLaunchTemplate"),!x&&m&&(console.warn("wexinServiceAccountAppId will be deprecated, use serviceAccountAppId instead."),x=m),function(t,e){void 0===t&&(t=""),void 0===e&&(e=""),I.log("renderWXOpenLaunchApp"),Promise.all([Promise.resolve(u||window.LAUNCH_APP_WEIXIN_JS_SDK_TICKET||r("weixinJsSdkTicket")||""),Promise.resolve(i)]).then(function(r){I.log("allRes",r);var i=r[0];if(i){var a=r[1];if(a){var c=n(7),u=i,l=(new Date).getTime(),h=a("jsapi_ticket="+u+"&noncestr="+c+"&timestamp="+l+"&url="+location.href);return R.config({debug:E,appId:t,timestamp:l,nonceStr:c,signature:h,jsApiList:["showOptionMenu","onMenuShareTimeline","onMenuShareAppMessage"],openTagList:P}),R.ready(function(){if(O&&(I.log("onMenuShareAppMessageOptions",O),R.onMenuShareAppMessage(O)),window.LAUNCH_APP_SHARE_APP_MESSAGE=function(t){t=Zi(Zi({},M),t),I.log("window LAUNCH_APP_SHARE_APP_MESSAGE",t),R.onMenuShareAppMessage(t)},S&&(I.log("onMenuShareTimelineOptions",S),R.onMenuShareTimeline(S)),window.LAUNCH_APP_SHARE_TIMELINE=function(t){t=Zi(Zi({},N),t),I.log("window LAUNCH_APP_SHARE_TIMELINE",t),R.onMenuShareTimeline(t)},e){window.LAUNCH_APP_READY=!0,j&&j();var t=function(){var t=o(s);I.log("containers",s,t,t.length),t.length>0&&t.each(function(t,n){var r=o(n).attr("data-launch-app-key");if(!r){var i=o(n).parents("[data-launch-app-key]:eq(0)");i.length>0&&(r=i.attr("data-launch-app-key"),I.log("keyEle",i,r))}r||(r=String(t));var a="mazey-launch-app-tag-".concat(r),c=o(".".concat(a," wx-open-launch-app")),u=o(n).attr("data-launch-app-ext-info");if(!u){var s=o(n).parents("[data-launch-app-ext-info]:eq(0)");s.length>0&&(u=s.attr("data-launch-app-ext-info"),I.log("eleExtInfoEle parents",s,u))}u&&(C=u);var l=o(n).attr("data-launch-app-error-link");if(!l){var h=o(n).parents("[data-launch-app-error-link]:eq(0)");h.length>0&&(l=h.attr("data-launch-app-error-link"),I.log("eleErrorLinkEle parents",h,l))}var d=g;l&&(d=l),0===c.length&&(o(n).addClass(a),I.log("success:",a),function(t){var n=f,r=n+t,i="<wx-open-launch-app id='"+r+"' appid='"+e+"' extinfo='".concat(C)+"' style='z-index:99;position:absolute;width:100%;height:100%;opacity:1;background:transparent;overflow:hidden;left:0;'><script type='text/wxtag-template'>"+B+"<\/script></wx-open-launch-app>";o("."+t+":eq(0)").append(i);var a=document.getElementById(r);a&&(a.addEventListener("ready",function(t){I.log("ready event",t)}),a.addEventListener("launch",function(t){I.log("launch event",t),t.detail&&t.detail.extInfo&&I.log("launch extInfo",t.detail.extInfo)}),a.addEventListener("error",function(t){I.error(t.detail),o("[id^='"+n+"']").hide(),p&&H(),d&&(I.log("realErrorLink",d),location.href=d)}),a.addEventListener("click",function(t){I.log("click event",t),L&&L()}))}(a))})};t(),k=t}else I.log("openPlatformMobileAppId is required for weixin launch app")}),R.error(function(t){I.error(t)}),"success:launch_app"}I.error("sha1 is required")}else I.error("weixinJsSdkTicket is required")}).catch(function(t){I.error(t)})}(x,w)}function F(t){if(void 0===t&&(t={}),I.log("appUpdated",t),!window.LAUNCH_APP_LOAD&&T(t)&&(W(),window.LAUNCH_APP_LOAD=!0),b&&window.LAUNCH_APP_LOAD&&T(t)&&k(),_()){var e=o(s);e.length>0&&e.each(function(t,e){var n=o(e).children("."+d);if(!n||!n.length){var r=o(e).attr("data-launch-app-error-link");if(!r){var i=o(e).parents("[data-launch-app-error-link]:eq(0)");i.length>0&&(r=i.attr("data-launch-app-error-link"))}if(r&&"string"==typeof r&&r.length){var a=D(r,"position:absolute;left:0;z-index:999;","a");o(e).append(a)}}})}}function z(){I.log("appBeforeDestroy",z),window.LAUNCH_APP_LOAD=null,window.LAUNCH_APP_HIDE_WEIXIN_BROWSER=null}return window.LAUNCH_APP_UPDATE=F,window.LAUNCH_APP_BEFORE_DESTROY=z,window.LAUNCH_APP_SHOW_WEIXIN_TO_BROWSER=H,{LAUNCH_APP_UPDATE:F,LAUNCH_APP_BEFORE_DESTROY:z,LAUNCH_APP_SHOW_WEIXIN_TO_BROWSER:H,LAUNCH_APP_SHARE_TIMELINE:function(t){I.log("opt",t)},LAUNCH_APP_SHARE_APP_MESSAGE:function(t){I.log("opt",t)},start:F,update:F,destroy:z}};export{ea as default};