@bi-nova/services 1.5.1 → 1.5.2
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 +4 -2
- package/dist/index.d.ts +4 -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 Be=Object.defineProperty,qr=Object.defineProperties,Br=Object.getOwnPropertyDescriptor,jr=Object.getOwnPropertyDescriptors,Vr=Object.getOwnPropertyNames,Un=Object.getOwnPropertySymbols;var Mn=Object.prototype.hasOwnProperty,Hr=Object.prototype.propertyIsEnumerable;var on=(e,r,a)=>r in e?Be(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,at=(e,r)=>{for(var a in r||(r={}))Mn.call(r,a)&&on(e,a,r[a]);if(Un)for(var a of Un(r))Hr.call(r,a)&&on(e,a,r[a]);return e},zt=(e,r)=>qr(e,jr(r));var Gr=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),je=(e,r)=>{for(var a in r)Be(e,a,{get:r[a],enumerable:!0})},Kr=(e,r,a,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of Vr(r))!Mn.call(e,l)&&l!==a&&Be(e,l,{get:()=>r[l],enumerable:!(d=Br(r,l))||d.enumerable});return e};var Xr=e=>Kr(Be({},"__esModule",{value:!0}),e);var Ve=(e,r,a)=>on(e,typeof r!="symbol"?r+"":r,a);var tr=Gr((fi,Zn)=>{"use strict";(()=>{var e={737:(l,h,A)=>{"use strict";A.r(h),A.d(h,{default:()=>O,getJrCommand:()=>R});var P=A(307),N=A.n(P);function M(){M=function(){return K};var D,K={},vt=Object.prototype,dt=vt.hasOwnProperty,Pt=Object.defineProperty||function(_,f,g){_[f]=g.value},yt=typeof Symbol=="function"?Symbol:{},At=yt.iterator||"@@iterator",St=yt.asyncIterator||"@@asyncIterator",Et=yt.toStringTag||"@@toStringTag";function ht(_,f,g){return Object.defineProperty(_,f,{value:g,enumerable:!0,configurable:!0,writable:!0}),_[f]}try{ht({},"")}catch(_){ht=function(f,g,U){return f[g]=U}}function Kt(_,f,g,U){var v=f&&f.prototype instanceof se?f:se,q=Object.create(v.prototype),ot=new ye(U||[]);return Pt(q,"_invoke",{value:Ft(_,g,ot)}),q}function Xt(_,f,g){try{return{type:"normal",arg:_.call(f,g)}}catch(U){return{type:"throw",arg:U}}}K.wrap=Kt;var Ht="suspendedStart",Zt="suspendedYield",F="executing",Nt="completed",Ct={};function se(){}function ie(){}function qt(){}var ue={};ht(ue,At,(function(){return this}));var ae=Object.getPrototypeOf,Mt=ae&&ae(ae(re([])));Mt&&Mt!==vt&&dt.call(Mt,At)&&(ue=Mt);var Gt=qt.prototype=se.prototype=Object.create(ue);function me(_){["next","throw","return"].forEach((function(f){ht(_,f,(function(g){return this._invoke(f,g)}))}))}function te(_,f){function g(v,q,ot,It){var gt=Xt(_[v],_,q);if(gt.type!=="throw"){var Qt=gt.arg,ee=Qt.value;return ee&&tt(ee)=="object"&&dt.call(ee,"__await")?f.resolve(ee.__await).then((function(Rt){g("next",Rt,ot,It)}),(function(Rt){g("throw",Rt,ot,It)})):f.resolve(ee).then((function(Rt){Qt.value=Rt,ot(Qt)}),(function(Rt){return g("throw",Rt,ot,It)}))}It(gt.arg)}var U;Pt(this,"_invoke",{value:function(v,q){function ot(){return new f((function(It,gt){g(v,q,It,gt)}))}return U=U?U.then(ot,ot):ot()}})}function Ft(_,f,g){var U=Ht;return function(v,q){if(U===F)throw Error("Generator is already running");if(U===Nt){if(v==="throw")throw q;return{value:D,done:!0}}for(g.method=v,g.arg=q;;){var ot=g.delegate;if(ot){var It=Jt(ot,g);if(It){if(It===Ct)continue;return It}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(U===Ht)throw U=Nt,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);U=F;var gt=Xt(_,f,g);if(gt.type==="normal"){if(U=g.done?Nt:Zt,gt.arg===Ct)continue;return{value:gt.arg,done:g.done}}gt.type==="throw"&&(U=Nt,g.method="throw",g.arg=gt.arg)}}}function Jt(_,f){var g=f.method,U=_.iterator[g];if(U===D)return f.delegate=null,g==="throw"&&_.iterator.return&&(f.method="return",f.arg=D,Jt(_,f),f.method==="throw")||g!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+g+"' method")),Ct;var v=Xt(U,_.iterator,f.arg);if(v.type==="throw")return f.method="throw",f.arg=v.arg,f.delegate=null,Ct;var q=v.arg;return q?q.done?(f[_.resultName]=q.value,f.next=_.nextLoc,f.method!=="return"&&(f.method="next",f.arg=D),f.delegate=null,Ct):q:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,Ct)}function ne(_){var f={tryLoc:_[0]};1 in _&&(f.catchLoc=_[1]),2 in _&&(f.finallyLoc=_[2],f.afterLoc=_[3]),this.tryEntries.push(f)}function de(_){var f=_.completion||{};f.type="normal",delete f.arg,_.completion=f}function ye(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(ne,this),this.reset(!0)}function re(_){if(_||_===""){var f=_[At];if(f)return f.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var g=-1,U=function v(){for(;++g<_.length;)if(dt.call(_,g))return v.value=_[g],v.done=!1,v;return v.value=D,v.done=!0,v};return U.next=U}}throw new TypeError(tt(_)+" is not iterable")}return ie.prototype=qt,Pt(Gt,"constructor",{value:qt,configurable:!0}),Pt(qt,"constructor",{value:ie,configurable:!0}),ie.displayName=ht(qt,Et,"GeneratorFunction"),K.isGeneratorFunction=function(_){var f=typeof _=="function"&&_.constructor;return!!f&&(f===ie||(f.displayName||f.name)==="GeneratorFunction")},K.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,qt):(_.__proto__=qt,ht(_,Et,"GeneratorFunction")),_.prototype=Object.create(Gt),_},K.awrap=function(_){return{__await:_}},me(te.prototype),ht(te.prototype,St,(function(){return this})),K.AsyncIterator=te,K.async=function(_,f,g,U,v){v===void 0&&(v=Promise);var q=new te(Kt(_,f,g,U),v);return K.isGeneratorFunction(f)?q:q.next().then((function(ot){return ot.done?ot.value:q.next()}))},me(Gt),ht(Gt,Et,"Generator"),ht(Gt,At,(function(){return this})),ht(Gt,"toString",(function(){return"[object Generator]"})),K.keys=function(_){var f=Object(_),g=[];for(var U in f)g.push(U);return g.reverse(),function v(){for(;g.length;){var q=g.pop();if(q in f)return v.value=q,v.done=!1,v}return v.done=!0,v}},K.values=re,ye.prototype={constructor:ye,reset:function(_){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(de),!_)for(var f in this)f.charAt(0)==="t"&&dt.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=D)},stop:function(){this.done=!0;var _=this.tryEntries[0].completion;if(_.type==="throw")throw _.arg;return this.rval},dispatchException:function(_){if(this.done)throw _;var f=this;function g(gt,Qt){return q.type="throw",q.arg=_,f.next=gt,Qt&&(f.method="next",f.arg=D),!!Qt}for(var U=this.tryEntries.length-1;U>=0;--U){var v=this.tryEntries[U],q=v.completion;if(v.tryLoc==="root")return g("end");if(v.tryLoc<=this.prev){var ot=dt.call(v,"catchLoc"),It=dt.call(v,"finallyLoc");if(ot&&It){if(this.prev<v.catchLoc)return g(v.catchLoc,!0);if(this.prev<v.finallyLoc)return g(v.finallyLoc)}else if(ot){if(this.prev<v.catchLoc)return g(v.catchLoc,!0)}else{if(!It)throw Error("try statement without catch or finally");if(this.prev<v.finallyLoc)return g(v.finallyLoc)}}}},abrupt:function(_,f){for(var g=this.tryEntries.length-1;g>=0;--g){var U=this.tryEntries[g];if(U.tryLoc<=this.prev&&dt.call(U,"finallyLoc")&&this.prev<U.finallyLoc){var v=U;break}}v&&(_==="break"||_==="continue")&&v.tryLoc<=f&&f<=v.finallyLoc&&(v=null);var q=v?v.completion:{};return q.type=_,q.arg=f,v?(this.method="next",this.next=v.finallyLoc,Ct):this.complete(q)},complete:function(_,f){if(_.type==="throw")throw _.arg;return _.type==="break"||_.type==="continue"?this.next=_.arg:_.type==="return"?(this.rval=this.arg=_.arg,this.method="return",this.next="end"):_.type==="normal"&&f&&(this.next=f),Ct},finish:function(_){for(var f=this.tryEntries.length-1;f>=0;--f){var g=this.tryEntries[f];if(g.finallyLoc===_)return this.complete(g.completion,g.afterLoc),de(g),Ct}},catch:function(_){for(var f=this.tryEntries.length-1;f>=0;--f){var g=this.tryEntries[f];if(g.tryLoc===_){var U=g.completion;if(U.type==="throw"){var v=U.arg;de(g)}return v}}throw Error("illegal catch attempt")},delegateYield:function(_,f,g){return this.delegate={iterator:re(_),resultName:f,nextLoc:g},this.method==="next"&&(this.arg=D),Ct}},K}function ct(D,K,vt,dt,Pt,yt,At){try{var St=D[yt](At),Et=St.value}catch(ht){return void vt(ht)}St.done?K(Et):Promise.resolve(Et).then(dt,Pt)}function tt(D){return tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},tt(D)}var X="https://ms.jr.jd.com";function Lt(D){var K=D.host,vt=D.type,dt=vt===void 0?"post":vt,Pt=D.data,yt=D.path,At=yt===void 0?"":yt,St=D.config,Et=St===void 0?{}:St,ht=(Et.withCredentials,Et.isWG),Kt=ht===void 0||ht,Xt=Et.contentType,Ht=Xt===void 0?"application/x-www-form-urlencoded":Xt;return new Promise((function(Zt,F){wx.request({url:(K||X)+At,method:dt.toUpperCase(),data:Kt?S({reqData:JSON.stringify(Pt)}):Pt,header:{"content-type":Ht},success:function(Nt){Nt.statusCode===200?Zt(Nt.data):F({statusCode:Nt.statusCode,errMsg:Nt.errMsg,data:Nt.data})},fail:function(Nt){F(Nt)}})}))}function S(D){var K="";return tt(D)==="object"&&D!==null&&(Object.keys(D).map((function(vt){var dt=D[vt];return K+=vt+"="+encodeURIComponent(dt)+"&",""})),K.length>0&&(K=K.substr(0,K.length-1))),K}function et(D){return mt.apply(this,arguments)}function mt(){var D;return D=M().mark((function K(vt){var dt,Pt,yt,At,St,Et,ht,Kt,Xt,Ht;return M().wrap((function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return dt=vt.url,Pt=vt.channel,yt=vt.callback,N().init(),At=new(N()),St=At.nonce(),Et=At.sign(JSON.stringify({t:"".concat(new Date().getTime())}),St),ht="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),Kt="",Xt={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:dt,channel:Pt,clientCode:"0",antiRushInfo:Et}},Zt.next=12,Lt({host:"https://ms.jr.jd.com",type:"post",path:ht,config:{withCredentials:!0},data:Xt});case 12:(Ht=Zt.sent).resultCode===0&&Ht.resultData&&Ht.resultData.code==="00000"&&Ht.resultData.data&&(Kt=Ht.resultData.data.goldenKeyText),yt&&yt(Kt?{code:"0",msg:"command success",data:Kt}:{code:"-1",msg:"command empty"});case 15:case"end":return Zt.stop()}}),K)})),mt=function(){var K=this,vt=arguments;return new Promise((function(dt,Pt){var yt=D.apply(K,vt);function At(Et){ct(yt,dt,Pt,At,St,"next",Et)}function St(Et){ct(yt,dt,Pt,At,St,"throw",Et)}At(void 0)}))},mt.apply(this,arguments)}function it(D){return it=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},it(D)}function H(){H=function(){return K};var D,K={},vt=Object.prototype,dt=vt.hasOwnProperty,Pt=Object.defineProperty||function(_,f,g){_[f]=g.value},yt=typeof Symbol=="function"?Symbol:{},At=yt.iterator||"@@iterator",St=yt.asyncIterator||"@@asyncIterator",Et=yt.toStringTag||"@@toStringTag";function ht(_,f,g){return Object.defineProperty(_,f,{value:g,enumerable:!0,configurable:!0,writable:!0}),_[f]}try{ht({},"")}catch(_){ht=function(f,g,U){return f[g]=U}}function Kt(_,f,g,U){var v=f&&f.prototype instanceof se?f:se,q=Object.create(v.prototype),ot=new ye(U||[]);return Pt(q,"_invoke",{value:Ft(_,g,ot)}),q}function Xt(_,f,g){try{return{type:"normal",arg:_.call(f,g)}}catch(U){return{type:"throw",arg:U}}}K.wrap=Kt;var Ht="suspendedStart",Zt="suspendedYield",F="executing",Nt="completed",Ct={};function se(){}function ie(){}function qt(){}var ue={};ht(ue,At,(function(){return this}));var ae=Object.getPrototypeOf,Mt=ae&&ae(ae(re([])));Mt&&Mt!==vt&&dt.call(Mt,At)&&(ue=Mt);var Gt=qt.prototype=se.prototype=Object.create(ue);function me(_){["next","throw","return"].forEach((function(f){ht(_,f,(function(g){return this._invoke(f,g)}))}))}function te(_,f){function g(v,q,ot,It){var gt=Xt(_[v],_,q);if(gt.type!=="throw"){var Qt=gt.arg,ee=Qt.value;return ee&&it(ee)=="object"&&dt.call(ee,"__await")?f.resolve(ee.__await).then((function(Rt){g("next",Rt,ot,It)}),(function(Rt){g("throw",Rt,ot,It)})):f.resolve(ee).then((function(Rt){Qt.value=Rt,ot(Qt)}),(function(Rt){return g("throw",Rt,ot,It)}))}It(gt.arg)}var U;Pt(this,"_invoke",{value:function(v,q){function ot(){return new f((function(It,gt){g(v,q,It,gt)}))}return U=U?U.then(ot,ot):ot()}})}function Ft(_,f,g){var U=Ht;return function(v,q){if(U===F)throw Error("Generator is already running");if(U===Nt){if(v==="throw")throw q;return{value:D,done:!0}}for(g.method=v,g.arg=q;;){var ot=g.delegate;if(ot){var It=Jt(ot,g);if(It){if(It===Ct)continue;return It}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(U===Ht)throw U=Nt,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);U=F;var gt=Xt(_,f,g);if(gt.type==="normal"){if(U=g.done?Nt:Zt,gt.arg===Ct)continue;return{value:gt.arg,done:g.done}}gt.type==="throw"&&(U=Nt,g.method="throw",g.arg=gt.arg)}}}function Jt(_,f){var g=f.method,U=_.iterator[g];if(U===D)return f.delegate=null,g==="throw"&&_.iterator.return&&(f.method="return",f.arg=D,Jt(_,f),f.method==="throw")||g!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+g+"' method")),Ct;var v=Xt(U,_.iterator,f.arg);if(v.type==="throw")return f.method="throw",f.arg=v.arg,f.delegate=null,Ct;var q=v.arg;return q?q.done?(f[_.resultName]=q.value,f.next=_.nextLoc,f.method!=="return"&&(f.method="next",f.arg=D),f.delegate=null,Ct):q:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,Ct)}function ne(_){var f={tryLoc:_[0]};1 in _&&(f.catchLoc=_[1]),2 in _&&(f.finallyLoc=_[2],f.afterLoc=_[3]),this.tryEntries.push(f)}function de(_){var f=_.completion||{};f.type="normal",delete f.arg,_.completion=f}function ye(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(ne,this),this.reset(!0)}function re(_){if(_||_===""){var f=_[At];if(f)return f.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var g=-1,U=function v(){for(;++g<_.length;)if(dt.call(_,g))return v.value=_[g],v.done=!1,v;return v.value=D,v.done=!0,v};return U.next=U}}throw new TypeError(it(_)+" is not iterable")}return ie.prototype=qt,Pt(Gt,"constructor",{value:qt,configurable:!0}),Pt(qt,"constructor",{value:ie,configurable:!0}),ie.displayName=ht(qt,Et,"GeneratorFunction"),K.isGeneratorFunction=function(_){var f=typeof _=="function"&&_.constructor;return!!f&&(f===ie||(f.displayName||f.name)==="GeneratorFunction")},K.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,qt):(_.__proto__=qt,ht(_,Et,"GeneratorFunction")),_.prototype=Object.create(Gt),_},K.awrap=function(_){return{__await:_}},me(te.prototype),ht(te.prototype,St,(function(){return this})),K.AsyncIterator=te,K.async=function(_,f,g,U,v){v===void 0&&(v=Promise);var q=new te(Kt(_,f,g,U),v);return K.isGeneratorFunction(f)?q:q.next().then((function(ot){return ot.done?ot.value:q.next()}))},me(Gt),ht(Gt,Et,"Generator"),ht(Gt,At,(function(){return this})),ht(Gt,"toString",(function(){return"[object Generator]"})),K.keys=function(_){var f=Object(_),g=[];for(var U in f)g.push(U);return g.reverse(),function v(){for(;g.length;){var q=g.pop();if(q in f)return v.value=q,v.done=!1,v}return v.done=!0,v}},K.values=re,ye.prototype={constructor:ye,reset:function(_){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(de),!_)for(var f in this)f.charAt(0)==="t"&&dt.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=D)},stop:function(){this.done=!0;var _=this.tryEntries[0].completion;if(_.type==="throw")throw _.arg;return this.rval},dispatchException:function(_){if(this.done)throw _;var f=this;function g(gt,Qt){return q.type="throw",q.arg=_,f.next=gt,Qt&&(f.method="next",f.arg=D),!!Qt}for(var U=this.tryEntries.length-1;U>=0;--U){var v=this.tryEntries[U],q=v.completion;if(v.tryLoc==="root")return g("end");if(v.tryLoc<=this.prev){var ot=dt.call(v,"catchLoc"),It=dt.call(v,"finallyLoc");if(ot&&It){if(this.prev<v.catchLoc)return g(v.catchLoc,!0);if(this.prev<v.finallyLoc)return g(v.finallyLoc)}else if(ot){if(this.prev<v.catchLoc)return g(v.catchLoc,!0)}else{if(!It)throw Error("try statement without catch or finally");if(this.prev<v.finallyLoc)return g(v.finallyLoc)}}}},abrupt:function(_,f){for(var g=this.tryEntries.length-1;g>=0;--g){var U=this.tryEntries[g];if(U.tryLoc<=this.prev&&dt.call(U,"finallyLoc")&&this.prev<U.finallyLoc){var v=U;break}}v&&(_==="break"||_==="continue")&&v.tryLoc<=f&&f<=v.finallyLoc&&(v=null);var q=v?v.completion:{};return q.type=_,q.arg=f,v?(this.method="next",this.next=v.finallyLoc,Ct):this.complete(q)},complete:function(_,f){if(_.type==="throw")throw _.arg;return _.type==="break"||_.type==="continue"?this.next=_.arg:_.type==="return"?(this.rval=this.arg=_.arg,this.method="return",this.next="end"):_.type==="normal"&&f&&(this.next=f),Ct},finish:function(_){for(var f=this.tryEntries.length-1;f>=0;--f){var g=this.tryEntries[f];if(g.finallyLoc===_)return this.complete(g.completion,g.afterLoc),de(g),Ct}},catch:function(_){for(var f=this.tryEntries.length-1;f>=0;--f){var g=this.tryEntries[f];if(g.tryLoc===_){var U=g.completion;if(U.type==="throw"){var v=U.arg;de(g)}return v}}throw Error("illegal catch attempt")},delegateYield:function(_,f,g){return this.delegate={iterator:re(_),resultName:f,nextLoc:g},this.method==="next"&&(this.arg=D),Ct}},K}function wt(D,K,vt,dt,Pt,yt,At){try{var St=D[yt](At),Et=St.value}catch(ht){return void vt(ht)}St.done?K(Et):Promise.resolve(Et).then(dt,Pt)}function R(D){return b.apply(this,arguments)}function b(){var D;return D=H().mark((function K(vt){var dt,Pt,yt;return H().wrap((function(At){for(;;)switch(At.prev=At.next){case 0:return dt=vt.url,Pt=vt.channel,yt=vt.callback,At.next=3,et({url:dt,channel:Pt,callback:yt});case 3:case"end":return At.stop()}}),K)})),b=function(){var K=this,vt=arguments;return new Promise((function(dt,Pt){var yt=D.apply(K,vt);function At(Et){wt(yt,dt,Pt,At,St,"next",Et)}function St(Et){wt(yt,dt,Pt,At,St,"throw",Et)}At(void 0)}))},b.apply(this,arguments)}var Y={getJrCommand:R};(l=A.hmd(l)).exports&&(l.exports=Y,l.exports.getJrCommand=R),typeof window!="undefined"&&(window.LyyGetCommandSDK=Y);let O=Y},307:function(l,h,A){var P,N,M;function ct(tt){return ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X},ct(tt)}M=function(){"use strict";function tt(t){return(tt=typeof Symbol=="function"&&ct(Symbol.iterator)=="symbol"?function(o){return ct(o)}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":ct(o)})(t)}function X(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}function Lt(t,o){for(var u=0;u<o.length;u++){var c=o[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function S(t,o,u){return o&&Lt(t.prototype,o),u&&Lt(t,u),t}function et(t,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(o&&o.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),o&&it(t,o)}function mt(t){return(mt=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(t)}function it(t,o){return(it=Object.setPrototypeOf||function(u,c){return u.__proto__=c,u})(t,o)}function H(t){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(u){return!1}})();return function(){var u,c=mt(t);return(function(p,m){if(m&&(ct(m)=="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E})(p)})(this,o?(u=mt(this).constructor,Reflect.construct(c,arguments,u)):c.apply(this,arguments))}}function wt(t){return(function(o){if(Array.isArray(o))return R(o)})(t)||(function(o){if(typeof Symbol!="undefined"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)})(t)||(function(o,u){if(o){if(typeof o=="string")return R(o,u);var c=Object.prototype.toString.call(o).slice(8,-1);return(c=c==="Object"&&o.constructor?o.constructor.name:c)==="Map"||c==="Set"?Array.from(o):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?R(o,u):void 0}})(t)||(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 R(t,o){(o==null||o>t.length)&&(o=t.length);for(var u=0,c=new Array(o);u<o;u++)c[u]=t[u];return c}var
|
|
3
|
-
`),c+=
|
|
4
|
-
`),c+=St[t[j]>>2]+St[(3&t[j])<<4|t[j+1]>>4]+St[(15&t[j+1])<<2|t[j+2]>>6]+St[63&t[j+2]];for(o=0;o<u;o++)c+="=";return c},b4_decode:function(t){var o=0,u=0,c=(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length%4;if(2<c)return null;for(o=0;o<c;o++)if(t.charAt(t.length-o-1)!="=")return null;var p,m,E,L,C=new Array(3*(t.length-c)/4);for(o=0,u=0;u<C.length;)p=St.indexOf(t.charAt(o++)),m=St.indexOf(t.charAt(o++)),E=St.indexOf(t.charAt(o++)),L=St.indexOf(t.charAt(o++)),C[u++]=p<<2|m>>4,C[u++]=(15&m)<<4|E>>2,C[u++]=(3&E)<<6|L;for(o=0;o<c;o++)if(C.pop()!=0)return null;return C}};function ht(){}ht.encode=function(t,o,u){for(var c=new Array(2*u),p=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),m=o,E=0;m<u+o;m++,E++)c[E]=p[(255&t[m])>>4],c[++E]=p[15&t[m]];return c.join("")},ht.decode=function(t){if(t==null||t==""||t.length%2!=0)return null;for(var o=t.length/2,u=ht.toCharCodeArray(t),c=new Array(o),p=0;p<o;p++){if(48<=u[2*p]&&u[2*p]<=57)c[p]=u[2*p]-48<<4;else if(65<=u[2*p]&&u[2*p]<=70)c[p]=u[2*p]-65+10<<4;else{if(!(97<=u[2*p]&&u[2*p]<=102))return null;c[p]=u[2*p]-97+10<<4}if(48<=u[2*p+1]&&u[2*p+1]<=57)c[p]=c[p]|u[2*p+1]-48;else if(65<=u[2*p+1]&&u[2*p+1]<=70)c[p]=c[p]|u[2*p+1]-65+10;else{if(!(97<=u[2*p+1]&&u[2*p+1]<=102))return null;c[p]=c[p]|u[2*p+1]-97+10}}return c},ht.toCharCodeArray=function(t){for(var o=new Array(t.length),u=0;u<t.length;u++)o[u]=t.charCodeAt(u);return o};var Kt=ht,Xt=Kt;(Jt=function(){}).utf8StrToh6=function(t){t=encodeURIComponent(t);for(var o=unescape(t),u=o.length,c=[],p=0;p<u;p++)c[p]=o.charCodeAt(p).toString(16);return c.join("")},Jt.utf8StrToBytes=function(t){t=encodeURIComponent(t);for(var o=unescape(t),u=o.length,c=[],p=0;p<u;p++)c[p]=o.charCodeAt(p);return c},Jt.hexToUtf8Str=function(t){for(var o=Xt.decode(t),u=[],c=0;c<o.length;c++)u.push(String.fromCharCode(o[c]));return decodeURIComponent(escape(u.join("")))},Jt.bytesToUtf8Str=function(t){for(var o=t,u=[],c=0;c<o.length;c++)u.push(String.fromCharCode(o[c]));return decodeURIComponent(escape(u.join("")))},Jt.intToByte=function(t){return new Array(t>>24&255,t>>16&255,t>>8&255,255&t)},Jt.byteToInt=function(t,o){return o+3<t.length?t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3]:o+2<t.length?t[o+1]<<16|t[o+2]<<8|t[o+3]:o+1<t.length?t[o]<<8|t[o+1]:t[o]};var Ht,Zt=Jt,F={exports:{}};Ht=F,function(){function t(n,i,s){n!=null&&(typeof n=="number"?this.fromNumber(n,i,s):i==null&&typeof n!="string"?this.fromString(n,256):this.fromString(n,i))}function o(){return new t(null)}var u=(u=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(t.prototype.am=function(n,i,s,y,I,x){for(var V=32767&i,k=i>>15;0<=--x;){var xt=32767&this[n],$t=this[n++]>>15,ce=k*xt+$t*V;I=((xt=V*xt+((32767&ce)<<15)+s[y]+(1073741823&I))>>>30)+(ce>>>15)+k*$t+(I>>>30),s[y++]=1073741823&xt}return I},30):u&&navigator.appName!="Netscape"?(t.prototype.am=function(n,i,s,y,I,x){for(;0<=--x;){var V=i*this[n++]+s[y]+I;I=Math.floor(V/67108864),s[y++]=67108863&V}return I},26):(t.prototype.am=function(n,i,s,y,I,x){for(var V=16383&i,k=i>>14;0<=--x;){var xt=16383&this[n],$t=this[n++]>>14,ce=k*xt+$t*V;I=((xt=V*xt+((16383&ce)<<14)+s[y]+I)>>28)+(ce>>14)+k*$t,s[y++]=268435455&xt}return I},28);t.prototype.DB=u,t.prototype.DM=(1<<u)-1,t.prototype.DV=1<<u,t.prototype.FV=Math.pow(2,52),t.prototype.F1=52-u,t.prototype.F2=2*u-52;for(var c=new Array,p=48,m=0;m<=9;++m)c[p++]=m;for(p=97,m=10;m<36;++m)c[p++]=m;for(p=65,m=10;m<36;++m)c[p++]=m;function E(n){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(n)}function L(n,i){return(n=c[n.charCodeAt(i)])==null?-1:n}function C(n){var i=o();return i.fromInt(n),i}function st(n){var i,s=1;return(i=n>>>16)!=0&&(n=i,s+=16),(i=n>>8)!=0&&(n=i,s+=8),(i=n>>4)!=0&&(n=i,s+=4),(i=n>>2)!=0&&(n=i,s+=2),(i=n>>1)!=0&&(n=i,s+=1),s}function lt(n){this.m=n}function w(n){this.m=n,this.mp=n.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<n.DB-15)-1,this.mt2=2*n.t}function Q(n,i){return n&i}function nt(n,i){return n|i}function Z(n,i){return n^i}function ft(n,i){return n&~i}function pt(){}function Ot(n){return n}function B(n){this.r2=o(),this.q3=o(),t.ONE.dlShiftTo(2*n.t,this.r2),this.mu=this.r2.divide(n),this.m=n}lt.prototype.convert=function(n){return n.s<0||0<=n.compareTo(this.m)?n.mod(this.m):n},lt.prototype.revert=function(n){return n},lt.prototype.reduce=function(n){n.divRemTo(this.m,null,n)},lt.prototype.mulTo=function(n,i,s){n.multiplyTo(i,s),this.reduce(s)},lt.prototype.sqrTo=function(n,i){n.squareTo(i),this.reduce(i)},w.prototype.convert=function(n){var i=o();return n.abs().dlShiftTo(this.m.t,i),i.divRemTo(this.m,null,i),n.s<0&&0<i.compareTo(t.ZERO)&&this.m.subTo(i,i),i},w.prototype.revert=function(n){var i=o();return n.copyTo(i),this.reduce(i),i},w.prototype.reduce=function(n){for(;n.t<=this.mt2;)n[n.t++]=0;for(var i=0;i<this.m.t;++i){var s=32767&n[i],y=s*this.mpl+((s*this.mph+(n[i]>>15)*this.mpl&this.um)<<15)&n.DM;for(n[s=i+this.m.t]+=this.m.am(0,y,n,i,0,this.m.t);n[s]>=n.DV;)n[s]-=n.DV,n[++s]++}n.clamp(),n.drShiftTo(this.m.t,n),0<=n.compareTo(this.m)&&n.subTo(this.m,n)},w.prototype.mulTo=function(n,i,s){n.multiplyTo(i,s),this.reduce(s)},w.prototype.sqrTo=function(n,i){n.squareTo(i),this.reduce(i)},t.prototype.copyTo=function(n){for(var i=this.t-1;0<=i;--i)n[i]=this[i];n.t=this.t,n.s=this.s},t.prototype.fromInt=function(n){this.t=1,this.s=n<0?-1:0,0<n?this[0]=n:n<-1?this[0]=n+this.DV:this.t=0},t.prototype.fromString=function(n,i){var s;if(i==16)s=4;else if(i==8)s=3;else if(i==256)s=8;else if(i==2)s=1;else if(i==32)s=5;else{if(i!=4)return void this.fromRadix(n,i);s=2}this.t=0,this.s=0;for(var y=n.length,I=!1,x=0;0<=--y;){var V=s==8?255&n[y]:L(n,y);V<0?n.charAt(y)=="-"&&(I=!0):(I=!1,x==0?this[this.t++]=V:x+s>this.DB?(this[this.t-1]|=(V&(1<<this.DB-x)-1)<<x,this[this.t++]=V>>this.DB-x):this[this.t-1]|=V<<x,(x+=s)>=this.DB&&(x-=this.DB))}s==8&&128&n[0]&&(this.s=-1,0<x&&(this[this.t-1]|=(1<<this.DB-x)-1<<x)),this.clamp(),I&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var n=this.s&this.DM;0<this.t&&this[this.t-1]==n;)--this.t},t.prototype.dlShiftTo=function(n,i){for(var s=this.t-1;0<=s;--s)i[s+n]=this[s];for(s=n-1;0<=s;--s)i[s]=0;i.t=this.t+n,i.s=this.s},t.prototype.drShiftTo=function(n,i){for(var s=n;s<this.t;++s)i[s-n]=this[s];i.t=Math.max(this.t-n,0),i.s=this.s},t.prototype.lShiftTo=function(n,i){for(var s=n%this.DB,y=this.DB-s,I=(1<<y)-1,x=Math.floor(n/this.DB),V=this.s<<s&this.DM,k=this.t-1;0<=k;--k)i[k+x+1]=this[k]>>y|V,V=(this[k]&I)<<s;for(k=x-1;0<=k;--k)i[k]=0;i[x]=V,i.t=this.t+x+1,i.s=this.s,i.clamp()},t.prototype.rShiftTo=function(n,i){i.s=this.s;var s=Math.floor(n/this.DB);if(s>=this.t)i.t=0;else{var y=n%this.DB,I=this.DB-y,x=(1<<y)-1;i[0]=this[s]>>y;for(var V=s+1;V<this.t;++V)i[V-s-1]|=(this[V]&x)<<I,i[V-s]=this[V]>>y;0<y&&(i[this.t-s-1]|=(this.s&x)<<I),i.t=this.t-s,i.clamp()}},t.prototype.subTo=function(n,i){for(var s=0,y=0,I=Math.min(n.t,this.t);s<I;)y+=this[s]-n[s],i[s++]=y&this.DM,y>>=this.DB;if(n.t<this.t){for(y-=n.s;s<this.t;)y+=this[s],i[s++]=y&this.DM,y>>=this.DB;y+=this.s}else{for(y+=this.s;s<n.t;)y-=n[s],i[s++]=y&this.DM,y>>=this.DB;y-=n.s}i.s=y<0?-1:0,y<-1?i[s++]=this.DV+y:0<y&&(i[s++]=y),i.t=s,i.clamp()},t.prototype.multiplyTo=function(n,i){var s=this.abs(),y=n.abs(),I=s.t;for(i.t=I+y.t;0<=--I;)i[I]=0;for(I=0;I<y.t;++I)i[I+s.t]=s.am(0,y[I],i,I,0,s.t);i.s=0,i.clamp(),this.s!=n.s&&t.ZERO.subTo(i,i)},t.prototype.squareTo=function(n){for(var i=this.abs(),s=n.t=2*i.t;0<=--s;)n[s]=0;for(s=0;s<i.t-1;++s){var y=i.am(s,i[s],n,2*s,0,1);(n[s+i.t]+=i.am(s+1,2*i[s],n,2*s+1,y,i.t-s-1))>=i.DV&&(n[s+i.t]-=i.DV,n[s+i.t+1]=1)}0<n.t&&(n[n.t-1]+=i.am(s,i[s],n,2*s,0,1)),n.s=0,n.clamp()},t.prototype.divRemTo=function(n,i,s){var y=n.abs();if(!(y.t<=0)){if(($t=this.abs()).t<y.t)return i!=null&&i.fromInt(0),void(s!=null&&this.copyTo(s));s==null&&(s=o());var I=o(),x=this.s,V=n.s;0<(n=this.DB-st(y[y.t-1]))?(y.lShiftTo(n,I),$t.lShiftTo(n,s)):(y.copyTo(I),$t.copyTo(s));var k=I.t,xt=I[k-1];if(xt!=0){var $t=xt*(1<<this.F1)+(1<k?I[k-2]>>this.F2:0),ce=this.FV/$t,_e=(1<<this.F1)/$t,Re=1<<this.F2,jt=s.t,Ae=jt-k,Bt=i==null?o():i;for(I.dlShiftTo(Ae,Bt),0<=s.compareTo(Bt)&&(s[s.t++]=1,s.subTo(Bt,s)),t.ONE.dlShiftTo(k,Bt),Bt.subTo(I,I);I.t<k;)I[I.t++]=0;for(;0<=--Ae;){var rn=s[--jt]==xt?this.DM:Math.floor(s[jt]*ce+(s[jt-1]+Re)*_e);if((s[jt]+=I.am(0,rn,s,Ae,0,k))<rn)for(I.dlShiftTo(Ae,Bt),s.subTo(Bt,s);s[jt]<--rn;)s.subTo(Bt,s)}i!=null&&(s.drShiftTo(k,i),x!=V&&t.ZERO.subTo(i,i)),s.t=k,s.clamp(),0<n&&s.rShiftTo(n,s),x<0&&t.ZERO.subTo(s,s)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var n=this[0];if(!(1&n))return 0;var i=3&n;return 0<(i=(i=(i=(i=i*(2-(15&n)*i)&15)*(2-(255&n)*i)&255)*(2-((65535&n)*i&65535))&65535)*(2-n*i%this.DV)%this.DV)?this.DV-i:-i},t.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},t.prototype.exp=function(n,i){if(4294967295<n||n<1)return t.ONE;var s,y=o(),I=o(),x=i.convert(this),V=st(n)-1;for(x.copyTo(y);0<=--V;)i.sqrTo(y,I),0<(n&1<<V)?i.mulTo(I,x,y):(s=y,y=I,I=s);return i.revert(y)},t.prototype.toString=function(n){if(this.s<0)return"-"+this.negate().toString(n);var i;if(n==16)i=4;else if(n==8)i=3;else if(n==2)i=1;else if(n==32)i=5;else{if(n!=4)return this.toRadix(n);i=2}var s,y=(1<<i)-1,I=!1,x="",V=this.t,k=this.DB-V*this.DB%i;if(0<V--)for(k<this.DB&&0<(s=this[V]>>k)&&(I=!0,x=E(s));0<=V;)k<i?(s=(this[V]&(1<<k)-1)<<i-k,s|=this[--V]>>(k+=this.DB-i)):(s=this[V]>>(k-=i)&y,k<=0&&(k+=this.DB,--V)),(I=0<s||I)&&(x+=E(s));return I?x:"0"},t.prototype.negate=function(){var n=o();return t.ZERO.subTo(this,n),n},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(n){var i=this.s-n.s;if(i!=0)return i;var s=this.t;if((i=s-n.t)!=0)return this.s<0?-i:i;for(;0<=--s;)if((i=this[s]-n[s])!=0)return i;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+st(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(n){var i=o();return this.abs().divRemTo(n,null,i),this.s<0&&0<i.compareTo(t.ZERO)&&n.subTo(i,i),i},t.prototype.modPowInt=function(n,i){return i=new(n<256||i.isEven()?lt:w)(i),this.exp(n,i)},t.ZERO=C(0),t.ONE=C(1),pt.prototype.convert=Ot,pt.prototype.revert=Ot,pt.prototype.mulTo=function(n,i,s){n.multiplyTo(i,s)},pt.prototype.sqrTo=function(n,i){n.squareTo(i)},B.prototype.convert=function(n){if(n.s<0||n.t>2*this.m.t)return n.mod(this.m);if(n.compareTo(this.m)<0)return n;var i=o();return n.copyTo(i),this.reduce(i),i},B.prototype.revert=function(n){return n},B.prototype.reduce=function(n){for(n.drShiftTo(this.m.t-1,this.r2),n.t>this.m.t+1&&(n.t=this.m.t+1,n.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);n.compareTo(this.r2)<0;)n.dAddOffset(1,this.m.t+1);for(n.subTo(this.r2,n);0<=n.compareTo(this.m);)n.subTo(this.m,n)},B.prototype.mulTo=function(n,i,s){n.multiplyTo(i,s),this.reduce(s)},B.prototype.sqrTo=function(n,i){n.squareTo(i),this.reduce(i)};var $,G=[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],W=(1<<26)/G[G.length-1];function z(){var n;n=new Date().getTime(),Dt[rt++]^=255&n,Dt[rt++]^=n>>8&255,Dt[rt++]^=n>>16&255,Dt[rt++]^=n>>24&255,nn<=rt&&(rt-=nn)}if(t.prototype.chunkSize=function(n){return Math.floor(Math.LN2*this.DB/Math.log(n))},t.prototype.toRadix=function(n){if(n==null&&(n=10),this.signum()==0||n<2||36<n)return"0";var i=this.chunkSize(n),s=Math.pow(n,i),y=C(s),I=o(),x=o(),V="";for(this.divRemTo(y,I,x);0<I.signum();)V=(s+x.intValue()).toString(n).substr(1)+V,I.divRemTo(y,I,x);return x.intValue().toString(n)+V},t.prototype.fromRadix=function(n,i){this.fromInt(0);for(var s=this.chunkSize(i=i==null?10:i),y=Math.pow(i,s),I=!1,x=0,V=0,k=0;k<n.length;++k){var xt=L(n,k);xt<0?n.charAt(k)=="-"&&this.signum()==0&&(I=!0):(V=i*V+xt,++x>=s&&(this.dMultiply(y),this.dAddOffset(V,0),V=x=0))}0<x&&(this.dMultiply(Math.pow(i,x)),this.dAddOffset(V,0)),I&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(n,i,s){if(typeof i=="number")if(n<2)this.fromInt(1);else for(this.fromNumber(n,s),this.testBit(n-1)||this.bitwiseTo(t.ONE.shiftLeft(n-1),nt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(i);)this.dAddOffset(2,0),this.bitLength()>n&&this.subTo(t.ONE.shiftLeft(n-1),this);else{var y=new Array;s=7&n,y.length=1+(n>>3),i.nextBytes(y),0<s?y[0]&=(1<<s)-1:y[0]=0,this.fromString(y,256)}},t.prototype.bitwiseTo=function(n,i,s){for(var y,I=Math.min(n.t,this.t),x=0;x<I;++x)s[x]=i(this[x],n[x]);if(n.t<this.t){for(y=n.s&this.DM,x=I;x<this.t;++x)s[x]=i(this[x],y);s.t=this.t}else{for(y=this.s&this.DM,x=I;x<n.t;++x)s[x]=i(y,n[x]);s.t=n.t}s.s=i(this.s,n.s),s.clamp()},t.prototype.changeBit=function(n,i){return n=t.ONE.shiftLeft(n),this.bitwiseTo(n,i,n),n},t.prototype.addTo=function(n,i){for(var s=0,y=0,I=Math.min(n.t,this.t);s<I;)y+=this[s]+n[s],i[s++]=y&this.DM,y>>=this.DB;if(n.t<this.t){for(y+=n.s;s<this.t;)y+=this[s],i[s++]=y&this.DM,y>>=this.DB;y+=this.s}else{for(y+=this.s;s<n.t;)y+=n[s],i[s++]=y&this.DM,y>>=this.DB;y+=n.s}i.s=y<0?-1:0,0<y?i[s++]=y:y<-1&&(i[s++]=this.DV+y),i.t=s,i.clamp()},t.prototype.dMultiply=function(n){this[this.t]=this.am(0,n-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(n,i){if(n!=0){for(;this.t<=i;)this[this.t++]=0;for(this[i]+=n;this[i]>=this.DV;)this[i]-=this.DV,++i>=this.t&&(this[this.t++]=0),++this[i]}},t.prototype.multiplyLowerTo=function(n,i,s){var y,I=Math.min(this.t+n.t,i);for(s.s=0,s.t=I;0<I;)s[--I]=0;for(y=s.t-this.t;I<y;++I)s[I+this.t]=this.am(0,n[I],s,I,0,this.t);for(y=Math.min(n.t,i);I<y;++I)this.am(0,n[I],s,I,0,i-I);s.clamp()},t.prototype.multiplyUpperTo=function(n,i,s){var y=s.t=this.t+n.t- --i;for(s.s=0;0<=--y;)s[y]=0;for(y=Math.max(i-this.t,0);y<n.t;++y)s[this.t+y-i]=this.am(i-y,n[y],s,0,0,this.t+y-i);s.clamp(),s.drShiftTo(1,s)},t.prototype.modInt=function(n){if(n<=0)return 0;var i=this.DV%n,s=this.s<0?n-1:0;if(0<this.t)if(i==0)s=this[0]%n;else for(var y=this.t-1;0<=y;--y)s=(i*s+this[y])%n;return s},t.prototype.millerRabin=function(n){var i=this.subtract(t.ONE),s=i.getLowestSetBit();if(s<=0)return!1;var y=i.shiftRight(s);G.length<(n=n+1>>1)&&(n=G.length);for(var I=o(),x=0;x<n;++x){I.fromInt(G[Math.floor(Math.random()*G.length)]);var V=I.modPow(y,this);if(V.compareTo(t.ONE)!=0&&V.compareTo(i)!=0){for(var k=1;k++<s&&V.compareTo(i)!=0;)if((V=V.modPowInt(2,this)).compareTo(t.ONE)==0)return!1;if(V.compareTo(i)!=0)return!1}}return!0},t.prototype.clone=function(){var n=o();return this.copyTo(n),n},t.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]},t.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},t.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var n=this.t,i=new Array;i[0]=this.s;var s,y=this.DB-n*this.DB%8,I=0;if(0<n--)for(y<this.DB&&(s=this[n]>>y)!=(this.s&this.DM)>>y&&(i[I++]=s|this.s<<this.DB-y);0<=n;)y<8?(s=(this[n]&(1<<y)-1)<<8-y,s|=this[--n]>>(y+=this.DB-8)):(s=this[n]>>(y-=8)&255,y<=0&&(y+=this.DB,--n)),128&s&&(s|=-256),I==0&&(128&this.s)!=(128&s)&&++I,(0<I||s!=this.s)&&(i[I++]=s);return i},t.prototype.equals=function(n){return this.compareTo(n)==0},t.prototype.min=function(n){return this.compareTo(n)<0?this:n},t.prototype.max=function(n){return 0<this.compareTo(n)?this:n},t.prototype.and=function(n){var i=o();return this.bitwiseTo(n,Q,i),i},t.prototype.or=function(n){var i=o();return this.bitwiseTo(n,nt,i),i},t.prototype.xor=function(n){var i=o();return this.bitwiseTo(n,Z,i),i},t.prototype.andNot=function(n){var i=o();return this.bitwiseTo(n,ft,i),i},t.prototype.not=function(){for(var n=o(),i=0;i<this.t;++i)n[i]=this.DM&~this[i];return n.t=this.t,n.s=~this.s,n},t.prototype.shiftLeft=function(n){var i=o();return n<0?this.rShiftTo(-n,i):this.lShiftTo(n,i),i},t.prototype.shiftRight=function(n){var i=o();return n<0?this.lShiftTo(-n,i):this.rShiftTo(n,i),i},t.prototype.getLowestSetBit=function(){for(var n=0;n<this.t;++n)if(this[n]!=0)return n*this.DB+(function(i){if(i==0)return-1;var s=0;return!(65535&i)&&(i>>=16,s+=16),!(255&i)&&(i>>=8,s+=8),!(15&i)&&(i>>=4,s+=4),!(3&i)&&(i>>=2,s+=2),!(1&i)&&++s,s})(this[n]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var n=0,i=this.s&this.DM,s=0;s<this.t;++s)n+=(function(y){for(var I=0;y!=0;)y&=y-1,++I;return I})(this[s]^i);return n},t.prototype.testBit=function(n){var i=Math.floor(n/this.DB);return i>=this.t?this.s!=0:!!(this[i]&1<<n%this.DB)},t.prototype.setBit=function(n){return this.changeBit(n,nt)},t.prototype.clearBit=function(n){return this.changeBit(n,ft)},t.prototype.flipBit=function(n){return this.changeBit(n,Z)},t.prototype.add=function(n){var i=o();return this.addTo(n,i),i},t.prototype.subtract=function(n){var i=o();return this.subTo(n,i),i},t.prototype.multiply=function(n){var i=o();return this.multiplyTo(n,i),i},t.prototype.divide=function(n){var i=o();return this.divRemTo(n,i,null),i},t.prototype.remainder=function(n){var i=o();return this.divRemTo(n,null,i),i},t.prototype.divideAndRemainder=function(n){var i=o(),s=o();return this.divRemTo(n,i,s),new Array(i,s)},t.prototype.modPow=function(n,i){var s=n.bitLength(),y=C(1);if(s<=0)return y;var I=s<18?1:s<48?3:s<144?4:s<768?5:6,x=new(s<8?lt:i.isEven()?B:w)(i),V=new Array,k=3,xt=I-1,$t=(1<<I)-1;if(V[1]=x.convert(this),1<I){var ce=o();for(x.sqrTo(V[1],ce);k<=$t;)V[k]=o(),x.mulTo(ce,V[k-2],V[k]),k+=2}var _e,Re,jt=n.t-1,Ae=!0,Bt=o();for(s=st(n[jt])-1;0<=jt;){for(xt<=s?_e=n[jt]>>s-xt&$t:(_e=(n[jt]&(1<<s+1)-1)<<xt-s,0<jt&&(_e|=n[jt-1]>>this.DB+s-xt)),k=I;!(1&_e);)_e>>=1,--k;if((s-=k)<0&&(s+=this.DB,--jt),Ae)V[_e].copyTo(y),Ae=!1;else{for(;1<k;)x.sqrTo(y,Bt),x.sqrTo(Bt,y),k-=2;0<k?x.sqrTo(y,Bt):(Re=y,y=Bt,Bt=Re),x.mulTo(Bt,V[_e],y)}for(;0<=jt&&!(n[jt]&1<<s);)x.sqrTo(y,Bt),Re=y,y=Bt,Bt=Re,--s<0&&(s=this.DB-1,--jt)}return x.revert(y)},t.prototype.modInverse=function(n){var i=n.isEven();if(this.isEven()&&i||n.signum()==0)return t.ZERO;for(var s=n.clone(),y=this.clone(),I=C(1),x=C(0),V=C(0),k=C(1);s.signum()!=0;){for(;s.isEven();)s.rShiftTo(1,s),i?(I.isEven()&&x.isEven()||(I.addTo(this,I),x.subTo(n,x)),I.rShiftTo(1,I)):x.isEven()||x.subTo(n,x),x.rShiftTo(1,x);for(;y.isEven();)y.rShiftTo(1,y),i?(V.isEven()&&k.isEven()||(V.addTo(this,V),k.subTo(n,k)),V.rShiftTo(1,V)):k.isEven()||k.subTo(n,k),k.rShiftTo(1,k);0<=s.compareTo(y)?(s.subTo(y,s),i&&I.subTo(V,I),x.subTo(k,x)):(y.subTo(s,y),i&&V.subTo(I,V),k.subTo(x,k))}return y.compareTo(t.ONE)!=0?t.ZERO:0<=k.compareTo(n)?k.subtract(n):k.signum()<0?(k.addTo(n,k),k.signum()<0?k.add(n):k):k},t.prototype.pow=function(n){return this.exp(n,new pt)},t.prototype.gcd=function(n){var i=this.s<0?this.negate():this.clone(),s=n.s<0?n.negate():n.clone();i.compareTo(s)<0&&(I=i,i=s,s=I);var y=i.getLowestSetBit(),I=s.getLowestSetBit();if(I<0)return i;for(0<(I=y<I?y:I)&&(i.rShiftTo(I,i),s.rShiftTo(I,s));0<i.signum();)0<(y=i.getLowestSetBit())&&i.rShiftTo(y,i),0<(y=s.getLowestSetBit())&&s.rShiftTo(y,s),0<=i.compareTo(s)?(i.subTo(s,i),i.rShiftTo(1,i)):(s.subTo(i,s),s.rShiftTo(1,s));return 0<I&&s.lShiftTo(I,s),s},t.prototype.isProbablePrime=function(n){var i,s=this.abs();if(s.t==1&&s[0]<=G[G.length-1]){for(i=0;i<G.length;++i)if(s[0]==G[i])return!0;return!1}if(s.isEven())return!1;for(i=1;i<G.length;){for(var y=G[i],I=i+1;I<G.length&&y<W;)y*=G[I++];for(y=s.modInt(y);i<I;)if(y%G[i++]==0)return!1}return s.millerRabin(n)},t.prototype.square=function(){var n=o();return this.squareTo(n),n},t.prototype.Barrett=B,Dt==null){var Dt=new Array,rt=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var Tt=new Uint8Array(32);for(window.crypto.getRandomValues(Tt),kt=0;kt<32;++kt)Dt[rt++]=Tt[kt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Yt=window.crypto.random(32),kt=0;kt<Yt.length;++kt)Dt[rt++]=255&Yt.charCodeAt(kt)}for(;rt<nn;)kt=Math.floor(65536*Math.random()),Dt[rt++]=kt>>>8,Dt[rt++]=255&kt;rt=0,z()}function tn(){if($==null){for(z(),($=new en).init(Dt),rt=0;rt<Dt.length;++rt)Dt[rt]=0;rt=0}return $.next()}function xn(){}function en(){this.i=0,this.j=0,this.S=new Array}xn.prototype.nextBytes=function(n){for(var i=0;i<n.length;++i)n[i]=tn()},en.prototype.init=function(n){for(var i,s,y=0;y<256;++y)this.S[y]=y;for(y=i=0;y<256;++y)i=i+this.S[y]+n[y%n.length]&255,s=this.S[y],this.S[y]=this.S[i],this.S[i]=s;this.i=0,this.j=0},en.prototype.next=function(){var n;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,n=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=n,this.S[n+this.S[this.i]&255]};var nn=256;Ht.exports={default:t,BigInteger:t,SecureRandom:xn}}.call(b);var Nt=F.exports.BigInteger,Ct=(function(){function t(){X(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return S(t,[{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,u=o.toString(16);return u.length%2==1&&(u="0"+u),o<128?u:(128+u.length/2).toString(16)+u}},{key:"getValue",value:function(){return""}}]),t})(),se=(function(){et(o,Ct);var t=H(o);function o(u){var c;return X(this,o),(c=t.call(this)).t="02",u&&(c.v=(function(p){if((m=p.toString(16))[0]!=="-")m.length%2==1?m="0"+m:m.match(/^[0-7]/)||(m="00"+m);else{var m,E=(m=m.substr(1)).length;E%2==1?E+=1:m.match(/^[0-7]/)||(E+=2);for(var L="",C=0;C<E;C++)L+="f";m=(m=(L=new Nt(L,16)).xor(p).add(Nt.ONE)).toString(16).replace(/^-/,"")}return m})(u)),c}return S(o,[{key:"getValue",value:function(){return this.v}}]),o})(),ie=(function(){et(o,Ct);var t=H(o);function o(u){var c;return X(this,o),(c=t.call(this)).t="30",c.asn1Array=u,c}return S(o,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(u){return u.getEncodedHex()})).join(""),this.v}}]),o})();function qt(t,o){return+t[o+2]<8?1:128&+t.substr(o+2,2)}function ue(t,o){var u=qt(t,o);return(t=t.substr(o+2,2*u))?(+t[0]<8?new Nt(t,16):new Nt(t.substr(2),16)).intValue():-1}function ae(t,o){return o+2*(qt(t,o)+1)}var Mt=F.exports.BigInteger,Gt=new Mt("3"),me=(function(){function t(o,u){X(this,t),this.x=u,this.q=o}return S(t,[{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 t(this.q,this.x.negate().mod(this.q))}},{key:"add",value:function(o){return new t(this.q,this.x.add(o.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(o){return new t(this.q,this.x.subtract(o.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(o){return new t(this.q,this.x.multiply(o.toBigInteger()).mod(this.q))}},{key:"divide",value:function(o){return new t(this.q,this.x.multiply(o.toBigInteger().modInverse(this.q)).mod(this.q))}},{key:"square",value:function(){return new t(this.q,this.x.square().mod(this.q))}}]),t})(),te=(function(){function t(o,u,c,p){X(this,t),this.curve=o,this.x=u,this.y=c,this.z=p==null?Mt.ONE:p,this.zinv=null}return S(t,[{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(Mt.ZERO)&&o.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(o.z)).mod(this.curve.q).equals(Mt.ZERO))}},{key:"isInfinity",value:function(){return this.x===null&&this.y===null||this.z.equals(Mt.ZERO)&&!this.y.toBigInteger().equals(Mt.ZERO)}},{key:"negate",value:function(){return new t(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 u=this.x.toBigInteger(),c=this.y.toBigInteger(),p=this.z,m=o.x.toBigInteger(),E=o.y.toBigInteger(),L=o.z,C=this.curve.q,st=u.multiply(L).mod(C);return o=m.multiply(p).mod(C),u=st.subtract(o),m=c.multiply(L).mod(C),c=E.multiply(p).mod(C),E=m.subtract(c),Mt.ZERO.equals(u)?Mt.ZERO.equals(E)?this.twice():this.curve.infinity:(c=st.add(o),o=p.multiply(L).mod(C),L=u.square().mod(C),p=u.multiply(L).mod(C),c=o.multiply(E.square()).subtract(c.multiply(L)).mod(C),u=u.multiply(c).mod(C),m=E.multiply(L.multiply(st).subtract(c)).subtract(m.multiply(p)).mod(C),C=p.multiply(o).mod(C),new t(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(m),C))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var o=this.x.toBigInteger(),u=this.y.toBigInteger(),c=this.z,p=this.curve.q,m=this.curve.a.toBigInteger(),E=o.square().multiply(Gt).add(m.multiply(c.square())).mod(p),L=u.shiftLeft(1).multiply(c).mod(p),C=(m=(C=u.square().mod(p)).multiply(o).multiply(c).mod(p),u=L.square().mod(p),o=E.square().subtract(m.shiftLeft(3)).mod(p),c=L.multiply(o).mod(p),E.multiply(m.shiftLeft(2).subtract(o)).subtract(u.shiftLeft(1).multiply(C)).mod(p));return p=L.multiply(u).mod(p),new t(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(C),p)}},{key:"multiply",value:function(o){if(this.isInfinity())return this;if(!o.signum())return this.curve.infinity;for(var u=o.multiply(Gt),c=this.negate(),p=this,m=u.bitLength()-2;0<m;m--){p=p.twice();var E=u.testBit(m);E!==o.testBit(m)&&(p=p.add(E?this:c))}return p}}]),t})(),Ft=(function(){function t(o,u,c){X(this,t),this.q=o,this.a=this.fromBigInteger(u),this.b=this.fromBigInteger(c),this.infinity=new te(this,null,null)}return S(t,[{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 me(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 u=(o.length-2)/2,c=o.substr(2,u);return u=o.substr(2+u,u),new te(this,this.fromBigInteger(new Mt(c,16)),this.fromBigInteger(new Mt(u,16)))}}}]),t})(),Jt={ECPointFp:te,ECCurveFp:Ft},ne=F.exports.BigInteger,de=(Ft=F.exports.SecureRandom,Jt.ECCurveFp),ye=new Ft,re=(Jt=g()).curve,_=Jt.G,f=Jt.n;function g(){var t=new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),o=new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),u=new ne("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return u=(o=new de(t,o,u)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:o,G:u,n:new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function U(t,o){return t.length>=o?t:new Array(o-t.length+1).join("0")+t}function v(t,o){for(var u=[],c=~~(o/8),p=o%8,m=0,E=t.length;m<E;m++)u[m]=(t[(m+c)%E]<<p&255)+(t[(m+c+1)%E]>>>8-p&255);return u}function q(t,o){for(var u=[],c=t.length-1;0<=c;c--)u[c]=255&(t[c]^o[c]);return u}function ot(t,o){for(var u=[],c=t.length-1;0<=c;c--)u[c]=t[c]&o[c]&255;return u}function It(t,o){for(var u=[],c=t.length-1;0<=c;c--)u[c]=255&(t[c]|o[c]);return u}function gt(t,o){for(var u=[],c=0,p=t.length-1;0<=p;p--){var m=t[p]+o[p]+c;c=255<m?1:0,u[p]=255&m}return u}function Qt(t,o,u,c){return 0<=c&&c<=15?q(q(t,o),u):It(ot(t,o),ot((function(p){for(var m=[],E=p.length-1;0<=E;E--)m[E]=255&~p[E];return m})(t),u))}function ee(t,o){for(var u=[],c=[],p=0;p<16;p++){var m=4*p;u.push(o.slice(m,4+m))}for(var E,L=16;L<68;L++)u.push(q(q((E=q(q(u[L-16],u[L-9]),v(u[L-3],15)),q(q(E,v(E,15)),v(E,23))),v(u[L-13],7)),u[L-6]));for(var C=0;C<64;C++)c.push(q(u[C],u[C+4]));for(var st,lt,w,Q=[121,204,69,25],nt=[122,135,157,138],Z=t.slice(0,4),ft=t.slice(4,8),pt=t.slice(8,12),Ot=t.slice(12,16),B=t.slice(16,20),$=t.slice(20,24),G=t.slice(24,28),W=t.slice(28,32),z=0;z<64;z++){var Dt=0<=z&&z<=15?Q:nt,rt=q(Tt=v(gt(gt(v(Z,12),B),v(Dt,z)),7),v(Z,12)),Tt=(rt=gt(gt(gt((st=Z,lt=ft,w=pt,0<=(Dt=z)&&Dt<=15?q(q(st,lt),w):It(It(ot(st,lt),ot(st,w)),ot(lt,w))),Ot),rt),c[z]),gt(gt(gt(Qt(B,$,G,z),W),Tt),u[z]));Ot=pt,pt=v(ft,9),ft=Z,Z=rt,W=G,G=v($,19),$=B,B=q(q(Tt,v(Tt,9)),v(Tt,17))}return q([].concat(Z,ft,pt,Ot,B,$,G,W),t)}Ft={getGlobalCurve:function(){return re},generateEcparam:g,generateKeyPairHex:function(t,o,u){return{privateKey:u=U((o=(t?new ne(t,o,u):new ne(f.bitLength(),ye)).mod(f.subtract(ne.ONE)).add(ne.ONE)).toString(16),64),publicKey:"04"+U((o=_.multiply(o)).getX().toBigInteger().toString(16),64)+U(o.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(t){for(var o=(t=unescape(encodeURIComponent(t))).length,u=[],c=0;c<o;c++)u[c>>>2]|=(255&t.charCodeAt(c))<<24-c%4*8;for(var p=[],m=0;m<o;m++){var E=u[m>>>2]>>>24-m%4*8&255;p.push((E>>>4).toString(16)),p.push((15&E).toString(16))}return p.join("")},leftPad:U,arrayToHex:function(t){return t.map((function(o){return(o=o.toString(16)).length===1?"0"+o:o})).join("")},arrayToUtf8:function(t){for(var o=[],u=0,c=0;c<2*t.length;c+=2)o[c>>>3]|=parseInt(t[u],10)<<24-c%8*4,u++;try{for(var p=[],m=0;m<t.length;m++){var E=o[m>>>2]>>>24-m%4*8&255;p.push(String.fromCharCode(E))}return decodeURIComponent(escape(p.join("")))}catch(L){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){for(var o=[],u=(t=(u=t.length)%2!=0?U(t,u+1):t).length,c=0;c<u;c+=2)o.push(parseInt(t.substr(c,2),16));return o},verifyPublicKey:function(t){var o=re.decodePointHex(t);return!!o&&(t=o.getX(),o.getY().square().equals(t.multiply(t.square()).add(t.multiply(re.a)).add(re.b)))}},Jt=function(t){for(var o=448<=(o=(L=8*t.length)%512)?512-o%448-1:448-o-1,u=new Array((o-7)/8),c=0,p=u.length;c<p;c++)u[c]=0;for(var m,E=[],L=L.toString(2),C=7;0<=C;C--)8<L.length?(m=L.length-8,E[C]=parseInt(L.substr(m),2),L=L.substr(0,m)):0<L.length?(E[C]=parseInt(L,2),L=""):E[C]=0;for(var st=[].concat(t,[128],u,E),lt=st.length/64,w=[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],Q=0;Q<lt;Q++){var nt=64*Q;w=ee(w,st.slice(nt,64+nt))}return w};var Rt=F.exports.BigInteger,wr=function(t,o){return t=new se(t),o=new se(o),new ie([t,o]).getEncodedHex()},br=function(t){var o=ae(t,0),u=ae(t,o),c=ue(t,o);return o=t.substr(u,2*c),u=ae(t,c=u+o.length),c=ue(t,c),t=t.substr(u,2*c),{r:new Nt(o,16),s:new Nt(t,16)}},_t=Ft,ve=Jt,Pe=(Ft=_t.generateEcparam()).G,Cn=Ft.curve,Se=Ft.n;function On(t,o,u){var c=2<arguments.length&&u!==void 0?u:"1234567812345678",p=(c=_t.utf8ToHex(c),_t.leftPad(Pe.curve.a.toBigInteger().toRadix(16),64)),m=_t.leftPad(Pe.curve.b.toBigInteger().toRadix(16),64),E=_t.leftPad(Pe.getX().toBigInteger().toRadix(16),64),L=_t.leftPad(Pe.getY().toBigInteger().toRadix(16),64);return u=(o=128<o.length?o.substr(2,128):o).substr(0,64),o=o.substr(64,64),o=_t.hexToArray(c+p+m+E+L+u+o),c=4*c.length,o.unshift(255&c),o.unshift(c>>8&255),o=ve(o),_t.arrayToHex(ve(o.concat(_t.hexToArray(t))))}function Fn(){var t=_t.generateKeyPairHex(),o=Cn.decodePointHex(t.publicKey);return t.k=new Rt(t.privateKey,16),t.x1=o.getX().toBigInteger(),t}Ft={generateKeyPairHex:_t.generateKeyPairHex,doEncrypt:function(t,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;t=typeof t=="string"?_t.hexToArray(_t.utf8ToHex(t)):Array.prototype.slice.call(t),o=_t.getGlobalCurve().decodePointHex(o);var c=_t.generateKeyPairHex(),p=new Rt(c.privateKey,16),m=c.publicKey;128<m.length&&(m=m.substr(m.length-128)),c=o.multiply(p),p=_t.hexToArray(_t.leftPad(c.getX().toBigInteger().toRadix(16),64)),o=_t.hexToArray(_t.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=_t.arrayToHex(ve([].concat(p,t,o)));var E,L=1,C=0,st=[],lt=[].concat(p,o);(E=function(){st=ve([].concat(wt(lt),[L>>24&255,L>>16&255,L>>8&255,255&L])),L++,C=0})();for(var w=0,Q=t.length;w<Q;w++)C===st.length&&E(),t[w]^=255&st[C++];return o=_t.arrayToHex(t),u===0?m+o+c:m+c+o},doDecrypt:function(t,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(m=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":m;o=new Rt(o,16);var p=t.substr(128,64),m=t.substr(192);u===0&&(p=t.substr(t.length-64),m=t.substr(128,t.length-128-64));var E,L=_t.hexToArray(m),C=(t=_t.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(o),o=_t.hexToArray(_t.leftPad(t.getX().toBigInteger().toRadix(16),64)),t=_t.hexToArray(_t.leftPad(t.getY().toBigInteger().toRadix(16),64)),1),st=0,lt=[],w=[].concat(o,t);(E=function(){lt=ve([].concat(wt(w),[C>>24&255,C>>16&255,C>>8&255,255&C])),C++,st=0})();for(var Q=0,nt=L.length;Q<nt;Q++)st===lt.length&&E(),L[Q]^=255<[st++];return _t.arrayToHex(ve([].concat(o,L,t)))===p?c==="array"?L:_t.arrayToUtf8(L):c==="array"?[]:""},doSignature:function(t,o){var u=(L=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=L.der,p=L.hash,m=L.publicKey,E=L.userId,L=typeof t=="string"?_t.utf8ToHex(t):_t.arrayToHex(t);p&&(L=On(L,m||(t=o,p=Pe.multiply(new Rt(t,16)),"04"+(t=_t.leftPad(p.getX().toBigInteger().toString(16),64))+(p=_t.leftPad(p.getY().toBigInteger().toString(16),64))),E));var C=new Rt(o,16),st=new Rt(L,16),lt=null,w=null,Q=null;do do{var nt;lt=(nt=u&&u.length?u.pop():Fn()).k,w=st.add(nt.x1).mod(Se)}while(w.equals(Rt.ZERO)||w.add(lt).equals(Se));while((Q=C.add(Rt.ONE).modInverse(Se).multiply(lt.subtract(w.multiply(C))).mod(Se)).equals(Rt.ZERO));return c?wr(w,Q):_t.leftPad(w.toString(16),64)+_t.leftPad(Q.toString(16),64)},doVerifySignature:function(t,o,u){var c,p,m=(L=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,E=L.hash,L=L.userId;return t=typeof t=="string"?_t.utf8ToHex(t):_t.arrayToHex(t),E&&(t=On(t,u,L)),p=m?(c=(p=br(o)).r,p.s):(c=new Rt(o.substring(0,64),16),new Rt(o.substring(64),16)),o=Cn.decodePointHex(u),u=new Rt(t,16),!(t=c.add(p).mod(Se)).equals(Rt.ZERO)&&(o=Pe.multiply(p).add(o.multiply(t)),u=u.add(o.getX().toBigInteger()).mod(Se),c.equals(u))},getPoint:Fn,verifyPublicKey:_t.verifyPublicKey};var Nr=Jt,Me=[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],Je=[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 Ze(t){for(var o=[],u=0,c=t.length;u<c;u+=2)o.push(parseInt(t.substr(u,2),16));return o}function Ee(t,o){return t<<o|t>>>32-o}function pe(t){return(255&Me[t>>>24&255])<<24|(255&Me[t>>>16&255])<<16|(255&Me[t>>>8&255])<<8|255&Me[255&t]}function ke(t){return t^Ee(t,2)^Ee(t,10)^Ee(t,18)^Ee(t,24)}function qe(t){return t^Ee(t,13)^Ee(t,23)}function Ln(t,o,u,c){c=(m=(E=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":m;var p=E.mode,m=(m=E.iv)===void 0?[]:m,E=(E=E.output)===void 0?"string":E;if(p==="cbc"&&(m=typeof m=="string"?Ze(m):m).length!==16)throw new Error("iv is invalid");if((o=typeof o=="string"?Ze(o):o).length!==16)throw new Error("key is invalid");if(t=(typeof t=="string"?u!==0?function(B){for(var $=[],G=0,W=B.length;G<W;G++){var z=B.codePointAt(G);if(z<=127)$.push(z);else if(z<=2047)$.push(192|z>>>6),$.push(128|63&z);else if(z<=55295||57344<=z&&z<=65535)$.push(224|z>>>12),$.push(128|z>>>6&63),$.push(128|63&z);else{if(!(65536<=z&&z<=1114111))throw $.push(z),new Error("input is not supported");G++,$.push(240|z>>>18&28),$.push(128|z>>>12&63),$.push(128|z>>>6&63),$.push(128|63&z)}}return $}:Ze:wt)(t),c==="pkcs#5"&&u!==0)for(var L=16-t.length%16,C=0;C<L;C++)t.push(L);var st=new Array(32);(function(B,$,G){for(var W=new Array(4),z=new Array(4),Dt=0;Dt<4;Dt++)z[0]=255&B[0+4*Dt],z[1]=255&B[1+4*Dt],z[2]=255&B[2+4*Dt],z[3]=255&B[3+4*Dt],W[Dt]=z[0]<<24|z[1]<<16|z[2]<<8|z[3];W[0]^=2746333894,W[1]^=1453994832,W[2]^=1736282519,W[3]^=2993693404;for(var rt,Tt=0;Tt<32;Tt+=4)rt=W[1]^W[2]^W[3]^Je[Tt+0],$[Tt+0]=W[0]^=qe(pe(rt)),rt=W[2]^W[3]^W[0]^Je[Tt+1],$[Tt+1]=W[1]^=qe(pe(rt)),rt=W[3]^W[0]^W[1]^Je[Tt+2],$[Tt+2]=W[2]^=qe(pe(rt)),rt=W[0]^W[1]^W[2]^Je[Tt+3],$[Tt+3]=W[3]^=qe(pe(rt));if(G===0)for(var Yt,kt=0;kt<16;kt++)Yt=$[kt],$[kt]=$[31-kt],$[31-kt]=Yt})(o,st,u);for(var lt=[],w=m,Q=t.length,nt=0;16<=Q;){var Z=t.slice(nt,nt+16),ft=new Array(16);if(p==="cbc")for(var pt=0;pt<16;pt++)u!==0&&(Z[pt]^=w[pt]);(function(B,$,G){for(var W=new Array(4),z=new Array(4),Dt=0;Dt<4;Dt++)z[0]=255&B[4*Dt],z[1]=255&B[4*Dt+1],z[2]=255&B[4*Dt+2],z[3]=255&B[4*Dt+3],W[Dt]=z[0]<<24|z[1]<<16|z[2]<<8|z[3];for(var rt,Tt=0;Tt<32;Tt+=4)rt=W[1]^W[2]^W[3]^G[Tt+0],W[0]^=ke(pe(rt)),rt=W[2]^W[3]^W[0]^G[Tt+1],W[1]^=ke(pe(rt)),rt=W[3]^W[0]^W[1]^G[Tt+2],W[2]^=ke(pe(rt)),rt=W[0]^W[1]^W[2]^G[Tt+3],W[3]^=ke(pe(rt));for(var Yt=0;Yt<16;Yt+=4)$[Yt]=W[3-Yt/4]>>>24&255,$[Yt+1]=W[3-Yt/4]>>>16&255,$[Yt+2]=W[3-Yt/4]>>>8&255,$[Yt+3]=255&W[3-Yt/4]})(Z,ft,st);for(var Ot=0;Ot<16;Ot++)p==="cbc"&&u===0&&(ft[Ot]^=w[Ot]),lt[nt+Ot]=ft[Ot];p==="cbc"&&(w=u!==0?ft:Z),Q-=16,nt+=16}return c==="pkcs#5"&&u===0&&(c=lt[lt.length-1],lt.splice(lt.length-c,c)),E!=="array"?u!==0?lt.map((function(B){return(B=B.toString(16)).length===1?"0"+B:B})).join(""):(function(B){for(var $=[],G=0,W=B.length;G<W;G++)240<=B[G]&&B[G]<=247?($.push(String.fromCodePoint(((7&B[G])<<18)+((63&B[G+1])<<12)+((63&B[G+2])<<6)+(63&B[G+3]))),G+=3):224<=B[G]&&B[G]<=239?($.push(String.fromCodePoint(((15&B[G])<<12)+((63&B[G+1])<<6)+(63&B[G+2]))),G+=2):192<=B[G]&&B[G]<=223?($.push(String.fromCodePoint(((31&B[G])<<6)+(63&B[G+1]))),G++):$.push(String.fromCodePoint(B[G]));return $.join("")})(lt):lt}var Cr=[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],ge=[],Or=function(t,o,u){for(var c=t[0],p=t[1],m=t[2],E=t[3],L=t[4],C=t[5],st=t[6],lt=t[7],w=0;w<64;w++){w<16?ge[w]=0|o[u+w]:(Q=ge[w-15],nt=ge[w-2],ge[w]=((Q<<25|Q>>>7)^(Q<<14|Q>>>18)^Q>>>3)+ge[w-7]+((nt<<15|nt>>>17)^(nt<<13|nt>>>19)^nt>>>10)+ge[w-16]);var Q=c&p^c&m^p&m,nt=lt+((L<<26|L>>>6)^(L<<21|L>>>11)^(L<<7|L>>>25))+(L&C^~L&st)+Cr[w]+ge[w];lt=st,st=C,C=L,L=E+nt|0,E=m,m=p,p=c,c=nt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+Q)|0}t[0]=t[0]+c|0,t[1]=t[1]+p|0,t[2]=t[2]+m|0,t[3]=t[3]+E|0,t[4]=t[4]+L|0,t[5]=t[5]+C|0,t[6]=t[6]+st|0,t[7]=t[7]+lt|0},Yn=(Ft={c2:Ft,c3:function(t){return t=typeof t=="string"?(function(o){for(var u=[],c=0,p=o.length;c<p;c++){var m=o.codePointAt(c);if(m<=127)u.push(m);else if(m<=2047)u.push(192|m>>>6),u.push(128|63&m);else if(m<=55295||57344<=m&&m<=65535)u.push(224|m>>>12),u.push(128|m>>>6&63),u.push(128|63&m);else{if(!(65536<=m&&m<=1114111))throw u.push(m),new Error("input is not supported");c++,u.push(240|m>>>18&28),u.push(128|m>>>12&63),u.push(128|m>>>6&63),u.push(128|63&m)}}return u})(t):Array.prototype.slice.call(t),Nr(t).map((function(o){return(o=o.toString(16)).length===1?"0"+o:o})).join("")},c4:{encrypt:function(t,o,u){return Ln(t,o,1,u)},decrypt:function(t,o,u){return Ln(t,o,0,u)}},s2:function(t){var o=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],u=(function(p){for(var m=[],E=0;E<Math.ceil(p.length/4);E++)m[E]=p[4*E]<<24|(255&p[4*E+1])<<16|(255&p[4*E+2])<<8|255&p[4*E+3];return m})(t);u[(t=8*t.length)>>5]|=128<<24-t%32,u[15+(64+t>>9<<4)]=t;for(var c=0;c<u.length;c+=16)Or(o,u,c);return(function(p){for(var m=[],E=0;E<p.length;E++)m[4*E]=p[E]>>24&255,m[4*E+1]=p[E]>>16&255,m[4*E+2]=p[E]>>8&255,m[4*E+3]=255&p[E];return m})(o).map((function(p){return(p=p.toString(16)).length===1?"0"+p:p})).join("")}},Pt),Fr=At,Lr=Et,Yr=Kt,xr=Zt,Ur=Ft.c2,Mr=Ft.c3,Jr=Ft.c4,kr=Ft.s2;return(function(){var t;(t=function(){}).VERSION="2.1.0";var o=b;if(o.AAR2)return o.AAR2.VERSION!==t.VERSION&&console.log(o.AAR2.VERSION),o.AAR2;var u="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,p=!1,m=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,E=m!==void 0&&!!m.request&&!!m.login,L=function(w,Q){return typeof w=="string"&&typeof Q=="string"&&w!=null&&Q!=null&&w.substring(0,Q.length)===Q},C={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},st=function(w){for(var Q in C)if(C[Q]===w)return Q},lt=function(w,Q,nt){var Z=Date.now(),ft=new t;try{if(!w||w.length<=75)return console.error("error format 1:",w),C.ERROR_DATA_FORMAT;if(!L(w,"eyJ"))return console.error("error format 2:",w),C.ERROR_DATA_FORMAT;w=w.substring(3,w.length);var pt=Fr.my_b4_decode(w);if(!pt)return console.error("error format 3:",w),C.ERROR_DATA_FORMAT;var Ot,B=ft.cc.u8.byteToInt(pt.slice(0,4),0),$=pt.slice(4,4+B),G=ft.cc.u8.byteToInt(pt.slice(4+B,4+B+4),0),W=pt.slice(4+B+4,4+B+4+G),z=ft.cc.u8.byteToInt(pt.slice(4+B+4+G,4+B+4+G+4),0),Dt=pt.slice(4+B+4+G+4,4+B+4+G+4+z),rt=ft.cc.u8.bytesToUtf8Str($);if(ft.cc.h6.encode(W,0,G),Q||(nt!==void 0&&nt==="sm2"?(Ot=ft.cc.h6.encode(W,0,G),ft.co.c2.doVerifySignature(rt,Ot,u,{der:!0,hash:!0})):ft.co.c3(rt+"8890012345678890").toLowerCase()===ft.cc.h6.encode(Dt,0,z).toLowerCase())){if(rt.length%2==0){t.prototype.__v=function(){return rt.slice(0,2)};for(var Tt=[],Yt=2;Yt<66;Yt+=2)Tt.push(parseInt("0x"+rt.slice(Yt,Yt+2)));t.prototype.__i=function(){return Tt};var kt=parseInt("0x"+rt.slice(66,82))-Z;t.prototype.__o=function(){return kt}}return E||b.AAR2||(b.AAR2=t),C.SUCCESS}}catch(tn){return console.error(tn),C.ERROR_UNKNOWN_ERROR}return C.ERROR_SIGN_CHECK};return t.init=function(w,Q){var nt,Z={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof w=="string"?(L(w,"https")||L(w,"https")?Z.url=w:L(w,"eyJ")&&(Z.code=w),typeof Q=="string"&&(Z.publicKey=Q)):tt(w)==="object"&&(w.debug&&(Z.debug=w.debug),w.url&&(Z.url=w.url),w.code&&(Z.code=w.code),w.publicKey&&(Z.publicKey=w.publicKey),w.skipVerify&&(Z.skipVerify=w.skipVerify),w.alg&&(Z.alg=w.alg),w.callback&&typeof w.callback=="function"&&(Z.callback=w.callback)),p?Z.callback&&Z.callback(!0,{errorNo:nt=C.ALREADY_SUCCESS,errorMsg:st(nt)}):c?setTimeout((function(){t.init(w,Q)}),50):(c=!0,Z.debug&&Yn.start(Z.debug),Z.publicKey&&(u=Z.publicKey),Z.code?(nt=lt(Z.code,Z.skipVerify))===C.SUCCESS?(c=!(p=!0),Z.callback(!0,{errorNo:nt,errorMsg:st(nt)})):Z.callback(!1,{errorNo:nt,errorMsg:st(nt)}):Z.url&&(function(ft,pt,Ot){try{if(ft=ft+"?version="+t.VERSION+(E?"&name=wechat":"&name=browser")+"&t="+Date.now(),E)m.request({url:ft,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function($){$.statusCode===200?pt($.data):Ot(C.ERROR_XXX_REQUEST_FAIL)},fail:function($){$&&$.errMsg&&$.errMsg.indexOf("timeout")!==-1?Ot(C.ERROR_XXX_REQUEST_TIMEOUT):Ot(C.ERROR_XXX_REQUEST_FAIL)}});else{var B;if(window.XMLHttpRequest)B=new XMLHttpRequest;else if(window.ActiveXObject)try{B=new ActiveXObject("Msxml2.XMLHTTP")}catch($){try{B=new ActiveXObject("Microsoft.XMLHTTP")}catch(G){}}B&&(B.onload=function(){B.readyState===4&&(B.status===200?pt(B.responseText):Ot(C.ERROR_XHR_ERROR))},B.ontimeout=function(){Ot(C.ERROR_XHR_TIMEOUT)},B.onerror=function(){Ot(C.ERROR_XHR_ERROR)},B.open("POST",ft,!0),B.timeout=5e3,B.send(null))}}catch($){console.error($),Ot(C.ERROR_UNKNOWN_ERROR)}})(Z.url,(function(ft){(ft=lt(ft,Z.skipVerify,Z.alg))===C.SUCCESS?(c=!(p=!0),Z.callback(!0,{errorNo:ft,errorMsg:st(ft)})):(c=!1,Z.callback(!1,{errorNo:ft,errorMsg:st(ft)}))}),(function(ft){c=!1,Z.callback(!1,{errorNo:ft,errorMsg:st(ft)})})))},t.prototype={cc:{b4:Lr,h6:Yr,u8:xr},co:{c2:Ur,c3:Mr,c4:Jr,s2:kr},nonce:function(){var w="0000000000"+Math.ceil(2147483647*Math.random())+Math.floor((Date.now()+this.__o())/1e3);return w.substring(w.length-20)},sign:function(w,Q){return this.__s(w,Q)},__s:function(w,Q){var nt=this.cc.u8.utf8StrToBytes(w),Z=this.__i();return w=this.cc.u8.utf8StrToBytes(Q),Q=this.cc.u8.utf8StrToBytes(this.__c()),w=[].concat(nt,Z,w,Q),Q=parseInt("0x"+this.__v()),this.__f(Q)(w)+this.__v()},__f:function(w){var Q=this.co.s2,nt=this.co.c3,Z=this.cc.h6.decode,ft=[function(pt){return Q(pt)},function(pt){return nt(pt)},function(pt){return nt(Z(Q(pt)))},function(pt){return Q(Z(nt(pt)))},function(pt){return nt(Z(nt(pt)))},function(pt){return Q(Z(Q(pt)))}];return ft[(128<w?w-128:w)%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(m!==void 0&&m.env&&m.request&&m.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 Yn.isDebug()},version:function(){return t.VERSION}},t})()},ct(h)=="object"?l.exports=M():(N=typeof(P=M)=="function"?P.call(h,A,h,l):P)===void 0||(l.exports=N)}},r={};function a(l){var h=r[l];if(h!==void 0)return h.exports;var A=r[l]={id:l,loaded:!1,exports:{}};return e[l].call(A.exports,A,A.exports,a),A.loaded=!0,A.exports}a.n=l=>{var h=l&&l.__esModule?()=>l.default:()=>l;return a.d(h,{a:h}),h},a.d=(l,h)=>{for(var A in h)a.o(h,A)&&!a.o(l,A)&&Object.defineProperty(l,A,{enumerable:!0,get:h[A]})},a.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(l){if(typeof window=="object")return window}})(),a.hmd=l=>((l=Object.create(l)).children||(l.children=[]),Object.defineProperty(l,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+l.id)}}),l),a.o=(l,h)=>Object.prototype.hasOwnProperty.call(l,h),a.r=l=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})};var d=a(737);Zn.exports.LyyGetCommandSDK=d})()});var Yo={};je(Yo,{DyErrorCode:()=>he,DyErrorMessage:()=>ut,ENV_TYPE:()=>Wt,EXTERNAL_ENV_TYPE:()=>le,JdErrorCode:()=>Xe,JdErrorMessage:()=>bt,createServices:()=>Tr,getDisplayAdConfig:()=>bn,getDyPayRtaData:()=>$e,handleDyAuthDebitSignFlow:()=>En,handleDyJsapiPayFlow:()=>Sn,handleDyPayCommandFlow:()=>Pn,handleDyPayFlow:()=>We,handleJdInsurance:()=>yn,handleJdInsuranceExt:()=>_n,handleJdjrCashLoanExt:()=>dn,handleJdjrCashLoanFlow:()=>fn,normalizeDisplayAdData:()=>ze});module.exports=Xr(Yo);var Wt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},le={SIT:"sit",RELEASE:"release",PROD:"prod"},He={[Wt.DEV]:"https://dm.leyaoyao.com",[Wt.SIT]:"https://sm.leyaoyao.com",[Wt.UAT]:"https://um.leyaoyao.com",[Wt.PROD]:"https://m.leyaoyao.com"},Jn={[Wt.DEV]:"https://dad2.leyaoyao.com",[Wt.SIT]:"https://sad2.leyaoyao.com",[Wt.UAT]:"https://uad2.leyaoyao.com",[Wt.PROD]:"https://nad.ehuoke.com"},Ne={[le.SIT]:"https://sopenapi.leyaoyao.com",[le.RELEASE]:"https://uopen-api.leyaoyao.com",[le.PROD]:"https://api-gateway.leyaoyao.com"};function Ge(e,r){return`${He[e]||He[Wt.PROD]}${r}`}function kn(e){return Jn[e]||Jn[Wt.PROD]}var Te={debug:!1,env:Wt.PROD,externalEnv:le.PROD,apiDomain:""},qn=at({},Te);function Bn(e){qn=at(at({},Te),e)}function fe(){return qn}var Qr=Object.defineProperty,Wr=(e,r,a)=>r in e?Qr(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,$r=(e,r,a)=>Wr(e,typeof r!="symbol"?r+"":r,a);function oe(){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 zr=class{constructor(e=!1){$r(this,"enable"),this.enable=e}setEnable(e){this.enable=e}info(...e){this.enable&&console.info("[BI Info]",...e)}warn(...e){this.enable&&console.warn("[BI Warn]",...e)}error(...e){this.enable&&console.error("[BI Error]",...e)}debug(...e){this.enable&&console.log("[BI Debug]",...e)}},T=new zr;function Ce(e){let r=oe();return r==="taro"?Taro.setClipboardData({data:e}).then(()=>{T.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):r==="uni"?new Promise((a,d)=>{uni.setClipboardData({data:e,success:()=>{T.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{T.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),d(l)}})}):r==="wechat"?new Promise((a,d)=>{wx.setClipboardData({data:e,success:()=>{T.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{T.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),d(l)}})}):r==="alipay"?new Promise((a,d)=>{my.setClipboardData({text:e,success:()=>{T.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{T.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),d(l)}})}):navigator.clipboard.writeText(e).then(()=>{T.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function an(e,r=2e3){let a=oe();if(a==="taro"){Taro.showToast({title:e,icon:"none",mask:!0,duration:r});return}if(a==="uni"){uni.showToast({title:e,icon:"none",mask:!0,duration:r});return}if(a==="wechat"){wx.showToast({title:e,icon:"none",mask:!0,duration:r});return}if(a==="alipay"){my.showToast({content:e,duration:r});return}typeof console!="undefined"&&console.log(`[Toast] ${e}`)}async function De(){var e,r,a,d,l;let h=oe();try{if(h==="taro")return((e=(await Taro.getSystemInfo()).platform)==null?void 0:e.toLowerCase())==="ios"?"ios":"android";if(h==="uni")return((r=uni.getSystemInfoSync().platform)==null?void 0:r.toLowerCase())==="ios"?"ios":"android";if(h==="wechat")return wx.getDeviceInfo?((a=(await wx.getDeviceInfo()).platform)==null?void 0:a.toLowerCase())==="ios"?"ios":"android":((d=wx.getSystemInfoSync().platform)==null?void 0:d.toLowerCase())==="ios"?"ios":"android";if(h==="alipay")return((l=my.getSystemInfoSync().platform)==null?void 0:l.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let A=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(A))return"ios";if(/android/.test(A))return"android"}return"unknown"}catch(A){return T.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",A),"unknown"}}var Ut={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function J(e,r,a=null){return{code:e,message:r,data:a}}function Ke(e,r){return e==null?{valid:!1,message:`${r}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof e=="string"&&e.trim().length===0?{valid:!1,message:`${r}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Oe(e,r){for(let a of r){let d=Ke(e[a],a);if(!d.valid)return d}return{valid:!0}}var pn={};je(pn,{handleJdInsurance:()=>yn,handleJdInsuranceExt:()=>_n,handleJdjrCashLoanExt:()=>dn,handleJdjrCashLoanFlow:()=>fn});var Xe=(H=>(H[H.JD_CASH_LOAN__MISSING_PHONE=2001]="JD_CASH_LOAN__MISSING_PHONE",H[H.JD_CASH_LOAN__MISSING_DEVICE_ID=2002]="JD_CASH_LOAN__MISSING_DEVICE_ID",H[H.JD_CASH_LOAN__RTA_FAILED=2003]="JD_CASH_LOAN__RTA_FAILED",H[H.JD_CASH_LOAN__GET_CONFIG_FAILED=2004]="JD_CASH_LOAN__GET_CONFIG_FAILED",H[H.JD_CASH_LOAN__INVALID_CONFIG=2005]="JD_CASH_LOAN__INVALID_CONFIG",H[H.JD_CASH_LOAN__EXT_NOT_ELIGIBLE=2006]="JD_CASH_LOAN__EXT_NOT_ELIGIBLE",H[H.JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS=2007]="JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS",H[H.JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM=2008]="JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM",H[H.JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID=2009]="JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID",H[H.JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE=2010]="JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE",H[H.JD_INSURANCE__USER_NOT_ELIGIBLE=2101]="JD_INSURANCE__USER_NOT_ELIGIBLE",H[H.JD_INSURANCE__H5_NOT_SUPPORTED=2102]="JD_INSURANCE__H5_NOT_SUPPORTED",H[H.JD_INSURANCE__INVALID_JUMP_PARAMS=2103]="JD_INSURANCE__INVALID_JUMP_PARAMS",H[H.JD_INSURANCE__GET_CONFIG_FAILED=2104]="JD_INSURANCE__GET_CONFIG_FAILED",H[H.JD_INSURANCE__COPY_FAILED=2105]="JD_INSURANCE__COPY_FAILED",H[H.JD_INSURANCE__TASK_COMPLETED=2106]="JD_INSURANCE__TASK_COMPLETED",H[H.JD_INSURANCE__UNKNOWN_JUMP_MODE=2107]="JD_INSURANCE__UNKNOWN_JUMP_MODE",H[H.JD_INSURANCE__RTA_FAILED=2108]="JD_INSURANCE__RTA_FAILED",H))(Xe||{}),bt={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"},he=(F=>(F[F.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",F[F.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",F[F.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",F[F.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",F[F.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",F[F.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",F[F.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",F[F.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",F[F.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",F[F.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",F[F.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",F[F.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",F[F.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",F[F.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",F[F.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",F[F.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",F[F.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",F[F.DY_PAY__INVALID_RETURN_TYPE=3018]="DY_PAY__INVALID_RETURN_TYPE",F[F.DY_PAY__JSAPI_INFO_FAILED=3019]="DY_PAY__JSAPI_INFO_FAILED",F[F.DY_PAY__REQUEST_JSAPI_INFO_FAILED=3020]="DY_PAY__REQUEST_JSAPI_INFO_FAILED",F[F.DY_PAY__MISSING_JSAPI_PAY_INFO=3021]="DY_PAY__MISSING_JSAPI_PAY_INFO",F[F.DY_PAY__INVALID_JSAPI_PAY_INFO=3022]="DY_PAY__INVALID_JSAPI_PAY_INFO",F[F.DY_PAY__JSAPI_SIGNATURE_FAILED=3023]="DY_PAY__JSAPI_SIGNATURE_FAILED",F[F.DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED=3024]="DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED",F[F.DY_PAY__JSAPI_UNSUPPORTED_ENV=3025]="DY_PAY__JSAPI_UNSUPPORTED_ENV",F[F.DY_PAY__JSAPI_AUTH_REDIRECT_FAILED=3026]="DY_PAY__JSAPI_AUTH_REDIRECT_FAILED",F[F.DY_PAY__JSAPI_SDK_LOAD_FAILED=3027]="DY_PAY__JSAPI_SDK_LOAD_FAILED",F[F.DY_PAY__JSAPI_CONFIG_FAILED=3028]="DY_PAY__JSAPI_CONFIG_FAILED",F[F.DY_PAY__JSAPI_INVOKE_FAILED=3029]="DY_PAY__JSAPI_INVOKE_FAILED",F[F.DY_PAY__MISSING_AUTH_TOKEN=3030]="DY_PAY__MISSING_AUTH_TOKEN",F[F.DY_PAY_COMMAND__MISSING_ORDER_AMOUNT=3031]="DY_PAY_COMMAND__MISSING_ORDER_AMOUNT",F[F.DY_PAY_COMMAND__GET_FAILED=3032]="DY_PAY_COMMAND__GET_FAILED",F[F.DY_PAY_COMMAND__REQUEST_FAILED=3033]="DY_PAY_COMMAND__REQUEST_FAILED",F[F.DY_PAY_COMMAND__COPY_FAILED=3034]="DY_PAY_COMMAND__COPY_FAILED",F[F.DY_PAY_COMMAND__INVALID_RTA_DATA=3035]="DY_PAY_COMMAND__INVALID_RTA_DATA",F[F.DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID=3036]="DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID",F[F.DY_PAY__AUTH_DEBIT_SIGN_FAILED=3037]="DY_PAY__AUTH_DEBIT_SIGN_FAILED",F[F.DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED=3038]="DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED",F))(he||{}),ut={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"};var Zr=(e,r,a,d)=>{let l=oe();if(l==="taro")return Taro.request({url:e,method:r,data:a,header:d}).then(P=>P);if(l==="uni")return new Promise((P,N)=>{uni.request({url:e,method:r,data:a,header:d,success:M=>P(M),fail:M=>N(M)})});if(l==="wechat")return new Promise((P,N)=>{wx.request({url:e,method:r,data:a,header:d,success:M=>P(M),fail:M=>N(M)})});if(l==="alipay")return new Promise((P,N)=>{my.request({url:e,method:r,data:a,headers:d,success:M=>P(M),fail:M=>N(M)})});let h=r.toUpperCase()==="GET",A=h&&a&&Object.keys(a).length?`${e}?${new URLSearchParams(a).toString()}`:e;return fetch(A,{method:r,headers:d,body:h?void 0:JSON.stringify(a)}).then(async P=>({statusCode:P.status,data:await P.json()}))},sn=class{constructor(r=null){Ve(this,"staticConfig");this.staticConfig=r}getCurrentConfig(){return this.staticConfig||fe()||Te}async getAuthToken(){let r=this.getCurrentConfig();if(r.getAuthToken&&typeof r.getAuthToken=="function")try{let a=await r.getAuthToken();return a?(T.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),a):(T.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(a){return T.error("\u83B7\u53D6Token\u5931\u8D25",a),null}return null}async buildHeader(r={},a=!0){let d=at({"content-type":"application/json"},r);if(!a)return d;let l=await this.getAuthToken();if(!l)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 d.Authorization_bar=l,d}async request(r){let{path:a,method:d="POST",data:l={},header:h={},authRequired:A=!0,baseDomain:P,beforeRequest:N,afterResponse:M}=r,ct=P?`${P}${a}`:Ge(this.getCurrentConfig().env||"prod",a),tt=await this.buildHeader(h,A);N&&typeof N=="function"&&await N({url:ct,method:d,data:l,header:tt}),T.info(`\u53D1\u8D77${d}\u8BF7\u6C42:`,{path:a,method:d});try{let X=await Zr(ct,d,l,tt);return T.info("\u8BF7\u6C42\u6210\u529F:",{path:a,statusCode:X.statusCode}),M&&typeof M=="function"&&await M(X.data),X.data}catch(X){throw T.error("\u8BF7\u6C42\u5931\u8D25:",{path:a,error:X}),X}}get(r,a={},d={}){return this.request(at({path:r,method:"GET",data:a},d))}post(r,a={},d={}){return this.request(at({path:r,method:"POST",data:a},d))}},we=(e=null)=>new sn(e);var to=(function(){"use strict";function e(S,et){var mt=(65535&S)+(65535&et);return(S>>16)+(et>>16)+(mt>>16)<<16|65535&mt}function r(S,et,mt,it,H,wt){return e((wt=e(e(et,S),e(it,wt)))<<H|wt>>>32-H,mt)}function a(S,et,mt,it,H,wt,R){return r(et&mt|~et&it,S,et,H,wt,R)}function d(S,et,mt,it,H,wt,R){return r(et&it|mt&~it,S,et,H,wt,R)}function l(S,et,mt,it,H,wt,R){return r(et^mt^it,S,et,H,wt,R)}function h(S,et,mt,it,H,wt,R){return r(mt^(et|~it),S,et,H,wt,R)}function A(S,et){var mt,it,H,wt;S[et>>5]|=128<<et%32,S[14+(et+64>>>9<<4)]=et;for(var R=1732584193,b=-271733879,Y=-1732584194,O=271733878,D=0;D<S.length;D+=16)R=a(mt=R,it=b,H=Y,wt=O,S[D],7,-680876936),O=a(O,R,b,Y,S[D+1],12,-389564586),Y=a(Y,O,R,b,S[D+2],17,606105819),b=a(b,Y,O,R,S[D+3],22,-1044525330),R=a(R,b,Y,O,S[D+4],7,-176418897),O=a(O,R,b,Y,S[D+5],12,1200080426),Y=a(Y,O,R,b,S[D+6],17,-1473231341),b=a(b,Y,O,R,S[D+7],22,-45705983),R=a(R,b,Y,O,S[D+8],7,1770035416),O=a(O,R,b,Y,S[D+9],12,-1958414417),Y=a(Y,O,R,b,S[D+10],17,-42063),b=a(b,Y,O,R,S[D+11],22,-1990404162),R=a(R,b,Y,O,S[D+12],7,1804603682),O=a(O,R,b,Y,S[D+13],12,-40341101),Y=a(Y,O,R,b,S[D+14],17,-1502002290),R=d(R,b=a(b,Y,O,R,S[D+15],22,1236535329),Y,O,S[D+1],5,-165796510),O=d(O,R,b,Y,S[D+6],9,-1069501632),Y=d(Y,O,R,b,S[D+11],14,643717713),b=d(b,Y,O,R,S[D],20,-373897302),R=d(R,b,Y,O,S[D+5],5,-701558691),O=d(O,R,b,Y,S[D+10],9,38016083),Y=d(Y,O,R,b,S[D+15],14,-660478335),b=d(b,Y,O,R,S[D+4],20,-405537848),R=d(R,b,Y,O,S[D+9],5,568446438),O=d(O,R,b,Y,S[D+14],9,-1019803690),Y=d(Y,O,R,b,S[D+3],14,-187363961),b=d(b,Y,O,R,S[D+8],20,1163531501),R=d(R,b,Y,O,S[D+13],5,-1444681467),O=d(O,R,b,Y,S[D+2],9,-51403784),Y=d(Y,O,R,b,S[D+7],14,1735328473),R=l(R,b=d(b,Y,O,R,S[D+12],20,-1926607734),Y,O,S[D+5],4,-378558),O=l(O,R,b,Y,S[D+8],11,-2022574463),Y=l(Y,O,R,b,S[D+11],16,1839030562),b=l(b,Y,O,R,S[D+14],23,-35309556),R=l(R,b,Y,O,S[D+1],4,-1530992060),O=l(O,R,b,Y,S[D+4],11,1272893353),Y=l(Y,O,R,b,S[D+7],16,-155497632),b=l(b,Y,O,R,S[D+10],23,-1094730640),R=l(R,b,Y,O,S[D+13],4,681279174),O=l(O,R,b,Y,S[D],11,-358537222),Y=l(Y,O,R,b,S[D+3],16,-722521979),b=l(b,Y,O,R,S[D+6],23,76029189),R=l(R,b,Y,O,S[D+9],4,-640364487),O=l(O,R,b,Y,S[D+12],11,-421815835),Y=l(Y,O,R,b,S[D+15],16,530742520),R=h(R,b=l(b,Y,O,R,S[D+2],23,-995338651),Y,O,S[D],6,-198630844),O=h(O,R,b,Y,S[D+7],10,1126891415),Y=h(Y,O,R,b,S[D+14],15,-1416354905),b=h(b,Y,O,R,S[D+5],21,-57434055),R=h(R,b,Y,O,S[D+12],6,1700485571),O=h(O,R,b,Y,S[D+3],10,-1894986606),Y=h(Y,O,R,b,S[D+10],15,-1051523),b=h(b,Y,O,R,S[D+1],21,-2054922799),R=h(R,b,Y,O,S[D+8],6,1873313359),O=h(O,R,b,Y,S[D+15],10,-30611744),Y=h(Y,O,R,b,S[D+6],15,-1560198380),b=h(b,Y,O,R,S[D+13],21,1309151649),R=h(R,b,Y,O,S[D+4],6,-145523070),O=h(O,R,b,Y,S[D+11],10,-1120210379),Y=h(Y,O,R,b,S[D+2],15,718787259),b=h(b,Y,O,R,S[D+9],21,-343485551),R=e(R,mt),b=e(b,it),Y=e(Y,H),O=e(O,wt);return[R,b,Y,O]}function P(S){for(var et="",mt=32*S.length,it=0;it<mt;it+=8)et+=String.fromCharCode(S[it>>5]>>>it%32&255);return et}function N(S){var et=[];for(et[(S.length>>2)-1]=void 0,it=0;it<et.length;it+=1)et[it]=0;for(var mt=8*S.length,it=0;it<mt;it+=8)et[it>>5]|=(255&S.charCodeAt(it/8))<<it%32;return et}function M(S){for(var et,mt="0123456789abcdef",it="",H=0;H<S.length;H+=1)et=S.charCodeAt(H),it+=mt.charAt(et>>>4&15)+mt.charAt(15&et);return it}function ct(S){return unescape(encodeURIComponent(S))}function tt(S){return P(A(N(S=ct(S)),8*S.length))}function X(S,et){return(function(mt,it){var H,wt=N(mt),R=[],b=[];for(R[15]=b[15]=void 0,16<wt.length&&(wt=A(wt,8*mt.length)),H=0;H<16;H+=1)R[H]=909522486^wt[H],b[H]=1549556828^wt[H];return it=A(R.concat(N(it)),512+8*it.length),P(A(b.concat(it),640))})(ct(S),ct(et))}function Lt(S,et,mt){return et?mt?X(et,S):M(X(et,S)):mt?tt(S):M(tt(S))}return Lt})(),Fe=to;function jn(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function Vn(e){if(typeof e!="object"||e===null)return e;let r=Object.keys(e).sort(),a={};for(let d of r)a[d]=e[d];return JSON.stringify(a)}function Hn(e,r){let a={appId:e.appId,randomStr:e.randomStr,data:e.data},d=Object.keys(a).sort(),l="";for(let[h,A]of d.entries())l+=`${A}=${a[A]}`,h<d.length-1&&(l+="&");return l+=`&secretKey=${r}`,Fe(l)}var eo=(e,r,a,d)=>{let l=oe();return l==="taro"?Taro.request({url:e,method:r,data:a,header:d}).then(h=>h):l==="uni"?new Promise((h,A)=>{uni.request({url:e,method:r,data:a,header:d,success:P=>h(P),fail:P=>A(P)})}):l==="wechat"?new Promise((h,A)=>{wx.request({url:e,method:r,data:a,header:d,success:P=>h(P),fail:P=>A(P)})}):l==="alipay"?new Promise((h,A)=>{my.request({url:e,method:r,data:a,headers:d,success:P=>h(P),fail:P=>A(P)})}):fetch(e,{method:r,headers:d,body:JSON.stringify(a)}).then(async h=>({statusCode:h.status,data:await h.json()}))},un=class{constructor(r=null){Ve(this,"staticConfig");this.staticConfig=r}getCurrentConfig(){return this.staticConfig||fe()||{}}getExternalEnv(){var r;return((r=this.getCurrentConfig())==null?void 0:r.externalEnv)||le.PROD}getExternalHost(){let r=this.getExternalEnv();return Ne[r]||Ne.prod}generateSign(r={}){let a=this.getCurrentConfig(),{externalAppId:d,externalAppSecret:l}=a;if(!d||!l)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let h=jn(),A=Vn(r),P=Hn({appId:d,randomStr:h,data:A},l);return{appId:d,randomStr:h,sign:P}}buildRequestBody(r={}){let a=this.generateSign(r);return zt(at({},a),{data:r})}buildUrl(r){return`${this.getExternalHost()}${r}`}async request(r){let{path:a,method:d="POST",data:l={},header:h={},needSign:A=!0,beforeRequest:P,afterResponse:N}=r,M=this.buildUrl(a),ct=at({"content-type":"application/json"},h),tt=A?this.buildRequestBody(l):l;P&&typeof P=="function"&&await P({url:M,method:d,data:tt,header:ct}),T.info(`\u53D1\u8D77${d}\u8BF7\u6C42:`,{path:a,method:d});try{let X=await eo(M,d,tt,ct);if(T.info("\u8BF7\u6C42\u6210\u529F:",{path:a,statusCode:X.statusCode}),N&&typeof N=="function"&&await N(X.data),X.statusCode===200&&X.data.code===200)return X.data.data;throw{code:X.data.code,msg:X.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:X.data}}catch(X){throw(X==null?void 0:X.code)!==void 0?X:(T.error("\u8BF7\u6C42\u5931\u8D25:",{path:a,error:X}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:X})}}get(r,a={},d={}){return this.request(at({path:r,method:"GET",data:a},d))}post(r,a={},d={}){return this.request(at({path:r,method:"POST",data:a},d))}},Gn=(e=null)=>new un(e);var cn=we(),ln=Gn();function Kn(e){let r=Ke(e==null?void 0:e.equipmentValue,"equipmentValue");return r.valid?cn.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",e):Promise.reject({code:"PARAM_ERROR",message:r.message})}async function Xn(e){let r=Oe(e,["idMd5Value","rtaStrategy"]);return r.valid?ln.post("/open/rest/cpa/jd/rta-check",e):Promise.reject({code:"PARAM_ERROR",message:r.message})}async function Qn(e){try{let r={thirdPlatform:e.thirdPlatform,thirdPlatformUserId:e.thirdPlatformUserId,thirdPlatformEquipmentValue:e.thirdPlatformEquipmentValue,os:e.os,client:"wxMini"};e.phone&&(r.mobileMd5=Fe(e.phone)),e.extendData&&(Object.prototype.toString.call(e.extendData)==="[object Object]"?r.extendData=e.extendData:T.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let a=await ln.post("/open/rest/cpa/jd/insurance/get",r);return a?a.jumpMode==1?{jumpMode:1,appId:a.appId,url:a.url}:{jumpMode:2,url:a.url,channel:a.channelId}:void 0}catch(r){throw T.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",r),r}}function Wn(e){let r=Ke(e==null?void 0:e.equipmentValue,"equipmentValue");return r.valid?cn.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",e):Promise.reject({code:"PARAM_ERROR",message:r.message})}function $n(e){let r=Oe(e,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return r.valid?cn.post("/gw/advert/customer/cpa-activity/jd/rta/validate",e):Promise.reject({code:"PARAM_ERROR",message:r.message})}async function zn(e){let r=await De(),a={thirdPlatform:e.thirdPlatform,thirdPlatformUserId:e.thirdPlatformUserId,thirdPlatformEquipmentValue:e.thirdPlatformEquipmentValue,os:r,client:e.client};return e.phone&&(a.mobileMd5=Fe(e.phone)),e.extendData&&(Object.prototype.toString.call(e.extendData)==="[object Object]"?a.extendData=e.extendData:T.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),ln.post("/open/rest/cpa/jd/cash-loan/get",a)}async function fn(e){let{phone:r,rtaId:a,equipmentId:d,lyyUserId:l,entrance:h}=e;if(!r)return J(Ut.INVALID_PARAM,bt[2001]);if(!d)return J(Ut.INVALID_PARAM,bt[2002]);try{if(a){T.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:r});let tt=await $n({phone:r,lyyEquipmentValue:d,lyyUserId:l||"",rtaId:a});if(tt.code!=="0000000"||!tt.body||tt.body.state!=1)return T.error("RTA\u9A8C\u8BC1\u5931\u8D25",tt),J(2003,bt[2003]);T.info("RTA\u9A8C\u8BC1\u6210\u529F",tt.body)}T.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:r});let A=await De(),P=await Wn({phone:r,equipmentValue:d,os:A,entrance:h});if(P.code!=="0000000"||!P.body)return T.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",P),J(2004,bt[2004]);let{appId:N,targetUrl:M}=P.body;if(!N||!M)return T.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:N,targetUrl:M}),J(2005,bt[2005]);let ct=J(Ut.SUCCESS,"\u6210\u529F",{appId:N,targetUrl:M});return T.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",ct),ct}catch(A){return T.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",A),J(Ut.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function dn(e){let{phone:r,rtaId:a,thirdPlatform:d,thirdPlatformUserId:l,thirdPlatformEquipmentValue:h}=e;if(!r)return J(Ut.INVALID_PARAM,bt[2001]);if(!d)return J(2008,bt[2008]);if(!l)return J(2009,bt[2009]);if(!h)return J(2010,bt[2010]);try{if(a){T.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:r});let X=await Xn({idMd5Value:r,rtaStrategy:a});if(X.status!=1)return T.error("RTA\u9A8C\u8BC1\u5931\u8D25",X),J(2003,bt[2003]);T.info("RTA\u9A8C\u8BC1\u6210\u529F",X)}let A=await zn(e),{url:P,channelId:N,matchFlag:M,jumpMode:ct,appId:tt}=A||{};return M?ct===3?!tt||!P?J(2007,bt[2007]):J(Ut.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:tt,url:P}):J(2007,bt[2007]):J(2006,bt[2006])}catch(A){return T.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",A),J(Ut.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var be=null,Le=null;try{Le=tr()}catch(e){}function er(){return be||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(be=globalThis.LyyGetCommandSDK,be):Le?(be=Le.LyyGetCommandSDK||Le.default||Le,be):null)}function nr(e){var a;T.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",e);let r=er();r!=null&&r.getJrCommand?r.getJrCommand(e):(a=r==null?void 0:r.default)!=null&&a.getJrCommand?r.default.getJrCommand(e):(T.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),e.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function no(e,r){return new Promise((a,d)=>{try{nr({url:e,channel:r,callback:l=>{l.code==="0"?a(l.data):d({msg:l.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(l){d(l)}})}async function yn(e){try{let r=await De(),a=at({os:r},e);T.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",a);let{code:d,body:l}=await Kn(a);if(d==="0000000"&&l){let{url:h,channelId:A,matchFlag:P,jumpMode:N,appId:M}=l;if(!P)return J(2101,bt[2101]);if(N===1)return T.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),J(2102,bt[2102]);if(N===2)return oe()==="web"&&T.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:h}),!h||!A?J(2103,bt[2103]):new Promise(ct=>{nr({url:h,channel:A,callback:async tt=>{if((tt==null?void 0:tt.code)==="0")try{await Ce(tt==null?void 0:tt.data),ct(J(Ut.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(X){ct(J(2105,bt[2105]))}else ct(J(2105,bt[2105]))}})});if(N===3)return!M||!h?J(2103,bt[2103]):J(Ut.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:M,path:h})}return J(2104,bt[2104])}catch(r){return T.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",r),J(Ut.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function _n(e){T.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let r=await Qn(zt(at({},e),{os:await De()}));if(!r)return T.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),J(2106,bt[2106]);if(r.jumpMode===1)return T.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:r.appId,url:r.url}),J(Ut.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:r.appId,path:r.url});if(r.jumpMode===2){if(oe()==="web")return T.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:r.url}),J(Ut.SUCCESS,"\u6210\u529F",{type:"h5",url:r.url});try{let a=await no(r.url,r.channel);return await Ce(a),T.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),J(Ut.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(a){return T.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",a),an("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),J(2105,bt[2105])}}return T.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",r.jumpMode),J(2107,bt[2107])}catch(r){let a=typeof r=="string"?r:(r==null?void 0:r.msg)||(r==null?void 0:r.message)||"\u672A\u77E5\u9519\u8BEF";return T.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",a),an("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),a.includes("RTA")||a.includes("\u8D44\u683C")?J(2108,bt[2108]):J(Ut.NETWORK_ERROR,a)}}var Rn={};je(Rn,{DyErrorCode:()=>he,getDyPayRtaData:()=>$e,handleDyAuthDebitSignFlow:()=>En,handleDyJsapiPayFlow:()=>Sn,handleDyPayCommandFlow:()=>Pn,handleDyPayFlow:()=>We});var ro=["weapp","h5"],oo=["h5","ulink","jsapi"],io=["switchTab","reLaunch","redirectTo","navigateTo"];function ao(e){return ro.includes(e)}function so(e){return oo.includes(e)}function uo(e){return io.includes(e)}function rr(e){let r=e.returnType||"h5";return!e.telephone&&r==="h5"?{valid:!1,errorCode:3001}:e.price?e.equipmentValue?e.businessType?e.client&&!ao(e.client)?{valid:!1,errorCode:3004}:so(r)?e.douyinOrderExtendData&&typeof e.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:e.backWay&&e.client==="weapp"&&!uo(e.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 or(e){return e.price?e.equipmentValue?e.businessType?e.douyinOrderExtendData&&typeof e.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}}function ir(e){return e.equipmentValue?{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function ar(e){return e.equipmentValue?e.orderAmount?e.businessType?e.commandUrl!=null&&typeof e.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3031}:{valid:!1,errorCode:3002}}function sr(e){return e.equipmentValue?e.commandUrl!=null&&typeof e.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function ur(e){return e.showFlag===!0&&typeof e.payAmount=="number"&&e.payAmount>0&&typeof e.businessType=="number"&&e.businessType>0}var Ie=we();async function cr(e){let{price:r,equipmentValue:a,douyinOrderExtendData:d,douyinCommodityVirtualFlag:l,businessType:h,platformActivities:A={}}=e,P={businessType:h,equipmentValue:a,payInfoBusinessType:"commonDouyinPayment",platformActivities:at({douyinCommodityVirtualFlag:l||!1,douyinCommodityPrice:r,douyinOrderExtendData:d||""},A)};try{let N=await Ie.post("/gw/advert/customer/payment/pay-info",P);return N.code!=="0000000"||!(N!=null&&N.body)?Promise.reject({code:3006,message:N.message||ut[3006]}):(N.body.platformActivities=P.platformActivities,N)}catch(N){return T.error("getDyOrderAmountFn error:",N),Promise.reject({code:3007,message:ut[3007]})}}async function lr(e){var r,a,d,l;try{let h=e.commodityList.map(Lt=>(Lt.commodity=Lt.commodityId,delete Lt.commodityId,Lt.quantity=Lt.quantity||1,Lt)),A=e.advertExtendInfo&&Object.keys(e.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:e.advertExtendInfo}):"",P=oe(),N="";P==="wechat"?N="wechatMini":P==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(N="wechatHtml");let M=e.returnType==="jsapi",ct=M?22:21,tt=at(at(at({businessType:e.businessType,fixedClientType:ct,channelCode:null,douyinData:at(at({loginMobile:e.telephone||""},((r=e.jsapiInfo)==null?void 0:r.outProductCategory)!=null?{outProductCategory:e.jsapiInfo.outProductCategory}:{}),((a=e.jsapiInfo)==null?void 0:a.requestId)!=null?{requestId:e.jsapiInfo.requestId}:{}),equipmentUseFlag:!1,payEquipmentDTO:{equipmentValue:e.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:A,transType:5,actualFee:e.totalFee,totalFee:e.totalFee,commodityList:h,clientSourceDetailType:N,platformActivities:e.platformActivities||{}},e.commoditySign&&{commoditySign:e.commoditySign}),e.unifiedOrderExtendData&&at({},e.unifiedOrderExtendData)),M?{appId:((d=e.jsapiInfo)==null?void 0:d.appId)||"",openId:((l=e.jsapiInfo)==null?void 0:l.douyinOpenId)||""}:{});if(e.returnType=="ulink")return delete tt.channelCode,tt;let X=await Ie.post("/gw/payment-bff/unified/order",tt);return X.code!=="0000000"||!(X!=null&&X.body)?Promise.reject({code:3008,message:X.message||ut[3008]}):X}catch(h){return T.error("dyUnifiedOrderFn error:",h),Promise.reject({code:3009,message:ut[3009]})}}async function fr(e){let r={equipmentValue:e.equipmentValue,phone:e.telephone||""};e.price&&(r.orderAmount=e.price);try{let a=await Ie.post("/gw/advert/customer/douyin/pay/check",r);return a.code!=="0000000"||!(a!=null&&a.body)?Promise.reject({code:3013,message:a.message||ut[3013]}):a}catch(a){return T.error("getDyPayRtaData error:",a),Promise.reject({code:3014,message:(a==null?void 0:a.message)||ut[3014]})}}async function dr(e={}){var r;try{let a=(r=e.requestNo)==null?void 0:r.trim(),d=a?`/gw/advert/customer/douyin/pay/jsapi/info?requestNo=${a}`:"/gw/advert/customer/douyin/pay/jsapi/info",l=await Ie.get(d);return l.code!=="0000000"||!(l!=null&&l.body)?Promise.reject({code:3019,message:l.message||ut[3019]}):{appId:l.body.appId,douyinOpenId:l.body.douyinOpenId,outProductCategory:l.body.outProductCategory,requestId:l.body.requestId}}catch(a){return T.error("getDyPayJsapiInfoFn error:",a),Promise.reject({code:(a==null?void 0:a.code)||3020,message:(a==null?void 0:a.message)||ut[3020]})}}async function hn(e){try{let r=await Ie.post("/gw/advert/customer/douyin/pay/jsapi/signature",e);return r.code!=="0000000"||!(r!=null&&r.body)||!r.body.signature||!r.body.timestamp||!r.body.nonceStr?Promise.reject({code:3023,message:r.message||ut[3023]}):{signature:r.body.signature,timestamp:r.body.timestamp,nonceStr:r.body.nonceStr}}catch(r){return T.error("getDyPayJsapiSignatureFn error:",r),Promise.reject({code:(r==null?void 0:r.code)||3024,message:(r==null?void 0:r.message)||ut[3024]})}}async function yr(e){try{let r=await Ie.post("/gw/advert/customer/douyin/pay-command",e);return r.code!=="0000000"||!(r!=null&&r.body)?Promise.reject({code:3032,message:r.message||ut[3032]}):r}catch(r){return T.error("getDyPayCommandFn error:",r),Promise.reject({code:(r==null?void 0:r.code)||3033,message:(r==null?void 0:r.message)||ut[3033]})}}async function _r(e){try{let r=await Ie.post("/gw/advert/customer/automatic-debit/sign/request-id",{requestId:e});return r.code!=="0000000"||!(r!=null&&r.body)?Promise.reject({code:3037,message:r.message||ut[3037]}):r.body}catch(r){return T.error("dyAutomaticDebitSignByRequestIdFn error:",r),Promise.reject({code:(r==null?void 0:r.code)||3038,message:(r==null?void 0:r.message)||ut[3038]})}}var co="/auth/rest/auth/third",pr="url_token",lo="https://unpkg.byted-static.com/bridge/douyin_open/1.0.17/lib/douyin_open.umd.js",Ye=null;function Vt(e,r){let a=new Error(r||ut[e]);return Object.assign(a,{code:e})}function xe(){return typeof window!="undefined"&&typeof document!="undefined"}function mn(){return xe()?window.location.href:""}function Ue(e){let r=e.href||mn();if(!e.key||!r)return"";try{let a=new URL(r,gr()),d=a.searchParams.get(e.key);return d!=null?d:fo(a.hash,e.key)}catch(a){return T.warn("getDyUrlParam parse error:",a),""}}function fo(e,r){if(!e||!r)return"";let a=e.indexOf("?");if(a<0)return"";let d=e.slice(a+1).split("#")[0];return new URLSearchParams(d).get(r)||""}function hr(e){let{href:r,paramName:a}=e;if(!r||!a)return r;let d=r.indexOf("#"),l=d>=0?r.slice(0,d):r,h=d>=0?r.slice(d):"";try{let A=new URL(l,gr()),P=_o(l);return A.searchParams.delete(a),`${P?`${A.pathname}${A.search}`:A.toString()}${mr(h,a)}`}catch(A){return T.warn("removeDyUrlParam parse error:",A),mo(r,a)}}function mr(e,r){if(!e||!r)return e;let a=e.indexOf("?");if(a<0)return e;let d=e.slice(0,a),l=e.slice(a+1),h=l.indexOf("#"),A=h>=0?l.slice(0,h):l,P=h>=0?l.slice(h):"",N=new URLSearchParams(A);N.delete(r);let M=N.toString();return`${d}${M?`?${M}`:""}${P}`}function gn(e={}){let a=(e.href||mn()).split("#")[0]||"";return hr({href:a,paramName:e.tokenParamName||pr})}function yo(e){var l,h;let r=e.tokenParamName||pr,a=hr({href:e.redirectUrl||mn(),paramName:r});if(!a)throw Vt(3025);let d=new URLSearchParams({useAgent:e.useAgent||"douyin",category:e.category||"pay",internal:String((l=e.internal)!=null?l:!1),silent:String((h=e.silent)!=null?h:!1),redirectUrl:a});return e.equipmentValue&&d.set("equipmentValue",e.equipmentValue),`${e.authPath||co}?${d.toString()}`}function An(e){if(!xe())throw Vt(3025);let r=yo(e);T.info("\u8DF3\u8F6C\u6296\u97F3\u6388\u6743:",{authUrl:r,equipmentValue:e.equipmentValue});try{return window.location.href=r,r}catch(a){throw T.error("redirectDyAuth error:",a),Vt(3026)}}function Qe(){if(!xe())return null;let e=window;return e.DouyinOpenJSBridge||e.douyin_open||null}function Dn(e={}){if(!xe())return Promise.reject(Vt(3025));let r=Qe();if(r)return T.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5DF2\u52A0\u8F7D"),Promise.resolve(r);if(Ye)return T.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u590D\u7528\u52A0\u8F7D\u4E2D\u4EFB\u52A1"),Ye;let a=e.sdkUrl||lo;return T.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5F00\u59CB\u52A0\u8F7D",{sdkUrl:a}),Ye=new Promise((d,l)=>{let h=po(a),A=()=>{let M=Qe();if(!M){l(Vt(3027));return}T.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u6210\u529F"),d(M)},P=M=>{T.error("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u5931\u8D25",M),l(Vt(3027))};if(h){if(T.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u811A\u672C\u5DF2\u5B58\u5728"),ho(h)){window.setTimeout(A,0);return}h.addEventListener("load",A,{once:!0}),h.addEventListener("error",P,{once:!0});return}let N=document.createElement("script");N.src=a,N.async=!0,N.addEventListener("load",A,{once:!0}),N.addEventListener("error",M=>{N.remove(),P(M)},{once:!0}),document.head.appendChild(N)}).catch(d=>{throw Ye=null,d}),Ye}function In(e){let r=e.sdk||Qe();if(!r)return Promise.reject(Vt(3027));let{appId:a,signatureData:d,url:l}=e;return!a||!l||!(d!=null&&d.signature)||!(d!=null&&d.timestamp)||!(d!=null&&d.nonceStr)?Promise.reject(Vt(3028)):new Promise((h,A)=>{T.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u5F00\u59CB\u914D\u7F6E",{appId:a,url:l});try{r.config({params:{client_key:a,signature:d.signature,timestamp:String(d.timestamp),nonce_str:d.nonceStr,url:l}}),r.ready(()=>{T.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5B8C\u6210"),h(r)}),r.error(P=>{T.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5931\u8D25",P),A(Vt(3028))})}catch(P){T.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5F02\u5E38",P),A(Vt(3028))}})}function vn(e){let r=e.sdk||Qe();if(!r)return Promise.reject(Vt(3027));if(!r.ttcjpay||typeof r.ttcjpay.dypay!="function")return Promise.reject(Vt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));let{appId:a,payInfo:d}=e;if(!a||!d)return Promise.reject(Vt(3021));let l={appId:a,timeStamp:String(d.timeStamp),nonceStr:d.nonceStr,package:d.package,signType:d.signType,paySign:d.paySign};return new Promise((h,A)=>{T.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528 dypay");try{r.ttcjpay.dypay({sdk_info:JSON.stringify(l),success:P=>{if(T.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u6210\u529F\u56DE\u8C03",P),(P==null?void 0:P.code)===-2){A(Vt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}h(P)},fail:P=>{if(T.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u5931\u8D25\u56DE\u8C03",P),(P==null?void 0:P.code)===-2){A(Vt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}A(Vt(3029,(P==null?void 0:P.message)||(P==null?void 0:P.errMsg)))}})}catch(P){T.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528\u5F02\u5E38",P),A(Vt(3029,P==null?void 0:P.message))}})}function gr(){return xe()?window.location.origin:"https://bi-nova.local"}function _o(e){return!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)&&!e.startsWith("//")}function po(e){return Array.from(document.getElementsByTagName("script")).find(a=>a.src===e)||null}function ho(e){let r=e.readyState;return r==="loaded"||r==="complete"}function mo(e,r){let a=e.indexOf("#"),d=a>=0?e.slice(0,a):e,l=a>=0?e.slice(a):"",h=d.indexOf("?");if(h<0)return e;let A=d.slice(0,h),N=d.slice(h+1).split("&").filter(M=>M&&decodeURIComponent(M.split("=")[0])!==r).join("&");return`${A}${N?`?${N}`:""}${mr(l,r)}`}async function We(e){var a,d,l,h;let r=rr(e);if(!r.valid)return J(r.errorCode,ut[r.errorCode]);try{let A=e.returnType||"h5",P=await cr({price:e.price,equipmentValue:e.equipmentValue,businessType:e.businessType,douyinOrderExtendData:(e==null?void 0:e.douyinOrderExtendData)||"",platformActivities:(e==null?void 0:e.platformActivities)||{},douyinCommodityVirtualFlag:(e==null?void 0:e.douyinCommodityVirtualFlag)||!1}),N=A==="jsapi"?await dr({requestNo:Ue({key:"requestNo"})}):void 0,M=await lr(zt(at(zt(at({},P.body),{telephone:e.telephone,equipmentValue:e.equipmentValue,businessType:e.businessType}),e.unifiedOrderExtendData&&{unifiedOrderExtendData:e.unifiedOrderExtendData}),{returnType:A,jsapiInfo:N}));if(e.returnType==="ulink")return J(0,"success",{ulinkQueryParams:M});let ct=((a=M==null?void 0:M.body)==null?void 0:a.h5Url)||"",tt=((d=M==null?void 0:M.body)==null?void 0:d.outTradeNo)||"";if(A==="jsapi"){let Lt=Dr((l=M==null?void 0:M.body)==null?void 0:l.payInfo);return J(0,"success",{appId:(N==null?void 0:N.appId)||"",payInfo:Lt,outTradeNo:tt})}let X=ct?await go(zt(at({},e),{dyUrl:ct})):"";return X?J(0,"success",{h5Url:X,outTradeNo:tt}):J(3010,ut[3010])}catch(A){T.error("handleDyPayFlow error:",A);let P=(h=A==null?void 0:A.code)!=null?h:3012,N=(A==null?void 0:A.message)||ut[3012];return J(P,N)}}function Dr(e){if(!e)throw{code:3021,message:ut[3021]};if(typeof e=="object"){if(Ar(e))return e;throw{code:3022,message:ut[3022]}}try{let r=JSON.parse(e);if(!Ar(r))throw new Error("invalid payInfo fields");return r}catch(r){throw{code:3022,message:ut[3022],error:r}}}function Ar(e){return typeof e.timeStamp=="string"&&e.timeStamp!==""&&typeof e.nonceStr=="string"&&e.nonceStr!==""&&typeof e.package=="string"&&e.package!==""&&typeof e.signType=="string"&&e.signType!==""&&typeof e.paySign=="string"&&e.paySign!==""}async function go(e){let r=fe(),a=Ge(r.env||"prod",""),d=typeof r.getAuthToken=="function"?await r.getAuthToken():"",l=e.client||"weapp";return`${a}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${l}&equipmentId=${e.equipmentValue}&dyUrl=${e.dyUrl}&fromUrl=${encodeURIComponent(e.fromUrl||"")}&backUrl=${encodeURIComponent(e.backUrl||"")}&backWay=${e.backWay||""}&url_token=${d}`}async function $e(e){var a;let r=ir(e);if(!r.valid)return J(r.errorCode,ut[r.errorCode]);try{let d=await fr({price:(e==null?void 0:e.price)||"",equipmentValue:e.equipmentValue,telephone:(e==null?void 0:e.telephone)||""});return J(0,"success",d.body)}catch(d){T.error("getDyPayRtaData error:",d);let l=(a=d==null?void 0:d.code)!=null?a:3015,h=(d==null?void 0:d.message)||ut[3015];return J(l,h)}}async function Ir(e){var a,d;let r=ar(e);if(!r.valid)return J(r.errorCode,ut[r.errorCode]);try{let l=(a=e.commandUrl)==null?void 0:a.trim(),A=(await yr(at({phone:e.telephone||"",equipmentValue:e.equipmentValue,orderAmount:e.orderAmount,businessType:e.businessType},l?{commandUrl:l}:{}))).body||"";return A?J(0,"success",{command:A}):J(3032,ut[3032])}catch(l){T.error("getDyPayCommand error:",l);let h=(d=l==null?void 0:l.code)!=null?d:3033,A=(l==null?void 0:l.message)||ut[3033];return J(h,A)}}async function Ao(e){var a;let r=await Ir(e);if(r.code!==0||!((a=r.data)!=null&&a.command))return J(r.code,r.message);try{return await Ce(r.data.command),J(0,"success",at({type:"copy_success"},e.returnCommand?{command:r.data.command}:{}))}catch(d){return T.error("copyDyPayCommand error:",d),J(3034,ut[3034])}}async function Pn(e){var a,d,l;let r=sr(e);if(!r.valid)return J(r.errorCode,ut[r.errorCode]);try{let h=await $e({telephone:e.telephone||"",equipmentValue:e.equipmentValue,price:e.price});if(h.code!==0)return J(h.code,h.message);let A=h.data;if(!(A!=null&&A.showFlag))return J(0,"success",{eligible:!1,type:"not_eligible"});if(!ur(A))return J(3035,ut[3035]);let P={telephone:e.telephone||"",equipmentValue:e.equipmentValue,orderAmount:A.payAmount,businessType:A.businessType,commandUrl:e.commandUrl};if(e.autoCopy){let M=await Ao(zt(at({},P),{returnCommand:e.returnCommand}));return M.code!==0?J(M.code,M.message):J(0,"success",at({eligible:!0,type:"copy_success"},(a=M.data)!=null&&a.command?{command:M.data.command}:{}))}let N=await Ir(P);return N.code!==0||!((d=N.data)!=null&&d.command)?J(N.code,N.message):J(0,"success",{eligible:!0,type:"command",command:N.data.command})}catch(h){T.error("handleDyPayCommandFlow error:",h);let A=(l=h==null?void 0:h.code)!=null?l:3033,P=(h==null?void 0:h.message)||ut[3033];return J(A,P)}}async function Sn(e){var a,d,l;let r=or(e);if(!r.valid)return J(r.errorCode,ut[r.errorCode]);try{let h=fe(),A=e.authToken||(typeof h.getAuthToken=="function"?await h.getAuthToken():""),P=e.autoAuth!==!1;if(!A){if(!P)return J(3030,ut[3030]);let Lt=An({equipmentValue:e.equipmentValue,redirectUrl:e.redirectUrl,tokenParamName:e.tokenParamName});return J(0,"redirecting",{type:"auth_redirect",authUrl:Lt})}let N=await Dn({sdkUrl:e.sdkUrl}),M=await We(zt(at({},e),{client:"h5",returnType:"jsapi"}));if(M.code!==0||!((a=M.data)!=null&&a.appId)||!((d=M.data)!=null&&d.payInfo))return J(M.code||3021,M.message||ut[3021]);let ct=e.signatureUrl||gn({tokenParamName:e.tokenParamName}),tt=await hn({url:ct});await In({appId:M.data.appId,signatureData:tt,url:ct,sdk:N});let X=await vn({appId:M.data.appId,payInfo:M.data.payInfo,sdk:N});return J(0,"success",{type:"pay_result",outTradeNo:M.data.outTradeNo,payResult:X})}catch(h){T.error("handleDyJsapiPayFlow error:",h);let A=(l=h==null?void 0:h.code)!=null?l:3029,P=(h==null?void 0:h.message)||ut[3029];return J(A,P)}}async function En(){var l;let e="url_token",r=fe(),d=(typeof r.getAuthToken=="function"?await r.getAuthToken():"")||Ue({key:e});try{if(!d){let Lt=Ue({key:"equipmentValue"}),S=An(at({tokenParamName:e},Lt?{equipmentValue:Lt}:{}));return J(0,"redirecting",{type:"auth_redirect",authUrl:S})}let h=Ue({key:"requestId"}).trim();if(!h)return J(3036,ut[3036]);let A=await Dn(),P=await _r(h),N=P.appId||P.appid||"",M=Dr(P.payInfo);if(!N)return J(3021,ut[3021]);let ct=gn({tokenParamName:e}),tt=await hn(at({url:ct},N?{appid:N}:{}));await In({appId:N,signatureData:tt,url:ct,sdk:A});let X=await vn({appId:N,payInfo:M,sdk:A});return J(0,"success",{type:"sign_result",orderNo:P.orderNo,payResult:X})}catch(h){T.error("handleDyAuthDebitSignFlow error:",h);let A=(l=h==null?void 0:h.code)!=null?l:3029,P=(h==null?void 0:h.message)||ut[3029];return J(A,P)}}var Nn={};je(Nn,{getDisplayAdConfig:()=>bn,normalizeDisplayAdData:()=>ze});var Do=we();function vr(e){let r=Oe(e,["placementId"]);if(!r.valid)return Promise.reject({code:"PARAM_ERROR",message:r.message});let a=fe().env||"prod";return Do.get(`/gw/advert-plugin/api/v1/config/list/valid/${e.placementId}`,{},{authRequired:!1,baseDomain:kn(a)})}var Pr=30*1e3,Io="__",wn=new Map,Tn=new Map;function vo(e,r){return[e.appId||"",r,e.type||""].join(Io)}function Po(e){let r=wn.get(e);return r?r.expireAt<=Date.now()?(wn.delete(e),T.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:e}),null):r.data:null}function So(e,r){wn.set(e,{data:r,expireAt:Date.now()+Pr})}function Eo(e){return Array.isArray(e==null?void 0:e.body)?e.body:[]}function Ro(e){return String(e==null?void 0:e.code)!=="200"}function To(e,r){let a=String(e||r||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(a)?a:r||"banner"}function Sr(e){return String(e||"").trim().toLowerCase()}function wo(e){var r;return!!e&&e.status!==0&&((r=e.platformConfig)==null?void 0:r.valid)!==!1}function bo(e){return[...e].sort((r,a)=>{var h,A,P,N;let d=Number((h=r.priority)!=null?h:9999),l=Number((A=a.priority)!=null?A:9999);return d!==l?d-l:Number((P=a.weight)!=null?P:0)-Number((N=r.weight)!=null?N:0)})}function Er(e){return e.find(r=>Sr(r.advertPlatform)==="gdt")||null}function Rr(e){return e.find(r=>Sr(r.advertPlatform)!=="gdt")||null}function No(e,r){return e&&r?"mixed":e?"wechat":r?"custom":"none"}function Co(e,r){var l,h;let a=Er(e),d=Rr(e);return a&&d?Number((l=a.priority)!=null?l:9999)<=Number((h=d.priority)!=null?h:9999)?"wechat-first":"custom-first":r==="custom"?"custom-only":r==="wechat"?"wechat-only":"wechat-first"}function Oo(e){var a;let r=Er(e);return((a=r==null?void 0:r.platformConfig)==null?void 0:a.adId)||""}function Fo(e){let r=Rr(e),a=r==null?void 0:r.platformConfig;if(!a)return null;let d=a.image||a.imageUrl||"",l=a.video||a.videoUrl||"",h=a.poster||d||"",A=a.jumpUrl||a.url||a.webUrl||"";return!d&&!l?null:{image:d||void 0,video:l||void 0,poster:h||void 0,title:a.title,description:a.description,buttonText:a.buttonText,badgeText:a.badgeText,jumpSeconds:a.jumpSeconds,loadTimeout:a.loadTimeout||a.timeout,muted:a.muted,adSpec:a.adSpec,url:A||void 0,action:A?{type:"web",url:A}:void 0}}function ze(e,r){let a=bo(e.filter(wo)),d=Fo(a),l=Oo(a),h=To(void 0,r),A=No(l,d),P=Co(a,A);return{show:!!(l||d),adId:"",type:h,provider:A,priority:P,unitId:l,customAd:d,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:e}}async function bn(e){let r=e.placementId||e.adId||"",a=vo(e,r),d=Po(a);if(d)return T.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:a,placementId:r}),J(Ut.SUCCESS,"\u6210\u529F",d);let l=Tn.get(a);if(l)return T.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:a,placementId:r}),l;let h=(async()=>{try{T.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",e);let A=await vr({placementId:r}),P=Eo(A);if(T.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:a,placementId:r,response:A,body:P}),Ro(A)||!P)return T.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",A),J(Ut.UNKNOWN_ERROR,(A==null?void 0:A.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let N=ze(P,e.type);return N.adId=r,N.cache=zt(at({},N.cache),{enable:!0,ttl:Pr}),So(a,N),T.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:a,placementId:r,provider:N.provider,priority:N.priority,hasUnitId:!!N.unitId,hasCustomAd:!!N.customAd}),J(Ut.SUCCESS,"\u6210\u529F",N)}catch(A){return T.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:a,placementId:r,error:A}),J(Ut.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{Tn.delete(a)}})();return Tn.set(a,h),h}function Lo(e={}){T.info("\u670D\u52A1\u521D\u59CB\u5316",e);let r=at(at({},Te),e);r.env&&!He[r.env]&&(T.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${r.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),r.env=Wt.PROD),r.externalEnv&&!Ne[r.externalEnv]&&(T.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${r.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),r.externalEnv=le.PROD),r.debug!==void 0&&T.setEnable(r.debug),Bn(r),T.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",r)}function Tr(e={}){let r="",a=null;async function d(){if(typeof e.getAuthToken=="function"){let h=await e.getAuthToken();if(h)return h}return a&&typeof a.getStorage=="function"&&a.getStorage("auth_token")||""}let l={name:"services",setToken(h){return r=h||"",a&&typeof a.setStorage=="function"&&a.setStorage("auth_token",r),l},async getAuthToken(){return r||d()},clearToken(){return r="",a&&typeof a.setStorage=="function"&&a.setStorage("auth_token",""),l},install(h){a=h;let A=zt(at({},e),{getAuthToken:()=>l.getAuthToken()});Lo(A),T.info("services installed via nova.use()"),Object.assign(h,{jd:at({},pn),dy:at({},Rn),ads:at({},Nn),setToken:l.setToken,clearToken:l.clearToken})}};return l}0&&(module.exports={DyErrorCode,DyErrorMessage,ENV_TYPE,EXTERNAL_ENV_TYPE,JdErrorCode,JdErrorMessage,createServices,getDisplayAdConfig,getDyPayRtaData,handleDyAuthDebitSignFlow,handleDyJsapiPayFlow,handleDyPayCommandFlow,handleDyPayFlow,handleJdInsurance,handleJdInsuranceExt,handleJdjrCashLoanExt,handleJdjrCashLoanFlow,normalizeDisplayAdData});
|
|
1
|
+
"use strict";var Be=Object.defineProperty,Hr=Object.defineProperties,Gr=Object.getOwnPropertyDescriptor,Kr=Object.getOwnPropertyDescriptors,Xr=Object.getOwnPropertyNames,Un=Object.getOwnPropertySymbols;var Mn=Object.prototype.hasOwnProperty,Qr=Object.prototype.propertyIsEnumerable;var on=(e,r,a)=>r in e?Be(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,at=(e,r)=>{for(var a in r||(r={}))Mn.call(r,a)&&on(e,a,r[a]);if(Un)for(var a of Un(r))Qr.call(r,a)&&on(e,a,r[a]);return e},zt=(e,r)=>Hr(e,Kr(r));var Wr=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),je=(e,r)=>{for(var a in r)Be(e,a,{get:r[a],enumerable:!0})},$r=(e,r,a,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of Xr(r))!Mn.call(e,l)&&l!==a&&Be(e,l,{get:()=>r[l],enumerable:!(d=Gr(r,l))||d.enumerable});return e};var zr=e=>$r(Be({},"__esModule",{value:!0}),e);var Ve=(e,r,a)=>on(e,typeof r!="symbol"?r+"":r,a);var tr=Wr((gi,Zn)=>{"use strict";(()=>{var e={737:(l,h,A)=>{"use strict";A.r(h),A.d(h,{default:()=>F,getJrCommand:()=>R});var v=A(307),N=A.n(v);function M(){M=function(){return K};var D,K={},Pt=Object.prototype,dt=Pt.hasOwnProperty,vt=Object.defineProperty||function(y,f,g){y[f]=g.value},_t=typeof Symbol=="function"?Symbol:{},At=_t.iterator||"@@iterator",Et=_t.asyncIterator||"@@asyncIterator",St=_t.toStringTag||"@@toStringTag";function ht(y,f,g){return Object.defineProperty(y,f,{value:g,enumerable:!0,configurable:!0,writable:!0}),y[f]}try{ht({},"")}catch(y){ht=function(f,g,U){return f[g]=U}}function Gt(y,f,g,U){var P=f&&f.prototype instanceof se?f:se,q=Object.create(P.prototype),ot=new _e(U||[]);return vt(q,"_invoke",{value:Ot(y,g,ot)}),q}function Kt(y,f,g){try{return{type:"normal",arg:y.call(f,g)}}catch(U){return{type:"throw",arg:U}}}K.wrap=Gt;var Vt="suspendedStart",Zt="suspendedYield",Xt="executing",T="completed",Nt={};function se(){}function ie(){}function qt(){}var ue={};ht(ue,At,(function(){return this}));var ae=Object.getPrototypeOf,Ut=ae&&ae(ae(re([])));Ut&&Ut!==Pt&&dt.call(Ut,At)&&(ue=Ut);var Ht=qt.prototype=se.prototype=Object.create(ue);function me(y){["next","throw","return"].forEach((function(f){ht(y,f,(function(g){return this._invoke(f,g)}))}))}function te(y,f){function g(P,q,ot,It){var gt=Kt(y[P],y,q);if(gt.type!=="throw"){var Qt=gt.arg,ee=Qt.value;return ee&&tt(ee)=="object"&&dt.call(ee,"__await")?f.resolve(ee.__await).then((function(Rt){g("next",Rt,ot,It)}),(function(Rt){g("throw",Rt,ot,It)})):f.resolve(ee).then((function(Rt){Qt.value=Rt,ot(Qt)}),(function(Rt){return g("throw",Rt,ot,It)}))}It(gt.arg)}var U;vt(this,"_invoke",{value:function(P,q){function ot(){return new f((function(It,gt){g(P,q,It,gt)}))}return U=U?U.then(ot,ot):ot()}})}function Ot(y,f,g){var U=Vt;return function(P,q){if(U===Xt)throw Error("Generator is already running");if(U===T){if(P==="throw")throw q;return{value:D,done:!0}}for(g.method=P,g.arg=q;;){var ot=g.delegate;if(ot){var It=Mt(ot,g);if(It){if(It===Nt)continue;return It}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(U===Vt)throw U=T,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);U=Xt;var gt=Kt(y,f,g);if(gt.type==="normal"){if(U=g.done?T:Zt,gt.arg===Nt)continue;return{value:gt.arg,done:g.done}}gt.type==="throw"&&(U=T,g.method="throw",g.arg=gt.arg)}}}function Mt(y,f){var g=f.method,U=y.iterator[g];if(U===D)return f.delegate=null,g==="throw"&&y.iterator.return&&(f.method="return",f.arg=D,Mt(y,f),f.method==="throw")||g!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+g+"' method")),Nt;var P=Kt(U,y.iterator,f.arg);if(P.type==="throw")return f.method="throw",f.arg=P.arg,f.delegate=null,Nt;var q=P.arg;return q?q.done?(f[y.resultName]=q.value,f.next=y.nextLoc,f.method!=="return"&&(f.method="next",f.arg=D),f.delegate=null,Nt):q:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,Nt)}function ne(y){var f={tryLoc:y[0]};1 in y&&(f.catchLoc=y[1]),2 in y&&(f.finallyLoc=y[2],f.afterLoc=y[3]),this.tryEntries.push(f)}function de(y){var f=y.completion||{};f.type="normal",delete f.arg,y.completion=f}function _e(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(ne,this),this.reset(!0)}function re(y){if(y||y===""){var f=y[At];if(f)return f.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var g=-1,U=function P(){for(;++g<y.length;)if(dt.call(y,g))return P.value=y[g],P.done=!1,P;return P.value=D,P.done=!0,P};return U.next=U}}throw new TypeError(tt(y)+" is not iterable")}return ie.prototype=qt,vt(Ht,"constructor",{value:qt,configurable:!0}),vt(qt,"constructor",{value:ie,configurable:!0}),ie.displayName=ht(qt,St,"GeneratorFunction"),K.isGeneratorFunction=function(y){var f=typeof y=="function"&&y.constructor;return!!f&&(f===ie||(f.displayName||f.name)==="GeneratorFunction")},K.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,qt):(y.__proto__=qt,ht(y,St,"GeneratorFunction")),y.prototype=Object.create(Ht),y},K.awrap=function(y){return{__await:y}},me(te.prototype),ht(te.prototype,Et,(function(){return this})),K.AsyncIterator=te,K.async=function(y,f,g,U,P){P===void 0&&(P=Promise);var q=new te(Gt(y,f,g,U),P);return K.isGeneratorFunction(f)?q:q.next().then((function(ot){return ot.done?ot.value:q.next()}))},me(Ht),ht(Ht,St,"Generator"),ht(Ht,At,(function(){return this})),ht(Ht,"toString",(function(){return"[object Generator]"})),K.keys=function(y){var f=Object(y),g=[];for(var U in f)g.push(U);return g.reverse(),function P(){for(;g.length;){var q=g.pop();if(q in f)return P.value=q,P.done=!1,P}return P.done=!0,P}},K.values=re,_e.prototype={constructor:_e,reset:function(y){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(de),!y)for(var f in this)f.charAt(0)==="t"&&dt.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=D)},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 f=this;function g(gt,Qt){return q.type="throw",q.arg=y,f.next=gt,Qt&&(f.method="next",f.arg=D),!!Qt}for(var U=this.tryEntries.length-1;U>=0;--U){var P=this.tryEntries[U],q=P.completion;if(P.tryLoc==="root")return g("end");if(P.tryLoc<=this.prev){var ot=dt.call(P,"catchLoc"),It=dt.call(P,"finallyLoc");if(ot&&It){if(this.prev<P.catchLoc)return g(P.catchLoc,!0);if(this.prev<P.finallyLoc)return g(P.finallyLoc)}else if(ot){if(this.prev<P.catchLoc)return g(P.catchLoc,!0)}else{if(!It)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return g(P.finallyLoc)}}}},abrupt:function(y,f){for(var g=this.tryEntries.length-1;g>=0;--g){var U=this.tryEntries[g];if(U.tryLoc<=this.prev&&dt.call(U,"finallyLoc")&&this.prev<U.finallyLoc){var P=U;break}}P&&(y==="break"||y==="continue")&&P.tryLoc<=f&&f<=P.finallyLoc&&(P=null);var q=P?P.completion:{};return q.type=y,q.arg=f,P?(this.method="next",this.next=P.finallyLoc,Nt):this.complete(q)},complete:function(y,f){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"&&f&&(this.next=f),Nt},finish:function(y){for(var f=this.tryEntries.length-1;f>=0;--f){var g=this.tryEntries[f];if(g.finallyLoc===y)return this.complete(g.completion,g.afterLoc),de(g),Nt}},catch:function(y){for(var f=this.tryEntries.length-1;f>=0;--f){var g=this.tryEntries[f];if(g.tryLoc===y){var U=g.completion;if(U.type==="throw"){var P=U.arg;de(g)}return P}}throw Error("illegal catch attempt")},delegateYield:function(y,f,g){return this.delegate={iterator:re(y),resultName:f,nextLoc:g},this.method==="next"&&(this.arg=D),Nt}},K}function ct(D,K,Pt,dt,vt,_t,At){try{var Et=D[_t](At),St=Et.value}catch(ht){return void Pt(ht)}Et.done?K(St):Promise.resolve(St).then(dt,vt)}function tt(D){return tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},tt(D)}var X="https://ms.jr.jd.com";function Ft(D){var K=D.host,Pt=D.type,dt=Pt===void 0?"post":Pt,vt=D.data,_t=D.path,At=_t===void 0?"":_t,Et=D.config,St=Et===void 0?{}:Et,ht=(St.withCredentials,St.isWG),Gt=ht===void 0||ht,Kt=St.contentType,Vt=Kt===void 0?"application/x-www-form-urlencoded":Kt;return new Promise((function(Zt,Xt){wx.request({url:(K||X)+At,method:dt.toUpperCase(),data:Gt?E({reqData:JSON.stringify(vt)}):vt,header:{"content-type":Vt},success:function(T){T.statusCode===200?Zt(T.data):Xt({statusCode:T.statusCode,errMsg:T.errMsg,data:T.data})},fail:function(T){Xt(T)}})}))}function E(D){var K="";return tt(D)==="object"&&D!==null&&(Object.keys(D).map((function(Pt){var dt=D[Pt];return K+=Pt+"="+encodeURIComponent(dt)+"&",""})),K.length>0&&(K=K.substr(0,K.length-1))),K}function et(D){return mt.apply(this,arguments)}function mt(){var D;return D=M().mark((function K(Pt){var dt,vt,_t,At,Et,St,ht,Gt,Kt,Vt;return M().wrap((function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return dt=Pt.url,vt=Pt.channel,_t=Pt.callback,N().init(),At=new(N()),Et=At.nonce(),St=At.sign(JSON.stringify({t:"".concat(new Date().getTime())}),Et),ht="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),Gt="",Kt={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:dt,channel:vt,clientCode:"0",antiRushInfo:St}},Zt.next=12,Ft({host:"https://ms.jr.jd.com",type:"post",path:ht,config:{withCredentials:!0},data:Kt});case 12:(Vt=Zt.sent).resultCode===0&&Vt.resultData&&Vt.resultData.code==="00000"&&Vt.resultData.data&&(Gt=Vt.resultData.data.goldenKeyText),_t&&_t(Gt?{code:"0",msg:"command success",data:Gt}:{code:"-1",msg:"command empty"});case 15:case"end":return Zt.stop()}}),K)})),mt=function(){var K=this,Pt=arguments;return new Promise((function(dt,vt){var _t=D.apply(K,Pt);function At(St){ct(_t,dt,vt,At,Et,"next",St)}function Et(St){ct(_t,dt,vt,At,Et,"throw",St)}At(void 0)}))},mt.apply(this,arguments)}function it(D){return it=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},it(D)}function H(){H=function(){return K};var D,K={},Pt=Object.prototype,dt=Pt.hasOwnProperty,vt=Object.defineProperty||function(y,f,g){y[f]=g.value},_t=typeof Symbol=="function"?Symbol:{},At=_t.iterator||"@@iterator",Et=_t.asyncIterator||"@@asyncIterator",St=_t.toStringTag||"@@toStringTag";function ht(y,f,g){return Object.defineProperty(y,f,{value:g,enumerable:!0,configurable:!0,writable:!0}),y[f]}try{ht({},"")}catch(y){ht=function(f,g,U){return f[g]=U}}function Gt(y,f,g,U){var P=f&&f.prototype instanceof se?f:se,q=Object.create(P.prototype),ot=new _e(U||[]);return vt(q,"_invoke",{value:Ot(y,g,ot)}),q}function Kt(y,f,g){try{return{type:"normal",arg:y.call(f,g)}}catch(U){return{type:"throw",arg:U}}}K.wrap=Gt;var Vt="suspendedStart",Zt="suspendedYield",Xt="executing",T="completed",Nt={};function se(){}function ie(){}function qt(){}var ue={};ht(ue,At,(function(){return this}));var ae=Object.getPrototypeOf,Ut=ae&&ae(ae(re([])));Ut&&Ut!==Pt&&dt.call(Ut,At)&&(ue=Ut);var Ht=qt.prototype=se.prototype=Object.create(ue);function me(y){["next","throw","return"].forEach((function(f){ht(y,f,(function(g){return this._invoke(f,g)}))}))}function te(y,f){function g(P,q,ot,It){var gt=Kt(y[P],y,q);if(gt.type!=="throw"){var Qt=gt.arg,ee=Qt.value;return ee&&it(ee)=="object"&&dt.call(ee,"__await")?f.resolve(ee.__await).then((function(Rt){g("next",Rt,ot,It)}),(function(Rt){g("throw",Rt,ot,It)})):f.resolve(ee).then((function(Rt){Qt.value=Rt,ot(Qt)}),(function(Rt){return g("throw",Rt,ot,It)}))}It(gt.arg)}var U;vt(this,"_invoke",{value:function(P,q){function ot(){return new f((function(It,gt){g(P,q,It,gt)}))}return U=U?U.then(ot,ot):ot()}})}function Ot(y,f,g){var U=Vt;return function(P,q){if(U===Xt)throw Error("Generator is already running");if(U===T){if(P==="throw")throw q;return{value:D,done:!0}}for(g.method=P,g.arg=q;;){var ot=g.delegate;if(ot){var It=Mt(ot,g);if(It){if(It===Nt)continue;return It}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(U===Vt)throw U=T,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);U=Xt;var gt=Kt(y,f,g);if(gt.type==="normal"){if(U=g.done?T:Zt,gt.arg===Nt)continue;return{value:gt.arg,done:g.done}}gt.type==="throw"&&(U=T,g.method="throw",g.arg=gt.arg)}}}function Mt(y,f){var g=f.method,U=y.iterator[g];if(U===D)return f.delegate=null,g==="throw"&&y.iterator.return&&(f.method="return",f.arg=D,Mt(y,f),f.method==="throw")||g!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+g+"' method")),Nt;var P=Kt(U,y.iterator,f.arg);if(P.type==="throw")return f.method="throw",f.arg=P.arg,f.delegate=null,Nt;var q=P.arg;return q?q.done?(f[y.resultName]=q.value,f.next=y.nextLoc,f.method!=="return"&&(f.method="next",f.arg=D),f.delegate=null,Nt):q:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,Nt)}function ne(y){var f={tryLoc:y[0]};1 in y&&(f.catchLoc=y[1]),2 in y&&(f.finallyLoc=y[2],f.afterLoc=y[3]),this.tryEntries.push(f)}function de(y){var f=y.completion||{};f.type="normal",delete f.arg,y.completion=f}function _e(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(ne,this),this.reset(!0)}function re(y){if(y||y===""){var f=y[At];if(f)return f.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var g=-1,U=function P(){for(;++g<y.length;)if(dt.call(y,g))return P.value=y[g],P.done=!1,P;return P.value=D,P.done=!0,P};return U.next=U}}throw new TypeError(it(y)+" is not iterable")}return ie.prototype=qt,vt(Ht,"constructor",{value:qt,configurable:!0}),vt(qt,"constructor",{value:ie,configurable:!0}),ie.displayName=ht(qt,St,"GeneratorFunction"),K.isGeneratorFunction=function(y){var f=typeof y=="function"&&y.constructor;return!!f&&(f===ie||(f.displayName||f.name)==="GeneratorFunction")},K.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,qt):(y.__proto__=qt,ht(y,St,"GeneratorFunction")),y.prototype=Object.create(Ht),y},K.awrap=function(y){return{__await:y}},me(te.prototype),ht(te.prototype,Et,(function(){return this})),K.AsyncIterator=te,K.async=function(y,f,g,U,P){P===void 0&&(P=Promise);var q=new te(Gt(y,f,g,U),P);return K.isGeneratorFunction(f)?q:q.next().then((function(ot){return ot.done?ot.value:q.next()}))},me(Ht),ht(Ht,St,"Generator"),ht(Ht,At,(function(){return this})),ht(Ht,"toString",(function(){return"[object Generator]"})),K.keys=function(y){var f=Object(y),g=[];for(var U in f)g.push(U);return g.reverse(),function P(){for(;g.length;){var q=g.pop();if(q in f)return P.value=q,P.done=!1,P}return P.done=!0,P}},K.values=re,_e.prototype={constructor:_e,reset:function(y){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(de),!y)for(var f in this)f.charAt(0)==="t"&&dt.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=D)},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 f=this;function g(gt,Qt){return q.type="throw",q.arg=y,f.next=gt,Qt&&(f.method="next",f.arg=D),!!Qt}for(var U=this.tryEntries.length-1;U>=0;--U){var P=this.tryEntries[U],q=P.completion;if(P.tryLoc==="root")return g("end");if(P.tryLoc<=this.prev){var ot=dt.call(P,"catchLoc"),It=dt.call(P,"finallyLoc");if(ot&&It){if(this.prev<P.catchLoc)return g(P.catchLoc,!0);if(this.prev<P.finallyLoc)return g(P.finallyLoc)}else if(ot){if(this.prev<P.catchLoc)return g(P.catchLoc,!0)}else{if(!It)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return g(P.finallyLoc)}}}},abrupt:function(y,f){for(var g=this.tryEntries.length-1;g>=0;--g){var U=this.tryEntries[g];if(U.tryLoc<=this.prev&&dt.call(U,"finallyLoc")&&this.prev<U.finallyLoc){var P=U;break}}P&&(y==="break"||y==="continue")&&P.tryLoc<=f&&f<=P.finallyLoc&&(P=null);var q=P?P.completion:{};return q.type=y,q.arg=f,P?(this.method="next",this.next=P.finallyLoc,Nt):this.complete(q)},complete:function(y,f){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"&&f&&(this.next=f),Nt},finish:function(y){for(var f=this.tryEntries.length-1;f>=0;--f){var g=this.tryEntries[f];if(g.finallyLoc===y)return this.complete(g.completion,g.afterLoc),de(g),Nt}},catch:function(y){for(var f=this.tryEntries.length-1;f>=0;--f){var g=this.tryEntries[f];if(g.tryLoc===y){var U=g.completion;if(U.type==="throw"){var P=U.arg;de(g)}return P}}throw Error("illegal catch attempt")},delegateYield:function(y,f,g){return this.delegate={iterator:re(y),resultName:f,nextLoc:g},this.method==="next"&&(this.arg=D),Nt}},K}function wt(D,K,Pt,dt,vt,_t,At){try{var Et=D[_t](At),St=Et.value}catch(ht){return void Pt(ht)}Et.done?K(St):Promise.resolve(St).then(dt,vt)}function R(D){return C.apply(this,arguments)}function C(){var D;return D=H().mark((function K(Pt){var dt,vt,_t;return H().wrap((function(At){for(;;)switch(At.prev=At.next){case 0:return dt=Pt.url,vt=Pt.channel,_t=Pt.callback,At.next=3,et({url:dt,channel:vt,callback:_t});case 3:case"end":return At.stop()}}),K)})),C=function(){var K=this,Pt=arguments;return new Promise((function(dt,vt){var _t=D.apply(K,Pt);function At(St){wt(_t,dt,vt,At,Et,"next",St)}function Et(St){wt(_t,dt,vt,At,Et,"throw",St)}At(void 0)}))},C.apply(this,arguments)}var Y={getJrCommand:R};(l=A.hmd(l)).exports&&(l.exports=Y,l.exports.getJrCommand=R),typeof window!="undefined"&&(window.LyyGetCommandSDK=Y);let F=Y},307:function(l,h,A){var v,N,M;function ct(tt){return ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X},ct(tt)}M=function(){"use strict";function tt(t){return(tt=typeof Symbol=="function"&&ct(Symbol.iterator)=="symbol"?function(o){return ct(o)}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":ct(o)})(t)}function X(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}function Ft(t,o){for(var u=0;u<o.length;u++){var c=o[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function E(t,o,u){return o&&Ft(t.prototype,o),u&&Ft(t,u),t}function et(t,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(o&&o.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),o&&it(t,o)}function mt(t){return(mt=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(t)}function it(t,o){return(it=Object.setPrototypeOf||function(u,c){return u.__proto__=c,u})(t,o)}function H(t){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(u){return!1}})();return function(){var u,c=mt(t);return(function(p,m){if(m&&(ct(m)=="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S})(p)})(this,o?(u=mt(this).constructor,Reflect.construct(c,arguments,u)):c.apply(this,arguments))}}function wt(t){return(function(o){if(Array.isArray(o))return R(o)})(t)||(function(o){if(typeof Symbol!="undefined"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)})(t)||(function(o,u){if(o){if(typeof o=="string")return R(o,u);var c=Object.prototype.toString.call(o).slice(8,-1);return(c=c==="Object"&&o.constructor?o.constructor.name:c)==="Map"||c==="Set"?Array.from(o):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?R(o,u):void 0}})(t)||(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 R(t,o){(o==null||o>t.length)&&(o=t.length);for(var u=0,c=new Array(o);u<o;u++)c[u]=t[u];return c}var C=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:A.g!==void 0?A.g:typeof self!="undefined"?self:{},Y=!1,F=!1,D={console:!0,focus:!1,time:!1,length:!0,infinite:!1,time_interval:500,time_threshold:100,length_threshold:300},K=function(){typeof document!="undefined"&&document.hasFocus&&!document.hasFocus()&&(F=!0)},Pt=function(){var t=Date.now();Date.now()-t>D.time_threshold&&(F=!0)},dt=function(){var t=C.outerWidth,o=C.outerHeight,u=C.innerWidth,c=C.innerHeight;t&&o&&u&&c&&typeof t=="number"&&typeof o=="number"&&typeof u=="number"&&typeof c=="number"&&(t-u>D.length_threshold||o-c>D.length_threshold)&&(F=!0)};(Ot={}).start=function(t){if(!Y){if(t&&tt(t)==="object")for(var o in t)D[o]=t[o];var u;D.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);')():F=!0:setInterval((function(){}),100)),D.console&&(function(){var c=new Date;c.toString=function(){for(var p=Date.now();;)if(10<Date.now()-p)return Date.now()},console.log(c),c.toString=function(){return F=!0,Date.now()}})(),D.focus&&K(),D.time&&Pt(),D.length&&dt(),u=setInterval((function(){u&&F&&clearInterval(u),D.focus&&K(),D.time&&Pt(),D.length&&dt()}),D.time_interval),Y=!0}},Ot.isDebug=function(){return F};var vt=Ot,_t=".123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-!",At={my_b4_encode:function(t){var o=0,u=(j=0)<t.length%3?3-t.length%3:0;for(o=0;o<u;o++)t[t.length]=0;var c="";for(j=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
|
|
3
|
+
`),c+=_t[t[j]>>2]+_t[(3&t[j])<<4|t[j+1]>>4]+_t[(15&t[j+1])<<2|t[j+2]>>6]+_t[63&t[j+2]];for(o=0;o<u;o++)c+=_t[64];return c},my_b4_decode:function(t){var o=0,u=0,c=(t=t.replace(/[^A-Za-z0-9\+\-\!\.]/g,"")).length%4;if(2<c)return null;for(o=0;o<c;o++)if(t.charAt(t.length-o-1)!=_t[64])return null;var p,m,S,L,O=new Array(3*(t.length-c)/4);for(o=0,u=0;u<O.length;)p=_t.indexOf(t.charAt(o++)),m=_t.indexOf(t.charAt(o++)),S=_t.indexOf(t.charAt(o++)),L=_t.indexOf(t.charAt(o++)),O[u++]=p<<2|m>>4,O[u++]=(15&m)<<4|S>>2,O[u++]=(3&S)<<6|L;for(o=0;o<c;o++)if(O.pop()!=0)return null;return O}},Et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",St={b4_encode:function(t){var o=0,u=(j=0)<t.length%3?3-t.length%3:0;for(o=0;o<u;o++)t[t.length]=0;var c="";for(o=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
|
|
4
|
+
`),c+=Et[t[j]>>2]+Et[(3&t[j])<<4|t[j+1]>>4]+Et[(15&t[j+1])<<2|t[j+2]>>6]+Et[63&t[j+2]];for(o=0;o<u;o++)c+="=";return c},b4_decode:function(t){var o=0,u=0,c=(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length%4;if(2<c)return null;for(o=0;o<c;o++)if(t.charAt(t.length-o-1)!="=")return null;var p,m,S,L,O=new Array(3*(t.length-c)/4);for(o=0,u=0;u<O.length;)p=Et.indexOf(t.charAt(o++)),m=Et.indexOf(t.charAt(o++)),S=Et.indexOf(t.charAt(o++)),L=Et.indexOf(t.charAt(o++)),O[u++]=p<<2|m>>4,O[u++]=(15&m)<<4|S>>2,O[u++]=(3&S)<<6|L;for(o=0;o<c;o++)if(O.pop()!=0)return null;return O}};function ht(){}ht.encode=function(t,o,u){for(var c=new Array(2*u),p=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),m=o,S=0;m<u+o;m++,S++)c[S]=p[(255&t[m])>>4],c[++S]=p[15&t[m]];return c.join("")},ht.decode=function(t){if(t==null||t==""||t.length%2!=0)return null;for(var o=t.length/2,u=ht.toCharCodeArray(t),c=new Array(o),p=0;p<o;p++){if(48<=u[2*p]&&u[2*p]<=57)c[p]=u[2*p]-48<<4;else if(65<=u[2*p]&&u[2*p]<=70)c[p]=u[2*p]-65+10<<4;else{if(!(97<=u[2*p]&&u[2*p]<=102))return null;c[p]=u[2*p]-97+10<<4}if(48<=u[2*p+1]&&u[2*p+1]<=57)c[p]=c[p]|u[2*p+1]-48;else if(65<=u[2*p+1]&&u[2*p+1]<=70)c[p]=c[p]|u[2*p+1]-65+10;else{if(!(97<=u[2*p+1]&&u[2*p+1]<=102))return null;c[p]=c[p]|u[2*p+1]-97+10}}return c},ht.toCharCodeArray=function(t){for(var o=new Array(t.length),u=0;u<t.length;u++)o[u]=t.charCodeAt(u);return o};var Gt=ht,Kt=Gt;(Mt=function(){}).utf8StrToh6=function(t){t=encodeURIComponent(t);for(var o=unescape(t),u=o.length,c=[],p=0;p<u;p++)c[p]=o.charCodeAt(p).toString(16);return c.join("")},Mt.utf8StrToBytes=function(t){t=encodeURIComponent(t);for(var o=unescape(t),u=o.length,c=[],p=0;p<u;p++)c[p]=o.charCodeAt(p);return c},Mt.hexToUtf8Str=function(t){for(var o=Kt.decode(t),u=[],c=0;c<o.length;c++)u.push(String.fromCharCode(o[c]));return decodeURIComponent(escape(u.join("")))},Mt.bytesToUtf8Str=function(t){for(var o=t,u=[],c=0;c<o.length;c++)u.push(String.fromCharCode(o[c]));return decodeURIComponent(escape(u.join("")))},Mt.intToByte=function(t){return new Array(t>>24&255,t>>16&255,t>>8&255,255&t)},Mt.byteToInt=function(t,o){return o+3<t.length?t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3]:o+2<t.length?t[o+1]<<16|t[o+2]<<8|t[o+3]:o+1<t.length?t[o]<<8|t[o+1]:t[o]};var Vt,Zt=Mt,Xt={exports:{}};Vt=Xt,function(){function t(n,i,s){n!=null&&(typeof n=="number"?this.fromNumber(n,i,s):i==null&&typeof n!="string"?this.fromString(n,256):this.fromString(n,i))}function o(){return new t(null)}var u=(u=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(t.prototype.am=function(n,i,s,_,I,x){for(var V=32767&i,k=i>>15;0<=--x;){var Yt=32767&this[n],$t=this[n++]>>15,ce=k*Yt+$t*V;I=((Yt=V*Yt+((32767&ce)<<15)+s[_]+(1073741823&I))>>>30)+(ce>>>15)+k*$t+(I>>>30),s[_++]=1073741823&Yt}return I},30):u&&navigator.appName!="Netscape"?(t.prototype.am=function(n,i,s,_,I,x){for(;0<=--x;){var V=i*this[n++]+s[_]+I;I=Math.floor(V/67108864),s[_++]=67108863&V}return I},26):(t.prototype.am=function(n,i,s,_,I,x){for(var V=16383&i,k=i>>14;0<=--x;){var Yt=16383&this[n],$t=this[n++]>>14,ce=k*Yt+$t*V;I=((Yt=V*Yt+((16383&ce)<<14)+s[_]+I)>>28)+(ce>>14)+k*$t,s[_++]=268435455&Yt}return I},28);t.prototype.DB=u,t.prototype.DM=(1<<u)-1,t.prototype.DV=1<<u,t.prototype.FV=Math.pow(2,52),t.prototype.F1=52-u,t.prototype.F2=2*u-52;for(var c=new Array,p=48,m=0;m<=9;++m)c[p++]=m;for(p=97,m=10;m<36;++m)c[p++]=m;for(p=65,m=10;m<36;++m)c[p++]=m;function S(n){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(n)}function L(n,i){return(n=c[n.charCodeAt(i)])==null?-1:n}function O(n){var i=o();return i.fromInt(n),i}function st(n){var i,s=1;return(i=n>>>16)!=0&&(n=i,s+=16),(i=n>>8)!=0&&(n=i,s+=8),(i=n>>4)!=0&&(n=i,s+=4),(i=n>>2)!=0&&(n=i,s+=2),(i=n>>1)!=0&&(n=i,s+=1),s}function lt(n){this.m=n}function b(n){this.m=n,this.mp=n.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<n.DB-15)-1,this.mt2=2*n.t}function Q(n,i){return n&i}function nt(n,i){return n|i}function Z(n,i){return n^i}function ft(n,i){return n&~i}function pt(){}function Ct(n){return n}function B(n){this.r2=o(),this.q3=o(),t.ONE.dlShiftTo(2*n.t,this.r2),this.mu=this.r2.divide(n),this.m=n}lt.prototype.convert=function(n){return n.s<0||0<=n.compareTo(this.m)?n.mod(this.m):n},lt.prototype.revert=function(n){return n},lt.prototype.reduce=function(n){n.divRemTo(this.m,null,n)},lt.prototype.mulTo=function(n,i,s){n.multiplyTo(i,s),this.reduce(s)},lt.prototype.sqrTo=function(n,i){n.squareTo(i),this.reduce(i)},b.prototype.convert=function(n){var i=o();return n.abs().dlShiftTo(this.m.t,i),i.divRemTo(this.m,null,i),n.s<0&&0<i.compareTo(t.ZERO)&&this.m.subTo(i,i),i},b.prototype.revert=function(n){var i=o();return n.copyTo(i),this.reduce(i),i},b.prototype.reduce=function(n){for(;n.t<=this.mt2;)n[n.t++]=0;for(var i=0;i<this.m.t;++i){var s=32767&n[i],_=s*this.mpl+((s*this.mph+(n[i]>>15)*this.mpl&this.um)<<15)&n.DM;for(n[s=i+this.m.t]+=this.m.am(0,_,n,i,0,this.m.t);n[s]>=n.DV;)n[s]-=n.DV,n[++s]++}n.clamp(),n.drShiftTo(this.m.t,n),0<=n.compareTo(this.m)&&n.subTo(this.m,n)},b.prototype.mulTo=function(n,i,s){n.multiplyTo(i,s),this.reduce(s)},b.prototype.sqrTo=function(n,i){n.squareTo(i),this.reduce(i)},t.prototype.copyTo=function(n){for(var i=this.t-1;0<=i;--i)n[i]=this[i];n.t=this.t,n.s=this.s},t.prototype.fromInt=function(n){this.t=1,this.s=n<0?-1:0,0<n?this[0]=n:n<-1?this[0]=n+this.DV:this.t=0},t.prototype.fromString=function(n,i){var s;if(i==16)s=4;else if(i==8)s=3;else if(i==256)s=8;else if(i==2)s=1;else if(i==32)s=5;else{if(i!=4)return void this.fromRadix(n,i);s=2}this.t=0,this.s=0;for(var _=n.length,I=!1,x=0;0<=--_;){var V=s==8?255&n[_]:L(n,_);V<0?n.charAt(_)=="-"&&(I=!0):(I=!1,x==0?this[this.t++]=V:x+s>this.DB?(this[this.t-1]|=(V&(1<<this.DB-x)-1)<<x,this[this.t++]=V>>this.DB-x):this[this.t-1]|=V<<x,(x+=s)>=this.DB&&(x-=this.DB))}s==8&&128&n[0]&&(this.s=-1,0<x&&(this[this.t-1]|=(1<<this.DB-x)-1<<x)),this.clamp(),I&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var n=this.s&this.DM;0<this.t&&this[this.t-1]==n;)--this.t},t.prototype.dlShiftTo=function(n,i){for(var s=this.t-1;0<=s;--s)i[s+n]=this[s];for(s=n-1;0<=s;--s)i[s]=0;i.t=this.t+n,i.s=this.s},t.prototype.drShiftTo=function(n,i){for(var s=n;s<this.t;++s)i[s-n]=this[s];i.t=Math.max(this.t-n,0),i.s=this.s},t.prototype.lShiftTo=function(n,i){for(var s=n%this.DB,_=this.DB-s,I=(1<<_)-1,x=Math.floor(n/this.DB),V=this.s<<s&this.DM,k=this.t-1;0<=k;--k)i[k+x+1]=this[k]>>_|V,V=(this[k]&I)<<s;for(k=x-1;0<=k;--k)i[k]=0;i[x]=V,i.t=this.t+x+1,i.s=this.s,i.clamp()},t.prototype.rShiftTo=function(n,i){i.s=this.s;var s=Math.floor(n/this.DB);if(s>=this.t)i.t=0;else{var _=n%this.DB,I=this.DB-_,x=(1<<_)-1;i[0]=this[s]>>_;for(var V=s+1;V<this.t;++V)i[V-s-1]|=(this[V]&x)<<I,i[V-s]=this[V]>>_;0<_&&(i[this.t-s-1]|=(this.s&x)<<I),i.t=this.t-s,i.clamp()}},t.prototype.subTo=function(n,i){for(var s=0,_=0,I=Math.min(n.t,this.t);s<I;)_+=this[s]-n[s],i[s++]=_&this.DM,_>>=this.DB;if(n.t<this.t){for(_-=n.s;s<this.t;)_+=this[s],i[s++]=_&this.DM,_>>=this.DB;_+=this.s}else{for(_+=this.s;s<n.t;)_-=n[s],i[s++]=_&this.DM,_>>=this.DB;_-=n.s}i.s=_<0?-1:0,_<-1?i[s++]=this.DV+_:0<_&&(i[s++]=_),i.t=s,i.clamp()},t.prototype.multiplyTo=function(n,i){var s=this.abs(),_=n.abs(),I=s.t;for(i.t=I+_.t;0<=--I;)i[I]=0;for(I=0;I<_.t;++I)i[I+s.t]=s.am(0,_[I],i,I,0,s.t);i.s=0,i.clamp(),this.s!=n.s&&t.ZERO.subTo(i,i)},t.prototype.squareTo=function(n){for(var i=this.abs(),s=n.t=2*i.t;0<=--s;)n[s]=0;for(s=0;s<i.t-1;++s){var _=i.am(s,i[s],n,2*s,0,1);(n[s+i.t]+=i.am(s+1,2*i[s],n,2*s+1,_,i.t-s-1))>=i.DV&&(n[s+i.t]-=i.DV,n[s+i.t+1]=1)}0<n.t&&(n[n.t-1]+=i.am(s,i[s],n,2*s,0,1)),n.s=0,n.clamp()},t.prototype.divRemTo=function(n,i,s){var _=n.abs();if(!(_.t<=0)){if(($t=this.abs()).t<_.t)return i!=null&&i.fromInt(0),void(s!=null&&this.copyTo(s));s==null&&(s=o());var I=o(),x=this.s,V=n.s;0<(n=this.DB-st(_[_.t-1]))?(_.lShiftTo(n,I),$t.lShiftTo(n,s)):(_.copyTo(I),$t.copyTo(s));var k=I.t,Yt=I[k-1];if(Yt!=0){var $t=Yt*(1<<this.F1)+(1<k?I[k-2]>>this.F2:0),ce=this.FV/$t,ye=(1<<this.F1)/$t,Re=1<<this.F2,jt=s.t,Ae=jt-k,Bt=i==null?o():i;for(I.dlShiftTo(Ae,Bt),0<=s.compareTo(Bt)&&(s[s.t++]=1,s.subTo(Bt,s)),t.ONE.dlShiftTo(k,Bt),Bt.subTo(I,I);I.t<k;)I[I.t++]=0;for(;0<=--Ae;){var rn=s[--jt]==Yt?this.DM:Math.floor(s[jt]*ce+(s[jt-1]+Re)*ye);if((s[jt]+=I.am(0,rn,s,Ae,0,k))<rn)for(I.dlShiftTo(Ae,Bt),s.subTo(Bt,s);s[jt]<--rn;)s.subTo(Bt,s)}i!=null&&(s.drShiftTo(k,i),x!=V&&t.ZERO.subTo(i,i)),s.t=k,s.clamp(),0<n&&s.rShiftTo(n,s),x<0&&t.ZERO.subTo(s,s)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var n=this[0];if(!(1&n))return 0;var i=3&n;return 0<(i=(i=(i=(i=i*(2-(15&n)*i)&15)*(2-(255&n)*i)&255)*(2-((65535&n)*i&65535))&65535)*(2-n*i%this.DV)%this.DV)?this.DV-i:-i},t.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},t.prototype.exp=function(n,i){if(4294967295<n||n<1)return t.ONE;var s,_=o(),I=o(),x=i.convert(this),V=st(n)-1;for(x.copyTo(_);0<=--V;)i.sqrTo(_,I),0<(n&1<<V)?i.mulTo(I,x,_):(s=_,_=I,I=s);return i.revert(_)},t.prototype.toString=function(n){if(this.s<0)return"-"+this.negate().toString(n);var i;if(n==16)i=4;else if(n==8)i=3;else if(n==2)i=1;else if(n==32)i=5;else{if(n!=4)return this.toRadix(n);i=2}var s,_=(1<<i)-1,I=!1,x="",V=this.t,k=this.DB-V*this.DB%i;if(0<V--)for(k<this.DB&&0<(s=this[V]>>k)&&(I=!0,x=S(s));0<=V;)k<i?(s=(this[V]&(1<<k)-1)<<i-k,s|=this[--V]>>(k+=this.DB-i)):(s=this[V]>>(k-=i)&_,k<=0&&(k+=this.DB,--V)),(I=0<s||I)&&(x+=S(s));return I?x:"0"},t.prototype.negate=function(){var n=o();return t.ZERO.subTo(this,n),n},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(n){var i=this.s-n.s;if(i!=0)return i;var s=this.t;if((i=s-n.t)!=0)return this.s<0?-i:i;for(;0<=--s;)if((i=this[s]-n[s])!=0)return i;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+st(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(n){var i=o();return this.abs().divRemTo(n,null,i),this.s<0&&0<i.compareTo(t.ZERO)&&n.subTo(i,i),i},t.prototype.modPowInt=function(n,i){return i=new(n<256||i.isEven()?lt:b)(i),this.exp(n,i)},t.ZERO=O(0),t.ONE=O(1),pt.prototype.convert=Ct,pt.prototype.revert=Ct,pt.prototype.mulTo=function(n,i,s){n.multiplyTo(i,s)},pt.prototype.sqrTo=function(n,i){n.squareTo(i)},B.prototype.convert=function(n){if(n.s<0||n.t>2*this.m.t)return n.mod(this.m);if(n.compareTo(this.m)<0)return n;var i=o();return n.copyTo(i),this.reduce(i),i},B.prototype.revert=function(n){return n},B.prototype.reduce=function(n){for(n.drShiftTo(this.m.t-1,this.r2),n.t>this.m.t+1&&(n.t=this.m.t+1,n.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);n.compareTo(this.r2)<0;)n.dAddOffset(1,this.m.t+1);for(n.subTo(this.r2,n);0<=n.compareTo(this.m);)n.subTo(this.m,n)},B.prototype.mulTo=function(n,i,s){n.multiplyTo(i,s),this.reduce(s)},B.prototype.sqrTo=function(n,i){n.squareTo(i),this.reduce(i)};var $,G=[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],W=(1<<26)/G[G.length-1];function z(){var n;n=new Date().getTime(),Dt[rt++]^=255&n,Dt[rt++]^=n>>8&255,Dt[rt++]^=n>>16&255,Dt[rt++]^=n>>24&255,nn<=rt&&(rt-=nn)}if(t.prototype.chunkSize=function(n){return Math.floor(Math.LN2*this.DB/Math.log(n))},t.prototype.toRadix=function(n){if(n==null&&(n=10),this.signum()==0||n<2||36<n)return"0";var i=this.chunkSize(n),s=Math.pow(n,i),_=O(s),I=o(),x=o(),V="";for(this.divRemTo(_,I,x);0<I.signum();)V=(s+x.intValue()).toString(n).substr(1)+V,I.divRemTo(_,I,x);return x.intValue().toString(n)+V},t.prototype.fromRadix=function(n,i){this.fromInt(0);for(var s=this.chunkSize(i=i==null?10:i),_=Math.pow(i,s),I=!1,x=0,V=0,k=0;k<n.length;++k){var Yt=L(n,k);Yt<0?n.charAt(k)=="-"&&this.signum()==0&&(I=!0):(V=i*V+Yt,++x>=s&&(this.dMultiply(_),this.dAddOffset(V,0),V=x=0))}0<x&&(this.dMultiply(Math.pow(i,x)),this.dAddOffset(V,0)),I&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(n,i,s){if(typeof i=="number")if(n<2)this.fromInt(1);else for(this.fromNumber(n,s),this.testBit(n-1)||this.bitwiseTo(t.ONE.shiftLeft(n-1),nt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(i);)this.dAddOffset(2,0),this.bitLength()>n&&this.subTo(t.ONE.shiftLeft(n-1),this);else{var _=new Array;s=7&n,_.length=1+(n>>3),i.nextBytes(_),0<s?_[0]&=(1<<s)-1:_[0]=0,this.fromString(_,256)}},t.prototype.bitwiseTo=function(n,i,s){for(var _,I=Math.min(n.t,this.t),x=0;x<I;++x)s[x]=i(this[x],n[x]);if(n.t<this.t){for(_=n.s&this.DM,x=I;x<this.t;++x)s[x]=i(this[x],_);s.t=this.t}else{for(_=this.s&this.DM,x=I;x<n.t;++x)s[x]=i(_,n[x]);s.t=n.t}s.s=i(this.s,n.s),s.clamp()},t.prototype.changeBit=function(n,i){return n=t.ONE.shiftLeft(n),this.bitwiseTo(n,i,n),n},t.prototype.addTo=function(n,i){for(var s=0,_=0,I=Math.min(n.t,this.t);s<I;)_+=this[s]+n[s],i[s++]=_&this.DM,_>>=this.DB;if(n.t<this.t){for(_+=n.s;s<this.t;)_+=this[s],i[s++]=_&this.DM,_>>=this.DB;_+=this.s}else{for(_+=this.s;s<n.t;)_+=n[s],i[s++]=_&this.DM,_>>=this.DB;_+=n.s}i.s=_<0?-1:0,0<_?i[s++]=_:_<-1&&(i[s++]=this.DV+_),i.t=s,i.clamp()},t.prototype.dMultiply=function(n){this[this.t]=this.am(0,n-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(n,i){if(n!=0){for(;this.t<=i;)this[this.t++]=0;for(this[i]+=n;this[i]>=this.DV;)this[i]-=this.DV,++i>=this.t&&(this[this.t++]=0),++this[i]}},t.prototype.multiplyLowerTo=function(n,i,s){var _,I=Math.min(this.t+n.t,i);for(s.s=0,s.t=I;0<I;)s[--I]=0;for(_=s.t-this.t;I<_;++I)s[I+this.t]=this.am(0,n[I],s,I,0,this.t);for(_=Math.min(n.t,i);I<_;++I)this.am(0,n[I],s,I,0,i-I);s.clamp()},t.prototype.multiplyUpperTo=function(n,i,s){var _=s.t=this.t+n.t- --i;for(s.s=0;0<=--_;)s[_]=0;for(_=Math.max(i-this.t,0);_<n.t;++_)s[this.t+_-i]=this.am(i-_,n[_],s,0,0,this.t+_-i);s.clamp(),s.drShiftTo(1,s)},t.prototype.modInt=function(n){if(n<=0)return 0;var i=this.DV%n,s=this.s<0?n-1:0;if(0<this.t)if(i==0)s=this[0]%n;else for(var _=this.t-1;0<=_;--_)s=(i*s+this[_])%n;return s},t.prototype.millerRabin=function(n){var i=this.subtract(t.ONE),s=i.getLowestSetBit();if(s<=0)return!1;var _=i.shiftRight(s);G.length<(n=n+1>>1)&&(n=G.length);for(var I=o(),x=0;x<n;++x){I.fromInt(G[Math.floor(Math.random()*G.length)]);var V=I.modPow(_,this);if(V.compareTo(t.ONE)!=0&&V.compareTo(i)!=0){for(var k=1;k++<s&&V.compareTo(i)!=0;)if((V=V.modPowInt(2,this)).compareTo(t.ONE)==0)return!1;if(V.compareTo(i)!=0)return!1}}return!0},t.prototype.clone=function(){var n=o();return this.copyTo(n),n},t.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]},t.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},t.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var n=this.t,i=new Array;i[0]=this.s;var s,_=this.DB-n*this.DB%8,I=0;if(0<n--)for(_<this.DB&&(s=this[n]>>_)!=(this.s&this.DM)>>_&&(i[I++]=s|this.s<<this.DB-_);0<=n;)_<8?(s=(this[n]&(1<<_)-1)<<8-_,s|=this[--n]>>(_+=this.DB-8)):(s=this[n]>>(_-=8)&255,_<=0&&(_+=this.DB,--n)),128&s&&(s|=-256),I==0&&(128&this.s)!=(128&s)&&++I,(0<I||s!=this.s)&&(i[I++]=s);return i},t.prototype.equals=function(n){return this.compareTo(n)==0},t.prototype.min=function(n){return this.compareTo(n)<0?this:n},t.prototype.max=function(n){return 0<this.compareTo(n)?this:n},t.prototype.and=function(n){var i=o();return this.bitwiseTo(n,Q,i),i},t.prototype.or=function(n){var i=o();return this.bitwiseTo(n,nt,i),i},t.prototype.xor=function(n){var i=o();return this.bitwiseTo(n,Z,i),i},t.prototype.andNot=function(n){var i=o();return this.bitwiseTo(n,ft,i),i},t.prototype.not=function(){for(var n=o(),i=0;i<this.t;++i)n[i]=this.DM&~this[i];return n.t=this.t,n.s=~this.s,n},t.prototype.shiftLeft=function(n){var i=o();return n<0?this.rShiftTo(-n,i):this.lShiftTo(n,i),i},t.prototype.shiftRight=function(n){var i=o();return n<0?this.lShiftTo(-n,i):this.rShiftTo(n,i),i},t.prototype.getLowestSetBit=function(){for(var n=0;n<this.t;++n)if(this[n]!=0)return n*this.DB+(function(i){if(i==0)return-1;var s=0;return!(65535&i)&&(i>>=16,s+=16),!(255&i)&&(i>>=8,s+=8),!(15&i)&&(i>>=4,s+=4),!(3&i)&&(i>>=2,s+=2),!(1&i)&&++s,s})(this[n]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var n=0,i=this.s&this.DM,s=0;s<this.t;++s)n+=(function(_){for(var I=0;_!=0;)_&=_-1,++I;return I})(this[s]^i);return n},t.prototype.testBit=function(n){var i=Math.floor(n/this.DB);return i>=this.t?this.s!=0:!!(this[i]&1<<n%this.DB)},t.prototype.setBit=function(n){return this.changeBit(n,nt)},t.prototype.clearBit=function(n){return this.changeBit(n,ft)},t.prototype.flipBit=function(n){return this.changeBit(n,Z)},t.prototype.add=function(n){var i=o();return this.addTo(n,i),i},t.prototype.subtract=function(n){var i=o();return this.subTo(n,i),i},t.prototype.multiply=function(n){var i=o();return this.multiplyTo(n,i),i},t.prototype.divide=function(n){var i=o();return this.divRemTo(n,i,null),i},t.prototype.remainder=function(n){var i=o();return this.divRemTo(n,null,i),i},t.prototype.divideAndRemainder=function(n){var i=o(),s=o();return this.divRemTo(n,i,s),new Array(i,s)},t.prototype.modPow=function(n,i){var s=n.bitLength(),_=O(1);if(s<=0)return _;var I=s<18?1:s<48?3:s<144?4:s<768?5:6,x=new(s<8?lt:i.isEven()?B:b)(i),V=new Array,k=3,Yt=I-1,$t=(1<<I)-1;if(V[1]=x.convert(this),1<I){var ce=o();for(x.sqrTo(V[1],ce);k<=$t;)V[k]=o(),x.mulTo(ce,V[k-2],V[k]),k+=2}var ye,Re,jt=n.t-1,Ae=!0,Bt=o();for(s=st(n[jt])-1;0<=jt;){for(Yt<=s?ye=n[jt]>>s-Yt&$t:(ye=(n[jt]&(1<<s+1)-1)<<Yt-s,0<jt&&(ye|=n[jt-1]>>this.DB+s-Yt)),k=I;!(1&ye);)ye>>=1,--k;if((s-=k)<0&&(s+=this.DB,--jt),Ae)V[ye].copyTo(_),Ae=!1;else{for(;1<k;)x.sqrTo(_,Bt),x.sqrTo(Bt,_),k-=2;0<k?x.sqrTo(_,Bt):(Re=_,_=Bt,Bt=Re),x.mulTo(Bt,V[ye],_)}for(;0<=jt&&!(n[jt]&1<<s);)x.sqrTo(_,Bt),Re=_,_=Bt,Bt=Re,--s<0&&(s=this.DB-1,--jt)}return x.revert(_)},t.prototype.modInverse=function(n){var i=n.isEven();if(this.isEven()&&i||n.signum()==0)return t.ZERO;for(var s=n.clone(),_=this.clone(),I=O(1),x=O(0),V=O(0),k=O(1);s.signum()!=0;){for(;s.isEven();)s.rShiftTo(1,s),i?(I.isEven()&&x.isEven()||(I.addTo(this,I),x.subTo(n,x)),I.rShiftTo(1,I)):x.isEven()||x.subTo(n,x),x.rShiftTo(1,x);for(;_.isEven();)_.rShiftTo(1,_),i?(V.isEven()&&k.isEven()||(V.addTo(this,V),k.subTo(n,k)),V.rShiftTo(1,V)):k.isEven()||k.subTo(n,k),k.rShiftTo(1,k);0<=s.compareTo(_)?(s.subTo(_,s),i&&I.subTo(V,I),x.subTo(k,x)):(_.subTo(s,_),i&&V.subTo(I,V),k.subTo(x,k))}return _.compareTo(t.ONE)!=0?t.ZERO:0<=k.compareTo(n)?k.subtract(n):k.signum()<0?(k.addTo(n,k),k.signum()<0?k.add(n):k):k},t.prototype.pow=function(n){return this.exp(n,new pt)},t.prototype.gcd=function(n){var i=this.s<0?this.negate():this.clone(),s=n.s<0?n.negate():n.clone();i.compareTo(s)<0&&(I=i,i=s,s=I);var _=i.getLowestSetBit(),I=s.getLowestSetBit();if(I<0)return i;for(0<(I=_<I?_:I)&&(i.rShiftTo(I,i),s.rShiftTo(I,s));0<i.signum();)0<(_=i.getLowestSetBit())&&i.rShiftTo(_,i),0<(_=s.getLowestSetBit())&&s.rShiftTo(_,s),0<=i.compareTo(s)?(i.subTo(s,i),i.rShiftTo(1,i)):(s.subTo(i,s),s.rShiftTo(1,s));return 0<I&&s.lShiftTo(I,s),s},t.prototype.isProbablePrime=function(n){var i,s=this.abs();if(s.t==1&&s[0]<=G[G.length-1]){for(i=0;i<G.length;++i)if(s[0]==G[i])return!0;return!1}if(s.isEven())return!1;for(i=1;i<G.length;){for(var _=G[i],I=i+1;I<G.length&&_<W;)_*=G[I++];for(_=s.modInt(_);i<I;)if(_%G[i++]==0)return!1}return s.millerRabin(n)},t.prototype.square=function(){var n=o();return this.squareTo(n),n},t.prototype.Barrett=B,Dt==null){var Dt=new Array,rt=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var Tt=new Uint8Array(32);for(window.crypto.getRandomValues(Tt),kt=0;kt<32;++kt)Dt[rt++]=Tt[kt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Lt=window.crypto.random(32),kt=0;kt<Lt.length;++kt)Dt[rt++]=255&Lt.charCodeAt(kt)}for(;rt<nn;)kt=Math.floor(65536*Math.random()),Dt[rt++]=kt>>>8,Dt[rt++]=255&kt;rt=0,z()}function tn(){if($==null){for(z(),($=new en).init(Dt),rt=0;rt<Dt.length;++rt)Dt[rt]=0;rt=0}return $.next()}function xn(){}function en(){this.i=0,this.j=0,this.S=new Array}xn.prototype.nextBytes=function(n){for(var i=0;i<n.length;++i)n[i]=tn()},en.prototype.init=function(n){for(var i,s,_=0;_<256;++_)this.S[_]=_;for(_=i=0;_<256;++_)i=i+this.S[_]+n[_%n.length]&255,s=this.S[_],this.S[_]=this.S[i],this.S[i]=s;this.i=0,this.j=0},en.prototype.next=function(){var n;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,n=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=n,this.S[n+this.S[this.i]&255]};var nn=256;Vt.exports={default:t,BigInteger:t,SecureRandom:xn}}.call(C);var T=Xt.exports.BigInteger,Nt=(function(){function t(){X(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return E(t,[{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,u=o.toString(16);return u.length%2==1&&(u="0"+u),o<128?u:(128+u.length/2).toString(16)+u}},{key:"getValue",value:function(){return""}}]),t})(),se=(function(){et(o,Nt);var t=H(o);function o(u){var c;return X(this,o),(c=t.call(this)).t="02",u&&(c.v=(function(p){if((m=p.toString(16))[0]!=="-")m.length%2==1?m="0"+m:m.match(/^[0-7]/)||(m="00"+m);else{var m,S=(m=m.substr(1)).length;S%2==1?S+=1:m.match(/^[0-7]/)||(S+=2);for(var L="",O=0;O<S;O++)L+="f";m=(m=(L=new T(L,16)).xor(p).add(T.ONE)).toString(16).replace(/^-/,"")}return m})(u)),c}return E(o,[{key:"getValue",value:function(){return this.v}}]),o})(),ie=(function(){et(o,Nt);var t=H(o);function o(u){var c;return X(this,o),(c=t.call(this)).t="30",c.asn1Array=u,c}return E(o,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(u){return u.getEncodedHex()})).join(""),this.v}}]),o})();function qt(t,o){return+t[o+2]<8?1:128&+t.substr(o+2,2)}function ue(t,o){var u=qt(t,o);return(t=t.substr(o+2,2*u))?(+t[0]<8?new T(t,16):new T(t.substr(2),16)).intValue():-1}function ae(t,o){return o+2*(qt(t,o)+1)}var Ut=Xt.exports.BigInteger,Ht=new Ut("3"),me=(function(){function t(o,u){X(this,t),this.x=u,this.q=o}return E(t,[{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 t(this.q,this.x.negate().mod(this.q))}},{key:"add",value:function(o){return new t(this.q,this.x.add(o.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(o){return new t(this.q,this.x.subtract(o.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(o){return new t(this.q,this.x.multiply(o.toBigInteger()).mod(this.q))}},{key:"divide",value:function(o){return new t(this.q,this.x.multiply(o.toBigInteger().modInverse(this.q)).mod(this.q))}},{key:"square",value:function(){return new t(this.q,this.x.square().mod(this.q))}}]),t})(),te=(function(){function t(o,u,c,p){X(this,t),this.curve=o,this.x=u,this.y=c,this.z=p==null?Ut.ONE:p,this.zinv=null}return E(t,[{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(Ut.ZERO)&&o.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(o.z)).mod(this.curve.q).equals(Ut.ZERO))}},{key:"isInfinity",value:function(){return this.x===null&&this.y===null||this.z.equals(Ut.ZERO)&&!this.y.toBigInteger().equals(Ut.ZERO)}},{key:"negate",value:function(){return new t(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 u=this.x.toBigInteger(),c=this.y.toBigInteger(),p=this.z,m=o.x.toBigInteger(),S=o.y.toBigInteger(),L=o.z,O=this.curve.q,st=u.multiply(L).mod(O);return o=m.multiply(p).mod(O),u=st.subtract(o),m=c.multiply(L).mod(O),c=S.multiply(p).mod(O),S=m.subtract(c),Ut.ZERO.equals(u)?Ut.ZERO.equals(S)?this.twice():this.curve.infinity:(c=st.add(o),o=p.multiply(L).mod(O),L=u.square().mod(O),p=u.multiply(L).mod(O),c=o.multiply(S.square()).subtract(c.multiply(L)).mod(O),u=u.multiply(c).mod(O),m=S.multiply(L.multiply(st).subtract(c)).subtract(m.multiply(p)).mod(O),O=p.multiply(o).mod(O),new t(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(m),O))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var o=this.x.toBigInteger(),u=this.y.toBigInteger(),c=this.z,p=this.curve.q,m=this.curve.a.toBigInteger(),S=o.square().multiply(Ht).add(m.multiply(c.square())).mod(p),L=u.shiftLeft(1).multiply(c).mod(p),O=(m=(O=u.square().mod(p)).multiply(o).multiply(c).mod(p),u=L.square().mod(p),o=S.square().subtract(m.shiftLeft(3)).mod(p),c=L.multiply(o).mod(p),S.multiply(m.shiftLeft(2).subtract(o)).subtract(u.shiftLeft(1).multiply(O)).mod(p));return p=L.multiply(u).mod(p),new t(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(O),p)}},{key:"multiply",value:function(o){if(this.isInfinity())return this;if(!o.signum())return this.curve.infinity;for(var u=o.multiply(Ht),c=this.negate(),p=this,m=u.bitLength()-2;0<m;m--){p=p.twice();var S=u.testBit(m);S!==o.testBit(m)&&(p=p.add(S?this:c))}return p}}]),t})(),Ot=(function(){function t(o,u,c){X(this,t),this.q=o,this.a=this.fromBigInteger(u),this.b=this.fromBigInteger(c),this.infinity=new te(this,null,null)}return E(t,[{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 me(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 u=(o.length-2)/2,c=o.substr(2,u);return u=o.substr(2+u,u),new te(this,this.fromBigInteger(new Ut(c,16)),this.fromBigInteger(new Ut(u,16)))}}}]),t})(),Mt={ECPointFp:te,ECCurveFp:Ot},ne=Xt.exports.BigInteger,de=(Ot=Xt.exports.SecureRandom,Mt.ECCurveFp),_e=new Ot,re=(Mt=g()).curve,y=Mt.G,f=Mt.n;function g(){var t=new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),o=new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),u=new ne("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return u=(o=new de(t,o,u)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:o,G:u,n:new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function U(t,o){return t.length>=o?t:new Array(o-t.length+1).join("0")+t}function P(t,o){for(var u=[],c=~~(o/8),p=o%8,m=0,S=t.length;m<S;m++)u[m]=(t[(m+c)%S]<<p&255)+(t[(m+c+1)%S]>>>8-p&255);return u}function q(t,o){for(var u=[],c=t.length-1;0<=c;c--)u[c]=255&(t[c]^o[c]);return u}function ot(t,o){for(var u=[],c=t.length-1;0<=c;c--)u[c]=t[c]&o[c]&255;return u}function It(t,o){for(var u=[],c=t.length-1;0<=c;c--)u[c]=255&(t[c]|o[c]);return u}function gt(t,o){for(var u=[],c=0,p=t.length-1;0<=p;p--){var m=t[p]+o[p]+c;c=255<m?1:0,u[p]=255&m}return u}function Qt(t,o,u,c){return 0<=c&&c<=15?q(q(t,o),u):It(ot(t,o),ot((function(p){for(var m=[],S=p.length-1;0<=S;S--)m[S]=255&~p[S];return m})(t),u))}function ee(t,o){for(var u=[],c=[],p=0;p<16;p++){var m=4*p;u.push(o.slice(m,4+m))}for(var S,L=16;L<68;L++)u.push(q(q((S=q(q(u[L-16],u[L-9]),P(u[L-3],15)),q(q(S,P(S,15)),P(S,23))),P(u[L-13],7)),u[L-6]));for(var O=0;O<64;O++)c.push(q(u[O],u[O+4]));for(var st,lt,b,Q=[121,204,69,25],nt=[122,135,157,138],Z=t.slice(0,4),ft=t.slice(4,8),pt=t.slice(8,12),Ct=t.slice(12,16),B=t.slice(16,20),$=t.slice(20,24),G=t.slice(24,28),W=t.slice(28,32),z=0;z<64;z++){var Dt=0<=z&&z<=15?Q:nt,rt=q(Tt=P(gt(gt(P(Z,12),B),P(Dt,z)),7),P(Z,12)),Tt=(rt=gt(gt(gt((st=Z,lt=ft,b=pt,0<=(Dt=z)&&Dt<=15?q(q(st,lt),b):It(It(ot(st,lt),ot(st,b)),ot(lt,b))),Ct),rt),c[z]),gt(gt(gt(Qt(B,$,G,z),W),Tt),u[z]));Ct=pt,pt=P(ft,9),ft=Z,Z=rt,W=G,G=P($,19),$=B,B=q(q(Tt,P(Tt,9)),P(Tt,17))}return q([].concat(Z,ft,pt,Ct,B,$,G,W),t)}Ot={getGlobalCurve:function(){return re},generateEcparam:g,generateKeyPairHex:function(t,o,u){return{privateKey:u=U((o=(t?new ne(t,o,u):new ne(f.bitLength(),_e)).mod(f.subtract(ne.ONE)).add(ne.ONE)).toString(16),64),publicKey:"04"+U((o=y.multiply(o)).getX().toBigInteger().toString(16),64)+U(o.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(t){for(var o=(t=unescape(encodeURIComponent(t))).length,u=[],c=0;c<o;c++)u[c>>>2]|=(255&t.charCodeAt(c))<<24-c%4*8;for(var p=[],m=0;m<o;m++){var S=u[m>>>2]>>>24-m%4*8&255;p.push((S>>>4).toString(16)),p.push((15&S).toString(16))}return p.join("")},leftPad:U,arrayToHex:function(t){return t.map((function(o){return(o=o.toString(16)).length===1?"0"+o:o})).join("")},arrayToUtf8:function(t){for(var o=[],u=0,c=0;c<2*t.length;c+=2)o[c>>>3]|=parseInt(t[u],10)<<24-c%8*4,u++;try{for(var p=[],m=0;m<t.length;m++){var S=o[m>>>2]>>>24-m%4*8&255;p.push(String.fromCharCode(S))}return decodeURIComponent(escape(p.join("")))}catch(L){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){for(var o=[],u=(t=(u=t.length)%2!=0?U(t,u+1):t).length,c=0;c<u;c+=2)o.push(parseInt(t.substr(c,2),16));return o},verifyPublicKey:function(t){var o=re.decodePointHex(t);return!!o&&(t=o.getX(),o.getY().square().equals(t.multiply(t.square()).add(t.multiply(re.a)).add(re.b)))}},Mt=function(t){for(var o=448<=(o=(L=8*t.length)%512)?512-o%448-1:448-o-1,u=new Array((o-7)/8),c=0,p=u.length;c<p;c++)u[c]=0;for(var m,S=[],L=L.toString(2),O=7;0<=O;O--)8<L.length?(m=L.length-8,S[O]=parseInt(L.substr(m),2),L=L.substr(0,m)):0<L.length?(S[O]=parseInt(L,2),L=""):S[O]=0;for(var st=[].concat(t,[128],u,S),lt=st.length/64,b=[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],Q=0;Q<lt;Q++){var nt=64*Q;b=ee(b,st.slice(nt,64+nt))}return b};var Rt=Xt.exports.BigInteger,Or=function(t,o){return t=new se(t),o=new se(o),new ie([t,o]).getEncodedHex()},Fr=function(t){var o=ae(t,0),u=ae(t,o),c=ue(t,o);return o=t.substr(u,2*c),u=ae(t,c=u+o.length),c=ue(t,c),t=t.substr(u,2*c),{r:new T(o,16),s:new T(t,16)}},yt=Ot,Pe=Mt,ve=(Ot=yt.generateEcparam()).G,Cn=Ot.curve,Ee=Ot.n;function On(t,o,u){var c=2<arguments.length&&u!==void 0?u:"1234567812345678",p=(c=yt.utf8ToHex(c),yt.leftPad(ve.curve.a.toBigInteger().toRadix(16),64)),m=yt.leftPad(ve.curve.b.toBigInteger().toRadix(16),64),S=yt.leftPad(ve.getX().toBigInteger().toRadix(16),64),L=yt.leftPad(ve.getY().toBigInteger().toRadix(16),64);return u=(o=128<o.length?o.substr(2,128):o).substr(0,64),o=o.substr(64,64),o=yt.hexToArray(c+p+m+S+L+u+o),c=4*c.length,o.unshift(255&c),o.unshift(c>>8&255),o=Pe(o),yt.arrayToHex(Pe(o.concat(yt.hexToArray(t))))}function Fn(){var t=yt.generateKeyPairHex(),o=Cn.decodePointHex(t.publicKey);return t.k=new Rt(t.privateKey,16),t.x1=o.getX().toBigInteger(),t}Ot={generateKeyPairHex:yt.generateKeyPairHex,doEncrypt:function(t,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;t=typeof t=="string"?yt.hexToArray(yt.utf8ToHex(t)):Array.prototype.slice.call(t),o=yt.getGlobalCurve().decodePointHex(o);var c=yt.generateKeyPairHex(),p=new Rt(c.privateKey,16),m=c.publicKey;128<m.length&&(m=m.substr(m.length-128)),c=o.multiply(p),p=yt.hexToArray(yt.leftPad(c.getX().toBigInteger().toRadix(16),64)),o=yt.hexToArray(yt.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=yt.arrayToHex(Pe([].concat(p,t,o)));var S,L=1,O=0,st=[],lt=[].concat(p,o);(S=function(){st=Pe([].concat(wt(lt),[L>>24&255,L>>16&255,L>>8&255,255&L])),L++,O=0})();for(var b=0,Q=t.length;b<Q;b++)O===st.length&&S(),t[b]^=255&st[O++];return o=yt.arrayToHex(t),u===0?m+o+c:m+c+o},doDecrypt:function(t,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(m=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":m;o=new Rt(o,16);var p=t.substr(128,64),m=t.substr(192);u===0&&(p=t.substr(t.length-64),m=t.substr(128,t.length-128-64));var S,L=yt.hexToArray(m),O=(t=yt.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(o),o=yt.hexToArray(yt.leftPad(t.getX().toBigInteger().toRadix(16),64)),t=yt.hexToArray(yt.leftPad(t.getY().toBigInteger().toRadix(16),64)),1),st=0,lt=[],b=[].concat(o,t);(S=function(){lt=Pe([].concat(wt(b),[O>>24&255,O>>16&255,O>>8&255,255&O])),O++,st=0})();for(var Q=0,nt=L.length;Q<nt;Q++)st===lt.length&&S(),L[Q]^=255<[st++];return yt.arrayToHex(Pe([].concat(o,L,t)))===p?c==="array"?L:yt.arrayToUtf8(L):c==="array"?[]:""},doSignature:function(t,o){var u=(L=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=L.der,p=L.hash,m=L.publicKey,S=L.userId,L=typeof t=="string"?yt.utf8ToHex(t):yt.arrayToHex(t);p&&(L=On(L,m||(t=o,p=ve.multiply(new Rt(t,16)),"04"+(t=yt.leftPad(p.getX().toBigInteger().toString(16),64))+(p=yt.leftPad(p.getY().toBigInteger().toString(16),64))),S));var O=new Rt(o,16),st=new Rt(L,16),lt=null,b=null,Q=null;do do{var nt;lt=(nt=u&&u.length?u.pop():Fn()).k,b=st.add(nt.x1).mod(Ee)}while(b.equals(Rt.ZERO)||b.add(lt).equals(Ee));while((Q=O.add(Rt.ONE).modInverse(Ee).multiply(lt.subtract(b.multiply(O))).mod(Ee)).equals(Rt.ZERO));return c?Or(b,Q):yt.leftPad(b.toString(16),64)+yt.leftPad(Q.toString(16),64)},doVerifySignature:function(t,o,u){var c,p,m=(L=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,S=L.hash,L=L.userId;return t=typeof t=="string"?yt.utf8ToHex(t):yt.arrayToHex(t),S&&(t=On(t,u,L)),p=m?(c=(p=Fr(o)).r,p.s):(c=new Rt(o.substring(0,64),16),new Rt(o.substring(64),16)),o=Cn.decodePointHex(u),u=new Rt(t,16),!(t=c.add(p).mod(Ee)).equals(Rt.ZERO)&&(o=ve.multiply(p).add(o.multiply(t)),u=u.add(o.getX().toBigInteger()).mod(Ee),c.equals(u))},getPoint:Fn,verifyPublicKey:yt.verifyPublicKey};var Lr=Mt,Me=[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],Je=[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 Ze(t){for(var o=[],u=0,c=t.length;u<c;u+=2)o.push(parseInt(t.substr(u,2),16));return o}function Se(t,o){return t<<o|t>>>32-o}function pe(t){return(255&Me[t>>>24&255])<<24|(255&Me[t>>>16&255])<<16|(255&Me[t>>>8&255])<<8|255&Me[255&t]}function ke(t){return t^Se(t,2)^Se(t,10)^Se(t,18)^Se(t,24)}function qe(t){return t^Se(t,13)^Se(t,23)}function Ln(t,o,u,c){c=(m=(S=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":m;var p=S.mode,m=(m=S.iv)===void 0?[]:m,S=(S=S.output)===void 0?"string":S;if(p==="cbc"&&(m=typeof m=="string"?Ze(m):m).length!==16)throw new Error("iv is invalid");if((o=typeof o=="string"?Ze(o):o).length!==16)throw new Error("key is invalid");if(t=(typeof t=="string"?u!==0?function(B){for(var $=[],G=0,W=B.length;G<W;G++){var z=B.codePointAt(G);if(z<=127)$.push(z);else if(z<=2047)$.push(192|z>>>6),$.push(128|63&z);else if(z<=55295||57344<=z&&z<=65535)$.push(224|z>>>12),$.push(128|z>>>6&63),$.push(128|63&z);else{if(!(65536<=z&&z<=1114111))throw $.push(z),new Error("input is not supported");G++,$.push(240|z>>>18&28),$.push(128|z>>>12&63),$.push(128|z>>>6&63),$.push(128|63&z)}}return $}:Ze:wt)(t),c==="pkcs#5"&&u!==0)for(var L=16-t.length%16,O=0;O<L;O++)t.push(L);var st=new Array(32);(function(B,$,G){for(var W=new Array(4),z=new Array(4),Dt=0;Dt<4;Dt++)z[0]=255&B[0+4*Dt],z[1]=255&B[1+4*Dt],z[2]=255&B[2+4*Dt],z[3]=255&B[3+4*Dt],W[Dt]=z[0]<<24|z[1]<<16|z[2]<<8|z[3];W[0]^=2746333894,W[1]^=1453994832,W[2]^=1736282519,W[3]^=2993693404;for(var rt,Tt=0;Tt<32;Tt+=4)rt=W[1]^W[2]^W[3]^Je[Tt+0],$[Tt+0]=W[0]^=qe(pe(rt)),rt=W[2]^W[3]^W[0]^Je[Tt+1],$[Tt+1]=W[1]^=qe(pe(rt)),rt=W[3]^W[0]^W[1]^Je[Tt+2],$[Tt+2]=W[2]^=qe(pe(rt)),rt=W[0]^W[1]^W[2]^Je[Tt+3],$[Tt+3]=W[3]^=qe(pe(rt));if(G===0)for(var Lt,kt=0;kt<16;kt++)Lt=$[kt],$[kt]=$[31-kt],$[31-kt]=Lt})(o,st,u);for(var lt=[],b=m,Q=t.length,nt=0;16<=Q;){var Z=t.slice(nt,nt+16),ft=new Array(16);if(p==="cbc")for(var pt=0;pt<16;pt++)u!==0&&(Z[pt]^=b[pt]);(function(B,$,G){for(var W=new Array(4),z=new Array(4),Dt=0;Dt<4;Dt++)z[0]=255&B[4*Dt],z[1]=255&B[4*Dt+1],z[2]=255&B[4*Dt+2],z[3]=255&B[4*Dt+3],W[Dt]=z[0]<<24|z[1]<<16|z[2]<<8|z[3];for(var rt,Tt=0;Tt<32;Tt+=4)rt=W[1]^W[2]^W[3]^G[Tt+0],W[0]^=ke(pe(rt)),rt=W[2]^W[3]^W[0]^G[Tt+1],W[1]^=ke(pe(rt)),rt=W[3]^W[0]^W[1]^G[Tt+2],W[2]^=ke(pe(rt)),rt=W[0]^W[1]^W[2]^G[Tt+3],W[3]^=ke(pe(rt));for(var Lt=0;Lt<16;Lt+=4)$[Lt]=W[3-Lt/4]>>>24&255,$[Lt+1]=W[3-Lt/4]>>>16&255,$[Lt+2]=W[3-Lt/4]>>>8&255,$[Lt+3]=255&W[3-Lt/4]})(Z,ft,st);for(var Ct=0;Ct<16;Ct++)p==="cbc"&&u===0&&(ft[Ct]^=b[Ct]),lt[nt+Ct]=ft[Ct];p==="cbc"&&(b=u!==0?ft:Z),Q-=16,nt+=16}return c==="pkcs#5"&&u===0&&(c=lt[lt.length-1],lt.splice(lt.length-c,c)),S!=="array"?u!==0?lt.map((function(B){return(B=B.toString(16)).length===1?"0"+B:B})).join(""):(function(B){for(var $=[],G=0,W=B.length;G<W;G++)240<=B[G]&&B[G]<=247?($.push(String.fromCodePoint(((7&B[G])<<18)+((63&B[G+1])<<12)+((63&B[G+2])<<6)+(63&B[G+3]))),G+=3):224<=B[G]&&B[G]<=239?($.push(String.fromCodePoint(((15&B[G])<<12)+((63&B[G+1])<<6)+(63&B[G+2]))),G+=2):192<=B[G]&&B[G]<=223?($.push(String.fromCodePoint(((31&B[G])<<6)+(63&B[G+1]))),G++):$.push(String.fromCodePoint(B[G]));return $.join("")})(lt):lt}var Yr=[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],ge=[],xr=function(t,o,u){for(var c=t[0],p=t[1],m=t[2],S=t[3],L=t[4],O=t[5],st=t[6],lt=t[7],b=0;b<64;b++){b<16?ge[b]=0|o[u+b]:(Q=ge[b-15],nt=ge[b-2],ge[b]=((Q<<25|Q>>>7)^(Q<<14|Q>>>18)^Q>>>3)+ge[b-7]+((nt<<15|nt>>>17)^(nt<<13|nt>>>19)^nt>>>10)+ge[b-16]);var Q=c&p^c&m^p&m,nt=lt+((L<<26|L>>>6)^(L<<21|L>>>11)^(L<<7|L>>>25))+(L&O^~L&st)+Yr[b]+ge[b];lt=st,st=O,O=L,L=S+nt|0,S=m,m=p,p=c,c=nt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+Q)|0}t[0]=t[0]+c|0,t[1]=t[1]+p|0,t[2]=t[2]+m|0,t[3]=t[3]+S|0,t[4]=t[4]+L|0,t[5]=t[5]+O|0,t[6]=t[6]+st|0,t[7]=t[7]+lt|0},Yn=(Ot={c2:Ot,c3:function(t){return t=typeof t=="string"?(function(o){for(var u=[],c=0,p=o.length;c<p;c++){var m=o.codePointAt(c);if(m<=127)u.push(m);else if(m<=2047)u.push(192|m>>>6),u.push(128|63&m);else if(m<=55295||57344<=m&&m<=65535)u.push(224|m>>>12),u.push(128|m>>>6&63),u.push(128|63&m);else{if(!(65536<=m&&m<=1114111))throw u.push(m),new Error("input is not supported");c++,u.push(240|m>>>18&28),u.push(128|m>>>12&63),u.push(128|m>>>6&63),u.push(128|63&m)}}return u})(t):Array.prototype.slice.call(t),Lr(t).map((function(o){return(o=o.toString(16)).length===1?"0"+o:o})).join("")},c4:{encrypt:function(t,o,u){return Ln(t,o,1,u)},decrypt:function(t,o,u){return Ln(t,o,0,u)}},s2:function(t){var o=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],u=(function(p){for(var m=[],S=0;S<Math.ceil(p.length/4);S++)m[S]=p[4*S]<<24|(255&p[4*S+1])<<16|(255&p[4*S+2])<<8|255&p[4*S+3];return m})(t);u[(t=8*t.length)>>5]|=128<<24-t%32,u[15+(64+t>>9<<4)]=t;for(var c=0;c<u.length;c+=16)xr(o,u,c);return(function(p){for(var m=[],S=0;S<p.length;S++)m[4*S]=p[S]>>24&255,m[4*S+1]=p[S]>>16&255,m[4*S+2]=p[S]>>8&255,m[4*S+3]=255&p[S];return m})(o).map((function(p){return(p=p.toString(16)).length===1?"0"+p:p})).join("")}},vt),Ur=At,Mr=St,Jr=Gt,kr=Zt,qr=Ot.c2,Br=Ot.c3,jr=Ot.c4,Vr=Ot.s2;return(function(){var t;(t=function(){}).VERSION="2.1.0";var o=C;if(o.AAR2)return o.AAR2.VERSION!==t.VERSION&&console.log(o.AAR2.VERSION),o.AAR2;var u="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,p=!1,m=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,S=m!==void 0&&!!m.request&&!!m.login,L=function(b,Q){return typeof b=="string"&&typeof Q=="string"&&b!=null&&Q!=null&&b.substring(0,Q.length)===Q},O={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},st=function(b){for(var Q in O)if(O[Q]===b)return Q},lt=function(b,Q,nt){var Z=Date.now(),ft=new t;try{if(!b||b.length<=75)return console.error("error format 1:",b),O.ERROR_DATA_FORMAT;if(!L(b,"eyJ"))return console.error("error format 2:",b),O.ERROR_DATA_FORMAT;b=b.substring(3,b.length);var pt=Ur.my_b4_decode(b);if(!pt)return console.error("error format 3:",b),O.ERROR_DATA_FORMAT;var Ct,B=ft.cc.u8.byteToInt(pt.slice(0,4),0),$=pt.slice(4,4+B),G=ft.cc.u8.byteToInt(pt.slice(4+B,4+B+4),0),W=pt.slice(4+B+4,4+B+4+G),z=ft.cc.u8.byteToInt(pt.slice(4+B+4+G,4+B+4+G+4),0),Dt=pt.slice(4+B+4+G+4,4+B+4+G+4+z),rt=ft.cc.u8.bytesToUtf8Str($);if(ft.cc.h6.encode(W,0,G),Q||(nt!==void 0&&nt==="sm2"?(Ct=ft.cc.h6.encode(W,0,G),ft.co.c2.doVerifySignature(rt,Ct,u,{der:!0,hash:!0})):ft.co.c3(rt+"8890012345678890").toLowerCase()===ft.cc.h6.encode(Dt,0,z).toLowerCase())){if(rt.length%2==0){t.prototype.__v=function(){return rt.slice(0,2)};for(var Tt=[],Lt=2;Lt<66;Lt+=2)Tt.push(parseInt("0x"+rt.slice(Lt,Lt+2)));t.prototype.__i=function(){return Tt};var kt=parseInt("0x"+rt.slice(66,82))-Z;t.prototype.__o=function(){return kt}}return S||C.AAR2||(C.AAR2=t),O.SUCCESS}}catch(tn){return console.error(tn),O.ERROR_UNKNOWN_ERROR}return O.ERROR_SIGN_CHECK};return t.init=function(b,Q){var nt,Z={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof b=="string"?(L(b,"https")||L(b,"https")?Z.url=b:L(b,"eyJ")&&(Z.code=b),typeof Q=="string"&&(Z.publicKey=Q)):tt(b)==="object"&&(b.debug&&(Z.debug=b.debug),b.url&&(Z.url=b.url),b.code&&(Z.code=b.code),b.publicKey&&(Z.publicKey=b.publicKey),b.skipVerify&&(Z.skipVerify=b.skipVerify),b.alg&&(Z.alg=b.alg),b.callback&&typeof b.callback=="function"&&(Z.callback=b.callback)),p?Z.callback&&Z.callback(!0,{errorNo:nt=O.ALREADY_SUCCESS,errorMsg:st(nt)}):c?setTimeout((function(){t.init(b,Q)}),50):(c=!0,Z.debug&&Yn.start(Z.debug),Z.publicKey&&(u=Z.publicKey),Z.code?(nt=lt(Z.code,Z.skipVerify))===O.SUCCESS?(c=!(p=!0),Z.callback(!0,{errorNo:nt,errorMsg:st(nt)})):Z.callback(!1,{errorNo:nt,errorMsg:st(nt)}):Z.url&&(function(ft,pt,Ct){try{if(ft=ft+"?version="+t.VERSION+(S?"&name=wechat":"&name=browser")+"&t="+Date.now(),S)m.request({url:ft,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function($){$.statusCode===200?pt($.data):Ct(O.ERROR_XXX_REQUEST_FAIL)},fail:function($){$&&$.errMsg&&$.errMsg.indexOf("timeout")!==-1?Ct(O.ERROR_XXX_REQUEST_TIMEOUT):Ct(O.ERROR_XXX_REQUEST_FAIL)}});else{var B;if(window.XMLHttpRequest)B=new XMLHttpRequest;else if(window.ActiveXObject)try{B=new ActiveXObject("Msxml2.XMLHTTP")}catch($){try{B=new ActiveXObject("Microsoft.XMLHTTP")}catch(G){}}B&&(B.onload=function(){B.readyState===4&&(B.status===200?pt(B.responseText):Ct(O.ERROR_XHR_ERROR))},B.ontimeout=function(){Ct(O.ERROR_XHR_TIMEOUT)},B.onerror=function(){Ct(O.ERROR_XHR_ERROR)},B.open("POST",ft,!0),B.timeout=5e3,B.send(null))}}catch($){console.error($),Ct(O.ERROR_UNKNOWN_ERROR)}})(Z.url,(function(ft){(ft=lt(ft,Z.skipVerify,Z.alg))===O.SUCCESS?(c=!(p=!0),Z.callback(!0,{errorNo:ft,errorMsg:st(ft)})):(c=!1,Z.callback(!1,{errorNo:ft,errorMsg:st(ft)}))}),(function(ft){c=!1,Z.callback(!1,{errorNo:ft,errorMsg:st(ft)})})))},t.prototype={cc:{b4:Mr,h6:Jr,u8:kr},co:{c2:qr,c3:Br,c4:jr,s2:Vr},nonce:function(){var b="0000000000"+Math.ceil(2147483647*Math.random())+Math.floor((Date.now()+this.__o())/1e3);return b.substring(b.length-20)},sign:function(b,Q){return this.__s(b,Q)},__s:function(b,Q){var nt=this.cc.u8.utf8StrToBytes(b),Z=this.__i();return b=this.cc.u8.utf8StrToBytes(Q),Q=this.cc.u8.utf8StrToBytes(this.__c()),b=[].concat(nt,Z,b,Q),Q=parseInt("0x"+this.__v()),this.__f(Q)(b)+this.__v()},__f:function(b){var Q=this.co.s2,nt=this.co.c3,Z=this.cc.h6.decode,ft=[function(pt){return Q(pt)},function(pt){return nt(pt)},function(pt){return nt(Z(Q(pt)))},function(pt){return Q(Z(nt(pt)))},function(pt){return nt(Z(nt(pt)))},function(pt){return Q(Z(Q(pt)))}];return ft[(128<b?b-128:b)%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(m!==void 0&&m.env&&m.request&&m.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 Yn.isDebug()},version:function(){return t.VERSION}},t})()},ct(h)=="object"?l.exports=M():(N=typeof(v=M)=="function"?v.call(h,A,h,l):v)===void 0||(l.exports=N)}},r={};function a(l){var h=r[l];if(h!==void 0)return h.exports;var A=r[l]={id:l,loaded:!1,exports:{}};return e[l].call(A.exports,A,A.exports,a),A.loaded=!0,A.exports}a.n=l=>{var h=l&&l.__esModule?()=>l.default:()=>l;return a.d(h,{a:h}),h},a.d=(l,h)=>{for(var A in h)a.o(h,A)&&!a.o(l,A)&&Object.defineProperty(l,A,{enumerable:!0,get:h[A]})},a.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(l){if(typeof window=="object")return window}})(),a.hmd=l=>((l=Object.create(l)).children||(l.children=[]),Object.defineProperty(l,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+l.id)}}),l),a.o=(l,h)=>Object.prototype.hasOwnProperty.call(l,h),a.r=l=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})};var d=a(737);Zn.exports.LyyGetCommandSDK=d})()});var Bo={};je(Bo,{DyErrorCode:()=>he,DyErrorMessage:()=>ut,ENV_TYPE:()=>Wt,EXTERNAL_ENV_TYPE:()=>le,JdErrorCode:()=>Xe,JdErrorMessage:()=>bt,createServices:()=>Cr,getDisplayAdConfig:()=>bn,getDyPayRtaData:()=>$e,handleDyAuthDebitSignFlow:()=>Sn,handleDyJsapiPayFlow:()=>En,handleDyPayCommandFlow:()=>vn,handleDyPayFlow:()=>We,handleJdInsurance:()=>_n,handleJdInsuranceExt:()=>yn,handleJdjrCashLoanExt:()=>dn,handleJdjrCashLoanFlow:()=>fn,normalizeDisplayAdData:()=>ze});module.exports=zr(Bo);var Wt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},le={SIT:"sit",RELEASE:"release",PROD:"prod"},He={[Wt.DEV]:"https://dm.leyaoyao.com",[Wt.SIT]:"https://sm.leyaoyao.com",[Wt.UAT]:"https://um.leyaoyao.com",[Wt.PROD]:"https://m.leyaoyao.com"},Jn={[Wt.DEV]:"https://dad2.leyaoyao.com",[Wt.SIT]:"https://sad2.leyaoyao.com",[Wt.UAT]:"https://uad2.leyaoyao.com",[Wt.PROD]:"https://nad.ehuoke.com"},Ne={[le.SIT]:"https://sopenapi.leyaoyao.com",[le.RELEASE]:"https://uopen-api.leyaoyao.com",[le.PROD]:"https://api-gateway.leyaoyao.com"};function Ge(e,r){return`${He[e]||He[Wt.PROD]}${r}`}function kn(e){return Jn[e]||Jn[Wt.PROD]}var Te={debug:!1,env:Wt.PROD,externalEnv:le.PROD,apiDomain:""},qn=at({},Te);function Bn(e){qn=at(at({},Te),e)}function fe(){return qn}var Zr=Object.defineProperty,to=(e,r,a)=>r in e?Zr(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,eo=(e,r,a)=>to(e,typeof r!="symbol"?r+"":r,a);function oe(){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 no=class{constructor(e=!1){eo(this,"enable"),this.enable=e}setEnable(e){this.enable=e}info(...e){this.enable&&console.info("[BI Info]",...e)}warn(...e){this.enable&&console.warn("[BI Warn]",...e)}error(...e){this.enable&&console.error("[BI Error]",...e)}debug(...e){this.enable&&console.log("[BI Debug]",...e)}},w=new no;function Ce(e){let r=oe();return r==="taro"?Taro.setClipboardData({data:e}).then(()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):r==="uni"?new Promise((a,d)=>{uni.setClipboardData({data:e,success:()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{w.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),d(l)}})}):r==="wechat"?new Promise((a,d)=>{wx.setClipboardData({data:e,success:()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{w.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),d(l)}})}):r==="alipay"?new Promise((a,d)=>{my.setClipboardData({text:e,success:()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{w.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),d(l)}})}):navigator.clipboard.writeText(e).then(()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function an(e,r=2e3){let a=oe();if(a==="taro"){Taro.showToast({title:e,icon:"none",mask:!0,duration:r});return}if(a==="uni"){uni.showToast({title:e,icon:"none",mask:!0,duration:r});return}if(a==="wechat"){wx.showToast({title:e,icon:"none",mask:!0,duration:r});return}if(a==="alipay"){my.showToast({content:e,duration:r});return}typeof console!="undefined"&&console.log(`[Toast] ${e}`)}async function De(){var e,r,a,d,l;let h=oe();try{if(h==="taro")return((e=(await Taro.getSystemInfo()).platform)==null?void 0:e.toLowerCase())==="ios"?"ios":"android";if(h==="uni")return((r=uni.getSystemInfoSync().platform)==null?void 0:r.toLowerCase())==="ios"?"ios":"android";if(h==="wechat")return wx.getDeviceInfo?((a=(await wx.getDeviceInfo()).platform)==null?void 0:a.toLowerCase())==="ios"?"ios":"android":((d=wx.getSystemInfoSync().platform)==null?void 0:d.toLowerCase())==="ios"?"ios":"android";if(h==="alipay")return((l=my.getSystemInfoSync().platform)==null?void 0:l.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let A=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(A))return"ios";if(/android/.test(A))return"android"}return"unknown"}catch(A){return w.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",A),"unknown"}}var xt={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function J(e,r,a=null){return{code:e,message:r,data:a}}function Ke(e,r){return e==null?{valid:!1,message:`${r}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof e=="string"&&e.trim().length===0?{valid:!1,message:`${r}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Oe(e,r){for(let a of r){let d=Ke(e[a],a);if(!d.valid)return d}return{valid:!0}}var pn={};je(pn,{handleJdInsurance:()=>_n,handleJdInsuranceExt:()=>yn,handleJdjrCashLoanExt:()=>dn,handleJdjrCashLoanFlow:()=>fn});var Xe=(H=>(H[H.JD_CASH_LOAN__MISSING_PHONE=2001]="JD_CASH_LOAN__MISSING_PHONE",H[H.JD_CASH_LOAN__MISSING_DEVICE_ID=2002]="JD_CASH_LOAN__MISSING_DEVICE_ID",H[H.JD_CASH_LOAN__RTA_FAILED=2003]="JD_CASH_LOAN__RTA_FAILED",H[H.JD_CASH_LOAN__GET_CONFIG_FAILED=2004]="JD_CASH_LOAN__GET_CONFIG_FAILED",H[H.JD_CASH_LOAN__INVALID_CONFIG=2005]="JD_CASH_LOAN__INVALID_CONFIG",H[H.JD_CASH_LOAN__EXT_NOT_ELIGIBLE=2006]="JD_CASH_LOAN__EXT_NOT_ELIGIBLE",H[H.JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS=2007]="JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS",H[H.JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM=2008]="JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM",H[H.JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID=2009]="JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID",H[H.JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE=2010]="JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE",H[H.JD_INSURANCE__USER_NOT_ELIGIBLE=2101]="JD_INSURANCE__USER_NOT_ELIGIBLE",H[H.JD_INSURANCE__H5_NOT_SUPPORTED=2102]="JD_INSURANCE__H5_NOT_SUPPORTED",H[H.JD_INSURANCE__INVALID_JUMP_PARAMS=2103]="JD_INSURANCE__INVALID_JUMP_PARAMS",H[H.JD_INSURANCE__GET_CONFIG_FAILED=2104]="JD_INSURANCE__GET_CONFIG_FAILED",H[H.JD_INSURANCE__COPY_FAILED=2105]="JD_INSURANCE__COPY_FAILED",H[H.JD_INSURANCE__TASK_COMPLETED=2106]="JD_INSURANCE__TASK_COMPLETED",H[H.JD_INSURANCE__UNKNOWN_JUMP_MODE=2107]="JD_INSURANCE__UNKNOWN_JUMP_MODE",H[H.JD_INSURANCE__RTA_FAILED=2108]="JD_INSURANCE__RTA_FAILED",H))(Xe||{}),bt={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"},he=(T=>(T[T.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",T[T.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",T[T.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",T[T.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",T[T.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",T[T.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",T[T.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",T[T.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",T[T.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",T[T.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",T[T.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",T[T.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",T[T.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",T[T.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",T[T.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",T[T.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",T[T.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",T[T.DY_PAY__INVALID_RETURN_TYPE=3018]="DY_PAY__INVALID_RETURN_TYPE",T[T.DY_PAY__JSAPI_INFO_FAILED=3019]="DY_PAY__JSAPI_INFO_FAILED",T[T.DY_PAY__REQUEST_JSAPI_INFO_FAILED=3020]="DY_PAY__REQUEST_JSAPI_INFO_FAILED",T[T.DY_PAY__MISSING_JSAPI_PAY_INFO=3021]="DY_PAY__MISSING_JSAPI_PAY_INFO",T[T.DY_PAY__INVALID_JSAPI_PAY_INFO=3022]="DY_PAY__INVALID_JSAPI_PAY_INFO",T[T.DY_PAY__JSAPI_SIGNATURE_FAILED=3023]="DY_PAY__JSAPI_SIGNATURE_FAILED",T[T.DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED=3024]="DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED",T[T.DY_PAY__JSAPI_UNSUPPORTED_ENV=3025]="DY_PAY__JSAPI_UNSUPPORTED_ENV",T[T.DY_PAY__JSAPI_AUTH_REDIRECT_FAILED=3026]="DY_PAY__JSAPI_AUTH_REDIRECT_FAILED",T[T.DY_PAY__JSAPI_SDK_LOAD_FAILED=3027]="DY_PAY__JSAPI_SDK_LOAD_FAILED",T[T.DY_PAY__JSAPI_CONFIG_FAILED=3028]="DY_PAY__JSAPI_CONFIG_FAILED",T[T.DY_PAY__JSAPI_INVOKE_FAILED=3029]="DY_PAY__JSAPI_INVOKE_FAILED",T[T.DY_PAY__MISSING_AUTH_TOKEN=3030]="DY_PAY__MISSING_AUTH_TOKEN",T[T.DY_PAY_COMMAND__MISSING_ORDER_AMOUNT=3031]="DY_PAY_COMMAND__MISSING_ORDER_AMOUNT",T[T.DY_PAY_COMMAND__GET_FAILED=3032]="DY_PAY_COMMAND__GET_FAILED",T[T.DY_PAY_COMMAND__REQUEST_FAILED=3033]="DY_PAY_COMMAND__REQUEST_FAILED",T[T.DY_PAY_COMMAND__COPY_FAILED=3034]="DY_PAY_COMMAND__COPY_FAILED",T[T.DY_PAY_COMMAND__INVALID_RTA_DATA=3035]="DY_PAY_COMMAND__INVALID_RTA_DATA",T[T.DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID=3036]="DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID",T[T.DY_PAY__AUTH_DEBIT_SIGN_FAILED=3037]="DY_PAY__AUTH_DEBIT_SIGN_FAILED",T[T.DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED=3038]="DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED",T[T.DY_PAY__JSAPI_PAY_CANCELLED=3039]="DY_PAY__JSAPI_PAY_CANCELLED",T))(he||{}),ut={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"};var ro=(e,r,a,d)=>{let l=oe();if(l==="taro")return Taro.request({url:e,method:r,data:a,header:d}).then(v=>v);if(l==="uni")return new Promise((v,N)=>{uni.request({url:e,method:r,data:a,header:d,success:M=>v(M),fail:M=>N(M)})});if(l==="wechat")return new Promise((v,N)=>{wx.request({url:e,method:r,data:a,header:d,success:M=>v(M),fail:M=>N(M)})});if(l==="alipay")return new Promise((v,N)=>{my.request({url:e,method:r,data:a,headers:d,success:M=>v(M),fail:M=>N(M)})});let h=r.toUpperCase()==="GET",A=h&&a&&Object.keys(a).length?`${e}?${new URLSearchParams(a).toString()}`:e;return fetch(A,{method:r,headers:d,body:h?void 0:JSON.stringify(a)}).then(async v=>({statusCode:v.status,data:await v.json()}))},sn=class{constructor(r=null){Ve(this,"staticConfig");this.staticConfig=r}getCurrentConfig(){return this.staticConfig||fe()||Te}async getAuthToken(){let r=this.getCurrentConfig();if(r.getAuthToken&&typeof r.getAuthToken=="function")try{let a=await r.getAuthToken();return a?(w.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),a):(w.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(a){return w.error("\u83B7\u53D6Token\u5931\u8D25",a),null}return null}async buildHeader(r={},a=!0){let d=at({"content-type":"application/json"},r);if(!a)return d;let l=await this.getAuthToken();if(!l)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 d.Authorization_bar=l,d}async request(r){let{path:a,method:d="POST",data:l={},header:h={},authRequired:A=!0,baseDomain:v,beforeRequest:N,afterResponse:M}=r,ct=v?`${v}${a}`:Ge(this.getCurrentConfig().env||"prod",a),tt=await this.buildHeader(h,A);N&&typeof N=="function"&&await N({url:ct,method:d,data:l,header:tt}),w.info(`\u53D1\u8D77${d}\u8BF7\u6C42:`,{path:a,method:d});try{let X=await ro(ct,d,l,tt);return w.info("\u8BF7\u6C42\u6210\u529F:",{path:a,statusCode:X.statusCode}),M&&typeof M=="function"&&await M(X.data),X.data}catch(X){throw w.error("\u8BF7\u6C42\u5931\u8D25:",{path:a,error:X}),X}}get(r,a={},d={}){return this.request(at({path:r,method:"GET",data:a},d))}post(r,a={},d={}){return this.request(at({path:r,method:"POST",data:a},d))}},we=(e=null)=>new sn(e);var oo=(function(){"use strict";function e(E,et){var mt=(65535&E)+(65535&et);return(E>>16)+(et>>16)+(mt>>16)<<16|65535&mt}function r(E,et,mt,it,H,wt){return e((wt=e(e(et,E),e(it,wt)))<<H|wt>>>32-H,mt)}function a(E,et,mt,it,H,wt,R){return r(et&mt|~et&it,E,et,H,wt,R)}function d(E,et,mt,it,H,wt,R){return r(et&it|mt&~it,E,et,H,wt,R)}function l(E,et,mt,it,H,wt,R){return r(et^mt^it,E,et,H,wt,R)}function h(E,et,mt,it,H,wt,R){return r(mt^(et|~it),E,et,H,wt,R)}function A(E,et){var mt,it,H,wt;E[et>>5]|=128<<et%32,E[14+(et+64>>>9<<4)]=et;for(var R=1732584193,C=-271733879,Y=-1732584194,F=271733878,D=0;D<E.length;D+=16)R=a(mt=R,it=C,H=Y,wt=F,E[D],7,-680876936),F=a(F,R,C,Y,E[D+1],12,-389564586),Y=a(Y,F,R,C,E[D+2],17,606105819),C=a(C,Y,F,R,E[D+3],22,-1044525330),R=a(R,C,Y,F,E[D+4],7,-176418897),F=a(F,R,C,Y,E[D+5],12,1200080426),Y=a(Y,F,R,C,E[D+6],17,-1473231341),C=a(C,Y,F,R,E[D+7],22,-45705983),R=a(R,C,Y,F,E[D+8],7,1770035416),F=a(F,R,C,Y,E[D+9],12,-1958414417),Y=a(Y,F,R,C,E[D+10],17,-42063),C=a(C,Y,F,R,E[D+11],22,-1990404162),R=a(R,C,Y,F,E[D+12],7,1804603682),F=a(F,R,C,Y,E[D+13],12,-40341101),Y=a(Y,F,R,C,E[D+14],17,-1502002290),R=d(R,C=a(C,Y,F,R,E[D+15],22,1236535329),Y,F,E[D+1],5,-165796510),F=d(F,R,C,Y,E[D+6],9,-1069501632),Y=d(Y,F,R,C,E[D+11],14,643717713),C=d(C,Y,F,R,E[D],20,-373897302),R=d(R,C,Y,F,E[D+5],5,-701558691),F=d(F,R,C,Y,E[D+10],9,38016083),Y=d(Y,F,R,C,E[D+15],14,-660478335),C=d(C,Y,F,R,E[D+4],20,-405537848),R=d(R,C,Y,F,E[D+9],5,568446438),F=d(F,R,C,Y,E[D+14],9,-1019803690),Y=d(Y,F,R,C,E[D+3],14,-187363961),C=d(C,Y,F,R,E[D+8],20,1163531501),R=d(R,C,Y,F,E[D+13],5,-1444681467),F=d(F,R,C,Y,E[D+2],9,-51403784),Y=d(Y,F,R,C,E[D+7],14,1735328473),R=l(R,C=d(C,Y,F,R,E[D+12],20,-1926607734),Y,F,E[D+5],4,-378558),F=l(F,R,C,Y,E[D+8],11,-2022574463),Y=l(Y,F,R,C,E[D+11],16,1839030562),C=l(C,Y,F,R,E[D+14],23,-35309556),R=l(R,C,Y,F,E[D+1],4,-1530992060),F=l(F,R,C,Y,E[D+4],11,1272893353),Y=l(Y,F,R,C,E[D+7],16,-155497632),C=l(C,Y,F,R,E[D+10],23,-1094730640),R=l(R,C,Y,F,E[D+13],4,681279174),F=l(F,R,C,Y,E[D],11,-358537222),Y=l(Y,F,R,C,E[D+3],16,-722521979),C=l(C,Y,F,R,E[D+6],23,76029189),R=l(R,C,Y,F,E[D+9],4,-640364487),F=l(F,R,C,Y,E[D+12],11,-421815835),Y=l(Y,F,R,C,E[D+15],16,530742520),R=h(R,C=l(C,Y,F,R,E[D+2],23,-995338651),Y,F,E[D],6,-198630844),F=h(F,R,C,Y,E[D+7],10,1126891415),Y=h(Y,F,R,C,E[D+14],15,-1416354905),C=h(C,Y,F,R,E[D+5],21,-57434055),R=h(R,C,Y,F,E[D+12],6,1700485571),F=h(F,R,C,Y,E[D+3],10,-1894986606),Y=h(Y,F,R,C,E[D+10],15,-1051523),C=h(C,Y,F,R,E[D+1],21,-2054922799),R=h(R,C,Y,F,E[D+8],6,1873313359),F=h(F,R,C,Y,E[D+15],10,-30611744),Y=h(Y,F,R,C,E[D+6],15,-1560198380),C=h(C,Y,F,R,E[D+13],21,1309151649),R=h(R,C,Y,F,E[D+4],6,-145523070),F=h(F,R,C,Y,E[D+11],10,-1120210379),Y=h(Y,F,R,C,E[D+2],15,718787259),C=h(C,Y,F,R,E[D+9],21,-343485551),R=e(R,mt),C=e(C,it),Y=e(Y,H),F=e(F,wt);return[R,C,Y,F]}function v(E){for(var et="",mt=32*E.length,it=0;it<mt;it+=8)et+=String.fromCharCode(E[it>>5]>>>it%32&255);return et}function N(E){var et=[];for(et[(E.length>>2)-1]=void 0,it=0;it<et.length;it+=1)et[it]=0;for(var mt=8*E.length,it=0;it<mt;it+=8)et[it>>5]|=(255&E.charCodeAt(it/8))<<it%32;return et}function M(E){for(var et,mt="0123456789abcdef",it="",H=0;H<E.length;H+=1)et=E.charCodeAt(H),it+=mt.charAt(et>>>4&15)+mt.charAt(15&et);return it}function ct(E){return unescape(encodeURIComponent(E))}function tt(E){return v(A(N(E=ct(E)),8*E.length))}function X(E,et){return(function(mt,it){var H,wt=N(mt),R=[],C=[];for(R[15]=C[15]=void 0,16<wt.length&&(wt=A(wt,8*mt.length)),H=0;H<16;H+=1)R[H]=909522486^wt[H],C[H]=1549556828^wt[H];return it=A(R.concat(N(it)),512+8*it.length),v(A(C.concat(it),640))})(ct(E),ct(et))}function Ft(E,et,mt){return et?mt?X(et,E):M(X(et,E)):mt?tt(E):M(tt(E))}return Ft})(),Fe=oo;function jn(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function Vn(e){if(typeof e!="object"||e===null)return e;let r=Object.keys(e).sort(),a={};for(let d of r)a[d]=e[d];return JSON.stringify(a)}function Hn(e,r){let a={appId:e.appId,randomStr:e.randomStr,data:e.data},d=Object.keys(a).sort(),l="";for(let[h,A]of d.entries())l+=`${A}=${a[A]}`,h<d.length-1&&(l+="&");return l+=`&secretKey=${r}`,Fe(l)}var io=(e,r,a,d)=>{let l=oe();return l==="taro"?Taro.request({url:e,method:r,data:a,header:d}).then(h=>h):l==="uni"?new Promise((h,A)=>{uni.request({url:e,method:r,data:a,header:d,success:v=>h(v),fail:v=>A(v)})}):l==="wechat"?new Promise((h,A)=>{wx.request({url:e,method:r,data:a,header:d,success:v=>h(v),fail:v=>A(v)})}):l==="alipay"?new Promise((h,A)=>{my.request({url:e,method:r,data:a,headers:d,success:v=>h(v),fail:v=>A(v)})}):fetch(e,{method:r,headers:d,body:JSON.stringify(a)}).then(async h=>({statusCode:h.status,data:await h.json()}))},un=class{constructor(r=null){Ve(this,"staticConfig");this.staticConfig=r}getCurrentConfig(){return this.staticConfig||fe()||{}}getExternalEnv(){var r;return((r=this.getCurrentConfig())==null?void 0:r.externalEnv)||le.PROD}getExternalHost(){let r=this.getExternalEnv();return Ne[r]||Ne.prod}generateSign(r={}){let a=this.getCurrentConfig(),{externalAppId:d,externalAppSecret:l}=a;if(!d||!l)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let h=jn(),A=Vn(r),v=Hn({appId:d,randomStr:h,data:A},l);return{appId:d,randomStr:h,sign:v}}buildRequestBody(r={}){let a=this.generateSign(r);return zt(at({},a),{data:r})}buildUrl(r){return`${this.getExternalHost()}${r}`}async request(r){let{path:a,method:d="POST",data:l={},header:h={},needSign:A=!0,beforeRequest:v,afterResponse:N}=r,M=this.buildUrl(a),ct=at({"content-type":"application/json"},h),tt=A?this.buildRequestBody(l):l;v&&typeof v=="function"&&await v({url:M,method:d,data:tt,header:ct}),w.info(`\u53D1\u8D77${d}\u8BF7\u6C42:`,{path:a,method:d});try{let X=await io(M,d,tt,ct);if(w.info("\u8BF7\u6C42\u6210\u529F:",{path:a,statusCode:X.statusCode}),N&&typeof N=="function"&&await N(X.data),X.statusCode===200&&X.data.code===200)return X.data.data;throw{code:X.data.code,msg:X.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:X.data}}catch(X){throw(X==null?void 0:X.code)!==void 0?X:(w.error("\u8BF7\u6C42\u5931\u8D25:",{path:a,error:X}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:X})}}get(r,a={},d={}){return this.request(at({path:r,method:"GET",data:a},d))}post(r,a={},d={}){return this.request(at({path:r,method:"POST",data:a},d))}},Gn=(e=null)=>new un(e);var cn=we(),ln=Gn();function Kn(e){let r=Ke(e==null?void 0:e.equipmentValue,"equipmentValue");return r.valid?cn.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",e):Promise.reject({code:"PARAM_ERROR",message:r.message})}async function Xn(e){let r=Oe(e,["idMd5Value","rtaStrategy"]);return r.valid?ln.post("/open/rest/cpa/jd/rta-check",e):Promise.reject({code:"PARAM_ERROR",message:r.message})}async function Qn(e){try{let r={thirdPlatform:e.thirdPlatform,thirdPlatformUserId:e.thirdPlatformUserId,thirdPlatformEquipmentValue:e.thirdPlatformEquipmentValue,os:e.os,client:"wxMini"};e.phone&&(r.mobileMd5=Fe(e.phone)),e.extendData&&(Object.prototype.toString.call(e.extendData)==="[object Object]"?r.extendData=e.extendData:w.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let a=await ln.post("/open/rest/cpa/jd/insurance/get",r);return a?a.jumpMode==1?{jumpMode:1,appId:a.appId,url:a.url}:{jumpMode:2,url:a.url,channel:a.channelId}:void 0}catch(r){throw w.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",r),r}}function Wn(e){let r=Ke(e==null?void 0:e.equipmentValue,"equipmentValue");return r.valid?cn.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",e):Promise.reject({code:"PARAM_ERROR",message:r.message})}function $n(e){let r=Oe(e,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return r.valid?cn.post("/gw/advert/customer/cpa-activity/jd/rta/validate",e):Promise.reject({code:"PARAM_ERROR",message:r.message})}async function zn(e){let r=await De(),a={thirdPlatform:e.thirdPlatform,thirdPlatformUserId:e.thirdPlatformUserId,thirdPlatformEquipmentValue:e.thirdPlatformEquipmentValue,os:r,client:e.client};return e.phone&&(a.mobileMd5=Fe(e.phone)),e.extendData&&(Object.prototype.toString.call(e.extendData)==="[object Object]"?a.extendData=e.extendData:w.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),ln.post("/open/rest/cpa/jd/cash-loan/get",a)}async function fn(e){let{phone:r,rtaId:a,equipmentId:d,lyyUserId:l,entrance:h}=e;if(!r)return J(xt.INVALID_PARAM,bt[2001]);if(!d)return J(xt.INVALID_PARAM,bt[2002]);try{if(a){w.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:r});let tt=await $n({phone:r,lyyEquipmentValue:d,lyyUserId:l||"",rtaId:a});if(tt.code!=="0000000"||!tt.body||tt.body.state!=1)return w.error("RTA\u9A8C\u8BC1\u5931\u8D25",tt),J(2003,bt[2003]);w.info("RTA\u9A8C\u8BC1\u6210\u529F",tt.body)}w.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:r});let A=await De(),v=await Wn({phone:r,equipmentValue:d,os:A,entrance:h});if(v.code!=="0000000"||!v.body)return w.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",v),J(2004,bt[2004]);let{appId:N,targetUrl:M}=v.body;if(!N||!M)return w.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:N,targetUrl:M}),J(2005,bt[2005]);let ct=J(xt.SUCCESS,"\u6210\u529F",{appId:N,targetUrl:M});return w.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",ct),ct}catch(A){return w.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",A),J(xt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function dn(e){let{phone:r,rtaId:a,thirdPlatform:d,thirdPlatformUserId:l,thirdPlatformEquipmentValue:h}=e;if(!r)return J(xt.INVALID_PARAM,bt[2001]);if(!d)return J(2008,bt[2008]);if(!l)return J(2009,bt[2009]);if(!h)return J(2010,bt[2010]);try{if(a){w.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:r});let X=await Xn({idMd5Value:r,rtaStrategy:a});if(X.status!=1)return w.error("RTA\u9A8C\u8BC1\u5931\u8D25",X),J(2003,bt[2003]);w.info("RTA\u9A8C\u8BC1\u6210\u529F",X)}let A=await zn(e),{url:v,channelId:N,matchFlag:M,jumpMode:ct,appId:tt}=A||{};return M?ct===3?!tt||!v?J(2007,bt[2007]):J(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:tt,url:v}):J(2007,bt[2007]):J(2006,bt[2006])}catch(A){return w.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",A),J(xt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var be=null,Le=null;try{Le=tr()}catch(e){}function er(){return be||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(be=globalThis.LyyGetCommandSDK,be):Le?(be=Le.LyyGetCommandSDK||Le.default||Le,be):null)}function nr(e){var a;w.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",e);let r=er();r!=null&&r.getJrCommand?r.getJrCommand(e):(a=r==null?void 0:r.default)!=null&&a.getJrCommand?r.default.getJrCommand(e):(w.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),e.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function ao(e,r){return new Promise((a,d)=>{try{nr({url:e,channel:r,callback:l=>{l.code==="0"?a(l.data):d({msg:l.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(l){d(l)}})}async function _n(e){try{let r=await De(),a=at({os:r},e);w.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",a);let{code:d,body:l}=await Kn(a);if(d==="0000000"&&l){let{url:h,channelId:A,matchFlag:v,jumpMode:N,appId:M}=l;if(!v)return J(2101,bt[2101]);if(N===1)return w.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),J(2102,bt[2102]);if(N===2)return oe()==="web"&&w.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:h}),!h||!A?J(2103,bt[2103]):new Promise(ct=>{nr({url:h,channel:A,callback:async tt=>{if((tt==null?void 0:tt.code)==="0")try{await Ce(tt==null?void 0:tt.data),ct(J(xt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(X){ct(J(2105,bt[2105]))}else ct(J(2105,bt[2105]))}})});if(N===3)return!M||!h?J(2103,bt[2103]):J(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:M,path:h})}return J(2104,bt[2104])}catch(r){return w.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",r),J(xt.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function yn(e){w.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let r=await Qn(zt(at({},e),{os:await De()}));if(!r)return w.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),J(2106,bt[2106]);if(r.jumpMode===1)return w.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:r.appId,url:r.url}),J(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:r.appId,path:r.url});if(r.jumpMode===2){if(oe()==="web")return w.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:r.url}),J(xt.SUCCESS,"\u6210\u529F",{type:"h5",url:r.url});try{let a=await ao(r.url,r.channel);return await Ce(a),w.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),J(xt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(a){return w.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",a),an("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),J(2105,bt[2105])}}return w.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",r.jumpMode),J(2107,bt[2107])}catch(r){let a=typeof r=="string"?r:(r==null?void 0:r.msg)||(r==null?void 0:r.message)||"\u672A\u77E5\u9519\u8BEF";return w.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",a),an("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),a.includes("RTA")||a.includes("\u8D44\u683C")?J(2108,bt[2108]):J(xt.NETWORK_ERROR,a)}}var Rn={};je(Rn,{DyErrorCode:()=>he,getDyPayRtaData:()=>$e,handleDyAuthDebitSignFlow:()=>Sn,handleDyJsapiPayFlow:()=>En,handleDyPayCommandFlow:()=>vn,handleDyPayFlow:()=>We});var so=["weapp","h5"],uo=["h5","ulink","jsapi"],co=["switchTab","reLaunch","redirectTo","navigateTo"];function lo(e){return so.includes(e)}function fo(e){return uo.includes(e)}function _o(e){return co.includes(e)}function rr(e){let r=e.returnType||"h5";return!e.telephone&&r==="h5"?{valid:!1,errorCode:3001}:e.price?e.equipmentValue?e.businessType?e.client&&!lo(e.client)?{valid:!1,errorCode:3004}:fo(r)?e.douyinOrderExtendData&&typeof e.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:e.backWay&&e.client==="weapp"&&!_o(e.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 or(e){return e.price?e.equipmentValue?e.businessType?e.douyinOrderExtendData&&typeof e.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}}function ir(e){return e.equipmentValue?{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function ar(e){return e.equipmentValue?e.orderAmount?e.businessType?e.commandUrl!=null&&typeof e.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3031}:{valid:!1,errorCode:3002}}function sr(e){return e.equipmentValue?e.commandUrl!=null&&typeof e.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function ur(e){return e.showFlag===!0&&typeof e.payAmount=="number"&&e.payAmount>0&&typeof e.businessType=="number"&&e.businessType>0}var Ie=we();async function cr(e){let{price:r,equipmentValue:a,douyinOrderExtendData:d,douyinCommodityVirtualFlag:l,businessType:h,platformActivities:A={}}=e,v={businessType:h,equipmentValue:a,payInfoBusinessType:"commonDouyinPayment",platformActivities:at({douyinCommodityVirtualFlag:l||!1,douyinCommodityPrice:r,douyinOrderExtendData:d||""},A)};try{let N=await Ie.post("/gw/advert/customer/payment/pay-info",v);return N.code!=="0000000"||!(N!=null&&N.body)?Promise.reject({code:3006,message:N.message||ut[3006]}):(N.body.platformActivities=v.platformActivities,N)}catch(N){return w.error("getDyOrderAmountFn error:",N),Promise.reject({code:3007,message:ut[3007]})}}async function lr(e){var r,a,d,l;try{let h=e.commodityList.map(Ft=>(Ft.commodity=Ft.commodityId,delete Ft.commodityId,Ft.quantity=Ft.quantity||1,Ft)),A=e.advertExtendInfo&&Object.keys(e.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:e.advertExtendInfo}):"",v=oe(),N="";v==="wechat"?N="wechatMini":v==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(N="wechatHtml");let M=e.returnType==="jsapi",ct=M?22:21,tt=at(at(at({businessType:e.businessType,fixedClientType:ct,channelCode:null,douyinData:at(at({loginMobile:e.telephone||""},((r=e.jsapiInfo)==null?void 0:r.outProductCategory)!=null?{outProductCategory:e.jsapiInfo.outProductCategory}:{}),((a=e.jsapiInfo)==null?void 0:a.requestId)!=null?{requestId:e.jsapiInfo.requestId}:{}),equipmentUseFlag:!1,payEquipmentDTO:{equipmentValue:e.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:A,transType:5,actualFee:e.totalFee,totalFee:e.totalFee,commodityList:h,clientSourceDetailType:N,platformActivities:e.platformActivities||{}},e.commoditySign&&{commoditySign:e.commoditySign}),e.unifiedOrderExtendData&&at({},e.unifiedOrderExtendData)),M?{appId:((d=e.jsapiInfo)==null?void 0:d.appId)||"",openId:((l=e.jsapiInfo)==null?void 0:l.douyinOpenId)||""}:{});if(e.returnType=="ulink")return delete tt.channelCode,tt;let X=await Ie.post("/gw/payment-bff/unified/order",tt);return X.code!=="0000000"||!(X!=null&&X.body)?Promise.reject({code:3008,message:X.message||ut[3008]}):X}catch(h){return w.error("dyUnifiedOrderFn error:",h),Promise.reject({code:3009,message:ut[3009]})}}async function fr(e){let r={equipmentValue:e.equipmentValue,phone:e.telephone||""};e.price&&(r.orderAmount=e.price);try{let a=await Ie.post("/gw/advert/customer/douyin/pay/check",r);return a.code!=="0000000"||!(a!=null&&a.body)?Promise.reject({code:3013,message:a.message||ut[3013]}):a}catch(a){return w.error("getDyPayRtaData error:",a),Promise.reject({code:3014,message:(a==null?void 0:a.message)||ut[3014]})}}async function dr(e={}){var r;try{let a=(r=e.requestNo)==null?void 0:r.trim(),d=a?`/gw/advert/customer/douyin/pay/jsapi/info?requestNo=${a}`:"/gw/advert/customer/douyin/pay/jsapi/info",l=await Ie.get(d);return l.code!=="0000000"||!(l!=null&&l.body)?Promise.reject({code:3019,message:l.message||ut[3019]}):{appId:l.body.appId,douyinOpenId:l.body.douyinOpenId,outProductCategory:l.body.outProductCategory,requestId:l.body.requestId}}catch(a){return w.error("getDyPayJsapiInfoFn error:",a),Promise.reject({code:(a==null?void 0:a.code)||3020,message:(a==null?void 0:a.message)||ut[3020]})}}async function hn(e){try{let r=await Ie.post("/gw/advert/customer/douyin/pay/jsapi/signature",e);return r.code!=="0000000"||!(r!=null&&r.body)||!r.body.signature||!r.body.timestamp||!r.body.nonceStr?Promise.reject({code:3023,message:r.message||ut[3023]}):{signature:r.body.signature,timestamp:r.body.timestamp,nonceStr:r.body.nonceStr}}catch(r){return w.error("getDyPayJsapiSignatureFn error:",r),Promise.reject({code:(r==null?void 0:r.code)||3024,message:(r==null?void 0:r.message)||ut[3024]})}}async function _r(e){try{let r=await Ie.post("/gw/advert/customer/douyin/pay-command",e);return r.code!=="0000000"||!(r!=null&&r.body)?Promise.reject({code:3032,message:r.message||ut[3032]}):r}catch(r){return w.error("getDyPayCommandFn error:",r),Promise.reject({code:(r==null?void 0:r.code)||3033,message:(r==null?void 0:r.message)||ut[3033]})}}async function yr(e){try{let r=await Ie.post("/gw/advert/customer/automatic-debit/sign/request-id",{requestId:e});return r.code!=="0000000"||!(r!=null&&r.body)?Promise.reject({code:3037,message:r.message||ut[3037]}):r.body}catch(r){return w.error("dyAutomaticDebitSignByRequestIdFn error:",r),Promise.reject({code:(r==null?void 0:r.code)||3038,message:(r==null?void 0:r.message)||ut[3038]})}}var yo="/auth/rest/auth/third",gr="url_token",po="https://unpkg.byted-static.com/bridge/douyin_open/1.0.17/lib/douyin_open.umd.js",Ye=null,ho="-2",mo="1",go="0";function Jt(e,r){let a=new Error(r||ut[e]);return Object.assign(a,{code:e})}function Ar(e){var a;let r=(a=e==null?void 0:e.data)==null?void 0:a.code;return r!=null?String(r):typeof(e==null?void 0:e.code)=="string"?e.code:""}function pr(e){return String(e==null?void 0:e.code)===ho}function hr(e){return Ar(e)===mo}function mr(e){var r,a;return((r=e==null?void 0:e.data)==null?void 0:r.msg)||((a=e==null?void 0:e.data)==null?void 0:a.message)||(e==null?void 0:e.message)||(e==null?void 0:e.errMsg)}function xe(){return typeof window!="undefined"&&typeof document!="undefined"}function mn(){return xe()?window.location.href:""}function Ue(e){let r=e.href||mn();if(!e.key||!r)return"";try{let a=new URL(r,Pr()),d=a.searchParams.get(e.key);return d!=null?d:Ao(a.hash,e.key)}catch(a){return w.warn("getDyUrlParam parse error:",a),""}}function Ao(e,r){if(!e||!r)return"";let a=e.indexOf("?");if(a<0)return"";let d=e.slice(a+1).split("#")[0];return new URLSearchParams(d).get(r)||""}function Dr(e){let{href:r,paramName:a}=e;if(!r||!a)return r;let d=r.indexOf("#"),l=d>=0?r.slice(0,d):r,h=d>=0?r.slice(d):"";try{let A=new URL(l,Pr()),v=Io(l);return A.searchParams.delete(a),`${v?`${A.pathname}${A.search}`:A.toString()}${Ir(h,a)}`}catch(A){return w.warn("removeDyUrlParam parse error:",A),Eo(r,a)}}function Ir(e,r){if(!e||!r)return e;let a=e.indexOf("?");if(a<0)return e;let d=e.slice(0,a),l=e.slice(a+1),h=l.indexOf("#"),A=h>=0?l.slice(0,h):l,v=h>=0?l.slice(h):"",N=new URLSearchParams(A);N.delete(r);let M=N.toString();return`${d}${M?`?${M}`:""}${v}`}function gn(e={}){let a=(e.href||mn()).split("#")[0]||"";return Dr({href:a,paramName:e.tokenParamName||gr})}function Do(e){var l,h;let r=e.tokenParamName||gr,a=Dr({href:e.redirectUrl||mn(),paramName:r});if(!a)throw Jt(3025);let d=new URLSearchParams({useAgent:e.useAgent||"douyin",category:e.category||"pay",internal:String((l=e.internal)!=null?l:!1),silent:String((h=e.silent)!=null?h:!1),redirectUrl:a});return e.equipmentValue&&d.set("equipmentValue",e.equipmentValue),`${e.authPath||yo}?${d.toString()}`}function An(e){if(!xe())throw Jt(3025);let r=Do(e);w.info("\u8DF3\u8F6C\u6296\u97F3\u6388\u6743:",{authUrl:r,equipmentValue:e.equipmentValue});try{return window.location.href=r,r}catch(a){throw w.error("redirectDyAuth error:",a),Jt(3026)}}function Qe(){if(!xe())return null;let e=window;return e.DouyinOpenJSBridge||e.douyin_open||null}function Dn(e={}){if(!xe())return Promise.reject(Jt(3025));let r=Qe();if(r)return w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5DF2\u52A0\u8F7D"),Promise.resolve(r);if(Ye)return w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u590D\u7528\u52A0\u8F7D\u4E2D\u4EFB\u52A1"),Ye;let a=e.sdkUrl||po;return w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5F00\u59CB\u52A0\u8F7D",{sdkUrl:a}),Ye=new Promise((d,l)=>{let h=Po(a),A=()=>{let M=Qe();if(!M){l(Jt(3027));return}w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u6210\u529F"),d(M)},v=M=>{w.error("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u5931\u8D25",M),l(Jt(3027))};if(h){if(w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u811A\u672C\u5DF2\u5B58\u5728"),vo(h)){window.setTimeout(A,0);return}h.addEventListener("load",A,{once:!0}),h.addEventListener("error",v,{once:!0});return}let N=document.createElement("script");N.src=a,N.async=!0,N.addEventListener("load",A,{once:!0}),N.addEventListener("error",M=>{N.remove(),v(M)},{once:!0}),document.head.appendChild(N)}).catch(d=>{throw Ye=null,d}),Ye}function In(e){let r=e.sdk||Qe();if(!r)return Promise.reject(Jt(3027));let{appId:a,signatureData:d,url:l}=e;return!a||!l||!(d!=null&&d.signature)||!(d!=null&&d.timestamp)||!(d!=null&&d.nonceStr)?Promise.reject(Jt(3028)):new Promise((h,A)=>{w.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u5F00\u59CB\u914D\u7F6E",{appId:a,url:l});try{r.config({params:{client_key:a,signature:d.signature,timestamp:String(d.timestamp),nonce_str:d.nonceStr,url:l}}),r.ready(()=>{w.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5B8C\u6210"),h(r)}),r.error(v=>{w.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5931\u8D25",v),A(Jt(3028))})}catch(v){w.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5F02\u5E38",v),A(Jt(3028))}})}function Pn(e){let r=e.sdk||Qe();if(!r)return Promise.reject(Jt(3027));if(!r.ttcjpay||typeof r.ttcjpay.dypay!="function")return Promise.reject(Jt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));let{appId:a,payInfo:d}=e;if(!a||!d)return Promise.reject(Jt(3021));let l={appId:a,timeStamp:String(d.timeStamp),nonceStr:d.nonceStr,package:d.package,signType:d.signType,paySign:d.paySign};return new Promise((h,A)=>{w.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528 dypay");try{r.ttcjpay.dypay({sdk_info:JSON.stringify(l),success:v=>{if(w.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u6210\u529F\u56DE\u8C03",v),pr(v)){A(Jt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(hr(v)){A(Jt(3039));return}let N=Ar(v);if(N&&N!==go){A(Jt(3029,mr(v)));return}h(v)},fail:v=>{if(w.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u5931\u8D25\u56DE\u8C03",v),pr(v)){A(Jt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(hr(v)){A(Jt(3039));return}A(Jt(3029,mr(v)))}})}catch(v){w.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528\u5F02\u5E38",v),A(Jt(3029,v==null?void 0:v.message))}})}function Pr(){return xe()?window.location.origin:"https://bi-nova.local"}function Io(e){return!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)&&!e.startsWith("//")}function Po(e){return Array.from(document.getElementsByTagName("script")).find(a=>a.src===e)||null}function vo(e){let r=e.readyState;return r==="loaded"||r==="complete"}function Eo(e,r){let a=e.indexOf("#"),d=a>=0?e.slice(0,a):e,l=a>=0?e.slice(a):"",h=d.indexOf("?");if(h<0)return e;let A=d.slice(0,h),N=d.slice(h+1).split("&").filter(M=>M&&decodeURIComponent(M.split("=")[0])!==r).join("&");return`${A}${N?`?${N}`:""}${Ir(l,r)}`}async function We(e){var a,d,l,h;let r=rr(e);if(!r.valid)return J(r.errorCode,ut[r.errorCode]);try{let A=e.returnType||"h5",v=await cr({price:e.price,equipmentValue:e.equipmentValue,businessType:e.businessType,douyinOrderExtendData:(e==null?void 0:e.douyinOrderExtendData)||"",platformActivities:(e==null?void 0:e.platformActivities)||{},douyinCommodityVirtualFlag:(e==null?void 0:e.douyinCommodityVirtualFlag)||!1}),N=A==="jsapi"?await dr({requestNo:Ue({key:"requestNo"})}):void 0,M=await lr(zt(at(zt(at({},v.body),{telephone:e.telephone,equipmentValue:e.equipmentValue,businessType:e.businessType}),e.unifiedOrderExtendData&&{unifiedOrderExtendData:e.unifiedOrderExtendData}),{returnType:A,jsapiInfo:N}));if(e.returnType==="ulink")return J(0,"success",{ulinkQueryParams:M});let ct=((a=M==null?void 0:M.body)==null?void 0:a.h5Url)||"",tt=((d=M==null?void 0:M.body)==null?void 0:d.outTradeNo)||"";if(A==="jsapi"){let Ft=Er((l=M==null?void 0:M.body)==null?void 0:l.payInfo);return J(0,"success",{appId:(N==null?void 0:N.appId)||"",payInfo:Ft,outTradeNo:tt})}let X=ct?await So(zt(at({},e),{dyUrl:ct})):"";return X?J(0,"success",{h5Url:X,outTradeNo:tt}):J(3010,ut[3010])}catch(A){w.error("handleDyPayFlow error:",A);let v=(h=A==null?void 0:A.code)!=null?h:3012,N=(A==null?void 0:A.message)||ut[3012];return J(v,N)}}function Er(e){if(!e)throw{code:3021,message:ut[3021]};if(typeof e=="object"){if(vr(e))return e;throw{code:3022,message:ut[3022]}}try{let r=JSON.parse(e);if(!vr(r))throw new Error("invalid payInfo fields");return r}catch(r){throw{code:3022,message:ut[3022],error:r}}}function vr(e){return typeof e.timeStamp=="string"&&e.timeStamp!==""&&typeof e.nonceStr=="string"&&e.nonceStr!==""&&typeof e.package=="string"&&e.package!==""&&typeof e.signType=="string"&&e.signType!==""&&typeof e.paySign=="string"&&e.paySign!==""}async function So(e){let r=fe(),a=Ge(r.env||"prod",""),d=typeof r.getAuthToken=="function"?await r.getAuthToken():"",l=e.client||"weapp";return`${a}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${l}&equipmentId=${e.equipmentValue}&dyUrl=${e.dyUrl}&fromUrl=${encodeURIComponent(e.fromUrl||"")}&backUrl=${encodeURIComponent(e.backUrl||"")}&backWay=${e.backWay||""}&url_token=${d}`}async function $e(e){var a;let r=ir(e);if(!r.valid)return J(r.errorCode,ut[r.errorCode]);try{let d=await fr({price:(e==null?void 0:e.price)||"",equipmentValue:e.equipmentValue,telephone:(e==null?void 0:e.telephone)||""});return J(0,"success",d.body)}catch(d){w.error("getDyPayRtaData error:",d);let l=(a=d==null?void 0:d.code)!=null?a:3015,h=(d==null?void 0:d.message)||ut[3015];return J(l,h)}}async function Sr(e){var a,d;let r=ar(e);if(!r.valid)return J(r.errorCode,ut[r.errorCode]);try{let l=(a=e.commandUrl)==null?void 0:a.trim(),A=(await _r(at({phone:e.telephone||"",equipmentValue:e.equipmentValue,orderAmount:e.orderAmount,businessType:e.businessType},l?{commandUrl:l}:{}))).body||"";return A?J(0,"success",{command:A}):J(3032,ut[3032])}catch(l){w.error("getDyPayCommand error:",l);let h=(d=l==null?void 0:l.code)!=null?d:3033,A=(l==null?void 0:l.message)||ut[3033];return J(h,A)}}async function Ro(e){var a;let r=await Sr(e);if(r.code!==0||!((a=r.data)!=null&&a.command))return J(r.code,r.message);try{return await Ce(r.data.command),J(0,"success",at({type:"copy_success"},e.returnCommand?{command:r.data.command}:{}))}catch(d){return w.error("copyDyPayCommand error:",d),J(3034,ut[3034])}}async function vn(e){var a,d,l;let r=sr(e);if(!r.valid)return J(r.errorCode,ut[r.errorCode]);try{let h=await $e({telephone:e.telephone||"",equipmentValue:e.equipmentValue,price:e.price});if(h.code!==0)return J(h.code,h.message);let A=h.data;if(!(A!=null&&A.showFlag))return J(0,"success",{eligible:!1,type:"not_eligible"});if(!ur(A))return J(3035,ut[3035]);let v={telephone:e.telephone||"",equipmentValue:e.equipmentValue,orderAmount:A.payAmount,businessType:A.businessType,commandUrl:e.commandUrl};if(e.autoCopy){let M=await Ro(zt(at({},v),{returnCommand:e.returnCommand}));return M.code!==0?J(M.code,M.message):J(0,"success",at({eligible:!0,type:"copy_success"},(a=M.data)!=null&&a.command?{command:M.data.command}:{}))}let N=await Sr(v);return N.code!==0||!((d=N.data)!=null&&d.command)?J(N.code,N.message):J(0,"success",{eligible:!0,type:"command",command:N.data.command})}catch(h){w.error("handleDyPayCommandFlow error:",h);let A=(l=h==null?void 0:h.code)!=null?l:3033,v=(h==null?void 0:h.message)||ut[3033];return J(A,v)}}async function En(e){var a,d,l;let r=or(e);if(!r.valid)return J(r.errorCode,ut[r.errorCode]);try{let h=fe(),A=e.authToken||(typeof h.getAuthToken=="function"?await h.getAuthToken():""),v=e.autoAuth!==!1;if(!A){if(!v)return J(3030,ut[3030]);let Ft=An({equipmentValue:e.equipmentValue,redirectUrl:e.redirectUrl,tokenParamName:e.tokenParamName});return J(0,"redirecting",{type:"auth_redirect",authUrl:Ft})}let N=await Dn({sdkUrl:e.sdkUrl}),M=await We(zt(at({},e),{client:"h5",returnType:"jsapi"}));if(M.code!==0||!((a=M.data)!=null&&a.appId)||!((d=M.data)!=null&&d.payInfo))return J(M.code||3021,M.message||ut[3021]);let ct=e.signatureUrl||gn({tokenParamName:e.tokenParamName}),tt=await hn({url:ct});await In({appId:M.data.appId,signatureData:tt,url:ct,sdk:N});let X=await Pn({appId:M.data.appId,payInfo:M.data.payInfo,sdk:N});return J(0,"success",{type:"pay_result",outTradeNo:M.data.outTradeNo,payResult:X})}catch(h){w.error("handleDyJsapiPayFlow error:",h);let A=(l=h==null?void 0:h.code)!=null?l:3029,v=(h==null?void 0:h.message)||ut[3029];return J(A,v)}}async function Sn(){var l;let e="url_token",r=fe(),d=(typeof r.getAuthToken=="function"?await r.getAuthToken():"")||Ue({key:e});try{if(!d){let Ft=Ue({key:"equipmentValue"}),E=An(at({tokenParamName:e},Ft?{equipmentValue:Ft}:{}));return J(0,"redirecting",{type:"auth_redirect",authUrl:E})}let h=Ue({key:"requestId"}).trim();if(!h)return J(3036,ut[3036]);let A=await Dn(),v=await yr(h),N=v.appId||v.appid||"",M=Er(v.payInfo);if(!N)return J(3021,ut[3021]);let ct=gn({tokenParamName:e}),tt=await hn(at({url:ct},N?{appid:N}:{}));await In({appId:N,signatureData:tt,url:ct,sdk:A});let X=await Pn({appId:N,payInfo:M,sdk:A});return J(0,"success",{type:"sign_result",orderNo:v.orderNo,payResult:X})}catch(h){w.error("handleDyAuthDebitSignFlow error:",h);let A=(l=h==null?void 0:h.code)!=null?l:3029,v=(h==null?void 0:h.message)||ut[3029];return J(A,v)}}var Nn={};je(Nn,{getDisplayAdConfig:()=>bn,normalizeDisplayAdData:()=>ze});var To=we();function Rr(e){let r=Oe(e,["placementId"]);if(!r.valid)return Promise.reject({code:"PARAM_ERROR",message:r.message});let a=fe().env||"prod";return To.get(`/gw/advert-plugin/api/v1/config/list/valid/${e.placementId}`,{},{authRequired:!1,baseDomain:kn(a)})}var Tr=30*1e3,wo="__",wn=new Map,Tn=new Map;function bo(e,r){return[e.appId||"",r,e.type||""].join(wo)}function No(e){let r=wn.get(e);return r?r.expireAt<=Date.now()?(wn.delete(e),w.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:e}),null):r.data:null}function Co(e,r){wn.set(e,{data:r,expireAt:Date.now()+Tr})}function Oo(e){return Array.isArray(e==null?void 0:e.body)?e.body:[]}function Fo(e){return String(e==null?void 0:e.code)!=="200"}function Lo(e,r){let a=String(e||r||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(a)?a:r||"banner"}function wr(e){return String(e||"").trim().toLowerCase()}function Yo(e){var r;return!!e&&e.status!==0&&((r=e.platformConfig)==null?void 0:r.valid)!==!1}function xo(e){return[...e].sort((r,a)=>{var h,A,v,N;let d=Number((h=r.priority)!=null?h:9999),l=Number((A=a.priority)!=null?A:9999);return d!==l?d-l:Number((v=a.weight)!=null?v:0)-Number((N=r.weight)!=null?N:0)})}function br(e){return e.find(r=>wr(r.advertPlatform)==="gdt")||null}function Nr(e){return e.find(r=>wr(r.advertPlatform)!=="gdt")||null}function Uo(e,r){return e&&r?"mixed":e?"wechat":r?"custom":"none"}function Mo(e,r){var l,h;let a=br(e),d=Nr(e);return a&&d?Number((l=a.priority)!=null?l:9999)<=Number((h=d.priority)!=null?h:9999)?"wechat-first":"custom-first":r==="custom"?"custom-only":r==="wechat"?"wechat-only":"wechat-first"}function Jo(e){var a;let r=br(e);return((a=r==null?void 0:r.platformConfig)==null?void 0:a.adId)||""}function ko(e){let r=Nr(e),a=r==null?void 0:r.platformConfig;if(!a)return null;let d=a.image||a.imageUrl||"",l=a.video||a.videoUrl||"",h=a.poster||d||"",A=a.jumpUrl||a.url||a.webUrl||"";return!d&&!l?null:{image:d||void 0,video:l||void 0,poster:h||void 0,title:a.title,description:a.description,buttonText:a.buttonText,badgeText:a.badgeText,jumpSeconds:a.jumpSeconds,loadTimeout:a.loadTimeout||a.timeout,muted:a.muted,adSpec:a.adSpec,url:A||void 0,action:A?{type:"web",url:A}:void 0}}function ze(e,r){let a=xo(e.filter(Yo)),d=ko(a),l=Jo(a),h=Lo(void 0,r),A=Uo(l,d),v=Mo(a,A);return{show:!!(l||d),adId:"",type:h,provider:A,priority:v,unitId:l,customAd:d,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:e}}async function bn(e){let r=e.placementId||e.adId||"",a=bo(e,r),d=No(a);if(d)return w.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:a,placementId:r}),J(xt.SUCCESS,"\u6210\u529F",d);let l=Tn.get(a);if(l)return w.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:a,placementId:r}),l;let h=(async()=>{try{w.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",e);let A=await Rr({placementId:r}),v=Oo(A);if(w.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:a,placementId:r,response:A,body:v}),Fo(A)||!v)return w.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",A),J(xt.UNKNOWN_ERROR,(A==null?void 0:A.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let N=ze(v,e.type);return N.adId=r,N.cache=zt(at({},N.cache),{enable:!0,ttl:Tr}),Co(a,N),w.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:a,placementId:r,provider:N.provider,priority:N.priority,hasUnitId:!!N.unitId,hasCustomAd:!!N.customAd}),J(xt.SUCCESS,"\u6210\u529F",N)}catch(A){return w.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:a,placementId:r,error:A}),J(xt.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{Tn.delete(a)}})();return Tn.set(a,h),h}function qo(e={}){w.info("\u670D\u52A1\u521D\u59CB\u5316",e);let r=at(at({},Te),e);r.env&&!He[r.env]&&(w.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${r.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),r.env=Wt.PROD),r.externalEnv&&!Ne[r.externalEnv]&&(w.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${r.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),r.externalEnv=le.PROD),r.debug!==void 0&&w.setEnable(r.debug),Bn(r),w.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",r)}function Cr(e={}){let r="",a=null;async function d(){if(typeof e.getAuthToken=="function"){let h=await e.getAuthToken();if(h)return h}return a&&typeof a.getStorage=="function"&&a.getStorage("auth_token")||""}let l={name:"services",setToken(h){return r=h||"",a&&typeof a.setStorage=="function"&&a.setStorage("auth_token",r),l},async getAuthToken(){return r||d()},clearToken(){return r="",a&&typeof a.setStorage=="function"&&a.setStorage("auth_token",""),l},install(h){a=h;let A=zt(at({},e),{getAuthToken:()=>l.getAuthToken()});qo(A),w.info("services installed via nova.use()"),Object.assign(h,{jd:at({},pn),dy:at({},Rn),ads:at({},Nn),setToken:l.setToken,clearToken:l.clearToken})}};return l}0&&(module.exports={DyErrorCode,DyErrorMessage,ENV_TYPE,EXTERNAL_ENV_TYPE,JdErrorCode,JdErrorMessage,createServices,getDisplayAdConfig,getDyPayRtaData,handleDyAuthDebitSignFlow,handleDyJsapiPayFlow,handleDyPayCommandFlow,handleDyPayFlow,handleJdInsurance,handleJdInsuranceExt,handleJdjrCashLoanExt,handleJdjrCashLoanFlow,normalizeDisplayAdData});
|
|
5
5
|
/*! For license information please see LyyGetCommandSDK.min.js.LICENSE.txt */
|