UNPKG

zmp-sdk

Version:

Zalo Mini App SDK

24 lines (21 loc) 235 kB
/** * @timeBuild 18-02-2025 10:49:10 * @license zmp-sdk * * Copyright @ 2025. 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(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["zmp-sdk"]={})}(this,(function(e){"use strict";function t(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 n,r=1048576,i=window.zAppID,o=window.APP_ID,a="https://zalo.me/s",s="https://h5.zdn.vn/zapps",u="h5.zdn.vn",c="/zapps",l={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"},d={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"}(n||(n={}));var p,f,h,m,v,y,g,_,w,T,b,E,S,P,I,A,O,k,N,C,M,R,x,D=0,U=-2e3,L=-1400,j=-1500,B=-1401,Z=-1404,z=-1408,W=-1409,F=-2004,V=-2005,G=-2006,H=-2007,K="Success",J="Unknown error. Please try again later.",q="Request limit exceeded. Please try again later.",Q="Request timeout. Please try again later.",$="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",Y="Login failed",X="This API is not supported in this version of Zalo",ee="User Authentication Required. Please grant User Authentication permission before requesting User Permission",te="Unable to pick media",ne="Unable to save image",re="Unable to save video",ie="Unable to save file",oe={SUCCESS:{code:D,message:K},UNKNOWN_ERROR:{code:U,message:J},UNAUTHORIZED:{code:B,message:$},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:Z,message:X},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:z,message:Q},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"}},ae={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:{}},se={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:oe.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:oe.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:oe.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:oe.USER_DENIED}},iOS:{"-2":{mapTo:oe.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:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},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:{},SAVE_VIDEO_GALLERY:{versionLive:{iOS:628},errorList:{android:{"-101":{mapTo:{code:G,message:re},needMoreDetail:!0},"-102":{mapTo:{code:G,message:re},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:G,message:re},needMoreDetail:!0}}}},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:V,message:ne},needMoreDetail:!0},"-102":{mapTo:{code:V,message:ne},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:V,message:ne},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:oe.MPDS_ACTION_INVALID},"-101":{mapTo:oe.UNKNOWN_ERROR},"-105":{mapTo:oe.MPDS_SOURCE_INVALID},"-106":{mapTo:oe.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:oe.MPDS_ACTION_INVALID},"-101":{mapTo:oe.MPDS_APPID_INVALID},"-102":{mapTo:oe.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:oe.MPDS_ACTION_INVALID},"-101":{mapTo:oe.UNKNOWN_ERROR},"-105":{mapTo:oe.MPDS_SOURCE_INVALID},"-106":{mapTo:oe.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:oe.MPDS_ACTION_INVALID},"-101":{mapTo:oe.MPDS_APPID_INVALID},"-102":{mapTo:oe.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:oe.USER_DENIED},"-101":{mapTo:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:oe.USER_DENIED},"-10":{mapTo:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:oe.USER_CANCEL}},iOS:{"-101":{mapTo:oe.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:oe.USER_CANCEL},999:{mapTo:{code:F,message:te},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:F,message:te}}}}},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:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:oe.UNKNOWN_ERROR},"-600":{mapTo:oe.DEVICE_NOT_SUPPORT},"-602":{mapTo:oe.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:oe.UNKNOWN_ERROR},"-600":{mapTo:oe.DEVICE_NOT_SUPPORT},"-601":{mapTo:oe.SCAN_TIMEOUT},"-602":{mapTo:oe.SERVICE_NOT_READY},"-603":{mapTo:oe.UNREADABLE},"-604":{mapTo:oe.INVALID_MRZ},"-605":{mapTo:oe.PROCESSING},"-606":{mapTo:oe.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:H,message:ie},needMoreDetail:!0},"-102":{mapTo:{code:H,message:ie},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:H,message:ie},needMoreDetail:!0}}}},MP_APP_LIFECYCLE_TRACKING:{skipJump:!1}},ue={android:{"-4":oe.DECODE_FAILED,"-5":oe.CLIENT_NOT_SUPPORT,"-14":oe.TIME_OUT},iOS:{"-9":oe.DECODE_FAILED,"-5":oe.CLIENT_NOT_SUPPORT,"-14":oe.TIME_OUT}},ce={android:12100615,iOS:460,wp:0,unknown:0},le=5*r,de="https://payment-mini.zalo.me/api/order/create",pe="https://payment-mini.zalo.me/api/order/iap-create",fe="https://payment-mini.zalo.me/api/transaction",he="https://payment-mini.zalo.me/api/order/purchase",me="DEFERRED",ve="IMMEDIATE_AND_CHARGE_FULL_PRICE",ye={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},ge=5,_e=6,we="#1843EF",Te=0,be={"-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 Ee(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 Se(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ee(o,r,i,a,s,"next",e)}function s(e){Ee(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Pe(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 Ie(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ae(e,t){if(e){if("string"==typeof e)return Pe(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)?Pe(e,t):void 0}}function Oe(e){return function(e){if(Array.isArray(e))return Pe(e)}(e)||Ie(e)||Ae(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 ke(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 Ne(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,Oe(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Ce(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(u)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(c)),isMpWeb:window.location.hostname.includes("localhost")}}Ne.async=function(e){return Se((function(){var t,n,r,i,o=arguments;return ke(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,Oe(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]}}))}))},e.NetworkType=void 0,(p=e.NetworkType||(e.NetworkType={})).none="none",p.wifi="wifi",p.cellular="cellular",p.unknown="unknown",e.PlatformType=void 0,(f=e.PlatformType||(e.PlatformType={})).wp="wp",f.android="android",f.iOS="iOS",f.unknown="unknown",e.Events=void 0,(h=e.Events||(e.Events={})).AppPaused="h5.event.paused",h.AppResumed="h5.event.resumed",h.NetworkChanged="h5.event.connection.changed",h.OnDataCallback="h5.event.webview.result",h.WebviewClosed="h5.event.webview.close",h.OpenApp="h5.event.open.mp",h.AppClose="h5.event.action.close",h.PaymentCallback="payment.callback",h.PaymentResult="action.payment.result",h.PaymentClose="action.payment.close",h.DownloadProgress="h5.event.webview.download.progress",e.JumpStatus=void 0,(m=e.JumpStatus||(e.JumpStatus={})).DOING="doing",m.DONE="done",e.ProfileType=void 0,(v=e.ProfileType||(e.ProfileType={}))[v.user=1]="user",v[v.oa=0]="oa",v[v.aliasOA=2]="aliasOA",e.ChatType=void 0,(y=e.ChatType||(e.ChatType={}))[y.user=1]="user",y[y.oa=0]="oa",e.PostFeedType=void 0,(g=e.PostFeedType||(e.PostFeedType={}))[g.image=1]="image",g[g.multi_image=2]="multi_image",g[g.link=4]="link",g[g.profile=5]="profile",e.ScanNFCType=void 0,(_=e.ScanNFCType||(e.ScanNFCType={}))[_.cccd=1]="cccd",e.ShareSheetType=void 0,(w=e.ShareSheetType||(e.ShareSheetType={}))[w.image=1]="image",w[w.gif=11]="gif",w[w.video=12]="video",w[w.link=4]="link",w[w.oa=5]="oa",w[w.zmp=20]="zmp",w[w.multi_image=21]="multi_image",w[w.zmp_deep_link=4]="zmp_deep_link",w[w.text=22]="text",e.OrientationType=void 0,(T=e.OrientationType||(e.OrientationType={}))[T.auto=1]="auto",T[T.portrait=2]="portrait",T[T.landscape=3]="landscape",e.VibrateType=void 0,(b=e.VibrateType||(e.VibrateType={}))[b.oneShot=0]="oneShot",e.MediaPickerType=void 0,(E=e.MediaPickerType||(e.MediaPickerType={}))[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",e.IAPPayType=void 0,(S=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",S.ONETIME="ONETIME",e.ProrationMode=void 0,(P=e.ProrationMode||(e.ProrationMode={}))[P.UNKNOW=0]="UNKNOW",P[P.DEFERRED=1]="DEFERRED",P[P.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(I=e.StatusBarType||(e.StatusBarType={}))[I.normal=1]="normal",I[I.hidden=0]="hidden",I[I.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(A=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[A.show=1]="show",A[A.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(O=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[O.show=1]="show",O[O.hide=0]="hide",e.TextAlignType=void 0,(k=e.TextAlignType||(e.TextAlignType={}))[k.left=0]="left",k[k.center=1]="center",e.CameraEvents=void 0,(N=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",N.OnStartCallback="h5.event.camera.start",N.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(C=e.FacingMode||(e.FacingMode={})).FRONT="user",C.BACK="environment",e.PhotoFormat=void 0,(M=e.PhotoFormat||(e.PhotoFormat={})).WEBP="image/webp",M.PNG="image/png",M.JPEG="image/jpeg",e.PhotoQuality=void 0,(R=e.PhotoQuality||(e.PhotoQuality={})).HIGH="high",R.NORMAL="normal",R.LOW="low",e.StreamType=void 0,(x=e.StreamType||(e.StreamType={})).VIDEO="video",x.AUDIO="audio";var Me,Re=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function xe(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function De(){var e=function(){var e=Ne((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:Ce(),platform:t,platformName:Re(t),zaloVersion:xe(e).trim()}}}();if(e)return e}var Ue=(null===(Me=De())||void 0===Me?void 0:Me.appEnv)||{};function Le(e){Le.on&&Le.engine(e)}Le.on=!1,Le.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 je=function(e,t){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==t||null===(r=t.fail)||void 0===r||r.call(t,i),Le({stage:n.NOT_FOUND,type:"error",name:e,request:t,state:"fail",response:i})};function Be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ze(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){Be(e,t,n[t])}))}return e}function ze(e,t){return function(e){if(Array.isArray(e))return e}(e)||Ie(e)||Ae(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 We="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Fe(){throw new Error("setTimeout has not been defined")}function Ve(){throw new Error("clearTimeout has not been defined")}var Ge=Fe,He=Ve;function Ke(e){if(Ge===setTimeout)return setTimeout(e,0);if((Ge===Fe||!Ge)&&setTimeout)return Ge=setTimeout,setTimeout(e,0);try{return Ge(e,0)}catch(t){try{return Ge.call(null,e,0)}catch(t){return Ge.call(this,e,0)}}}"function"==typeof We.setTimeout&&(Ge=setTimeout),"function"==typeof We.clearTimeout&&(He=clearTimeout);var Je,qe=[],Qe=!1,$e=-1;function Ye(){Qe&&Je&&(Qe=!1,Je.length?qe=Je.concat(qe):$e=-1,qe.length&&Xe())}function Xe(){if(!Qe){var e=Ke(Ye);Qe=!0;for(var t=qe.length;t;){for(Je=qe,qe=[];++$e<t;)Je&&Je[$e].run();$e=-1,t=qe.length}Je=null,Qe=!1,function(e){if(He===clearTimeout)return clearTimeout(e);if((He===Ve||!He)&&clearTimeout)return He=clearTimeout,clearTimeout(e);try{He(e)}catch(t){try{return He.call(null,e)}catch(t){return He.call(this,e)}}}(e)}}function et(e,t){this.fun=e,this.array=t}et.prototype.run=function(){this.fun.apply(null,this.array)};function tt(){}var nt=tt,rt=tt,it=tt,ot=tt,at=tt,st=tt,ut=tt;var ct=We.performance||{},lt=ct.now||ct.mozNow||ct.msNow||ct.oNow||ct.webkitNow||function(){return(new Date).getTime()};var dt=new Date;var pt,ft={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];qe.push(new et(e,t)),1!==qe.length||Qe||Ke(Xe)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:nt,addListener:rt,once:it,off:ot,removeListener:at,removeAllListeners:st,emit:ut,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*lt.call(ct),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-dt)/1e3}},ht=ft,mt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function vt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function yt(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 mt?mt:"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 ht&&ht.env&&"true"===ht.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(!V(e))throw new TypeError;if(!H(t))throw new TypeError;return S(e,t)}if(!V(e))throw new TypeError;if(!j(t))throw new TypeError;if(!j(r)&&!D(r)&&!U(r))throw new TypeError;return U(r)&&(r=void 0),P(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!j(n))throw new TypeError;if(!D(r)&&!K(r))throw new TypeError;C(e,t,n,r)}return n}function v(e,t,n,r){if(!j(n))throw new TypeError;return D(r)||(r=F(r)),C(e,t,n,r)}function y(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),O(e,t,n)}function _(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),N(e,t,n)}function T(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function b(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!j(t))throw new TypeError;D(n)||(n=F(n));var r=I(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)&&!U(r)){if(!H(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)&&!U(o)){if(!j(o))throw new TypeError;r=o}}return r}function I(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(O(e,t,n))return!0;var r=X(t);return!U(r)&&A(e,r,n)}function O(e,t,n){var r=I(t,n,!1);return!D(r)&&z(r.has(e))}function k(e,t,n){if(O(e,t,n))return N(e,t,n);var r=X(t);return U(r)?void 0:k(e,r,n)}function N(e,t,n){var r=I(t,n,!1);if(!D(r))return r.get(e)}function C(e,t,n,r){I(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=I(e,t,!1);if(D(r))return n;for(var i=q(r.keys()),o=0;;){var a=$(i);if(!a)return n.length=o,n;var s=Q(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 U(e){return null===e}function L(e){return"symbol"==typeof e}function j(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(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(G(n))if(!j(i=n.call(e)))return i;if(G(r=e.valueOf))if(!j(i=r.call(e)))return i}else{var r;if(G(r=e.valueOf))if(!j(i=r.call(e)))return i;var i,o=e.toString;if(G(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 L(t)?t:W(t)}function V(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function G(e){return"function"==typeof e}function H(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(!G(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!G(t))throw new TypeError;var n=t.call(e);if(!j(n))throw new TypeError;return n}function Q(e){return e.value}function $(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",T),e("getOwnMetadataKeys",b),e("deleteMetadata",E)}(r)}()}(pt||(pt={}));var gt=Object.prototype.toString;var _t="[object Null]",wt="[object Undefined]";function Tt(e){return null==e?void 0===e?wt:_t:function(e){return gt.call(e)}(e)}function bt(e){return null!=e&&"object"==typeof e}var Et={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||bt(e)&&"[object Number]"==Tt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return bt(e)&&"[object RegExp]"==Tt(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 St(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pt(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 It(e){return It=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},It(e)}function At(e){return It(e)}function Ot(e,t,n){return Ot="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=At(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},Ot(e,t,n)}function kt(e,t,n){return Ot(e,t,n)}function Nt(e,t){return Nt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Nt(e,t)}function Ct(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&&Nt(e,t)}function Mt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rt(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=At(e);if(t){var i=At(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==vt(t)&&"function"!=typeof t?Mt(e):t}(this,n)}}var xt=function(e,t){return e(t={exports:{}},t.exports),t.exports /*! ***************************************************************************** Copyright (C) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */}((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})),Dt="ACTION_CALLBACK";var Ut=function(t){Ct(r,t);var n=Rt(r);function r(){var e;return St(this,r),(e=n.apply(this,arguments)).debug=yt("zmp:event-emitter"),e}var i=r.prototype;return i.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},i.on=function(t,n,i){var o=this;if(t===Dt||t===e.Events.PaymentCallback)return kt(At(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return kt(At(r.prototype),"on",this).call(this,t,(function(e,r){o.h5ConfirmHandleEvent(e,t,i),n(r)}),i)},i.once=function(e,t,n){var i=this;if(e===Dt)return kt(At(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return kt(At(r.prototype),"once",this).call(this,e,(function(r,o){i.h5ConfirmHandleEvent(r,e,n),t(o)}),n)},r.getInstance=function(){return r.instance||(r.instance=new r),r.instance},r}(xt);function Lt(e){Ut.getInstance().emit(Dt,e)}function jt(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){Lt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=yt("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=vn(r);i("stringToData",a);var s=function(t,n){try{if(t===e.Events.OpenApp){var r=n.url,i=new URL(r),a=i.pathname.split("/zapps/".concat(o))[1];return{path:"".concat(a||"/").concat(i.search)}}return n}catch(e){return n}}(n,a);Ut.getInstance().emit(n,t,s)}},window.zaloNative2JS={nativeCall:function(t,n,r){Ut.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Bt={encode:jt,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:jt(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":vt(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":vt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Zt={},zt=function(e,t,n){var r=t||"default";return function(){return(r in Zt?Zt[r](e,n):e).apply(this,arguments)}};zt.setWrapper=function(e){Zt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Wt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Ft(e){try{return null===e?Wt:JSON.parse(e)}catch(e){return Wt}}var Vt,Gt={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Bt.encode(n);"post"!=t&&(e=Bt.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=zt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=zt((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(Ft(e.responseText))},o.onerror=function(e){e.responseText?r(Ft(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Ht=Gt,Kt=(Vt=Se((function(e,t,n){var r,i,o,a;return ke(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},Et.isUndefined(n)||(r.currentVersion=n),i=Bt.appendToUrl(d.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 Vt.apply(this,arguments)});function Jt(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Ht.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var qt=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Qt=function(){var e;return"android"===((null===(e=De())||void 0===e?void 0:e.platformName)||"").toLowerCase()},$t=function(){var e=0;if(window.zaloVersionCode)e=window.zaloVersionCode;else{var t,n=Number((null===(t=De())||void 0===t?void 0:t.zaloVersion)||"");if(n>=24112e3)e=n;else{var r,i=((null===(r=De())||void 0===r?void 0:r.platformName)||"").toLowerCase();"android"===i?e=n%1e4:"ios"===i&&(e=n)}}return e},Yt=function(e,t){var n=$t();return Qt()&&n<e||function(){var e;return"ios"===((null===(e=De())||void 0===e?void 0:e.platformName)||"").toLowerCase()}()&&n<t};function Xt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var en,tn=function(){function e(t,n,r,i){St(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}(),nn=function(e,t){return Xt(e,tn)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Xt(e,Error)?new tn(U,e.message,t).toJSON():Et.isEmpty(null==e?void 0:e.message)||Et.isEmpty(null==e?void 0:e.code)?new tn(U,J,t,e).toJSON():new tn(e.code,e.message,t,e.detail).toJSON()}(e,t)},rn=(en=Se((function(e){var t;return ke(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(d.GET_AUTH_SETTING,Ze({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return en.apply(this,arguments)}),on=Se((function(){return ke(this,(function(e){return[2,new Promise(function(){var e=Se((function(e,t){var n,r,i,o;return ke(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,pn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=pn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new tn(B,$,"getSetting")),[4,rn(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new tn(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)}}())]}))})),an=function(){var t,n,r,i=De(),o={},a=Ut.getInstance(),s=[],u=!1;return u||(n=function(t){var n=t.serialId,r=yn(t.result),i=Tn(null==r?void 0:r.action),u=Et.isEmpty(null==r?void 0:r.error_code)?0:null==r?void 0:r.error_code,c=null==r?void 0:r.error_message,l=(null==r?void 0:r.data)||r;if(i&&0===u){var d=JSON.parse(null==r?void 0:r.data);u=Et.isEmpty(null==d?void 0:d.error_code)?0:null==d?void 0:d.error_code,c=null==d?void 0:d.error_message,l=(null==d?void 0:d.data)||d}var p={error_code:u,error_message:c,data:l,action:(null==r?void 0:r.action)||t.actionName};if(n&&o[n]){var f=o[n],h=f.callback,m=f.timeout,v=f.isMultiCallback,y=f.options,g=f.downloadListener;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?Et.isFunction(r)&&r(e):Et.isFunction(i)&&i(e)}(p,h),!v&&delete o[n],m&&clearTimeout(m);var _={action:null==p?void 0:p.action,error:null==p?void 0:p.error_code,message:null==p?void 0:p.error_message,data:{}};try{if("action.open.inapp"===p.action||"action.open.outapp"===p.action){var w=new URL(null==y?void 0:y.url),T="".concat(w.protocol,"//").concat(w.host).concat(w.pathname);_.data={url:T}}if("action.follow.oa"===p.action||"action.unfollow.oa"===p.action){var b=null==y?void 0:y.uid;_.data={uid:b}}if("action.open.chat"===p.action){var E=null==y?void 0:y.uId,S=null==y?void 0:y.type;_.data={uid:E,openChatType:S}}(null==y?void 0:y.onProgress)&&g&&a.off(e.Events.DownloadProgress,g)}catch(e){}s.push(_)}},Ut.getInstance().on(Dt,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],Jt(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],Jt(e)}}),5e3),u=!0),r=Se((function(t,n,r,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,S,P,I,A,O,k,N;return ke(this,(function(C){switch(C.label){case 0:return c=Math.floor(1e6*Math.random()),l="".concat(t,"_").concat(c),d=Pn(t),(null==s?void 0:s.actionName)&&s.actionName.length>0&&(d=null==s?void 0:s.actionName),p=(null==s?void 0:s.isMultiCallback)||!1,f=!1!==(null==s?void 0:s.timeout)&&((null==s?void 0:s.timeout)||!0),h=(null==s?void 0:s.haveCallback)||!1,m=(null==s?void 0:s.skipJump)||!1,v=(null==s?void 0:s.requireAccessToken)||!1,y=bn(d),n&&r&&(o[l]={options:n,callback:r,isMultiCallback:p},f&&h&&(o[l].timeout=setTimeout((function(){return Lt({serialId:l,result:{error_code:z,error_message:Q,data:{timeout:f},action:t}}),null}),!0===f?8e3:1e3*f))),y?[4,on()]:[3,2];case 1:if(!1===(null==(_=C.sent())||null===(g=_.authSetting)||void 0===g?void 0:g["scope.userInfo"]))return Lt({serialId:l,result:{error_code:B,error_message:ee,data:{isMobile:null==i||null===(w=i.platform)||void 0===w?void 0:w.isMobile},action:t}}),[2];C.label=2;case 2:return T=Tn(d),!(null==i||null===(u=i.platform)||void 0===u?void 0:u.isMobile)||!t||Et.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!mn(t)||T&&!1===T.isSupported?(Lt({serialId:l,result:{error_code:Z,error_message:X,data:{isMobile:null==i||null===(b=i.platform)||void 0===b?void 0:b.isMobile},action:t}}),[2]):(E=hn(n),m?[3,4]:[4,pn.getJSAccessToken()]);case 3:return P=C.sent(),[3,5];case 4:P="",C.label=5;case 5:S=P,C.label=6;case 6:return C.trys.push([6,10,,11]),m||!v?[3,8]:[4,pn.getAccessToken()];case 7:return A=C.sent(),[3,9];case 8:A="",C.label=9;case 9:return I=A,[3,11];case 10:return O=C.sent(),Lt({serialId:l,result:{error_code:null==O?void 0:O.code,error_message:null==O?void 0:O.message,action:t}}),[2];case 11:try{n&&(null==n?void 0:n.onProgress)&&(k=function(e){!function(e,t){e.url;var n=e.progress;t&&t(n)}(e,null=