zmp-sdk 2.51.5 → 2.52.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @timeBuild 22-06-2026 17:20:21
2
+ * @timeBuild 14-07-2026 11:57:09
3
3
  * @license zmp-sdk
4
4
  *
5
5
  * Copyright @ 2026. Zalo Group.
@@ -7,7 +7,7 @@
7
7
  * This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
8
8
  */
9
9
 
10
- !function(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=0,m=-2e3,v=-1400,y=-1500,g=-1401,_=-1404,w=-1408,b=-1409,T=-2004,E=-2005,P=-2006,S=-2007,I=-700,A="Success",O="Unknown error. Please try again later.",k="Request limit exceeded. Please try again later.",C="Request timeout. Please try again later.",N="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",M="Login failed",R="This API is not supported in this version of Zalo",x="User Authentication Required. Please grant User Authentication permission before requesting User Permission",D="Unable to pick media",L="Unable to save image",U="Unable to save video",j="Unable to save file",B="Download failed. Please check your URL again.",Z={SUCCESS:{code:h,message:A},UNKNOWN_ERROR:{code:m,message:O},UNAUTHORIZED:{code:g,message:N},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:_,message:R},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:w,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:{}},W={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:Z.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:Z.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:Z.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:Z.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:Z.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:Z.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:Z.USER_DENIED}},iOS:{"-2":{mapTo:Z.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:Z.USER_DENIED},"-400":{mapTo:Z.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:Z.USER_DENIED},"-400":{mapTo:Z.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:Z.UNKNOWN_ERROR},"-10":{mapTo:Z.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:P,message:U},needMoreDetail:!0},"-102":{mapTo:{code:P,message:U},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:P,message:U},needMoreDetail:!0}}}},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},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}}}},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:Z.MPDS_ACTION_INVALID},"-101":{mapTo:Z.UNKNOWN_ERROR},"-105":{mapTo:Z.MPDS_SOURCE_INVALID},"-106":{mapTo:Z.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:Z.MPDS_ACTION_INVALID},"-101":{mapTo:Z.MPDS_APPID_INVALID},"-102":{mapTo:Z.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:Z.MPDS_ACTION_INVALID},"-101":{mapTo:Z.UNKNOWN_ERROR},"-105":{mapTo:Z.MPDS_SOURCE_INVALID},"-106":{mapTo:Z.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:Z.MPDS_ACTION_INVALID},"-101":{mapTo:Z.MPDS_APPID_INVALID},"-102":{mapTo:Z.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:Z.USER_DENIED},"-101":{mapTo:Z.USER_DENIED},"-400":{mapTo:Z.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:Z.USER_DENIED},"-10":{mapTo:Z.USER_DENIED},"-400":{mapTo:Z.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:Z.USER_CANCEL}},iOS:{"-101":{mapTo:Z.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:Z.USER_CANCEL},999:{mapTo:{code:T,message:D},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:T,message:D}},"-101":{mapTo:Z.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:Z.USER_DENIED},"-400":{mapTo:Z.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:Z.USER_DENIED},"-400":{mapTo:Z.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:Z.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:Z.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:Z.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:Z.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:Z.UNKNOWN_ERROR},"-600":{mapTo:Z.DEVICE_NOT_SUPPORT},"-602":{mapTo:Z.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:Z.UNKNOWN_ERROR},"-600":{mapTo:Z.DEVICE_NOT_SUPPORT},"-601":{mapTo:Z.SCAN_TIMEOUT},"-602":{mapTo:Z.SERVICE_NOT_READY},"-603":{mapTo:Z.UNREADABLE},"-604":{mapTo:Z.INVALID_MRZ},"-605":{mapTo:Z.PROCESSING},"-606":{mapTo:Z.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:S,message:j},needMoreDetail:!0},"-102":{mapTo:{code:S,message:j},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:S,message:j},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:B}},"-700":{mapTo:{code:I,message:B}},"-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}},F={android:{"-4":Z.DECODE_FAILED,"-5":Z.CLIENT_NOT_SUPPORT,"-14":Z.TIME_OUT},iOS:{"-9":Z.DECODE_FAILED,"-5":Z.CLIENT_NOT_SUPPORT,"-14":Z.TIME_OUT}},G={android:12100615,iOS:460,wp:0,unknown:0},V=5*r,H="https://payment-mini.zalo.me/api/order/create-v2",K="https://payment-mini.zalo.me/api/order/iap-create",J="https://payment-mini.zalo.me/api/transaction",q="https://payment-mini.zalo.me/api/order/purchase",Q="DEFERRED",Y="IMMEDIATE_AND_CHARGE_FULL_PRICE",$={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},X=5,ee=6,te="#1843EF",ne=0,re={"-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"}(p||(p={})),function(e){e[e.APP_INITIALIZING=95]="APP_INITIALIZING",e[e.APP_READY=96]="APP_READY"}(f||(f={}));var ie,oe,ae,se,ue,ce,le,de,pe,fe,he,me,ve,ye,ge,_e,we,be,Te,Ee,Pe,Se,Ie,Ae="checkoutKitWidget-ifCKW",Oe="https://h5.zalo.me",ke={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"},Ce=["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 xe(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function De(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)||xe(e)||De(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(u)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(c)),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]}}))}))},e.NetworkType=void 0,(ie=e.NetworkType||(e.NetworkType={})).none="none",ie.wifi="wifi",ie.cellular="cellular",ie.unknown="unknown",e.PlatformType=void 0,(oe=e.PlatformType||(e.PlatformType={})).wp="wp",oe.android="android",oe.iOS="iOS",oe.unknown="unknown",e.Events=void 0,(ae=e.Events||(e.Events={})).AppPaused="h5.event.paused",ae.AppResumed="h5.event.resumed",ae.NetworkChanged="h5.event.connection.changed",ae.OnDataCallback="h5.event.webview.result",ae.WebviewClosed="h5.event.webview.close",ae.OpenApp="h5.event.open.mp",ae.AppClose="h5.event.action.close",ae.PaymentCallback="payment.callback",ae.PaymentResult="action.payment.result",ae.PaymentDone="action.payment.done",ae.PaymentClose="action.payment.close",ae.DownloadProgress="h5.event.webview.download.progress",e.JumpStatus=void 0,(se=e.JumpStatus||(e.JumpStatus={})).DOING="doing",se.DONE="done",e.ProfileType=void 0,(ue=e.ProfileType||(e.ProfileType={}))[ue.user=1]="user",ue[ue.oa=0]="oa",ue[ue.aliasOA=2]="aliasOA",e.ChatType=void 0,(ce=e.ChatType||(e.ChatType={}))[ce.user=1]="user",ce[ce.oa=0]="oa",e.PostFeedType=void 0,(le=e.PostFeedType||(e.PostFeedType={}))[le.image=1]="image",le[le.multi_image=2]="multi_image",le[le.link=4]="link",le[le.profile=5]="profile",e.ScanNFCType=void 0,(de=e.ScanNFCType||(e.ScanNFCType={}))[de.cccd=1]="cccd",e.ShareSheetType=void 0,(pe=e.ShareSheetType||(e.ShareSheetType={}))[pe.image=1]="image",pe[pe.gif=11]="gif",pe[pe.video=12]="video",pe[pe.link=4]="link",pe[pe.oa=5]="oa",pe[pe.zmp=20]="zmp",pe[pe.multi_image=21]="multi_image",pe[pe.zmp_deep_link=4]="zmp_deep_link",pe[pe.text=22]="text",e.OrientationType=void 0,(fe=e.OrientationType||(e.OrientationType={}))[fe.auto=1]="auto",fe[fe.portrait=2]="portrait",fe[fe.landscape=3]="landscape",e.VibrateType=void 0,(he=e.VibrateType||(e.VibrateType={}))[he.oneShot=0]="oneShot",e.MediaPickerType=void 0,(me=e.MediaPickerType||(e.MediaPickerType={}))[me.zcamera=3]="zcamera",me[me.zcamera_photo=1]="zcamera_photo",me[me.zcamera_video=2]="zcamera_video",me[me.zcamera_scan=7]="zcamera_scan",me[me.photo=4]="photo",me[me.video=5]="video",me[me.file=6]="file",e.IAPPayType=void 0,(ve=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",ve.ONETIME="ONETIME",e.ProrationMode=void 0,(ye=e.ProrationMode||(e.ProrationMode={}))[ye.UNKNOW=0]="UNKNOW",ye[ye.DEFERRED=1]="DEFERRED",ye[ye.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(ge=e.StatusBarType||(e.StatusBarType={}))[ge.normal=1]="normal",ge[ge.hidden=0]="hidden",ge[ge.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(_e=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[_e.show=1]="show",_e[_e.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(we=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[we.show=1]="show",we[we.hide=0]="hide",e.TextAlignType=void 0,(be=e.TextAlignType||(e.TextAlignType={}))[be.left=0]="left",be[be.center=1]="center",e.OpenProfilePickerType=void 0,(e.OpenProfilePickerType||(e.OpenProfilePickerType={})).TOOL_DEL_FRIEND="tool_del_friend",e.CameraEvents=void 0,(Te=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",Te.OnStartCallback="h5.event.camera.start",Te.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(Ee=e.FacingMode||(e.FacingMode={})).FRONT="user",Ee.BACK="environment",e.PhotoFormat=void 0,(Pe=e.PhotoFormat||(e.PhotoFormat={})).WEBP="image/webp",Pe.PNG="image/png",Pe.JPEG="image/jpeg",e.PhotoQuality=void 0,(Se=e.PhotoQuality||(e.PhotoQuality={})).HIGH="high",Se.NORMAL="normal",Se.LOW="low",e.StreamType=void 0,(Ie=e.StreamType||(e.StreamType={})).VIDEO="video",Ie.AUDIO="audio";var ze,We=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.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,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),He({stage:n.NOT_FOUND,type:"error",name:e,request:t,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)||xe(e)||De(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,yt=lt;var gt=Ye.performance||{},_t=gt.now||gt.mozNow||gt.msNow||gt.oNow||gt.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:yt,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(gt),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 St(e){return e&&e.constructor===Symbol?"symbol":typeof e}function It(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(D(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)&&!D(r)&&!L(r))throw new TypeError;return L(r)&&(r=void 0),S(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;N(e,t,n,r)}return n}function v(e,t,n,r){if(!j(n))throw new TypeError;return D(r)||(r=F(r)),N(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)),C(e,t,n)}function b(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function T(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 P(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!D(r)&&!L(r)){if(!H(r))throw new TypeError;t=r}}return t}function S(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!D(o)&&!L(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!L(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 C(e,t,n);var r=X(t);return L(r)?void 0:k(e,r,n)}function C(e,t,n){var r=I(t,n,!1);if(!D(r))return r.get(e)}function N(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=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 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 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(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(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(x(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",y),e("hasOwnMetadata",g),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]",kt="[object Undefined]";function Ct(e){return null==e?void 0===e?kt: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]"==Ct(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return Nt(e)&&"[object RegExp]"==Ct(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 xt(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 Dt(e){return Dt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Dt(e)}function Lt(e){return Dt(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"!==St(t)&&"function"!=typeof t?zt(e):t}(this,n)}}var Ft=function(e,t){return e(t={exports:{}},t.exports),t.exports
10
+ !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",CONVERT_USER_IDS:"https://h5.zalo.me/openapi/convert-user-ids",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=0,m=-2e3,v=-1400,y=-1500,g=-1401,_=-1404,w=-1408,b=-1409,T=-2004,E=-2005,P=-2006,S=-2007,I=-700,A=-2106,O="Success",k="Unknown error. Please try again later.",C="Request limit exceeded. Please try again later.",N="Request timeout. Please try again later.",M="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",R="Login failed",x="This API is not supported in this version of Zalo",D="User Authentication Required. Please grant User Authentication permission before requesting User Permission",L="Unable to pick media",U="Unable to save image",j="Unable to save video",B="Unable to save file",Z="Download failed. Please check your URL again.",z="Unable to add voucher",W={SUCCESS:{code:h,message:O},UNKNOWN_ERROR:{code:m,message:k},UNAUTHORIZED:{code:g,message:M},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:_,message:x},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:w,message:N},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"},VOUCHER_CREATE_FAILED:{code:A,message:z}},F={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:{},addVoucher:{limit:5}},V={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:W.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:W.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:W.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:W.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:W.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:W.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:W.USER_DENIED}},iOS:{"-2":{mapTo:W.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:W.USER_DENIED},"-400":{mapTo:W.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:W.USER_DENIED},"-400":{mapTo:W.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:W.UNKNOWN_ERROR},"-10":{mapTo:W.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:P,message:j},needMoreDetail:!0},"-102":{mapTo:{code:P,message:j},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:P,message:j},needMoreDetail:!0}}}},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:E,message:U},needMoreDetail:!0},"-102":{mapTo:{code:E,message:U},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:E,message:U},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:W.MPDS_ACTION_INVALID},"-101":{mapTo:W.UNKNOWN_ERROR},"-105":{mapTo:W.MPDS_SOURCE_INVALID},"-106":{mapTo:W.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:W.MPDS_ACTION_INVALID},"-101":{mapTo:W.MPDS_APPID_INVALID},"-102":{mapTo:W.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:W.MPDS_ACTION_INVALID},"-101":{mapTo:W.UNKNOWN_ERROR},"-105":{mapTo:W.MPDS_SOURCE_INVALID},"-106":{mapTo:W.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:W.MPDS_ACTION_INVALID},"-101":{mapTo:W.MPDS_APPID_INVALID},"-102":{mapTo:W.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:W.USER_DENIED},"-101":{mapTo:W.USER_DENIED},"-400":{mapTo:W.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:W.USER_DENIED},"-10":{mapTo:W.USER_DENIED},"-400":{mapTo:W.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:W.USER_CANCEL}},iOS:{"-101":{mapTo:W.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:W.USER_CANCEL},999:{mapTo:{code:T,message:L},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:T,message:L}},"-101":{mapTo:W.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:W.USER_DENIED},"-400":{mapTo:W.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:W.USER_DENIED},"-400":{mapTo:W.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:W.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:W.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:W.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:W.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:W.UNKNOWN_ERROR},"-600":{mapTo:W.DEVICE_NOT_SUPPORT},"-602":{mapTo:W.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:W.UNKNOWN_ERROR},"-600":{mapTo:W.DEVICE_NOT_SUPPORT},"-601":{mapTo:W.SCAN_TIMEOUT},"-602":{mapTo:W.SERVICE_NOT_READY},"-603":{mapTo:W.UNREADABLE},"-604":{mapTo:W.INVALID_MRZ},"-605":{mapTo:W.PROCESSING},"-606":{mapTo:W.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:S,message:B},needMoreDetail:!0},"-102":{mapTo:{code:S,message:B},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:S,message:B},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:Z}},"-700":{mapTo:{code:I,message:Z}},"-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}},G={android:{"-4":W.DECODE_FAILED,"-5":W.CLIENT_NOT_SUPPORT,"-14":W.TIME_OUT},iOS:{"-9":W.DECODE_FAILED,"-5":W.CLIENT_NOT_SUPPORT,"-14":W.TIME_OUT}},H={android:12100615,iOS:460,wp:0,unknown:0},K=5*r,J="https://payment-mini.zalo.me/api/order/create-v2",q="https://payment-mini.zalo.me/api/order/iap-create",Q="https://payment-mini.zalo.me/api/transaction",Y="https://payment-mini.zalo.me/api/order/purchase",$="https://h5.zalo.me/apis/qr-wallet/deeplink",X="DEFERRED",ee="IMMEDIATE_AND_CHARGE_FULL_PRICE",te={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},ne=5,re=6,ie="#1843EF",oe=0,ae={"-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"}(p||(p={})),function(e){e[e.APP_INITIALIZING=95]="APP_INITIALIZING",e[e.APP_READY=96]="APP_READY"}(f||(f={}));var se,ue,ce,le,de,pe,fe,he,me,ve,ye,ge,_e,we,be,Te,Ee,Pe,Se,Ie,Ae,Oe,ke,Ce="checkoutKitWidget-ifCKW",Ne="https://h5.zalo.me",Me={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"},Re=["close","pay"];function xe(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 De(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){xe(o,r,i,a,s,"next",e)}function s(e){xe(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Le(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 Ue(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function je(e,t){if(e){if("string"==typeof e)return Le(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)?Le(e,t):void 0}}function Be(e){return function(e){if(Array.isArray(e))return Le(e)}(e)||Ue(e)||je(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 Ze(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 ze(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 We(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{return e.apply(void 0,Be(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Fe(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")}}We.async=function(e){return De((function(){var t,n,r,i,o=arguments;return Ze(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,Be(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,(se=e.NetworkType||(e.NetworkType={})).none="none",se.wifi="wifi",se.cellular="cellular",se.unknown="unknown",e.PlatformType=void 0,(ue=e.PlatformType||(e.PlatformType={})).wp="wp",ue.android="android",ue.iOS="iOS",ue.unknown="unknown",e.Events=void 0,(ce=e.Events||(e.Events={})).AppPaused="h5.event.paused",ce.AppResumed="h5.event.resumed",ce.NetworkChanged="h5.event.connection.changed",ce.OnDataCallback="h5.event.webview.result",ce.WebviewClosed="h5.event.webview.close",ce.OpenApp="h5.event.open.mp",ce.AppClose="h5.event.action.close",ce.PaymentCallback="payment.callback",ce.PaymentResult="action.payment.result",ce.PaymentDone="action.payment.done",ce.PaymentClose="action.payment.close",ce.DownloadProgress="h5.event.webview.download.progress",e.JumpStatus=void 0,(le=e.JumpStatus||(e.JumpStatus={})).DOING="doing",le.DONE="done",e.ProfileType=void 0,(de=e.ProfileType||(e.ProfileType={}))[de.user=1]="user",de[de.oa=0]="oa",de[de.aliasOA=2]="aliasOA",e.ChatType=void 0,(pe=e.ChatType||(e.ChatType={}))[pe.user=1]="user",pe[pe.oa=0]="oa",e.PostFeedType=void 0,(fe=e.PostFeedType||(e.PostFeedType={}))[fe.image=1]="image",fe[fe.multi_image=2]="multi_image",fe[fe.link=4]="link",fe[fe.profile=5]="profile",e.ScanNFCType=void 0,(he=e.ScanNFCType||(e.ScanNFCType={}))[he.cccd=1]="cccd",e.ShareSheetType=void 0,(me=e.ShareSheetType||(e.ShareSheetType={}))[me.image=1]="image",me[me.gif=11]="gif",me[me.video=12]="video",me[me.link=4]="link",me[me.oa=5]="oa",me[me.zmp=20]="zmp",me[me.multi_image=21]="multi_image",me[me.zmp_deep_link=4]="zmp_deep_link",me[me.text=22]="text",e.OrientationType=void 0,(ve=e.OrientationType||(e.OrientationType={}))[ve.auto=1]="auto",ve[ve.portrait=2]="portrait",ve[ve.landscape=3]="landscape",e.VibrateType=void 0,(ye=e.VibrateType||(e.VibrateType={}))[ye.oneShot=0]="oneShot",e.MediaPickerType=void 0,(ge=e.MediaPickerType||(e.MediaPickerType={}))[ge.zcamera=3]="zcamera",ge[ge.zcamera_photo=1]="zcamera_photo",ge[ge.zcamera_video=2]="zcamera_video",ge[ge.zcamera_scan=7]="zcamera_scan",ge[ge.photo=4]="photo",ge[ge.video=5]="video",ge[ge.file=6]="file",e.IAPPayType=void 0,(_e=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",_e.ONETIME="ONETIME",e.ProrationMode=void 0,(we=e.ProrationMode||(e.ProrationMode={}))[we.UNKNOW=0]="UNKNOW",we[we.DEFERRED=1]="DEFERRED",we[we.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(be=e.StatusBarType||(e.StatusBarType={}))[be.normal=1]="normal",be[be.hidden=0]="hidden",be[be.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(Te=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[Te.show=1]="show",Te[Te.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(Ee=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[Ee.show=1]="show",Ee[Ee.hide=0]="hide",e.TextAlignType=void 0,(Pe=e.TextAlignType||(e.TextAlignType={}))[Pe.left=0]="left",Pe[Pe.center=1]="center",e.OpenProfilePickerType=void 0,(e.OpenProfilePickerType||(e.OpenProfilePickerType={})).TOOL_DEL_FRIEND="tool_del_friend",e.CameraEvents=void 0,(Se=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",Se.OnStartCallback="h5.event.camera.start",Se.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(Ie=e.FacingMode||(e.FacingMode={})).FRONT="user",Ie.BACK="environment",e.PhotoFormat=void 0,(Ae=e.PhotoFormat||(e.PhotoFormat={})).WEBP="image/webp",Ae.PNG="image/png",Ae.JPEG="image/jpeg",e.PhotoQuality=void 0,(Oe=e.PhotoQuality||(e.PhotoQuality={})).HIGH="high",Oe.NORMAL="normal",Oe.LOW="low",e.StreamType=void 0,(ke=e.StreamType||(e.StreamType={})).VIDEO="video",ke.AUDIO="audio";var Ve,Ge=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function He(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Ke(){var e=function(){var e=We((function(){return window.navigator.userAgent.toLowerCase()}))();if(e){var t=function(e){return{isAndroid:/android/i.test(e)&&!/iemobile/.test(e),isIOS:/iphone|ios|ipad|ipod/.test(e)&&!/iemobile/.test(e),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(e),isZalo:/zalo/.test(e)}}(e);return{appEnv:Fe(),platform:t,platformName:Ge(t),zaloVersion:He(e).trim()}}}();if(e)return e}var Je=(null===(Ve=Ke())||void 0===Ve?void 0:Ve.appEnv)||{};function qe(e){qe.on&&qe.engine(e)}qe.on=!1,qe.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 Qe=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),qe({stage:n.NOT_FOUND,type:"error",name:e,request:t,state:"fail",response:i})};function Ye(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $e(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){Ye(e,t,n[t])}))}return e}function Xe(e,t){return function(e){if(Array.isArray(e))return e}(e)||Ue(e)||je(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 et="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function tt(){throw new Error("setTimeout has not been defined")}function nt(){throw new Error("clearTimeout has not been defined")}var rt=tt,it=nt;function ot(e){if(rt===setTimeout)return setTimeout(e,0);if((rt===tt||!rt)&&setTimeout)return rt=setTimeout,setTimeout(e,0);try{return rt(e,0)}catch(t){try{return rt.call(null,e,0)}catch(t){return rt.call(this,e,0)}}}"function"==typeof et.setTimeout&&(rt=setTimeout),"function"==typeof et.clearTimeout&&(it=clearTimeout);var at,st=[],ut=!1,ct=-1;function lt(){ut&&at&&(ut=!1,at.length?st=at.concat(st):ct=-1,st.length&&dt())}function dt(){if(!ut){var e=ot(lt);ut=!0;for(var t=st.length;t;){for(at=st,st=[];++ct<t;)at&&at[ct].run();ct=-1,t=st.length}at=null,ut=!1,function(e){if(it===clearTimeout)return clearTimeout(e);if((it===nt||!it)&&clearTimeout)return it=clearTimeout,clearTimeout(e);try{it(e)}catch(t){try{return it.call(null,e)}catch(t){return it.call(this,e)}}}(e)}}function pt(e,t){this.fun=e,this.array=t}pt.prototype.run=function(){this.fun.apply(null,this.array)};function ft(){}var ht=ft,mt=ft,vt=ft,yt=ft,gt=ft,_t=ft,wt=ft;var bt=et.performance||{},Tt=bt.now||bt.mozNow||bt.msNow||bt.oNow||bt.webkitNow||function(){return(new Date).getTime()};var Et=new Date;var Pt,St={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];st.push(new pt(e,t)),1!==st.length||ut||ot(dt)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:ht,addListener:mt,once:vt,off:yt,removeListener:gt,removeAllListeners:_t,emit:wt,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*Tt.call(bt),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Et)/1e3}},It=St,At="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ot(e){return e&&e.constructor===Symbol?"symbol":typeof e}function kt(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 At?At:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),r=i(e);function i(e,t){return function(n,r){"function"!=typeof e[n]&&Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0===n.Reflect?n.Reflect=e:r=i(n.Reflect,r),function(e){var t=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return re(Object.create(null))}:a?function(){return re({__proto__:null})}:function(){return re({})},has:s?function(e,n){return t.call(e,n)}:function(e,t){return t in e},get:s?function(e,n){return t.call(e,n)?e[n]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),l="object"==typeof It&&It.env&&"true"===It.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?te():Set,f=new(l||"function"!=typeof WeakMap?ne():WeakMap);function h(e,t,n,r){if(D(n)){if(!V(e))throw new TypeError;if(!H(t))throw new TypeError;return P(e,t)}if(!V(e))throw new TypeError;if(!j(t))throw new TypeError;if(!j(r)&&!D(r)&&!L(r))throw new TypeError;return L(r)&&(r=void 0),S(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;N(e,t,n,r)}return n}function v(e,t,n,r){if(!j(n))throw new TypeError;return D(r)||(r=F(r)),N(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)),C(e,t,n)}function b(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function T(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 P(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!D(r)&&!L(r)){if(!H(r))throw new TypeError;t=r}}return t}function S(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!D(o)&&!L(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!L(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 C(e,t,n);var r=X(t);return L(r)?void 0:k(e,r,n)}function C(e,t,n){var r=I(t,n,!1);if(!D(r))return r.get(e)}function N(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=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 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 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(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 U(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 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",y),e("hasOwnMetadata",g),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",T),e("deleteMetadata",E)}(r)}()}(Pt||(Pt={}));var Ct=Object.prototype.toString;var Nt="[object Null]",Mt="[object Undefined]";function Rt(e){return null==e?void 0===e?Mt:Nt:function(e){return Ct.call(e)}(e)}function xt(e){return null!=e&&"object"==typeof e}var Dt={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||xt(e)&&"[object Number]"==Rt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return xt(e)&&"[object RegExp]"==Rt(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 Lt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ut(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 jt(e){return jt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},jt(e)}function Bt(e){return jt(e)}function Zt(e,t,n){return Zt="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=Bt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},Zt(e,t,n)}function zt(e,t,n){return Zt(e,t,n)}function Wt(e,t){return Wt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Wt(e,t)}function Ft(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Wt(e,t)}function Vt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gt(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=Bt(e);if(t){var i=Bt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==Ot(t)&&"function"!=typeof t?Vt(e):t}(this,n)}}var Ht=function(e,t){return e(t={exports:{}},t.exports),t.exports
11
11
  /*! *****************************************************************************
12
12
  Copyright (C) Microsoft. All rights reserved.
13
13
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -21,4 +21,4 @@
21
21
 
22
22
  See the Apache Version 2.0 License for specific language governing permissions
23
23
  and limitations under the License.
24
- ***************************************************************************** */}((function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],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})),Gt={enablePaymentDone:!1};function Vt(e){var t=e.data;return{orderId:t.zmpOrderId||t.orderId,transId:t.appTransID||t.apptransid||t.transId}}var Ht="ACTION_CALLBACK";function Kt(t,n,r,i){switch(!0){case"string"==typeof r||null===r:return[{eventName:t,eventId:n,data:r}];case t===e.Events.OpenApp&&(null==i?void 0:i.enablePaymentDone):var o=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}(r.path);return[{eventName:e.Events.PaymentDone,eventId:n,data:o}];case t===e.Events.OnDataCallback:if(["PAY_BY_BANK","PAY_BY_CUSTOM_METHOD"].includes(null==r?void 0:r.eventType))return[{eventName:e.Events.OnDataCallback,eventId:n,data:r},{eventName:e.Events.PaymentDone,eventId:n,data:Vt(r)}];break;default:return[{eventName:t,eventId:n,data:r}]}}var Jt=function(t){Zt(r,t);var n=Wt(r);function r(){var e;return Rt(this,r),(e=n.apply(this,arguments)).debug=It("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===Ht||t===e.Events.PaymentCallback)return jt(Lt(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return jt(Lt(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===Ht)return jt(Lt(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return jt(Lt(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}(Ft);function qt(e){Jt.getInstance().emit(Ht,e)}function Qt(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){qt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=It("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=Cn(r);i("stringToData",a);var s=function(t,n){if(!n||"string"==typeof n)return 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),u=Kt(n,t,s,Gt);null==u||u.forEach((function(e){Jt.getInstance().emit(e.eventName,e.eventId,e.data);var t=document.getElementById(Ae);t&&zn(t,"appEvent",{eventName:e.eventName,eventId:e.eventId,data:e.data})}))}},window.zaloNative2JS={nativeCall:function(t,n,r){Jt.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Yt={encode:Qt,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:Qt(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":St(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":St(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},$t={},Xt=function(e,t,n){var r=t||"default";return function(){return(r in $t?$t[r](e,n):e).apply(this,arguments)}};Xt.setWrapper=function(e){$t[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var en={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function tn(e){try{return null===e?en:JSON.parse(e)}catch(e){return en}}var nn,rn={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Yt.encode(n);"post"!=t&&(e=Yt.appendToUrl(e,i),i="");var o=function(e,t){if(!self.XMLHttpRequest)return null;var n=new XMLHttpRequest,r=function(){};if(!("withCredentials"in n))return null;n.open(e,t,!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded");var i={send:function(e){n.send(e)}},o=Xt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Xt((function(){a=r,"onerror"in i&&i.onerror(n)}),"entry","XMLHttpRequest:error");return n.onload=function(){o()},n.onerror=function(){a()},n.onreadystatechange=function(){4==n.readyState&&(200==n.status?o():a())},i}(t,e);return!!o&&(o.onload=function(e){r(tn(e.responseText))},o.onerror=function(e){e.responseText?r(tn(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},on=rn,an=(nn=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=Yt.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,appId:e,zaloAppId:a.data.zaloAppId}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return nn.apply(this,arguments)});function sn(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));on.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var un=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},cn=function(){var e;return"android"===((null===(e=Ge())||void 0===e?void 0:e.platformName)||"").toLowerCase()},ln=function(){var e;return"ios"===((null===(e=Ge())||void 0===e?void 0:e.platformName)||"").toLowerCase()};function dn(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 pn=function(){var e,t=0;if(window.zaloVersionCode)return dn(window.zaloVersionCode);var n=Number((null===(e=Ge())||void 0===e?void 0:e.zaloVersion)||"0");return n>=24112e3?t=n:cn()?t=n%1e4:ln()&&(t=n),dn(t)};function fn(e,t){if(window.isAPISupport&&"function"==typeof window.isAPISupport)return window.isAPISupport(e,t);var n=pn();return cn()?n>=e:!!ln()&&n>=t}function hn(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var mn,vn=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}(),yn=function(e,t){return hn(e,vn)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return hn(e,Error)?new vn(m,e.message,t).toJSON():Mt.isEmpty(null==e?void 0:e.message)||Mt.isEmpty(null==e?void 0:e.code)?new vn(m,O,t,e).toJSON():new vn(e.code,e.message,t,e.detail).toJSON()}(e,t)},gn=(mn=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(d.GET_AUTH_SETTING,qe({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return mn.apply(this,arguments)}),_n=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,In.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=In.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new vn(g,N,"getSetting")),[4,gn(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new vn(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)}}())]}))})),wn=function(){var t,n,r,i=Ge(),o={},a=Jt.getInstance(),s=[],u=!1;return u||(n=function(t){var n=t.serialId,r=Nn(t.result),i=Dn(null==r?void 0:r.action),u=Mt.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=Mt.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?Mt.isFunction(r)&&r(e):Mt.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),b="".concat(w.protocol,"//").concat(w.host).concat(w.pathname);_.data={url:b}}if("action.follow.oa"===p.action||"action.unfollow.oa"===p.action){var T=null==y?void 0:y.uid;_.data={uid:T}}if("action.open.chat"===p.action){var E=null==y?void 0:y.uId,P=null==y?void 0:y.type;_.data={uid:E,openChatType:P}}(null==y?void 0:y.onProgress)&&g&&a.off(e.Events.DownloadProgress,g)}catch(e){}s.push(_)}},Jt.getInstance().on(Ht,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],sn(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],sn(e)}}),5e3),u=!0),r=Me((function(t,n,r,s){var u,c,l,d,p,f,h,m,v,y,b,T,E,P,S,I,A,O,k,N,M,D,L;return Ue(this,(function(U){switch(U.label){case 0:return c=Math.floor(1e6*Math.random()),l="".concat(t,"_").concat(c),d=Bn(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=Ln(d),n&&r&&(o[l]={options:n,callback:r,isMultiCallback:p},f&&h&&(o[l].timeout=setTimeout((function(){return qt({serialId:l,result:{error_code:w,error_message:C,data:{timeout:f},action:t}}),null}),!0===f?8e3:1e3*f))),y?[4,_n()]:[3,2];case 1:if(!1===(null==(T=U.sent())||null===(b=T.authSetting)||void 0===b?void 0:b["scope.userInfo"]))return qt({serialId:l,result:{error_code:g,error_message:x,data:{isMobile:null==i||null===(E=i.platform)||void 0===E?void 0:E.isMobile},action:t}}),[2];U.label=2;case 2:return P=Dn(d),!(null==i||null===(u=i.platform)||void 0===u?void 0:u.isMobile)||!t||Mt.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!kn(t)||P&&!1===P.isSupported?(qt({serialId:l,result:{error_code:_,error_message:R,data:{isMobile:null==i||null===(S=i.platform)||void 0===S?void 0:S.isMobile},action:t}}),[2]):(I=On(n),m?[3,4]:[4,In.getJSAccessToken()]);case 3:return O=U.sent(),[3,5];case 4:O="",U.label=5;case 5:A=O,U.label=6;case 6:return U.trys.push([6,10,,11]),m||!v?[3,8]:[4,In.getAccessToken()];case 7:return N=U.sent(),[3,9];case 8:N="",U.label=9;case 9:return k=N,[3,11];case 10:return M=U.sent(),qt({serialId:l,result:{error_code:null==M?void 0:M.code,error_message:null==M?void 0:M.message,action:t}}),[2];case 11:try{n&&(null==n?void 0:n.onProgress)&&(D=function(e){!function(e,t){e.url;var n=e.progress;t&&t(n)}(e,null==n?void 0:n.onProgress)},o[l].downloadListener=D,a.on(e.Events.DownloadProgress,D))}catch(e){}return L=i.platform.isIOS?window.onNativeMessage(l,d):'window.onNativeMessage("'.concat(l,'", "').concat(d,'")'),[2,ZaloJavaScriptInterface.jsCall(A,d,k,I,L)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),bn={success:function(e,t){return{code:h,message:t||A,data:e||{}}},error:{failLimit:function(){return new vn(b,k)},badRequest:function(e){return new vn(v,e)},loginFailed:function(e){return new vn(g,"".concat(M,": ").concat(e))},loginRequired:function(){return new vn(g,N)},cannotGetShareInfo:function(){return new vn(y,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(re).find((function(t){return t===e.toString()}));return new vn(e,t||O)},clientNotSupport:function(){return new vn(_,R)}}},Tn=function(t){var n,r,i,o=null===(n=Ge())||void 0===n?void 0:n.platformName,a=jn(t.action),s=W[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new vn(m,"Can not get auth code: ".concat(t.error_message));if(In.jumpStatus!==e.JumpStatus.DONE&&!u)return new vn(Z.UNAUTHORIZED.code,Z.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new vn(Z.FORBIDDEN.code,Z.FORBIDDEN.message);if(o&&(null===(r=F[o])||void 0===r?void 0:r[t.error_code]))return new vn(F[o][t.error_code].code,F[o][t.error_code].message);var l=null==c||null===(i=c[o])||void 0===i?void 0:i[String(t.error_code)];if(l){var d,p,f,h=null===(d=l.mapTo)||void 0===d?void 0:d.message;if(null==l?void 0:l.needMoreDetail)h="".concat(null==l||null===(f=l.mapTo)||void 0===f?void 0:f.message,": ").concat(t.error_message);return new vn(null===(p=l.mapTo)||void 0===p?void 0:p.code,h)}return new vn(t.error_code,t.error_message)},En=function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=Mt.isEmpty(t)?void 0:t[r];if(o)return He({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Tn(i):null==i?void 0:i.data)}}return Mt.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=W[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){wn(e,t,o,qe({},i,a))}),s)},Pn=function(){var e=Me((function(e){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){Mt.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Sn=function(){function t(){Rt(this,t),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={},this.retryLimitMap={}}var r,a,u,c=t.prototype;return c.initRetryLimit=function(e){var t=z[e],n={lastCall:(new Date).getTime(),limit:t&&t.limit?t.limit:3,retry:0};return this.retryLimitMap[e]=n,n},c.resetRetryLimit=function(e){this.retryLimitMap[e].lastCall=(new Date).getTime(),this.retryLimitMap[e].retry=0},c.getRetryLimit=function(e){var t=this.retryLimitMap[e];return t&&t.lastCall&&t.retry||(t=this.initRetryLimit(e)),t},c.increaseRetryLimit=function(e){this.retryLimitMap[e].retry++},c.jump=function(){var t=this;return Me((function(){return Ue(this,(function(r){return[2,new Promise((function(r,i){t._jumpStatus?t._jumpStatus===e.JumpStatus.DONE?r(e.JumpStatus.DONE):r(e.JumpStatus.DOING):(t._jumpStatus=e.JumpStatus.DOING,He({stage:n.REQUEST,type:"log",name:"jump"}),wn("JUMP_LOGIN",{},{success:function(n){var i=n.data;t._miniProgramConfig=(null==i?void 0:i.miniProgramConfig)||{};var o=(null==i?void 0:i.cookiesOAuthLogins)||[],a=o.find((function(e){return e.name===l.JS_TOKEN}));a&&(t._jsAccessToken=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),t._cookies=o;var s=t._cookies.find((function(e){return e.name===l.ZOAUTH}));(null==s?void 0:s.value)||sn([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){sn([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),i(e)}},{skipJump:!0}))}))]}))}))()},c.loginZaloV3=function(e,t,n){var r=this;return Me((function(){var i;return Ue(this,(function(o){switch(o.label){case 0:return i="".concat(d.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(s,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=Me((function(e){var t,n,i;return Ue(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return t=o.sent(),n=null==t?void 0:t.access_token,r._accessToken=n,i=1e3*parseInt(t.expires_in),r.accessTokenExpiresIn=i,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(r._accessToken||""),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,o.sent()]}}))}))()},c.loginZaloV4=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this;return Me((function(){var i,o;return Ue(this,(function(a){switch(a.label){case 0:return(i=new URLSearchParams).append("app_id",e),i.append("code",t),i.append("code_verifier",n),Mt.isNull(r.refreshToken)||0===r.refreshToken.length?i.append("grant_type","authorization_code"):(i.append("grant_type","refresh_token"),i.append("refresh_token",r.refreshToken||"")),o={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.GET_ACCESS_TOKEN,qe({method:"POST",body:i},o)).then(function(){var e=Me((function(e){var t,n,i,o;return Ue(this,(function(a){switch(a.label){case 0:return[4,e.json()];case 1:return t=a.sent(),n=(null==t?void 0:t.access_token)||"",i=(null==t?void 0:t.refresh_token)||"",r.refreshToken=i,r._accessToken=n,o=1e3*parseInt(null==t?void 0:t.expires_in),r.accessTokenExpiresIn=o,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,a.sent()]}}))}))()},c.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return Me((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(r.getAccessTokenCount<=1||r._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Ue(this,(function(m){switch(m.label){case 0:return n=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(r=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):e?[4,t.verifyUserAuthorized()]:[3,4];case 3:return s=m.sent(),[3,5];case 4:s=!0,m.label=5;case 5:return a=s,t._accessToken.length>0&&n<t.accessTokenExpiresIn&&a?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(l.ZOAUTH)]);case 6:return u=m.sent(),[4,t.jumpAndGetToken(l.ZOAUTH_VRF)];case 7:if(c=m.sent(),d="zmp.getaccesstoken.fail",!a)throw r.getAccessTokenCount--,sn([{action:d,error:-104,message:"no user auth",data:{}}]),bn.error.loginFailed("User Authentication Required");if(!u)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),c?[4,t.loginZaloV4(o,u,c)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(o,i,u)];case 11:p=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),p="",console.log("Can not get access token",f),sn([{action:d,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return r.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(sn([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(bn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw r.getAccessTokenCount--,sn([{action:d,error:-102,message:"no oauth",data:{}}]),bn.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return Me((function(){var t,n,r,i,o,a;return Ue(this,(function(s){switch(s.label){case 0:return n=!0,[4,e.jumpAndGetToken()];case 1:if(s.sent(),!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,7];s.label=2;case 2:return s.trys.push([2,6,,7]),(r=Dn("action.mp.user.authorize"))&&r.isSupported?[4,_n()]:[3,5];case 3:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,5]:[4,Pn()];case 4:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=5;case 5:return[3,7];case 6:return s.sent(),n=!1,[3,7];case 7:return[2,n]}}))}))()},c.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},c.getJSAccessToken=function(){var e=this;return Me((function(){var t;return Ue(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(l.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},c.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},c.jumpAndGetToken=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;return new Promise(function(){var i=Me((function(i){var o,a,s,u;return Ue(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?Mt.isString(t)?(o=r._cookies.find((function(e){return e.name===t})),[2,i(null==o?void 0:o.value)]):[2,i("")]:(n&&r._jumpStatus===e.JumpStatus.DONE&&(r._jumpStatus=void 0),a={name:t,cb:function(e){return i(e)}},[4,r.jump()]);case 1:return(s=c.sent())===e.JumpStatus.DONE?(r._jumpStatus=s,r.WAITING_QUEUE.length&&(r.WAITING_QUEUE.forEach((function(e){var t=r._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),r.WAITING_QUEUE=[]),u=r._cookies.find((function(e){return e.name===a.name})),a.cb(null==u?void 0:u.value)):r.WAITING_QUEUE.push(a),[2]}}))}));return function(e){return i.apply(this,arguments)}}())},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},r=t,(a=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&xt(r.prototype,a),u&&xt(r,u),t}(),In=Sn.getInstance(),An=It("zmp:utils:common"),On=function(e){if(Mt.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=[];for(var n=e.length,r=0;r<n;r++)t.push(On(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+On(e[i]));return"{"+t.join(",")+"}"}return e.toString()},kn=function(e){var t=W[e],n=pn(),r=t&&"object"==typeof t&&"versionLive"in t&&t.versionLive&&"iOS"in t.versionLive?t.versionLive.iOS:0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||n>=r},Cn=function(e){try{if(e){An(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}var n=JSON.parse(t);return An("formattedValue",t,n,void 0===n?"undefined":St(n)),n}return null}catch(t){return An("parse json error:",t),e}},Nn=function(e){if(Mt.isObject(JSON)&&JSON.parse&&Mt.isString(e)){var t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\x00/g,"");return JSON.parse(t,(function(e,t){return t}))}return Mt.isObject(e)?e:new Function("return "+e)()},Mn=function(e){for(var t=document.getElementsByTagName("meta"),n=0;n<t.length;n++)if(t[n].getAttribute("name")===e||t[n].getAttribute("property")===e)return t[n].getAttribute("content");return""},Rn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var xn=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},Dn=function(e){if(void 0!==e){var t=In.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},Ln=function(e){if(void 0===e)return!1;var t=In.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},Un=function(){var e=Me((function(){return Ue(this,(function(e){return[2,new Promise(function(){var e=Me((function(e,t){var n;return Ue(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,In.jumpAndGetToken()];case 1:return t.sent(),n=In.miniProgramConfig,e(!0===(null==n?void 0:n.canUseAccessTokenByDefault)),[3,3];case 2:return t.sent(),e(!1),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));return function(){return e.apply(this,arguments)}}(),jn=function(e){return"action.get.device_info"===e?"GET_DEVICE_INFO":e.replace("action.","").replace(/\./g,"_").toUpperCase()},Bn=function(e){return e.startsWith("action.")?e:"GET_DEVICE_INFO"===e?"action.get.device_info":"action.".concat(e.replace(/\_/g,".").toLowerCase())},Zn=function(e,t,n){"string"==typeof n&&n.length>0?e.set(t,n):"object"!=typeof n||Array.isArray(n)||Object.entries(n).forEach((function(n){var r=Qe(n,2),i=r[0],o=r[1];null!=o&&""!==o&&e.set("".concat(t).concat(i),String(o))}))},zn=function(e,t,n){var r;null===(r=e.contentWindow)||void 0===r||r.postMessage({type:t,payload:n},Oe)};function Wn(e,t,n,r){var i,o;!function(e,t){if(z[e]){var n=In.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&In.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw yn(bn.error.failLimit(),e);In.increaseRetryLimit(e)}}(e);var a=Array.isArray(n)&&n.length>0&&(null===(i=n[0])||void 0===i?void 0:i.success),s=Array.isArray(n)&&n.length>0&&(null===(o=n[0])||void 0===o?void 0:o.fail);try{var u=n;t.length>0&&t.forEach((function(t,r){var i=t.safeParse(n[r]);if(!i.success){var o,a=null===(o=i.error)||void 0===o?void 0:o.issues,s=a.map((function(e,t){var n=e.path.length>0?e.path.map((function(e,t){return t>0?"[".concat(e,"]"):e})).join(""):"arg";return"Error ".concat(t+1,": Code: ").concat(e.code," ~ Path: ").concat(n," ~ Message: ").concat(e.message)})).join(" | "),c=bn.error.badRequest(s);throw c.detail=a,yn(c,e)}u.push(i.data)}));var c=r.apply(void 0,Le(u));return Mt.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!Mt.isNull(a)&&Mt.isFunction(a))return a(e);t(c)})).catch((function(t){var r=yn(t,e);if(!Mt.isNull(s)&&Mt.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!Mt.isNull(s)&&Mt.isFunction(s))return s(t);throw yn(t,e)}}function Fn(e){return Gn.apply(this,arguments)}function Gn(){return(Gn=Me((function(e){return Ue(this,(function(t){return[2,Wn("login",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,In.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Ve.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ke("login",{}))]}}))})))]}))}))).apply(this,arguments)}function Vn(e){return Hn.apply(this,arguments)}function Hn(){return(Hn=Me((function(e){return Ue(this,(function(t){return[2,Wn("getAccessToken",[],[e],Me((function(){var e;return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Un()]:[3,3];case 1:return e=!t.sent(),[4,In.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Ve.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ke("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Kn,Jn="2.51.5";function qn(){return Wn("getVersion",[],[],(function(){return Jn}))}function Qn(){var e;return{version:Mn("version-id")||"",apiVersion:Jn,zaloVersion:String(pn()),platform:(null===(e=Ge())||void 0===e?void 0:e.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function Yn(){return Wn("getSystemInfo",[],[],(function(){return Qn()}))}!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(Kn||(Kn={}));const $n=Kn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xn=e=>{switch(typeof e){case"undefined":return $n.undefined;case"string":return $n.string;case"number":return isNaN(e)?$n.nan:$n.number;case"boolean":return $n.boolean;case"function":return $n.function;case"bigint":return $n.bigint;case"symbol":return $n.symbol;case"object":return Array.isArray(e)?$n.array:null===e?$n.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?$n.promise:"undefined"!=typeof Map&&e instanceof Map?$n.map:"undefined"!=typeof Set&&e instanceof Set?$n.set:"undefined"!=typeof Date&&e instanceof Date?$n.date:$n.object;default:return $n.unknown}},er=Kn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class tr extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){const n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Kn.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}tr.create=e=>new tr(e);const nr=(e,t)=>{let n;switch(e.code){case er.invalid_type:n=e.received===$n.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case er.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Kn.jsonStringifyReplacer)}`;break;case er.unrecognized_keys:n=`Unrecognized key(s) in object: ${Kn.joinValues(e.keys,", ")}`;break;case er.invalid_union:n="Invalid input";break;case er.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Kn.joinValues(e.options)}`;break;case er.invalid_enum_value:n=`Invalid enum value. Expected ${Kn.joinValues(e.options)}, received '${e.received}'`;break;case er.invalid_arguments:n="Invalid function arguments";break;case er.invalid_return_type:n="Invalid function return type";break;case er.invalid_date:n="Invalid date";break;case er.invalid_string:"object"==typeof e.validation?"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Kn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case er.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(e.minimum)}`:"Invalid input";break;case er.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(e.maximum)}`:"Invalid input";break;case er.custom:n="Invalid input";break;case er.invalid_intersection_types:n="Intersection results could not be merged";break;case er.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case er.not_finite:n="Number must be finite";break;default:n=t.defaultError,Kn.assertNever(e)}return{message:n}};let rr=nr;function ir(){return rr}const or=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const u=r.filter((e=>!!e)).slice().reverse();for(const e of u)s=e(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}};function ar(e,t){const n=or({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,ir(),nr].filter((e=>!!e))});e.common.issues.push(n)}class sr{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return ur;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t)n.push({key:await e.key,value:await e.value});return sr.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:i}=r;if("aborted"===t.status)return ur;if("aborted"===i.status)return ur;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),(void 0!==i.value||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}}const ur=Object.freeze({status:"aborted"}),cr=e=>({status:"dirty",value:e}),lr=e=>({status:"valid",value:e}),dr=e=>"aborted"===e.status,pr=e=>"dirty"===e.status,fr=e=>"valid"===e.status,hr=e=>"undefined"!=typeof Promise&&e instanceof Promise;var mr;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(mr||(mr={}));class vr{constructor(e,t,n,r){this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._path.concat(this._key)}}const yr=(e,t)=>{if(fr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,error:new tr(e.common.issues)}};function gr(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=n?n:t.defaultError},description:i}}class _r{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Xn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Xn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new sr,ctx:{common:e.parent.common,data:e.data,parsedType:Xn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(hr(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return yr(r,i)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(hr(r)?r:Promise.resolve(r));return yr(n,i)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const i=e(t),o=()=>r.addIssue({code:er.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(o(),!1))):!!i||(o(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new ri({schema:this,typeName:hi.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ii.create(this,this._def)}nullable(){return oi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ur.create(this,this._def)}promise(){return ni.create(this,this._def)}or(e){return zr.create([this,e],this._def)}and(e){return Vr.create(this,e,this._def)}transform(e){return new ri({...gr(this._def),schema:this,typeName:hi.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ai({...gr(this._def),innerType:this,defaultValue:t,typeName:hi.ZodDefault})}brand(){return new li({typeName:hi.ZodBranded,type:this,...gr(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new si({...gr(this._def),innerType:this,catchValue:t,typeName:hi.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return di.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const wr=/^c[^\s-]{8,}$/i,br=/^[a-z][a-z0-9]*$/,Tr=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,Er=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/;class Pr extends _r{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:er.invalid_string,...mr.errToObj(n)}),this.nonempty=e=>this.min(1,mr.errToObj(e)),this.trim=()=>new Pr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==$n.string){const t=this._getOrReturnCtx(e);return ar(t,{code:er.invalid_type,expected:$n.string,received:t.parsedType}),ur}const t=new sr;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),ar(n,{code:er.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),ar(n,{code:er.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,o=e.data.length<i.value;(r||o)&&(n=this._getOrReturnCtx(e,n),r?ar(n,{code:er.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&ar(n,{code:er.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)Er.test(e.data)||(n=this._getOrReturnCtx(e,n),ar(n,{validation:"email",code:er.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Tr.test(e.data)||(n=this._getOrReturnCtx(e,n),ar(n,{validation:"uuid",code:er.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)wr.test(e.data)||(n=this._getOrReturnCtx(e,n),ar(n,{validation:"cuid",code:er.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)br.test(e.data)||(n=this._getOrReturnCtx(e,n),ar(n,{validation:"cuid2",code:er.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),ar(n,{validation:"url",code:er.invalid_string,message:i.message}),t.dirty()}else if("regex"===i.kind){i.regex.lastIndex=0;i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),ar(n,{validation:"regex",code:er.invalid_string,message:i.message}),t.dirty())}else if("trim"===i.kind)e.data=e.data.trim();else if("startsWith"===i.kind)e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),ar(n,{code:er.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty());else if("endsWith"===i.kind)e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),ar(n,{code:er.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty());else if("datetime"===i.kind){((r=i).precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):0===r.precision?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(n=this._getOrReturnCtx(e,n),ar(n,{code:er.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else Kn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new Pr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...mr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...mr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...mr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...mr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...mr.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...mr.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...mr.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...mr.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...mr.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...mr.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...mr.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...mr.errToObj(t)})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Sr(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}Pr.create=e=>{var t;return new Pr({checks:[],typeName:hi.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...gr(e)})};class Ir extends _r{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==$n.number){const t=this._getOrReturnCtx(e);return ar(t,{code:er.invalid_type,expected:$n.number,received:t.parsedType}),ur}let t;const n=new sr;for(const r of this._def.checks)if("int"===r.kind)Kn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),ar(t,{code:er.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),ar(t,{code:er.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),ar(t,{code:er.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==Sr(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),ar(t,{code:er.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),ar(t,{code:er.not_finite,message:r.message}),n.dirty()):Kn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,mr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,mr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,mr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,mr.toString(t))}setLimit(e,t,n,r){return new Ir({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:mr.toString(r)}]})}_addCheck(e){return new Ir({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:mr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:mr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:mr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:mr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:mr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:mr.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:mr.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&Kn.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Ir.create=e=>new Ir({checks:[],typeName:hi.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...gr(e)});class Ar extends _r{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==$n.bigint){const t=this._getOrReturnCtx(e);return ar(t,{code:er.invalid_type,expected:$n.bigint,received:t.parsedType}),ur}return lr(e.data)}}Ar.create=e=>{var t;return new Ar({typeName:hi.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...gr(e)})};class Or extends _r{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==$n.boolean){const t=this._getOrReturnCtx(e);return ar(t,{code:er.invalid_type,expected:$n.boolean,received:t.parsedType}),ur}return lr(e.data)}}Or.create=e=>new Or({typeName:hi.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...gr(e)});class kr extends _r{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==$n.date){const t=this._getOrReturnCtx(e);return ar(t,{code:er.invalid_type,expected:$n.date,received:t.parsedType}),ur}if(isNaN(e.data.getTime())){return ar(this._getOrReturnCtx(e),{code:er.invalid_date}),ur}const t=new sr;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),ar(n,{code:er.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),ar(n,{code:er.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Kn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new kr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:mr.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:mr.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}kr.create=e=>new kr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:hi.ZodDate,...gr(e)});class Cr extends _r{_parse(e){if(this._getType(e)!==$n.symbol){const t=this._getOrReturnCtx(e);return ar(t,{code:er.invalid_type,expected:$n.symbol,received:t.parsedType}),ur}return lr(e.data)}}Cr.create=e=>new Cr({typeName:hi.ZodSymbol,...gr(e)});class Nr extends _r{_parse(e){if(this._getType(e)!==$n.undefined){const t=this._getOrReturnCtx(e);return ar(t,{code:er.invalid_type,expected:$n.undefined,received:t.parsedType}),ur}return lr(e.data)}}Nr.create=e=>new Nr({typeName:hi.ZodUndefined,...gr(e)});class Mr extends _r{_parse(e){if(this._getType(e)!==$n.null){const t=this._getOrReturnCtx(e);return ar(t,{code:er.invalid_type,expected:$n.null,received:t.parsedType}),ur}return lr(e.data)}}Mr.create=e=>new Mr({typeName:hi.ZodNull,...gr(e)});class Rr extends _r{constructor(){super(...arguments),this._any=!0}_parse(e){return lr(e.data)}}Rr.create=e=>new Rr({typeName:hi.ZodAny,...gr(e)});class xr extends _r{constructor(){super(...arguments),this._unknown=!0}_parse(e){return lr(e.data)}}xr.create=e=>new xr({typeName:hi.ZodUnknown,...gr(e)});class Dr extends _r{_parse(e){const t=this._getOrReturnCtx(e);return ar(t,{code:er.invalid_type,expected:$n.never,received:t.parsedType}),ur}}Dr.create=e=>new Dr({typeName:hi.ZodNever,...gr(e)});class Lr extends _r{_parse(e){if(this._getType(e)!==$n.undefined){const t=this._getOrReturnCtx(e);return ar(t,{code:er.invalid_type,expected:$n.void,received:t.parsedType}),ur}return lr(e.data)}}Lr.create=e=>new Lr({typeName:hi.ZodVoid,...gr(e)});class Ur extends _r{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==$n.array)return ar(t,{code:er.invalid_type,expected:$n.array,received:t.parsedType}),ur;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(ar(t,{code:e?er.too_big:er.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(ar(t,{code:er.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(ar(t,{code:er.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new vr(t,e,t.path,n))))).then((e=>sr.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new vr(t,e,t.path,n))));return sr.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Ur({...this._def,minLength:{value:e,message:mr.toString(t)}})}max(e,t){return new Ur({...this._def,maxLength:{value:e,message:mr.toString(t)}})}length(e,t){return new Ur({...this._def,exactLength:{value:e,message:mr.toString(t)}})}nonempty(e){return this.min(1,e)}}var jr;function Br(e){if(e instanceof Zr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ii.create(Br(r))}return new Zr({...e._def,shape:()=>t})}return e instanceof Ur?Ur.create(Br(e.element)):e instanceof ii?ii.create(Br(e.unwrap())):e instanceof oi?oi.create(Br(e.unwrap())):e instanceof Hr?Hr.create(e.items.map((e=>Br(e)))):e}Ur.create=(e,t)=>new Ur({type:e,minLength:null,maxLength:null,exactLength:null,typeName:hi.ZodArray,...gr(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(jr||(jr={}));class Zr extends _r{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Kn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==$n.object){const t=this._getOrReturnCtx(e);return ar(t,{code:er.invalid_type,expected:$n.object,received:t.parsedType}),ur}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Dr&&"strip"===this._def.unknownKeys))for(const e in n.data)i.includes(e)||o.push(e);const a=[];for(const e of i){const t=r[e],i=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new vr(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Dr){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)o.length>0&&(ar(n,{code:er.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const r=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new vr(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>sr.mergeObjectSync(t,e))):sr.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return mr.errToObj,new Zr({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,i,o,a;const s=null!==(o=null===(i=(r=this._def).errorMap)||void 0===i?void 0:i.call(r,t,n).message)&&void 0!==o?o:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=mr.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new Zr({...this._def,unknownKeys:"strip"})}passthrough(){return new Zr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Zr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Zr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>jr.mergeShapes(this._def.shape(),e._def.shape()),typeName:hi.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Zr({...this._def,catchall:e})}pick(e){const t={};return Kn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new Zr({...this._def,shape:()=>t})}omit(e){const t={};return Kn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new Zr({...this._def,shape:()=>t})}deepPartial(){return Br(this)}partial(e){const t={};return Kn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new Zr({...this._def,shape:()=>t})}required(e){const t={};return Kn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof ii;)e=e._def.innerType;t[n]=e}})),new Zr({...this._def,shape:()=>t})}keyof(){return Xr(Kn.objectKeys(this.shape))}}Zr.create=(e,t)=>new Zr({shape:()=>e,unknownKeys:"strip",catchall:Dr.create(),typeName:hi.ZodObject,...gr(t)}),Zr.strictCreate=(e,t)=>new Zr({shape:()=>e,unknownKeys:"strict",catchall:Dr.create(),typeName:hi.ZodObject,...gr(t)}),Zr.lazycreate=(e,t)=>new Zr({shape:e,unknownKeys:"strip",catchall:Dr.create(),typeName:hi.ZodObject,...gr(t)});class zr extends _r{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new tr(e.ctx.common.issues)));return ar(t,{code:er.invalid_union,unionErrors:n}),ur}));{let e;const r=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=r.map((e=>new tr(e)));return ar(t,{code:er.invalid_union,unionErrors:i}),ur}}get options(){return this._def.options}}zr.create=(e,t)=>new zr({options:e,typeName:hi.ZodUnion,...gr(t)});const Wr=e=>e instanceof Yr?Wr(e.schema):e instanceof ri?Wr(e.innerType()):e instanceof $r?[e.value]:e instanceof ei?e.options:e instanceof ti?Object.keys(e.enum):e instanceof ai?Wr(e._def.innerType):e instanceof Nr?[void 0]:e instanceof Mr?[null]:null;class Fr extends _r{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==$n.object)return ar(t,{code:er.invalid_type,expected:$n.object,received:t.parsedType}),ur;const n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(ar(t,{code:er.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ur)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=Wr(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new Fr({typeName:hi.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...gr(n)})}}function Gr(e,t){const n=Xn(e),r=Xn(t);if(e===t)return{valid:!0,data:e};if(n===$n.object&&r===$n.object){const n=Kn.objectKeys(t),r=Kn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=Gr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===$n.array&&r===$n.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Gr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===$n.date&&r===$n.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Vr extends _r{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(dr(e)||dr(r))return ur;const i=Gr(e.value,r.value);return i.valid?((pr(e)||pr(r))&&t.dirty(),{status:t.value,value:i.data}):(ar(n,{code:er.invalid_intersection_types}),ur)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Vr.create=(e,t,n)=>new Vr({left:e,right:t,typeName:hi.ZodIntersection,...gr(n)});class Hr extends _r{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==$n.array)return ar(n,{code:er.invalid_type,expected:$n.array,received:n.parsedType}),ur;if(n.data.length<this._def.items.length)return ar(n,{code:er.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ur;!this._def.rest&&n.data.length>this._def.items.length&&(ar(n,{code:er.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new vr(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>sr.mergeArray(t,e))):sr.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Hr({...this._def,rest:e})}}Hr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Hr({items:e,typeName:hi.ZodTuple,rest:null,...gr(t)})};class Kr extends _r{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==$n.object)return ar(n,{code:er.invalid_type,expected:$n.object,received:n.parsedType}),ur;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new vr(n,e,n.path,e)),value:o._parse(new vr(n,n.data[e],n.path,e))});return n.common.async?sr.mergeObjectAsync(t,r):sr.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Kr(t instanceof _r?{keyType:e,valueType:t,typeName:hi.ZodRecord,...gr(n)}:{keyType:Pr.create(),valueType:e,typeName:hi.ZodRecord,...gr(t)})}}class Jr extends _r{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==$n.map)return ar(n,{code:er.invalid_type,expected:$n.map,received:n.parsedType}),ur;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new vr(n,e,n.path,[o,"key"])),value:i._parse(new vr(n,t,n.path,[o,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of o){const r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return ur;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of o){const r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return ur;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Jr.create=(e,t,n)=>new Jr({valueType:t,keyType:e,typeName:hi.ZodMap,...gr(n)});class qr extends _r{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==$n.set)return ar(n,{code:er.invalid_type,expected:$n.set,received:n.parsedType}),ur;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(ar(n,{code:er.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(ar(n,{code:er.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const n=new Set;for(const r of e){if("aborted"===r.status)return ur;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map(((e,t)=>i._parse(new vr(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new qr({...this._def,minSize:{value:e,message:mr.toString(t)}})}max(e,t){return new qr({...this._def,maxSize:{value:e,message:mr.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}qr.create=(e,t)=>new qr({valueType:e,minSize:null,maxSize:null,typeName:hi.ZodSet,...gr(t)});class Qr extends _r{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==$n.function)return ar(t,{code:er.invalid_type,expected:$n.function,received:t.parsedType}),ur;function n(e,n){return or({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ir(),nr].filter((e=>!!e)),issueData:{code:er.invalid_arguments,argumentsError:n}})}function r(e,n){return or({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ir(),nr].filter((e=>!!e)),issueData:{code:er.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof ni?lr((async(...e)=>{const t=new tr([]),a=await this._def.args.parseAsync(e,i).catch((r=>{throw t.addIssue(n(e,r)),t})),s=await o(...a);return await this._def.returns._def.type.parseAsync(s,i).catch((e=>{throw t.addIssue(r(s,e)),t}))})):lr(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new tr([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new tr([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Qr({...this._def,args:Hr.create(e).rest(xr.create())})}returns(e){return new Qr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Qr({args:e||Hr.create([]).rest(xr.create()),returns:t||xr.create(),typeName:hi.ZodFunction,...gr(n)})}}class Yr extends _r{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Yr.create=(e,t)=>new Yr({getter:e,typeName:hi.ZodLazy,...gr(t)});class $r extends _r{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return ar(t,{received:t.data,code:er.invalid_literal,expected:this._def.value}),ur}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Xr(e,t){return new ei({values:e,typeName:hi.ZodEnum,...gr(t)})}$r.create=(e,t)=>new $r({value:e,typeName:hi.ZodLiteral,...gr(t)});class ei extends _r{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return ar(t,{expected:Kn.joinValues(n),received:t.parsedType,code:er.invalid_type}),ur}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return ar(t,{received:t.data,code:er.invalid_enum_value,options:n}),ur}return lr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return ei.create(e)}exclude(e){return ei.create(this.options.filter((t=>!e.includes(t))))}}ei.create=Xr;class ti extends _r{_parse(e){const t=Kn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==$n.string&&n.parsedType!==$n.number){const e=Kn.objectValues(t);return ar(n,{expected:Kn.joinValues(e),received:n.parsedType,code:er.invalid_type}),ur}if(-1===t.indexOf(e.data)){const e=Kn.objectValues(t);return ar(n,{received:n.data,code:er.invalid_enum_value,options:e}),ur}return lr(e.data)}get enum(){return this._def.values}}ti.create=(e,t)=>new ti({values:e,typeName:hi.ZodNativeEnum,...gr(t)});class ni extends _r{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==$n.promise&&!1===t.common.async)return ar(t,{code:er.invalid_type,expected:$n.promise,received:t.parsedType}),ur;const n=t.parsedType===$n.promise?t.data:Promise.resolve(t.data);return lr(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ni.create=(e,t)=>new ni({type:e,typeName:hi.ZodPromise,...gr(t)});class ri extends _r{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===hi.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null;if("preprocess"===r.type){const e=r.transform(n.data);return n.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n}))):this._def.schema._parseSync({data:e,path:n.path,parent:n})}const i={addIssue:e=>{ar(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"refinement"===r.type){const e=e=>{const t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?ur:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?ur:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!fr(e))return e;const o=r.transform(e.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>fr(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}Kn.assertNever(r)}}ri.create=(e,t,n)=>new ri({schema:e,typeName:hi.ZodEffects,effect:t,...gr(n)}),ri.createWithPreprocess=(e,t,n)=>new ri({schema:t,effect:{type:"preprocess",transform:e},typeName:hi.ZodEffects,...gr(n)});class ii extends _r{_parse(e){return this._getType(e)===$n.undefined?lr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ii.create=(e,t)=>new ii({innerType:e,typeName:hi.ZodOptional,...gr(t)});class oi extends _r{_parse(e){return this._getType(e)===$n.null?lr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}oi.create=(e,t)=>new oi({innerType:e,typeName:hi.ZodNullable,...gr(t)});class ai extends _r{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===$n.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ai.create=(e,t)=>new ai({innerType:e,typeName:hi.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...gr(t)});class si extends _r{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t,common:{...t.common,issues:[]}}});return hr(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue()}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}}si.create=(e,t)=>new si({innerType:e,typeName:hi.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...gr(t)});class ui extends _r{_parse(e){if(this._getType(e)!==$n.nan){const t=this._getOrReturnCtx(e);return ar(t,{code:er.invalid_type,expected:$n.nan,received:t.parsedType}),ur}return{status:"valid",value:e.data}}}ui.create=e=>new ui({typeName:hi.ZodNaN,...gr(e)});const ci=Symbol("zod_brand");class li extends _r{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class di extends _r{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?ur:"dirty"===e.status?(t.dirty(),cr(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?ur:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new di({in:e,out:t,typeName:hi.ZodPipeline})}}const pi=(e,t={},n)=>e?Rr.create().superRefine(((r,i)=>{if(!e(r)){const e="function"==typeof t?t(r):t,o="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...o,fatal:n})}})):Rr.create(),fi={object:Zr.lazycreate};var hi;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"}(hi||(hi={}));const mi=Pr.create,vi=Ir.create,yi=ui.create,gi=Ar.create,_i=Or.create,wi=kr.create,bi=Cr.create,Ti=Nr.create,Ei=Mr.create,Pi=Rr.create,Si=xr.create,Ii=Dr.create,Ai=Lr.create,Oi=Ur.create,ki=Zr.create,Ci=Zr.strictCreate,Ni=zr.create,Mi=Fr.create,Ri=Vr.create,xi=Hr.create,Di=Kr.create,Li=Jr.create,Ui=qr.create,ji=Qr.create,Bi=Yr.create,Zi=$r.create,zi=ei.create,Wi=ti.create,Fi=ni.create,Gi=ri.create,Vi=ii.create,Hi=oi.create,Ki=ri.createWithPreprocess,Ji=di.create,qi={string:e=>Pr.create({...e,coerce:!0}),number:e=>Ir.create({...e,coerce:!0}),boolean:e=>Or.create({...e,coerce:!0}),bigint:e=>Ar.create({...e,coerce:!0}),date:e=>kr.create({...e,coerce:!0})},Qi=ur;var Yi=Object.freeze({__proto__:null,defaultErrorMap:nr,setErrorMap:function(e){rr=e},getErrorMap:ir,makeIssue:or,EMPTY_PATH:[],addIssueToContext:ar,ParseStatus:sr,INVALID:ur,DIRTY:cr,OK:lr,isAborted:dr,isDirty:pr,isValid:fr,isAsync:hr,get util(){return Kn},ZodParsedType:$n,getParsedType:Xn,ZodType:_r,ZodString:Pr,ZodNumber:Ir,ZodBigInt:Ar,ZodBoolean:Or,ZodDate:kr,ZodSymbol:Cr,ZodUndefined:Nr,ZodNull:Mr,ZodAny:Rr,ZodUnknown:xr,ZodNever:Dr,ZodVoid:Lr,ZodArray:Ur,get objectUtil(){return jr},ZodObject:Zr,ZodUnion:zr,ZodDiscriminatedUnion:Fr,ZodIntersection:Vr,ZodTuple:Hr,ZodRecord:Kr,ZodMap:Jr,ZodSet:qr,ZodFunction:Qr,ZodLazy:Yr,ZodLiteral:$r,ZodEnum:ei,ZodNativeEnum:ti,ZodPromise:ni,ZodEffects:ri,ZodTransformer:ri,ZodOptional:ii,ZodNullable:oi,ZodDefault:ai,ZodCatch:si,ZodNaN:ui,BRAND:ci,ZodBranded:li,ZodPipeline:di,custom:pi,Schema:_r,ZodSchema:_r,late:fi,get ZodFirstPartyTypeKind(){return hi},coerce:qi,any:Pi,array:Oi,bigint:gi,boolean:_i,date:wi,discriminatedUnion:Mi,effect:Gi,enum:zi,function:ji,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>pi((t=>t instanceof e),t,!0),intersection:Ri,lazy:Bi,literal:Zi,map:Li,nan:yi,nativeEnum:Wi,never:Ii,null:Ei,nullable:Hi,number:vi,object:ki,oboolean:()=>_i().optional(),onumber:()=>vi().optional(),optional:Vi,ostring:()=>mi().optional(),pipeline:Ji,preprocess:Ki,promise:Fi,record:Di,set:Ui,strictObject:Ci,string:mi,symbol:bi,transformer:Gi,tuple:xi,undefined:Ti,union:Ni,unknown:Si,void:Ai,NEVER:Qi,ZodIssueCode:er,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:tr}),$i=function(){function t(){var e,n,r,i,a,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,I,A,O,k;Rt(this,t),this.initConfig=window.APP_CONFIG;var C=Mt.isString(null===(e=this.initConfig)||void 0===e||null===(n=e.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(i=r.app)||void 0===i||null===(a=i.headerColor)||void 0===a?void 0:a.length)>0?X:ee;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,R="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?$.HIDE_BACK:$.SHOW_BACK,x="home"===(null===(v=this.initConfig)||void 0===v||null===(y=v.app)||void 0===y?void 0:y.leftButton)||"both"===(null===(g=this.initConfig)||void 0===g||null===(_=g.app)||void 0===_?void 0:_.leftButton)?$.SHOW_HOME:$.HIDE_HOME,D=new URL(location.href),L=xn(null===(w=this.initConfig)||void 0===w||null===(b=w.app)||void 0===b?void 0:b.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.app)||void 0===E?void 0:E.actionBarHidden)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?ee:X);this.config={actionbarType:C,buttonType:R,statusbarType:L,dataConfig:{backgroundColor:(null===(P=this.initConfig)||void 0===P||null===(S=P.app)||void 0===S?void 0:S.headerColor)||te,textColor:(null===(I=this.initConfig)||void 0===I||null===(A=I.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(O=this.initConfig)||void 0===O||null===(k=O.app)||void 0===k?void 0:k.textAlign)||ne,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(s,"/").concat(o,"/").concat(D.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return Me((function(){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},n.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return Me((function(){var r,i;return Ue(this,(function(o){return void 0===(void 0===e?"undefined":St(e))&&null===(void 0===e?"undefined":St(e))||(r="none"===e||"home"===e?$.HIDE_BACK:$.SHOW_BACK,i="home"===e||"both"===e?$.SHOW_HOME:$.HIDE_HOME,n.config.buttonType=r,n.config.dataConfig.viewInLeftType=r,n.config.homeConfig.enable=i),n.config.dataConfig.confirmToExit=t,[2,new Promise((function(e,t){En("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",qe({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},n.setAndroidBottomNavigationBar=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return Me((function(){var r,i,o;return Ue(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Ge())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();En("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideAndroidBottomNavigationBar=!!t,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1})}))]}))}))()},n.setIOSBottomSafeArea=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return Me((function(){var r,i,o;return Ue(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Ge())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();En("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideIOSSafeAreaBottom=!!t,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1,delay:200})}))]}))}))()},n.configHeader=function(t){var n=this;return Me((function(){var r;return Ue(this,(function(i){return r=n.config,Mt.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),Mt.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),Mt.isString(t.textAlign)&&("left"===t.textAlign?r.dataConfig.textAlign=e.TextAlignType.left:"center"===t.textAlign&&(r.dataConfig.textAlign=e.TextAlignType.center)),!0===t.hideActionBar?r.actionbarType=ee:!1===t.hideActionBar&&(r.actionbarType=X),"normal"===t.statusBarType?r.statusbarType=e.StatusBarType.normal:"hidden"===t.statusBarType?r.statusbarType=e.StatusBarType.hidden:"transparent"===t.statusBarType&&(r.statusbarType=e.StatusBarType.transparent),[2,new Promise((function(i,o){En("CHANGE_ACTIONBAR",qe({},r),{success:function(){var o;n.config=qe({},r);var a,s=null===(o=Ge())||void 0===o?void 0:o.platform;window.STATUS_BAR_TYPE=(a=n.config.statusbarType)===e.StatusBarType.hidden?"hidden":a===e.StatusBarType.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=n.config.actionbarType===ee;var u=null===document||void 0===document?void 0:document.querySelector(":root");if(null==s?void 0:s.isAndroid){var c=0;if(("hidden"===t.statusBarType||"transparent"===t.statusBarType)&&t.hideActionBar){var l=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(l)&&(l=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),c=l}c?null==u||u.style.setProperty("--zaui-safe-area-inset-top","".concat(c,"px")):null==u||u.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}i()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t}(),Xi=$i.getInstance(),eo=[ki({title:mi()}).optional()];function to(e){return no.apply(this,arguments)}function no(){return no=Me((function(e){return Ue(this,(function(t){return[2,Wn("setNavigationBarTitle",eo,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Xi.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),no.apply(this,arguments)}var ro=[ki({color:mi(),textColor:Yi.enum(["black","white"]).optional(),statusBarColor:mi().optional()}).optional()];function io(e){return oo.apply(this,arguments)}function oo(){return oo=Me((function(e){return Ue(this,(function(t){return[2,Wn("setNavigationBarColor",ro,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Xi.configHeader({hideActionBar:!(e.color.length>0),headerTextColor:e.textColor,headerColor:e.color.length>0?e.color:e.statusBarColor})]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),oo.apply(this,arguments)}var ao=[ki({type:Yi.enum(["none","back","home","both"])}).optional()];function so(e){return uo.apply(this,arguments)}function uo(){return uo=Me((function(e){return Ue(this,(function(t){return[2,Wn("setNavigationBarLeftButton",ao,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Xi.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),uo.apply(this,arguments)}function co(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function lo(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,co(e,t,"get"))}function po(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function fo(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,co(e,t,"set"),n),n}var ho,mo,vo=function(){function e(){Rt(this,e)}var t=e.prototype;return t.getSynchronize=function(e){return new Map},t.setSynchronize=function(e){return{errorKeys:[]}},t.getInfoSynchronize=function(){return{currentSize:0,limitSize:0}},t.removeSynchronize=function(e){return{errorKeys:[]}},t.clearSynchronize=function(){},t.getItem=function(e){return this.getSynchronize([e]).get(e)||null},t.setItem=function(e,t){if(this.setSynchronize(Je({},e,t)).errorKeys.length>0)throw new Error("Failed to set item: ".concat(e))},t.removeItem=function(e){this.removeSynchronize([e])},t.clear=function(){this.clearSynchronize()},t.getStorageInfo=function(){return this.getInfoSynchronize()},e}(),yo=new WeakMap,go=new WeakMap,_o=new WeakMap,wo=function(e){Zt(n,e);var t=Wt(n);function n(e){var r;return Rt(this,n),po(zt(r=t.call(this)),yo,{writable:!0,value:localStorage}),po(zt(r),go,{writable:!0,value:void 0}),po(zt(r),_o,{writable:!0,value:void 0}),fo(zt(r),_o,{keys:new Set,currentSize:0,limitSize:V}),fo(zt(r),go,e),r.findAllCurrentDataByApp(e),r}var r=n.prototype;return r.findAllCurrentDataByApp=function(e){try{var t;for(t in lo(this,yo)){if(e)if(t.split("_")[0]!==e)continue;lo(this,_o).keys.add(t)}}catch(e){}},r.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},r.getSync=function(e){return lo(this,go)&&(e="".concat(lo(this,go),"_").concat(e)),lo(this,_o).keys.has(e)?lo(this,yo).getItem(e):null},r.set=function(e){var t=this;return Me((function(){return Ue(this,(function(n){return Object.entries(e).forEach((function(e){var n=Qe(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.setSync=function(e,t){lo(this,go)&&(e="".concat(lo(this,go),"_").concat(e)),lo(this,yo).setItem(e,t),lo(this,_o).keys.add(e)},r.getInfo=function(){var e=this;return Me((function(){return Ue(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},r.getInfoSync=function(){var e=function(e,t){var n,r=0;for(n in e){var i=n.split("_")[0];e.hasOwnProperty(n)&&(t&&i!==t||(r+=2*(e[n].length+n.length)))}return r}(lo(this,yo),lo(this,go));return{currentSize:Mt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((V/1024).toFixed(2))}},r.remove=function(e){var t=this;return Me((function(){return Ue(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.removeSync=function(e){lo(this,go)&&(e="".concat(lo(this,go),"_").concat(e)),lo(this,_o).keys.has(e)&&(lo(this,yo).removeItem(e),lo(this,_o).keys.delete(e))},r.clearAsync=function(){var e=this;return Me((function(){return Ue(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},r.clearSync=function(){var e=this;lo(this,_o).keys.forEach((function(t){lo(e,go)&&t.indexOf(lo(e,go))<0||(lo(e,yo).removeItem(t),lo(e,_o).keys.delete(t))}))},r.setSynchronize=function(e){var t=this;return Object.entries(e).forEach((function(e){var n=Qe(e,2),r=n[0],i=n[1];t.setSync(r,i)})),{errorKeys:[]}},r.getSynchronize=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),n},r.getInfoSynchronize=function(){return this.getInfoSync()},r.clearSynchronize=function(){this.clearSync()},n}(vo),bo=new WeakMap,To=new WeakMap,Eo=function(e){Zt(n,e);var t=Wt(n);function n(e){var r;return Rt(this,n),po(zt(r=t.call(this)),bo,{writable:!0,value:void 0}),po(zt(r),To,{writable:!0,value:void 0}),fo(zt(r),To,{keys:new Set,currentSize:0,limitSize:V}),fo(zt(r),bo,e),r}var r=n.prototype;return r.get=function(e){var t=this;return Me((function(){return Ue(this,(function(n){return[2,new Promise((function(n,r){En("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:lo(t,bo)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.getSynchronize=function(e){var t={mpds_action:"mpds.get",mpds_data:{keys:e},appId:lo(this,bo)},n=new Map,r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.map&&(n=new Map(Object.entries(r.mpds_data.map))),n},r.set=function(e){var t=this;return Me((function(){return Ue(this,(function(n){return[2,new Promise((function(n,r){En("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:lo(t,bo)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.setSynchronize=function(e){var t={mpds_action:"mpds.set",mpds_data:{map:e},appId:lo(this,bo)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.getInfo=function(){var e=this;return Me((function(){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:lo(e,bo)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:Mt.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(V/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.getInfoSynchronize=function(){var e={mpds_action:"mpds.get.size",mpds_data:{},appId:lo(this,bo)},t=0,n=this.handleResult(e);return n&&n.mpds_data&&n.mpds_data.size&&(t=n.mpds_data.size),{currentSize:Mt.isNumber(t)?Number(Number(t)/1024):0,limitSize:Number(V/1024)}},r.remove=function(e){var t=this;return Me((function(){return Ue(this,(function(n){return[2,new Promise((function(n,r){En("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:lo(t,bo)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.removeSynchronize=function(e){var t={mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:lo(this,bo)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.clearAsync=function(){var e=this;return Me((function(){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:lo(e,bo)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.clearSynchronize=function(){var e={mpds_action:"mpds.clear.appData",mpds_data:{},appId:lo(this,bo)};this.handleResult(e)},r.handleResult=function(e){var t=null;try{var n=ZaloJavaScriptInterface.processActionMPDS(JSON.stringify(e));if(n=JSON.parse(n)){if(0===n.error_code)return n.data;t=Tn(n).toJSON()}}catch(e){t=e}finally{if(null!==t)throw t}return{}},n}(vo),Po=function(){function e(){Rt(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return Me((function(){var n,r;return Ue(this,(function(i){switch(i.label){case 0:return[4,t.getInstance().get(e)];case 1:return n=i.sent(),r={},n.forEach((function(e,t){r[t]=Cn(e)})),[2,r]}}))}))()},t.getItem=function(e){return this.getInstance().getItem(e)},t.putDataToStorage=function(e){var t=this;return Me((function(){var n,r;return Ue(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Qe(e,2),n=t[0],i=t[1];Mt.isUndefined(i)||Mt.isNull(i)||(r[n]=Rn(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.setItem=function(e,t){return this.getInstance().setItem(e,t)},t.removeDataFromStorage=function(e){var t=this;return Me((function(){return Ue(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.removeItem=function(e){this.getInstance().removeItem(e)},t.clearStorage=function(){var e=this;return Me((function(){return Ue(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clearAsync()];case 1:return t.sent(),[2]}}))}))()},t.clearStorageSync=function(){this.getInstance().clear()},t.getStorageInfo=function(){var e=this;return Me((function(){return Ue(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},t.getStorageInfoSync=function(){return this.getInstance().getStorageInfo()},e}(),So=new WeakMap,Io=function(e){Zt(n,e);var t=Wt(n);function n(e){var r;return Rt(this,n),po(zt(r=t.call(this)),So,{writable:!0,value:void 0}),fo(zt(r),So,e),r}return n.prototype.getInstance=function(){return new wo(lo(this,So))},n}(Po),Ao=new WeakMap,Oo=function(e){Zt(n,e);var t=Wt(n);function n(e){var r;return Rt(this,n),po(zt(r=t.call(this)),Ao,{writable:!0,value:void 0}),fo(zt(r),Ao,e),r}return n.prototype.getInstance=function(){return new Eo(lo(this,Ao))},n}(Po),ko=new Io(o),Co=pn(),No=(null===(ho=Ge())||void 0===ho?void 0:ho.platformName)||"unknown";Co>0&&Co>={android:12100571,iOS:400,wp:0,unknown:0}[No]&&(null===(mo=Ge())||void 0===mo?void 0:mo.appEnv.isMp)&&(ko=new Oo(o));var Mo=ko,Ro=[ki({data:Yi.record(mi(),Yi.any())}).optional()];function xo(e){return Do.apply(this,arguments)}function Do(){return Do=Me((function(e){return Ue(this,(function(t){return[2,Wn("setStorage",Ro,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp||Ve.isMpWeb?[4,Mo.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ke("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Do.apply(this,arguments)}var Lo=[ki({keys:Yi.array(mi())}).optional()];function Uo(e){return jo.apply(this,arguments)}function jo(){return jo=Me((function(e){return Ue(this,(function(t){return[2,Wn("getStorage",Lo,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp||Ve.isMpWeb?[4,Mo.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ke("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),jo.apply(this,arguments)}function Bo(e){return Zo.apply(this,arguments)}function Zo(){return(Zo=Me((function(e){return Ue(this,(function(t){return[2,Wn("getStorageInfo",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp||Ve.isMpWeb?[4,Mo.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ke("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var zo=[ki({keys:Yi.array(mi())}).optional()];function Wo(e){return Fo.apply(this,arguments)}function Fo(){return Fo=Me((function(e){return Ue(this,(function(t){return[2,Wn("removeStorage",zo,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp||Ve.isMpWeb?[4,Mo.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ke("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fo.apply(this,arguments)}var Go=[ki({prefix:mi().optional()}).optional()];function Vo(e){return Ho.apply(this,arguments)}function Ho(){return(Ho=Me((function(e){return Ue(this,(function(t){return[2,Wn("clearStorage",Go,[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp||Ve.isMpWeb?[4,Mo.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ke("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var Ko=function(){var e=Me((function(e,t){var n,r,i,a;return Ue(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,Un()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,In.getAccessToken(n)];case 3:return i=s.sent(),a="id,name,user_id_by_oa,is_sensitive",a=e?"".concat(a,",picture.type(").concat(e,")"):"".concat(a,",picture"),[4,fetch("".concat(d.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(o),{headers:{access_token:i||""}}).then(function(){var e=Me((function(e){var t,n,r,i,o,a;return Ue(this,(function(s){switch(s.label){case 0:return[4,e.json()];case 1:if(r=s.sent(),void 0!==(i=null==r?void 0:r.error)&&0!==i)throw o=(null==r?void 0:r.message)||O,new vn(i,o);return a=null==r?void 0:r.user_id_by_oa,[2,{id:null==r?void 0:r.id,name:(null==r?void 0:r.name)||"",avatar:(null==r||null===(t=r.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url)||"",idByOA:a,followedOA:!!(null==r?void 0:r.is_follower),isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),Jo=[ki({avatarType:Yi.enum(["small","normal","large"]).optional(),autoRequestPermission:Yi.boolean().default(!1).optional()}).optional()];function qo(e){return Qo.apply(this,arguments)}function Qo(){return Qo=Me((function(e){return Ue(this,(function(t){return[2,Wn("getUserInfo",Jo,[e],function(){var e=Me((function(e){var t,n,r;return Ue(this,(function(i){switch(i.label){case 0:if(!Ve.isMp)return[3,4];t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Ko(t,n)];case 2:return[2,{userInfo:i.sent()}];case 3:return r=i.sent(),[2,Promise.reject(r)];case 4:return Ve.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Ke("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qo.apply(this,arguments)}var Yo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},$o=Me((function(){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Ge())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case Yo(s).NONE:o=e.NetworkType.none;break;case Yo(s).WIFI:o=e.NetworkType.wifi;break;case Yo(s)["2G"]:case Yo(s)["3G"]:case Yo(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function Xo(e){return ea.apply(this,arguments)}function ea(){return(ea=Me((function(t){return Ue(this,(function(n){return[2,Wn("getNetworkType",[],[t],Me((function(){var t,n;return Ue(this,(function(r){switch(r.label){case 0:return Ve.isMp?[4,$o()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(Ve.isMpWeb){switch(t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t.effectiveType){case"none":n=e.NetworkType.none;break;case"4g":n=e.NetworkType.wifi;break;case"3g":case"2g":n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return[2,Promise.resolve({networkType:n})]}return[2,Promise.reject(Ke("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var ta=[Yi.function().args(ki({isConnected:Yi.boolean(),networkType:Yi.enum(["none","wifi","cellular","unknown"])})).returns(Yi.void())];function na(t){return Wn("onNetworkStatusChange",ta,[t],(function(t){var n=t;if(Ve.isMp)!function(t){Jt.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;$o().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(Ve.isMpWeb){var r=navigator.connection||navigator.mozConnection||navigator.webkitConnection,i=r.effectiveType;r.addEventListener("change",(function(){var t;switch(i){case"none":t=e.NetworkType.none;break;case"4g":t=e.NetworkType.wifi;break;case"3g":case"2g":t=e.NetworkType.cellular;break;default:t=e.NetworkType.unknown}n({isConnected:!0,networkType:t})}))}}))}var ra=function(){var e=Me((function(e){var t,n,r,i,o,a;return Ue(this,(function(s){return a={subaction:0,scanning_type:Mt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Mt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Mt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Mt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Mt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Mt.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Mt.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Mt.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Mt.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Mt.isNumber(null==e||null===(o=e.scanConfig)||void 0===o?void 0:o.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}},[2,new Promise((function(e,t){En("SCAN_IBEACON",qe({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ia=[ki({scanningType:Yi.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Yi.number().optional(),monitorInterval:Yi.number().optional(),domain:Yi.string().optional(),scanConfig:ki({scanTime:Yi.number().optional(),timeBetweenScan:Yi.number().optional(),beaconTimeout:Yi.number().optional(),delayCheckConnectedTimeout:Yi.number().optional(),beaconConnectedTimeout:Yi.number().optional()}).optional(),items:Yi.array(ki({id:Yi.string().optional(),distance:Yi.number().optional(),monitor:ki({enable:Yi.boolean().optional(),movingRange:Yi.number().optional()}).optional()})).optional(),scanFromSource:Yi.string().optional()}).optional()];function oa(e){return aa.apply(this,arguments)}function aa(){return(aa=Me((function(e){return Ue(this,(function(t){return[2,Wn("startBeaconDiscovery",ia,[e],Me((function(){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,ra(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ke("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var sa=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function ua(e){return ca.apply(this,arguments)}function ca(){return(ca=Me((function(e){return Ue(this,(function(t){return[2,Wn("stopBeaconDiscovery",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,sa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ke("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var la=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("SCAN_IBEACON",{subaction:1},{success:function(t){var n={beacons:[]};Array.isArray(t)&&t.forEach((function(e){var t={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};n.beacons.push(t)})),e(n)},fail:function(e){t(e)}},{isMultiCallback:!0})}))]}))}));function da(e){return pa.apply(this,arguments)}function pa(){return(pa=Me((function(e){return Ue(this,(function(t){return[2,Wn("getBeacons",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,la()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Ke("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var fa=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ha(e){return ma.apply(this,arguments)}function ma(){return(ma=Me((function(e){return Ue(this,(function(t){return[2,Wn("closeApp",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,fa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var va=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ya(e){return ga.apply(this,arguments)}function ga(){return(ga=Me((function(e){return Ue(this,(function(t){return[2,Wn("scanQRCode",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,va()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Ke("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var _a=function(){var t=Me((function(t,n,r,o){return Ue(this,(function(a){return[2,new Promise((function(a,s){En("OPEN_PROFILE",{uId:t,type:e.ProfileType[n],zapp:i,sourceId:r,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(e,n,r,i){return t.apply(this,arguments)}}(),wa=[ki({id:mi(),type:Yi.enum(["user","oa","aliasOA"]),sourceId:Yi.any().optional(),sourceIndex:Yi.any().optional()}).optional()];function ba(e){return Ta.apply(this,arguments)}function Ta(){return Ta=Me((function(e){return Ue(this,(function(t){return[2,Wn("openProfile",wa,[e],function(){var e=Me((function(e){var t,n,r,i;return Ue(this,(function(o){switch(o.label){case 0:return Ve.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,_a(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ta.apply(this,arguments)}var Ea=function(){var t=Me((function(t,n){var r,o,a,s=arguments;return Ue(this,(function(u){return r=s.length>2&&void 0!==s[2]?s[2]:"",o=s.length>3?s[3]:void 0,a=s.length>4?s[4]:void 0,[2,new Promise((function(s,u){En("OPEN_CHAT",{uId:t,type:e.ChatType[n],msg:r,zapp:i,sourceId:o,sourceIndex:a},{success:function(){s()},fail:function(e){u(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Pa=[ki({id:mi(),type:Yi.enum(["user","oa"]),sourceId:Yi.any().optional(),sourceIndex:Yi.any().optional(),message:mi().optional()}).optional()];function Sa(e){return Ia.apply(this,arguments)}function Ia(){return Ia=Me((function(e){return Ue(this,(function(t){return[2,Wn("openChat",Pa,[e],function(){var e=Me((function(e){var t,n,r,i,o;return Ue(this,(function(a){switch(a.label){case 0:return Ve.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,Ea(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ia.apply(this,arguments)}function Aa(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var Oa=function(){var t=Me((function(t,n){var r,o;return Ue(this,(function(a){switch(r={},o=t,t){case"image":(null==n?void 0:n.imageUrls)?(o="multi_image",r={photoUrl:null==n?void 0:n.imageUrls}):r={photoUrl:null==n?void 0:n.imageUrl};break;case"link":r={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":r={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(t,n){En("OPEN_POSTFEED",Aa(qe({type:e.PostFeedType[o]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),ka=[Yi.union([ki({type:Yi.enum(["image"]),data:ki({imageUrl:mi().url().optional(),imageUrls:Yi.array(mi().url()).optional()})}),ki({type:Yi.enum(["link"]),data:ki({link:mi().url(),title:mi().max(100).optional(),thumb:mi().url().optional(),description:mi().max(400).default("").optional()})}),ki({type:Yi.enum(["profile"]),data:ki({id:mi().optional()})})])];function Ca(e){return Na.apply(this,arguments)}function Na(){return Na=Me((function(e){return Ue(this,(function(t){return[2,Wn("openPostFeed",ka,[e],function(){var e=Me((function(e){var t,n;return Ue(this,(function(r){switch(r.label){case 0:return Ve.isMp?(t=e.type,n=e.data,[4,Oa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ke("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Na.apply(this,arguments)}var Ma=function(){var e=Me((function(e){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:i},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ra=[ki({id:mi(),showDialogConfirm:Yi.boolean().optional()}).optional()];function xa(e){return Da.apply(this,arguments)}function Da(){return Da=Me((function(e){return Ue(this,(function(t){return[2,Wn("followOA",Ra,[e],function(){var e=Me((function(e){var t;return Ue(this,(function(n){switch(n.label){case 0:return Ve.isMp?(t=e.id,[4,Ma(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Da.apply(this,arguments)}var La=function(){var e=Me((function(e){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ua=[ki({id:mi()}).optional()];function ja(e){return Ba.apply(this,arguments)}function Ba(){return Ba=Me((function(e){return Ue(this,(function(t){return[2,Wn("unfollowOA",Ua,[e],function(){var e=Me((function(e){var t;return Ue(this,(function(n){switch(n.label){case 0:return Ve.isMp?(t=e.id,[4,La(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ba.apply(this,arguments)}var Za=function(){var e=Me((function(e,t,n,r,i,o){var s,u,l,p,f,h,m,v;return Ue(this,(function(y){switch(y.label){case 0:return l=new URL(location.href),p=new URLSearchParams,f="".concat(l.pathname.replace(c,"")).concat(l.search),o&&(f="/".concat(e).concat("/"===o[0]?"":"/").concat(o)),!(h=new URL("".concat(a).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(u=window.APP_VERSION)||void 0===u?void 0:u.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CREATE_SHARE_LINK,qe({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw bn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,Aa(qe({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),za=function(){var t=Me((function(t,n){var r,a,s,u,c,l,d,p,f,h,m;return Ue(this,(function(v){switch(v.label){case 0:switch(r={},a=t,t){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return r={text:null==n?void 0:n.text,desc:(null==n?void 0:n.desc)||(null==n?void 0:n.description),autoParseLink:(null==n?void 0:n.autoParseLink)?1:0},[3,14];case 2:return c=[],l=pn(),d=(null===(u=Ge())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=G[d]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?c=null==n?void 0:n.imageUrls:c.push(null==n?void 0:n.imageUrl),r={photoUrls:c,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,14];case 3:return r={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 4:return r={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 5:return r={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,14];case 6:return r={uid:null==n?void 0:n.id},[3,14];case 7:case 10:return[4,In.getAccessToken()];case 8:case 11:return s=v.sent(),[4,Za(o,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 9:return p=v.sent(),r={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(o,"&shareId=").concat(p.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return f=v.sent().shareableLink,h=new URL(f),m=h.searchParams.getAll("zshareId"),h.searchParams.delete("zshareId"),m.length>0&&h.searchParams.append("zshareId",m[0]),r={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(t,n){En("OPEN_SHARESHEET",Aa(qe({type:e.ShareSheetType[a]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{timeout:!1})}))]}}))}));return function(e,n){return t.apply(this,arguments)}}(),Wa=[Yi.union([ki({type:Yi.enum(["text"]),data:ki({text:mi(),description:mi().default("").optional(),autoParseLink:Yi.boolean().default(!1).optional()})}),ki({type:Yi.enum(["image"]),data:ki({imageUrl:mi().url().optional(),imageUrls:Yi.array(mi().url()).max(10).optional()})}),ki({type:Yi.enum(["link"]),data:ki({link:mi().url(),chatOnly:Yi.boolean().optional()})}),ki({type:Yi.enum(["oa"]),data:ki({id:mi()})}),ki({type:Yi.enum(["gif"]),data:ki({gifUrl:mi().url(),imageUrl:mi().url().optional(),width:vi().min(0).optional(),height:vi().min(0).optional()})}),ki({type:Yi.enum(["video"]),data:ki({videoThumb:mi().url(),videoUrl:mi().url(),width:vi().min(0).optional(),height:vi().min(0).optional()})}),ki({type:Yi.enum(["zmp","zmp_deep_link"]),data:ki({title:mi().max(100),thumbnail:mi().url(),path:mi().optional(),description:mi().max(400).default("").optional()})})])];function Fa(e){return Ga.apply(this,arguments)}function Ga(){return Ga=Me((function(e){return Ue(this,(function(t){return[2,Wn("openShareSheet",Wa,[e],function(){var e=Me((function(e){var t,n;return Ue(this,(function(r){switch(r.label){case 0:return Ve.isMp?(t=e.type,n=e.data,[4,za(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ke("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ga.apply(this,arguments)}var Va=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Ge())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)?e({userAllow:void 0===t.error_code||(null==t?void 0:t.error_code)>=0,message:void 0===t.error_code?"User allowed":null==t?void 0:t.error_message}):e({userAllow:(null==t?void 0:t.error_code)>=0,message:null==t?void 0:t.error_message})},fail:function(n){var r,i;(null===(r=Ge())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)&&"number"==typeof(null==n?void 0:n.code)?e({userAllow:(null==n?void 0:n.code)>=0,message:null==n?void 0:n.message}):t(n)}},{isMultiCallback:!0})}))]}))}));function Ha(e){return Ka.apply(this,arguments)}function Ka(){return(Ka=Me((function(e){return Ue(this,(function(t){return[2,Wn("requestCameraPermission",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return[4,Va()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Ja=function(){var e=Me((function(e,t,n){return Ue(this,(function(r){return[2,new Promise((function(r,i){En("CREATE_SHORTCUT",{url:e,title:t,iconUrl:n},{success:function(e){r(e)},fail:function(e){i(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),qa=Me((function(){var e,t,n,r=arguments;return Ue(this,(function(i){switch(i.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:o,t=r.length>1&&void 0!==r[1]?r[1]:0,n=Qn(),[4,an(e,t,n.version)];case 1:return[2,i.sent()]}}))})),Qa=function(){var e=Me((function(e,t,n,r){var i,o,a,s,u;return Ue(this,(function(c){return i=new URL(e),o=i.href.includes("vnpay"),a=i.searchParams.get("typeInapp"),s=Mt.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?un(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?un(null==t?void 0:t.leftButton):"back"},u=Number.isInteger(n)?n:void 0,o||!Mt.isEmpty(a)||r||i.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){En("OPEN_INAPP",{url:i.href,style:s,h5_src_open:u},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r,i){return e.apply(this,arguments)}}(),Ya=[ki({params:Yi.record(mi(),mi()).optional()}).optional()];function $a(e){return Xa.apply(this,arguments)}function Xa(){return Xa=Me((function(e){return Ue(this,(function(t){return[2,Wn("createShortcut",Ya,[e],function(){var e=Me((function(e){var t,n,r,i,s,u,c,l;return Ue(this,(function(d){switch(d.label){case 0:return Ve.isMp?[4,qa(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=Ge())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||Mn("og:image:url")||"",u=r.name||document.title,(c=(null==e?void 0:e.params)?new URLSearchParams(null==e?void 0:e.params):new URLSearchParams).append("utm_source","zalo-shortcut"),c.append("utm_medium","default"),c.append("utm_campaign","default"),i?(c.append("appId",o),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,Qa(encodeURI(l),void 0,void 0,!0)]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Ja("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,bn.success()];case 6:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xa.apply(this,arguments)}var es=function(){var e=Me((function(e,t,n){return Ue(this,(function(r){return[2,new Promise((function(r,o){En("PROMPT_AUTHENTICATION",{secret_data:e,app_id:i,ui:{title:null==t?void 0:t.title,sub_title:null==t?void 0:t.subTitle,negative_text:null==t?void 0:t.negativeButtonText},require_fingerprint:n?1:0},{success:function(e){var t,n,i,o;r({code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null==e||null===(t=e.data)||void 0===t?void 0:t.domain,code:null==e||null===(n=e.data)||void 0===n?void 0:n.error_code,message:null==e||null===(i=e.data)||void 0===i?void 0:i.error_message,payToken:null==e||null===(o=e.data)||void 0===o?void 0:o.pay_token}})},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),ts=[ki({secretData:mi(),ui:ki({title:mi().default("Xác thực").optional(),subTitle:mi().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:mi().default("Đóng").optional()}).optional(),requireFingerprint:_i().default(!0).optional()}).optional()];function ns(e){return rs.apply(this,arguments)}function rs(){return rs=Me((function(e){return Ue(this,(function(t){return[2,Wn("openBioAuthentication",ts,[e],function(){var e=Me((function(e){var t,n,r;return Ue(this,(function(i){switch(i.label){case 0:return Ve.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,es(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Ke("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rs.apply(this,arguments)}var is=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("PROMPT_AUTHENTICATION_CHECK_STATE",{},{success:function(t){e(null==t?void 0:t.bio_state)},fail:function(e){t(e)}},{actionName:"action.prompt.authentication.check_state"})}))]}))}));function os(e){return as.apply(this,arguments)}function as(){return(as=Me((function(e){return Ue(this,(function(t){return[2,Wn("checkStateBioAuthentication",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,is()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Ve.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Ke("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var ss=function(){var e=Me((function(e){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),us=[ki({message:mi()}).optional()];function cs(e){return ls.apply(this,arguments)}function ls(){return ls=Me((function(e){return Ue(this,(function(t){return[2,Wn("showToast",us,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,ss(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ls.apply(this,arguments)}var ds=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function ps(e){return fs.apply(this,arguments)}function fs(){return(fs=Me((function(e){return Ue(this,(function(t){return[2,Wn("hideKeyboard",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,ds()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var hs=function(){var e=Me((function(e){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ms=[ki({phoneNumber:mi()})];function vs(e){return ys.apply(this,arguments)}function ys(){return ys=Me((function(e){return Ue(this,(function(t){return[2,Wn("openPhone",ms,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,hs(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ys.apply(this,arguments)}var gs=function(){var e=Me((function(e,t){return Ue(this,(function(n){return[2,new Promise((function(n,r){En("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),_s=[ki({content:mi(),phoneNumber:mi()})];function ws(e){return bs.apply(this,arguments)}function bs(){return bs=Me((function(e){return Ue(this,(function(t){return[2,Wn("openSMS",_s,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,gs(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bs.apply(this,arguments)}var Ts=function(){var e=Me((function(e){var t,n=arguments;return Ue(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){En("VIEW_MYQR",{dpn:t,uid:e,zapp:i},{success:function(){n()},fail:function(e){r(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Es=[ki({id:mi(),displayName:mi().default("").optional()})];function Ps(e){return Ss.apply(this,arguments)}function Ss(){return Ss=Me((function(e){return Ue(this,(function(t){return[2,Wn("viewOAQr",Es,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Ts(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ss.apply(this,arguments)}var Is=function(){var e=Me((function(e){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("KEEP_SCREEN",{data:{keep_screen_on:e?1:0}},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),As=[ki({keepScreenOn:_i()})];function Os(e){return ks.apply(this,arguments)}function ks(){return ks=Me((function(e){return Ue(this,(function(t){return[2,Wn("keepScreen",As,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Is(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ks.apply(this,arguments)}function Cs(e){return Ns.apply(this,arguments)}function Ns(){return(Ns=Me((function(e){return Ue(this,(function(t){return[2,Wn("onKeepScreen",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,Is(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function Ms(e){return Rs.apply(this,arguments)}function Rs(){return(Rs=Me((function(e){return Ue(this,(function(t){return[2,Wn("offKeepScreen",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,Is(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var xs=function(){var e=Me((function(e,t,n){var r;return Ue(this,(function(i){return r={},e?r={imageBase64Data:e}:t&&(r={imageUrl:t}),[2,new Promise((function(e,t){En("SAVE_IMAGE_GALLERY",Aa(qe({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Ds=[ki({imageBase64Data:mi().max(7e6).optional(),imageUrl:mi().url().optional()}).optional()];function Ls(e){return Us.apply(this,arguments)}function Us(){return Us=Me((function(e){return Ue(this,(function(t){return[2,Wn("saveImageToGallery",Ds,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,xs(e.imageBase64Data,e.imageUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Us.apply(this,arguments)}var js=function(){var e=Me((function(e,t,n){var r;return Ue(this,(function(i){return r={},t?r={videoBase64Data:t}:e&&(r={videoUrl:e}),[2,new Promise((function(e,t){En("SAVE_VIDEO_GALLERY",Aa(qe({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Bs=[ki({videoUrl:mi().url().optional(),videoBase64Data:mi().max(7e6).optional()}).optional()];function Zs(e){return zs.apply(this,arguments)}function zs(){return zs=Me((function(e){return Ue(this,(function(t){return[2,Wn("saveVideoToGallery",Bs,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,js(e.videoUrl,e.videoBase64Data,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("saveVideoToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zs.apply(this,arguments)}var Ws=function(){var e=Me((function(e){var t,n,r,i,o,a,u=arguments;return Ue(this,(function(c){switch(c.label){case 0:t=u.length>1&&void 0!==u[1]?u[1]:"/",n=u.length>2&&void 0!==u[2]?u[2]:{},c.label=1;case 1:return c.trys.push([1,3,,4]),[4,qa(e,0)];case 2:return r=c.sent(),[3,4];case 3:return c.sent(),[3,4];case 4:i={appId:e},r&&(i.appName=r.name,i.appAvtUrl=r.logoUrl),o="".concat(s,"/").concat(e).concat(t);try{a=new URL(o),Object.entries(n).forEach((function(e){var t=Qe(e,2),n=t[0],r=t[1];a.searchParams.append(n,String(r))})),o=a.href}catch(e){}return[2,new Promise((function(e,t){En("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),Fs=[ki({appId:mi(),path:mi().optional(),params:Yi.record(mi(),mi()).optional()})];function Gs(e){return Vs.apply(this,arguments)}function Vs(){return Vs=Me((function(e){return Ue(this,(function(t){return[2,Wn("openMiniApp",Fs,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Ws(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vs.apply(this,arguments)}var Hs=Me((function(){var t,n,r=arguments;return Ue(this,(function(i){return t=r.length>0&&void 0!==r[0]?r[0]:"oneShot",n=r.length>1?r[1]:void 0,[2,new Promise((function(r,i){En("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),Ks=[ki({type:Yi.enum(["oneShot"]).default("oneShot").optional(),milliseconds:vi().optional()}).optional()];function Js(e){return qs.apply(this,arguments)}function qs(){return qs=Me((function(e){return Ue(this,(function(t){return[2,Wn("vibrate",Ks,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Hs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qs.apply(this,arguments)}var Qs=[ki({url:mi(),config:ki({style:Yi.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Yi.enum(["back","none"]).default("back").optional()}).optional()})];function Ys(e){return $s.apply(this,arguments)}function $s(){return $s=Me((function(e){return Ue(this,(function(t){return[2,Wn("openWebview",Qs,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Qa(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$s.apply(this,arguments)}function Xs(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Yt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function eu(){return Wn("getRouteParams",[],[],(function(){return Xs()}))}function tu(e){return nu.apply(this,arguments)}function nu(){return(nu=Me((function(e){return Ue(this,(function(t){return[2,Wn("getAppInfo",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,qa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Ke("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var ru=function(){var e=Me((function(e){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("WEBVIEW_SET_RESULT",{result:Rn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),iu=[ki({data:Yi.any()})];function ou(e){return au.apply(this,arguments)}function au(){return au=Me((function(e){return Ue(this,(function(t){return[2,Wn("sendDataToPreviousMiniApp",iu,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,ru(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),au.apply(this,arguments)}var su=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){var n,r;En("MP_GET_NUMBER",{forceUpdate:!0},{success:function(n){var r={};if(null==n?void 0:n.token)return r.token=null==n?void 0:n.token,e(r);t(bn.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Ge())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function uu(e){return cu.apply(this,arguments)}function cu(){return(cu=Me((function(e){return Ue(this,(function(t){return[2,Wn("getPhoneNumber",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,su()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Ke("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var lu=Me((function(){var t,n,r,a=arguments;return Ue(this,(function(s){return t=a.length>0&&void 0!==a[0]?a[0]:1,n=a.length>1?a[1]:void 0,r=a.length>2?a[2]:void 0,[2,new Promise((function(a,s){En("MP_OPEN_PROFILE_PICKER",qe({},n===e.OpenProfilePickerType.TOOL_DEL_FRIEND?{maxProfile:t,src:n,uids:r,zapp:i,appId:o}:{maxProfile:t}),{success:function(e){Array.isArray(e)?a(e.map((function(e){return e.id}))):a([])},fail:function(e){s(e)}},{isMultiCallback:!0})}))]}))})),du=[ki({maxProfile:vi().optional().default(1),src:Yi.enum([e.OpenProfilePickerType.TOOL_DEL_FRIEND]).optional(),uids:Oi(mi()).optional()}).superRefine((function(t,n){var r=t.src,i=t.maxProfile;r===e.OpenProfilePickerType.TOOL_DEL_FRIEND?i<1&&n.addIssue({code:"custom",path:["maxProfile"],message:"maxProfile must be at least 1 when src is 'tool_del_friend'"}):(i<1||i>10)&&n.addIssue({code:"custom",path:["maxProfile"],message:"maxProfile must be between 1 and 10"})}))];function pu(e){return fu.apply(this,arguments)}function fu(){return fu=Me((function(e){return Ue(this,(function(t){return[2,Wn("openProfilePicker",du,[e],function(){var e=Me((function(e){var t,n,r,i,o,a,s,u,c,l,p,f;return Ue(this,(function(h){switch(h.label){case 0:return Ve.isMp?[4,lu(null==e?void 0:e.maxProfile,null==e?void 0:e.src,null==e?void 0:e.uids)]:[3,12];case 1:return t=h.sent(),n=function(e,t){return Array.from({length:Math.ceil(e.length/t)},(function(n,r){return e.slice(r*t,r*t+t)}))},t.length>0?[4,In.getAccessToken()]:[3,11];case 2:r=h.sent(),i=n(t,20),o=[],a=!0,s=!1,u=void 0,h.label=3;case 3:h.trys.push([3,8,9,10]),c=function(){var e,t,n,i,a,s,u;return Ue(this,(function(c){switch(c.label){case 0:e=p.value,c.label=1;case 1:return c.trys.push([1,4,,5]),[4,fetch(d.GET_LIST_USER_INFO,{method:"POST",headers:{"Content-Type":"application/json",access_token:r||""},body:JSON.stringify({fields:"id,name,picture",user_ids:e})})];case 2:return[4,c.sent().json()];case 3:if(0!==(t=c.sent()).error||!t.data)throw new Error(t.message);return i=e.map((function(e){var n,r,i,o,a,s,u,c,l,d,p;return{id:(null===(n=t.data[e])||void 0===n||null===(r=n.user_info)||void 0===r?void 0:r.user_id_by_app)||"",profile:{name:null===(i=t.data[e])||void 0===i||null===(o=i.user_info)||void 0===o?void 0:o.name,avatar:null===(a=t.data[e])||void 0===a||null===(s=a.user_info)||void 0===s||null===(u=s.picture)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.url},code:0!==(null===(l=t.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(Mt.isUndefined(null===(d=t.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=t.data[e])||void 0===p?void 0:p.message)}})),(n=o).push.apply(n,Le(i)),[3,5];case 4:return a=c.sent(),u=e.map((function(e){return{id:e,profile:{name:"",avatar:""},code:-1,message:"Can't get profile: ".concat(a.message)}})),(s=o).push.apply(s,Le(u)),[3,5];case 5:return[2]}}))},l=i[Symbol.iterator](),h.label=4;case 4:return(a=(p=l.next()).done)?[3,7]:[5,je(c())];case 5:h.sent(),h.label=6;case 6:return a=!0,[3,4];case 7:return[3,10];case 8:return f=h.sent(),s=!0,u=f,[3,10];case 9:try{a||null==l.return||l.return()}finally{if(s)throw u}return[7];case 10:return[2,{users:o}];case 11:return[2,{users:[]}];case 12:return Ve.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Ke("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fu.apply(this,arguments)}var hu=function(){var e=Me((function(e,t,n){var r;return Ue(this,(function(i){return r=t&&Mt.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){En("MP_JOIN_WIFI",{ssid:e,securityType:r,password:t,hiddenSsid:n},{success:function(e){i(e)},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),mu=[ki({SSID:mi(),password:mi().optional(),hiddenSSID:_i().optional()})];function vu(e){return yu.apply(this,arguments)}function yu(){return yu=Me((function(e){return Ue(this,(function(t){return[2,Wn("connectWifi",mu,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,hu(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yu.apply(this,arguments)}var gu=function(){var t=Me((function(t,n,r,i,o,a,s){var u,c;return Ue(this,(function(l){return u=n&&n.length>0?{type:0,url:n,max_size:r||1048576}:null,c={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(n,r){En("PICK_MEDIA",{featureFlag:null===u?1:void 0,media_type:e.MediaPickerType[t],edit_view:qe({},c,i),silent_request:o,upload:u,max_select_items:a,compressLevel:null!=s?s:0},{success:function(e){n(null!==u?null==e?void 0:e.result_content:null==e?void 0:e.path)},fail:function(e){r(e)}},{isMultiCallback:!0})}))]}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),_u=[ki({type:Yi.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:mi().url().optional(),maxItemSize:vi().min(0).optional(),editView:ki({enable:_i().optional(),aspectRatio:mi().regex(/^\d+:\d+$/).optional()}).optional(),silentRequest:_i().optional(),maxSelectItem:vi().min(1).optional(),compressLevel:vi().min(0).max(3).default(0)})];function wu(e){return bu.apply(this,arguments)}function bu(){return bu=Me((function(e){return Ue(this,(function(t){return[2,Wn("openMediaPicker",_u,[e],function(){var e=Me((function(e){var t,n,r,i,o,a,s;return Ue(this,(function(u){switch(u.label){case 0:return Ve.isMp?(i={},Mt.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(n=e.editView)||void 0===n?void 0:n.enable)?i.enable=1:i.enable=0,i.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio,o=!0===e.silentRequest?1:0,a=e.maxSelectItem,s=e.compressLevel,[4,gu(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a,s)]):[3,2];case 1:return[2,{data:u.sent()}];case 2:return Ve.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Ke("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bu.apply(this,arguments)}var Tu=[ki({title:mi().max(100),description:mi().max(400).default(""),thumbnail:mi().url().optional(),path:mi().optional()})];function Eu(e){return Pu.apply(this,arguments)}function Pu(){return Pu=Me((function(e){return Ue(this,(function(t){return[2,Wn("getShareableLink",Tu,[e],function(){var e=Me((function(e){var t;return Ue(this,(function(n){switch(n.label){case 0:return[4,In.getAccessToken()];case 1:return t=n.sent(),[4,Za(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pu.apply(this,arguments)}var Su=function(){var e=Me((function(e){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("MP_CLOSE_LOADINGVIEW",{at:(new Date).getTime(),when:e,url:location.href},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}();function Iu(e){return Au.apply(this,arguments)}function Au(){return(Au=Me((function(e){return Ue(this,(function(t){return[2,Wn("closeLoading",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,Su("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}var Ou=function(){var e=Me((function(e){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}();function ku(e){return Cu.apply(this,arguments)}function Cu(){return Cu=Me((function(e){return Ue(this,(function(t){return[2,Wn("requestUpdateZalo",[],[e],Me((function(){var e,t,n;return Ue(this,(function(r){switch(r.label){case 0:return Ve.isMp?(n=(null===(e=Ge())||void 0===e||null===(t=e.platform)||void 0===t?void 0:t.isIOS)?"https://apps.apple.com/vn/app/zalo/id579523206":"https://play.google.com/store/apps/details?id=com.zing.zalo",[4,Ou(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("requestUpdateZalo",{}))]}}))})))]}))})),Cu.apply(this,arguments)}var Nu=Jt.getInstance();Nu.addListener=function(t,n,r){var i=t;return Nu.addListener(e.Events[i],n,r)};var Mu=[Yi.function()];function Ru(t){return Wn("onConfirmToExit",Mu,[t],(function(t){var n=t;Ve.isMp&&(Nu.on(e.Events.AppClose,n,'{"handle_h5": 1}'),Xi.setNavigationBarLeftButton(void 0,2))}))}function xu(){return Wn("offConfirmToExit",[],[],(function(){Ve.isMp&&(Nu.off(e.Events.AppClose),Xi.setNavigationBarLeftButton(void 0,0))}))}function Du(){return Wn("getDeviceId",[],[],(function(){return Ve.isMp&&In.getSync(l.DEVICE_ID)||""}))}function Lu(e){return Uu.apply(this,arguments)}function Uu(){return(Uu=Me((function(e){return Ue(this,(function(t){return[2,Wn("getDeviceIdAsync",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,In.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function ju(){return Wn("getContext",[],[],(function(){if(Ve.isMp){var e=In.getSync(l.CONTEXT_ID)||"";return{type:In.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function Bu(e){return Zu.apply(this,arguments)}function Zu(){return(Zu=Me((function(e){return Ue(this,(function(t){return[2,Wn("getContextAsync",[],[e],Me((function(){var e;return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,In.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,In.jumpAndGetToken(l.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function zu(e){return Wu.apply(this,arguments)}function Wu(){return(Wu=Me((function(e){return Ue(this,(function(t){return[2,Wn("getAuthCode",[],[e],Me((function(){var e,t;return Ue(this,(function(n){switch(n.label){case 0:return Ve.isMp?[4,In.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,In.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,In.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw sn([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),bn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function Fu(e){return Gu.apply(this,arguments)}function Gu(){return(Gu=Me((function(e){return Ue(this,(function(t){return[2,Wn("getZPIToken",[],[e],Me((function(){var e,t,n,r;return Ue(this,(function(i){switch(i.label){case 0:return Ve.isMp?[4,In.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,In.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,In.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,In.jumpAndGetToken(l.ZPT_ZPI)];case 4:return r=i.sent()||"",[2,{utoken:e,gtoken:t,zpp:n,zpt:r}];case 5:return[2,Promise.resolve({utoken:"",gtoken:"",zpp:"",zpt:""})]}}))})))]}))}))).apply(this,arguments)}var Vu=[mi()];function Hu(e){return Wn("setAccessToken",Vu,[e],(function(e){var t=e;In.setAccessToken(t)}))}var Ku=[ki({url:mi().url()})];function Ju(e){return qu.apply(this,arguments)}function qu(){return qu=Me((function(e){return Ue(this,(function(t){return[2,Wn("openOutApp",Ku,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Ou(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qu.apply(this,arguments)}var Qu=[ki({count:vi().min(1).optional().default(1),sourceType:Yi.array(Yi.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Yi.enum(["back","front"]).default("front").optional()})];function Yu(e){return $u.apply(this,arguments)}function $u(){return $u=Me((function(e){return Ue(this,(function(t){return[2,Wn("chooseImage",Qu,[e],function(){var e=Me((function(e){var t,n,r,i;return Ue(this,(function(o){return t=e.sourceType||["album","camera"],n=e.cameraType||"front",r=e.count||1,(i=document.createElement("input")).type="file",i.multiple=r>1,i.accept="image/*",i.style.display="none",1===t.length&&t.includes("camera")&&(i.accept="front"===n?"zcamera/photo-frontfacing":"zcamera/photo-backfacing",i.capture="front"===n?"user":"environment"),[2,new Promise((function(e,t){i.addEventListener("change",(function(n){var i,o=(null==n||null===(i=n.target)||void 0===i?void 0:i.files)||[];if(o.length>r)t(new Error("You are only allowed to choose a maximum of ".concat(r," images at a time")));else{var a={filePaths:[],tempFiles:[]};Array.from(o).forEach((function(e){a.filePaths.push(URL.createObjectURL(e)),a.tempFiles.push({path:URL.createObjectURL(e),size:e.size})})),e(a)}})),document.body.appendChild(i),i.click()}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$u.apply(this,arguments)}var Xu=Me((function(){var e,t,n=arguments;return Ue(this,(function(r){return e=n.length>0&&void 0!==n[0]&&n[0],t=n.length>1&&void 0!==n[1]?n[1]:"Cho phép Zalo truy cập vào vị trí của thiết bị này?",[2,new Promise((function(n,r){En("GET_LOCATION",{silent_request:e,permission_description:t,forceUpdate:!0},{success:function(e){var t={};if(null==e?void 0:e.token)return t.token=null==e?void 0:e.token,n(t);r(bn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function ec(e){return tc.apply(this,arguments)}function tc(){return(tc=Me((function(e){return Ue(this,(function(t){return[2,Wn("getLocation",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,Xu()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({token:""})]:[2,Promise.reject(Ke("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var nc=[Yi.function().args(ki({data:Yi.any()})).returns(Yi.void())];function rc(t){return Wn("onCallbackData",nc,[t],(function(){!function(t){Jt.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var ic=function(){var e=Me((function(e){var t,n,r,i,o,a,s,u,c,l,d,p;return Ue(this,(function(f){switch(f.label){case 0:return e||(e=Xs()),"object"==typeof e&&((r=e.zmpOrderId||e.orderId)||(n=e.appTransID||e.apptransid||e.transId)),"string"==typeof e&&(i=Yt.getParameterByName("orderId",e),o=Yt.getParameterByName("appTransID",e)||Yt.getParameterByName("apptransid",e),n=i||o),a={headers:{authorization:"Bearer "}},[4,In.jumpAndGetToken()];case 1:return f.sent(),s=null===(t=In.miniProgramConfig)||void 0===t?void 0:t.jwt,a.headers.authorization="Bearer ".concat(s),u=new URL(J),c={orderId:r||"",transId:n||""},u.search=new URLSearchParams(c).toString(),[4,fetch(u.toString(),a)];case 2:return[4,f.sent().json()];case 3:if(!(l=f.sent()).data)throw bn.error.badRequest(l.msg);return d=l.data||{},p={err:l.err,msg:l.msg},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,qe({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),oc=function(){var t=Me((function(t,n,r,i,a,s,u){var c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,I,A,O,k;return Ue(this,(function(C){switch(C.label){case 0:c=o,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("mac",i),r&&l.append("desc",encodeURIComponent(r)),a&&(d=a,"object"==typeof a&&(d=JSON.stringify(a)),l.append("extradata",encodeURIComponent(d))),s&&(p=s,"object"==typeof s&&(p=JSON.stringify(s)),l.append("payload",encodeURIComponent(p))),u&&("string"==typeof u?(l.append("method",u),l.append("isCustom","false")):"object"==typeof u&&(l.append("method",u.id),l.append("isCustom",JSON.stringify(u.isCustom)))),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,In.jumpAndGetToken()];case 2:return C.sent(),m=null===(h=In.miniProgramConfig)||void 0===h?void 0:h.jwt,f.headers.authorization="Bearer ".concat(m),[4,fetch(H,Aa(qe({method:"POST"},f),{body:l}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw bn.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=v.data.messageToken||"",w=window.APP_VERSION,b=window.APP_ENV,T={miniAppId:c,orderId:y},E=v.data.method,P=v.data.isCustom,g&&(T.token=g),w&&(T.version=w),b&&(T.env=b),E&&(T.method=E),P&&(T.isCustom=P),S=Yt.encode(T),I=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),A=pn(),O=cn()&&A<742?"normal":"bottomSheet",Gt.enablePaymentDone=Jt.getInstance().eventNames().includes(e.Events.PaymentDone),[4,Qa(I,{style:O}).then((function(){var t=!1;Jt.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(Me((function(){var n;return Ue(this,(function(r){switch(r.label){case 0:return t?[3,2]:(Jt.getInstance().emit(e.Events.PaymentDone,y,{orderId:y}),[4,ic({zmpOrderId:y})]);case 1:(n=r.sent()).err>=0&&!n.isCustom&&Jt.getInstance().emit(e.Events.PaymentClose,n.err,Aa(qe({},n),{zmpOrderId:y})),r.label=2;case 2:return[2]}}))})),500)})),Jt.getInstance().once(e.Events.OpenApp,(function(){t=!0})),Jt.getInstance().once(e.Events.PaymentDone,(function(){t=!0,Gt.enablePaymentDone=!1}))}))];case 5:return C.sent(),[2,{orderId:y,messageToken:_}];case 6:throw k=C.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),ac=[ki({amount:Yi.union([mi(),vi()]),item:Yi.array(Yi.record(mi(),Yi.any())),desc:Yi.string(),mac:Yi.string(),extradata:Yi.any().optional(),payload:Yi.any().optional(),method:Yi.union([Yi.string(),Yi.object({id:Yi.string(),isCustom:Yi.boolean()})]).optional()})];function sc(e){return uc.apply(this,arguments)}function uc(){return uc=Me((function(e){return Ue(this,(function(t){return[2,Wn("createOrder",ac,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,oc(e.amount,e.item,e.desc,e.mac,e.extradata,e.payload,e.method)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Ke("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),uc.apply(this,arguments)}var cc=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),lc=function(){var e=Me((function(e,t,n,r,i){var o,a,s,u,c,l,d,p,f,h,m;return Ue(this,(function(v){switch(v.label){case 0:(o=new URLSearchParams).append("amount",e.toString()),t&&o.append("desc",encodeURIComponent(t)),n&&o.append("method",n),r&&o.append("transId",r),i&&o.append("mac",i),a={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},v.label=1;case 1:return v.trys.push([1,9,,10]),[4,In.jumpAndGetToken()];case 2:if(v.sent(),c=null===(s=In.miniProgramConfig)||void 0===s?void 0:s.jwt,a.headers.authorization="Bearer ".concat(c),!(null===(u=In.miniProgramConfig)||void 0===u?void 0:u.showConfirmToPayment))return[3,6];v.label=3;case 3:return v.trys.push([3,5,,6]),[4,cc()];case 4:return v.sent(),[3,6];case 5:throw l=v.sent(),console.error("Failed:",l),l;case 6:return[4,fetch(q,Aa(qe({method:"POST"},a),{body:o}))];case 7:return[4,v.sent().json()];case 8:if(!(d=v.sent()).data||0!==d.err)throw bn.error.badRequest(d.msg);return p=d.data.id,f=d.data.messageToken||"",h=d.data.transId||"",[2,{orderId:p,messageToken:f,transId:h}];case 9:throw m=v.sent(),console.log("Internal error"),m;case 10:return[2]}}))}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),dc=[ki({amount:Yi.union([Yi.string(),Yi.number()]),desc:Yi.string(),method:Yi.string(),transId:Yi.string().optional(),mac:Yi.string().optional()})];function pc(e){return fc.apply(this,arguments)}function fc(){return fc=Me((function(e){return Ue(this,(function(t){return[2,Wn("purchase",dc,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,lc(e.amount,e.desc,e.method,null==e?void 0:e.transId,null==e?void 0:e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Ke("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fc.apply(this,arguments)}var hc=function(){var e=Me((function(e,t){return Ue(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;En("MP_SELECT_PAYMENT_METHOD",{isBinding:i,channels:e,selectedMethod:t,forceUpdate:!0},{success:function(e){console.log(e),n(e)},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),mc=[ki({channels:Oi(ki({method:mi(),subMethod:mi().optional(),subInfo:mi().optional()})).optional(),selectedMethod:ki({method:mi(),subMethod:mi().optional()}).optional()}).optional()];function vc(e){return yc.apply(this,arguments)}function yc(){return yc=Me((function(e){return Ue(this,(function(t){return[2,Wn("selectPaymentMethod",mc,[e],function(){var e=Me((function(e){var t,n;return Ue(this,(function(r){switch(r.label){case 0:return Ve.isMp?(t=e.channels,n=e.selectedMethod,[4,hc(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Ke("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yc.apply(this,arguments)}var gc=[ki({data:Yi.union([mi(),Yi.record(mi(),mi().nullish())])})];function _c(e){return wc.apply(this,arguments)}function wc(){return wc=Me((function(e){return Ue(this,(function(t){return[2,Wn("checkTransaction",gc,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,ic(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Ke("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wc.apply(this,arguments)}var bc=function(){var t=Me((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,b,T;return Ue(this,(function(E){switch(E.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===Y&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===Q&&(h=e.ProrationMode.DEFERRED),f.append("utm",a||"default"),f.append("merchantTransId",s||""),f.append("prorationMode",h.toString()),f.append("appId",p),i&&f.append("method",i),m="",(null===(u=Ge())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Ge())||void 0===l||null===(d=l.platform)||void 0===d?void 0:d.isAndroid)&&(m="android"),f.append("os",m),f.append("productId",t),v={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},E.label=1;case 1:return E.trys.push([1,5,,6]),[4,In.jumpAndGetToken()];case 2:return E.sent(),g=null===(y=In.miniProgramConfig)||void 0===y?void 0:y.jwt,v.headers.authorization="Bearer ".concat(g),[4,fetch(K,Aa(qe({method:"POST"},v),{body:f}))];case 3:return[4,E.sent().json()];case 4:if(!(_=E.sent()).data||!_.data.store||0!==_.err)throw bn.error.createIAPOrderFailed(_.err);return w=_.data.store,b=_.data.orderId,[2,new Promise((function(e,t){En("IAP_REQUESTPAYMENT",qe({},w),{success:function(){e({orderId:b})},fail:function(e){t(e)}})}))];case 5:throw T=E.sent(),console.log("Internal error"),T;case 6:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),Tc=[ki({productId:mi(),payType:Yi.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Yi.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:mi().optional(),method:Yi.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:mi().optional()})];function Ec(e){return Pc.apply(this,arguments)}function Pc(){return Pc=Me((function(e){return Ue(this,(function(t){return[2,Wn("createOrderIAP",Tc,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,bc(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Ke("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pc.apply(this,arguments)}var Sc=[ki({hide:_i().default(!1).optional()}).optional()];function Ic(e){return Ac.apply(this,arguments)}function Ac(){return Ac=Me((function(e){return Ue(this,(function(t){return[2,Wn("setAndroidBottomNavigationBar",Sc,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Xi.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ac.apply(this,arguments)}var Oc=[ki({hide:_i().default(!1).optional()}).optional()];function kc(e){return Cc.apply(this,arguments)}function Cc(){return Cc=Me((function(e){return Ue(this,(function(t){return[2,Wn("setIOSBottomSafeArea",Oc,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Xi.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Cc.apply(this,arguments)}var Nc=[ki({type:Yi.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Yi.string().optional()}).optional()];function Mc(e){return Rc.apply(this,arguments)}function Rc(){return Rc=Me((function(e){return Ue(this,(function(t){return[2,Wn("setStatusBar",Nc,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Xi.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Rc.apply(this,arguments)}var xc=[ki({headerTextColor:Yi.enum(["black","white"]).optional(),headerColor:Yi.string().optional(),actionBar:ki({hide:Yi.boolean().optional(),title:Yi.string().optional(),leftButton:Yi.enum(["back","none"]).optional(),textAlign:Yi.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Yi.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Yi.boolean().optional(),hideIOSSafeAreaBottom:Yi.boolean().optional()})];function Dc(e){return Lc.apply(this,arguments)}function Lc(){return Lc=Me((function(e){return Ue(this,(function(t){return[2,Wn("configAppView",xc,[e],function(){var e=Me((function(e){var t,n,r,i,o,a,s;return Ue(this,(function(u){switch(u.label){case 0:return Ve.isMp?Mt.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Xi.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return Mt.isUndefined(null===(n=e.actionBar)||void 0===n?void 0:n.title)||!(null===(r=e.actionBar)||void 0===r?void 0:r.title)?[3,4]:[4,Xi.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Xi.configHeader({hideActionBar:null===(i=e.actionBar)||void 0===i?void 0:i.hide,statusBarType:e.statusBarType,headerTextColor:e.headerTextColor,headerColor:e.headerColor,textAlign:null===(o=e.actionBar)||void 0===o?void 0:o.textAlign})];case 5:u.sent(),u.label=6;case 6:return u.trys.push([6,11,,12]),"boolean"!=typeof e.hideAndroidBottomNavigationBar?[3,8]:[4,Xi.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Xi.setIOSBottomSafeArea(e.hideIOSSafeAreaBottom)];case 9:u.sent(),u.label=10;case 10:return[3,12];case 11:return u.sent(),[3,12];case 12:return[2];case 13:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Lc.apply(this,arguments)}var Uc=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function jc(e){return Bc.apply(this,arguments)}function Bc(){return(Bc=Me((function(e){return Ue(this,(function(t){return[2,Wn("minimizeApp",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,Uc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Zc=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function zc(e){return Wc.apply(this,arguments)}function Wc(){return(Wc=Me((function(e){return Ue(this,(function(t){return[2,Wn("openPermissionSetting",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,Zc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Fc=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Gc(e){return Vc.apply(this,arguments)}function Vc(){return(Vc=Me((function(e){return Ue(this,(function(t){return[2,Wn("favoriteApp",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,Fc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Hc=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Kc(e){return Jc.apply(this,arguments)}function Jc(){return(Jc=Me((function(e){return Ue(this,(function(t){return[2,Wn("openGroupList",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,Hc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var qc=Me((function(){var e;return Ue(this,(function(t){switch(t.label){case 0:return[4,In.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){En("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function Qc(e){return Yc.apply(this,arguments)}function Yc(){return(Yc=Me((function(e){return Ue(this,(function(t){return[2,Wn("requestSendNotification",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,qc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var $c=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Xc(e){return el.apply(this,arguments)}function el(){return(el=Me((function(e){return Ue(this,(function(t){return[2,Wn("addRating",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,$c()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ke("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var tl,nl=(tl=Me((function(e,t,n){var r,i;return Ue(this,(function(o){switch(o.label){case 0:return(r=new URLSearchParams).append("appId",t),r.append("accessToken",n),r.append("oaId",e),i={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CHECK_INTERACT_OA,qe({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return tl.apply(this,arguments)}),rl=function(){var e=Me((function(e){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("MP_INTERACT_OA",{oaId:e,forceUpdate:!0},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),il=[ki({oaId:mi()})];function ol(e){return al.apply(this,arguments)}function al(){return al=Me((function(e){return Ue(this,(function(t){return[2,Wn("interactOA",il,[e],function(){var e=Me((function(e){var t,n,r;return Ue(this,(function(i){switch(i.label){case 0:return Ve.isMp?(t=e.oaId,[4,In.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||Mt.isEmpty(n)?[3,3]:[4,nl(t,o,n)];case 2:if(0===(null==(r=i.sent())?void 0:r.err))return[2,Promise.resolve({})];i.label=3;case 3:return[4,rl(t)];case 4:return[2,i.sent()];case 5:return Ve.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ke("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),al.apply(this,arguments)}var sl=[ki({oaId:mi()})];function ul(e){return cl.apply(this,arguments)}function cl(){return cl=Me((function(e){return Ue(this,(function(t){return[2,Wn("isAllowedInteractWithOA",sl,[e],function(){var e=Me((function(e){var t,n,r;return Ue(this,(function(i){switch(i.label){case 0:return Ve.isMp?(t=e.oaId,[4,In.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||Mt.isEmpty(n)?[3,3]:[4,nl(t,o,n)];case 2:return r=i.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return Ve.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Ke("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cl.apply(this,arguments)}function ll(e){return dl.apply(this,arguments)}function dl(){return(dl=Me((function(e){return Ue(this,(function(t){return[2,Wn("getSetting",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,_n()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Ke("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var pl=Yi.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber","scope.userFriends"]),fl=[ki({scopes:Yi.array(pl).max(2).optional()}).optional()];function hl(e){return ml.apply(this,arguments)}function ml(){return ml=Me((function(e){return Ue(this,(function(t){return[2,Wn("authorize",fl,[e],function(){var e=Me((function(e){var t;return Ue(this,(function(n){switch(n.label){case 0:return Ve.isMp?(t=null==e?void 0:e.scopes,fn(724,573)?[4,Pn(null!=t?t:void 0)]:[3,2]):[3,3];case 1:return[2,n.sent()];case 2:return[2,Promise.reject(bn.error.clientNotSupport())];case 3:return Ve.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ke("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ml.apply(this,arguments)}var vl=Me((function(){return Ue(this,(function(e){return[2,new Promise(function(){var e=Me((function(e,t){var n;return Ue(this,(function(r){switch(r.label){case 0:return Mt.isUndefined(ZaloJavaScriptInterface)||"function"!=typeof ZaloJavaScriptInterface.checkCameraPermission?[3,2]:[4,ZaloJavaScriptInterface.checkCameraPermission()];case 1:return n=r.sent(),[2,e({userAllow:"grant"===n})];case 2:return t(bn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function yl(e){return Wn("checkZaloCameraPermission",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return[4,vl()];case 1:return[2,e.sent()]}}))})))}var gl=Me((function(){return Ue(this,(function(e){return[2,new Promise(function(){var e=Me((function(e,t){var n,r,i;return Ue(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,In.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=In.miniProgramConfig)||void 0===n?void 0:n.userId,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function _l(e){return wl.apply(this,arguments)}function wl(){return(wl=Me((function(e){return Ue(this,(function(t){return[2,Wn("getUserID",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,gl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ke("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var bl=Me((function(){return Ue(this,(function(e){return[2,new Promise(function(){var e=Me((function(e,t){var n,r,i;return Ue(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,In.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=In.miniProgramConfig)||void 0===n?void 0:n.idToken,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Tl(e){return El.apply(this,arguments)}function El(){return(El=Me((function(e){return Ue(this,(function(t){return[2,Wn("getIDToken",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,bl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ke("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Pl={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},Sl={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},Il=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;Rt(this,t),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(c.haveVideoStream()&&c._userRequestFrameCallback){var t=c.getCanvas();if(c.drawFrame(),t){var n={data:t.toDataURL(e.PhotoFormat.PNG),width:t.width,height:t.height};Jt.getInstance().emit(e.CameraEvents.OnFrameCallback,0,n),requestAnimationFrame(c.tick)}}},this._videoElement=n,this._mediaConstraints=null!=u?u:null,this._facingMode=null!==(r=null==u?void 0:u.facingMode)&&void 0!==r?r:Sl.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(i=null==u?void 0:u.deviceId)&&void 0!==i?i:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(o=null==u?void 0:u.mirrored)&&void 0!==o?o:Sl.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:Sl.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:Sl.video}var n=t.prototype;return n.on=function(t,n){Jt.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){Jt.getInstance().off(t),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!1)},n.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},n.getFacingMode=function(){return this._facingMode},n.getCameraList=function(){return this._cameraList},n.getCameraCount=function(){return this._cameraList.length},n.getSelectedDeviceId=function(){return this._selectedDeviceId},n.setDeviceId=function(e){var t=this;return Me((function(){return Ue(this,(function(n){switch(n.label){case 0:return t._selectedDeviceId=e,t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},n.updateMediaConstraints=function(e){var t=this;return Me((function(){var n,r,i,o,a,s;return Ue(this,(function(u){switch(u.label){case 0:return Mt.isEmpty(e)?[2]:JSON.stringify(e)!==JSON.stringify(t._mediaConstraints)?(t._mediaConstraints=e,t._facingMode=null!==(n=null==e?void 0:e.facingMode)&&void 0!==n?n:t._facingMode,t._selectedDeviceId=null!==(r=null==e?void 0:e.deviceId)&&void 0!==r?r:t._selectedDeviceId,t._mirror=null!==(i=null==e?void 0:e.mirrored)&&void 0!==i?i:t._mirror,t._audioEnabled=null!==(o=null==e?void 0:e.audio)&&void 0!==o?o:t._audioEnabled,t._videoEnabled=null!==(a=null==e?void 0:e.video)&&void 0!==a?a:t._videoEnabled,t._selectedDeviceId=null!==(s=null==e?void 0:e.deviceId)&&void 0!==s?s:t._selectedDeviceId,t._hasUserMedia?[4,t.stream()]:[3,2]):[2];case 1:u.sent(),u.label=2;case 2:return[2]}}))}))()},n.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||Sl.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||Sl.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},n.selectCamera=function(){var t=!0,n=!1,r=void 0;try{for(var i,o=this._cameraList[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(this._facingMode==e.FacingMode.FRONT&&a.label.toLowerCase().includes("front")||this._facingMode==e.FacingMode.BACK&&a.label.toLowerCase().includes("back")){this._selectedDeviceId=a.deviceId;break}}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}},n.flip=function(){var t=this;return Me((function(){return Ue(this,(function(n){switch(n.label){case 0:return t._facingMode=t._facingMode==e.FacingMode.FRONT?e.FacingMode.BACK:e.FacingMode.FRONT,t._videoElement.style.transform="",t.selectCamera(),t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.start=function(){var t=this;return Me((function(){var n,r;return Ue(this,(function(i){return n=Jt.getInstance(),r=function(e){try{t._hasUserMedia&&t.stop()}catch(e){}},n.off(e.Events.AppPaused,r),n.on(e.Events.AppPaused,r),[2,new Promise(function(){var n=Me((function(n,r){var i;return Ue(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),Jt.getInstance().emit(e.CameraEvents.OnStartCallback,0),n(t._selectedDeviceId),[3,3];case 2:return i=o.sent(),r(i),[3,3];case 3:return[2]}}))}));return function(e,t){return n.apply(this,arguments)}}())]}))}))()},n.info=function(){var e=this;return Me((function(){return Ue(this,(function(t){return[2,new Promise((function(t,n){navigator.mediaDevices.enumerateDevices().then((function(n){e.getVideoInputs(n),t(e._cameraList)})).catch((function(e){n(e)}))}))]}))}))()},n.stream=function(){var e=this;return Me((function(){return Ue(this,(function(t){return[2,new Promise((function(t,n){try{e._stop();var r=e.getCurrentMediaConstraints();if(!1===r.video&&!r.audio)return void t(e._facingMode);navigator.mediaDevices.getUserMedia(r).then(function(){var n=Me((function(n){return Ue(this,(function(r){switch(r.label){case 0:return[4,e.info()];case 1:return r.sent(),e.selectCamera(),e.handleUserMedia(null,n),t(e._facingMode),[2]}}))}));return function(e){return n.apply(this,arguments)}}()).catch((function(t){e.handleUserMedia(t),n(t)}))}catch(e){n(e)}}))]}))}))()},n.handleUserMedia=function(t,n){var r=this;if(!t&&n){this._stream=n;try{this._videoElement&&(this._videoElement.srcObject=n,(this._facingMode==e.FacingMode.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){r._userRequestFrameCallback&&r.tick()},this._videoElement.play().then((function(){r._hasUserMedia=!0})).catch((function(e){r._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},n.updateTrackEnable=function(t,n){var r=this;return Me((function(){return Ue(this,(function(i){switch(i.label){case 0:if(t===e.StreamType.VIDEO){if(r._videoEnabled===n)return[2];r._videoEnabled=n}else{if(r._audioEnabled===n)return[2];r._audioEnabled=n}return[4,r.stream()];case 1:return i.sent(),[2]}}))}))()},n.pause=function(e){var t=this;return Me((function(){return Ue(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},n.resume=function(e){var t=this;return Me((function(){return Ue(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},n.isUsing=function(){return this._hasUserMedia},n.stop=function(){this._stop(),Jt.getInstance().emit(e.CameraEvents.OnStopCallback,0)},n._stop=function(){t.stopMediaStream(this._stream),this._hasUserMedia=!1},n.setFacingMode=function(e){this._facingMode=e},n.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},n.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||Pl.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},n.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},n.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},n.drawFrame=function(t){var n=this._videoElement,r=t||{};if(n&&this._ctx&&this._canvasElement){var i=this._canvasElement,o=this._ctx;i.width=(null==r?void 0:r.width)||i.width,i.height=(null==r?void 0:r.height)||i.height,((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.translate(i.width,0),o.scale(-1,1)),o.drawImage(n,0,0,i.width,i.height),((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.scale(-1,1),o.translate(-i.width,0))}},t.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},t}(),Al=ki({play:Yi.function(),pause:Yi.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),Ol=[ki({videoElement:Al,mediaConstraints:Yi.object({width:Yi.number().min(100).optional(),height:Yi.number().min(100).optional(),facingMode:Yi.string().optional(),audio:Yi.boolean().optional(),video:Yi.boolean().optional(),deviceId:Yi.string().optional(),mirrored:Yi.boolean().optional()}).nullish()}).optional()];function kl(e){return Wn("createCameraContext",Ol,[e],(function(e){return new Il(e.videoElement,e.mediaConstraints)}))}var Cl=function(){function e(){var t,n;Rt(this,e),this.sdkLoaded=!1,this.queue=[];var r=window.AdtimaZMA={config:{cateId:null===(t=window.zmpGlobal)||void 0===t||null===(n=t.appInfo)||void 0===n?void 0:n.cateType,appId:window.APP_ID},queue:[],load:function(e,t){r.queue=Le(r.queue).concat([[e,t]])}}}var t=e.prototype;return t.loadSDK=function(){var e=this,t=document.createElement("script");t.src="https://adtima-static.zascdn.me/resource/js/zma/sdk.js?q=".concat(Math.floor((new Date).getTime()/864e5)),t.onload=function(){e.sdkLoaded=!0,e.processQueue()},t.onerror=function(){e.sdkLoaded=!0},document.body.appendChild(t)},t.load=function(e,t){var n;Mt.isFunction(null===(n=window.AdtimaZMA)||void 0===n?void 0:n.load)&&window.AdtimaZMA.load(e,t)},t.display=function(e){var t;this.sdkLoaded?Mt.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.display)&&window.AdtimaZMA.display(e):this.queue.push(this.display.bind(this,e))},t.refresh=function(e){var t;this.sdkLoaded?Mt.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.refresh)&&window.AdtimaZMA.refresh(e):this.queue.push(this.refresh.bind(this,e))},t.processQueue=function(){for(;this.queue.length>0;){var e=this.queue.shift();e&&e()}},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}();function Nl(e){return Ml.apply(this,arguments)}function Ml(){return(Ml=Me((function(e){return Ue(this,(function(t){return[2,Wn("setupAd",[],[e],(function(){return Cl.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var Rl=[ki({ids:Yi.union([Yi.string(),Yi.array(Yi.string())]),config:ki({display:Yi.boolean().optional(),onClose:Yi.function().optional()}).optional()})];function xl(e){return Dl.apply(this,arguments)}function Dl(){return Dl=Me((function(e){return Ue(this,(function(t){return[2,Wn("loadAd",Rl,[e],function(){var e=Me((function(e){return Ue(this,(function(t){return Cl.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Dl.apply(this,arguments)}var Ll=[ki({id:Yi.string()})];function Ul(e){return jl.apply(this,arguments)}function jl(){return jl=Me((function(e){return Ue(this,(function(t){return[2,Wn("displayAd",Ll,[e],function(){var e=Me((function(e){return Ue(this,(function(t){return Cl.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),jl.apply(this,arguments)}var Bl=[ki({id:Yi.string().optional()}).optional()];function Zl(e){return zl.apply(this,arguments)}function zl(){return zl=Me((function(e){return Ue(this,(function(t){return[2,Wn("refreshAd",Bl,[e],function(){var e=Me((function(e){return Ue(this,(function(t){return Cl.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zl.apply(this,arguments)}var Wl,Fl=[ki({id:mi(),guidingText:mi().optional(),color:mi().optional(),onStatusChange:Yi.function().optional(),onError:Yi.function().optional()}).catchall(Yi.any())];function Gl(e){return Vl.apply(this,arguments)}function Vl(){return Vl=Me((function(e){return Ue(this,(function(n){return[2,Wn("showOAWidget",Fl,[e],function(){var e=Me((function(e){var n,r,i,o,a,s,u,c;return Ue(this,(function(l){if(Ve.isMp){try{n=document.getElementById(e.id),r=e.onStatusChange,i=e.guidingText,o=e.color,a=t(e,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="ifOAW-".concat(e.id,"-").concat(Date.now()),(c=new URL(ke.OA)).searchParams.set("id",u),c.searchParams.set("appId",window.APP_ID),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=Qe(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.removeEventListener("message",Wl,!1),Wl=function(){var e=Me((function(e){var t,n,i,o,a,s,l,d;return Ue(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith(Oe)?(n=document.getElementById(u),i=t.type,(o=new URL(t.href)).origin!==c.origin||o.pathname!==c.pathname||t.id!==u?[3,3]:"followOA"!==i&&"getOAInfo"!==i?[3,2]:[4,In.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=In.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},Oe),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?_a(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",Wl,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("showOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vl.apply(this,arguments)}var Hl,Kl="showFunctionButtonWidget",Jl=[Yi.object({id:Yi.string(),type:Yi.string(),text:Yi.string(),color:Yi.string().optional(),disabled:Yi.boolean().optional(),onDataReceived:Yi.function().optional(),onError:Yi.function().optional()}).catchall(Yi.any())],ql=function(e){if(hn(e,vn))return new vn(e.code,e.message,Kl,e.detail);if(hn(e,Error))return new vn(m,e.message,Kl);if("object"==typeof e&&null!==e&&"code"in e&&"message"in e&&"number"==typeof e.code&&("string"==typeof(n=e.message)||Array.isArray(n)&&n.every((function(e){return"string"==typeof e})))){var t=e;return new vn(t.code,t.message,Kl,t.detail)}var n;return"string"==typeof e?new vn(m,e,Kl):new vn(m,O,Kl,e)};function Ql(e){return Yl.apply(this,arguments)}function Yl(){return Yl=Me((function(e){return Ue(this,(function(n){return[2,Wn(Kl,Jl,[e],function(){var e=Me((function(e){var n,r,i,o,a,s,u,c;return Ue(this,(function(l){if(Ve.isMp){try{n=document.getElementById(e.id),r=e.onDataReceived,i=e.onError,o=t(e,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="ifFBW-".concat(e.id,"-").concat(Date.now()),(u=new URL(ke.FUNCTION_BUTTON)).searchParams.set("id",s),u.searchParams.set("appId",window.APP_ID),Object.entries(o).forEach((function(e){var t=Qe(e,2),n=t[0],r=t[1];r&&u.searchParams.set("data-".concat(n),String(r))})),a.id=s,a.src=u.href,a.style.width="100%",a.style.height="100%",a.style.border="none",Object.entries(o).forEach((function(e){var t=Qe(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.removeEventListener("message",Hl,!1),Hl=function(){var e=Me((function(e){var t,n,a,c,l,d,p,f,h,m,v,y,g,_,w;return Ue(this,(function(b){switch(b.label){case 0:if(t=e.data,!e.origin.startsWith(Oe))return[3,6];if("object"!=typeof t||null===t)return[2];if(n=document.getElementById(s),a=t.type,"string"!=typeof t.href)return[2];try{c=new URL(t.href)}catch(e){return null==i||i(ql(e)),[2]}if(c.origin!==u.origin||c.pathname!==u.pathname||t.id!==s)return[3,6];if("buttonClicked"!==a)return[3,5];b.label=1;case 1:return b.trys.push([1,3,,4]),[4,In.jumpAndGetToken()];case 2:return b.sent(),f=null===(l=In.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=In.miniProgramConfig)||void 0===d?void 0:d.encryptKey,null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h}},Oe),[3,4];case 3:return m=b.sent(),null==i||i(ql(m)),[3,4];case 4:return[3,6];case 5:if("onSuccess"===a){if((null==(v=t.payload)?void 0:v.type)===o.type){if("string"!=typeof(y=null==v?void 0:v.data))return null==i||i(ql("Invalid function button widget response")),[2];g={callAction:function(e,t){var r;null==n||null===(r=n.contentWindow)||void 0===r||r.postMessage({type:"context.callAction",payload:{actionName:e,actionData:t}},Oe)}},null==r||r(y,o.type,g)}}else"onError"===a&&(null==(_=t.payload)?void 0:_.type)===o.type&&(null==i||i(ql(null!==(w=null==_?void 0:_.data)&&void 0!==w?w:"Function button widget failed")));b.label=6;case 6:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",Hl,!1))}catch(t){null===(c=e.onError)||void 0===c||c.call(e,ql(t))}return[2,Promise.resolve()]}return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("showFunctionButtonWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yl.apply(this,arguments)}var $l=function(){var t=Me((function(t,n){var r,i,o=arguments;return Ue(this,(function(a){return r=o.length>2&&void 0!==o[2]&&o[2],i={},"cccd"===t&&(i={mrz:null==n?void 0:n.mrz}),[2,new Promise((function(n,o){En("SCAN_NFC",{type:e.ScanNFCType[t],data:i,skip_active_authen:r},{success:function(e){if("cccd"===t){var r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P={dg1:null!==(r=e.dg1)&&void 0!==r?r:"",dg2:null!==(i=e.dg2)&&void 0!==i?i:"",dg3:null!==(o=e.dg3)&&void 0!==o?o:"",dg4:null!==(a=e.dg4)&&void 0!==a?a:"",dg5:null!==(s=e.dg5)&&void 0!==s?s:"",dg6:null!==(u=e.dg6)&&void 0!==u?u:"",dg7:null!==(c=e.dg7)&&void 0!==c?c:"",dg8:null!==(l=e.dg8)&&void 0!==l?l:"",dg9:null!==(d=e.dg9)&&void 0!==d?d:"",dg10:null!==(p=e.dg10)&&void 0!==p?p:"",dg11:null!==(f=e.dg11)&&void 0!==f?f:"",dg12:null!==(h=e.dg12)&&void 0!==h?h:"",dg13:null!==(m=e.dg13)&&void 0!==m?m:"",dg14:null!==(v=e.dg14)&&void 0!==v?v:"",dg15:null!==(y=e.dg15)&&void 0!==y?y:"",dg16:null!==(g=e.dg16)&&void 0!==g?g:"",com:null!==(_=e.com)&&void 0!==_?_:"",sod:null!==(w=e.sod)&&void 0!==w?w:"",challenge:null!==(b=e.challenge)&&void 0!==b?b:"",aAResult:null!==(T=e.aAResult)&&void 0!==T?T:"",eACCAResult:null!==(E=e.eACCAResult)&&void 0!==E?E:""};n(P)}else n({})},fail:function(e){o(e)}},{timeout:!1})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Xl=[ki({type:Yi.enum(["cccd"]),data:ki({mrz:mi().max(90)}),skip_active_authen:_i().optional().default(!1)})];function ed(e){return td.apply(this,arguments)}function td(){return td=Me((function(e){return Ue(this,(function(t){return[2,Wn("scanNFC",Xl,[e],function(){var e=Me((function(e){var t,n,r,i;return Ue(this,(function(o){switch(o.label){case 0:return Ve.isMp?fn(754,620)?(n=e.type,r=e.data,i=null!==(t=e.skip_active_authen)&&void 0!==t&&t,[4,$l(n,r,i)]):[3,2]:[3,3];case 1:return[2,o.sent()];case 2:return[2,Promise.reject(bn.error.clientNotSupport())];case 3:return Ve.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ke("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),td.apply(this,arguments)}var nd=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function rd(e){return id.apply(this,arguments)}function id(){return(id=Me((function(e){return Ue(this,(function(t){return[2,Wn("checkNFC",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,nd()]:[3,2];case 1:return[2,e.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ke("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}var od=[Yi.string().trim().min(1)];var ad=[Yi.string().trim().min(1),Yi.string().trim()];var sd=[Yi.string().trim().min(1)];var ud={getItem:function(e){return Wn("getItem",od,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ve.isMp||Ve.isMpWeb){if(fn(757,625))return Mo.getItem(t[0]);throw bn.error.clientNotSupport()}throw Ke("getItem",{})}))},setItem:function(e,t){return Wn("setItem",ad,[e,t],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ve.isMp||Ve.isMpWeb){if(fn(757,625))return Mo.setItem(t[0],t[1]);throw bn.error.clientNotSupport()}throw Ke("setItem",{})}))},clear:function(){return Wn("clear",[],[],(function(){if(Ve.isMp||Ve.isMpWeb){if(fn(757,625))return Mo.clearStorageSync();throw bn.error.clientNotSupport()}throw Ke("clear",{})}))},removeItem:function(e){return Wn("removeItem",sd,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ve.isMp||Ve.isMpWeb){if(fn(757,625))return Mo.removeItem(t[0]);throw bn.error.clientNotSupport()}throw Ke("removeItem",{})}))},getStorageInfo:function(){return Wn("getStorageInfoSync",[],[],(function(){if(Ve.isMp||Ve.isMpWeb){if(fn(757,625))return Mo.getStorageInfoSync();throw bn.error.clientNotSupport()}throw Ke("getStorageInfoSync",{})}))}},cd=function(){var e=Me((function(e,t,n){var r,i;return Ue(this,(function(a){switch(a.label){case 0:return[4,qa(o,0)];case 1:return r=a.sent(),i=JSON.stringify({qrContent:n,merchantLogo:r.logoUrl,merchantName:r.name,orderDescription:t,amount:e}),[2,new Promise((function(e,t){En("MP_OPEN_ZINSTANTVIEW",{viewId:"4f9f9b4ba70e4e50171f",payload:{bundle_data:i,typeView:3,clearBackground:!0,occupyStatusBar:!0,disableSlideToBack:!0,disableBack:!1}},{success:function(n){console.log(n);try{n&&"string"==typeof n?(r=JSON.parse(n),(i=r&&r.act_type?r.act_type:null)&&Ce.includes(i)?e({status:i}):t("Unknown action or checkout failed")):t("Invalid format response data")}catch(e){t(e)}var r,i},fail:function(e){t(e)}},{})}))]}}))}));return function(t,n,r){return e.apply(this,arguments)}}(),ld=[ki({amount:Yi.union([Yi.string(),Yi.number()]),orderDescription:Yi.string(),qrContent:Yi.string()})];function dd(){return dd=Me((function(e){return Ue(this,(function(t){return[2,Wn("openCheckoutPopup",ld,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,cd(e.amount,e.orderDescription,e.qrContent)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ke("openCheckoutPopup",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),dd.apply(this,arguments)}var pd={purchase:pc,createOrder:sc,checkTransaction:_c,createOrderIAP:Ec,selectPaymentMethod:vc,openCheckoutPopup:function(e){return dd.apply(this,arguments)}},fd=pd,hd=function(){var e=Me((function(e,t,n){var r;return Ue(this,(function(i){return r={},t?r={fileBase64Data:t}:e&&(r={fileUrl:e}),[2,new Promise((function(e,t){En("SAVE_FILE",Aa(qe({},r),{onProgress:n}),{success:function(t){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),md=[ki({url:Yi.string().url().optional(),fileBase64Data:Yi.string().max(7e6).optional()}).optional()];function vd(e){return yd.apply(this,arguments)}function yd(){return yd=Me((function(e){return Ue(this,(function(t){return[2,Wn("downloadFile",md,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,hd(e.url,e.fileBase64Data,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("downloadFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yd.apply(this,arguments)}var gd=Yi.enum(["APP_INITIALIZING","APP_READY"]),_d=Yi.any();var wd,bd={logEvent:function(e,t){return Wn("logEvent",[gd,_d],[e,t],(function(e,t){if(Ve.isMp||Ve.isMpWeb){var n,r,i,o=Aa(qe({},"object"==typeof t&&null!==t?t:{}),{duration:Math.round(performance.now()),timestamp:Date.now()});return null===window||void 0===window||null===(n=window.zmpGlobal)||void 0===n||null===(r=n.eventManager)||void 0===r||null===(i=r.logEventForClient)||void 0===i||i.call(r,{type:p.DEV_TRACKING,eventCode:"APP_INITIALIZING"===e?f.APP_INITIALIZING:f.APP_READY}),sn([{action:"zmp.app.lifecycle.tracking",error:0,message:"",data:qe({eventType:e},o)}])}throw Ke("logEvent",{})}))}},Td=[ki({id:mi(),textColor:Yi.string().optional(),fontSize:Yi.string().optional(),buttonHeight:Yi.string().optional(),buttonColor:Yi.string().optional(),buttonTextColor:Yi.string().optional(),buttonRadius:Yi.string().optional(),buttonText:Yi.string().optional(),checkboxBGColor:Yi.string().optional(),checkboxCheckmarkColor:Yi.string().optional(),onClick:Yi.function().optional(),onStatusChange:Yi.function().optional(),onError:Yi.function().optional()}).catchall(Yi.any())];function Ed(e){return Pd.apply(this,arguments)}function Pd(){return Pd=Me((function(e){return Ue(this,(function(n){return[2,Wn("showCustomOAWidget",Td,[e],function(){var e=Me((function(e){var n,r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T;return Ue(this,(function(E){if(Ve.isMp){try{n=document.getElementById(e.id),r=e.textColor,i=e.fontSize,o=e.buttonHeight,a=e.buttonColor,s=e.buttonTextColor,u=e.buttonRadius,c=e.buttonText,l=e.checkboxBGColor,d=e.checkboxCheckmarkColor,p=e.onStatusChange,f=e.onClick,h=e.onError,m=t(e,["textColor","fontSize","buttonHeight","buttonColor","buttonTextColor","buttonRadius","buttonText","checkboxBGColor","checkboxCheckmarkColor","onStatusChange","onClick","onError"]),n&&(v=document.createElement("iframe"),y="ifCOAW-".concat(e.id,"-").concat(Date.now()),g=new URL(ke.CUSTOM_OA),_={id:y,appId:window.APP_ID,textColor:r,fontSize:i,buttonHeight:o,buttonColor:a,buttonTextColor:s,buttonRadius:u,buttonText:c,checkboxBGColor:l,checkboxCheckmarkColor:d},Object.entries(m).forEach((function(e){var t=Qe(e,2),n=t[0],r=t[1];r&&(_["data-".concat(n)]=String(r))})),w=JSON.stringify(_),P=w,S=(new TextEncoder).encode(P),I=Array.from(S).map((function(e){return String.fromCharCode(e)})).join(""),b=btoa(I),T=encodeURIComponent(b),Zn(g.searchParams,"data",T),v.id=y,v.src=g.href,v.style.width="100%",v.style.height="100%",v.style.border="none",n.innerHTML=v.outerHTML,window.removeEventListener("message",wd,!1),wd=function(){var e=Me((function(e){var t,n,r,i,o,a,s,u,c;return Ue(this,(function(l){switch(l.label){case 0:return t=e.data,e.origin.startsWith(Oe)?(n=document.getElementById(y),r=t.type,(i=new URL(t.href)).origin!==g.origin||i.pathname!==g.pathname||t.id!==y?[3,3]:"followOA"!==r&&"getOAInfo"!==r?[3,2]:[4,In.jumpAndGetToken()]):[3,3];case 1:return l.sent(),s=null===(o=In.miniProgramConfig)||void 0===o?void 0:o.jwt,null==n||null===(a=n.contentWindow)||void 0===a||a.postMessage({type:r,payload:{jwt:s}},Oe),[3,3];case 2:"oaInfo"===r?null==p||p(null===(u=t.payload)||void 0===u?void 0:u.followed):"openOA"===r?_a(t.payload.id,"oa"):"heightChange"===r?n.style.height="".concat(t.payload,"px"):"onClick"===r?null==f||f(null===(c=t.payload)||void 0===c?void 0:c.status):"onError"===r&&(null==h||h(t.payload)),l.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",wd,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}var P,S,I;return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("showCustomOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pd.apply(this,arguments)}var Sd,Id=[ki({id:mi(),onMethodChange:Yi.function().optional()}).catchall(Yi.any())];function Ad(){return Ad=Me((function(e){return Ue(this,(function(n){return[2,Wn("showWidget",Id,[e],function(){var e=Me((function(e){var n,r,i,o,a,s,u,c,l,d,p,f;return Ue(this,(function(h){if(Ve.isMp){try{n=document.getElementById(e.id),r=e.onMethodChange,i=e.fail,o=t(e,["onMethodChange","fail"]),n&&((a=document.getElementById(Ae))&&(null==a||null===(s=a.parentNode)||void 0===s||s.removeChild(a),a=null),a=document.createElement("iframe"),u=Ae,c=new URL(ke.CHECKOUT_KIT),l={id:u,appId:window.APP_ID},Object.entries(o).forEach((function(e){var t=Qe(e,2),n=t[0],r=t[1];r&&(l["data-".concat(n)]=r)})),d=JSON.stringify(l),p=btoa(d),f=encodeURIComponent(p),Zn(c.searchParams,"data",f),a.id=u,a.src=c.href,a.style.width="100%",a.style.height="100%",a.style.border="none",n.innerHTML=a.outerHTML,window.removeEventListener("message",Sd,!1),Sd=function(){var e=Me((function(e){var t,n,o,a,s,l,d,p,f,h;return Ue(this,(function(m){switch(m.label){case 0:if(t=e.data,!e.origin.startsWith(Oe))return[3,9];if(n=t.type,o=document.getElementById(u),(a=new URL(t.href)).origin!==c.origin||a.pathname!==c.pathname||t.id!==u)return[3,9];switch(n){case"getInfo":return[3,1];case"getToken":return[3,2];case"heightChange":return[3,4];case"callAction":return[3,5];case"onMethodChange":return[3,6];case"onError":return[3,7]}return[3,8];case 1:return zn(o,n,{appId:window.APP_ID,zaloVersion:pn(),appPlatform:null===(s=Ge())||void 0===s?void 0:s.platformName}),[3,9];case 2:return[4,In.jumpAndGetToken()];case 3:return m.sent(),d=null===(l=In.miniProgramConfig)||void 0===l?void 0:l.jwt,zn(o,n,{jwt:d}),[3,9];case 4:return o.style.height="".concat(t.payload,"px"),[3,9];case 5:return p=t.payload,f=p.actionName,h=p.actionData,String(f).length>0&&En(f,h,{success:function(e){zn(o,n,{status:0,actionName:f,data:e})},fail:function(e){zn(o,n,{status:-1,actionName:f,data:e})}},{}),[3,9];case 6:return null==r||r.apply(void 0,Le(Object.values(t.payload))),[3,9];case 7:null==i||i(t.payload),m.label=8;case 8:return[3,9];case 9:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",Sd,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("showWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ad.apply(this,arguments)}var Od,kd=[ki({amount:Yi.union([Yi.string(),Yi.number()]),desc:Yi.string(),payload:Yi.object({}).catchall(Yi.any()).optional()}).catchall(Yi.any())];function Cd(){return Cd=Me((function(e){return Ue(this,(function(n){return[2,Wn("purchase",kd,[e],function(){var e=Me((function(e){return Ue(this,(function(n){return Ve.isMp?[2,new Promise((function(n,r){var i=document.getElementById(Ae),o=new URL(ke.CHECKOUT_KIT);if(!(i&&hn(i,HTMLIFrameElement)&&i.src.startsWith(o.origin)&&i.src.includes(o.pathname)))return r(Ke("purchase",{message:"Widget not found or not initialized."}));e.amount,e.desc,e.payload;var a=t(e,["amount","desc","payload"]),s="purchase";zn(i,s,qe({amount:String(e.amount),desc:e.desc,payload:e.payload||{}},a)),window.removeEventListener("message",Od,!1),Od=function(){var e=Me((function(e){var t,i,a;return Ue(this,(function(u){if(t=e.data,e.origin.startsWith(Oe)&&(i=t.type,(a=new URL(t.href)).origin===o.origin&&a.pathname===o.pathname&&t.id===Ae)){if(i===s)return[2,n(t.payload)];if("onError"===i)return[2,r(t.payload)]}return[2]}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",Od,!1)}))]:Ve.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Ke("purchase",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Cd.apply(this,arguments)}var Nd={showWidget:function(e){return Ad.apply(this,arguments)},purchase:function(e){return Cd.apply(this,arguments)}},Md=function(){var e=Me((function(e){var t,n,r,i,o=arguments;return Ue(this,(function(a){return t=o.length>1&&void 0!==o[1]?o[1]:"",n=o.length>2&&void 0!==o[2]&&o[2],r=o.length>3&&void 0!==o[3]&&o[3],i=o.length>4&&void 0!==o[4]&&o[4],[2,new Promise((function(o,a){En("OPEN_DOCUMENT",{url:e,title:t,share:n,download:r,edit:i},{success:function(e){o()},fail:function(e){a(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Rd=[ki({url:mi(),title:mi().optional(),share:Yi.boolean().optional().default(!1),download:Yi.boolean().optional().default(!1),edit:Yi.boolean().optional().default(!1)})];function xd(e){return Dd.apply(this,arguments)}function Dd(){return Dd=Me((function(e){return Ue(this,(function(t){return[2,Wn("openDocument",Rd,[e],function(){var e=Me((function(e){var t;return Ue(this,(function(n){switch(n.label){case 0:return Ve.isMp?fn(25091842,666)?(t=!!(cn()&&pn()>=25111864)&&e.share,[4,Md(e.url,e.title,t,e.download,e.edit)]):[3,2]:[3,3];case 1:return[2,n.sent()];case 2:return[2,Promise.reject(bn.error.clientNotSupport())];case 3:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("openDocument",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Dd.apply(this,arguments)}function Ld(e){return Ud.apply(this,arguments)}function Ud(){return(Ud=Me((function(e){return Ue(this,(function(t){return[2,Wn("getEntrySource",[],[e],Me((function(){var e,t;return Ue(this,(function(n){switch(n.label){case 0:return Ve.isMp?[4,In.jumpAndGetToken()]:[3,2];case 1:return n.sent(),t=null===(e=In.miniProgramConfig)||void 0===e?void 0:e.srcOpen,[2,Promise.resolve({srcOpen:t||""})];case 2:return[2,Promise.resolve({srcOpen:""})]}}))})))]}))}))).apply(this,arguments)}var jd=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("GET_DEVICE_INFO",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Bd(e){return Zd.apply(this,arguments)}function Zd(){return(Zd=Me((function(e){return Ue(this,(function(t){return[2,Wn("getDeviceInfo",[],[e],Me((function(){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?fn(25102854,674)?[4,jd()]:[3,2]:[3,3];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(bn.error.clientNotSupport())];case 3:return Ve.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ke("getDeviceInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var zd=function(){var e=Me((function(e,t){return Ue(this,(function(n){return[2,new Promise((function(n,r){En("LFS_FILE_INFO",{file_path:e,digest_algorithm:t},{success:function(e){n(e)},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}();function Wd(){return Fd.apply(this,arguments)}function Fd(){return(Fd=Me((function(){return Ue(this,(function(e){return[2,Wn("isSupportLFS",[],[],Me((function(){return Ue(this,(function(e){return Ve.isMp?[2,Promise.resolve({support:fn(25112868,692)})]:Ve.isMpWeb?[2,Promise.resolve({support:!1})]:[2,Promise.reject(Ke("isSupportLFS",{}))]}))})))]}))}))).apply(this,arguments)}var Gd=[ki({filePath:Yi.string(),digestAlgorithm:Yi.enum(["sha1","md5"]).optional().default("md5")}).optional()];function Vd(){return Vd=Me((function(e){return Ue(this,(function(t){return[2,Wn("getFileInfo",Gd,[e],function(){var e=Me((function(e){var t;return Ue(this,(function(n){switch(n.label){case 0:return Ve.isMp?[4,Wd()]:[3,4];case 1:return n.sent().support?(t=e.digestAlgorithm||"md5",[4,zd(e.filePath,t)]):[3,3];case 2:return[2,n.sent()];case 3:throw bn.error.clientNotSupport();case 4:return Ve.isMpWeb?[2,Promise.resolve({size:"",digest:"",type:""})]:[2,Promise.reject(Ke("getFileInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vd.apply(this,arguments)}var Hd=Me((function(){return Ue(this,(function(e){return[2,new Promise((function(e,t){En("LFS_LIST",{},{success:function(t){var n=t.map((function(e){var t=qe({},e);try{t.filePath=t.file_path,t.createTime=t.created_time,delete t.file_path,delete t.created_time}catch(e){}return t}));e({list:n})},fail:function(e){t(e)}},{})}))]}))}));function Kd(){return Kd=Me((function(e){return Ue(this,(function(t){return[2,Wn("getSavedFileList",[],[e],function(){var e=Me((function(e){return Ue(this,(function(e){switch(e.label){case 0:return Ve.isMp?[4,Wd()]:[3,4];case 1:return e.sent().support?[4,Hd()]:[3,3];case 2:return[2,e.sent()];case 3:throw bn.error.clientNotSupport();case 4:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("getSavedFileList",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Kd.apply(this,arguments)}var Jd=function(){var e=Me((function(e){return Ue(this,(function(t){return[2,new Promise((function(t,n){En("LFS_FILE_REMOVE",{file_path:e},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),qd=[ki({filePath:Yi.string()}).optional()];function Qd(){return Qd=Me((function(e){return Ue(this,(function(t){return[2,Wn("removeSavedFile",qd,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Wd()]:[3,4];case 1:return t.sent().support?[4,Jd(e.filePath)]:[3,3];case 2:return[2,t.sent()];case 3:throw bn.error.clientNotSupport();case 4:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("removeSavedFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qd.apply(this,arguments)}var Yd=function(){var e=Me((function(e,t){var n;return Ue(this,(function(r){return n={file_path:e},[2,new Promise((function(e,r){En("LFS_FILE_SAVE",Aa(qe({},n),{onProgress:t}),{success:function(t){e({savedPath:t})},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),$d=[ki({filePath:Yi.string()}).optional()];function Xd(){return Xd=Me((function(e){return Ue(this,(function(t){return[2,Wn("saveFile",$d,[e],function(){var e=Me((function(e){return Ue(this,(function(t){switch(t.label){case 0:return Ve.isMp?[4,Wd()]:[3,4];case 1:return t.sent().support?[4,Yd(e.filePath,e.onProgress)]:[3,3];case 2:return[2,t.sent()];case 3:throw bn.error.clientNotSupport();case 4:return Ve.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ke("saveFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xd.apply(this,arguments)}var ep={getFileInfo:function(e){return Vd.apply(this,arguments)},getSavedFileList:function(e){return Kd.apply(this,arguments)},removeSavedFile:function(e){return Qd.apply(this,arguments)},saveFile:function(e){return Xd.apply(this,arguments)},isSupportLFS:Wd};window.ZaloMiniAppSDK={getVersion:qn},Fn();var tp=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},AppError:vn,login:Fn,getAccessToken:Vn,getVersion:qn,getSystemInfo:Yn,setNavigationBarTitle:to,setNavigationBarColor:io,setNavigationBarLeftButton:so,setStorage:xo,getStorage:Uo,getStorageInfo:Bo,removeStorage:Wo,clearStorage:Vo,getUserInfo:qo,getNetworkType:Xo,onNetworkStatusChange:na,startBeaconDiscovery:oa,stopBeaconDiscovery:ua,getBeacons:da,closeApp:ha,scanQRCode:ya,openProfile:ba,openChat:Sa,openPostFeed:Ca,followOA:xa,unfollowOA:ja,openShareSheet:Fa,requestCameraPermission:Ha,createShortcut:$a,openBioAuthentication:ns,checkStateBioAuthentication:os,showToast:cs,hideKeyboard:ps,openPhone:vs,openSMS:ws,viewOAQr:Ps,keepScreen:Os,onKeepScreen:Cs,offKeepScreen:Ms,saveImageToGallery:Ls,saveVideoToGallery:Zs,openMiniApp:Gs,vibrate:Js,openWebview:Ys,getRouteParams:eu,getAppInfo:tu,sendDataToPreviousMiniApp:ou,getPhoneNumber:uu,openProfilePicker:pu,connectWifi:vu,openMediaPicker:wu,getShareableLink:Eu,closeLoading:Iu,requestUpdateZalo:ku,onConfirmToExit:Ru,offConfirmToExit:xu,getDeviceId:Du,getDeviceIdAsync:Lu,getContext:ju,getContextAsync:Bu,getAuthCode:zu,getZPIToken:Fu,setAccessToken:Hu,openOutApp:Ju,chooseImage:Yu,getLocation:ec,onCallbackData:rc,createOrder:sc,purchase:pc,selectPaymentMethod:vc,checkTransaction:_c,createOrderIAP:Ec,events:Nu,setAndroidBottomNavigationBar:Ic,setIOSBottomSafeArea:kc,setStatusBar:Mc,configAppView:Dc,minimizeApp:jc,openPermissionSetting:zc,favoriteApp:Gc,openGroupList:Kc,requestSendNotification:Qc,addRating:Xc,interactOA:ol,interactOa:ol,isAllowedInteractWithOA:ul,getSetting:ll,authorize:hl,checkZaloCameraPermission:yl,getUserID:_l,getIDToken:Tl,createCameraContext:kl,setupAd:Nl,loadAd:xl,displayAd:Ul,refreshAd:Zl,showOAWidget:Gl,showFunctionButtonWidget:Ql,scanNFC:ed,checkNFC:rd,nativeStorage:ud,Payment:pd,CheckoutSDK:fd,downloadFile:vd,trackingManager:bd,showCustomOAWidget:Ed,CheckoutKit:Nd,openDocument:xd,getEntrySource:Ld,getDeviceInfo:Bd,LFSStorage:ep,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:Il}),np=t(tp,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]);!function(){var e,t=null===(e=Ge())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,tp))}(),e.AppError=vn,e.CheckoutKit=Nd,e.CheckoutSDK=fd,e.EventName=e.Events,e.LFSStorage=ep,e.Payment=pd,e.ZMACameraImp=Il,e.addRating=Xc,e.authorize=hl,e.checkNFC=rd,e.checkStateBioAuthentication=os,e.checkTransaction=_c,e.checkZaloCameraPermission=yl,e.chooseImage=Yu,e.clearStorage=Vo,e.closeApp=ha,e.closeLoading=Iu,e.configAppView=Dc,e.connectWifi=vu,e.createCameraContext=kl,e.createOrder=sc,e.createOrderIAP=Ec,e.createShortcut=$a,e.default=np,e.displayAd=Ul,e.downloadFile=vd,e.events=Nu,e.favoriteApp=Gc,e.followOA=xa,e.getAccessToken=Vn,e.getAppInfo=tu,e.getAuthCode=zu,e.getBeacons=da,e.getContext=ju,e.getContextAsync=Bu,e.getDeviceId=Du,e.getDeviceIdAsync=Lu,e.getDeviceInfo=Bd,e.getEntrySource=Ld,e.getIDToken=Tl,e.getLocation=ec,e.getNetworkType=Xo,e.getPhoneNumber=uu,e.getRouteParams=eu,e.getSetting=ll,e.getShareableLink=Eu,e.getStorage=Uo,e.getStorageInfo=Bo,e.getSystemInfo=Yn,e.getUserID=_l,e.getUserInfo=qo,e.getVersion=qn,e.getZPIToken=Fu,e.hideKeyboard=ps,e.interactOA=ol,e.interactOa=ol,e.isAllowedInteractWithOA=ul,e.keepScreen=Os,e.loadAd=xl,e.login=Fn,e.minimizeApp=jc,e.nativeStorage=ud,e.offConfirmToExit=xu,e.offKeepScreen=Ms,e.onCallbackData=rc,e.onConfirmToExit=Ru,e.onKeepScreen=Cs,e.onNetworkStatusChange=na,e.openBioAuthentication=ns,e.openChat=Sa,e.openDocument=xd,e.openGroupList=Kc,e.openMediaPicker=wu,e.openMiniApp=Gs,e.openOutApp=Ju,e.openPermissionSetting=zc,e.openPhone=vs,e.openPostFeed=Ca,e.openProfile=ba,e.openProfilePicker=pu,e.openSMS=ws,e.openShareSheet=Fa,e.openWebview=Ys,e.purchase=pc,e.refreshAd=Zl,e.removeStorage=Wo,e.requestCameraPermission=Ha,e.requestSendNotification=Qc,e.requestUpdateZalo=ku,e.saveImageToGallery=Ls,e.saveVideoToGallery=Zs,e.scanNFC=ed,e.scanQRCode=ya,e.selectPaymentMethod=vc,e.sendDataToPreviousMiniApp=ou,e.setAccessToken=Hu,e.setAndroidBottomNavigationBar=Ic,e.setIOSBottomSafeArea=kc,e.setNavigationBarColor=io,e.setNavigationBarLeftButton=so,e.setNavigationBarTitle=to,e.setStatusBar=Mc,e.setStorage=xo,e.setupAd=Nl,e.showCustomOAWidget=Ed,e.showFunctionButtonWidget=Ql,e.showOAWidget=Gl,e.showToast=cs,e.startBeaconDiscovery=oa,e.stopBeaconDiscovery=ua,e.trackingManager=bd,e.unfollowOA=ja,e.vibrate=Js,e.viewOAQr=Ps,Object.defineProperty(e,"__esModule",{value:!0})}));
24
+ ***************************************************************************** */}((function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],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})),Kt={enablePaymentDone:!1};function Jt(e){var t=e.data;return{orderId:t.zmpOrderId||t.orderId,transId:t.appTransID||t.apptransid||t.transId}}var qt="ACTION_CALLBACK";function Qt(t,n,r,i){switch(!0){case"string"==typeof r||null===r:return[{eventName:t,eventId:n,data:r}];case t===e.Events.OpenApp&&(null==i?void 0:i.enablePaymentDone):var o=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}(r.path);return[{eventName:e.Events.PaymentDone,eventId:n,data:o}];case t===e.Events.OnDataCallback:if(["PAY_BY_BANK","PAY_BY_CUSTOM_METHOD"].includes(null==r?void 0:r.eventType))return[{eventName:e.Events.OnDataCallback,eventId:n,data:r},{eventName:e.Events.PaymentDone,eventId:n,data:Jt(r)}];break;default:return[{eventName:t,eventId:n,data:r}]}}var Yt=function(t){Ft(r,t);var n=Gt(r);function r(){var e;return Lt(this,r),(e=n.apply(this,arguments)).debug=kt("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===qt||t===e.Events.PaymentCallback)return zt(Bt(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return zt(Bt(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===qt)return zt(Bt(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return zt(Bt(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}(Ht);function $t(e){Yt.getInstance().emit(qt,e)}function Xt(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){$t({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=kt("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=Rn(r);i("stringToData",a);var s=function(t,n){if(!n||"string"==typeof n)return 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),u=Qt(n,t,s,Kt);null==u||u.forEach((function(e){Yt.getInstance().emit(e.eventName,e.eventId,e.data);var t=document.getElementById(Ce);t&&Vn(t,"appEvent",{eventName:e.eventName,eventId:e.eventId,data:e.data})}))}},window.zaloNative2JS={nativeCall:function(t,n,r){Yt.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var en={encode:Xt,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:Xt(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var n=e.split("=");n&&2==n.length&&(t[n[0]]=decodeURIComponent(n[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e||void 0===e?"undefined":Ot(e)))return e;var t=Object.keys(e),n=[];return t.map((function(t){var r=e[t],i=[t,r="object"==(void 0===r||void 0===r?"undefined":Ot(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},tn={},nn=function(e,t,n){var r=t||"default";return function(){return(r in tn?tn[r](e,n):e).apply(this,arguments)}};nn.setWrapper=function(e){tn[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var rn={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function on(e){try{return null===e?rn:JSON.parse(e)}catch(e){return rn}}var an,sn={execute:function(e,t,n,r){n.suppress_http_code=1;var i=en.encode(n);"post"!=t&&(e=en.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=nn((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=nn((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(on(e.responseText))},o.onerror=function(e){e.responseText?r(on(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},un=sn,cn=(an=De((function(e,t,n){var r,i,o,a;return Ze(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},Dt.isUndefined(n)||(r.currentVersion=n),i=en.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,appId:e,zaloAppId:a.data.zaloAppId}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return an.apply(this,arguments)});function ln(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));un.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var dn=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},pn=function(){var e;return"android"===((null===(e=Ke())||void 0===e?void 0:e.platformName)||"").toLowerCase()},fn=function(){var e;return"ios"===((null===(e=Ke())||void 0===e?void 0:e.platformName)||"").toLowerCase()};function hn(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 mn=function(){var e,t=0;if(window.zaloVersionCode)return hn(window.zaloVersionCode);var n=Number((null===(e=Ke())||void 0===e?void 0:e.zaloVersion)||"0");return n>=24112e3?t=n:pn()?t=n%1e4:fn()&&(t=n),hn(t)};function vn(e,t){if(window.isAPISupport&&"function"==typeof window.isAPISupport)return window.isAPISupport(e,t);var n=mn();return pn()?n>=e:!!fn()&&n>=t}function yn(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var gn,_n=function(){function e(t,n,r,i){Lt(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}(),wn=function(e,t){return yn(e,_n)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return yn(e,Error)?new _n(m,e.message,t).toJSON():Dt.isEmpty(null==e?void 0:e.message)||Dt.isEmpty(null==e?void 0:e.code)?new _n(m,k,t,e).toJSON():new _n(e.code,e.message,t,e.detail).toJSON()}(e,t)},bn=(gn=De((function(e){var t;return Ze(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,$e({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return gn.apply(this,arguments)}),Tn=De((function(){return Ze(this,(function(e){return[2,new Promise(function(){var e=De((function(e,t){var n,r,i,o;return Ze(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,kn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=kn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new _n(g,M,"getSetting")),[4,bn(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new _n(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)}}())]}))})),En=function(){var t,n,r,i=Ke(),o={},a=Yt.getInstance(),s=[],u=!1;return u||(n=function(t){var n=t.serialId,r=xn(t.result),i=jn(null==r?void 0:r.action),u=Dt.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=Dt.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?Dt.isFunction(r)&&r(e):Dt.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),b="".concat(w.protocol,"//").concat(w.host).concat(w.pathname);_.data={url:b}}if("action.follow.oa"===p.action||"action.unfollow.oa"===p.action){var T=null==y?void 0:y.uid;_.data={uid:T}}if("action.open.chat"===p.action){var E=null==y?void 0:y.uId,P=null==y?void 0:y.type;_.data={uid:E,openChatType:P}}(null==y?void 0:y.onProgress)&&g&&a.off(e.Events.DownloadProgress,g)}catch(e){}s.push(_)}},Yt.getInstance().on(qt,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],ln(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],ln(e)}}),5e3),u=!0),r=De((function(t,n,r,s){var u,c,l,d,p,f,h,m,v,y,b,T,E,P,S,I,A,O,k,C,M,R,L;return Ze(this,(function(U){switch(U.label){case 0:return c=Math.floor(1e6*Math.random()),l="".concat(t,"_").concat(c),d=Wn(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 $t({serialId:l,result:{error_code:w,error_message:N,data:{timeout:f},action:t}}),null}),!0===f?8e3:1e3*f))),y?[4,Tn()]:[3,2];case 1:if(!1===(null==(T=U.sent())||null===(b=T.authSetting)||void 0===b?void 0:b["scope.userInfo"]))return $t({serialId:l,result:{error_code:g,error_message:D,data:{isMobile:null==i||null===(E=i.platform)||void 0===E?void 0:E.isMobile},action:t}}),[2];U.label=2;case 2:return P=jn(d),!(null==i||null===(u=i.platform)||void 0===u?void 0:u.isMobile)||!t||Dt.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!Mn(t)||P&&!1===P.isSupported?($t({serialId:l,result:{error_code:_,error_message:x,data:{isMobile:null==i||null===(S=i.platform)||void 0===S?void 0:S.isMobile},action:t}}),[2]):(I=Nn(n),m?[3,4]:[4,kn.getJSAccessToken()]);case 3:return O=U.sent(),[3,5];case 4:O="",U.label=5;case 5:A=O,U.label=6;case 6:return U.trys.push([6,10,,11]),m||!v?[3,8]:[4,kn.getAccessToken()];case 7:return C=U.sent(),[3,9];case 8:C="",U.label=9;case 9:return k=C,[3,11];case 10:return M=U.sent(),$t({serialId:l,result:{error_code:null==M?void 0:M.code,error_message:null==M?void 0:M.message,action:t}}),[2];case 11:try{n&&(null==n?void 0:n.onProgress)&&(R=function(e){!function(e,t){e.url;var n=e.progress;t&&t(n)}(e,null==n?void 0:n.onProgress)},o[l].downloadListener=R,a.on(e.Events.DownloadProgress,R))}catch(e){}return L=i.platform.isIOS?window.onNativeMessage(l,d):'window.onNativeMessage("'.concat(l,'", "').concat(d,'")'),[2,ZaloJavaScriptInterface.jsCall(A,d,k,I,L)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),Pn={success:function(e,t){return{code:h,message:t||O,data:e||{}}},error:{failLimit:function(){return new _n(b,C)},badRequest:function(e){return new _n(v,e)},loginFailed:function(e){return new _n(g,"".concat(R,": ").concat(e))},loginRequired:function(){return new _n(g,M)},cannotGetShareInfo:function(){return new _n(y,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(ae).find((function(t){return t===e.toString()}));return new _n(e,t||k)},clientNotSupport:function(){return new _n(_,x)}}},Sn=function(t){var n,r,i,o=null===(n=Ke())||void 0===n?void 0:n.platformName,a=zn(t.action),s=V[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new _n(m,"Can not get auth code: ".concat(t.error_message));if(kn.jumpStatus!==e.JumpStatus.DONE&&!u)return new _n(W.UNAUTHORIZED.code,W.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new _n(W.FORBIDDEN.code,W.FORBIDDEN.message);if(o&&(null===(r=G[o])||void 0===r?void 0:r[t.error_code]))return new _n(G[o][t.error_code].code,G[o][t.error_code].message);var l=null==c||null===(i=c[o])||void 0===i?void 0:i[String(t.error_code)];if(l){var d,p,f,h=null===(d=l.mapTo)||void 0===d?void 0:d.message;if(null==l?void 0:l.needMoreDetail)h="".concat(null==l||null===(f=l.mapTo)||void 0===f?void 0:f.message,": ").concat(t.error_message);return new _n(null===(p=l.mapTo)||void 0===p?void 0:p.code,h)}return new _n(t.error_code,t.error_message)},In=function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=Dt.isEmpty(t)?void 0:t[r];if(o)return qe({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Sn(i):null==i?void 0:i.data)}}return Dt.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=V[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){En(e,t,o,$e({},i,a))}),s)},An=function(){var e=De((function(e){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){Dt.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),On=function(){function t(){Lt(this,t),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={},this.retryLimitMap={}}var r,a,u,c=t.prototype;return c.initRetryLimit=function(e){var t=F[e],n={lastCall:(new Date).getTime(),limit:t&&t.limit?t.limit:3,retry:0};return this.retryLimitMap[e]=n,n},c.resetRetryLimit=function(e){this.retryLimitMap[e].lastCall=(new Date).getTime(),this.retryLimitMap[e].retry=0},c.getRetryLimit=function(e){var t=this.retryLimitMap[e];return t&&t.lastCall&&t.retry||(t=this.initRetryLimit(e)),t},c.increaseRetryLimit=function(e){this.retryLimitMap[e].retry++},c.jump=function(){var t=this;return De((function(){return Ze(this,(function(r){return[2,new Promise((function(r,i){t._jumpStatus?t._jumpStatus===e.JumpStatus.DONE?r(e.JumpStatus.DONE):r(e.JumpStatus.DOING):(t._jumpStatus=e.JumpStatus.DOING,qe({stage:n.REQUEST,type:"log",name:"jump"}),En("JUMP_LOGIN",{},{success:function(n){var i=n.data;t._miniProgramConfig=(null==i?void 0:i.miniProgramConfig)||{};var o=(null==i?void 0:i.cookiesOAuthLogins)||[],a=o.find((function(e){return e.name===l.JS_TOKEN}));a&&(t._jsAccessToken=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),t._cookies=o;var s=t._cookies.find((function(e){return e.name===l.ZOAUTH}));(null==s?void 0:s.value)||ln([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){ln([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),i(e)}},{skipJump:!0}))}))]}))}))()},c.loginZaloV3=function(e,t,n){var r=this;return De((function(){var i;return Ze(this,(function(o){switch(o.label){case 0:return i="".concat(d.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(s,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=De((function(e){var t,n,i;return Ze(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return t=o.sent(),n=null==t?void 0:t.access_token,r._accessToken=n,i=1e3*parseInt(t.expires_in),r.accessTokenExpiresIn=i,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(r._accessToken||""),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,o.sent()]}}))}))()},c.loginZaloV4=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this;return De((function(){var i,o;return Ze(this,(function(a){switch(a.label){case 0:return(i=new URLSearchParams).append("app_id",e),i.append("code",t),i.append("code_verifier",n),Dt.isNull(r.refreshToken)||0===r.refreshToken.length?i.append("grant_type","authorization_code"):(i.append("grant_type","refresh_token"),i.append("refresh_token",r.refreshToken||"")),o={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.GET_ACCESS_TOKEN,$e({method:"POST",body:i},o)).then(function(){var e=De((function(e){var t,n,i,o;return Ze(this,(function(a){switch(a.label){case 0:return[4,e.json()];case 1:return t=a.sent(),n=(null==t?void 0:t.access_token)||"",i=(null==t?void 0:t.refresh_token)||"",r.refreshToken=i,r._accessToken=n,o=1e3*parseInt(null==t?void 0:t.expires_in),r.accessTokenExpiresIn=o,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,a.sent()]}}))}))()},c.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return De((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=De((function(){return Ze(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(r.getAccessTokenCount<=1||r._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Ze(this,(function(m){switch(m.label){case 0:return n=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(r=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):e?[4,t.verifyUserAuthorized()]:[3,4];case 3:return s=m.sent(),[3,5];case 4:s=!0,m.label=5;case 5:return a=s,t._accessToken.length>0&&n<t.accessTokenExpiresIn&&a?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(l.ZOAUTH)]);case 6:return u=m.sent(),[4,t.jumpAndGetToken(l.ZOAUTH_VRF)];case 7:if(c=m.sent(),d="zmp.getaccesstoken.fail",!a)throw r.getAccessTokenCount--,ln([{action:d,error:-104,message:"no user auth",data:{}}]),Pn.error.loginFailed("User Authentication Required");if(!u)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),c?[4,t.loginZaloV4(o,u,c)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(o,i,u)];case 11:p=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),p="",console.log("Can not get access token",f),ln([{action:d,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return r.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(ln([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(Pn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw r.getAccessTokenCount--,ln([{action:d,error:-102,message:"no oauth",data:{}}]),Pn.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return De((function(){var t,n,r,i,o,a;return Ze(this,(function(s){switch(s.label){case 0:return n=!0,[4,e.jumpAndGetToken()];case 1:if(s.sent(),!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,7];s.label=2;case 2:return s.trys.push([2,6,,7]),(r=jn("action.mp.user.authorize"))&&r.isSupported?[4,Tn()]:[3,5];case 3:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,5]:[4,An()];case 4:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=5;case 5:return[3,7];case 6:return s.sent(),n=!1,[3,7];case 7:return[2,n]}}))}))()},c.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},c.getJSAccessToken=function(){var e=this;return De((function(){var t;return Ze(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(l.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},c.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},c.jumpAndGetToken=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;return new Promise(function(){var i=De((function(i){var o,a,s,u;return Ze(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?Dt.isString(t)?(o=r._cookies.find((function(e){return e.name===t})),[2,i(null==o?void 0:o.value)]):[2,i("")]:(n&&r._jumpStatus===e.JumpStatus.DONE&&(r._jumpStatus=void 0),a={name:t,cb:function(e){return i(e)}},[4,r.jump()]);case 1:return(s=c.sent())===e.JumpStatus.DONE?(r._jumpStatus=s,r.WAITING_QUEUE.length&&(r.WAITING_QUEUE.forEach((function(e){var t=r._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),r.WAITING_QUEUE=[]),u=r._cookies.find((function(e){return e.name===a.name})),a.cb(null==u?void 0:u.value)):r.WAITING_QUEUE.push(a),[2]}}))}));return function(e){return i.apply(this,arguments)}}())},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},r=t,(a=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&Ut(r.prototype,a),u&&Ut(r,u),t}(),kn=On.getInstance(),Cn=kt("zmp:utils:common"),Nn=function(e){if(Dt.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=[];for(var n=e.length,r=0;r<n;r++)t.push(Nn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+Nn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},Mn=function(e){var t=V[e],n=mn(),r=t&&"object"==typeof t&&"versionLive"in t&&t.versionLive&&"iOS"in t.versionLive?t.versionLive.iOS:0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||n>=r},Rn=function(e){try{if(e){Cn(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}var n=JSON.parse(t);return Cn("formattedValue",t,n,void 0===n?"undefined":Ot(n)),n}return null}catch(t){return Cn("parse json error:",t),e}},xn=function(e){if(Dt.isObject(JSON)&&JSON.parse&&Dt.isString(e)){var t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\x00/g,"");return JSON.parse(t,(function(e,t){return t}))}return Dt.isObject(e)?e:new Function("return "+e)()},Dn=function(e){for(var t=document.getElementsByTagName("meta"),n=0;n<t.length;n++)if(t[n].getAttribute("name")===e||t[n].getAttribute("property")===e)return t[n].getAttribute("content");return""},Ln=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var Un=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},jn=function(e){if(void 0!==e){var t=kn.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},Bn=function(e){if(void 0===e)return!1;var t=kn.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},Zn=function(){var e=De((function(){return Ze(this,(function(e){return[2,new Promise(function(){var e=De((function(e,t){var n;return Ze(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,kn.jumpAndGetToken()];case 1:return t.sent(),n=kn.miniProgramConfig,e(!0===(null==n?void 0:n.canUseAccessTokenByDefault)),[3,3];case 2:return t.sent(),e(!1),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));return function(){return e.apply(this,arguments)}}(),zn=function(e){return"action.get.device_info"===e?"GET_DEVICE_INFO":e.replace("action.","").replace(/\./g,"_").toUpperCase()},Wn=function(e){return e.startsWith("action.")?e:"GET_DEVICE_INFO"===e?"action.get.device_info":"action.".concat(e.replace(/\_/g,".").toLowerCase())},Fn=function(e,t,n){"string"==typeof n&&n.length>0?e.set(t,n):"object"!=typeof n||Array.isArray(n)||Object.entries(n).forEach((function(n){var r=Xe(n,2),i=r[0],o=r[1];null!=o&&""!==o&&e.set("".concat(t).concat(i),String(o))}))},Vn=function(e,t,n){var r;null===(r=e.contentWindow)||void 0===r||r.postMessage({type:t,payload:n},Ne)};function Gn(e,t,n,r){var i,o;!function(e,t){if(F[e]){var n=kn.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&kn.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw wn(Pn.error.failLimit(),e);kn.increaseRetryLimit(e)}}(e);var a=Array.isArray(n)&&n.length>0&&(null===(i=n[0])||void 0===i?void 0:i.success),s=Array.isArray(n)&&n.length>0&&(null===(o=n[0])||void 0===o?void 0:o.fail);try{var u=n;t.length>0&&t.forEach((function(t,r){var i=t.safeParse(n[r]);if(!i.success){var o,a=null===(o=i.error)||void 0===o?void 0:o.issues,s=a.map((function(e,t){var n=e.path.length>0?e.path.map((function(e,t){return t>0?"[".concat(e,"]"):e})).join(""):"arg";return"Error ".concat(t+1,": Code: ").concat(e.code," ~ Path: ").concat(n," ~ Message: ").concat(e.message)})).join(" | "),c=Pn.error.badRequest(s);throw c.detail=a,wn(c,e)}u.push(i.data)}));var c=r.apply(void 0,Be(u));return Dt.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!Dt.isNull(a)&&Dt.isFunction(a))return a(e);t(c)})).catch((function(t){var r=wn(t,e);if(!Dt.isNull(s)&&Dt.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!Dt.isNull(s)&&Dt.isFunction(s))return s(t);throw wn(t,e)}}function Hn(e){return Kn.apply(this,arguments)}function Kn(){return(Kn=De((function(e){return Ze(this,(function(t){return[2,Gn("login",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,kn.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Je.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Qe("login",{}))]}}))})))]}))}))).apply(this,arguments)}function Jn(e){return qn.apply(this,arguments)}function qn(){return(qn=De((function(e){return Ze(this,(function(t){return[2,Gn("getAccessToken",[],[e],De((function(){var e;return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,Zn()]:[3,3];case 1:return e=!t.sent(),[4,kn.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Je.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Qe("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Qn,Yn="2.52.0-beta.1";function $n(){return Gn("getVersion",[],[],(function(){return Yn}))}function Xn(){var e;return{version:Dn("version-id")||"",apiVersion:Yn,zaloVersion:String(mn()),platform:(null===(e=Ke())||void 0===e?void 0:e.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function er(){return Gn("getSystemInfo",[],[],(function(){return Xn()}))}!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(Qn||(Qn={}));const tr=Qn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nr=e=>{switch(typeof e){case"undefined":return tr.undefined;case"string":return tr.string;case"number":return isNaN(e)?tr.nan:tr.number;case"boolean":return tr.boolean;case"function":return tr.function;case"bigint":return tr.bigint;case"symbol":return tr.symbol;case"object":return Array.isArray(e)?tr.array:null===e?tr.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?tr.promise:"undefined"!=typeof Map&&e instanceof Map?tr.map:"undefined"!=typeof Set&&e instanceof Set?tr.set:"undefined"!=typeof Date&&e instanceof Date?tr.date:tr.object;default:return tr.unknown}},rr=Qn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ir extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){const n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Qn.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}ir.create=e=>new ir(e);const or=(e,t)=>{let n;switch(e.code){case rr.invalid_type:n=e.received===tr.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case rr.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Qn.jsonStringifyReplacer)}`;break;case rr.unrecognized_keys:n=`Unrecognized key(s) in object: ${Qn.joinValues(e.keys,", ")}`;break;case rr.invalid_union:n="Invalid input";break;case rr.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Qn.joinValues(e.options)}`;break;case rr.invalid_enum_value:n=`Invalid enum value. Expected ${Qn.joinValues(e.options)}, received '${e.received}'`;break;case rr.invalid_arguments:n="Invalid function arguments";break;case rr.invalid_return_type:n="Invalid function return type";break;case rr.invalid_date:n="Invalid date";break;case rr.invalid_string:"object"==typeof e.validation?"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Qn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case rr.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(e.minimum)}`:"Invalid input";break;case rr.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(e.maximum)}`:"Invalid input";break;case rr.custom:n="Invalid input";break;case rr.invalid_intersection_types:n="Intersection results could not be merged";break;case rr.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case rr.not_finite:n="Number must be finite";break;default:n=t.defaultError,Qn.assertNever(e)}return{message:n}};let ar=or;function sr(){return ar}const ur=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const u=r.filter((e=>!!e)).slice().reverse();for(const e of u)s=e(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}};function cr(e,t){const n=ur({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,sr(),or].filter((e=>!!e))});e.common.issues.push(n)}class lr{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return dr;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t)n.push({key:await e.key,value:await e.value});return lr.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:i}=r;if("aborted"===t.status)return dr;if("aborted"===i.status)return dr;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),(void 0!==i.value||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}}const dr=Object.freeze({status:"aborted"}),pr=e=>({status:"dirty",value:e}),fr=e=>({status:"valid",value:e}),hr=e=>"aborted"===e.status,mr=e=>"dirty"===e.status,vr=e=>"valid"===e.status,yr=e=>"undefined"!=typeof Promise&&e instanceof Promise;var gr;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(gr||(gr={}));class _r{constructor(e,t,n,r){this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._path.concat(this._key)}}const wr=(e,t)=>{if(vr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,error:new ir(e.common.issues)}};function br(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=n?n:t.defaultError},description:i}}class Tr{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return nr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new lr,ctx:{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(yr(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},i=this._parseSync({data:e,path:r.path,parent:r});return wr(r,i)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(yr(r)?r:Promise.resolve(r));return wr(n,i)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const i=e(t),o=()=>r.addIssue({code:rr.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(o(),!1))):!!i||(o(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new ai({schema:this,typeName:yi.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return si.create(this,this._def)}nullable(){return ui.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Zr.create(this,this._def)}promise(){return oi.create(this,this._def)}or(e){return Vr.create([this,e],this._def)}and(e){return Jr.create(this,e,this._def)}transform(e){return new ai({...br(this._def),schema:this,typeName:yi.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ci({...br(this._def),innerType:this,defaultValue:t,typeName:yi.ZodDefault})}brand(){return new fi({typeName:yi.ZodBranded,type:this,...br(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new li({...br(this._def),innerType:this,catchValue:t,typeName:yi.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return hi.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Er=/^c[^\s-]{8,}$/i,Pr=/^[a-z][a-z0-9]*$/,Sr=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,Ir=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/;class Ar extends Tr{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:rr.invalid_string,...gr.errToObj(n)}),this.nonempty=e=>this.min(1,gr.errToObj(e)),this.trim=()=>new Ar({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==tr.string){const t=this._getOrReturnCtx(e);return cr(t,{code:rr.invalid_type,expected:tr.string,received:t.parsedType}),dr}const t=new lr;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),cr(n,{code:rr.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),cr(n,{code:rr.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,o=e.data.length<i.value;(r||o)&&(n=this._getOrReturnCtx(e,n),r?cr(n,{code:rr.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&cr(n,{code:rr.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)Ir.test(e.data)||(n=this._getOrReturnCtx(e,n),cr(n,{validation:"email",code:rr.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Sr.test(e.data)||(n=this._getOrReturnCtx(e,n),cr(n,{validation:"uuid",code:rr.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Er.test(e.data)||(n=this._getOrReturnCtx(e,n),cr(n,{validation:"cuid",code:rr.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Pr.test(e.data)||(n=this._getOrReturnCtx(e,n),cr(n,{validation:"cuid2",code:rr.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),cr(n,{validation:"url",code:rr.invalid_string,message:i.message}),t.dirty()}else if("regex"===i.kind){i.regex.lastIndex=0;i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),cr(n,{validation:"regex",code:rr.invalid_string,message:i.message}),t.dirty())}else if("trim"===i.kind)e.data=e.data.trim();else if("startsWith"===i.kind)e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),cr(n,{code:rr.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty());else if("endsWith"===i.kind)e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),cr(n,{code:rr.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty());else if("datetime"===i.kind){((r=i).precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):0===r.precision?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(n=this._getOrReturnCtx(e,n),cr(n,{code:rr.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else Qn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new Ar({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...gr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...gr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...gr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...gr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...gr.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...gr.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...gr.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...gr.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...gr.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...gr.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...gr.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...gr.errToObj(t)})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Or(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}Ar.create=e=>{var t;return new Ar({checks:[],typeName:yi.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...br(e)})};class kr extends Tr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==tr.number){const t=this._getOrReturnCtx(e);return cr(t,{code:rr.invalid_type,expected:tr.number,received:t.parsedType}),dr}let t;const n=new lr;for(const r of this._def.checks)if("int"===r.kind)Qn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),cr(t,{code:rr.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),cr(t,{code:rr.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),cr(t,{code:rr.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==Or(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),cr(t,{code:rr.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),cr(t,{code:rr.not_finite,message:r.message}),n.dirty()):Qn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,gr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,gr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,gr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,gr.toString(t))}setLimit(e,t,n,r){return new kr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:gr.toString(r)}]})}_addCheck(e){return new kr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:gr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:gr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:gr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:gr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:gr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:gr.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:gr.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&Qn.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}kr.create=e=>new kr({checks:[],typeName:yi.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...br(e)});class Cr extends Tr{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==tr.bigint){const t=this._getOrReturnCtx(e);return cr(t,{code:rr.invalid_type,expected:tr.bigint,received:t.parsedType}),dr}return fr(e.data)}}Cr.create=e=>{var t;return new Cr({typeName:yi.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...br(e)})};class Nr extends Tr{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==tr.boolean){const t=this._getOrReturnCtx(e);return cr(t,{code:rr.invalid_type,expected:tr.boolean,received:t.parsedType}),dr}return fr(e.data)}}Nr.create=e=>new Nr({typeName:yi.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...br(e)});class Mr extends Tr{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==tr.date){const t=this._getOrReturnCtx(e);return cr(t,{code:rr.invalid_type,expected:tr.date,received:t.parsedType}),dr}if(isNaN(e.data.getTime())){return cr(this._getOrReturnCtx(e),{code:rr.invalid_date}),dr}const t=new lr;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),cr(n,{code:rr.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),cr(n,{code:rr.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Qn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Mr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:gr.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:gr.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}Mr.create=e=>new Mr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:yi.ZodDate,...br(e)});class Rr extends Tr{_parse(e){if(this._getType(e)!==tr.symbol){const t=this._getOrReturnCtx(e);return cr(t,{code:rr.invalid_type,expected:tr.symbol,received:t.parsedType}),dr}return fr(e.data)}}Rr.create=e=>new Rr({typeName:yi.ZodSymbol,...br(e)});class xr extends Tr{_parse(e){if(this._getType(e)!==tr.undefined){const t=this._getOrReturnCtx(e);return cr(t,{code:rr.invalid_type,expected:tr.undefined,received:t.parsedType}),dr}return fr(e.data)}}xr.create=e=>new xr({typeName:yi.ZodUndefined,...br(e)});class Dr extends Tr{_parse(e){if(this._getType(e)!==tr.null){const t=this._getOrReturnCtx(e);return cr(t,{code:rr.invalid_type,expected:tr.null,received:t.parsedType}),dr}return fr(e.data)}}Dr.create=e=>new Dr({typeName:yi.ZodNull,...br(e)});class Lr extends Tr{constructor(){super(...arguments),this._any=!0}_parse(e){return fr(e.data)}}Lr.create=e=>new Lr({typeName:yi.ZodAny,...br(e)});class Ur extends Tr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return fr(e.data)}}Ur.create=e=>new Ur({typeName:yi.ZodUnknown,...br(e)});class jr extends Tr{_parse(e){const t=this._getOrReturnCtx(e);return cr(t,{code:rr.invalid_type,expected:tr.never,received:t.parsedType}),dr}}jr.create=e=>new jr({typeName:yi.ZodNever,...br(e)});class Br extends Tr{_parse(e){if(this._getType(e)!==tr.undefined){const t=this._getOrReturnCtx(e);return cr(t,{code:rr.invalid_type,expected:tr.void,received:t.parsedType}),dr}return fr(e.data)}}Br.create=e=>new Br({typeName:yi.ZodVoid,...br(e)});class Zr extends Tr{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==tr.array)return cr(t,{code:rr.invalid_type,expected:tr.array,received:t.parsedType}),dr;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(cr(t,{code:e?rr.too_big:rr.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(cr(t,{code:rr.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(cr(t,{code:rr.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new _r(t,e,t.path,n))))).then((e=>lr.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new _r(t,e,t.path,n))));return lr.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Zr({...this._def,minLength:{value:e,message:gr.toString(t)}})}max(e,t){return new Zr({...this._def,maxLength:{value:e,message:gr.toString(t)}})}length(e,t){return new Zr({...this._def,exactLength:{value:e,message:gr.toString(t)}})}nonempty(e){return this.min(1,e)}}var zr;function Wr(e){if(e instanceof Fr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=si.create(Wr(r))}return new Fr({...e._def,shape:()=>t})}return e instanceof Zr?Zr.create(Wr(e.element)):e instanceof si?si.create(Wr(e.unwrap())):e instanceof ui?ui.create(Wr(e.unwrap())):e instanceof qr?qr.create(e.items.map((e=>Wr(e)))):e}Zr.create=(e,t)=>new Zr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:yi.ZodArray,...br(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(zr||(zr={}));class Fr extends Tr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Qn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==tr.object){const t=this._getOrReturnCtx(e);return cr(t,{code:rr.invalid_type,expected:tr.object,received:t.parsedType}),dr}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof jr&&"strip"===this._def.unknownKeys))for(const e in n.data)i.includes(e)||o.push(e);const a=[];for(const e of i){const t=r[e],i=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new _r(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof jr){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)o.length>0&&(cr(n,{code:rr.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const r=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new _r(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>lr.mergeObjectSync(t,e))):lr.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return gr.errToObj,new Fr({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,i,o,a;const s=null!==(o=null===(i=(r=this._def).errorMap)||void 0===i?void 0:i.call(r,t,n).message)&&void 0!==o?o:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=gr.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new Fr({...this._def,unknownKeys:"strip"})}passthrough(){return new Fr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Fr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Fr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>zr.mergeShapes(this._def.shape(),e._def.shape()),typeName:yi.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Fr({...this._def,catchall:e})}pick(e){const t={};return Qn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new Fr({...this._def,shape:()=>t})}omit(e){const t={};return Qn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new Fr({...this._def,shape:()=>t})}deepPartial(){return Wr(this)}partial(e){const t={};return Qn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new Fr({...this._def,shape:()=>t})}required(e){const t={};return Qn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof si;)e=e._def.innerType;t[n]=e}})),new Fr({...this._def,shape:()=>t})}keyof(){return ni(Qn.objectKeys(this.shape))}}Fr.create=(e,t)=>new Fr({shape:()=>e,unknownKeys:"strip",catchall:jr.create(),typeName:yi.ZodObject,...br(t)}),Fr.strictCreate=(e,t)=>new Fr({shape:()=>e,unknownKeys:"strict",catchall:jr.create(),typeName:yi.ZodObject,...br(t)}),Fr.lazycreate=(e,t)=>new Fr({shape:e,unknownKeys:"strip",catchall:jr.create(),typeName:yi.ZodObject,...br(t)});class Vr extends Tr{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new ir(e.ctx.common.issues)));return cr(t,{code:rr.invalid_union,unionErrors:n}),dr}));{let e;const r=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=r.map((e=>new ir(e)));return cr(t,{code:rr.invalid_union,unionErrors:i}),dr}}get options(){return this._def.options}}Vr.create=(e,t)=>new Vr({options:e,typeName:yi.ZodUnion,...br(t)});const Gr=e=>e instanceof ei?Gr(e.schema):e instanceof ai?Gr(e.innerType()):e instanceof ti?[e.value]:e instanceof ri?e.options:e instanceof ii?Object.keys(e.enum):e instanceof ci?Gr(e._def.innerType):e instanceof xr?[void 0]:e instanceof Dr?[null]:null;class Hr extends Tr{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==tr.object)return cr(t,{code:rr.invalid_type,expected:tr.object,received:t.parsedType}),dr;const n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(cr(t,{code:rr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),dr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=Gr(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new Hr({typeName:yi.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...br(n)})}}function Kr(e,t){const n=nr(e),r=nr(t);if(e===t)return{valid:!0,data:e};if(n===tr.object&&r===tr.object){const n=Qn.objectKeys(t),r=Qn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=Kr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===tr.array&&r===tr.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Kr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===tr.date&&r===tr.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Jr extends Tr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(hr(e)||hr(r))return dr;const i=Kr(e.value,r.value);return i.valid?((mr(e)||mr(r))&&t.dirty(),{status:t.value,value:i.data}):(cr(n,{code:rr.invalid_intersection_types}),dr)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Jr.create=(e,t,n)=>new Jr({left:e,right:t,typeName:yi.ZodIntersection,...br(n)});class qr extends Tr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==tr.array)return cr(n,{code:rr.invalid_type,expected:tr.array,received:n.parsedType}),dr;if(n.data.length<this._def.items.length)return cr(n,{code:rr.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),dr;!this._def.rest&&n.data.length>this._def.items.length&&(cr(n,{code:rr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new _r(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>lr.mergeArray(t,e))):lr.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new qr({...this._def,rest:e})}}qr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new qr({items:e,typeName:yi.ZodTuple,rest:null,...br(t)})};class Qr extends Tr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==tr.object)return cr(n,{code:rr.invalid_type,expected:tr.object,received:n.parsedType}),dr;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new _r(n,e,n.path,e)),value:o._parse(new _r(n,n.data[e],n.path,e))});return n.common.async?lr.mergeObjectAsync(t,r):lr.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Qr(t instanceof Tr?{keyType:e,valueType:t,typeName:yi.ZodRecord,...br(n)}:{keyType:Ar.create(),valueType:e,typeName:yi.ZodRecord,...br(t)})}}class Yr extends Tr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==tr.map)return cr(n,{code:rr.invalid_type,expected:tr.map,received:n.parsedType}),dr;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new _r(n,e,n.path,[o,"key"])),value:i._parse(new _r(n,t,n.path,[o,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of o){const r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return dr;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of o){const r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return dr;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Yr.create=(e,t,n)=>new Yr({valueType:t,keyType:e,typeName:yi.ZodMap,...br(n)});class $r extends Tr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==tr.set)return cr(n,{code:rr.invalid_type,expected:tr.set,received:n.parsedType}),dr;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(cr(n,{code:rr.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(cr(n,{code:rr.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const n=new Set;for(const r of e){if("aborted"===r.status)return dr;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map(((e,t)=>i._parse(new _r(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new $r({...this._def,minSize:{value:e,message:gr.toString(t)}})}max(e,t){return new $r({...this._def,maxSize:{value:e,message:gr.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}$r.create=(e,t)=>new $r({valueType:e,minSize:null,maxSize:null,typeName:yi.ZodSet,...br(t)});class Xr extends Tr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==tr.function)return cr(t,{code:rr.invalid_type,expected:tr.function,received:t.parsedType}),dr;function n(e,n){return ur({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,sr(),or].filter((e=>!!e)),issueData:{code:rr.invalid_arguments,argumentsError:n}})}function r(e,n){return ur({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,sr(),or].filter((e=>!!e)),issueData:{code:rr.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof oi?fr((async(...e)=>{const t=new ir([]),a=await this._def.args.parseAsync(e,i).catch((r=>{throw t.addIssue(n(e,r)),t})),s=await o(...a);return await this._def.returns._def.type.parseAsync(s,i).catch((e=>{throw t.addIssue(r(s,e)),t}))})):fr(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new ir([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new ir([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Xr({...this._def,args:qr.create(e).rest(Ur.create())})}returns(e){return new Xr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Xr({args:e||qr.create([]).rest(Ur.create()),returns:t||Ur.create(),typeName:yi.ZodFunction,...br(n)})}}class ei extends Tr{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ei.create=(e,t)=>new ei({getter:e,typeName:yi.ZodLazy,...br(t)});class ti extends Tr{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return cr(t,{received:t.data,code:rr.invalid_literal,expected:this._def.value}),dr}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ni(e,t){return new ri({values:e,typeName:yi.ZodEnum,...br(t)})}ti.create=(e,t)=>new ti({value:e,typeName:yi.ZodLiteral,...br(t)});class ri extends Tr{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return cr(t,{expected:Qn.joinValues(n),received:t.parsedType,code:rr.invalid_type}),dr}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return cr(t,{received:t.data,code:rr.invalid_enum_value,options:n}),dr}return fr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return ri.create(e)}exclude(e){return ri.create(this.options.filter((t=>!e.includes(t))))}}ri.create=ni;class ii extends Tr{_parse(e){const t=Qn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==tr.string&&n.parsedType!==tr.number){const e=Qn.objectValues(t);return cr(n,{expected:Qn.joinValues(e),received:n.parsedType,code:rr.invalid_type}),dr}if(-1===t.indexOf(e.data)){const e=Qn.objectValues(t);return cr(n,{received:n.data,code:rr.invalid_enum_value,options:e}),dr}return fr(e.data)}get enum(){return this._def.values}}ii.create=(e,t)=>new ii({values:e,typeName:yi.ZodNativeEnum,...br(t)});class oi extends Tr{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==tr.promise&&!1===t.common.async)return cr(t,{code:rr.invalid_type,expected:tr.promise,received:t.parsedType}),dr;const n=t.parsedType===tr.promise?t.data:Promise.resolve(t.data);return fr(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}oi.create=(e,t)=>new oi({type:e,typeName:yi.ZodPromise,...br(t)});class ai extends Tr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===yi.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null;if("preprocess"===r.type){const e=r.transform(n.data);return n.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n}))):this._def.schema._parseSync({data:e,path:n.path,parent:n})}const i={addIssue:e=>{cr(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"refinement"===r.type){const e=e=>{const t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?dr:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?dr:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!vr(e))return e;const o=r.transform(e.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>vr(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}Qn.assertNever(r)}}ai.create=(e,t,n)=>new ai({schema:e,typeName:yi.ZodEffects,effect:t,...br(n)}),ai.createWithPreprocess=(e,t,n)=>new ai({schema:t,effect:{type:"preprocess",transform:e},typeName:yi.ZodEffects,...br(n)});class si extends Tr{_parse(e){return this._getType(e)===tr.undefined?fr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}si.create=(e,t)=>new si({innerType:e,typeName:yi.ZodOptional,...br(t)});class ui extends Tr{_parse(e){return this._getType(e)===tr.null?fr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ui.create=(e,t)=>new ui({innerType:e,typeName:yi.ZodNullable,...br(t)});class ci extends Tr{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===tr.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ci.create=(e,t)=>new ci({innerType:e,typeName:yi.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...br(t)});class li extends Tr{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t,common:{...t.common,issues:[]}}});return yr(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue()}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}}li.create=(e,t)=>new li({innerType:e,typeName:yi.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...br(t)});class di extends Tr{_parse(e){if(this._getType(e)!==tr.nan){const t=this._getOrReturnCtx(e);return cr(t,{code:rr.invalid_type,expected:tr.nan,received:t.parsedType}),dr}return{status:"valid",value:e.data}}}di.create=e=>new di({typeName:yi.ZodNaN,...br(e)});const pi=Symbol("zod_brand");class fi extends Tr{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class hi extends Tr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?dr:"dirty"===e.status?(t.dirty(),pr(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?dr:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new hi({in:e,out:t,typeName:yi.ZodPipeline})}}const mi=(e,t={},n)=>e?Lr.create().superRefine(((r,i)=>{if(!e(r)){const e="function"==typeof t?t(r):t,o="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...o,fatal:n})}})):Lr.create(),vi={object:Fr.lazycreate};var yi;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"}(yi||(yi={}));const gi=Ar.create,_i=kr.create,wi=di.create,bi=Cr.create,Ti=Nr.create,Ei=Mr.create,Pi=Rr.create,Si=xr.create,Ii=Dr.create,Ai=Lr.create,Oi=Ur.create,ki=jr.create,Ci=Br.create,Ni=Zr.create,Mi=Fr.create,Ri=Fr.strictCreate,xi=Vr.create,Di=Hr.create,Li=Jr.create,Ui=qr.create,ji=Qr.create,Bi=Yr.create,Zi=$r.create,zi=Xr.create,Wi=ei.create,Fi=ti.create,Vi=ri.create,Gi=ii.create,Hi=oi.create,Ki=ai.create,Ji=si.create,qi=ui.create,Qi=ai.createWithPreprocess,Yi=hi.create,$i={string:e=>Ar.create({...e,coerce:!0}),number:e=>kr.create({...e,coerce:!0}),boolean:e=>Nr.create({...e,coerce:!0}),bigint:e=>Cr.create({...e,coerce:!0}),date:e=>Mr.create({...e,coerce:!0})},Xi=dr;var eo=Object.freeze({__proto__:null,defaultErrorMap:or,setErrorMap:function(e){ar=e},getErrorMap:sr,makeIssue:ur,EMPTY_PATH:[],addIssueToContext:cr,ParseStatus:lr,INVALID:dr,DIRTY:pr,OK:fr,isAborted:hr,isDirty:mr,isValid:vr,isAsync:yr,get util(){return Qn},ZodParsedType:tr,getParsedType:nr,ZodType:Tr,ZodString:Ar,ZodNumber:kr,ZodBigInt:Cr,ZodBoolean:Nr,ZodDate:Mr,ZodSymbol:Rr,ZodUndefined:xr,ZodNull:Dr,ZodAny:Lr,ZodUnknown:Ur,ZodNever:jr,ZodVoid:Br,ZodArray:Zr,get objectUtil(){return zr},ZodObject:Fr,ZodUnion:Vr,ZodDiscriminatedUnion:Hr,ZodIntersection:Jr,ZodTuple:qr,ZodRecord:Qr,ZodMap:Yr,ZodSet:$r,ZodFunction:Xr,ZodLazy:ei,ZodLiteral:ti,ZodEnum:ri,ZodNativeEnum:ii,ZodPromise:oi,ZodEffects:ai,ZodTransformer:ai,ZodOptional:si,ZodNullable:ui,ZodDefault:ci,ZodCatch:li,ZodNaN:di,BRAND:pi,ZodBranded:fi,ZodPipeline:hi,custom:mi,Schema:Tr,ZodSchema:Tr,late:vi,get ZodFirstPartyTypeKind(){return yi},coerce:$i,any:Ai,array:Ni,bigint:bi,boolean:Ti,date:Ei,discriminatedUnion:Di,effect:Ki,enum:Vi,function:zi,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>mi((t=>t instanceof e),t,!0),intersection:Li,lazy:Wi,literal:Fi,map:Bi,nan:wi,nativeEnum:Gi,never:ki,null:Ii,nullable:qi,number:_i,object:Mi,oboolean:()=>Ti().optional(),onumber:()=>_i().optional(),optional:Ji,ostring:()=>gi().optional(),pipeline:Yi,preprocess:Qi,promise:Hi,record:ji,set:Zi,strictObject:Ri,string:gi,symbol:Pi,transformer:Ki,tuple:Ui,undefined:Si,union:xi,unknown:Oi,void:Ci,NEVER:Xi,ZodIssueCode:rr,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:ir}),to=function(){function t(){var e,n,r,i,a,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,I,A,O,k;Lt(this,t),this.initConfig=window.APP_CONFIG;var C=Dt.isString(null===(e=this.initConfig)||void 0===e||null===(n=e.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(i=r.app)||void 0===i||null===(a=i.headerColor)||void 0===a?void 0:a.length)>0?ne:re;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,R="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?te.HIDE_BACK:te.SHOW_BACK,x="home"===(null===(v=this.initConfig)||void 0===v||null===(y=v.app)||void 0===y?void 0:y.leftButton)||"both"===(null===(g=this.initConfig)||void 0===g||null===(_=g.app)||void 0===_?void 0:_.leftButton)?te.SHOW_HOME:te.HIDE_HOME,D=new URL(location.href),L=Un(null===(w=this.initConfig)||void 0===w||null===(b=w.app)||void 0===b?void 0:b.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.app)||void 0===E?void 0:E.actionBarHidden)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?re:ne);this.config={actionbarType:C,buttonType:R,statusbarType:L,dataConfig:{backgroundColor:(null===(P=this.initConfig)||void 0===P||null===(S=P.app)||void 0===S?void 0:S.headerColor)||ie,textColor:(null===(I=this.initConfig)||void 0===I||null===(A=I.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(O=this.initConfig)||void 0===O||null===(k=O.app)||void 0===k?void 0:k.textAlign)||oe,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(s,"/").concat(o,"/").concat(D.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return De((function(){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},n.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return De((function(){var r,i;return Ze(this,(function(o){return void 0===(void 0===e?"undefined":Ot(e))&&null===(void 0===e?"undefined":Ot(e))||(r="none"===e||"home"===e?te.HIDE_BACK:te.SHOW_BACK,i="home"===e||"both"===e?te.SHOW_HOME:te.HIDE_HOME,n.config.buttonType=r,n.config.dataConfig.viewInLeftType=r,n.config.homeConfig.enable=i),n.config.dataConfig.confirmToExit=t,[2,new Promise((function(e,t){In("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",$e({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},n.setAndroidBottomNavigationBar=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return De((function(){var r,i,o;return Ze(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Ke())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();In("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideAndroidBottomNavigationBar=!!t,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1})}))]}))}))()},n.setIOSBottomSafeArea=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return De((function(){var r,i,o;return Ze(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Ke())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();In("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideIOSSafeAreaBottom=!!t,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1,delay:200})}))]}))}))()},n.configHeader=function(t){var n=this;return De((function(){var r;return Ze(this,(function(i){return r=n.config,Dt.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),Dt.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),Dt.isString(t.textAlign)&&("left"===t.textAlign?r.dataConfig.textAlign=e.TextAlignType.left:"center"===t.textAlign&&(r.dataConfig.textAlign=e.TextAlignType.center)),!0===t.hideActionBar?r.actionbarType=re:!1===t.hideActionBar&&(r.actionbarType=ne),"normal"===t.statusBarType?r.statusbarType=e.StatusBarType.normal:"hidden"===t.statusBarType?r.statusbarType=e.StatusBarType.hidden:"transparent"===t.statusBarType&&(r.statusbarType=e.StatusBarType.transparent),[2,new Promise((function(i,o){In("CHANGE_ACTIONBAR",$e({},r),{success:function(){var o;n.config=$e({},r);var a,s=null===(o=Ke())||void 0===o?void 0:o.platform;window.STATUS_BAR_TYPE=(a=n.config.statusbarType)===e.StatusBarType.hidden?"hidden":a===e.StatusBarType.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=n.config.actionbarType===re;var u=null===document||void 0===document?void 0:document.querySelector(":root");if(null==s?void 0:s.isAndroid){var c=0;if(("hidden"===t.statusBarType||"transparent"===t.statusBarType)&&t.hideActionBar){var l=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(l)&&(l=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),c=l}c?null==u||u.style.setProperty("--zaui-safe-area-inset-top","".concat(c,"px")):null==u||u.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}i()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t}(),no=to.getInstance(),ro=[Mi({title:gi()}).optional()];function io(e){return oo.apply(this,arguments)}function oo(){return oo=De((function(e){return Ze(this,(function(t){return[2,Gn("setNavigationBarTitle",ro,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,no.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),oo.apply(this,arguments)}var ao=[Mi({color:gi(),textColor:eo.enum(["black","white"]).optional(),statusBarColor:gi().optional()}).optional()];function so(e){return uo.apply(this,arguments)}function uo(){return uo=De((function(e){return Ze(this,(function(t){return[2,Gn("setNavigationBarColor",ao,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,no.configHeader({hideActionBar:!(e.color.length>0),headerTextColor:e.textColor,headerColor:e.color.length>0?e.color:e.statusBarColor})]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),uo.apply(this,arguments)}var co=[Mi({type:eo.enum(["none","back","home","both"])}).optional()];function lo(e){return po.apply(this,arguments)}function po(){return po=De((function(e){return Ze(this,(function(t){return[2,Gn("setNavigationBarLeftButton",co,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,no.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),po.apply(this,arguments)}function fo(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function ho(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,fo(e,t,"get"))}function mo(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function vo(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,fo(e,t,"set"),n),n}var yo,go,_o=function(){function e(){Lt(this,e)}var t=e.prototype;return t.getSynchronize=function(e){return new Map},t.setSynchronize=function(e){return{errorKeys:[]}},t.getInfoSynchronize=function(){return{currentSize:0,limitSize:0}},t.removeSynchronize=function(e){return{errorKeys:[]}},t.clearSynchronize=function(){},t.getItem=function(e){return this.getSynchronize([e]).get(e)||null},t.setItem=function(e,t){if(this.setSynchronize(Ye({},e,t)).errorKeys.length>0)throw new Error("Failed to set item: ".concat(e))},t.removeItem=function(e){this.removeSynchronize([e])},t.clear=function(){this.clearSynchronize()},t.getStorageInfo=function(){return this.getInfoSynchronize()},e}(),wo=new WeakMap,bo=new WeakMap,To=new WeakMap,Eo=function(e){Ft(n,e);var t=Gt(n);function n(e){var r;return Lt(this,n),mo(Vt(r=t.call(this)),wo,{writable:!0,value:localStorage}),mo(Vt(r),bo,{writable:!0,value:void 0}),mo(Vt(r),To,{writable:!0,value:void 0}),vo(Vt(r),To,{keys:new Set,currentSize:0,limitSize:K}),vo(Vt(r),bo,e),r.findAllCurrentDataByApp(e),r}var r=n.prototype;return r.findAllCurrentDataByApp=function(e){try{var t;for(t in ho(this,wo)){if(e)if(t.split("_")[0]!==e)continue;ho(this,To).keys.add(t)}}catch(e){}},r.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},r.getSync=function(e){return ho(this,bo)&&(e="".concat(ho(this,bo),"_").concat(e)),ho(this,To).keys.has(e)?ho(this,wo).getItem(e):null},r.set=function(e){var t=this;return De((function(){return Ze(this,(function(n){return Object.entries(e).forEach((function(e){var n=Xe(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.setSync=function(e,t){ho(this,bo)&&(e="".concat(ho(this,bo),"_").concat(e)),ho(this,wo).setItem(e,t),ho(this,To).keys.add(e)},r.getInfo=function(){var e=this;return De((function(){return Ze(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},r.getInfoSync=function(){var e=function(e,t){var n,r=0;for(n in e){var i=n.split("_")[0];e.hasOwnProperty(n)&&(t&&i!==t||(r+=2*(e[n].length+n.length)))}return r}(ho(this,wo),ho(this,bo));return{currentSize:Dt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((K/1024).toFixed(2))}},r.remove=function(e){var t=this;return De((function(){return Ze(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.removeSync=function(e){ho(this,bo)&&(e="".concat(ho(this,bo),"_").concat(e)),ho(this,To).keys.has(e)&&(ho(this,wo).removeItem(e),ho(this,To).keys.delete(e))},r.clearAsync=function(){var e=this;return De((function(){return Ze(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},r.clearSync=function(){var e=this;ho(this,To).keys.forEach((function(t){ho(e,bo)&&t.indexOf(ho(e,bo))<0||(ho(e,wo).removeItem(t),ho(e,To).keys.delete(t))}))},r.setSynchronize=function(e){var t=this;return Object.entries(e).forEach((function(e){var n=Xe(e,2),r=n[0],i=n[1];t.setSync(r,i)})),{errorKeys:[]}},r.getSynchronize=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),n},r.getInfoSynchronize=function(){return this.getInfoSync()},r.clearSynchronize=function(){this.clearSync()},n}(_o),Po=new WeakMap,So=new WeakMap,Io=function(e){Ft(n,e);var t=Gt(n);function n(e){var r;return Lt(this,n),mo(Vt(r=t.call(this)),Po,{writable:!0,value:void 0}),mo(Vt(r),So,{writable:!0,value:void 0}),vo(Vt(r),So,{keys:new Set,currentSize:0,limitSize:K}),vo(Vt(r),Po,e),r}var r=n.prototype;return r.get=function(e){var t=this;return De((function(){return Ze(this,(function(n){return[2,new Promise((function(n,r){In("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:ho(t,Po)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.getSynchronize=function(e){var t={mpds_action:"mpds.get",mpds_data:{keys:e},appId:ho(this,Po)},n=new Map,r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.map&&(n=new Map(Object.entries(r.mpds_data.map))),n},r.set=function(e){var t=this;return De((function(){return Ze(this,(function(n){return[2,new Promise((function(n,r){In("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:ho(t,Po)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.setSynchronize=function(e){var t={mpds_action:"mpds.set",mpds_data:{map:e},appId:ho(this,Po)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.getInfo=function(){var e=this;return De((function(){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:ho(e,Po)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:Dt.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(K/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.getInfoSynchronize=function(){var e={mpds_action:"mpds.get.size",mpds_data:{},appId:ho(this,Po)},t=0,n=this.handleResult(e);return n&&n.mpds_data&&n.mpds_data.size&&(t=n.mpds_data.size),{currentSize:Dt.isNumber(t)?Number(Number(t)/1024):0,limitSize:Number(K/1024)}},r.remove=function(e){var t=this;return De((function(){return Ze(this,(function(n){return[2,new Promise((function(n,r){In("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:ho(t,Po)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.removeSynchronize=function(e){var t={mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:ho(this,Po)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.clearAsync=function(){var e=this;return De((function(){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:ho(e,Po)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.clearSynchronize=function(){var e={mpds_action:"mpds.clear.appData",mpds_data:{},appId:ho(this,Po)};this.handleResult(e)},r.handleResult=function(e){var t=null;try{var n=ZaloJavaScriptInterface.processActionMPDS(JSON.stringify(e));if(n=JSON.parse(n)){if(0===n.error_code)return n.data;t=Sn(n).toJSON()}}catch(e){t=e}finally{if(null!==t)throw t}return{}},n}(_o),Ao=function(){function e(){Lt(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return De((function(){var n,r;return Ze(this,(function(i){switch(i.label){case 0:return[4,t.getInstance().get(e)];case 1:return n=i.sent(),r={},n.forEach((function(e,t){r[t]=Rn(e)})),[2,r]}}))}))()},t.getItem=function(e){return this.getInstance().getItem(e)},t.putDataToStorage=function(e){var t=this;return De((function(){var n,r;return Ze(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Xe(e,2),n=t[0],i=t[1];Dt.isUndefined(i)||Dt.isNull(i)||(r[n]=Ln(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.setItem=function(e,t){return this.getInstance().setItem(e,t)},t.removeDataFromStorage=function(e){var t=this;return De((function(){return Ze(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.removeItem=function(e){this.getInstance().removeItem(e)},t.clearStorage=function(){var e=this;return De((function(){return Ze(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clearAsync()];case 1:return t.sent(),[2]}}))}))()},t.clearStorageSync=function(){this.getInstance().clear()},t.getStorageInfo=function(){var e=this;return De((function(){return Ze(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},t.getStorageInfoSync=function(){return this.getInstance().getStorageInfo()},e}(),Oo=new WeakMap,ko=function(e){Ft(n,e);var t=Gt(n);function n(e){var r;return Lt(this,n),mo(Vt(r=t.call(this)),Oo,{writable:!0,value:void 0}),vo(Vt(r),Oo,e),r}return n.prototype.getInstance=function(){return new Eo(ho(this,Oo))},n}(Ao),Co=new WeakMap,No=function(e){Ft(n,e);var t=Gt(n);function n(e){var r;return Lt(this,n),mo(Vt(r=t.call(this)),Co,{writable:!0,value:void 0}),vo(Vt(r),Co,e),r}return n.prototype.getInstance=function(){return new Io(ho(this,Co))},n}(Ao),Mo=new ko(o),Ro=mn(),xo=(null===(yo=Ke())||void 0===yo?void 0:yo.platformName)||"unknown";Ro>0&&Ro>={android:12100571,iOS:400,wp:0,unknown:0}[xo]&&(null===(go=Ke())||void 0===go?void 0:go.appEnv.isMp)&&(Mo=new No(o));var Do=Mo,Lo=[Mi({data:eo.record(gi(),eo.any())}).optional()];function Uo(e){return jo.apply(this,arguments)}function jo(){return jo=De((function(e){return Ze(this,(function(t){return[2,Gn("setStorage",Lo,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp||Je.isMpWeb?[4,Do.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Qe("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),jo.apply(this,arguments)}var Bo=[Mi({keys:eo.array(gi())}).optional()];function Zo(e){return zo.apply(this,arguments)}function zo(){return zo=De((function(e){return Ze(this,(function(t){return[2,Gn("getStorage",Bo,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp||Je.isMpWeb?[4,Do.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Qe("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zo.apply(this,arguments)}function Wo(e){return Fo.apply(this,arguments)}function Fo(){return(Fo=De((function(e){return Ze(this,(function(t){return[2,Gn("getStorageInfo",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp||Je.isMpWeb?[4,Do.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Qe("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Vo=[Mi({keys:eo.array(gi())}).optional()];function Go(e){return Ho.apply(this,arguments)}function Ho(){return Ho=De((function(e){return Ze(this,(function(t){return[2,Gn("removeStorage",Vo,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp||Je.isMpWeb?[4,Do.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Qe("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ho.apply(this,arguments)}var Ko=[Mi({prefix:gi().optional()}).optional()];function Jo(e){return qo.apply(this,arguments)}function qo(){return(qo=De((function(e){return Ze(this,(function(t){return[2,Gn("clearStorage",Ko,[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp||Je.isMpWeb?[4,Do.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Qe("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var Qo=function(){var e=De((function(e,t){var n,r,i,a;return Ze(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,Zn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,kn.getAccessToken(n)];case 3:return i=s.sent(),a="id,name,user_id_by_oa,is_sensitive",a=e?"".concat(a,",picture.type(").concat(e,")"):"".concat(a,",picture"),[4,fetch("".concat(d.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(o),{headers:{access_token:i||""}}).then(function(){var e=De((function(e){var t,n,r,i,o,a;return Ze(this,(function(s){switch(s.label){case 0:return[4,e.json()];case 1:if(r=s.sent(),void 0!==(i=null==r?void 0:r.error)&&0!==i)throw o=(null==r?void 0:r.message)||k,new _n(i,o);return a=null==r?void 0:r.user_id_by_oa,[2,{id:null==r?void 0:r.id,name:(null==r?void 0:r.name)||"",avatar:(null==r||null===(t=r.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url)||"",idByOA:a,followedOA:!!(null==r?void 0:r.is_follower),isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),Yo=[Mi({avatarType:eo.enum(["small","normal","large"]).optional(),autoRequestPermission:eo.boolean().default(!1).optional()}).optional()];function $o(e){return Xo.apply(this,arguments)}function Xo(){return Xo=De((function(e){return Ze(this,(function(t){return[2,Gn("getUserInfo",Yo,[e],function(){var e=De((function(e){var t,n,r;return Ze(this,(function(i){switch(i.label){case 0:if(!Je.isMp)return[3,4];t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Qo(t,n)];case 2:return[2,{userInfo:i.sent()}];case 3:return r=i.sent(),[2,Promise.reject(r)];case 4:return Je.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Qe("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xo.apply(this,arguments)}var ea=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},ta=De((function(){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Ke())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case ea(s).NONE:o=e.NetworkType.none;break;case ea(s).WIFI:o=e.NetworkType.wifi;break;case ea(s)["2G"]:case ea(s)["3G"]:case ea(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function na(e){return ra.apply(this,arguments)}function ra(){return(ra=De((function(t){return Ze(this,(function(n){return[2,Gn("getNetworkType",[],[t],De((function(){var t,n;return Ze(this,(function(r){switch(r.label){case 0:return Je.isMp?[4,ta()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(Je.isMpWeb){switch(t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t.effectiveType){case"none":n=e.NetworkType.none;break;case"4g":n=e.NetworkType.wifi;break;case"3g":case"2g":n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return[2,Promise.resolve({networkType:n})]}return[2,Promise.reject(Qe("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var ia=[eo.function().args(Mi({isConnected:eo.boolean(),networkType:eo.enum(["none","wifi","cellular","unknown"])})).returns(eo.void())];function oa(t){return Gn("onNetworkStatusChange",ia,[t],(function(t){var n=t;if(Je.isMp)!function(t){Yt.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;ta().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(Je.isMpWeb){var r=navigator.connection||navigator.mozConnection||navigator.webkitConnection,i=r.effectiveType;r.addEventListener("change",(function(){var t;switch(i){case"none":t=e.NetworkType.none;break;case"4g":t=e.NetworkType.wifi;break;case"3g":case"2g":t=e.NetworkType.cellular;break;default:t=e.NetworkType.unknown}n({isConnected:!0,networkType:t})}))}}))}var aa=function(){var e=De((function(e){var t,n,r,i,o,a;return Ze(this,(function(s){return a={subaction:0,scanning_type:Dt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Dt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Dt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Dt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Dt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Dt.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Dt.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Dt.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Dt.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Dt.isNumber(null==e||null===(o=e.scanConfig)||void 0===o?void 0:o.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}},[2,new Promise((function(e,t){In("SCAN_IBEACON",$e({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),sa=[Mi({scanningType:eo.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:eo.number().optional(),monitorInterval:eo.number().optional(),domain:eo.string().optional(),scanConfig:Mi({scanTime:eo.number().optional(),timeBetweenScan:eo.number().optional(),beaconTimeout:eo.number().optional(),delayCheckConnectedTimeout:eo.number().optional(),beaconConnectedTimeout:eo.number().optional()}).optional(),items:eo.array(Mi({id:eo.string().optional(),distance:eo.number().optional(),monitor:Mi({enable:eo.boolean().optional(),movingRange:eo.number().optional()}).optional()})).optional(),scanFromSource:eo.string().optional()}).optional()];function ua(e){return ca.apply(this,arguments)}function ca(){return(ca=De((function(e){return Ze(this,(function(t){return[2,Gn("startBeaconDiscovery",sa,[e],De((function(){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,aa(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Qe("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var la=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function da(e){return pa.apply(this,arguments)}function pa(){return(pa=De((function(e){return Ze(this,(function(t){return[2,Gn("stopBeaconDiscovery",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,la()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Qe("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var fa=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("SCAN_IBEACON",{subaction:1},{success:function(t){var n={beacons:[]};Array.isArray(t)&&t.forEach((function(e){var t={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};n.beacons.push(t)})),e(n)},fail:function(e){t(e)}},{isMultiCallback:!0})}))]}))}));function ha(e){return ma.apply(this,arguments)}function ma(){return(ma=De((function(e){return Ze(this,(function(t){return[2,Gn("getBeacons",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,fa()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Qe("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var va=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ya(e){return ga.apply(this,arguments)}function ga(){return(ga=De((function(e){return Ze(this,(function(t){return[2,Gn("closeApp",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,va()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var _a=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function wa(e){return ba.apply(this,arguments)}function ba(){return(ba=De((function(e){return Ze(this,(function(t){return[2,Gn("scanQRCode",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,_a()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Qe("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Ta=function(){var t=De((function(t,n,r,o){return Ze(this,(function(a){return[2,new Promise((function(a,s){In("OPEN_PROFILE",{uId:t,type:e.ProfileType[n],zapp:i,sourceId:r,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(e,n,r,i){return t.apply(this,arguments)}}(),Ea=[Mi({id:gi(),type:eo.enum(["user","oa","aliasOA"]),sourceId:eo.any().optional(),sourceIndex:eo.any().optional()}).optional()];function Pa(e){return Sa.apply(this,arguments)}function Sa(){return Sa=De((function(e){return Ze(this,(function(t){return[2,Gn("openProfile",Ea,[e],function(){var e=De((function(e){var t,n,r,i;return Ze(this,(function(o){switch(o.label){case 0:return Je.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Ta(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Sa.apply(this,arguments)}var Ia=function(){var t=De((function(t,n){var r,o,a,s=arguments;return Ze(this,(function(u){return r=s.length>2&&void 0!==s[2]?s[2]:"",o=s.length>3?s[3]:void 0,a=s.length>4?s[4]:void 0,[2,new Promise((function(s,u){In("OPEN_CHAT",{uId:t,type:e.ChatType[n],msg:r,zapp:i,sourceId:o,sourceIndex:a},{success:function(){s()},fail:function(e){u(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Aa=[Mi({id:gi(),type:eo.enum(["user","oa"]),sourceId:eo.any().optional(),sourceIndex:eo.any().optional(),message:gi().optional()}).optional()];function Oa(e){return ka.apply(this,arguments)}function ka(){return ka=De((function(e){return Ze(this,(function(t){return[2,Gn("openChat",Aa,[e],function(){var e=De((function(e){var t,n,r,i,o;return Ze(this,(function(a){switch(a.label){case 0:return Je.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,Ia(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ka.apply(this,arguments)}function Ca(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var Na=function(){var t=De((function(t,n){var r,o;return Ze(this,(function(a){switch(r={},o=t,t){case"image":(null==n?void 0:n.imageUrls)?(o="multi_image",r={photoUrl:null==n?void 0:n.imageUrls}):r={photoUrl:null==n?void 0:n.imageUrl};break;case"link":r={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":r={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(t,n){In("OPEN_POSTFEED",Ca($e({type:e.PostFeedType[o]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Ma=[eo.union([Mi({type:eo.enum(["image"]),data:Mi({imageUrl:gi().url().optional(),imageUrls:eo.array(gi().url()).optional()})}),Mi({type:eo.enum(["link"]),data:Mi({link:gi().url(),title:gi().max(100).optional(),thumb:gi().url().optional(),description:gi().max(400).default("").optional()})}),Mi({type:eo.enum(["profile"]),data:Mi({id:gi().optional()})})])];function Ra(e){return xa.apply(this,arguments)}function xa(){return xa=De((function(e){return Ze(this,(function(t){return[2,Gn("openPostFeed",Ma,[e],function(){var e=De((function(e){var t,n;return Ze(this,(function(r){switch(r.label){case 0:return Je.isMp?(t=e.type,n=e.data,[4,Na(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Qe("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xa.apply(this,arguments)}var Da=function(){var e=De((function(e){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:i},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),La=[Mi({id:gi(),showDialogConfirm:eo.boolean().optional()}).optional()];function Ua(e){return ja.apply(this,arguments)}function ja(){return ja=De((function(e){return Ze(this,(function(t){return[2,Gn("followOA",La,[e],function(){var e=De((function(e){var t;return Ze(this,(function(n){switch(n.label){case 0:return Je.isMp?(t=e.id,[4,Da(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ja.apply(this,arguments)}var Ba=function(){var e=De((function(e){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Za=[Mi({id:gi()}).optional()];function za(e){return Wa.apply(this,arguments)}function Wa(){return Wa=De((function(e){return Ze(this,(function(t){return[2,Gn("unfollowOA",Za,[e],function(){var e=De((function(e){var t;return Ze(this,(function(n){switch(n.label){case 0:return Je.isMp?(t=e.id,[4,Ba(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wa.apply(this,arguments)}var Fa=function(){var e=De((function(e,t,n,r,i,o){var s,u,l,p,f,h,m,v;return Ze(this,(function(y){switch(y.label){case 0:return l=new URL(location.href),p=new URLSearchParams,f="".concat(l.pathname.replace(c,"")).concat(l.search),o&&(f="/".concat(e).concat("/"===o[0]?"":"/").concat(o)),!(h=new URL("".concat(a).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(u=window.APP_VERSION)||void 0===u?void 0:u.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CREATE_SHARE_LINK,$e({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw Pn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,Ca($e({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Va=function(){var t=De((function(t,n){var r,a,s,u,c,l,d,p,f,h,m;return Ze(this,(function(v){switch(v.label){case 0:switch(r={},a=t,t){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return r={text:null==n?void 0:n.text,desc:(null==n?void 0:n.desc)||(null==n?void 0:n.description),autoParseLink:(null==n?void 0:n.autoParseLink)?1:0},[3,14];case 2:return c=[],l=mn(),d=(null===(u=Ke())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=H[d]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?c=null==n?void 0:n.imageUrls:c.push(null==n?void 0:n.imageUrl),r={photoUrls:c,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,14];case 3:return r={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 4:return r={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 5:return r={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,14];case 6:return r={uid:null==n?void 0:n.id},[3,14];case 7:case 10:return[4,kn.getAccessToken()];case 8:case 11:return s=v.sent(),[4,Fa(o,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 9:return p=v.sent(),r={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(o,"&shareId=").concat(p.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return f=v.sent().shareableLink,h=new URL(f),m=h.searchParams.getAll("zshareId"),h.searchParams.delete("zshareId"),m.length>0&&h.searchParams.append("zshareId",m[0]),r={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(t,n){In("OPEN_SHARESHEET",Ca($e({type:e.ShareSheetType[a]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{timeout:!1})}))]}}))}));return function(e,n){return t.apply(this,arguments)}}(),Ga=[eo.union([Mi({type:eo.enum(["text"]),data:Mi({text:gi(),description:gi().default("").optional(),autoParseLink:eo.boolean().default(!1).optional()})}),Mi({type:eo.enum(["image"]),data:Mi({imageUrl:gi().url().optional(),imageUrls:eo.array(gi().url()).max(10).optional()})}),Mi({type:eo.enum(["link"]),data:Mi({link:gi().url(),chatOnly:eo.boolean().optional()})}),Mi({type:eo.enum(["oa"]),data:Mi({id:gi()})}),Mi({type:eo.enum(["gif"]),data:Mi({gifUrl:gi().url(),imageUrl:gi().url().optional(),width:_i().min(0).optional(),height:_i().min(0).optional()})}),Mi({type:eo.enum(["video"]),data:Mi({videoThumb:gi().url(),videoUrl:gi().url(),width:_i().min(0).optional(),height:_i().min(0).optional()})}),Mi({type:eo.enum(["zmp","zmp_deep_link"]),data:Mi({title:gi().max(100),thumbnail:gi().url(),path:gi().optional(),description:gi().max(400).default("").optional()})})])];function Ha(e){return Ka.apply(this,arguments)}function Ka(){return Ka=De((function(e){return Ze(this,(function(t){return[2,Gn("openShareSheet",Ga,[e],function(){var e=De((function(e){var t,n;return Ze(this,(function(r){switch(r.label){case 0:return Je.isMp?(t=e.type,n=e.data,[4,Va(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Qe("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ka.apply(this,arguments)}var Ja=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Ke())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)?e({userAllow:void 0===t.error_code||(null==t?void 0:t.error_code)>=0,message:void 0===t.error_code?"User allowed":null==t?void 0:t.error_message}):e({userAllow:(null==t?void 0:t.error_code)>=0,message:null==t?void 0:t.error_message})},fail:function(n){var r,i;(null===(r=Ke())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)&&"number"==typeof(null==n?void 0:n.code)?e({userAllow:(null==n?void 0:n.code)>=0,message:null==n?void 0:n.message}):t(n)}},{isMultiCallback:!0})}))]}))}));function qa(e){return Qa.apply(this,arguments)}function Qa(){return(Qa=De((function(e){return Ze(this,(function(t){return[2,Gn("requestCameraPermission",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return[4,Ja()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Ya=function(){var e=De((function(e,t,n){return Ze(this,(function(r){return[2,new Promise((function(r,i){In("CREATE_SHORTCUT",{url:e,title:t,iconUrl:n},{success:function(e){r(e)},fail:function(e){i(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),$a=De((function(){var e,t,n,r=arguments;return Ze(this,(function(i){switch(i.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:o,t=r.length>1&&void 0!==r[1]?r[1]:0,n=Xn(),[4,cn(e,t,n.version)];case 1:return[2,i.sent()]}}))})),Xa=function(){var e=De((function(e,t,n,r){var i,o,a,s,u;return Ze(this,(function(c){return i=new URL(e),o=i.href.includes("vnpay"),a=i.searchParams.get("typeInapp"),s=Dt.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?dn(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?dn(null==t?void 0:t.leftButton):"back"},u=Number.isInteger(n)?n:void 0,o||!Dt.isEmpty(a)||r||i.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){In("OPEN_INAPP",{url:i.href,style:s,h5_src_open:u},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r,i){return e.apply(this,arguments)}}(),es=[Mi({params:eo.record(gi(),gi()).optional()}).optional()];function ts(e){return ns.apply(this,arguments)}function ns(){return ns=De((function(e){return Ze(this,(function(t){return[2,Gn("createShortcut",es,[e],function(){var e=De((function(e){var t,n,r,i,s,u,c,l;return Ze(this,(function(d){switch(d.label){case 0:return Je.isMp?[4,$a(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=Ke())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||Dn("og:image:url")||"",u=r.name||document.title,(c=(null==e?void 0:e.params)?new URLSearchParams(null==e?void 0:e.params):new URLSearchParams).append("utm_source","zalo-shortcut"),c.append("utm_medium","default"),c.append("utm_campaign","default"),i?(c.append("appId",o),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,Xa(encodeURI(l),void 0,void 0,!0)]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Ya("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,Pn.success()];case 6:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ns.apply(this,arguments)}var rs=function(){var e=De((function(e,t,n){return Ze(this,(function(r){return[2,new Promise((function(r,o){In("PROMPT_AUTHENTICATION",{secret_data:e,app_id:i,ui:{title:null==t?void 0:t.title,sub_title:null==t?void 0:t.subTitle,negative_text:null==t?void 0:t.negativeButtonText},require_fingerprint:n?1:0},{success:function(e){var t,n,i,o;r({code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null==e||null===(t=e.data)||void 0===t?void 0:t.domain,code:null==e||null===(n=e.data)||void 0===n?void 0:n.error_code,message:null==e||null===(i=e.data)||void 0===i?void 0:i.error_message,payToken:null==e||null===(o=e.data)||void 0===o?void 0:o.pay_token}})},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),is=[Mi({secretData:gi(),ui:Mi({title:gi().default("Xác thực").optional(),subTitle:gi().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:gi().default("Đóng").optional()}).optional(),requireFingerprint:Ti().default(!0).optional()}).optional()];function os(e){return as.apply(this,arguments)}function as(){return as=De((function(e){return Ze(this,(function(t){return[2,Gn("openBioAuthentication",is,[e],function(){var e=De((function(e){var t,n,r;return Ze(this,(function(i){switch(i.label){case 0:return Je.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,rs(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Qe("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),as.apply(this,arguments)}var ss=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("PROMPT_AUTHENTICATION_CHECK_STATE",{},{success:function(t){e(null==t?void 0:t.bio_state)},fail:function(e){t(e)}},{actionName:"action.prompt.authentication.check_state"})}))]}))}));function us(e){return cs.apply(this,arguments)}function cs(){return(cs=De((function(e){return Ze(this,(function(t){return[2,Gn("checkStateBioAuthentication",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,ss()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Je.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Qe("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var ls=function(){var e=De((function(e){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ds=[Mi({message:gi()}).optional()];function ps(e){return fs.apply(this,arguments)}function fs(){return fs=De((function(e){return Ze(this,(function(t){return[2,Gn("showToast",ds,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,ls(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fs.apply(this,arguments)}var hs=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function ms(e){return vs.apply(this,arguments)}function vs(){return(vs=De((function(e){return Ze(this,(function(t){return[2,Gn("hideKeyboard",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,hs()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var ys=function(){var e=De((function(e){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),gs=[Mi({phoneNumber:gi()})];function _s(e){return ws.apply(this,arguments)}function ws(){return ws=De((function(e){return Ze(this,(function(t){return[2,Gn("openPhone",gs,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,ys(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ws.apply(this,arguments)}var bs=function(){var e=De((function(e,t){return Ze(this,(function(n){return[2,new Promise((function(n,r){In("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ts=[Mi({content:gi(),phoneNumber:gi()})];function Es(e){return Ps.apply(this,arguments)}function Ps(){return Ps=De((function(e){return Ze(this,(function(t){return[2,Gn("openSMS",Ts,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,bs(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ps.apply(this,arguments)}var Ss=function(){var e=De((function(e){var t,n=arguments;return Ze(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){In("VIEW_MYQR",{dpn:t,uid:e,zapp:i},{success:function(){n()},fail:function(e){r(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Is=[Mi({id:gi(),displayName:gi().default("").optional()})];function As(e){return Os.apply(this,arguments)}function Os(){return Os=De((function(e){return Ze(this,(function(t){return[2,Gn("viewOAQr",Is,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,Ss(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Os.apply(this,arguments)}var ks=function(){var e=De((function(e){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("KEEP_SCREEN",{data:{keep_screen_on:e?1:0}},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Cs=[Mi({keepScreenOn:Ti()})];function Ns(e){return Ms.apply(this,arguments)}function Ms(){return Ms=De((function(e){return Ze(this,(function(t){return[2,Gn("keepScreen",Cs,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,ks(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ms.apply(this,arguments)}function Rs(e){return xs.apply(this,arguments)}function xs(){return(xs=De((function(e){return Ze(this,(function(t){return[2,Gn("onKeepScreen",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,ks(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function Ds(e){return Ls.apply(this,arguments)}function Ls(){return(Ls=De((function(e){return Ze(this,(function(t){return[2,Gn("offKeepScreen",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,ks(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var Us=function(){var e=De((function(e,t,n){var r;return Ze(this,(function(i){return r={},e?r={imageBase64Data:e}:t&&(r={imageUrl:t}),[2,new Promise((function(e,t){In("SAVE_IMAGE_GALLERY",Ca($e({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),js=[Mi({imageBase64Data:gi().max(7e6).optional(),imageUrl:gi().url().optional()}).optional()];function Bs(e){return Zs.apply(this,arguments)}function Zs(){return Zs=De((function(e){return Ze(this,(function(t){return[2,Gn("saveImageToGallery",js,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,Us(e.imageBase64Data,e.imageUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zs.apply(this,arguments)}var zs=function(){var e=De((function(e,t,n){var r;return Ze(this,(function(i){return r={},t?r={videoBase64Data:t}:e&&(r={videoUrl:e}),[2,new Promise((function(e,t){In("SAVE_VIDEO_GALLERY",Ca($e({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Ws=[Mi({videoUrl:gi().url().optional(),videoBase64Data:gi().max(7e6).optional()}).optional()];function Fs(e){return Vs.apply(this,arguments)}function Vs(){return Vs=De((function(e){return Ze(this,(function(t){return[2,Gn("saveVideoToGallery",Ws,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,zs(e.videoUrl,e.videoBase64Data,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("saveVideoToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vs.apply(this,arguments)}var Gs=function(){var e=De((function(e){var t,n,r,i,o,a,u=arguments;return Ze(this,(function(c){switch(c.label){case 0:t=u.length>1&&void 0!==u[1]?u[1]:"/",n=u.length>2&&void 0!==u[2]?u[2]:{},c.label=1;case 1:return c.trys.push([1,3,,4]),[4,$a(e,0)];case 2:return r=c.sent(),[3,4];case 3:return c.sent(),[3,4];case 4:i={appId:e},r&&(i.appName=r.name,i.appAvtUrl=r.logoUrl),o="".concat(s,"/").concat(e).concat(t);try{a=new URL(o),Object.entries(n).forEach((function(e){var t=Xe(e,2),n=t[0],r=t[1];a.searchParams.append(n,String(r))})),o=a.href}catch(e){}return[2,new Promise((function(e,t){In("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),Hs=[Mi({appId:gi(),path:gi().optional(),params:eo.record(gi(),gi()).optional()})];function Ks(e){return Js.apply(this,arguments)}function Js(){return Js=De((function(e){return Ze(this,(function(t){return[2,Gn("openMiniApp",Hs,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,Gs(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Js.apply(this,arguments)}var qs=De((function(){var t,n,r=arguments;return Ze(this,(function(i){return t=r.length>0&&void 0!==r[0]?r[0]:"oneShot",n=r.length>1?r[1]:void 0,[2,new Promise((function(r,i){In("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),Qs=[Mi({type:eo.enum(["oneShot"]).default("oneShot").optional(),milliseconds:_i().optional()}).optional()];function Ys(e){return $s.apply(this,arguments)}function $s(){return $s=De((function(e){return Ze(this,(function(t){return[2,Gn("vibrate",Qs,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,qs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$s.apply(this,arguments)}var Xs=[Mi({url:gi(),config:Mi({style:eo.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:eo.enum(["back","none"]).default("back").optional()}).optional()})];function eu(e){return tu.apply(this,arguments)}function tu(){return tu=De((function(e){return Ze(this,(function(t){return[2,Gn("openWebview",Xs,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,Xa(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),tu.apply(this,arguments)}function nu(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=en.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function ru(){return Gn("getRouteParams",[],[],(function(){return nu()}))}function iu(e){return ou.apply(this,arguments)}function ou(){return(ou=De((function(e){return Ze(this,(function(t){return[2,Gn("getAppInfo",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,$a()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Qe("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var au=function(){var e=De((function(e){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("WEBVIEW_SET_RESULT",{result:Ln(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),su=[Mi({data:eo.any()})];function uu(e){return cu.apply(this,arguments)}function cu(){return cu=De((function(e){return Ze(this,(function(t){return[2,Gn("sendDataToPreviousMiniApp",su,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,au(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cu.apply(this,arguments)}var lu=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){var n,r;In("MP_GET_NUMBER",{forceUpdate:!0},{success:function(n){var r={};if(null==n?void 0:n.token)return r.token=null==n?void 0:n.token,e(r);t(Pn.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Ke())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function du(e){return pu.apply(this,arguments)}function pu(){return(pu=De((function(e){return Ze(this,(function(t){return[2,Gn("getPhoneNumber",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,lu()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Qe("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var fu=De((function(){var t,n,r,a=arguments;return Ze(this,(function(s){return t=a.length>0&&void 0!==a[0]?a[0]:1,n=a.length>1?a[1]:void 0,r=a.length>2?a[2]:void 0,[2,new Promise((function(a,s){var u=$e({},n===e.OpenProfilePickerType.TOOL_DEL_FRIEND?{maxProfile:t,src:n,uids:r,zapp:i,appId:o}:{maxProfile:t});In("MP_OPEN_PROFILE_PICKER",u,{success:function(e){Array.isArray(e)?a(e.map((function(e){return e.id}))):a([])},fail:function(e){s(e)}},{isMultiCallback:!0})}))]}))})),hu=[Mi({maxProfile:_i().optional().default(1),src:eo.enum([e.OpenProfilePickerType.TOOL_DEL_FRIEND]).optional(),uids:Ni(gi()).optional()}).superRefine((function(t,n){var r=t.src,i=t.maxProfile;r===e.OpenProfilePickerType.TOOL_DEL_FRIEND?i<1&&n.addIssue({code:"custom",path:["maxProfile"],message:"maxProfile must be at least 1 when src is 'tool_del_friend'"}):(i<1||i>10)&&n.addIssue({code:"custom",path:["maxProfile"],message:"maxProfile must be between 1 and 10"})}))],mu=function(){var e=De((function(e,t){var n,r,i;return Ze(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(r=new URLSearchParams).append("appId",o),r.append("accessToken",t),r.append("userIds",JSON.stringify(e)),[4,fetch(d.CONVERT_USER_IDS,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r})];case 1:return[4,a.sent().json()];case 2:return 0===(null==(i=a.sent())?void 0:i.err)&&Array.isArray(null==i||null===(n=i.data)||void 0===n?void 0:n.userIds)?[2,i.data.userIds]:[3,4];case 3:return a.sent(),[2,e];case 4:return[2,e]}}))}));return function(t,n){return e.apply(this,arguments)}}();function vu(e){return yu.apply(this,arguments)}function yu(){return yu=De((function(t){return Ze(this,(function(n){return[2,Gn("openProfilePicker",hu,[t],function(){var t=De((function(t){var n,r,i,o,a,s,u,c,l,p,f,h,m;return Ze(this,(function(v){switch(v.label){case 0:return Je.isMp?[4,fu(null==t?void 0:t.maxProfile,null==t?void 0:t.src,null==t?void 0:t.uids)]:[3,15];case 1:return n=v.sent(),r=function(e,t){return Array.from({length:Math.ceil(e.length/t)},(function(n,r){return e.slice(r*t,r*t+t)}))},n.length>0?[4,kn.getAccessToken()]:[3,14];case 2:return i=v.sent(),(null==t?void 0:t.src)===e.OpenProfilePickerType.TOOL_DEL_FRIEND?[3,4]:[4,mu(n,i||"")];case 3:return o=v.sent(),[3,5];case 4:o=n,v.label=5;case 5:a=r(o,20),s=[],u=!0,c=!1,l=void 0,v.label=6;case 6:v.trys.push([6,11,12,13]),p=function(){var e,t,n,r,o,a,u;return Ze(this,(function(c){switch(c.label){case 0:e=h.value,c.label=1;case 1:return c.trys.push([1,4,,5]),[4,fetch(d.GET_LIST_USER_INFO,{method:"POST",headers:{"Content-Type":"application/json",access_token:i||""},body:JSON.stringify({fields:"id,name,picture",user_ids:e})})];case 2:return[4,c.sent().json()];case 3:if(0!==(t=c.sent()).error||!t.data)throw new Error(t.message);return r=e.map((function(e){var n,r,i,o,a,s,u,c,l,d,p;return{id:(null===(n=t.data[e])||void 0===n||null===(r=n.user_info)||void 0===r?void 0:r.user_id_by_app)||"",profile:{name:null===(i=t.data[e])||void 0===i||null===(o=i.user_info)||void 0===o?void 0:o.name,avatar:null===(a=t.data[e])||void 0===a||null===(s=a.user_info)||void 0===s||null===(u=s.picture)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.url},code:0!==(null===(l=t.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(Dt.isUndefined(null===(d=t.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=t.data[e])||void 0===p?void 0:p.message)}})),(n=s).push.apply(n,Be(r)),[3,5];case 4:return o=c.sent(),u=e.map((function(e){return{id:e,profile:{name:"",avatar:""},code:-1,message:"Can't get profile: ".concat(o.message)}})),(a=s).push.apply(a,Be(u)),[3,5];case 5:return[2]}}))},f=a[Symbol.iterator](),v.label=7;case 7:return(u=(h=f.next()).done)?[3,10]:[5,ze(p())];case 8:v.sent(),v.label=9;case 9:return u=!0,[3,7];case 10:return[3,13];case 11:return m=v.sent(),c=!0,l=m,[3,13];case 12:try{u||null==f.return||f.return()}finally{if(c)throw l}return[7];case 13:return[2,{users:s}];case 14:return[2,{users:[]}];case 15:return Je.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Qe("openProfilePicker",{}))]}}))}));return function(e){return t.apply(this,arguments)}}())]}))})),yu.apply(this,arguments)}var gu=function(){var e=De((function(e,t,n){var r;return Ze(this,(function(i){return r=t&&Dt.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){In("MP_JOIN_WIFI",{ssid:e,securityType:r,password:t,hiddenSsid:n},{success:function(e){i(e)},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),_u=[Mi({SSID:gi(),password:gi().optional(),hiddenSSID:Ti().optional()})];function wu(e){return bu.apply(this,arguments)}function bu(){return bu=De((function(e){return Ze(this,(function(t){return[2,Gn("connectWifi",_u,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,gu(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bu.apply(this,arguments)}var Tu=function(){var t=De((function(t,n,r,i,o,a,s){var u,c;return Ze(this,(function(l){return u=n&&n.length>0?{type:0,url:n,max_size:r||1048576}:null,c={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(n,r){In("PICK_MEDIA",{featureFlag:null===u?1:void 0,media_type:e.MediaPickerType[t],edit_view:$e({},c,i),silent_request:o,upload:u,max_select_items:a,compressLevel:null!=s?s:0},{success:function(e){n(null!==u?null==e?void 0:e.result_content:null==e?void 0:e.path)},fail:function(e){r(e)}},{isMultiCallback:!0})}))]}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),Eu=[Mi({type:eo.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:gi().url().optional(),maxItemSize:_i().min(0).optional(),editView:Mi({enable:Ti().optional(),aspectRatio:gi().regex(/^\d+:\d+$/).optional()}).optional(),silentRequest:Ti().optional(),maxSelectItem:_i().min(1).optional(),compressLevel:_i().min(0).max(3).default(0)})];function Pu(e){return Su.apply(this,arguments)}function Su(){return Su=De((function(e){return Ze(this,(function(t){return[2,Gn("openMediaPicker",Eu,[e],function(){var e=De((function(e){var t,n,r,i,o,a,s;return Ze(this,(function(u){switch(u.label){case 0:return Je.isMp?(i={},Dt.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(n=e.editView)||void 0===n?void 0:n.enable)?i.enable=1:i.enable=0,i.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio,o=!0===e.silentRequest?1:0,a=e.maxSelectItem,s=e.compressLevel,[4,Tu(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a,s)]):[3,2];case 1:return[2,{data:u.sent()}];case 2:return Je.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Qe("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Su.apply(this,arguments)}var Iu=[Mi({title:gi().max(100),description:gi().max(400).default(""),thumbnail:gi().url().optional(),path:gi().optional()})];function Au(e){return Ou.apply(this,arguments)}function Ou(){return Ou=De((function(e){return Ze(this,(function(t){return[2,Gn("getShareableLink",Iu,[e],function(){var e=De((function(e){var t;return Ze(this,(function(n){switch(n.label){case 0:return[4,kn.getAccessToken()];case 1:return t=n.sent(),[4,Fa(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ou.apply(this,arguments)}var ku=function(){var e=De((function(e){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("MP_CLOSE_LOADINGVIEW",{at:(new Date).getTime(),when:e,url:location.href},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}();function Cu(e){return Nu.apply(this,arguments)}function Nu(){return(Nu=De((function(e){return Ze(this,(function(t){return[2,Gn("closeLoading",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,ku("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}var Mu=function(){var e=De((function(e){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}();function Ru(e){return xu.apply(this,arguments)}function xu(){return xu=De((function(e){return Ze(this,(function(t){return[2,Gn("requestUpdateZalo",[],[e],De((function(){var e,t,n;return Ze(this,(function(r){switch(r.label){case 0:return Je.isMp?(n=(null===(e=Ke())||void 0===e||null===(t=e.platform)||void 0===t?void 0:t.isIOS)?"https://apps.apple.com/vn/app/zalo/id579523206":"https://play.google.com/store/apps/details?id=com.zing.zalo",[4,Mu(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("requestUpdateZalo",{}))]}}))})))]}))})),xu.apply(this,arguments)}var Du=Yt.getInstance();Du.addListener=function(t,n,r){var i=t;return Du.addListener(e.Events[i],n,r)};var Lu=[eo.function()];function Uu(t){return Gn("onConfirmToExit",Lu,[t],(function(t){var n=t;Je.isMp&&(Du.on(e.Events.AppClose,n,'{"handle_h5": 1}'),no.setNavigationBarLeftButton(void 0,2))}))}function ju(){return Gn("offConfirmToExit",[],[],(function(){Je.isMp&&(Du.off(e.Events.AppClose),no.setNavigationBarLeftButton(void 0,0))}))}function Bu(){return Gn("getDeviceId",[],[],(function(){return Je.isMp&&kn.getSync(l.DEVICE_ID)||""}))}function Zu(e){return zu.apply(this,arguments)}function zu(){return(zu=De((function(e){return Ze(this,(function(t){return[2,Gn("getDeviceIdAsync",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,kn.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function Wu(){return Gn("getContext",[],[],(function(){if(Je.isMp){var e=kn.getSync(l.CONTEXT_ID)||"";return{type:kn.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function Fu(e){return Vu.apply(this,arguments)}function Vu(){return(Vu=De((function(e){return Ze(this,(function(t){return[2,Gn("getContextAsync",[],[e],De((function(){var e;return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,kn.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,kn.jumpAndGetToken(l.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function Gu(e){return Hu.apply(this,arguments)}function Hu(){return(Hu=De((function(e){return Ze(this,(function(t){return[2,Gn("getAuthCode",[],[e],De((function(){var e,t;return Ze(this,(function(n){switch(n.label){case 0:return Je.isMp?[4,kn.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,kn.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,kn.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw ln([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),Pn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function Ku(e){return Ju.apply(this,arguments)}function Ju(){return(Ju=De((function(e){return Ze(this,(function(t){return[2,Gn("getZPIToken",[],[e],De((function(){var e,t,n,r;return Ze(this,(function(i){switch(i.label){case 0:return Je.isMp?[4,kn.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,kn.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,kn.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,kn.jumpAndGetToken(l.ZPT_ZPI)];case 4:return r=i.sent()||"",[2,{utoken:e,gtoken:t,zpp:n,zpt:r}];case 5:return[2,Promise.resolve({utoken:"",gtoken:"",zpp:"",zpt:""})]}}))})))]}))}))).apply(this,arguments)}var qu=[gi()];function Qu(e){return Gn("setAccessToken",qu,[e],(function(e){var t=e;kn.setAccessToken(t)}))}var Yu=[Mi({url:gi().url()})];function $u(e){return Xu.apply(this,arguments)}function Xu(){return Xu=De((function(e){return Ze(this,(function(t){return[2,Gn("openOutApp",Yu,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,Mu(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xu.apply(this,arguments)}var ec=[Mi({count:_i().min(1).optional().default(1),sourceType:eo.array(eo.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:eo.enum(["back","front"]).default("front").optional()})];function tc(e){return nc.apply(this,arguments)}function nc(){return nc=De((function(e){return Ze(this,(function(t){return[2,Gn("chooseImage",ec,[e],function(){var e=De((function(e){var t,n,r,i;return Ze(this,(function(o){return t=e.sourceType||["album","camera"],n=e.cameraType||"front",r=e.count||1,(i=document.createElement("input")).type="file",i.multiple=r>1,i.accept="image/*",i.style.display="none",1===t.length&&t.includes("camera")&&(i.accept="front"===n?"zcamera/photo-frontfacing":"zcamera/photo-backfacing",i.capture="front"===n?"user":"environment"),[2,new Promise((function(e,t){i.addEventListener("change",(function(n){var i,o=(null==n||null===(i=n.target)||void 0===i?void 0:i.files)||[];if(o.length>r)t(new Error("You are only allowed to choose a maximum of ".concat(r," images at a time")));else{var a={filePaths:[],tempFiles:[]};Array.from(o).forEach((function(e){a.filePaths.push(URL.createObjectURL(e)),a.tempFiles.push({path:URL.createObjectURL(e),size:e.size})})),e(a)}})),document.body.appendChild(i),i.click()}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),nc.apply(this,arguments)}var rc=De((function(){var e,t,n=arguments;return Ze(this,(function(r){return e=n.length>0&&void 0!==n[0]&&n[0],t=n.length>1&&void 0!==n[1]?n[1]:"Cho phép Zalo truy cập vào vị trí của thiết bị này?",[2,new Promise((function(n,r){In("GET_LOCATION",{silent_request:e,permission_description:t,forceUpdate:!0},{success:function(e){var t={};if(null==e?void 0:e.token)return t.token=null==e?void 0:e.token,n(t);r(Pn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function ic(e){return oc.apply(this,arguments)}function oc(){return(oc=De((function(e){return Ze(this,(function(t){return[2,Gn("getLocation",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,rc()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({token:""})]:[2,Promise.reject(Qe("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var ac=[eo.function().args(Mi({data:eo.any()})).returns(eo.void())];function sc(t){return Gn("onCallbackData",ac,[t],(function(){!function(t){Yt.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var uc=function(){var e=De((function(e){var t,n,r,i,o,a,s,u,c,l,d,p;return Ze(this,(function(f){switch(f.label){case 0:return e||(e=nu()),"object"==typeof e&&((r=e.zmpOrderId||e.orderId)||(n=e.appTransID||e.apptransid||e.transId)),"string"==typeof e&&(i=en.getParameterByName("orderId",e),o=en.getParameterByName("appTransID",e)||en.getParameterByName("apptransid",e),n=i||o),a={headers:{authorization:"Bearer "}},[4,kn.jumpAndGetToken()];case 1:return f.sent(),s=null===(t=kn.miniProgramConfig)||void 0===t?void 0:t.jwt,a.headers.authorization="Bearer ".concat(s),u=new URL(Q),c={orderId:r||"",transId:n||""},u.search=new URLSearchParams(c).toString(),[4,fetch(u.toString(),a)];case 2:return[4,f.sent().json()];case 3:if(!(l=f.sent()).data)throw Pn.error.badRequest(l.msg);return d=l.data||{},p={err:l.err,msg:l.msg},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,$e({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),cc=function(){var t=De((function(t,n,r,i,a,s,u){var c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,I,A,O,k;return Ze(this,(function(C){switch(C.label){case 0:c=o,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("mac",i),r&&l.append("desc",encodeURIComponent(r)),a&&(d=a,"object"==typeof a&&(d=JSON.stringify(a)),l.append("extradata",encodeURIComponent(d))),s&&(p=s,"object"==typeof s&&(p=JSON.stringify(s)),l.append("payload",encodeURIComponent(p))),u&&("string"==typeof u?(l.append("method",u),l.append("isCustom","false")):"object"==typeof u&&(l.append("method",u.id),l.append("isCustom",JSON.stringify(u.isCustom)))),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,kn.jumpAndGetToken()];case 2:return C.sent(),m=null===(h=kn.miniProgramConfig)||void 0===h?void 0:h.jwt,f.headers.authorization="Bearer ".concat(m),[4,fetch(J,Ca($e({method:"POST"},f),{body:l}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw Pn.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=v.data.messageToken||"",w=window.APP_VERSION,b=window.APP_ENV,T={miniAppId:c,orderId:y},E=v.data.method,P=v.data.isCustom,g&&(T.token=g),w&&(T.version=w),b&&(T.env=b),E&&(T.method=E),P&&(T.isCustom=P),S=en.encode(T),I=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),A=mn(),O=pn()&&A<742?"normal":"bottomSheet",Kt.enablePaymentDone=Yt.getInstance().eventNames().includes(e.Events.PaymentDone),[4,Xa(I,{style:O}).then((function(){var t=!1;Yt.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(De((function(){var n;return Ze(this,(function(r){switch(r.label){case 0:return t?[3,2]:(Yt.getInstance().emit(e.Events.PaymentDone,y,{orderId:y}),[4,uc({zmpOrderId:y})]);case 1:(n=r.sent()).err>=0&&!n.isCustom&&Yt.getInstance().emit(e.Events.PaymentClose,n.err,Ca($e({},n),{zmpOrderId:y})),r.label=2;case 2:return[2]}}))})),500)})),Yt.getInstance().once(e.Events.OpenApp,(function(){t=!0})),Yt.getInstance().once(e.Events.PaymentDone,(function(){t=!0,Kt.enablePaymentDone=!1}))}))];case 5:return C.sent(),[2,{orderId:y,messageToken:_}];case 6:throw k=C.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),lc=[Mi({amount:eo.union([gi(),_i()]),item:eo.array(eo.record(gi(),eo.any())),desc:eo.string(),mac:eo.string(),extradata:eo.any().optional(),payload:eo.any().optional(),method:eo.union([eo.string(),eo.object({id:eo.string(),isCustom:eo.boolean()})]).optional()})];function dc(e){return pc.apply(this,arguments)}function pc(){return pc=De((function(e){return Ze(this,(function(t){return[2,Gn("createOrder",lc,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,cc(e.amount,e.item,e.desc,e.mac,e.extradata,e.payload,e.method)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Qe("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pc.apply(this,arguments)}var fc=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),hc=function(){var e=De((function(e,t,n,r,i){var o,a,s,u,c,l,d,p,f,h,m;return Ze(this,(function(v){switch(v.label){case 0:(o=new URLSearchParams).append("amount",e.toString()),t&&o.append("desc",encodeURIComponent(t)),n&&o.append("method",n),r&&o.append("transId",r),i&&o.append("mac",i),a={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},v.label=1;case 1:return v.trys.push([1,9,,10]),[4,kn.jumpAndGetToken()];case 2:if(v.sent(),c=null===(s=kn.miniProgramConfig)||void 0===s?void 0:s.jwt,a.headers.authorization="Bearer ".concat(c),!(null===(u=kn.miniProgramConfig)||void 0===u?void 0:u.showConfirmToPayment))return[3,6];v.label=3;case 3:return v.trys.push([3,5,,6]),[4,fc()];case 4:return v.sent(),[3,6];case 5:throw l=v.sent(),console.error("Failed:",l),l;case 6:return[4,fetch(Y,Ca($e({method:"POST"},a),{body:o}))];case 7:return[4,v.sent().json()];case 8:if(!(d=v.sent()).data||0!==d.err)throw Pn.error.badRequest(d.msg);return p=d.data.id,f=d.data.messageToken||"",h=d.data.transId||"",[2,{orderId:p,messageToken:f,transId:h}];case 9:throw m=v.sent(),console.log("Internal error"),m;case 10:return[2]}}))}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),mc=[Mi({amount:eo.union([eo.string(),eo.number()]),desc:eo.string(),method:eo.string(),transId:eo.string().optional(),mac:eo.string().optional()})];function vc(e){return yc.apply(this,arguments)}function yc(){return yc=De((function(e){return Ze(this,(function(t){return[2,Gn("purchase",mc,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,hc(e.amount,e.desc,e.method,null==e?void 0:e.transId,null==e?void 0:e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Qe("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yc.apply(this,arguments)}var gc=function(){var e=De((function(e,t){return Ze(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;In("MP_SELECT_PAYMENT_METHOD",{isBinding:i,channels:e,selectedMethod:t,forceUpdate:!0},{success:function(e){console.log(e),n(e)},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),_c=[Mi({channels:Ni(Mi({method:gi(),subMethod:gi().optional(),subInfo:gi().optional()})).optional(),selectedMethod:Mi({method:gi(),subMethod:gi().optional()}).optional()}).optional()];function wc(e){return bc.apply(this,arguments)}function bc(){return bc=De((function(e){return Ze(this,(function(t){return[2,Gn("selectPaymentMethod",_c,[e],function(){var e=De((function(e){var t,n;return Ze(this,(function(r){switch(r.label){case 0:return Je.isMp?(t=e.channels,n=e.selectedMethod,[4,gc(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Qe("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bc.apply(this,arguments)}var Tc=[Mi({data:eo.union([gi(),eo.record(gi(),gi().nullish())])})];function Ec(e){return Pc.apply(this,arguments)}function Pc(){return Pc=De((function(e){return Ze(this,(function(t){return[2,Gn("checkTransaction",Tc,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,uc(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Qe("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pc.apply(this,arguments)}var Sc=function(){var t=De((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,b,T;return Ze(this,(function(E){switch(E.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===ee&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===X&&(h=e.ProrationMode.DEFERRED),f.append("utm",a||"default"),f.append("merchantTransId",s||""),f.append("prorationMode",h.toString()),f.append("appId",p),i&&f.append("method",i),m="",(null===(u=Ke())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Ke())||void 0===l||null===(d=l.platform)||void 0===d?void 0:d.isAndroid)&&(m="android"),f.append("os",m),f.append("productId",t),v={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},E.label=1;case 1:return E.trys.push([1,5,,6]),[4,kn.jumpAndGetToken()];case 2:return E.sent(),g=null===(y=kn.miniProgramConfig)||void 0===y?void 0:y.jwt,v.headers.authorization="Bearer ".concat(g),[4,fetch(q,Ca($e({method:"POST"},v),{body:f}))];case 3:return[4,E.sent().json()];case 4:if(!(_=E.sent()).data||!_.data.store||0!==_.err)throw Pn.error.createIAPOrderFailed(_.err);return w=_.data.store,b=_.data.orderId,[2,new Promise((function(e,t){In("IAP_REQUESTPAYMENT",$e({},w),{success:function(){e({orderId:b})},fail:function(e){t(e)}})}))];case 5:throw T=E.sent(),console.log("Internal error"),T;case 6:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),Ic=[Mi({productId:gi(),payType:eo.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:eo.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:gi().optional(),method:eo.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:gi().optional()})];function Ac(e){return Oc.apply(this,arguments)}function Oc(){return Oc=De((function(e){return Ze(this,(function(t){return[2,Gn("createOrderIAP",Ic,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,Sc(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Qe("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oc.apply(this,arguments)}var kc=[Mi({hide:Ti().default(!1).optional()}).optional()];function Cc(e){return Nc.apply(this,arguments)}function Nc(){return Nc=De((function(e){return Ze(this,(function(t){return[2,Gn("setAndroidBottomNavigationBar",kc,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,no.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Nc.apply(this,arguments)}var Mc=[Mi({hide:Ti().default(!1).optional()}).optional()];function Rc(e){return xc.apply(this,arguments)}function xc(){return xc=De((function(e){return Ze(this,(function(t){return[2,Gn("setIOSBottomSafeArea",Mc,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,no.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xc.apply(this,arguments)}var Dc=[Mi({type:eo.enum(["normal","hidden","transparent"]).default("normal").optional(),color:eo.string().optional()}).optional()];function Lc(e){return Uc.apply(this,arguments)}function Uc(){return Uc=De((function(e){return Ze(this,(function(t){return[2,Gn("setStatusBar",Dc,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,no.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Uc.apply(this,arguments)}var jc=[Mi({headerTextColor:eo.enum(["black","white"]).optional(),headerColor:eo.string().optional(),actionBar:Mi({hide:eo.boolean().optional(),title:eo.string().optional(),leftButton:eo.enum(["back","none"]).optional(),textAlign:eo.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:eo.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:eo.boolean().optional(),hideIOSSafeAreaBottom:eo.boolean().optional()})];function Bc(e){return Zc.apply(this,arguments)}function Zc(){return Zc=De((function(e){return Ze(this,(function(t){return[2,Gn("configAppView",jc,[e],function(){var e=De((function(e){var t,n,r,i,o,a,s;return Ze(this,(function(u){switch(u.label){case 0:return Je.isMp?Dt.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,no.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return Dt.isUndefined(null===(n=e.actionBar)||void 0===n?void 0:n.title)||!(null===(r=e.actionBar)||void 0===r?void 0:r.title)?[3,4]:[4,no.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,no.configHeader({hideActionBar:null===(i=e.actionBar)||void 0===i?void 0:i.hide,statusBarType:e.statusBarType,headerTextColor:e.headerTextColor,headerColor:e.headerColor,textAlign:null===(o=e.actionBar)||void 0===o?void 0:o.textAlign})];case 5:u.sent(),u.label=6;case 6:return u.trys.push([6,11,,12]),"boolean"!=typeof e.hideAndroidBottomNavigationBar?[3,8]:[4,no.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,no.setIOSBottomSafeArea(e.hideIOSSafeAreaBottom)];case 9:u.sent(),u.label=10;case 10:return[3,12];case 11:return u.sent(),[3,12];case 12:return[2];case 13:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zc.apply(this,arguments)}var zc=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Wc(e){return Fc.apply(this,arguments)}function Fc(){return(Fc=De((function(e){return Ze(this,(function(t){return[2,Gn("minimizeApp",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,zc()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Vc=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function Gc(e){return Hc.apply(this,arguments)}function Hc(){return(Hc=De((function(e){return Ze(this,(function(t){return[2,Gn("openPermissionSetting",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,Vc()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Kc=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Jc(e){return qc.apply(this,arguments)}function qc(){return(qc=De((function(e){return Ze(this,(function(t){return[2,Gn("favoriteApp",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,Kc()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Qc=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Yc(e){return $c.apply(this,arguments)}function $c(){return($c=De((function(e){return Ze(this,(function(t){return[2,Gn("openGroupList",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,Qc()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Xc=De((function(){var e;return Ze(this,(function(t){switch(t.label){case 0:return[4,kn.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){In("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function el(e){return tl.apply(this,arguments)}function tl(){return(tl=De((function(e){return Ze(this,(function(t){return[2,Gn("requestSendNotification",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,Xc()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var nl=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function rl(e){return il.apply(this,arguments)}function il(){return(il=De((function(e){return Ze(this,(function(t){return[2,Gn("addRating",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,nl()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Qe("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var ol=function(){var e=De((function(e){var t,n,r,i,o,a,s;return Ze(this,(function(u){switch(u.label){case 0:return[4,kn.jumpAndGetToken()];case 1:if(u.sent(),!(r=null===(t=kn.miniProgramConfig)||void 0===t?void 0:t.jwt))throw new _n(g,M);return(i=new URLSearchParams).append("data",JSON.stringify(function(e){return{title:e.title,name:e.name,desc:e.desc||e.ownerName,avatarUrl:e.avatarUrl||e.merchantLogoUrl,meta:{code:e.code,display:e.display||"qr_code",partner:e.partner,name:e.name,merchantName:e.merchantName,merchantOaId:e.merchantOaId,merchantLogoUrl:e.merchantLogoUrl,ownerName:e.ownerName,condition:e.condition,conditionDetail:e.conditionDetail,validAt:e.validAt,expiredAt:e.expiredAt,remindAt:e.remindAt,actions:e.actions}}}(e))),[4,fetch($,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(r)},body:i})];case 2:o=u.sent(),u.label=3;case 3:return u.trys.push([3,5,,6]),[4,o.json()];case 4:return a=u.sent(),[3,6];case 5:throw u.sent(),new _n(A,z);case 6:if(0!==(null==a?void 0:a.err))throw new _n("number"==typeof(null==a?void 0:a.err)?a.err:A,function(e){var t="string"==typeof(null==e?void 0:e.msg)?e.msg.trim():"";return t||(-1===(null==e?void 0:e.err)?"Unknown exception":z)}(a));if(!(s=null===(n=a.data)||void 0===n?void 0:n.deeplink))throw new _n(A,z);return[4,Xa(s)];case 7:return u.sent(),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),al=Mi({type:eo.enum(["url","phone"]),value:gi().min(1),cta:gi().min(1)}),sl=[Mi({title:gi().min(1).max(200),name:gi().min(1).max(200),desc:gi().min(1).max(500).optional(),avatarUrl:gi().url().max(500).optional(),code:gi().min(1).max(64),display:eo.enum(["qr_code","bar_code"]).default("qr_code").optional(),partner:gi().min(1).optional(),merchantName:gi().min(1).max(100),merchantOaId:gi().min(1).max(50),merchantLogoUrl:gi().url().max(500).optional(),ownerName:gi().min(1).max(100),condition:gi().min(1).max(500),conditionDetail:gi().min(1).max(2e3).optional(),validAt:_i().int().nonnegative().optional(),expiredAt:_i().int().positive(),remindAt:_i().int().nonnegative().optional(),actions:eo.array(al).max(3).optional()})];function ul(e){return cl.apply(this,arguments)}function cl(){return cl=De((function(e){return Ze(this,(function(t){return[2,Gn("addVoucher",sl,[e],function(){var e=De((function(e,t){var n;return Ze(this,(function(r){switch(r.label){case 0:return n=t||e,Je.isMp?[4,ol(n)]:[3,2];case 1:return[2,r.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("addVoucher",{}))]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))})),cl.apply(this,arguments)}var ll,dl=(ll=De((function(e,t,n){var r,i;return Ze(this,(function(o){switch(o.label){case 0:return(r=new URLSearchParams).append("appId",t),r.append("accessToken",n),r.append("oaId",e),i={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CHECK_INTERACT_OA,$e({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return ll.apply(this,arguments)}),pl=function(){var e=De((function(e){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("MP_INTERACT_OA",{oaId:e,forceUpdate:!0},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),fl=[Mi({oaId:gi()})];function hl(e){return ml.apply(this,arguments)}function ml(){return ml=De((function(e){return Ze(this,(function(t){return[2,Gn("interactOA",fl,[e],function(){var e=De((function(e){var t,n,r;return Ze(this,(function(i){switch(i.label){case 0:return Je.isMp?(t=e.oaId,[4,kn.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||Dt.isEmpty(n)?[3,3]:[4,dl(t,o,n)];case 2:if(0===(null==(r=i.sent())?void 0:r.err))return[2,Promise.resolve({})];i.label=3;case 3:return[4,pl(t)];case 4:return[2,i.sent()];case 5:return Je.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Qe("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ml.apply(this,arguments)}var vl=[Mi({oaId:gi()})];function yl(e){return gl.apply(this,arguments)}function gl(){return gl=De((function(e){return Ze(this,(function(t){return[2,Gn("isAllowedInteractWithOA",vl,[e],function(){var e=De((function(e){var t,n,r;return Ze(this,(function(i){switch(i.label){case 0:return Je.isMp?(t=e.oaId,[4,kn.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||Dt.isEmpty(n)?[3,3]:[4,dl(t,o,n)];case 2:return r=i.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return Je.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Qe("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),gl.apply(this,arguments)}function _l(e){return wl.apply(this,arguments)}function wl(){return(wl=De((function(e){return Ze(this,(function(t){return[2,Gn("getSetting",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,Tn()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Qe("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var bl=eo.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber","scope.userFriends"]),Tl=[Mi({scopes:eo.array(bl).max(2).optional()}).optional()];function El(e){return Pl.apply(this,arguments)}function Pl(){return Pl=De((function(e){return Ze(this,(function(t){return[2,Gn("authorize",Tl,[e],function(){var e=De((function(e){var t;return Ze(this,(function(n){switch(n.label){case 0:return Je.isMp?(t=null==e?void 0:e.scopes,vn(724,573)?[4,An(null!=t?t:void 0)]:[3,2]):[3,3];case 1:return[2,n.sent()];case 2:return[2,Promise.reject(Pn.error.clientNotSupport())];case 3:return Je.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Qe("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pl.apply(this,arguments)}var Sl=De((function(){return Ze(this,(function(e){return[2,new Promise(function(){var e=De((function(e,t){var n;return Ze(this,(function(r){switch(r.label){case 0:return Dt.isUndefined(ZaloJavaScriptInterface)||"function"!=typeof ZaloJavaScriptInterface.checkCameraPermission?[3,2]:[4,ZaloJavaScriptInterface.checkCameraPermission()];case 1:return n=r.sent(),[2,e({userAllow:"grant"===n})];case 2:return t(Pn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Il(e){return Gn("checkZaloCameraPermission",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return[4,Sl()];case 1:return[2,e.sent()]}}))})))}var Al=De((function(){return Ze(this,(function(e){return[2,new Promise(function(){var e=De((function(e,t){var n,r,i;return Ze(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,kn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=kn.miniProgramConfig)||void 0===n?void 0:n.userId,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Ol(e){return kl.apply(this,arguments)}function kl(){return(kl=De((function(e){return Ze(this,(function(t){return[2,Gn("getUserID",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,Al()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Qe("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var Cl=De((function(){return Ze(this,(function(e){return[2,new Promise(function(){var e=De((function(e,t){var n,r,i;return Ze(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,kn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=kn.miniProgramConfig)||void 0===n?void 0:n.idToken,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Nl(e){return Ml.apply(this,arguments)}function Ml(){return(Ml=De((function(e){return Ze(this,(function(t){return[2,Gn("getIDToken",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,Cl()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Qe("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Rl={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},xl={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},Dl=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;Lt(this,t),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(c.haveVideoStream()&&c._userRequestFrameCallback){var t=c.getCanvas();if(c.drawFrame(),t){var n={data:t.toDataURL(e.PhotoFormat.PNG),width:t.width,height:t.height};Yt.getInstance().emit(e.CameraEvents.OnFrameCallback,0,n),requestAnimationFrame(c.tick)}}},this._videoElement=n,this._mediaConstraints=null!=u?u:null,this._facingMode=null!==(r=null==u?void 0:u.facingMode)&&void 0!==r?r:xl.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(i=null==u?void 0:u.deviceId)&&void 0!==i?i:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(o=null==u?void 0:u.mirrored)&&void 0!==o?o:xl.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:xl.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:xl.video}var n=t.prototype;return n.on=function(t,n){Yt.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){Yt.getInstance().off(t),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!1)},n.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},n.getFacingMode=function(){return this._facingMode},n.getCameraList=function(){return this._cameraList},n.getCameraCount=function(){return this._cameraList.length},n.getSelectedDeviceId=function(){return this._selectedDeviceId},n.setDeviceId=function(e){var t=this;return De((function(){return Ze(this,(function(n){switch(n.label){case 0:return t._selectedDeviceId=e,t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},n.updateMediaConstraints=function(e){var t=this;return De((function(){var n,r,i,o,a,s;return Ze(this,(function(u){switch(u.label){case 0:return Dt.isEmpty(e)?[2]:JSON.stringify(e)!==JSON.stringify(t._mediaConstraints)?(t._mediaConstraints=e,t._facingMode=null!==(n=null==e?void 0:e.facingMode)&&void 0!==n?n:t._facingMode,t._selectedDeviceId=null!==(r=null==e?void 0:e.deviceId)&&void 0!==r?r:t._selectedDeviceId,t._mirror=null!==(i=null==e?void 0:e.mirrored)&&void 0!==i?i:t._mirror,t._audioEnabled=null!==(o=null==e?void 0:e.audio)&&void 0!==o?o:t._audioEnabled,t._videoEnabled=null!==(a=null==e?void 0:e.video)&&void 0!==a?a:t._videoEnabled,t._selectedDeviceId=null!==(s=null==e?void 0:e.deviceId)&&void 0!==s?s:t._selectedDeviceId,t._hasUserMedia?[4,t.stream()]:[3,2]):[2];case 1:u.sent(),u.label=2;case 2:return[2]}}))}))()},n.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||xl.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||xl.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},n.selectCamera=function(){var t=!0,n=!1,r=void 0;try{for(var i,o=this._cameraList[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(this._facingMode==e.FacingMode.FRONT&&a.label.toLowerCase().includes("front")||this._facingMode==e.FacingMode.BACK&&a.label.toLowerCase().includes("back")){this._selectedDeviceId=a.deviceId;break}}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}},n.flip=function(){var t=this;return De((function(){return Ze(this,(function(n){switch(n.label){case 0:return t._facingMode=t._facingMode==e.FacingMode.FRONT?e.FacingMode.BACK:e.FacingMode.FRONT,t._videoElement.style.transform="",t.selectCamera(),t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.start=function(){var t=this;return De((function(){var n,r;return Ze(this,(function(i){return n=Yt.getInstance(),r=function(e){try{t._hasUserMedia&&t.stop()}catch(e){}},n.off(e.Events.AppPaused,r),n.on(e.Events.AppPaused,r),[2,new Promise(function(){var n=De((function(n,r){var i;return Ze(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),Yt.getInstance().emit(e.CameraEvents.OnStartCallback,0),n(t._selectedDeviceId),[3,3];case 2:return i=o.sent(),r(i),[3,3];case 3:return[2]}}))}));return function(e,t){return n.apply(this,arguments)}}())]}))}))()},n.info=function(){var e=this;return De((function(){return Ze(this,(function(t){return[2,new Promise((function(t,n){navigator.mediaDevices.enumerateDevices().then((function(n){e.getVideoInputs(n),t(e._cameraList)})).catch((function(e){n(e)}))}))]}))}))()},n.stream=function(){var e=this;return De((function(){return Ze(this,(function(t){return[2,new Promise((function(t,n){try{e._stop();var r=e.getCurrentMediaConstraints();if(!1===r.video&&!r.audio)return void t(e._facingMode);navigator.mediaDevices.getUserMedia(r).then(function(){var n=De((function(n){return Ze(this,(function(r){switch(r.label){case 0:return[4,e.info()];case 1:return r.sent(),e.selectCamera(),e.handleUserMedia(null,n),t(e._facingMode),[2]}}))}));return function(e){return n.apply(this,arguments)}}()).catch((function(t){e.handleUserMedia(t),n(t)}))}catch(e){n(e)}}))]}))}))()},n.handleUserMedia=function(t,n){var r=this;if(!t&&n){this._stream=n;try{this._videoElement&&(this._videoElement.srcObject=n,(this._facingMode==e.FacingMode.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){r._userRequestFrameCallback&&r.tick()},this._videoElement.play().then((function(){r._hasUserMedia=!0})).catch((function(e){r._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},n.updateTrackEnable=function(t,n){var r=this;return De((function(){return Ze(this,(function(i){switch(i.label){case 0:if(t===e.StreamType.VIDEO){if(r._videoEnabled===n)return[2];r._videoEnabled=n}else{if(r._audioEnabled===n)return[2];r._audioEnabled=n}return[4,r.stream()];case 1:return i.sent(),[2]}}))}))()},n.pause=function(e){var t=this;return De((function(){return Ze(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},n.resume=function(e){var t=this;return De((function(){return Ze(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},n.isUsing=function(){return this._hasUserMedia},n.stop=function(){this._stop(),Yt.getInstance().emit(e.CameraEvents.OnStopCallback,0)},n._stop=function(){t.stopMediaStream(this._stream),this._hasUserMedia=!1},n.setFacingMode=function(e){this._facingMode=e},n.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},n.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||Rl.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},n.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},n.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},n.drawFrame=function(t){var n=this._videoElement,r=t||{};if(n&&this._ctx&&this._canvasElement){var i=this._canvasElement,o=this._ctx;i.width=(null==r?void 0:r.width)||i.width,i.height=(null==r?void 0:r.height)||i.height,((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.translate(i.width,0),o.scale(-1,1)),o.drawImage(n,0,0,i.width,i.height),((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.scale(-1,1),o.translate(-i.width,0))}},t.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},t}(),Ll=Mi({play:eo.function(),pause:eo.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),Ul=[Mi({videoElement:Ll,mediaConstraints:eo.object({width:eo.number().min(100).optional(),height:eo.number().min(100).optional(),facingMode:eo.string().optional(),audio:eo.boolean().optional(),video:eo.boolean().optional(),deviceId:eo.string().optional(),mirrored:eo.boolean().optional()}).nullish()}).optional()];function jl(e){return Gn("createCameraContext",Ul,[e],(function(e){return new Dl(e.videoElement,e.mediaConstraints)}))}var Bl=function(){function e(){var t,n;Lt(this,e),this.sdkLoaded=!1,this.queue=[];var r=window.AdtimaZMA={config:{cateId:null===(t=window.zmpGlobal)||void 0===t||null===(n=t.appInfo)||void 0===n?void 0:n.cateType,appId:window.APP_ID},queue:[],load:function(e,t){r.queue=Be(r.queue).concat([[e,t]])}}}var t=e.prototype;return t.loadSDK=function(){var e=this,t=document.createElement("script");t.src="https://adtima-static.zascdn.me/resource/js/zma/sdk.js?q=".concat(Math.floor((new Date).getTime()/864e5)),t.onload=function(){e.sdkLoaded=!0,e.processQueue()},t.onerror=function(){e.sdkLoaded=!0},document.body.appendChild(t)},t.load=function(e,t){var n;Dt.isFunction(null===(n=window.AdtimaZMA)||void 0===n?void 0:n.load)&&window.AdtimaZMA.load(e,t)},t.display=function(e){var t;this.sdkLoaded?Dt.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.display)&&window.AdtimaZMA.display(e):this.queue.push(this.display.bind(this,e))},t.refresh=function(e){var t;this.sdkLoaded?Dt.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.refresh)&&window.AdtimaZMA.refresh(e):this.queue.push(this.refresh.bind(this,e))},t.processQueue=function(){for(;this.queue.length>0;){var e=this.queue.shift();e&&e()}},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}();function Zl(e){return zl.apply(this,arguments)}function zl(){return(zl=De((function(e){return Ze(this,(function(t){return[2,Gn("setupAd",[],[e],(function(){return Bl.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var Wl=[Mi({ids:eo.union([eo.string(),eo.array(eo.string())]),config:Mi({display:eo.boolean().optional(),onClose:eo.function().optional()}).optional()})];function Fl(e){return Vl.apply(this,arguments)}function Vl(){return Vl=De((function(e){return Ze(this,(function(t){return[2,Gn("loadAd",Wl,[e],function(){var e=De((function(e){return Ze(this,(function(t){return Bl.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vl.apply(this,arguments)}var Gl=[Mi({id:eo.string()})];function Hl(e){return Kl.apply(this,arguments)}function Kl(){return Kl=De((function(e){return Ze(this,(function(t){return[2,Gn("displayAd",Gl,[e],function(){var e=De((function(e){return Ze(this,(function(t){return Bl.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Kl.apply(this,arguments)}var Jl=[Mi({id:eo.string().optional()}).optional()];function ql(e){return Ql.apply(this,arguments)}function Ql(){return Ql=De((function(e){return Ze(this,(function(t){return[2,Gn("refreshAd",Jl,[e],function(){var e=De((function(e){return Ze(this,(function(t){return Bl.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ql.apply(this,arguments)}var Yl,$l=[Mi({id:gi(),guidingText:gi().optional(),color:gi().optional(),onStatusChange:eo.function().optional(),onError:eo.function().optional()}).catchall(eo.any())];function Xl(e){return ed.apply(this,arguments)}function ed(){return ed=De((function(e){return Ze(this,(function(n){return[2,Gn("showOAWidget",$l,[e],function(){var e=De((function(e){var n,r,i,o,a,s,u,c;return Ze(this,(function(l){if(Je.isMp){try{n=document.getElementById(e.id),r=e.onStatusChange,i=e.guidingText,o=e.color,a=t(e,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="ifOAW-".concat(e.id,"-").concat(Date.now()),(c=new URL(Me.OA)).searchParams.set("id",u),c.searchParams.set("appId",window.APP_ID),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=Xe(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.removeEventListener("message",Yl,!1),Yl=function(){var e=De((function(e){var t,n,i,o,a,s,l,d;return Ze(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith(Ne)?(n=document.getElementById(u),i=t.type,(o=new URL(t.href)).origin!==c.origin||o.pathname!==c.pathname||t.id!==u?[3,3]:"followOA"!==i&&"getOAInfo"!==i?[3,2]:[4,kn.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=kn.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},Ne),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?Ta(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",Yl,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("showOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ed.apply(this,arguments)}var td,nd="showFunctionButtonWidget",rd=[eo.object({id:eo.string(),type:eo.string(),text:eo.string(),color:eo.string().optional(),disabled:eo.boolean().optional(),onDataReceived:eo.function().optional(),onError:eo.function().optional()}).catchall(eo.any())],id=function(e){if(yn(e,_n))return new _n(e.code,e.message,nd,e.detail);if(yn(e,Error))return new _n(m,e.message,nd);if("object"==typeof e&&null!==e&&"code"in e&&"message"in e&&"number"==typeof e.code&&("string"==typeof(n=e.message)||Array.isArray(n)&&n.every((function(e){return"string"==typeof e})))){var t=e;return new _n(t.code,t.message,nd,t.detail)}var n;return"string"==typeof e?new _n(m,e,nd):new _n(m,k,nd,e)};function od(e){return ad.apply(this,arguments)}function ad(){return ad=De((function(e){return Ze(this,(function(n){return[2,Gn(nd,rd,[e],function(){var e=De((function(e){var n,r,i,o,a,s,u,c;return Ze(this,(function(l){if(Je.isMp){try{n=document.getElementById(e.id),r=e.onDataReceived,i=e.onError,o=t(e,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="ifFBW-".concat(e.id,"-").concat(Date.now()),(u=new URL(Me.FUNCTION_BUTTON)).searchParams.set("id",s),u.searchParams.set("appId",window.APP_ID),Object.entries(o).forEach((function(e){var t=Xe(e,2),n=t[0],r=t[1];r&&u.searchParams.set("data-".concat(n),String(r))})),a.id=s,a.src=u.href,a.style.width="100%",a.style.height="100%",a.style.border="none",Object.entries(o).forEach((function(e){var t=Xe(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.removeEventListener("message",td,!1),td=function(){var e=De((function(e){var t,n,a,c,l,d,p,f,h,m,v,y,g,_,w;return Ze(this,(function(b){switch(b.label){case 0:if(t=e.data,!e.origin.startsWith(Ne))return[3,6];if("object"!=typeof t||null===t)return[2];if(n=document.getElementById(s),a=t.type,"string"!=typeof t.href)return[2];try{c=new URL(t.href)}catch(e){return null==i||i(id(e)),[2]}if(c.origin!==u.origin||c.pathname!==u.pathname||t.id!==s)return[3,6];if("buttonClicked"!==a)return[3,5];b.label=1;case 1:return b.trys.push([1,3,,4]),[4,kn.jumpAndGetToken()];case 2:return b.sent(),f=null===(l=kn.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=kn.miniProgramConfig)||void 0===d?void 0:d.encryptKey,null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h}},Ne),[3,4];case 3:return m=b.sent(),null==i||i(id(m)),[3,4];case 4:return[3,6];case 5:if("onSuccess"===a){if((null==(v=t.payload)?void 0:v.type)===o.type){if("string"!=typeof(y=null==v?void 0:v.data))return null==i||i(id("Invalid function button widget response")),[2];g={callAction:function(e,t){var r;null==n||null===(r=n.contentWindow)||void 0===r||r.postMessage({type:"context.callAction",payload:{actionName:e,actionData:t}},Ne)}},null==r||r(y,o.type,g)}}else"onError"===a&&(null==(_=t.payload)?void 0:_.type)===o.type&&(null==i||i(id(null!==(w=null==_?void 0:_.data)&&void 0!==w?w:"Function button widget failed")));b.label=6;case 6:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",td,!1))}catch(t){null===(c=e.onError)||void 0===c||c.call(e,id(t))}return[2,Promise.resolve()]}return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("showFunctionButtonWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ad.apply(this,arguments)}var sd=function(){var t=De((function(t,n){var r,i,o=arguments;return Ze(this,(function(a){return r=o.length>2&&void 0!==o[2]&&o[2],i={},"cccd"===t&&(i={mrz:null==n?void 0:n.mrz}),[2,new Promise((function(n,o){In("SCAN_NFC",{type:e.ScanNFCType[t],data:i,skip_active_authen:r},{success:function(e){if("cccd"===t){var r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P={dg1:null!==(r=e.dg1)&&void 0!==r?r:"",dg2:null!==(i=e.dg2)&&void 0!==i?i:"",dg3:null!==(o=e.dg3)&&void 0!==o?o:"",dg4:null!==(a=e.dg4)&&void 0!==a?a:"",dg5:null!==(s=e.dg5)&&void 0!==s?s:"",dg6:null!==(u=e.dg6)&&void 0!==u?u:"",dg7:null!==(c=e.dg7)&&void 0!==c?c:"",dg8:null!==(l=e.dg8)&&void 0!==l?l:"",dg9:null!==(d=e.dg9)&&void 0!==d?d:"",dg10:null!==(p=e.dg10)&&void 0!==p?p:"",dg11:null!==(f=e.dg11)&&void 0!==f?f:"",dg12:null!==(h=e.dg12)&&void 0!==h?h:"",dg13:null!==(m=e.dg13)&&void 0!==m?m:"",dg14:null!==(v=e.dg14)&&void 0!==v?v:"",dg15:null!==(y=e.dg15)&&void 0!==y?y:"",dg16:null!==(g=e.dg16)&&void 0!==g?g:"",com:null!==(_=e.com)&&void 0!==_?_:"",sod:null!==(w=e.sod)&&void 0!==w?w:"",challenge:null!==(b=e.challenge)&&void 0!==b?b:"",aAResult:null!==(T=e.aAResult)&&void 0!==T?T:"",eACCAResult:null!==(E=e.eACCAResult)&&void 0!==E?E:""};n(P)}else n({})},fail:function(e){o(e)}},{timeout:!1})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),ud=[Mi({type:eo.enum(["cccd"]),data:Mi({mrz:gi().max(90)}),skip_active_authen:Ti().optional().default(!1)})];function cd(e){return ld.apply(this,arguments)}function ld(){return ld=De((function(e){return Ze(this,(function(t){return[2,Gn("scanNFC",ud,[e],function(){var e=De((function(e){var t,n,r,i;return Ze(this,(function(o){switch(o.label){case 0:return Je.isMp?vn(754,620)?(n=e.type,r=e.data,i=null!==(t=e.skip_active_authen)&&void 0!==t&&t,[4,sd(n,r,i)]):[3,2]:[3,3];case 1:return[2,o.sent()];case 2:return[2,Promise.reject(Pn.error.clientNotSupport())];case 3:return Je.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Qe("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ld.apply(this,arguments)}var dd=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function pd(e){return fd.apply(this,arguments)}function fd(){return(fd=De((function(e){return Ze(this,(function(t){return[2,Gn("checkNFC",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,dd()]:[3,2];case 1:return[2,e.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Qe("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}var hd=[eo.string().trim().min(1)];var md=[eo.string().trim().min(1),eo.string().trim()];var vd=[eo.string().trim().min(1)];var yd={getItem:function(e){return Gn("getItem",hd,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Je.isMp||Je.isMpWeb){if(vn(757,625))return Do.getItem(t[0]);throw Pn.error.clientNotSupport()}throw Qe("getItem",{})}))},setItem:function(e,t){return Gn("setItem",md,[e,t],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Je.isMp||Je.isMpWeb){if(vn(757,625))return Do.setItem(t[0],t[1]);throw Pn.error.clientNotSupport()}throw Qe("setItem",{})}))},clear:function(){return Gn("clear",[],[],(function(){if(Je.isMp||Je.isMpWeb){if(vn(757,625))return Do.clearStorageSync();throw Pn.error.clientNotSupport()}throw Qe("clear",{})}))},removeItem:function(e){return Gn("removeItem",vd,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Je.isMp||Je.isMpWeb){if(vn(757,625))return Do.removeItem(t[0]);throw Pn.error.clientNotSupport()}throw Qe("removeItem",{})}))},getStorageInfo:function(){return Gn("getStorageInfoSync",[],[],(function(){if(Je.isMp||Je.isMpWeb){if(vn(757,625))return Do.getStorageInfoSync();throw Pn.error.clientNotSupport()}throw Qe("getStorageInfoSync",{})}))}},gd=function(){var e=De((function(e,t,n){var r,i;return Ze(this,(function(a){switch(a.label){case 0:return[4,$a(o,0)];case 1:return r=a.sent(),i=JSON.stringify({qrContent:n,merchantLogo:r.logoUrl,merchantName:r.name,orderDescription:t,amount:e}),[2,new Promise((function(e,t){In("MP_OPEN_ZINSTANTVIEW",{viewId:"4f9f9b4ba70e4e50171f",payload:{bundle_data:i,typeView:3,clearBackground:!0,occupyStatusBar:!0,disableSlideToBack:!0,disableBack:!1}},{success:function(n){console.log(n);try{n&&"string"==typeof n?(r=JSON.parse(n),(i=r&&r.act_type?r.act_type:null)&&Re.includes(i)?e({status:i}):t("Unknown action or checkout failed")):t("Invalid format response data")}catch(e){t(e)}var r,i},fail:function(e){t(e)}},{})}))]}}))}));return function(t,n,r){return e.apply(this,arguments)}}(),_d=[Mi({amount:eo.union([eo.string(),eo.number()]),orderDescription:eo.string(),qrContent:eo.string()})];function wd(){return wd=De((function(e){return Ze(this,(function(t){return[2,Gn("openCheckoutPopup",_d,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,gd(e.amount,e.orderDescription,e.qrContent)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Qe("openCheckoutPopup",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wd.apply(this,arguments)}var bd={purchase:vc,createOrder:dc,checkTransaction:Ec,createOrderIAP:Ac,selectPaymentMethod:wc,openCheckoutPopup:function(e){return wd.apply(this,arguments)}},Td=bd,Ed=function(){var e=De((function(e,t,n){var r;return Ze(this,(function(i){return r={},t?r={fileBase64Data:t}:e&&(r={fileUrl:e}),[2,new Promise((function(e,t){In("SAVE_FILE",Ca($e({},r),{onProgress:n}),{success:function(t){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Pd=[Mi({url:eo.string().url().optional(),fileBase64Data:eo.string().max(7e6).optional()}).optional()];function Sd(e){return Id.apply(this,arguments)}function Id(){return Id=De((function(e){return Ze(this,(function(t){return[2,Gn("downloadFile",Pd,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,Ed(e.url,e.fileBase64Data,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("downloadFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Id.apply(this,arguments)}var Ad=eo.enum(["APP_INITIALIZING","APP_READY"]),Od=eo.any();var kd,Cd={logEvent:function(e,t){return Gn("logEvent",[Ad,Od],[e,t],(function(e,t){if(Je.isMp||Je.isMpWeb){var n,r,i,o=Ca($e({},"object"==typeof t&&null!==t?t:{}),{duration:Math.round(performance.now()),timestamp:Date.now()});return null===window||void 0===window||null===(n=window.zmpGlobal)||void 0===n||null===(r=n.eventManager)||void 0===r||null===(i=r.logEventForClient)||void 0===i||i.call(r,{type:p.DEV_TRACKING,eventCode:"APP_INITIALIZING"===e?f.APP_INITIALIZING:f.APP_READY}),ln([{action:"zmp.app.lifecycle.tracking",error:0,message:"",data:$e({eventType:e},o)}])}throw Qe("logEvent",{})}))}},Nd=[Mi({id:gi(),textColor:eo.string().optional(),fontSize:eo.string().optional(),buttonHeight:eo.string().optional(),buttonColor:eo.string().optional(),buttonTextColor:eo.string().optional(),buttonRadius:eo.string().optional(),buttonText:eo.string().optional(),checkboxBGColor:eo.string().optional(),checkboxCheckmarkColor:eo.string().optional(),onClick:eo.function().optional(),onStatusChange:eo.function().optional(),onError:eo.function().optional()}).catchall(eo.any())];function Md(e){return Rd.apply(this,arguments)}function Rd(){return Rd=De((function(e){return Ze(this,(function(n){return[2,Gn("showCustomOAWidget",Nd,[e],function(){var e=De((function(e){var n,r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T;return Ze(this,(function(E){if(Je.isMp){try{n=document.getElementById(e.id),r=e.textColor,i=e.fontSize,o=e.buttonHeight,a=e.buttonColor,s=e.buttonTextColor,u=e.buttonRadius,c=e.buttonText,l=e.checkboxBGColor,d=e.checkboxCheckmarkColor,p=e.onStatusChange,f=e.onClick,h=e.onError,m=t(e,["textColor","fontSize","buttonHeight","buttonColor","buttonTextColor","buttonRadius","buttonText","checkboxBGColor","checkboxCheckmarkColor","onStatusChange","onClick","onError"]),n&&(v=document.createElement("iframe"),y="ifCOAW-".concat(e.id,"-").concat(Date.now()),g=new URL(Me.CUSTOM_OA),_={id:y,appId:window.APP_ID,textColor:r,fontSize:i,buttonHeight:o,buttonColor:a,buttonTextColor:s,buttonRadius:u,buttonText:c,checkboxBGColor:l,checkboxCheckmarkColor:d},Object.entries(m).forEach((function(e){var t=Xe(e,2),n=t[0],r=t[1];r&&(_["data-".concat(n)]=String(r))})),w=JSON.stringify(_),P=w,S=(new TextEncoder).encode(P),I=Array.from(S).map((function(e){return String.fromCharCode(e)})).join(""),b=btoa(I),T=encodeURIComponent(b),Fn(g.searchParams,"data",T),v.id=y,v.src=g.href,v.style.width="100%",v.style.height="100%",v.style.border="none",n.innerHTML=v.outerHTML,window.removeEventListener("message",kd,!1),kd=function(){var e=De((function(e){var t,n,r,i,o,a,s,u,c;return Ze(this,(function(l){switch(l.label){case 0:return t=e.data,e.origin.startsWith(Ne)?(n=document.getElementById(y),r=t.type,(i=new URL(t.href)).origin!==g.origin||i.pathname!==g.pathname||t.id!==y?[3,3]:"followOA"!==r&&"getOAInfo"!==r?[3,2]:[4,kn.jumpAndGetToken()]):[3,3];case 1:return l.sent(),s=null===(o=kn.miniProgramConfig)||void 0===o?void 0:o.jwt,null==n||null===(a=n.contentWindow)||void 0===a||a.postMessage({type:r,payload:{jwt:s}},Ne),[3,3];case 2:"oaInfo"===r?null==p||p(null===(u=t.payload)||void 0===u?void 0:u.followed):"openOA"===r?Ta(t.payload.id,"oa"):"heightChange"===r?n.style.height="".concat(t.payload,"px"):"onClick"===r?null==f||f(null===(c=t.payload)||void 0===c?void 0:c.status):"onError"===r&&(null==h||h(t.payload)),l.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",kd,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}var P,S,I;return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("showCustomOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Rd.apply(this,arguments)}var xd,Dd=[Mi({id:gi(),onMethodChange:eo.function().optional()}).catchall(eo.any())];function Ld(){return Ld=De((function(e){return Ze(this,(function(n){return[2,Gn("showWidget",Dd,[e],function(){var e=De((function(e){var n,r,i,o,a,s,u,c,l,d,p,f;return Ze(this,(function(h){if(Je.isMp){try{n=document.getElementById(e.id),r=e.onMethodChange,i=e.fail,o=t(e,["onMethodChange","fail"]),n&&((a=document.getElementById(Ce))&&(null==a||null===(s=a.parentNode)||void 0===s||s.removeChild(a),a=null),a=document.createElement("iframe"),u=Ce,c=new URL(Me.CHECKOUT_KIT),l={id:u,appId:window.APP_ID},Object.entries(o).forEach((function(e){var t=Xe(e,2),n=t[0],r=t[1];r&&(l["data-".concat(n)]=r)})),d=JSON.stringify(l),p=btoa(d),f=encodeURIComponent(p),Fn(c.searchParams,"data",f),a.id=u,a.src=c.href,a.style.width="100%",a.style.height="100%",a.style.border="none",n.innerHTML=a.outerHTML,window.removeEventListener("message",xd,!1),xd=function(){var e=De((function(e){var t,n,o,a,s,l,d,p,f,h;return Ze(this,(function(m){switch(m.label){case 0:if(t=e.data,!e.origin.startsWith(Ne))return[3,9];if(n=t.type,o=document.getElementById(u),(a=new URL(t.href)).origin!==c.origin||a.pathname!==c.pathname||t.id!==u)return[3,9];switch(n){case"getInfo":return[3,1];case"getToken":return[3,2];case"heightChange":return[3,4];case"callAction":return[3,5];case"onMethodChange":return[3,6];case"onError":return[3,7]}return[3,8];case 1:return Vn(o,n,{appId:window.APP_ID,zaloVersion:mn(),appPlatform:null===(s=Ke())||void 0===s?void 0:s.platformName}),[3,9];case 2:return[4,kn.jumpAndGetToken()];case 3:return m.sent(),d=null===(l=kn.miniProgramConfig)||void 0===l?void 0:l.jwt,Vn(o,n,{jwt:d}),[3,9];case 4:return o.style.height="".concat(t.payload,"px"),[3,9];case 5:return p=t.payload,f=p.actionName,h=p.actionData,String(f).length>0&&In(f,h,{success:function(e){Vn(o,n,{status:0,actionName:f,data:e})},fail:function(e){Vn(o,n,{status:-1,actionName:f,data:e})}},{}),[3,9];case 6:return null==r||r.apply(void 0,Be(Object.values(t.payload))),[3,9];case 7:null==i||i(t.payload),m.label=8;case 8:return[3,9];case 9:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",xd,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("showWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ld.apply(this,arguments)}var Ud,jd=[Mi({amount:eo.union([eo.string(),eo.number()]),desc:eo.string(),payload:eo.object({}).catchall(eo.any()).optional()}).catchall(eo.any())];function Bd(){return Bd=De((function(e){return Ze(this,(function(n){return[2,Gn("purchase",jd,[e],function(){var e=De((function(e){return Ze(this,(function(n){return Je.isMp?[2,new Promise((function(n,r){var i=document.getElementById(Ce),o=new URL(Me.CHECKOUT_KIT);if(!(i&&yn(i,HTMLIFrameElement)&&i.src.startsWith(o.origin)&&i.src.includes(o.pathname)))return r(Qe("purchase",{message:"Widget not found or not initialized."}));e.amount,e.desc,e.payload;var a=t(e,["amount","desc","payload"]),s="purchase";Vn(i,s,$e({amount:String(e.amount),desc:e.desc,payload:e.payload||{}},a)),window.removeEventListener("message",Ud,!1),Ud=function(){var e=De((function(e){var t,i,a;return Ze(this,(function(u){if(t=e.data,e.origin.startsWith(Ne)&&(i=t.type,(a=new URL(t.href)).origin===o.origin&&a.pathname===o.pathname&&t.id===Ce)){if(i===s)return[2,n(t.payload)];if("onError"===i)return[2,r(t.payload)]}return[2]}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",Ud,!1)}))]:Je.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Qe("purchase",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bd.apply(this,arguments)}var Zd={showWidget:function(e){return Ld.apply(this,arguments)},purchase:function(e){return Bd.apply(this,arguments)}},zd=function(){var e=De((function(e){var t,n,r,i,o=arguments;return Ze(this,(function(a){return t=o.length>1&&void 0!==o[1]?o[1]:"",n=o.length>2&&void 0!==o[2]&&o[2],r=o.length>3&&void 0!==o[3]&&o[3],i=o.length>4&&void 0!==o[4]&&o[4],[2,new Promise((function(o,a){In("OPEN_DOCUMENT",{url:e,title:t,share:n,download:r,edit:i},{success:function(e){o()},fail:function(e){a(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Wd=[Mi({url:gi(),title:gi().optional(),share:eo.boolean().optional().default(!1),download:eo.boolean().optional().default(!1),edit:eo.boolean().optional().default(!1)})];function Fd(e){return Vd.apply(this,arguments)}function Vd(){return Vd=De((function(e){return Ze(this,(function(t){return[2,Gn("openDocument",Wd,[e],function(){var e=De((function(e){var t;return Ze(this,(function(n){switch(n.label){case 0:return Je.isMp?vn(25091842,666)?(t=!!(pn()&&mn()>=25111864)&&e.share,[4,zd(e.url,e.title,t,e.download,e.edit)]):[3,2]:[3,3];case 1:return[2,n.sent()];case 2:return[2,Promise.reject(Pn.error.clientNotSupport())];case 3:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("openDocument",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vd.apply(this,arguments)}function Gd(e){return Hd.apply(this,arguments)}function Hd(){return(Hd=De((function(e){return Ze(this,(function(t){return[2,Gn("getEntrySource",[],[e],De((function(){var e,t;return Ze(this,(function(n){switch(n.label){case 0:return Je.isMp?[4,kn.jumpAndGetToken()]:[3,2];case 1:return n.sent(),t=null===(e=kn.miniProgramConfig)||void 0===e?void 0:e.srcOpen,[2,Promise.resolve({srcOpen:t||""})];case 2:return[2,Promise.resolve({srcOpen:""})]}}))})))]}))}))).apply(this,arguments)}var Kd=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("GET_DEVICE_INFO",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Jd(e){return qd.apply(this,arguments)}function qd(){return(qd=De((function(e){return Ze(this,(function(t){return[2,Gn("getDeviceInfo",[],[e],De((function(){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?vn(25102854,674)?[4,Kd()]:[3,2]:[3,3];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Pn.error.clientNotSupport())];case 3:return Je.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Qe("getDeviceInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Qd=function(){var e=De((function(e,t){return Ze(this,(function(n){return[2,new Promise((function(n,r){In("LFS_FILE_INFO",{file_path:e,digest_algorithm:t},{success:function(e){n(e)},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}();function Yd(){return $d.apply(this,arguments)}function $d(){return($d=De((function(){return Ze(this,(function(e){return[2,Gn("isSupportLFS",[],[],De((function(){return Ze(this,(function(e){return Je.isMp?[2,Promise.resolve({support:vn(25112868,692)})]:Je.isMpWeb?[2,Promise.resolve({support:!1})]:[2,Promise.reject(Qe("isSupportLFS",{}))]}))})))]}))}))).apply(this,arguments)}var Xd=[Mi({filePath:eo.string(),digestAlgorithm:eo.enum(["sha1","md5"]).optional().default("md5")}).optional()];function ep(){return ep=De((function(e){return Ze(this,(function(t){return[2,Gn("getFileInfo",Xd,[e],function(){var e=De((function(e){var t;return Ze(this,(function(n){switch(n.label){case 0:return Je.isMp?[4,Yd()]:[3,4];case 1:return n.sent().support?(t=e.digestAlgorithm||"md5",[4,Qd(e.filePath,t)]):[3,3];case 2:return[2,n.sent()];case 3:throw Pn.error.clientNotSupport();case 4:return Je.isMpWeb?[2,Promise.resolve({size:"",digest:"",type:""})]:[2,Promise.reject(Qe("getFileInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ep.apply(this,arguments)}var tp=De((function(){return Ze(this,(function(e){return[2,new Promise((function(e,t){In("LFS_LIST",{},{success:function(t){var n=t.map((function(e){var t=$e({},e);try{t.filePath=t.file_path,t.createTime=t.created_time,delete t.file_path,delete t.created_time}catch(e){}return t}));e({list:n})},fail:function(e){t(e)}},{})}))]}))}));function np(){return np=De((function(e){return Ze(this,(function(t){return[2,Gn("getSavedFileList",[],[e],function(){var e=De((function(e){return Ze(this,(function(e){switch(e.label){case 0:return Je.isMp?[4,Yd()]:[3,4];case 1:return e.sent().support?[4,tp()]:[3,3];case 2:return[2,e.sent()];case 3:throw Pn.error.clientNotSupport();case 4:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("getSavedFileList",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),np.apply(this,arguments)}var rp=function(){var e=De((function(e){return Ze(this,(function(t){return[2,new Promise((function(t,n){In("LFS_FILE_REMOVE",{file_path:e},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ip=[Mi({filePath:eo.string()}).optional()];function op(){return op=De((function(e){return Ze(this,(function(t){return[2,Gn("removeSavedFile",ip,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,Yd()]:[3,4];case 1:return t.sent().support?[4,rp(e.filePath)]:[3,3];case 2:return[2,t.sent()];case 3:throw Pn.error.clientNotSupport();case 4:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("removeSavedFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),op.apply(this,arguments)}var ap=function(){var e=De((function(e,t){var n;return Ze(this,(function(r){return n={file_path:e},[2,new Promise((function(e,r){In("LFS_FILE_SAVE",Ca($e({},n),{onProgress:t}),{success:function(t){e({savedPath:t})},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),sp=[Mi({filePath:eo.string()}).optional()];function up(){return up=De((function(e){return Ze(this,(function(t){return[2,Gn("saveFile",sp,[e],function(){var e=De((function(e){return Ze(this,(function(t){switch(t.label){case 0:return Je.isMp?[4,Yd()]:[3,4];case 1:return t.sent().support?[4,ap(e.filePath,e.onProgress)]:[3,3];case 2:return[2,t.sent()];case 3:throw Pn.error.clientNotSupport();case 4:return Je.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Qe("saveFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),up.apply(this,arguments)}var cp={getFileInfo:function(e){return ep.apply(this,arguments)},getSavedFileList:function(e){return np.apply(this,arguments)},removeSavedFile:function(e){return op.apply(this,arguments)},saveFile:function(e){return up.apply(this,arguments)},isSupportLFS:Yd};window.ZaloMiniAppSDK={getVersion:$n},Hn();var lp=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},AppError:_n,login:Hn,getAccessToken:Jn,getVersion:$n,getSystemInfo:er,setNavigationBarTitle:io,setNavigationBarColor:so,setNavigationBarLeftButton:lo,setStorage:Uo,getStorage:Zo,getStorageInfo:Wo,removeStorage:Go,clearStorage:Jo,getUserInfo:$o,getNetworkType:na,onNetworkStatusChange:oa,startBeaconDiscovery:ua,stopBeaconDiscovery:da,getBeacons:ha,closeApp:ya,scanQRCode:wa,openProfile:Pa,openChat:Oa,openPostFeed:Ra,followOA:Ua,unfollowOA:za,openShareSheet:Ha,requestCameraPermission:qa,createShortcut:ts,openBioAuthentication:os,checkStateBioAuthentication:us,showToast:ps,hideKeyboard:ms,openPhone:_s,openSMS:Es,viewOAQr:As,keepScreen:Ns,onKeepScreen:Rs,offKeepScreen:Ds,saveImageToGallery:Bs,saveVideoToGallery:Fs,openMiniApp:Ks,vibrate:Ys,openWebview:eu,getRouteParams:ru,getAppInfo:iu,sendDataToPreviousMiniApp:uu,getPhoneNumber:du,openProfilePicker:vu,connectWifi:wu,openMediaPicker:Pu,getShareableLink:Au,closeLoading:Cu,requestUpdateZalo:Ru,onConfirmToExit:Uu,offConfirmToExit:ju,getDeviceId:Bu,getDeviceIdAsync:Zu,getContext:Wu,getContextAsync:Fu,getAuthCode:Gu,getZPIToken:Ku,setAccessToken:Qu,openOutApp:$u,chooseImage:tc,getLocation:ic,onCallbackData:sc,createOrder:dc,purchase:vc,selectPaymentMethod:wc,checkTransaction:Ec,createOrderIAP:Ac,events:Du,setAndroidBottomNavigationBar:Cc,setIOSBottomSafeArea:Rc,setStatusBar:Lc,configAppView:Bc,minimizeApp:Wc,openPermissionSetting:Gc,favoriteApp:Jc,openGroupList:Yc,requestSendNotification:el,addRating:rl,addVoucher:ul,interactOA:hl,interactOa:hl,isAllowedInteractWithOA:yl,getSetting:_l,authorize:El,checkZaloCameraPermission:Il,getUserID:Ol,getIDToken:Nl,createCameraContext:jl,setupAd:Zl,loadAd:Fl,displayAd:Hl,refreshAd:ql,showOAWidget:Xl,showFunctionButtonWidget:od,scanNFC:cd,checkNFC:pd,nativeStorage:yd,Payment:bd,CheckoutSDK:Td,downloadFile:Sd,trackingManager:Cd,showCustomOAWidget:Md,CheckoutKit:Zd,openDocument:Fd,getEntrySource:Gd,getDeviceInfo:Jd,LFSStorage:cp,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:Dl}),dp=t(lp,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]);!function(){var e,t=null===(e=Ke())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,lp))}(),e.AppError=_n,e.CheckoutKit=Zd,e.CheckoutSDK=Td,e.EventName=e.Events,e.LFSStorage=cp,e.Payment=bd,e.ZMACameraImp=Dl,e.addRating=rl,e.addVoucher=ul,e.authorize=El,e.checkNFC=pd,e.checkStateBioAuthentication=us,e.checkTransaction=Ec,e.checkZaloCameraPermission=Il,e.chooseImage=tc,e.clearStorage=Jo,e.closeApp=ya,e.closeLoading=Cu,e.configAppView=Bc,e.connectWifi=wu,e.createCameraContext=jl,e.createOrder=dc,e.createOrderIAP=Ac,e.createShortcut=ts,e.default=dp,e.displayAd=Hl,e.downloadFile=Sd,e.events=Du,e.favoriteApp=Jc,e.followOA=Ua,e.getAccessToken=Jn,e.getAppInfo=iu,e.getAuthCode=Gu,e.getBeacons=ha,e.getContext=Wu,e.getContextAsync=Fu,e.getDeviceId=Bu,e.getDeviceIdAsync=Zu,e.getDeviceInfo=Jd,e.getEntrySource=Gd,e.getIDToken=Nl,e.getLocation=ic,e.getNetworkType=na,e.getPhoneNumber=du,e.getRouteParams=ru,e.getSetting=_l,e.getShareableLink=Au,e.getStorage=Zo,e.getStorageInfo=Wo,e.getSystemInfo=er,e.getUserID=Ol,e.getUserInfo=$o,e.getVersion=$n,e.getZPIToken=Ku,e.hideKeyboard=ms,e.interactOA=hl,e.interactOa=hl,e.isAllowedInteractWithOA=yl,e.keepScreen=Ns,e.loadAd=Fl,e.login=Hn,e.minimizeApp=Wc,e.nativeStorage=yd,e.offConfirmToExit=ju,e.offKeepScreen=Ds,e.onCallbackData=sc,e.onConfirmToExit=Uu,e.onKeepScreen=Rs,e.onNetworkStatusChange=oa,e.openBioAuthentication=os,e.openChat=Oa,e.openDocument=Fd,e.openGroupList=Yc,e.openMediaPicker=Pu,e.openMiniApp=Ks,e.openOutApp=$u,e.openPermissionSetting=Gc,e.openPhone=_s,e.openPostFeed=Ra,e.openProfile=Pa,e.openProfilePicker=vu,e.openSMS=Es,e.openShareSheet=Ha,e.openWebview=eu,e.purchase=vc,e.refreshAd=ql,e.removeStorage=Go,e.requestCameraPermission=qa,e.requestSendNotification=el,e.requestUpdateZalo=Ru,e.saveImageToGallery=Bs,e.saveVideoToGallery=Fs,e.scanNFC=cd,e.scanQRCode=wa,e.selectPaymentMethod=wc,e.sendDataToPreviousMiniApp=uu,e.setAccessToken=Qu,e.setAndroidBottomNavigationBar=Cc,e.setIOSBottomSafeArea=Rc,e.setNavigationBarColor=so,e.setNavigationBarLeftButton=lo,e.setNavigationBarTitle=io,e.setStatusBar=Lc,e.setStorage=Uo,e.setupAd=Zl,e.showCustomOAWidget=Md,e.showFunctionButtonWidget=od,e.showOAWidget=Xl,e.showToast=ps,e.startBeaconDiscovery=ua,e.stopBeaconDiscovery=da,e.trackingManager=Cd,e.unfollowOA=za,e.vibrate=Ys,e.viewOAQr=As,Object.defineProperty(e,"__esModule",{value:!0})}));