zmp-sdk 2.47.0-beta.8 → 2.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apis/apis/openProfilePicker.js +1 -1
- package/apis/common/apis/general/openProfilePicker.js +1 -1
- package/apis/external/tslib/tslib.es6.js +1 -1
- package/apis/index.d.ts +24 -1
- package/apis/index.es.js +1 -1
- package/apis/package.json.js +1 -1
- package/apis/types/enum.js +1 -1
- package/browser.min.js +2 -2
- package/index.d.ts +25 -2
- package/index.es.js +2 -2
- package/index.js +2 -2
- package/index.umd.js +3 -3
- package/package.json +1 -1
package/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @timeBuild
|
|
2
|
+
* @timeBuild 01-08-2025 09:49:20
|
|
3
3
|
* @license zmp-sdk
|
|
4
4
|
*
|
|
5
5
|
* Copyright @ 2025. Zalo Group.
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
function e(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var t,n=1048576,r=window.zAppID,i=window.APP_ID,o="https://zalo.me/s",a="https://h5.zdn.vn/zapps",s="h5.zdn.vn",u="/zapps",c={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSION:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType",UTOKEN_ZPI:"h5.zdn.vn_utoken_zpi",GTOKEN_ZPI:"h5.zdn.vn_gtoken_zpi",ZPP_ZPI:"h5.zdn.vn_zpp_zpi",ZPT_ZPI:"h5.zdn.vn_zpt_zpi"},l={GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token",GET_LIST_USER_INFO:"https://graph.zalo.me/v2.0/me/friends/list",CREATE_ORDER:"https://payment-mini.zalo.me/api/order/create",GET_APP_INFO:"https://h5.zalo.me/apps/get-info",SEND_ACTION_LOG:"https://h5.zalo.me/log/async",CREATE_SHARE_LINK:"https://h5.zalo.me/openapi/create-sharelink",CHECK_INTERACT_OA:"https://h5.zalo.me/openapi/check-interact-oa",GET_AUTH_SETTING:"https://h5.zalo.me/apis/users/auth-settings"};!function(e){e.REQUEST="REQUEST",e.MODIFIED_REQUEST="MODIFIED_REQUEST",e.RESPONSE="RESPONSE",e.MODIFIED_RESPONSE="MODIFIED_RESPONSE",e.NOT_FOUND="NOT_FOUND"}(t||(t={}));var d,p,f=0,h=-2e3,m=-1400,v=-1500,g=-1401,y=-1404,_=-1408,b=-1409,w=-2004,T=-2005,E=-2006,I=-2007,P="Success",S="Unknown error. Please try again later.",A="Request limit exceeded. Please try again later.",O="Request timeout. Please try again later.",C="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",N="Login failed",k="This API is not supported in this version of Zalo",M="User Authentication Required. Please grant User Authentication permission before requesting User Permission",R="Unable to pick media",x="Unable to save image",D="Unable to save video",U="Unable to save file",L={SUCCESS:{code:f,message:P},UNKNOWN_ERROR:{code:h,message:S},UNAUTHORIZED:{code:g,message:C},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:y,message:k},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:_,message:O},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"}},j={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:{}},B={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:L.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:L.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:L.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:L.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:L.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:L.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:L.USER_DENIED}},iOS:{"-2":{mapTo:L.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:L.USER_DENIED},"-400":{mapTo:L.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:L.USER_DENIED},"-400":{mapTo:L.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:L.UNKNOWN_ERROR},"-10":{mapTo:L.USER_CANCEL}}}},VIEW_MYQR:{haveCallback:!0,timeout:!0,requireAccessToken:!0},KEEP_SCREEN:{haveCallback:!0,timeout:2},CHANGE_AUTOROTATE:{skipJump:!0},CHECK_APP_INSTALLED:{},QUERY_SHOW:{},QUERY_HIDE:{},OPEN_INAPPRW:{},ZALORUN_GETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_SETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_GETDAYSTEP:{haveCallback:!0},ZALORUN_FORCESUBMITDATA:{haveCallback:!0},ZALORUN_SETWEIGHT:{haveCallback:!0},OPEN_PROFILE_EXT:{},DOWNLOAD_CATE:{haveCallback:!0},JUMP_LOGIN:{skipJump:!0,whiteList:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{},OPEN_ADTIMA_ADS:{},GET_ADIDCLIENT:{},SCAN_IBEACON:{},SAVE_VIDEO_GALLERY:{versionLive:{iOS:628},errorList:{android:{"-101":{mapTo:{code:E,message:D},needMoreDetail:!0},"-102":{mapTo:{code:E,message:D},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:E,message:D},needMoreDetail:!0}}}},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:T,message:x},needMoreDetail:!0},"-102":{mapTo:{code:T,message:x},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:T,message:x},needMoreDetail:!0}}}},OPEN_MP:{versionLive:{iOS:402}},CHANGE_ACTIONBAR:{haveCallback:!0,timeout:2,versionLive:{iOS:402},skipJump:!0},ZBROWSER_MPDS:{haveCallback:!0,timeout:2,versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:L.MPDS_ACTION_INVALID},"-101":{mapTo:L.UNKNOWN_ERROR},"-105":{mapTo:L.MPDS_SOURCE_INVALID},"-106":{mapTo:L.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:L.MPDS_ACTION_INVALID},"-101":{mapTo:L.MPDS_APPID_INVALID},"-102":{mapTo:L.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:L.MPDS_ACTION_INVALID},"-101":{mapTo:L.UNKNOWN_ERROR},"-105":{mapTo:L.MPDS_SOURCE_INVALID},"-106":{mapTo:L.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:L.MPDS_ACTION_INVALID},"-101":{mapTo:L.MPDS_APPID_INVALID},"-102":{mapTo:L.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:L.USER_DENIED},"-101":{mapTo:L.USER_DENIED},"-400":{mapTo:L.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:L.USER_DENIED},"-10":{mapTo:L.USER_DENIED},"-400":{mapTo:L.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:L.USER_CANCEL}},iOS:{"-101":{mapTo:L.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:L.USER_CANCEL},999:{mapTo:{code:w,message:R},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:w,message:R}}}}},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:L.USER_DENIED},"-400":{mapTo:L.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:L.USER_DENIED},"-400":{mapTo:L.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:L.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:L.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:L.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:L.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:L.UNKNOWN_ERROR},"-600":{mapTo:L.DEVICE_NOT_SUPPORT},"-602":{mapTo:L.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:L.UNKNOWN_ERROR},"-600":{mapTo:L.DEVICE_NOT_SUPPORT},"-601":{mapTo:L.SCAN_TIMEOUT},"-602":{mapTo:L.SERVICE_NOT_READY},"-603":{mapTo:L.UNREADABLE},"-604":{mapTo:L.INVALID_MRZ},"-605":{mapTo:L.PROCESSING},"-606":{mapTo:L.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:I,message:U},needMoreDetail:!0},"-102":{mapTo:{code:I,message:U},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:I,message:U},needMoreDetail:!0}}}},MP_APP_LIFECYCLE_TRACKING:{skipJump:!1}},Z={android:{"-4":L.DECODE_FAILED,"-5":L.CLIENT_NOT_SUPPORT,"-14":L.TIME_OUT},iOS:{"-9":L.DECODE_FAILED,"-5":L.CLIENT_NOT_SUPPORT,"-14":L.TIME_OUT}},z={android:12100615,iOS:460,wp:0,unknown:0},W=5*n,F="https://payment-mini.zalo.me/api/order/create-v2",G="https://payment-mini.zalo.me/api/order/iap-create",H="https://payment-mini.zalo.me/api/transaction",V="https://payment-mini.zalo.me/api/order/purchase",K="DEFERRED",J="IMMEDIATE_AND_CHARGE_FULL_PRICE",q={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},Q=5,Y=6,$="#1843EF",X=0,ee={"-12101":"Invalid params","-12102":"Session expire","-12103":"Not permission","-12104":"Not Authorize","-12105":"Unknown exception","-12106":"Cannot create order","-12107":"Transaction not found","-12108":"Cannot update order","-12109":"Cannot decode param","-12110":"Version not support","-12111":"Receipt expire","-12112":"Product not found","-12113":"Subscription other GW","-12114":"Product already subcription","-12115":"Not exist","-12116":"Already exist","-12117":"Not allow","-12118":"Not permit","-12119":"Internal error","-2":"Unable to pay","-6":"Unable to register","-7":"Registered account","-832":"Purchased by another account","-833":"Register for another account","-834":"Unable to register","-2010":"System is maintaining","-3999":"Not in Vietnam","-12129":"Purchased by another account",123:"An error has occurred"};!function(e){e.DEV_TRACKING="devTracking"}(d||(d={})),function(e){e[e.APP_INITIALIZING=95]="APP_INITIALIZING",e[e.APP_READY=96]="APP_READY"}(p||(p={}));var te,ne,re,ie,oe,ae,se,ue,ce,le,de,pe,fe,he,me,ve,ge,ye,_e,be,we,Te,Ee,Ie="checkoutKitWidget-ifCKW",Pe="https://h5.zalo.me",Se={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"};function Ae(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 Oe(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ae(o,r,i,a,s,"next",e)}function s(e){Ae(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Ce(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 Ne(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ke(e,t){if(e){if("string"==typeof e)return Ce(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)?Ce(e,t):void 0}}function Me(e){return function(e){if(Array.isArray(e))return Ce(e)}(e)||Ne(e)||ke(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 Re(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 xe(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,Me(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function De(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(s)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(u)),isMpWeb:window.location.hostname.includes("localhost")}}xe.async=function(e){return Oe((function(){var t,n,r,i,o=arguments;return Re(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,Me(n))];case 2:return[2,a.sent()];case 3:return i=a.sent(),"undefined"!=typeof console&&console.error&&console.error(i),[2,null];case 4:return[2]}}))}))},function(e){e.none="none",e.wifi="wifi",e.cellular="cellular",e.unknown="unknown"}(te||(te={})),function(e){e.wp="wp",e.android="android",e.iOS="iOS",e.unknown="unknown"}(ne||(ne={})),function(e){e.AppPaused="h5.event.paused",e.AppResumed="h5.event.resumed",e.NetworkChanged="h5.event.connection.changed",e.OnDataCallback="h5.event.webview.result",e.WebviewClosed="h5.event.webview.close",e.OpenApp="h5.event.open.mp",e.AppClose="h5.event.action.close",e.PaymentCallback="payment.callback",e.PaymentResult="action.payment.result",e.PaymentDone="action.payment.done",e.PaymentClose="action.payment.close",e.DownloadProgress="h5.event.webview.download.progress"}(re||(re={})),function(e){e.DOING="doing",e.DONE="done"}(ie||(ie={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa",e[e.aliasOA=2]="aliasOA"}(oe||(oe={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa"}(ae||(ae={})),function(e){e[e.image=1]="image",e[e.multi_image=2]="multi_image",e[e.link=4]="link",e[e.profile=5]="profile"}(se||(se={})),function(e){e[e.cccd=1]="cccd"}(ue||(ue={})),function(e){e[e.image=1]="image",e[e.gif=11]="gif",e[e.video=12]="video",e[e.link=4]="link",e[e.oa=5]="oa",e[e.zmp=20]="zmp",e[e.multi_image=21]="multi_image",e[e.zmp_deep_link=4]="zmp_deep_link",e[e.text=22]="text"}(ce||(ce={})),function(e){e[e.auto=1]="auto",e[e.portrait=2]="portrait",e[e.landscape=3]="landscape"}(le||(le={})),function(e){e[e.oneShot=0]="oneShot"}(de||(de={})),function(e){e[e.zcamera=3]="zcamera",e[e.zcamera_photo=1]="zcamera_photo",e[e.zcamera_video=2]="zcamera_video",e[e.zcamera_scan=7]="zcamera_scan",e[e.photo=4]="photo",e[e.video=5]="video",e[e.file=6]="file"}(pe||(pe={})),function(e){e.SUBSCRIPTION="SUBSCRIPTION",e.ONETIME="ONETIME"}(fe||(fe={})),function(e){e[e.UNKNOW=0]="UNKNOW",e[e.DEFERRED=1]="DEFERRED",e[e.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE"}(he||(he={})),function(e){e[e.normal=1]="normal",e[e.hidden=0]="hidden",e[e.transparent=2]="transparent"}(me||(me={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(ve||(ve={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(ge||(ge={})),function(e){e[e.left=0]="left",e[e.center=1]="center"}(ye||(ye={})),function(e){e.OnFrameCallback="h5.event.camera.frame",e.OnStartCallback="h5.event.camera.start",e.OnStopCallback="h5.event.camera.stop"}(_e||(_e={})),function(e){e.FRONT="user",e.BACK="environment"}(be||(be={})),function(e){e.WEBP="image/webp",e.PNG="image/png",e.JPEG="image/jpeg"}(we||(we={})),function(e){e.HIGH="high",e.NORMAL="normal",e.LOW="low"}(Te||(Te={})),function(e){e.VIDEO="video",e.AUDIO="audio"}(Ee||(Ee={}));var Ue,Le=function(e){return e.isAndroid?ne.android:e.isIOS?ne.iOS:ne.unknown};function je(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Be(){var e=function(){var e=xe((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:De(),platform:t,platformName:Le(t),zaloVersion:je(e).trim()}}}();if(e)return e}var Ze=(null===(Ue=Be())||void 0===Ue?void 0:Ue.appEnv)||{};function ze(e){ze.on&&ze.engine(e)}ze.on=!1,ze.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 We=function(e,n){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==n||null===(r=n.fail)||void 0===r||r.call(n,i),ze({stage:t.NOT_FOUND,type:"error",name:e,request:n,state:"fail",response:i})};function Fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ge(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){Fe(e,t,n[t])}))}return e}function He(e,t){return function(e){if(Array.isArray(e))return e}(e)||Ne(e)||ke(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.")}()}function Ve(e){return e&&e.constructor===Symbol?"symbol":typeof e}function Ke(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]}}var Je=Object.prototype.toString;var qe="[object Null]",Qe="[object Undefined]";function Ye(e){return null==e?void 0===e?Qe:qe:function(e){return Je.call(e)}(e)}function $e(e){return null!=e&&"object"==typeof e}var Xe={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||$e(e)&&"[object Number]"==Ye(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return $e(e)&&"[object RegExp]"==Ye(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 et(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tt(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 nt(e){return nt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},nt(e)}function rt(e){return nt(e)}function it(e,t,n){return it="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=rt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},it(e,t,n)}function ot(e,t,n){return it(e,t,n)}function at(e,t){return at=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},at(e,t)}function st(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&&at(e,t)}function ut(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ct(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=rt(e);if(t){var i=rt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==Ve(t)&&"function"!=typeof t?ut(e):t}(this,n)}}var lt,dt,pt=(lt=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},lt(dt={exports:{}},dt.exports),dt.exports),ft={enablePaymentDone:!1};function ht(e){var t=e.data;return{orderId:t.zmpOrderId||t.orderId,transId:t.appTransID||t.apptransid||t.transId}}var mt="ACTION_CALLBACK";function vt(e,t,n,r){switch(!0){case"string"==typeof n||null===n:return[{eventName:e,eventId:t,data:n}];case e===re.OpenApp&&(null==r?void 0:r.enablePaymentDone):var i=function(e){var t=new URL(e,window.location.origin),n=t.pathname.split("/")[3].toUpperCase().replace(/-/g,"_"),r={},i=t.searchParams.get("orderId"),o=t.searchParams.get("zmpOrderId"),a=t.searchParams.get("appTransID")||t.searchParams.get("apptransid");switch(n){case"MOMO":case"MOMO_SANDBOX":r.orderId=o,r.transId=i;break;default:r.orderId=o||i,r.transId=a}return r}(n.path);return[{eventName:re.PaymentDone,eventId:t,data:i}];case e===re.OnDataCallback:if(["PAY_BY_BANK","PAY_BY_CUSTOM_METHOD"].includes(null==n?void 0:n.eventType))return[{eventName:re.OnDataCallback,eventId:t,data:n},{eventName:re.PaymentDone,eventId:t,data:ht(n)}];break;default:return[{eventName:e,eventId:t,data:n}]}}var gt=function(e){st(n,e);var t=ct(n);function n(){var e;return et(this,n),(e=t.apply(this,arguments)).debug=Ke("zmp:event-emitter"),e}var r=n.prototype;return r.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},r.on=function(e,t,r){var i=this;if(e===mt||e===re.PaymentCallback)return ot(rt(n.prototype),"on",this).call(this,e,t,r);this.debug("register ".concat(String(e),": ").concat(r));return ot(rt(n.prototype),"on",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},r.once=function(e,t,r){var i=this;if(e===mt)return ot(rt(n.prototype),"once",this).call(this,e,t,r);this.debug("register once ".concat(String(e),": ").concat(r));return ot(rt(n.prototype),"once",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},n}(pt);function yt(e){gt.getInstance().emit(mt,e)}function _t(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(void 0===r)return;if(null===r)return void t.push(n);t.push(encodeURIComponent(n)+"="+encodeURIComponent(r))}return t.join("&")}window.onNativeMessage=function(e,t){return function(n){yt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){var r=Ke("zmp:zalo_h5_event_handler");r("eventId: ".concat(e,", eventName: ").concat(t,", eventData: ").concat(n));var o=qt(n);r("stringToData",o);var a=function(e,t){if(!t||"string"==typeof t)return t;try{if(e===re.OpenApp){var n=t.url,r=new URL(n),o=r.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(o||"/").concat(r.search)}}return t}catch(e){return t}}(t,o),s=vt(t,e,a,ft);null==s||s.forEach((function(e){gt.getInstance().emit(e.eventName,e.eventId,e.data);var t=document.getElementById(Ie);t&&sn(t,"appEvent",{eventName:e.eventName,eventId:e.eventId,data:e.data})}))}},window.zaloNative2JS={nativeCall:function(e,t,n){gt.getInstance().emit(re.PaymentCallback,e,t,n)}};var bt={encode:_t,decode:function(e,t){var n={};if(""===e)return n;for(var r=e.split("&"),i=0;i<r.length;i++){var o=r[i].split("=",2),a=decodeURIComponent(o[0]);if(t&&Object.prototype.hasOwnProperty.call(n,a))throw new URIError("Duplicate key: "+a);n[a]=2===o.length?decodeURIComponent(o[1]):null}return n},appendToUrl:function(e,t){return e+(-1!==e.indexOf("?")?"&":"?")+("string"==typeof t?t:_t(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var n=e.split("=");n&&2==n.length&&(t[n[0]]=decodeURIComponent(n[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e||void 0===e?"undefined":Ve(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":Ve(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},wt={},Tt=function(e,t,n){var r=t||"default";return function(){return(r in wt?wt[r](e,n):e).apply(this,arguments)}};Tt.setWrapper=function(e){wt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Et={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function It(e){try{return null===e?Et:JSON.parse(e)}catch(e){return Et}}var Pt,St={execute:function(e,t,n,r){n.suppress_http_code=1;var i=bt.encode(n);"post"!=t&&(e=bt.appendToUrl(e,i),i="");var o=function(e,t){if(!self.XMLHttpRequest)return null;var n=new XMLHttpRequest,r=function(){};if(!("withCredentials"in n))return null;n.open(e,t,!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded");var i={send:function(e){n.send(e)}},o=Tt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Tt((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(It(e.responseText))},o.onerror=function(e){e.responseText?r(It(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},At=(Pt=Oe((function(e,t,n){var r,i,o,a;return Re(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},Xe.isUndefined(n)||(r.currentVersion=n),i=bt.appendToUrl(l.GET_APP_INFO,r),[4,fetch(i,{credentials:"include"})];case 1:return(o=s.sent()).ok?[4,o.json()]:[3,3];case 2:if((a=s.sent()).err<0||!a.data)throw new Error(a);return[2,{name:a.data.name,version:a.data.version,description:a.data.description,appUrl:a.data.appUrl,qrCodeUrl:a.data.qrCodeUrl,logoUrl:a.data.logoUrl,cateID:a.data.cateType}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return Pt.apply(this,arguments)});function Ot(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));St.execute(l.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var Ct=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Nt=function(){var e;return"android"===((null===(e=Be())||void 0===e?void 0:e.platformName)||"").toLowerCase()};var kt=function(){var e=0;if(window.zaloVersionCode)e=window.zaloVersionCode;else{var t,n=Number((null===(t=Be())||void 0===t?void 0:t.zaloVersion)||"0");if(n>=24112e3)e=n;else{var r,i=((null===(r=Be())||void 0===r?void 0:r.platformName)||"").toLowerCase();"android"===i?e=n%1e4:"ios"===i&&(e=n)}}return function(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)}(e)},Mt=function(e,t){var n=kt();return Nt()&&n<e||function(){var e;return"ios"===((null===(e=Be())||void 0===e?void 0:e.platformName)||"").toLowerCase()}()&&n<t};function Rt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var xt,Dt=function(){function e(t,n,r,i){et(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}(),Ut=function(e,t){return Rt(e,Dt)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Rt(e,Error)?new Dt(h,e.message,t).toJSON():Xe.isEmpty(null==e?void 0:e.message)||Xe.isEmpty(null==e?void 0:e.code)?new Dt(h,S,t,e).toJSON():new Dt(e.code,e.message,t,e.detail).toJSON()}(e,t)},Lt=(xt=Oe((function(e){var t;return Re(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(l.GET_AUTH_SETTING,Ge({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return xt.apply(this,arguments)}),jt=Oe((function(){return Re(this,(function(e){return[2,new Promise(function(){var e=Oe((function(e,t){var n,r,i,o;return Re(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,Ht.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=Ht.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new Dt(g,C,"getSetting")),[4,Lt(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new Dt(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)}}())]}))})),Bt=function(){var e,t,n,r=Be(),i={},o=gt.getInstance(),a=[],s=!1;return s||(t=function(e){var t=e.serialId,n=Qt(e.result),r=en(null==n?void 0:n.action),s=Xe.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,u=null==n?void 0:n.error_message,c=(null==n?void 0:n.data)||n;if(r&&0===s){var l=JSON.parse(null==n?void 0:n.data);s=Xe.isEmpty(null==l?void 0:l.error_code)?0:null==l?void 0:l.error_code,u=null==l?void 0:l.error_message,c=(null==l?void 0:l.data)||l}var d={error_code:s,error_message:u,data:c,action:(null==n?void 0:n.action)||e.actionName};if(t&&i[t]){var p=i[t],f=p.callback,h=p.timeout,m=p.isMultiCallback,v=p.options,g=p.downloadListener;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?Xe.isFunction(r)&&r(e):Xe.isFunction(i)&&i(e)}(d,f),!m&&delete i[t],h&&clearTimeout(h);var y={action:null==d?void 0:d.action,error:null==d?void 0:d.error_code,message:null==d?void 0:d.error_message,data:{}};try{if("action.open.inapp"===d.action||"action.open.outapp"===d.action){var _=new URL(null==v?void 0:v.url),b="".concat(_.protocol,"//").concat(_.host).concat(_.pathname);y.data={url:b}}if("action.follow.oa"===d.action||"action.unfollow.oa"===d.action){var w=null==v?void 0:v.uid;y.data={uid:w}}if("action.open.chat"===d.action){var T=null==v?void 0:v.uId,E=null==v?void 0:v.type;y.data={uid:T,openChatType:E}}(null==v?void 0:v.onProgress)&&g&&o.off(re.DownloadProgress,g)}catch(e){}a.push(y)}},gt.getInstance().on(mt,t),o.on(re.AppPaused,(function(){if(a.length>0){var e=a;a=[],Ot(e)}})),e?clearInterval(e):e=setInterval((function(){if(a.length>0){var e=a;a=[],Ot(e)}}),5e3),s=!0),n=Oe((function(e,t,n,a){var s,u,c,l,d,p,f,h,m,v,b,w,T,E,I,P,S,A,C,N,R,x,D;return Re(this,(function(U){switch(U.label){case 0:return u=Math.floor(1e6*Math.random()),c="".concat(e,"_").concat(u),l=on(e),(null==a?void 0:a.actionName)&&a.actionName.length>0&&(l=null==a?void 0:a.actionName),d=(null==a?void 0:a.isMultiCallback)||!1,p=!1!==(null==a?void 0:a.timeout)&&((null==a?void 0:a.timeout)||!0),f=(null==a?void 0:a.haveCallback)||!1,h=(null==a?void 0:a.skipJump)||!1,m=(null==a?void 0:a.requireAccessToken)||!1,v=tn(l),t&&n&&(i[c]={options:t,callback:n,isMultiCallback:d},p&&f&&(i[c].timeout=setTimeout((function(){return yt({serialId:c,result:{error_code:_,error_message:O,data:{timeout:p},action:e}}),null}),!0===p?8e3:1e3*p))),v?[4,jt()]:[3,2];case 1:if(!1===(null==(w=U.sent())||null===(b=w.authSetting)||void 0===b?void 0:b["scope.userInfo"]))return yt({serialId:c,result:{error_code:g,error_message:M,data:{isMobile:null==r||null===(T=r.platform)||void 0===T?void 0:T.isMobile},action:e}}),[2];U.label=2;case 2:return E=en(l),!(null==r||null===(s=r.platform)||void 0===s?void 0:s.isMobile)||!e||Xe.isUndefined(ZaloJavaScriptInterface)||r.platform.isIOS&&!Jt(e)||E&&!1===E.isSupported?(yt({serialId:c,result:{error_code:y,error_message:k,data:{isMobile:null==r||null===(I=r.platform)||void 0===I?void 0:I.isMobile},action:e}}),[2]):(P=Kt(t),h?[3,4]:[4,Ht.getJSAccessToken()]);case 3:return A=U.sent(),[3,5];case 4:A="",U.label=5;case 5:S=A,U.label=6;case 6:return U.trys.push([6,10,,11]),h||!m?[3,8]:[4,Ht.getAccessToken()];case 7:return N=U.sent(),[3,9];case 8:N="",U.label=9;case 9:return C=N,[3,11];case 10:return R=U.sent(),yt({serialId:c,result:{error_code:null==R?void 0:R.code,error_message:null==R?void 0:R.message,action:e}}),[2];case 11:try{t&&(null==t?void 0:t.onProgress)&&(x=function(e){!function(e,t){var n=e.progress;t&&t(n)}(e,null==t?void 0:t.onProgress)},i[c].downloadListener=x,o.on(re.DownloadProgress,x))}catch(e){}return D=r.platform.isIOS?window.onNativeMessage(c,l):'window.onNativeMessage("'.concat(c,'", "').concat(l,'")'),[2,ZaloJavaScriptInterface.jsCall(S,l,C,P,D)]}}))})),function(e,t,r,i){return n.apply(this,arguments)}}(),Zt={success:function(e,t){return{code:f,message:t||P,data:e||{}}},error:{failLimit:function(){return new Dt(b,A)},badRequest:function(e){return new Dt(m,e)},loginFailed:function(e){return new Dt(g,"".concat(N,": ").concat(e))},loginRequired:function(){return new Dt(g,C)},cannotGetShareInfo:function(){return new Dt(v,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(ee).find((function(t){return t===e.toString()}));return new Dt(e,t||S)},clientNotSupport:function(){return new Dt(y,k)}}},zt=function(e){var t,n,r,i=null===(t=Be())||void 0===t?void 0:t.platformName,o=rn(e.action),a=B[o],s=(null==a?void 0:a.skipJump)||!1,u=(null==a?void 0:a.errorList)||{};if("JUMP_LOGIN"===o)return new Dt(h,"Can not get auth code: ".concat(e.error_message));if(Ht.jumpStatus!==ie.DONE&&!s)return new Dt(L.UNAUTHORIZED.code,L.UNAUTHORIZED.message);if("permission required!"===String(e.error_message).toLowerCase()||"no permission!"===String(e.error_message).toLowerCase())return new Dt(L.FORBIDDEN.code,L.FORBIDDEN.message);if(i&&(null===(n=Z[i])||void 0===n?void 0:n[e.error_code]))return new Dt(Z[i][e.error_code].code,Z[i][e.error_code].message);var c=null==u||null===(r=u[i])||void 0===r?void 0:r[String(e.error_code)];if(c){var l,d,p,f=null===(l=c.mapTo)||void 0===l?void 0:l.message;if(null==c?void 0:c.needMoreDetail)f="".concat(null==c||null===(p=c.mapTo)||void 0===p?void 0:p.message,": ").concat(e.error_message);return new Dt(null===(d=c.mapTo)||void 0===d?void 0:d.code,f)}return new Dt(e.error_code,e.error_message)},Wt=function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=Xe.isEmpty(n)?void 0:n[r];if(o)return ze({stage:t.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?zt(i):null==i?void 0:i.data)}}return Xe.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=B[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){Bt(e,n,o,Ge({},i,a))}),s)},Ft=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){Wt("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){Xe.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Gt=function(){function e(){et(this,e),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={},this.retryLimitMap={}}var n,o,s,u=e.prototype;return u.initRetryLimit=function(e){var t=j[e],n={lastCall:(new Date).getTime(),limit:t&&t.limit?t.limit:3,retry:0};return this.retryLimitMap[e]=n,n},u.resetRetryLimit=function(e){this.retryLimitMap[e].lastCall=(new Date).getTime(),this.retryLimitMap[e].retry=0},u.getRetryLimit=function(e){var t=this.retryLimitMap[e];return t&&t.lastCall&&t.retry||(t=this.initRetryLimit(e)),t},u.increaseRetryLimit=function(e){this.retryLimitMap[e].retry++},u.jump=function(){var e=this;return Oe((function(){return Re(this,(function(n){return[2,new Promise((function(n,r){e._jumpStatus?e._jumpStatus===ie.DONE?n(ie.DONE):n(ie.DOING):(e._jumpStatus=ie.DOING,ze({stage:t.REQUEST,type:"log",name:"jump"}),Bt("JUMP_LOGIN",{},{success:function(t){var r=t.data;e._miniProgramConfig=(null==r?void 0:r.miniProgramConfig)||{};var i=(null==r?void 0:r.cookiesOAuthLogins)||[],o=i.find((function(e){return e.name===c.JS_TOKEN}));o&&(e._jsAccessToken=o.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(o.value)),e._cookies=i;var a=e._cookies.find((function(e){return e.name===c.ZOAUTH}));(null==a?void 0:a.value)||Ot([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),n(ie.DONE)},fail:function(e){Ot([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),r(e)}},{skipJump:!0}))}))]}))}))()},u.loginZaloV3=function(e,t,n){var r=this;return Oe((function(){var i;return Re(this,(function(o){switch(o.label){case 0:return i="".concat(l.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(a,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=Oe((function(e){var t,n,i;return Re(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return t=o.sent(),n=null==t?void 0:t.access_token,r._accessToken=n,i=1e3*parseInt(t.expires_in),r.accessTokenExpiresIn=i,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(r._accessToken||""),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,o.sent()]}}))}))()},u.loginZaloV4=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this;return Oe((function(){var i,o;return Re(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),Xe.isNull(r.refreshToken)||0===r.refreshToken.length?i.append("grant_type","authorization_code"):(i.append("grant_type","refresh_token"),i.append("refresh_token",r.refreshToken||"")),o={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.GET_ACCESS_TOKEN,Ge({method:"POST",body:i},o)).then(function(){var e=Oe((function(e){var t,n,i,o;return Re(this,(function(a){switch(a.label){case 0:return[4,e.json()];case 1:return t=a.sent(),n=(null==t?void 0:t.access_token)||"",i=(null==t?void 0:t.refresh_token)||"",r.refreshToken=i,r._accessToken=n,o=1e3*parseInt(null==t?void 0:t.expires_in),r.accessTokenExpiresIn=o,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,a.sent()]}}))}))()},u.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return Oe((function(){var n,o,a,s,u,l,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(o.getAccessTokenCount<=1||o._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Re(this,(function(m){switch(m.label){case 0:return n=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(o=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken?(o.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?(o.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(c.ZOAUTH)]);case 6:return u=m.sent(),[4,t.jumpAndGetToken(c.ZOAUTH_VRF)];case 7:if(l=m.sent(),d="zmp.getaccesstoken.fail",!a)throw o.getAccessTokenCount--,Ot([{action:d,error:-104,message:"no user auth",data:{}}]),Zt.error.loginFailed("User Authentication Required");if(!u)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),l?[4,t.loginZaloV4(i,u,l)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(i,r,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),Ot([{action:d,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return o.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(Ot([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(Zt.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw o.getAccessTokenCount--,Ot([{action:d,error:-102,message:"no oauth",data:{}}]),Zt.error.loginFailed("Zalo app has not been activated")}}))}))()},u.verifyUserAuthorized=function(){var e=this;return Oe((function(){var t,n,r,i,o,a;return Re(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=en("action.mp.user.authorize"))&&r.isSupported?[4,jt()]:[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,Ft()];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]}}))}))()},u.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},u.getJSAccessToken=function(){var e=this;return Oe((function(){var t;return Re(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(c.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},u.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},u.jumpAndGetToken=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;return new Promise(function(){var r=Oe((function(r){var i,o,a,s;return Re(this,(function(u){switch(u.label){case 0:return!t&&n._cookies.length>0?Xe.isString(e)?(i=n._cookies.find((function(t){return t.name===e})),[2,r(null==i?void 0:i.value)]):[2,r("")]:(t&&n._jumpStatus===ie.DONE&&(n._jumpStatus=void 0),o={name:e,cb:function(e){return r(e)}},[4,n.jump()]);case 1:return(a=u.sent())===ie.DONE?(n._jumpStatus=a,n.WAITING_QUEUE.length&&(n.WAITING_QUEUE.forEach((function(e){var t=n._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),n.WAITING_QUEUE=[]),s=n._cookies.find((function(e){return e.name===o.name})),o.cb(null==s?void 0:s.value)):n.WAITING_QUEUE.push(o),[2]}}))}));return function(e){return r.apply(this,arguments)}}())},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},n=e,(o=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&tt(n.prototype,o),s&&tt(n,s),e}(),Ht=Gt.getInstance(),Vt=Ke("zmp:utils:common"),Kt=function(e){if(Xe.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(Kt(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+Kt(e[i]));return"{"+t.join(",")+"}"}return e.toString()},Jt=function(e){var t=B[e],n=kt(),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},qt=function(e){try{if(e){Vt(e);var t=e.replace(/\\/g,"").replace(/'/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}var n=JSON.parse(t);return Vt("formattedValue",t,n,void 0===n?"undefined":Ve(n)),n}return null}catch(t){return Vt("parse json error:",t),e}},Qt=function(e){if(Xe.isObject(JSON)&&JSON.parse&&Xe.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 Xe.isObject(e)?e:new Function("return "+e)()},Yt=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""},$t=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var Xt=function(e){return"hidden"===e?me.hidden:"transparent"===e?me.transparent:me.normal},en=function(e){if(void 0!==e){var t=Ht.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},tn=function(e){if(void 0===e)return!1;var t=Ht.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},nn=function(){var e=Oe((function(){return Re(this,(function(e){return[2,new Promise(function(){var e=Oe((function(e,t){var n;return Re(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Ht.jumpAndGetToken()];case 1:return t.sent(),n=Ht.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)}}(),rn=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},on=function(e){return e.startsWith("action.")?e:"action.".concat(e.replace(/\_/g,".").toLowerCase())},an=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=He(n,2),i=r[0],o=r[1];null!=o&&""!==o&&e.set("".concat(t).concat(i),String(o))}))},sn=function(e,t,n){var r;null===(r=e.contentWindow)||void 0===r||r.postMessage({type:t,payload:n},Pe)};function un(e,t,n,r){var i,o;!function(e,t){if(j[e]){var n=Ht.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&Ht.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw Ut(Zt.error.failLimit(),e);Ht.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=Zt.error.badRequest(s);throw c.detail=a,Ut(c,e)}u.push(i.data)}));var c=r.apply(void 0,Me(u));return Xe.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!Xe.isNull(a)&&Xe.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Ut(t,e);if(!Xe.isNull(s)&&Xe.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!Xe.isNull(s)&&Xe.isFunction(s))return s(t);throw Ut(t,e)}}function cn(e){return ln.apply(this,arguments)}function ln(){return(ln=Oe((function(e){return Re(this,(function(t){return[2,un("login",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Ht.jumpAndGetToken(c.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Ze.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(We("login",{}))]}}))})))]}))}))).apply(this,arguments)}function dn(e){return pn.apply(this,arguments)}function pn(){return(pn=Oe((function(e){return Re(this,(function(t){return[2,un("getAccessToken",[],[e],Oe((function(){var e;return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,nn()]:[3,3];case 1:return e=!t.sent(),[4,Ht.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Ze.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(We("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var fn,hn="2.47.0-beta.8";function mn(){return un("getVersion",[],[],(function(){return hn}))}function vn(){var e;return{version:Yt("version-id")||"",apiVersion:hn,zaloVersion:String(kt()),platform:(null===(e=Be())||void 0===e?void 0:e.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function gn(){return un("getSystemInfo",[],[],(function(){return vn()}))}!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}(fn||(fn={}));const yn=fn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_n=e=>{switch(typeof e){case"undefined":return yn.undefined;case"string":return yn.string;case"number":return isNaN(e)?yn.nan:yn.number;case"boolean":return yn.boolean;case"function":return yn.function;case"bigint":return yn.bigint;case"symbol":return yn.symbol;case"object":return Array.isArray(e)?yn.array:null===e?yn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?yn.promise:"undefined"!=typeof Map&&e instanceof Map?yn.map:"undefined"!=typeof Set&&e instanceof Set?yn.set:"undefined"!=typeof Date&&e instanceof Date?yn.date:yn.object;default:return yn.unknown}},bn=fn.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 wn 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,fn.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()}}wn.create=e=>new wn(e);const Tn=(e,t)=>{let n;switch(e.code){case bn.invalid_type:n=e.received===yn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case bn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,fn.jsonStringifyReplacer)}`;break;case bn.unrecognized_keys:n=`Unrecognized key(s) in object: ${fn.joinValues(e.keys,", ")}`;break;case bn.invalid_union:n="Invalid input";break;case bn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${fn.joinValues(e.options)}`;break;case bn.invalid_enum_value:n=`Invalid enum value. Expected ${fn.joinValues(e.options)}, received '${e.received}'`;break;case bn.invalid_arguments:n="Invalid function arguments";break;case bn.invalid_return_type:n="Invalid function return type";break;case bn.invalid_date:n="Invalid date";break;case bn.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}"`:fn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case bn.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 bn.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 bn.custom:n="Invalid input";break;case bn.invalid_intersection_types:n="Intersection results could not be merged";break;case bn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case bn.not_finite:n="Number must be finite";break;default:n=t.defaultError,fn.assertNever(e)}return{message:n}};let En=Tn;function In(){return En}const Pn=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 Sn(e,t){const n=Pn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,In(),Tn].filter((e=>!!e))});e.common.issues.push(n)}class An{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 On;"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 An.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 On;if("aborted"===i.status)return On;"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 On=Object.freeze({status:"aborted"}),Cn=e=>({status:"dirty",value:e}),Nn=e=>({status:"valid",value:e}),kn=e=>"aborted"===e.status,Mn=e=>"dirty"===e.status,Rn=e=>"valid"===e.status,xn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Dn;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Dn||(Dn={}));class Un{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 Ln=(e,t)=>{if(Rn(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 wn(e.common.issues)}};function jn(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 Bn{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 _n(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:_n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new An,ctx:{common:e.parent.common,data:e.data,parsedType:_n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(xn(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:_n(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Ln(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:_n(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(xn(r)?r:Promise.resolve(r));return Ln(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:bn.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 Er({schema:this,typeName:xr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ir.create(this,this._def)}nullable(){return Pr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rr.create(this,this._def)}promise(){return Tr.create(this,this._def)}or(e){return sr.create([this,e],this._def)}and(e){return dr.create(this,e,this._def)}transform(e){return new Er({...jn(this._def),schema:this,typeName:xr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Sr({...jn(this._def),innerType:this,defaultValue:t,typeName:xr.ZodDefault})}brand(){return new Nr({typeName:xr.ZodBranded,type:this,...jn(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Ar({...jn(this._def),innerType:this,catchValue:t,typeName:xr.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return kr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Zn=/^c[^\s-]{8,}$/i,zn=/^[a-z][a-z0-9]*$/,Wn=/^([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,Fn=/^(([^<>()[\]\\.,;:\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 Gn extends Bn{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:bn.invalid_string,...Dn.errToObj(n)}),this.nonempty=e=>this.min(1,Dn.errToObj(e)),this.trim=()=>new Gn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==yn.string){const t=this._getOrReturnCtx(e);return Sn(t,{code:bn.invalid_type,expected:yn.string,received:t.parsedType}),On}const t=new An;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),Sn(n,{code:bn.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),Sn(n,{code:bn.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?Sn(n,{code:bn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Sn(n,{code:bn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)Fn.test(e.data)||(n=this._getOrReturnCtx(e,n),Sn(n,{validation:"email",code:bn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Wn.test(e.data)||(n=this._getOrReturnCtx(e,n),Sn(n,{validation:"uuid",code:bn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Zn.test(e.data)||(n=this._getOrReturnCtx(e,n),Sn(n,{validation:"cuid",code:bn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)zn.test(e.data)||(n=this._getOrReturnCtx(e,n),Sn(n,{validation:"cuid2",code:bn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Sn(n,{validation:"url",code:bn.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),Sn(n,{validation:"regex",code:bn.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),Sn(n,{code:bn.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),Sn(n,{code:bn.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),Sn(n,{code:bn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else fn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new Gn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Dn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Dn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Dn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Dn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Dn.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,...Dn.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Dn.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Dn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Dn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Dn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Dn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Dn.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 Hn(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)}Gn.create=e=>{var t;return new Gn({checks:[],typeName:xr.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...jn(e)})};class Vn extends Bn{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)!==yn.number){const t=this._getOrReturnCtx(e);return Sn(t,{code:bn.invalid_type,expected:yn.number,received:t.parsedType}),On}let t;const n=new An;for(const r of this._def.checks)if("int"===r.kind)fn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Sn(t,{code:bn.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),Sn(t,{code:bn.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),Sn(t,{code:bn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==Hn(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Sn(t,{code:bn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Sn(t,{code:bn.not_finite,message:r.message}),n.dirty()):fn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Dn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Dn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Dn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Dn.toString(t))}setLimit(e,t,n,r){return new Vn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Dn.toString(r)}]})}_addCheck(e){return new Vn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Dn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Dn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Dn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Dn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Dn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Dn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Dn.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&&fn.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)}}Vn.create=e=>new Vn({checks:[],typeName:xr.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...jn(e)});class Kn extends Bn{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==yn.bigint){const t=this._getOrReturnCtx(e);return Sn(t,{code:bn.invalid_type,expected:yn.bigint,received:t.parsedType}),On}return Nn(e.data)}}Kn.create=e=>{var t;return new Kn({typeName:xr.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...jn(e)})};class Jn extends Bn{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==yn.boolean){const t=this._getOrReturnCtx(e);return Sn(t,{code:bn.invalid_type,expected:yn.boolean,received:t.parsedType}),On}return Nn(e.data)}}Jn.create=e=>new Jn({typeName:xr.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...jn(e)});class qn extends Bn{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==yn.date){const t=this._getOrReturnCtx(e);return Sn(t,{code:bn.invalid_type,expected:yn.date,received:t.parsedType}),On}if(isNaN(e.data.getTime())){return Sn(this._getOrReturnCtx(e),{code:bn.invalid_date}),On}const t=new An;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Sn(n,{code:bn.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),Sn(n,{code:bn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):fn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new qn({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Dn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Dn.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}}qn.create=e=>new qn({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:xr.ZodDate,...jn(e)});class Qn extends Bn{_parse(e){if(this._getType(e)!==yn.symbol){const t=this._getOrReturnCtx(e);return Sn(t,{code:bn.invalid_type,expected:yn.symbol,received:t.parsedType}),On}return Nn(e.data)}}Qn.create=e=>new Qn({typeName:xr.ZodSymbol,...jn(e)});class Yn extends Bn{_parse(e){if(this._getType(e)!==yn.undefined){const t=this._getOrReturnCtx(e);return Sn(t,{code:bn.invalid_type,expected:yn.undefined,received:t.parsedType}),On}return Nn(e.data)}}Yn.create=e=>new Yn({typeName:xr.ZodUndefined,...jn(e)});class $n extends Bn{_parse(e){if(this._getType(e)!==yn.null){const t=this._getOrReturnCtx(e);return Sn(t,{code:bn.invalid_type,expected:yn.null,received:t.parsedType}),On}return Nn(e.data)}}$n.create=e=>new $n({typeName:xr.ZodNull,...jn(e)});class Xn extends Bn{constructor(){super(...arguments),this._any=!0}_parse(e){return Nn(e.data)}}Xn.create=e=>new Xn({typeName:xr.ZodAny,...jn(e)});class er extends Bn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Nn(e.data)}}er.create=e=>new er({typeName:xr.ZodUnknown,...jn(e)});class tr extends Bn{_parse(e){const t=this._getOrReturnCtx(e);return Sn(t,{code:bn.invalid_type,expected:yn.never,received:t.parsedType}),On}}tr.create=e=>new tr({typeName:xr.ZodNever,...jn(e)});class nr extends Bn{_parse(e){if(this._getType(e)!==yn.undefined){const t=this._getOrReturnCtx(e);return Sn(t,{code:bn.invalid_type,expected:yn.void,received:t.parsedType}),On}return Nn(e.data)}}nr.create=e=>new nr({typeName:xr.ZodVoid,...jn(e)});class rr extends Bn{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==yn.array)return Sn(t,{code:bn.invalid_type,expected:yn.array,received:t.parsedType}),On;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Sn(t,{code:e?bn.too_big:bn.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&&(Sn(t,{code:bn.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&&(Sn(t,{code:bn.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 Un(t,e,t.path,n))))).then((e=>An.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new Un(t,e,t.path,n))));return An.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new rr({...this._def,minLength:{value:e,message:Dn.toString(t)}})}max(e,t){return new rr({...this._def,maxLength:{value:e,message:Dn.toString(t)}})}length(e,t){return new rr({...this._def,exactLength:{value:e,message:Dn.toString(t)}})}nonempty(e){return this.min(1,e)}}var ir;function or(e){if(e instanceof ar){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ir.create(or(r))}return new ar({...e._def,shape:()=>t})}return e instanceof rr?rr.create(or(e.element)):e instanceof Ir?Ir.create(or(e.unwrap())):e instanceof Pr?Pr.create(or(e.unwrap())):e instanceof pr?pr.create(e.items.map((e=>or(e)))):e}rr.create=(e,t)=>new rr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xr.ZodArray,...jn(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(ir||(ir={}));class ar extends Bn{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=fn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==yn.object){const t=this._getOrReturnCtx(e);return Sn(t,{code:bn.invalid_type,expected:yn.object,received:t.parsedType}),On}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof tr&&"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 Un(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof tr){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&&(Sn(n,{code:bn.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 Un(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=>An.mergeObjectSync(t,e))):An.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return new ar({...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=Dn.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new ar({...this._def,unknownKeys:"strip"})}passthrough(){return new ar({...this._def,unknownKeys:"passthrough"})}extend(e){return new ar({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ar({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>ir.mergeShapes(this._def.shape(),e._def.shape()),typeName:xr.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ar({...this._def,catchall:e})}pick(e){const t={};return fn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new ar({...this._def,shape:()=>t})}omit(e){const t={};return fn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new ar({...this._def,shape:()=>t})}deepPartial(){return or(this)}partial(e){const t={};return fn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new ar({...this._def,shape:()=>t})}required(e){const t={};return fn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Ir;)e=e._def.innerType;t[n]=e}})),new ar({...this._def,shape:()=>t})}keyof(){return _r(fn.objectKeys(this.shape))}}ar.create=(e,t)=>new ar({shape:()=>e,unknownKeys:"strip",catchall:tr.create(),typeName:xr.ZodObject,...jn(t)}),ar.strictCreate=(e,t)=>new ar({shape:()=>e,unknownKeys:"strict",catchall:tr.create(),typeName:xr.ZodObject,...jn(t)}),ar.lazycreate=(e,t)=>new ar({shape:e,unknownKeys:"strip",catchall:tr.create(),typeName:xr.ZodObject,...jn(t)});class sr extends Bn{_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 wn(e.ctx.common.issues)));return Sn(t,{code:bn.invalid_union,unionErrors:n}),On}));{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 wn(e)));return Sn(t,{code:bn.invalid_union,unionErrors:i}),On}}get options(){return this._def.options}}sr.create=(e,t)=>new sr({options:e,typeName:xr.ZodUnion,...jn(t)});const ur=e=>e instanceof gr?ur(e.schema):e instanceof Er?ur(e.innerType()):e instanceof yr?[e.value]:e instanceof br?e.options:e instanceof wr?Object.keys(e.enum):e instanceof Sr?ur(e._def.innerType):e instanceof Yn?[void 0]:e instanceof $n?[null]:null;class cr extends Bn{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==yn.object)return Sn(t,{code:bn.invalid_type,expected:yn.object,received:t.parsedType}),On;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}):(Sn(t,{code:bn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),On)}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=ur(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 cr({typeName:xr.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...jn(n)})}}function lr(e,t){const n=_n(e),r=_n(t);if(e===t)return{valid:!0,data:e};if(n===yn.object&&r===yn.object){const n=fn.objectKeys(t),r=fn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=lr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===yn.array&&r===yn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=lr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===yn.date&&r===yn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class dr extends Bn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(kn(e)||kn(r))return On;const i=lr(e.value,r.value);return i.valid?((Mn(e)||Mn(r))&&t.dirty(),{status:t.value,value:i.data}):(Sn(n,{code:bn.invalid_intersection_types}),On)};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}))}}dr.create=(e,t,n)=>new dr({left:e,right:t,typeName:xr.ZodIntersection,...jn(n)});class pr extends Bn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==yn.array)return Sn(n,{code:bn.invalid_type,expected:yn.array,received:n.parsedType}),On;if(n.data.length<this._def.items.length)return Sn(n,{code:bn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),On;!this._def.rest&&n.data.length>this._def.items.length&&(Sn(n,{code:bn.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 Un(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>An.mergeArray(t,e))):An.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new pr({...this._def,rest:e})}}pr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pr({items:e,typeName:xr.ZodTuple,rest:null,...jn(t)})};class fr extends Bn{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!==yn.object)return Sn(n,{code:bn.invalid_type,expected:yn.object,received:n.parsedType}),On;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new Un(n,e,n.path,e)),value:o._parse(new Un(n,n.data[e],n.path,e))});return n.common.async?An.mergeObjectAsync(t,r):An.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new fr(t instanceof Bn?{keyType:e,valueType:t,typeName:xr.ZodRecord,...jn(n)}:{keyType:Gn.create(),valueType:e,typeName:xr.ZodRecord,...jn(t)})}}class hr extends Bn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==yn.map)return Sn(n,{code:bn.invalid_type,expected:yn.map,received:n.parsedType}),On;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new Un(n,e,n.path,[o,"key"])),value:i._parse(new Un(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 On;"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 On;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}hr.create=(e,t,n)=>new hr({valueType:t,keyType:e,typeName:xr.ZodMap,...jn(n)});class mr extends Bn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==yn.set)return Sn(n,{code:bn.invalid_type,expected:yn.set,received:n.parsedType}),On;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Sn(n,{code:bn.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&&(Sn(n,{code:bn.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 On;"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 Un(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new mr({...this._def,minSize:{value:e,message:Dn.toString(t)}})}max(e,t){return new mr({...this._def,maxSize:{value:e,message:Dn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}mr.create=(e,t)=>new mr({valueType:e,minSize:null,maxSize:null,typeName:xr.ZodSet,...jn(t)});class vr extends Bn{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==yn.function)return Sn(t,{code:bn.invalid_type,expected:yn.function,received:t.parsedType}),On;function n(e,n){return Pn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,In(),Tn].filter((e=>!!e)),issueData:{code:bn.invalid_arguments,argumentsError:n}})}function r(e,n){return Pn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,In(),Tn].filter((e=>!!e)),issueData:{code:bn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Tr?Nn((async(...e)=>{const t=new wn([]),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}))})):Nn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new wn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new wn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new vr({...this._def,args:pr.create(e).rest(er.create())})}returns(e){return new vr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new vr({args:e||pr.create([]).rest(er.create()),returns:t||er.create(),typeName:xr.ZodFunction,...jn(n)})}}class gr extends Bn{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})}}gr.create=(e,t)=>new gr({getter:e,typeName:xr.ZodLazy,...jn(t)});class yr extends Bn{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Sn(t,{received:t.data,code:bn.invalid_literal,expected:this._def.value}),On}return{status:"valid",value:e.data}}get value(){return this._def.value}}function _r(e,t){return new br({values:e,typeName:xr.ZodEnum,...jn(t)})}yr.create=(e,t)=>new yr({value:e,typeName:xr.ZodLiteral,...jn(t)});class br extends Bn{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Sn(t,{expected:fn.joinValues(n),received:t.parsedType,code:bn.invalid_type}),On}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Sn(t,{received:t.data,code:bn.invalid_enum_value,options:n}),On}return Nn(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 br.create(e)}exclude(e){return br.create(this.options.filter((t=>!e.includes(t))))}}br.create=_r;class wr extends Bn{_parse(e){const t=fn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==yn.string&&n.parsedType!==yn.number){const e=fn.objectValues(t);return Sn(n,{expected:fn.joinValues(e),received:n.parsedType,code:bn.invalid_type}),On}if(-1===t.indexOf(e.data)){const e=fn.objectValues(t);return Sn(n,{received:n.data,code:bn.invalid_enum_value,options:e}),On}return Nn(e.data)}get enum(){return this._def.values}}wr.create=(e,t)=>new wr({values:e,typeName:xr.ZodNativeEnum,...jn(t)});class Tr extends Bn{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==yn.promise&&!1===t.common.async)return Sn(t,{code:bn.invalid_type,expected:yn.promise,received:t.parsedType}),On;const n=t.parsedType===yn.promise?t.data:Promise.resolve(t.data);return Nn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Tr.create=(e,t)=>new Tr({type:e,typeName:xr.ZodPromise,...jn(t)});class Er extends Bn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xr.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=>{Sn(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?On:("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?On:("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(!Rn(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=>Rn(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}fn.assertNever(r)}}Er.create=(e,t,n)=>new Er({schema:e,typeName:xr.ZodEffects,effect:t,...jn(n)}),Er.createWithPreprocess=(e,t,n)=>new Er({schema:t,effect:{type:"preprocess",transform:e},typeName:xr.ZodEffects,...jn(n)});class Ir extends Bn{_parse(e){return this._getType(e)===yn.undefined?Nn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ir.create=(e,t)=>new Ir({innerType:e,typeName:xr.ZodOptional,...jn(t)});class Pr extends Bn{_parse(e){return this._getType(e)===yn.null?Nn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pr.create=(e,t)=>new Pr({innerType:e,typeName:xr.ZodNullable,...jn(t)});class Sr extends Bn{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===yn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Sr.create=(e,t)=>new Sr({innerType:e,typeName:xr.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...jn(t)});class Ar extends Bn{_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 xn(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}}Ar.create=(e,t)=>new Ar({innerType:e,typeName:xr.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...jn(t)});class Or extends Bn{_parse(e){if(this._getType(e)!==yn.nan){const t=this._getOrReturnCtx(e);return Sn(t,{code:bn.invalid_type,expected:yn.nan,received:t.parsedType}),On}return{status:"valid",value:e.data}}}Or.create=e=>new Or({typeName:xr.ZodNaN,...jn(e)});const Cr=Symbol("zod_brand");class Nr extends Bn{_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 kr extends Bn{_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?On:"dirty"===e.status?(t.dirty(),Cn(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?On:"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 kr({in:e,out:t,typeName:xr.ZodPipeline})}}const Mr=(e,t={},n)=>e?Xn.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})}})):Xn.create(),Rr={object:ar.lazycreate};var xr;!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"}(xr||(xr={}));const Dr=Gn.create,Ur=Vn.create,Lr=Or.create,jr=Kn.create,Br=Jn.create,Zr=qn.create,zr=Qn.create,Wr=Yn.create,Fr=$n.create,Gr=Xn.create,Hr=er.create,Vr=tr.create,Kr=nr.create,Jr=rr.create,qr=ar.create,Qr=ar.strictCreate,Yr=sr.create,$r=cr.create,Xr=dr.create,ei=pr.create,ti=fr.create,ni=hr.create,ri=mr.create,ii=vr.create,oi=gr.create,ai=yr.create,si=br.create,ui=wr.create,ci=Tr.create,li=Er.create,di=Ir.create,pi=Pr.create,fi=Er.createWithPreprocess,hi=kr.create,mi={string:e=>Gn.create({...e,coerce:!0}),number:e=>Vn.create({...e,coerce:!0}),boolean:e=>Jn.create({...e,coerce:!0}),bigint:e=>Kn.create({...e,coerce:!0}),date:e=>qn.create({...e,coerce:!0})},vi=On;var gi=Object.freeze({__proto__:null,defaultErrorMap:Tn,setErrorMap:function(e){En=e},getErrorMap:In,makeIssue:Pn,EMPTY_PATH:[],addIssueToContext:Sn,ParseStatus:An,INVALID:On,DIRTY:Cn,OK:Nn,isAborted:kn,isDirty:Mn,isValid:Rn,isAsync:xn,get util(){return fn},ZodParsedType:yn,getParsedType:_n,ZodType:Bn,ZodString:Gn,ZodNumber:Vn,ZodBigInt:Kn,ZodBoolean:Jn,ZodDate:qn,ZodSymbol:Qn,ZodUndefined:Yn,ZodNull:$n,ZodAny:Xn,ZodUnknown:er,ZodNever:tr,ZodVoid:nr,ZodArray:rr,get objectUtil(){return ir},ZodObject:ar,ZodUnion:sr,ZodDiscriminatedUnion:cr,ZodIntersection:dr,ZodTuple:pr,ZodRecord:fr,ZodMap:hr,ZodSet:mr,ZodFunction:vr,ZodLazy:gr,ZodLiteral:yr,ZodEnum:br,ZodNativeEnum:wr,ZodPromise:Tr,ZodEffects:Er,ZodTransformer:Er,ZodOptional:Ir,ZodNullable:Pr,ZodDefault:Sr,ZodCatch:Ar,ZodNaN:Or,BRAND:Cr,ZodBranded:Nr,ZodPipeline:kr,custom:Mr,Schema:Bn,ZodSchema:Bn,late:Rr,get ZodFirstPartyTypeKind(){return xr},coerce:mi,any:Gr,array:Jr,bigint:jr,boolean:Br,date:Zr,discriminatedUnion:$r,effect:li,enum:si,function:ii,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Mr((t=>t instanceof e),t,!0),intersection:Xr,lazy:oi,literal:ai,map:ni,nan:Lr,nativeEnum:ui,never:Vr,null:Fr,nullable:pi,number:Ur,object:qr,oboolean:()=>Br().optional(),onumber:()=>Ur().optional(),optional:di,ostring:()=>Dr().optional(),pipeline:hi,preprocess:fi,promise:ci,record:ti,set:ri,strictObject:Qr,string:Dr,symbol:zr,transformer:li,tuple:ei,undefined:Wr,union:Yr,unknown:Hr,void:Kr,NEVER:vi,ZodIssueCode:bn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:wn}),yi=function(){function e(){var t,n,r,o,s,u,c,l,d,p,f,h,m,v,g,y,_,b,w,T,E,I,P,S,A,O,C;et(this,e),this.initConfig=window.APP_CONFIG;var N=Xe.isString(null===(t=this.initConfig)||void 0===t||null===(n=t.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(o=r.app)||void 0===o||null===(s=o.headerColor)||void 0===s?void 0:s.length)>0?Q:Y;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 k,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)?q.HIDE_BACK:q.SHOW_BACK,x="home"===(null===(v=this.initConfig)||void 0===v||null===(g=v.app)||void 0===g?void 0:g.leftButton)||"both"===(null===(y=this.initConfig)||void 0===y||null===(_=y.app)||void 0===_?void 0:_.leftButton)?q.SHOW_HOME:q.HIDE_HOME,D=new URL(location.href),U=Xt(null===(b=this.initConfig)||void 0===b||null===(w=b.app)||void 0===w?void 0:w.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.app)||void 0===E?void 0:E.actionBarHidden)&&(N=(null===(k=this.initConfig)||void 0===k||null===(M=k.app)||void 0===M?void 0:M.actionBarHidden)?Y:Q);this.config={actionbarType:N,buttonType:R,statusbarType:U,dataConfig:{backgroundColor:(null===(I=this.initConfig)||void 0===I||null===(P=I.app)||void 0===P?void 0:P.headerColor)||$,textColor:(null===(S=this.initConfig)||void 0===S||null===(A=S.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(O=this.initConfig)||void 0===O||null===(C=O.app)||void 0===C?void 0:C.textAlign)||X,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(a,"/").concat(i,"/").concat(D.search)}}}var t=e.prototype;return t.setNavigationBarTitle=function(e){return Oe((function(){return Re(this,(function(t){return[2,new Promise((function(t,n){Wt("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},t.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return Oe((function(){var r,i;return Re(this,(function(o){return void 0===(void 0===e?"undefined":Ve(e))&&null===(void 0===e?"undefined":Ve(e))||(r="none"===e||"home"===e?q.HIDE_BACK:q.SHOW_BACK,i="home"===e||"both"===e?q.SHOW_HOME:q.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){Wt("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Ge({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},t.setAndroidBottomNavigationBar=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return Oe((function(){var n,r,i;return Re(this,(function(o){return r=e?ve.hide:ve.show,i=null===(n=Be())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isAndroid))return n();Wt("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideAndroidBottomNavigationBar=!!e,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.setIOSBottomSafeArea=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return Oe((function(){var n,r,i;return Re(this,(function(o){return r=e?ge.hide:ge.show,i=null===(n=Be())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isIOS))return n();Wt("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideIOSSafeAreaBottom=!!e,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1,delay:200})}))]}))}))()},t.configHeader=function(e){var t=this;return Oe((function(){var n;return Re(this,(function(r){return n=t.config,Xe.isString(e.headerColor)&&(n.dataConfig.backgroundColor=e.headerColor),Xe.isString(e.headerTextColor)&&(n.dataConfig.textColor=e.headerTextColor),Xe.isString(e.textAlign)&&("left"===e.textAlign?n.dataConfig.textAlign=ye.left:"center"===e.textAlign&&(n.dataConfig.textAlign=ye.center)),!0===e.hideActionBar?n.actionbarType=Y:!1===e.hideActionBar&&(n.actionbarType=Q),"normal"===e.statusBarType?n.statusbarType=me.normal:"hidden"===e.statusBarType?n.statusbarType=me.hidden:"transparent"===e.statusBarType&&(n.statusbarType=me.transparent),[2,new Promise((function(r,i){Wt("CHANGE_ACTIONBAR",Ge({},n),{success:function(){var i;t.config=Ge({},n);var o,a=null===(i=Be())||void 0===i?void 0:i.platform;window.STATUS_BAR_TYPE=(o=t.config.statusbarType)===me.hidden?"hidden":o===me.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=t.config.actionbarType===Y;var s=null===document||void 0===document?void 0:document.querySelector(":root");if(null==a?void 0:a.isAndroid){var u=0;if(("hidden"===e.statusBarType||"transparent"===e.statusBarType)&&e.hideActionBar){var c=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(c)&&(c=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),u=c}u?null==s||s.style.setProperty("--zaui-safe-area-inset-top","".concat(u,"px")):null==s||s.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}r()},fail:function(e){i(e)}},{timeout:!1})}))]}))}))()},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}(),_i=yi.getInstance(),bi=[qr({title:Dr()}).optional()];function wi(e){return Ti.apply(this,arguments)}function Ti(){return Ti=Oe((function(e){return Re(this,(function(t){return[2,un("setNavigationBarTitle",bi,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,_i.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ti.apply(this,arguments)}var Ei=[qr({color:Dr(),textColor:gi.enum(["black","white"]).optional(),statusBarColor:Dr().optional()}).optional()];function Ii(e){return Pi.apply(this,arguments)}function Pi(){return Pi=Oe((function(e){return Re(this,(function(t){return[2,un("setNavigationBarColor",Ei,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,_i.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 Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pi.apply(this,arguments)}var Si=[qr({type:gi.enum(["none","back","home","both"])}).optional()];function Ai(e){return Oi.apply(this,arguments)}function Oi(){return Oi=Oe((function(e){return Re(this,(function(t){return[2,un("setNavigationBarLeftButton",Si,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,_i.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oi.apply(this,arguments)}function Ci(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Ni(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Ci(e,t,"get"))}function ki(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 Mi(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,Ci(e,t,"set"),n),n}var Ri,xi,Di=function(){function e(){et(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(Fe({},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}(),Ui=new WeakMap,Li=new WeakMap,ji=new WeakMap,Bi=function(e){st(n,e);var t=ct(n);function n(e){var r;return et(this,n),ki(ut(r=t.call(this)),Ui,{writable:!0,value:localStorage}),ki(ut(r),Li,{writable:!0,value:void 0}),ki(ut(r),ji,{writable:!0,value:void 0}),Mi(ut(r),ji,{keys:new Set,currentSize:0,limitSize:W}),Mi(ut(r),Li,e),r.findAllCurrentDataByApp(e),r}var r=n.prototype;return r.findAllCurrentDataByApp=function(e){try{var t;for(t in Ni(this,Ui)){if(e)if(t.split("_")[0]!==e)continue;Ni(this,ji).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 Ni(this,Li)&&(e="".concat(Ni(this,Li),"_").concat(e)),Ni(this,ji).keys.has(e)?Ni(this,Ui).getItem(e):null},r.set=function(e){var t=this;return Oe((function(){return Re(this,(function(n){return Object.entries(e).forEach((function(e){var n=He(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.setSync=function(e,t){Ni(this,Li)&&(e="".concat(Ni(this,Li),"_").concat(e)),Ni(this,Ui).setItem(e,t),Ni(this,ji).keys.add(e)},r.getInfo=function(){var e=this;return Oe((function(){return Re(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}(Ni(this,Ui),Ni(this,Li));return{currentSize:Xe.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((W/1024).toFixed(2))}},r.remove=function(e){var t=this;return Oe((function(){return Re(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.removeSync=function(e){Ni(this,Li)&&(e="".concat(Ni(this,Li),"_").concat(e)),Ni(this,ji).keys.has(e)&&(Ni(this,Ui).removeItem(e),Ni(this,ji).keys.delete(e))},r.clearAsync=function(){var e=this;return Oe((function(){return Re(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},r.clearSync=function(){var e=this;Ni(this,ji).keys.forEach((function(t){Ni(e,Li)&&t.indexOf(Ni(e,Li))<0||(Ni(e,Ui).removeItem(t),Ni(e,ji).keys.delete(t))}))},r.setSynchronize=function(e){var t=this;return Object.entries(e).forEach((function(e){var n=He(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}(Di),Zi=new WeakMap,zi=new WeakMap,Wi=function(e){st(n,e);var t=ct(n);function n(e){var r;return et(this,n),ki(ut(r=t.call(this)),Zi,{writable:!0,value:void 0}),ki(ut(r),zi,{writable:!0,value:void 0}),Mi(ut(r),zi,{keys:new Set,currentSize:0,limitSize:W}),Mi(ut(r),Zi,e),r}var r=n.prototype;return r.get=function(e){var t=this;return Oe((function(){return Re(this,(function(n){return[2,new Promise((function(n,r){Wt("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Ni(t,Zi)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.getSynchronize=function(e){var t={mpds_action:"mpds.get",mpds_data:{keys:e},appId:Ni(this,Zi)},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 Oe((function(){return Re(this,(function(n){return[2,new Promise((function(n,r){Wt("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Ni(t,Zi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.setSynchronize=function(e){var t={mpds_action:"mpds.set",mpds_data:{map:e},appId:Ni(this,Zi)},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 Oe((function(){return Re(this,(function(t){return[2,new Promise((function(t,n){Wt("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Ni(e,Zi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:Xe.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(W/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.getInfoSynchronize=function(){var e={mpds_action:"mpds.get.size",mpds_data:{},appId:Ni(this,Zi)},t=0,n=this.handleResult(e);return n&&n.mpds_data&&n.mpds_data.size&&(t=n.mpds_data.size),{currentSize:Xe.isNumber(t)?Number(Number(t)/1024):0,limitSize:Number(W/1024)}},r.remove=function(e){var t=this;return Oe((function(){return Re(this,(function(n){return[2,new Promise((function(n,r){Wt("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Ni(t,Zi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.removeSynchronize=function(e){var t={mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Ni(this,Zi)},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 Oe((function(){return Re(this,(function(t){return[2,new Promise((function(t,n){Wt("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Ni(e,Zi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.clearSynchronize=function(){var e={mpds_action:"mpds.clear.appData",mpds_data:{},appId:Ni(this,Zi)};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=zt(n).toJSON()}}catch(e){t=e}finally{if(null!==t)throw t}return{}},n}(Di),Fi=function(){function e(){et(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return Oe((function(){var n,r;return Re(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]=qt(e)})),[2,r]}}))}))()},t.getItem=function(e){return this.getInstance().getItem(e)},t.putDataToStorage=function(e){var t=this;return Oe((function(){var n,r;return Re(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=He(e,2),n=t[0],i=t[1];Xe.isUndefined(i)||Xe.isNull(i)||(r[n]=$t(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 Oe((function(){return Re(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 Oe((function(){return Re(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 Oe((function(){return Re(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}(),Gi=new WeakMap,Hi=function(e){st(n,e);var t=ct(n);function n(e){var r;return et(this,n),ki(ut(r=t.call(this)),Gi,{writable:!0,value:void 0}),Mi(ut(r),Gi,e),r}return n.prototype.getInstance=function(){return new Bi(Ni(this,Gi))},n}(Fi),Vi=new WeakMap,Ki=function(e){st(n,e);var t=ct(n);function n(e){var r;return et(this,n),ki(ut(r=t.call(this)),Vi,{writable:!0,value:void 0}),Mi(ut(r),Vi,e),r}return n.prototype.getInstance=function(){return new Wi(Ni(this,Vi))},n}(Fi),Ji=new Hi(i),qi=kt(),Qi=(null===(Ri=Be())||void 0===Ri?void 0:Ri.platformName)||"unknown";qi>0&&qi>={android:12100571,iOS:400,wp:0,unknown:0}[Qi]&&(null===(xi=Be())||void 0===xi?void 0:xi.appEnv.isMp)&&(Ji=new Ki(i));var Yi=Ji,$i=[qr({data:gi.record(Dr(),gi.any())}).optional()];function Xi(e){return eo.apply(this,arguments)}function eo(){return eo=Oe((function(e){return Re(this,(function(t){return[2,un("setStorage",$i,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp||Ze.isMpWeb?[4,Yi.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(We("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),eo.apply(this,arguments)}var to=[qr({keys:gi.array(Dr())}).optional()];function no(e){return ro.apply(this,arguments)}function ro(){return ro=Oe((function(e){return Re(this,(function(t){return[2,un("getStorage",to,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp||Ze.isMpWeb?[4,Yi.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(We("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ro.apply(this,arguments)}function io(e){return oo.apply(this,arguments)}function oo(){return(oo=Oe((function(e){return Re(this,(function(t){return[2,un("getStorageInfo",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp||Ze.isMpWeb?[4,Yi.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(We("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var ao=[qr({keys:gi.array(Dr())}).optional()];function so(e){return uo.apply(this,arguments)}function uo(){return uo=Oe((function(e){return Re(this,(function(t){return[2,un("removeStorage",ao,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp||Ze.isMpWeb?[4,Yi.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(We("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),uo.apply(this,arguments)}var co=[qr({prefix:Dr().optional()}).optional()];function lo(e){return po.apply(this,arguments)}function po(){return(po=Oe((function(e){return Re(this,(function(t){return[2,un("clearStorage",co,[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp||Ze.isMpWeb?[4,Yi.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(We("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var fo=function(){var e=Oe((function(e,t){var n,r,o,a;return Re(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,nn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,Ht.getAccessToken(n)];case 3:return o=s.sent(),a="id,name,user_id_by_oa,is_sensitive",a=e?"".concat(a,",picture.type(").concat(e,")"):"".concat(a,",picture"),[4,fetch("".concat(l.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(i),{headers:{access_token:o||""}}).then(function(){var e=Oe((function(e){var t,n,r,i,o,a;return Re(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)&&i<0)throw o=(null==r?void 0:r.message)||S,new Dt(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)}}(),ho=[qr({avatarType:gi.enum(["small","normal","large"]).optional(),autoRequestPermission:gi.boolean().default(!1).optional()}).optional()];function mo(e){return vo.apply(this,arguments)}function vo(){return vo=Oe((function(e){return Re(this,(function(t){return[2,un("getUserInfo",ho,[e],function(){var e=Oe((function(e){var t,n,r;return Re(this,(function(i){switch(i.label){case 0:if(!Ze.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,fo(t,n)];case 2:return[2,{userInfo:i.sent()}];case 3:return r=i.sent(),[2,Promise.reject(r)];case 4:return Ze.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(We("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vo.apply(this,arguments)}var go=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},yo=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(t){var n,r,i,o=t.network,a=(null===(n=Be())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)||!1;switch(o){case go(a).NONE:i=te.none;break;case go(a).WIFI:i=te.wifi;break;case go(a)["2G"]:case go(a)["3G"]:case go(a)["4G"]:i=te.cellular;break;default:i=te.unknown}e(i)},fail:function(e){t(e)}},{})}))]}))}));function _o(e){return bo.apply(this,arguments)}function bo(){return(bo=Oe((function(e){return Re(this,(function(t){return[2,un("getNetworkType",[],[e],Oe((function(){var e,t;return Re(this,(function(n){switch(n.label){case 0:return Ze.isMp?[4,yo()]:[3,2];case 1:return[2,{networkType:n.sent()}];case 2:if(Ze.isMpWeb){switch(e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,e.effectiveType){case"none":t=te.none;break;case"4g":t=te.wifi;break;case"3g":case"2g":t=te.cellular;break;default:t=te.unknown}return[2,Promise.resolve({networkType:t})]}return[2,Promise.reject(We("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var wo=[gi.function().args(qr({isConnected:gi.boolean(),networkType:gi.enum(["none","wifi","cellular","unknown"])})).returns(gi.void())];function To(e){return un("onNetworkStatusChange",wo,[e],(function(e){var t=e;if(Ze.isMp)!function(e){gt.getInstance().on(re.NetworkChanged,(function(t){var n=null==t?void 0:t.state;yo().then((function(t){e({isConnected:"CONNECTED"===n,networkType:t})}))}))}(t);else if(Ze.isMpWeb){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,r=n.effectiveType;n.addEventListener("change",(function(){var e;switch(r){case"none":e=te.none;break;case"4g":e=te.wifi;break;case"3g":case"2g":e=te.cellular;break;default:e=te.unknown}t({isConnected:!0,networkType:e})}))}}))}var Eo=function(){var e=Oe((function(e){var t,n,r,i,o,a;return Re(this,(function(s){return a={subaction:0,scanning_type:Xe.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Xe.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Xe.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Xe.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Xe.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Xe.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Xe.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Xe.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Xe.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Xe.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){Wt("SCAN_IBEACON",Ge({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Io=[qr({scanningType:gi.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:gi.number().optional(),monitorInterval:gi.number().optional(),domain:gi.string().optional(),scanConfig:qr({scanTime:gi.number().optional(),timeBetweenScan:gi.number().optional(),beaconTimeout:gi.number().optional(),delayCheckConnectedTimeout:gi.number().optional(),beaconConnectedTimeout:gi.number().optional()}).optional(),items:gi.array(qr({id:gi.string().optional(),distance:gi.number().optional(),monitor:qr({enable:gi.boolean().optional(),movingRange:gi.number().optional()}).optional()})).optional(),scanFromSource:gi.string().optional()}).optional()];function Po(e){return So.apply(this,arguments)}function So(){return(So=Oe((function(e){return Re(this,(function(t){return[2,un("startBeaconDiscovery",Io,[e],Oe((function(){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Eo(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(We("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Ao=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Oo(e){return Co.apply(this,arguments)}function Co(){return(Co=Oe((function(e){return Re(this,(function(t){return[2,un("stopBeaconDiscovery",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Ao()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(We("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var No=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("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 ko(e){return Mo.apply(this,arguments)}function Mo(){return(Mo=Oe((function(e){return Re(this,(function(t){return[2,un("getBeacons",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,No()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(We("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Ro=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function xo(e){return Do.apply(this,arguments)}function Do(){return(Do=Oe((function(e){return Re(this,(function(t){return[2,un("closeApp",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Ro()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Uo=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Lo(e){return jo.apply(this,arguments)}function jo(){return(jo=Oe((function(e){return Re(this,(function(t){return[2,un("scanQRCode",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Uo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(We("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Bo=function(){var e=Oe((function(e,t,n,i){return Re(this,(function(o){return[2,new Promise((function(o,a){Wt("OPEN_PROFILE",{uId:e,type:oe[t],zapp:r,sourceId:n,sourceIndex:i},{success:function(){o()},fail:function(e){a(e)}},{})}))]}))}));return function(t,n,r,i){return e.apply(this,arguments)}}(),Zo=[qr({id:Dr(),type:gi.enum(["user","oa","aliasOA"]),sourceId:gi.any().optional(),sourceIndex:gi.any().optional()}).optional()];function zo(e){return Wo.apply(this,arguments)}function Wo(){return Wo=Oe((function(e){return Re(this,(function(t){return[2,un("openProfile",Zo,[e],function(){var e=Oe((function(e){var t,n,r,i;return Re(this,(function(o){switch(o.label){case 0:return Ze.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Bo(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wo.apply(this,arguments)}var Fo=function(){var e=Oe((function(e,t){var n,i,o,a=arguments;return Re(this,(function(s){return n=a.length>2&&void 0!==a[2]?a[2]:"",i=a.length>3?a[3]:void 0,o=a.length>4?a[4]:void 0,[2,new Promise((function(a,s){Wt("OPEN_CHAT",{uId:e,type:ae[t],msg:n,zapp:r,sourceId:i,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Go=[qr({id:Dr(),type:gi.enum(["user","oa"]),sourceId:gi.any().optional(),sourceIndex:gi.any().optional(),message:Dr().optional()}).optional()];function Ho(e){return Vo.apply(this,arguments)}function Vo(){return Vo=Oe((function(e){return Re(this,(function(t){return[2,un("openChat",Go,[e],function(){var e=Oe((function(e){var t,n,r,i,o;return Re(this,(function(a){switch(a.label){case 0:return Ze.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,Fo(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vo.apply(this,arguments)}function Ko(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var Jo=function(){var e=Oe((function(e,t){var n,i;return Re(this,(function(o){switch(n={},i=e,e){case"image":(null==t?void 0:t.imageUrls)?(i="multi_image",n={photoUrl:null==t?void 0:t.imageUrls}):n={photoUrl:null==t?void 0:t.imageUrl};break;case"link":n={link:null==t?void 0:t.link,title:null==t?void 0:t.title,thumb:null==t?void 0:t.thumb,description:null==t?void 0:t.description};break;case"profile":n={avt:null==t?void 0:t.avatar,uid:null==t?void 0:t.id,dpn:null==t?void 0:t.displayName}}return[2,new Promise((function(e,t){Wt("OPEN_POSTFEED",Ko(Ge({type:se[i]},n),{zapp:r}),{success:function(t){e({status:null==t?void 0:t.status,shareType:null==t?void 0:t.share_type,numberOfUser:null==t?void 0:t.uid_to_size})},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),qo=[gi.union([qr({type:gi.enum(["image"]),data:qr({imageUrl:Dr().url().optional(),imageUrls:gi.array(Dr().url()).optional()})}),qr({type:gi.enum(["link"]),data:qr({link:Dr().url(),title:Dr().max(100).optional(),thumb:Dr().url().optional(),description:Dr().max(400).default("").optional()})}),qr({type:gi.enum(["profile"]),data:qr({id:Dr().optional()})})])];function Qo(e){return Yo.apply(this,arguments)}function Yo(){return Yo=Oe((function(e){return Re(this,(function(t){return[2,un("openPostFeed",qo,[e],function(){var e=Oe((function(e){var t,n;return Re(this,(function(r){switch(r.label){case 0:return Ze.isMp?(t=e.type,n=e.data,[4,Jo(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(We("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yo.apply(this,arguments)}var $o=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){Wt("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:r},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Xo=[qr({id:Dr(),showDialogConfirm:gi.boolean().optional()}).optional()];function ea(e){return ta.apply(this,arguments)}function ta(){return ta=Oe((function(e){return Re(this,(function(t){return[2,un("followOA",Xo,[e],function(){var e=Oe((function(e){var t;return Re(this,(function(n){switch(n.label){case 0:return Ze.isMp?(t=e.id,[4,$o(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ta.apply(this,arguments)}var na=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){Wt("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ra=[qr({id:Dr()}).optional()];function ia(e){return oa.apply(this,arguments)}function oa(){return oa=Oe((function(e){return Re(this,(function(t){return[2,un("unfollowOA",ra,[e],function(){var e=Oe((function(e){var t;return Re(this,(function(n){switch(n.label){case 0:return Ze.isMp?(t=e.id,[4,na(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),oa.apply(this,arguments)}var aa=function(){var e=Oe((function(e,t,n,r,i,a){var s,c,d,p,f,h,m,v;return Re(this,(function(g){switch(g.label){case 0:return d=new URL(location.href),p=new URLSearchParams,f="".concat(d.pathname.replace(u,"")).concat(d.search),a&&(f="/".concat(e).concat("/"===a[0]?"":"/").concat(a)),!(h=new URL("".concat(o).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(c=window.APP_VERSION)||void 0===c?void 0:c.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.CREATE_SHARE_LINK,Ge({method:"POST",body:p},m))];case 1:return[4,g.sent().json()];case 2:if(!(v=g.sent())||0!==v.err)throw Zt.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,Ko(Ge({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),sa=function(){var e=Oe((function(e,t){var n,o,a,s,u,c,l,d,p,f,h;return Re(this,(function(m){switch(m.label){case 0:switch(n={},o=e,e){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return n={text:null==t?void 0:t.text,desc:(null==t?void 0:t.desc)||(null==t?void 0:t.description),autoParseLink:(null==t?void 0:t.autoParseLink)?1:0},[3,14];case 2:return u=[],c=kt(),l=(null===(s=Be())||void 0===s?void 0:s.platformName)||"unknown",Number(c)>=z[l]&&(o="multi_image"),Array.isArray(null==t?void 0:t.imageUrls)&&(null==t?void 0:t.imageUrls.length)>0?u=null==t?void 0:t.imageUrls:u.push(null==t?void 0:t.imageUrl),n={photoUrls:u,photoUrl:null==t?void 0:t.imageUrl,caption:null==t?void 0:t.caption},[3,14];case 3:return n={photoUrl:null==t?void 0:t.imageUrl,gifUrl:null==t?void 0:t.gifUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 4:return n={videoThumb:null==t?void 0:t.videoThumb,videoUrl:null==t?void 0:t.videoUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 5:return n={link:null==t?void 0:t.link,chatOnly:(null==t?void 0:t.chatOnly)?1:0},[3,14];case 6:return n={uid:null==t?void 0:t.id},[3,14];case 7:case 10:return[4,Ht.getAccessToken()];case 8:case 11:return a=m.sent(),[4,aa(i,a||"",(null==t?void 0:t.title)||"",(null==t?void 0:t.description)||"",(null==t?void 0:t.thumbnail)||"",null==t?void 0:t.path)];case 9:return d=m.sent(),n={data:{ZInstantAPIInfo:{url:"".concat(d.zinstantApi),zinstantdata_id:"templateId=".concat(d.ztemplateId,"&appId=").concat(i,"&shareId=").concat(d.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return p=m.sent().shareableLink,f=new URL(p),h=f.searchParams.getAll("zshareId"),f.searchParams.delete("zshareId"),h.length>0&&f.searchParams.append("zshareId",h[0]),n={link:f.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(e,t){Wt("OPEN_SHARESHEET",Ko(Ge({type:ce[o]},n),{zapp:r}),{success:function(t){e({status:null==t?void 0:t.status,shareType:null==t?void 0:t.share_type,numberOfUser:null==t?void 0:t.uid_to_size})},fail:function(e){t(e)}},{timeout:!1})}))]}}))}));return function(t,n){return e.apply(this,arguments)}}(),ua=[gi.union([qr({type:gi.enum(["text"]),data:qr({text:Dr(),description:Dr().default("").optional(),autoParseLink:gi.boolean().default(!1).optional()})}),qr({type:gi.enum(["image"]),data:qr({imageUrl:Dr().url().optional(),imageUrls:gi.array(Dr().url()).max(10).optional()})}),qr({type:gi.enum(["link"]),data:qr({link:Dr().url(),chatOnly:gi.boolean().optional()})}),qr({type:gi.enum(["oa"]),data:qr({id:Dr()})}),qr({type:gi.enum(["gif"]),data:qr({gifUrl:Dr().url(),imageUrl:Dr().url().optional(),width:Ur().min(0).optional(),height:Ur().min(0).optional()})}),qr({type:gi.enum(["video"]),data:qr({videoThumb:Dr().url(),videoUrl:Dr().url(),width:Ur().min(0).optional(),height:Ur().min(0).optional()})}),qr({type:gi.enum(["zmp","zmp_deep_link"]),data:qr({title:Dr().max(100),thumbnail:Dr().url(),path:Dr().optional(),description:Dr().max(400).default("").optional()})})])];function ca(e){return la.apply(this,arguments)}function la(){return la=Oe((function(e){return Re(this,(function(t){return[2,un("openShareSheet",ua,[e],function(){var e=Oe((function(e){var t,n;return Re(this,(function(r){switch(r.label){case 0:return Ze.isMp?(t=e.type,n=e.data,[4,sa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(We("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),la.apply(this,arguments)}var da=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Be())||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=Be())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)&&"number"==typeof(null==n?void 0:n.code)?e({userAllow:(null==n?void 0:n.code)>=0,message:null==n?void 0:n.message}):t(n)}},{isMultiCallback:!0})}))]}))}));function pa(e){return fa.apply(this,arguments)}function fa(){return(fa=Oe((function(e){return Re(this,(function(t){return[2,un("requestCameraPermission",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return[4,da()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var ha=function(){var e=Oe((function(e,t,n){return Re(this,(function(r){return[2,new Promise((function(r,i){Wt("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)}}(),ma=Oe((function(){var e,t,n,r=arguments;return Re(this,(function(o){switch(o.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:i,t=r.length>1&&void 0!==r[1]?r[1]:0,n=vn(),[4,At(e,t,n.version)];case 1:return[2,o.sent()]}}))})),va=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){Wt("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ga=[qr({params:gi.record(Dr(),Dr()).optional()}).optional()];function ya(e){return _a.apply(this,arguments)}function _a(){return _a=Oe((function(e){return Re(this,(function(t){return[2,un("createShortcut",ga,[e],function(){var e=Oe((function(e){var t,n,r,a,s,u,c,l;return Re(this,(function(d){switch(d.label){case 0:return Ze.isMp?[4,ma(i,0)]:[3,6];case 1:return r=d.sent(),a=null===(t=Be())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||Yt("og:image:url")||"",u=r.name||document.title,(c=(null==e?void 0:e.params)?new URLSearchParams(null==e?void 0:e.params):new URLSearchParams).append("utm_source","zalo-shortcut"),c.append("utm_medium","default"),c.append("utm_campaign","default"),a?(c.append("appId",i),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,va(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,ha("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,Zt.success()];case 6:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_a.apply(this,arguments)}var ba=function(){var e=Oe((function(e,t,n){return Re(this,(function(i){return[2,new Promise((function(i,o){Wt("PROMPT_AUTHENTICATION",{secret_data:e,app_id:r,ui:{title:null==t?void 0:t.title,sub_title:null==t?void 0:t.subTitle,negative_text:null==t?void 0:t.negativeButtonText},require_fingerprint:n?1:0},{success:function(e){var t,n,r,o;i({code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null==e||null===(t=e.data)||void 0===t?void 0:t.domain,code:null==e||null===(n=e.data)||void 0===n?void 0:n.error_code,message:null==e||null===(r=e.data)||void 0===r?void 0:r.error_message,payToken:null==e||null===(o=e.data)||void 0===o?void 0:o.pay_token}})},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),wa=[qr({secretData:Dr(),ui:qr({title:Dr().default("Xác thực").optional(),subTitle:Dr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:Dr().default("Đóng").optional()}).optional(),requireFingerprint:Br().default(!0).optional()}).optional()];function Ta(e){return Ea.apply(this,arguments)}function Ea(){return Ea=Oe((function(e){return Re(this,(function(t){return[2,un("openBioAuthentication",wa,[e],function(){var e=Oe((function(e){var t,n,r;return Re(this,(function(i){switch(i.label){case 0:return Ze.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,ba(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(We("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ea.apply(this,arguments)}var Ia=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("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 Pa(e){return Sa.apply(this,arguments)}function Sa(){return(Sa=Oe((function(e){return Re(this,(function(t){return[2,un("checkStateBioAuthentication",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Ia()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Ze.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(We("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Aa=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){Wt("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Oa=[qr({message:Dr()}).optional()];function Ca(e){return Na.apply(this,arguments)}function Na(){return Na=Oe((function(e){return Re(this,(function(t){return[2,un("showToast",Oa,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Aa(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Na.apply(this,arguments)}var ka=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ma(e){return Ra.apply(this,arguments)}function Ra(){return(Ra=Oe((function(e){return Re(this,(function(t){return[2,un("hideKeyboard",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,ka()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var xa=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){Wt("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Da=[qr({phoneNumber:Dr()})];function Ua(e){return La.apply(this,arguments)}function La(){return La=Oe((function(e){return Re(this,(function(t){return[2,un("openPhone",Da,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,xa(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),La.apply(this,arguments)}var ja=function(){var e=Oe((function(e,t){return Re(this,(function(n){return[2,new Promise((function(n,r){Wt("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ba=[qr({content:Dr(),phoneNumber:Dr()})];function Za(e){return za.apply(this,arguments)}function za(){return za=Oe((function(e){return Re(this,(function(t){return[2,un("openSMS",Ba,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,ja(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),za.apply(this,arguments)}var Wa=function(){var e=Oe((function(e){var t,n=arguments;return Re(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){Wt("VIEW_MYQR",{dpn:t,uid:e,zapp:r},{success:function(){n()},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Fa=[qr({id:Dr(),displayName:Dr().default("").optional()})];function Ga(e){return Ha.apply(this,arguments)}function Ha(){return Ha=Oe((function(e){return Re(this,(function(t){return[2,un("viewOAQr",Fa,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Wa(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ha.apply(this,arguments)}var Va=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){Wt("KEEP_SCREEN",{data:{keep_screen_on:e?1:0}},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ka=[qr({keepScreenOn:Br()})];function Ja(e){return qa.apply(this,arguments)}function qa(){return qa=Oe((function(e){return Re(this,(function(t){return[2,un("keepScreen",Ka,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Va(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qa.apply(this,arguments)}function Qa(e){return Ya.apply(this,arguments)}function Ya(){return(Ya=Oe((function(e){return Re(this,(function(t){return[2,un("onKeepScreen",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Va(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function $a(e){return Xa.apply(this,arguments)}function Xa(){return(Xa=Oe((function(e){return Re(this,(function(t){return[2,un("offKeepScreen",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Va(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var es=function(){var e=Oe((function(e,t,n){var r;return Re(this,(function(i){return r={},e?r={imageBase64Data:e}:t&&(r={imageUrl:t}),[2,new Promise((function(e,t){Wt("SAVE_IMAGE_GALLERY",Ko(Ge({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),ts=[qr({imageBase64Data:Dr().optional(),imageUrl:Dr().url().optional()}).optional()];function ns(e){return rs.apply(this,arguments)}function rs(){return rs=Oe((function(e){return Re(this,(function(t){return[2,un("saveImageToGallery",ts,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,es(e.imageBase64Data,e.imageUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rs.apply(this,arguments)}var is=function(){var e=Oe((function(e,t){var n;return Re(this,(function(r){return{},n={videoUrl:e,onProgress:t},[2,new Promise((function(e,t){Wt("SAVE_VIDEO_GALLERY",Ge({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),os=[qr({videoUrl:Dr().url()}).optional()];function as(e){return ss.apply(this,arguments)}function ss(){return ss=Oe((function(e){return Re(this,(function(t){return[2,un("saveVideoToGallery",os,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,is(e.videoUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("saveVideoToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ss.apply(this,arguments)}var us=function(){var e=Oe((function(e){var t,n,r,i,o,s,u=arguments;return Re(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,ma(e,0)];case 2:return r=c.sent(),[3,4];case 3:return c.sent(),[3,4];case 4:i={appId:e},r&&(i.appName=r.name,i.appAvtUrl=r.logoUrl),o="".concat(a,"/").concat(e).concat(t);try{s=new URL(o),Object.entries(n).forEach((function(e){var t=He(e,2),n=t[0],r=t[1];s.searchParams.append(n,String(r))})),o=s.href}catch(e){}return[2,new Promise((function(e,t){Wt("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),cs=[qr({appId:Dr(),path:Dr().optional(),params:gi.record(Dr(),Dr()).optional()})];function ls(e){return ds.apply(this,arguments)}function ds(){return ds=Oe((function(e){return Re(this,(function(t){return[2,un("openMiniApp",cs,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,us(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ds.apply(this,arguments)}var ps=Oe((function(){var e,t,n=arguments;return Re(this,(function(r){return e=n.length>0&&void 0!==n[0]?n[0]:"oneShot",t=n.length>1?n[1]:void 0,[2,new Promise((function(n,r){Wt("INTERACTIVE_VIBRATION",{type:de[e],vibrate_time:t},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))})),fs=[qr({type:gi.enum(["oneShot"]).default("oneShot").optional(),milliseconds:Ur().optional()})];function hs(e){return ms.apply(this,arguments)}function ms(){return ms=Oe((function(e){return Re(this,(function(t){return[2,un("vibrate",fs,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,ps(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ms.apply(this,arguments)}var vs=function(){var e=Oe((function(e,t){var n,r,i,o;return Re(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=Xe.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Ct(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Ct(null==t?void 0:t.leftButton):"back"},!r&&Xe.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){Wt("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),gs=[qr({url:Dr(),config:qr({style:gi.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:gi.enum(["back","none"]).default("back").optional()}).optional()})];function ys(e){return _s.apply(this,arguments)}function _s(){return _s=Oe((function(e){return Re(this,(function(t){return[2,un("openWebview",gs,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,vs(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_s.apply(this,arguments)}function bs(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=bt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function ws(){return un("getRouteParams",[],[],(function(){return bs()}))}function Ts(e){return Es.apply(this,arguments)}function Es(){return(Es=Oe((function(e){return Re(this,(function(t){return[2,un("getAppInfo",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,ma()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(We("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Is=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){Wt("WEBVIEW_SET_RESULT",{result:$t(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ps=[qr({data:gi.any()})];function Ss(e){return As.apply(this,arguments)}function As(){return As=Oe((function(e){return Re(this,(function(t){return[2,un("sendDataToPreviousMiniApp",Ps,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Is(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),As.apply(this,arguments)}var Os=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){var n,r;Wt("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(Zt.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Be())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function Cs(e){return Ns.apply(this,arguments)}function Ns(){return(Ns=Oe((function(e){return Re(this,(function(t){return[2,un("getPhoneNumber",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Os()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(We("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var ks=Oe((function(){var e,t=arguments;return Re(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){Wt("MP_OPEN_PROFILE_PICKER",{maxProfile:e},{success:function(e){Array.isArray(e)?t(e.map((function(e){return e.id}))):t([])},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))})),Ms=[qr({maxProfile:Ur().min(1).max(10).optional().default(1)})];function Rs(e){return xs.apply(this,arguments)}function xs(){return xs=Oe((function(e){return Re(this,(function(t){return[2,un("openProfilePicker",Ms,[e],function(){var e=Oe((function(e){var t,n,r,i,o;return Re(this,(function(a){switch(a.label){case 0:return Ze.isMp?[4,ks(null==e?void 0:e.maxProfile)]:[3,8];case 1:if(!((t=a.sent()).length>0))return[3,7];a.label=2;case 2:return a.trys.push([2,6,,7]),[4,Ht.getAccessToken()];case 3:return r=a.sent(),[4,fetch(l.GET_LIST_USER_INFO,{method:"POST",headers:{"Content-Type":"application/json",access_token:r||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})})];case 4:return[4,a.sent().json()];case 5:if(0!==(i=a.sent()).error||!i.data)throw new Error(i.message);return n=t.map((function(e){var t,n,r,o,a,s,u,c,l,d,p;return{id:(null===(t=i.data[e])||void 0===t||null===(n=t.user_info)||void 0===n?void 0:n.user_id_by_app)||"",profile:{name:null===(r=i.data[e])||void 0===r||null===(o=r.user_info)||void 0===o?void 0:o.name,avatar:null===(a=i.data[e])||void 0===a||null===(s=a.user_info)||void 0===s||null===(u=s.picture)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.url},code:0!==(null===(l=i.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(Xe.isUndefined(null===(d=i.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=i.data[e])||void 0===p?void 0:p.message)}})),[3,7];case 6:return o=a.sent(),n=t.map((function(e){return{id:e,profile:{name:"",avatar:""},code:-1,message:"Can't get profile: ".concat(o.message)}})),[3,7];case 7:return[2,{users:n||[]}];case 8:return Ze.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(We("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xs.apply(this,arguments)}var Ds=function(){var e=Oe((function(e,t,n){var r;return Re(this,(function(i){return r=t&&Xe.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){Wt("MP_JOIN_WIFI",{ssid:e,securityType:r,password:t,hiddenSsid:n},{success:function(e){i(e)},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Us=[qr({SSID:Dr(),password:Dr().optional(),hiddenSSID:Br().optional()})];function Ls(e){return js.apply(this,arguments)}function js(){return js=Oe((function(e){return Re(this,(function(t){return[2,un("connectWifi",Us,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Ds(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),js.apply(this,arguments)}var Bs=function(){var e=Oe((function(e,t,n,r,i,o){var a,s;return Re(this,(function(u){return a={type:0,url:t,max_size:n||1048576},s={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(t,n){Wt("PICK_MEDIA",{media_type:pe[e],edit_view:Ge({},s,r),silent_request:i,upload:a,max_select_items:o},{success:function(e){t(null==e?void 0:e.result_content)},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Zs=[qr({type:gi.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:Dr().url(),maxItemSize:Ur().min(0).optional(),editView:qr({enable:Br().optional(),aspectRatio:Dr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:Br().optional(),maxSelectItem:Ur().min(1).optional()})];function zs(e){return Ws.apply(this,arguments)}function Ws(){return Ws=Oe((function(e){return Re(this,(function(t){return[2,un("openMediaPicker",Zs,[e],function(){var e=Oe((function(e){var t,n,r,i,o,a;return Re(this,(function(s){switch(s.label){case 0:return Ze.isMp?(i={},Xe.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(n=e.editView)||void 0===n?void 0:n.enable)?i.enable=1:i.enable=0,i.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio,o=!0===e.silentRequest?1:0,a=e.maxSelectItem,[4,Bs(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Ze.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(We("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ws.apply(this,arguments)}var Fs=[qr({title:Dr().max(100),description:Dr().max(400).default(""),thumbnail:Dr().url().optional(),path:Dr().optional()})];function Gs(e){return Hs.apply(this,arguments)}function Hs(){return Hs=Oe((function(e){return Re(this,(function(t){return[2,un("getShareableLink",Fs,[e],function(){var e=Oe((function(e){var t;return Re(this,(function(n){switch(n.label){case 0:return[4,Ht.getAccessToken()];case 1:return t=n.sent(),[4,aa(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)}}())]}))})),Hs.apply(this,arguments)}var Vs=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){Wt("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 Ks(e){return Js.apply(this,arguments)}function Js(){return(Js=Oe((function(e){return Re(this,(function(t){return[2,un("closeLoading",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Vs("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function qs(e){return Qs.apply(this,arguments)}function Qs(){return Qs=Oe((function(e){return Re(this,(function(t){return[2,un("requestUpdateZalo",[],[e],Oe((function(){var e,t,n;return Re(this,(function(r){switch(r.label){case 0:return Ze.isMp?(n=(null===(e=Be())||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,va(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("requestUpdateZalo",{}))]}}))})))]}))})),Qs.apply(this,arguments)}var Ys=gt.getInstance();Ys.addListener=function(e,t,n){var r=e;return Ys.addListener(re[r],t,n)};var $s=[gi.function()];function Xs(e){return un("onConfirmToExit",$s,[e],(function(e){var t=e;Ze.isMp&&(Ys.on(re.AppClose,t,'{"handle_h5": 1}'),_i.setNavigationBarLeftButton(void 0,2))}))}function eu(){return un("offConfirmToExit",[],[],(function(){Ze.isMp&&(Ys.off(re.AppClose),_i.setNavigationBarLeftButton(void 0,0))}))}function tu(){return un("getDeviceId",[],[],(function(){return Ze.isMp&&Ht.getSync(c.DEVICE_ID)||""}))}function nu(e){return ru.apply(this,arguments)}function ru(){return(ru=Oe((function(e){return Re(this,(function(t){return[2,un("getDeviceIdAsync",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Ht.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function iu(){return un("getContext",[],[],(function(){if(Ze.isMp){var e=Ht.getSync(c.CONTEXT_ID)||"";return{type:Ht.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function ou(e){return au.apply(this,arguments)}function au(){return(au=Oe((function(e){return Re(this,(function(t){return[2,un("getContextAsync",[],[e],Oe((function(){var e;return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Ht.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,Ht.jumpAndGetToken(c.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function su(e){return uu.apply(this,arguments)}function uu(){return(uu=Oe((function(e){return Re(this,(function(t){return[2,un("getAuthCode",[],[e],Oe((function(){var e,t;return Re(this,(function(n){switch(n.label){case 0:return Ze.isMp?[4,Ht.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,Ht.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,Ht.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Ot([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),Zt.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function cu(e){return lu.apply(this,arguments)}function lu(){return(lu=Oe((function(e){return Re(this,(function(t){return[2,un("getZPIToken",[],[e],Oe((function(){var e,t,n,r;return Re(this,(function(i){switch(i.label){case 0:return Ze.isMp?[4,Ht.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,Ht.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,Ht.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,Ht.jumpAndGetToken(c.ZPT_ZPI)];case 4:return r=i.sent()||"",[2,{utoken:e,gtoken:t,zpp:n,zpt:r}];case 5:return[2,Promise.resolve({utoken:"",gtoken:"",zpp:"",zpt:""})]}}))})))]}))}))).apply(this,arguments)}var du=[Dr()];function pu(e){return un("setAccessToken",du,[e],(function(e){var t=e;Ht.setAccessToken(t)}))}var fu=[qr({url:Dr().url()})];function hu(e){return mu.apply(this,arguments)}function mu(){return mu=Oe((function(e){return Re(this,(function(t){return[2,un("openOutApp",fu,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,va(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),mu.apply(this,arguments)}var vu=[qr({count:Ur().min(1).optional().default(1),sourceType:gi.array(gi.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:gi.enum(["back","front"]).default("front").optional()})];function gu(e){return yu.apply(this,arguments)}function yu(){return yu=Oe((function(e){return Re(this,(function(t){return[2,un("chooseImage",vu,[e],function(){var e=Oe((function(e){var t,n,r,i;return Re(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)}}())]}))})),yu.apply(this,arguments)}var _u=Oe((function(){var e,t,n=arguments;return Re(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){Wt("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(Zt.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function bu(e){return wu.apply(this,arguments)}function wu(){return(wu=Oe((function(e){return Re(this,(function(t){return[2,un("getLocation",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,_u()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({token:""})]:[2,Promise.reject(We("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Tu=[gi.function().args(qr({data:gi.any()})).returns(gi.void())];function Eu(e){return un("onCallbackData",Tu,[e],(function(){!function(e){gt.getInstance().on(re.OnDataCallback,(function(t){e({data:t})}))}(e)}))}var Iu=function(){var e=Oe((function(e){var t,n,r,o,a,s,u,c,l,d,p;return Re(this,(function(f){switch(f.label){case 0:return e||(e=bs()),"object"==typeof e&&((n=e.zmpOrderId||e.orderId)||(t=e.appTransID||e.apptransid||e.transId)),"string"==typeof e&&(r=bt.getParameterByName("orderId",e),o=bt.getParameterByName("appTransID",e)||bt.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,Ht.getAccessToken().catch((function(){throw Zt.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(H),c={orderId:n||"",transId:t||"",appId:i},u.search=new URLSearchParams(c).toString(),[4,fetch(u.toString(),a)];case 2:return[4,f.sent().json()];case 3:if(!(l=f.sent()).data)throw Zt.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,Ge({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Pu=function(){var e=Oe((function(e,t,n,r,o,a,s){var u,c,l,d,p,f,h,m,v,g,y,_,b,w,T,E,I,P,S,A;return Re(this,(function(O){switch(O.label){case 0:u=i,(c=new URLSearchParams).append("amount",e.toString()),c.append("item",encodeURIComponent(JSON.stringify(t))),c.append("appId",u),c.append("mac",r),n&&c.append("desc",encodeURIComponent(n)),o&&(l=o,"object"==typeof o&&(l=JSON.stringify(o)),c.append("extradata",encodeURIComponent(l))),a&&(d=a,"object"==typeof a&&(d=JSON.stringify(a)),c.append("payload",encodeURIComponent(d))),s&&("string"==typeof s?(c.append("method",s),c.append("isCustom","false")):"object"==typeof s&&(c.append("method",s.id),c.append("isCustom",JSON.stringify(s.isCustom)))),p={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},O.label=1;case 1:return O.trys.push([1,6,,7]),[4,Ht.getAccessToken().catch((function(){throw Zt.error.loginRequired}))];case 2:return f=O.sent(),p.headers.authorization="Bearer ".concat(f),[4,fetch(F,Ko(Ge({method:"POST"},p),{body:c}))];case 3:return[4,O.sent().json()];case 4:if(!(h=O.sent()).data||0!==h.err)throw Zt.error.badRequest(h.msg);return m=h.data.id,v=h.data.jwt,g=h.data.messageToken||"",y=window.APP_VERSION,_=window.APP_ENV,b={miniAppId:u,orderId:m},w=h.data.method,T=h.data.isCustom,v&&(b.token=v),y&&(b.version=y),_&&(b.env=_),w&&(b.method=w),T&&(b.isCustom=T),E=bt.encode(b),I=new URL("?".concat(E),"https://payment-mini.zalo.me").toString(),P=kt(),S=Nt()&&P<742?"normal":"bottomSheet",ft.enablePaymentDone=gt.getInstance().eventNames().includes(re.PaymentDone),[4,vs(I,{style:S}).then((function(){var e=!1;gt.getInstance().once(re.WebviewClosed,(function(){setTimeout(Oe((function(){var t;return Re(this,(function(n){switch(n.label){case 0:return e?[3,2]:(gt.getInstance().emit(re.PaymentDone,m,{orderId:m}),[4,Iu({zmpOrderId:m})]);case 1:(t=n.sent()).err>=0&&!t.isCustom&>.getInstance().emit(re.PaymentClose,t.err,Ko(Ge({},t),{zmpOrderId:m})),n.label=2;case 2:return[2]}}))})),500)})),gt.getInstance().once(re.OpenApp,(function(){e=!0})),gt.getInstance().once(re.PaymentDone,(function(){e=!0,ft.enablePaymentDone=!1}))}))];case 5:return O.sent(),[2,{orderId:m,messageToken:g}];case 6:throw A=O.sent(),console.log("Internal error"),A;case 7:return[2]}}))}));return function(t,n,r,i,o,a,s){return e.apply(this,arguments)}}(),Su=[qr({amount:gi.union([Dr(),Ur()]),item:gi.array(gi.record(Dr(),gi.any())),desc:gi.string(),mac:gi.string(),extradata:gi.any().optional(),payload:gi.any().optional(),method:gi.union([gi.string(),gi.object({id:gi.string(),isCustom:gi.boolean()})]).optional()})];function Au(e){return Ou.apply(this,arguments)}function Ou(){return Ou=Oe((function(e){return Re(this,(function(t){return[2,un("createOrder",Su,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Pu(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 Ze.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(We("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ou.apply(this,arguments)}var Cu=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),Nu=function(){var e=Oe((function(e,t,n,r,o){var a,s,u,c,l,d,p,f,h,m,v,g;return Re(this,(function(y){switch(y.label){case 0:a=i,(s=new URLSearchParams).append("amount",e.toString()),s.append("appId",a),t&&s.append("desc",encodeURIComponent(t)),n&&s.append("method",n),r&&s.append("transId",r),o&&s.append("mac",o),u={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},y.label=1;case 1:return y.trys.push([1,10,,11]),[4,Ht.getAccessToken().catch((function(){throw Zt.error.loginRequired}))];case 2:return l=y.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,Ht.jumpAndGetToken()];case 3:if(y.sent(),d=null===(c=Ht.miniProgramConfig)||void 0===c?void 0:c.showConfirmToPayment,console.log("showConfirmToPayment",d),!d)return[3,7];y.label=4;case 4:return y.trys.push([4,6,,7]),[4,Cu()];case 5:return y.sent(),[3,7];case 6:throw p=y.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(V,Ko(Ge({method:"POST"},u),{body:s}))];case 8:return[4,y.sent().json()];case 9:if(!(f=y.sent()).data||0!==f.err)throw Zt.error.badRequest(f.msg);return h=f.data.id,m=f.data.messageToken||"",v=f.data.transId||"",[2,{orderId:h,messageToken:m,transId:v}];case 10:throw g=y.sent(),console.log("Internal error"),g;case 11:return[2]}}))}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),ku=[qr({amount:gi.union([gi.string(),gi.number()]),desc:gi.string(),method:gi.string(),transId:gi.string().optional(),mac:gi.string().optional()})];function Mu(e){return Ru.apply(this,arguments)}function Ru(){return Ru=Oe((function(e){return Re(this,(function(t){return[2,un("purchase",ku,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Nu(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 Ze.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(We("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ru.apply(this,arguments)}var xu=function(){var e=Oe((function(e,t){return Re(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;Wt("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)}}(),Du=[qr({channels:Jr(qr({method:Dr(),subMethod:Dr().optional(),subInfo:Dr().optional()})).optional(),selectedMethod:qr({method:Dr(),subMethod:Dr().optional()}).optional()}).optional()];function Uu(e){return Lu.apply(this,arguments)}function Lu(){return Lu=Oe((function(e){return Re(this,(function(t){return[2,un("selectPaymentMethod",Du,[e],function(){var e=Oe((function(e){var t,n;return Re(this,(function(r){switch(r.label){case 0:return Ze.isMp?(t=e.channels,n=e.selectedMethod,[4,xu(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(We("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Lu.apply(this,arguments)}var ju=[qr({data:gi.union([Dr(),gi.record(Dr(),Dr().nullish())])})];function Bu(e){return Zu.apply(this,arguments)}function Zu(){return Zu=Oe((function(e){return Re(this,(function(t){return[2,un("checkTransaction",ju,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Iu(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(We("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zu.apply(this,arguments)}var zu=function(){var e=Oe((function(e,t,n,r,o,a){var s,u,c,l,d,p,f,h,m,v,g,y,_,b;return Re(this,(function(w){switch(w.label){case 0:d=i,(p=new URLSearchParams).append("payType",t||fe.SUBSCRIPTION),f=he.UNKNOW,n===J&&(f=he.IMMEDIATE_AND_CHARGE_FULL_PRICE),n===K&&(f=he.DEFERRED),p.append("utm",o||"default"),p.append("merchantTransId",a||""),p.append("prorationMode",f.toString()),p.append("appId",d),r&&p.append("method",r),h="",(null===(s=Be())||void 0===s||null===(u=s.platform)||void 0===u?void 0:u.isIOS)?h="ios":(null===(c=Be())||void 0===c||null===(l=c.platform)||void 0===l?void 0:l.isAndroid)&&(h="android"),p.append("os",h),p.append("productId",e),m={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},w.label=1;case 1:return w.trys.push([1,5,,6]),[4,Ht.getAccessToken().catch((function(){throw Zt.error.loginRequired}))];case 2:return v=w.sent(),m.headers.authorization="Bearer ".concat(v),[4,fetch(G,Ko(Ge({method:"POST"},m),{body:p}))];case 3:return[4,w.sent().json()];case 4:if(!(g=w.sent()).data||!g.data.store||0!==g.err)throw Zt.error.createIAPOrderFailed(g.err);return y=g.data.store,_=g.data.orderId,[2,new Promise((function(e,t){Wt("IAP_REQUESTPAYMENT",Ge({},y),{success:function(){e({orderId:_})},fail:function(e){t(e)}})}))];case 5:throw b=w.sent(),console.log("Internal error"),b;case 6:return[2]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Wu=[qr({productId:Dr(),payType:gi.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:gi.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:Dr().optional(),method:gi.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:Dr().optional()})];function Fu(e){return Gu.apply(this,arguments)}function Gu(){return Gu=Oe((function(e){return Re(this,(function(t){return[2,un("createOrderIAP",Wu,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,zu(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(We("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gu.apply(this,arguments)}var Hu=[qr({hide:Br().default(!1).optional()}).optional()];function Vu(e){return Ku.apply(this,arguments)}function Ku(){return Ku=Oe((function(e){return Re(this,(function(t){return[2,un("setAndroidBottomNavigationBar",Hu,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,_i.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ku.apply(this,arguments)}var Ju=[qr({hide:Br().default(!1).optional()}).optional()];function qu(e){return Qu.apply(this,arguments)}function Qu(){return Qu=Oe((function(e){return Re(this,(function(t){return[2,un("setIOSBottomSafeArea",Ju,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,_i.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qu.apply(this,arguments)}var Yu=[qr({type:gi.enum(["normal","hidden","transparent"]).default("normal").optional(),color:gi.string().optional()}).optional()];function $u(e){return Xu.apply(this,arguments)}function Xu(){return Xu=Oe((function(e){return Re(this,(function(t){return[2,un("setStatusBar",Yu,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,_i.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xu.apply(this,arguments)}var ec=[qr({headerTextColor:gi.enum(["black","white"]).optional(),headerColor:gi.string().optional(),actionBar:qr({hide:gi.boolean().optional(),title:gi.string().optional(),leftButton:gi.enum(["back","none"]).optional(),textAlign:gi.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:gi.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:gi.boolean().optional(),hideIOSSafeAreaBottom:gi.boolean().optional()})];function tc(e){return nc.apply(this,arguments)}function nc(){return nc=Oe((function(e){return Re(this,(function(t){return[2,un("configAppView",ec,[e],function(){var e=Oe((function(e){var t,n,r,i,o,a,s;return Re(this,(function(u){switch(u.label){case 0:return Ze.isMp?Xe.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,_i.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return Xe.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,_i.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,_i.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,_i.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,_i.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 Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),nc.apply(this,arguments)}var rc=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ic(e){return oc.apply(this,arguments)}function oc(){return(oc=Oe((function(e){return Re(this,(function(t){return[2,un("minimizeApp",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,rc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var ac=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function sc(e){return uc.apply(this,arguments)}function uc(){return(uc=Oe((function(e){return Re(this,(function(t){return[2,un("openPermissionSetting",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,ac()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var cc=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function lc(e){return dc.apply(this,arguments)}function dc(){return(dc=Oe((function(e){return Re(this,(function(t){return[2,un("favoriteApp",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,cc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var pc=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function fc(e){return hc.apply(this,arguments)}function hc(){return(hc=Oe((function(e){return Re(this,(function(t){return[2,un("openGroupList",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,pc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var mc=Oe((function(){var e;return Re(this,(function(t){switch(t.label){case 0:return[4,Ht.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){Wt("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function vc(e){return gc.apply(this,arguments)}function gc(){return(gc=Oe((function(e){return Re(this,(function(t){return[2,un("requestSendNotification",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,mc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var yc=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function _c(e){return bc.apply(this,arguments)}function bc(){return(bc=Oe((function(e){return Re(this,(function(t){return[2,un("addRating",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,yc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(We("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var wc,Tc=(wc=Oe((function(e,t,n){var r,i;return Re(this,(function(o){switch(o.label){case 0:return(r=new URLSearchParams).append("appId",t),r.append("accessToken",n),r.append("oaId",e),i={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.CHECK_INTERACT_OA,Ge({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return wc.apply(this,arguments)}),Ec=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){Wt("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)}}(),Ic=[qr({oaId:Dr()})];function Pc(e){return Sc.apply(this,arguments)}function Sc(){return Sc=Oe((function(e){return Re(this,(function(t){return[2,un("interactOA",Ic,[e],function(){var e=Oe((function(e){var t,n,r;return Re(this,(function(o){switch(o.label){case 0:return Ze.isMp?(t=e.oaId,[4,Ht.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||Xe.isEmpty(n)?[3,3]:[4,Tc(t,i,n)];case 2:if(0===(null==(r=o.sent())?void 0:r.err))return[2,Promise.resolve({})];o.label=3;case 3:return[4,Ec(t)];case 4:return[2,o.sent()];case 5:return Ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(We("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Sc.apply(this,arguments)}var Ac=[qr({oaId:Dr()})];function Oc(e){return Cc.apply(this,arguments)}function Cc(){return Cc=Oe((function(e){return Re(this,(function(t){return[2,un("isAllowedInteractWithOA",Ac,[e],function(){var e=Oe((function(e){var t,n,r;return Re(this,(function(o){switch(o.label){case 0:return Ze.isMp?(t=e.oaId,[4,Ht.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||Xe.isEmpty(n)?[3,3]:[4,Tc(t,i,n)];case 2:return r=o.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return Ze.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(We("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Cc.apply(this,arguments)}function Nc(e){return kc.apply(this,arguments)}function kc(){return(kc=Oe((function(e){return Re(this,(function(t){return[2,un("getSetting",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,jt()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(We("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Mc=gi.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Rc=[qr({scopes:gi.array(Mc).max(2).optional()}).optional()];function xc(e){return Dc.apply(this,arguments)}function Dc(){return Dc=Oe((function(e){return Re(this,(function(t){return[2,un("authorize",Rc,[e],function(){var e=Oe((function(e){var t;return Re(this,(function(n){switch(n.label){case 0:return Ze.isMp?(t=null==e?void 0:e.scopes,Mt(724,573)?[2,Promise.reject(Zt.error.clientNotSupport())]:[4,Ft(null!=t?t:void 0)]):[3,2];case 1:return[2,n.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(We("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Dc.apply(this,arguments)}var Uc=Oe((function(){return Re(this,(function(e){return[2,new Promise(function(){var e=Oe((function(e,t){var n;return Re(this,(function(r){switch(r.label){case 0:return Xe.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(Zt.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Lc(e){return un("checkZaloCameraPermission",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return[4,Uc()];case 1:return[2,e.sent()]}}))})))}var jc=Oe((function(){return Re(this,(function(e){return[2,new Promise(function(){var e=Oe((function(e,t){var n,r,i;return Re(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Ht.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=Ht.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 Bc(e){return Zc.apply(this,arguments)}function Zc(){return(Zc=Oe((function(e){return Re(this,(function(t){return[2,un("getUserID",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,jc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(We("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var zc=Oe((function(){return Re(this,(function(e){return[2,new Promise(function(){var e=Oe((function(e,t){var n,r,i;return Re(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Ht.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=Ht.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 Wc(e){return Fc.apply(this,arguments)}function Fc(){return(Fc=Oe((function(e){return Re(this,(function(t){return[2,un("getIDToken",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,zc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(We("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Gc={format:we.JPEG,quality:Te.NORMAL,mirrored:!1,useVideoSourceSize:!1},Hc={width:1024,height:768,facingMode:be.FRONT,mirrored:!1,audio:!1,video:!0},Vc=function(){function e(t){var n,r,i,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=this;et(this,e),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(u.haveVideoStream()&&u._userRequestFrameCallback){var e=u.getCanvas();if(u.drawFrame(),e){var t={data:e.toDataURL(we.PNG),width:e.width,height:e.height};gt.getInstance().emit(_e.OnFrameCallback,0,t),requestAnimationFrame(u.tick)}}},this._videoElement=t,this._mediaConstraints=null!=s?s:null,this._facingMode=null!==(n=null==s?void 0:s.facingMode)&&void 0!==n?n:Hc.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(r=null==s?void 0:s.deviceId)&&void 0!==r?r:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(i=null==s?void 0:s.mirrored)&&void 0!==i?i:Hc.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(o=null==s?void 0:s.audio)&&void 0!==o?o:Hc.audio,this._videoEnabled=null!==(a=null==s?void 0:s.video)&&void 0!==a?a:Hc.video}var t=e.prototype;return t.on=function(e,t){gt.getInstance().on(e,(function(e){t(e)})),e===_e.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},t.off=function(e){gt.getInstance().off(e),e===_e.OnFrameCallback&&(this._userRequestFrameCallback=!1)},t.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},t.getFacingMode=function(){return this._facingMode},t.getCameraList=function(){return this._cameraList},t.getCameraCount=function(){return this._cameraList.length},t.getSelectedDeviceId=function(){return this._selectedDeviceId},t.setDeviceId=function(e){var t=this;return Oe((function(){return Re(this,(function(n){switch(n.label){case 0:return t._selectedDeviceId=e,t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},t.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},t.updateMediaConstraints=function(e){var t=this;return Oe((function(){var n,r,i,o,a,s;return Re(this,(function(u){switch(u.label){case 0:return Xe.isEmpty(e)?[2]:JSON.stringify(e)!==JSON.stringify(t._mediaConstraints)?(t._mediaConstraints=e,t._facingMode=null!==(n=null==e?void 0:e.facingMode)&&void 0!==n?n:t._facingMode,t._selectedDeviceId=null!==(r=null==e?void 0:e.deviceId)&&void 0!==r?r:t._selectedDeviceId,t._mirror=null!==(i=null==e?void 0:e.mirrored)&&void 0!==i?i:t._mirror,t._audioEnabled=null!==(o=null==e?void 0:e.audio)&&void 0!==o?o:t._audioEnabled,t._videoEnabled=null!==(a=null==e?void 0:e.video)&&void 0!==a?a:t._videoEnabled,t._selectedDeviceId=null!==(s=null==e?void 0:e.deviceId)&&void 0!==s?s:t._selectedDeviceId,t._hasUserMedia?[4,t.stream()]:[3,2]):[2];case 1:u.sent(),u.label=2;case 2:return[2]}}))}))()},t.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||Hc.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||Hc.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},t.selectCamera=function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._cameraList[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;if(this._facingMode==be.FRONT&&o.label.toLowerCase().includes("front")||this._facingMode==be.BACK&&o.label.toLowerCase().includes("back")){this._selectedDeviceId=o.deviceId;break}}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}},t.flip=function(){var e=this;return Oe((function(){return Re(this,(function(t){switch(t.label){case 0:return e._facingMode=e._facingMode==be.FRONT?be.BACK:be.FRONT,e._videoElement.style.transform="",e.selectCamera(),e._hasUserMedia?[4,e.stream()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))()},t.start=function(){var e=this;return Oe((function(){var t,n;return Re(this,(function(r){return t=gt.getInstance(),n=function(t){try{e._hasUserMedia&&e.stop()}catch(e){}},t.off(re.AppPaused,n),t.on(re.AppPaused,n),[2,new Promise(function(){var t=Oe((function(t,n){var r;return Re(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e.stream()];case 1:return i.sent(),gt.getInstance().emit(_e.OnStartCallback,0),t(e._selectedDeviceId),[3,3];case 2:return r=i.sent(),n(r),[3,3];case 3:return[2]}}))}));return function(e,n){return t.apply(this,arguments)}}())]}))}))()},t.info=function(){var e=this;return Oe((function(){return Re(this,(function(t){return[2,new Promise((function(t,n){navigator.mediaDevices.enumerateDevices().then((function(n){e.getVideoInputs(n),t(e._cameraList)})).catch((function(e){n(e)}))}))]}))}))()},t.stream=function(){var e=this;return Oe((function(){return Re(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=Oe((function(n){return Re(this,(function(r){switch(r.label){case 0:return[4,e.info()];case 1:return r.sent(),e.selectCamera(),e.handleUserMedia(null,n),t(e._facingMode),[2]}}))}));return function(e){return n.apply(this,arguments)}}()).catch((function(t){e.handleUserMedia(t),n(t)}))}catch(e){n(e)}}))]}))}))()},t.handleUserMedia=function(e,t){var n=this;if(!e&&t){this._stream=t;try{this._videoElement&&(this._videoElement.srcObject=t,(this._facingMode==be.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){n._userRequestFrameCallback&&n.tick()},this._videoElement.play().then((function(){n._hasUserMedia=!0})).catch((function(e){n._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},t.updateTrackEnable=function(e,t){var n=this;return Oe((function(){return Re(this,(function(r){switch(r.label){case 0:if(e===Ee.VIDEO){if(n._videoEnabled===t)return[2];n._videoEnabled=t}else{if(n._audioEnabled===t)return[2];n._audioEnabled=t}return[4,n.stream()];case 1:return r.sent(),[2]}}))}))()},t.pause=function(e){var t=this;return Oe((function(){return Re(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},t.resume=function(e){var t=this;return Oe((function(){return Re(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},t.isUsing=function(){return this._hasUserMedia},t.stop=function(){this._stop(),gt.getInstance().emit(_e.OnStopCallback,0)},t._stop=function(){e.stopMediaStream(this._stream),this._hasUserMedia=!1},t.setFacingMode=function(e){this._facingMode=e},t.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},t.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||Gc.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},t.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},t.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},t.drawFrame=function(e){var t=this._videoElement,n=e||{};if(t&&this._ctx&&this._canvasElement){var r=this._canvasElement,i=this._ctx;r.width=(null==n?void 0:n.width)||r.width,r.height=(null==n?void 0:n.height)||r.height,((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===be.FRONT)&&(i.translate(r.width,0),i.scale(-1,1)),i.drawImage(t,0,0,r.width,r.height),((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===be.FRONT)&&(i.scale(-1,1),i.translate(-r.width,0))}},e.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},e}(),Kc=qr({play:gi.function(),pause:gi.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),Jc=[qr({videoElement:Kc,mediaConstraints:gi.object({width:gi.number().min(100).optional(),height:gi.number().min(100).optional(),facingMode:gi.string().optional(),audio:gi.boolean().optional(),video:gi.boolean().optional(),deviceId:gi.string().optional(),mirrored:gi.boolean().optional()}).nullish()}).optional()];function qc(e){return un("createCameraContext",Jc,[e],(function(e){return new Vc(e.videoElement,e.mediaConstraints)}))}var Qc=function(){function e(){var t,n;et(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=Me(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;Xe.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?Xe.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?Xe.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 Yc(e){return $c.apply(this,arguments)}function $c(){return($c=Oe((function(e){return Re(this,(function(t){return[2,un("setupAd",[],[e],(function(){return Qc.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var Xc=[qr({ids:gi.union([gi.string(),gi.array(gi.string())]),config:qr({display:gi.boolean().optional(),onClose:gi.function().optional()}).optional()})];function el(e){return tl.apply(this,arguments)}function tl(){return tl=Oe((function(e){return Re(this,(function(t){return[2,un("loadAd",Xc,[e],function(){var e=Oe((function(e){return Re(this,(function(t){return Qc.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),tl.apply(this,arguments)}var nl=[qr({id:gi.string()})];function rl(e){return il.apply(this,arguments)}function il(){return il=Oe((function(e){return Re(this,(function(t){return[2,un("displayAd",nl,[e],function(){var e=Oe((function(e){return Re(this,(function(t){return Qc.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),il.apply(this,arguments)}var ol=[qr({id:gi.string().optional()}).optional()];function al(e){return sl.apply(this,arguments)}function sl(){return sl=Oe((function(e){return Re(this,(function(t){return[2,un("refreshAd",ol,[e],function(){var e=Oe((function(e){return Re(this,(function(t){return Qc.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),sl.apply(this,arguments)}var ul,cl=[qr({id:Dr(),guidingText:Dr().optional(),color:Dr().optional(),onStatusChange:gi.function().optional(),onError:gi.function().optional()}).catchall(gi.any())];function ll(e){return dl.apply(this,arguments)}function dl(){return dl=Oe((function(t){return Re(this,(function(n){return[2,un("showOAWidget",cl,[t],function(){var t=Oe((function(t){var n,r,i,o,a,s,u,c;return Re(this,(function(l){if(Ze.isMp){try{n=document.getElementById(t.id),r=t.onStatusChange,i=t.guidingText,o=t.color,a=e(t,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="ifOAW-".concat(t.id,"-").concat(Date.now()),(c=new URL(Se.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=He(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",ul,!1),ul=function(){var e=Oe((function(e){var t,n,i,o,a,s,l,d;return Re(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith(Pe)?(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,Ht.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=Ht.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},Pe),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?Bo(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",ul,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("showOAWidget",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),dl.apply(this,arguments)}var pl,fl=[gi.object({id:gi.string(),type:gi.string(),text:gi.string(),color:gi.string().optional(),disabled:gi.boolean().optional(),onDataReceived:gi.function().optional(),onError:gi.function().optional()}).catchall(gi.any())];function hl(e){return ml.apply(this,arguments)}function ml(){return ml=Oe((function(t){return Re(this,(function(n){return[2,un("showFunctionButtonWidget",fl,[t],function(){var t=Oe((function(t){var n,r,i,o,a,s,u;return Re(this,(function(c){if(Ze.isMp){try{n=document.getElementById(t.id),r=t.onDataReceived,i=t.onError,o=e(t,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="ifFBW-".concat(t.id,"-").concat(Date.now()),(u=new URL(Se.FUNCTION_BUTTON)).searchParams.set("id",s),u.searchParams.set("appId",window.APP_ID),Object.entries(o).forEach((function(e){var t=He(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=He(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.removeEventListener("message",pl,!1),pl=function(){var e=Oe((function(e){var t,n,a,c,l,d,p,f,h,m,v,g,y;return Re(this,(function(_){switch(_.label){case 0:return t=e.data,e.origin.startsWith(Pe)?(n=document.getElementById(s),a=t.type,(c=new URL(t.href)).origin!==u.origin||c.pathname!==u.pathname||t.id!==s?[3,4]:"buttonClicked"!==a?[3,3]:[4,Ht.jumpAndGetToken()]):[3,4];case 1:return _.sent(),f=null===(l=Ht.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=Ht.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,dn()];case 2:return m=_.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},Pe),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(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}},Pe)}},null==r||r.apply(void 0,Me(Object.values(v)).concat([g]))):"onError"===a&&(null==(y=t.payload)?void 0:y.type)===o.type&&(null==i||i(null==y?void 0:y.data)),_.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",pl,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("showFunctionButtonWidget",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),ml.apply(this,arguments)}var vl=function(){var e=Oe((function(e,t){var n;return Re(this,(function(r){return n={},"cccd"===e&&(n={mrz:null==t?void 0:t.mrz}),[2,new Promise((function(t,r){Wt("SCAN_NFC",{type:ue[e],data:n},{success:function(n){if("cccd"===e){var r,i,o,a,s,u,c,l,d,p,f,h,m,v,g,y,_,b,w,T,E,I={dg1:null!==(r=n.dg1)&&void 0!==r?r:"",dg2:null!==(i=n.dg2)&&void 0!==i?i:"",dg3:null!==(o=n.dg3)&&void 0!==o?o:"",dg4:null!==(a=n.dg4)&&void 0!==a?a:"",dg5:null!==(s=n.dg5)&&void 0!==s?s:"",dg6:null!==(u=n.dg6)&&void 0!==u?u:"",dg7:null!==(c=n.dg7)&&void 0!==c?c:"",dg8:null!==(l=n.dg8)&&void 0!==l?l:"",dg9:null!==(d=n.dg9)&&void 0!==d?d:"",dg10:null!==(p=n.dg10)&&void 0!==p?p:"",dg11:null!==(f=n.dg11)&&void 0!==f?f:"",dg12:null!==(h=n.dg12)&&void 0!==h?h:"",dg13:null!==(m=n.dg13)&&void 0!==m?m:"",dg14:null!==(v=n.dg14)&&void 0!==v?v:"",dg15:null!==(g=n.dg15)&&void 0!==g?g:"",dg16:null!==(y=n.dg16)&&void 0!==y?y:"",com:null!==(_=n.com)&&void 0!==_?_:"",sod:null!==(b=n.sod)&&void 0!==b?b:"",challenge:null!==(w=n.challenge)&&void 0!==w?w:"",aAResult:null!==(T=n.aAResult)&&void 0!==T?T:"",eACCAResult:null!==(E=n.eACCAResult)&&void 0!==E?E:""};t(I)}else t({})},fail:function(e){r(e)}},{timeout:!1})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),gl=[qr({type:gi.enum(["cccd"]),data:qr({mrz:Dr().max(90)})})];function yl(e){return _l.apply(this,arguments)}function _l(){return _l=Oe((function(e){return Re(this,(function(t){return[2,un("scanNFC",gl,[e],function(){var e=Oe((function(e){var t,n;return Re(this,(function(r){switch(r.label){case 0:return Ze.isMp?Mt(754,620)?[2,Promise.reject(Zt.error.clientNotSupport())]:(t=e.type,n=e.data,[4,vl(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(We("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_l.apply(this,arguments)}var bl=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){Wt("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function wl(e){return Tl.apply(this,arguments)}function Tl(){return(Tl=Oe((function(e){return Re(this,(function(t){return[2,un("checkNFC",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,bl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(We("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}var El=[gi.string().trim().min(1)];var Il=[gi.string().trim().min(1),gi.string().trim()];var Pl=[gi.string().trim().min(1)];var Sl={getItem:function(e){return un("getItem",El,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ze.isMp||Ze.isMpWeb){if(Mt(757,625))throw Zt.error.clientNotSupport();return Yi.getItem(t[0])}throw We("getItem",{})}))},setItem:function(e,t){return un("setItem",Il,[e,t],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ze.isMp||Ze.isMpWeb){if(Mt(757,625))throw Zt.error.clientNotSupport();return Yi.setItem(t[0],t[1])}throw We("setItem",{})}))},clear:function(){return un("clear",[],[],(function(){if(Ze.isMp||Ze.isMpWeb){if(Mt(757,625))throw Zt.error.clientNotSupport();return Yi.clearStorageSync()}throw We("clear",{})}))},removeItem:function(e){return un("removeItem",Pl,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ze.isMp||Ze.isMpWeb){if(Mt(757,625))throw Zt.error.clientNotSupport();return Yi.removeItem(t[0])}throw We("removeItem",{})}))},getStorageInfo:function(){return un("getStorageInfoSync",[],[],(function(){if(Ze.isMp||Ze.isMpWeb){if(Mt(757,625))throw Zt.error.clientNotSupport();return Yi.getStorageInfoSync()}throw We("getStorageInfoSync",{})}))}},Al={purchase:Mu,createOrder:Au,checkTransaction:Bu,createOrderIAP:Fu,selectPaymentMethod:Uu},Ol=Al,Cl=function(){var e=Oe((function(e,t){return Re(this,(function(n){return[2,new Promise((function(n,r){Wt("SAVE_FILE",{fileUrl:e,onProgress:t},{success:function(e){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Nl=[qr({url:gi.string().url()}).optional()];function kl(e){return Ml.apply(this,arguments)}function Ml(){return Ml=Oe((function(e){return Re(this,(function(t){return[2,un("downloadFile",Nl,[e],function(){var e=Oe((function(e){var t;return Re(this,(function(n){switch(n.label){case 0:return Ze.isMp?(t=e.url,[4,Cl(t,e.onProgress)]):[3,2];case 1:return[2,n.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("downloadFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ml.apply(this,arguments)}var Rl=gi.enum(["APP_INITIALIZING","APP_READY"]),xl=gi.any();var Dl,Ul={logEvent:function(e,t){return un("logEvent",[Rl,xl],[e,t],(function(e,t){if(Ze.isMp||Ze.isMpWeb){var n,r,i,o=Ko(Ge({},"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:d.DEV_TRACKING,eventCode:"APP_INITIALIZING"===e?p.APP_INITIALIZING:p.APP_READY}),Ot([{action:"zmp.app.lifecycle.tracking",error:0,message:"",data:Ge({eventType:e},o)}])}throw We("logEvent",{})}))}},Ll=[qr({id:Dr(),textColor:gi.string().optional(),fontSize:gi.string().optional(),buttonHeight:gi.string().optional(),buttonColor:gi.string().optional(),buttonTextColor:gi.string().optional(),buttonRadius:gi.string().optional(),buttonText:gi.string().optional(),checkboxBGColor:gi.string().optional(),checkboxCheckmarkColor:gi.string().optional(),onClick:gi.function().optional(),onStatusChange:gi.function().optional(),onError:gi.function().optional()}).catchall(gi.any())];function jl(e){return Bl.apply(this,arguments)}function Bl(){return Bl=Oe((function(t){return Re(this,(function(n){return[2,un("showCustomOAWidget",Ll,[t],function(){var t=Oe((function(t){var n,r,i,o,a,s,u,c,l,d,p,f,h,m,v,g,y,_,b,w,T;return Re(this,(function(E){if(Ze.isMp){try{n=document.getElementById(t.id),r=t.textColor,i=t.fontSize,o=t.buttonHeight,a=t.buttonColor,s=t.buttonTextColor,u=t.buttonRadius,c=t.buttonText,l=t.checkboxBGColor,d=t.checkboxCheckmarkColor,p=t.onStatusChange,f=t.onClick,h=t.onError,m=e(t,["textColor","fontSize","buttonHeight","buttonColor","buttonTextColor","buttonRadius","buttonText","checkboxBGColor","checkboxCheckmarkColor","onStatusChange","onClick","onError"]),n&&(v=document.createElement("iframe"),g="ifCOAW-".concat(t.id,"-").concat(Date.now()),y=new URL(Se.CUSTOM_OA),_={id:g,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=He(e,2),n=t[0],r=t[1];r&&(_["data-".concat(n)]=String(r))})),b=JSON.stringify(_),I=b,P=(new TextEncoder).encode(I),S=Array.from(P).map((function(e){return String.fromCharCode(e)})).join(""),w=btoa(S),T=encodeURIComponent(w),an(y.searchParams,"data",T),v.id=g,v.src=y.href,v.style.width="100%",v.style.height="100%",v.style.border="none",n.innerHTML=v.outerHTML,window.removeEventListener("message",Dl,!1),Dl=function(){var e=Oe((function(e){var t,n,r,i,o,a,s,u,c;return Re(this,(function(l){switch(l.label){case 0:return t=e.data,e.origin.startsWith(Pe)?(n=document.getElementById(g),r=t.type,(i=new URL(t.href)).origin!==y.origin||i.pathname!==y.pathname||t.id!==g?[3,3]:"followOA"!==r&&"getOAInfo"!==r?[3,2]:[4,Ht.jumpAndGetToken()]):[3,3];case 1:return l.sent(),s=null===(o=Ht.miniProgramConfig)||void 0===o?void 0:o.jwt,null==n||null===(a=n.contentWindow)||void 0===a||a.postMessage({type:r,payload:{jwt:s}},Pe),[3,3];case 2:"oaInfo"===r?null==p||p(null===(u=t.payload)||void 0===u?void 0:u.followed):"openOA"===r?Bo(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",Dl,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}var I,P,S;return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("showCustomOAWidget",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),Bl.apply(this,arguments)}var Zl,zl=[qr({id:Dr(),onMethodChange:gi.function().optional()}).catchall(gi.any())];function Wl(){return Wl=Oe((function(t){return Re(this,(function(n){return[2,un("showWidget",zl,[t],function(){var t=Oe((function(t){var n,r,i,o,a,s,u,c,l,d,p;return Re(this,(function(f){if(Ze.isMp){try{n=document.getElementById(t.id),r=t.onMethodChange,i=t.fail,o=e(t,["onMethodChange","fail"]),n&&((a=document.getElementById(Ie))&&(document.body.removeChild(a),a=null),a=document.createElement("iframe"),s=Ie,u=new URL(Se.CHECKOUT_KIT),c={id:s,appId:window.APP_ID},Object.entries(o).forEach((function(e){var t=He(e,2),n=t[0],r=t[1];r&&(c["data-".concat(n)]=r)})),l=JSON.stringify(c),d=btoa(l),p=encodeURIComponent(d),an(u.searchParams,"data",p),a.id=s,a.src=u.href,a.style.width="100%",a.style.height="100%",a.style.border="none",n.innerHTML=a.outerHTML,window.removeEventListener("message",Zl,!1),Zl=function(){var e=Oe((function(e){var t,n,o,a,c,l,d,p,f,h;return Re(this,(function(m){switch(m.label){case 0:if(t=e.data,!e.origin.startsWith(Pe))return[3,9];if(n=t.type,o=document.getElementById(s),(a=new URL(t.href)).origin!==u.origin||a.pathname!==u.pathname||t.id!==s)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 sn(o,n,{appId:window.APP_ID,zaloVersion:kt(),appPlatform:null===(c=Be())||void 0===c?void 0:c.platformName}),[3,9];case 2:return[4,Ht.jumpAndGetToken()];case 3:return m.sent(),d=null===(l=Ht.miniProgramConfig)||void 0===l?void 0:l.jwt,sn(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&&Wt(f,h,{success:function(e){sn(o,n,{status:0,actionName:f,data:e})},fail:function(e){sn(o,n,{status:-1,actionName:f,data:e})}},{}),[3,9];case 6:return null==r||r.apply(void 0,Me(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",Zl,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("showWidget",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),Wl.apply(this,arguments)}var Fl,Gl=[qr({amount:gi.union([gi.string(),gi.number()]),desc:gi.string(),payload:gi.object({}).catchall(gi.any()).optional()}).catchall(gi.any())];function Hl(){return Hl=Oe((function(t){return Re(this,(function(n){return[2,un("purchase",Gl,[t],function(){var t=Oe((function(t){return Re(this,(function(n){return Ze.isMp?[2,new Promise((function(n,r){var i=document.getElementById(Ie),o=new URL(Se.CHECKOUT_KIT);if(!(i&&Rt(i,HTMLIFrameElement)&&i.src.startsWith(o.origin)&&i.src.includes(o.pathname)))return r(We("purchase",{message:"Widget not found or not initialized."}));var a=e(t,["amount","desc","payload"]),s="purchase";sn(i,s,Ge({amount:String(t.amount),desc:t.desc,payload:t.payload||{}},a)),window.removeEventListener("message",Fl,!1),Fl=function(){var e=Oe((function(e){var t,i,a;return Re(this,(function(u){if(t=e.data,e.origin.startsWith(Pe)&&(i=t.type,(a=new URL(t.href)).origin===o.origin&&a.pathname===o.pathname&&t.id===Ie)){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",Fl,!1)}))]:Ze.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(We("purchase",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),Hl.apply(this,arguments)}var Vl={showWidget:function(e){return Wl.apply(this,arguments)},purchase:function(e){return Hl.apply(this,arguments)}};window.ZaloMiniAppSDK={getVersion:mn},cn();var Kl=Object.freeze({__proto__:null,get Events(){return re},get EventName(){return re},get CameraEvents(){return _e},AppError:Dt,login:cn,getAccessToken:dn,getVersion:mn,getSystemInfo:gn,setNavigationBarTitle:wi,setNavigationBarColor:Ii,setNavigationBarLeftButton:Ai,setStorage:Xi,getStorage:no,getStorageInfo:io,removeStorage:so,clearStorage:lo,getUserInfo:mo,getNetworkType:_o,onNetworkStatusChange:To,startBeaconDiscovery:Po,stopBeaconDiscovery:Oo,getBeacons:ko,closeApp:xo,scanQRCode:Lo,openProfile:zo,openChat:Ho,openPostFeed:Qo,followOA:ea,unfollowOA:ia,openShareSheet:ca,requestCameraPermission:pa,createShortcut:ya,openBioAuthentication:Ta,checkStateBioAuthentication:Pa,showToast:Ca,hideKeyboard:Ma,openPhone:Ua,openSMS:Za,viewOAQr:Ga,keepScreen:Ja,onKeepScreen:Qa,offKeepScreen:$a,saveImageToGallery:ns,saveVideoToGallery:as,openMiniApp:ls,vibrate:hs,openWebview:ys,getRouteParams:ws,getAppInfo:Ts,sendDataToPreviousMiniApp:Ss,getPhoneNumber:Cs,openProfilePicker:Rs,connectWifi:Ls,openMediaPicker:zs,getShareableLink:Gs,closeLoading:Ks,requestUpdateZalo:qs,onConfirmToExit:Xs,offConfirmToExit:eu,getDeviceId:tu,getDeviceIdAsync:nu,getContext:iu,getContextAsync:ou,getAuthCode:su,getZPIToken:cu,setAccessToken:pu,openOutApp:hu,chooseImage:gu,getLocation:bu,onCallbackData:Eu,createOrder:Au,purchase:Mu,selectPaymentMethod:Uu,checkTransaction:Bu,createOrderIAP:Fu,events:Ys,setAndroidBottomNavigationBar:Vu,setIOSBottomSafeArea:qu,setStatusBar:$u,configAppView:tc,minimizeApp:ic,openPermissionSetting:sc,favoriteApp:lc,openGroupList:fc,requestSendNotification:vc,addRating:_c,interactOA:Pc,interactOa:Pc,isAllowedInteractWithOA:Oc,getSetting:Nc,authorize:xc,checkZaloCameraPermission:Lc,getUserID:Bc,getIDToken:Wc,createCameraContext:qc,setupAd:Yc,loadAd:el,displayAd:rl,refreshAd:al,showOAWidget:ll,showFunctionButtonWidget:hl,scanNFC:yl,checkNFC:wl,nativeStorage:Sl,Payment:Al,CheckoutSDK:Ol,downloadFile:kl,trackingManager:Ul,showCustomOAWidget:jl,CheckoutKit:Vl,get FacingMode(){return be},get PhotoFormat(){return we},get PhotoQuality(){return Te},get StreamType(){return Ee},ZMACameraImp:Vc}),Jl=e(Kl,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]);!function(){var e,t=null===(e=Be())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,Kl))}();export{ve as AndroidBottomNavigationBarType,Dt as AppError,_e as CameraEvents,ae as ChatType,Vl as CheckoutKit,Ol as CheckoutSDK,re as EventName,re as Events,be as FacingMode,fe as IAPPayType,ge as IOSSafeAreaBottomType,ie as JumpStatus,pe as MediaPickerType,te as NetworkType,le as OrientationType,Al as Payment,we as PhotoFormat,Te as PhotoQuality,ne as PlatformType,se as PostFeedType,oe as ProfileType,he as ProrationMode,ue as ScanNFCType,ce as ShareSheetType,me as StatusBarType,Ee as StreamType,ye as TextAlignType,de as VibrateType,Vc as ZMACameraImp,_c as addRating,xc as authorize,wl as checkNFC,Pa as checkStateBioAuthentication,Bu as checkTransaction,Lc as checkZaloCameraPermission,gu as chooseImage,lo as clearStorage,xo as closeApp,Ks as closeLoading,tc as configAppView,Ls as connectWifi,qc as createCameraContext,Au as createOrder,Fu as createOrderIAP,ya as createShortcut,Jl as default,rl as displayAd,kl as downloadFile,Ys as events,lc as favoriteApp,ea as followOA,dn as getAccessToken,Ts as getAppInfo,su as getAuthCode,ko as getBeacons,iu as getContext,ou as getContextAsync,tu as getDeviceId,nu as getDeviceIdAsync,Wc as getIDToken,bu as getLocation,_o as getNetworkType,Cs as getPhoneNumber,ws as getRouteParams,Nc as getSetting,Gs as getShareableLink,no as getStorage,io as getStorageInfo,gn as getSystemInfo,Bc as getUserID,mo as getUserInfo,mn as getVersion,cu as getZPIToken,Ma as hideKeyboard,Pc as interactOA,Pc as interactOa,Oc as isAllowedInteractWithOA,Ja as keepScreen,el as loadAd,cn as login,ic as minimizeApp,Sl as nativeStorage,eu as offConfirmToExit,$a as offKeepScreen,Eu as onCallbackData,Xs as onConfirmToExit,Qa as onKeepScreen,To as onNetworkStatusChange,Ta as openBioAuthentication,Ho as openChat,fc as openGroupList,zs as openMediaPicker,ls as openMiniApp,hu as openOutApp,sc as openPermissionSetting,Ua as openPhone,Qo as openPostFeed,zo as openProfile,Rs as openProfilePicker,Za as openSMS,ca as openShareSheet,ys as openWebview,Mu as purchase,al as refreshAd,so as removeStorage,pa as requestCameraPermission,vc as requestSendNotification,qs as requestUpdateZalo,ns as saveImageToGallery,as as saveVideoToGallery,yl as scanNFC,Lo as scanQRCode,Uu as selectPaymentMethod,Ss as sendDataToPreviousMiniApp,pu as setAccessToken,Vu as setAndroidBottomNavigationBar,qu as setIOSBottomSafeArea,Ii as setNavigationBarColor,Ai as setNavigationBarLeftButton,wi as setNavigationBarTitle,$u as setStatusBar,Xi as setStorage,Yc as setupAd,jl as showCustomOAWidget,hl as showFunctionButtonWidget,ll as showOAWidget,Ca as showToast,Po as startBeaconDiscovery,Oo as stopBeaconDiscovery,Ul as trackingManager,ia as unfollowOA,hs as vibrate,Ga as viewOAQr};
|
|
10
|
+
function e(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var t,n=1048576,r=window.zAppID,i=window.APP_ID,o="https://zalo.me/s",a="https://h5.zdn.vn/zapps",s="h5.zdn.vn",u="/zapps",c={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSION:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType",UTOKEN_ZPI:"h5.zdn.vn_utoken_zpi",GTOKEN_ZPI:"h5.zdn.vn_gtoken_zpi",ZPP_ZPI:"h5.zdn.vn_zpp_zpi",ZPT_ZPI:"h5.zdn.vn_zpt_zpi"},l={GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token",GET_LIST_USER_INFO:"https://graph.zalo.me/v2.0/me/friends/list",CREATE_ORDER:"https://payment-mini.zalo.me/api/order/create",GET_APP_INFO:"https://h5.zalo.me/apps/get-info",SEND_ACTION_LOG:"https://h5.zalo.me/log/async",CREATE_SHARE_LINK:"https://h5.zalo.me/openapi/create-sharelink",CHECK_INTERACT_OA:"https://h5.zalo.me/openapi/check-interact-oa",GET_AUTH_SETTING:"https://h5.zalo.me/apis/users/auth-settings"};!function(e){e.REQUEST="REQUEST",e.MODIFIED_REQUEST="MODIFIED_REQUEST",e.RESPONSE="RESPONSE",e.MODIFIED_RESPONSE="MODIFIED_RESPONSE",e.NOT_FOUND="NOT_FOUND"}(t||(t={}));var d,p,f=0,h=-2e3,m=-1400,v=-1500,g=-1401,y=-1404,_=-1408,b=-1409,w=-2004,T=-2005,E=-2006,I=-2007,P="Success",S="Unknown error. Please try again later.",O="Request limit exceeded. Please try again later.",A="Request timeout. Please try again later.",C="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",N="Login failed",k="This API is not supported in this version of Zalo",M="User Authentication Required. Please grant User Authentication permission before requesting User Permission",R="Unable to pick media",x="Unable to save image",D="Unable to save video",U="Unable to save file",L={SUCCESS:{code:f,message:P},UNKNOWN_ERROR:{code:h,message:S},UNAUTHORIZED:{code:g,message:C},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:y,message:k},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:_,message:A},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"}},j={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:{}},B={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:L.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:L.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:L.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:L.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:L.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:L.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:L.USER_DENIED}},iOS:{"-2":{mapTo:L.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:L.USER_DENIED},"-400":{mapTo:L.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:L.USER_DENIED},"-400":{mapTo:L.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:L.UNKNOWN_ERROR},"-10":{mapTo:L.USER_CANCEL}}}},VIEW_MYQR:{haveCallback:!0,timeout:!0,requireAccessToken:!0},KEEP_SCREEN:{haveCallback:!0,timeout:2},CHANGE_AUTOROTATE:{skipJump:!0},CHECK_APP_INSTALLED:{},QUERY_SHOW:{},QUERY_HIDE:{},OPEN_INAPPRW:{},ZALORUN_GETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_SETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_GETDAYSTEP:{haveCallback:!0},ZALORUN_FORCESUBMITDATA:{haveCallback:!0},ZALORUN_SETWEIGHT:{haveCallback:!0},OPEN_PROFILE_EXT:{},DOWNLOAD_CATE:{haveCallback:!0},JUMP_LOGIN:{skipJump:!0,whiteList:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{},OPEN_ADTIMA_ADS:{},GET_ADIDCLIENT:{},SCAN_IBEACON:{},SAVE_VIDEO_GALLERY:{versionLive:{iOS:628},errorList:{android:{"-101":{mapTo:{code:E,message:D},needMoreDetail:!0},"-102":{mapTo:{code:E,message:D},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:E,message:D},needMoreDetail:!0}}}},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:T,message:x},needMoreDetail:!0},"-102":{mapTo:{code:T,message:x},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:T,message:x},needMoreDetail:!0}}}},OPEN_MP:{versionLive:{iOS:402}},CHANGE_ACTIONBAR:{haveCallback:!0,timeout:2,versionLive:{iOS:402},skipJump:!0},ZBROWSER_MPDS:{haveCallback:!0,timeout:2,versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:L.MPDS_ACTION_INVALID},"-101":{mapTo:L.UNKNOWN_ERROR},"-105":{mapTo:L.MPDS_SOURCE_INVALID},"-106":{mapTo:L.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:L.MPDS_ACTION_INVALID},"-101":{mapTo:L.MPDS_APPID_INVALID},"-102":{mapTo:L.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:L.MPDS_ACTION_INVALID},"-101":{mapTo:L.UNKNOWN_ERROR},"-105":{mapTo:L.MPDS_SOURCE_INVALID},"-106":{mapTo:L.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:L.MPDS_ACTION_INVALID},"-101":{mapTo:L.MPDS_APPID_INVALID},"-102":{mapTo:L.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:L.USER_DENIED},"-101":{mapTo:L.USER_DENIED},"-400":{mapTo:L.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:L.USER_DENIED},"-10":{mapTo:L.USER_DENIED},"-400":{mapTo:L.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:L.USER_CANCEL}},iOS:{"-101":{mapTo:L.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:L.USER_CANCEL},999:{mapTo:{code:w,message:R},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:w,message:R}}}}},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:L.USER_DENIED},"-400":{mapTo:L.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:L.USER_DENIED},"-400":{mapTo:L.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:L.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:L.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:L.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:L.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:L.UNKNOWN_ERROR},"-600":{mapTo:L.DEVICE_NOT_SUPPORT},"-602":{mapTo:L.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:L.UNKNOWN_ERROR},"-600":{mapTo:L.DEVICE_NOT_SUPPORT},"-601":{mapTo:L.SCAN_TIMEOUT},"-602":{mapTo:L.SERVICE_NOT_READY},"-603":{mapTo:L.UNREADABLE},"-604":{mapTo:L.INVALID_MRZ},"-605":{mapTo:L.PROCESSING},"-606":{mapTo:L.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:I,message:U},needMoreDetail:!0},"-102":{mapTo:{code:I,message:U},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:I,message:U},needMoreDetail:!0}}}},MP_APP_LIFECYCLE_TRACKING:{skipJump:!1}},Z={android:{"-4":L.DECODE_FAILED,"-5":L.CLIENT_NOT_SUPPORT,"-14":L.TIME_OUT},iOS:{"-9":L.DECODE_FAILED,"-5":L.CLIENT_NOT_SUPPORT,"-14":L.TIME_OUT}},z={android:12100615,iOS:460,wp:0,unknown:0},W=5*n,F="https://payment-mini.zalo.me/api/order/create-v2",G="https://payment-mini.zalo.me/api/order/iap-create",H="https://payment-mini.zalo.me/api/transaction",V="https://payment-mini.zalo.me/api/order/purchase",K="DEFERRED",J="IMMEDIATE_AND_CHARGE_FULL_PRICE",q={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},Q=5,Y=6,$="#1843EF",X=0,ee={"-12101":"Invalid params","-12102":"Session expire","-12103":"Not permission","-12104":"Not Authorize","-12105":"Unknown exception","-12106":"Cannot create order","-12107":"Transaction not found","-12108":"Cannot update order","-12109":"Cannot decode param","-12110":"Version not support","-12111":"Receipt expire","-12112":"Product not found","-12113":"Subscription other GW","-12114":"Product already subcription","-12115":"Not exist","-12116":"Already exist","-12117":"Not allow","-12118":"Not permit","-12119":"Internal error","-2":"Unable to pay","-6":"Unable to register","-7":"Registered account","-832":"Purchased by another account","-833":"Register for another account","-834":"Unable to register","-2010":"System is maintaining","-3999":"Not in Vietnam","-12129":"Purchased by another account",123:"An error has occurred"};!function(e){e.DEV_TRACKING="devTracking"}(d||(d={})),function(e){e[e.APP_INITIALIZING=95]="APP_INITIALIZING",e[e.APP_READY=96]="APP_READY"}(p||(p={}));var te,ne,re,ie,oe,ae,se,ue,ce,le,de,pe,fe,he,me,ve,ge,ye,_e,be,we,Te,Ee,Ie,Pe="checkoutKitWidget-ifCKW",Se="https://h5.zalo.me",Oe={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"};function Ae(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 Ce(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ae(o,r,i,a,s,"next",e)}function s(e){Ae(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Ne(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 ke(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Me(e,t){if(e){if("string"==typeof e)return Ne(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)?Ne(e,t):void 0}}function Re(e){return function(e){if(Array.isArray(e))return Ne(e)}(e)||ke(e)||Me(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 xe(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 De(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 Ue(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,Re(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Le(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(s)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(u)),isMpWeb:window.location.hostname.includes("localhost")}}Ue.async=function(e){return Ce((function(){var t,n,r,i,o=arguments;return xe(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,Re(n))];case 2:return[2,a.sent()];case 3:return i=a.sent(),"undefined"!=typeof console&&console.error&&console.error(i),[2,null];case 4:return[2]}}))}))},function(e){e.none="none",e.wifi="wifi",e.cellular="cellular",e.unknown="unknown"}(te||(te={})),function(e){e.wp="wp",e.android="android",e.iOS="iOS",e.unknown="unknown"}(ne||(ne={})),function(e){e.AppPaused="h5.event.paused",e.AppResumed="h5.event.resumed",e.NetworkChanged="h5.event.connection.changed",e.OnDataCallback="h5.event.webview.result",e.WebviewClosed="h5.event.webview.close",e.OpenApp="h5.event.open.mp",e.AppClose="h5.event.action.close",e.PaymentCallback="payment.callback",e.PaymentResult="action.payment.result",e.PaymentDone="action.payment.done",e.PaymentClose="action.payment.close",e.DownloadProgress="h5.event.webview.download.progress"}(re||(re={})),function(e){e.DOING="doing",e.DONE="done"}(ie||(ie={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa",e[e.aliasOA=2]="aliasOA"}(oe||(oe={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa"}(ae||(ae={})),function(e){e[e.image=1]="image",e[e.multi_image=2]="multi_image",e[e.link=4]="link",e[e.profile=5]="profile"}(se||(se={})),function(e){e[e.cccd=1]="cccd"}(ue||(ue={})),function(e){e[e.image=1]="image",e[e.gif=11]="gif",e[e.video=12]="video",e[e.link=4]="link",e[e.oa=5]="oa",e[e.zmp=20]="zmp",e[e.multi_image=21]="multi_image",e[e.zmp_deep_link=4]="zmp_deep_link",e[e.text=22]="text"}(ce||(ce={})),function(e){e[e.auto=1]="auto",e[e.portrait=2]="portrait",e[e.landscape=3]="landscape"}(le||(le={})),function(e){e[e.oneShot=0]="oneShot"}(de||(de={})),function(e){e[e.zcamera=3]="zcamera",e[e.zcamera_photo=1]="zcamera_photo",e[e.zcamera_video=2]="zcamera_video",e[e.zcamera_scan=7]="zcamera_scan",e[e.photo=4]="photo",e[e.video=5]="video",e[e.file=6]="file"}(pe||(pe={})),function(e){e.SUBSCRIPTION="SUBSCRIPTION",e.ONETIME="ONETIME"}(fe||(fe={})),function(e){e[e.UNKNOW=0]="UNKNOW",e[e.DEFERRED=1]="DEFERRED",e[e.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE"}(he||(he={})),function(e){e[e.normal=1]="normal",e[e.hidden=0]="hidden",e[e.transparent=2]="transparent"}(me||(me={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(ve||(ve={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(ge||(ge={})),function(e){e[e.left=0]="left",e[e.center=1]="center"}(ye||(ye={})),function(e){e.TOOL_DEL_FRIEND="tool_del_friend"}(_e||(_e={})),function(e){e.OnFrameCallback="h5.event.camera.frame",e.OnStartCallback="h5.event.camera.start",e.OnStopCallback="h5.event.camera.stop"}(be||(be={})),function(e){e.FRONT="user",e.BACK="environment"}(we||(we={})),function(e){e.WEBP="image/webp",e.PNG="image/png",e.JPEG="image/jpeg"}(Te||(Te={})),function(e){e.HIGH="high",e.NORMAL="normal",e.LOW="low"}(Ee||(Ee={})),function(e){e.VIDEO="video",e.AUDIO="audio"}(Ie||(Ie={}));var je,Be=function(e){return e.isAndroid?ne.android:e.isIOS?ne.iOS:ne.unknown};function Ze(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function ze(){var e=function(){var e=Ue((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:Le(),platform:t,platformName:Be(t),zaloVersion:Ze(e).trim()}}}();if(e)return e}var We=(null===(je=ze())||void 0===je?void 0:je.appEnv)||{};function Fe(e){Fe.on&&Fe.engine(e)}Fe.on=!1,Fe.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 Ge=function(e,n){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==n||null===(r=n.fail)||void 0===r||r.call(n,i),Fe({stage:t.NOT_FOUND,type:"error",name:e,request:n,state:"fail",response:i})};function He(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ve(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){He(e,t,n[t])}))}return e}function Ke(e,t){return function(e){if(Array.isArray(e))return e}(e)||ke(e)||Me(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.")}()}function Je(e){return e&&e.constructor===Symbol?"symbol":typeof e}function qe(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]}}var Qe=Object.prototype.toString;var Ye="[object Null]",$e="[object Undefined]";function Xe(e){return null==e?void 0===e?$e:Ye:function(e){return Qe.call(e)}(e)}function et(e){return null!=e&&"object"==typeof e}var tt={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||et(e)&&"[object Number]"==Xe(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return et(e)&&"[object RegExp]"==Xe(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 nt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function it(e){return it=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},it(e)}function ot(e){return it(e)}function at(e,t,n){return at="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=ot(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},at(e,t,n)}function st(e,t,n){return at(e,t,n)}function ut(e,t){return ut=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ut(e,t)}function ct(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ut(e,t)}function lt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dt(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=ot(e);if(t){var i=ot(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==Je(t)&&"function"!=typeof t?lt(e):t}(this,n)}}var pt,ft,ht=(pt=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},pt(ft={exports:{}},ft.exports),ft.exports),mt={enablePaymentDone:!1};function vt(e){var t=e.data;return{orderId:t.zmpOrderId||t.orderId,transId:t.appTransID||t.apptransid||t.transId}}var gt="ACTION_CALLBACK";function yt(e,t,n,r){switch(!0){case"string"==typeof n||null===n:return[{eventName:e,eventId:t,data:n}];case e===re.OpenApp&&(null==r?void 0:r.enablePaymentDone):var i=function(e){var t=new URL(e,window.location.origin),n=t.pathname.split("/")[3].toUpperCase().replace(/-/g,"_"),r={},i=t.searchParams.get("orderId"),o=t.searchParams.get("zmpOrderId"),a=t.searchParams.get("appTransID")||t.searchParams.get("apptransid");switch(n){case"MOMO":case"MOMO_SANDBOX":r.orderId=o,r.transId=i;break;default:r.orderId=o||i,r.transId=a}return r}(n.path);return[{eventName:re.PaymentDone,eventId:t,data:i}];case e===re.OnDataCallback:if(["PAY_BY_BANK","PAY_BY_CUSTOM_METHOD"].includes(null==n?void 0:n.eventType))return[{eventName:re.OnDataCallback,eventId:t,data:n},{eventName:re.PaymentDone,eventId:t,data:vt(n)}];break;default:return[{eventName:e,eventId:t,data:n}]}}var _t=function(e){ct(n,e);var t=dt(n);function n(){var e;return nt(this,n),(e=t.apply(this,arguments)).debug=qe("zmp:event-emitter"),e}var r=n.prototype;return r.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},r.on=function(e,t,r){var i=this;if(e===gt||e===re.PaymentCallback)return st(ot(n.prototype),"on",this).call(this,e,t,r);this.debug("register ".concat(String(e),": ").concat(r));return st(ot(n.prototype),"on",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},r.once=function(e,t,r){var i=this;if(e===gt)return st(ot(n.prototype),"once",this).call(this,e,t,r);this.debug("register once ".concat(String(e),": ").concat(r));return st(ot(n.prototype),"once",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},n}(ht);function bt(e){_t.getInstance().emit(gt,e)}function wt(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){bt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){var r=qe("zmp:zalo_h5_event_handler");r("eventId: ".concat(e,", eventName: ").concat(t,", eventData: ").concat(n));var o=Yt(n);r("stringToData",o);var a=function(e,t){if(!t||"string"==typeof t)return t;try{if(e===re.OpenApp){var n=t.url,r=new URL(n),o=r.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(o||"/").concat(r.search)}}return t}catch(e){return t}}(t,o),s=yt(t,e,a,mt);null==s||s.forEach((function(e){_t.getInstance().emit(e.eventName,e.eventId,e.data);var t=document.getElementById(Pe);t&&cn(t,"appEvent",{eventName:e.eventName,eventId:e.eventId,data:e.data})}))}},window.zaloNative2JS={nativeCall:function(e,t,n){_t.getInstance().emit(re.PaymentCallback,e,t,n)}};var Tt={encode:wt,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:wt(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":Je(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":Je(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Et={},It=function(e,t,n){var r=t||"default";return function(){return(r in Et?Et[r](e,n):e).apply(this,arguments)}};It.setWrapper=function(e){Et[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Pt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function St(e){try{return null===e?Pt:JSON.parse(e)}catch(e){return Pt}}var Ot,At={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Tt.encode(n);"post"!=t&&(e=Tt.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=It((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=It((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(St(e.responseText))},o.onerror=function(e){e.responseText?r(St(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Ct=(Ot=Ce((function(e,t,n){var r,i,o,a;return xe(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},tt.isUndefined(n)||(r.currentVersion=n),i=Tt.appendToUrl(l.GET_APP_INFO,r),[4,fetch(i,{credentials:"include"})];case 1:return(o=s.sent()).ok?[4,o.json()]:[3,3];case 2:if((a=s.sent()).err<0||!a.data)throw new Error(a);return[2,{name:a.data.name,version:a.data.version,description:a.data.description,appUrl:a.data.appUrl,qrCodeUrl:a.data.qrCodeUrl,logoUrl:a.data.logoUrl,cateID:a.data.cateType}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return Ot.apply(this,arguments)});function Nt(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));At.execute(l.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var kt=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Mt=function(){var e;return"android"===((null===(e=ze())||void 0===e?void 0:e.platformName)||"").toLowerCase()};var Rt=function(){var e=0;if(window.zaloVersionCode)e=window.zaloVersionCode;else{var t,n=Number((null===(t=ze())||void 0===t?void 0:t.zaloVersion)||"0");if(n>=24112e3)e=n;else{var r,i=((null===(r=ze())||void 0===r?void 0:r.platformName)||"").toLowerCase();"android"===i?e=n%1e4:"ios"===i&&(e=n)}}return function(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)}(e)},xt=function(e,t){var n=Rt();return Mt()&&n<e||function(){var e;return"ios"===((null===(e=ze())||void 0===e?void 0:e.platformName)||"").toLowerCase()}()&&n<t};function Dt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Ut,Lt=function(){function e(t,n,r,i){nt(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}(),jt=function(e,t){return Dt(e,Lt)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Dt(e,Error)?new Lt(h,e.message,t).toJSON():tt.isEmpty(null==e?void 0:e.message)||tt.isEmpty(null==e?void 0:e.code)?new Lt(h,S,t,e).toJSON():new Lt(e.code,e.message,t,e.detail).toJSON()}(e,t)},Bt=(Ut=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(l.GET_AUTH_SETTING,Ve({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Ut.apply(this,arguments)}),Zt=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n,r,i,o;return xe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,Kt.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=Kt.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new Lt(g,C,"getSetting")),[4,Bt(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new Lt(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)}}())]}))})),zt=function(){var e,t,n,r=ze(),i={},o=_t.getInstance(),a=[],s=!1;return s||(t=function(e){var t=e.serialId,n=$t(e.result),r=nn(null==n?void 0:n.action),s=tt.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,u=null==n?void 0:n.error_message,c=(null==n?void 0:n.data)||n;if(r&&0===s){var l=JSON.parse(null==n?void 0:n.data);s=tt.isEmpty(null==l?void 0:l.error_code)?0:null==l?void 0:l.error_code,u=null==l?void 0:l.error_message,c=(null==l?void 0:l.data)||l}var d={error_code:s,error_message:u,data:c,action:(null==n?void 0:n.action)||e.actionName};if(t&&i[t]){var p=i[t],f=p.callback,h=p.timeout,m=p.isMultiCallback,v=p.options,g=p.downloadListener;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?tt.isFunction(r)&&r(e):tt.isFunction(i)&&i(e)}(d,f),!m&&delete i[t],h&&clearTimeout(h);var y={action:null==d?void 0:d.action,error:null==d?void 0:d.error_code,message:null==d?void 0:d.error_message,data:{}};try{if("action.open.inapp"===d.action||"action.open.outapp"===d.action){var _=new URL(null==v?void 0:v.url),b="".concat(_.protocol,"//").concat(_.host).concat(_.pathname);y.data={url:b}}if("action.follow.oa"===d.action||"action.unfollow.oa"===d.action){var w=null==v?void 0:v.uid;y.data={uid:w}}if("action.open.chat"===d.action){var T=null==v?void 0:v.uId,E=null==v?void 0:v.type;y.data={uid:T,openChatType:E}}(null==v?void 0:v.onProgress)&&g&&o.off(re.DownloadProgress,g)}catch(e){}a.push(y)}},_t.getInstance().on(gt,t),o.on(re.AppPaused,(function(){if(a.length>0){var e=a;a=[],Nt(e)}})),e?clearInterval(e):e=setInterval((function(){if(a.length>0){var e=a;a=[],Nt(e)}}),5e3),s=!0),n=Ce((function(e,t,n,a){var s,u,c,l,d,p,f,h,m,v,b,w,T,E,I,P,S,O,C,N,R,x,D;return xe(this,(function(U){switch(U.label){case 0:return u=Math.floor(1e6*Math.random()),c="".concat(e,"_").concat(u),l=sn(e),(null==a?void 0:a.actionName)&&a.actionName.length>0&&(l=null==a?void 0:a.actionName),d=(null==a?void 0:a.isMultiCallback)||!1,p=!1!==(null==a?void 0:a.timeout)&&((null==a?void 0:a.timeout)||!0),f=(null==a?void 0:a.haveCallback)||!1,h=(null==a?void 0:a.skipJump)||!1,m=(null==a?void 0:a.requireAccessToken)||!1,v=rn(l),t&&n&&(i[c]={options:t,callback:n,isMultiCallback:d},p&&f&&(i[c].timeout=setTimeout((function(){return bt({serialId:c,result:{error_code:_,error_message:A,data:{timeout:p},action:e}}),null}),!0===p?8e3:1e3*p))),v?[4,Zt()]:[3,2];case 1:if(!1===(null==(w=U.sent())||null===(b=w.authSetting)||void 0===b?void 0:b["scope.userInfo"]))return bt({serialId:c,result:{error_code:g,error_message:M,data:{isMobile:null==r||null===(T=r.platform)||void 0===T?void 0:T.isMobile},action:e}}),[2];U.label=2;case 2:return E=nn(l),!(null==r||null===(s=r.platform)||void 0===s?void 0:s.isMobile)||!e||tt.isUndefined(ZaloJavaScriptInterface)||r.platform.isIOS&&!Qt(e)||E&&!1===E.isSupported?(bt({serialId:c,result:{error_code:y,error_message:k,data:{isMobile:null==r||null===(I=r.platform)||void 0===I?void 0:I.isMobile},action:e}}),[2]):(P=qt(t),h?[3,4]:[4,Kt.getJSAccessToken()]);case 3:return O=U.sent(),[3,5];case 4:O="",U.label=5;case 5:S=O,U.label=6;case 6:return U.trys.push([6,10,,11]),h||!m?[3,8]:[4,Kt.getAccessToken()];case 7:return N=U.sent(),[3,9];case 8:N="",U.label=9;case 9:return C=N,[3,11];case 10:return R=U.sent(),bt({serialId:c,result:{error_code:null==R?void 0:R.code,error_message:null==R?void 0:R.message,action:e}}),[2];case 11:try{t&&(null==t?void 0:t.onProgress)&&(x=function(e){!function(e,t){var n=e.progress;t&&t(n)}(e,null==t?void 0:t.onProgress)},i[c].downloadListener=x,o.on(re.DownloadProgress,x))}catch(e){}return D=r.platform.isIOS?window.onNativeMessage(c,l):'window.onNativeMessage("'.concat(c,'", "').concat(l,'")'),[2,ZaloJavaScriptInterface.jsCall(S,l,C,P,D)]}}))})),function(e,t,r,i){return n.apply(this,arguments)}}(),Wt={success:function(e,t){return{code:f,message:t||P,data:e||{}}},error:{failLimit:function(){return new Lt(b,O)},badRequest:function(e){return new Lt(m,e)},loginFailed:function(e){return new Lt(g,"".concat(N,": ").concat(e))},loginRequired:function(){return new Lt(g,C)},cannotGetShareInfo:function(){return new Lt(v,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(ee).find((function(t){return t===e.toString()}));return new Lt(e,t||S)},clientNotSupport:function(){return new Lt(y,k)}}},Ft=function(e){var t,n,r,i=null===(t=ze())||void 0===t?void 0:t.platformName,o=an(e.action),a=B[o],s=(null==a?void 0:a.skipJump)||!1,u=(null==a?void 0:a.errorList)||{};if("JUMP_LOGIN"===o)return new Lt(h,"Can not get auth code: ".concat(e.error_message));if(Kt.jumpStatus!==ie.DONE&&!s)return new Lt(L.UNAUTHORIZED.code,L.UNAUTHORIZED.message);if("permission required!"===String(e.error_message).toLowerCase()||"no permission!"===String(e.error_message).toLowerCase())return new Lt(L.FORBIDDEN.code,L.FORBIDDEN.message);if(i&&(null===(n=Z[i])||void 0===n?void 0:n[e.error_code]))return new Lt(Z[i][e.error_code].code,Z[i][e.error_code].message);var c=null==u||null===(r=u[i])||void 0===r?void 0:r[String(e.error_code)];if(c){var l,d,p,f=null===(l=c.mapTo)||void 0===l?void 0:l.message;if(null==c?void 0:c.needMoreDetail)f="".concat(null==c||null===(p=c.mapTo)||void 0===p?void 0:p.message,": ").concat(e.error_message);return new Lt(null===(d=c.mapTo)||void 0===d?void 0:d.code,f)}return new Lt(e.error_code,e.error_message)},Gt=function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=tt.isEmpty(n)?void 0:n[r];if(o)return Fe({stage:t.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Ft(i):null==i?void 0:i.data)}}return tt.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=B[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){zt(e,n,o,Ve({},i,a))}),s)},Ht=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){Gt("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){tt.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Vt=function(){function e(){nt(this,e),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={},this.retryLimitMap={}}var n,o,s,u=e.prototype;return u.initRetryLimit=function(e){var t=j[e],n={lastCall:(new Date).getTime(),limit:t&&t.limit?t.limit:3,retry:0};return this.retryLimitMap[e]=n,n},u.resetRetryLimit=function(e){this.retryLimitMap[e].lastCall=(new Date).getTime(),this.retryLimitMap[e].retry=0},u.getRetryLimit=function(e){var t=this.retryLimitMap[e];return t&&t.lastCall&&t.retry||(t=this.initRetryLimit(e)),t},u.increaseRetryLimit=function(e){this.retryLimitMap[e].retry++},u.jump=function(){var e=this;return Ce((function(){return xe(this,(function(n){return[2,new Promise((function(n,r){e._jumpStatus?e._jumpStatus===ie.DONE?n(ie.DONE):n(ie.DOING):(e._jumpStatus=ie.DOING,Fe({stage:t.REQUEST,type:"log",name:"jump"}),zt("JUMP_LOGIN",{},{success:function(t){var r=t.data;e._miniProgramConfig=(null==r?void 0:r.miniProgramConfig)||{};var i=(null==r?void 0:r.cookiesOAuthLogins)||[],o=i.find((function(e){return e.name===c.JS_TOKEN}));o&&(e._jsAccessToken=o.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(o.value)),e._cookies=i;var a=e._cookies.find((function(e){return e.name===c.ZOAUTH}));(null==a?void 0:a.value)||Nt([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),n(ie.DONE)},fail:function(e){Nt([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),r(e)}},{skipJump:!0}))}))]}))}))()},u.loginZaloV3=function(e,t,n){var r=this;return Ce((function(){var i;return xe(this,(function(o){switch(o.label){case 0:return i="".concat(l.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(a,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=Ce((function(e){var t,n,i;return xe(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return t=o.sent(),n=null==t?void 0:t.access_token,r._accessToken=n,i=1e3*parseInt(t.expires_in),r.accessTokenExpiresIn=i,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(r._accessToken||""),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,o.sent()]}}))}))()},u.loginZaloV4=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this;return Ce((function(){var i,o;return xe(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),tt.isNull(r.refreshToken)||0===r.refreshToken.length?i.append("grant_type","authorization_code"):(i.append("grant_type","refresh_token"),i.append("refresh_token",r.refreshToken||"")),o={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.GET_ACCESS_TOKEN,Ve({method:"POST",body:i},o)).then(function(){var e=Ce((function(e){var t,n,i,o;return xe(this,(function(a){switch(a.label){case 0:return[4,e.json()];case 1:return t=a.sent(),n=(null==t?void 0:t.access_token)||"",i=(null==t?void 0:t.refresh_token)||"",r.refreshToken=i,r._accessToken=n,o=1e3*parseInt(null==t?void 0:t.expires_in),r.accessTokenExpiresIn=o,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,a.sent()]}}))}))()},u.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return Ce((function(){var n,o,a,s,u,l,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(o.getAccessTokenCount<=1||o._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return xe(this,(function(m){switch(m.label){case 0:return n=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(o=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken?(o.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?(o.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(c.ZOAUTH)]);case 6:return u=m.sent(),[4,t.jumpAndGetToken(c.ZOAUTH_VRF)];case 7:if(l=m.sent(),d="zmp.getaccesstoken.fail",!a)throw o.getAccessTokenCount--,Nt([{action:d,error:-104,message:"no user auth",data:{}}]),Wt.error.loginFailed("User Authentication Required");if(!u)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),l?[4,t.loginZaloV4(i,u,l)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(i,r,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),Nt([{action:d,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return o.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(Nt([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(Wt.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw o.getAccessTokenCount--,Nt([{action:d,error:-102,message:"no oauth",data:{}}]),Wt.error.loginFailed("Zalo app has not been activated")}}))}))()},u.verifyUserAuthorized=function(){var e=this;return Ce((function(){var t,n,r,i,o,a;return xe(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=nn("action.mp.user.authorize"))&&r.isSupported?[4,Zt()]:[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,Ht()];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]}}))}))()},u.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},u.getJSAccessToken=function(){var e=this;return Ce((function(){var t;return xe(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(c.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},u.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},u.jumpAndGetToken=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;return new Promise(function(){var r=Ce((function(r){var i,o,a,s;return xe(this,(function(u){switch(u.label){case 0:return!t&&n._cookies.length>0?tt.isString(e)?(i=n._cookies.find((function(t){return t.name===e})),[2,r(null==i?void 0:i.value)]):[2,r("")]:(t&&n._jumpStatus===ie.DONE&&(n._jumpStatus=void 0),o={name:e,cb:function(e){return r(e)}},[4,n.jump()]);case 1:return(a=u.sent())===ie.DONE?(n._jumpStatus=a,n.WAITING_QUEUE.length&&(n.WAITING_QUEUE.forEach((function(e){var t=n._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),n.WAITING_QUEUE=[]),s=n._cookies.find((function(e){return e.name===o.name})),o.cb(null==s?void 0:s.value)):n.WAITING_QUEUE.push(o),[2]}}))}));return function(e){return r.apply(this,arguments)}}())},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},n=e,(o=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&rt(n.prototype,o),s&&rt(n,s),e}(),Kt=Vt.getInstance(),Jt=qe("zmp:utils:common"),qt=function(e){if(tt.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(qt(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+qt(e[i]));return"{"+t.join(",")+"}"}return e.toString()},Qt=function(e){var t=B[e],n=Rt(),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},Yt=function(e){try{if(e){Jt(e);var t=e.replace(/\\/g,"").replace(/'/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}var n=JSON.parse(t);return Jt("formattedValue",t,n,void 0===n?"undefined":Je(n)),n}return null}catch(t){return Jt("parse json error:",t),e}},$t=function(e){if(tt.isObject(JSON)&&JSON.parse&&tt.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 tt.isObject(e)?e:new Function("return "+e)()},Xt=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""},en=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var tn=function(e){return"hidden"===e?me.hidden:"transparent"===e?me.transparent:me.normal},nn=function(e){if(void 0!==e){var t=Kt.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},rn=function(e){if(void 0===e)return!1;var t=Kt.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},on=function(){var e=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n;return xe(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Kt.jumpAndGetToken()];case 1:return t.sent(),n=Kt.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)}}(),an=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},sn=function(e){return e.startsWith("action.")?e:"action.".concat(e.replace(/\_/g,".").toLowerCase())},un=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=Ke(n,2),i=r[0],o=r[1];null!=o&&""!==o&&e.set("".concat(t).concat(i),String(o))}))},cn=function(e,t,n){var r;null===(r=e.contentWindow)||void 0===r||r.postMessage({type:t,payload:n},Se)};function ln(e,t,n,r){var i,o;!function(e,t){if(j[e]){var n=Kt.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&Kt.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw jt(Wt.error.failLimit(),e);Kt.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=Wt.error.badRequest(s);throw c.detail=a,jt(c,e)}u.push(i.data)}));var c=r.apply(void 0,Re(u));return tt.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!tt.isNull(a)&&tt.isFunction(a))return a(e);t(c)})).catch((function(t){var r=jt(t,e);if(!tt.isNull(s)&&tt.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!tt.isNull(s)&&tt.isFunction(s))return s(t);throw jt(t,e)}}function dn(e){return pn.apply(this,arguments)}function pn(){return(pn=Ce((function(e){return xe(this,(function(t){return[2,ln("login",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Kt.jumpAndGetToken(c.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return We.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ge("login",{}))]}}))})))]}))}))).apply(this,arguments)}function fn(e){return hn.apply(this,arguments)}function hn(){return(hn=Ce((function(e){return xe(this,(function(t){return[2,ln("getAccessToken",[],[e],Ce((function(){var e;return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,on()]:[3,3];case 1:return e=!t.sent(),[4,Kt.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return We.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ge("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var mn,vn="2.47.1";function gn(){return ln("getVersion",[],[],(function(){return vn}))}function yn(){var e;return{version:Xt("version-id")||"",apiVersion:vn,zaloVersion:String(Rt()),platform:(null===(e=ze())||void 0===e?void 0:e.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function _n(){return ln("getSystemInfo",[],[],(function(){return yn()}))}!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}(mn||(mn={}));const bn=mn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wn=e=>{switch(typeof e){case"undefined":return bn.undefined;case"string":return bn.string;case"number":return isNaN(e)?bn.nan:bn.number;case"boolean":return bn.boolean;case"function":return bn.function;case"bigint":return bn.bigint;case"symbol":return bn.symbol;case"object":return Array.isArray(e)?bn.array:null===e?bn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?bn.promise:"undefined"!=typeof Map&&e instanceof Map?bn.map:"undefined"!=typeof Set&&e instanceof Set?bn.set:"undefined"!=typeof Date&&e instanceof Date?bn.date:bn.object;default:return bn.unknown}},Tn=mn.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 En 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,mn.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()}}En.create=e=>new En(e);const In=(e,t)=>{let n;switch(e.code){case Tn.invalid_type:n=e.received===bn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Tn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,mn.jsonStringifyReplacer)}`;break;case Tn.unrecognized_keys:n=`Unrecognized key(s) in object: ${mn.joinValues(e.keys,", ")}`;break;case Tn.invalid_union:n="Invalid input";break;case Tn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${mn.joinValues(e.options)}`;break;case Tn.invalid_enum_value:n=`Invalid enum value. Expected ${mn.joinValues(e.options)}, received '${e.received}'`;break;case Tn.invalid_arguments:n="Invalid function arguments";break;case Tn.invalid_return_type:n="Invalid function return type";break;case Tn.invalid_date:n="Invalid date";break;case Tn.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}"`:mn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Tn.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 Tn.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 Tn.custom:n="Invalid input";break;case Tn.invalid_intersection_types:n="Intersection results could not be merged";break;case Tn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Tn.not_finite:n="Number must be finite";break;default:n=t.defaultError,mn.assertNever(e)}return{message:n}};let Pn=In;function Sn(){return Pn}const On=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 An(e,t){const n=On({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Sn(),In].filter((e=>!!e))});e.common.issues.push(n)}class Cn{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 Nn;"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 Cn.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 Nn;if("aborted"===i.status)return Nn;"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 Nn=Object.freeze({status:"aborted"}),kn=e=>({status:"dirty",value:e}),Mn=e=>({status:"valid",value:e}),Rn=e=>"aborted"===e.status,xn=e=>"dirty"===e.status,Dn=e=>"valid"===e.status,Un=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Ln;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Ln||(Ln={}));class jn{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 Bn=(e,t)=>{if(Dn(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 En(e.common.issues)}};function Zn(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 zn{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 wn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:wn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Cn,ctx:{common:e.parent.common,data:e.data,parsedType:wn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Un(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:wn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Bn(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:wn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Un(r)?r:Promise.resolve(r));return Bn(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:Tn.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 Pr({schema:this,typeName:Ur.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Sr.create(this,this._def)}nullable(){return Or.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return or.create(this,this._def)}promise(){return Ir.create(this,this._def)}or(e){return cr.create([this,e],this._def)}and(e){return fr.create(this,e,this._def)}transform(e){return new Pr({...Zn(this._def),schema:this,typeName:Ur.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ar({...Zn(this._def),innerType:this,defaultValue:t,typeName:Ur.ZodDefault})}brand(){return new Mr({typeName:Ur.ZodBranded,type:this,...Zn(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Cr({...Zn(this._def),innerType:this,catchValue:t,typeName:Ur.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Rr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Wn=/^c[^\s-]{8,}$/i,Fn=/^[a-z][a-z0-9]*$/,Gn=/^([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,Hn=/^(([^<>()[\]\\.,;:\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 Vn extends zn{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Tn.invalid_string,...Ln.errToObj(n)}),this.nonempty=e=>this.min(1,Ln.errToObj(e)),this.trim=()=>new Vn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==bn.string){const t=this._getOrReturnCtx(e);return An(t,{code:Tn.invalid_type,expected:bn.string,received:t.parsedType}),Nn}const t=new Cn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),An(n,{code:Tn.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),An(n,{code:Tn.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?An(n,{code:Tn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&An(n,{code:Tn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)Hn.test(e.data)||(n=this._getOrReturnCtx(e,n),An(n,{validation:"email",code:Tn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Gn.test(e.data)||(n=this._getOrReturnCtx(e,n),An(n,{validation:"uuid",code:Tn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Wn.test(e.data)||(n=this._getOrReturnCtx(e,n),An(n,{validation:"cuid",code:Tn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Fn.test(e.data)||(n=this._getOrReturnCtx(e,n),An(n,{validation:"cuid2",code:Tn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),An(n,{validation:"url",code:Tn.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),An(n,{validation:"regex",code:Tn.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),An(n,{code:Tn.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),An(n,{code:Tn.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),An(n,{code:Tn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else mn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new Vn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ln.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ln.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ln.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ln.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ln.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,...Ln.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ln.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ln.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ln.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ln.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ln.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ln.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 Kn(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)}Vn.create=e=>{var t;return new Vn({checks:[],typeName:Ur.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Zn(e)})};class Jn extends zn{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)!==bn.number){const t=this._getOrReturnCtx(e);return An(t,{code:Tn.invalid_type,expected:bn.number,received:t.parsedType}),Nn}let t;const n=new Cn;for(const r of this._def.checks)if("int"===r.kind)mn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),An(t,{code:Tn.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),An(t,{code:Tn.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),An(t,{code:Tn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==Kn(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),An(t,{code:Tn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),An(t,{code:Tn.not_finite,message:r.message}),n.dirty()):mn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ln.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ln.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ln.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ln.toString(t))}setLimit(e,t,n,r){return new Jn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ln.toString(r)}]})}_addCheck(e){return new Jn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ln.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ln.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ln.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ln.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ln.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ln.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ln.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&&mn.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)}}Jn.create=e=>new Jn({checks:[],typeName:Ur.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...Zn(e)});class qn extends zn{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==bn.bigint){const t=this._getOrReturnCtx(e);return An(t,{code:Tn.invalid_type,expected:bn.bigint,received:t.parsedType}),Nn}return Mn(e.data)}}qn.create=e=>{var t;return new qn({typeName:Ur.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Zn(e)})};class Qn extends zn{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==bn.boolean){const t=this._getOrReturnCtx(e);return An(t,{code:Tn.invalid_type,expected:bn.boolean,received:t.parsedType}),Nn}return Mn(e.data)}}Qn.create=e=>new Qn({typeName:Ur.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...Zn(e)});class Yn extends zn{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==bn.date){const t=this._getOrReturnCtx(e);return An(t,{code:Tn.invalid_type,expected:bn.date,received:t.parsedType}),Nn}if(isNaN(e.data.getTime())){return An(this._getOrReturnCtx(e),{code:Tn.invalid_date}),Nn}const t=new Cn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),An(n,{code:Tn.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),An(n,{code:Tn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):mn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Yn({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ln.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ln.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}}Yn.create=e=>new Yn({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ur.ZodDate,...Zn(e)});class $n extends zn{_parse(e){if(this._getType(e)!==bn.symbol){const t=this._getOrReturnCtx(e);return An(t,{code:Tn.invalid_type,expected:bn.symbol,received:t.parsedType}),Nn}return Mn(e.data)}}$n.create=e=>new $n({typeName:Ur.ZodSymbol,...Zn(e)});class Xn extends zn{_parse(e){if(this._getType(e)!==bn.undefined){const t=this._getOrReturnCtx(e);return An(t,{code:Tn.invalid_type,expected:bn.undefined,received:t.parsedType}),Nn}return Mn(e.data)}}Xn.create=e=>new Xn({typeName:Ur.ZodUndefined,...Zn(e)});class er extends zn{_parse(e){if(this._getType(e)!==bn.null){const t=this._getOrReturnCtx(e);return An(t,{code:Tn.invalid_type,expected:bn.null,received:t.parsedType}),Nn}return Mn(e.data)}}er.create=e=>new er({typeName:Ur.ZodNull,...Zn(e)});class tr extends zn{constructor(){super(...arguments),this._any=!0}_parse(e){return Mn(e.data)}}tr.create=e=>new tr({typeName:Ur.ZodAny,...Zn(e)});class nr extends zn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Mn(e.data)}}nr.create=e=>new nr({typeName:Ur.ZodUnknown,...Zn(e)});class rr extends zn{_parse(e){const t=this._getOrReturnCtx(e);return An(t,{code:Tn.invalid_type,expected:bn.never,received:t.parsedType}),Nn}}rr.create=e=>new rr({typeName:Ur.ZodNever,...Zn(e)});class ir extends zn{_parse(e){if(this._getType(e)!==bn.undefined){const t=this._getOrReturnCtx(e);return An(t,{code:Tn.invalid_type,expected:bn.void,received:t.parsedType}),Nn}return Mn(e.data)}}ir.create=e=>new ir({typeName:Ur.ZodVoid,...Zn(e)});class or extends zn{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==bn.array)return An(t,{code:Tn.invalid_type,expected:bn.array,received:t.parsedType}),Nn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(An(t,{code:e?Tn.too_big:Tn.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&&(An(t,{code:Tn.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&&(An(t,{code:Tn.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 jn(t,e,t.path,n))))).then((e=>Cn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new jn(t,e,t.path,n))));return Cn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new or({...this._def,minLength:{value:e,message:Ln.toString(t)}})}max(e,t){return new or({...this._def,maxLength:{value:e,message:Ln.toString(t)}})}length(e,t){return new or({...this._def,exactLength:{value:e,message:Ln.toString(t)}})}nonempty(e){return this.min(1,e)}}var ar;function sr(e){if(e instanceof ur){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Sr.create(sr(r))}return new ur({...e._def,shape:()=>t})}return e instanceof or?or.create(sr(e.element)):e instanceof Sr?Sr.create(sr(e.unwrap())):e instanceof Or?Or.create(sr(e.unwrap())):e instanceof hr?hr.create(e.items.map((e=>sr(e)))):e}or.create=(e,t)=>new or({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ur.ZodArray,...Zn(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(ar||(ar={}));class ur extends zn{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=mn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==bn.object){const t=this._getOrReturnCtx(e);return An(t,{code:Tn.invalid_type,expected:bn.object,received:t.parsedType}),Nn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof rr&&"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 jn(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof rr){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&&(An(n,{code:Tn.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 jn(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=>Cn.mergeObjectSync(t,e))):Cn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return new ur({...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=Ln.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new ur({...this._def,unknownKeys:"strip"})}passthrough(){return new ur({...this._def,unknownKeys:"passthrough"})}extend(e){return new ur({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ur({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>ar.mergeShapes(this._def.shape(),e._def.shape()),typeName:Ur.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ur({...this._def,catchall:e})}pick(e){const t={};return mn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new ur({...this._def,shape:()=>t})}omit(e){const t={};return mn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new ur({...this._def,shape:()=>t})}deepPartial(){return sr(this)}partial(e){const t={};return mn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new ur({...this._def,shape:()=>t})}required(e){const t={};return mn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Sr;)e=e._def.innerType;t[n]=e}})),new ur({...this._def,shape:()=>t})}keyof(){return wr(mn.objectKeys(this.shape))}}ur.create=(e,t)=>new ur({shape:()=>e,unknownKeys:"strip",catchall:rr.create(),typeName:Ur.ZodObject,...Zn(t)}),ur.strictCreate=(e,t)=>new ur({shape:()=>e,unknownKeys:"strict",catchall:rr.create(),typeName:Ur.ZodObject,...Zn(t)}),ur.lazycreate=(e,t)=>new ur({shape:e,unknownKeys:"strip",catchall:rr.create(),typeName:Ur.ZodObject,...Zn(t)});class cr extends zn{_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 En(e.ctx.common.issues)));return An(t,{code:Tn.invalid_union,unionErrors:n}),Nn}));{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 En(e)));return An(t,{code:Tn.invalid_union,unionErrors:i}),Nn}}get options(){return this._def.options}}cr.create=(e,t)=>new cr({options:e,typeName:Ur.ZodUnion,...Zn(t)});const lr=e=>e instanceof _r?lr(e.schema):e instanceof Pr?lr(e.innerType()):e instanceof br?[e.value]:e instanceof Tr?e.options:e instanceof Er?Object.keys(e.enum):e instanceof Ar?lr(e._def.innerType):e instanceof Xn?[void 0]:e instanceof er?[null]:null;class dr extends zn{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==bn.object)return An(t,{code:Tn.invalid_type,expected:bn.object,received:t.parsedType}),Nn;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}):(An(t,{code:Tn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Nn)}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=lr(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 dr({typeName:Ur.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Zn(n)})}}function pr(e,t){const n=wn(e),r=wn(t);if(e===t)return{valid:!0,data:e};if(n===bn.object&&r===bn.object){const n=mn.objectKeys(t),r=mn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=pr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===bn.array&&r===bn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=pr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===bn.date&&r===bn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class fr extends zn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Rn(e)||Rn(r))return Nn;const i=pr(e.value,r.value);return i.valid?((xn(e)||xn(r))&&t.dirty(),{status:t.value,value:i.data}):(An(n,{code:Tn.invalid_intersection_types}),Nn)};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}))}}fr.create=(e,t,n)=>new fr({left:e,right:t,typeName:Ur.ZodIntersection,...Zn(n)});class hr extends zn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==bn.array)return An(n,{code:Tn.invalid_type,expected:bn.array,received:n.parsedType}),Nn;if(n.data.length<this._def.items.length)return An(n,{code:Tn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Nn;!this._def.rest&&n.data.length>this._def.items.length&&(An(n,{code:Tn.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 jn(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Cn.mergeArray(t,e))):Cn.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:Ur.ZodTuple,rest:null,...Zn(t)})};class mr extends zn{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!==bn.object)return An(n,{code:Tn.invalid_type,expected:bn.object,received:n.parsedType}),Nn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new jn(n,e,n.path,e)),value:o._parse(new jn(n,n.data[e],n.path,e))});return n.common.async?Cn.mergeObjectAsync(t,r):Cn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new mr(t instanceof zn?{keyType:e,valueType:t,typeName:Ur.ZodRecord,...Zn(n)}:{keyType:Vn.create(),valueType:e,typeName:Ur.ZodRecord,...Zn(t)})}}class vr extends zn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==bn.map)return An(n,{code:Tn.invalid_type,expected:bn.map,received:n.parsedType}),Nn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new jn(n,e,n.path,[o,"key"])),value:i._parse(new jn(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 Nn;"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 Nn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}vr.create=(e,t,n)=>new vr({valueType:t,keyType:e,typeName:Ur.ZodMap,...Zn(n)});class gr extends zn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==bn.set)return An(n,{code:Tn.invalid_type,expected:bn.set,received:n.parsedType}),Nn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(An(n,{code:Tn.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&&(An(n,{code:Tn.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 Nn;"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 jn(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new gr({...this._def,minSize:{value:e,message:Ln.toString(t)}})}max(e,t){return new gr({...this._def,maxSize:{value:e,message:Ln.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}gr.create=(e,t)=>new gr({valueType:e,minSize:null,maxSize:null,typeName:Ur.ZodSet,...Zn(t)});class yr extends zn{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==bn.function)return An(t,{code:Tn.invalid_type,expected:bn.function,received:t.parsedType}),Nn;function n(e,n){return On({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Sn(),In].filter((e=>!!e)),issueData:{code:Tn.invalid_arguments,argumentsError:n}})}function r(e,n){return On({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Sn(),In].filter((e=>!!e)),issueData:{code:Tn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Ir?Mn((async(...e)=>{const t=new En([]),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}))})):Mn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new En([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new En([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new yr({...this._def,args:hr.create(e).rest(nr.create())})}returns(e){return new yr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new yr({args:e||hr.create([]).rest(nr.create()),returns:t||nr.create(),typeName:Ur.ZodFunction,...Zn(n)})}}class _r extends zn{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})}}_r.create=(e,t)=>new _r({getter:e,typeName:Ur.ZodLazy,...Zn(t)});class br extends zn{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return An(t,{received:t.data,code:Tn.invalid_literal,expected:this._def.value}),Nn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function wr(e,t){return new Tr({values:e,typeName:Ur.ZodEnum,...Zn(t)})}br.create=(e,t)=>new br({value:e,typeName:Ur.ZodLiteral,...Zn(t)});class Tr extends zn{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return An(t,{expected:mn.joinValues(n),received:t.parsedType,code:Tn.invalid_type}),Nn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return An(t,{received:t.data,code:Tn.invalid_enum_value,options:n}),Nn}return Mn(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 Tr.create(e)}exclude(e){return Tr.create(this.options.filter((t=>!e.includes(t))))}}Tr.create=wr;class Er extends zn{_parse(e){const t=mn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==bn.string&&n.parsedType!==bn.number){const e=mn.objectValues(t);return An(n,{expected:mn.joinValues(e),received:n.parsedType,code:Tn.invalid_type}),Nn}if(-1===t.indexOf(e.data)){const e=mn.objectValues(t);return An(n,{received:n.data,code:Tn.invalid_enum_value,options:e}),Nn}return Mn(e.data)}get enum(){return this._def.values}}Er.create=(e,t)=>new Er({values:e,typeName:Ur.ZodNativeEnum,...Zn(t)});class Ir extends zn{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==bn.promise&&!1===t.common.async)return An(t,{code:Tn.invalid_type,expected:bn.promise,received:t.parsedType}),Nn;const n=t.parsedType===bn.promise?t.data:Promise.resolve(t.data);return Mn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ir.create=(e,t)=>new Ir({type:e,typeName:Ur.ZodPromise,...Zn(t)});class Pr extends zn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ur.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=>{An(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?Nn:("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?Nn:("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(!Dn(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=>Dn(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}mn.assertNever(r)}}Pr.create=(e,t,n)=>new Pr({schema:e,typeName:Ur.ZodEffects,effect:t,...Zn(n)}),Pr.createWithPreprocess=(e,t,n)=>new Pr({schema:t,effect:{type:"preprocess",transform:e},typeName:Ur.ZodEffects,...Zn(n)});class Sr extends zn{_parse(e){return this._getType(e)===bn.undefined?Mn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Sr.create=(e,t)=>new Sr({innerType:e,typeName:Ur.ZodOptional,...Zn(t)});class Or extends zn{_parse(e){return this._getType(e)===bn.null?Mn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Or.create=(e,t)=>new Or({innerType:e,typeName:Ur.ZodNullable,...Zn(t)});class Ar extends zn{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===bn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ar.create=(e,t)=>new Ar({innerType:e,typeName:Ur.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Zn(t)});class Cr extends zn{_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 Un(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}}Cr.create=(e,t)=>new Cr({innerType:e,typeName:Ur.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Zn(t)});class Nr extends zn{_parse(e){if(this._getType(e)!==bn.nan){const t=this._getOrReturnCtx(e);return An(t,{code:Tn.invalid_type,expected:bn.nan,received:t.parsedType}),Nn}return{status:"valid",value:e.data}}}Nr.create=e=>new Nr({typeName:Ur.ZodNaN,...Zn(e)});const kr=Symbol("zod_brand");class Mr extends zn{_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 Rr extends zn{_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?Nn:"dirty"===e.status?(t.dirty(),kn(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?Nn:"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 Rr({in:e,out:t,typeName:Ur.ZodPipeline})}}const xr=(e,t={},n)=>e?tr.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})}})):tr.create(),Dr={object:ur.lazycreate};var Ur;!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"}(Ur||(Ur={}));const Lr=Vn.create,jr=Jn.create,Br=Nr.create,Zr=qn.create,zr=Qn.create,Wr=Yn.create,Fr=$n.create,Gr=Xn.create,Hr=er.create,Vr=tr.create,Kr=nr.create,Jr=rr.create,qr=ir.create,Qr=or.create,Yr=ur.create,$r=ur.strictCreate,Xr=cr.create,ei=dr.create,ti=fr.create,ni=hr.create,ri=mr.create,ii=vr.create,oi=gr.create,ai=yr.create,si=_r.create,ui=br.create,ci=Tr.create,li=Er.create,di=Ir.create,pi=Pr.create,fi=Sr.create,hi=Or.create,mi=Pr.createWithPreprocess,vi=Rr.create,gi={string:e=>Vn.create({...e,coerce:!0}),number:e=>Jn.create({...e,coerce:!0}),boolean:e=>Qn.create({...e,coerce:!0}),bigint:e=>qn.create({...e,coerce:!0}),date:e=>Yn.create({...e,coerce:!0})},yi=Nn;var _i=Object.freeze({__proto__:null,defaultErrorMap:In,setErrorMap:function(e){Pn=e},getErrorMap:Sn,makeIssue:On,EMPTY_PATH:[],addIssueToContext:An,ParseStatus:Cn,INVALID:Nn,DIRTY:kn,OK:Mn,isAborted:Rn,isDirty:xn,isValid:Dn,isAsync:Un,get util(){return mn},ZodParsedType:bn,getParsedType:wn,ZodType:zn,ZodString:Vn,ZodNumber:Jn,ZodBigInt:qn,ZodBoolean:Qn,ZodDate:Yn,ZodSymbol:$n,ZodUndefined:Xn,ZodNull:er,ZodAny:tr,ZodUnknown:nr,ZodNever:rr,ZodVoid:ir,ZodArray:or,get objectUtil(){return ar},ZodObject:ur,ZodUnion:cr,ZodDiscriminatedUnion:dr,ZodIntersection:fr,ZodTuple:hr,ZodRecord:mr,ZodMap:vr,ZodSet:gr,ZodFunction:yr,ZodLazy:_r,ZodLiteral:br,ZodEnum:Tr,ZodNativeEnum:Er,ZodPromise:Ir,ZodEffects:Pr,ZodTransformer:Pr,ZodOptional:Sr,ZodNullable:Or,ZodDefault:Ar,ZodCatch:Cr,ZodNaN:Nr,BRAND:kr,ZodBranded:Mr,ZodPipeline:Rr,custom:xr,Schema:zn,ZodSchema:zn,late:Dr,get ZodFirstPartyTypeKind(){return Ur},coerce:gi,any:Vr,array:Qr,bigint:Zr,boolean:zr,date:Wr,discriminatedUnion:ei,effect:pi,enum:ci,function:ai,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>xr((t=>t instanceof e),t,!0),intersection:ti,lazy:si,literal:ui,map:ii,nan:Br,nativeEnum:li,never:Jr,null:Hr,nullable:hi,number:jr,object:Yr,oboolean:()=>zr().optional(),onumber:()=>jr().optional(),optional:fi,ostring:()=>Lr().optional(),pipeline:vi,preprocess:mi,promise:di,record:ri,set:oi,strictObject:$r,string:Lr,symbol:Fr,transformer:pi,tuple:ni,undefined:Gr,union:Xr,unknown:Kr,void:qr,NEVER:yi,ZodIssueCode:Tn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:En}),bi=function(){function e(){var t,n,r,o,s,u,c,l,d,p,f,h,m,v,g,y,_,b,w,T,E,I,P,S,O,A,C;nt(this,e),this.initConfig=window.APP_CONFIG;var N=tt.isString(null===(t=this.initConfig)||void 0===t||null===(n=t.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(o=r.app)||void 0===o||null===(s=o.headerColor)||void 0===s?void 0:s.length)>0?Q:Y;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 k,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)?q.HIDE_BACK:q.SHOW_BACK,x="home"===(null===(v=this.initConfig)||void 0===v||null===(g=v.app)||void 0===g?void 0:g.leftButton)||"both"===(null===(y=this.initConfig)||void 0===y||null===(_=y.app)||void 0===_?void 0:_.leftButton)?q.SHOW_HOME:q.HIDE_HOME,D=new URL(location.href),U=tn(null===(b=this.initConfig)||void 0===b||null===(w=b.app)||void 0===w?void 0:w.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.app)||void 0===E?void 0:E.actionBarHidden)&&(N=(null===(k=this.initConfig)||void 0===k||null===(M=k.app)||void 0===M?void 0:M.actionBarHidden)?Y:Q);this.config={actionbarType:N,buttonType:R,statusbarType:U,dataConfig:{backgroundColor:(null===(I=this.initConfig)||void 0===I||null===(P=I.app)||void 0===P?void 0:P.headerColor)||$,textColor:(null===(S=this.initConfig)||void 0===S||null===(O=S.app)||void 0===O?void 0:O.textColor)||"",textAlign:(null===(A=this.initConfig)||void 0===A||null===(C=A.app)||void 0===C?void 0:C.textAlign)||X,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(a,"/").concat(i,"/").concat(D.search)}}}var t=e.prototype;return t.setNavigationBarTitle=function(e){return Ce((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){Gt("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},t.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return Ce((function(){var r,i;return xe(this,(function(o){return void 0===(void 0===e?"undefined":Je(e))&&null===(void 0===e?"undefined":Je(e))||(r="none"===e||"home"===e?q.HIDE_BACK:q.SHOW_BACK,i="home"===e||"both"===e?q.SHOW_HOME:q.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){Gt("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Ve({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},t.setAndroidBottomNavigationBar=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return Ce((function(){var n,r,i;return xe(this,(function(o){return r=e?ve.hide:ve.show,i=null===(n=ze())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isAndroid))return n();Gt("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideAndroidBottomNavigationBar=!!e,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.setIOSBottomSafeArea=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return Ce((function(){var n,r,i;return xe(this,(function(o){return r=e?ge.hide:ge.show,i=null===(n=ze())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isIOS))return n();Gt("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideIOSSafeAreaBottom=!!e,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1,delay:200})}))]}))}))()},t.configHeader=function(e){var t=this;return Ce((function(){var n;return xe(this,(function(r){return n=t.config,tt.isString(e.headerColor)&&(n.dataConfig.backgroundColor=e.headerColor),tt.isString(e.headerTextColor)&&(n.dataConfig.textColor=e.headerTextColor),tt.isString(e.textAlign)&&("left"===e.textAlign?n.dataConfig.textAlign=ye.left:"center"===e.textAlign&&(n.dataConfig.textAlign=ye.center)),!0===e.hideActionBar?n.actionbarType=Y:!1===e.hideActionBar&&(n.actionbarType=Q),"normal"===e.statusBarType?n.statusbarType=me.normal:"hidden"===e.statusBarType?n.statusbarType=me.hidden:"transparent"===e.statusBarType&&(n.statusbarType=me.transparent),[2,new Promise((function(r,i){Gt("CHANGE_ACTIONBAR",Ve({},n),{success:function(){var i;t.config=Ve({},n);var o,a=null===(i=ze())||void 0===i?void 0:i.platform;window.STATUS_BAR_TYPE=(o=t.config.statusbarType)===me.hidden?"hidden":o===me.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=t.config.actionbarType===Y;var s=null===document||void 0===document?void 0:document.querySelector(":root");if(null==a?void 0:a.isAndroid){var u=0;if(("hidden"===e.statusBarType||"transparent"===e.statusBarType)&&e.hideActionBar){var c=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(c)&&(c=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),u=c}u?null==s||s.style.setProperty("--zaui-safe-area-inset-top","".concat(u,"px")):null==s||s.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}r()},fail:function(e){i(e)}},{timeout:!1})}))]}))}))()},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}(),wi=bi.getInstance(),Ti=[Yr({title:Lr()}).optional()];function Ei(e){return Ii.apply(this,arguments)}function Ii(){return Ii=Ce((function(e){return xe(this,(function(t){return[2,ln("setNavigationBarTitle",Ti,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,wi.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ii.apply(this,arguments)}var Pi=[Yr({color:Lr(),textColor:_i.enum(["black","white"]).optional(),statusBarColor:Lr().optional()}).optional()];function Si(e){return Oi.apply(this,arguments)}function Oi(){return Oi=Ce((function(e){return xe(this,(function(t){return[2,ln("setNavigationBarColor",Pi,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,wi.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 We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oi.apply(this,arguments)}var Ai=[Yr({type:_i.enum(["none","back","home","both"])}).optional()];function Ci(e){return Ni.apply(this,arguments)}function Ni(){return Ni=Ce((function(e){return xe(this,(function(t){return[2,ln("setNavigationBarLeftButton",Ai,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,wi.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ni.apply(this,arguments)}function ki(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Mi(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,ki(e,t,"get"))}function Ri(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 xi(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,ki(e,t,"set"),n),n}var Di,Ui,Li=function(){function e(){nt(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(He({},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}(),ji=new WeakMap,Bi=new WeakMap,Zi=new WeakMap,zi=function(e){ct(n,e);var t=dt(n);function n(e){var r;return nt(this,n),Ri(lt(r=t.call(this)),ji,{writable:!0,value:localStorage}),Ri(lt(r),Bi,{writable:!0,value:void 0}),Ri(lt(r),Zi,{writable:!0,value:void 0}),xi(lt(r),Zi,{keys:new Set,currentSize:0,limitSize:W}),xi(lt(r),Bi,e),r.findAllCurrentDataByApp(e),r}var r=n.prototype;return r.findAllCurrentDataByApp=function(e){try{var t;for(t in Mi(this,ji)){if(e)if(t.split("_")[0]!==e)continue;Mi(this,Zi).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 Mi(this,Bi)&&(e="".concat(Mi(this,Bi),"_").concat(e)),Mi(this,Zi).keys.has(e)?Mi(this,ji).getItem(e):null},r.set=function(e){var t=this;return Ce((function(){return xe(this,(function(n){return Object.entries(e).forEach((function(e){var n=Ke(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.setSync=function(e,t){Mi(this,Bi)&&(e="".concat(Mi(this,Bi),"_").concat(e)),Mi(this,ji).setItem(e,t),Mi(this,Zi).keys.add(e)},r.getInfo=function(){var e=this;return Ce((function(){return xe(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}(Mi(this,ji),Mi(this,Bi));return{currentSize:tt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((W/1024).toFixed(2))}},r.remove=function(e){var t=this;return Ce((function(){return xe(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.removeSync=function(e){Mi(this,Bi)&&(e="".concat(Mi(this,Bi),"_").concat(e)),Mi(this,Zi).keys.has(e)&&(Mi(this,ji).removeItem(e),Mi(this,Zi).keys.delete(e))},r.clearAsync=function(){var e=this;return Ce((function(){return xe(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},r.clearSync=function(){var e=this;Mi(this,Zi).keys.forEach((function(t){Mi(e,Bi)&&t.indexOf(Mi(e,Bi))<0||(Mi(e,ji).removeItem(t),Mi(e,Zi).keys.delete(t))}))},r.setSynchronize=function(e){var t=this;return Object.entries(e).forEach((function(e){var n=Ke(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}(Li),Wi=new WeakMap,Fi=new WeakMap,Gi=function(e){ct(n,e);var t=dt(n);function n(e){var r;return nt(this,n),Ri(lt(r=t.call(this)),Wi,{writable:!0,value:void 0}),Ri(lt(r),Fi,{writable:!0,value:void 0}),xi(lt(r),Fi,{keys:new Set,currentSize:0,limitSize:W}),xi(lt(r),Wi,e),r}var r=n.prototype;return r.get=function(e){var t=this;return Ce((function(){return xe(this,(function(n){return[2,new Promise((function(n,r){Gt("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Mi(t,Wi)},{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:Mi(this,Wi)},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 Ce((function(){return xe(this,(function(n){return[2,new Promise((function(n,r){Gt("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Mi(t,Wi)},{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:Mi(this,Wi)},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 Ce((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){Gt("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Mi(e,Wi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:tt.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(W/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.getInfoSynchronize=function(){var e={mpds_action:"mpds.get.size",mpds_data:{},appId:Mi(this,Wi)},t=0,n=this.handleResult(e);return n&&n.mpds_data&&n.mpds_data.size&&(t=n.mpds_data.size),{currentSize:tt.isNumber(t)?Number(Number(t)/1024):0,limitSize:Number(W/1024)}},r.remove=function(e){var t=this;return Ce((function(){return xe(this,(function(n){return[2,new Promise((function(n,r){Gt("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Mi(t,Wi)},{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:Mi(this,Wi)},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 Ce((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){Gt("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Mi(e,Wi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.clearSynchronize=function(){var e={mpds_action:"mpds.clear.appData",mpds_data:{},appId:Mi(this,Wi)};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=Ft(n).toJSON()}}catch(e){t=e}finally{if(null!==t)throw t}return{}},n}(Li),Hi=function(){function e(){nt(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return Ce((function(){var n,r;return xe(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]=Yt(e)})),[2,r]}}))}))()},t.getItem=function(e){return this.getInstance().getItem(e)},t.putDataToStorage=function(e){var t=this;return Ce((function(){var n,r;return xe(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Ke(e,2),n=t[0],i=t[1];tt.isUndefined(i)||tt.isNull(i)||(r[n]=en(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 Ce((function(){return xe(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 Ce((function(){return xe(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 Ce((function(){return xe(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}(),Vi=new WeakMap,Ki=function(e){ct(n,e);var t=dt(n);function n(e){var r;return nt(this,n),Ri(lt(r=t.call(this)),Vi,{writable:!0,value:void 0}),xi(lt(r),Vi,e),r}return n.prototype.getInstance=function(){return new zi(Mi(this,Vi))},n}(Hi),Ji=new WeakMap,qi=function(e){ct(n,e);var t=dt(n);function n(e){var r;return nt(this,n),Ri(lt(r=t.call(this)),Ji,{writable:!0,value:void 0}),xi(lt(r),Ji,e),r}return n.prototype.getInstance=function(){return new Gi(Mi(this,Ji))},n}(Hi),Qi=new Ki(i),Yi=Rt(),$i=(null===(Di=ze())||void 0===Di?void 0:Di.platformName)||"unknown";Yi>0&&Yi>={android:12100571,iOS:400,wp:0,unknown:0}[$i]&&(null===(Ui=ze())||void 0===Ui?void 0:Ui.appEnv.isMp)&&(Qi=new qi(i));var Xi=Qi,eo=[Yr({data:_i.record(Lr(),_i.any())}).optional()];function to(e){return no.apply(this,arguments)}function no(){return no=Ce((function(e){return xe(this,(function(t){return[2,ln("setStorage",eo,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp||We.isMpWeb?[4,Xi.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ge("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),no.apply(this,arguments)}var ro=[Yr({keys:_i.array(Lr())}).optional()];function io(e){return oo.apply(this,arguments)}function oo(){return oo=Ce((function(e){return xe(this,(function(t){return[2,ln("getStorage",ro,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp||We.isMpWeb?[4,Xi.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ge("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),oo.apply(this,arguments)}function ao(e){return so.apply(this,arguments)}function so(){return(so=Ce((function(e){return xe(this,(function(t){return[2,ln("getStorageInfo",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp||We.isMpWeb?[4,Xi.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ge("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var uo=[Yr({keys:_i.array(Lr())}).optional()];function co(e){return lo.apply(this,arguments)}function lo(){return lo=Ce((function(e){return xe(this,(function(t){return[2,ln("removeStorage",uo,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp||We.isMpWeb?[4,Xi.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ge("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),lo.apply(this,arguments)}var po=[Yr({prefix:Lr().optional()}).optional()];function fo(e){return ho.apply(this,arguments)}function ho(){return(ho=Ce((function(e){return xe(this,(function(t){return[2,ln("clearStorage",po,[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp||We.isMpWeb?[4,Xi.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ge("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var mo=function(){var e=Ce((function(e,t){var n,r,o,a;return xe(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,on()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,Kt.getAccessToken(n)];case 3:return o=s.sent(),a="id,name,user_id_by_oa,is_sensitive",a=e?"".concat(a,",picture.type(").concat(e,")"):"".concat(a,",picture"),[4,fetch("".concat(l.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(i),{headers:{access_token:o||""}}).then(function(){var e=Ce((function(e){var t,n,r,i,o,a;return xe(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)&&i<0)throw o=(null==r?void 0:r.message)||S,new Lt(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)}}(),vo=[Yr({avatarType:_i.enum(["small","normal","large"]).optional(),autoRequestPermission:_i.boolean().default(!1).optional()}).optional()];function go(e){return yo.apply(this,arguments)}function yo(){return yo=Ce((function(e){return xe(this,(function(t){return[2,ln("getUserInfo",vo,[e],function(){var e=Ce((function(e){var t,n,r;return xe(this,(function(i){switch(i.label){case 0:if(!We.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,mo(t,n)];case 2:return[2,{userInfo:i.sent()}];case 3:return r=i.sent(),[2,Promise.reject(r)];case 4:return We.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Ge("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yo.apply(this,arguments)}var _o=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},bo=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(t){var n,r,i,o=t.network,a=(null===(n=ze())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)||!1;switch(o){case _o(a).NONE:i=te.none;break;case _o(a).WIFI:i=te.wifi;break;case _o(a)["2G"]:case _o(a)["3G"]:case _o(a)["4G"]:i=te.cellular;break;default:i=te.unknown}e(i)},fail:function(e){t(e)}},{})}))]}))}));function wo(e){return To.apply(this,arguments)}function To(){return(To=Ce((function(e){return xe(this,(function(t){return[2,ln("getNetworkType",[],[e],Ce((function(){var e,t;return xe(this,(function(n){switch(n.label){case 0:return We.isMp?[4,bo()]:[3,2];case 1:return[2,{networkType:n.sent()}];case 2:if(We.isMpWeb){switch(e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,e.effectiveType){case"none":t=te.none;break;case"4g":t=te.wifi;break;case"3g":case"2g":t=te.cellular;break;default:t=te.unknown}return[2,Promise.resolve({networkType:t})]}return[2,Promise.reject(Ge("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Eo=[_i.function().args(Yr({isConnected:_i.boolean(),networkType:_i.enum(["none","wifi","cellular","unknown"])})).returns(_i.void())];function Io(e){return ln("onNetworkStatusChange",Eo,[e],(function(e){var t=e;if(We.isMp)!function(e){_t.getInstance().on(re.NetworkChanged,(function(t){var n=null==t?void 0:t.state;bo().then((function(t){e({isConnected:"CONNECTED"===n,networkType:t})}))}))}(t);else if(We.isMpWeb){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,r=n.effectiveType;n.addEventListener("change",(function(){var e;switch(r){case"none":e=te.none;break;case"4g":e=te.wifi;break;case"3g":case"2g":e=te.cellular;break;default:e=te.unknown}t({isConnected:!0,networkType:e})}))}}))}var Po=function(){var e=Ce((function(e){var t,n,r,i,o,a;return xe(this,(function(s){return a={subaction:0,scanning_type:tt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:tt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:tt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:tt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:tt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:tt.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:tt.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:tt.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:tt.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:tt.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){Gt("SCAN_IBEACON",Ve({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),So=[Yr({scanningType:_i.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:_i.number().optional(),monitorInterval:_i.number().optional(),domain:_i.string().optional(),scanConfig:Yr({scanTime:_i.number().optional(),timeBetweenScan:_i.number().optional(),beaconTimeout:_i.number().optional(),delayCheckConnectedTimeout:_i.number().optional(),beaconConnectedTimeout:_i.number().optional()}).optional(),items:_i.array(Yr({id:_i.string().optional(),distance:_i.number().optional(),monitor:Yr({enable:_i.boolean().optional(),movingRange:_i.number().optional()}).optional()})).optional(),scanFromSource:_i.string().optional()}).optional()];function Oo(e){return Ao.apply(this,arguments)}function Ao(){return(Ao=Ce((function(e){return xe(this,(function(t){return[2,ln("startBeaconDiscovery",So,[e],Ce((function(){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Po(e)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ge("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Co=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function No(e){return ko.apply(this,arguments)}function ko(){return(ko=Ce((function(e){return xe(this,(function(t){return[2,ln("stopBeaconDiscovery",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Co()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ge("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Mo=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("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 Ro(e){return xo.apply(this,arguments)}function xo(){return(xo=Ce((function(e){return xe(this,(function(t){return[2,ln("getBeacons",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Mo()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Ge("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Do=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Uo(e){return Lo.apply(this,arguments)}function Lo(){return(Lo=Ce((function(e){return xe(this,(function(t){return[2,ln("closeApp",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Do()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var jo=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Bo(e){return Zo.apply(this,arguments)}function Zo(){return(Zo=Ce((function(e){return xe(this,(function(t){return[2,ln("scanQRCode",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,jo()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Ge("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var zo=function(){var e=Ce((function(e,t,n,i){return xe(this,(function(o){return[2,new Promise((function(o,a){Gt("OPEN_PROFILE",{uId:e,type:oe[t],zapp:r,sourceId:n,sourceIndex:i},{success:function(){o()},fail:function(e){a(e)}},{})}))]}))}));return function(t,n,r,i){return e.apply(this,arguments)}}(),Wo=[Yr({id:Lr(),type:_i.enum(["user","oa","aliasOA"]),sourceId:_i.any().optional(),sourceIndex:_i.any().optional()}).optional()];function Fo(e){return Go.apply(this,arguments)}function Go(){return Go=Ce((function(e){return xe(this,(function(t){return[2,ln("openProfile",Wo,[e],function(){var e=Ce((function(e){var t,n,r,i;return xe(this,(function(o){switch(o.label){case 0:return We.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,zo(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Go.apply(this,arguments)}var Ho=function(){var e=Ce((function(e,t){var n,i,o,a=arguments;return xe(this,(function(s){return n=a.length>2&&void 0!==a[2]?a[2]:"",i=a.length>3?a[3]:void 0,o=a.length>4?a[4]:void 0,[2,new Promise((function(a,s){Gt("OPEN_CHAT",{uId:e,type:ae[t],msg:n,zapp:r,sourceId:i,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Vo=[Yr({id:Lr(),type:_i.enum(["user","oa"]),sourceId:_i.any().optional(),sourceIndex:_i.any().optional(),message:Lr().optional()}).optional()];function Ko(e){return Jo.apply(this,arguments)}function Jo(){return Jo=Ce((function(e){return xe(this,(function(t){return[2,ln("openChat",Vo,[e],function(){var e=Ce((function(e){var t,n,r,i,o;return xe(this,(function(a){switch(a.label){case 0:return We.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,Ho(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Jo.apply(this,arguments)}function qo(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 Qo=function(){var e=Ce((function(e,t){var n,i;return xe(this,(function(o){switch(n={},i=e,e){case"image":(null==t?void 0:t.imageUrls)?(i="multi_image",n={photoUrl:null==t?void 0:t.imageUrls}):n={photoUrl:null==t?void 0:t.imageUrl};break;case"link":n={link:null==t?void 0:t.link,title:null==t?void 0:t.title,thumb:null==t?void 0:t.thumb,description:null==t?void 0:t.description};break;case"profile":n={avt:null==t?void 0:t.avatar,uid:null==t?void 0:t.id,dpn:null==t?void 0:t.displayName}}return[2,new Promise((function(e,t){Gt("OPEN_POSTFEED",qo(Ve({type:se[i]},n),{zapp:r}),{success:function(t){e({status:null==t?void 0:t.status,shareType:null==t?void 0:t.share_type,numberOfUser:null==t?void 0:t.uid_to_size})},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Yo=[_i.union([Yr({type:_i.enum(["image"]),data:Yr({imageUrl:Lr().url().optional(),imageUrls:_i.array(Lr().url()).optional()})}),Yr({type:_i.enum(["link"]),data:Yr({link:Lr().url(),title:Lr().max(100).optional(),thumb:Lr().url().optional(),description:Lr().max(400).default("").optional()})}),Yr({type:_i.enum(["profile"]),data:Yr({id:Lr().optional()})})])];function $o(e){return Xo.apply(this,arguments)}function Xo(){return Xo=Ce((function(e){return xe(this,(function(t){return[2,ln("openPostFeed",Yo,[e],function(){var e=Ce((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return We.isMp?(t=e.type,n=e.data,[4,Qo(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ge("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xo.apply(this,arguments)}var ea=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){Gt("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:r},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ta=[Yr({id:Lr(),showDialogConfirm:_i.boolean().optional()}).optional()];function na(e){return ra.apply(this,arguments)}function ra(){return ra=Ce((function(e){return xe(this,(function(t){return[2,ln("followOA",ta,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return We.isMp?(t=e.id,[4,ea(t)]):[3,2];case 1:return[2,n.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ra.apply(this,arguments)}var ia=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){Gt("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),oa=[Yr({id:Lr()}).optional()];function aa(e){return sa.apply(this,arguments)}function sa(){return sa=Ce((function(e){return xe(this,(function(t){return[2,ln("unfollowOA",oa,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return We.isMp?(t=e.id,[4,ia(t)]):[3,2];case 1:return[2,n.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),sa.apply(this,arguments)}var ua=function(){var e=Ce((function(e,t,n,r,i,a){var s,c,d,p,f,h,m,v;return xe(this,(function(g){switch(g.label){case 0:return d=new URL(location.href),p=new URLSearchParams,f="".concat(d.pathname.replace(u,"")).concat(d.search),a&&(f="/".concat(e).concat("/"===a[0]?"":"/").concat(a)),!(h=new URL("".concat(o).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(c=window.APP_VERSION)||void 0===c?void 0:c.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.CREATE_SHARE_LINK,Ve({method:"POST",body:p},m))];case 1:return[4,g.sent().json()];case 2:if(!(v=g.sent())||0!==v.err)throw Wt.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,qo(Ve({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),ca=function(){var e=Ce((function(e,t){var n,o,a,s,u,c,l,d,p,f,h;return xe(this,(function(m){switch(m.label){case 0:switch(n={},o=e,e){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return n={text:null==t?void 0:t.text,desc:(null==t?void 0:t.desc)||(null==t?void 0:t.description),autoParseLink:(null==t?void 0:t.autoParseLink)?1:0},[3,14];case 2:return u=[],c=Rt(),l=(null===(s=ze())||void 0===s?void 0:s.platformName)||"unknown",Number(c)>=z[l]&&(o="multi_image"),Array.isArray(null==t?void 0:t.imageUrls)&&(null==t?void 0:t.imageUrls.length)>0?u=null==t?void 0:t.imageUrls:u.push(null==t?void 0:t.imageUrl),n={photoUrls:u,photoUrl:null==t?void 0:t.imageUrl,caption:null==t?void 0:t.caption},[3,14];case 3:return n={photoUrl:null==t?void 0:t.imageUrl,gifUrl:null==t?void 0:t.gifUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 4:return n={videoThumb:null==t?void 0:t.videoThumb,videoUrl:null==t?void 0:t.videoUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 5:return n={link:null==t?void 0:t.link,chatOnly:(null==t?void 0:t.chatOnly)?1:0},[3,14];case 6:return n={uid:null==t?void 0:t.id},[3,14];case 7:case 10:return[4,Kt.getAccessToken()];case 8:case 11:return a=m.sent(),[4,ua(i,a||"",(null==t?void 0:t.title)||"",(null==t?void 0:t.description)||"",(null==t?void 0:t.thumbnail)||"",null==t?void 0:t.path)];case 9:return d=m.sent(),n={data:{ZInstantAPIInfo:{url:"".concat(d.zinstantApi),zinstantdata_id:"templateId=".concat(d.ztemplateId,"&appId=").concat(i,"&shareId=").concat(d.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return p=m.sent().shareableLink,f=new URL(p),h=f.searchParams.getAll("zshareId"),f.searchParams.delete("zshareId"),h.length>0&&f.searchParams.append("zshareId",h[0]),n={link:f.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(e,t){Gt("OPEN_SHARESHEET",qo(Ve({type:ce[o]},n),{zapp:r}),{success:function(t){e({status:null==t?void 0:t.status,shareType:null==t?void 0:t.share_type,numberOfUser:null==t?void 0:t.uid_to_size})},fail:function(e){t(e)}},{timeout:!1})}))]}}))}));return function(t,n){return e.apply(this,arguments)}}(),la=[_i.union([Yr({type:_i.enum(["text"]),data:Yr({text:Lr(),description:Lr().default("").optional(),autoParseLink:_i.boolean().default(!1).optional()})}),Yr({type:_i.enum(["image"]),data:Yr({imageUrl:Lr().url().optional(),imageUrls:_i.array(Lr().url()).max(10).optional()})}),Yr({type:_i.enum(["link"]),data:Yr({link:Lr().url(),chatOnly:_i.boolean().optional()})}),Yr({type:_i.enum(["oa"]),data:Yr({id:Lr()})}),Yr({type:_i.enum(["gif"]),data:Yr({gifUrl:Lr().url(),imageUrl:Lr().url().optional(),width:jr().min(0).optional(),height:jr().min(0).optional()})}),Yr({type:_i.enum(["video"]),data:Yr({videoThumb:Lr().url(),videoUrl:Lr().url(),width:jr().min(0).optional(),height:jr().min(0).optional()})}),Yr({type:_i.enum(["zmp","zmp_deep_link"]),data:Yr({title:Lr().max(100),thumbnail:Lr().url(),path:Lr().optional(),description:Lr().max(400).default("").optional()})})])];function da(e){return pa.apply(this,arguments)}function pa(){return pa=Ce((function(e){return xe(this,(function(t){return[2,ln("openShareSheet",la,[e],function(){var e=Ce((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return We.isMp?(t=e.type,n=e.data,[4,ca(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ge("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pa.apply(this,arguments)}var fa=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=ze())||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=ze())||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 ma.apply(this,arguments)}function ma(){return(ma=Ce((function(e){return xe(this,(function(t){return[2,ln("requestCameraPermission",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return[4,fa()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var va=function(){var e=Ce((function(e,t,n){return xe(this,(function(r){return[2,new Promise((function(r,i){Gt("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)}}(),ga=Ce((function(){var e,t,n,r=arguments;return xe(this,(function(o){switch(o.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:i,t=r.length>1&&void 0!==r[1]?r[1]:0,n=yn(),[4,Ct(e,t,n.version)];case 1:return[2,o.sent()]}}))})),ya=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){Gt("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),_a=[Yr({params:_i.record(Lr(),Lr()).optional()}).optional()];function ba(e){return wa.apply(this,arguments)}function wa(){return wa=Ce((function(e){return xe(this,(function(t){return[2,ln("createShortcut",_a,[e],function(){var e=Ce((function(e){var t,n,r,a,s,u,c,l;return xe(this,(function(d){switch(d.label){case 0:return We.isMp?[4,ga(i,0)]:[3,6];case 1:return r=d.sent(),a=null===(t=ze())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||Xt("og:image:url")||"",u=r.name||document.title,(c=(null==e?void 0:e.params)?new URLSearchParams(null==e?void 0:e.params):new URLSearchParams).append("utm_source","zalo-shortcut"),c.append("utm_medium","default"),c.append("utm_campaign","default"),a?(c.append("appId",i),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,ya(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,va("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,Wt.success()];case 6:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wa.apply(this,arguments)}var Ta=function(){var e=Ce((function(e,t,n){return xe(this,(function(i){return[2,new Promise((function(i,o){Gt("PROMPT_AUTHENTICATION",{secret_data:e,app_id:r,ui:{title:null==t?void 0:t.title,sub_title:null==t?void 0:t.subTitle,negative_text:null==t?void 0:t.negativeButtonText},require_fingerprint:n?1:0},{success:function(e){var t,n,r,o;i({code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null==e||null===(t=e.data)||void 0===t?void 0:t.domain,code:null==e||null===(n=e.data)||void 0===n?void 0:n.error_code,message:null==e||null===(r=e.data)||void 0===r?void 0:r.error_message,payToken:null==e||null===(o=e.data)||void 0===o?void 0:o.pay_token}})},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Ea=[Yr({secretData:Lr(),ui:Yr({title:Lr().default("Xác thực").optional(),subTitle:Lr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:Lr().default("Đóng").optional()}).optional(),requireFingerprint:zr().default(!0).optional()}).optional()];function Ia(e){return Pa.apply(this,arguments)}function Pa(){return Pa=Ce((function(e){return xe(this,(function(t){return[2,ln("openBioAuthentication",Ea,[e],function(){var e=Ce((function(e){var t,n,r;return xe(this,(function(i){switch(i.label){case 0:return We.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Ta(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Ge("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pa.apply(this,arguments)}var Sa=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("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 Oa(e){return Aa.apply(this,arguments)}function Aa(){return(Aa=Ce((function(e){return xe(this,(function(t){return[2,ln("checkStateBioAuthentication",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Sa()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return We.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Ge("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Ca=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){Gt("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Na=[Yr({message:Lr()}).optional()];function ka(e){return Ma.apply(this,arguments)}function Ma(){return Ma=Ce((function(e){return xe(this,(function(t){return[2,ln("showToast",Na,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ca(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ma.apply(this,arguments)}var Ra=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function xa(e){return Da.apply(this,arguments)}function Da(){return(Da=Ce((function(e){return xe(this,(function(t){return[2,ln("hideKeyboard",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Ra()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var Ua=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){Gt("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),La=[Yr({phoneNumber:Lr()})];function ja(e){return Ba.apply(this,arguments)}function Ba(){return Ba=Ce((function(e){return xe(this,(function(t){return[2,ln("openPhone",La,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ua(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ba.apply(this,arguments)}var Za=function(){var e=Ce((function(e,t){return xe(this,(function(n){return[2,new Promise((function(n,r){Gt("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),za=[Yr({content:Lr(),phoneNumber:Lr()})];function Wa(e){return Fa.apply(this,arguments)}function Fa(){return Fa=Ce((function(e){return xe(this,(function(t){return[2,ln("openSMS",za,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Za(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fa.apply(this,arguments)}var Ga=function(){var e=Ce((function(e){var t,n=arguments;return xe(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){Gt("VIEW_MYQR",{dpn:t,uid:e,zapp:r},{success:function(){n()},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ha=[Yr({id:Lr(),displayName:Lr().default("").optional()})];function Va(e){return Ka.apply(this,arguments)}function Ka(){return Ka=Ce((function(e){return xe(this,(function(t){return[2,ln("viewOAQr",Ha,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ga(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ka.apply(this,arguments)}var Ja=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){Gt("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)}}(),qa=[Yr({keepScreenOn:zr()})];function Qa(e){return Ya.apply(this,arguments)}function Ya(){return Ya=Ce((function(e){return xe(this,(function(t){return[2,ln("keepScreen",qa,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ja(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ya.apply(this,arguments)}function $a(e){return Xa.apply(this,arguments)}function Xa(){return(Xa=Ce((function(e){return xe(this,(function(t){return[2,ln("onKeepScreen",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Ja(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function es(e){return ts.apply(this,arguments)}function ts(){return(ts=Ce((function(e){return xe(this,(function(t){return[2,ln("offKeepScreen",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Ja(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var ns=function(){var e=Ce((function(e,t,n){var r;return xe(this,(function(i){return r={},e?r={imageBase64Data:e}:t&&(r={imageUrl:t}),[2,new Promise((function(e,t){Gt("SAVE_IMAGE_GALLERY",qo(Ve({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),rs=[Yr({imageBase64Data:Lr().optional(),imageUrl:Lr().url().optional()}).optional()];function is(e){return os.apply(this,arguments)}function os(){return os=Ce((function(e){return xe(this,(function(t){return[2,ln("saveImageToGallery",rs,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,ns(e.imageBase64Data,e.imageUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),os.apply(this,arguments)}var as=function(){var e=Ce((function(e,t){var n;return xe(this,(function(r){return{},n={videoUrl:e,onProgress:t},[2,new Promise((function(e,t){Gt("SAVE_VIDEO_GALLERY",Ve({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ss=[Yr({videoUrl:Lr().url()}).optional()];function us(e){return cs.apply(this,arguments)}function cs(){return cs=Ce((function(e){return xe(this,(function(t){return[2,ln("saveVideoToGallery",ss,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,as(e.videoUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("saveVideoToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cs.apply(this,arguments)}var ls=function(){var e=Ce((function(e){var t,n,r,i,o,s,u=arguments;return xe(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,ga(e,0)];case 2:return r=c.sent(),[3,4];case 3:return c.sent(),[3,4];case 4:i={appId:e},r&&(i.appName=r.name,i.appAvtUrl=r.logoUrl),o="".concat(a,"/").concat(e).concat(t);try{s=new URL(o),Object.entries(n).forEach((function(e){var t=Ke(e,2),n=t[0],r=t[1];s.searchParams.append(n,String(r))})),o=s.href}catch(e){}return[2,new Promise((function(e,t){Gt("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),ds=[Yr({appId:Lr(),path:Lr().optional(),params:_i.record(Lr(),Lr()).optional()})];function ps(e){return fs.apply(this,arguments)}function fs(){return fs=Ce((function(e){return xe(this,(function(t){return[2,ln("openMiniApp",ds,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,ls(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fs.apply(this,arguments)}var hs=Ce((function(){var e,t,n=arguments;return xe(this,(function(r){return e=n.length>0&&void 0!==n[0]?n[0]:"oneShot",t=n.length>1?n[1]:void 0,[2,new Promise((function(n,r){Gt("INTERACTIVE_VIBRATION",{type:de[e],vibrate_time:t},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))})),ms=[Yr({type:_i.enum(["oneShot"]).default("oneShot").optional(),milliseconds:jr().optional()})];function vs(e){return gs.apply(this,arguments)}function gs(){return gs=Ce((function(e){return xe(this,(function(t){return[2,ln("vibrate",ms,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.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 We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),gs.apply(this,arguments)}var ys=function(){var e=Ce((function(e,t){var n,r,i,o;return xe(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=tt.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?kt(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?kt(null==t?void 0:t.leftButton):"back"},!r&&tt.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){Gt("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),_s=[Yr({url:Lr(),config:Yr({style:_i.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:_i.enum(["back","none"]).default("back").optional()}).optional()})];function bs(e){return ws.apply(this,arguments)}function ws(){return ws=Ce((function(e){return xe(this,(function(t){return[2,ln("openWebview",_s,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,ys(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ws.apply(this,arguments)}function Ts(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Tt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Es(){return ln("getRouteParams",[],[],(function(){return Ts()}))}function Is(e){return Ps.apply(this,arguments)}function Ps(){return(Ps=Ce((function(e){return xe(this,(function(t){return[2,ln("getAppInfo",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,ga()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Ge("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Ss=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){Gt("WEBVIEW_SET_RESULT",{result:en(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Os=[Yr({data:_i.any()})];function As(e){return Cs.apply(this,arguments)}function Cs(){return Cs=Ce((function(e){return xe(this,(function(t){return[2,ln("sendDataToPreviousMiniApp",Os,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ss(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Cs.apply(this,arguments)}var Ns=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){var n,r;Gt("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(Wt.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=ze())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function ks(e){return Ms.apply(this,arguments)}function Ms(){return(Ms=Ce((function(e){return xe(this,(function(t){return[2,ln("getPhoneNumber",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Ns()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Ge("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var Rs=Ce((function(){var e,t,n,o=arguments;return xe(this,(function(a){return e=o.length>0&&void 0!==o[0]?o[0]:1,t=o.length>1?o[1]:void 0,n=o.length>2?o[2]:void 0,[2,new Promise((function(o,a){Gt("MP_OPEN_PROFILE_PICKER",Ve({},t===_e.TOOL_DEL_FRIEND?{maxProfile:e,src:t,uids:n,zapp:r,appId:i}:{maxProfile:e}),{success:function(e){Array.isArray(e)?o(e.map((function(e){return e.id}))):o([])},fail:function(e){a(e)}},{isMultiCallback:!0})}))]}))})),xs=[Yr({maxProfile:jr().optional().default(1),src:_i.enum([_e.TOOL_DEL_FRIEND]).optional(),uids:Qr(Lr()).optional()}).superRefine((function(e,t){var n=e.src,r=e.maxProfile;n===_e.TOOL_DEL_FRIEND?r<1&&t.addIssue({code:"custom",path:["maxProfile"],message:"maxProfile must be at least 1 when src is 'tool_del_friend'"}):(r<1||r>10)&&t.addIssue({code:"custom",path:["maxProfile"],message:"maxProfile must be between 1 and 10"})}))];function Ds(e){return Us.apply(this,arguments)}function Us(){return Us=Ce((function(e){return xe(this,(function(t){return[2,ln("openProfilePicker",xs,[e],function(){var e=Ce((function(e){var t,n,r,i,o,a,s,u,c,d,p,f;return xe(this,(function(h){switch(h.label){case 0:return We.isMp?[4,Rs(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,Kt.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 xe(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(l.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(tt.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,Re(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,Re(u)),[3,5];case 5:return[2]}}))},d=i[Symbol.iterator](),h.label=4;case 4:return(a=(p=d.next()).done)?[3,7]:[5,De(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==d.return||d.return()}finally{if(s)throw u}return[7];case 10:return[2,{users:o}];case 11:return[2,{users:[]}];case 12:return We.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Ge("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Us.apply(this,arguments)}var Ls=function(){var e=Ce((function(e,t,n){var r;return xe(this,(function(i){return r=t&&tt.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){Gt("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)}}(),js=[Yr({SSID:Lr(),password:Lr().optional(),hiddenSSID:zr().optional()})];function Bs(e){return Zs.apply(this,arguments)}function Zs(){return Zs=Ce((function(e){return xe(this,(function(t){return[2,ln("connectWifi",js,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ls(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zs.apply(this,arguments)}var zs=function(){var e=Ce((function(e,t,n,r,i,o){var a,s;return xe(this,(function(u){return a={type:0,url:t,max_size:n||1048576},s={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(t,n){Gt("PICK_MEDIA",{media_type:pe[e],edit_view:Ve({},s,r),silent_request:i,upload:a,max_select_items:o},{success:function(e){t(null==e?void 0:e.result_content)},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Ws=[Yr({type:_i.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:Lr().url(),maxItemSize:jr().min(0).optional(),editView:Yr({enable:zr().optional(),aspectRatio:Lr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:zr().optional(),maxSelectItem:jr().min(1).optional()})];function Fs(e){return Gs.apply(this,arguments)}function Gs(){return Gs=Ce((function(e){return xe(this,(function(t){return[2,ln("openMediaPicker",Ws,[e],function(){var e=Ce((function(e){var t,n,r,i,o,a;return xe(this,(function(s){switch(s.label){case 0:return We.isMp?(i={},tt.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(n=e.editView)||void 0===n?void 0:n.enable)?i.enable=1:i.enable=0,i.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio,o=!0===e.silentRequest?1:0,a=e.maxSelectItem,[4,zs(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return We.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Ge("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gs.apply(this,arguments)}var Hs=[Yr({title:Lr().max(100),description:Lr().max(400).default(""),thumbnail:Lr().url().optional(),path:Lr().optional()})];function Vs(e){return Ks.apply(this,arguments)}function Ks(){return Ks=Ce((function(e){return xe(this,(function(t){return[2,ln("getShareableLink",Hs,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return[4,Kt.getAccessToken()];case 1:return t=n.sent(),[4,ua(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ks.apply(this,arguments)}var Js=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){Gt("MP_CLOSE_LOADINGVIEW",{at:(new Date).getTime(),when:e,url:location.href},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}();function qs(e){return Qs.apply(this,arguments)}function Qs(){return(Qs=Ce((function(e){return xe(this,(function(t){return[2,ln("closeLoading",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Js("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function Ys(e){return $s.apply(this,arguments)}function $s(){return $s=Ce((function(e){return xe(this,(function(t){return[2,ln("requestUpdateZalo",[],[e],Ce((function(){var e,t,n;return xe(this,(function(r){switch(r.label){case 0:return We.isMp?(n=(null===(e=ze())||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,ya(n)]):[3,2];case 1:return[2,r.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("requestUpdateZalo",{}))]}}))})))]}))})),$s.apply(this,arguments)}var Xs=_t.getInstance();Xs.addListener=function(e,t,n){var r=e;return Xs.addListener(re[r],t,n)};var eu=[_i.function()];function tu(e){return ln("onConfirmToExit",eu,[e],(function(e){var t=e;We.isMp&&(Xs.on(re.AppClose,t,'{"handle_h5": 1}'),wi.setNavigationBarLeftButton(void 0,2))}))}function nu(){return ln("offConfirmToExit",[],[],(function(){We.isMp&&(Xs.off(re.AppClose),wi.setNavigationBarLeftButton(void 0,0))}))}function ru(){return ln("getDeviceId",[],[],(function(){return We.isMp&&Kt.getSync(c.DEVICE_ID)||""}))}function iu(e){return ou.apply(this,arguments)}function ou(){return(ou=Ce((function(e){return xe(this,(function(t){return[2,ln("getDeviceIdAsync",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Kt.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function au(){return ln("getContext",[],[],(function(){if(We.isMp){var e=Kt.getSync(c.CONTEXT_ID)||"";return{type:Kt.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function su(e){return uu.apply(this,arguments)}function uu(){return(uu=Ce((function(e){return xe(this,(function(t){return[2,ln("getContextAsync",[],[e],Ce((function(){var e;return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Kt.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,Kt.jumpAndGetToken(c.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function cu(e){return lu.apply(this,arguments)}function lu(){return(lu=Ce((function(e){return xe(this,(function(t){return[2,ln("getAuthCode",[],[e],Ce((function(){var e,t;return xe(this,(function(n){switch(n.label){case 0:return We.isMp?[4,Kt.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,Kt.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,Kt.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Nt([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),Wt.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function du(e){return pu.apply(this,arguments)}function pu(){return(pu=Ce((function(e){return xe(this,(function(t){return[2,ln("getZPIToken",[],[e],Ce((function(){var e,t,n,r;return xe(this,(function(i){switch(i.label){case 0:return We.isMp?[4,Kt.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,Kt.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,Kt.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,Kt.jumpAndGetToken(c.ZPT_ZPI)];case 4:return r=i.sent()||"",[2,{utoken:e,gtoken:t,zpp:n,zpt:r}];case 5:return[2,Promise.resolve({utoken:"",gtoken:"",zpp:"",zpt:""})]}}))})))]}))}))).apply(this,arguments)}var fu=[Lr()];function hu(e){return ln("setAccessToken",fu,[e],(function(e){var t=e;Kt.setAccessToken(t)}))}var mu=[Yr({url:Lr().url()})];function vu(e){return gu.apply(this,arguments)}function gu(){return gu=Ce((function(e){return xe(this,(function(t){return[2,ln("openOutApp",mu,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,ya(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),gu.apply(this,arguments)}var yu=[Yr({count:jr().min(1).optional().default(1),sourceType:_i.array(_i.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:_i.enum(["back","front"]).default("front").optional()})];function _u(e){return bu.apply(this,arguments)}function bu(){return bu=Ce((function(e){return xe(this,(function(t){return[2,ln("chooseImage",yu,[e],function(){var e=Ce((function(e){var t,n,r,i;return xe(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)}}())]}))})),bu.apply(this,arguments)}var wu=Ce((function(){var e,t,n=arguments;return xe(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){Gt("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(Wt.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Tu(e){return Eu.apply(this,arguments)}function Eu(){return(Eu=Ce((function(e){return xe(this,(function(t){return[2,ln("getLocation",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,wu()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({token:""})]:[2,Promise.reject(Ge("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Iu=[_i.function().args(Yr({data:_i.any()})).returns(_i.void())];function Pu(e){return ln("onCallbackData",Iu,[e],(function(){!function(e){_t.getInstance().on(re.OnDataCallback,(function(t){e({data:t})}))}(e)}))}var Su=function(){var e=Ce((function(e){var t,n,r,o,a,s,u,c,l,d,p;return xe(this,(function(f){switch(f.label){case 0:return e||(e=Ts()),"object"==typeof e&&((n=e.zmpOrderId||e.orderId)||(t=e.appTransID||e.apptransid||e.transId)),"string"==typeof e&&(r=Tt.getParameterByName("orderId",e),o=Tt.getParameterByName("appTransID",e)||Tt.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,Kt.getAccessToken().catch((function(){throw Wt.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(H),c={orderId:n||"",transId:t||"",appId:i},u.search=new URLSearchParams(c).toString(),[4,fetch(u.toString(),a)];case 2:return[4,f.sent().json()];case 3:if(!(l=f.sent()).data)throw Wt.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,Ve({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Ou=function(){var e=Ce((function(e,t,n,r,o,a,s){var u,c,l,d,p,f,h,m,v,g,y,_,b,w,T,E,I,P,S,O;return xe(this,(function(A){switch(A.label){case 0:u=i,(c=new URLSearchParams).append("amount",e.toString()),c.append("item",encodeURIComponent(JSON.stringify(t))),c.append("appId",u),c.append("mac",r),n&&c.append("desc",encodeURIComponent(n)),o&&(l=o,"object"==typeof o&&(l=JSON.stringify(o)),c.append("extradata",encodeURIComponent(l))),a&&(d=a,"object"==typeof a&&(d=JSON.stringify(a)),c.append("payload",encodeURIComponent(d))),s&&("string"==typeof s?(c.append("method",s),c.append("isCustom","false")):"object"==typeof s&&(c.append("method",s.id),c.append("isCustom",JSON.stringify(s.isCustom)))),p={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},A.label=1;case 1:return A.trys.push([1,6,,7]),[4,Kt.getAccessToken().catch((function(){throw Wt.error.loginRequired}))];case 2:return f=A.sent(),p.headers.authorization="Bearer ".concat(f),[4,fetch(F,qo(Ve({method:"POST"},p),{body:c}))];case 3:return[4,A.sent().json()];case 4:if(!(h=A.sent()).data||0!==h.err)throw Wt.error.badRequest(h.msg);return m=h.data.id,v=h.data.jwt,g=h.data.messageToken||"",y=window.APP_VERSION,_=window.APP_ENV,b={miniAppId:u,orderId:m},w=h.data.method,T=h.data.isCustom,v&&(b.token=v),y&&(b.version=y),_&&(b.env=_),w&&(b.method=w),T&&(b.isCustom=T),E=Tt.encode(b),I=new URL("?".concat(E),"https://payment-mini.zalo.me").toString(),P=Rt(),S=Mt()&&P<742?"normal":"bottomSheet",mt.enablePaymentDone=_t.getInstance().eventNames().includes(re.PaymentDone),[4,ys(I,{style:S}).then((function(){var e=!1;_t.getInstance().once(re.WebviewClosed,(function(){setTimeout(Ce((function(){var t;return xe(this,(function(n){switch(n.label){case 0:return e?[3,2]:(_t.getInstance().emit(re.PaymentDone,m,{orderId:m}),[4,Su({zmpOrderId:m})]);case 1:(t=n.sent()).err>=0&&!t.isCustom&&_t.getInstance().emit(re.PaymentClose,t.err,qo(Ve({},t),{zmpOrderId:m})),n.label=2;case 2:return[2]}}))})),500)})),_t.getInstance().once(re.OpenApp,(function(){e=!0})),_t.getInstance().once(re.PaymentDone,(function(){e=!0,mt.enablePaymentDone=!1}))}))];case 5:return A.sent(),[2,{orderId:m,messageToken:g}];case 6:throw O=A.sent(),console.log("Internal error"),O;case 7:return[2]}}))}));return function(t,n,r,i,o,a,s){return e.apply(this,arguments)}}(),Au=[Yr({amount:_i.union([Lr(),jr()]),item:_i.array(_i.record(Lr(),_i.any())),desc:_i.string(),mac:_i.string(),extradata:_i.any().optional(),payload:_i.any().optional(),method:_i.union([_i.string(),_i.object({id:_i.string(),isCustom:_i.boolean()})]).optional()})];function Cu(e){return Nu.apply(this,arguments)}function Nu(){return Nu=Ce((function(e){return xe(this,(function(t){return[2,ln("createOrder",Au,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ou(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 We.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Ge("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Nu.apply(this,arguments)}var ku=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),Mu=function(){var e=Ce((function(e,t,n,r,o){var a,s,u,c,l,d,p,f,h,m,v,g;return xe(this,(function(y){switch(y.label){case 0:a=i,(s=new URLSearchParams).append("amount",e.toString()),s.append("appId",a),t&&s.append("desc",encodeURIComponent(t)),n&&s.append("method",n),r&&s.append("transId",r),o&&s.append("mac",o),u={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},y.label=1;case 1:return y.trys.push([1,10,,11]),[4,Kt.getAccessToken().catch((function(){throw Wt.error.loginRequired}))];case 2:return l=y.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,Kt.jumpAndGetToken()];case 3:if(y.sent(),d=null===(c=Kt.miniProgramConfig)||void 0===c?void 0:c.showConfirmToPayment,console.log("showConfirmToPayment",d),!d)return[3,7];y.label=4;case 4:return y.trys.push([4,6,,7]),[4,ku()];case 5:return y.sent(),[3,7];case 6:throw p=y.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(V,qo(Ve({method:"POST"},u),{body:s}))];case 8:return[4,y.sent().json()];case 9:if(!(f=y.sent()).data||0!==f.err)throw Wt.error.badRequest(f.msg);return h=f.data.id,m=f.data.messageToken||"",v=f.data.transId||"",[2,{orderId:h,messageToken:m,transId:v}];case 10:throw g=y.sent(),console.log("Internal error"),g;case 11:return[2]}}))}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),Ru=[Yr({amount:_i.union([_i.string(),_i.number()]),desc:_i.string(),method:_i.string(),transId:_i.string().optional(),mac:_i.string().optional()})];function xu(e){return Du.apply(this,arguments)}function Du(){return Du=Ce((function(e){return xe(this,(function(t){return[2,ln("purchase",Ru,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Mu(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 We.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Ge("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Du.apply(this,arguments)}var Uu=function(){var e=Ce((function(e,t){return xe(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;Gt("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)}}(),Lu=[Yr({channels:Qr(Yr({method:Lr(),subMethod:Lr().optional(),subInfo:Lr().optional()})).optional(),selectedMethod:Yr({method:Lr(),subMethod:Lr().optional()}).optional()}).optional()];function ju(e){return Bu.apply(this,arguments)}function Bu(){return Bu=Ce((function(e){return xe(this,(function(t){return[2,ln("selectPaymentMethod",Lu,[e],function(){var e=Ce((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return We.isMp?(t=e.channels,n=e.selectedMethod,[4,Uu(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Ge("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bu.apply(this,arguments)}var Zu=[Yr({data:_i.union([Lr(),_i.record(Lr(),Lr().nullish())])})];function zu(e){return Wu.apply(this,arguments)}function Wu(){return Wu=Ce((function(e){return xe(this,(function(t){return[2,ln("checkTransaction",Zu,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Su(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Ge("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wu.apply(this,arguments)}var Fu=function(){var e=Ce((function(e,t,n,r,o,a){var s,u,c,l,d,p,f,h,m,v,g,y,_,b;return xe(this,(function(w){switch(w.label){case 0:d=i,(p=new URLSearchParams).append("payType",t||fe.SUBSCRIPTION),f=he.UNKNOW,n===J&&(f=he.IMMEDIATE_AND_CHARGE_FULL_PRICE),n===K&&(f=he.DEFERRED),p.append("utm",o||"default"),p.append("merchantTransId",a||""),p.append("prorationMode",f.toString()),p.append("appId",d),r&&p.append("method",r),h="",(null===(s=ze())||void 0===s||null===(u=s.platform)||void 0===u?void 0:u.isIOS)?h="ios":(null===(c=ze())||void 0===c||null===(l=c.platform)||void 0===l?void 0:l.isAndroid)&&(h="android"),p.append("os",h),p.append("productId",e),m={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},w.label=1;case 1:return w.trys.push([1,5,,6]),[4,Kt.getAccessToken().catch((function(){throw Wt.error.loginRequired}))];case 2:return v=w.sent(),m.headers.authorization="Bearer ".concat(v),[4,fetch(G,qo(Ve({method:"POST"},m),{body:p}))];case 3:return[4,w.sent().json()];case 4:if(!(g=w.sent()).data||!g.data.store||0!==g.err)throw Wt.error.createIAPOrderFailed(g.err);return y=g.data.store,_=g.data.orderId,[2,new Promise((function(e,t){Gt("IAP_REQUESTPAYMENT",Ve({},y),{success:function(){e({orderId:_})},fail:function(e){t(e)}})}))];case 5:throw b=w.sent(),console.log("Internal error"),b;case 6:return[2]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Gu=[Yr({productId:Lr(),payType:_i.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:_i.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:Lr().optional(),method:_i.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:Lr().optional()})];function Hu(e){return Vu.apply(this,arguments)}function Vu(){return Vu=Ce((function(e){return xe(this,(function(t){return[2,ln("createOrderIAP",Gu,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Fu(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Ge("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vu.apply(this,arguments)}var Ku=[Yr({hide:zr().default(!1).optional()}).optional()];function Ju(e){return qu.apply(this,arguments)}function qu(){return qu=Ce((function(e){return xe(this,(function(t){return[2,ln("setAndroidBottomNavigationBar",Ku,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,wi.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qu.apply(this,arguments)}var Qu=[Yr({hide:zr().default(!1).optional()}).optional()];function Yu(e){return $u.apply(this,arguments)}function $u(){return $u=Ce((function(e){return xe(this,(function(t){return[2,ln("setIOSBottomSafeArea",Qu,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,wi.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$u.apply(this,arguments)}var Xu=[Yr({type:_i.enum(["normal","hidden","transparent"]).default("normal").optional(),color:_i.string().optional()}).optional()];function ec(e){return tc.apply(this,arguments)}function tc(){return tc=Ce((function(e){return xe(this,(function(t){return[2,ln("setStatusBar",Xu,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,wi.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),tc.apply(this,arguments)}var nc=[Yr({headerTextColor:_i.enum(["black","white"]).optional(),headerColor:_i.string().optional(),actionBar:Yr({hide:_i.boolean().optional(),title:_i.string().optional(),leftButton:_i.enum(["back","none"]).optional(),textAlign:_i.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:_i.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:_i.boolean().optional(),hideIOSSafeAreaBottom:_i.boolean().optional()})];function rc(e){return ic.apply(this,arguments)}function ic(){return ic=Ce((function(e){return xe(this,(function(t){return[2,ln("configAppView",nc,[e],function(){var e=Ce((function(e){var t,n,r,i,o,a,s;return xe(this,(function(u){switch(u.label){case 0:return We.isMp?tt.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,wi.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return tt.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,wi.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,wi.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,wi.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,wi.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 We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ic.apply(this,arguments)}var oc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ac(e){return sc.apply(this,arguments)}function sc(){return(sc=Ce((function(e){return xe(this,(function(t){return[2,ln("minimizeApp",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,oc()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var uc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function cc(e){return lc.apply(this,arguments)}function lc(){return(lc=Ce((function(e){return xe(this,(function(t){return[2,ln("openPermissionSetting",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,uc()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var dc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function pc(e){return fc.apply(this,arguments)}function fc(){return(fc=Ce((function(e){return xe(this,(function(t){return[2,ln("favoriteApp",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,dc()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var hc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function mc(e){return vc.apply(this,arguments)}function vc(){return(vc=Ce((function(e){return xe(this,(function(t){return[2,ln("openGroupList",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,hc()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var gc=Ce((function(){var e;return xe(this,(function(t){switch(t.label){case 0:return[4,Kt.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){Gt("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function yc(e){return _c.apply(this,arguments)}function _c(){return(_c=Ce((function(e){return xe(this,(function(t){return[2,ln("requestSendNotification",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,gc()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var bc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function wc(e){return Tc.apply(this,arguments)}function Tc(){return(Tc=Ce((function(e){return xe(this,(function(t){return[2,ln("addRating",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,bc()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ge("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var Ec,Ic=(Ec=Ce((function(e,t,n){var r,i;return xe(this,(function(o){switch(o.label){case 0:return(r=new URLSearchParams).append("appId",t),r.append("accessToken",n),r.append("oaId",e),i={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.CHECK_INTERACT_OA,Ve({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return Ec.apply(this,arguments)}),Pc=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){Gt("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)}}(),Sc=[Yr({oaId:Lr()})];function Oc(e){return Ac.apply(this,arguments)}function Ac(){return Ac=Ce((function(e){return xe(this,(function(t){return[2,ln("interactOA",Sc,[e],function(){var e=Ce((function(e){var t,n,r;return xe(this,(function(o){switch(o.label){case 0:return We.isMp?(t=e.oaId,[4,Kt.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||tt.isEmpty(n)?[3,3]:[4,Ic(t,i,n)];case 2:if(0===(null==(r=o.sent())?void 0:r.err))return[2,Promise.resolve({})];o.label=3;case 3:return[4,Pc(t)];case 4:return[2,o.sent()];case 5:return We.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ge("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ac.apply(this,arguments)}var Cc=[Yr({oaId:Lr()})];function Nc(e){return kc.apply(this,arguments)}function kc(){return kc=Ce((function(e){return xe(this,(function(t){return[2,ln("isAllowedInteractWithOA",Cc,[e],function(){var e=Ce((function(e){var t,n,r;return xe(this,(function(o){switch(o.label){case 0:return We.isMp?(t=e.oaId,[4,Kt.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||tt.isEmpty(n)?[3,3]:[4,Ic(t,i,n)];case 2:return r=o.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return We.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Ge("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),kc.apply(this,arguments)}function Mc(e){return Rc.apply(this,arguments)}function Rc(){return(Rc=Ce((function(e){return xe(this,(function(t){return[2,ln("getSetting",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Zt()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Ge("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var xc=_i.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Dc=[Yr({scopes:_i.array(xc).max(2).optional()}).optional()];function Uc(e){return Lc.apply(this,arguments)}function Lc(){return Lc=Ce((function(e){return xe(this,(function(t){return[2,ln("authorize",Dc,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return We.isMp?(t=null==e?void 0:e.scopes,xt(724,573)?[2,Promise.reject(Wt.error.clientNotSupport())]:[4,Ht(null!=t?t:void 0)]):[3,2];case 1:return[2,n.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ge("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Lc.apply(this,arguments)}var jc=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n;return xe(this,(function(r){switch(r.label){case 0:return tt.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(Wt.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Bc(e){return ln("checkZaloCameraPermission",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return[4,jc()];case 1:return[2,e.sent()]}}))})))}var Zc=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n,r,i;return xe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Kt.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=Kt.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 zc(e){return Wc.apply(this,arguments)}function Wc(){return(Wc=Ce((function(e){return xe(this,(function(t){return[2,ln("getUserID",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Zc()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ge("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var Fc=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n,r,i;return xe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Kt.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=Kt.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 Gc(e){return Hc.apply(this,arguments)}function Hc(){return(Hc=Ce((function(e){return xe(this,(function(t){return[2,ln("getIDToken",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Fc()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ge("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Vc={format:Te.JPEG,quality:Ee.NORMAL,mirrored:!1,useVideoSourceSize:!1},Kc={width:1024,height:768,facingMode:we.FRONT,mirrored:!1,audio:!1,video:!0},Jc=function(){function e(t){var n,r,i,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=this;nt(this,e),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(u.haveVideoStream()&&u._userRequestFrameCallback){var e=u.getCanvas();if(u.drawFrame(),e){var t={data:e.toDataURL(Te.PNG),width:e.width,height:e.height};_t.getInstance().emit(be.OnFrameCallback,0,t),requestAnimationFrame(u.tick)}}},this._videoElement=t,this._mediaConstraints=null!=s?s:null,this._facingMode=null!==(n=null==s?void 0:s.facingMode)&&void 0!==n?n:Kc.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(r=null==s?void 0:s.deviceId)&&void 0!==r?r:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(i=null==s?void 0:s.mirrored)&&void 0!==i?i:Kc.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(o=null==s?void 0:s.audio)&&void 0!==o?o:Kc.audio,this._videoEnabled=null!==(a=null==s?void 0:s.video)&&void 0!==a?a:Kc.video}var t=e.prototype;return t.on=function(e,t){_t.getInstance().on(e,(function(e){t(e)})),e===be.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},t.off=function(e){_t.getInstance().off(e),e===be.OnFrameCallback&&(this._userRequestFrameCallback=!1)},t.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},t.getFacingMode=function(){return this._facingMode},t.getCameraList=function(){return this._cameraList},t.getCameraCount=function(){return this._cameraList.length},t.getSelectedDeviceId=function(){return this._selectedDeviceId},t.setDeviceId=function(e){var t=this;return Ce((function(){return xe(this,(function(n){switch(n.label){case 0:return t._selectedDeviceId=e,t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},t.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},t.updateMediaConstraints=function(e){var t=this;return Ce((function(){var n,r,i,o,a,s;return xe(this,(function(u){switch(u.label){case 0:return tt.isEmpty(e)?[2]:JSON.stringify(e)!==JSON.stringify(t._mediaConstraints)?(t._mediaConstraints=e,t._facingMode=null!==(n=null==e?void 0:e.facingMode)&&void 0!==n?n:t._facingMode,t._selectedDeviceId=null!==(r=null==e?void 0:e.deviceId)&&void 0!==r?r:t._selectedDeviceId,t._mirror=null!==(i=null==e?void 0:e.mirrored)&&void 0!==i?i:t._mirror,t._audioEnabled=null!==(o=null==e?void 0:e.audio)&&void 0!==o?o:t._audioEnabled,t._videoEnabled=null!==(a=null==e?void 0:e.video)&&void 0!==a?a:t._videoEnabled,t._selectedDeviceId=null!==(s=null==e?void 0:e.deviceId)&&void 0!==s?s:t._selectedDeviceId,t._hasUserMedia?[4,t.stream()]:[3,2]):[2];case 1:u.sent(),u.label=2;case 2:return[2]}}))}))()},t.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||Kc.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||Kc.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},t.selectCamera=function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._cameraList[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;if(this._facingMode==we.FRONT&&o.label.toLowerCase().includes("front")||this._facingMode==we.BACK&&o.label.toLowerCase().includes("back")){this._selectedDeviceId=o.deviceId;break}}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}},t.flip=function(){var e=this;return Ce((function(){return xe(this,(function(t){switch(t.label){case 0:return e._facingMode=e._facingMode==we.FRONT?we.BACK:we.FRONT,e._videoElement.style.transform="",e.selectCamera(),e._hasUserMedia?[4,e.stream()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))()},t.start=function(){var e=this;return Ce((function(){var t,n;return xe(this,(function(r){return t=_t.getInstance(),n=function(t){try{e._hasUserMedia&&e.stop()}catch(e){}},t.off(re.AppPaused,n),t.on(re.AppPaused,n),[2,new Promise(function(){var t=Ce((function(t,n){var r;return xe(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e.stream()];case 1:return i.sent(),_t.getInstance().emit(be.OnStartCallback,0),t(e._selectedDeviceId),[3,3];case 2:return r=i.sent(),n(r),[3,3];case 3:return[2]}}))}));return function(e,n){return t.apply(this,arguments)}}())]}))}))()},t.info=function(){var e=this;return Ce((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){navigator.mediaDevices.enumerateDevices().then((function(n){e.getVideoInputs(n),t(e._cameraList)})).catch((function(e){n(e)}))}))]}))}))()},t.stream=function(){var e=this;return Ce((function(){return xe(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=Ce((function(n){return xe(this,(function(r){switch(r.label){case 0:return[4,e.info()];case 1:return r.sent(),e.selectCamera(),e.handleUserMedia(null,n),t(e._facingMode),[2]}}))}));return function(e){return n.apply(this,arguments)}}()).catch((function(t){e.handleUserMedia(t),n(t)}))}catch(e){n(e)}}))]}))}))()},t.handleUserMedia=function(e,t){var n=this;if(!e&&t){this._stream=t;try{this._videoElement&&(this._videoElement.srcObject=t,(this._facingMode==we.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){n._userRequestFrameCallback&&n.tick()},this._videoElement.play().then((function(){n._hasUserMedia=!0})).catch((function(e){n._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},t.updateTrackEnable=function(e,t){var n=this;return Ce((function(){return xe(this,(function(r){switch(r.label){case 0:if(e===Ie.VIDEO){if(n._videoEnabled===t)return[2];n._videoEnabled=t}else{if(n._audioEnabled===t)return[2];n._audioEnabled=t}return[4,n.stream()];case 1:return r.sent(),[2]}}))}))()},t.pause=function(e){var t=this;return Ce((function(){return xe(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},t.resume=function(e){var t=this;return Ce((function(){return xe(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},t.isUsing=function(){return this._hasUserMedia},t.stop=function(){this._stop(),_t.getInstance().emit(be.OnStopCallback,0)},t._stop=function(){e.stopMediaStream(this._stream),this._hasUserMedia=!1},t.setFacingMode=function(e){this._facingMode=e},t.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},t.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||Vc.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},t.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},t.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},t.drawFrame=function(e){var t=this._videoElement,n=e||{};if(t&&this._ctx&&this._canvasElement){var r=this._canvasElement,i=this._ctx;r.width=(null==n?void 0:n.width)||r.width,r.height=(null==n?void 0:n.height)||r.height,((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===we.FRONT)&&(i.translate(r.width,0),i.scale(-1,1)),i.drawImage(t,0,0,r.width,r.height),((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===we.FRONT)&&(i.scale(-1,1),i.translate(-r.width,0))}},e.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},e}(),qc=Yr({play:_i.function(),pause:_i.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),Qc=[Yr({videoElement:qc,mediaConstraints:_i.object({width:_i.number().min(100).optional(),height:_i.number().min(100).optional(),facingMode:_i.string().optional(),audio:_i.boolean().optional(),video:_i.boolean().optional(),deviceId:_i.string().optional(),mirrored:_i.boolean().optional()}).nullish()}).optional()];function Yc(e){return ln("createCameraContext",Qc,[e],(function(e){return new Jc(e.videoElement,e.mediaConstraints)}))}var $c=function(){function e(){var t,n;nt(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=Re(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;tt.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?tt.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?tt.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 Xc(e){return el.apply(this,arguments)}function el(){return(el=Ce((function(e){return xe(this,(function(t){return[2,ln("setupAd",[],[e],(function(){return $c.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var tl=[Yr({ids:_i.union([_i.string(),_i.array(_i.string())]),config:Yr({display:_i.boolean().optional(),onClose:_i.function().optional()}).optional()})];function nl(e){return rl.apply(this,arguments)}function rl(){return rl=Ce((function(e){return xe(this,(function(t){return[2,ln("loadAd",tl,[e],function(){var e=Ce((function(e){return xe(this,(function(t){return $c.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rl.apply(this,arguments)}var il=[Yr({id:_i.string()})];function ol(e){return al.apply(this,arguments)}function al(){return al=Ce((function(e){return xe(this,(function(t){return[2,ln("displayAd",il,[e],function(){var e=Ce((function(e){return xe(this,(function(t){return $c.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),al.apply(this,arguments)}var sl=[Yr({id:_i.string().optional()}).optional()];function ul(e){return cl.apply(this,arguments)}function cl(){return cl=Ce((function(e){return xe(this,(function(t){return[2,ln("refreshAd",sl,[e],function(){var e=Ce((function(e){return xe(this,(function(t){return $c.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cl.apply(this,arguments)}var ll,dl=[Yr({id:Lr(),guidingText:Lr().optional(),color:Lr().optional(),onStatusChange:_i.function().optional(),onError:_i.function().optional()}).catchall(_i.any())];function pl(e){return fl.apply(this,arguments)}function fl(){return fl=Ce((function(t){return xe(this,(function(n){return[2,ln("showOAWidget",dl,[t],function(){var t=Ce((function(t){var n,r,i,o,a,s,u,c;return xe(this,(function(l){if(We.isMp){try{n=document.getElementById(t.id),r=t.onStatusChange,i=t.guidingText,o=t.color,a=e(t,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="ifOAW-".concat(t.id,"-").concat(Date.now()),(c=new URL(Oe.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=Ke(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",ll,!1),ll=function(){var e=Ce((function(e){var t,n,i,o,a,s,l,d;return xe(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith(Se)?(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,Kt.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=Kt.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},Se),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?zo(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",ll,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("showOAWidget",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),fl.apply(this,arguments)}var hl,ml=[_i.object({id:_i.string(),type:_i.string(),text:_i.string(),color:_i.string().optional(),disabled:_i.boolean().optional(),onDataReceived:_i.function().optional(),onError:_i.function().optional()}).catchall(_i.any())];function vl(e){return gl.apply(this,arguments)}function gl(){return gl=Ce((function(t){return xe(this,(function(n){return[2,ln("showFunctionButtonWidget",ml,[t],function(){var t=Ce((function(t){var n,r,i,o,a,s,u;return xe(this,(function(c){if(We.isMp){try{n=document.getElementById(t.id),r=t.onDataReceived,i=t.onError,o=e(t,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="ifFBW-".concat(t.id,"-").concat(Date.now()),(u=new URL(Oe.FUNCTION_BUTTON)).searchParams.set("id",s),u.searchParams.set("appId",window.APP_ID),Object.entries(o).forEach((function(e){var t=Ke(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=Ke(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=Ce((function(e){var t,n,a,c,l,d,p,f,h,m,v,g,y;return xe(this,(function(_){switch(_.label){case 0:return t=e.data,e.origin.startsWith(Se)?(n=document.getElementById(s),a=t.type,(c=new URL(t.href)).origin!==u.origin||c.pathname!==u.pathname||t.id!==s?[3,4]:"buttonClicked"!==a?[3,3]:[4,Kt.jumpAndGetToken()]):[3,4];case 1:return _.sent(),f=null===(l=Kt.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=Kt.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,fn()];case 2:return m=_.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},Se),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(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}},Se)}},null==r||r.apply(void 0,Re(Object.values(v)).concat([g]))):"onError"===a&&(null==(y=t.payload)?void 0:y.type)===o.type&&(null==i||i(null==y?void 0:y.data)),_.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",hl,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("showFunctionButtonWidget",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),gl.apply(this,arguments)}var yl=function(){var e=Ce((function(e,t){var n;return xe(this,(function(r){return n={},"cccd"===e&&(n={mrz:null==t?void 0:t.mrz}),[2,new Promise((function(t,r){Gt("SCAN_NFC",{type:ue[e],data:n},{success:function(n){if("cccd"===e){var r,i,o,a,s,u,c,l,d,p,f,h,m,v,g,y,_,b,w,T,E,I={dg1:null!==(r=n.dg1)&&void 0!==r?r:"",dg2:null!==(i=n.dg2)&&void 0!==i?i:"",dg3:null!==(o=n.dg3)&&void 0!==o?o:"",dg4:null!==(a=n.dg4)&&void 0!==a?a:"",dg5:null!==(s=n.dg5)&&void 0!==s?s:"",dg6:null!==(u=n.dg6)&&void 0!==u?u:"",dg7:null!==(c=n.dg7)&&void 0!==c?c:"",dg8:null!==(l=n.dg8)&&void 0!==l?l:"",dg9:null!==(d=n.dg9)&&void 0!==d?d:"",dg10:null!==(p=n.dg10)&&void 0!==p?p:"",dg11:null!==(f=n.dg11)&&void 0!==f?f:"",dg12:null!==(h=n.dg12)&&void 0!==h?h:"",dg13:null!==(m=n.dg13)&&void 0!==m?m:"",dg14:null!==(v=n.dg14)&&void 0!==v?v:"",dg15:null!==(g=n.dg15)&&void 0!==g?g:"",dg16:null!==(y=n.dg16)&&void 0!==y?y:"",com:null!==(_=n.com)&&void 0!==_?_:"",sod:null!==(b=n.sod)&&void 0!==b?b:"",challenge:null!==(w=n.challenge)&&void 0!==w?w:"",aAResult:null!==(T=n.aAResult)&&void 0!==T?T:"",eACCAResult:null!==(E=n.eACCAResult)&&void 0!==E?E:""};t(I)}else t({})},fail:function(e){r(e)}},{timeout:!1})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),_l=[Yr({type:_i.enum(["cccd"]),data:Yr({mrz:Lr().max(90)})})];function bl(e){return wl.apply(this,arguments)}function wl(){return wl=Ce((function(e){return xe(this,(function(t){return[2,ln("scanNFC",_l,[e],function(){var e=Ce((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return We.isMp?xt(754,620)?[2,Promise.reject(Wt.error.clientNotSupport())]:(t=e.type,n=e.data,[4,yl(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ge("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wl.apply(this,arguments)}var Tl=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){Gt("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function El(e){return Il.apply(this,arguments)}function Il(){return(Il=Ce((function(e){return xe(this,(function(t){return[2,ln("checkNFC",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Tl()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ge("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}var Pl=[_i.string().trim().min(1)];var Sl=[_i.string().trim().min(1),_i.string().trim()];var Ol=[_i.string().trim().min(1)];var Al={getItem:function(e){return ln("getItem",Pl,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(We.isMp||We.isMpWeb){if(xt(757,625))throw Wt.error.clientNotSupport();return Xi.getItem(t[0])}throw Ge("getItem",{})}))},setItem:function(e,t){return ln("setItem",Sl,[e,t],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(We.isMp||We.isMpWeb){if(xt(757,625))throw Wt.error.clientNotSupport();return Xi.setItem(t[0],t[1])}throw Ge("setItem",{})}))},clear:function(){return ln("clear",[],[],(function(){if(We.isMp||We.isMpWeb){if(xt(757,625))throw Wt.error.clientNotSupport();return Xi.clearStorageSync()}throw Ge("clear",{})}))},removeItem:function(e){return ln("removeItem",Ol,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(We.isMp||We.isMpWeb){if(xt(757,625))throw Wt.error.clientNotSupport();return Xi.removeItem(t[0])}throw Ge("removeItem",{})}))},getStorageInfo:function(){return ln("getStorageInfoSync",[],[],(function(){if(We.isMp||We.isMpWeb){if(xt(757,625))throw Wt.error.clientNotSupport();return Xi.getStorageInfoSync()}throw Ge("getStorageInfoSync",{})}))}},Cl={purchase:xu,createOrder:Cu,checkTransaction:zu,createOrderIAP:Hu,selectPaymentMethod:ju},Nl=Cl,kl=function(){var e=Ce((function(e,t){return xe(this,(function(n){return[2,new Promise((function(n,r){Gt("SAVE_FILE",{fileUrl:e,onProgress:t},{success:function(e){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ml=[Yr({url:_i.string().url()}).optional()];function Rl(e){return xl.apply(this,arguments)}function xl(){return xl=Ce((function(e){return xe(this,(function(t){return[2,ln("downloadFile",Ml,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return We.isMp?(t=e.url,[4,kl(t,e.onProgress)]):[3,2];case 1:return[2,n.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("downloadFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xl.apply(this,arguments)}var Dl=_i.enum(["APP_INITIALIZING","APP_READY"]),Ul=_i.any();var Ll,jl={logEvent:function(e,t){return ln("logEvent",[Dl,Ul],[e,t],(function(e,t){if(We.isMp||We.isMpWeb){var n,r,i,o=qo(Ve({},"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:d.DEV_TRACKING,eventCode:"APP_INITIALIZING"===e?p.APP_INITIALIZING:p.APP_READY}),Nt([{action:"zmp.app.lifecycle.tracking",error:0,message:"",data:Ve({eventType:e},o)}])}throw Ge("logEvent",{})}))}},Bl=[Yr({id:Lr(),textColor:_i.string().optional(),fontSize:_i.string().optional(),buttonHeight:_i.string().optional(),buttonColor:_i.string().optional(),buttonTextColor:_i.string().optional(),buttonRadius:_i.string().optional(),buttonText:_i.string().optional(),checkboxBGColor:_i.string().optional(),checkboxCheckmarkColor:_i.string().optional(),onClick:_i.function().optional(),onStatusChange:_i.function().optional(),onError:_i.function().optional()}).catchall(_i.any())];function Zl(e){return zl.apply(this,arguments)}function zl(){return zl=Ce((function(t){return xe(this,(function(n){return[2,ln("showCustomOAWidget",Bl,[t],function(){var t=Ce((function(t){var n,r,i,o,a,s,u,c,l,d,p,f,h,m,v,g,y,_,b,w,T;return xe(this,(function(E){if(We.isMp){try{n=document.getElementById(t.id),r=t.textColor,i=t.fontSize,o=t.buttonHeight,a=t.buttonColor,s=t.buttonTextColor,u=t.buttonRadius,c=t.buttonText,l=t.checkboxBGColor,d=t.checkboxCheckmarkColor,p=t.onStatusChange,f=t.onClick,h=t.onError,m=e(t,["textColor","fontSize","buttonHeight","buttonColor","buttonTextColor","buttonRadius","buttonText","checkboxBGColor","checkboxCheckmarkColor","onStatusChange","onClick","onError"]),n&&(v=document.createElement("iframe"),g="ifCOAW-".concat(t.id,"-").concat(Date.now()),y=new URL(Oe.CUSTOM_OA),_={id:g,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=Ke(e,2),n=t[0],r=t[1];r&&(_["data-".concat(n)]=String(r))})),b=JSON.stringify(_),I=b,P=(new TextEncoder).encode(I),S=Array.from(P).map((function(e){return String.fromCharCode(e)})).join(""),w=btoa(S),T=encodeURIComponent(w),un(y.searchParams,"data",T),v.id=g,v.src=y.href,v.style.width="100%",v.style.height="100%",v.style.border="none",n.innerHTML=v.outerHTML,window.removeEventListener("message",Ll,!1),Ll=function(){var e=Ce((function(e){var t,n,r,i,o,a,s,u,c;return xe(this,(function(l){switch(l.label){case 0:return t=e.data,e.origin.startsWith(Se)?(n=document.getElementById(g),r=t.type,(i=new URL(t.href)).origin!==y.origin||i.pathname!==y.pathname||t.id!==g?[3,3]:"followOA"!==r&&"getOAInfo"!==r?[3,2]:[4,Kt.jumpAndGetToken()]):[3,3];case 1:return l.sent(),s=null===(o=Kt.miniProgramConfig)||void 0===o?void 0:o.jwt,null==n||null===(a=n.contentWindow)||void 0===a||a.postMessage({type:r,payload:{jwt:s}},Se),[3,3];case 2:"oaInfo"===r?null==p||p(null===(u=t.payload)||void 0===u?void 0:u.followed):"openOA"===r?zo(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",Ll,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}var I,P,S;return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("showCustomOAWidget",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),zl.apply(this,arguments)}var Wl,Fl=[Yr({id:Lr(),onMethodChange:_i.function().optional()}).catchall(_i.any())];function Gl(){return Gl=Ce((function(t){return xe(this,(function(n){return[2,ln("showWidget",Fl,[t],function(){var t=Ce((function(t){var n,r,i,o,a,s,u,c,l,d,p;return xe(this,(function(f){if(We.isMp){try{n=document.getElementById(t.id),r=t.onMethodChange,i=t.fail,o=e(t,["onMethodChange","fail"]),n&&((a=document.getElementById(Pe))&&(document.body.removeChild(a),a=null),a=document.createElement("iframe"),s=Pe,u=new URL(Oe.CHECKOUT_KIT),c={id:s,appId:window.APP_ID},Object.entries(o).forEach((function(e){var t=Ke(e,2),n=t[0],r=t[1];r&&(c["data-".concat(n)]=r)})),l=JSON.stringify(c),d=btoa(l),p=encodeURIComponent(d),un(u.searchParams,"data",p),a.id=s,a.src=u.href,a.style.width="100%",a.style.height="100%",a.style.border="none",n.innerHTML=a.outerHTML,window.removeEventListener("message",Wl,!1),Wl=function(){var e=Ce((function(e){var t,n,o,a,c,l,d,p,f,h;return xe(this,(function(m){switch(m.label){case 0:if(t=e.data,!e.origin.startsWith(Se))return[3,9];if(n=t.type,o=document.getElementById(s),(a=new URL(t.href)).origin!==u.origin||a.pathname!==u.pathname||t.id!==s)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 cn(o,n,{appId:window.APP_ID,zaloVersion:Rt(),appPlatform:null===(c=ze())||void 0===c?void 0:c.platformName}),[3,9];case 2:return[4,Kt.jumpAndGetToken()];case 3:return m.sent(),d=null===(l=Kt.miniProgramConfig)||void 0===l?void 0:l.jwt,cn(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&&Gt(f,h,{success:function(e){cn(o,n,{status:0,actionName:f,data:e})},fail:function(e){cn(o,n,{status:-1,actionName:f,data:e})}},{}),[3,9];case 6:return null==r||r.apply(void 0,Re(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",Wl,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("showWidget",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),Gl.apply(this,arguments)}var Hl,Vl=[Yr({amount:_i.union([_i.string(),_i.number()]),desc:_i.string(),payload:_i.object({}).catchall(_i.any()).optional()}).catchall(_i.any())];function Kl(){return Kl=Ce((function(t){return xe(this,(function(n){return[2,ln("purchase",Vl,[t],function(){var t=Ce((function(t){return xe(this,(function(n){return We.isMp?[2,new Promise((function(n,r){var i=document.getElementById(Pe),o=new URL(Oe.CHECKOUT_KIT);if(!(i&&Dt(i,HTMLIFrameElement)&&i.src.startsWith(o.origin)&&i.src.includes(o.pathname)))return r(Ge("purchase",{message:"Widget not found or not initialized."}));var a=e(t,["amount","desc","payload"]),s="purchase";cn(i,s,Ve({amount:String(t.amount),desc:t.desc,payload:t.payload||{}},a)),window.removeEventListener("message",Hl,!1),Hl=function(){var e=Ce((function(e){var t,i,a;return xe(this,(function(u){if(t=e.data,e.origin.startsWith(Se)&&(i=t.type,(a=new URL(t.href)).origin===o.origin&&a.pathname===o.pathname&&t.id===Pe)){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",Hl,!1)}))]:We.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Ge("purchase",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),Kl.apply(this,arguments)}var Jl={showWidget:function(e){return Gl.apply(this,arguments)},purchase:function(e){return Kl.apply(this,arguments)}};window.ZaloMiniAppSDK={getVersion:gn},dn();var ql=Object.freeze({__proto__:null,get Events(){return re},get EventName(){return re},get CameraEvents(){return be},AppError:Lt,login:dn,getAccessToken:fn,getVersion:gn,getSystemInfo:_n,setNavigationBarTitle:Ei,setNavigationBarColor:Si,setNavigationBarLeftButton:Ci,setStorage:to,getStorage:io,getStorageInfo:ao,removeStorage:co,clearStorage:fo,getUserInfo:go,getNetworkType:wo,onNetworkStatusChange:Io,startBeaconDiscovery:Oo,stopBeaconDiscovery:No,getBeacons:Ro,closeApp:Uo,scanQRCode:Bo,openProfile:Fo,openChat:Ko,openPostFeed:$o,followOA:na,unfollowOA:aa,openShareSheet:da,requestCameraPermission:ha,createShortcut:ba,openBioAuthentication:Ia,checkStateBioAuthentication:Oa,showToast:ka,hideKeyboard:xa,openPhone:ja,openSMS:Wa,viewOAQr:Va,keepScreen:Qa,onKeepScreen:$a,offKeepScreen:es,saveImageToGallery:is,saveVideoToGallery:us,openMiniApp:ps,vibrate:vs,openWebview:bs,getRouteParams:Es,getAppInfo:Is,sendDataToPreviousMiniApp:As,getPhoneNumber:ks,openProfilePicker:Ds,connectWifi:Bs,openMediaPicker:Fs,getShareableLink:Vs,closeLoading:qs,requestUpdateZalo:Ys,onConfirmToExit:tu,offConfirmToExit:nu,getDeviceId:ru,getDeviceIdAsync:iu,getContext:au,getContextAsync:su,getAuthCode:cu,getZPIToken:du,setAccessToken:hu,openOutApp:vu,chooseImage:_u,getLocation:Tu,onCallbackData:Pu,createOrder:Cu,purchase:xu,selectPaymentMethod:ju,checkTransaction:zu,createOrderIAP:Hu,events:Xs,setAndroidBottomNavigationBar:Ju,setIOSBottomSafeArea:Yu,setStatusBar:ec,configAppView:rc,minimizeApp:ac,openPermissionSetting:cc,favoriteApp:pc,openGroupList:mc,requestSendNotification:yc,addRating:wc,interactOA:Oc,interactOa:Oc,isAllowedInteractWithOA:Nc,getSetting:Mc,authorize:Uc,checkZaloCameraPermission:Bc,getUserID:zc,getIDToken:Gc,createCameraContext:Yc,setupAd:Xc,loadAd:nl,displayAd:ol,refreshAd:ul,showOAWidget:pl,showFunctionButtonWidget:vl,scanNFC:bl,checkNFC:El,nativeStorage:Al,Payment:Cl,CheckoutSDK:Nl,downloadFile:Rl,trackingManager:jl,showCustomOAWidget:Zl,CheckoutKit:Jl,get FacingMode(){return we},get PhotoFormat(){return Te},get PhotoQuality(){return Ee},get StreamType(){return Ie},ZMACameraImp:Jc}),Ql=e(ql,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]);!function(){var e,t=null===(e=ze())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,ql))}();export{ve as AndroidBottomNavigationBarType,Lt as AppError,be as CameraEvents,ae as ChatType,Jl as CheckoutKit,Nl as CheckoutSDK,re as EventName,re as Events,we as FacingMode,fe as IAPPayType,ge as IOSSafeAreaBottomType,ie as JumpStatus,pe as MediaPickerType,te as NetworkType,_e as OpenProfilePickerType,le as OrientationType,Cl as Payment,Te as PhotoFormat,Ee as PhotoQuality,ne as PlatformType,se as PostFeedType,oe as ProfileType,he as ProrationMode,ue as ScanNFCType,ce as ShareSheetType,me as StatusBarType,Ie as StreamType,ye as TextAlignType,de as VibrateType,Jc as ZMACameraImp,wc as addRating,Uc as authorize,El as checkNFC,Oa as checkStateBioAuthentication,zu as checkTransaction,Bc as checkZaloCameraPermission,_u as chooseImage,fo as clearStorage,Uo as closeApp,qs as closeLoading,rc as configAppView,Bs as connectWifi,Yc as createCameraContext,Cu as createOrder,Hu as createOrderIAP,ba as createShortcut,Ql as default,ol as displayAd,Rl as downloadFile,Xs as events,pc as favoriteApp,na as followOA,fn as getAccessToken,Is as getAppInfo,cu as getAuthCode,Ro as getBeacons,au as getContext,su as getContextAsync,ru as getDeviceId,iu as getDeviceIdAsync,Gc as getIDToken,Tu as getLocation,wo as getNetworkType,ks as getPhoneNumber,Es as getRouteParams,Mc as getSetting,Vs as getShareableLink,io as getStorage,ao as getStorageInfo,_n as getSystemInfo,zc as getUserID,go as getUserInfo,gn as getVersion,du as getZPIToken,xa as hideKeyboard,Oc as interactOA,Oc as interactOa,Nc as isAllowedInteractWithOA,Qa as keepScreen,nl as loadAd,dn as login,ac as minimizeApp,Al as nativeStorage,nu as offConfirmToExit,es as offKeepScreen,Pu as onCallbackData,tu as onConfirmToExit,$a as onKeepScreen,Io as onNetworkStatusChange,Ia as openBioAuthentication,Ko as openChat,mc as openGroupList,Fs as openMediaPicker,ps as openMiniApp,vu as openOutApp,cc as openPermissionSetting,ja as openPhone,$o as openPostFeed,Fo as openProfile,Ds as openProfilePicker,Wa as openSMS,da as openShareSheet,bs as openWebview,xu as purchase,ul as refreshAd,co as removeStorage,ha as requestCameraPermission,yc as requestSendNotification,Ys as requestUpdateZalo,is as saveImageToGallery,us as saveVideoToGallery,bl as scanNFC,Bo as scanQRCode,ju as selectPaymentMethod,As as sendDataToPreviousMiniApp,hu as setAccessToken,Ju as setAndroidBottomNavigationBar,Yu as setIOSBottomSafeArea,Si as setNavigationBarColor,Ci as setNavigationBarLeftButton,Ei as setNavigationBarTitle,ec as setStatusBar,to as setStorage,Xc as setupAd,Zl as showCustomOAWidget,vl as showFunctionButtonWidget,pl as showOAWidget,ka as showToast,Oo as startBeaconDiscovery,No as stopBeaconDiscovery,jl as trackingManager,aa as unfollowOA,vs as vibrate,Va as viewOAQr};
|