zmp-sdk 2.39.6 → 3.0.9
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/constants.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 +3 -3
- package/package.json +1 -1
package/browser.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @timeBuild 29-07-2024
|
|
2
|
+
* @timeBuild 29-07-2024 20:34:38
|
|
3
3
|
* @license zmp-sdk
|
|
4
4
|
*
|
|
5
5
|
* Copyright @ 2024. Zalo Group.
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(){"use strict";function e(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}var t,n=1048576,r=window.zAppID,i=window.APP_ID,o="https://zalo.me/s",a="https://h5.zdn.vn/zapps",s="h5.zdn.vn",u="/zapps",c={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSION:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType",UTOKEN_ZPI:"h5.zdn.vn_utoken_zpi",GTOKEN_ZPI:"h5.zdn.vn_gtoken_zpi",ZPP_ZPI:"h5.zdn.vn_zpp_zpi",ZPT_ZPI:"h5.zdn.vn_zpt_zpi"},l={GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token",GET_LIST_USER_INFO:"https://graph.zalo.me/v2.0/me/friends/list",CREATE_ORDER:"https://payment-mini.zalo.me/api/order/create",GET_APP_INFO:"https://h5.zalo.me/apps/get-info",SEND_ACTION_LOG:"https://h5.zalo.me/log/async",CREATE_SHARE_LINK:"https://h5.zalo.me/openapi/create-sharelink",CHECK_INTERACT_OA:"https://h5.zalo.me/openapi/check-interact-oa",GET_AUTH_SETTING:"https://h5.zalo.me/apis/users/auth-settings"};!function(e){e.REQUEST="REQUEST",e.MODIFIED_REQUEST="MODIFIED_REQUEST",e.RESPONSE="RESPONSE",e.MODIFIED_RESPONSE="MODIFIED_RESPONSE",e.NOT_FOUND="NOT_FOUND"}(t||(t={}));var d,p,f,h,m,v,y,g,_,w,b,T,E,S,O,P,A,I,k,C,N,M,R=0,x=-2e3,D=-1400,j=-1500,U=-1401,L=-1404,B=-1408,Z=-2004,z=-2005,W="Success",F="Unknown error. Please try again later.",G="Request timeout. Please try again later.",H="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",V="Login failed",K="This API is not supported in this version of Zalo",J="User Authentication Required. Please grant User Authentication permission before requesting User Permission",q="Unable to pick media",$="Unable to save image",Q={SUCCESS:{code:R,message:W},UNKNOWN_ERROR:{code:x,message:F},UNAUTHORIZED:{code:U,message:H},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:L,message:K},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:B,message:G},USER_DENIED:{code:-2002,message:"User denied"},USER_CANCEL:{code:-2003,message:"User cancel"}},Y={GET_DOWNLOADED_STICKER:{haveCallback:!0},OPEN_SHARE_STICKER:{},OPEN_PROFILE:{requireAccessToken:!0},OPEN_FEED_DETAIL:{},OPEN_FRIEND_RADA:{},OPEN_INAPP:{},OPEN_OUTAPP:{requireAccessToken:!0},OPEN_PAGE:{},OPEN_PHOTODETAIL:{},OPEN_GALARY:{},OPEN_GAMECENTER:{},OPEN_GAMENEWS:{},OPEN_TAB_CONTACT:{},OPEN_TAB_SOCIAL:{},OPEN_FRIENDSUGGEST:{},OPEN_GROUPLIST:{},OPEN_NEARBY:{},OPEN_ROOM:{},OPEN_STICKERSTORE:{},OPEN_CREATECHAT:{},COPY_LINK_CATESTICKER:{},REQUEST_BUY_STICKER:{},OPEN_CHAT:{requireAccessToken:!0},OPEN_TAB_CHAT:{},OPEN_CHATGROUP:{},OPEN_ADDFRIEND:{},OPEN_TAB_MORE:{},OPEN_POSTFEED:{requireAccessToken:!0},OPEN_LOGINDEVICES:{},OPEN_SENDSTICKER:{},REPORT_ABUSE:{haveCallback:!0},FOLLOW_OA:{haveCallback:!0,requireAccessToken:!0},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:Q.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:Q.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:Q.USER_DENIED}},iOS:{"-2":{mapTo:Q.USER_DENIED}}}},CHANGE_TITLE_HEADER:{skipJump:!0},WEBVIEW_CLEARCACHE:{},WEBVIEW_CONFIRMCACHE:{},WEBVIEW_ISVISIBLE:{},WEBVIEW_NETWORKTYPE:{skipJump:!0},CHANGE_BUTTON_HEADER:{},CREATE_OPTIONS_MENU:{skipJump:!0,haveCallback:!0},CREATE_SHORTCUT:{requireAccessToken:!0},CHANGE_ACTIONBAR_LEFTBUTTON_TYPE:{skipJump:!0,haveCallback:!0},WINDOW_CLOSE:{skipJump:!0,haveCallback:!0},WEBVIEW_CHECKRESERROR:{},IAP_REQUESTPAYMENT:{haveCallback:!0},ZBROWSER_GETSTATS:{},ZBROWSER_JSBRIDGE:{skipJump:!0,haveCallback:!0},PROMPT_AUTHENTICATION:{},CHANGE_ACTIONBAR_COLOR:{skipJump:!0},PROMPT_AUTHENTICATION_CHECK_STATE:{},OPEN_APPSTORE:{},GET_LOCATION:{haveCallback:!0,errorList:{android:{"-1":{mapTo:Q.USER_DENIED}},iOS:{"-1":{mapTo:Q.USER_DENIED}}}},QUERY_LOCATION_HIDE:{haveCallback:!0},SHOW_TOAST:{haveCallback:!0,timeout:2},OPEN_APP:{},HIDE_KEYBOARD:{},OPEN_PHONE:{},OPEN_QR:{},OPEN_SMS:{},VIEW_MYQR:{haveCallback:!0,timeout:!0,requireAccessToken:!0},KEEP_SCREEN:{haveCallback:!0,timeout:2},CHANGE_AUTOROTATE:{skipJump:!0},CHECK_APP_INSTALLED:{},QUERY_SHOW:{},QUERY_HIDE:{},OPEN_INAPPRW:{},ZALORUN_GETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_SETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_GETDAYSTEP:{haveCallback:!0},ZALORUN_FORCESUBMITDATA:{haveCallback:!0},ZALORUN_SETWEIGHT:{haveCallback:!0},OPEN_PROFILE_EXT:{},DOWNLOAD_CATE:{haveCallback:!0},JUMP_LOGIN:{skipJump:!0,whiteList:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{},OPEN_ADTIMA_ADS:{},GET_ADIDCLIENT:{},SCAN_IBEACON:{},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:z,message:$},needMoreDetail:!0},"-102":{mapTo:{code:z,message:$},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:z,message:$},needMoreDetail:!0}}}},OPEN_MP:{versionLive:{iOS:402}},CHANGE_ACTIONBAR:{haveCallback:!0,timeout:2,versionLive:{iOS:402},skipJump:!0},ZBROWSER_MPDS:{haveCallback:!0,timeout:2,versionLive:{iOS:402}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:Q.USER_DENIED},"-101":{mapTo:Q.USER_DENIED}},iOS:{"-1":{mapTo:Q.USER_DENIED},"-10":{mapTo:Q.USER_DENIED}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:Q.USER_CANCEL}},iOS:{"-101":{mapTo:Q.USER_CANCEL}}}},GET_SUPPORTED_ACTIONS:{whiteList:!0},MP_JOIN_WIFI:{haveCallback:!0,timeout:!0,versionLive:{android:0,iOS:0},havePermission:!1,whiteList:!1},PICK_MEDIA:{requireAccessToken:!0,versionLive:{iOS:440},errorList:{android:{"-101":{mapTo:Q.USER_CANCEL},999:{mapTo:{code:Z,message:q},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:Z,message:q}}}}},MP_CLOSE_LOADINGVIEW:{skipJump:!0},CHANGE_BOTTOMBAR:{haveCallback:!0,timeout:2,skipJump:!0},MA_MENU_MINIMIZE:{skipJump:!1,versionLive:{iOS:520}},MA_MENU_PERMISSION:{skipJump:!1,versionLive:{iOS:520}},MA_MENU_FAVORITES:{skipJump:!1,versionLive:{iOS:520}},MP_SEND_NOTIFICATION:{skipJump:!1,versionLive:{iOS:530},errorList:{android:{"-1":{mapTo:Q.USER_DENIED}},iOS:{"-1":{mapTo:Q.USER_DENIED}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1},MP_USER_AUTHORIZE:{skipJump:!1},MP_SELECT_PAYMENT_METHOD:{skipJump:!1}},X={android:{"-4":Q.DECODE_FAILED,"-5":Q.CLIENT_NOT_SUPPORT,"-14":Q.TIME_OUT},iOS:{"-9":Q.DECODE_FAILED,"-5":Q.CLIENT_NOT_SUPPORT,"-14":Q.TIME_OUT}},ee={android:12100615,iOS:460,wp:0,unknown:0},te=5*n,ne={CREATE_ORDER:process.env.CREATE_ORDER,CREATE_IAP_ORDER:process.env.CREATE_IAP_ORDER,GET_TRANSACTION:process.env.GET_TRANSACTION,GET_ORDER_STATUS:process.env.GET_ORDER_STATUS},re=process.env.PAYMENT_H5_URL,ie="DEFERRED",oe="IMMEDIATE_AND_CHARGE_FULL_PRICE",ae={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},se=5,ue=6,ce="#1843EF",le=0,de={"-12101":"Invalid params","-12102":"Session expire","-12103":"Not permission","-12104":"Not Authorize","-12105":"Unknown exception","-12106":"Cannot create order","-12107":"Transaction not found","-12108":"Cannot update order","-12109":"Cannot decode param","-12110":"Version not support","-12111":"Receipt expire","-12112":"Product not found","-12113":"Subscription other GW","-12114":"Product already subcription","-12115":"Not exist","-12116":"Already exist","-12117":"Not allow","-12118":"Not permit","-12119":"Internal error","-2":"Unable to pay","-6":"Unable to register","-7":"Registered account","-832":"Purchased by another account","-833":"Register for another account","-834":"Unable to register","-2010":"System is maintaining","-3999":"Not in Vietnam","-12129":"Purchased by another account",123:"An error has occurred"};function pe(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function fe(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){pe(o,r,i,a,s,"next",e)}function s(e){pe(o,r,i,a,s,"throw",e)}a(void 0)}))}}function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function me(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ve(e,t){if(e){if("string"==typeof e)return he(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?he(e,t):void 0}}function ye(e){return function(e){if(Array.isArray(e))return he(e)}(e)||me(e)||ve(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ge(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function _e(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{return e.apply(void 0,ye(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function we(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(s)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(u)),isMpWeb:window.location.hostname.includes("localhost")}}_e.async=function(e){return fe((function(){var t,n,r,i,o=arguments;return ge(this,(function(a){switch(a.label){case 0:for(t=o.length,n=new Array(t),r=0;r<t;r++)n[r]=o[r];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.apply(void 0,ye(n))];case 2:return[2,a.sent()];case 3:return i=a.sent(),"undefined"!=typeof console&&console.error&&console.error(i),[2,null];case 4:return[2]}}))}))},function(e){e.none="none",e.wifi="wifi",e.cellular="cellular",e.unknown="unknown"}(d||(d={})),function(e){e.wp="wp",e.android="android",e.iOS="iOS",e.unknown="unknown"}(p||(p={})),function(e){e.AppPaused="h5.event.paused",e.AppResumed="h5.event.resumed",e.NetworkChanged="h5.event.connection.changed",e.OnDataCallback="h5.event.webview.result",e.WebviewClosed="h5.event.webview.close",e.OpenApp="h5.event.open.mp",e.AppClose="h5.event.action.close",e.PaymentCallback="payment.callback",e.PaymentResult="action.payment.result",e.PaymentClose="action.payment.close"}(f||(f={})),function(e){e.DOING="doing",e.DONE="done"}(h||(h={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa",e[e.aliasOA=2]="aliasOA"}(m||(m={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa"}(v||(v={})),function(e){e[e.image=1]="image",e[e.link=4]="link",e[e.profile=5]="profile"}(y||(y={})),function(e){e[e.image=1]="image",e[e.gif=11]="gif",e[e.video=12]="video",e[e.link=4]="link",e[e.oa=5]="oa",e[e.zmp=20]="zmp",e[e.multi_image=21]="multi_image",e[e.zmp_deep_link=4]="zmp_deep_link",e[e.text=22]="text"}(g||(g={})),function(e){e[e.auto=1]="auto",e[e.portrait=2]="portrait",e[e.landscape=3]="landscape"}(_||(_={})),function(e){e[e.oneShot=0]="oneShot"}(w||(w={})),function(e){e[e.zcamera=3]="zcamera",e[e.zcamera_photo=1]="zcamera_photo",e[e.zcamera_video=2]="zcamera_video",e[e.zcamera_scan=7]="zcamera_scan",e[e.photo=4]="photo",e[e.video=5]="video",e[e.file=6]="file"}(b||(b={})),function(e){e.SUBSCRIPTION="SUBSCRIPTION",e.ONETIME="ONETIME"}(T||(T={})),function(e){e[e.UNKNOW=0]="UNKNOW",e[e.DEFERRED=1]="DEFERRED",e[e.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE"}(E||(E={})),function(e){e[e.normal=1]="normal",e[e.hidden=0]="hidden",e[e.transparent=2]="transparent"}(S||(S={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(O||(O={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(P||(P={})),function(e){e[e.left=0]="left",e[e.center=1]="center"}(A||(A={})),function(e){e.OnFrameCallback="h5.event.camera.frame",e.OnStartCallback="h5.event.camera.start",e.OnStopCallback="h5.event.camera.stop"}(I||(I={})),function(e){e.FRONT="user",e.BACK="environment"}(k||(k={})),function(e){e.WEBP="image/webp",e.PNG="image/png",e.JPEG="image/jpeg"}(C||(C={})),function(e){e.HIGH="high",e.NORMAL="normal",e.LOW="low"}(N||(N={})),function(e){e.VIDEO="video",e.AUDIO="audio"}(M||(M={}));var be,Te=function(e){return e.isAndroid?p.android:e.isIOS?p.iOS:p.unknown};function Ee(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Se(){var e=function(){var e=_e((function(){return window.navigator.userAgent.toLowerCase()}))();if(e){var t=function(e){return{isAndroid:/android/i.test(e)&&!/iemobile/.test(e),isIOS:/iphone|ios|ipad|ipod/.test(e)&&!/iemobile/.test(e),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(e),isZalo:/zalo/.test(e)}}(e);return{appEnv:we(),platform:t,platformName:Te(t),zaloVersion:Ee(e).trim()}}}();if(e)return e}var Oe=(null===(be=Se())||void 0===be?void 0:be.appEnv)||{};function Pe(e){Pe.on&&Pe.engine(e)}Pe.on=!1,Pe.engine=function(e){var t=e.name,n=e.type,r=e.state,i=e.request,o=e.response,a=e.stage;console[n]([t,a,r,i,o].filter(Boolean).map((function(e){return"object"==typeof e?JSON.stringify(e):e})).join("; "))};var Ae=function(e,n){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==n||null===(r=n.fail)||void 0===r||r.call(n,i),Pe({stage:t.NOT_FOUND,type:"error",name:e,request:n,state:"fail",response:i})};function Ie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ke(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ie(e,t,n[t])}))}return e}function Ce(e,t){return function(e){if(Array.isArray(e))return e}(e)||me(e)||ve(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ne="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Me(){throw new Error("setTimeout has not been defined")}function Re(){throw new Error("clearTimeout has not been defined")}var xe=Me,De=Re;function je(e){if(xe===setTimeout)return setTimeout(e,0);if((xe===Me||!xe)&&setTimeout)return xe=setTimeout,setTimeout(e,0);try{return xe(e,0)}catch(t){try{return xe.call(null,e,0)}catch(t){return xe.call(this,e,0)}}}"function"==typeof Ne.setTimeout&&(xe=setTimeout),"function"==typeof Ne.clearTimeout&&(De=clearTimeout);var Ue,Le=[],Be=!1,Ze=-1;function ze(){Be&&Ue&&(Be=!1,Ue.length?Le=Ue.concat(Le):Ze=-1,Le.length&&We())}function We(){if(!Be){var e=je(ze);Be=!0;for(var t=Le.length;t;){for(Ue=Le,Le=[];++Ze<t;)Ue&&Ue[Ze].run();Ze=-1,t=Le.length}Ue=null,Be=!1,function(e){if(De===clearTimeout)return clearTimeout(e);if((De===Re||!De)&&clearTimeout)return De=clearTimeout,clearTimeout(e);try{De(e)}catch(t){try{return De.call(null,e)}catch(t){return De.call(this,e)}}}(e)}}function Fe(e,t){this.fun=e,this.array=t}Fe.prototype.run=function(){this.fun.apply(null,this.array)};function Ge(){}var He=Ge,Ve=Ge,Ke=Ge,Je=Ge,qe=Ge,$e=Ge,Qe=Ge;var Ye=Ne.performance||{},Xe=Ye.now||Ye.mozNow||Ye.msNow||Ye.oNow||Ye.webkitNow||function(){return(new Date).getTime()};var et=new Date;var tt,nt={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Le.push(new Fe(e,t)),1!==Le.length||Be||je(We)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:He,addListener:Ve,once:Ke,off:Je,removeListener:qe,removeAllListeners:$e,emit:Qe,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*Xe.call(Ye),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-et)/1e3}},rt=nt,it="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ot(e){return e&&e.constructor===Symbol?"symbol":typeof e}function at(e){return"function"==typeof window.Debug?window.Debug(e):function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n]}}!function(e){!function(t){var n="object"==typeof it?it:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),r=i(e);function i(e,t){return function(n,r){"function"!=typeof e[n]&&Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0===n.Reflect?n.Reflect=e:r=i(n.Reflect,r),function(e){var t=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return re(Object.create(null))}:a?function(){return re({__proto__:null})}:function(){return re({})},has:s?function(e,n){return t.call(e,n)}:function(e,t){return t in e},get:s?function(e,n){return t.call(e,n)?e[n]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),l="object"==typeof rt&&rt.env&&"true"===rt.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?te():Set,f=new(l||"function"!=typeof WeakMap?ne():WeakMap);function h(e,t,n,r){if(D(n)){if(!G(e))throw new TypeError;if(!V(t))throw new TypeError;return S(e,t)}if(!G(e))throw new TypeError;if(!L(t))throw new TypeError;if(!L(r)&&!D(r)&&!j(r))throw new TypeError;return j(r)&&(r=void 0),O(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!L(n))throw new TypeError;if(!D(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!L(n))throw new TypeError;return D(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!L(t))throw new TypeError;return D(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!L(t))throw new TypeError;return D(n)||(n=F(n)),I(e,t,n)}function _(e,t,n){if(!L(t))throw new TypeError;return D(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!L(t))throw new TypeError;return D(n)||(n=F(n)),C(e,t,n)}function b(e,t){if(!L(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function T(e,t){if(!L(e))throw new TypeError;return D(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!L(t))throw new TypeError;D(n)||(n=F(n));var r=P(t,n,!1);if(D(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}function S(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!D(r)&&!j(r)){if(!V(r))throw new TypeError;t=r}}return t}function O(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!D(o)&&!j(o)){if(!L(o))throw new TypeError;r=o}}return r}function P(e,t,n){var r=f.get(e);if(D(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(D(i)){if(!n)return;i=new d,r.set(t,i)}return i}function A(e,t,n){if(I(e,t,n))return!0;var r=X(t);return!j(r)&&A(e,r,n)}function I(e,t,n){var r=P(t,n,!1);return!D(r)&&z(r.has(e))}function k(e,t,n){if(I(e,t,n))return C(e,t,n);var r=X(t);return j(r)?void 0:k(e,r,n)}function C(e,t,n){var r=P(t,n,!1);if(!D(r))return r.get(e)}function N(e,t,n,r){P(n,r,!0).set(e,t)}function M(e,t){var n=R(e,t),r=X(e);if(null===r)return n;var i=M(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new p,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,d=i;l<d.length;l++){c=d[l];o.has(c)||(o.add(c),a.push(c))}return a}function R(e,t){var n=[],r=P(e,t,!1);if(D(r))return n;for(var i=q(r.keys()),o=0;;){var a=Q(i);if(!a)return n.length=o,n;var s=$(a);try{n[o]=s}catch(e){try{Y(i)}finally{throw e}}o++}}function x(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function D(e){return void 0===e}function j(e){return null===e}function U(e){return"symbol"==typeof e}function L(e){return"object"==typeof e?null!==e:"function"==typeof e}function B(e,t){switch(x(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",i=J(e,r);if(void 0!==i){var o=i.call(e,n);if(L(o))throw new TypeError;return o}return Z(e,"default"===n?"number":n)}function Z(e,t){if("string"===t){var n=e.toString;if(H(n))if(!L(i=n.call(e)))return i;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i}else{var r;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i;var i,o=e.toString;if(H(o))if(!L(i=o.call(e)))return i}throw new TypeError}function z(e){return!!e}function W(e){return""+e}function F(e){var t=B(e,3);return U(t)?t:W(t)}function G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function H(e){return"function"==typeof e}function V(e){return"function"==typeof e}function K(e){switch(x(e)){case 3:case 4:return!0;default:return!1}}function J(e,t){var n=e[t];if(null!=n){if(!H(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!H(t))throw new TypeError;var n=t.call(e);if(!L(n))throw new TypeError;return n}function $(e){return e.value}function Q(e){var t=e.next();return!t.done&&t}function Y(e){var t=e.return;t&&t.call(e)}function X(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function te(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function ne(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function re(e){return e.__=void 0,delete e.__,e}e("decorate",h),e("metadata",m),e("defineMetadata",v),e("hasMetadata",y),e("hasOwnMetadata",g),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",T),e("deleteMetadata",E)}(r)}()}(tt||(tt={}));var st=Object.prototype.toString;var ut="[object Null]",ct="[object Undefined]";function lt(e){return null==e?void 0===e?ct:ut:function(e){return st.call(e)}(e)}function dt(e){return null!=e&&"object"==typeof e}var pt={isEmpty:function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length},isNull:function(e){return null===e},isUndefined:function(e){return void 0===e},isFunction:function(e){return"function"==typeof e},isObject:function(e){return null!==e&&("function"==typeof e||"object"==typeof e)},isString:function(e){return null!=e&&"string"==typeof e.valueOf()},isNumber:function(e){return"number"==typeof e||dt(e)&&"[object Number]"==lt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return dt(e)&&"[object RegExp]"==lt(e)},get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=function(n){return String.prototype.split.call(t,n).filter(Boolean).reduce((function(e,t){return null!=e?e[t]:e}),e)},i=r(/[,[\]]+?/)||r(/[,[\].]+?/);return void 0===i||i===e?n:i},isPromise:function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}};function ft(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ht(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mt(e){return mt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},mt(e)}function vt(e){return mt(e)}function yt(e,t,n){return yt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=vt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},yt(e,t,n)}function gt(e,t,n){return yt(e,t,n)}function _t(e,t){return _t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_t(e,t)}function wt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_t(e,t)}function bt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=vt(e);if(t){var i=vt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==ot(t)&&"function"!=typeof t?bt(e):t}(this,n)}}var Et,St,Ot=(Et=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],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){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(d-1);c<d;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),d){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(p=1,u=new Array(d-1);p<d;p++)u[p-1]=arguments[p];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},Et(St={exports:{}},St.exports),St.exports),Pt="ACTION_CALLBACK";var At=function(e){wt(n,e);var t=Tt(n);function n(){var e;return ft(this,n),(e=t.apply(this,arguments)).debug=at("zmp:event-emitter"),e}var r=n.prototype;return r.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},r.on=function(e,t,r){var i=this;if(e===Pt||e===f.PaymentCallback)return gt(vt(n.prototype),"on",this).call(this,e,t,r);this.debug("register ".concat(String(e),": ").concat(r));return gt(vt(n.prototype),"on",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},r.once=function(e,t,r){var i=this;if(e===Pt)return gt(vt(n.prototype),"once",this).call(this,e,t,r);this.debug("register once ".concat(String(e),": ").concat(r));return gt(vt(n.prototype),"once",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},n}(Ot);function It(e){At.getInstance().emit(Pt,e)}function kt(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){It({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){var r=at("zmp:zalo_h5_event_handler");r("eventId: ".concat(e,", eventName: ").concat(t,", eventData: ").concat(n));var o=on(n);r("stringToData",o);var a=function(e,t){try{if(e===f.OpenApp){var n=t.url,r=new URL(n),o=r.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(o||"/").concat(r.search)}}return t}catch(e){return t}}(t,o);At.getInstance().emit(t,e,a)}},window.zaloNative2JS={nativeCall:function(e,t,n){At.getInstance().emit(f.PaymentCallback,e,t,n)}};var Ct={encode:kt,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:kt(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":ot(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":ot(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Nt={},Mt=function(e,t,n){var r=t||"default";return function(){return(r in Nt?Nt[r](e,n):e).apply(this,arguments)}};Mt.setWrapper=function(e){Nt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Rt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function xt(e){try{return null===e?Rt:JSON.parse(e)}catch(e){return Rt}}var Dt,jt={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Ct.encode(n);"post"!=t&&(e=Ct.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=Mt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Mt((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(xt(e.responseText))},o.onerror=function(e){e.responseText?r(xt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Ut=jt,Lt=(Dt=fe((function(e,t,n){var r,i,o,a;return ge(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},pt.isUndefined(n)||(r.currentVersion=n),i=Ct.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 Dt.apply(this,arguments)});function Bt(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Ut.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 Zt=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},zt=function(){var e,t,n=Number((null===(e=Se())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=Se())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Wt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Ft,Gt,Ht=function(){function e(t,n,r,i){ft(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}(),Vt=function(e,t){return Wt(e,Ht)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Wt(e,Error)?new Ht(x,e.message,t).toJSON():pt.isEmpty(null==e?void 0:e.message)||pt.isEmpty(null==e?void 0:e.code)?new Ht(x,F,t,e).toJSON():new Ht(e.code,e.message,t,e.detail).toJSON()}(e,t)},Kt=(Ft=fe((function(e){var t;return ge(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,ke({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Ft.apply(this,arguments)}),Jt=fe((function(){return ge(this,(function(e){return[2,new Promise(function(){var e=fe((function(e,t){var n,r,i,o;return ge(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,en.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=en.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new Ht(U,H,"getSetting")),[4,Kt(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new Ht(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)}}())]}))})),qt=function(){var e,t,n,r=Se(),i={},o=At.getInstance(),a=[],s=!1;return s||(t=function(e){var t=e.serialId,n=an(e.result),r=ln(null==n?void 0:n.action),o=pt.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,s=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===o){var c=JSON.parse(null==n?void 0:n.data);o=pt.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,s=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:o,error_message:s,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&i[t]){var d=i[t],p=d.callback,f=d.timeout,h=d.isMultiCallback,m=d.options;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?pt.isFunction(r)&&r(e):pt.isFunction(i)&&i(e)}(l,p),!h&&delete i[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){}a.push(v)}},At.getInstance().on(Pt,t),o.on(f.AppPaused,(function(){if(a.length>0){var e=a;a=[],Bt(e)}})),e?clearInterval(e):e=setInterval((function(){if(a.length>0){var e=a;a=[],Bt(e)}}),5e3),s=!0),n=fe((function(e,t,n,o){var a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,O,P,A;return ge(this,(function(I){switch(I.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c="action.".concat(e.replace(/\_/g,".").toLowerCase()),(null==o?void 0:o.actionName)&&o.actionName.length>0&&(c=null==o?void 0:o.actionName),l=(null==o?void 0:o.isMultiCallback)||!1,d=!1!==(null==o?void 0:o.timeout)&&((null==o?void 0:o.timeout)||!0),p=(null==o?void 0:o.haveCallback)||!1,f=(null==o?void 0:o.skipJump)||!1,h=(null==o?void 0:o.requireAccessToken)||!1,m=dn(c),t&&n&&(i[u]={options:t,callback:n,isMultiCallback:l},d&&p&&(i[u].timeout=setTimeout((function(){return It({serialId:u,result:{error_code:B,error_message:G,data:{timeout:d},action:e}}),null}),!0===d?8e3:1e3*d))),m?[4,Jt()]:[3,2];case 1:if(!1===(null==(y=I.sent())||null===(v=y.authSetting)||void 0===v?void 0:v["scope.userInfo"]))return It({serialId:u,result:{error_code:U,error_message:J,data:{isMobile:null==r||null===(g=r.platform)||void 0===g?void 0:g.isMobile},action:e}}),[2];I.label=2;case 2:return _=ln(c),!(null==r||null===(a=r.platform)||void 0===a?void 0:a.isMobile)||!e||pt.isUndefined(ZaloJavaScriptInterface)||r.platform.isIOS&&!rn(e)||_&&!1===_.isSupported?(It({serialId:u,result:{error_code:L,error_message:K,data:{isMobile:null==r||null===(w=r.platform)||void 0===w?void 0:w.isMobile},action:e}}),[2]):(b=nn(t),f?[3,4]:[4,en.getJSAccessToken()]);case 3:return E=I.sent(),[3,5];case 4:E="",I.label=5;case 5:T=E,I.label=6;case 6:return I.trys.push([6,10,,11]),f||!h?[3,8]:[4,en.getAccessToken()];case 7:return O=I.sent(),[3,9];case 8:O="",I.label=9;case 9:return S=O,[3,11];case 10:return P=I.sent(),It({serialId:u,result:{error_code:null==P?void 0:P.code,error_message:null==P?void 0:P.message,action:e}}),[2];case 11:return A=r.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(T,c,S,b,A)]}}))})),function(e,t,r,i){return n.apply(this,arguments)}}(),$t={success:function(e,t){return{code:R,message:t||W,data:e||{}}},error:{badRequest:function(e){return new Ht(D,e)},loginFailed:function(e){return new Ht(U,"".concat(V,": ").concat(e))},loginRequired:function(){return new Ht(U,H)},cannotGetShareInfo:function(){return new Ht(j,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(de).find((function(t){return t===e.toString()}));return new Ht(e,t||F)},clientNotSupport:function(){return new Ht(L,K)}}},Qt=(Gt=function(e){var t,n,r,i=null===(t=Se())||void 0===t?void 0:t.platformName,o=e.action.replace("action.","").replace(/\./g,"_").toUpperCase(),a=Y[o],s=(null==a?void 0:a.skipJump)||!1,u=(null==a?void 0:a.errorList)||{};if("JUMP_LOGIN"===o)return new Ht(x,"Can not get auth code: ".concat(e.error_message));if(en.jumpStatus!==h.DONE&&!s)return new Ht(Q.UNAUTHORIZED.code,Q.UNAUTHORIZED.message);if("permission required!"===String(e.error_message).toLowerCase()||"no permission!"===String(e.error_message).toLowerCase())return new Ht(Q.FORBIDDEN.code,Q.FORBIDDEN.message);if(i&&(null===(n=X[i])||void 0===n?void 0:n[e.error_code]))return new Ht(X[i][e.error_code].code,X[i][e.error_code].message);var c=null==u||null===(r=u[i])||void 0===r?void 0:r[String(e.error_code)];if(c){var l,d,p,f=null===(l=c.mapTo)||void 0===l?void 0:l.message;return(null==c?void 0:c.needMoreDetail)&&(f="".concat(null==c||null===(p=c.mapTo)||void 0===p?void 0:p.message,": ").concat(e.error_message)),new Ht(null===(d=c.mapTo)||void 0===d?void 0:d.code,f)}return new Ht(e.error_code,e.error_message)},function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=pt.isEmpty(n)?void 0:n[r];if(o)return Pe({stage:t.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Gt(i):null==i?void 0:i.data)}}return pt.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=Y[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){qt(e,n,o,ke({},i,a))}),s)}),Yt=function(){var e=fe((function(e){return ge(this,(function(t){return[2,new Promise((function(t,n){Qt("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){pt.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Xt=function(){function e(){ft(this,e),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 n,o,s,u=e.prototype;return u.jump=function(){var e=this;return fe((function(){return ge(this,(function(n){return[2,new Promise((function(n,r){e._jumpStatus?e._jumpStatus===h.DONE?n(h.DONE):n(h.DOING):(e._jumpStatus=h.DOING,Pe({stage:t.REQUEST,type:"log",name:"jump"}),qt("JUMP_LOGIN",{},{success:function(t){var r=t.data;e._miniProgramConfig=(null==r?void 0:r.miniProgramConfig)||{};var i=(null==r?void 0:r.cookiesOAuthLogins)||[],o=i.find((function(e){return e.name===c.JS_TOKEN}));o&&(e._jsAccessToken=o.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(o.value)),e._cookies=i;var a=e._cookies.find((function(e){return e.name===c.ZOAUTH}));(null==a?void 0:a.value)||Bt([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),n(h.DONE)},fail:function(e){Bt([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),r(e)}},{skipJump:!0}))}))]}))}))()},u.loginZaloV3=function(e,t,n){var r=this;return fe((function(){var i;return ge(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=fe((function(e){var t,n,i;return ge(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()]}}))}))()},u.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 fe((function(){var i,o;return ge(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),pt.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,ke({method:"POST",body:i},o)).then(function(){var e=fe((function(e){var t,n,i,o;return ge(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()]}}))}))()},u.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return fe((function(){var n,o,a,s,u,l,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=fe((function(){return ge(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 ge(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 d=m.sent(),[3,7];case 6:d=!0,m.label=7;case 7:if(!d)throw a.getAccessTokenCount--,Bt([{action:l,error:-104,message:"no user auth",data:{}}]),$t.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 p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(i,r,s)];case 11:p=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),p="",console.log("Can not get access token",f),Bt([{action:l,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return a.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(Bt([{action:l,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject($t.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw a.getAccessTokenCount--,Bt([{action:l,error:-102,message:"no oauth",data:{}}]),$t.error.loginFailed("Zalo app has not been activated")}}))}))()},u.verifyUserAuthorized=function(){var e=this;return fe((function(){var t,n,r,i,o,a;return ge(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=ln("action.mp.user.authorize"))&&r.isSupported?[4,Jt()]:[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,Yt()];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]}}))}))()},u.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},u.getJSAccessToken=function(){var e=this;return fe((function(){var t;return ge(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)]}}))}))()},u.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},u.jumpAndGetToken=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;return new Promise(function(){var r=fe((function(r){var i,o,a,s;return ge(this,(function(u){switch(u.label){case 0:return!t&&n._cookies.length>0?pt.isString(e)?(i=n._cookies.find((function(t){return t.name===e})),[2,r(null==i?void 0:i.value)]):[2,r("")]:(t&&n._jumpStatus===h.DONE&&(n._jumpStatus=void 0),o={name:e,cb:function(e){return r(e)}},[4,n.jump()]);case 1:return(a=u.sent())===h.DONE?(n._jumpStatus=a,n.WAITING_QUEUE.length&&(n.WAITING_QUEUE.forEach((function(e){var t=n._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),n.WAITING_QUEUE=[]),s=n._cookies.find((function(e){return e.name===o.name})),o.cb(null==s?void 0:s.value)):n.WAITING_QUEUE.push(o),[2]}}))}));return function(e){return r.apply(this,arguments)}}())},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},n=e,(o=[{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}}])&&ht(n.prototype,o),s&&ht(n,s),e}(),en=Xt.getInstance(),tn=at("zmp:utils:common"),nn=function(e){if(pt.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(nn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+nn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},rn=function(e){var t,n,r=Y[e],i=(null===(t=Se())||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},on=function(e){try{if(e){tn(e);var t=e.replace(/\\/g,"").replace(/'/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return tn("formattedValue",t,JSON.parse(t),ot(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return tn("parse json error:",t),e}},an=function(e){if(pt.isObject(JSON)&&JSON.parse&&pt.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 pt.isObject(e)?e:new Function("return "+e)()},sn=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""},un=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var cn=function(e){return"hidden"===e?S.hidden:"transparent"===e?S.transparent:S.normal},ln=function(e){if(void 0!==e){var t=en.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},dn=function(e){if(void 0===e)return!1;var t=en.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},pn=function(){var e=fe((function(){return ge(this,(function(e){return[2,new Promise(function(){var e=fe((function(e,t){var n;return ge(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,en.jumpAndGetToken()];case 1:return t.sent(),n=en.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 fn(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=$t.error.badRequest(s);throw c.detail=a,Vt(c,e)}u.push(i.data)}));var c=r.apply(void 0,ye(u));return pt.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!pt.isNull(a)&&pt.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Vt(t,e);if(!pt.isNull(s)&&pt.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!pt.isNull(s)&&pt.isFunction(s))return s(t);throw Vt(t,e)}}function hn(e){return mn.apply(this,arguments)}function mn(){return(mn=fe((function(e){return ge(this,(function(t){return[2,fn("login",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,en.jumpAndGetToken(c.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Oe.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ae("login",{}))]}}))})))]}))}))).apply(this,arguments)}function vn(e){return yn.apply(this,arguments)}function yn(){return(yn=fe((function(e){return ge(this,(function(t){return[2,fn("getAccessToken",[],[e],fe((function(){var e;return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,pn()]:[3,3];case 1:return e=!t.sent(),[4,en.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Oe.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ae("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var gn,_n="2.39.6";function wn(){return fn("getVersion",[],[],(function(){return _n}))}function bn(){var e,t;return{version:sn("version-id")||"",apiVersion:_n,zaloVersion:(null===(e=Se())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=Se())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function Tn(){return fn("getSystemInfo",[],[],(function(){return bn()}))}!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(gn||(gn={}));const En=gn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Sn=e=>{switch(typeof e){case"undefined":return En.undefined;case"string":return En.string;case"number":return isNaN(e)?En.nan:En.number;case"boolean":return En.boolean;case"function":return En.function;case"bigint":return En.bigint;case"symbol":return En.symbol;case"object":return Array.isArray(e)?En.array:null===e?En.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?En.promise:"undefined"!=typeof Map&&e instanceof Map?En.map:"undefined"!=typeof Set&&e instanceof Set?En.set:"undefined"!=typeof Date&&e instanceof Date?En.date:En.object;default:return En.unknown}},On=gn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Pn extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){const n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,gn.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Pn.create=e=>new Pn(e);const An=(e,t)=>{let n;switch(e.code){case On.invalid_type:n=e.received===En.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case On.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,gn.jsonStringifyReplacer)}`;break;case On.unrecognized_keys:n=`Unrecognized key(s) in object: ${gn.joinValues(e.keys,", ")}`;break;case On.invalid_union:n="Invalid input";break;case On.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${gn.joinValues(e.options)}`;break;case On.invalid_enum_value:n=`Invalid enum value. Expected ${gn.joinValues(e.options)}, received '${e.received}'`;break;case On.invalid_arguments:n="Invalid function arguments";break;case On.invalid_return_type:n="Invalid function return type";break;case On.invalid_date:n="Invalid date";break;case On.invalid_string:"object"==typeof e.validation?"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:gn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case On.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(e.minimum)}`:"Invalid input";break;case On.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(e.maximum)}`:"Invalid input";break;case On.custom:n="Invalid input";break;case On.invalid_intersection_types:n="Intersection results could not be merged";break;case On.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case On.not_finite:n="Number must be finite";break;default:n=t.defaultError,gn.assertNever(e)}return{message:n}};let In=An;function kn(){return In}const Cn=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const u=r.filter((e=>!!e)).slice().reverse();for(const e of u)s=e(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}};function Nn(e,t){const n=Cn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,kn(),An].filter((e=>!!e))});e.common.issues.push(n)}class Mn{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return Rn;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t)n.push({key:await e.key,value:await e.value});return Mn.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:i}=r;if("aborted"===t.status)return Rn;if("aborted"===i.status)return Rn;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),(void 0!==i.value||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}}const Rn=Object.freeze({status:"aborted"}),xn=e=>({status:"dirty",value:e}),Dn=e=>({status:"valid",value:e}),jn=e=>"aborted"===e.status,Un=e=>"dirty"===e.status,Ln=e=>"valid"===e.status,Bn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Zn;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Zn||(Zn={}));class zn{constructor(e,t,n,r){this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._path.concat(this._key)}}const Wn=(e,t)=>{if(Ln(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,error:new Pn(e.common.issues)}};function Fn(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=n?n:t.defaultError},description:i}}class Gn{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Sn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Sn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Mn,ctx:{common:e.parent.common,data:e.data,parsedType:Sn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Bn(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Wn(r,i)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Bn(r)?r:Promise.resolve(r));return Wn(n,i)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const i=e(t),o=()=>r.addIssue({code:On.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(o(),!1))):!!i||(o(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new Ir({schema:this,typeName:Br.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return kr.create(this,this._def)}nullable(){return Cr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ur.create(this,this._def)}promise(){return Ar.create(this,this._def)}or(e){return pr.create([this,e],this._def)}and(e){return vr.create(this,e,this._def)}transform(e){return new Ir({...Fn(this._def),schema:this,typeName:Br.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Nr({...Fn(this._def),innerType:this,defaultValue:t,typeName:Br.ZodDefault})}brand(){return new Dr({typeName:Br.ZodBranded,type:this,...Fn(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Mr({...Fn(this._def),innerType:this,catchValue:t,typeName:Br.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return jr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Hn=/^c[^\s-]{8,}$/i,Vn=/^[a-z][a-z0-9]*$/,Kn=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,Jn=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/;class qn extends Gn{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:On.invalid_string,...Zn.errToObj(n)}),this.nonempty=e=>this.min(1,Zn.errToObj(e)),this.trim=()=>new qn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==En.string){const t=this._getOrReturnCtx(e);return Nn(t,{code:On.invalid_type,expected:En.string,received:t.parsedType}),Rn}const t=new Mn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),Nn(n,{code:On.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),Nn(n,{code:On.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,o=e.data.length<i.value;(r||o)&&(n=this._getOrReturnCtx(e,n),r?Nn(n,{code:On.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Nn(n,{code:On.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)Jn.test(e.data)||(n=this._getOrReturnCtx(e,n),Nn(n,{validation:"email",code:On.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Kn.test(e.data)||(n=this._getOrReturnCtx(e,n),Nn(n,{validation:"uuid",code:On.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Hn.test(e.data)||(n=this._getOrReturnCtx(e,n),Nn(n,{validation:"cuid",code:On.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Vn.test(e.data)||(n=this._getOrReturnCtx(e,n),Nn(n,{validation:"cuid2",code:On.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Nn(n,{validation:"url",code:On.invalid_string,message:i.message}),t.dirty()}else if("regex"===i.kind){i.regex.lastIndex=0;i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Nn(n,{validation:"regex",code:On.invalid_string,message:i.message}),t.dirty())}else if("trim"===i.kind)e.data=e.data.trim();else if("startsWith"===i.kind)e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),Nn(n,{code:On.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty());else if("endsWith"===i.kind)e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),Nn(n,{code:On.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty());else if("datetime"===i.kind){((r=i).precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):0===r.precision?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(n=this._getOrReturnCtx(e,n),Nn(n,{code:On.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else gn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new qn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Zn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Zn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Zn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Zn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Zn.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...Zn.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Zn.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Zn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Zn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Zn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Zn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Zn.errToObj(t)})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function $n(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}qn.create=e=>{var t;return new qn({checks:[],typeName:Br.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Fn(e)})};class Qn extends Gn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==En.number){const t=this._getOrReturnCtx(e);return Nn(t,{code:On.invalid_type,expected:En.number,received:t.parsedType}),Rn}let t;const n=new Mn;for(const r of this._def.checks)if("int"===r.kind)gn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Nn(t,{code:On.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Nn(t,{code:On.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Nn(t,{code:On.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==$n(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Nn(t,{code:On.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Nn(t,{code:On.not_finite,message:r.message}),n.dirty()):gn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Zn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Zn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Zn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Zn.toString(t))}setLimit(e,t,n,r){return new Qn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Zn.toString(r)}]})}_addCheck(e){return new Qn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Zn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Zn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Zn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Zn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Zn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Zn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Zn.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&gn.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Qn.create=e=>new Qn({checks:[],typeName:Br.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...Fn(e)});class Yn extends Gn{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==En.bigint){const t=this._getOrReturnCtx(e);return Nn(t,{code:On.invalid_type,expected:En.bigint,received:t.parsedType}),Rn}return Dn(e.data)}}Yn.create=e=>{var t;return new Yn({typeName:Br.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Fn(e)})};class Xn extends Gn{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==En.boolean){const t=this._getOrReturnCtx(e);return Nn(t,{code:On.invalid_type,expected:En.boolean,received:t.parsedType}),Rn}return Dn(e.data)}}Xn.create=e=>new Xn({typeName:Br.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...Fn(e)});class er extends Gn{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==En.date){const t=this._getOrReturnCtx(e);return Nn(t,{code:On.invalid_type,expected:En.date,received:t.parsedType}),Rn}if(isNaN(e.data.getTime())){return Nn(this._getOrReturnCtx(e),{code:On.invalid_date}),Rn}const t=new Mn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Nn(n,{code:On.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),Nn(n,{code:On.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):gn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new er({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Zn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Zn.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}er.create=e=>new er({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Br.ZodDate,...Fn(e)});class tr extends Gn{_parse(e){if(this._getType(e)!==En.symbol){const t=this._getOrReturnCtx(e);return Nn(t,{code:On.invalid_type,expected:En.symbol,received:t.parsedType}),Rn}return Dn(e.data)}}tr.create=e=>new tr({typeName:Br.ZodSymbol,...Fn(e)});class nr extends Gn{_parse(e){if(this._getType(e)!==En.undefined){const t=this._getOrReturnCtx(e);return Nn(t,{code:On.invalid_type,expected:En.undefined,received:t.parsedType}),Rn}return Dn(e.data)}}nr.create=e=>new nr({typeName:Br.ZodUndefined,...Fn(e)});class rr extends Gn{_parse(e){if(this._getType(e)!==En.null){const t=this._getOrReturnCtx(e);return Nn(t,{code:On.invalid_type,expected:En.null,received:t.parsedType}),Rn}return Dn(e.data)}}rr.create=e=>new rr({typeName:Br.ZodNull,...Fn(e)});class ir extends Gn{constructor(){super(...arguments),this._any=!0}_parse(e){return Dn(e.data)}}ir.create=e=>new ir({typeName:Br.ZodAny,...Fn(e)});class or extends Gn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Dn(e.data)}}or.create=e=>new or({typeName:Br.ZodUnknown,...Fn(e)});class ar extends Gn{_parse(e){const t=this._getOrReturnCtx(e);return Nn(t,{code:On.invalid_type,expected:En.never,received:t.parsedType}),Rn}}ar.create=e=>new ar({typeName:Br.ZodNever,...Fn(e)});class sr extends Gn{_parse(e){if(this._getType(e)!==En.undefined){const t=this._getOrReturnCtx(e);return Nn(t,{code:On.invalid_type,expected:En.void,received:t.parsedType}),Rn}return Dn(e.data)}}sr.create=e=>new sr({typeName:Br.ZodVoid,...Fn(e)});class ur extends Gn{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==En.array)return Nn(t,{code:On.invalid_type,expected:En.array,received:t.parsedType}),Rn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Nn(t,{code:e?On.too_big:On.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(Nn(t,{code:On.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(Nn(t,{code:On.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new zn(t,e,t.path,n))))).then((e=>Mn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new zn(t,e,t.path,n))));return Mn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new ur({...this._def,minLength:{value:e,message:Zn.toString(t)}})}max(e,t){return new ur({...this._def,maxLength:{value:e,message:Zn.toString(t)}})}length(e,t){return new ur({...this._def,exactLength:{value:e,message:Zn.toString(t)}})}nonempty(e){return this.min(1,e)}}var cr;function lr(e){if(e instanceof dr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=kr.create(lr(r))}return new dr({...e._def,shape:()=>t})}return e instanceof ur?ur.create(lr(e.element)):e instanceof kr?kr.create(lr(e.unwrap())):e instanceof Cr?Cr.create(lr(e.unwrap())):e instanceof yr?yr.create(e.items.map((e=>lr(e)))):e}ur.create=(e,t)=>new ur({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Br.ZodArray,...Fn(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(cr||(cr={}));class dr extends Gn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=gn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==En.object){const t=this._getOrReturnCtx(e);return Nn(t,{code:On.invalid_type,expected:En.object,received:t.parsedType}),Rn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ar&&"strip"===this._def.unknownKeys))for(const e in n.data)i.includes(e)||o.push(e);const a=[];for(const e of i){const t=r[e],i=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new zn(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ar){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)o.length>0&&(Nn(n,{code:On.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const r=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new zn(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>Mn.mergeObjectSync(t,e))):Mn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Zn.errToObj,new dr({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,i,o,a;const s=null!==(o=null===(i=(r=this._def).errorMap)||void 0===i?void 0:i.call(r,t,n).message)&&void 0!==o?o:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=Zn.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new dr({...this._def,unknownKeys:"strip"})}passthrough(){return new dr({...this._def,unknownKeys:"passthrough"})}extend(e){return new dr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new dr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>cr.mergeShapes(this._def.shape(),e._def.shape()),typeName:Br.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new dr({...this._def,catchall:e})}pick(e){const t={};return gn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new dr({...this._def,shape:()=>t})}omit(e){const t={};return gn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new dr({...this._def,shape:()=>t})}deepPartial(){return lr(this)}partial(e){const t={};return gn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new dr({...this._def,shape:()=>t})}required(e){const t={};return gn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof kr;)e=e._def.innerType;t[n]=e}})),new dr({...this._def,shape:()=>t})}keyof(){return Sr(gn.objectKeys(this.shape))}}dr.create=(e,t)=>new dr({shape:()=>e,unknownKeys:"strip",catchall:ar.create(),typeName:Br.ZodObject,...Fn(t)}),dr.strictCreate=(e,t)=>new dr({shape:()=>e,unknownKeys:"strict",catchall:ar.create(),typeName:Br.ZodObject,...Fn(t)}),dr.lazycreate=(e,t)=>new dr({shape:e,unknownKeys:"strip",catchall:ar.create(),typeName:Br.ZodObject,...Fn(t)});class pr extends Gn{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new Pn(e.ctx.common.issues)));return Nn(t,{code:On.invalid_union,unionErrors:n}),Rn}));{let e;const r=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=r.map((e=>new Pn(e)));return Nn(t,{code:On.invalid_union,unionErrors:i}),Rn}}get options(){return this._def.options}}pr.create=(e,t)=>new pr({options:e,typeName:Br.ZodUnion,...Fn(t)});const fr=e=>e instanceof Tr?fr(e.schema):e instanceof Ir?fr(e.innerType()):e instanceof Er?[e.value]:e instanceof Or?e.options:e instanceof Pr?Object.keys(e.enum):e instanceof Nr?fr(e._def.innerType):e instanceof nr?[void 0]:e instanceof rr?[null]:null;class hr extends Gn{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==En.object)return Nn(t,{code:On.invalid_type,expected:En.object,received:t.parsedType}),Rn;const n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Nn(t,{code:On.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Rn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=fr(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new hr({typeName:Br.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Fn(n)})}}function mr(e,t){const n=Sn(e),r=Sn(t);if(e===t)return{valid:!0,data:e};if(n===En.object&&r===En.object){const n=gn.objectKeys(t),r=gn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=mr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===En.array&&r===En.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=mr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===En.date&&r===En.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class vr extends Gn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(jn(e)||jn(r))return Rn;const i=mr(e.value,r.value);return i.valid?((Un(e)||Un(r))&&t.dirty(),{status:t.value,value:i.data}):(Nn(n,{code:On.invalid_intersection_types}),Rn)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}vr.create=(e,t,n)=>new vr({left:e,right:t,typeName:Br.ZodIntersection,...Fn(n)});class yr extends Gn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==En.array)return Nn(n,{code:On.invalid_type,expected:En.array,received:n.parsedType}),Rn;if(n.data.length<this._def.items.length)return Nn(n,{code:On.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Rn;!this._def.rest&&n.data.length>this._def.items.length&&(Nn(n,{code:On.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new zn(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Mn.mergeArray(t,e))):Mn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new yr({...this._def,rest:e})}}yr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new yr({items:e,typeName:Br.ZodTuple,rest:null,...Fn(t)})};class gr extends Gn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==En.object)return Nn(n,{code:On.invalid_type,expected:En.object,received:n.parsedType}),Rn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new zn(n,e,n.path,e)),value:o._parse(new zn(n,n.data[e],n.path,e))});return n.common.async?Mn.mergeObjectAsync(t,r):Mn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new gr(t instanceof Gn?{keyType:e,valueType:t,typeName:Br.ZodRecord,...Fn(n)}:{keyType:qn.create(),valueType:e,typeName:Br.ZodRecord,...Fn(t)})}}class _r extends Gn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==En.map)return Nn(n,{code:On.invalid_type,expected:En.map,received:n.parsedType}),Rn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new zn(n,e,n.path,[o,"key"])),value:i._parse(new zn(n,t,n.path,[o,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of o){const r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return Rn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of o){const r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return Rn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}_r.create=(e,t,n)=>new _r({valueType:t,keyType:e,typeName:Br.ZodMap,...Fn(n)});class wr extends Gn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==En.set)return Nn(n,{code:On.invalid_type,expected:En.set,received:n.parsedType}),Rn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Nn(n,{code:On.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(Nn(n,{code:On.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const n=new Set;for(const r of e){if("aborted"===r.status)return Rn;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map(((e,t)=>i._parse(new zn(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new wr({...this._def,minSize:{value:e,message:Zn.toString(t)}})}max(e,t){return new wr({...this._def,maxSize:{value:e,message:Zn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}wr.create=(e,t)=>new wr({valueType:e,minSize:null,maxSize:null,typeName:Br.ZodSet,...Fn(t)});class br extends Gn{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==En.function)return Nn(t,{code:On.invalid_type,expected:En.function,received:t.parsedType}),Rn;function n(e,n){return Cn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,kn(),An].filter((e=>!!e)),issueData:{code:On.invalid_arguments,argumentsError:n}})}function r(e,n){return Cn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,kn(),An].filter((e=>!!e)),issueData:{code:On.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Ar?Dn((async(...e)=>{const t=new Pn([]),a=await this._def.args.parseAsync(e,i).catch((r=>{throw t.addIssue(n(e,r)),t})),s=await o(...a);return await this._def.returns._def.type.parseAsync(s,i).catch((e=>{throw t.addIssue(r(s,e)),t}))})):Dn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new Pn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new Pn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new br({...this._def,args:yr.create(e).rest(or.create())})}returns(e){return new br({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new br({args:e||yr.create([]).rest(or.create()),returns:t||or.create(),typeName:Br.ZodFunction,...Fn(n)})}}class Tr extends Gn{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Tr.create=(e,t)=>new Tr({getter:e,typeName:Br.ZodLazy,...Fn(t)});class Er extends Gn{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Nn(t,{received:t.data,code:On.invalid_literal,expected:this._def.value}),Rn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Sr(e,t){return new Or({values:e,typeName:Br.ZodEnum,...Fn(t)})}Er.create=(e,t)=>new Er({value:e,typeName:Br.ZodLiteral,...Fn(t)});class Or extends Gn{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Nn(t,{expected:gn.joinValues(n),received:t.parsedType,code:On.invalid_type}),Rn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Nn(t,{received:t.data,code:On.invalid_enum_value,options:n}),Rn}return Dn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Or.create(e)}exclude(e){return Or.create(this.options.filter((t=>!e.includes(t))))}}Or.create=Sr;class Pr extends Gn{_parse(e){const t=gn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==En.string&&n.parsedType!==En.number){const e=gn.objectValues(t);return Nn(n,{expected:gn.joinValues(e),received:n.parsedType,code:On.invalid_type}),Rn}if(-1===t.indexOf(e.data)){const e=gn.objectValues(t);return Nn(n,{received:n.data,code:On.invalid_enum_value,options:e}),Rn}return Dn(e.data)}get enum(){return this._def.values}}Pr.create=(e,t)=>new Pr({values:e,typeName:Br.ZodNativeEnum,...Fn(t)});class Ar extends Gn{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==En.promise&&!1===t.common.async)return Nn(t,{code:On.invalid_type,expected:En.promise,received:t.parsedType}),Rn;const n=t.parsedType===En.promise?t.data:Promise.resolve(t.data);return Dn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ar.create=(e,t)=>new Ar({type:e,typeName:Br.ZodPromise,...Fn(t)});class Ir extends Gn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Br.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null;if("preprocess"===r.type){const e=r.transform(n.data);return n.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n}))):this._def.schema._parseSync({data:e,path:n.path,parent:n})}const i={addIssue:e=>{Nn(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"refinement"===r.type){const e=e=>{const t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?Rn:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?Rn:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ln(e))return e;const o=r.transform(e.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>Ln(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}gn.assertNever(r)}}Ir.create=(e,t,n)=>new Ir({schema:e,typeName:Br.ZodEffects,effect:t,...Fn(n)}),Ir.createWithPreprocess=(e,t,n)=>new Ir({schema:t,effect:{type:"preprocess",transform:e},typeName:Br.ZodEffects,...Fn(n)});class kr extends Gn{_parse(e){return this._getType(e)===En.undefined?Dn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}kr.create=(e,t)=>new kr({innerType:e,typeName:Br.ZodOptional,...Fn(t)});class Cr extends Gn{_parse(e){return this._getType(e)===En.null?Dn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Cr.create=(e,t)=>new Cr({innerType:e,typeName:Br.ZodNullable,...Fn(t)});class Nr extends Gn{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===En.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Nr.create=(e,t)=>new Nr({innerType:e,typeName:Br.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Fn(t)});class Mr extends Gn{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t,common:{...t.common,issues:[]}}});return Bn(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue()}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}}Mr.create=(e,t)=>new Mr({innerType:e,typeName:Br.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Fn(t)});class Rr extends Gn{_parse(e){if(this._getType(e)!==En.nan){const t=this._getOrReturnCtx(e);return Nn(t,{code:On.invalid_type,expected:En.nan,received:t.parsedType}),Rn}return{status:"valid",value:e.data}}}Rr.create=e=>new Rr({typeName:Br.ZodNaN,...Fn(e)});const xr=Symbol("zod_brand");class Dr extends Gn{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class jr extends Gn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Rn:"dirty"===e.status?(t.dirty(),xn(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Rn:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new jr({in:e,out:t,typeName:Br.ZodPipeline})}}const Ur=(e,t={},n)=>e?ir.create().superRefine(((r,i)=>{if(!e(r)){const e="function"==typeof t?t(r):t,o="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...o,fatal:n})}})):ir.create(),Lr={object:dr.lazycreate};var Br;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"}(Br||(Br={}));const Zr=qn.create,zr=Qn.create,Wr=Rr.create,Fr=Yn.create,Gr=Xn.create,Hr=er.create,Vr=tr.create,Kr=nr.create,Jr=rr.create,qr=ir.create,$r=or.create,Qr=ar.create,Yr=sr.create,Xr=ur.create,ei=dr.create,ti=dr.strictCreate,ni=pr.create,ri=hr.create,ii=vr.create,oi=yr.create,ai=gr.create,si=_r.create,ui=wr.create,ci=br.create,li=Tr.create,di=Er.create,pi=Or.create,fi=Pr.create,hi=Ar.create,mi=Ir.create,vi=kr.create,yi=Cr.create,gi=Ir.createWithPreprocess,_i=jr.create,wi={string:e=>qn.create({...e,coerce:!0}),number:e=>Qn.create({...e,coerce:!0}),boolean:e=>Xn.create({...e,coerce:!0}),bigint:e=>Yn.create({...e,coerce:!0}),date:e=>er.create({...e,coerce:!0})},bi=Rn;var Ti=Object.freeze({__proto__:null,defaultErrorMap:An,setErrorMap:function(e){In=e},getErrorMap:kn,makeIssue:Cn,EMPTY_PATH:[],addIssueToContext:Nn,ParseStatus:Mn,INVALID:Rn,DIRTY:xn,OK:Dn,isAborted:jn,isDirty:Un,isValid:Ln,isAsync:Bn,get util(){return gn},ZodParsedType:En,getParsedType:Sn,ZodType:Gn,ZodString:qn,ZodNumber:Qn,ZodBigInt:Yn,ZodBoolean:Xn,ZodDate:er,ZodSymbol:tr,ZodUndefined:nr,ZodNull:rr,ZodAny:ir,ZodUnknown:or,ZodNever:ar,ZodVoid:sr,ZodArray:ur,get objectUtil(){return cr},ZodObject:dr,ZodUnion:pr,ZodDiscriminatedUnion:hr,ZodIntersection:vr,ZodTuple:yr,ZodRecord:gr,ZodMap:_r,ZodSet:wr,ZodFunction:br,ZodLazy:Tr,ZodLiteral:Er,ZodEnum:Or,ZodNativeEnum:Pr,ZodPromise:Ar,ZodEffects:Ir,ZodTransformer:Ir,ZodOptional:kr,ZodNullable:Cr,ZodDefault:Nr,ZodCatch:Mr,ZodNaN:Rr,BRAND:xr,ZodBranded:Dr,ZodPipeline:jr,custom:Ur,Schema:Gn,ZodSchema:Gn,late:Lr,get ZodFirstPartyTypeKind(){return Br},coerce:wi,any:qr,array:Xr,bigint:Fr,boolean:Gr,date:Hr,discriminatedUnion:ri,effect:mi,enum:pi,function:ci,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Ur((t=>t instanceof e),t,!0),intersection:ii,lazy:li,literal:di,map:si,nan:Wr,nativeEnum:fi,never:Qr,null:Jr,nullable:yi,number:zr,object:ei,oboolean:()=>Gr().optional(),onumber:()=>zr().optional(),optional:vi,ostring:()=>Zr().optional(),pipeline:_i,preprocess:gi,promise:hi,record:ai,set:ui,strictObject:ti,string:Zr,symbol:Vr,transformer:mi,tuple:oi,undefined:Kr,union:ni,unknown:$r,void:Yr,NEVER:bi,ZodIssueCode:On,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Pn}),Ei=function(){function e(){var t,n,r,o,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,O,P,A,I,k;ft(this,e),this.initConfig=window.APP_CONFIG;var C=pt.isString(null===(t=this.initConfig)||void 0===t||null===(n=t.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?se:ue;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===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,R="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.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)?ae.HIDE_BACK:ae.SHOW_BACK,x="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)?ae.SHOW_HOME:ae.HIDE_HOME,D=new URL(location.href),j=cn(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)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?ue:se);this.config={actionbarType:C,buttonType:R,statusbarType:j,dataConfig:{backgroundColor:(null===(S=this.initConfig)||void 0===S||null===(O=S.app)||void 0===O?void 0:O.headerColor)||ce,textColor:(null===(P=this.initConfig)||void 0===P||null===(A=P.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(I=this.initConfig)||void 0===I||null===(k=I.app)||void 0===k?void 0:k.textAlign)||le,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(a,"/").concat(i,"/").concat(D.search)}}}var t=e.prototype;return t.setNavigationBarTitle=function(e){return fe((function(){return ge(this,(function(t){return[2,new Promise((function(t,n){Qt("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},t.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return fe((function(){var r,i;return ge(this,(function(o){return void 0===(void 0===e?"undefined":ot(e))&&null===(void 0===e?"undefined":ot(e))||(r="none"===e||"home"===e?ae.HIDE_BACK:ae.SHOW_BACK,i="home"===e||"both"===e?ae.SHOW_HOME:ae.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){Qt("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",ke({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},t.setAndroidBottomNavigationBar=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return fe((function(){var n,r,i;return ge(this,(function(o){return r=e?O.hide:O.show,i=null===(n=Se())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isAndroid))return n();Qt("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideAndroidBottomNavigationBar=!!e,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.setIOSBottomSafeArea=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return fe((function(){var n,r,i;return ge(this,(function(o){return r=e?P.hide:P.show,i=null===(n=Se())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isIOS))return n();Qt("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideIOSSafeAreaBottom=!!e,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1,delay:200})}))]}))}))()},t.configHeader=function(e){var t=this;return fe((function(){var n;return ge(this,(function(r){return n=t.config,pt.isString(e.headerColor)&&(n.dataConfig.backgroundColor=e.headerColor),pt.isString(e.headerTextColor)&&(n.dataConfig.textColor=e.headerTextColor),pt.isString(e.textAlign)&&("left"===e.textAlign?n.dataConfig.textAlign=A.left:"center"===e.textAlign&&(n.dataConfig.textAlign=A.center)),!0===e.hideActionBar?n.actionbarType=ue:!1===e.hideActionBar&&(n.actionbarType=se),"normal"===e.statusBarType?n.statusbarType=S.normal:"hidden"===e.statusBarType?n.statusbarType=S.hidden:"transparent"===e.statusBarType&&(n.statusbarType=S.transparent),[2,new Promise((function(r,i){Qt("CHANGE_ACTIONBAR",ke({},n),{success:function(){var i;t.config=ke({},n);var o,a=null===(i=Se())||void 0===i?void 0:i.platform;window.STATUS_BAR_TYPE=(o=t.config.statusbarType)===S.hidden?"hidden":o===S.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=t.config.actionbarType===ue;var s=null===document||void 0===document?void 0:document.querySelector(":root");if(null==a?void 0:a.isAndroid){var u=0;if(("hidden"===e.statusBarType||"transparent"===e.statusBarType)&&e.hideActionBar){var c=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(c)&&(c=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),u=c}u?null==s||s.style.setProperty("--zaui-safe-area-inset-top","".concat(u,"px")):null==s||s.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}r()},fail:function(e){i(e)}},{timeout:!1})}))]}))}))()},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}(),Si=Ei.getInstance(),Oi=[ei({title:Zr()}).optional()];function Pi(e){return Ai.apply(this,arguments)}function Ai(){return Ai=fe((function(e){return ge(this,(function(t){return[2,fn("setNavigationBarTitle",Oi,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Si.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ai.apply(this,arguments)}var Ii=[ei({color:Zr(),textColor:Ti.enum(["black","white"]).optional(),statusBarColor:Zr().optional()}).optional()];function ki(e){return Ci.apply(this,arguments)}function Ci(){return Ci=fe((function(e){return ge(this,(function(t){return[2,fn("setNavigationBarColor",Ii,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Si.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 Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ci.apply(this,arguments)}var Ni=[ei({type:Ti.enum(["none","back","home","both"])}).optional()];function Mi(e){return Ri.apply(this,arguments)}function Ri(){return Ri=fe((function(e){return ge(this,(function(t){return[2,fn("setNavigationBarLeftButton",Ni,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Si.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ri.apply(this,arguments)}function xi(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Di(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,xi(e,t,"get"))}function ji(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 Ui(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,xi(e,t,"set"),n),n}var Li,Bi,Zi,zi=new WeakMap,Wi=new WeakMap,Fi=new WeakMap,Gi=function(){function e(t){ft(this,e),ji(this,zi,{writable:!0,value:localStorage}),ji(this,Wi,{writable:!0,value:void 0}),ji(this,Fi,{writable:!0,value:void 0}),Ui(this,Fi,{keys:new Set,currentSize:0,limitSize:te}),Ui(this,Wi,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in Di(this,zi)){if(e)if(t.split("_")[0]!==e)continue;Di(this,Fi).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 Di(this,Wi)&&(e="".concat(Di(this,Wi),"_").concat(e)),Di(this,Fi).keys.has(e)?Di(this,zi).getItem(e):null},t.set=function(e){var t=this;return fe((function(){return ge(this,(function(n){return Object.entries(e).forEach((function(e){var n=Ce(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){Di(this,Wi)&&(e="".concat(Di(this,Wi),"_").concat(e)),Di(this,zi).setItem(e,t),Di(this,Fi).keys.add(e)},t.getInfo=function(){var e=this;return fe((function(){return ge(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}(Di(this,zi),Di(this,Wi));return{currentSize:pt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((te/1024).toFixed(2))}},t.remove=function(e){var t=this;return fe((function(){return ge(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){Di(this,Wi)&&(e="".concat(Di(this,Wi),"_").concat(e)),Di(this,Fi).keys.has(e)&&(Di(this,zi).removeItem(e),Di(this,Fi).keys.delete(e))},t.clear=function(){var e=this;return fe((function(){return ge(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;Di(this,Fi).keys.forEach((function(t){Di(e,Wi)&&t.indexOf(Di(e,Wi))<0||(Di(e,zi).removeItem(t),Di(e,Fi).keys.delete(t))}))},e}(),Hi=new WeakMap,Vi=new WeakMap,Ki=function(){function e(t){ft(this,e),ji(this,Hi,{writable:!0,value:void 0}),ji(this,Vi,{writable:!0,value:void 0}),Ui(this,Vi,{keys:new Set,currentSize:0,limitSize:te}),Ui(this,Hi,t)}var t=e.prototype;return t.get=function(e){var t=this;return fe((function(){return ge(this,(function(n){return[2,new Promise((function(n,r){Qt("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Di(t,Hi)},{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 fe((function(){return ge(this,(function(n){return[2,new Promise((function(n,r){Qt("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Di(t,Hi)},{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 fe((function(){return ge(this,(function(t){return[2,new Promise((function(t,n){Qt("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Di(e,Hi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:pt.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(te/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return fe((function(){return ge(this,(function(n){return[2,new Promise((function(n,r){Qt("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Di(t,Hi)},{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 fe((function(){return ge(this,(function(t){return[2,new Promise((function(t,n){Qt("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Di(e,Hi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),Ji=function(){function e(){ft(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return fe((function(){var n,r;return ge(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]=on(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return fe((function(){var n,r;return ge(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Ce(e,2),n=t[0],i=t[1];pt.isUndefined(i)||pt.isNull(i)||(r[n]=un(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return fe((function(){return ge(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 fe((function(){return ge(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 fe((function(){return ge(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),qi=new WeakMap,$i=function(e){wt(n,e);var t=Tt(n);function n(e){var r;return ft(this,n),ji(bt(r=t.call(this)),qi,{writable:!0,value:void 0}),Ui(bt(r),qi,e),r}return n.prototype.getInstance=function(){return new Gi(Di(this,qi))},n}(Ji),Qi=new WeakMap,Yi=function(e){wt(n,e);var t=Tt(n);function n(e){var r;return ft(this,n),ji(bt(r=t.call(this)),Qi,{writable:!0,value:void 0}),Ui(bt(r),Qi,e),r}return n.prototype.getInstance=function(){return new Ki(Di(this,Qi))},n}(Ji),Xi=new $i(i),eo=(null===(Li=Se())||void 0===Li?void 0:Li.zaloVersion)||"",to=(null===(Bi=Se())||void 0===Bi?void 0:Bi.platformName)||"unknown";!!pt.isString(eo)&&parseInt(eo,10)>={android:12100571,iOS:400,wp:0,unknown:0}[to]&&(null===(Zi=Se())||void 0===Zi?void 0:Zi.appEnv.isMp)&&(Xi=new Yi(i));var no=Xi,ro=[ei({data:Ti.record(Zr(),Ti.any())}).optional()];function io(e){return oo.apply(this,arguments)}function oo(){return oo=fe((function(e){return ge(this,(function(t){return[2,fn("setStorage",ro,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,no.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ae("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),oo.apply(this,arguments)}var ao=[ei({keys:Ti.array(Zr())}).optional()];function so(e){return uo.apply(this,arguments)}function uo(){return uo=fe((function(e){return ge(this,(function(t){return[2,fn("getStorage",ao,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,no.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ae("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),uo.apply(this,arguments)}function co(e){return lo.apply(this,arguments)}function lo(){return(lo=fe((function(e){return ge(this,(function(t){return[2,fn("getStorageInfo",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,no.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ae("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var po=[ei({keys:Ti.array(Zr())}).optional()];function fo(e){return ho.apply(this,arguments)}function ho(){return ho=fe((function(e){return ge(this,(function(t){return[2,fn("removeStorage",po,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,no.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ae("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ho.apply(this,arguments)}var mo=[ei({prefix:Zr().optional()}).optional()];function vo(e){return yo.apply(this,arguments)}function yo(){return(yo=fe((function(e){return ge(this,(function(t){return[2,fn("clearStorage",mo,[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,no.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ae("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var go=function(){var e=fe((function(e,t){var n,r,o,a;return ge(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,pn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,en.getAccessToken(n)];case 3:return o=s.sent(),a="id,name,user_id_by_oa,is_sensitive",a=e?"".concat(a,",picture.type(").concat(e,")"):"".concat(a,",picture"),[4,fetch("".concat(l.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(i),{headers:{access_token:o||""}}).then(function(){var e=fe((function(e){var t,n,r,i;return ge(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:!!(null==r?void 0:r.is_follower),isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),_o=[ei({avatarType:Ti.enum(["small","normal","large"]).optional(),autoRequestPermission:Ti.boolean().default(!1).optional()}).optional()];function wo(e){return bo.apply(this,arguments)}function bo(){return bo=fe((function(e){return ge(this,(function(t){return[2,fn("getUserInfo",_o,[e],function(){var e=fe((function(e){var t,n;return ge(this,(function(r){switch(r.label){case 0:return Oe.isMp?(t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,[4,go(t,n)]):[3,2];case 1:return[2,{userInfo:r.sent()}];case 2:return Oe.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Ae("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bo.apply(this,arguments)}var To=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},Eo=fe((function(){return ge(this,(function(e){return[2,new Promise((function(e,t){Qt("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(t){var n,r,i,o=t.network,a=(null===(n=Se())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)||!1;switch(o){case To(a).NONE:i=d.none;break;case To(a).WIFI:i=d.wifi;break;case To(a)["2G"]:case To(a)["3G"]:case To(a)["4G"]:i=d.cellular;break;default:i=d.unknown}e(i)},fail:function(e){t(e)}},{})}))]}))}));function So(e){return Oo.apply(this,arguments)}function Oo(){return(Oo=fe((function(e){return ge(this,(function(t){return[2,fn("getNetworkType",[],[e],fe((function(){var e,t;return ge(this,(function(n){switch(n.label){case 0:return Oe.isMp?[4,Eo()]:[3,2];case 1:return[2,{networkType:n.sent()}];case 2:if(Oe.isMpWeb){switch(e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,e.effectiveType){case"none":t=d.none;break;case"4g":t=d.wifi;break;case"3g":case"2g":t=d.cellular;break;default:t=d.unknown}return[2,Promise.resolve({networkType:t})]}return[2,Promise.reject(Ae("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Po=[Ti.function().args(ei({isConnected:Ti.boolean(),networkType:Ti.enum(["none","wifi","cellular","unknown"])})).returns(Ti.void())];function Ao(e){return fn("onNetworkStatusChange",Po,[e],(function(e){var t=e;if(Oe.isMp)!function(e){At.getInstance().on(f.NetworkChanged,(function(t){var n=null==t?void 0:t.state;Eo().then((function(t){e({isConnected:"CONNECTED"===n,networkType:t})}))}))}(t);else if(Oe.isMpWeb){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,r=n.effectiveType;n.addEventListener("change",(function(){var e;switch(r){case"none":e=d.none;break;case"4g":e=d.wifi;break;case"3g":case"2g":e=d.cellular;break;default:e=d.unknown}t({isConnected:!0,networkType:e})}))}}))}var Io=function(){var e=fe((function(e){var t,n,r,i,o,a;return ge(this,(function(s){return a={subaction:0,scanning_type:pt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:pt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:pt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:pt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:pt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:pt.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:pt.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:pt.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:pt.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:pt.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){Qt("SCAN_IBEACON",ke({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ko=[ei({scanningType:Ti.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Ti.number().optional(),monitorInterval:Ti.number().optional(),domain:Ti.string().optional(),scanConfig:ei({scanTime:Ti.number().optional(),timeBetweenScan:Ti.number().optional(),beaconTimeout:Ti.number().optional(),delayCheckConnectedTimeout:Ti.number().optional(),beaconConnectedTimeout:Ti.number().optional()}).optional(),items:Ti.array(ei({id:Ti.string().optional(),distance:Ti.number().optional(),monitor:ei({enable:Ti.boolean().optional(),movingRange:Ti.number().optional()}).optional()})).optional(),scanFromSource:Ti.string().optional()}).optional()];function Co(e){return No.apply(this,arguments)}function No(){return(No=fe((function(e){return ge(this,(function(t){return[2,fn("startBeaconDiscovery",ko,[e],fe((function(){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Io(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ae("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Mo=fe((function(){return ge(this,(function(e){return[2,new Promise((function(e,t){Qt("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Ro(e){return xo.apply(this,arguments)}function xo(){return(xo=fe((function(e){return ge(this,(function(t){return[2,fn("stopBeaconDiscovery",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Mo()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ae("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Do=fe((function(){return ge(this,(function(e){return[2,new Promise((function(e,t){Qt("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 jo(e){return Uo.apply(this,arguments)}function Uo(){return(Uo=fe((function(e){return ge(this,(function(t){return[2,fn("getBeacons",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Do()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Ae("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Lo=fe((function(){return ge(this,(function(e){return[2,new Promise((function(e,t){Qt("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Bo(e){return Zo.apply(this,arguments)}function Zo(){return(Zo=fe((function(e){return ge(this,(function(t){return[2,fn("closeApp",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Lo()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var zo=fe((function(){return ge(this,(function(e){return[2,new Promise((function(e,t){Qt("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Wo(e){return Fo.apply(this,arguments)}function Fo(){return(Fo=fe((function(e){return ge(this,(function(t){return[2,fn("scanQRCode",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,zo()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Ae("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Go=function(){var e=fe((function(e,t,n,i){return ge(this,(function(o){return[2,new Promise((function(o,a){Qt("OPEN_PROFILE",{uId:e,type:m[t],zapp:r,sourceId:n,sourceIndex:i},{success:function(){o()},fail:function(e){a(e)}},{})}))]}))}));return function(t,n,r,i){return e.apply(this,arguments)}}(),Ho=[ei({id:Zr(),type:Ti.enum(["user","oa","aliasOA"]),sourceId:Ti.any().optional(),sourceIndex:Ti.any().optional()}).optional()];function Vo(e){return Ko.apply(this,arguments)}function Ko(){return Ko=fe((function(e){return ge(this,(function(t){return[2,fn("openProfile",Ho,[e],function(){var e=fe((function(e){var t,n,r,i;return ge(this,(function(o){switch(o.label){case 0:return Oe.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Go(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ko.apply(this,arguments)}var Jo=function(){var e=fe((function(e,t){var n,i,o,a=arguments;return ge(this,(function(s){return n=a.length>2&&void 0!==a[2]?a[2]:"",i=a.length>3?a[3]:void 0,o=a.length>4?a[4]:void 0,[2,new Promise((function(a,s){Qt("OPEN_CHAT",{uId:e,type:v[t],msg:n,zapp:r,sourceId:i,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),qo=[ei({id:Zr(),type:Ti.enum(["user","oa"]),sourceId:Ti.any().optional(),sourceIndex:Ti.any().optional(),message:Zr().optional()}).optional()];function $o(e){return Qo.apply(this,arguments)}function Qo(){return Qo=fe((function(e){return ge(this,(function(t){return[2,fn("openChat",qo,[e],function(){var e=fe((function(e){var t,n,r,i,o;return ge(this,(function(a){switch(a.label){case 0:return Oe.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,Jo(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qo.apply(this,arguments)}function Yo(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 Xo=function(){var e=fe((function(e,t){var n;return ge(this,(function(i){switch(n={},e){case"image":n={photoUrl:null==t?void 0:t.imageUrl};break;case"link":n={link:null==t?void 0:t.link,title:null==t?void 0:t.title,thumb:null==t?void 0:t.thumb,description:null==t?void 0:t.description};break;case"profile":n={avt:null==t?void 0:t.avatar,uid:null==t?void 0:t.id,dpn:null==t?void 0:t.displayName}}return[2,new Promise((function(t,i){Qt("OPEN_POSTFEED",Yo(ke({type:y[e]},n),{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){i(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ea=[Ti.union([ei({type:Ti.enum(["image"]),data:ei({imageUrl:Zr().url().optional()})}),ei({type:Ti.enum(["link"]),data:ei({link:Zr().url(),title:Zr().max(100).optional(),thumb:Zr().url().optional(),description:Zr().max(400).default("").optional()})}),ei({type:Ti.enum(["profile"]),data:ei({id:Zr().optional()})})])];function ta(e){return na.apply(this,arguments)}function na(){return na=fe((function(e){return ge(this,(function(t){return[2,fn("openPostFeed",ea,[e],function(){var e=fe((function(e){var t,n;return ge(this,(function(r){switch(r.label){case 0:return Oe.isMp?(t=e.type,n=e.data,[4,Xo(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ae("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),na.apply(this,arguments)}var ra=function(){var e=fe((function(e){return ge(this,(function(t){return[2,new Promise((function(t,n){Qt("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)}}(),ia=[ei({id:Zr(),showDialogConfirm:Ti.boolean().optional()}).optional()];function oa(e){return aa.apply(this,arguments)}function aa(){return aa=fe((function(e){return ge(this,(function(t){return[2,fn("followOA",ia,[e],function(){var e=fe((function(e){var t;return ge(this,(function(n){switch(n.label){case 0:return Oe.isMp?(t=e.id,[4,ra(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),aa.apply(this,arguments)}var sa=function(){var e=fe((function(e){return ge(this,(function(t){return[2,new Promise((function(t,n){Qt("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ua=[ei({id:Zr()}).optional()];function ca(e){return la.apply(this,arguments)}function la(){return la=fe((function(e){return ge(this,(function(t){return[2,fn("unfollowOA",ua,[e],function(){var e=fe((function(e){var t;return ge(this,(function(n){switch(n.label){case 0:return Oe.isMp?(t=e.id,[4,sa(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),la.apply(this,arguments)}var da=function(){var e=fe((function(e,t,n,r,i,a){var s,c,d,p,f,h,m,v;return ge(this,(function(y){switch(y.label){case 0:return d=new URL(location.href),p=new URLSearchParams,f="".concat(d.pathname.replace(u,"")).concat(d.search),a&&(f="/".concat(e).concat("/"===a[0]?"":"/").concat(a)),!(h=new URL("".concat(o).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(c=window.APP_VERSION)||void 0===c?void 0:c.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.CREATE_SHARE_LINK,ke({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw $t.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,Yo(ke({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),pa=function(){var e=fe((function(e,t){var n,o,a,s,u,c,l,d,p,f,h,m;return ge(this,(function(v){switch(v.label){case 0:switch(n={},o=e,e){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return n={text:null==t?void 0:t.text,desc:(null==t?void 0:t.desc)||(null==t?void 0:t.description),autoParseLink:(null==t?void 0:t.autoParseLink)?1:0},[3,14];case 2:return c=[],l=(null===(s=Se())||void 0===s?void 0:s.zaloVersion)||0,d=(null===(u=Se())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=ee[d]&&(o="multi_image"),Array.isArray(null==t?void 0:t.imageUrls)&&(null==t?void 0:t.imageUrls.length)>0?c=null==t?void 0:t.imageUrls:c.push(null==t?void 0:t.imageUrl),n={photoUrls:c,photoUrl:null==t?void 0:t.imageUrl,caption:null==t?void 0:t.caption},[3,14];case 3:return n={photoUrl:null==t?void 0:t.imageUrl,gifUrl:null==t?void 0:t.gifUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 4:return n={videoThumb:null==t?void 0:t.videoThumb,videoUrl:null==t?void 0:t.videoUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 5:return n={link:null==t?void 0:t.link,chatOnly:(null==t?void 0:t.chatOnly)?1:0},[3,14];case 6:return n={uid:null==t?void 0:t.id},[3,14];case 7:case 10:return[4,en.getAccessToken()];case 8:case 11:return a=v.sent(),[4,da(i,a||"",(null==t?void 0:t.title)||"",(null==t?void 0:t.description)||"",(null==t?void 0:t.thumbnail)||"",null==t?void 0:t.path)];case 9:return p=v.sent(),n={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(i,"&shareId=").concat(p.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return f=v.sent().shareableLink,h=new URL(f),m=h.searchParams.getAll("zshareId"),h.searchParams.delete("zshareId"),m.length>0&&h.searchParams.append("zshareId",m[0]),n={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(e,t){Qt("OPEN_SHARESHEET",Yo(ke({type:g[o]},n),{zapp:r}),{success:function(t){e({status:null==t?void 0:t.status,shareType:null==t?void 0:t.share_type,numberOfUser:null==t?void 0:t.uid_to_size})},fail:function(e){t(e)}},{timeout:!1})}))]}}))}));return function(t,n){return e.apply(this,arguments)}}(),fa=[Ti.union([ei({type:Ti.enum(["text"]),data:ei({text:Zr(),description:Zr().default("").optional(),autoParseLink:Ti.boolean().default(!1).optional()})}),ei({type:Ti.enum(["image"]),data:ei({imageUrl:Zr().url(),imageUrls:Ti.array(Zr().url()).max(10).optional()})}),ei({type:Ti.enum(["link"]),data:ei({link:Zr().url(),chatOnly:Ti.boolean().optional()})}),ei({type:Ti.enum(["oa"]),data:ei({id:Zr()})}),ei({type:Ti.enum(["gif"]),data:ei({gifUrl:Zr().url(),imageUrl:Zr().url().optional(),width:zr().min(0).optional(),height:zr().min(0).optional()})}),ei({type:Ti.enum(["video"]),data:ei({videoThumb:Zr().url(),videoUrl:Zr().url(),width:zr().min(0).optional(),height:zr().min(0).optional()})}),ei({type:Ti.enum(["zmp","zmp_deep_link"]),data:ei({title:Zr().max(100),thumbnail:Zr().url(),path:Zr().optional(),description:Zr().max(400).default("").optional()})})])];function ha(e){return ma.apply(this,arguments)}function ma(){return ma=fe((function(e){return ge(this,(function(t){return[2,fn("openShareSheet",fa,[e],function(){var e=fe((function(e){var t,n;return ge(this,(function(r){switch(r.label){case 0:return Oe.isMp?(t=e.type,n=e.data,[4,pa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ae("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ma.apply(this,arguments)}var va=fe((function(){return ge(this,(function(e){return[2,new Promise((function(e,t){Qt("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Se())||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=Se())||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 ya(e){return ga.apply(this,arguments)}function ga(){return(ga=fe((function(e){return ge(this,(function(t){return[2,fn("requestCameraPermission",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return[4,va()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var _a=function(){var e=fe((function(e,t,n){return ge(this,(function(r){return[2,new Promise((function(r,i){Qt("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)}}(),wa=fe((function(){var e,t,n,r=arguments;return ge(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=bn(),[4,Lt(e,t,n.version)];case 1:return[2,o.sent()]}}))})),ba=function(){var e=fe((function(e){return ge(this,(function(t){return[2,new Promise((function(t,n){Qt("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ta=[ei({params:Ti.record(Zr(),Zr()).optional()}).optional()];function Ea(e){return Sa.apply(this,arguments)}function Sa(){return Sa=fe((function(e){return ge(this,(function(t){return[2,fn("createShortcut",Ta,[e],function(){var e=fe((function(e){var t,n,r,a,s,u,c,l;return ge(this,(function(d){switch(d.label){case 0:return Oe.isMp?[4,wa(i,0)]:[3,6];case 1:return r=d.sent(),a=null===(t=Se())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||sn("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,ba(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,_a("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,$t.success()];case 6:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Sa.apply(this,arguments)}var Oa=function(){var e=fe((function(e,t,n){return ge(this,(function(i){return[2,new Promise((function(i,o){Qt("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)}}(),Pa=[ei({secretData:Zr(),ui:ei({title:Zr().default("Xác thực").optional(),subTitle:Zr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:Zr().default("Đóng").optional()}).optional(),requireFingerprint:Gr().default(!0).optional()}).optional()];function Aa(e){return Ia.apply(this,arguments)}function Ia(){return Ia=fe((function(e){return ge(this,(function(t){return[2,fn("openBioAuthentication",Pa,[e],function(){var e=fe((function(e){var t,n,r;return ge(this,(function(i){switch(i.label){case 0:return Oe.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Oa(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Ae("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ia.apply(this,arguments)}var ka=fe((function(){return ge(this,(function(e){return[2,new Promise((function(e,t){Qt("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 Ca(e){return Na.apply(this,arguments)}function Na(){return(Na=fe((function(e){return ge(this,(function(t){return[2,fn("checkStateBioAuthentication",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,ka()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Oe.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Ae("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Ma=function(){var e=fe((function(e){return ge(this,(function(t){return[2,new Promise((function(t,n){Qt("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ra=[ei({message:Zr()}).optional()];function xa(e){return Da.apply(this,arguments)}function Da(){return Da=fe((function(e){return ge(this,(function(t){return[2,fn("showToast",Ra,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ma(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Da.apply(this,arguments)}var ja=fe((function(){return ge(this,(function(e){return[2,new Promise((function(e,t){Qt("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ua(e){return La.apply(this,arguments)}function La(){return(La=fe((function(e){return ge(this,(function(t){return[2,fn("hideKeyboard",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,ja()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var Ba=function(){var e=fe((function(e){return ge(this,(function(t){return[2,new Promise((function(t,n){Qt("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Za=[ei({phoneNumber:Zr()})];function za(e){return Wa.apply(this,arguments)}function Wa(){return Wa=fe((function(e){return ge(this,(function(t){return[2,fn("openPhone",Za,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ba(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wa.apply(this,arguments)}var Fa=function(){var e=fe((function(e,t){return ge(this,(function(n){return[2,new Promise((function(n,r){Qt("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ga=[ei({content:Zr(),phoneNumber:Zr()})];function Ha(e){return Va.apply(this,arguments)}function Va(){return Va=fe((function(e){return ge(this,(function(t){return[2,fn("openSMS",Ga,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Fa(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Va.apply(this,arguments)}var Ka=function(){var e=fe((function(e){var t,n=arguments;return ge(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){Qt("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)}}(),Ja=[ei({id:Zr(),displayName:Zr().default("").optional()})];function qa(e){return $a.apply(this,arguments)}function $a(){return $a=fe((function(e){return ge(this,(function(t){return[2,fn("viewOAQr",Ja,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ka(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$a.apply(this,arguments)}var Qa=function(){var e=fe((function(e){return ge(this,(function(t){return[2,new Promise((function(t,n){Qt("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)}}(),Ya=[ei({keepScreenOn:Gr()})];function Xa(e){return es.apply(this,arguments)}function es(){return es=fe((function(e){return ge(this,(function(t){return[2,fn("keepScreen",Ya,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Qa(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),es.apply(this,arguments)}function ts(e){return ns.apply(this,arguments)}function ns(){return(ns=fe((function(e){return ge(this,(function(t){return[2,fn("onKeepScreen",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Qa(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function rs(e){return is.apply(this,arguments)}function is(){return(is=fe((function(e){return ge(this,(function(t){return[2,fn("offKeepScreen",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Qa(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var os=function(){var e=fe((function(e,t){var n;return ge(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){Qt("SAVE_IMAGE_GALLERY",ke({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),as=[ei({imageBase64Data:Zr().optional(),imageUrl:Zr().url().optional()}).optional()];function ss(e){return us.apply(this,arguments)}function us(){return us=fe((function(e){return ge(this,(function(t){return[2,fn("saveImageToGallery",as,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,os(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),us.apply(this,arguments)}var cs=function(){var e=fe((function(e){var t,n,r,i,o,s,u=arguments;return ge(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,wa(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=Ce(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){Qt("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),ls=[ei({appId:Zr(),path:Zr().optional(),params:Ti.record(Zr(),Zr()).optional()})];function ds(e){return ps.apply(this,arguments)}function ps(){return ps=fe((function(e){return ge(this,(function(t){return[2,fn("openMiniApp",ls,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,cs(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ps.apply(this,arguments)}var fs=fe((function(){var e,t,n=arguments;return ge(this,(function(r){return e=n.length>0&&void 0!==n[0]?n[0]:"oneShot",t=n.length>1?n[1]:void 0,[2,new Promise((function(n,r){Qt("INTERACTIVE_VIBRATION",{type:w[e],vibrate_time:t},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))})),hs=[ei({type:Ti.enum(["oneShot"]).default("oneShot"),milliseconds:zr().optional()})];function ms(e){return vs.apply(this,arguments)}function vs(){return vs=fe((function(e){return ge(this,(function(t){return[2,fn("vibrate",hs,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,fs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vs.apply(this,arguments)}var ys=function(){var e=fe((function(e,t){var n,r,i,o;return ge(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=pt.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Zt(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Zt(null==t?void 0:t.leftButton):"back"},!r&&pt.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){Qt("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),gs=[ei({url:Zr(),config:ei({style:Ti.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Ti.enum(["back","none"]).default("back").optional()}).optional()})];function _s(e){return ws.apply(this,arguments)}function ws(){return ws=fe((function(e){return ge(this,(function(t){return[2,fn("openWebview",gs,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,ys(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ws.apply(this,arguments)}function bs(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Ct.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Ts(){return fn("getRouteParams",[],[],(function(){return bs()}))}function Es(e){return Ss.apply(this,arguments)}function Ss(){return(Ss=fe((function(e){return ge(this,(function(t){return[2,fn("getAppInfo",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,wa()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Ae("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Os=function(){var e=fe((function(e){return ge(this,(function(t){return[2,new Promise((function(t,n){Qt("WEBVIEW_SET_RESULT",{result:un(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ps=[ei({data:Ti.any()})];function As(e){return Is.apply(this,arguments)}function Is(){return Is=fe((function(e){return ge(this,(function(t){return[2,fn("sendDataToPreviousMiniApp",Ps,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Os(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Is.apply(this,arguments)}var ks=fe((function(){return ge(this,(function(e){return[2,new Promise((function(e,t){var n,r;Qt("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($t.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Se())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function Cs(e){return Ns.apply(this,arguments)}function Ns(){return(Ns=fe((function(e){return ge(this,(function(t){return[2,fn("getPhoneNumber",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,ks()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Ae("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var Ms=fe((function(){var e,t=arguments;return ge(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){Qt("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})}))]}))})),Rs=[ei({maxProfile:zr().min(1).max(10).optional().default(1)})];function xs(e){return Ds.apply(this,arguments)}function Ds(){return Ds=fe((function(e){return ge(this,(function(t){return[2,fn("openProfilePicker",Rs,[e],function(){var e=fe((function(e){var t,n,r,i,o;return ge(this,(function(a){switch(a.label){case 0:return Oe.isMp?[4,Ms(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,en.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,d,p;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(pt.isUndefined(null===(d=i.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=i.data[e])||void 0===p?void 0:p.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 Oe.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Ae("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ds.apply(this,arguments)}var js=function(){var e=fe((function(e,t,n){var r;return ge(this,(function(i){return r=t&&pt.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){Qt("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)}}(),Us=[ei({SSID:Zr(),password:Zr().optional(),hiddenSSID:Gr().optional()})];function Ls(e){return Bs.apply(this,arguments)}function Bs(){return Bs=fe((function(e){return ge(this,(function(t){return[2,fn("connectWifi",Us,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,js(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bs.apply(this,arguments)}var Zs=function(){var e=fe((function(e,t,n,r,i,o){var a,s;return ge(this,(function(u){return a={type:0,url:t,max_size:n||1048576},s={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(t,n){Qt("PICK_MEDIA",{media_type:b[e],edit_view:ke({},s,r),silent_request:i,upload:a,max_select_items:o},{success:function(e){t(null==e?void 0:e.result_content)},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),zs=[ei({type:Ti.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:Zr().url(),maxItemSize:zr().min(0).optional(),editView:ei({enable:Gr().optional(),aspectRatio:Zr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:Gr().optional(),maxSelectItem:zr().min(1).optional()})];function Ws(e){return Fs.apply(this,arguments)}function Fs(){return Fs=fe((function(e){return ge(this,(function(t){return[2,fn("openMediaPicker",zs,[e],function(){var e=fe((function(e){var t,n,r,i,o,a;return ge(this,(function(s){switch(s.label){case 0:return Oe.isMp?(i={},pt.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,Zs(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Oe.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Ae("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fs.apply(this,arguments)}var Gs=[ei({title:Zr().max(100),description:Zr().max(400).default(""),thumbnail:Zr().url().optional(),path:Zr().optional()})];function Hs(e){return Vs.apply(this,arguments)}function Vs(){return Vs=fe((function(e){return ge(this,(function(t){return[2,fn("getShareableLink",Gs,[e],function(){var e=fe((function(e){var t;return ge(this,(function(n){switch(n.label){case 0:return[4,en.getAccessToken()];case 1:return t=n.sent(),[4,da(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)}}())]}))})),Vs.apply(this,arguments)}var Ks=function(){var e=fe((function(e){return ge(this,(function(t){return[2,new Promise((function(t,n){Qt("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 Js(e){return qs.apply(this,arguments)}function qs(){return(qs=fe((function(e){return ge(this,(function(t){return[2,fn("closeLoading",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Ks("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function $s(e){return Qs.apply(this,arguments)}function Qs(){return Qs=fe((function(e){return ge(this,(function(t){return[2,fn("requestUpdateZalo",[],[e],fe((function(){var e,t,n;return ge(this,(function(r){switch(r.label){case 0:return Oe.isMp?(n=(null===(e=Se())||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,ba(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("requestUpdateZalo",{}))]}}))})))]}))})),Qs.apply(this,arguments)}var Ys=At.getInstance();Ys.addListener=function(e,t,n){var r=e;return Ys.addListener(f[r],t,n)};var Xs=[Ti.function()];function eu(e){return fn("onConfirmToExit",Xs,[e],(function(e){var t=e;Oe.isMp&&(Ys.on(f.AppClose,t,'{"handle_h5": 1}'),Si.setNavigationBarLeftButton(void 0,2))}))}function tu(){return fn("offConfirmToExit",[],[],(function(){Oe.isMp&&(Ys.off(f.AppClose),Si.setNavigationBarLeftButton(void 0,0))}))}function nu(){return fn("getDeviceId",[],[],(function(){return Oe.isMp&&en.getSync(c.DEVICE_ID)||""}))}function ru(e){return iu.apply(this,arguments)}function iu(){return(iu=fe((function(e){return ge(this,(function(t){return[2,fn("getDeviceIdAsync",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,en.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function ou(){return fn("getContext",[],[],(function(){if(Oe.isMp){var e=en.getSync(c.CONTEXT_ID)||"";return{type:en.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function au(e){return su.apply(this,arguments)}function su(){return(su=fe((function(e){return ge(this,(function(t){return[2,fn("getContextAsync",[],[e],fe((function(){var e;return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,en.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,en.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 uu(e){return cu.apply(this,arguments)}function cu(){return(cu=fe((function(e){return ge(this,(function(t){return[2,fn("getAuthCode",[],[e],fe((function(){var e,t;return ge(this,(function(n){switch(n.label){case 0:return Oe.isMp?[4,en.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,en.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,en.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Bt([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),$t.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function lu(e){return du.apply(this,arguments)}function du(){return(du=fe((function(e){return ge(this,(function(t){return[2,fn("getZPIToken",[],[e],fe((function(){var e,t,n,r;return ge(this,(function(i){switch(i.label){case 0:return Oe.isMp?[4,en.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,en.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,en.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,en.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 pu=[Zr()];function fu(e){return fn("setAccessToken",pu,[e],(function(e){var t=e;en.setAccessToken(t)}))}var hu=[ei({url:Zr().url()})];function mu(e){return vu.apply(this,arguments)}function vu(){return vu=fe((function(e){return ge(this,(function(t){return[2,fn("openOutApp",hu,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,ba(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vu.apply(this,arguments)}var yu=[ei({count:zr().min(1).optional().default(1),sourceType:Ti.array(Ti.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Ti.enum(["back","front"]).default("front").optional()})];function gu(e){return _u.apply(this,arguments)}function _u(){return _u=fe((function(e){return ge(this,(function(t){return[2,fn("chooseImage",yu,[e],function(){var e=fe((function(e){var t,n,r,i;return ge(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)}}())]}))})),_u.apply(this,arguments)}var wu=fe((function(){var e,t,n=arguments;return ge(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){Qt("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($t.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function bu(e){return Tu.apply(this,arguments)}function Tu(){return(Tu=fe((function(e){return ge(this,(function(t){return[2,fn("getLocation",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,wu()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Ae("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Eu=[Ti.function().args(ei({data:Ti.any()})).returns(Ti.void())];function Su(e){return fn("onCallbackData",Eu,[e],(function(){!function(e){At.getInstance().on(f.OnDataCallback,(function(t){e({data:t})}))}(e)}))}var Ou=function(){var e=fe((function(e){var t,n,r,o,a,s,u,c,l,d,p;return ge(this,(function(f){switch(f.label){case 0:return n="",e||(e=bs()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Ct.getParameterByName("orderId",e),o=Ct.getParameterByName("appTransID",e)||Ct.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,en.getAccessToken().catch((function(){throw $t.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(ne.GET_TRANSACTION),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 $t.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,ke({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Pu=function(){var e=fe((function(e,t,n,r,o,a,s){var u,c,l,d,p,h,m,v,y,g,_,w,b,T,E,S,O,P,A,I,k;return ge(this,(function(C){switch(C.label){case 0:u=i,(c=new URLSearchParams).append("amount",e.toString()),c.append("item",encodeURIComponent(JSON.stringify(t))),c.append("appId",u),n&&c.append("desc",encodeURIComponent(n)),r&&(l=r,"object"==typeof r&&(l=JSON.stringify(r)),c.append("extradata",encodeURIComponent(l))),o&&(d=o,"object"==typeof o&&(d=JSON.stringify(o)),c.append("payload",encodeURIComponent(d))),a&&("string"==typeof a?(c.append("method",a),c.append("isCustom","false")):"object"==typeof a&&(c.append("method",a.id),c.append("isCustom",JSON.stringify(a.isCustom)))),s&&c.append("mac",s),p={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,en.getAccessToken().catch((function(){throw $t.error.loginRequired}))];case 2:return m=C.sent(),p.headers.authorization="Bearer ".concat(m),[4,fetch(ne.CREATE_ORDER,Yo(ke({method:"POST"},p),{body:c}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw $t.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=v.data.messageToken||"",w=window.APP_VERSION,b=window.APP_ENV,T={miniAppId:u,orderId:y},E=v.data.method,S=v.data.isCustom,g&&(T.token=g),w&&(T.version=w),b&&(T.env=b),E&&(T.method=E),S&&(T.isCustom=S),O=Ct.encode(T),P=new URL("?".concat(O),re).toString(),A=zt(),I=((null===(h=Se())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,ys(P,{style:"android"===I&&A<742?"normal":"bottomSheet"}).then((function(){var e=!1;At.getInstance().once(f.WebviewClosed,(function(){setTimeout(fe((function(){var t;return ge(this,(function(n){switch(n.label){case 0:return e?[3,2]:[4,Ou({zmpOrderId:y})];case 1:(t=n.sent()).err>=0&&!t.isCustom&&At.getInstance().emit(f.PaymentClose,t.err,Yo(ke({},t),{zmpOrderId:y})),n.label=2;case 2:return[2]}}))})),500)})),At.getInstance().once(f.OpenApp,(function(){e=!0}))}))];case 5:return C.sent(),[2,{orderId:y,messageToken:_}];case 6:throw k=C.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(t,n,r,i,o,a,s){return e.apply(this,arguments)}}(),Au=[ei({amount:Ti.union([Zr(),zr()]),item:Ti.array(Ti.record(Zr(),Ti.any())),desc:Zr(),extradata:Ti.any().optional(),payload:Ti.any().optional(),method:Ti.union([Ti.string(),Ti.object({id:Ti.string(),isCustom:Ti.boolean()})]).optional(),mac:Ti.string().optional()})];function Iu(e){return ku.apply(this,arguments)}function ku(){return ku=fe((function(e){return ge(this,(function(t){return[2,fn("createOrder",Au,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Pu(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 Oe.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Ae("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ku.apply(this,arguments)}var Cu=function(){var e=fe((function(e){return ge(this,(function(t){return[2,new Promise((function(t,n){Qt("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)}}(),Nu=[ei({method:Zr().optional()}).optional()];function Mu(e){return Ru.apply(this,arguments)}function Ru(){return Ru=fe((function(e){return ge(this,(function(t){return[2,fn("selectPaymentMethod",Nu,[e],function(){var e=fe((function(e){var t;return ge(this,(function(n){switch(n.label){case 0:return Oe.isMp?(t=e.method,[4,Cu(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Ae("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ru.apply(this,arguments)}var xu=[ei({data:Ti.union([Zr(),Ti.record(Zr(),Zr())])})];function Du(e){return ju.apply(this,arguments)}function ju(){return ju=fe((function(e){return ge(this,(function(t){return[2,fn("checkTransaction",xu,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ou(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Ae("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ju.apply(this,arguments)}var Uu=[ei({hide:Gr().default(!1).optional()}).optional()];function Lu(e){return Bu.apply(this,arguments)}function Bu(){return Bu=fe((function(e){return ge(this,(function(t){return[2,fn("setAndroidBottomNavigationBar",Uu,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Si.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bu.apply(this,arguments)}var Zu=[ei({hide:Gr().default(!1).optional()}).optional()];function zu(e){return Wu.apply(this,arguments)}function Wu(){return Wu=fe((function(e){return ge(this,(function(t){return[2,fn("setIOSBottomSafeArea",Zu,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Si.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wu.apply(this,arguments)}var Fu=[ei({type:Ti.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Ti.string().optional()}).optional()];function Gu(e){return Hu.apply(this,arguments)}function Hu(){return Hu=fe((function(e){return ge(this,(function(t){return[2,fn("setStatusBar",Fu,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Si.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hu.apply(this,arguments)}var Vu=[ei({headerTextColor:Ti.enum(["black","white"]).optional(),headerColor:Ti.string().optional(),actionBar:ei({hide:Ti.boolean().optional(),title:Ti.string().optional(),leftButton:Ti.enum(["back","none"]).optional(),textAlign:Ti.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Ti.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Ti.boolean().optional(),hideIOSSafeAreaBottom:Ti.boolean().optional()})];function Ku(e){return Ju.apply(this,arguments)}function Ju(){return Ju=fe((function(e){return ge(this,(function(t){return[2,fn("configAppView",Vu,[e],function(){var e=fe((function(e){var t,n,r,i,o,a,s;return ge(this,(function(u){switch(u.label){case 0:return Oe.isMp?pt.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Si.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return pt.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,Si.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Si.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,Si.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Si.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 Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ju.apply(this,arguments)}var qu=function(){var e=fe((function(e,t,n,r,o,a){var s,u,c,l,d,p,f,h,m,v,y,g,_,w;return ge(this,(function(b){switch(b.label){case 0:d=i,(p=new URLSearchParams).append("payType",t||T.SUBSCRIPTION),f=E.UNKNOW,n===oe&&(f=E.IMMEDIATE_AND_CHARGE_FULL_PRICE),n===ie&&(f=E.DEFERRED),p.append("utm",o||"default"),p.append("merchantTransId",a||""),p.append("prorationMode",f.toString()),p.append("appId",d),r&&p.append("method",r),h="",(null===(s=Se())||void 0===s||null===(u=s.platform)||void 0===u?void 0:u.isIOS)?h="ios":(null===(c=Se())||void 0===c||null===(l=c.platform)||void 0===l?void 0:l.isAndroid)&&(h="android"),p.append("os",h),p.append("productId",e),m={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},b.label=1;case 1:return b.trys.push([1,5,,6]),[4,en.getAccessToken().catch((function(){throw $t.error.loginRequired}))];case 2:return v=b.sent(),m.headers.authorization="Bearer ".concat(v),[4,fetch(ne.CREATE_IAP_ORDER,Yo(ke({method:"POST"},m),{body:p}))];case 3:return[4,b.sent().json()];case 4:if(!(y=b.sent()).data||!y.data.store||0!==y.err)throw $t.error.createIAPOrderFailed(y.err);return g=y.data.store,_=y.data.orderId,[2,new Promise((function(e,t){Qt("IAP_REQUESTPAYMENT",ke({},g),{success:function(){e({orderId:_})},fail:function(e){t(e)}})}))];case 5:throw w=b.sent(),console.log("Internal error"),w;case 6:return[2]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),$u=[ei({productId:Zr(),payType:Ti.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Ti.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:Zr().optional(),method:Ti.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:Zr().optional()})];function Qu(e){return Yu.apply(this,arguments)}function Yu(){return Yu=fe((function(e){return ge(this,(function(t){return[2,fn("createOrderIAP",$u,[e],function(){var e=fe((function(e){return ge(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,qu(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Ae("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yu.apply(this,arguments)}var Xu=fe((function(){return ge(this,(function(e){return[2,new Promise((function(e,t){Qt("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ec(e){return tc.apply(this,arguments)}function tc(){return(tc=fe((function(e){return ge(this,(function(t){return[2,fn("minimizeApp",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Xu()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var nc=fe((function(){return ge(this,(function(e){return[2,new Promise((function(e,t){Qt("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function rc(e){return ic.apply(this,arguments)}function ic(){return(ic=fe((function(e){return ge(this,(function(t){return[2,fn("openPermissionSetting",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,nc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var oc=fe((function(){return ge(this,(function(e){return[2,new Promise((function(e,t){Qt("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ac(e){return sc.apply(this,arguments)}function sc(){return(sc=fe((function(e){return ge(this,(function(t){return[2,fn("favoriteApp",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,oc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var uc=fe((function(){return ge(this,(function(e){return[2,new Promise((function(e,t){Qt("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function cc(e){return lc.apply(this,arguments)}function lc(){return(lc=fe((function(e){return ge(this,(function(t){return[2,fn("openGroupList",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,uc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var dc=fe((function(){var e;return ge(this,(function(t){switch(t.label){case 0:return[4,en.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){Qt("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function pc(e){return fc.apply(this,arguments)}function fc(){return(fc=fe((function(e){return ge(this,(function(t){return[2,fn("requestSendNotification",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,dc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var hc=fe((function(){return ge(this,(function(e){return[2,new Promise((function(e,t){Qt("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function mc(e){return vc.apply(this,arguments)}function vc(){return(vc=fe((function(e){return ge(this,(function(t){return[2,fn("addRating",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,hc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ae("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var yc,gc=(yc=fe((function(e,t,n){var r,i;return ge(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,ke({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return yc.apply(this,arguments)}),_c=function(){var e=fe((function(e){return ge(this,(function(t){return[2,new Promise((function(t,n){Qt("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)}}(),wc=[ei({oaId:Zr()})];function bc(e){return Tc.apply(this,arguments)}function Tc(){return Tc=fe((function(e){return ge(this,(function(t){return[2,fn("interactOA",wc,[e],function(){var e=fe((function(e){var t,n,r;return ge(this,(function(o){switch(o.label){case 0:return Oe.isMp?(t=e.oaId,[4,en.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||pt.isEmpty(n)?[3,3]:[4,gc(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,_c(t)];case 4:return[2,o.sent()];case 5:return Oe.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ae("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Tc.apply(this,arguments)}var Ec=[ei({oaId:Zr()})];function Sc(e){return Oc.apply(this,arguments)}function Oc(){return Oc=fe((function(e){return ge(this,(function(t){return[2,fn("isAllowedInteractWithOA",Ec,[e],function(){var e=fe((function(e){var t,n,r;return ge(this,(function(o){switch(o.label){case 0:return Oe.isMp?(t=e.oaId,[4,en.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||pt.isEmpty(n)?[3,3]:[4,gc(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 Oe.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Ae("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oc.apply(this,arguments)}function Pc(e){return Ac.apply(this,arguments)}function Ac(){return(Ac=fe((function(e){return ge(this,(function(t){return[2,fn("getSetting",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Jt()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Ae("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Ic=Ti.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),kc=[ei({scopes:Ti.array(Ic).max(2).optional()}).optional()];function Cc(e){return Nc.apply(this,arguments)}function Nc(){return Nc=fe((function(e){return ge(this,(function(t){return[2,fn("authorize",kc,[e],function(){var e=fe((function(e){var t,n,r,i;return ge(this,(function(o){switch(o.label){case 0:return Oe.isMp?(n=null==e?void 0:e.scopes,r=zt(),("android"===(i=((null===(t=Se())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject($t.error.clientNotSupport())]:[4,Yt(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ae("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Nc.apply(this,arguments)}var Mc=fe((function(){return ge(this,(function(e){return[2,new Promise(function(){var e=fe((function(e,t){var n;return ge(this,(function(r){switch(r.label){case 0:return pt.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($t.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Rc(e){return fn("checkZaloCameraPermission",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return[4,Mc()];case 1:return[2,e.sent()]}}))})))}var xc=fe((function(){return ge(this,(function(e){return[2,new Promise(function(){var e=fe((function(e,t){var n,r,i;return ge(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,en.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=en.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 Dc(e){return jc.apply(this,arguments)}function jc(){return(jc=fe((function(e){return ge(this,(function(t){return[2,fn("getUserID",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,xc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ae("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var Uc=fe((function(){return ge(this,(function(e){return[2,new Promise(function(){var e=fe((function(e,t){var n,r,i;return ge(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,en.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=en.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 Lc(e){return Bc.apply(this,arguments)}function Bc(){return(Bc=fe((function(e){return ge(this,(function(t){return[2,fn("getIDToken",[],[e],fe((function(){return ge(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Uc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ae("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Zc={format:C.JPEG,quality:N.NORMAL,mirrored:!1,useVideoSourceSize:!1},zc={width:1024,height:768,facingMode:k.FRONT,mirrored:!1,audio:!1,video:!0},Wc=function(){function e(t){var n,r,i,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=this;ft(this,e),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(u.haveVideoStream()&&u._userRequestFrameCallback){var e=u.getCanvas();if(u.drawFrame(),e){var t={data:e.toDataURL(C.PNG),width:e.width,height:e.height};At.getInstance().emit(I.OnFrameCallback,0,t),requestAnimationFrame(u.tick)}}},this._videoElement=t,this._mediaConstraints=null!=s?s:null,this._facingMode=null!==(n=null==s?void 0:s.facingMode)&&void 0!==n?n:zc.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(r=null==s?void 0:s.deviceId)&&void 0!==r?r:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(i=null==s?void 0:s.mirrored)&&void 0!==i?i:zc.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(o=null==s?void 0:s.audio)&&void 0!==o?o:zc.audio,this._videoEnabled=null!==(a=null==s?void 0:s.video)&&void 0!==a?a:zc.video}var t=e.prototype;return t.on=function(e,t){At.getInstance().on(e,(function(e){t(e)})),e===I.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},t.off=function(e){At.getInstance().off(e),e===I.OnFrameCallback&&(this._userRequestFrameCallback=!1)},t.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},t.getFacingMode=function(){return this._facingMode},t.getCameraList=function(){return this._cameraList},t.getCameraCount=function(){return this._cameraList.length},t.getSelectedDeviceId=function(){return this._selectedDeviceId},t.setDeviceId=function(e){var t=this;return fe((function(){return ge(this,(function(n){switch(n.label){case 0:return t._selectedDeviceId=e,t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},t.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},t.updateMediaConstraints=function(e){var t=this;return fe((function(){var n,r,i,o,a,s;return ge(this,(function(u){switch(u.label){case 0:return pt.isEmpty(e)?[2]:JSON.stringify(e)!==JSON.stringify(t._mediaConstraints)?(t._mediaConstraints=e,t._facingMode=null!==(n=null==e?void 0:e.facingMode)&&void 0!==n?n:t._facingMode,t._selectedDeviceId=null!==(r=null==e?void 0:e.deviceId)&&void 0!==r?r:t._selectedDeviceId,t._mirror=null!==(i=null==e?void 0:e.mirrored)&&void 0!==i?i:t._mirror,t._audioEnabled=null!==(o=null==e?void 0:e.audio)&&void 0!==o?o:t._audioEnabled,t._videoEnabled=null!==(a=null==e?void 0:e.video)&&void 0!==a?a:t._videoEnabled,t._selectedDeviceId=null!==(s=null==e?void 0:e.deviceId)&&void 0!==s?s:t._selectedDeviceId,t._hasUserMedia?[4,t.stream()]:[3,2]):[2];case 1:u.sent(),u.label=2;case 2:return[2]}}))}))()},t.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||zc.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||zc.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},t.selectCamera=function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._cameraList[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;if(this._facingMode==k.FRONT&&o.label.toLowerCase().includes("front")||this._facingMode==k.BACK&&o.label.toLowerCase().includes("back")){this._selectedDeviceId=o.deviceId;break}}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}},t.flip=function(){var e=this;return fe((function(){return ge(this,(function(t){switch(t.label){case 0:return e._facingMode=e._facingMode==k.FRONT?k.BACK:k.FRONT,e._videoElement.style.transform="",e.selectCamera(),e._hasUserMedia?[4,e.stream()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))()},t.start=function(){var e=this;return fe((function(){var t,n;return ge(this,(function(r){return t=At.getInstance(),n=function(t){try{e._hasUserMedia&&e.stop()}catch(e){}},t.off(f.AppPaused,n),t.on(f.AppPaused,n),[2,new Promise(function(){var t=fe((function(t,n){var r;return ge(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e.stream()];case 1:return i.sent(),At.getInstance().emit(I.OnStartCallback,0),t(e._selectedDeviceId),[3,3];case 2:return r=i.sent(),n(r),[3,3];case 3:return[2]}}))}));return function(e,n){return t.apply(this,arguments)}}())]}))}))()},t.info=function(){var e=this;return fe((function(){return ge(this,(function(t){return[2,new Promise((function(t,n){navigator.mediaDevices.enumerateDevices().then((function(n){e.getVideoInputs(n),t(e._cameraList)})).catch((function(e){n(e)}))}))]}))}))()},t.stream=function(){var e=this;return fe((function(){return ge(this,(function(t){return[2,new Promise((function(t,n){try{e._stop();var r=e.getCurrentMediaConstraints();if(!1===r.video&&!r.audio)return void t(e._facingMode);navigator.mediaDevices.getUserMedia(r).then(function(){var n=fe((function(n){return ge(this,(function(r){switch(r.label){case 0:return[4,e.info()];case 1:return r.sent(),e.selectCamera(),e.handleUserMedia(null,n),t(e._facingMode),[2]}}))}));return function(e){return n.apply(this,arguments)}}()).catch((function(t){e.handleUserMedia(t),n(t)}))}catch(e){n(e)}}))]}))}))()},t.handleUserMedia=function(e,t){var n=this;if(!e&&t){this._stream=t;try{this._videoElement&&(this._videoElement.srcObject=t,(this._facingMode==k.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){n._userRequestFrameCallback&&n.tick()},this._videoElement.play().then((function(){n._hasUserMedia=!0})).catch((function(e){n._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},t.updateTrackEnable=function(e,t){var n=this;return fe((function(){return ge(this,(function(r){switch(r.label){case 0:if(e===M.VIDEO){if(n._videoEnabled===t)return[2];n._videoEnabled=t}else{if(n._audioEnabled===t)return[2];n._audioEnabled=t}return[4,n.stream()];case 1:return r.sent(),[2]}}))}))()},t.pause=function(e){var t=this;return fe((function(){return ge(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},t.resume=function(e){var t=this;return fe((function(){return ge(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},t.isUsing=function(){return this._hasUserMedia},t.stop=function(){this._stop(),At.getInstance().emit(I.OnStopCallback,0)},t._stop=function(){e.stopMediaStream(this._stream),this._hasUserMedia=!1},t.setFacingMode=function(e){this._facingMode=e},t.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},t.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||Zc.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},t.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},t.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},t.drawFrame=function(e){var t=this._videoElement,n=e||{};if(t&&this._ctx&&this._canvasElement){var r=this._canvasElement,i=this._ctx;r.width=(null==n?void 0:n.width)||r.width,r.height=(null==n?void 0:n.height)||r.height,((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===k.FRONT)&&(i.translate(r.width,0),i.scale(-1,1)),i.drawImage(t,0,0,r.width,r.height),((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===k.FRONT)&&(i.scale(-1,1),i.translate(-r.width,0))}},e.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},e}(),Fc=ei({play:Ti.function(),pause:Ti.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),Gc=[ei({videoElement:Fc,mediaConstraints:Ti.object({width:Ti.number().min(100).optional(),height:Ti.number().min(100).optional(),facingMode:Ti.string().optional(),audio:Ti.boolean().optional(),video:Ti.boolean().optional(),deviceId:Ti.string().optional(),mirrored:Ti.boolean().optional()}).nullish()}).optional()];function Hc(e){return fn("createCameraContext",Gc,[e],(function(e){return console.log("createCameraContext",e),new Wc(e.videoElement,e.mediaConstraints)}))}var Vc=function(){function e(){var t,n;ft(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=ye(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;pt.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?pt.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?pt.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 Kc(e){return Jc.apply(this,arguments)}function Jc(){return(Jc=fe((function(e){return ge(this,(function(t){return[2,fn("setupAd",[],[e],(function(){return Vc.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var qc=[ei({ids:Ti.union([Ti.string(),Ti.array(Ti.string())]),config:ei({display:Ti.boolean().optional(),onClose:Ti.function().optional()}).optional()})];function $c(e){return Qc.apply(this,arguments)}function Qc(){return Qc=fe((function(e){return ge(this,(function(t){return[2,fn("loadAd",qc,[e],function(){var e=fe((function(e){return ge(this,(function(t){return Vc.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qc.apply(this,arguments)}var Yc=[ei({id:Ti.string()})];function Xc(e){return el.apply(this,arguments)}function el(){return el=fe((function(e){return ge(this,(function(t){return[2,fn("displayAd",Yc,[e],function(){var e=fe((function(e){return ge(this,(function(t){return Vc.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),el.apply(this,arguments)}var tl=[ei({id:Ti.string().optional()}).optional()];function nl(e){return rl.apply(this,arguments)}function rl(){return rl=fe((function(e){return ge(this,(function(t){return[2,fn("refreshAd",tl,[e],function(){var e=fe((function(e){return ge(this,(function(t){return Vc.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rl.apply(this,arguments)}var il=[ei({id:Zr(),guidingText:Zr().optional(),color:Zr().optional(),onStatusChange:Ti.function().optional()})];function ol(e){return al.apply(this,arguments)}function al(){return al=fe((function(t){return ge(this,(function(n){return[2,fn("showOAWidget",il,[t],function(){var t=fe((function(t){var n,r,i,o,a,s,u,c;return ge(this,(function(l){if(Oe.isMp){try{n=document.getElementById(t.id),r=t.onStatusChange,i=t.guidingText,o=t.color,a=e(t,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="iframeOAWidget_".concat(Date.now()),(c=new URL("https://h5.zalo.me/widgets/oa_widget.html")).searchParams.set("id",u),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=Ce(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.addEventListener("message",function(){var e=fe((function(e){var t,n,i,o,a,s,l,d;return ge(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(u),i=t.type,(o=new URL(t.href)).origin!==c.origin||o.pathname!==c.pathname||t.id!==u?[3,3]:"followOA"!==i&&"getOAInfo"!==i?[3,2]:[4,en.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=en.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},"*"),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?Go(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),al.apply(this,arguments)}var sl=[ei({id:Zr(),type:Zr(),text:Zr(),color:Zr().optional(),disabled:Ti.boolean().optional(),onDataReceived:Ti.function().optional(),onError:Ti.function().optional()})];function ul(e){return cl.apply(this,arguments)}function cl(){return cl=fe((function(t){return ge(this,(function(n){return[2,fn("showFunctionButtonWidget",sl,[t],function(){var t=fe((function(t){var n,r,i,o,a,s,u;return ge(this,(function(c){if(Oe.isMp){try{n=document.getElementById(t.id),r=t.onDataReceived,i=t.onError,o=e(t,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="iframeFunctionButtonWidget".concat(Date.now()),(u=new URL("https://h5.zalo.me/widgets/function_button_widget.html")).searchParams.set("id",s),Object.entries(o).forEach((function(e){var t=Ce(e,2),n=t[0],r=t[1];r&&u.searchParams.set("data-".concat(n),String(r))})),a.id=s,a.src=u.href,a.style.width="100%",a.style.height="100%",a.style.border="none",Object.entries(o).forEach((function(e){var t=Ce(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.addEventListener("message",function(){var e=fe((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return ge(this,(function(g){switch(g.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(s),a=t.type,(c=new URL(t.href)).origin!==u.origin||c.pathname!==u.pathname||t.id!==s?[3,4]:"buttonClicked"!==a?[3,3]:[4,en.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=en.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=en.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,vn()];case 2:return m=g.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},"*"),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(null==r||r(null==v?void 0:v.data)):"onError"===a&&(null==(y=t.payload)?void 0:y.type)===o.type&&(null==i||i(null==y?void 0:y.data)),g.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ae("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),cl.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:wn},hn();var ll=Object.freeze({__proto__:null,get Events(){return f},get EventName(){return f},get CameraEvents(){return I},login:hn,getAccessToken:vn,getVersion:wn,getSystemInfo:Tn,setNavigationBarTitle:Pi,setNavigationBarColor:ki,setNavigationBarLeftButton:Mi,setStorage:io,getStorage:so,getStorageInfo:co,removeStorage:fo,clearStorage:vo,getUserInfo:wo,getNetworkType:So,onNetworkStatusChange:Ao,startBeaconDiscovery:Co,stopBeaconDiscovery:Ro,getBeacons:jo,closeApp:Bo,scanQRCode:Wo,openProfile:Vo,openChat:$o,openPostFeed:ta,followOA:oa,unfollowOA:ca,openShareSheet:ha,requestCameraPermission:ya,createShortcut:Ea,openBioAuthentication:Aa,checkStateBioAuthentication:Ca,showToast:xa,hideKeyboard:Ua,openPhone:za,openSMS:Ha,viewOAQr:qa,keepScreen:Xa,onKeepScreen:ts,offKeepScreen:rs,saveImageToGallery:ss,openMiniApp:ds,vibrate:ms,openWebview:_s,getRouteParams:Ts,getAppInfo:Es,sendDataToPreviousMiniApp:As,getPhoneNumber:Cs,openProfilePicker:xs,connectWifi:Ls,openMediaPicker:Ws,getShareableLink:Hs,closeLoading:Js,requestUpdateZalo:$s,onConfirmToExit:eu,offConfirmToExit:tu,getDeviceId:nu,getDeviceIdAsync:ru,getContext:ou,getContextAsync:au,getAuthCode:uu,getZPIToken:lu,setAccessToken:fu,openOutApp:mu,chooseImage:gu,getLocation:bu,onCallbackData:Su,createOrder:Iu,selectPaymentMethod:Mu,checkTransaction:Du,events:Ys,setAndroidBottomNavigationBar:Lu,setIOSBottomSafeArea:zu,setStatusBar:Gu,configAppView:Ku,createOrderIAP:Qu,minimizeApp:ec,openPermissionSetting:rc,favoriteApp:ac,openGroupList:cc,requestSendNotification:pc,addRating:mc,interactOA:bc,interactOa:bc,isAllowedInteractWithOA:Sc,getSetting:Pc,authorize:Cc,checkZaloCameraPermission:Rc,getUserID:Dc,getIDToken:Lc,createCameraContext:Hc,setupAd:Kc,loadAd:$c,displayAd:Xc,refreshAd:nl,showOAWidget:ol,showFunctionButtonWidget:ul,get FacingMode(){return k},get PhotoFormat(){return C},get PhotoQuality(){return N},get StreamType(){return M},ZMACameraImp:Wc}),dl=Iu,pl=Du,fl=Qu,hl=Mu,ml=e(ll,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod"]),vl={createOrder:dl,checkTransaction:pl,createOrderIAP:fl,selectPaymentMethod:hl};!function(){var e,t=null===(e=Se())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,ll))}();var yl=Object.freeze({__proto__:null,Payment:vl,default:ml,get Events(){return f},get EventName(){return f},get CameraEvents(){return I},login:hn,getAccessToken:vn,getVersion:wn,getSystemInfo:Tn,setNavigationBarTitle:Pi,setNavigationBarColor:ki,setNavigationBarLeftButton:Mi,setStorage:io,getStorage:so,getStorageInfo:co,removeStorage:fo,clearStorage:vo,getUserInfo:wo,getNetworkType:So,onNetworkStatusChange:Ao,startBeaconDiscovery:Co,stopBeaconDiscovery:Ro,getBeacons:jo,closeApp:Bo,scanQRCode:Wo,openProfile:Vo,openChat:$o,openPostFeed:ta,followOA:oa,unfollowOA:ca,openShareSheet:ha,requestCameraPermission:ya,createShortcut:Ea,openBioAuthentication:Aa,checkStateBioAuthentication:Ca,showToast:xa,hideKeyboard:Ua,openPhone:za,openSMS:Ha,viewOAQr:qa,keepScreen:Xa,onKeepScreen:ts,offKeepScreen:rs,saveImageToGallery:ss,openMiniApp:ds,vibrate:ms,openWebview:_s,getRouteParams:Ts,getAppInfo:Es,sendDataToPreviousMiniApp:As,getPhoneNumber:Cs,openProfilePicker:xs,connectWifi:Ls,openMediaPicker:Ws,getShareableLink:Hs,closeLoading:Js,requestUpdateZalo:$s,onConfirmToExit:eu,offConfirmToExit:tu,getDeviceId:nu,getDeviceIdAsync:ru,getContext:ou,getContextAsync:au,getAuthCode:uu,getZPIToken:lu,setAccessToken:fu,openOutApp:mu,chooseImage:gu,getLocation:bu,onCallbackData:Su,createOrder:Iu,selectPaymentMethod:Mu,checkTransaction:Du,events:Ys,setAndroidBottomNavigationBar:Lu,setIOSBottomSafeArea:zu,setStatusBar:Gu,configAppView:Ku,createOrderIAP:Qu,minimizeApp:ec,openPermissionSetting:rc,favoriteApp:ac,openGroupList:cc,requestSendNotification:pc,addRating:mc,interactOA:bc,interactOa:bc,isAllowedInteractWithOA:Sc,getSetting:Pc,authorize:Cc,checkZaloCameraPermission:Rc,getUserID:Dc,getIDToken:Lc,createCameraContext:Hc,setupAd:Kc,loadAd:$c,displayAd:Xc,refreshAd:nl,showOAWidget:ol,showFunctionButtonWidget:ul,get FacingMode(){return k},get PhotoFormat(){return C},get PhotoQuality(){return N},get StreamType(){return M},ZMACameraImp:Wc,get NetworkType(){return d},get PlatformType(){return p},get JumpStatus(){return h},get ProfileType(){return m},get ChatType(){return v},get PostFeedType(){return y},get ShareSheetType(){return g},get OrientationType(){return _},get VibrateType(){return w},get MediaPickerType(){return b},get IAPPayType(){return T},get ProrationMode(){return E},get StatusBarType(){return S},get AndroidBottomNavigationBarType(){return O},get IOSSafeAreaBottomType(){return P},get TextAlignType(){return A}});window.ZaloMiniAppSDK=yl}();
|
|
10
|
+
!function(){"use strict";function e(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}var t,n=1048576,r=window.zAppID,i=window.APP_ID,o="https://zalo.me/s",a="https://h5.zdn.vn/zapps",s="h5.zdn.vn",u="/zapps",c={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSION:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType",UTOKEN_ZPI:"h5.zdn.vn_utoken_zpi",GTOKEN_ZPI:"h5.zdn.vn_gtoken_zpi",ZPP_ZPI:"h5.zdn.vn_zpp_zpi",ZPT_ZPI:"h5.zdn.vn_zpt_zpi"},l={GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token",GET_LIST_USER_INFO:"https://graph.zalo.me/v2.0/me/friends/list",CREATE_ORDER:"https://payment-mini.zalo.me/api/order/create",GET_APP_INFO:"https://h5.zalo.me/apps/get-info",SEND_ACTION_LOG:"https://h5.zalo.me/log/async",CREATE_SHARE_LINK:"https://h5.zalo.me/openapi/create-sharelink",CHECK_INTERACT_OA:"https://h5.zalo.me/openapi/check-interact-oa",GET_AUTH_SETTING:"https://h5.zalo.me/apis/users/auth-settings"};!function(e){e.REQUEST="REQUEST",e.MODIFIED_REQUEST="MODIFIED_REQUEST",e.RESPONSE="RESPONSE",e.MODIFIED_RESPONSE="MODIFIED_RESPONSE",e.NOT_FOUND="NOT_FOUND"}(t||(t={}));var d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A,I,k,C,N,M,x=0,R=-2e3,D=-1400,j=-1500,U=-1401,L=-1404,B=-1408,Z=-2004,z=-2005,W="Success",F="Unknown error. Please try again later.",G="Request timeout. Please try again later.",H="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",V="Login failed",K="This API is not supported in this version of Zalo",J="User Authentication Required. Please grant User Authentication permission before requesting User Permission",q="Unable to pick media",$="Unable to save image",Q={SUCCESS:{code:x,message:W},UNKNOWN_ERROR:{code:R,message:F},UNAUTHORIZED:{code:U,message:H},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:L,message:K},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:B,message:G},USER_DENIED:{code:-2002,message:"User denied"},USER_CANCEL:{code:-2003,message:"User cancel"}},Y={GET_DOWNLOADED_STICKER:{haveCallback:!0},OPEN_SHARE_STICKER:{},OPEN_PROFILE:{requireAccessToken:!0},OPEN_FEED_DETAIL:{},OPEN_FRIEND_RADA:{},OPEN_INAPP:{},OPEN_OUTAPP:{requireAccessToken:!0},OPEN_PAGE:{},OPEN_PHOTODETAIL:{},OPEN_GALARY:{},OPEN_GAMECENTER:{},OPEN_GAMENEWS:{},OPEN_TAB_CONTACT:{},OPEN_TAB_SOCIAL:{},OPEN_FRIENDSUGGEST:{},OPEN_GROUPLIST:{},OPEN_NEARBY:{},OPEN_ROOM:{},OPEN_STICKERSTORE:{},OPEN_CREATECHAT:{},COPY_LINK_CATESTICKER:{},REQUEST_BUY_STICKER:{},OPEN_CHAT:{requireAccessToken:!0},OPEN_TAB_CHAT:{},OPEN_CHATGROUP:{},OPEN_ADDFRIEND:{},OPEN_TAB_MORE:{},OPEN_POSTFEED:{requireAccessToken:!0},OPEN_LOGINDEVICES:{},OPEN_SENDSTICKER:{},REPORT_ABUSE:{haveCallback:!0},FOLLOW_OA:{haveCallback:!0,requireAccessToken:!0},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:Q.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:Q.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:Q.USER_DENIED}},iOS:{"-2":{mapTo:Q.USER_DENIED}}}},CHANGE_TITLE_HEADER:{skipJump:!0},WEBVIEW_CLEARCACHE:{},WEBVIEW_CONFIRMCACHE:{},WEBVIEW_ISVISIBLE:{},WEBVIEW_NETWORKTYPE:{skipJump:!0},CHANGE_BUTTON_HEADER:{},CREATE_OPTIONS_MENU:{skipJump:!0,haveCallback:!0},CREATE_SHORTCUT:{requireAccessToken:!0},CHANGE_ACTIONBAR_LEFTBUTTON_TYPE:{skipJump:!0,haveCallback:!0},WINDOW_CLOSE:{skipJump:!0,haveCallback:!0},WEBVIEW_CHECKRESERROR:{},IAP_REQUESTPAYMENT:{haveCallback:!0},ZBROWSER_GETSTATS:{},ZBROWSER_JSBRIDGE:{skipJump:!0,haveCallback:!0},PROMPT_AUTHENTICATION:{},CHANGE_ACTIONBAR_COLOR:{skipJump:!0},PROMPT_AUTHENTICATION_CHECK_STATE:{},OPEN_APPSTORE:{},GET_LOCATION:{haveCallback:!0,errorList:{android:{"-1":{mapTo:Q.USER_DENIED}},iOS:{"-1":{mapTo:Q.USER_DENIED}}}},QUERY_LOCATION_HIDE:{haveCallback:!0},SHOW_TOAST:{haveCallback:!0,timeout:2},OPEN_APP:{},HIDE_KEYBOARD:{},OPEN_PHONE:{},OPEN_QR:{},OPEN_SMS:{},VIEW_MYQR:{haveCallback:!0,timeout:!0,requireAccessToken:!0},KEEP_SCREEN:{haveCallback:!0,timeout:2},CHANGE_AUTOROTATE:{skipJump:!0},CHECK_APP_INSTALLED:{},QUERY_SHOW:{},QUERY_HIDE:{},OPEN_INAPPRW:{},ZALORUN_GETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_SETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_GETDAYSTEP:{haveCallback:!0},ZALORUN_FORCESUBMITDATA:{haveCallback:!0},ZALORUN_SETWEIGHT:{haveCallback:!0},OPEN_PROFILE_EXT:{},DOWNLOAD_CATE:{haveCallback:!0},JUMP_LOGIN:{skipJump:!0,whiteList:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{},OPEN_ADTIMA_ADS:{},GET_ADIDCLIENT:{},SCAN_IBEACON:{},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:z,message:$},needMoreDetail:!0},"-102":{mapTo:{code:z,message:$},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:z,message:$},needMoreDetail:!0}}}},OPEN_MP:{versionLive:{iOS:402}},CHANGE_ACTIONBAR:{haveCallback:!0,timeout:2,versionLive:{iOS:402},skipJump:!0},ZBROWSER_MPDS:{haveCallback:!0,timeout:2,versionLive:{iOS:402}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:Q.USER_DENIED},"-101":{mapTo:Q.USER_DENIED}},iOS:{"-1":{mapTo:Q.USER_DENIED},"-10":{mapTo:Q.USER_DENIED}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:Q.USER_CANCEL}},iOS:{"-101":{mapTo:Q.USER_CANCEL}}}},GET_SUPPORTED_ACTIONS:{whiteList:!0},MP_JOIN_WIFI:{haveCallback:!0,timeout:!0,versionLive:{android:0,iOS:0},havePermission:!1,whiteList:!1},PICK_MEDIA:{requireAccessToken:!0,versionLive:{iOS:440},errorList:{android:{"-101":{mapTo:Q.USER_CANCEL},999:{mapTo:{code:Z,message:q},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:Z,message:q}}}}},MP_CLOSE_LOADINGVIEW:{skipJump:!0},CHANGE_BOTTOMBAR:{haveCallback:!0,timeout:2,skipJump:!0},MA_MENU_MINIMIZE:{skipJump:!1,versionLive:{iOS:520}},MA_MENU_PERMISSION:{skipJump:!1,versionLive:{iOS:520}},MA_MENU_FAVORITES:{skipJump:!1,versionLive:{iOS:520}},MP_SEND_NOTIFICATION:{skipJump:!1,versionLive:{iOS:530},errorList:{android:{"-1":{mapTo:Q.USER_DENIED}},iOS:{"-1":{mapTo:Q.USER_DENIED}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1},MP_USER_AUTHORIZE:{skipJump:!1},MP_SELECT_PAYMENT_METHOD:{skipJump:!1}},X={android:{"-4":Q.DECODE_FAILED,"-5":Q.CLIENT_NOT_SUPPORT,"-14":Q.TIME_OUT},iOS:{"-9":Q.DECODE_FAILED,"-5":Q.CLIENT_NOT_SUPPORT,"-14":Q.TIME_OUT}},ee={android:12100615,iOS:460,wp:0,unknown:0},te=5*n,ne="https://payment-mini.zalo.me/api/order/create",re="https://payment-mini.zalo.me/api/order/iap-create",ie="https://payment-mini.zalo.me/api/transaction",oe="DEFERRED",ae="IMMEDIATE_AND_CHARGE_FULL_PRICE",se={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},ue=5,ce=6,le="#1843EF",de=0,pe={"-12101":"Invalid params","-12102":"Session expire","-12103":"Not permission","-12104":"Not Authorize","-12105":"Unknown exception","-12106":"Cannot create order","-12107":"Transaction not found","-12108":"Cannot update order","-12109":"Cannot decode param","-12110":"Version not support","-12111":"Receipt expire","-12112":"Product not found","-12113":"Subscription other GW","-12114":"Product already subcription","-12115":"Not exist","-12116":"Already exist","-12117":"Not allow","-12118":"Not permit","-12119":"Internal error","-2":"Unable to pay","-6":"Unable to register","-7":"Registered account","-832":"Purchased by another account","-833":"Register for another account","-834":"Unable to register","-2010":"System is maintaining","-3999":"Not in Vietnam","-12129":"Purchased by another account",123:"An error has occurred"};function fe(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function he(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){fe(o,r,i,a,s,"next",e)}function s(e){fe(o,r,i,a,s,"throw",e)}a(void 0)}))}}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ve(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ye(e,t){if(e){if("string"==typeof e)return me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?me(e,t):void 0}}function ge(e){return function(e){if(Array.isArray(e))return me(e)}(e)||ve(e)||ye(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _e(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function we(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{return e.apply(void 0,ge(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function be(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(s)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(u)),isMpWeb:window.location.hostname.includes("localhost")}}we.async=function(e){return he((function(){var t,n,r,i,o=arguments;return _e(this,(function(a){switch(a.label){case 0:for(t=o.length,n=new Array(t),r=0;r<t;r++)n[r]=o[r];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.apply(void 0,ge(n))];case 2:return[2,a.sent()];case 3:return i=a.sent(),"undefined"!=typeof console&&console.error&&console.error(i),[2,null];case 4:return[2]}}))}))},function(e){e.none="none",e.wifi="wifi",e.cellular="cellular",e.unknown="unknown"}(d||(d={})),function(e){e.wp="wp",e.android="android",e.iOS="iOS",e.unknown="unknown"}(p||(p={})),function(e){e.AppPaused="h5.event.paused",e.AppResumed="h5.event.resumed",e.NetworkChanged="h5.event.connection.changed",e.OnDataCallback="h5.event.webview.result",e.WebviewClosed="h5.event.webview.close",e.OpenApp="h5.event.open.mp",e.AppClose="h5.event.action.close",e.PaymentCallback="payment.callback",e.PaymentResult="action.payment.result",e.PaymentClose="action.payment.close"}(f||(f={})),function(e){e.DOING="doing",e.DONE="done"}(h||(h={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa",e[e.aliasOA=2]="aliasOA"}(m||(m={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa"}(v||(v={})),function(e){e[e.image=1]="image",e[e.link=4]="link",e[e.profile=5]="profile"}(y||(y={})),function(e){e[e.image=1]="image",e[e.gif=11]="gif",e[e.video=12]="video",e[e.link=4]="link",e[e.oa=5]="oa",e[e.zmp=20]="zmp",e[e.multi_image=21]="multi_image",e[e.zmp_deep_link=4]="zmp_deep_link",e[e.text=22]="text"}(g||(g={})),function(e){e[e.auto=1]="auto",e[e.portrait=2]="portrait",e[e.landscape=3]="landscape"}(_||(_={})),function(e){e[e.oneShot=0]="oneShot"}(w||(w={})),function(e){e[e.zcamera=3]="zcamera",e[e.zcamera_photo=1]="zcamera_photo",e[e.zcamera_video=2]="zcamera_video",e[e.zcamera_scan=7]="zcamera_scan",e[e.photo=4]="photo",e[e.video=5]="video",e[e.file=6]="file"}(b||(b={})),function(e){e.SUBSCRIPTION="SUBSCRIPTION",e.ONETIME="ONETIME"}(T||(T={})),function(e){e[e.UNKNOW=0]="UNKNOW",e[e.DEFERRED=1]="DEFERRED",e[e.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE"}(E||(E={})),function(e){e[e.normal=1]="normal",e[e.hidden=0]="hidden",e[e.transparent=2]="transparent"}(S||(S={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(P||(P={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(O||(O={})),function(e){e[e.left=0]="left",e[e.center=1]="center"}(A||(A={})),function(e){e.OnFrameCallback="h5.event.camera.frame",e.OnStartCallback="h5.event.camera.start",e.OnStopCallback="h5.event.camera.stop"}(I||(I={})),function(e){e.FRONT="user",e.BACK="environment"}(k||(k={})),function(e){e.WEBP="image/webp",e.PNG="image/png",e.JPEG="image/jpeg"}(C||(C={})),function(e){e.HIGH="high",e.NORMAL="normal",e.LOW="low"}(N||(N={})),function(e){e.VIDEO="video",e.AUDIO="audio"}(M||(M={}));var Te,Ee=function(e){return e.isAndroid?p.android:e.isIOS?p.iOS:p.unknown};function Se(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Pe(){var e=function(){var e=we((function(){return window.navigator.userAgent.toLowerCase()}))();if(e){var t=function(e){return{isAndroid:/android/i.test(e)&&!/iemobile/.test(e),isIOS:/iphone|ios|ipad|ipod/.test(e)&&!/iemobile/.test(e),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(e),isZalo:/zalo/.test(e)}}(e);return{appEnv:be(),platform:t,platformName:Ee(t),zaloVersion:Se(e).trim()}}}();if(e)return e}var Oe=(null===(Te=Pe())||void 0===Te?void 0:Te.appEnv)||{};function Ae(e){Ae.on&&Ae.engine(e)}Ae.on=!1,Ae.engine=function(e){var t=e.name,n=e.type,r=e.state,i=e.request,o=e.response,a=e.stage;console[n]([t,a,r,i,o].filter(Boolean).map((function(e){return"object"==typeof e?JSON.stringify(e):e})).join("; "))};var Ie=function(e,n){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==n||null===(r=n.fail)||void 0===r||r.call(n,i),Ae({stage:t.NOT_FOUND,type:"error",name:e,request:n,state:"fail",response:i})};function ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ke(e,t,n[t])}))}return e}function Ne(e,t){return function(e){if(Array.isArray(e))return e}(e)||ve(e)||ye(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Me="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function xe(){throw new Error("setTimeout has not been defined")}function Re(){throw new Error("clearTimeout has not been defined")}var De=xe,je=Re;function Ue(e){if(De===setTimeout)return setTimeout(e,0);if((De===xe||!De)&&setTimeout)return De=setTimeout,setTimeout(e,0);try{return De(e,0)}catch(t){try{return De.call(null,e,0)}catch(t){return De.call(this,e,0)}}}"function"==typeof Me.setTimeout&&(De=setTimeout),"function"==typeof Me.clearTimeout&&(je=clearTimeout);var Le,Be=[],Ze=!1,ze=-1;function We(){Ze&&Le&&(Ze=!1,Le.length?Be=Le.concat(Be):ze=-1,Be.length&&Fe())}function Fe(){if(!Ze){var e=Ue(We);Ze=!0;for(var t=Be.length;t;){for(Le=Be,Be=[];++ze<t;)Le&&Le[ze].run();ze=-1,t=Be.length}Le=null,Ze=!1,function(e){if(je===clearTimeout)return clearTimeout(e);if((je===Re||!je)&&clearTimeout)return je=clearTimeout,clearTimeout(e);try{je(e)}catch(t){try{return je.call(null,e)}catch(t){return je.call(this,e)}}}(e)}}function Ge(e,t){this.fun=e,this.array=t}Ge.prototype.run=function(){this.fun.apply(null,this.array)};function He(){}var Ve=He,Ke=He,Je=He,qe=He,$e=He,Qe=He,Ye=He;var Xe=Me.performance||{},et=Xe.now||Xe.mozNow||Xe.msNow||Xe.oNow||Xe.webkitNow||function(){return(new Date).getTime()};var tt=new Date;var nt,rt={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Be.push(new Ge(e,t)),1!==Be.length||Ze||Ue(Fe)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Ve,addListener:Ke,once:Je,off:qe,removeListener:$e,removeAllListeners:Qe,emit:Ye,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*et.call(Xe),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-tt)/1e3}},it=rt,ot="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function at(e){return e&&e.constructor===Symbol?"symbol":typeof e}function st(e){return"function"==typeof window.Debug?window.Debug(e):function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n]}}!function(e){!function(t){var n="object"==typeof ot?ot:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),r=i(e);function i(e,t){return function(n,r){"function"!=typeof e[n]&&Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0===n.Reflect?n.Reflect=e:r=i(n.Reflect,r),function(e){var t=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return re(Object.create(null))}:a?function(){return re({__proto__:null})}:function(){return re({})},has:s?function(e,n){return t.call(e,n)}:function(e,t){return t in e},get:s?function(e,n){return t.call(e,n)?e[n]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),l="object"==typeof it&&it.env&&"true"===it.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?te():Set,f=new(l||"function"!=typeof WeakMap?ne():WeakMap);function h(e,t,n,r){if(D(n)){if(!G(e))throw new TypeError;if(!V(t))throw new TypeError;return S(e,t)}if(!G(e))throw new TypeError;if(!L(t))throw new TypeError;if(!L(r)&&!D(r)&&!j(r))throw new TypeError;return j(r)&&(r=void 0),P(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!L(n))throw new TypeError;if(!D(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!L(n))throw new TypeError;return D(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!L(t))throw new TypeError;return D(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!L(t))throw new TypeError;return D(n)||(n=F(n)),I(e,t,n)}function _(e,t,n){if(!L(t))throw new TypeError;return D(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!L(t))throw new TypeError;return D(n)||(n=F(n)),C(e,t,n)}function b(e,t){if(!L(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function T(e,t){if(!L(e))throw new TypeError;return D(t)||(t=F(t)),x(e,t)}function E(e,t,n){if(!L(t))throw new TypeError;D(n)||(n=F(n));var r=O(t,n,!1);if(D(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}function S(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!D(r)&&!j(r)){if(!V(r))throw new TypeError;t=r}}return t}function P(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!D(o)&&!j(o)){if(!L(o))throw new TypeError;r=o}}return r}function O(e,t,n){var r=f.get(e);if(D(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(D(i)){if(!n)return;i=new d,r.set(t,i)}return i}function A(e,t,n){if(I(e,t,n))return!0;var r=X(t);return!j(r)&&A(e,r,n)}function I(e,t,n){var r=O(t,n,!1);return!D(r)&&z(r.has(e))}function k(e,t,n){if(I(e,t,n))return C(e,t,n);var r=X(t);return j(r)?void 0:k(e,r,n)}function C(e,t,n){var r=O(t,n,!1);if(!D(r))return r.get(e)}function N(e,t,n,r){O(n,r,!0).set(e,t)}function M(e,t){var n=x(e,t),r=X(e);if(null===r)return n;var i=M(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new p,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,d=i;l<d.length;l++){c=d[l];o.has(c)||(o.add(c),a.push(c))}return a}function x(e,t){var n=[],r=O(e,t,!1);if(D(r))return n;for(var i=q(r.keys()),o=0;;){var a=Q(i);if(!a)return n.length=o,n;var s=$(a);try{n[o]=s}catch(e){try{Y(i)}finally{throw e}}o++}}function R(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function D(e){return void 0===e}function j(e){return null===e}function U(e){return"symbol"==typeof e}function L(e){return"object"==typeof e?null!==e:"function"==typeof e}function B(e,t){switch(R(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",i=J(e,r);if(void 0!==i){var o=i.call(e,n);if(L(o))throw new TypeError;return o}return Z(e,"default"===n?"number":n)}function Z(e,t){if("string"===t){var n=e.toString;if(H(n))if(!L(i=n.call(e)))return i;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i}else{var r;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i;var i,o=e.toString;if(H(o))if(!L(i=o.call(e)))return i}throw new TypeError}function z(e){return!!e}function W(e){return""+e}function F(e){var t=B(e,3);return U(t)?t:W(t)}function G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function H(e){return"function"==typeof e}function V(e){return"function"==typeof e}function K(e){switch(R(e)){case 3:case 4:return!0;default:return!1}}function J(e,t){var n=e[t];if(null!=n){if(!H(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!H(t))throw new TypeError;var n=t.call(e);if(!L(n))throw new TypeError;return n}function $(e){return e.value}function Q(e){var t=e.next();return!t.done&&t}function Y(e){var t=e.return;t&&t.call(e)}function X(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function te(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function ne(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function re(e){return e.__=void 0,delete e.__,e}e("decorate",h),e("metadata",m),e("defineMetadata",v),e("hasMetadata",y),e("hasOwnMetadata",g),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",T),e("deleteMetadata",E)}(r)}()}(nt||(nt={}));var ut=Object.prototype.toString;var ct="[object Null]",lt="[object Undefined]";function dt(e){return null==e?void 0===e?lt:ct:function(e){return ut.call(e)}(e)}function pt(e){return null!=e&&"object"==typeof e}var ft={isEmpty:function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length},isNull:function(e){return null===e},isUndefined:function(e){return void 0===e},isFunction:function(e){return"function"==typeof e},isObject:function(e){return null!==e&&("function"==typeof e||"object"==typeof e)},isString:function(e){return null!=e&&"string"==typeof e.valueOf()},isNumber:function(e){return"number"==typeof e||pt(e)&&"[object Number]"==dt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return pt(e)&&"[object RegExp]"==dt(e)},get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=function(n){return String.prototype.split.call(t,n).filter(Boolean).reduce((function(e,t){return null!=e?e[t]:e}),e)},i=r(/[,[\]]+?/)||r(/[,[\].]+?/);return void 0===i||i===e?n:i},isPromise:function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}};function ht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function vt(e){return vt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},vt(e)}function yt(e){return vt(e)}function gt(e,t,n){return gt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=yt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},gt(e,t,n)}function _t(e,t,n){return gt(e,t,n)}function wt(e,t){return wt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},wt(e,t)}function bt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wt(e,t)}function Tt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Et(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=yt(e);if(t){var i=yt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==at(t)&&"function"!=typeof t?Tt(e):t}(this,n)}}var St,Pt,Ot=(St=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],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){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(d-1);c<d;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),d){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(p=1,u=new Array(d-1);p<d;p++)u[p-1]=arguments[p];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},St(Pt={exports:{}},Pt.exports),Pt.exports),At="ACTION_CALLBACK";var It=function(e){bt(n,e);var t=Et(n);function n(){var e;return ht(this,n),(e=t.apply(this,arguments)).debug=st("zmp:event-emitter"),e}var r=n.prototype;return r.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},r.on=function(e,t,r){var i=this;if(e===At||e===f.PaymentCallback)return _t(yt(n.prototype),"on",this).call(this,e,t,r);this.debug("register ".concat(String(e),": ").concat(r));return _t(yt(n.prototype),"on",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},r.once=function(e,t,r){var i=this;if(e===At)return _t(yt(n.prototype),"once",this).call(this,e,t,r);this.debug("register once ".concat(String(e),": ").concat(r));return _t(yt(n.prototype),"once",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},n}(Ot);function kt(e){It.getInstance().emit(At,e)}function Ct(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){kt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){var r=st("zmp:zalo_h5_event_handler");r("eventId: ".concat(e,", eventName: ").concat(t,", eventData: ").concat(n));var o=an(n);r("stringToData",o);var a=function(e,t){try{if(e===f.OpenApp){var n=t.url,r=new URL(n),o=r.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(o||"/").concat(r.search)}}return t}catch(e){return t}}(t,o);It.getInstance().emit(t,e,a)}},window.zaloNative2JS={nativeCall:function(e,t,n){It.getInstance().emit(f.PaymentCallback,e,t,n)}};var Nt={encode:Ct,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:Ct(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":at(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":at(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Mt={},xt=function(e,t,n){var r=t||"default";return function(){return(r in Mt?Mt[r](e,n):e).apply(this,arguments)}};xt.setWrapper=function(e){Mt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Rt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Dt(e){try{return null===e?Rt:JSON.parse(e)}catch(e){return Rt}}var jt,Ut={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Nt.encode(n);"post"!=t&&(e=Nt.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=xt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=xt((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(Dt(e.responseText))},o.onerror=function(e){e.responseText?r(Dt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Lt=Ut,Bt=(jt=he((function(e,t,n){var r,i,o,a;return _e(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},ft.isUndefined(n)||(r.currentVersion=n),i=Nt.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 jt.apply(this,arguments)});function Zt(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Lt.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 zt=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Wt=function(){var e,t,n=Number((null===(e=Pe())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=Pe())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Ft(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Gt,Ht,Vt=function(){function e(t,n,r,i){ht(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}(),Kt=function(e,t){return Ft(e,Vt)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Ft(e,Error)?new Vt(R,e.message,t).toJSON():ft.isEmpty(null==e?void 0:e.message)||ft.isEmpty(null==e?void 0:e.code)?new Vt(R,F,t,e).toJSON():new Vt(e.code,e.message,t,e.detail).toJSON()}(e,t)},Jt=(Gt=he((function(e){var t;return _e(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,Ce({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Gt.apply(this,arguments)}),qt=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n,r,i,o;return _e(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,tn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=tn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new Vt(U,H,"getSetting")),[4,Jt(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new Vt(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)}}())]}))})),$t=function(){var e,t,n,r=Pe(),i={},o=It.getInstance(),a=[],s=!1;return s||(t=function(e){var t=e.serialId,n=sn(e.result),r=dn(null==n?void 0:n.action),o=ft.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,s=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===o){var c=JSON.parse(null==n?void 0:n.data);o=ft.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,s=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:o,error_message:s,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&i[t]){var d=i[t],p=d.callback,f=d.timeout,h=d.isMultiCallback,m=d.options;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?ft.isFunction(r)&&r(e):ft.isFunction(i)&&i(e)}(l,p),!h&&delete i[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){}a.push(v)}},It.getInstance().on(At,t),o.on(f.AppPaused,(function(){if(a.length>0){var e=a;a=[],Zt(e)}})),e?clearInterval(e):e=setInterval((function(){if(a.length>0){var e=a;a=[],Zt(e)}}),5e3),s=!0),n=he((function(e,t,n,o){var a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A;return _e(this,(function(I){switch(I.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c="action.".concat(e.replace(/\_/g,".").toLowerCase()),(null==o?void 0:o.actionName)&&o.actionName.length>0&&(c=null==o?void 0:o.actionName),l=(null==o?void 0:o.isMultiCallback)||!1,d=!1!==(null==o?void 0:o.timeout)&&((null==o?void 0:o.timeout)||!0),p=(null==o?void 0:o.haveCallback)||!1,f=(null==o?void 0:o.skipJump)||!1,h=(null==o?void 0:o.requireAccessToken)||!1,m=pn(c),t&&n&&(i[u]={options:t,callback:n,isMultiCallback:l},d&&p&&(i[u].timeout=setTimeout((function(){return kt({serialId:u,result:{error_code:B,error_message:G,data:{timeout:d},action:e}}),null}),!0===d?8e3:1e3*d))),m?[4,qt()]:[3,2];case 1:if(!1===(null==(y=I.sent())||null===(v=y.authSetting)||void 0===v?void 0:v["scope.userInfo"]))return kt({serialId:u,result:{error_code:U,error_message:J,data:{isMobile:null==r||null===(g=r.platform)||void 0===g?void 0:g.isMobile},action:e}}),[2];I.label=2;case 2:return _=dn(c),!(null==r||null===(a=r.platform)||void 0===a?void 0:a.isMobile)||!e||ft.isUndefined(ZaloJavaScriptInterface)||r.platform.isIOS&&!on(e)||_&&!1===_.isSupported?(kt({serialId:u,result:{error_code:L,error_message:K,data:{isMobile:null==r||null===(w=r.platform)||void 0===w?void 0:w.isMobile},action:e}}),[2]):(b=rn(t),f?[3,4]:[4,tn.getJSAccessToken()]);case 3:return E=I.sent(),[3,5];case 4:E="",I.label=5;case 5:T=E,I.label=6;case 6:return I.trys.push([6,10,,11]),f||!h?[3,8]:[4,tn.getAccessToken()];case 7:return P=I.sent(),[3,9];case 8:P="",I.label=9;case 9:return S=P,[3,11];case 10:return O=I.sent(),kt({serialId:u,result:{error_code:null==O?void 0:O.code,error_message:null==O?void 0:O.message,action:e}}),[2];case 11:return A=r.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(T,c,S,b,A)]}}))})),function(e,t,r,i){return n.apply(this,arguments)}}(),Qt={success:function(e,t){return{code:x,message:t||W,data:e||{}}},error:{badRequest:function(e){return new Vt(D,e)},loginFailed:function(e){return new Vt(U,"".concat(V,": ").concat(e))},loginRequired:function(){return new Vt(U,H)},cannotGetShareInfo:function(){return new Vt(j,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(pe).find((function(t){return t===e.toString()}));return new Vt(e,t||F)},clientNotSupport:function(){return new Vt(L,K)}}},Yt=(Ht=function(e){var t,n,r,i=null===(t=Pe())||void 0===t?void 0:t.platformName,o=e.action.replace("action.","").replace(/\./g,"_").toUpperCase(),a=Y[o],s=(null==a?void 0:a.skipJump)||!1,u=(null==a?void 0:a.errorList)||{};if("JUMP_LOGIN"===o)return new Vt(R,"Can not get auth code: ".concat(e.error_message));if(tn.jumpStatus!==h.DONE&&!s)return new Vt(Q.UNAUTHORIZED.code,Q.UNAUTHORIZED.message);if("permission required!"===String(e.error_message).toLowerCase()||"no permission!"===String(e.error_message).toLowerCase())return new Vt(Q.FORBIDDEN.code,Q.FORBIDDEN.message);if(i&&(null===(n=X[i])||void 0===n?void 0:n[e.error_code]))return new Vt(X[i][e.error_code].code,X[i][e.error_code].message);var c=null==u||null===(r=u[i])||void 0===r?void 0:r[String(e.error_code)];if(c){var l,d,p,f=null===(l=c.mapTo)||void 0===l?void 0:l.message;return(null==c?void 0:c.needMoreDetail)&&(f="".concat(null==c||null===(p=c.mapTo)||void 0===p?void 0:p.message,": ").concat(e.error_message)),new Vt(null===(d=c.mapTo)||void 0===d?void 0:d.code,f)}return new Vt(e.error_code,e.error_message)},function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=ft.isEmpty(n)?void 0:n[r];if(o)return Ae({stage:t.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Ht(i):null==i?void 0:i.data)}}return ft.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=Y[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){$t(e,n,o,Ce({},i,a))}),s)}),Xt=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){ft.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),en=function(){function e(){ht(this,e),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 n,o,s,u=e.prototype;return u.jump=function(){var e=this;return he((function(){return _e(this,(function(n){return[2,new Promise((function(n,r){e._jumpStatus?e._jumpStatus===h.DONE?n(h.DONE):n(h.DOING):(e._jumpStatus=h.DOING,Ae({stage:t.REQUEST,type:"log",name:"jump"}),$t("JUMP_LOGIN",{},{success:function(t){var r=t.data;e._miniProgramConfig=(null==r?void 0:r.miniProgramConfig)||{};var i=(null==r?void 0:r.cookiesOAuthLogins)||[],o=i.find((function(e){return e.name===c.JS_TOKEN}));o&&(e._jsAccessToken=o.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(o.value)),e._cookies=i;var a=e._cookies.find((function(e){return e.name===c.ZOAUTH}));(null==a?void 0:a.value)||Zt([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),n(h.DONE)},fail:function(e){Zt([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),r(e)}},{skipJump:!0}))}))]}))}))()},u.loginZaloV3=function(e,t,n){var r=this;return he((function(){var i;return _e(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=he((function(e){var t,n,i;return _e(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()]}}))}))()},u.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 he((function(){var i,o;return _e(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),ft.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,Ce({method:"POST",body:i},o)).then(function(){var e=he((function(e){var t,n,i,o;return _e(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()]}}))}))()},u.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return he((function(){var n,o,a,s,u,l,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=he((function(){return _e(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 _e(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 d=m.sent(),[3,7];case 6:d=!0,m.label=7;case 7:if(!d)throw a.getAccessTokenCount--,Zt([{action:l,error:-104,message:"no user auth",data:{}}]),Qt.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 p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(i,r,s)];case 11:p=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),p="",console.log("Can not get access token",f),Zt([{action:l,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return a.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(Zt([{action:l,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(Qt.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw a.getAccessTokenCount--,Zt([{action:l,error:-102,message:"no oauth",data:{}}]),Qt.error.loginFailed("Zalo app has not been activated")}}))}))()},u.verifyUserAuthorized=function(){var e=this;return he((function(){var t,n,r,i,o,a;return _e(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=dn("action.mp.user.authorize"))&&r.isSupported?[4,qt()]:[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,Xt()];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]}}))}))()},u.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},u.getJSAccessToken=function(){var e=this;return he((function(){var t;return _e(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)]}}))}))()},u.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},u.jumpAndGetToken=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;return new Promise(function(){var r=he((function(r){var i,o,a,s;return _e(this,(function(u){switch(u.label){case 0:return!t&&n._cookies.length>0?ft.isString(e)?(i=n._cookies.find((function(t){return t.name===e})),[2,r(null==i?void 0:i.value)]):[2,r("")]:(t&&n._jumpStatus===h.DONE&&(n._jumpStatus=void 0),o={name:e,cb:function(e){return r(e)}},[4,n.jump()]);case 1:return(a=u.sent())===h.DONE?(n._jumpStatus=a,n.WAITING_QUEUE.length&&(n.WAITING_QUEUE.forEach((function(e){var t=n._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),n.WAITING_QUEUE=[]),s=n._cookies.find((function(e){return e.name===o.name})),o.cb(null==s?void 0:s.value)):n.WAITING_QUEUE.push(o),[2]}}))}));return function(e){return r.apply(this,arguments)}}())},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},n=e,(o=[{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}}])&&mt(n.prototype,o),s&&mt(n,s),e}(),tn=en.getInstance(),nn=st("zmp:utils:common"),rn=function(e){if(ft.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(rn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+rn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},on=function(e){var t,n,r=Y[e],i=(null===(t=Pe())||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},an=function(e){try{if(e){nn(e);var t=e.replace(/\\/g,"").replace(/'/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return nn("formattedValue",t,JSON.parse(t),at(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return nn("parse json error:",t),e}},sn=function(e){if(ft.isObject(JSON)&&JSON.parse&&ft.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 ft.isObject(e)?e:new Function("return "+e)()},un=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""},cn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var ln=function(e){return"hidden"===e?S.hidden:"transparent"===e?S.transparent:S.normal},dn=function(e){if(void 0!==e){var t=tn.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},pn=function(e){if(void 0===e)return!1;var t=tn.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},fn=function(){var e=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n;return _e(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,tn.jumpAndGetToken()];case 1:return t.sent(),n=tn.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 hn(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=Qt.error.badRequest(s);throw c.detail=a,Kt(c,e)}u.push(i.data)}));var c=r.apply(void 0,ge(u));return ft.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!ft.isNull(a)&&ft.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Kt(t,e);if(!ft.isNull(s)&&ft.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!ft.isNull(s)&&ft.isFunction(s))return s(t);throw Kt(t,e)}}function mn(e){return vn.apply(this,arguments)}function vn(){return(vn=he((function(e){return _e(this,(function(t){return[2,hn("login",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,tn.jumpAndGetToken(c.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Oe.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ie("login",{}))]}}))})))]}))}))).apply(this,arguments)}function yn(e){return gn.apply(this,arguments)}function gn(){return(gn=he((function(e){return _e(this,(function(t){return[2,hn("getAccessToken",[],[e],he((function(){var e;return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,fn()]:[3,3];case 1:return e=!t.sent(),[4,tn.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Oe.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ie("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var _n,wn="3.0.9";function bn(){return hn("getVersion",[],[],(function(){return wn}))}function Tn(){var e,t;return{version:un("version-id")||"",apiVersion:wn,zaloVersion:(null===(e=Pe())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=Pe())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function En(){return hn("getSystemInfo",[],[],(function(){return Tn()}))}!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(_n||(_n={}));const Sn=_n.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pn=e=>{switch(typeof e){case"undefined":return Sn.undefined;case"string":return Sn.string;case"number":return isNaN(e)?Sn.nan:Sn.number;case"boolean":return Sn.boolean;case"function":return Sn.function;case"bigint":return Sn.bigint;case"symbol":return Sn.symbol;case"object":return Array.isArray(e)?Sn.array:null===e?Sn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Sn.promise:"undefined"!=typeof Map&&e instanceof Map?Sn.map:"undefined"!=typeof Set&&e instanceof Set?Sn.set:"undefined"!=typeof Date&&e instanceof Date?Sn.date:Sn.object;default:return Sn.unknown}},On=_n.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class An extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){const n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,_n.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}An.create=e=>new An(e);const In=(e,t)=>{let n;switch(e.code){case On.invalid_type:n=e.received===Sn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case On.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,_n.jsonStringifyReplacer)}`;break;case On.unrecognized_keys:n=`Unrecognized key(s) in object: ${_n.joinValues(e.keys,", ")}`;break;case On.invalid_union:n="Invalid input";break;case On.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${_n.joinValues(e.options)}`;break;case On.invalid_enum_value:n=`Invalid enum value. Expected ${_n.joinValues(e.options)}, received '${e.received}'`;break;case On.invalid_arguments:n="Invalid function arguments";break;case On.invalid_return_type:n="Invalid function return type";break;case On.invalid_date:n="Invalid date";break;case On.invalid_string:"object"==typeof e.validation?"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:_n.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case On.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(e.minimum)}`:"Invalid input";break;case On.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(e.maximum)}`:"Invalid input";break;case On.custom:n="Invalid input";break;case On.invalid_intersection_types:n="Intersection results could not be merged";break;case On.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case On.not_finite:n="Number must be finite";break;default:n=t.defaultError,_n.assertNever(e)}return{message:n}};let kn=In;function Cn(){return kn}const Nn=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const u=r.filter((e=>!!e)).slice().reverse();for(const e of u)s=e(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}};function Mn(e,t){const n=Nn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Cn(),In].filter((e=>!!e))});e.common.issues.push(n)}class xn{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return Rn;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t)n.push({key:await e.key,value:await e.value});return xn.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:i}=r;if("aborted"===t.status)return Rn;if("aborted"===i.status)return Rn;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),(void 0!==i.value||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}}const Rn=Object.freeze({status:"aborted"}),Dn=e=>({status:"dirty",value:e}),jn=e=>({status:"valid",value:e}),Un=e=>"aborted"===e.status,Ln=e=>"dirty"===e.status,Bn=e=>"valid"===e.status,Zn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var zn;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(zn||(zn={}));class Wn{constructor(e,t,n,r){this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._path.concat(this._key)}}const Fn=(e,t)=>{if(Bn(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,error:new An(e.common.issues)}};function Gn(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=n?n:t.defaultError},description:i}}class Hn{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Pn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Pn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new xn,ctx:{common:e.parent.common,data:e.data,parsedType:Pn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Zn(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Fn(r,i)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Zn(r)?r:Promise.resolve(r));return Fn(n,i)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const i=e(t),o=()=>r.addIssue({code:On.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(o(),!1))):!!i||(o(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new kr({schema:this,typeName:Zr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Cr.create(this,this._def)}nullable(){return Nr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return cr.create(this,this._def)}promise(){return Ir.create(this,this._def)}or(e){return fr.create([this,e],this._def)}and(e){return yr.create(this,e,this._def)}transform(e){return new kr({...Gn(this._def),schema:this,typeName:Zr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Mr({...Gn(this._def),innerType:this,defaultValue:t,typeName:Zr.ZodDefault})}brand(){return new jr({typeName:Zr.ZodBranded,type:this,...Gn(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new xr({...Gn(this._def),innerType:this,catchValue:t,typeName:Zr.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ur.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Vn=/^c[^\s-]{8,}$/i,Kn=/^[a-z][a-z0-9]*$/,Jn=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,qn=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/;class $n extends Hn{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:On.invalid_string,...zn.errToObj(n)}),this.nonempty=e=>this.min(1,zn.errToObj(e)),this.trim=()=>new $n({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Sn.string){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.string,received:t.parsedType}),Rn}const t=new xn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),Mn(n,{code:On.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),Mn(n,{code:On.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,o=e.data.length<i.value;(r||o)&&(n=this._getOrReturnCtx(e,n),r?Mn(n,{code:On.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Mn(n,{code:On.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)qn.test(e.data)||(n=this._getOrReturnCtx(e,n),Mn(n,{validation:"email",code:On.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Jn.test(e.data)||(n=this._getOrReturnCtx(e,n),Mn(n,{validation:"uuid",code:On.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Vn.test(e.data)||(n=this._getOrReturnCtx(e,n),Mn(n,{validation:"cuid",code:On.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Kn.test(e.data)||(n=this._getOrReturnCtx(e,n),Mn(n,{validation:"cuid2",code:On.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Mn(n,{validation:"url",code:On.invalid_string,message:i.message}),t.dirty()}else if("regex"===i.kind){i.regex.lastIndex=0;i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Mn(n,{validation:"regex",code:On.invalid_string,message:i.message}),t.dirty())}else if("trim"===i.kind)e.data=e.data.trim();else if("startsWith"===i.kind)e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),Mn(n,{code:On.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty());else if("endsWith"===i.kind)e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),Mn(n,{code:On.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty());else if("datetime"===i.kind){((r=i).precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):0===r.precision?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(n=this._getOrReturnCtx(e,n),Mn(n,{code:On.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else _n.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new $n({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...zn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...zn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...zn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...zn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...zn.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...zn.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...zn.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...zn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...zn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...zn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...zn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...zn.errToObj(t)})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Qn(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}$n.create=e=>{var t;return new $n({checks:[],typeName:Zr.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Gn(e)})};class Yn extends Hn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==Sn.number){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.number,received:t.parsedType}),Rn}let t;const n=new xn;for(const r of this._def.checks)if("int"===r.kind)_n.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Mn(t,{code:On.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Mn(t,{code:On.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Mn(t,{code:On.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==Qn(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Mn(t,{code:On.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Mn(t,{code:On.not_finite,message:r.message}),n.dirty()):_n.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,zn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,zn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,zn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,zn.toString(t))}setLimit(e,t,n,r){return new Yn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:zn.toString(r)}]})}_addCheck(e){return new Yn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:zn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:zn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:zn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:zn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:zn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:zn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:zn.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&_n.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Yn.create=e=>new Yn({checks:[],typeName:Zr.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...Gn(e)});class Xn extends Hn{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Sn.bigint){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.bigint,received:t.parsedType}),Rn}return jn(e.data)}}Xn.create=e=>{var t;return new Xn({typeName:Zr.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Gn(e)})};class er extends Hn{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Sn.boolean){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.boolean,received:t.parsedType}),Rn}return jn(e.data)}}er.create=e=>new er({typeName:Zr.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...Gn(e)});class tr extends Hn{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Sn.date){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.date,received:t.parsedType}),Rn}if(isNaN(e.data.getTime())){return Mn(this._getOrReturnCtx(e),{code:On.invalid_date}),Rn}const t=new xn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Mn(n,{code:On.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),Mn(n,{code:On.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):_n.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new tr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:zn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:zn.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}tr.create=e=>new tr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Zr.ZodDate,...Gn(e)});class nr extends Hn{_parse(e){if(this._getType(e)!==Sn.symbol){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.symbol,received:t.parsedType}),Rn}return jn(e.data)}}nr.create=e=>new nr({typeName:Zr.ZodSymbol,...Gn(e)});class rr extends Hn{_parse(e){if(this._getType(e)!==Sn.undefined){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.undefined,received:t.parsedType}),Rn}return jn(e.data)}}rr.create=e=>new rr({typeName:Zr.ZodUndefined,...Gn(e)});class ir extends Hn{_parse(e){if(this._getType(e)!==Sn.null){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.null,received:t.parsedType}),Rn}return jn(e.data)}}ir.create=e=>new ir({typeName:Zr.ZodNull,...Gn(e)});class or extends Hn{constructor(){super(...arguments),this._any=!0}_parse(e){return jn(e.data)}}or.create=e=>new or({typeName:Zr.ZodAny,...Gn(e)});class ar extends Hn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jn(e.data)}}ar.create=e=>new ar({typeName:Zr.ZodUnknown,...Gn(e)});class sr extends Hn{_parse(e){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.never,received:t.parsedType}),Rn}}sr.create=e=>new sr({typeName:Zr.ZodNever,...Gn(e)});class ur extends Hn{_parse(e){if(this._getType(e)!==Sn.undefined){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.void,received:t.parsedType}),Rn}return jn(e.data)}}ur.create=e=>new ur({typeName:Zr.ZodVoid,...Gn(e)});class cr extends Hn{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Sn.array)return Mn(t,{code:On.invalid_type,expected:Sn.array,received:t.parsedType}),Rn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Mn(t,{code:e?On.too_big:On.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(Mn(t,{code:On.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(Mn(t,{code:On.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new Wn(t,e,t.path,n))))).then((e=>xn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new Wn(t,e,t.path,n))));return xn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new cr({...this._def,minLength:{value:e,message:zn.toString(t)}})}max(e,t){return new cr({...this._def,maxLength:{value:e,message:zn.toString(t)}})}length(e,t){return new cr({...this._def,exactLength:{value:e,message:zn.toString(t)}})}nonempty(e){return this.min(1,e)}}var lr;function dr(e){if(e instanceof pr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Cr.create(dr(r))}return new pr({...e._def,shape:()=>t})}return e instanceof cr?cr.create(dr(e.element)):e instanceof Cr?Cr.create(dr(e.unwrap())):e instanceof Nr?Nr.create(dr(e.unwrap())):e instanceof gr?gr.create(e.items.map((e=>dr(e)))):e}cr.create=(e,t)=>new cr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Zr.ZodArray,...Gn(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(lr||(lr={}));class pr extends Hn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=_n.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Sn.object){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.object,received:t.parsedType}),Rn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof sr&&"strip"===this._def.unknownKeys))for(const e in n.data)i.includes(e)||o.push(e);const a=[];for(const e of i){const t=r[e],i=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new Wn(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof sr){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)o.length>0&&(Mn(n,{code:On.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const r=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new Wn(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>xn.mergeObjectSync(t,e))):xn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return zn.errToObj,new pr({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,i,o,a;const s=null!==(o=null===(i=(r=this._def).errorMap)||void 0===i?void 0:i.call(r,t,n).message)&&void 0!==o?o:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=zn.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new pr({...this._def,unknownKeys:"strip"})}passthrough(){return new pr({...this._def,unknownKeys:"passthrough"})}extend(e){return new pr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new pr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>lr.mergeShapes(this._def.shape(),e._def.shape()),typeName:Zr.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new pr({...this._def,catchall:e})}pick(e){const t={};return _n.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new pr({...this._def,shape:()=>t})}omit(e){const t={};return _n.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new pr({...this._def,shape:()=>t})}deepPartial(){return dr(this)}partial(e){const t={};return _n.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new pr({...this._def,shape:()=>t})}required(e){const t={};return _n.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Cr;)e=e._def.innerType;t[n]=e}})),new pr({...this._def,shape:()=>t})}keyof(){return Pr(_n.objectKeys(this.shape))}}pr.create=(e,t)=>new pr({shape:()=>e,unknownKeys:"strip",catchall:sr.create(),typeName:Zr.ZodObject,...Gn(t)}),pr.strictCreate=(e,t)=>new pr({shape:()=>e,unknownKeys:"strict",catchall:sr.create(),typeName:Zr.ZodObject,...Gn(t)}),pr.lazycreate=(e,t)=>new pr({shape:e,unknownKeys:"strip",catchall:sr.create(),typeName:Zr.ZodObject,...Gn(t)});class fr extends Hn{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new An(e.ctx.common.issues)));return Mn(t,{code:On.invalid_union,unionErrors:n}),Rn}));{let e;const r=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=r.map((e=>new An(e)));return Mn(t,{code:On.invalid_union,unionErrors:i}),Rn}}get options(){return this._def.options}}fr.create=(e,t)=>new fr({options:e,typeName:Zr.ZodUnion,...Gn(t)});const hr=e=>e instanceof Er?hr(e.schema):e instanceof kr?hr(e.innerType()):e instanceof Sr?[e.value]:e instanceof Or?e.options:e instanceof Ar?Object.keys(e.enum):e instanceof Mr?hr(e._def.innerType):e instanceof rr?[void 0]:e instanceof ir?[null]:null;class mr extends Hn{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Sn.object)return Mn(t,{code:On.invalid_type,expected:Sn.object,received:t.parsedType}),Rn;const n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Mn(t,{code:On.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Rn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=hr(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new mr({typeName:Zr.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Gn(n)})}}function vr(e,t){const n=Pn(e),r=Pn(t);if(e===t)return{valid:!0,data:e};if(n===Sn.object&&r===Sn.object){const n=_n.objectKeys(t),r=_n.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=vr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Sn.array&&r===Sn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=vr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Sn.date&&r===Sn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class yr extends Hn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Un(e)||Un(r))return Rn;const i=vr(e.value,r.value);return i.valid?((Ln(e)||Ln(r))&&t.dirty(),{status:t.value,value:i.data}):(Mn(n,{code:On.invalid_intersection_types}),Rn)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}yr.create=(e,t,n)=>new yr({left:e,right:t,typeName:Zr.ZodIntersection,...Gn(n)});class gr extends Hn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Sn.array)return Mn(n,{code:On.invalid_type,expected:Sn.array,received:n.parsedType}),Rn;if(n.data.length<this._def.items.length)return Mn(n,{code:On.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Rn;!this._def.rest&&n.data.length>this._def.items.length&&(Mn(n,{code:On.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new Wn(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>xn.mergeArray(t,e))):xn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new gr({...this._def,rest:e})}}gr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new gr({items:e,typeName:Zr.ZodTuple,rest:null,...Gn(t)})};class _r extends Hn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Sn.object)return Mn(n,{code:On.invalid_type,expected:Sn.object,received:n.parsedType}),Rn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new Wn(n,e,n.path,e)),value:o._parse(new Wn(n,n.data[e],n.path,e))});return n.common.async?xn.mergeObjectAsync(t,r):xn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new _r(t instanceof Hn?{keyType:e,valueType:t,typeName:Zr.ZodRecord,...Gn(n)}:{keyType:$n.create(),valueType:e,typeName:Zr.ZodRecord,...Gn(t)})}}class wr extends Hn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Sn.map)return Mn(n,{code:On.invalid_type,expected:Sn.map,received:n.parsedType}),Rn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new Wn(n,e,n.path,[o,"key"])),value:i._parse(new Wn(n,t,n.path,[o,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of o){const r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return Rn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of o){const r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return Rn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}wr.create=(e,t,n)=>new wr({valueType:t,keyType:e,typeName:Zr.ZodMap,...Gn(n)});class br extends Hn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Sn.set)return Mn(n,{code:On.invalid_type,expected:Sn.set,received:n.parsedType}),Rn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Mn(n,{code:On.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(Mn(n,{code:On.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const n=new Set;for(const r of e){if("aborted"===r.status)return Rn;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map(((e,t)=>i._parse(new Wn(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new br({...this._def,minSize:{value:e,message:zn.toString(t)}})}max(e,t){return new br({...this._def,maxSize:{value:e,message:zn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}br.create=(e,t)=>new br({valueType:e,minSize:null,maxSize:null,typeName:Zr.ZodSet,...Gn(t)});class Tr extends Hn{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Sn.function)return Mn(t,{code:On.invalid_type,expected:Sn.function,received:t.parsedType}),Rn;function n(e,n){return Nn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Cn(),In].filter((e=>!!e)),issueData:{code:On.invalid_arguments,argumentsError:n}})}function r(e,n){return Nn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Cn(),In].filter((e=>!!e)),issueData:{code:On.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Ir?jn((async(...e)=>{const t=new An([]),a=await this._def.args.parseAsync(e,i).catch((r=>{throw t.addIssue(n(e,r)),t})),s=await o(...a);return await this._def.returns._def.type.parseAsync(s,i).catch((e=>{throw t.addIssue(r(s,e)),t}))})):jn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new An([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new An([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Tr({...this._def,args:gr.create(e).rest(ar.create())})}returns(e){return new Tr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Tr({args:e||gr.create([]).rest(ar.create()),returns:t||ar.create(),typeName:Zr.ZodFunction,...Gn(n)})}}class Er extends Hn{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Er.create=(e,t)=>new Er({getter:e,typeName:Zr.ZodLazy,...Gn(t)});class Sr extends Hn{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Mn(t,{received:t.data,code:On.invalid_literal,expected:this._def.value}),Rn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Pr(e,t){return new Or({values:e,typeName:Zr.ZodEnum,...Gn(t)})}Sr.create=(e,t)=>new Sr({value:e,typeName:Zr.ZodLiteral,...Gn(t)});class Or extends Hn{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Mn(t,{expected:_n.joinValues(n),received:t.parsedType,code:On.invalid_type}),Rn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Mn(t,{received:t.data,code:On.invalid_enum_value,options:n}),Rn}return jn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Or.create(e)}exclude(e){return Or.create(this.options.filter((t=>!e.includes(t))))}}Or.create=Pr;class Ar extends Hn{_parse(e){const t=_n.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Sn.string&&n.parsedType!==Sn.number){const e=_n.objectValues(t);return Mn(n,{expected:_n.joinValues(e),received:n.parsedType,code:On.invalid_type}),Rn}if(-1===t.indexOf(e.data)){const e=_n.objectValues(t);return Mn(n,{received:n.data,code:On.invalid_enum_value,options:e}),Rn}return jn(e.data)}get enum(){return this._def.values}}Ar.create=(e,t)=>new Ar({values:e,typeName:Zr.ZodNativeEnum,...Gn(t)});class Ir extends Hn{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Sn.promise&&!1===t.common.async)return Mn(t,{code:On.invalid_type,expected:Sn.promise,received:t.parsedType}),Rn;const n=t.parsedType===Sn.promise?t.data:Promise.resolve(t.data);return jn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ir.create=(e,t)=>new Ir({type:e,typeName:Zr.ZodPromise,...Gn(t)});class kr extends Hn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Zr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null;if("preprocess"===r.type){const e=r.transform(n.data);return n.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n}))):this._def.schema._parseSync({data:e,path:n.path,parent:n})}const i={addIssue:e=>{Mn(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"refinement"===r.type){const e=e=>{const t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?Rn:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?Rn:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Bn(e))return e;const o=r.transform(e.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>Bn(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}_n.assertNever(r)}}kr.create=(e,t,n)=>new kr({schema:e,typeName:Zr.ZodEffects,effect:t,...Gn(n)}),kr.createWithPreprocess=(e,t,n)=>new kr({schema:t,effect:{type:"preprocess",transform:e},typeName:Zr.ZodEffects,...Gn(n)});class Cr extends Hn{_parse(e){return this._getType(e)===Sn.undefined?jn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Cr.create=(e,t)=>new Cr({innerType:e,typeName:Zr.ZodOptional,...Gn(t)});class Nr extends Hn{_parse(e){return this._getType(e)===Sn.null?jn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nr.create=(e,t)=>new Nr({innerType:e,typeName:Zr.ZodNullable,...Gn(t)});class Mr extends Hn{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Sn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Mr.create=(e,t)=>new Mr({innerType:e,typeName:Zr.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Gn(t)});class xr extends Hn{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t,common:{...t.common,issues:[]}}});return Zn(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue()}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}}xr.create=(e,t)=>new xr({innerType:e,typeName:Zr.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Gn(t)});class Rr extends Hn{_parse(e){if(this._getType(e)!==Sn.nan){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.nan,received:t.parsedType}),Rn}return{status:"valid",value:e.data}}}Rr.create=e=>new Rr({typeName:Zr.ZodNaN,...Gn(e)});const Dr=Symbol("zod_brand");class jr extends Hn{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ur extends Hn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Rn:"dirty"===e.status?(t.dirty(),Dn(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Rn:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Ur({in:e,out:t,typeName:Zr.ZodPipeline})}}const Lr=(e,t={},n)=>e?or.create().superRefine(((r,i)=>{if(!e(r)){const e="function"==typeof t?t(r):t,o="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...o,fatal:n})}})):or.create(),Br={object:pr.lazycreate};var Zr;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"}(Zr||(Zr={}));const zr=$n.create,Wr=Yn.create,Fr=Rr.create,Gr=Xn.create,Hr=er.create,Vr=tr.create,Kr=nr.create,Jr=rr.create,qr=ir.create,$r=or.create,Qr=ar.create,Yr=sr.create,Xr=ur.create,ei=cr.create,ti=pr.create,ni=pr.strictCreate,ri=fr.create,ii=mr.create,oi=yr.create,ai=gr.create,si=_r.create,ui=wr.create,ci=br.create,li=Tr.create,di=Er.create,pi=Sr.create,fi=Or.create,hi=Ar.create,mi=Ir.create,vi=kr.create,yi=Cr.create,gi=Nr.create,_i=kr.createWithPreprocess,wi=Ur.create,bi={string:e=>$n.create({...e,coerce:!0}),number:e=>Yn.create({...e,coerce:!0}),boolean:e=>er.create({...e,coerce:!0}),bigint:e=>Xn.create({...e,coerce:!0}),date:e=>tr.create({...e,coerce:!0})},Ti=Rn;var Ei=Object.freeze({__proto__:null,defaultErrorMap:In,setErrorMap:function(e){kn=e},getErrorMap:Cn,makeIssue:Nn,EMPTY_PATH:[],addIssueToContext:Mn,ParseStatus:xn,INVALID:Rn,DIRTY:Dn,OK:jn,isAborted:Un,isDirty:Ln,isValid:Bn,isAsync:Zn,get util(){return _n},ZodParsedType:Sn,getParsedType:Pn,ZodType:Hn,ZodString:$n,ZodNumber:Yn,ZodBigInt:Xn,ZodBoolean:er,ZodDate:tr,ZodSymbol:nr,ZodUndefined:rr,ZodNull:ir,ZodAny:or,ZodUnknown:ar,ZodNever:sr,ZodVoid:ur,ZodArray:cr,get objectUtil(){return lr},ZodObject:pr,ZodUnion:fr,ZodDiscriminatedUnion:mr,ZodIntersection:yr,ZodTuple:gr,ZodRecord:_r,ZodMap:wr,ZodSet:br,ZodFunction:Tr,ZodLazy:Er,ZodLiteral:Sr,ZodEnum:Or,ZodNativeEnum:Ar,ZodPromise:Ir,ZodEffects:kr,ZodTransformer:kr,ZodOptional:Cr,ZodNullable:Nr,ZodDefault:Mr,ZodCatch:xr,ZodNaN:Rr,BRAND:Dr,ZodBranded:jr,ZodPipeline:Ur,custom:Lr,Schema:Hn,ZodSchema:Hn,late:Br,get ZodFirstPartyTypeKind(){return Zr},coerce:bi,any:$r,array:ei,bigint:Gr,boolean:Hr,date:Vr,discriminatedUnion:ii,effect:vi,enum:fi,function:li,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Lr((t=>t instanceof e),t,!0),intersection:oi,lazy:di,literal:pi,map:ui,nan:Fr,nativeEnum:hi,never:Yr,null:qr,nullable:gi,number:Wr,object:ti,oboolean:()=>Hr().optional(),onumber:()=>Wr().optional(),optional:yi,ostring:()=>zr().optional(),pipeline:wi,preprocess:_i,promise:mi,record:si,set:ci,strictObject:ni,string:zr,symbol:Kr,transformer:vi,tuple:ai,undefined:Jr,union:ri,unknown:Qr,void:Xr,NEVER:Ti,ZodIssueCode:On,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:An}),Si=function(){function e(){var t,n,r,o,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A,I,k;ht(this,e),this.initConfig=window.APP_CONFIG;var C=ft.isString(null===(t=this.initConfig)||void 0===t||null===(n=t.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?ue:ce;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===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,x="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.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)?se.HIDE_BACK:se.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)?se.SHOW_HOME:se.HIDE_HOME,D=new URL(location.href),j=ln(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)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?ce:ue);this.config={actionbarType:C,buttonType:x,statusbarType:j,dataConfig:{backgroundColor:(null===(S=this.initConfig)||void 0===S||null===(P=S.app)||void 0===P?void 0:P.headerColor)||le,textColor:(null===(O=this.initConfig)||void 0===O||null===(A=O.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(I=this.initConfig)||void 0===I||null===(k=I.app)||void 0===k?void 0:k.textAlign)||de,viewInLeftType:x,confirmToExit:1},homeConfig:{enable:R,url:"".concat(a,"/").concat(i,"/").concat(D.search)}}}var t=e.prototype;return t.setNavigationBarTitle=function(e){return he((function(){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},t.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return he((function(){var r,i;return _e(this,(function(o){return void 0===(void 0===e?"undefined":at(e))&&null===(void 0===e?"undefined":at(e))||(r="none"===e||"home"===e?se.HIDE_BACK:se.SHOW_BACK,i="home"===e||"both"===e?se.SHOW_HOME:se.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){Yt("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Ce({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},t.setAndroidBottomNavigationBar=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return he((function(){var n,r,i;return _e(this,(function(o){return r=e?P.hide:P.show,i=null===(n=Pe())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isAndroid))return n();Yt("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideAndroidBottomNavigationBar=!!e,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.setIOSBottomSafeArea=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return he((function(){var n,r,i;return _e(this,(function(o){return r=e?O.hide:O.show,i=null===(n=Pe())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isIOS))return n();Yt("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideIOSSafeAreaBottom=!!e,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1,delay:200})}))]}))}))()},t.configHeader=function(e){var t=this;return he((function(){var n;return _e(this,(function(r){return n=t.config,ft.isString(e.headerColor)&&(n.dataConfig.backgroundColor=e.headerColor),ft.isString(e.headerTextColor)&&(n.dataConfig.textColor=e.headerTextColor),ft.isString(e.textAlign)&&("left"===e.textAlign?n.dataConfig.textAlign=A.left:"center"===e.textAlign&&(n.dataConfig.textAlign=A.center)),!0===e.hideActionBar?n.actionbarType=ce:!1===e.hideActionBar&&(n.actionbarType=ue),"normal"===e.statusBarType?n.statusbarType=S.normal:"hidden"===e.statusBarType?n.statusbarType=S.hidden:"transparent"===e.statusBarType&&(n.statusbarType=S.transparent),[2,new Promise((function(r,i){Yt("CHANGE_ACTIONBAR",Ce({},n),{success:function(){var i;t.config=Ce({},n);var o,a=null===(i=Pe())||void 0===i?void 0:i.platform;window.STATUS_BAR_TYPE=(o=t.config.statusbarType)===S.hidden?"hidden":o===S.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=t.config.actionbarType===ce;var s=null===document||void 0===document?void 0:document.querySelector(":root");if(null==a?void 0:a.isAndroid){var u=0;if(("hidden"===e.statusBarType||"transparent"===e.statusBarType)&&e.hideActionBar){var c=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(c)&&(c=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),u=c}u?null==s||s.style.setProperty("--zaui-safe-area-inset-top","".concat(u,"px")):null==s||s.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}r()},fail:function(e){i(e)}},{timeout:!1})}))]}))}))()},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}(),Pi=Si.getInstance(),Oi=[ti({title:zr()}).optional()];function Ai(e){return Ii.apply(this,arguments)}function Ii(){return Ii=he((function(e){return _e(this,(function(t){return[2,hn("setNavigationBarTitle",Oi,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Pi.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ii.apply(this,arguments)}var ki=[ti({color:zr(),textColor:Ei.enum(["black","white"]).optional(),statusBarColor:zr().optional()}).optional()];function Ci(e){return Ni.apply(this,arguments)}function Ni(){return Ni=he((function(e){return _e(this,(function(t){return[2,hn("setNavigationBarColor",ki,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Pi.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 Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ni.apply(this,arguments)}var Mi=[ti({type:Ei.enum(["none","back","home","both"])}).optional()];function xi(e){return Ri.apply(this,arguments)}function Ri(){return Ri=he((function(e){return _e(this,(function(t){return[2,hn("setNavigationBarLeftButton",Mi,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Pi.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ri.apply(this,arguments)}function Di(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function ji(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Di(e,t,"get"))}function Ui(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 Li(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,Di(e,t,"set"),n),n}var Bi,Zi,zi,Wi=new WeakMap,Fi=new WeakMap,Gi=new WeakMap,Hi=function(){function e(t){ht(this,e),Ui(this,Wi,{writable:!0,value:localStorage}),Ui(this,Fi,{writable:!0,value:void 0}),Ui(this,Gi,{writable:!0,value:void 0}),Li(this,Gi,{keys:new Set,currentSize:0,limitSize:te}),Li(this,Fi,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in ji(this,Wi)){if(e)if(t.split("_")[0]!==e)continue;ji(this,Gi).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 ji(this,Fi)&&(e="".concat(ji(this,Fi),"_").concat(e)),ji(this,Gi).keys.has(e)?ji(this,Wi).getItem(e):null},t.set=function(e){var t=this;return he((function(){return _e(this,(function(n){return Object.entries(e).forEach((function(e){var n=Ne(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){ji(this,Fi)&&(e="".concat(ji(this,Fi),"_").concat(e)),ji(this,Wi).setItem(e,t),ji(this,Gi).keys.add(e)},t.getInfo=function(){var e=this;return he((function(){return _e(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}(ji(this,Wi),ji(this,Fi));return{currentSize:ft.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((te/1024).toFixed(2))}},t.remove=function(e){var t=this;return he((function(){return _e(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){ji(this,Fi)&&(e="".concat(ji(this,Fi),"_").concat(e)),ji(this,Gi).keys.has(e)&&(ji(this,Wi).removeItem(e),ji(this,Gi).keys.delete(e))},t.clear=function(){var e=this;return he((function(){return _e(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;ji(this,Gi).keys.forEach((function(t){ji(e,Fi)&&t.indexOf(ji(e,Fi))<0||(ji(e,Wi).removeItem(t),ji(e,Gi).keys.delete(t))}))},e}(),Vi=new WeakMap,Ki=new WeakMap,Ji=function(){function e(t){ht(this,e),Ui(this,Vi,{writable:!0,value:void 0}),Ui(this,Ki,{writable:!0,value:void 0}),Li(this,Ki,{keys:new Set,currentSize:0,limitSize:te}),Li(this,Vi,t)}var t=e.prototype;return t.get=function(e){var t=this;return he((function(){return _e(this,(function(n){return[2,new Promise((function(n,r){Yt("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:ji(t,Vi)},{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 he((function(){return _e(this,(function(n){return[2,new Promise((function(n,r){Yt("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:ji(t,Vi)},{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 he((function(){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:ji(e,Vi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:ft.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(te/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return he((function(){return _e(this,(function(n){return[2,new Promise((function(n,r){Yt("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:ji(t,Vi)},{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 he((function(){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:ji(e,Vi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),qi=function(){function e(){ht(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return he((function(){var n,r;return _e(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]=an(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return he((function(){var n,r;return _e(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Ne(e,2),n=t[0],i=t[1];ft.isUndefined(i)||ft.isNull(i)||(r[n]=cn(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return he((function(){return _e(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 he((function(){return _e(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 he((function(){return _e(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),$i=new WeakMap,Qi=function(e){bt(n,e);var t=Et(n);function n(e){var r;return ht(this,n),Ui(Tt(r=t.call(this)),$i,{writable:!0,value:void 0}),Li(Tt(r),$i,e),r}return n.prototype.getInstance=function(){return new Hi(ji(this,$i))},n}(qi),Yi=new WeakMap,Xi=function(e){bt(n,e);var t=Et(n);function n(e){var r;return ht(this,n),Ui(Tt(r=t.call(this)),Yi,{writable:!0,value:void 0}),Li(Tt(r),Yi,e),r}return n.prototype.getInstance=function(){return new Ji(ji(this,Yi))},n}(qi),eo=new Qi(i),to=(null===(Bi=Pe())||void 0===Bi?void 0:Bi.zaloVersion)||"",no=(null===(Zi=Pe())||void 0===Zi?void 0:Zi.platformName)||"unknown";!!ft.isString(to)&&parseInt(to,10)>={android:12100571,iOS:400,wp:0,unknown:0}[no]&&(null===(zi=Pe())||void 0===zi?void 0:zi.appEnv.isMp)&&(eo=new Xi(i));var ro=eo,io=[ti({data:Ei.record(zr(),Ei.any())}).optional()];function oo(e){return ao.apply(this,arguments)}function ao(){return ao=he((function(e){return _e(this,(function(t){return[2,hn("setStorage",io,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,ro.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ie("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ao.apply(this,arguments)}var so=[ti({keys:Ei.array(zr())}).optional()];function uo(e){return co.apply(this,arguments)}function co(){return co=he((function(e){return _e(this,(function(t){return[2,hn("getStorage",so,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,ro.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ie("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),co.apply(this,arguments)}function lo(e){return po.apply(this,arguments)}function po(){return(po=he((function(e){return _e(this,(function(t){return[2,hn("getStorageInfo",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,ro.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ie("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var fo=[ti({keys:Ei.array(zr())}).optional()];function ho(e){return mo.apply(this,arguments)}function mo(){return mo=he((function(e){return _e(this,(function(t){return[2,hn("removeStorage",fo,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,ro.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ie("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),mo.apply(this,arguments)}var vo=[ti({prefix:zr().optional()}).optional()];function yo(e){return go.apply(this,arguments)}function go(){return(go=he((function(e){return _e(this,(function(t){return[2,hn("clearStorage",vo,[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,ro.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ie("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var _o=function(){var e=he((function(e,t){var n,r,o,a;return _e(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,fn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,tn.getAccessToken(n)];case 3:return o=s.sent(),a="id,name,user_id_by_oa,is_sensitive",a=e?"".concat(a,",picture.type(").concat(e,")"):"".concat(a,",picture"),[4,fetch("".concat(l.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(i),{headers:{access_token:o||""}}).then(function(){var e=he((function(e){var t,n,r,i;return _e(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:!!(null==r?void 0:r.is_follower),isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),wo=[ti({avatarType:Ei.enum(["small","normal","large"]).optional(),autoRequestPermission:Ei.boolean().default(!1).optional()}).optional()];function bo(e){return To.apply(this,arguments)}function To(){return To=he((function(e){return _e(this,(function(t){return[2,hn("getUserInfo",wo,[e],function(){var e=he((function(e){var t,n;return _e(this,(function(r){switch(r.label){case 0:return Oe.isMp?(t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,[4,_o(t,n)]):[3,2];case 1:return[2,{userInfo:r.sent()}];case 2:return Oe.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Ie("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),To.apply(this,arguments)}var Eo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},So=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(t){var n,r,i,o=t.network,a=(null===(n=Pe())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)||!1;switch(o){case Eo(a).NONE:i=d.none;break;case Eo(a).WIFI:i=d.wifi;break;case Eo(a)["2G"]:case Eo(a)["3G"]:case Eo(a)["4G"]:i=d.cellular;break;default:i=d.unknown}e(i)},fail:function(e){t(e)}},{})}))]}))}));function Po(e){return Oo.apply(this,arguments)}function Oo(){return(Oo=he((function(e){return _e(this,(function(t){return[2,hn("getNetworkType",[],[e],he((function(){var e,t;return _e(this,(function(n){switch(n.label){case 0:return Oe.isMp?[4,So()]:[3,2];case 1:return[2,{networkType:n.sent()}];case 2:if(Oe.isMpWeb){switch(e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,e.effectiveType){case"none":t=d.none;break;case"4g":t=d.wifi;break;case"3g":case"2g":t=d.cellular;break;default:t=d.unknown}return[2,Promise.resolve({networkType:t})]}return[2,Promise.reject(Ie("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Ao=[Ei.function().args(ti({isConnected:Ei.boolean(),networkType:Ei.enum(["none","wifi","cellular","unknown"])})).returns(Ei.void())];function Io(e){return hn("onNetworkStatusChange",Ao,[e],(function(e){var t=e;if(Oe.isMp)!function(e){It.getInstance().on(f.NetworkChanged,(function(t){var n=null==t?void 0:t.state;So().then((function(t){e({isConnected:"CONNECTED"===n,networkType:t})}))}))}(t);else if(Oe.isMpWeb){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,r=n.effectiveType;n.addEventListener("change",(function(){var e;switch(r){case"none":e=d.none;break;case"4g":e=d.wifi;break;case"3g":case"2g":e=d.cellular;break;default:e=d.unknown}t({isConnected:!0,networkType:e})}))}}))}var ko=function(){var e=he((function(e){var t,n,r,i,o,a;return _e(this,(function(s){return a={subaction:0,scanning_type:ft.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:ft.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:ft.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:ft.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:ft.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:ft.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:ft.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:ft.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:ft.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:ft.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){Yt("SCAN_IBEACON",Ce({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Co=[ti({scanningType:Ei.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Ei.number().optional(),monitorInterval:Ei.number().optional(),domain:Ei.string().optional(),scanConfig:ti({scanTime:Ei.number().optional(),timeBetweenScan:Ei.number().optional(),beaconTimeout:Ei.number().optional(),delayCheckConnectedTimeout:Ei.number().optional(),beaconConnectedTimeout:Ei.number().optional()}).optional(),items:Ei.array(ti({id:Ei.string().optional(),distance:Ei.number().optional(),monitor:ti({enable:Ei.boolean().optional(),movingRange:Ei.number().optional()}).optional()})).optional(),scanFromSource:Ei.string().optional()}).optional()];function No(e){return Mo.apply(this,arguments)}function Mo(){return(Mo=he((function(e){return _e(this,(function(t){return[2,hn("startBeaconDiscovery",Co,[e],he((function(){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,ko(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ie("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var xo=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Ro(e){return Do.apply(this,arguments)}function Do(){return(Do=he((function(e){return _e(this,(function(t){return[2,hn("stopBeaconDiscovery",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,xo()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ie("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var jo=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("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 Uo(e){return Lo.apply(this,arguments)}function Lo(){return(Lo=he((function(e){return _e(this,(function(t){return[2,hn("getBeacons",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,jo()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Ie("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Bo=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Zo(e){return zo.apply(this,arguments)}function zo(){return(zo=he((function(e){return _e(this,(function(t){return[2,hn("closeApp",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Bo()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Wo=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Fo(e){return Go.apply(this,arguments)}function Go(){return(Go=he((function(e){return _e(this,(function(t){return[2,hn("scanQRCode",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Wo()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Ie("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Ho=function(){var e=he((function(e,t,n,i){return _e(this,(function(o){return[2,new Promise((function(o,a){Yt("OPEN_PROFILE",{uId:e,type:m[t],zapp:r,sourceId:n,sourceIndex:i},{success:function(){o()},fail:function(e){a(e)}},{})}))]}))}));return function(t,n,r,i){return e.apply(this,arguments)}}(),Vo=[ti({id:zr(),type:Ei.enum(["user","oa","aliasOA"]),sourceId:Ei.any().optional(),sourceIndex:Ei.any().optional()}).optional()];function Ko(e){return Jo.apply(this,arguments)}function Jo(){return Jo=he((function(e){return _e(this,(function(t){return[2,hn("openProfile",Vo,[e],function(){var e=he((function(e){var t,n,r,i;return _e(this,(function(o){switch(o.label){case 0:return Oe.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Ho(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Jo.apply(this,arguments)}var qo=function(){var e=he((function(e,t){var n,i,o,a=arguments;return _e(this,(function(s){return n=a.length>2&&void 0!==a[2]?a[2]:"",i=a.length>3?a[3]:void 0,o=a.length>4?a[4]:void 0,[2,new Promise((function(a,s){Yt("OPEN_CHAT",{uId:e,type:v[t],msg:n,zapp:r,sourceId:i,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),$o=[ti({id:zr(),type:Ei.enum(["user","oa"]),sourceId:Ei.any().optional(),sourceIndex:Ei.any().optional(),message:zr().optional()}).optional()];function Qo(e){return Yo.apply(this,arguments)}function Yo(){return Yo=he((function(e){return _e(this,(function(t){return[2,hn("openChat",$o,[e],function(){var e=he((function(e){var t,n,r,i,o;return _e(this,(function(a){switch(a.label){case 0:return Oe.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,qo(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yo.apply(this,arguments)}function Xo(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 ea=function(){var e=he((function(e,t){var n;return _e(this,(function(i){switch(n={},e){case"image":n={photoUrl:null==t?void 0:t.imageUrl};break;case"link":n={link:null==t?void 0:t.link,title:null==t?void 0:t.title,thumb:null==t?void 0:t.thumb,description:null==t?void 0:t.description};break;case"profile":n={avt:null==t?void 0:t.avatar,uid:null==t?void 0:t.id,dpn:null==t?void 0:t.displayName}}return[2,new Promise((function(t,i){Yt("OPEN_POSTFEED",Xo(Ce({type:y[e]},n),{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){i(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ta=[Ei.union([ti({type:Ei.enum(["image"]),data:ti({imageUrl:zr().url().optional()})}),ti({type:Ei.enum(["link"]),data:ti({link:zr().url(),title:zr().max(100).optional(),thumb:zr().url().optional(),description:zr().max(400).default("").optional()})}),ti({type:Ei.enum(["profile"]),data:ti({id:zr().optional()})})])];function na(e){return ra.apply(this,arguments)}function ra(){return ra=he((function(e){return _e(this,(function(t){return[2,hn("openPostFeed",ta,[e],function(){var e=he((function(e){var t,n;return _e(this,(function(r){switch(r.label){case 0:return Oe.isMp?(t=e.type,n=e.data,[4,ea(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ie("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ra.apply(this,arguments)}var ia=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("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)}}(),oa=[ti({id:zr(),showDialogConfirm:Ei.boolean().optional()}).optional()];function aa(e){return sa.apply(this,arguments)}function sa(){return sa=he((function(e){return _e(this,(function(t){return[2,hn("followOA",oa,[e],function(){var e=he((function(e){var t;return _e(this,(function(n){switch(n.label){case 0:return Oe.isMp?(t=e.id,[4,ia(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),sa.apply(this,arguments)}var ua=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ca=[ti({id:zr()}).optional()];function la(e){return da.apply(this,arguments)}function da(){return da=he((function(e){return _e(this,(function(t){return[2,hn("unfollowOA",ca,[e],function(){var e=he((function(e){var t;return _e(this,(function(n){switch(n.label){case 0:return Oe.isMp?(t=e.id,[4,ua(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),da.apply(this,arguments)}var pa=function(){var e=he((function(e,t,n,r,i,a){var s,c,d,p,f,h,m,v;return _e(this,(function(y){switch(y.label){case 0:return d=new URL(location.href),p=new URLSearchParams,f="".concat(d.pathname.replace(u,"")).concat(d.search),a&&(f="/".concat(e).concat("/"===a[0]?"":"/").concat(a)),!(h=new URL("".concat(o).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(c=window.APP_VERSION)||void 0===c?void 0:c.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.CREATE_SHARE_LINK,Ce({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw Qt.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,Xo(Ce({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),fa=function(){var e=he((function(e,t){var n,o,a,s,u,c,l,d,p,f,h,m;return _e(this,(function(v){switch(v.label){case 0:switch(n={},o=e,e){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return n={text:null==t?void 0:t.text,desc:(null==t?void 0:t.desc)||(null==t?void 0:t.description),autoParseLink:(null==t?void 0:t.autoParseLink)?1:0},[3,14];case 2:return c=[],l=(null===(s=Pe())||void 0===s?void 0:s.zaloVersion)||0,d=(null===(u=Pe())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=ee[d]&&(o="multi_image"),Array.isArray(null==t?void 0:t.imageUrls)&&(null==t?void 0:t.imageUrls.length)>0?c=null==t?void 0:t.imageUrls:c.push(null==t?void 0:t.imageUrl),n={photoUrls:c,photoUrl:null==t?void 0:t.imageUrl,caption:null==t?void 0:t.caption},[3,14];case 3:return n={photoUrl:null==t?void 0:t.imageUrl,gifUrl:null==t?void 0:t.gifUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 4:return n={videoThumb:null==t?void 0:t.videoThumb,videoUrl:null==t?void 0:t.videoUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 5:return n={link:null==t?void 0:t.link,chatOnly:(null==t?void 0:t.chatOnly)?1:0},[3,14];case 6:return n={uid:null==t?void 0:t.id},[3,14];case 7:case 10:return[4,tn.getAccessToken()];case 8:case 11:return a=v.sent(),[4,pa(i,a||"",(null==t?void 0:t.title)||"",(null==t?void 0:t.description)||"",(null==t?void 0:t.thumbnail)||"",null==t?void 0:t.path)];case 9:return p=v.sent(),n={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(i,"&shareId=").concat(p.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return f=v.sent().shareableLink,h=new URL(f),m=h.searchParams.getAll("zshareId"),h.searchParams.delete("zshareId"),m.length>0&&h.searchParams.append("zshareId",m[0]),n={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(e,t){Yt("OPEN_SHARESHEET",Xo(Ce({type:g[o]},n),{zapp:r}),{success:function(t){e({status:null==t?void 0:t.status,shareType:null==t?void 0:t.share_type,numberOfUser:null==t?void 0:t.uid_to_size})},fail:function(e){t(e)}},{timeout:!1})}))]}}))}));return function(t,n){return e.apply(this,arguments)}}(),ha=[Ei.union([ti({type:Ei.enum(["text"]),data:ti({text:zr(),description:zr().default("").optional(),autoParseLink:Ei.boolean().default(!1).optional()})}),ti({type:Ei.enum(["image"]),data:ti({imageUrl:zr().url(),imageUrls:Ei.array(zr().url()).max(10).optional()})}),ti({type:Ei.enum(["link"]),data:ti({link:zr().url(),chatOnly:Ei.boolean().optional()})}),ti({type:Ei.enum(["oa"]),data:ti({id:zr()})}),ti({type:Ei.enum(["gif"]),data:ti({gifUrl:zr().url(),imageUrl:zr().url().optional(),width:Wr().min(0).optional(),height:Wr().min(0).optional()})}),ti({type:Ei.enum(["video"]),data:ti({videoThumb:zr().url(),videoUrl:zr().url(),width:Wr().min(0).optional(),height:Wr().min(0).optional()})}),ti({type:Ei.enum(["zmp","zmp_deep_link"]),data:ti({title:zr().max(100),thumbnail:zr().url(),path:zr().optional(),description:zr().max(400).default("").optional()})})])];function ma(e){return va.apply(this,arguments)}function va(){return va=he((function(e){return _e(this,(function(t){return[2,hn("openShareSheet",ha,[e],function(){var e=he((function(e){var t,n;return _e(this,(function(r){switch(r.label){case 0:return Oe.isMp?(t=e.type,n=e.data,[4,fa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ie("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),va.apply(this,arguments)}var ya=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Pe())||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=Pe())||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 ga(e){return _a.apply(this,arguments)}function _a(){return(_a=he((function(e){return _e(this,(function(t){return[2,hn("requestCameraPermission",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return[4,ya()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var wa=function(){var e=he((function(e,t,n){return _e(this,(function(r){return[2,new Promise((function(r,i){Yt("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)}}(),ba=he((function(){var e,t,n,r=arguments;return _e(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=Tn(),[4,Bt(e,t,n.version)];case 1:return[2,o.sent()]}}))})),Ta=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ea=[ti({params:Ei.record(zr(),zr()).optional()}).optional()];function Sa(e){return Pa.apply(this,arguments)}function Pa(){return Pa=he((function(e){return _e(this,(function(t){return[2,hn("createShortcut",Ea,[e],function(){var e=he((function(e){var t,n,r,a,s,u,c,l;return _e(this,(function(d){switch(d.label){case 0:return Oe.isMp?[4,ba(i,0)]:[3,6];case 1:return r=d.sent(),a=null===(t=Pe())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||un("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,Ta(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,wa("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,Qt.success()];case 6:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pa.apply(this,arguments)}var Oa=function(){var e=he((function(e,t,n){return _e(this,(function(i){return[2,new Promise((function(i,o){Yt("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)}}(),Aa=[ti({secretData:zr(),ui:ti({title:zr().default("Xác thực").optional(),subTitle:zr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:zr().default("Đóng").optional()}).optional(),requireFingerprint:Hr().default(!0).optional()}).optional()];function Ia(e){return ka.apply(this,arguments)}function ka(){return ka=he((function(e){return _e(this,(function(t){return[2,hn("openBioAuthentication",Aa,[e],function(){var e=he((function(e){var t,n,r;return _e(this,(function(i){switch(i.label){case 0:return Oe.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Oa(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Ie("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ka.apply(this,arguments)}var Ca=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("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 Na(e){return Ma.apply(this,arguments)}function Ma(){return(Ma=he((function(e){return _e(this,(function(t){return[2,hn("checkStateBioAuthentication",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Ca()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Oe.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Ie("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var xa=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ra=[ti({message:zr()}).optional()];function Da(e){return ja.apply(this,arguments)}function ja(){return ja=he((function(e){return _e(this,(function(t){return[2,hn("showToast",Ra,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,xa(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ja.apply(this,arguments)}var Ua=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function La(e){return Ba.apply(this,arguments)}function Ba(){return(Ba=he((function(e){return _e(this,(function(t){return[2,hn("hideKeyboard",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Ua()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var Za=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),za=[ti({phoneNumber:zr()})];function Wa(e){return Fa.apply(this,arguments)}function Fa(){return Fa=he((function(e){return _e(this,(function(t){return[2,hn("openPhone",za,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Za(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fa.apply(this,arguments)}var Ga=function(){var e=he((function(e,t){return _e(this,(function(n){return[2,new Promise((function(n,r){Yt("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ha=[ti({content:zr(),phoneNumber:zr()})];function Va(e){return Ka.apply(this,arguments)}function Ka(){return Ka=he((function(e){return _e(this,(function(t){return[2,hn("openSMS",Ha,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ga(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ka.apply(this,arguments)}var Ja=function(){var e=he((function(e){var t,n=arguments;return _e(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){Yt("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)}}(),qa=[ti({id:zr(),displayName:zr().default("").optional()})];function $a(e){return Qa.apply(this,arguments)}function Qa(){return Qa=he((function(e){return _e(this,(function(t){return[2,hn("viewOAQr",qa,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ja(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qa.apply(this,arguments)}var Ya=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("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)}}(),Xa=[ti({keepScreenOn:Hr()})];function es(e){return ts.apply(this,arguments)}function ts(){return ts=he((function(e){return _e(this,(function(t){return[2,hn("keepScreen",Xa,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ya(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ts.apply(this,arguments)}function ns(e){return rs.apply(this,arguments)}function rs(){return(rs=he((function(e){return _e(this,(function(t){return[2,hn("onKeepScreen",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Ya(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function is(e){return os.apply(this,arguments)}function os(){return(os=he((function(e){return _e(this,(function(t){return[2,hn("offKeepScreen",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Ya(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var as=function(){var e=he((function(e,t){var n;return _e(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){Yt("SAVE_IMAGE_GALLERY",Ce({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ss=[ti({imageBase64Data:zr().optional(),imageUrl:zr().url().optional()}).optional()];function us(e){return cs.apply(this,arguments)}function cs(){return cs=he((function(e){return _e(this,(function(t){return[2,hn("saveImageToGallery",ss,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,as(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cs.apply(this,arguments)}var ls=function(){var e=he((function(e){var t,n,r,i,o,s,u=arguments;return _e(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,ba(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=Ne(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){Yt("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),ds=[ti({appId:zr(),path:zr().optional(),params:Ei.record(zr(),zr()).optional()})];function ps(e){return fs.apply(this,arguments)}function fs(){return fs=he((function(e){return _e(this,(function(t){return[2,hn("openMiniApp",ds,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,ls(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fs.apply(this,arguments)}var hs=he((function(){var e,t,n=arguments;return _e(this,(function(r){return e=n.length>0&&void 0!==n[0]?n[0]:"oneShot",t=n.length>1?n[1]:void 0,[2,new Promise((function(n,r){Yt("INTERACTIVE_VIBRATION",{type:w[e],vibrate_time:t},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))})),ms=[ti({type:Ei.enum(["oneShot"]).default("oneShot"),milliseconds:Wr().optional()})];function vs(e){return ys.apply(this,arguments)}function ys(){return ys=he((function(e){return _e(this,(function(t){return[2,hn("vibrate",ms,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,hs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ys.apply(this,arguments)}var gs=function(){var e=he((function(e,t){var n,r,i,o;return _e(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=ft.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?zt(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?zt(null==t?void 0:t.leftButton):"back"},!r&&ft.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){Yt("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),_s=[ti({url:zr(),config:ti({style:Ei.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Ei.enum(["back","none"]).default("back").optional()}).optional()})];function ws(e){return bs.apply(this,arguments)}function bs(){return bs=he((function(e){return _e(this,(function(t){return[2,hn("openWebview",_s,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,gs(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bs.apply(this,arguments)}function Ts(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Nt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Es(){return hn("getRouteParams",[],[],(function(){return Ts()}))}function Ss(e){return Ps.apply(this,arguments)}function Ps(){return(Ps=he((function(e){return _e(this,(function(t){return[2,hn("getAppInfo",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,ba()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Ie("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Os=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("WEBVIEW_SET_RESULT",{result:cn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),As=[ti({data:Ei.any()})];function Is(e){return ks.apply(this,arguments)}function ks(){return ks=he((function(e){return _e(this,(function(t){return[2,hn("sendDataToPreviousMiniApp",As,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Os(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ks.apply(this,arguments)}var Cs=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){var n,r;Yt("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(Qt.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Pe())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function Ns(e){return Ms.apply(this,arguments)}function Ms(){return(Ms=he((function(e){return _e(this,(function(t){return[2,hn("getPhoneNumber",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Cs()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Ie("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var xs=he((function(){var e,t=arguments;return _e(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){Yt("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})}))]}))})),Rs=[ti({maxProfile:Wr().min(1).max(10).optional().default(1)})];function Ds(e){return js.apply(this,arguments)}function js(){return js=he((function(e){return _e(this,(function(t){return[2,hn("openProfilePicker",Rs,[e],function(){var e=he((function(e){var t,n,r,i,o;return _e(this,(function(a){switch(a.label){case 0:return Oe.isMp?[4,xs(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,tn.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,d,p;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(ft.isUndefined(null===(d=i.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=i.data[e])||void 0===p?void 0:p.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 Oe.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Ie("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),js.apply(this,arguments)}var Us=function(){var e=he((function(e,t,n){var r;return _e(this,(function(i){return r=t&&ft.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){Yt("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)}}(),Ls=[ti({SSID:zr(),password:zr().optional(),hiddenSSID:Hr().optional()})];function Bs(e){return Zs.apply(this,arguments)}function Zs(){return Zs=he((function(e){return _e(this,(function(t){return[2,hn("connectWifi",Ls,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Us(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zs.apply(this,arguments)}var zs=function(){var e=he((function(e,t,n,r,i,o){var a,s;return _e(this,(function(u){return a={type:0,url:t,max_size:n||1048576},s={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(t,n){Yt("PICK_MEDIA",{media_type:b[e],edit_view:Ce({},s,r),silent_request:i,upload:a,max_select_items:o},{success:function(e){t(null==e?void 0:e.result_content)},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Ws=[ti({type:Ei.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:zr().url(),maxItemSize:Wr().min(0).optional(),editView:ti({enable:Hr().optional(),aspectRatio:zr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:Hr().optional(),maxSelectItem:Wr().min(1).optional()})];function Fs(e){return Gs.apply(this,arguments)}function Gs(){return Gs=he((function(e){return _e(this,(function(t){return[2,hn("openMediaPicker",Ws,[e],function(){var e=he((function(e){var t,n,r,i,o,a;return _e(this,(function(s){switch(s.label){case 0:return Oe.isMp?(i={},ft.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,zs(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Oe.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Ie("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gs.apply(this,arguments)}var Hs=[ti({title:zr().max(100),description:zr().max(400).default(""),thumbnail:zr().url().optional(),path:zr().optional()})];function Vs(e){return Ks.apply(this,arguments)}function Ks(){return Ks=he((function(e){return _e(this,(function(t){return[2,hn("getShareableLink",Hs,[e],function(){var e=he((function(e){var t;return _e(this,(function(n){switch(n.label){case 0:return[4,tn.getAccessToken()];case 1:return t=n.sent(),[4,pa(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)}}())]}))})),Ks.apply(this,arguments)}var Js=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("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 qs(e){return $s.apply(this,arguments)}function $s(){return($s=he((function(e){return _e(this,(function(t){return[2,hn("closeLoading",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Js("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function Qs(e){return Ys.apply(this,arguments)}function Ys(){return Ys=he((function(e){return _e(this,(function(t){return[2,hn("requestUpdateZalo",[],[e],he((function(){var e,t,n;return _e(this,(function(r){switch(r.label){case 0:return Oe.isMp?(n=(null===(e=Pe())||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,Ta(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("requestUpdateZalo",{}))]}}))})))]}))})),Ys.apply(this,arguments)}var Xs=It.getInstance();Xs.addListener=function(e,t,n){var r=e;return Xs.addListener(f[r],t,n)};var eu=[Ei.function()];function tu(e){return hn("onConfirmToExit",eu,[e],(function(e){var t=e;Oe.isMp&&(Xs.on(f.AppClose,t,'{"handle_h5": 1}'),Pi.setNavigationBarLeftButton(void 0,2))}))}function nu(){return hn("offConfirmToExit",[],[],(function(){Oe.isMp&&(Xs.off(f.AppClose),Pi.setNavigationBarLeftButton(void 0,0))}))}function ru(){return hn("getDeviceId",[],[],(function(){return Oe.isMp&&tn.getSync(c.DEVICE_ID)||""}))}function iu(e){return ou.apply(this,arguments)}function ou(){return(ou=he((function(e){return _e(this,(function(t){return[2,hn("getDeviceIdAsync",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,tn.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function au(){return hn("getContext",[],[],(function(){if(Oe.isMp){var e=tn.getSync(c.CONTEXT_ID)||"";return{type:tn.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function su(e){return uu.apply(this,arguments)}function uu(){return(uu=he((function(e){return _e(this,(function(t){return[2,hn("getContextAsync",[],[e],he((function(){var e;return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,tn.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,tn.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 cu(e){return lu.apply(this,arguments)}function lu(){return(lu=he((function(e){return _e(this,(function(t){return[2,hn("getAuthCode",[],[e],he((function(){var e,t;return _e(this,(function(n){switch(n.label){case 0:return Oe.isMp?[4,tn.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,tn.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,tn.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Zt([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),Qt.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function du(e){return pu.apply(this,arguments)}function pu(){return(pu=he((function(e){return _e(this,(function(t){return[2,hn("getZPIToken",[],[e],he((function(){var e,t,n,r;return _e(this,(function(i){switch(i.label){case 0:return Oe.isMp?[4,tn.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,tn.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,tn.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,tn.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 fu=[zr()];function hu(e){return hn("setAccessToken",fu,[e],(function(e){var t=e;tn.setAccessToken(t)}))}var mu=[ti({url:zr().url()})];function vu(e){return yu.apply(this,arguments)}function yu(){return yu=he((function(e){return _e(this,(function(t){return[2,hn("openOutApp",mu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ta(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yu.apply(this,arguments)}var gu=[ti({count:Wr().min(1).optional().default(1),sourceType:Ei.array(Ei.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Ei.enum(["back","front"]).default("front").optional()})];function _u(e){return wu.apply(this,arguments)}function wu(){return wu=he((function(e){return _e(this,(function(t){return[2,hn("chooseImage",gu,[e],function(){var e=he((function(e){var t,n,r,i;return _e(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)}}())]}))})),wu.apply(this,arguments)}var bu=he((function(){var e,t,n=arguments;return _e(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){Yt("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(Qt.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Tu(e){return Eu.apply(this,arguments)}function Eu(){return(Eu=he((function(e){return _e(this,(function(t){return[2,hn("getLocation",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,bu()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Ie("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Su=[Ei.function().args(ti({data:Ei.any()})).returns(Ei.void())];function Pu(e){return hn("onCallbackData",Su,[e],(function(){!function(e){It.getInstance().on(f.OnDataCallback,(function(t){e({data:t})}))}(e)}))}var Ou=function(){var e=he((function(e){var t,n,r,o,a,s,u,c,l,d,p;return _e(this,(function(f){switch(f.label){case 0:return n="",e||(e=Ts()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Nt.getParameterByName("orderId",e),o=Nt.getParameterByName("appTransID",e)||Nt.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,tn.getAccessToken().catch((function(){throw Qt.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(ie),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 Qt.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,Ce({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Au=function(){var e=he((function(e,t,n,r,o,a,s){var u,c,l,d,p,h,m,v,y,g,_,w,b,T,E,S,P,O,A,I,k;return _e(this,(function(C){switch(C.label){case 0:u=i,(c=new URLSearchParams).append("amount",e.toString()),c.append("item",encodeURIComponent(JSON.stringify(t))),c.append("appId",u),n&&c.append("desc",encodeURIComponent(n)),r&&(l=r,"object"==typeof r&&(l=JSON.stringify(r)),c.append("extradata",encodeURIComponent(l))),o&&(d=o,"object"==typeof o&&(d=JSON.stringify(o)),c.append("payload",encodeURIComponent(d))),a&&("string"==typeof a?(c.append("method",a),c.append("isCustom","false")):"object"==typeof a&&(c.append("method",a.id),c.append("isCustom",JSON.stringify(a.isCustom)))),s&&c.append("mac",s),p={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,tn.getAccessToken().catch((function(){throw Qt.error.loginRequired}))];case 2:return m=C.sent(),p.headers.authorization="Bearer ".concat(m),[4,fetch(ne,Xo(Ce({method:"POST"},p),{body:c}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw Qt.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=v.data.messageToken||"",w=window.APP_VERSION,b=window.APP_ENV,T={miniAppId:u,orderId:y},E=v.data.method,S=v.data.isCustom,g&&(T.token=g),w&&(T.version=w),b&&(T.env=b),E&&(T.method=E),S&&(T.isCustom=S),P=Nt.encode(T),O=new URL("?".concat(P),"https://payment-mini.zalo.me").toString(),A=Wt(),I=((null===(h=Pe())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,gs(O,{style:"android"===I&&A<742?"normal":"bottomSheet"}).then((function(){var e=!1;It.getInstance().once(f.WebviewClosed,(function(){setTimeout(he((function(){var t;return _e(this,(function(n){switch(n.label){case 0:return e?[3,2]:[4,Ou({zmpOrderId:y})];case 1:(t=n.sent()).err>=0&&!t.isCustom&&It.getInstance().emit(f.PaymentClose,t.err,Xo(Ce({},t),{zmpOrderId:y})),n.label=2;case 2:return[2]}}))})),500)})),It.getInstance().once(f.OpenApp,(function(){e=!0}))}))];case 5:return C.sent(),[2,{orderId:y,messageToken:_}];case 6:throw k=C.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(t,n,r,i,o,a,s){return e.apply(this,arguments)}}(),Iu=[ti({amount:Ei.union([zr(),Wr()]),item:Ei.array(Ei.record(zr(),Ei.any())),desc:zr(),extradata:Ei.any().optional(),payload:Ei.any().optional(),method:Ei.union([Ei.string(),Ei.object({id:Ei.string(),isCustom:Ei.boolean()})]).optional(),mac:Ei.string().optional()})];function ku(e){return Cu.apply(this,arguments)}function Cu(){return Cu=he((function(e){return _e(this,(function(t){return[2,hn("createOrder",Iu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Au(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 Oe.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Ie("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Cu.apply(this,arguments)}var Nu=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("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)}}(),Mu=[ti({method:zr().optional()}).optional()];function xu(e){return Ru.apply(this,arguments)}function Ru(){return Ru=he((function(e){return _e(this,(function(t){return[2,hn("selectPaymentMethod",Mu,[e],function(){var e=he((function(e){var t;return _e(this,(function(n){switch(n.label){case 0:return Oe.isMp?(t=e.method,[4,Nu(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Ie("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ru.apply(this,arguments)}var Du=[ti({data:Ei.union([zr(),Ei.record(zr(),zr())])})];function ju(e){return Uu.apply(this,arguments)}function Uu(){return Uu=he((function(e){return _e(this,(function(t){return[2,hn("checkTransaction",Du,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ou(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Ie("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Uu.apply(this,arguments)}var Lu=[ti({hide:Hr().default(!1).optional()}).optional()];function Bu(e){return Zu.apply(this,arguments)}function Zu(){return Zu=he((function(e){return _e(this,(function(t){return[2,hn("setAndroidBottomNavigationBar",Lu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Pi.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zu.apply(this,arguments)}var zu=[ti({hide:Hr().default(!1).optional()}).optional()];function Wu(e){return Fu.apply(this,arguments)}function Fu(){return Fu=he((function(e){return _e(this,(function(t){return[2,hn("setIOSBottomSafeArea",zu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Pi.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fu.apply(this,arguments)}var Gu=[ti({type:Ei.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Ei.string().optional()}).optional()];function Hu(e){return Vu.apply(this,arguments)}function Vu(){return Vu=he((function(e){return _e(this,(function(t){return[2,hn("setStatusBar",Gu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Pi.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vu.apply(this,arguments)}var Ku=[ti({headerTextColor:Ei.enum(["black","white"]).optional(),headerColor:Ei.string().optional(),actionBar:ti({hide:Ei.boolean().optional(),title:Ei.string().optional(),leftButton:Ei.enum(["back","none"]).optional(),textAlign:Ei.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Ei.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Ei.boolean().optional(),hideIOSSafeAreaBottom:Ei.boolean().optional()})];function Ju(e){return qu.apply(this,arguments)}function qu(){return qu=he((function(e){return _e(this,(function(t){return[2,hn("configAppView",Ku,[e],function(){var e=he((function(e){var t,n,r,i,o,a,s;return _e(this,(function(u){switch(u.label){case 0:return Oe.isMp?ft.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Pi.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return ft.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,Pi.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Pi.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,Pi.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Pi.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 Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qu.apply(this,arguments)}var $u=function(){var e=he((function(e,t,n,r,o,a){var s,u,c,l,d,p,f,h,m,v,y,g,_,w;return _e(this,(function(b){switch(b.label){case 0:d=i,(p=new URLSearchParams).append("payType",t||T.SUBSCRIPTION),f=E.UNKNOW,n===ae&&(f=E.IMMEDIATE_AND_CHARGE_FULL_PRICE),n===oe&&(f=E.DEFERRED),p.append("utm",o||"default"),p.append("merchantTransId",a||""),p.append("prorationMode",f.toString()),p.append("appId",d),r&&p.append("method",r),h="",(null===(s=Pe())||void 0===s||null===(u=s.platform)||void 0===u?void 0:u.isIOS)?h="ios":(null===(c=Pe())||void 0===c||null===(l=c.platform)||void 0===l?void 0:l.isAndroid)&&(h="android"),p.append("os",h),p.append("productId",e),m={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},b.label=1;case 1:return b.trys.push([1,5,,6]),[4,tn.getAccessToken().catch((function(){throw Qt.error.loginRequired}))];case 2:return v=b.sent(),m.headers.authorization="Bearer ".concat(v),[4,fetch(re,Xo(Ce({method:"POST"},m),{body:p}))];case 3:return[4,b.sent().json()];case 4:if(!(y=b.sent()).data||!y.data.store||0!==y.err)throw Qt.error.createIAPOrderFailed(y.err);return g=y.data.store,_=y.data.orderId,[2,new Promise((function(e,t){Yt("IAP_REQUESTPAYMENT",Ce({},g),{success:function(){e({orderId:_})},fail:function(e){t(e)}})}))];case 5:throw w=b.sent(),console.log("Internal error"),w;case 6:return[2]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Qu=[ti({productId:zr(),payType:Ei.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Ei.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:zr().optional(),method:Ei.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:zr().optional()})];function Yu(e){return Xu.apply(this,arguments)}function Xu(){return Xu=he((function(e){return _e(this,(function(t){return[2,hn("createOrderIAP",Qu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,$u(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Ie("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xu.apply(this,arguments)}var ec=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function tc(e){return nc.apply(this,arguments)}function nc(){return(nc=he((function(e){return _e(this,(function(t){return[2,hn("minimizeApp",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,ec()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var rc=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function ic(e){return oc.apply(this,arguments)}function oc(){return(oc=he((function(e){return _e(this,(function(t){return[2,hn("openPermissionSetting",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,rc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var ac=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function sc(e){return uc.apply(this,arguments)}function uc(){return(uc=he((function(e){return _e(this,(function(t){return[2,hn("favoriteApp",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,ac()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var cc=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function lc(e){return dc.apply(this,arguments)}function dc(){return(dc=he((function(e){return _e(this,(function(t){return[2,hn("openGroupList",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,cc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var pc=he((function(){var e;return _e(this,(function(t){switch(t.label){case 0:return[4,tn.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){Yt("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function fc(e){return hc.apply(this,arguments)}function hc(){return(hc=he((function(e){return _e(this,(function(t){return[2,hn("requestSendNotification",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,pc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var mc=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function vc(e){return yc.apply(this,arguments)}function yc(){return(yc=he((function(e){return _e(this,(function(t){return[2,hn("addRating",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,mc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ie("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var gc,_c=(gc=he((function(e,t,n){var r,i;return _e(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,Ce({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return gc.apply(this,arguments)}),wc=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("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)}}(),bc=[ti({oaId:zr()})];function Tc(e){return Ec.apply(this,arguments)}function Ec(){return Ec=he((function(e){return _e(this,(function(t){return[2,hn("interactOA",bc,[e],function(){var e=he((function(e){var t,n,r;return _e(this,(function(o){switch(o.label){case 0:return Oe.isMp?(t=e.oaId,[4,tn.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||ft.isEmpty(n)?[3,3]:[4,_c(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,wc(t)];case 4:return[2,o.sent()];case 5:return Oe.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ie("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ec.apply(this,arguments)}var Sc=[ti({oaId:zr()})];function Pc(e){return Oc.apply(this,arguments)}function Oc(){return Oc=he((function(e){return _e(this,(function(t){return[2,hn("isAllowedInteractWithOA",Sc,[e],function(){var e=he((function(e){var t,n,r;return _e(this,(function(o){switch(o.label){case 0:return Oe.isMp?(t=e.oaId,[4,tn.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||ft.isEmpty(n)?[3,3]:[4,_c(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 Oe.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Ie("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oc.apply(this,arguments)}function Ac(e){return Ic.apply(this,arguments)}function Ic(){return(Ic=he((function(e){return _e(this,(function(t){return[2,hn("getSetting",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,qt()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Ie("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var kc=Ei.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Cc=[ti({scopes:Ei.array(kc).max(2).optional()}).optional()];function Nc(e){return Mc.apply(this,arguments)}function Mc(){return Mc=he((function(e){return _e(this,(function(t){return[2,hn("authorize",Cc,[e],function(){var e=he((function(e){var t,n,r,i;return _e(this,(function(o){switch(o.label){case 0:return Oe.isMp?(n=null==e?void 0:e.scopes,r=Wt(),("android"===(i=((null===(t=Pe())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject(Qt.error.clientNotSupport())]:[4,Xt(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ie("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Mc.apply(this,arguments)}var xc=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n;return _e(this,(function(r){switch(r.label){case 0:return ft.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(Qt.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Rc(e){return hn("checkZaloCameraPermission",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return[4,xc()];case 1:return[2,e.sent()]}}))})))}var Dc=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n,r,i;return _e(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,tn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=tn.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 jc(e){return Uc.apply(this,arguments)}function Uc(){return(Uc=he((function(e){return _e(this,(function(t){return[2,hn("getUserID",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Dc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ie("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var Lc=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n,r,i;return _e(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,tn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=tn.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 Bc(e){return Zc.apply(this,arguments)}function Zc(){return(Zc=he((function(e){return _e(this,(function(t){return[2,hn("getIDToken",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Lc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ie("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var zc={format:C.JPEG,quality:N.NORMAL,mirrored:!1,useVideoSourceSize:!1},Wc={width:1024,height:768,facingMode:k.FRONT,mirrored:!1,audio:!1,video:!0},Fc=function(){function e(t){var n,r,i,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=this;ht(this,e),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(u.haveVideoStream()&&u._userRequestFrameCallback){var e=u.getCanvas();if(u.drawFrame(),e){var t={data:e.toDataURL(C.PNG),width:e.width,height:e.height};It.getInstance().emit(I.OnFrameCallback,0,t),requestAnimationFrame(u.tick)}}},this._videoElement=t,this._mediaConstraints=null!=s?s:null,this._facingMode=null!==(n=null==s?void 0:s.facingMode)&&void 0!==n?n:Wc.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(r=null==s?void 0:s.deviceId)&&void 0!==r?r:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(i=null==s?void 0:s.mirrored)&&void 0!==i?i:Wc.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(o=null==s?void 0:s.audio)&&void 0!==o?o:Wc.audio,this._videoEnabled=null!==(a=null==s?void 0:s.video)&&void 0!==a?a:Wc.video}var t=e.prototype;return t.on=function(e,t){It.getInstance().on(e,(function(e){t(e)})),e===I.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},t.off=function(e){It.getInstance().off(e),e===I.OnFrameCallback&&(this._userRequestFrameCallback=!1)},t.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},t.getFacingMode=function(){return this._facingMode},t.getCameraList=function(){return this._cameraList},t.getCameraCount=function(){return this._cameraList.length},t.getSelectedDeviceId=function(){return this._selectedDeviceId},t.setDeviceId=function(e){var t=this;return he((function(){return _e(this,(function(n){switch(n.label){case 0:return t._selectedDeviceId=e,t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},t.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},t.updateMediaConstraints=function(e){var t=this;return he((function(){var n,r,i,o,a,s;return _e(this,(function(u){switch(u.label){case 0:return ft.isEmpty(e)?[2]:JSON.stringify(e)!==JSON.stringify(t._mediaConstraints)?(t._mediaConstraints=e,t._facingMode=null!==(n=null==e?void 0:e.facingMode)&&void 0!==n?n:t._facingMode,t._selectedDeviceId=null!==(r=null==e?void 0:e.deviceId)&&void 0!==r?r:t._selectedDeviceId,t._mirror=null!==(i=null==e?void 0:e.mirrored)&&void 0!==i?i:t._mirror,t._audioEnabled=null!==(o=null==e?void 0:e.audio)&&void 0!==o?o:t._audioEnabled,t._videoEnabled=null!==(a=null==e?void 0:e.video)&&void 0!==a?a:t._videoEnabled,t._selectedDeviceId=null!==(s=null==e?void 0:e.deviceId)&&void 0!==s?s:t._selectedDeviceId,t._hasUserMedia?[4,t.stream()]:[3,2]):[2];case 1:u.sent(),u.label=2;case 2:return[2]}}))}))()},t.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||Wc.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||Wc.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},t.selectCamera=function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._cameraList[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;if(this._facingMode==k.FRONT&&o.label.toLowerCase().includes("front")||this._facingMode==k.BACK&&o.label.toLowerCase().includes("back")){this._selectedDeviceId=o.deviceId;break}}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}},t.flip=function(){var e=this;return he((function(){return _e(this,(function(t){switch(t.label){case 0:return e._facingMode=e._facingMode==k.FRONT?k.BACK:k.FRONT,e._videoElement.style.transform="",e.selectCamera(),e._hasUserMedia?[4,e.stream()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))()},t.start=function(){var e=this;return he((function(){var t,n;return _e(this,(function(r){return t=It.getInstance(),n=function(t){try{e._hasUserMedia&&e.stop()}catch(e){}},t.off(f.AppPaused,n),t.on(f.AppPaused,n),[2,new Promise(function(){var t=he((function(t,n){var r;return _e(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e.stream()];case 1:return i.sent(),It.getInstance().emit(I.OnStartCallback,0),t(e._selectedDeviceId),[3,3];case 2:return r=i.sent(),n(r),[3,3];case 3:return[2]}}))}));return function(e,n){return t.apply(this,arguments)}}())]}))}))()},t.info=function(){var e=this;return he((function(){return _e(this,(function(t){return[2,new Promise((function(t,n){navigator.mediaDevices.enumerateDevices().then((function(n){e.getVideoInputs(n),t(e._cameraList)})).catch((function(e){n(e)}))}))]}))}))()},t.stream=function(){var e=this;return he((function(){return _e(this,(function(t){return[2,new Promise((function(t,n){try{e._stop();var r=e.getCurrentMediaConstraints();if(!1===r.video&&!r.audio)return void t(e._facingMode);navigator.mediaDevices.getUserMedia(r).then(function(){var n=he((function(n){return _e(this,(function(r){switch(r.label){case 0:return[4,e.info()];case 1:return r.sent(),e.selectCamera(),e.handleUserMedia(null,n),t(e._facingMode),[2]}}))}));return function(e){return n.apply(this,arguments)}}()).catch((function(t){e.handleUserMedia(t),n(t)}))}catch(e){n(e)}}))]}))}))()},t.handleUserMedia=function(e,t){var n=this;if(!e&&t){this._stream=t;try{this._videoElement&&(this._videoElement.srcObject=t,(this._facingMode==k.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){n._userRequestFrameCallback&&n.tick()},this._videoElement.play().then((function(){n._hasUserMedia=!0})).catch((function(e){n._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},t.updateTrackEnable=function(e,t){var n=this;return he((function(){return _e(this,(function(r){switch(r.label){case 0:if(e===M.VIDEO){if(n._videoEnabled===t)return[2];n._videoEnabled=t}else{if(n._audioEnabled===t)return[2];n._audioEnabled=t}return[4,n.stream()];case 1:return r.sent(),[2]}}))}))()},t.pause=function(e){var t=this;return he((function(){return _e(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},t.resume=function(e){var t=this;return he((function(){return _e(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},t.isUsing=function(){return this._hasUserMedia},t.stop=function(){this._stop(),It.getInstance().emit(I.OnStopCallback,0)},t._stop=function(){e.stopMediaStream(this._stream),this._hasUserMedia=!1},t.setFacingMode=function(e){this._facingMode=e},t.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},t.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||zc.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},t.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},t.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},t.drawFrame=function(e){var t=this._videoElement,n=e||{};if(t&&this._ctx&&this._canvasElement){var r=this._canvasElement,i=this._ctx;r.width=(null==n?void 0:n.width)||r.width,r.height=(null==n?void 0:n.height)||r.height,((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===k.FRONT)&&(i.translate(r.width,0),i.scale(-1,1)),i.drawImage(t,0,0,r.width,r.height),((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===k.FRONT)&&(i.scale(-1,1),i.translate(-r.width,0))}},e.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},e}(),Gc=ti({play:Ei.function(),pause:Ei.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),Hc=[ti({videoElement:Gc,mediaConstraints:Ei.object({width:Ei.number().min(100).optional(),height:Ei.number().min(100).optional(),facingMode:Ei.string().optional(),audio:Ei.boolean().optional(),video:Ei.boolean().optional(),deviceId:Ei.string().optional(),mirrored:Ei.boolean().optional()}).nullish()}).optional()];function Vc(e){return hn("createCameraContext",Hc,[e],(function(e){return console.log("createCameraContext",e),new Fc(e.videoElement,e.mediaConstraints)}))}var Kc=function(){function e(){var t,n;ht(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=ge(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;ft.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?ft.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?ft.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 qc.apply(this,arguments)}function qc(){return(qc=he((function(e){return _e(this,(function(t){return[2,hn("setupAd",[],[e],(function(){return Kc.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var $c=[ti({ids:Ei.union([Ei.string(),Ei.array(Ei.string())]),config:ti({display:Ei.boolean().optional(),onClose:Ei.function().optional()}).optional()})];function Qc(e){return Yc.apply(this,arguments)}function Yc(){return Yc=he((function(e){return _e(this,(function(t){return[2,hn("loadAd",$c,[e],function(){var e=he((function(e){return _e(this,(function(t){return Kc.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yc.apply(this,arguments)}var Xc=[ti({id:Ei.string()})];function el(e){return tl.apply(this,arguments)}function tl(){return tl=he((function(e){return _e(this,(function(t){return[2,hn("displayAd",Xc,[e],function(){var e=he((function(e){return _e(this,(function(t){return Kc.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),tl.apply(this,arguments)}var nl=[ti({id:Ei.string().optional()}).optional()];function rl(e){return il.apply(this,arguments)}function il(){return il=he((function(e){return _e(this,(function(t){return[2,hn("refreshAd",nl,[e],function(){var e=he((function(e){return _e(this,(function(t){return Kc.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),il.apply(this,arguments)}var ol=[ti({id:zr(),guidingText:zr().optional(),color:zr().optional(),onStatusChange:Ei.function().optional()})];function al(e){return sl.apply(this,arguments)}function sl(){return sl=he((function(t){return _e(this,(function(n){return[2,hn("showOAWidget",ol,[t],function(){var t=he((function(t){var n,r,i,o,a,s,u,c;return _e(this,(function(l){if(Oe.isMp){try{n=document.getElementById(t.id),r=t.onStatusChange,i=t.guidingText,o=t.color,a=e(t,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="iframeOAWidget_".concat(Date.now()),(c=new URL("https://h5.zalo.me/widgets/oa_widget.html")).searchParams.set("id",u),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=Ne(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.addEventListener("message",function(){var e=he((function(e){var t,n,i,o,a,s,l,d;return _e(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(u),i=t.type,(o=new URL(t.href)).origin!==c.origin||o.pathname!==c.pathname||t.id!==u?[3,3]:"followOA"!==i&&"getOAInfo"!==i?[3,2]:[4,tn.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=tn.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},"*"),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?Ho(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),sl.apply(this,arguments)}var ul=[ti({id:zr(),type:zr(),text:zr(),color:zr().optional(),disabled:Ei.boolean().optional(),onDataReceived:Ei.function().optional(),onError:Ei.function().optional()})];function cl(e){return ll.apply(this,arguments)}function ll(){return ll=he((function(t){return _e(this,(function(n){return[2,hn("showFunctionButtonWidget",ul,[t],function(){var t=he((function(t){var n,r,i,o,a,s,u;return _e(this,(function(c){if(Oe.isMp){try{n=document.getElementById(t.id),r=t.onDataReceived,i=t.onError,o=e(t,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="iframeFunctionButtonWidget".concat(Date.now()),(u=new URL("https://h5.zalo.me/widgets/function_button_widget.html")).searchParams.set("id",s),Object.entries(o).forEach((function(e){var t=Ne(e,2),n=t[0],r=t[1];r&&u.searchParams.set("data-".concat(n),String(r))})),a.id=s,a.src=u.href,a.style.width="100%",a.style.height="100%",a.style.border="none",Object.entries(o).forEach((function(e){var t=Ne(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.addEventListener("message",function(){var e=he((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return _e(this,(function(g){switch(g.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(s),a=t.type,(c=new URL(t.href)).origin!==u.origin||c.pathname!==u.pathname||t.id!==s?[3,4]:"buttonClicked"!==a?[3,3]:[4,tn.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=tn.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=tn.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,yn()];case 2:return m=g.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},"*"),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(null==r||r(null==v?void 0:v.data)):"onError"===a&&(null==(y=t.payload)?void 0:y.type)===o.type&&(null==i||i(null==y?void 0:y.data)),g.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),ll.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:bn},mn();var dl=Object.freeze({__proto__:null,get Events(){return f},get EventName(){return f},get CameraEvents(){return I},login:mn,getAccessToken:yn,getVersion:bn,getSystemInfo:En,setNavigationBarTitle:Ai,setNavigationBarColor:Ci,setNavigationBarLeftButton:xi,setStorage:oo,getStorage:uo,getStorageInfo:lo,removeStorage:ho,clearStorage:yo,getUserInfo:bo,getNetworkType:Po,onNetworkStatusChange:Io,startBeaconDiscovery:No,stopBeaconDiscovery:Ro,getBeacons:Uo,closeApp:Zo,scanQRCode:Fo,openProfile:Ko,openChat:Qo,openPostFeed:na,followOA:aa,unfollowOA:la,openShareSheet:ma,requestCameraPermission:ga,createShortcut:Sa,openBioAuthentication:Ia,checkStateBioAuthentication:Na,showToast:Da,hideKeyboard:La,openPhone:Wa,openSMS:Va,viewOAQr:$a,keepScreen:es,onKeepScreen:ns,offKeepScreen:is,saveImageToGallery:us,openMiniApp:ps,vibrate:vs,openWebview:ws,getRouteParams:Es,getAppInfo:Ss,sendDataToPreviousMiniApp:Is,getPhoneNumber:Ns,openProfilePicker:Ds,connectWifi:Bs,openMediaPicker:Fs,getShareableLink:Vs,closeLoading:qs,requestUpdateZalo:Qs,onConfirmToExit:tu,offConfirmToExit:nu,getDeviceId:ru,getDeviceIdAsync:iu,getContext:au,getContextAsync:su,getAuthCode:cu,getZPIToken:du,setAccessToken:hu,openOutApp:vu,chooseImage:_u,getLocation:Tu,onCallbackData:Pu,createOrder:ku,selectPaymentMethod:xu,checkTransaction:ju,events:Xs,setAndroidBottomNavigationBar:Bu,setIOSBottomSafeArea:Wu,setStatusBar:Hu,configAppView:Ju,createOrderIAP:Yu,minimizeApp:tc,openPermissionSetting:ic,favoriteApp:sc,openGroupList:lc,requestSendNotification:fc,addRating:vc,interactOA:Tc,interactOa:Tc,isAllowedInteractWithOA:Pc,getSetting:Ac,authorize:Nc,checkZaloCameraPermission:Rc,getUserID:jc,getIDToken:Bc,createCameraContext:Vc,setupAd:Jc,loadAd:Qc,displayAd:el,refreshAd:rl,showOAWidget:al,showFunctionButtonWidget:cl,get FacingMode(){return k},get PhotoFormat(){return C},get PhotoQuality(){return N},get StreamType(){return M},ZMACameraImp:Fc}),pl=ku,fl=ju,hl=Yu,ml=xu,vl=e(dl,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod"]),yl={createOrder:pl,checkTransaction:fl,createOrderIAP:hl,selectPaymentMethod:ml};!function(){var e,t=null===(e=Pe())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,dl))}();var gl=Object.freeze({__proto__:null,Payment:yl,default:vl,get Events(){return f},get EventName(){return f},get CameraEvents(){return I},login:mn,getAccessToken:yn,getVersion:bn,getSystemInfo:En,setNavigationBarTitle:Ai,setNavigationBarColor:Ci,setNavigationBarLeftButton:xi,setStorage:oo,getStorage:uo,getStorageInfo:lo,removeStorage:ho,clearStorage:yo,getUserInfo:bo,getNetworkType:Po,onNetworkStatusChange:Io,startBeaconDiscovery:No,stopBeaconDiscovery:Ro,getBeacons:Uo,closeApp:Zo,scanQRCode:Fo,openProfile:Ko,openChat:Qo,openPostFeed:na,followOA:aa,unfollowOA:la,openShareSheet:ma,requestCameraPermission:ga,createShortcut:Sa,openBioAuthentication:Ia,checkStateBioAuthentication:Na,showToast:Da,hideKeyboard:La,openPhone:Wa,openSMS:Va,viewOAQr:$a,keepScreen:es,onKeepScreen:ns,offKeepScreen:is,saveImageToGallery:us,openMiniApp:ps,vibrate:vs,openWebview:ws,getRouteParams:Es,getAppInfo:Ss,sendDataToPreviousMiniApp:Is,getPhoneNumber:Ns,openProfilePicker:Ds,connectWifi:Bs,openMediaPicker:Fs,getShareableLink:Vs,closeLoading:qs,requestUpdateZalo:Qs,onConfirmToExit:tu,offConfirmToExit:nu,getDeviceId:ru,getDeviceIdAsync:iu,getContext:au,getContextAsync:su,getAuthCode:cu,getZPIToken:du,setAccessToken:hu,openOutApp:vu,chooseImage:_u,getLocation:Tu,onCallbackData:Pu,createOrder:ku,selectPaymentMethod:xu,checkTransaction:ju,events:Xs,setAndroidBottomNavigationBar:Bu,setIOSBottomSafeArea:Wu,setStatusBar:Hu,configAppView:Ju,createOrderIAP:Yu,minimizeApp:tc,openPermissionSetting:ic,favoriteApp:sc,openGroupList:lc,requestSendNotification:fc,addRating:vc,interactOA:Tc,interactOa:Tc,isAllowedInteractWithOA:Pc,getSetting:Ac,authorize:Nc,checkZaloCameraPermission:Rc,getUserID:jc,getIDToken:Bc,createCameraContext:Vc,setupAd:Jc,loadAd:Qc,displayAd:el,refreshAd:rl,showOAWidget:al,showFunctionButtonWidget:cl,get FacingMode(){return k},get PhotoFormat(){return C},get PhotoQuality(){return N},get StreamType(){return M},ZMACameraImp:Fc,get NetworkType(){return d},get PlatformType(){return p},get JumpStatus(){return h},get ProfileType(){return m},get ChatType(){return v},get PostFeedType(){return y},get ShareSheetType(){return g},get OrientationType(){return _},get VibrateType(){return w},get MediaPickerType(){return b},get IAPPayType(){return T},get ProrationMode(){return E},get StatusBarType(){return S},get AndroidBottomNavigationBarType(){return P},get IOSSafeAreaBottomType(){return O},get TextAlignType(){return A}});window.ZaloMiniAppSDK=gl}();
|