@bi-nova/services 1.3.4-beta.202606031412 → 1.3.4-beta.202606041618
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 +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Ye=Object.defineProperty,pn=Object.defineProperties,hn=Object.getOwnPropertyDescriptor,yn=Object.getOwnPropertyDescriptors,gn=Object.getOwnPropertyNames,Dr=Object.getOwnPropertySymbols;var Ir=Object.prototype.hasOwnProperty,mn=Object.prototype.propertyIsEnumerable;var $e=(o,a,u)=>a in o?Ye(o,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):o[a]=u,gt=(o,a)=>{for(var u in a||(a={}))Ir.call(a,u)&&$e(o,u,a[u]);if(Dr)for(var u of Dr(a))mn.call(a,u)&&$e(o,u,a[u]);return o},Zt=(o,a)=>pn(o,yn(a));var _n=(o,a)=>()=>(a||o((a={exports:{}}).exports,a),a.exports),Me=(o,a)=>{for(var u in a)Ye(o,u,{get:a[u],enumerable:!0})},vn=(o,a,u,_)=>{if(a&&typeof a=="object"||typeof a=="function")for(let g of gn(a))!Ir.call(o,g)&&g!==u&&Ye(o,g,{get:()=>a[g],enumerable:!(_=hn(a,g))||_.enumerable});return o};var An=o=>vn(Ye({},"__esModule",{value:!0}),o);var je=(o,a,u)=>$e(o,typeof a!="symbol"?a+"":a,u);var Mr=_n((Fo,Yr)=>{"use strict";(()=>{var o={737:(g,R,P)=>{"use strict";P.r(R),P.d(R,{default:()=>C,getJrCommand:()=>S});var B=P(307),q=P.n(B);function rt(){rt=function(){return V};var v,V={},At=Object.prototype,ct=At.hasOwnProperty,Dt=Object.defineProperty||function(d,l,y){d[l]=y.value},lt=typeof Symbol=="function"?Symbol:{},mt=lt.iterator||"@@iterator",It=lt.asyncIterator||"@@asyncIterator",Rt=lt.toStringTag||"@@toStringTag";function pt(d,l,y){return Object.defineProperty(d,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),d[l]}try{pt({},"")}catch(d){pt=function(l,y,F){return l[y]=F}}function Vt(d,l,y,F){var D=l&&l.prototype instanceof ie?l:ie,U=Object.create(D.prototype),nt=new le(F||[]);return Dt(U,"_invoke",{value:Ot(d,y,nt)}),U}function Ht(d,l,y){try{return{type:"normal",arg:d.call(l,y)}}catch(F){return{type:"throw",arg:F}}}V.wrap=Vt;var kt="suspendedStart",$t="suspendedYield",Gt="executing",Pt="completed",wt={};function ie(){}function ne(){}function jt(){}var ae={};pt(ae,mt,(function(){return this}));var oe=Object.getPrototypeOf,Lt=oe&&oe(oe(ee([])));Lt&&Lt!==At&&ct.call(Lt,mt)&&(ae=Lt);var Jt=jt.prototype=ie.prototype=Object.create(ae);function he(d){["next","throw","return"].forEach((function(l){pt(d,l,(function(y){return this._invoke(l,y)}))}))}function zt(d,l){function y(D,U,nt,vt){var yt=Ht(d[D],d,U);if(yt.type!=="throw"){var Xt=yt.arg,Qt=Xt.value;return Qt&&Q(Qt)=="object"&&ct.call(Qt,"__await")?l.resolve(Qt.__await).then((function(Et){y("next",Et,nt,vt)}),(function(Et){y("throw",Et,nt,vt)})):l.resolve(Qt).then((function(Et){Xt.value=Et,nt(Xt)}),(function(Et){return y("throw",Et,nt,vt)}))}vt(yt.arg)}var F;Dt(this,"_invoke",{value:function(D,U){function nt(){return new l((function(vt,yt){y(D,U,vt,yt)}))}return F=F?F.then(nt,nt):nt()}})}function Ot(d,l,y){var F=kt;return function(D,U){if(F===Gt)throw Error("Generator is already running");if(F===Pt){if(D==="throw")throw U;return{value:v,done:!0}}for(y.method=D,y.arg=U;;){var nt=y.delegate;if(nt){var vt=Ut(nt,y);if(vt){if(vt===wt)continue;return vt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(F===kt)throw F=Pt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);F=Gt;var yt=Ht(d,l,y);if(yt.type==="normal"){if(F=y.done?Pt:$t,yt.arg===wt)continue;return{value:yt.arg,done:y.done}}yt.type==="throw"&&(F=Pt,y.method="throw",y.arg=yt.arg)}}}function Ut(d,l){var y=l.method,F=d.iterator[y];if(F===v)return l.delegate=null,y==="throw"&&d.iterator.return&&(l.method="return",l.arg=v,Ut(d,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),wt;var D=Ht(F,d.iterator,l.arg);if(D.type==="throw")return l.method="throw",l.arg=D.arg,l.delegate=null,wt;var U=D.arg;return U?U.done?(l[d.resultName]=U.value,l.next=d.nextLoc,l.method!=="return"&&(l.method="next",l.arg=v),l.delegate=null,wt):U:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,wt)}function te(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 ce(d){var l=d.completion||{};l.type="normal",delete l.arg,d.completion=l}function le(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(te,this),this.reset(!0)}function ee(d){if(d||d===""){var l=d[mt];if(l)return l.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var y=-1,F=function D(){for(;++y<d.length;)if(ct.call(d,y))return D.value=d[y],D.done=!1,D;return D.value=v,D.done=!0,D};return F.next=F}}throw new TypeError(Q(d)+" is not iterable")}return ne.prototype=jt,Dt(Jt,"constructor",{value:jt,configurable:!0}),Dt(jt,"constructor",{value:ne,configurable:!0}),ne.displayName=pt(jt,Rt,"GeneratorFunction"),V.isGeneratorFunction=function(d){var l=typeof d=="function"&&d.constructor;return!!l&&(l===ne||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,jt):(d.__proto__=jt,pt(d,Rt,"GeneratorFunction")),d.prototype=Object.create(Jt),d},V.awrap=function(d){return{__await:d}},he(zt.prototype),pt(zt.prototype,It,(function(){return this})),V.AsyncIterator=zt,V.async=function(d,l,y,F,D){D===void 0&&(D=Promise);var U=new zt(Vt(d,l,y,F),D);return V.isGeneratorFunction(l)?U:U.next().then((function(nt){return nt.done?nt.value:U.next()}))},he(Jt),pt(Jt,Rt,"Generator"),pt(Jt,mt,(function(){return this})),pt(Jt,"toString",(function(){return"[object Generator]"})),V.keys=function(d){var l=Object(d),y=[];for(var F in l)y.push(F);return y.reverse(),function D(){for(;y.length;){var U=y.pop();if(U in l)return D.value=U,D.done=!1,D}return D.done=!0,D}},V.values=ee,le.prototype={constructor:le,reset:function(d){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(ce),!d)for(var l in this)l.charAt(0)==="t"&&ct.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=v)},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 y(yt,Xt){return U.type="throw",U.arg=d,l.next=yt,Xt&&(l.method="next",l.arg=v),!!Xt}for(var F=this.tryEntries.length-1;F>=0;--F){var D=this.tryEntries[F],U=D.completion;if(D.tryLoc==="root")return y("end");if(D.tryLoc<=this.prev){var nt=ct.call(D,"catchLoc"),vt=ct.call(D,"finallyLoc");if(nt&&vt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0);if(this.prev<D.finallyLoc)return y(D.finallyLoc)}else if(nt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0)}else{if(!vt)throw Error("try statement without catch or finally");if(this.prev<D.finallyLoc)return y(D.finallyLoc)}}}},abrupt:function(d,l){for(var y=this.tryEntries.length-1;y>=0;--y){var F=this.tryEntries[y];if(F.tryLoc<=this.prev&&ct.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var D=F;break}}D&&(d==="break"||d==="continue")&&D.tryLoc<=l&&l<=D.finallyLoc&&(D=null);var U=D?D.completion:{};return U.type=d,U.arg=l,D?(this.method="next",this.next=D.finallyLoc,wt):this.complete(U)},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),wt},finish:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===d)return this.complete(y.completion,y.afterLoc),ce(y),wt}},catch:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===d){var F=y.completion;if(F.type==="throw"){var D=F.arg;ce(y)}return D}}throw Error("illegal catch attempt")},delegateYield:function(d,l,y){return this.delegate={iterator:ee(d),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=v),wt}},V}function at(v,V,At,ct,Dt,lt,mt){try{var It=v[lt](mt),Rt=It.value}catch(pt){return void At(pt)}It.done?V(Rt):Promise.resolve(Rt).then(ct,Dt)}function Q(v){return Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},Q(v)}var $="https://ms.jr.jd.com";function ve(v){var V=v.host,At=v.type,ct=At===void 0?"post":At,Dt=v.data,lt=v.path,mt=lt===void 0?"":lt,It=v.config,Rt=It===void 0?{}:It,pt=(Rt.withCredentials,Rt.isWG),Vt=pt===void 0||pt,Ht=Rt.contentType,kt=Ht===void 0?"application/x-www-form-urlencoded":Ht;return new Promise((function($t,Gt){wx.request({url:(V||$)+mt,method:ct.toUpperCase(),data:Vt?I({reqData:JSON.stringify(Dt)}):Dt,header:{"content-type":kt},success:function(Pt){Pt.statusCode===200?$t(Pt.data):Gt({statusCode:Pt.statusCode,errMsg:Pt.errMsg,data:Pt.data})},fail:function(Pt){Gt(Pt)}})}))}function I(v){var V="";return Q(v)==="object"&&v!==null&&(Object.keys(v).map((function(At){var ct=v[At];return V+=At+"="+encodeURIComponent(ct)+"&",""})),V.length>0&&(V=V.substr(0,V.length-1))),V}function Z(v){return ht.apply(this,arguments)}function ht(){var v;return v=rt().mark((function V(At){var ct,Dt,lt,mt,It,Rt,pt,Vt,Ht,kt;return rt().wrap((function($t){for(;;)switch($t.prev=$t.next){case 0:return ct=At.url,Dt=At.channel,lt=At.callback,q().init(),mt=new(q()),It=mt.nonce(),Rt=mt.sign(JSON.stringify({t:"".concat(new Date().getTime())}),It),pt="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),Vt="",Ht={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:ct,channel:Dt,clientCode:"0",antiRushInfo:Rt}},$t.next=12,ve({host:"https://ms.jr.jd.com",type:"post",path:pt,config:{withCredentials:!0},data:Ht});case 12:(kt=$t.sent).resultCode===0&&kt.resultData&&kt.resultData.code==="00000"&&kt.resultData.data&&(Vt=kt.resultData.data.goldenKeyText),lt&<(Vt?{code:"0",msg:"command success",data:Vt}:{code:"-1",msg:"command empty"});case 15:case"end":return $t.stop()}}),V)})),ht=function(){var V=this,At=arguments;return new Promise((function(ct,Dt){var lt=v.apply(V,At);function mt(Rt){at(lt,ct,Dt,mt,It,"next",Rt)}function It(Rt){at(lt,ct,Dt,mt,It,"throw",Rt)}mt(void 0)}))},ht.apply(this,arguments)}function ot(v){return ot=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},ot(v)}function k(){k=function(){return V};var v,V={},At=Object.prototype,ct=At.hasOwnProperty,Dt=Object.defineProperty||function(d,l,y){d[l]=y.value},lt=typeof Symbol=="function"?Symbol:{},mt=lt.iterator||"@@iterator",It=lt.asyncIterator||"@@asyncIterator",Rt=lt.toStringTag||"@@toStringTag";function pt(d,l,y){return Object.defineProperty(d,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),d[l]}try{pt({},"")}catch(d){pt=function(l,y,F){return l[y]=F}}function Vt(d,l,y,F){var D=l&&l.prototype instanceof ie?l:ie,U=Object.create(D.prototype),nt=new le(F||[]);return Dt(U,"_invoke",{value:Ot(d,y,nt)}),U}function Ht(d,l,y){try{return{type:"normal",arg:d.call(l,y)}}catch(F){return{type:"throw",arg:F}}}V.wrap=Vt;var kt="suspendedStart",$t="suspendedYield",Gt="executing",Pt="completed",wt={};function ie(){}function ne(){}function jt(){}var ae={};pt(ae,mt,(function(){return this}));var oe=Object.getPrototypeOf,Lt=oe&&oe(oe(ee([])));Lt&&Lt!==At&&ct.call(Lt,mt)&&(ae=Lt);var Jt=jt.prototype=ie.prototype=Object.create(ae);function he(d){["next","throw","return"].forEach((function(l){pt(d,l,(function(y){return this._invoke(l,y)}))}))}function zt(d,l){function y(D,U,nt,vt){var yt=Ht(d[D],d,U);if(yt.type!=="throw"){var Xt=yt.arg,Qt=Xt.value;return Qt&&ot(Qt)=="object"&&ct.call(Qt,"__await")?l.resolve(Qt.__await).then((function(Et){y("next",Et,nt,vt)}),(function(Et){y("throw",Et,nt,vt)})):l.resolve(Qt).then((function(Et){Xt.value=Et,nt(Xt)}),(function(Et){return y("throw",Et,nt,vt)}))}vt(yt.arg)}var F;Dt(this,"_invoke",{value:function(D,U){function nt(){return new l((function(vt,yt){y(D,U,vt,yt)}))}return F=F?F.then(nt,nt):nt()}})}function Ot(d,l,y){var F=kt;return function(D,U){if(F===Gt)throw Error("Generator is already running");if(F===Pt){if(D==="throw")throw U;return{value:v,done:!0}}for(y.method=D,y.arg=U;;){var nt=y.delegate;if(nt){var vt=Ut(nt,y);if(vt){if(vt===wt)continue;return vt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(F===kt)throw F=Pt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);F=Gt;var yt=Ht(d,l,y);if(yt.type==="normal"){if(F=y.done?Pt:$t,yt.arg===wt)continue;return{value:yt.arg,done:y.done}}yt.type==="throw"&&(F=Pt,y.method="throw",y.arg=yt.arg)}}}function Ut(d,l){var y=l.method,F=d.iterator[y];if(F===v)return l.delegate=null,y==="throw"&&d.iterator.return&&(l.method="return",l.arg=v,Ut(d,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),wt;var D=Ht(F,d.iterator,l.arg);if(D.type==="throw")return l.method="throw",l.arg=D.arg,l.delegate=null,wt;var U=D.arg;return U?U.done?(l[d.resultName]=U.value,l.next=d.nextLoc,l.method!=="return"&&(l.method="next",l.arg=v),l.delegate=null,wt):U:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,wt)}function te(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 ce(d){var l=d.completion||{};l.type="normal",delete l.arg,d.completion=l}function le(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(te,this),this.reset(!0)}function ee(d){if(d||d===""){var l=d[mt];if(l)return l.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var y=-1,F=function D(){for(;++y<d.length;)if(ct.call(d,y))return D.value=d[y],D.done=!1,D;return D.value=v,D.done=!0,D};return F.next=F}}throw new TypeError(ot(d)+" is not iterable")}return ne.prototype=jt,Dt(Jt,"constructor",{value:jt,configurable:!0}),Dt(jt,"constructor",{value:ne,configurable:!0}),ne.displayName=pt(jt,Rt,"GeneratorFunction"),V.isGeneratorFunction=function(d){var l=typeof d=="function"&&d.constructor;return!!l&&(l===ne||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,jt):(d.__proto__=jt,pt(d,Rt,"GeneratorFunction")),d.prototype=Object.create(Jt),d},V.awrap=function(d){return{__await:d}},he(zt.prototype),pt(zt.prototype,It,(function(){return this})),V.AsyncIterator=zt,V.async=function(d,l,y,F,D){D===void 0&&(D=Promise);var U=new zt(Vt(d,l,y,F),D);return V.isGeneratorFunction(l)?U:U.next().then((function(nt){return nt.done?nt.value:U.next()}))},he(Jt),pt(Jt,Rt,"Generator"),pt(Jt,mt,(function(){return this})),pt(Jt,"toString",(function(){return"[object Generator]"})),V.keys=function(d){var l=Object(d),y=[];for(var F in l)y.push(F);return y.reverse(),function D(){for(;y.length;){var U=y.pop();if(U in l)return D.value=U,D.done=!1,D}return D.done=!0,D}},V.values=ee,le.prototype={constructor:le,reset:function(d){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(ce),!d)for(var l in this)l.charAt(0)==="t"&&ct.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=v)},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 y(yt,Xt){return U.type="throw",U.arg=d,l.next=yt,Xt&&(l.method="next",l.arg=v),!!Xt}for(var F=this.tryEntries.length-1;F>=0;--F){var D=this.tryEntries[F],U=D.completion;if(D.tryLoc==="root")return y("end");if(D.tryLoc<=this.prev){var nt=ct.call(D,"catchLoc"),vt=ct.call(D,"finallyLoc");if(nt&&vt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0);if(this.prev<D.finallyLoc)return y(D.finallyLoc)}else if(nt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0)}else{if(!vt)throw Error("try statement without catch or finally");if(this.prev<D.finallyLoc)return y(D.finallyLoc)}}}},abrupt:function(d,l){for(var y=this.tryEntries.length-1;y>=0;--y){var F=this.tryEntries[y];if(F.tryLoc<=this.prev&&ct.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var D=F;break}}D&&(d==="break"||d==="continue")&&D.tryLoc<=l&&l<=D.finallyLoc&&(D=null);var U=D?D.completion:{};return U.type=d,U.arg=l,D?(this.method="next",this.next=D.finallyLoc,wt):this.complete(U)},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),wt},finish:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===d)return this.complete(y.completion,y.afterLoc),ce(y),wt}},catch:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===d){var F=y.completion;if(F.type==="throw"){var D=F.arg;ce(y)}return D}}throw Error("illegal catch attempt")},delegateYield:function(d,l,y){return this.delegate={iterator:ee(d),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=v),wt}},V}function Tt(v,V,At,ct,Dt,lt,mt){try{var It=v[lt](mt),Rt=It.value}catch(pt){return void At(pt)}It.done?V(Rt):Promise.resolve(Rt).then(ct,Dt)}function S(v){return b.apply(this,arguments)}function b(){var v;return v=k().mark((function V(At){var ct,Dt,lt;return k().wrap((function(mt){for(;;)switch(mt.prev=mt.next){case 0:return ct=At.url,Dt=At.channel,lt=At.callback,mt.next=3,Z({url:ct,channel:Dt,callback:lt});case 3:case"end":return mt.stop()}}),V)})),b=function(){var V=this,At=arguments;return new Promise((function(ct,Dt){var lt=v.apply(V,At);function mt(Rt){Tt(lt,ct,Dt,mt,It,"next",Rt)}function It(Rt){Tt(lt,ct,Dt,mt,It,"throw",Rt)}mt(void 0)}))},b.apply(this,arguments)}var m={getJrCommand:S};(g=P.hmd(g)).exports&&(g.exports=m,g.exports.getJrCommand=S),typeof window!="undefined"&&(window.LyyGetCommandSDK=m);let C=m},307:function(g,R,P){var B,q,rt;function at(Q){return at=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},at(Q)}rt=function(){"use strict";function Q(t){return(Q=typeof Symbol=="function"&&at(Symbol.iterator)=="symbol"?function(r){return at(r)}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":at(r)})(t)}function $(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function ve(t,r){for(var s=0;s<r.length;s++){var c=r[s];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function I(t,r,s){return r&&ve(t.prototype,r),s&&ve(t,s),t}function Z(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&&ot(t,r)}function ht(t){return(ht=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(t)}function ot(t,r){return(ot=Object.setPrototypeOf||function(s,c){return s.__proto__=c,s})(t,r)}function k(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(s){return!1}})();return function(){var s,c=ht(t);return(function(p,h){if(h&&(at(h)=="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E})(p)})(this,r?(s=ht(this).constructor,Reflect.construct(c,arguments,s)):c.apply(this,arguments))}}function Tt(t){return(function(r){if(Array.isArray(r))return S(r)})(t)||(function(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)})(t)||(function(r,s){if(r){if(typeof r=="string")return S(r,s);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)?S(r,s):void 0}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function S(t,r){(r==null||r>t.length)&&(r=t.length);for(var s=0,c=new Array(r);s<r;s++)c[s]=t[s];return c}var b=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:P.g!==void 0?P.g:typeof self!="undefined"?self:{},m=!1,C=!1,
|
|
1
|
+
"use strict";var Ue=Object.defineProperty,pn=Object.defineProperties,hn=Object.getOwnPropertyDescriptor,yn=Object.getOwnPropertyDescriptors,gn=Object.getOwnPropertyNames,Dr=Object.getOwnPropertySymbols;var Ir=Object.prototype.hasOwnProperty,mn=Object.prototype.propertyIsEnumerable;var ze=(o,a,u)=>a in o?Ue(o,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):o[a]=u,gt=(o,a)=>{for(var u in a||(a={}))Ir.call(a,u)&&ze(o,u,a[u]);if(Dr)for(var u of Dr(a))mn.call(a,u)&&ze(o,u,a[u]);return o},Zt=(o,a)=>pn(o,yn(a));var _n=(o,a)=>()=>(a||o((a={exports:{}}).exports,a),a.exports),Ye=(o,a)=>{for(var u in a)Ue(o,u,{get:a[u],enumerable:!0})},vn=(o,a,u,v)=>{if(a&&typeof a=="object"||typeof a=="function")for(let g of gn(a))!Ir.call(o,g)&&g!==u&&Ue(o,g,{get:()=>a[g],enumerable:!(v=hn(a,g))||v.enumerable});return o};var An=o=>vn(Ue({},"__esModule",{value:!0}),o);var Me=(o,a,u)=>ze(o,typeof a!="symbol"?a+"":a,u);var Mr=_n((Fo,Yr)=>{"use strict";(()=>{var o={737:(g,R,P)=>{"use strict";P.r(R),P.d(R,{default:()=>C,getJrCommand:()=>S});var B=P(307),q=P.n(B);function rt(){rt=function(){return V};var _,V={},At=Object.prototype,ct=At.hasOwnProperty,Dt=Object.defineProperty||function(d,l,y){d[l]=y.value},lt=typeof Symbol=="function"?Symbol:{},mt=lt.iterator||"@@iterator",It=lt.asyncIterator||"@@asyncIterator",Rt=lt.toStringTag||"@@toStringTag";function pt(d,l,y){return Object.defineProperty(d,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),d[l]}try{pt({},"")}catch(d){pt=function(l,y,F){return l[y]=F}}function Vt(d,l,y,F){var D=l&&l.prototype instanceof ie?l:ie,U=Object.create(D.prototype),nt=new le(F||[]);return Dt(U,"_invoke",{value:Ot(d,y,nt)}),U}function Ht(d,l,y){try{return{type:"normal",arg:d.call(l,y)}}catch(F){return{type:"throw",arg:F}}}V.wrap=Vt;var Jt="suspendedStart",zt="suspendedYield",Gt="executing",Pt="completed",wt={};function ie(){}function ne(){}function jt(){}var ae={};pt(ae,mt,(function(){return this}));var oe=Object.getPrototypeOf,Lt=oe&&oe(oe(ee([])));Lt&&Lt!==At&&ct.call(Lt,mt)&&(ae=Lt);var kt=jt.prototype=ie.prototype=Object.create(ae);function he(d){["next","throw","return"].forEach((function(l){pt(d,l,(function(y){return this._invoke(l,y)}))}))}function Qt(d,l){function y(D,U,nt,vt){var yt=Ht(d[D],d,U);if(yt.type!=="throw"){var Xt=yt.arg,$t=Xt.value;return $t&&$($t)=="object"&&ct.call($t,"__await")?l.resolve($t.__await).then((function(Et){y("next",Et,nt,vt)}),(function(Et){y("throw",Et,nt,vt)})):l.resolve($t).then((function(Et){Xt.value=Et,nt(Xt)}),(function(Et){return y("throw",Et,nt,vt)}))}vt(yt.arg)}var F;Dt(this,"_invoke",{value:function(D,U){function nt(){return new l((function(vt,yt){y(D,U,vt,yt)}))}return F=F?F.then(nt,nt):nt()}})}function Ot(d,l,y){var F=Jt;return function(D,U){if(F===Gt)throw Error("Generator is already running");if(F===Pt){if(D==="throw")throw U;return{value:_,done:!0}}for(y.method=D,y.arg=U;;){var nt=y.delegate;if(nt){var vt=Ut(nt,y);if(vt){if(vt===wt)continue;return vt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(F===Jt)throw F=Pt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);F=Gt;var yt=Ht(d,l,y);if(yt.type==="normal"){if(F=y.done?Pt:zt,yt.arg===wt)continue;return{value:yt.arg,done:y.done}}yt.type==="throw"&&(F=Pt,y.method="throw",y.arg=yt.arg)}}}function Ut(d,l){var y=l.method,F=d.iterator[y];if(F===_)return l.delegate=null,y==="throw"&&d.iterator.return&&(l.method="return",l.arg=_,Ut(d,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),wt;var D=Ht(F,d.iterator,l.arg);if(D.type==="throw")return l.method="throw",l.arg=D.arg,l.delegate=null,wt;var U=D.arg;return U?U.done?(l[d.resultName]=U.value,l.next=d.nextLoc,l.method!=="return"&&(l.method="next",l.arg=_),l.delegate=null,wt):U:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,wt)}function te(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 ce(d){var l=d.completion||{};l.type="normal",delete l.arg,d.completion=l}function le(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(te,this),this.reset(!0)}function ee(d){if(d||d===""){var l=d[mt];if(l)return l.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var y=-1,F=function D(){for(;++y<d.length;)if(ct.call(d,y))return D.value=d[y],D.done=!1,D;return D.value=_,D.done=!0,D};return F.next=F}}throw new TypeError($(d)+" is not iterable")}return ne.prototype=jt,Dt(kt,"constructor",{value:jt,configurable:!0}),Dt(jt,"constructor",{value:ne,configurable:!0}),ne.displayName=pt(jt,Rt,"GeneratorFunction"),V.isGeneratorFunction=function(d){var l=typeof d=="function"&&d.constructor;return!!l&&(l===ne||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,jt):(d.__proto__=jt,pt(d,Rt,"GeneratorFunction")),d.prototype=Object.create(kt),d},V.awrap=function(d){return{__await:d}},he(Qt.prototype),pt(Qt.prototype,It,(function(){return this})),V.AsyncIterator=Qt,V.async=function(d,l,y,F,D){D===void 0&&(D=Promise);var U=new Qt(Vt(d,l,y,F),D);return V.isGeneratorFunction(l)?U:U.next().then((function(nt){return nt.done?nt.value:U.next()}))},he(kt),pt(kt,Rt,"Generator"),pt(kt,mt,(function(){return this})),pt(kt,"toString",(function(){return"[object Generator]"})),V.keys=function(d){var l=Object(d),y=[];for(var F in l)y.push(F);return y.reverse(),function D(){for(;y.length;){var U=y.pop();if(U in l)return D.value=U,D.done=!1,D}return D.done=!0,D}},V.values=ee,le.prototype={constructor:le,reset:function(d){if(this.prev=0,this.next=0,this.sent=this._sent=_,this.done=!1,this.delegate=null,this.method="next",this.arg=_,this.tryEntries.forEach(ce),!d)for(var l in this)l.charAt(0)==="t"&&ct.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=_)},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 y(yt,Xt){return U.type="throw",U.arg=d,l.next=yt,Xt&&(l.method="next",l.arg=_),!!Xt}for(var F=this.tryEntries.length-1;F>=0;--F){var D=this.tryEntries[F],U=D.completion;if(D.tryLoc==="root")return y("end");if(D.tryLoc<=this.prev){var nt=ct.call(D,"catchLoc"),vt=ct.call(D,"finallyLoc");if(nt&&vt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0);if(this.prev<D.finallyLoc)return y(D.finallyLoc)}else if(nt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0)}else{if(!vt)throw Error("try statement without catch or finally");if(this.prev<D.finallyLoc)return y(D.finallyLoc)}}}},abrupt:function(d,l){for(var y=this.tryEntries.length-1;y>=0;--y){var F=this.tryEntries[y];if(F.tryLoc<=this.prev&&ct.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var D=F;break}}D&&(d==="break"||d==="continue")&&D.tryLoc<=l&&l<=D.finallyLoc&&(D=null);var U=D?D.completion:{};return U.type=d,U.arg=l,D?(this.method="next",this.next=D.finallyLoc,wt):this.complete(U)},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),wt},finish:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===d)return this.complete(y.completion,y.afterLoc),ce(y),wt}},catch:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===d){var F=y.completion;if(F.type==="throw"){var D=F.arg;ce(y)}return D}}throw Error("illegal catch attempt")},delegateYield:function(d,l,y){return this.delegate={iterator:ee(d),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=_),wt}},V}function at(_,V,At,ct,Dt,lt,mt){try{var It=_[lt](mt),Rt=It.value}catch(pt){return void At(pt)}It.done?V(Rt):Promise.resolve(Rt).then(ct,Dt)}function $(_){return $=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},$(_)}var z="https://ms.jr.jd.com";function ve(_){var V=_.host,At=_.type,ct=At===void 0?"post":At,Dt=_.data,lt=_.path,mt=lt===void 0?"":lt,It=_.config,Rt=It===void 0?{}:It,pt=(Rt.withCredentials,Rt.isWG),Vt=pt===void 0||pt,Ht=Rt.contentType,Jt=Ht===void 0?"application/x-www-form-urlencoded":Ht;return new Promise((function(zt,Gt){wx.request({url:(V||z)+mt,method:ct.toUpperCase(),data:Vt?I({reqData:JSON.stringify(Dt)}):Dt,header:{"content-type":Jt},success:function(Pt){Pt.statusCode===200?zt(Pt.data):Gt({statusCode:Pt.statusCode,errMsg:Pt.errMsg,data:Pt.data})},fail:function(Pt){Gt(Pt)}})}))}function I(_){var V="";return $(_)==="object"&&_!==null&&(Object.keys(_).map((function(At){var ct=_[At];return V+=At+"="+encodeURIComponent(ct)+"&",""})),V.length>0&&(V=V.substr(0,V.length-1))),V}function Z(_){return ht.apply(this,arguments)}function ht(){var _;return _=rt().mark((function V(At){var ct,Dt,lt,mt,It,Rt,pt,Vt,Ht,Jt;return rt().wrap((function(zt){for(;;)switch(zt.prev=zt.next){case 0:return ct=At.url,Dt=At.channel,lt=At.callback,q().init(),mt=new(q()),It=mt.nonce(),Rt=mt.sign(JSON.stringify({t:"".concat(new Date().getTime())}),It),pt="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),Vt="",Ht={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:ct,channel:Dt,clientCode:"0",antiRushInfo:Rt}},zt.next=12,ve({host:"https://ms.jr.jd.com",type:"post",path:pt,config:{withCredentials:!0},data:Ht});case 12:(Jt=zt.sent).resultCode===0&&Jt.resultData&&Jt.resultData.code==="00000"&&Jt.resultData.data&&(Vt=Jt.resultData.data.goldenKeyText),lt&<(Vt?{code:"0",msg:"command success",data:Vt}:{code:"-1",msg:"command empty"});case 15:case"end":return zt.stop()}}),V)})),ht=function(){var V=this,At=arguments;return new Promise((function(ct,Dt){var lt=_.apply(V,At);function mt(Rt){at(lt,ct,Dt,mt,It,"next",Rt)}function It(Rt){at(lt,ct,Dt,mt,It,"throw",Rt)}mt(void 0)}))},ht.apply(this,arguments)}function ot(_){return ot=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},ot(_)}function J(){J=function(){return V};var _,V={},At=Object.prototype,ct=At.hasOwnProperty,Dt=Object.defineProperty||function(d,l,y){d[l]=y.value},lt=typeof Symbol=="function"?Symbol:{},mt=lt.iterator||"@@iterator",It=lt.asyncIterator||"@@asyncIterator",Rt=lt.toStringTag||"@@toStringTag";function pt(d,l,y){return Object.defineProperty(d,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),d[l]}try{pt({},"")}catch(d){pt=function(l,y,F){return l[y]=F}}function Vt(d,l,y,F){var D=l&&l.prototype instanceof ie?l:ie,U=Object.create(D.prototype),nt=new le(F||[]);return Dt(U,"_invoke",{value:Ot(d,y,nt)}),U}function Ht(d,l,y){try{return{type:"normal",arg:d.call(l,y)}}catch(F){return{type:"throw",arg:F}}}V.wrap=Vt;var Jt="suspendedStart",zt="suspendedYield",Gt="executing",Pt="completed",wt={};function ie(){}function ne(){}function jt(){}var ae={};pt(ae,mt,(function(){return this}));var oe=Object.getPrototypeOf,Lt=oe&&oe(oe(ee([])));Lt&&Lt!==At&&ct.call(Lt,mt)&&(ae=Lt);var kt=jt.prototype=ie.prototype=Object.create(ae);function he(d){["next","throw","return"].forEach((function(l){pt(d,l,(function(y){return this._invoke(l,y)}))}))}function Qt(d,l){function y(D,U,nt,vt){var yt=Ht(d[D],d,U);if(yt.type!=="throw"){var Xt=yt.arg,$t=Xt.value;return $t&&ot($t)=="object"&&ct.call($t,"__await")?l.resolve($t.__await).then((function(Et){y("next",Et,nt,vt)}),(function(Et){y("throw",Et,nt,vt)})):l.resolve($t).then((function(Et){Xt.value=Et,nt(Xt)}),(function(Et){return y("throw",Et,nt,vt)}))}vt(yt.arg)}var F;Dt(this,"_invoke",{value:function(D,U){function nt(){return new l((function(vt,yt){y(D,U,vt,yt)}))}return F=F?F.then(nt,nt):nt()}})}function Ot(d,l,y){var F=Jt;return function(D,U){if(F===Gt)throw Error("Generator is already running");if(F===Pt){if(D==="throw")throw U;return{value:_,done:!0}}for(y.method=D,y.arg=U;;){var nt=y.delegate;if(nt){var vt=Ut(nt,y);if(vt){if(vt===wt)continue;return vt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(F===Jt)throw F=Pt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);F=Gt;var yt=Ht(d,l,y);if(yt.type==="normal"){if(F=y.done?Pt:zt,yt.arg===wt)continue;return{value:yt.arg,done:y.done}}yt.type==="throw"&&(F=Pt,y.method="throw",y.arg=yt.arg)}}}function Ut(d,l){var y=l.method,F=d.iterator[y];if(F===_)return l.delegate=null,y==="throw"&&d.iterator.return&&(l.method="return",l.arg=_,Ut(d,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),wt;var D=Ht(F,d.iterator,l.arg);if(D.type==="throw")return l.method="throw",l.arg=D.arg,l.delegate=null,wt;var U=D.arg;return U?U.done?(l[d.resultName]=U.value,l.next=d.nextLoc,l.method!=="return"&&(l.method="next",l.arg=_),l.delegate=null,wt):U:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,wt)}function te(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 ce(d){var l=d.completion||{};l.type="normal",delete l.arg,d.completion=l}function le(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(te,this),this.reset(!0)}function ee(d){if(d||d===""){var l=d[mt];if(l)return l.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var y=-1,F=function D(){for(;++y<d.length;)if(ct.call(d,y))return D.value=d[y],D.done=!1,D;return D.value=_,D.done=!0,D};return F.next=F}}throw new TypeError(ot(d)+" is not iterable")}return ne.prototype=jt,Dt(kt,"constructor",{value:jt,configurable:!0}),Dt(jt,"constructor",{value:ne,configurable:!0}),ne.displayName=pt(jt,Rt,"GeneratorFunction"),V.isGeneratorFunction=function(d){var l=typeof d=="function"&&d.constructor;return!!l&&(l===ne||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,jt):(d.__proto__=jt,pt(d,Rt,"GeneratorFunction")),d.prototype=Object.create(kt),d},V.awrap=function(d){return{__await:d}},he(Qt.prototype),pt(Qt.prototype,It,(function(){return this})),V.AsyncIterator=Qt,V.async=function(d,l,y,F,D){D===void 0&&(D=Promise);var U=new Qt(Vt(d,l,y,F),D);return V.isGeneratorFunction(l)?U:U.next().then((function(nt){return nt.done?nt.value:U.next()}))},he(kt),pt(kt,Rt,"Generator"),pt(kt,mt,(function(){return this})),pt(kt,"toString",(function(){return"[object Generator]"})),V.keys=function(d){var l=Object(d),y=[];for(var F in l)y.push(F);return y.reverse(),function D(){for(;y.length;){var U=y.pop();if(U in l)return D.value=U,D.done=!1,D}return D.done=!0,D}},V.values=ee,le.prototype={constructor:le,reset:function(d){if(this.prev=0,this.next=0,this.sent=this._sent=_,this.done=!1,this.delegate=null,this.method="next",this.arg=_,this.tryEntries.forEach(ce),!d)for(var l in this)l.charAt(0)==="t"&&ct.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=_)},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 y(yt,Xt){return U.type="throw",U.arg=d,l.next=yt,Xt&&(l.method="next",l.arg=_),!!Xt}for(var F=this.tryEntries.length-1;F>=0;--F){var D=this.tryEntries[F],U=D.completion;if(D.tryLoc==="root")return y("end");if(D.tryLoc<=this.prev){var nt=ct.call(D,"catchLoc"),vt=ct.call(D,"finallyLoc");if(nt&&vt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0);if(this.prev<D.finallyLoc)return y(D.finallyLoc)}else if(nt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0)}else{if(!vt)throw Error("try statement without catch or finally");if(this.prev<D.finallyLoc)return y(D.finallyLoc)}}}},abrupt:function(d,l){for(var y=this.tryEntries.length-1;y>=0;--y){var F=this.tryEntries[y];if(F.tryLoc<=this.prev&&ct.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var D=F;break}}D&&(d==="break"||d==="continue")&&D.tryLoc<=l&&l<=D.finallyLoc&&(D=null);var U=D?D.completion:{};return U.type=d,U.arg=l,D?(this.method="next",this.next=D.finallyLoc,wt):this.complete(U)},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),wt},finish:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===d)return this.complete(y.completion,y.afterLoc),ce(y),wt}},catch:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===d){var F=y.completion;if(F.type==="throw"){var D=F.arg;ce(y)}return D}}throw Error("illegal catch attempt")},delegateYield:function(d,l,y){return this.delegate={iterator:ee(d),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=_),wt}},V}function Tt(_,V,At,ct,Dt,lt,mt){try{var It=_[lt](mt),Rt=It.value}catch(pt){return void At(pt)}It.done?V(Rt):Promise.resolve(Rt).then(ct,Dt)}function S(_){return b.apply(this,arguments)}function b(){var _;return _=J().mark((function V(At){var ct,Dt,lt;return J().wrap((function(mt){for(;;)switch(mt.prev=mt.next){case 0:return ct=At.url,Dt=At.channel,lt=At.callback,mt.next=3,Z({url:ct,channel:Dt,callback:lt});case 3:case"end":return mt.stop()}}),V)})),b=function(){var V=this,At=arguments;return new Promise((function(ct,Dt){var lt=_.apply(V,At);function mt(Rt){Tt(lt,ct,Dt,mt,It,"next",Rt)}function It(Rt){Tt(lt,ct,Dt,mt,It,"throw",Rt)}mt(void 0)}))},b.apply(this,arguments)}var m={getJrCommand:S};(g=P.hmd(g)).exports&&(g.exports=m,g.exports.getJrCommand=S),typeof window!="undefined"&&(window.LyyGetCommandSDK=m);let C=m},307:function(g,R,P){var B,q,rt;function at($){return at=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},at($)}rt=function(){"use strict";function $(t){return($=typeof Symbol=="function"&&at(Symbol.iterator)=="symbol"?function(r){return at(r)}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":at(r)})(t)}function z(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function ve(t,r){for(var s=0;s<r.length;s++){var c=r[s];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function I(t,r,s){return r&&ve(t.prototype,r),s&&ve(t,s),t}function Z(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&&ot(t,r)}function ht(t){return(ht=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(t)}function ot(t,r){return(ot=Object.setPrototypeOf||function(s,c){return s.__proto__=c,s})(t,r)}function J(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(s){return!1}})();return function(){var s,c=ht(t);return(function(p,h){if(h&&(at(h)=="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E})(p)})(this,r?(s=ht(this).constructor,Reflect.construct(c,arguments,s)):c.apply(this,arguments))}}function Tt(t){return(function(r){if(Array.isArray(r))return S(r)})(t)||(function(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)})(t)||(function(r,s){if(r){if(typeof r=="string")return S(r,s);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)?S(r,s):void 0}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function S(t,r){(r==null||r>t.length)&&(r=t.length);for(var s=0,c=new Array(r);s<r;s++)c[s]=t[s];return c}var b=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:P.g!==void 0?P.g:typeof self!="undefined"?self:{},m=!1,C=!1,_={console:!0,focus:!1,time:!1,length:!0,infinite:!1,time_interval:500,time_threshold:100,length_threshold:300},V=function(){typeof document!="undefined"&&document.hasFocus&&!document.hasFocus()&&(C=!0)},At=function(){var t=Date.now();Date.now()-t>_.time_threshold&&(C=!0)},ct=function(){var t=b.outerWidth,r=b.outerHeight,s=b.innerWidth,c=b.innerHeight;t&&r&&s&&c&&typeof t=="number"&&typeof r=="number"&&typeof s=="number"&&typeof c=="number"&&(t-s>_.length_threshold||r-c>_.length_threshold)&&(C=!0)};(Ot={}).start=function(t){if(!m){if(t&&$(t)==="object")for(var r in t)_[r]=t[r];var s;_.infinite&&(typeof window!="undefined"&&Object.prototype.toString.call(window)==="[object Window]"?typeof Function!="undefined"&&Function.constructor!==void 0&&/Function[^]*\[native code\]/.test(""+Function.constructor)&&typeof setInterval!="undefined"&&/setInterval[^]*\[native code\]/.test(""+setInterval)?new Function('setInterval(function(){!/Function[^]*[native code]/.test("" + Function.constructor) ? function(){while(1);}() : new Function("debugger")(); }, 100);')():C=!0:setInterval((function(){}),100)),_.console&&(function(){var c=new Date;c.toString=function(){for(var p=Date.now();;)if(10<Date.now()-p)return Date.now()},console.log(c),c.toString=function(){return C=!0,Date.now()}})(),_.focus&&V(),_.time&&At(),_.length&&ct(),s=setInterval((function(){s&&C&&clearInterval(s),_.focus&&V(),_.time&&At(),_.length&&ct()}),_.time_interval),m=!0}},Ot.isDebug=function(){return C};var Dt=Ot,lt=".123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-!",mt={my_b4_encode:function(t){var r=0,s=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<s;r++)t[t.length]=0;var c="";for(j=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
|
|
3
3
|
`),c+=lt[t[j]>>2]+lt[(3&t[j])<<4|t[j+1]>>4]+lt[(15&t[j+1])<<2|t[j+2]>>6]+lt[63&t[j+2]];for(r=0;r<s;r++)c+=lt[64];return c},my_b4_decode:function(t){var r=0,s=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)!=lt[64])return null;var p,h,E,O,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)p=lt.indexOf(t.charAt(r++)),h=lt.indexOf(t.charAt(r++)),E=lt.indexOf(t.charAt(r++)),O=lt.indexOf(t.charAt(r++)),w[s++]=p<<2|h>>4,w[s++]=(15&h)<<4|E>>2,w[s++]=(3&E)<<6|O;for(r=0;r<c;r++)if(w.pop()!=0)return null;return w}},It="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Rt={b4_encode:function(t){var r=0,s=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<s;r++)t[t.length]=0;var c="";for(r=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
|
|
4
|
-
`),c+=It[t[j]>>2]+It[(3&t[j])<<4|t[j+1]>>4]+It[(15&t[j+1])<<2|t[j+2]>>6]+It[63&t[j+2]];for(r=0;r<s;r++)c+="=";return c},b4_decode:function(t){var r=0,s=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 p,h,E,O,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)p=It.indexOf(t.charAt(r++)),h=It.indexOf(t.charAt(r++)),E=It.indexOf(t.charAt(r++)),O=It.indexOf(t.charAt(r++)),w[s++]=p<<2|h>>4,w[s++]=(15&h)<<4|E>>2,w[s++]=(3&E)<<6|O;for(r=0;r<c;r++)if(w.pop()!=0)return null;return w}};function pt(){}pt.encode=function(t,r,s){for(var c=new Array(2*s),p=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),h=r,E=0;h<s+r;h++,E++)c[E]=p[(255&t[h])>>4],c[++E]=p[15&t[h]];return c.join("")},pt.decode=function(t){if(t==null||t==""||t.length%2!=0)return null;for(var r=t.length/2,s=pt.toCharCodeArray(t),c=new Array(r),p=0;p<r;p++){if(48<=s[2*p]&&s[2*p]<=57)c[p]=s[2*p]-48<<4;else if(65<=s[2*p]&&s[2*p]<=70)c[p]=s[2*p]-65+10<<4;else{if(!(97<=s[2*p]&&s[2*p]<=102))return null;c[p]=s[2*p]-97+10<<4}if(48<=s[2*p+1]&&s[2*p+1]<=57)c[p]=c[p]|s[2*p+1]-48;else if(65<=s[2*p+1]&&s[2*p+1]<=70)c[p]=c[p]|s[2*p+1]-65+10;else{if(!(97<=s[2*p+1]&&s[2*p+1]<=102))return null;c[p]=c[p]|s[2*p+1]-97+10}}return c},pt.toCharCodeArray=function(t){for(var r=new Array(t.length),s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r};var Vt=pt,Ht=Vt;(Ut=function(){}).utf8StrToh6=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],p=0;p<s;p++)c[p]=r.charCodeAt(p).toString(16);return c.join("")},Ut.utf8StrToBytes=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],p=0;p<s;p++)c[p]=r.charCodeAt(p);return c},Ut.hexToUtf8Str=function(t){for(var r=Ht.decode(t),s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.bytesToUtf8Str=function(t){for(var r=t,s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.intToByte=function(t){return new Array(t>>24&255,t>>16&255,t>>8&255,255&t)},Ut.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 kt,$t=Ut,Gt={exports:{}};kt=Gt,function(){function t(e,n,i){e!=null&&(typeof e=="number"?this.fromNumber(e,n,i):n==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,n))}function r(){return new t(null)}var s=(s=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(t.prototype.am=function(e,n,i,f,A,N){for(var M=32767&n,L=n>>15;0<=--N;){var Ft=32767&this[e],Wt=this[e++]>>15,se=L*Ft+Wt*M;A=((Ft=M*Ft+((32767&se)<<15)+i[f]+(1073741823&A))>>>30)+(se>>>15)+L*Wt+(A>>>30),i[f++]=1073741823&Ft}return A},30):s&&navigator.appName!="Netscape"?(t.prototype.am=function(e,n,i,f,A,N){for(;0<=--N;){var M=n*this[e++]+i[f]+A;A=Math.floor(M/67108864),i[f++]=67108863&M}return A},26):(t.prototype.am=function(e,n,i,f,A,N){for(var M=16383&n,L=n>>14;0<=--N;){var Ft=16383&this[e],Wt=this[e++]>>14,se=L*Ft+Wt*M;A=((Ft=M*Ft+((16383&se)<<14)+i[f]+A)>>28)+(se>>14)+L*Wt,i[f++]=268435455&Ft}return A},28);t.prototype.DB=s,t.prototype.DM=(1<<s)-1,t.prototype.DV=1<<s,t.prototype.FV=Math.pow(2,52),t.prototype.F1=52-s,t.prototype.F2=2*s-52;for(var c=new Array,p=48,h=0;h<=9;++h)c[p++]=h;for(p=97,h=10;h<36;++h)c[p++]=h;for(p=65,h=10;h<36;++h)c[p++]=h;function E(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function O(e,n){return(e=c[e.charCodeAt(n)])==null?-1:e}function w(e){var n=r();return n.fromInt(e),n}function it(e){var n,i=1;return(n=e>>>16)!=0&&(e=n,i+=16),(n=e>>8)!=0&&(e=n,i+=8),(n=e>>4)!=0&&(e=n,i+=4),(n=e>>2)!=0&&(e=n,i+=2),(n=e>>1)!=0&&(e=n,i+=1),i}function st(e){this.m=e}function T(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function H(e,n){return e&n}function tt(e,n){return e|n}function z(e,n){return e^n}function ut(e,n){return e&~n}function dt(){}function Ct(e){return e}function Y(e){this.r2=r(),this.q3=r(),t.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}st.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},st.prototype.revert=function(e){return e},st.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},st.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i),this.reduce(i)},st.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},T.prototype.convert=function(e){var n=r();return e.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),e.s<0&&0<n.compareTo(t.ZERO)&&this.m.subTo(n,n),n},T.prototype.revert=function(e){var n=r();return e.copyTo(n),this.reduce(n),n},T.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var n=0;n<this.m.t;++n){var i=32767&e[n],f=i*this.mpl+((i*this.mph+(e[n]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[i=n+this.m.t]+=this.m.am(0,f,e,n,0,this.m.t);e[i]>=e.DV;)e[i]-=e.DV,e[++i]++}e.clamp(),e.drShiftTo(this.m.t,e),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},T.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i),this.reduce(i)},T.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},t.prototype.copyTo=function(e){for(var n=this.t-1;0<=n;--n)e[n]=this[n];e.t=this.t,e.s=this.s},t.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0<e?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},t.prototype.fromString=function(e,n){var i;if(n==16)i=4;else if(n==8)i=3;else if(n==256)i=8;else if(n==2)i=1;else if(n==32)i=5;else{if(n!=4)return void this.fromRadix(e,n);i=2}this.t=0,this.s=0;for(var f=e.length,A=!1,N=0;0<=--f;){var M=i==8?255&e[f]:O(e,f);M<0?e.charAt(f)=="-"&&(A=!0):(A=!1,N==0?this[this.t++]=M:N+i>this.DB?(this[this.t-1]|=(M&(1<<this.DB-N)-1)<<N,this[this.t++]=M>>this.DB-N):this[this.t-1]|=M<<N,(N+=i)>=this.DB&&(N-=this.DB))}i==8&&128&e[0]&&(this.s=-1,0<N&&(this[this.t-1]|=(1<<this.DB-N)-1<<N)),this.clamp(),A&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var e=this.s&this.DM;0<this.t&&this[this.t-1]==e;)--this.t},t.prototype.dlShiftTo=function(e,n){for(var i=this.t-1;0<=i;--i)n[i+e]=this[i];for(i=e-1;0<=i;--i)n[i]=0;n.t=this.t+e,n.s=this.s},t.prototype.drShiftTo=function(e,n){for(var i=e;i<this.t;++i)n[i-e]=this[i];n.t=Math.max(this.t-e,0),n.s=this.s},t.prototype.lShiftTo=function(e,n){for(var i=e%this.DB,f=this.DB-i,A=(1<<f)-1,N=Math.floor(e/this.DB),M=this.s<<i&this.DM,L=this.t-1;0<=L;--L)n[L+N+1]=this[L]>>f|M,M=(this[L]&A)<<i;for(L=N-1;0<=L;--L)n[L]=0;n[N]=M,n.t=this.t+N+1,n.s=this.s,n.clamp()},t.prototype.rShiftTo=function(e,n){n.s=this.s;var i=Math.floor(e/this.DB);if(i>=this.t)n.t=0;else{var f=e%this.DB,A=this.DB-f,N=(1<<f)-1;n[0]=this[i]>>f;for(var M=i+1;M<this.t;++M)n[M-i-1]|=(this[M]&N)<<A,n[M-i]=this[M]>>f;0<f&&(n[this.t-i-1]|=(this.s&N)<<A),n.t=this.t-i,n.clamp()}},t.prototype.subTo=function(e,n){for(var i=0,f=0,A=Math.min(e.t,this.t);i<A;)f+=this[i]-e[i],n[i++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f-=e.s;i<this.t;)f+=this[i],n[i++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;i<e.t;)f-=e[i],n[i++]=f&this.DM,f>>=this.DB;f-=e.s}n.s=f<0?-1:0,f<-1?n[i++]=this.DV+f:0<f&&(n[i++]=f),n.t=i,n.clamp()},t.prototype.multiplyTo=function(e,n){var i=this.abs(),f=e.abs(),A=i.t;for(n.t=A+f.t;0<=--A;)n[A]=0;for(A=0;A<f.t;++A)n[A+i.t]=i.am(0,f[A],n,A,0,i.t);n.s=0,n.clamp(),this.s!=e.s&&t.ZERO.subTo(n,n)},t.prototype.squareTo=function(e){for(var n=this.abs(),i=e.t=2*n.t;0<=--i;)e[i]=0;for(i=0;i<n.t-1;++i){var f=n.am(i,n[i],e,2*i,0,1);(e[i+n.t]+=n.am(i+1,2*n[i],e,2*i+1,f,n.t-i-1))>=n.DV&&(e[i+n.t]-=n.DV,e[i+n.t+1]=1)}0<e.t&&(e[e.t-1]+=n.am(i,n[i],e,2*i,0,1)),e.s=0,e.clamp()},t.prototype.divRemTo=function(e,n,i){var f=e.abs();if(!(f.t<=0)){if((Wt=this.abs()).t<f.t)return n!=null&&n.fromInt(0),void(i!=null&&this.copyTo(i));i==null&&(i=r());var A=r(),N=this.s,M=e.s;0<(e=this.DB-it(f[f.t-1]))?(f.lShiftTo(e,A),Wt.lShiftTo(e,i)):(f.copyTo(A),Wt.copyTo(i));var L=A.t,Ft=A[L-1];if(Ft!=0){var Wt=Ft*(1<<this.F1)+(1<L?A[L-2]>>this.F2:0),se=this.FV/Wt,fe=(1<<this.F1)/Wt,Ee=1<<this.F2,qt=i.t,ge=qt-L,Bt=n==null?r():n;for(A.dlShiftTo(ge,Bt),0<=i.compareTo(Bt)&&(i[i.t++]=1,i.subTo(Bt,i)),t.ONE.dlShiftTo(L,Bt),Bt.subTo(A,A);A.t<L;)A[A.t++]=0;for(;0<=--ge;){var We=i[--qt]==Ft?this.DM:Math.floor(i[qt]*se+(i[qt-1]+Ee)*fe);if((i[qt]+=A.am(0,We,i,ge,0,L))<We)for(A.dlShiftTo(ge,Bt),i.subTo(Bt,i);i[qt]<--We;)i.subTo(Bt,i)}n!=null&&(i.drShiftTo(L,n),N!=M&&t.ZERO.subTo(n,n)),i.t=L,i.clamp(),0<e&&i.rShiftTo(e,i),N<0&&t.ZERO.subTo(i,i)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var n=3&e;return 0<(n=(n=(n=(n=n*(2-(15&e)*n)&15)*(2-(255&e)*n)&255)*(2-((65535&e)*n&65535))&65535)*(2-e*n%this.DV)%this.DV)?this.DV-n:-n},t.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},t.prototype.exp=function(e,n){if(4294967295<e||e<1)return t.ONE;var i,f=r(),A=r(),N=n.convert(this),M=it(e)-1;for(N.copyTo(f);0<=--M;)n.sqrTo(f,A),0<(e&1<<M)?n.mulTo(A,N,f):(i=f,f=A,A=i);return n.revert(f)},t.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var n;if(e==16)n=4;else if(e==8)n=3;else if(e==2)n=1;else if(e==32)n=5;else{if(e!=4)return this.toRadix(e);n=2}var i,f=(1<<n)-1,A=!1,N="",M=this.t,L=this.DB-M*this.DB%n;if(0<M--)for(L<this.DB&&0<(i=this[M]>>L)&&(A=!0,N=E(i));0<=M;)L<n?(i=(this[M]&(1<<L)-1)<<n-L,i|=this[--M]>>(L+=this.DB-n)):(i=this[M]>>(L-=n)&f,L<=0&&(L+=this.DB,--M)),(A=0<i||A)&&(N+=E(i));return A?N:"0"},t.prototype.negate=function(){var e=r();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(e){var n=this.s-e.s;if(n!=0)return n;var i=this.t;if((n=i-e.t)!=0)return this.s<0?-n:n;for(;0<=--i;)if((n=this[i]-e[i])!=0)return n;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+it(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var n=r();return this.abs().divRemTo(e,null,n),this.s<0&&0<n.compareTo(t.ZERO)&&e.subTo(n,n),n},t.prototype.modPowInt=function(e,n){return n=new(e<256||n.isEven()?st:T)(n),this.exp(e,n)},t.ZERO=w(0),t.ONE=w(1),dt.prototype.convert=Ct,dt.prototype.revert=Ct,dt.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i)},dt.prototype.sqrTo=function(e,n){e.squareTo(n)},Y.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var n=r();return e.copyTo(n),this.reduce(n),n},Y.prototype.revert=function(e){return e},Y.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);0<=e.compareTo(this.m);)e.subTo(this.m,e)},Y.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i),this.reduce(i)},Y.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)};var X,J=[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],G=(1<<26)/J[J.length-1];function W(){var e;e=new Date().getTime(),_t[et++]^=255&e,_t[et++]^=e>>8&255,_t[et++]^=e>>16&255,_t[et++]^=e>>24&255,Ke<=et&&(et-=Ke)}if(t.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},t.prototype.toRadix=function(e){if(e==null&&(e=10),this.signum()==0||e<2||36<e)return"0";var n=this.chunkSize(e),i=Math.pow(e,n),f=w(i),A=r(),N=r(),M="";for(this.divRemTo(f,A,N);0<A.signum();)M=(i+N.intValue()).toString(e).substr(1)+M,A.divRemTo(f,A,N);return N.intValue().toString(e)+M},t.prototype.fromRadix=function(e,n){this.fromInt(0);for(var i=this.chunkSize(n=n==null?10:n),f=Math.pow(n,i),A=!1,N=0,M=0,L=0;L<e.length;++L){var Ft=O(e,L);Ft<0?e.charAt(L)=="-"&&this.signum()==0&&(A=!0):(M=n*M+Ft,++N>=i&&(this.dMultiply(f),this.dAddOffset(M,0),M=N=0))}0<N&&(this.dMultiply(Math.pow(n,N)),this.dAddOffset(M,0)),A&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,n,i){if(typeof n=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),tt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var f=new Array;i=7&e,f.length=1+(e>>3),n.nextBytes(f),0<i?f[0]&=(1<<i)-1:f[0]=0,this.fromString(f,256)}},t.prototype.bitwiseTo=function(e,n,i){for(var f,A=Math.min(e.t,this.t),N=0;N<A;++N)i[N]=n(this[N],e[N]);if(e.t<this.t){for(f=e.s&this.DM,N=A;N<this.t;++N)i[N]=n(this[N],f);i.t=this.t}else{for(f=this.s&this.DM,N=A;N<e.t;++N)i[N]=n(f,e[N]);i.t=e.t}i.s=n(this.s,e.s),i.clamp()},t.prototype.changeBit=function(e,n){return e=t.ONE.shiftLeft(e),this.bitwiseTo(e,n,e),e},t.prototype.addTo=function(e,n){for(var i=0,f=0,A=Math.min(e.t,this.t);i<A;)f+=this[i]+e[i],n[i++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f+=e.s;i<this.t;)f+=this[i],n[i++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;i<e.t;)f+=e[i],n[i++]=f&this.DM,f>>=this.DB;f+=e.s}n.s=f<0?-1:0,0<f?n[i++]=f:f<-1&&(n[i++]=this.DV+f),n.t=i,n.clamp()},t.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(e,n){if(e!=0){for(;this.t<=n;)this[this.t++]=0;for(this[n]+=e;this[n]>=this.DV;)this[n]-=this.DV,++n>=this.t&&(this[this.t++]=0),++this[n]}},t.prototype.multiplyLowerTo=function(e,n,i){var f,A=Math.min(this.t+e.t,n);for(i.s=0,i.t=A;0<A;)i[--A]=0;for(f=i.t-this.t;A<f;++A)i[A+this.t]=this.am(0,e[A],i,A,0,this.t);for(f=Math.min(e.t,n);A<f;++A)this.am(0,e[A],i,A,0,n-A);i.clamp()},t.prototype.multiplyUpperTo=function(e,n,i){var f=i.t=this.t+e.t- --n;for(i.s=0;0<=--f;)i[f]=0;for(f=Math.max(n-this.t,0);f<e.t;++f)i[this.t+f-n]=this.am(n-f,e[f],i,0,0,this.t+f-n);i.clamp(),i.drShiftTo(1,i)},t.prototype.modInt=function(e){if(e<=0)return 0;var n=this.DV%e,i=this.s<0?e-1:0;if(0<this.t)if(n==0)i=this[0]%e;else for(var f=this.t-1;0<=f;--f)i=(n*i+this[f])%e;return i},t.prototype.millerRabin=function(e){var n=this.subtract(t.ONE),i=n.getLowestSetBit();if(i<=0)return!1;var f=n.shiftRight(i);J.length<(e=e+1>>1)&&(e=J.length);for(var A=r(),N=0;N<e;++N){A.fromInt(J[Math.floor(Math.random()*J.length)]);var M=A.modPow(f,this);if(M.compareTo(t.ONE)!=0&&M.compareTo(n)!=0){for(var L=1;L++<i&&M.compareTo(n)!=0;)if((M=M.modPowInt(2,this)).compareTo(t.ONE)==0)return!1;if(M.compareTo(n)!=0)return!1}}return!0},t.prototype.clone=function(){var e=r();return this.copyTo(e),e},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 e=this.t,n=new Array;n[0]=this.s;var i,f=this.DB-e*this.DB%8,A=0;if(0<e--)for(f<this.DB&&(i=this[e]>>f)!=(this.s&this.DM)>>f&&(n[A++]=i|this.s<<this.DB-f);0<=e;)f<8?(i=(this[e]&(1<<f)-1)<<8-f,i|=this[--e]>>(f+=this.DB-8)):(i=this[e]>>(f-=8)&255,f<=0&&(f+=this.DB,--e)),128&i&&(i|=-256),A==0&&(128&this.s)!=(128&i)&&++A,(0<A||i!=this.s)&&(n[A++]=i);return n},t.prototype.equals=function(e){return this.compareTo(e)==0},t.prototype.min=function(e){return this.compareTo(e)<0?this:e},t.prototype.max=function(e){return 0<this.compareTo(e)?this:e},t.prototype.and=function(e){var n=r();return this.bitwiseTo(e,H,n),n},t.prototype.or=function(e){var n=r();return this.bitwiseTo(e,tt,n),n},t.prototype.xor=function(e){var n=r();return this.bitwiseTo(e,z,n),n},t.prototype.andNot=function(e){var n=r();return this.bitwiseTo(e,ut,n),n},t.prototype.not=function(){for(var e=r(),n=0;n<this.t;++n)e[n]=this.DM&~this[n];return e.t=this.t,e.s=~this.s,e},t.prototype.shiftLeft=function(e){var n=r();return e<0?this.rShiftTo(-e,n):this.lShiftTo(e,n),n},t.prototype.shiftRight=function(e){var n=r();return e<0?this.lShiftTo(-e,n):this.rShiftTo(e,n),n},t.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+(function(n){if(n==0)return-1;var i=0;return!(65535&n)&&(n>>=16,i+=16),!(255&n)&&(n>>=8,i+=8),!(15&n)&&(n>>=4,i+=4),!(3&n)&&(n>>=2,i+=2),!(1&n)&&++i,i})(this[e]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var e=0,n=this.s&this.DM,i=0;i<this.t;++i)e+=(function(f){for(var A=0;f!=0;)f&=f-1,++A;return A})(this[i]^n);return e},t.prototype.testBit=function(e){var n=Math.floor(e/this.DB);return n>=this.t?this.s!=0:!!(this[n]&1<<e%this.DB)},t.prototype.setBit=function(e){return this.changeBit(e,tt)},t.prototype.clearBit=function(e){return this.changeBit(e,ut)},t.prototype.flipBit=function(e){return this.changeBit(e,z)},t.prototype.add=function(e){var n=r();return this.addTo(e,n),n},t.prototype.subtract=function(e){var n=r();return this.subTo(e,n),n},t.prototype.multiply=function(e){var n=r();return this.multiplyTo(e,n),n},t.prototype.divide=function(e){var n=r();return this.divRemTo(e,n,null),n},t.prototype.remainder=function(e){var n=r();return this.divRemTo(e,null,n),n},t.prototype.divideAndRemainder=function(e){var n=r(),i=r();return this.divRemTo(e,n,i),new Array(n,i)},t.prototype.modPow=function(e,n){var i=e.bitLength(),f=w(1);if(i<=0)return f;var A=i<18?1:i<48?3:i<144?4:i<768?5:6,N=new(i<8?st:n.isEven()?Y:T)(n),M=new Array,L=3,Ft=A-1,Wt=(1<<A)-1;if(M[1]=N.convert(this),1<A){var se=r();for(N.sqrTo(M[1],se);L<=Wt;)M[L]=r(),N.mulTo(se,M[L-2],M[L]),L+=2}var fe,Ee,qt=e.t-1,ge=!0,Bt=r();for(i=it(e[qt])-1;0<=qt;){for(Ft<=i?fe=e[qt]>>i-Ft&Wt:(fe=(e[qt]&(1<<i+1)-1)<<Ft-i,0<qt&&(fe|=e[qt-1]>>this.DB+i-Ft)),L=A;!(1&fe);)fe>>=1,--L;if((i-=L)<0&&(i+=this.DB,--qt),ge)M[fe].copyTo(f),ge=!1;else{for(;1<L;)N.sqrTo(f,Bt),N.sqrTo(Bt,f),L-=2;0<L?N.sqrTo(f,Bt):(Ee=f,f=Bt,Bt=Ee),N.mulTo(Bt,M[fe],f)}for(;0<=qt&&!(e[qt]&1<<i);)N.sqrTo(f,Bt),Ee=f,f=Bt,Bt=Ee,--i<0&&(i=this.DB-1,--qt)}return N.revert(f)},t.prototype.modInverse=function(e){var n=e.isEven();if(this.isEven()&&n||e.signum()==0)return t.ZERO;for(var i=e.clone(),f=this.clone(),A=w(1),N=w(0),M=w(0),L=w(1);i.signum()!=0;){for(;i.isEven();)i.rShiftTo(1,i),n?(A.isEven()&&N.isEven()||(A.addTo(this,A),N.subTo(e,N)),A.rShiftTo(1,A)):N.isEven()||N.subTo(e,N),N.rShiftTo(1,N);for(;f.isEven();)f.rShiftTo(1,f),n?(M.isEven()&&L.isEven()||(M.addTo(this,M),L.subTo(e,L)),M.rShiftTo(1,M)):L.isEven()||L.subTo(e,L),L.rShiftTo(1,L);0<=i.compareTo(f)?(i.subTo(f,i),n&&A.subTo(M,A),N.subTo(L,N)):(f.subTo(i,f),n&&M.subTo(A,M),L.subTo(N,L))}return f.compareTo(t.ONE)!=0?t.ZERO:0<=L.compareTo(e)?L.subtract(e):L.signum()<0?(L.addTo(e,L),L.signum()<0?L.add(e):L):L},t.prototype.pow=function(e){return this.exp(e,new dt)},t.prototype.gcd=function(e){var n=this.s<0?this.negate():this.clone(),i=e.s<0?e.negate():e.clone();n.compareTo(i)<0&&(A=n,n=i,i=A);var f=n.getLowestSetBit(),A=i.getLowestSetBit();if(A<0)return n;for(0<(A=f<A?f:A)&&(n.rShiftTo(A,n),i.rShiftTo(A,i));0<n.signum();)0<(f=n.getLowestSetBit())&&n.rShiftTo(f,n),0<(f=i.getLowestSetBit())&&i.rShiftTo(f,i),0<=n.compareTo(i)?(n.subTo(i,n),n.rShiftTo(1,n)):(i.subTo(n,i),i.rShiftTo(1,i));return 0<A&&i.lShiftTo(A,i),i},t.prototype.isProbablePrime=function(e){var n,i=this.abs();if(i.t==1&&i[0]<=J[J.length-1]){for(n=0;n<J.length;++n)if(i[0]==J[n])return!0;return!1}if(i.isEven())return!1;for(n=1;n<J.length;){for(var f=J[n],A=n+1;A<J.length&&f<G;)f*=J[A++];for(f=i.modInt(f);n<A;)if(f%J[n++]==0)return!1}return i.millerRabin(e)},t.prototype.square=function(){var e=r();return this.squareTo(e),e},t.prototype.Barrett=Y,_t==null){var _t=new Array,et=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var St=new Uint8Array(32);for(window.crypto.getRandomValues(St),Yt=0;Yt<32;++Yt)_t[et++]=St[Yt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Nt=window.crypto.random(32),Yt=0;Yt<Nt.length;++Yt)_t[et++]=255&Nt.charCodeAt(Yt)}for(;et<Ke;)Yt=Math.floor(65536*Math.random()),_t[et++]=Yt>>>8,_t[et++]=255&Yt;et=0,W()}function Ge(){if(X==null){for(W(),(X=new Xe).init(_t),et=0;et<_t.length;++et)_t[et]=0;et=0}return X.next()}function Ar(){}function Xe(){this.i=0,this.j=0,this.S=new Array}Ar.prototype.nextBytes=function(e){for(var n=0;n<e.length;++n)e[n]=Ge()},Xe.prototype.init=function(e){for(var n,i,f=0;f<256;++f)this.S[f]=f;for(f=n=0;f<256;++f)n=n+this.S[f]+e[f%e.length]&255,i=this.S[f],this.S[f]=this.S[n],this.S[n]=i;this.i=0,this.j=0},Xe.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var Ke=256;kt.exports={default:t,BigInteger:t,SecureRandom:Ar}}.call(b);var Pt=Gt.exports.BigInteger,wt=(function(){function t(){$(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return I(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,s=r.toString(16);return s.length%2==1&&(s="0"+s),r<128?s:(128+s.length/2).toString(16)+s}},{key:"getValue",value:function(){return""}}]),t})(),ie=(function(){Z(r,wt);var t=k(r);function r(s){var c;return $(this,r),(c=t.call(this)).t="02",s&&(c.v=(function(p){if((h=p.toString(16))[0]!=="-")h.length%2==1?h="0"+h:h.match(/^[0-7]/)||(h="00"+h);else{var h,E=(h=h.substr(1)).length;E%2==1?E+=1:h.match(/^[0-7]/)||(E+=2);for(var O="",w=0;w<E;w++)O+="f";h=(h=(O=new Pt(O,16)).xor(p).add(Pt.ONE)).toString(16).replace(/^-/,"")}return h})(s)),c}return I(r,[{key:"getValue",value:function(){return this.v}}]),r})(),ne=(function(){Z(r,wt);var t=k(r);function r(s){var c;return $(this,r),(c=t.call(this)).t="30",c.asn1Array=s,c}return I(r,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(s){return s.getEncodedHex()})).join(""),this.v}}]),r})();function jt(t,r){return+t[r+2]<8?1:128&+t.substr(r+2,2)}function ae(t,r){var s=jt(t,r);return(t=t.substr(r+2,2*s))?(+t[0]<8?new Pt(t,16):new Pt(t.substr(2),16)).intValue():-1}function oe(t,r){return r+2*(jt(t,r)+1)}var Lt=Gt.exports.BigInteger,Jt=new Lt("3"),he=(function(){function t(r,s){$(this,t),this.x=s,this.q=r}return I(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})(),zt=(function(){function t(r,s,c,p){$(this,t),this.curve=r,this.x=s,this.y=c,this.z=p==null?Lt.ONE:p,this.zinv=null}return I(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(Lt.ZERO)&&r.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Lt.ZERO))}},{key:"isInfinity",value:function(){return this.x===null&&this.y===null||this.z.equals(Lt.ZERO)&&!this.y.toBigInteger().equals(Lt.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 s=this.x.toBigInteger(),c=this.y.toBigInteger(),p=this.z,h=r.x.toBigInteger(),E=r.y.toBigInteger(),O=r.z,w=this.curve.q,it=s.multiply(O).mod(w);return r=h.multiply(p).mod(w),s=it.subtract(r),h=c.multiply(O).mod(w),c=E.multiply(p).mod(w),E=h.subtract(c),Lt.ZERO.equals(s)?Lt.ZERO.equals(E)?this.twice():this.curve.infinity:(c=it.add(r),r=p.multiply(O).mod(w),O=s.square().mod(w),p=s.multiply(O).mod(w),c=r.multiply(E.square()).subtract(c.multiply(O)).mod(w),s=s.multiply(c).mod(w),h=E.multiply(O.multiply(it).subtract(c)).subtract(h.multiply(p)).mod(w),w=p.multiply(r).mod(w),new t(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(h),w))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var r=this.x.toBigInteger(),s=this.y.toBigInteger(),c=this.z,p=this.curve.q,h=this.curve.a.toBigInteger(),E=r.square().multiply(Jt).add(h.multiply(c.square())).mod(p),O=s.shiftLeft(1).multiply(c).mod(p),w=(h=(w=s.square().mod(p)).multiply(r).multiply(c).mod(p),s=O.square().mod(p),r=E.square().subtract(h.shiftLeft(3)).mod(p),c=O.multiply(r).mod(p),E.multiply(h.shiftLeft(2).subtract(r)).subtract(s.shiftLeft(1).multiply(w)).mod(p));return p=O.multiply(s).mod(p),new t(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(w),p)}},{key:"multiply",value:function(r){if(this.isInfinity())return this;if(!r.signum())return this.curve.infinity;for(var s=r.multiply(Jt),c=this.negate(),p=this,h=s.bitLength()-2;0<h;h--){p=p.twice();var E=s.testBit(h);E!==r.testBit(h)&&(p=p.add(E?this:c))}return p}}]),t})(),Ot=(function(){function t(r,s,c){$(this,t),this.q=r,this.a=this.fromBigInteger(s),this.b=this.fromBigInteger(c),this.infinity=new zt(this,null,null)}return I(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 he(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 s=(r.length-2)/2,c=r.substr(2,s);return s=r.substr(2+s,s),new zt(this,this.fromBigInteger(new Lt(c,16)),this.fromBigInteger(new Lt(s,16)))}}}]),t})(),Ut={ECPointFp:zt,ECCurveFp:Ot},te=Gt.exports.BigInteger,ce=(Ot=Gt.exports.SecureRandom,Ut.ECCurveFp),le=new Ot,ee=(Ut=y()).curve,d=Ut.G,l=Ut.n;function y(){var t=new te("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),r=new te("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),s=new te("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return s=(r=new ce(t,r,s)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:r,G:s,n:new te("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function F(t,r){return t.length>=r?t:new Array(r-t.length+1).join("0")+t}function D(t,r){for(var s=[],c=~~(r/8),p=r%8,h=0,E=t.length;h<E;h++)s[h]=(t[(h+c)%E]<<p&255)+(t[(h+c+1)%E]>>>8-p&255);return s}function U(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]^r[c]);return s}function nt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=t[c]&r[c]&255;return s}function vt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]|r[c]);return s}function yt(t,r){for(var s=[],c=0,p=t.length-1;0<=p;p--){var h=t[p]+r[p]+c;c=255<h?1:0,s[p]=255&h}return s}function Xt(t,r,s,c){return 0<=c&&c<=15?U(U(t,r),s):vt(nt(t,r),nt((function(p){for(var h=[],E=p.length-1;0<=E;E--)h[E]=255&~p[E];return h})(t),s))}function Qt(t,r){for(var s=[],c=[],p=0;p<16;p++){var h=4*p;s.push(r.slice(h,4+h))}for(var E,O=16;O<68;O++)s.push(U(U((E=U(U(s[O-16],s[O-9]),D(s[O-3],15)),U(U(E,D(E,15)),D(E,23))),D(s[O-13],7)),s[O-6]));for(var w=0;w<64;w++)c.push(U(s[w],s[w+4]));for(var it,st,T,H=[121,204,69,25],tt=[122,135,157,138],z=t.slice(0,4),ut=t.slice(4,8),dt=t.slice(8,12),Ct=t.slice(12,16),Y=t.slice(16,20),X=t.slice(20,24),J=t.slice(24,28),G=t.slice(28,32),W=0;W<64;W++){var _t=0<=W&&W<=15?H:tt,et=U(St=D(yt(yt(D(z,12),Y),D(_t,W)),7),D(z,12)),St=(et=yt(yt(yt((it=z,st=ut,T=dt,0<=(_t=W)&&_t<=15?U(U(it,st),T):vt(vt(nt(it,st),nt(it,T)),nt(st,T))),Ct),et),c[W]),yt(yt(yt(Xt(Y,X,J,W),G),St),s[W]));Ct=dt,dt=D(ut,9),ut=z,z=et,G=J,J=D(X,19),X=Y,Y=U(U(St,D(St,9)),D(St,17))}return U([].concat(z,ut,dt,Ct,Y,X,J,G),t)}Ot={getGlobalCurve:function(){return ee},generateEcparam:y,generateKeyPairHex:function(t,r,s){return{privateKey:s=F((r=(t?new te(t,r,s):new te(l.bitLength(),le)).mod(l.subtract(te.ONE)).add(te.ONE)).toString(16),64),publicKey:"04"+F((r=d.multiply(r)).getX().toBigInteger().toString(16),64)+F(r.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(t){for(var r=(t=unescape(encodeURIComponent(t))).length,s=[],c=0;c<r;c++)s[c>>>2]|=(255&t.charCodeAt(c))<<24-c%4*8;for(var p=[],h=0;h<r;h++){var E=s[h>>>2]>>>24-h%4*8&255;p.push((E>>>4).toString(16)),p.push((15&E).toString(16))}return p.join("")},leftPad:F,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=[],s=0,c=0;c<2*t.length;c+=2)r[c>>>3]|=parseInt(t[s],10)<<24-c%8*4,s++;try{for(var p=[],h=0;h<t.length;h++){var E=r[h>>>2]>>>24-h%4*8&255;p.push(String.fromCharCode(E))}return decodeURIComponent(escape(p.join("")))}catch(O){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){for(var r=[],s=(t=(s=t.length)%2!=0?F(t,s+1):t).length,c=0;c<s;c+=2)r.push(parseInt(t.substr(c,2),16));return r},verifyPublicKey:function(t){var r=ee.decodePointHex(t);return!!r&&(t=r.getX(),r.getY().square().equals(t.multiply(t.square()).add(t.multiply(ee.a)).add(ee.b)))}},Ut=function(t){for(var r=448<=(r=(O=8*t.length)%512)?512-r%448-1:448-r-1,s=new Array((r-7)/8),c=0,p=s.length;c<p;c++)s[c]=0;for(var h,E=[],O=O.toString(2),w=7;0<=w;w--)8<O.length?(h=O.length-8,E[w]=parseInt(O.substr(h),2),O=O.substr(0,h)):0<O.length?(E[w]=parseInt(O,2),O=""):E[w]=0;for(var it=[].concat(t,[128],s,E),st=it.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],H=0;H<st;H++){var tt=64*H;T=Qt(T,it.slice(tt,64+tt))}return T};var Et=Gt.exports.BigInteger,Zr=function(t,r){return t=new ie(t),r=new ie(r),new ne([t,r]).getEncodedHex()},tn=function(t){var r=oe(t,0),s=oe(t,r),c=ae(t,r);return r=t.substr(s,2*c),s=oe(t,c=s+r.length),c=ae(t,c),t=t.substr(s,2*c),{r:new Pt(r,16),s:new Pt(t,16)}},ft=Ot,Ae=Ut,De=(Ot=ft.generateEcparam()).G,yr=Ot.curve,Ie=Ot.n;function gr(t,r,s){var c=2<arguments.length&&s!==void 0?s:"1234567812345678",p=(c=ft.utf8ToHex(c),ft.leftPad(De.curve.a.toBigInteger().toRadix(16),64)),h=ft.leftPad(De.curve.b.toBigInteger().toRadix(16),64),E=ft.leftPad(De.getX().toBigInteger().toRadix(16),64),O=ft.leftPad(De.getY().toBigInteger().toRadix(16),64);return s=(r=128<r.length?r.substr(2,128):r).substr(0,64),r=r.substr(64,64),r=ft.hexToArray(c+p+h+E+O+s+r),c=4*c.length,r.unshift(255&c),r.unshift(c>>8&255),r=Ae(r),ft.arrayToHex(Ae(r.concat(ft.hexToArray(t))))}function mr(){var t=ft.generateKeyPairHex(),r=yr.decodePointHex(t.publicKey);return t.k=new Et(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}Ot={generateKeyPairHex:ft.generateKeyPairHex,doEncrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;t=typeof t=="string"?ft.hexToArray(ft.utf8ToHex(t)):Array.prototype.slice.call(t),r=ft.getGlobalCurve().decodePointHex(r);var c=ft.generateKeyPairHex(),p=new Et(c.privateKey,16),h=c.publicKey;128<h.length&&(h=h.substr(h.length-128)),c=r.multiply(p),p=ft.hexToArray(ft.leftPad(c.getX().toBigInteger().toRadix(16),64)),r=ft.hexToArray(ft.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=ft.arrayToHex(Ae([].concat(p,t,r)));var E,O=1,w=0,it=[],st=[].concat(p,r);(E=function(){it=Ae([].concat(Tt(st),[O>>24&255,O>>16&255,O>>8&255,255&O])),O++,w=0})();for(var T=0,H=t.length;T<H;T++)w===it.length&&E(),t[T]^=255&it[w++];return r=ft.arrayToHex(t),s===0?h+r+c:h+c+r},doDecrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(h=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":h;r=new Et(r,16);var p=t.substr(128,64),h=t.substr(192);s===0&&(p=t.substr(t.length-64),h=t.substr(128,t.length-128-64));var E,O=ft.hexToArray(h),w=(t=ft.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),r=ft.hexToArray(ft.leftPad(t.getX().toBigInteger().toRadix(16),64)),t=ft.hexToArray(ft.leftPad(t.getY().toBigInteger().toRadix(16),64)),1),it=0,st=[],T=[].concat(r,t);(E=function(){st=Ae([].concat(Tt(T),[w>>24&255,w>>16&255,w>>8&255,255&w])),w++,it=0})();for(var H=0,tt=O.length;H<tt;H++)it===st.length&&E(),O[H]^=255&st[it++];return ft.arrayToHex(Ae([].concat(r,O,t)))===p?c==="array"?O:ft.arrayToUtf8(O):c==="array"?[]:""},doSignature:function(t,r){var s=(O=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=O.der,p=O.hash,h=O.publicKey,E=O.userId,O=typeof t=="string"?ft.utf8ToHex(t):ft.arrayToHex(t);p&&(O=gr(O,h||(t=r,p=De.multiply(new Et(t,16)),"04"+(t=ft.leftPad(p.getX().toBigInteger().toString(16),64))+(p=ft.leftPad(p.getY().toBigInteger().toString(16),64))),E));var w=new Et(r,16),it=new Et(O,16),st=null,T=null,H=null;do do{var tt;st=(tt=s&&s.length?s.pop():mr()).k,T=it.add(tt.x1).mod(Ie)}while(T.equals(Et.ZERO)||T.add(st).equals(Ie));while((H=w.add(Et.ONE).modInverse(Ie).multiply(st.subtract(T.multiply(w))).mod(Ie)).equals(Et.ZERO));return c?Zr(T,H):ft.leftPad(T.toString(16),64)+ft.leftPad(H.toString(16),64)},doVerifySignature:function(t,r,s){var c,p,h=(O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,E=O.hash,O=O.userId;return t=typeof t=="string"?ft.utf8ToHex(t):ft.arrayToHex(t),E&&(t=gr(t,s,O)),p=h?(c=(p=tn(r)).r,p.s):(c=new Et(r.substring(0,64),16),new Et(r.substring(64),16)),r=yr.decodePointHex(s),s=new Et(t,16),!(t=c.add(p).mod(Ie)).equals(Et.ZERO)&&(r=De.multiply(p).add(r.multiply(t)),s=s.add(r.getX().toBigInteger()).mod(Ie),c.equals(s))},getPoint:mr,verifyPublicKey:ft.verifyPublicKey};var en=Ut,Fe=[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],xe=[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 He(t){for(var r=[],s=0,c=t.length;s<c;s+=2)r.push(parseInt(t.substr(s,2),16));return r}function Re(t,r){return t<<r|t>>>32-r}function pe(t){return(255&Fe[t>>>24&255])<<24|(255&Fe[t>>>16&255])<<16|(255&Fe[t>>>8&255])<<8|255&Fe[255&t]}function Le(t){return t^Re(t,2)^Re(t,10)^Re(t,18)^Re(t,24)}function Ue(t){return t^Re(t,13)^Re(t,23)}function _r(t,r,s,c){c=(h=(E=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":h;var p=E.mode,h=(h=E.iv)===void 0?[]:h,E=(E=E.output)===void 0?"string":E;if(p==="cbc"&&(h=typeof h=="string"?He(h):h).length!==16)throw new Error("iv is invalid");if((r=typeof r=="string"?He(r):r).length!==16)throw new Error("key is invalid");if(t=(typeof t=="string"?s!==0?function(Y){for(var X=[],J=0,G=Y.length;J<G;J++){var W=Y.codePointAt(J);if(W<=127)X.push(W);else if(W<=2047)X.push(192|W>>>6),X.push(128|63&W);else if(W<=55295||57344<=W&&W<=65535)X.push(224|W>>>12),X.push(128|W>>>6&63),X.push(128|63&W);else{if(!(65536<=W&&W<=1114111))throw X.push(W),new Error("input is not supported");J++,X.push(240|W>>>18&28),X.push(128|W>>>12&63),X.push(128|W>>>6&63),X.push(128|63&W)}}return X}:He:Tt)(t),c==="pkcs#5"&&s!==0)for(var O=16-t.length%16,w=0;w<O;w++)t.push(O);var it=new Array(32);(function(Y,X,J){for(var G=new Array(4),W=new Array(4),_t=0;_t<4;_t++)W[0]=255&Y[0+4*_t],W[1]=255&Y[1+4*_t],W[2]=255&Y[2+4*_t],W[3]=255&Y[3+4*_t],G[_t]=W[0]<<24|W[1]<<16|W[2]<<8|W[3];G[0]^=2746333894,G[1]^=1453994832,G[2]^=1736282519,G[3]^=2993693404;for(var et,St=0;St<32;St+=4)et=G[1]^G[2]^G[3]^xe[St+0],X[St+0]=G[0]^=Ue(pe(et)),et=G[2]^G[3]^G[0]^xe[St+1],X[St+1]=G[1]^=Ue(pe(et)),et=G[3]^G[0]^G[1]^xe[St+2],X[St+2]=G[2]^=Ue(pe(et)),et=G[0]^G[1]^G[2]^xe[St+3],X[St+3]=G[3]^=Ue(pe(et));if(J===0)for(var Nt,Yt=0;Yt<16;Yt++)Nt=X[Yt],X[Yt]=X[31-Yt],X[31-Yt]=Nt})(r,it,s);for(var st=[],T=h,H=t.length,tt=0;16<=H;){var z=t.slice(tt,tt+16),ut=new Array(16);if(p==="cbc")for(var dt=0;dt<16;dt++)s!==0&&(z[dt]^=T[dt]);(function(Y,X,J){for(var G=new Array(4),W=new Array(4),_t=0;_t<4;_t++)W[0]=255&Y[4*_t],W[1]=255&Y[4*_t+1],W[2]=255&Y[4*_t+2],W[3]=255&Y[4*_t+3],G[_t]=W[0]<<24|W[1]<<16|W[2]<<8|W[3];for(var et,St=0;St<32;St+=4)et=G[1]^G[2]^G[3]^J[St+0],G[0]^=Le(pe(et)),et=G[2]^G[3]^G[0]^J[St+1],G[1]^=Le(pe(et)),et=G[3]^G[0]^G[1]^J[St+2],G[2]^=Le(pe(et)),et=G[0]^G[1]^G[2]^J[St+3],G[3]^=Le(pe(et));for(var Nt=0;Nt<16;Nt+=4)X[Nt]=G[3-Nt/4]>>>24&255,X[Nt+1]=G[3-Nt/4]>>>16&255,X[Nt+2]=G[3-Nt/4]>>>8&255,X[Nt+3]=255&G[3-Nt/4]})(z,ut,it);for(var Ct=0;Ct<16;Ct++)p==="cbc"&&s===0&&(ut[Ct]^=T[Ct]),st[tt+Ct]=ut[Ct];p==="cbc"&&(T=s!==0?ut:z),H-=16,tt+=16}return c==="pkcs#5"&&s===0&&(c=st[st.length-1],st.splice(st.length-c,c)),E!=="array"?s!==0?st.map((function(Y){return(Y=Y.toString(16)).length===1?"0"+Y:Y})).join(""):(function(Y){for(var X=[],J=0,G=Y.length;J<G;J++)240<=Y[J]&&Y[J]<=247?(X.push(String.fromCodePoint(((7&Y[J])<<18)+((63&Y[J+1])<<12)+((63&Y[J+2])<<6)+(63&Y[J+3]))),J+=3):224<=Y[J]&&Y[J]<=239?(X.push(String.fromCodePoint(((15&Y[J])<<12)+((63&Y[J+1])<<6)+(63&Y[J+2]))),J+=2):192<=Y[J]&&Y[J]<=223?(X.push(String.fromCodePoint(((31&Y[J])<<6)+(63&Y[J+1]))),J++):X.push(String.fromCodePoint(Y[J]));return X.join("")})(st):st}var rn=[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],ye=[],nn=function(t,r,s){for(var c=t[0],p=t[1],h=t[2],E=t[3],O=t[4],w=t[5],it=t[6],st=t[7],T=0;T<64;T++){T<16?ye[T]=0|r[s+T]:(H=ye[T-15],tt=ye[T-2],ye[T]=((H<<25|H>>>7)^(H<<14|H>>>18)^H>>>3)+ye[T-7]+((tt<<15|tt>>>17)^(tt<<13|tt>>>19)^tt>>>10)+ye[T-16]);var H=c&p^c&h^p&h,tt=st+((O<<26|O>>>6)^(O<<21|O>>>11)^(O<<7|O>>>25))+(O&w^~O&it)+rn[T]+ye[T];st=it,it=w,w=O,O=E+tt|0,E=h,h=p,p=c,c=tt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+H)|0}t[0]=t[0]+c|0,t[1]=t[1]+p|0,t[2]=t[2]+h|0,t[3]=t[3]+E|0,t[4]=t[4]+O|0,t[5]=t[5]+w|0,t[6]=t[6]+it|0,t[7]=t[7]+st|0},vr=(Ot={c2:Ot,c3:function(t){return t=typeof t=="string"?(function(r){for(var s=[],c=0,p=r.length;c<p;c++){var h=r.codePointAt(c);if(h<=127)s.push(h);else if(h<=2047)s.push(192|h>>>6),s.push(128|63&h);else if(h<=55295||57344<=h&&h<=65535)s.push(224|h>>>12),s.push(128|h>>>6&63),s.push(128|63&h);else{if(!(65536<=h&&h<=1114111))throw s.push(h),new Error("input is not supported");c++,s.push(240|h>>>18&28),s.push(128|h>>>12&63),s.push(128|h>>>6&63),s.push(128|63&h)}}return s})(t):Array.prototype.slice.call(t),en(t).map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},c4:{encrypt:function(t,r,s){return _r(t,r,1,s)},decrypt:function(t,r,s){return _r(t,r,0,s)}},s2:function(t){var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],s=(function(p){for(var h=[],E=0;E<Math.ceil(p.length/4);E++)h[E]=p[4*E]<<24|(255&p[4*E+1])<<16|(255&p[4*E+2])<<8|255&p[4*E+3];return h})(t);s[(t=8*t.length)>>5]|=128<<24-t%32,s[15+(64+t>>9<<4)]=t;for(var c=0;c<s.length;c+=16)nn(r,s,c);return(function(p){for(var h=[],E=0;E<p.length;E++)h[4*E]=p[E]>>24&255,h[4*E+1]=p[E]>>16&255,h[4*E+2]=p[E]>>8&255,h[4*E+3]=255&p[E];return h})(r).map((function(p){return(p=p.toString(16)).length===1?"0"+p:p})).join("")}},Dt),on=mt,an=Rt,sn=Vt,un=$t,cn=Ot.c2,ln=Ot.c3,fn=Ot.c4,dn=Ot.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 s="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,p=!1,h=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,E=h!==void 0&&!!h.request&&!!h.login,O=function(T,H){return typeof T=="string"&&typeof H=="string"&&T!=null&&H!=null&&T.substring(0,H.length)===H},w={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},it=function(T){for(var H in w)if(w[H]===T)return H},st=function(T,H,tt){var z=Date.now(),ut=new t;try{if(!T||T.length<=75)return console.error("error format 1:",T),w.ERROR_DATA_FORMAT;if(!O(T,"eyJ"))return console.error("error format 2:",T),w.ERROR_DATA_FORMAT;T=T.substring(3,T.length);var dt=on.my_b4_decode(T);if(!dt)return console.error("error format 3:",T),w.ERROR_DATA_FORMAT;var Ct,Y=ut.cc.u8.byteToInt(dt.slice(0,4),0),X=dt.slice(4,4+Y),J=ut.cc.u8.byteToInt(dt.slice(4+Y,4+Y+4),0),G=dt.slice(4+Y+4,4+Y+4+J),W=ut.cc.u8.byteToInt(dt.slice(4+Y+4+J,4+Y+4+J+4),0),_t=dt.slice(4+Y+4+J+4,4+Y+4+J+4+W),et=ut.cc.u8.bytesToUtf8Str(X);if(ut.cc.h6.encode(G,0,J),H||(tt!==void 0&&tt==="sm2"?(Ct=ut.cc.h6.encode(G,0,J),ut.co.c2.doVerifySignature(et,Ct,s,{der:!0,hash:!0})):ut.co.c3(et+"8890012345678890").toLowerCase()===ut.cc.h6.encode(_t,0,W).toLowerCase())){if(et.length%2==0){t.prototype.__v=function(){return et.slice(0,2)};for(var St=[],Nt=2;Nt<66;Nt+=2)St.push(parseInt("0x"+et.slice(Nt,Nt+2)));t.prototype.__i=function(){return St};var Yt=parseInt("0x"+et.slice(66,82))-z;t.prototype.__o=function(){return Yt}}return E||b.AAR2||(b.AAR2=t),w.SUCCESS}}catch(Ge){return console.error(Ge),w.ERROR_UNKNOWN_ERROR}return w.ERROR_SIGN_CHECK};return t.init=function(T,H){var tt,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 H=="string"&&(z.publicKey=H)):Q(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)),p?z.callback&&z.callback(!0,{errorNo:tt=w.ALREADY_SUCCESS,errorMsg:it(tt)}):c?setTimeout((function(){t.init(T,H)}),50):(c=!0,z.debug&&vr.start(z.debug),z.publicKey&&(s=z.publicKey),z.code?(tt=st(z.code,z.skipVerify))===w.SUCCESS?(c=!(p=!0),z.callback(!0,{errorNo:tt,errorMsg:it(tt)})):z.callback(!1,{errorNo:tt,errorMsg:it(tt)}):z.url&&(function(ut,dt,Ct){try{if(ut=ut+"?version="+t.VERSION+(E?"&name=wechat":"&name=browser")+"&t="+Date.now(),E)h.request({url:ut,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function(X){X.statusCode===200?dt(X.data):Ct(w.ERROR_XXX_REQUEST_FAIL)},fail:function(X){X&&X.errMsg&&X.errMsg.indexOf("timeout")!==-1?Ct(w.ERROR_XXX_REQUEST_TIMEOUT):Ct(w.ERROR_XXX_REQUEST_FAIL)}});else{var Y;if(window.XMLHttpRequest)Y=new XMLHttpRequest;else if(window.ActiveXObject)try{Y=new ActiveXObject("Msxml2.XMLHTTP")}catch(X){try{Y=new ActiveXObject("Microsoft.XMLHTTP")}catch(J){}}Y&&(Y.onload=function(){Y.readyState===4&&(Y.status===200?dt(Y.responseText):Ct(w.ERROR_XHR_ERROR))},Y.ontimeout=function(){Ct(w.ERROR_XHR_TIMEOUT)},Y.onerror=function(){Ct(w.ERROR_XHR_ERROR)},Y.open("POST",ut,!0),Y.timeout=5e3,Y.send(null))}}catch(X){console.error(X),Ct(w.ERROR_UNKNOWN_ERROR)}})(z.url,(function(ut){(ut=st(ut,z.skipVerify,z.alg))===w.SUCCESS?(c=!(p=!0),z.callback(!0,{errorNo:ut,errorMsg:it(ut)})):(c=!1,z.callback(!1,{errorNo:ut,errorMsg:it(ut)}))}),(function(ut){c=!1,z.callback(!1,{errorNo:ut,errorMsg:it(ut)})})))},t.prototype={cc:{b4:an,h6:sn,u8:un},co:{c2:cn,c3:ln,c4:fn,s2:dn},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,H){return this.__s(T,H)},__s:function(T,H){var tt=this.cc.u8.utf8StrToBytes(T),z=this.__i();return T=this.cc.u8.utf8StrToBytes(H),H=this.cc.u8.utf8StrToBytes(this.__c()),T=[].concat(tt,z,T,H),H=parseInt("0x"+this.__v()),this.__f(H)(T)+this.__v()},__f:function(T){var H=this.co.s2,tt=this.co.c3,z=this.cc.h6.decode,ut=[function(dt){return H(dt)},function(dt){return tt(dt)},function(dt){return tt(z(H(dt)))},function(dt){return H(z(tt(dt)))},function(dt){return tt(z(tt(dt)))},function(dt){return H(z(H(dt)))}];return ut[(128<T?T-128:T)%ut.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(h!==void 0&&h.env&&h.request&&h.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 vr.isDebug()},version:function(){return t.VERSION}},t})()},at(R)=="object"?g.exports=rt():(q=typeof(B=rt)=="function"?B.call(R,P,R,g):B)===void 0||(g.exports=q)}},a={};function u(g){var R=a[g];if(R!==void 0)return R.exports;var P=a[g]={id:g,loaded:!1,exports:{}};return o[g].call(P.exports,P,P.exports,u),P.loaded=!0,P.exports}u.n=g=>{var R=g&&g.__esModule?()=>g.default:()=>g;return u.d(R,{a:R}),R},u.d=(g,R)=>{for(var P in R)u.o(R,P)&&!u.o(g,P)&&Object.defineProperty(g,P,{enumerable:!0,get:R[P]})},u.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(g){if(typeof window=="object")return window}})(),u.hmd=g=>((g=Object.create(g)).children||(g.children=[]),Object.defineProperty(g,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+g.id)}}),g),u.o=(g,R)=>Object.prototype.hasOwnProperty.call(g,R),u.r=g=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})};var _=u(737);Yr.exports.LyyGetCommandSDK=_})()});var ro={};Me(ro,{DyErrorCode:()=>_e,DyErrorMessage:()=>Mt,ENV_TYPE:()=>Kt,EXTERNAL_ENV_TYPE:()=>ue,JdErrorCode:()=>ke,JdErrorMessage:()=>bt,createServices:()=>Qr,getDisplayAdConfig:()=>pr,getDyPayRtaData:()=>cr,handleDyPayFlow:()=>ur,handleJdInsurance:()=>ir,handleJdInsuranceExt:()=>ar,handleJdjrCashLoanExt:()=>or,handleJdjrCashLoanFlow:()=>nr,normalizeDisplayAdData:()=>Ve});module.exports=An(ro);var Kt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},ue={SIT:"sit",RELEASE:"release",PROD:"prod"},Be={[Kt.DEV]:"https://dm.leyaoyao.com",[Kt.SIT]:"https://sm.leyaoyao.com",[Kt.UAT]:"https://um.leyaoyao.com",[Kt.PROD]:"https://m.leyaoyao.com"},Rr={[Kt.DEV]:"https://dad2.leyaoyao.com",[Kt.SIT]:"https://sad2.leyaoyao.com",[Kt.UAT]:"https://uad2.leyaoyao.com",[Kt.PROD]:"https://nad.ehuoke.com"},Pe={[ue.SIT]:"https://sopenapi.leyaoyao.com",[ue.RELEASE]:"https://uopen-api.leyaoyao.com",[ue.PROD]:"https://api-gateway.leyaoyao.com"};function we(o,a){return`${Be[o]||Be[Kt.PROD]}${a}`}function Er(o){return Rr[o]||Rr[Kt.PROD]}var Se={debug:!1,env:Kt.PROD,externalEnv:ue.PROD,apiDomain:""},Sr=gt({},Se);function Tr(o){Sr=gt(gt({},Se),o)}function de(){return Sr}var Dn=Object.defineProperty,In=(o,a,u)=>a in o?Dn(o,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):o[a]=u,Rn=(o,a,u)=>In(o,typeof a!="symbol"?a+"":a,u);function re(){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 En=class{constructor(o=!1){Rn(this,"enable"),this.enable=o}setEnable(o){this.enable=o}info(...o){this.enable&&console.info("[BI Info]",...o)}warn(...o){this.enable&&console.warn("[BI Warn]",...o)}error(...o){this.enable&&console.error("[BI Error]",...o)}debug(...o){this.enable&&console.log("[BI Debug]",...o)}},x=new En;function ze(o){let a=re();return a==="taro"?Taro.setClipboardData({data:o}).then(()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):a==="uni"?new Promise((u,_)=>{uni.setClipboardData({data:o,success:()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{x.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),_(g)}})}):a==="wechat"?new Promise((u,_)=>{wx.setClipboardData({data:o,success:()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{x.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),_(g)}})}):a==="alipay"?new Promise((u,_)=>{my.setClipboardData({text:o,success:()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{x.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),_(g)}})}):navigator.clipboard.writeText(o).then(()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function Qe(o,a=2e3){let u=re();if(u==="taro"){Taro.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="uni"){uni.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="wechat"){wx.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="alipay"){my.showToast({content:o,duration:a});return}typeof console!="undefined"&&console.log(`[Toast] ${o}`)}async function me(){var o,a,u,_,g;let R=re();try{if(R==="taro")return((o=(await Taro.getSystemInfo()).platform)==null?void 0:o.toLowerCase())==="ios"?"ios":"android";if(R==="uni")return((a=uni.getSystemInfoSync().platform)==null?void 0:a.toLowerCase())==="ios"?"ios":"android";if(R==="wechat")return wx.getDeviceInfo?((u=(await wx.getDeviceInfo()).platform)==null?void 0:u.toLowerCase())==="ios"?"ios":"android":((_=wx.getSystemInfoSync().platform)==null?void 0:_.toLowerCase())==="ios"?"ios":"android";if(R==="alipay")return((g=my.getSystemInfoSync().platform)==null?void 0:g.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let P=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(P))return"ios";if(/android/.test(P))return"android"}return"unknown"}catch(P){return x.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",P),"unknown"}}var xt={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function K(o,a,u=null){return{code:o,message:a,data:u}}function qe(o,a){return o==null?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof o=="string"&&o.trim().length===0?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Ce(o,a){for(let u of a){let _=qe(o[u],u);if(!_.valid)return _}return{valid:!0}}var sr={};Me(sr,{handleJdInsurance:()=>ir,handleJdInsuranceExt:()=>ar,handleJdjrCashLoanExt:()=>or,handleJdjrCashLoanFlow:()=>nr});var ke=(k=>(k[k.JD_CASH_LOAN__MISSING_PHONE=2001]="JD_CASH_LOAN__MISSING_PHONE",k[k.JD_CASH_LOAN__MISSING_DEVICE_ID=2002]="JD_CASH_LOAN__MISSING_DEVICE_ID",k[k.JD_CASH_LOAN__RTA_FAILED=2003]="JD_CASH_LOAN__RTA_FAILED",k[k.JD_CASH_LOAN__GET_CONFIG_FAILED=2004]="JD_CASH_LOAN__GET_CONFIG_FAILED",k[k.JD_CASH_LOAN__INVALID_CONFIG=2005]="JD_CASH_LOAN__INVALID_CONFIG",k[k.JD_CASH_LOAN__EXT_NOT_ELIGIBLE=2006]="JD_CASH_LOAN__EXT_NOT_ELIGIBLE",k[k.JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS=2007]="JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS",k[k.JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM=2008]="JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM",k[k.JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID=2009]="JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID",k[k.JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE=2010]="JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE",k[k.JD_INSURANCE__USER_NOT_ELIGIBLE=2101]="JD_INSURANCE__USER_NOT_ELIGIBLE",k[k.JD_INSURANCE__H5_NOT_SUPPORTED=2102]="JD_INSURANCE__H5_NOT_SUPPORTED",k[k.JD_INSURANCE__INVALID_JUMP_PARAMS=2103]="JD_INSURANCE__INVALID_JUMP_PARAMS",k[k.JD_INSURANCE__GET_CONFIG_FAILED=2104]="JD_INSURANCE__GET_CONFIG_FAILED",k[k.JD_INSURANCE__COPY_FAILED=2105]="JD_INSURANCE__COPY_FAILED",k[k.JD_INSURANCE__TASK_COMPLETED=2106]="JD_INSURANCE__TASK_COMPLETED",k[k.JD_INSURANCE__UNKNOWN_JUMP_MODE=2107]="JD_INSURANCE__UNKNOWN_JUMP_MODE",k[k.JD_INSURANCE__RTA_FAILED=2108]="JD_INSURANCE__RTA_FAILED",k))(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=(m=>(m[m.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",m[m.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",m[m.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",m[m.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",m[m.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",m[m.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",m[m.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",m[m.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",m[m.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",m[m.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",m[m.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",m[m.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",m[m.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",m[m.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",m[m.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",m[m.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",m[m.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",m[m.DY_PAY__INVALID_RETURN_TYPE=3018]="DY_PAY__INVALID_RETURN_TYPE",m[m.DY_PAY__JSAPI_INFO_FAILED=3019]="DY_PAY__JSAPI_INFO_FAILED",m[m.DY_PAY__REQUEST_JSAPI_INFO_FAILED=3020]="DY_PAY__REQUEST_JSAPI_INFO_FAILED",m[m.DY_PAY__MISSING_JSAPI_PAY_INFO=3021]="DY_PAY__MISSING_JSAPI_PAY_INFO",m[m.DY_PAY__INVALID_JSAPI_PAY_INFO=3022]="DY_PAY__INVALID_JSAPI_PAY_INFO",m))(_e||{}),Mt={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"};var Sn=(o,a,u,_)=>{let g=re();if(g==="taro")return Taro.request({url:o,method:a,data:u,header:_}).then(B=>B);if(g==="uni")return new Promise((B,q)=>{uni.request({url:o,method:a,data:u,header:_,success:rt=>B(rt),fail:rt=>q(rt)})});if(g==="wechat")return new Promise((B,q)=>{wx.request({url:o,method:a,data:u,header:_,success:rt=>B(rt),fail:rt=>q(rt)})});if(g==="alipay")return new Promise((B,q)=>{my.request({url:o,method:a,data:u,headers:_,success:rt=>B(rt),fail:rt=>q(rt)})});let R=a.toUpperCase()==="GET",P=R&&u&&Object.keys(u).length?`${o}?${new URLSearchParams(u).toString()}`:o;return fetch(P,{method:a,headers:_,body:R?void 0:JSON.stringify(u)}).then(async B=>({statusCode:B.status,data:await B.json()}))},Ze=class{constructor(a=null){je(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||de()||Se}async getAuthToken(){let a=this.getCurrentConfig();if(a.getAuthToken&&typeof a.getAuthToken=="function")try{let u=await a.getAuthToken();return u?(x.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),u):(x.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(u){return x.error("\u83B7\u53D6Token\u5931\u8D25",u),null}return null}async buildHeader(a={},u=!0){let _=gt({"content-type":"application/json"},a);if(!u)return _;let g=await this.getAuthToken();if(!g)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 _.Authorization_bar=g,_}async request(a){let{path:u,method:_="POST",data:g={},header:R={},authRequired:P=!0,baseDomain:B,beforeRequest:q,afterResponse:rt}=a,at=B?`${B}${u}`:we(this.getCurrentConfig().env||"prod",u),Q=await this.buildHeader(R,P);q&&typeof q=="function"&&await q({url:at,method:_,data:g,header:Q}),x.info(`\u53D1\u8D77${_}\u8BF7\u6C42:`,{path:u,method:_});try{let $=await Sn(at,_,g,Q);return x.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:$.statusCode}),rt&&typeof rt=="function"&&await rt($.data),$.data}catch($){throw x.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:$}),$}}get(a,u={},_={}){return this.request(gt({path:a,method:"GET",data:u},_))}post(a,u={},_={}){return this.request(gt({path:a,method:"POST",data:u},_))}},Te=(o=null)=>new Ze(o);var Tn=(function(){"use strict";function o(I,Z){var ht=(65535&I)+(65535&Z);return(I>>16)+(Z>>16)+(ht>>16)<<16|65535&ht}function a(I,Z,ht,ot,k,Tt){return o((Tt=o(o(Z,I),o(ot,Tt)))<<k|Tt>>>32-k,ht)}function u(I,Z,ht,ot,k,Tt,S){return a(Z&ht|~Z&ot,I,Z,k,Tt,S)}function _(I,Z,ht,ot,k,Tt,S){return a(Z&ot|ht&~ot,I,Z,k,Tt,S)}function g(I,Z,ht,ot,k,Tt,S){return a(Z^ht^ot,I,Z,k,Tt,S)}function R(I,Z,ht,ot,k,Tt,S){return a(ht^(Z|~ot),I,Z,k,Tt,S)}function P(I,Z){var ht,ot,k,Tt;I[Z>>5]|=128<<Z%32,I[14+(Z+64>>>9<<4)]=Z;for(var S=1732584193,b=-271733879,m=-1732584194,C=271733878,v=0;v<I.length;v+=16)S=u(ht=S,ot=b,k=m,Tt=C,I[v],7,-680876936),C=u(C,S,b,m,I[v+1],12,-389564586),m=u(m,C,S,b,I[v+2],17,606105819),b=u(b,m,C,S,I[v+3],22,-1044525330),S=u(S,b,m,C,I[v+4],7,-176418897),C=u(C,S,b,m,I[v+5],12,1200080426),m=u(m,C,S,b,I[v+6],17,-1473231341),b=u(b,m,C,S,I[v+7],22,-45705983),S=u(S,b,m,C,I[v+8],7,1770035416),C=u(C,S,b,m,I[v+9],12,-1958414417),m=u(m,C,S,b,I[v+10],17,-42063),b=u(b,m,C,S,I[v+11],22,-1990404162),S=u(S,b,m,C,I[v+12],7,1804603682),C=u(C,S,b,m,I[v+13],12,-40341101),m=u(m,C,S,b,I[v+14],17,-1502002290),S=_(S,b=u(b,m,C,S,I[v+15],22,1236535329),m,C,I[v+1],5,-165796510),C=_(C,S,b,m,I[v+6],9,-1069501632),m=_(m,C,S,b,I[v+11],14,643717713),b=_(b,m,C,S,I[v],20,-373897302),S=_(S,b,m,C,I[v+5],5,-701558691),C=_(C,S,b,m,I[v+10],9,38016083),m=_(m,C,S,b,I[v+15],14,-660478335),b=_(b,m,C,S,I[v+4],20,-405537848),S=_(S,b,m,C,I[v+9],5,568446438),C=_(C,S,b,m,I[v+14],9,-1019803690),m=_(m,C,S,b,I[v+3],14,-187363961),b=_(b,m,C,S,I[v+8],20,1163531501),S=_(S,b,m,C,I[v+13],5,-1444681467),C=_(C,S,b,m,I[v+2],9,-51403784),m=_(m,C,S,b,I[v+7],14,1735328473),S=g(S,b=_(b,m,C,S,I[v+12],20,-1926607734),m,C,I[v+5],4,-378558),C=g(C,S,b,m,I[v+8],11,-2022574463),m=g(m,C,S,b,I[v+11],16,1839030562),b=g(b,m,C,S,I[v+14],23,-35309556),S=g(S,b,m,C,I[v+1],4,-1530992060),C=g(C,S,b,m,I[v+4],11,1272893353),m=g(m,C,S,b,I[v+7],16,-155497632),b=g(b,m,C,S,I[v+10],23,-1094730640),S=g(S,b,m,C,I[v+13],4,681279174),C=g(C,S,b,m,I[v],11,-358537222),m=g(m,C,S,b,I[v+3],16,-722521979),b=g(b,m,C,S,I[v+6],23,76029189),S=g(S,b,m,C,I[v+9],4,-640364487),C=g(C,S,b,m,I[v+12],11,-421815835),m=g(m,C,S,b,I[v+15],16,530742520),S=R(S,b=g(b,m,C,S,I[v+2],23,-995338651),m,C,I[v],6,-198630844),C=R(C,S,b,m,I[v+7],10,1126891415),m=R(m,C,S,b,I[v+14],15,-1416354905),b=R(b,m,C,S,I[v+5],21,-57434055),S=R(S,b,m,C,I[v+12],6,1700485571),C=R(C,S,b,m,I[v+3],10,-1894986606),m=R(m,C,S,b,I[v+10],15,-1051523),b=R(b,m,C,S,I[v+1],21,-2054922799),S=R(S,b,m,C,I[v+8],6,1873313359),C=R(C,S,b,m,I[v+15],10,-30611744),m=R(m,C,S,b,I[v+6],15,-1560198380),b=R(b,m,C,S,I[v+13],21,1309151649),S=R(S,b,m,C,I[v+4],6,-145523070),C=R(C,S,b,m,I[v+11],10,-1120210379),m=R(m,C,S,b,I[v+2],15,718787259),b=R(b,m,C,S,I[v+9],21,-343485551),S=o(S,ht),b=o(b,ot),m=o(m,k),C=o(C,Tt);return[S,b,m,C]}function B(I){for(var Z="",ht=32*I.length,ot=0;ot<ht;ot+=8)Z+=String.fromCharCode(I[ot>>5]>>>ot%32&255);return Z}function q(I){var Z=[];for(Z[(I.length>>2)-1]=void 0,ot=0;ot<Z.length;ot+=1)Z[ot]=0;for(var ht=8*I.length,ot=0;ot<ht;ot+=8)Z[ot>>5]|=(255&I.charCodeAt(ot/8))<<ot%32;return Z}function rt(I){for(var Z,ht="0123456789abcdef",ot="",k=0;k<I.length;k+=1)Z=I.charCodeAt(k),ot+=ht.charAt(Z>>>4&15)+ht.charAt(15&Z);return ot}function at(I){return unescape(encodeURIComponent(I))}function Q(I){return B(P(q(I=at(I)),8*I.length))}function $(I,Z){return(function(ht,ot){var k,Tt=q(ht),S=[],b=[];for(S[15]=b[15]=void 0,16<Tt.length&&(Tt=P(Tt,8*ht.length)),k=0;k<16;k+=1)S[k]=909522486^Tt[k],b[k]=1549556828^Tt[k];return ot=P(S.concat(q(ot)),512+8*ot.length),B(P(b.concat(ot),640))})(at(I),at(Z))}function ve(I,Z,ht){return Z?ht?$(Z,I):rt($(Z,I)):ht?Q(I):rt(Q(I))}return ve})(),Oe=Tn;function br(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function Pr(o){if(typeof o!="object"||o===null)return o;let a=Object.keys(o).sort(),u={};for(let _ of a)u[_]=o[_];return JSON.stringify(u)}function wr(o,a){let u={appId:o.appId,randomStr:o.randomStr,data:o.data},_=Object.keys(u).sort(),g="";for(let[R,P]of _.entries())g+=`${P}=${u[P]}`,R<_.length-1&&(g+="&");return g+=`&secretKey=${a}`,Oe(g)}var bn=(o,a,u,_)=>{let g=re();return g==="taro"?Taro.request({url:o,method:a,data:u,header:_}).then(R=>R):g==="uni"?new Promise((R,P)=>{uni.request({url:o,method:a,data:u,header:_,success:B=>R(B),fail:B=>P(B)})}):g==="wechat"?new Promise((R,P)=>{wx.request({url:o,method:a,data:u,header:_,success:B=>R(B),fail:B=>P(B)})}):g==="alipay"?new Promise((R,P)=>{my.request({url:o,method:a,data:u,headers:_,success:B=>R(B),fail:B=>P(B)})}):fetch(o,{method:a,headers:_,body:JSON.stringify(u)}).then(async R=>({statusCode:R.status,data:await R.json()}))},tr=class{constructor(a=null){je(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||de()||{}}getExternalEnv(){var a;return((a=this.getCurrentConfig())==null?void 0:a.externalEnv)||ue.PROD}getExternalHost(){let a=this.getExternalEnv();return Pe[a]||Pe.prod}generateSign(a={}){let u=this.getCurrentConfig(),{externalAppId:_,externalAppSecret:g}=u;if(!_||!g)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let R=br(),P=Pr(a),B=wr({appId:_,randomStr:R,data:P},g);return{appId:_,randomStr:R,sign:B}}buildRequestBody(a={}){let u=this.generateSign(a);return Zt(gt({},u),{data:a})}buildUrl(a){return`${this.getExternalHost()}${a}`}async request(a){let{path:u,method:_="POST",data:g={},header:R={},needSign:P=!0,beforeRequest:B,afterResponse:q}=a,rt=this.buildUrl(u),at=gt({"content-type":"application/json"},R),Q=P?this.buildRequestBody(g):g;B&&typeof B=="function"&&await B({url:rt,method:_,data:Q,header:at}),x.info(`\u53D1\u8D77${_}\u8BF7\u6C42:`,{path:u,method:_});try{let $=await bn(rt,_,Q,at);if(x.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:$.statusCode}),q&&typeof q=="function"&&await q($.data),$.statusCode===200&&$.data.code===200)return $.data.data;throw{code:$.data.code,msg:$.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:$.data}}catch($){throw($==null?void 0:$.code)!==void 0?$:(x.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:$}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:$})}}get(a,u={},_={}){return this.request(gt({path:a,method:"GET",data:u},_))}post(a,u={},_={}){return this.request(gt({path:a,method:"POST",data:u},_))}},Cr=(o=null)=>new tr(o);var er=Te(),rr=Cr();function Or(o){let a=qe(o==null?void 0:o.equipmentValue,"equipmentValue");return a.valid?er.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Nr(o){let a=Ce(o,["idMd5Value","rtaStrategy"]);return a.valid?rr.post("/open/rest/cpa/jd/rta-check",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Fr(o){try{let a={thirdPlatform:o.thirdPlatform,thirdPlatformUserId:o.thirdPlatformUserId,thirdPlatformEquipmentValue:o.thirdPlatformEquipmentValue,os:o.os,client:"wxMini"};o.phone&&(a.mobileMd5=Oe(o.phone)),o.extendData&&(Object.prototype.toString.call(o.extendData)==="[object Object]"?a.extendData=o.extendData:x.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let u=await rr.post("/open/rest/cpa/jd/insurance/get",a);return u?u.jumpMode==1?{jumpMode:1,appId:u.appId,url:u.url}:{jumpMode:2,url:u.url,channel:u.channelId}:void 0}catch(a){throw x.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",a),a}}function xr(o){let a=qe(o==null?void 0:o.equipmentValue,"equipmentValue");return a.valid?er.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}function Lr(o){let a=Ce(o,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return a.valid?er.post("/gw/advert/customer/cpa-activity/jd/rta/validate",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Ur(o){let a=await me(),u={thirdPlatform:o.thirdPlatform,thirdPlatformUserId:o.thirdPlatformUserId,thirdPlatformEquipmentValue:o.thirdPlatformEquipmentValue,os:a,client:o.client};return o.phone&&(u.mobileMd5=Oe(o.phone)),o.extendData&&(Object.prototype.toString.call(o.extendData)==="[object Object]"?u.extendData=o.extendData:x.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),rr.post("/open/rest/cpa/jd/cash-loan/get",u)}async function nr(o){let{phone:a,rtaId:u,equipmentId:_,lyyUserId:g,entrance:R}=o;if(!a)return K(xt.INVALID_PARAM,bt[2001]);if(!_)return K(xt.INVALID_PARAM,bt[2002]);try{if(u){x.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let Q=await Lr({phone:a,lyyEquipmentValue:_,lyyUserId:g||"",rtaId:u});if(Q.code!=="0000000"||!Q.body||Q.body.state!=1)return x.error("RTA\u9A8C\u8BC1\u5931\u8D25",Q),K(2003,bt[2003]);x.info("RTA\u9A8C\u8BC1\u6210\u529F",Q.body)}x.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:a});let P=await me(),B=await xr({phone:a,equipmentValue:_,os:P,entrance:R});if(B.code!=="0000000"||!B.body)return x.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",B),K(2004,bt[2004]);let{appId:q,targetUrl:rt}=B.body;if(!q||!rt)return x.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:q,targetUrl:rt}),K(2005,bt[2005]);let at=K(xt.SUCCESS,"\u6210\u529F",{appId:q,targetUrl:rt});return x.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",at),at}catch(P){return x.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",P),K(xt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function or(o){let{phone:a,rtaId:u,thirdPlatform:_,thirdPlatformUserId:g,thirdPlatformEquipmentValue:R}=o;if(!a)return K(xt.INVALID_PARAM,bt[2001]);if(!_)return K(2008,bt[2008]);if(!g)return K(2009,bt[2009]);if(!R)return K(2010,bt[2010]);try{if(u){x.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let $=await Nr({idMd5Value:a,rtaStrategy:u});if($.status!=1)return x.error("RTA\u9A8C\u8BC1\u5931\u8D25",$),K(2003,bt[2003]);x.info("RTA\u9A8C\u8BC1\u6210\u529F",$)}let P=await Ur(o),{url:B,channelId:q,matchFlag:rt,jumpMode:at,appId:Q}=P||{};return rt?at===3?!Q||!B?K(2007,bt[2007]):K(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:Q,url:B}):K(2007,bt[2007]):K(2006,bt[2006])}catch(P){return x.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",P),K(xt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var be=null,Ne=null;try{Ne=Mr()}catch(o){}function jr(){return be||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(be=globalThis.LyyGetCommandSDK,be):Ne?(be=Ne.LyyGetCommandSDK||Ne.default||Ne,be):null)}function Br(o){var u;x.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",o);let a=jr();a!=null&&a.getJrCommand?a.getJrCommand(o):(u=a==null?void 0:a.default)!=null&&u.getJrCommand?a.default.getJrCommand(o):(x.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),o.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function Pn(o,a){return new Promise((u,_)=>{try{Br({url:o,channel:a,callback:g=>{g.code==="0"?u(g.data):_({msg:g.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(g){_(g)}})}async function ir(o){try{let a=await me(),u=gt({os:a},o);x.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",u);let{code:_,body:g}=await Or(u);if(_==="0000000"&&g){let{url:R,channelId:P,matchFlag:B,jumpMode:q,appId:rt}=g;if(!B)return K(2101,bt[2101]);if(q===1)return x.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),K(2102,bt[2102]);if(q===2)return re()==="web"&&x.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:R}),!R||!P?K(2103,bt[2103]):new Promise(at=>{Br({url:R,channel:P,callback:async Q=>{if((Q==null?void 0:Q.code)==="0")try{await ze(Q==null?void 0:Q.data),at(K(xt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch($){at(K(2105,bt[2105]))}else at(K(2105,bt[2105]))}})});if(q===3)return!rt||!R?K(2103,bt[2103]):K(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:rt,path:R})}return K(2104,bt[2104])}catch(a){return x.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",a),K(xt.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function ar(o){x.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let a=await Fr(Zt(gt({},o),{os:await me()}));if(!a)return x.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),K(2106,bt[2106]);if(a.jumpMode===1)return x.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:a.appId,url:a.url}),K(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:a.appId,path:a.url});if(a.jumpMode===2){if(re()==="web")return x.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:a.url}),K(xt.SUCCESS,"\u6210\u529F",{type:"h5",url:a.url});try{let u=await Pn(a.url,a.channel);return await ze(u),x.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),K(xt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(u){return x.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",u),Qe("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),K(2105,bt[2105])}}return x.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",a.jumpMode),K(2107,bt[2107])}catch(a){let u=typeof a=="string"?a:(a==null?void 0:a.msg)||(a==null?void 0:a.message)||"\u672A\u77E5\u9519\u8BEF";return x.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",u),Qe("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),u.includes("RTA")||u.includes("\u8D44\u683C")?K(2108,bt[2108]):K(xt.NETWORK_ERROR,u)}}var lr={};Me(lr,{DyErrorCode:()=>_e,getDyPayRtaData:()=>cr,handleDyPayFlow:()=>ur});var wn=["weapp","h5"],Cn=["default","jsapi"];function On(o){return wn.includes(o)}var Nn=["h5","ulink"];function Fn(o){return Nn.includes(o)}function xn(o){return Cn.includes(o)}var Ln=["switchTab","reLaunch","redirectTo","navigateTo"];function Un(o){return Ln.includes(o)}function qr(o){return o.telephone?o.price?o.equipmentValue?o.businessType?o.client&&!On(o.client)?{valid:!1,errorCode:3004}:o.returnType&&!Fn(o.returnType)?{valid:!1,errorCode:3018}:o.payClientType&&!xn(o.payClientType)?{valid:!1,errorCode:3004}:o.douyinOrderExtendData&&typeof o.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:o.backWay&&o.client==="weapp"&&!Un(o.backWay)?{valid:!1,errorCode:3016}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}:{valid:!1,errorCode:3001}}function kr(o){return o.equipmentValue?o.telephone?{valid:!0,errorCode:0}:{valid:!1,errorCode:3001}:{valid:!1,errorCode:3002}}var Je=Te();async function Jr(o){let{price:a,equipmentValue:u,douyinOrderExtendData:_,douyinCommodityVirtualFlag:g,businessType:R,platformActivities:P={}}=o,B={businessType:R,equipmentValue:u,payInfoBusinessType:"commonDouyinPayment",platformActivities:gt({douyinCommodityVirtualFlag:g||!1,douyinCommodityPrice:a,douyinOrderExtendData:_||""},P)};try{let q=await Je.post("/gw/advert/customer/payment/pay-info",B);return q.code!=="0000000"||!(q!=null&&q.body)?Promise.reject({code:3006,message:q.message||Mt[3006]}):(q.body.platformActivities=B.platformActivities,q)}catch(q){return x.error("getDyOrderAmountFn error:",q),Promise.reject({code:3007,message:Mt[3007]})}}async function Vr(o){var a,u;try{let _=o.commodityList.map(Q=>(Q.commodity=Q.commodityId,delete Q.commodityId,Q.quantity=Q.quantity||1,Q)),g=o.advertExtendInfo&&Object.keys(o.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:o.advertExtendInfo}):"",R=re(),P="";R==="wechat"?P="wechatMini":R==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(P="wechatHtml");let B=o.payClientType==="jsapi",q=B?22:21,rt=gt(gt(gt({businessType:o.businessType,fixedClientType:q,channelCode:null,douyinData:{loginMobile:o.telephone||""},equipmentUseFlag:!0,payEquipmentDTO:{equipmentValue:o.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:g,transType:5,actualFee:o.totalFee,totalFee:o.totalFee,commodityList:_,clientSourceDetailType:P,platformActivities:o.platformActivities||{}},o.commoditySign&&{commoditySign:o.commoditySign}),o.unifiedOrderExtendData&>({},o.unifiedOrderExtendData)),B?{appId:((a=o.jsapiInfo)==null?void 0:a.appId)||"",openId:((u=o.jsapiInfo)==null?void 0:u.douyinOpenId)||""}:{}),at=await Je.post("/gw/payment-bff/unified/order",rt);return at.code!=="0000000"||!(at!=null&&at.body)?Promise.reject({code:3008,message:at.message||Mt[3008]}):at}catch(_){return x.error("dyUnifiedOrderFn error:",_),Promise.reject({code:3009,message:Mt[3009]})}}async function Hr(o){let a={equipmentValue:o.equipmentValue,phone:o.telephone||""};o.price&&(a.orderAmount=o.price);try{let u=await Je.post("/gw/advert/customer/douyin/pay/check",a);return u.code!=="0000000"||!(u!=null&&u.body)?Promise.reject({code:3013,message:u.message||Mt[3013]}):u}catch(u){return x.error("getDyPayRtaData error:",u),Promise.reject({code:3014,message:(u==null?void 0:u.message)||Mt[3014]})}}async function Gr(){try{let o=await Je.get("/gw/advert/customer/douyin/pay/jsapi/info");return o.code!=="0000000"||!(o!=null&&o.body)?Promise.reject({code:3019,message:o.message||Mt[3019]}):{appId:o.body.appId,douyinOpenId:o.body.douyinOpenId}}catch(o){return x.error("getDyPayJsapiInfoFn error:",o),Promise.reject({code:(o==null?void 0:o.code)||3020,message:(o==null?void 0:o.message)||Mt[3020]})}}async function ur(o){var u,_,g,R;let a=qr(o);if(!a.valid)return K(a.errorCode,Mt[a.errorCode]);try{let P=await Jr({price:o.price,equipmentValue:o.equipmentValue,businessType:o.businessType,douyinOrderExtendData:(o==null?void 0:o.douyinOrderExtendData)||"",platformActivities:(o==null?void 0:o.platformActivities)||{},douyinCommodityVirtualFlag:(o==null?void 0:o.douyinCommodityVirtualFlag)||!1}),B=o.payClientType==="jsapi"?await Gr():void 0,q=await Vr(Zt(gt(Zt(gt({},P.body),{telephone:o.telephone,equipmentValue:o.equipmentValue,businessType:o.businessType}),o.unifiedOrderExtendData&&{unifiedOrderExtendData:o.unifiedOrderExtendData}),{payClientType:o.payClientType,jsapiInfo:B})),rt=((u=q==null?void 0:q.body)==null?void 0:u.h5Url)||"",at=((_=q==null?void 0:q.body)==null?void 0:_.outTradeNo)||"";if(o.returnType==="ulink"){let $=rt?await Bn(Zt(gt({},o),{dyUrl:rt})):"";return $?K(0,"success",{ulinkUrl:$,outTradeNo:at}):K(3010,Mt[3010])}if(o.payClientType==="jsapi"){let $=Yn((g=q==null?void 0:q.body)==null?void 0:g.payInfo);return K(0,"success",{appId:(B==null?void 0:B.appId)||"",payInfo:$,outTradeNo:at})}let Q=rt?await jn(Zt(gt({},o),{dyUrl:rt})):"";return Q?K(0,"success",{h5Url:Q,outTradeNo:at}):K(3010,Mt[3010])}catch(P){x.error("handleDyPayFlow error:",P);let B=(R=P==null?void 0:P.code)!=null?R:3012,q=(P==null?void 0:P.message)||Mt[3012];return K(B,q)}}function Yn(o){if(!o)throw{code:3021,message:Mt[3021]};try{let a=JSON.parse(o);if(!Mn(a))throw new Error("invalid payInfo fields");return a}catch(a){throw{code:3022,message:Mt[3022],error:a}}}function Mn(o){return typeof o.timeStamp=="string"&&o.timeStamp!==""&&typeof o.nonceStr=="string"&&o.nonceStr!==""&&typeof o.package=="string"&&o.package!==""&&typeof o.signType=="string"&&o.signType!==""&&typeof o.paySign=="string"&&o.paySign!==""}async function jn(o){let a=de(),u=we(a.env||"prod",""),_=typeof a.getAuthToken=="function"?await a.getAuthToken():"",g=o.client||"weapp";return`${u}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${g}&equipmentId=${o.equipmentValue}&dyUrl=${o.dyUrl}&fromUrl=${encodeURIComponent(o.fromUrl||"")}&backUrl=${encodeURIComponent(o.backUrl||"")}&backWay=${o.backWay||""}&url_token=${_}`}async function Bn(o){let a=de(),u=we(a.env||"prod",""),_=typeof a.getAuthToken=="function"?await a.getAuthToken():"";return`${u}/pages/subAdvertising.html?#/douyinPayUlinkTransfer?equipmentId=${o.equipmentValue}&dyUrl=${encodeURIComponent(o.dyUrl)}&fromUrl=${encodeURIComponent(o.fromUrl||"")}&backUrl=${encodeURIComponent(o.backUrl||"")}&url_token=${_}`}async function cr(o){var u;let a=kr(o);if(!a.valid)return K(a.errorCode,Mt[a.errorCode]);try{let _=await Hr({price:(o==null?void 0:o.price)||"",equipmentValue:o.equipmentValue,telephone:(o==null?void 0:o.telephone)||""});return K(0,"success",_.body)}catch(_){x.error("getDyPayRtaData error:",_);let g=(u=_==null?void 0:_.code)!=null?u:3015,R=(_==null?void 0:_.message)||Mt[3015];return K(g,R)}}var hr={};Me(hr,{getDisplayAdConfig:()=>pr,normalizeDisplayAdData:()=>Ve});var qn=Te();function Xr(o){let a=Ce(o,["placementId"]);if(!a.valid)return Promise.reject({code:"PARAM_ERROR",message:a.message});let u=de().env||"prod";return qn.get(`/gw/advert-plugin/api/v1/config/list/valid/${o.placementId}`,{},{authRequired:!1,baseDomain:Er(u)})}var Kr=30*1e3,kn="__",dr=new Map,fr=new Map;function Jn(o,a){return[o.appId||"",a,o.type||""].join(kn)}function Vn(o){let a=dr.get(o);return a?a.expireAt<=Date.now()?(dr.delete(o),x.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:o}),null):a.data:null}function Hn(o,a){dr.set(o,{data:a,expireAt:Date.now()+Kr})}function Gn(o){return Array.isArray(o==null?void 0:o.body)?o.body:[]}function Xn(o){return String(o==null?void 0:o.code)!=="200"}function Kn(o,a){let u=String(o||a||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(u)?u:a||"banner"}function Wr(o){return String(o||"").trim().toLowerCase()}function Wn(o){var a;return!!o&&o.status!==0&&((a=o.platformConfig)==null?void 0:a.valid)!==!1}function $n(o){return[...o].sort((a,u)=>{var R,P,B,q;let _=Number((R=a.priority)!=null?R:9999),g=Number((P=u.priority)!=null?P:9999);return _!==g?_-g:Number((B=u.weight)!=null?B:0)-Number((q=a.weight)!=null?q:0)})}function $r(o){return o.find(a=>Wr(a.advertPlatform)==="gdt")||null}function zr(o){return o.find(a=>Wr(a.advertPlatform)!=="gdt")||null}function zn(o,a){return o&&a?"mixed":o?"wechat":a?"custom":"none"}function Qn(o,a){var g,R;let u=$r(o),_=zr(o);return u&&_?Number((g=u.priority)!=null?g:9999)<=Number((R=_.priority)!=null?R:9999)?"wechat-first":"custom-first":a==="custom"?"custom-only":a==="wechat"?"wechat-only":"wechat-first"}function Zn(o){var u;let a=$r(o);return((u=a==null?void 0:a.platformConfig)==null?void 0:u.adId)||""}function to(o){let a=zr(o),u=a==null?void 0:a.platformConfig;if(!u)return null;let _=u.image||u.imageUrl||"",g=u.video||u.videoUrl||"",R=u.poster||_||"",P=u.jumpUrl||u.url||u.webUrl||"";return!_&&!g?null:{image:_||void 0,video:g||void 0,poster:R||void 0,title:u.title,description:u.description,buttonText:u.buttonText,badgeText:u.badgeText,jumpSeconds:u.jumpSeconds,loadTimeout:u.loadTimeout||u.timeout,muted:u.muted,adSpec:u.adSpec,url:P||void 0,action:P?{type:"web",url:P}:void 0}}function Ve(o,a){let u=$n(o.filter(Wn)),_=to(u),g=Zn(u),R=Kn(void 0,a),P=zn(g,_),B=Qn(u,P);return{show:!!(g||_),adId:"",type:R,provider:P,priority:B,unitId:g,customAd:_,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:o}}async function pr(o){let a=o.placementId||o.adId||"",u=Jn(o,a),_=Vn(u);if(_)return x.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:u,placementId:a}),K(xt.SUCCESS,"\u6210\u529F",_);let g=fr.get(u);if(g)return x.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:u,placementId:a}),g;let R=(async()=>{try{x.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",o);let P=await Xr({placementId:a}),B=Gn(P);if(x.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:u,placementId:a,response:P,body:B}),Xn(P)||!B)return x.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",P),K(xt.UNKNOWN_ERROR,(P==null?void 0:P.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let q=Ve(B,o.type);return q.adId=a,q.cache=Zt(gt({},q.cache),{enable:!0,ttl:Kr}),Hn(u,q),x.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:u,placementId:a,provider:q.provider,priority:q.priority,hasUnitId:!!q.unitId,hasCustomAd:!!q.customAd}),K(xt.SUCCESS,"\u6210\u529F",q)}catch(P){return x.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:u,placementId:a,error:P}),K(xt.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{fr.delete(u)}})();return fr.set(u,R),R}function eo(o={}){x.info("\u670D\u52A1\u521D\u59CB\u5316",o);let a=gt(gt({},Se),o);a.env&&!Be[a.env]&&(x.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${a.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.env=Kt.PROD),a.externalEnv&&!Pe[a.externalEnv]&&(x.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${a.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.externalEnv=ue.PROD),a.debug!==void 0&&x.setEnable(a.debug),Tr(a),x.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",a)}function Qr(o={}){let a="",u=null;async function _(){if(typeof o.getAuthToken=="function"){let R=await o.getAuthToken();if(R)return R}return u&&typeof u.getStorage=="function"&&u.getStorage("auth_token")||""}let g={name:"services",setToken(R){return a=R||"",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",a),g},async getAuthToken(){return a||_()},clearToken(){return a="",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",""),g},install(R){u=R;let P=Zt(gt({},o),{getAuthToken:()=>g.getAuthToken()});eo(P),x.info("services installed via nova.use()"),Object.assign(R,{jd:gt({},sr),dy:gt({},lr),ads:gt({},hr),setToken:g.setToken,clearToken:g.clearToken})}};return g}0&&(module.exports={DyErrorCode,DyErrorMessage,ENV_TYPE,EXTERNAL_ENV_TYPE,JdErrorCode,JdErrorMessage,createServices,getDisplayAdConfig,getDyPayRtaData,handleDyPayFlow,handleJdInsurance,handleJdInsuranceExt,handleJdjrCashLoanExt,handleJdjrCashLoanFlow,normalizeDisplayAdData});
|
|
4
|
+
`),c+=It[t[j]>>2]+It[(3&t[j])<<4|t[j+1]>>4]+It[(15&t[j+1])<<2|t[j+2]>>6]+It[63&t[j+2]];for(r=0;r<s;r++)c+="=";return c},b4_decode:function(t){var r=0,s=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 p,h,E,O,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)p=It.indexOf(t.charAt(r++)),h=It.indexOf(t.charAt(r++)),E=It.indexOf(t.charAt(r++)),O=It.indexOf(t.charAt(r++)),w[s++]=p<<2|h>>4,w[s++]=(15&h)<<4|E>>2,w[s++]=(3&E)<<6|O;for(r=0;r<c;r++)if(w.pop()!=0)return null;return w}};function pt(){}pt.encode=function(t,r,s){for(var c=new Array(2*s),p=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),h=r,E=0;h<s+r;h++,E++)c[E]=p[(255&t[h])>>4],c[++E]=p[15&t[h]];return c.join("")},pt.decode=function(t){if(t==null||t==""||t.length%2!=0)return null;for(var r=t.length/2,s=pt.toCharCodeArray(t),c=new Array(r),p=0;p<r;p++){if(48<=s[2*p]&&s[2*p]<=57)c[p]=s[2*p]-48<<4;else if(65<=s[2*p]&&s[2*p]<=70)c[p]=s[2*p]-65+10<<4;else{if(!(97<=s[2*p]&&s[2*p]<=102))return null;c[p]=s[2*p]-97+10<<4}if(48<=s[2*p+1]&&s[2*p+1]<=57)c[p]=c[p]|s[2*p+1]-48;else if(65<=s[2*p+1]&&s[2*p+1]<=70)c[p]=c[p]|s[2*p+1]-65+10;else{if(!(97<=s[2*p+1]&&s[2*p+1]<=102))return null;c[p]=c[p]|s[2*p+1]-97+10}}return c},pt.toCharCodeArray=function(t){for(var r=new Array(t.length),s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r};var Vt=pt,Ht=Vt;(Ut=function(){}).utf8StrToh6=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],p=0;p<s;p++)c[p]=r.charCodeAt(p).toString(16);return c.join("")},Ut.utf8StrToBytes=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],p=0;p<s;p++)c[p]=r.charCodeAt(p);return c},Ut.hexToUtf8Str=function(t){for(var r=Ht.decode(t),s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.bytesToUtf8Str=function(t){for(var r=t,s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.intToByte=function(t){return new Array(t>>24&255,t>>16&255,t>>8&255,255&t)},Ut.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 Jt,zt=Ut,Gt={exports:{}};Jt=Gt,function(){function t(e,n,i){e!=null&&(typeof e=="number"?this.fromNumber(e,n,i):n==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,n))}function r(){return new t(null)}var s=(s=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(t.prototype.am=function(e,n,i,f,A,N){for(var M=32767&n,L=n>>15;0<=--N;){var Ft=32767&this[e],Wt=this[e++]>>15,se=L*Ft+Wt*M;A=((Ft=M*Ft+((32767&se)<<15)+i[f]+(1073741823&A))>>>30)+(se>>>15)+L*Wt+(A>>>30),i[f++]=1073741823&Ft}return A},30):s&&navigator.appName!="Netscape"?(t.prototype.am=function(e,n,i,f,A,N){for(;0<=--N;){var M=n*this[e++]+i[f]+A;A=Math.floor(M/67108864),i[f++]=67108863&M}return A},26):(t.prototype.am=function(e,n,i,f,A,N){for(var M=16383&n,L=n>>14;0<=--N;){var Ft=16383&this[e],Wt=this[e++]>>14,se=L*Ft+Wt*M;A=((Ft=M*Ft+((16383&se)<<14)+i[f]+A)>>28)+(se>>14)+L*Wt,i[f++]=268435455&Ft}return A},28);t.prototype.DB=s,t.prototype.DM=(1<<s)-1,t.prototype.DV=1<<s,t.prototype.FV=Math.pow(2,52),t.prototype.F1=52-s,t.prototype.F2=2*s-52;for(var c=new Array,p=48,h=0;h<=9;++h)c[p++]=h;for(p=97,h=10;h<36;++h)c[p++]=h;for(p=65,h=10;h<36;++h)c[p++]=h;function E(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function O(e,n){return(e=c[e.charCodeAt(n)])==null?-1:e}function w(e){var n=r();return n.fromInt(e),n}function it(e){var n,i=1;return(n=e>>>16)!=0&&(e=n,i+=16),(n=e>>8)!=0&&(e=n,i+=8),(n=e>>4)!=0&&(e=n,i+=4),(n=e>>2)!=0&&(e=n,i+=2),(n=e>>1)!=0&&(e=n,i+=1),i}function st(e){this.m=e}function T(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function H(e,n){return e&n}function tt(e,n){return e|n}function Q(e,n){return e^n}function ut(e,n){return e&~n}function dt(){}function Ct(e){return e}function Y(e){this.r2=r(),this.q3=r(),t.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}st.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},st.prototype.revert=function(e){return e},st.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},st.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i),this.reduce(i)},st.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},T.prototype.convert=function(e){var n=r();return e.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),e.s<0&&0<n.compareTo(t.ZERO)&&this.m.subTo(n,n),n},T.prototype.revert=function(e){var n=r();return e.copyTo(n),this.reduce(n),n},T.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var n=0;n<this.m.t;++n){var i=32767&e[n],f=i*this.mpl+((i*this.mph+(e[n]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[i=n+this.m.t]+=this.m.am(0,f,e,n,0,this.m.t);e[i]>=e.DV;)e[i]-=e.DV,e[++i]++}e.clamp(),e.drShiftTo(this.m.t,e),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},T.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i),this.reduce(i)},T.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},t.prototype.copyTo=function(e){for(var n=this.t-1;0<=n;--n)e[n]=this[n];e.t=this.t,e.s=this.s},t.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0<e?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},t.prototype.fromString=function(e,n){var i;if(n==16)i=4;else if(n==8)i=3;else if(n==256)i=8;else if(n==2)i=1;else if(n==32)i=5;else{if(n!=4)return void this.fromRadix(e,n);i=2}this.t=0,this.s=0;for(var f=e.length,A=!1,N=0;0<=--f;){var M=i==8?255&e[f]:O(e,f);M<0?e.charAt(f)=="-"&&(A=!0):(A=!1,N==0?this[this.t++]=M:N+i>this.DB?(this[this.t-1]|=(M&(1<<this.DB-N)-1)<<N,this[this.t++]=M>>this.DB-N):this[this.t-1]|=M<<N,(N+=i)>=this.DB&&(N-=this.DB))}i==8&&128&e[0]&&(this.s=-1,0<N&&(this[this.t-1]|=(1<<this.DB-N)-1<<N)),this.clamp(),A&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var e=this.s&this.DM;0<this.t&&this[this.t-1]==e;)--this.t},t.prototype.dlShiftTo=function(e,n){for(var i=this.t-1;0<=i;--i)n[i+e]=this[i];for(i=e-1;0<=i;--i)n[i]=0;n.t=this.t+e,n.s=this.s},t.prototype.drShiftTo=function(e,n){for(var i=e;i<this.t;++i)n[i-e]=this[i];n.t=Math.max(this.t-e,0),n.s=this.s},t.prototype.lShiftTo=function(e,n){for(var i=e%this.DB,f=this.DB-i,A=(1<<f)-1,N=Math.floor(e/this.DB),M=this.s<<i&this.DM,L=this.t-1;0<=L;--L)n[L+N+1]=this[L]>>f|M,M=(this[L]&A)<<i;for(L=N-1;0<=L;--L)n[L]=0;n[N]=M,n.t=this.t+N+1,n.s=this.s,n.clamp()},t.prototype.rShiftTo=function(e,n){n.s=this.s;var i=Math.floor(e/this.DB);if(i>=this.t)n.t=0;else{var f=e%this.DB,A=this.DB-f,N=(1<<f)-1;n[0]=this[i]>>f;for(var M=i+1;M<this.t;++M)n[M-i-1]|=(this[M]&N)<<A,n[M-i]=this[M]>>f;0<f&&(n[this.t-i-1]|=(this.s&N)<<A),n.t=this.t-i,n.clamp()}},t.prototype.subTo=function(e,n){for(var i=0,f=0,A=Math.min(e.t,this.t);i<A;)f+=this[i]-e[i],n[i++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f-=e.s;i<this.t;)f+=this[i],n[i++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;i<e.t;)f-=e[i],n[i++]=f&this.DM,f>>=this.DB;f-=e.s}n.s=f<0?-1:0,f<-1?n[i++]=this.DV+f:0<f&&(n[i++]=f),n.t=i,n.clamp()},t.prototype.multiplyTo=function(e,n){var i=this.abs(),f=e.abs(),A=i.t;for(n.t=A+f.t;0<=--A;)n[A]=0;for(A=0;A<f.t;++A)n[A+i.t]=i.am(0,f[A],n,A,0,i.t);n.s=0,n.clamp(),this.s!=e.s&&t.ZERO.subTo(n,n)},t.prototype.squareTo=function(e){for(var n=this.abs(),i=e.t=2*n.t;0<=--i;)e[i]=0;for(i=0;i<n.t-1;++i){var f=n.am(i,n[i],e,2*i,0,1);(e[i+n.t]+=n.am(i+1,2*n[i],e,2*i+1,f,n.t-i-1))>=n.DV&&(e[i+n.t]-=n.DV,e[i+n.t+1]=1)}0<e.t&&(e[e.t-1]+=n.am(i,n[i],e,2*i,0,1)),e.s=0,e.clamp()},t.prototype.divRemTo=function(e,n,i){var f=e.abs();if(!(f.t<=0)){if((Wt=this.abs()).t<f.t)return n!=null&&n.fromInt(0),void(i!=null&&this.copyTo(i));i==null&&(i=r());var A=r(),N=this.s,M=e.s;0<(e=this.DB-it(f[f.t-1]))?(f.lShiftTo(e,A),Wt.lShiftTo(e,i)):(f.copyTo(A),Wt.copyTo(i));var L=A.t,Ft=A[L-1];if(Ft!=0){var Wt=Ft*(1<<this.F1)+(1<L?A[L-2]>>this.F2:0),se=this.FV/Wt,fe=(1<<this.F1)/Wt,Ee=1<<this.F2,qt=i.t,ge=qt-L,Bt=n==null?r():n;for(A.dlShiftTo(ge,Bt),0<=i.compareTo(Bt)&&(i[i.t++]=1,i.subTo(Bt,i)),t.ONE.dlShiftTo(L,Bt),Bt.subTo(A,A);A.t<L;)A[A.t++]=0;for(;0<=--ge;){var We=i[--qt]==Ft?this.DM:Math.floor(i[qt]*se+(i[qt-1]+Ee)*fe);if((i[qt]+=A.am(0,We,i,ge,0,L))<We)for(A.dlShiftTo(ge,Bt),i.subTo(Bt,i);i[qt]<--We;)i.subTo(Bt,i)}n!=null&&(i.drShiftTo(L,n),N!=M&&t.ZERO.subTo(n,n)),i.t=L,i.clamp(),0<e&&i.rShiftTo(e,i),N<0&&t.ZERO.subTo(i,i)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var n=3&e;return 0<(n=(n=(n=(n=n*(2-(15&e)*n)&15)*(2-(255&e)*n)&255)*(2-((65535&e)*n&65535))&65535)*(2-e*n%this.DV)%this.DV)?this.DV-n:-n},t.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},t.prototype.exp=function(e,n){if(4294967295<e||e<1)return t.ONE;var i,f=r(),A=r(),N=n.convert(this),M=it(e)-1;for(N.copyTo(f);0<=--M;)n.sqrTo(f,A),0<(e&1<<M)?n.mulTo(A,N,f):(i=f,f=A,A=i);return n.revert(f)},t.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var n;if(e==16)n=4;else if(e==8)n=3;else if(e==2)n=1;else if(e==32)n=5;else{if(e!=4)return this.toRadix(e);n=2}var i,f=(1<<n)-1,A=!1,N="",M=this.t,L=this.DB-M*this.DB%n;if(0<M--)for(L<this.DB&&0<(i=this[M]>>L)&&(A=!0,N=E(i));0<=M;)L<n?(i=(this[M]&(1<<L)-1)<<n-L,i|=this[--M]>>(L+=this.DB-n)):(i=this[M]>>(L-=n)&f,L<=0&&(L+=this.DB,--M)),(A=0<i||A)&&(N+=E(i));return A?N:"0"},t.prototype.negate=function(){var e=r();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(e){var n=this.s-e.s;if(n!=0)return n;var i=this.t;if((n=i-e.t)!=0)return this.s<0?-n:n;for(;0<=--i;)if((n=this[i]-e[i])!=0)return n;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+it(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var n=r();return this.abs().divRemTo(e,null,n),this.s<0&&0<n.compareTo(t.ZERO)&&e.subTo(n,n),n},t.prototype.modPowInt=function(e,n){return n=new(e<256||n.isEven()?st:T)(n),this.exp(e,n)},t.ZERO=w(0),t.ONE=w(1),dt.prototype.convert=Ct,dt.prototype.revert=Ct,dt.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i)},dt.prototype.sqrTo=function(e,n){e.squareTo(n)},Y.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var n=r();return e.copyTo(n),this.reduce(n),n},Y.prototype.revert=function(e){return e},Y.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);0<=e.compareTo(this.m);)e.subTo(this.m,e)},Y.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i),this.reduce(i)},Y.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)};var X,k=[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],G=(1<<26)/k[k.length-1];function W(){var e;e=new Date().getTime(),_t[et++]^=255&e,_t[et++]^=e>>8&255,_t[et++]^=e>>16&255,_t[et++]^=e>>24&255,Ke<=et&&(et-=Ke)}if(t.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},t.prototype.toRadix=function(e){if(e==null&&(e=10),this.signum()==0||e<2||36<e)return"0";var n=this.chunkSize(e),i=Math.pow(e,n),f=w(i),A=r(),N=r(),M="";for(this.divRemTo(f,A,N);0<A.signum();)M=(i+N.intValue()).toString(e).substr(1)+M,A.divRemTo(f,A,N);return N.intValue().toString(e)+M},t.prototype.fromRadix=function(e,n){this.fromInt(0);for(var i=this.chunkSize(n=n==null?10:n),f=Math.pow(n,i),A=!1,N=0,M=0,L=0;L<e.length;++L){var Ft=O(e,L);Ft<0?e.charAt(L)=="-"&&this.signum()==0&&(A=!0):(M=n*M+Ft,++N>=i&&(this.dMultiply(f),this.dAddOffset(M,0),M=N=0))}0<N&&(this.dMultiply(Math.pow(n,N)),this.dAddOffset(M,0)),A&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,n,i){if(typeof n=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),tt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var f=new Array;i=7&e,f.length=1+(e>>3),n.nextBytes(f),0<i?f[0]&=(1<<i)-1:f[0]=0,this.fromString(f,256)}},t.prototype.bitwiseTo=function(e,n,i){for(var f,A=Math.min(e.t,this.t),N=0;N<A;++N)i[N]=n(this[N],e[N]);if(e.t<this.t){for(f=e.s&this.DM,N=A;N<this.t;++N)i[N]=n(this[N],f);i.t=this.t}else{for(f=this.s&this.DM,N=A;N<e.t;++N)i[N]=n(f,e[N]);i.t=e.t}i.s=n(this.s,e.s),i.clamp()},t.prototype.changeBit=function(e,n){return e=t.ONE.shiftLeft(e),this.bitwiseTo(e,n,e),e},t.prototype.addTo=function(e,n){for(var i=0,f=0,A=Math.min(e.t,this.t);i<A;)f+=this[i]+e[i],n[i++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f+=e.s;i<this.t;)f+=this[i],n[i++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;i<e.t;)f+=e[i],n[i++]=f&this.DM,f>>=this.DB;f+=e.s}n.s=f<0?-1:0,0<f?n[i++]=f:f<-1&&(n[i++]=this.DV+f),n.t=i,n.clamp()},t.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(e,n){if(e!=0){for(;this.t<=n;)this[this.t++]=0;for(this[n]+=e;this[n]>=this.DV;)this[n]-=this.DV,++n>=this.t&&(this[this.t++]=0),++this[n]}},t.prototype.multiplyLowerTo=function(e,n,i){var f,A=Math.min(this.t+e.t,n);for(i.s=0,i.t=A;0<A;)i[--A]=0;for(f=i.t-this.t;A<f;++A)i[A+this.t]=this.am(0,e[A],i,A,0,this.t);for(f=Math.min(e.t,n);A<f;++A)this.am(0,e[A],i,A,0,n-A);i.clamp()},t.prototype.multiplyUpperTo=function(e,n,i){var f=i.t=this.t+e.t- --n;for(i.s=0;0<=--f;)i[f]=0;for(f=Math.max(n-this.t,0);f<e.t;++f)i[this.t+f-n]=this.am(n-f,e[f],i,0,0,this.t+f-n);i.clamp(),i.drShiftTo(1,i)},t.prototype.modInt=function(e){if(e<=0)return 0;var n=this.DV%e,i=this.s<0?e-1:0;if(0<this.t)if(n==0)i=this[0]%e;else for(var f=this.t-1;0<=f;--f)i=(n*i+this[f])%e;return i},t.prototype.millerRabin=function(e){var n=this.subtract(t.ONE),i=n.getLowestSetBit();if(i<=0)return!1;var f=n.shiftRight(i);k.length<(e=e+1>>1)&&(e=k.length);for(var A=r(),N=0;N<e;++N){A.fromInt(k[Math.floor(Math.random()*k.length)]);var M=A.modPow(f,this);if(M.compareTo(t.ONE)!=0&&M.compareTo(n)!=0){for(var L=1;L++<i&&M.compareTo(n)!=0;)if((M=M.modPowInt(2,this)).compareTo(t.ONE)==0)return!1;if(M.compareTo(n)!=0)return!1}}return!0},t.prototype.clone=function(){var e=r();return this.copyTo(e),e},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 e=this.t,n=new Array;n[0]=this.s;var i,f=this.DB-e*this.DB%8,A=0;if(0<e--)for(f<this.DB&&(i=this[e]>>f)!=(this.s&this.DM)>>f&&(n[A++]=i|this.s<<this.DB-f);0<=e;)f<8?(i=(this[e]&(1<<f)-1)<<8-f,i|=this[--e]>>(f+=this.DB-8)):(i=this[e]>>(f-=8)&255,f<=0&&(f+=this.DB,--e)),128&i&&(i|=-256),A==0&&(128&this.s)!=(128&i)&&++A,(0<A||i!=this.s)&&(n[A++]=i);return n},t.prototype.equals=function(e){return this.compareTo(e)==0},t.prototype.min=function(e){return this.compareTo(e)<0?this:e},t.prototype.max=function(e){return 0<this.compareTo(e)?this:e},t.prototype.and=function(e){var n=r();return this.bitwiseTo(e,H,n),n},t.prototype.or=function(e){var n=r();return this.bitwiseTo(e,tt,n),n},t.prototype.xor=function(e){var n=r();return this.bitwiseTo(e,Q,n),n},t.prototype.andNot=function(e){var n=r();return this.bitwiseTo(e,ut,n),n},t.prototype.not=function(){for(var e=r(),n=0;n<this.t;++n)e[n]=this.DM&~this[n];return e.t=this.t,e.s=~this.s,e},t.prototype.shiftLeft=function(e){var n=r();return e<0?this.rShiftTo(-e,n):this.lShiftTo(e,n),n},t.prototype.shiftRight=function(e){var n=r();return e<0?this.lShiftTo(-e,n):this.rShiftTo(e,n),n},t.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+(function(n){if(n==0)return-1;var i=0;return!(65535&n)&&(n>>=16,i+=16),!(255&n)&&(n>>=8,i+=8),!(15&n)&&(n>>=4,i+=4),!(3&n)&&(n>>=2,i+=2),!(1&n)&&++i,i})(this[e]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var e=0,n=this.s&this.DM,i=0;i<this.t;++i)e+=(function(f){for(var A=0;f!=0;)f&=f-1,++A;return A})(this[i]^n);return e},t.prototype.testBit=function(e){var n=Math.floor(e/this.DB);return n>=this.t?this.s!=0:!!(this[n]&1<<e%this.DB)},t.prototype.setBit=function(e){return this.changeBit(e,tt)},t.prototype.clearBit=function(e){return this.changeBit(e,ut)},t.prototype.flipBit=function(e){return this.changeBit(e,Q)},t.prototype.add=function(e){var n=r();return this.addTo(e,n),n},t.prototype.subtract=function(e){var n=r();return this.subTo(e,n),n},t.prototype.multiply=function(e){var n=r();return this.multiplyTo(e,n),n},t.prototype.divide=function(e){var n=r();return this.divRemTo(e,n,null),n},t.prototype.remainder=function(e){var n=r();return this.divRemTo(e,null,n),n},t.prototype.divideAndRemainder=function(e){var n=r(),i=r();return this.divRemTo(e,n,i),new Array(n,i)},t.prototype.modPow=function(e,n){var i=e.bitLength(),f=w(1);if(i<=0)return f;var A=i<18?1:i<48?3:i<144?4:i<768?5:6,N=new(i<8?st:n.isEven()?Y:T)(n),M=new Array,L=3,Ft=A-1,Wt=(1<<A)-1;if(M[1]=N.convert(this),1<A){var se=r();for(N.sqrTo(M[1],se);L<=Wt;)M[L]=r(),N.mulTo(se,M[L-2],M[L]),L+=2}var fe,Ee,qt=e.t-1,ge=!0,Bt=r();for(i=it(e[qt])-1;0<=qt;){for(Ft<=i?fe=e[qt]>>i-Ft&Wt:(fe=(e[qt]&(1<<i+1)-1)<<Ft-i,0<qt&&(fe|=e[qt-1]>>this.DB+i-Ft)),L=A;!(1&fe);)fe>>=1,--L;if((i-=L)<0&&(i+=this.DB,--qt),ge)M[fe].copyTo(f),ge=!1;else{for(;1<L;)N.sqrTo(f,Bt),N.sqrTo(Bt,f),L-=2;0<L?N.sqrTo(f,Bt):(Ee=f,f=Bt,Bt=Ee),N.mulTo(Bt,M[fe],f)}for(;0<=qt&&!(e[qt]&1<<i);)N.sqrTo(f,Bt),Ee=f,f=Bt,Bt=Ee,--i<0&&(i=this.DB-1,--qt)}return N.revert(f)},t.prototype.modInverse=function(e){var n=e.isEven();if(this.isEven()&&n||e.signum()==0)return t.ZERO;for(var i=e.clone(),f=this.clone(),A=w(1),N=w(0),M=w(0),L=w(1);i.signum()!=0;){for(;i.isEven();)i.rShiftTo(1,i),n?(A.isEven()&&N.isEven()||(A.addTo(this,A),N.subTo(e,N)),A.rShiftTo(1,A)):N.isEven()||N.subTo(e,N),N.rShiftTo(1,N);for(;f.isEven();)f.rShiftTo(1,f),n?(M.isEven()&&L.isEven()||(M.addTo(this,M),L.subTo(e,L)),M.rShiftTo(1,M)):L.isEven()||L.subTo(e,L),L.rShiftTo(1,L);0<=i.compareTo(f)?(i.subTo(f,i),n&&A.subTo(M,A),N.subTo(L,N)):(f.subTo(i,f),n&&M.subTo(A,M),L.subTo(N,L))}return f.compareTo(t.ONE)!=0?t.ZERO:0<=L.compareTo(e)?L.subtract(e):L.signum()<0?(L.addTo(e,L),L.signum()<0?L.add(e):L):L},t.prototype.pow=function(e){return this.exp(e,new dt)},t.prototype.gcd=function(e){var n=this.s<0?this.negate():this.clone(),i=e.s<0?e.negate():e.clone();n.compareTo(i)<0&&(A=n,n=i,i=A);var f=n.getLowestSetBit(),A=i.getLowestSetBit();if(A<0)return n;for(0<(A=f<A?f:A)&&(n.rShiftTo(A,n),i.rShiftTo(A,i));0<n.signum();)0<(f=n.getLowestSetBit())&&n.rShiftTo(f,n),0<(f=i.getLowestSetBit())&&i.rShiftTo(f,i),0<=n.compareTo(i)?(n.subTo(i,n),n.rShiftTo(1,n)):(i.subTo(n,i),i.rShiftTo(1,i));return 0<A&&i.lShiftTo(A,i),i},t.prototype.isProbablePrime=function(e){var n,i=this.abs();if(i.t==1&&i[0]<=k[k.length-1]){for(n=0;n<k.length;++n)if(i[0]==k[n])return!0;return!1}if(i.isEven())return!1;for(n=1;n<k.length;){for(var f=k[n],A=n+1;A<k.length&&f<G;)f*=k[A++];for(f=i.modInt(f);n<A;)if(f%k[n++]==0)return!1}return i.millerRabin(e)},t.prototype.square=function(){var e=r();return this.squareTo(e),e},t.prototype.Barrett=Y,_t==null){var _t=new Array,et=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var St=new Uint8Array(32);for(window.crypto.getRandomValues(St),Yt=0;Yt<32;++Yt)_t[et++]=St[Yt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Nt=window.crypto.random(32),Yt=0;Yt<Nt.length;++Yt)_t[et++]=255&Nt.charCodeAt(Yt)}for(;et<Ke;)Yt=Math.floor(65536*Math.random()),_t[et++]=Yt>>>8,_t[et++]=255&Yt;et=0,W()}function Ge(){if(X==null){for(W(),(X=new Xe).init(_t),et=0;et<_t.length;++et)_t[et]=0;et=0}return X.next()}function Ar(){}function Xe(){this.i=0,this.j=0,this.S=new Array}Ar.prototype.nextBytes=function(e){for(var n=0;n<e.length;++n)e[n]=Ge()},Xe.prototype.init=function(e){for(var n,i,f=0;f<256;++f)this.S[f]=f;for(f=n=0;f<256;++f)n=n+this.S[f]+e[f%e.length]&255,i=this.S[f],this.S[f]=this.S[n],this.S[n]=i;this.i=0,this.j=0},Xe.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var Ke=256;Jt.exports={default:t,BigInteger:t,SecureRandom:Ar}}.call(b);var Pt=Gt.exports.BigInteger,wt=(function(){function t(){z(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return I(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,s=r.toString(16);return s.length%2==1&&(s="0"+s),r<128?s:(128+s.length/2).toString(16)+s}},{key:"getValue",value:function(){return""}}]),t})(),ie=(function(){Z(r,wt);var t=J(r);function r(s){var c;return z(this,r),(c=t.call(this)).t="02",s&&(c.v=(function(p){if((h=p.toString(16))[0]!=="-")h.length%2==1?h="0"+h:h.match(/^[0-7]/)||(h="00"+h);else{var h,E=(h=h.substr(1)).length;E%2==1?E+=1:h.match(/^[0-7]/)||(E+=2);for(var O="",w=0;w<E;w++)O+="f";h=(h=(O=new Pt(O,16)).xor(p).add(Pt.ONE)).toString(16).replace(/^-/,"")}return h})(s)),c}return I(r,[{key:"getValue",value:function(){return this.v}}]),r})(),ne=(function(){Z(r,wt);var t=J(r);function r(s){var c;return z(this,r),(c=t.call(this)).t="30",c.asn1Array=s,c}return I(r,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(s){return s.getEncodedHex()})).join(""),this.v}}]),r})();function jt(t,r){return+t[r+2]<8?1:128&+t.substr(r+2,2)}function ae(t,r){var s=jt(t,r);return(t=t.substr(r+2,2*s))?(+t[0]<8?new Pt(t,16):new Pt(t.substr(2),16)).intValue():-1}function oe(t,r){return r+2*(jt(t,r)+1)}var Lt=Gt.exports.BigInteger,kt=new Lt("3"),he=(function(){function t(r,s){z(this,t),this.x=s,this.q=r}return I(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})(),Qt=(function(){function t(r,s,c,p){z(this,t),this.curve=r,this.x=s,this.y=c,this.z=p==null?Lt.ONE:p,this.zinv=null}return I(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(Lt.ZERO)&&r.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Lt.ZERO))}},{key:"isInfinity",value:function(){return this.x===null&&this.y===null||this.z.equals(Lt.ZERO)&&!this.y.toBigInteger().equals(Lt.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 s=this.x.toBigInteger(),c=this.y.toBigInteger(),p=this.z,h=r.x.toBigInteger(),E=r.y.toBigInteger(),O=r.z,w=this.curve.q,it=s.multiply(O).mod(w);return r=h.multiply(p).mod(w),s=it.subtract(r),h=c.multiply(O).mod(w),c=E.multiply(p).mod(w),E=h.subtract(c),Lt.ZERO.equals(s)?Lt.ZERO.equals(E)?this.twice():this.curve.infinity:(c=it.add(r),r=p.multiply(O).mod(w),O=s.square().mod(w),p=s.multiply(O).mod(w),c=r.multiply(E.square()).subtract(c.multiply(O)).mod(w),s=s.multiply(c).mod(w),h=E.multiply(O.multiply(it).subtract(c)).subtract(h.multiply(p)).mod(w),w=p.multiply(r).mod(w),new t(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(h),w))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var r=this.x.toBigInteger(),s=this.y.toBigInteger(),c=this.z,p=this.curve.q,h=this.curve.a.toBigInteger(),E=r.square().multiply(kt).add(h.multiply(c.square())).mod(p),O=s.shiftLeft(1).multiply(c).mod(p),w=(h=(w=s.square().mod(p)).multiply(r).multiply(c).mod(p),s=O.square().mod(p),r=E.square().subtract(h.shiftLeft(3)).mod(p),c=O.multiply(r).mod(p),E.multiply(h.shiftLeft(2).subtract(r)).subtract(s.shiftLeft(1).multiply(w)).mod(p));return p=O.multiply(s).mod(p),new t(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(w),p)}},{key:"multiply",value:function(r){if(this.isInfinity())return this;if(!r.signum())return this.curve.infinity;for(var s=r.multiply(kt),c=this.negate(),p=this,h=s.bitLength()-2;0<h;h--){p=p.twice();var E=s.testBit(h);E!==r.testBit(h)&&(p=p.add(E?this:c))}return p}}]),t})(),Ot=(function(){function t(r,s,c){z(this,t),this.q=r,this.a=this.fromBigInteger(s),this.b=this.fromBigInteger(c),this.infinity=new Qt(this,null,null)}return I(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 he(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 s=(r.length-2)/2,c=r.substr(2,s);return s=r.substr(2+s,s),new Qt(this,this.fromBigInteger(new Lt(c,16)),this.fromBigInteger(new Lt(s,16)))}}}]),t})(),Ut={ECPointFp:Qt,ECCurveFp:Ot},te=Gt.exports.BigInteger,ce=(Ot=Gt.exports.SecureRandom,Ut.ECCurveFp),le=new Ot,ee=(Ut=y()).curve,d=Ut.G,l=Ut.n;function y(){var t=new te("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),r=new te("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),s=new te("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return s=(r=new ce(t,r,s)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:r,G:s,n:new te("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function F(t,r){return t.length>=r?t:new Array(r-t.length+1).join("0")+t}function D(t,r){for(var s=[],c=~~(r/8),p=r%8,h=0,E=t.length;h<E;h++)s[h]=(t[(h+c)%E]<<p&255)+(t[(h+c+1)%E]>>>8-p&255);return s}function U(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]^r[c]);return s}function nt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=t[c]&r[c]&255;return s}function vt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]|r[c]);return s}function yt(t,r){for(var s=[],c=0,p=t.length-1;0<=p;p--){var h=t[p]+r[p]+c;c=255<h?1:0,s[p]=255&h}return s}function Xt(t,r,s,c){return 0<=c&&c<=15?U(U(t,r),s):vt(nt(t,r),nt((function(p){for(var h=[],E=p.length-1;0<=E;E--)h[E]=255&~p[E];return h})(t),s))}function $t(t,r){for(var s=[],c=[],p=0;p<16;p++){var h=4*p;s.push(r.slice(h,4+h))}for(var E,O=16;O<68;O++)s.push(U(U((E=U(U(s[O-16],s[O-9]),D(s[O-3],15)),U(U(E,D(E,15)),D(E,23))),D(s[O-13],7)),s[O-6]));for(var w=0;w<64;w++)c.push(U(s[w],s[w+4]));for(var it,st,T,H=[121,204,69,25],tt=[122,135,157,138],Q=t.slice(0,4),ut=t.slice(4,8),dt=t.slice(8,12),Ct=t.slice(12,16),Y=t.slice(16,20),X=t.slice(20,24),k=t.slice(24,28),G=t.slice(28,32),W=0;W<64;W++){var _t=0<=W&&W<=15?H:tt,et=U(St=D(yt(yt(D(Q,12),Y),D(_t,W)),7),D(Q,12)),St=(et=yt(yt(yt((it=Q,st=ut,T=dt,0<=(_t=W)&&_t<=15?U(U(it,st),T):vt(vt(nt(it,st),nt(it,T)),nt(st,T))),Ct),et),c[W]),yt(yt(yt(Xt(Y,X,k,W),G),St),s[W]));Ct=dt,dt=D(ut,9),ut=Q,Q=et,G=k,k=D(X,19),X=Y,Y=U(U(St,D(St,9)),D(St,17))}return U([].concat(Q,ut,dt,Ct,Y,X,k,G),t)}Ot={getGlobalCurve:function(){return ee},generateEcparam:y,generateKeyPairHex:function(t,r,s){return{privateKey:s=F((r=(t?new te(t,r,s):new te(l.bitLength(),le)).mod(l.subtract(te.ONE)).add(te.ONE)).toString(16),64),publicKey:"04"+F((r=d.multiply(r)).getX().toBigInteger().toString(16),64)+F(r.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(t){for(var r=(t=unescape(encodeURIComponent(t))).length,s=[],c=0;c<r;c++)s[c>>>2]|=(255&t.charCodeAt(c))<<24-c%4*8;for(var p=[],h=0;h<r;h++){var E=s[h>>>2]>>>24-h%4*8&255;p.push((E>>>4).toString(16)),p.push((15&E).toString(16))}return p.join("")},leftPad:F,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=[],s=0,c=0;c<2*t.length;c+=2)r[c>>>3]|=parseInt(t[s],10)<<24-c%8*4,s++;try{for(var p=[],h=0;h<t.length;h++){var E=r[h>>>2]>>>24-h%4*8&255;p.push(String.fromCharCode(E))}return decodeURIComponent(escape(p.join("")))}catch(O){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){for(var r=[],s=(t=(s=t.length)%2!=0?F(t,s+1):t).length,c=0;c<s;c+=2)r.push(parseInt(t.substr(c,2),16));return r},verifyPublicKey:function(t){var r=ee.decodePointHex(t);return!!r&&(t=r.getX(),r.getY().square().equals(t.multiply(t.square()).add(t.multiply(ee.a)).add(ee.b)))}},Ut=function(t){for(var r=448<=(r=(O=8*t.length)%512)?512-r%448-1:448-r-1,s=new Array((r-7)/8),c=0,p=s.length;c<p;c++)s[c]=0;for(var h,E=[],O=O.toString(2),w=7;0<=w;w--)8<O.length?(h=O.length-8,E[w]=parseInt(O.substr(h),2),O=O.substr(0,h)):0<O.length?(E[w]=parseInt(O,2),O=""):E[w]=0;for(var it=[].concat(t,[128],s,E),st=it.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],H=0;H<st;H++){var tt=64*H;T=$t(T,it.slice(tt,64+tt))}return T};var Et=Gt.exports.BigInteger,Zr=function(t,r){return t=new ie(t),r=new ie(r),new ne([t,r]).getEncodedHex()},tn=function(t){var r=oe(t,0),s=oe(t,r),c=ae(t,r);return r=t.substr(s,2*c),s=oe(t,c=s+r.length),c=ae(t,c),t=t.substr(s,2*c),{r:new Pt(r,16),s:new Pt(t,16)}},ft=Ot,Ae=Ut,De=(Ot=ft.generateEcparam()).G,yr=Ot.curve,Ie=Ot.n;function gr(t,r,s){var c=2<arguments.length&&s!==void 0?s:"1234567812345678",p=(c=ft.utf8ToHex(c),ft.leftPad(De.curve.a.toBigInteger().toRadix(16),64)),h=ft.leftPad(De.curve.b.toBigInteger().toRadix(16),64),E=ft.leftPad(De.getX().toBigInteger().toRadix(16),64),O=ft.leftPad(De.getY().toBigInteger().toRadix(16),64);return s=(r=128<r.length?r.substr(2,128):r).substr(0,64),r=r.substr(64,64),r=ft.hexToArray(c+p+h+E+O+s+r),c=4*c.length,r.unshift(255&c),r.unshift(c>>8&255),r=Ae(r),ft.arrayToHex(Ae(r.concat(ft.hexToArray(t))))}function mr(){var t=ft.generateKeyPairHex(),r=yr.decodePointHex(t.publicKey);return t.k=new Et(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}Ot={generateKeyPairHex:ft.generateKeyPairHex,doEncrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;t=typeof t=="string"?ft.hexToArray(ft.utf8ToHex(t)):Array.prototype.slice.call(t),r=ft.getGlobalCurve().decodePointHex(r);var c=ft.generateKeyPairHex(),p=new Et(c.privateKey,16),h=c.publicKey;128<h.length&&(h=h.substr(h.length-128)),c=r.multiply(p),p=ft.hexToArray(ft.leftPad(c.getX().toBigInteger().toRadix(16),64)),r=ft.hexToArray(ft.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=ft.arrayToHex(Ae([].concat(p,t,r)));var E,O=1,w=0,it=[],st=[].concat(p,r);(E=function(){it=Ae([].concat(Tt(st),[O>>24&255,O>>16&255,O>>8&255,255&O])),O++,w=0})();for(var T=0,H=t.length;T<H;T++)w===it.length&&E(),t[T]^=255&it[w++];return r=ft.arrayToHex(t),s===0?h+r+c:h+c+r},doDecrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(h=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":h;r=new Et(r,16);var p=t.substr(128,64),h=t.substr(192);s===0&&(p=t.substr(t.length-64),h=t.substr(128,t.length-128-64));var E,O=ft.hexToArray(h),w=(t=ft.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),r=ft.hexToArray(ft.leftPad(t.getX().toBigInteger().toRadix(16),64)),t=ft.hexToArray(ft.leftPad(t.getY().toBigInteger().toRadix(16),64)),1),it=0,st=[],T=[].concat(r,t);(E=function(){st=Ae([].concat(Tt(T),[w>>24&255,w>>16&255,w>>8&255,255&w])),w++,it=0})();for(var H=0,tt=O.length;H<tt;H++)it===st.length&&E(),O[H]^=255&st[it++];return ft.arrayToHex(Ae([].concat(r,O,t)))===p?c==="array"?O:ft.arrayToUtf8(O):c==="array"?[]:""},doSignature:function(t,r){var s=(O=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=O.der,p=O.hash,h=O.publicKey,E=O.userId,O=typeof t=="string"?ft.utf8ToHex(t):ft.arrayToHex(t);p&&(O=gr(O,h||(t=r,p=De.multiply(new Et(t,16)),"04"+(t=ft.leftPad(p.getX().toBigInteger().toString(16),64))+(p=ft.leftPad(p.getY().toBigInteger().toString(16),64))),E));var w=new Et(r,16),it=new Et(O,16),st=null,T=null,H=null;do do{var tt;st=(tt=s&&s.length?s.pop():mr()).k,T=it.add(tt.x1).mod(Ie)}while(T.equals(Et.ZERO)||T.add(st).equals(Ie));while((H=w.add(Et.ONE).modInverse(Ie).multiply(st.subtract(T.multiply(w))).mod(Ie)).equals(Et.ZERO));return c?Zr(T,H):ft.leftPad(T.toString(16),64)+ft.leftPad(H.toString(16),64)},doVerifySignature:function(t,r,s){var c,p,h=(O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,E=O.hash,O=O.userId;return t=typeof t=="string"?ft.utf8ToHex(t):ft.arrayToHex(t),E&&(t=gr(t,s,O)),p=h?(c=(p=tn(r)).r,p.s):(c=new Et(r.substring(0,64),16),new Et(r.substring(64),16)),r=yr.decodePointHex(s),s=new Et(t,16),!(t=c.add(p).mod(Ie)).equals(Et.ZERO)&&(r=De.multiply(p).add(r.multiply(t)),s=s.add(r.getX().toBigInteger()).mod(Ie),c.equals(s))},getPoint:mr,verifyPublicKey:ft.verifyPublicKey};var en=Ut,Ne=[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],Fe=[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 He(t){for(var r=[],s=0,c=t.length;s<c;s+=2)r.push(parseInt(t.substr(s,2),16));return r}function Re(t,r){return t<<r|t>>>32-r}function de(t){return(255&Ne[t>>>24&255])<<24|(255&Ne[t>>>16&255])<<16|(255&Ne[t>>>8&255])<<8|255&Ne[255&t]}function xe(t){return t^Re(t,2)^Re(t,10)^Re(t,18)^Re(t,24)}function Le(t){return t^Re(t,13)^Re(t,23)}function _r(t,r,s,c){c=(h=(E=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":h;var p=E.mode,h=(h=E.iv)===void 0?[]:h,E=(E=E.output)===void 0?"string":E;if(p==="cbc"&&(h=typeof h=="string"?He(h):h).length!==16)throw new Error("iv is invalid");if((r=typeof r=="string"?He(r):r).length!==16)throw new Error("key is invalid");if(t=(typeof t=="string"?s!==0?function(Y){for(var X=[],k=0,G=Y.length;k<G;k++){var W=Y.codePointAt(k);if(W<=127)X.push(W);else if(W<=2047)X.push(192|W>>>6),X.push(128|63&W);else if(W<=55295||57344<=W&&W<=65535)X.push(224|W>>>12),X.push(128|W>>>6&63),X.push(128|63&W);else{if(!(65536<=W&&W<=1114111))throw X.push(W),new Error("input is not supported");k++,X.push(240|W>>>18&28),X.push(128|W>>>12&63),X.push(128|W>>>6&63),X.push(128|63&W)}}return X}:He:Tt)(t),c==="pkcs#5"&&s!==0)for(var O=16-t.length%16,w=0;w<O;w++)t.push(O);var it=new Array(32);(function(Y,X,k){for(var G=new Array(4),W=new Array(4),_t=0;_t<4;_t++)W[0]=255&Y[0+4*_t],W[1]=255&Y[1+4*_t],W[2]=255&Y[2+4*_t],W[3]=255&Y[3+4*_t],G[_t]=W[0]<<24|W[1]<<16|W[2]<<8|W[3];G[0]^=2746333894,G[1]^=1453994832,G[2]^=1736282519,G[3]^=2993693404;for(var et,St=0;St<32;St+=4)et=G[1]^G[2]^G[3]^Fe[St+0],X[St+0]=G[0]^=Le(de(et)),et=G[2]^G[3]^G[0]^Fe[St+1],X[St+1]=G[1]^=Le(de(et)),et=G[3]^G[0]^G[1]^Fe[St+2],X[St+2]=G[2]^=Le(de(et)),et=G[0]^G[1]^G[2]^Fe[St+3],X[St+3]=G[3]^=Le(de(et));if(k===0)for(var Nt,Yt=0;Yt<16;Yt++)Nt=X[Yt],X[Yt]=X[31-Yt],X[31-Yt]=Nt})(r,it,s);for(var st=[],T=h,H=t.length,tt=0;16<=H;){var Q=t.slice(tt,tt+16),ut=new Array(16);if(p==="cbc")for(var dt=0;dt<16;dt++)s!==0&&(Q[dt]^=T[dt]);(function(Y,X,k){for(var G=new Array(4),W=new Array(4),_t=0;_t<4;_t++)W[0]=255&Y[4*_t],W[1]=255&Y[4*_t+1],W[2]=255&Y[4*_t+2],W[3]=255&Y[4*_t+3],G[_t]=W[0]<<24|W[1]<<16|W[2]<<8|W[3];for(var et,St=0;St<32;St+=4)et=G[1]^G[2]^G[3]^k[St+0],G[0]^=xe(de(et)),et=G[2]^G[3]^G[0]^k[St+1],G[1]^=xe(de(et)),et=G[3]^G[0]^G[1]^k[St+2],G[2]^=xe(de(et)),et=G[0]^G[1]^G[2]^k[St+3],G[3]^=xe(de(et));for(var Nt=0;Nt<16;Nt+=4)X[Nt]=G[3-Nt/4]>>>24&255,X[Nt+1]=G[3-Nt/4]>>>16&255,X[Nt+2]=G[3-Nt/4]>>>8&255,X[Nt+3]=255&G[3-Nt/4]})(Q,ut,it);for(var Ct=0;Ct<16;Ct++)p==="cbc"&&s===0&&(ut[Ct]^=T[Ct]),st[tt+Ct]=ut[Ct];p==="cbc"&&(T=s!==0?ut:Q),H-=16,tt+=16}return c==="pkcs#5"&&s===0&&(c=st[st.length-1],st.splice(st.length-c,c)),E!=="array"?s!==0?st.map((function(Y){return(Y=Y.toString(16)).length===1?"0"+Y:Y})).join(""):(function(Y){for(var X=[],k=0,G=Y.length;k<G;k++)240<=Y[k]&&Y[k]<=247?(X.push(String.fromCodePoint(((7&Y[k])<<18)+((63&Y[k+1])<<12)+((63&Y[k+2])<<6)+(63&Y[k+3]))),k+=3):224<=Y[k]&&Y[k]<=239?(X.push(String.fromCodePoint(((15&Y[k])<<12)+((63&Y[k+1])<<6)+(63&Y[k+2]))),k+=2):192<=Y[k]&&Y[k]<=223?(X.push(String.fromCodePoint(((31&Y[k])<<6)+(63&Y[k+1]))),k++):X.push(String.fromCodePoint(Y[k]));return X.join("")})(st):st}var rn=[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],ye=[],nn=function(t,r,s){for(var c=t[0],p=t[1],h=t[2],E=t[3],O=t[4],w=t[5],it=t[6],st=t[7],T=0;T<64;T++){T<16?ye[T]=0|r[s+T]:(H=ye[T-15],tt=ye[T-2],ye[T]=((H<<25|H>>>7)^(H<<14|H>>>18)^H>>>3)+ye[T-7]+((tt<<15|tt>>>17)^(tt<<13|tt>>>19)^tt>>>10)+ye[T-16]);var H=c&p^c&h^p&h,tt=st+((O<<26|O>>>6)^(O<<21|O>>>11)^(O<<7|O>>>25))+(O&w^~O&it)+rn[T]+ye[T];st=it,it=w,w=O,O=E+tt|0,E=h,h=p,p=c,c=tt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+H)|0}t[0]=t[0]+c|0,t[1]=t[1]+p|0,t[2]=t[2]+h|0,t[3]=t[3]+E|0,t[4]=t[4]+O|0,t[5]=t[5]+w|0,t[6]=t[6]+it|0,t[7]=t[7]+st|0},vr=(Ot={c2:Ot,c3:function(t){return t=typeof t=="string"?(function(r){for(var s=[],c=0,p=r.length;c<p;c++){var h=r.codePointAt(c);if(h<=127)s.push(h);else if(h<=2047)s.push(192|h>>>6),s.push(128|63&h);else if(h<=55295||57344<=h&&h<=65535)s.push(224|h>>>12),s.push(128|h>>>6&63),s.push(128|63&h);else{if(!(65536<=h&&h<=1114111))throw s.push(h),new Error("input is not supported");c++,s.push(240|h>>>18&28),s.push(128|h>>>12&63),s.push(128|h>>>6&63),s.push(128|63&h)}}return s})(t):Array.prototype.slice.call(t),en(t).map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},c4:{encrypt:function(t,r,s){return _r(t,r,1,s)},decrypt:function(t,r,s){return _r(t,r,0,s)}},s2:function(t){var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],s=(function(p){for(var h=[],E=0;E<Math.ceil(p.length/4);E++)h[E]=p[4*E]<<24|(255&p[4*E+1])<<16|(255&p[4*E+2])<<8|255&p[4*E+3];return h})(t);s[(t=8*t.length)>>5]|=128<<24-t%32,s[15+(64+t>>9<<4)]=t;for(var c=0;c<s.length;c+=16)nn(r,s,c);return(function(p){for(var h=[],E=0;E<p.length;E++)h[4*E]=p[E]>>24&255,h[4*E+1]=p[E]>>16&255,h[4*E+2]=p[E]>>8&255,h[4*E+3]=255&p[E];return h})(r).map((function(p){return(p=p.toString(16)).length===1?"0"+p:p})).join("")}},Dt),on=mt,an=Rt,sn=Vt,un=zt,cn=Ot.c2,ln=Ot.c3,fn=Ot.c4,dn=Ot.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 s="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,p=!1,h=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,E=h!==void 0&&!!h.request&&!!h.login,O=function(T,H){return typeof T=="string"&&typeof H=="string"&&T!=null&&H!=null&&T.substring(0,H.length)===H},w={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},it=function(T){for(var H in w)if(w[H]===T)return H},st=function(T,H,tt){var Q=Date.now(),ut=new t;try{if(!T||T.length<=75)return console.error("error format 1:",T),w.ERROR_DATA_FORMAT;if(!O(T,"eyJ"))return console.error("error format 2:",T),w.ERROR_DATA_FORMAT;T=T.substring(3,T.length);var dt=on.my_b4_decode(T);if(!dt)return console.error("error format 3:",T),w.ERROR_DATA_FORMAT;var Ct,Y=ut.cc.u8.byteToInt(dt.slice(0,4),0),X=dt.slice(4,4+Y),k=ut.cc.u8.byteToInt(dt.slice(4+Y,4+Y+4),0),G=dt.slice(4+Y+4,4+Y+4+k),W=ut.cc.u8.byteToInt(dt.slice(4+Y+4+k,4+Y+4+k+4),0),_t=dt.slice(4+Y+4+k+4,4+Y+4+k+4+W),et=ut.cc.u8.bytesToUtf8Str(X);if(ut.cc.h6.encode(G,0,k),H||(tt!==void 0&&tt==="sm2"?(Ct=ut.cc.h6.encode(G,0,k),ut.co.c2.doVerifySignature(et,Ct,s,{der:!0,hash:!0})):ut.co.c3(et+"8890012345678890").toLowerCase()===ut.cc.h6.encode(_t,0,W).toLowerCase())){if(et.length%2==0){t.prototype.__v=function(){return et.slice(0,2)};for(var St=[],Nt=2;Nt<66;Nt+=2)St.push(parseInt("0x"+et.slice(Nt,Nt+2)));t.prototype.__i=function(){return St};var Yt=parseInt("0x"+et.slice(66,82))-Q;t.prototype.__o=function(){return Yt}}return E||b.AAR2||(b.AAR2=t),w.SUCCESS}}catch(Ge){return console.error(Ge),w.ERROR_UNKNOWN_ERROR}return w.ERROR_SIGN_CHECK};return t.init=function(T,H){var tt,Q={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof T=="string"?(O(T,"https")||O(T,"https")?Q.url=T:O(T,"eyJ")&&(Q.code=T),typeof H=="string"&&(Q.publicKey=H)):$(T)==="object"&&(T.debug&&(Q.debug=T.debug),T.url&&(Q.url=T.url),T.code&&(Q.code=T.code),T.publicKey&&(Q.publicKey=T.publicKey),T.skipVerify&&(Q.skipVerify=T.skipVerify),T.alg&&(Q.alg=T.alg),T.callback&&typeof T.callback=="function"&&(Q.callback=T.callback)),p?Q.callback&&Q.callback(!0,{errorNo:tt=w.ALREADY_SUCCESS,errorMsg:it(tt)}):c?setTimeout((function(){t.init(T,H)}),50):(c=!0,Q.debug&&vr.start(Q.debug),Q.publicKey&&(s=Q.publicKey),Q.code?(tt=st(Q.code,Q.skipVerify))===w.SUCCESS?(c=!(p=!0),Q.callback(!0,{errorNo:tt,errorMsg:it(tt)})):Q.callback(!1,{errorNo:tt,errorMsg:it(tt)}):Q.url&&(function(ut,dt,Ct){try{if(ut=ut+"?version="+t.VERSION+(E?"&name=wechat":"&name=browser")+"&t="+Date.now(),E)h.request({url:ut,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function(X){X.statusCode===200?dt(X.data):Ct(w.ERROR_XXX_REQUEST_FAIL)},fail:function(X){X&&X.errMsg&&X.errMsg.indexOf("timeout")!==-1?Ct(w.ERROR_XXX_REQUEST_TIMEOUT):Ct(w.ERROR_XXX_REQUEST_FAIL)}});else{var Y;if(window.XMLHttpRequest)Y=new XMLHttpRequest;else if(window.ActiveXObject)try{Y=new ActiveXObject("Msxml2.XMLHTTP")}catch(X){try{Y=new ActiveXObject("Microsoft.XMLHTTP")}catch(k){}}Y&&(Y.onload=function(){Y.readyState===4&&(Y.status===200?dt(Y.responseText):Ct(w.ERROR_XHR_ERROR))},Y.ontimeout=function(){Ct(w.ERROR_XHR_TIMEOUT)},Y.onerror=function(){Ct(w.ERROR_XHR_ERROR)},Y.open("POST",ut,!0),Y.timeout=5e3,Y.send(null))}}catch(X){console.error(X),Ct(w.ERROR_UNKNOWN_ERROR)}})(Q.url,(function(ut){(ut=st(ut,Q.skipVerify,Q.alg))===w.SUCCESS?(c=!(p=!0),Q.callback(!0,{errorNo:ut,errorMsg:it(ut)})):(c=!1,Q.callback(!1,{errorNo:ut,errorMsg:it(ut)}))}),(function(ut){c=!1,Q.callback(!1,{errorNo:ut,errorMsg:it(ut)})})))},t.prototype={cc:{b4:an,h6:sn,u8:un},co:{c2:cn,c3:ln,c4:fn,s2:dn},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,H){return this.__s(T,H)},__s:function(T,H){var tt=this.cc.u8.utf8StrToBytes(T),Q=this.__i();return T=this.cc.u8.utf8StrToBytes(H),H=this.cc.u8.utf8StrToBytes(this.__c()),T=[].concat(tt,Q,T,H),H=parseInt("0x"+this.__v()),this.__f(H)(T)+this.__v()},__f:function(T){var H=this.co.s2,tt=this.co.c3,Q=this.cc.h6.decode,ut=[function(dt){return H(dt)},function(dt){return tt(dt)},function(dt){return tt(Q(H(dt)))},function(dt){return H(Q(tt(dt)))},function(dt){return tt(Q(tt(dt)))},function(dt){return H(Q(H(dt)))}];return ut[(128<T?T-128:T)%ut.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(h!==void 0&&h.env&&h.request&&h.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 vr.isDebug()},version:function(){return t.VERSION}},t})()},at(R)=="object"?g.exports=rt():(q=typeof(B=rt)=="function"?B.call(R,P,R,g):B)===void 0||(g.exports=q)}},a={};function u(g){var R=a[g];if(R!==void 0)return R.exports;var P=a[g]={id:g,loaded:!1,exports:{}};return o[g].call(P.exports,P,P.exports,u),P.loaded=!0,P.exports}u.n=g=>{var R=g&&g.__esModule?()=>g.default:()=>g;return u.d(R,{a:R}),R},u.d=(g,R)=>{for(var P in R)u.o(R,P)&&!u.o(g,P)&&Object.defineProperty(g,P,{enumerable:!0,get:R[P]})},u.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(g){if(typeof window=="object")return window}})(),u.hmd=g=>((g=Object.create(g)).children||(g.children=[]),Object.defineProperty(g,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+g.id)}}),g),u.o=(g,R)=>Object.prototype.hasOwnProperty.call(g,R),u.r=g=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})};var v=u(737);Yr.exports.LyyGetCommandSDK=v})()});var ro={};Ye(ro,{DyErrorCode:()=>_e,DyErrorMessage:()=>Mt,ENV_TYPE:()=>Kt,EXTERNAL_ENV_TYPE:()=>ue,JdErrorCode:()=>Je,JdErrorMessage:()=>bt,createServices:()=>$r,getDisplayAdConfig:()=>pr,getDyPayRtaData:()=>cr,handleDyPayFlow:()=>ur,handleJdInsurance:()=>ir,handleJdInsuranceExt:()=>ar,handleJdjrCashLoanExt:()=>or,handleJdjrCashLoanFlow:()=>nr,normalizeDisplayAdData:()=>Ve});module.exports=An(ro);var Kt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},ue={SIT:"sit",RELEASE:"release",PROD:"prod"},je={[Kt.DEV]:"https://dm.leyaoyao.com",[Kt.SIT]:"https://sm.leyaoyao.com",[Kt.UAT]:"https://um.leyaoyao.com",[Kt.PROD]:"https://m.leyaoyao.com"},Rr={[Kt.DEV]:"https://dad2.leyaoyao.com",[Kt.SIT]:"https://sad2.leyaoyao.com",[Kt.UAT]:"https://uad2.leyaoyao.com",[Kt.PROD]:"https://nad.ehuoke.com"},Pe={[ue.SIT]:"https://sopenapi.leyaoyao.com",[ue.RELEASE]:"https://uopen-api.leyaoyao.com",[ue.PROD]:"https://api-gateway.leyaoyao.com"};function Be(o,a){return`${je[o]||je[Kt.PROD]}${a}`}function Er(o){return Rr[o]||Rr[Kt.PROD]}var Se={debug:!1,env:Kt.PROD,externalEnv:ue.PROD,apiDomain:""},Sr=gt({},Se);function Tr(o){Sr=gt(gt({},Se),o)}function pe(){return Sr}var Dn=Object.defineProperty,In=(o,a,u)=>a in o?Dn(o,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):o[a]=u,Rn=(o,a,u)=>In(o,typeof a!="symbol"?a+"":a,u);function re(){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 En=class{constructor(o=!1){Rn(this,"enable"),this.enable=o}setEnable(o){this.enable=o}info(...o){this.enable&&console.info("[BI Info]",...o)}warn(...o){this.enable&&console.warn("[BI Warn]",...o)}error(...o){this.enable&&console.error("[BI Error]",...o)}debug(...o){this.enable&&console.log("[BI Debug]",...o)}},x=new En;function Qe(o){let a=re();return a==="taro"?Taro.setClipboardData({data:o}).then(()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):a==="uni"?new Promise((u,v)=>{uni.setClipboardData({data:o,success:()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{x.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),v(g)}})}):a==="wechat"?new Promise((u,v)=>{wx.setClipboardData({data:o,success:()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{x.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),v(g)}})}):a==="alipay"?new Promise((u,v)=>{my.setClipboardData({text:o,success:()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{x.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),v(g)}})}):navigator.clipboard.writeText(o).then(()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function $e(o,a=2e3){let u=re();if(u==="taro"){Taro.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="uni"){uni.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="wechat"){wx.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="alipay"){my.showToast({content:o,duration:a});return}typeof console!="undefined"&&console.log(`[Toast] ${o}`)}async function me(){var o,a,u,v,g;let R=re();try{if(R==="taro")return((o=(await Taro.getSystemInfo()).platform)==null?void 0:o.toLowerCase())==="ios"?"ios":"android";if(R==="uni")return((a=uni.getSystemInfoSync().platform)==null?void 0:a.toLowerCase())==="ios"?"ios":"android";if(R==="wechat")return wx.getDeviceInfo?((u=(await wx.getDeviceInfo()).platform)==null?void 0:u.toLowerCase())==="ios"?"ios":"android":((v=wx.getSystemInfoSync().platform)==null?void 0:v.toLowerCase())==="ios"?"ios":"android";if(R==="alipay")return((g=my.getSystemInfoSync().platform)==null?void 0:g.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let P=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(P))return"ios";if(/android/.test(P))return"android"}return"unknown"}catch(P){return x.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",P),"unknown"}}var xt={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function K(o,a,u=null){return{code:o,message:a,data:u}}function qe(o,a){return o==null?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof o=="string"&&o.trim().length===0?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function we(o,a){for(let u of a){let v=qe(o[u],u);if(!v.valid)return v}return{valid:!0}}var sr={};Ye(sr,{handleJdInsurance:()=>ir,handleJdInsuranceExt:()=>ar,handleJdjrCashLoanExt:()=>or,handleJdjrCashLoanFlow:()=>nr});var Je=(J=>(J[J.JD_CASH_LOAN__MISSING_PHONE=2001]="JD_CASH_LOAN__MISSING_PHONE",J[J.JD_CASH_LOAN__MISSING_DEVICE_ID=2002]="JD_CASH_LOAN__MISSING_DEVICE_ID",J[J.JD_CASH_LOAN__RTA_FAILED=2003]="JD_CASH_LOAN__RTA_FAILED",J[J.JD_CASH_LOAN__GET_CONFIG_FAILED=2004]="JD_CASH_LOAN__GET_CONFIG_FAILED",J[J.JD_CASH_LOAN__INVALID_CONFIG=2005]="JD_CASH_LOAN__INVALID_CONFIG",J[J.JD_CASH_LOAN__EXT_NOT_ELIGIBLE=2006]="JD_CASH_LOAN__EXT_NOT_ELIGIBLE",J[J.JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS=2007]="JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS",J[J.JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM=2008]="JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM",J[J.JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID=2009]="JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID",J[J.JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE=2010]="JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE",J[J.JD_INSURANCE__USER_NOT_ELIGIBLE=2101]="JD_INSURANCE__USER_NOT_ELIGIBLE",J[J.JD_INSURANCE__H5_NOT_SUPPORTED=2102]="JD_INSURANCE__H5_NOT_SUPPORTED",J[J.JD_INSURANCE__INVALID_JUMP_PARAMS=2103]="JD_INSURANCE__INVALID_JUMP_PARAMS",J[J.JD_INSURANCE__GET_CONFIG_FAILED=2104]="JD_INSURANCE__GET_CONFIG_FAILED",J[J.JD_INSURANCE__COPY_FAILED=2105]="JD_INSURANCE__COPY_FAILED",J[J.JD_INSURANCE__TASK_COMPLETED=2106]="JD_INSURANCE__TASK_COMPLETED",J[J.JD_INSURANCE__UNKNOWN_JUMP_MODE=2107]="JD_INSURANCE__UNKNOWN_JUMP_MODE",J[J.JD_INSURANCE__RTA_FAILED=2108]="JD_INSURANCE__RTA_FAILED",J))(Je||{}),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=(m=>(m[m.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",m[m.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",m[m.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",m[m.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",m[m.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",m[m.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",m[m.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",m[m.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",m[m.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",m[m.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",m[m.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",m[m.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",m[m.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",m[m.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",m[m.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",m[m.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",m[m.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",m[m.DY_PAY__INVALID_RETURN_TYPE=3018]="DY_PAY__INVALID_RETURN_TYPE",m[m.DY_PAY__JSAPI_INFO_FAILED=3019]="DY_PAY__JSAPI_INFO_FAILED",m[m.DY_PAY__REQUEST_JSAPI_INFO_FAILED=3020]="DY_PAY__REQUEST_JSAPI_INFO_FAILED",m[m.DY_PAY__MISSING_JSAPI_PAY_INFO=3021]="DY_PAY__MISSING_JSAPI_PAY_INFO",m[m.DY_PAY__INVALID_JSAPI_PAY_INFO=3022]="DY_PAY__INVALID_JSAPI_PAY_INFO",m))(_e||{}),Mt={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"};var Sn=(o,a,u,v)=>{let g=re();if(g==="taro")return Taro.request({url:o,method:a,data:u,header:v}).then(B=>B);if(g==="uni")return new Promise((B,q)=>{uni.request({url:o,method:a,data:u,header:v,success:rt=>B(rt),fail:rt=>q(rt)})});if(g==="wechat")return new Promise((B,q)=>{wx.request({url:o,method:a,data:u,header:v,success:rt=>B(rt),fail:rt=>q(rt)})});if(g==="alipay")return new Promise((B,q)=>{my.request({url:o,method:a,data:u,headers:v,success:rt=>B(rt),fail:rt=>q(rt)})});let R=a.toUpperCase()==="GET",P=R&&u&&Object.keys(u).length?`${o}?${new URLSearchParams(u).toString()}`:o;return fetch(P,{method:a,headers:v,body:R?void 0:JSON.stringify(u)}).then(async B=>({statusCode:B.status,data:await B.json()}))},Ze=class{constructor(a=null){Me(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||pe()||Se}async getAuthToken(){let a=this.getCurrentConfig();if(a.getAuthToken&&typeof a.getAuthToken=="function")try{let u=await a.getAuthToken();return u?(x.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),u):(x.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(u){return x.error("\u83B7\u53D6Token\u5931\u8D25",u),null}return null}async buildHeader(a={},u=!0){let v=gt({"content-type":"application/json"},a);if(!u)return v;let g=await this.getAuthToken();if(!g)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 v.Authorization_bar=g,v}async request(a){let{path:u,method:v="POST",data:g={},header:R={},authRequired:P=!0,baseDomain:B,beforeRequest:q,afterResponse:rt}=a,at=B?`${B}${u}`:Be(this.getCurrentConfig().env||"prod",u),$=await this.buildHeader(R,P);q&&typeof q=="function"&&await q({url:at,method:v,data:g,header:$}),x.info(`\u53D1\u8D77${v}\u8BF7\u6C42:`,{path:u,method:v});try{let z=await Sn(at,v,g,$);return x.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:z.statusCode}),rt&&typeof rt=="function"&&await rt(z.data),z.data}catch(z){throw x.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:z}),z}}get(a,u={},v={}){return this.request(gt({path:a,method:"GET",data:u},v))}post(a,u={},v={}){return this.request(gt({path:a,method:"POST",data:u},v))}},Te=(o=null)=>new Ze(o);var Tn=(function(){"use strict";function o(I,Z){var ht=(65535&I)+(65535&Z);return(I>>16)+(Z>>16)+(ht>>16)<<16|65535&ht}function a(I,Z,ht,ot,J,Tt){return o((Tt=o(o(Z,I),o(ot,Tt)))<<J|Tt>>>32-J,ht)}function u(I,Z,ht,ot,J,Tt,S){return a(Z&ht|~Z&ot,I,Z,J,Tt,S)}function v(I,Z,ht,ot,J,Tt,S){return a(Z&ot|ht&~ot,I,Z,J,Tt,S)}function g(I,Z,ht,ot,J,Tt,S){return a(Z^ht^ot,I,Z,J,Tt,S)}function R(I,Z,ht,ot,J,Tt,S){return a(ht^(Z|~ot),I,Z,J,Tt,S)}function P(I,Z){var ht,ot,J,Tt;I[Z>>5]|=128<<Z%32,I[14+(Z+64>>>9<<4)]=Z;for(var S=1732584193,b=-271733879,m=-1732584194,C=271733878,_=0;_<I.length;_+=16)S=u(ht=S,ot=b,J=m,Tt=C,I[_],7,-680876936),C=u(C,S,b,m,I[_+1],12,-389564586),m=u(m,C,S,b,I[_+2],17,606105819),b=u(b,m,C,S,I[_+3],22,-1044525330),S=u(S,b,m,C,I[_+4],7,-176418897),C=u(C,S,b,m,I[_+5],12,1200080426),m=u(m,C,S,b,I[_+6],17,-1473231341),b=u(b,m,C,S,I[_+7],22,-45705983),S=u(S,b,m,C,I[_+8],7,1770035416),C=u(C,S,b,m,I[_+9],12,-1958414417),m=u(m,C,S,b,I[_+10],17,-42063),b=u(b,m,C,S,I[_+11],22,-1990404162),S=u(S,b,m,C,I[_+12],7,1804603682),C=u(C,S,b,m,I[_+13],12,-40341101),m=u(m,C,S,b,I[_+14],17,-1502002290),S=v(S,b=u(b,m,C,S,I[_+15],22,1236535329),m,C,I[_+1],5,-165796510),C=v(C,S,b,m,I[_+6],9,-1069501632),m=v(m,C,S,b,I[_+11],14,643717713),b=v(b,m,C,S,I[_],20,-373897302),S=v(S,b,m,C,I[_+5],5,-701558691),C=v(C,S,b,m,I[_+10],9,38016083),m=v(m,C,S,b,I[_+15],14,-660478335),b=v(b,m,C,S,I[_+4],20,-405537848),S=v(S,b,m,C,I[_+9],5,568446438),C=v(C,S,b,m,I[_+14],9,-1019803690),m=v(m,C,S,b,I[_+3],14,-187363961),b=v(b,m,C,S,I[_+8],20,1163531501),S=v(S,b,m,C,I[_+13],5,-1444681467),C=v(C,S,b,m,I[_+2],9,-51403784),m=v(m,C,S,b,I[_+7],14,1735328473),S=g(S,b=v(b,m,C,S,I[_+12],20,-1926607734),m,C,I[_+5],4,-378558),C=g(C,S,b,m,I[_+8],11,-2022574463),m=g(m,C,S,b,I[_+11],16,1839030562),b=g(b,m,C,S,I[_+14],23,-35309556),S=g(S,b,m,C,I[_+1],4,-1530992060),C=g(C,S,b,m,I[_+4],11,1272893353),m=g(m,C,S,b,I[_+7],16,-155497632),b=g(b,m,C,S,I[_+10],23,-1094730640),S=g(S,b,m,C,I[_+13],4,681279174),C=g(C,S,b,m,I[_],11,-358537222),m=g(m,C,S,b,I[_+3],16,-722521979),b=g(b,m,C,S,I[_+6],23,76029189),S=g(S,b,m,C,I[_+9],4,-640364487),C=g(C,S,b,m,I[_+12],11,-421815835),m=g(m,C,S,b,I[_+15],16,530742520),S=R(S,b=g(b,m,C,S,I[_+2],23,-995338651),m,C,I[_],6,-198630844),C=R(C,S,b,m,I[_+7],10,1126891415),m=R(m,C,S,b,I[_+14],15,-1416354905),b=R(b,m,C,S,I[_+5],21,-57434055),S=R(S,b,m,C,I[_+12],6,1700485571),C=R(C,S,b,m,I[_+3],10,-1894986606),m=R(m,C,S,b,I[_+10],15,-1051523),b=R(b,m,C,S,I[_+1],21,-2054922799),S=R(S,b,m,C,I[_+8],6,1873313359),C=R(C,S,b,m,I[_+15],10,-30611744),m=R(m,C,S,b,I[_+6],15,-1560198380),b=R(b,m,C,S,I[_+13],21,1309151649),S=R(S,b,m,C,I[_+4],6,-145523070),C=R(C,S,b,m,I[_+11],10,-1120210379),m=R(m,C,S,b,I[_+2],15,718787259),b=R(b,m,C,S,I[_+9],21,-343485551),S=o(S,ht),b=o(b,ot),m=o(m,J),C=o(C,Tt);return[S,b,m,C]}function B(I){for(var Z="",ht=32*I.length,ot=0;ot<ht;ot+=8)Z+=String.fromCharCode(I[ot>>5]>>>ot%32&255);return Z}function q(I){var Z=[];for(Z[(I.length>>2)-1]=void 0,ot=0;ot<Z.length;ot+=1)Z[ot]=0;for(var ht=8*I.length,ot=0;ot<ht;ot+=8)Z[ot>>5]|=(255&I.charCodeAt(ot/8))<<ot%32;return Z}function rt(I){for(var Z,ht="0123456789abcdef",ot="",J=0;J<I.length;J+=1)Z=I.charCodeAt(J),ot+=ht.charAt(Z>>>4&15)+ht.charAt(15&Z);return ot}function at(I){return unescape(encodeURIComponent(I))}function $(I){return B(P(q(I=at(I)),8*I.length))}function z(I,Z){return(function(ht,ot){var J,Tt=q(ht),S=[],b=[];for(S[15]=b[15]=void 0,16<Tt.length&&(Tt=P(Tt,8*ht.length)),J=0;J<16;J+=1)S[J]=909522486^Tt[J],b[J]=1549556828^Tt[J];return ot=P(S.concat(q(ot)),512+8*ot.length),B(P(b.concat(ot),640))})(at(I),at(Z))}function ve(I,Z,ht){return Z?ht?z(Z,I):rt(z(Z,I)):ht?$(I):rt($(I))}return ve})(),Ce=Tn;function br(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function Pr(o){if(typeof o!="object"||o===null)return o;let a=Object.keys(o).sort(),u={};for(let v of a)u[v]=o[v];return JSON.stringify(u)}function wr(o,a){let u={appId:o.appId,randomStr:o.randomStr,data:o.data},v=Object.keys(u).sort(),g="";for(let[R,P]of v.entries())g+=`${P}=${u[P]}`,R<v.length-1&&(g+="&");return g+=`&secretKey=${a}`,Ce(g)}var bn=(o,a,u,v)=>{let g=re();return g==="taro"?Taro.request({url:o,method:a,data:u,header:v}).then(R=>R):g==="uni"?new Promise((R,P)=>{uni.request({url:o,method:a,data:u,header:v,success:B=>R(B),fail:B=>P(B)})}):g==="wechat"?new Promise((R,P)=>{wx.request({url:o,method:a,data:u,header:v,success:B=>R(B),fail:B=>P(B)})}):g==="alipay"?new Promise((R,P)=>{my.request({url:o,method:a,data:u,headers:v,success:B=>R(B),fail:B=>P(B)})}):fetch(o,{method:a,headers:v,body:JSON.stringify(u)}).then(async R=>({statusCode:R.status,data:await R.json()}))},tr=class{constructor(a=null){Me(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||pe()||{}}getExternalEnv(){var a;return((a=this.getCurrentConfig())==null?void 0:a.externalEnv)||ue.PROD}getExternalHost(){let a=this.getExternalEnv();return Pe[a]||Pe.prod}generateSign(a={}){let u=this.getCurrentConfig(),{externalAppId:v,externalAppSecret:g}=u;if(!v||!g)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let R=br(),P=Pr(a),B=wr({appId:v,randomStr:R,data:P},g);return{appId:v,randomStr:R,sign:B}}buildRequestBody(a={}){let u=this.generateSign(a);return Zt(gt({},u),{data:a})}buildUrl(a){return`${this.getExternalHost()}${a}`}async request(a){let{path:u,method:v="POST",data:g={},header:R={},needSign:P=!0,beforeRequest:B,afterResponse:q}=a,rt=this.buildUrl(u),at=gt({"content-type":"application/json"},R),$=P?this.buildRequestBody(g):g;B&&typeof B=="function"&&await B({url:rt,method:v,data:$,header:at}),x.info(`\u53D1\u8D77${v}\u8BF7\u6C42:`,{path:u,method:v});try{let z=await bn(rt,v,$,at);if(x.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:z.statusCode}),q&&typeof q=="function"&&await q(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:(x.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:z}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:z})}}get(a,u={},v={}){return this.request(gt({path:a,method:"GET",data:u},v))}post(a,u={},v={}){return this.request(gt({path:a,method:"POST",data:u},v))}},Cr=(o=null)=>new tr(o);var er=Te(),rr=Cr();function Or(o){let a=qe(o==null?void 0:o.equipmentValue,"equipmentValue");return a.valid?er.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Nr(o){let a=we(o,["idMd5Value","rtaStrategy"]);return a.valid?rr.post("/open/rest/cpa/jd/rta-check",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Fr(o){try{let a={thirdPlatform:o.thirdPlatform,thirdPlatformUserId:o.thirdPlatformUserId,thirdPlatformEquipmentValue:o.thirdPlatformEquipmentValue,os:o.os,client:"wxMini"};o.phone&&(a.mobileMd5=Ce(o.phone)),o.extendData&&(Object.prototype.toString.call(o.extendData)==="[object Object]"?a.extendData=o.extendData:x.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let u=await rr.post("/open/rest/cpa/jd/insurance/get",a);return u?u.jumpMode==1?{jumpMode:1,appId:u.appId,url:u.url}:{jumpMode:2,url:u.url,channel:u.channelId}:void 0}catch(a){throw x.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",a),a}}function xr(o){let a=qe(o==null?void 0:o.equipmentValue,"equipmentValue");return a.valid?er.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}function Lr(o){let a=we(o,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return a.valid?er.post("/gw/advert/customer/cpa-activity/jd/rta/validate",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Ur(o){let a=await me(),u={thirdPlatform:o.thirdPlatform,thirdPlatformUserId:o.thirdPlatformUserId,thirdPlatformEquipmentValue:o.thirdPlatformEquipmentValue,os:a,client:o.client};return o.phone&&(u.mobileMd5=Ce(o.phone)),o.extendData&&(Object.prototype.toString.call(o.extendData)==="[object Object]"?u.extendData=o.extendData:x.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),rr.post("/open/rest/cpa/jd/cash-loan/get",u)}async function nr(o){let{phone:a,rtaId:u,equipmentId:v,lyyUserId:g,entrance:R}=o;if(!a)return K(xt.INVALID_PARAM,bt[2001]);if(!v)return K(xt.INVALID_PARAM,bt[2002]);try{if(u){x.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let $=await Lr({phone:a,lyyEquipmentValue:v,lyyUserId:g||"",rtaId:u});if($.code!=="0000000"||!$.body||$.body.state!=1)return x.error("RTA\u9A8C\u8BC1\u5931\u8D25",$),K(2003,bt[2003]);x.info("RTA\u9A8C\u8BC1\u6210\u529F",$.body)}x.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:a});let P=await me(),B=await xr({phone:a,equipmentValue:v,os:P,entrance:R});if(B.code!=="0000000"||!B.body)return x.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",B),K(2004,bt[2004]);let{appId:q,targetUrl:rt}=B.body;if(!q||!rt)return x.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:q,targetUrl:rt}),K(2005,bt[2005]);let at=K(xt.SUCCESS,"\u6210\u529F",{appId:q,targetUrl:rt});return x.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",at),at}catch(P){return x.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",P),K(xt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function or(o){let{phone:a,rtaId:u,thirdPlatform:v,thirdPlatformUserId:g,thirdPlatformEquipmentValue:R}=o;if(!a)return K(xt.INVALID_PARAM,bt[2001]);if(!v)return K(2008,bt[2008]);if(!g)return K(2009,bt[2009]);if(!R)return K(2010,bt[2010]);try{if(u){x.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let z=await Nr({idMd5Value:a,rtaStrategy:u});if(z.status!=1)return x.error("RTA\u9A8C\u8BC1\u5931\u8D25",z),K(2003,bt[2003]);x.info("RTA\u9A8C\u8BC1\u6210\u529F",z)}let P=await Ur(o),{url:B,channelId:q,matchFlag:rt,jumpMode:at,appId:$}=P||{};return rt?at===3?!$||!B?K(2007,bt[2007]):K(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:$,url:B}):K(2007,bt[2007]):K(2006,bt[2006])}catch(P){return x.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",P),K(xt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var be=null,Oe=null;try{Oe=Mr()}catch(o){}function jr(){return be||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(be=globalThis.LyyGetCommandSDK,be):Oe?(be=Oe.LyyGetCommandSDK||Oe.default||Oe,be):null)}function Br(o){var u;x.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",o);let a=jr();a!=null&&a.getJrCommand?a.getJrCommand(o):(u=a==null?void 0:a.default)!=null&&u.getJrCommand?a.default.getJrCommand(o):(x.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),o.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function Pn(o,a){return new Promise((u,v)=>{try{Br({url:o,channel:a,callback:g=>{g.code==="0"?u(g.data):v({msg:g.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(g){v(g)}})}async function ir(o){try{let a=await me(),u=gt({os:a},o);x.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",u);let{code:v,body:g}=await Or(u);if(v==="0000000"&&g){let{url:R,channelId:P,matchFlag:B,jumpMode:q,appId:rt}=g;if(!B)return K(2101,bt[2101]);if(q===1)return x.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),K(2102,bt[2102]);if(q===2)return re()==="web"&&x.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:R}),!R||!P?K(2103,bt[2103]):new Promise(at=>{Br({url:R,channel:P,callback:async $=>{if(($==null?void 0:$.code)==="0")try{await Qe($==null?void 0:$.data),at(K(xt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(z){at(K(2105,bt[2105]))}else at(K(2105,bt[2105]))}})});if(q===3)return!rt||!R?K(2103,bt[2103]):K(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:rt,path:R})}return K(2104,bt[2104])}catch(a){return x.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",a),K(xt.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function ar(o){x.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let a=await Fr(Zt(gt({},o),{os:await me()}));if(!a)return x.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),K(2106,bt[2106]);if(a.jumpMode===1)return x.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:a.appId,url:a.url}),K(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:a.appId,path:a.url});if(a.jumpMode===2){if(re()==="web")return x.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:a.url}),K(xt.SUCCESS,"\u6210\u529F",{type:"h5",url:a.url});try{let u=await Pn(a.url,a.channel);return await Qe(u),x.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),K(xt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(u){return x.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",u),$e("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),K(2105,bt[2105])}}return x.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",a.jumpMode),K(2107,bt[2107])}catch(a){let u=typeof a=="string"?a:(a==null?void 0:a.msg)||(a==null?void 0:a.message)||"\u672A\u77E5\u9519\u8BEF";return x.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",u),$e("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),u.includes("RTA")||u.includes("\u8D44\u683C")?K(2108,bt[2108]):K(xt.NETWORK_ERROR,u)}}var lr={};Ye(lr,{DyErrorCode:()=>_e,getDyPayRtaData:()=>cr,handleDyPayFlow:()=>ur});var wn=["weapp","h5"],Cn=["default","jsapi"];function On(o){return wn.includes(o)}var Nn=["h5","ulink"];function Fn(o){return Nn.includes(o)}function xn(o){return Cn.includes(o)}var Ln=["switchTab","reLaunch","redirectTo","navigateTo"];function Un(o){return Ln.includes(o)}function qr(o){return!o.telephone&&o.returnType==="h5"?{valid:!1,errorCode:3001}:o.price?o.equipmentValue?o.businessType?o.client&&!On(o.client)?{valid:!1,errorCode:3004}:o.returnType&&!Fn(o.returnType)?{valid:!1,errorCode:3018}:o.payClientType&&!xn(o.payClientType)?{valid:!1,errorCode:3004}:o.douyinOrderExtendData&&typeof o.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:o.backWay&&o.client==="weapp"&&!Un(o.backWay)?{valid:!1,errorCode:3016}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}}function Jr(o){return o.equipmentValue?{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}var ke=Te();async function kr(o){let{price:a,equipmentValue:u,douyinOrderExtendData:v,douyinCommodityVirtualFlag:g,businessType:R,platformActivities:P={}}=o,B={businessType:R,equipmentValue:u,payInfoBusinessType:"commonDouyinPayment",platformActivities:gt({douyinCommodityVirtualFlag:g||!1,douyinCommodityPrice:a,douyinOrderExtendData:v||""},P)};try{let q=await ke.post("/gw/advert/customer/payment/pay-info",B);return q.code!=="0000000"||!(q!=null&&q.body)?Promise.reject({code:3006,message:q.message||Mt[3006]}):(q.body.platformActivities=B.platformActivities,q)}catch(q){return x.error("getDyOrderAmountFn error:",q),Promise.reject({code:3007,message:Mt[3007]})}}async function Vr(o){var a,u;try{let v=o.commodityList.map($=>($.commodity=$.commodityId,delete $.commodityId,$.quantity=$.quantity||1,$)),g=o.advertExtendInfo&&Object.keys(o.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:o.advertExtendInfo}):"",R=re(),P="";R==="wechat"?P="wechatMini":R==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(P="wechatHtml");let B=o.payClientType==="jsapi",q=B?22:21,rt=gt(gt(gt({businessType:o.businessType,fixedClientType:q,channelCode:null,douyinData:{loginMobile:o.telephone||""},equipmentUseFlag:!0,payEquipmentDTO:{equipmentValue:o.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:g,transType:5,actualFee:o.totalFee,totalFee:o.totalFee,commodityList:v,clientSourceDetailType:P,platformActivities:o.platformActivities||{}},o.commoditySign&&{commoditySign:o.commoditySign}),o.unifiedOrderExtendData&>({},o.unifiedOrderExtendData)),B?{appId:((a=o.jsapiInfo)==null?void 0:a.appId)||"",openId:((u=o.jsapiInfo)==null?void 0:u.douyinOpenId)||""}:{}),at=await ke.post("/gw/payment-bff/unified/order",rt);return at.code!=="0000000"||!(at!=null&&at.body)?Promise.reject({code:3008,message:at.message||Mt[3008]}):at}catch(v){return x.error("dyUnifiedOrderFn error:",v),Promise.reject({code:3009,message:Mt[3009]})}}async function Hr(o){let a={equipmentValue:o.equipmentValue,phone:o.telephone||""};o.price&&(a.orderAmount=o.price);try{let u=await ke.post("/gw/advert/customer/douyin/pay/check",a);return u.code!=="0000000"||!(u!=null&&u.body)?Promise.reject({code:3013,message:u.message||Mt[3013]}):u}catch(u){return x.error("getDyPayRtaData error:",u),Promise.reject({code:3014,message:(u==null?void 0:u.message)||Mt[3014]})}}async function Gr(){try{let o=await ke.get("/gw/advert/customer/douyin/pay/jsapi/info");return o.code!=="0000000"||!(o!=null&&o.body)?Promise.reject({code:3019,message:o.message||Mt[3019]}):{appId:o.body.appId,douyinOpenId:o.body.douyinOpenId}}catch(o){return x.error("getDyPayJsapiInfoFn error:",o),Promise.reject({code:(o==null?void 0:o.code)||3020,message:(o==null?void 0:o.message)||Mt[3020]})}}async function ur(o){var u,v,g,R;let a=qr(o);if(!a.valid)return K(a.errorCode,Mt[a.errorCode]);try{let P=await kr({price:o.price,equipmentValue:o.equipmentValue,businessType:o.businessType,douyinOrderExtendData:(o==null?void 0:o.douyinOrderExtendData)||"",platformActivities:(o==null?void 0:o.platformActivities)||{},douyinCommodityVirtualFlag:(o==null?void 0:o.douyinCommodityVirtualFlag)||!1}),B=o.payClientType==="jsapi"?await Gr():void 0,q=await Vr(Zt(gt(Zt(gt({},P.body),{telephone:o.telephone,equipmentValue:o.equipmentValue,businessType:o.businessType}),o.unifiedOrderExtendData&&{unifiedOrderExtendData:o.unifiedOrderExtendData}),{payClientType:o.payClientType,jsapiInfo:B})),rt=((u=q==null?void 0:q.body)==null?void 0:u.h5Url)||"",at=((v=q==null?void 0:q.body)==null?void 0:v.outTradeNo)||"";if(o.returnType==="ulink"){let z=rt?await Bn(Zt(gt({},o),{dyUrl:rt})):"";return z?K(0,"success",{ulinkUrl:z,outTradeNo:at}):K(3010,Mt[3010])}if(o.payClientType==="jsapi"){let z=Yn((g=q==null?void 0:q.body)==null?void 0:g.payInfo);return K(0,"success",{appId:(B==null?void 0:B.appId)||"",payInfo:z,outTradeNo:at})}let $=rt?await jn(Zt(gt({},o),{dyUrl:rt})):"";return $?K(0,"success",{h5Url:$,outTradeNo:at}):K(3010,Mt[3010])}catch(P){x.error("handleDyPayFlow error:",P);let B=(R=P==null?void 0:P.code)!=null?R:3012,q=(P==null?void 0:P.message)||Mt[3012];return K(B,q)}}function Yn(o){if(!o)throw{code:3021,message:Mt[3021]};try{let a=JSON.parse(o);if(!Mn(a))throw new Error("invalid payInfo fields");return a}catch(a){throw{code:3022,message:Mt[3022],error:a}}}function Mn(o){return typeof o.timeStamp=="string"&&o.timeStamp!==""&&typeof o.nonceStr=="string"&&o.nonceStr!==""&&typeof o.package=="string"&&o.package!==""&&typeof o.signType=="string"&&o.signType!==""&&typeof o.paySign=="string"&&o.paySign!==""}async function jn(o){let a=pe(),u=Be(a.env||"prod",""),v=typeof a.getAuthToken=="function"?await a.getAuthToken():"",g=o.client||"weapp";return`${u}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${g}&equipmentId=${o.equipmentValue}&dyUrl=${o.dyUrl}&fromUrl=${encodeURIComponent(o.fromUrl||"")}&backUrl=${encodeURIComponent(o.backUrl||"")}&backWay=${o.backWay||""}&url_token=${v}`}async function Bn(o){return o.dyUrl+`${o.backUrl?"&return_url="+encodeURIComponent(o.backUrl||""):""}&jump_back_schema=${encodeURIComponent("weixin://")}`}async function cr(o){var u;let a=Jr(o);if(!a.valid)return K(a.errorCode,Mt[a.errorCode]);try{let v=await Hr({price:(o==null?void 0:o.price)||"",equipmentValue:o.equipmentValue,telephone:(o==null?void 0:o.telephone)||""});return K(0,"success",v.body)}catch(v){x.error("getDyPayRtaData error:",v);let g=(u=v==null?void 0:v.code)!=null?u:3015,R=(v==null?void 0:v.message)||Mt[3015];return K(g,R)}}var hr={};Ye(hr,{getDisplayAdConfig:()=>pr,normalizeDisplayAdData:()=>Ve});var qn=Te();function Xr(o){let a=we(o,["placementId"]);if(!a.valid)return Promise.reject({code:"PARAM_ERROR",message:a.message});let u=pe().env||"prod";return qn.get(`/gw/advert-plugin/api/v1/config/list/valid/${o.placementId}`,{},{authRequired:!1,baseDomain:Er(u)})}var Kr=30*1e3,Jn="__",dr=new Map,fr=new Map;function kn(o,a){return[o.appId||"",a,o.type||""].join(Jn)}function Vn(o){let a=dr.get(o);return a?a.expireAt<=Date.now()?(dr.delete(o),x.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:o}),null):a.data:null}function Hn(o,a){dr.set(o,{data:a,expireAt:Date.now()+Kr})}function Gn(o){return Array.isArray(o==null?void 0:o.body)?o.body:[]}function Xn(o){return String(o==null?void 0:o.code)!=="200"}function Kn(o,a){let u=String(o||a||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(u)?u:a||"banner"}function Wr(o){return String(o||"").trim().toLowerCase()}function Wn(o){var a;return!!o&&o.status!==0&&((a=o.platformConfig)==null?void 0:a.valid)!==!1}function zn(o){return[...o].sort((a,u)=>{var R,P,B,q;let v=Number((R=a.priority)!=null?R:9999),g=Number((P=u.priority)!=null?P:9999);return v!==g?v-g:Number((B=u.weight)!=null?B:0)-Number((q=a.weight)!=null?q:0)})}function zr(o){return o.find(a=>Wr(a.advertPlatform)==="gdt")||null}function Qr(o){return o.find(a=>Wr(a.advertPlatform)!=="gdt")||null}function Qn(o,a){return o&&a?"mixed":o?"wechat":a?"custom":"none"}function $n(o,a){var g,R;let u=zr(o),v=Qr(o);return u&&v?Number((g=u.priority)!=null?g:9999)<=Number((R=v.priority)!=null?R:9999)?"wechat-first":"custom-first":a==="custom"?"custom-only":a==="wechat"?"wechat-only":"wechat-first"}function Zn(o){var u;let a=zr(o);return((u=a==null?void 0:a.platformConfig)==null?void 0:u.adId)||""}function to(o){let a=Qr(o),u=a==null?void 0:a.platformConfig;if(!u)return null;let v=u.image||u.imageUrl||"",g=u.video||u.videoUrl||"",R=u.poster||v||"",P=u.jumpUrl||u.url||u.webUrl||"";return!v&&!g?null:{image:v||void 0,video:g||void 0,poster:R||void 0,title:u.title,description:u.description,buttonText:u.buttonText,badgeText:u.badgeText,jumpSeconds:u.jumpSeconds,loadTimeout:u.loadTimeout||u.timeout,muted:u.muted,adSpec:u.adSpec,url:P||void 0,action:P?{type:"web",url:P}:void 0}}function Ve(o,a){let u=zn(o.filter(Wn)),v=to(u),g=Zn(u),R=Kn(void 0,a),P=Qn(g,v),B=$n(u,P);return{show:!!(g||v),adId:"",type:R,provider:P,priority:B,unitId:g,customAd:v,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:o}}async function pr(o){let a=o.placementId||o.adId||"",u=kn(o,a),v=Vn(u);if(v)return x.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:u,placementId:a}),K(xt.SUCCESS,"\u6210\u529F",v);let g=fr.get(u);if(g)return x.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:u,placementId:a}),g;let R=(async()=>{try{x.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",o);let P=await Xr({placementId:a}),B=Gn(P);if(x.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:u,placementId:a,response:P,body:B}),Xn(P)||!B)return x.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",P),K(xt.UNKNOWN_ERROR,(P==null?void 0:P.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let q=Ve(B,o.type);return q.adId=a,q.cache=Zt(gt({},q.cache),{enable:!0,ttl:Kr}),Hn(u,q),x.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:u,placementId:a,provider:q.provider,priority:q.priority,hasUnitId:!!q.unitId,hasCustomAd:!!q.customAd}),K(xt.SUCCESS,"\u6210\u529F",q)}catch(P){return x.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:u,placementId:a,error:P}),K(xt.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{fr.delete(u)}})();return fr.set(u,R),R}function eo(o={}){x.info("\u670D\u52A1\u521D\u59CB\u5316",o);let a=gt(gt({},Se),o);a.env&&!je[a.env]&&(x.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${a.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.env=Kt.PROD),a.externalEnv&&!Pe[a.externalEnv]&&(x.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${a.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.externalEnv=ue.PROD),a.debug!==void 0&&x.setEnable(a.debug),Tr(a),x.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",a)}function $r(o={}){let a="",u=null;async function v(){if(typeof o.getAuthToken=="function"){let R=await o.getAuthToken();if(R)return R}return u&&typeof u.getStorage=="function"&&u.getStorage("auth_token")||""}let g={name:"services",setToken(R){return a=R||"",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",a),g},async getAuthToken(){return a||v()},clearToken(){return a="",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",""),g},install(R){u=R;let P=Zt(gt({},o),{getAuthToken:()=>g.getAuthToken()});eo(P),x.info("services installed via nova.use()"),Object.assign(R,{jd:gt({},sr),dy:gt({},lr),ads:gt({},hr),setToken:g.setToken,clearToken:g.clearToken})}};return g}0&&(module.exports={DyErrorCode,DyErrorMessage,ENV_TYPE,EXTERNAL_ENV_TYPE,JdErrorCode,JdErrorMessage,createServices,getDisplayAdConfig,getDyPayRtaData,handleDyPayFlow,handleJdInsurance,handleJdInsuranceExt,handleJdjrCashLoanExt,handleJdjrCashLoanFlow,normalizeDisplayAdData});
|
|
5
5
|
/*! For license information please see LyyGetCommandSDK.min.js.LICENSE.txt */
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var hr=Object.defineProperty,fn=Object.defineProperties;var dn=Object.getOwnPropertyDescriptors;var pr=Object.getOwnPropertySymbols;var pn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable;var Ge=(o,a,u)=>a in o?hr(o,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):o[a]=u,gt=(o,a)=>{for(var u in a||(a={}))pn.call(a,u)&&Ge(o,u,a[u]);if(pr)for(var u of pr(a))hn.call(a,u)&&Ge(o,u,a[u]);return o},Zt=(o,a)=>fn(o,dn(a));var yn=(o,a)=>()=>(a||o((a={exports:{}}).exports,a),a.exports),Xe=(o,a)=>{for(var u in a)hr(o,u,{get:a[u],enumerable:!0})};var Ye=(o,a,u)=>Ge(o,typeof a!="symbol"?a+"":a,u);var Nr=yn((Po,Or)=>{"use strict";(()=>{var o={737:(g,R,P)=>{"use strict";P.r(R),P.d(R,{default:()=>C,getJrCommand:()=>S});var B=P(307),q=P.n(B);function rt(){rt=function(){return V};var _,V={},At=Object.prototype,ct=At.hasOwnProperty,Dt=Object.defineProperty||function(d,l,y){d[l]=y.value},lt=typeof Symbol=="function"?Symbol:{},mt=lt.iterator||"@@iterator",It=lt.asyncIterator||"@@asyncIterator",Rt=lt.toStringTag||"@@toStringTag";function pt(d,l,y){return Object.defineProperty(d,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),d[l]}try{pt({},"")}catch(d){pt=function(l,y,F){return l[y]=F}}function Vt(d,l,y,F){var D=l&&l.prototype instanceof ie?l:ie,U=Object.create(D.prototype),nt=new ce(F||[]);return Dt(U,"_invoke",{value:Ot(d,y,nt)}),U}function Ht(d,l,y){try{return{type:"normal",arg:d.call(l,y)}}catch(F){return{type:"throw",arg:F}}}V.wrap=Vt;var kt="suspendedStart",$t="suspendedYield",Gt="executing",Pt="completed",wt={};function ie(){}function ne(){}function Mt(){}var ae={};pt(ae,mt,(function(){return this}));var oe=Object.getPrototypeOf,Lt=oe&&oe(oe(ee([])));Lt&&Lt!==At&&ct.call(Lt,mt)&&(ae=Lt);var Jt=Mt.prototype=ie.prototype=Object.create(ae);function he(d){["next","throw","return"].forEach((function(l){pt(d,l,(function(y){return this._invoke(l,y)}))}))}function zt(d,l){function y(D,U,nt,vt){var yt=Ht(d[D],d,U);if(yt.type!=="throw"){var Xt=yt.arg,Qt=Xt.value;return Qt&&Q(Qt)=="object"&&ct.call(Qt,"__await")?l.resolve(Qt.__await).then((function(Et){y("next",Et,nt,vt)}),(function(Et){y("throw",Et,nt,vt)})):l.resolve(Qt).then((function(Et){Xt.value=Et,nt(Xt)}),(function(Et){return y("throw",Et,nt,vt)}))}vt(yt.arg)}var F;Dt(this,"_invoke",{value:function(D,U){function nt(){return new l((function(vt,yt){y(D,U,vt,yt)}))}return F=F?F.then(nt,nt):nt()}})}function Ot(d,l,y){var F=kt;return function(D,U){if(F===Gt)throw Error("Generator is already running");if(F===Pt){if(D==="throw")throw U;return{value:_,done:!0}}for(y.method=D,y.arg=U;;){var nt=y.delegate;if(nt){var vt=Ut(nt,y);if(vt){if(vt===wt)continue;return vt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(F===kt)throw F=Pt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);F=Gt;var yt=Ht(d,l,y);if(yt.type==="normal"){if(F=y.done?Pt:$t,yt.arg===wt)continue;return{value:yt.arg,done:y.done}}yt.type==="throw"&&(F=Pt,y.method="throw",y.arg=yt.arg)}}}function Ut(d,l){var y=l.method,F=d.iterator[y];if(F===_)return l.delegate=null,y==="throw"&&d.iterator.return&&(l.method="return",l.arg=_,Ut(d,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),wt;var D=Ht(F,d.iterator,l.arg);if(D.type==="throw")return l.method="throw",l.arg=D.arg,l.delegate=null,wt;var U=D.arg;return U?U.done?(l[d.resultName]=U.value,l.next=d.nextLoc,l.method!=="return"&&(l.method="next",l.arg=_),l.delegate=null,wt):U:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,wt)}function te(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 ue(d){var l=d.completion||{};l.type="normal",delete l.arg,d.completion=l}function ce(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(te,this),this.reset(!0)}function ee(d){if(d||d===""){var l=d[mt];if(l)return l.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var y=-1,F=function D(){for(;++y<d.length;)if(ct.call(d,y))return D.value=d[y],D.done=!1,D;return D.value=_,D.done=!0,D};return F.next=F}}throw new TypeError(Q(d)+" is not iterable")}return ne.prototype=Mt,Dt(Jt,"constructor",{value:Mt,configurable:!0}),Dt(Mt,"constructor",{value:ne,configurable:!0}),ne.displayName=pt(Mt,Rt,"GeneratorFunction"),V.isGeneratorFunction=function(d){var l=typeof d=="function"&&d.constructor;return!!l&&(l===ne||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,Mt):(d.__proto__=Mt,pt(d,Rt,"GeneratorFunction")),d.prototype=Object.create(Jt),d},V.awrap=function(d){return{__await:d}},he(zt.prototype),pt(zt.prototype,It,(function(){return this})),V.AsyncIterator=zt,V.async=function(d,l,y,F,D){D===void 0&&(D=Promise);var U=new zt(Vt(d,l,y,F),D);return V.isGeneratorFunction(l)?U:U.next().then((function(nt){return nt.done?nt.value:U.next()}))},he(Jt),pt(Jt,Rt,"Generator"),pt(Jt,mt,(function(){return this})),pt(Jt,"toString",(function(){return"[object Generator]"})),V.keys=function(d){var l=Object(d),y=[];for(var F in l)y.push(F);return y.reverse(),function D(){for(;y.length;){var U=y.pop();if(U in l)return D.value=U,D.done=!1,D}return D.done=!0,D}},V.values=ee,ce.prototype={constructor:ce,reset:function(d){if(this.prev=0,this.next=0,this.sent=this._sent=_,this.done=!1,this.delegate=null,this.method="next",this.arg=_,this.tryEntries.forEach(ue),!d)for(var l in this)l.charAt(0)==="t"&&ct.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=_)},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 y(yt,Xt){return U.type="throw",U.arg=d,l.next=yt,Xt&&(l.method="next",l.arg=_),!!Xt}for(var F=this.tryEntries.length-1;F>=0;--F){var D=this.tryEntries[F],U=D.completion;if(D.tryLoc==="root")return y("end");if(D.tryLoc<=this.prev){var nt=ct.call(D,"catchLoc"),vt=ct.call(D,"finallyLoc");if(nt&&vt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0);if(this.prev<D.finallyLoc)return y(D.finallyLoc)}else if(nt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0)}else{if(!vt)throw Error("try statement without catch or finally");if(this.prev<D.finallyLoc)return y(D.finallyLoc)}}}},abrupt:function(d,l){for(var y=this.tryEntries.length-1;y>=0;--y){var F=this.tryEntries[y];if(F.tryLoc<=this.prev&&ct.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var D=F;break}}D&&(d==="break"||d==="continue")&&D.tryLoc<=l&&l<=D.finallyLoc&&(D=null);var U=D?D.completion:{};return U.type=d,U.arg=l,D?(this.method="next",this.next=D.finallyLoc,wt):this.complete(U)},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),wt},finish:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===d)return this.complete(y.completion,y.afterLoc),ue(y),wt}},catch:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===d){var F=y.completion;if(F.type==="throw"){var D=F.arg;ue(y)}return D}}throw Error("illegal catch attempt")},delegateYield:function(d,l,y){return this.delegate={iterator:ee(d),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=_),wt}},V}function at(_,V,At,ct,Dt,lt,mt){try{var It=_[lt](mt),Rt=It.value}catch(pt){return void At(pt)}It.done?V(Rt):Promise.resolve(Rt).then(ct,Dt)}function Q(_){return Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},Q(_)}var $="https://ms.jr.jd.com";function _e(_){var V=_.host,At=_.type,ct=At===void 0?"post":At,Dt=_.data,lt=_.path,mt=lt===void 0?"":lt,It=_.config,Rt=It===void 0?{}:It,pt=(Rt.withCredentials,Rt.isWG),Vt=pt===void 0||pt,Ht=Rt.contentType,kt=Ht===void 0?"application/x-www-form-urlencoded":Ht;return new Promise((function($t,Gt){wx.request({url:(V||$)+mt,method:ct.toUpperCase(),data:Vt?I({reqData:JSON.stringify(Dt)}):Dt,header:{"content-type":kt},success:function(Pt){Pt.statusCode===200?$t(Pt.data):Gt({statusCode:Pt.statusCode,errMsg:Pt.errMsg,data:Pt.data})},fail:function(Pt){Gt(Pt)}})}))}function I(_){var V="";return Q(_)==="object"&&_!==null&&(Object.keys(_).map((function(At){var ct=_[At];return V+=At+"="+encodeURIComponent(ct)+"&",""})),V.length>0&&(V=V.substr(0,V.length-1))),V}function Z(_){return ht.apply(this,arguments)}function ht(){var _;return _=rt().mark((function V(At){var ct,Dt,lt,mt,It,Rt,pt,Vt,Ht,kt;return rt().wrap((function($t){for(;;)switch($t.prev=$t.next){case 0:return ct=At.url,Dt=At.channel,lt=At.callback,q().init(),mt=new(q()),It=mt.nonce(),Rt=mt.sign(JSON.stringify({t:"".concat(new Date().getTime())}),It),pt="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),Vt="",Ht={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:ct,channel:Dt,clientCode:"0",antiRushInfo:Rt}},$t.next=12,_e({host:"https://ms.jr.jd.com",type:"post",path:pt,config:{withCredentials:!0},data:Ht});case 12:(kt=$t.sent).resultCode===0&&kt.resultData&&kt.resultData.code==="00000"&&kt.resultData.data&&(Vt=kt.resultData.data.goldenKeyText),lt&<(Vt?{code:"0",msg:"command success",data:Vt}:{code:"-1",msg:"command empty"});case 15:case"end":return $t.stop()}}),V)})),ht=function(){var V=this,At=arguments;return new Promise((function(ct,Dt){var lt=_.apply(V,At);function mt(Rt){at(lt,ct,Dt,mt,It,"next",Rt)}function It(Rt){at(lt,ct,Dt,mt,It,"throw",Rt)}mt(void 0)}))},ht.apply(this,arguments)}function ot(_){return ot=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},ot(_)}function k(){k=function(){return V};var _,V={},At=Object.prototype,ct=At.hasOwnProperty,Dt=Object.defineProperty||function(d,l,y){d[l]=y.value},lt=typeof Symbol=="function"?Symbol:{},mt=lt.iterator||"@@iterator",It=lt.asyncIterator||"@@asyncIterator",Rt=lt.toStringTag||"@@toStringTag";function pt(d,l,y){return Object.defineProperty(d,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),d[l]}try{pt({},"")}catch(d){pt=function(l,y,F){return l[y]=F}}function Vt(d,l,y,F){var D=l&&l.prototype instanceof ie?l:ie,U=Object.create(D.prototype),nt=new ce(F||[]);return Dt(U,"_invoke",{value:Ot(d,y,nt)}),U}function Ht(d,l,y){try{return{type:"normal",arg:d.call(l,y)}}catch(F){return{type:"throw",arg:F}}}V.wrap=Vt;var kt="suspendedStart",$t="suspendedYield",Gt="executing",Pt="completed",wt={};function ie(){}function ne(){}function Mt(){}var ae={};pt(ae,mt,(function(){return this}));var oe=Object.getPrototypeOf,Lt=oe&&oe(oe(ee([])));Lt&&Lt!==At&&ct.call(Lt,mt)&&(ae=Lt);var Jt=Mt.prototype=ie.prototype=Object.create(ae);function he(d){["next","throw","return"].forEach((function(l){pt(d,l,(function(y){return this._invoke(l,y)}))}))}function zt(d,l){function y(D,U,nt,vt){var yt=Ht(d[D],d,U);if(yt.type!=="throw"){var Xt=yt.arg,Qt=Xt.value;return Qt&&ot(Qt)=="object"&&ct.call(Qt,"__await")?l.resolve(Qt.__await).then((function(Et){y("next",Et,nt,vt)}),(function(Et){y("throw",Et,nt,vt)})):l.resolve(Qt).then((function(Et){Xt.value=Et,nt(Xt)}),(function(Et){return y("throw",Et,nt,vt)}))}vt(yt.arg)}var F;Dt(this,"_invoke",{value:function(D,U){function nt(){return new l((function(vt,yt){y(D,U,vt,yt)}))}return F=F?F.then(nt,nt):nt()}})}function Ot(d,l,y){var F=kt;return function(D,U){if(F===Gt)throw Error("Generator is already running");if(F===Pt){if(D==="throw")throw U;return{value:_,done:!0}}for(y.method=D,y.arg=U;;){var nt=y.delegate;if(nt){var vt=Ut(nt,y);if(vt){if(vt===wt)continue;return vt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(F===kt)throw F=Pt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);F=Gt;var yt=Ht(d,l,y);if(yt.type==="normal"){if(F=y.done?Pt:$t,yt.arg===wt)continue;return{value:yt.arg,done:y.done}}yt.type==="throw"&&(F=Pt,y.method="throw",y.arg=yt.arg)}}}function Ut(d,l){var y=l.method,F=d.iterator[y];if(F===_)return l.delegate=null,y==="throw"&&d.iterator.return&&(l.method="return",l.arg=_,Ut(d,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),wt;var D=Ht(F,d.iterator,l.arg);if(D.type==="throw")return l.method="throw",l.arg=D.arg,l.delegate=null,wt;var U=D.arg;return U?U.done?(l[d.resultName]=U.value,l.next=d.nextLoc,l.method!=="return"&&(l.method="next",l.arg=_),l.delegate=null,wt):U:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,wt)}function te(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 ue(d){var l=d.completion||{};l.type="normal",delete l.arg,d.completion=l}function ce(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(te,this),this.reset(!0)}function ee(d){if(d||d===""){var l=d[mt];if(l)return l.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var y=-1,F=function D(){for(;++y<d.length;)if(ct.call(d,y))return D.value=d[y],D.done=!1,D;return D.value=_,D.done=!0,D};return F.next=F}}throw new TypeError(ot(d)+" is not iterable")}return ne.prototype=Mt,Dt(Jt,"constructor",{value:Mt,configurable:!0}),Dt(Mt,"constructor",{value:ne,configurable:!0}),ne.displayName=pt(Mt,Rt,"GeneratorFunction"),V.isGeneratorFunction=function(d){var l=typeof d=="function"&&d.constructor;return!!l&&(l===ne||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,Mt):(d.__proto__=Mt,pt(d,Rt,"GeneratorFunction")),d.prototype=Object.create(Jt),d},V.awrap=function(d){return{__await:d}},he(zt.prototype),pt(zt.prototype,It,(function(){return this})),V.AsyncIterator=zt,V.async=function(d,l,y,F,D){D===void 0&&(D=Promise);var U=new zt(Vt(d,l,y,F),D);return V.isGeneratorFunction(l)?U:U.next().then((function(nt){return nt.done?nt.value:U.next()}))},he(Jt),pt(Jt,Rt,"Generator"),pt(Jt,mt,(function(){return this})),pt(Jt,"toString",(function(){return"[object Generator]"})),V.keys=function(d){var l=Object(d),y=[];for(var F in l)y.push(F);return y.reverse(),function D(){for(;y.length;){var U=y.pop();if(U in l)return D.value=U,D.done=!1,D}return D.done=!0,D}},V.values=ee,ce.prototype={constructor:ce,reset:function(d){if(this.prev=0,this.next=0,this.sent=this._sent=_,this.done=!1,this.delegate=null,this.method="next",this.arg=_,this.tryEntries.forEach(ue),!d)for(var l in this)l.charAt(0)==="t"&&ct.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=_)},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 y(yt,Xt){return U.type="throw",U.arg=d,l.next=yt,Xt&&(l.method="next",l.arg=_),!!Xt}for(var F=this.tryEntries.length-1;F>=0;--F){var D=this.tryEntries[F],U=D.completion;if(D.tryLoc==="root")return y("end");if(D.tryLoc<=this.prev){var nt=ct.call(D,"catchLoc"),vt=ct.call(D,"finallyLoc");if(nt&&vt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0);if(this.prev<D.finallyLoc)return y(D.finallyLoc)}else if(nt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0)}else{if(!vt)throw Error("try statement without catch or finally");if(this.prev<D.finallyLoc)return y(D.finallyLoc)}}}},abrupt:function(d,l){for(var y=this.tryEntries.length-1;y>=0;--y){var F=this.tryEntries[y];if(F.tryLoc<=this.prev&&ct.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var D=F;break}}D&&(d==="break"||d==="continue")&&D.tryLoc<=l&&l<=D.finallyLoc&&(D=null);var U=D?D.completion:{};return U.type=d,U.arg=l,D?(this.method="next",this.next=D.finallyLoc,wt):this.complete(U)},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),wt},finish:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===d)return this.complete(y.completion,y.afterLoc),ue(y),wt}},catch:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===d){var F=y.completion;if(F.type==="throw"){var D=F.arg;ue(y)}return D}}throw Error("illegal catch attempt")},delegateYield:function(d,l,y){return this.delegate={iterator:ee(d),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=_),wt}},V}function Tt(_,V,At,ct,Dt,lt,mt){try{var It=_[lt](mt),Rt=It.value}catch(pt){return void At(pt)}It.done?V(Rt):Promise.resolve(Rt).then(ct,Dt)}function S(_){return b.apply(this,arguments)}function b(){var _;return _=k().mark((function V(At){var ct,Dt,lt;return k().wrap((function(mt){for(;;)switch(mt.prev=mt.next){case 0:return ct=At.url,Dt=At.channel,lt=At.callback,mt.next=3,Z({url:ct,channel:Dt,callback:lt});case 3:case"end":return mt.stop()}}),V)})),b=function(){var V=this,At=arguments;return new Promise((function(ct,Dt){var lt=_.apply(V,At);function mt(Rt){Tt(lt,ct,Dt,mt,It,"next",Rt)}function It(Rt){Tt(lt,ct,Dt,mt,It,"throw",Rt)}mt(void 0)}))},b.apply(this,arguments)}var m={getJrCommand:S};(g=P.hmd(g)).exports&&(g.exports=m,g.exports.getJrCommand=S),typeof window!="undefined"&&(window.LyyGetCommandSDK=m);let C=m},307:function(g,R,P){var B,q,rt;function at(Q){return at=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},at(Q)}rt=function(){"use strict";function Q(t){return(Q=typeof Symbol=="function"&&at(Symbol.iterator)=="symbol"?function(r){return at(r)}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":at(r)})(t)}function $(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _e(t,r){for(var s=0;s<r.length;s++){var c=r[s];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function I(t,r,s){return r&&_e(t.prototype,r),s&&_e(t,s),t}function Z(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&&ot(t,r)}function ht(t){return(ht=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(t)}function ot(t,r){return(ot=Object.setPrototypeOf||function(s,c){return s.__proto__=c,s})(t,r)}function k(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(s){return!1}})();return function(){var s,c=ht(t);return(function(p,h){if(h&&(at(h)=="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E})(p)})(this,r?(s=ht(this).constructor,Reflect.construct(c,arguments,s)):c.apply(this,arguments))}}function Tt(t){return(function(r){if(Array.isArray(r))return S(r)})(t)||(function(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)})(t)||(function(r,s){if(r){if(typeof r=="string")return S(r,s);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)?S(r,s):void 0}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function S(t,r){(r==null||r>t.length)&&(r=t.length);for(var s=0,c=new Array(r);s<r;s++)c[s]=t[s];return c}var b=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:P.g!==void 0?P.g:typeof self!="undefined"?self:{},m=!1,C=!1,_={console:!0,focus:!1,time:!1,length:!0,infinite:!1,time_interval:500,time_threshold:100,length_threshold:300},V=function(){typeof document!="undefined"&&document.hasFocus&&!document.hasFocus()&&(C=!0)},At=function(){var t=Date.now();Date.now()-t>_.time_threshold&&(C=!0)},ct=function(){var t=b.outerWidth,r=b.outerHeight,s=b.innerWidth,c=b.innerHeight;t&&r&&s&&c&&typeof t=="number"&&typeof r=="number"&&typeof s=="number"&&typeof c=="number"&&(t-s>_.length_threshold||r-c>_.length_threshold)&&(C=!0)};(Ot={}).start=function(t){if(!m){if(t
|
|
1
|
+
var hr=Object.defineProperty,fn=Object.defineProperties;var dn=Object.getOwnPropertyDescriptors;var pr=Object.getOwnPropertySymbols;var pn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable;var Ge=(o,a,u)=>a in o?hr(o,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):o[a]=u,gt=(o,a)=>{for(var u in a||(a={}))pn.call(a,u)&&Ge(o,u,a[u]);if(pr)for(var u of pr(a))hn.call(a,u)&&Ge(o,u,a[u]);return o},Zt=(o,a)=>fn(o,dn(a));var yn=(o,a)=>()=>(a||o((a={exports:{}}).exports,a),a.exports),Xe=(o,a)=>{for(var u in a)hr(o,u,{get:a[u],enumerable:!0})};var Ue=(o,a,u)=>Ge(o,typeof a!="symbol"?a+"":a,u);var Nr=yn((Po,Or)=>{"use strict";(()=>{var o={737:(g,R,P)=>{"use strict";P.r(R),P.d(R,{default:()=>C,getJrCommand:()=>S});var B=P(307),q=P.n(B);function rt(){rt=function(){return V};var _,V={},At=Object.prototype,ct=At.hasOwnProperty,Dt=Object.defineProperty||function(d,l,y){d[l]=y.value},lt=typeof Symbol=="function"?Symbol:{},mt=lt.iterator||"@@iterator",It=lt.asyncIterator||"@@asyncIterator",Rt=lt.toStringTag||"@@toStringTag";function pt(d,l,y){return Object.defineProperty(d,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),d[l]}try{pt({},"")}catch(d){pt=function(l,y,F){return l[y]=F}}function Vt(d,l,y,F){var D=l&&l.prototype instanceof ie?l:ie,U=Object.create(D.prototype),nt=new ce(F||[]);return Dt(U,"_invoke",{value:Ot(d,y,nt)}),U}function Ht(d,l,y){try{return{type:"normal",arg:d.call(l,y)}}catch(F){return{type:"throw",arg:F}}}V.wrap=Vt;var Jt="suspendedStart",zt="suspendedYield",Gt="executing",Pt="completed",wt={};function ie(){}function ne(){}function Mt(){}var ae={};pt(ae,mt,(function(){return this}));var oe=Object.getPrototypeOf,Lt=oe&&oe(oe(ee([])));Lt&&Lt!==At&&ct.call(Lt,mt)&&(ae=Lt);var kt=Mt.prototype=ie.prototype=Object.create(ae);function he(d){["next","throw","return"].forEach((function(l){pt(d,l,(function(y){return this._invoke(l,y)}))}))}function Qt(d,l){function y(D,U,nt,vt){var yt=Ht(d[D],d,U);if(yt.type!=="throw"){var Xt=yt.arg,$t=Xt.value;return $t&&$($t)=="object"&&ct.call($t,"__await")?l.resolve($t.__await).then((function(Et){y("next",Et,nt,vt)}),(function(Et){y("throw",Et,nt,vt)})):l.resolve($t).then((function(Et){Xt.value=Et,nt(Xt)}),(function(Et){return y("throw",Et,nt,vt)}))}vt(yt.arg)}var F;Dt(this,"_invoke",{value:function(D,U){function nt(){return new l((function(vt,yt){y(D,U,vt,yt)}))}return F=F?F.then(nt,nt):nt()}})}function Ot(d,l,y){var F=Jt;return function(D,U){if(F===Gt)throw Error("Generator is already running");if(F===Pt){if(D==="throw")throw U;return{value:_,done:!0}}for(y.method=D,y.arg=U;;){var nt=y.delegate;if(nt){var vt=Ut(nt,y);if(vt){if(vt===wt)continue;return vt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(F===Jt)throw F=Pt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);F=Gt;var yt=Ht(d,l,y);if(yt.type==="normal"){if(F=y.done?Pt:zt,yt.arg===wt)continue;return{value:yt.arg,done:y.done}}yt.type==="throw"&&(F=Pt,y.method="throw",y.arg=yt.arg)}}}function Ut(d,l){var y=l.method,F=d.iterator[y];if(F===_)return l.delegate=null,y==="throw"&&d.iterator.return&&(l.method="return",l.arg=_,Ut(d,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),wt;var D=Ht(F,d.iterator,l.arg);if(D.type==="throw")return l.method="throw",l.arg=D.arg,l.delegate=null,wt;var U=D.arg;return U?U.done?(l[d.resultName]=U.value,l.next=d.nextLoc,l.method!=="return"&&(l.method="next",l.arg=_),l.delegate=null,wt):U:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,wt)}function te(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 ue(d){var l=d.completion||{};l.type="normal",delete l.arg,d.completion=l}function ce(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(te,this),this.reset(!0)}function ee(d){if(d||d===""){var l=d[mt];if(l)return l.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var y=-1,F=function D(){for(;++y<d.length;)if(ct.call(d,y))return D.value=d[y],D.done=!1,D;return D.value=_,D.done=!0,D};return F.next=F}}throw new TypeError($(d)+" is not iterable")}return ne.prototype=Mt,Dt(kt,"constructor",{value:Mt,configurable:!0}),Dt(Mt,"constructor",{value:ne,configurable:!0}),ne.displayName=pt(Mt,Rt,"GeneratorFunction"),V.isGeneratorFunction=function(d){var l=typeof d=="function"&&d.constructor;return!!l&&(l===ne||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,Mt):(d.__proto__=Mt,pt(d,Rt,"GeneratorFunction")),d.prototype=Object.create(kt),d},V.awrap=function(d){return{__await:d}},he(Qt.prototype),pt(Qt.prototype,It,(function(){return this})),V.AsyncIterator=Qt,V.async=function(d,l,y,F,D){D===void 0&&(D=Promise);var U=new Qt(Vt(d,l,y,F),D);return V.isGeneratorFunction(l)?U:U.next().then((function(nt){return nt.done?nt.value:U.next()}))},he(kt),pt(kt,Rt,"Generator"),pt(kt,mt,(function(){return this})),pt(kt,"toString",(function(){return"[object Generator]"})),V.keys=function(d){var l=Object(d),y=[];for(var F in l)y.push(F);return y.reverse(),function D(){for(;y.length;){var U=y.pop();if(U in l)return D.value=U,D.done=!1,D}return D.done=!0,D}},V.values=ee,ce.prototype={constructor:ce,reset:function(d){if(this.prev=0,this.next=0,this.sent=this._sent=_,this.done=!1,this.delegate=null,this.method="next",this.arg=_,this.tryEntries.forEach(ue),!d)for(var l in this)l.charAt(0)==="t"&&ct.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=_)},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 y(yt,Xt){return U.type="throw",U.arg=d,l.next=yt,Xt&&(l.method="next",l.arg=_),!!Xt}for(var F=this.tryEntries.length-1;F>=0;--F){var D=this.tryEntries[F],U=D.completion;if(D.tryLoc==="root")return y("end");if(D.tryLoc<=this.prev){var nt=ct.call(D,"catchLoc"),vt=ct.call(D,"finallyLoc");if(nt&&vt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0);if(this.prev<D.finallyLoc)return y(D.finallyLoc)}else if(nt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0)}else{if(!vt)throw Error("try statement without catch or finally");if(this.prev<D.finallyLoc)return y(D.finallyLoc)}}}},abrupt:function(d,l){for(var y=this.tryEntries.length-1;y>=0;--y){var F=this.tryEntries[y];if(F.tryLoc<=this.prev&&ct.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var D=F;break}}D&&(d==="break"||d==="continue")&&D.tryLoc<=l&&l<=D.finallyLoc&&(D=null);var U=D?D.completion:{};return U.type=d,U.arg=l,D?(this.method="next",this.next=D.finallyLoc,wt):this.complete(U)},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),wt},finish:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===d)return this.complete(y.completion,y.afterLoc),ue(y),wt}},catch:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===d){var F=y.completion;if(F.type==="throw"){var D=F.arg;ue(y)}return D}}throw Error("illegal catch attempt")},delegateYield:function(d,l,y){return this.delegate={iterator:ee(d),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=_),wt}},V}function at(_,V,At,ct,Dt,lt,mt){try{var It=_[lt](mt),Rt=It.value}catch(pt){return void At(pt)}It.done?V(Rt):Promise.resolve(Rt).then(ct,Dt)}function $(_){return $=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},$(_)}var z="https://ms.jr.jd.com";function _e(_){var V=_.host,At=_.type,ct=At===void 0?"post":At,Dt=_.data,lt=_.path,mt=lt===void 0?"":lt,It=_.config,Rt=It===void 0?{}:It,pt=(Rt.withCredentials,Rt.isWG),Vt=pt===void 0||pt,Ht=Rt.contentType,Jt=Ht===void 0?"application/x-www-form-urlencoded":Ht;return new Promise((function(zt,Gt){wx.request({url:(V||z)+mt,method:ct.toUpperCase(),data:Vt?I({reqData:JSON.stringify(Dt)}):Dt,header:{"content-type":Jt},success:function(Pt){Pt.statusCode===200?zt(Pt.data):Gt({statusCode:Pt.statusCode,errMsg:Pt.errMsg,data:Pt.data})},fail:function(Pt){Gt(Pt)}})}))}function I(_){var V="";return $(_)==="object"&&_!==null&&(Object.keys(_).map((function(At){var ct=_[At];return V+=At+"="+encodeURIComponent(ct)+"&",""})),V.length>0&&(V=V.substr(0,V.length-1))),V}function Z(_){return ht.apply(this,arguments)}function ht(){var _;return _=rt().mark((function V(At){var ct,Dt,lt,mt,It,Rt,pt,Vt,Ht,Jt;return rt().wrap((function(zt){for(;;)switch(zt.prev=zt.next){case 0:return ct=At.url,Dt=At.channel,lt=At.callback,q().init(),mt=new(q()),It=mt.nonce(),Rt=mt.sign(JSON.stringify({t:"".concat(new Date().getTime())}),It),pt="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),Vt="",Ht={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:ct,channel:Dt,clientCode:"0",antiRushInfo:Rt}},zt.next=12,_e({host:"https://ms.jr.jd.com",type:"post",path:pt,config:{withCredentials:!0},data:Ht});case 12:(Jt=zt.sent).resultCode===0&&Jt.resultData&&Jt.resultData.code==="00000"&&Jt.resultData.data&&(Vt=Jt.resultData.data.goldenKeyText),lt&<(Vt?{code:"0",msg:"command success",data:Vt}:{code:"-1",msg:"command empty"});case 15:case"end":return zt.stop()}}),V)})),ht=function(){var V=this,At=arguments;return new Promise((function(ct,Dt){var lt=_.apply(V,At);function mt(Rt){at(lt,ct,Dt,mt,It,"next",Rt)}function It(Rt){at(lt,ct,Dt,mt,It,"throw",Rt)}mt(void 0)}))},ht.apply(this,arguments)}function ot(_){return ot=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},ot(_)}function J(){J=function(){return V};var _,V={},At=Object.prototype,ct=At.hasOwnProperty,Dt=Object.defineProperty||function(d,l,y){d[l]=y.value},lt=typeof Symbol=="function"?Symbol:{},mt=lt.iterator||"@@iterator",It=lt.asyncIterator||"@@asyncIterator",Rt=lt.toStringTag||"@@toStringTag";function pt(d,l,y){return Object.defineProperty(d,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),d[l]}try{pt({},"")}catch(d){pt=function(l,y,F){return l[y]=F}}function Vt(d,l,y,F){var D=l&&l.prototype instanceof ie?l:ie,U=Object.create(D.prototype),nt=new ce(F||[]);return Dt(U,"_invoke",{value:Ot(d,y,nt)}),U}function Ht(d,l,y){try{return{type:"normal",arg:d.call(l,y)}}catch(F){return{type:"throw",arg:F}}}V.wrap=Vt;var Jt="suspendedStart",zt="suspendedYield",Gt="executing",Pt="completed",wt={};function ie(){}function ne(){}function Mt(){}var ae={};pt(ae,mt,(function(){return this}));var oe=Object.getPrototypeOf,Lt=oe&&oe(oe(ee([])));Lt&&Lt!==At&&ct.call(Lt,mt)&&(ae=Lt);var kt=Mt.prototype=ie.prototype=Object.create(ae);function he(d){["next","throw","return"].forEach((function(l){pt(d,l,(function(y){return this._invoke(l,y)}))}))}function Qt(d,l){function y(D,U,nt,vt){var yt=Ht(d[D],d,U);if(yt.type!=="throw"){var Xt=yt.arg,$t=Xt.value;return $t&&ot($t)=="object"&&ct.call($t,"__await")?l.resolve($t.__await).then((function(Et){y("next",Et,nt,vt)}),(function(Et){y("throw",Et,nt,vt)})):l.resolve($t).then((function(Et){Xt.value=Et,nt(Xt)}),(function(Et){return y("throw",Et,nt,vt)}))}vt(yt.arg)}var F;Dt(this,"_invoke",{value:function(D,U){function nt(){return new l((function(vt,yt){y(D,U,vt,yt)}))}return F=F?F.then(nt,nt):nt()}})}function Ot(d,l,y){var F=Jt;return function(D,U){if(F===Gt)throw Error("Generator is already running");if(F===Pt){if(D==="throw")throw U;return{value:_,done:!0}}for(y.method=D,y.arg=U;;){var nt=y.delegate;if(nt){var vt=Ut(nt,y);if(vt){if(vt===wt)continue;return vt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(F===Jt)throw F=Pt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);F=Gt;var yt=Ht(d,l,y);if(yt.type==="normal"){if(F=y.done?Pt:zt,yt.arg===wt)continue;return{value:yt.arg,done:y.done}}yt.type==="throw"&&(F=Pt,y.method="throw",y.arg=yt.arg)}}}function Ut(d,l){var y=l.method,F=d.iterator[y];if(F===_)return l.delegate=null,y==="throw"&&d.iterator.return&&(l.method="return",l.arg=_,Ut(d,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),wt;var D=Ht(F,d.iterator,l.arg);if(D.type==="throw")return l.method="throw",l.arg=D.arg,l.delegate=null,wt;var U=D.arg;return U?U.done?(l[d.resultName]=U.value,l.next=d.nextLoc,l.method!=="return"&&(l.method="next",l.arg=_),l.delegate=null,wt):U:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,wt)}function te(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 ue(d){var l=d.completion||{};l.type="normal",delete l.arg,d.completion=l}function ce(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(te,this),this.reset(!0)}function ee(d){if(d||d===""){var l=d[mt];if(l)return l.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var y=-1,F=function D(){for(;++y<d.length;)if(ct.call(d,y))return D.value=d[y],D.done=!1,D;return D.value=_,D.done=!0,D};return F.next=F}}throw new TypeError(ot(d)+" is not iterable")}return ne.prototype=Mt,Dt(kt,"constructor",{value:Mt,configurable:!0}),Dt(Mt,"constructor",{value:ne,configurable:!0}),ne.displayName=pt(Mt,Rt,"GeneratorFunction"),V.isGeneratorFunction=function(d){var l=typeof d=="function"&&d.constructor;return!!l&&(l===ne||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,Mt):(d.__proto__=Mt,pt(d,Rt,"GeneratorFunction")),d.prototype=Object.create(kt),d},V.awrap=function(d){return{__await:d}},he(Qt.prototype),pt(Qt.prototype,It,(function(){return this})),V.AsyncIterator=Qt,V.async=function(d,l,y,F,D){D===void 0&&(D=Promise);var U=new Qt(Vt(d,l,y,F),D);return V.isGeneratorFunction(l)?U:U.next().then((function(nt){return nt.done?nt.value:U.next()}))},he(kt),pt(kt,Rt,"Generator"),pt(kt,mt,(function(){return this})),pt(kt,"toString",(function(){return"[object Generator]"})),V.keys=function(d){var l=Object(d),y=[];for(var F in l)y.push(F);return y.reverse(),function D(){for(;y.length;){var U=y.pop();if(U in l)return D.value=U,D.done=!1,D}return D.done=!0,D}},V.values=ee,ce.prototype={constructor:ce,reset:function(d){if(this.prev=0,this.next=0,this.sent=this._sent=_,this.done=!1,this.delegate=null,this.method="next",this.arg=_,this.tryEntries.forEach(ue),!d)for(var l in this)l.charAt(0)==="t"&&ct.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=_)},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 y(yt,Xt){return U.type="throw",U.arg=d,l.next=yt,Xt&&(l.method="next",l.arg=_),!!Xt}for(var F=this.tryEntries.length-1;F>=0;--F){var D=this.tryEntries[F],U=D.completion;if(D.tryLoc==="root")return y("end");if(D.tryLoc<=this.prev){var nt=ct.call(D,"catchLoc"),vt=ct.call(D,"finallyLoc");if(nt&&vt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0);if(this.prev<D.finallyLoc)return y(D.finallyLoc)}else if(nt){if(this.prev<D.catchLoc)return y(D.catchLoc,!0)}else{if(!vt)throw Error("try statement without catch or finally");if(this.prev<D.finallyLoc)return y(D.finallyLoc)}}}},abrupt:function(d,l){for(var y=this.tryEntries.length-1;y>=0;--y){var F=this.tryEntries[y];if(F.tryLoc<=this.prev&&ct.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var D=F;break}}D&&(d==="break"||d==="continue")&&D.tryLoc<=l&&l<=D.finallyLoc&&(D=null);var U=D?D.completion:{};return U.type=d,U.arg=l,D?(this.method="next",this.next=D.finallyLoc,wt):this.complete(U)},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),wt},finish:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===d)return this.complete(y.completion,y.afterLoc),ue(y),wt}},catch:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===d){var F=y.completion;if(F.type==="throw"){var D=F.arg;ue(y)}return D}}throw Error("illegal catch attempt")},delegateYield:function(d,l,y){return this.delegate={iterator:ee(d),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=_),wt}},V}function Tt(_,V,At,ct,Dt,lt,mt){try{var It=_[lt](mt),Rt=It.value}catch(pt){return void At(pt)}It.done?V(Rt):Promise.resolve(Rt).then(ct,Dt)}function S(_){return b.apply(this,arguments)}function b(){var _;return _=J().mark((function V(At){var ct,Dt,lt;return J().wrap((function(mt){for(;;)switch(mt.prev=mt.next){case 0:return ct=At.url,Dt=At.channel,lt=At.callback,mt.next=3,Z({url:ct,channel:Dt,callback:lt});case 3:case"end":return mt.stop()}}),V)})),b=function(){var V=this,At=arguments;return new Promise((function(ct,Dt){var lt=_.apply(V,At);function mt(Rt){Tt(lt,ct,Dt,mt,It,"next",Rt)}function It(Rt){Tt(lt,ct,Dt,mt,It,"throw",Rt)}mt(void 0)}))},b.apply(this,arguments)}var m={getJrCommand:S};(g=P.hmd(g)).exports&&(g.exports=m,g.exports.getJrCommand=S),typeof window!="undefined"&&(window.LyyGetCommandSDK=m);let C=m},307:function(g,R,P){var B,q,rt;function at($){return at=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},at($)}rt=function(){"use strict";function $(t){return($=typeof Symbol=="function"&&at(Symbol.iterator)=="symbol"?function(r){return at(r)}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":at(r)})(t)}function z(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _e(t,r){for(var s=0;s<r.length;s++){var c=r[s];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function I(t,r,s){return r&&_e(t.prototype,r),s&&_e(t,s),t}function Z(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&&ot(t,r)}function ht(t){return(ht=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(t)}function ot(t,r){return(ot=Object.setPrototypeOf||function(s,c){return s.__proto__=c,s})(t,r)}function J(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(s){return!1}})();return function(){var s,c=ht(t);return(function(p,h){if(h&&(at(h)=="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E})(p)})(this,r?(s=ht(this).constructor,Reflect.construct(c,arguments,s)):c.apply(this,arguments))}}function Tt(t){return(function(r){if(Array.isArray(r))return S(r)})(t)||(function(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)})(t)||(function(r,s){if(r){if(typeof r=="string")return S(r,s);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)?S(r,s):void 0}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function S(t,r){(r==null||r>t.length)&&(r=t.length);for(var s=0,c=new Array(r);s<r;s++)c[s]=t[s];return c}var b=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:P.g!==void 0?P.g:typeof self!="undefined"?self:{},m=!1,C=!1,_={console:!0,focus:!1,time:!1,length:!0,infinite:!1,time_interval:500,time_threshold:100,length_threshold:300},V=function(){typeof document!="undefined"&&document.hasFocus&&!document.hasFocus()&&(C=!0)},At=function(){var t=Date.now();Date.now()-t>_.time_threshold&&(C=!0)},ct=function(){var t=b.outerWidth,r=b.outerHeight,s=b.innerWidth,c=b.innerHeight;t&&r&&s&&c&&typeof t=="number"&&typeof r=="number"&&typeof s=="number"&&typeof c=="number"&&(t-s>_.length_threshold||r-c>_.length_threshold)&&(C=!0)};(Ot={}).start=function(t){if(!m){if(t&&$(t)==="object")for(var r in t)_[r]=t[r];var s;_.infinite&&(typeof window!="undefined"&&Object.prototype.toString.call(window)==="[object Window]"?typeof Function!="undefined"&&Function.constructor!==void 0&&/Function[^]*\[native code\]/.test(""+Function.constructor)&&typeof setInterval!="undefined"&&/setInterval[^]*\[native code\]/.test(""+setInterval)?new Function('setInterval(function(){!/Function[^]*[native code]/.test("" + Function.constructor) ? function(){while(1);}() : new Function("debugger")(); }, 100);')():C=!0:setInterval((function(){}),100)),_.console&&(function(){var c=new Date;c.toString=function(){for(var p=Date.now();;)if(10<Date.now()-p)return Date.now()},console.log(c),c.toString=function(){return C=!0,Date.now()}})(),_.focus&&V(),_.time&&At(),_.length&&ct(),s=setInterval((function(){s&&C&&clearInterval(s),_.focus&&V(),_.time&&At(),_.length&&ct()}),_.time_interval),m=!0}},Ot.isDebug=function(){return C};var Dt=Ot,lt=".123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-!",mt={my_b4_encode:function(t){var r=0,s=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<s;r++)t[t.length]=0;var c="";for(j=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
|
|
3
3
|
`),c+=lt[t[j]>>2]+lt[(3&t[j])<<4|t[j+1]>>4]+lt[(15&t[j+1])<<2|t[j+2]>>6]+lt[63&t[j+2]];for(r=0;r<s;r++)c+=lt[64];return c},my_b4_decode:function(t){var r=0,s=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)!=lt[64])return null;var p,h,E,O,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)p=lt.indexOf(t.charAt(r++)),h=lt.indexOf(t.charAt(r++)),E=lt.indexOf(t.charAt(r++)),O=lt.indexOf(t.charAt(r++)),w[s++]=p<<2|h>>4,w[s++]=(15&h)<<4|E>>2,w[s++]=(3&E)<<6|O;for(r=0;r<c;r++)if(w.pop()!=0)return null;return w}},It="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Rt={b4_encode:function(t){var r=0,s=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<s;r++)t[t.length]=0;var c="";for(r=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
|
|
4
|
-
`),c+=It[t[j]>>2]+It[(3&t[j])<<4|t[j+1]>>4]+It[(15&t[j+1])<<2|t[j+2]>>6]+It[63&t[j+2]];for(r=0;r<s;r++)c+="=";return c},b4_decode:function(t){var r=0,s=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 p,h,E,O,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)p=It.indexOf(t.charAt(r++)),h=It.indexOf(t.charAt(r++)),E=It.indexOf(t.charAt(r++)),O=It.indexOf(t.charAt(r++)),w[s++]=p<<2|h>>4,w[s++]=(15&h)<<4|E>>2,w[s++]=(3&E)<<6|O;for(r=0;r<c;r++)if(w.pop()!=0)return null;return w}};function pt(){}pt.encode=function(t,r,s){for(var c=new Array(2*s),p=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),h=r,E=0;h<s+r;h++,E++)c[E]=p[(255&t[h])>>4],c[++E]=p[15&t[h]];return c.join("")},pt.decode=function(t){if(t==null||t==""||t.length%2!=0)return null;for(var r=t.length/2,s=pt.toCharCodeArray(t),c=new Array(r),p=0;p<r;p++){if(48<=s[2*p]&&s[2*p]<=57)c[p]=s[2*p]-48<<4;else if(65<=s[2*p]&&s[2*p]<=70)c[p]=s[2*p]-65+10<<4;else{if(!(97<=s[2*p]&&s[2*p]<=102))return null;c[p]=s[2*p]-97+10<<4}if(48<=s[2*p+1]&&s[2*p+1]<=57)c[p]=c[p]|s[2*p+1]-48;else if(65<=s[2*p+1]&&s[2*p+1]<=70)c[p]=c[p]|s[2*p+1]-65+10;else{if(!(97<=s[2*p+1]&&s[2*p+1]<=102))return null;c[p]=c[p]|s[2*p+1]-97+10}}return c},pt.toCharCodeArray=function(t){for(var r=new Array(t.length),s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r};var Vt=pt,Ht=Vt;(Ut=function(){}).utf8StrToh6=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],p=0;p<s;p++)c[p]=r.charCodeAt(p).toString(16);return c.join("")},Ut.utf8StrToBytes=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],p=0;p<s;p++)c[p]=r.charCodeAt(p);return c},Ut.hexToUtf8Str=function(t){for(var r=Ht.decode(t),s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.bytesToUtf8Str=function(t){for(var r=t,s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.intToByte=function(t){return new Array(t>>24&255,t>>16&255,t>>8&255,255&t)},Ut.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 kt,$t=Ut,Gt={exports:{}};kt=Gt,function(){function t(e,n,i){e!=null&&(typeof e=="number"?this.fromNumber(e,n,i):n==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,n))}function r(){return new t(null)}var s=(s=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(t.prototype.am=function(e,n,i,f,A,N){for(var M=32767&n,L=n>>15;0<=--N;){var Ft=32767&this[e],Kt=this[e++]>>15,se=L*Ft+Kt*M;A=((Ft=M*Ft+((32767&se)<<15)+i[f]+(1073741823&A))>>>30)+(se>>>15)+L*Kt+(A>>>30),i[f++]=1073741823&Ft}return A},30):s&&navigator.appName!="Netscape"?(t.prototype.am=function(e,n,i,f,A,N){for(;0<=--N;){var M=n*this[e++]+i[f]+A;A=Math.floor(M/67108864),i[f++]=67108863&M}return A},26):(t.prototype.am=function(e,n,i,f,A,N){for(var M=16383&n,L=n>>14;0<=--N;){var Ft=16383&this[e],Kt=this[e++]>>14,se=L*Ft+Kt*M;A=((Ft=M*Ft+((16383&se)<<14)+i[f]+A)>>28)+(se>>14)+L*Kt,i[f++]=268435455&Ft}return A},28);t.prototype.DB=s,t.prototype.DM=(1<<s)-1,t.prototype.DV=1<<s,t.prototype.FV=Math.pow(2,52),t.prototype.F1=52-s,t.prototype.F2=2*s-52;for(var c=new Array,p=48,h=0;h<=9;++h)c[p++]=h;for(p=97,h=10;h<36;++h)c[p++]=h;for(p=65,h=10;h<36;++h)c[p++]=h;function E(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function O(e,n){return(e=c[e.charCodeAt(n)])==null?-1:e}function w(e){var n=r();return n.fromInt(e),n}function it(e){var n,i=1;return(n=e>>>16)!=0&&(e=n,i+=16),(n=e>>8)!=0&&(e=n,i+=8),(n=e>>4)!=0&&(e=n,i+=4),(n=e>>2)!=0&&(e=n,i+=2),(n=e>>1)!=0&&(e=n,i+=1),i}function st(e){this.m=e}function T(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function H(e,n){return e&n}function tt(e,n){return e|n}function z(e,n){return e^n}function ut(e,n){return e&~n}function dt(){}function Ct(e){return e}function Y(e){this.r2=r(),this.q3=r(),t.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}st.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},st.prototype.revert=function(e){return e},st.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},st.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i),this.reduce(i)},st.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},T.prototype.convert=function(e){var n=r();return e.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),e.s<0&&0<n.compareTo(t.ZERO)&&this.m.subTo(n,n),n},T.prototype.revert=function(e){var n=r();return e.copyTo(n),this.reduce(n),n},T.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var n=0;n<this.m.t;++n){var i=32767&e[n],f=i*this.mpl+((i*this.mph+(e[n]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[i=n+this.m.t]+=this.m.am(0,f,e,n,0,this.m.t);e[i]>=e.DV;)e[i]-=e.DV,e[++i]++}e.clamp(),e.drShiftTo(this.m.t,e),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},T.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i),this.reduce(i)},T.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},t.prototype.copyTo=function(e){for(var n=this.t-1;0<=n;--n)e[n]=this[n];e.t=this.t,e.s=this.s},t.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0<e?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},t.prototype.fromString=function(e,n){var i;if(n==16)i=4;else if(n==8)i=3;else if(n==256)i=8;else if(n==2)i=1;else if(n==32)i=5;else{if(n!=4)return void this.fromRadix(e,n);i=2}this.t=0,this.s=0;for(var f=e.length,A=!1,N=0;0<=--f;){var M=i==8?255&e[f]:O(e,f);M<0?e.charAt(f)=="-"&&(A=!0):(A=!1,N==0?this[this.t++]=M:N+i>this.DB?(this[this.t-1]|=(M&(1<<this.DB-N)-1)<<N,this[this.t++]=M>>this.DB-N):this[this.t-1]|=M<<N,(N+=i)>=this.DB&&(N-=this.DB))}i==8&&128&e[0]&&(this.s=-1,0<N&&(this[this.t-1]|=(1<<this.DB-N)-1<<N)),this.clamp(),A&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var e=this.s&this.DM;0<this.t&&this[this.t-1]==e;)--this.t},t.prototype.dlShiftTo=function(e,n){for(var i=this.t-1;0<=i;--i)n[i+e]=this[i];for(i=e-1;0<=i;--i)n[i]=0;n.t=this.t+e,n.s=this.s},t.prototype.drShiftTo=function(e,n){for(var i=e;i<this.t;++i)n[i-e]=this[i];n.t=Math.max(this.t-e,0),n.s=this.s},t.prototype.lShiftTo=function(e,n){for(var i=e%this.DB,f=this.DB-i,A=(1<<f)-1,N=Math.floor(e/this.DB),M=this.s<<i&this.DM,L=this.t-1;0<=L;--L)n[L+N+1]=this[L]>>f|M,M=(this[L]&A)<<i;for(L=N-1;0<=L;--L)n[L]=0;n[N]=M,n.t=this.t+N+1,n.s=this.s,n.clamp()},t.prototype.rShiftTo=function(e,n){n.s=this.s;var i=Math.floor(e/this.DB);if(i>=this.t)n.t=0;else{var f=e%this.DB,A=this.DB-f,N=(1<<f)-1;n[0]=this[i]>>f;for(var M=i+1;M<this.t;++M)n[M-i-1]|=(this[M]&N)<<A,n[M-i]=this[M]>>f;0<f&&(n[this.t-i-1]|=(this.s&N)<<A),n.t=this.t-i,n.clamp()}},t.prototype.subTo=function(e,n){for(var i=0,f=0,A=Math.min(e.t,this.t);i<A;)f+=this[i]-e[i],n[i++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f-=e.s;i<this.t;)f+=this[i],n[i++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;i<e.t;)f-=e[i],n[i++]=f&this.DM,f>>=this.DB;f-=e.s}n.s=f<0?-1:0,f<-1?n[i++]=this.DV+f:0<f&&(n[i++]=f),n.t=i,n.clamp()},t.prototype.multiplyTo=function(e,n){var i=this.abs(),f=e.abs(),A=i.t;for(n.t=A+f.t;0<=--A;)n[A]=0;for(A=0;A<f.t;++A)n[A+i.t]=i.am(0,f[A],n,A,0,i.t);n.s=0,n.clamp(),this.s!=e.s&&t.ZERO.subTo(n,n)},t.prototype.squareTo=function(e){for(var n=this.abs(),i=e.t=2*n.t;0<=--i;)e[i]=0;for(i=0;i<n.t-1;++i){var f=n.am(i,n[i],e,2*i,0,1);(e[i+n.t]+=n.am(i+1,2*n[i],e,2*i+1,f,n.t-i-1))>=n.DV&&(e[i+n.t]-=n.DV,e[i+n.t+1]=1)}0<e.t&&(e[e.t-1]+=n.am(i,n[i],e,2*i,0,1)),e.s=0,e.clamp()},t.prototype.divRemTo=function(e,n,i){var f=e.abs();if(!(f.t<=0)){if((Kt=this.abs()).t<f.t)return n!=null&&n.fromInt(0),void(i!=null&&this.copyTo(i));i==null&&(i=r());var A=r(),N=this.s,M=e.s;0<(e=this.DB-it(f[f.t-1]))?(f.lShiftTo(e,A),Kt.lShiftTo(e,i)):(f.copyTo(A),Kt.copyTo(i));var L=A.t,Ft=A[L-1];if(Ft!=0){var Kt=Ft*(1<<this.F1)+(1<L?A[L-2]>>this.F2:0),se=this.FV/Kt,le=(1<<this.F1)/Kt,Re=1<<this.F2,qt=i.t,ge=qt-L,jt=n==null?r():n;for(A.dlShiftTo(ge,jt),0<=i.compareTo(jt)&&(i[i.t++]=1,i.subTo(jt,i)),t.ONE.dlShiftTo(L,jt),jt.subTo(A,A);A.t<L;)A[A.t++]=0;for(;0<=--ge;){var He=i[--qt]==Ft?this.DM:Math.floor(i[qt]*se+(i[qt-1]+Re)*le);if((i[qt]+=A.am(0,He,i,ge,0,L))<He)for(A.dlShiftTo(ge,jt),i.subTo(jt,i);i[qt]<--He;)i.subTo(jt,i)}n!=null&&(i.drShiftTo(L,n),N!=M&&t.ZERO.subTo(n,n)),i.t=L,i.clamp(),0<e&&i.rShiftTo(e,i),N<0&&t.ZERO.subTo(i,i)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var n=3&e;return 0<(n=(n=(n=(n=n*(2-(15&e)*n)&15)*(2-(255&e)*n)&255)*(2-((65535&e)*n&65535))&65535)*(2-e*n%this.DV)%this.DV)?this.DV-n:-n},t.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},t.prototype.exp=function(e,n){if(4294967295<e||e<1)return t.ONE;var i,f=r(),A=r(),N=n.convert(this),M=it(e)-1;for(N.copyTo(f);0<=--M;)n.sqrTo(f,A),0<(e&1<<M)?n.mulTo(A,N,f):(i=f,f=A,A=i);return n.revert(f)},t.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var n;if(e==16)n=4;else if(e==8)n=3;else if(e==2)n=1;else if(e==32)n=5;else{if(e!=4)return this.toRadix(e);n=2}var i,f=(1<<n)-1,A=!1,N="",M=this.t,L=this.DB-M*this.DB%n;if(0<M--)for(L<this.DB&&0<(i=this[M]>>L)&&(A=!0,N=E(i));0<=M;)L<n?(i=(this[M]&(1<<L)-1)<<n-L,i|=this[--M]>>(L+=this.DB-n)):(i=this[M]>>(L-=n)&f,L<=0&&(L+=this.DB,--M)),(A=0<i||A)&&(N+=E(i));return A?N:"0"},t.prototype.negate=function(){var e=r();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(e){var n=this.s-e.s;if(n!=0)return n;var i=this.t;if((n=i-e.t)!=0)return this.s<0?-n:n;for(;0<=--i;)if((n=this[i]-e[i])!=0)return n;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+it(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var n=r();return this.abs().divRemTo(e,null,n),this.s<0&&0<n.compareTo(t.ZERO)&&e.subTo(n,n),n},t.prototype.modPowInt=function(e,n){return n=new(e<256||n.isEven()?st:T)(n),this.exp(e,n)},t.ZERO=w(0),t.ONE=w(1),dt.prototype.convert=Ct,dt.prototype.revert=Ct,dt.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i)},dt.prototype.sqrTo=function(e,n){e.squareTo(n)},Y.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var n=r();return e.copyTo(n),this.reduce(n),n},Y.prototype.revert=function(e){return e},Y.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);0<=e.compareTo(this.m);)e.subTo(this.m,e)},Y.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i),this.reduce(i)},Y.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)};var X,J=[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],G=(1<<26)/J[J.length-1];function W(){var e;e=new Date().getTime(),_t[et++]^=255&e,_t[et++]^=e>>8&255,_t[et++]^=e>>16&255,_t[et++]^=e>>24&255,Ve<=et&&(et-=Ve)}if(t.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},t.prototype.toRadix=function(e){if(e==null&&(e=10),this.signum()==0||e<2||36<e)return"0";var n=this.chunkSize(e),i=Math.pow(e,n),f=w(i),A=r(),N=r(),M="";for(this.divRemTo(f,A,N);0<A.signum();)M=(i+N.intValue()).toString(e).substr(1)+M,A.divRemTo(f,A,N);return N.intValue().toString(e)+M},t.prototype.fromRadix=function(e,n){this.fromInt(0);for(var i=this.chunkSize(n=n==null?10:n),f=Math.pow(n,i),A=!1,N=0,M=0,L=0;L<e.length;++L){var Ft=O(e,L);Ft<0?e.charAt(L)=="-"&&this.signum()==0&&(A=!0):(M=n*M+Ft,++N>=i&&(this.dMultiply(f),this.dAddOffset(M,0),M=N=0))}0<N&&(this.dMultiply(Math.pow(n,N)),this.dAddOffset(M,0)),A&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,n,i){if(typeof n=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),tt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var f=new Array;i=7&e,f.length=1+(e>>3),n.nextBytes(f),0<i?f[0]&=(1<<i)-1:f[0]=0,this.fromString(f,256)}},t.prototype.bitwiseTo=function(e,n,i){for(var f,A=Math.min(e.t,this.t),N=0;N<A;++N)i[N]=n(this[N],e[N]);if(e.t<this.t){for(f=e.s&this.DM,N=A;N<this.t;++N)i[N]=n(this[N],f);i.t=this.t}else{for(f=this.s&this.DM,N=A;N<e.t;++N)i[N]=n(f,e[N]);i.t=e.t}i.s=n(this.s,e.s),i.clamp()},t.prototype.changeBit=function(e,n){return e=t.ONE.shiftLeft(e),this.bitwiseTo(e,n,e),e},t.prototype.addTo=function(e,n){for(var i=0,f=0,A=Math.min(e.t,this.t);i<A;)f+=this[i]+e[i],n[i++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f+=e.s;i<this.t;)f+=this[i],n[i++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;i<e.t;)f+=e[i],n[i++]=f&this.DM,f>>=this.DB;f+=e.s}n.s=f<0?-1:0,0<f?n[i++]=f:f<-1&&(n[i++]=this.DV+f),n.t=i,n.clamp()},t.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(e,n){if(e!=0){for(;this.t<=n;)this[this.t++]=0;for(this[n]+=e;this[n]>=this.DV;)this[n]-=this.DV,++n>=this.t&&(this[this.t++]=0),++this[n]}},t.prototype.multiplyLowerTo=function(e,n,i){var f,A=Math.min(this.t+e.t,n);for(i.s=0,i.t=A;0<A;)i[--A]=0;for(f=i.t-this.t;A<f;++A)i[A+this.t]=this.am(0,e[A],i,A,0,this.t);for(f=Math.min(e.t,n);A<f;++A)this.am(0,e[A],i,A,0,n-A);i.clamp()},t.prototype.multiplyUpperTo=function(e,n,i){var f=i.t=this.t+e.t- --n;for(i.s=0;0<=--f;)i[f]=0;for(f=Math.max(n-this.t,0);f<e.t;++f)i[this.t+f-n]=this.am(n-f,e[f],i,0,0,this.t+f-n);i.clamp(),i.drShiftTo(1,i)},t.prototype.modInt=function(e){if(e<=0)return 0;var n=this.DV%e,i=this.s<0?e-1:0;if(0<this.t)if(n==0)i=this[0]%e;else for(var f=this.t-1;0<=f;--f)i=(n*i+this[f])%e;return i},t.prototype.millerRabin=function(e){var n=this.subtract(t.ONE),i=n.getLowestSetBit();if(i<=0)return!1;var f=n.shiftRight(i);J.length<(e=e+1>>1)&&(e=J.length);for(var A=r(),N=0;N<e;++N){A.fromInt(J[Math.floor(Math.random()*J.length)]);var M=A.modPow(f,this);if(M.compareTo(t.ONE)!=0&&M.compareTo(n)!=0){for(var L=1;L++<i&&M.compareTo(n)!=0;)if((M=M.modPowInt(2,this)).compareTo(t.ONE)==0)return!1;if(M.compareTo(n)!=0)return!1}}return!0},t.prototype.clone=function(){var e=r();return this.copyTo(e),e},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 e=this.t,n=new Array;n[0]=this.s;var i,f=this.DB-e*this.DB%8,A=0;if(0<e--)for(f<this.DB&&(i=this[e]>>f)!=(this.s&this.DM)>>f&&(n[A++]=i|this.s<<this.DB-f);0<=e;)f<8?(i=(this[e]&(1<<f)-1)<<8-f,i|=this[--e]>>(f+=this.DB-8)):(i=this[e]>>(f-=8)&255,f<=0&&(f+=this.DB,--e)),128&i&&(i|=-256),A==0&&(128&this.s)!=(128&i)&&++A,(0<A||i!=this.s)&&(n[A++]=i);return n},t.prototype.equals=function(e){return this.compareTo(e)==0},t.prototype.min=function(e){return this.compareTo(e)<0?this:e},t.prototype.max=function(e){return 0<this.compareTo(e)?this:e},t.prototype.and=function(e){var n=r();return this.bitwiseTo(e,H,n),n},t.prototype.or=function(e){var n=r();return this.bitwiseTo(e,tt,n),n},t.prototype.xor=function(e){var n=r();return this.bitwiseTo(e,z,n),n},t.prototype.andNot=function(e){var n=r();return this.bitwiseTo(e,ut,n),n},t.prototype.not=function(){for(var e=r(),n=0;n<this.t;++n)e[n]=this.DM&~this[n];return e.t=this.t,e.s=~this.s,e},t.prototype.shiftLeft=function(e){var n=r();return e<0?this.rShiftTo(-e,n):this.lShiftTo(e,n),n},t.prototype.shiftRight=function(e){var n=r();return e<0?this.lShiftTo(-e,n):this.rShiftTo(e,n),n},t.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+(function(n){if(n==0)return-1;var i=0;return!(65535&n)&&(n>>=16,i+=16),!(255&n)&&(n>>=8,i+=8),!(15&n)&&(n>>=4,i+=4),!(3&n)&&(n>>=2,i+=2),!(1&n)&&++i,i})(this[e]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var e=0,n=this.s&this.DM,i=0;i<this.t;++i)e+=(function(f){for(var A=0;f!=0;)f&=f-1,++A;return A})(this[i]^n);return e},t.prototype.testBit=function(e){var n=Math.floor(e/this.DB);return n>=this.t?this.s!=0:!!(this[n]&1<<e%this.DB)},t.prototype.setBit=function(e){return this.changeBit(e,tt)},t.prototype.clearBit=function(e){return this.changeBit(e,ut)},t.prototype.flipBit=function(e){return this.changeBit(e,z)},t.prototype.add=function(e){var n=r();return this.addTo(e,n),n},t.prototype.subtract=function(e){var n=r();return this.subTo(e,n),n},t.prototype.multiply=function(e){var n=r();return this.multiplyTo(e,n),n},t.prototype.divide=function(e){var n=r();return this.divRemTo(e,n,null),n},t.prototype.remainder=function(e){var n=r();return this.divRemTo(e,null,n),n},t.prototype.divideAndRemainder=function(e){var n=r(),i=r();return this.divRemTo(e,n,i),new Array(n,i)},t.prototype.modPow=function(e,n){var i=e.bitLength(),f=w(1);if(i<=0)return f;var A=i<18?1:i<48?3:i<144?4:i<768?5:6,N=new(i<8?st:n.isEven()?Y:T)(n),M=new Array,L=3,Ft=A-1,Kt=(1<<A)-1;if(M[1]=N.convert(this),1<A){var se=r();for(N.sqrTo(M[1],se);L<=Kt;)M[L]=r(),N.mulTo(se,M[L-2],M[L]),L+=2}var le,Re,qt=e.t-1,ge=!0,jt=r();for(i=it(e[qt])-1;0<=qt;){for(Ft<=i?le=e[qt]>>i-Ft&Kt:(le=(e[qt]&(1<<i+1)-1)<<Ft-i,0<qt&&(le|=e[qt-1]>>this.DB+i-Ft)),L=A;!(1&le);)le>>=1,--L;if((i-=L)<0&&(i+=this.DB,--qt),ge)M[le].copyTo(f),ge=!1;else{for(;1<L;)N.sqrTo(f,jt),N.sqrTo(jt,f),L-=2;0<L?N.sqrTo(f,jt):(Re=f,f=jt,jt=Re),N.mulTo(jt,M[le],f)}for(;0<=qt&&!(e[qt]&1<<i);)N.sqrTo(f,jt),Re=f,f=jt,jt=Re,--i<0&&(i=this.DB-1,--qt)}return N.revert(f)},t.prototype.modInverse=function(e){var n=e.isEven();if(this.isEven()&&n||e.signum()==0)return t.ZERO;for(var i=e.clone(),f=this.clone(),A=w(1),N=w(0),M=w(0),L=w(1);i.signum()!=0;){for(;i.isEven();)i.rShiftTo(1,i),n?(A.isEven()&&N.isEven()||(A.addTo(this,A),N.subTo(e,N)),A.rShiftTo(1,A)):N.isEven()||N.subTo(e,N),N.rShiftTo(1,N);for(;f.isEven();)f.rShiftTo(1,f),n?(M.isEven()&&L.isEven()||(M.addTo(this,M),L.subTo(e,L)),M.rShiftTo(1,M)):L.isEven()||L.subTo(e,L),L.rShiftTo(1,L);0<=i.compareTo(f)?(i.subTo(f,i),n&&A.subTo(M,A),N.subTo(L,N)):(f.subTo(i,f),n&&M.subTo(A,M),L.subTo(N,L))}return f.compareTo(t.ONE)!=0?t.ZERO:0<=L.compareTo(e)?L.subtract(e):L.signum()<0?(L.addTo(e,L),L.signum()<0?L.add(e):L):L},t.prototype.pow=function(e){return this.exp(e,new dt)},t.prototype.gcd=function(e){var n=this.s<0?this.negate():this.clone(),i=e.s<0?e.negate():e.clone();n.compareTo(i)<0&&(A=n,n=i,i=A);var f=n.getLowestSetBit(),A=i.getLowestSetBit();if(A<0)return n;for(0<(A=f<A?f:A)&&(n.rShiftTo(A,n),i.rShiftTo(A,i));0<n.signum();)0<(f=n.getLowestSetBit())&&n.rShiftTo(f,n),0<(f=i.getLowestSetBit())&&i.rShiftTo(f,i),0<=n.compareTo(i)?(n.subTo(i,n),n.rShiftTo(1,n)):(i.subTo(n,i),i.rShiftTo(1,i));return 0<A&&i.lShiftTo(A,i),i},t.prototype.isProbablePrime=function(e){var n,i=this.abs();if(i.t==1&&i[0]<=J[J.length-1]){for(n=0;n<J.length;++n)if(i[0]==J[n])return!0;return!1}if(i.isEven())return!1;for(n=1;n<J.length;){for(var f=J[n],A=n+1;A<J.length&&f<G;)f*=J[A++];for(f=i.modInt(f);n<A;)if(f%J[n++]==0)return!1}return i.millerRabin(e)},t.prototype.square=function(){var e=r();return this.squareTo(e),e},t.prototype.Barrett=Y,_t==null){var _t=new Array,et=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var St=new Uint8Array(32);for(window.crypto.getRandomValues(St),Yt=0;Yt<32;++Yt)_t[et++]=St[Yt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Nt=window.crypto.random(32),Yt=0;Yt<Nt.length;++Yt)_t[et++]=255&Nt.charCodeAt(Yt)}for(;et<Ve;)Yt=Math.floor(65536*Math.random()),_t[et++]=Yt>>>8,_t[et++]=255&Yt;et=0,W()}function ke(){if(X==null){for(W(),(X=new Je).init(_t),et=0;et<_t.length;++et)_t[et]=0;et=0}return X.next()}function dr(){}function Je(){this.i=0,this.j=0,this.S=new Array}dr.prototype.nextBytes=function(e){for(var n=0;n<e.length;++n)e[n]=ke()},Je.prototype.init=function(e){for(var n,i,f=0;f<256;++f)this.S[f]=f;for(f=n=0;f<256;++f)n=n+this.S[f]+e[f%e.length]&255,i=this.S[f],this.S[f]=this.S[n],this.S[n]=i;this.i=0,this.j=0},Je.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var Ve=256;kt.exports={default:t,BigInteger:t,SecureRandom:dr}}.call(b);var Pt=Gt.exports.BigInteger,wt=(function(){function t(){$(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return I(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,s=r.toString(16);return s.length%2==1&&(s="0"+s),r<128?s:(128+s.length/2).toString(16)+s}},{key:"getValue",value:function(){return""}}]),t})(),ie=(function(){Z(r,wt);var t=k(r);function r(s){var c;return $(this,r),(c=t.call(this)).t="02",s&&(c.v=(function(p){if((h=p.toString(16))[0]!=="-")h.length%2==1?h="0"+h:h.match(/^[0-7]/)||(h="00"+h);else{var h,E=(h=h.substr(1)).length;E%2==1?E+=1:h.match(/^[0-7]/)||(E+=2);for(var O="",w=0;w<E;w++)O+="f";h=(h=(O=new Pt(O,16)).xor(p).add(Pt.ONE)).toString(16).replace(/^-/,"")}return h})(s)),c}return I(r,[{key:"getValue",value:function(){return this.v}}]),r})(),ne=(function(){Z(r,wt);var t=k(r);function r(s){var c;return $(this,r),(c=t.call(this)).t="30",c.asn1Array=s,c}return I(r,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(s){return s.getEncodedHex()})).join(""),this.v}}]),r})();function Mt(t,r){return+t[r+2]<8?1:128&+t.substr(r+2,2)}function ae(t,r){var s=Mt(t,r);return(t=t.substr(r+2,2*s))?(+t[0]<8?new Pt(t,16):new Pt(t.substr(2),16)).intValue():-1}function oe(t,r){return r+2*(Mt(t,r)+1)}var Lt=Gt.exports.BigInteger,Jt=new Lt("3"),he=(function(){function t(r,s){$(this,t),this.x=s,this.q=r}return I(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})(),zt=(function(){function t(r,s,c,p){$(this,t),this.curve=r,this.x=s,this.y=c,this.z=p==null?Lt.ONE:p,this.zinv=null}return I(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(Lt.ZERO)&&r.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Lt.ZERO))}},{key:"isInfinity",value:function(){return this.x===null&&this.y===null||this.z.equals(Lt.ZERO)&&!this.y.toBigInteger().equals(Lt.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 s=this.x.toBigInteger(),c=this.y.toBigInteger(),p=this.z,h=r.x.toBigInteger(),E=r.y.toBigInteger(),O=r.z,w=this.curve.q,it=s.multiply(O).mod(w);return r=h.multiply(p).mod(w),s=it.subtract(r),h=c.multiply(O).mod(w),c=E.multiply(p).mod(w),E=h.subtract(c),Lt.ZERO.equals(s)?Lt.ZERO.equals(E)?this.twice():this.curve.infinity:(c=it.add(r),r=p.multiply(O).mod(w),O=s.square().mod(w),p=s.multiply(O).mod(w),c=r.multiply(E.square()).subtract(c.multiply(O)).mod(w),s=s.multiply(c).mod(w),h=E.multiply(O.multiply(it).subtract(c)).subtract(h.multiply(p)).mod(w),w=p.multiply(r).mod(w),new t(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(h),w))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var r=this.x.toBigInteger(),s=this.y.toBigInteger(),c=this.z,p=this.curve.q,h=this.curve.a.toBigInteger(),E=r.square().multiply(Jt).add(h.multiply(c.square())).mod(p),O=s.shiftLeft(1).multiply(c).mod(p),w=(h=(w=s.square().mod(p)).multiply(r).multiply(c).mod(p),s=O.square().mod(p),r=E.square().subtract(h.shiftLeft(3)).mod(p),c=O.multiply(r).mod(p),E.multiply(h.shiftLeft(2).subtract(r)).subtract(s.shiftLeft(1).multiply(w)).mod(p));return p=O.multiply(s).mod(p),new t(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(w),p)}},{key:"multiply",value:function(r){if(this.isInfinity())return this;if(!r.signum())return this.curve.infinity;for(var s=r.multiply(Jt),c=this.negate(),p=this,h=s.bitLength()-2;0<h;h--){p=p.twice();var E=s.testBit(h);E!==r.testBit(h)&&(p=p.add(E?this:c))}return p}}]),t})(),Ot=(function(){function t(r,s,c){$(this,t),this.q=r,this.a=this.fromBigInteger(s),this.b=this.fromBigInteger(c),this.infinity=new zt(this,null,null)}return I(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 he(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 s=(r.length-2)/2,c=r.substr(2,s);return s=r.substr(2+s,s),new zt(this,this.fromBigInteger(new Lt(c,16)),this.fromBigInteger(new Lt(s,16)))}}}]),t})(),Ut={ECPointFp:zt,ECCurveFp:Ot},te=Gt.exports.BigInteger,ue=(Ot=Gt.exports.SecureRandom,Ut.ECCurveFp),ce=new Ot,ee=(Ut=y()).curve,d=Ut.G,l=Ut.n;function y(){var t=new te("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),r=new te("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),s=new te("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return s=(r=new ue(t,r,s)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:r,G:s,n:new te("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function F(t,r){return t.length>=r?t:new Array(r-t.length+1).join("0")+t}function D(t,r){for(var s=[],c=~~(r/8),p=r%8,h=0,E=t.length;h<E;h++)s[h]=(t[(h+c)%E]<<p&255)+(t[(h+c+1)%E]>>>8-p&255);return s}function U(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]^r[c]);return s}function nt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=t[c]&r[c]&255;return s}function vt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]|r[c]);return s}function yt(t,r){for(var s=[],c=0,p=t.length-1;0<=p;p--){var h=t[p]+r[p]+c;c=255<h?1:0,s[p]=255&h}return s}function Xt(t,r,s,c){return 0<=c&&c<=15?U(U(t,r),s):vt(nt(t,r),nt((function(p){for(var h=[],E=p.length-1;0<=E;E--)h[E]=255&~p[E];return h})(t),s))}function Qt(t,r){for(var s=[],c=[],p=0;p<16;p++){var h=4*p;s.push(r.slice(h,4+h))}for(var E,O=16;O<68;O++)s.push(U(U((E=U(U(s[O-16],s[O-9]),D(s[O-3],15)),U(U(E,D(E,15)),D(E,23))),D(s[O-13],7)),s[O-6]));for(var w=0;w<64;w++)c.push(U(s[w],s[w+4]));for(var it,st,T,H=[121,204,69,25],tt=[122,135,157,138],z=t.slice(0,4),ut=t.slice(4,8),dt=t.slice(8,12),Ct=t.slice(12,16),Y=t.slice(16,20),X=t.slice(20,24),J=t.slice(24,28),G=t.slice(28,32),W=0;W<64;W++){var _t=0<=W&&W<=15?H:tt,et=U(St=D(yt(yt(D(z,12),Y),D(_t,W)),7),D(z,12)),St=(et=yt(yt(yt((it=z,st=ut,T=dt,0<=(_t=W)&&_t<=15?U(U(it,st),T):vt(vt(nt(it,st),nt(it,T)),nt(st,T))),Ct),et),c[W]),yt(yt(yt(Xt(Y,X,J,W),G),St),s[W]));Ct=dt,dt=D(ut,9),ut=z,z=et,G=J,J=D(X,19),X=Y,Y=U(U(St,D(St,9)),D(St,17))}return U([].concat(z,ut,dt,Ct,Y,X,J,G),t)}Ot={getGlobalCurve:function(){return ee},generateEcparam:y,generateKeyPairHex:function(t,r,s){return{privateKey:s=F((r=(t?new te(t,r,s):new te(l.bitLength(),ce)).mod(l.subtract(te.ONE)).add(te.ONE)).toString(16),64),publicKey:"04"+F((r=d.multiply(r)).getX().toBigInteger().toString(16),64)+F(r.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(t){for(var r=(t=unescape(encodeURIComponent(t))).length,s=[],c=0;c<r;c++)s[c>>>2]|=(255&t.charCodeAt(c))<<24-c%4*8;for(var p=[],h=0;h<r;h++){var E=s[h>>>2]>>>24-h%4*8&255;p.push((E>>>4).toString(16)),p.push((15&E).toString(16))}return p.join("")},leftPad:F,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=[],s=0,c=0;c<2*t.length;c+=2)r[c>>>3]|=parseInt(t[s],10)<<24-c%8*4,s++;try{for(var p=[],h=0;h<t.length;h++){var E=r[h>>>2]>>>24-h%4*8&255;p.push(String.fromCharCode(E))}return decodeURIComponent(escape(p.join("")))}catch(O){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){for(var r=[],s=(t=(s=t.length)%2!=0?F(t,s+1):t).length,c=0;c<s;c+=2)r.push(parseInt(t.substr(c,2),16));return r},verifyPublicKey:function(t){var r=ee.decodePointHex(t);return!!r&&(t=r.getX(),r.getY().square().equals(t.multiply(t.square()).add(t.multiply(ee.a)).add(ee.b)))}},Ut=function(t){for(var r=448<=(r=(O=8*t.length)%512)?512-r%448-1:448-r-1,s=new Array((r-7)/8),c=0,p=s.length;c<p;c++)s[c]=0;for(var h,E=[],O=O.toString(2),w=7;0<=w;w--)8<O.length?(h=O.length-8,E[w]=parseInt(O.substr(h),2),O=O.substr(0,h)):0<O.length?(E[w]=parseInt(O,2),O=""):E[w]=0;for(var it=[].concat(t,[128],s,E),st=it.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],H=0;H<st;H++){var tt=64*H;T=Qt(T,it.slice(tt,64+tt))}return T};var Et=Gt.exports.BigInteger,zr=function(t,r){return t=new ie(t),r=new ie(r),new ne([t,r]).getEncodedHex()},Qr=function(t){var r=oe(t,0),s=oe(t,r),c=ae(t,r);return r=t.substr(s,2*c),s=oe(t,c=s+r.length),c=ae(t,c),t=t.substr(s,2*c),{r:new Pt(r,16),s:new Pt(t,16)}},ft=Ot,ve=Ut,Ae=(Ot=ft.generateEcparam()).G,sr=Ot.curve,De=Ot.n;function ur(t,r,s){var c=2<arguments.length&&s!==void 0?s:"1234567812345678",p=(c=ft.utf8ToHex(c),ft.leftPad(Ae.curve.a.toBigInteger().toRadix(16),64)),h=ft.leftPad(Ae.curve.b.toBigInteger().toRadix(16),64),E=ft.leftPad(Ae.getX().toBigInteger().toRadix(16),64),O=ft.leftPad(Ae.getY().toBigInteger().toRadix(16),64);return s=(r=128<r.length?r.substr(2,128):r).substr(0,64),r=r.substr(64,64),r=ft.hexToArray(c+p+h+E+O+s+r),c=4*c.length,r.unshift(255&c),r.unshift(c>>8&255),r=ve(r),ft.arrayToHex(ve(r.concat(ft.hexToArray(t))))}function cr(){var t=ft.generateKeyPairHex(),r=sr.decodePointHex(t.publicKey);return t.k=new Et(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}Ot={generateKeyPairHex:ft.generateKeyPairHex,doEncrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;t=typeof t=="string"?ft.hexToArray(ft.utf8ToHex(t)):Array.prototype.slice.call(t),r=ft.getGlobalCurve().decodePointHex(r);var c=ft.generateKeyPairHex(),p=new Et(c.privateKey,16),h=c.publicKey;128<h.length&&(h=h.substr(h.length-128)),c=r.multiply(p),p=ft.hexToArray(ft.leftPad(c.getX().toBigInteger().toRadix(16),64)),r=ft.hexToArray(ft.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=ft.arrayToHex(ve([].concat(p,t,r)));var E,O=1,w=0,it=[],st=[].concat(p,r);(E=function(){it=ve([].concat(Tt(st),[O>>24&255,O>>16&255,O>>8&255,255&O])),O++,w=0})();for(var T=0,H=t.length;T<H;T++)w===it.length&&E(),t[T]^=255&it[w++];return r=ft.arrayToHex(t),s===0?h+r+c:h+c+r},doDecrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(h=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":h;r=new Et(r,16);var p=t.substr(128,64),h=t.substr(192);s===0&&(p=t.substr(t.length-64),h=t.substr(128,t.length-128-64));var E,O=ft.hexToArray(h),w=(t=ft.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),r=ft.hexToArray(ft.leftPad(t.getX().toBigInteger().toRadix(16),64)),t=ft.hexToArray(ft.leftPad(t.getY().toBigInteger().toRadix(16),64)),1),it=0,st=[],T=[].concat(r,t);(E=function(){st=ve([].concat(Tt(T),[w>>24&255,w>>16&255,w>>8&255,255&w])),w++,it=0})();for(var H=0,tt=O.length;H<tt;H++)it===st.length&&E(),O[H]^=255&st[it++];return ft.arrayToHex(ve([].concat(r,O,t)))===p?c==="array"?O:ft.arrayToUtf8(O):c==="array"?[]:""},doSignature:function(t,r){var s=(O=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=O.der,p=O.hash,h=O.publicKey,E=O.userId,O=typeof t=="string"?ft.utf8ToHex(t):ft.arrayToHex(t);p&&(O=ur(O,h||(t=r,p=Ae.multiply(new Et(t,16)),"04"+(t=ft.leftPad(p.getX().toBigInteger().toString(16),64))+(p=ft.leftPad(p.getY().toBigInteger().toString(16),64))),E));var w=new Et(r,16),it=new Et(O,16),st=null,T=null,H=null;do do{var tt;st=(tt=s&&s.length?s.pop():cr()).k,T=it.add(tt.x1).mod(De)}while(T.equals(Et.ZERO)||T.add(st).equals(De));while((H=w.add(Et.ONE).modInverse(De).multiply(st.subtract(T.multiply(w))).mod(De)).equals(Et.ZERO));return c?zr(T,H):ft.leftPad(T.toString(16),64)+ft.leftPad(H.toString(16),64)},doVerifySignature:function(t,r,s){var c,p,h=(O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,E=O.hash,O=O.userId;return t=typeof t=="string"?ft.utf8ToHex(t):ft.arrayToHex(t),E&&(t=ur(t,s,O)),p=h?(c=(p=Qr(r)).r,p.s):(c=new Et(r.substring(0,64),16),new Et(r.substring(64),16)),r=sr.decodePointHex(s),s=new Et(t,16),!(t=c.add(p).mod(De)).equals(Et.ZERO)&&(r=Ae.multiply(p).add(r.multiply(t)),s=s.add(r.getX().toBigInteger()).mod(De),c.equals(s))},getPoint:cr,verifyPublicKey:ft.verifyPublicKey};var Zr=Ut,Fe=[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],xe=[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 qe(t){for(var r=[],s=0,c=t.length;s<c;s+=2)r.push(parseInt(t.substr(s,2),16));return r}function Ie(t,r){return t<<r|t>>>32-r}function pe(t){return(255&Fe[t>>>24&255])<<24|(255&Fe[t>>>16&255])<<16|(255&Fe[t>>>8&255])<<8|255&Fe[255&t]}function Le(t){return t^Ie(t,2)^Ie(t,10)^Ie(t,18)^Ie(t,24)}function Ue(t){return t^Ie(t,13)^Ie(t,23)}function lr(t,r,s,c){c=(h=(E=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":h;var p=E.mode,h=(h=E.iv)===void 0?[]:h,E=(E=E.output)===void 0?"string":E;if(p==="cbc"&&(h=typeof h=="string"?qe(h):h).length!==16)throw new Error("iv is invalid");if((r=typeof r=="string"?qe(r):r).length!==16)throw new Error("key is invalid");if(t=(typeof t=="string"?s!==0?function(Y){for(var X=[],J=0,G=Y.length;J<G;J++){var W=Y.codePointAt(J);if(W<=127)X.push(W);else if(W<=2047)X.push(192|W>>>6),X.push(128|63&W);else if(W<=55295||57344<=W&&W<=65535)X.push(224|W>>>12),X.push(128|W>>>6&63),X.push(128|63&W);else{if(!(65536<=W&&W<=1114111))throw X.push(W),new Error("input is not supported");J++,X.push(240|W>>>18&28),X.push(128|W>>>12&63),X.push(128|W>>>6&63),X.push(128|63&W)}}return X}:qe:Tt)(t),c==="pkcs#5"&&s!==0)for(var O=16-t.length%16,w=0;w<O;w++)t.push(O);var it=new Array(32);(function(Y,X,J){for(var G=new Array(4),W=new Array(4),_t=0;_t<4;_t++)W[0]=255&Y[0+4*_t],W[1]=255&Y[1+4*_t],W[2]=255&Y[2+4*_t],W[3]=255&Y[3+4*_t],G[_t]=W[0]<<24|W[1]<<16|W[2]<<8|W[3];G[0]^=2746333894,G[1]^=1453994832,G[2]^=1736282519,G[3]^=2993693404;for(var et,St=0;St<32;St+=4)et=G[1]^G[2]^G[3]^xe[St+0],X[St+0]=G[0]^=Ue(pe(et)),et=G[2]^G[3]^G[0]^xe[St+1],X[St+1]=G[1]^=Ue(pe(et)),et=G[3]^G[0]^G[1]^xe[St+2],X[St+2]=G[2]^=Ue(pe(et)),et=G[0]^G[1]^G[2]^xe[St+3],X[St+3]=G[3]^=Ue(pe(et));if(J===0)for(var Nt,Yt=0;Yt<16;Yt++)Nt=X[Yt],X[Yt]=X[31-Yt],X[31-Yt]=Nt})(r,it,s);for(var st=[],T=h,H=t.length,tt=0;16<=H;){var z=t.slice(tt,tt+16),ut=new Array(16);if(p==="cbc")for(var dt=0;dt<16;dt++)s!==0&&(z[dt]^=T[dt]);(function(Y,X,J){for(var G=new Array(4),W=new Array(4),_t=0;_t<4;_t++)W[0]=255&Y[4*_t],W[1]=255&Y[4*_t+1],W[2]=255&Y[4*_t+2],W[3]=255&Y[4*_t+3],G[_t]=W[0]<<24|W[1]<<16|W[2]<<8|W[3];for(var et,St=0;St<32;St+=4)et=G[1]^G[2]^G[3]^J[St+0],G[0]^=Le(pe(et)),et=G[2]^G[3]^G[0]^J[St+1],G[1]^=Le(pe(et)),et=G[3]^G[0]^G[1]^J[St+2],G[2]^=Le(pe(et)),et=G[0]^G[1]^G[2]^J[St+3],G[3]^=Le(pe(et));for(var Nt=0;Nt<16;Nt+=4)X[Nt]=G[3-Nt/4]>>>24&255,X[Nt+1]=G[3-Nt/4]>>>16&255,X[Nt+2]=G[3-Nt/4]>>>8&255,X[Nt+3]=255&G[3-Nt/4]})(z,ut,it);for(var Ct=0;Ct<16;Ct++)p==="cbc"&&s===0&&(ut[Ct]^=T[Ct]),st[tt+Ct]=ut[Ct];p==="cbc"&&(T=s!==0?ut:z),H-=16,tt+=16}return c==="pkcs#5"&&s===0&&(c=st[st.length-1],st.splice(st.length-c,c)),E!=="array"?s!==0?st.map((function(Y){return(Y=Y.toString(16)).length===1?"0"+Y:Y})).join(""):(function(Y){for(var X=[],J=0,G=Y.length;J<G;J++)240<=Y[J]&&Y[J]<=247?(X.push(String.fromCodePoint(((7&Y[J])<<18)+((63&Y[J+1])<<12)+((63&Y[J+2])<<6)+(63&Y[J+3]))),J+=3):224<=Y[J]&&Y[J]<=239?(X.push(String.fromCodePoint(((15&Y[J])<<12)+((63&Y[J+1])<<6)+(63&Y[J+2]))),J+=2):192<=Y[J]&&Y[J]<=223?(X.push(String.fromCodePoint(((31&Y[J])<<6)+(63&Y[J+1]))),J++):X.push(String.fromCodePoint(Y[J]));return X.join("")})(st):st}var tn=[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],ye=[],en=function(t,r,s){for(var c=t[0],p=t[1],h=t[2],E=t[3],O=t[4],w=t[5],it=t[6],st=t[7],T=0;T<64;T++){T<16?ye[T]=0|r[s+T]:(H=ye[T-15],tt=ye[T-2],ye[T]=((H<<25|H>>>7)^(H<<14|H>>>18)^H>>>3)+ye[T-7]+((tt<<15|tt>>>17)^(tt<<13|tt>>>19)^tt>>>10)+ye[T-16]);var H=c&p^c&h^p&h,tt=st+((O<<26|O>>>6)^(O<<21|O>>>11)^(O<<7|O>>>25))+(O&w^~O&it)+tn[T]+ye[T];st=it,it=w,w=O,O=E+tt|0,E=h,h=p,p=c,c=tt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+H)|0}t[0]=t[0]+c|0,t[1]=t[1]+p|0,t[2]=t[2]+h|0,t[3]=t[3]+E|0,t[4]=t[4]+O|0,t[5]=t[5]+w|0,t[6]=t[6]+it|0,t[7]=t[7]+st|0},fr=(Ot={c2:Ot,c3:function(t){return t=typeof t=="string"?(function(r){for(var s=[],c=0,p=r.length;c<p;c++){var h=r.codePointAt(c);if(h<=127)s.push(h);else if(h<=2047)s.push(192|h>>>6),s.push(128|63&h);else if(h<=55295||57344<=h&&h<=65535)s.push(224|h>>>12),s.push(128|h>>>6&63),s.push(128|63&h);else{if(!(65536<=h&&h<=1114111))throw s.push(h),new Error("input is not supported");c++,s.push(240|h>>>18&28),s.push(128|h>>>12&63),s.push(128|h>>>6&63),s.push(128|63&h)}}return s})(t):Array.prototype.slice.call(t),Zr(t).map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},c4:{encrypt:function(t,r,s){return lr(t,r,1,s)},decrypt:function(t,r,s){return lr(t,r,0,s)}},s2:function(t){var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],s=(function(p){for(var h=[],E=0;E<Math.ceil(p.length/4);E++)h[E]=p[4*E]<<24|(255&p[4*E+1])<<16|(255&p[4*E+2])<<8|255&p[4*E+3];return h})(t);s[(t=8*t.length)>>5]|=128<<24-t%32,s[15+(64+t>>9<<4)]=t;for(var c=0;c<s.length;c+=16)en(r,s,c);return(function(p){for(var h=[],E=0;E<p.length;E++)h[4*E]=p[E]>>24&255,h[4*E+1]=p[E]>>16&255,h[4*E+2]=p[E]>>8&255,h[4*E+3]=255&p[E];return h})(r).map((function(p){return(p=p.toString(16)).length===1?"0"+p:p})).join("")}},Dt),rn=mt,nn=Rt,on=Vt,an=$t,sn=Ot.c2,un=Ot.c3,cn=Ot.c4,ln=Ot.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 s="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,p=!1,h=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,E=h!==void 0&&!!h.request&&!!h.login,O=function(T,H){return typeof T=="string"&&typeof H=="string"&&T!=null&&H!=null&&T.substring(0,H.length)===H},w={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},it=function(T){for(var H in w)if(w[H]===T)return H},st=function(T,H,tt){var z=Date.now(),ut=new t;try{if(!T||T.length<=75)return console.error("error format 1:",T),w.ERROR_DATA_FORMAT;if(!O(T,"eyJ"))return console.error("error format 2:",T),w.ERROR_DATA_FORMAT;T=T.substring(3,T.length);var dt=rn.my_b4_decode(T);if(!dt)return console.error("error format 3:",T),w.ERROR_DATA_FORMAT;var Ct,Y=ut.cc.u8.byteToInt(dt.slice(0,4),0),X=dt.slice(4,4+Y),J=ut.cc.u8.byteToInt(dt.slice(4+Y,4+Y+4),0),G=dt.slice(4+Y+4,4+Y+4+J),W=ut.cc.u8.byteToInt(dt.slice(4+Y+4+J,4+Y+4+J+4),0),_t=dt.slice(4+Y+4+J+4,4+Y+4+J+4+W),et=ut.cc.u8.bytesToUtf8Str(X);if(ut.cc.h6.encode(G,0,J),H||(tt!==void 0&&tt==="sm2"?(Ct=ut.cc.h6.encode(G,0,J),ut.co.c2.doVerifySignature(et,Ct,s,{der:!0,hash:!0})):ut.co.c3(et+"8890012345678890").toLowerCase()===ut.cc.h6.encode(_t,0,W).toLowerCase())){if(et.length%2==0){t.prototype.__v=function(){return et.slice(0,2)};for(var St=[],Nt=2;Nt<66;Nt+=2)St.push(parseInt("0x"+et.slice(Nt,Nt+2)));t.prototype.__i=function(){return St};var Yt=parseInt("0x"+et.slice(66,82))-z;t.prototype.__o=function(){return Yt}}return E||b.AAR2||(b.AAR2=t),w.SUCCESS}}catch(ke){return console.error(ke),w.ERROR_UNKNOWN_ERROR}return w.ERROR_SIGN_CHECK};return t.init=function(T,H){var tt,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 H=="string"&&(z.publicKey=H)):Q(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)),p?z.callback&&z.callback(!0,{errorNo:tt=w.ALREADY_SUCCESS,errorMsg:it(tt)}):c?setTimeout((function(){t.init(T,H)}),50):(c=!0,z.debug&&fr.start(z.debug),z.publicKey&&(s=z.publicKey),z.code?(tt=st(z.code,z.skipVerify))===w.SUCCESS?(c=!(p=!0),z.callback(!0,{errorNo:tt,errorMsg:it(tt)})):z.callback(!1,{errorNo:tt,errorMsg:it(tt)}):z.url&&(function(ut,dt,Ct){try{if(ut=ut+"?version="+t.VERSION+(E?"&name=wechat":"&name=browser")+"&t="+Date.now(),E)h.request({url:ut,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function(X){X.statusCode===200?dt(X.data):Ct(w.ERROR_XXX_REQUEST_FAIL)},fail:function(X){X&&X.errMsg&&X.errMsg.indexOf("timeout")!==-1?Ct(w.ERROR_XXX_REQUEST_TIMEOUT):Ct(w.ERROR_XXX_REQUEST_FAIL)}});else{var Y;if(window.XMLHttpRequest)Y=new XMLHttpRequest;else if(window.ActiveXObject)try{Y=new ActiveXObject("Msxml2.XMLHTTP")}catch(X){try{Y=new ActiveXObject("Microsoft.XMLHTTP")}catch(J){}}Y&&(Y.onload=function(){Y.readyState===4&&(Y.status===200?dt(Y.responseText):Ct(w.ERROR_XHR_ERROR))},Y.ontimeout=function(){Ct(w.ERROR_XHR_TIMEOUT)},Y.onerror=function(){Ct(w.ERROR_XHR_ERROR)},Y.open("POST",ut,!0),Y.timeout=5e3,Y.send(null))}}catch(X){console.error(X),Ct(w.ERROR_UNKNOWN_ERROR)}})(z.url,(function(ut){(ut=st(ut,z.skipVerify,z.alg))===w.SUCCESS?(c=!(p=!0),z.callback(!0,{errorNo:ut,errorMsg:it(ut)})):(c=!1,z.callback(!1,{errorNo:ut,errorMsg:it(ut)}))}),(function(ut){c=!1,z.callback(!1,{errorNo:ut,errorMsg:it(ut)})})))},t.prototype={cc:{b4:nn,h6:on,u8:an},co:{c2:sn,c3:un,c4:cn,s2:ln},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,H){return this.__s(T,H)},__s:function(T,H){var tt=this.cc.u8.utf8StrToBytes(T),z=this.__i();return T=this.cc.u8.utf8StrToBytes(H),H=this.cc.u8.utf8StrToBytes(this.__c()),T=[].concat(tt,z,T,H),H=parseInt("0x"+this.__v()),this.__f(H)(T)+this.__v()},__f:function(T){var H=this.co.s2,tt=this.co.c3,z=this.cc.h6.decode,ut=[function(dt){return H(dt)},function(dt){return tt(dt)},function(dt){return tt(z(H(dt)))},function(dt){return H(z(tt(dt)))},function(dt){return tt(z(tt(dt)))},function(dt){return H(z(H(dt)))}];return ut[(128<T?T-128:T)%ut.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(h!==void 0&&h.env&&h.request&&h.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 fr.isDebug()},version:function(){return t.VERSION}},t})()},at(R)=="object"?g.exports=rt():(q=typeof(B=rt)=="function"?B.call(R,P,R,g):B)===void 0||(g.exports=q)}},a={};function u(g){var R=a[g];if(R!==void 0)return R.exports;var P=a[g]={id:g,loaded:!1,exports:{}};return o[g].call(P.exports,P,P.exports,u),P.loaded=!0,P.exports}u.n=g=>{var R=g&&g.__esModule?()=>g.default:()=>g;return u.d(R,{a:R}),R},u.d=(g,R)=>{for(var P in R)u.o(R,P)&&!u.o(g,P)&&Object.defineProperty(g,P,{enumerable:!0,get:R[P]})},u.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(g){if(typeof window=="object")return window}})(),u.hmd=g=>((g=Object.create(g)).children||(g.children=[]),Object.defineProperty(g,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+g.id)}}),g),u.o=(g,R)=>Object.prototype.hasOwnProperty.call(g,R),u.r=g=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})};var v=u(737);Or.exports.LyyGetCommandSDK=v})()});var Wt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},fe={SIT:"sit",RELEASE:"release",PROD:"prod"},Me={[Wt.DEV]:"https://dm.leyaoyao.com",[Wt.SIT]:"https://sm.leyaoyao.com",[Wt.UAT]:"https://um.leyaoyao.com",[Wt.PROD]:"https://m.leyaoyao.com"},yr={[Wt.DEV]:"https://dad2.leyaoyao.com",[Wt.SIT]:"https://sad2.leyaoyao.com",[Wt.UAT]:"https://uad2.leyaoyao.com",[Wt.PROD]:"https://nad.ehuoke.com"},Pe={[fe.SIT]:"https://sopenapi.leyaoyao.com",[fe.RELEASE]:"https://uopen-api.leyaoyao.com",[fe.PROD]:"https://api-gateway.leyaoyao.com"};function we(o,a){return`${Me[o]||Me[Wt.PROD]}${a}`}function gr(o){return yr[o]||yr[Wt.PROD]}var Ee={debug:!1,env:Wt.PROD,externalEnv:fe.PROD,apiDomain:""},mr=gt({},Ee);function _r(o){mr=gt(gt({},Ee),o)}function de(){return mr}var gn=Object.defineProperty,mn=(o,a,u)=>a in o?gn(o,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):o[a]=u,_n=(o,a,u)=>mn(o,typeof a!="symbol"?a+"":a,u);function re(){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 vn=class{constructor(o=!1){_n(this,"enable"),this.enable=o}setEnable(o){this.enable=o}info(...o){this.enable&&console.info("[BI Info]",...o)}warn(...o){this.enable&&console.warn("[BI Warn]",...o)}error(...o){this.enable&&console.error("[BI Error]",...o)}debug(...o){this.enable&&console.log("[BI Debug]",...o)}},x=new vn;function Ke(o){let a=re();return a==="taro"?Taro.setClipboardData({data:o}).then(()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):a==="uni"?new Promise((u,v)=>{uni.setClipboardData({data:o,success:()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{x.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),v(g)}})}):a==="wechat"?new Promise((u,v)=>{wx.setClipboardData({data:o,success:()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{x.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),v(g)}})}):a==="alipay"?new Promise((u,v)=>{my.setClipboardData({text:o,success:()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{x.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),v(g)}})}):navigator.clipboard.writeText(o).then(()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function We(o,a=2e3){let u=re();if(u==="taro"){Taro.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="uni"){uni.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="wechat"){wx.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="alipay"){my.showToast({content:o,duration:a});return}typeof console!="undefined"&&console.log(`[Toast] ${o}`)}async function me(){var o,a,u,v,g;let R=re();try{if(R==="taro")return((o=(await Taro.getSystemInfo()).platform)==null?void 0:o.toLowerCase())==="ios"?"ios":"android";if(R==="uni")return((a=uni.getSystemInfoSync().platform)==null?void 0:a.toLowerCase())==="ios"?"ios":"android";if(R==="wechat")return wx.getDeviceInfo?((u=(await wx.getDeviceInfo()).platform)==null?void 0:u.toLowerCase())==="ios"?"ios":"android":((v=wx.getSystemInfoSync().platform)==null?void 0:v.toLowerCase())==="ios"?"ios":"android";if(R==="alipay")return((g=my.getSystemInfoSync().platform)==null?void 0:g.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let P=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(P))return"ios";if(/android/.test(P))return"android"}return"unknown"}catch(P){return x.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",P),"unknown"}}var xt={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function K(o,a,u=null){return{code:o,message:a,data:u}}function je(o,a){return o==null?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof o=="string"&&o.trim().length===0?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Ce(o,a){for(let u of a){let v=je(o[u],u);if(!v.valid)return v}return{valid:!0}}var er={};Xe(er,{handleJdInsurance:()=>Lr,handleJdInsuranceExt:()=>Ur,handleJdjrCashLoanExt:()=>Cr,handleJdjrCashLoanFlow:()=>wr});var $e=(k=>(k[k.JD_CASH_LOAN__MISSING_PHONE=2001]="JD_CASH_LOAN__MISSING_PHONE",k[k.JD_CASH_LOAN__MISSING_DEVICE_ID=2002]="JD_CASH_LOAN__MISSING_DEVICE_ID",k[k.JD_CASH_LOAN__RTA_FAILED=2003]="JD_CASH_LOAN__RTA_FAILED",k[k.JD_CASH_LOAN__GET_CONFIG_FAILED=2004]="JD_CASH_LOAN__GET_CONFIG_FAILED",k[k.JD_CASH_LOAN__INVALID_CONFIG=2005]="JD_CASH_LOAN__INVALID_CONFIG",k[k.JD_CASH_LOAN__EXT_NOT_ELIGIBLE=2006]="JD_CASH_LOAN__EXT_NOT_ELIGIBLE",k[k.JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS=2007]="JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS",k[k.JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM=2008]="JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM",k[k.JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID=2009]="JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID",k[k.JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE=2010]="JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE",k[k.JD_INSURANCE__USER_NOT_ELIGIBLE=2101]="JD_INSURANCE__USER_NOT_ELIGIBLE",k[k.JD_INSURANCE__H5_NOT_SUPPORTED=2102]="JD_INSURANCE__H5_NOT_SUPPORTED",k[k.JD_INSURANCE__INVALID_JUMP_PARAMS=2103]="JD_INSURANCE__INVALID_JUMP_PARAMS",k[k.JD_INSURANCE__GET_CONFIG_FAILED=2104]="JD_INSURANCE__GET_CONFIG_FAILED",k[k.JD_INSURANCE__COPY_FAILED=2105]="JD_INSURANCE__COPY_FAILED",k[k.JD_INSURANCE__TASK_COMPLETED=2106]="JD_INSURANCE__TASK_COMPLETED",k[k.JD_INSURANCE__UNKNOWN_JUMP_MODE=2107]="JD_INSURANCE__UNKNOWN_JUMP_MODE",k[k.JD_INSURANCE__RTA_FAILED=2108]="JD_INSURANCE__RTA_FAILED",k))($e||{}),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"},Se=(m=>(m[m.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",m[m.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",m[m.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",m[m.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",m[m.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",m[m.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",m[m.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",m[m.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",m[m.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",m[m.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",m[m.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",m[m.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",m[m.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",m[m.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",m[m.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",m[m.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",m[m.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",m[m.DY_PAY__INVALID_RETURN_TYPE=3018]="DY_PAY__INVALID_RETURN_TYPE",m[m.DY_PAY__JSAPI_INFO_FAILED=3019]="DY_PAY__JSAPI_INFO_FAILED",m[m.DY_PAY__REQUEST_JSAPI_INFO_FAILED=3020]="DY_PAY__REQUEST_JSAPI_INFO_FAILED",m[m.DY_PAY__MISSING_JSAPI_PAY_INFO=3021]="DY_PAY__MISSING_JSAPI_PAY_INFO",m[m.DY_PAY__INVALID_JSAPI_PAY_INFO=3022]="DY_PAY__INVALID_JSAPI_PAY_INFO",m))(Se||{}),Bt={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"};var An=(o,a,u,v)=>{let g=re();if(g==="taro")return Taro.request({url:o,method:a,data:u,header:v}).then(B=>B);if(g==="uni")return new Promise((B,q)=>{uni.request({url:o,method:a,data:u,header:v,success:rt=>B(rt),fail:rt=>q(rt)})});if(g==="wechat")return new Promise((B,q)=>{wx.request({url:o,method:a,data:u,header:v,success:rt=>B(rt),fail:rt=>q(rt)})});if(g==="alipay")return new Promise((B,q)=>{my.request({url:o,method:a,data:u,headers:v,success:rt=>B(rt),fail:rt=>q(rt)})});let R=a.toUpperCase()==="GET",P=R&&u&&Object.keys(u).length?`${o}?${new URLSearchParams(u).toString()}`:o;return fetch(P,{method:a,headers:v,body:R?void 0:JSON.stringify(u)}).then(async B=>({statusCode:B.status,data:await B.json()}))},ze=class{constructor(a=null){Ye(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||de()||Ee}async getAuthToken(){let a=this.getCurrentConfig();if(a.getAuthToken&&typeof a.getAuthToken=="function")try{let u=await a.getAuthToken();return u?(x.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),u):(x.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(u){return x.error("\u83B7\u53D6Token\u5931\u8D25",u),null}return null}async buildHeader(a={},u=!0){let v=gt({"content-type":"application/json"},a);if(!u)return v;let g=await this.getAuthToken();if(!g)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 v.Authorization_bar=g,v}async request(a){let{path:u,method:v="POST",data:g={},header:R={},authRequired:P=!0,baseDomain:B,beforeRequest:q,afterResponse:rt}=a,at=B?`${B}${u}`:we(this.getCurrentConfig().env||"prod",u),Q=await this.buildHeader(R,P);q&&typeof q=="function"&&await q({url:at,method:v,data:g,header:Q}),x.info(`\u53D1\u8D77${v}\u8BF7\u6C42:`,{path:u,method:v});try{let $=await An(at,v,g,Q);return x.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:$.statusCode}),rt&&typeof rt=="function"&&await rt($.data),$.data}catch($){throw x.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:$}),$}}get(a,u={},v={}){return this.request(gt({path:a,method:"GET",data:u},v))}post(a,u={},v={}){return this.request(gt({path:a,method:"POST",data:u},v))}},Te=(o=null)=>new ze(o);var Dn=(function(){"use strict";function o(I,Z){var ht=(65535&I)+(65535&Z);return(I>>16)+(Z>>16)+(ht>>16)<<16|65535&ht}function a(I,Z,ht,ot,k,Tt){return o((Tt=o(o(Z,I),o(ot,Tt)))<<k|Tt>>>32-k,ht)}function u(I,Z,ht,ot,k,Tt,S){return a(Z&ht|~Z&ot,I,Z,k,Tt,S)}function v(I,Z,ht,ot,k,Tt,S){return a(Z&ot|ht&~ot,I,Z,k,Tt,S)}function g(I,Z,ht,ot,k,Tt,S){return a(Z^ht^ot,I,Z,k,Tt,S)}function R(I,Z,ht,ot,k,Tt,S){return a(ht^(Z|~ot),I,Z,k,Tt,S)}function P(I,Z){var ht,ot,k,Tt;I[Z>>5]|=128<<Z%32,I[14+(Z+64>>>9<<4)]=Z;for(var S=1732584193,b=-271733879,m=-1732584194,C=271733878,_=0;_<I.length;_+=16)S=u(ht=S,ot=b,k=m,Tt=C,I[_],7,-680876936),C=u(C,S,b,m,I[_+1],12,-389564586),m=u(m,C,S,b,I[_+2],17,606105819),b=u(b,m,C,S,I[_+3],22,-1044525330),S=u(S,b,m,C,I[_+4],7,-176418897),C=u(C,S,b,m,I[_+5],12,1200080426),m=u(m,C,S,b,I[_+6],17,-1473231341),b=u(b,m,C,S,I[_+7],22,-45705983),S=u(S,b,m,C,I[_+8],7,1770035416),C=u(C,S,b,m,I[_+9],12,-1958414417),m=u(m,C,S,b,I[_+10],17,-42063),b=u(b,m,C,S,I[_+11],22,-1990404162),S=u(S,b,m,C,I[_+12],7,1804603682),C=u(C,S,b,m,I[_+13],12,-40341101),m=u(m,C,S,b,I[_+14],17,-1502002290),S=v(S,b=u(b,m,C,S,I[_+15],22,1236535329),m,C,I[_+1],5,-165796510),C=v(C,S,b,m,I[_+6],9,-1069501632),m=v(m,C,S,b,I[_+11],14,643717713),b=v(b,m,C,S,I[_],20,-373897302),S=v(S,b,m,C,I[_+5],5,-701558691),C=v(C,S,b,m,I[_+10],9,38016083),m=v(m,C,S,b,I[_+15],14,-660478335),b=v(b,m,C,S,I[_+4],20,-405537848),S=v(S,b,m,C,I[_+9],5,568446438),C=v(C,S,b,m,I[_+14],9,-1019803690),m=v(m,C,S,b,I[_+3],14,-187363961),b=v(b,m,C,S,I[_+8],20,1163531501),S=v(S,b,m,C,I[_+13],5,-1444681467),C=v(C,S,b,m,I[_+2],9,-51403784),m=v(m,C,S,b,I[_+7],14,1735328473),S=g(S,b=v(b,m,C,S,I[_+12],20,-1926607734),m,C,I[_+5],4,-378558),C=g(C,S,b,m,I[_+8],11,-2022574463),m=g(m,C,S,b,I[_+11],16,1839030562),b=g(b,m,C,S,I[_+14],23,-35309556),S=g(S,b,m,C,I[_+1],4,-1530992060),C=g(C,S,b,m,I[_+4],11,1272893353),m=g(m,C,S,b,I[_+7],16,-155497632),b=g(b,m,C,S,I[_+10],23,-1094730640),S=g(S,b,m,C,I[_+13],4,681279174),C=g(C,S,b,m,I[_],11,-358537222),m=g(m,C,S,b,I[_+3],16,-722521979),b=g(b,m,C,S,I[_+6],23,76029189),S=g(S,b,m,C,I[_+9],4,-640364487),C=g(C,S,b,m,I[_+12],11,-421815835),m=g(m,C,S,b,I[_+15],16,530742520),S=R(S,b=g(b,m,C,S,I[_+2],23,-995338651),m,C,I[_],6,-198630844),C=R(C,S,b,m,I[_+7],10,1126891415),m=R(m,C,S,b,I[_+14],15,-1416354905),b=R(b,m,C,S,I[_+5],21,-57434055),S=R(S,b,m,C,I[_+12],6,1700485571),C=R(C,S,b,m,I[_+3],10,-1894986606),m=R(m,C,S,b,I[_+10],15,-1051523),b=R(b,m,C,S,I[_+1],21,-2054922799),S=R(S,b,m,C,I[_+8],6,1873313359),C=R(C,S,b,m,I[_+15],10,-30611744),m=R(m,C,S,b,I[_+6],15,-1560198380),b=R(b,m,C,S,I[_+13],21,1309151649),S=R(S,b,m,C,I[_+4],6,-145523070),C=R(C,S,b,m,I[_+11],10,-1120210379),m=R(m,C,S,b,I[_+2],15,718787259),b=R(b,m,C,S,I[_+9],21,-343485551),S=o(S,ht),b=o(b,ot),m=o(m,k),C=o(C,Tt);return[S,b,m,C]}function B(I){for(var Z="",ht=32*I.length,ot=0;ot<ht;ot+=8)Z+=String.fromCharCode(I[ot>>5]>>>ot%32&255);return Z}function q(I){var Z=[];for(Z[(I.length>>2)-1]=void 0,ot=0;ot<Z.length;ot+=1)Z[ot]=0;for(var ht=8*I.length,ot=0;ot<ht;ot+=8)Z[ot>>5]|=(255&I.charCodeAt(ot/8))<<ot%32;return Z}function rt(I){for(var Z,ht="0123456789abcdef",ot="",k=0;k<I.length;k+=1)Z=I.charCodeAt(k),ot+=ht.charAt(Z>>>4&15)+ht.charAt(15&Z);return ot}function at(I){return unescape(encodeURIComponent(I))}function Q(I){return B(P(q(I=at(I)),8*I.length))}function $(I,Z){return(function(ht,ot){var k,Tt=q(ht),S=[],b=[];for(S[15]=b[15]=void 0,16<Tt.length&&(Tt=P(Tt,8*ht.length)),k=0;k<16;k+=1)S[k]=909522486^Tt[k],b[k]=1549556828^Tt[k];return ot=P(S.concat(q(ot)),512+8*ot.length),B(P(b.concat(ot),640))})(at(I),at(Z))}function _e(I,Z,ht){return Z?ht?$(Z,I):rt($(Z,I)):ht?Q(I):rt(Q(I))}return _e})(),Oe=Dn;function vr(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function Ar(o){if(typeof o!="object"||o===null)return o;let a=Object.keys(o).sort(),u={};for(let v of a)u[v]=o[v];return JSON.stringify(u)}function Dr(o,a){let u={appId:o.appId,randomStr:o.randomStr,data:o.data},v=Object.keys(u).sort(),g="";for(let[R,P]of v.entries())g+=`${P}=${u[P]}`,R<v.length-1&&(g+="&");return g+=`&secretKey=${a}`,Oe(g)}var In=(o,a,u,v)=>{let g=re();return g==="taro"?Taro.request({url:o,method:a,data:u,header:v}).then(R=>R):g==="uni"?new Promise((R,P)=>{uni.request({url:o,method:a,data:u,header:v,success:B=>R(B),fail:B=>P(B)})}):g==="wechat"?new Promise((R,P)=>{wx.request({url:o,method:a,data:u,header:v,success:B=>R(B),fail:B=>P(B)})}):g==="alipay"?new Promise((R,P)=>{my.request({url:o,method:a,data:u,headers:v,success:B=>R(B),fail:B=>P(B)})}):fetch(o,{method:a,headers:v,body:JSON.stringify(u)}).then(async R=>({statusCode:R.status,data:await R.json()}))},Qe=class{constructor(a=null){Ye(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||de()||{}}getExternalEnv(){var a;return((a=this.getCurrentConfig())==null?void 0:a.externalEnv)||fe.PROD}getExternalHost(){let a=this.getExternalEnv();return Pe[a]||Pe.prod}generateSign(a={}){let u=this.getCurrentConfig(),{externalAppId:v,externalAppSecret:g}=u;if(!v||!g)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let R=vr(),P=Ar(a),B=Dr({appId:v,randomStr:R,data:P},g);return{appId:v,randomStr:R,sign:B}}buildRequestBody(a={}){let u=this.generateSign(a);return Zt(gt({},u),{data:a})}buildUrl(a){return`${this.getExternalHost()}${a}`}async request(a){let{path:u,method:v="POST",data:g={},header:R={},needSign:P=!0,beforeRequest:B,afterResponse:q}=a,rt=this.buildUrl(u),at=gt({"content-type":"application/json"},R),Q=P?this.buildRequestBody(g):g;B&&typeof B=="function"&&await B({url:rt,method:v,data:Q,header:at}),x.info(`\u53D1\u8D77${v}\u8BF7\u6C42:`,{path:u,method:v});try{let $=await In(rt,v,Q,at);if(x.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:$.statusCode}),q&&typeof q=="function"&&await q($.data),$.statusCode===200&&$.data.code===200)return $.data.data;throw{code:$.data.code,msg:$.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:$.data}}catch($){throw($==null?void 0:$.code)!==void 0?$:(x.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:$}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:$})}}get(a,u={},v={}){return this.request(gt({path:a,method:"GET",data:u},v))}post(a,u={},v={}){return this.request(gt({path:a,method:"POST",data:u},v))}},Ir=(o=null)=>new Qe(o);var Ze=Te(),tr=Ir();function Rr(o){let a=je(o==null?void 0:o.equipmentValue,"equipmentValue");return a.valid?Ze.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Er(o){let a=Ce(o,["idMd5Value","rtaStrategy"]);return a.valid?tr.post("/open/rest/cpa/jd/rta-check",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Sr(o){try{let a={thirdPlatform:o.thirdPlatform,thirdPlatformUserId:o.thirdPlatformUserId,thirdPlatformEquipmentValue:o.thirdPlatformEquipmentValue,os:o.os,client:"wxMini"};o.phone&&(a.mobileMd5=Oe(o.phone)),o.extendData&&(Object.prototype.toString.call(o.extendData)==="[object Object]"?a.extendData=o.extendData:x.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let u=await tr.post("/open/rest/cpa/jd/insurance/get",a);return u?u.jumpMode==1?{jumpMode:1,appId:u.appId,url:u.url}:{jumpMode:2,url:u.url,channel:u.channelId}:void 0}catch(a){throw x.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",a),a}}function Tr(o){let a=je(o==null?void 0:o.equipmentValue,"equipmentValue");return a.valid?Ze.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}function br(o){let a=Ce(o,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return a.valid?Ze.post("/gw/advert/customer/cpa-activity/jd/rta/validate",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Pr(o){let a=await me(),u={thirdPlatform:o.thirdPlatform,thirdPlatformUserId:o.thirdPlatformUserId,thirdPlatformEquipmentValue:o.thirdPlatformEquipmentValue,os:a,client:o.client};return o.phone&&(u.mobileMd5=Oe(o.phone)),o.extendData&&(Object.prototype.toString.call(o.extendData)==="[object Object]"?u.extendData=o.extendData:x.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),tr.post("/open/rest/cpa/jd/cash-loan/get",u)}async function wr(o){let{phone:a,rtaId:u,equipmentId:v,lyyUserId:g,entrance:R}=o;if(!a)return K(xt.INVALID_PARAM,bt[2001]);if(!v)return K(xt.INVALID_PARAM,bt[2002]);try{if(u){x.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let Q=await br({phone:a,lyyEquipmentValue:v,lyyUserId:g||"",rtaId:u});if(Q.code!=="0000000"||!Q.body||Q.body.state!=1)return x.error("RTA\u9A8C\u8BC1\u5931\u8D25",Q),K(2003,bt[2003]);x.info("RTA\u9A8C\u8BC1\u6210\u529F",Q.body)}x.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:a});let P=await me(),B=await Tr({phone:a,equipmentValue:v,os:P,entrance:R});if(B.code!=="0000000"||!B.body)return x.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",B),K(2004,bt[2004]);let{appId:q,targetUrl:rt}=B.body;if(!q||!rt)return x.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:q,targetUrl:rt}),K(2005,bt[2005]);let at=K(xt.SUCCESS,"\u6210\u529F",{appId:q,targetUrl:rt});return x.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",at),at}catch(P){return x.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",P),K(xt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function Cr(o){let{phone:a,rtaId:u,thirdPlatform:v,thirdPlatformUserId:g,thirdPlatformEquipmentValue:R}=o;if(!a)return K(xt.INVALID_PARAM,bt[2001]);if(!v)return K(2008,bt[2008]);if(!g)return K(2009,bt[2009]);if(!R)return K(2010,bt[2010]);try{if(u){x.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let $=await Er({idMd5Value:a,rtaStrategy:u});if($.status!=1)return x.error("RTA\u9A8C\u8BC1\u5931\u8D25",$),K(2003,bt[2003]);x.info("RTA\u9A8C\u8BC1\u6210\u529F",$)}let P=await Pr(o),{url:B,channelId:q,matchFlag:rt,jumpMode:at,appId:Q}=P||{};return rt?at===3?!Q||!B?K(2007,bt[2007]):K(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:Q,url:B}):K(2007,bt[2007]):K(2006,bt[2006])}catch(P){return x.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",P),K(xt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var be=null,Ne=null;try{Ne=Nr()}catch(o){}function Fr(){return be||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(be=globalThis.LyyGetCommandSDK,be):Ne?(be=Ne.LyyGetCommandSDK||Ne.default||Ne,be):null)}function xr(o){var u;x.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",o);let a=Fr();a!=null&&a.getJrCommand?a.getJrCommand(o):(u=a==null?void 0:a.default)!=null&&u.getJrCommand?a.default.getJrCommand(o):(x.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),o.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function Rn(o,a){return new Promise((u,v)=>{try{xr({url:o,channel:a,callback:g=>{g.code==="0"?u(g.data):v({msg:g.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(g){v(g)}})}async function Lr(o){try{let a=await me(),u=gt({os:a},o);x.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",u);let{code:v,body:g}=await Rr(u);if(v==="0000000"&&g){let{url:R,channelId:P,matchFlag:B,jumpMode:q,appId:rt}=g;if(!B)return K(2101,bt[2101]);if(q===1)return x.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),K(2102,bt[2102]);if(q===2)return re()==="web"&&x.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:R}),!R||!P?K(2103,bt[2103]):new Promise(at=>{xr({url:R,channel:P,callback:async Q=>{if((Q==null?void 0:Q.code)==="0")try{await Ke(Q==null?void 0:Q.data),at(K(xt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch($){at(K(2105,bt[2105]))}else at(K(2105,bt[2105]))}})});if(q===3)return!rt||!R?K(2103,bt[2103]):K(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:rt,path:R})}return K(2104,bt[2104])}catch(a){return x.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",a),K(xt.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function Ur(o){x.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let a=await Sr(Zt(gt({},o),{os:await me()}));if(!a)return x.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),K(2106,bt[2106]);if(a.jumpMode===1)return x.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:a.appId,url:a.url}),K(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:a.appId,path:a.url});if(a.jumpMode===2){if(re()==="web")return x.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:a.url}),K(xt.SUCCESS,"\u6210\u529F",{type:"h5",url:a.url});try{let u=await Rn(a.url,a.channel);return await Ke(u),x.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),K(xt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(u){return x.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",u),We("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),K(2105,bt[2105])}}return x.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",a.jumpMode),K(2107,bt[2107])}catch(a){let u=typeof a=="string"?a:(a==null?void 0:a.msg)||(a==null?void 0:a.message)||"\u672A\u77E5\u9519\u8BEF";return x.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",u),We("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),u.includes("RTA")||u.includes("\u8D44\u683C")?K(2108,bt[2108]):K(xt.NETWORK_ERROR,u)}}var rr={};Xe(rr,{DyErrorCode:()=>Se,getDyPayRtaData:()=>Vr,handleDyPayFlow:()=>Jr});var En=["weapp","h5"],Sn=["default","jsapi"];function Tn(o){return En.includes(o)}var bn=["h5","ulink"];function Pn(o){return bn.includes(o)}function wn(o){return Sn.includes(o)}var Cn=["switchTab","reLaunch","redirectTo","navigateTo"];function On(o){return Cn.includes(o)}function Yr(o){return o.telephone?o.price?o.equipmentValue?o.businessType?o.client&&!Tn(o.client)?{valid:!1,errorCode:3004}:o.returnType&&!Pn(o.returnType)?{valid:!1,errorCode:3018}:o.payClientType&&!wn(o.payClientType)?{valid:!1,errorCode:3004}:o.douyinOrderExtendData&&typeof o.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:o.backWay&&o.client==="weapp"&&!On(o.backWay)?{valid:!1,errorCode:3016}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}:{valid:!1,errorCode:3001}}function Mr(o){return o.equipmentValue?o.telephone?{valid:!0,errorCode:0}:{valid:!1,errorCode:3001}:{valid:!1,errorCode:3002}}var Be=Te();async function jr(o){let{price:a,equipmentValue:u,douyinOrderExtendData:v,douyinCommodityVirtualFlag:g,businessType:R,platformActivities:P={}}=o,B={businessType:R,equipmentValue:u,payInfoBusinessType:"commonDouyinPayment",platformActivities:gt({douyinCommodityVirtualFlag:g||!1,douyinCommodityPrice:a,douyinOrderExtendData:v||""},P)};try{let q=await Be.post("/gw/advert/customer/payment/pay-info",B);return q.code!=="0000000"||!(q!=null&&q.body)?Promise.reject({code:3006,message:q.message||Bt[3006]}):(q.body.platformActivities=B.platformActivities,q)}catch(q){return x.error("getDyOrderAmountFn error:",q),Promise.reject({code:3007,message:Bt[3007]})}}async function Br(o){var a,u;try{let v=o.commodityList.map(Q=>(Q.commodity=Q.commodityId,delete Q.commodityId,Q.quantity=Q.quantity||1,Q)),g=o.advertExtendInfo&&Object.keys(o.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:o.advertExtendInfo}):"",R=re(),P="";R==="wechat"?P="wechatMini":R==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(P="wechatHtml");let B=o.payClientType==="jsapi",q=B?22:21,rt=gt(gt(gt({businessType:o.businessType,fixedClientType:q,channelCode:null,douyinData:{loginMobile:o.telephone||""},equipmentUseFlag:!0,payEquipmentDTO:{equipmentValue:o.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:g,transType:5,actualFee:o.totalFee,totalFee:o.totalFee,commodityList:v,clientSourceDetailType:P,platformActivities:o.platformActivities||{}},o.commoditySign&&{commoditySign:o.commoditySign}),o.unifiedOrderExtendData&>({},o.unifiedOrderExtendData)),B?{appId:((a=o.jsapiInfo)==null?void 0:a.appId)||"",openId:((u=o.jsapiInfo)==null?void 0:u.douyinOpenId)||""}:{}),at=await Be.post("/gw/payment-bff/unified/order",rt);return at.code!=="0000000"||!(at!=null&&at.body)?Promise.reject({code:3008,message:at.message||Bt[3008]}):at}catch(v){return x.error("dyUnifiedOrderFn error:",v),Promise.reject({code:3009,message:Bt[3009]})}}async function qr(o){let a={equipmentValue:o.equipmentValue,phone:o.telephone||""};o.price&&(a.orderAmount=o.price);try{let u=await Be.post("/gw/advert/customer/douyin/pay/check",a);return u.code!=="0000000"||!(u!=null&&u.body)?Promise.reject({code:3013,message:u.message||Bt[3013]}):u}catch(u){return x.error("getDyPayRtaData error:",u),Promise.reject({code:3014,message:(u==null?void 0:u.message)||Bt[3014]})}}async function kr(){try{let o=await Be.get("/gw/advert/customer/douyin/pay/jsapi/info");return o.code!=="0000000"||!(o!=null&&o.body)?Promise.reject({code:3019,message:o.message||Bt[3019]}):{appId:o.body.appId,douyinOpenId:o.body.douyinOpenId}}catch(o){return x.error("getDyPayJsapiInfoFn error:",o),Promise.reject({code:(o==null?void 0:o.code)||3020,message:(o==null?void 0:o.message)||Bt[3020]})}}async function Jr(o){var u,v,g,R;let a=Yr(o);if(!a.valid)return K(a.errorCode,Bt[a.errorCode]);try{let P=await jr({price:o.price,equipmentValue:o.equipmentValue,businessType:o.businessType,douyinOrderExtendData:(o==null?void 0:o.douyinOrderExtendData)||"",platformActivities:(o==null?void 0:o.platformActivities)||{},douyinCommodityVirtualFlag:(o==null?void 0:o.douyinCommodityVirtualFlag)||!1}),B=o.payClientType==="jsapi"?await kr():void 0,q=await Br(Zt(gt(Zt(gt({},P.body),{telephone:o.telephone,equipmentValue:o.equipmentValue,businessType:o.businessType}),o.unifiedOrderExtendData&&{unifiedOrderExtendData:o.unifiedOrderExtendData}),{payClientType:o.payClientType,jsapiInfo:B})),rt=((u=q==null?void 0:q.body)==null?void 0:u.h5Url)||"",at=((v=q==null?void 0:q.body)==null?void 0:v.outTradeNo)||"";if(o.returnType==="ulink"){let $=rt?await Ln(Zt(gt({},o),{dyUrl:rt})):"";return $?K(0,"success",{ulinkUrl:$,outTradeNo:at}):K(3010,Bt[3010])}if(o.payClientType==="jsapi"){let $=Nn((g=q==null?void 0:q.body)==null?void 0:g.payInfo);return K(0,"success",{appId:(B==null?void 0:B.appId)||"",payInfo:$,outTradeNo:at})}let Q=rt?await xn(Zt(gt({},o),{dyUrl:rt})):"";return Q?K(0,"success",{h5Url:Q,outTradeNo:at}):K(3010,Bt[3010])}catch(P){x.error("handleDyPayFlow error:",P);let B=(R=P==null?void 0:P.code)!=null?R:3012,q=(P==null?void 0:P.message)||Bt[3012];return K(B,q)}}function Nn(o){if(!o)throw{code:3021,message:Bt[3021]};try{let a=JSON.parse(o);if(!Fn(a))throw new Error("invalid payInfo fields");return a}catch(a){throw{code:3022,message:Bt[3022],error:a}}}function Fn(o){return typeof o.timeStamp=="string"&&o.timeStamp!==""&&typeof o.nonceStr=="string"&&o.nonceStr!==""&&typeof o.package=="string"&&o.package!==""&&typeof o.signType=="string"&&o.signType!==""&&typeof o.paySign=="string"&&o.paySign!==""}async function xn(o){let a=de(),u=we(a.env||"prod",""),v=typeof a.getAuthToken=="function"?await a.getAuthToken():"",g=o.client||"weapp";return`${u}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${g}&equipmentId=${o.equipmentValue}&dyUrl=${o.dyUrl}&fromUrl=${encodeURIComponent(o.fromUrl||"")}&backUrl=${encodeURIComponent(o.backUrl||"")}&backWay=${o.backWay||""}&url_token=${v}`}async function Ln(o){let a=de(),u=we(a.env||"prod",""),v=typeof a.getAuthToken=="function"?await a.getAuthToken():"";return`${u}/pages/subAdvertising.html?#/douyinPayUlinkTransfer?equipmentId=${o.equipmentValue}&dyUrl=${encodeURIComponent(o.dyUrl)}&fromUrl=${encodeURIComponent(o.fromUrl||"")}&backUrl=${encodeURIComponent(o.backUrl||"")}&url_token=${v}`}async function Vr(o){var u;let a=Mr(o);if(!a.valid)return K(a.errorCode,Bt[a.errorCode]);try{let v=await qr({price:(o==null?void 0:o.price)||"",equipmentValue:o.equipmentValue,telephone:(o==null?void 0:o.telephone)||""});return K(0,"success",v.body)}catch(v){x.error("getDyPayRtaData error:",v);let g=(u=v==null?void 0:v.code)!=null?u:3015,R=(v==null?void 0:v.message)||Bt[3015];return K(g,R)}}var ar={};Xe(ar,{getDisplayAdConfig:()=>$r,normalizeDisplayAdData:()=>ir});var Un=Te();function Hr(o){let a=Ce(o,["placementId"]);if(!a.valid)return Promise.reject({code:"PARAM_ERROR",message:a.message});let u=de().env||"prod";return Un.get(`/gw/advert-plugin/api/v1/config/list/valid/${o.placementId}`,{},{authRequired:!1,baseDomain:gr(u)})}var Gr=30*1e3,Yn="__",or=new Map,nr=new Map;function Mn(o,a){return[o.appId||"",a,o.type||""].join(Yn)}function jn(o){let a=or.get(o);return a?a.expireAt<=Date.now()?(or.delete(o),x.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:o}),null):a.data:null}function Bn(o,a){or.set(o,{data:a,expireAt:Date.now()+Gr})}function qn(o){return Array.isArray(o==null?void 0:o.body)?o.body:[]}function kn(o){return String(o==null?void 0:o.code)!=="200"}function Jn(o,a){let u=String(o||a||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(u)?u:a||"banner"}function Xr(o){return String(o||"").trim().toLowerCase()}function Vn(o){var a;return!!o&&o.status!==0&&((a=o.platformConfig)==null?void 0:a.valid)!==!1}function Hn(o){return[...o].sort((a,u)=>{var R,P,B,q;let v=Number((R=a.priority)!=null?R:9999),g=Number((P=u.priority)!=null?P:9999);return v!==g?v-g:Number((B=u.weight)!=null?B:0)-Number((q=a.weight)!=null?q:0)})}function Kr(o){return o.find(a=>Xr(a.advertPlatform)==="gdt")||null}function Wr(o){return o.find(a=>Xr(a.advertPlatform)!=="gdt")||null}function Gn(o,a){return o&&a?"mixed":o?"wechat":a?"custom":"none"}function Xn(o,a){var g,R;let u=Kr(o),v=Wr(o);return u&&v?Number((g=u.priority)!=null?g:9999)<=Number((R=v.priority)!=null?R:9999)?"wechat-first":"custom-first":a==="custom"?"custom-only":a==="wechat"?"wechat-only":"wechat-first"}function Kn(o){var u;let a=Kr(o);return((u=a==null?void 0:a.platformConfig)==null?void 0:u.adId)||""}function Wn(o){let a=Wr(o),u=a==null?void 0:a.platformConfig;if(!u)return null;let v=u.image||u.imageUrl||"",g=u.video||u.videoUrl||"",R=u.poster||v||"",P=u.jumpUrl||u.url||u.webUrl||"";return!v&&!g?null:{image:v||void 0,video:g||void 0,poster:R||void 0,title:u.title,description:u.description,buttonText:u.buttonText,badgeText:u.badgeText,jumpSeconds:u.jumpSeconds,loadTimeout:u.loadTimeout||u.timeout,muted:u.muted,adSpec:u.adSpec,url:P||void 0,action:P?{type:"web",url:P}:void 0}}function ir(o,a){let u=Hn(o.filter(Vn)),v=Wn(u),g=Kn(u),R=Jn(void 0,a),P=Gn(g,v),B=Xn(u,P);return{show:!!(g||v),adId:"",type:R,provider:P,priority:B,unitId:g,customAd:v,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:o}}async function $r(o){let a=o.placementId||o.adId||"",u=Mn(o,a),v=jn(u);if(v)return x.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:u,placementId:a}),K(xt.SUCCESS,"\u6210\u529F",v);let g=nr.get(u);if(g)return x.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:u,placementId:a}),g;let R=(async()=>{try{x.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",o);let P=await Hr({placementId:a}),B=qn(P);if(x.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:u,placementId:a,response:P,body:B}),kn(P)||!B)return x.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",P),K(xt.UNKNOWN_ERROR,(P==null?void 0:P.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let q=ir(B,o.type);return q.adId=a,q.cache=Zt(gt({},q.cache),{enable:!0,ttl:Gr}),Bn(u,q),x.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:u,placementId:a,provider:q.provider,priority:q.priority,hasUnitId:!!q.unitId,hasCustomAd:!!q.customAd}),K(xt.SUCCESS,"\u6210\u529F",q)}catch(P){return x.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:u,placementId:a,error:P}),K(xt.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{nr.delete(u)}})();return nr.set(u,R),R}function $n(o={}){x.info("\u670D\u52A1\u521D\u59CB\u5316",o);let a=gt(gt({},Ee),o);a.env&&!Me[a.env]&&(x.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${a.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.env=Wt.PROD),a.externalEnv&&!Pe[a.externalEnv]&&(x.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${a.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.externalEnv=fe.PROD),a.debug!==void 0&&x.setEnable(a.debug),_r(a),x.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",a)}function zn(o={}){let a="",u=null;async function v(){if(typeof o.getAuthToken=="function"){let R=await o.getAuthToken();if(R)return R}return u&&typeof u.getStorage=="function"&&u.getStorage("auth_token")||""}let g={name:"services",setToken(R){return a=R||"",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",a),g},async getAuthToken(){return a||v()},clearToken(){return a="",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",""),g},install(R){u=R;let P=Zt(gt({},o),{getAuthToken:()=>g.getAuthToken()});$n(P),x.info("services installed via nova.use()"),Object.assign(R,{jd:gt({},er),dy:gt({},rr),ads:gt({},ar),setToken:g.setToken,clearToken:g.clearToken})}};return g}export{Se as DyErrorCode,Bt as DyErrorMessage,Wt as ENV_TYPE,fe as EXTERNAL_ENV_TYPE,$e as JdErrorCode,bt as JdErrorMessage,zn as createServices,$r as getDisplayAdConfig,Vr as getDyPayRtaData,Jr as handleDyPayFlow,Lr as handleJdInsurance,Ur as handleJdInsuranceExt,Cr as handleJdjrCashLoanExt,wr as handleJdjrCashLoanFlow,ir as normalizeDisplayAdData};
|
|
4
|
+
`),c+=It[t[j]>>2]+It[(3&t[j])<<4|t[j+1]>>4]+It[(15&t[j+1])<<2|t[j+2]>>6]+It[63&t[j+2]];for(r=0;r<s;r++)c+="=";return c},b4_decode:function(t){var r=0,s=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 p,h,E,O,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)p=It.indexOf(t.charAt(r++)),h=It.indexOf(t.charAt(r++)),E=It.indexOf(t.charAt(r++)),O=It.indexOf(t.charAt(r++)),w[s++]=p<<2|h>>4,w[s++]=(15&h)<<4|E>>2,w[s++]=(3&E)<<6|O;for(r=0;r<c;r++)if(w.pop()!=0)return null;return w}};function pt(){}pt.encode=function(t,r,s){for(var c=new Array(2*s),p=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),h=r,E=0;h<s+r;h++,E++)c[E]=p[(255&t[h])>>4],c[++E]=p[15&t[h]];return c.join("")},pt.decode=function(t){if(t==null||t==""||t.length%2!=0)return null;for(var r=t.length/2,s=pt.toCharCodeArray(t),c=new Array(r),p=0;p<r;p++){if(48<=s[2*p]&&s[2*p]<=57)c[p]=s[2*p]-48<<4;else if(65<=s[2*p]&&s[2*p]<=70)c[p]=s[2*p]-65+10<<4;else{if(!(97<=s[2*p]&&s[2*p]<=102))return null;c[p]=s[2*p]-97+10<<4}if(48<=s[2*p+1]&&s[2*p+1]<=57)c[p]=c[p]|s[2*p+1]-48;else if(65<=s[2*p+1]&&s[2*p+1]<=70)c[p]=c[p]|s[2*p+1]-65+10;else{if(!(97<=s[2*p+1]&&s[2*p+1]<=102))return null;c[p]=c[p]|s[2*p+1]-97+10}}return c},pt.toCharCodeArray=function(t){for(var r=new Array(t.length),s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r};var Vt=pt,Ht=Vt;(Ut=function(){}).utf8StrToh6=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],p=0;p<s;p++)c[p]=r.charCodeAt(p).toString(16);return c.join("")},Ut.utf8StrToBytes=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],p=0;p<s;p++)c[p]=r.charCodeAt(p);return c},Ut.hexToUtf8Str=function(t){for(var r=Ht.decode(t),s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.bytesToUtf8Str=function(t){for(var r=t,s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.intToByte=function(t){return new Array(t>>24&255,t>>16&255,t>>8&255,255&t)},Ut.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 Jt,zt=Ut,Gt={exports:{}};Jt=Gt,function(){function t(e,n,i){e!=null&&(typeof e=="number"?this.fromNumber(e,n,i):n==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,n))}function r(){return new t(null)}var s=(s=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(t.prototype.am=function(e,n,i,f,v,N){for(var M=32767&n,L=n>>15;0<=--N;){var Ft=32767&this[e],Kt=this[e++]>>15,se=L*Ft+Kt*M;v=((Ft=M*Ft+((32767&se)<<15)+i[f]+(1073741823&v))>>>30)+(se>>>15)+L*Kt+(v>>>30),i[f++]=1073741823&Ft}return v},30):s&&navigator.appName!="Netscape"?(t.prototype.am=function(e,n,i,f,v,N){for(;0<=--N;){var M=n*this[e++]+i[f]+v;v=Math.floor(M/67108864),i[f++]=67108863&M}return v},26):(t.prototype.am=function(e,n,i,f,v,N){for(var M=16383&n,L=n>>14;0<=--N;){var Ft=16383&this[e],Kt=this[e++]>>14,se=L*Ft+Kt*M;v=((Ft=M*Ft+((16383&se)<<14)+i[f]+v)>>28)+(se>>14)+L*Kt,i[f++]=268435455&Ft}return v},28);t.prototype.DB=s,t.prototype.DM=(1<<s)-1,t.prototype.DV=1<<s,t.prototype.FV=Math.pow(2,52),t.prototype.F1=52-s,t.prototype.F2=2*s-52;for(var c=new Array,p=48,h=0;h<=9;++h)c[p++]=h;for(p=97,h=10;h<36;++h)c[p++]=h;for(p=65,h=10;h<36;++h)c[p++]=h;function E(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function O(e,n){return(e=c[e.charCodeAt(n)])==null?-1:e}function w(e){var n=r();return n.fromInt(e),n}function it(e){var n,i=1;return(n=e>>>16)!=0&&(e=n,i+=16),(n=e>>8)!=0&&(e=n,i+=8),(n=e>>4)!=0&&(e=n,i+=4),(n=e>>2)!=0&&(e=n,i+=2),(n=e>>1)!=0&&(e=n,i+=1),i}function st(e){this.m=e}function T(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function H(e,n){return e&n}function tt(e,n){return e|n}function Q(e,n){return e^n}function ut(e,n){return e&~n}function dt(){}function Ct(e){return e}function Y(e){this.r2=r(),this.q3=r(),t.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}st.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},st.prototype.revert=function(e){return e},st.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},st.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i),this.reduce(i)},st.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},T.prototype.convert=function(e){var n=r();return e.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),e.s<0&&0<n.compareTo(t.ZERO)&&this.m.subTo(n,n),n},T.prototype.revert=function(e){var n=r();return e.copyTo(n),this.reduce(n),n},T.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var n=0;n<this.m.t;++n){var i=32767&e[n],f=i*this.mpl+((i*this.mph+(e[n]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[i=n+this.m.t]+=this.m.am(0,f,e,n,0,this.m.t);e[i]>=e.DV;)e[i]-=e.DV,e[++i]++}e.clamp(),e.drShiftTo(this.m.t,e),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},T.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i),this.reduce(i)},T.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},t.prototype.copyTo=function(e){for(var n=this.t-1;0<=n;--n)e[n]=this[n];e.t=this.t,e.s=this.s},t.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0<e?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},t.prototype.fromString=function(e,n){var i;if(n==16)i=4;else if(n==8)i=3;else if(n==256)i=8;else if(n==2)i=1;else if(n==32)i=5;else{if(n!=4)return void this.fromRadix(e,n);i=2}this.t=0,this.s=0;for(var f=e.length,v=!1,N=0;0<=--f;){var M=i==8?255&e[f]:O(e,f);M<0?e.charAt(f)=="-"&&(v=!0):(v=!1,N==0?this[this.t++]=M:N+i>this.DB?(this[this.t-1]|=(M&(1<<this.DB-N)-1)<<N,this[this.t++]=M>>this.DB-N):this[this.t-1]|=M<<N,(N+=i)>=this.DB&&(N-=this.DB))}i==8&&128&e[0]&&(this.s=-1,0<N&&(this[this.t-1]|=(1<<this.DB-N)-1<<N)),this.clamp(),v&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var e=this.s&this.DM;0<this.t&&this[this.t-1]==e;)--this.t},t.prototype.dlShiftTo=function(e,n){for(var i=this.t-1;0<=i;--i)n[i+e]=this[i];for(i=e-1;0<=i;--i)n[i]=0;n.t=this.t+e,n.s=this.s},t.prototype.drShiftTo=function(e,n){for(var i=e;i<this.t;++i)n[i-e]=this[i];n.t=Math.max(this.t-e,0),n.s=this.s},t.prototype.lShiftTo=function(e,n){for(var i=e%this.DB,f=this.DB-i,v=(1<<f)-1,N=Math.floor(e/this.DB),M=this.s<<i&this.DM,L=this.t-1;0<=L;--L)n[L+N+1]=this[L]>>f|M,M=(this[L]&v)<<i;for(L=N-1;0<=L;--L)n[L]=0;n[N]=M,n.t=this.t+N+1,n.s=this.s,n.clamp()},t.prototype.rShiftTo=function(e,n){n.s=this.s;var i=Math.floor(e/this.DB);if(i>=this.t)n.t=0;else{var f=e%this.DB,v=this.DB-f,N=(1<<f)-1;n[0]=this[i]>>f;for(var M=i+1;M<this.t;++M)n[M-i-1]|=(this[M]&N)<<v,n[M-i]=this[M]>>f;0<f&&(n[this.t-i-1]|=(this.s&N)<<v),n.t=this.t-i,n.clamp()}},t.prototype.subTo=function(e,n){for(var i=0,f=0,v=Math.min(e.t,this.t);i<v;)f+=this[i]-e[i],n[i++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f-=e.s;i<this.t;)f+=this[i],n[i++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;i<e.t;)f-=e[i],n[i++]=f&this.DM,f>>=this.DB;f-=e.s}n.s=f<0?-1:0,f<-1?n[i++]=this.DV+f:0<f&&(n[i++]=f),n.t=i,n.clamp()},t.prototype.multiplyTo=function(e,n){var i=this.abs(),f=e.abs(),v=i.t;for(n.t=v+f.t;0<=--v;)n[v]=0;for(v=0;v<f.t;++v)n[v+i.t]=i.am(0,f[v],n,v,0,i.t);n.s=0,n.clamp(),this.s!=e.s&&t.ZERO.subTo(n,n)},t.prototype.squareTo=function(e){for(var n=this.abs(),i=e.t=2*n.t;0<=--i;)e[i]=0;for(i=0;i<n.t-1;++i){var f=n.am(i,n[i],e,2*i,0,1);(e[i+n.t]+=n.am(i+1,2*n[i],e,2*i+1,f,n.t-i-1))>=n.DV&&(e[i+n.t]-=n.DV,e[i+n.t+1]=1)}0<e.t&&(e[e.t-1]+=n.am(i,n[i],e,2*i,0,1)),e.s=0,e.clamp()},t.prototype.divRemTo=function(e,n,i){var f=e.abs();if(!(f.t<=0)){if((Kt=this.abs()).t<f.t)return n!=null&&n.fromInt(0),void(i!=null&&this.copyTo(i));i==null&&(i=r());var v=r(),N=this.s,M=e.s;0<(e=this.DB-it(f[f.t-1]))?(f.lShiftTo(e,v),Kt.lShiftTo(e,i)):(f.copyTo(v),Kt.copyTo(i));var L=v.t,Ft=v[L-1];if(Ft!=0){var Kt=Ft*(1<<this.F1)+(1<L?v[L-2]>>this.F2:0),se=this.FV/Kt,le=(1<<this.F1)/Kt,Re=1<<this.F2,qt=i.t,ge=qt-L,jt=n==null?r():n;for(v.dlShiftTo(ge,jt),0<=i.compareTo(jt)&&(i[i.t++]=1,i.subTo(jt,i)),t.ONE.dlShiftTo(L,jt),jt.subTo(v,v);v.t<L;)v[v.t++]=0;for(;0<=--ge;){var He=i[--qt]==Ft?this.DM:Math.floor(i[qt]*se+(i[qt-1]+Re)*le);if((i[qt]+=v.am(0,He,i,ge,0,L))<He)for(v.dlShiftTo(ge,jt),i.subTo(jt,i);i[qt]<--He;)i.subTo(jt,i)}n!=null&&(i.drShiftTo(L,n),N!=M&&t.ZERO.subTo(n,n)),i.t=L,i.clamp(),0<e&&i.rShiftTo(e,i),N<0&&t.ZERO.subTo(i,i)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var n=3&e;return 0<(n=(n=(n=(n=n*(2-(15&e)*n)&15)*(2-(255&e)*n)&255)*(2-((65535&e)*n&65535))&65535)*(2-e*n%this.DV)%this.DV)?this.DV-n:-n},t.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},t.prototype.exp=function(e,n){if(4294967295<e||e<1)return t.ONE;var i,f=r(),v=r(),N=n.convert(this),M=it(e)-1;for(N.copyTo(f);0<=--M;)n.sqrTo(f,v),0<(e&1<<M)?n.mulTo(v,N,f):(i=f,f=v,v=i);return n.revert(f)},t.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var n;if(e==16)n=4;else if(e==8)n=3;else if(e==2)n=1;else if(e==32)n=5;else{if(e!=4)return this.toRadix(e);n=2}var i,f=(1<<n)-1,v=!1,N="",M=this.t,L=this.DB-M*this.DB%n;if(0<M--)for(L<this.DB&&0<(i=this[M]>>L)&&(v=!0,N=E(i));0<=M;)L<n?(i=(this[M]&(1<<L)-1)<<n-L,i|=this[--M]>>(L+=this.DB-n)):(i=this[M]>>(L-=n)&f,L<=0&&(L+=this.DB,--M)),(v=0<i||v)&&(N+=E(i));return v?N:"0"},t.prototype.negate=function(){var e=r();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(e){var n=this.s-e.s;if(n!=0)return n;var i=this.t;if((n=i-e.t)!=0)return this.s<0?-n:n;for(;0<=--i;)if((n=this[i]-e[i])!=0)return n;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+it(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var n=r();return this.abs().divRemTo(e,null,n),this.s<0&&0<n.compareTo(t.ZERO)&&e.subTo(n,n),n},t.prototype.modPowInt=function(e,n){return n=new(e<256||n.isEven()?st:T)(n),this.exp(e,n)},t.ZERO=w(0),t.ONE=w(1),dt.prototype.convert=Ct,dt.prototype.revert=Ct,dt.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i)},dt.prototype.sqrTo=function(e,n){e.squareTo(n)},Y.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var n=r();return e.copyTo(n),this.reduce(n),n},Y.prototype.revert=function(e){return e},Y.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);0<=e.compareTo(this.m);)e.subTo(this.m,e)},Y.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i),this.reduce(i)},Y.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)};var X,k=[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],G=(1<<26)/k[k.length-1];function W(){var e;e=new Date().getTime(),_t[et++]^=255&e,_t[et++]^=e>>8&255,_t[et++]^=e>>16&255,_t[et++]^=e>>24&255,Ve<=et&&(et-=Ve)}if(t.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},t.prototype.toRadix=function(e){if(e==null&&(e=10),this.signum()==0||e<2||36<e)return"0";var n=this.chunkSize(e),i=Math.pow(e,n),f=w(i),v=r(),N=r(),M="";for(this.divRemTo(f,v,N);0<v.signum();)M=(i+N.intValue()).toString(e).substr(1)+M,v.divRemTo(f,v,N);return N.intValue().toString(e)+M},t.prototype.fromRadix=function(e,n){this.fromInt(0);for(var i=this.chunkSize(n=n==null?10:n),f=Math.pow(n,i),v=!1,N=0,M=0,L=0;L<e.length;++L){var Ft=O(e,L);Ft<0?e.charAt(L)=="-"&&this.signum()==0&&(v=!0):(M=n*M+Ft,++N>=i&&(this.dMultiply(f),this.dAddOffset(M,0),M=N=0))}0<N&&(this.dMultiply(Math.pow(n,N)),this.dAddOffset(M,0)),v&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,n,i){if(typeof n=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),tt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var f=new Array;i=7&e,f.length=1+(e>>3),n.nextBytes(f),0<i?f[0]&=(1<<i)-1:f[0]=0,this.fromString(f,256)}},t.prototype.bitwiseTo=function(e,n,i){for(var f,v=Math.min(e.t,this.t),N=0;N<v;++N)i[N]=n(this[N],e[N]);if(e.t<this.t){for(f=e.s&this.DM,N=v;N<this.t;++N)i[N]=n(this[N],f);i.t=this.t}else{for(f=this.s&this.DM,N=v;N<e.t;++N)i[N]=n(f,e[N]);i.t=e.t}i.s=n(this.s,e.s),i.clamp()},t.prototype.changeBit=function(e,n){return e=t.ONE.shiftLeft(e),this.bitwiseTo(e,n,e),e},t.prototype.addTo=function(e,n){for(var i=0,f=0,v=Math.min(e.t,this.t);i<v;)f+=this[i]+e[i],n[i++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f+=e.s;i<this.t;)f+=this[i],n[i++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;i<e.t;)f+=e[i],n[i++]=f&this.DM,f>>=this.DB;f+=e.s}n.s=f<0?-1:0,0<f?n[i++]=f:f<-1&&(n[i++]=this.DV+f),n.t=i,n.clamp()},t.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(e,n){if(e!=0){for(;this.t<=n;)this[this.t++]=0;for(this[n]+=e;this[n]>=this.DV;)this[n]-=this.DV,++n>=this.t&&(this[this.t++]=0),++this[n]}},t.prototype.multiplyLowerTo=function(e,n,i){var f,v=Math.min(this.t+e.t,n);for(i.s=0,i.t=v;0<v;)i[--v]=0;for(f=i.t-this.t;v<f;++v)i[v+this.t]=this.am(0,e[v],i,v,0,this.t);for(f=Math.min(e.t,n);v<f;++v)this.am(0,e[v],i,v,0,n-v);i.clamp()},t.prototype.multiplyUpperTo=function(e,n,i){var f=i.t=this.t+e.t- --n;for(i.s=0;0<=--f;)i[f]=0;for(f=Math.max(n-this.t,0);f<e.t;++f)i[this.t+f-n]=this.am(n-f,e[f],i,0,0,this.t+f-n);i.clamp(),i.drShiftTo(1,i)},t.prototype.modInt=function(e){if(e<=0)return 0;var n=this.DV%e,i=this.s<0?e-1:0;if(0<this.t)if(n==0)i=this[0]%e;else for(var f=this.t-1;0<=f;--f)i=(n*i+this[f])%e;return i},t.prototype.millerRabin=function(e){var n=this.subtract(t.ONE),i=n.getLowestSetBit();if(i<=0)return!1;var f=n.shiftRight(i);k.length<(e=e+1>>1)&&(e=k.length);for(var v=r(),N=0;N<e;++N){v.fromInt(k[Math.floor(Math.random()*k.length)]);var M=v.modPow(f,this);if(M.compareTo(t.ONE)!=0&&M.compareTo(n)!=0){for(var L=1;L++<i&&M.compareTo(n)!=0;)if((M=M.modPowInt(2,this)).compareTo(t.ONE)==0)return!1;if(M.compareTo(n)!=0)return!1}}return!0},t.prototype.clone=function(){var e=r();return this.copyTo(e),e},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 e=this.t,n=new Array;n[0]=this.s;var i,f=this.DB-e*this.DB%8,v=0;if(0<e--)for(f<this.DB&&(i=this[e]>>f)!=(this.s&this.DM)>>f&&(n[v++]=i|this.s<<this.DB-f);0<=e;)f<8?(i=(this[e]&(1<<f)-1)<<8-f,i|=this[--e]>>(f+=this.DB-8)):(i=this[e]>>(f-=8)&255,f<=0&&(f+=this.DB,--e)),128&i&&(i|=-256),v==0&&(128&this.s)!=(128&i)&&++v,(0<v||i!=this.s)&&(n[v++]=i);return n},t.prototype.equals=function(e){return this.compareTo(e)==0},t.prototype.min=function(e){return this.compareTo(e)<0?this:e},t.prototype.max=function(e){return 0<this.compareTo(e)?this:e},t.prototype.and=function(e){var n=r();return this.bitwiseTo(e,H,n),n},t.prototype.or=function(e){var n=r();return this.bitwiseTo(e,tt,n),n},t.prototype.xor=function(e){var n=r();return this.bitwiseTo(e,Q,n),n},t.prototype.andNot=function(e){var n=r();return this.bitwiseTo(e,ut,n),n},t.prototype.not=function(){for(var e=r(),n=0;n<this.t;++n)e[n]=this.DM&~this[n];return e.t=this.t,e.s=~this.s,e},t.prototype.shiftLeft=function(e){var n=r();return e<0?this.rShiftTo(-e,n):this.lShiftTo(e,n),n},t.prototype.shiftRight=function(e){var n=r();return e<0?this.lShiftTo(-e,n):this.rShiftTo(e,n),n},t.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+(function(n){if(n==0)return-1;var i=0;return!(65535&n)&&(n>>=16,i+=16),!(255&n)&&(n>>=8,i+=8),!(15&n)&&(n>>=4,i+=4),!(3&n)&&(n>>=2,i+=2),!(1&n)&&++i,i})(this[e]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var e=0,n=this.s&this.DM,i=0;i<this.t;++i)e+=(function(f){for(var v=0;f!=0;)f&=f-1,++v;return v})(this[i]^n);return e},t.prototype.testBit=function(e){var n=Math.floor(e/this.DB);return n>=this.t?this.s!=0:!!(this[n]&1<<e%this.DB)},t.prototype.setBit=function(e){return this.changeBit(e,tt)},t.prototype.clearBit=function(e){return this.changeBit(e,ut)},t.prototype.flipBit=function(e){return this.changeBit(e,Q)},t.prototype.add=function(e){var n=r();return this.addTo(e,n),n},t.prototype.subtract=function(e){var n=r();return this.subTo(e,n),n},t.prototype.multiply=function(e){var n=r();return this.multiplyTo(e,n),n},t.prototype.divide=function(e){var n=r();return this.divRemTo(e,n,null),n},t.prototype.remainder=function(e){var n=r();return this.divRemTo(e,null,n),n},t.prototype.divideAndRemainder=function(e){var n=r(),i=r();return this.divRemTo(e,n,i),new Array(n,i)},t.prototype.modPow=function(e,n){var i=e.bitLength(),f=w(1);if(i<=0)return f;var v=i<18?1:i<48?3:i<144?4:i<768?5:6,N=new(i<8?st:n.isEven()?Y:T)(n),M=new Array,L=3,Ft=v-1,Kt=(1<<v)-1;if(M[1]=N.convert(this),1<v){var se=r();for(N.sqrTo(M[1],se);L<=Kt;)M[L]=r(),N.mulTo(se,M[L-2],M[L]),L+=2}var le,Re,qt=e.t-1,ge=!0,jt=r();for(i=it(e[qt])-1;0<=qt;){for(Ft<=i?le=e[qt]>>i-Ft&Kt:(le=(e[qt]&(1<<i+1)-1)<<Ft-i,0<qt&&(le|=e[qt-1]>>this.DB+i-Ft)),L=v;!(1&le);)le>>=1,--L;if((i-=L)<0&&(i+=this.DB,--qt),ge)M[le].copyTo(f),ge=!1;else{for(;1<L;)N.sqrTo(f,jt),N.sqrTo(jt,f),L-=2;0<L?N.sqrTo(f,jt):(Re=f,f=jt,jt=Re),N.mulTo(jt,M[le],f)}for(;0<=qt&&!(e[qt]&1<<i);)N.sqrTo(f,jt),Re=f,f=jt,jt=Re,--i<0&&(i=this.DB-1,--qt)}return N.revert(f)},t.prototype.modInverse=function(e){var n=e.isEven();if(this.isEven()&&n||e.signum()==0)return t.ZERO;for(var i=e.clone(),f=this.clone(),v=w(1),N=w(0),M=w(0),L=w(1);i.signum()!=0;){for(;i.isEven();)i.rShiftTo(1,i),n?(v.isEven()&&N.isEven()||(v.addTo(this,v),N.subTo(e,N)),v.rShiftTo(1,v)):N.isEven()||N.subTo(e,N),N.rShiftTo(1,N);for(;f.isEven();)f.rShiftTo(1,f),n?(M.isEven()&&L.isEven()||(M.addTo(this,M),L.subTo(e,L)),M.rShiftTo(1,M)):L.isEven()||L.subTo(e,L),L.rShiftTo(1,L);0<=i.compareTo(f)?(i.subTo(f,i),n&&v.subTo(M,v),N.subTo(L,N)):(f.subTo(i,f),n&&M.subTo(v,M),L.subTo(N,L))}return f.compareTo(t.ONE)!=0?t.ZERO:0<=L.compareTo(e)?L.subtract(e):L.signum()<0?(L.addTo(e,L),L.signum()<0?L.add(e):L):L},t.prototype.pow=function(e){return this.exp(e,new dt)},t.prototype.gcd=function(e){var n=this.s<0?this.negate():this.clone(),i=e.s<0?e.negate():e.clone();n.compareTo(i)<0&&(v=n,n=i,i=v);var f=n.getLowestSetBit(),v=i.getLowestSetBit();if(v<0)return n;for(0<(v=f<v?f:v)&&(n.rShiftTo(v,n),i.rShiftTo(v,i));0<n.signum();)0<(f=n.getLowestSetBit())&&n.rShiftTo(f,n),0<(f=i.getLowestSetBit())&&i.rShiftTo(f,i),0<=n.compareTo(i)?(n.subTo(i,n),n.rShiftTo(1,n)):(i.subTo(n,i),i.rShiftTo(1,i));return 0<v&&i.lShiftTo(v,i),i},t.prototype.isProbablePrime=function(e){var n,i=this.abs();if(i.t==1&&i[0]<=k[k.length-1]){for(n=0;n<k.length;++n)if(i[0]==k[n])return!0;return!1}if(i.isEven())return!1;for(n=1;n<k.length;){for(var f=k[n],v=n+1;v<k.length&&f<G;)f*=k[v++];for(f=i.modInt(f);n<v;)if(f%k[n++]==0)return!1}return i.millerRabin(e)},t.prototype.square=function(){var e=r();return this.squareTo(e),e},t.prototype.Barrett=Y,_t==null){var _t=new Array,et=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var St=new Uint8Array(32);for(window.crypto.getRandomValues(St),Yt=0;Yt<32;++Yt)_t[et++]=St[Yt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Nt=window.crypto.random(32),Yt=0;Yt<Nt.length;++Yt)_t[et++]=255&Nt.charCodeAt(Yt)}for(;et<Ve;)Yt=Math.floor(65536*Math.random()),_t[et++]=Yt>>>8,_t[et++]=255&Yt;et=0,W()}function Je(){if(X==null){for(W(),(X=new ke).init(_t),et=0;et<_t.length;++et)_t[et]=0;et=0}return X.next()}function dr(){}function ke(){this.i=0,this.j=0,this.S=new Array}dr.prototype.nextBytes=function(e){for(var n=0;n<e.length;++n)e[n]=Je()},ke.prototype.init=function(e){for(var n,i,f=0;f<256;++f)this.S[f]=f;for(f=n=0;f<256;++f)n=n+this.S[f]+e[f%e.length]&255,i=this.S[f],this.S[f]=this.S[n],this.S[n]=i;this.i=0,this.j=0},ke.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var Ve=256;Jt.exports={default:t,BigInteger:t,SecureRandom:dr}}.call(b);var Pt=Gt.exports.BigInteger,wt=(function(){function t(){z(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return I(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,s=r.toString(16);return s.length%2==1&&(s="0"+s),r<128?s:(128+s.length/2).toString(16)+s}},{key:"getValue",value:function(){return""}}]),t})(),ie=(function(){Z(r,wt);var t=J(r);function r(s){var c;return z(this,r),(c=t.call(this)).t="02",s&&(c.v=(function(p){if((h=p.toString(16))[0]!=="-")h.length%2==1?h="0"+h:h.match(/^[0-7]/)||(h="00"+h);else{var h,E=(h=h.substr(1)).length;E%2==1?E+=1:h.match(/^[0-7]/)||(E+=2);for(var O="",w=0;w<E;w++)O+="f";h=(h=(O=new Pt(O,16)).xor(p).add(Pt.ONE)).toString(16).replace(/^-/,"")}return h})(s)),c}return I(r,[{key:"getValue",value:function(){return this.v}}]),r})(),ne=(function(){Z(r,wt);var t=J(r);function r(s){var c;return z(this,r),(c=t.call(this)).t="30",c.asn1Array=s,c}return I(r,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(s){return s.getEncodedHex()})).join(""),this.v}}]),r})();function Mt(t,r){return+t[r+2]<8?1:128&+t.substr(r+2,2)}function ae(t,r){var s=Mt(t,r);return(t=t.substr(r+2,2*s))?(+t[0]<8?new Pt(t,16):new Pt(t.substr(2),16)).intValue():-1}function oe(t,r){return r+2*(Mt(t,r)+1)}var Lt=Gt.exports.BigInteger,kt=new Lt("3"),he=(function(){function t(r,s){z(this,t),this.x=s,this.q=r}return I(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})(),Qt=(function(){function t(r,s,c,p){z(this,t),this.curve=r,this.x=s,this.y=c,this.z=p==null?Lt.ONE:p,this.zinv=null}return I(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(Lt.ZERO)&&r.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Lt.ZERO))}},{key:"isInfinity",value:function(){return this.x===null&&this.y===null||this.z.equals(Lt.ZERO)&&!this.y.toBigInteger().equals(Lt.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 s=this.x.toBigInteger(),c=this.y.toBigInteger(),p=this.z,h=r.x.toBigInteger(),E=r.y.toBigInteger(),O=r.z,w=this.curve.q,it=s.multiply(O).mod(w);return r=h.multiply(p).mod(w),s=it.subtract(r),h=c.multiply(O).mod(w),c=E.multiply(p).mod(w),E=h.subtract(c),Lt.ZERO.equals(s)?Lt.ZERO.equals(E)?this.twice():this.curve.infinity:(c=it.add(r),r=p.multiply(O).mod(w),O=s.square().mod(w),p=s.multiply(O).mod(w),c=r.multiply(E.square()).subtract(c.multiply(O)).mod(w),s=s.multiply(c).mod(w),h=E.multiply(O.multiply(it).subtract(c)).subtract(h.multiply(p)).mod(w),w=p.multiply(r).mod(w),new t(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(h),w))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var r=this.x.toBigInteger(),s=this.y.toBigInteger(),c=this.z,p=this.curve.q,h=this.curve.a.toBigInteger(),E=r.square().multiply(kt).add(h.multiply(c.square())).mod(p),O=s.shiftLeft(1).multiply(c).mod(p),w=(h=(w=s.square().mod(p)).multiply(r).multiply(c).mod(p),s=O.square().mod(p),r=E.square().subtract(h.shiftLeft(3)).mod(p),c=O.multiply(r).mod(p),E.multiply(h.shiftLeft(2).subtract(r)).subtract(s.shiftLeft(1).multiply(w)).mod(p));return p=O.multiply(s).mod(p),new t(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(w),p)}},{key:"multiply",value:function(r){if(this.isInfinity())return this;if(!r.signum())return this.curve.infinity;for(var s=r.multiply(kt),c=this.negate(),p=this,h=s.bitLength()-2;0<h;h--){p=p.twice();var E=s.testBit(h);E!==r.testBit(h)&&(p=p.add(E?this:c))}return p}}]),t})(),Ot=(function(){function t(r,s,c){z(this,t),this.q=r,this.a=this.fromBigInteger(s),this.b=this.fromBigInteger(c),this.infinity=new Qt(this,null,null)}return I(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 he(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 s=(r.length-2)/2,c=r.substr(2,s);return s=r.substr(2+s,s),new Qt(this,this.fromBigInteger(new Lt(c,16)),this.fromBigInteger(new Lt(s,16)))}}}]),t})(),Ut={ECPointFp:Qt,ECCurveFp:Ot},te=Gt.exports.BigInteger,ue=(Ot=Gt.exports.SecureRandom,Ut.ECCurveFp),ce=new Ot,ee=(Ut=y()).curve,d=Ut.G,l=Ut.n;function y(){var t=new te("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),r=new te("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),s=new te("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return s=(r=new ue(t,r,s)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:r,G:s,n:new te("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function F(t,r){return t.length>=r?t:new Array(r-t.length+1).join("0")+t}function D(t,r){for(var s=[],c=~~(r/8),p=r%8,h=0,E=t.length;h<E;h++)s[h]=(t[(h+c)%E]<<p&255)+(t[(h+c+1)%E]>>>8-p&255);return s}function U(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]^r[c]);return s}function nt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=t[c]&r[c]&255;return s}function vt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]|r[c]);return s}function yt(t,r){for(var s=[],c=0,p=t.length-1;0<=p;p--){var h=t[p]+r[p]+c;c=255<h?1:0,s[p]=255&h}return s}function Xt(t,r,s,c){return 0<=c&&c<=15?U(U(t,r),s):vt(nt(t,r),nt((function(p){for(var h=[],E=p.length-1;0<=E;E--)h[E]=255&~p[E];return h})(t),s))}function $t(t,r){for(var s=[],c=[],p=0;p<16;p++){var h=4*p;s.push(r.slice(h,4+h))}for(var E,O=16;O<68;O++)s.push(U(U((E=U(U(s[O-16],s[O-9]),D(s[O-3],15)),U(U(E,D(E,15)),D(E,23))),D(s[O-13],7)),s[O-6]));for(var w=0;w<64;w++)c.push(U(s[w],s[w+4]));for(var it,st,T,H=[121,204,69,25],tt=[122,135,157,138],Q=t.slice(0,4),ut=t.slice(4,8),dt=t.slice(8,12),Ct=t.slice(12,16),Y=t.slice(16,20),X=t.slice(20,24),k=t.slice(24,28),G=t.slice(28,32),W=0;W<64;W++){var _t=0<=W&&W<=15?H:tt,et=U(St=D(yt(yt(D(Q,12),Y),D(_t,W)),7),D(Q,12)),St=(et=yt(yt(yt((it=Q,st=ut,T=dt,0<=(_t=W)&&_t<=15?U(U(it,st),T):vt(vt(nt(it,st),nt(it,T)),nt(st,T))),Ct),et),c[W]),yt(yt(yt(Xt(Y,X,k,W),G),St),s[W]));Ct=dt,dt=D(ut,9),ut=Q,Q=et,G=k,k=D(X,19),X=Y,Y=U(U(St,D(St,9)),D(St,17))}return U([].concat(Q,ut,dt,Ct,Y,X,k,G),t)}Ot={getGlobalCurve:function(){return ee},generateEcparam:y,generateKeyPairHex:function(t,r,s){return{privateKey:s=F((r=(t?new te(t,r,s):new te(l.bitLength(),ce)).mod(l.subtract(te.ONE)).add(te.ONE)).toString(16),64),publicKey:"04"+F((r=d.multiply(r)).getX().toBigInteger().toString(16),64)+F(r.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(t){for(var r=(t=unescape(encodeURIComponent(t))).length,s=[],c=0;c<r;c++)s[c>>>2]|=(255&t.charCodeAt(c))<<24-c%4*8;for(var p=[],h=0;h<r;h++){var E=s[h>>>2]>>>24-h%4*8&255;p.push((E>>>4).toString(16)),p.push((15&E).toString(16))}return p.join("")},leftPad:F,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=[],s=0,c=0;c<2*t.length;c+=2)r[c>>>3]|=parseInt(t[s],10)<<24-c%8*4,s++;try{for(var p=[],h=0;h<t.length;h++){var E=r[h>>>2]>>>24-h%4*8&255;p.push(String.fromCharCode(E))}return decodeURIComponent(escape(p.join("")))}catch(O){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){for(var r=[],s=(t=(s=t.length)%2!=0?F(t,s+1):t).length,c=0;c<s;c+=2)r.push(parseInt(t.substr(c,2),16));return r},verifyPublicKey:function(t){var r=ee.decodePointHex(t);return!!r&&(t=r.getX(),r.getY().square().equals(t.multiply(t.square()).add(t.multiply(ee.a)).add(ee.b)))}},Ut=function(t){for(var r=448<=(r=(O=8*t.length)%512)?512-r%448-1:448-r-1,s=new Array((r-7)/8),c=0,p=s.length;c<p;c++)s[c]=0;for(var h,E=[],O=O.toString(2),w=7;0<=w;w--)8<O.length?(h=O.length-8,E[w]=parseInt(O.substr(h),2),O=O.substr(0,h)):0<O.length?(E[w]=parseInt(O,2),O=""):E[w]=0;for(var it=[].concat(t,[128],s,E),st=it.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],H=0;H<st;H++){var tt=64*H;T=$t(T,it.slice(tt,64+tt))}return T};var Et=Gt.exports.BigInteger,Qr=function(t,r){return t=new ie(t),r=new ie(r),new ne([t,r]).getEncodedHex()},$r=function(t){var r=oe(t,0),s=oe(t,r),c=ae(t,r);return r=t.substr(s,2*c),s=oe(t,c=s+r.length),c=ae(t,c),t=t.substr(s,2*c),{r:new Pt(r,16),s:new Pt(t,16)}},ft=Ot,ve=Ut,Ae=(Ot=ft.generateEcparam()).G,sr=Ot.curve,De=Ot.n;function ur(t,r,s){var c=2<arguments.length&&s!==void 0?s:"1234567812345678",p=(c=ft.utf8ToHex(c),ft.leftPad(Ae.curve.a.toBigInteger().toRadix(16),64)),h=ft.leftPad(Ae.curve.b.toBigInteger().toRadix(16),64),E=ft.leftPad(Ae.getX().toBigInteger().toRadix(16),64),O=ft.leftPad(Ae.getY().toBigInteger().toRadix(16),64);return s=(r=128<r.length?r.substr(2,128):r).substr(0,64),r=r.substr(64,64),r=ft.hexToArray(c+p+h+E+O+s+r),c=4*c.length,r.unshift(255&c),r.unshift(c>>8&255),r=ve(r),ft.arrayToHex(ve(r.concat(ft.hexToArray(t))))}function cr(){var t=ft.generateKeyPairHex(),r=sr.decodePointHex(t.publicKey);return t.k=new Et(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}Ot={generateKeyPairHex:ft.generateKeyPairHex,doEncrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;t=typeof t=="string"?ft.hexToArray(ft.utf8ToHex(t)):Array.prototype.slice.call(t),r=ft.getGlobalCurve().decodePointHex(r);var c=ft.generateKeyPairHex(),p=new Et(c.privateKey,16),h=c.publicKey;128<h.length&&(h=h.substr(h.length-128)),c=r.multiply(p),p=ft.hexToArray(ft.leftPad(c.getX().toBigInteger().toRadix(16),64)),r=ft.hexToArray(ft.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=ft.arrayToHex(ve([].concat(p,t,r)));var E,O=1,w=0,it=[],st=[].concat(p,r);(E=function(){it=ve([].concat(Tt(st),[O>>24&255,O>>16&255,O>>8&255,255&O])),O++,w=0})();for(var T=0,H=t.length;T<H;T++)w===it.length&&E(),t[T]^=255&it[w++];return r=ft.arrayToHex(t),s===0?h+r+c:h+c+r},doDecrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(h=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":h;r=new Et(r,16);var p=t.substr(128,64),h=t.substr(192);s===0&&(p=t.substr(t.length-64),h=t.substr(128,t.length-128-64));var E,O=ft.hexToArray(h),w=(t=ft.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),r=ft.hexToArray(ft.leftPad(t.getX().toBigInteger().toRadix(16),64)),t=ft.hexToArray(ft.leftPad(t.getY().toBigInteger().toRadix(16),64)),1),it=0,st=[],T=[].concat(r,t);(E=function(){st=ve([].concat(Tt(T),[w>>24&255,w>>16&255,w>>8&255,255&w])),w++,it=0})();for(var H=0,tt=O.length;H<tt;H++)it===st.length&&E(),O[H]^=255&st[it++];return ft.arrayToHex(ve([].concat(r,O,t)))===p?c==="array"?O:ft.arrayToUtf8(O):c==="array"?[]:""},doSignature:function(t,r){var s=(O=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=O.der,p=O.hash,h=O.publicKey,E=O.userId,O=typeof t=="string"?ft.utf8ToHex(t):ft.arrayToHex(t);p&&(O=ur(O,h||(t=r,p=Ae.multiply(new Et(t,16)),"04"+(t=ft.leftPad(p.getX().toBigInteger().toString(16),64))+(p=ft.leftPad(p.getY().toBigInteger().toString(16),64))),E));var w=new Et(r,16),it=new Et(O,16),st=null,T=null,H=null;do do{var tt;st=(tt=s&&s.length?s.pop():cr()).k,T=it.add(tt.x1).mod(De)}while(T.equals(Et.ZERO)||T.add(st).equals(De));while((H=w.add(Et.ONE).modInverse(De).multiply(st.subtract(T.multiply(w))).mod(De)).equals(Et.ZERO));return c?Qr(T,H):ft.leftPad(T.toString(16),64)+ft.leftPad(H.toString(16),64)},doVerifySignature:function(t,r,s){var c,p,h=(O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,E=O.hash,O=O.userId;return t=typeof t=="string"?ft.utf8ToHex(t):ft.arrayToHex(t),E&&(t=ur(t,s,O)),p=h?(c=(p=$r(r)).r,p.s):(c=new Et(r.substring(0,64),16),new Et(r.substring(64),16)),r=sr.decodePointHex(s),s=new Et(t,16),!(t=c.add(p).mod(De)).equals(Et.ZERO)&&(r=Ae.multiply(p).add(r.multiply(t)),s=s.add(r.getX().toBigInteger()).mod(De),c.equals(s))},getPoint:cr,verifyPublicKey:ft.verifyPublicKey};var Zr=Ut,Ne=[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],Fe=[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 qe(t){for(var r=[],s=0,c=t.length;s<c;s+=2)r.push(parseInt(t.substr(s,2),16));return r}function Ie(t,r){return t<<r|t>>>32-r}function de(t){return(255&Ne[t>>>24&255])<<24|(255&Ne[t>>>16&255])<<16|(255&Ne[t>>>8&255])<<8|255&Ne[255&t]}function xe(t){return t^Ie(t,2)^Ie(t,10)^Ie(t,18)^Ie(t,24)}function Le(t){return t^Ie(t,13)^Ie(t,23)}function lr(t,r,s,c){c=(h=(E=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":h;var p=E.mode,h=(h=E.iv)===void 0?[]:h,E=(E=E.output)===void 0?"string":E;if(p==="cbc"&&(h=typeof h=="string"?qe(h):h).length!==16)throw new Error("iv is invalid");if((r=typeof r=="string"?qe(r):r).length!==16)throw new Error("key is invalid");if(t=(typeof t=="string"?s!==0?function(Y){for(var X=[],k=0,G=Y.length;k<G;k++){var W=Y.codePointAt(k);if(W<=127)X.push(W);else if(W<=2047)X.push(192|W>>>6),X.push(128|63&W);else if(W<=55295||57344<=W&&W<=65535)X.push(224|W>>>12),X.push(128|W>>>6&63),X.push(128|63&W);else{if(!(65536<=W&&W<=1114111))throw X.push(W),new Error("input is not supported");k++,X.push(240|W>>>18&28),X.push(128|W>>>12&63),X.push(128|W>>>6&63),X.push(128|63&W)}}return X}:qe:Tt)(t),c==="pkcs#5"&&s!==0)for(var O=16-t.length%16,w=0;w<O;w++)t.push(O);var it=new Array(32);(function(Y,X,k){for(var G=new Array(4),W=new Array(4),_t=0;_t<4;_t++)W[0]=255&Y[0+4*_t],W[1]=255&Y[1+4*_t],W[2]=255&Y[2+4*_t],W[3]=255&Y[3+4*_t],G[_t]=W[0]<<24|W[1]<<16|W[2]<<8|W[3];G[0]^=2746333894,G[1]^=1453994832,G[2]^=1736282519,G[3]^=2993693404;for(var et,St=0;St<32;St+=4)et=G[1]^G[2]^G[3]^Fe[St+0],X[St+0]=G[0]^=Le(de(et)),et=G[2]^G[3]^G[0]^Fe[St+1],X[St+1]=G[1]^=Le(de(et)),et=G[3]^G[0]^G[1]^Fe[St+2],X[St+2]=G[2]^=Le(de(et)),et=G[0]^G[1]^G[2]^Fe[St+3],X[St+3]=G[3]^=Le(de(et));if(k===0)for(var Nt,Yt=0;Yt<16;Yt++)Nt=X[Yt],X[Yt]=X[31-Yt],X[31-Yt]=Nt})(r,it,s);for(var st=[],T=h,H=t.length,tt=0;16<=H;){var Q=t.slice(tt,tt+16),ut=new Array(16);if(p==="cbc")for(var dt=0;dt<16;dt++)s!==0&&(Q[dt]^=T[dt]);(function(Y,X,k){for(var G=new Array(4),W=new Array(4),_t=0;_t<4;_t++)W[0]=255&Y[4*_t],W[1]=255&Y[4*_t+1],W[2]=255&Y[4*_t+2],W[3]=255&Y[4*_t+3],G[_t]=W[0]<<24|W[1]<<16|W[2]<<8|W[3];for(var et,St=0;St<32;St+=4)et=G[1]^G[2]^G[3]^k[St+0],G[0]^=xe(de(et)),et=G[2]^G[3]^G[0]^k[St+1],G[1]^=xe(de(et)),et=G[3]^G[0]^G[1]^k[St+2],G[2]^=xe(de(et)),et=G[0]^G[1]^G[2]^k[St+3],G[3]^=xe(de(et));for(var Nt=0;Nt<16;Nt+=4)X[Nt]=G[3-Nt/4]>>>24&255,X[Nt+1]=G[3-Nt/4]>>>16&255,X[Nt+2]=G[3-Nt/4]>>>8&255,X[Nt+3]=255&G[3-Nt/4]})(Q,ut,it);for(var Ct=0;Ct<16;Ct++)p==="cbc"&&s===0&&(ut[Ct]^=T[Ct]),st[tt+Ct]=ut[Ct];p==="cbc"&&(T=s!==0?ut:Q),H-=16,tt+=16}return c==="pkcs#5"&&s===0&&(c=st[st.length-1],st.splice(st.length-c,c)),E!=="array"?s!==0?st.map((function(Y){return(Y=Y.toString(16)).length===1?"0"+Y:Y})).join(""):(function(Y){for(var X=[],k=0,G=Y.length;k<G;k++)240<=Y[k]&&Y[k]<=247?(X.push(String.fromCodePoint(((7&Y[k])<<18)+((63&Y[k+1])<<12)+((63&Y[k+2])<<6)+(63&Y[k+3]))),k+=3):224<=Y[k]&&Y[k]<=239?(X.push(String.fromCodePoint(((15&Y[k])<<12)+((63&Y[k+1])<<6)+(63&Y[k+2]))),k+=2):192<=Y[k]&&Y[k]<=223?(X.push(String.fromCodePoint(((31&Y[k])<<6)+(63&Y[k+1]))),k++):X.push(String.fromCodePoint(Y[k]));return X.join("")})(st):st}var tn=[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],ye=[],en=function(t,r,s){for(var c=t[0],p=t[1],h=t[2],E=t[3],O=t[4],w=t[5],it=t[6],st=t[7],T=0;T<64;T++){T<16?ye[T]=0|r[s+T]:(H=ye[T-15],tt=ye[T-2],ye[T]=((H<<25|H>>>7)^(H<<14|H>>>18)^H>>>3)+ye[T-7]+((tt<<15|tt>>>17)^(tt<<13|tt>>>19)^tt>>>10)+ye[T-16]);var H=c&p^c&h^p&h,tt=st+((O<<26|O>>>6)^(O<<21|O>>>11)^(O<<7|O>>>25))+(O&w^~O&it)+tn[T]+ye[T];st=it,it=w,w=O,O=E+tt|0,E=h,h=p,p=c,c=tt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+H)|0}t[0]=t[0]+c|0,t[1]=t[1]+p|0,t[2]=t[2]+h|0,t[3]=t[3]+E|0,t[4]=t[4]+O|0,t[5]=t[5]+w|0,t[6]=t[6]+it|0,t[7]=t[7]+st|0},fr=(Ot={c2:Ot,c3:function(t){return t=typeof t=="string"?(function(r){for(var s=[],c=0,p=r.length;c<p;c++){var h=r.codePointAt(c);if(h<=127)s.push(h);else if(h<=2047)s.push(192|h>>>6),s.push(128|63&h);else if(h<=55295||57344<=h&&h<=65535)s.push(224|h>>>12),s.push(128|h>>>6&63),s.push(128|63&h);else{if(!(65536<=h&&h<=1114111))throw s.push(h),new Error("input is not supported");c++,s.push(240|h>>>18&28),s.push(128|h>>>12&63),s.push(128|h>>>6&63),s.push(128|63&h)}}return s})(t):Array.prototype.slice.call(t),Zr(t).map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},c4:{encrypt:function(t,r,s){return lr(t,r,1,s)},decrypt:function(t,r,s){return lr(t,r,0,s)}},s2:function(t){var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],s=(function(p){for(var h=[],E=0;E<Math.ceil(p.length/4);E++)h[E]=p[4*E]<<24|(255&p[4*E+1])<<16|(255&p[4*E+2])<<8|255&p[4*E+3];return h})(t);s[(t=8*t.length)>>5]|=128<<24-t%32,s[15+(64+t>>9<<4)]=t;for(var c=0;c<s.length;c+=16)en(r,s,c);return(function(p){for(var h=[],E=0;E<p.length;E++)h[4*E]=p[E]>>24&255,h[4*E+1]=p[E]>>16&255,h[4*E+2]=p[E]>>8&255,h[4*E+3]=255&p[E];return h})(r).map((function(p){return(p=p.toString(16)).length===1?"0"+p:p})).join("")}},Dt),rn=mt,nn=Rt,on=Vt,an=zt,sn=Ot.c2,un=Ot.c3,cn=Ot.c4,ln=Ot.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 s="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,p=!1,h=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,E=h!==void 0&&!!h.request&&!!h.login,O=function(T,H){return typeof T=="string"&&typeof H=="string"&&T!=null&&H!=null&&T.substring(0,H.length)===H},w={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},it=function(T){for(var H in w)if(w[H]===T)return H},st=function(T,H,tt){var Q=Date.now(),ut=new t;try{if(!T||T.length<=75)return console.error("error format 1:",T),w.ERROR_DATA_FORMAT;if(!O(T,"eyJ"))return console.error("error format 2:",T),w.ERROR_DATA_FORMAT;T=T.substring(3,T.length);var dt=rn.my_b4_decode(T);if(!dt)return console.error("error format 3:",T),w.ERROR_DATA_FORMAT;var Ct,Y=ut.cc.u8.byteToInt(dt.slice(0,4),0),X=dt.slice(4,4+Y),k=ut.cc.u8.byteToInt(dt.slice(4+Y,4+Y+4),0),G=dt.slice(4+Y+4,4+Y+4+k),W=ut.cc.u8.byteToInt(dt.slice(4+Y+4+k,4+Y+4+k+4),0),_t=dt.slice(4+Y+4+k+4,4+Y+4+k+4+W),et=ut.cc.u8.bytesToUtf8Str(X);if(ut.cc.h6.encode(G,0,k),H||(tt!==void 0&&tt==="sm2"?(Ct=ut.cc.h6.encode(G,0,k),ut.co.c2.doVerifySignature(et,Ct,s,{der:!0,hash:!0})):ut.co.c3(et+"8890012345678890").toLowerCase()===ut.cc.h6.encode(_t,0,W).toLowerCase())){if(et.length%2==0){t.prototype.__v=function(){return et.slice(0,2)};for(var St=[],Nt=2;Nt<66;Nt+=2)St.push(parseInt("0x"+et.slice(Nt,Nt+2)));t.prototype.__i=function(){return St};var Yt=parseInt("0x"+et.slice(66,82))-Q;t.prototype.__o=function(){return Yt}}return E||b.AAR2||(b.AAR2=t),w.SUCCESS}}catch(Je){return console.error(Je),w.ERROR_UNKNOWN_ERROR}return w.ERROR_SIGN_CHECK};return t.init=function(T,H){var tt,Q={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof T=="string"?(O(T,"https")||O(T,"https")?Q.url=T:O(T,"eyJ")&&(Q.code=T),typeof H=="string"&&(Q.publicKey=H)):$(T)==="object"&&(T.debug&&(Q.debug=T.debug),T.url&&(Q.url=T.url),T.code&&(Q.code=T.code),T.publicKey&&(Q.publicKey=T.publicKey),T.skipVerify&&(Q.skipVerify=T.skipVerify),T.alg&&(Q.alg=T.alg),T.callback&&typeof T.callback=="function"&&(Q.callback=T.callback)),p?Q.callback&&Q.callback(!0,{errorNo:tt=w.ALREADY_SUCCESS,errorMsg:it(tt)}):c?setTimeout((function(){t.init(T,H)}),50):(c=!0,Q.debug&&fr.start(Q.debug),Q.publicKey&&(s=Q.publicKey),Q.code?(tt=st(Q.code,Q.skipVerify))===w.SUCCESS?(c=!(p=!0),Q.callback(!0,{errorNo:tt,errorMsg:it(tt)})):Q.callback(!1,{errorNo:tt,errorMsg:it(tt)}):Q.url&&(function(ut,dt,Ct){try{if(ut=ut+"?version="+t.VERSION+(E?"&name=wechat":"&name=browser")+"&t="+Date.now(),E)h.request({url:ut,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function(X){X.statusCode===200?dt(X.data):Ct(w.ERROR_XXX_REQUEST_FAIL)},fail:function(X){X&&X.errMsg&&X.errMsg.indexOf("timeout")!==-1?Ct(w.ERROR_XXX_REQUEST_TIMEOUT):Ct(w.ERROR_XXX_REQUEST_FAIL)}});else{var Y;if(window.XMLHttpRequest)Y=new XMLHttpRequest;else if(window.ActiveXObject)try{Y=new ActiveXObject("Msxml2.XMLHTTP")}catch(X){try{Y=new ActiveXObject("Microsoft.XMLHTTP")}catch(k){}}Y&&(Y.onload=function(){Y.readyState===4&&(Y.status===200?dt(Y.responseText):Ct(w.ERROR_XHR_ERROR))},Y.ontimeout=function(){Ct(w.ERROR_XHR_TIMEOUT)},Y.onerror=function(){Ct(w.ERROR_XHR_ERROR)},Y.open("POST",ut,!0),Y.timeout=5e3,Y.send(null))}}catch(X){console.error(X),Ct(w.ERROR_UNKNOWN_ERROR)}})(Q.url,(function(ut){(ut=st(ut,Q.skipVerify,Q.alg))===w.SUCCESS?(c=!(p=!0),Q.callback(!0,{errorNo:ut,errorMsg:it(ut)})):(c=!1,Q.callback(!1,{errorNo:ut,errorMsg:it(ut)}))}),(function(ut){c=!1,Q.callback(!1,{errorNo:ut,errorMsg:it(ut)})})))},t.prototype={cc:{b4:nn,h6:on,u8:an},co:{c2:sn,c3:un,c4:cn,s2:ln},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,H){return this.__s(T,H)},__s:function(T,H){var tt=this.cc.u8.utf8StrToBytes(T),Q=this.__i();return T=this.cc.u8.utf8StrToBytes(H),H=this.cc.u8.utf8StrToBytes(this.__c()),T=[].concat(tt,Q,T,H),H=parseInt("0x"+this.__v()),this.__f(H)(T)+this.__v()},__f:function(T){var H=this.co.s2,tt=this.co.c3,Q=this.cc.h6.decode,ut=[function(dt){return H(dt)},function(dt){return tt(dt)},function(dt){return tt(Q(H(dt)))},function(dt){return H(Q(tt(dt)))},function(dt){return tt(Q(tt(dt)))},function(dt){return H(Q(H(dt)))}];return ut[(128<T?T-128:T)%ut.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(h!==void 0&&h.env&&h.request&&h.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 fr.isDebug()},version:function(){return t.VERSION}},t})()},at(R)=="object"?g.exports=rt():(q=typeof(B=rt)=="function"?B.call(R,P,R,g):B)===void 0||(g.exports=q)}},a={};function u(g){var R=a[g];if(R!==void 0)return R.exports;var P=a[g]={id:g,loaded:!1,exports:{}};return o[g].call(P.exports,P,P.exports,u),P.loaded=!0,P.exports}u.n=g=>{var R=g&&g.__esModule?()=>g.default:()=>g;return u.d(R,{a:R}),R},u.d=(g,R)=>{for(var P in R)u.o(R,P)&&!u.o(g,P)&&Object.defineProperty(g,P,{enumerable:!0,get:R[P]})},u.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(g){if(typeof window=="object")return window}})(),u.hmd=g=>((g=Object.create(g)).children||(g.children=[]),Object.defineProperty(g,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+g.id)}}),g),u.o=(g,R)=>Object.prototype.hasOwnProperty.call(g,R),u.r=g=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})};var A=u(737);Or.exports.LyyGetCommandSDK=A})()});var Wt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},fe={SIT:"sit",RELEASE:"release",PROD:"prod"},Ye={[Wt.DEV]:"https://dm.leyaoyao.com",[Wt.SIT]:"https://sm.leyaoyao.com",[Wt.UAT]:"https://um.leyaoyao.com",[Wt.PROD]:"https://m.leyaoyao.com"},yr={[Wt.DEV]:"https://dad2.leyaoyao.com",[Wt.SIT]:"https://sad2.leyaoyao.com",[Wt.UAT]:"https://uad2.leyaoyao.com",[Wt.PROD]:"https://nad.ehuoke.com"},Pe={[fe.SIT]:"https://sopenapi.leyaoyao.com",[fe.RELEASE]:"https://uopen-api.leyaoyao.com",[fe.PROD]:"https://api-gateway.leyaoyao.com"};function Me(o,a){return`${Ye[o]||Ye[Wt.PROD]}${a}`}function gr(o){return yr[o]||yr[Wt.PROD]}var Ee={debug:!1,env:Wt.PROD,externalEnv:fe.PROD,apiDomain:""},mr=gt({},Ee);function _r(o){mr=gt(gt({},Ee),o)}function pe(){return mr}var gn=Object.defineProperty,mn=(o,a,u)=>a in o?gn(o,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):o[a]=u,_n=(o,a,u)=>mn(o,typeof a!="symbol"?a+"":a,u);function re(){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 vn=class{constructor(o=!1){_n(this,"enable"),this.enable=o}setEnable(o){this.enable=o}info(...o){this.enable&&console.info("[BI Info]",...o)}warn(...o){this.enable&&console.warn("[BI Warn]",...o)}error(...o){this.enable&&console.error("[BI Error]",...o)}debug(...o){this.enable&&console.log("[BI Debug]",...o)}},x=new vn;function Ke(o){let a=re();return a==="taro"?Taro.setClipboardData({data:o}).then(()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):a==="uni"?new Promise((u,A)=>{uni.setClipboardData({data:o,success:()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{x.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),A(g)}})}):a==="wechat"?new Promise((u,A)=>{wx.setClipboardData({data:o,success:()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{x.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),A(g)}})}):a==="alipay"?new Promise((u,A)=>{my.setClipboardData({text:o,success:()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{x.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),A(g)}})}):navigator.clipboard.writeText(o).then(()=>{x.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function We(o,a=2e3){let u=re();if(u==="taro"){Taro.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="uni"){uni.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="wechat"){wx.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="alipay"){my.showToast({content:o,duration:a});return}typeof console!="undefined"&&console.log(`[Toast] ${o}`)}async function me(){var o,a,u,A,g;let R=re();try{if(R==="taro")return((o=(await Taro.getSystemInfo()).platform)==null?void 0:o.toLowerCase())==="ios"?"ios":"android";if(R==="uni")return((a=uni.getSystemInfoSync().platform)==null?void 0:a.toLowerCase())==="ios"?"ios":"android";if(R==="wechat")return wx.getDeviceInfo?((u=(await wx.getDeviceInfo()).platform)==null?void 0:u.toLowerCase())==="ios"?"ios":"android":((A=wx.getSystemInfoSync().platform)==null?void 0:A.toLowerCase())==="ios"?"ios":"android";if(R==="alipay")return((g=my.getSystemInfoSync().platform)==null?void 0:g.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let P=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(P))return"ios";if(/android/.test(P))return"android"}return"unknown"}catch(P){return x.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",P),"unknown"}}var xt={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function K(o,a,u=null){return{code:o,message:a,data:u}}function je(o,a){return o==null?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof o=="string"&&o.trim().length===0?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function we(o,a){for(let u of a){let A=je(o[u],u);if(!A.valid)return A}return{valid:!0}}var er={};Xe(er,{handleJdInsurance:()=>Lr,handleJdInsuranceExt:()=>Ur,handleJdjrCashLoanExt:()=>Cr,handleJdjrCashLoanFlow:()=>wr});var ze=(J=>(J[J.JD_CASH_LOAN__MISSING_PHONE=2001]="JD_CASH_LOAN__MISSING_PHONE",J[J.JD_CASH_LOAN__MISSING_DEVICE_ID=2002]="JD_CASH_LOAN__MISSING_DEVICE_ID",J[J.JD_CASH_LOAN__RTA_FAILED=2003]="JD_CASH_LOAN__RTA_FAILED",J[J.JD_CASH_LOAN__GET_CONFIG_FAILED=2004]="JD_CASH_LOAN__GET_CONFIG_FAILED",J[J.JD_CASH_LOAN__INVALID_CONFIG=2005]="JD_CASH_LOAN__INVALID_CONFIG",J[J.JD_CASH_LOAN__EXT_NOT_ELIGIBLE=2006]="JD_CASH_LOAN__EXT_NOT_ELIGIBLE",J[J.JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS=2007]="JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS",J[J.JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM=2008]="JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM",J[J.JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID=2009]="JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID",J[J.JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE=2010]="JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE",J[J.JD_INSURANCE__USER_NOT_ELIGIBLE=2101]="JD_INSURANCE__USER_NOT_ELIGIBLE",J[J.JD_INSURANCE__H5_NOT_SUPPORTED=2102]="JD_INSURANCE__H5_NOT_SUPPORTED",J[J.JD_INSURANCE__INVALID_JUMP_PARAMS=2103]="JD_INSURANCE__INVALID_JUMP_PARAMS",J[J.JD_INSURANCE__GET_CONFIG_FAILED=2104]="JD_INSURANCE__GET_CONFIG_FAILED",J[J.JD_INSURANCE__COPY_FAILED=2105]="JD_INSURANCE__COPY_FAILED",J[J.JD_INSURANCE__TASK_COMPLETED=2106]="JD_INSURANCE__TASK_COMPLETED",J[J.JD_INSURANCE__UNKNOWN_JUMP_MODE=2107]="JD_INSURANCE__UNKNOWN_JUMP_MODE",J[J.JD_INSURANCE__RTA_FAILED=2108]="JD_INSURANCE__RTA_FAILED",J))(ze||{}),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"},Se=(m=>(m[m.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",m[m.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",m[m.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",m[m.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",m[m.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",m[m.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",m[m.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",m[m.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",m[m.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",m[m.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",m[m.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",m[m.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",m[m.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",m[m.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",m[m.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",m[m.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",m[m.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",m[m.DY_PAY__INVALID_RETURN_TYPE=3018]="DY_PAY__INVALID_RETURN_TYPE",m[m.DY_PAY__JSAPI_INFO_FAILED=3019]="DY_PAY__JSAPI_INFO_FAILED",m[m.DY_PAY__REQUEST_JSAPI_INFO_FAILED=3020]="DY_PAY__REQUEST_JSAPI_INFO_FAILED",m[m.DY_PAY__MISSING_JSAPI_PAY_INFO=3021]="DY_PAY__MISSING_JSAPI_PAY_INFO",m[m.DY_PAY__INVALID_JSAPI_PAY_INFO=3022]="DY_PAY__INVALID_JSAPI_PAY_INFO",m))(Se||{}),Bt={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"};var An=(o,a,u,A)=>{let g=re();if(g==="taro")return Taro.request({url:o,method:a,data:u,header:A}).then(B=>B);if(g==="uni")return new Promise((B,q)=>{uni.request({url:o,method:a,data:u,header:A,success:rt=>B(rt),fail:rt=>q(rt)})});if(g==="wechat")return new Promise((B,q)=>{wx.request({url:o,method:a,data:u,header:A,success:rt=>B(rt),fail:rt=>q(rt)})});if(g==="alipay")return new Promise((B,q)=>{my.request({url:o,method:a,data:u,headers:A,success:rt=>B(rt),fail:rt=>q(rt)})});let R=a.toUpperCase()==="GET",P=R&&u&&Object.keys(u).length?`${o}?${new URLSearchParams(u).toString()}`:o;return fetch(P,{method:a,headers:A,body:R?void 0:JSON.stringify(u)}).then(async B=>({statusCode:B.status,data:await B.json()}))},Qe=class{constructor(a=null){Ue(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||pe()||Ee}async getAuthToken(){let a=this.getCurrentConfig();if(a.getAuthToken&&typeof a.getAuthToken=="function")try{let u=await a.getAuthToken();return u?(x.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),u):(x.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(u){return x.error("\u83B7\u53D6Token\u5931\u8D25",u),null}return null}async buildHeader(a={},u=!0){let A=gt({"content-type":"application/json"},a);if(!u)return A;let g=await this.getAuthToken();if(!g)throw{code:"AUTH_TOKEN_REQUIRED",message:"\u5F53\u524D\u63A5\u53E3\u9700\u8981 token\uFF0C\u8BF7\u5728\u7528\u6237\u767B\u5F55\u6210\u529F\u540E\u8C03\u7528 nova.setToken(token) \u6216 \u76F4\u63A5createServices\u65F6\u4F20\u5165getAuthToken"};return A.Authorization_bar=g,A}async request(a){let{path:u,method:A="POST",data:g={},header:R={},authRequired:P=!0,baseDomain:B,beforeRequest:q,afterResponse:rt}=a,at=B?`${B}${u}`:Me(this.getCurrentConfig().env||"prod",u),$=await this.buildHeader(R,P);q&&typeof q=="function"&&await q({url:at,method:A,data:g,header:$}),x.info(`\u53D1\u8D77${A}\u8BF7\u6C42:`,{path:u,method:A});try{let z=await An(at,A,g,$);return x.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:z.statusCode}),rt&&typeof rt=="function"&&await rt(z.data),z.data}catch(z){throw x.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:z}),z}}get(a,u={},A={}){return this.request(gt({path:a,method:"GET",data:u},A))}post(a,u={},A={}){return this.request(gt({path:a,method:"POST",data:u},A))}},Te=(o=null)=>new Qe(o);var Dn=(function(){"use strict";function o(I,Z){var ht=(65535&I)+(65535&Z);return(I>>16)+(Z>>16)+(ht>>16)<<16|65535&ht}function a(I,Z,ht,ot,J,Tt){return o((Tt=o(o(Z,I),o(ot,Tt)))<<J|Tt>>>32-J,ht)}function u(I,Z,ht,ot,J,Tt,S){return a(Z&ht|~Z&ot,I,Z,J,Tt,S)}function A(I,Z,ht,ot,J,Tt,S){return a(Z&ot|ht&~ot,I,Z,J,Tt,S)}function g(I,Z,ht,ot,J,Tt,S){return a(Z^ht^ot,I,Z,J,Tt,S)}function R(I,Z,ht,ot,J,Tt,S){return a(ht^(Z|~ot),I,Z,J,Tt,S)}function P(I,Z){var ht,ot,J,Tt;I[Z>>5]|=128<<Z%32,I[14+(Z+64>>>9<<4)]=Z;for(var S=1732584193,b=-271733879,m=-1732584194,C=271733878,_=0;_<I.length;_+=16)S=u(ht=S,ot=b,J=m,Tt=C,I[_],7,-680876936),C=u(C,S,b,m,I[_+1],12,-389564586),m=u(m,C,S,b,I[_+2],17,606105819),b=u(b,m,C,S,I[_+3],22,-1044525330),S=u(S,b,m,C,I[_+4],7,-176418897),C=u(C,S,b,m,I[_+5],12,1200080426),m=u(m,C,S,b,I[_+6],17,-1473231341),b=u(b,m,C,S,I[_+7],22,-45705983),S=u(S,b,m,C,I[_+8],7,1770035416),C=u(C,S,b,m,I[_+9],12,-1958414417),m=u(m,C,S,b,I[_+10],17,-42063),b=u(b,m,C,S,I[_+11],22,-1990404162),S=u(S,b,m,C,I[_+12],7,1804603682),C=u(C,S,b,m,I[_+13],12,-40341101),m=u(m,C,S,b,I[_+14],17,-1502002290),S=A(S,b=u(b,m,C,S,I[_+15],22,1236535329),m,C,I[_+1],5,-165796510),C=A(C,S,b,m,I[_+6],9,-1069501632),m=A(m,C,S,b,I[_+11],14,643717713),b=A(b,m,C,S,I[_],20,-373897302),S=A(S,b,m,C,I[_+5],5,-701558691),C=A(C,S,b,m,I[_+10],9,38016083),m=A(m,C,S,b,I[_+15],14,-660478335),b=A(b,m,C,S,I[_+4],20,-405537848),S=A(S,b,m,C,I[_+9],5,568446438),C=A(C,S,b,m,I[_+14],9,-1019803690),m=A(m,C,S,b,I[_+3],14,-187363961),b=A(b,m,C,S,I[_+8],20,1163531501),S=A(S,b,m,C,I[_+13],5,-1444681467),C=A(C,S,b,m,I[_+2],9,-51403784),m=A(m,C,S,b,I[_+7],14,1735328473),S=g(S,b=A(b,m,C,S,I[_+12],20,-1926607734),m,C,I[_+5],4,-378558),C=g(C,S,b,m,I[_+8],11,-2022574463),m=g(m,C,S,b,I[_+11],16,1839030562),b=g(b,m,C,S,I[_+14],23,-35309556),S=g(S,b,m,C,I[_+1],4,-1530992060),C=g(C,S,b,m,I[_+4],11,1272893353),m=g(m,C,S,b,I[_+7],16,-155497632),b=g(b,m,C,S,I[_+10],23,-1094730640),S=g(S,b,m,C,I[_+13],4,681279174),C=g(C,S,b,m,I[_],11,-358537222),m=g(m,C,S,b,I[_+3],16,-722521979),b=g(b,m,C,S,I[_+6],23,76029189),S=g(S,b,m,C,I[_+9],4,-640364487),C=g(C,S,b,m,I[_+12],11,-421815835),m=g(m,C,S,b,I[_+15],16,530742520),S=R(S,b=g(b,m,C,S,I[_+2],23,-995338651),m,C,I[_],6,-198630844),C=R(C,S,b,m,I[_+7],10,1126891415),m=R(m,C,S,b,I[_+14],15,-1416354905),b=R(b,m,C,S,I[_+5],21,-57434055),S=R(S,b,m,C,I[_+12],6,1700485571),C=R(C,S,b,m,I[_+3],10,-1894986606),m=R(m,C,S,b,I[_+10],15,-1051523),b=R(b,m,C,S,I[_+1],21,-2054922799),S=R(S,b,m,C,I[_+8],6,1873313359),C=R(C,S,b,m,I[_+15],10,-30611744),m=R(m,C,S,b,I[_+6],15,-1560198380),b=R(b,m,C,S,I[_+13],21,1309151649),S=R(S,b,m,C,I[_+4],6,-145523070),C=R(C,S,b,m,I[_+11],10,-1120210379),m=R(m,C,S,b,I[_+2],15,718787259),b=R(b,m,C,S,I[_+9],21,-343485551),S=o(S,ht),b=o(b,ot),m=o(m,J),C=o(C,Tt);return[S,b,m,C]}function B(I){for(var Z="",ht=32*I.length,ot=0;ot<ht;ot+=8)Z+=String.fromCharCode(I[ot>>5]>>>ot%32&255);return Z}function q(I){var Z=[];for(Z[(I.length>>2)-1]=void 0,ot=0;ot<Z.length;ot+=1)Z[ot]=0;for(var ht=8*I.length,ot=0;ot<ht;ot+=8)Z[ot>>5]|=(255&I.charCodeAt(ot/8))<<ot%32;return Z}function rt(I){for(var Z,ht="0123456789abcdef",ot="",J=0;J<I.length;J+=1)Z=I.charCodeAt(J),ot+=ht.charAt(Z>>>4&15)+ht.charAt(15&Z);return ot}function at(I){return unescape(encodeURIComponent(I))}function $(I){return B(P(q(I=at(I)),8*I.length))}function z(I,Z){return(function(ht,ot){var J,Tt=q(ht),S=[],b=[];for(S[15]=b[15]=void 0,16<Tt.length&&(Tt=P(Tt,8*ht.length)),J=0;J<16;J+=1)S[J]=909522486^Tt[J],b[J]=1549556828^Tt[J];return ot=P(S.concat(q(ot)),512+8*ot.length),B(P(b.concat(ot),640))})(at(I),at(Z))}function _e(I,Z,ht){return Z?ht?z(Z,I):rt(z(Z,I)):ht?$(I):rt($(I))}return _e})(),Ce=Dn;function vr(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function Ar(o){if(typeof o!="object"||o===null)return o;let a=Object.keys(o).sort(),u={};for(let A of a)u[A]=o[A];return JSON.stringify(u)}function Dr(o,a){let u={appId:o.appId,randomStr:o.randomStr,data:o.data},A=Object.keys(u).sort(),g="";for(let[R,P]of A.entries())g+=`${P}=${u[P]}`,R<A.length-1&&(g+="&");return g+=`&secretKey=${a}`,Ce(g)}var In=(o,a,u,A)=>{let g=re();return g==="taro"?Taro.request({url:o,method:a,data:u,header:A}).then(R=>R):g==="uni"?new Promise((R,P)=>{uni.request({url:o,method:a,data:u,header:A,success:B=>R(B),fail:B=>P(B)})}):g==="wechat"?new Promise((R,P)=>{wx.request({url:o,method:a,data:u,header:A,success:B=>R(B),fail:B=>P(B)})}):g==="alipay"?new Promise((R,P)=>{my.request({url:o,method:a,data:u,headers:A,success:B=>R(B),fail:B=>P(B)})}):fetch(o,{method:a,headers:A,body:JSON.stringify(u)}).then(async R=>({statusCode:R.status,data:await R.json()}))},$e=class{constructor(a=null){Ue(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||pe()||{}}getExternalEnv(){var a;return((a=this.getCurrentConfig())==null?void 0:a.externalEnv)||fe.PROD}getExternalHost(){let a=this.getExternalEnv();return Pe[a]||Pe.prod}generateSign(a={}){let u=this.getCurrentConfig(),{externalAppId:A,externalAppSecret:g}=u;if(!A||!g)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let R=vr(),P=Ar(a),B=Dr({appId:A,randomStr:R,data:P},g);return{appId:A,randomStr:R,sign:B}}buildRequestBody(a={}){let u=this.generateSign(a);return Zt(gt({},u),{data:a})}buildUrl(a){return`${this.getExternalHost()}${a}`}async request(a){let{path:u,method:A="POST",data:g={},header:R={},needSign:P=!0,beforeRequest:B,afterResponse:q}=a,rt=this.buildUrl(u),at=gt({"content-type":"application/json"},R),$=P?this.buildRequestBody(g):g;B&&typeof B=="function"&&await B({url:rt,method:A,data:$,header:at}),x.info(`\u53D1\u8D77${A}\u8BF7\u6C42:`,{path:u,method:A});try{let z=await In(rt,A,$,at);if(x.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:z.statusCode}),q&&typeof q=="function"&&await q(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:(x.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:z}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:z})}}get(a,u={},A={}){return this.request(gt({path:a,method:"GET",data:u},A))}post(a,u={},A={}){return this.request(gt({path:a,method:"POST",data:u},A))}},Ir=(o=null)=>new $e(o);var Ze=Te(),tr=Ir();function Rr(o){let a=je(o==null?void 0:o.equipmentValue,"equipmentValue");return a.valid?Ze.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Er(o){let a=we(o,["idMd5Value","rtaStrategy"]);return a.valid?tr.post("/open/rest/cpa/jd/rta-check",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Sr(o){try{let a={thirdPlatform:o.thirdPlatform,thirdPlatformUserId:o.thirdPlatformUserId,thirdPlatformEquipmentValue:o.thirdPlatformEquipmentValue,os:o.os,client:"wxMini"};o.phone&&(a.mobileMd5=Ce(o.phone)),o.extendData&&(Object.prototype.toString.call(o.extendData)==="[object Object]"?a.extendData=o.extendData:x.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let u=await tr.post("/open/rest/cpa/jd/insurance/get",a);return u?u.jumpMode==1?{jumpMode:1,appId:u.appId,url:u.url}:{jumpMode:2,url:u.url,channel:u.channelId}:void 0}catch(a){throw x.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",a),a}}function Tr(o){let a=je(o==null?void 0:o.equipmentValue,"equipmentValue");return a.valid?Ze.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}function br(o){let a=we(o,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return a.valid?Ze.post("/gw/advert/customer/cpa-activity/jd/rta/validate",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Pr(o){let a=await me(),u={thirdPlatform:o.thirdPlatform,thirdPlatformUserId:o.thirdPlatformUserId,thirdPlatformEquipmentValue:o.thirdPlatformEquipmentValue,os:a,client:o.client};return o.phone&&(u.mobileMd5=Ce(o.phone)),o.extendData&&(Object.prototype.toString.call(o.extendData)==="[object Object]"?u.extendData=o.extendData:x.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),tr.post("/open/rest/cpa/jd/cash-loan/get",u)}async function wr(o){let{phone:a,rtaId:u,equipmentId:A,lyyUserId:g,entrance:R}=o;if(!a)return K(xt.INVALID_PARAM,bt[2001]);if(!A)return K(xt.INVALID_PARAM,bt[2002]);try{if(u){x.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let $=await br({phone:a,lyyEquipmentValue:A,lyyUserId:g||"",rtaId:u});if($.code!=="0000000"||!$.body||$.body.state!=1)return x.error("RTA\u9A8C\u8BC1\u5931\u8D25",$),K(2003,bt[2003]);x.info("RTA\u9A8C\u8BC1\u6210\u529F",$.body)}x.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:a});let P=await me(),B=await Tr({phone:a,equipmentValue:A,os:P,entrance:R});if(B.code!=="0000000"||!B.body)return x.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",B),K(2004,bt[2004]);let{appId:q,targetUrl:rt}=B.body;if(!q||!rt)return x.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:q,targetUrl:rt}),K(2005,bt[2005]);let at=K(xt.SUCCESS,"\u6210\u529F",{appId:q,targetUrl:rt});return x.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",at),at}catch(P){return x.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",P),K(xt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function Cr(o){let{phone:a,rtaId:u,thirdPlatform:A,thirdPlatformUserId:g,thirdPlatformEquipmentValue:R}=o;if(!a)return K(xt.INVALID_PARAM,bt[2001]);if(!A)return K(2008,bt[2008]);if(!g)return K(2009,bt[2009]);if(!R)return K(2010,bt[2010]);try{if(u){x.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let z=await Er({idMd5Value:a,rtaStrategy:u});if(z.status!=1)return x.error("RTA\u9A8C\u8BC1\u5931\u8D25",z),K(2003,bt[2003]);x.info("RTA\u9A8C\u8BC1\u6210\u529F",z)}let P=await Pr(o),{url:B,channelId:q,matchFlag:rt,jumpMode:at,appId:$}=P||{};return rt?at===3?!$||!B?K(2007,bt[2007]):K(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:$,url:B}):K(2007,bt[2007]):K(2006,bt[2006])}catch(P){return x.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",P),K(xt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var be=null,Oe=null;try{Oe=Nr()}catch(o){}function Fr(){return be||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(be=globalThis.LyyGetCommandSDK,be):Oe?(be=Oe.LyyGetCommandSDK||Oe.default||Oe,be):null)}function xr(o){var u;x.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",o);let a=Fr();a!=null&&a.getJrCommand?a.getJrCommand(o):(u=a==null?void 0:a.default)!=null&&u.getJrCommand?a.default.getJrCommand(o):(x.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),o.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function Rn(o,a){return new Promise((u,A)=>{try{xr({url:o,channel:a,callback:g=>{g.code==="0"?u(g.data):A({msg:g.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(g){A(g)}})}async function Lr(o){try{let a=await me(),u=gt({os:a},o);x.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",u);let{code:A,body:g}=await Rr(u);if(A==="0000000"&&g){let{url:R,channelId:P,matchFlag:B,jumpMode:q,appId:rt}=g;if(!B)return K(2101,bt[2101]);if(q===1)return x.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),K(2102,bt[2102]);if(q===2)return re()==="web"&&x.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:R}),!R||!P?K(2103,bt[2103]):new Promise(at=>{xr({url:R,channel:P,callback:async $=>{if(($==null?void 0:$.code)==="0")try{await Ke($==null?void 0:$.data),at(K(xt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(z){at(K(2105,bt[2105]))}else at(K(2105,bt[2105]))}})});if(q===3)return!rt||!R?K(2103,bt[2103]):K(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:rt,path:R})}return K(2104,bt[2104])}catch(a){return x.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",a),K(xt.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function Ur(o){x.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let a=await Sr(Zt(gt({},o),{os:await me()}));if(!a)return x.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),K(2106,bt[2106]);if(a.jumpMode===1)return x.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:a.appId,url:a.url}),K(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:a.appId,path:a.url});if(a.jumpMode===2){if(re()==="web")return x.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:a.url}),K(xt.SUCCESS,"\u6210\u529F",{type:"h5",url:a.url});try{let u=await Rn(a.url,a.channel);return await Ke(u),x.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),K(xt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(u){return x.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",u),We("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),K(2105,bt[2105])}}return x.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",a.jumpMode),K(2107,bt[2107])}catch(a){let u=typeof a=="string"?a:(a==null?void 0:a.msg)||(a==null?void 0:a.message)||"\u672A\u77E5\u9519\u8BEF";return x.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",u),We("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),u.includes("RTA")||u.includes("\u8D44\u683C")?K(2108,bt[2108]):K(xt.NETWORK_ERROR,u)}}var rr={};Xe(rr,{DyErrorCode:()=>Se,getDyPayRtaData:()=>Vr,handleDyPayFlow:()=>kr});var En=["weapp","h5"],Sn=["default","jsapi"];function Tn(o){return En.includes(o)}var bn=["h5","ulink"];function Pn(o){return bn.includes(o)}function wn(o){return Sn.includes(o)}var Cn=["switchTab","reLaunch","redirectTo","navigateTo"];function On(o){return Cn.includes(o)}function Yr(o){return!o.telephone&&o.returnType==="h5"?{valid:!1,errorCode:3001}:o.price?o.equipmentValue?o.businessType?o.client&&!Tn(o.client)?{valid:!1,errorCode:3004}:o.returnType&&!Pn(o.returnType)?{valid:!1,errorCode:3018}:o.payClientType&&!wn(o.payClientType)?{valid:!1,errorCode:3004}:o.douyinOrderExtendData&&typeof o.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:o.backWay&&o.client==="weapp"&&!On(o.backWay)?{valid:!1,errorCode:3016}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}}function Mr(o){return o.equipmentValue?{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}var Be=Te();async function jr(o){let{price:a,equipmentValue:u,douyinOrderExtendData:A,douyinCommodityVirtualFlag:g,businessType:R,platformActivities:P={}}=o,B={businessType:R,equipmentValue:u,payInfoBusinessType:"commonDouyinPayment",platformActivities:gt({douyinCommodityVirtualFlag:g||!1,douyinCommodityPrice:a,douyinOrderExtendData:A||""},P)};try{let q=await Be.post("/gw/advert/customer/payment/pay-info",B);return q.code!=="0000000"||!(q!=null&&q.body)?Promise.reject({code:3006,message:q.message||Bt[3006]}):(q.body.platformActivities=B.platformActivities,q)}catch(q){return x.error("getDyOrderAmountFn error:",q),Promise.reject({code:3007,message:Bt[3007]})}}async function Br(o){var a,u;try{let A=o.commodityList.map($=>($.commodity=$.commodityId,delete $.commodityId,$.quantity=$.quantity||1,$)),g=o.advertExtendInfo&&Object.keys(o.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:o.advertExtendInfo}):"",R=re(),P="";R==="wechat"?P="wechatMini":R==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(P="wechatHtml");let B=o.payClientType==="jsapi",q=B?22:21,rt=gt(gt(gt({businessType:o.businessType,fixedClientType:q,channelCode:null,douyinData:{loginMobile:o.telephone||""},equipmentUseFlag:!0,payEquipmentDTO:{equipmentValue:o.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:g,transType:5,actualFee:o.totalFee,totalFee:o.totalFee,commodityList:A,clientSourceDetailType:P,platformActivities:o.platformActivities||{}},o.commoditySign&&{commoditySign:o.commoditySign}),o.unifiedOrderExtendData&>({},o.unifiedOrderExtendData)),B?{appId:((a=o.jsapiInfo)==null?void 0:a.appId)||"",openId:((u=o.jsapiInfo)==null?void 0:u.douyinOpenId)||""}:{}),at=await Be.post("/gw/payment-bff/unified/order",rt);return at.code!=="0000000"||!(at!=null&&at.body)?Promise.reject({code:3008,message:at.message||Bt[3008]}):at}catch(A){return x.error("dyUnifiedOrderFn error:",A),Promise.reject({code:3009,message:Bt[3009]})}}async function qr(o){let a={equipmentValue:o.equipmentValue,phone:o.telephone||""};o.price&&(a.orderAmount=o.price);try{let u=await Be.post("/gw/advert/customer/douyin/pay/check",a);return u.code!=="0000000"||!(u!=null&&u.body)?Promise.reject({code:3013,message:u.message||Bt[3013]}):u}catch(u){return x.error("getDyPayRtaData error:",u),Promise.reject({code:3014,message:(u==null?void 0:u.message)||Bt[3014]})}}async function Jr(){try{let o=await Be.get("/gw/advert/customer/douyin/pay/jsapi/info");return o.code!=="0000000"||!(o!=null&&o.body)?Promise.reject({code:3019,message:o.message||Bt[3019]}):{appId:o.body.appId,douyinOpenId:o.body.douyinOpenId}}catch(o){return x.error("getDyPayJsapiInfoFn error:",o),Promise.reject({code:(o==null?void 0:o.code)||3020,message:(o==null?void 0:o.message)||Bt[3020]})}}async function kr(o){var u,A,g,R;let a=Yr(o);if(!a.valid)return K(a.errorCode,Bt[a.errorCode]);try{let P=await jr({price:o.price,equipmentValue:o.equipmentValue,businessType:o.businessType,douyinOrderExtendData:(o==null?void 0:o.douyinOrderExtendData)||"",platformActivities:(o==null?void 0:o.platformActivities)||{},douyinCommodityVirtualFlag:(o==null?void 0:o.douyinCommodityVirtualFlag)||!1}),B=o.payClientType==="jsapi"?await Jr():void 0,q=await Br(Zt(gt(Zt(gt({},P.body),{telephone:o.telephone,equipmentValue:o.equipmentValue,businessType:o.businessType}),o.unifiedOrderExtendData&&{unifiedOrderExtendData:o.unifiedOrderExtendData}),{payClientType:o.payClientType,jsapiInfo:B})),rt=((u=q==null?void 0:q.body)==null?void 0:u.h5Url)||"",at=((A=q==null?void 0:q.body)==null?void 0:A.outTradeNo)||"";if(o.returnType==="ulink"){let z=rt?await Ln(Zt(gt({},o),{dyUrl:rt})):"";return z?K(0,"success",{ulinkUrl:z,outTradeNo:at}):K(3010,Bt[3010])}if(o.payClientType==="jsapi"){let z=Nn((g=q==null?void 0:q.body)==null?void 0:g.payInfo);return K(0,"success",{appId:(B==null?void 0:B.appId)||"",payInfo:z,outTradeNo:at})}let $=rt?await xn(Zt(gt({},o),{dyUrl:rt})):"";return $?K(0,"success",{h5Url:$,outTradeNo:at}):K(3010,Bt[3010])}catch(P){x.error("handleDyPayFlow error:",P);let B=(R=P==null?void 0:P.code)!=null?R:3012,q=(P==null?void 0:P.message)||Bt[3012];return K(B,q)}}function Nn(o){if(!o)throw{code:3021,message:Bt[3021]};try{let a=JSON.parse(o);if(!Fn(a))throw new Error("invalid payInfo fields");return a}catch(a){throw{code:3022,message:Bt[3022],error:a}}}function Fn(o){return typeof o.timeStamp=="string"&&o.timeStamp!==""&&typeof o.nonceStr=="string"&&o.nonceStr!==""&&typeof o.package=="string"&&o.package!==""&&typeof o.signType=="string"&&o.signType!==""&&typeof o.paySign=="string"&&o.paySign!==""}async function xn(o){let a=pe(),u=Me(a.env||"prod",""),A=typeof a.getAuthToken=="function"?await a.getAuthToken():"",g=o.client||"weapp";return`${u}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${g}&equipmentId=${o.equipmentValue}&dyUrl=${o.dyUrl}&fromUrl=${encodeURIComponent(o.fromUrl||"")}&backUrl=${encodeURIComponent(o.backUrl||"")}&backWay=${o.backWay||""}&url_token=${A}`}async function Ln(o){return o.dyUrl+`${o.backUrl?"&return_url="+encodeURIComponent(o.backUrl||""):""}&jump_back_schema=${encodeURIComponent("weixin://")}`}async function Vr(o){var u;let a=Mr(o);if(!a.valid)return K(a.errorCode,Bt[a.errorCode]);try{let A=await qr({price:(o==null?void 0:o.price)||"",equipmentValue:o.equipmentValue,telephone:(o==null?void 0:o.telephone)||""});return K(0,"success",A.body)}catch(A){x.error("getDyPayRtaData error:",A);let g=(u=A==null?void 0:A.code)!=null?u:3015,R=(A==null?void 0:A.message)||Bt[3015];return K(g,R)}}var ar={};Xe(ar,{getDisplayAdConfig:()=>zr,normalizeDisplayAdData:()=>ir});var Un=Te();function Hr(o){let a=we(o,["placementId"]);if(!a.valid)return Promise.reject({code:"PARAM_ERROR",message:a.message});let u=pe().env||"prod";return Un.get(`/gw/advert-plugin/api/v1/config/list/valid/${o.placementId}`,{},{authRequired:!1,baseDomain:gr(u)})}var Gr=30*1e3,Yn="__",or=new Map,nr=new Map;function Mn(o,a){return[o.appId||"",a,o.type||""].join(Yn)}function jn(o){let a=or.get(o);return a?a.expireAt<=Date.now()?(or.delete(o),x.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:o}),null):a.data:null}function Bn(o,a){or.set(o,{data:a,expireAt:Date.now()+Gr})}function qn(o){return Array.isArray(o==null?void 0:o.body)?o.body:[]}function Jn(o){return String(o==null?void 0:o.code)!=="200"}function kn(o,a){let u=String(o||a||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(u)?u:a||"banner"}function Xr(o){return String(o||"").trim().toLowerCase()}function Vn(o){var a;return!!o&&o.status!==0&&((a=o.platformConfig)==null?void 0:a.valid)!==!1}function Hn(o){return[...o].sort((a,u)=>{var R,P,B,q;let A=Number((R=a.priority)!=null?R:9999),g=Number((P=u.priority)!=null?P:9999);return A!==g?A-g:Number((B=u.weight)!=null?B:0)-Number((q=a.weight)!=null?q:0)})}function Kr(o){return o.find(a=>Xr(a.advertPlatform)==="gdt")||null}function Wr(o){return o.find(a=>Xr(a.advertPlatform)!=="gdt")||null}function Gn(o,a){return o&&a?"mixed":o?"wechat":a?"custom":"none"}function Xn(o,a){var g,R;let u=Kr(o),A=Wr(o);return u&&A?Number((g=u.priority)!=null?g:9999)<=Number((R=A.priority)!=null?R:9999)?"wechat-first":"custom-first":a==="custom"?"custom-only":a==="wechat"?"wechat-only":"wechat-first"}function Kn(o){var u;let a=Kr(o);return((u=a==null?void 0:a.platformConfig)==null?void 0:u.adId)||""}function Wn(o){let a=Wr(o),u=a==null?void 0:a.platformConfig;if(!u)return null;let A=u.image||u.imageUrl||"",g=u.video||u.videoUrl||"",R=u.poster||A||"",P=u.jumpUrl||u.url||u.webUrl||"";return!A&&!g?null:{image:A||void 0,video:g||void 0,poster:R||void 0,title:u.title,description:u.description,buttonText:u.buttonText,badgeText:u.badgeText,jumpSeconds:u.jumpSeconds,loadTimeout:u.loadTimeout||u.timeout,muted:u.muted,adSpec:u.adSpec,url:P||void 0,action:P?{type:"web",url:P}:void 0}}function ir(o,a){let u=Hn(o.filter(Vn)),A=Wn(u),g=Kn(u),R=kn(void 0,a),P=Gn(g,A),B=Xn(u,P);return{show:!!(g||A),adId:"",type:R,provider:P,priority:B,unitId:g,customAd:A,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:o}}async function zr(o){let a=o.placementId||o.adId||"",u=Mn(o,a),A=jn(u);if(A)return x.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:u,placementId:a}),K(xt.SUCCESS,"\u6210\u529F",A);let g=nr.get(u);if(g)return x.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:u,placementId:a}),g;let R=(async()=>{try{x.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",o);let P=await Hr({placementId:a}),B=qn(P);if(x.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:u,placementId:a,response:P,body:B}),Jn(P)||!B)return x.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",P),K(xt.UNKNOWN_ERROR,(P==null?void 0:P.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let q=ir(B,o.type);return q.adId=a,q.cache=Zt(gt({},q.cache),{enable:!0,ttl:Gr}),Bn(u,q),x.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:u,placementId:a,provider:q.provider,priority:q.priority,hasUnitId:!!q.unitId,hasCustomAd:!!q.customAd}),K(xt.SUCCESS,"\u6210\u529F",q)}catch(P){return x.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:u,placementId:a,error:P}),K(xt.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{nr.delete(u)}})();return nr.set(u,R),R}function zn(o={}){x.info("\u670D\u52A1\u521D\u59CB\u5316",o);let a=gt(gt({},Ee),o);a.env&&!Ye[a.env]&&(x.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${a.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.env=Wt.PROD),a.externalEnv&&!Pe[a.externalEnv]&&(x.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${a.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.externalEnv=fe.PROD),a.debug!==void 0&&x.setEnable(a.debug),_r(a),x.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",a)}function Qn(o={}){let a="",u=null;async function A(){if(typeof o.getAuthToken=="function"){let R=await o.getAuthToken();if(R)return R}return u&&typeof u.getStorage=="function"&&u.getStorage("auth_token")||""}let g={name:"services",setToken(R){return a=R||"",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",a),g},async getAuthToken(){return a||A()},clearToken(){return a="",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",""),g},install(R){u=R;let P=Zt(gt({},o),{getAuthToken:()=>g.getAuthToken()});zn(P),x.info("services installed via nova.use()"),Object.assign(R,{jd:gt({},er),dy:gt({},rr),ads:gt({},ar),setToken:g.setToken,clearToken:g.clearToken})}};return g}export{Se as DyErrorCode,Bt as DyErrorMessage,Wt as ENV_TYPE,fe as EXTERNAL_ENV_TYPE,ze as JdErrorCode,bt as JdErrorMessage,Qn as createServices,zr as getDisplayAdConfig,Vr as getDyPayRtaData,kr as handleDyPayFlow,Lr as handleJdInsurance,Ur as handleJdInsuranceExt,Cr as handleJdjrCashLoanExt,wr as handleJdjrCashLoanFlow,ir as normalizeDisplayAdData};
|
|
5
5
|
/*! For license information please see LyyGetCommandSDK.min.js.LICENSE.txt */
|