zmp-sdk 2.38.0 → 2.38.1
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/apis/common/apis/general/getUserInfo.js +1 -1
- package/apis/package.json.js +1 -1
- package/browser.min.js +2 -2
- package/index.es.js +2 -2
- package/index.js +2 -2
- package/index.umd.js +2 -2
- package/package.json +1 -1
package/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @timeBuild
|
|
2
|
+
* @timeBuild 06-06-2024 16:55:31
|
|
3
3
|
* @license zmp-sdk
|
|
4
4
|
*
|
|
5
5
|
* Copyright @ 2024. Zalo Group.
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
|
|
22
22
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
23
23
|
and limitations under the License.
|
|
24
|
-
***************************************************************************** */}((function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],p=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),p){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,a),!0}for(c=1,u=new Array(p-1);c<p;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var d,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),p){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,r);break;case 4:l[c].fn.call(l[c].context,t,r,i);break;default:if(!u)for(d=1,u=new Array(p-1);d<p;d++)u[d-1]=arguments[d];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==t||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})),Tr="ACTION_CALLBACK";var Er=function(t){gr(r,t);var n=wr(r);function r(){var e;return pr(this,r),(e=n.apply(this,arguments)).debug=ir("zmp:event-emitter"),e}var i=r.prototype;return i.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},i.on=function(t,n,i){var o=this;if(t===Tr||t===e.Events.PaymentCallback)return vr(hr(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return vr(hr(r.prototype),"on",this).call(this,t,(function(e,r){o.h5ConfirmHandleEvent(e,t,i),n(r)}),i)},i.once=function(e,t,n){var i=this;if(e===Tr)return vr(hr(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return vr(hr(r.prototype),"once",this).call(this,e,(function(r,o){i.h5ConfirmHandleEvent(r,e,n),t(o)}),n)},r.getInstance=function(){return r.instance||(r.instance=new r),r.instance},r}(br);function Sr(e){Er.getInstance().emit(Tr,e)}function Pr(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(void 0===r)return;if(null===r)return void t.push(n);t.push(encodeURIComponent(n)+"="+encodeURIComponent(r))}return t.join("&")}window.onNativeMessage=function(e,t){return function(n){Sr({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var o=ir("zmp:zalo_h5_event_handler");o("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=ei(r);o("stringToData",a);var s=function(t,n){try{if(t===e.Events.OpenApp){var r=n.url,o=new URL(r),a=o.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(a||"/").concat(o.search)}}return n}catch(e){return n}}(n,a);Er.getInstance().emit(n,t,s)}},window.zaloNative2JS={nativeCall:function(t,n,r){Er.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Ar={encode:Pr,decode:function(e,t){var n={};if(""===e)return n;for(var r=e.split("&"),i=0;i<r.length;i++){var o=r[i].split("=",2),a=decodeURIComponent(o[0]);if(t&&Object.prototype.hasOwnProperty.call(n,a))throw new URIError("Duplicate key: "+a);n[a]=2===o.length?decodeURIComponent(o[1]):null}return n},appendToUrl:function(e,t){return e+(-1!==e.indexOf("?")?"&":"?")+("string"==typeof t?t:Pr(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var n=e.split("=");n&&2==n.length&&(t[n[0]]=decodeURIComponent(n[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e||void 0===e?"undefined":rr(e)))return e;var t=Object.keys(e),n=[];return t.map((function(t){var r=e[t],i=[t,r="object"==(void 0===r||void 0===r?"undefined":rr(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Or={},kr=function(e,t,n){var r=t||"default";return function(){return(r in Or?Or[r](e,n):e).apply(this,arguments)}};kr.setWrapper=function(e){Or[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Ir={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Nr(e){try{return null===e?Ir:JSON.parse(e)}catch(e){return Ir}}var Cr,Mr={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Ar.encode(n);"post"!=t&&(e=Ar.appendToUrl(e,i),i="");var o=function(e,t){if(!self.XMLHttpRequest)return null;var n=new XMLHttpRequest,r=function(){};if(!("withCredentials"in n))return null;n.open(e,t,!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded");var i={send:function(e){n.send(e)}},o=kr((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=kr((function(){a=r,"onerror"in i&&i.onerror(n)}),"entry","XMLHttpRequest:error");return n.onload=function(){o()},n.onerror=function(){a()},n.onreadystatechange=function(){4==n.readyState&&(200==n.status?o():a())},i}(t,e);return!!o&&(o.onload=function(e){r(Nr(e.responseText))},o.onerror=function(e){e.responseText?r(Nr(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},xr=Mr,Rr=(Cr=V((function(e,t,n){var r,i,o,a;return Q(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},lr.isUndefined(n)||(r.currentVersion=n),i=Ar.appendToUrl(l.GET_APP_INFO,r),[4,fetch(i,{credentials:"include"})];case 1:return(o=s.sent()).ok?[4,o.json()]:[3,3];case 2:if((a=s.sent()).err<0||!a.data)throw new Error(a);return[2,{name:a.data.name,version:a.data.version,description:a.data.description,appUrl:a.data.appUrl,qrCodeUrl:a.data.qrCodeUrl,logoUrl:a.data.logoUrl,cateID:a.data.cateType}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return Cr.apply(this,arguments)});function jr(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));xr.execute(l.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:e}})}catch(e){}}var Dr=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Ur=function(){var e,t,n=Number((null===(e=Tn())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=Tn())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Br(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Zr,Lr,zr=function(){function e(t,n,r,i){pr(this,e),this.code=t,this.message=n,this.api=r,this.detail=i}var t=e.prototype;return t.toString=function(){return"api: ".concat(String(this.api),"; code: ").concat(this.code,"; message: ").concat(JSON.stringify(this.message))},t.toJSON=function(){return{code:this.code,message:this.message,api:this.api,detail:this.detail}},e}(),Wr=function(e,t){return Br(e,zr)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Br(e,Error)?new zr(f,e.message,t).toJSON():lr.isEmpty(null==e?void 0:e.message)||lr.isEmpty(null==e?void 0:e.code)?new zr(f,T,t,e).toJSON():new zr(e.code,e.message,t,e.detail).toJSON()}(e,t)},Gr=(Zr=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(l.GET_AUTH_SETTING,On({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Zr.apply(this,arguments)}),Fr=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n,r,i,o;return Q(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,$r.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=$r.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new zr(v,S,"getSetting")),[4,Gr(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new zr(i.err,i.msg,"getSetting")),[3,4];case 3:return o=a.sent(),t(o),[3,4];case 4:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))})),Hr=function(){var t,n,r,i=Tn(),o={},a=Er.getInstance(),s=[],u=!1;return u||(n=function(e){var t=e.serialId,n=ti(e.result),r=oi(null==n?void 0:n.action),i=lr.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,a=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===i){var c=JSON.parse(null==n?void 0:n.data);i=lr.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,a=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:i,error_message:a,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&o[t]){var p=o[t],d=p.callback,f=p.timeout,h=p.isMultiCallback,m=p.options;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?lr.isFunction(r)&&r(e):lr.isFunction(i)&&i(e)}(l,d),!h&&delete o[t],f&&clearTimeout(f);var v={action:null==l?void 0:l.action,error:null==l?void 0:l.error_code,message:null==l?void 0:l.error_message,data:{}};try{if("action.open.inapp"===l.action||"action.open.outapp"===l.action){var y=new URL(null==m?void 0:m.url),g="".concat(y.protocol,"//").concat(y.host).concat(y.pathname);v.data={url:g}}if("action.follow.oa"===l.action||"action.unfollow.oa"===l.action){var _=null==m?void 0:m.uid;v.data={uid:_}}if("action.open.chat"===l.action){var w=null==m?void 0:m.uId,b=null==m?void 0:m.type;v.data={uid:w,openChatType:b}}}catch(e){}s.push(v)}},Er.getInstance().on(Tr,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],jr(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],jr(e)}}),5e3),u=!0),r=V((function(e,t,n,r){var a,s,u,c,l,p,d,f,h,m,_,w,b,T,S,P,k,I,N,C,M,x;return Q(this,(function(R){switch(R.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c="action.".concat(e.replace(/\_/g,".").toLowerCase()),(null==r?void 0:r.actionName)&&r.actionName.length>0&&(c=null==r?void 0:r.actionName),l=(null==r?void 0:r.isMultiCallback)||!1,p=!1!==(null==r?void 0:r.timeout)&&((null==r?void 0:r.timeout)||!0),d=(null==r?void 0:r.haveCallback)||!1,f=(null==r?void 0:r.skipJump)||!1,h=(null==r?void 0:r.requireAccessToken)||!1,m=ai(c),t&&n&&(o[u]={options:t,callback:n,isMultiCallback:l},p&&d&&(o[u].timeout=setTimeout((function(){return Sr({serialId:u,result:{error_code:g,error_message:E,data:{timeout:p},action:e}}),null}),!0===p?8e3:1e3*p))),m?[4,Fr()]:[3,2];case 1:if(!1===(null==(w=R.sent())||null===(_=w.authSetting)||void 0===_?void 0:_["scope.userInfo"]))return Sr({serialId:u,result:{error_code:v,error_message:O,data:{isMobile:null==i||null===(b=i.platform)||void 0===b?void 0:b.isMobile},action:e}}),[2];R.label=2;case 2:return T=oi(c),!(null==i||null===(a=i.platform)||void 0===a?void 0:a.isMobile)||!e||lr.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!Xr(e)||T&&!1===T.isSupported?(Sr({serialId:u,result:{error_code:y,error_message:A,data:{isMobile:null==i||null===(S=i.platform)||void 0===S?void 0:S.isMobile},action:e}}),[2]):(P=Qr(t),f?[3,4]:[4,$r.getJSAccessToken()]);case 3:return I=R.sent(),[3,5];case 4:I="",R.label=5;case 5:k=I,R.label=6;case 6:return R.trys.push([6,10,,11]),f||!h?[3,8]:[4,$r.getAccessToken()];case 7:return C=R.sent(),[3,9];case 8:C="",R.label=9;case 9:return N=C,[3,11];case 10:return M=R.sent(),Sr({serialId:u,result:{error_code:null==M?void 0:M.code,error_message:null==M?void 0:M.message,action:e}}),[2];case 11:return x=i.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(k,c,N,P,x)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),Kr={success:function(e,t){return{code:d,message:t||b,data:e||{}}},error:{badRequest:function(e){return new zr(h,e)},loginFailed:function(e){return new zr(v,"".concat(P,": ").concat(e))},loginRequired:function(){return new zr(v,S)},cannotGetShareInfo:function(){return new zr(m,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(H).find((function(t){return t===e.toString()}));return new zr(e,t||T)},clientNotSupport:function(){return new zr(y,A)}}},Vr=(Lr=function(t){var n,r,i,o=null===(n=Tn())||void 0===n?void 0:n.platformName,a=t.action.replace("action.","").replace(/\./g,"_").toUpperCase(),s=C[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new zr(f,"Can not get auth code: ".concat(t.error_message));if($r.jumpStatus!==e.JumpStatus.DONE&&!u)return new zr(N.UNAUTHORIZED.code,N.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new zr(N.FORBIDDEN.code,N.FORBIDDEN.message);if(o&&(null===(r=M[o])||void 0===r?void 0:r[t.error_code]))return new zr(M[o][t.error_code].code,M[o][t.error_code].message);var l=null==c||null===(i=c[o])||void 0===i?void 0:i[String(t.error_code)];if(l){var p,d,h,m=null===(p=l.mapTo)||void 0===p?void 0:p.message;return(null==l?void 0:l.needMoreDetail)&&(m="".concat(null==l||null===(h=l.mapTo)||void 0===h?void 0:h.message,": ").concat(t.error_message)),new zr(null===(d=l.mapTo)||void 0===d?void 0:d.code,m)}return new zr(t.error_code,t.error_message)},function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=lr.isEmpty(n)?void 0:n[r];if(o)return Sn({stage:t.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Lr(i):null==i?void 0:i.data)}}return lr.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=C[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){Hr(e,n,o,On({},i,a))}),s)}),Jr=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){lr.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),qr=function(){function n(){pr(this,n),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={}}var o,s,u,p=n.prototype;return p.jump=function(){var n=this;return V((function(){return Q(this,(function(r){return[2,new Promise((function(r,i){n._jumpStatus?n._jumpStatus===e.JumpStatus.DONE?r(e.JumpStatus.DONE):r(e.JumpStatus.DOING):(n._jumpStatus=e.JumpStatus.DOING,Sn({stage:t.REQUEST,type:"log",name:"jump"}),Hr("JUMP_LOGIN",{},{success:function(t){var i=t.data;n._miniProgramConfig=(null==i?void 0:i.miniProgramConfig)||{};var o=(null==i?void 0:i.cookiesOAuthLogins)||[],a=o.find((function(e){return e.name===c.JS_TOKEN}));a&&(n._jsAccessToken=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),n._cookies=o;var s=n._cookies.find((function(e){return e.name===c.ZOAUTH}));(null==s?void 0:s.value)||jr([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){jr([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),i(e)}},{skipJump:!0}))}))]}))}))()},p.loginZaloV3=function(e,t,n){var r=this;return V((function(){var i;return Q(this,(function(o){switch(o.label){case 0:return i="".concat(l.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(a,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=V((function(e){var t,n,i;return Q(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return t=o.sent(),n=null==t?void 0:t.access_token,r._accessToken=n,i=1e3*parseInt(t.expires_in),r.accessTokenExpiresIn=i,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(r._accessToken||""),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,o.sent()]}}))}))()},p.loginZaloV4=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this;return V((function(){var i,o;return Q(this,(function(a){switch(a.label){case 0:return(i=new URLSearchParams).append("app_id",e),i.append("code",t),i.append("code_verifier",n),lr.isNull(r.refreshToken)||0===r.refreshToken.length?i.append("grant_type","authorization_code"):(i.append("grant_type","refresh_token"),i.append("refresh_token",r.refreshToken||"")),o={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.GET_ACCESS_TOKEN,On({method:"POST",body:i},o)).then(function(){var e=V((function(e){var t,n,i,o;return Q(this,(function(a){switch(a.label){case 0:return[4,e.json()];case 1:return t=a.sent(),n=(null==t?void 0:t.access_token)||"",i=(null==t?void 0:t.refresh_token)||"",r.refreshToken=i,r._accessToken=n,o=1e3*parseInt(null==t?void 0:t.expires_in),r.accessTokenExpiresIn=o,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,a.sent()]}}))}))()},p.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return V((function(){var n,o,a,s,u,l,p,d,f;function h(){return m.apply(this,arguments)}function m(){return(m=V((function(){return Q(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(a.getAccessTokenCount<=1||a._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Q(this,(function(m){switch(m.label){case 0:return o=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(a=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken||t._accessToken.length>0&&o<t.accessTokenExpiresIn&&(null===(n=t._miniProgramConfig)||void 0===n?void 0:n.userAuthorized)?(a.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(c.ZOAUTH)]);case 3:return s=m.sent(),[4,t.jumpAndGetToken(c.ZOAUTH_VRF)];case 4:return u=m.sent(),l="zmp.getaccesstoken.fail",e?[4,t.verifyUserAuthorized()]:[3,6];case 5:return p=m.sent(),[3,7];case 6:p=!0,m.label=7;case 7:if(!p)throw a.getAccessTokenCount--,jr([{action:l,error:-104,message:"no user auth",data:{}}]),Kr.error.loginFailed("User Authentication Required");if(!s)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),u?[4,t.loginZaloV4(i,s,u)]:[3,10];case 9:return d=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(i,r,s)];case 11:d=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),d="",console.log("Can not get access token",f),jr([{action:l,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return a.getAccessTokenCount--,d||jr([{action:l,error:-101,message:"no accessToken",data:{}}]),[2,Promise.resolve(t._accessToken)];case 15:throw a.getAccessTokenCount--,jr([{action:l,error:-102,message:"no oauth",data:{}}]),Kr.error.loginFailed("Zalo app has not been activated")}}))}))()},p.verifyUserAuthorized=function(){var e=this;return V((function(){var t,n,r,i,o,a;return Q(this,(function(s){switch(s.label){case 0:if(n=!0,!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,6];s.label=1;case 1:return s.trys.push([1,5,,6]),(r=oi("action.mp.user.authorize"))&&r.isSupported?[4,Fr()]:[3,4];case 2:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,4]:[4,Jr()];case 3:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=4;case 4:return[3,6];case 5:return s.sent(),n=!1,[3,6];case 6:return[2,n]}}))}))()},p.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},p.getJSAccessToken=function(){var e=this;return V((function(){var t;return Q(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(c.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},p.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},p.jumpAndGetToken=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;return new Promise(function(){var i=V((function(i){var o,a,s,u;return Q(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?lr.isString(t)?(o=r._cookies.find((function(e){return e.name===t})),[2,i(null==o?void 0:o.value)]):[2,i("")]:(n&&r._jumpStatus===e.JumpStatus.DONE&&(r._jumpStatus=void 0),a={name:t,cb:function(e){return i(e)}},[4,r.jump()]);case 1:return(s=c.sent())===e.JumpStatus.DONE?(r._jumpStatus=s,r.WAITING_QUEUE.length&&(r.WAITING_QUEUE.forEach((function(e){var t=r._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),r.WAITING_QUEUE=[]),u=r._cookies.find((function(e){return e.name===a.name})),a.cb(null==u?void 0:u.value)):r.WAITING_QUEUE.push(a),[2]}}))}));return function(e){return i.apply(this,arguments)}}())},n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},o=n,(s=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&dr(o.prototype,s),u&&dr(o,u),n}(),$r=qr.getInstance(),Yr=ir("zmp:utils:common"),Qr=function(e){if(lr.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=[];for(var n=e.length,r=0;r<n;r++)t.push(Qr(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+Qr(e[i]));return"{"+t.join(",")+"}"}return e.toString()},Xr=function(e){var t,n,r=C[e],i=(null===(t=Tn())||void 0===t?void 0:t.zaloVersion)||0,o="versionLive"in r&&(null==r||null===(n=r.versionLive)||void 0===n?void 0:n.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||Number(i)>=o},ei=function(e){try{if(e){Yr(e);var t=e.replace(/\\/g,"").replace(/'/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return Yr("formattedValue",t,JSON.parse(t),rr(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return Yr("parse json error:",t),e}},ti=function(e){if(lr.isObject(JSON)&&JSON.parse&&lr.isString(e)){var t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\x00/g,"");return JSON.parse(t,(function(e,t){return t}))}return lr.isObject(e)?e:new Function("return "+e)()},ni=function(e){for(var t=document.getElementsByTagName("meta"),n=0;n<t.length;n++)if(t[n].getAttribute("name")===e||t[n].getAttribute("property")===e)return t[n].getAttribute("content");return""},ri=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var ii=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},oi=function(e){if(void 0!==e){var t=$r.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},ai=function(e){if(void 0===e)return!1;var t=$r.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},si=function(){var e=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n;return Q(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,$r.jumpAndGetToken()];case 1:return t.sent(),n=$r.miniProgramConfig,e(!0===(null==n?void 0:n.canUseAccessTokenByDefault)),[3,3];case 2:return t.sent(),e(!1),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));return function(){return e.apply(this,arguments)}}();function ui(e,t,n,r){var i,o,a=Array.isArray(n)&&n.length>0&&(null===(i=n[0])||void 0===i?void 0:i.success),s=Array.isArray(n)&&n.length>0&&(null===(o=n[0])||void 0===o?void 0:o.fail);try{var u=n;t.length>0&&t.forEach((function(t,r){var i=t.safeParse(n[r]);if(!i.success){var o,a=null===(o=i.error)||void 0===o?void 0:o.issues,s=a.map((function(e,t){var n=e.path.length>0?e.path.map((function(e,t){return t>0?"[".concat(e,"]"):e})).join(""):"arg";return"Error ".concat(t+1,": Code: ").concat(e.code," ~ Path: ").concat(n," ~ Message: ").concat(e.message)})).join(" | "),c=Kr.error.badRequest(s);throw c.detail=a,Wr(c,e)}u.push(i.data)}));var c=r.apply(void 0,Y(u));return lr.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!lr.isNull(a)&&lr.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Wr(t,e);if(!lr.isNull(s)&&lr.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!lr.isNull(s)&&lr.isFunction(s))return s(t);throw Wr(t,e)}}function ci(e){return li.apply(this,arguments)}function li(){return(li=V((function(e){return Q(this,(function(t){return[2,ui("login",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return En.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Pn("login",{}))]}}))})))]}))}))).apply(this,arguments)}function pi(e){return di.apply(this,arguments)}function di(){return(di=V((function(e){return Q(this,(function(t){return[2,ui("getAccessToken",[],[e],V((function(){var e;return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,si()]:[3,3];case 1:return e=!t.sent(),[4,$r.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return En.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Pn("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var fi="2.38.0";function hi(){return ui("getVersion",[],[],(function(){return fi}))}function mi(){var e,t;return{version:ni("version-id")||"",apiVersion:fi,zaloVersion:(null===(e=Tn())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=Tn())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function vi(){return ui("getSystemInfo",[],[],(function(){return mi()}))}var yi=function(){function t(){var e,n,r,o,s,u,c,l,p,d,f,h,m,v,y,g,_,w,b,T,E,S,P,A,O,k,I;pr(this,t),this.initConfig=window.APP_CONFIG;var N=lr.isString(null===(e=this.initConfig)||void 0===e||null===(n=e.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(o=r.app)||void 0===o||null===(s=o.headerColor)||void 0===s?void 0:s.length)>0?z:W;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(p=l.app)||void 0===p?void 0:p.hideAndroidBottomNavigationBar);var C,M,x="none"===(null===(d=this.initConfig)||void 0===d||null===(f=d.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?L.HIDE_BACK:L.SHOW_BACK,R="home"===(null===(v=this.initConfig)||void 0===v||null===(y=v.app)||void 0===y?void 0:y.leftButton)||"both"===(null===(g=this.initConfig)||void 0===g||null===(_=g.app)||void 0===_?void 0:_.leftButton)?L.SHOW_HOME:L.HIDE_HOME,j=new URL(location.href),D=ii(null===(w=this.initConfig)||void 0===w||null===(b=w.app)||void 0===b?void 0:b.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.app)||void 0===E?void 0:E.actionBarHidden)&&(N=(null===(C=this.initConfig)||void 0===C||null===(M=C.app)||void 0===M?void 0:M.actionBarHidden)?W:z);this.config={actionbarType:N,buttonType:x,statusbarType:D,dataConfig:{backgroundColor:(null===(S=this.initConfig)||void 0===S||null===(P=S.app)||void 0===P?void 0:P.headerColor)||G,textColor:(null===(A=this.initConfig)||void 0===A||null===(O=A.app)||void 0===O?void 0:O.textColor)||"",textAlign:(null===(k=this.initConfig)||void 0===k||null===(I=k.app)||void 0===I?void 0:I.textAlign)||F,viewInLeftType:x,confirmToExit:1},homeConfig:{enable:R,url:"".concat(a,"/").concat(i,"/").concat(j.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},n.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return V((function(){var r,i;return Q(this,(function(o){return void 0===(void 0===e?"undefined":rr(e))&&null===(void 0===e?"undefined":rr(e))||(r="none"===e||"home"===e?L.HIDE_BACK:L.SHOW_BACK,i="home"===e||"both"===e?L.SHOW_HOME:L.HIDE_HOME,n.config.buttonType=r,n.config.dataConfig.viewInLeftType=r,n.config.homeConfig.enable=i),n.config.dataConfig.confirmToExit=t,[2,new Promise((function(e,t){Vr("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",On({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},n.setAndroidBottomNavigationBar=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return V((function(){var r,i,o;return Q(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Tn())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();Vr("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideAndroidBottomNavigationBar=!!t,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1})}))]}))}))()},n.setIOSBottomSafeArea=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return V((function(){var r,i,o;return Q(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Tn())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();Vr("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideIOSSafeAreaBottom=!!t,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1,delay:200})}))]}))}))()},n.configHeader=function(t){var n=this;return V((function(){var r;return Q(this,(function(i){return r=n.config,lr.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),lr.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),lr.isString(t.textAlign)&&("left"===t.textAlign?r.dataConfig.textAlign=e.TextAlignType.left:"center"===t.textAlign&&(r.dataConfig.textAlign=e.TextAlignType.center)),!0===t.hideActionBar?r.actionbarType=W:!1===t.hideActionBar&&(r.actionbarType=z),"normal"===t.statusBarType?r.statusbarType=e.StatusBarType.normal:"hidden"===t.statusBarType?r.statusbarType=e.StatusBarType.hidden:"transparent"===t.statusBarType&&(r.statusbarType=e.StatusBarType.transparent),[2,new Promise((function(i,o){Vr("CHANGE_ACTIONBAR",On({},r),{success:function(){var o;n.config=On({},r);var a,s=null===(o=Tn())||void 0===o?void 0:o.platform;window.STATUS_BAR_TYPE=(a=n.config.statusbarType)===e.StatusBarType.hidden?"hidden":a===e.StatusBarType.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=n.config.actionbarType===W;var u=null===document||void 0===document?void 0:document.querySelector(":root");if(null==s?void 0:s.isAndroid){var c=0;if(("hidden"===t.statusBarType||"transparent"===t.statusBarType)&&t.hideActionBar){var l=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(l)&&(l=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),c=l}c?null==u||u.style.setProperty("--zaui-safe-area-inset-top","".concat(c,"px")):null==u||u.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}i()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t}(),gi=yi.getInstance(),_i=[Ct({title:yt()}).optional()];function wi(e){return bi.apply(this,arguments)}function bi(){return bi=V((function(e){return Q(this,(function(t){return[2,ui("setNavigationBarTitle",_i,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bi.apply(this,arguments)}var Ti=[Ct({color:yt(),textColor:yn.enum(["black","white"]).optional(),statusBarColor:yt().optional()}).optional()];function Ei(e){return Si.apply(this,arguments)}function Si(){return Si=V((function(e){return Q(this,(function(t){return[2,ui("setNavigationBarColor",Ti,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.configHeader({hideActionBar:!(e.color.length>0),headerTextColor:e.textColor,headerColor:e.color.length>0?e.color:e.statusBarColor})]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Si.apply(this,arguments)}var Pi=[Ct({type:yn.enum(["none","back","home","both"])}).optional()];function Ai(e){return Oi.apply(this,arguments)}function Oi(){return Oi=V((function(e){return Q(this,(function(t){return[2,ui("setNavigationBarLeftButton",Pi,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oi.apply(this,arguments)}function ki(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Ii(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,ki(e,t,"get"))}function Ni(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function Ci(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,ki(e,t,"set"),n),n}var Mi,xi,Ri,ji=new WeakMap,Di=new WeakMap,Ui=new WeakMap,Bi=function(){function e(t){pr(this,e),Ni(this,ji,{writable:!0,value:localStorage}),Ni(this,Di,{writable:!0,value:void 0}),Ni(this,Ui,{writable:!0,value:void 0}),Ci(this,Ui,{keys:new Set,currentSize:0,limitSize:R}),Ci(this,Di,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in Ii(this,ji)){if(e)if(t.split("_")[0]!==e)continue;Ii(this,Ui).keys.add(t)}}catch(e){}},t.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},t.getSync=function(e){return Ii(this,Di)&&(e="".concat(Ii(this,Di),"_").concat(e)),Ii(this,Ui).keys.has(e)?Ii(this,ji).getItem(e):null},t.set=function(e){var t=this;return V((function(){return Q(this,(function(n){return Object.entries(e).forEach((function(e){var n=kn(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){Ii(this,Di)&&(e="".concat(Ii(this,Di),"_").concat(e)),Ii(this,ji).setItem(e,t),Ii(this,Ui).keys.add(e)},t.getInfo=function(){var e=this;return V((function(){return Q(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},t.getInfoSync=function(){var e=function(e,t){var n,r=0;for(n in e){var i=n.split("_")[0];e.hasOwnProperty(n)&&(t&&i!==t||(r+=2*(e[n].length+n.length)))}return r}(Ii(this,ji),Ii(this,Di));return{currentSize:lr.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((R/1024).toFixed(2))}},t.remove=function(e){var t=this;return V((function(){return Q(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){Ii(this,Di)&&(e="".concat(Ii(this,Di),"_").concat(e)),Ii(this,Ui).keys.has(e)&&(Ii(this,ji).removeItem(e),Ii(this,Ui).keys.delete(e))},t.clear=function(){var e=this;return V((function(){return Q(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;Ii(this,Ui).keys.forEach((function(t){Ii(e,Di)&&t.indexOf(Ii(e,Di))<0||(Ii(e,ji).removeItem(t),Ii(e,Ui).keys.delete(t))}))},e}(),Zi=new WeakMap,Li=new WeakMap,zi=function(){function e(t){pr(this,e),Ni(this,Zi,{writable:!0,value:void 0}),Ni(this,Li,{writable:!0,value:void 0}),Ci(this,Li,{keys:new Set,currentSize:0,limitSize:R}),Ci(this,Zi,t)}var t=e.prototype;return t.get=function(e){var t=this;return V((function(){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Ii(t,Zi)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.set=function(e){var t=this;return V((function(){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Ii(t,Zi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.getInfo=function(){var e=this;return V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Ii(e,Zi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:lr.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(R/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return V((function(){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Ii(t,Zi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.clear=function(){var e=this;return V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Ii(e,Zi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),Wi=function(){function e(){pr(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return V((function(){var n,r;return Q(this,(function(i){switch(i.label){case 0:return[4,t.getInstance().get(e)];case 1:return n=i.sent(),r={},n.forEach((function(e,t){r[t]=ei(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return V((function(){var n,r;return Q(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=kn(e,2),n=t[0],i=t[1];lr.isUndefined(i)||lr.isNull(i)||(r[n]=ri(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return V((function(){return Q(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.clearStorage=function(){var e=this;return V((function(){return Q(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clear()];case 1:return t.sent(),[2]}}))}))()},t.getStorageInfo=function(){var e=this;return V((function(){return Q(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),Gi=new WeakMap,Fi=function(e){gr(n,e);var t=wr(n);function n(e){var r;return pr(this,n),Ni(_r(r=t.call(this)),Gi,{writable:!0,value:void 0}),Ci(_r(r),Gi,e),r}return n.prototype.getInstance=function(){return new Bi(Ii(this,Gi))},n}(Wi),Hi=new WeakMap,Ki=function(e){gr(n,e);var t=wr(n);function n(e){var r;return pr(this,n),Ni(_r(r=t.call(this)),Hi,{writable:!0,value:void 0}),Ci(_r(r),Hi,e),r}return n.prototype.getInstance=function(){return new zi(Ii(this,Hi))},n}(Wi),Vi=new Fi(i),Ji=(null===(Mi=Tn())||void 0===Mi?void 0:Mi.zaloVersion)||"",qi=(null===(xi=Tn())||void 0===xi?void 0:xi.platformName)||"unknown";!!lr.isString(Ji)&&parseInt(Ji,10)>={android:12100571,iOS:400,wp:0,unknown:0}[qi]&&(null===(Ri=Tn())||void 0===Ri?void 0:Ri.appEnv.isMp)&&(Vi=new Ki(i));var $i=Vi,Yi=[Ct({data:yn.record(yt(),yn.any())}).optional()];function Qi(e){return Xi.apply(this,arguments)}function Xi(){return Xi=V((function(e){return Q(this,(function(t){return[2,ui("setStorage",Yi,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp||En.isMpWeb?[4,$i.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Pn("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xi.apply(this,arguments)}var eo=[Ct({keys:yn.array(yt())}).optional()];function to(e){return no.apply(this,arguments)}function no(){return no=V((function(e){return Q(this,(function(t){return[2,ui("getStorage",eo,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp||En.isMpWeb?[4,$i.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Pn("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),no.apply(this,arguments)}function ro(e){return io.apply(this,arguments)}function io(){return(io=V((function(e){return Q(this,(function(t){return[2,ui("getStorageInfo",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp||En.isMpWeb?[4,$i.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Pn("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var oo=[Ct({keys:yn.array(yt())}).optional()];function ao(e){return so.apply(this,arguments)}function so(){return so=V((function(e){return Q(this,(function(t){return[2,ui("removeStorage",oo,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp||En.isMpWeb?[4,$i.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Pn("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),so.apply(this,arguments)}var uo=[Ct({prefix:yt().optional()}).optional()];function co(e){return lo.apply(this,arguments)}function lo(){return(lo=V((function(e){return Q(this,(function(t){return[2,ui("clearStorage",uo,[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp||En.isMpWeb?[4,$i.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Pn("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var po=function(){var e=V((function(e){var t,n,r;return Q(this,(function(i){switch(i.label){case 0:return[4,si()];case 1:return t=!i.sent(),[4,$r.getAccessToken(t)];case 2:return n=i.sent(),r="id,name,user_id_by_oa,is_sensitive",r=e?"".concat(r,",picture.type(").concat(e,")"):"".concat(r,",picture"),[4,fetch("".concat(l.GET_USER_INFO,"?fields=").concat(r),{headers:{access_token:n||""}}).then(function(){var e=V((function(e){var t,n,r,i;return Q(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return r=o.sent(),i=null==r?void 0:r.user_id_by_oa,[2,{id:null==r?void 0:r.id,name:(null==r?void 0:r.name)||"",avatar:(null==r||null===(t=r.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url)||"",idByOA:i,followedOA:!!i,isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 3:return[2,i.sent()]}}))}));return function(t){return e.apply(this,arguments)}}(),fo=[Ct({avatarType:yn.enum(["small","normal","large"]).optional()}).optional()];function ho(e){return mo.apply(this,arguments)}function mo(){return mo=V((function(e){return Q(this,(function(t){return[2,ui("getUserInfo",fo,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=null==e?void 0:e.avatarType,[4,po(t)]):[3,2];case 1:return[2,{userInfo:n.sent()}];case 2:return En.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Pn("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),mo.apply(this,arguments)}var vo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},yo=V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Tn())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case vo(s).NONE:o=e.NetworkType.none;break;case vo(s).WIFI:o=e.NetworkType.wifi;break;case vo(s)["2G"]:case vo(s)["3G"]:case vo(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function go(e){return _o.apply(this,arguments)}function _o(){return(_o=V((function(t){return Q(this,(function(n){return[2,ui("getNetworkType",[],[t],V((function(){var t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?[4,yo()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(En.isMpWeb){switch(t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t.effectiveType){case"none":n=e.NetworkType.none;break;case"4g":n=e.NetworkType.wifi;break;case"3g":case"2g":n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return[2,Promise.resolve({networkType:n})]}return[2,Promise.reject(Pn("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var wo=[yn.function().args(Ct({isConnected:yn.boolean(),networkType:yn.enum(["none","wifi","cellular","unknown"])})).returns(yn.void())];function bo(t){return ui("onNetworkStatusChange",wo,[t],(function(t){var n=t;if(En.isMp)!function(t){Er.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;yo().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(En.isMpWeb){var r=navigator.connection||navigator.mozConnection||navigator.webkitConnection,i=r.effectiveType;r.addEventListener("change",(function(){var t;switch(i){case"none":t=e.NetworkType.none;break;case"4g":t=e.NetworkType.wifi;break;case"3g":case"2g":t=e.NetworkType.cellular;break;default:t=e.NetworkType.unknown}n({isConnected:!0,networkType:t})}))}}))}var To=function(){var e=V((function(e){var t,n,r,i,o,a;return Q(this,(function(s){return a={subaction:0,scanning_type:lr.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:lr.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:lr.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:lr.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:lr.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:lr.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:lr.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:lr.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:lr.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:lr.isNumber(null==e||null===(o=e.scanConfig)||void 0===o?void 0:o.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}},[2,new Promise((function(e,t){Vr("SCAN_IBEACON",On({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Eo=[Ct({scanningType:yn.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:yn.number().optional(),monitorInterval:yn.number().optional(),domain:yn.string().optional(),scanConfig:Ct({scanTime:yn.number().optional(),timeBetweenScan:yn.number().optional(),beaconTimeout:yn.number().optional(),delayCheckConnectedTimeout:yn.number().optional(),beaconConnectedTimeout:yn.number().optional()}).optional(),items:yn.array(Ct({id:yn.string().optional(),distance:yn.number().optional(),monitor:Ct({enable:yn.boolean().optional(),movingRange:yn.number().optional()}).optional()})).optional(),scanFromSource:yn.string().optional()}).optional()];function So(e){return Po.apply(this,arguments)}function Po(){return(Po=V((function(e){return Q(this,(function(t){return[2,ui("startBeaconDiscovery",Eo,[e],V((function(){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,To(e)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Pn("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Ao=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Oo(e){return ko.apply(this,arguments)}function ko(){return(ko=V((function(e){return Q(this,(function(t){return[2,ui("stopBeaconDiscovery",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ao()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Pn("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Io=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("SCAN_IBEACON",{subaction:1},{success:function(t){var n={beacons:[]};Array.isArray(t)&&t.forEach((function(e){var t={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};n.beacons.push(t)})),e(n)},fail:function(e){t(e)}},{isMultiCallback:!0})}))]}))}));function No(e){return Co.apply(this,arguments)}function Co(){return(Co=V((function(e){return Q(this,(function(t){return[2,ui("getBeacons",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Io()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Pn("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Mo=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function xo(e){return Ro.apply(this,arguments)}function Ro(){return(Ro=V((function(e){return Q(this,(function(t){return[2,ui("closeApp",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Mo()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var jo=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Do(e){return Uo.apply(this,arguments)}function Uo(){return(Uo=V((function(e){return Q(this,(function(t){return[2,ui("scanQRCode",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,jo()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Pn("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Bo=function(){var t=V((function(t,n,i,o){return Q(this,(function(a){return[2,new Promise((function(a,s){Vr("OPEN_PROFILE",{uId:t,type:e.ProfileType[n],zapp:r,sourceId:i,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(e,n,r,i){return t.apply(this,arguments)}}(),Zo=[Ct({id:yt(),type:yn.enum(["user","oa","aliasOA"]),sourceId:yn.any().optional(),sourceIndex:yn.any().optional()}).optional()];function Lo(e){return zo.apply(this,arguments)}function zo(){return zo=V((function(e){return Q(this,(function(t){return[2,ui("openProfile",Zo,[e],function(){var e=V((function(e){var t,n,r,i;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Bo(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zo.apply(this,arguments)}var Wo=function(){var t=V((function(t,n){var i,o,a,s=arguments;return Q(this,(function(u){return i=s.length>2&&void 0!==s[2]?s[2]:"",o=s.length>3?s[3]:void 0,a=s.length>4?s[4]:void 0,[2,new Promise((function(s,u){Vr("OPEN_CHAT",{uId:t,type:e.ChatType[n],msg:i,zapp:r,sourceId:o,sourceIndex:a},{success:function(){s()},fail:function(e){u(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Go=[Ct({id:yt(),type:yn.enum(["user","oa"]),sourceId:yn.any().optional(),sourceIndex:yn.any().optional(),message:yt().optional()}).optional()];function Fo(e){return Ho.apply(this,arguments)}function Ho(){return Ho=V((function(e){return Q(this,(function(t){return[2,ui("openChat",Go,[e],function(){var e=V((function(e){var t,n,r,i,o;return Q(this,(function(a){switch(a.label){case 0:return En.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,Wo(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ho.apply(this,arguments)}function Ko(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var Vo=function(){var t=V((function(t,n){var i;return Q(this,(function(o){switch(i={},t){case"image":i={photoUrl:null==n?void 0:n.imageUrl};break;case"link":i={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":i={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(n,o){Vr("OPEN_POSTFEED",Ko(On({type:e.PostFeedType[t]},i),{zapp:r}),{success:function(e){n({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){o(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Jo=[yn.union([Ct({type:yn.enum(["image"]),data:Ct({imageUrl:yt().url().optional()})}),Ct({type:yn.enum(["link"]),data:Ct({link:yt().url(),title:yt().max(100).optional(),thumb:yt().url().optional(),description:yt().max(400).default("").optional()})}),Ct({type:yn.enum(["profile"]),data:Ct({id:yt().optional()})})])];function qo(e){return $o.apply(this,arguments)}function $o(){return $o=V((function(e){return Q(this,(function(t){return[2,ui("openPostFeed",Jo,[e],function(){var e=V((function(e){var t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?(t=e.type,n=e.data,[4,Vo(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Pn("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$o.apply(this,arguments)}var Yo=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:r},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Qo=[Ct({id:yt(),showDialogConfirm:yn.boolean().optional()}).optional()];function Xo(e){return ea.apply(this,arguments)}function ea(){return ea=V((function(e){return Q(this,(function(t){return[2,ui("followOA",Qo,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=e.id,[4,Yo(t)]):[3,2];case 1:return[2,n.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ea.apply(this,arguments)}var ta=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),na=[Ct({id:yt()}).optional()];function ra(e){return ia.apply(this,arguments)}function ia(){return ia=V((function(e){return Q(this,(function(t){return[2,ui("unfollowOA",na,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=e.id,[4,ta(t)]):[3,2];case 1:return[2,n.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ia.apply(this,arguments)}var oa=function(){var e=V((function(e,t,n,r,i,a){var s,c,p,d,f,h;return Q(this,(function(m){switch(m.label){case 0:return s=new URL(location.href),c=new URLSearchParams,p="".concat(s.pathname.replace(u,"")).concat(s.search),a&&(p="/".concat(e).concat("/"===a[0]?"":"/").concat(a)),d=new URL("".concat(o).concat(p)),c.append("title",n),c.append("description",r||""),c.append("thumbnail",i||""),c.append("url",d.href),c.append("accessToken",t||""),f={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.CREATE_SHARE_LINK,On({method:"POST",body:c},f))];case 1:return[4,m.sent().json()];case 2:if(!(h=m.sent())||0!==h.err)throw Kr.error.cannotGetShareInfo();return d.search="".concat(d.search,"&zshareId=").concat(h.data.shareId),[2,Ko(On({},h.data),{shareableLink:d.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),aa=function(){var t=V((function(t,n){var o,a,s,u,c,l,p,d,f,h,m,v;return Q(this,(function(y){switch(y.label){case 0:switch(o={},a=t,t){case"image":return[3,1];case"gif":return[3,2];case"video":return[3,3];case"link":return[3,4];case"oa":return[3,5];case"zmp":return[3,6];case"zmp_deep_link":return[3,9]}return[3,12];case 1:return l=[],p=(null===(u=Tn())||void 0===u?void 0:u.zaloVersion)||0,d=(null===(c=Tn())||void 0===c?void 0:c.platformName)||"unknown",Number(p)>=x[d]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?l=null==n?void 0:n.imageUrls:l.push(null==n?void 0:n.imageUrl),o={photoUrls:l,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,13];case 2:return o={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,13];case 3:return o={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,13];case 4:return o={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,13];case 5:return o={uid:null==n?void 0:n.id},[3,13];case 6:case 9:return[4,$r.getAccessToken()];case 7:case 10:return s=y.sent(),[4,oa(i,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 8:return f=y.sent(),o={data:{ZInstantAPIInfo:{url:"".concat(f.zinstantApi),zinstantdata_id:"templateId=".concat(f.ztemplateId,"&appId=").concat(i,"&shareId=").concat(f.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,13];case 11:return h=y.sent().shareableLink,m=new URL(h),v=m.searchParams.getAll("zshareId"),m.searchParams.delete("zshareId"),v.length>0&&m.searchParams.append("zshareId",v[0]),o={link:m.href,chatOnly:0},[3,13];case 12:return[3,13];case 13:return[2,new Promise((function(t,n){Vr("OPEN_SHARESHEET",Ko(On({type:e.ShareSheetType[a]},o),{zapp:r}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{timeout:!1})}))]}}))}));return function(e,n){return t.apply(this,arguments)}}(),sa=[yn.union([Ct({type:yn.enum(["image"]),data:Ct({imageUrl:yt().url(),imageUrls:yn.array(yt().url()).max(10).optional()})}),Ct({type:yn.enum(["link"]),data:Ct({link:yt().url(),chatOnly:yn.boolean().optional()})}),Ct({type:yn.enum(["oa"]),data:Ct({id:yt()})}),Ct({type:yn.enum(["gif"]),data:Ct({gifUrl:yt().url(),imageUrl:yt().url().optional(),width:gt().min(0).optional(),height:gt().min(0).optional()})}),Ct({type:yn.enum(["video"]),data:Ct({videoThumb:yt().url(),videoUrl:yt().url(),width:gt().min(0).optional(),height:gt().min(0).optional()})}),Ct({type:yn.enum(["zmp","zmp_deep_link"]),data:Ct({title:yt().max(100),thumbnail:yt().url(),path:yt().optional(),description:yt().max(400).default("").optional()})})])];function ua(e){return ca.apply(this,arguments)}function ca(){return ca=V((function(e){return Q(this,(function(t){return[2,ui("openShareSheet",sa,[e],function(){var e=V((function(e){var t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?(t=e.type,n=e.data,[4,aa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Pn("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ca.apply(this,arguments)}var la=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Tn())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)?e({userAllow:void 0===t.error_code||(null==t?void 0:t.error_code)>=0,message:void 0===t.error_code?"User allowed":null==t?void 0:t.error_message}):e({userAllow:(null==t?void 0:t.error_code)>=0,message:null==t?void 0:t.error_message})},fail:function(n){var r,i;(null===(r=Tn())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)&&"number"==typeof(null==n?void 0:n.code)?e({userAllow:(null==n?void 0:n.code)>=0,message:null==n?void 0:n.message}):t(n)}},{isMultiCallback:!0})}))]}))}));function pa(e){return da.apply(this,arguments)}function da(){return(da=V((function(e){return Q(this,(function(t){return[2,ui("requestCameraPermission",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return[4,la()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var fa=function(){var e=V((function(e,t,n){return Q(this,(function(r){return[2,new Promise((function(r,i){Vr("CREATE_SHORTCUT",{url:e,title:t,iconUrl:n},{success:function(e){r(e)},fail:function(e){i(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),ha=V((function(){var e,t,n,r=arguments;return Q(this,(function(o){switch(o.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:i,t=r.length>1&&void 0!==r[1]?r[1]:0,n=mi(),[4,Rr(e,t,n.version)];case 1:return[2,o.sent()]}}))})),ma=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),va=[Ct({params:yn.record(yt(),yt()).optional()}).optional()];function ya(e){return ga.apply(this,arguments)}function ga(){return ga=V((function(e){return Q(this,(function(t){return[2,ui("createShortcut",va,[e],function(){var e=V((function(e){var t,n,r,a,s,u,c,l;return Q(this,(function(p){switch(p.label){case 0:return En.isMp?[4,ha(i,0)]:[3,6];case 1:return r=p.sent(),a=null===(t=Tn())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||ni("og:image:url")||"",u=r.name||document.title,(c=(null==e?void 0:e.params)?new URLSearchParams(null==e?void 0:e.params):new URLSearchParams).append("utm_source","zalo-shortcut"),c.append("utm_medium","default"),c.append("utm_campaign","default"),a?(c.append("appId",i),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,ma(encodeURI(l))]):[3,3];case 2:return p.sent(),[3,5];case 3:return[4,fa("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:p.sent(),p.label=5;case 5:return[2,Kr.success()];case 6:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ga.apply(this,arguments)}var _a=function(){var e=V((function(e,t,n){return Q(this,(function(i){return[2,new Promise((function(i,o){Vr("PROMPT_AUTHENTICATION",{secret_data:e,app_id:r,ui:{title:null==t?void 0:t.title,sub_title:null==t?void 0:t.subTitle,negative_text:null==t?void 0:t.negativeButtonText},require_fingerprint:n?1:0},{success:function(e){var t,n,r,o;i({code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null==e||null===(t=e.data)||void 0===t?void 0:t.domain,code:null==e||null===(n=e.data)||void 0===n?void 0:n.error_code,message:null==e||null===(r=e.data)||void 0===r?void 0:r.error_message,payToken:null==e||null===(o=e.data)||void 0===o?void 0:o.pay_token}})},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),wa=[Ct({secretData:yt(),ui:Ct({title:yt().default("Xác thực").optional(),subTitle:yt().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:yt().default("Đóng").optional()}).optional(),requireFingerprint:bt().default(!0).optional()}).optional()];function ba(e){return Ta.apply(this,arguments)}function Ta(){return Ta=V((function(e){return Q(this,(function(t){return[2,ui("openBioAuthentication",wa,[e],function(){var e=V((function(e){var t,n,r;return Q(this,(function(i){switch(i.label){case 0:return En.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,_a(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Pn("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ta.apply(this,arguments)}var Ea=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("PROMPT_AUTHENTICATION_CHECK_STATE",{},{success:function(t){e(null==t?void 0:t.bio_state)},fail:function(e){t(e)}},{actionName:"action.prompt.authentication.check_state"})}))]}))}));function Sa(e){return Pa.apply(this,arguments)}function Pa(){return(Pa=V((function(e){return Q(this,(function(t){return[2,ui("checkStateBioAuthentication",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ea()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return En.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Pn("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Aa=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Oa=[Ct({message:yt()}).optional()];function ka(e){return Ia.apply(this,arguments)}function Ia(){return Ia=V((function(e){return Q(this,(function(t){return[2,ui("showToast",Oa,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Aa(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ia.apply(this,arguments)}var Na=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ca(e){return Ma.apply(this,arguments)}function Ma(){return(Ma=V((function(e){return Q(this,(function(t){return[2,ui("hideKeyboard",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Na()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var xa=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ra=[Ct({phoneNumber:yt()})];function ja(e){return Da.apply(this,arguments)}function Da(){return Da=V((function(e){return Q(this,(function(t){return[2,ui("openPhone",Ra,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,xa(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Da.apply(this,arguments)}var Ua=function(){var e=V((function(e,t){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ba=[Ct({content:yt(),phoneNumber:yt()})];function Za(e){return La.apply(this,arguments)}function La(){return La=V((function(e){return Q(this,(function(t){return[2,ui("openSMS",Ba,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Ua(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),La.apply(this,arguments)}var za=function(){var e=V((function(e){var t,n=arguments;return Q(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){Vr("VIEW_MYQR",{dpn:t,uid:e,zapp:r},{success:function(){n()},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Wa=[Ct({id:yt(),displayName:yt().default("").optional()})];function Ga(e){return Fa.apply(this,arguments)}function Fa(){return Fa=V((function(e){return Q(this,(function(t){return[2,ui("viewOAQr",Wa,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,za(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fa.apply(this,arguments)}var Ha=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("KEEP_SCREEN",{data:{keep_screen_on:e?1:0}},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ka=[Ct({keepScreenOn:bt()})];function Va(e){return Ja.apply(this,arguments)}function Ja(){return Ja=V((function(e){return Q(this,(function(t){return[2,ui("keepScreen",Ka,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Ha(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ja.apply(this,arguments)}function qa(e){return $a.apply(this,arguments)}function $a(){return($a=V((function(e){return Q(this,(function(t){return[2,ui("onKeepScreen",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ha(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function Ya(e){return Qa.apply(this,arguments)}function Qa(){return(Qa=V((function(e){return Q(this,(function(t){return[2,ui("offKeepScreen",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ha(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var Xa=function(){var e=V((function(e,t){var n;return Q(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){Vr("SAVE_IMAGE_GALLERY",On({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),es=[Ct({imageBase64Data:yt().optional(),imageUrl:yt().url().optional()}).optional()];function ts(e){return ns.apply(this,arguments)}function ns(){return ns=V((function(e){return Q(this,(function(t){return[2,ui("saveImageToGallery",es,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Xa(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ns.apply(this,arguments)}var rs=function(){var e=V((function(e){var t,n,r,i,o,s,u=arguments;return Q(this,(function(c){switch(c.label){case 0:t=u.length>1&&void 0!==u[1]?u[1]:"/",n=u.length>2&&void 0!==u[2]?u[2]:{},c.label=1;case 1:return c.trys.push([1,3,,4]),[4,ha(e,0)];case 2:return r=c.sent(),[3,4];case 3:return c.sent(),[3,4];case 4:i={appId:e},r&&(i.appName=r.name,i.appAvtUrl=r.logoUrl),o="".concat(a,"/").concat(e).concat(t);try{s=new URL(o),Object.entries(n).forEach((function(e){var t=kn(e,2),n=t[0],r=t[1];s.searchParams.append(n,String(r))})),o=s.href}catch(e){}return[2,new Promise((function(e,t){Vr("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),is=[Ct({appId:yt(),path:yt().optional(),params:yn.record(yt(),yt()).optional()})];function os(e){return as.apply(this,arguments)}function as(){return as=V((function(e){return Q(this,(function(t){return[2,ui("openMiniApp",is,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,rs(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),as.apply(this,arguments)}var ss=V((function(){var t,n,r=arguments;return Q(this,(function(i){return t=r.length>0&&void 0!==r[0]?r[0]:"oneShot",n=r.length>1?r[1]:void 0,[2,new Promise((function(r,i){Vr("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),us=[Ct({type:yn.enum(["oneShot"]).default("oneShot"),milliseconds:gt().optional()})];function cs(e){return ls.apply(this,arguments)}function ls(){return ls=V((function(e){return Q(this,(function(t){return[2,ui("vibrate",us,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,ss(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ls.apply(this,arguments)}var ps=function(){var e=V((function(e,t){var n,r,i,o;return Q(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=lr.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Dr(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Dr(null==t?void 0:t.leftButton):"back"},!r&&lr.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){Vr("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ds=[Ct({url:yt(),config:Ct({style:yn.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:yn.enum(["back","none"]).default("back").optional()}).optional()})];function fs(e){return hs.apply(this,arguments)}function hs(){return hs=V((function(e){return Q(this,(function(t){return[2,ui("openWebview",ds,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,ps(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),hs.apply(this,arguments)}function ms(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Ar.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function vs(){return ui("getRouteParams",[],[],(function(){return ms()}))}function ys(e){return gs.apply(this,arguments)}function gs(){return(gs=V((function(e){return Q(this,(function(t){return[2,ui("getAppInfo",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,ha()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Pn("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var _s=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("WEBVIEW_SET_RESULT",{result:ri(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ws=[Ct({data:yn.any()})];function bs(e){return Ts.apply(this,arguments)}function Ts(){return Ts=V((function(e){return Q(this,(function(t){return[2,ui("sendDataToPreviousMiniApp",ws,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,_s(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ts.apply(this,arguments)}var Es=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){var n,r;Vr("MP_GET_NUMBER",{forceUpdate:!0},{success:function(n){var r={};if(null==n?void 0:n.token)return r.token=null==n?void 0:n.token,e(r);t(Kr.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Tn())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function Ss(e){return Ps.apply(this,arguments)}function Ps(){return(Ps=V((function(e){return Q(this,(function(t){return[2,ui("getPhoneNumber",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Es()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Pn("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var As=V((function(){var e,t=arguments;return Q(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){Vr("MP_OPEN_PROFILE_PICKER",{maxProfile:e},{success:function(e){Array.isArray(e)?t(e.map((function(e){return e.id}))):t([])},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))})),Os=[Ct({maxProfile:gt().min(1).max(10).optional().default(1)})];function ks(e){return Is.apply(this,arguments)}function Is(){return Is=V((function(e){return Q(this,(function(t){return[2,ui("openProfilePicker",Os,[e],function(){var e=V((function(e){var t,n,r,i,o;return Q(this,(function(a){switch(a.label){case 0:return En.isMp?[4,As(null==e?void 0:e.maxProfile)]:[3,8];case 1:if(!((t=a.sent()).length>0))return[3,7];a.label=2;case 2:return a.trys.push([2,6,,7]),[4,$r.getAccessToken()];case 3:return r=a.sent(),[4,fetch(l.GET_LIST_USER_INFO,{method:"POST",headers:{"Content-Type":"application/json",access_token:r||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})})];case 4:return[4,a.sent().json()];case 5:if(0!==(i=a.sent()).error||!i.data)throw new Error(i.message);return n=t.map((function(e){var t,n,r,o,a,s,u,c,l,p,d;return{id:(null===(t=i.data[e])||void 0===t||null===(n=t.user_info)||void 0===n?void 0:n.user_id_by_app)||"",profile:{name:null===(r=i.data[e])||void 0===r||null===(o=r.user_info)||void 0===o?void 0:o.name,avatar:null===(a=i.data[e])||void 0===a||null===(s=a.user_info)||void 0===s||null===(u=s.picture)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.url},code:0!==(null===(l=i.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(lr.isUndefined(null===(p=i.data[e])||void 0===p?void 0:p.message)?"Unknown error":null===(d=i.data[e])||void 0===d?void 0:d.message)}})),[3,7];case 6:return o=a.sent(),n=t.map((function(e){return{id:e,profile:{name:"",avatar:""},code:-1,message:"Can't get profile: ".concat(o.message)}})),[3,7];case 7:return[2,{users:n||[]}];case 8:return En.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Pn("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Is.apply(this,arguments)}var Ns=function(){var e=V((function(e,t,n){var r;return Q(this,(function(i){return r=t&&lr.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){Vr("MP_JOIN_WIFI",{ssid:e,securityType:r,password:t,hiddenSsid:n},{success:function(e){i(e)},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Cs=[Ct({SSID:yt(),password:yt().optional(),hiddenSSID:bt().optional()})];function Ms(e){return xs.apply(this,arguments)}function xs(){return xs=V((function(e){return Q(this,(function(t){return[2,ui("connectWifi",Cs,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Ns(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xs.apply(this,arguments)}var Rs=function(){var t=V((function(t,n,r,i,o,a){var s,u;return Q(this,(function(c){return s={type:0,url:n,maxSize:r||1048576},u={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(n,r){Vr("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:On({},u,i),silent_request:o,upload:s,max_select_items:a},{success:function(e){n(null==e?void 0:e.result_content)},fail:function(e){r(e)}},{isMultiCallback:!0})}))]}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),js=[Ct({type:yn.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:yt().url(),maxItemSize:gt().min(0).optional(),editView:Ct({enable:bt().optional(),aspectRatio:yt().regex(/^d+:d+$/).optional()}).optional(),silentRequest:bt().optional(),maxSelectItem:gt().min(1).optional()})];function Ds(e){return Us.apply(this,arguments)}function Us(){return Us=V((function(e){return Q(this,(function(t){return[2,ui("openMediaPicker",js,[e],function(){var e=V((function(e){var t,n,r,i,o,a;return Q(this,(function(s){switch(s.label){case 0:return En.isMp?(i={},lr.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(n=e.editView)||void 0===n?void 0:n.enable)?i.enable=1:i.enable=0,i.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio,o=!0===e.silentRequest?1:0,a=e.maxSelectItem,[4,Rs(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return En.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Pn("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Us.apply(this,arguments)}var Bs=[Ct({title:yt().max(100),description:yt().max(400).default(""),thumbnail:yt().url().optional(),path:yt().optional()})];function Zs(e){return Ls.apply(this,arguments)}function Ls(){return Ls=V((function(e){return Q(this,(function(t){return[2,ui("getShareableLink",Bs,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return[4,$r.getAccessToken()];case 1:return t=n.sent(),[4,oa(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ls.apply(this,arguments)}var zs=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("MP_CLOSE_LOADINGVIEW",{at:(new Date).getTime(),when:e,url:location.href},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}();function Ws(e){return Gs.apply(this,arguments)}function Gs(){return(Gs=V((function(e){return Q(this,(function(t){return[2,ui("closeLoading",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,zs("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function Fs(e){return Hs.apply(this,arguments)}function Hs(){return Hs=V((function(e){return Q(this,(function(t){return[2,ui("requestUpdateZalo",[],[e],V((function(){var e,t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?(n=(null===(e=Tn())||void 0===e||null===(t=e.platform)||void 0===t?void 0:t.isIOS)?"https://apps.apple.com/vn/app/zalo/id579523206":"https://play.google.com/store/apps/details?id=com.zing.zalo",[4,ma(n)]):[3,2];case 1:return[2,r.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("requestUpdateZalo",{}))]}}))})))]}))})),Hs.apply(this,arguments)}var Ks=Er.getInstance();Ks.addListener=function(t,n,r){var i=t;return Ks.addListener(e.Events[i],n,r)};var Vs=[yn.function()];function Js(t){return ui("onConfirmToExit",Vs,[t],(function(t){var n=t;En.isMp&&(Ks.on(e.Events.AppClose,n,'{"handle_h5": 1}'),gi.setNavigationBarLeftButton(void 0,2))}))}function qs(){return ui("offConfirmToExit",[],[],(function(){En.isMp&&(Ks.off(e.Events.AppClose),gi.setNavigationBarLeftButton(void 0,0))}))}function $s(){return ui("getDeviceId",[],[],(function(){return En.isMp&&$r.getSync(c.DEVICE_ID)||""}))}function Ys(e){return Qs.apply(this,arguments)}function Qs(){return(Qs=V((function(e){return Q(this,(function(t){return[2,ui("getDeviceIdAsync",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function Xs(){return ui("getContext",[],[],(function(){if(En.isMp){var e=$r.getSync(c.CONTEXT_ID)||"";return{type:$r.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function eu(e){return tu.apply(this,arguments)}function tu(){return(tu=V((function(e){return Q(this,(function(t){return[2,ui("getContextAsync",[],[e],V((function(){var e;return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,$r.jumpAndGetToken(c.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function nu(e){return ru.apply(this,arguments)}function ru(){return(ru=V((function(e){return Q(this,(function(t){return[2,ui("getAuthCode",[],[e],V((function(){var e,t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,$r.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,$r.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw jr([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),Kr.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function iu(e){return ou.apply(this,arguments)}function ou(){return(ou=V((function(e){return Q(this,(function(t){return[2,ui("getZPIToken",[],[e],V((function(){var e,t,n,r;return Q(this,(function(i){switch(i.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,$r.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,$r.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,$r.jumpAndGetToken(c.ZPT_ZPI)];case 4:return r=i.sent()||"",[2,{utoken:e,gtoken:t,zpp:n,zpt:r}];case 5:return[2,Promise.resolve({utoken:"",gtoken:"",zpp:"",zpt:""})]}}))})))]}))}))).apply(this,arguments)}var au=[yt()];function su(e){return ui("setAccessToken",au,[e],(function(e){var t=e;$r.setAccessToken(t)}))}var uu=[Ct({url:yt().url()})];function cu(e){return lu.apply(this,arguments)}function lu(){return lu=V((function(e){return Q(this,(function(t){return[2,ui("openOutApp",uu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,ma(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),lu.apply(this,arguments)}var pu=[Ct({count:gt().min(1).optional().default(1),sourceType:yn.array(yn.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:yn.enum(["back","front"]).default("front").optional()})];function du(e){return fu.apply(this,arguments)}function fu(){return fu=V((function(e){return Q(this,(function(t){return[2,ui("chooseImage",pu,[e],function(){var e=V((function(e){var t,n,r,i;return Q(this,(function(o){return t=e.sourceType||["album","camera"],n=e.cameraType||"front",r=e.count||1,(i=document.createElement("input")).type="file",i.multiple=r>1,i.accept="image/*",i.style.display="none",1===t.length&&t.includes("camera")&&(i.accept="front"===n?"zcamera/photo-frontfacing":"zcamera/photo-backfacing",i.capture="front"===n?"user":"environment"),[2,new Promise((function(e,t){i.addEventListener("change",(function(n){var i,o=(null==n||null===(i=n.target)||void 0===i?void 0:i.files)||[];if(o.length>r)t(new Error("You are only allowed to choose a maximum of ".concat(r," images at a time")));else{var a={filePaths:[],tempFiles:[]};Array.from(o).forEach((function(e){a.filePaths.push(URL.createObjectURL(e)),a.tempFiles.push({path:URL.createObjectURL(e),size:e.size})})),e(a)}})),document.body.appendChild(i),i.click()}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fu.apply(this,arguments)}var hu=V((function(){var e,t,n=arguments;return Q(this,(function(r){return e=n.length>0&&void 0!==n[0]&&n[0],t=n.length>1&&void 0!==n[1]?n[1]:"Cho phép Zalo truy cập vào vị trí của thiết bị này?",[2,new Promise((function(n,r){Vr("GET_LOCATION",{silent_request:e,permission_description:t,forceUpdate:!0},{success:function(e){var t={};if(null==e?void 0:e.token)return t.token=null==e?void 0:e.token,n(t);r(Kr.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function mu(e){return vu.apply(this,arguments)}function vu(){return(vu=V((function(e){return Q(this,(function(t){return[2,ui("getLocation",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,hu()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Pn("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var yu=[yn.function().args(Ct({data:yn.any()})).returns(yn.void())];function gu(t){return ui("onCallbackData",yu,[t],(function(){!function(t){Er.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var _u=function(){var e=V((function(e){var t,n,r,o,a,s,u,c,l,p,d;return Q(this,(function(f){switch(f.label){case 0:return n="",e||(e=ms()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Ar.getParameterByName("orderId",e),o=Ar.getParameterByName("appTransID",e)||Ar.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,$r.getAccessToken().catch((function(){throw Kr.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(U),c={orderId:n,transId:t||"",appId:i},u.search=new URLSearchParams(c).toString(),[4,fetch(u.toString(),a)];case 2:return[4,f.sent().json()];case 3:if(!(l=f.sent()).data)throw Kr.error.badRequest(l.msg);return p=l.data||{},d={err:l.err},0!==Object.keys(p).length&&p.constructor===Object&&Object.assign(d,On({msg:p.resultMessage},p)),[2,d]}}))}));return function(t){return e.apply(this,arguments)}}(),wu=function(){var t=V((function(t,n,r,o,a,s,u){var c,l,p,d,f,h,m,v,y,g,_,w,b,T,E,S,P,A,O,k;return Q(this,(function(I){switch(I.label){case 0:c=i,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("appId",c),r&&l.append("desc",encodeURIComponent(r)),o&&(p=o,"object"==typeof o&&(p=JSON.stringify(o)),l.append("extradata",encodeURIComponent(p))),a&&(d=a,"object"==typeof a&&(d=JSON.stringify(a)),l.append("payload",encodeURIComponent(d))),s&&("string"==typeof s?(l.append("method",s),l.append("isCustom","false")):"object"==typeof s&&(l.append("method",s.id),l.append("isCustom",JSON.stringify(s.isCustom)))),u&&l.append("mac",u),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},I.label=1;case 1:return I.trys.push([1,6,,7]),[4,$r.getAccessToken().catch((function(){throw Kr.error.loginRequired}))];case 2:return m=I.sent(),f.headers.authorization="Bearer ".concat(m),[4,fetch(j,Ko(On({method:"POST"},f),{body:l}))];case 3:return[4,I.sent().json()];case 4:if(!(v=I.sent()).data||0!==v.err)throw Kr.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=window.APP_VERSION,w=window.APP_ENV,b={miniAppId:c,orderId:y},T=v.data.method,E=v.data.isCustom,g&&(b.token=g),_&&(b.version=_),w&&(b.env=w),T&&(b.method=T),E&&(b.isCustom=E),S=Ar.encode(b),P=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),A=Ur(),O=((null===(h=Tn())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,ps(P,{style:"android"===O&&A<742?"normal":"bottomSheet"}).then((function(){var t=!1;Er.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(V((function(){var n;return Q(this,(function(r){switch(r.label){case 0:return t?[3,2]:[4,_u({zmpOrderId:y})];case 1:(n=r.sent()).err>=0&&!n.isCustom&&Er.getInstance().emit(e.Events.PaymentClose,n.err,Ko(On({},n),{zmpOrderId:y})),r.label=2;case 2:return[2]}}))})),500)})),Er.getInstance().once(e.Events.OpenApp,(function(){t=!0}))}))];case 5:return I.sent(),[2,{orderId:y}];case 6:throw k=I.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),bu=[Ct({amount:yn.union([yt(),gt()]),item:yn.array(yn.record(yt(),yn.any())),desc:yt(),extradata:yn.any().optional(),payload:yn.any().optional(),method:yn.union([yn.string(),yn.object({id:yn.string(),isCustom:yn.boolean()})]).optional(),mac:yn.string().optional()})];function Tu(e){return Eu.apply(this,arguments)}function Eu(){return Eu=V((function(e){return Q(this,(function(t){return[2,ui("createOrder",bu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,wu(e.amount,e.item,e.desc,e.extradata,e.payload,e.method,e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Pn("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Eu.apply(this,arguments)}var Su=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("MP_SELECT_PAYMENT_METHOD",{method:e,forceUpdate:!0},{success:function(e){console.log(e),t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Pu=[Ct({method:yt().optional()}).optional()];function Au(e){return Ou.apply(this,arguments)}function Ou(){return Ou=V((function(e){return Q(this,(function(t){return[2,ui("selectPaymentMethod",Pu,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=e.method,[4,Su(t)]):[3,2];case 1:return[2,n.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Pn("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ou.apply(this,arguments)}var ku=[Ct({data:yn.union([yt(),yn.record(yt(),yt())])})];function Iu(e){return Nu.apply(this,arguments)}function Nu(){return Nu=V((function(e){return Q(this,(function(t){return[2,ui("checkTransaction",ku,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,_u(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Pn("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Nu.apply(this,arguments)}var Cu=[Ct({hide:bt().default(!1).optional()}).optional()];function Mu(e){return xu.apply(this,arguments)}function xu(){return xu=V((function(e){return Q(this,(function(t){return[2,ui("setAndroidBottomNavigationBar",Cu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xu.apply(this,arguments)}var Ru=[Ct({hide:bt().default(!1).optional()}).optional()];function ju(e){return Du.apply(this,arguments)}function Du(){return Du=V((function(e){return Q(this,(function(t){return[2,ui("setIOSBottomSafeArea",Ru,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Du.apply(this,arguments)}var Uu=[Ct({type:yn.enum(["normal","hidden","transparent"]).default("normal").optional(),color:yn.string().optional()}).optional()];function Bu(e){return Zu.apply(this,arguments)}function Zu(){return Zu=V((function(e){return Q(this,(function(t){return[2,ui("setStatusBar",Uu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zu.apply(this,arguments)}var Lu=[Ct({headerTextColor:yn.enum(["black","white"]).optional(),headerColor:yn.string().optional(),actionBar:Ct({hide:yn.boolean().optional(),title:yn.string().optional(),leftButton:yn.enum(["back","none"]).optional(),textAlign:yn.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:yn.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:yn.boolean().optional(),hideIOSSafeAreaBottom:yn.boolean().optional()})];function zu(e){return Wu.apply(this,arguments)}function Wu(){return Wu=V((function(e){return Q(this,(function(t){return[2,ui("configAppView",Lu,[e],function(){var e=V((function(e){var t,n,r,i,o,a,s;return Q(this,(function(u){switch(u.label){case 0:return En.isMp?lr.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,gi.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return lr.isUndefined(null===(n=e.actionBar)||void 0===n?void 0:n.title)||!(null===(r=e.actionBar)||void 0===r?void 0:r.title)?[3,4]:[4,gi.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,gi.configHeader({hideActionBar:null===(i=e.actionBar)||void 0===i?void 0:i.hide,statusBarType:e.statusBarType,headerTextColor:e.headerTextColor,headerColor:e.headerColor,textAlign:null===(o=e.actionBar)||void 0===o?void 0:o.textAlign})];case 5:u.sent(),u.label=6;case 6:return u.trys.push([6,11,,12]),"boolean"!=typeof e.hideAndroidBottomNavigationBar?[3,8]:[4,gi.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,gi.setIOSBottomSafeArea(e.hideIOSSafeAreaBottom)];case 9:u.sent(),u.label=10;case 10:return[3,12];case 11:return u.sent(),[3,12];case 12:return[2];case 13:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wu.apply(this,arguments)}var Gu=function(){var t=V((function(t,n,r,o,a,s){var u,c,l,p,d,f,h,m,v,y,g,_,w,b;return Q(this,(function(T){switch(T.label){case 0:d=i,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===Z&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===B&&(h=e.ProrationMode.DEFERRED),f.append("utm",a||"default"),f.append("merchantTransId",s||""),f.append("prorationMode",h.toString()),f.append("appId",d),o&&f.append("method",o),m="",(null===(u=Tn())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Tn())||void 0===l||null===(p=l.platform)||void 0===p?void 0:p.isAndroid)&&(m="android"),f.append("os",m),f.append("productId",t),v={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},T.label=1;case 1:return T.trys.push([1,5,,6]),[4,$r.getAccessToken().catch((function(){throw Kr.error.loginRequired}))];case 2:return y=T.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(D,Ko(On({method:"POST"},v),{body:f}))];case 3:return[4,T.sent().json()];case 4:if(!(g=T.sent()).data||!g.data.store||0!==g.err)throw Kr.error.createIAPOrderFailed(g.err);return _=g.data.store,w=g.data.orderId,[2,new Promise((function(e,t){Vr("IAP_REQUESTPAYMENT",On({},_),{success:function(){e({orderId:w})},fail:function(e){t(e)}})}))];case 5:throw b=T.sent(),console.log("Internal error"),b;case 6:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),Fu=[Ct({productId:yt(),payType:yn.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:yn.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:yt().optional(),method:yn.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:yt().optional()})];function Hu(e){return Ku.apply(this,arguments)}function Ku(){return Ku=V((function(e){return Q(this,(function(t){return[2,ui("createOrderIAP",Fu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Gu(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Pn("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ku.apply(this,arguments)}var Vu=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Ju(e){return qu.apply(this,arguments)}function qu(){return(qu=V((function(e){return Q(this,(function(t){return[2,ui("minimizeApp",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Vu()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var $u=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function Yu(e){return Qu.apply(this,arguments)}function Qu(){return(Qu=V((function(e){return Q(this,(function(t){return[2,ui("openPermissionSetting",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,$u()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Xu=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ec(e){return tc.apply(this,arguments)}function tc(){return(tc=V((function(e){return Q(this,(function(t){return[2,ui("favoriteApp",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Xu()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var nc=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function rc(e){return ic.apply(this,arguments)}function ic(){return(ic=V((function(e){return Q(this,(function(t){return[2,ui("openGroupList",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,nc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var oc=V((function(){var e;return Q(this,(function(t){switch(t.label){case 0:return[4,$r.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){Vr("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function ac(e){return sc.apply(this,arguments)}function sc(){return(sc=V((function(e){return Q(this,(function(t){return[2,ui("requestSendNotification",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,oc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var uc=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function cc(e){return lc.apply(this,arguments)}function lc(){return(lc=V((function(e){return Q(this,(function(t){return[2,ui("addRating",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,uc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Pn("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var pc,dc=(pc=V((function(e,t,n){var r,i;return Q(this,(function(o){switch(o.label){case 0:return(r=new URLSearchParams).append("appId",t),r.append("accessToken",n),r.append("oaId",e),i={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.CHECK_INTERACT_OA,On({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return pc.apply(this,arguments)}),fc=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("MP_INTERACT_OA",{oaId:e,forceUpdate:!0},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),hc=[Ct({oaId:yt()})];function mc(e){return vc.apply(this,arguments)}function vc(){return vc=V((function(e){return Q(this,(function(t){return[2,ui("interactOA",hc,[e],function(){var e=V((function(e){var t,n,r;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(t=e.oaId,[4,$r.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||lr.isEmpty(n)?[3,3]:[4,dc(t,i,n)];case 2:if(0===(null==(r=o.sent())?void 0:r.err))return[2,Promise.resolve({})];o.label=3;case 3:return[4,fc(t)];case 4:return[2,o.sent()];case 5:return En.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Pn("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vc.apply(this,arguments)}var yc=[Ct({oaId:yt()})];function gc(e){return _c.apply(this,arguments)}function _c(){return _c=V((function(e){return Q(this,(function(t){return[2,ui("isAllowedInteractWithOA",yc,[e],function(){var e=V((function(e){var t,n,r;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(t=e.oaId,[4,$r.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||lr.isEmpty(n)?[3,3]:[4,dc(t,i,n)];case 2:return r=o.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return En.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Pn("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_c.apply(this,arguments)}function wc(e){return bc.apply(this,arguments)}function bc(){return(bc=V((function(e){return Q(this,(function(t){return[2,ui("getSetting",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Fr()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Pn("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Tc=yn.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Ec=[Ct({scopes:yn.array(Tc).max(2).optional()}).optional()];function Sc(e){return Pc.apply(this,arguments)}function Pc(){return Pc=V((function(e){return Q(this,(function(t){return[2,ui("authorize",Ec,[e],function(){var e=V((function(e){var t,n,r,i;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(n=null==e?void 0:e.scopes,r=Ur(),("android"===(i=((null===(t=Tn())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject(Kr.error.clientNotSupport())]:[4,Jr(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Pn("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pc.apply(this,arguments)}var Ac=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n;return Q(this,(function(r){switch(r.label){case 0:return lr.isUndefined(ZaloJavaScriptInterface)||"function"!=typeof ZaloJavaScriptInterface.checkCameraPermission?[3,2]:[4,ZaloJavaScriptInterface.checkCameraPermission()];case 1:return n=r.sent(),[2,e({userAllow:"grant"===n})];case 2:return t(Kr.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Oc(e){return ui("checkZaloCameraPermission",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return[4,Ac()];case 1:return[2,e.sent()]}}))})))}var kc=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n,r,i;return Q(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,$r.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=$r.miniProgramConfig)||void 0===n?void 0:n.userId,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Ic(e){return Nc.apply(this,arguments)}function Nc(){return(Nc=V((function(e){return Q(this,(function(t){return[2,ui("getUserID",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,kc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Pn("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var Cc=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n,r,i;return Q(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,$r.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=$r.miniProgramConfig)||void 0===n?void 0:n.idToken,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Mc(e){return xc.apply(this,arguments)}function xc(){return(xc=V((function(e){return Q(this,(function(t){return[2,ui("getIDToken",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Cc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Pn("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Rc=function(){function e(){var t,n;pr(this,e),this.sdkLoaded=!1,this.queue=[];var r=window.AdtimaZMA={config:{cateId:null===(t=window.zmpGlobal)||void 0===t||null===(n=t.appInfo)||void 0===n?void 0:n.cateType,appId:window.APP_ID},queue:[],load:function(e,t){r.queue=Y(r.queue).concat([[e,t]])}}}var t=e.prototype;return t.loadSDK=function(){var e=this,t=document.createElement("script");t.src="https://adtima-static.zascdn.me/resource/js/zma/sdk.js?q=".concat(Math.floor((new Date).getTime()/864e5)),t.onload=function(){e.sdkLoaded=!0,e.processQueue()},t.onerror=function(){e.sdkLoaded=!0},document.body.appendChild(t)},t.load=function(e,t){var n;lr.isFunction(null===(n=window.AdtimaZMA)||void 0===n?void 0:n.load)&&window.AdtimaZMA.load(e,t)},t.display=function(e){var t;this.sdkLoaded?lr.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.display)&&window.AdtimaZMA.display(e):this.queue.push(this.display.bind(this,e))},t.refresh=function(e){var t;this.sdkLoaded?lr.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.refresh)&&window.AdtimaZMA.refresh(e):this.queue.push(this.refresh.bind(this,e))},t.processQueue=function(){for(;this.queue.length>0;){var e=this.queue.shift();e&&e()}},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}();function jc(e){return Dc.apply(this,arguments)}function Dc(){return(Dc=V((function(e){return Q(this,(function(t){return[2,ui("setupAd",[],[e],(function(){return Rc.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var Uc=[Ct({ids:yn.union([yn.string(),yn.array(yn.string())]),config:Ct({display:yn.boolean().optional(),onClose:yn.function().optional()}).optional()})];function Bc(e){return Zc.apply(this,arguments)}function Zc(){return Zc=V((function(e){return Q(this,(function(t){return[2,ui("loadAd",Uc,[e],function(){var e=V((function(e){return Q(this,(function(t){return Rc.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zc.apply(this,arguments)}var Lc=[Ct({id:yn.string()})];function zc(e){return Wc.apply(this,arguments)}function Wc(){return Wc=V((function(e){return Q(this,(function(t){return[2,ui("displayAd",Lc,[e],function(){var e=V((function(e){return Q(this,(function(t){return Rc.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wc.apply(this,arguments)}var Gc=[Ct({id:yn.string().optional()}).optional()];function Fc(e){return Hc.apply(this,arguments)}function Hc(){return Hc=V((function(e){return Q(this,(function(t){return[2,ui("refreshAd",Gc,[e],function(){var e=V((function(e){return Q(this,(function(t){return Rc.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hc.apply(this,arguments)}var Kc=[Ct({id:yt(),guidingText:yt().optional(),color:yt().optional(),onStatusChange:yn.function().optional()})];function Vc(e){return Jc.apply(this,arguments)}function Jc(){return Jc=V((function(e){return Q(this,(function(t){return[2,ui("showOAWidget",Kc,[e],function(){var e=V((function(e){var t,n,r,i,o;return Q(this,(function(a){if(En.isMp)try{t=document.getElementById(e.id),n=e.guidingText,r=e.onStatusChange,i=e.color,t&&((o=document.createElement("iframe")).id="iframeOAWidget",o.src="https://h5.zalo.me/widgets/oa_widget.html?guidingText=".concat(n,"&color=").concat(i),o.style.width="100%",o.style.height="100%",o.style.border="none",t.innerHTML=o.outerHTML,window.addEventListener("message",function(){var e=V((function(e){var t,n,i,o,a,s,u;return Q(this,(function(c){switch(c.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById("iframeOAWidget"),"followOA"!==(i=t.type)&&"getOAInfo"!==i?[3,2]:[4,$r.jumpAndGetToken()]):[3,3];case 1:return c.sent(),s=null===(o=$r.miniProgramConfig)||void 0===o?void 0:o.jwt,null==n||null===(a=n.contentWindow)||void 0===a||a.postMessage({type:i,payload:{jwt:s}},"*"),[3,3];case 2:"oaInfo"===i?null==r||r(null===(u=t.payload)||void 0===u?void 0:u.followed):"openOA"===i?Bo(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),c.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Jc.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:hi},ci();var qc=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},login:ci,getAccessToken:pi,getVersion:hi,getSystemInfo:vi,setNavigationBarTitle:wi,setNavigationBarColor:Ei,setNavigationBarLeftButton:Ai,setStorage:Qi,getStorage:to,getStorageInfo:ro,removeStorage:ao,clearStorage:co,getUserInfo:ho,getNetworkType:go,onNetworkStatusChange:bo,startBeaconDiscovery:So,stopBeaconDiscovery:Oo,getBeacons:No,closeApp:xo,scanQRCode:Do,openProfile:Lo,openChat:Fo,openPostFeed:qo,followOA:Xo,unfollowOA:ra,openShareSheet:ua,requestCameraPermission:pa,createShortcut:ya,openBioAuthentication:ba,checkStateBioAuthentication:Sa,showToast:ka,hideKeyboard:Ca,openPhone:ja,openSMS:Za,viewOAQr:Ga,keepScreen:Va,onKeepScreen:qa,offKeepScreen:Ya,saveImageToGallery:ts,openMiniApp:os,vibrate:cs,openWebview:fs,getRouteParams:vs,getAppInfo:ys,sendDataToPreviousMiniApp:bs,getPhoneNumber:Ss,openProfilePicker:ks,connectWifi:Ms,openMediaPicker:Ds,getShareableLink:Zs,closeLoading:Ws,requestUpdateZalo:Fs,onConfirmToExit:Js,offConfirmToExit:qs,getDeviceId:$s,getDeviceIdAsync:Ys,getContext:Xs,getContextAsync:eu,getAuthCode:nu,getZPIToken:iu,setAccessToken:su,openOutApp:cu,chooseImage:du,getLocation:mu,onCallbackData:gu,createOrder:Tu,selectPaymentMethod:Au,checkTransaction:Iu,events:Ks,setAndroidBottomNavigationBar:Mu,setIOSBottomSafeArea:ju,setStatusBar:Bu,configAppView:zu,createOrderIAP:Hu,minimizeApp:Ju,openPermissionSetting:Yu,favoriteApp:ec,openGroupList:rc,requestSendNotification:ac,addRating:cc,interactOA:mc,interactOa:mc,isAllowedInteractWithOA:gc,getSetting:wc,authorize:Sc,checkZaloCameraPermission:Oc,getUserID:Ic,getIDToken:Mc,setupAd:jc,loadAd:Bc,displayAd:zc,refreshAd:Fc,showOAWidget:Vc}),$c=Tu,Yc=Iu,Qc=Hu,Xc=Au,el=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(qc,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod"]),tl={createOrder:$c,checkTransaction:Yc,createOrderIAP:Qc,selectPaymentMethod:Xc};!function(){var e,t=null===(e=Tn())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,qc))}(),e.EventName=e.Events,e.Payment=tl,e.addRating=cc,e.authorize=Sc,e.checkStateBioAuthentication=Sa,e.checkTransaction=Iu,e.checkZaloCameraPermission=Oc,e.chooseImage=du,e.clearStorage=co,e.closeApp=xo,e.closeLoading=Ws,e.configAppView=zu,e.connectWifi=Ms,e.createOrder=Tu,e.createOrderIAP=Hu,e.createShortcut=ya,e.default=el,e.displayAd=zc,e.events=Ks,e.favoriteApp=ec,e.followOA=Xo,e.getAccessToken=pi,e.getAppInfo=ys,e.getAuthCode=nu,e.getBeacons=No,e.getContext=Xs,e.getContextAsync=eu,e.getDeviceId=$s,e.getDeviceIdAsync=Ys,e.getIDToken=Mc,e.getLocation=mu,e.getNetworkType=go,e.getPhoneNumber=Ss,e.getRouteParams=vs,e.getSetting=wc,e.getShareableLink=Zs,e.getStorage=to,e.getStorageInfo=ro,e.getSystemInfo=vi,e.getUserID=Ic,e.getUserInfo=ho,e.getVersion=hi,e.getZPIToken=iu,e.hideKeyboard=Ca,e.interactOA=mc,e.interactOa=mc,e.isAllowedInteractWithOA=gc,e.keepScreen=Va,e.loadAd=Bc,e.login=ci,e.minimizeApp=Ju,e.offConfirmToExit=qs,e.offKeepScreen=Ya,e.onCallbackData=gu,e.onConfirmToExit=Js,e.onKeepScreen=qa,e.onNetworkStatusChange=bo,e.openBioAuthentication=ba,e.openChat=Fo,e.openGroupList=rc,e.openMediaPicker=Ds,e.openMiniApp=os,e.openOutApp=cu,e.openPermissionSetting=Yu,e.openPhone=ja,e.openPostFeed=qo,e.openProfile=Lo,e.openProfilePicker=ks,e.openSMS=Za,e.openShareSheet=ua,e.openWebview=fs,e.refreshAd=Fc,e.removeStorage=ao,e.requestCameraPermission=pa,e.requestSendNotification=ac,e.requestUpdateZalo=Fs,e.saveImageToGallery=ts,e.scanQRCode=Do,e.selectPaymentMethod=Au,e.sendDataToPreviousMiniApp=bs,e.setAccessToken=su,e.setAndroidBottomNavigationBar=Mu,e.setIOSBottomSafeArea=ju,e.setNavigationBarColor=Ei,e.setNavigationBarLeftButton=Ai,e.setNavigationBarTitle=wi,e.setStatusBar=Bu,e.setStorage=Qi,e.setupAd=jc,e.showOAWidget=Vc,e.showToast=ka,e.startBeaconDiscovery=So,e.stopBeaconDiscovery=Oo,e.unfollowOA=ra,e.vibrate=cs,e.viewOAQr=Ga,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
24
|
+
***************************************************************************** */}((function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],p=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),p){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,a),!0}for(c=1,u=new Array(p-1);c<p;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var d,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),p){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,r);break;case 4:l[c].fn.call(l[c].context,t,r,i);break;default:if(!u)for(d=1,u=new Array(p-1);d<p;d++)u[d-1]=arguments[d];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==t||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})),Tr="ACTION_CALLBACK";var Er=function(t){gr(r,t);var n=wr(r);function r(){var e;return pr(this,r),(e=n.apply(this,arguments)).debug=ir("zmp:event-emitter"),e}var i=r.prototype;return i.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},i.on=function(t,n,i){var o=this;if(t===Tr||t===e.Events.PaymentCallback)return vr(hr(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return vr(hr(r.prototype),"on",this).call(this,t,(function(e,r){o.h5ConfirmHandleEvent(e,t,i),n(r)}),i)},i.once=function(e,t,n){var i=this;if(e===Tr)return vr(hr(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return vr(hr(r.prototype),"once",this).call(this,e,(function(r,o){i.h5ConfirmHandleEvent(r,e,n),t(o)}),n)},r.getInstance=function(){return r.instance||(r.instance=new r),r.instance},r}(br);function Sr(e){Er.getInstance().emit(Tr,e)}function Pr(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(void 0===r)return;if(null===r)return void t.push(n);t.push(encodeURIComponent(n)+"="+encodeURIComponent(r))}return t.join("&")}window.onNativeMessage=function(e,t){return function(n){Sr({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var o=ir("zmp:zalo_h5_event_handler");o("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=ei(r);o("stringToData",a);var s=function(t,n){try{if(t===e.Events.OpenApp){var r=n.url,o=new URL(r),a=o.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(a||"/").concat(o.search)}}return n}catch(e){return n}}(n,a);Er.getInstance().emit(n,t,s)}},window.zaloNative2JS={nativeCall:function(t,n,r){Er.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Ar={encode:Pr,decode:function(e,t){var n={};if(""===e)return n;for(var r=e.split("&"),i=0;i<r.length;i++){var o=r[i].split("=",2),a=decodeURIComponent(o[0]);if(t&&Object.prototype.hasOwnProperty.call(n,a))throw new URIError("Duplicate key: "+a);n[a]=2===o.length?decodeURIComponent(o[1]):null}return n},appendToUrl:function(e,t){return e+(-1!==e.indexOf("?")?"&":"?")+("string"==typeof t?t:Pr(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var n=e.split("=");n&&2==n.length&&(t[n[0]]=decodeURIComponent(n[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e||void 0===e?"undefined":rr(e)))return e;var t=Object.keys(e),n=[];return t.map((function(t){var r=e[t],i=[t,r="object"==(void 0===r||void 0===r?"undefined":rr(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Or={},kr=function(e,t,n){var r=t||"default";return function(){return(r in Or?Or[r](e,n):e).apply(this,arguments)}};kr.setWrapper=function(e){Or[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Ir={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Nr(e){try{return null===e?Ir:JSON.parse(e)}catch(e){return Ir}}var Cr,Mr={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Ar.encode(n);"post"!=t&&(e=Ar.appendToUrl(e,i),i="");var o=function(e,t){if(!self.XMLHttpRequest)return null;var n=new XMLHttpRequest,r=function(){};if(!("withCredentials"in n))return null;n.open(e,t,!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded");var i={send:function(e){n.send(e)}},o=kr((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=kr((function(){a=r,"onerror"in i&&i.onerror(n)}),"entry","XMLHttpRequest:error");return n.onload=function(){o()},n.onerror=function(){a()},n.onreadystatechange=function(){4==n.readyState&&(200==n.status?o():a())},i}(t,e);return!!o&&(o.onload=function(e){r(Nr(e.responseText))},o.onerror=function(e){e.responseText?r(Nr(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},xr=Mr,Rr=(Cr=V((function(e,t,n){var r,i,o,a;return Q(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},lr.isUndefined(n)||(r.currentVersion=n),i=Ar.appendToUrl(l.GET_APP_INFO,r),[4,fetch(i,{credentials:"include"})];case 1:return(o=s.sent()).ok?[4,o.json()]:[3,3];case 2:if((a=s.sent()).err<0||!a.data)throw new Error(a);return[2,{name:a.data.name,version:a.data.version,description:a.data.description,appUrl:a.data.appUrl,qrCodeUrl:a.data.qrCodeUrl,logoUrl:a.data.logoUrl,cateID:a.data.cateType}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return Cr.apply(this,arguments)});function jr(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));xr.execute(l.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:e}})}catch(e){}}var Dr=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Ur=function(){var e,t,n=Number((null===(e=Tn())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=Tn())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Br(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Zr,Lr,zr=function(){function e(t,n,r,i){pr(this,e),this.code=t,this.message=n,this.api=r,this.detail=i}var t=e.prototype;return t.toString=function(){return"api: ".concat(String(this.api),"; code: ").concat(this.code,"; message: ").concat(JSON.stringify(this.message))},t.toJSON=function(){return{code:this.code,message:this.message,api:this.api,detail:this.detail}},e}(),Wr=function(e,t){return Br(e,zr)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Br(e,Error)?new zr(f,e.message,t).toJSON():lr.isEmpty(null==e?void 0:e.message)||lr.isEmpty(null==e?void 0:e.code)?new zr(f,T,t,e).toJSON():new zr(e.code,e.message,t,e.detail).toJSON()}(e,t)},Gr=(Zr=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(l.GET_AUTH_SETTING,On({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Zr.apply(this,arguments)}),Fr=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n,r,i,o;return Q(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,$r.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=$r.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new zr(v,S,"getSetting")),[4,Gr(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new zr(i.err,i.msg,"getSetting")),[3,4];case 3:return o=a.sent(),t(o),[3,4];case 4:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))})),Hr=function(){var t,n,r,i=Tn(),o={},a=Er.getInstance(),s=[],u=!1;return u||(n=function(e){var t=e.serialId,n=ti(e.result),r=oi(null==n?void 0:n.action),i=lr.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,a=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===i){var c=JSON.parse(null==n?void 0:n.data);i=lr.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,a=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:i,error_message:a,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&o[t]){var p=o[t],d=p.callback,f=p.timeout,h=p.isMultiCallback,m=p.options;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?lr.isFunction(r)&&r(e):lr.isFunction(i)&&i(e)}(l,d),!h&&delete o[t],f&&clearTimeout(f);var v={action:null==l?void 0:l.action,error:null==l?void 0:l.error_code,message:null==l?void 0:l.error_message,data:{}};try{if("action.open.inapp"===l.action||"action.open.outapp"===l.action){var y=new URL(null==m?void 0:m.url),g="".concat(y.protocol,"//").concat(y.host).concat(y.pathname);v.data={url:g}}if("action.follow.oa"===l.action||"action.unfollow.oa"===l.action){var _=null==m?void 0:m.uid;v.data={uid:_}}if("action.open.chat"===l.action){var w=null==m?void 0:m.uId,b=null==m?void 0:m.type;v.data={uid:w,openChatType:b}}}catch(e){}s.push(v)}},Er.getInstance().on(Tr,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],jr(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],jr(e)}}),5e3),u=!0),r=V((function(e,t,n,r){var a,s,u,c,l,p,d,f,h,m,_,w,b,T,S,P,k,I,N,C,M,x;return Q(this,(function(R){switch(R.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c="action.".concat(e.replace(/\_/g,".").toLowerCase()),(null==r?void 0:r.actionName)&&r.actionName.length>0&&(c=null==r?void 0:r.actionName),l=(null==r?void 0:r.isMultiCallback)||!1,p=!1!==(null==r?void 0:r.timeout)&&((null==r?void 0:r.timeout)||!0),d=(null==r?void 0:r.haveCallback)||!1,f=(null==r?void 0:r.skipJump)||!1,h=(null==r?void 0:r.requireAccessToken)||!1,m=ai(c),t&&n&&(o[u]={options:t,callback:n,isMultiCallback:l},p&&d&&(o[u].timeout=setTimeout((function(){return Sr({serialId:u,result:{error_code:g,error_message:E,data:{timeout:p},action:e}}),null}),!0===p?8e3:1e3*p))),m?[4,Fr()]:[3,2];case 1:if(!1===(null==(w=R.sent())||null===(_=w.authSetting)||void 0===_?void 0:_["scope.userInfo"]))return Sr({serialId:u,result:{error_code:v,error_message:O,data:{isMobile:null==i||null===(b=i.platform)||void 0===b?void 0:b.isMobile},action:e}}),[2];R.label=2;case 2:return T=oi(c),!(null==i||null===(a=i.platform)||void 0===a?void 0:a.isMobile)||!e||lr.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!Xr(e)||T&&!1===T.isSupported?(Sr({serialId:u,result:{error_code:y,error_message:A,data:{isMobile:null==i||null===(S=i.platform)||void 0===S?void 0:S.isMobile},action:e}}),[2]):(P=Qr(t),f?[3,4]:[4,$r.getJSAccessToken()]);case 3:return I=R.sent(),[3,5];case 4:I="",R.label=5;case 5:k=I,R.label=6;case 6:return R.trys.push([6,10,,11]),f||!h?[3,8]:[4,$r.getAccessToken()];case 7:return C=R.sent(),[3,9];case 8:C="",R.label=9;case 9:return N=C,[3,11];case 10:return M=R.sent(),Sr({serialId:u,result:{error_code:null==M?void 0:M.code,error_message:null==M?void 0:M.message,action:e}}),[2];case 11:return x=i.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(k,c,N,P,x)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),Kr={success:function(e,t){return{code:d,message:t||b,data:e||{}}},error:{badRequest:function(e){return new zr(h,e)},loginFailed:function(e){return new zr(v,"".concat(P,": ").concat(e))},loginRequired:function(){return new zr(v,S)},cannotGetShareInfo:function(){return new zr(m,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(H).find((function(t){return t===e.toString()}));return new zr(e,t||T)},clientNotSupport:function(){return new zr(y,A)}}},Vr=(Lr=function(t){var n,r,i,o=null===(n=Tn())||void 0===n?void 0:n.platformName,a=t.action.replace("action.","").replace(/\./g,"_").toUpperCase(),s=C[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new zr(f,"Can not get auth code: ".concat(t.error_message));if($r.jumpStatus!==e.JumpStatus.DONE&&!u)return new zr(N.UNAUTHORIZED.code,N.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new zr(N.FORBIDDEN.code,N.FORBIDDEN.message);if(o&&(null===(r=M[o])||void 0===r?void 0:r[t.error_code]))return new zr(M[o][t.error_code].code,M[o][t.error_code].message);var l=null==c||null===(i=c[o])||void 0===i?void 0:i[String(t.error_code)];if(l){var p,d,h,m=null===(p=l.mapTo)||void 0===p?void 0:p.message;return(null==l?void 0:l.needMoreDetail)&&(m="".concat(null==l||null===(h=l.mapTo)||void 0===h?void 0:h.message,": ").concat(t.error_message)),new zr(null===(d=l.mapTo)||void 0===d?void 0:d.code,m)}return new zr(t.error_code,t.error_message)},function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=lr.isEmpty(n)?void 0:n[r];if(o)return Sn({stage:t.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Lr(i):null==i?void 0:i.data)}}return lr.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=C[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){Hr(e,n,o,On({},i,a))}),s)}),Jr=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){lr.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),qr=function(){function n(){pr(this,n),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={}}var o,s,u,p=n.prototype;return p.jump=function(){var n=this;return V((function(){return Q(this,(function(r){return[2,new Promise((function(r,i){n._jumpStatus?n._jumpStatus===e.JumpStatus.DONE?r(e.JumpStatus.DONE):r(e.JumpStatus.DOING):(n._jumpStatus=e.JumpStatus.DOING,Sn({stage:t.REQUEST,type:"log",name:"jump"}),Hr("JUMP_LOGIN",{},{success:function(t){var i=t.data;n._miniProgramConfig=(null==i?void 0:i.miniProgramConfig)||{};var o=(null==i?void 0:i.cookiesOAuthLogins)||[],a=o.find((function(e){return e.name===c.JS_TOKEN}));a&&(n._jsAccessToken=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),n._cookies=o;var s=n._cookies.find((function(e){return e.name===c.ZOAUTH}));(null==s?void 0:s.value)||jr([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){jr([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),i(e)}},{skipJump:!0}))}))]}))}))()},p.loginZaloV3=function(e,t,n){var r=this;return V((function(){var i;return Q(this,(function(o){switch(o.label){case 0:return i="".concat(l.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(a,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=V((function(e){var t,n,i;return Q(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return t=o.sent(),n=null==t?void 0:t.access_token,r._accessToken=n,i=1e3*parseInt(t.expires_in),r.accessTokenExpiresIn=i,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(r._accessToken||""),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,o.sent()]}}))}))()},p.loginZaloV4=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this;return V((function(){var i,o;return Q(this,(function(a){switch(a.label){case 0:return(i=new URLSearchParams).append("app_id",e),i.append("code",t),i.append("code_verifier",n),lr.isNull(r.refreshToken)||0===r.refreshToken.length?i.append("grant_type","authorization_code"):(i.append("grant_type","refresh_token"),i.append("refresh_token",r.refreshToken||"")),o={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.GET_ACCESS_TOKEN,On({method:"POST",body:i},o)).then(function(){var e=V((function(e){var t,n,i,o;return Q(this,(function(a){switch(a.label){case 0:return[4,e.json()];case 1:return t=a.sent(),n=(null==t?void 0:t.access_token)||"",i=(null==t?void 0:t.refresh_token)||"",r.refreshToken=i,r._accessToken=n,o=1e3*parseInt(null==t?void 0:t.expires_in),r.accessTokenExpiresIn=o,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,a.sent()]}}))}))()},p.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return V((function(){var n,o,a,s,u,l,p,d,f;function h(){return m.apply(this,arguments)}function m(){return(m=V((function(){return Q(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(a.getAccessTokenCount<=1||a._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Q(this,(function(m){switch(m.label){case 0:return o=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(a=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken||t._accessToken.length>0&&o<t.accessTokenExpiresIn&&(null===(n=t._miniProgramConfig)||void 0===n?void 0:n.userAuthorized)?(a.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(c.ZOAUTH)]);case 3:return s=m.sent(),[4,t.jumpAndGetToken(c.ZOAUTH_VRF)];case 4:return u=m.sent(),l="zmp.getaccesstoken.fail",e?[4,t.verifyUserAuthorized()]:[3,6];case 5:return p=m.sent(),[3,7];case 6:p=!0,m.label=7;case 7:if(!p)throw a.getAccessTokenCount--,jr([{action:l,error:-104,message:"no user auth",data:{}}]),Kr.error.loginFailed("User Authentication Required");if(!s)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),u?[4,t.loginZaloV4(i,s,u)]:[3,10];case 9:return d=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(i,r,s)];case 11:d=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),d="",console.log("Can not get access token",f),jr([{action:l,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return a.getAccessTokenCount--,d||jr([{action:l,error:-101,message:"no accessToken",data:{}}]),[2,Promise.resolve(t._accessToken)];case 15:throw a.getAccessTokenCount--,jr([{action:l,error:-102,message:"no oauth",data:{}}]),Kr.error.loginFailed("Zalo app has not been activated")}}))}))()},p.verifyUserAuthorized=function(){var e=this;return V((function(){var t,n,r,i,o,a;return Q(this,(function(s){switch(s.label){case 0:if(n=!0,!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,6];s.label=1;case 1:return s.trys.push([1,5,,6]),(r=oi("action.mp.user.authorize"))&&r.isSupported?[4,Fr()]:[3,4];case 2:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,4]:[4,Jr()];case 3:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=4;case 4:return[3,6];case 5:return s.sent(),n=!1,[3,6];case 6:return[2,n]}}))}))()},p.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},p.getJSAccessToken=function(){var e=this;return V((function(){var t;return Q(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(c.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},p.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},p.jumpAndGetToken=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;return new Promise(function(){var i=V((function(i){var o,a,s,u;return Q(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?lr.isString(t)?(o=r._cookies.find((function(e){return e.name===t})),[2,i(null==o?void 0:o.value)]):[2,i("")]:(n&&r._jumpStatus===e.JumpStatus.DONE&&(r._jumpStatus=void 0),a={name:t,cb:function(e){return i(e)}},[4,r.jump()]);case 1:return(s=c.sent())===e.JumpStatus.DONE?(r._jumpStatus=s,r.WAITING_QUEUE.length&&(r.WAITING_QUEUE.forEach((function(e){var t=r._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),r.WAITING_QUEUE=[]),u=r._cookies.find((function(e){return e.name===a.name})),a.cb(null==u?void 0:u.value)):r.WAITING_QUEUE.push(a),[2]}}))}));return function(e){return i.apply(this,arguments)}}())},n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},o=n,(s=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&dr(o.prototype,s),u&&dr(o,u),n}(),$r=qr.getInstance(),Yr=ir("zmp:utils:common"),Qr=function(e){if(lr.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=[];for(var n=e.length,r=0;r<n;r++)t.push(Qr(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+Qr(e[i]));return"{"+t.join(",")+"}"}return e.toString()},Xr=function(e){var t,n,r=C[e],i=(null===(t=Tn())||void 0===t?void 0:t.zaloVersion)||0,o="versionLive"in r&&(null==r||null===(n=r.versionLive)||void 0===n?void 0:n.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||Number(i)>=o},ei=function(e){try{if(e){Yr(e);var t=e.replace(/\\/g,"").replace(/'/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return Yr("formattedValue",t,JSON.parse(t),rr(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return Yr("parse json error:",t),e}},ti=function(e){if(lr.isObject(JSON)&&JSON.parse&&lr.isString(e)){var t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\x00/g,"");return JSON.parse(t,(function(e,t){return t}))}return lr.isObject(e)?e:new Function("return "+e)()},ni=function(e){for(var t=document.getElementsByTagName("meta"),n=0;n<t.length;n++)if(t[n].getAttribute("name")===e||t[n].getAttribute("property")===e)return t[n].getAttribute("content");return""},ri=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var ii=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},oi=function(e){if(void 0!==e){var t=$r.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},ai=function(e){if(void 0===e)return!1;var t=$r.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},si=function(){var e=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n;return Q(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,$r.jumpAndGetToken()];case 1:return t.sent(),n=$r.miniProgramConfig,e(!0===(null==n?void 0:n.canUseAccessTokenByDefault)),[3,3];case 2:return t.sent(),e(!1),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));return function(){return e.apply(this,arguments)}}();function ui(e,t,n,r){var i,o,a=Array.isArray(n)&&n.length>0&&(null===(i=n[0])||void 0===i?void 0:i.success),s=Array.isArray(n)&&n.length>0&&(null===(o=n[0])||void 0===o?void 0:o.fail);try{var u=n;t.length>0&&t.forEach((function(t,r){var i=t.safeParse(n[r]);if(!i.success){var o,a=null===(o=i.error)||void 0===o?void 0:o.issues,s=a.map((function(e,t){var n=e.path.length>0?e.path.map((function(e,t){return t>0?"[".concat(e,"]"):e})).join(""):"arg";return"Error ".concat(t+1,": Code: ").concat(e.code," ~ Path: ").concat(n," ~ Message: ").concat(e.message)})).join(" | "),c=Kr.error.badRequest(s);throw c.detail=a,Wr(c,e)}u.push(i.data)}));var c=r.apply(void 0,Y(u));return lr.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!lr.isNull(a)&&lr.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Wr(t,e);if(!lr.isNull(s)&&lr.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!lr.isNull(s)&&lr.isFunction(s))return s(t);throw Wr(t,e)}}function ci(e){return li.apply(this,arguments)}function li(){return(li=V((function(e){return Q(this,(function(t){return[2,ui("login",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return En.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Pn("login",{}))]}}))})))]}))}))).apply(this,arguments)}function pi(e){return di.apply(this,arguments)}function di(){return(di=V((function(e){return Q(this,(function(t){return[2,ui("getAccessToken",[],[e],V((function(){var e;return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,si()]:[3,3];case 1:return e=!t.sent(),[4,$r.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return En.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Pn("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var fi="2.38.1";function hi(){return ui("getVersion",[],[],(function(){return fi}))}function mi(){var e,t;return{version:ni("version-id")||"",apiVersion:fi,zaloVersion:(null===(e=Tn())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=Tn())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function vi(){return ui("getSystemInfo",[],[],(function(){return mi()}))}var yi=function(){function t(){var e,n,r,o,s,u,c,l,p,d,f,h,m,v,y,g,_,w,b,T,E,S,P,A,O,k,I;pr(this,t),this.initConfig=window.APP_CONFIG;var N=lr.isString(null===(e=this.initConfig)||void 0===e||null===(n=e.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(o=r.app)||void 0===o||null===(s=o.headerColor)||void 0===s?void 0:s.length)>0?z:W;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(p=l.app)||void 0===p?void 0:p.hideAndroidBottomNavigationBar);var C,M,x="none"===(null===(d=this.initConfig)||void 0===d||null===(f=d.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?L.HIDE_BACK:L.SHOW_BACK,R="home"===(null===(v=this.initConfig)||void 0===v||null===(y=v.app)||void 0===y?void 0:y.leftButton)||"both"===(null===(g=this.initConfig)||void 0===g||null===(_=g.app)||void 0===_?void 0:_.leftButton)?L.SHOW_HOME:L.HIDE_HOME,j=new URL(location.href),D=ii(null===(w=this.initConfig)||void 0===w||null===(b=w.app)||void 0===b?void 0:b.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.app)||void 0===E?void 0:E.actionBarHidden)&&(N=(null===(C=this.initConfig)||void 0===C||null===(M=C.app)||void 0===M?void 0:M.actionBarHidden)?W:z);this.config={actionbarType:N,buttonType:x,statusbarType:D,dataConfig:{backgroundColor:(null===(S=this.initConfig)||void 0===S||null===(P=S.app)||void 0===P?void 0:P.headerColor)||G,textColor:(null===(A=this.initConfig)||void 0===A||null===(O=A.app)||void 0===O?void 0:O.textColor)||"",textAlign:(null===(k=this.initConfig)||void 0===k||null===(I=k.app)||void 0===I?void 0:I.textAlign)||F,viewInLeftType:x,confirmToExit:1},homeConfig:{enable:R,url:"".concat(a,"/").concat(i,"/").concat(j.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},n.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return V((function(){var r,i;return Q(this,(function(o){return void 0===(void 0===e?"undefined":rr(e))&&null===(void 0===e?"undefined":rr(e))||(r="none"===e||"home"===e?L.HIDE_BACK:L.SHOW_BACK,i="home"===e||"both"===e?L.SHOW_HOME:L.HIDE_HOME,n.config.buttonType=r,n.config.dataConfig.viewInLeftType=r,n.config.homeConfig.enable=i),n.config.dataConfig.confirmToExit=t,[2,new Promise((function(e,t){Vr("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",On({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},n.setAndroidBottomNavigationBar=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return V((function(){var r,i,o;return Q(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Tn())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();Vr("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideAndroidBottomNavigationBar=!!t,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1})}))]}))}))()},n.setIOSBottomSafeArea=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return V((function(){var r,i,o;return Q(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Tn())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();Vr("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideIOSSafeAreaBottom=!!t,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1,delay:200})}))]}))}))()},n.configHeader=function(t){var n=this;return V((function(){var r;return Q(this,(function(i){return r=n.config,lr.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),lr.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),lr.isString(t.textAlign)&&("left"===t.textAlign?r.dataConfig.textAlign=e.TextAlignType.left:"center"===t.textAlign&&(r.dataConfig.textAlign=e.TextAlignType.center)),!0===t.hideActionBar?r.actionbarType=W:!1===t.hideActionBar&&(r.actionbarType=z),"normal"===t.statusBarType?r.statusbarType=e.StatusBarType.normal:"hidden"===t.statusBarType?r.statusbarType=e.StatusBarType.hidden:"transparent"===t.statusBarType&&(r.statusbarType=e.StatusBarType.transparent),[2,new Promise((function(i,o){Vr("CHANGE_ACTIONBAR",On({},r),{success:function(){var o;n.config=On({},r);var a,s=null===(o=Tn())||void 0===o?void 0:o.platform;window.STATUS_BAR_TYPE=(a=n.config.statusbarType)===e.StatusBarType.hidden?"hidden":a===e.StatusBarType.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=n.config.actionbarType===W;var u=null===document||void 0===document?void 0:document.querySelector(":root");if(null==s?void 0:s.isAndroid){var c=0;if(("hidden"===t.statusBarType||"transparent"===t.statusBarType)&&t.hideActionBar){var l=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(l)&&(l=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),c=l}c?null==u||u.style.setProperty("--zaui-safe-area-inset-top","".concat(c,"px")):null==u||u.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}i()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t}(),gi=yi.getInstance(),_i=[Ct({title:yt()}).optional()];function wi(e){return bi.apply(this,arguments)}function bi(){return bi=V((function(e){return Q(this,(function(t){return[2,ui("setNavigationBarTitle",_i,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bi.apply(this,arguments)}var Ti=[Ct({color:yt(),textColor:yn.enum(["black","white"]).optional(),statusBarColor:yt().optional()}).optional()];function Ei(e){return Si.apply(this,arguments)}function Si(){return Si=V((function(e){return Q(this,(function(t){return[2,ui("setNavigationBarColor",Ti,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.configHeader({hideActionBar:!(e.color.length>0),headerTextColor:e.textColor,headerColor:e.color.length>0?e.color:e.statusBarColor})]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Si.apply(this,arguments)}var Pi=[Ct({type:yn.enum(["none","back","home","both"])}).optional()];function Ai(e){return Oi.apply(this,arguments)}function Oi(){return Oi=V((function(e){return Q(this,(function(t){return[2,ui("setNavigationBarLeftButton",Pi,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oi.apply(this,arguments)}function ki(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Ii(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,ki(e,t,"get"))}function Ni(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function Ci(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,ki(e,t,"set"),n),n}var Mi,xi,Ri,ji=new WeakMap,Di=new WeakMap,Ui=new WeakMap,Bi=function(){function e(t){pr(this,e),Ni(this,ji,{writable:!0,value:localStorage}),Ni(this,Di,{writable:!0,value:void 0}),Ni(this,Ui,{writable:!0,value:void 0}),Ci(this,Ui,{keys:new Set,currentSize:0,limitSize:R}),Ci(this,Di,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in Ii(this,ji)){if(e)if(t.split("_")[0]!==e)continue;Ii(this,Ui).keys.add(t)}}catch(e){}},t.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},t.getSync=function(e){return Ii(this,Di)&&(e="".concat(Ii(this,Di),"_").concat(e)),Ii(this,Ui).keys.has(e)?Ii(this,ji).getItem(e):null},t.set=function(e){var t=this;return V((function(){return Q(this,(function(n){return Object.entries(e).forEach((function(e){var n=kn(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){Ii(this,Di)&&(e="".concat(Ii(this,Di),"_").concat(e)),Ii(this,ji).setItem(e,t),Ii(this,Ui).keys.add(e)},t.getInfo=function(){var e=this;return V((function(){return Q(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},t.getInfoSync=function(){var e=function(e,t){var n,r=0;for(n in e){var i=n.split("_")[0];e.hasOwnProperty(n)&&(t&&i!==t||(r+=2*(e[n].length+n.length)))}return r}(Ii(this,ji),Ii(this,Di));return{currentSize:lr.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((R/1024).toFixed(2))}},t.remove=function(e){var t=this;return V((function(){return Q(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){Ii(this,Di)&&(e="".concat(Ii(this,Di),"_").concat(e)),Ii(this,Ui).keys.has(e)&&(Ii(this,ji).removeItem(e),Ii(this,Ui).keys.delete(e))},t.clear=function(){var e=this;return V((function(){return Q(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;Ii(this,Ui).keys.forEach((function(t){Ii(e,Di)&&t.indexOf(Ii(e,Di))<0||(Ii(e,ji).removeItem(t),Ii(e,Ui).keys.delete(t))}))},e}(),Zi=new WeakMap,Li=new WeakMap,zi=function(){function e(t){pr(this,e),Ni(this,Zi,{writable:!0,value:void 0}),Ni(this,Li,{writable:!0,value:void 0}),Ci(this,Li,{keys:new Set,currentSize:0,limitSize:R}),Ci(this,Zi,t)}var t=e.prototype;return t.get=function(e){var t=this;return V((function(){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Ii(t,Zi)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.set=function(e){var t=this;return V((function(){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Ii(t,Zi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.getInfo=function(){var e=this;return V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Ii(e,Zi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:lr.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(R/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return V((function(){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Ii(t,Zi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.clear=function(){var e=this;return V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Ii(e,Zi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),Wi=function(){function e(){pr(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return V((function(){var n,r;return Q(this,(function(i){switch(i.label){case 0:return[4,t.getInstance().get(e)];case 1:return n=i.sent(),r={},n.forEach((function(e,t){r[t]=ei(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return V((function(){var n,r;return Q(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=kn(e,2),n=t[0],i=t[1];lr.isUndefined(i)||lr.isNull(i)||(r[n]=ri(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return V((function(){return Q(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.clearStorage=function(){var e=this;return V((function(){return Q(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clear()];case 1:return t.sent(),[2]}}))}))()},t.getStorageInfo=function(){var e=this;return V((function(){return Q(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),Gi=new WeakMap,Fi=function(e){gr(n,e);var t=wr(n);function n(e){var r;return pr(this,n),Ni(_r(r=t.call(this)),Gi,{writable:!0,value:void 0}),Ci(_r(r),Gi,e),r}return n.prototype.getInstance=function(){return new Bi(Ii(this,Gi))},n}(Wi),Hi=new WeakMap,Ki=function(e){gr(n,e);var t=wr(n);function n(e){var r;return pr(this,n),Ni(_r(r=t.call(this)),Hi,{writable:!0,value:void 0}),Ci(_r(r),Hi,e),r}return n.prototype.getInstance=function(){return new zi(Ii(this,Hi))},n}(Wi),Vi=new Fi(i),Ji=(null===(Mi=Tn())||void 0===Mi?void 0:Mi.zaloVersion)||"",qi=(null===(xi=Tn())||void 0===xi?void 0:xi.platformName)||"unknown";!!lr.isString(Ji)&&parseInt(Ji,10)>={android:12100571,iOS:400,wp:0,unknown:0}[qi]&&(null===(Ri=Tn())||void 0===Ri?void 0:Ri.appEnv.isMp)&&(Vi=new Ki(i));var $i=Vi,Yi=[Ct({data:yn.record(yt(),yn.any())}).optional()];function Qi(e){return Xi.apply(this,arguments)}function Xi(){return Xi=V((function(e){return Q(this,(function(t){return[2,ui("setStorage",Yi,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp||En.isMpWeb?[4,$i.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Pn("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xi.apply(this,arguments)}var eo=[Ct({keys:yn.array(yt())}).optional()];function to(e){return no.apply(this,arguments)}function no(){return no=V((function(e){return Q(this,(function(t){return[2,ui("getStorage",eo,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp||En.isMpWeb?[4,$i.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Pn("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),no.apply(this,arguments)}function ro(e){return io.apply(this,arguments)}function io(){return(io=V((function(e){return Q(this,(function(t){return[2,ui("getStorageInfo",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp||En.isMpWeb?[4,$i.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Pn("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var oo=[Ct({keys:yn.array(yt())}).optional()];function ao(e){return so.apply(this,arguments)}function so(){return so=V((function(e){return Q(this,(function(t){return[2,ui("removeStorage",oo,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp||En.isMpWeb?[4,$i.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Pn("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),so.apply(this,arguments)}var uo=[Ct({prefix:yt().optional()}).optional()];function co(e){return lo.apply(this,arguments)}function lo(){return(lo=V((function(e){return Q(this,(function(t){return[2,ui("clearStorage",uo,[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp||En.isMpWeb?[4,$i.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Pn("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var po=function(){var e=V((function(e){var t,n,r;return Q(this,(function(o){switch(o.label){case 0:return[4,si()];case 1:return t=!o.sent(),[4,$r.getAccessToken(t)];case 2:return n=o.sent(),r="id,name,user_id_by_oa,is_sensitive",r=e?"".concat(r,",picture.type(").concat(e,")"):"".concat(r,",picture"),[4,fetch("".concat(l.GET_USER_INFO,"?fields=").concat(r,"&miniapp_id=").concat(i),{headers:{access_token:n||""}}).then(function(){var e=V((function(e){var t,n,r,i;return Q(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return r=o.sent(),i=null==r?void 0:r.user_id_by_oa,[2,{id:null==r?void 0:r.id,name:(null==r?void 0:r.name)||"",avatar:(null==r||null===(t=r.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url)||"",idByOA:i,followedOA:!!i,isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 3:return[2,o.sent()]}}))}));return function(t){return e.apply(this,arguments)}}(),fo=[Ct({avatarType:yn.enum(["small","normal","large"]).optional()}).optional()];function ho(e){return mo.apply(this,arguments)}function mo(){return mo=V((function(e){return Q(this,(function(t){return[2,ui("getUserInfo",fo,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=null==e?void 0:e.avatarType,[4,po(t)]):[3,2];case 1:return[2,{userInfo:n.sent()}];case 2:return En.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Pn("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),mo.apply(this,arguments)}var vo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},yo=V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Tn())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case vo(s).NONE:o=e.NetworkType.none;break;case vo(s).WIFI:o=e.NetworkType.wifi;break;case vo(s)["2G"]:case vo(s)["3G"]:case vo(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function go(e){return _o.apply(this,arguments)}function _o(){return(_o=V((function(t){return Q(this,(function(n){return[2,ui("getNetworkType",[],[t],V((function(){var t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?[4,yo()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(En.isMpWeb){switch(t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t.effectiveType){case"none":n=e.NetworkType.none;break;case"4g":n=e.NetworkType.wifi;break;case"3g":case"2g":n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return[2,Promise.resolve({networkType:n})]}return[2,Promise.reject(Pn("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var wo=[yn.function().args(Ct({isConnected:yn.boolean(),networkType:yn.enum(["none","wifi","cellular","unknown"])})).returns(yn.void())];function bo(t){return ui("onNetworkStatusChange",wo,[t],(function(t){var n=t;if(En.isMp)!function(t){Er.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;yo().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(En.isMpWeb){var r=navigator.connection||navigator.mozConnection||navigator.webkitConnection,i=r.effectiveType;r.addEventListener("change",(function(){var t;switch(i){case"none":t=e.NetworkType.none;break;case"4g":t=e.NetworkType.wifi;break;case"3g":case"2g":t=e.NetworkType.cellular;break;default:t=e.NetworkType.unknown}n({isConnected:!0,networkType:t})}))}}))}var To=function(){var e=V((function(e){var t,n,r,i,o,a;return Q(this,(function(s){return a={subaction:0,scanning_type:lr.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:lr.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:lr.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:lr.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:lr.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:lr.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:lr.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:lr.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:lr.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:lr.isNumber(null==e||null===(o=e.scanConfig)||void 0===o?void 0:o.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}},[2,new Promise((function(e,t){Vr("SCAN_IBEACON",On({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Eo=[Ct({scanningType:yn.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:yn.number().optional(),monitorInterval:yn.number().optional(),domain:yn.string().optional(),scanConfig:Ct({scanTime:yn.number().optional(),timeBetweenScan:yn.number().optional(),beaconTimeout:yn.number().optional(),delayCheckConnectedTimeout:yn.number().optional(),beaconConnectedTimeout:yn.number().optional()}).optional(),items:yn.array(Ct({id:yn.string().optional(),distance:yn.number().optional(),monitor:Ct({enable:yn.boolean().optional(),movingRange:yn.number().optional()}).optional()})).optional(),scanFromSource:yn.string().optional()}).optional()];function So(e){return Po.apply(this,arguments)}function Po(){return(Po=V((function(e){return Q(this,(function(t){return[2,ui("startBeaconDiscovery",Eo,[e],V((function(){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,To(e)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Pn("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Ao=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Oo(e){return ko.apply(this,arguments)}function ko(){return(ko=V((function(e){return Q(this,(function(t){return[2,ui("stopBeaconDiscovery",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ao()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Pn("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Io=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("SCAN_IBEACON",{subaction:1},{success:function(t){var n={beacons:[]};Array.isArray(t)&&t.forEach((function(e){var t={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};n.beacons.push(t)})),e(n)},fail:function(e){t(e)}},{isMultiCallback:!0})}))]}))}));function No(e){return Co.apply(this,arguments)}function Co(){return(Co=V((function(e){return Q(this,(function(t){return[2,ui("getBeacons",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Io()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Pn("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Mo=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function xo(e){return Ro.apply(this,arguments)}function Ro(){return(Ro=V((function(e){return Q(this,(function(t){return[2,ui("closeApp",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Mo()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var jo=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Do(e){return Uo.apply(this,arguments)}function Uo(){return(Uo=V((function(e){return Q(this,(function(t){return[2,ui("scanQRCode",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,jo()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Pn("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Bo=function(){var t=V((function(t,n,i,o){return Q(this,(function(a){return[2,new Promise((function(a,s){Vr("OPEN_PROFILE",{uId:t,type:e.ProfileType[n],zapp:r,sourceId:i,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(e,n,r,i){return t.apply(this,arguments)}}(),Zo=[Ct({id:yt(),type:yn.enum(["user","oa","aliasOA"]),sourceId:yn.any().optional(),sourceIndex:yn.any().optional()}).optional()];function Lo(e){return zo.apply(this,arguments)}function zo(){return zo=V((function(e){return Q(this,(function(t){return[2,ui("openProfile",Zo,[e],function(){var e=V((function(e){var t,n,r,i;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Bo(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zo.apply(this,arguments)}var Wo=function(){var t=V((function(t,n){var i,o,a,s=arguments;return Q(this,(function(u){return i=s.length>2&&void 0!==s[2]?s[2]:"",o=s.length>3?s[3]:void 0,a=s.length>4?s[4]:void 0,[2,new Promise((function(s,u){Vr("OPEN_CHAT",{uId:t,type:e.ChatType[n],msg:i,zapp:r,sourceId:o,sourceIndex:a},{success:function(){s()},fail:function(e){u(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Go=[Ct({id:yt(),type:yn.enum(["user","oa"]),sourceId:yn.any().optional(),sourceIndex:yn.any().optional(),message:yt().optional()}).optional()];function Fo(e){return Ho.apply(this,arguments)}function Ho(){return Ho=V((function(e){return Q(this,(function(t){return[2,ui("openChat",Go,[e],function(){var e=V((function(e){var t,n,r,i,o;return Q(this,(function(a){switch(a.label){case 0:return En.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,Wo(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ho.apply(this,arguments)}function Ko(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var Vo=function(){var t=V((function(t,n){var i;return Q(this,(function(o){switch(i={},t){case"image":i={photoUrl:null==n?void 0:n.imageUrl};break;case"link":i={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":i={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(n,o){Vr("OPEN_POSTFEED",Ko(On({type:e.PostFeedType[t]},i),{zapp:r}),{success:function(e){n({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){o(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Jo=[yn.union([Ct({type:yn.enum(["image"]),data:Ct({imageUrl:yt().url().optional()})}),Ct({type:yn.enum(["link"]),data:Ct({link:yt().url(),title:yt().max(100).optional(),thumb:yt().url().optional(),description:yt().max(400).default("").optional()})}),Ct({type:yn.enum(["profile"]),data:Ct({id:yt().optional()})})])];function qo(e){return $o.apply(this,arguments)}function $o(){return $o=V((function(e){return Q(this,(function(t){return[2,ui("openPostFeed",Jo,[e],function(){var e=V((function(e){var t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?(t=e.type,n=e.data,[4,Vo(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Pn("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$o.apply(this,arguments)}var Yo=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:r},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Qo=[Ct({id:yt(),showDialogConfirm:yn.boolean().optional()}).optional()];function Xo(e){return ea.apply(this,arguments)}function ea(){return ea=V((function(e){return Q(this,(function(t){return[2,ui("followOA",Qo,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=e.id,[4,Yo(t)]):[3,2];case 1:return[2,n.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ea.apply(this,arguments)}var ta=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),na=[Ct({id:yt()}).optional()];function ra(e){return ia.apply(this,arguments)}function ia(){return ia=V((function(e){return Q(this,(function(t){return[2,ui("unfollowOA",na,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=e.id,[4,ta(t)]):[3,2];case 1:return[2,n.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ia.apply(this,arguments)}var oa=function(){var e=V((function(e,t,n,r,i,a){var s,c,p,d,f,h;return Q(this,(function(m){switch(m.label){case 0:return s=new URL(location.href),c=new URLSearchParams,p="".concat(s.pathname.replace(u,"")).concat(s.search),a&&(p="/".concat(e).concat("/"===a[0]?"":"/").concat(a)),d=new URL("".concat(o).concat(p)),c.append("title",n),c.append("description",r||""),c.append("thumbnail",i||""),c.append("url",d.href),c.append("accessToken",t||""),f={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.CREATE_SHARE_LINK,On({method:"POST",body:c},f))];case 1:return[4,m.sent().json()];case 2:if(!(h=m.sent())||0!==h.err)throw Kr.error.cannotGetShareInfo();return d.search="".concat(d.search,"&zshareId=").concat(h.data.shareId),[2,Ko(On({},h.data),{shareableLink:d.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),aa=function(){var t=V((function(t,n){var o,a,s,u,c,l,p,d,f,h,m,v;return Q(this,(function(y){switch(y.label){case 0:switch(o={},a=t,t){case"image":return[3,1];case"gif":return[3,2];case"video":return[3,3];case"link":return[3,4];case"oa":return[3,5];case"zmp":return[3,6];case"zmp_deep_link":return[3,9]}return[3,12];case 1:return l=[],p=(null===(u=Tn())||void 0===u?void 0:u.zaloVersion)||0,d=(null===(c=Tn())||void 0===c?void 0:c.platformName)||"unknown",Number(p)>=x[d]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?l=null==n?void 0:n.imageUrls:l.push(null==n?void 0:n.imageUrl),o={photoUrls:l,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,13];case 2:return o={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,13];case 3:return o={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,13];case 4:return o={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,13];case 5:return o={uid:null==n?void 0:n.id},[3,13];case 6:case 9:return[4,$r.getAccessToken()];case 7:case 10:return s=y.sent(),[4,oa(i,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 8:return f=y.sent(),o={data:{ZInstantAPIInfo:{url:"".concat(f.zinstantApi),zinstantdata_id:"templateId=".concat(f.ztemplateId,"&appId=").concat(i,"&shareId=").concat(f.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,13];case 11:return h=y.sent().shareableLink,m=new URL(h),v=m.searchParams.getAll("zshareId"),m.searchParams.delete("zshareId"),v.length>0&&m.searchParams.append("zshareId",v[0]),o={link:m.href,chatOnly:0},[3,13];case 12:return[3,13];case 13:return[2,new Promise((function(t,n){Vr("OPEN_SHARESHEET",Ko(On({type:e.ShareSheetType[a]},o),{zapp:r}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{timeout:!1})}))]}}))}));return function(e,n){return t.apply(this,arguments)}}(),sa=[yn.union([Ct({type:yn.enum(["image"]),data:Ct({imageUrl:yt().url(),imageUrls:yn.array(yt().url()).max(10).optional()})}),Ct({type:yn.enum(["link"]),data:Ct({link:yt().url(),chatOnly:yn.boolean().optional()})}),Ct({type:yn.enum(["oa"]),data:Ct({id:yt()})}),Ct({type:yn.enum(["gif"]),data:Ct({gifUrl:yt().url(),imageUrl:yt().url().optional(),width:gt().min(0).optional(),height:gt().min(0).optional()})}),Ct({type:yn.enum(["video"]),data:Ct({videoThumb:yt().url(),videoUrl:yt().url(),width:gt().min(0).optional(),height:gt().min(0).optional()})}),Ct({type:yn.enum(["zmp","zmp_deep_link"]),data:Ct({title:yt().max(100),thumbnail:yt().url(),path:yt().optional(),description:yt().max(400).default("").optional()})})])];function ua(e){return ca.apply(this,arguments)}function ca(){return ca=V((function(e){return Q(this,(function(t){return[2,ui("openShareSheet",sa,[e],function(){var e=V((function(e){var t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?(t=e.type,n=e.data,[4,aa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Pn("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ca.apply(this,arguments)}var la=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Tn())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)?e({userAllow:void 0===t.error_code||(null==t?void 0:t.error_code)>=0,message:void 0===t.error_code?"User allowed":null==t?void 0:t.error_message}):e({userAllow:(null==t?void 0:t.error_code)>=0,message:null==t?void 0:t.error_message})},fail:function(n){var r,i;(null===(r=Tn())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)&&"number"==typeof(null==n?void 0:n.code)?e({userAllow:(null==n?void 0:n.code)>=0,message:null==n?void 0:n.message}):t(n)}},{isMultiCallback:!0})}))]}))}));function pa(e){return da.apply(this,arguments)}function da(){return(da=V((function(e){return Q(this,(function(t){return[2,ui("requestCameraPermission",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return[4,la()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var fa=function(){var e=V((function(e,t,n){return Q(this,(function(r){return[2,new Promise((function(r,i){Vr("CREATE_SHORTCUT",{url:e,title:t,iconUrl:n},{success:function(e){r(e)},fail:function(e){i(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),ha=V((function(){var e,t,n,r=arguments;return Q(this,(function(o){switch(o.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:i,t=r.length>1&&void 0!==r[1]?r[1]:0,n=mi(),[4,Rr(e,t,n.version)];case 1:return[2,o.sent()]}}))})),ma=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),va=[Ct({params:yn.record(yt(),yt()).optional()}).optional()];function ya(e){return ga.apply(this,arguments)}function ga(){return ga=V((function(e){return Q(this,(function(t){return[2,ui("createShortcut",va,[e],function(){var e=V((function(e){var t,n,r,a,s,u,c,l;return Q(this,(function(p){switch(p.label){case 0:return En.isMp?[4,ha(i,0)]:[3,6];case 1:return r=p.sent(),a=null===(t=Tn())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||ni("og:image:url")||"",u=r.name||document.title,(c=(null==e?void 0:e.params)?new URLSearchParams(null==e?void 0:e.params):new URLSearchParams).append("utm_source","zalo-shortcut"),c.append("utm_medium","default"),c.append("utm_campaign","default"),a?(c.append("appId",i),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,ma(encodeURI(l))]):[3,3];case 2:return p.sent(),[3,5];case 3:return[4,fa("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:p.sent(),p.label=5;case 5:return[2,Kr.success()];case 6:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ga.apply(this,arguments)}var _a=function(){var e=V((function(e,t,n){return Q(this,(function(i){return[2,new Promise((function(i,o){Vr("PROMPT_AUTHENTICATION",{secret_data:e,app_id:r,ui:{title:null==t?void 0:t.title,sub_title:null==t?void 0:t.subTitle,negative_text:null==t?void 0:t.negativeButtonText},require_fingerprint:n?1:0},{success:function(e){var t,n,r,o;i({code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null==e||null===(t=e.data)||void 0===t?void 0:t.domain,code:null==e||null===(n=e.data)||void 0===n?void 0:n.error_code,message:null==e||null===(r=e.data)||void 0===r?void 0:r.error_message,payToken:null==e||null===(o=e.data)||void 0===o?void 0:o.pay_token}})},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),wa=[Ct({secretData:yt(),ui:Ct({title:yt().default("Xác thực").optional(),subTitle:yt().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:yt().default("Đóng").optional()}).optional(),requireFingerprint:bt().default(!0).optional()}).optional()];function ba(e){return Ta.apply(this,arguments)}function Ta(){return Ta=V((function(e){return Q(this,(function(t){return[2,ui("openBioAuthentication",wa,[e],function(){var e=V((function(e){var t,n,r;return Q(this,(function(i){switch(i.label){case 0:return En.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,_a(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Pn("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ta.apply(this,arguments)}var Ea=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("PROMPT_AUTHENTICATION_CHECK_STATE",{},{success:function(t){e(null==t?void 0:t.bio_state)},fail:function(e){t(e)}},{actionName:"action.prompt.authentication.check_state"})}))]}))}));function Sa(e){return Pa.apply(this,arguments)}function Pa(){return(Pa=V((function(e){return Q(this,(function(t){return[2,ui("checkStateBioAuthentication",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ea()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return En.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Pn("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Aa=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Oa=[Ct({message:yt()}).optional()];function ka(e){return Ia.apply(this,arguments)}function Ia(){return Ia=V((function(e){return Q(this,(function(t){return[2,ui("showToast",Oa,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Aa(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ia.apply(this,arguments)}var Na=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ca(e){return Ma.apply(this,arguments)}function Ma(){return(Ma=V((function(e){return Q(this,(function(t){return[2,ui("hideKeyboard",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Na()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var xa=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ra=[Ct({phoneNumber:yt()})];function ja(e){return Da.apply(this,arguments)}function Da(){return Da=V((function(e){return Q(this,(function(t){return[2,ui("openPhone",Ra,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,xa(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Da.apply(this,arguments)}var Ua=function(){var e=V((function(e,t){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ba=[Ct({content:yt(),phoneNumber:yt()})];function Za(e){return La.apply(this,arguments)}function La(){return La=V((function(e){return Q(this,(function(t){return[2,ui("openSMS",Ba,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Ua(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),La.apply(this,arguments)}var za=function(){var e=V((function(e){var t,n=arguments;return Q(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){Vr("VIEW_MYQR",{dpn:t,uid:e,zapp:r},{success:function(){n()},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Wa=[Ct({id:yt(),displayName:yt().default("").optional()})];function Ga(e){return Fa.apply(this,arguments)}function Fa(){return Fa=V((function(e){return Q(this,(function(t){return[2,ui("viewOAQr",Wa,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,za(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fa.apply(this,arguments)}var Ha=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("KEEP_SCREEN",{data:{keep_screen_on:e?1:0}},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ka=[Ct({keepScreenOn:bt()})];function Va(e){return Ja.apply(this,arguments)}function Ja(){return Ja=V((function(e){return Q(this,(function(t){return[2,ui("keepScreen",Ka,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Ha(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ja.apply(this,arguments)}function qa(e){return $a.apply(this,arguments)}function $a(){return($a=V((function(e){return Q(this,(function(t){return[2,ui("onKeepScreen",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ha(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function Ya(e){return Qa.apply(this,arguments)}function Qa(){return(Qa=V((function(e){return Q(this,(function(t){return[2,ui("offKeepScreen",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ha(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var Xa=function(){var e=V((function(e,t){var n;return Q(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){Vr("SAVE_IMAGE_GALLERY",On({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),es=[Ct({imageBase64Data:yt().optional(),imageUrl:yt().url().optional()}).optional()];function ts(e){return ns.apply(this,arguments)}function ns(){return ns=V((function(e){return Q(this,(function(t){return[2,ui("saveImageToGallery",es,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Xa(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ns.apply(this,arguments)}var rs=function(){var e=V((function(e){var t,n,r,i,o,s,u=arguments;return Q(this,(function(c){switch(c.label){case 0:t=u.length>1&&void 0!==u[1]?u[1]:"/",n=u.length>2&&void 0!==u[2]?u[2]:{},c.label=1;case 1:return c.trys.push([1,3,,4]),[4,ha(e,0)];case 2:return r=c.sent(),[3,4];case 3:return c.sent(),[3,4];case 4:i={appId:e},r&&(i.appName=r.name,i.appAvtUrl=r.logoUrl),o="".concat(a,"/").concat(e).concat(t);try{s=new URL(o),Object.entries(n).forEach((function(e){var t=kn(e,2),n=t[0],r=t[1];s.searchParams.append(n,String(r))})),o=s.href}catch(e){}return[2,new Promise((function(e,t){Vr("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),is=[Ct({appId:yt(),path:yt().optional(),params:yn.record(yt(),yt()).optional()})];function os(e){return as.apply(this,arguments)}function as(){return as=V((function(e){return Q(this,(function(t){return[2,ui("openMiniApp",is,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,rs(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),as.apply(this,arguments)}var ss=V((function(){var t,n,r=arguments;return Q(this,(function(i){return t=r.length>0&&void 0!==r[0]?r[0]:"oneShot",n=r.length>1?r[1]:void 0,[2,new Promise((function(r,i){Vr("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),us=[Ct({type:yn.enum(["oneShot"]).default("oneShot"),milliseconds:gt().optional()})];function cs(e){return ls.apply(this,arguments)}function ls(){return ls=V((function(e){return Q(this,(function(t){return[2,ui("vibrate",us,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,ss(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ls.apply(this,arguments)}var ps=function(){var e=V((function(e,t){var n,r,i,o;return Q(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=lr.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Dr(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Dr(null==t?void 0:t.leftButton):"back"},!r&&lr.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){Vr("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ds=[Ct({url:yt(),config:Ct({style:yn.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:yn.enum(["back","none"]).default("back").optional()}).optional()})];function fs(e){return hs.apply(this,arguments)}function hs(){return hs=V((function(e){return Q(this,(function(t){return[2,ui("openWebview",ds,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,ps(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),hs.apply(this,arguments)}function ms(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Ar.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function vs(){return ui("getRouteParams",[],[],(function(){return ms()}))}function ys(e){return gs.apply(this,arguments)}function gs(){return(gs=V((function(e){return Q(this,(function(t){return[2,ui("getAppInfo",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,ha()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Pn("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var _s=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("WEBVIEW_SET_RESULT",{result:ri(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ws=[Ct({data:yn.any()})];function bs(e){return Ts.apply(this,arguments)}function Ts(){return Ts=V((function(e){return Q(this,(function(t){return[2,ui("sendDataToPreviousMiniApp",ws,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,_s(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ts.apply(this,arguments)}var Es=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){var n,r;Vr("MP_GET_NUMBER",{forceUpdate:!0},{success:function(n){var r={};if(null==n?void 0:n.token)return r.token=null==n?void 0:n.token,e(r);t(Kr.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Tn())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function Ss(e){return Ps.apply(this,arguments)}function Ps(){return(Ps=V((function(e){return Q(this,(function(t){return[2,ui("getPhoneNumber",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Es()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Pn("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var As=V((function(){var e,t=arguments;return Q(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){Vr("MP_OPEN_PROFILE_PICKER",{maxProfile:e},{success:function(e){Array.isArray(e)?t(e.map((function(e){return e.id}))):t([])},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))})),Os=[Ct({maxProfile:gt().min(1).max(10).optional().default(1)})];function ks(e){return Is.apply(this,arguments)}function Is(){return Is=V((function(e){return Q(this,(function(t){return[2,ui("openProfilePicker",Os,[e],function(){var e=V((function(e){var t,n,r,i,o;return Q(this,(function(a){switch(a.label){case 0:return En.isMp?[4,As(null==e?void 0:e.maxProfile)]:[3,8];case 1:if(!((t=a.sent()).length>0))return[3,7];a.label=2;case 2:return a.trys.push([2,6,,7]),[4,$r.getAccessToken()];case 3:return r=a.sent(),[4,fetch(l.GET_LIST_USER_INFO,{method:"POST",headers:{"Content-Type":"application/json",access_token:r||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})})];case 4:return[4,a.sent().json()];case 5:if(0!==(i=a.sent()).error||!i.data)throw new Error(i.message);return n=t.map((function(e){var t,n,r,o,a,s,u,c,l,p,d;return{id:(null===(t=i.data[e])||void 0===t||null===(n=t.user_info)||void 0===n?void 0:n.user_id_by_app)||"",profile:{name:null===(r=i.data[e])||void 0===r||null===(o=r.user_info)||void 0===o?void 0:o.name,avatar:null===(a=i.data[e])||void 0===a||null===(s=a.user_info)||void 0===s||null===(u=s.picture)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.url},code:0!==(null===(l=i.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(lr.isUndefined(null===(p=i.data[e])||void 0===p?void 0:p.message)?"Unknown error":null===(d=i.data[e])||void 0===d?void 0:d.message)}})),[3,7];case 6:return o=a.sent(),n=t.map((function(e){return{id:e,profile:{name:"",avatar:""},code:-1,message:"Can't get profile: ".concat(o.message)}})),[3,7];case 7:return[2,{users:n||[]}];case 8:return En.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Pn("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Is.apply(this,arguments)}var Ns=function(){var e=V((function(e,t,n){var r;return Q(this,(function(i){return r=t&&lr.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){Vr("MP_JOIN_WIFI",{ssid:e,securityType:r,password:t,hiddenSsid:n},{success:function(e){i(e)},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Cs=[Ct({SSID:yt(),password:yt().optional(),hiddenSSID:bt().optional()})];function Ms(e){return xs.apply(this,arguments)}function xs(){return xs=V((function(e){return Q(this,(function(t){return[2,ui("connectWifi",Cs,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Ns(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xs.apply(this,arguments)}var Rs=function(){var t=V((function(t,n,r,i,o,a){var s,u;return Q(this,(function(c){return s={type:0,url:n,maxSize:r||1048576},u={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(n,r){Vr("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:On({},u,i),silent_request:o,upload:s,max_select_items:a},{success:function(e){n(null==e?void 0:e.result_content)},fail:function(e){r(e)}},{isMultiCallback:!0})}))]}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),js=[Ct({type:yn.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:yt().url(),maxItemSize:gt().min(0).optional(),editView:Ct({enable:bt().optional(),aspectRatio:yt().regex(/^d+:d+$/).optional()}).optional(),silentRequest:bt().optional(),maxSelectItem:gt().min(1).optional()})];function Ds(e){return Us.apply(this,arguments)}function Us(){return Us=V((function(e){return Q(this,(function(t){return[2,ui("openMediaPicker",js,[e],function(){var e=V((function(e){var t,n,r,i,o,a;return Q(this,(function(s){switch(s.label){case 0:return En.isMp?(i={},lr.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(n=e.editView)||void 0===n?void 0:n.enable)?i.enable=1:i.enable=0,i.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio,o=!0===e.silentRequest?1:0,a=e.maxSelectItem,[4,Rs(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return En.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Pn("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Us.apply(this,arguments)}var Bs=[Ct({title:yt().max(100),description:yt().max(400).default(""),thumbnail:yt().url().optional(),path:yt().optional()})];function Zs(e){return Ls.apply(this,arguments)}function Ls(){return Ls=V((function(e){return Q(this,(function(t){return[2,ui("getShareableLink",Bs,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return[4,$r.getAccessToken()];case 1:return t=n.sent(),[4,oa(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ls.apply(this,arguments)}var zs=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("MP_CLOSE_LOADINGVIEW",{at:(new Date).getTime(),when:e,url:location.href},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}();function Ws(e){return Gs.apply(this,arguments)}function Gs(){return(Gs=V((function(e){return Q(this,(function(t){return[2,ui("closeLoading",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,zs("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function Fs(e){return Hs.apply(this,arguments)}function Hs(){return Hs=V((function(e){return Q(this,(function(t){return[2,ui("requestUpdateZalo",[],[e],V((function(){var e,t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?(n=(null===(e=Tn())||void 0===e||null===(t=e.platform)||void 0===t?void 0:t.isIOS)?"https://apps.apple.com/vn/app/zalo/id579523206":"https://play.google.com/store/apps/details?id=com.zing.zalo",[4,ma(n)]):[3,2];case 1:return[2,r.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("requestUpdateZalo",{}))]}}))})))]}))})),Hs.apply(this,arguments)}var Ks=Er.getInstance();Ks.addListener=function(t,n,r){var i=t;return Ks.addListener(e.Events[i],n,r)};var Vs=[yn.function()];function Js(t){return ui("onConfirmToExit",Vs,[t],(function(t){var n=t;En.isMp&&(Ks.on(e.Events.AppClose,n,'{"handle_h5": 1}'),gi.setNavigationBarLeftButton(void 0,2))}))}function qs(){return ui("offConfirmToExit",[],[],(function(){En.isMp&&(Ks.off(e.Events.AppClose),gi.setNavigationBarLeftButton(void 0,0))}))}function $s(){return ui("getDeviceId",[],[],(function(){return En.isMp&&$r.getSync(c.DEVICE_ID)||""}))}function Ys(e){return Qs.apply(this,arguments)}function Qs(){return(Qs=V((function(e){return Q(this,(function(t){return[2,ui("getDeviceIdAsync",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function Xs(){return ui("getContext",[],[],(function(){if(En.isMp){var e=$r.getSync(c.CONTEXT_ID)||"";return{type:$r.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function eu(e){return tu.apply(this,arguments)}function tu(){return(tu=V((function(e){return Q(this,(function(t){return[2,ui("getContextAsync",[],[e],V((function(){var e;return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,$r.jumpAndGetToken(c.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function nu(e){return ru.apply(this,arguments)}function ru(){return(ru=V((function(e){return Q(this,(function(t){return[2,ui("getAuthCode",[],[e],V((function(){var e,t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,$r.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,$r.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw jr([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),Kr.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function iu(e){return ou.apply(this,arguments)}function ou(){return(ou=V((function(e){return Q(this,(function(t){return[2,ui("getZPIToken",[],[e],V((function(){var e,t,n,r;return Q(this,(function(i){switch(i.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,$r.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,$r.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,$r.jumpAndGetToken(c.ZPT_ZPI)];case 4:return r=i.sent()||"",[2,{utoken:e,gtoken:t,zpp:n,zpt:r}];case 5:return[2,Promise.resolve({utoken:"",gtoken:"",zpp:"",zpt:""})]}}))})))]}))}))).apply(this,arguments)}var au=[yt()];function su(e){return ui("setAccessToken",au,[e],(function(e){var t=e;$r.setAccessToken(t)}))}var uu=[Ct({url:yt().url()})];function cu(e){return lu.apply(this,arguments)}function lu(){return lu=V((function(e){return Q(this,(function(t){return[2,ui("openOutApp",uu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,ma(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),lu.apply(this,arguments)}var pu=[Ct({count:gt().min(1).optional().default(1),sourceType:yn.array(yn.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:yn.enum(["back","front"]).default("front").optional()})];function du(e){return fu.apply(this,arguments)}function fu(){return fu=V((function(e){return Q(this,(function(t){return[2,ui("chooseImage",pu,[e],function(){var e=V((function(e){var t,n,r,i;return Q(this,(function(o){return t=e.sourceType||["album","camera"],n=e.cameraType||"front",r=e.count||1,(i=document.createElement("input")).type="file",i.multiple=r>1,i.accept="image/*",i.style.display="none",1===t.length&&t.includes("camera")&&(i.accept="front"===n?"zcamera/photo-frontfacing":"zcamera/photo-backfacing",i.capture="front"===n?"user":"environment"),[2,new Promise((function(e,t){i.addEventListener("change",(function(n){var i,o=(null==n||null===(i=n.target)||void 0===i?void 0:i.files)||[];if(o.length>r)t(new Error("You are only allowed to choose a maximum of ".concat(r," images at a time")));else{var a={filePaths:[],tempFiles:[]};Array.from(o).forEach((function(e){a.filePaths.push(URL.createObjectURL(e)),a.tempFiles.push({path:URL.createObjectURL(e),size:e.size})})),e(a)}})),document.body.appendChild(i),i.click()}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fu.apply(this,arguments)}var hu=V((function(){var e,t,n=arguments;return Q(this,(function(r){return e=n.length>0&&void 0!==n[0]&&n[0],t=n.length>1&&void 0!==n[1]?n[1]:"Cho phép Zalo truy cập vào vị trí của thiết bị này?",[2,new Promise((function(n,r){Vr("GET_LOCATION",{silent_request:e,permission_description:t,forceUpdate:!0},{success:function(e){var t={};if(null==e?void 0:e.token)return t.token=null==e?void 0:e.token,n(t);r(Kr.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function mu(e){return vu.apply(this,arguments)}function vu(){return(vu=V((function(e){return Q(this,(function(t){return[2,ui("getLocation",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,hu()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Pn("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var yu=[yn.function().args(Ct({data:yn.any()})).returns(yn.void())];function gu(t){return ui("onCallbackData",yu,[t],(function(){!function(t){Er.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var _u=function(){var e=V((function(e){var t,n,r,o,a,s,u,c,l,p,d;return Q(this,(function(f){switch(f.label){case 0:return n="",e||(e=ms()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Ar.getParameterByName("orderId",e),o=Ar.getParameterByName("appTransID",e)||Ar.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,$r.getAccessToken().catch((function(){throw Kr.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(U),c={orderId:n,transId:t||"",appId:i},u.search=new URLSearchParams(c).toString(),[4,fetch(u.toString(),a)];case 2:return[4,f.sent().json()];case 3:if(!(l=f.sent()).data)throw Kr.error.badRequest(l.msg);return p=l.data||{},d={err:l.err},0!==Object.keys(p).length&&p.constructor===Object&&Object.assign(d,On({msg:p.resultMessage},p)),[2,d]}}))}));return function(t){return e.apply(this,arguments)}}(),wu=function(){var t=V((function(t,n,r,o,a,s,u){var c,l,p,d,f,h,m,v,y,g,_,w,b,T,E,S,P,A,O,k;return Q(this,(function(I){switch(I.label){case 0:c=i,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("appId",c),r&&l.append("desc",encodeURIComponent(r)),o&&(p=o,"object"==typeof o&&(p=JSON.stringify(o)),l.append("extradata",encodeURIComponent(p))),a&&(d=a,"object"==typeof a&&(d=JSON.stringify(a)),l.append("payload",encodeURIComponent(d))),s&&("string"==typeof s?(l.append("method",s),l.append("isCustom","false")):"object"==typeof s&&(l.append("method",s.id),l.append("isCustom",JSON.stringify(s.isCustom)))),u&&l.append("mac",u),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},I.label=1;case 1:return I.trys.push([1,6,,7]),[4,$r.getAccessToken().catch((function(){throw Kr.error.loginRequired}))];case 2:return m=I.sent(),f.headers.authorization="Bearer ".concat(m),[4,fetch(j,Ko(On({method:"POST"},f),{body:l}))];case 3:return[4,I.sent().json()];case 4:if(!(v=I.sent()).data||0!==v.err)throw Kr.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=window.APP_VERSION,w=window.APP_ENV,b={miniAppId:c,orderId:y},T=v.data.method,E=v.data.isCustom,g&&(b.token=g),_&&(b.version=_),w&&(b.env=w),T&&(b.method=T),E&&(b.isCustom=E),S=Ar.encode(b),P=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),A=Ur(),O=((null===(h=Tn())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,ps(P,{style:"android"===O&&A<742?"normal":"bottomSheet"}).then((function(){var t=!1;Er.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(V((function(){var n;return Q(this,(function(r){switch(r.label){case 0:return t?[3,2]:[4,_u({zmpOrderId:y})];case 1:(n=r.sent()).err>=0&&!n.isCustom&&Er.getInstance().emit(e.Events.PaymentClose,n.err,Ko(On({},n),{zmpOrderId:y})),r.label=2;case 2:return[2]}}))})),500)})),Er.getInstance().once(e.Events.OpenApp,(function(){t=!0}))}))];case 5:return I.sent(),[2,{orderId:y}];case 6:throw k=I.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),bu=[Ct({amount:yn.union([yt(),gt()]),item:yn.array(yn.record(yt(),yn.any())),desc:yt(),extradata:yn.any().optional(),payload:yn.any().optional(),method:yn.union([yn.string(),yn.object({id:yn.string(),isCustom:yn.boolean()})]).optional(),mac:yn.string().optional()})];function Tu(e){return Eu.apply(this,arguments)}function Eu(){return Eu=V((function(e){return Q(this,(function(t){return[2,ui("createOrder",bu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,wu(e.amount,e.item,e.desc,e.extradata,e.payload,e.method,e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Pn("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Eu.apply(this,arguments)}var Su=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("MP_SELECT_PAYMENT_METHOD",{method:e,forceUpdate:!0},{success:function(e){console.log(e),t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Pu=[Ct({method:yt().optional()}).optional()];function Au(e){return Ou.apply(this,arguments)}function Ou(){return Ou=V((function(e){return Q(this,(function(t){return[2,ui("selectPaymentMethod",Pu,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=e.method,[4,Su(t)]):[3,2];case 1:return[2,n.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Pn("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ou.apply(this,arguments)}var ku=[Ct({data:yn.union([yt(),yn.record(yt(),yt())])})];function Iu(e){return Nu.apply(this,arguments)}function Nu(){return Nu=V((function(e){return Q(this,(function(t){return[2,ui("checkTransaction",ku,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,_u(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Pn("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Nu.apply(this,arguments)}var Cu=[Ct({hide:bt().default(!1).optional()}).optional()];function Mu(e){return xu.apply(this,arguments)}function xu(){return xu=V((function(e){return Q(this,(function(t){return[2,ui("setAndroidBottomNavigationBar",Cu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xu.apply(this,arguments)}var Ru=[Ct({hide:bt().default(!1).optional()}).optional()];function ju(e){return Du.apply(this,arguments)}function Du(){return Du=V((function(e){return Q(this,(function(t){return[2,ui("setIOSBottomSafeArea",Ru,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Du.apply(this,arguments)}var Uu=[Ct({type:yn.enum(["normal","hidden","transparent"]).default("normal").optional(),color:yn.string().optional()}).optional()];function Bu(e){return Zu.apply(this,arguments)}function Zu(){return Zu=V((function(e){return Q(this,(function(t){return[2,ui("setStatusBar",Uu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zu.apply(this,arguments)}var Lu=[Ct({headerTextColor:yn.enum(["black","white"]).optional(),headerColor:yn.string().optional(),actionBar:Ct({hide:yn.boolean().optional(),title:yn.string().optional(),leftButton:yn.enum(["back","none"]).optional(),textAlign:yn.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:yn.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:yn.boolean().optional(),hideIOSSafeAreaBottom:yn.boolean().optional()})];function zu(e){return Wu.apply(this,arguments)}function Wu(){return Wu=V((function(e){return Q(this,(function(t){return[2,ui("configAppView",Lu,[e],function(){var e=V((function(e){var t,n,r,i,o,a,s;return Q(this,(function(u){switch(u.label){case 0:return En.isMp?lr.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,gi.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return lr.isUndefined(null===(n=e.actionBar)||void 0===n?void 0:n.title)||!(null===(r=e.actionBar)||void 0===r?void 0:r.title)?[3,4]:[4,gi.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,gi.configHeader({hideActionBar:null===(i=e.actionBar)||void 0===i?void 0:i.hide,statusBarType:e.statusBarType,headerTextColor:e.headerTextColor,headerColor:e.headerColor,textAlign:null===(o=e.actionBar)||void 0===o?void 0:o.textAlign})];case 5:u.sent(),u.label=6;case 6:return u.trys.push([6,11,,12]),"boolean"!=typeof e.hideAndroidBottomNavigationBar?[3,8]:[4,gi.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,gi.setIOSBottomSafeArea(e.hideIOSSafeAreaBottom)];case 9:u.sent(),u.label=10;case 10:return[3,12];case 11:return u.sent(),[3,12];case 12:return[2];case 13:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wu.apply(this,arguments)}var Gu=function(){var t=V((function(t,n,r,o,a,s){var u,c,l,p,d,f,h,m,v,y,g,_,w,b;return Q(this,(function(T){switch(T.label){case 0:d=i,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===Z&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===B&&(h=e.ProrationMode.DEFERRED),f.append("utm",a||"default"),f.append("merchantTransId",s||""),f.append("prorationMode",h.toString()),f.append("appId",d),o&&f.append("method",o),m="",(null===(u=Tn())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Tn())||void 0===l||null===(p=l.platform)||void 0===p?void 0:p.isAndroid)&&(m="android"),f.append("os",m),f.append("productId",t),v={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},T.label=1;case 1:return T.trys.push([1,5,,6]),[4,$r.getAccessToken().catch((function(){throw Kr.error.loginRequired}))];case 2:return y=T.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(D,Ko(On({method:"POST"},v),{body:f}))];case 3:return[4,T.sent().json()];case 4:if(!(g=T.sent()).data||!g.data.store||0!==g.err)throw Kr.error.createIAPOrderFailed(g.err);return _=g.data.store,w=g.data.orderId,[2,new Promise((function(e,t){Vr("IAP_REQUESTPAYMENT",On({},_),{success:function(){e({orderId:w})},fail:function(e){t(e)}})}))];case 5:throw b=T.sent(),console.log("Internal error"),b;case 6:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),Fu=[Ct({productId:yt(),payType:yn.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:yn.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:yt().optional(),method:yn.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:yt().optional()})];function Hu(e){return Ku.apply(this,arguments)}function Ku(){return Ku=V((function(e){return Q(this,(function(t){return[2,ui("createOrderIAP",Fu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Gu(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Pn("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ku.apply(this,arguments)}var Vu=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Ju(e){return qu.apply(this,arguments)}function qu(){return(qu=V((function(e){return Q(this,(function(t){return[2,ui("minimizeApp",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Vu()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var $u=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function Yu(e){return Qu.apply(this,arguments)}function Qu(){return(Qu=V((function(e){return Q(this,(function(t){return[2,ui("openPermissionSetting",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,$u()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Xu=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ec(e){return tc.apply(this,arguments)}function tc(){return(tc=V((function(e){return Q(this,(function(t){return[2,ui("favoriteApp",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Xu()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var nc=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function rc(e){return ic.apply(this,arguments)}function ic(){return(ic=V((function(e){return Q(this,(function(t){return[2,ui("openGroupList",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,nc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var oc=V((function(){var e;return Q(this,(function(t){switch(t.label){case 0:return[4,$r.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){Vr("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function ac(e){return sc.apply(this,arguments)}function sc(){return(sc=V((function(e){return Q(this,(function(t){return[2,ui("requestSendNotification",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,oc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var uc=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function cc(e){return lc.apply(this,arguments)}function lc(){return(lc=V((function(e){return Q(this,(function(t){return[2,ui("addRating",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,uc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Pn("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var pc,dc=(pc=V((function(e,t,n){var r,i;return Q(this,(function(o){switch(o.label){case 0:return(r=new URLSearchParams).append("appId",t),r.append("accessToken",n),r.append("oaId",e),i={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.CHECK_INTERACT_OA,On({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return pc.apply(this,arguments)}),fc=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("MP_INTERACT_OA",{oaId:e,forceUpdate:!0},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),hc=[Ct({oaId:yt()})];function mc(e){return vc.apply(this,arguments)}function vc(){return vc=V((function(e){return Q(this,(function(t){return[2,ui("interactOA",hc,[e],function(){var e=V((function(e){var t,n,r;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(t=e.oaId,[4,$r.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||lr.isEmpty(n)?[3,3]:[4,dc(t,i,n)];case 2:if(0===(null==(r=o.sent())?void 0:r.err))return[2,Promise.resolve({})];o.label=3;case 3:return[4,fc(t)];case 4:return[2,o.sent()];case 5:return En.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Pn("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vc.apply(this,arguments)}var yc=[Ct({oaId:yt()})];function gc(e){return _c.apply(this,arguments)}function _c(){return _c=V((function(e){return Q(this,(function(t){return[2,ui("isAllowedInteractWithOA",yc,[e],function(){var e=V((function(e){var t,n,r;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(t=e.oaId,[4,$r.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||lr.isEmpty(n)?[3,3]:[4,dc(t,i,n)];case 2:return r=o.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return En.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Pn("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_c.apply(this,arguments)}function wc(e){return bc.apply(this,arguments)}function bc(){return(bc=V((function(e){return Q(this,(function(t){return[2,ui("getSetting",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Fr()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Pn("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Tc=yn.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Ec=[Ct({scopes:yn.array(Tc).max(2).optional()}).optional()];function Sc(e){return Pc.apply(this,arguments)}function Pc(){return Pc=V((function(e){return Q(this,(function(t){return[2,ui("authorize",Ec,[e],function(){var e=V((function(e){var t,n,r,i;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(n=null==e?void 0:e.scopes,r=Ur(),("android"===(i=((null===(t=Tn())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject(Kr.error.clientNotSupport())]:[4,Jr(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Pn("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pc.apply(this,arguments)}var Ac=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n;return Q(this,(function(r){switch(r.label){case 0:return lr.isUndefined(ZaloJavaScriptInterface)||"function"!=typeof ZaloJavaScriptInterface.checkCameraPermission?[3,2]:[4,ZaloJavaScriptInterface.checkCameraPermission()];case 1:return n=r.sent(),[2,e({userAllow:"grant"===n})];case 2:return t(Kr.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Oc(e){return ui("checkZaloCameraPermission",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return[4,Ac()];case 1:return[2,e.sent()]}}))})))}var kc=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n,r,i;return Q(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,$r.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=$r.miniProgramConfig)||void 0===n?void 0:n.userId,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Ic(e){return Nc.apply(this,arguments)}function Nc(){return(Nc=V((function(e){return Q(this,(function(t){return[2,ui("getUserID",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,kc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Pn("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var Cc=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n,r,i;return Q(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,$r.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=$r.miniProgramConfig)||void 0===n?void 0:n.idToken,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Mc(e){return xc.apply(this,arguments)}function xc(){return(xc=V((function(e){return Q(this,(function(t){return[2,ui("getIDToken",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Cc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Pn("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Rc=function(){function e(){var t,n;pr(this,e),this.sdkLoaded=!1,this.queue=[];var r=window.AdtimaZMA={config:{cateId:null===(t=window.zmpGlobal)||void 0===t||null===(n=t.appInfo)||void 0===n?void 0:n.cateType,appId:window.APP_ID},queue:[],load:function(e,t){r.queue=Y(r.queue).concat([[e,t]])}}}var t=e.prototype;return t.loadSDK=function(){var e=this,t=document.createElement("script");t.src="https://adtima-static.zascdn.me/resource/js/zma/sdk.js?q=".concat(Math.floor((new Date).getTime()/864e5)),t.onload=function(){e.sdkLoaded=!0,e.processQueue()},t.onerror=function(){e.sdkLoaded=!0},document.body.appendChild(t)},t.load=function(e,t){var n;lr.isFunction(null===(n=window.AdtimaZMA)||void 0===n?void 0:n.load)&&window.AdtimaZMA.load(e,t)},t.display=function(e){var t;this.sdkLoaded?lr.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.display)&&window.AdtimaZMA.display(e):this.queue.push(this.display.bind(this,e))},t.refresh=function(e){var t;this.sdkLoaded?lr.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.refresh)&&window.AdtimaZMA.refresh(e):this.queue.push(this.refresh.bind(this,e))},t.processQueue=function(){for(;this.queue.length>0;){var e=this.queue.shift();e&&e()}},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}();function jc(e){return Dc.apply(this,arguments)}function Dc(){return(Dc=V((function(e){return Q(this,(function(t){return[2,ui("setupAd",[],[e],(function(){return Rc.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var Uc=[Ct({ids:yn.union([yn.string(),yn.array(yn.string())]),config:Ct({display:yn.boolean().optional(),onClose:yn.function().optional()}).optional()})];function Bc(e){return Zc.apply(this,arguments)}function Zc(){return Zc=V((function(e){return Q(this,(function(t){return[2,ui("loadAd",Uc,[e],function(){var e=V((function(e){return Q(this,(function(t){return Rc.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zc.apply(this,arguments)}var Lc=[Ct({id:yn.string()})];function zc(e){return Wc.apply(this,arguments)}function Wc(){return Wc=V((function(e){return Q(this,(function(t){return[2,ui("displayAd",Lc,[e],function(){var e=V((function(e){return Q(this,(function(t){return Rc.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wc.apply(this,arguments)}var Gc=[Ct({id:yn.string().optional()}).optional()];function Fc(e){return Hc.apply(this,arguments)}function Hc(){return Hc=V((function(e){return Q(this,(function(t){return[2,ui("refreshAd",Gc,[e],function(){var e=V((function(e){return Q(this,(function(t){return Rc.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hc.apply(this,arguments)}var Kc=[Ct({id:yt(),guidingText:yt().optional(),color:yt().optional(),onStatusChange:yn.function().optional()})];function Vc(e){return Jc.apply(this,arguments)}function Jc(){return Jc=V((function(e){return Q(this,(function(t){return[2,ui("showOAWidget",Kc,[e],function(){var e=V((function(e){var t,n,r,i,o;return Q(this,(function(a){if(En.isMp)try{t=document.getElementById(e.id),n=e.guidingText,r=e.onStatusChange,i=e.color,t&&((o=document.createElement("iframe")).id="iframeOAWidget",o.src="https://h5.zalo.me/widgets/oa_widget.html?guidingText=".concat(n,"&color=").concat(i),o.style.width="100%",o.style.height="100%",o.style.border="none",t.innerHTML=o.outerHTML,window.addEventListener("message",function(){var e=V((function(e){var t,n,i,o,a,s,u;return Q(this,(function(c){switch(c.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById("iframeOAWidget"),"followOA"!==(i=t.type)&&"getOAInfo"!==i?[3,2]:[4,$r.jumpAndGetToken()]):[3,3];case 1:return c.sent(),s=null===(o=$r.miniProgramConfig)||void 0===o?void 0:o.jwt,null==n||null===(a=n.contentWindow)||void 0===a||a.postMessage({type:i,payload:{jwt:s}},"*"),[3,3];case 2:"oaInfo"===i?null==r||r(null===(u=t.payload)||void 0===u?void 0:u.followed):"openOA"===i?Bo(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),c.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Jc.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:hi},ci();var qc=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},login:ci,getAccessToken:pi,getVersion:hi,getSystemInfo:vi,setNavigationBarTitle:wi,setNavigationBarColor:Ei,setNavigationBarLeftButton:Ai,setStorage:Qi,getStorage:to,getStorageInfo:ro,removeStorage:ao,clearStorage:co,getUserInfo:ho,getNetworkType:go,onNetworkStatusChange:bo,startBeaconDiscovery:So,stopBeaconDiscovery:Oo,getBeacons:No,closeApp:xo,scanQRCode:Do,openProfile:Lo,openChat:Fo,openPostFeed:qo,followOA:Xo,unfollowOA:ra,openShareSheet:ua,requestCameraPermission:pa,createShortcut:ya,openBioAuthentication:ba,checkStateBioAuthentication:Sa,showToast:ka,hideKeyboard:Ca,openPhone:ja,openSMS:Za,viewOAQr:Ga,keepScreen:Va,onKeepScreen:qa,offKeepScreen:Ya,saveImageToGallery:ts,openMiniApp:os,vibrate:cs,openWebview:fs,getRouteParams:vs,getAppInfo:ys,sendDataToPreviousMiniApp:bs,getPhoneNumber:Ss,openProfilePicker:ks,connectWifi:Ms,openMediaPicker:Ds,getShareableLink:Zs,closeLoading:Ws,requestUpdateZalo:Fs,onConfirmToExit:Js,offConfirmToExit:qs,getDeviceId:$s,getDeviceIdAsync:Ys,getContext:Xs,getContextAsync:eu,getAuthCode:nu,getZPIToken:iu,setAccessToken:su,openOutApp:cu,chooseImage:du,getLocation:mu,onCallbackData:gu,createOrder:Tu,selectPaymentMethod:Au,checkTransaction:Iu,events:Ks,setAndroidBottomNavigationBar:Mu,setIOSBottomSafeArea:ju,setStatusBar:Bu,configAppView:zu,createOrderIAP:Hu,minimizeApp:Ju,openPermissionSetting:Yu,favoriteApp:ec,openGroupList:rc,requestSendNotification:ac,addRating:cc,interactOA:mc,interactOa:mc,isAllowedInteractWithOA:gc,getSetting:wc,authorize:Sc,checkZaloCameraPermission:Oc,getUserID:Ic,getIDToken:Mc,setupAd:jc,loadAd:Bc,displayAd:zc,refreshAd:Fc,showOAWidget:Vc}),$c=Tu,Yc=Iu,Qc=Hu,Xc=Au,el=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(qc,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod"]),tl={createOrder:$c,checkTransaction:Yc,createOrderIAP:Qc,selectPaymentMethod:Xc};!function(){var e,t=null===(e=Tn())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,qc))}(),e.EventName=e.Events,e.Payment=tl,e.addRating=cc,e.authorize=Sc,e.checkStateBioAuthentication=Sa,e.checkTransaction=Iu,e.checkZaloCameraPermission=Oc,e.chooseImage=du,e.clearStorage=co,e.closeApp=xo,e.closeLoading=Ws,e.configAppView=zu,e.connectWifi=Ms,e.createOrder=Tu,e.createOrderIAP=Hu,e.createShortcut=ya,e.default=el,e.displayAd=zc,e.events=Ks,e.favoriteApp=ec,e.followOA=Xo,e.getAccessToken=pi,e.getAppInfo=ys,e.getAuthCode=nu,e.getBeacons=No,e.getContext=Xs,e.getContextAsync=eu,e.getDeviceId=$s,e.getDeviceIdAsync=Ys,e.getIDToken=Mc,e.getLocation=mu,e.getNetworkType=go,e.getPhoneNumber=Ss,e.getRouteParams=vs,e.getSetting=wc,e.getShareableLink=Zs,e.getStorage=to,e.getStorageInfo=ro,e.getSystemInfo=vi,e.getUserID=Ic,e.getUserInfo=ho,e.getVersion=hi,e.getZPIToken=iu,e.hideKeyboard=Ca,e.interactOA=mc,e.interactOa=mc,e.isAllowedInteractWithOA=gc,e.keepScreen=Va,e.loadAd=Bc,e.login=ci,e.minimizeApp=Ju,e.offConfirmToExit=qs,e.offKeepScreen=Ya,e.onCallbackData=gu,e.onConfirmToExit=Js,e.onKeepScreen=qa,e.onNetworkStatusChange=bo,e.openBioAuthentication=ba,e.openChat=Fo,e.openGroupList=rc,e.openMediaPicker=Ds,e.openMiniApp=os,e.openOutApp=cu,e.openPermissionSetting=Yu,e.openPhone=ja,e.openPostFeed=qo,e.openProfile=Lo,e.openProfilePicker=ks,e.openSMS=Za,e.openShareSheet=ua,e.openWebview=fs,e.refreshAd=Fc,e.removeStorage=ao,e.requestCameraPermission=pa,e.requestSendNotification=ac,e.requestUpdateZalo=Fs,e.saveImageToGallery=ts,e.scanQRCode=Do,e.selectPaymentMethod=Au,e.sendDataToPreviousMiniApp=bs,e.setAccessToken=su,e.setAndroidBottomNavigationBar=Mu,e.setIOSBottomSafeArea=ju,e.setNavigationBarColor=Ei,e.setNavigationBarLeftButton=Ai,e.setNavigationBarTitle=wi,e.setStatusBar=Bu,e.setStorage=Qi,e.setupAd=jc,e.showOAWidget=Vc,e.showToast=ka,e.startBeaconDiscovery=So,e.stopBeaconDiscovery=Oo,e.unfollowOA=ra,e.vibrate=cs,e.viewOAQr=Ga,Object.defineProperty(e,"__esModule",{value:!0})}));
|