zmp-sdk 2.40.0 → 2.41.0
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/createCameraContext.js +1 -1
- package/apis/apis/scanNFC.js +1 -0
- package/apis/common/apis/general/scanNFC.js +1 -0
- package/apis/common/call/index.js +1 -1
- package/apis/constants.js +1 -1
- package/apis/index.d.ts +80 -1
- package/apis/index.es.js +1 -1
- package/apis/index.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 +84 -1
- package/index.es.js +2 -2
- package/index.js +2 -2
- package/index.umd.js +3 -3
- package/package.json +1 -1
package/browser.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @timeBuild
|
|
2
|
+
* @timeBuild 24-09-2024 11:08:48
|
|
3
3
|
* @license zmp-sdk
|
|
4
4
|
*
|
|
5
5
|
* Copyright @ 2024. Zalo Group.
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(){"use strict";function e(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var t,n=1048576,r=window.zAppID,i=window.APP_ID,o="https://zalo.me/s",a="https://h5.zdn.vn/zapps",s="h5.zdn.vn",u="/zapps",c={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSION:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType",UTOKEN_ZPI:"h5.zdn.vn_utoken_zpi",GTOKEN_ZPI:"h5.zdn.vn_gtoken_zpi",ZPP_ZPI:"h5.zdn.vn_zpp_zpi",ZPT_ZPI:"h5.zdn.vn_zpt_zpi"},l={GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token",GET_LIST_USER_INFO:"https://graph.zalo.me/v2.0/me/friends/list",CREATE_ORDER:"https://payment-mini.zalo.me/api/order/create",GET_APP_INFO:"https://h5.zalo.me/apps/get-info",SEND_ACTION_LOG:"https://h5.zalo.me/log/async",CREATE_SHARE_LINK:"https://h5.zalo.me/openapi/create-sharelink",CHECK_INTERACT_OA:"https://h5.zalo.me/openapi/check-interact-oa",GET_AUTH_SETTING:"https://h5.zalo.me/apis/users/auth-settings"};!function(e){e.REQUEST="REQUEST",e.MODIFIED_REQUEST="MODIFIED_REQUEST",e.RESPONSE="RESPONSE",e.MODIFIED_RESPONSE="MODIFIED_RESPONSE",e.NOT_FOUND="NOT_FOUND"}(t||(t={}));var d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,O,A,I,k,C,N,M,R=0,x=-2e3,U=-1400,D=-1500,j=-1401,L=-1404,B=-1408,Z=-1409,z=-2004,W=-2005,F="Success",G="Unknown error. Please try again later.",H="Request limit exceeded. Please try again later.",V="Request timeout. Please try again later.",K="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",J="Login failed",q="This API is not supported in this version of Zalo",Q="User Authentication Required. Please grant User Authentication permission before requesting User Permission",$="Unable to pick media",Y="Unable to save image",X={SUCCESS:{code:R,message:F},UNKNOWN_ERROR:{code:x,message:G},UNAUTHORIZED:{code:j,message:K},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:L,message:q},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:B,message:V},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."}},ee={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:{}},te={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:X.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:X.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:X.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:X.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:X.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:X.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:X.USER_DENIED}},iOS:{"-2":{mapTo:X.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:X.USER_DENIED},"-400":{mapTo:X.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:X.USER_DENIED},"-400":{mapTo:X.DUPLICATE_REQUEST}}}},QUERY_LOCATION_HIDE:{haveCallback:!0},SHOW_TOAST:{haveCallback:!0,timeout:2},OPEN_APP:{},HIDE_KEYBOARD:{},OPEN_PHONE:{},OPEN_QR:{},OPEN_SMS:{},VIEW_MYQR:{haveCallback:!0,timeout:!0,requireAccessToken:!0},KEEP_SCREEN:{haveCallback:!0,timeout:2},CHANGE_AUTOROTATE:{skipJump:!0},CHECK_APP_INSTALLED:{},QUERY_SHOW:{},QUERY_HIDE:{},OPEN_INAPPRW:{},ZALORUN_GETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_SETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_GETDAYSTEP:{haveCallback:!0},ZALORUN_FORCESUBMITDATA:{haveCallback:!0},ZALORUN_SETWEIGHT:{haveCallback:!0},OPEN_PROFILE_EXT:{},DOWNLOAD_CATE:{haveCallback:!0},JUMP_LOGIN:{skipJump:!0,whiteList:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{},OPEN_ADTIMA_ADS:{},GET_ADIDCLIENT:{},SCAN_IBEACON:{},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:W,message:Y},needMoreDetail:!0},"-102":{mapTo:{code:W,message:Y},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:W,message:Y},needMoreDetail:!0}}}},OPEN_MP:{versionLive:{iOS:402}},CHANGE_ACTIONBAR:{haveCallback:!0,timeout:2,versionLive:{iOS:402},skipJump:!0},ZBROWSER_MPDS:{haveCallback:!0,timeout:2,versionLive:{iOS:402}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:X.USER_DENIED},"-101":{mapTo:X.USER_DENIED},"-400":{mapTo:X.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:X.USER_DENIED},"-10":{mapTo:X.USER_DENIED},"-400":{mapTo:X.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:X.USER_CANCEL}},iOS:{"-101":{mapTo:X.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:X.USER_CANCEL},999:{mapTo:{code:z,message:$},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:z,message:$}}}}},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:X.USER_DENIED},"-400":{mapTo:X.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:X.USER_DENIED},"-400":{mapTo:X.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:X.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:X.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:X.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:X.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1}},ne={android:{"-4":X.DECODE_FAILED,"-5":X.CLIENT_NOT_SUPPORT,"-14":X.TIME_OUT},iOS:{"-9":X.DECODE_FAILED,"-5":X.CLIENT_NOT_SUPPORT,"-14":X.TIME_OUT}},re={android:12100615,iOS:460,wp:0,unknown:0},ie=5*n,oe="https://payment-mini.zalo.me/api/order/create",ae="https://payment-mini.zalo.me/api/order/iap-create",se="https://payment-mini.zalo.me/api/transaction",ue="https://payment-mini.zalo.me/api/order/purchase",ce="DEFERRED",le="IMMEDIATE_AND_CHARGE_FULL_PRICE",de={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},pe=5,fe=6,he="#1843EF",me=0,ve={"-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 ye(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 ge(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ye(o,r,i,a,s,"next",e)}function s(e){ye(o,r,i,a,s,"throw",e)}a(void 0)}))}}function _e(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 we(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function be(e,t){if(e){if("string"==typeof e)return _e(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)?_e(e,t):void 0}}function Te(e){return function(e){if(Array.isArray(e))return _e(e)}(e)||we(e)||be(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 Ee(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 Pe(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,Te(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Se(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")}}Pe.async=function(e){return ge((function(){var t,n,r,i,o=arguments;return Ee(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,Te(n))];case 2:return[2,a.sent()];case 3:return i=a.sent(),"undefined"!=typeof console&&console.error&&console.error(i),[2,null];case 4:return[2]}}))}))},function(e){e.none="none",e.wifi="wifi",e.cellular="cellular",e.unknown="unknown"}(d||(d={})),function(e){e.wp="wp",e.android="android",e.iOS="iOS",e.unknown="unknown"}(p||(p={})),function(e){e.AppPaused="h5.event.paused",e.AppResumed="h5.event.resumed",e.NetworkChanged="h5.event.connection.changed",e.OnDataCallback="h5.event.webview.result",e.WebviewClosed="h5.event.webview.close",e.OpenApp="h5.event.open.mp",e.AppClose="h5.event.action.close",e.PaymentCallback="payment.callback",e.PaymentResult="action.payment.result",e.PaymentClose="action.payment.close"}(f||(f={})),function(e){e.DOING="doing",e.DONE="done"}(h||(h={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa",e[e.aliasOA=2]="aliasOA"}(m||(m={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa"}(v||(v={})),function(e){e[e.image=1]="image",e[e.link=4]="link",e[e.profile=5]="profile"}(y||(y={})),function(e){e[e.image=1]="image",e[e.gif=11]="gif",e[e.video=12]="video",e[e.link=4]="link",e[e.oa=5]="oa",e[e.zmp=20]="zmp",e[e.multi_image=21]="multi_image",e[e.zmp_deep_link=4]="zmp_deep_link",e[e.text=22]="text"}(g||(g={})),function(e){e[e.auto=1]="auto",e[e.portrait=2]="portrait",e[e.landscape=3]="landscape"}(_||(_={})),function(e){e[e.oneShot=0]="oneShot"}(w||(w={})),function(e){e[e.zcamera=3]="zcamera",e[e.zcamera_photo=1]="zcamera_photo",e[e.zcamera_video=2]="zcamera_video",e[e.zcamera_scan=7]="zcamera_scan",e[e.photo=4]="photo",e[e.video=5]="video",e[e.file=6]="file"}(b||(b={})),function(e){e.SUBSCRIPTION="SUBSCRIPTION",e.ONETIME="ONETIME"}(T||(T={})),function(e){e[e.UNKNOW=0]="UNKNOW",e[e.DEFERRED=1]="DEFERRED",e[e.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE"}(E||(E={})),function(e){e[e.normal=1]="normal",e[e.hidden=0]="hidden",e[e.transparent=2]="transparent"}(P||(P={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(S||(S={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(O||(O={})),function(e){e[e.left=0]="left",e[e.center=1]="center"}(A||(A={})),function(e){e.OnFrameCallback="h5.event.camera.frame",e.OnStartCallback="h5.event.camera.start",e.OnStopCallback="h5.event.camera.stop"}(I||(I={})),function(e){e.FRONT="user",e.BACK="environment"}(k||(k={})),function(e){e.WEBP="image/webp",e.PNG="image/png",e.JPEG="image/jpeg"}(C||(C={})),function(e){e.HIGH="high",e.NORMAL="normal",e.LOW="low"}(N||(N={})),function(e){e.VIDEO="video",e.AUDIO="audio"}(M||(M={}));var Oe,Ae=function(e){return e.isAndroid?p.android:e.isIOS?p.iOS:p.unknown};function Ie(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function ke(){var e=function(){var e=Pe((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:Se(),platform:t,platformName:Ae(t),zaloVersion:Ie(e).trim()}}}();if(e)return e}var Ce=(null===(Oe=ke())||void 0===Oe?void 0:Oe.appEnv)||{};function Ne(e){Ne.on&&Ne.engine(e)}Ne.on=!1,Ne.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 Me=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),Ne({stage:t.NOT_FOUND,type:"error",name:e,request:n,state:"fail",response:i})};function Re(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xe(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){Re(e,t,n[t])}))}return e}function Ue(e,t){return function(e){if(Array.isArray(e))return e}(e)||we(e)||be(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var De="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function je(){throw new Error("setTimeout has not been defined")}function Le(){throw new Error("clearTimeout has not been defined")}var Be=je,Ze=Le;function ze(e){if(Be===setTimeout)return setTimeout(e,0);if((Be===je||!Be)&&setTimeout)return Be=setTimeout,setTimeout(e,0);try{return Be(e,0)}catch(t){try{return Be.call(null,e,0)}catch(t){return Be.call(this,e,0)}}}"function"==typeof De.setTimeout&&(Be=setTimeout),"function"==typeof De.clearTimeout&&(Ze=clearTimeout);var We,Fe=[],Ge=!1,He=-1;function Ve(){Ge&&We&&(Ge=!1,We.length?Fe=We.concat(Fe):He=-1,Fe.length&&Ke())}function Ke(){if(!Ge){var e=ze(Ve);Ge=!0;for(var t=Fe.length;t;){for(We=Fe,Fe=[];++He<t;)We&&We[He].run();He=-1,t=Fe.length}We=null,Ge=!1,function(e){if(Ze===clearTimeout)return clearTimeout(e);if((Ze===Le||!Ze)&&clearTimeout)return Ze=clearTimeout,clearTimeout(e);try{Ze(e)}catch(t){try{return Ze.call(null,e)}catch(t){return Ze.call(this,e)}}}(e)}}function Je(e,t){this.fun=e,this.array=t}Je.prototype.run=function(){this.fun.apply(null,this.array)};function qe(){}var Qe=qe,$e=qe,Ye=qe,Xe=qe,et=qe,tt=qe,nt=qe;var rt=De.performance||{},it=rt.now||rt.mozNow||rt.msNow||rt.oNow||rt.webkitNow||function(){return(new Date).getTime()};var ot=new Date;var at,st={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Fe.push(new Je(e,t)),1!==Fe.length||Ge||ze(Ke)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Qe,addListener:$e,once:Ye,off:Xe,removeListener:et,removeAllListeners:tt,emit:nt,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*it.call(rt),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-ot)/1e3}},ut=st,ct="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function lt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function dt(e){return"function"==typeof window.Debug?window.Debug(e):function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n]}}!function(e){!function(t){var n="object"==typeof ct?ct:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),r=i(e);function i(e,t){return function(n,r){"function"!=typeof e[n]&&Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0===n.Reflect?n.Reflect=e:r=i(n.Reflect,r),function(e){var t=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return re(Object.create(null))}:a?function(){return re({__proto__:null})}:function(){return re({})},has:s?function(e,n){return t.call(e,n)}:function(e,t){return t in e},get:s?function(e,n){return t.call(e,n)?e[n]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),l="object"==typeof ut&&ut.env&&"true"===ut.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?te():Set,f=new(l||"function"!=typeof WeakMap?ne():WeakMap);function h(e,t,n,r){if(U(n)){if(!G(e))throw new TypeError;if(!V(t))throw new TypeError;return P(e,t)}if(!G(e))throw new TypeError;if(!L(t))throw new TypeError;if(!L(r)&&!U(r)&&!D(r))throw new TypeError;return D(r)&&(r=void 0),S(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!L(n))throw new TypeError;if(!U(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!L(n))throw new TypeError;return U(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),I(e,t,n)}function _(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),C(e,t,n)}function b(e,t){if(!L(e))throw new TypeError;return U(t)||(t=F(t)),M(e,t)}function T(e,t){if(!L(e))throw new TypeError;return U(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!L(t))throw new TypeError;U(n)||(n=F(n));var r=O(t,n,!1);if(U(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}function P(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!U(r)&&!D(r)){if(!V(r))throw new TypeError;t=r}}return t}function S(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!U(o)&&!D(o)){if(!L(o))throw new TypeError;r=o}}return r}function O(e,t,n){var r=f.get(e);if(U(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(U(i)){if(!n)return;i=new d,r.set(t,i)}return i}function A(e,t,n){if(I(e,t,n))return!0;var r=X(t);return!D(r)&&A(e,r,n)}function I(e,t,n){var r=O(t,n,!1);return!U(r)&&z(r.has(e))}function k(e,t,n){if(I(e,t,n))return C(e,t,n);var r=X(t);return D(r)?void 0:k(e,r,n)}function C(e,t,n){var r=O(t,n,!1);if(!U(r))return r.get(e)}function N(e,t,n,r){O(n,r,!0).set(e,t)}function M(e,t){var n=R(e,t),r=X(e);if(null===r)return n;var i=M(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new p,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,d=i;l<d.length;l++){c=d[l];o.has(c)||(o.add(c),a.push(c))}return a}function R(e,t){var n=[],r=O(e,t,!1);if(U(r))return n;for(var i=q(r.keys()),o=0;;){var a=$(i);if(!a)return n.length=o,n;var s=Q(a);try{n[o]=s}catch(e){try{Y(i)}finally{throw e}}o++}}function x(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function U(e){return void 0===e}function D(e){return null===e}function j(e){return"symbol"==typeof e}function L(e){return"object"==typeof e?null!==e:"function"==typeof e}function B(e,t){switch(x(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",i=J(e,r);if(void 0!==i){var o=i.call(e,n);if(L(o))throw new TypeError;return o}return Z(e,"default"===n?"number":n)}function Z(e,t){if("string"===t){var n=e.toString;if(H(n))if(!L(i=n.call(e)))return i;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i}else{var r;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i;var i,o=e.toString;if(H(o))if(!L(i=o.call(e)))return i}throw new TypeError}function z(e){return!!e}function W(e){return""+e}function F(e){var t=B(e,3);return j(t)?t:W(t)}function G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function H(e){return"function"==typeof e}function V(e){return"function"==typeof e}function K(e){switch(x(e)){case 3:case 4:return!0;default:return!1}}function J(e,t){var n=e[t];if(null!=n){if(!H(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!H(t))throw new TypeError;var n=t.call(e);if(!L(n))throw new TypeError;return n}function Q(e){return e.value}function $(e){var t=e.next();return!t.done&&t}function Y(e){var t=e.return;t&&t.call(e)}function X(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function te(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function ne(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function re(e){return e.__=void 0,delete e.__,e}e("decorate",h),e("metadata",m),e("defineMetadata",v),e("hasMetadata",y),e("hasOwnMetadata",g),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",T),e("deleteMetadata",E)}(r)}()}(at||(at={}));var pt=Object.prototype.toString;var ft="[object Null]",ht="[object Undefined]";function mt(e){return null==e?void 0===e?ht:ft:function(e){return pt.call(e)}(e)}function vt(e){return null!=e&&"object"==typeof e}var yt={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||vt(e)&&"[object Number]"==mt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return vt(e)&&"[object RegExp]"==mt(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 gt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _t(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 wt(e){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},wt(e)}function bt(e){return wt(e)}function Tt(e,t,n){return Tt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=bt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},Tt(e,t,n)}function Et(e,t,n){return Tt(e,t,n)}function Pt(e,t){return Pt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Pt(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&&Pt(e,t)}function Ot(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function At(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=bt(e);if(t){var i=bt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==lt(t)&&"function"!=typeof t?Ot(e):t}(this,n)}}var It,kt,Ct=(It=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},It(kt={exports:{}},kt.exports),kt.exports),Nt="ACTION_CALLBACK";var Mt=function(e){St(n,e);var t=At(n);function n(){var e;return gt(this,n),(e=t.apply(this,arguments)).debug=dt("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===Nt||e===f.PaymentCallback)return Et(bt(n.prototype),"on",this).call(this,e,t,r);this.debug("register ".concat(String(e),": ").concat(r));return Et(bt(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===Nt)return Et(bt(n.prototype),"once",this).call(this,e,t,r);this.debug("register once ".concat(String(e),": ").concat(r));return Et(bt(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}(Ct);function Rt(e){Mt.getInstance().emit(Nt,e)}function xt(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(void 0===r)return;if(null===r)return void t.push(n);t.push(encodeURIComponent(n)+"="+encodeURIComponent(r))}return t.join("&")}window.onNativeMessage=function(e,t){return function(n){Rt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){var r=dt("zmp:zalo_h5_event_handler");r("eventId: ".concat(e,", eventName: ").concat(t,", eventData: ").concat(n));var o=ln(n);r("stringToData",o);var a=function(e,t){try{if(e===f.OpenApp){var n=t.url,r=new URL(n),o=r.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(o||"/").concat(r.search)}}return t}catch(e){return t}}(t,o);Mt.getInstance().emit(t,e,a)}},window.zaloNative2JS={nativeCall:function(e,t,n){Mt.getInstance().emit(f.PaymentCallback,e,t,n)}};var Ut={encode:xt,decode:function(e,t){var n={};if(""===e)return n;for(var r=e.split("&"),i=0;i<r.length;i++){var o=r[i].split("=",2),a=decodeURIComponent(o[0]);if(t&&Object.prototype.hasOwnProperty.call(n,a))throw new URIError("Duplicate key: "+a);n[a]=2===o.length?decodeURIComponent(o[1]):null}return n},appendToUrl:function(e,t){return e+(-1!==e.indexOf("?")?"&":"?")+("string"==typeof t?t:xt(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var n=e.split("=");n&&2==n.length&&(t[n[0]]=decodeURIComponent(n[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e||void 0===e?"undefined":lt(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":lt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Dt={},jt=function(e,t,n){var r=t||"default";return function(){return(r in Dt?Dt[r](e,n):e).apply(this,arguments)}};jt.setWrapper=function(e){Dt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Lt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Bt(e){try{return null===e?Lt:JSON.parse(e)}catch(e){return Lt}}var Zt,zt={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Ut.encode(n);"post"!=t&&(e=Ut.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=jt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=jt((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(Bt(e.responseText))},o.onerror=function(e){e.responseText?r(Bt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Wt=zt,Ft=(Zt=ge((function(e,t,n){var r,i,o,a;return Ee(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},yt.isUndefined(n)||(r.currentVersion=n),i=Ut.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 Zt.apply(this,arguments)});function Gt(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Wt.execute(l.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:e}})}catch(e){}}var Ht=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Vt=function(){var e,t,n=Number((null===(e=ke())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=ke())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Kt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Jt,qt,Qt=function(){function e(t,n,r,i){gt(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}(),$t=function(e,t){return Kt(e,Qt)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Kt(e,Error)?new Qt(x,e.message,t).toJSON():yt.isEmpty(null==e?void 0:e.message)||yt.isEmpty(null==e?void 0:e.code)?new Qt(x,G,t,e).toJSON():new Qt(e.code,e.message,t,e.detail).toJSON()}(e,t)},Yt=(Jt=ge((function(e){var t;return Ee(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,xe({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Jt.apply(this,arguments)}),Xt=ge((function(){return Ee(this,(function(e){return[2,new Promise(function(){var e=ge((function(e,t){var n,r,i,o;return Ee(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,an.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=an.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new Qt(j,K,"getSetting")),[4,Yt(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new Qt(i.err,i.msg,"getSetting")),[3,4];case 3:return o=a.sent(),t(o),[3,4];case 4:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))})),en=function(){var e,t,n,r=ke(),i={},o=Mt.getInstance(),a=[],s=!1;return s||(t=function(e){var t=e.serialId,n=dn(e.result),r=mn(null==n?void 0:n.action),o=yt.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,s=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===o){var c=JSON.parse(null==n?void 0:n.data);o=yt.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,s=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:o,error_message:s,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&i[t]){var d=i[t],p=d.callback,f=d.timeout,h=d.isMultiCallback,m=d.options;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?yt.isFunction(r)&&r(e):yt.isFunction(i)&&i(e)}(l,p),!h&&delete i[t],f&&clearTimeout(f);var v={action:null==l?void 0:l.action,error:null==l?void 0:l.error_code,message:null==l?void 0:l.error_message,data:{}};try{if("action.open.inapp"===l.action||"action.open.outapp"===l.action){var y=new URL(null==m?void 0:m.url),g="".concat(y.protocol,"//").concat(y.host).concat(y.pathname);v.data={url:g}}if("action.follow.oa"===l.action||"action.unfollow.oa"===l.action){var _=null==m?void 0:m.uid;v.data={uid:_}}if("action.open.chat"===l.action){var w=null==m?void 0:m.uId,b=null==m?void 0:m.type;v.data={uid:w,openChatType:b}}}catch(e){}a.push(v)}},Mt.getInstance().on(Nt,t),o.on(f.AppPaused,(function(){if(a.length>0){var e=a;a=[],Gt(e)}})),e?clearInterval(e):e=setInterval((function(){if(a.length>0){var e=a;a=[],Gt(e)}}),5e3),s=!0),n=ge((function(e,t,n,o){var a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,O,A;return Ee(this,(function(I){switch(I.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c=_n(e),(null==o?void 0:o.actionName)&&o.actionName.length>0&&(c=null==o?void 0:o.actionName),l=(null==o?void 0:o.isMultiCallback)||!1,d=!1!==(null==o?void 0:o.timeout)&&((null==o?void 0:o.timeout)||!0),p=(null==o?void 0:o.haveCallback)||!1,f=(null==o?void 0:o.skipJump)||!1,h=(null==o?void 0:o.requireAccessToken)||!1,m=vn(c),t&&n&&(i[u]={options:t,callback:n,isMultiCallback:l},d&&p&&(i[u].timeout=setTimeout((function(){return Rt({serialId:u,result:{error_code:B,error_message:V,data:{timeout:d},action:e}}),null}),!0===d?8e3:1e3*d))),m?[4,Xt()]:[3,2];case 1:if(!1===(null==(y=I.sent())||null===(v=y.authSetting)||void 0===v?void 0:v["scope.userInfo"]))return Rt({serialId:u,result:{error_code:j,error_message:Q,data:{isMobile:null==r||null===(g=r.platform)||void 0===g?void 0:g.isMobile},action:e}}),[2];I.label=2;case 2:return _=mn(c),!(null==r||null===(a=r.platform)||void 0===a?void 0:a.isMobile)||!e||yt.isUndefined(ZaloJavaScriptInterface)||r.platform.isIOS&&!cn(e)||_&&!1===_.isSupported?(Rt({serialId:u,result:{error_code:L,error_message:q,data:{isMobile:null==r||null===(w=r.platform)||void 0===w?void 0:w.isMobile},action:e}}),[2]):(b=un(t),f?[3,4]:[4,an.getJSAccessToken()]);case 3:return E=I.sent(),[3,5];case 4:E="",I.label=5;case 5:T=E,I.label=6;case 6:return I.trys.push([6,10,,11]),f||!h?[3,8]:[4,an.getAccessToken()];case 7:return S=I.sent(),[3,9];case 8:S="",I.label=9;case 9:return P=S,[3,11];case 10:return O=I.sent(),Rt({serialId:u,result:{error_code:null==O?void 0:O.code,error_message:null==O?void 0:O.message,action:e}}),[2];case 11:return A=r.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(T,c,P,b,A)]}}))})),function(e,t,r,i){return n.apply(this,arguments)}}(),tn={success:function(e,t){return{code:R,message:t||F,data:e||{}}},error:{failLimit:function(){return new Qt(Z,H)},badRequest:function(e){return new Qt(U,e)},loginFailed:function(e){return new Qt(j,"".concat(J,": ").concat(e))},loginRequired:function(){return new Qt(j,K)},cannotGetShareInfo:function(){return new Qt(D,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(ve).find((function(t){return t===e.toString()}));return new Qt(e,t||G)},clientNotSupport:function(){return new Qt(L,q)}}},nn=(qt=function(e){var t,n,r,i=null===(t=ke())||void 0===t?void 0:t.platformName,o=gn(e.action),a=te[o],s=(null==a?void 0:a.skipJump)||!1,u=(null==a?void 0:a.errorList)||{};if("JUMP_LOGIN"===o)return new Qt(x,"Can not get auth code: ".concat(e.error_message));if(an.jumpStatus!==h.DONE&&!s)return new Qt(X.UNAUTHORIZED.code,X.UNAUTHORIZED.message);if("permission required!"===String(e.error_message).toLowerCase()||"no permission!"===String(e.error_message).toLowerCase())return new Qt(X.FORBIDDEN.code,X.FORBIDDEN.message);if(i&&(null===(n=ne[i])||void 0===n?void 0:n[e.error_code]))return new Qt(ne[i][e.error_code].code,ne[i][e.error_code].message);var c=null==u||null===(r=u[i])||void 0===r?void 0:r[String(e.error_code)];if(c){var l,d,p,f=null===(l=c.mapTo)||void 0===l?void 0:l.message;return(null==c?void 0:c.needMoreDetail)&&(f="".concat(null==c||null===(p=c.mapTo)||void 0===p?void 0:p.message,": ").concat(e.error_message)),new Qt(null===(d=c.mapTo)||void 0===d?void 0:d.code,f)}return new Qt(e.error_code,e.error_message)},function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=yt.isEmpty(n)?void 0:n[r];if(o)return Ne({stage:t.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?qt(i):null==i?void 0:i.data)}}return yt.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=te[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){en(e,n,o,xe({},i,a))}),s)}),rn=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){yt.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),on=function(){function e(){gt(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=ee[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 ge((function(){return Ee(this,(function(n){return[2,new Promise((function(n,r){e._jumpStatus?e._jumpStatus===h.DONE?n(h.DONE):n(h.DOING):(e._jumpStatus=h.DOING,Ne({stage:t.REQUEST,type:"log",name:"jump"}),en("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)||Gt([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),n(h.DONE)},fail:function(e){Gt([{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 ge((function(){var i;return Ee(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=ge((function(e){var t,n,i;return Ee(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 ge((function(){var i,o;return Ee(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),yt.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,xe({method:"POST",body:i},o)).then(function(){var e=ge((function(e){var t,n,i,o;return Ee(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 ge((function(){var n,o,a,s,u,l,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=ge((function(){return Ee(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 Ee(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--,Gt([{action:d,error:-104,message:"no user auth",data:{}}]),tn.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),Gt([{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)]:(Gt([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(tn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw o.getAccessTokenCount--,Gt([{action:d,error:-102,message:"no oauth",data:{}}]),tn.error.loginFailed("Zalo app has not been activated")}}))}))()},u.verifyUserAuthorized=function(){var e=this;return ge((function(){var t,n,r,i,o,a;return Ee(this,(function(s){switch(s.label){case 0:if(n=!0,!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,6];s.label=1;case 1:return s.trys.push([1,5,,6]),(r=mn("action.mp.user.authorize"))&&r.isSupported?[4,Xt()]:[3,4];case 2:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,4]:[4,rn()];case 3:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=4;case 4:return[3,6];case 5:return s.sent(),n=!1,[3,6];case 6:return[2,n]}}))}))()},u.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},u.getJSAccessToken=function(){var e=this;return ge((function(){var t;return Ee(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=ge((function(r){var i,o,a,s;return Ee(this,(function(u){switch(u.label){case 0:return!t&&n._cookies.length>0?yt.isString(e)?(i=n._cookies.find((function(t){return t.name===e})),[2,r(null==i?void 0:i.value)]):[2,r("")]:(t&&n._jumpStatus===h.DONE&&(n._jumpStatus=void 0),o={name:e,cb:function(e){return r(e)}},[4,n.jump()]);case 1:return(a=u.sent())===h.DONE?(n._jumpStatus=a,n.WAITING_QUEUE.length&&(n.WAITING_QUEUE.forEach((function(e){var t=n._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),n.WAITING_QUEUE=[]),s=n._cookies.find((function(e){return e.name===o.name})),o.cb(null==s?void 0:s.value)):n.WAITING_QUEUE.push(o),[2]}}))}));return function(e){return r.apply(this,arguments)}}())},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},n=e,(o=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&_t(n.prototype,o),s&&_t(n,s),e}(),an=on.getInstance(),sn=dt("zmp:utils:common"),un=function(e){if(yt.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(un(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+un(e[i]));return"{"+t.join(",")+"}"}return e.toString()},cn=function(e){var t,n,r=te[e],i=(null===(t=ke())||void 0===t?void 0:t.zaloVersion)||0,o="versionLive"in r&&(null==r||null===(n=r.versionLive)||void 0===n?void 0:n.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||Number(i)>=o},ln=function(e){try{if(e){sn(e);var t=e.replace(/\\/g,"").replace(/'/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return sn("formattedValue",t,JSON.parse(t),lt(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return sn("parse json error:",t),e}},dn=function(e){if(yt.isObject(JSON)&&JSON.parse&&yt.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 yt.isObject(e)?e:new Function("return "+e)()},pn=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""},fn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var hn=function(e){return"hidden"===e?P.hidden:"transparent"===e?P.transparent:P.normal},mn=function(e){if(void 0!==e){var t=an.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},vn=function(e){if(void 0===e)return!1;var t=an.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},yn=function(){var e=ge((function(){return Ee(this,(function(e){return[2,new Promise(function(){var e=ge((function(e,t){var n;return Ee(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,an.jumpAndGetToken()];case 1:return t.sent(),n=an.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)}}(),gn=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},_n=function(e){return"action.".concat(e.replace(/\_/g,".").toLowerCase())};function wn(e,t,n,r){var i,o;!function(e,t){if(ee[e]){var n=an.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&an.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw $t(tn.error.failLimit(),e);an.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=tn.error.badRequest(s);throw c.detail=a,$t(c,e)}u.push(i.data)}));var c=r.apply(void 0,Te(u));return yt.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!yt.isNull(a)&&yt.isFunction(a))return a(e);t(c)})).catch((function(t){var r=$t(t,e);if(!yt.isNull(s)&&yt.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!yt.isNull(s)&&yt.isFunction(s))return s(t);throw $t(t,e)}}function bn(e){return Tn.apply(this,arguments)}function Tn(){return(Tn=ge((function(e){return Ee(this,(function(t){return[2,wn("login",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,an.jumpAndGetToken(c.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Ce.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Me("login",{}))]}}))})))]}))}))).apply(this,arguments)}function En(e){return Pn.apply(this,arguments)}function Pn(){return(Pn=ge((function(e){return Ee(this,(function(t){return[2,wn("getAccessToken",[],[e],ge((function(){var e;return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,yn()]:[3,3];case 1:return e=!t.sent(),[4,an.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Ce.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Me("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Sn,On="2.40.0";function An(){return wn("getVersion",[],[],(function(){return On}))}function In(){var e,t;return{version:pn("version-id")||"",apiVersion:On,zaloVersion:(null===(e=ke())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=ke())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function kn(){return wn("getSystemInfo",[],[],(function(){return In()}))}!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}(Sn||(Sn={}));const Cn=Sn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nn=e=>{switch(typeof e){case"undefined":return Cn.undefined;case"string":return Cn.string;case"number":return isNaN(e)?Cn.nan:Cn.number;case"boolean":return Cn.boolean;case"function":return Cn.function;case"bigint":return Cn.bigint;case"symbol":return Cn.symbol;case"object":return Array.isArray(e)?Cn.array:null===e?Cn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Cn.promise:"undefined"!=typeof Map&&e instanceof Map?Cn.map:"undefined"!=typeof Set&&e instanceof Set?Cn.set:"undefined"!=typeof Date&&e instanceof Date?Cn.date:Cn.object;default:return Cn.unknown}},Mn=Sn.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 Rn 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,Sn.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()}}Rn.create=e=>new Rn(e);const xn=(e,t)=>{let n;switch(e.code){case Mn.invalid_type:n=e.received===Cn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Mn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Sn.jsonStringifyReplacer)}`;break;case Mn.unrecognized_keys:n=`Unrecognized key(s) in object: ${Sn.joinValues(e.keys,", ")}`;break;case Mn.invalid_union:n="Invalid input";break;case Mn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Sn.joinValues(e.options)}`;break;case Mn.invalid_enum_value:n=`Invalid enum value. Expected ${Sn.joinValues(e.options)}, received '${e.received}'`;break;case Mn.invalid_arguments:n="Invalid function arguments";break;case Mn.invalid_return_type:n="Invalid function return type";break;case Mn.invalid_date:n="Invalid date";break;case Mn.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}"`:Sn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Mn.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 Mn.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 Mn.custom:n="Invalid input";break;case Mn.invalid_intersection_types:n="Intersection results could not be merged";break;case Mn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Mn.not_finite:n="Number must be finite";break;default:n=t.defaultError,Sn.assertNever(e)}return{message:n}};let Un=xn;function Dn(){return Un}const jn=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 Ln(e,t){const n=jn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Dn(),xn].filter((e=>!!e))});e.common.issues.push(n)}class Bn{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 Zn;"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 Bn.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 Zn;if("aborted"===i.status)return Zn;"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 Zn=Object.freeze({status:"aborted"}),zn=e=>({status:"dirty",value:e}),Wn=e=>({status:"valid",value:e}),Fn=e=>"aborted"===e.status,Gn=e=>"dirty"===e.status,Hn=e=>"valid"===e.status,Vn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Kn;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Kn||(Kn={}));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 qn=(e,t)=>{if(Hn(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 Rn(e.common.issues)}};function Qn(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 $n{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 Nn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Bn,ctx:{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Vn(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:Nn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return qn(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:Nn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Vn(r)?r:Promise.resolve(r));return qn(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:Mn.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 Ur({schema:this,typeName:Vr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Dr.create(this,this._def)}nullable(){return jr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mr.create(this,this._def)}promise(){return xr.create(this,this._def)}or(e){return _r.create([this,e],this._def)}and(e){return Er.create(this,e,this._def)}transform(e){return new Ur({...Qn(this._def),schema:this,typeName:Vr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Lr({...Qn(this._def),innerType:this,defaultValue:t,typeName:Vr.ZodDefault})}brand(){return new Wr({typeName:Vr.ZodBranded,type:this,...Qn(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Br({...Qn(this._def),innerType:this,catchValue:t,typeName:Vr.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Fr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Yn=/^c[^\s-]{8,}$/i,Xn=/^[a-z][a-z0-9]*$/,er=/^([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,tr=/^(([^<>()[\]\\.,;:\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 nr extends $n{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Mn.invalid_string,...Kn.errToObj(n)}),this.nonempty=e=>this.min(1,Kn.errToObj(e)),this.trim=()=>new nr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Cn.string){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.string,received:t.parsedType}),Zn}const t=new Bn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.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),Ln(n,{code:Mn.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?Ln(n,{code:Mn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Ln(n,{code:Mn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)tr.test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{validation:"email",code:Mn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)er.test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{validation:"uuid",code:Mn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Yn.test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{validation:"cuid",code:Mn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Xn.test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{validation:"cuid2",code:Mn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Ln(n,{validation:"url",code:Mn.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),Ln(n,{validation:"regex",code:Mn.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),Ln(n,{code:Mn.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),Ln(n,{code:Mn.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),Ln(n,{code:Mn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else Sn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new nr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Kn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Kn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Kn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Kn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Kn.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,...Kn.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Kn.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Kn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Kn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Kn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Kn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Kn.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 rr(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)}nr.create=e=>{var t;return new nr({checks:[],typeName:Vr.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Qn(e)})};class ir extends $n{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)!==Cn.number){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.number,received:t.parsedType}),Zn}let t;const n=new Bn;for(const r of this._def.checks)if("int"===r.kind)Sn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Ln(t,{code:Mn.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),Ln(t,{code:Mn.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),Ln(t,{code:Mn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==rr(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Ln(t,{code:Mn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Ln(t,{code:Mn.not_finite,message:r.message}),n.dirty()):Sn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Kn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Kn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Kn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Kn.toString(t))}setLimit(e,t,n,r){return new ir({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Kn.toString(r)}]})}_addCheck(e){return new ir({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Kn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Kn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Kn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Kn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Kn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Kn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Kn.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&&Sn.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ir.create=e=>new ir({checks:[],typeName:Vr.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...Qn(e)});class or extends $n{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Cn.bigint){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.bigint,received:t.parsedType}),Zn}return Wn(e.data)}}or.create=e=>{var t;return new or({typeName:Vr.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Qn(e)})};class ar extends $n{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Cn.boolean){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.boolean,received:t.parsedType}),Zn}return Wn(e.data)}}ar.create=e=>new ar({typeName:Vr.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...Qn(e)});class sr extends $n{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Cn.date){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.date,received:t.parsedType}),Zn}if(isNaN(e.data.getTime())){return Ln(this._getOrReturnCtx(e),{code:Mn.invalid_date}),Zn}const t=new Bn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.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),Ln(n,{code:Mn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Sn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new sr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Kn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Kn.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}}sr.create=e=>new sr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Vr.ZodDate,...Qn(e)});class ur extends $n{_parse(e){if(this._getType(e)!==Cn.symbol){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.symbol,received:t.parsedType}),Zn}return Wn(e.data)}}ur.create=e=>new ur({typeName:Vr.ZodSymbol,...Qn(e)});class cr extends $n{_parse(e){if(this._getType(e)!==Cn.undefined){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.undefined,received:t.parsedType}),Zn}return Wn(e.data)}}cr.create=e=>new cr({typeName:Vr.ZodUndefined,...Qn(e)});class lr extends $n{_parse(e){if(this._getType(e)!==Cn.null){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.null,received:t.parsedType}),Zn}return Wn(e.data)}}lr.create=e=>new lr({typeName:Vr.ZodNull,...Qn(e)});class dr extends $n{constructor(){super(...arguments),this._any=!0}_parse(e){return Wn(e.data)}}dr.create=e=>new dr({typeName:Vr.ZodAny,...Qn(e)});class pr extends $n{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Wn(e.data)}}pr.create=e=>new pr({typeName:Vr.ZodUnknown,...Qn(e)});class fr extends $n{_parse(e){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.never,received:t.parsedType}),Zn}}fr.create=e=>new fr({typeName:Vr.ZodNever,...Qn(e)});class hr extends $n{_parse(e){if(this._getType(e)!==Cn.undefined){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.void,received:t.parsedType}),Zn}return Wn(e.data)}}hr.create=e=>new hr({typeName:Vr.ZodVoid,...Qn(e)});class mr extends $n{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Cn.array)return Ln(t,{code:Mn.invalid_type,expected:Cn.array,received:t.parsedType}),Zn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Ln(t,{code:e?Mn.too_big:Mn.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&&(Ln(t,{code:Mn.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&&(Ln(t,{code:Mn.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=>Bn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new Jn(t,e,t.path,n))));return Bn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new mr({...this._def,minLength:{value:e,message:Kn.toString(t)}})}max(e,t){return new mr({...this._def,maxLength:{value:e,message:Kn.toString(t)}})}length(e,t){return new mr({...this._def,exactLength:{value:e,message:Kn.toString(t)}})}nonempty(e){return this.min(1,e)}}var vr;function yr(e){if(e instanceof gr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Dr.create(yr(r))}return new gr({...e._def,shape:()=>t})}return e instanceof mr?mr.create(yr(e.element)):e instanceof Dr?Dr.create(yr(e.unwrap())):e instanceof jr?jr.create(yr(e.unwrap())):e instanceof Pr?Pr.create(e.items.map((e=>yr(e)))):e}mr.create=(e,t)=>new mr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Vr.ZodArray,...Qn(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(vr||(vr={}));class gr extends $n{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=Sn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Cn.object){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.object,received:t.parsedType}),Zn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof fr&&"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 fr){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&&(Ln(n,{code:Mn.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=>Bn.mergeObjectSync(t,e))):Bn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Kn.errToObj,new gr({...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=Kn.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new gr({...this._def,unknownKeys:"strip"})}passthrough(){return new gr({...this._def,unknownKeys:"passthrough"})}extend(e){return new gr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new gr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>vr.mergeShapes(this._def.shape(),e._def.shape()),typeName:Vr.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new gr({...this._def,catchall:e})}pick(e){const t={};return Sn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new gr({...this._def,shape:()=>t})}omit(e){const t={};return Sn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new gr({...this._def,shape:()=>t})}deepPartial(){return yr(this)}partial(e){const t={};return Sn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new gr({...this._def,shape:()=>t})}required(e){const t={};return Sn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Dr;)e=e._def.innerType;t[n]=e}})),new gr({...this._def,shape:()=>t})}keyof(){return Nr(Sn.objectKeys(this.shape))}}gr.create=(e,t)=>new gr({shape:()=>e,unknownKeys:"strip",catchall:fr.create(),typeName:Vr.ZodObject,...Qn(t)}),gr.strictCreate=(e,t)=>new gr({shape:()=>e,unknownKeys:"strict",catchall:fr.create(),typeName:Vr.ZodObject,...Qn(t)}),gr.lazycreate=(e,t)=>new gr({shape:e,unknownKeys:"strip",catchall:fr.create(),typeName:Vr.ZodObject,...Qn(t)});class _r extends $n{_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 Rn(e.ctx.common.issues)));return Ln(t,{code:Mn.invalid_union,unionErrors:n}),Zn}));{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 Rn(e)));return Ln(t,{code:Mn.invalid_union,unionErrors:i}),Zn}}get options(){return this._def.options}}_r.create=(e,t)=>new _r({options:e,typeName:Vr.ZodUnion,...Qn(t)});const wr=e=>e instanceof kr?wr(e.schema):e instanceof Ur?wr(e.innerType()):e instanceof Cr?[e.value]:e instanceof Mr?e.options:e instanceof Rr?Object.keys(e.enum):e instanceof Lr?wr(e._def.innerType):e instanceof cr?[void 0]:e instanceof lr?[null]:null;class br extends $n{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Cn.object)return Ln(t,{code:Mn.invalid_type,expected:Cn.object,received:t.parsedType}),Zn;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}):(Ln(t,{code:Mn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Zn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=wr(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new br({typeName:Vr.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Qn(n)})}}function Tr(e,t){const n=Nn(e),r=Nn(t);if(e===t)return{valid:!0,data:e};if(n===Cn.object&&r===Cn.object){const n=Sn.objectKeys(t),r=Sn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=Tr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Cn.array&&r===Cn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Tr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Cn.date&&r===Cn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Er extends $n{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Fn(e)||Fn(r))return Zn;const i=Tr(e.value,r.value);return i.valid?((Gn(e)||Gn(r))&&t.dirty(),{status:t.value,value:i.data}):(Ln(n,{code:Mn.invalid_intersection_types}),Zn)};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}))}}Er.create=(e,t,n)=>new Er({left:e,right:t,typeName:Vr.ZodIntersection,...Qn(n)});class Pr extends $n{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Cn.array)return Ln(n,{code:Mn.invalid_type,expected:Cn.array,received:n.parsedType}),Zn;if(n.data.length<this._def.items.length)return Ln(n,{code:Mn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Zn;!this._def.rest&&n.data.length>this._def.items.length&&(Ln(n,{code:Mn.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=>Bn.mergeArray(t,e))):Bn.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:Vr.ZodTuple,rest:null,...Qn(t)})};class Sr extends $n{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!==Cn.object)return Ln(n,{code:Mn.invalid_type,expected:Cn.object,received:n.parsedType}),Zn;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?Bn.mergeObjectAsync(t,r):Bn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Sr(t instanceof $n?{keyType:e,valueType:t,typeName:Vr.ZodRecord,...Qn(n)}:{keyType:nr.create(),valueType:e,typeName:Vr.ZodRecord,...Qn(t)})}}class Or extends $n{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Cn.map)return Ln(n,{code:Mn.invalid_type,expected:Cn.map,received:n.parsedType}),Zn;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 Zn;"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 Zn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Or.create=(e,t,n)=>new Or({valueType:t,keyType:e,typeName:Vr.ZodMap,...Qn(n)});class Ar extends $n{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Cn.set)return Ln(n,{code:Mn.invalid_type,expected:Cn.set,received:n.parsedType}),Zn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Ln(n,{code:Mn.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&&(Ln(n,{code:Mn.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 Zn;"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 Ar({...this._def,minSize:{value:e,message:Kn.toString(t)}})}max(e,t){return new Ar({...this._def,maxSize:{value:e,message:Kn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ar.create=(e,t)=>new Ar({valueType:e,minSize:null,maxSize:null,typeName:Vr.ZodSet,...Qn(t)});class Ir extends $n{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Cn.function)return Ln(t,{code:Mn.invalid_type,expected:Cn.function,received:t.parsedType}),Zn;function n(e,n){return jn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Dn(),xn].filter((e=>!!e)),issueData:{code:Mn.invalid_arguments,argumentsError:n}})}function r(e,n){return jn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Dn(),xn].filter((e=>!!e)),issueData:{code:Mn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof xr?Wn((async(...e)=>{const t=new Rn([]),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}))})):Wn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new Rn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new Rn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ir({...this._def,args:Pr.create(e).rest(pr.create())})}returns(e){return new Ir({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Ir({args:e||Pr.create([]).rest(pr.create()),returns:t||pr.create(),typeName:Vr.ZodFunction,...Qn(n)})}}class kr extends $n{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})}}kr.create=(e,t)=>new kr({getter:e,typeName:Vr.ZodLazy,...Qn(t)});class Cr extends $n{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Ln(t,{received:t.data,code:Mn.invalid_literal,expected:this._def.value}),Zn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Nr(e,t){return new Mr({values:e,typeName:Vr.ZodEnum,...Qn(t)})}Cr.create=(e,t)=>new Cr({value:e,typeName:Vr.ZodLiteral,...Qn(t)});class Mr extends $n{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Ln(t,{expected:Sn.joinValues(n),received:t.parsedType,code:Mn.invalid_type}),Zn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Ln(t,{received:t.data,code:Mn.invalid_enum_value,options:n}),Zn}return Wn(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 Mr.create(e)}exclude(e){return Mr.create(this.options.filter((t=>!e.includes(t))))}}Mr.create=Nr;class Rr extends $n{_parse(e){const t=Sn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Cn.string&&n.parsedType!==Cn.number){const e=Sn.objectValues(t);return Ln(n,{expected:Sn.joinValues(e),received:n.parsedType,code:Mn.invalid_type}),Zn}if(-1===t.indexOf(e.data)){const e=Sn.objectValues(t);return Ln(n,{received:n.data,code:Mn.invalid_enum_value,options:e}),Zn}return Wn(e.data)}get enum(){return this._def.values}}Rr.create=(e,t)=>new Rr({values:e,typeName:Vr.ZodNativeEnum,...Qn(t)});class xr extends $n{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Cn.promise&&!1===t.common.async)return Ln(t,{code:Mn.invalid_type,expected:Cn.promise,received:t.parsedType}),Zn;const n=t.parsedType===Cn.promise?t.data:Promise.resolve(t.data);return Wn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}xr.create=(e,t)=>new xr({type:e,typeName:Vr.ZodPromise,...Qn(t)});class Ur extends $n{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Vr.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=>{Ln(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?Zn:("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?Zn:("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(!Hn(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=>Hn(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}Sn.assertNever(r)}}Ur.create=(e,t,n)=>new Ur({schema:e,typeName:Vr.ZodEffects,effect:t,...Qn(n)}),Ur.createWithPreprocess=(e,t,n)=>new Ur({schema:t,effect:{type:"preprocess",transform:e},typeName:Vr.ZodEffects,...Qn(n)});class Dr extends $n{_parse(e){return this._getType(e)===Cn.undefined?Wn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Dr.create=(e,t)=>new Dr({innerType:e,typeName:Vr.ZodOptional,...Qn(t)});class jr extends $n{_parse(e){return this._getType(e)===Cn.null?Wn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}jr.create=(e,t)=>new jr({innerType:e,typeName:Vr.ZodNullable,...Qn(t)});class Lr extends $n{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Cn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Lr.create=(e,t)=>new Lr({innerType:e,typeName:Vr.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Qn(t)});class Br extends $n{_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 Vn(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}}Br.create=(e,t)=>new Br({innerType:e,typeName:Vr.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Qn(t)});class Zr extends $n{_parse(e){if(this._getType(e)!==Cn.nan){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.nan,received:t.parsedType}),Zn}return{status:"valid",value:e.data}}}Zr.create=e=>new Zr({typeName:Vr.ZodNaN,...Qn(e)});const zr=Symbol("zod_brand");class Wr extends $n{_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 Fr extends $n{_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?Zn:"dirty"===e.status?(t.dirty(),zn(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?Zn:"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 Fr({in:e,out:t,typeName:Vr.ZodPipeline})}}const Gr=(e,t={},n)=>e?dr.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})}})):dr.create(),Hr={object:gr.lazycreate};var Vr;!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"}(Vr||(Vr={}));const Kr=nr.create,Jr=ir.create,qr=Zr.create,Qr=or.create,$r=ar.create,Yr=sr.create,Xr=ur.create,ei=cr.create,ti=lr.create,ni=dr.create,ri=pr.create,ii=fr.create,oi=hr.create,ai=mr.create,si=gr.create,ui=gr.strictCreate,ci=_r.create,li=br.create,di=Er.create,pi=Pr.create,fi=Sr.create,hi=Or.create,mi=Ar.create,vi=Ir.create,yi=kr.create,gi=Cr.create,_i=Mr.create,wi=Rr.create,bi=xr.create,Ti=Ur.create,Ei=Dr.create,Pi=jr.create,Si=Ur.createWithPreprocess,Oi=Fr.create,Ai={string:e=>nr.create({...e,coerce:!0}),number:e=>ir.create({...e,coerce:!0}),boolean:e=>ar.create({...e,coerce:!0}),bigint:e=>or.create({...e,coerce:!0}),date:e=>sr.create({...e,coerce:!0})},Ii=Zn;var ki=Object.freeze({__proto__:null,defaultErrorMap:xn,setErrorMap:function(e){Un=e},getErrorMap:Dn,makeIssue:jn,EMPTY_PATH:[],addIssueToContext:Ln,ParseStatus:Bn,INVALID:Zn,DIRTY:zn,OK:Wn,isAborted:Fn,isDirty:Gn,isValid:Hn,isAsync:Vn,get util(){return Sn},ZodParsedType:Cn,getParsedType:Nn,ZodType:$n,ZodString:nr,ZodNumber:ir,ZodBigInt:or,ZodBoolean:ar,ZodDate:sr,ZodSymbol:ur,ZodUndefined:cr,ZodNull:lr,ZodAny:dr,ZodUnknown:pr,ZodNever:fr,ZodVoid:hr,ZodArray:mr,get objectUtil(){return vr},ZodObject:gr,ZodUnion:_r,ZodDiscriminatedUnion:br,ZodIntersection:Er,ZodTuple:Pr,ZodRecord:Sr,ZodMap:Or,ZodSet:Ar,ZodFunction:Ir,ZodLazy:kr,ZodLiteral:Cr,ZodEnum:Mr,ZodNativeEnum:Rr,ZodPromise:xr,ZodEffects:Ur,ZodTransformer:Ur,ZodOptional:Dr,ZodNullable:jr,ZodDefault:Lr,ZodCatch:Br,ZodNaN:Zr,BRAND:zr,ZodBranded:Wr,ZodPipeline:Fr,custom:Gr,Schema:$n,ZodSchema:$n,late:Hr,get ZodFirstPartyTypeKind(){return Vr},coerce:Ai,any:ni,array:ai,bigint:Qr,boolean:$r,date:Yr,discriminatedUnion:li,effect:Ti,enum:_i,function:vi,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Gr((t=>t instanceof e),t,!0),intersection:di,lazy:yi,literal:gi,map:hi,nan:qr,nativeEnum:wi,never:ii,null:ti,nullable:Pi,number:Jr,object:si,oboolean:()=>$r().optional(),onumber:()=>Jr().optional(),optional:Ei,ostring:()=>Kr().optional(),pipeline:Oi,preprocess:Si,promise:bi,record:fi,set:mi,strictObject:ui,string:Kr,symbol:Xr,transformer:Ti,tuple:pi,undefined:ei,union:ci,unknown:ri,void:oi,NEVER:Ii,ZodIssueCode:Mn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Rn}),Ci=function(){function e(){var t,n,r,o,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,O,A,I,k;gt(this,e),this.initConfig=window.APP_CONFIG;var C=yt.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?pe:fe;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,R="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?de.HIDE_BACK:de.SHOW_BACK,x="home"===(null===(v=this.initConfig)||void 0===v||null===(y=v.app)||void 0===y?void 0:y.leftButton)||"both"===(null===(g=this.initConfig)||void 0===g||null===(_=g.app)||void 0===_?void 0:_.leftButton)?de.SHOW_HOME:de.HIDE_HOME,U=new URL(location.href),D=hn(null===(w=this.initConfig)||void 0===w||null===(b=w.app)||void 0===b?void 0:b.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.app)||void 0===E?void 0:E.actionBarHidden)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?fe:pe);this.config={actionbarType:C,buttonType:R,statusbarType:D,dataConfig:{backgroundColor:(null===(P=this.initConfig)||void 0===P||null===(S=P.app)||void 0===S?void 0:S.headerColor)||he,textColor:(null===(O=this.initConfig)||void 0===O||null===(A=O.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(I=this.initConfig)||void 0===I||null===(k=I.app)||void 0===k?void 0:k.textAlign)||me,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(a,"/").concat(i,"/").concat(U.search)}}}var t=e.prototype;return t.setNavigationBarTitle=function(e){return ge((function(){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("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 ge((function(){var r,i;return Ee(this,(function(o){return void 0===(void 0===e?"undefined":lt(e))&&null===(void 0===e?"undefined":lt(e))||(r="none"===e||"home"===e?de.HIDE_BACK:de.SHOW_BACK,i="home"===e||"both"===e?de.SHOW_HOME:de.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){nn("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",xe({},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 ge((function(){var n,r,i;return Ee(this,(function(o){return r=e?S.hide:S.show,i=null===(n=ke())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isAndroid))return n();nn("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 ge((function(){var n,r,i;return Ee(this,(function(o){return r=e?O.hide:O.show,i=null===(n=ke())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isIOS))return n();nn("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 ge((function(){var n;return Ee(this,(function(r){return n=t.config,yt.isString(e.headerColor)&&(n.dataConfig.backgroundColor=e.headerColor),yt.isString(e.headerTextColor)&&(n.dataConfig.textColor=e.headerTextColor),yt.isString(e.textAlign)&&("left"===e.textAlign?n.dataConfig.textAlign=A.left:"center"===e.textAlign&&(n.dataConfig.textAlign=A.center)),!0===e.hideActionBar?n.actionbarType=fe:!1===e.hideActionBar&&(n.actionbarType=pe),"normal"===e.statusBarType?n.statusbarType=P.normal:"hidden"===e.statusBarType?n.statusbarType=P.hidden:"transparent"===e.statusBarType&&(n.statusbarType=P.transparent),[2,new Promise((function(r,i){nn("CHANGE_ACTIONBAR",xe({},n),{success:function(){var i;t.config=xe({},n);var o,a=null===(i=ke())||void 0===i?void 0:i.platform;window.STATUS_BAR_TYPE=(o=t.config.statusbarType)===P.hidden?"hidden":o===P.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=t.config.actionbarType===fe;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}(),Ni=Ci.getInstance(),Mi=[si({title:Kr()}).optional()];function Ri(e){return xi.apply(this,arguments)}function xi(){return xi=ge((function(e){return Ee(this,(function(t){return[2,wn("setNavigationBarTitle",Mi,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ni.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xi.apply(this,arguments)}var Ui=[si({color:Kr(),textColor:ki.enum(["black","white"]).optional(),statusBarColor:Kr().optional()}).optional()];function Di(e){return ji.apply(this,arguments)}function ji(){return ji=ge((function(e){return Ee(this,(function(t){return[2,wn("setNavigationBarColor",Ui,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ni.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 Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ji.apply(this,arguments)}var Li=[si({type:ki.enum(["none","back","home","both"])}).optional()];function Bi(e){return Zi.apply(this,arguments)}function Zi(){return Zi=ge((function(e){return Ee(this,(function(t){return[2,wn("setNavigationBarLeftButton",Li,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ni.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zi.apply(this,arguments)}function zi(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Wi(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,zi(e,t,"get"))}function Fi(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 Gi(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,zi(e,t,"set"),n),n}var Hi,Vi,Ki,Ji=new WeakMap,qi=new WeakMap,Qi=new WeakMap,$i=function(){function e(t){gt(this,e),Fi(this,Ji,{writable:!0,value:localStorage}),Fi(this,qi,{writable:!0,value:void 0}),Fi(this,Qi,{writable:!0,value:void 0}),Gi(this,Qi,{keys:new Set,currentSize:0,limitSize:ie}),Gi(this,qi,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in Wi(this,Ji)){if(e)if(t.split("_")[0]!==e)continue;Wi(this,Qi).keys.add(t)}}catch(e){}},t.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},t.getSync=function(e){return Wi(this,qi)&&(e="".concat(Wi(this,qi),"_").concat(e)),Wi(this,Qi).keys.has(e)?Wi(this,Ji).getItem(e):null},t.set=function(e){var t=this;return ge((function(){return Ee(this,(function(n){return Object.entries(e).forEach((function(e){var n=Ue(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){Wi(this,qi)&&(e="".concat(Wi(this,qi),"_").concat(e)),Wi(this,Ji).setItem(e,t),Wi(this,Qi).keys.add(e)},t.getInfo=function(){var e=this;return ge((function(){return Ee(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},t.getInfoSync=function(){var e=function(e,t){var n,r=0;for(n in e){var i=n.split("_")[0];e.hasOwnProperty(n)&&(t&&i!==t||(r+=2*(e[n].length+n.length)))}return r}(Wi(this,Ji),Wi(this,qi));return{currentSize:yt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((ie/1024).toFixed(2))}},t.remove=function(e){var t=this;return ge((function(){return Ee(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){Wi(this,qi)&&(e="".concat(Wi(this,qi),"_").concat(e)),Wi(this,Qi).keys.has(e)&&(Wi(this,Ji).removeItem(e),Wi(this,Qi).keys.delete(e))},t.clear=function(){var e=this;return ge((function(){return Ee(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;Wi(this,Qi).keys.forEach((function(t){Wi(e,qi)&&t.indexOf(Wi(e,qi))<0||(Wi(e,Ji).removeItem(t),Wi(e,Qi).keys.delete(t))}))},e}(),Yi=new WeakMap,Xi=new WeakMap,eo=function(){function e(t){gt(this,e),Fi(this,Yi,{writable:!0,value:void 0}),Fi(this,Xi,{writable:!0,value:void 0}),Gi(this,Xi,{keys:new Set,currentSize:0,limitSize:ie}),Gi(this,Yi,t)}var t=e.prototype;return t.get=function(e){var t=this;return ge((function(){return Ee(this,(function(n){return[2,new Promise((function(n,r){nn("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Wi(t,Yi)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.set=function(e){var t=this;return ge((function(){return Ee(this,(function(n){return[2,new Promise((function(n,r){nn("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Wi(t,Yi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.getInfo=function(){var e=this;return ge((function(){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Wi(e,Yi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:yt.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(ie/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return ge((function(){return Ee(this,(function(n){return[2,new Promise((function(n,r){nn("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Wi(t,Yi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.clear=function(){var e=this;return ge((function(){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Wi(e,Yi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),to=function(){function e(){gt(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return ge((function(){var n,r;return Ee(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]=ln(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return ge((function(){var n,r;return Ee(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Ue(e,2),n=t[0],i=t[1];yt.isUndefined(i)||yt.isNull(i)||(r[n]=fn(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return ge((function(){return Ee(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.clearStorage=function(){var e=this;return ge((function(){return Ee(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clear()];case 1:return t.sent(),[2]}}))}))()},t.getStorageInfo=function(){var e=this;return ge((function(){return Ee(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),no=new WeakMap,ro=function(e){St(n,e);var t=At(n);function n(e){var r;return gt(this,n),Fi(Ot(r=t.call(this)),no,{writable:!0,value:void 0}),Gi(Ot(r),no,e),r}return n.prototype.getInstance=function(){return new $i(Wi(this,no))},n}(to),io=new WeakMap,oo=function(e){St(n,e);var t=At(n);function n(e){var r;return gt(this,n),Fi(Ot(r=t.call(this)),io,{writable:!0,value:void 0}),Gi(Ot(r),io,e),r}return n.prototype.getInstance=function(){return new eo(Wi(this,io))},n}(to),ao=new ro(i),so=(null===(Hi=ke())||void 0===Hi?void 0:Hi.zaloVersion)||"",uo=(null===(Vi=ke())||void 0===Vi?void 0:Vi.platformName)||"unknown";!!yt.isString(so)&&parseInt(so,10)>={android:12100571,iOS:400,wp:0,unknown:0}[uo]&&(null===(Ki=ke())||void 0===Ki?void 0:Ki.appEnv.isMp)&&(ao=new oo(i));var co=ao,lo=[si({data:ki.record(Kr(),ki.any())}).optional()];function po(e){return fo.apply(this,arguments)}function fo(){return fo=ge((function(e){return Ee(this,(function(t){return[2,wn("setStorage",lo,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp||Ce.isMpWeb?[4,co.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Me("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fo.apply(this,arguments)}var ho=[si({keys:ki.array(Kr())}).optional()];function mo(e){return vo.apply(this,arguments)}function vo(){return vo=ge((function(e){return Ee(this,(function(t){return[2,wn("getStorage",ho,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp||Ce.isMpWeb?[4,co.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Me("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vo.apply(this,arguments)}function yo(e){return go.apply(this,arguments)}function go(){return(go=ge((function(e){return Ee(this,(function(t){return[2,wn("getStorageInfo",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp||Ce.isMpWeb?[4,co.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Me("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var _o=[si({keys:ki.array(Kr())}).optional()];function wo(e){return bo.apply(this,arguments)}function bo(){return bo=ge((function(e){return Ee(this,(function(t){return[2,wn("removeStorage",_o,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp||Ce.isMpWeb?[4,co.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Me("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bo.apply(this,arguments)}var To=[si({prefix:Kr().optional()}).optional()];function Eo(e){return Po.apply(this,arguments)}function Po(){return(Po=ge((function(e){return Ee(this,(function(t){return[2,wn("clearStorage",To,[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp||Ce.isMpWeb?[4,co.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Me("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var So=function(){var e=ge((function(e,t){var n,r,o,a;return Ee(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,yn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,an.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=ge((function(e){var t,n,r,i;return Ee(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return r=o.sent(),i=null==r?void 0:r.user_id_by_oa,[2,{id:null==r?void 0:r.id,name:(null==r?void 0:r.name)||"",avatar:(null==r||null===(t=r.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url)||"",idByOA:i,followedOA:!!(null==r?void 0:r.is_follower),isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),Oo=[si({avatarType:ki.enum(["small","normal","large"]).optional(),autoRequestPermission:ki.boolean().default(!1).optional()}).optional()];function Ao(e){return Io.apply(this,arguments)}function Io(){return Io=ge((function(e){return Ee(this,(function(t){return[2,wn("getUserInfo",Oo,[e],function(){var e=ge((function(e){var t,n;return Ee(this,(function(r){switch(r.label){case 0:return Ce.isMp?(t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,[4,So(t,n)]):[3,2];case 1:return[2,{userInfo:r.sent()}];case 2:return Ce.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Me("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Io.apply(this,arguments)}var ko=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},Co=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(t){var n,r,i,o=t.network,a=(null===(n=ke())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)||!1;switch(o){case ko(a).NONE:i=d.none;break;case ko(a).WIFI:i=d.wifi;break;case ko(a)["2G"]:case ko(a)["3G"]:case ko(a)["4G"]:i=d.cellular;break;default:i=d.unknown}e(i)},fail:function(e){t(e)}},{})}))]}))}));function No(e){return Mo.apply(this,arguments)}function Mo(){return(Mo=ge((function(e){return Ee(this,(function(t){return[2,wn("getNetworkType",[],[e],ge((function(){var e,t;return Ee(this,(function(n){switch(n.label){case 0:return Ce.isMp?[4,Co()]:[3,2];case 1:return[2,{networkType:n.sent()}];case 2:if(Ce.isMpWeb){switch(e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,e.effectiveType){case"none":t=d.none;break;case"4g":t=d.wifi;break;case"3g":case"2g":t=d.cellular;break;default:t=d.unknown}return[2,Promise.resolve({networkType:t})]}return[2,Promise.reject(Me("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Ro=[ki.function().args(si({isConnected:ki.boolean(),networkType:ki.enum(["none","wifi","cellular","unknown"])})).returns(ki.void())];function xo(e){return wn("onNetworkStatusChange",Ro,[e],(function(e){var t=e;if(Ce.isMp)!function(e){Mt.getInstance().on(f.NetworkChanged,(function(t){var n=null==t?void 0:t.state;Co().then((function(t){e({isConnected:"CONNECTED"===n,networkType:t})}))}))}(t);else if(Ce.isMpWeb){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,r=n.effectiveType;n.addEventListener("change",(function(){var e;switch(r){case"none":e=d.none;break;case"4g":e=d.wifi;break;case"3g":case"2g":e=d.cellular;break;default:e=d.unknown}t({isConnected:!0,networkType:e})}))}}))}var Uo=function(){var e=ge((function(e){var t,n,r,i,o,a;return Ee(this,(function(s){return a={subaction:0,scanning_type:yt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:yt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:yt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:yt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:yt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:yt.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:yt.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:yt.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:yt.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:yt.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){nn("SCAN_IBEACON",xe({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Do=[si({scanningType:ki.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:ki.number().optional(),monitorInterval:ki.number().optional(),domain:ki.string().optional(),scanConfig:si({scanTime:ki.number().optional(),timeBetweenScan:ki.number().optional(),beaconTimeout:ki.number().optional(),delayCheckConnectedTimeout:ki.number().optional(),beaconConnectedTimeout:ki.number().optional()}).optional(),items:ki.array(si({id:ki.string().optional(),distance:ki.number().optional(),monitor:si({enable:ki.boolean().optional(),movingRange:ki.number().optional()}).optional()})).optional(),scanFromSource:ki.string().optional()}).optional()];function jo(e){return Lo.apply(this,arguments)}function Lo(){return(Lo=ge((function(e){return Ee(this,(function(t){return[2,wn("startBeaconDiscovery",Do,[e],ge((function(){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Uo(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Me("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Bo=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Zo(e){return zo.apply(this,arguments)}function zo(){return(zo=ge((function(e){return Ee(this,(function(t){return[2,wn("stopBeaconDiscovery",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Bo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Me("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Wo=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("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 Fo(e){return Go.apply(this,arguments)}function Go(){return(Go=ge((function(e){return Ee(this,(function(t){return[2,wn("getBeacons",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Wo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Me("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Ho=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Vo(e){return Ko.apply(this,arguments)}function Ko(){return(Ko=ge((function(e){return Ee(this,(function(t){return[2,wn("closeApp",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Ho()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Jo=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function qo(e){return Qo.apply(this,arguments)}function Qo(){return(Qo=ge((function(e){return Ee(this,(function(t){return[2,wn("scanQRCode",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Jo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Me("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var $o=function(){var e=ge((function(e,t,n,i){return Ee(this,(function(o){return[2,new Promise((function(o,a){nn("OPEN_PROFILE",{uId:e,type:m[t],zapp:r,sourceId:n,sourceIndex:i},{success:function(){o()},fail:function(e){a(e)}},{})}))]}))}));return function(t,n,r,i){return e.apply(this,arguments)}}(),Yo=[si({id:Kr(),type:ki.enum(["user","oa","aliasOA"]),sourceId:ki.any().optional(),sourceIndex:ki.any().optional()}).optional()];function Xo(e){return ea.apply(this,arguments)}function ea(){return ea=ge((function(e){return Ee(this,(function(t){return[2,wn("openProfile",Yo,[e],function(){var e=ge((function(e){var t,n,r,i;return Ee(this,(function(o){switch(o.label){case 0:return Ce.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,$o(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ea.apply(this,arguments)}var ta=function(){var e=ge((function(e,t){var n,i,o,a=arguments;return Ee(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){nn("OPEN_CHAT",{uId:e,type:v[t],msg:n,zapp:r,sourceId:i,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),na=[si({id:Kr(),type:ki.enum(["user","oa"]),sourceId:ki.any().optional(),sourceIndex:ki.any().optional(),message:Kr().optional()}).optional()];function ra(e){return ia.apply(this,arguments)}function ia(){return ia=ge((function(e){return Ee(this,(function(t){return[2,wn("openChat",na,[e],function(){var e=ge((function(e){var t,n,r,i,o;return Ee(this,(function(a){switch(a.label){case 0:return Ce.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,ta(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ia.apply(this,arguments)}function oa(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 aa=function(){var e=ge((function(e,t){var n;return Ee(this,(function(i){switch(n={},e){case"image":n={photoUrl:null==t?void 0:t.imageUrl};break;case"link":n={link:null==t?void 0:t.link,title:null==t?void 0:t.title,thumb:null==t?void 0:t.thumb,description:null==t?void 0:t.description};break;case"profile":n={avt:null==t?void 0:t.avatar,uid:null==t?void 0:t.id,dpn:null==t?void 0:t.displayName}}return[2,new Promise((function(t,i){nn("OPEN_POSTFEED",oa(xe({type:y[e]},n),{zapp:r}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){i(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),sa=[ki.union([si({type:ki.enum(["image"]),data:si({imageUrl:Kr().url().optional()})}),si({type:ki.enum(["link"]),data:si({link:Kr().url(),title:Kr().max(100).optional(),thumb:Kr().url().optional(),description:Kr().max(400).default("").optional()})}),si({type:ki.enum(["profile"]),data:si({id:Kr().optional()})})])];function ua(e){return ca.apply(this,arguments)}function ca(){return ca=ge((function(e){return Ee(this,(function(t){return[2,wn("openPostFeed",sa,[e],function(){var e=ge((function(e){var t,n;return Ee(this,(function(r){switch(r.label){case 0:return Ce.isMp?(t=e.type,n=e.data,[4,aa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Me("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ca.apply(this,arguments)}var la=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("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)}}(),da=[si({id:Kr(),showDialogConfirm:ki.boolean().optional()}).optional()];function pa(e){return fa.apply(this,arguments)}function fa(){return fa=ge((function(e){return Ee(this,(function(t){return[2,wn("followOA",da,[e],function(){var e=ge((function(e){var t;return Ee(this,(function(n){switch(n.label){case 0:return Ce.isMp?(t=e.id,[4,la(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fa.apply(this,arguments)}var ha=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ma=[si({id:Kr()}).optional()];function va(e){return ya.apply(this,arguments)}function ya(){return ya=ge((function(e){return Ee(this,(function(t){return[2,wn("unfollowOA",ma,[e],function(){var e=ge((function(e){var t;return Ee(this,(function(n){switch(n.label){case 0:return Ce.isMp?(t=e.id,[4,ha(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ya.apply(this,arguments)}var ga=function(){var e=ge((function(e,t,n,r,i,a){var s,c,d,p,f,h,m,v;return Ee(this,(function(y){switch(y.label){case 0:return d=new URL(location.href),p=new URLSearchParams,f="".concat(d.pathname.replace(u,"")).concat(d.search),a&&(f="/".concat(e).concat("/"===a[0]?"":"/").concat(a)),!(h=new URL("".concat(o).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(c=window.APP_VERSION)||void 0===c?void 0:c.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.CREATE_SHARE_LINK,xe({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw tn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,oa(xe({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),_a=function(){var e=ge((function(e,t){var n,o,a,s,u,c,l,d,p,f,h,m;return Ee(this,(function(v){switch(v.label){case 0:switch(n={},o=e,e){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return n={text:null==t?void 0:t.text,desc:(null==t?void 0:t.desc)||(null==t?void 0:t.description),autoParseLink:(null==t?void 0:t.autoParseLink)?1:0},[3,14];case 2:return c=[],l=(null===(s=ke())||void 0===s?void 0:s.zaloVersion)||0,d=(null===(u=ke())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=re[d]&&(o="multi_image"),Array.isArray(null==t?void 0:t.imageUrls)&&(null==t?void 0:t.imageUrls.length)>0?c=null==t?void 0:t.imageUrls:c.push(null==t?void 0:t.imageUrl),n={photoUrls:c,photoUrl:null==t?void 0:t.imageUrl,caption:null==t?void 0:t.caption},[3,14];case 3:return n={photoUrl:null==t?void 0:t.imageUrl,gifUrl:null==t?void 0:t.gifUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 4:return n={videoThumb:null==t?void 0:t.videoThumb,videoUrl:null==t?void 0:t.videoUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 5:return n={link:null==t?void 0:t.link,chatOnly:(null==t?void 0:t.chatOnly)?1:0},[3,14];case 6:return n={uid:null==t?void 0:t.id},[3,14];case 7:case 10:return[4,an.getAccessToken()];case 8:case 11:return a=v.sent(),[4,ga(i,a||"",(null==t?void 0:t.title)||"",(null==t?void 0:t.description)||"",(null==t?void 0:t.thumbnail)||"",null==t?void 0:t.path)];case 9:return p=v.sent(),n={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(i,"&shareId=").concat(p.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return f=v.sent().shareableLink,h=new URL(f),m=h.searchParams.getAll("zshareId"),h.searchParams.delete("zshareId"),m.length>0&&h.searchParams.append("zshareId",m[0]),n={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(e,t){nn("OPEN_SHARESHEET",oa(xe({type:g[o]},n),{zapp:r}),{success:function(t){e({status:null==t?void 0:t.status,shareType:null==t?void 0:t.share_type,numberOfUser:null==t?void 0:t.uid_to_size})},fail:function(e){t(e)}},{timeout:!1})}))]}}))}));return function(t,n){return e.apply(this,arguments)}}(),wa=[ki.union([si({type:ki.enum(["text"]),data:si({text:Kr(),description:Kr().default("").optional(),autoParseLink:ki.boolean().default(!1).optional()})}),si({type:ki.enum(["image"]),data:si({imageUrl:Kr().url(),imageUrls:ki.array(Kr().url()).max(10).optional()})}),si({type:ki.enum(["link"]),data:si({link:Kr().url(),chatOnly:ki.boolean().optional()})}),si({type:ki.enum(["oa"]),data:si({id:Kr()})}),si({type:ki.enum(["gif"]),data:si({gifUrl:Kr().url(),imageUrl:Kr().url().optional(),width:Jr().min(0).optional(),height:Jr().min(0).optional()})}),si({type:ki.enum(["video"]),data:si({videoThumb:Kr().url(),videoUrl:Kr().url(),width:Jr().min(0).optional(),height:Jr().min(0).optional()})}),si({type:ki.enum(["zmp","zmp_deep_link"]),data:si({title:Kr().max(100),thumbnail:Kr().url(),path:Kr().optional(),description:Kr().max(400).default("").optional()})})])];function ba(e){return Ta.apply(this,arguments)}function Ta(){return Ta=ge((function(e){return Ee(this,(function(t){return[2,wn("openShareSheet",wa,[e],function(){var e=ge((function(e){var t,n;return Ee(this,(function(r){switch(r.label){case 0:return Ce.isMp?(t=e.type,n=e.data,[4,_a(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Me("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ta.apply(this,arguments)}var Ea=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=ke())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)?e({userAllow:void 0===t.error_code||(null==t?void 0:t.error_code)>=0,message:void 0===t.error_code?"User allowed":null==t?void 0:t.error_message}):e({userAllow:(null==t?void 0:t.error_code)>=0,message:null==t?void 0:t.error_message})},fail:function(n){var r,i;(null===(r=ke())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)&&"number"==typeof(null==n?void 0:n.code)?e({userAllow:(null==n?void 0:n.code)>=0,message:null==n?void 0:n.message}):t(n)}},{isMultiCallback:!0})}))]}))}));function Pa(e){return Sa.apply(this,arguments)}function Sa(){return(Sa=ge((function(e){return Ee(this,(function(t){return[2,wn("requestCameraPermission",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return[4,Ea()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Oa=function(){var e=ge((function(e,t,n){return Ee(this,(function(r){return[2,new Promise((function(r,i){nn("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)}}(),Aa=ge((function(){var e,t,n,r=arguments;return Ee(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=In(),[4,Ft(e,t,n.version)];case 1:return[2,o.sent()]}}))})),Ia=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ka=[si({params:ki.record(Kr(),Kr()).optional()}).optional()];function Ca(e){return Na.apply(this,arguments)}function Na(){return Na=ge((function(e){return Ee(this,(function(t){return[2,wn("createShortcut",ka,[e],function(){var e=ge((function(e){var t,n,r,a,s,u,c,l;return Ee(this,(function(d){switch(d.label){case 0:return Ce.isMp?[4,Aa(i,0)]:[3,6];case 1:return r=d.sent(),a=null===(t=ke())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||pn("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,Ia(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Oa("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,tn.success()];case 6:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Na.apply(this,arguments)}var Ma=function(){var e=ge((function(e,t,n){return Ee(this,(function(i){return[2,new Promise((function(i,o){nn("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)}}(),Ra=[si({secretData:Kr(),ui:si({title:Kr().default("Xác thực").optional(),subTitle:Kr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:Kr().default("Đóng").optional()}).optional(),requireFingerprint:$r().default(!0).optional()}).optional()];function xa(e){return Ua.apply(this,arguments)}function Ua(){return Ua=ge((function(e){return Ee(this,(function(t){return[2,wn("openBioAuthentication",Ra,[e],function(){var e=ge((function(e){var t,n,r;return Ee(this,(function(i){switch(i.label){case 0:return Ce.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Ma(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Me("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ua.apply(this,arguments)}var Da=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("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 ja(e){return La.apply(this,arguments)}function La(){return(La=ge((function(e){return Ee(this,(function(t){return[2,wn("checkStateBioAuthentication",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Da()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Ce.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Me("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Ba=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Za=[si({message:Kr()}).optional()];function za(e){return Wa.apply(this,arguments)}function Wa(){return Wa=ge((function(e){return Ee(this,(function(t){return[2,wn("showToast",Za,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ba(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wa.apply(this,arguments)}var Fa=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ga(e){return Ha.apply(this,arguments)}function Ha(){return(Ha=ge((function(e){return Ee(this,(function(t){return[2,wn("hideKeyboard",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Fa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var Va=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ka=[si({phoneNumber:Kr()})];function Ja(e){return qa.apply(this,arguments)}function qa(){return qa=ge((function(e){return Ee(this,(function(t){return[2,wn("openPhone",Ka,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Va(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qa.apply(this,arguments)}var Qa=function(){var e=ge((function(e,t){return Ee(this,(function(n){return[2,new Promise((function(n,r){nn("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),$a=[si({content:Kr(),phoneNumber:Kr()})];function Ya(e){return Xa.apply(this,arguments)}function Xa(){return Xa=ge((function(e){return Ee(this,(function(t){return[2,wn("openSMS",$a,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Qa(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xa.apply(this,arguments)}var es=function(){var e=ge((function(e){var t,n=arguments;return Ee(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){nn("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)}}(),ts=[si({id:Kr(),displayName:Kr().default("").optional()})];function ns(e){return rs.apply(this,arguments)}function rs(){return rs=ge((function(e){return Ee(this,(function(t){return[2,wn("viewOAQr",ts,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,es(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rs.apply(this,arguments)}var is=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("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)}}(),os=[si({keepScreenOn:$r()})];function as(e){return ss.apply(this,arguments)}function ss(){return ss=ge((function(e){return Ee(this,(function(t){return[2,wn("keepScreen",os,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,is(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ss.apply(this,arguments)}function us(e){return cs.apply(this,arguments)}function cs(){return(cs=ge((function(e){return Ee(this,(function(t){return[2,wn("onKeepScreen",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,is(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function ls(e){return ds.apply(this,arguments)}function ds(){return(ds=ge((function(e){return Ee(this,(function(t){return[2,wn("offKeepScreen",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,is(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var ps=function(){var e=ge((function(e,t){var n;return Ee(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){nn("SAVE_IMAGE_GALLERY",xe({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),fs=[si({imageBase64Data:Kr().optional(),imageUrl:Kr().url().optional()}).optional()];function hs(e){return ms.apply(this,arguments)}function ms(){return ms=ge((function(e){return Ee(this,(function(t){return[2,wn("saveImageToGallery",fs,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,ps(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ms.apply(this,arguments)}var vs=function(){var e=ge((function(e){var t,n,r,i,o,s,u=arguments;return Ee(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,Aa(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=Ue(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){nn("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),ys=[si({appId:Kr(),path:Kr().optional(),params:ki.record(Kr(),Kr()).optional()})];function gs(e){return _s.apply(this,arguments)}function _s(){return _s=ge((function(e){return Ee(this,(function(t){return[2,wn("openMiniApp",ys,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,vs(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_s.apply(this,arguments)}var ws=ge((function(){var e,t,n=arguments;return Ee(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){nn("INTERACTIVE_VIBRATION",{type:w[e],vibrate_time:t},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))})),bs=[si({type:ki.enum(["oneShot"]).default("oneShot"),milliseconds:Jr().optional()})];function Ts(e){return Es.apply(this,arguments)}function Es(){return Es=ge((function(e){return Ee(this,(function(t){return[2,wn("vibrate",bs,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,ws(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Es.apply(this,arguments)}var Ps=function(){var e=ge((function(e,t){var n,r,i,o;return Ee(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=yt.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Ht(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Ht(null==t?void 0:t.leftButton):"back"},!r&&yt.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){nn("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ss=[si({url:Kr(),config:si({style:ki.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:ki.enum(["back","none"]).default("back").optional()}).optional()})];function Os(e){return As.apply(this,arguments)}function As(){return As=ge((function(e){return Ee(this,(function(t){return[2,wn("openWebview",Ss,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ps(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),As.apply(this,arguments)}function Is(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Ut.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function ks(){return wn("getRouteParams",[],[],(function(){return Is()}))}function Cs(e){return Ns.apply(this,arguments)}function Ns(){return(Ns=ge((function(e){return Ee(this,(function(t){return[2,wn("getAppInfo",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Aa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Me("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Ms=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("WEBVIEW_SET_RESULT",{result:fn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Rs=[si({data:ki.any()})];function xs(e){return Us.apply(this,arguments)}function Us(){return Us=ge((function(e){return Ee(this,(function(t){return[2,wn("sendDataToPreviousMiniApp",Rs,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ms(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Us.apply(this,arguments)}var Ds=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){var n,r;nn("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(tn.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=ke())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function js(e){return Ls.apply(this,arguments)}function Ls(){return(Ls=ge((function(e){return Ee(this,(function(t){return[2,wn("getPhoneNumber",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Ds()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Me("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var Bs=ge((function(){var e,t=arguments;return Ee(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){nn("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})}))]}))})),Zs=[si({maxProfile:Jr().min(1).max(10).optional().default(1)})];function zs(e){return Ws.apply(this,arguments)}function Ws(){return Ws=ge((function(e){return Ee(this,(function(t){return[2,wn("openProfilePicker",Zs,[e],function(){var e=ge((function(e){var t,n,r,i,o;return Ee(this,(function(a){switch(a.label){case 0:return Ce.isMp?[4,Bs(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,an.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(yt.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 Ce.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Me("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ws.apply(this,arguments)}var Fs=function(){var e=ge((function(e,t,n){var r;return Ee(this,(function(i){return r=t&&yt.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){nn("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)}}(),Gs=[si({SSID:Kr(),password:Kr().optional(),hiddenSSID:$r().optional()})];function Hs(e){return Vs.apply(this,arguments)}function Vs(){return Vs=ge((function(e){return Ee(this,(function(t){return[2,wn("connectWifi",Gs,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Fs(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vs.apply(this,arguments)}var Ks=function(){var e=ge((function(e,t,n,r,i,o){var a,s;return Ee(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){nn("PICK_MEDIA",{media_type:b[e],edit_view:xe({},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)}}(),Js=[si({type:ki.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:Kr().url(),maxItemSize:Jr().min(0).optional(),editView:si({enable:$r().optional(),aspectRatio:Kr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:$r().optional(),maxSelectItem:Jr().min(1).optional()})];function qs(e){return Qs.apply(this,arguments)}function Qs(){return Qs=ge((function(e){return Ee(this,(function(t){return[2,wn("openMediaPicker",Js,[e],function(){var e=ge((function(e){var t,n,r,i,o,a;return Ee(this,(function(s){switch(s.label){case 0:return Ce.isMp?(i={},yt.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,Ks(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Ce.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Me("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qs.apply(this,arguments)}var $s=[si({title:Kr().max(100),description:Kr().max(400).default(""),thumbnail:Kr().url().optional(),path:Kr().optional()})];function Ys(e){return Xs.apply(this,arguments)}function Xs(){return Xs=ge((function(e){return Ee(this,(function(t){return[2,wn("getShareableLink",$s,[e],function(){var e=ge((function(e){var t;return Ee(this,(function(n){switch(n.label){case 0:return[4,an.getAccessToken()];case 1:return t=n.sent(),[4,ga(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)}}())]}))})),Xs.apply(this,arguments)}var eu=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("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 tu(e){return nu.apply(this,arguments)}function nu(){return(nu=ge((function(e){return Ee(this,(function(t){return[2,wn("closeLoading",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,eu("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function ru(e){return iu.apply(this,arguments)}function iu(){return iu=ge((function(e){return Ee(this,(function(t){return[2,wn("requestUpdateZalo",[],[e],ge((function(){var e,t,n;return Ee(this,(function(r){switch(r.label){case 0:return Ce.isMp?(n=(null===(e=ke())||void 0===e||null===(t=e.platform)||void 0===t?void 0:t.isIOS)?"https://apps.apple.com/vn/app/zalo/id579523206":"https://play.google.com/store/apps/details?id=com.zing.zalo",[4,Ia(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("requestUpdateZalo",{}))]}}))})))]}))})),iu.apply(this,arguments)}var ou=Mt.getInstance();ou.addListener=function(e,t,n){var r=e;return ou.addListener(f[r],t,n)};var au=[ki.function()];function su(e){return wn("onConfirmToExit",au,[e],(function(e){var t=e;Ce.isMp&&(ou.on(f.AppClose,t,'{"handle_h5": 1}'),Ni.setNavigationBarLeftButton(void 0,2))}))}function uu(){return wn("offConfirmToExit",[],[],(function(){Ce.isMp&&(ou.off(f.AppClose),Ni.setNavigationBarLeftButton(void 0,0))}))}function cu(){return wn("getDeviceId",[],[],(function(){return Ce.isMp&&an.getSync(c.DEVICE_ID)||""}))}function lu(e){return du.apply(this,arguments)}function du(){return(du=ge((function(e){return Ee(this,(function(t){return[2,wn("getDeviceIdAsync",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,an.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function pu(){return wn("getContext",[],[],(function(){if(Ce.isMp){var e=an.getSync(c.CONTEXT_ID)||"";return{type:an.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function fu(e){return hu.apply(this,arguments)}function hu(){return(hu=ge((function(e){return Ee(this,(function(t){return[2,wn("getContextAsync",[],[e],ge((function(){var e;return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,an.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,an.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 mu(e){return vu.apply(this,arguments)}function vu(){return(vu=ge((function(e){return Ee(this,(function(t){return[2,wn("getAuthCode",[],[e],ge((function(){var e,t;return Ee(this,(function(n){switch(n.label){case 0:return Ce.isMp?[4,an.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,an.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,an.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Gt([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),tn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function yu(e){return gu.apply(this,arguments)}function gu(){return(gu=ge((function(e){return Ee(this,(function(t){return[2,wn("getZPIToken",[],[e],ge((function(){var e,t,n,r;return Ee(this,(function(i){switch(i.label){case 0:return Ce.isMp?[4,an.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,an.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,an.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,an.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 _u=[Kr()];function wu(e){return wn("setAccessToken",_u,[e],(function(e){var t=e;an.setAccessToken(t)}))}var bu=[si({url:Kr().url()})];function Tu(e){return Eu.apply(this,arguments)}function Eu(){return Eu=ge((function(e){return Ee(this,(function(t){return[2,wn("openOutApp",bu,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ia(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Eu.apply(this,arguments)}var Pu=[si({count:Jr().min(1).optional().default(1),sourceType:ki.array(ki.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:ki.enum(["back","front"]).default("front").optional()})];function Su(e){return Ou.apply(this,arguments)}function Ou(){return Ou=ge((function(e){return Ee(this,(function(t){return[2,wn("chooseImage",Pu,[e],function(){var e=ge((function(e){var t,n,r,i;return Ee(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)}}())]}))})),Ou.apply(this,arguments)}var Au=ge((function(){var e,t,n=arguments;return Ee(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){nn("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(tn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Iu(e){return ku.apply(this,arguments)}function ku(){return(ku=ge((function(e){return Ee(this,(function(t){return[2,wn("getLocation",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Au()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Me("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Cu=[ki.function().args(si({data:ki.any()})).returns(ki.void())];function Nu(e){return wn("onCallbackData",Cu,[e],(function(){!function(e){Mt.getInstance().on(f.OnDataCallback,(function(t){e({data:t})}))}(e)}))}var Mu=function(){var e=ge((function(e){var t,n,r,o,a,s,u,c,l,d,p;return Ee(this,(function(f){switch(f.label){case 0:return n="",e||(e=Is()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Ut.getParameterByName("orderId",e),o=Ut.getParameterByName("appTransID",e)||Ut.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,an.getAccessToken().catch((function(){throw tn.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(se),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 tn.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,xe({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Ru=function(){var e=ge((function(e,t,n,r,o,a,s){var u,c,l,d,p,h,m,v,y,g,_,w,b,T,E,P,S,O,A,I,k;return Ee(this,(function(C){switch(C.label){case 0:u=i,(c=new URLSearchParams).append("amount",e.toString()),c.append("item",encodeURIComponent(JSON.stringify(t))),c.append("appId",u),n&&c.append("desc",encodeURIComponent(n)),r&&(l=r,"object"==typeof r&&(l=JSON.stringify(r)),c.append("extradata",encodeURIComponent(l))),o&&(d=o,"object"==typeof o&&(d=JSON.stringify(o)),c.append("payload",encodeURIComponent(d))),a&&("string"==typeof a?(c.append("method",a),c.append("isCustom","false")):"object"==typeof a&&(c.append("method",a.id),c.append("isCustom",JSON.stringify(a.isCustom)))),s&&c.append("mac",s),p={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,an.getAccessToken().catch((function(){throw tn.error.loginRequired}))];case 2:return m=C.sent(),p.headers.authorization="Bearer ".concat(m),[4,fetch(oe,oa(xe({method:"POST"},p),{body:c}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw tn.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=v.data.messageToken||"",w=window.APP_VERSION,b=window.APP_ENV,T={miniAppId:u,orderId:y},E=v.data.method,P=v.data.isCustom,g&&(T.token=g),w&&(T.version=w),b&&(T.env=b),E&&(T.method=E),P&&(T.isCustom=P),S=Ut.encode(T),O=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),A=Vt(),I=((null===(h=ke())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,Ps(O,{style:"android"===I&&A<742?"normal":"bottomSheet"}).then((function(){var e=!1;Mt.getInstance().once(f.WebviewClosed,(function(){setTimeout(ge((function(){var t;return Ee(this,(function(n){switch(n.label){case 0:return e?[3,2]:[4,Mu({zmpOrderId:y})];case 1:(t=n.sent()).err>=0&&!t.isCustom&&Mt.getInstance().emit(f.PaymentClose,t.err,oa(xe({},t),{zmpOrderId:y})),n.label=2;case 2:return[2]}}))})),500)})),Mt.getInstance().once(f.OpenApp,(function(){e=!0}))}))];case 5:return C.sent(),[2,{orderId:y,messageToken:_}];case 6:throw k=C.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(t,n,r,i,o,a,s){return e.apply(this,arguments)}}(),xu=[si({amount:ki.union([Kr(),Jr()]),item:ki.array(ki.record(Kr(),ki.any())),desc:Kr(),extradata:ki.any().optional(),payload:ki.any().optional(),method:ki.union([ki.string(),ki.object({id:ki.string(),isCustom:ki.boolean()})]).optional(),mac:ki.string().optional()})];function Uu(e){return Du.apply(this,arguments)}function Du(){return Du=ge((function(e){return Ee(this,(function(t){return[2,wn("createOrder",xu,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ru(e.amount,e.item,e.desc,e.extradata,e.payload,e.method,e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Me("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Du.apply(this,arguments)}var ju=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),Lu=function(){var e=ge((function(e,t,n,r,o){var a,s,u,c,l,d,p,f,h,m,v,y;return Ee(this,(function(g){switch(g.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 "}},g.label=1;case 1:return g.trys.push([1,10,,11]),[4,an.getAccessToken().catch((function(){throw tn.error.loginRequired}))];case 2:return l=g.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,an.jumpAndGetToken()];case 3:if(g.sent(),d=null===(c=an.miniProgramConfig)||void 0===c?void 0:c.showConfirmToPayment,console.log("showConfirmToPayment",d),!d)return[3,7];g.label=4;case 4:return g.trys.push([4,6,,7]),[4,ju()];case 5:return g.sent(),[3,7];case 6:throw p=g.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(ue,oa(xe({method:"POST"},u),{body:s}))];case 8:return[4,g.sent().json()];case 9:if(!(f=g.sent()).data||0!==f.err)throw tn.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 y=g.sent(),console.log("Internal error"),y;case 11:return[2]}}))}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),Bu=[si({amount:ki.union([ki.string(),ki.number()]),desc:ki.string(),method:ki.string(),transId:ki.string().optional(),mac:ki.string().optional()})];function Zu(e){return zu.apply(this,arguments)}function zu(){return zu=ge((function(e){return Ee(this,(function(t){return[2,wn("purchase",Bu,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Lu(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 Ce.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Me("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zu.apply(this,arguments)}var Wu=function(){var e=ge((function(e,t){return Ee(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;nn("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)}}(),Fu=[si({channels:ai(si({method:Kr(),subMethod:Kr().optional(),subInfo:Kr().optional()})).optional(),selectedMethod:si({method:Kr(),subMethod:Kr().optional()}).optional()}).optional()];function Gu(e){return Hu.apply(this,arguments)}function Hu(){return Hu=ge((function(e){return Ee(this,(function(t){return[2,wn("selectPaymentMethod",Fu,[e],function(){var e=ge((function(e){var t,n;return Ee(this,(function(r){switch(r.label){case 0:return Ce.isMp?(t=e.channels,n=e.selectedMethod,[4,Wu(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Me("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hu.apply(this,arguments)}var Vu=[si({data:ki.union([Kr(),ki.record(Kr(),Kr())])})];function Ku(e){return Ju.apply(this,arguments)}function Ju(){return Ju=ge((function(e){return Ee(this,(function(t){return[2,wn("checkTransaction",Vu,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Mu(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Me("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ju.apply(this,arguments)}var qu=[si({hide:$r().default(!1).optional()}).optional()];function Qu(e){return $u.apply(this,arguments)}function $u(){return $u=ge((function(e){return Ee(this,(function(t){return[2,wn("setAndroidBottomNavigationBar",qu,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ni.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$u.apply(this,arguments)}var Yu=[si({hide:$r().default(!1).optional()}).optional()];function Xu(e){return ec.apply(this,arguments)}function ec(){return ec=ge((function(e){return Ee(this,(function(t){return[2,wn("setIOSBottomSafeArea",Yu,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ni.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ec.apply(this,arguments)}var tc=[si({type:ki.enum(["normal","hidden","transparent"]).default("normal").optional(),color:ki.string().optional()}).optional()];function nc(e){return rc.apply(this,arguments)}function rc(){return rc=ge((function(e){return Ee(this,(function(t){return[2,wn("setStatusBar",tc,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ni.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rc.apply(this,arguments)}var ic=[si({headerTextColor:ki.enum(["black","white"]).optional(),headerColor:ki.string().optional(),actionBar:si({hide:ki.boolean().optional(),title:ki.string().optional(),leftButton:ki.enum(["back","none"]).optional(),textAlign:ki.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:ki.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:ki.boolean().optional(),hideIOSSafeAreaBottom:ki.boolean().optional()})];function oc(e){return ac.apply(this,arguments)}function ac(){return ac=ge((function(e){return Ee(this,(function(t){return[2,wn("configAppView",ic,[e],function(){var e=ge((function(e){var t,n,r,i,o,a,s;return Ee(this,(function(u){switch(u.label){case 0:return Ce.isMp?yt.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Ni.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return yt.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,Ni.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Ni.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,Ni.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Ni.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 Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ac.apply(this,arguments)}var sc=function(){var e=ge((function(e,t,n,r,o,a){var s,u,c,l,d,p,f,h,m,v,y,g,_,w;return Ee(this,(function(b){switch(b.label){case 0:d=i,(p=new URLSearchParams).append("payType",t||T.SUBSCRIPTION),f=E.UNKNOW,n===le&&(f=E.IMMEDIATE_AND_CHARGE_FULL_PRICE),n===ce&&(f=E.DEFERRED),p.append("utm",o||"default"),p.append("merchantTransId",a||""),p.append("prorationMode",f.toString()),p.append("appId",d),r&&p.append("method",r),h="",(null===(s=ke())||void 0===s||null===(u=s.platform)||void 0===u?void 0:u.isIOS)?h="ios":(null===(c=ke())||void 0===c||null===(l=c.platform)||void 0===l?void 0:l.isAndroid)&&(h="android"),p.append("os",h),p.append("productId",e),m={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},b.label=1;case 1:return b.trys.push([1,5,,6]),[4,an.getAccessToken().catch((function(){throw tn.error.loginRequired}))];case 2:return v=b.sent(),m.headers.authorization="Bearer ".concat(v),[4,fetch(ae,oa(xe({method:"POST"},m),{body:p}))];case 3:return[4,b.sent().json()];case 4:if(!(y=b.sent()).data||!y.data.store||0!==y.err)throw tn.error.createIAPOrderFailed(y.err);return g=y.data.store,_=y.data.orderId,[2,new Promise((function(e,t){nn("IAP_REQUESTPAYMENT",xe({},g),{success:function(){e({orderId:_})},fail:function(e){t(e)}})}))];case 5:throw w=b.sent(),console.log("Internal error"),w;case 6:return[2]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),uc=[si({productId:Kr(),payType:ki.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:ki.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:Kr().optional(),method:ki.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:Kr().optional()})];function cc(e){return lc.apply(this,arguments)}function lc(){return lc=ge((function(e){return Ee(this,(function(t){return[2,wn("createOrderIAP",uc,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,sc(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Me("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),lc.apply(this,arguments)}var dc=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function pc(e){return fc.apply(this,arguments)}function fc(){return(fc=ge((function(e){return Ee(this,(function(t){return[2,wn("minimizeApp",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,dc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var hc=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function mc(e){return vc.apply(this,arguments)}function vc(){return(vc=ge((function(e){return Ee(this,(function(t){return[2,wn("openPermissionSetting",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,hc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var yc=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function gc(e){return _c.apply(this,arguments)}function _c(){return(_c=ge((function(e){return Ee(this,(function(t){return[2,wn("favoriteApp",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,yc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var wc=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function bc(e){return Tc.apply(this,arguments)}function Tc(){return(Tc=ge((function(e){return Ee(this,(function(t){return[2,wn("openGroupList",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,wc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Ec=ge((function(){var e;return Ee(this,(function(t){switch(t.label){case 0:return[4,an.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){nn("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function Pc(e){return Sc.apply(this,arguments)}function Sc(){return(Sc=ge((function(e){return Ee(this,(function(t){return[2,wn("requestSendNotification",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Ec()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var Oc=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Ac(e){return Ic.apply(this,arguments)}function Ic(){return(Ic=ge((function(e){return Ee(this,(function(t){return[2,wn("addRating",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Oc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Me("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var kc,Cc=(kc=ge((function(e,t,n){var r,i;return Ee(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,xe({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return kc.apply(this,arguments)}),Nc=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("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)}}(),Mc=[si({oaId:Kr()})];function Rc(e){return xc.apply(this,arguments)}function xc(){return xc=ge((function(e){return Ee(this,(function(t){return[2,wn("interactOA",Mc,[e],function(){var e=ge((function(e){var t,n,r;return Ee(this,(function(o){switch(o.label){case 0:return Ce.isMp?(t=e.oaId,[4,an.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||yt.isEmpty(n)?[3,3]:[4,Cc(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,Nc(t)];case 4:return[2,o.sent()];case 5:return Ce.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Me("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xc.apply(this,arguments)}var Uc=[si({oaId:Kr()})];function Dc(e){return jc.apply(this,arguments)}function jc(){return jc=ge((function(e){return Ee(this,(function(t){return[2,wn("isAllowedInteractWithOA",Uc,[e],function(){var e=ge((function(e){var t,n,r;return Ee(this,(function(o){switch(o.label){case 0:return Ce.isMp?(t=e.oaId,[4,an.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||yt.isEmpty(n)?[3,3]:[4,Cc(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 Ce.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Me("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),jc.apply(this,arguments)}function Lc(e){return Bc.apply(this,arguments)}function Bc(){return(Bc=ge((function(e){return Ee(this,(function(t){return[2,wn("getSetting",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Xt()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Me("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Zc=ki.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),zc=[si({scopes:ki.array(Zc).max(2).optional()}).optional()];function Wc(e){return Fc.apply(this,arguments)}function Fc(){return Fc=ge((function(e){return Ee(this,(function(t){return[2,wn("authorize",zc,[e],function(){var e=ge((function(e){var t,n,r,i;return Ee(this,(function(o){switch(o.label){case 0:return Ce.isMp?(n=null==e?void 0:e.scopes,r=Vt(),("android"===(i=((null===(t=ke())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject(tn.error.clientNotSupport())]:[4,rn(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Me("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fc.apply(this,arguments)}var Gc=ge((function(){return Ee(this,(function(e){return[2,new Promise(function(){var e=ge((function(e,t){var n;return Ee(this,(function(r){switch(r.label){case 0:return yt.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(tn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Hc(e){return wn("checkZaloCameraPermission",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return[4,Gc()];case 1:return[2,e.sent()]}}))})))}var Vc=ge((function(){return Ee(this,(function(e){return[2,new Promise(function(){var e=ge((function(e,t){var n,r,i;return Ee(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,an.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=an.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 Kc(e){return Jc.apply(this,arguments)}function Jc(){return(Jc=ge((function(e){return Ee(this,(function(t){return[2,wn("getUserID",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Vc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Me("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var qc=ge((function(){return Ee(this,(function(e){return[2,new Promise(function(){var e=ge((function(e,t){var n,r,i;return Ee(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,an.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=an.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 Qc(e){return $c.apply(this,arguments)}function $c(){return($c=ge((function(e){return Ee(this,(function(t){return[2,wn("getIDToken",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,qc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Me("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Yc={format:C.JPEG,quality:N.NORMAL,mirrored:!1,useVideoSourceSize:!1},Xc={width:1024,height:768,facingMode:k.FRONT,mirrored:!1,audio:!1,video:!0},el=function(){function e(t){var n,r,i,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=this;gt(this,e),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(u.haveVideoStream()&&u._userRequestFrameCallback){var e=u.getCanvas();if(u.drawFrame(),e){var t={data:e.toDataURL(C.PNG),width:e.width,height:e.height};Mt.getInstance().emit(I.OnFrameCallback,0,t),requestAnimationFrame(u.tick)}}},this._videoElement=t,this._mediaConstraints=null!=s?s:null,this._facingMode=null!==(n=null==s?void 0:s.facingMode)&&void 0!==n?n:Xc.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:Xc.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(o=null==s?void 0:s.audio)&&void 0!==o?o:Xc.audio,this._videoEnabled=null!==(a=null==s?void 0:s.video)&&void 0!==a?a:Xc.video}var t=e.prototype;return t.on=function(e,t){Mt.getInstance().on(e,(function(e){t(e)})),e===I.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},t.off=function(e){Mt.getInstance().off(e),e===I.OnFrameCallback&&(this._userRequestFrameCallback=!1)},t.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},t.getFacingMode=function(){return this._facingMode},t.getCameraList=function(){return this._cameraList},t.getCameraCount=function(){return this._cameraList.length},t.getSelectedDeviceId=function(){return this._selectedDeviceId},t.setDeviceId=function(e){var t=this;return ge((function(){return Ee(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 ge((function(){var n,r,i,o,a,s;return Ee(this,(function(u){switch(u.label){case 0:return yt.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||Xc.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||Xc.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},t.selectCamera=function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._cameraList[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;if(this._facingMode==k.FRONT&&o.label.toLowerCase().includes("front")||this._facingMode==k.BACK&&o.label.toLowerCase().includes("back")){this._selectedDeviceId=o.deviceId;break}}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}},t.flip=function(){var e=this;return ge((function(){return Ee(this,(function(t){switch(t.label){case 0:return e._facingMode=e._facingMode==k.FRONT?k.BACK:k.FRONT,e._videoElement.style.transform="",e.selectCamera(),e._hasUserMedia?[4,e.stream()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))()},t.start=function(){var e=this;return ge((function(){var t,n;return Ee(this,(function(r){return t=Mt.getInstance(),n=function(t){try{e._hasUserMedia&&e.stop()}catch(e){}},t.off(f.AppPaused,n),t.on(f.AppPaused,n),[2,new Promise(function(){var t=ge((function(t,n){var r;return Ee(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e.stream()];case 1:return i.sent(),Mt.getInstance().emit(I.OnStartCallback,0),t(e._selectedDeviceId),[3,3];case 2:return r=i.sent(),n(r),[3,3];case 3:return[2]}}))}));return function(e,n){return t.apply(this,arguments)}}())]}))}))()},t.info=function(){var e=this;return ge((function(){return Ee(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 ge((function(){return Ee(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=ge((function(n){return Ee(this,(function(r){switch(r.label){case 0:return[4,e.info()];case 1:return r.sent(),e.selectCamera(),e.handleUserMedia(null,n),t(e._facingMode),[2]}}))}));return function(e){return n.apply(this,arguments)}}()).catch((function(t){e.handleUserMedia(t),n(t)}))}catch(e){n(e)}}))]}))}))()},t.handleUserMedia=function(e,t){var n=this;if(!e&&t){this._stream=t;try{this._videoElement&&(this._videoElement.srcObject=t,(this._facingMode==k.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){n._userRequestFrameCallback&&n.tick()},this._videoElement.play().then((function(){n._hasUserMedia=!0})).catch((function(e){n._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},t.updateTrackEnable=function(e,t){var n=this;return ge((function(){return Ee(this,(function(r){switch(r.label){case 0:if(e===M.VIDEO){if(n._videoEnabled===t)return[2];n._videoEnabled=t}else{if(n._audioEnabled===t)return[2];n._audioEnabled=t}return[4,n.stream()];case 1:return r.sent(),[2]}}))}))()},t.pause=function(e){var t=this;return ge((function(){return Ee(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 ge((function(){return Ee(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(),Mt.getInstance().emit(I.OnStopCallback,0)},t._stop=function(){e.stopMediaStream(this._stream),this._hasUserMedia=!1},t.setFacingMode=function(e){this._facingMode=e},t.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},t.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||Yc.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},t.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},t.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},t.drawFrame=function(e){var t=this._videoElement,n=e||{};if(t&&this._ctx&&this._canvasElement){var r=this._canvasElement,i=this._ctx;r.width=(null==n?void 0:n.width)||r.width,r.height=(null==n?void 0:n.height)||r.height,((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===k.FRONT)&&(i.translate(r.width,0),i.scale(-1,1)),i.drawImage(t,0,0,r.width,r.height),((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===k.FRONT)&&(i.scale(-1,1),i.translate(-r.width,0))}},e.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},e}(),tl=si({play:ki.function(),pause:ki.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),nl=[si({videoElement:tl,mediaConstraints:ki.object({width:ki.number().min(100).optional(),height:ki.number().min(100).optional(),facingMode:ki.string().optional(),audio:ki.boolean().optional(),video:ki.boolean().optional(),deviceId:ki.string().optional(),mirrored:ki.boolean().optional()}).nullish()}).optional()];function rl(e){return wn("createCameraContext",nl,[e],(function(e){return console.log("createCameraContext",e),new el(e.videoElement,e.mediaConstraints)}))}var il=function(){function e(){var t,n;gt(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=Te(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;yt.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?yt.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?yt.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 ol(e){return al.apply(this,arguments)}function al(){return(al=ge((function(e){return Ee(this,(function(t){return[2,wn("setupAd",[],[e],(function(){return il.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var sl=[si({ids:ki.union([ki.string(),ki.array(ki.string())]),config:si({display:ki.boolean().optional(),onClose:ki.function().optional()}).optional()})];function ul(e){return cl.apply(this,arguments)}function cl(){return cl=ge((function(e){return Ee(this,(function(t){return[2,wn("loadAd",sl,[e],function(){var e=ge((function(e){return Ee(this,(function(t){return il.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cl.apply(this,arguments)}var ll=[si({id:ki.string()})];function dl(e){return pl.apply(this,arguments)}function pl(){return pl=ge((function(e){return Ee(this,(function(t){return[2,wn("displayAd",ll,[e],function(){var e=ge((function(e){return Ee(this,(function(t){return il.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pl.apply(this,arguments)}var fl=[si({id:ki.string().optional()}).optional()];function hl(e){return ml.apply(this,arguments)}function ml(){return ml=ge((function(e){return Ee(this,(function(t){return[2,wn("refreshAd",fl,[e],function(){var e=ge((function(e){return Ee(this,(function(t){return il.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ml.apply(this,arguments)}var vl=[si({id:Kr(),guidingText:Kr().optional(),color:Kr().optional(),onStatusChange:ki.function().optional()})];function yl(e){return gl.apply(this,arguments)}function gl(){return gl=ge((function(t){return Ee(this,(function(n){return[2,wn("showOAWidget",vl,[t],function(){var t=ge((function(t){var n,r,i,o,a,s,u,c;return Ee(this,(function(l){if(Ce.isMp){try{n=document.getElementById(t.id),r=t.onStatusChange,i=t.guidingText,o=t.color,a=e(t,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="iframeOAWidget_".concat(Date.now()),(c=new URL("https://h5.zalo.me/widgets/oa_widget.html")).searchParams.set("id",u),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=Ue(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.addEventListener("message",function(){var e=ge((function(e){var t,n,i,o,a,s,l,d;return Ee(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(u),i=t.type,(o=new URL(t.href)).origin!==c.origin||o.pathname!==c.pathname||t.id!==u?[3,3]:"followOA"!==i&&"getOAInfo"!==i?[3,2]:[4,an.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=an.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},"*"),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?$o(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),gl.apply(this,arguments)}var _l=[si({id:Kr(),type:Kr(),text:Kr(),color:Kr().optional(),disabled:ki.boolean().optional(),onDataReceived:ki.function().optional(),onError:ki.function().optional()})];function wl(e){return bl.apply(this,arguments)}function bl(){return bl=ge((function(t){return Ee(this,(function(n){return[2,wn("showFunctionButtonWidget",_l,[t],function(){var t=ge((function(t){var n,r,i,o,a,s,u;return Ee(this,(function(c){if(Ce.isMp){try{n=document.getElementById(t.id),r=t.onDataReceived,i=t.onError,o=e(t,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="iframeFunctionButtonWidget".concat(Date.now()),(u=new URL("https://h5.zalo.me/widgets/function_button_widget.html")).searchParams.set("id",s),Object.entries(o).forEach((function(e){var t=Ue(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=Ue(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.addEventListener("message",function(){var e=ge((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return Ee(this,(function(g){switch(g.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(s),a=t.type,(c=new URL(t.href)).origin!==u.origin||c.pathname!==u.pathname||t.id!==s?[3,4]:"buttonClicked"!==a?[3,3]:[4,an.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=an.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=an.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,En()];case 2:return m=g.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},"*"),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(null==r||r(null==v?void 0:v.data)):"onError"===a&&(null==(y=t.payload)?void 0:y.type)===o.type&&(null==i||i(null==y?void 0:y.data)),g.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),bl.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:An},bn();var Tl=Object.freeze({__proto__:null,get Events(){return f},get EventName(){return f},get CameraEvents(){return I},login:bn,getAccessToken:En,getVersion:An,getSystemInfo:kn,setNavigationBarTitle:Ri,setNavigationBarColor:Di,setNavigationBarLeftButton:Bi,setStorage:po,getStorage:mo,getStorageInfo:yo,removeStorage:wo,clearStorage:Eo,getUserInfo:Ao,getNetworkType:No,onNetworkStatusChange:xo,startBeaconDiscovery:jo,stopBeaconDiscovery:Zo,getBeacons:Fo,closeApp:Vo,scanQRCode:qo,openProfile:Xo,openChat:ra,openPostFeed:ua,followOA:pa,unfollowOA:va,openShareSheet:ba,requestCameraPermission:Pa,createShortcut:Ca,openBioAuthentication:xa,checkStateBioAuthentication:ja,showToast:za,hideKeyboard:Ga,openPhone:Ja,openSMS:Ya,viewOAQr:ns,keepScreen:as,onKeepScreen:us,offKeepScreen:ls,saveImageToGallery:hs,openMiniApp:gs,vibrate:Ts,openWebview:Os,getRouteParams:ks,getAppInfo:Cs,sendDataToPreviousMiniApp:xs,getPhoneNumber:js,openProfilePicker:zs,connectWifi:Hs,openMediaPicker:qs,getShareableLink:Ys,closeLoading:tu,requestUpdateZalo:ru,onConfirmToExit:su,offConfirmToExit:uu,getDeviceId:cu,getDeviceIdAsync:lu,getContext:pu,getContextAsync:fu,getAuthCode:mu,getZPIToken:yu,setAccessToken:wu,openOutApp:Tu,chooseImage:Su,getLocation:Iu,onCallbackData:Nu,createOrder:Uu,purchase:Zu,selectPaymentMethod:Gu,checkTransaction:Ku,events:ou,setAndroidBottomNavigationBar:Qu,setIOSBottomSafeArea:Xu,setStatusBar:nc,configAppView:oc,createOrderIAP:cc,minimizeApp:pc,openPermissionSetting:mc,favoriteApp:gc,openGroupList:bc,requestSendNotification:Pc,addRating:Ac,interactOA:Rc,interactOa:Rc,isAllowedInteractWithOA:Dc,getSetting:Lc,authorize:Wc,checkZaloCameraPermission:Hc,getUserID:Kc,getIDToken:Qc,createCameraContext:rl,setupAd:ol,loadAd:ul,displayAd:dl,refreshAd:hl,showOAWidget:yl,showFunctionButtonWidget:wl,get FacingMode(){return k},get PhotoFormat(){return C},get PhotoQuality(){return N},get StreamType(){return M},ZMACameraImp:el}),El=Uu,Pl=Ku,Sl=cc,Ol=Gu,Al=Zu,Il=e(Tl,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]),kl={createOrder:El,checkTransaction:Pl,createOrderIAP:Sl,selectPaymentMethod:Ol},Cl={selectPaymentMethod:Ol,purchase:Al};!function(){var e,t=null===(e=ke())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,Tl))}();var Nl=Object.freeze({__proto__:null,Payment:kl,CheckoutSDK:Cl,default:Il,get Events(){return f},get EventName(){return f},get CameraEvents(){return I},login:bn,getAccessToken:En,getVersion:An,getSystemInfo:kn,setNavigationBarTitle:Ri,setNavigationBarColor:Di,setNavigationBarLeftButton:Bi,setStorage:po,getStorage:mo,getStorageInfo:yo,removeStorage:wo,clearStorage:Eo,getUserInfo:Ao,getNetworkType:No,onNetworkStatusChange:xo,startBeaconDiscovery:jo,stopBeaconDiscovery:Zo,getBeacons:Fo,closeApp:Vo,scanQRCode:qo,openProfile:Xo,openChat:ra,openPostFeed:ua,followOA:pa,unfollowOA:va,openShareSheet:ba,requestCameraPermission:Pa,createShortcut:Ca,openBioAuthentication:xa,checkStateBioAuthentication:ja,showToast:za,hideKeyboard:Ga,openPhone:Ja,openSMS:Ya,viewOAQr:ns,keepScreen:as,onKeepScreen:us,offKeepScreen:ls,saveImageToGallery:hs,openMiniApp:gs,vibrate:Ts,openWebview:Os,getRouteParams:ks,getAppInfo:Cs,sendDataToPreviousMiniApp:xs,getPhoneNumber:js,openProfilePicker:zs,connectWifi:Hs,openMediaPicker:qs,getShareableLink:Ys,closeLoading:tu,requestUpdateZalo:ru,onConfirmToExit:su,offConfirmToExit:uu,getDeviceId:cu,getDeviceIdAsync:lu,getContext:pu,getContextAsync:fu,getAuthCode:mu,getZPIToken:yu,setAccessToken:wu,openOutApp:Tu,chooseImage:Su,getLocation:Iu,onCallbackData:Nu,createOrder:Uu,purchase:Zu,selectPaymentMethod:Gu,checkTransaction:Ku,events:ou,setAndroidBottomNavigationBar:Qu,setIOSBottomSafeArea:Xu,setStatusBar:nc,configAppView:oc,createOrderIAP:cc,minimizeApp:pc,openPermissionSetting:mc,favoriteApp:gc,openGroupList:bc,requestSendNotification:Pc,addRating:Ac,interactOA:Rc,interactOa:Rc,isAllowedInteractWithOA:Dc,getSetting:Lc,authorize:Wc,checkZaloCameraPermission:Hc,getUserID:Kc,getIDToken:Qc,createCameraContext:rl,setupAd:ol,loadAd:ul,displayAd:dl,refreshAd:hl,showOAWidget:yl,showFunctionButtonWidget:wl,get FacingMode(){return k},get PhotoFormat(){return C},get PhotoQuality(){return N},get StreamType(){return M},ZMACameraImp:el,get NetworkType(){return d},get PlatformType(){return p},get JumpStatus(){return h},get ProfileType(){return m},get ChatType(){return v},get PostFeedType(){return y},get ShareSheetType(){return g},get OrientationType(){return _},get VibrateType(){return w},get MediaPickerType(){return b},get IAPPayType(){return T},get ProrationMode(){return E},get StatusBarType(){return P},get AndroidBottomNavigationBarType(){return S},get IOSSafeAreaBottomType(){return O},get TextAlignType(){return A}});window.ZaloMiniAppSDK=Nl}();
|
|
10
|
+
!function(){"use strict";function e(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var t,n=1048576,r=window.zAppID,i=window.APP_ID,o="https://zalo.me/s",a="https://h5.zdn.vn/zapps",s="h5.zdn.vn",u="/zapps",c={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSION:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType",UTOKEN_ZPI:"h5.zdn.vn_utoken_zpi",GTOKEN_ZPI:"h5.zdn.vn_gtoken_zpi",ZPP_ZPI:"h5.zdn.vn_zpp_zpi",ZPT_ZPI:"h5.zdn.vn_zpt_zpi"},l={GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token",GET_LIST_USER_INFO:"https://graph.zalo.me/v2.0/me/friends/list",CREATE_ORDER:"https://payment-mini.zalo.me/api/order/create",GET_APP_INFO:"https://h5.zalo.me/apps/get-info",SEND_ACTION_LOG:"https://h5.zalo.me/log/async",CREATE_SHARE_LINK:"https://h5.zalo.me/openapi/create-sharelink",CHECK_INTERACT_OA:"https://h5.zalo.me/openapi/check-interact-oa",GET_AUTH_SETTING:"https://h5.zalo.me/apis/users/auth-settings"};!function(e){e.REQUEST="REQUEST",e.MODIFIED_REQUEST="MODIFIED_REQUEST",e.RESPONSE="RESPONSE",e.MODIFIED_RESPONSE="MODIFIED_RESPONSE",e.NOT_FOUND="NOT_FOUND"}(t||(t={}));var d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,A,O,I,k,C,N,M,R,x=0,U=-2e3,D=-1400,j=-1500,L=-1401,B=-1404,Z=-1408,z=-1409,W=-2004,F=-2005,G="Success",H="Unknown error. Please try again later.",V="Request limit exceeded. Please try again later.",K="Request timeout. Please try again later.",J="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",q="Login failed",Q="This API is not supported in this version of Zalo",$="User Authentication Required. Please grant User Authentication permission before requesting User Permission",Y="Unable to pick media",X="Unable to save image",ee={SUCCESS:{code:x,message:G},UNKNOWN_ERROR:{code:U,message:H},UNAUTHORIZED:{code:L,message:J},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:B,message:Q},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:Z,message:K},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."}},te={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:{}},ne={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:ee.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:ee.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:ee.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:ee.USER_DENIED}},iOS:{"-2":{mapTo:ee.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:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},QUERY_LOCATION_HIDE:{haveCallback:!0},SHOW_TOAST:{haveCallback:!0,timeout:2},OPEN_APP:{},HIDE_KEYBOARD:{},OPEN_PHONE:{},OPEN_QR:{},OPEN_SMS:{},VIEW_MYQR:{haveCallback:!0,timeout:!0,requireAccessToken:!0},KEEP_SCREEN:{haveCallback:!0,timeout:2},CHANGE_AUTOROTATE:{skipJump:!0},CHECK_APP_INSTALLED:{},QUERY_SHOW:{},QUERY_HIDE:{},OPEN_INAPPRW:{},ZALORUN_GETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_SETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_GETDAYSTEP:{haveCallback:!0},ZALORUN_FORCESUBMITDATA:{haveCallback:!0},ZALORUN_SETWEIGHT:{haveCallback:!0},OPEN_PROFILE_EXT:{},DOWNLOAD_CATE:{haveCallback:!0},JUMP_LOGIN:{skipJump:!0,whiteList:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{},OPEN_ADTIMA_ADS:{},GET_ADIDCLIENT:{},SCAN_IBEACON:{},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:F,message:X},needMoreDetail:!0},"-102":{mapTo:{code:F,message:X},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:F,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}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:ee.USER_DENIED},"-101":{mapTo:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ee.USER_DENIED},"-10":{mapTo:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:ee.USER_CANCEL}},iOS:{"-101":{mapTo:ee.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:ee.USER_CANCEL},999:{mapTo:{code:W,message:Y},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:W,message:Y}}}}},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:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:ee.UNKNOWN_ERROR},"-600":{mapTo:ee.DEVICE_NOT_SUPPORT},"-601":{mapTo:ee.SCAN_TIMEOUT},"-602":{mapTo:ee.SERVICE_NOT_READY},"-603":{mapTo:ee.UNREADABLE},"-604":{mapTo:ee.INVALID_MRZ},"-605":{mapTo:ee.PROCESSING},"-606":{mapTo:ee.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1}},re={android:{"-4":ee.DECODE_FAILED,"-5":ee.CLIENT_NOT_SUPPORT,"-14":ee.TIME_OUT},iOS:{"-9":ee.DECODE_FAILED,"-5":ee.CLIENT_NOT_SUPPORT,"-14":ee.TIME_OUT}},ie={android:12100615,iOS:460,wp:0,unknown:0},oe=5*n,ae="https://payment-mini.zalo.me/api/order/create",se="https://payment-mini.zalo.me/api/order/iap-create",ue="https://payment-mini.zalo.me/api/transaction",ce="https://payment-mini.zalo.me/api/order/purchase",le="DEFERRED",de="IMMEDIATE_AND_CHARGE_FULL_PRICE",pe={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},fe=5,he=6,me="#1843EF",ve=0,ye={"-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 ge(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 _e(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ge(o,r,i,a,s,"next",e)}function s(e){ge(o,r,i,a,s,"throw",e)}a(void 0)}))}}function we(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 be(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Te(e,t){if(e){if("string"==typeof e)return we(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)?we(e,t):void 0}}function Ee(e){return function(e){if(Array.isArray(e))return we(e)}(e)||be(e)||Te(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 Pe(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 Se(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,Ee(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Ae(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")}}Se.async=function(e){return _e((function(){var t,n,r,i,o=arguments;return Pe(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,Ee(n))];case 2:return[2,a.sent()];case 3:return i=a.sent(),"undefined"!=typeof console&&console.error&&console.error(i),[2,null];case 4:return[2]}}))}))},function(e){e.none="none",e.wifi="wifi",e.cellular="cellular",e.unknown="unknown"}(d||(d={})),function(e){e.wp="wp",e.android="android",e.iOS="iOS",e.unknown="unknown"}(p||(p={})),function(e){e.AppPaused="h5.event.paused",e.AppResumed="h5.event.resumed",e.NetworkChanged="h5.event.connection.changed",e.OnDataCallback="h5.event.webview.result",e.WebviewClosed="h5.event.webview.close",e.OpenApp="h5.event.open.mp",e.AppClose="h5.event.action.close",e.PaymentCallback="payment.callback",e.PaymentResult="action.payment.result",e.PaymentClose="action.payment.close"}(f||(f={})),function(e){e.DOING="doing",e.DONE="done"}(h||(h={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa",e[e.aliasOA=2]="aliasOA"}(m||(m={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa"}(v||(v={})),function(e){e[e.image=1]="image",e[e.link=4]="link",e[e.profile=5]="profile"}(y||(y={})),function(e){e[e.cccd=1]="cccd"}(g||(g={})),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"}(_||(_={})),function(e){e[e.auto=1]="auto",e[e.portrait=2]="portrait",e[e.landscape=3]="landscape"}(w||(w={})),function(e){e[e.oneShot=0]="oneShot"}(b||(b={})),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"}(T||(T={})),function(e){e.SUBSCRIPTION="SUBSCRIPTION",e.ONETIME="ONETIME"}(E||(E={})),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"}(P||(P={})),function(e){e[e.normal=1]="normal",e[e.hidden=0]="hidden",e[e.transparent=2]="transparent"}(S||(S={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(A||(A={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(O||(O={})),function(e){e[e.left=0]="left",e[e.center=1]="center"}(I||(I={})),function(e){e.OnFrameCallback="h5.event.camera.frame",e.OnStartCallback="h5.event.camera.start",e.OnStopCallback="h5.event.camera.stop"}(k||(k={})),function(e){e.FRONT="user",e.BACK="environment"}(C||(C={})),function(e){e.WEBP="image/webp",e.PNG="image/png",e.JPEG="image/jpeg"}(N||(N={})),function(e){e.HIGH="high",e.NORMAL="normal",e.LOW="low"}(M||(M={})),function(e){e.VIDEO="video",e.AUDIO="audio"}(R||(R={}));var Oe,Ie=function(e){return e.isAndroid?p.android:e.isIOS?p.iOS:p.unknown};function ke(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Ce(){var e=function(){var e=Se((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:Ae(),platform:t,platformName:Ie(t),zaloVersion:ke(e).trim()}}}();if(e)return e}var Ne=(null===(Oe=Ce())||void 0===Oe?void 0:Oe.appEnv)||{};function Me(e){Me.on&&Me.engine(e)}Me.on=!1,Me.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 Re=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),Me({stage:t.NOT_FOUND,type:"error",name:e,request:n,state:"fail",response:i})};function xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ue(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){xe(e,t,n[t])}))}return e}function De(e,t){return function(e){if(Array.isArray(e))return e}(e)||be(e)||Te(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var je="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Le(){throw new Error("setTimeout has not been defined")}function Be(){throw new Error("clearTimeout has not been defined")}var Ze=Le,ze=Be;function We(e){if(Ze===setTimeout)return setTimeout(e,0);if((Ze===Le||!Ze)&&setTimeout)return Ze=setTimeout,setTimeout(e,0);try{return Ze(e,0)}catch(t){try{return Ze.call(null,e,0)}catch(t){return Ze.call(this,e,0)}}}"function"==typeof je.setTimeout&&(Ze=setTimeout),"function"==typeof je.clearTimeout&&(ze=clearTimeout);var Fe,Ge=[],He=!1,Ve=-1;function Ke(){He&&Fe&&(He=!1,Fe.length?Ge=Fe.concat(Ge):Ve=-1,Ge.length&&Je())}function Je(){if(!He){var e=We(Ke);He=!0;for(var t=Ge.length;t;){for(Fe=Ge,Ge=[];++Ve<t;)Fe&&Fe[Ve].run();Ve=-1,t=Ge.length}Fe=null,He=!1,function(e){if(ze===clearTimeout)return clearTimeout(e);if((ze===Be||!ze)&&clearTimeout)return ze=clearTimeout,clearTimeout(e);try{ze(e)}catch(t){try{return ze.call(null,e)}catch(t){return ze.call(this,e)}}}(e)}}function qe(e,t){this.fun=e,this.array=t}qe.prototype.run=function(){this.fun.apply(null,this.array)};function Qe(){}var $e=Qe,Ye=Qe,Xe=Qe,et=Qe,tt=Qe,nt=Qe,rt=Qe;var it=je.performance||{},ot=it.now||it.mozNow||it.msNow||it.oNow||it.webkitNow||function(){return(new Date).getTime()};var at=new Date;var st,ut={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ge.push(new qe(e,t)),1!==Ge.length||He||We(Je)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:$e,addListener:Ye,once:Xe,off:et,removeListener:tt,removeAllListeners:nt,emit:rt,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*ot.call(it),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-at)/1e3}},ct=ut,lt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function dt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function pt(e){return"function"==typeof window.Debug?window.Debug(e):function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n]}}!function(e){!function(t){var n="object"==typeof lt?lt:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),r=i(e);function i(e,t){return function(n,r){"function"!=typeof e[n]&&Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0===n.Reflect?n.Reflect=e:r=i(n.Reflect,r),function(e){var t=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return re(Object.create(null))}:a?function(){return re({__proto__:null})}:function(){return re({})},has:s?function(e,n){return t.call(e,n)}:function(e,t){return t in e},get:s?function(e,n){return t.call(e,n)?e[n]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),l="object"==typeof ct&&ct.env&&"true"===ct.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?te():Set,f=new(l||"function"!=typeof WeakMap?ne():WeakMap);function h(e,t,n,r){if(U(n)){if(!G(e))throw new TypeError;if(!V(t))throw new TypeError;return P(e,t)}if(!G(e))throw new TypeError;if(!L(t))throw new TypeError;if(!L(r)&&!U(r)&&!D(r))throw new TypeError;return D(r)&&(r=void 0),S(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!L(n))throw new TypeError;if(!U(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!L(n))throw new TypeError;return U(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),O(e,t,n)}function g(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),I(e,t,n)}function _(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),C(e,t,n)}function b(e,t){if(!L(e))throw new TypeError;return U(t)||(t=F(t)),M(e,t)}function T(e,t){if(!L(e))throw new TypeError;return U(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!L(t))throw new TypeError;U(n)||(n=F(n));var r=A(t,n,!1);if(U(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}function P(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!U(r)&&!D(r)){if(!V(r))throw new TypeError;t=r}}return t}function S(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!U(o)&&!D(o)){if(!L(o))throw new TypeError;r=o}}return r}function A(e,t,n){var r=f.get(e);if(U(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(U(i)){if(!n)return;i=new d,r.set(t,i)}return i}function O(e,t,n){if(I(e,t,n))return!0;var r=X(t);return!D(r)&&O(e,r,n)}function I(e,t,n){var r=A(t,n,!1);return!U(r)&&z(r.has(e))}function k(e,t,n){if(I(e,t,n))return C(e,t,n);var r=X(t);return D(r)?void 0:k(e,r,n)}function C(e,t,n){var r=A(t,n,!1);if(!U(r))return r.get(e)}function N(e,t,n,r){A(n,r,!0).set(e,t)}function M(e,t){var n=R(e,t),r=X(e);if(null===r)return n;var i=M(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new p,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,d=i;l<d.length;l++){c=d[l];o.has(c)||(o.add(c),a.push(c))}return a}function R(e,t){var n=[],r=A(e,t,!1);if(U(r))return n;for(var i=q(r.keys()),o=0;;){var a=$(i);if(!a)return n.length=o,n;var s=Q(a);try{n[o]=s}catch(e){try{Y(i)}finally{throw e}}o++}}function x(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function U(e){return void 0===e}function D(e){return null===e}function j(e){return"symbol"==typeof e}function L(e){return"object"==typeof e?null!==e:"function"==typeof e}function B(e,t){switch(x(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",i=J(e,r);if(void 0!==i){var o=i.call(e,n);if(L(o))throw new TypeError;return o}return Z(e,"default"===n?"number":n)}function Z(e,t){if("string"===t){var n=e.toString;if(H(n))if(!L(i=n.call(e)))return i;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i}else{var r;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i;var i,o=e.toString;if(H(o))if(!L(i=o.call(e)))return i}throw new TypeError}function z(e){return!!e}function W(e){return""+e}function F(e){var t=B(e,3);return j(t)?t:W(t)}function G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function H(e){return"function"==typeof e}function V(e){return"function"==typeof e}function K(e){switch(x(e)){case 3:case 4:return!0;default:return!1}}function J(e,t){var n=e[t];if(null!=n){if(!H(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!H(t))throw new TypeError;var n=t.call(e);if(!L(n))throw new TypeError;return n}function Q(e){return e.value}function $(e){var t=e.next();return!t.done&&t}function Y(e){var t=e.return;t&&t.call(e)}function X(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function te(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function ne(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function re(e){return e.__=void 0,delete e.__,e}e("decorate",h),e("metadata",m),e("defineMetadata",v),e("hasMetadata",y),e("hasOwnMetadata",g),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",T),e("deleteMetadata",E)}(r)}()}(st||(st={}));var ft=Object.prototype.toString;var ht="[object Null]",mt="[object Undefined]";function vt(e){return null==e?void 0===e?mt:ht:function(e){return ft.call(e)}(e)}function yt(e){return null!=e&&"object"==typeof e}var gt={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||yt(e)&&"[object Number]"==vt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return yt(e)&&"[object RegExp]"==vt(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 _t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wt(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 bt(e){return bt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},bt(e)}function Tt(e){return bt(e)}function Et(e,t,n){return Et="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=Tt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},Et(e,t,n)}function Pt(e,t,n){return Et(e,t,n)}function St(e,t){return St=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},St(e,t)}function At(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&&St(e,t)}function Ot(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function It(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=Tt(e);if(t){var i=Tt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==dt(t)&&"function"!=typeof t?Ot(e):t}(this,n)}}var kt,Ct,Nt=(kt=function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,a),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),d){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,r);break;case 4:l[c].fn.call(l[c].context,t,r,i);break;default:if(!u)for(p=1,u=new Array(d-1);p<d;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==t||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s},kt(Ct={exports:{}},Ct.exports),Ct.exports),Mt="ACTION_CALLBACK";var Rt=function(e){At(n,e);var t=It(n);function n(){var e;return _t(this,n),(e=t.apply(this,arguments)).debug=pt("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===f.PaymentCallback)return Pt(Tt(n.prototype),"on",this).call(this,e,t,r);this.debug("register ".concat(String(e),": ").concat(r));return Pt(Tt(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 Pt(Tt(n.prototype),"once",this).call(this,e,t,r);this.debug("register once ".concat(String(e),": ").concat(r));return Pt(Tt(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}(Nt);function xt(e){Rt.getInstance().emit(Mt,e)}function Ut(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){xt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){var r=pt("zmp:zalo_h5_event_handler");r("eventId: ".concat(e,", eventName: ").concat(t,", eventData: ").concat(n));var o=dn(n);r("stringToData",o);var a=function(e,t){try{if(e===f.OpenApp){var n=t.url,r=new URL(n),o=r.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(o||"/").concat(r.search)}}return t}catch(e){return t}}(t,o);Rt.getInstance().emit(t,e,a)}},window.zaloNative2JS={nativeCall:function(e,t,n){Rt.getInstance().emit(f.PaymentCallback,e,t,n)}};var Dt={encode:Ut,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:Ut(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":dt(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":dt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},jt={},Lt=function(e,t,n){var r=t||"default";return function(){return(r in jt?jt[r](e,n):e).apply(this,arguments)}};Lt.setWrapper=function(e){jt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Bt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Zt(e){try{return null===e?Bt:JSON.parse(e)}catch(e){return Bt}}var zt,Wt={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Dt.encode(n);"post"!=t&&(e=Dt.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=Lt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Lt((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(Zt(e.responseText))},o.onerror=function(e){e.responseText?r(Zt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Ft=Wt,Gt=(zt=_e((function(e,t,n){var r,i,o,a;return Pe(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},gt.isUndefined(n)||(r.currentVersion=n),i=Dt.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 zt.apply(this,arguments)});function Ht(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Ft.execute(l.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:e}})}catch(e){}}var Vt=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Kt=function(){var e,t,n=Number((null===(e=Ce())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=Ce())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Jt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var qt,Qt,$t=function(){function e(t,n,r,i){_t(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}(),Yt=function(e,t){return Jt(e,$t)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Jt(e,Error)?new $t(U,e.message,t).toJSON():gt.isEmpty(null==e?void 0:e.message)||gt.isEmpty(null==e?void 0:e.code)?new $t(U,H,t,e).toJSON():new $t(e.code,e.message,t,e.detail).toJSON()}(e,t)},Xt=(qt=_e((function(e){var t;return Pe(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,Ue({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return qt.apply(this,arguments)}),en=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n,r,i,o;return Pe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,sn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=sn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new $t(L,J,"getSetting")),[4,Xt(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new $t(i.err,i.msg,"getSetting")),[3,4];case 3:return o=a.sent(),t(o),[3,4];case 4:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))})),tn=function(){var e,t,n,r=Ce(),i={},o=Rt.getInstance(),a=[],s=!1;return s||(t=function(e){var t=e.serialId,n=pn(e.result),r=vn(null==n?void 0:n.action),o=gt.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,s=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===o){var c=JSON.parse(null==n?void 0:n.data);o=gt.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,s=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:o,error_message:s,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&i[t]){var d=i[t],p=d.callback,f=d.timeout,h=d.isMultiCallback,m=d.options;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?gt.isFunction(r)&&r(e):gt.isFunction(i)&&i(e)}(l,p),!h&&delete i[t],f&&clearTimeout(f);var v={action:null==l?void 0:l.action,error:null==l?void 0:l.error_code,message:null==l?void 0:l.error_message,data:{}};try{if("action.open.inapp"===l.action||"action.open.outapp"===l.action){var y=new URL(null==m?void 0:m.url),g="".concat(y.protocol,"//").concat(y.host).concat(y.pathname);v.data={url:g}}if("action.follow.oa"===l.action||"action.unfollow.oa"===l.action){var _=null==m?void 0:m.uid;v.data={uid:_}}if("action.open.chat"===l.action){var w=null==m?void 0:m.uId,b=null==m?void 0:m.type;v.data={uid:w,openChatType:b}}}catch(e){}a.push(v)}},Rt.getInstance().on(Mt,t),o.on(f.AppPaused,(function(){if(a.length>0){var e=a;a=[],Ht(e)}})),e?clearInterval(e):e=setInterval((function(){if(a.length>0){var e=a;a=[],Ht(e)}}),5e3),s=!0),n=_e((function(e,t,n,o){var a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,A,O;return Pe(this,(function(I){switch(I.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c=wn(e),(null==o?void 0:o.actionName)&&o.actionName.length>0&&(c=null==o?void 0:o.actionName),l=(null==o?void 0:o.isMultiCallback)||!1,d=!1!==(null==o?void 0:o.timeout)&&((null==o?void 0:o.timeout)||!0),p=(null==o?void 0:o.haveCallback)||!1,f=(null==o?void 0:o.skipJump)||!1,h=(null==o?void 0:o.requireAccessToken)||!1,m=yn(c),t&&n&&(i[u]={options:t,callback:n,isMultiCallback:l},d&&p&&(i[u].timeout=setTimeout((function(){return xt({serialId:u,result:{error_code:Z,error_message:K,data:{timeout:d},action:e}}),null}),!0===d?8e3:1e3*d))),m?[4,en()]:[3,2];case 1:if(!1===(null==(y=I.sent())||null===(v=y.authSetting)||void 0===v?void 0:v["scope.userInfo"]))return xt({serialId:u,result:{error_code:L,error_message:$,data:{isMobile:null==r||null===(g=r.platform)||void 0===g?void 0:g.isMobile},action:e}}),[2];I.label=2;case 2:return _=vn(c),!(null==r||null===(a=r.platform)||void 0===a?void 0:a.isMobile)||!e||gt.isUndefined(ZaloJavaScriptInterface)||r.platform.isIOS&&!ln(e)||_&&!1===_.isSupported?(xt({serialId:u,result:{error_code:B,error_message:Q,data:{isMobile:null==r||null===(w=r.platform)||void 0===w?void 0:w.isMobile},action:e}}),[2]):(b=cn(t),f?[3,4]:[4,sn.getJSAccessToken()]);case 3:return E=I.sent(),[3,5];case 4:E="",I.label=5;case 5:T=E,I.label=6;case 6:return I.trys.push([6,10,,11]),f||!h?[3,8]:[4,sn.getAccessToken()];case 7:return S=I.sent(),[3,9];case 8:S="",I.label=9;case 9:return P=S,[3,11];case 10:return A=I.sent(),xt({serialId:u,result:{error_code:null==A?void 0:A.code,error_message:null==A?void 0:A.message,action:e}}),[2];case 11:return O=r.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(T,c,P,b,O)]}}))})),function(e,t,r,i){return n.apply(this,arguments)}}(),nn={success:function(e,t){return{code:x,message:t||G,data:e||{}}},error:{failLimit:function(){return new $t(z,V)},badRequest:function(e){return new $t(D,e)},loginFailed:function(e){return new $t(L,"".concat(q,": ").concat(e))},loginRequired:function(){return new $t(L,J)},cannotGetShareInfo:function(){return new $t(j,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(ye).find((function(t){return t===e.toString()}));return new $t(e,t||H)},clientNotSupport:function(){return new $t(B,Q)}}},rn=(Qt=function(e){var t,n,r,i,o,a=null===(t=Ce())||void 0===t?void 0:t.platformName,s=_n(e.action),u=ne[s],c=(null==u?void 0:u.skipJump)||!1,l=(null==u?void 0:u.errorList)||{};if("JUMP_LOGIN"===s)return new $t(U,"Can not get auth code: ".concat(e.error_message));if(sn.jumpStatus!==h.DONE&&!c)return new $t(ee.UNAUTHORIZED.code,ee.UNAUTHORIZED.message);if("permission required!"===String(e.error_message).toLowerCase()||"no permission!"===String(e.error_message).toLowerCase())return new $t(ee.FORBIDDEN.code,ee.FORBIDDEN.message);if(a&&(null===(n=re[a])||void 0===n?void 0:n[e.error_code]))return new $t(re[a][e.error_code].code,re[a][e.error_code].message);var d=null!==(o=null==l||null===(r=l[a])||void 0===r?void 0:r[String(e.error_code)])&&void 0!==o?o:null==l||null===(i=l.all)||void 0===i?void 0:i[e.error_code];if(d){var p,f,m,v=null===(p=d.mapTo)||void 0===p?void 0:p.message;return(null==d?void 0:d.needMoreDetail)&&(v="".concat(null==d||null===(m=d.mapTo)||void 0===m?void 0:m.message,": ").concat(e.error_message)),new $t(null===(f=d.mapTo)||void 0===f?void 0:f.code,v)}return new $t(e.error_code,e.error_message)},function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=gt.isEmpty(n)?void 0:n[r];if(o)return Me({stage:t.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Qt(i):null==i?void 0:i.data)}}return gt.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=ne[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){tn(e,n,o,Ue({},i,a))}),s)}),on=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){gt.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),an=function(){function e(){_t(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=te[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 _e((function(){return Pe(this,(function(n){return[2,new Promise((function(n,r){e._jumpStatus?e._jumpStatus===h.DONE?n(h.DONE):n(h.DOING):(e._jumpStatus=h.DOING,Me({stage:t.REQUEST,type:"log",name:"jump"}),tn("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)||Ht([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),n(h.DONE)},fail:function(e){Ht([{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 _e((function(){var i;return Pe(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=_e((function(e){var t,n,i;return Pe(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 _e((function(){var i,o;return Pe(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),gt.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,Ue({method:"POST",body:i},o)).then(function(){var e=_e((function(e){var t,n,i,o;return Pe(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 _e((function(){var n,o,a,s,u,l,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=_e((function(){return Pe(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 Pe(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--,Ht([{action:d,error:-104,message:"no user auth",data:{}}]),nn.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),Ht([{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)]:(Ht([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(nn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw o.getAccessTokenCount--,Ht([{action:d,error:-102,message:"no oauth",data:{}}]),nn.error.loginFailed("Zalo app has not been activated")}}))}))()},u.verifyUserAuthorized=function(){var e=this;return _e((function(){var t,n,r,i,o,a;return Pe(this,(function(s){switch(s.label){case 0:if(n=!0,!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,6];s.label=1;case 1:return s.trys.push([1,5,,6]),(r=vn("action.mp.user.authorize"))&&r.isSupported?[4,en()]:[3,4];case 2:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,4]:[4,on()];case 3:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=4;case 4:return[3,6];case 5:return s.sent(),n=!1,[3,6];case 6:return[2,n]}}))}))()},u.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},u.getJSAccessToken=function(){var e=this;return _e((function(){var t;return Pe(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=_e((function(r){var i,o,a,s;return Pe(this,(function(u){switch(u.label){case 0:return!t&&n._cookies.length>0?gt.isString(e)?(i=n._cookies.find((function(t){return t.name===e})),[2,r(null==i?void 0:i.value)]):[2,r("")]:(t&&n._jumpStatus===h.DONE&&(n._jumpStatus=void 0),o={name:e,cb:function(e){return r(e)}},[4,n.jump()]);case 1:return(a=u.sent())===h.DONE?(n._jumpStatus=a,n.WAITING_QUEUE.length&&(n.WAITING_QUEUE.forEach((function(e){var t=n._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),n.WAITING_QUEUE=[]),s=n._cookies.find((function(e){return e.name===o.name})),o.cb(null==s?void 0:s.value)):n.WAITING_QUEUE.push(o),[2]}}))}));return function(e){return r.apply(this,arguments)}}())},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},n=e,(o=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&wt(n.prototype,o),s&&wt(n,s),e}(),sn=an.getInstance(),un=pt("zmp:utils:common"),cn=function(e){if(gt.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(cn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+cn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},ln=function(e){var t,n,r=ne[e],i=(null===(t=Ce())||void 0===t?void 0:t.zaloVersion)||0,o="versionLive"in r&&(null==r||null===(n=r.versionLive)||void 0===n?void 0:n.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||Number(i)>=o},dn=function(e){try{if(e){un(e);var t=e.replace(/\\/g,"").replace(/'/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return un("formattedValue",t,JSON.parse(t),dt(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return un("parse json error:",t),e}},pn=function(e){if(gt.isObject(JSON)&&JSON.parse&>.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 gt.isObject(e)?e:new Function("return "+e)()},fn=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""},hn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var mn=function(e){return"hidden"===e?S.hidden:"transparent"===e?S.transparent:S.normal},vn=function(e){if(void 0!==e){var t=sn.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},yn=function(e){if(void 0===e)return!1;var t=sn.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},gn=function(){var e=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n;return Pe(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,sn.jumpAndGetToken()];case 1:return t.sent(),n=sn.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)}}(),_n=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},wn=function(e){return"action.".concat(e.replace(/\_/g,".").toLowerCase())};function bn(e,t,n,r){var i,o;!function(e,t){if(te[e]){var n=sn.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&sn.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw Yt(nn.error.failLimit(),e);sn.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=nn.error.badRequest(s);throw c.detail=a,Yt(c,e)}u.push(i.data)}));var c=r.apply(void 0,Ee(u));return gt.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!gt.isNull(a)&>.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Yt(t,e);if(!gt.isNull(s)&>.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!gt.isNull(s)&>.isFunction(s))return s(t);throw Yt(t,e)}}function Tn(e){return En.apply(this,arguments)}function En(){return(En=_e((function(e){return Pe(this,(function(t){return[2,bn("login",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,sn.jumpAndGetToken(c.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Ne.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Re("login",{}))]}}))})))]}))}))).apply(this,arguments)}function Pn(e){return Sn.apply(this,arguments)}function Sn(){return(Sn=_e((function(e){return Pe(this,(function(t){return[2,bn("getAccessToken",[],[e],_e((function(){var e;return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,gn()]:[3,3];case 1:return e=!t.sent(),[4,sn.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Ne.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Re("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var An,On="2.41.0";function In(){return bn("getVersion",[],[],(function(){return On}))}function kn(){var e,t;return{version:fn("version-id")||"",apiVersion:On,zaloVersion:(null===(e=Ce())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=Ce())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function Cn(){return bn("getSystemInfo",[],[],(function(){return kn()}))}!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}(An||(An={}));const Nn=An.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Mn=e=>{switch(typeof e){case"undefined":return Nn.undefined;case"string":return Nn.string;case"number":return isNaN(e)?Nn.nan:Nn.number;case"boolean":return Nn.boolean;case"function":return Nn.function;case"bigint":return Nn.bigint;case"symbol":return Nn.symbol;case"object":return Array.isArray(e)?Nn.array:null===e?Nn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Nn.promise:"undefined"!=typeof Map&&e instanceof Map?Nn.map:"undefined"!=typeof Set&&e instanceof Set?Nn.set:"undefined"!=typeof Date&&e instanceof Date?Nn.date:Nn.object;default:return Nn.unknown}},Rn=An.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 xn 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,An.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()}}xn.create=e=>new xn(e);const Un=(e,t)=>{let n;switch(e.code){case Rn.invalid_type:n=e.received===Nn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Rn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,An.jsonStringifyReplacer)}`;break;case Rn.unrecognized_keys:n=`Unrecognized key(s) in object: ${An.joinValues(e.keys,", ")}`;break;case Rn.invalid_union:n="Invalid input";break;case Rn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${An.joinValues(e.options)}`;break;case Rn.invalid_enum_value:n=`Invalid enum value. Expected ${An.joinValues(e.options)}, received '${e.received}'`;break;case Rn.invalid_arguments:n="Invalid function arguments";break;case Rn.invalid_return_type:n="Invalid function return type";break;case Rn.invalid_date:n="Invalid date";break;case Rn.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}"`:An.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Rn.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 Rn.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 Rn.custom:n="Invalid input";break;case Rn.invalid_intersection_types:n="Intersection results could not be merged";break;case Rn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Rn.not_finite:n="Number must be finite";break;default:n=t.defaultError,An.assertNever(e)}return{message:n}};let Dn=Un;function jn(){return Dn}const Ln=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 Bn(e,t){const n=Ln({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,jn(),Un].filter((e=>!!e))});e.common.issues.push(n)}class Zn{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 zn;"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 Zn.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 zn;if("aborted"===i.status)return zn;"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 zn=Object.freeze({status:"aborted"}),Wn=e=>({status:"dirty",value:e}),Fn=e=>({status:"valid",value:e}),Gn=e=>"aborted"===e.status,Hn=e=>"dirty"===e.status,Vn=e=>"valid"===e.status,Kn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Jn;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Jn||(Jn={}));class qn{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 Qn=(e,t)=>{if(Vn(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 xn(e.common.issues)}};function $n(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 Yn{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 Mn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Mn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Zn,ctx:{common:e.parent.common,data:e.data,parsedType:Mn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Kn(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:Mn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Qn(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:Mn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Kn(r)?r:Promise.resolve(r));return Qn(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:Rn.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 Dr({schema:this,typeName:Kr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return jr.create(this,this._def)}nullable(){return Lr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vr.create(this,this._def)}promise(){return Ur.create(this,this._def)}or(e){return wr.create([this,e],this._def)}and(e){return Pr.create(this,e,this._def)}transform(e){return new Dr({...$n(this._def),schema:this,typeName:Kr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Br({...$n(this._def),innerType:this,defaultValue:t,typeName:Kr.ZodDefault})}brand(){return new Fr({typeName:Kr.ZodBranded,type:this,...$n(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Zr({...$n(this._def),innerType:this,catchValue:t,typeName:Kr.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Gr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Xn=/^c[^\s-]{8,}$/i,er=/^[a-z][a-z0-9]*$/,tr=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,nr=/^(([^<>()[\]\\.,;:\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 rr extends Yn{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Rn.invalid_string,...Jn.errToObj(n)}),this.nonempty=e=>this.min(1,Jn.errToObj(e)),this.trim=()=>new rr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Nn.string){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.string,received:t.parsedType}),zn}const t=new Zn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),Bn(n,{code:Rn.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),Bn(n,{code:Rn.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?Bn(n,{code:Rn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Bn(n,{code:Rn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)nr.test(e.data)||(n=this._getOrReturnCtx(e,n),Bn(n,{validation:"email",code:Rn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)tr.test(e.data)||(n=this._getOrReturnCtx(e,n),Bn(n,{validation:"uuid",code:Rn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Xn.test(e.data)||(n=this._getOrReturnCtx(e,n),Bn(n,{validation:"cuid",code:Rn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)er.test(e.data)||(n=this._getOrReturnCtx(e,n),Bn(n,{validation:"cuid2",code:Rn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Bn(n,{validation:"url",code:Rn.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),Bn(n,{validation:"regex",code:Rn.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),Bn(n,{code:Rn.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),Bn(n,{code:Rn.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),Bn(n,{code:Rn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else An.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new rr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Jn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Jn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Jn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Jn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Jn.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,...Jn.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Jn.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Jn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Jn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Jn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Jn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Jn.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 ir(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)}rr.create=e=>{var t;return new rr({checks:[],typeName:Kr.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...$n(e)})};class or extends Yn{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)!==Nn.number){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.number,received:t.parsedType}),zn}let t;const n=new Zn;for(const r of this._def.checks)if("int"===r.kind)An.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Bn(t,{code:Rn.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),Bn(t,{code:Rn.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),Bn(t,{code:Rn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==ir(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Bn(t,{code:Rn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Bn(t,{code:Rn.not_finite,message:r.message}),n.dirty()):An.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Jn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Jn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Jn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Jn.toString(t))}setLimit(e,t,n,r){return new or({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Jn.toString(r)}]})}_addCheck(e){return new or({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Jn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Jn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Jn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Jn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Jn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Jn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Jn.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&&An.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)}}or.create=e=>new or({checks:[],typeName:Kr.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...$n(e)});class ar extends Yn{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Nn.bigint){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.bigint,received:t.parsedType}),zn}return Fn(e.data)}}ar.create=e=>{var t;return new ar({typeName:Kr.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...$n(e)})};class sr extends Yn{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Nn.boolean){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.boolean,received:t.parsedType}),zn}return Fn(e.data)}}sr.create=e=>new sr({typeName:Kr.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...$n(e)});class ur extends Yn{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Nn.date){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.date,received:t.parsedType}),zn}if(isNaN(e.data.getTime())){return Bn(this._getOrReturnCtx(e),{code:Rn.invalid_date}),zn}const t=new Zn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Bn(n,{code:Rn.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),Bn(n,{code:Rn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):An.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ur({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Jn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Jn.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}}ur.create=e=>new ur({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Kr.ZodDate,...$n(e)});class cr extends Yn{_parse(e){if(this._getType(e)!==Nn.symbol){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.symbol,received:t.parsedType}),zn}return Fn(e.data)}}cr.create=e=>new cr({typeName:Kr.ZodSymbol,...$n(e)});class lr extends Yn{_parse(e){if(this._getType(e)!==Nn.undefined){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.undefined,received:t.parsedType}),zn}return Fn(e.data)}}lr.create=e=>new lr({typeName:Kr.ZodUndefined,...$n(e)});class dr extends Yn{_parse(e){if(this._getType(e)!==Nn.null){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.null,received:t.parsedType}),zn}return Fn(e.data)}}dr.create=e=>new dr({typeName:Kr.ZodNull,...$n(e)});class pr extends Yn{constructor(){super(...arguments),this._any=!0}_parse(e){return Fn(e.data)}}pr.create=e=>new pr({typeName:Kr.ZodAny,...$n(e)});class fr extends Yn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Fn(e.data)}}fr.create=e=>new fr({typeName:Kr.ZodUnknown,...$n(e)});class hr extends Yn{_parse(e){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.never,received:t.parsedType}),zn}}hr.create=e=>new hr({typeName:Kr.ZodNever,...$n(e)});class mr extends Yn{_parse(e){if(this._getType(e)!==Nn.undefined){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.void,received:t.parsedType}),zn}return Fn(e.data)}}mr.create=e=>new mr({typeName:Kr.ZodVoid,...$n(e)});class vr extends Yn{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Nn.array)return Bn(t,{code:Rn.invalid_type,expected:Nn.array,received:t.parsedType}),zn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Bn(t,{code:e?Rn.too_big:Rn.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&&(Bn(t,{code:Rn.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&&(Bn(t,{code:Rn.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 qn(t,e,t.path,n))))).then((e=>Zn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new qn(t,e,t.path,n))));return Zn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new vr({...this._def,minLength:{value:e,message:Jn.toString(t)}})}max(e,t){return new vr({...this._def,maxLength:{value:e,message:Jn.toString(t)}})}length(e,t){return new vr({...this._def,exactLength:{value:e,message:Jn.toString(t)}})}nonempty(e){return this.min(1,e)}}var yr;function gr(e){if(e instanceof _r){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=jr.create(gr(r))}return new _r({...e._def,shape:()=>t})}return e instanceof vr?vr.create(gr(e.element)):e instanceof jr?jr.create(gr(e.unwrap())):e instanceof Lr?Lr.create(gr(e.unwrap())):e instanceof Sr?Sr.create(e.items.map((e=>gr(e)))):e}vr.create=(e,t)=>new vr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Kr.ZodArray,...$n(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(yr||(yr={}));class _r extends Yn{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=An.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Nn.object){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.object,received:t.parsedType}),zn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof hr&&"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 qn(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof hr){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&&(Bn(n,{code:Rn.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 qn(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=>Zn.mergeObjectSync(t,e))):Zn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Jn.errToObj,new _r({...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=Jn.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new _r({...this._def,unknownKeys:"strip"})}passthrough(){return new _r({...this._def,unknownKeys:"passthrough"})}extend(e){return new _r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new _r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>yr.mergeShapes(this._def.shape(),e._def.shape()),typeName:Kr.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new _r({...this._def,catchall:e})}pick(e){const t={};return An.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new _r({...this._def,shape:()=>t})}omit(e){const t={};return An.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new _r({...this._def,shape:()=>t})}deepPartial(){return gr(this)}partial(e){const t={};return An.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new _r({...this._def,shape:()=>t})}required(e){const t={};return An.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof jr;)e=e._def.innerType;t[n]=e}})),new _r({...this._def,shape:()=>t})}keyof(){return Mr(An.objectKeys(this.shape))}}_r.create=(e,t)=>new _r({shape:()=>e,unknownKeys:"strip",catchall:hr.create(),typeName:Kr.ZodObject,...$n(t)}),_r.strictCreate=(e,t)=>new _r({shape:()=>e,unknownKeys:"strict",catchall:hr.create(),typeName:Kr.ZodObject,...$n(t)}),_r.lazycreate=(e,t)=>new _r({shape:e,unknownKeys:"strip",catchall:hr.create(),typeName:Kr.ZodObject,...$n(t)});class wr extends Yn{_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 xn(e.ctx.common.issues)));return Bn(t,{code:Rn.invalid_union,unionErrors:n}),zn}));{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 xn(e)));return Bn(t,{code:Rn.invalid_union,unionErrors:i}),zn}}get options(){return this._def.options}}wr.create=(e,t)=>new wr({options:e,typeName:Kr.ZodUnion,...$n(t)});const br=e=>e instanceof Cr?br(e.schema):e instanceof Dr?br(e.innerType()):e instanceof Nr?[e.value]:e instanceof Rr?e.options:e instanceof xr?Object.keys(e.enum):e instanceof Br?br(e._def.innerType):e instanceof lr?[void 0]:e instanceof dr?[null]:null;class Tr extends Yn{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Nn.object)return Bn(t,{code:Rn.invalid_type,expected:Nn.object,received:t.parsedType}),zn;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}):(Bn(t,{code:Rn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),zn)}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=br(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 Tr({typeName:Kr.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...$n(n)})}}function Er(e,t){const n=Mn(e),r=Mn(t);if(e===t)return{valid:!0,data:e};if(n===Nn.object&&r===Nn.object){const n=An.objectKeys(t),r=An.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=Er(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Nn.array&&r===Nn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Er(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Nn.date&&r===Nn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Pr extends Yn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Gn(e)||Gn(r))return zn;const i=Er(e.value,r.value);return i.valid?((Hn(e)||Hn(r))&&t.dirty(),{status:t.value,value:i.data}):(Bn(n,{code:Rn.invalid_intersection_types}),zn)};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}))}}Pr.create=(e,t,n)=>new Pr({left:e,right:t,typeName:Kr.ZodIntersection,...$n(n)});class Sr extends Yn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Nn.array)return Bn(n,{code:Rn.invalid_type,expected:Nn.array,received:n.parsedType}),zn;if(n.data.length<this._def.items.length)return Bn(n,{code:Rn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),zn;!this._def.rest&&n.data.length>this._def.items.length&&(Bn(n,{code:Rn.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 qn(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Zn.mergeArray(t,e))):Zn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Sr({...this._def,rest:e})}}Sr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Sr({items:e,typeName:Kr.ZodTuple,rest:null,...$n(t)})};class Ar extends Yn{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!==Nn.object)return Bn(n,{code:Rn.invalid_type,expected:Nn.object,received:n.parsedType}),zn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new qn(n,e,n.path,e)),value:o._parse(new qn(n,n.data[e],n.path,e))});return n.common.async?Zn.mergeObjectAsync(t,r):Zn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Ar(t instanceof Yn?{keyType:e,valueType:t,typeName:Kr.ZodRecord,...$n(n)}:{keyType:rr.create(),valueType:e,typeName:Kr.ZodRecord,...$n(t)})}}class Or extends Yn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Nn.map)return Bn(n,{code:Rn.invalid_type,expected:Nn.map,received:n.parsedType}),zn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new qn(n,e,n.path,[o,"key"])),value:i._parse(new qn(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 zn;"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 zn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Or.create=(e,t,n)=>new Or({valueType:t,keyType:e,typeName:Kr.ZodMap,...$n(n)});class Ir extends Yn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Nn.set)return Bn(n,{code:Rn.invalid_type,expected:Nn.set,received:n.parsedType}),zn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Bn(n,{code:Rn.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&&(Bn(n,{code:Rn.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 zn;"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 qn(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Ir({...this._def,minSize:{value:e,message:Jn.toString(t)}})}max(e,t){return new Ir({...this._def,maxSize:{value:e,message:Jn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ir.create=(e,t)=>new Ir({valueType:e,minSize:null,maxSize:null,typeName:Kr.ZodSet,...$n(t)});class kr extends Yn{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Nn.function)return Bn(t,{code:Rn.invalid_type,expected:Nn.function,received:t.parsedType}),zn;function n(e,n){return Ln({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,jn(),Un].filter((e=>!!e)),issueData:{code:Rn.invalid_arguments,argumentsError:n}})}function r(e,n){return Ln({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,jn(),Un].filter((e=>!!e)),issueData:{code:Rn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Ur?Fn((async(...e)=>{const t=new xn([]),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}))})):Fn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new xn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new xn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new kr({...this._def,args:Sr.create(e).rest(fr.create())})}returns(e){return new kr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new kr({args:e||Sr.create([]).rest(fr.create()),returns:t||fr.create(),typeName:Kr.ZodFunction,...$n(n)})}}class Cr extends Yn{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})}}Cr.create=(e,t)=>new Cr({getter:e,typeName:Kr.ZodLazy,...$n(t)});class Nr extends Yn{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Bn(t,{received:t.data,code:Rn.invalid_literal,expected:this._def.value}),zn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Mr(e,t){return new Rr({values:e,typeName:Kr.ZodEnum,...$n(t)})}Nr.create=(e,t)=>new Nr({value:e,typeName:Kr.ZodLiteral,...$n(t)});class Rr extends Yn{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Bn(t,{expected:An.joinValues(n),received:t.parsedType,code:Rn.invalid_type}),zn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Bn(t,{received:t.data,code:Rn.invalid_enum_value,options:n}),zn}return Fn(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 Rr.create(e)}exclude(e){return Rr.create(this.options.filter((t=>!e.includes(t))))}}Rr.create=Mr;class xr extends Yn{_parse(e){const t=An.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Nn.string&&n.parsedType!==Nn.number){const e=An.objectValues(t);return Bn(n,{expected:An.joinValues(e),received:n.parsedType,code:Rn.invalid_type}),zn}if(-1===t.indexOf(e.data)){const e=An.objectValues(t);return Bn(n,{received:n.data,code:Rn.invalid_enum_value,options:e}),zn}return Fn(e.data)}get enum(){return this._def.values}}xr.create=(e,t)=>new xr({values:e,typeName:Kr.ZodNativeEnum,...$n(t)});class Ur extends Yn{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Nn.promise&&!1===t.common.async)return Bn(t,{code:Rn.invalid_type,expected:Nn.promise,received:t.parsedType}),zn;const n=t.parsedType===Nn.promise?t.data:Promise.resolve(t.data);return Fn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ur.create=(e,t)=>new Ur({type:e,typeName:Kr.ZodPromise,...$n(t)});class Dr extends Yn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Kr.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=>{Bn(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?zn:("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?zn:("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(!Vn(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=>Vn(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}An.assertNever(r)}}Dr.create=(e,t,n)=>new Dr({schema:e,typeName:Kr.ZodEffects,effect:t,...$n(n)}),Dr.createWithPreprocess=(e,t,n)=>new Dr({schema:t,effect:{type:"preprocess",transform:e},typeName:Kr.ZodEffects,...$n(n)});class jr extends Yn{_parse(e){return this._getType(e)===Nn.undefined?Fn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}jr.create=(e,t)=>new jr({innerType:e,typeName:Kr.ZodOptional,...$n(t)});class Lr extends Yn{_parse(e){return this._getType(e)===Nn.null?Fn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Lr.create=(e,t)=>new Lr({innerType:e,typeName:Kr.ZodNullable,...$n(t)});class Br extends Yn{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Nn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Br.create=(e,t)=>new Br({innerType:e,typeName:Kr.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...$n(t)});class Zr extends Yn{_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 Kn(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}}Zr.create=(e,t)=>new Zr({innerType:e,typeName:Kr.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...$n(t)});class zr extends Yn{_parse(e){if(this._getType(e)!==Nn.nan){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.nan,received:t.parsedType}),zn}return{status:"valid",value:e.data}}}zr.create=e=>new zr({typeName:Kr.ZodNaN,...$n(e)});const Wr=Symbol("zod_brand");class Fr extends Yn{_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 Gr extends Yn{_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?zn:"dirty"===e.status?(t.dirty(),Wn(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?zn:"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 Gr({in:e,out:t,typeName:Kr.ZodPipeline})}}const Hr=(e,t={},n)=>e?pr.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})}})):pr.create(),Vr={object:_r.lazycreate};var Kr;!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"}(Kr||(Kr={}));const Jr=rr.create,qr=or.create,Qr=zr.create,$r=ar.create,Yr=sr.create,Xr=ur.create,ei=cr.create,ti=lr.create,ni=dr.create,ri=pr.create,ii=fr.create,oi=hr.create,ai=mr.create,si=vr.create,ui=_r.create,ci=_r.strictCreate,li=wr.create,di=Tr.create,pi=Pr.create,fi=Sr.create,hi=Ar.create,mi=Or.create,vi=Ir.create,yi=kr.create,gi=Cr.create,_i=Nr.create,wi=Rr.create,bi=xr.create,Ti=Ur.create,Ei=Dr.create,Pi=jr.create,Si=Lr.create,Ai=Dr.createWithPreprocess,Oi=Gr.create,Ii={string:e=>rr.create({...e,coerce:!0}),number:e=>or.create({...e,coerce:!0}),boolean:e=>sr.create({...e,coerce:!0}),bigint:e=>ar.create({...e,coerce:!0}),date:e=>ur.create({...e,coerce:!0})},ki=zn;var Ci=Object.freeze({__proto__:null,defaultErrorMap:Un,setErrorMap:function(e){Dn=e},getErrorMap:jn,makeIssue:Ln,EMPTY_PATH:[],addIssueToContext:Bn,ParseStatus:Zn,INVALID:zn,DIRTY:Wn,OK:Fn,isAborted:Gn,isDirty:Hn,isValid:Vn,isAsync:Kn,get util(){return An},ZodParsedType:Nn,getParsedType:Mn,ZodType:Yn,ZodString:rr,ZodNumber:or,ZodBigInt:ar,ZodBoolean:sr,ZodDate:ur,ZodSymbol:cr,ZodUndefined:lr,ZodNull:dr,ZodAny:pr,ZodUnknown:fr,ZodNever:hr,ZodVoid:mr,ZodArray:vr,get objectUtil(){return yr},ZodObject:_r,ZodUnion:wr,ZodDiscriminatedUnion:Tr,ZodIntersection:Pr,ZodTuple:Sr,ZodRecord:Ar,ZodMap:Or,ZodSet:Ir,ZodFunction:kr,ZodLazy:Cr,ZodLiteral:Nr,ZodEnum:Rr,ZodNativeEnum:xr,ZodPromise:Ur,ZodEffects:Dr,ZodTransformer:Dr,ZodOptional:jr,ZodNullable:Lr,ZodDefault:Br,ZodCatch:Zr,ZodNaN:zr,BRAND:Wr,ZodBranded:Fr,ZodPipeline:Gr,custom:Hr,Schema:Yn,ZodSchema:Yn,late:Vr,get ZodFirstPartyTypeKind(){return Kr},coerce:Ii,any:ri,array:si,bigint:$r,boolean:Yr,date:Xr,discriminatedUnion:di,effect:Ei,enum:wi,function:yi,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Hr((t=>t instanceof e),t,!0),intersection:pi,lazy:gi,literal:_i,map:mi,nan:Qr,nativeEnum:bi,never:oi,null:ni,nullable:Si,number:qr,object:ui,oboolean:()=>Yr().optional(),onumber:()=>qr().optional(),optional:Pi,ostring:()=>Jr().optional(),pipeline:Oi,preprocess:Ai,promise:Ti,record:hi,set:vi,strictObject:ci,string:Jr,symbol:ei,transformer:Ei,tuple:fi,undefined:ti,union:li,unknown:ii,void:ai,NEVER:ki,ZodIssueCode:Rn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:xn}),Ni=function(){function e(){var t,n,r,o,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,A,O,I,k;_t(this,e),this.initConfig=window.APP_CONFIG;var C=gt.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?fe:he;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,R="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?pe.HIDE_BACK:pe.SHOW_BACK,x="home"===(null===(v=this.initConfig)||void 0===v||null===(y=v.app)||void 0===y?void 0:y.leftButton)||"both"===(null===(g=this.initConfig)||void 0===g||null===(_=g.app)||void 0===_?void 0:_.leftButton)?pe.SHOW_HOME:pe.HIDE_HOME,U=new URL(location.href),D=mn(null===(w=this.initConfig)||void 0===w||null===(b=w.app)||void 0===b?void 0:b.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.app)||void 0===E?void 0:E.actionBarHidden)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?he:fe);this.config={actionbarType:C,buttonType:R,statusbarType:D,dataConfig:{backgroundColor:(null===(P=this.initConfig)||void 0===P||null===(S=P.app)||void 0===S?void 0:S.headerColor)||me,textColor:(null===(A=this.initConfig)||void 0===A||null===(O=A.app)||void 0===O?void 0:O.textColor)||"",textAlign:(null===(I=this.initConfig)||void 0===I||null===(k=I.app)||void 0===k?void 0:k.textAlign)||ve,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(a,"/").concat(i,"/").concat(U.search)}}}var t=e.prototype;return t.setNavigationBarTitle=function(e){return _e((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("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 _e((function(){var r,i;return Pe(this,(function(o){return void 0===(void 0===e?"undefined":dt(e))&&null===(void 0===e?"undefined":dt(e))||(r="none"===e||"home"===e?pe.HIDE_BACK:pe.SHOW_BACK,i="home"===e||"both"===e?pe.SHOW_HOME:pe.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){rn("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Ue({},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 _e((function(){var n,r,i;return Pe(this,(function(o){return r=e?A.hide:A.show,i=null===(n=Ce())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isAndroid))return n();rn("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 _e((function(){var n,r,i;return Pe(this,(function(o){return r=e?O.hide:O.show,i=null===(n=Ce())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isIOS))return n();rn("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 _e((function(){var n;return Pe(this,(function(r){return n=t.config,gt.isString(e.headerColor)&&(n.dataConfig.backgroundColor=e.headerColor),gt.isString(e.headerTextColor)&&(n.dataConfig.textColor=e.headerTextColor),gt.isString(e.textAlign)&&("left"===e.textAlign?n.dataConfig.textAlign=I.left:"center"===e.textAlign&&(n.dataConfig.textAlign=I.center)),!0===e.hideActionBar?n.actionbarType=he:!1===e.hideActionBar&&(n.actionbarType=fe),"normal"===e.statusBarType?n.statusbarType=S.normal:"hidden"===e.statusBarType?n.statusbarType=S.hidden:"transparent"===e.statusBarType&&(n.statusbarType=S.transparent),[2,new Promise((function(r,i){rn("CHANGE_ACTIONBAR",Ue({},n),{success:function(){var i;t.config=Ue({},n);var o,a=null===(i=Ce())||void 0===i?void 0:i.platform;window.STATUS_BAR_TYPE=(o=t.config.statusbarType)===S.hidden?"hidden":o===S.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=t.config.actionbarType===he;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}(),Mi=Ni.getInstance(),Ri=[ui({title:Jr()}).optional()];function xi(e){return Ui.apply(this,arguments)}function Ui(){return Ui=_e((function(e){return Pe(this,(function(t){return[2,bn("setNavigationBarTitle",Ri,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Mi.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ui.apply(this,arguments)}var Di=[ui({color:Jr(),textColor:Ci.enum(["black","white"]).optional(),statusBarColor:Jr().optional()}).optional()];function ji(e){return Li.apply(this,arguments)}function Li(){return Li=_e((function(e){return Pe(this,(function(t){return[2,bn("setNavigationBarColor",Di,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Mi.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 Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Li.apply(this,arguments)}var Bi=[ui({type:Ci.enum(["none","back","home","both"])}).optional()];function Zi(e){return zi.apply(this,arguments)}function zi(){return zi=_e((function(e){return Pe(this,(function(t){return[2,bn("setNavigationBarLeftButton",Bi,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Mi.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zi.apply(this,arguments)}function Wi(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Fi(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Wi(e,t,"get"))}function Gi(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 Hi(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,Wi(e,t,"set"),n),n}var Vi,Ki,Ji,qi=new WeakMap,Qi=new WeakMap,$i=new WeakMap,Yi=function(){function e(t){_t(this,e),Gi(this,qi,{writable:!0,value:localStorage}),Gi(this,Qi,{writable:!0,value:void 0}),Gi(this,$i,{writable:!0,value:void 0}),Hi(this,$i,{keys:new Set,currentSize:0,limitSize:oe}),Hi(this,Qi,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in Fi(this,qi)){if(e)if(t.split("_")[0]!==e)continue;Fi(this,$i).keys.add(t)}}catch(e){}},t.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},t.getSync=function(e){return Fi(this,Qi)&&(e="".concat(Fi(this,Qi),"_").concat(e)),Fi(this,$i).keys.has(e)?Fi(this,qi).getItem(e):null},t.set=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return Object.entries(e).forEach((function(e){var n=De(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){Fi(this,Qi)&&(e="".concat(Fi(this,Qi),"_").concat(e)),Fi(this,qi).setItem(e,t),Fi(this,$i).keys.add(e)},t.getInfo=function(){var e=this;return _e((function(){return Pe(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},t.getInfoSync=function(){var e=function(e,t){var n,r=0;for(n in e){var i=n.split("_")[0];e.hasOwnProperty(n)&&(t&&i!==t||(r+=2*(e[n].length+n.length)))}return r}(Fi(this,qi),Fi(this,Qi));return{currentSize:gt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((oe/1024).toFixed(2))}},t.remove=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){Fi(this,Qi)&&(e="".concat(Fi(this,Qi),"_").concat(e)),Fi(this,$i).keys.has(e)&&(Fi(this,qi).removeItem(e),Fi(this,$i).keys.delete(e))},t.clear=function(){var e=this;return _e((function(){return Pe(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;Fi(this,$i).keys.forEach((function(t){Fi(e,Qi)&&t.indexOf(Fi(e,Qi))<0||(Fi(e,qi).removeItem(t),Fi(e,$i).keys.delete(t))}))},e}(),Xi=new WeakMap,eo=new WeakMap,to=function(){function e(t){_t(this,e),Gi(this,Xi,{writable:!0,value:void 0}),Gi(this,eo,{writable:!0,value:void 0}),Hi(this,eo,{keys:new Set,currentSize:0,limitSize:oe}),Hi(this,Xi,t)}var t=e.prototype;return t.get=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return[2,new Promise((function(n,r){rn("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Fi(t,Xi)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.set=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return[2,new Promise((function(n,r){rn("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Fi(t,Xi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.getInfo=function(){var e=this;return _e((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Fi(e,Xi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:gt.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(oe/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return[2,new Promise((function(n,r){rn("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Fi(t,Xi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.clear=function(){var e=this;return _e((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Fi(e,Xi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),no=function(){function e(){_t(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return _e((function(){var n,r;return Pe(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]=dn(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return _e((function(){var n,r;return Pe(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=De(e,2),n=t[0],i=t[1];gt.isUndefined(i)||gt.isNull(i)||(r[n]=hn(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return _e((function(){return Pe(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.clearStorage=function(){var e=this;return _e((function(){return Pe(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clear()];case 1:return t.sent(),[2]}}))}))()},t.getStorageInfo=function(){var e=this;return _e((function(){return Pe(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),ro=new WeakMap,io=function(e){At(n,e);var t=It(n);function n(e){var r;return _t(this,n),Gi(Ot(r=t.call(this)),ro,{writable:!0,value:void 0}),Hi(Ot(r),ro,e),r}return n.prototype.getInstance=function(){return new Yi(Fi(this,ro))},n}(no),oo=new WeakMap,ao=function(e){At(n,e);var t=It(n);function n(e){var r;return _t(this,n),Gi(Ot(r=t.call(this)),oo,{writable:!0,value:void 0}),Hi(Ot(r),oo,e),r}return n.prototype.getInstance=function(){return new to(Fi(this,oo))},n}(no),so=new io(i),uo=(null===(Vi=Ce())||void 0===Vi?void 0:Vi.zaloVersion)||"",co=(null===(Ki=Ce())||void 0===Ki?void 0:Ki.platformName)||"unknown";!!gt.isString(uo)&&parseInt(uo,10)>={android:12100571,iOS:400,wp:0,unknown:0}[co]&&(null===(Ji=Ce())||void 0===Ji?void 0:Ji.appEnv.isMp)&&(so=new ao(i));var lo=so,po=[ui({data:Ci.record(Jr(),Ci.any())}).optional()];function fo(e){return ho.apply(this,arguments)}function ho(){return ho=_e((function(e){return Pe(this,(function(t){return[2,bn("setStorage",po,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,lo.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Re("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ho.apply(this,arguments)}var mo=[ui({keys:Ci.array(Jr())}).optional()];function vo(e){return yo.apply(this,arguments)}function yo(){return yo=_e((function(e){return Pe(this,(function(t){return[2,bn("getStorage",mo,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,lo.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Re("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yo.apply(this,arguments)}function go(e){return _o.apply(this,arguments)}function _o(){return(_o=_e((function(e){return Pe(this,(function(t){return[2,bn("getStorageInfo",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,lo.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Re("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var wo=[ui({keys:Ci.array(Jr())}).optional()];function bo(e){return To.apply(this,arguments)}function To(){return To=_e((function(e){return Pe(this,(function(t){return[2,bn("removeStorage",wo,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,lo.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Re("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),To.apply(this,arguments)}var Eo=[ui({prefix:Jr().optional()}).optional()];function Po(e){return So.apply(this,arguments)}function So(){return(So=_e((function(e){return Pe(this,(function(t){return[2,bn("clearStorage",Eo,[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,lo.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Re("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var Ao=function(){var e=_e((function(e,t){var n,r,o,a;return Pe(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,gn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,sn.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=_e((function(e){var t,n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return r=o.sent(),i=null==r?void 0:r.user_id_by_oa,[2,{id:null==r?void 0:r.id,name:(null==r?void 0:r.name)||"",avatar:(null==r||null===(t=r.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url)||"",idByOA:i,followedOA:!!(null==r?void 0:r.is_follower),isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),Oo=[ui({avatarType:Ci.enum(["small","normal","large"]).optional(),autoRequestPermission:Ci.boolean().default(!1).optional()}).optional()];function Io(e){return ko.apply(this,arguments)}function ko(){return ko=_e((function(e){return Pe(this,(function(t){return[2,bn("getUserInfo",Oo,[e],function(){var e=_e((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,[4,Ao(t,n)]):[3,2];case 1:return[2,{userInfo:r.sent()}];case 2:return Ne.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Re("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ko.apply(this,arguments)}var Co=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},No=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(t){var n,r,i,o=t.network,a=(null===(n=Ce())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)||!1;switch(o){case Co(a).NONE:i=d.none;break;case Co(a).WIFI:i=d.wifi;break;case Co(a)["2G"]:case Co(a)["3G"]:case Co(a)["4G"]:i=d.cellular;break;default:i=d.unknown}e(i)},fail:function(e){t(e)}},{})}))]}))}));function Mo(e){return Ro.apply(this,arguments)}function Ro(){return(Ro=_e((function(e){return Pe(this,(function(t){return[2,bn("getNetworkType",[],[e],_e((function(){var e,t;return Pe(this,(function(n){switch(n.label){case 0:return Ne.isMp?[4,No()]:[3,2];case 1:return[2,{networkType:n.sent()}];case 2:if(Ne.isMpWeb){switch(e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,e.effectiveType){case"none":t=d.none;break;case"4g":t=d.wifi;break;case"3g":case"2g":t=d.cellular;break;default:t=d.unknown}return[2,Promise.resolve({networkType:t})]}return[2,Promise.reject(Re("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var xo=[Ci.function().args(ui({isConnected:Ci.boolean(),networkType:Ci.enum(["none","wifi","cellular","unknown"])})).returns(Ci.void())];function Uo(e){return bn("onNetworkStatusChange",xo,[e],(function(e){var t=e;if(Ne.isMp)!function(e){Rt.getInstance().on(f.NetworkChanged,(function(t){var n=null==t?void 0:t.state;No().then((function(t){e({isConnected:"CONNECTED"===n,networkType:t})}))}))}(t);else if(Ne.isMpWeb){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,r=n.effectiveType;n.addEventListener("change",(function(){var e;switch(r){case"none":e=d.none;break;case"4g":e=d.wifi;break;case"3g":case"2g":e=d.cellular;break;default:e=d.unknown}t({isConnected:!0,networkType:e})}))}}))}var Do=function(){var e=_e((function(e){var t,n,r,i,o,a;return Pe(this,(function(s){return a={subaction:0,scanning_type:gt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:gt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:gt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:gt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:gt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:gt.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:gt.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:gt.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:gt.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:gt.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){rn("SCAN_IBEACON",Ue({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),jo=[ui({scanningType:Ci.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Ci.number().optional(),monitorInterval:Ci.number().optional(),domain:Ci.string().optional(),scanConfig:ui({scanTime:Ci.number().optional(),timeBetweenScan:Ci.number().optional(),beaconTimeout:Ci.number().optional(),delayCheckConnectedTimeout:Ci.number().optional(),beaconConnectedTimeout:Ci.number().optional()}).optional(),items:Ci.array(ui({id:Ci.string().optional(),distance:Ci.number().optional(),monitor:ui({enable:Ci.boolean().optional(),movingRange:Ci.number().optional()}).optional()})).optional(),scanFromSource:Ci.string().optional()}).optional()];function Lo(e){return Bo.apply(this,arguments)}function Bo(){return(Bo=_e((function(e){return Pe(this,(function(t){return[2,bn("startBeaconDiscovery",jo,[e],_e((function(){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Do(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Re("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Zo=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function zo(e){return Wo.apply(this,arguments)}function Wo(){return(Wo=_e((function(e){return Pe(this,(function(t){return[2,bn("stopBeaconDiscovery",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Zo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Re("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Fo=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("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 Go(e){return Ho.apply(this,arguments)}function Ho(){return(Ho=_e((function(e){return Pe(this,(function(t){return[2,bn("getBeacons",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Fo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Re("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Vo=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Ko(e){return Jo.apply(this,arguments)}function Jo(){return(Jo=_e((function(e){return Pe(this,(function(t){return[2,bn("closeApp",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Vo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var qo=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Qo(e){return $o.apply(this,arguments)}function $o(){return($o=_e((function(e){return Pe(this,(function(t){return[2,bn("scanQRCode",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,qo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Re("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Yo=function(){var e=_e((function(e,t,n,i){return Pe(this,(function(o){return[2,new Promise((function(o,a){rn("OPEN_PROFILE",{uId:e,type:m[t],zapp:r,sourceId:n,sourceIndex:i},{success:function(){o()},fail:function(e){a(e)}},{})}))]}))}));return function(t,n,r,i){return e.apply(this,arguments)}}(),Xo=[ui({id:Jr(),type:Ci.enum(["user","oa","aliasOA"]),sourceId:Ci.any().optional(),sourceIndex:Ci.any().optional()}).optional()];function ea(e){return ta.apply(this,arguments)}function ta(){return ta=_e((function(e){return Pe(this,(function(t){return[2,bn("openProfile",Xo,[e],function(){var e=_e((function(e){var t,n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return Ne.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Yo(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ta.apply(this,arguments)}var na=function(){var e=_e((function(e,t){var n,i,o,a=arguments;return Pe(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){rn("OPEN_CHAT",{uId:e,type:v[t],msg:n,zapp:r,sourceId:i,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ra=[ui({id:Jr(),type:Ci.enum(["user","oa"]),sourceId:Ci.any().optional(),sourceIndex:Ci.any().optional(),message:Jr().optional()}).optional()];function ia(e){return oa.apply(this,arguments)}function oa(){return oa=_e((function(e){return Pe(this,(function(t){return[2,bn("openChat",ra,[e],function(){var e=_e((function(e){var t,n,r,i,o;return Pe(this,(function(a){switch(a.label){case 0:return Ne.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,na(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),oa.apply(this,arguments)}function aa(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var sa=function(){var e=_e((function(e,t){var n;return Pe(this,(function(i){switch(n={},e){case"image":n={photoUrl:null==t?void 0:t.imageUrl};break;case"link":n={link:null==t?void 0:t.link,title:null==t?void 0:t.title,thumb:null==t?void 0:t.thumb,description:null==t?void 0:t.description};break;case"profile":n={avt:null==t?void 0:t.avatar,uid:null==t?void 0:t.id,dpn:null==t?void 0:t.displayName}}return[2,new Promise((function(t,i){rn("OPEN_POSTFEED",aa(Ue({type:y[e]},n),{zapp:r}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){i(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ua=[Ci.union([ui({type:Ci.enum(["image"]),data:ui({imageUrl:Jr().url().optional()})}),ui({type:Ci.enum(["link"]),data:ui({link:Jr().url(),title:Jr().max(100).optional(),thumb:Jr().url().optional(),description:Jr().max(400).default("").optional()})}),ui({type:Ci.enum(["profile"]),data:ui({id:Jr().optional()})})])];function ca(e){return la.apply(this,arguments)}function la(){return la=_e((function(e){return Pe(this,(function(t){return[2,bn("openPostFeed",ua,[e],function(){var e=_e((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=e.type,n=e.data,[4,sa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Re("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),la.apply(this,arguments)}var da=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("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)}}(),pa=[ui({id:Jr(),showDialogConfirm:Ci.boolean().optional()}).optional()];function fa(e){return ha.apply(this,arguments)}function ha(){return ha=_e((function(e){return Pe(this,(function(t){return[2,bn("followOA",pa,[e],function(){var e=_e((function(e){var t;return Pe(this,(function(n){switch(n.label){case 0:return Ne.isMp?(t=e.id,[4,da(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ha.apply(this,arguments)}var ma=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),va=[ui({id:Jr()}).optional()];function ya(e){return ga.apply(this,arguments)}function ga(){return ga=_e((function(e){return Pe(this,(function(t){return[2,bn("unfollowOA",va,[e],function(){var e=_e((function(e){var t;return Pe(this,(function(n){switch(n.label){case 0:return Ne.isMp?(t=e.id,[4,ma(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ga.apply(this,arguments)}var _a=function(){var e=_e((function(e,t,n,r,i,a){var s,c,d,p,f,h,m,v;return Pe(this,(function(y){switch(y.label){case 0:return d=new URL(location.href),p=new URLSearchParams,f="".concat(d.pathname.replace(u,"")).concat(d.search),a&&(f="/".concat(e).concat("/"===a[0]?"":"/").concat(a)),!(h=new URL("".concat(o).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(c=window.APP_VERSION)||void 0===c?void 0:c.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.CREATE_SHARE_LINK,Ue({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw nn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,aa(Ue({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),wa=function(){var e=_e((function(e,t){var n,o,a,s,u,c,l,d,p,f,h,m;return Pe(this,(function(v){switch(v.label){case 0:switch(n={},o=e,e){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return n={text:null==t?void 0:t.text,desc:(null==t?void 0:t.desc)||(null==t?void 0:t.description),autoParseLink:(null==t?void 0:t.autoParseLink)?1:0},[3,14];case 2:return c=[],l=(null===(s=Ce())||void 0===s?void 0:s.zaloVersion)||0,d=(null===(u=Ce())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=ie[d]&&(o="multi_image"),Array.isArray(null==t?void 0:t.imageUrls)&&(null==t?void 0:t.imageUrls.length)>0?c=null==t?void 0:t.imageUrls:c.push(null==t?void 0:t.imageUrl),n={photoUrls:c,photoUrl:null==t?void 0:t.imageUrl,caption:null==t?void 0:t.caption},[3,14];case 3:return n={photoUrl:null==t?void 0:t.imageUrl,gifUrl:null==t?void 0:t.gifUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 4:return n={videoThumb:null==t?void 0:t.videoThumb,videoUrl:null==t?void 0:t.videoUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 5:return n={link:null==t?void 0:t.link,chatOnly:(null==t?void 0:t.chatOnly)?1:0},[3,14];case 6:return n={uid:null==t?void 0:t.id},[3,14];case 7:case 10:return[4,sn.getAccessToken()];case 8:case 11:return a=v.sent(),[4,_a(i,a||"",(null==t?void 0:t.title)||"",(null==t?void 0:t.description)||"",(null==t?void 0:t.thumbnail)||"",null==t?void 0:t.path)];case 9:return p=v.sent(),n={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(i,"&shareId=").concat(p.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return f=v.sent().shareableLink,h=new URL(f),m=h.searchParams.getAll("zshareId"),h.searchParams.delete("zshareId"),m.length>0&&h.searchParams.append("zshareId",m[0]),n={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(e,t){rn("OPEN_SHARESHEET",aa(Ue({type:_[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)}}(),ba=[Ci.union([ui({type:Ci.enum(["text"]),data:ui({text:Jr(),description:Jr().default("").optional(),autoParseLink:Ci.boolean().default(!1).optional()})}),ui({type:Ci.enum(["image"]),data:ui({imageUrl:Jr().url(),imageUrls:Ci.array(Jr().url()).max(10).optional()})}),ui({type:Ci.enum(["link"]),data:ui({link:Jr().url(),chatOnly:Ci.boolean().optional()})}),ui({type:Ci.enum(["oa"]),data:ui({id:Jr()})}),ui({type:Ci.enum(["gif"]),data:ui({gifUrl:Jr().url(),imageUrl:Jr().url().optional(),width:qr().min(0).optional(),height:qr().min(0).optional()})}),ui({type:Ci.enum(["video"]),data:ui({videoThumb:Jr().url(),videoUrl:Jr().url(),width:qr().min(0).optional(),height:qr().min(0).optional()})}),ui({type:Ci.enum(["zmp","zmp_deep_link"]),data:ui({title:Jr().max(100),thumbnail:Jr().url(),path:Jr().optional(),description:Jr().max(400).default("").optional()})})])];function Ta(e){return Ea.apply(this,arguments)}function Ea(){return Ea=_e((function(e){return Pe(this,(function(t){return[2,bn("openShareSheet",ba,[e],function(){var e=_e((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=e.type,n=e.data,[4,wa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Re("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ea.apply(this,arguments)}var Pa=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Ce())||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=Ce())||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 Sa(e){return Aa.apply(this,arguments)}function Aa(){return(Aa=_e((function(e){return Pe(this,(function(t){return[2,bn("requestCameraPermission",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return[4,Pa()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Oa=function(){var e=_e((function(e,t,n){return Pe(this,(function(r){return[2,new Promise((function(r,i){rn("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)}}(),Ia=_e((function(){var e,t,n,r=arguments;return Pe(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=kn(),[4,Gt(e,t,n.version)];case 1:return[2,o.sent()]}}))})),ka=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ca=[ui({params:Ci.record(Jr(),Jr()).optional()}).optional()];function Na(e){return Ma.apply(this,arguments)}function Ma(){return Ma=_e((function(e){return Pe(this,(function(t){return[2,bn("createShortcut",Ca,[e],function(){var e=_e((function(e){var t,n,r,a,s,u,c,l;return Pe(this,(function(d){switch(d.label){case 0:return Ne.isMp?[4,Ia(i,0)]:[3,6];case 1:return r=d.sent(),a=null===(t=Ce())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||fn("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,ka(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Oa("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,nn.success()];case 6:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ma.apply(this,arguments)}var Ra=function(){var e=_e((function(e,t,n){return Pe(this,(function(i){return[2,new Promise((function(i,o){rn("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)}}(),xa=[ui({secretData:Jr(),ui:ui({title:Jr().default("Xác thực").optional(),subTitle:Jr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:Jr().default("Đóng").optional()}).optional(),requireFingerprint:Yr().default(!0).optional()}).optional()];function Ua(e){return Da.apply(this,arguments)}function Da(){return Da=_e((function(e){return Pe(this,(function(t){return[2,bn("openBioAuthentication",xa,[e],function(){var e=_e((function(e){var t,n,r;return Pe(this,(function(i){switch(i.label){case 0:return Ne.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Ra(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Re("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Da.apply(this,arguments)}var ja=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("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 La(e){return Ba.apply(this,arguments)}function Ba(){return(Ba=_e((function(e){return Pe(this,(function(t){return[2,bn("checkStateBioAuthentication",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,ja()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Ne.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Re("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Za=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),za=[ui({message:Jr()}).optional()];function Wa(e){return Fa.apply(this,arguments)}function Fa(){return Fa=_e((function(e){return Pe(this,(function(t){return[2,bn("showToast",za,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Za(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fa.apply(this,arguments)}var Ga=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ha(e){return Va.apply(this,arguments)}function Va(){return(Va=_e((function(e){return Pe(this,(function(t){return[2,bn("hideKeyboard",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Ga()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var Ka=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ja=[ui({phoneNumber:Jr()})];function qa(e){return Qa.apply(this,arguments)}function Qa(){return Qa=_e((function(e){return Pe(this,(function(t){return[2,bn("openPhone",Ja,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ka(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qa.apply(this,arguments)}var $a=function(){var e=_e((function(e,t){return Pe(this,(function(n){return[2,new Promise((function(n,r){rn("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ya=[ui({content:Jr(),phoneNumber:Jr()})];function Xa(e){return es.apply(this,arguments)}function es(){return es=_e((function(e){return Pe(this,(function(t){return[2,bn("openSMS",Ya,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,$a(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),es.apply(this,arguments)}var ts=function(){var e=_e((function(e){var t,n=arguments;return Pe(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){rn("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)}}(),ns=[ui({id:Jr(),displayName:Jr().default("").optional()})];function rs(e){return is.apply(this,arguments)}function is(){return is=_e((function(e){return Pe(this,(function(t){return[2,bn("viewOAQr",ns,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,ts(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),is.apply(this,arguments)}var os=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("KEEP_SCREEN",{data:{keep_screen_on:e?1:0}},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),as=[ui({keepScreenOn:Yr()})];function ss(e){return us.apply(this,arguments)}function us(){return us=_e((function(e){return Pe(this,(function(t){return[2,bn("keepScreen",as,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,os(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),us.apply(this,arguments)}function cs(e){return ls.apply(this,arguments)}function ls(){return(ls=_e((function(e){return Pe(this,(function(t){return[2,bn("onKeepScreen",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,os(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function ds(e){return ps.apply(this,arguments)}function ps(){return(ps=_e((function(e){return Pe(this,(function(t){return[2,bn("offKeepScreen",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,os(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var fs=function(){var e=_e((function(e,t){var n;return Pe(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){rn("SAVE_IMAGE_GALLERY",Ue({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),hs=[ui({imageBase64Data:Jr().optional(),imageUrl:Jr().url().optional()}).optional()];function ms(e){return vs.apply(this,arguments)}function vs(){return vs=_e((function(e){return Pe(this,(function(t){return[2,bn("saveImageToGallery",hs,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,fs(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vs.apply(this,arguments)}var ys=function(){var e=_e((function(e){var t,n,r,i,o,s,u=arguments;return Pe(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,Ia(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=De(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){rn("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),gs=[ui({appId:Jr(),path:Jr().optional(),params:Ci.record(Jr(),Jr()).optional()})];function _s(e){return ws.apply(this,arguments)}function ws(){return ws=_e((function(e){return Pe(this,(function(t){return[2,bn("openMiniApp",gs,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,ys(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ws.apply(this,arguments)}var bs=_e((function(){var e,t,n=arguments;return Pe(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){rn("INTERACTIVE_VIBRATION",{type:b[e],vibrate_time:t},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))})),Ts=[ui({type:Ci.enum(["oneShot"]).default("oneShot"),milliseconds:qr().optional()})];function Es(e){return Ps.apply(this,arguments)}function Ps(){return Ps=_e((function(e){return Pe(this,(function(t){return[2,bn("vibrate",Ts,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,bs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ps.apply(this,arguments)}var Ss=function(){var e=_e((function(e,t){var n,r,i,o;return Pe(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=gt.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Vt(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Vt(null==t?void 0:t.leftButton):"back"},!r&>.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){rn("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),As=[ui({url:Jr(),config:ui({style:Ci.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Ci.enum(["back","none"]).default("back").optional()}).optional()})];function Os(e){return Is.apply(this,arguments)}function Is(){return Is=_e((function(e){return Pe(this,(function(t){return[2,bn("openWebview",As,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ss(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Is.apply(this,arguments)}function ks(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Dt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Cs(){return bn("getRouteParams",[],[],(function(){return ks()}))}function Ns(e){return Ms.apply(this,arguments)}function Ms(){return(Ms=_e((function(e){return Pe(this,(function(t){return[2,bn("getAppInfo",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Ia()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Re("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Rs=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("WEBVIEW_SET_RESULT",{result:hn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),xs=[ui({data:Ci.any()})];function Us(e){return Ds.apply(this,arguments)}function Ds(){return Ds=_e((function(e){return Pe(this,(function(t){return[2,bn("sendDataToPreviousMiniApp",xs,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Rs(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ds.apply(this,arguments)}var js=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){var n,r;rn("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(nn.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Ce())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function Ls(e){return Bs.apply(this,arguments)}function Bs(){return(Bs=_e((function(e){return Pe(this,(function(t){return[2,bn("getPhoneNumber",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,js()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Re("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var Zs=_e((function(){var e,t=arguments;return Pe(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){rn("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})}))]}))})),zs=[ui({maxProfile:qr().min(1).max(10).optional().default(1)})];function Ws(e){return Fs.apply(this,arguments)}function Fs(){return Fs=_e((function(e){return Pe(this,(function(t){return[2,bn("openProfilePicker",zs,[e],function(){var e=_e((function(e){var t,n,r,i,o;return Pe(this,(function(a){switch(a.label){case 0:return Ne.isMp?[4,Zs(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,sn.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(gt.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 Ne.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Re("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fs.apply(this,arguments)}var Gs=function(){var e=_e((function(e,t,n){var r;return Pe(this,(function(i){return r=t&>.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){rn("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)}}(),Hs=[ui({SSID:Jr(),password:Jr().optional(),hiddenSSID:Yr().optional()})];function Vs(e){return Ks.apply(this,arguments)}function Ks(){return Ks=_e((function(e){return Pe(this,(function(t){return[2,bn("connectWifi",Hs,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Gs(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ks.apply(this,arguments)}var Js=function(){var e=_e((function(e,t,n,r,i,o){var a,s;return Pe(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){rn("PICK_MEDIA",{media_type:T[e],edit_view:Ue({},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)}}(),qs=[ui({type:Ci.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:Jr().url(),maxItemSize:qr().min(0).optional(),editView:ui({enable:Yr().optional(),aspectRatio:Jr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:Yr().optional(),maxSelectItem:qr().min(1).optional()})];function Qs(e){return $s.apply(this,arguments)}function $s(){return $s=_e((function(e){return Pe(this,(function(t){return[2,bn("openMediaPicker",qs,[e],function(){var e=_e((function(e){var t,n,r,i,o,a;return Pe(this,(function(s){switch(s.label){case 0:return Ne.isMp?(i={},gt.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,Js(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Ne.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Re("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$s.apply(this,arguments)}var Ys=[ui({title:Jr().max(100),description:Jr().max(400).default(""),thumbnail:Jr().url().optional(),path:Jr().optional()})];function Xs(e){return eu.apply(this,arguments)}function eu(){return eu=_e((function(e){return Pe(this,(function(t){return[2,bn("getShareableLink",Ys,[e],function(){var e=_e((function(e){var t;return Pe(this,(function(n){switch(n.label){case 0:return[4,sn.getAccessToken()];case 1:return t=n.sent(),[4,_a(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)}}())]}))})),eu.apply(this,arguments)}var tu=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("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 nu(e){return ru.apply(this,arguments)}function ru(){return(ru=_e((function(e){return Pe(this,(function(t){return[2,bn("closeLoading",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,tu("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function iu(e){return ou.apply(this,arguments)}function ou(){return ou=_e((function(e){return Pe(this,(function(t){return[2,bn("requestUpdateZalo",[],[e],_e((function(){var e,t,n;return Pe(this,(function(r){switch(r.label){case 0:return Ne.isMp?(n=(null===(e=Ce())||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,ka(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("requestUpdateZalo",{}))]}}))})))]}))})),ou.apply(this,arguments)}var au=Rt.getInstance();au.addListener=function(e,t,n){var r=e;return au.addListener(f[r],t,n)};var su=[Ci.function()];function uu(e){return bn("onConfirmToExit",su,[e],(function(e){var t=e;Ne.isMp&&(au.on(f.AppClose,t,'{"handle_h5": 1}'),Mi.setNavigationBarLeftButton(void 0,2))}))}function cu(){return bn("offConfirmToExit",[],[],(function(){Ne.isMp&&(au.off(f.AppClose),Mi.setNavigationBarLeftButton(void 0,0))}))}function lu(){return bn("getDeviceId",[],[],(function(){return Ne.isMp&&sn.getSync(c.DEVICE_ID)||""}))}function du(e){return pu.apply(this,arguments)}function pu(){return(pu=_e((function(e){return Pe(this,(function(t){return[2,bn("getDeviceIdAsync",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,sn.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function fu(){return bn("getContext",[],[],(function(){if(Ne.isMp){var e=sn.getSync(c.CONTEXT_ID)||"";return{type:sn.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function hu(e){return mu.apply(this,arguments)}function mu(){return(mu=_e((function(e){return Pe(this,(function(t){return[2,bn("getContextAsync",[],[e],_e((function(){var e;return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,sn.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,sn.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 vu(e){return yu.apply(this,arguments)}function yu(){return(yu=_e((function(e){return Pe(this,(function(t){return[2,bn("getAuthCode",[],[e],_e((function(){var e,t;return Pe(this,(function(n){switch(n.label){case 0:return Ne.isMp?[4,sn.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,sn.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,sn.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Ht([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),nn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function gu(e){return _u.apply(this,arguments)}function _u(){return(_u=_e((function(e){return Pe(this,(function(t){return[2,bn("getZPIToken",[],[e],_e((function(){var e,t,n,r;return Pe(this,(function(i){switch(i.label){case 0:return Ne.isMp?[4,sn.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,sn.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,sn.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,sn.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 wu=[Jr()];function bu(e){return bn("setAccessToken",wu,[e],(function(e){var t=e;sn.setAccessToken(t)}))}var Tu=[ui({url:Jr().url()})];function Eu(e){return Pu.apply(this,arguments)}function Pu(){return Pu=_e((function(e){return Pe(this,(function(t){return[2,bn("openOutApp",Tu,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,ka(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pu.apply(this,arguments)}var Su=[ui({count:qr().min(1).optional().default(1),sourceType:Ci.array(Ci.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Ci.enum(["back","front"]).default("front").optional()})];function Au(e){return Ou.apply(this,arguments)}function Ou(){return Ou=_e((function(e){return Pe(this,(function(t){return[2,bn("chooseImage",Su,[e],function(){var e=_e((function(e){var t,n,r,i;return Pe(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)}}())]}))})),Ou.apply(this,arguments)}var Iu=_e((function(){var e,t,n=arguments;return Pe(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){rn("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(nn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function ku(e){return Cu.apply(this,arguments)}function Cu(){return(Cu=_e((function(e){return Pe(this,(function(t){return[2,bn("getLocation",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Iu()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Re("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Nu=[Ci.function().args(ui({data:Ci.any()})).returns(Ci.void())];function Mu(e){return bn("onCallbackData",Nu,[e],(function(){!function(e){Rt.getInstance().on(f.OnDataCallback,(function(t){e({data:t})}))}(e)}))}var Ru=function(){var e=_e((function(e){var t,n,r,o,a,s,u,c,l,d,p;return Pe(this,(function(f){switch(f.label){case 0:return n="",e||(e=ks()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Dt.getParameterByName("orderId",e),o=Dt.getParameterByName("appTransID",e)||Dt.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,sn.getAccessToken().catch((function(){throw nn.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(ue),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 nn.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,Ue({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),xu=function(){var e=_e((function(e,t,n,r,o,a,s){var u,c,l,d,p,h,m,v,y,g,_,w,b,T,E,P,S,A,O,I,k;return Pe(this,(function(C){switch(C.label){case 0:u=i,(c=new URLSearchParams).append("amount",e.toString()),c.append("item",encodeURIComponent(JSON.stringify(t))),c.append("appId",u),n&&c.append("desc",encodeURIComponent(n)),r&&(l=r,"object"==typeof r&&(l=JSON.stringify(r)),c.append("extradata",encodeURIComponent(l))),o&&(d=o,"object"==typeof o&&(d=JSON.stringify(o)),c.append("payload",encodeURIComponent(d))),a&&("string"==typeof a?(c.append("method",a),c.append("isCustom","false")):"object"==typeof a&&(c.append("method",a.id),c.append("isCustom",JSON.stringify(a.isCustom)))),s&&c.append("mac",s),p={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,sn.getAccessToken().catch((function(){throw nn.error.loginRequired}))];case 2:return m=C.sent(),p.headers.authorization="Bearer ".concat(m),[4,fetch(ae,aa(Ue({method:"POST"},p),{body:c}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw nn.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=v.data.messageToken||"",w=window.APP_VERSION,b=window.APP_ENV,T={miniAppId:u,orderId:y},E=v.data.method,P=v.data.isCustom,g&&(T.token=g),w&&(T.version=w),b&&(T.env=b),E&&(T.method=E),P&&(T.isCustom=P),S=Dt.encode(T),A=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),O=Kt(),I=((null===(h=Ce())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,Ss(A,{style:"android"===I&&O<742?"normal":"bottomSheet"}).then((function(){var e=!1;Rt.getInstance().once(f.WebviewClosed,(function(){setTimeout(_e((function(){var t;return Pe(this,(function(n){switch(n.label){case 0:return e?[3,2]:[4,Ru({zmpOrderId:y})];case 1:(t=n.sent()).err>=0&&!t.isCustom&&Rt.getInstance().emit(f.PaymentClose,t.err,aa(Ue({},t),{zmpOrderId:y})),n.label=2;case 2:return[2]}}))})),500)})),Rt.getInstance().once(f.OpenApp,(function(){e=!0}))}))];case 5:return C.sent(),[2,{orderId:y,messageToken:_}];case 6:throw k=C.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(t,n,r,i,o,a,s){return e.apply(this,arguments)}}(),Uu=[ui({amount:Ci.union([Jr(),qr()]),item:Ci.array(Ci.record(Jr(),Ci.any())),desc:Jr(),extradata:Ci.any().optional(),payload:Ci.any().optional(),method:Ci.union([Ci.string(),Ci.object({id:Ci.string(),isCustom:Ci.boolean()})]).optional(),mac:Ci.string().optional()})];function Du(e){return ju.apply(this,arguments)}function ju(){return ju=_e((function(e){return Pe(this,(function(t){return[2,bn("createOrder",Uu,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,xu(e.amount,e.item,e.desc,e.extradata,e.payload,e.method,e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Re("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ju.apply(this,arguments)}var Lu=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),Bu=function(){var e=_e((function(e,t,n,r,o){var a,s,u,c,l,d,p,f,h,m,v,y;return Pe(this,(function(g){switch(g.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 "}},g.label=1;case 1:return g.trys.push([1,10,,11]),[4,sn.getAccessToken().catch((function(){throw nn.error.loginRequired}))];case 2:return l=g.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,sn.jumpAndGetToken()];case 3:if(g.sent(),d=null===(c=sn.miniProgramConfig)||void 0===c?void 0:c.showConfirmToPayment,console.log("showConfirmToPayment",d),!d)return[3,7];g.label=4;case 4:return g.trys.push([4,6,,7]),[4,Lu()];case 5:return g.sent(),[3,7];case 6:throw p=g.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(ce,aa(Ue({method:"POST"},u),{body:s}))];case 8:return[4,g.sent().json()];case 9:if(!(f=g.sent()).data||0!==f.err)throw nn.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 y=g.sent(),console.log("Internal error"),y;case 11:return[2]}}))}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),Zu=[ui({amount:Ci.union([Ci.string(),Ci.number()]),desc:Ci.string(),method:Ci.string(),transId:Ci.string().optional(),mac:Ci.string().optional()})];function zu(e){return Wu.apply(this,arguments)}function Wu(){return Wu=_e((function(e){return Pe(this,(function(t){return[2,bn("purchase",Zu,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Bu(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 Ne.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Re("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wu.apply(this,arguments)}var Fu=function(){var e=_e((function(e,t){return Pe(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;rn("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)}}(),Gu=[ui({channels:si(ui({method:Jr(),subMethod:Jr().optional(),subInfo:Jr().optional()})).optional(),selectedMethod:ui({method:Jr(),subMethod:Jr().optional()}).optional()}).optional()];function Hu(e){return Vu.apply(this,arguments)}function Vu(){return Vu=_e((function(e){return Pe(this,(function(t){return[2,bn("selectPaymentMethod",Gu,[e],function(){var e=_e((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=e.channels,n=e.selectedMethod,[4,Fu(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Re("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vu.apply(this,arguments)}var Ku=[ui({data:Ci.union([Jr(),Ci.record(Jr(),Jr())])})];function Ju(e){return qu.apply(this,arguments)}function qu(){return qu=_e((function(e){return Pe(this,(function(t){return[2,bn("checkTransaction",Ku,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ru(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Re("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qu.apply(this,arguments)}var Qu=[ui({hide:Yr().default(!1).optional()}).optional()];function $u(e){return Yu.apply(this,arguments)}function Yu(){return Yu=_e((function(e){return Pe(this,(function(t){return[2,bn("setAndroidBottomNavigationBar",Qu,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Mi.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yu.apply(this,arguments)}var Xu=[ui({hide:Yr().default(!1).optional()}).optional()];function ec(e){return tc.apply(this,arguments)}function tc(){return tc=_e((function(e){return Pe(this,(function(t){return[2,bn("setIOSBottomSafeArea",Xu,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Mi.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),tc.apply(this,arguments)}var nc=[ui({type:Ci.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Ci.string().optional()}).optional()];function rc(e){return ic.apply(this,arguments)}function ic(){return ic=_e((function(e){return Pe(this,(function(t){return[2,bn("setStatusBar",nc,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Mi.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ic.apply(this,arguments)}var oc=[ui({headerTextColor:Ci.enum(["black","white"]).optional(),headerColor:Ci.string().optional(),actionBar:ui({hide:Ci.boolean().optional(),title:Ci.string().optional(),leftButton:Ci.enum(["back","none"]).optional(),textAlign:Ci.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Ci.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Ci.boolean().optional(),hideIOSSafeAreaBottom:Ci.boolean().optional()})];function ac(e){return sc.apply(this,arguments)}function sc(){return sc=_e((function(e){return Pe(this,(function(t){return[2,bn("configAppView",oc,[e],function(){var e=_e((function(e){var t,n,r,i,o,a,s;return Pe(this,(function(u){switch(u.label){case 0:return Ne.isMp?gt.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Mi.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return gt.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,Mi.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Mi.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,Mi.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Mi.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 Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),sc.apply(this,arguments)}var uc=function(){var e=_e((function(e,t,n,r,o,a){var s,u,c,l,d,p,f,h,m,v,y,g,_,w;return Pe(this,(function(b){switch(b.label){case 0:d=i,(p=new URLSearchParams).append("payType",t||E.SUBSCRIPTION),f=P.UNKNOW,n===de&&(f=P.IMMEDIATE_AND_CHARGE_FULL_PRICE),n===le&&(f=P.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=Ce())||void 0===s||null===(u=s.platform)||void 0===u?void 0:u.isIOS)?h="ios":(null===(c=Ce())||void 0===c||null===(l=c.platform)||void 0===l?void 0:l.isAndroid)&&(h="android"),p.append("os",h),p.append("productId",e),m={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},b.label=1;case 1:return b.trys.push([1,5,,6]),[4,sn.getAccessToken().catch((function(){throw nn.error.loginRequired}))];case 2:return v=b.sent(),m.headers.authorization="Bearer ".concat(v),[4,fetch(se,aa(Ue({method:"POST"},m),{body:p}))];case 3:return[4,b.sent().json()];case 4:if(!(y=b.sent()).data||!y.data.store||0!==y.err)throw nn.error.createIAPOrderFailed(y.err);return g=y.data.store,_=y.data.orderId,[2,new Promise((function(e,t){rn("IAP_REQUESTPAYMENT",Ue({},g),{success:function(){e({orderId:_})},fail:function(e){t(e)}})}))];case 5:throw w=b.sent(),console.log("Internal error"),w;case 6:return[2]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),cc=[ui({productId:Jr(),payType:Ci.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Ci.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:Jr().optional(),method:Ci.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:Jr().optional()})];function lc(e){return dc.apply(this,arguments)}function dc(){return dc=_e((function(e){return Pe(this,(function(t){return[2,bn("createOrderIAP",cc,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,uc(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Re("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),dc.apply(this,arguments)}var pc=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function fc(e){return hc.apply(this,arguments)}function hc(){return(hc=_e((function(e){return Pe(this,(function(t){return[2,bn("minimizeApp",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,pc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var mc=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function vc(e){return yc.apply(this,arguments)}function yc(){return(yc=_e((function(e){return Pe(this,(function(t){return[2,bn("openPermissionSetting",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,mc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var gc=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function _c(e){return wc.apply(this,arguments)}function wc(){return(wc=_e((function(e){return Pe(this,(function(t){return[2,bn("favoriteApp",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,gc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var bc=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Tc(e){return Ec.apply(this,arguments)}function Ec(){return(Ec=_e((function(e){return Pe(this,(function(t){return[2,bn("openGroupList",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,bc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Pc=_e((function(){var e;return Pe(this,(function(t){switch(t.label){case 0:return[4,sn.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){rn("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function Sc(e){return Ac.apply(this,arguments)}function Ac(){return(Ac=_e((function(e){return Pe(this,(function(t){return[2,bn("requestSendNotification",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Pc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var Oc=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Ic(e){return kc.apply(this,arguments)}function kc(){return(kc=_e((function(e){return Pe(this,(function(t){return[2,bn("addRating",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Oc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var Cc,Nc=(Cc=_e((function(e,t,n){var r,i;return Pe(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,Ue({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return Cc.apply(this,arguments)}),Mc=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("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)}}(),Rc=[ui({oaId:Jr()})];function xc(e){return Uc.apply(this,arguments)}function Uc(){return Uc=_e((function(e){return Pe(this,(function(t){return[2,bn("interactOA",Rc,[e],function(){var e=_e((function(e){var t,n,r;return Pe(this,(function(o){switch(o.label){case 0:return Ne.isMp?(t=e.oaId,[4,sn.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||gt.isEmpty(n)?[3,3]:[4,Nc(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,Mc(t)];case 4:return[2,o.sent()];case 5:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Uc.apply(this,arguments)}var Dc=[ui({oaId:Jr()})];function jc(e){return Lc.apply(this,arguments)}function Lc(){return Lc=_e((function(e){return Pe(this,(function(t){return[2,bn("isAllowedInteractWithOA",Dc,[e],function(){var e=_e((function(e){var t,n,r;return Pe(this,(function(o){switch(o.label){case 0:return Ne.isMp?(t=e.oaId,[4,sn.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||gt.isEmpty(n)?[3,3]:[4,Nc(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 Ne.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Re("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Lc.apply(this,arguments)}function Bc(e){return Zc.apply(this,arguments)}function Zc(){return(Zc=_e((function(e){return Pe(this,(function(t){return[2,bn("getSetting",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,en()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Re("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var zc=Ci.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Wc=[ui({scopes:Ci.array(zc).max(2).optional()}).optional()];function Fc(e){return Gc.apply(this,arguments)}function Gc(){return Gc=_e((function(e){return Pe(this,(function(t){return[2,bn("authorize",Wc,[e],function(){var e=_e((function(e){var t,n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return Ne.isMp?(n=null==e?void 0:e.scopes,r=Kt(),("android"===(i=((null===(t=Ce())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject(nn.error.clientNotSupport())]:[4,on(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gc.apply(this,arguments)}var Hc=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n;return Pe(this,(function(r){switch(r.label){case 0:return gt.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(nn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Vc(e){return bn("checkZaloCameraPermission",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return[4,Hc()];case 1:return[2,e.sent()]}}))})))}var Kc=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,sn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=sn.miniProgramConfig)||void 0===n?void 0:n.userId,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Jc(e){return qc.apply(this,arguments)}function qc(){return(qc=_e((function(e){return Pe(this,(function(t){return[2,bn("getUserID",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Kc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Re("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var Qc=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,sn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=sn.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 $c(e){return Yc.apply(this,arguments)}function Yc(){return(Yc=_e((function(e){return Pe(this,(function(t){return[2,bn("getIDToken",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Qc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Re("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Xc={format:N.JPEG,quality:M.NORMAL,mirrored:!1,useVideoSourceSize:!1},el={width:1024,height:768,facingMode:C.FRONT,mirrored:!1,audio:!1,video:!0},tl=function(){function e(t){var n,r,i,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=this;_t(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(N.PNG),width:e.width,height:e.height};Rt.getInstance().emit(k.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:el.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:el.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(o=null==s?void 0:s.audio)&&void 0!==o?o:el.audio,this._videoEnabled=null!==(a=null==s?void 0:s.video)&&void 0!==a?a:el.video}var t=e.prototype;return t.on=function(e,t){Rt.getInstance().on(e,(function(e){t(e)})),e===k.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},t.off=function(e){Rt.getInstance().off(e),e===k.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 _e((function(){return Pe(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 _e((function(){var n,r,i,o,a,s;return Pe(this,(function(u){switch(u.label){case 0:return gt.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||el.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||el.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==C.FRONT&&o.label.toLowerCase().includes("front")||this._facingMode==C.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 _e((function(){return Pe(this,(function(t){switch(t.label){case 0:return e._facingMode=e._facingMode==C.FRONT?C.BACK:C.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 _e((function(){var t,n;return Pe(this,(function(r){return t=Rt.getInstance(),n=function(t){try{e._hasUserMedia&&e.stop()}catch(e){}},t.off(f.AppPaused,n),t.on(f.AppPaused,n),[2,new Promise(function(){var t=_e((function(t,n){var r;return Pe(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e.stream()];case 1:return i.sent(),Rt.getInstance().emit(k.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 _e((function(){return Pe(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 _e((function(){return Pe(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=_e((function(n){return Pe(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==C.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 _e((function(){return Pe(this,(function(r){switch(r.label){case 0:if(e===R.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 _e((function(){return Pe(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 _e((function(){return Pe(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(),Rt.getInstance().emit(k.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||Xc.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===C.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===C.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}(),nl=ui({play:Ci.function(),pause:Ci.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),rl=[ui({videoElement:nl,mediaConstraints:Ci.object({width:Ci.number().min(100).optional(),height:Ci.number().min(100).optional(),facingMode:Ci.string().optional(),audio:Ci.boolean().optional(),video:Ci.boolean().optional(),deviceId:Ci.string().optional(),mirrored:Ci.boolean().optional()}).nullish()}).optional()];function il(e){return bn("createCameraContext",rl,[e],(function(e){return new tl(e.videoElement,e.mediaConstraints)}))}var ol=function(){function e(){var t,n;_t(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=Ee(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;gt.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?gt.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?gt.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 al(e){return sl.apply(this,arguments)}function sl(){return(sl=_e((function(e){return Pe(this,(function(t){return[2,bn("setupAd",[],[e],(function(){return ol.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var ul=[ui({ids:Ci.union([Ci.string(),Ci.array(Ci.string())]),config:ui({display:Ci.boolean().optional(),onClose:Ci.function().optional()}).optional()})];function cl(e){return ll.apply(this,arguments)}function ll(){return ll=_e((function(e){return Pe(this,(function(t){return[2,bn("loadAd",ul,[e],function(){var e=_e((function(e){return Pe(this,(function(t){return ol.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ll.apply(this,arguments)}var dl=[ui({id:Ci.string()})];function pl(e){return fl.apply(this,arguments)}function fl(){return fl=_e((function(e){return Pe(this,(function(t){return[2,bn("displayAd",dl,[e],function(){var e=_e((function(e){return Pe(this,(function(t){return ol.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fl.apply(this,arguments)}var hl=[ui({id:Ci.string().optional()}).optional()];function ml(e){return vl.apply(this,arguments)}function vl(){return vl=_e((function(e){return Pe(this,(function(t){return[2,bn("refreshAd",hl,[e],function(){var e=_e((function(e){return Pe(this,(function(t){return ol.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vl.apply(this,arguments)}var yl=[ui({id:Jr(),guidingText:Jr().optional(),color:Jr().optional(),onStatusChange:Ci.function().optional()})];function gl(e){return _l.apply(this,arguments)}function _l(){return _l=_e((function(t){return Pe(this,(function(n){return[2,bn("showOAWidget",yl,[t],function(){var t=_e((function(t){var n,r,i,o,a,s,u,c;return Pe(this,(function(l){if(Ne.isMp){try{n=document.getElementById(t.id),r=t.onStatusChange,i=t.guidingText,o=t.color,a=e(t,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="iframeOAWidget_".concat(Date.now()),(c=new URL("https://h5.zalo.me/widgets/oa_widget.html")).searchParams.set("id",u),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=De(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.addEventListener("message",function(){var e=_e((function(e){var t,n,i,o,a,s,l,d;return Pe(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(u),i=t.type,(o=new URL(t.href)).origin!==c.origin||o.pathname!==c.pathname||t.id!==u?[3,3]:"followOA"!==i&&"getOAInfo"!==i?[3,2]:[4,sn.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=sn.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},"*"),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?Yo(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),_l.apply(this,arguments)}var wl=[ui({id:Jr(),type:Jr(),text:Jr(),color:Jr().optional(),disabled:Ci.boolean().optional(),onDataReceived:Ci.function().optional(),onError:Ci.function().optional()})];function bl(e){return Tl.apply(this,arguments)}function Tl(){return Tl=_e((function(t){return Pe(this,(function(n){return[2,bn("showFunctionButtonWidget",wl,[t],function(){var t=_e((function(t){var n,r,i,o,a,s,u;return Pe(this,(function(c){if(Ne.isMp){try{n=document.getElementById(t.id),r=t.onDataReceived,i=t.onError,o=e(t,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="iframeFunctionButtonWidget".concat(Date.now()),(u=new URL("https://h5.zalo.me/widgets/function_button_widget.html")).searchParams.set("id",s),Object.entries(o).forEach((function(e){var t=De(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=De(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.addEventListener("message",function(){var e=_e((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return Pe(this,(function(g){switch(g.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(s),a=t.type,(c=new URL(t.href)).origin!==u.origin||c.pathname!==u.pathname||t.id!==s?[3,4]:"buttonClicked"!==a?[3,3]:[4,sn.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=sn.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=sn.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,Pn()];case 2:return m=g.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},"*"),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(null==r||r(null==v?void 0:v.data)):"onError"===a&&(null==(y=t.payload)?void 0:y.type)===o.type&&(null==i||i(null==y?void 0:y.data)),g.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),Tl.apply(this,arguments)}var El=function(){var e=_e((function(e,t){var n;return Pe(this,(function(r){return n={},"cccd"===e&&(n={mrz:null==t?void 0:t.mrz}),[2,new Promise((function(t,r){rn("SCAN_NFC",{type:g[e],data:n},{success:function(n){if("cccd"===e){var r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E={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!==(y=n.dg15)&&void 0!==y?y:"",dg16:null!==(g=n.dg16)&&void 0!==g?g:"",sod:null!==(_=n.sod)&&void 0!==_?_:"",challenge:null!==(w=n.challenge)&&void 0!==w?w:"",aAResult:null!==(b=n.aAResult)&&void 0!==b?b:"",eACCAResult:null!==(T=n.eACCAResult)&&void 0!==T?T:""};t(E)}else t({})},fail:function(e){r(e)}},{timeout:!1})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Pl=[ui({type:Ci.enum(["cccd"]),data:ui({mrz:Jr().max(90)})})];function Sl(e){return Al.apply(this,arguments)}function Al(){return Al=_e((function(e){return Pe(this,(function(t){return[2,bn("scanNFC",Pl,[e],function(){var e=_e((function(e){var t,n,r,i,o;return Pe(this,(function(a){switch(a.label){case 0:return Ne.isMp?(n=Kt(),"android"===(r=((null===(t=Ce())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&n<754||"ios"===r&&n<620?[2,Promise.reject(nn.error.clientNotSupport())]:(i=e.type,o=e.data,[4,El(i,o)])):[3,2];case 1:return[2,a.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Al.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:In},Tn();var Ol=Object.freeze({__proto__:null,get Events(){return f},get EventName(){return f},get CameraEvents(){return k},login:Tn,getAccessToken:Pn,getVersion:In,getSystemInfo:Cn,setNavigationBarTitle:xi,setNavigationBarColor:ji,setNavigationBarLeftButton:Zi,setStorage:fo,getStorage:vo,getStorageInfo:go,removeStorage:bo,clearStorage:Po,getUserInfo:Io,getNetworkType:Mo,onNetworkStatusChange:Uo,startBeaconDiscovery:Lo,stopBeaconDiscovery:zo,getBeacons:Go,closeApp:Ko,scanQRCode:Qo,openProfile:ea,openChat:ia,openPostFeed:ca,followOA:fa,unfollowOA:ya,openShareSheet:Ta,requestCameraPermission:Sa,createShortcut:Na,openBioAuthentication:Ua,checkStateBioAuthentication:La,showToast:Wa,hideKeyboard:Ha,openPhone:qa,openSMS:Xa,viewOAQr:rs,keepScreen:ss,onKeepScreen:cs,offKeepScreen:ds,saveImageToGallery:ms,openMiniApp:_s,vibrate:Es,openWebview:Os,getRouteParams:Cs,getAppInfo:Ns,sendDataToPreviousMiniApp:Us,getPhoneNumber:Ls,openProfilePicker:Ws,connectWifi:Vs,openMediaPicker:Qs,getShareableLink:Xs,closeLoading:nu,requestUpdateZalo:iu,onConfirmToExit:uu,offConfirmToExit:cu,getDeviceId:lu,getDeviceIdAsync:du,getContext:fu,getContextAsync:hu,getAuthCode:vu,getZPIToken:gu,setAccessToken:bu,openOutApp:Eu,chooseImage:Au,getLocation:ku,onCallbackData:Mu,createOrder:Du,purchase:zu,selectPaymentMethod:Hu,checkTransaction:Ju,events:au,setAndroidBottomNavigationBar:$u,setIOSBottomSafeArea:ec,setStatusBar:rc,configAppView:ac,createOrderIAP:lc,minimizeApp:fc,openPermissionSetting:vc,favoriteApp:_c,openGroupList:Tc,requestSendNotification:Sc,addRating:Ic,interactOA:xc,interactOa:xc,isAllowedInteractWithOA:jc,getSetting:Bc,authorize:Fc,checkZaloCameraPermission:Vc,getUserID:Jc,getIDToken:$c,createCameraContext:il,setupAd:al,loadAd:cl,displayAd:pl,refreshAd:ml,showOAWidget:gl,showFunctionButtonWidget:bl,scanNFC:Sl,get FacingMode(){return C},get PhotoFormat(){return N},get PhotoQuality(){return M},get StreamType(){return R},ZMACameraImp:tl}),Il=Du,kl=Ju,Cl=lc,Nl=Hu,Ml=zu,Rl=e(Ol,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]),xl={createOrder:Il,checkTransaction:kl,createOrderIAP:Cl,selectPaymentMethod:Nl},Ul={selectPaymentMethod:Nl,purchase:Ml};!function(){var e,t=null===(e=Ce())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,Ol))}();var Dl=Object.freeze({__proto__:null,Payment:xl,CheckoutSDK:Ul,default:Rl,get Events(){return f},get EventName(){return f},get CameraEvents(){return k},login:Tn,getAccessToken:Pn,getVersion:In,getSystemInfo:Cn,setNavigationBarTitle:xi,setNavigationBarColor:ji,setNavigationBarLeftButton:Zi,setStorage:fo,getStorage:vo,getStorageInfo:go,removeStorage:bo,clearStorage:Po,getUserInfo:Io,getNetworkType:Mo,onNetworkStatusChange:Uo,startBeaconDiscovery:Lo,stopBeaconDiscovery:zo,getBeacons:Go,closeApp:Ko,scanQRCode:Qo,openProfile:ea,openChat:ia,openPostFeed:ca,followOA:fa,unfollowOA:ya,openShareSheet:Ta,requestCameraPermission:Sa,createShortcut:Na,openBioAuthentication:Ua,checkStateBioAuthentication:La,showToast:Wa,hideKeyboard:Ha,openPhone:qa,openSMS:Xa,viewOAQr:rs,keepScreen:ss,onKeepScreen:cs,offKeepScreen:ds,saveImageToGallery:ms,openMiniApp:_s,vibrate:Es,openWebview:Os,getRouteParams:Cs,getAppInfo:Ns,sendDataToPreviousMiniApp:Us,getPhoneNumber:Ls,openProfilePicker:Ws,connectWifi:Vs,openMediaPicker:Qs,getShareableLink:Xs,closeLoading:nu,requestUpdateZalo:iu,onConfirmToExit:uu,offConfirmToExit:cu,getDeviceId:lu,getDeviceIdAsync:du,getContext:fu,getContextAsync:hu,getAuthCode:vu,getZPIToken:gu,setAccessToken:bu,openOutApp:Eu,chooseImage:Au,getLocation:ku,onCallbackData:Mu,createOrder:Du,purchase:zu,selectPaymentMethod:Hu,checkTransaction:Ju,events:au,setAndroidBottomNavigationBar:$u,setIOSBottomSafeArea:ec,setStatusBar:rc,configAppView:ac,createOrderIAP:lc,minimizeApp:fc,openPermissionSetting:vc,favoriteApp:_c,openGroupList:Tc,requestSendNotification:Sc,addRating:Ic,interactOA:xc,interactOa:xc,isAllowedInteractWithOA:jc,getSetting:Bc,authorize:Fc,checkZaloCameraPermission:Vc,getUserID:Jc,getIDToken:$c,createCameraContext:il,setupAd:al,loadAd:cl,displayAd:pl,refreshAd:ml,showOAWidget:gl,showFunctionButtonWidget:bl,scanNFC:Sl,get FacingMode(){return C},get PhotoFormat(){return N},get PhotoQuality(){return M},get StreamType(){return R},ZMACameraImp:tl,get NetworkType(){return d},get PlatformType(){return p},get JumpStatus(){return h},get ProfileType(){return m},get ChatType(){return v},get PostFeedType(){return y},get ScanNFCType(){return g},get ShareSheetType(){return _},get OrientationType(){return w},get VibrateType(){return b},get MediaPickerType(){return T},get IAPPayType(){return E},get ProrationMode(){return P},get StatusBarType(){return S},get AndroidBottomNavigationBarType(){return A},get IOSSafeAreaBottomType(){return O},get TextAlignType(){return I}});window.ZaloMiniAppSDK=Dl}();
|