@bi-nova/services 1.3.4-beta.202606101813 → 1.3.4-beta.202606111102
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.js +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";var je=Object.defineProperty,Lr=Object.defineProperties,xr=Object.getOwnPropertyDescriptor,Yr=Object.getOwnPropertyDescriptors,Ur=Object.getOwnPropertyNames,wn=Object.getOwnPropertySymbols;var bn=Object.prototype.hasOwnProperty,Mr=Object.prototype.propertyIsEnumerable;var rn=(e,o,s)=>o in e?je(e,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[o]=s,ut=(e,o)=>{for(var s in o||(o={}))bn.call(o,s)&&rn(e,s,o[s]);if(wn)for(var s of wn(o))Mr.call(o,s)&&rn(e,s,o[s]);return e},Wt=(e,o)=>Lr(e,Yr(o));var Jr=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),qe=(e,o)=>{for(var s in o)je(e,s,{get:o[s],enumerable:!0})},kr=(e,o,s,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let y of Ur(o))!bn.call(e,y)&&y!==s&&je(e,y,{get:()=>o[y],enumerable:!(p=xr(o,y))||p.enumerable});return e};var jr=e=>kr(je({},"__esModule",{value:!0}),e);var Be=(e,o,s)=>rn(e,typeof o!="symbol"?o+"":o,s);var Hn=Jr((si,Vn)=>{"use strict";(()=>{var e={737:(y,g,A)=>{"use strict";A.r(g),A.d(g,{default:()=>C,getJrCommand:()=>R});var E=A(307),U=A.n(E);function M(){M=function(){return K};var D,K={},It=Object.prototype,ft=It.hasOwnProperty,Pt=Object.defineProperty||function(d,l,m){d[l]=m.value},dt=typeof Symbol=="function"?Symbol:{},At=dt.iterator||"@@iterator",Et=dt.asyncIterator||"@@asyncIterator",St=dt.toStringTag||"@@toStringTag";function ht(d,l,m){return Object.defineProperty(d,l,{value:m,enumerable:!0,configurable:!0,writable:!0}),d[l]}try{ht({},"")}catch(d){ht=function(l,m,Y){return l[m]=Y}}function Gt(d,l,m,Y){var I=l&&l.prototype instanceof se?l:se,q=Object.create(I.prototype),ot=new de(Y||[]);return Pt(q,"_invoke",{value:Ft(d,m,ot)}),q}function L(d,l,m){try{return{type:"normal",arg:d.call(l,m)}}catch(Y){return{type:"throw",arg:Y}}}K.wrap=Gt;var Vt="suspendedStart",Zt="suspendedYield",Kt="executing",Nt="completed",Ct={};function se(){}function ie(){}function kt(){}var ue={};ht(ue,At,(function(){return this}));var ae=Object.getPrototypeOf,Ut=ae&&ae(ae(re([])));Ut&&Ut!==It&&ft.call(Ut,At)&&(ue=Ut);var Ht=kt.prototype=se.prototype=Object.create(ue);function me(d){["next","throw","return"].forEach((function(l){ht(d,l,(function(m){return this._invoke(l,m)}))}))}function te(d,l){function m(I,q,ot,vt){var mt=L(d[I],d,q);if(mt.type!=="throw"){var Xt=mt.arg,ee=Xt.value;return ee&&tt(ee)=="object"&&ft.call(ee,"__await")?l.resolve(ee.__await).then((function(Rt){m("next",Rt,ot,vt)}),(function(Rt){m("throw",Rt,ot,vt)})):l.resolve(ee).then((function(Rt){Xt.value=Rt,ot(Xt)}),(function(Rt){return m("throw",Rt,ot,vt)}))}vt(mt.arg)}var Y;Pt(this,"_invoke",{value:function(I,q){function ot(){return new l((function(vt,mt){m(I,q,vt,mt)}))}return Y=Y?Y.then(ot,ot):ot()}})}function Ft(d,l,m){var Y=Vt;return function(I,q){if(Y===Kt)throw Error("Generator is already running");if(Y===Nt){if(I==="throw")throw q;return{value:D,done:!0}}for(m.method=I,m.arg=q;;){var ot=m.delegate;if(ot){var vt=Mt(ot,m);if(vt){if(vt===Ct)continue;return vt}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(Y===Vt)throw Y=Nt,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);Y=Kt;var mt=L(d,l,m);if(mt.type==="normal"){if(Y=m.done?Nt:Zt,mt.arg===Ct)continue;return{value:mt.arg,done:m.done}}mt.type==="throw"&&(Y=Nt,m.method="throw",m.arg=mt.arg)}}}function Mt(d,l){var m=l.method,Y=d.iterator[m];if(Y===D)return l.delegate=null,m==="throw"&&d.iterator.return&&(l.method="return",l.arg=D,Mt(d,l),l.method==="throw")||m!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+m+"' method")),Ct;var I=L(Y,d.iterator,l.arg);if(I.type==="throw")return l.method="throw",l.arg=I.arg,l.delegate=null,Ct;var q=I.arg;return q?q.done?(l[d.resultName]=q.value,l.next=d.nextLoc,l.method!=="return"&&(l.method="next",l.arg=D),l.delegate=null,Ct):q:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,Ct)}function ne(d){var l={tryLoc:d[0]};1 in d&&(l.catchLoc=d[1]),2 in d&&(l.finallyLoc=d[2],l.afterLoc=d[3]),this.tryEntries.push(l)}function fe(d){var l=d.completion||{};l.type="normal",delete l.arg,d.completion=l}function de(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(ne,this),this.reset(!0)}function re(d){if(d||d===""){var l=d[At];if(l)return l.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var m=-1,Y=function I(){for(;++m<d.length;)if(ft.call(d,m))return I.value=d[m],I.done=!1,I;return I.value=D,I.done=!0,I};return Y.next=Y}}throw new TypeError(tt(d)+" is not iterable")}return ie.prototype=kt,Pt(Ht,"constructor",{value:kt,configurable:!0}),Pt(kt,"constructor",{value:ie,configurable:!0}),ie.displayName=ht(kt,St,"GeneratorFunction"),K.isGeneratorFunction=function(d){var l=typeof d=="function"&&d.constructor;return!!l&&(l===ie||(l.displayName||l.name)==="GeneratorFunction")},K.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,kt):(d.__proto__=kt,ht(d,St,"GeneratorFunction")),d.prototype=Object.create(Ht),d},K.awrap=function(d){return{__await:d}},me(te.prototype),ht(te.prototype,Et,(function(){return this})),K.AsyncIterator=te,K.async=function(d,l,m,Y,I){I===void 0&&(I=Promise);var q=new te(Gt(d,l,m,Y),I);return K.isGeneratorFunction(l)?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(d){var l=Object(d),m=[];for(var Y in l)m.push(Y);return m.reverse(),function I(){for(;m.length;){var q=m.pop();if(q in l)return I.value=q,I.done=!1,I}return I.done=!0,I}},K.values=re,de.prototype={constructor:de,reset:function(d){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(fe),!d)for(var l in this)l.charAt(0)==="t"&&ft.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=D)},stop:function(){this.done=!0;var d=this.tryEntries[0].completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(d){if(this.done)throw d;var l=this;function m(mt,Xt){return q.type="throw",q.arg=d,l.next=mt,Xt&&(l.method="next",l.arg=D),!!Xt}for(var Y=this.tryEntries.length-1;Y>=0;--Y){var I=this.tryEntries[Y],q=I.completion;if(I.tryLoc==="root")return m("end");if(I.tryLoc<=this.prev){var ot=ft.call(I,"catchLoc"),vt=ft.call(I,"finallyLoc");if(ot&&vt){if(this.prev<I.catchLoc)return m(I.catchLoc,!0);if(this.prev<I.finallyLoc)return m(I.finallyLoc)}else if(ot){if(this.prev<I.catchLoc)return m(I.catchLoc,!0)}else{if(!vt)throw Error("try statement without catch or finally");if(this.prev<I.finallyLoc)return m(I.finallyLoc)}}}},abrupt:function(d,l){for(var m=this.tryEntries.length-1;m>=0;--m){var Y=this.tryEntries[m];if(Y.tryLoc<=this.prev&&ft.call(Y,"finallyLoc")&&this.prev<Y.finallyLoc){var I=Y;break}}I&&(d==="break"||d==="continue")&&I.tryLoc<=l&&l<=I.finallyLoc&&(I=null);var q=I?I.completion:{};return q.type=d,q.arg=l,I?(this.method="next",this.next=I.finallyLoc,Ct):this.complete(q)},complete:function(d,l){if(d.type==="throw")throw d.arg;return d.type==="break"||d.type==="continue"?this.next=d.arg:d.type==="return"?(this.rval=this.arg=d.arg,this.method="return",this.next="end"):d.type==="normal"&&l&&(this.next=l),Ct},finish:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.finallyLoc===d)return this.complete(m.completion,m.afterLoc),fe(m),Ct}},catch:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.tryLoc===d){var Y=m.completion;if(Y.type==="throw"){var I=Y.arg;fe(m)}return I}}throw Error("illegal catch attempt")},delegateYield:function(d,l,m){return this.delegate={iterator:re(d),resultName:l,nextLoc:m},this.method==="next"&&(this.arg=D),Ct}},K}function it(D,K,It,ft,Pt,dt,At){try{var Et=D[dt](At),St=Et.value}catch(ht){return void It(ht)}Et.done?K(St):Promise.resolve(St).then(ft,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 z="https://ms.jr.jd.com";function zt(D){var K=D.host,It=D.type,ft=It===void 0?"post":It,Pt=D.data,dt=D.path,At=dt===void 0?"":dt,Et=D.config,St=Et===void 0?{}:Et,ht=(St.withCredentials,St.isWG),Gt=ht===void 0||ht,L=St.contentType,Vt=L===void 0?"application/x-www-form-urlencoded":L;return new Promise((function(Zt,Kt){wx.request({url:(K||z)+At,method:ft.toUpperCase(),data:Gt?P({reqData:JSON.stringify(Pt)}):Pt,header:{"content-type":Vt},success:function(Nt){Nt.statusCode===200?Zt(Nt.data):Kt({statusCode:Nt.statusCode,errMsg:Nt.errMsg,data:Nt.data})},fail:function(Nt){Kt(Nt)}})}))}function P(D){var K="";return tt(D)==="object"&&D!==null&&(Object.keys(D).map((function(It){var ft=D[It];return K+=It+"="+encodeURIComponent(ft)+"&",""})),K.length>0&&(K=K.substr(0,K.length-1))),K}function et(D){return _t.apply(this,arguments)}function _t(){var D;return D=M().mark((function K(It){var ft,Pt,dt,At,Et,St,ht,Gt,L,Vt;return M().wrap((function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return ft=It.url,Pt=It.channel,dt=It.callback,U().init(),At=new(U()),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="",L={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:ft,channel:Pt,clientCode:"0",antiRushInfo:St}},Zt.next=12,zt({host:"https://ms.jr.jd.com",type:"post",path:ht,config:{withCredentials:!0},data:L});case 12:(Vt=Zt.sent).resultCode===0&&Vt.resultData&&Vt.resultData.code==="00000"&&Vt.resultData.data&&(Gt=Vt.resultData.data.goldenKeyText),dt&&dt(Gt?{code:"0",msg:"command success",data:Gt}:{code:"-1",msg:"command empty"});case 15:case"end":return Zt.stop()}}),K)})),_t=function(){var K=this,It=arguments;return new Promise((function(ft,Pt){var dt=D.apply(K,It);function At(St){it(dt,ft,Pt,At,Et,"next",St)}function Et(St){it(dt,ft,Pt,At,Et,"throw",St)}At(void 0)}))},_t.apply(this,arguments)}function at(D){return at=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},at(D)}function H(){H=function(){return K};var D,K={},It=Object.prototype,ft=It.hasOwnProperty,Pt=Object.defineProperty||function(d,l,m){d[l]=m.value},dt=typeof Symbol=="function"?Symbol:{},At=dt.iterator||"@@iterator",Et=dt.asyncIterator||"@@asyncIterator",St=dt.toStringTag||"@@toStringTag";function ht(d,l,m){return Object.defineProperty(d,l,{value:m,enumerable:!0,configurable:!0,writable:!0}),d[l]}try{ht({},"")}catch(d){ht=function(l,m,Y){return l[m]=Y}}function Gt(d,l,m,Y){var I=l&&l.prototype instanceof se?l:se,q=Object.create(I.prototype),ot=new de(Y||[]);return Pt(q,"_invoke",{value:Ft(d,m,ot)}),q}function L(d,l,m){try{return{type:"normal",arg:d.call(l,m)}}catch(Y){return{type:"throw",arg:Y}}}K.wrap=Gt;var Vt="suspendedStart",Zt="suspendedYield",Kt="executing",Nt="completed",Ct={};function se(){}function ie(){}function kt(){}var ue={};ht(ue,At,(function(){return this}));var ae=Object.getPrototypeOf,Ut=ae&&ae(ae(re([])));Ut&&Ut!==It&&ft.call(Ut,At)&&(ue=Ut);var Ht=kt.prototype=se.prototype=Object.create(ue);function me(d){["next","throw","return"].forEach((function(l){ht(d,l,(function(m){return this._invoke(l,m)}))}))}function te(d,l){function m(I,q,ot,vt){var mt=L(d[I],d,q);if(mt.type!=="throw"){var Xt=mt.arg,ee=Xt.value;return ee&&at(ee)=="object"&&ft.call(ee,"__await")?l.resolve(ee.__await).then((function(Rt){m("next",Rt,ot,vt)}),(function(Rt){m("throw",Rt,ot,vt)})):l.resolve(ee).then((function(Rt){Xt.value=Rt,ot(Xt)}),(function(Rt){return m("throw",Rt,ot,vt)}))}vt(mt.arg)}var Y;Pt(this,"_invoke",{value:function(I,q){function ot(){return new l((function(vt,mt){m(I,q,vt,mt)}))}return Y=Y?Y.then(ot,ot):ot()}})}function Ft(d,l,m){var Y=Vt;return function(I,q){if(Y===Kt)throw Error("Generator is already running");if(Y===Nt){if(I==="throw")throw q;return{value:D,done:!0}}for(m.method=I,m.arg=q;;){var ot=m.delegate;if(ot){var vt=Mt(ot,m);if(vt){if(vt===Ct)continue;return vt}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(Y===Vt)throw Y=Nt,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);Y=Kt;var mt=L(d,l,m);if(mt.type==="normal"){if(Y=m.done?Nt:Zt,mt.arg===Ct)continue;return{value:mt.arg,done:m.done}}mt.type==="throw"&&(Y=Nt,m.method="throw",m.arg=mt.arg)}}}function Mt(d,l){var m=l.method,Y=d.iterator[m];if(Y===D)return l.delegate=null,m==="throw"&&d.iterator.return&&(l.method="return",l.arg=D,Mt(d,l),l.method==="throw")||m!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+m+"' method")),Ct;var I=L(Y,d.iterator,l.arg);if(I.type==="throw")return l.method="throw",l.arg=I.arg,l.delegate=null,Ct;var q=I.arg;return q?q.done?(l[d.resultName]=q.value,l.next=d.nextLoc,l.method!=="return"&&(l.method="next",l.arg=D),l.delegate=null,Ct):q:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,Ct)}function ne(d){var l={tryLoc:d[0]};1 in d&&(l.catchLoc=d[1]),2 in d&&(l.finallyLoc=d[2],l.afterLoc=d[3]),this.tryEntries.push(l)}function fe(d){var l=d.completion||{};l.type="normal",delete l.arg,d.completion=l}function de(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(ne,this),this.reset(!0)}function re(d){if(d||d===""){var l=d[At];if(l)return l.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var m=-1,Y=function I(){for(;++m<d.length;)if(ft.call(d,m))return I.value=d[m],I.done=!1,I;return I.value=D,I.done=!0,I};return Y.next=Y}}throw new TypeError(at(d)+" is not iterable")}return ie.prototype=kt,Pt(Ht,"constructor",{value:kt,configurable:!0}),Pt(kt,"constructor",{value:ie,configurable:!0}),ie.displayName=ht(kt,St,"GeneratorFunction"),K.isGeneratorFunction=function(d){var l=typeof d=="function"&&d.constructor;return!!l&&(l===ie||(l.displayName||l.name)==="GeneratorFunction")},K.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,kt):(d.__proto__=kt,ht(d,St,"GeneratorFunction")),d.prototype=Object.create(Ht),d},K.awrap=function(d){return{__await:d}},me(te.prototype),ht(te.prototype,Et,(function(){return this})),K.AsyncIterator=te,K.async=function(d,l,m,Y,I){I===void 0&&(I=Promise);var q=new te(Gt(d,l,m,Y),I);return K.isGeneratorFunction(l)?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(d){var l=Object(d),m=[];for(var Y in l)m.push(Y);return m.reverse(),function I(){for(;m.length;){var q=m.pop();if(q in l)return I.value=q,I.done=!1,I}return I.done=!0,I}},K.values=re,de.prototype={constructor:de,reset:function(d){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(fe),!d)for(var l in this)l.charAt(0)==="t"&&ft.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=D)},stop:function(){this.done=!0;var d=this.tryEntries[0].completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(d){if(this.done)throw d;var l=this;function m(mt,Xt){return q.type="throw",q.arg=d,l.next=mt,Xt&&(l.method="next",l.arg=D),!!Xt}for(var Y=this.tryEntries.length-1;Y>=0;--Y){var I=this.tryEntries[Y],q=I.completion;if(I.tryLoc==="root")return m("end");if(I.tryLoc<=this.prev){var ot=ft.call(I,"catchLoc"),vt=ft.call(I,"finallyLoc");if(ot&&vt){if(this.prev<I.catchLoc)return m(I.catchLoc,!0);if(this.prev<I.finallyLoc)return m(I.finallyLoc)}else if(ot){if(this.prev<I.catchLoc)return m(I.catchLoc,!0)}else{if(!vt)throw Error("try statement without catch or finally");if(this.prev<I.finallyLoc)return m(I.finallyLoc)}}}},abrupt:function(d,l){for(var m=this.tryEntries.length-1;m>=0;--m){var Y=this.tryEntries[m];if(Y.tryLoc<=this.prev&&ft.call(Y,"finallyLoc")&&this.prev<Y.finallyLoc){var I=Y;break}}I&&(d==="break"||d==="continue")&&I.tryLoc<=l&&l<=I.finallyLoc&&(I=null);var q=I?I.completion:{};return q.type=d,q.arg=l,I?(this.method="next",this.next=I.finallyLoc,Ct):this.complete(q)},complete:function(d,l){if(d.type==="throw")throw d.arg;return d.type==="break"||d.type==="continue"?this.next=d.arg:d.type==="return"?(this.rval=this.arg=d.arg,this.method="return",this.next="end"):d.type==="normal"&&l&&(this.next=l),Ct},finish:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.finallyLoc===d)return this.complete(m.completion,m.afterLoc),fe(m),Ct}},catch:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.tryLoc===d){var Y=m.completion;if(Y.type==="throw"){var I=Y.arg;fe(m)}return I}}throw Error("illegal catch attempt")},delegateYield:function(d,l,m){return this.delegate={iterator:re(d),resultName:l,nextLoc:m},this.method==="next"&&(this.arg=D),Ct}},K}function wt(D,K,It,ft,Pt,dt,At){try{var Et=D[dt](At),St=Et.value}catch(ht){return void It(ht)}Et.done?K(St):Promise.resolve(St).then(ft,Pt)}function R(D){return b.apply(this,arguments)}function b(){var D;return D=H().mark((function K(It){var ft,Pt,dt;return H().wrap((function(At){for(;;)switch(At.prev=At.next){case 0:return ft=It.url,Pt=It.channel,dt=It.callback,At.next=3,et({url:ft,channel:Pt,callback:dt});case 3:case"end":return At.stop()}}),K)})),b=function(){var K=this,It=arguments;return new Promise((function(ft,Pt){var dt=D.apply(K,It);function At(St){wt(dt,ft,Pt,At,Et,"next",St)}function Et(St){wt(dt,ft,Pt,At,Et,"throw",St)}At(void 0)}))},b.apply(this,arguments)}var F={getJrCommand:R};(y=A.hmd(y)).exports&&(y.exports=F,y.exports.getJrCommand=R),typeof window!="undefined"&&(window.LyyGetCommandSDK=F);let C=F},307:function(y,g,A){var E,U,M;function it(tt){return it=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(z){return typeof z}:function(z){return z&&typeof Symbol=="function"&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z},it(tt)}M=function(){"use strict";function tt(t){return(tt=typeof Symbol=="function"&&it(Symbol.iterator)=="symbol"?function(r){return it(r)}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":it(r)})(t)}function z(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function zt(t,r){for(var u=0;u<r.length;u++){var c=r[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function P(t,r,u){return r&&zt(t.prototype,r),u&&zt(t,u),t}function et(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&at(t,r)}function _t(t){return(_t=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(t)}function at(t,r){return(at=Object.setPrototypeOf||function(u,c){return u.__proto__=c,u})(t,r)}function H(t){var r=(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=_t(t);return(function(h,_){if(_&&(it(_)=="object"||typeof _=="function"))return _;if(_!==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})(h)})(this,r?(u=_t(this).constructor,Reflect.construct(c,arguments,u)):c.apply(this,arguments))}}function wt(t){return(function(r){if(Array.isArray(r))return R(r)})(t)||(function(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)})(t)||(function(r,u){if(r){if(typeof r=="string")return R(r,u);var c=Object.prototype.toString.call(r).slice(8,-1);return(c=c==="Object"&&r.constructor?r.constructor.name:c)==="Map"||c==="Set"?Array.from(r):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?R(r,u):void 0}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function R(t,r){(r==null||r>t.length)&&(r=t.length);for(var u=0,c=new Array(r);u<r;u++)c[u]=t[u];return c}var b=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:A.g!==void 0?A.g:typeof self!="undefined"?self:{},F=!1,C=!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()&&(C=!0)},It=function(){var t=Date.now();Date.now()-t>D.time_threshold&&(C=!0)},ft=function(){var t=b.outerWidth,r=b.outerHeight,u=b.innerWidth,c=b.innerHeight;t&&r&&u&&c&&typeof t=="number"&&typeof r=="number"&&typeof u=="number"&&typeof c=="number"&&(t-u>D.length_threshold||r-c>D.length_threshold)&&(C=!0)};(Ft={}).start=function(t){if(!F){if(t&&tt(t)==="object")for(var r in t)D[r]=t[r];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);')():C=!0:setInterval((function(){}),100)),D.console&&(function(){var c=new Date;c.toString=function(){for(var h=Date.now();;)if(10<Date.now()-h)return Date.now()},console.log(c),c.toString=function(){return C=!0,Date.now()}})(),D.focus&&K(),D.time&&It(),D.length&&ft(),u=setInterval((function(){u&&C&&clearInterval(u),D.focus&&K(),D.time&&It(),D.length&&ft()}),D.time_interval),F=!0}},Ft.isDebug=function(){return C};var Pt=Ft,dt=".123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-!",At={my_b4_encode:function(t){var r=0,u=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<u;r++)t[t.length]=0;var c="";for(j=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
|
|
3
3
|
`),c+=dt[t[j]>>2]+dt[(3&t[j])<<4|t[j+1]>>4]+dt[(15&t[j+1])<<2|t[j+2]>>6]+dt[63&t[j+2]];for(r=0;r<u;r++)c+=dt[64];return c},my_b4_decode:function(t){var r=0,u=0,c=(t=t.replace(/[^A-Za-z0-9\+\-\!\.]/g,"")).length%4;if(2<c)return null;for(r=0;r<c;r++)if(t.charAt(t.length-r-1)!=dt[64])return null;var h,_,S,O,N=new Array(3*(t.length-c)/4);for(r=0,u=0;u<N.length;)h=dt.indexOf(t.charAt(r++)),_=dt.indexOf(t.charAt(r++)),S=dt.indexOf(t.charAt(r++)),O=dt.indexOf(t.charAt(r++)),N[u++]=h<<2|_>>4,N[u++]=(15&_)<<4|S>>2,N[u++]=(3&S)<<6|O;for(r=0;r<c;r++)if(N.pop()!=0)return null;return N}},Et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",St={b4_encode:function(t){var r=0,u=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<u;r++)t[t.length]=0;var c="";for(r=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(r=0;r<u;r++)c+="=";return c},b4_decode:function(t){var r=0,u=0,c=(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length%4;if(2<c)return null;for(r=0;r<c;r++)if(t.charAt(t.length-r-1)!="=")return null;var h,_,S,O,N=new Array(3*(t.length-c)/4);for(r=0,u=0;u<N.length;)h=Et.indexOf(t.charAt(r++)),_=Et.indexOf(t.charAt(r++)),S=Et.indexOf(t.charAt(r++)),O=Et.indexOf(t.charAt(r++)),N[u++]=h<<2|_>>4,N[u++]=(15&_)<<4|S>>2,N[u++]=(3&S)<<6|O;for(r=0;r<c;r++)if(N.pop()!=0)return null;return N}};function ht(){}ht.encode=function(t,r,u){for(var c=new Array(2*u),h=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),_=r,S=0;_<u+r;_++,S++)c[S]=h[(255&t[_])>>4],c[++S]=h[15&t[_]];return c.join("")},ht.decode=function(t){if(t==null||t==""||t.length%2!=0)return null;for(var r=t.length/2,u=ht.toCharCodeArray(t),c=new Array(r),h=0;h<r;h++){if(48<=u[2*h]&&u[2*h]<=57)c[h]=u[2*h]-48<<4;else if(65<=u[2*h]&&u[2*h]<=70)c[h]=u[2*h]-65+10<<4;else{if(!(97<=u[2*h]&&u[2*h]<=102))return null;c[h]=u[2*h]-97+10<<4}if(48<=u[2*h+1]&&u[2*h+1]<=57)c[h]=c[h]|u[2*h+1]-48;else if(65<=u[2*h+1]&&u[2*h+1]<=70)c[h]=c[h]|u[2*h+1]-65+10;else{if(!(97<=u[2*h+1]&&u[2*h+1]<=102))return null;c[h]=c[h]|u[2*h+1]-97+10}}return c},ht.toCharCodeArray=function(t){for(var r=new Array(t.length),u=0;u<t.length;u++)r[u]=t.charCodeAt(u);return r};var Gt=ht,L=Gt;(Mt=function(){}).utf8StrToh6=function(t){t=encodeURIComponent(t);for(var r=unescape(t),u=r.length,c=[],h=0;h<u;h++)c[h]=r.charCodeAt(h).toString(16);return c.join("")},Mt.utf8StrToBytes=function(t){t=encodeURIComponent(t);for(var r=unescape(t),u=r.length,c=[],h=0;h<u;h++)c[h]=r.charCodeAt(h);return c},Mt.hexToUtf8Str=function(t){for(var r=L.decode(t),u=[],c=0;c<r.length;c++)u.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(u.join("")))},Mt.bytesToUtf8Str=function(t){for(var r=t,u=[],c=0;c<r.length;c++)u.push(String.fromCharCode(r[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,r){return r+3<t.length?t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]:r+2<t.length?t[r+1]<<16|t[r+2]<<8|t[r+3]:r+1<t.length?t[r]<<8|t[r+1]:t[r]};var Vt,Zt=Mt,Kt={exports:{}};Vt=Kt,function(){function t(n,i,a){n!=null&&(typeof n=="number"?this.fromNumber(n,i,a):i==null&&typeof n!="string"?this.fromString(n,256):this.fromString(n,i))}function r(){return new t(null)}var u=(u=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(t.prototype.am=function(n,i,a,f,v,x){for(var V=32767&i,J=i>>15;0<=--x;){var xt=32767&this[n],$t=this[n++]>>15,ce=J*xt+$t*V;v=((xt=V*xt+((32767&ce)<<15)+a[f]+(1073741823&v))>>>30)+(ce>>>15)+J*$t+(v>>>30),a[f++]=1073741823&xt}return v},30):u&&navigator.appName!="Netscape"?(t.prototype.am=function(n,i,a,f,v,x){for(;0<=--x;){var V=i*this[n++]+a[f]+v;v=Math.floor(V/67108864),a[f++]=67108863&V}return v},26):(t.prototype.am=function(n,i,a,f,v,x){for(var V=16383&i,J=i>>14;0<=--x;){var xt=16383&this[n],$t=this[n++]>>14,ce=J*xt+$t*V;v=((xt=V*xt+((16383&ce)<<14)+a[f]+v)>>28)+(ce>>14)+J*$t,a[f++]=268435455&xt}return v},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,h=48,_=0;_<=9;++_)c[h++]=_;for(h=97,_=10;_<36;++_)c[h++]=_;for(h=65,_=10;_<36;++_)c[h++]=_;function S(n){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(n)}function O(n,i){return(n=c[n.charCodeAt(i)])==null?-1:n}function N(n){var i=r();return i.fromInt(n),i}function st(n){var i,a=1;return(i=n>>>16)!=0&&(n=i,a+=16),(i=n>>8)!=0&&(n=i,a+=8),(i=n>>4)!=0&&(n=i,a+=4),(i=n>>2)!=0&&(n=i,a+=2),(i=n>>1)!=0&&(n=i,a+=1),a}function ct(n){this.m=n}function T(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 X(n,i){return n&i}function nt(n,i){return n|i}function Z(n,i){return n^i}function lt(n,i){return n&~i}function pt(){}function Ot(n){return n}function B(n){this.r2=r(),this.q3=r(),t.ONE.dlShiftTo(2*n.t,this.r2),this.mu=this.r2.divide(n),this.m=n}ct.prototype.convert=function(n){return n.s<0||0<=n.compareTo(this.m)?n.mod(this.m):n},ct.prototype.revert=function(n){return n},ct.prototype.reduce=function(n){n.divRemTo(this.m,null,n)},ct.prototype.mulTo=function(n,i,a){n.multiplyTo(i,a),this.reduce(a)},ct.prototype.sqrTo=function(n,i){n.squareTo(i),this.reduce(i)},T.prototype.convert=function(n){var i=r();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},T.prototype.revert=function(n){var i=r();return n.copyTo(i),this.reduce(i),i},T.prototype.reduce=function(n){for(;n.t<=this.mt2;)n[n.t++]=0;for(var i=0;i<this.m.t;++i){var a=32767&n[i],f=a*this.mpl+((a*this.mph+(n[i]>>15)*this.mpl&this.um)<<15)&n.DM;for(n[a=i+this.m.t]+=this.m.am(0,f,n,i,0,this.m.t);n[a]>=n.DV;)n[a]-=n.DV,n[++a]++}n.clamp(),n.drShiftTo(this.m.t,n),0<=n.compareTo(this.m)&&n.subTo(this.m,n)},T.prototype.mulTo=function(n,i,a){n.multiplyTo(i,a),this.reduce(a)},T.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 a;if(i==16)a=4;else if(i==8)a=3;else if(i==256)a=8;else if(i==2)a=1;else if(i==32)a=5;else{if(i!=4)return void this.fromRadix(n,i);a=2}this.t=0,this.s=0;for(var f=n.length,v=!1,x=0;0<=--f;){var V=a==8?255&n[f]:O(n,f);V<0?n.charAt(f)=="-"&&(v=!0):(v=!1,x==0?this[this.t++]=V:x+a>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+=a)>=this.DB&&(x-=this.DB))}a==8&&128&n[0]&&(this.s=-1,0<x&&(this[this.t-1]|=(1<<this.DB-x)-1<<x)),this.clamp(),v&&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 a=this.t-1;0<=a;--a)i[a+n]=this[a];for(a=n-1;0<=a;--a)i[a]=0;i.t=this.t+n,i.s=this.s},t.prototype.drShiftTo=function(n,i){for(var a=n;a<this.t;++a)i[a-n]=this[a];i.t=Math.max(this.t-n,0),i.s=this.s},t.prototype.lShiftTo=function(n,i){for(var a=n%this.DB,f=this.DB-a,v=(1<<f)-1,x=Math.floor(n/this.DB),V=this.s<<a&this.DM,J=this.t-1;0<=J;--J)i[J+x+1]=this[J]>>f|V,V=(this[J]&v)<<a;for(J=x-1;0<=J;--J)i[J]=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 a=Math.floor(n/this.DB);if(a>=this.t)i.t=0;else{var f=n%this.DB,v=this.DB-f,x=(1<<f)-1;i[0]=this[a]>>f;for(var V=a+1;V<this.t;++V)i[V-a-1]|=(this[V]&x)<<v,i[V-a]=this[V]>>f;0<f&&(i[this.t-a-1]|=(this.s&x)<<v),i.t=this.t-a,i.clamp()}},t.prototype.subTo=function(n,i){for(var a=0,f=0,v=Math.min(n.t,this.t);a<v;)f+=this[a]-n[a],i[a++]=f&this.DM,f>>=this.DB;if(n.t<this.t){for(f-=n.s;a<this.t;)f+=this[a],i[a++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;a<n.t;)f-=n[a],i[a++]=f&this.DM,f>>=this.DB;f-=n.s}i.s=f<0?-1:0,f<-1?i[a++]=this.DV+f:0<f&&(i[a++]=f),i.t=a,i.clamp()},t.prototype.multiplyTo=function(n,i){var a=this.abs(),f=n.abs(),v=a.t;for(i.t=v+f.t;0<=--v;)i[v]=0;for(v=0;v<f.t;++v)i[v+a.t]=a.am(0,f[v],i,v,0,a.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(),a=n.t=2*i.t;0<=--a;)n[a]=0;for(a=0;a<i.t-1;++a){var f=i.am(a,i[a],n,2*a,0,1);(n[a+i.t]+=i.am(a+1,2*i[a],n,2*a+1,f,i.t-a-1))>=i.DV&&(n[a+i.t]-=i.DV,n[a+i.t+1]=1)}0<n.t&&(n[n.t-1]+=i.am(a,i[a],n,2*a,0,1)),n.s=0,n.clamp()},t.prototype.divRemTo=function(n,i,a){var f=n.abs();if(!(f.t<=0)){if(($t=this.abs()).t<f.t)return i!=null&&i.fromInt(0),void(a!=null&&this.copyTo(a));a==null&&(a=r());var v=r(),x=this.s,V=n.s;0<(n=this.DB-st(f[f.t-1]))?(f.lShiftTo(n,v),$t.lShiftTo(n,a)):(f.copyTo(v),$t.copyTo(a));var J=v.t,xt=v[J-1];if(xt!=0){var $t=xt*(1<<this.F1)+(1<J?v[J-2]>>this.F2:0),ce=this.FV/$t,ye=(1<<this.F1)/$t,Se=1<<this.F2,Bt=a.t,Ae=Bt-J,jt=i==null?r():i;for(v.dlShiftTo(Ae,jt),0<=a.compareTo(jt)&&(a[a.t++]=1,a.subTo(jt,a)),t.ONE.dlShiftTo(J,jt),jt.subTo(v,v);v.t<J;)v[v.t++]=0;for(;0<=--Ae;){var nn=a[--Bt]==xt?this.DM:Math.floor(a[Bt]*ce+(a[Bt-1]+Se)*ye);if((a[Bt]+=v.am(0,nn,a,Ae,0,J))<nn)for(v.dlShiftTo(Ae,jt),a.subTo(jt,a);a[Bt]<--nn;)a.subTo(jt,a)}i!=null&&(a.drShiftTo(J,i),x!=V&&t.ZERO.subTo(i,i)),a.t=J,a.clamp(),0<n&&a.rShiftTo(n,a),x<0&&t.ZERO.subTo(a,a)}}},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 a,f=r(),v=r(),x=i.convert(this),V=st(n)-1;for(x.copyTo(f);0<=--V;)i.sqrTo(f,v),0<(n&1<<V)?i.mulTo(v,x,f):(a=f,f=v,v=a);return i.revert(f)},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 a,f=(1<<i)-1,v=!1,x="",V=this.t,J=this.DB-V*this.DB%i;if(0<V--)for(J<this.DB&&0<(a=this[V]>>J)&&(v=!0,x=S(a));0<=V;)J<i?(a=(this[V]&(1<<J)-1)<<i-J,a|=this[--V]>>(J+=this.DB-i)):(a=this[V]>>(J-=i)&f,J<=0&&(J+=this.DB,--V)),(v=0<a||v)&&(x+=S(a));return v?x:"0"},t.prototype.negate=function(){var n=r();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 a=this.t;if((i=a-n.t)!=0)return this.s<0?-i:i;for(;0<=--a;)if((i=this[a]-n[a])!=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=r();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()?ct:T)(i),this.exp(n,i)},t.ZERO=N(0),t.ONE=N(1),pt.prototype.convert=Ot,pt.prototype.revert=Ot,pt.prototype.mulTo=function(n,i,a){n.multiplyTo(i,a)},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=r();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,a){n.multiplyTo(i,a),this.reduce(a)},B.prototype.sqrTo=function(n,i){n.squareTo(i),this.reduce(i)};var Q,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 $(){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,en<=rt&&(rt-=en)}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),a=Math.pow(n,i),f=N(a),v=r(),x=r(),V="";for(this.divRemTo(f,v,x);0<v.signum();)V=(a+x.intValue()).toString(n).substr(1)+V,v.divRemTo(f,v,x);return x.intValue().toString(n)+V},t.prototype.fromRadix=function(n,i){this.fromInt(0);for(var a=this.chunkSize(i=i==null?10:i),f=Math.pow(i,a),v=!1,x=0,V=0,J=0;J<n.length;++J){var xt=O(n,J);xt<0?n.charAt(J)=="-"&&this.signum()==0&&(v=!0):(V=i*V+xt,++x>=a&&(this.dMultiply(f),this.dAddOffset(V,0),V=x=0))}0<x&&(this.dMultiply(Math.pow(i,x)),this.dAddOffset(V,0)),v&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(n,i,a){if(typeof i=="number")if(n<2)this.fromInt(1);else for(this.fromNumber(n,a),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 f=new Array;a=7&n,f.length=1+(n>>3),i.nextBytes(f),0<a?f[0]&=(1<<a)-1:f[0]=0,this.fromString(f,256)}},t.prototype.bitwiseTo=function(n,i,a){for(var f,v=Math.min(n.t,this.t),x=0;x<v;++x)a[x]=i(this[x],n[x]);if(n.t<this.t){for(f=n.s&this.DM,x=v;x<this.t;++x)a[x]=i(this[x],f);a.t=this.t}else{for(f=this.s&this.DM,x=v;x<n.t;++x)a[x]=i(f,n[x]);a.t=n.t}a.s=i(this.s,n.s),a.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 a=0,f=0,v=Math.min(n.t,this.t);a<v;)f+=this[a]+n[a],i[a++]=f&this.DM,f>>=this.DB;if(n.t<this.t){for(f+=n.s;a<this.t;)f+=this[a],i[a++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;a<n.t;)f+=n[a],i[a++]=f&this.DM,f>>=this.DB;f+=n.s}i.s=f<0?-1:0,0<f?i[a++]=f:f<-1&&(i[a++]=this.DV+f),i.t=a,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,a){var f,v=Math.min(this.t+n.t,i);for(a.s=0,a.t=v;0<v;)a[--v]=0;for(f=a.t-this.t;v<f;++v)a[v+this.t]=this.am(0,n[v],a,v,0,this.t);for(f=Math.min(n.t,i);v<f;++v)this.am(0,n[v],a,v,0,i-v);a.clamp()},t.prototype.multiplyUpperTo=function(n,i,a){var f=a.t=this.t+n.t- --i;for(a.s=0;0<=--f;)a[f]=0;for(f=Math.max(i-this.t,0);f<n.t;++f)a[this.t+f-i]=this.am(i-f,n[f],a,0,0,this.t+f-i);a.clamp(),a.drShiftTo(1,a)},t.prototype.modInt=function(n){if(n<=0)return 0;var i=this.DV%n,a=this.s<0?n-1:0;if(0<this.t)if(i==0)a=this[0]%n;else for(var f=this.t-1;0<=f;--f)a=(i*a+this[f])%n;return a},t.prototype.millerRabin=function(n){var i=this.subtract(t.ONE),a=i.getLowestSetBit();if(a<=0)return!1;var f=i.shiftRight(a);G.length<(n=n+1>>1)&&(n=G.length);for(var v=r(),x=0;x<n;++x){v.fromInt(G[Math.floor(Math.random()*G.length)]);var V=v.modPow(f,this);if(V.compareTo(t.ONE)!=0&&V.compareTo(i)!=0){for(var J=1;J++<a&&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=r();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 a,f=this.DB-n*this.DB%8,v=0;if(0<n--)for(f<this.DB&&(a=this[n]>>f)!=(this.s&this.DM)>>f&&(i[v++]=a|this.s<<this.DB-f);0<=n;)f<8?(a=(this[n]&(1<<f)-1)<<8-f,a|=this[--n]>>(f+=this.DB-8)):(a=this[n]>>(f-=8)&255,f<=0&&(f+=this.DB,--n)),128&a&&(a|=-256),v==0&&(128&this.s)!=(128&a)&&++v,(0<v||a!=this.s)&&(i[v++]=a);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=r();return this.bitwiseTo(n,X,i),i},t.prototype.or=function(n){var i=r();return this.bitwiseTo(n,nt,i),i},t.prototype.xor=function(n){var i=r();return this.bitwiseTo(n,Z,i),i},t.prototype.andNot=function(n){var i=r();return this.bitwiseTo(n,lt,i),i},t.prototype.not=function(){for(var n=r(),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=r();return n<0?this.rShiftTo(-n,i):this.lShiftTo(n,i),i},t.prototype.shiftRight=function(n){var i=r();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 a=0;return!(65535&i)&&(i>>=16,a+=16),!(255&i)&&(i>>=8,a+=8),!(15&i)&&(i>>=4,a+=4),!(3&i)&&(i>>=2,a+=2),!(1&i)&&++a,a})(this[n]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var n=0,i=this.s&this.DM,a=0;a<this.t;++a)n+=(function(f){for(var v=0;f!=0;)f&=f-1,++v;return v})(this[a]^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,lt)},t.prototype.flipBit=function(n){return this.changeBit(n,Z)},t.prototype.add=function(n){var i=r();return this.addTo(n,i),i},t.prototype.subtract=function(n){var i=r();return this.subTo(n,i),i},t.prototype.multiply=function(n){var i=r();return this.multiplyTo(n,i),i},t.prototype.divide=function(n){var i=r();return this.divRemTo(n,i,null),i},t.prototype.remainder=function(n){var i=r();return this.divRemTo(n,null,i),i},t.prototype.divideAndRemainder=function(n){var i=r(),a=r();return this.divRemTo(n,i,a),new Array(i,a)},t.prototype.modPow=function(n,i){var a=n.bitLength(),f=N(1);if(a<=0)return f;var v=a<18?1:a<48?3:a<144?4:a<768?5:6,x=new(a<8?ct:i.isEven()?B:T)(i),V=new Array,J=3,xt=v-1,$t=(1<<v)-1;if(V[1]=x.convert(this),1<v){var ce=r();for(x.sqrTo(V[1],ce);J<=$t;)V[J]=r(),x.mulTo(ce,V[J-2],V[J]),J+=2}var ye,Se,Bt=n.t-1,Ae=!0,jt=r();for(a=st(n[Bt])-1;0<=Bt;){for(xt<=a?ye=n[Bt]>>a-xt&$t:(ye=(n[Bt]&(1<<a+1)-1)<<xt-a,0<Bt&&(ye|=n[Bt-1]>>this.DB+a-xt)),J=v;!(1&ye);)ye>>=1,--J;if((a-=J)<0&&(a+=this.DB,--Bt),Ae)V[ye].copyTo(f),Ae=!1;else{for(;1<J;)x.sqrTo(f,jt),x.sqrTo(jt,f),J-=2;0<J?x.sqrTo(f,jt):(Se=f,f=jt,jt=Se),x.mulTo(jt,V[ye],f)}for(;0<=Bt&&!(n[Bt]&1<<a);)x.sqrTo(f,jt),Se=f,f=jt,jt=Se,--a<0&&(a=this.DB-1,--Bt)}return x.revert(f)},t.prototype.modInverse=function(n){var i=n.isEven();if(this.isEven()&&i||n.signum()==0)return t.ZERO;for(var a=n.clone(),f=this.clone(),v=N(1),x=N(0),V=N(0),J=N(1);a.signum()!=0;){for(;a.isEven();)a.rShiftTo(1,a),i?(v.isEven()&&x.isEven()||(v.addTo(this,v),x.subTo(n,x)),v.rShiftTo(1,v)):x.isEven()||x.subTo(n,x),x.rShiftTo(1,x);for(;f.isEven();)f.rShiftTo(1,f),i?(V.isEven()&&J.isEven()||(V.addTo(this,V),J.subTo(n,J)),V.rShiftTo(1,V)):J.isEven()||J.subTo(n,J),J.rShiftTo(1,J);0<=a.compareTo(f)?(a.subTo(f,a),i&&v.subTo(V,v),x.subTo(J,x)):(f.subTo(a,f),i&&V.subTo(v,V),J.subTo(x,J))}return f.compareTo(t.ONE)!=0?t.ZERO:0<=J.compareTo(n)?J.subtract(n):J.signum()<0?(J.addTo(n,J),J.signum()<0?J.add(n):J):J},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(),a=n.s<0?n.negate():n.clone();i.compareTo(a)<0&&(v=i,i=a,a=v);var f=i.getLowestSetBit(),v=a.getLowestSetBit();if(v<0)return i;for(0<(v=f<v?f:v)&&(i.rShiftTo(v,i),a.rShiftTo(v,a));0<i.signum();)0<(f=i.getLowestSetBit())&&i.rShiftTo(f,i),0<(f=a.getLowestSetBit())&&a.rShiftTo(f,a),0<=i.compareTo(a)?(i.subTo(a,i),i.rShiftTo(1,i)):(a.subTo(i,a),a.rShiftTo(1,a));return 0<v&&a.lShiftTo(v,a),a},t.prototype.isProbablePrime=function(n){var i,a=this.abs();if(a.t==1&&a[0]<=G[G.length-1]){for(i=0;i<G.length;++i)if(a[0]==G[i])return!0;return!1}if(a.isEven())return!1;for(i=1;i<G.length;){for(var f=G[i],v=i+1;v<G.length&&f<W;)f*=G[v++];for(f=a.modInt(f);i<v;)if(f%G[i++]==0)return!1}return a.millerRabin(n)},t.prototype.square=function(){var n=r();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),Jt=0;Jt<32;++Jt)Dt[rt++]=Tt[Jt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Lt=window.crypto.random(32),Jt=0;Jt<Lt.length;++Jt)Dt[rt++]=255&Lt.charCodeAt(Jt)}for(;rt<en;)Jt=Math.floor(65536*Math.random()),Dt[rt++]=Jt>>>8,Dt[rt++]=255&Jt;rt=0,$()}function Ze(){if(Q==null){for($(),(Q=new tn).init(Dt),rt=0;rt<Dt.length;++rt)Dt[rt]=0;rt=0}return Q.next()}function Tn(){}function tn(){this.i=0,this.j=0,this.S=new Array}Tn.prototype.nextBytes=function(n){for(var i=0;i<n.length;++i)n[i]=Ze()},tn.prototype.init=function(n){for(var i,a,f=0;f<256;++f)this.S[f]=f;for(f=i=0;f<256;++f)i=i+this.S[f]+n[f%n.length]&255,a=this.S[f],this.S[f]=this.S[i],this.S[i]=a;this.i=0,this.j=0},tn.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 en=256;Vt.exports={default:t,BigInteger:t,SecureRandom:Tn}}.call(b);var Nt=Kt.exports.BigInteger,Ct=(function(){function t(){z(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return P(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 r=this.v.length/2,u=r.toString(16);return u.length%2==1&&(u="0"+u),r<128?u:(128+u.length/2).toString(16)+u}},{key:"getValue",value:function(){return""}}]),t})(),se=(function(){et(r,Ct);var t=H(r);function r(u){var c;return z(this,r),(c=t.call(this)).t="02",u&&(c.v=(function(h){if((_=h.toString(16))[0]!=="-")_.length%2==1?_="0"+_:_.match(/^[0-7]/)||(_="00"+_);else{var _,S=(_=_.substr(1)).length;S%2==1?S+=1:_.match(/^[0-7]/)||(S+=2);for(var O="",N=0;N<S;N++)O+="f";_=(_=(O=new Nt(O,16)).xor(h).add(Nt.ONE)).toString(16).replace(/^-/,"")}return _})(u)),c}return P(r,[{key:"getValue",value:function(){return this.v}}]),r})(),ie=(function(){et(r,Ct);var t=H(r);function r(u){var c;return z(this,r),(c=t.call(this)).t="30",c.asn1Array=u,c}return P(r,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(u){return u.getEncodedHex()})).join(""),this.v}}]),r})();function kt(t,r){return+t[r+2]<8?1:128&+t.substr(r+2,2)}function ue(t,r){var u=kt(t,r);return(t=t.substr(r+2,2*u))?(+t[0]<8?new Nt(t,16):new Nt(t.substr(2),16)).intValue():-1}function ae(t,r){return r+2*(kt(t,r)+1)}var Ut=Kt.exports.BigInteger,Ht=new Ut("3"),me=(function(){function t(r,u){z(this,t),this.x=u,this.q=r}return P(t,[{key:"equals",value:function(r){return r===this||this.q.equals(r.q)&&this.x.equals(r.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(r){return new t(this.q,this.x.add(r.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(r){return new t(this.q,this.x.subtract(r.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(r){return new t(this.q,this.x.multiply(r.toBigInteger()).mod(this.q))}},{key:"divide",value:function(r){return new t(this.q,this.x.multiply(r.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(r,u,c,h){z(this,t),this.curve=r,this.x=u,this.y=c,this.z=h==null?Ut.ONE:h,this.zinv=null}return P(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(r){return r===this||(this.isInfinity()?r.isInfinity():r.isInfinity()?this.isInfinity():!!r.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Ut.ZERO)&&r.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(r.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(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var u=this.x.toBigInteger(),c=this.y.toBigInteger(),h=this.z,_=r.x.toBigInteger(),S=r.y.toBigInteger(),O=r.z,N=this.curve.q,st=u.multiply(O).mod(N);return r=_.multiply(h).mod(N),u=st.subtract(r),_=c.multiply(O).mod(N),c=S.multiply(h).mod(N),S=_.subtract(c),Ut.ZERO.equals(u)?Ut.ZERO.equals(S)?this.twice():this.curve.infinity:(c=st.add(r),r=h.multiply(O).mod(N),O=u.square().mod(N),h=u.multiply(O).mod(N),c=r.multiply(S.square()).subtract(c.multiply(O)).mod(N),u=u.multiply(c).mod(N),_=S.multiply(O.multiply(st).subtract(c)).subtract(_.multiply(h)).mod(N),N=h.multiply(r).mod(N),new t(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(_),N))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var r=this.x.toBigInteger(),u=this.y.toBigInteger(),c=this.z,h=this.curve.q,_=this.curve.a.toBigInteger(),S=r.square().multiply(Ht).add(_.multiply(c.square())).mod(h),O=u.shiftLeft(1).multiply(c).mod(h),N=(_=(N=u.square().mod(h)).multiply(r).multiply(c).mod(h),u=O.square().mod(h),r=S.square().subtract(_.shiftLeft(3)).mod(h),c=O.multiply(r).mod(h),S.multiply(_.shiftLeft(2).subtract(r)).subtract(u.shiftLeft(1).multiply(N)).mod(h));return h=O.multiply(u).mod(h),new t(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(N),h)}},{key:"multiply",value:function(r){if(this.isInfinity())return this;if(!r.signum())return this.curve.infinity;for(var u=r.multiply(Ht),c=this.negate(),h=this,_=u.bitLength()-2;0<_;_--){h=h.twice();var S=u.testBit(_);S!==r.testBit(_)&&(h=h.add(S?this:c))}return h}}]),t})(),Ft=(function(){function t(r,u,c){z(this,t),this.q=r,this.a=this.fromBigInteger(u),this.b=this.fromBigInteger(c),this.infinity=new te(this,null,null)}return P(t,[{key:"equals",value:function(r){return r===this||this.q.equals(r.q)&&this.a.equals(r.a)&&this.b.equals(r.b)}},{key:"fromBigInteger",value:function(r){return new me(this.q,r)}},{key:"decodePointHex",value:function(r){switch(parseInt(r.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var u=(r.length-2)/2,c=r.substr(2,u);return u=r.substr(2+u,u),new te(this,this.fromBigInteger(new Ut(c,16)),this.fromBigInteger(new Ut(u,16)))}}}]),t})(),Mt={ECPointFp:te,ECCurveFp:Ft},ne=Kt.exports.BigInteger,fe=(Ft=Kt.exports.SecureRandom,Mt.ECCurveFp),de=new Ft,re=(Mt=m()).curve,d=Mt.G,l=Mt.n;function m(){var t=new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),r=new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),u=new ne("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return u=(r=new fe(t,r,u)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:r,G:u,n:new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function Y(t,r){return t.length>=r?t:new Array(r-t.length+1).join("0")+t}function I(t,r){for(var u=[],c=~~(r/8),h=r%8,_=0,S=t.length;_<S;_++)u[_]=(t[(_+c)%S]<<h&255)+(t[(_+c+1)%S]>>>8-h&255);return u}function q(t,r){for(var u=[],c=t.length-1;0<=c;c--)u[c]=255&(t[c]^r[c]);return u}function ot(t,r){for(var u=[],c=t.length-1;0<=c;c--)u[c]=t[c]&r[c]&255;return u}function vt(t,r){for(var u=[],c=t.length-1;0<=c;c--)u[c]=255&(t[c]|r[c]);return u}function mt(t,r){for(var u=[],c=0,h=t.length-1;0<=h;h--){var _=t[h]+r[h]+c;c=255<_?1:0,u[h]=255&_}return u}function Xt(t,r,u,c){return 0<=c&&c<=15?q(q(t,r),u):vt(ot(t,r),ot((function(h){for(var _=[],S=h.length-1;0<=S;S--)_[S]=255&~h[S];return _})(t),u))}function ee(t,r){for(var u=[],c=[],h=0;h<16;h++){var _=4*h;u.push(r.slice(_,4+_))}for(var S,O=16;O<68;O++)u.push(q(q((S=q(q(u[O-16],u[O-9]),I(u[O-3],15)),q(q(S,I(S,15)),I(S,23))),I(u[O-13],7)),u[O-6]));for(var N=0;N<64;N++)c.push(q(u[N],u[N+4]));for(var st,ct,T,X=[121,204,69,25],nt=[122,135,157,138],Z=t.slice(0,4),lt=t.slice(4,8),pt=t.slice(8,12),Ot=t.slice(12,16),B=t.slice(16,20),Q=t.slice(20,24),G=t.slice(24,28),W=t.slice(28,32),$=0;$<64;$++){var Dt=0<=$&&$<=15?X:nt,rt=q(Tt=I(mt(mt(I(Z,12),B),I(Dt,$)),7),I(Z,12)),Tt=(rt=mt(mt(mt((st=Z,ct=lt,T=pt,0<=(Dt=$)&&Dt<=15?q(q(st,ct),T):vt(vt(ot(st,ct),ot(st,T)),ot(ct,T))),Ot),rt),c[$]),mt(mt(mt(Xt(B,Q,G,$),W),Tt),u[$]));Ot=pt,pt=I(lt,9),lt=Z,Z=rt,W=G,G=I(Q,19),Q=B,B=q(q(Tt,I(Tt,9)),I(Tt,17))}return q([].concat(Z,lt,pt,Ot,B,Q,G,W),t)}Ft={getGlobalCurve:function(){return re},generateEcparam:m,generateKeyPairHex:function(t,r,u){return{privateKey:u=Y((r=(t?new ne(t,r,u):new ne(l.bitLength(),de)).mod(l.subtract(ne.ONE)).add(ne.ONE)).toString(16),64),publicKey:"04"+Y((r=d.multiply(r)).getX().toBigInteger().toString(16),64)+Y(r.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(t){for(var r=(t=unescape(encodeURIComponent(t))).length,u=[],c=0;c<r;c++)u[c>>>2]|=(255&t.charCodeAt(c))<<24-c%4*8;for(var h=[],_=0;_<r;_++){var S=u[_>>>2]>>>24-_%4*8&255;h.push((S>>>4).toString(16)),h.push((15&S).toString(16))}return h.join("")},leftPad:Y,arrayToHex:function(t){return t.map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},arrayToUtf8:function(t){for(var r=[],u=0,c=0;c<2*t.length;c+=2)r[c>>>3]|=parseInt(t[u],10)<<24-c%8*4,u++;try{for(var h=[],_=0;_<t.length;_++){var S=r[_>>>2]>>>24-_%4*8&255;h.push(String.fromCharCode(S))}return decodeURIComponent(escape(h.join("")))}catch(O){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){for(var r=[],u=(t=(u=t.length)%2!=0?Y(t,u+1):t).length,c=0;c<u;c+=2)r.push(parseInt(t.substr(c,2),16));return r},verifyPublicKey:function(t){var r=re.decodePointHex(t);return!!r&&(t=r.getX(),r.getY().square().equals(t.multiply(t.square()).add(t.multiply(re.a)).add(re.b)))}},Mt=function(t){for(var r=448<=(r=(O=8*t.length)%512)?512-r%448-1:448-r-1,u=new Array((r-7)/8),c=0,h=u.length;c<h;c++)u[c]=0;for(var _,S=[],O=O.toString(2),N=7;0<=N;N--)8<O.length?(_=O.length-8,S[N]=parseInt(O.substr(_),2),O=O.substr(0,_)):0<O.length?(S[N]=parseInt(O,2),O=""):S[N]=0;for(var st=[].concat(t,[128],u,S),ct=st.length/64,T=[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],X=0;X<ct;X++){var nt=64*X;T=ee(T,st.slice(nt,64+nt))}return T};var Rt=Kt.exports.BigInteger,vr=function(t,r){return t=new se(t),r=new se(r),new ie([t,r]).getEncodedHex()},Ir=function(t){var r=ae(t,0),u=ae(t,r),c=ue(t,r);return r=t.substr(u,2*c),u=ae(t,c=u+r.length),c=ue(t,c),t=t.substr(u,2*c),{r:new Nt(r,16),s:new Nt(t,16)}},yt=Ft,ve=Mt,Ie=(Ft=yt.generateEcparam()).G,In=Ft.curve,Pe=Ft.n;function Pn(t,r,u){var c=2<arguments.length&&u!==void 0?u:"1234567812345678",h=(c=yt.utf8ToHex(c),yt.leftPad(Ie.curve.a.toBigInteger().toRadix(16),64)),_=yt.leftPad(Ie.curve.b.toBigInteger().toRadix(16),64),S=yt.leftPad(Ie.getX().toBigInteger().toRadix(16),64),O=yt.leftPad(Ie.getY().toBigInteger().toRadix(16),64);return u=(r=128<r.length?r.substr(2,128):r).substr(0,64),r=r.substr(64,64),r=yt.hexToArray(c+h+_+S+O+u+r),c=4*c.length,r.unshift(255&c),r.unshift(c>>8&255),r=ve(r),yt.arrayToHex(ve(r.concat(yt.hexToArray(t))))}function En(){var t=yt.generateKeyPairHex(),r=In.decodePointHex(t.publicKey);return t.k=new Rt(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}Ft={generateKeyPairHex:yt.generateKeyPairHex,doEncrypt:function(t,r){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),r=yt.getGlobalCurve().decodePointHex(r);var c=yt.generateKeyPairHex(),h=new Rt(c.privateKey,16),_=c.publicKey;128<_.length&&(_=_.substr(_.length-128)),c=r.multiply(h),h=yt.hexToArray(yt.leftPad(c.getX().toBigInteger().toRadix(16),64)),r=yt.hexToArray(yt.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=yt.arrayToHex(ve([].concat(h,t,r)));var S,O=1,N=0,st=[],ct=[].concat(h,r);(S=function(){st=ve([].concat(wt(ct),[O>>24&255,O>>16&255,O>>8&255,255&O])),O++,N=0})();for(var T=0,X=t.length;T<X;T++)N===st.length&&S(),t[T]^=255&st[N++];return r=yt.arrayToHex(t),u===0?_+r+c:_+c+r},doDecrypt:function(t,r){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(_=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":_;r=new Rt(r,16);var h=t.substr(128,64),_=t.substr(192);u===0&&(h=t.substr(t.length-64),_=t.substr(128,t.length-128-64));var S,O=yt.hexToArray(_),N=(t=yt.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),r=yt.hexToArray(yt.leftPad(t.getX().toBigInteger().toRadix(16),64)),t=yt.hexToArray(yt.leftPad(t.getY().toBigInteger().toRadix(16),64)),1),st=0,ct=[],T=[].concat(r,t);(S=function(){ct=ve([].concat(wt(T),[N>>24&255,N>>16&255,N>>8&255,255&N])),N++,st=0})();for(var X=0,nt=O.length;X<nt;X++)st===ct.length&&S(),O[X]^=255&ct[st++];return yt.arrayToHex(ve([].concat(r,O,t)))===h?c==="array"?O:yt.arrayToUtf8(O):c==="array"?[]:""},doSignature:function(t,r){var u=(O=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=O.der,h=O.hash,_=O.publicKey,S=O.userId,O=typeof t=="string"?yt.utf8ToHex(t):yt.arrayToHex(t);h&&(O=Pn(O,_||(t=r,h=Ie.multiply(new Rt(t,16)),"04"+(t=yt.leftPad(h.getX().toBigInteger().toString(16),64))+(h=yt.leftPad(h.getY().toBigInteger().toString(16),64))),S));var N=new Rt(r,16),st=new Rt(O,16),ct=null,T=null,X=null;do do{var nt;ct=(nt=u&&u.length?u.pop():En()).k,T=st.add(nt.x1).mod(Pe)}while(T.equals(Rt.ZERO)||T.add(ct).equals(Pe));while((X=N.add(Rt.ONE).modInverse(Pe).multiply(ct.subtract(T.multiply(N))).mod(Pe)).equals(Rt.ZERO));return c?vr(T,X):yt.leftPad(T.toString(16),64)+yt.leftPad(X.toString(16),64)},doVerifySignature:function(t,r,u){var c,h,_=(O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,S=O.hash,O=O.userId;return t=typeof t=="string"?yt.utf8ToHex(t):yt.arrayToHex(t),S&&(t=Pn(t,u,O)),h=_?(c=(h=Ir(r)).r,h.s):(c=new Rt(r.substring(0,64),16),new Rt(r.substring(64),16)),r=In.decodePointHex(u),u=new Rt(t,16),!(t=c.add(h).mod(Pe)).equals(Rt.ZERO)&&(r=Ie.multiply(h).add(r.multiply(t)),u=u.add(r.getX().toBigInteger()).mod(Pe),c.equals(u))},getPoint:En,verifyPublicKey:yt.verifyPublicKey};var Pr=Mt,Ue=[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],Me=[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 r=[],u=0,c=t.length;u<c;u+=2)r.push(parseInt(t.substr(u,2),16));return r}function Ee(t,r){return t<<r|t>>>32-r}function he(t){return(255&Ue[t>>>24&255])<<24|(255&Ue[t>>>16&255])<<16|(255&Ue[t>>>8&255])<<8|255&Ue[255&t]}function Je(t){return t^Ee(t,2)^Ee(t,10)^Ee(t,18)^Ee(t,24)}function ke(t){return t^Ee(t,13)^Ee(t,23)}function Sn(t,r,u,c){c=(_=(S=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":_;var h=S.mode,_=(_=S.iv)===void 0?[]:_,S=(S=S.output)===void 0?"string":S;if(h==="cbc"&&(_=typeof _=="string"?ze(_):_).length!==16)throw new Error("iv is invalid");if((r=typeof r=="string"?ze(r):r).length!==16)throw new Error("key is invalid");if(t=(typeof t=="string"?u!==0?function(B){for(var Q=[],G=0,W=B.length;G<W;G++){var $=B.codePointAt(G);if($<=127)Q.push($);else if($<=2047)Q.push(192|$>>>6),Q.push(128|63&$);else if($<=55295||57344<=$&&$<=65535)Q.push(224|$>>>12),Q.push(128|$>>>6&63),Q.push(128|63&$);else{if(!(65536<=$&&$<=1114111))throw Q.push($),new Error("input is not supported");G++,Q.push(240|$>>>18&28),Q.push(128|$>>>12&63),Q.push(128|$>>>6&63),Q.push(128|63&$)}}return Q}:ze:wt)(t),c==="pkcs#5"&&u!==0)for(var O=16-t.length%16,N=0;N<O;N++)t.push(O);var st=new Array(32);(function(B,Q,G){for(var W=new Array(4),$=new Array(4),Dt=0;Dt<4;Dt++)$[0]=255&B[0+4*Dt],$[1]=255&B[1+4*Dt],$[2]=255&B[2+4*Dt],$[3]=255&B[3+4*Dt],W[Dt]=$[0]<<24|$[1]<<16|$[2]<<8|$[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]^Me[Tt+0],Q[Tt+0]=W[0]^=ke(he(rt)),rt=W[2]^W[3]^W[0]^Me[Tt+1],Q[Tt+1]=W[1]^=ke(he(rt)),rt=W[3]^W[0]^W[1]^Me[Tt+2],Q[Tt+2]=W[2]^=ke(he(rt)),rt=W[0]^W[1]^W[2]^Me[Tt+3],Q[Tt+3]=W[3]^=ke(he(rt));if(G===0)for(var Lt,Jt=0;Jt<16;Jt++)Lt=Q[Jt],Q[Jt]=Q[31-Jt],Q[31-Jt]=Lt})(r,st,u);for(var ct=[],T=_,X=t.length,nt=0;16<=X;){var Z=t.slice(nt,nt+16),lt=new Array(16);if(h==="cbc")for(var pt=0;pt<16;pt++)u!==0&&(Z[pt]^=T[pt]);(function(B,Q,G){for(var W=new Array(4),$=new Array(4),Dt=0;Dt<4;Dt++)$[0]=255&B[4*Dt],$[1]=255&B[4*Dt+1],$[2]=255&B[4*Dt+2],$[3]=255&B[4*Dt+3],W[Dt]=$[0]<<24|$[1]<<16|$[2]<<8|$[3];for(var rt,Tt=0;Tt<32;Tt+=4)rt=W[1]^W[2]^W[3]^G[Tt+0],W[0]^=Je(he(rt)),rt=W[2]^W[3]^W[0]^G[Tt+1],W[1]^=Je(he(rt)),rt=W[3]^W[0]^W[1]^G[Tt+2],W[2]^=Je(he(rt)),rt=W[0]^W[1]^W[2]^G[Tt+3],W[3]^=Je(he(rt));for(var Lt=0;Lt<16;Lt+=4)Q[Lt]=W[3-Lt/4]>>>24&255,Q[Lt+1]=W[3-Lt/4]>>>16&255,Q[Lt+2]=W[3-Lt/4]>>>8&255,Q[Lt+3]=255&W[3-Lt/4]})(Z,lt,st);for(var Ot=0;Ot<16;Ot++)h==="cbc"&&u===0&&(lt[Ot]^=T[Ot]),ct[nt+Ot]=lt[Ot];h==="cbc"&&(T=u!==0?lt:Z),X-=16,nt+=16}return c==="pkcs#5"&&u===0&&(c=ct[ct.length-1],ct.splice(ct.length-c,c)),S!=="array"?u!==0?ct.map((function(B){return(B=B.toString(16)).length===1?"0"+B:B})).join(""):(function(B){for(var Q=[],G=0,W=B.length;G<W;G++)240<=B[G]&&B[G]<=247?(Q.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?(Q.push(String.fromCodePoint(((15&B[G])<<12)+((63&B[G+1])<<6)+(63&B[G+2]))),G+=2):192<=B[G]&&B[G]<=223?(Q.push(String.fromCodePoint(((31&B[G])<<6)+(63&B[G+1]))),G++):Q.push(String.fromCodePoint(B[G]));return Q.join("")})(ct):ct}var Er=[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=[],Sr=function(t,r,u){for(var c=t[0],h=t[1],_=t[2],S=t[3],O=t[4],N=t[5],st=t[6],ct=t[7],T=0;T<64;T++){T<16?ge[T]=0|r[u+T]:(X=ge[T-15],nt=ge[T-2],ge[T]=((X<<25|X>>>7)^(X<<14|X>>>18)^X>>>3)+ge[T-7]+((nt<<15|nt>>>17)^(nt<<13|nt>>>19)^nt>>>10)+ge[T-16]);var X=c&h^c&_^h&_,nt=ct+((O<<26|O>>>6)^(O<<21|O>>>11)^(O<<7|O>>>25))+(O&N^~O&st)+Er[T]+ge[T];ct=st,st=N,N=O,O=S+nt|0,S=_,_=h,h=c,c=nt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+X)|0}t[0]=t[0]+c|0,t[1]=t[1]+h|0,t[2]=t[2]+_|0,t[3]=t[3]+S|0,t[4]=t[4]+O|0,t[5]=t[5]+N|0,t[6]=t[6]+st|0,t[7]=t[7]+ct|0},Rn=(Ft={c2:Ft,c3:function(t){return t=typeof t=="string"?(function(r){for(var u=[],c=0,h=r.length;c<h;c++){var _=r.codePointAt(c);if(_<=127)u.push(_);else if(_<=2047)u.push(192|_>>>6),u.push(128|63&_);else if(_<=55295||57344<=_&&_<=65535)u.push(224|_>>>12),u.push(128|_>>>6&63),u.push(128|63&_);else{if(!(65536<=_&&_<=1114111))throw u.push(_),new Error("input is not supported");c++,u.push(240|_>>>18&28),u.push(128|_>>>12&63),u.push(128|_>>>6&63),u.push(128|63&_)}}return u})(t):Array.prototype.slice.call(t),Pr(t).map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},c4:{encrypt:function(t,r,u){return Sn(t,r,1,u)},decrypt:function(t,r,u){return Sn(t,r,0,u)}},s2:function(t){var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],u=(function(h){for(var _=[],S=0;S<Math.ceil(h.length/4);S++)_[S]=h[4*S]<<24|(255&h[4*S+1])<<16|(255&h[4*S+2])<<8|255&h[4*S+3];return _})(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)Sr(r,u,c);return(function(h){for(var _=[],S=0;S<h.length;S++)_[4*S]=h[S]>>24&255,_[4*S+1]=h[S]>>16&255,_[4*S+2]=h[S]>>8&255,_[4*S+3]=255&h[S];return _})(r).map((function(h){return(h=h.toString(16)).length===1?"0"+h:h})).join("")}},Pt),Rr=At,Tr=St,wr=Gt,br=Zt,Nr=Ft.c2,Cr=Ft.c3,Or=Ft.c4,Fr=Ft.s2;return(function(){var t;(t=function(){}).VERSION="2.1.0";var r=b;if(r.AAR2)return r.AAR2.VERSION!==t.VERSION&&console.log(r.AAR2.VERSION),r.AAR2;var u="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,h=!1,_=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,S=_!==void 0&&!!_.request&&!!_.login,O=function(T,X){return typeof T=="string"&&typeof X=="string"&&T!=null&&X!=null&&T.substring(0,X.length)===X},N={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(T){for(var X in N)if(N[X]===T)return X},ct=function(T,X,nt){var Z=Date.now(),lt=new t;try{if(!T||T.length<=75)return console.error("error format 1:",T),N.ERROR_DATA_FORMAT;if(!O(T,"eyJ"))return console.error("error format 2:",T),N.ERROR_DATA_FORMAT;T=T.substring(3,T.length);var pt=Rr.my_b4_decode(T);if(!pt)return console.error("error format 3:",T),N.ERROR_DATA_FORMAT;var Ot,B=lt.cc.u8.byteToInt(pt.slice(0,4),0),Q=pt.slice(4,4+B),G=lt.cc.u8.byteToInt(pt.slice(4+B,4+B+4),0),W=pt.slice(4+B+4,4+B+4+G),$=lt.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+$),rt=lt.cc.u8.bytesToUtf8Str(Q);if(lt.cc.h6.encode(W,0,G),X||(nt!==void 0&&nt==="sm2"?(Ot=lt.cc.h6.encode(W,0,G),lt.co.c2.doVerifySignature(rt,Ot,u,{der:!0,hash:!0})):lt.co.c3(rt+"8890012345678890").toLowerCase()===lt.cc.h6.encode(Dt,0,$).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 Jt=parseInt("0x"+rt.slice(66,82))-Z;t.prototype.__o=function(){return Jt}}return S||b.AAR2||(b.AAR2=t),N.SUCCESS}}catch(Ze){return console.error(Ze),N.ERROR_UNKNOWN_ERROR}return N.ERROR_SIGN_CHECK};return t.init=function(T,X){var nt,Z={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof T=="string"?(O(T,"https")||O(T,"https")?Z.url=T:O(T,"eyJ")&&(Z.code=T),typeof X=="string"&&(Z.publicKey=X)):tt(T)==="object"&&(T.debug&&(Z.debug=T.debug),T.url&&(Z.url=T.url),T.code&&(Z.code=T.code),T.publicKey&&(Z.publicKey=T.publicKey),T.skipVerify&&(Z.skipVerify=T.skipVerify),T.alg&&(Z.alg=T.alg),T.callback&&typeof T.callback=="function"&&(Z.callback=T.callback)),h?Z.callback&&Z.callback(!0,{errorNo:nt=N.ALREADY_SUCCESS,errorMsg:st(nt)}):c?setTimeout((function(){t.init(T,X)}),50):(c=!0,Z.debug&&Rn.start(Z.debug),Z.publicKey&&(u=Z.publicKey),Z.code?(nt=ct(Z.code,Z.skipVerify))===N.SUCCESS?(c=!(h=!0),Z.callback(!0,{errorNo:nt,errorMsg:st(nt)})):Z.callback(!1,{errorNo:nt,errorMsg:st(nt)}):Z.url&&(function(lt,pt,Ot){try{if(lt=lt+"?version="+t.VERSION+(S?"&name=wechat":"&name=browser")+"&t="+Date.now(),S)_.request({url:lt,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function(Q){Q.statusCode===200?pt(Q.data):Ot(N.ERROR_XXX_REQUEST_FAIL)},fail:function(Q){Q&&Q.errMsg&&Q.errMsg.indexOf("timeout")!==-1?Ot(N.ERROR_XXX_REQUEST_TIMEOUT):Ot(N.ERROR_XXX_REQUEST_FAIL)}});else{var B;if(window.XMLHttpRequest)B=new XMLHttpRequest;else if(window.ActiveXObject)try{B=new ActiveXObject("Msxml2.XMLHTTP")}catch(Q){try{B=new ActiveXObject("Microsoft.XMLHTTP")}catch(G){}}B&&(B.onload=function(){B.readyState===4&&(B.status===200?pt(B.responseText):Ot(N.ERROR_XHR_ERROR))},B.ontimeout=function(){Ot(N.ERROR_XHR_TIMEOUT)},B.onerror=function(){Ot(N.ERROR_XHR_ERROR)},B.open("POST",lt,!0),B.timeout=5e3,B.send(null))}}catch(Q){console.error(Q),Ot(N.ERROR_UNKNOWN_ERROR)}})(Z.url,(function(lt){(lt=ct(lt,Z.skipVerify,Z.alg))===N.SUCCESS?(c=!(h=!0),Z.callback(!0,{errorNo:lt,errorMsg:st(lt)})):(c=!1,Z.callback(!1,{errorNo:lt,errorMsg:st(lt)}))}),(function(lt){c=!1,Z.callback(!1,{errorNo:lt,errorMsg:st(lt)})})))},t.prototype={cc:{b4:Tr,h6:wr,u8:br},co:{c2:Nr,c3:Cr,c4:Or,s2:Fr},nonce:function(){var T="0000000000"+Math.ceil(2147483647*Math.random())+Math.floor((Date.now()+this.__o())/1e3);return T.substring(T.length-20)},sign:function(T,X){return this.__s(T,X)},__s:function(T,X){var nt=this.cc.u8.utf8StrToBytes(T),Z=this.__i();return T=this.cc.u8.utf8StrToBytes(X),X=this.cc.u8.utf8StrToBytes(this.__c()),T=[].concat(nt,Z,T,X),X=parseInt("0x"+this.__v()),this.__f(X)(T)+this.__v()},__f:function(T){var X=this.co.s2,nt=this.co.c3,Z=this.cc.h6.decode,lt=[function(pt){return X(pt)},function(pt){return nt(pt)},function(pt){return nt(Z(X(pt)))},function(pt){return X(Z(nt(pt)))},function(pt){return nt(Z(nt(pt)))},function(pt){return X(Z(X(pt)))}];return lt[(128<T?T-128:T)%lt.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(_!==void 0&&_.env&&_.request&&_.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 Rn.isDebug()},version:function(){return t.VERSION}},t})()},it(g)=="object"?y.exports=M():(U=typeof(E=M)=="function"?E.call(g,A,g,y):E)===void 0||(y.exports=U)}},o={};function s(y){var g=o[y];if(g!==void 0)return g.exports;var A=o[y]={id:y,loaded:!1,exports:{}};return e[y].call(A.exports,A,A.exports,s),A.loaded=!0,A.exports}s.n=y=>{var g=y&&y.__esModule?()=>y.default:()=>y;return s.d(g,{a:g}),g},s.d=(y,g)=>{for(var A in g)s.o(g,A)&&!s.o(y,A)&&Object.defineProperty(y,A,{enumerable:!0,get:g[A]})},s.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(y){if(typeof window=="object")return window}})(),s.hmd=y=>((y=Object.create(y)).children||(y.children=[]),Object.defineProperty(y,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+y.id)}}),y),s.o=(y,g)=>Object.prototype.hasOwnProperty.call(y,g),s.r=y=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})};var p=s(737);Vn.exports.LyyGetCommandSDK=p})()});var Co={};qe(Co,{DyErrorCode:()=>_e,DyErrorMessage:()=>gt,ENV_TYPE:()=>Qt,EXTERNAL_ENV_TYPE:()=>le,JdErrorCode:()=>Ke,JdErrorMessage:()=>bt,createServices:()=>Dr,getDisplayAdConfig:()=>Dn,getDyPayRtaData:()=>Qe,handleDyJsapiPayFlow:()=>_n,handleDyPayCommandFlow:()=>hn,handleDyPayFlow:()=>We,handleJdInsurance:()=>dn,handleJdInsuranceExt:()=>yn,handleJdjrCashLoanExt:()=>fn,handleJdjrCashLoanFlow:()=>ln,normalizeDisplayAdData:()=>$e});module.exports=jr(Co);var Qt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},le={SIT:"sit",RELEASE:"release",PROD:"prod"},Ve={[Qt.DEV]:"https://dm.leyaoyao.com",[Qt.SIT]:"https://sm.leyaoyao.com",[Qt.UAT]:"https://um.leyaoyao.com",[Qt.PROD]:"https://m.leyaoyao.com"},Nn={[Qt.DEV]:"https://dad2.leyaoyao.com",[Qt.SIT]:"https://sad2.leyaoyao.com",[Qt.UAT]:"https://uad2.leyaoyao.com",[Qt.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 He(e,o){return`${Ve[e]||Ve[Qt.PROD]}${o}`}function Cn(e){return Nn[e]||Nn[Qt.PROD]}var Re={debug:!1,env:Qt.PROD,externalEnv:le.PROD,apiDomain:""},On=ut({},Re);function Fn(e){On=ut(ut({},Re),e)}function pe(){return On}var qr=Object.defineProperty,Br=(e,o,s)=>o in e?qr(e,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[o]=s,Vr=(e,o,s)=>Br(e,typeof o!="symbol"?o+"":o,s);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 Hr=class{constructor(e=!1){Vr(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 Hr;function Ce(e){let o=oe();return o==="taro"?Taro.setClipboardData({data:e}).then(()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):o==="uni"?new Promise((s,p)=>{uni.setClipboardData({data:e,success:()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),s()},fail:y=>{w.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",y),p(y)}})}):o==="wechat"?new Promise((s,p)=>{wx.setClipboardData({data:e,success:()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),s()},fail:y=>{w.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",y),p(y)}})}):o==="alipay"?new Promise((s,p)=>{my.setClipboardData({text:e,success:()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),s()},fail:y=>{w.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",y),p(y)}})}):navigator.clipboard.writeText(e).then(()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function on(e,o=2e3){let s=oe();if(s==="taro"){Taro.showToast({title:e,icon:"none",mask:!0,duration:o});return}if(s==="uni"){uni.showToast({title:e,icon:"none",mask:!0,duration:o});return}if(s==="wechat"){wx.showToast({title:e,icon:"none",mask:!0,duration:o});return}if(s==="alipay"){my.showToast({content:e,duration:o});return}typeof console!="undefined"&&console.log(`[Toast] ${e}`)}async function De(){var e,o,s,p,y;let g=oe();try{if(g==="taro")return((e=(await Taro.getSystemInfo()).platform)==null?void 0:e.toLowerCase())==="ios"?"ios":"android";if(g==="uni")return((o=uni.getSystemInfoSync().platform)==null?void 0:o.toLowerCase())==="ios"?"ios":"android";if(g==="wechat")return wx.getDeviceInfo?((s=(await wx.getDeviceInfo()).platform)==null?void 0:s.toLowerCase())==="ios"?"ios":"android":((p=wx.getSystemInfoSync().platform)==null?void 0:p.toLowerCase())==="ios"?"ios":"android";if(g==="alipay")return((y=my.getSystemInfoSync().platform)==null?void 0:y.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 Yt={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function k(e,o,s=null){return{code:e,message:o,data:s}}function Ge(e,o){return e==null?{valid:!1,message:`${o}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof e=="string"&&e.trim().length===0?{valid:!1,message:`${o}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Oe(e,o){for(let s of o){let p=Ge(e[s],s);if(!p.valid)return p}return{valid:!0}}var pn={};qe(pn,{handleJdInsurance:()=>dn,handleJdInsuranceExt:()=>yn,handleJdjrCashLoanExt:()=>fn,handleJdjrCashLoanFlow:()=>ln});var Ke=(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))(Ke||{}),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"},_e=(L=>(L[L.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",L[L.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",L[L.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",L[L.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",L[L.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",L[L.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",L[L.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",L[L.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",L[L.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",L[L.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",L[L.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",L[L.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",L[L.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",L[L.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",L[L.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",L[L.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",L[L.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",L[L.DY_PAY__INVALID_RETURN_TYPE=3018]="DY_PAY__INVALID_RETURN_TYPE",L[L.DY_PAY__JSAPI_INFO_FAILED=3019]="DY_PAY__JSAPI_INFO_FAILED",L[L.DY_PAY__REQUEST_JSAPI_INFO_FAILED=3020]="DY_PAY__REQUEST_JSAPI_INFO_FAILED",L[L.DY_PAY__MISSING_JSAPI_PAY_INFO=3021]="DY_PAY__MISSING_JSAPI_PAY_INFO",L[L.DY_PAY__INVALID_JSAPI_PAY_INFO=3022]="DY_PAY__INVALID_JSAPI_PAY_INFO",L[L.DY_PAY__JSAPI_SIGNATURE_FAILED=3023]="DY_PAY__JSAPI_SIGNATURE_FAILED",L[L.DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED=3024]="DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED",L[L.DY_PAY__JSAPI_UNSUPPORTED_ENV=3025]="DY_PAY__JSAPI_UNSUPPORTED_ENV",L[L.DY_PAY__JSAPI_AUTH_REDIRECT_FAILED=3026]="DY_PAY__JSAPI_AUTH_REDIRECT_FAILED",L[L.DY_PAY__JSAPI_SDK_LOAD_FAILED=3027]="DY_PAY__JSAPI_SDK_LOAD_FAILED",L[L.DY_PAY__JSAPI_CONFIG_FAILED=3028]="DY_PAY__JSAPI_CONFIG_FAILED",L[L.DY_PAY__JSAPI_INVOKE_FAILED=3029]="DY_PAY__JSAPI_INVOKE_FAILED",L[L.DY_PAY__MISSING_AUTH_TOKEN=3030]="DY_PAY__MISSING_AUTH_TOKEN",L[L.DY_PAY_COMMAND__MISSING_ORDER_AMOUNT=3031]="DY_PAY_COMMAND__MISSING_ORDER_AMOUNT",L[L.DY_PAY_COMMAND__GET_FAILED=3032]="DY_PAY_COMMAND__GET_FAILED",L[L.DY_PAY_COMMAND__REQUEST_FAILED=3033]="DY_PAY_COMMAND__REQUEST_FAILED",L[L.DY_PAY_COMMAND__COPY_FAILED=3034]="DY_PAY_COMMAND__COPY_FAILED",L[L.DY_PAY_COMMAND__INVALID_RTA_DATA=3035]="DY_PAY_COMMAND__INVALID_RTA_DATA",L))(_e||{}),gt={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"};var Gr=(e,o,s,p)=>{let y=oe();if(y==="taro")return Taro.request({url:e,method:o,data:s,header:p}).then(E=>E);if(y==="uni")return new Promise((E,U)=>{uni.request({url:e,method:o,data:s,header:p,success:M=>E(M),fail:M=>U(M)})});if(y==="wechat")return new Promise((E,U)=>{wx.request({url:e,method:o,data:s,header:p,success:M=>E(M),fail:M=>U(M)})});if(y==="alipay")return new Promise((E,U)=>{my.request({url:e,method:o,data:s,headers:p,success:M=>E(M),fail:M=>U(M)})});let g=o.toUpperCase()==="GET",A=g&&s&&Object.keys(s).length?`${e}?${new URLSearchParams(s).toString()}`:e;return fetch(A,{method:o,headers:p,body:g?void 0:JSON.stringify(s)}).then(async E=>({statusCode:E.status,data:await E.json()}))},an=class{constructor(o=null){Be(this,"staticConfig");this.staticConfig=o}getCurrentConfig(){return this.staticConfig||pe()||Re}async getAuthToken(){let o=this.getCurrentConfig();if(o.getAuthToken&&typeof o.getAuthToken=="function")try{let s=await o.getAuthToken();return s?(w.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),s):(w.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(s){return w.error("\u83B7\u53D6Token\u5931\u8D25",s),null}return null}async buildHeader(o={},s=!0){let p=ut({"content-type":"application/json"},o);if(!s)return p;let y=await this.getAuthToken();if(!y)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 p.Authorization_bar=y,p}async request(o){let{path:s,method:p="POST",data:y={},header:g={},authRequired:A=!0,baseDomain:E,beforeRequest:U,afterResponse:M}=o,it=E?`${E}${s}`:He(this.getCurrentConfig().env||"prod",s),tt=await this.buildHeader(g,A);U&&typeof U=="function"&&await U({url:it,method:p,data:y,header:tt}),w.info(`\u53D1\u8D77${p}\u8BF7\u6C42:`,{path:s,method:p});try{let z=await Gr(it,p,y,tt);return w.info("\u8BF7\u6C42\u6210\u529F:",{path:s,statusCode:z.statusCode}),M&&typeof M=="function"&&await M(z.data),z.data}catch(z){throw w.error("\u8BF7\u6C42\u5931\u8D25:",{path:s,error:z}),z}}get(o,s={},p={}){return this.request(ut({path:o,method:"GET",data:s},p))}post(o,s={},p={}){return this.request(ut({path:o,method:"POST",data:s},p))}},Te=(e=null)=>new an(e);var Kr=(function(){"use strict";function e(P,et){var _t=(65535&P)+(65535&et);return(P>>16)+(et>>16)+(_t>>16)<<16|65535&_t}function o(P,et,_t,at,H,wt){return e((wt=e(e(et,P),e(at,wt)))<<H|wt>>>32-H,_t)}function s(P,et,_t,at,H,wt,R){return o(et&_t|~et&at,P,et,H,wt,R)}function p(P,et,_t,at,H,wt,R){return o(et&at|_t&~at,P,et,H,wt,R)}function y(P,et,_t,at,H,wt,R){return o(et^_t^at,P,et,H,wt,R)}function g(P,et,_t,at,H,wt,R){return o(_t^(et|~at),P,et,H,wt,R)}function A(P,et){var _t,at,H,wt;P[et>>5]|=128<<et%32,P[14+(et+64>>>9<<4)]=et;for(var R=1732584193,b=-271733879,F=-1732584194,C=271733878,D=0;D<P.length;D+=16)R=s(_t=R,at=b,H=F,wt=C,P[D],7,-680876936),C=s(C,R,b,F,P[D+1],12,-389564586),F=s(F,C,R,b,P[D+2],17,606105819),b=s(b,F,C,R,P[D+3],22,-1044525330),R=s(R,b,F,C,P[D+4],7,-176418897),C=s(C,R,b,F,P[D+5],12,1200080426),F=s(F,C,R,b,P[D+6],17,-1473231341),b=s(b,F,C,R,P[D+7],22,-45705983),R=s(R,b,F,C,P[D+8],7,1770035416),C=s(C,R,b,F,P[D+9],12,-1958414417),F=s(F,C,R,b,P[D+10],17,-42063),b=s(b,F,C,R,P[D+11],22,-1990404162),R=s(R,b,F,C,P[D+12],7,1804603682),C=s(C,R,b,F,P[D+13],12,-40341101),F=s(F,C,R,b,P[D+14],17,-1502002290),R=p(R,b=s(b,F,C,R,P[D+15],22,1236535329),F,C,P[D+1],5,-165796510),C=p(C,R,b,F,P[D+6],9,-1069501632),F=p(F,C,R,b,P[D+11],14,643717713),b=p(b,F,C,R,P[D],20,-373897302),R=p(R,b,F,C,P[D+5],5,-701558691),C=p(C,R,b,F,P[D+10],9,38016083),F=p(F,C,R,b,P[D+15],14,-660478335),b=p(b,F,C,R,P[D+4],20,-405537848),R=p(R,b,F,C,P[D+9],5,568446438),C=p(C,R,b,F,P[D+14],9,-1019803690),F=p(F,C,R,b,P[D+3],14,-187363961),b=p(b,F,C,R,P[D+8],20,1163531501),R=p(R,b,F,C,P[D+13],5,-1444681467),C=p(C,R,b,F,P[D+2],9,-51403784),F=p(F,C,R,b,P[D+7],14,1735328473),R=y(R,b=p(b,F,C,R,P[D+12],20,-1926607734),F,C,P[D+5],4,-378558),C=y(C,R,b,F,P[D+8],11,-2022574463),F=y(F,C,R,b,P[D+11],16,1839030562),b=y(b,F,C,R,P[D+14],23,-35309556),R=y(R,b,F,C,P[D+1],4,-1530992060),C=y(C,R,b,F,P[D+4],11,1272893353),F=y(F,C,R,b,P[D+7],16,-155497632),b=y(b,F,C,R,P[D+10],23,-1094730640),R=y(R,b,F,C,P[D+13],4,681279174),C=y(C,R,b,F,P[D],11,-358537222),F=y(F,C,R,b,P[D+3],16,-722521979),b=y(b,F,C,R,P[D+6],23,76029189),R=y(R,b,F,C,P[D+9],4,-640364487),C=y(C,R,b,F,P[D+12],11,-421815835),F=y(F,C,R,b,P[D+15],16,530742520),R=g(R,b=y(b,F,C,R,P[D+2],23,-995338651),F,C,P[D],6,-198630844),C=g(C,R,b,F,P[D+7],10,1126891415),F=g(F,C,R,b,P[D+14],15,-1416354905),b=g(b,F,C,R,P[D+5],21,-57434055),R=g(R,b,F,C,P[D+12],6,1700485571),C=g(C,R,b,F,P[D+3],10,-1894986606),F=g(F,C,R,b,P[D+10],15,-1051523),b=g(b,F,C,R,P[D+1],21,-2054922799),R=g(R,b,F,C,P[D+8],6,1873313359),C=g(C,R,b,F,P[D+15],10,-30611744),F=g(F,C,R,b,P[D+6],15,-1560198380),b=g(b,F,C,R,P[D+13],21,1309151649),R=g(R,b,F,C,P[D+4],6,-145523070),C=g(C,R,b,F,P[D+11],10,-1120210379),F=g(F,C,R,b,P[D+2],15,718787259),b=g(b,F,C,R,P[D+9],21,-343485551),R=e(R,_t),b=e(b,at),F=e(F,H),C=e(C,wt);return[R,b,F,C]}function E(P){for(var et="",_t=32*P.length,at=0;at<_t;at+=8)et+=String.fromCharCode(P[at>>5]>>>at%32&255);return et}function U(P){var et=[];for(et[(P.length>>2)-1]=void 0,at=0;at<et.length;at+=1)et[at]=0;for(var _t=8*P.length,at=0;at<_t;at+=8)et[at>>5]|=(255&P.charCodeAt(at/8))<<at%32;return et}function M(P){for(var et,_t="0123456789abcdef",at="",H=0;H<P.length;H+=1)et=P.charCodeAt(H),at+=_t.charAt(et>>>4&15)+_t.charAt(15&et);return at}function it(P){return unescape(encodeURIComponent(P))}function tt(P){return E(A(U(P=it(P)),8*P.length))}function z(P,et){return(function(_t,at){var H,wt=U(_t),R=[],b=[];for(R[15]=b[15]=void 0,16<wt.length&&(wt=A(wt,8*_t.length)),H=0;H<16;H+=1)R[H]=909522486^wt[H],b[H]=1549556828^wt[H];return at=A(R.concat(U(at)),512+8*at.length),E(A(b.concat(at),640))})(it(P),it(et))}function zt(P,et,_t){return et?_t?z(et,P):M(z(et,P)):_t?tt(P):M(tt(P))}return zt})(),Fe=Kr;function Ln(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function xn(e){if(typeof e!="object"||e===null)return e;let o=Object.keys(e).sort(),s={};for(let p of o)s[p]=e[p];return JSON.stringify(s)}function Yn(e,o){let s={appId:e.appId,randomStr:e.randomStr,data:e.data},p=Object.keys(s).sort(),y="";for(let[g,A]of p.entries())y+=`${A}=${s[A]}`,g<p.length-1&&(y+="&");return y+=`&secretKey=${o}`,Fe(y)}var Xr=(e,o,s,p)=>{let y=oe();return y==="taro"?Taro.request({url:e,method:o,data:s,header:p}).then(g=>g):y==="uni"?new Promise((g,A)=>{uni.request({url:e,method:o,data:s,header:p,success:E=>g(E),fail:E=>A(E)})}):y==="wechat"?new Promise((g,A)=>{wx.request({url:e,method:o,data:s,header:p,success:E=>g(E),fail:E=>A(E)})}):y==="alipay"?new Promise((g,A)=>{my.request({url:e,method:o,data:s,headers:p,success:E=>g(E),fail:E=>A(E)})}):fetch(e,{method:o,headers:p,body:JSON.stringify(s)}).then(async g=>({statusCode:g.status,data:await g.json()}))},sn=class{constructor(o=null){Be(this,"staticConfig");this.staticConfig=o}getCurrentConfig(){return this.staticConfig||pe()||{}}getExternalEnv(){var o;return((o=this.getCurrentConfig())==null?void 0:o.externalEnv)||le.PROD}getExternalHost(){let o=this.getExternalEnv();return Ne[o]||Ne.prod}generateSign(o={}){let s=this.getCurrentConfig(),{externalAppId:p,externalAppSecret:y}=s;if(!p||!y)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let g=Ln(),A=xn(o),E=Yn({appId:p,randomStr:g,data:A},y);return{appId:p,randomStr:g,sign:E}}buildRequestBody(o={}){let s=this.generateSign(o);return Wt(ut({},s),{data:o})}buildUrl(o){return`${this.getExternalHost()}${o}`}async request(o){let{path:s,method:p="POST",data:y={},header:g={},needSign:A=!0,beforeRequest:E,afterResponse:U}=o,M=this.buildUrl(s),it=ut({"content-type":"application/json"},g),tt=A?this.buildRequestBody(y):y;E&&typeof E=="function"&&await E({url:M,method:p,data:tt,header:it}),w.info(`\u53D1\u8D77${p}\u8BF7\u6C42:`,{path:s,method:p});try{let z=await Xr(M,p,tt,it);if(w.info("\u8BF7\u6C42\u6210\u529F:",{path:s,statusCode:z.statusCode}),U&&typeof U=="function"&&await U(z.data),z.statusCode===200&&z.data.code===200)return z.data.data;throw{code:z.data.code,msg:z.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:z.data}}catch(z){throw(z==null?void 0:z.code)!==void 0?z:(w.error("\u8BF7\u6C42\u5931\u8D25:",{path:s,error:z}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:z})}}get(o,s={},p={}){return this.request(ut({path:o,method:"GET",data:s},p))}post(o,s={},p={}){return this.request(ut({path:o,method:"POST",data:s},p))}},Un=(e=null)=>new sn(e);var un=Te(),cn=Un();function Mn(e){let o=Ge(e==null?void 0:e.equipmentValue,"equipmentValue");return o.valid?un.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",e):Promise.reject({code:"PARAM_ERROR",message:o.message})}async function Jn(e){let o=Oe(e,["idMd5Value","rtaStrategy"]);return o.valid?cn.post("/open/rest/cpa/jd/rta-check",e):Promise.reject({code:"PARAM_ERROR",message:o.message})}async function kn(e){try{let o={thirdPlatform:e.thirdPlatform,thirdPlatformUserId:e.thirdPlatformUserId,thirdPlatformEquipmentValue:e.thirdPlatformEquipmentValue,os:e.os,client:"wxMini"};e.phone&&(o.mobileMd5=Fe(e.phone)),e.extendData&&(Object.prototype.toString.call(e.extendData)==="[object Object]"?o.extendData=e.extendData:w.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let s=await cn.post("/open/rest/cpa/jd/insurance/get",o);return s?s.jumpMode==1?{jumpMode:1,appId:s.appId,url:s.url}:{jumpMode:2,url:s.url,channel:s.channelId}:void 0}catch(o){throw w.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",o),o}}function jn(e){let o=Ge(e==null?void 0:e.equipmentValue,"equipmentValue");return o.valid?un.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",e):Promise.reject({code:"PARAM_ERROR",message:o.message})}function qn(e){let o=Oe(e,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return o.valid?un.post("/gw/advert/customer/cpa-activity/jd/rta/validate",e):Promise.reject({code:"PARAM_ERROR",message:o.message})}async function Bn(e){let o=await De(),s={thirdPlatform:e.thirdPlatform,thirdPlatformUserId:e.thirdPlatformUserId,thirdPlatformEquipmentValue:e.thirdPlatformEquipmentValue,os:o,client:e.client};return e.phone&&(s.mobileMd5=Fe(e.phone)),e.extendData&&(Object.prototype.toString.call(e.extendData)==="[object Object]"?s.extendData=e.extendData:w.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),cn.post("/open/rest/cpa/jd/cash-loan/get",s)}async function ln(e){let{phone:o,rtaId:s,equipmentId:p,lyyUserId:y,entrance:g}=e;if(!o)return k(Yt.INVALID_PARAM,bt[2001]);if(!p)return k(Yt.INVALID_PARAM,bt[2002]);try{if(s){w.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:o});let tt=await qn({phone:o,lyyEquipmentValue:p,lyyUserId:y||"",rtaId:s});if(tt.code!=="0000000"||!tt.body||tt.body.state!=1)return w.error("RTA\u9A8C\u8BC1\u5931\u8D25",tt),k(2003,bt[2003]);w.info("RTA\u9A8C\u8BC1\u6210\u529F",tt.body)}w.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:o});let A=await De(),E=await jn({phone:o,equipmentValue:p,os:A,entrance:g});if(E.code!=="0000000"||!E.body)return w.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",E),k(2004,bt[2004]);let{appId:U,targetUrl:M}=E.body;if(!U||!M)return w.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:U,targetUrl:M}),k(2005,bt[2005]);let it=k(Yt.SUCCESS,"\u6210\u529F",{appId:U,targetUrl:M});return w.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",it),it}catch(A){return w.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",A),k(Yt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function fn(e){let{phone:o,rtaId:s,thirdPlatform:p,thirdPlatformUserId:y,thirdPlatformEquipmentValue:g}=e;if(!o)return k(Yt.INVALID_PARAM,bt[2001]);if(!p)return k(2008,bt[2008]);if(!y)return k(2009,bt[2009]);if(!g)return k(2010,bt[2010]);try{if(s){w.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:o});let z=await Jn({idMd5Value:o,rtaStrategy:s});if(z.status!=1)return w.error("RTA\u9A8C\u8BC1\u5931\u8D25",z),k(2003,bt[2003]);w.info("RTA\u9A8C\u8BC1\u6210\u529F",z)}let A=await Bn(e),{url:E,channelId:U,matchFlag:M,jumpMode:it,appId:tt}=A||{};return M?it===3?!tt||!E?k(2007,bt[2007]):k(Yt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:tt,url:E}):k(2007,bt[2007]):k(2006,bt[2006])}catch(A){return w.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",A),k(Yt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var we=null,Le=null;try{Le=Hn()}catch(e){}function Gn(){return we||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(we=globalThis.LyyGetCommandSDK,we):Le?(we=Le.LyyGetCommandSDK||Le.default||Le,we):null)}function Kn(e){var s;w.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",e);let o=Gn();o!=null&&o.getJrCommand?o.getJrCommand(e):(s=o==null?void 0:o.default)!=null&&s.getJrCommand?o.default.getJrCommand(e):(w.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),e.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function Wr(e,o){return new Promise((s,p)=>{try{Kn({url:e,channel:o,callback:y=>{y.code==="0"?s(y.data):p({msg:y.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(y){p(y)}})}async function dn(e){try{let o=await De(),s=ut({os:o},e);w.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",s);let{code:p,body:y}=await Mn(s);if(p==="0000000"&&y){let{url:g,channelId:A,matchFlag:E,jumpMode:U,appId:M}=y;if(!E)return k(2101,bt[2101]);if(U===1)return w.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),k(2102,bt[2102]);if(U===2)return oe()==="web"&&w.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:g}),!g||!A?k(2103,bt[2103]):new Promise(it=>{Kn({url:g,channel:A,callback:async tt=>{if((tt==null?void 0:tt.code)==="0")try{await Ce(tt==null?void 0:tt.data),it(k(Yt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(z){it(k(2105,bt[2105]))}else it(k(2105,bt[2105]))}})});if(U===3)return!M||!g?k(2103,bt[2103]):k(Yt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:M,path:g})}return k(2104,bt[2104])}catch(o){return w.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",o),k(Yt.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 o=await kn(Wt(ut({},e),{os:await De()}));if(!o)return w.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),k(2106,bt[2106]);if(o.jumpMode===1)return w.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:o.appId,url:o.url}),k(Yt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:o.appId,path:o.url});if(o.jumpMode===2){if(oe()==="web")return w.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:o.url}),k(Yt.SUCCESS,"\u6210\u529F",{type:"h5",url:o.url});try{let s=await Wr(o.url,o.channel);return await Ce(s),w.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),k(Yt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(s){return w.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",s),on("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),k(2105,bt[2105])}}return w.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",o.jumpMode),k(2107,bt[2107])}catch(o){let s=typeof o=="string"?o:(o==null?void 0:o.msg)||(o==null?void 0:o.message)||"\u672A\u77E5\u9519\u8BEF";return w.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",s),on("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),s.includes("RTA")||s.includes("\u8D44\u683C")?k(2108,bt[2108]):k(Yt.NETWORK_ERROR,s)}}var mn={};qe(mn,{DyErrorCode:()=>_e,getDyPayRtaData:()=>Qe,handleDyJsapiPayFlow:()=>_n,handleDyPayCommandFlow:()=>hn,handleDyPayFlow:()=>We});var Qr=["weapp","h5"],$r=["h5","ulink","jsapi"],zr=["switchTab","reLaunch","redirectTo","navigateTo"];function Zr(e){return Qr.includes(e)}function to(e){return $r.includes(e)}function eo(e){return zr.includes(e)}function Xn(e){let o=e.returnType||"h5";return!e.telephone&&o==="h5"?{valid:!1,errorCode:3001}:e.price?e.equipmentValue?e.businessType?e.client&&!Zr(e.client)?{valid:!1,errorCode:3004}:to(o)?e.douyinOrderExtendData&&typeof e.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:e.backWay&&e.client==="weapp"&&!eo(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 Wn(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 Qn(e){return e.equipmentValue?{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function $n(e){return e.telephone?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}:{valid:!1,errorCode:3001}}function zn(e){return e.telephone?e.equipmentValue?e.commandUrl!=null&&typeof e.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3001}}function Zn(e){return e.showFlag===!0&&typeof e.payAmount=="number"&&e.payAmount>0&&typeof e.businessType=="number"&&e.businessType>0}var be=Te();async function tr(e){let{price:o,equipmentValue:s,douyinOrderExtendData:p,douyinCommodityVirtualFlag:y,businessType:g,platformActivities:A={}}=e,E={businessType:g,equipmentValue:s,payInfoBusinessType:"commonDouyinPayment",platformActivities:ut({douyinCommodityVirtualFlag:y||!1,douyinCommodityPrice:o,douyinOrderExtendData:p||""},A)};try{let U=await be.post("/gw/advert/customer/payment/pay-info",E);return U.code!=="0000000"||!(U!=null&&U.body)?Promise.reject({code:3006,message:U.message||gt[3006]}):(U.body.platformActivities=E.platformActivities,U)}catch(U){return w.error("getDyOrderAmountFn error:",U),Promise.reject({code:3007,message:gt[3007]})}}async function er(e){var o,s;try{let p=e.commodityList.map(tt=>(tt.commodity=tt.commodityId,delete tt.commodityId,tt.quantity=tt.quantity||1,tt)),y=e.advertExtendInfo&&Object.keys(e.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:e.advertExtendInfo}):"",g=oe(),A="";g==="wechat"?A="wechatMini":g==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(A="wechatHtml");let E=e.returnType==="jsapi",U=E?22:21,M=ut(ut(ut({businessType:e.businessType,fixedClientType:U,channelCode:null,douyinData:{loginMobile:e.telephone||""},equipmentUseFlag:!0,payEquipmentDTO:{equipmentValue:e.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:y,transType:5,actualFee:e.totalFee,totalFee:e.totalFee,commodityList:p,clientSourceDetailType:A,platformActivities:e.platformActivities||{}},e.commoditySign&&{commoditySign:e.commoditySign}),e.unifiedOrderExtendData&&ut({},e.unifiedOrderExtendData)),E?{appId:((o=e.jsapiInfo)==null?void 0:o.appId)||"",openId:((s=e.jsapiInfo)==null?void 0:s.douyinOpenId)||""}:{});e.returnType=="ulink"&&(delete M.channelCode,delete M.douyinData,delete M.clientSourceDetailType,delete M.platformActivities.douyinCommodityVirtualFlag,delete M.platformActivities.douyinCommodityPrice,delete M.platformActivities.douyinOrderExtendData);let it=await be.post("/gw/payment-bff/unified/order",M);return it.code!=="0000000"||!(it!=null&&it.body)?Promise.reject({code:3008,message:it.message||gt[3008]}):it}catch(p){return w.error("dyUnifiedOrderFn error:",p),Promise.reject({code:3009,message:gt[3009]})}}async function nr(e){let o={equipmentValue:e.equipmentValue,phone:e.telephone||""};e.price&&(o.orderAmount=e.price);try{let s=await be.post("/gw/advert/customer/douyin/pay/check",o);return s.code!=="0000000"||!(s!=null&&s.body)?Promise.reject({code:3013,message:s.message||gt[3013]}):s}catch(s){return w.error("getDyPayRtaData error:",s),Promise.reject({code:3014,message:(s==null?void 0:s.message)||gt[3014]})}}async function rr(){try{let e=await be.get("/gw/advert/customer/douyin/pay/jsapi/info");return e.code!=="0000000"||!(e!=null&&e.body)?Promise.reject({code:3019,message:e.message||gt[3019]}):{appId:e.body.appId,douyinOpenId:e.body.douyinOpenId}}catch(e){return w.error("getDyPayJsapiInfoFn error:",e),Promise.reject({code:(e==null?void 0:e.code)||3020,message:(e==null?void 0:e.message)||gt[3020]})}}async function or(e){try{let o=await be.post("/gw/advert/customer/douyin/pay/jsapi/signature",e);return o.code!=="0000000"||!(o!=null&&o.body)||!o.body.signature||!o.body.timestamp||!o.body.nonceStr?Promise.reject({code:3023,message:o.message||gt[3023]}):{signature:o.body.signature,timestamp:o.body.timestamp,nonceStr:o.body.nonceStr}}catch(o){return w.error("getDyPayJsapiSignatureFn error:",o),Promise.reject({code:(o==null?void 0:o.code)||3024,message:(o==null?void 0:o.message)||gt[3024]})}}async function ir(e){try{let o=await be.post("/gw/advert/customer/douyin/pay-command",e);return o.code!=="0000000"||!(o!=null&&o.body)?Promise.reject({code:3032,message:o.message||gt[3032]}):o}catch(o){return w.error("getDyPayCommandFn error:",o),Promise.reject({code:(o==null?void 0:o.code)||3033,message:(o==null?void 0:o.message)||gt[3033]})}}var no="/auth/rest/auth/third",ar="url_token",ro="https://unpkg.byted-static.com/bridge/douyin_open/1.0.17/lib/douyin_open.umd.js",xe=null;function qt(e,o){let s=new Error(o||gt[e]);return Object.assign(s,{code:e})}function Ye(){return typeof window!="undefined"&&typeof document!="undefined"}function sr(){return Ye()?window.location.href:""}function ur(e){let{href:o,paramName:s}=e;if(!o||!s)return o;let p=o.indexOf("#"),y=p>=0?o.slice(0,p):o,g=p>=0?o.slice(p):"";try{let A=new URL(y,io()),E=ao(y);return A.searchParams.delete(s),`${E?`${A.pathname}${A.search}`:A.toString()}${g}`}catch(A){return w.warn("removeDyUrlParam parse error:",A),co(o,s)}}function cr(e={}){let s=(e.href||sr()).split("#")[0]||"";return ur({href:s,paramName:e.tokenParamName||ar})}function oo(e){var y,g;if(!e.equipmentValue)throw qt(3002);let o=e.tokenParamName||ar,s=ur({href:e.redirectUrl||sr(),paramName:o});if(!s)throw qt(3025);let p=new URLSearchParams({useAgent:e.useAgent||"douyin",category:e.category||"pay",internal:String((y=e.internal)!=null?y:!1),silent:String((g=e.silent)!=null?g:!1),equipmentValue:e.equipmentValue,redirectUrl:s});return`${e.authPath||no}?${p.toString()}`}function lr(e){if(!Ye())throw qt(3025);let o=oo(e);w.info("\u8DF3\u8F6C\u6296\u97F3\u6388\u6743:",{authUrl:o,equipmentValue:e.equipmentValue});try{return window.location.href=o,o}catch(s){throw w.error("redirectDyAuth error:",s),qt(3026)}}function Xe(){if(!Ye())return null;let e=window;return e.DouyinOpenJSBridge||e.douyin_open||null}function fr(e={}){if(!Ye())return Promise.reject(qt(3025));let o=Xe();if(o)return w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5DF2\u52A0\u8F7D"),Promise.resolve(o);if(xe)return w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u590D\u7528\u52A0\u8F7D\u4E2D\u4EFB\u52A1"),xe;let s=e.sdkUrl||ro;return w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5F00\u59CB\u52A0\u8F7D",{sdkUrl:s}),xe=new Promise((p,y)=>{let g=so(s),A=()=>{let M=Xe();if(!M){y(qt(3027));return}w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u6210\u529F"),p(M)},E=M=>{w.error("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u5931\u8D25",M),y(qt(3027))};if(g){if(w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u811A\u672C\u5DF2\u5B58\u5728"),uo(g)){window.setTimeout(A,0);return}g.addEventListener("load",A,{once:!0}),g.addEventListener("error",E,{once:!0});return}let U=document.createElement("script");U.src=s,U.async=!0,U.addEventListener("load",A,{once:!0}),U.addEventListener("error",M=>{U.remove(),E(M)},{once:!0}),document.head.appendChild(U)}).catch(p=>{throw xe=null,p}),xe}function dr(e){let o=e.sdk||Xe();if(!o)return Promise.reject(qt(3027));let{appId:s,signatureData:p,url:y}=e;return!s||!y||!(p!=null&&p.signature)||!(p!=null&&p.timestamp)||!(p!=null&&p.nonceStr)?Promise.reject(qt(3028)):new Promise((g,A)=>{w.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u5F00\u59CB\u914D\u7F6E",{appId:s,url:y});try{o.config({params:{client_key:s,signature:p.signature,timestamp:String(p.timestamp),nonce_str:p.nonceStr,url:y}}),o.ready(()=>{w.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5B8C\u6210"),g(o)}),o.error(E=>{w.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5931\u8D25",E),A(qt(3028))})}catch(E){w.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5F02\u5E38",E),A(qt(3028))}})}function yr(e){let o=e.sdk||Xe();if(!o)return Promise.reject(qt(3027));if(!o.ttcjpay||typeof o.ttcjpay.dypay!="function")return Promise.reject(qt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));let{appId:s,payInfo:p}=e;if(!s||!p)return Promise.reject(qt(3021));let y={appId:s,timeStamp:String(p.timeStamp),nonceStr:p.nonceStr,package:p.package,signType:p.signType,paySign:p.paySign};return new Promise((g,A)=>{w.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528 dypay");try{o.ttcjpay.dypay({sdk_info:JSON.stringify(y),success:E=>{if(w.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u6210\u529F\u56DE\u8C03",E),(E==null?void 0:E.code)===-2){A(qt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}g(E)},fail:E=>{if(w.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u5931\u8D25\u56DE\u8C03",E),(E==null?void 0:E.code)===-2){A(qt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}A(qt(3029,(E==null?void 0:E.message)||(E==null?void 0:E.errMsg)))}})}catch(E){w.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528\u5F02\u5E38",E),A(qt(3029,E==null?void 0:E.message))}})}function io(){return Ye()?window.location.origin:"https://bi-nova.local"}function ao(e){return!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)&&!e.startsWith("//")}function so(e){return Array.from(document.getElementsByTagName("script")).find(s=>s.src===e)||null}function uo(e){let o=e.readyState;return o==="loaded"||o==="complete"}function co(e,o){let s=e.indexOf("#"),p=s>=0?e.slice(0,s):e,y=s>=0?e.slice(s):"",g=p.indexOf("?");if(g<0)return e;let A=p.slice(0,g),U=p.slice(g+1).split("&").filter(M=>M&&decodeURIComponent(M.split("=")[0])!==o).join("&");return`${A}${U?`?${U}`:""}${y}`}async function We(e){var s,p,y,g;let o=Xn(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let A=e.returnType||"h5",E=await tr({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}),U=A==="jsapi"?await rr():void 0,M=await er(Wt(ut(Wt(ut({},E.body),{telephone:e.telephone,equipmentValue:e.equipmentValue,businessType:e.businessType}),e.unifiedOrderExtendData&&{unifiedOrderExtendData:e.unifiedOrderExtendData}),{returnType:A,jsapiInfo:U})),it=((s=M==null?void 0:M.body)==null?void 0:s.h5Url)||"",tt=((p=M==null?void 0:M.body)==null?void 0:p.outTradeNo)||"";if(A==="ulink"){let zt=it?await po(Wt(ut({},e),{dyUrl:it})):"";return zt?k(0,"success",{ulinkUrl:zt,outTradeNo:tt}):k(3010,gt[3010])}if(A==="jsapi"){let zt=lo((y=M==null?void 0:M.body)==null?void 0:y.payInfo);return k(0,"success",{appId:(U==null?void 0:U.appId)||"",payInfo:zt,outTradeNo:tt})}let z=it?await yo(Wt(ut({},e),{dyUrl:it})):"";return z?k(0,"success",{h5Url:z,outTradeNo:tt}):k(3010,gt[3010])}catch(A){w.error("handleDyPayFlow error:",A);let E=(g=A==null?void 0:A.code)!=null?g:3012,U=(A==null?void 0:A.message)||gt[3012];return k(E,U)}}function lo(e){if(!e)throw{code:3021,message:gt[3021]};try{let o=JSON.parse(e);if(!fo(o))throw new Error("invalid payInfo fields");return o}catch(o){throw{code:3022,message:gt[3022],error:o}}}function fo(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 yo(e){let o=pe(),s=He(o.env||"prod",""),p=typeof o.getAuthToken=="function"?await o.getAuthToken():"",y=e.client||"weapp";return`${s}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${y}&equipmentId=${e.equipmentValue}&dyUrl=${e.dyUrl}&fromUrl=${encodeURIComponent(e.fromUrl||"")}&backUrl=${encodeURIComponent(e.backUrl||"")}&backWay=${e.backWay||""}&url_token=${p}`}async function po(e){return e.dyUrl+`${e.backUrl?"&return_url="+encodeURIComponent(e.backUrl||""):""}&jump_back_schema=${encodeURIComponent("weixin://")}`}async function Qe(e){var s;let o=Qn(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let p=await nr({price:(e==null?void 0:e.price)||"",equipmentValue:e.equipmentValue,telephone:(e==null?void 0:e.telephone)||""});return k(0,"success",p.body)}catch(p){w.error("getDyPayRtaData error:",p);let y=(s=p==null?void 0:p.code)!=null?s:3015,g=(p==null?void 0:p.message)||gt[3015];return k(y,g)}}async function pr(e){var s,p;let o=$n(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let y=(s=e.commandUrl)==null?void 0:s.trim(),A=(await ir(ut({phone:e.telephone,equipmentValue:e.equipmentValue,orderAmount:e.orderAmount,businessType:e.businessType},y?{commandUrl:y}:{}))).body||"";return A?k(0,"success",{command:A}):k(3032,gt[3032])}catch(y){w.error("getDyPayCommand error:",y);let g=(p=y==null?void 0:y.code)!=null?p:3033,A=(y==null?void 0:y.message)||gt[3033];return k(g,A)}}async function ho(e){var s;let o=await pr(e);if(o.code!==0||!((s=o.data)!=null&&s.command))return k(o.code,o.message);try{return await Ce(o.data.command),k(0,"success",ut({type:"copy_success"},e.returnCommand?{command:o.data.command}:{}))}catch(p){return w.error("copyDyPayCommand error:",p),k(3034,gt[3034])}}async function hn(e){var s,p,y;let o=zn(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let g=await Qe({telephone:e.telephone,equipmentValue:e.equipmentValue,price:e.price});if(g.code!==0)return k(g.code,g.message);let A=g.data;if(!(A!=null&&A.showFlag))return k(0,"success",{eligible:!1,type:"not_eligible"});if(!Zn(A))return k(3035,gt[3035]);let E={telephone:e.telephone,equipmentValue:e.equipmentValue,orderAmount:A.payAmount,businessType:A.businessType,commandUrl:e.commandUrl};if(e.autoCopy){let M=await ho(Wt(ut({},E),{returnCommand:e.returnCommand}));return M.code!==0?k(M.code,M.message):k(0,"success",ut({eligible:!0,type:"copy_success"},(s=M.data)!=null&&s.command?{command:M.data.command}:{}))}let U=await pr(E);return U.code!==0||!((p=U.data)!=null&&p.command)?k(U.code,U.message):k(0,"success",{eligible:!0,type:"command",command:U.data.command})}catch(g){w.error("handleDyPayCommandFlow error:",g);let A=(y=g==null?void 0:g.code)!=null?y:3033,E=(g==null?void 0:g.message)||gt[3033];return k(A,E)}}async function _n(e){var s,p,y;let o=Wn(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let g=pe(),A=e.authToken||(typeof g.getAuthToken=="function"?await g.getAuthToken():""),E=e.autoAuth!==!1;if(!A){if(!E)return k(3030,gt[3030]);let zt=lr({equipmentValue:e.equipmentValue,redirectUrl:e.redirectUrl,tokenParamName:e.tokenParamName});return k(0,"redirecting",{type:"auth_redirect",authUrl:zt})}let U=await fr({sdkUrl:e.sdkUrl}),M=await We(Wt(ut({},e),{client:"h5",returnType:"jsapi"}));if(M.code!==0||!((s=M.data)!=null&&s.appId)||!((p=M.data)!=null&&p.payInfo))return k(M.code||3021,M.message||gt[3021]);let it=e.signatureUrl||cr({tokenParamName:e.tokenParamName}),tt=await or({url:it});await dr({appId:M.data.appId,signatureData:tt,url:it,sdk:U});let z=await yr({appId:M.data.appId,payInfo:M.data.payInfo,sdk:U});return k(0,"success",{type:"pay_result",outTradeNo:M.data.outTradeNo,payResult:z})}catch(g){w.error("handleDyJsapiPayFlow error:",g);let A=(y=g==null?void 0:g.code)!=null?y:3029,E=(g==null?void 0:g.message)||gt[3029];return k(A,E)}}var vn={};qe(vn,{getDisplayAdConfig:()=>Dn,normalizeDisplayAdData:()=>$e});var _o=Te();function hr(e){let o=Oe(e,["placementId"]);if(!o.valid)return Promise.reject({code:"PARAM_ERROR",message:o.message});let s=pe().env||"prod";return _o.get(`/gw/advert-plugin/api/v1/config/list/valid/${e.placementId}`,{},{authRequired:!1,baseDomain:Cn(s)})}var _r=30*1e3,mo="__",An=new Map,gn=new Map;function go(e,o){return[e.appId||"",o,e.type||""].join(mo)}function Ao(e){let o=An.get(e);return o?o.expireAt<=Date.now()?(An.delete(e),w.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:e}),null):o.data:null}function Do(e,o){An.set(e,{data:o,expireAt:Date.now()+_r})}function vo(e){return Array.isArray(e==null?void 0:e.body)?e.body:[]}function Io(e){return String(e==null?void 0:e.code)!=="200"}function Po(e,o){let s=String(e||o||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(s)?s:o||"banner"}function mr(e){return String(e||"").trim().toLowerCase()}function Eo(e){var o;return!!e&&e.status!==0&&((o=e.platformConfig)==null?void 0:o.valid)!==!1}function So(e){return[...e].sort((o,s)=>{var g,A,E,U;let p=Number((g=o.priority)!=null?g:9999),y=Number((A=s.priority)!=null?A:9999);return p!==y?p-y:Number((E=s.weight)!=null?E:0)-Number((U=o.weight)!=null?U:0)})}function gr(e){return e.find(o=>mr(o.advertPlatform)==="gdt")||null}function Ar(e){return e.find(o=>mr(o.advertPlatform)!=="gdt")||null}function Ro(e,o){return e&&o?"mixed":e?"wechat":o?"custom":"none"}function To(e,o){var y,g;let s=gr(e),p=Ar(e);return s&&p?Number((y=s.priority)!=null?y:9999)<=Number((g=p.priority)!=null?g:9999)?"wechat-first":"custom-first":o==="custom"?"custom-only":o==="wechat"?"wechat-only":"wechat-first"}function wo(e){var s;let o=gr(e);return((s=o==null?void 0:o.platformConfig)==null?void 0:s.adId)||""}function bo(e){let o=Ar(e),s=o==null?void 0:o.platformConfig;if(!s)return null;let p=s.image||s.imageUrl||"",y=s.video||s.videoUrl||"",g=s.poster||p||"",A=s.jumpUrl||s.url||s.webUrl||"";return!p&&!y?null:{image:p||void 0,video:y||void 0,poster:g||void 0,title:s.title,description:s.description,buttonText:s.buttonText,badgeText:s.badgeText,jumpSeconds:s.jumpSeconds,loadTimeout:s.loadTimeout||s.timeout,muted:s.muted,adSpec:s.adSpec,url:A||void 0,action:A?{type:"web",url:A}:void 0}}function $e(e,o){let s=So(e.filter(Eo)),p=bo(s),y=wo(s),g=Po(void 0,o),A=Ro(y,p),E=To(s,A);return{show:!!(y||p),adId:"",type:g,provider:A,priority:E,unitId:y,customAd:p,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:e}}async function Dn(e){let o=e.placementId||e.adId||"",s=go(e,o),p=Ao(s);if(p)return w.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:s,placementId:o}),k(Yt.SUCCESS,"\u6210\u529F",p);let y=gn.get(s);if(y)return w.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:s,placementId:o}),y;let g=(async()=>{try{w.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",e);let A=await hr({placementId:o}),E=vo(A);if(w.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:s,placementId:o,response:A,body:E}),Io(A)||!E)return w.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",A),k(Yt.UNKNOWN_ERROR,(A==null?void 0:A.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let U=$e(E,e.type);return U.adId=o,U.cache=Wt(ut({},U.cache),{enable:!0,ttl:_r}),Do(s,U),w.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:s,placementId:o,provider:U.provider,priority:U.priority,hasUnitId:!!U.unitId,hasCustomAd:!!U.customAd}),k(Yt.SUCCESS,"\u6210\u529F",U)}catch(A){return w.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:s,placementId:o,error:A}),k(Yt.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{gn.delete(s)}})();return gn.set(s,g),g}function No(e={}){w.info("\u670D\u52A1\u521D\u59CB\u5316",e);let o=ut(ut({},Re),e);o.env&&!Ve[o.env]&&(w.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${o.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),o.env=Qt.PROD),o.externalEnv&&!Ne[o.externalEnv]&&(w.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${o.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),o.externalEnv=le.PROD),o.debug!==void 0&&w.setEnable(o.debug),Fn(o),w.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",o)}function Dr(e={}){let o="",s=null;async function p(){if(typeof e.getAuthToken=="function"){let g=await e.getAuthToken();if(g)return g}return s&&typeof s.getStorage=="function"&&s.getStorage("auth_token")||""}let y={name:"services",setToken(g){return o=g||"",s&&typeof s.setStorage=="function"&&s.setStorage("auth_token",o),y},async getAuthToken(){return o||p()},clearToken(){return o="",s&&typeof s.setStorage=="function"&&s.setStorage("auth_token",""),y},install(g){s=g;let A=Wt(ut({},e),{getAuthToken:()=>y.getAuthToken()});No(A),w.info("services installed via nova.use()"),Object.assign(g,{jd:ut({},pn),dy:ut({},mn),ads:ut({},vn),setToken:y.setToken,clearToken:y.clearToken})}};return y}0&&(module.exports={DyErrorCode,DyErrorMessage,ENV_TYPE,EXTERNAL_ENV_TYPE,JdErrorCode,JdErrorMessage,createServices,getDisplayAdConfig,getDyPayRtaData,handleDyJsapiPayFlow,handleDyPayCommandFlow,handleDyPayFlow,handleJdInsurance,handleJdInsuranceExt,handleJdjrCashLoanExt,handleJdjrCashLoanFlow,normalizeDisplayAdData});
|
|
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(r=0;r<u;r++)c+="=";return c},b4_decode:function(t){var r=0,u=0,c=(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length%4;if(2<c)return null;for(r=0;r<c;r++)if(t.charAt(t.length-r-1)!="=")return null;var h,_,S,O,N=new Array(3*(t.length-c)/4);for(r=0,u=0;u<N.length;)h=Et.indexOf(t.charAt(r++)),_=Et.indexOf(t.charAt(r++)),S=Et.indexOf(t.charAt(r++)),O=Et.indexOf(t.charAt(r++)),N[u++]=h<<2|_>>4,N[u++]=(15&_)<<4|S>>2,N[u++]=(3&S)<<6|O;for(r=0;r<c;r++)if(N.pop()!=0)return null;return N}};function ht(){}ht.encode=function(t,r,u){for(var c=new Array(2*u),h=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),_=r,S=0;_<u+r;_++,S++)c[S]=h[(255&t[_])>>4],c[++S]=h[15&t[_]];return c.join("")},ht.decode=function(t){if(t==null||t==""||t.length%2!=0)return null;for(var r=t.length/2,u=ht.toCharCodeArray(t),c=new Array(r),h=0;h<r;h++){if(48<=u[2*h]&&u[2*h]<=57)c[h]=u[2*h]-48<<4;else if(65<=u[2*h]&&u[2*h]<=70)c[h]=u[2*h]-65+10<<4;else{if(!(97<=u[2*h]&&u[2*h]<=102))return null;c[h]=u[2*h]-97+10<<4}if(48<=u[2*h+1]&&u[2*h+1]<=57)c[h]=c[h]|u[2*h+1]-48;else if(65<=u[2*h+1]&&u[2*h+1]<=70)c[h]=c[h]|u[2*h+1]-65+10;else{if(!(97<=u[2*h+1]&&u[2*h+1]<=102))return null;c[h]=c[h]|u[2*h+1]-97+10}}return c},ht.toCharCodeArray=function(t){for(var r=new Array(t.length),u=0;u<t.length;u++)r[u]=t.charCodeAt(u);return r};var Gt=ht,L=Gt;(Mt=function(){}).utf8StrToh6=function(t){t=encodeURIComponent(t);for(var r=unescape(t),u=r.length,c=[],h=0;h<u;h++)c[h]=r.charCodeAt(h).toString(16);return c.join("")},Mt.utf8StrToBytes=function(t){t=encodeURIComponent(t);for(var r=unescape(t),u=r.length,c=[],h=0;h<u;h++)c[h]=r.charCodeAt(h);return c},Mt.hexToUtf8Str=function(t){for(var r=L.decode(t),u=[],c=0;c<r.length;c++)u.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(u.join("")))},Mt.bytesToUtf8Str=function(t){for(var r=t,u=[],c=0;c<r.length;c++)u.push(String.fromCharCode(r[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,r){return r+3<t.length?t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]:r+2<t.length?t[r+1]<<16|t[r+2]<<8|t[r+3]:r+1<t.length?t[r]<<8|t[r+1]:t[r]};var Vt,Zt=Mt,Kt={exports:{}};Vt=Kt,function(){function t(n,i,a){n!=null&&(typeof n=="number"?this.fromNumber(n,i,a):i==null&&typeof n!="string"?this.fromString(n,256):this.fromString(n,i))}function r(){return new t(null)}var u=(u=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(t.prototype.am=function(n,i,a,f,v,x){for(var V=32767&i,J=i>>15;0<=--x;){var xt=32767&this[n],$t=this[n++]>>15,ce=J*xt+$t*V;v=((xt=V*xt+((32767&ce)<<15)+a[f]+(1073741823&v))>>>30)+(ce>>>15)+J*$t+(v>>>30),a[f++]=1073741823&xt}return v},30):u&&navigator.appName!="Netscape"?(t.prototype.am=function(n,i,a,f,v,x){for(;0<=--x;){var V=i*this[n++]+a[f]+v;v=Math.floor(V/67108864),a[f++]=67108863&V}return v},26):(t.prototype.am=function(n,i,a,f,v,x){for(var V=16383&i,J=i>>14;0<=--x;){var xt=16383&this[n],$t=this[n++]>>14,ce=J*xt+$t*V;v=((xt=V*xt+((16383&ce)<<14)+a[f]+v)>>28)+(ce>>14)+J*$t,a[f++]=268435455&xt}return v},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,h=48,_=0;_<=9;++_)c[h++]=_;for(h=97,_=10;_<36;++_)c[h++]=_;for(h=65,_=10;_<36;++_)c[h++]=_;function S(n){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(n)}function O(n,i){return(n=c[n.charCodeAt(i)])==null?-1:n}function N(n){var i=r();return i.fromInt(n),i}function st(n){var i,a=1;return(i=n>>>16)!=0&&(n=i,a+=16),(i=n>>8)!=0&&(n=i,a+=8),(i=n>>4)!=0&&(n=i,a+=4),(i=n>>2)!=0&&(n=i,a+=2),(i=n>>1)!=0&&(n=i,a+=1),a}function ct(n){this.m=n}function T(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 X(n,i){return n&i}function nt(n,i){return n|i}function Z(n,i){return n^i}function lt(n,i){return n&~i}function pt(){}function Ot(n){return n}function B(n){this.r2=r(),this.q3=r(),t.ONE.dlShiftTo(2*n.t,this.r2),this.mu=this.r2.divide(n),this.m=n}ct.prototype.convert=function(n){return n.s<0||0<=n.compareTo(this.m)?n.mod(this.m):n},ct.prototype.revert=function(n){return n},ct.prototype.reduce=function(n){n.divRemTo(this.m,null,n)},ct.prototype.mulTo=function(n,i,a){n.multiplyTo(i,a),this.reduce(a)},ct.prototype.sqrTo=function(n,i){n.squareTo(i),this.reduce(i)},T.prototype.convert=function(n){var i=r();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},T.prototype.revert=function(n){var i=r();return n.copyTo(i),this.reduce(i),i},T.prototype.reduce=function(n){for(;n.t<=this.mt2;)n[n.t++]=0;for(var i=0;i<this.m.t;++i){var a=32767&n[i],f=a*this.mpl+((a*this.mph+(n[i]>>15)*this.mpl&this.um)<<15)&n.DM;for(n[a=i+this.m.t]+=this.m.am(0,f,n,i,0,this.m.t);n[a]>=n.DV;)n[a]-=n.DV,n[++a]++}n.clamp(),n.drShiftTo(this.m.t,n),0<=n.compareTo(this.m)&&n.subTo(this.m,n)},T.prototype.mulTo=function(n,i,a){n.multiplyTo(i,a),this.reduce(a)},T.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 a;if(i==16)a=4;else if(i==8)a=3;else if(i==256)a=8;else if(i==2)a=1;else if(i==32)a=5;else{if(i!=4)return void this.fromRadix(n,i);a=2}this.t=0,this.s=0;for(var f=n.length,v=!1,x=0;0<=--f;){var V=a==8?255&n[f]:O(n,f);V<0?n.charAt(f)=="-"&&(v=!0):(v=!1,x==0?this[this.t++]=V:x+a>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+=a)>=this.DB&&(x-=this.DB))}a==8&&128&n[0]&&(this.s=-1,0<x&&(this[this.t-1]|=(1<<this.DB-x)-1<<x)),this.clamp(),v&&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 a=this.t-1;0<=a;--a)i[a+n]=this[a];for(a=n-1;0<=a;--a)i[a]=0;i.t=this.t+n,i.s=this.s},t.prototype.drShiftTo=function(n,i){for(var a=n;a<this.t;++a)i[a-n]=this[a];i.t=Math.max(this.t-n,0),i.s=this.s},t.prototype.lShiftTo=function(n,i){for(var a=n%this.DB,f=this.DB-a,v=(1<<f)-1,x=Math.floor(n/this.DB),V=this.s<<a&this.DM,J=this.t-1;0<=J;--J)i[J+x+1]=this[J]>>f|V,V=(this[J]&v)<<a;for(J=x-1;0<=J;--J)i[J]=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 a=Math.floor(n/this.DB);if(a>=this.t)i.t=0;else{var f=n%this.DB,v=this.DB-f,x=(1<<f)-1;i[0]=this[a]>>f;for(var V=a+1;V<this.t;++V)i[V-a-1]|=(this[V]&x)<<v,i[V-a]=this[V]>>f;0<f&&(i[this.t-a-1]|=(this.s&x)<<v),i.t=this.t-a,i.clamp()}},t.prototype.subTo=function(n,i){for(var a=0,f=0,v=Math.min(n.t,this.t);a<v;)f+=this[a]-n[a],i[a++]=f&this.DM,f>>=this.DB;if(n.t<this.t){for(f-=n.s;a<this.t;)f+=this[a],i[a++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;a<n.t;)f-=n[a],i[a++]=f&this.DM,f>>=this.DB;f-=n.s}i.s=f<0?-1:0,f<-1?i[a++]=this.DV+f:0<f&&(i[a++]=f),i.t=a,i.clamp()},t.prototype.multiplyTo=function(n,i){var a=this.abs(),f=n.abs(),v=a.t;for(i.t=v+f.t;0<=--v;)i[v]=0;for(v=0;v<f.t;++v)i[v+a.t]=a.am(0,f[v],i,v,0,a.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(),a=n.t=2*i.t;0<=--a;)n[a]=0;for(a=0;a<i.t-1;++a){var f=i.am(a,i[a],n,2*a,0,1);(n[a+i.t]+=i.am(a+1,2*i[a],n,2*a+1,f,i.t-a-1))>=i.DV&&(n[a+i.t]-=i.DV,n[a+i.t+1]=1)}0<n.t&&(n[n.t-1]+=i.am(a,i[a],n,2*a,0,1)),n.s=0,n.clamp()},t.prototype.divRemTo=function(n,i,a){var f=n.abs();if(!(f.t<=0)){if(($t=this.abs()).t<f.t)return i!=null&&i.fromInt(0),void(a!=null&&this.copyTo(a));a==null&&(a=r());var v=r(),x=this.s,V=n.s;0<(n=this.DB-st(f[f.t-1]))?(f.lShiftTo(n,v),$t.lShiftTo(n,a)):(f.copyTo(v),$t.copyTo(a));var J=v.t,xt=v[J-1];if(xt!=0){var $t=xt*(1<<this.F1)+(1<J?v[J-2]>>this.F2:0),ce=this.FV/$t,ye=(1<<this.F1)/$t,Se=1<<this.F2,Bt=a.t,Ae=Bt-J,jt=i==null?r():i;for(v.dlShiftTo(Ae,jt),0<=a.compareTo(jt)&&(a[a.t++]=1,a.subTo(jt,a)),t.ONE.dlShiftTo(J,jt),jt.subTo(v,v);v.t<J;)v[v.t++]=0;for(;0<=--Ae;){var nn=a[--Bt]==xt?this.DM:Math.floor(a[Bt]*ce+(a[Bt-1]+Se)*ye);if((a[Bt]+=v.am(0,nn,a,Ae,0,J))<nn)for(v.dlShiftTo(Ae,jt),a.subTo(jt,a);a[Bt]<--nn;)a.subTo(jt,a)}i!=null&&(a.drShiftTo(J,i),x!=V&&t.ZERO.subTo(i,i)),a.t=J,a.clamp(),0<n&&a.rShiftTo(n,a),x<0&&t.ZERO.subTo(a,a)}}},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 a,f=r(),v=r(),x=i.convert(this),V=st(n)-1;for(x.copyTo(f);0<=--V;)i.sqrTo(f,v),0<(n&1<<V)?i.mulTo(v,x,f):(a=f,f=v,v=a);return i.revert(f)},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 a,f=(1<<i)-1,v=!1,x="",V=this.t,J=this.DB-V*this.DB%i;if(0<V--)for(J<this.DB&&0<(a=this[V]>>J)&&(v=!0,x=S(a));0<=V;)J<i?(a=(this[V]&(1<<J)-1)<<i-J,a|=this[--V]>>(J+=this.DB-i)):(a=this[V]>>(J-=i)&f,J<=0&&(J+=this.DB,--V)),(v=0<a||v)&&(x+=S(a));return v?x:"0"},t.prototype.negate=function(){var n=r();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 a=this.t;if((i=a-n.t)!=0)return this.s<0?-i:i;for(;0<=--a;)if((i=this[a]-n[a])!=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=r();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()?ct:T)(i),this.exp(n,i)},t.ZERO=N(0),t.ONE=N(1),pt.prototype.convert=Ot,pt.prototype.revert=Ot,pt.prototype.mulTo=function(n,i,a){n.multiplyTo(i,a)},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=r();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,a){n.multiplyTo(i,a),this.reduce(a)},B.prototype.sqrTo=function(n,i){n.squareTo(i),this.reduce(i)};var Q,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 $(){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,en<=rt&&(rt-=en)}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),a=Math.pow(n,i),f=N(a),v=r(),x=r(),V="";for(this.divRemTo(f,v,x);0<v.signum();)V=(a+x.intValue()).toString(n).substr(1)+V,v.divRemTo(f,v,x);return x.intValue().toString(n)+V},t.prototype.fromRadix=function(n,i){this.fromInt(0);for(var a=this.chunkSize(i=i==null?10:i),f=Math.pow(i,a),v=!1,x=0,V=0,J=0;J<n.length;++J){var xt=O(n,J);xt<0?n.charAt(J)=="-"&&this.signum()==0&&(v=!0):(V=i*V+xt,++x>=a&&(this.dMultiply(f),this.dAddOffset(V,0),V=x=0))}0<x&&(this.dMultiply(Math.pow(i,x)),this.dAddOffset(V,0)),v&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(n,i,a){if(typeof i=="number")if(n<2)this.fromInt(1);else for(this.fromNumber(n,a),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 f=new Array;a=7&n,f.length=1+(n>>3),i.nextBytes(f),0<a?f[0]&=(1<<a)-1:f[0]=0,this.fromString(f,256)}},t.prototype.bitwiseTo=function(n,i,a){for(var f,v=Math.min(n.t,this.t),x=0;x<v;++x)a[x]=i(this[x],n[x]);if(n.t<this.t){for(f=n.s&this.DM,x=v;x<this.t;++x)a[x]=i(this[x],f);a.t=this.t}else{for(f=this.s&this.DM,x=v;x<n.t;++x)a[x]=i(f,n[x]);a.t=n.t}a.s=i(this.s,n.s),a.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 a=0,f=0,v=Math.min(n.t,this.t);a<v;)f+=this[a]+n[a],i[a++]=f&this.DM,f>>=this.DB;if(n.t<this.t){for(f+=n.s;a<this.t;)f+=this[a],i[a++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;a<n.t;)f+=n[a],i[a++]=f&this.DM,f>>=this.DB;f+=n.s}i.s=f<0?-1:0,0<f?i[a++]=f:f<-1&&(i[a++]=this.DV+f),i.t=a,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,a){var f,v=Math.min(this.t+n.t,i);for(a.s=0,a.t=v;0<v;)a[--v]=0;for(f=a.t-this.t;v<f;++v)a[v+this.t]=this.am(0,n[v],a,v,0,this.t);for(f=Math.min(n.t,i);v<f;++v)this.am(0,n[v],a,v,0,i-v);a.clamp()},t.prototype.multiplyUpperTo=function(n,i,a){var f=a.t=this.t+n.t- --i;for(a.s=0;0<=--f;)a[f]=0;for(f=Math.max(i-this.t,0);f<n.t;++f)a[this.t+f-i]=this.am(i-f,n[f],a,0,0,this.t+f-i);a.clamp(),a.drShiftTo(1,a)},t.prototype.modInt=function(n){if(n<=0)return 0;var i=this.DV%n,a=this.s<0?n-1:0;if(0<this.t)if(i==0)a=this[0]%n;else for(var f=this.t-1;0<=f;--f)a=(i*a+this[f])%n;return a},t.prototype.millerRabin=function(n){var i=this.subtract(t.ONE),a=i.getLowestSetBit();if(a<=0)return!1;var f=i.shiftRight(a);G.length<(n=n+1>>1)&&(n=G.length);for(var v=r(),x=0;x<n;++x){v.fromInt(G[Math.floor(Math.random()*G.length)]);var V=v.modPow(f,this);if(V.compareTo(t.ONE)!=0&&V.compareTo(i)!=0){for(var J=1;J++<a&&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=r();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 a,f=this.DB-n*this.DB%8,v=0;if(0<n--)for(f<this.DB&&(a=this[n]>>f)!=(this.s&this.DM)>>f&&(i[v++]=a|this.s<<this.DB-f);0<=n;)f<8?(a=(this[n]&(1<<f)-1)<<8-f,a|=this[--n]>>(f+=this.DB-8)):(a=this[n]>>(f-=8)&255,f<=0&&(f+=this.DB,--n)),128&a&&(a|=-256),v==0&&(128&this.s)!=(128&a)&&++v,(0<v||a!=this.s)&&(i[v++]=a);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=r();return this.bitwiseTo(n,X,i),i},t.prototype.or=function(n){var i=r();return this.bitwiseTo(n,nt,i),i},t.prototype.xor=function(n){var i=r();return this.bitwiseTo(n,Z,i),i},t.prototype.andNot=function(n){var i=r();return this.bitwiseTo(n,lt,i),i},t.prototype.not=function(){for(var n=r(),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=r();return n<0?this.rShiftTo(-n,i):this.lShiftTo(n,i),i},t.prototype.shiftRight=function(n){var i=r();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 a=0;return!(65535&i)&&(i>>=16,a+=16),!(255&i)&&(i>>=8,a+=8),!(15&i)&&(i>>=4,a+=4),!(3&i)&&(i>>=2,a+=2),!(1&i)&&++a,a})(this[n]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var n=0,i=this.s&this.DM,a=0;a<this.t;++a)n+=(function(f){for(var v=0;f!=0;)f&=f-1,++v;return v})(this[a]^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,lt)},t.prototype.flipBit=function(n){return this.changeBit(n,Z)},t.prototype.add=function(n){var i=r();return this.addTo(n,i),i},t.prototype.subtract=function(n){var i=r();return this.subTo(n,i),i},t.prototype.multiply=function(n){var i=r();return this.multiplyTo(n,i),i},t.prototype.divide=function(n){var i=r();return this.divRemTo(n,i,null),i},t.prototype.remainder=function(n){var i=r();return this.divRemTo(n,null,i),i},t.prototype.divideAndRemainder=function(n){var i=r(),a=r();return this.divRemTo(n,i,a),new Array(i,a)},t.prototype.modPow=function(n,i){var a=n.bitLength(),f=N(1);if(a<=0)return f;var v=a<18?1:a<48?3:a<144?4:a<768?5:6,x=new(a<8?ct:i.isEven()?B:T)(i),V=new Array,J=3,xt=v-1,$t=(1<<v)-1;if(V[1]=x.convert(this),1<v){var ce=r();for(x.sqrTo(V[1],ce);J<=$t;)V[J]=r(),x.mulTo(ce,V[J-2],V[J]),J+=2}var ye,Se,Bt=n.t-1,Ae=!0,jt=r();for(a=st(n[Bt])-1;0<=Bt;){for(xt<=a?ye=n[Bt]>>a-xt&$t:(ye=(n[Bt]&(1<<a+1)-1)<<xt-a,0<Bt&&(ye|=n[Bt-1]>>this.DB+a-xt)),J=v;!(1&ye);)ye>>=1,--J;if((a-=J)<0&&(a+=this.DB,--Bt),Ae)V[ye].copyTo(f),Ae=!1;else{for(;1<J;)x.sqrTo(f,jt),x.sqrTo(jt,f),J-=2;0<J?x.sqrTo(f,jt):(Se=f,f=jt,jt=Se),x.mulTo(jt,V[ye],f)}for(;0<=Bt&&!(n[Bt]&1<<a);)x.sqrTo(f,jt),Se=f,f=jt,jt=Se,--a<0&&(a=this.DB-1,--Bt)}return x.revert(f)},t.prototype.modInverse=function(n){var i=n.isEven();if(this.isEven()&&i||n.signum()==0)return t.ZERO;for(var a=n.clone(),f=this.clone(),v=N(1),x=N(0),V=N(0),J=N(1);a.signum()!=0;){for(;a.isEven();)a.rShiftTo(1,a),i?(v.isEven()&&x.isEven()||(v.addTo(this,v),x.subTo(n,x)),v.rShiftTo(1,v)):x.isEven()||x.subTo(n,x),x.rShiftTo(1,x);for(;f.isEven();)f.rShiftTo(1,f),i?(V.isEven()&&J.isEven()||(V.addTo(this,V),J.subTo(n,J)),V.rShiftTo(1,V)):J.isEven()||J.subTo(n,J),J.rShiftTo(1,J);0<=a.compareTo(f)?(a.subTo(f,a),i&&v.subTo(V,v),x.subTo(J,x)):(f.subTo(a,f),i&&V.subTo(v,V),J.subTo(x,J))}return f.compareTo(t.ONE)!=0?t.ZERO:0<=J.compareTo(n)?J.subtract(n):J.signum()<0?(J.addTo(n,J),J.signum()<0?J.add(n):J):J},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(),a=n.s<0?n.negate():n.clone();i.compareTo(a)<0&&(v=i,i=a,a=v);var f=i.getLowestSetBit(),v=a.getLowestSetBit();if(v<0)return i;for(0<(v=f<v?f:v)&&(i.rShiftTo(v,i),a.rShiftTo(v,a));0<i.signum();)0<(f=i.getLowestSetBit())&&i.rShiftTo(f,i),0<(f=a.getLowestSetBit())&&a.rShiftTo(f,a),0<=i.compareTo(a)?(i.subTo(a,i),i.rShiftTo(1,i)):(a.subTo(i,a),a.rShiftTo(1,a));return 0<v&&a.lShiftTo(v,a),a},t.prototype.isProbablePrime=function(n){var i,a=this.abs();if(a.t==1&&a[0]<=G[G.length-1]){for(i=0;i<G.length;++i)if(a[0]==G[i])return!0;return!1}if(a.isEven())return!1;for(i=1;i<G.length;){for(var f=G[i],v=i+1;v<G.length&&f<W;)f*=G[v++];for(f=a.modInt(f);i<v;)if(f%G[i++]==0)return!1}return a.millerRabin(n)},t.prototype.square=function(){var n=r();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),Jt=0;Jt<32;++Jt)Dt[rt++]=Tt[Jt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Lt=window.crypto.random(32),Jt=0;Jt<Lt.length;++Jt)Dt[rt++]=255&Lt.charCodeAt(Jt)}for(;rt<en;)Jt=Math.floor(65536*Math.random()),Dt[rt++]=Jt>>>8,Dt[rt++]=255&Jt;rt=0,$()}function Ze(){if(Q==null){for($(),(Q=new tn).init(Dt),rt=0;rt<Dt.length;++rt)Dt[rt]=0;rt=0}return Q.next()}function Tn(){}function tn(){this.i=0,this.j=0,this.S=new Array}Tn.prototype.nextBytes=function(n){for(var i=0;i<n.length;++i)n[i]=Ze()},tn.prototype.init=function(n){for(var i,a,f=0;f<256;++f)this.S[f]=f;for(f=i=0;f<256;++f)i=i+this.S[f]+n[f%n.length]&255,a=this.S[f],this.S[f]=this.S[i],this.S[i]=a;this.i=0,this.j=0},tn.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 en=256;Vt.exports={default:t,BigInteger:t,SecureRandom:Tn}}.call(b);var Nt=Kt.exports.BigInteger,Ct=(function(){function t(){z(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return P(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 r=this.v.length/2,u=r.toString(16);return u.length%2==1&&(u="0"+u),r<128?u:(128+u.length/2).toString(16)+u}},{key:"getValue",value:function(){return""}}]),t})(),se=(function(){et(r,Ct);var t=H(r);function r(u){var c;return z(this,r),(c=t.call(this)).t="02",u&&(c.v=(function(h){if((_=h.toString(16))[0]!=="-")_.length%2==1?_="0"+_:_.match(/^[0-7]/)||(_="00"+_);else{var _,S=(_=_.substr(1)).length;S%2==1?S+=1:_.match(/^[0-7]/)||(S+=2);for(var O="",N=0;N<S;N++)O+="f";_=(_=(O=new Nt(O,16)).xor(h).add(Nt.ONE)).toString(16).replace(/^-/,"")}return _})(u)),c}return P(r,[{key:"getValue",value:function(){return this.v}}]),r})(),ie=(function(){et(r,Ct);var t=H(r);function r(u){var c;return z(this,r),(c=t.call(this)).t="30",c.asn1Array=u,c}return P(r,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(u){return u.getEncodedHex()})).join(""),this.v}}]),r})();function kt(t,r){return+t[r+2]<8?1:128&+t.substr(r+2,2)}function ue(t,r){var u=kt(t,r);return(t=t.substr(r+2,2*u))?(+t[0]<8?new Nt(t,16):new Nt(t.substr(2),16)).intValue():-1}function ae(t,r){return r+2*(kt(t,r)+1)}var Ut=Kt.exports.BigInteger,Ht=new Ut("3"),me=(function(){function t(r,u){z(this,t),this.x=u,this.q=r}return P(t,[{key:"equals",value:function(r){return r===this||this.q.equals(r.q)&&this.x.equals(r.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(r){return new t(this.q,this.x.add(r.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(r){return new t(this.q,this.x.subtract(r.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(r){return new t(this.q,this.x.multiply(r.toBigInteger()).mod(this.q))}},{key:"divide",value:function(r){return new t(this.q,this.x.multiply(r.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(r,u,c,h){z(this,t),this.curve=r,this.x=u,this.y=c,this.z=h==null?Ut.ONE:h,this.zinv=null}return P(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(r){return r===this||(this.isInfinity()?r.isInfinity():r.isInfinity()?this.isInfinity():!!r.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Ut.ZERO)&&r.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(r.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(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var u=this.x.toBigInteger(),c=this.y.toBigInteger(),h=this.z,_=r.x.toBigInteger(),S=r.y.toBigInteger(),O=r.z,N=this.curve.q,st=u.multiply(O).mod(N);return r=_.multiply(h).mod(N),u=st.subtract(r),_=c.multiply(O).mod(N),c=S.multiply(h).mod(N),S=_.subtract(c),Ut.ZERO.equals(u)?Ut.ZERO.equals(S)?this.twice():this.curve.infinity:(c=st.add(r),r=h.multiply(O).mod(N),O=u.square().mod(N),h=u.multiply(O).mod(N),c=r.multiply(S.square()).subtract(c.multiply(O)).mod(N),u=u.multiply(c).mod(N),_=S.multiply(O.multiply(st).subtract(c)).subtract(_.multiply(h)).mod(N),N=h.multiply(r).mod(N),new t(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(_),N))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var r=this.x.toBigInteger(),u=this.y.toBigInteger(),c=this.z,h=this.curve.q,_=this.curve.a.toBigInteger(),S=r.square().multiply(Ht).add(_.multiply(c.square())).mod(h),O=u.shiftLeft(1).multiply(c).mod(h),N=(_=(N=u.square().mod(h)).multiply(r).multiply(c).mod(h),u=O.square().mod(h),r=S.square().subtract(_.shiftLeft(3)).mod(h),c=O.multiply(r).mod(h),S.multiply(_.shiftLeft(2).subtract(r)).subtract(u.shiftLeft(1).multiply(N)).mod(h));return h=O.multiply(u).mod(h),new t(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(N),h)}},{key:"multiply",value:function(r){if(this.isInfinity())return this;if(!r.signum())return this.curve.infinity;for(var u=r.multiply(Ht),c=this.negate(),h=this,_=u.bitLength()-2;0<_;_--){h=h.twice();var S=u.testBit(_);S!==r.testBit(_)&&(h=h.add(S?this:c))}return h}}]),t})(),Ft=(function(){function t(r,u,c){z(this,t),this.q=r,this.a=this.fromBigInteger(u),this.b=this.fromBigInteger(c),this.infinity=new te(this,null,null)}return P(t,[{key:"equals",value:function(r){return r===this||this.q.equals(r.q)&&this.a.equals(r.a)&&this.b.equals(r.b)}},{key:"fromBigInteger",value:function(r){return new me(this.q,r)}},{key:"decodePointHex",value:function(r){switch(parseInt(r.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var u=(r.length-2)/2,c=r.substr(2,u);return u=r.substr(2+u,u),new te(this,this.fromBigInteger(new Ut(c,16)),this.fromBigInteger(new Ut(u,16)))}}}]),t})(),Mt={ECPointFp:te,ECCurveFp:Ft},ne=Kt.exports.BigInteger,fe=(Ft=Kt.exports.SecureRandom,Mt.ECCurveFp),de=new Ft,re=(Mt=m()).curve,d=Mt.G,l=Mt.n;function m(){var t=new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),r=new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),u=new ne("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return u=(r=new fe(t,r,u)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:r,G:u,n:new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function Y(t,r){return t.length>=r?t:new Array(r-t.length+1).join("0")+t}function I(t,r){for(var u=[],c=~~(r/8),h=r%8,_=0,S=t.length;_<S;_++)u[_]=(t[(_+c)%S]<<h&255)+(t[(_+c+1)%S]>>>8-h&255);return u}function q(t,r){for(var u=[],c=t.length-1;0<=c;c--)u[c]=255&(t[c]^r[c]);return u}function ot(t,r){for(var u=[],c=t.length-1;0<=c;c--)u[c]=t[c]&r[c]&255;return u}function vt(t,r){for(var u=[],c=t.length-1;0<=c;c--)u[c]=255&(t[c]|r[c]);return u}function mt(t,r){for(var u=[],c=0,h=t.length-1;0<=h;h--){var _=t[h]+r[h]+c;c=255<_?1:0,u[h]=255&_}return u}function Xt(t,r,u,c){return 0<=c&&c<=15?q(q(t,r),u):vt(ot(t,r),ot((function(h){for(var _=[],S=h.length-1;0<=S;S--)_[S]=255&~h[S];return _})(t),u))}function ee(t,r){for(var u=[],c=[],h=0;h<16;h++){var _=4*h;u.push(r.slice(_,4+_))}for(var S,O=16;O<68;O++)u.push(q(q((S=q(q(u[O-16],u[O-9]),I(u[O-3],15)),q(q(S,I(S,15)),I(S,23))),I(u[O-13],7)),u[O-6]));for(var N=0;N<64;N++)c.push(q(u[N],u[N+4]));for(var st,ct,T,X=[121,204,69,25],nt=[122,135,157,138],Z=t.slice(0,4),lt=t.slice(4,8),pt=t.slice(8,12),Ot=t.slice(12,16),B=t.slice(16,20),Q=t.slice(20,24),G=t.slice(24,28),W=t.slice(28,32),$=0;$<64;$++){var Dt=0<=$&&$<=15?X:nt,rt=q(Tt=I(mt(mt(I(Z,12),B),I(Dt,$)),7),I(Z,12)),Tt=(rt=mt(mt(mt((st=Z,ct=lt,T=pt,0<=(Dt=$)&&Dt<=15?q(q(st,ct),T):vt(vt(ot(st,ct),ot(st,T)),ot(ct,T))),Ot),rt),c[$]),mt(mt(mt(Xt(B,Q,G,$),W),Tt),u[$]));Ot=pt,pt=I(lt,9),lt=Z,Z=rt,W=G,G=I(Q,19),Q=B,B=q(q(Tt,I(Tt,9)),I(Tt,17))}return q([].concat(Z,lt,pt,Ot,B,Q,G,W),t)}Ft={getGlobalCurve:function(){return re},generateEcparam:m,generateKeyPairHex:function(t,r,u){return{privateKey:u=Y((r=(t?new ne(t,r,u):new ne(l.bitLength(),de)).mod(l.subtract(ne.ONE)).add(ne.ONE)).toString(16),64),publicKey:"04"+Y((r=d.multiply(r)).getX().toBigInteger().toString(16),64)+Y(r.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(t){for(var r=(t=unescape(encodeURIComponent(t))).length,u=[],c=0;c<r;c++)u[c>>>2]|=(255&t.charCodeAt(c))<<24-c%4*8;for(var h=[],_=0;_<r;_++){var S=u[_>>>2]>>>24-_%4*8&255;h.push((S>>>4).toString(16)),h.push((15&S).toString(16))}return h.join("")},leftPad:Y,arrayToHex:function(t){return t.map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},arrayToUtf8:function(t){for(var r=[],u=0,c=0;c<2*t.length;c+=2)r[c>>>3]|=parseInt(t[u],10)<<24-c%8*4,u++;try{for(var h=[],_=0;_<t.length;_++){var S=r[_>>>2]>>>24-_%4*8&255;h.push(String.fromCharCode(S))}return decodeURIComponent(escape(h.join("")))}catch(O){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){for(var r=[],u=(t=(u=t.length)%2!=0?Y(t,u+1):t).length,c=0;c<u;c+=2)r.push(parseInt(t.substr(c,2),16));return r},verifyPublicKey:function(t){var r=re.decodePointHex(t);return!!r&&(t=r.getX(),r.getY().square().equals(t.multiply(t.square()).add(t.multiply(re.a)).add(re.b)))}},Mt=function(t){for(var r=448<=(r=(O=8*t.length)%512)?512-r%448-1:448-r-1,u=new Array((r-7)/8),c=0,h=u.length;c<h;c++)u[c]=0;for(var _,S=[],O=O.toString(2),N=7;0<=N;N--)8<O.length?(_=O.length-8,S[N]=parseInt(O.substr(_),2),O=O.substr(0,_)):0<O.length?(S[N]=parseInt(O,2),O=""):S[N]=0;for(var st=[].concat(t,[128],u,S),ct=st.length/64,T=[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],X=0;X<ct;X++){var nt=64*X;T=ee(T,st.slice(nt,64+nt))}return T};var Rt=Kt.exports.BigInteger,vr=function(t,r){return t=new se(t),r=new se(r),new ie([t,r]).getEncodedHex()},Ir=function(t){var r=ae(t,0),u=ae(t,r),c=ue(t,r);return r=t.substr(u,2*c),u=ae(t,c=u+r.length),c=ue(t,c),t=t.substr(u,2*c),{r:new Nt(r,16),s:new Nt(t,16)}},yt=Ft,ve=Mt,Ie=(Ft=yt.generateEcparam()).G,In=Ft.curve,Pe=Ft.n;function Pn(t,r,u){var c=2<arguments.length&&u!==void 0?u:"1234567812345678",h=(c=yt.utf8ToHex(c),yt.leftPad(Ie.curve.a.toBigInteger().toRadix(16),64)),_=yt.leftPad(Ie.curve.b.toBigInteger().toRadix(16),64),S=yt.leftPad(Ie.getX().toBigInteger().toRadix(16),64),O=yt.leftPad(Ie.getY().toBigInteger().toRadix(16),64);return u=(r=128<r.length?r.substr(2,128):r).substr(0,64),r=r.substr(64,64),r=yt.hexToArray(c+h+_+S+O+u+r),c=4*c.length,r.unshift(255&c),r.unshift(c>>8&255),r=ve(r),yt.arrayToHex(ve(r.concat(yt.hexToArray(t))))}function En(){var t=yt.generateKeyPairHex(),r=In.decodePointHex(t.publicKey);return t.k=new Rt(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}Ft={generateKeyPairHex:yt.generateKeyPairHex,doEncrypt:function(t,r){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),r=yt.getGlobalCurve().decodePointHex(r);var c=yt.generateKeyPairHex(),h=new Rt(c.privateKey,16),_=c.publicKey;128<_.length&&(_=_.substr(_.length-128)),c=r.multiply(h),h=yt.hexToArray(yt.leftPad(c.getX().toBigInteger().toRadix(16),64)),r=yt.hexToArray(yt.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=yt.arrayToHex(ve([].concat(h,t,r)));var S,O=1,N=0,st=[],ct=[].concat(h,r);(S=function(){st=ve([].concat(wt(ct),[O>>24&255,O>>16&255,O>>8&255,255&O])),O++,N=0})();for(var T=0,X=t.length;T<X;T++)N===st.length&&S(),t[T]^=255&st[N++];return r=yt.arrayToHex(t),u===0?_+r+c:_+c+r},doDecrypt:function(t,r){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(_=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":_;r=new Rt(r,16);var h=t.substr(128,64),_=t.substr(192);u===0&&(h=t.substr(t.length-64),_=t.substr(128,t.length-128-64));var S,O=yt.hexToArray(_),N=(t=yt.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),r=yt.hexToArray(yt.leftPad(t.getX().toBigInteger().toRadix(16),64)),t=yt.hexToArray(yt.leftPad(t.getY().toBigInteger().toRadix(16),64)),1),st=0,ct=[],T=[].concat(r,t);(S=function(){ct=ve([].concat(wt(T),[N>>24&255,N>>16&255,N>>8&255,255&N])),N++,st=0})();for(var X=0,nt=O.length;X<nt;X++)st===ct.length&&S(),O[X]^=255&ct[st++];return yt.arrayToHex(ve([].concat(r,O,t)))===h?c==="array"?O:yt.arrayToUtf8(O):c==="array"?[]:""},doSignature:function(t,r){var u=(O=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=O.der,h=O.hash,_=O.publicKey,S=O.userId,O=typeof t=="string"?yt.utf8ToHex(t):yt.arrayToHex(t);h&&(O=Pn(O,_||(t=r,h=Ie.multiply(new Rt(t,16)),"04"+(t=yt.leftPad(h.getX().toBigInteger().toString(16),64))+(h=yt.leftPad(h.getY().toBigInteger().toString(16),64))),S));var N=new Rt(r,16),st=new Rt(O,16),ct=null,T=null,X=null;do do{var nt;ct=(nt=u&&u.length?u.pop():En()).k,T=st.add(nt.x1).mod(Pe)}while(T.equals(Rt.ZERO)||T.add(ct).equals(Pe));while((X=N.add(Rt.ONE).modInverse(Pe).multiply(ct.subtract(T.multiply(N))).mod(Pe)).equals(Rt.ZERO));return c?vr(T,X):yt.leftPad(T.toString(16),64)+yt.leftPad(X.toString(16),64)},doVerifySignature:function(t,r,u){var c,h,_=(O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,S=O.hash,O=O.userId;return t=typeof t=="string"?yt.utf8ToHex(t):yt.arrayToHex(t),S&&(t=Pn(t,u,O)),h=_?(c=(h=Ir(r)).r,h.s):(c=new Rt(r.substring(0,64),16),new Rt(r.substring(64),16)),r=In.decodePointHex(u),u=new Rt(t,16),!(t=c.add(h).mod(Pe)).equals(Rt.ZERO)&&(r=Ie.multiply(h).add(r.multiply(t)),u=u.add(r.getX().toBigInteger()).mod(Pe),c.equals(u))},getPoint:En,verifyPublicKey:yt.verifyPublicKey};var Pr=Mt,Ue=[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],Me=[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 r=[],u=0,c=t.length;u<c;u+=2)r.push(parseInt(t.substr(u,2),16));return r}function Ee(t,r){return t<<r|t>>>32-r}function he(t){return(255&Ue[t>>>24&255])<<24|(255&Ue[t>>>16&255])<<16|(255&Ue[t>>>8&255])<<8|255&Ue[255&t]}function Je(t){return t^Ee(t,2)^Ee(t,10)^Ee(t,18)^Ee(t,24)}function ke(t){return t^Ee(t,13)^Ee(t,23)}function Sn(t,r,u,c){c=(_=(S=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":_;var h=S.mode,_=(_=S.iv)===void 0?[]:_,S=(S=S.output)===void 0?"string":S;if(h==="cbc"&&(_=typeof _=="string"?ze(_):_).length!==16)throw new Error("iv is invalid");if((r=typeof r=="string"?ze(r):r).length!==16)throw new Error("key is invalid");if(t=(typeof t=="string"?u!==0?function(B){for(var Q=[],G=0,W=B.length;G<W;G++){var $=B.codePointAt(G);if($<=127)Q.push($);else if($<=2047)Q.push(192|$>>>6),Q.push(128|63&$);else if($<=55295||57344<=$&&$<=65535)Q.push(224|$>>>12),Q.push(128|$>>>6&63),Q.push(128|63&$);else{if(!(65536<=$&&$<=1114111))throw Q.push($),new Error("input is not supported");G++,Q.push(240|$>>>18&28),Q.push(128|$>>>12&63),Q.push(128|$>>>6&63),Q.push(128|63&$)}}return Q}:ze:wt)(t),c==="pkcs#5"&&u!==0)for(var O=16-t.length%16,N=0;N<O;N++)t.push(O);var st=new Array(32);(function(B,Q,G){for(var W=new Array(4),$=new Array(4),Dt=0;Dt<4;Dt++)$[0]=255&B[0+4*Dt],$[1]=255&B[1+4*Dt],$[2]=255&B[2+4*Dt],$[3]=255&B[3+4*Dt],W[Dt]=$[0]<<24|$[1]<<16|$[2]<<8|$[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]^Me[Tt+0],Q[Tt+0]=W[0]^=ke(he(rt)),rt=W[2]^W[3]^W[0]^Me[Tt+1],Q[Tt+1]=W[1]^=ke(he(rt)),rt=W[3]^W[0]^W[1]^Me[Tt+2],Q[Tt+2]=W[2]^=ke(he(rt)),rt=W[0]^W[1]^W[2]^Me[Tt+3],Q[Tt+3]=W[3]^=ke(he(rt));if(G===0)for(var Lt,Jt=0;Jt<16;Jt++)Lt=Q[Jt],Q[Jt]=Q[31-Jt],Q[31-Jt]=Lt})(r,st,u);for(var ct=[],T=_,X=t.length,nt=0;16<=X;){var Z=t.slice(nt,nt+16),lt=new Array(16);if(h==="cbc")for(var pt=0;pt<16;pt++)u!==0&&(Z[pt]^=T[pt]);(function(B,Q,G){for(var W=new Array(4),$=new Array(4),Dt=0;Dt<4;Dt++)$[0]=255&B[4*Dt],$[1]=255&B[4*Dt+1],$[2]=255&B[4*Dt+2],$[3]=255&B[4*Dt+3],W[Dt]=$[0]<<24|$[1]<<16|$[2]<<8|$[3];for(var rt,Tt=0;Tt<32;Tt+=4)rt=W[1]^W[2]^W[3]^G[Tt+0],W[0]^=Je(he(rt)),rt=W[2]^W[3]^W[0]^G[Tt+1],W[1]^=Je(he(rt)),rt=W[3]^W[0]^W[1]^G[Tt+2],W[2]^=Je(he(rt)),rt=W[0]^W[1]^W[2]^G[Tt+3],W[3]^=Je(he(rt));for(var Lt=0;Lt<16;Lt+=4)Q[Lt]=W[3-Lt/4]>>>24&255,Q[Lt+1]=W[3-Lt/4]>>>16&255,Q[Lt+2]=W[3-Lt/4]>>>8&255,Q[Lt+3]=255&W[3-Lt/4]})(Z,lt,st);for(var Ot=0;Ot<16;Ot++)h==="cbc"&&u===0&&(lt[Ot]^=T[Ot]),ct[nt+Ot]=lt[Ot];h==="cbc"&&(T=u!==0?lt:Z),X-=16,nt+=16}return c==="pkcs#5"&&u===0&&(c=ct[ct.length-1],ct.splice(ct.length-c,c)),S!=="array"?u!==0?ct.map((function(B){return(B=B.toString(16)).length===1?"0"+B:B})).join(""):(function(B){for(var Q=[],G=0,W=B.length;G<W;G++)240<=B[G]&&B[G]<=247?(Q.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?(Q.push(String.fromCodePoint(((15&B[G])<<12)+((63&B[G+1])<<6)+(63&B[G+2]))),G+=2):192<=B[G]&&B[G]<=223?(Q.push(String.fromCodePoint(((31&B[G])<<6)+(63&B[G+1]))),G++):Q.push(String.fromCodePoint(B[G]));return Q.join("")})(ct):ct}var Er=[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=[],Sr=function(t,r,u){for(var c=t[0],h=t[1],_=t[2],S=t[3],O=t[4],N=t[5],st=t[6],ct=t[7],T=0;T<64;T++){T<16?ge[T]=0|r[u+T]:(X=ge[T-15],nt=ge[T-2],ge[T]=((X<<25|X>>>7)^(X<<14|X>>>18)^X>>>3)+ge[T-7]+((nt<<15|nt>>>17)^(nt<<13|nt>>>19)^nt>>>10)+ge[T-16]);var X=c&h^c&_^h&_,nt=ct+((O<<26|O>>>6)^(O<<21|O>>>11)^(O<<7|O>>>25))+(O&N^~O&st)+Er[T]+ge[T];ct=st,st=N,N=O,O=S+nt|0,S=_,_=h,h=c,c=nt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+X)|0}t[0]=t[0]+c|0,t[1]=t[1]+h|0,t[2]=t[2]+_|0,t[3]=t[3]+S|0,t[4]=t[4]+O|0,t[5]=t[5]+N|0,t[6]=t[6]+st|0,t[7]=t[7]+ct|0},Rn=(Ft={c2:Ft,c3:function(t){return t=typeof t=="string"?(function(r){for(var u=[],c=0,h=r.length;c<h;c++){var _=r.codePointAt(c);if(_<=127)u.push(_);else if(_<=2047)u.push(192|_>>>6),u.push(128|63&_);else if(_<=55295||57344<=_&&_<=65535)u.push(224|_>>>12),u.push(128|_>>>6&63),u.push(128|63&_);else{if(!(65536<=_&&_<=1114111))throw u.push(_),new Error("input is not supported");c++,u.push(240|_>>>18&28),u.push(128|_>>>12&63),u.push(128|_>>>6&63),u.push(128|63&_)}}return u})(t):Array.prototype.slice.call(t),Pr(t).map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},c4:{encrypt:function(t,r,u){return Sn(t,r,1,u)},decrypt:function(t,r,u){return Sn(t,r,0,u)}},s2:function(t){var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],u=(function(h){for(var _=[],S=0;S<Math.ceil(h.length/4);S++)_[S]=h[4*S]<<24|(255&h[4*S+1])<<16|(255&h[4*S+2])<<8|255&h[4*S+3];return _})(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)Sr(r,u,c);return(function(h){for(var _=[],S=0;S<h.length;S++)_[4*S]=h[S]>>24&255,_[4*S+1]=h[S]>>16&255,_[4*S+2]=h[S]>>8&255,_[4*S+3]=255&h[S];return _})(r).map((function(h){return(h=h.toString(16)).length===1?"0"+h:h})).join("")}},Pt),Rr=At,Tr=St,wr=Gt,br=Zt,Nr=Ft.c2,Cr=Ft.c3,Or=Ft.c4,Fr=Ft.s2;return(function(){var t;(t=function(){}).VERSION="2.1.0";var r=b;if(r.AAR2)return r.AAR2.VERSION!==t.VERSION&&console.log(r.AAR2.VERSION),r.AAR2;var u="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,h=!1,_=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,S=_!==void 0&&!!_.request&&!!_.login,O=function(T,X){return typeof T=="string"&&typeof X=="string"&&T!=null&&X!=null&&T.substring(0,X.length)===X},N={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(T){for(var X in N)if(N[X]===T)return X},ct=function(T,X,nt){var Z=Date.now(),lt=new t;try{if(!T||T.length<=75)return console.error("error format 1:",T),N.ERROR_DATA_FORMAT;if(!O(T,"eyJ"))return console.error("error format 2:",T),N.ERROR_DATA_FORMAT;T=T.substring(3,T.length);var pt=Rr.my_b4_decode(T);if(!pt)return console.error("error format 3:",T),N.ERROR_DATA_FORMAT;var Ot,B=lt.cc.u8.byteToInt(pt.slice(0,4),0),Q=pt.slice(4,4+B),G=lt.cc.u8.byteToInt(pt.slice(4+B,4+B+4),0),W=pt.slice(4+B+4,4+B+4+G),$=lt.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+$),rt=lt.cc.u8.bytesToUtf8Str(Q);if(lt.cc.h6.encode(W,0,G),X||(nt!==void 0&&nt==="sm2"?(Ot=lt.cc.h6.encode(W,0,G),lt.co.c2.doVerifySignature(rt,Ot,u,{der:!0,hash:!0})):lt.co.c3(rt+"8890012345678890").toLowerCase()===lt.cc.h6.encode(Dt,0,$).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 Jt=parseInt("0x"+rt.slice(66,82))-Z;t.prototype.__o=function(){return Jt}}return S||b.AAR2||(b.AAR2=t),N.SUCCESS}}catch(Ze){return console.error(Ze),N.ERROR_UNKNOWN_ERROR}return N.ERROR_SIGN_CHECK};return t.init=function(T,X){var nt,Z={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof T=="string"?(O(T,"https")||O(T,"https")?Z.url=T:O(T,"eyJ")&&(Z.code=T),typeof X=="string"&&(Z.publicKey=X)):tt(T)==="object"&&(T.debug&&(Z.debug=T.debug),T.url&&(Z.url=T.url),T.code&&(Z.code=T.code),T.publicKey&&(Z.publicKey=T.publicKey),T.skipVerify&&(Z.skipVerify=T.skipVerify),T.alg&&(Z.alg=T.alg),T.callback&&typeof T.callback=="function"&&(Z.callback=T.callback)),h?Z.callback&&Z.callback(!0,{errorNo:nt=N.ALREADY_SUCCESS,errorMsg:st(nt)}):c?setTimeout((function(){t.init(T,X)}),50):(c=!0,Z.debug&&Rn.start(Z.debug),Z.publicKey&&(u=Z.publicKey),Z.code?(nt=ct(Z.code,Z.skipVerify))===N.SUCCESS?(c=!(h=!0),Z.callback(!0,{errorNo:nt,errorMsg:st(nt)})):Z.callback(!1,{errorNo:nt,errorMsg:st(nt)}):Z.url&&(function(lt,pt,Ot){try{if(lt=lt+"?version="+t.VERSION+(S?"&name=wechat":"&name=browser")+"&t="+Date.now(),S)_.request({url:lt,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function(Q){Q.statusCode===200?pt(Q.data):Ot(N.ERROR_XXX_REQUEST_FAIL)},fail:function(Q){Q&&Q.errMsg&&Q.errMsg.indexOf("timeout")!==-1?Ot(N.ERROR_XXX_REQUEST_TIMEOUT):Ot(N.ERROR_XXX_REQUEST_FAIL)}});else{var B;if(window.XMLHttpRequest)B=new XMLHttpRequest;else if(window.ActiveXObject)try{B=new ActiveXObject("Msxml2.XMLHTTP")}catch(Q){try{B=new ActiveXObject("Microsoft.XMLHTTP")}catch(G){}}B&&(B.onload=function(){B.readyState===4&&(B.status===200?pt(B.responseText):Ot(N.ERROR_XHR_ERROR))},B.ontimeout=function(){Ot(N.ERROR_XHR_TIMEOUT)},B.onerror=function(){Ot(N.ERROR_XHR_ERROR)},B.open("POST",lt,!0),B.timeout=5e3,B.send(null))}}catch(Q){console.error(Q),Ot(N.ERROR_UNKNOWN_ERROR)}})(Z.url,(function(lt){(lt=ct(lt,Z.skipVerify,Z.alg))===N.SUCCESS?(c=!(h=!0),Z.callback(!0,{errorNo:lt,errorMsg:st(lt)})):(c=!1,Z.callback(!1,{errorNo:lt,errorMsg:st(lt)}))}),(function(lt){c=!1,Z.callback(!1,{errorNo:lt,errorMsg:st(lt)})})))},t.prototype={cc:{b4:Tr,h6:wr,u8:br},co:{c2:Nr,c3:Cr,c4:Or,s2:Fr},nonce:function(){var T="0000000000"+Math.ceil(2147483647*Math.random())+Math.floor((Date.now()+this.__o())/1e3);return T.substring(T.length-20)},sign:function(T,X){return this.__s(T,X)},__s:function(T,X){var nt=this.cc.u8.utf8StrToBytes(T),Z=this.__i();return T=this.cc.u8.utf8StrToBytes(X),X=this.cc.u8.utf8StrToBytes(this.__c()),T=[].concat(nt,Z,T,X),X=parseInt("0x"+this.__v()),this.__f(X)(T)+this.__v()},__f:function(T){var X=this.co.s2,nt=this.co.c3,Z=this.cc.h6.decode,lt=[function(pt){return X(pt)},function(pt){return nt(pt)},function(pt){return nt(Z(X(pt)))},function(pt){return X(Z(nt(pt)))},function(pt){return nt(Z(nt(pt)))},function(pt){return X(Z(X(pt)))}];return lt[(128<T?T-128:T)%lt.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(_!==void 0&&_.env&&_.request&&_.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 Rn.isDebug()},version:function(){return t.VERSION}},t})()},it(g)=="object"?y.exports=M():(U=typeof(E=M)=="function"?E.call(g,A,g,y):E)===void 0||(y.exports=U)}},o={};function s(y){var g=o[y];if(g!==void 0)return g.exports;var A=o[y]={id:y,loaded:!1,exports:{}};return e[y].call(A.exports,A,A.exports,s),A.loaded=!0,A.exports}s.n=y=>{var g=y&&y.__esModule?()=>y.default:()=>y;return s.d(g,{a:g}),g},s.d=(y,g)=>{for(var A in g)s.o(g,A)&&!s.o(y,A)&&Object.defineProperty(y,A,{enumerable:!0,get:g[A]})},s.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(y){if(typeof window=="object")return window}})(),s.hmd=y=>((y=Object.create(y)).children||(y.children=[]),Object.defineProperty(y,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+y.id)}}),y),s.o=(y,g)=>Object.prototype.hasOwnProperty.call(y,g),s.r=y=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})};var p=s(737);Vn.exports.LyyGetCommandSDK=p})()});var Co={};qe(Co,{DyErrorCode:()=>_e,DyErrorMessage:()=>gt,ENV_TYPE:()=>Qt,EXTERNAL_ENV_TYPE:()=>le,JdErrorCode:()=>Ke,JdErrorMessage:()=>bt,createServices:()=>Dr,getDisplayAdConfig:()=>Dn,getDyPayRtaData:()=>Qe,handleDyJsapiPayFlow:()=>_n,handleDyPayCommandFlow:()=>hn,handleDyPayFlow:()=>We,handleJdInsurance:()=>dn,handleJdInsuranceExt:()=>yn,handleJdjrCashLoanExt:()=>fn,handleJdjrCashLoanFlow:()=>ln,normalizeDisplayAdData:()=>$e});module.exports=jr(Co);var Qt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},le={SIT:"sit",RELEASE:"release",PROD:"prod"},Ve={[Qt.DEV]:"https://dm.leyaoyao.com",[Qt.SIT]:"https://sm.leyaoyao.com",[Qt.UAT]:"https://um.leyaoyao.com",[Qt.PROD]:"https://m.leyaoyao.com"},Nn={[Qt.DEV]:"https://dad2.leyaoyao.com",[Qt.SIT]:"https://sad2.leyaoyao.com",[Qt.UAT]:"https://uad2.leyaoyao.com",[Qt.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 He(e,o){return`${Ve[e]||Ve[Qt.PROD]}${o}`}function Cn(e){return Nn[e]||Nn[Qt.PROD]}var Re={debug:!1,env:Qt.PROD,externalEnv:le.PROD,apiDomain:""},On=ut({},Re);function Fn(e){On=ut(ut({},Re),e)}function pe(){return On}var qr=Object.defineProperty,Br=(e,o,s)=>o in e?qr(e,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[o]=s,Vr=(e,o,s)=>Br(e,typeof o!="symbol"?o+"":o,s);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 Hr=class{constructor(e=!1){Vr(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 Hr;function Ce(e){let o=oe();return o==="taro"?Taro.setClipboardData({data:e}).then(()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):o==="uni"?new Promise((s,p)=>{uni.setClipboardData({data:e,success:()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),s()},fail:y=>{w.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",y),p(y)}})}):o==="wechat"?new Promise((s,p)=>{wx.setClipboardData({data:e,success:()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),s()},fail:y=>{w.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",y),p(y)}})}):o==="alipay"?new Promise((s,p)=>{my.setClipboardData({text:e,success:()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),s()},fail:y=>{w.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",y),p(y)}})}):navigator.clipboard.writeText(e).then(()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function on(e,o=2e3){let s=oe();if(s==="taro"){Taro.showToast({title:e,icon:"none",mask:!0,duration:o});return}if(s==="uni"){uni.showToast({title:e,icon:"none",mask:!0,duration:o});return}if(s==="wechat"){wx.showToast({title:e,icon:"none",mask:!0,duration:o});return}if(s==="alipay"){my.showToast({content:e,duration:o});return}typeof console!="undefined"&&console.log(`[Toast] ${e}`)}async function De(){var e,o,s,p,y;let g=oe();try{if(g==="taro")return((e=(await Taro.getSystemInfo()).platform)==null?void 0:e.toLowerCase())==="ios"?"ios":"android";if(g==="uni")return((o=uni.getSystemInfoSync().platform)==null?void 0:o.toLowerCase())==="ios"?"ios":"android";if(g==="wechat")return wx.getDeviceInfo?((s=(await wx.getDeviceInfo()).platform)==null?void 0:s.toLowerCase())==="ios"?"ios":"android":((p=wx.getSystemInfoSync().platform)==null?void 0:p.toLowerCase())==="ios"?"ios":"android";if(g==="alipay")return((y=my.getSystemInfoSync().platform)==null?void 0:y.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 Yt={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function k(e,o,s=null){return{code:e,message:o,data:s}}function Ge(e,o){return e==null?{valid:!1,message:`${o}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof e=="string"&&e.trim().length===0?{valid:!1,message:`${o}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Oe(e,o){for(let s of o){let p=Ge(e[s],s);if(!p.valid)return p}return{valid:!0}}var pn={};qe(pn,{handleJdInsurance:()=>dn,handleJdInsuranceExt:()=>yn,handleJdjrCashLoanExt:()=>fn,handleJdjrCashLoanFlow:()=>ln});var Ke=(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))(Ke||{}),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"},_e=(L=>(L[L.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",L[L.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",L[L.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",L[L.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",L[L.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",L[L.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",L[L.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",L[L.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",L[L.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",L[L.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",L[L.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",L[L.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",L[L.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",L[L.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",L[L.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",L[L.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",L[L.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",L[L.DY_PAY__INVALID_RETURN_TYPE=3018]="DY_PAY__INVALID_RETURN_TYPE",L[L.DY_PAY__JSAPI_INFO_FAILED=3019]="DY_PAY__JSAPI_INFO_FAILED",L[L.DY_PAY__REQUEST_JSAPI_INFO_FAILED=3020]="DY_PAY__REQUEST_JSAPI_INFO_FAILED",L[L.DY_PAY__MISSING_JSAPI_PAY_INFO=3021]="DY_PAY__MISSING_JSAPI_PAY_INFO",L[L.DY_PAY__INVALID_JSAPI_PAY_INFO=3022]="DY_PAY__INVALID_JSAPI_PAY_INFO",L[L.DY_PAY__JSAPI_SIGNATURE_FAILED=3023]="DY_PAY__JSAPI_SIGNATURE_FAILED",L[L.DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED=3024]="DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED",L[L.DY_PAY__JSAPI_UNSUPPORTED_ENV=3025]="DY_PAY__JSAPI_UNSUPPORTED_ENV",L[L.DY_PAY__JSAPI_AUTH_REDIRECT_FAILED=3026]="DY_PAY__JSAPI_AUTH_REDIRECT_FAILED",L[L.DY_PAY__JSAPI_SDK_LOAD_FAILED=3027]="DY_PAY__JSAPI_SDK_LOAD_FAILED",L[L.DY_PAY__JSAPI_CONFIG_FAILED=3028]="DY_PAY__JSAPI_CONFIG_FAILED",L[L.DY_PAY__JSAPI_INVOKE_FAILED=3029]="DY_PAY__JSAPI_INVOKE_FAILED",L[L.DY_PAY__MISSING_AUTH_TOKEN=3030]="DY_PAY__MISSING_AUTH_TOKEN",L[L.DY_PAY_COMMAND__MISSING_ORDER_AMOUNT=3031]="DY_PAY_COMMAND__MISSING_ORDER_AMOUNT",L[L.DY_PAY_COMMAND__GET_FAILED=3032]="DY_PAY_COMMAND__GET_FAILED",L[L.DY_PAY_COMMAND__REQUEST_FAILED=3033]="DY_PAY_COMMAND__REQUEST_FAILED",L[L.DY_PAY_COMMAND__COPY_FAILED=3034]="DY_PAY_COMMAND__COPY_FAILED",L[L.DY_PAY_COMMAND__INVALID_RTA_DATA=3035]="DY_PAY_COMMAND__INVALID_RTA_DATA",L))(_e||{}),gt={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"};var Gr=(e,o,s,p)=>{let y=oe();if(y==="taro")return Taro.request({url:e,method:o,data:s,header:p}).then(E=>E);if(y==="uni")return new Promise((E,U)=>{uni.request({url:e,method:o,data:s,header:p,success:M=>E(M),fail:M=>U(M)})});if(y==="wechat")return new Promise((E,U)=>{wx.request({url:e,method:o,data:s,header:p,success:M=>E(M),fail:M=>U(M)})});if(y==="alipay")return new Promise((E,U)=>{my.request({url:e,method:o,data:s,headers:p,success:M=>E(M),fail:M=>U(M)})});let g=o.toUpperCase()==="GET",A=g&&s&&Object.keys(s).length?`${e}?${new URLSearchParams(s).toString()}`:e;return fetch(A,{method:o,headers:p,body:g?void 0:JSON.stringify(s)}).then(async E=>({statusCode:E.status,data:await E.json()}))},an=class{constructor(o=null){Be(this,"staticConfig");this.staticConfig=o}getCurrentConfig(){return this.staticConfig||pe()||Re}async getAuthToken(){let o=this.getCurrentConfig();if(o.getAuthToken&&typeof o.getAuthToken=="function")try{let s=await o.getAuthToken();return s?(w.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),s):(w.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(s){return w.error("\u83B7\u53D6Token\u5931\u8D25",s),null}return null}async buildHeader(o={},s=!0){let p=ut({"content-type":"application/json"},o);if(!s)return p;let y=await this.getAuthToken();if(!y)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 p.Authorization_bar=y,p}async request(o){let{path:s,method:p="POST",data:y={},header:g={},authRequired:A=!0,baseDomain:E,beforeRequest:U,afterResponse:M}=o,it=E?`${E}${s}`:He(this.getCurrentConfig().env||"prod",s),tt=await this.buildHeader(g,A);U&&typeof U=="function"&&await U({url:it,method:p,data:y,header:tt}),w.info(`\u53D1\u8D77${p}\u8BF7\u6C42:`,{path:s,method:p});try{let z=await Gr(it,p,y,tt);return w.info("\u8BF7\u6C42\u6210\u529F:",{path:s,statusCode:z.statusCode}),M&&typeof M=="function"&&await M(z.data),z.data}catch(z){throw w.error("\u8BF7\u6C42\u5931\u8D25:",{path:s,error:z}),z}}get(o,s={},p={}){return this.request(ut({path:o,method:"GET",data:s},p))}post(o,s={},p={}){return this.request(ut({path:o,method:"POST",data:s},p))}},Te=(e=null)=>new an(e);var Kr=(function(){"use strict";function e(P,et){var _t=(65535&P)+(65535&et);return(P>>16)+(et>>16)+(_t>>16)<<16|65535&_t}function o(P,et,_t,at,H,wt){return e((wt=e(e(et,P),e(at,wt)))<<H|wt>>>32-H,_t)}function s(P,et,_t,at,H,wt,R){return o(et&_t|~et&at,P,et,H,wt,R)}function p(P,et,_t,at,H,wt,R){return o(et&at|_t&~at,P,et,H,wt,R)}function y(P,et,_t,at,H,wt,R){return o(et^_t^at,P,et,H,wt,R)}function g(P,et,_t,at,H,wt,R){return o(_t^(et|~at),P,et,H,wt,R)}function A(P,et){var _t,at,H,wt;P[et>>5]|=128<<et%32,P[14+(et+64>>>9<<4)]=et;for(var R=1732584193,b=-271733879,F=-1732584194,C=271733878,D=0;D<P.length;D+=16)R=s(_t=R,at=b,H=F,wt=C,P[D],7,-680876936),C=s(C,R,b,F,P[D+1],12,-389564586),F=s(F,C,R,b,P[D+2],17,606105819),b=s(b,F,C,R,P[D+3],22,-1044525330),R=s(R,b,F,C,P[D+4],7,-176418897),C=s(C,R,b,F,P[D+5],12,1200080426),F=s(F,C,R,b,P[D+6],17,-1473231341),b=s(b,F,C,R,P[D+7],22,-45705983),R=s(R,b,F,C,P[D+8],7,1770035416),C=s(C,R,b,F,P[D+9],12,-1958414417),F=s(F,C,R,b,P[D+10],17,-42063),b=s(b,F,C,R,P[D+11],22,-1990404162),R=s(R,b,F,C,P[D+12],7,1804603682),C=s(C,R,b,F,P[D+13],12,-40341101),F=s(F,C,R,b,P[D+14],17,-1502002290),R=p(R,b=s(b,F,C,R,P[D+15],22,1236535329),F,C,P[D+1],5,-165796510),C=p(C,R,b,F,P[D+6],9,-1069501632),F=p(F,C,R,b,P[D+11],14,643717713),b=p(b,F,C,R,P[D],20,-373897302),R=p(R,b,F,C,P[D+5],5,-701558691),C=p(C,R,b,F,P[D+10],9,38016083),F=p(F,C,R,b,P[D+15],14,-660478335),b=p(b,F,C,R,P[D+4],20,-405537848),R=p(R,b,F,C,P[D+9],5,568446438),C=p(C,R,b,F,P[D+14],9,-1019803690),F=p(F,C,R,b,P[D+3],14,-187363961),b=p(b,F,C,R,P[D+8],20,1163531501),R=p(R,b,F,C,P[D+13],5,-1444681467),C=p(C,R,b,F,P[D+2],9,-51403784),F=p(F,C,R,b,P[D+7],14,1735328473),R=y(R,b=p(b,F,C,R,P[D+12],20,-1926607734),F,C,P[D+5],4,-378558),C=y(C,R,b,F,P[D+8],11,-2022574463),F=y(F,C,R,b,P[D+11],16,1839030562),b=y(b,F,C,R,P[D+14],23,-35309556),R=y(R,b,F,C,P[D+1],4,-1530992060),C=y(C,R,b,F,P[D+4],11,1272893353),F=y(F,C,R,b,P[D+7],16,-155497632),b=y(b,F,C,R,P[D+10],23,-1094730640),R=y(R,b,F,C,P[D+13],4,681279174),C=y(C,R,b,F,P[D],11,-358537222),F=y(F,C,R,b,P[D+3],16,-722521979),b=y(b,F,C,R,P[D+6],23,76029189),R=y(R,b,F,C,P[D+9],4,-640364487),C=y(C,R,b,F,P[D+12],11,-421815835),F=y(F,C,R,b,P[D+15],16,530742520),R=g(R,b=y(b,F,C,R,P[D+2],23,-995338651),F,C,P[D],6,-198630844),C=g(C,R,b,F,P[D+7],10,1126891415),F=g(F,C,R,b,P[D+14],15,-1416354905),b=g(b,F,C,R,P[D+5],21,-57434055),R=g(R,b,F,C,P[D+12],6,1700485571),C=g(C,R,b,F,P[D+3],10,-1894986606),F=g(F,C,R,b,P[D+10],15,-1051523),b=g(b,F,C,R,P[D+1],21,-2054922799),R=g(R,b,F,C,P[D+8],6,1873313359),C=g(C,R,b,F,P[D+15],10,-30611744),F=g(F,C,R,b,P[D+6],15,-1560198380),b=g(b,F,C,R,P[D+13],21,1309151649),R=g(R,b,F,C,P[D+4],6,-145523070),C=g(C,R,b,F,P[D+11],10,-1120210379),F=g(F,C,R,b,P[D+2],15,718787259),b=g(b,F,C,R,P[D+9],21,-343485551),R=e(R,_t),b=e(b,at),F=e(F,H),C=e(C,wt);return[R,b,F,C]}function E(P){for(var et="",_t=32*P.length,at=0;at<_t;at+=8)et+=String.fromCharCode(P[at>>5]>>>at%32&255);return et}function U(P){var et=[];for(et[(P.length>>2)-1]=void 0,at=0;at<et.length;at+=1)et[at]=0;for(var _t=8*P.length,at=0;at<_t;at+=8)et[at>>5]|=(255&P.charCodeAt(at/8))<<at%32;return et}function M(P){for(var et,_t="0123456789abcdef",at="",H=0;H<P.length;H+=1)et=P.charCodeAt(H),at+=_t.charAt(et>>>4&15)+_t.charAt(15&et);return at}function it(P){return unescape(encodeURIComponent(P))}function tt(P){return E(A(U(P=it(P)),8*P.length))}function z(P,et){return(function(_t,at){var H,wt=U(_t),R=[],b=[];for(R[15]=b[15]=void 0,16<wt.length&&(wt=A(wt,8*_t.length)),H=0;H<16;H+=1)R[H]=909522486^wt[H],b[H]=1549556828^wt[H];return at=A(R.concat(U(at)),512+8*at.length),E(A(b.concat(at),640))})(it(P),it(et))}function zt(P,et,_t){return et?_t?z(et,P):M(z(et,P)):_t?tt(P):M(tt(P))}return zt})(),Fe=Kr;function Ln(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function xn(e){if(typeof e!="object"||e===null)return e;let o=Object.keys(e).sort(),s={};for(let p of o)s[p]=e[p];return JSON.stringify(s)}function Yn(e,o){let s={appId:e.appId,randomStr:e.randomStr,data:e.data},p=Object.keys(s).sort(),y="";for(let[g,A]of p.entries())y+=`${A}=${s[A]}`,g<p.length-1&&(y+="&");return y+=`&secretKey=${o}`,Fe(y)}var Xr=(e,o,s,p)=>{let y=oe();return y==="taro"?Taro.request({url:e,method:o,data:s,header:p}).then(g=>g):y==="uni"?new Promise((g,A)=>{uni.request({url:e,method:o,data:s,header:p,success:E=>g(E),fail:E=>A(E)})}):y==="wechat"?new Promise((g,A)=>{wx.request({url:e,method:o,data:s,header:p,success:E=>g(E),fail:E=>A(E)})}):y==="alipay"?new Promise((g,A)=>{my.request({url:e,method:o,data:s,headers:p,success:E=>g(E),fail:E=>A(E)})}):fetch(e,{method:o,headers:p,body:JSON.stringify(s)}).then(async g=>({statusCode:g.status,data:await g.json()}))},sn=class{constructor(o=null){Be(this,"staticConfig");this.staticConfig=o}getCurrentConfig(){return this.staticConfig||pe()||{}}getExternalEnv(){var o;return((o=this.getCurrentConfig())==null?void 0:o.externalEnv)||le.PROD}getExternalHost(){let o=this.getExternalEnv();return Ne[o]||Ne.prod}generateSign(o={}){let s=this.getCurrentConfig(),{externalAppId:p,externalAppSecret:y}=s;if(!p||!y)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let g=Ln(),A=xn(o),E=Yn({appId:p,randomStr:g,data:A},y);return{appId:p,randomStr:g,sign:E}}buildRequestBody(o={}){let s=this.generateSign(o);return Wt(ut({},s),{data:o})}buildUrl(o){return`${this.getExternalHost()}${o}`}async request(o){let{path:s,method:p="POST",data:y={},header:g={},needSign:A=!0,beforeRequest:E,afterResponse:U}=o,M=this.buildUrl(s),it=ut({"content-type":"application/json"},g),tt=A?this.buildRequestBody(y):y;E&&typeof E=="function"&&await E({url:M,method:p,data:tt,header:it}),w.info(`\u53D1\u8D77${p}\u8BF7\u6C42:`,{path:s,method:p});try{let z=await Xr(M,p,tt,it);if(w.info("\u8BF7\u6C42\u6210\u529F:",{path:s,statusCode:z.statusCode}),U&&typeof U=="function"&&await U(z.data),z.statusCode===200&&z.data.code===200)return z.data.data;throw{code:z.data.code,msg:z.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:z.data}}catch(z){throw(z==null?void 0:z.code)!==void 0?z:(w.error("\u8BF7\u6C42\u5931\u8D25:",{path:s,error:z}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:z})}}get(o,s={},p={}){return this.request(ut({path:o,method:"GET",data:s},p))}post(o,s={},p={}){return this.request(ut({path:o,method:"POST",data:s},p))}},Un=(e=null)=>new sn(e);var un=Te(),cn=Un();function Mn(e){let o=Ge(e==null?void 0:e.equipmentValue,"equipmentValue");return o.valid?un.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",e):Promise.reject({code:"PARAM_ERROR",message:o.message})}async function Jn(e){let o=Oe(e,["idMd5Value","rtaStrategy"]);return o.valid?cn.post("/open/rest/cpa/jd/rta-check",e):Promise.reject({code:"PARAM_ERROR",message:o.message})}async function kn(e){try{let o={thirdPlatform:e.thirdPlatform,thirdPlatformUserId:e.thirdPlatformUserId,thirdPlatformEquipmentValue:e.thirdPlatformEquipmentValue,os:e.os,client:"wxMini"};e.phone&&(o.mobileMd5=Fe(e.phone)),e.extendData&&(Object.prototype.toString.call(e.extendData)==="[object Object]"?o.extendData=e.extendData:w.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let s=await cn.post("/open/rest/cpa/jd/insurance/get",o);return s?s.jumpMode==1?{jumpMode:1,appId:s.appId,url:s.url}:{jumpMode:2,url:s.url,channel:s.channelId}:void 0}catch(o){throw w.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",o),o}}function jn(e){let o=Ge(e==null?void 0:e.equipmentValue,"equipmentValue");return o.valid?un.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",e):Promise.reject({code:"PARAM_ERROR",message:o.message})}function qn(e){let o=Oe(e,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return o.valid?un.post("/gw/advert/customer/cpa-activity/jd/rta/validate",e):Promise.reject({code:"PARAM_ERROR",message:o.message})}async function Bn(e){let o=await De(),s={thirdPlatform:e.thirdPlatform,thirdPlatformUserId:e.thirdPlatformUserId,thirdPlatformEquipmentValue:e.thirdPlatformEquipmentValue,os:o,client:e.client};return e.phone&&(s.mobileMd5=Fe(e.phone)),e.extendData&&(Object.prototype.toString.call(e.extendData)==="[object Object]"?s.extendData=e.extendData:w.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),cn.post("/open/rest/cpa/jd/cash-loan/get",s)}async function ln(e){let{phone:o,rtaId:s,equipmentId:p,lyyUserId:y,entrance:g}=e;if(!o)return k(Yt.INVALID_PARAM,bt[2001]);if(!p)return k(Yt.INVALID_PARAM,bt[2002]);try{if(s){w.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:o});let tt=await qn({phone:o,lyyEquipmentValue:p,lyyUserId:y||"",rtaId:s});if(tt.code!=="0000000"||!tt.body||tt.body.state!=1)return w.error("RTA\u9A8C\u8BC1\u5931\u8D25",tt),k(2003,bt[2003]);w.info("RTA\u9A8C\u8BC1\u6210\u529F",tt.body)}w.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:o});let A=await De(),E=await jn({phone:o,equipmentValue:p,os:A,entrance:g});if(E.code!=="0000000"||!E.body)return w.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",E),k(2004,bt[2004]);let{appId:U,targetUrl:M}=E.body;if(!U||!M)return w.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:U,targetUrl:M}),k(2005,bt[2005]);let it=k(Yt.SUCCESS,"\u6210\u529F",{appId:U,targetUrl:M});return w.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",it),it}catch(A){return w.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",A),k(Yt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function fn(e){let{phone:o,rtaId:s,thirdPlatform:p,thirdPlatformUserId:y,thirdPlatformEquipmentValue:g}=e;if(!o)return k(Yt.INVALID_PARAM,bt[2001]);if(!p)return k(2008,bt[2008]);if(!y)return k(2009,bt[2009]);if(!g)return k(2010,bt[2010]);try{if(s){w.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:o});let z=await Jn({idMd5Value:o,rtaStrategy:s});if(z.status!=1)return w.error("RTA\u9A8C\u8BC1\u5931\u8D25",z),k(2003,bt[2003]);w.info("RTA\u9A8C\u8BC1\u6210\u529F",z)}let A=await Bn(e),{url:E,channelId:U,matchFlag:M,jumpMode:it,appId:tt}=A||{};return M?it===3?!tt||!E?k(2007,bt[2007]):k(Yt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:tt,url:E}):k(2007,bt[2007]):k(2006,bt[2006])}catch(A){return w.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",A),k(Yt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var we=null,Le=null;try{Le=Hn()}catch(e){}function Gn(){return we||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(we=globalThis.LyyGetCommandSDK,we):Le?(we=Le.LyyGetCommandSDK||Le.default||Le,we):null)}function Kn(e){var s;w.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",e);let o=Gn();o!=null&&o.getJrCommand?o.getJrCommand(e):(s=o==null?void 0:o.default)!=null&&s.getJrCommand?o.default.getJrCommand(e):(w.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),e.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function Wr(e,o){return new Promise((s,p)=>{try{Kn({url:e,channel:o,callback:y=>{y.code==="0"?s(y.data):p({msg:y.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(y){p(y)}})}async function dn(e){try{let o=await De(),s=ut({os:o},e);w.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",s);let{code:p,body:y}=await Mn(s);if(p==="0000000"&&y){let{url:g,channelId:A,matchFlag:E,jumpMode:U,appId:M}=y;if(!E)return k(2101,bt[2101]);if(U===1)return w.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),k(2102,bt[2102]);if(U===2)return oe()==="web"&&w.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:g}),!g||!A?k(2103,bt[2103]):new Promise(it=>{Kn({url:g,channel:A,callback:async tt=>{if((tt==null?void 0:tt.code)==="0")try{await Ce(tt==null?void 0:tt.data),it(k(Yt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(z){it(k(2105,bt[2105]))}else it(k(2105,bt[2105]))}})});if(U===3)return!M||!g?k(2103,bt[2103]):k(Yt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:M,path:g})}return k(2104,bt[2104])}catch(o){return w.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",o),k(Yt.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 o=await kn(Wt(ut({},e),{os:await De()}));if(!o)return w.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),k(2106,bt[2106]);if(o.jumpMode===1)return w.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:o.appId,url:o.url}),k(Yt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:o.appId,path:o.url});if(o.jumpMode===2){if(oe()==="web")return w.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:o.url}),k(Yt.SUCCESS,"\u6210\u529F",{type:"h5",url:o.url});try{let s=await Wr(o.url,o.channel);return await Ce(s),w.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),k(Yt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(s){return w.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",s),on("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),k(2105,bt[2105])}}return w.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",o.jumpMode),k(2107,bt[2107])}catch(o){let s=typeof o=="string"?o:(o==null?void 0:o.msg)||(o==null?void 0:o.message)||"\u672A\u77E5\u9519\u8BEF";return w.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",s),on("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),s.includes("RTA")||s.includes("\u8D44\u683C")?k(2108,bt[2108]):k(Yt.NETWORK_ERROR,s)}}var mn={};qe(mn,{DyErrorCode:()=>_e,getDyPayRtaData:()=>Qe,handleDyJsapiPayFlow:()=>_n,handleDyPayCommandFlow:()=>hn,handleDyPayFlow:()=>We});var Qr=["weapp","h5"],$r=["h5","ulink","jsapi"],zr=["switchTab","reLaunch","redirectTo","navigateTo"];function Zr(e){return Qr.includes(e)}function to(e){return $r.includes(e)}function eo(e){return zr.includes(e)}function Xn(e){let o=e.returnType||"h5";return!e.telephone&&o==="h5"?{valid:!1,errorCode:3001}:e.price?e.equipmentValue?e.businessType?e.client&&!Zr(e.client)?{valid:!1,errorCode:3004}:to(o)?e.douyinOrderExtendData&&typeof e.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:e.backWay&&e.client==="weapp"&&!eo(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 Wn(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 Qn(e){return e.equipmentValue?{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function $n(e){return e.telephone?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}:{valid:!1,errorCode:3001}}function zn(e){return e.telephone?e.equipmentValue?e.commandUrl!=null&&typeof e.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3001}}function Zn(e){return e.showFlag===!0&&typeof e.payAmount=="number"&&e.payAmount>0&&typeof e.businessType=="number"&&e.businessType>0}var be=Te();async function tr(e){let{price:o,equipmentValue:s,douyinOrderExtendData:p,douyinCommodityVirtualFlag:y,businessType:g,platformActivities:A={}}=e,E={businessType:g,equipmentValue:s,payInfoBusinessType:"commonDouyinPayment",platformActivities:ut({douyinCommodityVirtualFlag:y||!1,douyinCommodityPrice:o,douyinOrderExtendData:p||""},A)};try{let U=await be.post("/gw/advert/customer/payment/pay-info",E);return U.code!=="0000000"||!(U!=null&&U.body)?Promise.reject({code:3006,message:U.message||gt[3006]}):(U.body.platformActivities=E.platformActivities,U)}catch(U){return w.error("getDyOrderAmountFn error:",U),Promise.reject({code:3007,message:gt[3007]})}}async function er(e){var o,s;try{let p=e.commodityList.map(tt=>(tt.commodity=tt.commodityId,delete tt.commodityId,tt.quantity=tt.quantity||1,tt)),y=e.advertExtendInfo&&Object.keys(e.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:e.advertExtendInfo}):"",g=oe(),A="";g==="wechat"?A="wechatMini":g==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(A="wechatHtml");let E=e.returnType==="jsapi",U=E?22:21,M=ut(ut(ut({businessType:e.businessType,fixedClientType:U,channelCode:null,douyinData:{loginMobile:e.telephone||""},equipmentUseFlag:!0,payEquipmentDTO:{equipmentValue:e.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:y,transType:5,actualFee:e.totalFee,totalFee:e.totalFee,commodityList:p,clientSourceDetailType:A,platformActivities:e.platformActivities||{}},e.commoditySign&&{commoditySign:e.commoditySign}),e.unifiedOrderExtendData&&ut({},e.unifiedOrderExtendData)),E?{appId:((o=e.jsapiInfo)==null?void 0:o.appId)||"",openId:((s=e.jsapiInfo)==null?void 0:s.douyinOpenId)||""}:{});e.returnType=="ulink"&&(delete M.channelCode,delete M.douyinData,delete M.clientSourceDetailType,delete M.platformActivities.douyinCommodityVirtualFlag,delete M.platformActivities.douyinCommodityPrice,delete M.platformActivities.douyinOrderExtendData);let it=await be.post("/gw/payment-bff/unified/order",M);return it.code!=="0000000"||!(it!=null&&it.body)?Promise.reject({code:3008,message:it.message||gt[3008]}):it}catch(p){return w.error("dyUnifiedOrderFn error:",p),Promise.reject({code:3009,message:gt[3009]})}}async function nr(e){let o={equipmentValue:e.equipmentValue,phone:e.telephone||""};e.price&&(o.orderAmount=e.price);try{let s=await be.post("/gw/advert/customer/douyin/pay/check",o);return s.code!=="0000000"||!(s!=null&&s.body)?Promise.reject({code:3013,message:s.message||gt[3013]}):s}catch(s){return w.error("getDyPayRtaData error:",s),Promise.reject({code:3014,message:(s==null?void 0:s.message)||gt[3014]})}}async function rr(){try{let e=await be.get("/gw/advert/customer/douyin/pay/jsapi/info");return e.code!=="0000000"||!(e!=null&&e.body)?Promise.reject({code:3019,message:e.message||gt[3019]}):{appId:e.body.appId,douyinOpenId:e.body.douyinOpenId}}catch(e){return w.error("getDyPayJsapiInfoFn error:",e),Promise.reject({code:(e==null?void 0:e.code)||3020,message:(e==null?void 0:e.message)||gt[3020]})}}async function or(e){try{let o=await be.post("/gw/advert/customer/douyin/pay/jsapi/signature",e);return o.code!=="0000000"||!(o!=null&&o.body)||!o.body.signature||!o.body.timestamp||!o.body.nonceStr?Promise.reject({code:3023,message:o.message||gt[3023]}):{signature:o.body.signature,timestamp:o.body.timestamp,nonceStr:o.body.nonceStr}}catch(o){return w.error("getDyPayJsapiSignatureFn error:",o),Promise.reject({code:(o==null?void 0:o.code)||3024,message:(o==null?void 0:o.message)||gt[3024]})}}async function ir(e){try{let o=await be.post("/gw/advert/customer/douyin/pay-command",e);return o.code!=="0000000"||!(o!=null&&o.body)?Promise.reject({code:3032,message:o.message||gt[3032]}):o}catch(o){return w.error("getDyPayCommandFn error:",o),Promise.reject({code:(o==null?void 0:o.code)||3033,message:(o==null?void 0:o.message)||gt[3033]})}}var no="/auth/rest/auth/third",ar="url_token",ro="https://unpkg.byted-static.com/bridge/douyin_open/1.0.17/lib/douyin_open.umd.js",xe=null;function qt(e,o){let s=new Error(o||gt[e]);return Object.assign(s,{code:e})}function Ye(){return typeof window!="undefined"&&typeof document!="undefined"}function sr(){return Ye()?window.location.href:""}function ur(e){let{href:o,paramName:s}=e;if(!o||!s)return o;let p=o.indexOf("#"),y=p>=0?o.slice(0,p):o,g=p>=0?o.slice(p):"";try{let A=new URL(y,io()),E=ao(y);return A.searchParams.delete(s),`${E?`${A.pathname}${A.search}`:A.toString()}${g}`}catch(A){return w.warn("removeDyUrlParam parse error:",A),co(o,s)}}function cr(e={}){let s=(e.href||sr()).split("#")[0]||"";return ur({href:s,paramName:e.tokenParamName||ar})}function oo(e){var y,g;if(!e.equipmentValue)throw qt(3002);let o=e.tokenParamName||ar,s=ur({href:e.redirectUrl||sr(),paramName:o});if(!s)throw qt(3025);let p=new URLSearchParams({useAgent:e.useAgent||"douyin",category:e.category||"pay",internal:String((y=e.internal)!=null?y:!1),silent:String((g=e.silent)!=null?g:!1),equipmentValue:e.equipmentValue,redirectUrl:s});return`${e.authPath||no}?${p.toString()}`}function lr(e){if(!Ye())throw qt(3025);let o=oo(e);w.info("\u8DF3\u8F6C\u6296\u97F3\u6388\u6743:",{authUrl:o,equipmentValue:e.equipmentValue});try{return window.location.href=o,o}catch(s){throw w.error("redirectDyAuth error:",s),qt(3026)}}function Xe(){if(!Ye())return null;let e=window;return e.DouyinOpenJSBridge||e.douyin_open||null}function fr(e={}){if(!Ye())return Promise.reject(qt(3025));let o=Xe();if(o)return w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5DF2\u52A0\u8F7D"),Promise.resolve(o);if(xe)return w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u590D\u7528\u52A0\u8F7D\u4E2D\u4EFB\u52A1"),xe;let s=e.sdkUrl||ro;return w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5F00\u59CB\u52A0\u8F7D",{sdkUrl:s}),xe=new Promise((p,y)=>{let g=so(s),A=()=>{let M=Xe();if(!M){y(qt(3027));return}w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u6210\u529F"),p(M)},E=M=>{w.error("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u5931\u8D25",M),y(qt(3027))};if(g){if(w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u811A\u672C\u5DF2\u5B58\u5728"),uo(g)){window.setTimeout(A,0);return}g.addEventListener("load",A,{once:!0}),g.addEventListener("error",E,{once:!0});return}let U=document.createElement("script");U.src=s,U.async=!0,U.addEventListener("load",A,{once:!0}),U.addEventListener("error",M=>{U.remove(),E(M)},{once:!0}),document.head.appendChild(U)}).catch(p=>{throw xe=null,p}),xe}function dr(e){let o=e.sdk||Xe();if(!o)return Promise.reject(qt(3027));let{appId:s,signatureData:p,url:y}=e;return!s||!y||!(p!=null&&p.signature)||!(p!=null&&p.timestamp)||!(p!=null&&p.nonceStr)?Promise.reject(qt(3028)):new Promise((g,A)=>{w.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u5F00\u59CB\u914D\u7F6E",{appId:s,url:y});try{o.config({params:{client_key:s,signature:p.signature,timestamp:String(p.timestamp),nonce_str:p.nonceStr,url:y}}),o.ready(()=>{w.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5B8C\u6210"),g(o)}),o.error(E=>{w.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5931\u8D25",E),A(qt(3028))})}catch(E){w.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5F02\u5E38",E),A(qt(3028))}})}function yr(e){let o=e.sdk||Xe();if(!o)return Promise.reject(qt(3027));if(!o.ttcjpay||typeof o.ttcjpay.dypay!="function")return Promise.reject(qt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));let{appId:s,payInfo:p}=e;if(!s||!p)return Promise.reject(qt(3021));let y={appId:s,timeStamp:String(p.timeStamp),nonceStr:p.nonceStr,package:p.package,signType:p.signType,paySign:p.paySign};return new Promise((g,A)=>{w.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528 dypay");try{o.ttcjpay.dypay({sdk_info:JSON.stringify(y),success:E=>{if(w.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u6210\u529F\u56DE\u8C03",E),(E==null?void 0:E.code)===-2){A(qt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}g(E)},fail:E=>{if(w.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u5931\u8D25\u56DE\u8C03",E),(E==null?void 0:E.code)===-2){A(qt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}A(qt(3029,(E==null?void 0:E.message)||(E==null?void 0:E.errMsg)))}})}catch(E){w.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528\u5F02\u5E38",E),A(qt(3029,E==null?void 0:E.message))}})}function io(){return Ye()?window.location.origin:"https://bi-nova.local"}function ao(e){return!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)&&!e.startsWith("//")}function so(e){return Array.from(document.getElementsByTagName("script")).find(s=>s.src===e)||null}function uo(e){let o=e.readyState;return o==="loaded"||o==="complete"}function co(e,o){let s=e.indexOf("#"),p=s>=0?e.slice(0,s):e,y=s>=0?e.slice(s):"",g=p.indexOf("?");if(g<0)return e;let A=p.slice(0,g),U=p.slice(g+1).split("&").filter(M=>M&&decodeURIComponent(M.split("=")[0])!==o).join("&");return`${A}${U?`?${U}`:""}${y}`}async function We(e){var s,p,y,g;let o=Xn(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let A=e.returnType||"h5",E=await tr({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}),U=A==="jsapi"?await rr():void 0,M=await er(Wt(ut(Wt(ut({},E.body),{telephone:e.telephone,equipmentValue:e.equipmentValue,businessType:e.businessType}),e.unifiedOrderExtendData&&{unifiedOrderExtendData:e.unifiedOrderExtendData}),{returnType:A,jsapiInfo:U})),it=((s=M==null?void 0:M.body)==null?void 0:s.h5Url)||"",tt=((p=M==null?void 0:M.body)==null?void 0:p.outTradeNo)||"";if(A==="ulink"){let zt=it?await po(Wt(ut({},e),{dyUrl:it})):"";return zt?k(0,"success",{ulinkUrl:zt,outTradeNo:tt}):k(3010,gt[3010])}if(A==="jsapi"){let zt=lo((y=M==null?void 0:M.body)==null?void 0:y.payInfo);return k(0,"success",{appId:(U==null?void 0:U.appId)||"",payInfo:zt,outTradeNo:tt})}let z=it?await yo(Wt(ut({},e),{dyUrl:it})):"";return z?k(0,"success",{h5Url:z,outTradeNo:tt}):k(3010,gt[3010])}catch(A){w.error("handleDyPayFlow error:",A);let E=(g=A==null?void 0:A.code)!=null?g:3012,U=(A==null?void 0:A.message)||gt[3012];return k(E,U)}}function lo(e){if(!e)throw{code:3021,message:gt[3021]};try{let o=JSON.parse(e);if(!fo(o))throw new Error("invalid payInfo fields");return o}catch(o){throw{code:3022,message:gt[3022],error:o}}}function fo(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 yo(e){let o=pe(),s=He(o.env||"prod",""),p=typeof o.getAuthToken=="function"?await o.getAuthToken():"",y=e.client||"weapp";return`${s}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${y}&equipmentId=${e.equipmentValue}&dyUrl=${e.dyUrl}&fromUrl=${encodeURIComponent(e.fromUrl||"")}&backUrl=${encodeURIComponent(e.backUrl||"")}&backWay=${e.backWay||""}&url_token=${p}`}async function po(e){let o=e.dyUrl+`${e.backUrl?"&return_url="+encodeURIComponent(e.backUrl||""):""}&jump_back_schema=${encodeURIComponent("weixin://")}`;return e.jumpNow&&window.location.replace(o),e.encodeUrl&&(o=encodeURIComponent(o)),o}async function Qe(e){var s;let o=Qn(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let p=await nr({price:(e==null?void 0:e.price)||"",equipmentValue:e.equipmentValue,telephone:(e==null?void 0:e.telephone)||""});return k(0,"success",p.body)}catch(p){w.error("getDyPayRtaData error:",p);let y=(s=p==null?void 0:p.code)!=null?s:3015,g=(p==null?void 0:p.message)||gt[3015];return k(y,g)}}async function pr(e){var s,p;let o=$n(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let y=(s=e.commandUrl)==null?void 0:s.trim(),A=(await ir(ut({phone:e.telephone,equipmentValue:e.equipmentValue,orderAmount:e.orderAmount,businessType:e.businessType},y?{commandUrl:y}:{}))).body||"";return A?k(0,"success",{command:A}):k(3032,gt[3032])}catch(y){w.error("getDyPayCommand error:",y);let g=(p=y==null?void 0:y.code)!=null?p:3033,A=(y==null?void 0:y.message)||gt[3033];return k(g,A)}}async function ho(e){var s;let o=await pr(e);if(o.code!==0||!((s=o.data)!=null&&s.command))return k(o.code,o.message);try{return await Ce(o.data.command),k(0,"success",ut({type:"copy_success"},e.returnCommand?{command:o.data.command}:{}))}catch(p){return w.error("copyDyPayCommand error:",p),k(3034,gt[3034])}}async function hn(e){var s,p,y;let o=zn(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let g=await Qe({telephone:e.telephone,equipmentValue:e.equipmentValue,price:e.price});if(g.code!==0)return k(g.code,g.message);let A=g.data;if(!(A!=null&&A.showFlag))return k(0,"success",{eligible:!1,type:"not_eligible"});if(!Zn(A))return k(3035,gt[3035]);let E={telephone:e.telephone,equipmentValue:e.equipmentValue,orderAmount:A.payAmount,businessType:A.businessType,commandUrl:e.commandUrl};if(e.autoCopy){let M=await ho(Wt(ut({},E),{returnCommand:e.returnCommand}));return M.code!==0?k(M.code,M.message):k(0,"success",ut({eligible:!0,type:"copy_success"},(s=M.data)!=null&&s.command?{command:M.data.command}:{}))}let U=await pr(E);return U.code!==0||!((p=U.data)!=null&&p.command)?k(U.code,U.message):k(0,"success",{eligible:!0,type:"command",command:U.data.command})}catch(g){w.error("handleDyPayCommandFlow error:",g);let A=(y=g==null?void 0:g.code)!=null?y:3033,E=(g==null?void 0:g.message)||gt[3033];return k(A,E)}}async function _n(e){var s,p,y;let o=Wn(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let g=pe(),A=e.authToken||(typeof g.getAuthToken=="function"?await g.getAuthToken():""),E=e.autoAuth!==!1;if(!A){if(!E)return k(3030,gt[3030]);let zt=lr({equipmentValue:e.equipmentValue,redirectUrl:e.redirectUrl,tokenParamName:e.tokenParamName});return k(0,"redirecting",{type:"auth_redirect",authUrl:zt})}let U=await fr({sdkUrl:e.sdkUrl}),M=await We(Wt(ut({},e),{client:"h5",returnType:"jsapi"}));if(M.code!==0||!((s=M.data)!=null&&s.appId)||!((p=M.data)!=null&&p.payInfo))return k(M.code||3021,M.message||gt[3021]);let it=e.signatureUrl||cr({tokenParamName:e.tokenParamName}),tt=await or({url:it});await dr({appId:M.data.appId,signatureData:tt,url:it,sdk:U});let z=await yr({appId:M.data.appId,payInfo:M.data.payInfo,sdk:U});return k(0,"success",{type:"pay_result",outTradeNo:M.data.outTradeNo,payResult:z})}catch(g){w.error("handleDyJsapiPayFlow error:",g);let A=(y=g==null?void 0:g.code)!=null?y:3029,E=(g==null?void 0:g.message)||gt[3029];return k(A,E)}}var vn={};qe(vn,{getDisplayAdConfig:()=>Dn,normalizeDisplayAdData:()=>$e});var _o=Te();function hr(e){let o=Oe(e,["placementId"]);if(!o.valid)return Promise.reject({code:"PARAM_ERROR",message:o.message});let s=pe().env||"prod";return _o.get(`/gw/advert-plugin/api/v1/config/list/valid/${e.placementId}`,{},{authRequired:!1,baseDomain:Cn(s)})}var _r=30*1e3,mo="__",An=new Map,gn=new Map;function go(e,o){return[e.appId||"",o,e.type||""].join(mo)}function Ao(e){let o=An.get(e);return o?o.expireAt<=Date.now()?(An.delete(e),w.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:e}),null):o.data:null}function Do(e,o){An.set(e,{data:o,expireAt:Date.now()+_r})}function vo(e){return Array.isArray(e==null?void 0:e.body)?e.body:[]}function Io(e){return String(e==null?void 0:e.code)!=="200"}function Po(e,o){let s=String(e||o||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(s)?s:o||"banner"}function mr(e){return String(e||"").trim().toLowerCase()}function Eo(e){var o;return!!e&&e.status!==0&&((o=e.platformConfig)==null?void 0:o.valid)!==!1}function So(e){return[...e].sort((o,s)=>{var g,A,E,U;let p=Number((g=o.priority)!=null?g:9999),y=Number((A=s.priority)!=null?A:9999);return p!==y?p-y:Number((E=s.weight)!=null?E:0)-Number((U=o.weight)!=null?U:0)})}function gr(e){return e.find(o=>mr(o.advertPlatform)==="gdt")||null}function Ar(e){return e.find(o=>mr(o.advertPlatform)!=="gdt")||null}function Ro(e,o){return e&&o?"mixed":e?"wechat":o?"custom":"none"}function To(e,o){var y,g;let s=gr(e),p=Ar(e);return s&&p?Number((y=s.priority)!=null?y:9999)<=Number((g=p.priority)!=null?g:9999)?"wechat-first":"custom-first":o==="custom"?"custom-only":o==="wechat"?"wechat-only":"wechat-first"}function wo(e){var s;let o=gr(e);return((s=o==null?void 0:o.platformConfig)==null?void 0:s.adId)||""}function bo(e){let o=Ar(e),s=o==null?void 0:o.platformConfig;if(!s)return null;let p=s.image||s.imageUrl||"",y=s.video||s.videoUrl||"",g=s.poster||p||"",A=s.jumpUrl||s.url||s.webUrl||"";return!p&&!y?null:{image:p||void 0,video:y||void 0,poster:g||void 0,title:s.title,description:s.description,buttonText:s.buttonText,badgeText:s.badgeText,jumpSeconds:s.jumpSeconds,loadTimeout:s.loadTimeout||s.timeout,muted:s.muted,adSpec:s.adSpec,url:A||void 0,action:A?{type:"web",url:A}:void 0}}function $e(e,o){let s=So(e.filter(Eo)),p=bo(s),y=wo(s),g=Po(void 0,o),A=Ro(y,p),E=To(s,A);return{show:!!(y||p),adId:"",type:g,provider:A,priority:E,unitId:y,customAd:p,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:e}}async function Dn(e){let o=e.placementId||e.adId||"",s=go(e,o),p=Ao(s);if(p)return w.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:s,placementId:o}),k(Yt.SUCCESS,"\u6210\u529F",p);let y=gn.get(s);if(y)return w.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:s,placementId:o}),y;let g=(async()=>{try{w.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",e);let A=await hr({placementId:o}),E=vo(A);if(w.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:s,placementId:o,response:A,body:E}),Io(A)||!E)return w.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",A),k(Yt.UNKNOWN_ERROR,(A==null?void 0:A.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let U=$e(E,e.type);return U.adId=o,U.cache=Wt(ut({},U.cache),{enable:!0,ttl:_r}),Do(s,U),w.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:s,placementId:o,provider:U.provider,priority:U.priority,hasUnitId:!!U.unitId,hasCustomAd:!!U.customAd}),k(Yt.SUCCESS,"\u6210\u529F",U)}catch(A){return w.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:s,placementId:o,error:A}),k(Yt.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{gn.delete(s)}})();return gn.set(s,g),g}function No(e={}){w.info("\u670D\u52A1\u521D\u59CB\u5316",e);let o=ut(ut({},Re),e);o.env&&!Ve[o.env]&&(w.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${o.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),o.env=Qt.PROD),o.externalEnv&&!Ne[o.externalEnv]&&(w.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${o.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),o.externalEnv=le.PROD),o.debug!==void 0&&w.setEnable(o.debug),Fn(o),w.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",o)}function Dr(e={}){let o="",s=null;async function p(){if(typeof e.getAuthToken=="function"){let g=await e.getAuthToken();if(g)return g}return s&&typeof s.getStorage=="function"&&s.getStorage("auth_token")||""}let y={name:"services",setToken(g){return o=g||"",s&&typeof s.setStorage=="function"&&s.setStorage("auth_token",o),y},async getAuthToken(){return o||p()},clearToken(){return o="",s&&typeof s.setStorage=="function"&&s.setStorage("auth_token",""),y},install(g){s=g;let A=Wt(ut({},e),{getAuthToken:()=>y.getAuthToken()});No(A),w.info("services installed via nova.use()"),Object.assign(g,{jd:ut({},pn),dy:ut({},mn),ads:ut({},vn),setToken:y.setToken,clearToken:y.clearToken})}};return y}0&&(module.exports={DyErrorCode,DyErrorMessage,ENV_TYPE,EXTERNAL_ENV_TYPE,JdErrorCode,JdErrorMessage,createServices,getDisplayAdConfig,getDyPayRtaData,handleDyJsapiPayFlow,handleDyPayCommandFlow,handleDyPayFlow,handleJdInsurance,handleJdInsuranceExt,handleJdjrCashLoanExt,handleJdjrCashLoanFlow,normalizeDisplayAdData});
|
|
5
5
|
/*! For license information please see LyyGetCommandSDK.min.js.LICENSE.txt */
|