UNPKG

zmp-sdk

Version:

Zalo Mini App SDK

10 lines (9 loc) 254 kB
/** * @timeBuild 05-03-2026 15:46:02 * @license zmp-sdk * * Copyright @ 2026. Zalo Group. * * This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. */ !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=0,h=-2e3,m=-1400,v=-1500,g=-1401,y=-1404,_=-1408,w=-1409,b=-2004,T=-2005,E=-2006,P=-2007,I=-700,S="Success",A="Unknown error. Please try again later.",O="Request limit exceeded. Please try again later.",C="Request timeout. Please try again later.",k="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",N="Login failed",M="This API is not supported in this version of Zalo",R="User Authentication Required. Please grant User Authentication permission before requesting User Permission",D="Unable to pick media",x="Unable to save image",L="Unable to save video",U="Unable to save file",j="Download failed. Please check your URL again.",B={SUCCESS:{code:f,message:S},UNKNOWN_ERROR:{code:h,message:A},UNAUTHORIZED:{code:g,message:k},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:y,message:M},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:_,message:C},USER_DENIED:{code:-2002,message:"User denied"},USER_CANCEL:{code:-2003,message:"User cancel"},DUPLICATE_REQUEST:{code:-1410,message:"Duplicate request. Please try again later."},DEVICE_NOT_SUPPORT:{code:-600,message:"This device does not support NFC"},SERVICE_NOT_READY:{code:-602,message:"NFC service is not ready. Please check in your setting"},UNREADABLE:{code:-603,message:"NFC tag is unreadable"},INVALID_MRZ:{code:-604,message:"Invalid MRZ data. Please try again later."},PROCESSING:{code:-605,message:"Processing NFC tag. Please wait a moment."},CANCEL:{code:-606,message:"User cancel"},SCAN_TIMEOUT:{code:-601,message:"NFC scan timeout. Please try again later."},MPDS_ACTION_INVALID:{code:-3e3,message:"Action name from input data does not match declared API actions"},MPDS_SOURCE_INVALID:{code:-3005,message:"This API not called from Mini App"},MPDS_APPID_INVALID:{code:-3006,message:"AppId from input data does not match the currently opened AppId"}},Z={addRating:{limit:1},authorize:{},isAllowedInteractWithOA:{},favoriteApp:{},followOA:{},getLocation:{},getPhoneNumber:{},getShareableLink:{},getSetting:{},getAppInfo:{},getUserInfo:{},interactOA:{},openProfilePicker:{},openShareSheet:{},unfollowOA:{},checkTransaction:{limit:5},createOrder:{limit:5},createOrderIAP:{limit:5},selectPaymentMethod:{},requestSendNotification:{}},z={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,errorList:{android:{"-400":{mapTo:B.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:B.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:B.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:B.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:B.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:B.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:B.USER_DENIED}},iOS:{"-2":{mapTo:B.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:B.USER_DENIED},"-400":{mapTo:B.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:B.USER_DENIED},"-400":{mapTo:B.DUPLICATE_REQUEST}}}},QUERY_LOCATION_HIDE:{haveCallback:!0},SHOW_TOAST:{haveCallback:!0,timeout:2},OPEN_APP:{},HIDE_KEYBOARD:{},OPEN_PHONE:{},OPEN_QR:{},OPEN_SMS:{errorList:{iOS:{"-9":{mapTo:B.UNKNOWN_ERROR},"-10":{mapTo:B.USER_CANCEL}}}},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:{},SAVE_VIDEO_GALLERY:{versionLive:{iOS:628},errorList:{android:{"-101":{mapTo:{code:E,message:L},needMoreDetail:!0},"-102":{mapTo:{code:E,message:L},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:E,message:L},needMoreDetail:!0}}}},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:T,message:x},needMoreDetail:!0},"-102":{mapTo:{code:T,message:x},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:T,message:x},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},errorList:{android:{"-100":{mapTo:B.MPDS_ACTION_INVALID},"-101":{mapTo:B.UNKNOWN_ERROR},"-105":{mapTo:B.MPDS_SOURCE_INVALID},"-106":{mapTo:B.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:B.MPDS_ACTION_INVALID},"-101":{mapTo:B.MPDS_APPID_INVALID},"-102":{mapTo:B.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:B.MPDS_ACTION_INVALID},"-101":{mapTo:B.UNKNOWN_ERROR},"-105":{mapTo:B.MPDS_SOURCE_INVALID},"-106":{mapTo:B.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:B.MPDS_ACTION_INVALID},"-101":{mapTo:B.MPDS_APPID_INVALID},"-102":{mapTo:B.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:B.USER_DENIED},"-101":{mapTo:B.USER_DENIED},"-400":{mapTo:B.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:B.USER_DENIED},"-10":{mapTo:B.USER_DENIED},"-400":{mapTo:B.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:B.USER_CANCEL}},iOS:{"-101":{mapTo:B.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:B.USER_CANCEL},999:{mapTo:{code:b,message:D},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:b,message:D}},"-101":{mapTo:B.USER_CANCEL}}}},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:B.USER_DENIED},"-400":{mapTo:B.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:B.USER_DENIED},"-400":{mapTo:B.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:B.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:B.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:B.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:B.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:B.UNKNOWN_ERROR},"-600":{mapTo:B.DEVICE_NOT_SUPPORT},"-602":{mapTo:B.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:B.UNKNOWN_ERROR},"-600":{mapTo:B.DEVICE_NOT_SUPPORT},"-601":{mapTo:B.SCAN_TIMEOUT},"-602":{mapTo:B.SERVICE_NOT_READY},"-603":{mapTo:B.UNREADABLE},"-604":{mapTo:B.INVALID_MRZ},"-605":{mapTo:B.PROCESSING},"-606":{mapTo:B.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:P,message:U},needMoreDetail:!0},"-102":{mapTo:{code:P,message:U},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:P,message:U},needMoreDetail:!0}}}},LFS_FILE_INFO:{skipJump:!1},LFS_LIST:{skipJump:!1},LFS_FILE_SAVE:{skipJump:!1},LFS_FILE_REMOVE:{skipJump:!1},MP_APP_LIFECYCLE_TRACKING:{skipJump:!1},OPEN_DOCUMENT:{skipJump:!1,errorList:{all:{"-10":{mapTo:{code:I,message:j}},"-700":{mapTo:{code:I,message:j}},"-701":{mapTo:{code:-701,message:"Unsupported file type"}},"-702":{mapTo:{code:-702,message:"Download failed. Please check your network or file path again."}},"-703":{mapTo:{code:-703,message:"Open document failed"}}}}},GET_DEVICE_INFO:{skipJump:!1},MP_OPEN_ZINSTANTVIEW:{skipJump:!1,timeout:!0,versionLive:{android:25081840,iOS:674}},OPEN_SETTING:{skipJump:!1}},W={android:{"-4":B.DECODE_FAILED,"-5":B.CLIENT_NOT_SUPPORT,"-14":B.TIME_OUT},iOS:{"-9":B.DECODE_FAILED,"-5":B.CLIENT_NOT_SUPPORT,"-14":B.TIME_OUT}},F={android:12100615,iOS:460,wp:0,unknown:0},G=5*n,V="https://payment-mini.zalo.me/api/order/create-v2",H="https://payment-mini.zalo.me/api/order/iap-create",K="https://payment-mini.zalo.me/api/transaction",J="https://payment-mini.zalo.me/api/order/purchase",q="DEFERRED",Q="IMMEDIATE_AND_CHARGE_FULL_PRICE",Y={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},$=5,X=6,ee="#1843EF",te=0,ne={"-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(e){e.DEV_TRACKING="devTracking"}(d||(d={})),function(e){e[e.APP_INITIALIZING=95]="APP_INITIALIZING",e[e.APP_READY=96]="APP_READY"}(p||(p={}));var re,ie,oe,ae,se,ue,ce,le,de,pe,fe,he,me,ve,ge,ye,_e,we,be,Te,Ee,Pe,Ie,Se,Ae="checkoutKitWidget-ifCKW",Oe="https://h5.zalo.me",Ce={CHECKOUT_KIT:"https://h5.zalo.me/widgets/checkoutkit_widget.html",FUNCTION_BUTTON:"https://h5.zalo.me/widgets/function_button_widget.html",OA:"https://h5.zalo.me/widgets/oa_widget.html",CUSTOM_OA:"https://h5.zalo.me/widgets/oa_widget_custom.html"},ke=["close","pay"];function Ne(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 Me(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ne(o,r,i,a,s,"next",e)}function s(e){Ne(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Re(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 De(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function xe(e,t){if(e){if("string"==typeof e)return Re(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)?Re(e,t):void 0}}function Le(e){return function(e){if(Array.isArray(e))return Re(e)}(e)||De(e)||xe(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 Ue(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 je(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Be(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,Le(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Ze(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")}}Be.async=function(e){return Me((function(){var t,n,r,i,o=arguments;return Ue(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,Le(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"}(re||(re={})),function(e){e.wp="wp",e.android="android",e.iOS="iOS",e.unknown="unknown"}(ie||(ie={})),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.PaymentDone="action.payment.done",e.PaymentClose="action.payment.close",e.DownloadProgress="h5.event.webview.download.progress"}(oe||(oe={})),function(e){e.DOING="doing",e.DONE="done"}(ae||(ae={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa",e[e.aliasOA=2]="aliasOA"}(se||(se={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa"}(ue||(ue={})),function(e){e[e.image=1]="image",e[e.multi_image=2]="multi_image",e[e.link=4]="link",e[e.profile=5]="profile"}(ce||(ce={})),function(e){e[e.cccd=1]="cccd"}(le||(le={})),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"}(de||(de={})),function(e){e[e.auto=1]="auto",e[e.portrait=2]="portrait",e[e.landscape=3]="landscape"}(pe||(pe={})),function(e){e[e.oneShot=0]="oneShot"}(fe||(fe={})),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"}(he||(he={})),function(e){e.SUBSCRIPTION="SUBSCRIPTION",e.ONETIME="ONETIME"}(me||(me={})),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"}(ve||(ve={})),function(e){e[e.normal=1]="normal",e[e.hidden=0]="hidden",e[e.transparent=2]="transparent"}(ge||(ge={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(ye||(ye={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(_e||(_e={})),function(e){e[e.left=0]="left",e[e.center=1]="center"}(we||(we={})),function(e){e.TOOL_DEL_FRIEND="tool_del_friend"}(be||(be={})),function(e){e.OnFrameCallback="h5.event.camera.frame",e.OnStartCallback="h5.event.camera.start",e.OnStopCallback="h5.event.camera.stop"}(Te||(Te={})),function(e){e.FRONT="user",e.BACK="environment"}(Ee||(Ee={})),function(e){e.WEBP="image/webp",e.PNG="image/png",e.JPEG="image/jpeg"}(Pe||(Pe={})),function(e){e.HIGH="high",e.NORMAL="normal",e.LOW="low"}(Ie||(Ie={})),function(e){e.VIDEO="video",e.AUDIO="audio"}(Se||(Se={}));var ze,We=function(e){return e.isAndroid?ie.android:e.isIOS?ie.iOS:ie.unknown};function Fe(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Ge(){var e=function(){var e=Be((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:Ze(),platform:t,platformName:We(t),zaloVersion:Fe(e).trim()}}}();if(e)return e}var Ve=(null===(ze=Ge())||void 0===ze?void 0:ze.appEnv)||{};function He(e){He.on&&He.engine(e)}He.on=!1,He.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 Ke=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),He({stage:t.NOT_FOUND,type:"error",name:e,request:n,state:"fail",response:i})};function Je(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qe(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){Je(e,t,n[t])}))}return e}function Qe(e,t){return function(e){if(Array.isArray(e))return e}(e)||De(e)||xe(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 Ye="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function $e(){throw new Error("setTimeout has not been defined")}function Xe(){throw new Error("clearTimeout has not been defined")}var et=$e,tt=Xe;function nt(e){if(et===setTimeout)return setTimeout(e,0);if((et===$e||!et)&&setTimeout)return et=setTimeout,setTimeout(e,0);try{return et(e,0)}catch(t){try{return et.call(null,e,0)}catch(t){return et.call(this,e,0)}}}"function"==typeof Ye.setTimeout&&(et=setTimeout),"function"==typeof Ye.clearTimeout&&(tt=clearTimeout);var rt,it=[],ot=!1,at=-1;function st(){ot&&rt&&(ot=!1,rt.length?it=rt.concat(it):at=-1,it.length&&ut())}function ut(){if(!ot){var e=nt(st);ot=!0;for(var t=it.length;t;){for(rt=it,it=[];++at<t;)rt&&rt[at].run();at=-1,t=it.length}rt=null,ot=!1,function(e){if(tt===clearTimeout)return clearTimeout(e);if((tt===Xe||!tt)&&clearTimeout)return tt=clearTimeout,clearTimeout(e);try{tt(e)}catch(t){try{return tt.call(null,e)}catch(t){return tt.call(this,e)}}}(e)}}function ct(e,t){this.fun=e,this.array=t}ct.prototype.run=function(){this.fun.apply(null,this.array)};function lt(){}var dt=lt,pt=lt,ft=lt,ht=lt,mt=lt,vt=lt,gt=lt;var yt=Ye.performance||{},_t=yt.now||yt.mozNow||yt.msNow||yt.oNow||yt.webkitNow||function(){return(new Date).getTime()};var wt=new Date;var bt,Tt={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];it.push(new ct(e,t)),1!==it.length||ot||nt(ut)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:dt,addListener:pt,once:ft,off:ht,removeListener:mt,removeAllListeners:vt,emit:gt,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*_t.call(yt),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-wt)/1e3}},Et=Tt,Pt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function It(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 Pt?Pt:"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 Et&&Et.env&&"true"===Et.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(x(n)){if(!G(e))throw new TypeError;if(!H(t))throw new TypeError;return P(e,t)}if(!G(e))throw new TypeError;if(!j(t))throw new TypeError;if(!j(r)&&!x(r)&&!L(r))throw new TypeError;return L(r)&&(r=void 0),I(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!j(n))throw new TypeError;if(!x(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!j(n))throw new TypeError;return x(r)||(r=F(r)),N(e,t,n,r)}function g(e,t,n){if(!j(t))throw new TypeError;return x(n)||(n=F(n)),A(e,t,n)}function y(e,t,n){if(!j(t))throw new TypeError;return x(n)||(n=F(n)),O(e,t,n)}function _(e,t,n){if(!j(t))throw new TypeError;return x(n)||(n=F(n)),C(e,t,n)}function w(e,t,n){if(!j(t))throw new TypeError;return x(n)||(n=F(n)),k(e,t,n)}function b(e,t){if(!j(e))throw new TypeError;return x(t)||(t=F(t)),M(e,t)}function T(e,t){if(!j(e))throw new TypeError;return x(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!j(t))throw new TypeError;x(n)||(n=F(n));var r=S(t,n,!1);if(x(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 P(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!x(r)&&!L(r)){if(!H(r))throw new TypeError;t=r}}return t}function I(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!x(o)&&!L(o)){if(!j(o))throw new TypeError;r=o}}return r}function S(e,t,n){var r=f.get(e);if(x(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(x(i)){if(!n)return;i=new d,r.set(t,i)}return i}function A(e,t,n){if(O(e,t,n))return!0;var r=X(t);return!L(r)&&A(e,r,n)}function O(e,t,n){var r=S(t,n,!1);return!x(r)&&z(r.has(e))}function C(e,t,n){if(O(e,t,n))return k(e,t,n);var r=X(t);return L(r)?void 0:C(e,r,n)}function k(e,t,n){var r=S(t,n,!1);if(!x(r))return r.get(e)}function N(e,t,n,r){S(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=S(e,t,!1);if(x(r))return n;for(var i=q(r.keys()),o=0;;){var a=Y(i);if(!a)return n.length=o,n;var s=Q(a);try{n[o]=s}catch(e){try{$(i)}finally{throw e}}o++}}function D(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 x(e){return void 0===e}function L(e){return null===e}function U(e){return"symbol"==typeof e}function j(e){return"object"==typeof e?null!==e:"function"==typeof e}function B(e,t){switch(D(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(j(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(V(n))if(!j(i=n.call(e)))return i;if(V(r=e.valueOf))if(!j(i=r.call(e)))return i}else{var r;if(V(r=e.valueOf))if(!j(i=r.call(e)))return i;var i,o=e.toString;if(V(o))if(!j(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 V(e){return"function"==typeof e}function H(e){return"function"==typeof e}function K(e){switch(D(e)){case 3:case 4:return!0;default:return!1}}function J(e,t){var n=e[t];if(null!=n){if(!V(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!V(t))throw new TypeError;var n=t.call(e);if(!j(n))throw new TypeError;return n}function Q(e){return e.value}function Y(e){var t=e.next();return!t.done&&t}function $(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",g),e("hasOwnMetadata",y),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",T),e("deleteMetadata",E)}(r)}()}(bt||(bt={}));var At=Object.prototype.toString;var Ot="[object Null]",Ct="[object Undefined]";function kt(e){return null==e?void 0===e?Ct:Ot:function(e){return At.call(e)}(e)}function Nt(e){return null!=e&&"object"==typeof e}var Mt={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||Nt(e)&&"[object Number]"==kt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return Nt(e)&&"[object RegExp]"==kt(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 Rt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dt(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 xt(e){return xt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},xt(e)}function Lt(e){return xt(e)}function Ut(e,t,n){return Ut="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=Lt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},Ut(e,t,n)}function jt(e,t,n){return Ut(e,t,n)}function Bt(e,t){return Bt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Bt(e,t)}function Zt(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&&Bt(e,t)}function zt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wt(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=Lt(e);if(t){var i=Lt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==It(t)&&"function"!=typeof t?zt(e):t}(this,n)}}var Ft,Gt,Vt=(Ft=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},Ft(Gt={exports:{}},Gt.exports),Gt.exports),Ht={enablePaymentDone:!1};function Kt(e){var t=e.data;return{orderId:t.zmpOrderId||t.orderId,transId:t.appTransID||t.apptransid||t.transId}}var Jt="ACTION_CALLBACK";function qt(e,t,n,r){switch(!0){case"string"==typeof n||null===n:return[{eventName:e,eventId:t,data:n}];case e===oe.OpenApp&&(null==r?void 0:r.enablePaymentDone):var i=function(e){var t=new URL(e,window.location.origin),n=t.pathname.split("/")[3].toUpperCase().replace(/-/g,"_"),r={},i=t.searchParams.get("orderId"),o=t.searchParams.get("zmpOrderId"),a=t.searchParams.get("appTransID")||t.searchParams.get("apptransid");switch(n){case"MOMO":case"MOMO_SANDBOX":r.orderId=o,r.transId=i;break;default:r.orderId=o||i,r.transId=a}return r}(n.path);return[{eventName:oe.PaymentDone,eventId:t,data:i}];case e===oe.OnDataCallback:if(["PAY_BY_BANK","PAY_BY_CUSTOM_METHOD"].includes(null==n?void 0:n.eventType))return[{eventName:oe.OnDataCallback,eventId:t,data:n},{eventName:oe.PaymentDone,eventId:t,data:Kt(n)}];break;default:return[{eventName:e,eventId:t,data:n}]}}var Qt=function(e){Zt(n,e);var t=Wt(n);function n(){var e;return Rt(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===Jt||e===oe.PaymentCallback)return jt(Lt(n.prototype),"on",this).call(this,e,t,r);this.debug("register ".concat(String(e),": ").concat(r));return jt(Lt(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===Jt)return jt(Lt(n.prototype),"once",this).call(this,e,t,r);this.debug("register once ".concat(String(e),": ").concat(r));return jt(Lt(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}(Vt);function Yt(e){Qt.getInstance().emit(Jt,e)}function $t(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){Yt({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=Mn(n);r("stringToData",o);var a=function(e,t){if(!t||"string"==typeof t)return t;try{if(e===oe.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),s=qt(t,e,a,Ht);null==s||s.forEach((function(e){Qt.getInstance().emit(e.eventName,e.eventId,e.data);var t=document.getElementById(Ae);t&&Fn(t,"appEvent",{eventName:e.eventName,eventId:e.eventId,data:e.data})}))}},window.zaloNative2JS={nativeCall:function(e,t,n){Qt.getInstance().emit(oe.PaymentCallback,e,t,n)}};var Xt={encode:$t,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:$t(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":It(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":It(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},en={},tn=function(e,t,n){var r=t||"default";return function(){return(r in en?en[r](e,n):e).apply(this,arguments)}};tn.setWrapper=function(e){en[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var nn={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function rn(e){try{return null===e?nn:JSON.parse(e)}catch(e){return nn}}var on,an={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Xt.encode(n);"post"!=t&&(e=Xt.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=tn((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=tn((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(rn(e.responseText))},o.onerror=function(e){e.responseText?r(rn(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},sn=an,un=(on=Me((function(e,t,n){var r,i,o,a;return Ue(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},Mt.isUndefined(n)||(r.currentVersion=n),i=Xt.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,appId:e,zaloAppId:a.data.zaloAppId}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return on.apply(this,arguments)});function cn(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));sn.execute(l.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var ln=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},dn=function(){var e;return"android"===((null===(e=Ge())||void 0===e?void 0:e.platformName)||"").toLowerCase()},pn=function(){var e;return"ios"===((null===(e=Ge())||void 0===e?void 0:e.platformName)||"").toLowerCase()};function fn(e){var t=String(e);try{if(/^\d{9}$/.test(t)&&"0"===t[5])return Number(t.slice(0,5)+t.slice(6))}catch(e){}return Number(t)}var hn=function(){var e,t=0;if(window.zaloVersionCode)return fn(window.zaloVersionCode);var n=Number((null===(e=Ge())||void 0===e?void 0:e.zaloVersion)||"0");return n>=24112e3?t=n:dn()?t=n%1e4:pn()&&(t=n),fn(t)};function mn(e,t){if(window.isAPISupport&&"function"==typeof window.isAPISupport)return window.isAPISupport(e,t);var n=hn();return dn()?n>=e:!!pn()&&n>=t}function vn(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var gn,yn=function(){function e(t,n,r,i){Rt(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}(),_n=function(e,t){return vn(e,yn)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return vn(e,Error)?new yn(h,e.message,t).toJSON():Mt.isEmpty(null==e?void 0:e.message)||Mt.isEmpty(null==e?void 0:e.code)?new yn(h,A,t,e).toJSON():new yn(e.code,e.message,t,e.detail).toJSON()}(e,t)},wn=(gn=Me((function(e){var t;return Ue(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,qe({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return gn.apply(this,arguments)}),bn=Me((function(){return Ue(this,(function(e){return[2,new Promise(function(){var e=Me((function(e,t){var n,r,i,o;return Ue(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,On.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=On.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new yn(g,k,"getSetting")),[4,wn(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new yn(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)}}())]}))})),Tn=function(){var e,t,n,r=Ge(),i={},o=Qt.getInstance(),a=[],s=!1;return s||(t=function(e){var t=e.serialId,n=Rn(e.result),r=Un(null==n?void 0:n.action),s=Mt.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,u=null==n?void 0:n.error_message,c=(null==n?void 0:n.data)||n;if(r&&0===s){var l=JSON.parse(null==n?void 0:n.data);s=Mt.isEmpty(null==l?void 0:l.error_code)?0:null==l?void 0:l.error_code,u=null==l?void 0:l.error_message,c=(null==l?void 0:l.data)||l}var d={error_code:s,error_message:u,data:c,action:(null==n?void 0:n.action)||e.actionName};if(t&&i[t]){var p=i[t],f=p.callback,h=p.timeout,m=p.isMultiCallback,v=p.options,g=p.downloadListener;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?Mt.isFunction(r)&&r(e):Mt.isFunction(i)&&i(e)}(d,f),!m&&delete i[t],h&&clearTimeout(h);var y={action:null==d?void 0:d.action,error:null==d?void 0:d.error_code,message:null==d?void 0:d.error_message,data:{}};try{if("action.open.inapp"===d.action||"action.open.outapp"===d.action){var _=new URL(null==v?void 0:v.url),w="".concat(_.protocol,"//").concat(_.host).concat(_.pathname);y.data={url:w}}if("action.follow.oa"===d.action||"action.unfollow.oa"===d.action){var b=null==v?void 0:v.uid;y.data={uid:b}}if("action.open.chat"===d.action){var T=null==v?void 0:v.uId,E=null==v?void 0:v.type;y.data={uid:T,openChatType:E}}(null==v?void 0:v.onProgress)&&g&&o.off(oe.DownloadProgress,g)}catch(e){}a.push(y)}},Qt.getInstance().on(Jt,t),o.on(oe.AppPaused,(function(){if(a.length>0){var e=a;a=[],cn(e)}})),e?clearInterval(e):e=setInterval((function(){if(a.length>0){var e=a;a=[],cn(e)}}),5e3),s=!0),n=Me((function(e,t,n,a){var s,u,c,l,d,p,f,h,m,v,w,b,T,E,P,I,S,A,O,k,N,D,x;return Ue(this,(function(L){switch(L.label){case 0:return u=Math.floor(1e6*Math.random()),c="".concat(e,"_").concat(u),l=zn(e),(null==a?void 0:a.actionName)&&a.actionName.length>0&&(l=null==a?void 0:a.actionName),d=(null==a?void 0:a.isMultiCallback)||!1,p=!1!==(null==a?void 0:a.timeout)&&((null==a?void 0:a.timeout)||!0),f=(null==a?void 0:a.haveCallback)||!1,h=(null==a?void 0:a.skipJump)||!1,m=(null==a?void 0:a.requireAccessToken)||!1,v=jn(l),t&&n&&(i[c]={options:t,callback:n,isMultiCallback:d},p&&f&&(i[c].timeout=setTimeout((function(){return Yt({serialId:c,result:{error_code:_,error_message:C,data:{timeout:p},action:e}}),null}),!0===p?8e3:1e3*p))),v?[4,bn()]:[3,2];case 1:if(!1===(null==(b=L.sent())||null===(w=b.authSetting)||void 0===w?void 0:w["scope.userI