@bi-nova/services 2.0.0-beta.202610211621 → 2.0.0-beta.202610211744
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +98 -2
- package/dist/index.d.ts +98 -2
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var gn=Object.defineProperty,Oo=Object.defineProperties,Lo=Object.getOwnPropertyDescriptor,Fo=Object.getOwnPropertyDescriptors,xo=Object.getOwnPropertyNames,Nr=Object.getOwnPropertySymbols;var wr=Object.prototype.hasOwnProperty,Uo=Object.prototype.propertyIsEnumerable;var Vn=(t,e,n)=>e in t?gn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,L=(t,e)=>{for(var n in e||(e={}))wr.call(e,n)&&Vn(t,n,e[n]);if(Nr)for(var n of Nr(e))Uo.call(e,n)&&Vn(t,n,e[n]);return t},Dt=(t,e)=>Oo(t,Fo(e));var Vo=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),qe=(t,e)=>{for(var n in e)gn(t,n,{get:e[n],enumerable:!0})},Yo=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of xo(e))!wr.call(t,s)&&s!==n&&gn(t,s,{get:()=>e[s],enumerable:!(a=Lo(e,s))||a.enumerable});return t};var Mo=t=>Yo(gn({},"__esModule",{value:!0}),t);var be=(t,e,n)=>Vn(t,typeof e!="symbol"?e+"":e,n);var Hr=Vo((Xu,qr)=>{"use strict";(()=>{var t={737:(s,l,p)=>{"use strict";p.r(l),p.d(l,{default:()=>U,getJrCommand:()=>w});var h=p(307),I=p.n(h);function P(){P=function(){return $};var E,$={},bt=Object.prototype,_t=bt.hasOwnProperty,St=Object.defineProperty||function(y,_,D){y[_]=D.value},mt=typeof Symbol=="function"?Symbol:{},It=mt.iterator||"@@iterator",Rt=mt.asyncIterator||"@@asyncIterator",Tt=mt.toStringTag||"@@toStringTag";function ht(y,_,D){return Object.defineProperty(y,_,{value:D,enumerable:!0,configurable:!0,writable:!0}),y[_]}try{ht({},"")}catch(y){ht=function(_,D,k){return _[D]=k}}function zt(y,_,D,k){var T=_&&_.prototype instanceof me?_:me,K=Object.create(T.prototype),ut=new Pe(k||[]);return St(K,"_invoke",{value:xt(y,D,ut)}),K}function $t(y,_,D){try{return{type:"normal",arg:y.call(_,D)}}catch(k){return{type:"throw",arg:k}}}$.wrap=zt;var Qt="suspendedStart",re="suspendedYield",Zt="executing",C="completed",Lt={};function me(){}function fe(){}function qt(){}var ye={};ht(ye,It,(function(){return this}));var pe=Object.getPrototypeOf,Yt=pe&&pe(pe(se([])));Yt&&Yt!==bt&&_t.call(Yt,It)&&(ye=Yt);var Wt=qt.prototype=me.prototype=Object.create(ye);function ve(y){["next","throw","return"].forEach((function(_){ht(y,_,(function(D){return this._invoke(_,D)}))}))}function ie(y,_){function D(T,K,ut,Et){var gt=$t(y[T],y,K);if(gt.type!=="throw"){var te=gt.arg,oe=te.value;return oe&&G(oe)=="object"&&_t.call(oe,"__await")?_.resolve(oe.__await).then((function(vt){D("next",vt,ut,Et)}),(function(vt){D("throw",vt,ut,Et)})):_.resolve(oe).then((function(vt){te.value=vt,ut(te)}),(function(vt){return D("throw",vt,ut,Et)}))}Et(gt.arg)}var k;St(this,"_invoke",{value:function(T,K){function ut(){return new _((function(Et,gt){D(T,K,Et,gt)}))}return k=k?k.then(ut,ut):ut()}})}function xt(y,_,D){var k=Qt;return function(T,K){if(k===Zt)throw Error("Generator is already running");if(k===C){if(T==="throw")throw K;return{value:E,done:!0}}for(D.method=T,D.arg=K;;){var ut=D.delegate;if(ut){var Et=Mt(ut,D);if(Et){if(Et===Lt)continue;return Et}}if(D.method==="next")D.sent=D._sent=D.arg;else if(D.method==="throw"){if(k===Qt)throw k=C,D.arg;D.dispatchException(D.arg)}else D.method==="return"&&D.abrupt("return",D.arg);k=Zt;var gt=$t(y,_,D);if(gt.type==="normal"){if(k=D.done?C:re,gt.arg===Lt)continue;return{value:gt.arg,done:D.done}}gt.type==="throw"&&(k=C,D.method="throw",D.arg=gt.arg)}}}function Mt(y,_){var D=_.method,k=y.iterator[D];if(k===E)return _.delegate=null,D==="throw"&&y.iterator.return&&(_.method="return",_.arg=E,Mt(y,_),_.method==="throw")||D!=="return"&&(_.method="throw",_.arg=new TypeError("The iterator does not provide a '"+D+"' method")),Lt;var T=$t(k,y.iterator,_.arg);if(T.type==="throw")return _.method="throw",_.arg=T.arg,_.delegate=null,Lt;var K=T.arg;return K?K.done?(_[y.resultName]=K.value,_.next=y.nextLoc,_.method!=="return"&&(_.method="next",_.arg=E),_.delegate=null,Lt):K:(_.method="throw",_.arg=new TypeError("iterator result is not an object"),_.delegate=null,Lt)}function ue(y){var _={tryLoc:y[0]};1 in y&&(_.catchLoc=y[1]),2 in y&&(_.finallyLoc=y[2],_.afterLoc=y[3]),this.tryEntries.push(_)}function Ie(y){var _=y.completion||{};_.type="normal",delete _.arg,y.completion=_}function Pe(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(ue,this),this.reset(!0)}function se(y){if(y||y===""){var _=y[It];if(_)return _.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var D=-1,k=function T(){for(;++D<y.length;)if(_t.call(y,D))return T.value=y[D],T.done=!1,T;return T.value=E,T.done=!0,T};return k.next=k}}throw new TypeError(G(y)+" is not iterable")}return fe.prototype=qt,St(Wt,"constructor",{value:qt,configurable:!0}),St(qt,"constructor",{value:fe,configurable:!0}),fe.displayName=ht(qt,Tt,"GeneratorFunction"),$.isGeneratorFunction=function(y){var _=typeof y=="function"&&y.constructor;return!!_&&(_===fe||(_.displayName||_.name)==="GeneratorFunction")},$.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,qt):(y.__proto__=qt,ht(y,Tt,"GeneratorFunction")),y.prototype=Object.create(Wt),y},$.awrap=function(y){return{__await:y}},ve(ie.prototype),ht(ie.prototype,Rt,(function(){return this})),$.AsyncIterator=ie,$.async=function(y,_,D,k,T){T===void 0&&(T=Promise);var K=new ie(zt(y,_,D,k),T);return $.isGeneratorFunction(_)?K:K.next().then((function(ut){return ut.done?ut.value:K.next()}))},ve(Wt),ht(Wt,Tt,"Generator"),ht(Wt,It,(function(){return this})),ht(Wt,"toString",(function(){return"[object Generator]"})),$.keys=function(y){var _=Object(y),D=[];for(var k in _)D.push(k);return D.reverse(),function T(){for(;D.length;){var K=D.pop();if(K in _)return T.value=K,T.done=!1,T}return T.done=!0,T}},$.values=se,Pe.prototype={constructor:Pe,reset:function(y){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(Ie),!y)for(var _ in this)_.charAt(0)==="t"&&_t.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=E)},stop:function(){this.done=!0;var y=this.tryEntries[0].completion;if(y.type==="throw")throw y.arg;return this.rval},dispatchException:function(y){if(this.done)throw y;var _=this;function D(gt,te){return K.type="throw",K.arg=y,_.next=gt,te&&(_.method="next",_.arg=E),!!te}for(var k=this.tryEntries.length-1;k>=0;--k){var T=this.tryEntries[k],K=T.completion;if(T.tryLoc==="root")return D("end");if(T.tryLoc<=this.prev){var ut=_t.call(T,"catchLoc"),Et=_t.call(T,"finallyLoc");if(ut&&Et){if(this.prev<T.catchLoc)return D(T.catchLoc,!0);if(this.prev<T.finallyLoc)return D(T.finallyLoc)}else if(ut){if(this.prev<T.catchLoc)return D(T.catchLoc,!0)}else{if(!Et)throw Error("try statement without catch or finally");if(this.prev<T.finallyLoc)return D(T.finallyLoc)}}}},abrupt:function(y,_){for(var D=this.tryEntries.length-1;D>=0;--D){var k=this.tryEntries[D];if(k.tryLoc<=this.prev&&_t.call(k,"finallyLoc")&&this.prev<k.finallyLoc){var T=k;break}}T&&(y==="break"||y==="continue")&&T.tryLoc<=_&&_<=T.finallyLoc&&(T=null);var K=T?T.completion:{};return K.type=y,K.arg=_,T?(this.method="next",this.next=T.finallyLoc,Lt):this.complete(K)},complete:function(y,_){if(y.type==="throw")throw y.arg;return y.type==="break"||y.type==="continue"?this.next=y.arg:y.type==="return"?(this.rval=this.arg=y.arg,this.method="return",this.next="end"):y.type==="normal"&&_&&(this.next=_),Lt},finish:function(y){for(var _=this.tryEntries.length-1;_>=0;--_){var D=this.tryEntries[_];if(D.finallyLoc===y)return this.complete(D.completion,D.afterLoc),Ie(D),Lt}},catch:function(y){for(var _=this.tryEntries.length-1;_>=0;--_){var D=this.tryEntries[_];if(D.tryLoc===y){var k=D.completion;if(k.type==="throw"){var T=k.arg;Ie(D)}return T}}throw Error("illegal catch attempt")},delegateYield:function(y,_,D){return this.delegate={iterator:se(y),resultName:_,nextLoc:D},this.method==="next"&&(this.arg=E),Lt}},$}function q(E,$,bt,_t,St,mt,It){try{var Rt=E[mt](It),Tt=Rt.value}catch(ht){return void bt(ht)}Rt.done?$(Tt):Promise.resolve(Tt).then(_t,St)}function G(E){return G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},G(E)}var M="https://ms.jr.jd.com";function pt(E){var $=E.host,bt=E.type,_t=bt===void 0?"post":bt,St=E.data,mt=E.path,It=mt===void 0?"":mt,Rt=E.config,Tt=Rt===void 0?{}:Rt,ht=(Tt.withCredentials,Tt.isWG),zt=ht===void 0||ht,$t=Tt.contentType,Qt=$t===void 0?"application/x-www-form-urlencoded":$t;return new Promise((function(re,Zt){wx.request({url:($||M)+It,method:_t.toUpperCase(),data:zt?R({reqData:JSON.stringify(St)}):St,header:{"content-type":Qt},success:function(C){C.statusCode===200?re(C.data):Zt({statusCode:C.statusCode,errMsg:C.errMsg,data:C.data})},fail:function(C){Zt(C)}})}))}function R(E){var $="";return G(E)==="object"&&E!==null&&(Object.keys(E).map((function(bt){var _t=E[bt];return $+=bt+"="+encodeURIComponent(_t)+"&",""})),$.length>0&&($=$.substr(0,$.length-1))),$}function J(E){return ct.apply(this,arguments)}function ct(){var E;return E=P().mark((function $(bt){var _t,St,mt,It,Rt,Tt,ht,zt,$t,Qt;return P().wrap((function(re){for(;;)switch(re.prev=re.next){case 0:return _t=bt.url,St=bt.channel,mt=bt.callback,I().init(),It=new(I()),Rt=It.nonce(),Tt=It.sign(JSON.stringify({t:"".concat(new Date().getTime())}),Rt),ht="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),zt="",$t={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:_t,channel:St,clientCode:"0",antiRushInfo:Tt}},re.next=12,pt({host:"https://ms.jr.jd.com",type:"post",path:ht,config:{withCredentials:!0},data:$t});case 12:(Qt=re.sent).resultCode===0&&Qt.resultData&&Qt.resultData.code==="00000"&&Qt.resultData.data&&(zt=Qt.resultData.data.goldenKeyText),mt&&mt(zt?{code:"0",msg:"command success",data:zt}:{code:"-1",msg:"command empty"});case 15:case"end":return re.stop()}}),$)})),ct=function(){var $=this,bt=arguments;return new Promise((function(_t,St){var mt=E.apply($,bt);function It(Tt){q(mt,_t,St,It,Rt,"next",Tt)}function Rt(Tt){q(mt,_t,St,It,Rt,"throw",Tt)}It(void 0)}))},ct.apply(this,arguments)}function st(E){return st=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},st(E)}function X(){X=function(){return $};var E,$={},bt=Object.prototype,_t=bt.hasOwnProperty,St=Object.defineProperty||function(y,_,D){y[_]=D.value},mt=typeof Symbol=="function"?Symbol:{},It=mt.iterator||"@@iterator",Rt=mt.asyncIterator||"@@asyncIterator",Tt=mt.toStringTag||"@@toStringTag";function ht(y,_,D){return Object.defineProperty(y,_,{value:D,enumerable:!0,configurable:!0,writable:!0}),y[_]}try{ht({},"")}catch(y){ht=function(_,D,k){return _[D]=k}}function zt(y,_,D,k){var T=_&&_.prototype instanceof me?_:me,K=Object.create(T.prototype),ut=new Pe(k||[]);return St(K,"_invoke",{value:xt(y,D,ut)}),K}function $t(y,_,D){try{return{type:"normal",arg:y.call(_,D)}}catch(k){return{type:"throw",arg:k}}}$.wrap=zt;var Qt="suspendedStart",re="suspendedYield",Zt="executing",C="completed",Lt={};function me(){}function fe(){}function qt(){}var ye={};ht(ye,It,(function(){return this}));var pe=Object.getPrototypeOf,Yt=pe&&pe(pe(se([])));Yt&&Yt!==bt&&_t.call(Yt,It)&&(ye=Yt);var Wt=qt.prototype=me.prototype=Object.create(ye);function ve(y){["next","throw","return"].forEach((function(_){ht(y,_,(function(D){return this._invoke(_,D)}))}))}function ie(y,_){function D(T,K,ut,Et){var gt=$t(y[T],y,K);if(gt.type!=="throw"){var te=gt.arg,oe=te.value;return oe&&st(oe)=="object"&&_t.call(oe,"__await")?_.resolve(oe.__await).then((function(vt){D("next",vt,ut,Et)}),(function(vt){D("throw",vt,ut,Et)})):_.resolve(oe).then((function(vt){te.value=vt,ut(te)}),(function(vt){return D("throw",vt,ut,Et)}))}Et(gt.arg)}var k;St(this,"_invoke",{value:function(T,K){function ut(){return new _((function(Et,gt){D(T,K,Et,gt)}))}return k=k?k.then(ut,ut):ut()}})}function xt(y,_,D){var k=Qt;return function(T,K){if(k===Zt)throw Error("Generator is already running");if(k===C){if(T==="throw")throw K;return{value:E,done:!0}}for(D.method=T,D.arg=K;;){var ut=D.delegate;if(ut){var Et=Mt(ut,D);if(Et){if(Et===Lt)continue;return Et}}if(D.method==="next")D.sent=D._sent=D.arg;else if(D.method==="throw"){if(k===Qt)throw k=C,D.arg;D.dispatchException(D.arg)}else D.method==="return"&&D.abrupt("return",D.arg);k=Zt;var gt=$t(y,_,D);if(gt.type==="normal"){if(k=D.done?C:re,gt.arg===Lt)continue;return{value:gt.arg,done:D.done}}gt.type==="throw"&&(k=C,D.method="throw",D.arg=gt.arg)}}}function Mt(y,_){var D=_.method,k=y.iterator[D];if(k===E)return _.delegate=null,D==="throw"&&y.iterator.return&&(_.method="return",_.arg=E,Mt(y,_),_.method==="throw")||D!=="return"&&(_.method="throw",_.arg=new TypeError("The iterator does not provide a '"+D+"' method")),Lt;var T=$t(k,y.iterator,_.arg);if(T.type==="throw")return _.method="throw",_.arg=T.arg,_.delegate=null,Lt;var K=T.arg;return K?K.done?(_[y.resultName]=K.value,_.next=y.nextLoc,_.method!=="return"&&(_.method="next",_.arg=E),_.delegate=null,Lt):K:(_.method="throw",_.arg=new TypeError("iterator result is not an object"),_.delegate=null,Lt)}function ue(y){var _={tryLoc:y[0]};1 in y&&(_.catchLoc=y[1]),2 in y&&(_.finallyLoc=y[2],_.afterLoc=y[3]),this.tryEntries.push(_)}function Ie(y){var _=y.completion||{};_.type="normal",delete _.arg,y.completion=_}function Pe(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(ue,this),this.reset(!0)}function se(y){if(y||y===""){var _=y[It];if(_)return _.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var D=-1,k=function T(){for(;++D<y.length;)if(_t.call(y,D))return T.value=y[D],T.done=!1,T;return T.value=E,T.done=!0,T};return k.next=k}}throw new TypeError(st(y)+" is not iterable")}return fe.prototype=qt,St(Wt,"constructor",{value:qt,configurable:!0}),St(qt,"constructor",{value:fe,configurable:!0}),fe.displayName=ht(qt,Tt,"GeneratorFunction"),$.isGeneratorFunction=function(y){var _=typeof y=="function"&&y.constructor;return!!_&&(_===fe||(_.displayName||_.name)==="GeneratorFunction")},$.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,qt):(y.__proto__=qt,ht(y,Tt,"GeneratorFunction")),y.prototype=Object.create(Wt),y},$.awrap=function(y){return{__await:y}},ve(ie.prototype),ht(ie.prototype,Rt,(function(){return this})),$.AsyncIterator=ie,$.async=function(y,_,D,k,T){T===void 0&&(T=Promise);var K=new ie(zt(y,_,D,k),T);return $.isGeneratorFunction(_)?K:K.next().then((function(ut){return ut.done?ut.value:K.next()}))},ve(Wt),ht(Wt,Tt,"Generator"),ht(Wt,It,(function(){return this})),ht(Wt,"toString",(function(){return"[object Generator]"})),$.keys=function(y){var _=Object(y),D=[];for(var k in _)D.push(k);return D.reverse(),function T(){for(;D.length;){var K=D.pop();if(K in _)return T.value=K,T.done=!1,T}return T.done=!0,T}},$.values=se,Pe.prototype={constructor:Pe,reset:function(y){if(this.prev=0,this.next=0,this.sent=this._sent=E,this.done=!1,this.delegate=null,this.method="next",this.arg=E,this.tryEntries.forEach(Ie),!y)for(var _ in this)_.charAt(0)==="t"&&_t.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=E)},stop:function(){this.done=!0;var y=this.tryEntries[0].completion;if(y.type==="throw")throw y.arg;return this.rval},dispatchException:function(y){if(this.done)throw y;var _=this;function D(gt,te){return K.type="throw",K.arg=y,_.next=gt,te&&(_.method="next",_.arg=E),!!te}for(var k=this.tryEntries.length-1;k>=0;--k){var T=this.tryEntries[k],K=T.completion;if(T.tryLoc==="root")return D("end");if(T.tryLoc<=this.prev){var ut=_t.call(T,"catchLoc"),Et=_t.call(T,"finallyLoc");if(ut&&Et){if(this.prev<T.catchLoc)return D(T.catchLoc,!0);if(this.prev<T.finallyLoc)return D(T.finallyLoc)}else if(ut){if(this.prev<T.catchLoc)return D(T.catchLoc,!0)}else{if(!Et)throw Error("try statement without catch or finally");if(this.prev<T.finallyLoc)return D(T.finallyLoc)}}}},abrupt:function(y,_){for(var D=this.tryEntries.length-1;D>=0;--D){var k=this.tryEntries[D];if(k.tryLoc<=this.prev&&_t.call(k,"finallyLoc")&&this.prev<k.finallyLoc){var T=k;break}}T&&(y==="break"||y==="continue")&&T.tryLoc<=_&&_<=T.finallyLoc&&(T=null);var K=T?T.completion:{};return K.type=y,K.arg=_,T?(this.method="next",this.next=T.finallyLoc,Lt):this.complete(K)},complete:function(y,_){if(y.type==="throw")throw y.arg;return y.type==="break"||y.type==="continue"?this.next=y.arg:y.type==="return"?(this.rval=this.arg=y.arg,this.method="return",this.next="end"):y.type==="normal"&&_&&(this.next=_),Lt},finish:function(y){for(var _=this.tryEntries.length-1;_>=0;--_){var D=this.tryEntries[_];if(D.finallyLoc===y)return this.complete(D.completion,D.afterLoc),Ie(D),Lt}},catch:function(y){for(var _=this.tryEntries.length-1;_>=0;--_){var D=this.tryEntries[_];if(D.tryLoc===y){var k=D.completion;if(k.type==="throw"){var T=k.arg;Ie(D)}return T}}throw Error("illegal catch attempt")},delegateYield:function(y,_,D){return this.delegate={iterator:se(y),resultName:_,nextLoc:D},this.method==="next"&&(this.arg=E),Lt}},$}function Ot(E,$,bt,_t,St,mt,It){try{var Rt=E[mt](It),Tt=Rt.value}catch(ht){return void bt(ht)}Rt.done?$(Tt):Promise.resolve(Tt).then(_t,St)}function w(E){return F.apply(this,arguments)}function F(){var E;return E=X().mark((function $(bt){var _t,St,mt;return X().wrap((function(It){for(;;)switch(It.prev=It.next){case 0:return _t=bt.url,St=bt.channel,mt=bt.callback,It.next=3,J({url:_t,channel:St,callback:mt});case 3:case"end":return It.stop()}}),$)})),F=function(){var $=this,bt=arguments;return new Promise((function(_t,St){var mt=E.apply($,bt);function It(Tt){Ot(mt,_t,St,It,Rt,"next",Tt)}function Rt(Tt){Ot(mt,_t,St,It,Rt,"throw",Tt)}It(void 0)}))},F.apply(this,arguments)}var Y={getJrCommand:w};(s=p.hmd(s)).exports&&(s.exports=Y,s.exports.getJrCommand=w),typeof window!="undefined"&&(window.LyyGetCommandSDK=Y);let U=Y},307:function(s,l,p){var h,I,P;function q(G){return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},q(G)}P=function(){"use strict";function G(r){return(G=typeof Symbol=="function"&&q(Symbol.iterator)=="symbol"?function(o){return q(o)}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":q(o)})(r)}function M(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}function pt(r,o){for(var d=0;d<o.length;d++){var f=o[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(r,f.key,f)}}function R(r,o,d){return o&&pt(r.prototype,o),d&&pt(r,d),r}function J(r,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(o&&o.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),o&&st(r,o)}function ct(r){return(ct=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(r)}function st(r,o){return(st=Object.setPrototypeOf||function(d,f){return d.__proto__=f,d})(r,o)}function X(r){var o=(function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(d){return!1}})();return function(){var d,f=ct(r);return(function(A,g){if(g&&(q(g)=="object"||typeof g=="function"))return g;if(g!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N})(A)})(this,o?(d=ct(this).constructor,Reflect.construct(f,arguments,d)):f.apply(this,arguments))}}function Ot(r){return(function(o){if(Array.isArray(o))return w(o)})(r)||(function(o){if(typeof Symbol!="undefined"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)})(r)||(function(o,d){if(o){if(typeof o=="string")return w(o,d);var f=Object.prototype.toString.call(o).slice(8,-1);return(f=f==="Object"&&o.constructor?o.constructor.name:f)==="Map"||f==="Set"?Array.from(o):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?w(o,d):void 0}})(r)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function
|
|
3
|
-
`),f+=mt[r[j]>>2]+mt[(3&r[j])<<4|r[j+1]>>4]+mt[(15&r[j+1])<<2|r[j+2]>>6]+mt[63&r[j+2]];for(
|
|
4
|
-
`),f+=Rt[r[j]>>2]+Rt[(3&r[j])<<4|r[j+1]>>4]+Rt[(15&r[j+1])<<2|r[j+2]>>6]+Rt[63&r[j+2]];for(o=0;o<d;o++)f+="=";return f},b4_decode:function(r){var o=0,d=0,f=(r=r.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length%4;if(2<f)return null;for(o=0;o<f;o++)if(r.charAt(r.length-o-1)!="=")return null;var A,g,N,V,x=new Array(3*(r.length-f)/4);for(o=0,d=0;d<x.length;)A=Rt.indexOf(r.charAt(o++)),g=Rt.indexOf(r.charAt(o++)),N=Rt.indexOf(r.charAt(o++)),V=Rt.indexOf(r.charAt(o++)),x[d++]=A<<2|g>>4,x[d++]=(15&g)<<4|N>>2,x[d++]=(3&N)<<6|V;for(o=0;o<f;o++)if(x.pop()!=0)return null;return x}};function ht(){}ht.encode=function(r,o,d){for(var f=new Array(2*d),A=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),g=o,N=0;g<d+o;g++,N++)f[N]=A[(255&r[g])>>4],f[++N]=A[15&r[g]];return f.join("")},ht.decode=function(r){if(r==null||r==""||r.length%2!=0)return null;for(var o=r.length/2,d=ht.toCharCodeArray(r),f=new Array(o),A=0;A<o;A++){if(48<=d[2*A]&&d[2*A]<=57)f[A]=d[2*A]-48<<4;else if(65<=d[2*A]&&d[2*A]<=70)f[A]=d[2*A]-65+10<<4;else{if(!(97<=d[2*A]&&d[2*A]<=102))return null;f[A]=d[2*A]-97+10<<4}if(48<=d[2*A+1]&&d[2*A+1]<=57)f[A]=f[A]|d[2*A+1]-48;else if(65<=d[2*A+1]&&d[2*A+1]<=70)f[A]=f[A]|d[2*A+1]-65+10;else{if(!(97<=d[2*A+1]&&d[2*A+1]<=102))return null;f[A]=f[A]|d[2*A+1]-97+10}}return f},ht.toCharCodeArray=function(r){for(var o=new Array(r.length),d=0;d<r.length;d++)o[d]=r.charCodeAt(d);return o};var zt=ht,$t=zt;(Mt=function(){}).utf8StrToh6=function(r){r=encodeURIComponent(r);for(var o=unescape(r),d=o.length,f=[],A=0;A<d;A++)f[A]=o.charCodeAt(A).toString(16);return f.join("")},Mt.utf8StrToBytes=function(r){r=encodeURIComponent(r);for(var o=unescape(r),d=o.length,f=[],A=0;A<d;A++)f[A]=o.charCodeAt(A);return f},Mt.hexToUtf8Str=function(r){for(var o=$t.decode(r),d=[],f=0;f<o.length;f++)d.push(String.fromCharCode(o[f]));return decodeURIComponent(escape(d.join("")))},Mt.bytesToUtf8Str=function(r){for(var o=r,d=[],f=0;f<o.length;f++)d.push(String.fromCharCode(o[f]));return decodeURIComponent(escape(d.join("")))},Mt.intToByte=function(r){return new Array(r>>24&255,r>>16&255,r>>8&255,255&r)},Mt.byteToInt=function(r,o){return o+3<r.length?r[o]<<24|r[o+1]<<16|r[o+2]<<8|r[o+3]:o+2<r.length?r[o+1]<<16|r[o+2]<<8|r[o+3]:o+1<r.length?r[o]<<8|r[o+1]:r[o]};var Qt,re=Mt,Zt={exports:{}};Qt=Zt,function(){function r(i,u,c){i!=null&&(typeof i=="number"?this.fromNumber(i,u,c):u==null&&typeof i!="string"?this.fromString(i,256):this.fromString(i,u))}function o(){return new r(null)}var d=(d=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(r.prototype.am=function(i,u,c,m,S,B){for(var W=32767&u,H=u>>15;0<=--B;){var Vt=32767&this[i],ne=this[i++]>>15,Ae=H*Vt+ne*W;S=((Vt=W*Vt+((32767&Ae)<<15)+c[m]+(1073741823&S))>>>30)+(Ae>>>15)+H*ne+(S>>>30),c[m++]=1073741823&Vt}return S},30):d&&navigator.appName!="Netscape"?(r.prototype.am=function(i,u,c,m,S,B){for(;0<=--B;){var W=u*this[i++]+c[m]+S;S=Math.floor(W/67108864),c[m++]=67108863&W}return S},26):(r.prototype.am=function(i,u,c,m,S,B){for(var W=16383&u,H=u>>14;0<=--B;){var Vt=16383&this[i],ne=this[i++]>>14,Ae=H*Vt+ne*W;S=((Vt=W*Vt+((16383&Ae)<<14)+c[m]+S)>>28)+(Ae>>14)+H*ne,c[m++]=268435455&Vt}return S},28);r.prototype.DB=d,r.prototype.DM=(1<<d)-1,r.prototype.DV=1<<d,r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-d,r.prototype.F2=2*d-52;for(var f=new Array,A=48,g=0;g<=9;++g)f[A++]=g;for(A=97,g=10;g<36;++g)f[A++]=g;for(A=65,g=10;g<36;++g)f[A++]=g;function N(i){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(i)}function V(i,u){return(i=f[i.charCodeAt(u)])==null?-1:i}function x(i){var u=o();return u.fromInt(i),u}function lt(i){var u,c=1;return(u=i>>>16)!=0&&(i=u,c+=16),(u=i>>8)!=0&&(i=u,c+=8),(u=i>>4)!=0&&(i=u,c+=4),(u=i>>2)!=0&&(i=u,c+=2),(u=i>>1)!=0&&(i=u,c+=1),c}function dt(i){this.m=i}function O(i){this.m=i,this.mp=i.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<i.DB-15)-1,this.mt2=2*i.t}function Z(i,u){return i&u}function it(i,u){return i|u}function rt(i,u){return i^u}function ft(i,u){return i&~u}function At(){}function Ft(i){return i}function Q(i){this.r2=o(),this.q3=o(),r.ONE.dlShiftTo(2*i.t,this.r2),this.mu=this.r2.divide(i),this.m=i}dt.prototype.convert=function(i){return i.s<0||0<=i.compareTo(this.m)?i.mod(this.m):i},dt.prototype.revert=function(i){return i},dt.prototype.reduce=function(i){i.divRemTo(this.m,null,i)},dt.prototype.mulTo=function(i,u,c){i.multiplyTo(u,c),this.reduce(c)},dt.prototype.sqrTo=function(i,u){i.squareTo(u),this.reduce(u)},O.prototype.convert=function(i){var u=o();return i.abs().dlShiftTo(this.m.t,u),u.divRemTo(this.m,null,u),i.s<0&&0<u.compareTo(r.ZERO)&&this.m.subTo(u,u),u},O.prototype.revert=function(i){var u=o();return i.copyTo(u),this.reduce(u),u},O.prototype.reduce=function(i){for(;i.t<=this.mt2;)i[i.t++]=0;for(var u=0;u<this.m.t;++u){var c=32767&i[u],m=c*this.mpl+((c*this.mph+(i[u]>>15)*this.mpl&this.um)<<15)&i.DM;for(i[c=u+this.m.t]+=this.m.am(0,m,i,u,0,this.m.t);i[c]>=i.DV;)i[c]-=i.DV,i[++c]++}i.clamp(),i.drShiftTo(this.m.t,i),0<=i.compareTo(this.m)&&i.subTo(this.m,i)},O.prototype.mulTo=function(i,u,c){i.multiplyTo(u,c),this.reduce(c)},O.prototype.sqrTo=function(i,u){i.squareTo(u),this.reduce(u)},r.prototype.copyTo=function(i){for(var u=this.t-1;0<=u;--u)i[u]=this[u];i.t=this.t,i.s=this.s},r.prototype.fromInt=function(i){this.t=1,this.s=i<0?-1:0,0<i?this[0]=i:i<-1?this[0]=i+this.DV:this.t=0},r.prototype.fromString=function(i,u){var c;if(u==16)c=4;else if(u==8)c=3;else if(u==256)c=8;else if(u==2)c=1;else if(u==32)c=5;else{if(u!=4)return void this.fromRadix(i,u);c=2}this.t=0,this.s=0;for(var m=i.length,S=!1,B=0;0<=--m;){var W=c==8?255&i[m]:V(i,m);W<0?i.charAt(m)=="-"&&(S=!0):(S=!1,B==0?this[this.t++]=W:B+c>this.DB?(this[this.t-1]|=(W&(1<<this.DB-B)-1)<<B,this[this.t++]=W>>this.DB-B):this[this.t-1]|=W<<B,(B+=c)>=this.DB&&(B-=this.DB))}c==8&&128&i[0]&&(this.s=-1,0<B&&(this[this.t-1]|=(1<<this.DB-B)-1<<B)),this.clamp(),S&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var i=this.s&this.DM;0<this.t&&this[this.t-1]==i;)--this.t},r.prototype.dlShiftTo=function(i,u){for(var c=this.t-1;0<=c;--c)u[c+i]=this[c];for(c=i-1;0<=c;--c)u[c]=0;u.t=this.t+i,u.s=this.s},r.prototype.drShiftTo=function(i,u){for(var c=i;c<this.t;++c)u[c-i]=this[c];u.t=Math.max(this.t-i,0),u.s=this.s},r.prototype.lShiftTo=function(i,u){for(var c=i%this.DB,m=this.DB-c,S=(1<<m)-1,B=Math.floor(i/this.DB),W=this.s<<c&this.DM,H=this.t-1;0<=H;--H)u[H+B+1]=this[H]>>m|W,W=(this[H]&S)<<c;for(H=B-1;0<=H;--H)u[H]=0;u[B]=W,u.t=this.t+B+1,u.s=this.s,u.clamp()},r.prototype.rShiftTo=function(i,u){u.s=this.s;var c=Math.floor(i/this.DB);if(c>=this.t)u.t=0;else{var m=i%this.DB,S=this.DB-m,B=(1<<m)-1;u[0]=this[c]>>m;for(var W=c+1;W<this.t;++W)u[W-c-1]|=(this[W]&B)<<S,u[W-c]=this[W]>>m;0<m&&(u[this.t-c-1]|=(this.s&B)<<S),u.t=this.t-c,u.clamp()}},r.prototype.subTo=function(i,u){for(var c=0,m=0,S=Math.min(i.t,this.t);c<S;)m+=this[c]-i[c],u[c++]=m&this.DM,m>>=this.DB;if(i.t<this.t){for(m-=i.s;c<this.t;)m+=this[c],u[c++]=m&this.DM,m>>=this.DB;m+=this.s}else{for(m+=this.s;c<i.t;)m-=i[c],u[c++]=m&this.DM,m>>=this.DB;m-=i.s}u.s=m<0?-1:0,m<-1?u[c++]=this.DV+m:0<m&&(u[c++]=m),u.t=c,u.clamp()},r.prototype.multiplyTo=function(i,u){var c=this.abs(),m=i.abs(),S=c.t;for(u.t=S+m.t;0<=--S;)u[S]=0;for(S=0;S<m.t;++S)u[S+c.t]=c.am(0,m[S],u,S,0,c.t);u.s=0,u.clamp(),this.s!=i.s&&r.ZERO.subTo(u,u)},r.prototype.squareTo=function(i){for(var u=this.abs(),c=i.t=2*u.t;0<=--c;)i[c]=0;for(c=0;c<u.t-1;++c){var m=u.am(c,u[c],i,2*c,0,1);(i[c+u.t]+=u.am(c+1,2*u[c],i,2*c+1,m,u.t-c-1))>=u.DV&&(i[c+u.t]-=u.DV,i[c+u.t+1]=1)}0<i.t&&(i[i.t-1]+=u.am(c,u[c],i,2*c,0,1)),i.s=0,i.clamp()},r.prototype.divRemTo=function(i,u,c){var m=i.abs();if(!(m.t<=0)){if((ne=this.abs()).t<m.t)return u!=null&&u.fromInt(0),void(c!=null&&this.copyTo(c));c==null&&(c=o());var S=o(),B=this.s,W=i.s;0<(i=this.DB-lt(m[m.t-1]))?(m.lShiftTo(i,S),ne.lShiftTo(i,c)):(m.copyTo(S),ne.copyTo(c));var H=S.t,Vt=S[H-1];if(Vt!=0){var ne=Vt*(1<<this.F1)+(1<H?S[H-2]>>this.F2:0),Ae=this.FV/ne,Ee=(1<<this.F1)/ne,Je=1<<this.F2,jt=c.t,we=jt-H,Ht=u==null?o():u;for(S.dlShiftTo(we,Ht),0<=c.compareTo(Ht)&&(c[c.t++]=1,c.subTo(Ht,c)),r.ONE.dlShiftTo(H,Ht),Ht.subTo(S,S);S.t<H;)S[S.t++]=0;for(;0<=--we;){var Un=c[--jt]==Vt?this.DM:Math.floor(c[jt]*Ae+(c[jt-1]+Je)*Ee);if((c[jt]+=S.am(0,Un,c,we,0,H))<Un)for(S.dlShiftTo(we,Ht),c.subTo(Ht,c);c[jt]<--Un;)c.subTo(Ht,c)}u!=null&&(c.drShiftTo(H,u),B!=W&&r.ZERO.subTo(u,u)),c.t=H,c.clamp(),0<i&&c.rShiftTo(i,c),B<0&&r.ZERO.subTo(c,c)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var i=this[0];if(!(1&i))return 0;var u=3&i;return 0<(u=(u=(u=(u=u*(2-(15&i)*u)&15)*(2-(255&i)*u)&255)*(2-((65535&i)*u&65535))&65535)*(2-i*u%this.DV)%this.DV)?this.DV-u:-u},r.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},r.prototype.exp=function(i,u){if(4294967295<i||i<1)return r.ONE;var c,m=o(),S=o(),B=u.convert(this),W=lt(i)-1;for(B.copyTo(m);0<=--W;)u.sqrTo(m,S),0<(i&1<<W)?u.mulTo(S,B,m):(c=m,m=S,S=c);return u.revert(m)},r.prototype.toString=function(i){if(this.s<0)return"-"+this.negate().toString(i);var u;if(i==16)u=4;else if(i==8)u=3;else if(i==2)u=1;else if(i==32)u=5;else{if(i!=4)return this.toRadix(i);u=2}var c,m=(1<<u)-1,S=!1,B="",W=this.t,H=this.DB-W*this.DB%u;if(0<W--)for(H<this.DB&&0<(c=this[W]>>H)&&(S=!0,B=N(c));0<=W;)H<u?(c=(this[W]&(1<<H)-1)<<u-H,c|=this[--W]>>(H+=this.DB-u)):(c=this[W]>>(H-=u)&m,H<=0&&(H+=this.DB,--W)),(S=0<c||S)&&(B+=N(c));return S?B:"0"},r.prototype.negate=function(){var i=o();return r.ZERO.subTo(this,i),i},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(i){var u=this.s-i.s;if(u!=0)return u;var c=this.t;if((u=c-i.t)!=0)return this.s<0?-u:u;for(;0<=--c;)if((u=this[c]-i[c])!=0)return u;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+lt(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(i){var u=o();return this.abs().divRemTo(i,null,u),this.s<0&&0<u.compareTo(r.ZERO)&&i.subTo(u,u),u},r.prototype.modPowInt=function(i,u){return u=new(i<256||u.isEven()?dt:O)(u),this.exp(i,u)},r.ZERO=x(0),r.ONE=x(1),At.prototype.convert=Ft,At.prototype.revert=Ft,At.prototype.mulTo=function(i,u,c){i.multiplyTo(u,c)},At.prototype.sqrTo=function(i,u){i.squareTo(u)},Q.prototype.convert=function(i){if(i.s<0||i.t>2*this.m.t)return i.mod(this.m);if(i.compareTo(this.m)<0)return i;var u=o();return i.copyTo(u),this.reduce(u),u},Q.prototype.revert=function(i){return i},Q.prototype.reduce=function(i){for(i.drShiftTo(this.m.t-1,this.r2),i.t>this.m.t+1&&(i.t=this.m.t+1,i.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);i.compareTo(this.r2)<0;)i.dAddOffset(1,this.m.t+1);for(i.subTo(this.r2,i);0<=i.compareTo(this.m);)i.subTo(this.m,i)},Q.prototype.mulTo=function(i,u,c){i.multiplyTo(u,c),this.reduce(c)},Q.prototype.sqrTo=function(i,u){i.squareTo(u),this.reduce(u)};var et,z=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],tt=(1<<26)/z[z.length-1];function nt(){var i;i=new Date().getTime(),Pt[ot++]^=255&i,Pt[ot++]^=i>>8&255,Pt[ot++]^=i>>16&255,Pt[ot++]^=i>>24&255,xn<=ot&&(ot-=xn)}if(r.prototype.chunkSize=function(i){return Math.floor(Math.LN2*this.DB/Math.log(i))},r.prototype.toRadix=function(i){if(i==null&&(i=10),this.signum()==0||i<2||36<i)return"0";var u=this.chunkSize(i),c=Math.pow(i,u),m=x(c),S=o(),B=o(),W="";for(this.divRemTo(m,S,B);0<S.signum();)W=(c+B.intValue()).toString(i).substr(1)+W,S.divRemTo(m,S,B);return B.intValue().toString(i)+W},r.prototype.fromRadix=function(i,u){this.fromInt(0);for(var c=this.chunkSize(u=u==null?10:u),m=Math.pow(u,c),S=!1,B=0,W=0,H=0;H<i.length;++H){var Vt=V(i,H);Vt<0?i.charAt(H)=="-"&&this.signum()==0&&(S=!0):(W=u*W+Vt,++B>=c&&(this.dMultiply(m),this.dAddOffset(W,0),W=B=0))}0<B&&(this.dMultiply(Math.pow(u,B)),this.dAddOffset(W,0)),S&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(i,u,c){if(typeof u=="number")if(i<2)this.fromInt(1);else for(this.fromNumber(i,c),this.testBit(i-1)||this.bitwiseTo(r.ONE.shiftLeft(i-1),it,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(u);)this.dAddOffset(2,0),this.bitLength()>i&&this.subTo(r.ONE.shiftLeft(i-1),this);else{var m=new Array;c=7&i,m.length=1+(i>>3),u.nextBytes(m),0<c?m[0]&=(1<<c)-1:m[0]=0,this.fromString(m,256)}},r.prototype.bitwiseTo=function(i,u,c){for(var m,S=Math.min(i.t,this.t),B=0;B<S;++B)c[B]=u(this[B],i[B]);if(i.t<this.t){for(m=i.s&this.DM,B=S;B<this.t;++B)c[B]=u(this[B],m);c.t=this.t}else{for(m=this.s&this.DM,B=S;B<i.t;++B)c[B]=u(m,i[B]);c.t=i.t}c.s=u(this.s,i.s),c.clamp()},r.prototype.changeBit=function(i,u){return i=r.ONE.shiftLeft(i),this.bitwiseTo(i,u,i),i},r.prototype.addTo=function(i,u){for(var c=0,m=0,S=Math.min(i.t,this.t);c<S;)m+=this[c]+i[c],u[c++]=m&this.DM,m>>=this.DB;if(i.t<this.t){for(m+=i.s;c<this.t;)m+=this[c],u[c++]=m&this.DM,m>>=this.DB;m+=this.s}else{for(m+=this.s;c<i.t;)m+=i[c],u[c++]=m&this.DM,m>>=this.DB;m+=i.s}u.s=m<0?-1:0,0<m?u[c++]=m:m<-1&&(u[c++]=this.DV+m),u.t=c,u.clamp()},r.prototype.dMultiply=function(i){this[this.t]=this.am(0,i-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(i,u){if(i!=0){for(;this.t<=u;)this[this.t++]=0;for(this[u]+=i;this[u]>=this.DV;)this[u]-=this.DV,++u>=this.t&&(this[this.t++]=0),++this[u]}},r.prototype.multiplyLowerTo=function(i,u,c){var m,S=Math.min(this.t+i.t,u);for(c.s=0,c.t=S;0<S;)c[--S]=0;for(m=c.t-this.t;S<m;++S)c[S+this.t]=this.am(0,i[S],c,S,0,this.t);for(m=Math.min(i.t,u);S<m;++S)this.am(0,i[S],c,S,0,u-S);c.clamp()},r.prototype.multiplyUpperTo=function(i,u,c){var m=c.t=this.t+i.t- --u;for(c.s=0;0<=--m;)c[m]=0;for(m=Math.max(u-this.t,0);m<i.t;++m)c[this.t+m-u]=this.am(u-m,i[m],c,0,0,this.t+m-u);c.clamp(),c.drShiftTo(1,c)},r.prototype.modInt=function(i){if(i<=0)return 0;var u=this.DV%i,c=this.s<0?i-1:0;if(0<this.t)if(u==0)c=this[0]%i;else for(var m=this.t-1;0<=m;--m)c=(u*c+this[m])%i;return c},r.prototype.millerRabin=function(i){var u=this.subtract(r.ONE),c=u.getLowestSetBit();if(c<=0)return!1;var m=u.shiftRight(c);z.length<(i=i+1>>1)&&(i=z.length);for(var S=o(),B=0;B<i;++B){S.fromInt(z[Math.floor(Math.random()*z.length)]);var W=S.modPow(m,this);if(W.compareTo(r.ONE)!=0&&W.compareTo(u)!=0){for(var H=1;H++<c&&W.compareTo(u)!=0;)if((W=W.modPowInt(2,this)).compareTo(r.ONE)==0)return!1;if(W.compareTo(u)!=0)return!1}}return!0},r.prototype.clone=function(){var i=o();return this.copyTo(i),i},r.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var i=this.t,u=new Array;u[0]=this.s;var c,m=this.DB-i*this.DB%8,S=0;if(0<i--)for(m<this.DB&&(c=this[i]>>m)!=(this.s&this.DM)>>m&&(u[S++]=c|this.s<<this.DB-m);0<=i;)m<8?(c=(this[i]&(1<<m)-1)<<8-m,c|=this[--i]>>(m+=this.DB-8)):(c=this[i]>>(m-=8)&255,m<=0&&(m+=this.DB,--i)),128&c&&(c|=-256),S==0&&(128&this.s)!=(128&c)&&++S,(0<S||c!=this.s)&&(u[S++]=c);return u},r.prototype.equals=function(i){return this.compareTo(i)==0},r.prototype.min=function(i){return this.compareTo(i)<0?this:i},r.prototype.max=function(i){return 0<this.compareTo(i)?this:i},r.prototype.and=function(i){var u=o();return this.bitwiseTo(i,Z,u),u},r.prototype.or=function(i){var u=o();return this.bitwiseTo(i,it,u),u},r.prototype.xor=function(i){var u=o();return this.bitwiseTo(i,rt,u),u},r.prototype.andNot=function(i){var u=o();return this.bitwiseTo(i,ft,u),u},r.prototype.not=function(){for(var i=o(),u=0;u<this.t;++u)i[u]=this.DM&~this[u];return i.t=this.t,i.s=~this.s,i},r.prototype.shiftLeft=function(i){var u=o();return i<0?this.rShiftTo(-i,u):this.lShiftTo(i,u),u},r.prototype.shiftRight=function(i){var u=o();return i<0?this.lShiftTo(-i,u):this.rShiftTo(i,u),u},r.prototype.getLowestSetBit=function(){for(var i=0;i<this.t;++i)if(this[i]!=0)return i*this.DB+(function(u){if(u==0)return-1;var c=0;return!(65535&u)&&(u>>=16,c+=16),!(255&u)&&(u>>=8,c+=8),!(15&u)&&(u>>=4,c+=4),!(3&u)&&(u>>=2,c+=2),!(1&u)&&++c,c})(this[i]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var i=0,u=this.s&this.DM,c=0;c<this.t;++c)i+=(function(m){for(var S=0;m!=0;)m&=m-1,++S;return S})(this[c]^u);return i},r.prototype.testBit=function(i){var u=Math.floor(i/this.DB);return u>=this.t?this.s!=0:!!(this[u]&1<<i%this.DB)},r.prototype.setBit=function(i){return this.changeBit(i,it)},r.prototype.clearBit=function(i){return this.changeBit(i,ft)},r.prototype.flipBit=function(i){return this.changeBit(i,rt)},r.prototype.add=function(i){var u=o();return this.addTo(i,u),u},r.prototype.subtract=function(i){var u=o();return this.subTo(i,u),u},r.prototype.multiply=function(i){var u=o();return this.multiplyTo(i,u),u},r.prototype.divide=function(i){var u=o();return this.divRemTo(i,u,null),u},r.prototype.remainder=function(i){var u=o();return this.divRemTo(i,null,u),u},r.prototype.divideAndRemainder=function(i){var u=o(),c=o();return this.divRemTo(i,u,c),new Array(u,c)},r.prototype.modPow=function(i,u){var c=i.bitLength(),m=x(1);if(c<=0)return m;var S=c<18?1:c<48?3:c<144?4:c<768?5:6,B=new(c<8?dt:u.isEven()?Q:O)(u),W=new Array,H=3,Vt=S-1,ne=(1<<S)-1;if(W[1]=B.convert(this),1<S){var Ae=o();for(B.sqrTo(W[1],Ae);H<=ne;)W[H]=o(),B.mulTo(Ae,W[H-2],W[H]),H+=2}var Ee,Je,jt=i.t-1,we=!0,Ht=o();for(c=lt(i[jt])-1;0<=jt;){for(Vt<=c?Ee=i[jt]>>c-Vt&ne:(Ee=(i[jt]&(1<<c+1)-1)<<Vt-c,0<jt&&(Ee|=i[jt-1]>>this.DB+c-Vt)),H=S;!(1&Ee);)Ee>>=1,--H;if((c-=H)<0&&(c+=this.DB,--jt),we)W[Ee].copyTo(m),we=!1;else{for(;1<H;)B.sqrTo(m,Ht),B.sqrTo(Ht,m),H-=2;0<H?B.sqrTo(m,Ht):(Je=m,m=Ht,Ht=Je),B.mulTo(Ht,W[Ee],m)}for(;0<=jt&&!(i[jt]&1<<c);)B.sqrTo(m,Ht),Je=m,m=Ht,Ht=Je,--c<0&&(c=this.DB-1,--jt)}return B.revert(m)},r.prototype.modInverse=function(i){var u=i.isEven();if(this.isEven()&&u||i.signum()==0)return r.ZERO;for(var c=i.clone(),m=this.clone(),S=x(1),B=x(0),W=x(0),H=x(1);c.signum()!=0;){for(;c.isEven();)c.rShiftTo(1,c),u?(S.isEven()&&B.isEven()||(S.addTo(this,S),B.subTo(i,B)),S.rShiftTo(1,S)):B.isEven()||B.subTo(i,B),B.rShiftTo(1,B);for(;m.isEven();)m.rShiftTo(1,m),u?(W.isEven()&&H.isEven()||(W.addTo(this,W),H.subTo(i,H)),W.rShiftTo(1,W)):H.isEven()||H.subTo(i,H),H.rShiftTo(1,H);0<=c.compareTo(m)?(c.subTo(m,c),u&&S.subTo(W,S),B.subTo(H,B)):(m.subTo(c,m),u&&W.subTo(S,W),H.subTo(B,H))}return m.compareTo(r.ONE)!=0?r.ZERO:0<=H.compareTo(i)?H.subtract(i):H.signum()<0?(H.addTo(i,H),H.signum()<0?H.add(i):H):H},r.prototype.pow=function(i){return this.exp(i,new At)},r.prototype.gcd=function(i){var u=this.s<0?this.negate():this.clone(),c=i.s<0?i.negate():i.clone();u.compareTo(c)<0&&(S=u,u=c,c=S);var m=u.getLowestSetBit(),S=c.getLowestSetBit();if(S<0)return u;for(0<(S=m<S?m:S)&&(u.rShiftTo(S,u),c.rShiftTo(S,c));0<u.signum();)0<(m=u.getLowestSetBit())&&u.rShiftTo(m,u),0<(m=c.getLowestSetBit())&&c.rShiftTo(m,c),0<=u.compareTo(c)?(u.subTo(c,u),u.rShiftTo(1,u)):(c.subTo(u,c),c.rShiftTo(1,c));return 0<S&&c.lShiftTo(S,c),c},r.prototype.isProbablePrime=function(i){var u,c=this.abs();if(c.t==1&&c[0]<=z[z.length-1]){for(u=0;u<z.length;++u)if(c[0]==z[u])return!0;return!1}if(c.isEven())return!1;for(u=1;u<z.length;){for(var m=z[u],S=u+1;S<z.length&&m<tt;)m*=z[S++];for(m=c.modInt(m);u<S;)if(m%z[u++]==0)return!1}return c.millerRabin(i)},r.prototype.square=function(){var i=o();return this.squareTo(i),i},r.prototype.Barrett=Q,Pt==null){var Pt=new Array,ot=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var Nt=new Uint8Array(32);for(window.crypto.getRandomValues(Nt),kt=0;kt<32;++kt)Pt[ot++]=Nt[kt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Ut=window.crypto.random(32),kt=0;kt<Ut.length;++kt)Pt[ot++]=255&Ut.charCodeAt(kt)}for(;ot<xn;)kt=Math.floor(65536*Math.random()),Pt[ot++]=kt>>>8,Pt[ot++]=255&kt;ot=0,nt()}function Ln(){if(et==null){for(nt(),(et=new Fn).init(Pt),ot=0;ot<Pt.length;++ot)Pt[ot]=0;ot=0}return et.next()}function vr(){}function Fn(){this.i=0,this.j=0,this.S=new Array}vr.prototype.nextBytes=function(i){for(var u=0;u<i.length;++u)i[u]=Ln()},Fn.prototype.init=function(i){for(var u,c,m=0;m<256;++m)this.S[m]=m;for(m=u=0;m<256;++m)u=u+this.S[m]+i[m%i.length]&255,c=this.S[m],this.S[m]=this.S[u],this.S[u]=c;this.i=0,this.j=0},Fn.prototype.next=function(){var i;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,i=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=i,this.S[i+this.S[this.i]&255]};var xn=256;Qt.exports={default:r,BigInteger:r,SecureRandom:vr}}.call(F);var C=Zt.exports.BigInteger,Lt=(function(){function r(){M(this,r),this.tlv=null,this.t="00",this.l="00",this.v=""}return R(r,[{key:"getEncodedHex",value:function(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}},{key:"getLength",value:function(){var o=this.v.length/2,d=o.toString(16);return d.length%2==1&&(d="0"+d),o<128?d:(128+d.length/2).toString(16)+d}},{key:"getValue",value:function(){return""}}]),r})(),me=(function(){J(o,Lt);var r=X(o);function o(d){var f;return M(this,o),(f=r.call(this)).t="02",d&&(f.v=(function(A){if((g=A.toString(16))[0]!=="-")g.length%2==1?g="0"+g:g.match(/^[0-7]/)||(g="00"+g);else{var g,N=(g=g.substr(1)).length;N%2==1?N+=1:g.match(/^[0-7]/)||(N+=2);for(var V="",x=0;x<N;x++)V+="f";g=(g=(V=new C(V,16)).xor(A).add(C.ONE)).toString(16).replace(/^-/,"")}return g})(d)),f}return R(o,[{key:"getValue",value:function(){return this.v}}]),o})(),fe=(function(){J(o,Lt);var r=X(o);function o(d){var f;return M(this,o),(f=r.call(this)).t="30",f.asn1Array=d,f}return R(o,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(d){return d.getEncodedHex()})).join(""),this.v}}]),o})();function qt(r,o){return+r[o+2]<8?1:128&+r.substr(o+2,2)}function ye(r,o){var d=qt(r,o);return(r=r.substr(o+2,2*d))?(+r[0]<8?new C(r,16):new C(r.substr(2),16)).intValue():-1}function pe(r,o){return o+2*(qt(r,o)+1)}var Yt=Zt.exports.BigInteger,Wt=new Yt("3"),ve=(function(){function r(o,d){M(this,r),this.x=d,this.q=o}return R(r,[{key:"equals",value:function(o){return o===this||this.q.equals(o.q)&&this.x.equals(o.x)}},{key:"toBigInteger",value:function(){return this.x}},{key:"negate",value:function(){return new r(this.q,this.x.negate().mod(this.q))}},{key:"add",value:function(o){return new r(this.q,this.x.add(o.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(o){return new r(this.q,this.x.subtract(o.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(o){return new r(this.q,this.x.multiply(o.toBigInteger()).mod(this.q))}},{key:"divide",value:function(o){return new r(this.q,this.x.multiply(o.toBigInteger().modInverse(this.q)).mod(this.q))}},{key:"square",value:function(){return new r(this.q,this.x.square().mod(this.q))}}]),r})(),ie=(function(){function r(o,d,f,A){M(this,r),this.curve=o,this.x=d,this.y=f,this.z=A==null?Yt.ONE:A,this.zinv=null}return R(r,[{key:"getX",value:function(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"getY",value:function(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"equals",value:function(o){return o===this||(this.isInfinity()?o.isInfinity():o.isInfinity()?this.isInfinity():!!o.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(o.z)).mod(this.curve.q).equals(Yt.ZERO)&&o.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(o.z)).mod(this.curve.q).equals(Yt.ZERO))}},{key:"isInfinity",value:function(){return this.x===null&&this.y===null||this.z.equals(Yt.ZERO)&&!this.y.toBigInteger().equals(Yt.ZERO)}},{key:"negate",value:function(){return new r(this.curve,this.x,this.y.negate(),this.z)}},{key:"add",value:function(o){if(this.isInfinity())return o;if(o.isInfinity())return this;var d=this.x.toBigInteger(),f=this.y.toBigInteger(),A=this.z,g=o.x.toBigInteger(),N=o.y.toBigInteger(),V=o.z,x=this.curve.q,lt=d.multiply(V).mod(x);return o=g.multiply(A).mod(x),d=lt.subtract(o),g=f.multiply(V).mod(x),f=N.multiply(A).mod(x),N=g.subtract(f),Yt.ZERO.equals(d)?Yt.ZERO.equals(N)?this.twice():this.curve.infinity:(f=lt.add(o),o=A.multiply(V).mod(x),V=d.square().mod(x),A=d.multiply(V).mod(x),f=o.multiply(N.square()).subtract(f.multiply(V)).mod(x),d=d.multiply(f).mod(x),g=N.multiply(V.multiply(lt).subtract(f)).subtract(g.multiply(A)).mod(x),x=A.multiply(o).mod(x),new r(this.curve,this.curve.fromBigInteger(d),this.curve.fromBigInteger(g),x))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var o=this.x.toBigInteger(),d=this.y.toBigInteger(),f=this.z,A=this.curve.q,g=this.curve.a.toBigInteger(),N=o.square().multiply(Wt).add(g.multiply(f.square())).mod(A),V=d.shiftLeft(1).multiply(f).mod(A),x=(g=(x=d.square().mod(A)).multiply(o).multiply(f).mod(A),d=V.square().mod(A),o=N.square().subtract(g.shiftLeft(3)).mod(A),f=V.multiply(o).mod(A),N.multiply(g.shiftLeft(2).subtract(o)).subtract(d.shiftLeft(1).multiply(x)).mod(A));return A=V.multiply(d).mod(A),new r(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(x),A)}},{key:"multiply",value:function(o){if(this.isInfinity())return this;if(!o.signum())return this.curve.infinity;for(var d=o.multiply(Wt),f=this.negate(),A=this,g=d.bitLength()-2;0<g;g--){A=A.twice();var N=d.testBit(g);N!==o.testBit(g)&&(A=A.add(N?this:f))}return A}}]),r})(),xt=(function(){function r(o,d,f){M(this,r),this.q=o,this.a=this.fromBigInteger(d),this.b=this.fromBigInteger(f),this.infinity=new ie(this,null,null)}return R(r,[{key:"equals",value:function(o){return o===this||this.q.equals(o.q)&&this.a.equals(o.a)&&this.b.equals(o.b)}},{key:"fromBigInteger",value:function(o){return new ve(this.q,o)}},{key:"decodePointHex",value:function(o){switch(parseInt(o.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var d=(o.length-2)/2,f=o.substr(2,d);return d=o.substr(2+d,d),new ie(this,this.fromBigInteger(new Yt(f,16)),this.fromBigInteger(new Yt(d,16)))}}}]),r})(),Mt={ECPointFp:ie,ECCurveFp:xt},ue=Zt.exports.BigInteger,Ie=(xt=Zt.exports.SecureRandom,Mt.ECCurveFp),Pe=new xt,se=(Mt=D()).curve,y=Mt.G,_=Mt.n;function D(){var r=new ue("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),o=new ue("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),d=new ue("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return d=(o=new Ie(r,o,d)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:o,G:d,n:new ue("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function k(r,o){return r.length>=o?r:new Array(o-r.length+1).join("0")+r}function T(r,o){for(var d=[],f=~~(o/8),A=o%8,g=0,N=r.length;g<N;g++)d[g]=(r[(g+f)%N]<<A&255)+(r[(g+f+1)%N]>>>8-A&255);return d}function K(r,o){for(var d=[],f=r.length-1;0<=f;f--)d[f]=255&(r[f]^o[f]);return d}function ut(r,o){for(var d=[],f=r.length-1;0<=f;f--)d[f]=r[f]&o[f]&255;return d}function Et(r,o){for(var d=[],f=r.length-1;0<=f;f--)d[f]=255&(r[f]|o[f]);return d}function gt(r,o){for(var d=[],f=0,A=r.length-1;0<=A;A--){var g=r[A]+o[A]+f;f=255<g?1:0,d[A]=255&g}return d}function te(r,o,d,f){return 0<=f&&f<=15?K(K(r,o),d):Et(ut(r,o),ut((function(A){for(var g=[],N=A.length-1;0<=N;N--)g[N]=255&~A[N];return g})(r),d))}function oe(r,o){for(var d=[],f=[],A=0;A<16;A++){var g=4*A;d.push(o.slice(g,4+g))}for(var N,V=16;V<68;V++)d.push(K(K((N=K(K(d[V-16],d[V-9]),T(d[V-3],15)),K(K(N,T(N,15)),T(N,23))),T(d[V-13],7)),d[V-6]));for(var x=0;x<64;x++)f.push(K(d[x],d[x+4]));for(var lt,dt,O,Z=[121,204,69,25],it=[122,135,157,138],rt=r.slice(0,4),ft=r.slice(4,8),At=r.slice(8,12),Ft=r.slice(12,16),Q=r.slice(16,20),et=r.slice(20,24),z=r.slice(24,28),tt=r.slice(28,32),nt=0;nt<64;nt++){var Pt=0<=nt&&nt<=15?Z:it,ot=K(Nt=T(gt(gt(T(rt,12),Q),T(Pt,nt)),7),T(rt,12)),Nt=(ot=gt(gt(gt((lt=rt,dt=ft,O=At,0<=(Pt=nt)&&Pt<=15?K(K(lt,dt),O):Et(Et(ut(lt,dt),ut(lt,O)),ut(dt,O))),Ft),ot),f[nt]),gt(gt(gt(te(Q,et,z,nt),tt),Nt),d[nt]));Ft=At,At=T(ft,9),ft=rt,rt=ot,tt=z,z=T(et,19),et=Q,Q=K(K(Nt,T(Nt,9)),T(Nt,17))}return K([].concat(rt,ft,At,Ft,Q,et,z,tt),r)}xt={getGlobalCurve:function(){return se},generateEcparam:D,generateKeyPairHex:function(r,o,d){return{privateKey:d=k((o=(r?new ue(r,o,d):new ue(_.bitLength(),Pe)).mod(_.subtract(ue.ONE)).add(ue.ONE)).toString(16),64),publicKey:"04"+k((o=y.multiply(o)).getX().toBigInteger().toString(16),64)+k(o.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(r){for(var o=(r=unescape(encodeURIComponent(r))).length,d=[],f=0;f<o;f++)d[f>>>2]|=(255&r.charCodeAt(f))<<24-f%4*8;for(var A=[],g=0;g<o;g++){var N=d[g>>>2]>>>24-g%4*8&255;A.push((N>>>4).toString(16)),A.push((15&N).toString(16))}return A.join("")},leftPad:k,arrayToHex:function(r){return r.map((function(o){return(o=o.toString(16)).length===1?"0"+o:o})).join("")},arrayToUtf8:function(r){for(var o=[],d=0,f=0;f<2*r.length;f+=2)o[f>>>3]|=parseInt(r[d],10)<<24-f%8*4,d++;try{for(var A=[],g=0;g<r.length;g++){var N=o[g>>>2]>>>24-g%4*8&255;A.push(String.fromCharCode(N))}return decodeURIComponent(escape(A.join("")))}catch(V){throw new Error("Malformed UTF-8 data")}},hexToArray:function(r){for(var o=[],d=(r=(d=r.length)%2!=0?k(r,d+1):r).length,f=0;f<d;f+=2)o.push(parseInt(r.substr(f,2),16));return o},verifyPublicKey:function(r){var o=se.decodePointHex(r);return!!o&&(r=o.getX(),o.getY().square().equals(r.multiply(r.square()).add(r.multiply(se.a)).add(se.b)))}},Mt=function(r){for(var o=448<=(o=(V=8*r.length)%512)?512-o%448-1:448-o-1,d=new Array((o-7)/8),f=0,A=d.length;f<A;f++)d[f]=0;for(var g,N=[],V=V.toString(2),x=7;0<=x;x--)8<V.length?(g=V.length-8,N[x]=parseInt(V.substr(g),2),V=V.substr(0,g)):0<V.length?(N[x]=parseInt(V,2),V=""):N[x]=0;for(var lt=[].concat(r,[128],d,N),dt=lt.length/64,O=[115,128,22,111,73,20,178,185,23,36,66,215,218,138,6,0,169,111,48,188,22,49,56,170,227,141,238,77,176,251,14,78],Z=0;Z<dt;Z++){var it=64*Z;O=oe(O,lt.slice(it,64+it))}return O};var vt=Zt.exports.BigInteger,go=function(r,o){return r=new me(r),o=new me(o),new fe([r,o]).getEncodedHex()},Do=function(r){var o=pe(r,0),d=pe(r,o),f=ye(r,o);return o=r.substr(d,2*f),d=pe(r,f=d+o.length),f=ye(r,f),r=r.substr(d,2*f),{r:new C(o,16),s:new C(r,16)}},yt=xt,Me=Mt,Ge=(xt=yt.generateEcparam()).G,Er=xt.curve,Be=xt.n;function br(r,o,d){var f=2<arguments.length&&d!==void 0?d:"1234567812345678",A=(f=yt.utf8ToHex(f),yt.leftPad(Ge.curve.a.toBigInteger().toRadix(16),64)),g=yt.leftPad(Ge.curve.b.toBigInteger().toRadix(16),64),N=yt.leftPad(Ge.getX().toBigInteger().toRadix(16),64),V=yt.leftPad(Ge.getY().toBigInteger().toRadix(16),64);return d=(o=128<o.length?o.substr(2,128):o).substr(0,64),o=o.substr(64,64),o=yt.hexToArray(f+A+g+N+V+d+o),f=4*f.length,o.unshift(255&f),o.unshift(f>>8&255),o=Me(o),yt.arrayToHex(Me(o.concat(yt.hexToArray(r))))}function Sr(){var r=yt.generateKeyPairHex(),o=Er.decodePointHex(r.publicKey);return r.k=new vt(r.privateKey,16),r.x1=o.getX().toBigInteger(),r}xt={generateKeyPairHex:yt.generateKeyPairHex,doEncrypt:function(r,o){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;r=typeof r=="string"?yt.hexToArray(yt.utf8ToHex(r)):Array.prototype.slice.call(r),o=yt.getGlobalCurve().decodePointHex(o);var f=yt.generateKeyPairHex(),A=new vt(f.privateKey,16),g=f.publicKey;128<g.length&&(g=g.substr(g.length-128)),f=o.multiply(A),A=yt.hexToArray(yt.leftPad(f.getX().toBigInteger().toRadix(16),64)),o=yt.hexToArray(yt.leftPad(f.getY().toBigInteger().toRadix(16),64)),f=yt.arrayToHex(Me([].concat(A,r,o)));var N,V=1,x=0,lt=[],dt=[].concat(A,o);(N=function(){lt=Me([].concat(Ot(dt),[V>>24&255,V>>16&255,V>>8&255,255&V])),V++,x=0})();for(var O=0,Z=r.length;O<Z;O++)x===lt.length&&N(),r[O]^=255<[x++];return o=yt.arrayToHex(r),d===0?g+o+f:g+f+o},doDecrypt:function(r,o){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,f=(g=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":g;o=new vt(o,16);var A=r.substr(128,64),g=r.substr(192);d===0&&(A=r.substr(r.length-64),g=r.substr(128,r.length-128-64));var N,V=yt.hexToArray(g),x=(r=yt.getGlobalCurve().decodePointHex("04"+r.substr(0,128)).multiply(o),o=yt.hexToArray(yt.leftPad(r.getX().toBigInteger().toRadix(16),64)),r=yt.hexToArray(yt.leftPad(r.getY().toBigInteger().toRadix(16),64)),1),lt=0,dt=[],O=[].concat(o,r);(N=function(){dt=Me([].concat(Ot(O),[x>>24&255,x>>16&255,x>>8&255,255&x])),x++,lt=0})();for(var Z=0,it=V.length;Z<it;Z++)lt===dt.length&&N(),V[Z]^=255&dt[lt++];return yt.arrayToHex(Me([].concat(o,V,r)))===A?f==="array"?V:yt.arrayToUtf8(V):f==="array"?[]:""},doSignature:function(r,o){var d=(V=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,f=V.der,A=V.hash,g=V.publicKey,N=V.userId,V=typeof r=="string"?yt.utf8ToHex(r):yt.arrayToHex(r);A&&(V=br(V,g||(r=o,A=Ge.multiply(new vt(r,16)),"04"+(r=yt.leftPad(A.getX().toBigInteger().toString(16),64))+(A=yt.leftPad(A.getY().toBigInteger().toString(16),64))),N));var x=new vt(o,16),lt=new vt(V,16),dt=null,O=null,Z=null;do do{var it;dt=(it=d&&d.length?d.pop():Sr()).k,O=lt.add(it.x1).mod(Be)}while(O.equals(vt.ZERO)||O.add(dt).equals(Be));while((Z=x.add(vt.ONE).modInverse(Be).multiply(dt.subtract(O.multiply(x))).mod(Be)).equals(vt.ZERO));return f?go(O,Z):yt.leftPad(O.toString(16),64)+yt.leftPad(Z.toString(16),64)},doVerifySignature:function(r,o,d){var f,A,g=(V=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,N=V.hash,V=V.userId;return r=typeof r=="string"?yt.utf8ToHex(r):yt.arrayToHex(r),N&&(r=br(r,d,V)),A=g?(f=(A=Do(o)).r,A.s):(f=new vt(o.substring(0,64),16),new vt(o.substring(64),16)),o=Er.decodePointHex(d),d=new vt(r,16),!(r=f.add(A).mod(Be)).equals(vt.ZERO)&&(o=Ge.multiply(A).add(o.multiply(r)),d=d.add(o.getX().toBigInteger()).mod(Be),f.equals(d))},getPoint:Sr,verifyPublicKey:yt.verifyPublicKey};var Io=Mt,mn=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],yn=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function On(r){for(var o=[],d=0,f=r.length;d<f;d+=2)o.push(parseInt(r.substr(d,2),16));return o}function ke(r,o){return r<<o|r>>>32-o}function Re(r){return(255&mn[r>>>24&255])<<24|(255&mn[r>>>16&255])<<16|(255&mn[r>>>8&255])<<8|255&mn[255&r]}function An(r){return r^ke(r,2)^ke(r,10)^ke(r,18)^ke(r,24)}function hn(r){return r^ke(r,13)^ke(r,23)}function Rr(r,o,d,f){f=(g=(N=3<arguments.length&&f!==void 0?f:{}).padding)===void 0?"pkcs#5":g;var A=N.mode,g=(g=N.iv)===void 0?[]:g,N=(N=N.output)===void 0?"string":N;if(A==="cbc"&&(g=typeof g=="string"?On(g):g).length!==16)throw new Error("iv is invalid");if((o=typeof o=="string"?On(o):o).length!==16)throw new Error("key is invalid");if(r=(typeof r=="string"?d!==0?function(Q){for(var et=[],z=0,tt=Q.length;z<tt;z++){var nt=Q.codePointAt(z);if(nt<=127)et.push(nt);else if(nt<=2047)et.push(192|nt>>>6),et.push(128|63&nt);else if(nt<=55295||57344<=nt&&nt<=65535)et.push(224|nt>>>12),et.push(128|nt>>>6&63),et.push(128|63&nt);else{if(!(65536<=nt&&nt<=1114111))throw et.push(nt),new Error("input is not supported");z++,et.push(240|nt>>>18&28),et.push(128|nt>>>12&63),et.push(128|nt>>>6&63),et.push(128|63&nt)}}return et}:On:Ot)(r),f==="pkcs#5"&&d!==0)for(var V=16-r.length%16,x=0;x<V;x++)r.push(V);var lt=new Array(32);(function(Q,et,z){for(var tt=new Array(4),nt=new Array(4),Pt=0;Pt<4;Pt++)nt[0]=255&Q[0+4*Pt],nt[1]=255&Q[1+4*Pt],nt[2]=255&Q[2+4*Pt],nt[3]=255&Q[3+4*Pt],tt[Pt]=nt[0]<<24|nt[1]<<16|nt[2]<<8|nt[3];tt[0]^=2746333894,tt[1]^=1453994832,tt[2]^=1736282519,tt[3]^=2993693404;for(var ot,Nt=0;Nt<32;Nt+=4)ot=tt[1]^tt[2]^tt[3]^yn[Nt+0],et[Nt+0]=tt[0]^=hn(Re(ot)),ot=tt[2]^tt[3]^tt[0]^yn[Nt+1],et[Nt+1]=tt[1]^=hn(Re(ot)),ot=tt[3]^tt[0]^tt[1]^yn[Nt+2],et[Nt+2]=tt[2]^=hn(Re(ot)),ot=tt[0]^tt[1]^tt[2]^yn[Nt+3],et[Nt+3]=tt[3]^=hn(Re(ot));if(z===0)for(var Ut,kt=0;kt<16;kt++)Ut=et[kt],et[kt]=et[31-kt],et[31-kt]=Ut})(o,lt,d);for(var dt=[],O=g,Z=r.length,it=0;16<=Z;){var rt=r.slice(it,it+16),ft=new Array(16);if(A==="cbc")for(var At=0;At<16;At++)d!==0&&(rt[At]^=O[At]);(function(Q,et,z){for(var tt=new Array(4),nt=new Array(4),Pt=0;Pt<4;Pt++)nt[0]=255&Q[4*Pt],nt[1]=255&Q[4*Pt+1],nt[2]=255&Q[4*Pt+2],nt[3]=255&Q[4*Pt+3],tt[Pt]=nt[0]<<24|nt[1]<<16|nt[2]<<8|nt[3];for(var ot,Nt=0;Nt<32;Nt+=4)ot=tt[1]^tt[2]^tt[3]^z[Nt+0],tt[0]^=An(Re(ot)),ot=tt[2]^tt[3]^tt[0]^z[Nt+1],tt[1]^=An(Re(ot)),ot=tt[3]^tt[0]^tt[1]^z[Nt+2],tt[2]^=An(Re(ot)),ot=tt[0]^tt[1]^tt[2]^z[Nt+3],tt[3]^=An(Re(ot));for(var Ut=0;Ut<16;Ut+=4)et[Ut]=tt[3-Ut/4]>>>24&255,et[Ut+1]=tt[3-Ut/4]>>>16&255,et[Ut+2]=tt[3-Ut/4]>>>8&255,et[Ut+3]=255&tt[3-Ut/4]})(rt,ft,lt);for(var Ft=0;Ft<16;Ft++)A==="cbc"&&d===0&&(ft[Ft]^=O[Ft]),dt[it+Ft]=ft[Ft];A==="cbc"&&(O=d!==0?ft:rt),Z-=16,it+=16}return f==="pkcs#5"&&d===0&&(f=dt[dt.length-1],dt.splice(dt.length-f,f)),N!=="array"?d!==0?dt.map((function(Q){return(Q=Q.toString(16)).length===1?"0"+Q:Q})).join(""):(function(Q){for(var et=[],z=0,tt=Q.length;z<tt;z++)240<=Q[z]&&Q[z]<=247?(et.push(String.fromCodePoint(((7&Q[z])<<18)+((63&Q[z+1])<<12)+((63&Q[z+2])<<6)+(63&Q[z+3]))),z+=3):224<=Q[z]&&Q[z]<=239?(et.push(String.fromCodePoint(((15&Q[z])<<12)+((63&Q[z+1])<<6)+(63&Q[z+2]))),z+=2):192<=Q[z]&&Q[z]<=223?(et.push(String.fromCodePoint(((31&Q[z])<<6)+(63&Q[z+1]))),z++):et.push(String.fromCodePoint(Q[z]));return et.join("")})(dt):dt}var Po=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Ne=[],Eo=function(r,o,d){for(var f=r[0],A=r[1],g=r[2],N=r[3],V=r[4],x=r[5],lt=r[6],dt=r[7],O=0;O<64;O++){O<16?Ne[O]=0|o[d+O]:(Z=Ne[O-15],it=Ne[O-2],Ne[O]=((Z<<25|Z>>>7)^(Z<<14|Z>>>18)^Z>>>3)+Ne[O-7]+((it<<15|it>>>17)^(it<<13|it>>>19)^it>>>10)+Ne[O-16]);var Z=f&A^f&g^A&g,it=dt+((V<<26|V>>>6)^(V<<21|V>>>11)^(V<<7|V>>>25))+(V&x^~V<)+Po[O]+Ne[O];dt=lt,lt=x,x=V,V=N+it|0,N=g,g=A,A=f,f=it+(((f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22))+Z)|0}r[0]=r[0]+f|0,r[1]=r[1]+A|0,r[2]=r[2]+g|0,r[3]=r[3]+N|0,r[4]=r[4]+V|0,r[5]=r[5]+x|0,r[6]=r[6]+lt|0,r[7]=r[7]+dt|0},Tr=(xt={c2:xt,c3:function(r){return r=typeof r=="string"?(function(o){for(var d=[],f=0,A=o.length;f<A;f++){var g=o.codePointAt(f);if(g<=127)d.push(g);else if(g<=2047)d.push(192|g>>>6),d.push(128|63&g);else if(g<=55295||57344<=g&&g<=65535)d.push(224|g>>>12),d.push(128|g>>>6&63),d.push(128|63&g);else{if(!(65536<=g&&g<=1114111))throw d.push(g),new Error("input is not supported");f++,d.push(240|g>>>18&28),d.push(128|g>>>12&63),d.push(128|g>>>6&63),d.push(128|63&g)}}return d})(r):Array.prototype.slice.call(r),Io(r).map((function(o){return(o=o.toString(16)).length===1?"0"+o:o})).join("")},c4:{encrypt:function(r,o,d){return Rr(r,o,1,d)},decrypt:function(r,o,d){return Rr(r,o,0,d)}},s2:function(r){var o=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],d=(function(A){for(var g=[],N=0;N<Math.ceil(A.length/4);N++)g[N]=A[4*N]<<24|(255&A[4*N+1])<<16|(255&A[4*N+2])<<8|255&A[4*N+3];return g})(r);d[(r=8*r.length)>>5]|=128<<24-r%32,d[15+(64+r>>9<<4)]=r;for(var f=0;f<d.length;f+=16)Eo(o,d,f);return(function(A){for(var g=[],N=0;N<A.length;N++)g[4*N]=A[N]>>24&255,g[4*N+1]=A[N]>>16&255,g[4*N+2]=A[N]>>8&255,g[4*N+3]=255&A[N];return g})(o).map((function(A){return(A=A.toString(16)).length===1?"0"+A:A})).join("")}},St),bo=It,So=Tt,Ro=zt,To=re,vo=xt.c2,No=xt.c3,wo=xt.c4,Co=xt.s2;return(function(){var r;(r=function(){}).VERSION="2.1.0";var o=F;if(o.AAR2)return o.AAR2.VERSION!==r.VERSION&&console.log(o.AAR2.VERSION),o.AAR2;var d="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",f=!1,A=!1,g=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,N=g!==void 0&&!!g.request&&!!g.login,V=function(O,Z){return typeof O=="string"&&typeof Z=="string"&&O!=null&&Z!=null&&O.substring(0,Z.length)===Z},x={SUCCESS:0,ALREADY_SUCCESS:1,ERROR_XHR_TIMEOUT:-1,ERROR_XHR_ERROR:-2,ERROR_XXX_REQUEST_TIMEOUT:-3,ERROR_XXX_REQUEST_FAIL:-4,ERROR_SIGN_CHECK:-5,ERROR_UNKNOWN_ERROR:-6,ERROR_DATA_FORMAT:-7},lt=function(O){for(var Z in x)if(x[Z]===O)return Z},dt=function(O,Z,it){var rt=Date.now(),ft=new r;try{if(!O||O.length<=75)return console.error("error format 1:",O),x.ERROR_DATA_FORMAT;if(!V(O,"eyJ"))return console.error("error format 2:",O),x.ERROR_DATA_FORMAT;O=O.substring(3,O.length);var At=bo.my_b4_decode(O);if(!At)return console.error("error format 3:",O),x.ERROR_DATA_FORMAT;var Ft,Q=ft.cc.u8.byteToInt(At.slice(0,4),0),et=At.slice(4,4+Q),z=ft.cc.u8.byteToInt(At.slice(4+Q,4+Q+4),0),tt=At.slice(4+Q+4,4+Q+4+z),nt=ft.cc.u8.byteToInt(At.slice(4+Q+4+z,4+Q+4+z+4),0),Pt=At.slice(4+Q+4+z+4,4+Q+4+z+4+nt),ot=ft.cc.u8.bytesToUtf8Str(et);if(ft.cc.h6.encode(tt,0,z),Z||(it!==void 0&&it==="sm2"?(Ft=ft.cc.h6.encode(tt,0,z),ft.co.c2.doVerifySignature(ot,Ft,d,{der:!0,hash:!0})):ft.co.c3(ot+"8890012345678890").toLowerCase()===ft.cc.h6.encode(Pt,0,nt).toLowerCase())){if(ot.length%2==0){r.prototype.__v=function(){return ot.slice(0,2)};for(var Nt=[],Ut=2;Ut<66;Ut+=2)Nt.push(parseInt("0x"+ot.slice(Ut,Ut+2)));r.prototype.__i=function(){return Nt};var kt=parseInt("0x"+ot.slice(66,82))-rt;r.prototype.__o=function(){return kt}}return N||F.AAR2||(F.AAR2=r),x.SUCCESS}}catch(Ln){return console.error(Ln),x.ERROR_UNKNOWN_ERROR}return x.ERROR_SIGN_CHECK};return r.init=function(O,Z){var it,rt={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof O=="string"?(V(O,"https")||V(O,"https")?rt.url=O:V(O,"eyJ")&&(rt.code=O),typeof Z=="string"&&(rt.publicKey=Z)):G(O)==="object"&&(O.debug&&(rt.debug=O.debug),O.url&&(rt.url=O.url),O.code&&(rt.code=O.code),O.publicKey&&(rt.publicKey=O.publicKey),O.skipVerify&&(rt.skipVerify=O.skipVerify),O.alg&&(rt.alg=O.alg),O.callback&&typeof O.callback=="function"&&(rt.callback=O.callback)),A?rt.callback&&rt.callback(!0,{errorNo:it=x.ALREADY_SUCCESS,errorMsg:lt(it)}):f?setTimeout((function(){r.init(O,Z)}),50):(f=!0,rt.debug&&Tr.start(rt.debug),rt.publicKey&&(d=rt.publicKey),rt.code?(it=dt(rt.code,rt.skipVerify))===x.SUCCESS?(f=!(A=!0),rt.callback(!0,{errorNo:it,errorMsg:lt(it)})):rt.callback(!1,{errorNo:it,errorMsg:lt(it)}):rt.url&&(function(ft,At,Ft){try{if(ft=ft+"?version="+r.VERSION+(N?"&name=wechat":"&name=browser")+"&t="+Date.now(),N)g.request({url:ft,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function(et){et.statusCode===200?At(et.data):Ft(x.ERROR_XXX_REQUEST_FAIL)},fail:function(et){et&&et.errMsg&&et.errMsg.indexOf("timeout")!==-1?Ft(x.ERROR_XXX_REQUEST_TIMEOUT):Ft(x.ERROR_XXX_REQUEST_FAIL)}});else{var Q;if(window.XMLHttpRequest)Q=new XMLHttpRequest;else if(window.ActiveXObject)try{Q=new ActiveXObject("Msxml2.XMLHTTP")}catch(et){try{Q=new ActiveXObject("Microsoft.XMLHTTP")}catch(z){}}Q&&(Q.onload=function(){Q.readyState===4&&(Q.status===200?At(Q.responseText):Ft(x.ERROR_XHR_ERROR))},Q.ontimeout=function(){Ft(x.ERROR_XHR_TIMEOUT)},Q.onerror=function(){Ft(x.ERROR_XHR_ERROR)},Q.open("POST",ft,!0),Q.timeout=5e3,Q.send(null))}}catch(et){console.error(et),Ft(x.ERROR_UNKNOWN_ERROR)}})(rt.url,(function(ft){(ft=dt(ft,rt.skipVerify,rt.alg))===x.SUCCESS?(f=!(A=!0),rt.callback(!0,{errorNo:ft,errorMsg:lt(ft)})):(f=!1,rt.callback(!1,{errorNo:ft,errorMsg:lt(ft)}))}),(function(ft){f=!1,rt.callback(!1,{errorNo:ft,errorMsg:lt(ft)})})))},r.prototype={cc:{b4:So,h6:Ro,u8:To},co:{c2:vo,c3:No,c4:wo,s2:Co},nonce:function(){var O="0000000000"+Math.ceil(2147483647*Math.random())+Math.floor((Date.now()+this.__o())/1e3);return O.substring(O.length-20)},sign:function(O,Z){return this.__s(O,Z)},__s:function(O,Z){var it=this.cc.u8.utf8StrToBytes(O),rt=this.__i();return O=this.cc.u8.utf8StrToBytes(Z),Z=this.cc.u8.utf8StrToBytes(this.__c()),O=[].concat(it,rt,O,Z),Z=parseInt("0x"+this.__v()),this.__f(Z)(O)+this.__v()},__f:function(O){var Z=this.co.s2,it=this.co.c3,rt=this.cc.h6.decode,ft=[function(At){return Z(At)},function(At){return it(At)},function(At){return it(rt(Z(At)))},function(At){return Z(rt(it(At)))},function(At){return it(rt(it(At)))},function(At){return Z(rt(Z(At)))}];return ft[(128<O?O-128:O)%ft.length]},__i:function(){return[115,128,22,111,73,20,178,185,23,36,66,215,218,138,6,0,169,111,48,188,22,49,56,170,227,141,238,77,176,251,14,78]},__v:function(){return"00"},__c:function(){if(this.__d())return"debug";if(typeof phantom!="undefined"&&phantom.exit&&phantom.injectJs)return"phantom";if(typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]"&&process.version&&process.pid&&process.argv)return"require";if(g!==void 0&&g.env&&g.request&&g.getStorage){if(typeof window!="undefined"&&window.document&&window.alert&&window.atob&&typeof window.setTimeout=="function")return"window"}else{if(!(typeof window!="undefined"&&window.document&&window.alert&&window.atob&&typeof window.setTimeout=="function"))return"window";if(!window.navigator||typeof window.navigator.vendor!="string")return"navigator";if(window.navigator.webdriver)return"webdriver"}return""},__o:function(){return 0},__d:function(){return Tr.isDebug()},version:function(){return r.VERSION}},r})()},q(l)=="object"?s.exports=P():(I=typeof(h=P)=="function"?h.call(l,p,l,s):h)===void 0||(s.exports=I)}},e={};function n(s){var l=e[s];if(l!==void 0)return l.exports;var p=e[s]={id:s,loaded:!1,exports:{}};return t[s].call(p.exports,p,p.exports,n),p.loaded=!0,p.exports}n.n=s=>{var l=s&&s.__esModule?()=>s.default:()=>s;return n.d(l,{a:l}),l},n.d=(s,l)=>{for(var p in l)n.o(l,p)&&!n.o(s,p)&&Object.defineProperty(s,p,{enumerable:!0,get:l[p]})},n.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(s){if(typeof window=="object")return window}})(),n.hmd=s=>((s=Object.create(s)).children||(s.children=[]),Object.defineProperty(s,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+s.id)}}),s),n.o=(s,l)=>Object.prototype.hasOwnProperty.call(s,l),n.r=s=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})};var a=n(737);qr.exports.LyyGetCommandSDK=a})()});var Du={};qe(Du,{AutomaticDebitErrorCode:()=>Gn,AutomaticDebitErrorMessage:()=>le,DyErrorCode:()=>ge,DyErrorMessage:()=>at,ENV_TYPE:()=>ee,EXTERNAL_ENV_TYPE:()=>he,GlobalVipErrorCode:()=>Ke,GlobalVipErrorMessage:()=>_e,JdErrorCode:()=>Pn,JdErrorMessage:()=>Ct,checkBenefit:()=>Ir,clearCache:()=>Ao,confirm:()=>Xi,createServices:()=>ho,execute:()=>Nn,getCapability:()=>Qi,getDisplayAdConfig:()=>cn,getDyPayRtaData:()=>bn,getEntryContext:()=>Dr,getProductConfig:()=>ur,getSubscribeState:()=>_n,handleDyAuthDebitSignFlow:()=>Zn,handleDyAuthDebitSignFlowWithRawPayInfo:()=>tr,handleDyJsapiPayFlow:()=>$n,handleDyPayCommandFlow:()=>zn,handleDyPayFlow:()=>En,handleJdInsurance:()=>Kn,handleJdInsuranceExt:()=>Qn,handleJdjrCashLoanExt:()=>jn,handleJdjrCashLoanFlow:()=>Hn,handleSubscribeFlow:()=>mo,normalizeDisplayAdData:()=>Sn,normalizeProductConfig:()=>ze,pollSubscribeResult:()=>yo,recordExposure:()=>_o,resumeDouyin:()=>Wi});module.exports=Mo(Du);var ee={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},he={SIT:"sit",RELEASE:"release",PROD:"prod"},Dn={[ee.DEV]:"https://dm.leyaoyao.com",[ee.SIT]:"https://sm.leyaoyao.com",[ee.UAT]:"https://um.leyaoyao.com",[ee.PROD]:"https://m.leyaoyao.com"},Cr={[ee.DEV]:"https://dad2.leyaoyao.com",[ee.SIT]:"https://sad2.leyaoyao.com",[ee.UAT]:"https://uad2.leyaoyao.com",[ee.PROD]:"https://nad.ehuoke.com"},tn={[he.SIT]:"https://sopenapi.leyaoyao.com",[he.RELEASE]:"https://uopen-api.leyaoyao.com",[he.PROD]:"https://api-gateway.leyaoyao.com"};function He(t,e){return`${Dn[t]||Dn[ee.PROD]}${e}`}function Yn(t){return Cr[t]||Cr[ee.PROD]}var je={debug:!1,env:ee.PROD,externalEnv:he.PROD,apiDomain:""},Or=L({},je);function Lr(t){Or=L(L({},je),t)}function Xt(){return Or}var Go=Object.defineProperty,Bo=(t,e,n)=>e in t?Go(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ko=(t,e,n)=>Bo(t,typeof e!="symbol"?e+"":e,n);function ce(){return typeof Taro!="undefined"&&Taro.getEnv?"taro":typeof uni!="undefined"&&uni.request?"uni":typeof wx!="undefined"&&wx.request?"wechat":typeof my!="undefined"&&my.request?"alipay":typeof window!="undefined"?"web":"unknown"}var Jo=class{constructor(t=!1){ko(this,"enable"),this.enable=t}setEnable(t){this.enable=t}info(...t){this.enable&&console.info("[BI Info]",...t)}warn(...t){this.enable&&console.warn("[BI Warn]",...t)}error(...t){this.enable&&console.error("[BI Error]",...t)}debug(...t){this.enable&&console.log("[BI Debug]",...t)}},v=new Jo;function Ce(t){let e=ce();return e==="taro"?Taro.setClipboardData({data:t}).then(()=>{v.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):e==="uni"?new Promise((n,a)=>{uni.setClipboardData({data:t,success:()=>{v.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),n()},fail:s=>{v.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",s),a(s)}})}):e==="wechat"?new Promise((n,a)=>{wx.setClipboardData({data:t,success:()=>{v.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),n()},fail:s=>{v.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",s),a(s)}})}):e==="alipay"?new Promise((n,a)=>{my.setClipboardData({text:t,success:()=>{v.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),n()},fail:s=>{v.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",s),a(s)}})}):navigator.clipboard.writeText(t).then(()=>{v.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function Mn(t,e=2e3){let n=ce();if(n==="taro"){Taro.showToast({title:t,icon:"none",mask:!0,duration:e});return}if(n==="uni"){uni.showToast({title:t,icon:"none",mask:!0,duration:e});return}if(n==="wechat"){wx.showToast({title:t,icon:"none",mask:!0,duration:e});return}if(n==="alipay"){my.showToast({content:t,duration:e});return}typeof console!="undefined"&&console.log(`[Toast] ${t}`)}async function Oe(){var t,e,n,a,s;let l=ce();try{if(l==="taro")return((t=(await Taro.getSystemInfo()).platform)==null?void 0:t.toLowerCase())==="ios"?"ios":"android";if(l==="uni")return((e=uni.getSystemInfoSync().platform)==null?void 0:e.toLowerCase())==="ios"?"ios":"android";if(l==="wechat")return wx.getDeviceInfo?((n=(await wx.getDeviceInfo()).platform)==null?void 0:n.toLowerCase())==="ios"?"ios":"android":((a=wx.getSystemInfoSync().platform)==null?void 0:a.toLowerCase())==="ios"?"ios":"android";if(l==="alipay")return((s=my.getSystemInfoSync().platform)==null?void 0:s.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let p=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(p))return"ios";if(/android/.test(p))return"android"}return"unknown"}catch(p){return v.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",p),"unknown"}}var wt={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function b(t,e,n=null){return{code:t,message:e,data:n}}function In(t,e){return t==null?{valid:!1,message:`${e}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof t=="string"&&t.trim().length===0?{valid:!1,message:`${e}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function en(t,e){for(let n of e){let a=In(t[n],n);if(!a.valid)return a}return{valid:!0}}var Wn={};qe(Wn,{handleJdInsurance:()=>Kn,handleJdInsuranceExt:()=>Qn,handleJdjrCashLoanExt:()=>jn,handleJdjrCashLoanFlow:()=>Hn});var Pn=(X=>(X[X.JD_CASH_LOAN__MISSING_PHONE=2001]="JD_CASH_LOAN__MISSING_PHONE",X[X.JD_CASH_LOAN__MISSING_DEVICE_ID=2002]="JD_CASH_LOAN__MISSING_DEVICE_ID",X[X.JD_CASH_LOAN__RTA_FAILED=2003]="JD_CASH_LOAN__RTA_FAILED",X[X.JD_CASH_LOAN__GET_CONFIG_FAILED=2004]="JD_CASH_LOAN__GET_CONFIG_FAILED",X[X.JD_CASH_LOAN__INVALID_CONFIG=2005]="JD_CASH_LOAN__INVALID_CONFIG",X[X.JD_CASH_LOAN__EXT_NOT_ELIGIBLE=2006]="JD_CASH_LOAN__EXT_NOT_ELIGIBLE",X[X.JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS=2007]="JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS",X[X.JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM=2008]="JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM",X[X.JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID=2009]="JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID",X[X.JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE=2010]="JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE",X[X.JD_INSURANCE__USER_NOT_ELIGIBLE=2101]="JD_INSURANCE__USER_NOT_ELIGIBLE",X[X.JD_INSURANCE__H5_NOT_SUPPORTED=2102]="JD_INSURANCE__H5_NOT_SUPPORTED",X[X.JD_INSURANCE__INVALID_JUMP_PARAMS=2103]="JD_INSURANCE__INVALID_JUMP_PARAMS",X[X.JD_INSURANCE__GET_CONFIG_FAILED=2104]="JD_INSURANCE__GET_CONFIG_FAILED",X[X.JD_INSURANCE__COPY_FAILED=2105]="JD_INSURANCE__COPY_FAILED",X[X.JD_INSURANCE__TASK_COMPLETED=2106]="JD_INSURANCE__TASK_COMPLETED",X[X.JD_INSURANCE__UNKNOWN_JUMP_MODE=2107]="JD_INSURANCE__UNKNOWN_JUMP_MODE",X[X.JD_INSURANCE__RTA_FAILED=2108]="JD_INSURANCE__RTA_FAILED",X))(Pn||{}),Ct={2001:"\u7F3A\u5C11\u624B\u673A\u53F7\u53C2\u6570",2002:"\u7F3A\u5C11\u8BBE\u5907ID",2003:"\u672A\u6EE1\u8DB3\u6D3B\u52A8\u8D44\u683C",2004:"\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E\u5931\u8D25",2005:"\u8DF3\u8F6C\u914D\u7F6E\u53C2\u6570\u5F02\u5E38",2006:"\u7528\u6237\u4E0D\u7B26\u5408\u6D3B\u52A8\u53C2\u4E0E\u6761\u4EF6",2007:"\u8DF3\u8F6C\u53C2\u6570\u5F02\u5E38",2008:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u5E73\u53F0\u53C2\u6570",2009:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u7528\u6237ID",2010:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u8BBE\u5907\u503C",2101:"\u7528\u6237\u4E0D\u7B26\u5408\u6D3B\u52A8\u53C2\u4E0E\u6761\u4EF6",2102:"H5\u6A21\u5F0F\u6682\u4E0D\u652F\u6301",2103:"\u8DF3\u8F6C\u53C2\u6570\u5F02\u5E38",2104:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u5931\u8D25",2105:"\u590D\u5236\u53E3\u4EE4\u5931\u8D25",2106:"\u7528\u6237\u5DF2\u5B8C\u6210\u4EFB\u52A1",2107:"\u672A\u77E5\u8DF3\u8F6C\u6A21\u5F0F",2108:"RTA\u6821\u9A8C\u5931\u8D25"},ge=(C=>(C[C.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",C[C.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",C[C.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",C[C.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",C[C.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",C[C.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",C[C.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",C[C.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",C[C.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",C[C.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",C[C.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",C[C.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",C[C.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",C[C.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",C[C.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",C[C.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",C[C.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",C[C.DY_PAY__INVALID_RETURN_TYPE=3018]="DY_PAY__INVALID_RETURN_TYPE",C[C.DY_PAY__JSAPI_INFO_FAILED=3019]="DY_PAY__JSAPI_INFO_FAILED",C[C.DY_PAY__REQUEST_JSAPI_INFO_FAILED=3020]="DY_PAY__REQUEST_JSAPI_INFO_FAILED",C[C.DY_PAY__MISSING_JSAPI_PAY_INFO=3021]="DY_PAY__MISSING_JSAPI_PAY_INFO",C[C.DY_PAY__INVALID_JSAPI_PAY_INFO=3022]="DY_PAY__INVALID_JSAPI_PAY_INFO",C[C.DY_PAY__JSAPI_SIGNATURE_FAILED=3023]="DY_PAY__JSAPI_SIGNATURE_FAILED",C[C.DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED=3024]="DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED",C[C.DY_PAY__JSAPI_UNSUPPORTED_ENV=3025]="DY_PAY__JSAPI_UNSUPPORTED_ENV",C[C.DY_PAY__JSAPI_AUTH_REDIRECT_FAILED=3026]="DY_PAY__JSAPI_AUTH_REDIRECT_FAILED",C[C.DY_PAY__JSAPI_SDK_LOAD_FAILED=3027]="DY_PAY__JSAPI_SDK_LOAD_FAILED",C[C.DY_PAY__JSAPI_CONFIG_FAILED=3028]="DY_PAY__JSAPI_CONFIG_FAILED",C[C.DY_PAY__JSAPI_INVOKE_FAILED=3029]="DY_PAY__JSAPI_INVOKE_FAILED",C[C.DY_PAY__MISSING_AUTH_TOKEN=3030]="DY_PAY__MISSING_AUTH_TOKEN",C[C.DY_PAY_COMMAND__MISSING_ORDER_AMOUNT=3031]="DY_PAY_COMMAND__MISSING_ORDER_AMOUNT",C[C.DY_PAY_COMMAND__GET_FAILED=3032]="DY_PAY_COMMAND__GET_FAILED",C[C.DY_PAY_COMMAND__REQUEST_FAILED=3033]="DY_PAY_COMMAND__REQUEST_FAILED",C[C.DY_PAY_COMMAND__COPY_FAILED=3034]="DY_PAY_COMMAND__COPY_FAILED",C[C.DY_PAY_COMMAND__INVALID_RTA_DATA=3035]="DY_PAY_COMMAND__INVALID_RTA_DATA",C[C.DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID=3036]="DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID",C[C.DY_PAY__AUTH_DEBIT_SIGN_FAILED=3037]="DY_PAY__AUTH_DEBIT_SIGN_FAILED",C[C.DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED=3038]="DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED",C[C.DY_PAY__JSAPI_PAY_CANCELLED=3039]="DY_PAY__JSAPI_PAY_CANCELLED",C))(ge||{}),at={3001:"\u7F3A\u5C11\u624B\u673A\u53F7\u53C2\u6570",3002:"\u7F3A\u5C11\u8BBE\u5907ID\u53C2\u6570",3003:"\u7F3A\u5C11\u5957\u9910\u91D1\u989D\u53C2\u6570",3004:"\u65E0\u6548\u7684\u5BA2\u6237\u7AEF\u7C7B\u578B",3005:"\u4E1A\u52A1\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E",3006:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u5931\u8D25",3007:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u8BF7\u6C42\u5931\u8D25",3008:"\u7EDF\u4E00\u4E0B\u5355\u5931\u8D25",3009:"\u7EDF\u4E00\u4E0B\u5355\u8BF7\u6C42\u5931\u8D25",3010:"\u83B7\u53D6\u8DF3\u8F6C\u5730\u5740\u5931\u8D25",3011:"\u7F51\u7EDC\u8BF7\u6C42\u5F02\u5E38",3012:"\u4E0B\u5355\u6D41\u7A0B\u5F02\u5E38",3013:"\u83B7\u53D6RTA\u4FE1\u606F\u5931\u8D25",3014:"\u83B7\u53D6RTA\u4FE1\u606F\u8BF7\u6C42\u5931\u8D25",3015:"\u83B7\u53D6RTA\u4FE1\u606F\u5F02\u5E38",3016:"\u65E0\u6548\u7684\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u65B9\u5F0F",3017:"\u7F3A\u5C11\u4E1A\u52A1\u7C7B\u578B\u53C2\u6570",3018:"\u65E0\u6548\u7684\u8FD4\u56DE\u5730\u5740\u7C7B\u578B",3019:"\u83B7\u53D6JSAPI\u652F\u4ED8\u4FE1\u606F\u5931\u8D25",3020:"\u83B7\u53D6JSAPI\u652F\u4ED8\u4FE1\u606F\u8BF7\u6C42\u5931\u8D25",3021:"\u7F3A\u5C11JSAPI\u652F\u4ED8\u53C2\u6570",3022:"JSAPI\u652F\u4ED8\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E",3023:"\u83B7\u53D6JSAPI\u652F\u4ED8\u7B7E\u540D\u5931\u8D25",3024:"\u83B7\u53D6JSAPI\u652F\u4ED8\u7B7E\u540D\u8BF7\u6C42\u5931\u8D25",3025:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u6296\u97F3JSAPI\u652F\u4ED8",3026:"\u6296\u97F3\u6388\u6743\u8DF3\u8F6C\u5931\u8D25",3027:"\u6296\u97F3\u5F00\u653ESDK\u52A0\u8F7D\u5931\u8D25",3028:"\u6296\u97F3JSSDK\u521D\u59CB\u5316\u5931\u8D25",3029:"\u6296\u97F3JSAPI\u652F\u4ED8\u8C03\u8D77\u5931\u8D25",3030:"\u7F3A\u5C11\u6296\u97F3\u6388\u6743token",3031:"\u7F3A\u5C11\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4\u91D1\u989D",3032:"\u83B7\u53D6\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4\u5931\u8D25",3033:"\u83B7\u53D6\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4\u8BF7\u6C42\u5931\u8D25",3034:"\u590D\u5236\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4\u5931\u8D25",3035:"\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4RTA\u6570\u636E\u65E0\u6548",3036:"\u7F3A\u5C11\u6388\u6743\u4EE3\u6263\u7B7E\u7EA6requestId",3037:"\u6388\u6743\u4EE3\u6263\u7B7E\u7EA6\u5931\u8D25",3038:"\u6388\u6743\u4EE3\u6263\u7B7E\u7EA6\u8BF7\u6C42\u5931\u8D25",3039:"\u7528\u6237\u53D6\u6D88\u6296\u97F3\u652F\u4ED8"},Ke=(J=>(J[J.GLOBAL_VIP__MISSING_EQUIPMENT_VALUE=4001]="GLOBAL_VIP__MISSING_EQUIPMENT_VALUE",J[J.GLOBAL_VIP__MISSING_EQUIPMENT_TYPE=4002]="GLOBAL_VIP__MISSING_EQUIPMENT_TYPE",J[J.GLOBAL_VIP__INVALID_CLIENT_TYPE=4003]="GLOBAL_VIP__INVALID_CLIENT_TYPE",J[J.GLOBAL_VIP__ENTRANCE_CHECK_FAILED=4004]="GLOBAL_VIP__ENTRANCE_CHECK_FAILED",J[J.GLOBAL_VIP__MISSING_SUBSCRIBE_TYPE=4005]="GLOBAL_VIP__MISSING_SUBSCRIBE_TYPE",J[J.GLOBAL_VIP__CONFIG_FAILED=4006]="GLOBAL_VIP__CONFIG_FAILED",J[J.GLOBAL_VIP__INVALID_CONFIG=4007]="GLOBAL_VIP__INVALID_CONFIG",J[J.GLOBAL_VIP__STATE_QUERY_FAILED=4008]="GLOBAL_VIP__STATE_QUERY_FAILED",J[J.GLOBAL_VIP__ALREADY_ACTIVE=4009]="GLOBAL_VIP__ALREADY_ACTIVE",J[J.GLOBAL_VIP__SIGN_FAILED=4010]="GLOBAL_VIP__SIGN_FAILED",J[J.GLOBAL_VIP__INVALID_SIGN_RESULT=4011]="GLOBAL_VIP__INVALID_SIGN_RESULT",J[J.GLOBAL_VIP__BENEFIT_QUERY_FAILED=4012]="GLOBAL_VIP__BENEFIT_QUERY_FAILED",J[J.GLOBAL_VIP__EXPOSURE_FAILED=4013]="GLOBAL_VIP__EXPOSURE_FAILED",J[J.GLOBAL_VIP__DISCOUNT_CHECK_FAILED=4014]="GLOBAL_VIP__DISCOUNT_CHECK_FAILED",J[J.GLOBAL_VIP__POLL_FAILED=4015]="GLOBAL_VIP__POLL_FAILED",J))(Ke||{}),_e={4001:"\u7F3A\u5C11\u8BBE\u5907\u7F16\u53F7",4002:"\u7F3A\u5C11\u8BBE\u5907\u7C7B\u578B",4003:"\u65E0\u6548\u7684\u5BA2\u6237\u7AEF\u7C7B\u578B",4004:"\u5E73\u53F0\u5927\u4F1A\u5458\u5165\u53E3\u8D44\u683C\u67E5\u8BE2\u5931\u8D25",4005:"\u672A\u83B7\u53D6\u5230\u5E73\u53F0\u5927\u4F1A\u5458\u5361\u7C7B\u578B",4006:"\u5E73\u53F0\u5927\u4F1A\u5458\u8BA2\u9605\u914D\u7F6E\u67E5\u8BE2\u5931\u8D25",4007:"\u5E73\u53F0\u5927\u4F1A\u5458\u8BA2\u9605\u914D\u7F6E\u65E0\u6548",4008:"\u5E73\u53F0\u5927\u4F1A\u5458\u72B6\u6001\u67E5\u8BE2\u5931\u8D25",4009:"\u7528\u6237\u5DF2\u5F00\u901A\u5E73\u53F0\u5927\u4F1A\u5458",4010:"\u5E73\u53F0\u5927\u4F1A\u5458\u7B7E\u7EA6\u5931\u8D25",4011:"\u5E73\u53F0\u5927\u4F1A\u5458\u7B7E\u7EA6\u7ED3\u679C\u65E0\u6548",4012:"\u5E73\u53F0\u5927\u4F1A\u5458\u6743\u76CA\u67E5\u8BE2\u5931\u8D25",4013:"\u5E73\u53F0\u5927\u4F1A\u5458\u66DD\u5149\u8BB0\u5F55\u5931\u8D25",4014:"\u6296\u97F3\u7B7E\u7EA6\u4F18\u60E0\u8D44\u683C\u67E5\u8BE2\u5931\u8D25",4015:"\u5E73\u53F0\u5927\u4F1A\u5458\u7B7E\u7EA6\u7ED3\u679C\u8F6E\u8BE2\u5931\u8D25"},Gn=(I=>(I[I.AUTO_DEBIT__INVALID_PARAM=4101]="AUTO_DEBIT__INVALID_PARAM",I[I.AUTO_DEBIT__SIGN_REQUEST_FAILED=4102]="AUTO_DEBIT__SIGN_REQUEST_FAILED",I[I.AUTO_DEBIT__INVALID_RESPONSE=4103]="AUTO_DEBIT__INVALID_RESPONSE",I[I.AUTO_DEBIT__UNSUPPORTED_CAPABILITY=4104]="AUTO_DEBIT__UNSUPPORTED_CAPABILITY",I[I.AUTO_DEBIT__CHANNEL_INVOKE_FAILED=4105]="AUTO_DEBIT__CHANNEL_INVOKE_FAILED",I[I.AUTO_DEBIT__USER_CANCELLED=4106]="AUTO_DEBIT__USER_CANCELLED",I[I.AUTO_DEBIT__CONFIRM_FAILED=4107]="AUTO_DEBIT__CONFIRM_FAILED",I[I.AUTO_DEBIT__CONFIRM_TIMEOUT=4108]="AUTO_DEBIT__CONFIRM_TIMEOUT",I))(Gn||{}),le={4101:"\u81EA\u52A8\u4EE3\u6263\u7B7E\u7EA6\u53C2\u6570\u65E0\u6548",4102:"\u81EA\u52A8\u4EE3\u6263\u7B7E\u7EA6\u8BF7\u6C42\u5931\u8D25",4103:"\u81EA\u52A8\u4EE3\u6263\u7B7E\u7EA6\u54CD\u5E94\u65E0\u6548",4104:"\u5F53\u524D\u8FD0\u884C\u7AEF\u4E0D\u652F\u6301\u8BE5\u7B7E\u7EA6\u65B9\u5F0F",4105:"\u81EA\u52A8\u4EE3\u6263\u6E20\u9053\u8C03\u8D77\u5931\u8D25",4106:"\u7528\u6237\u53D6\u6D88\u81EA\u52A8\u4EE3\u6263\u7B7E\u7EA6",4107:"\u81EA\u52A8\u4EE3\u6263\u6700\u7EC8\u72B6\u6001\u786E\u8BA4\u5931\u8D25",4108:"\u81EA\u52A8\u4EE3\u6263\u6700\u7EC8\u72B6\u6001\u786E\u8BA4\u8D85\u65F6"};var qo=(t,e,n,a)=>{let s=ce();if(s==="taro")return Taro.request({url:t,method:e,data:n,header:a}).then(h=>h);if(s==="uni")return new Promise((h,I)=>{uni.request({url:t,method:e,data:n,header:a,success:P=>h(P),fail:P=>I(P)})});if(s==="wechat")return new Promise((h,I)=>{wx.request({url:t,method:e,data:n,header:a,success:P=>h(P),fail:P=>I(P)})});if(s==="alipay")return new Promise((h,I)=>{my.request({url:t,method:e,data:n,headers:a,success:P=>h(P),fail:P=>I(P)})});let l=e.toUpperCase()==="GET",p=l&&n&&Object.keys(n).length?`${t}?${new URLSearchParams(n).toString()}`:t;return fetch(p,{method:e,headers:a,body:l?void 0:JSON.stringify(n)}).then(async h=>({statusCode:h.status,data:await h.json()}))},Bn=class{constructor(e=null){be(this,"staticConfig");this.staticConfig=e}getCurrentConfig(){return this.staticConfig||Xt()||je}async getAuthToken(){let e=this.getCurrentConfig();if(e.getAuthToken&&typeof e.getAuthToken=="function")try{let n=await e.getAuthToken();return n?(v.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),n):(v.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(n){return v.error("\u83B7\u53D6Token\u5931\u8D25",n),null}return null}async buildHeader(e={},n=!0){let a=L({"content-type":"application/json"},e);if(!n)return a;let s=await this.getAuthToken();if(!s)throw{code:"AUTH_TOKEN_REQUIRED",message:"\u5F53\u524D\u63A5\u53E3\u9700\u8981 token\uFF0C\u8BF7\u5728\u7528\u6237\u767B\u5F55\u6210\u529F\u540E\u8C03\u7528 nova.setToken(token) \u6216 \u76F4\u63A5createServices\u65F6\u4F20\u5165getAuthToken"};return a.Authorization_bar=s,a}async request(e){let{path:n,method:a="POST",data:s={},header:l={},authRequired:p=!0,baseDomain:h,beforeRequest:I,afterResponse:P}=e,q=h?`${h}${n}`:He(this.getCurrentConfig().env||"prod",n),G=await this.buildHeader(l,p);I&&typeof I=="function"&&await I({url:q,method:a,data:s,header:G}),v.info(`\u53D1\u8D77${a}\u8BF7\u6C42:`,{path:n,method:a});try{let M=await qo(q,a,s,G);return v.info("\u8BF7\u6C42\u6210\u529F:",{path:n,statusCode:M.statusCode}),P&&typeof P=="function"&&await P(M.data),M.data}catch(M){throw v.error("\u8BF7\u6C42\u5931\u8D25:",{path:n,error:M}),M}}get(e,n={},a={}){return this.request(L({path:e,method:"GET",data:n},a))}post(e,n={},a={}){return this.request(L({path:e,method:"POST",data:n},a))}},De=(t=null)=>new Bn(t);var Ho=(function(){"use strict";function t(R,J){var ct=(65535&R)+(65535&J);return(R>>16)+(J>>16)+(ct>>16)<<16|65535&ct}function e(R,J,ct,st,X,Ot){return t((Ot=t(t(J,R),t(st,Ot)))<<X|Ot>>>32-X,ct)}function n(R,J,ct,st,X,Ot,w){return e(J&ct|~J&st,R,J,X,Ot,w)}function a(R,J,ct,st,X,Ot,w){return e(J&st|ct&~st,R,J,X,Ot,w)}function s(R,J,ct,st,X,Ot,w){return e(J^ct^st,R,J,X,Ot,w)}function l(R,J,ct,st,X,Ot,w){return e(ct^(J|~st),R,J,X,Ot,w)}function p(R,J){var ct,st,X,Ot;R[J>>5]|=128<<J%32,R[14+(J+64>>>9<<4)]=J;for(var w=1732584193,F=-271733879,Y=-1732584194,U=271733878,E=0;E<R.length;E+=16)w=n(ct=w,st=F,X=Y,Ot=U,R[E],7,-680876936),U=n(U,w,F,Y,R[E+1],12,-389564586),Y=n(Y,U,w,F,R[E+2],17,606105819),F=n(F,Y,U,w,R[E+3],22,-1044525330),w=n(w,F,Y,U,R[E+4],7,-176418897),U=n(U,w,F,Y,R[E+5],12,1200080426),Y=n(Y,U,w,F,R[E+6],17,-1473231341),F=n(F,Y,U,w,R[E+7],22,-45705983),w=n(w,F,Y,U,R[E+8],7,1770035416),U=n(U,w,F,Y,R[E+9],12,-1958414417),Y=n(Y,U,w,F,R[E+10],17,-42063),F=n(F,Y,U,w,R[E+11],22,-1990404162),w=n(w,F,Y,U,R[E+12],7,1804603682),U=n(U,w,F,Y,R[E+13],12,-40341101),Y=n(Y,U,w,F,R[E+14],17,-1502002290),w=a(w,F=n(F,Y,U,w,R[E+15],22,1236535329),Y,U,R[E+1],5,-165796510),U=a(U,w,F,Y,R[E+6],9,-1069501632),Y=a(Y,U,w,F,R[E+11],14,643717713),F=a(F,Y,U,w,R[E],20,-373897302),w=a(w,F,Y,U,R[E+5],5,-701558691),U=a(U,w,F,Y,R[E+10],9,38016083),Y=a(Y,U,w,F,R[E+15],14,-660478335),F=a(F,Y,U,w,R[E+4],20,-405537848),w=a(w,F,Y,U,R[E+9],5,568446438),U=a(U,w,F,Y,R[E+14],9,-1019803690),Y=a(Y,U,w,F,R[E+3],14,-187363961),F=a(F,Y,U,w,R[E+8],20,1163531501),w=a(w,F,Y,U,R[E+13],5,-1444681467),U=a(U,w,F,Y,R[E+2],9,-51403784),Y=a(Y,U,w,F,R[E+7],14,1735328473),w=s(w,F=a(F,Y,U,w,R[E+12],20,-1926607734),Y,U,R[E+5],4,-378558),U=s(U,w,F,Y,R[E+8],11,-2022574463),Y=s(Y,U,w,F,R[E+11],16,1839030562),F=s(F,Y,U,w,R[E+14],23,-35309556),w=s(w,F,Y,U,R[E+1],4,-1530992060),U=s(U,w,F,Y,R[E+4],11,1272893353),Y=s(Y,U,w,F,R[E+7],16,-155497632),F=s(F,Y,U,w,R[E+10],23,-1094730640),w=s(w,F,Y,U,R[E+13],4,681279174),U=s(U,w,F,Y,R[E],11,-358537222),Y=s(Y,U,w,F,R[E+3],16,-722521979),F=s(F,Y,U,w,R[E+6],23,76029189),w=s(w,F,Y,U,R[E+9],4,-640364487),U=s(U,w,F,Y,R[E+12],11,-421815835),Y=s(Y,U,w,F,R[E+15],16,530742520),w=l(w,F=s(F,Y,U,w,R[E+2],23,-995338651),Y,U,R[E],6,-198630844),U=l(U,w,F,Y,R[E+7],10,1126891415),Y=l(Y,U,w,F,R[E+14],15,-1416354905),F=l(F,Y,U,w,R[E+5],21,-57434055),w=l(w,F,Y,U,R[E+12],6,1700485571),U=l(U,w,F,Y,R[E+3],10,-1894986606),Y=l(Y,U,w,F,R[E+10],15,-1051523),F=l(F,Y,U,w,R[E+1],21,-2054922799),w=l(w,F,Y,U,R[E+8],6,1873313359),U=l(U,w,F,Y,R[E+15],10,-30611744),Y=l(Y,U,w,F,R[E+6],15,-1560198380),F=l(F,Y,U,w,R[E+13],21,1309151649),w=l(w,F,Y,U,R[E+4],6,-145523070),U=l(U,w,F,Y,R[E+11],10,-1120210379),Y=l(Y,U,w,F,R[E+2],15,718787259),F=l(F,Y,U,w,R[E+9],21,-343485551),w=t(w,ct),F=t(F,st),Y=t(Y,X),U=t(U,Ot);return[w,F,Y,U]}function h(R){for(var J="",ct=32*R.length,st=0;st<ct;st+=8)J+=String.fromCharCode(R[st>>5]>>>st%32&255);return J}function I(R){var J=[];for(J[(R.length>>2)-1]=void 0,st=0;st<J.length;st+=1)J[st]=0;for(var ct=8*R.length,st=0;st<ct;st+=8)J[st>>5]|=(255&R.charCodeAt(st/8))<<st%32;return J}function P(R){for(var J,ct="0123456789abcdef",st="",X=0;X<R.length;X+=1)J=R.charCodeAt(X),st+=ct.charAt(J>>>4&15)+ct.charAt(15&J);return st}function q(R){return unescape(encodeURIComponent(R))}function G(R){return h(p(I(R=q(R)),8*R.length))}function M(R,J){return(function(ct,st){var X,Ot=I(ct),w=[],F=[];for(w[15]=F[15]=void 0,16<Ot.length&&(Ot=p(Ot,8*ct.length)),X=0;X<16;X+=1)w[X]=909522486^Ot[X],F[X]=1549556828^Ot[X];return st=p(w.concat(I(st)),512+8*st.length),h(p(F.concat(st),640))})(q(R),q(J))}function pt(R,J,ct){return J?ct?M(J,R):P(M(J,R)):ct?G(R):P(G(R))}return pt})(),nn=Ho;function Fr(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function xr(t){if(typeof t!="object"||t===null)return t;let e=Object.keys(t).sort(),n={};for(let a of e)n[a]=t[a];return JSON.stringify(n)}function Ur(t,e){let n={appId:t.appId,randomStr:t.randomStr,data:t.data},a=Object.keys(n).sort(),s="";for(let[l,p]of a.entries())s+=`${p}=${n[p]}`,l<a.length-1&&(s+="&");return s+=`&secretKey=${e}`,nn(s)}var jo=(t,e,n,a)=>{let s=ce();return s==="taro"?Taro.request({url:t,method:e,data:n,header:a}).then(l=>l):s==="uni"?new Promise((l,p)=>{uni.request({url:t,method:e,data:n,header:a,success:h=>l(h),fail:h=>p(h)})}):s==="wechat"?new Promise((l,p)=>{wx.request({url:t,method:e,data:n,header:a,success:h=>l(h),fail:h=>p(h)})}):s==="alipay"?new Promise((l,p)=>{my.request({url:t,method:e,data:n,headers:a,success:h=>l(h),fail:h=>p(h)})}):fetch(t,{method:e,headers:a,body:JSON.stringify(n)}).then(async l=>({statusCode:l.status,data:await l.json()}))},kn=class{constructor(e=null){be(this,"staticConfig");this.staticConfig=e}getCurrentConfig(){return this.staticConfig||Xt()||{}}getExternalEnv(){var e;return((e=this.getCurrentConfig())==null?void 0:e.externalEnv)||he.PROD}getExternalHost(){let e=this.getExternalEnv();return tn[e]||tn.prod}generateSign(e={}){let n=this.getCurrentConfig(),{externalAppId:a,externalAppSecret:s}=n;if(!a||!s)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let l=Fr(),p=xr(e),h=Ur({appId:a,randomStr:l,data:p},s);return{appId:a,randomStr:l,sign:h}}buildRequestBody(e={}){let n=this.generateSign(e);return Dt(L({},n),{data:e})}buildUrl(e){return`${this.getExternalHost()}${e}`}async request(e){let{path:n,method:a="POST",data:s={},header:l={},needSign:p=!0,beforeRequest:h,afterResponse:I}=e,P=this.buildUrl(n),q=L({"content-type":"application/json"},l),G=p?this.buildRequestBody(s):s;h&&typeof h=="function"&&await h({url:P,method:a,data:G,header:q}),v.info(`\u53D1\u8D77${a}\u8BF7\u6C42:`,{path:n,method:a});try{let M=await jo(P,a,G,q);if(v.info("\u8BF7\u6C42\u6210\u529F:",{path:n,statusCode:M.statusCode}),I&&typeof I=="function"&&await I(M.data),M.statusCode===200&&M.data.code===200)return M.data.data;throw{code:M.data.code,msg:M.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:M.data}}catch(M){throw(M==null?void 0:M.code)!==void 0?M:(v.error("\u8BF7\u6C42\u5931\u8D25:",{path:n,error:M}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:M})}}get(e,n={},a={}){return this.request(L({path:e,method:"GET",data:n},a))}post(e,n={},a={}){return this.request(L({path:e,method:"POST",data:n},a))}},Vr=(t=null)=>new kn(t);var Jn=De(),qn=Vr();function Yr(t){let e=In(t==null?void 0:t.equipmentValue,"equipmentValue");return e.valid?Jn.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",t):Promise.reject({code:"PARAM_ERROR",message:e.message})}async function Mr(t){let e=en(t,["idMd5Value","rtaStrategy"]);return e.valid?qn.post("/open/rest/cpa/jd/rta-check",t):Promise.reject({code:"PARAM_ERROR",message:e.message})}async function Gr(t){try{let e={thirdPlatform:t.thirdPlatform,thirdPlatformUserId:t.thirdPlatformUserId,thirdPlatformEquipmentValue:t.thirdPlatformEquipmentValue,os:t.os,client:"wxMini"};t.phone&&(e.mobileMd5=nn(t.phone)),t.extendData&&(Object.prototype.toString.call(t.extendData)==="[object Object]"?e.extendData=t.extendData:v.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let n=await qn.post("/open/rest/cpa/jd/insurance/get",e);return n?{jumpMode:Number(n.jumpMode),appId:n.appId,url:n.url,channel:n.channelId}:void 0}catch(e){throw v.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",e),e}}function Br(t){let e=In(t==null?void 0:t.equipmentValue,"equipmentValue");return e.valid?Jn.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",t):Promise.reject({code:"PARAM_ERROR",message:e.message})}function kr(t){let e=en(t,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return e.valid?Jn.post("/gw/advert/customer/cpa-activity/jd/rta/validate",t):Promise.reject({code:"PARAM_ERROR",message:e.message})}async function Jr(t){let e=await Oe(),n={thirdPlatform:t.thirdPlatform,thirdPlatformUserId:t.thirdPlatformUserId,thirdPlatformEquipmentValue:t.thirdPlatformEquipmentValue,os:e,client:t.client};return t.phone&&(n.mobileMd5=nn(t.phone)),t.extendData&&(Object.prototype.toString.call(t.extendData)==="[object Object]"?n.extendData=t.extendData:v.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),qn.post("/open/rest/cpa/jd/cash-loan/get",n)}async function Hn(t){let{phone:e,rtaId:n,equipmentId:a,lyyUserId:s,entrance:l}=t;if(!e)return b(wt.INVALID_PARAM,Ct[2001]);if(!a)return b(wt.INVALID_PARAM,Ct[2002]);try{if(n){v.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:e});let G=await kr({phone:e,lyyEquipmentValue:a,lyyUserId:s||"",rtaId:n});if(G.code!=="0000000"||!G.body||G.body.state!=1)return v.error("RTA\u9A8C\u8BC1\u5931\u8D25",G),b(2003,Ct[2003]);v.info("RTA\u9A8C\u8BC1\u6210\u529F",G.body)}v.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:e});let p=await Oe(),h=await Br({phone:e,equipmentValue:a,os:p,entrance:l});if(h.code!=="0000000"||!h.body)return v.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",h),b(2004,Ct[2004]);let{appId:I,targetUrl:P}=h.body;if(!I||!P)return v.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:I,targetUrl:P}),b(2005,Ct[2005]);let q=b(wt.SUCCESS,"\u6210\u529F",{appId:I,targetUrl:P});return v.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",q),q}catch(p){return v.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",p),b(wt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function jn(t){let{phone:e,rtaId:n,thirdPlatform:a,thirdPlatformUserId:s,thirdPlatformEquipmentValue:l}=t;if(!e)return b(wt.INVALID_PARAM,Ct[2001]);if(!a)return b(2008,Ct[2008]);if(!s)return b(2009,Ct[2009]);if(!l)return b(2010,Ct[2010]);try{if(n){v.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:e});let M=await Mr({idMd5Value:e,rtaStrategy:n});if(M.status!=1)return v.error("RTA\u9A8C\u8BC1\u5931\u8D25",M),b(2003,Ct[2003]);v.info("RTA\u9A8C\u8BC1\u6210\u529F",M)}let p=await Jr(t),{url:h,channelId:I,matchFlag:P,jumpMode:q,appId:G}=p||{};return P?q===3?!G||!h?b(2007,Ct[2007]):b(wt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:G,url:h}):b(2007,Ct[2007]):b(2006,Ct[2006])}catch(p){return v.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",p),b(wt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var Qe=null,rn=null;try{rn=Hr()}catch(t){}function jr(){return Qe||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(Qe=globalThis.LyyGetCommandSDK,Qe):rn?(Qe=rn.LyyGetCommandSDK||rn.default||rn,Qe):null)}function Kr(t){var n;v.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",t);let e=jr();e!=null&&e.getJrCommand?e.getJrCommand(t):(n=e==null?void 0:e.default)!=null&&n.getJrCommand?e.default.getJrCommand(t):(v.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),t.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function Ko(t,e){return new Promise((n,a)=>{try{Kr({url:t,channel:e,callback:s=>{s.code==="0"?n(s.data):a({msg:s.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(s){a(s)}})}async function Kn(t){try{let e=await Oe(),n=L({os:e},t);v.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",n);let{code:a,body:s}=await Yr(n);if(a==="0000000"&&s){let{url:l,channelId:p,matchFlag:h,jumpMode:I,appId:P}=s;if(!h)return b(2101,Ct[2101]);if(I===1)return v.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),b(2102,Ct[2102]);if(I===2)return ce()==="web"&&v.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:l}),!l||!p?b(2103,Ct[2103]):new Promise(q=>{Kr({url:l,channel:p,callback:async G=>{if((G==null?void 0:G.code)==="0")try{await Ce(G==null?void 0:G.data),q(b(wt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(M){q(b(2105,Ct[2105]))}else q(b(2105,Ct[2105]))}})});if(I===3)return!P||!l?b(2103,Ct[2103]):b(wt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:P,path:l})}return b(2104,Ct[2104])}catch(e){return v.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",e),b(wt.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function Qn(t){v.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let e=await Gr(Dt(L({},t),{os:await Oe()}));if(!e)return v.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),b(2106,Ct[2106]);let{jumpMode:n,appId:a,url:s,channel:l}=e;if(n===1)return s?(v.info("H5\u8DF3\u8F6C\u6A21\u5F0F",{url:s}),b(wt.SUCCESS,"\u6210\u529F",{type:"h5",url:s})):(v.error("H5\u8DF3\u8F6C\u53C2\u6570\u4E0D\u5B8C\u6574:",{jumpMode:n,url:s}),b(2103,Ct[2103]));if(n===3)return!a||!s?(v.error("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u53C2\u6570\u4E0D\u5B8C\u6574:",{jumpMode:n,appId:a,url:s}),b(2103,Ct[2103])):(v.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{jumpMode:n,appId:a,url:s}),b(wt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:a,path:s}));if(n===2){if(ce()==="web")return v.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:s}),b(wt.SUCCESS,"\u6210\u529F",{type:"h5",url:s});try{let p=await Ko(s,l);return await Ce(p),v.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),b(wt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(p){return v.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",p),Mn("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),b(2105,Ct[2105])}}return v.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",n),b(2107,Ct[2107])}catch(e){let n=typeof e=="string"?e:(e==null?void 0:e.msg)||(e==null?void 0:e.message)||"\u672A\u77E5\u9519\u8BEF";return v.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",n),Mn("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),n.includes("RTA")||n.includes("\u8D44\u683C")?b(2108,Ct[2108]):b(wt.NETWORK_ERROR,n)}}var er={};qe(er,{DyErrorCode:()=>ge,getDyPayRtaData:()=>bn,handleDyAuthDebitSignFlow:()=>Zn,handleDyAuthDebitSignFlowWithRawPayInfo:()=>tr,handleDyJsapiPayFlow:()=>$n,handleDyPayCommandFlow:()=>zn,handleDyPayFlow:()=>En});var Qo=["weapp","h5"],Wo=["h5","ulink","jsapi"],Xo=["switchTab","reLaunch","redirectTo","navigateTo"];function zo(t){return Qo.includes(t)}function $o(t){return Wo.includes(t)}function Zo(t){return Xo.includes(t)}function Qr(t){let e=t.returnType||"h5";return!t.telephone&&e==="h5"?{valid:!1,errorCode:3001}:t.price?t.equipmentValue?t.businessType?t.client&&!zo(t.client)?{valid:!1,errorCode:3004}:$o(e)?t.douyinOrderExtendData&&typeof t.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:t.backWay&&t.client==="weapp"&&!Zo(t.backWay)?{valid:!1,errorCode:3016}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3018}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}}function Wr(t){return t.price?t.equipmentValue?t.businessType?t.douyinOrderExtendData&&typeof t.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}}function Xr(t){return t.equipmentValue?{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function zr(t){return t.equipmentValue?t.orderAmount?t.businessType?t.commandUrl!=null&&typeof t.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3031}:{valid:!1,errorCode:3002}}function $r(t){return t.equipmentValue?t.commandUrl!=null&&typeof t.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function Zr(t){return t.showFlag===!0&&typeof t.payAmount=="number"&&t.payAmount>0&&typeof t.businessType=="number"&&t.businessType>0}var Le=De();async function ti(t){let{price:e,equipmentValue:n,douyinOrderExtendData:a,douyinCommodityVirtualFlag:s,businessType:l,platformActivities:p={}}=t,h={businessType:l,equipmentValue:n,payInfoBusinessType:"commonDouyinPayment",platformActivities:L({douyinCommodityVirtualFlag:s||!1,douyinCommodityPrice:e,douyinOrderExtendData:a||""},p)};try{let I=await Le.post("/gw/advert/customer/payment/pay-info",h);return I.code!=="0000000"||!(I!=null&&I.body)?Promise.reject({code:3006,message:I.message||at[3006]}):(I.body.platformActivities=h.platformActivities,I)}catch(I){return v.error("getDyOrderAmountFn error:",I),Promise.reject({code:3007,message:at[3007]})}}async function ei(t){var e,n,a,s;try{let l=t.commodityList.map(pt=>(pt.commodity=pt.commodityId,delete pt.commodityId,pt.quantity=pt.quantity||1,pt)),p=t.advertExtendInfo&&Object.keys(t.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:t.advertExtendInfo}):"",h=ce(),I="";h==="wechat"?I="wechatMini":h==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(I="wechatHtml");let P=t.returnType==="jsapi",q=P?22:21,G=L(L(L({businessType:t.businessType,fixedClientType:q,channelCode:null,douyinData:L(L({loginMobile:t.telephone||""},((e=t.jsapiInfo)==null?void 0:e.outProductCategory)!=null?{outProductCategory:t.jsapiInfo.outProductCategory}:{}),((n=t.jsapiInfo)==null?void 0:n.requestId)!=null?{requestId:t.jsapiInfo.requestId}:{}),equipmentUseFlag:!1,payEquipmentDTO:{equipmentValue:t.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:p,transType:5,actualFee:t.totalFee,totalFee:t.totalFee,commodityList:l,clientSourceDetailType:I,platformActivities:t.platformActivities||{}},t.commoditySign&&{commoditySign:t.commoditySign}),t.unifiedOrderExtendData&&L({},t.unifiedOrderExtendData)),P?{appId:((a=t.jsapiInfo)==null?void 0:a.appId)||"",openId:((s=t.jsapiInfo)==null?void 0:s.douyinOpenId)||""}:{});if(t.returnType=="ulink")return delete G.channelCode,G;let M=await Le.post("/gw/payment-bff/unified/order",G);return M.code!=="0000000"||!(M!=null&&M.body)?Promise.reject({code:3008,message:M.message||at[3008]}):M}catch(l){return v.error("dyUnifiedOrderFn error:",l),Promise.reject({code:3009,message:at[3009]})}}async function ni(t){let e={equipmentValue:t.equipmentValue,phone:t.telephone||""};t.price&&(e.orderAmount=t.price);try{let n=await Le.post("/gw/advert/customer/douyin/pay/check",e);return n.code!=="0000000"||!(n!=null&&n.body)?Promise.reject({code:3013,message:n.message||at[3013]}):n}catch(n){return v.error("getDyPayRtaData error:",n),Promise.reject({code:3014,message:(n==null?void 0:n.message)||at[3014]})}}async function ri(t={}){var e;try{let n=(e=t.requestNo)==null?void 0:e.trim(),a=n?`/gw/advert/customer/douyin/pay/jsapi/info?requestNo=${n}`:"/gw/advert/customer/douyin/pay/jsapi/info",s=await Le.get(a);return s.code!=="0000000"||!(s!=null&&s.body)?Promise.reject({code:3019,message:s.message||at[3019]}):{appId:s.body.appId,douyinOpenId:s.body.douyinOpenId,outProductCategory:s.body.outProductCategory,requestId:s.body.requestId}}catch(n){return v.error("getDyPayJsapiInfoFn error:",n),Promise.reject({code:(n==null?void 0:n.code)||3020,message:(n==null?void 0:n.message)||at[3020]})}}async function Fe(t){try{let e=await Le.post("/gw/advert/customer/douyin/pay/jsapi/signature",t);return e.code!=="0000000"||!(e!=null&&e.body)||!e.body.signature||!e.body.timestamp||!e.body.nonceStr?Promise.reject({code:3023,message:e.message||at[3023]}):{signature:e.body.signature,timestamp:e.body.timestamp,nonceStr:e.body.nonceStr}}catch(e){return v.error("getDyPayJsapiSignatureFn error:",e),Promise.reject({code:(e==null?void 0:e.code)||3024,message:(e==null?void 0:e.message)||at[3024]})}}async function ii(t){try{let e=await Le.post("/gw/advert/customer/douyin/pay-command",t);return e.code!=="0000000"||!(e!=null&&e.body)?Promise.reject({code:3032,message:e.message||at[3032]}):e}catch(e){return v.error("getDyPayCommandFn error:",e),Promise.reject({code:(e==null?void 0:e.code)||3033,message:(e==null?void 0:e.message)||at[3033]})}}async function We(t){try{let e=await Le.post("/gw/advert/customer/automatic-debit/sign/request-id",{requestId:t});return e.code!=="0000000"||!(e!=null&&e.body)?Promise.reject({code:3037,message:e.message||at[3037]}):e.body}catch(e){return v.error("dyAutomaticDebitSignByRequestIdFn error:",e),Promise.reject({code:(e==null?void 0:e.code)||3038,message:(e==null?void 0:e.message)||at[3038]})}}var ta="/auth/rest/auth/third",si="url_token",ea="https://unpkg.byted-static.com/bridge/douyin_open/1.0.17/lib/douyin_open.umd.js",on=null,na="-2",ra="1",ia="0";function Gt(t,e){let n=new Error(e||at[t]);return Object.assign(n,{code:t})}function ci(t){var n;let e=(n=t==null?void 0:t.data)==null?void 0:n.code;return e!=null?String(e):typeof(t==null?void 0:t.code)=="string"?t.code:""}function oi(t){return String(t==null?void 0:t.code)===na}function ai(t){return ci(t)===ra}function ui(t){var e,n;return((e=t==null?void 0:t.data)==null?void 0:e.msg)||((n=t==null?void 0:t.data)==null?void 0:n.message)||(t==null?void 0:t.message)||(t==null?void 0:t.errMsg)}function an(){return typeof window!="undefined"&&typeof document!="undefined"}function Xn(){return an()?window.location.href:""}function Se(t){let e=t.href||Xn();if(!t.key||!e)return"";try{let n=new URL(e,fi()),a=n.searchParams.get(t.key);return a!=null?a:oa(n.hash,t.key)}catch(n){return v.warn("getDyUrlParam parse error:",n),""}}function oa(t,e){if(!t||!e)return"";let n=t.indexOf("?");if(n<0)return"";let a=t.slice(n+1).split("#")[0];return new URLSearchParams(a).get(e)||""}function li(t){let{href:e,paramName:n}=t;if(!e||!n)return e;let a=e.indexOf("#"),s=a>=0?e.slice(0,a):e,l=a>=0?e.slice(a):"";try{let p=new URL(s,fi()),h=ua(s);return p.searchParams.delete(n),`${h?`${p.pathname}${p.search}`:p.toString()}${di(l,n)}`}catch(p){return v.warn("removeDyUrlParam parse error:",p),la(e,n)}}function di(t,e){if(!t||!e)return t;let n=t.indexOf("?");if(n<0)return t;let a=t.slice(0,n),s=t.slice(n+1),l=s.indexOf("#"),p=l>=0?s.slice(0,l):s,h=l>=0?s.slice(l):"",I=new URLSearchParams(p);I.delete(e);let P=I.toString();return`${a}${P?`?${P}`:""}${h}`}function xe(t={}){let n=(t.href||Xn()).split("#")[0]||"";return li({href:n,paramName:t.tokenParamName||si})}function aa(t){var s,l;let e=t.tokenParamName||si,n=li({href:t.redirectUrl||Xn(),paramName:e});if(!n)throw Gt(3025);let a=new URLSearchParams({useAgent:t.useAgent||"douyin",category:t.category||"pay",internal:String((s=t.internal)!=null?s:!1),silent:String((l=t.silent)!=null?l:!1),redirectUrl:n});return t.equipmentValue&&a.set("equipmentValue",t.equipmentValue),`${t.authPath||ta}?${a.toString()}`}function un(t){if(!an())throw Gt(3025);let e=aa(t);v.info("\u8DF3\u8F6C\u6296\u97F3\u6388\u6743:",{authUrl:e,equipmentValue:t.equipmentValue});try{return window.location.href=e,e}catch(n){throw v.error("redirectDyAuth error:",n),Gt(3026)}}function Xe(){if(!an())return null;let t=window;return t.DouyinOpenJSBridge||t.douyin_open||null}function Ue(t={}){if(!an())return Promise.reject(Gt(3025));let e=Xe();if(e)return v.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5DF2\u52A0\u8F7D"),Promise.resolve(e);if(on)return v.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u590D\u7528\u52A0\u8F7D\u4E2D\u4EFB\u52A1"),on;let n=t.sdkUrl||ea;return v.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5F00\u59CB\u52A0\u8F7D",{sdkUrl:n}),on=new Promise((a,s)=>{let l=sa(n),p=()=>{let P=Xe();if(!P){s(Gt(3027));return}v.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u6210\u529F"),a(P)},h=P=>{v.error("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u5931\u8D25",P),s(Gt(3027))};if(l){if(v.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u811A\u672C\u5DF2\u5B58\u5728"),ca(l)){window.setTimeout(p,0);return}l.addEventListener("load",p,{once:!0}),l.addEventListener("error",h,{once:!0});return}let I=document.createElement("script");I.src=n,I.async=!0,I.addEventListener("load",p,{once:!0}),I.addEventListener("error",P=>{I.remove(),h(P)},{once:!0}),document.head.appendChild(I)}).catch(a=>{throw on=null,a}),on}function Ve(t){let e=t.sdk||Xe();if(!e)return Promise.reject(Gt(3027));let{appId:n,signatureData:a,url:s}=t;return!n||!s||!(a!=null&&a.signature)||!(a!=null&&a.timestamp)||!(a!=null&&a.nonceStr)?Promise.reject(Gt(3028)):new Promise((l,p)=>{v.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u5F00\u59CB\u914D\u7F6E",{appId:n,url:s});try{e.config({params:{client_key:n,signature:a.signature,timestamp:String(a.timestamp),nonce_str:a.nonceStr,url:s}}),e.ready(()=>{v.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5B8C\u6210"),l(e)}),e.error(h=>{v.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5931\u8D25",h),p(Gt(3028))})}catch(h){v.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5F02\u5E38",h),p(Gt(3028))}})}function sn(t){let e=t.sdk||Xe();if(!e)return Promise.reject(Gt(3027));if(!e.ttcjpay||typeof e.ttcjpay.dypay!="function")return Promise.reject(Gt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));let{appId:n,payInfo:a}=t;if(!n||!a)return Promise.reject(Gt(3021));let s={appId:n,timeStamp:String(a.timeStamp),nonceStr:a.nonceStr,package:a.package,signType:a.signType,paySign:a.paySign};return new Promise((l,p)=>{v.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528 dypay");try{e.ttcjpay.dypay({sdk_info:JSON.stringify(s),success:h=>{if(v.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u6210\u529F\u56DE\u8C03",h),oi(h)){p(Gt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(ai(h)){p(Gt(3039));return}let I=ci(h);if(I&&I!==ia){p(Gt(3029,ui(h)));return}l(h)},fail:h=>{if(v.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u5931\u8D25\u56DE\u8C03",h),oi(h)){p(Gt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(ai(h)){p(Gt(3039));return}p(Gt(3029,ui(h)))}})}catch(h){v.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528\u5F02\u5E38",h),p(Gt(3029,h==null?void 0:h.message))}})}function fi(){return an()?window.location.origin:"https://bi-nova.local"}function ua(t){return!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t)&&!t.startsWith("//")}function sa(t){return Array.from(document.getElementsByTagName("script")).find(n=>n.src===t)||null}function ca(t){let e=t.readyState;return e==="loaded"||e==="complete"}function la(t,e){let n=t.indexOf("#"),a=n>=0?t.slice(0,n):t,s=n>=0?t.slice(n):"",l=a.indexOf("?");if(l<0)return t;let p=a.slice(0,l),I=a.slice(l+1).split("&").filter(P=>P&&decodeURIComponent(P.split("=")[0])!==e).join("&");return`${p}${I?`?${I}`:""}${di(s,e)}`}async function En(t){var n,a,s,l;let e=Qr(t);if(!e.valid)return b(e.errorCode,at[e.errorCode]);try{let p=t.returnType||"h5",h=await ti({price:t.price,equipmentValue:t.equipmentValue,businessType:t.businessType,douyinOrderExtendData:(t==null?void 0:t.douyinOrderExtendData)||"",platformActivities:(t==null?void 0:t.platformActivities)||{},douyinCommodityVirtualFlag:(t==null?void 0:t.douyinCommodityVirtualFlag)||!1}),I=p==="jsapi"?await ri({requestNo:Se({key:"requestNo"})}):void 0,P=await ei(Dt(L(Dt(L({},h.body),{telephone:t.telephone,equipmentValue:t.equipmentValue,businessType:t.businessType}),t.unifiedOrderExtendData&&{unifiedOrderExtendData:t.unifiedOrderExtendData}),{returnType:p,jsapiInfo:I}));if(t.returnType==="ulink")return b(0,"success",{ulinkQueryParams:P});let q=((n=P==null?void 0:P.body)==null?void 0:n.h5Url)||"",G=((a=P==null?void 0:P.body)==null?void 0:a.outTradeNo)||"";if(p==="jsapi"){let pt=_i((s=P==null?void 0:P.body)==null?void 0:s.payInfo);return b(0,"success",{appId:(I==null?void 0:I.appId)||"",payInfo:pt,outTradeNo:G})}let M=q?await da(Dt(L({},t),{dyUrl:q})):"";return M?b(0,"success",{h5Url:M,outTradeNo:G}):b(3010,at[3010])}catch(p){v.error("handleDyPayFlow error:",p);let h=(l=p==null?void 0:p.code)!=null?l:3012,I=(p==null?void 0:p.message)||at[3012];return b(h,I)}}function _i(t){if(!t)throw{code:3021,message:at[3021]};if(typeof t=="object"){if(pi(t))return t;throw{code:3022,message:at[3022]}}try{let e=JSON.parse(t);if(!pi(e))throw new Error("invalid payInfo fields");return e}catch(e){throw{code:3022,message:at[3022],error:e}}}function pi(t){return typeof t.timeStamp=="string"&&t.timeStamp!==""&&typeof t.nonceStr=="string"&&t.nonceStr!==""&&typeof t.package=="string"&&t.package!==""&&typeof t.signType=="string"&&t.signType!==""&&typeof t.paySign=="string"&&t.paySign!==""}async function da(t){let e=Xt(),n=He(e.env||"prod",""),a=typeof e.getAuthToken=="function"?await e.getAuthToken():"",s=t.client||"weapp";return`${n}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${s}&equipmentId=${t.equipmentValue}&dyUrl=${t.dyUrl}&fromUrl=${encodeURIComponent(t.fromUrl||"")}&backUrl=${encodeURIComponent(t.backUrl||"")}&backWay=${t.backWay||""}&url_token=${a}`}async function bn(t){var n;let e=Xr(t);if(!e.valid)return b(e.errorCode,at[e.errorCode]);try{let a=await ni({price:(t==null?void 0:t.price)||"",equipmentValue:t.equipmentValue,telephone:(t==null?void 0:t.telephone)||""});return b(0,"success",a.body)}catch(a){v.error("getDyPayRtaData error:",a);let s=(n=a==null?void 0:a.code)!=null?n:3015,l=(a==null?void 0:a.message)||at[3015];return b(s,l)}}async function mi(t){var n,a;let e=zr(t);if(!e.valid)return b(e.errorCode,at[e.errorCode]);try{let s=(n=t.commandUrl)==null?void 0:n.trim(),p=(await ii(L({phone:t.telephone||"",equipmentValue:t.equipmentValue,orderAmount:t.orderAmount,businessType:t.businessType},s?{commandUrl:s}:{}))).body||"";return p?b(0,"success",{command:p}):b(3032,at[3032])}catch(s){v.error("getDyPayCommand error:",s);let l=(a=s==null?void 0:s.code)!=null?a:3033,p=(s==null?void 0:s.message)||at[3033];return b(l,p)}}async function fa(t){var n;let e=await mi(t);if(e.code!==0||!((n=e.data)!=null&&n.command))return b(e.code,e.message);try{return await Ce(e.data.command),b(0,"success",L({type:"copy_success"},t.returnCommand?{command:e.data.command}:{}))}catch(a){return v.error("copyDyPayCommand error:",a),b(3034,at[3034])}}async function zn(t){var n,a,s;let e=$r(t);if(!e.valid)return b(e.errorCode,at[e.errorCode]);try{let l=await bn({telephone:t.telephone||"",equipmentValue:t.equipmentValue,price:t.price});if(l.code!==0)return b(l.code,l.message);let p=l.data;if(!(p!=null&&p.showFlag))return b(0,"success",{eligible:!1,type:"not_eligible"});if(!Zr(p))return b(3035,at[3035]);let h={telephone:t.telephone||"",equipmentValue:t.equipmentValue,orderAmount:p.payAmount,businessType:p.businessType,commandUrl:t.commandUrl};if(t.autoCopy){let P=await fa(Dt(L({},h),{returnCommand:t.returnCommand}));return P.code!==0?b(P.code,P.message):b(0,"success",L({eligible:!0,type:"copy_success"},(n=P.data)!=null&&n.command?{command:P.data.command}:{}))}let I=await mi(h);return I.code!==0||!((a=I.data)!=null&&a.command)?b(I.code,I.message):b(0,"success",{eligible:!0,type:"command",command:I.data.command})}catch(l){v.error("handleDyPayCommandFlow error:",l);let p=(s=l==null?void 0:l.code)!=null?s:3033,h=(l==null?void 0:l.message)||at[3033];return b(p,h)}}async function $n(t){var n,a,s;let e=Wr(t);if(!e.valid)return b(e.errorCode,at[e.errorCode]);try{let l=Xt(),p=t.authToken||(typeof l.getAuthToken=="function"?await l.getAuthToken():""),h=t.autoAuth!==!1;if(!p){if(!h)return b(3030,at[3030]);let pt=un({equipmentValue:t.equipmentValue,redirectUrl:t.redirectUrl,tokenParamName:t.tokenParamName});return b(0,"redirecting",{type:"auth_redirect",authUrl:pt})}let I=await Ue({sdkUrl:t.sdkUrl}),P=await En(Dt(L({},t),{client:"h5",returnType:"jsapi"}));if(P.code!==0||!((n=P.data)!=null&&n.appId)||!((a=P.data)!=null&&a.payInfo))return b(P.code||3021,P.message||at[3021]);let q=t.signatureUrl||xe({tokenParamName:t.tokenParamName}),G=await Fe({url:q});await Ve({appId:P.data.appId,signatureData:G,url:q,sdk:I});let M=await sn({appId:P.data.appId,payInfo:P.data.payInfo,sdk:I});return b(0,"success",{type:"pay_result",outTradeNo:P.data.outTradeNo,payResult:M})}catch(l){v.error("handleDyJsapiPayFlow error:",l);let p=(s=l==null?void 0:l.code)!=null?s:3029,h=(l==null?void 0:l.message)||at[3029];return b(p,h)}}async function Zn(){var s;let t="url_token",e=Xt(),a=(typeof e.getAuthToken=="function"?await e.getAuthToken():"")||Se({key:t});try{if(!a){let pt=Se({key:"equipmentValue"}),R=un(L({tokenParamName:t},pt?{equipmentValue:pt}:{}));return b(0,"redirecting",{type:"auth_redirect",authUrl:R})}let l=Se({key:"requestId"}).trim();if(!l)return b(3036,at[3036]);let p=await Ue(),h=await We(l),I=h.appId||h.appid||"",P=_i(h.payInfo);if(!I)return b(3021,at[3021]);let q=xe({tokenParamName:t}),G=await Fe(L({url:q},I?{appid:I}:{}));await Ve({appId:I,signatureData:G,url:q,sdk:p});let M=await sn({appId:I,payInfo:P,sdk:p});return b(0,"success",{type:"sign_result",orderNo:h.orderNo,payResult:M})}catch(l){v.error("handleDyAuthDebitSignFlow error:",l);let p=(s=l==null?void 0:l.code)!=null?s:3029,h=(l==null?void 0:l.message)||at[3029];return b(p,h)}}var pa="-2",_a="1",ma="0";function ae(t,e){let n=new Error(e||at[t]);return Object.assign(n,{code:t})}function gi(t){var n;let e=(n=t==null?void 0:t.data)==null?void 0:n.code;return e!=null?String(e):typeof(t==null?void 0:t.code)=="string"?t.code:""}function yi(t){return String(t==null?void 0:t.code)===pa}function Ai(t){return gi(t)===_a}function hi(t){var e,n;return((e=t==null?void 0:t.data)==null?void 0:e.msg)||((n=t==null?void 0:t.data)==null?void 0:n.message)||(t==null?void 0:t.message)||(t==null?void 0:t.errMsg)}function ya(t){if(typeof t=="string"){if(!t.trim())throw ae(3021);return t}if(!t||typeof t!="object")throw ae(3021);let e=JSON.stringify(t);if(!e)throw ae(3022);return e}function Aa(t){let e=t.sdk||Xe();if(!e)return Promise.reject(ae(3027));if(!e.ttcjpay||typeof e.ttcjpay.dypay!="function")return Promise.reject(ae(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));let n="";try{n=ya(t.payInfo)}catch(a){return Promise.reject(a!=null&&a.code?a:ae(3022,a==null?void 0:a.message))}return new Promise((a,s)=>{v.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20 dypay");try{e.ttcjpay.dypay({sdk_info:n,success:l=>{if(v.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20\u6210\u529F\u56DE\u8C03",l),yi(l)){s(ae(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(Ai(l)){s(ae(3039));return}let p=gi(l);if(p&&p!==ma){s(ae(3029,hi(l)));return}a(l)},fail:l=>{if(v.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20\u5931\u8D25\u56DE\u8C03",l),yi(l)){s(ae(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(Ai(l)){s(ae(3039));return}s(ae(3029,hi(l)))}})}catch(l){v.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20\u8C03\u7528\u5F02\u5E38",l),s(ae(3029,l==null?void 0:l.message))}})}async function tr(){var s;let t="url_token",e=Xt(),a=(typeof e.getAuthToken=="function"?await e.getAuthToken():"")||Se({key:t});try{if(!a){let M=Se({key:"equipmentValue"}),pt=un(L({tokenParamName:t},M?{equipmentValue:M}:{}));return b(0,"redirecting",{type:"auth_redirect",authUrl:pt})}let l=Se({key:"requestId"}).trim();if(!l)return b(3036,at[3036]);let p=await Ue(),h=await We(l),I=h.appId||h.appid||"";if(!I)return b(3021,at[3021]);let P=xe({tokenParamName:t}),q=await Fe({url:P,appid:I});await Ve({appId:I,signatureData:q,url:P,sdk:p});let G=await Aa({payInfo:h.payInfo,sdk:p});return b(0,"success",{type:"sign_result",orderNo:h.orderNo,payResult:G})}catch(l){v.error("handleDyAuthDebitSignFlowWithRawPayInfo error:",l);let p=(s=l==null?void 0:l.code)!=null?s:3029,h=(l==null?void 0:l.message)||at[3029];return b(p,h)}}var sr={};qe(sr,{getDisplayAdConfig:()=>cn,getProductConfig:()=>ur,normalizeDisplayAdData:()=>Sn,normalizeProductConfig:()=>ze});var Di=De();function Ii(t){let e=en(t,["placementId"]);if(!e.valid)return Promise.reject({code:"PARAM_ERROR",message:e.message});let n=Xt().env||"prod",a=Number.isInteger(t.userId)&&Number(t.userId)>0?{userId:t.userId}:{};return Di.get(`/gw/advert-plugin/api/v1/config/list/valid/${t.placementId}`,a,{authRequired:!1,baseDomain:Yn(n)})}function Pi(t){let e=typeof(t==null?void 0:t.id)=="number"?Number.isInteger(t.id)&&t.id>0?String(t.id):"":String((t==null?void 0:t.id)||"").trim();if(!e)return Promise.reject({code:"PARAM_ERROR",message:"id \u5FC5\u987B\u4E3A\u975E\u7A7A\u5B57\u7B26\u4E32\u6216\u5927\u4E8E 0 \u7684\u6574\u6570"});let n=Xt().env||"prod";return Di.get(`/gw/advert-plugin/api/v1/product-config/placement/${encodeURIComponent(e)}`,{},{authRequired:!1,baseDomain:Yn(n)})}var Ei=30*1e3,ha="__",rr=new Map,nr=new Map;function ga(t,e){let n=Number.isInteger(t.userId)&&Number(t.userId)>0?t.userId:"";return[t.appId||"",e,t.type||"",n].join(ha)}function Da(t){let e=rr.get(t);return e?e.expireAt<=Date.now()?(rr.delete(t),v.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:t}),null):e.data:null}function Ia(t,e){rr.set(t,{data:e,expireAt:Date.now()+Ei})}function Pa(t){return Array.isArray(t==null?void 0:t.body)?t.body:[]}function Ea(t){return String(t==null?void 0:t.code)!=="200"}function ba(t,e){let n=String(t||e||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(n)?n:e||"banner"}function bi(t){return String(t||"").trim().toLowerCase()}function Sa(t){var e;return!!t&&t.status!==0&&((e=t.platformConfig)==null?void 0:e.valid)!==!1}function Ra(t){return[...t].sort((e,n)=>{var l,p,h,I;let a=Number((l=e.priority)!=null?l:9999),s=Number((p=n.priority)!=null?p:9999);return a!==s?a-s:Number((h=n.weight)!=null?h:0)-Number((I=e.weight)!=null?I:0)})}function Si(t){return t.find(e=>bi(e.advertPlatform)==="gdt")||null}function Ri(t){return t.find(e=>bi(e.advertPlatform)!=="gdt")||null}function Ta(t,e){return t&&e?"mixed":t?"wechat":e?"custom":"none"}function va(t,e){var s,l;let n=Si(t),a=Ri(t);return n&&a?Number((s=n.priority)!=null?s:9999)<=Number((l=a.priority)!=null?l:9999)?"wechat-first":"custom-first":e==="custom"?"custom-only":e==="wechat"?"wechat-only":"wechat-first"}function Na(t){var n;let e=Si(t);return((n=e==null?void 0:e.platformConfig)==null?void 0:n.adId)||""}function wa(t,e,n){let a=String(t.mediaType||"").trim().toLowerCase();return a==="video"&&n?"video":a==="image"&&e?"image":n?"video":"image"}function Ca(t){let e=t.targetAppId||"",n=t.targetPath||"",a=t.jumpUrl||t.url||t.webUrl||"",l=String(t.jumpType||"").trim().toLowerCase()||(e?"miniprogram":n?"internal":a?"web":"none");if(l==="miniprogram"){let p=String(t.miniProgramOpenMode||"").trim().toLowerCase()==="half"?"half":"full";return{jumpType:"miniProgram",appId:e||void 0,path:n||void 0,miniProgramOpenMode:p,action:{type:"miniProgram",appId:e||void 0,path:n||void 0,miniProgramOpenMode:p}}}return l==="internal"?{jumpType:"internal",path:n||void 0,action:{type:"internal",path:n||void 0}}:l==="web"?{jumpType:"web",url:a||void 0,action:{type:"web",url:a||void 0}}:l==="api"?{jumpType:"api",url:a||void 0,action:{type:"api",url:a||void 0}}:{jumpType:"none",action:{type:"none"}}}function Oa(t){let e=Ri(t),n=e==null?void 0:e.platformConfig;if(!n)return null;let a=n.image||n.imageUrl||"",s=n.video||n.videoUrl||"",l=n.poster||"";if(!a&&!s)return null;let p=wa(n,a,s),h=Ca(n),P=String(n.fitMode||"").trim().toLowerCase()==="contain"?"contain":"cover";return L({configId:e.id,placementId:e.placementId,configName:e.configName,advertPlatform:e.advertPlatform,mediaType:p,image:a||void 0,video:s||void 0,poster:l||void 0,bottomImage:n.bottomImage||void 0,advertiserName:n.advertiserName||void 0,advertiserLogo:n.advertiserLogo||void 0,description:n.description||void 0,buttonText:n.buttonText||void 0,badgeText:n.badgeText||void 0,jumpSeconds:n.jumpSeconds,loadTimeout:n.loadTimeout||n.timeout,muted:n.muted,adSpec:n.adSpec,fitMode:P},h)}function Sn(t,e){let n=Ra(t.filter(Sa)),a=Oa(n),s=Na(n),l=ba(void 0,e),p=Ta(s,a),h=va(n,p);return{show:!!(s||a),adId:"",type:l,provider:p,priority:h,unitId:s,customAd:a,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:t}}async function cn(t){let e=t.placementId||t.adId||"",n=ga(t,e),a=t.adId||e,s=(P,q={})=>{var pt;if(t.trackingSource==="ui")return;let G=t.tracking;if(!(G!=null&&G.track))return;let M=((pt=G.resolvePage)==null?void 0:pt.call(G,t.pageId))||{pageId:t.pageId||"page_unknown",pageIdSource:t.pageId?"props":"unknown"};G.track(Dt(L(L({key:P},a?{featureId:a}:{}),t.moduleId?{moduleId:t.moduleId}:{}),{pageId:M.pageId,pageIdSource:M.pageIdSource,pageUrl:M.pageUrl,attr:Dt(L({},q),{placementId:e})}))},l=(P,q,G)=>{var R;let M=P.data,pt=P.code===wt.SUCCESS?M!=null&&M.show?"selected":"no_config":"failed";s("bi_display_ad_config_result",L(L(L({status:pt,resultSource:q,resultCode:P.code},G?{errorType:G}:{}),M!=null&&M.provider?{provider:M.provider}:{}),((R=M==null?void 0:M.customAd)==null?void 0:R.configId)!==void 0?{configId:M.customAd.configId}:{}))};s("bi_display_ad_config_request",{requestType:"service"});let p=Da(n);if(p){v.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:n,placementId:e});let P=b(wt.SUCCESS,"\u6210\u529F",p);return l(P,"cache"),P}let h=nr.get(n);if(h){v.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:n,placementId:e});let P=await h;return l(P,"pending_reused"),P}let I=(async()=>{try{v.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",t);let P=await Ii(L({placementId:e},Number.isInteger(t.userId)&&Number(t.userId)>0?{userId:t.userId}:{})),q=Pa(P);if(v.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:n,placementId:e,response:P,body:q}),Ea(P)||!q){v.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",P);let pt=b(wt.UNKNOWN_ERROR,(P==null?void 0:P.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");return l(pt,"network","api_error"),s("bi_display_ad_error",{errorLayer:"config",errorType:"api_error",resultCode:pt.code}),pt}let G=Sn(q,t.type);G.adId=e,G.cache=Dt(L({},G.cache),{enable:!0,ttl:Ei}),Ia(n,G),v.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:n,placementId:e,provider:G.provider,priority:G.priority,hasUnitId:!!G.unitId,hasCustomAd:!!G.customAd});let M=b(wt.SUCCESS,"\u6210\u529F",G);return l(M,"network"),M}catch(P){v.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:n,placementId:e,error:P});let q=b(wt.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");return l(q,"network","network_error"),s("bi_display_ad_error",{errorLayer:"config",errorType:"network_error",resultCode:q.code}),q}finally{nr.delete(n)}})();return nr.set(n,I),I}var La=["banner","popup","half_screen"],Fa=["business","mini_program","internal","web","api","none"],xa=["token","authtoken","accesstoken","refreshtoken","authorization","cookie","password","passwd","secret","signature","credential","apikey","phone","userid","equipmentvalue","equipmentid","deviceid","entrance","thirdplatform","thirdplatformuserid","thirdplatformequipmentvalue","extenddata"],Ua=["default","vip_gold","insurance_blue"];function ir(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Bt(t){return typeof t=="string"?t.trim():""}function Va(t){return ir(t)?Object.keys(t).reduce((e,n)=>{let a=t[n],s=n.trim().toLowerCase().replace(/[\s_-]/g,"");return!s||xa.includes(s)||(typeof a=="string"||typeof a=="boolean"||typeof a=="number"&&Number.isFinite(a))&&(e[n]=a),e},{}):{}}function Ya(t){let e=ir(t)?t:{},a=Bt(e.type).toLowerCase(),s=a==="miniprogram"?"mini_program":a,l=Fa.includes(s)?s:"none",p=Bt(e.businessCode),h=Bt(e.appId),I=Bt(e.path);return Dt(L(L(L({type:l},p?{businessCode:p}:{}),h?{appId:h}:{}),I?{path:I}:{}),{params:Va(e.params)})}function Ma(t){let e=Bt(t.skinCode).toLowerCase(),n=Ua.includes(e)?e:"default",a=Number(t.heightRatio);return{skinCode:n,heightRatio:Number.isFinite(a)?Math.min(.85,Math.max(.4,a)):.68,closeable:t.closeable===!0,maskClosable:t.maskClosable!==!1,showAgreement:t.showAgreement===!0}}function Ga(t,e){let n=e==="banner"?Bt(t.bannerImageUrl)||Bt(t.image):Bt(t.popupImageUrl)||Bt(t.image),a=Bt(t.title),s=Bt(t.description),l=Bt(t.buttonText),p=Bt(t.badgeText);return L(L(L(L(L({},n?{imageUrl:n}:{}),a?{title:a}:{}),s?{description:s}:{}),l?{buttonText:l}:{}),p?{badgeText:p}:{})}function Ba(t){return!!(t.imageUrl||t.title||t.description||t.buttonText)}function ka(t){let e=Bt(t).toLowerCase();return e==="lyy"?"lyy":e==="third"?"third_party":null}function ze(t,e){var R;if(!t||t.status===0||t.isDeleted===1)return null;let n=String((R=t.id)!=null?R:"").trim(),a=String(e!=null?e:"").trim(),s=Bt(t.placementId);if(!n||!a||!(n===a||s===a))return null;let p=Bt(t.displayMode).toLowerCase(),h=ka(t.systemCode),I=ir(t.displayConfig)?t.displayConfig:{};if(!La.includes(p))return null;let P=Ga(I,p),q=Bt(t.productCode),G=Bt(t.providerCode),M=Bt(t.channelCode),pt=Bt(t.sceneCode);return Ba(P)?Dt(L(L(L(L(L({schemaVersion:Number(t.version)||1,adId:e,configId:t.id,placementId:s},q?{productCode:q}:{}),h?{systemType:h}:{}),G?{providerCode:G}:{}),M?{channelCode:M}:{}),pt?{sceneCode:pt}:{}),{displayMode:p,creative:P,panelStyle:Ma(I),action:Ya(I.action)}):null}var Ja=30*1e3,ar=new Map,or=new Map;function qa(t){return String(t.id)}function Ha(t){let e=ar.get(t);return e?e.expireAt<=Date.now()?(ar.delete(t),null):e.data:null}function ja(t,e){ar.set(t,{data:e,expireAt:Date.now()+Ja})}function Ka(t){return Array.isArray(t==null?void 0:t.body)?t.body:t!=null&&t.data?[t.data]:[]}async function ur(t){let e=typeof(t==null?void 0:t.id)=="number"?Number.isInteger(t.id)&&t.id>0?t.id:null:String((t==null?void 0:t.id)||"").trim()||null;if(e===null)return b(wt.INVALID_PARAM,"id \u5FC5\u987B\u4E3A\u975E\u7A7A\u5B57\u7B26\u4E32\u6216\u5927\u4E8E 0 \u7684\u6574\u6570");let n=Dt(L({},t),{id:e}),a=qa(n),s=Ha(a);if(s)return b(wt.SUCCESS,"\u6210\u529F",s);let l=or.get(a);if(l)return l;let p=(async()=>{try{let h=await Pi({id:n.id});if(String(h==null?void 0:h.code)!=="200")return b(wt.UNKNOWN_ERROR,(h==null?void 0:h.message)||"\u83B7\u53D6\u4EA7\u54C1 UI \u914D\u7F6E\u5931\u8D25");let P=Ka(h).map(G=>ze(G,n.id)).find(G=>!!G)||null,q={show:!!P,id:n.id,placementId:(P==null?void 0:P.placementId)||void 0,config:P,reason:P?"matched":"noConfig"};return ja(a,q),b(wt.SUCCESS,"\u6210\u529F",q)}catch(h){return v.error("\u6309\u5E7F\u544A ID \u83B7\u53D6\u4EA7\u54C1 UI \u914D\u7F6E\u5F02\u5E38",{id:n.id,error:h}),b(wt.NETWORK_ERROR,"\u83B7\u53D6\u4EA7\u54C1 UI \u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{or.delete(a)}})();return or.set(a,p),p}var Pr={};qe(Pr,{GlobalVipErrorCode:()=>Ke,checkBenefit:()=>Ir,clearCache:()=>Ao,getEntryContext:()=>Dr,getSubscribeState:()=>_n,handleSubscribeFlow:()=>mo,pollSubscribeResult:()=>yo,recordExposure:()=>_o});var $e=De();function Ti(t){return $e.get("/gw/advert/customer/global-vip/subscribe/check-buy-entrance",t)}function vi(t){return $e.get("/gw/advert/customer/global-vip/subscribe/subscribe-config",t)}function Ni(){return $e.get("/gw/advert/customer/global-vip/subscribe/user-subscribe-state")}function wi(t){return $e.get("/advert/customer/reward/multiple-reward/check",{equipmentValue:t})}function Ci(){return $e.post("/gw/advert/customer/global-vip/subscribe/set-exposure-count")}function Oi(t){return $e.post("/gw/advert/customer/automatic-debit/douyin/discount/check",t)}var mr={};qe(mr,{confirm:()=>Xi,execute:()=>Nn,getCapability:()=>Qi,resumeDouyin:()=>Wi});var Qa="/gw/advert/customer/automatic-debit/sign",Wa=De();function Li(t){return Wa.post(Qa,t)}function Fi(t){return(t==null?void 0:t.code)==="0000000"&&t.body!=null}var Te=class extends Error{constructor(e){super(e),this.name="AutomaticDebitConfirmValidationError"}};function Xa(t){var a,s;let e=(a=t.intervalMs)!=null?a:2e3,n=(s=t.timeoutMs)!=null?s:6e4;if(!Number.isFinite(e)||e<1e3)throw new Te("\u67E5\u8BE2\u95F4\u9694\u4E0D\u80FD\u5C0F\u4E8E 1000 \u6BEB\u79D2");if(!Number.isFinite(n)||n<=0)throw new Te("\u67E5\u8BE2\u8D85\u65F6\u65F6\u95F4\u5FC5\u987B\u5927\u4E8E\u96F6");return L({intervalMs:e,timeoutMs:n},t.signal?{signal:t.signal}:{})}function za(t,e,n,a){return a!=null&&a.aborted?Promise.resolve({type:"aborted"}):new Promise(s=>{let l=!1,p=P=>{l||(l=!0,clearTimeout(I),a==null||a.removeEventListener("abort",h),s(P))},h=()=>p({type:"aborted"}),I=setTimeout(()=>p({type:"timeout"}),n);a==null||a.addEventListener("abort",h,{once:!0}),Promise.resolve().then(()=>e(t)).then(P=>{if(P!=="PENDING"&&P!=="SUCCESS"&&P!=="FAILED"){p({type:"error",error:new Error("\u6700\u7EC8\u72B6\u6001\u67E5\u8BE2\u8FD4\u56DE\u4E86\u4E0D\u53D7\u652F\u6301\u7684\u72B6\u6001")});return}p({type:"status",status:P})},P=>p({type:"error",error:P}))})}function $a(t,e){return e!=null&&e.aborted?Promise.resolve(!1):new Promise(n=>{let a=!1,s=h=>{a||(a=!0,clearTimeout(p),e==null||e.removeEventListener("abort",l),n(h))},l=()=>s(!1),p=setTimeout(()=>s(!0),t);e==null||e.addEventListener("abort",l,{once:!0})})}async function xi(t,e,n={}){let a=t==null?void 0:t.trim();if(!a)throw new Te("\u7B7E\u7EA6\u8BA2\u5355\u53F7\u4E0D\u80FD\u4E3A\u7A7A");if(typeof e!="function")throw new Te("\u6700\u7EC8\u72B6\u6001\u67E5\u8BE2\u51FD\u6570\u4E0D\u80FD\u4E3A\u7A7A");let{intervalMs:s,timeoutMs:l,signal:p}=Xa(n),h=Date.now(),I;for(;;){if(p!=null&&p.aborted)return L({state:"pending",orderNo:a,reason:"aborted"},I!==void 0?{lastError:I}:{});let P=l-(Date.now()-h);if(P<=0)return L({state:"pending",orderNo:a,reason:"timeout"},I!==void 0?{lastError:I}:{});let q=await za(a,e,P,p);if(q.type==="aborted")return L({state:"pending",orderNo:a,reason:"aborted"},I!==void 0?{lastError:I}:{});if(q.type==="timeout")return L({state:"pending",orderNo:a,reason:"timeout"},I!==void 0?{lastError:I}:{});if(q.type==="error")I=q.error;else{if(q.status==="SUCCESS")return{state:"confirmed",orderNo:a};if(q.status==="FAILED")return{state:"failed",orderNo:a}}let G=l-(Date.now()-h);if(G<=0)continue;if(!await $a(Math.min(s,G),p))return L({state:"pending",orderNo:a,reason:"aborted"},I!==void 0?{lastError:I}:{})}}var Ui=["OfficialYq","WxOfficial","dyNpp","DySgp"],Vi=["alipay","aliPay","wechat"],Yi=["wxMini","aliMini","h5","command","jsapi"];function Ye(t){return typeof t=="string"&&t.trim()!==""}function Rn(t){return Ui.includes(t)}function Za(t){return Vi.includes(t)}function tu(t){return Yi.includes(t)}function Mi(t){if(t===""||t===null||t===void 0)return!1;let e=Number(t);return Number.isFinite(e)&&e>=0}function Gi(t){if(t===""||t===null||t===void 0)return!1;let e=Number(t);return Number.isInteger(e)&&e>0}function eu(t){let e=t.trim();if(!/^[a-zA-Z][a-zA-Z\d+.-]*:\/\/[^/?#\s]+(?:[/?#][^\s]*)?$/.test(e))return!1;if(typeof URL=="undefined")return!0;try{return!!new URL(e).protocol}catch(n){return!1}}function nu(t,e){return t==="OfficialYq"?e==="alipay"||e==="aliPay":e==="wechat"}function Bi(t){return!t||typeof t!="object"?{valid:!1,message:"\u7B7E\u7EA6\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A"}:Ye(t.equipmentValue)?Za(t.debitType)?Rn(t.channel)?nu(t.channel,t.debitType)?Mi(t.debitAmount)?Ye(t.executeTime)?Gi(t.period)?t.returnUrl!==void 0&&!eu(t.returnUrl)?{valid:!1,message:"\u56DE\u8DF3\u5730\u5740\u5FC5\u987B\u4E3A\u5408\u6CD5\u7684\u7EDD\u5BF9 URL"}:t.firstPayAmount!==void 0&&!Mi(t.firstPayAmount)?{valid:!1,message:"\u9996\u7B14\u652F\u4ED8\u91D1\u989D\u5FC5\u987B\u4E3A\u5927\u4E8E\u7B49\u4E8E\u96F6\u7684\u6570\u503C"}:t.firstDebitPeriod!==void 0&&!Gi(t.firstDebitPeriod)?{valid:!1,message:"\u9996\u6B21\u6263\u8D39\u5468\u671F\u5FC5\u987B\u4E3A\u6B63\u6574\u6570"}:t.wechatSignMode!==void 0&&t.wechatSignMode!=="PURE"&&t.wechatSignMode!=="PAY"?{valid:!1,message:"\u5FAE\u4FE1\u7B7E\u7EA6\u6A21\u5F0F\u4E0D\u53D7\u652F\u6301"}:t.douyinRedirectType!==void 0&&t.douyinRedirectType!=="ulink"&&t.douyinRedirectType!=="command"?{valid:!1,message:"\u6296\u97F3\u8C03\u8D77\u65B9\u5F0F\u4E0D\u53D7\u652F\u6301"}:{valid:!0}:{valid:!1,message:"\u6263\u8D39\u5468\u671F\u5FC5\u987B\u4E3A\u6B63\u6574\u6570"}:{valid:!1,message:"\u9996\u6B21\u6267\u884C\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A"}:{valid:!1,message:"\u540E\u7EED\u6263\u8D39\u91D1\u989D\u5FC5\u987B\u4E3A\u5927\u4E8E\u7B49\u4E8E\u96F6\u7684\u6570\u503C"}:{valid:!1,message:"\u7B7E\u7EA6\u6E20\u9053\u4E0E\u6263\u8D39\u7C7B\u578B\u4E0D\u5339\u914D"}:{valid:!1,message:"\u7B7E\u7EA6\u6E20\u9053\u4E0D\u53D7\u652F\u6301"}:{valid:!1,message:"\u6263\u8D39\u7C7B\u578B\u4E0D\u53D7\u652F\u6301"}:{valid:!1,message:"\u8BBE\u5907\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A"}}function ru(t){return Ye(t)?!0:typeof t=="object"&&t!==null&&!Array.isArray(t)&&Object.keys(t).length>0}function ln(t){if(!t||typeof t!="object")return{valid:!1,message:"\u7B7E\u7EA6\u54CD\u5E94\u4F53\u4E0D\u80FD\u4E3A\u7A7A"};let e=t;return Rn(e.channel)?tu(e.redirectType)?e.redirectType==="h5"||e.redirectType==="command"?Ye(e.payUrl)?{valid:!0}:{valid:!1,message:"\u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548 payUrl"}:e.redirectType==="wxMini"||e.redirectType==="aliMini"?Ye(e.appId)?Ye(e.payUrl)?{valid:!0}:{valid:!1,message:"\u5C0F\u7A0B\u5E8F\u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548 payUrl"}:{valid:!1,message:"\u5C0F\u7A0B\u5E8F\u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548 appId"}:ru(e.payInfo)?(e.channel==="dyNpp"||e.channel==="DySgp")&&!Ye(e.appId)?{valid:!1,message:"\u6296\u97F3 JSAPI \u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548 appId"}:{valid:!0}:{valid:!1,message:"JSAPI \u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548 payInfo"}:{valid:!1,message:"\u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548\u8C03\u8D77\u65B9\u5F0F"}:{valid:!1,message:"\u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548\u6E20\u9053"}}function cr(t){return ln(t).valid}var Jt=class extends Error{constructor(n,a,s){super(a);be(this,"type");be(this,"raw");this.name="AutomaticDebitRuntimeError",this.type=n,this.raw=s}};function dn(){return typeof wx!="undefined"?wx:null}function Tn(){return typeof my!="undefined"?my:null}function dr(){return typeof window!="undefined"&&typeof document!="undefined"}function iu(){return dr()&&typeof navigator!="undefined"&&/micromessenger/i.test(navigator.userAgent||"")}function Ji(){return dr()&&window.WeixinJSBridge||null}function fr(){let t=dn();if(t&&typeof t.request=="function")return"wechat-mini-program";let e=Tn();return e&&typeof e.request=="function"?"alipay-mini-program":dr()?"h5":"unknown"}function ou(t){var e,n,a;return t==="wechat-mini-program"?typeof((e=dn())==null?void 0:e.setClipboardData)=="function":t==="alipay-mini-program"?typeof((n=Tn())==null?void 0:n.setClipboardData)=="function":t==="h5"&&typeof navigator!="undefined"&&typeof((a=navigator.clipboard)==null?void 0:a.writeText)=="function"}function de(t,e,n,a){return Dt(L(L({supported:!1,runtime:e},t.channel?{channel:t.channel}:{}),t.redirectType?{redirectType:t.redirectType}:{}),{reason:n,message:a})}function vn(t,e={}){var h,I,P,q;let n=fr(),a=ln(t);if(!a.valid||!cr(t))return de(t,n,"INVALID_RESPONSE",a.message||"\u7B7E\u7EA6\u54CD\u5E94\u7ED3\u6784\u65E0\u6548");let{channel:s,redirectType:l}=t,p={supported:!0,runtime:n,channel:s,redirectType:l};return n==="unknown"?de(t,n,"UNSUPPORTED_RUNTIME","\u5F53\u524D\u8FD0\u884C\u7AEF\u4E0D\u652F\u6301\u81EA\u52A8\u4EE3\u6263\u6E20\u9053\u8C03\u8D77"):l==="h5"?n==="h5"&&typeof((h=window.location)==null?void 0:h.assign)=="function"||(n==="wechat-mini-program"||n==="alipay-mini-program")&&typeof e.externalRedirect=="function"?p:de(t,n,"UNSUPPORTED_RUNTIME","\u5F53\u524D\u8FD0\u884C\u7AEF\u65E0\u6CD5\u76F4\u63A5\u6253\u5F00 H5 \u7B7E\u7EA6\u5730\u5740\uFF0C\u8BF7\u914D\u7F6E externalRedirect"):l==="command"?s!=="dyNpp"&&s!=="DySgp"?de(t,n,"UNSUPPORTED_CHANNEL_REDIRECT","\u5F53\u524D\u6E20\u9053\u4E0D\u652F\u6301\u53E3\u4EE4\u8C03\u8D77\u65B9\u5F0F"):ou(n)?p:de(t,n,"MISSING_PLATFORM_API","\u5F53\u524D\u8FD0\u884C\u7AEF\u7F3A\u5C11\u526A\u8D34\u677F\u80FD\u529B"):l==="wxMini"?s!=="WxOfficial"?de(t,n,"UNSUPPORTED_CHANNEL_REDIRECT","\u5F53\u524D\u6E20\u9053\u4E0D\u652F\u6301\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u8C03\u8D77\u65B9\u5F0F"):n==="wechat-mini-program"&&typeof((I=dn())==null?void 0:I.navigateToMiniProgram)=="function"?p:de(t,n,"MISSING_PLATFORM_API","\u5F53\u524D\u8FD0\u884C\u7AEF\u7F3A\u5C11\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u80FD\u529B"):l==="aliMini"?s!=="OfficialYq"?de(t,n,"UNSUPPORTED_CHANNEL_REDIRECT","\u5F53\u524D\u6E20\u9053\u4E0D\u652F\u6301\u652F\u4ED8\u5B9D\u5C0F\u7A0B\u5E8F\u8C03\u8D77\u65B9\u5F0F"):n==="alipay-mini-program"&&typeof((P=Tn())==null?void 0:P.navigateToMiniProgram)=="function"?p:de(t,n,"MISSING_PLATFORM_API","\u5F53\u524D\u8FD0\u884C\u7AEF\u7F3A\u5C11\u652F\u4ED8\u5B9D\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u80FD\u529B"):s==="WxOfficial"?n==="wechat-mini-program"&&typeof((q=dn())==null?void 0:q.requestPayment)=="function"||n==="h5"&&iu()&&Ji()?p:de(t,n,"MISSING_PLATFORM_API","\u5F53\u524D\u8FD0\u884C\u7AEF\u7F3A\u5C11\u5FAE\u4FE1 JSAPI \u7B7E\u7EA6\u80FD\u529B"):s==="dyNpp"||s==="DySgp"?n==="h5"?p:de(t,n,"UNSUPPORTED_RUNTIME","\u6296\u97F3 JSAPI \u7B7E\u7EA6\u4EC5\u652F\u6301 H5 \u627F\u8F7D\u9875"):de(t,n,"UNSUPPORTED_CHANNEL_REDIRECT","\u5F53\u524D\u6E20\u9053\u4E0D\u652F\u6301 JSAPI \u8C03\u8D77\u65B9\u5F0F")}function au(t){if(t&&typeof t=="object"&&!Array.isArray(t))return t;if(typeof t=="string")try{let e=JSON.parse(t);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch(e){}throw new Jt("INVALID_RESPONSE","\u6E20\u9053 payInfo \u683C\u5F0F\u65E0\u6548")}function qi(t){let e=au(t),n=["timeStamp","nonceStr","package","signType","paySign"],a={};for(let s of n){let l=e[s];if(typeof l!="string"||l==="")throw new Jt("INVALID_RESPONSE",`\u5FAE\u4FE1 JSAPI \u7B7E\u7EA6\u53C2\u6570\u7F3A\u5C11 ${s}`);a[s]=l}return a}function uu(t){return qi(t)}function su(t){let e=t,n=String((e==null?void 0:e.errMsg)||(e==null?void 0:e.message)||"");return/cancel/i.test(n)||(e==null?void 0:e.code)===3039}function pr(t){return t instanceof Jt?t:su(t)?new Jt("USER_CANCELLED","\u7528\u6237\u53D6\u6D88\u81EA\u52A8\u4EE3\u6263\u7B7E\u7EA6",t):new Jt("CHANNEL_INVOKE_FAILED","\u6E20\u9053\u7B7E\u7EA6\u8C03\u8D77\u5931\u8D25",t)}function ki(t,e){let n=dn();return new Promise((a,s)=>{n[t](Dt(L({},e),{success:a,fail:s}))})}function cu(t,e){let n=Tn();return new Promise((a,s)=>{n[t](Dt(L({},e),{success:a,fail:s}))})}function lu(t){let e=Ji();return new Promise((n,a)=>{e.invoke("getBrandWCPayRequest",t,s=>{let l=String((s==null?void 0:s.err_msg)||(s==null?void 0:s.errMsg)||"");if(/:ok$/i.test(l)){n(s);return}a(s)})})}async function _r(t){if(typeof t.appId!="string"||t.appId==="")throw new Jt("INVALID_RESPONSE","\u6296\u97F3 JSAPI \u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548 appId");let e=t.appId,n=uu(t.payInfo),a=await Ue(),s=xe(),l=await Fe({url:s,appid:e});return await Ve({appId:e,signatureData:l,url:s,sdk:a}),sn({appId:e,payInfo:n,sdk:a})}async function lr(t,e){if(typeof e.beforeRedirect=="function")try{await e.beforeRedirect({orderNo:t.orderNo,channel:t.channel,redirectType:t.redirectType,payUrl:t.payUrl})}catch(n){throw new Jt("CHANNEL_INVOKE_FAILED","\u81EA\u52A8\u4EE3\u6263\u8DF3\u8F6C\u524D\u56DE\u8C03\u6267\u884C\u5931\u8D25",n)}}async function du(t,e,n){if(typeof e.externalRedirect!="function")throw new Jt("UNSUPPORTED_CAPABILITY","\u5F53\u524D\u5C0F\u7A0B\u5E8F\u672A\u914D\u7F6E externalRedirect\uFF0C\u65E0\u6CD5\u6253\u5F00 H5 \u7B7E\u7EA6\u5730\u5740");try{await e.externalRedirect({orderNo:t.orderNo,channel:t.channel,redirectType:t.redirectType,payUrl:t.payUrl,runtime:n})}catch(a){throw new Jt("CHANNEL_INVOKE_FAILED","\u81EA\u52A8\u4EE3\u6263\u5916\u90E8 H5 \u8DF3\u8F6C\u56DE\u8C03\u6267\u884C\u5931\u8D25",a)}}async function Hi(t,e={}){let n=vn(t,e);if(!n.supported||!cr(t))throw new Jt(n.reason==="INVALID_RESPONSE"?"INVALID_RESPONSE":"UNSUPPORTED_CAPABILITY",n.message||"\u5F53\u524D\u8FD0\u884C\u7AEF\u4E0D\u652F\u6301\u8BE5\u7B7E\u7EA6\u65B9\u5F0F");let a={orderNo:t.orderNo,channel:t.channel,redirectType:t.redirectType};try{if(t.redirectType==="h5"){if(await lr(t,e),n.runtime==="h5")window.location.assign(t.payUrl);else if(n.runtime==="wechat-mini-program"||n.runtime==="alipay-mini-program")await du(t,e,n.runtime);else throw new Jt("UNSUPPORTED_CAPABILITY","\u5F53\u524D\u8FD0\u884C\u7AEF\u65E0\u6CD5\u6253\u5F00 H5 \u7B7E\u7EA6\u5730\u5740");return Dt(L({},a),{state:"redirected"})}if(t.redirectType==="command")return await Ce(t.payUrl),Dt(L({},a),{state:"command_ready",payUrl:t.payUrl});if(t.redirectType==="wxMini"){await lr(t,e);let l=await ki("navigateToMiniProgram",L({appId:t.appId,path:t.payUrl},typeof t.payInfo=="object"&&t.payInfo?{extraData:t.payInfo}:{}));return Dt(L({},a),{state:"redirected",raw:l})}if(t.redirectType==="aliMini"){await lr(t,e);let l=await cu("navigateToMiniProgram",L({appId:t.appId,path:t.payUrl},typeof t.payInfo=="object"&&t.payInfo?{extraData:t.payInfo}:{}));return Dt(L({},a),{state:"redirected",raw:l})}if(t.channel==="WxOfficial"){let l=qi(t.payInfo),p=n.runtime==="wechat-mini-program"?await ki("requestPayment",l):await lu(l);return Dt(L({},a),{state:"invoked",raw:p})}let s=await _r(t);return Dt(L({},a),{state:"invoked",raw:s})}catch(s){throw pr(s)}}async function ji(t){var n;let e=(n=t==null?void 0:t.requestId)==null?void 0:n.trim();if(!e)throw new Jt("INVALID_RESPONSE","\u6296\u97F3\u81EA\u52A8\u4EE3\u6263\u7EED\u63A5 requestId \u4E0D\u80FD\u4E3A\u7A7A");if(fr()!=="h5")throw new Jt("UNSUPPORTED_CAPABILITY","\u6296\u97F3\u81EA\u52A8\u4EE3\u6263\u7EED\u63A5\u4EC5\u652F\u6301 H5 \u627F\u8F7D\u9875");try{let a=await We(e),s=a.appId||a.appid||"",l=await _r({appId:s,payInfo:a.payInfo}),p=Rn(a.channel)&&(a.channel==="dyNpp"||a.channel==="DySgp")?a.channel:void 0;return{state:"invoked",orderNo:a.orderNo,channel:p,redirectType:"jsapi",raw:l}}catch(a){throw pr(a)}}function fu(t){return t.type==="INVALID_RESPONSE"?4103:t.type==="UNSUPPORTED_CAPABILITY"?4104:t.type==="USER_CANCELLED"?4106:4105}function Ki(t){let e=t instanceof Jt?t:new Jt("CHANNEL_INVOKE_FAILED",le[4105],t),n=fu(e),a=n===4106?"cancelled":"failed";return b(n,e.message||le[n],L({state:a},e.raw!==void 0?{raw:e.raw}:{}))}async function Nn(t,e={}){let n=Bi(t);if(!n.valid)return b(4101,n.message||le[4101]);let a;try{a=await Li(t)}catch(p){return b(4102,(p==null?void 0:p.message)||le[4102])}if(!Fi(a))return b(4102,(a==null?void 0:a.message)||le[4102]);let s=ln(a.body);if(!s.valid)return b(4103,s.message||le[4103]);let l=vn(a.body,e);if(!l.supported)return b(4104,l.message||le[4104],{state:"failed",orderNo:a.body.orderNo,channel:a.body.channel,redirectType:a.body.redirectType});try{let p=await Hi(a.body,e);return b(0,"\u6210\u529F",p)}catch(p){return Ki(p)}}function Qi(t,e={}){return vn(t,e)}async function Wi(t){try{let e=await ji(t);return b(0,"\u6210\u529F",e)}catch(e){return Ki(e)}}async function Xi(t,e,n={}){try{let a=await xi(t,e,n);return a.state==="failed"?b(4107,le[4107],a):a.reason==="timeout"?b(4108,le[4108],a):b(0,a.reason==="aborted"?"\u6700\u7EC8\u72B6\u6001\u786E\u8BA4\u5DF2\u53D6\u6D88":"\u6210\u529F",a)}catch(a){let l=a instanceof Te?4101:4107;return b(l,(a==null?void 0:a.message)||le[l])}}var zi=["silver","gold","black","diamond"],$i=["OfficialYq","WxOfficial","dyNpp","DySgp"],Zi=["aliMini","aliPay","wxMini","wechat"],to=["alipay","aliPay","wechat"],eo=["ios","android","other"],no=["dyNpp","DySgp"],ro={dev:"wxe3b203d57e31f7d5",sit:"wx8774db1793d85b6f",uat:"wx8774db1793d85b6f",prod:"wx54c55f3735702ba6"};var wn=new Map,fn=new Map;function yr(t,e){let n=wn.get(t);if(n&&Date.now()-n.timestamp<6e4)return n.promise;let a=e().catch(s=>{throw wn.delete(t),s});return wn.set(t,{timestamp:Date.now(),promise:a}),a}function io(){wn.clear(),fn.clear()}function oo(t,e){let n=fn.get(t);if(n)return n;let a=e().finally(()=>{fn.get(t)===a&&fn.delete(t)});return fn.set(t,a),a}var Kt=class extends Error{constructor(n,a){super(a||_e[n]);be(this,"code");this.name="GlobalVipServiceError",this.code=n}};function Ze(t){return String(t)==="0000000"}function Ar(t){return Zi.includes(t)}function Cn(t){return zi.includes(t)}function ao(t){return $i.includes(t)}function hr(t){return no.includes(t)}function uo(){return{window:!1,banner:!1,package:!1,cart:!1}}function gr(t){let e=t==null||t===""?null:Number(t),n=e!==null&&Number.isFinite(e)?e:null,a="inactive";return n===1?a="active":n===2?a="refunded":n===3?a="trial":n!==null&&(a="unknown"),{state:n,active:n===1||n===3,status:a}}function so(t,e,n=!1){let a=Cn(t.subscribeType)?t.subscribeType:e,s=t.channelCode,l=Number(t.payAmount),p=Number(t.firstPayAmount),h=Number(t.renewAmount),I=Number(t.effectiveDate);if(!ao(s)||!Number.isFinite(l)||!Number.isFinite(p)||!Number.isFinite(h)||!Number.isFinite(I))return null;let P=q=>{let G=Number(q);return Number.isFinite(G)&&G>=0?G:0};return{subscribeType:a,channelCode:s,payAmount:l,firstPayAmount:p,renewAmount:h,effectiveDate:I,tryDay:P(t.tryDay),totalBenefitAmount:P(t.totalBenefitAmount),firstBenefitAmount:P(t.firstBenefitAmount),closeButtonPopSecond:P(t.closeButtonPopSecond),canEnjoyDiscount:n}}function co(t){return t?Cn(t.subscribeType)&&ao(t.channelCode)&&Number.isFinite(t.payAmount)&&Number.isFinite(t.firstPayAmount)&&Number.isFinite(t.renewAmount)&&Number.isFinite(t.effectiveDate)&&Number.isFinite(t.tryDay)&&t.tryDay>=0:!1}function lo(t){var e,n,a;if(!((e=t==null?void 0:t.equipmentValue)!=null&&e.trim()))throw new Kt(4001);if(!((n=t.equipmentTypeValue)!=null&&n.trim()))throw new Kt(4002);if(!Ar(t.clientType))throw new Kt(4003);if(!to.includes(t.debitType)||!eo.includes(t.os)||!((a=t.returnUrl)!=null&&a.trim()))throw new Kt(4007,"\u5E73\u53F0\u5927\u4F1A\u5458\u7B7E\u7EA6\u53C2\u6570\u65E0\u6548")}function _u(t){let e=n=>String(n).padStart(2,"0");return[t.getFullYear(),"-",e(t.getMonth()+1),"-",e(t.getDate())," ",e(t.getHours()),":",e(t.getMinutes()),":",e(t.getSeconds())].join("")}function fo(t,e){let n=new Date(Date.now()+e.tryDay*24*60*60*1e3),a=Xt().env||"prod",s=He(a,""),l=e.renewAmount===e.payAmount,p=[`${s}/pages/subAdvertising.html#/douyinSign?page=douyinSign`,`equipmentTypeId=${encodeURIComponent(t.equipmentTypeValue)}`,`price=${encodeURIComponent(String(e.payAmount))}`,`isNewMember=${l}`].join("&"),h={equipmentValue:t.equipmentValue,debitType:t.debitType,debitAmount:e.renewAmount,firstPayAmount:e.payAmount,period:e.effectiveDate,douyinSignPage:p,returnUrl:t.returnUrl,extraInfo:{subscribeType:e.subscribeType},platform:"lyy",executeTime:_u(n),channel:e.channelCode};t.phone&&(h.phoneNumber=t.phone),e.tryDay>0&&(h.signOnly=!0);let I=t.clientType==="aliMini"||t.clientType==="wxMini";if(hr(e.channelCode)&&(t.os==="ios"||t.os==="android"&&I)&&(h.douyinRedirectType="ulink"),e.channelCode==="WxOfficial"){h.wechatSignMode="PURE";let P=Xt().env||"prod",q=t.wechatAppId||(t.clientType==="wechat"?ro[P]:"");q&&(h.wechatAppId=q)}return h}function pn(t,e){return t instanceof Kt?b(t.code,t.message):(v.error("\u5E73\u53F0\u5927\u4F1A\u5458\u670D\u52A1\u5F02\u5E38",{code:t==null?void 0:t.code,name:t==null?void 0:t.name}),b(e,_e[e]))}function po(t){return t.result!==void 0?Number(t.result)===0:Ze(t.code)}async function mu(t){let e=`entrance:${t.equipmentTypeValue}:${t.equipmentValue}`;return yr(e,async()=>{let n=await Ti({equipmentTypeValue:t.equipmentTypeValue});if(!Ze(n.code)||!n.body)throw new Kt(4004);return n.body})}async function yu(t,e){let n=`config:${e}:${t.clientType}:${t.equipmentValue}`;return yr(n,async()=>{let a=await vi({subscribeType:e,clientType:t.clientType,equipmentValue:t.equipmentValue});if(!Ze(a.code)||!a.body)throw new Kt(4006);return a.body})}async function Au(t,e){var s;if(!hr(e.channelCode))return!1;let n=Dt(L({equipmentValue:t.equipmentValue,debitType:t.clientType==="aliMini"||t.clientType==="aliPay"?"alipay":"wechat",channel:e.channelCode},t.phone?{phoneNumber:t.phone}:{}),{firstPayAmount:e.firstPayAmount,debitAmount:e.renewAmount,businessType:1,platform:"lyy",douyinAppId:""}),a=await Oi(n);if(Ze(a.code))return((s=a.body)==null?void 0:s.canEnjoyDiscount)===!0;if(!t.phone&&a.code==="0000400"&&a.message==="phoneNumber\u4E0D\u80FD\u4E3A\u7A7A")return!0;throw new Kt(4014)}async function _n(){var t;try{let e=await Ni();if(!Ze(e.code))throw new Kt(4008);return b(0,"\u6210\u529F",gr((t=e.body)==null?void 0:t.state))}catch(e){return pn(e,4008)}}async function Dr(t){var e,n;if(!((e=t==null?void 0:t.equipmentValue)!=null&&e.trim()))return b(4001,_e[4001]);if(!((n=t.equipmentTypeValue)!=null&&n.trim()))return b(4002,_e[4002]);if(!Ar(t.clientType))return b(4003,_e[4003]);try{let a=await _n();if(a.code!==0||!a.data)return b(a.code,a.message);if(a.data.active)return b(0,"\u7528\u6237\u5DF2\u5F00\u901A\u5E73\u53F0\u5927\u4F1A\u5458",{canPurchase:!1,active:!0,memberState:a.data.state,subscribeType:null,entrances:uo(),config:null});let s=await mu(t);if(!Cn(s.subscribeType))throw new Kt(4005);let l=await yu(t,s.subscribeType),p=so(l,s.subscribeType);if(!p)throw new Kt(4007);let h=await Au(t,p),I=Dt(L({},p),{canEnjoyDiscount:h}),P={window:s.windowEntrance===!0,banner:s.bannerEntrance===!0,package:s.packageEntrance===!0,cart:s.buyCarEntrance===!0};return b(0,"\u6210\u529F",{canPurchase:!0,active:!1,memberState:a.data.state,subscribeType:s.subscribeType,entrances:P,config:I})}catch(a){return pn(a,4004)}}async function Ir(t){var e,n;if(!((e=t==null?void 0:t.equipmentValue)!=null&&e.trim()))return b(4001,_e[4001]);try{let a=await wi(t.equipmentValue);if(!po(a))throw new Kt(4012);let s=(n=a.data)!=null?n:a.body;return b(0,"\u6210\u529F",L({received:!!s},s!==void 0?{rawData:s}:{}))}catch(a){return pn(a,4012)}}async function _o(){try{let t=await Ci();if(!po(t))throw new Kt(4013);return b(0,"\u6210\u529F",!0)}catch(t){return pn(t,4013)}}async function mo(t){var e;try{lo(t);let n=await _n();if(n.code!==0||!n.data)return b(n.code,n.message);if(n.data.active)return b(0,"\u7528\u6237\u5DF2\u5F00\u901A\u5E73\u53F0\u5927\u4F1A\u5458",{type:"already_active",state:n.data});let a=t.config;if(!a){let p=await Dr({equipmentValue:t.equipmentValue,equipmentTypeValue:t.equipmentTypeValue,clientType:t.clientType,phone:t.phone});if(p.code!==0||!((e=p.data)!=null&&e.config))return b(p.code,p.message);a=p.data.config}if(!co(a))throw new Kt(4007);let s=fo(t,a),l=["sign",t.equipmentValue,a.subscribeType,a.channelCode,t.debitType].join(":");return oo(l,()=>Nn(s,{beforeRedirect:t.beforeRedirect,externalRedirect:t.externalRedirect}))}catch(n){return pn(n,4010)}}function hu(t){return new Promise(e=>setTimeout(e,t))}async function yo(t){var G,M,pt;if(!((G=t==null?void 0:t.equipmentValue)!=null&&G.trim()))return b(4001,_e[4001]);let e=(M=t.maxAttempts)!=null?M:3,n=(pt=t.interval)!=null?pt:3e3;if(!Number.isInteger(e)||e<1||!Number.isFinite(n)||n<0)return b(4007,"\u5E73\u53F0\u5927\u4F1A\u5458\u8F6E\u8BE2\u53C2\u6570\u65E0\u6548");let a=t.checkBenefit!==!1,s=gr(null),l=!1,p=!1,h=!a,I=!1,P=!a,q=0;for(let R=1;R<=e;R+=1){q=R;let[J,ct]=await Promise.all([p?Promise.resolve(null):_n(),h?Promise.resolve(null):Ir({equipmentValue:t.equipmentValue})]);if((J==null?void 0:J.code)===0&&J.data&&(I=!0,s=J.data,p=J.data.active),(ct==null?void 0:ct.code)===0&&ct.data&&(P=!0,l=ct.data.received,h=l),p&&h)break;R<e&&await hu(n)}return!I||!P?b(4015,_e[4015]):b(0,"\u6210\u529F",{active:s.active,benefitReceived:l,memberState:s.state,attempts:q})}function Ao(){io()}function gu(t={}){v.info("\u670D\u52A1\u521D\u59CB\u5316",t);let e=L(L({},je),t);e.env&&!Dn[e.env]&&(v.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${e.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),e.env=ee.PROD),e.externalEnv&&!tn[e.externalEnv]&&(v.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${e.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),e.externalEnv=he.PROD),e.debug!==void 0&&v.setEnable(e.debug),Lr(e),v.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",e)}function ho(t={}){let e="",n=null;async function a(){if(typeof t.getAuthToken=="function"){let l=await t.getAuthToken();if(l)return l}return n&&typeof n.getStorage=="function"&&n.getStorage("auth_token")||""}let s={name:"services",setToken(l){return e=l||"",n&&typeof n.setStorage=="function"&&n.setStorage("auth_token",e),s},async getAuthToken(){return e||a()},clearToken(){return e="",n&&typeof n.setStorage=="function"&&n.setStorage("auth_token",""),s},install(l){n=l;let p=Dt(L({},t),{getAuthToken:()=>s.getAuthToken()});gu(p),v.info("services installed via nova.use()"),Object.assign(l,{jd:L({},Wn),dy:L({},er),ads:Dt(L({},sr),{getDisplayAdConfig:h=>cn(Dt(L({},h),{tracking:l.tracking}))}),globalVip:L({},Pr),automaticDebit:L({},mr),setToken:s.setToken,clearToken:s.clearToken})}};return s}0&&(module.exports={AutomaticDebitErrorCode,AutomaticDebitErrorMessage,DyErrorCode,DyErrorMessage,ENV_TYPE,EXTERNAL_ENV_TYPE,GlobalVipErrorCode,GlobalVipErrorMessage,JdErrorCode,JdErrorMessage,checkBenefit,clearCache,confirm,createServices,execute,getCapability,getDisplayAdConfig,getDyPayRtaData,getEntryContext,getProductConfig,getSubscribeState,handleDyAuthDebitSignFlow,handleDyAuthDebitSignFlowWithRawPayInfo,handleDyJsapiPayFlow,handleDyPayCommandFlow,handleDyPayFlow,handleJdInsurance,handleJdInsuranceExt,handleJdjrCashLoanExt,handleJdjrCashLoanFlow,handleSubscribeFlow,normalizeDisplayAdData,normalizeProductConfig,pollSubscribeResult,recordExposure,resumeDouyin});
|
|
1
|
+
"use strict";var Dn=Object.defineProperty,Bo=Object.defineProperties,ko=Object.getOwnPropertyDescriptor,Jo=Object.getOwnPropertyDescriptors,qo=Object.getOwnPropertyNames,Ur=Object.getOwnPropertySymbols;var xr=Object.prototype.hasOwnProperty,Ho=Object.prototype.propertyIsEnumerable;var Gn=(t,e,n)=>e in t?Dn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,F=(t,e)=>{for(var n in e||(e={}))xr.call(e,n)&&Gn(t,n,e[n]);if(Ur)for(var n of Ur(e))Ho.call(e,n)&&Gn(t,n,e[n]);return t},It=(t,e)=>Bo(t,Jo(e));var jo=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),we=(t,e)=>{for(var n in e)Dn(t,n,{get:e[n],enumerable:!0})},Ko=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of qo(e))!xr.call(t,s)&&s!==n&&Dn(t,s,{get:()=>e[s],enumerable:!(o=ko(e,s))||o.enumerable});return t};var Qo=t=>Ko(Dn({},"__esModule",{value:!0}),t);var be=(t,e,n)=>Gn(t,typeof e!="symbol"?e+"":e,n);var Xr=jo((fs,Wr)=>{"use strict";(()=>{var t={737:(s,l,p)=>{"use strict";p.r(l),p.d(l,{default:()=>Y,getJrCommand:()=>C});var h=p(307),D=p.n(h);function P(){P=function(){return $};var S,$={},bt=Object.prototype,_t=bt.hasOwnProperty,Tt=Object.defineProperty||function(y,_,I){y[_]=I.value},mt=typeof Symbol=="function"?Symbol:{},Dt=mt.iterator||"@@iterator",Rt=mt.asyncIterator||"@@asyncIterator",vt=mt.toStringTag||"@@toStringTag";function ht(y,_,I){return Object.defineProperty(y,_,{value:I,enumerable:!0,configurable:!0,writable:!0}),y[_]}try{ht({},"")}catch(y){ht=function(_,I,k){return _[I]=k}}function zt(y,_,I,k){var R=_&&_.prototype instanceof Ae?_:Ae,K=Object.create(R.prototype),ut=new Ee(k||[]);return Tt(K,"_invoke",{value:Ut(y,I,ut)}),K}function $t(y,_,I){try{return{type:"normal",arg:y.call(_,I)}}catch(k){return{type:"throw",arg:k}}}$.wrap=zt;var Qt="suspendedStart",ie="suspendedYield",Zt="executing",w="completed",Lt={};function Ae(){}function _e(){}function qt(){}var he={};ht(he,Dt,(function(){return this}));var me=Object.getPrototypeOf,Vt=me&&me(me(ce([])));Vt&&Vt!==bt&&_t.call(Vt,Dt)&&(he=Vt);var Wt=qt.prototype=Ae.prototype=Object.create(he);function Ne(y){["next","throw","return"].forEach((function(_){ht(y,_,(function(I){return this._invoke(_,I)}))}))}function oe(y,_){function I(R,K,ut,St){var gt=$t(y[R],y,K);if(gt.type!=="throw"){var te=gt.arg,ae=te.value;return ae&&N(ae)=="object"&&_t.call(ae,"__await")?_.resolve(ae.__await).then((function(Nt){I("next",Nt,ut,St)}),(function(Nt){I("throw",Nt,ut,St)})):_.resolve(ae).then((function(Nt){te.value=Nt,ut(te)}),(function(Nt){return I("throw",Nt,ut,St)}))}St(gt.arg)}var k;Tt(this,"_invoke",{value:function(R,K){function ut(){return new _((function(St,gt){I(R,K,St,gt)}))}return k=k?k.then(ut,ut):ut()}})}function Ut(y,_,I){var k=Qt;return function(R,K){if(k===Zt)throw Error("Generator is already running");if(k===w){if(R==="throw")throw K;return{value:S,done:!0}}for(I.method=R,I.arg=K;;){var ut=I.delegate;if(ut){var St=Mt(ut,I);if(St){if(St===Lt)continue;return St}}if(I.method==="next")I.sent=I._sent=I.arg;else if(I.method==="throw"){if(k===Qt)throw k=w,I.arg;I.dispatchException(I.arg)}else I.method==="return"&&I.abrupt("return",I.arg);k=Zt;var gt=$t(y,_,I);if(gt.type==="normal"){if(k=I.done?w:ie,gt.arg===Lt)continue;return{value:gt.arg,done:I.done}}gt.type==="throw"&&(k=w,I.method="throw",I.arg=gt.arg)}}}function Mt(y,_){var I=_.method,k=y.iterator[I];if(k===S)return _.delegate=null,I==="throw"&&y.iterator.return&&(_.method="return",_.arg=S,Mt(y,_),_.method==="throw")||I!=="return"&&(_.method="throw",_.arg=new TypeError("The iterator does not provide a '"+I+"' method")),Lt;var R=$t(k,y.iterator,_.arg);if(R.type==="throw")return _.method="throw",_.arg=R.arg,_.delegate=null,Lt;var K=R.arg;return K?K.done?(_[y.resultName]=K.value,_.next=y.nextLoc,_.method!=="return"&&(_.method="next",_.arg=S),_.delegate=null,Lt):K:(_.method="throw",_.arg=new TypeError("iterator result is not an object"),_.delegate=null,Lt)}function se(y){var _={tryLoc:y[0]};1 in y&&(_.catchLoc=y[1]),2 in y&&(_.finallyLoc=y[2],_.afterLoc=y[3]),this.tryEntries.push(_)}function Pe(y){var _=y.completion||{};_.type="normal",delete _.arg,y.completion=_}function Ee(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(se,this),this.reset(!0)}function ce(y){if(y||y===""){var _=y[Dt];if(_)return _.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var I=-1,k=function R(){for(;++I<y.length;)if(_t.call(y,I))return R.value=y[I],R.done=!1,R;return R.value=S,R.done=!0,R};return k.next=k}}throw new TypeError(N(y)+" is not iterable")}return _e.prototype=qt,Tt(Wt,"constructor",{value:qt,configurable:!0}),Tt(qt,"constructor",{value:_e,configurable:!0}),_e.displayName=ht(qt,vt,"GeneratorFunction"),$.isGeneratorFunction=function(y){var _=typeof y=="function"&&y.constructor;return!!_&&(_===_e||(_.displayName||_.name)==="GeneratorFunction")},$.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,qt):(y.__proto__=qt,ht(y,vt,"GeneratorFunction")),y.prototype=Object.create(Wt),y},$.awrap=function(y){return{__await:y}},Ne(oe.prototype),ht(oe.prototype,Rt,(function(){return this})),$.AsyncIterator=oe,$.async=function(y,_,I,k,R){R===void 0&&(R=Promise);var K=new oe(zt(y,_,I,k),R);return $.isGeneratorFunction(_)?K:K.next().then((function(ut){return ut.done?ut.value:K.next()}))},Ne(Wt),ht(Wt,vt,"Generator"),ht(Wt,Dt,(function(){return this})),ht(Wt,"toString",(function(){return"[object Generator]"})),$.keys=function(y){var _=Object(y),I=[];for(var k in _)I.push(k);return I.reverse(),function R(){for(;I.length;){var K=I.pop();if(K in _)return R.value=K,R.done=!1,R}return R.done=!0,R}},$.values=ce,Ee.prototype={constructor:Ee,reset:function(y){if(this.prev=0,this.next=0,this.sent=this._sent=S,this.done=!1,this.delegate=null,this.method="next",this.arg=S,this.tryEntries.forEach(Pe),!y)for(var _ in this)_.charAt(0)==="t"&&_t.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=S)},stop:function(){this.done=!0;var y=this.tryEntries[0].completion;if(y.type==="throw")throw y.arg;return this.rval},dispatchException:function(y){if(this.done)throw y;var _=this;function I(gt,te){return K.type="throw",K.arg=y,_.next=gt,te&&(_.method="next",_.arg=S),!!te}for(var k=this.tryEntries.length-1;k>=0;--k){var R=this.tryEntries[k],K=R.completion;if(R.tryLoc==="root")return I("end");if(R.tryLoc<=this.prev){var ut=_t.call(R,"catchLoc"),St=_t.call(R,"finallyLoc");if(ut&&St){if(this.prev<R.catchLoc)return I(R.catchLoc,!0);if(this.prev<R.finallyLoc)return I(R.finallyLoc)}else if(ut){if(this.prev<R.catchLoc)return I(R.catchLoc,!0)}else{if(!St)throw Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return I(R.finallyLoc)}}}},abrupt:function(y,_){for(var I=this.tryEntries.length-1;I>=0;--I){var k=this.tryEntries[I];if(k.tryLoc<=this.prev&&_t.call(k,"finallyLoc")&&this.prev<k.finallyLoc){var R=k;break}}R&&(y==="break"||y==="continue")&&R.tryLoc<=_&&_<=R.finallyLoc&&(R=null);var K=R?R.completion:{};return K.type=y,K.arg=_,R?(this.method="next",this.next=R.finallyLoc,Lt):this.complete(K)},complete:function(y,_){if(y.type==="throw")throw y.arg;return y.type==="break"||y.type==="continue"?this.next=y.arg:y.type==="return"?(this.rval=this.arg=y.arg,this.method="return",this.next="end"):y.type==="normal"&&_&&(this.next=_),Lt},finish:function(y){for(var _=this.tryEntries.length-1;_>=0;--_){var I=this.tryEntries[_];if(I.finallyLoc===y)return this.complete(I.completion,I.afterLoc),Pe(I),Lt}},catch:function(y){for(var _=this.tryEntries.length-1;_>=0;--_){var I=this.tryEntries[_];if(I.tryLoc===y){var k=I.completion;if(k.type==="throw"){var R=k.arg;Pe(I)}return R}}throw Error("illegal catch attempt")},delegateYield:function(y,_,I){return this.delegate={iterator:ce(y),resultName:_,nextLoc:I},this.method==="next"&&(this.arg=S),Lt}},$}function q(S,$,bt,_t,Tt,mt,Dt){try{var Rt=S[mt](Dt),vt=Rt.value}catch(ht){return void bt(ht)}Rt.done?$(vt):Promise.resolve(vt).then(_t,Tt)}function N(S){return N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},N(S)}var G="https://ms.jr.jd.com";function pt(S){var $=S.host,bt=S.type,_t=bt===void 0?"post":bt,Tt=S.data,mt=S.path,Dt=mt===void 0?"":mt,Rt=S.config,vt=Rt===void 0?{}:Rt,ht=(vt.withCredentials,vt.isWG),zt=ht===void 0||ht,$t=vt.contentType,Qt=$t===void 0?"application/x-www-form-urlencoded":$t;return new Promise((function(ie,Zt){wx.request({url:($||G)+Dt,method:_t.toUpperCase(),data:zt?T({reqData:JSON.stringify(Tt)}):Tt,header:{"content-type":Qt},success:function(w){w.statusCode===200?ie(w.data):Zt({statusCode:w.statusCode,errMsg:w.errMsg,data:w.data})},fail:function(w){Zt(w)}})}))}function T(S){var $="";return N(S)==="object"&&S!==null&&(Object.keys(S).map((function(bt){var _t=S[bt];return $+=bt+"="+encodeURIComponent(_t)+"&",""})),$.length>0&&($=$.substr(0,$.length-1))),$}function J(S){return ct.apply(this,arguments)}function ct(){var S;return S=P().mark((function $(bt){var _t,Tt,mt,Dt,Rt,vt,ht,zt,$t,Qt;return P().wrap((function(ie){for(;;)switch(ie.prev=ie.next){case 0:return _t=bt.url,Tt=bt.channel,mt=bt.callback,D().init(),Dt=new(D()),Rt=Dt.nonce(),vt=Dt.sign(JSON.stringify({t:"".concat(new Date().getTime())}),Rt),ht="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),zt="",$t={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:_t,channel:Tt,clientCode:"0",antiRushInfo:vt}},ie.next=12,pt({host:"https://ms.jr.jd.com",type:"post",path:ht,config:{withCredentials:!0},data:$t});case 12:(Qt=ie.sent).resultCode===0&&Qt.resultData&&Qt.resultData.code==="00000"&&Qt.resultData.data&&(zt=Qt.resultData.data.goldenKeyText),mt&&mt(zt?{code:"0",msg:"command success",data:zt}:{code:"-1",msg:"command empty"});case 15:case"end":return ie.stop()}}),$)})),ct=function(){var $=this,bt=arguments;return new Promise((function(_t,Tt){var mt=S.apply($,bt);function Dt(vt){q(mt,_t,Tt,Dt,Rt,"next",vt)}function Rt(vt){q(mt,_t,Tt,Dt,Rt,"throw",vt)}Dt(void 0)}))},ct.apply(this,arguments)}function st(S){return st=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},st(S)}function X(){X=function(){return $};var S,$={},bt=Object.prototype,_t=bt.hasOwnProperty,Tt=Object.defineProperty||function(y,_,I){y[_]=I.value},mt=typeof Symbol=="function"?Symbol:{},Dt=mt.iterator||"@@iterator",Rt=mt.asyncIterator||"@@asyncIterator",vt=mt.toStringTag||"@@toStringTag";function ht(y,_,I){return Object.defineProperty(y,_,{value:I,enumerable:!0,configurable:!0,writable:!0}),y[_]}try{ht({},"")}catch(y){ht=function(_,I,k){return _[I]=k}}function zt(y,_,I,k){var R=_&&_.prototype instanceof Ae?_:Ae,K=Object.create(R.prototype),ut=new Ee(k||[]);return Tt(K,"_invoke",{value:Ut(y,I,ut)}),K}function $t(y,_,I){try{return{type:"normal",arg:y.call(_,I)}}catch(k){return{type:"throw",arg:k}}}$.wrap=zt;var Qt="suspendedStart",ie="suspendedYield",Zt="executing",w="completed",Lt={};function Ae(){}function _e(){}function qt(){}var he={};ht(he,Dt,(function(){return this}));var me=Object.getPrototypeOf,Vt=me&&me(me(ce([])));Vt&&Vt!==bt&&_t.call(Vt,Dt)&&(he=Vt);var Wt=qt.prototype=Ae.prototype=Object.create(he);function Ne(y){["next","throw","return"].forEach((function(_){ht(y,_,(function(I){return this._invoke(_,I)}))}))}function oe(y,_){function I(R,K,ut,St){var gt=$t(y[R],y,K);if(gt.type!=="throw"){var te=gt.arg,ae=te.value;return ae&&st(ae)=="object"&&_t.call(ae,"__await")?_.resolve(ae.__await).then((function(Nt){I("next",Nt,ut,St)}),(function(Nt){I("throw",Nt,ut,St)})):_.resolve(ae).then((function(Nt){te.value=Nt,ut(te)}),(function(Nt){return I("throw",Nt,ut,St)}))}St(gt.arg)}var k;Tt(this,"_invoke",{value:function(R,K){function ut(){return new _((function(St,gt){I(R,K,St,gt)}))}return k=k?k.then(ut,ut):ut()}})}function Ut(y,_,I){var k=Qt;return function(R,K){if(k===Zt)throw Error("Generator is already running");if(k===w){if(R==="throw")throw K;return{value:S,done:!0}}for(I.method=R,I.arg=K;;){var ut=I.delegate;if(ut){var St=Mt(ut,I);if(St){if(St===Lt)continue;return St}}if(I.method==="next")I.sent=I._sent=I.arg;else if(I.method==="throw"){if(k===Qt)throw k=w,I.arg;I.dispatchException(I.arg)}else I.method==="return"&&I.abrupt("return",I.arg);k=Zt;var gt=$t(y,_,I);if(gt.type==="normal"){if(k=I.done?w:ie,gt.arg===Lt)continue;return{value:gt.arg,done:I.done}}gt.type==="throw"&&(k=w,I.method="throw",I.arg=gt.arg)}}}function Mt(y,_){var I=_.method,k=y.iterator[I];if(k===S)return _.delegate=null,I==="throw"&&y.iterator.return&&(_.method="return",_.arg=S,Mt(y,_),_.method==="throw")||I!=="return"&&(_.method="throw",_.arg=new TypeError("The iterator does not provide a '"+I+"' method")),Lt;var R=$t(k,y.iterator,_.arg);if(R.type==="throw")return _.method="throw",_.arg=R.arg,_.delegate=null,Lt;var K=R.arg;return K?K.done?(_[y.resultName]=K.value,_.next=y.nextLoc,_.method!=="return"&&(_.method="next",_.arg=S),_.delegate=null,Lt):K:(_.method="throw",_.arg=new TypeError("iterator result is not an object"),_.delegate=null,Lt)}function se(y){var _={tryLoc:y[0]};1 in y&&(_.catchLoc=y[1]),2 in y&&(_.finallyLoc=y[2],_.afterLoc=y[3]),this.tryEntries.push(_)}function Pe(y){var _=y.completion||{};_.type="normal",delete _.arg,y.completion=_}function Ee(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(se,this),this.reset(!0)}function ce(y){if(y||y===""){var _=y[Dt];if(_)return _.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var I=-1,k=function R(){for(;++I<y.length;)if(_t.call(y,I))return R.value=y[I],R.done=!1,R;return R.value=S,R.done=!0,R};return k.next=k}}throw new TypeError(st(y)+" is not iterable")}return _e.prototype=qt,Tt(Wt,"constructor",{value:qt,configurable:!0}),Tt(qt,"constructor",{value:_e,configurable:!0}),_e.displayName=ht(qt,vt,"GeneratorFunction"),$.isGeneratorFunction=function(y){var _=typeof y=="function"&&y.constructor;return!!_&&(_===_e||(_.displayName||_.name)==="GeneratorFunction")},$.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,qt):(y.__proto__=qt,ht(y,vt,"GeneratorFunction")),y.prototype=Object.create(Wt),y},$.awrap=function(y){return{__await:y}},Ne(oe.prototype),ht(oe.prototype,Rt,(function(){return this})),$.AsyncIterator=oe,$.async=function(y,_,I,k,R){R===void 0&&(R=Promise);var K=new oe(zt(y,_,I,k),R);return $.isGeneratorFunction(_)?K:K.next().then((function(ut){return ut.done?ut.value:K.next()}))},Ne(Wt),ht(Wt,vt,"Generator"),ht(Wt,Dt,(function(){return this})),ht(Wt,"toString",(function(){return"[object Generator]"})),$.keys=function(y){var _=Object(y),I=[];for(var k in _)I.push(k);return I.reverse(),function R(){for(;I.length;){var K=I.pop();if(K in _)return R.value=K,R.done=!1,R}return R.done=!0,R}},$.values=ce,Ee.prototype={constructor:Ee,reset:function(y){if(this.prev=0,this.next=0,this.sent=this._sent=S,this.done=!1,this.delegate=null,this.method="next",this.arg=S,this.tryEntries.forEach(Pe),!y)for(var _ in this)_.charAt(0)==="t"&&_t.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=S)},stop:function(){this.done=!0;var y=this.tryEntries[0].completion;if(y.type==="throw")throw y.arg;return this.rval},dispatchException:function(y){if(this.done)throw y;var _=this;function I(gt,te){return K.type="throw",K.arg=y,_.next=gt,te&&(_.method="next",_.arg=S),!!te}for(var k=this.tryEntries.length-1;k>=0;--k){var R=this.tryEntries[k],K=R.completion;if(R.tryLoc==="root")return I("end");if(R.tryLoc<=this.prev){var ut=_t.call(R,"catchLoc"),St=_t.call(R,"finallyLoc");if(ut&&St){if(this.prev<R.catchLoc)return I(R.catchLoc,!0);if(this.prev<R.finallyLoc)return I(R.finallyLoc)}else if(ut){if(this.prev<R.catchLoc)return I(R.catchLoc,!0)}else{if(!St)throw Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return I(R.finallyLoc)}}}},abrupt:function(y,_){for(var I=this.tryEntries.length-1;I>=0;--I){var k=this.tryEntries[I];if(k.tryLoc<=this.prev&&_t.call(k,"finallyLoc")&&this.prev<k.finallyLoc){var R=k;break}}R&&(y==="break"||y==="continue")&&R.tryLoc<=_&&_<=R.finallyLoc&&(R=null);var K=R?R.completion:{};return K.type=y,K.arg=_,R?(this.method="next",this.next=R.finallyLoc,Lt):this.complete(K)},complete:function(y,_){if(y.type==="throw")throw y.arg;return y.type==="break"||y.type==="continue"?this.next=y.arg:y.type==="return"?(this.rval=this.arg=y.arg,this.method="return",this.next="end"):y.type==="normal"&&_&&(this.next=_),Lt},finish:function(y){for(var _=this.tryEntries.length-1;_>=0;--_){var I=this.tryEntries[_];if(I.finallyLoc===y)return this.complete(I.completion,I.afterLoc),Pe(I),Lt}},catch:function(y){for(var _=this.tryEntries.length-1;_>=0;--_){var I=this.tryEntries[_];if(I.tryLoc===y){var k=I.completion;if(k.type==="throw"){var R=k.arg;Pe(I)}return R}}throw Error("illegal catch attempt")},delegateYield:function(y,_,I){return this.delegate={iterator:ce(y),resultName:_,nextLoc:I},this.method==="next"&&(this.arg=S),Lt}},$}function wt(S,$,bt,_t,Tt,mt,Dt){try{var Rt=S[mt](Dt),vt=Rt.value}catch(ht){return void bt(ht)}Rt.done?$(vt):Promise.resolve(vt).then(_t,Tt)}function C(S){return U.apply(this,arguments)}function U(){var S;return S=X().mark((function $(bt){var _t,Tt,mt;return X().wrap((function(Dt){for(;;)switch(Dt.prev=Dt.next){case 0:return _t=bt.url,Tt=bt.channel,mt=bt.callback,Dt.next=3,J({url:_t,channel:Tt,callback:mt});case 3:case"end":return Dt.stop()}}),$)})),U=function(){var $=this,bt=arguments;return new Promise((function(_t,Tt){var mt=S.apply($,bt);function Dt(vt){wt(mt,_t,Tt,Dt,Rt,"next",vt)}function Rt(vt){wt(mt,_t,Tt,Dt,Rt,"throw",vt)}Dt(void 0)}))},U.apply(this,arguments)}var M={getJrCommand:C};(s=p.hmd(s)).exports&&(s.exports=M,s.exports.getJrCommand=C),typeof window!="undefined"&&(window.LyyGetCommandSDK=M);let Y=M},307:function(s,l,p){var h,D,P;function q(N){return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(G){return typeof G}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G},q(N)}P=function(){"use strict";function N(r){return(N=typeof Symbol=="function"&&q(Symbol.iterator)=="symbol"?function(a){return q(a)}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":q(a)})(r)}function G(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}function pt(r,a){for(var d=0;d<a.length;d++){var f=a[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(r,f.key,f)}}function T(r,a,d){return a&&pt(r.prototype,a),d&&pt(r,d),r}function J(r,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(a&&a.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),a&&st(r,a)}function ct(r){return(ct=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)})(r)}function st(r,a){return(st=Object.setPrototypeOf||function(d,f){return d.__proto__=f,d})(r,a)}function X(r){var a=(function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(d){return!1}})();return function(){var d,f=ct(r);return(function(A,g){if(g&&(q(g)=="object"||typeof g=="function"))return g;if(g!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(O){if(O===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O})(A)})(this,a?(d=ct(this).constructor,Reflect.construct(f,arguments,d)):f.apply(this,arguments))}}function wt(r){return(function(a){if(Array.isArray(a))return C(a)})(r)||(function(a){if(typeof Symbol!="undefined"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)})(r)||(function(a,d){if(a){if(typeof a=="string")return C(a,d);var f=Object.prototype.toString.call(a).slice(8,-1);return(f=f==="Object"&&a.constructor?a.constructor.name:f)==="Map"||f==="Set"?Array.from(a):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?C(a,d):void 0}})(r)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function C(r,a){(a==null||a>r.length)&&(a=r.length);for(var d=0,f=new Array(a);d<a;d++)f[d]=r[d];return f}var U=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:p.g!==void 0?p.g:typeof self!="undefined"?self:{},M=!1,Y=!1,S={console:!0,focus:!1,time:!1,length:!0,infinite:!1,time_interval:500,time_threshold:100,length_threshold:300},$=function(){typeof document!="undefined"&&document.hasFocus&&!document.hasFocus()&&(Y=!0)},bt=function(){var r=Date.now();Date.now()-r>S.time_threshold&&(Y=!0)},_t=function(){var r=U.outerWidth,a=U.outerHeight,d=U.innerWidth,f=U.innerHeight;r&&a&&d&&f&&typeof r=="number"&&typeof a=="number"&&typeof d=="number"&&typeof f=="number"&&(r-d>S.length_threshold||a-f>S.length_threshold)&&(Y=!0)};(Ut={}).start=function(r){if(!M){if(r&&N(r)==="object")for(var a in r)S[a]=r[a];var d;S.infinite&&(typeof window!="undefined"&&Object.prototype.toString.call(window)==="[object Window]"?typeof Function!="undefined"&&Function.constructor!==void 0&&/Function[^]*\[native code\]/.test(""+Function.constructor)&&typeof setInterval!="undefined"&&/setInterval[^]*\[native code\]/.test(""+setInterval)?new Function('setInterval(function(){!/Function[^]*[native code]/.test("" + Function.constructor) ? function(){while(1);}() : new Function("debugger")(); }, 100);')():Y=!0:setInterval((function(){}),100)),S.console&&(function(){var f=new Date;f.toString=function(){for(var A=Date.now();;)if(10<Date.now()-A)return Date.now()},console.log(f),f.toString=function(){return Y=!0,Date.now()}})(),S.focus&&$(),S.time&&bt(),S.length&&_t(),d=setInterval((function(){d&&Y&&clearInterval(d),S.focus&&$(),S.time&&bt(),S.length&&_t()}),S.time_interval),M=!0}},Ut.isDebug=function(){return Y};var Tt=Ut,mt=".123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-!",Dt={my_b4_encode:function(r){var a=0,d=(j=0)<r.length%3?3-r.length%3:0;for(a=0;a<d;a++)r[r.length]=0;var f="";for(j=0;j<r.length;j+=3)0<j&&j%57==0&&(f+=`
|
|
3
|
+
`),f+=mt[r[j]>>2]+mt[(3&r[j])<<4|r[j+1]>>4]+mt[(15&r[j+1])<<2|r[j+2]>>6]+mt[63&r[j+2]];for(a=0;a<d;a++)f+=mt[64];return f},my_b4_decode:function(r){var a=0,d=0,f=(r=r.replace(/[^A-Za-z0-9\+\-\!\.]/g,"")).length%4;if(2<f)return null;for(a=0;a<f;a++)if(r.charAt(r.length-a-1)!=mt[64])return null;var A,g,O,V,x=new Array(3*(r.length-f)/4);for(a=0,d=0;d<x.length;)A=mt.indexOf(r.charAt(a++)),g=mt.indexOf(r.charAt(a++)),O=mt.indexOf(r.charAt(a++)),V=mt.indexOf(r.charAt(a++)),x[d++]=A<<2|g>>4,x[d++]=(15&g)<<4|O>>2,x[d++]=(3&O)<<6|V;for(a=0;a<f;a++)if(x.pop()!=0)return null;return x}},Rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",vt={b4_encode:function(r){var a=0,d=(j=0)<r.length%3?3-r.length%3:0;for(a=0;a<d;a++)r[r.length]=0;var f="";for(a=0;j<r.length;j+=3)0<j&&j%57==0&&(f+=`
|
|
4
|
+
`),f+=Rt[r[j]>>2]+Rt[(3&r[j])<<4|r[j+1]>>4]+Rt[(15&r[j+1])<<2|r[j+2]>>6]+Rt[63&r[j+2]];for(a=0;a<d;a++)f+="=";return f},b4_decode:function(r){var a=0,d=0,f=(r=r.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length%4;if(2<f)return null;for(a=0;a<f;a++)if(r.charAt(r.length-a-1)!="=")return null;var A,g,O,V,x=new Array(3*(r.length-f)/4);for(a=0,d=0;d<x.length;)A=Rt.indexOf(r.charAt(a++)),g=Rt.indexOf(r.charAt(a++)),O=Rt.indexOf(r.charAt(a++)),V=Rt.indexOf(r.charAt(a++)),x[d++]=A<<2|g>>4,x[d++]=(15&g)<<4|O>>2,x[d++]=(3&O)<<6|V;for(a=0;a<f;a++)if(x.pop()!=0)return null;return x}};function ht(){}ht.encode=function(r,a,d){for(var f=new Array(2*d),A=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),g=a,O=0;g<d+a;g++,O++)f[O]=A[(255&r[g])>>4],f[++O]=A[15&r[g]];return f.join("")},ht.decode=function(r){if(r==null||r==""||r.length%2!=0)return null;for(var a=r.length/2,d=ht.toCharCodeArray(r),f=new Array(a),A=0;A<a;A++){if(48<=d[2*A]&&d[2*A]<=57)f[A]=d[2*A]-48<<4;else if(65<=d[2*A]&&d[2*A]<=70)f[A]=d[2*A]-65+10<<4;else{if(!(97<=d[2*A]&&d[2*A]<=102))return null;f[A]=d[2*A]-97+10<<4}if(48<=d[2*A+1]&&d[2*A+1]<=57)f[A]=f[A]|d[2*A+1]-48;else if(65<=d[2*A+1]&&d[2*A+1]<=70)f[A]=f[A]|d[2*A+1]-65+10;else{if(!(97<=d[2*A+1]&&d[2*A+1]<=102))return null;f[A]=f[A]|d[2*A+1]-97+10}}return f},ht.toCharCodeArray=function(r){for(var a=new Array(r.length),d=0;d<r.length;d++)a[d]=r.charCodeAt(d);return a};var zt=ht,$t=zt;(Mt=function(){}).utf8StrToh6=function(r){r=encodeURIComponent(r);for(var a=unescape(r),d=a.length,f=[],A=0;A<d;A++)f[A]=a.charCodeAt(A).toString(16);return f.join("")},Mt.utf8StrToBytes=function(r){r=encodeURIComponent(r);for(var a=unescape(r),d=a.length,f=[],A=0;A<d;A++)f[A]=a.charCodeAt(A);return f},Mt.hexToUtf8Str=function(r){for(var a=$t.decode(r),d=[],f=0;f<a.length;f++)d.push(String.fromCharCode(a[f]));return decodeURIComponent(escape(d.join("")))},Mt.bytesToUtf8Str=function(r){for(var a=r,d=[],f=0;f<a.length;f++)d.push(String.fromCharCode(a[f]));return decodeURIComponent(escape(d.join("")))},Mt.intToByte=function(r){return new Array(r>>24&255,r>>16&255,r>>8&255,255&r)},Mt.byteToInt=function(r,a){return a+3<r.length?r[a]<<24|r[a+1]<<16|r[a+2]<<8|r[a+3]:a+2<r.length?r[a+1]<<16|r[a+2]<<8|r[a+3]:a+1<r.length?r[a]<<8|r[a+1]:r[a]};var Qt,ie=Mt,Zt={exports:{}};Qt=Zt,function(){function r(i,u,c){i!=null&&(typeof i=="number"?this.fromNumber(i,u,c):u==null&&typeof i!="string"?this.fromString(i,256):this.fromString(i,u))}function a(){return new r(null)}var d=(d=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(r.prototype.am=function(i,u,c,m,b,B){for(var W=32767&u,H=u>>15;0<=--B;){var Yt=32767&this[i],ne=this[i++]>>15,ge=H*Yt+ne*W;b=((Yt=W*Yt+((32767&ge)<<15)+c[m]+(1073741823&b))>>>30)+(ge>>>15)+H*ne+(b>>>30),c[m++]=1073741823&Yt}return b},30):d&&navigator.appName!="Netscape"?(r.prototype.am=function(i,u,c,m,b,B){for(;0<=--B;){var W=u*this[i++]+c[m]+b;b=Math.floor(W/67108864),c[m++]=67108863&W}return b},26):(r.prototype.am=function(i,u,c,m,b,B){for(var W=16383&u,H=u>>14;0<=--B;){var Yt=16383&this[i],ne=this[i++]>>14,ge=H*Yt+ne*W;b=((Yt=W*Yt+((16383&ge)<<14)+c[m]+b)>>28)+(ge>>14)+H*ne,c[m++]=268435455&Yt}return b},28);r.prototype.DB=d,r.prototype.DM=(1<<d)-1,r.prototype.DV=1<<d,r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-d,r.prototype.F2=2*d-52;for(var f=new Array,A=48,g=0;g<=9;++g)f[A++]=g;for(A=97,g=10;g<36;++g)f[A++]=g;for(A=65,g=10;g<36;++g)f[A++]=g;function O(i){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(i)}function V(i,u){return(i=f[i.charCodeAt(u)])==null?-1:i}function x(i){var u=a();return u.fromInt(i),u}function lt(i){var u,c=1;return(u=i>>>16)!=0&&(i=u,c+=16),(u=i>>8)!=0&&(i=u,c+=8),(u=i>>4)!=0&&(i=u,c+=4),(u=i>>2)!=0&&(i=u,c+=2),(u=i>>1)!=0&&(i=u,c+=1),c}function dt(i){this.m=i}function L(i){this.m=i,this.mp=i.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<i.DB-15)-1,this.mt2=2*i.t}function Z(i,u){return i&u}function it(i,u){return i|u}function rt(i,u){return i^u}function ft(i,u){return i&~u}function At(){}function Ft(i){return i}function Q(i){this.r2=a(),this.q3=a(),r.ONE.dlShiftTo(2*i.t,this.r2),this.mu=this.r2.divide(i),this.m=i}dt.prototype.convert=function(i){return i.s<0||0<=i.compareTo(this.m)?i.mod(this.m):i},dt.prototype.revert=function(i){return i},dt.prototype.reduce=function(i){i.divRemTo(this.m,null,i)},dt.prototype.mulTo=function(i,u,c){i.multiplyTo(u,c),this.reduce(c)},dt.prototype.sqrTo=function(i,u){i.squareTo(u),this.reduce(u)},L.prototype.convert=function(i){var u=a();return i.abs().dlShiftTo(this.m.t,u),u.divRemTo(this.m,null,u),i.s<0&&0<u.compareTo(r.ZERO)&&this.m.subTo(u,u),u},L.prototype.revert=function(i){var u=a();return i.copyTo(u),this.reduce(u),u},L.prototype.reduce=function(i){for(;i.t<=this.mt2;)i[i.t++]=0;for(var u=0;u<this.m.t;++u){var c=32767&i[u],m=c*this.mpl+((c*this.mph+(i[u]>>15)*this.mpl&this.um)<<15)&i.DM;for(i[c=u+this.m.t]+=this.m.am(0,m,i,u,0,this.m.t);i[c]>=i.DV;)i[c]-=i.DV,i[++c]++}i.clamp(),i.drShiftTo(this.m.t,i),0<=i.compareTo(this.m)&&i.subTo(this.m,i)},L.prototype.mulTo=function(i,u,c){i.multiplyTo(u,c),this.reduce(c)},L.prototype.sqrTo=function(i,u){i.squareTo(u),this.reduce(u)},r.prototype.copyTo=function(i){for(var u=this.t-1;0<=u;--u)i[u]=this[u];i.t=this.t,i.s=this.s},r.prototype.fromInt=function(i){this.t=1,this.s=i<0?-1:0,0<i?this[0]=i:i<-1?this[0]=i+this.DV:this.t=0},r.prototype.fromString=function(i,u){var c;if(u==16)c=4;else if(u==8)c=3;else if(u==256)c=8;else if(u==2)c=1;else if(u==32)c=5;else{if(u!=4)return void this.fromRadix(i,u);c=2}this.t=0,this.s=0;for(var m=i.length,b=!1,B=0;0<=--m;){var W=c==8?255&i[m]:V(i,m);W<0?i.charAt(m)=="-"&&(b=!0):(b=!1,B==0?this[this.t++]=W:B+c>this.DB?(this[this.t-1]|=(W&(1<<this.DB-B)-1)<<B,this[this.t++]=W>>this.DB-B):this[this.t-1]|=W<<B,(B+=c)>=this.DB&&(B-=this.DB))}c==8&&128&i[0]&&(this.s=-1,0<B&&(this[this.t-1]|=(1<<this.DB-B)-1<<B)),this.clamp(),b&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var i=this.s&this.DM;0<this.t&&this[this.t-1]==i;)--this.t},r.prototype.dlShiftTo=function(i,u){for(var c=this.t-1;0<=c;--c)u[c+i]=this[c];for(c=i-1;0<=c;--c)u[c]=0;u.t=this.t+i,u.s=this.s},r.prototype.drShiftTo=function(i,u){for(var c=i;c<this.t;++c)u[c-i]=this[c];u.t=Math.max(this.t-i,0),u.s=this.s},r.prototype.lShiftTo=function(i,u){for(var c=i%this.DB,m=this.DB-c,b=(1<<m)-1,B=Math.floor(i/this.DB),W=this.s<<c&this.DM,H=this.t-1;0<=H;--H)u[H+B+1]=this[H]>>m|W,W=(this[H]&b)<<c;for(H=B-1;0<=H;--H)u[H]=0;u[B]=W,u.t=this.t+B+1,u.s=this.s,u.clamp()},r.prototype.rShiftTo=function(i,u){u.s=this.s;var c=Math.floor(i/this.DB);if(c>=this.t)u.t=0;else{var m=i%this.DB,b=this.DB-m,B=(1<<m)-1;u[0]=this[c]>>m;for(var W=c+1;W<this.t;++W)u[W-c-1]|=(this[W]&B)<<b,u[W-c]=this[W]>>m;0<m&&(u[this.t-c-1]|=(this.s&B)<<b),u.t=this.t-c,u.clamp()}},r.prototype.subTo=function(i,u){for(var c=0,m=0,b=Math.min(i.t,this.t);c<b;)m+=this[c]-i[c],u[c++]=m&this.DM,m>>=this.DB;if(i.t<this.t){for(m-=i.s;c<this.t;)m+=this[c],u[c++]=m&this.DM,m>>=this.DB;m+=this.s}else{for(m+=this.s;c<i.t;)m-=i[c],u[c++]=m&this.DM,m>>=this.DB;m-=i.s}u.s=m<0?-1:0,m<-1?u[c++]=this.DV+m:0<m&&(u[c++]=m),u.t=c,u.clamp()},r.prototype.multiplyTo=function(i,u){var c=this.abs(),m=i.abs(),b=c.t;for(u.t=b+m.t;0<=--b;)u[b]=0;for(b=0;b<m.t;++b)u[b+c.t]=c.am(0,m[b],u,b,0,c.t);u.s=0,u.clamp(),this.s!=i.s&&r.ZERO.subTo(u,u)},r.prototype.squareTo=function(i){for(var u=this.abs(),c=i.t=2*u.t;0<=--c;)i[c]=0;for(c=0;c<u.t-1;++c){var m=u.am(c,u[c],i,2*c,0,1);(i[c+u.t]+=u.am(c+1,2*u[c],i,2*c+1,m,u.t-c-1))>=u.DV&&(i[c+u.t]-=u.DV,i[c+u.t+1]=1)}0<i.t&&(i[i.t-1]+=u.am(c,u[c],i,2*c,0,1)),i.s=0,i.clamp()},r.prototype.divRemTo=function(i,u,c){var m=i.abs();if(!(m.t<=0)){if((ne=this.abs()).t<m.t)return u!=null&&u.fromInt(0),void(c!=null&&this.copyTo(c));c==null&&(c=a());var b=a(),B=this.s,W=i.s;0<(i=this.DB-lt(m[m.t-1]))?(m.lShiftTo(i,b),ne.lShiftTo(i,c)):(m.copyTo(b),ne.copyTo(c));var H=b.t,Yt=b[H-1];if(Yt!=0){var ne=Yt*(1<<this.F1)+(1<H?b[H-2]>>this.F2:0),ge=this.FV/ne,Se=(1<<this.F1)/ne,je=1<<this.F2,jt=c.t,Ce=jt-H,Ht=u==null?a():u;for(b.dlShiftTo(Ce,Ht),0<=c.compareTo(Ht)&&(c[c.t++]=1,c.subTo(Ht,c)),r.ONE.dlShiftTo(H,Ht),Ht.subTo(b,b);b.t<H;)b[b.t++]=0;for(;0<=--Ce;){var Mn=c[--jt]==Yt?this.DM:Math.floor(c[jt]*ge+(c[jt-1]+je)*Se);if((c[jt]+=b.am(0,Mn,c,Ce,0,H))<Mn)for(b.dlShiftTo(Ce,Ht),c.subTo(Ht,c);c[jt]<--Mn;)c.subTo(Ht,c)}u!=null&&(c.drShiftTo(H,u),B!=W&&r.ZERO.subTo(u,u)),c.t=H,c.clamp(),0<i&&c.rShiftTo(i,c),B<0&&r.ZERO.subTo(c,c)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var i=this[0];if(!(1&i))return 0;var u=3&i;return 0<(u=(u=(u=(u=u*(2-(15&i)*u)&15)*(2-(255&i)*u)&255)*(2-((65535&i)*u&65535))&65535)*(2-i*u%this.DV)%this.DV)?this.DV-u:-u},r.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},r.prototype.exp=function(i,u){if(4294967295<i||i<1)return r.ONE;var c,m=a(),b=a(),B=u.convert(this),W=lt(i)-1;for(B.copyTo(m);0<=--W;)u.sqrTo(m,b),0<(i&1<<W)?u.mulTo(b,B,m):(c=m,m=b,b=c);return u.revert(m)},r.prototype.toString=function(i){if(this.s<0)return"-"+this.negate().toString(i);var u;if(i==16)u=4;else if(i==8)u=3;else if(i==2)u=1;else if(i==32)u=5;else{if(i!=4)return this.toRadix(i);u=2}var c,m=(1<<u)-1,b=!1,B="",W=this.t,H=this.DB-W*this.DB%u;if(0<W--)for(H<this.DB&&0<(c=this[W]>>H)&&(b=!0,B=O(c));0<=W;)H<u?(c=(this[W]&(1<<H)-1)<<u-H,c|=this[--W]>>(H+=this.DB-u)):(c=this[W]>>(H-=u)&m,H<=0&&(H+=this.DB,--W)),(b=0<c||b)&&(B+=O(c));return b?B:"0"},r.prototype.negate=function(){var i=a();return r.ZERO.subTo(this,i),i},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(i){var u=this.s-i.s;if(u!=0)return u;var c=this.t;if((u=c-i.t)!=0)return this.s<0?-u:u;for(;0<=--c;)if((u=this[c]-i[c])!=0)return u;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+lt(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(i){var u=a();return this.abs().divRemTo(i,null,u),this.s<0&&0<u.compareTo(r.ZERO)&&i.subTo(u,u),u},r.prototype.modPowInt=function(i,u){return u=new(i<256||u.isEven()?dt:L)(u),this.exp(i,u)},r.ZERO=x(0),r.ONE=x(1),At.prototype.convert=Ft,At.prototype.revert=Ft,At.prototype.mulTo=function(i,u,c){i.multiplyTo(u,c)},At.prototype.sqrTo=function(i,u){i.squareTo(u)},Q.prototype.convert=function(i){if(i.s<0||i.t>2*this.m.t)return i.mod(this.m);if(i.compareTo(this.m)<0)return i;var u=a();return i.copyTo(u),this.reduce(u),u},Q.prototype.revert=function(i){return i},Q.prototype.reduce=function(i){for(i.drShiftTo(this.m.t-1,this.r2),i.t>this.m.t+1&&(i.t=this.m.t+1,i.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);i.compareTo(this.r2)<0;)i.dAddOffset(1,this.m.t+1);for(i.subTo(this.r2,i);0<=i.compareTo(this.m);)i.subTo(this.m,i)},Q.prototype.mulTo=function(i,u,c){i.multiplyTo(u,c),this.reduce(c)},Q.prototype.sqrTo=function(i,u){i.squareTo(u),this.reduce(u)};var et,z=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],tt=(1<<26)/z[z.length-1];function nt(){var i;i=new Date().getTime(),Pt[ot++]^=255&i,Pt[ot++]^=i>>8&255,Pt[ot++]^=i>>16&255,Pt[ot++]^=i>>24&255,Vn<=ot&&(ot-=Vn)}if(r.prototype.chunkSize=function(i){return Math.floor(Math.LN2*this.DB/Math.log(i))},r.prototype.toRadix=function(i){if(i==null&&(i=10),this.signum()==0||i<2||36<i)return"0";var u=this.chunkSize(i),c=Math.pow(i,u),m=x(c),b=a(),B=a(),W="";for(this.divRemTo(m,b,B);0<b.signum();)W=(c+B.intValue()).toString(i).substr(1)+W,b.divRemTo(m,b,B);return B.intValue().toString(i)+W},r.prototype.fromRadix=function(i,u){this.fromInt(0);for(var c=this.chunkSize(u=u==null?10:u),m=Math.pow(u,c),b=!1,B=0,W=0,H=0;H<i.length;++H){var Yt=V(i,H);Yt<0?i.charAt(H)=="-"&&this.signum()==0&&(b=!0):(W=u*W+Yt,++B>=c&&(this.dMultiply(m),this.dAddOffset(W,0),W=B=0))}0<B&&(this.dMultiply(Math.pow(u,B)),this.dAddOffset(W,0)),b&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(i,u,c){if(typeof u=="number")if(i<2)this.fromInt(1);else for(this.fromNumber(i,c),this.testBit(i-1)||this.bitwiseTo(r.ONE.shiftLeft(i-1),it,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(u);)this.dAddOffset(2,0),this.bitLength()>i&&this.subTo(r.ONE.shiftLeft(i-1),this);else{var m=new Array;c=7&i,m.length=1+(i>>3),u.nextBytes(m),0<c?m[0]&=(1<<c)-1:m[0]=0,this.fromString(m,256)}},r.prototype.bitwiseTo=function(i,u,c){for(var m,b=Math.min(i.t,this.t),B=0;B<b;++B)c[B]=u(this[B],i[B]);if(i.t<this.t){for(m=i.s&this.DM,B=b;B<this.t;++B)c[B]=u(this[B],m);c.t=this.t}else{for(m=this.s&this.DM,B=b;B<i.t;++B)c[B]=u(m,i[B]);c.t=i.t}c.s=u(this.s,i.s),c.clamp()},r.prototype.changeBit=function(i,u){return i=r.ONE.shiftLeft(i),this.bitwiseTo(i,u,i),i},r.prototype.addTo=function(i,u){for(var c=0,m=0,b=Math.min(i.t,this.t);c<b;)m+=this[c]+i[c],u[c++]=m&this.DM,m>>=this.DB;if(i.t<this.t){for(m+=i.s;c<this.t;)m+=this[c],u[c++]=m&this.DM,m>>=this.DB;m+=this.s}else{for(m+=this.s;c<i.t;)m+=i[c],u[c++]=m&this.DM,m>>=this.DB;m+=i.s}u.s=m<0?-1:0,0<m?u[c++]=m:m<-1&&(u[c++]=this.DV+m),u.t=c,u.clamp()},r.prototype.dMultiply=function(i){this[this.t]=this.am(0,i-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(i,u){if(i!=0){for(;this.t<=u;)this[this.t++]=0;for(this[u]+=i;this[u]>=this.DV;)this[u]-=this.DV,++u>=this.t&&(this[this.t++]=0),++this[u]}},r.prototype.multiplyLowerTo=function(i,u,c){var m,b=Math.min(this.t+i.t,u);for(c.s=0,c.t=b;0<b;)c[--b]=0;for(m=c.t-this.t;b<m;++b)c[b+this.t]=this.am(0,i[b],c,b,0,this.t);for(m=Math.min(i.t,u);b<m;++b)this.am(0,i[b],c,b,0,u-b);c.clamp()},r.prototype.multiplyUpperTo=function(i,u,c){var m=c.t=this.t+i.t- --u;for(c.s=0;0<=--m;)c[m]=0;for(m=Math.max(u-this.t,0);m<i.t;++m)c[this.t+m-u]=this.am(u-m,i[m],c,0,0,this.t+m-u);c.clamp(),c.drShiftTo(1,c)},r.prototype.modInt=function(i){if(i<=0)return 0;var u=this.DV%i,c=this.s<0?i-1:0;if(0<this.t)if(u==0)c=this[0]%i;else for(var m=this.t-1;0<=m;--m)c=(u*c+this[m])%i;return c},r.prototype.millerRabin=function(i){var u=this.subtract(r.ONE),c=u.getLowestSetBit();if(c<=0)return!1;var m=u.shiftRight(c);z.length<(i=i+1>>1)&&(i=z.length);for(var b=a(),B=0;B<i;++B){b.fromInt(z[Math.floor(Math.random()*z.length)]);var W=b.modPow(m,this);if(W.compareTo(r.ONE)!=0&&W.compareTo(u)!=0){for(var H=1;H++<c&&W.compareTo(u)!=0;)if((W=W.modPowInt(2,this)).compareTo(r.ONE)==0)return!1;if(W.compareTo(u)!=0)return!1}}return!0},r.prototype.clone=function(){var i=a();return this.copyTo(i),i},r.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var i=this.t,u=new Array;u[0]=this.s;var c,m=this.DB-i*this.DB%8,b=0;if(0<i--)for(m<this.DB&&(c=this[i]>>m)!=(this.s&this.DM)>>m&&(u[b++]=c|this.s<<this.DB-m);0<=i;)m<8?(c=(this[i]&(1<<m)-1)<<8-m,c|=this[--i]>>(m+=this.DB-8)):(c=this[i]>>(m-=8)&255,m<=0&&(m+=this.DB,--i)),128&c&&(c|=-256),b==0&&(128&this.s)!=(128&c)&&++b,(0<b||c!=this.s)&&(u[b++]=c);return u},r.prototype.equals=function(i){return this.compareTo(i)==0},r.prototype.min=function(i){return this.compareTo(i)<0?this:i},r.prototype.max=function(i){return 0<this.compareTo(i)?this:i},r.prototype.and=function(i){var u=a();return this.bitwiseTo(i,Z,u),u},r.prototype.or=function(i){var u=a();return this.bitwiseTo(i,it,u),u},r.prototype.xor=function(i){var u=a();return this.bitwiseTo(i,rt,u),u},r.prototype.andNot=function(i){var u=a();return this.bitwiseTo(i,ft,u),u},r.prototype.not=function(){for(var i=a(),u=0;u<this.t;++u)i[u]=this.DM&~this[u];return i.t=this.t,i.s=~this.s,i},r.prototype.shiftLeft=function(i){var u=a();return i<0?this.rShiftTo(-i,u):this.lShiftTo(i,u),u},r.prototype.shiftRight=function(i){var u=a();return i<0?this.lShiftTo(-i,u):this.rShiftTo(i,u),u},r.prototype.getLowestSetBit=function(){for(var i=0;i<this.t;++i)if(this[i]!=0)return i*this.DB+(function(u){if(u==0)return-1;var c=0;return!(65535&u)&&(u>>=16,c+=16),!(255&u)&&(u>>=8,c+=8),!(15&u)&&(u>>=4,c+=4),!(3&u)&&(u>>=2,c+=2),!(1&u)&&++c,c})(this[i]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var i=0,u=this.s&this.DM,c=0;c<this.t;++c)i+=(function(m){for(var b=0;m!=0;)m&=m-1,++b;return b})(this[c]^u);return i},r.prototype.testBit=function(i){var u=Math.floor(i/this.DB);return u>=this.t?this.s!=0:!!(this[u]&1<<i%this.DB)},r.prototype.setBit=function(i){return this.changeBit(i,it)},r.prototype.clearBit=function(i){return this.changeBit(i,ft)},r.prototype.flipBit=function(i){return this.changeBit(i,rt)},r.prototype.add=function(i){var u=a();return this.addTo(i,u),u},r.prototype.subtract=function(i){var u=a();return this.subTo(i,u),u},r.prototype.multiply=function(i){var u=a();return this.multiplyTo(i,u),u},r.prototype.divide=function(i){var u=a();return this.divRemTo(i,u,null),u},r.prototype.remainder=function(i){var u=a();return this.divRemTo(i,null,u),u},r.prototype.divideAndRemainder=function(i){var u=a(),c=a();return this.divRemTo(i,u,c),new Array(u,c)},r.prototype.modPow=function(i,u){var c=i.bitLength(),m=x(1);if(c<=0)return m;var b=c<18?1:c<48?3:c<144?4:c<768?5:6,B=new(c<8?dt:u.isEven()?Q:L)(u),W=new Array,H=3,Yt=b-1,ne=(1<<b)-1;if(W[1]=B.convert(this),1<b){var ge=a();for(B.sqrTo(W[1],ge);H<=ne;)W[H]=a(),B.mulTo(ge,W[H-2],W[H]),H+=2}var Se,je,jt=i.t-1,Ce=!0,Ht=a();for(c=lt(i[jt])-1;0<=jt;){for(Yt<=c?Se=i[jt]>>c-Yt&ne:(Se=(i[jt]&(1<<c+1)-1)<<Yt-c,0<jt&&(Se|=i[jt-1]>>this.DB+c-Yt)),H=b;!(1&Se);)Se>>=1,--H;if((c-=H)<0&&(c+=this.DB,--jt),Ce)W[Se].copyTo(m),Ce=!1;else{for(;1<H;)B.sqrTo(m,Ht),B.sqrTo(Ht,m),H-=2;0<H?B.sqrTo(m,Ht):(je=m,m=Ht,Ht=je),B.mulTo(Ht,W[Se],m)}for(;0<=jt&&!(i[jt]&1<<c);)B.sqrTo(m,Ht),je=m,m=Ht,Ht=je,--c<0&&(c=this.DB-1,--jt)}return B.revert(m)},r.prototype.modInverse=function(i){var u=i.isEven();if(this.isEven()&&u||i.signum()==0)return r.ZERO;for(var c=i.clone(),m=this.clone(),b=x(1),B=x(0),W=x(0),H=x(1);c.signum()!=0;){for(;c.isEven();)c.rShiftTo(1,c),u?(b.isEven()&&B.isEven()||(b.addTo(this,b),B.subTo(i,B)),b.rShiftTo(1,b)):B.isEven()||B.subTo(i,B),B.rShiftTo(1,B);for(;m.isEven();)m.rShiftTo(1,m),u?(W.isEven()&&H.isEven()||(W.addTo(this,W),H.subTo(i,H)),W.rShiftTo(1,W)):H.isEven()||H.subTo(i,H),H.rShiftTo(1,H);0<=c.compareTo(m)?(c.subTo(m,c),u&&b.subTo(W,b),B.subTo(H,B)):(m.subTo(c,m),u&&W.subTo(b,W),H.subTo(B,H))}return m.compareTo(r.ONE)!=0?r.ZERO:0<=H.compareTo(i)?H.subtract(i):H.signum()<0?(H.addTo(i,H),H.signum()<0?H.add(i):H):H},r.prototype.pow=function(i){return this.exp(i,new At)},r.prototype.gcd=function(i){var u=this.s<0?this.negate():this.clone(),c=i.s<0?i.negate():i.clone();u.compareTo(c)<0&&(b=u,u=c,c=b);var m=u.getLowestSetBit(),b=c.getLowestSetBit();if(b<0)return u;for(0<(b=m<b?m:b)&&(u.rShiftTo(b,u),c.rShiftTo(b,c));0<u.signum();)0<(m=u.getLowestSetBit())&&u.rShiftTo(m,u),0<(m=c.getLowestSetBit())&&c.rShiftTo(m,c),0<=u.compareTo(c)?(u.subTo(c,u),u.rShiftTo(1,u)):(c.subTo(u,c),c.rShiftTo(1,c));return 0<b&&c.lShiftTo(b,c),c},r.prototype.isProbablePrime=function(i){var u,c=this.abs();if(c.t==1&&c[0]<=z[z.length-1]){for(u=0;u<z.length;++u)if(c[0]==z[u])return!0;return!1}if(c.isEven())return!1;for(u=1;u<z.length;){for(var m=z[u],b=u+1;b<z.length&&m<tt;)m*=z[b++];for(m=c.modInt(m);u<b;)if(m%z[u++]==0)return!1}return c.millerRabin(i)},r.prototype.square=function(){var i=a();return this.squareTo(i),i},r.prototype.Barrett=Q,Pt==null){var Pt=new Array,ot=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var Ot=new Uint8Array(32);for(window.crypto.getRandomValues(Ot),kt=0;kt<32;++kt)Pt[ot++]=Ot[kt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var xt=window.crypto.random(32),kt=0;kt<xt.length;++kt)Pt[ot++]=255&xt.charCodeAt(kt)}for(;ot<Vn;)kt=Math.floor(65536*Math.random()),Pt[ot++]=kt>>>8,Pt[ot++]=255&kt;ot=0,nt()}function xn(){if(et==null){for(nt(),(et=new Yn).init(Pt),ot=0;ot<Pt.length;++ot)Pt[ot]=0;ot=0}return et.next()}function Fr(){}function Yn(){this.i=0,this.j=0,this.S=new Array}Fr.prototype.nextBytes=function(i){for(var u=0;u<i.length;++u)i[u]=xn()},Yn.prototype.init=function(i){for(var u,c,m=0;m<256;++m)this.S[m]=m;for(m=u=0;m<256;++m)u=u+this.S[m]+i[m%i.length]&255,c=this.S[m],this.S[m]=this.S[u],this.S[u]=c;this.i=0,this.j=0},Yn.prototype.next=function(){var i;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,i=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=i,this.S[i+this.S[this.i]&255]};var Vn=256;Qt.exports={default:r,BigInteger:r,SecureRandom:Fr}}.call(U);var w=Zt.exports.BigInteger,Lt=(function(){function r(){G(this,r),this.tlv=null,this.t="00",this.l="00",this.v=""}return T(r,[{key:"getEncodedHex",value:function(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}},{key:"getLength",value:function(){var a=this.v.length/2,d=a.toString(16);return d.length%2==1&&(d="0"+d),a<128?d:(128+d.length/2).toString(16)+d}},{key:"getValue",value:function(){return""}}]),r})(),Ae=(function(){J(a,Lt);var r=X(a);function a(d){var f;return G(this,a),(f=r.call(this)).t="02",d&&(f.v=(function(A){if((g=A.toString(16))[0]!=="-")g.length%2==1?g="0"+g:g.match(/^[0-7]/)||(g="00"+g);else{var g,O=(g=g.substr(1)).length;O%2==1?O+=1:g.match(/^[0-7]/)||(O+=2);for(var V="",x=0;x<O;x++)V+="f";g=(g=(V=new w(V,16)).xor(A).add(w.ONE)).toString(16).replace(/^-/,"")}return g})(d)),f}return T(a,[{key:"getValue",value:function(){return this.v}}]),a})(),_e=(function(){J(a,Lt);var r=X(a);function a(d){var f;return G(this,a),(f=r.call(this)).t="30",f.asn1Array=d,f}return T(a,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(d){return d.getEncodedHex()})).join(""),this.v}}]),a})();function qt(r,a){return+r[a+2]<8?1:128&+r.substr(a+2,2)}function he(r,a){var d=qt(r,a);return(r=r.substr(a+2,2*d))?(+r[0]<8?new w(r,16):new w(r.substr(2),16)).intValue():-1}function me(r,a){return a+2*(qt(r,a)+1)}var Vt=Zt.exports.BigInteger,Wt=new Vt("3"),Ne=(function(){function r(a,d){G(this,r),this.x=d,this.q=a}return T(r,[{key:"equals",value:function(a){return a===this||this.q.equals(a.q)&&this.x.equals(a.x)}},{key:"toBigInteger",value:function(){return this.x}},{key:"negate",value:function(){return new r(this.q,this.x.negate().mod(this.q))}},{key:"add",value:function(a){return new r(this.q,this.x.add(a.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(a){return new r(this.q,this.x.subtract(a.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(a){return new r(this.q,this.x.multiply(a.toBigInteger()).mod(this.q))}},{key:"divide",value:function(a){return new r(this.q,this.x.multiply(a.toBigInteger().modInverse(this.q)).mod(this.q))}},{key:"square",value:function(){return new r(this.q,this.x.square().mod(this.q))}}]),r})(),oe=(function(){function r(a,d,f,A){G(this,r),this.curve=a,this.x=d,this.y=f,this.z=A==null?Vt.ONE:A,this.zinv=null}return T(r,[{key:"getX",value:function(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"getY",value:function(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"equals",value:function(a){return a===this||(this.isInfinity()?a.isInfinity():a.isInfinity()?this.isInfinity():!!a.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(a.z)).mod(this.curve.q).equals(Vt.ZERO)&&a.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(a.z)).mod(this.curve.q).equals(Vt.ZERO))}},{key:"isInfinity",value:function(){return this.x===null&&this.y===null||this.z.equals(Vt.ZERO)&&!this.y.toBigInteger().equals(Vt.ZERO)}},{key:"negate",value:function(){return new r(this.curve,this.x,this.y.negate(),this.z)}},{key:"add",value:function(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var d=this.x.toBigInteger(),f=this.y.toBigInteger(),A=this.z,g=a.x.toBigInteger(),O=a.y.toBigInteger(),V=a.z,x=this.curve.q,lt=d.multiply(V).mod(x);return a=g.multiply(A).mod(x),d=lt.subtract(a),g=f.multiply(V).mod(x),f=O.multiply(A).mod(x),O=g.subtract(f),Vt.ZERO.equals(d)?Vt.ZERO.equals(O)?this.twice():this.curve.infinity:(f=lt.add(a),a=A.multiply(V).mod(x),V=d.square().mod(x),A=d.multiply(V).mod(x),f=a.multiply(O.square()).subtract(f.multiply(V)).mod(x),d=d.multiply(f).mod(x),g=O.multiply(V.multiply(lt).subtract(f)).subtract(g.multiply(A)).mod(x),x=A.multiply(a).mod(x),new r(this.curve,this.curve.fromBigInteger(d),this.curve.fromBigInteger(g),x))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var a=this.x.toBigInteger(),d=this.y.toBigInteger(),f=this.z,A=this.curve.q,g=this.curve.a.toBigInteger(),O=a.square().multiply(Wt).add(g.multiply(f.square())).mod(A),V=d.shiftLeft(1).multiply(f).mod(A),x=(g=(x=d.square().mod(A)).multiply(a).multiply(f).mod(A),d=V.square().mod(A),a=O.square().subtract(g.shiftLeft(3)).mod(A),f=V.multiply(a).mod(A),O.multiply(g.shiftLeft(2).subtract(a)).subtract(d.shiftLeft(1).multiply(x)).mod(A));return A=V.multiply(d).mod(A),new r(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(x),A)}},{key:"multiply",value:function(a){if(this.isInfinity())return this;if(!a.signum())return this.curve.infinity;for(var d=a.multiply(Wt),f=this.negate(),A=this,g=d.bitLength()-2;0<g;g--){A=A.twice();var O=d.testBit(g);O!==a.testBit(g)&&(A=A.add(O?this:f))}return A}}]),r})(),Ut=(function(){function r(a,d,f){G(this,r),this.q=a,this.a=this.fromBigInteger(d),this.b=this.fromBigInteger(f),this.infinity=new oe(this,null,null)}return T(r,[{key:"equals",value:function(a){return a===this||this.q.equals(a.q)&&this.a.equals(a.a)&&this.b.equals(a.b)}},{key:"fromBigInteger",value:function(a){return new Ne(this.q,a)}},{key:"decodePointHex",value:function(a){switch(parseInt(a.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var d=(a.length-2)/2,f=a.substr(2,d);return d=a.substr(2+d,d),new oe(this,this.fromBigInteger(new Vt(f,16)),this.fromBigInteger(new Vt(d,16)))}}}]),r})(),Mt={ECPointFp:oe,ECCurveFp:Ut},se=Zt.exports.BigInteger,Pe=(Ut=Zt.exports.SecureRandom,Mt.ECCurveFp),Ee=new Ut,ce=(Mt=I()).curve,y=Mt.G,_=Mt.n;function I(){var r=new se("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),a=new se("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),d=new se("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return d=(a=new Pe(r,a,d)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:a,G:d,n:new se("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function k(r,a){return r.length>=a?r:new Array(a-r.length+1).join("0")+r}function R(r,a){for(var d=[],f=~~(a/8),A=a%8,g=0,O=r.length;g<O;g++)d[g]=(r[(g+f)%O]<<A&255)+(r[(g+f+1)%O]>>>8-A&255);return d}function K(r,a){for(var d=[],f=r.length-1;0<=f;f--)d[f]=255&(r[f]^a[f]);return d}function ut(r,a){for(var d=[],f=r.length-1;0<=f;f--)d[f]=r[f]&a[f]&255;return d}function St(r,a){for(var d=[],f=r.length-1;0<=f;f--)d[f]=255&(r[f]|a[f]);return d}function gt(r,a){for(var d=[],f=0,A=r.length-1;0<=A;A--){var g=r[A]+a[A]+f;f=255<g?1:0,d[A]=255&g}return d}function te(r,a,d,f){return 0<=f&&f<=15?K(K(r,a),d):St(ut(r,a),ut((function(A){for(var g=[],O=A.length-1;0<=O;O--)g[O]=255&~A[O];return g})(r),d))}function ae(r,a){for(var d=[],f=[],A=0;A<16;A++){var g=4*A;d.push(a.slice(g,4+g))}for(var O,V=16;V<68;V++)d.push(K(K((O=K(K(d[V-16],d[V-9]),R(d[V-3],15)),K(K(O,R(O,15)),R(O,23))),R(d[V-13],7)),d[V-6]));for(var x=0;x<64;x++)f.push(K(d[x],d[x+4]));for(var lt,dt,L,Z=[121,204,69,25],it=[122,135,157,138],rt=r.slice(0,4),ft=r.slice(4,8),At=r.slice(8,12),Ft=r.slice(12,16),Q=r.slice(16,20),et=r.slice(20,24),z=r.slice(24,28),tt=r.slice(28,32),nt=0;nt<64;nt++){var Pt=0<=nt&&nt<=15?Z:it,ot=K(Ot=R(gt(gt(R(rt,12),Q),R(Pt,nt)),7),R(rt,12)),Ot=(ot=gt(gt(gt((lt=rt,dt=ft,L=At,0<=(Pt=nt)&&Pt<=15?K(K(lt,dt),L):St(St(ut(lt,dt),ut(lt,L)),ut(dt,L))),Ft),ot),f[nt]),gt(gt(gt(te(Q,et,z,nt),tt),Ot),d[nt]));Ft=At,At=R(ft,9),ft=rt,rt=ot,tt=z,z=R(et,19),et=Q,Q=K(K(Ot,R(Ot,9)),R(Ot,17))}return K([].concat(rt,ft,At,Ft,Q,et,z,tt),r)}Ut={getGlobalCurve:function(){return ce},generateEcparam:I,generateKeyPairHex:function(r,a,d){return{privateKey:d=k((a=(r?new se(r,a,d):new se(_.bitLength(),Ee)).mod(_.subtract(se.ONE)).add(se.ONE)).toString(16),64),publicKey:"04"+k((a=y.multiply(a)).getX().toBigInteger().toString(16),64)+k(a.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(r){for(var a=(r=unescape(encodeURIComponent(r))).length,d=[],f=0;f<a;f++)d[f>>>2]|=(255&r.charCodeAt(f))<<24-f%4*8;for(var A=[],g=0;g<a;g++){var O=d[g>>>2]>>>24-g%4*8&255;A.push((O>>>4).toString(16)),A.push((15&O).toString(16))}return A.join("")},leftPad:k,arrayToHex:function(r){return r.map((function(a){return(a=a.toString(16)).length===1?"0"+a:a})).join("")},arrayToUtf8:function(r){for(var a=[],d=0,f=0;f<2*r.length;f+=2)a[f>>>3]|=parseInt(r[d],10)<<24-f%8*4,d++;try{for(var A=[],g=0;g<r.length;g++){var O=a[g>>>2]>>>24-g%4*8&255;A.push(String.fromCharCode(O))}return decodeURIComponent(escape(A.join("")))}catch(V){throw new Error("Malformed UTF-8 data")}},hexToArray:function(r){for(var a=[],d=(r=(d=r.length)%2!=0?k(r,d+1):r).length,f=0;f<d;f+=2)a.push(parseInt(r.substr(f,2),16));return a},verifyPublicKey:function(r){var a=ce.decodePointHex(r);return!!a&&(r=a.getX(),a.getY().square().equals(r.multiply(r.square()).add(r.multiply(ce.a)).add(ce.b)))}},Mt=function(r){for(var a=448<=(a=(V=8*r.length)%512)?512-a%448-1:448-a-1,d=new Array((a-7)/8),f=0,A=d.length;f<A;f++)d[f]=0;for(var g,O=[],V=V.toString(2),x=7;0<=x;x--)8<V.length?(g=V.length-8,O[x]=parseInt(V.substr(g),2),V=V.substr(0,g)):0<V.length?(O[x]=parseInt(V,2),V=""):O[x]=0;for(var lt=[].concat(r,[128],d,O),dt=lt.length/64,L=[115,128,22,111,73,20,178,185,23,36,66,215,218,138,6,0,169,111,48,188,22,49,56,170,227,141,238,77,176,251,14,78],Z=0;Z<dt;Z++){var it=64*Z;L=ae(L,lt.slice(it,64+it))}return L};var Nt=Zt.exports.BigInteger,vo=function(r,a){return r=new Ae(r),a=new Ae(a),new _e([r,a]).getEncodedHex()},No=function(r){var a=me(r,0),d=me(r,a),f=he(r,a);return a=r.substr(d,2*f),d=me(r,f=d+a.length),f=he(r,f),r=r.substr(d,2*f),{r:new w(a,16),s:new w(r,16)}},yt=Ut,ke=Mt,Je=(Ut=yt.generateEcparam()).G,Nr=Ut.curve,qe=Ut.n;function Or(r,a,d){var f=2<arguments.length&&d!==void 0?d:"1234567812345678",A=(f=yt.utf8ToHex(f),yt.leftPad(Je.curve.a.toBigInteger().toRadix(16),64)),g=yt.leftPad(Je.curve.b.toBigInteger().toRadix(16),64),O=yt.leftPad(Je.getX().toBigInteger().toRadix(16),64),V=yt.leftPad(Je.getY().toBigInteger().toRadix(16),64);return d=(a=128<a.length?a.substr(2,128):a).substr(0,64),a=a.substr(64,64),a=yt.hexToArray(f+A+g+O+V+d+a),f=4*f.length,a.unshift(255&f),a.unshift(f>>8&255),a=ke(a),yt.arrayToHex(ke(a.concat(yt.hexToArray(r))))}function Cr(){var r=yt.generateKeyPairHex(),a=Nr.decodePointHex(r.publicKey);return r.k=new Nt(r.privateKey,16),r.x1=a.getX().toBigInteger(),r}Ut={generateKeyPairHex:yt.generateKeyPairHex,doEncrypt:function(r,a){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;r=typeof r=="string"?yt.hexToArray(yt.utf8ToHex(r)):Array.prototype.slice.call(r),a=yt.getGlobalCurve().decodePointHex(a);var f=yt.generateKeyPairHex(),A=new Nt(f.privateKey,16),g=f.publicKey;128<g.length&&(g=g.substr(g.length-128)),f=a.multiply(A),A=yt.hexToArray(yt.leftPad(f.getX().toBigInteger().toRadix(16),64)),a=yt.hexToArray(yt.leftPad(f.getY().toBigInteger().toRadix(16),64)),f=yt.arrayToHex(ke([].concat(A,r,a)));var O,V=1,x=0,lt=[],dt=[].concat(A,a);(O=function(){lt=ke([].concat(wt(dt),[V>>24&255,V>>16&255,V>>8&255,255&V])),V++,x=0})();for(var L=0,Z=r.length;L<Z;L++)x===lt.length&&O(),r[L]^=255<[x++];return a=yt.arrayToHex(r),d===0?g+a+f:g+f+a},doDecrypt:function(r,a){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,f=(g=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":g;a=new Nt(a,16);var A=r.substr(128,64),g=r.substr(192);d===0&&(A=r.substr(r.length-64),g=r.substr(128,r.length-128-64));var O,V=yt.hexToArray(g),x=(r=yt.getGlobalCurve().decodePointHex("04"+r.substr(0,128)).multiply(a),a=yt.hexToArray(yt.leftPad(r.getX().toBigInteger().toRadix(16),64)),r=yt.hexToArray(yt.leftPad(r.getY().toBigInteger().toRadix(16),64)),1),lt=0,dt=[],L=[].concat(a,r);(O=function(){dt=ke([].concat(wt(L),[x>>24&255,x>>16&255,x>>8&255,255&x])),x++,lt=0})();for(var Z=0,it=V.length;Z<it;Z++)lt===dt.length&&O(),V[Z]^=255&dt[lt++];return yt.arrayToHex(ke([].concat(a,V,r)))===A?f==="array"?V:yt.arrayToUtf8(V):f==="array"?[]:""},doSignature:function(r,a){var d=(V=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,f=V.der,A=V.hash,g=V.publicKey,O=V.userId,V=typeof r=="string"?yt.utf8ToHex(r):yt.arrayToHex(r);A&&(V=Or(V,g||(r=a,A=Je.multiply(new Nt(r,16)),"04"+(r=yt.leftPad(A.getX().toBigInteger().toString(16),64))+(A=yt.leftPad(A.getY().toBigInteger().toString(16),64))),O));var x=new Nt(a,16),lt=new Nt(V,16),dt=null,L=null,Z=null;do do{var it;dt=(it=d&&d.length?d.pop():Cr()).k,L=lt.add(it.x1).mod(qe)}while(L.equals(Nt.ZERO)||L.add(dt).equals(qe));while((Z=x.add(Nt.ONE).modInverse(qe).multiply(dt.subtract(L.multiply(x))).mod(qe)).equals(Nt.ZERO));return f?vo(L,Z):yt.leftPad(L.toString(16),64)+yt.leftPad(Z.toString(16),64)},doVerifySignature:function(r,a,d){var f,A,g=(V=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,O=V.hash,V=V.userId;return r=typeof r=="string"?yt.utf8ToHex(r):yt.arrayToHex(r),O&&(r=Or(r,d,V)),A=g?(f=(A=No(a)).r,A.s):(f=new Nt(a.substring(0,64),16),new Nt(a.substring(64),16)),a=Nr.decodePointHex(d),d=new Nt(r,16),!(r=f.add(A).mod(qe)).equals(Nt.ZERO)&&(a=Je.multiply(A).add(a.multiply(r)),d=d.add(a.getX().toBigInteger()).mod(qe),f.equals(d))},getPoint:Cr,verifyPublicKey:yt.verifyPublicKey};var Oo=Mt,An=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],hn=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function Un(r){for(var a=[],d=0,f=r.length;d<f;d+=2)a.push(parseInt(r.substr(d,2),16));return a}function He(r,a){return r<<a|r>>>32-a}function Re(r){return(255&An[r>>>24&255])<<24|(255&An[r>>>16&255])<<16|(255&An[r>>>8&255])<<8|255&An[255&r]}function gn(r){return r^He(r,2)^He(r,10)^He(r,18)^He(r,24)}function In(r){return r^He(r,13)^He(r,23)}function wr(r,a,d,f){f=(g=(O=3<arguments.length&&f!==void 0?f:{}).padding)===void 0?"pkcs#5":g;var A=O.mode,g=(g=O.iv)===void 0?[]:g,O=(O=O.output)===void 0?"string":O;if(A==="cbc"&&(g=typeof g=="string"?Un(g):g).length!==16)throw new Error("iv is invalid");if((a=typeof a=="string"?Un(a):a).length!==16)throw new Error("key is invalid");if(r=(typeof r=="string"?d!==0?function(Q){for(var et=[],z=0,tt=Q.length;z<tt;z++){var nt=Q.codePointAt(z);if(nt<=127)et.push(nt);else if(nt<=2047)et.push(192|nt>>>6),et.push(128|63&nt);else if(nt<=55295||57344<=nt&&nt<=65535)et.push(224|nt>>>12),et.push(128|nt>>>6&63),et.push(128|63&nt);else{if(!(65536<=nt&&nt<=1114111))throw et.push(nt),new Error("input is not supported");z++,et.push(240|nt>>>18&28),et.push(128|nt>>>12&63),et.push(128|nt>>>6&63),et.push(128|63&nt)}}return et}:Un:wt)(r),f==="pkcs#5"&&d!==0)for(var V=16-r.length%16,x=0;x<V;x++)r.push(V);var lt=new Array(32);(function(Q,et,z){for(var tt=new Array(4),nt=new Array(4),Pt=0;Pt<4;Pt++)nt[0]=255&Q[0+4*Pt],nt[1]=255&Q[1+4*Pt],nt[2]=255&Q[2+4*Pt],nt[3]=255&Q[3+4*Pt],tt[Pt]=nt[0]<<24|nt[1]<<16|nt[2]<<8|nt[3];tt[0]^=2746333894,tt[1]^=1453994832,tt[2]^=1736282519,tt[3]^=2993693404;for(var ot,Ot=0;Ot<32;Ot+=4)ot=tt[1]^tt[2]^tt[3]^hn[Ot+0],et[Ot+0]=tt[0]^=In(Re(ot)),ot=tt[2]^tt[3]^tt[0]^hn[Ot+1],et[Ot+1]=tt[1]^=In(Re(ot)),ot=tt[3]^tt[0]^tt[1]^hn[Ot+2],et[Ot+2]=tt[2]^=In(Re(ot)),ot=tt[0]^tt[1]^tt[2]^hn[Ot+3],et[Ot+3]=tt[3]^=In(Re(ot));if(z===0)for(var xt,kt=0;kt<16;kt++)xt=et[kt],et[kt]=et[31-kt],et[31-kt]=xt})(a,lt,d);for(var dt=[],L=g,Z=r.length,it=0;16<=Z;){var rt=r.slice(it,it+16),ft=new Array(16);if(A==="cbc")for(var At=0;At<16;At++)d!==0&&(rt[At]^=L[At]);(function(Q,et,z){for(var tt=new Array(4),nt=new Array(4),Pt=0;Pt<4;Pt++)nt[0]=255&Q[4*Pt],nt[1]=255&Q[4*Pt+1],nt[2]=255&Q[4*Pt+2],nt[3]=255&Q[4*Pt+3],tt[Pt]=nt[0]<<24|nt[1]<<16|nt[2]<<8|nt[3];for(var ot,Ot=0;Ot<32;Ot+=4)ot=tt[1]^tt[2]^tt[3]^z[Ot+0],tt[0]^=gn(Re(ot)),ot=tt[2]^tt[3]^tt[0]^z[Ot+1],tt[1]^=gn(Re(ot)),ot=tt[3]^tt[0]^tt[1]^z[Ot+2],tt[2]^=gn(Re(ot)),ot=tt[0]^tt[1]^tt[2]^z[Ot+3],tt[3]^=gn(Re(ot));for(var xt=0;xt<16;xt+=4)et[xt]=tt[3-xt/4]>>>24&255,et[xt+1]=tt[3-xt/4]>>>16&255,et[xt+2]=tt[3-xt/4]>>>8&255,et[xt+3]=255&tt[3-xt/4]})(rt,ft,lt);for(var Ft=0;Ft<16;Ft++)A==="cbc"&&d===0&&(ft[Ft]^=L[Ft]),dt[it+Ft]=ft[Ft];A==="cbc"&&(L=d!==0?ft:rt),Z-=16,it+=16}return f==="pkcs#5"&&d===0&&(f=dt[dt.length-1],dt.splice(dt.length-f,f)),O!=="array"?d!==0?dt.map((function(Q){return(Q=Q.toString(16)).length===1?"0"+Q:Q})).join(""):(function(Q){for(var et=[],z=0,tt=Q.length;z<tt;z++)240<=Q[z]&&Q[z]<=247?(et.push(String.fromCodePoint(((7&Q[z])<<18)+((63&Q[z+1])<<12)+((63&Q[z+2])<<6)+(63&Q[z+3]))),z+=3):224<=Q[z]&&Q[z]<=239?(et.push(String.fromCodePoint(((15&Q[z])<<12)+((63&Q[z+1])<<6)+(63&Q[z+2]))),z+=2):192<=Q[z]&&Q[z]<=223?(et.push(String.fromCodePoint(((31&Q[z])<<6)+(63&Q[z+1]))),z++):et.push(String.fromCodePoint(Q[z]));return et.join("")})(dt):dt}var Co=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Oe=[],wo=function(r,a,d){for(var f=r[0],A=r[1],g=r[2],O=r[3],V=r[4],x=r[5],lt=r[6],dt=r[7],L=0;L<64;L++){L<16?Oe[L]=0|a[d+L]:(Z=Oe[L-15],it=Oe[L-2],Oe[L]=((Z<<25|Z>>>7)^(Z<<14|Z>>>18)^Z>>>3)+Oe[L-7]+((it<<15|it>>>17)^(it<<13|it>>>19)^it>>>10)+Oe[L-16]);var Z=f&A^f&g^A&g,it=dt+((V<<26|V>>>6)^(V<<21|V>>>11)^(V<<7|V>>>25))+(V&x^~V<)+Co[L]+Oe[L];dt=lt,lt=x,x=V,V=O+it|0,O=g,g=A,A=f,f=it+(((f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22))+Z)|0}r[0]=r[0]+f|0,r[1]=r[1]+A|0,r[2]=r[2]+g|0,r[3]=r[3]+O|0,r[4]=r[4]+V|0,r[5]=r[5]+x|0,r[6]=r[6]+lt|0,r[7]=r[7]+dt|0},Lr=(Ut={c2:Ut,c3:function(r){return r=typeof r=="string"?(function(a){for(var d=[],f=0,A=a.length;f<A;f++){var g=a.codePointAt(f);if(g<=127)d.push(g);else if(g<=2047)d.push(192|g>>>6),d.push(128|63&g);else if(g<=55295||57344<=g&&g<=65535)d.push(224|g>>>12),d.push(128|g>>>6&63),d.push(128|63&g);else{if(!(65536<=g&&g<=1114111))throw d.push(g),new Error("input is not supported");f++,d.push(240|g>>>18&28),d.push(128|g>>>12&63),d.push(128|g>>>6&63),d.push(128|63&g)}}return d})(r):Array.prototype.slice.call(r),Oo(r).map((function(a){return(a=a.toString(16)).length===1?"0"+a:a})).join("")},c4:{encrypt:function(r,a,d){return wr(r,a,1,d)},decrypt:function(r,a,d){return wr(r,a,0,d)}},s2:function(r){var a=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],d=(function(A){for(var g=[],O=0;O<Math.ceil(A.length/4);O++)g[O]=A[4*O]<<24|(255&A[4*O+1])<<16|(255&A[4*O+2])<<8|255&A[4*O+3];return g})(r);d[(r=8*r.length)>>5]|=128<<24-r%32,d[15+(64+r>>9<<4)]=r;for(var f=0;f<d.length;f+=16)wo(a,d,f);return(function(A){for(var g=[],O=0;O<A.length;O++)g[4*O]=A[O]>>24&255,g[4*O+1]=A[O]>>16&255,g[4*O+2]=A[O]>>8&255,g[4*O+3]=255&A[O];return g})(a).map((function(A){return(A=A.toString(16)).length===1?"0"+A:A})).join("")}},Tt),Lo=Dt,Fo=vt,Uo=zt,xo=ie,Yo=Ut.c2,Vo=Ut.c3,Mo=Ut.c4,Go=Ut.s2;return(function(){var r;(r=function(){}).VERSION="2.1.0";var a=U;if(a.AAR2)return a.AAR2.VERSION!==r.VERSION&&console.log(a.AAR2.VERSION),a.AAR2;var d="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",f=!1,A=!1,g=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,O=g!==void 0&&!!g.request&&!!g.login,V=function(L,Z){return typeof L=="string"&&typeof Z=="string"&&L!=null&&Z!=null&&L.substring(0,Z.length)===Z},x={SUCCESS:0,ALREADY_SUCCESS:1,ERROR_XHR_TIMEOUT:-1,ERROR_XHR_ERROR:-2,ERROR_XXX_REQUEST_TIMEOUT:-3,ERROR_XXX_REQUEST_FAIL:-4,ERROR_SIGN_CHECK:-5,ERROR_UNKNOWN_ERROR:-6,ERROR_DATA_FORMAT:-7},lt=function(L){for(var Z in x)if(x[Z]===L)return Z},dt=function(L,Z,it){var rt=Date.now(),ft=new r;try{if(!L||L.length<=75)return console.error("error format 1:",L),x.ERROR_DATA_FORMAT;if(!V(L,"eyJ"))return console.error("error format 2:",L),x.ERROR_DATA_FORMAT;L=L.substring(3,L.length);var At=Lo.my_b4_decode(L);if(!At)return console.error("error format 3:",L),x.ERROR_DATA_FORMAT;var Ft,Q=ft.cc.u8.byteToInt(At.slice(0,4),0),et=At.slice(4,4+Q),z=ft.cc.u8.byteToInt(At.slice(4+Q,4+Q+4),0),tt=At.slice(4+Q+4,4+Q+4+z),nt=ft.cc.u8.byteToInt(At.slice(4+Q+4+z,4+Q+4+z+4),0),Pt=At.slice(4+Q+4+z+4,4+Q+4+z+4+nt),ot=ft.cc.u8.bytesToUtf8Str(et);if(ft.cc.h6.encode(tt,0,z),Z||(it!==void 0&&it==="sm2"?(Ft=ft.cc.h6.encode(tt,0,z),ft.co.c2.doVerifySignature(ot,Ft,d,{der:!0,hash:!0})):ft.co.c3(ot+"8890012345678890").toLowerCase()===ft.cc.h6.encode(Pt,0,nt).toLowerCase())){if(ot.length%2==0){r.prototype.__v=function(){return ot.slice(0,2)};for(var Ot=[],xt=2;xt<66;xt+=2)Ot.push(parseInt("0x"+ot.slice(xt,xt+2)));r.prototype.__i=function(){return Ot};var kt=parseInt("0x"+ot.slice(66,82))-rt;r.prototype.__o=function(){return kt}}return O||U.AAR2||(U.AAR2=r),x.SUCCESS}}catch(xn){return console.error(xn),x.ERROR_UNKNOWN_ERROR}return x.ERROR_SIGN_CHECK};return r.init=function(L,Z){var it,rt={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof L=="string"?(V(L,"https")||V(L,"https")?rt.url=L:V(L,"eyJ")&&(rt.code=L),typeof Z=="string"&&(rt.publicKey=Z)):N(L)==="object"&&(L.debug&&(rt.debug=L.debug),L.url&&(rt.url=L.url),L.code&&(rt.code=L.code),L.publicKey&&(rt.publicKey=L.publicKey),L.skipVerify&&(rt.skipVerify=L.skipVerify),L.alg&&(rt.alg=L.alg),L.callback&&typeof L.callback=="function"&&(rt.callback=L.callback)),A?rt.callback&&rt.callback(!0,{errorNo:it=x.ALREADY_SUCCESS,errorMsg:lt(it)}):f?setTimeout((function(){r.init(L,Z)}),50):(f=!0,rt.debug&&Lr.start(rt.debug),rt.publicKey&&(d=rt.publicKey),rt.code?(it=dt(rt.code,rt.skipVerify))===x.SUCCESS?(f=!(A=!0),rt.callback(!0,{errorNo:it,errorMsg:lt(it)})):rt.callback(!1,{errorNo:it,errorMsg:lt(it)}):rt.url&&(function(ft,At,Ft){try{if(ft=ft+"?version="+r.VERSION+(O?"&name=wechat":"&name=browser")+"&t="+Date.now(),O)g.request({url:ft,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function(et){et.statusCode===200?At(et.data):Ft(x.ERROR_XXX_REQUEST_FAIL)},fail:function(et){et&&et.errMsg&&et.errMsg.indexOf("timeout")!==-1?Ft(x.ERROR_XXX_REQUEST_TIMEOUT):Ft(x.ERROR_XXX_REQUEST_FAIL)}});else{var Q;if(window.XMLHttpRequest)Q=new XMLHttpRequest;else if(window.ActiveXObject)try{Q=new ActiveXObject("Msxml2.XMLHTTP")}catch(et){try{Q=new ActiveXObject("Microsoft.XMLHTTP")}catch(z){}}Q&&(Q.onload=function(){Q.readyState===4&&(Q.status===200?At(Q.responseText):Ft(x.ERROR_XHR_ERROR))},Q.ontimeout=function(){Ft(x.ERROR_XHR_TIMEOUT)},Q.onerror=function(){Ft(x.ERROR_XHR_ERROR)},Q.open("POST",ft,!0),Q.timeout=5e3,Q.send(null))}}catch(et){console.error(et),Ft(x.ERROR_UNKNOWN_ERROR)}})(rt.url,(function(ft){(ft=dt(ft,rt.skipVerify,rt.alg))===x.SUCCESS?(f=!(A=!0),rt.callback(!0,{errorNo:ft,errorMsg:lt(ft)})):(f=!1,rt.callback(!1,{errorNo:ft,errorMsg:lt(ft)}))}),(function(ft){f=!1,rt.callback(!1,{errorNo:ft,errorMsg:lt(ft)})})))},r.prototype={cc:{b4:Fo,h6:Uo,u8:xo},co:{c2:Yo,c3:Vo,c4:Mo,s2:Go},nonce:function(){var L="0000000000"+Math.ceil(2147483647*Math.random())+Math.floor((Date.now()+this.__o())/1e3);return L.substring(L.length-20)},sign:function(L,Z){return this.__s(L,Z)},__s:function(L,Z){var it=this.cc.u8.utf8StrToBytes(L),rt=this.__i();return L=this.cc.u8.utf8StrToBytes(Z),Z=this.cc.u8.utf8StrToBytes(this.__c()),L=[].concat(it,rt,L,Z),Z=parseInt("0x"+this.__v()),this.__f(Z)(L)+this.__v()},__f:function(L){var Z=this.co.s2,it=this.co.c3,rt=this.cc.h6.decode,ft=[function(At){return Z(At)},function(At){return it(At)},function(At){return it(rt(Z(At)))},function(At){return Z(rt(it(At)))},function(At){return it(rt(it(At)))},function(At){return Z(rt(Z(At)))}];return ft[(128<L?L-128:L)%ft.length]},__i:function(){return[115,128,22,111,73,20,178,185,23,36,66,215,218,138,6,0,169,111,48,188,22,49,56,170,227,141,238,77,176,251,14,78]},__v:function(){return"00"},__c:function(){if(this.__d())return"debug";if(typeof phantom!="undefined"&&phantom.exit&&phantom.injectJs)return"phantom";if(typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]"&&process.version&&process.pid&&process.argv)return"require";if(g!==void 0&&g.env&&g.request&&g.getStorage){if(typeof window!="undefined"&&window.document&&window.alert&&window.atob&&typeof window.setTimeout=="function")return"window"}else{if(!(typeof window!="undefined"&&window.document&&window.alert&&window.atob&&typeof window.setTimeout=="function"))return"window";if(!window.navigator||typeof window.navigator.vendor!="string")return"navigator";if(window.navigator.webdriver)return"webdriver"}return""},__o:function(){return 0},__d:function(){return Lr.isDebug()},version:function(){return r.VERSION}},r})()},q(l)=="object"?s.exports=P():(D=typeof(h=P)=="function"?h.call(l,p,l,s):h)===void 0||(s.exports=D)}},e={};function n(s){var l=e[s];if(l!==void 0)return l.exports;var p=e[s]={id:s,loaded:!1,exports:{}};return t[s].call(p.exports,p,p.exports,n),p.loaded=!0,p.exports}n.n=s=>{var l=s&&s.__esModule?()=>s.default:()=>s;return n.d(l,{a:l}),l},n.d=(s,l)=>{for(var p in l)n.o(l,p)&&!n.o(s,p)&&Object.defineProperty(s,p,{enumerable:!0,get:l[p]})},n.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(s){if(typeof window=="object")return window}})(),n.hmd=s=>((s=Object.create(s)).children||(s.children=[]),Object.defineProperty(s,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+s.id)}}),s),n.o=(s,l)=>Object.prototype.hasOwnProperty.call(s,l),n.r=s=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})};var o=n(737);Wr.exports.LyyGetCommandSDK=o})()});var xu={};we(xu,{AlipayTouchErrorCode:()=>qn,AlipayTouchErrorMessage:()=>Hn,AutomaticDebitErrorCode:()=>Jn,AutomaticDebitErrorMessage:()=>de,DyErrorCode:()=>De,DyErrorMessage:()=>at,ENV_TYPE:()=>ee,EXTERNAL_ENV_TYPE:()=>Ie,GlobalVipErrorCode:()=>We,GlobalVipErrorMessage:()=>ye,JdErrorCode:()=>Sn,JdErrorMessage:()=>Ct,checkBenefit:()=>Tr,clearCache:()=>Po,confirm:()=>eo,createServices:()=>Ro,execute:()=>wn,getCapability:()=>Zi,getDisplayAdConfig:()=>dn,getDyPayRtaData:()=>Rn,getEntryContext:()=>br,getProductConfig:()=>fr,getSubscribeState:()=>yn,handleDyAuthDebitSignFlow:()=>ir,handleDyAuthDebitSignFlowWithRawPayInfo:()=>or,handleDyJsapiPayFlow:()=>rr,handleDyPayCommandFlow:()=>nr,handleDyPayFlow:()=>Tn,handleJdInsurance:()=>$n,handleJdInsuranceExt:()=>Zn,handleJdjrCashLoanExt:()=>zn,handleJdjrCashLoanFlow:()=>Xn,handleSubscribeFlow:()=>Io,normalizeDisplayAdData:()=>vn,normalizeProductConfig:()=>Ze,pollSubscribeResult:()=>Do,recordExposure:()=>go,resolvePhone:()=>To,resumeDouyin:()=>to});module.exports=Qo(xu);var ee={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},Ie={SIT:"sit",RELEASE:"release",PROD:"prod"},Pn={[ee.DEV]:"https://dm.leyaoyao.com",[ee.SIT]:"https://sm.leyaoyao.com",[ee.UAT]:"https://um.leyaoyao.com",[ee.PROD]:"https://m.leyaoyao.com"},Yr={[ee.DEV]:"https://dad2.leyaoyao.com",[ee.SIT]:"https://sad2.leyaoyao.com",[ee.UAT]:"https://uad2.leyaoyao.com",[ee.PROD]:"https://nad.ehuoke.com"},rn={[Ie.SIT]:"https://sopenapi.leyaoyao.com",[Ie.RELEASE]:"https://uopen-api.leyaoyao.com",[Ie.PROD]:"https://api-gateway.leyaoyao.com"};function Ke(t,e){return`${Pn[t]||Pn[ee.PROD]}${e}`}function Bn(t){return Yr[t]||Yr[ee.PROD]}var Qe={debug:!1,env:ee.PROD,externalEnv:Ie.PROD,apiDomain:""},Vr=F({},Qe);function Mr(t){Vr=F(F({},Qe),t)}function Xt(){return Vr}var Wo=Object.defineProperty,Xo=(t,e,n)=>e in t?Wo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,zo=(t,e,n)=>Xo(t,typeof e!="symbol"?e+"":e,n);function le(){return typeof Taro!="undefined"&&Taro.getEnv?"taro":typeof uni!="undefined"&&uni.request?"uni":typeof wx!="undefined"&&wx.request?"wechat":typeof my!="undefined"&&my.request?"alipay":typeof window!="undefined"?"web":"unknown"}var $o=class{constructor(t=!1){zo(this,"enable"),this.enable=t}setEnable(t){this.enable=t}info(...t){this.enable&&console.info("[BI Info]",...t)}warn(...t){this.enable&&console.warn("[BI Warn]",...t)}error(...t){this.enable&&console.error("[BI Error]",...t)}debug(...t){this.enable&&console.log("[BI Debug]",...t)}},v=new $o;function Le(t){let e=le();return e==="taro"?Taro.setClipboardData({data:t}).then(()=>{v.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):e==="uni"?new Promise((n,o)=>{uni.setClipboardData({data:t,success:()=>{v.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),n()},fail:s=>{v.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",s),o(s)}})}):e==="wechat"?new Promise((n,o)=>{wx.setClipboardData({data:t,success:()=>{v.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),n()},fail:s=>{v.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",s),o(s)}})}):e==="alipay"?new Promise((n,o)=>{my.setClipboardData({text:t,success:()=>{v.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),n()},fail:s=>{v.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",s),o(s)}})}):navigator.clipboard.writeText(t).then(()=>{v.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function kn(t,e=2e3){let n=le();if(n==="taro"){Taro.showToast({title:t,icon:"none",mask:!0,duration:e});return}if(n==="uni"){uni.showToast({title:t,icon:"none",mask:!0,duration:e});return}if(n==="wechat"){wx.showToast({title:t,icon:"none",mask:!0,duration:e});return}if(n==="alipay"){my.showToast({content:t,duration:e});return}typeof console!="undefined"&&console.log(`[Toast] ${t}`)}async function Fe(){var t,e,n,o,s;let l=le();try{if(l==="taro")return((t=(await Taro.getSystemInfo()).platform)==null?void 0:t.toLowerCase())==="ios"?"ios":"android";if(l==="uni")return((e=uni.getSystemInfoSync().platform)==null?void 0:e.toLowerCase())==="ios"?"ios":"android";if(l==="wechat")return wx.getDeviceInfo?((n=(await wx.getDeviceInfo()).platform)==null?void 0:n.toLowerCase())==="ios"?"ios":"android":((o=wx.getSystemInfoSync().platform)==null?void 0:o.toLowerCase())==="ios"?"ios":"android";if(l==="alipay")return((s=my.getSystemInfoSync().platform)==null?void 0:s.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let p=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(p))return"ios";if(/android/.test(p))return"android"}return"unknown"}catch(p){return v.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",p),"unknown"}}var Et={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function E(t,e,n=null){return{code:t,message:e,data:n}}function En(t,e){return t==null?{valid:!1,message:`${e}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof t=="string"&&t.trim().length===0?{valid:!1,message:`${e}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Ue(t,e){for(let n of e){let o=En(t[n],n);if(!o.valid)return o}return{valid:!0}}var tr={};we(tr,{handleJdInsurance:()=>$n,handleJdInsuranceExt:()=>Zn,handleJdjrCashLoanExt:()=>zn,handleJdjrCashLoanFlow:()=>Xn});var Sn=(X=>(X[X.JD_CASH_LOAN__MISSING_PHONE=2001]="JD_CASH_LOAN__MISSING_PHONE",X[X.JD_CASH_LOAN__MISSING_DEVICE_ID=2002]="JD_CASH_LOAN__MISSING_DEVICE_ID",X[X.JD_CASH_LOAN__RTA_FAILED=2003]="JD_CASH_LOAN__RTA_FAILED",X[X.JD_CASH_LOAN__GET_CONFIG_FAILED=2004]="JD_CASH_LOAN__GET_CONFIG_FAILED",X[X.JD_CASH_LOAN__INVALID_CONFIG=2005]="JD_CASH_LOAN__INVALID_CONFIG",X[X.JD_CASH_LOAN__EXT_NOT_ELIGIBLE=2006]="JD_CASH_LOAN__EXT_NOT_ELIGIBLE",X[X.JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS=2007]="JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS",X[X.JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM=2008]="JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM",X[X.JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID=2009]="JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID",X[X.JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE=2010]="JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE",X[X.JD_INSURANCE__USER_NOT_ELIGIBLE=2101]="JD_INSURANCE__USER_NOT_ELIGIBLE",X[X.JD_INSURANCE__H5_NOT_SUPPORTED=2102]="JD_INSURANCE__H5_NOT_SUPPORTED",X[X.JD_INSURANCE__INVALID_JUMP_PARAMS=2103]="JD_INSURANCE__INVALID_JUMP_PARAMS",X[X.JD_INSURANCE__GET_CONFIG_FAILED=2104]="JD_INSURANCE__GET_CONFIG_FAILED",X[X.JD_INSURANCE__COPY_FAILED=2105]="JD_INSURANCE__COPY_FAILED",X[X.JD_INSURANCE__TASK_COMPLETED=2106]="JD_INSURANCE__TASK_COMPLETED",X[X.JD_INSURANCE__UNKNOWN_JUMP_MODE=2107]="JD_INSURANCE__UNKNOWN_JUMP_MODE",X[X.JD_INSURANCE__RTA_FAILED=2108]="JD_INSURANCE__RTA_FAILED",X))(Sn||{}),Ct={2001:"\u7F3A\u5C11\u624B\u673A\u53F7\u53C2\u6570",2002:"\u7F3A\u5C11\u8BBE\u5907ID",2003:"\u672A\u6EE1\u8DB3\u6D3B\u52A8\u8D44\u683C",2004:"\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E\u5931\u8D25",2005:"\u8DF3\u8F6C\u914D\u7F6E\u53C2\u6570\u5F02\u5E38",2006:"\u7528\u6237\u4E0D\u7B26\u5408\u6D3B\u52A8\u53C2\u4E0E\u6761\u4EF6",2007:"\u8DF3\u8F6C\u53C2\u6570\u5F02\u5E38",2008:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u5E73\u53F0\u53C2\u6570",2009:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u7528\u6237ID",2010:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u8BBE\u5907\u503C",2101:"\u7528\u6237\u4E0D\u7B26\u5408\u6D3B\u52A8\u53C2\u4E0E\u6761\u4EF6",2102:"H5\u6A21\u5F0F\u6682\u4E0D\u652F\u6301",2103:"\u8DF3\u8F6C\u53C2\u6570\u5F02\u5E38",2104:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u5931\u8D25",2105:"\u590D\u5236\u53E3\u4EE4\u5931\u8D25",2106:"\u7528\u6237\u5DF2\u5B8C\u6210\u4EFB\u52A1",2107:"\u672A\u77E5\u8DF3\u8F6C\u6A21\u5F0F",2108:"RTA\u6821\u9A8C\u5931\u8D25"},De=(w=>(w[w.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",w[w.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",w[w.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",w[w.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",w[w.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",w[w.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",w[w.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",w[w.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",w[w.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",w[w.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",w[w.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",w[w.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",w[w.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",w[w.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",w[w.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",w[w.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",w[w.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",w[w.DY_PAY__INVALID_RETURN_TYPE=3018]="DY_PAY__INVALID_RETURN_TYPE",w[w.DY_PAY__JSAPI_INFO_FAILED=3019]="DY_PAY__JSAPI_INFO_FAILED",w[w.DY_PAY__REQUEST_JSAPI_INFO_FAILED=3020]="DY_PAY__REQUEST_JSAPI_INFO_FAILED",w[w.DY_PAY__MISSING_JSAPI_PAY_INFO=3021]="DY_PAY__MISSING_JSAPI_PAY_INFO",w[w.DY_PAY__INVALID_JSAPI_PAY_INFO=3022]="DY_PAY__INVALID_JSAPI_PAY_INFO",w[w.DY_PAY__JSAPI_SIGNATURE_FAILED=3023]="DY_PAY__JSAPI_SIGNATURE_FAILED",w[w.DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED=3024]="DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED",w[w.DY_PAY__JSAPI_UNSUPPORTED_ENV=3025]="DY_PAY__JSAPI_UNSUPPORTED_ENV",w[w.DY_PAY__JSAPI_AUTH_REDIRECT_FAILED=3026]="DY_PAY__JSAPI_AUTH_REDIRECT_FAILED",w[w.DY_PAY__JSAPI_SDK_LOAD_FAILED=3027]="DY_PAY__JSAPI_SDK_LOAD_FAILED",w[w.DY_PAY__JSAPI_CONFIG_FAILED=3028]="DY_PAY__JSAPI_CONFIG_FAILED",w[w.DY_PAY__JSAPI_INVOKE_FAILED=3029]="DY_PAY__JSAPI_INVOKE_FAILED",w[w.DY_PAY__MISSING_AUTH_TOKEN=3030]="DY_PAY__MISSING_AUTH_TOKEN",w[w.DY_PAY_COMMAND__MISSING_ORDER_AMOUNT=3031]="DY_PAY_COMMAND__MISSING_ORDER_AMOUNT",w[w.DY_PAY_COMMAND__GET_FAILED=3032]="DY_PAY_COMMAND__GET_FAILED",w[w.DY_PAY_COMMAND__REQUEST_FAILED=3033]="DY_PAY_COMMAND__REQUEST_FAILED",w[w.DY_PAY_COMMAND__COPY_FAILED=3034]="DY_PAY_COMMAND__COPY_FAILED",w[w.DY_PAY_COMMAND__INVALID_RTA_DATA=3035]="DY_PAY_COMMAND__INVALID_RTA_DATA",w[w.DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID=3036]="DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID",w[w.DY_PAY__AUTH_DEBIT_SIGN_FAILED=3037]="DY_PAY__AUTH_DEBIT_SIGN_FAILED",w[w.DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED=3038]="DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED",w[w.DY_PAY__JSAPI_PAY_CANCELLED=3039]="DY_PAY__JSAPI_PAY_CANCELLED",w))(De||{}),at={3001:"\u7F3A\u5C11\u624B\u673A\u53F7\u53C2\u6570",3002:"\u7F3A\u5C11\u8BBE\u5907ID\u53C2\u6570",3003:"\u7F3A\u5C11\u5957\u9910\u91D1\u989D\u53C2\u6570",3004:"\u65E0\u6548\u7684\u5BA2\u6237\u7AEF\u7C7B\u578B",3005:"\u4E1A\u52A1\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E",3006:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u5931\u8D25",3007:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u8BF7\u6C42\u5931\u8D25",3008:"\u7EDF\u4E00\u4E0B\u5355\u5931\u8D25",3009:"\u7EDF\u4E00\u4E0B\u5355\u8BF7\u6C42\u5931\u8D25",3010:"\u83B7\u53D6\u8DF3\u8F6C\u5730\u5740\u5931\u8D25",3011:"\u7F51\u7EDC\u8BF7\u6C42\u5F02\u5E38",3012:"\u4E0B\u5355\u6D41\u7A0B\u5F02\u5E38",3013:"\u83B7\u53D6RTA\u4FE1\u606F\u5931\u8D25",3014:"\u83B7\u53D6RTA\u4FE1\u606F\u8BF7\u6C42\u5931\u8D25",3015:"\u83B7\u53D6RTA\u4FE1\u606F\u5F02\u5E38",3016:"\u65E0\u6548\u7684\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u65B9\u5F0F",3017:"\u7F3A\u5C11\u4E1A\u52A1\u7C7B\u578B\u53C2\u6570",3018:"\u65E0\u6548\u7684\u8FD4\u56DE\u5730\u5740\u7C7B\u578B",3019:"\u83B7\u53D6JSAPI\u652F\u4ED8\u4FE1\u606F\u5931\u8D25",3020:"\u83B7\u53D6JSAPI\u652F\u4ED8\u4FE1\u606F\u8BF7\u6C42\u5931\u8D25",3021:"\u7F3A\u5C11JSAPI\u652F\u4ED8\u53C2\u6570",3022:"JSAPI\u652F\u4ED8\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E",3023:"\u83B7\u53D6JSAPI\u652F\u4ED8\u7B7E\u540D\u5931\u8D25",3024:"\u83B7\u53D6JSAPI\u652F\u4ED8\u7B7E\u540D\u8BF7\u6C42\u5931\u8D25",3025:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u6296\u97F3JSAPI\u652F\u4ED8",3026:"\u6296\u97F3\u6388\u6743\u8DF3\u8F6C\u5931\u8D25",3027:"\u6296\u97F3\u5F00\u653ESDK\u52A0\u8F7D\u5931\u8D25",3028:"\u6296\u97F3JSSDK\u521D\u59CB\u5316\u5931\u8D25",3029:"\u6296\u97F3JSAPI\u652F\u4ED8\u8C03\u8D77\u5931\u8D25",3030:"\u7F3A\u5C11\u6296\u97F3\u6388\u6743token",3031:"\u7F3A\u5C11\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4\u91D1\u989D",3032:"\u83B7\u53D6\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4\u5931\u8D25",3033:"\u83B7\u53D6\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4\u8BF7\u6C42\u5931\u8D25",3034:"\u590D\u5236\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4\u5931\u8D25",3035:"\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4RTA\u6570\u636E\u65E0\u6548",3036:"\u7F3A\u5C11\u6388\u6743\u4EE3\u6263\u7B7E\u7EA6requestId",3037:"\u6388\u6743\u4EE3\u6263\u7B7E\u7EA6\u5931\u8D25",3038:"\u6388\u6743\u4EE3\u6263\u7B7E\u7EA6\u8BF7\u6C42\u5931\u8D25",3039:"\u7528\u6237\u53D6\u6D88\u6296\u97F3\u652F\u4ED8"},We=(J=>(J[J.GLOBAL_VIP__MISSING_EQUIPMENT_VALUE=4001]="GLOBAL_VIP__MISSING_EQUIPMENT_VALUE",J[J.GLOBAL_VIP__MISSING_EQUIPMENT_TYPE=4002]="GLOBAL_VIP__MISSING_EQUIPMENT_TYPE",J[J.GLOBAL_VIP__INVALID_CLIENT_TYPE=4003]="GLOBAL_VIP__INVALID_CLIENT_TYPE",J[J.GLOBAL_VIP__ENTRANCE_CHECK_FAILED=4004]="GLOBAL_VIP__ENTRANCE_CHECK_FAILED",J[J.GLOBAL_VIP__MISSING_SUBSCRIBE_TYPE=4005]="GLOBAL_VIP__MISSING_SUBSCRIBE_TYPE",J[J.GLOBAL_VIP__CONFIG_FAILED=4006]="GLOBAL_VIP__CONFIG_FAILED",J[J.GLOBAL_VIP__INVALID_CONFIG=4007]="GLOBAL_VIP__INVALID_CONFIG",J[J.GLOBAL_VIP__STATE_QUERY_FAILED=4008]="GLOBAL_VIP__STATE_QUERY_FAILED",J[J.GLOBAL_VIP__ALREADY_ACTIVE=4009]="GLOBAL_VIP__ALREADY_ACTIVE",J[J.GLOBAL_VIP__SIGN_FAILED=4010]="GLOBAL_VIP__SIGN_FAILED",J[J.GLOBAL_VIP__INVALID_SIGN_RESULT=4011]="GLOBAL_VIP__INVALID_SIGN_RESULT",J[J.GLOBAL_VIP__BENEFIT_QUERY_FAILED=4012]="GLOBAL_VIP__BENEFIT_QUERY_FAILED",J[J.GLOBAL_VIP__EXPOSURE_FAILED=4013]="GLOBAL_VIP__EXPOSURE_FAILED",J[J.GLOBAL_VIP__DISCOUNT_CHECK_FAILED=4014]="GLOBAL_VIP__DISCOUNT_CHECK_FAILED",J[J.GLOBAL_VIP__POLL_FAILED=4015]="GLOBAL_VIP__POLL_FAILED",J))(We||{}),ye={4001:"\u7F3A\u5C11\u8BBE\u5907\u7F16\u53F7",4002:"\u7F3A\u5C11\u8BBE\u5907\u7C7B\u578B",4003:"\u65E0\u6548\u7684\u5BA2\u6237\u7AEF\u7C7B\u578B",4004:"\u5E73\u53F0\u5927\u4F1A\u5458\u5165\u53E3\u8D44\u683C\u67E5\u8BE2\u5931\u8D25",4005:"\u672A\u83B7\u53D6\u5230\u5E73\u53F0\u5927\u4F1A\u5458\u5361\u7C7B\u578B",4006:"\u5E73\u53F0\u5927\u4F1A\u5458\u8BA2\u9605\u914D\u7F6E\u67E5\u8BE2\u5931\u8D25",4007:"\u5E73\u53F0\u5927\u4F1A\u5458\u8BA2\u9605\u914D\u7F6E\u65E0\u6548",4008:"\u5E73\u53F0\u5927\u4F1A\u5458\u72B6\u6001\u67E5\u8BE2\u5931\u8D25",4009:"\u7528\u6237\u5DF2\u5F00\u901A\u5E73\u53F0\u5927\u4F1A\u5458",4010:"\u5E73\u53F0\u5927\u4F1A\u5458\u7B7E\u7EA6\u5931\u8D25",4011:"\u5E73\u53F0\u5927\u4F1A\u5458\u7B7E\u7EA6\u7ED3\u679C\u65E0\u6548",4012:"\u5E73\u53F0\u5927\u4F1A\u5458\u6743\u76CA\u67E5\u8BE2\u5931\u8D25",4013:"\u5E73\u53F0\u5927\u4F1A\u5458\u66DD\u5149\u8BB0\u5F55\u5931\u8D25",4014:"\u6296\u97F3\u7B7E\u7EA6\u4F18\u60E0\u8D44\u683C\u67E5\u8BE2\u5931\u8D25",4015:"\u5E73\u53F0\u5927\u4F1A\u5458\u7B7E\u7EA6\u7ED3\u679C\u8F6E\u8BE2\u5931\u8D25"},Jn=(D=>(D[D.AUTO_DEBIT__INVALID_PARAM=4101]="AUTO_DEBIT__INVALID_PARAM",D[D.AUTO_DEBIT__SIGN_REQUEST_FAILED=4102]="AUTO_DEBIT__SIGN_REQUEST_FAILED",D[D.AUTO_DEBIT__INVALID_RESPONSE=4103]="AUTO_DEBIT__INVALID_RESPONSE",D[D.AUTO_DEBIT__UNSUPPORTED_CAPABILITY=4104]="AUTO_DEBIT__UNSUPPORTED_CAPABILITY",D[D.AUTO_DEBIT__CHANNEL_INVOKE_FAILED=4105]="AUTO_DEBIT__CHANNEL_INVOKE_FAILED",D[D.AUTO_DEBIT__USER_CANCELLED=4106]="AUTO_DEBIT__USER_CANCELLED",D[D.AUTO_DEBIT__CONFIRM_FAILED=4107]="AUTO_DEBIT__CONFIRM_FAILED",D[D.AUTO_DEBIT__CONFIRM_TIMEOUT=4108]="AUTO_DEBIT__CONFIRM_TIMEOUT",D))(Jn||{}),de={4101:"\u81EA\u52A8\u4EE3\u6263\u7B7E\u7EA6\u53C2\u6570\u65E0\u6548",4102:"\u81EA\u52A8\u4EE3\u6263\u7B7E\u7EA6\u8BF7\u6C42\u5931\u8D25",4103:"\u81EA\u52A8\u4EE3\u6263\u7B7E\u7EA6\u54CD\u5E94\u65E0\u6548",4104:"\u5F53\u524D\u8FD0\u884C\u7AEF\u4E0D\u652F\u6301\u8BE5\u7B7E\u7EA6\u65B9\u5F0F",4105:"\u81EA\u52A8\u4EE3\u6263\u6E20\u9053\u8C03\u8D77\u5931\u8D25",4106:"\u7528\u6237\u53D6\u6D88\u81EA\u52A8\u4EE3\u6263\u7B7E\u7EA6",4107:"\u81EA\u52A8\u4EE3\u6263\u6700\u7EC8\u72B6\u6001\u786E\u8BA4\u5931\u8D25",4108:"\u81EA\u52A8\u4EE3\u6263\u6700\u7EC8\u72B6\u6001\u786E\u8BA4\u8D85\u65F6"},qn=(N=>(N[N.ALIPAY_TOUCH__MISSING_MODE=5001]="ALIPAY_TOUCH__MISSING_MODE",N[N.ALIPAY_TOUCH__INVALID_APPID=5002]="ALIPAY_TOUCH__INVALID_APPID",N[N.ALIPAY_TOUCH__MISSING_THIRD_PLATFORM=5003]="ALIPAY_TOUCH__MISSING_THIRD_PLATFORM",N[N.ALIPAY_TOUCH__MISSING_THIRD_PLATFORM_USER_ID=5004]="ALIPAY_TOUCH__MISSING_THIRD_PLATFORM_USER_ID",N[N.ALIPAY_TOUCH__MISSING_OPENID=5005]="ALIPAY_TOUCH__MISSING_OPENID",N[N.ALIPAY_TOUCH__INVALID_PHONE=5006]="ALIPAY_TOUCH__INVALID_PHONE",N[N.ALIPAY_TOUCH__EXTERNAL_CONFIG_MISSING=5007]="ALIPAY_TOUCH__EXTERNAL_CONFIG_MISSING",N[N.ALIPAY_TOUCH__RESOLVE_FAILED=5008]="ALIPAY_TOUCH__RESOLVE_FAILED",N[N.ALIPAY_TOUCH__REQUEST_FAILED=5009]="ALIPAY_TOUCH__REQUEST_FAILED",N[N.ALIPAY_TOUCH__INVALID_RESPONSE=5010]="ALIPAY_TOUCH__INVALID_RESPONSE",N[N.ALIPAY_TOUCH__MISSING_AUTH_TOKEN=5011]="ALIPAY_TOUCH__MISSING_AUTH_TOKEN",N))(qn||{}),Hn={5001:"\u7F3A\u5C11\u63A5\u5165\u6A21\u5F0F\u53C2\u6570\uFF0C\u8BF7\u663E\u5F0F\u4F20\u5165 mode: internal \u6216 external",5002:"appid \u53C2\u6570\u7F3A\u5931\u6216\u4E3A\u7A7A",5003:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u5E73\u53F0\u6807\u8BC6 thirdPlatform",5004:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u5E73\u53F0\u7528\u6237ID thirdPlatformUserId",5005:"\u7F3A\u5C11 openid",5006:"phone \u53C2\u6570\u5FC5\u987B\u4E3A11\u4F4D\u6570\u5B57",5007:"\u672A\u914D\u7F6E\u5916\u90E8\u5BF9\u63A5\u51ED\u8BC1\uFF0C\u8BF7\u901A\u8FC7 createServices \u914D\u7F6E externalAppId \u548C externalAppSecret",5008:"\u78B0\u4E00\u78B0\u53D6\u53F7\u63A5\u53E3\u8FD4\u56DE\u4E1A\u52A1\u5931\u8D25",5009:"\u78B0\u4E00\u78B0\u53D6\u53F7\u8BF7\u6C42\u5931\u8D25",5010:"\u78B0\u4E00\u78B0\u53D6\u53F7\u54CD\u5E94\u6570\u636E\u4E0D\u5B8C\u6574\u6216\u6821\u9A8C\u5931\u8D25",5011:"\u7F3A\u5C11\u96C6\u56E2\u767B\u5F55\u6001\uFF0C\u8BF7\u5148 nova.setToken \u6216\u914D\u7F6E getAuthToken"};var Zo=(t,e,n,o)=>{let s=le();if(s==="taro")return Taro.request({url:t,method:e,data:n,header:o}).then(h=>h);if(s==="uni")return new Promise((h,D)=>{uni.request({url:t,method:e,data:n,header:o,success:P=>h(P),fail:P=>D(P)})});if(s==="wechat")return new Promise((h,D)=>{wx.request({url:t,method:e,data:n,header:o,success:P=>h(P),fail:P=>D(P)})});if(s==="alipay")return new Promise((h,D)=>{my.request({url:t,method:e,data:n,headers:o,success:P=>h(P),fail:P=>D(P)})});let l=e.toUpperCase()==="GET",p=l&&n&&Object.keys(n).length?`${t}?${new URLSearchParams(n).toString()}`:t;return fetch(p,{method:e,headers:o,body:l?void 0:JSON.stringify(n)}).then(async h=>({statusCode:h.status,data:await h.json()}))},jn=class{constructor(e=null){be(this,"staticConfig");this.staticConfig=e}getCurrentConfig(){return this.staticConfig||Xt()||Qe}async getAuthToken(){let e=this.getCurrentConfig();if(e.getAuthToken&&typeof e.getAuthToken=="function")try{let n=await e.getAuthToken();return n?(v.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),n):(v.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(n){return v.error("\u83B7\u53D6Token\u5931\u8D25",n),null}return null}async buildHeader(e={},n=!0){let o=F({"content-type":"application/json"},e);if(!n)return o;let s=await this.getAuthToken();if(!s)throw{code:"AUTH_TOKEN_REQUIRED",message:"\u5F53\u524D\u63A5\u53E3\u9700\u8981 token\uFF0C\u8BF7\u5728\u7528\u6237\u767B\u5F55\u6210\u529F\u540E\u8C03\u7528 nova.setToken(token) \u6216 \u76F4\u63A5createServices\u65F6\u4F20\u5165getAuthToken"};return o.Authorization_bar=s,o}async request(e){let{path:n,method:o="POST",data:s={},header:l={},authRequired:p=!0,baseDomain:h,beforeRequest:D,afterResponse:P}=e,q=h?`${h}${n}`:Ke(this.getCurrentConfig().env||"prod",n),N=await this.buildHeader(l,p);D&&typeof D=="function"&&await D({url:q,method:o,data:s,header:N}),v.info(`\u53D1\u8D77${o}\u8BF7\u6C42:`,{path:n,method:o});try{let G=await Zo(q,o,s,N);return v.info("\u8BF7\u6C42\u6210\u529F:",{path:n,statusCode:G.statusCode}),P&&typeof P=="function"&&await P(G.data),G.data}catch(G){throw v.error("\u8BF7\u6C42\u5931\u8D25:",{path:n,error:G}),G}}get(e,n={},o={}){return this.request(F({path:e,method:"GET",data:n},o))}post(e,n={},o={}){return this.request(F({path:e,method:"POST",data:n},o))}},fe=(t=null)=>new jn(t);var ta=(function(){"use strict";function t(T,J){var ct=(65535&T)+(65535&J);return(T>>16)+(J>>16)+(ct>>16)<<16|65535&ct}function e(T,J,ct,st,X,wt){return t((wt=t(t(J,T),t(st,wt)))<<X|wt>>>32-X,ct)}function n(T,J,ct,st,X,wt,C){return e(J&ct|~J&st,T,J,X,wt,C)}function o(T,J,ct,st,X,wt,C){return e(J&st|ct&~st,T,J,X,wt,C)}function s(T,J,ct,st,X,wt,C){return e(J^ct^st,T,J,X,wt,C)}function l(T,J,ct,st,X,wt,C){return e(ct^(J|~st),T,J,X,wt,C)}function p(T,J){var ct,st,X,wt;T[J>>5]|=128<<J%32,T[14+(J+64>>>9<<4)]=J;for(var C=1732584193,U=-271733879,M=-1732584194,Y=271733878,S=0;S<T.length;S+=16)C=n(ct=C,st=U,X=M,wt=Y,T[S],7,-680876936),Y=n(Y,C,U,M,T[S+1],12,-389564586),M=n(M,Y,C,U,T[S+2],17,606105819),U=n(U,M,Y,C,T[S+3],22,-1044525330),C=n(C,U,M,Y,T[S+4],7,-176418897),Y=n(Y,C,U,M,T[S+5],12,1200080426),M=n(M,Y,C,U,T[S+6],17,-1473231341),U=n(U,M,Y,C,T[S+7],22,-45705983),C=n(C,U,M,Y,T[S+8],7,1770035416),Y=n(Y,C,U,M,T[S+9],12,-1958414417),M=n(M,Y,C,U,T[S+10],17,-42063),U=n(U,M,Y,C,T[S+11],22,-1990404162),C=n(C,U,M,Y,T[S+12],7,1804603682),Y=n(Y,C,U,M,T[S+13],12,-40341101),M=n(M,Y,C,U,T[S+14],17,-1502002290),C=o(C,U=n(U,M,Y,C,T[S+15],22,1236535329),M,Y,T[S+1],5,-165796510),Y=o(Y,C,U,M,T[S+6],9,-1069501632),M=o(M,Y,C,U,T[S+11],14,643717713),U=o(U,M,Y,C,T[S],20,-373897302),C=o(C,U,M,Y,T[S+5],5,-701558691),Y=o(Y,C,U,M,T[S+10],9,38016083),M=o(M,Y,C,U,T[S+15],14,-660478335),U=o(U,M,Y,C,T[S+4],20,-405537848),C=o(C,U,M,Y,T[S+9],5,568446438),Y=o(Y,C,U,M,T[S+14],9,-1019803690),M=o(M,Y,C,U,T[S+3],14,-187363961),U=o(U,M,Y,C,T[S+8],20,1163531501),C=o(C,U,M,Y,T[S+13],5,-1444681467),Y=o(Y,C,U,M,T[S+2],9,-51403784),M=o(M,Y,C,U,T[S+7],14,1735328473),C=s(C,U=o(U,M,Y,C,T[S+12],20,-1926607734),M,Y,T[S+5],4,-378558),Y=s(Y,C,U,M,T[S+8],11,-2022574463),M=s(M,Y,C,U,T[S+11],16,1839030562),U=s(U,M,Y,C,T[S+14],23,-35309556),C=s(C,U,M,Y,T[S+1],4,-1530992060),Y=s(Y,C,U,M,T[S+4],11,1272893353),M=s(M,Y,C,U,T[S+7],16,-155497632),U=s(U,M,Y,C,T[S+10],23,-1094730640),C=s(C,U,M,Y,T[S+13],4,681279174),Y=s(Y,C,U,M,T[S],11,-358537222),M=s(M,Y,C,U,T[S+3],16,-722521979),U=s(U,M,Y,C,T[S+6],23,76029189),C=s(C,U,M,Y,T[S+9],4,-640364487),Y=s(Y,C,U,M,T[S+12],11,-421815835),M=s(M,Y,C,U,T[S+15],16,530742520),C=l(C,U=s(U,M,Y,C,T[S+2],23,-995338651),M,Y,T[S],6,-198630844),Y=l(Y,C,U,M,T[S+7],10,1126891415),M=l(M,Y,C,U,T[S+14],15,-1416354905),U=l(U,M,Y,C,T[S+5],21,-57434055),C=l(C,U,M,Y,T[S+12],6,1700485571),Y=l(Y,C,U,M,T[S+3],10,-1894986606),M=l(M,Y,C,U,T[S+10],15,-1051523),U=l(U,M,Y,C,T[S+1],21,-2054922799),C=l(C,U,M,Y,T[S+8],6,1873313359),Y=l(Y,C,U,M,T[S+15],10,-30611744),M=l(M,Y,C,U,T[S+6],15,-1560198380),U=l(U,M,Y,C,T[S+13],21,1309151649),C=l(C,U,M,Y,T[S+4],6,-145523070),Y=l(Y,C,U,M,T[S+11],10,-1120210379),M=l(M,Y,C,U,T[S+2],15,718787259),U=l(U,M,Y,C,T[S+9],21,-343485551),C=t(C,ct),U=t(U,st),M=t(M,X),Y=t(Y,wt);return[C,U,M,Y]}function h(T){for(var J="",ct=32*T.length,st=0;st<ct;st+=8)J+=String.fromCharCode(T[st>>5]>>>st%32&255);return J}function D(T){var J=[];for(J[(T.length>>2)-1]=void 0,st=0;st<J.length;st+=1)J[st]=0;for(var ct=8*T.length,st=0;st<ct;st+=8)J[st>>5]|=(255&T.charCodeAt(st/8))<<st%32;return J}function P(T){for(var J,ct="0123456789abcdef",st="",X=0;X<T.length;X+=1)J=T.charCodeAt(X),st+=ct.charAt(J>>>4&15)+ct.charAt(15&J);return st}function q(T){return unescape(encodeURIComponent(T))}function N(T){return h(p(D(T=q(T)),8*T.length))}function G(T,J){return(function(ct,st){var X,wt=D(ct),C=[],U=[];for(C[15]=U[15]=void 0,16<wt.length&&(wt=p(wt,8*ct.length)),X=0;X<16;X+=1)C[X]=909522486^wt[X],U[X]=1549556828^wt[X];return st=p(C.concat(D(st)),512+8*st.length),h(p(U.concat(st),640))})(q(T),q(J))}function pt(T,J,ct){return J?ct?G(J,T):P(G(J,T)):ct?N(T):P(N(T))}return pt})(),on=ta;function Gr(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function Br(t){if(typeof t!="object"||t===null)return t;let e=Object.keys(t).sort(),n={};for(let o of e)n[o]=t[o];return JSON.stringify(n)}function kr(t,e){let n={appId:t.appId,randomStr:t.randomStr,data:t.data},o=Object.keys(n).sort(),s="";for(let[l,p]of o.entries())s+=`${p}=${n[p]}`,l<o.length-1&&(s+="&");return s+=`&secretKey=${e}`,on(s)}var ea=(t,e,n,o)=>{let s=le();return s==="taro"?Taro.request({url:t,method:e,data:n,header:o}).then(l=>l):s==="uni"?new Promise((l,p)=>{uni.request({url:t,method:e,data:n,header:o,success:h=>l(h),fail:h=>p(h)})}):s==="wechat"?new Promise((l,p)=>{wx.request({url:t,method:e,data:n,header:o,success:h=>l(h),fail:h=>p(h)})}):s==="alipay"?new Promise((l,p)=>{my.request({url:t,method:e,data:n,headers:o,success:h=>l(h),fail:h=>p(h)})}):fetch(t,{method:e,headers:o,body:JSON.stringify(n)}).then(async l=>({statusCode:l.status,data:await l.json()}))},Kn=class{constructor(e=null){be(this,"staticConfig");this.staticConfig=e}getCurrentConfig(){return this.staticConfig||Xt()||{}}getExternalEnv(){var e;return((e=this.getCurrentConfig())==null?void 0:e.externalEnv)||Ie.PROD}getExternalHost(){let e=this.getExternalEnv();return rn[e]||rn.prod}generateSign(e={}){let n=this.getCurrentConfig(),{externalAppId:o,externalAppSecret:s}=n;if(!o||!s)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let l=Gr(),p=Br(e),h=kr({appId:o,randomStr:l,data:p},s);return{appId:o,randomStr:l,sign:h}}buildRequestBody(e={}){let n=this.generateSign(e);return It(F({},n),{data:e})}buildUrl(e){return`${this.getExternalHost()}${e}`}async request(e){let{path:n,method:o="POST",data:s={},header:l={},needSign:p=!0,beforeRequest:h,afterResponse:D}=e,P=this.buildUrl(n),q=F({"content-type":"application/json"},l),N=p?this.buildRequestBody(s):s;h&&typeof h=="function"&&await h({url:P,method:o,data:N,header:q}),v.info(`\u53D1\u8D77${o}\u8BF7\u6C42:`,{path:n,method:o});try{let G=await ea(P,o,N,q);if(v.info("\u8BF7\u6C42\u6210\u529F:",{path:n,statusCode:G.statusCode}),D&&typeof D=="function"&&await D(G.data),G.statusCode===200&&G.data.code===200)return G.data.data;throw{code:G.data.code,msg:G.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:G.data}}catch(G){throw(G==null?void 0:G.code)!==void 0?G:(v.error("\u8BF7\u6C42\u5931\u8D25:",{path:n,error:G}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:G})}}get(e,n={},o={}){return this.request(F({path:e,method:"GET",data:n},o))}post(e,n={},o={}){return this.request(F({path:e,method:"POST",data:n},o))}},bn=(t=null)=>new Kn(t);var Qn=fe(),Wn=bn();function Jr(t){let e=En(t==null?void 0:t.equipmentValue,"equipmentValue");return e.valid?Qn.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",t):Promise.reject({code:"PARAM_ERROR",message:e.message})}async function qr(t){let e=Ue(t,["idMd5Value","rtaStrategy"]);return e.valid?Wn.post("/open/rest/cpa/jd/rta-check",t):Promise.reject({code:"PARAM_ERROR",message:e.message})}async function Hr(t){try{let e={thirdPlatform:t.thirdPlatform,thirdPlatformUserId:t.thirdPlatformUserId,thirdPlatformEquipmentValue:t.thirdPlatformEquipmentValue,os:t.os,client:"wxMini"};t.phone&&(e.mobileMd5=on(t.phone)),t.extendData&&(Object.prototype.toString.call(t.extendData)==="[object Object]"?e.extendData=t.extendData:v.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let n=await Wn.post("/open/rest/cpa/jd/insurance/get",e);return n?{jumpMode:Number(n.jumpMode),appId:n.appId,url:n.url,channel:n.channelId}:void 0}catch(e){throw v.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",e),e}}function jr(t){let e=En(t==null?void 0:t.equipmentValue,"equipmentValue");return e.valid?Qn.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",t):Promise.reject({code:"PARAM_ERROR",message:e.message})}function Kr(t){let e=Ue(t,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return e.valid?Qn.post("/gw/advert/customer/cpa-activity/jd/rta/validate",t):Promise.reject({code:"PARAM_ERROR",message:e.message})}async function Qr(t){let e=await Fe(),n={thirdPlatform:t.thirdPlatform,thirdPlatformUserId:t.thirdPlatformUserId,thirdPlatformEquipmentValue:t.thirdPlatformEquipmentValue,os:e,client:t.client};return t.phone&&(n.mobileMd5=on(t.phone)),t.extendData&&(Object.prototype.toString.call(t.extendData)==="[object Object]"?n.extendData=t.extendData:v.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),Wn.post("/open/rest/cpa/jd/cash-loan/get",n)}async function Xn(t){let{phone:e,rtaId:n,equipmentId:o,lyyUserId:s,entrance:l}=t;if(!e)return E(Et.INVALID_PARAM,Ct[2001]);if(!o)return E(Et.INVALID_PARAM,Ct[2002]);try{if(n){v.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:e});let N=await Kr({phone:e,lyyEquipmentValue:o,lyyUserId:s||"",rtaId:n});if(N.code!=="0000000"||!N.body||N.body.state!=1)return v.error("RTA\u9A8C\u8BC1\u5931\u8D25",N),E(2003,Ct[2003]);v.info("RTA\u9A8C\u8BC1\u6210\u529F",N.body)}v.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:e});let p=await Fe(),h=await jr({phone:e,equipmentValue:o,os:p,entrance:l});if(h.code!=="0000000"||!h.body)return v.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",h),E(2004,Ct[2004]);let{appId:D,targetUrl:P}=h.body;if(!D||!P)return v.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:D,targetUrl:P}),E(2005,Ct[2005]);let q=E(Et.SUCCESS,"\u6210\u529F",{appId:D,targetUrl:P});return v.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",q),q}catch(p){return v.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",p),E(Et.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function zn(t){let{phone:e,rtaId:n,thirdPlatform:o,thirdPlatformUserId:s,thirdPlatformEquipmentValue:l}=t;if(!e)return E(Et.INVALID_PARAM,Ct[2001]);if(!o)return E(2008,Ct[2008]);if(!s)return E(2009,Ct[2009]);if(!l)return E(2010,Ct[2010]);try{if(n){v.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:e});let G=await qr({idMd5Value:e,rtaStrategy:n});if(G.status!=1)return v.error("RTA\u9A8C\u8BC1\u5931\u8D25",G),E(2003,Ct[2003]);v.info("RTA\u9A8C\u8BC1\u6210\u529F",G)}let p=await Qr(t),{url:h,channelId:D,matchFlag:P,jumpMode:q,appId:N}=p||{};return P?q===3?!N||!h?E(2007,Ct[2007]):E(Et.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:N,url:h}):E(2007,Ct[2007]):E(2006,Ct[2006])}catch(p){return v.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",p),E(Et.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var Xe=null,an=null;try{an=Xr()}catch(t){}function zr(){return Xe||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(Xe=globalThis.LyyGetCommandSDK,Xe):an?(Xe=an.LyyGetCommandSDK||an.default||an,Xe):null)}function $r(t){var n;v.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",t);let e=zr();e!=null&&e.getJrCommand?e.getJrCommand(t):(n=e==null?void 0:e.default)!=null&&n.getJrCommand?e.default.getJrCommand(t):(v.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),t.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function na(t,e){return new Promise((n,o)=>{try{$r({url:t,channel:e,callback:s=>{s.code==="0"?n(s.data):o({msg:s.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(s){o(s)}})}async function $n(t){try{let e=await Fe(),n=F({os:e},t);v.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",n);let{code:o,body:s}=await Jr(n);if(o==="0000000"&&s){let{url:l,channelId:p,matchFlag:h,jumpMode:D,appId:P}=s;if(!h)return E(2101,Ct[2101]);if(D===1)return v.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),E(2102,Ct[2102]);if(D===2)return le()==="web"&&v.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:l}),!l||!p?E(2103,Ct[2103]):new Promise(q=>{$r({url:l,channel:p,callback:async N=>{if((N==null?void 0:N.code)==="0")try{await Le(N==null?void 0:N.data),q(E(Et.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(G){q(E(2105,Ct[2105]))}else q(E(2105,Ct[2105]))}})});if(D===3)return!P||!l?E(2103,Ct[2103]):E(Et.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:P,path:l})}return E(2104,Ct[2104])}catch(e){return v.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",e),E(Et.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function Zn(t){v.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let e=await Hr(It(F({},t),{os:await Fe()}));if(!e)return v.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),E(2106,Ct[2106]);let{jumpMode:n,appId:o,url:s,channel:l}=e;if(n===1)return s?(v.info("H5\u8DF3\u8F6C\u6A21\u5F0F",{url:s}),E(Et.SUCCESS,"\u6210\u529F",{type:"h5",url:s})):(v.error("H5\u8DF3\u8F6C\u53C2\u6570\u4E0D\u5B8C\u6574:",{jumpMode:n,url:s}),E(2103,Ct[2103]));if(n===3)return!o||!s?(v.error("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u53C2\u6570\u4E0D\u5B8C\u6574:",{jumpMode:n,appId:o,url:s}),E(2103,Ct[2103])):(v.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{jumpMode:n,appId:o,url:s}),E(Et.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:o,path:s}));if(n===2){if(le()==="web")return v.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:s}),E(Et.SUCCESS,"\u6210\u529F",{type:"h5",url:s});try{let p=await na(s,l);return await Le(p),v.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),E(Et.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(p){return v.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",p),kn("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),E(2105,Ct[2105])}}return v.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",n),E(2107,Ct[2107])}catch(e){let n=typeof e=="string"?e:(e==null?void 0:e.msg)||(e==null?void 0:e.message)||"\u672A\u77E5\u9519\u8BEF";return v.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",n),kn("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),n.includes("RTA")||n.includes("\u8D44\u683C")?E(2108,Ct[2108]):E(Et.NETWORK_ERROR,n)}}var ar={};we(ar,{DyErrorCode:()=>De,getDyPayRtaData:()=>Rn,handleDyAuthDebitSignFlow:()=>ir,handleDyAuthDebitSignFlowWithRawPayInfo:()=>or,handleDyJsapiPayFlow:()=>rr,handleDyPayCommandFlow:()=>nr,handleDyPayFlow:()=>Tn});var ra=["weapp","h5"],ia=["h5","ulink","jsapi"],oa=["switchTab","reLaunch","redirectTo","navigateTo"];function aa(t){return ra.includes(t)}function ua(t){return ia.includes(t)}function sa(t){return oa.includes(t)}function Zr(t){let e=t.returnType||"h5";return!t.telephone&&e==="h5"?{valid:!1,errorCode:3001}:t.price?t.equipmentValue?t.businessType?t.client&&!aa(t.client)?{valid:!1,errorCode:3004}:ua(e)?t.douyinOrderExtendData&&typeof t.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:t.backWay&&t.client==="weapp"&&!sa(t.backWay)?{valid:!1,errorCode:3016}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3018}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}}function ti(t){return t.price?t.equipmentValue?t.businessType?t.douyinOrderExtendData&&typeof t.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}}function ei(t){return t.equipmentValue?{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function ni(t){return t.equipmentValue?t.orderAmount?t.businessType?t.commandUrl!=null&&typeof t.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3031}:{valid:!1,errorCode:3002}}function ri(t){return t.equipmentValue?t.commandUrl!=null&&typeof t.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function ii(t){return t.showFlag===!0&&typeof t.payAmount=="number"&&t.payAmount>0&&typeof t.businessType=="number"&&t.businessType>0}var xe=fe();async function oi(t){let{price:e,equipmentValue:n,douyinOrderExtendData:o,douyinCommodityVirtualFlag:s,businessType:l,platformActivities:p={}}=t,h={businessType:l,equipmentValue:n,payInfoBusinessType:"commonDouyinPayment",platformActivities:F({douyinCommodityVirtualFlag:s||!1,douyinCommodityPrice:e,douyinOrderExtendData:o||""},p)};try{let D=await xe.post("/gw/advert/customer/payment/pay-info",h);return D.code!=="0000000"||!(D!=null&&D.body)?Promise.reject({code:3006,message:D.message||at[3006]}):(D.body.platformActivities=h.platformActivities,D)}catch(D){return v.error("getDyOrderAmountFn error:",D),Promise.reject({code:3007,message:at[3007]})}}async function ai(t){var e,n,o,s;try{let l=t.commodityList.map(pt=>(pt.commodity=pt.commodityId,delete pt.commodityId,pt.quantity=pt.quantity||1,pt)),p=t.advertExtendInfo&&Object.keys(t.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:t.advertExtendInfo}):"",h=le(),D="";h==="wechat"?D="wechatMini":h==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(D="wechatHtml");let P=t.returnType==="jsapi",q=P?22:21,N=F(F(F({businessType:t.businessType,fixedClientType:q,channelCode:null,douyinData:F(F({loginMobile:t.telephone||""},((e=t.jsapiInfo)==null?void 0:e.outProductCategory)!=null?{outProductCategory:t.jsapiInfo.outProductCategory}:{}),((n=t.jsapiInfo)==null?void 0:n.requestId)!=null?{requestId:t.jsapiInfo.requestId}:{}),equipmentUseFlag:!1,payEquipmentDTO:{equipmentValue:t.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:p,transType:5,actualFee:t.totalFee,totalFee:t.totalFee,commodityList:l,clientSourceDetailType:D,platformActivities:t.platformActivities||{}},t.commoditySign&&{commoditySign:t.commoditySign}),t.unifiedOrderExtendData&&F({},t.unifiedOrderExtendData)),P?{appId:((o=t.jsapiInfo)==null?void 0:o.appId)||"",openId:((s=t.jsapiInfo)==null?void 0:s.douyinOpenId)||""}:{});if(t.returnType=="ulink")return delete N.channelCode,N;let G=await xe.post("/gw/payment-bff/unified/order",N);return G.code!=="0000000"||!(G!=null&&G.body)?Promise.reject({code:3008,message:G.message||at[3008]}):G}catch(l){return v.error("dyUnifiedOrderFn error:",l),Promise.reject({code:3009,message:at[3009]})}}async function ui(t){let e={equipmentValue:t.equipmentValue,phone:t.telephone||""};t.price&&(e.orderAmount=t.price);try{let n=await xe.post("/gw/advert/customer/douyin/pay/check",e);return n.code!=="0000000"||!(n!=null&&n.body)?Promise.reject({code:3013,message:n.message||at[3013]}):n}catch(n){return v.error("getDyPayRtaData error:",n),Promise.reject({code:3014,message:(n==null?void 0:n.message)||at[3014]})}}async function si(t={}){var e;try{let n=(e=t.requestNo)==null?void 0:e.trim(),o=n?`/gw/advert/customer/douyin/pay/jsapi/info?requestNo=${n}`:"/gw/advert/customer/douyin/pay/jsapi/info",s=await xe.get(o);return s.code!=="0000000"||!(s!=null&&s.body)?Promise.reject({code:3019,message:s.message||at[3019]}):{appId:s.body.appId,douyinOpenId:s.body.douyinOpenId,outProductCategory:s.body.outProductCategory,requestId:s.body.requestId}}catch(n){return v.error("getDyPayJsapiInfoFn error:",n),Promise.reject({code:(n==null?void 0:n.code)||3020,message:(n==null?void 0:n.message)||at[3020]})}}async function Ye(t){try{let e=await xe.post("/gw/advert/customer/douyin/pay/jsapi/signature",t);return e.code!=="0000000"||!(e!=null&&e.body)||!e.body.signature||!e.body.timestamp||!e.body.nonceStr?Promise.reject({code:3023,message:e.message||at[3023]}):{signature:e.body.signature,timestamp:e.body.timestamp,nonceStr:e.body.nonceStr}}catch(e){return v.error("getDyPayJsapiSignatureFn error:",e),Promise.reject({code:(e==null?void 0:e.code)||3024,message:(e==null?void 0:e.message)||at[3024]})}}async function ci(t){try{let e=await xe.post("/gw/advert/customer/douyin/pay-command",t);return e.code!=="0000000"||!(e!=null&&e.body)?Promise.reject({code:3032,message:e.message||at[3032]}):e}catch(e){return v.error("getDyPayCommandFn error:",e),Promise.reject({code:(e==null?void 0:e.code)||3033,message:(e==null?void 0:e.message)||at[3033]})}}async function ze(t){try{let e=await xe.post("/gw/advert/customer/automatic-debit/sign/request-id",{requestId:t});return e.code!=="0000000"||!(e!=null&&e.body)?Promise.reject({code:3037,message:e.message||at[3037]}):e.body}catch(e){return v.error("dyAutomaticDebitSignByRequestIdFn error:",e),Promise.reject({code:(e==null?void 0:e.code)||3038,message:(e==null?void 0:e.message)||at[3038]})}}var ca="/auth/rest/auth/third",pi="url_token",la="https://unpkg.byted-static.com/bridge/douyin_open/1.0.17/lib/douyin_open.umd.js",un=null,da="-2",fa="1",pa="0";function Gt(t,e){let n=new Error(e||at[t]);return Object.assign(n,{code:t})}function _i(t){var n;let e=(n=t==null?void 0:t.data)==null?void 0:n.code;return e!=null?String(e):typeof(t==null?void 0:t.code)=="string"?t.code:""}function li(t){return String(t==null?void 0:t.code)===da}function di(t){return _i(t)===fa}function fi(t){var e,n;return((e=t==null?void 0:t.data)==null?void 0:e.msg)||((n=t==null?void 0:t.data)==null?void 0:n.message)||(t==null?void 0:t.message)||(t==null?void 0:t.errMsg)}function sn(){return typeof window!="undefined"&&typeof document!="undefined"}function er(){return sn()?window.location.href:""}function Te(t){let e=t.href||er();if(!t.key||!e)return"";try{let n=new URL(e,Ai()),o=n.searchParams.get(t.key);return o!=null?o:_a(n.hash,t.key)}catch(n){return v.warn("getDyUrlParam parse error:",n),""}}function _a(t,e){if(!t||!e)return"";let n=t.indexOf("?");if(n<0)return"";let o=t.slice(n+1).split("#")[0];return new URLSearchParams(o).get(e)||""}function mi(t){let{href:e,paramName:n}=t;if(!e||!n)return e;let o=e.indexOf("#"),s=o>=0?e.slice(0,o):e,l=o>=0?e.slice(o):"";try{let p=new URL(s,Ai()),h=ya(s);return p.searchParams.delete(n),`${h?`${p.pathname}${p.search}`:p.toString()}${yi(l,n)}`}catch(p){return v.warn("removeDyUrlParam parse error:",p),ga(e,n)}}function yi(t,e){if(!t||!e)return t;let n=t.indexOf("?");if(n<0)return t;let o=t.slice(0,n),s=t.slice(n+1),l=s.indexOf("#"),p=l>=0?s.slice(0,l):s,h=l>=0?s.slice(l):"",D=new URLSearchParams(p);D.delete(e);let P=D.toString();return`${o}${P?`?${P}`:""}${h}`}function Ve(t={}){let n=(t.href||er()).split("#")[0]||"";return mi({href:n,paramName:t.tokenParamName||pi})}function ma(t){var s,l;let e=t.tokenParamName||pi,n=mi({href:t.redirectUrl||er(),paramName:e});if(!n)throw Gt(3025);let o=new URLSearchParams({useAgent:t.useAgent||"douyin",category:t.category||"pay",internal:String((s=t.internal)!=null?s:!1),silent:String((l=t.silent)!=null?l:!1),redirectUrl:n});return t.equipmentValue&&o.set("equipmentValue",t.equipmentValue),`${t.authPath||ca}?${o.toString()}`}function cn(t){if(!sn())throw Gt(3025);let e=ma(t);v.info("\u8DF3\u8F6C\u6296\u97F3\u6388\u6743:",{authUrl:e,equipmentValue:t.equipmentValue});try{return window.location.href=e,e}catch(n){throw v.error("redirectDyAuth error:",n),Gt(3026)}}function $e(){if(!sn())return null;let t=window;return t.DouyinOpenJSBridge||t.douyin_open||null}function Me(t={}){if(!sn())return Promise.reject(Gt(3025));let e=$e();if(e)return v.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5DF2\u52A0\u8F7D"),Promise.resolve(e);if(un)return v.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u590D\u7528\u52A0\u8F7D\u4E2D\u4EFB\u52A1"),un;let n=t.sdkUrl||la;return v.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5F00\u59CB\u52A0\u8F7D",{sdkUrl:n}),un=new Promise((o,s)=>{let l=Aa(n),p=()=>{let P=$e();if(!P){s(Gt(3027));return}v.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u6210\u529F"),o(P)},h=P=>{v.error("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u5931\u8D25",P),s(Gt(3027))};if(l){if(v.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u811A\u672C\u5DF2\u5B58\u5728"),ha(l)){window.setTimeout(p,0);return}l.addEventListener("load",p,{once:!0}),l.addEventListener("error",h,{once:!0});return}let D=document.createElement("script");D.src=n,D.async=!0,D.addEventListener("load",p,{once:!0}),D.addEventListener("error",P=>{D.remove(),h(P)},{once:!0}),document.head.appendChild(D)}).catch(o=>{throw un=null,o}),un}function Ge(t){let e=t.sdk||$e();if(!e)return Promise.reject(Gt(3027));let{appId:n,signatureData:o,url:s}=t;return!n||!s||!(o!=null&&o.signature)||!(o!=null&&o.timestamp)||!(o!=null&&o.nonceStr)?Promise.reject(Gt(3028)):new Promise((l,p)=>{v.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u5F00\u59CB\u914D\u7F6E",{appId:n,url:s});try{e.config({params:{client_key:n,signature:o.signature,timestamp:String(o.timestamp),nonce_str:o.nonceStr,url:s}}),e.ready(()=>{v.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5B8C\u6210"),l(e)}),e.error(h=>{v.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5931\u8D25",h),p(Gt(3028))})}catch(h){v.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5F02\u5E38",h),p(Gt(3028))}})}function ln(t){let e=t.sdk||$e();if(!e)return Promise.reject(Gt(3027));if(!e.ttcjpay||typeof e.ttcjpay.dypay!="function")return Promise.reject(Gt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));let{appId:n,payInfo:o}=t;if(!n||!o)return Promise.reject(Gt(3021));let s={appId:n,timeStamp:String(o.timeStamp),nonceStr:o.nonceStr,package:o.package,signType:o.signType,paySign:o.paySign};return new Promise((l,p)=>{v.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528 dypay");try{e.ttcjpay.dypay({sdk_info:JSON.stringify(s),success:h=>{if(v.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u6210\u529F\u56DE\u8C03",h),li(h)){p(Gt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(di(h)){p(Gt(3039));return}let D=_i(h);if(D&&D!==pa){p(Gt(3029,fi(h)));return}l(h)},fail:h=>{if(v.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u5931\u8D25\u56DE\u8C03",h),li(h)){p(Gt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(di(h)){p(Gt(3039));return}p(Gt(3029,fi(h)))}})}catch(h){v.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528\u5F02\u5E38",h),p(Gt(3029,h==null?void 0:h.message))}})}function Ai(){return sn()?window.location.origin:"https://bi-nova.local"}function ya(t){return!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t)&&!t.startsWith("//")}function Aa(t){return Array.from(document.getElementsByTagName("script")).find(n=>n.src===t)||null}function ha(t){let e=t.readyState;return e==="loaded"||e==="complete"}function ga(t,e){let n=t.indexOf("#"),o=n>=0?t.slice(0,n):t,s=n>=0?t.slice(n):"",l=o.indexOf("?");if(l<0)return t;let p=o.slice(0,l),D=o.slice(l+1).split("&").filter(P=>P&&decodeURIComponent(P.split("=")[0])!==e).join("&");return`${p}${D?`?${D}`:""}${yi(s,e)}`}async function Tn(t){var n,o,s,l;let e=Zr(t);if(!e.valid)return E(e.errorCode,at[e.errorCode]);try{let p=t.returnType||"h5",h=await oi({price:t.price,equipmentValue:t.equipmentValue,businessType:t.businessType,douyinOrderExtendData:(t==null?void 0:t.douyinOrderExtendData)||"",platformActivities:(t==null?void 0:t.platformActivities)||{},douyinCommodityVirtualFlag:(t==null?void 0:t.douyinCommodityVirtualFlag)||!1}),D=p==="jsapi"?await si({requestNo:Te({key:"requestNo"})}):void 0,P=await ai(It(F(It(F({},h.body),{telephone:t.telephone,equipmentValue:t.equipmentValue,businessType:t.businessType}),t.unifiedOrderExtendData&&{unifiedOrderExtendData:t.unifiedOrderExtendData}),{returnType:p,jsapiInfo:D}));if(t.returnType==="ulink")return E(0,"success",{ulinkQueryParams:P});let q=((n=P==null?void 0:P.body)==null?void 0:n.h5Url)||"",N=((o=P==null?void 0:P.body)==null?void 0:o.outTradeNo)||"";if(p==="jsapi"){let pt=gi((s=P==null?void 0:P.body)==null?void 0:s.payInfo);return E(0,"success",{appId:(D==null?void 0:D.appId)||"",payInfo:pt,outTradeNo:N})}let G=q?await Ia(It(F({},t),{dyUrl:q})):"";return G?E(0,"success",{h5Url:G,outTradeNo:N}):E(3010,at[3010])}catch(p){v.error("handleDyPayFlow error:",p);let h=(l=p==null?void 0:p.code)!=null?l:3012,D=(p==null?void 0:p.message)||at[3012];return E(h,D)}}function gi(t){if(!t)throw{code:3021,message:at[3021]};if(typeof t=="object"){if(hi(t))return t;throw{code:3022,message:at[3022]}}try{let e=JSON.parse(t);if(!hi(e))throw new Error("invalid payInfo fields");return e}catch(e){throw{code:3022,message:at[3022],error:e}}}function hi(t){return typeof t.timeStamp=="string"&&t.timeStamp!==""&&typeof t.nonceStr=="string"&&t.nonceStr!==""&&typeof t.package=="string"&&t.package!==""&&typeof t.signType=="string"&&t.signType!==""&&typeof t.paySign=="string"&&t.paySign!==""}async function Ia(t){let e=Xt(),n=Ke(e.env||"prod",""),o=typeof e.getAuthToken=="function"?await e.getAuthToken():"",s=t.client||"weapp";return`${n}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${s}&equipmentId=${t.equipmentValue}&dyUrl=${t.dyUrl}&fromUrl=${encodeURIComponent(t.fromUrl||"")}&backUrl=${encodeURIComponent(t.backUrl||"")}&backWay=${t.backWay||""}&url_token=${o}`}async function Rn(t){var n;let e=ei(t);if(!e.valid)return E(e.errorCode,at[e.errorCode]);try{let o=await ui({price:(t==null?void 0:t.price)||"",equipmentValue:t.equipmentValue,telephone:(t==null?void 0:t.telephone)||""});return E(0,"success",o.body)}catch(o){v.error("getDyPayRtaData error:",o);let s=(n=o==null?void 0:o.code)!=null?n:3015,l=(o==null?void 0:o.message)||at[3015];return E(s,l)}}async function Ii(t){var n,o;let e=ni(t);if(!e.valid)return E(e.errorCode,at[e.errorCode]);try{let s=(n=t.commandUrl)==null?void 0:n.trim(),p=(await ci(F({phone:t.telephone||"",equipmentValue:t.equipmentValue,orderAmount:t.orderAmount,businessType:t.businessType},s?{commandUrl:s}:{}))).body||"";return p?E(0,"success",{command:p}):E(3032,at[3032])}catch(s){v.error("getDyPayCommand error:",s);let l=(o=s==null?void 0:s.code)!=null?o:3033,p=(s==null?void 0:s.message)||at[3033];return E(l,p)}}async function Da(t){var n;let e=await Ii(t);if(e.code!==0||!((n=e.data)!=null&&n.command))return E(e.code,e.message);try{return await Le(e.data.command),E(0,"success",F({type:"copy_success"},t.returnCommand?{command:e.data.command}:{}))}catch(o){return v.error("copyDyPayCommand error:",o),E(3034,at[3034])}}async function nr(t){var n,o,s;let e=ri(t);if(!e.valid)return E(e.errorCode,at[e.errorCode]);try{let l=await Rn({telephone:t.telephone||"",equipmentValue:t.equipmentValue,price:t.price});if(l.code!==0)return E(l.code,l.message);let p=l.data;if(!(p!=null&&p.showFlag))return E(0,"success",{eligible:!1,type:"not_eligible"});if(!ii(p))return E(3035,at[3035]);let h={telephone:t.telephone||"",equipmentValue:t.equipmentValue,orderAmount:p.payAmount,businessType:p.businessType,commandUrl:t.commandUrl};if(t.autoCopy){let P=await Da(It(F({},h),{returnCommand:t.returnCommand}));return P.code!==0?E(P.code,P.message):E(0,"success",F({eligible:!0,type:"copy_success"},(n=P.data)!=null&&n.command?{command:P.data.command}:{}))}let D=await Ii(h);return D.code!==0||!((o=D.data)!=null&&o.command)?E(D.code,D.message):E(0,"success",{eligible:!0,type:"command",command:D.data.command})}catch(l){v.error("handleDyPayCommandFlow error:",l);let p=(s=l==null?void 0:l.code)!=null?s:3033,h=(l==null?void 0:l.message)||at[3033];return E(p,h)}}async function rr(t){var n,o,s;let e=ti(t);if(!e.valid)return E(e.errorCode,at[e.errorCode]);try{let l=Xt(),p=t.authToken||(typeof l.getAuthToken=="function"?await l.getAuthToken():""),h=t.autoAuth!==!1;if(!p){if(!h)return E(3030,at[3030]);let pt=cn({equipmentValue:t.equipmentValue,redirectUrl:t.redirectUrl,tokenParamName:t.tokenParamName});return E(0,"redirecting",{type:"auth_redirect",authUrl:pt})}let D=await Me({sdkUrl:t.sdkUrl}),P=await Tn(It(F({},t),{client:"h5",returnType:"jsapi"}));if(P.code!==0||!((n=P.data)!=null&&n.appId)||!((o=P.data)!=null&&o.payInfo))return E(P.code||3021,P.message||at[3021]);let q=t.signatureUrl||Ve({tokenParamName:t.tokenParamName}),N=await Ye({url:q});await Ge({appId:P.data.appId,signatureData:N,url:q,sdk:D});let G=await ln({appId:P.data.appId,payInfo:P.data.payInfo,sdk:D});return E(0,"success",{type:"pay_result",outTradeNo:P.data.outTradeNo,payResult:G})}catch(l){v.error("handleDyJsapiPayFlow error:",l);let p=(s=l==null?void 0:l.code)!=null?s:3029,h=(l==null?void 0:l.message)||at[3029];return E(p,h)}}async function ir(){var s;let t="url_token",e=Xt(),o=(typeof e.getAuthToken=="function"?await e.getAuthToken():"")||Te({key:t});try{if(!o){let pt=Te({key:"equipmentValue"}),T=cn(F({tokenParamName:t},pt?{equipmentValue:pt}:{}));return E(0,"redirecting",{type:"auth_redirect",authUrl:T})}let l=Te({key:"requestId"}).trim();if(!l)return E(3036,at[3036]);let p=await Me(),h=await ze(l),D=h.appId||h.appid||"",P=gi(h.payInfo);if(!D)return E(3021,at[3021]);let q=Ve({tokenParamName:t}),N=await Ye(F({url:q},D?{appid:D}:{}));await Ge({appId:D,signatureData:N,url:q,sdk:p});let G=await ln({appId:D,payInfo:P,sdk:p});return E(0,"success",{type:"sign_result",orderNo:h.orderNo,payResult:G})}catch(l){v.error("handleDyAuthDebitSignFlow error:",l);let p=(s=l==null?void 0:l.code)!=null?s:3029,h=(l==null?void 0:l.message)||at[3029];return E(p,h)}}var Pa="-2",Ea="1",Sa="0";function ue(t,e){let n=new Error(e||at[t]);return Object.assign(n,{code:t})}function Si(t){var n;let e=(n=t==null?void 0:t.data)==null?void 0:n.code;return e!=null?String(e):typeof(t==null?void 0:t.code)=="string"?t.code:""}function Di(t){return String(t==null?void 0:t.code)===Pa}function Pi(t){return Si(t)===Ea}function Ei(t){var e,n;return((e=t==null?void 0:t.data)==null?void 0:e.msg)||((n=t==null?void 0:t.data)==null?void 0:n.message)||(t==null?void 0:t.message)||(t==null?void 0:t.errMsg)}function ba(t){if(typeof t=="string"){if(!t.trim())throw ue(3021);return t}if(!t||typeof t!="object")throw ue(3021);let e=JSON.stringify(t);if(!e)throw ue(3022);return e}function Ta(t){let e=t.sdk||$e();if(!e)return Promise.reject(ue(3027));if(!e.ttcjpay||typeof e.ttcjpay.dypay!="function")return Promise.reject(ue(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));let n="";try{n=ba(t.payInfo)}catch(o){return Promise.reject(o!=null&&o.code?o:ue(3022,o==null?void 0:o.message))}return new Promise((o,s)=>{v.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20 dypay");try{e.ttcjpay.dypay({sdk_info:n,success:l=>{if(v.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20\u6210\u529F\u56DE\u8C03",l),Di(l)){s(ue(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(Pi(l)){s(ue(3039));return}let p=Si(l);if(p&&p!==Sa){s(ue(3029,Ei(l)));return}o(l)},fail:l=>{if(v.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20\u5931\u8D25\u56DE\u8C03",l),Di(l)){s(ue(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(Pi(l)){s(ue(3039));return}s(ue(3029,Ei(l)))}})}catch(l){v.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20\u8C03\u7528\u5F02\u5E38",l),s(ue(3029,l==null?void 0:l.message))}})}async function or(){var s;let t="url_token",e=Xt(),o=(typeof e.getAuthToken=="function"?await e.getAuthToken():"")||Te({key:t});try{if(!o){let G=Te({key:"equipmentValue"}),pt=cn(F({tokenParamName:t},G?{equipmentValue:G}:{}));return E(0,"redirecting",{type:"auth_redirect",authUrl:pt})}let l=Te({key:"requestId"}).trim();if(!l)return E(3036,at[3036]);let p=await Me(),h=await ze(l),D=h.appId||h.appid||"";if(!D)return E(3021,at[3021]);let P=Ve({tokenParamName:t}),q=await Ye({url:P,appid:D});await Ge({appId:D,signatureData:q,url:P,sdk:p});let N=await Ta({payInfo:h.payInfo,sdk:p});return E(0,"success",{type:"sign_result",orderNo:h.orderNo,payResult:N})}catch(l){v.error("handleDyAuthDebitSignFlowWithRawPayInfo error:",l);let p=(s=l==null?void 0:l.code)!=null?s:3029,h=(l==null?void 0:l.message)||at[3029];return E(p,h)}}var pr={};we(pr,{getDisplayAdConfig:()=>dn,getProductConfig:()=>fr,normalizeDisplayAdData:()=>vn,normalizeProductConfig:()=>Ze});var bi=fe();function Ti(t){let e=Ue(t,["placementId"]);if(!e.valid)return Promise.reject({code:"PARAM_ERROR",message:e.message});let n=Xt().env||"prod",o=Number.isInteger(t.userId)&&Number(t.userId)>0?{userId:t.userId}:{};return bi.get(`/gw/advert-plugin/api/v1/config/list/valid/${t.placementId}`,o,{authRequired:!1,baseDomain:Bn(n)})}function Ri(t){let e=typeof(t==null?void 0:t.id)=="number"?Number.isInteger(t.id)&&t.id>0?String(t.id):"":String((t==null?void 0:t.id)||"").trim();if(!e)return Promise.reject({code:"PARAM_ERROR",message:"id \u5FC5\u987B\u4E3A\u975E\u7A7A\u5B57\u7B26\u4E32\u6216\u5927\u4E8E 0 \u7684\u6574\u6570"});let n=Xt().env||"prod";return bi.get(`/gw/advert-plugin/api/v1/product-config/placement/${encodeURIComponent(e)}`,{},{authRequired:!1,baseDomain:Bn(n)})}var vi=30*1e3,Ra="__",sr=new Map,ur=new Map;function va(t,e){let n=Number.isInteger(t.userId)&&Number(t.userId)>0?t.userId:"";return[t.appId||"",e,t.type||"",n].join(Ra)}function Na(t){let e=sr.get(t);return e?e.expireAt<=Date.now()?(sr.delete(t),v.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:t}),null):e.data:null}function Oa(t,e){sr.set(t,{data:e,expireAt:Date.now()+vi})}function Ca(t){return Array.isArray(t==null?void 0:t.body)?t.body:[]}function wa(t){return String(t==null?void 0:t.code)!=="200"}function La(t,e){let n=String(t||e||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(n)?n:e||"banner"}function Ni(t){return String(t||"").trim().toLowerCase()}function Fa(t){var e;return!!t&&t.status!==0&&((e=t.platformConfig)==null?void 0:e.valid)!==!1}function Ua(t){return[...t].sort((e,n)=>{var l,p,h,D;let o=Number((l=e.priority)!=null?l:9999),s=Number((p=n.priority)!=null?p:9999);return o!==s?o-s:Number((h=n.weight)!=null?h:0)-Number((D=e.weight)!=null?D:0)})}function Oi(t){return t.find(e=>Ni(e.advertPlatform)==="gdt")||null}function Ci(t){return t.find(e=>Ni(e.advertPlatform)!=="gdt")||null}function xa(t,e){return t&&e?"mixed":t?"wechat":e?"custom":"none"}function Ya(t,e){var s,l;let n=Oi(t),o=Ci(t);return n&&o?Number((s=n.priority)!=null?s:9999)<=Number((l=o.priority)!=null?l:9999)?"wechat-first":"custom-first":e==="custom"?"custom-only":e==="wechat"?"wechat-only":"wechat-first"}function Va(t){var n;let e=Oi(t);return((n=e==null?void 0:e.platformConfig)==null?void 0:n.adId)||""}function Ma(t,e,n){let o=String(t.mediaType||"").trim().toLowerCase();return o==="video"&&n?"video":o==="image"&&e?"image":n?"video":"image"}function Ga(t){let e=t.targetAppId||"",n=t.targetPath||"",o=t.jumpUrl||t.url||t.webUrl||"",l=String(t.jumpType||"").trim().toLowerCase()||(e?"miniprogram":n?"internal":o?"web":"none");if(l==="miniprogram"){let p=String(t.miniProgramOpenMode||"").trim().toLowerCase()==="half"?"half":"full";return{jumpType:"miniProgram",appId:e||void 0,path:n||void 0,miniProgramOpenMode:p,action:{type:"miniProgram",appId:e||void 0,path:n||void 0,miniProgramOpenMode:p}}}return l==="internal"?{jumpType:"internal",path:n||void 0,action:{type:"internal",path:n||void 0}}:l==="web"?{jumpType:"web",url:o||void 0,action:{type:"web",url:o||void 0}}:l==="api"?{jumpType:"api",url:o||void 0,action:{type:"api",url:o||void 0}}:{jumpType:"none",action:{type:"none"}}}function Ba(t){let e=Ci(t),n=e==null?void 0:e.platformConfig;if(!n)return null;let o=n.image||n.imageUrl||"",s=n.video||n.videoUrl||"",l=n.poster||"";if(!o&&!s)return null;let p=Ma(n,o,s),h=Ga(n),P=String(n.fitMode||"").trim().toLowerCase()==="contain"?"contain":"cover";return F({configId:e.id,placementId:e.placementId,configName:e.configName,advertPlatform:e.advertPlatform,mediaType:p,image:o||void 0,video:s||void 0,poster:l||void 0,bottomImage:n.bottomImage||void 0,advertiserName:n.advertiserName||void 0,advertiserLogo:n.advertiserLogo||void 0,description:n.description||void 0,buttonText:n.buttonText||void 0,badgeText:n.badgeText||void 0,jumpSeconds:n.jumpSeconds,loadTimeout:n.loadTimeout||n.timeout,muted:n.muted,adSpec:n.adSpec,fitMode:P},h)}function vn(t,e){let n=Ua(t.filter(Fa)),o=Ba(n),s=Va(n),l=La(void 0,e),p=xa(s,o),h=Ya(n,p);return{show:!!(s||o),adId:"",type:l,provider:p,priority:h,unitId:s,customAd:o,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:t}}async function dn(t){let e=t.placementId||t.adId||"",n=va(t,e),o=t.adId||e,s=(P,q={})=>{var pt;if(t.trackingSource==="ui")return;let N=t.tracking;if(!(N!=null&&N.track))return;let G=((pt=N.resolvePage)==null?void 0:pt.call(N,t.pageId))||{pageId:t.pageId||"page_unknown",pageIdSource:t.pageId?"props":"unknown"};N.track(It(F(F({key:P},o?{featureId:o}:{}),t.moduleId?{moduleId:t.moduleId}:{}),{pageId:G.pageId,pageIdSource:G.pageIdSource,pageUrl:G.pageUrl,attr:It(F({},q),{placementId:e})}))},l=(P,q,N)=>{var T;let G=P.data,pt=P.code===Et.SUCCESS?G!=null&&G.show?"selected":"no_config":"failed";s("bi_display_ad_config_result",F(F(F({status:pt,resultSource:q,resultCode:P.code},N?{errorType:N}:{}),G!=null&&G.provider?{provider:G.provider}:{}),((T=G==null?void 0:G.customAd)==null?void 0:T.configId)!==void 0?{configId:G.customAd.configId}:{}))};s("bi_display_ad_config_request",{requestType:"service"});let p=Na(n);if(p){v.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:n,placementId:e});let P=E(Et.SUCCESS,"\u6210\u529F",p);return l(P,"cache"),P}let h=ur.get(n);if(h){v.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:n,placementId:e});let P=await h;return l(P,"pending_reused"),P}let D=(async()=>{try{v.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",t);let P=await Ti(F({placementId:e},Number.isInteger(t.userId)&&Number(t.userId)>0?{userId:t.userId}:{})),q=Ca(P);if(v.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:n,placementId:e,response:P,body:q}),wa(P)||!q){v.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",P);let pt=E(Et.UNKNOWN_ERROR,(P==null?void 0:P.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");return l(pt,"network","api_error"),s("bi_display_ad_error",{errorLayer:"config",errorType:"api_error",resultCode:pt.code}),pt}let N=vn(q,t.type);N.adId=e,N.cache=It(F({},N.cache),{enable:!0,ttl:vi}),Oa(n,N),v.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:n,placementId:e,provider:N.provider,priority:N.priority,hasUnitId:!!N.unitId,hasCustomAd:!!N.customAd});let G=E(Et.SUCCESS,"\u6210\u529F",N);return l(G,"network"),G}catch(P){v.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:n,placementId:e,error:P});let q=E(Et.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");return l(q,"network","network_error"),s("bi_display_ad_error",{errorLayer:"config",errorType:"network_error",resultCode:q.code}),q}finally{ur.delete(n)}})();return ur.set(n,D),D}var ka=["banner","popup","half_screen"],Ja=["business","mini_program","internal","web","api","none"],qa=["token","authtoken","accesstoken","refreshtoken","authorization","cookie","password","passwd","secret","signature","credential","apikey","phone","userid","equipmentvalue","equipmentid","deviceid","entrance","thirdplatform","thirdplatformuserid","thirdplatformequipmentvalue","extenddata"],Ha=["default","vip_gold","insurance_blue"];function cr(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Bt(t){return typeof t=="string"?t.trim():""}function ja(t){return cr(t)?Object.keys(t).reduce((e,n)=>{let o=t[n],s=n.trim().toLowerCase().replace(/[\s_-]/g,"");return!s||qa.includes(s)||(typeof o=="string"||typeof o=="boolean"||typeof o=="number"&&Number.isFinite(o))&&(e[n]=o),e},{}):{}}function Ka(t){let e=cr(t)?t:{},o=Bt(e.type).toLowerCase(),s=o==="miniprogram"?"mini_program":o,l=Ja.includes(s)?s:"none",p=Bt(e.businessCode),h=Bt(e.appId),D=Bt(e.path);return It(F(F(F({type:l},p?{businessCode:p}:{}),h?{appId:h}:{}),D?{path:D}:{}),{params:ja(e.params)})}function Qa(t){let e=Bt(t.skinCode).toLowerCase(),n=Ha.includes(e)?e:"default",o=Number(t.heightRatio);return{skinCode:n,heightRatio:Number.isFinite(o)?Math.min(.85,Math.max(.4,o)):.68,closeable:t.closeable===!0,maskClosable:t.maskClosable!==!1,showAgreement:t.showAgreement===!0}}function Wa(t,e){let n=e==="banner"?Bt(t.bannerImageUrl)||Bt(t.image):Bt(t.popupImageUrl)||Bt(t.image),o=Bt(t.title),s=Bt(t.description),l=Bt(t.buttonText),p=Bt(t.badgeText);return F(F(F(F(F({},n?{imageUrl:n}:{}),o?{title:o}:{}),s?{description:s}:{}),l?{buttonText:l}:{}),p?{badgeText:p}:{})}function Xa(t){return!!(t.imageUrl||t.title||t.description||t.buttonText)}function za(t){let e=Bt(t).toLowerCase();return e==="lyy"?"lyy":e==="third"?"third_party":null}function Ze(t,e){var T;if(!t||t.status===0||t.isDeleted===1)return null;let n=String((T=t.id)!=null?T:"").trim(),o=String(e!=null?e:"").trim(),s=Bt(t.placementId);if(!n||!o||!(n===o||s===o))return null;let p=Bt(t.displayMode).toLowerCase(),h=za(t.systemCode),D=cr(t.displayConfig)?t.displayConfig:{};if(!ka.includes(p))return null;let P=Wa(D,p),q=Bt(t.productCode),N=Bt(t.providerCode),G=Bt(t.channelCode),pt=Bt(t.sceneCode);return Xa(P)?It(F(F(F(F(F({schemaVersion:Number(t.version)||1,adId:e,configId:t.id,placementId:s},q?{productCode:q}:{}),h?{systemType:h}:{}),N?{providerCode:N}:{}),G?{channelCode:G}:{}),pt?{sceneCode:pt}:{}),{displayMode:p,creative:P,panelStyle:Qa(D),action:Ka(D.action)}):null}var $a=30*1e3,dr=new Map,lr=new Map;function Za(t){return String(t.id)}function tu(t){let e=dr.get(t);return e?e.expireAt<=Date.now()?(dr.delete(t),null):e.data:null}function eu(t,e){dr.set(t,{data:e,expireAt:Date.now()+$a})}function nu(t){return Array.isArray(t==null?void 0:t.body)?t.body:t!=null&&t.data?[t.data]:[]}async function fr(t){let e=typeof(t==null?void 0:t.id)=="number"?Number.isInteger(t.id)&&t.id>0?t.id:null:String((t==null?void 0:t.id)||"").trim()||null;if(e===null)return E(Et.INVALID_PARAM,"id \u5FC5\u987B\u4E3A\u975E\u7A7A\u5B57\u7B26\u4E32\u6216\u5927\u4E8E 0 \u7684\u6574\u6570");let n=It(F({},t),{id:e}),o=Za(n),s=tu(o);if(s)return E(Et.SUCCESS,"\u6210\u529F",s);let l=lr.get(o);if(l)return l;let p=(async()=>{try{let h=await Ri({id:n.id});if(String(h==null?void 0:h.code)!=="200")return E(Et.UNKNOWN_ERROR,(h==null?void 0:h.message)||"\u83B7\u53D6\u4EA7\u54C1 UI \u914D\u7F6E\u5931\u8D25");let P=nu(h).map(N=>Ze(N,n.id)).find(N=>!!N)||null,q={show:!!P,id:n.id,placementId:(P==null?void 0:P.placementId)||void 0,config:P,reason:P?"matched":"noConfig"};return eu(o,q),E(Et.SUCCESS,"\u6210\u529F",q)}catch(h){return v.error("\u6309\u5E7F\u544A ID \u83B7\u53D6\u4EA7\u54C1 UI \u914D\u7F6E\u5F02\u5E38",{id:n.id,error:h}),E(Et.NETWORK_ERROR,"\u83B7\u53D6\u4EA7\u54C1 UI \u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{lr.delete(o)}})();return lr.set(o,p),p}var Rr={};we(Rr,{GlobalVipErrorCode:()=>We,checkBenefit:()=>Tr,clearCache:()=>Po,getEntryContext:()=>br,getSubscribeState:()=>yn,handleSubscribeFlow:()=>Io,pollSubscribeResult:()=>Do,recordExposure:()=>go});var tn=fe();function wi(t){return tn.get("/gw/advert/customer/global-vip/subscribe/check-buy-entrance",t)}function Li(t){return tn.get("/gw/advert/customer/global-vip/subscribe/subscribe-config",t)}function Fi(){return tn.get("/gw/advert/customer/global-vip/subscribe/user-subscribe-state")}function Ui(t){return tn.get("/advert/customer/reward/multiple-reward/check",{equipmentValue:t})}function xi(){return tn.post("/gw/advert/customer/global-vip/subscribe/set-exposure-count")}function Yi(t){return tn.post("/gw/advert/customer/automatic-debit/douyin/discount/check",t)}var Ir={};we(Ir,{confirm:()=>eo,execute:()=>wn,getCapability:()=>Zi,resumeDouyin:()=>to});var ru="/gw/advert/customer/automatic-debit/sign",iu=fe();function Vi(t){return iu.post(ru,t)}function Mi(t){return(t==null?void 0:t.code)==="0000000"&&t.body!=null}var ve=class extends Error{constructor(e){super(e),this.name="AutomaticDebitConfirmValidationError"}};function ou(t){var o,s;let e=(o=t.intervalMs)!=null?o:2e3,n=(s=t.timeoutMs)!=null?s:6e4;if(!Number.isFinite(e)||e<1e3)throw new ve("\u67E5\u8BE2\u95F4\u9694\u4E0D\u80FD\u5C0F\u4E8E 1000 \u6BEB\u79D2");if(!Number.isFinite(n)||n<=0)throw new ve("\u67E5\u8BE2\u8D85\u65F6\u65F6\u95F4\u5FC5\u987B\u5927\u4E8E\u96F6");return F({intervalMs:e,timeoutMs:n},t.signal?{signal:t.signal}:{})}function au(t,e,n,o){return o!=null&&o.aborted?Promise.resolve({type:"aborted"}):new Promise(s=>{let l=!1,p=P=>{l||(l=!0,clearTimeout(D),o==null||o.removeEventListener("abort",h),s(P))},h=()=>p({type:"aborted"}),D=setTimeout(()=>p({type:"timeout"}),n);o==null||o.addEventListener("abort",h,{once:!0}),Promise.resolve().then(()=>e(t)).then(P=>{if(P!=="PENDING"&&P!=="SUCCESS"&&P!=="FAILED"){p({type:"error",error:new Error("\u6700\u7EC8\u72B6\u6001\u67E5\u8BE2\u8FD4\u56DE\u4E86\u4E0D\u53D7\u652F\u6301\u7684\u72B6\u6001")});return}p({type:"status",status:P})},P=>p({type:"error",error:P}))})}function uu(t,e){return e!=null&&e.aborted?Promise.resolve(!1):new Promise(n=>{let o=!1,s=h=>{o||(o=!0,clearTimeout(p),e==null||e.removeEventListener("abort",l),n(h))},l=()=>s(!1),p=setTimeout(()=>s(!0),t);e==null||e.addEventListener("abort",l,{once:!0})})}async function Gi(t,e,n={}){let o=t==null?void 0:t.trim();if(!o)throw new ve("\u7B7E\u7EA6\u8BA2\u5355\u53F7\u4E0D\u80FD\u4E3A\u7A7A");if(typeof e!="function")throw new ve("\u6700\u7EC8\u72B6\u6001\u67E5\u8BE2\u51FD\u6570\u4E0D\u80FD\u4E3A\u7A7A");let{intervalMs:s,timeoutMs:l,signal:p}=ou(n),h=Date.now(),D;for(;;){if(p!=null&&p.aborted)return F({state:"pending",orderNo:o,reason:"aborted"},D!==void 0?{lastError:D}:{});let P=l-(Date.now()-h);if(P<=0)return F({state:"pending",orderNo:o,reason:"timeout"},D!==void 0?{lastError:D}:{});let q=await au(o,e,P,p);if(q.type==="aborted")return F({state:"pending",orderNo:o,reason:"aborted"},D!==void 0?{lastError:D}:{});if(q.type==="timeout")return F({state:"pending",orderNo:o,reason:"timeout"},D!==void 0?{lastError:D}:{});if(q.type==="error")D=q.error;else{if(q.status==="SUCCESS")return{state:"confirmed",orderNo:o};if(q.status==="FAILED")return{state:"failed",orderNo:o}}let N=l-(Date.now()-h);if(N<=0)continue;if(!await uu(Math.min(s,N),p))return F({state:"pending",orderNo:o,reason:"aborted"},D!==void 0?{lastError:D}:{})}}var Bi=["OfficialYq","WxOfficial","dyNpp","DySgp"],ki=["alipay","aliPay","wechat"],Ji=["wxMini","aliMini","h5","command","jsapi"];function Be(t){return typeof t=="string"&&t.trim()!==""}function Nn(t){return Bi.includes(t)}function su(t){return ki.includes(t)}function cu(t){return Ji.includes(t)}function qi(t){if(t===""||t===null||t===void 0)return!1;let e=Number(t);return Number.isFinite(e)&&e>=0}function Hi(t){if(t===""||t===null||t===void 0)return!1;let e=Number(t);return Number.isInteger(e)&&e>0}function lu(t){let e=t.trim();if(!/^[a-zA-Z][a-zA-Z\d+.-]*:\/\/[^/?#\s]+(?:[/?#][^\s]*)?$/.test(e))return!1;if(typeof URL=="undefined")return!0;try{return!!new URL(e).protocol}catch(n){return!1}}function du(t,e){return t==="OfficialYq"?e==="alipay"||e==="aliPay":e==="wechat"}function ji(t){return!t||typeof t!="object"?{valid:!1,message:"\u7B7E\u7EA6\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A"}:Be(t.equipmentValue)?su(t.debitType)?Nn(t.channel)?du(t.channel,t.debitType)?qi(t.debitAmount)?Be(t.executeTime)?Hi(t.period)?t.returnUrl!==void 0&&!lu(t.returnUrl)?{valid:!1,message:"\u56DE\u8DF3\u5730\u5740\u5FC5\u987B\u4E3A\u5408\u6CD5\u7684\u7EDD\u5BF9 URL"}:t.firstPayAmount!==void 0&&!qi(t.firstPayAmount)?{valid:!1,message:"\u9996\u7B14\u652F\u4ED8\u91D1\u989D\u5FC5\u987B\u4E3A\u5927\u4E8E\u7B49\u4E8E\u96F6\u7684\u6570\u503C"}:t.firstDebitPeriod!==void 0&&!Hi(t.firstDebitPeriod)?{valid:!1,message:"\u9996\u6B21\u6263\u8D39\u5468\u671F\u5FC5\u987B\u4E3A\u6B63\u6574\u6570"}:t.wechatSignMode!==void 0&&t.wechatSignMode!=="PURE"&&t.wechatSignMode!=="PAY"?{valid:!1,message:"\u5FAE\u4FE1\u7B7E\u7EA6\u6A21\u5F0F\u4E0D\u53D7\u652F\u6301"}:t.douyinRedirectType!==void 0&&t.douyinRedirectType!=="ulink"&&t.douyinRedirectType!=="command"?{valid:!1,message:"\u6296\u97F3\u8C03\u8D77\u65B9\u5F0F\u4E0D\u53D7\u652F\u6301"}:{valid:!0}:{valid:!1,message:"\u6263\u8D39\u5468\u671F\u5FC5\u987B\u4E3A\u6B63\u6574\u6570"}:{valid:!1,message:"\u9996\u6B21\u6267\u884C\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A"}:{valid:!1,message:"\u540E\u7EED\u6263\u8D39\u91D1\u989D\u5FC5\u987B\u4E3A\u5927\u4E8E\u7B49\u4E8E\u96F6\u7684\u6570\u503C"}:{valid:!1,message:"\u7B7E\u7EA6\u6E20\u9053\u4E0E\u6263\u8D39\u7C7B\u578B\u4E0D\u5339\u914D"}:{valid:!1,message:"\u7B7E\u7EA6\u6E20\u9053\u4E0D\u53D7\u652F\u6301"}:{valid:!1,message:"\u6263\u8D39\u7C7B\u578B\u4E0D\u53D7\u652F\u6301"}:{valid:!1,message:"\u8BBE\u5907\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A"}}function fu(t){return Be(t)?!0:typeof t=="object"&&t!==null&&!Array.isArray(t)&&Object.keys(t).length>0}function fn(t){if(!t||typeof t!="object")return{valid:!1,message:"\u7B7E\u7EA6\u54CD\u5E94\u4F53\u4E0D\u80FD\u4E3A\u7A7A"};let e=t;return Nn(e.channel)?cu(e.redirectType)?e.redirectType==="h5"||e.redirectType==="command"?Be(e.payUrl)?{valid:!0}:{valid:!1,message:"\u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548 payUrl"}:e.redirectType==="wxMini"||e.redirectType==="aliMini"?Be(e.appId)?Be(e.payUrl)?{valid:!0}:{valid:!1,message:"\u5C0F\u7A0B\u5E8F\u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548 payUrl"}:{valid:!1,message:"\u5C0F\u7A0B\u5E8F\u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548 appId"}:fu(e.payInfo)?(e.channel==="dyNpp"||e.channel==="DySgp")&&!Be(e.appId)?{valid:!1,message:"\u6296\u97F3 JSAPI \u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548 appId"}:{valid:!0}:{valid:!1,message:"JSAPI \u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548 payInfo"}:{valid:!1,message:"\u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548\u8C03\u8D77\u65B9\u5F0F"}:{valid:!1,message:"\u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548\u6E20\u9053"}}function _r(t){return fn(t).valid}var Jt=class extends Error{constructor(n,o,s){super(o);be(this,"type");be(this,"raw");this.name="AutomaticDebitRuntimeError",this.type=n,this.raw=s}};function pn(){return typeof wx!="undefined"?wx:null}function On(){return typeof my!="undefined"?my:null}function yr(){return typeof window!="undefined"&&typeof document!="undefined"}function pu(){return yr()&&typeof navigator!="undefined"&&/micromessenger/i.test(navigator.userAgent||"")}function Qi(){return yr()&&window.WeixinJSBridge||null}function Ar(){let t=pn();if(t&&typeof t.request=="function")return"wechat-mini-program";let e=On();return e&&typeof e.request=="function"?"alipay-mini-program":yr()?"h5":"unknown"}function _u(t){var e,n,o;return t==="wechat-mini-program"?typeof((e=pn())==null?void 0:e.setClipboardData)=="function":t==="alipay-mini-program"?typeof((n=On())==null?void 0:n.setClipboardData)=="function":t==="h5"&&typeof navigator!="undefined"&&typeof((o=navigator.clipboard)==null?void 0:o.writeText)=="function"}function pe(t,e,n,o){return It(F(F({supported:!1,runtime:e},t.channel?{channel:t.channel}:{}),t.redirectType?{redirectType:t.redirectType}:{}),{reason:n,message:o})}function Cn(t,e={}){var h,D,P,q;let n=Ar(),o=fn(t);if(!o.valid||!_r(t))return pe(t,n,"INVALID_RESPONSE",o.message||"\u7B7E\u7EA6\u54CD\u5E94\u7ED3\u6784\u65E0\u6548");let{channel:s,redirectType:l}=t,p={supported:!0,runtime:n,channel:s,redirectType:l};return n==="unknown"?pe(t,n,"UNSUPPORTED_RUNTIME","\u5F53\u524D\u8FD0\u884C\u7AEF\u4E0D\u652F\u6301\u81EA\u52A8\u4EE3\u6263\u6E20\u9053\u8C03\u8D77"):l==="h5"?n==="h5"&&typeof((h=window.location)==null?void 0:h.assign)=="function"||(n==="wechat-mini-program"||n==="alipay-mini-program")&&typeof e.externalRedirect=="function"?p:pe(t,n,"UNSUPPORTED_RUNTIME","\u5F53\u524D\u8FD0\u884C\u7AEF\u65E0\u6CD5\u76F4\u63A5\u6253\u5F00 H5 \u7B7E\u7EA6\u5730\u5740\uFF0C\u8BF7\u914D\u7F6E externalRedirect"):l==="command"?s!=="dyNpp"&&s!=="DySgp"?pe(t,n,"UNSUPPORTED_CHANNEL_REDIRECT","\u5F53\u524D\u6E20\u9053\u4E0D\u652F\u6301\u53E3\u4EE4\u8C03\u8D77\u65B9\u5F0F"):_u(n)?p:pe(t,n,"MISSING_PLATFORM_API","\u5F53\u524D\u8FD0\u884C\u7AEF\u7F3A\u5C11\u526A\u8D34\u677F\u80FD\u529B"):l==="wxMini"?s!=="WxOfficial"?pe(t,n,"UNSUPPORTED_CHANNEL_REDIRECT","\u5F53\u524D\u6E20\u9053\u4E0D\u652F\u6301\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u8C03\u8D77\u65B9\u5F0F"):n==="wechat-mini-program"&&typeof((D=pn())==null?void 0:D.navigateToMiniProgram)=="function"?p:pe(t,n,"MISSING_PLATFORM_API","\u5F53\u524D\u8FD0\u884C\u7AEF\u7F3A\u5C11\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u80FD\u529B"):l==="aliMini"?s!=="OfficialYq"?pe(t,n,"UNSUPPORTED_CHANNEL_REDIRECT","\u5F53\u524D\u6E20\u9053\u4E0D\u652F\u6301\u652F\u4ED8\u5B9D\u5C0F\u7A0B\u5E8F\u8C03\u8D77\u65B9\u5F0F"):n==="alipay-mini-program"&&typeof((P=On())==null?void 0:P.navigateToMiniProgram)=="function"?p:pe(t,n,"MISSING_PLATFORM_API","\u5F53\u524D\u8FD0\u884C\u7AEF\u7F3A\u5C11\u652F\u4ED8\u5B9D\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u80FD\u529B"):s==="WxOfficial"?n==="wechat-mini-program"&&typeof((q=pn())==null?void 0:q.requestPayment)=="function"||n==="h5"&&pu()&&Qi()?p:pe(t,n,"MISSING_PLATFORM_API","\u5F53\u524D\u8FD0\u884C\u7AEF\u7F3A\u5C11\u5FAE\u4FE1 JSAPI \u7B7E\u7EA6\u80FD\u529B"):s==="dyNpp"||s==="DySgp"?n==="h5"?p:pe(t,n,"UNSUPPORTED_RUNTIME","\u6296\u97F3 JSAPI \u7B7E\u7EA6\u4EC5\u652F\u6301 H5 \u627F\u8F7D\u9875"):pe(t,n,"UNSUPPORTED_CHANNEL_REDIRECT","\u5F53\u524D\u6E20\u9053\u4E0D\u652F\u6301 JSAPI \u8C03\u8D77\u65B9\u5F0F")}function mu(t){if(t&&typeof t=="object"&&!Array.isArray(t))return t;if(typeof t=="string")try{let e=JSON.parse(t);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch(e){}throw new Jt("INVALID_RESPONSE","\u6E20\u9053 payInfo \u683C\u5F0F\u65E0\u6548")}function Wi(t){let e=mu(t),n=["timeStamp","nonceStr","package","signType","paySign"],o={};for(let s of n){let l=e[s];if(typeof l!="string"||l==="")throw new Jt("INVALID_RESPONSE",`\u5FAE\u4FE1 JSAPI \u7B7E\u7EA6\u53C2\u6570\u7F3A\u5C11 ${s}`);o[s]=l}return o}function yu(t){return Wi(t)}function Au(t){let e=t,n=String((e==null?void 0:e.errMsg)||(e==null?void 0:e.message)||"");return/cancel/i.test(n)||(e==null?void 0:e.code)===3039}function hr(t){return t instanceof Jt?t:Au(t)?new Jt("USER_CANCELLED","\u7528\u6237\u53D6\u6D88\u81EA\u52A8\u4EE3\u6263\u7B7E\u7EA6",t):new Jt("CHANNEL_INVOKE_FAILED","\u6E20\u9053\u7B7E\u7EA6\u8C03\u8D77\u5931\u8D25",t)}function Ki(t,e){let n=pn();return new Promise((o,s)=>{n[t](It(F({},e),{success:o,fail:s}))})}function hu(t,e){let n=On();return new Promise((o,s)=>{n[t](It(F({},e),{success:o,fail:s}))})}function gu(t){let e=Qi();return new Promise((n,o)=>{e.invoke("getBrandWCPayRequest",t,s=>{let l=String((s==null?void 0:s.err_msg)||(s==null?void 0:s.errMsg)||"");if(/:ok$/i.test(l)){n(s);return}o(s)})})}async function gr(t){if(typeof t.appId!="string"||t.appId==="")throw new Jt("INVALID_RESPONSE","\u6296\u97F3 JSAPI \u7B7E\u7EA6\u54CD\u5E94\u7F3A\u5C11\u6709\u6548 appId");let e=t.appId,n=yu(t.payInfo),o=await Me(),s=Ve(),l=await Ye({url:s,appid:e});return await Ge({appId:e,signatureData:l,url:s,sdk:o}),ln({appId:e,payInfo:n,sdk:o})}async function mr(t,e){if(typeof e.beforeRedirect=="function")try{await e.beforeRedirect({orderNo:t.orderNo,channel:t.channel,redirectType:t.redirectType,payUrl:t.payUrl})}catch(n){throw new Jt("CHANNEL_INVOKE_FAILED","\u81EA\u52A8\u4EE3\u6263\u8DF3\u8F6C\u524D\u56DE\u8C03\u6267\u884C\u5931\u8D25",n)}}async function Iu(t,e,n){if(typeof e.externalRedirect!="function")throw new Jt("UNSUPPORTED_CAPABILITY","\u5F53\u524D\u5C0F\u7A0B\u5E8F\u672A\u914D\u7F6E externalRedirect\uFF0C\u65E0\u6CD5\u6253\u5F00 H5 \u7B7E\u7EA6\u5730\u5740");try{await e.externalRedirect({orderNo:t.orderNo,channel:t.channel,redirectType:t.redirectType,payUrl:t.payUrl,runtime:n})}catch(o){throw new Jt("CHANNEL_INVOKE_FAILED","\u81EA\u52A8\u4EE3\u6263\u5916\u90E8 H5 \u8DF3\u8F6C\u56DE\u8C03\u6267\u884C\u5931\u8D25",o)}}async function Xi(t,e={}){let n=Cn(t,e);if(!n.supported||!_r(t))throw new Jt(n.reason==="INVALID_RESPONSE"?"INVALID_RESPONSE":"UNSUPPORTED_CAPABILITY",n.message||"\u5F53\u524D\u8FD0\u884C\u7AEF\u4E0D\u652F\u6301\u8BE5\u7B7E\u7EA6\u65B9\u5F0F");let o={orderNo:t.orderNo,channel:t.channel,redirectType:t.redirectType};try{if(t.redirectType==="h5"){if(await mr(t,e),n.runtime==="h5")window.location.assign(t.payUrl);else if(n.runtime==="wechat-mini-program"||n.runtime==="alipay-mini-program")await Iu(t,e,n.runtime);else throw new Jt("UNSUPPORTED_CAPABILITY","\u5F53\u524D\u8FD0\u884C\u7AEF\u65E0\u6CD5\u6253\u5F00 H5 \u7B7E\u7EA6\u5730\u5740");return It(F({},o),{state:"redirected"})}if(t.redirectType==="command")return await Le(t.payUrl),It(F({},o),{state:"command_ready",payUrl:t.payUrl});if(t.redirectType==="wxMini"){await mr(t,e);let l=await Ki("navigateToMiniProgram",F({appId:t.appId,path:t.payUrl},typeof t.payInfo=="object"&&t.payInfo?{extraData:t.payInfo}:{}));return It(F({},o),{state:"redirected",raw:l})}if(t.redirectType==="aliMini"){await mr(t,e);let l=await hu("navigateToMiniProgram",F({appId:t.appId,path:t.payUrl},typeof t.payInfo=="object"&&t.payInfo?{extraData:t.payInfo}:{}));return It(F({},o),{state:"redirected",raw:l})}if(t.channel==="WxOfficial"){let l=Wi(t.payInfo),p=n.runtime==="wechat-mini-program"?await Ki("requestPayment",l):await gu(l);return It(F({},o),{state:"invoked",raw:p})}let s=await gr(t);return It(F({},o),{state:"invoked",raw:s})}catch(s){throw hr(s)}}async function zi(t){var n;let e=(n=t==null?void 0:t.requestId)==null?void 0:n.trim();if(!e)throw new Jt("INVALID_RESPONSE","\u6296\u97F3\u81EA\u52A8\u4EE3\u6263\u7EED\u63A5 requestId \u4E0D\u80FD\u4E3A\u7A7A");if(Ar()!=="h5")throw new Jt("UNSUPPORTED_CAPABILITY","\u6296\u97F3\u81EA\u52A8\u4EE3\u6263\u7EED\u63A5\u4EC5\u652F\u6301 H5 \u627F\u8F7D\u9875");try{let o=await ze(e),s=o.appId||o.appid||"",l=await gr({appId:s,payInfo:o.payInfo}),p=Nn(o.channel)&&(o.channel==="dyNpp"||o.channel==="DySgp")?o.channel:void 0;return{state:"invoked",orderNo:o.orderNo,channel:p,redirectType:"jsapi",raw:l}}catch(o){throw hr(o)}}function Du(t){return t.type==="INVALID_RESPONSE"?4103:t.type==="UNSUPPORTED_CAPABILITY"?4104:t.type==="USER_CANCELLED"?4106:4105}function $i(t){let e=t instanceof Jt?t:new Jt("CHANNEL_INVOKE_FAILED",de[4105],t),n=Du(e),o=n===4106?"cancelled":"failed";return E(n,e.message||de[n],F({state:o},e.raw!==void 0?{raw:e.raw}:{}))}async function wn(t,e={}){let n=ji(t);if(!n.valid)return E(4101,n.message||de[4101]);let o;try{o=await Vi(t)}catch(p){return E(4102,(p==null?void 0:p.message)||de[4102])}if(!Mi(o))return E(4102,(o==null?void 0:o.message)||de[4102]);let s=fn(o.body);if(!s.valid)return E(4103,s.message||de[4103]);let l=Cn(o.body,e);if(!l.supported)return E(4104,l.message||de[4104],{state:"failed",orderNo:o.body.orderNo,channel:o.body.channel,redirectType:o.body.redirectType});try{let p=await Xi(o.body,e);return E(0,"\u6210\u529F",p)}catch(p){return $i(p)}}function Zi(t,e={}){return Cn(t,e)}async function to(t){try{let e=await zi(t);return E(0,"\u6210\u529F",e)}catch(e){return $i(e)}}async function eo(t,e,n={}){try{let o=await Gi(t,e,n);return o.state==="failed"?E(4107,de[4107],o):o.reason==="timeout"?E(4108,de[4108],o):E(0,o.reason==="aborted"?"\u6700\u7EC8\u72B6\u6001\u786E\u8BA4\u5DF2\u53D6\u6D88":"\u6210\u529F",o)}catch(o){let l=o instanceof ve?4101:4107;return E(l,(o==null?void 0:o.message)||de[l])}}var no=["silver","gold","black","diamond"],ro=["OfficialYq","WxOfficial","dyNpp","DySgp"],io=["aliMini","aliPay","wxMini","wechat"],oo=["alipay","aliPay","wechat"],ao=["ios","android","other"],uo=["dyNpp","DySgp"],so={dev:"wxe3b203d57e31f7d5",sit:"wx8774db1793d85b6f",uat:"wx8774db1793d85b6f",prod:"wx54c55f3735702ba6"};var Ln=new Map,_n=new Map;function Dr(t,e){let n=Ln.get(t);if(n&&Date.now()-n.timestamp<6e4)return n.promise;let o=e().catch(s=>{throw Ln.delete(t),s});return Ln.set(t,{timestamp:Date.now(),promise:o}),o}function co(){Ln.clear(),_n.clear()}function lo(t,e){let n=_n.get(t);if(n)return n;let o=e().finally(()=>{_n.get(t)===o&&_n.delete(t)});return _n.set(t,o),o}var Kt=class extends Error{constructor(n,o){super(o||ye[n]);be(this,"code");this.name="GlobalVipServiceError",this.code=n}};function en(t){return String(t)==="0000000"}function Pr(t){return io.includes(t)}function Fn(t){return no.includes(t)}function fo(t){return ro.includes(t)}function Er(t){return uo.includes(t)}function po(){return{window:!1,banner:!1,package:!1,cart:!1}}function Sr(t){let e=t==null||t===""?null:Number(t),n=e!==null&&Number.isFinite(e)?e:null,o="inactive";return n===1?o="active":n===2?o="refunded":n===3?o="trial":n!==null&&(o="unknown"),{state:n,active:n===1||n===3,status:o}}function _o(t,e,n=!1){let o=Fn(t.subscribeType)?t.subscribeType:e,s=t.channelCode,l=Number(t.payAmount),p=Number(t.firstPayAmount),h=Number(t.renewAmount),D=Number(t.effectiveDate);if(!fo(s)||!Number.isFinite(l)||!Number.isFinite(p)||!Number.isFinite(h)||!Number.isFinite(D))return null;let P=q=>{let N=Number(q);return Number.isFinite(N)&&N>=0?N:0};return{subscribeType:o,channelCode:s,payAmount:l,firstPayAmount:p,renewAmount:h,effectiveDate:D,tryDay:P(t.tryDay),totalBenefitAmount:P(t.totalBenefitAmount),firstBenefitAmount:P(t.firstBenefitAmount),closeButtonPopSecond:P(t.closeButtonPopSecond),canEnjoyDiscount:n}}function mo(t){return t?Fn(t.subscribeType)&&fo(t.channelCode)&&Number.isFinite(t.payAmount)&&Number.isFinite(t.firstPayAmount)&&Number.isFinite(t.renewAmount)&&Number.isFinite(t.effectiveDate)&&Number.isFinite(t.tryDay)&&t.tryDay>=0:!1}function yo(t){var e,n,o;if(!((e=t==null?void 0:t.equipmentValue)!=null&&e.trim()))throw new Kt(4001);if(!((n=t.equipmentTypeValue)!=null&&n.trim()))throw new Kt(4002);if(!Pr(t.clientType))throw new Kt(4003);if(!oo.includes(t.debitType)||!ao.includes(t.os)||!((o=t.returnUrl)!=null&&o.trim()))throw new Kt(4007,"\u5E73\u53F0\u5927\u4F1A\u5458\u7B7E\u7EA6\u53C2\u6570\u65E0\u6548")}function Eu(t){let e=n=>String(n).padStart(2,"0");return[t.getFullYear(),"-",e(t.getMonth()+1),"-",e(t.getDate())," ",e(t.getHours()),":",e(t.getMinutes()),":",e(t.getSeconds())].join("")}function Ao(t,e){let n=new Date(Date.now()+e.tryDay*24*60*60*1e3),o=Xt().env||"prod",s=Ke(o,""),l=e.renewAmount===e.payAmount,p=[`${s}/pages/subAdvertising.html#/douyinSign?page=douyinSign`,`equipmentTypeId=${encodeURIComponent(t.equipmentTypeValue)}`,`price=${encodeURIComponent(String(e.payAmount))}`,`isNewMember=${l}`].join("&"),h={equipmentValue:t.equipmentValue,debitType:t.debitType,debitAmount:e.renewAmount,firstPayAmount:e.payAmount,period:e.effectiveDate,douyinSignPage:p,returnUrl:t.returnUrl,extraInfo:{subscribeType:e.subscribeType},platform:"lyy",executeTime:Eu(n),channel:e.channelCode};t.phone&&(h.phoneNumber=t.phone),e.tryDay>0&&(h.signOnly=!0);let D=t.clientType==="aliMini"||t.clientType==="wxMini";if(Er(e.channelCode)&&(t.os==="ios"||t.os==="android"&&D)&&(h.douyinRedirectType="ulink"),e.channelCode==="WxOfficial"){h.wechatSignMode="PURE";let P=Xt().env||"prod",q=t.wechatAppId||(t.clientType==="wechat"?so[P]:"");q&&(h.wechatAppId=q)}return h}function mn(t,e){return t instanceof Kt?E(t.code,t.message):(v.error("\u5E73\u53F0\u5927\u4F1A\u5458\u670D\u52A1\u5F02\u5E38",{code:t==null?void 0:t.code,name:t==null?void 0:t.name}),E(e,ye[e]))}function ho(t){return t.result!==void 0?Number(t.result)===0:en(t.code)}async function Su(t){let e=`entrance:${t.equipmentTypeValue}:${t.equipmentValue}`;return Dr(e,async()=>{let n=await wi({equipmentTypeValue:t.equipmentTypeValue});if(!en(n.code)||!n.body)throw new Kt(4004);return n.body})}async function bu(t,e){let n=`config:${e}:${t.clientType}:${t.equipmentValue}`;return Dr(n,async()=>{let o=await Li({subscribeType:e,clientType:t.clientType,equipmentValue:t.equipmentValue});if(!en(o.code)||!o.body)throw new Kt(4006);return o.body})}async function Tu(t,e){var s;if(!Er(e.channelCode))return!1;let n=It(F({equipmentValue:t.equipmentValue,debitType:t.clientType==="aliMini"||t.clientType==="aliPay"?"alipay":"wechat",channel:e.channelCode},t.phone?{phoneNumber:t.phone}:{}),{firstPayAmount:e.firstPayAmount,debitAmount:e.renewAmount,businessType:1,platform:"lyy",douyinAppId:""}),o=await Yi(n);if(en(o.code))return((s=o.body)==null?void 0:s.canEnjoyDiscount)===!0;if(!t.phone&&o.code==="0000400"&&o.message==="phoneNumber\u4E0D\u80FD\u4E3A\u7A7A")return!0;throw new Kt(4014)}async function yn(){var t;try{let e=await Fi();if(!en(e.code))throw new Kt(4008);return E(0,"\u6210\u529F",Sr((t=e.body)==null?void 0:t.state))}catch(e){return mn(e,4008)}}async function br(t){var e,n;if(!((e=t==null?void 0:t.equipmentValue)!=null&&e.trim()))return E(4001,ye[4001]);if(!((n=t.equipmentTypeValue)!=null&&n.trim()))return E(4002,ye[4002]);if(!Pr(t.clientType))return E(4003,ye[4003]);try{let o=await yn();if(o.code!==0||!o.data)return E(o.code,o.message);if(o.data.active)return E(0,"\u7528\u6237\u5DF2\u5F00\u901A\u5E73\u53F0\u5927\u4F1A\u5458",{canPurchase:!1,active:!0,memberState:o.data.state,subscribeType:null,entrances:po(),config:null});let s=await Su(t);if(!Fn(s.subscribeType))throw new Kt(4005);let l=await bu(t,s.subscribeType),p=_o(l,s.subscribeType);if(!p)throw new Kt(4007);let h=await Tu(t,p),D=It(F({},p),{canEnjoyDiscount:h}),P={window:s.windowEntrance===!0,banner:s.bannerEntrance===!0,package:s.packageEntrance===!0,cart:s.buyCarEntrance===!0};return E(0,"\u6210\u529F",{canPurchase:!0,active:!1,memberState:o.data.state,subscribeType:s.subscribeType,entrances:P,config:D})}catch(o){return mn(o,4004)}}async function Tr(t){var e,n;if(!((e=t==null?void 0:t.equipmentValue)!=null&&e.trim()))return E(4001,ye[4001]);try{let o=await Ui(t.equipmentValue);if(!ho(o))throw new Kt(4012);let s=(n=o.data)!=null?n:o.body;return E(0,"\u6210\u529F",F({received:!!s},s!==void 0?{rawData:s}:{}))}catch(o){return mn(o,4012)}}async function go(){try{let t=await xi();if(!ho(t))throw new Kt(4013);return E(0,"\u6210\u529F",!0)}catch(t){return mn(t,4013)}}async function Io(t){var e;try{yo(t);let n=await yn();if(n.code!==0||!n.data)return E(n.code,n.message);if(n.data.active)return E(0,"\u7528\u6237\u5DF2\u5F00\u901A\u5E73\u53F0\u5927\u4F1A\u5458",{type:"already_active",state:n.data});let o=t.config;if(!o){let p=await br({equipmentValue:t.equipmentValue,equipmentTypeValue:t.equipmentTypeValue,clientType:t.clientType,phone:t.phone});if(p.code!==0||!((e=p.data)!=null&&e.config))return E(p.code,p.message);o=p.data.config}if(!mo(o))throw new Kt(4007);let s=Ao(t,o),l=["sign",t.equipmentValue,o.subscribeType,o.channelCode,t.debitType].join(":");return lo(l,()=>wn(s,{beforeRedirect:t.beforeRedirect,externalRedirect:t.externalRedirect}))}catch(n){return mn(n,4010)}}function Ru(t){return new Promise(e=>setTimeout(e,t))}async function Do(t){var N,G,pt;if(!((N=t==null?void 0:t.equipmentValue)!=null&&N.trim()))return E(4001,ye[4001]);let e=(G=t.maxAttempts)!=null?G:3,n=(pt=t.interval)!=null?pt:3e3;if(!Number.isInteger(e)||e<1||!Number.isFinite(n)||n<0)return E(4007,"\u5E73\u53F0\u5927\u4F1A\u5458\u8F6E\u8BE2\u53C2\u6570\u65E0\u6548");let o=t.checkBenefit!==!1,s=Sr(null),l=!1,p=!1,h=!o,D=!1,P=!o,q=0;for(let T=1;T<=e;T+=1){q=T;let[J,ct]=await Promise.all([p?Promise.resolve(null):yn(),h?Promise.resolve(null):Tr({equipmentValue:t.equipmentValue})]);if((J==null?void 0:J.code)===0&&J.data&&(D=!0,s=J.data,p=J.data.active),(ct==null?void 0:ct.code)===0&&ct.data&&(P=!0,l=ct.data.received,h=l),p&&h)break;T<e&&await Ru(n)}return!D||!P?E(4015,ye[4015]):E(0,"\u6210\u529F",{active:s.active,benefitReceived:l,memberState:s.state,attempts:q})}function Po(){co()}var vr={};we(vr,{resolvePhone:()=>To});var vu=fe(),Nu=bn();function Eo(t){let e=Ue(t,["appId"]);return e.valid?vu.get("/gw/advert/customer/alipay/phone/resolve",{appId:t.appId}):Promise.reject({code:"PARAM_ERROR",message:e.message})}function So(t){let e={thirdPlatform:t.thirdPlatform,thirdPlatformUserId:t.thirdPlatformUserId,openid:t.openid,appid:t.appid};return t.phone&&(e.phone=t.phone),Nu.post("/open/rest/alipay/phone/resolve",e)}var Ou=/^\d{11}$/;function re(t,e){let n=e||Hn[t]||"\u78B0\u4E00\u78B0\u53D6\u53F7\u5931\u8D25";return v.warn("\u78B0\u4E00\u78B0\u53D6\u53F7\u5931\u8D25",{code:t,message:n}),E(t,n)}function nn(t){return typeof t=="string"&&t.trim()!==""}function Cu(t){if(!t||typeof t!="object")return re(5001);if(t.mode!=="internal"&&t.mode!=="external")return re(5001);if(!nn(t.appid))return re(5002);if(t.mode==="external"){let e=t;if(!nn(e.thirdPlatform))return re(5003);if(!nn(e.thirdPlatformUserId))return re(5004);if(!nn(e.openid))return re(5005);if(e.phone!==void 0&&e.phone!==null&&e.phone!==""&&(typeof e.phone!="string"||!Ou.test(e.phone)))return re(5006)}return null}function bo(t){if(!t||typeof t!="object")return null;let e=t;if(typeof e.canUse!="boolean")return null;let n=nn(e.openid)?e.openid:null,o=nn(e.phone)?e.phone:null;return e.canUse&&(!n||!o)?null:{openid:n,phone:e.canUse?o:null,canUse:e.canUse}}function wu(t){return!t||Number(t.code)!==0?null:bo(t.body)}async function Lu(t){try{let e=await Eo({appId:t.appid}),n=wu(e);return n?E(Et.SUCCESS,"\u6210\u529F",n):e&&Number(e.code)!==0?re(5008,e.message||void 0):re(5010)}catch(e){return(e==null?void 0:e.code)==="AUTH_TOKEN_REQUIRED"?re(5011):re(5009,(e==null?void 0:e.message)||void 0)}}async function Fu(t){let e={thirdPlatform:t.thirdPlatform,thirdPlatformUserId:t.thirdPlatformUserId,openid:t.openid,appid:t.appid};t.phone&&(e.phone=t.phone);try{let n=await So(e),o=bo(n);return o?E(Et.SUCCESS,"\u6210\u529F",o):re(5010)}catch(n){let o=n;return o!=null&&o.message&&o.message.includes("externalAppId")?re(5007):re(5009,(o==null?void 0:o.msg)||(o==null?void 0:o.message)||void 0)}}async function To(t){let e=Cu(t);return e||(v.info("\u5F00\u59CB\u78B0\u4E00\u78B0\u53D6\u53F7",{mode:t.mode}),t.mode==="external"?Fu(t):Lu(t))}function Uu(t={}){v.info("\u670D\u52A1\u521D\u59CB\u5316",t);let e=F(F({},Qe),t);e.env&&!Pn[e.env]&&(v.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${e.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),e.env=ee.PROD),e.externalEnv&&!rn[e.externalEnv]&&(v.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${e.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),e.externalEnv=Ie.PROD),e.debug!==void 0&&v.setEnable(e.debug),Mr(e),v.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",e)}function Ro(t={}){let e="",n=null;async function o(){if(typeof t.getAuthToken=="function"){let l=await t.getAuthToken();if(l)return l}return n&&typeof n.getStorage=="function"&&n.getStorage("auth_token")||""}let s={name:"services",setToken(l){return e=l||"",n&&typeof n.setStorage=="function"&&n.setStorage("auth_token",e),s},async getAuthToken(){return e||o()},clearToken(){return e="",n&&typeof n.setStorage=="function"&&n.setStorage("auth_token",""),s},install(l){n=l;let p=It(F({},t),{getAuthToken:()=>s.getAuthToken()});Uu(p),v.info("services installed via nova.use()"),Object.assign(l,{jd:F({},tr),dy:F({},ar),ads:It(F({},pr),{getDisplayAdConfig:h=>dn(It(F({},h),{tracking:l.tracking}))}),globalVip:F({},Rr),automaticDebit:F({},Ir),alipayTouch:F({},vr),setToken:s.setToken,clearToken:s.clearToken})}};return s}0&&(module.exports={AlipayTouchErrorCode,AlipayTouchErrorMessage,AutomaticDebitErrorCode,AutomaticDebitErrorMessage,DyErrorCode,DyErrorMessage,ENV_TYPE,EXTERNAL_ENV_TYPE,GlobalVipErrorCode,GlobalVipErrorMessage,JdErrorCode,JdErrorMessage,checkBenefit,clearCache,confirm,createServices,execute,getCapability,getDisplayAdConfig,getDyPayRtaData,getEntryContext,getProductConfig,getSubscribeState,handleDyAuthDebitSignFlow,handleDyAuthDebitSignFlowWithRawPayInfo,handleDyJsapiPayFlow,handleDyPayCommandFlow,handleDyPayFlow,handleJdInsurance,handleJdInsuranceExt,handleJdjrCashLoanExt,handleJdjrCashLoanFlow,handleSubscribeFlow,normalizeDisplayAdData,normalizeProductConfig,pollSubscribeResult,recordExposure,resolvePhone,resumeDouyin});
|
|
5
5
|
/*! For license information please see LyyGetCommandSDK.min.js.LICENSE.txt */
|