@paypay/mini-app-js-sdk 2.46.0 → 2.48.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.
Files changed (33) hide show
  1. package/dist/client/clientUtils.d.ts +1 -1
  2. package/dist/client/communicationWithCore.d.ts +16 -0
  3. package/dist/client/functions/copyToClipboard.d.ts +2 -0
  4. package/dist/client/functions/coreWindowBridgeFunctions.d.ts +12 -0
  5. package/dist/client/functions/getKycPassportInfo.d.ts +3 -0
  6. package/dist/client/functions/logout.d.ts +6 -0
  7. package/dist/client/functions/renderCoupons.d.ts +6 -0
  8. package/dist/client/functions/scanCode.d.ts +2 -0
  9. package/dist/client/functions/setTitle.d.ts +2 -0
  10. package/dist/client/functions/share.d.ts +2 -0
  11. package/dist/client/functions/storageFunctions.d.ts +6 -0
  12. package/dist/client/functions/verifyMultiFactorAuthResult.d.ts +3 -0
  13. package/dist/client/index.d.ts +4 -59
  14. package/dist/client/types.d.ts +37 -2
  15. package/dist/client/{clientFunctions → windowBridgeFunctions}/storageFunctions.d.ts +10 -0
  16. package/dist/client/{clientFunctions → windowBridgeFunctions}/urlFunctions.d.ts +1 -0
  17. package/dist/core/coreFunctions/getLoginUrl.d.ts +1 -1
  18. package/dist/core/coreUtils.d.ts +1 -1
  19. package/dist/mini-app-js-sdk.browser.js +1 -1
  20. package/dist/mini-app-js-sdk.es.js +443 -557
  21. package/dist/model/bridge/getTopBarHeight.d.ts +1 -1
  22. package/dist/package/lottie/lottie.d.ts +6 -6
  23. package/dist/types/init.d.ts +0 -2
  24. package/dist/types/makePayment.d.ts +2 -1
  25. package/dist/utils/getAppDetail.d.ts +1 -0
  26. package/dist/utils/helper.d.ts +5 -2
  27. package/dist/views/coupon/components/Arrow/index.d.ts +5 -5
  28. package/dist/views/coupon/components/CouponAction/index.d.ts +4 -4
  29. package/dist/views/coupon/components/CouponContainer/index.d.ts +3 -3
  30. package/dist/views/coupon/index.d.ts +4 -4
  31. package/package.json +9 -9
  32. package/dist/types/getLoginUrl.d.ts +0 -8
  33. /package/dist/client/{clientFunctions → windowBridgeFunctions}/index.d.ts +0 -0
@@ -13,5 +13,5 @@ export declare function isSupportedSmartpayment(functionName: string): boolean;
13
13
  export declare function isFunctionRunning(): boolean;
14
14
  export declare function functionEnd(messageId: string): void;
15
15
  export declare function functionStart(): string;
16
- export declare function promiseToCallback<S, E extends MiniAppErrorResultType = MiniAppErrorResultType, P extends NativeParams<S, E> = NativeParams<S, E>>(functionName: string, target: (params: P) => Promise<S>, getCore: () => CoreFunctions, getLoggingParams?: (params: P) => Partial<Parameters<CoreFunctions['logEvent']>[0]>): (params: P) => void;
16
+ export declare function promiseToCallback<T, S, E extends MiniAppErrorResultType = MiniAppErrorResultType>(functionName: string, target: (params: T) => Promise<S>, getLoggingParams?: (params: T) => Partial<Parameters<CoreFunctions['logEvent']>[0]>): (params: T & NativeParams<S, E>) => Promise<S>;
17
17
  export declare function callbackToPromise<R, E extends MiniAppErrorResultType = MiniAppErrorResultType, P extends NativeParams<R, E> = NativeParams<R, E>>(target: (params: P) => unknown, functionName: string): (params: P) => Promise<R>;
@@ -0,0 +1,16 @@
1
+ import * as clientWindowBridgeFunctions from '../client/windowBridgeFunctions';
2
+ import { NativeParams } from '../jsbridge-core/jsbridge';
3
+ import { ClientMessageData, PPFunctionNameType, ResultErrorType } from '../types';
4
+ import { WindowBridgeFunctions } from '../utils/windowBridge';
5
+ export declare type ClientFunctions = WindowBridgeFunctions<typeof clientWindowBridgeFunctions>;
6
+ export declare const coreFunctions: WindowBridgeFunctions<{
7
+ claimCoupon: typeof import("../core/coreFunctions/claimCoupon").claimCoupon;
8
+ fetchCoupons: typeof import("../core/coreFunctions/fetchCoupons").fetchCoupons;
9
+ getLoginUrl: typeof import("../core/coreFunctions/getLoginUrl").getLoginUrl;
10
+ getPaymentSettings: typeof import("../core/coreFunctions/getPaymentSettings").getPaymentSettings;
11
+ logEvent: typeof import("../core/coreFunctions/logEvent").logEvent;
12
+ logout: typeof import("../core/coreFunctions/logout").logout;
13
+ markAsReady: typeof import("../core/coreFunctions/markAsReady").markAsReady;
14
+ }>;
15
+ export declare function postMessageToCore(messageData: ClientMessageData): Promise<void>;
16
+ export declare function triggerPostMessageToCore<T>(type: PPFunctionNameType, showIframeFlag: boolean, params: NativeParams<T, ResultErrorType>, postMessageParams: unknown): void;
@@ -0,0 +1,2 @@
1
+ import { CopyToClipBoardParams } from '../../types';
2
+ export declare function copyToClipboard(params: CopyToClipBoardParams): void;
@@ -0,0 +1,12 @@
1
+ export declare const getLoginUrl: (params: {
2
+ redirectUrl?: string | undefined;
3
+ redirectType?: import("../../types").RedirectType | undefined;
4
+ } & import("../../jsbridge-core/jsbridge").NativeParams<{
5
+ url: string;
6
+ loginUrlValidTill: number;
7
+ }, import("../../types").MiniAppErrorResultType>) => Promise<{
8
+ url: string;
9
+ loginUrlValidTill: number;
10
+ }>;
11
+ export declare const getPaymentSettings: (params: import("../../jsbridge-core/jsbridge").NativeParams<import("../../core/coreFunctions/getPaymentSettings").PaymentSettingsType, import("../../types").MiniAppErrorResultType>) => Promise<import("../../core/coreFunctions/getPaymentSettings").PaymentSettingsType>;
12
+ export declare const markAsReady: (params: import("../../jsbridge-core/jsbridge").NativeParams<void, import("../../types").MiniAppErrorResultType>) => Promise<void>;
@@ -0,0 +1,3 @@
1
+ import { NativeParams } from '../../jsbridge-core/jsbridge';
2
+ import { GetKycPassportInfoResult } from '../../types/getKycPassportInfo';
3
+ export declare function getKycPassportInfo(params: NativeParams<GetKycPassportInfoResult>): void;
@@ -0,0 +1,6 @@
1
+ import { MiniAppStatusType } from '../../model/miniAppStatus';
2
+ export declare const logout: (params: import("../../jsbridge-core/jsbridge").NativeParams<{
3
+ statusCode: MiniAppStatusType;
4
+ }, import("../../types").MiniAppErrorResultType>) => Promise<{
5
+ statusCode: MiniAppStatusType;
6
+ }>;
@@ -0,0 +1,6 @@
1
+ import { RenderCouponsParams } from '../../types';
2
+ export interface UpdateCouponIframeHeightMessage {
3
+ eventName: 'update-iframe-height';
4
+ height: number;
5
+ }
6
+ export declare const renderCoupons: (params: RenderCouponsParams & import("../../jsbridge-core/jsbridge").NativeParams<void, import('../../types').MiniAppErrorResultType>) => Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { ScanCodeClientParams } from '../../types';
2
+ export declare function scanCode(params: ScanCodeClientParams): void;
@@ -0,0 +1,2 @@
1
+ import { SetTitleParams } from '../../types';
2
+ export declare function setTitle(params: SetTitleParams): void;
@@ -0,0 +1,2 @@
1
+ import { ShareParams } from '../../types';
2
+ export declare function share(params: ShareParams): void;
@@ -0,0 +1,6 @@
1
+ import { GetDataParams, RemoveDataParams, SetDataParams } from '../../types';
2
+ export declare function getSessionData(params: GetDataParams): void;
3
+ export declare function setSessionData(params: SetDataParams): void;
4
+ export declare function setStorageData(params: SetDataParams): void;
5
+ export declare function getStorageData(params: GetDataParams): void;
6
+ export declare function removeStorageData(params: RemoveDataParams): void;
@@ -0,0 +1,3 @@
1
+ import { NativeParams } from '../../jsbridge-core/jsbridge';
2
+ import { VerifyMultiFactorAuthStatus } from '../../types/verifyMultiFactorAuthResult';
3
+ export declare function verifyMultiFactorAuthResult(params: NativeParams<VerifyMultiFactorAuthStatus>): void;
@@ -1,61 +1,6 @@
1
- import { NativeParams } from '../jsbridge-core/jsbridge';
2
- import { MiniAppModule } from '../mini-app-api';
3
- import { MiniAppStatusType } from '../model/miniAppStatus';
4
- import { CopyToClipBoardParams, GetDataParams, MiniAppErrorResultType, RemoveDataParams, RenderCouponsParams, RenderSmartButtonParams, ScanCodeClientParams, SdkType, SetDataParams, SetTitleParams, ShareParams } from '../types';
5
- import { WindowBridgeFunctions } from '../utils/windowBridge';
6
- import * as clientWindowBridgeFunctions from '../client/clientFunctions';
7
- import { GetKycPassportInfoResult } from '../types/getKycPassportInfo';
8
- import type { GetLoginUrlParams } from '../types/getLoginUrl';
9
- import { InitClientParams } from '../types/init';
10
- import { VerifyMultiFactorAuthStatus } from '../types/verifyMultiFactorAuthResult';
11
- export declare type ClientFunctions = WindowBridgeFunctions<typeof clientWindowBridgeFunctions>;
1
+ import { SdkType } from '../types';
12
2
  export declare function clearInternalInitSyncState(): void;
13
- declare function init(params: InitClientParams): void;
14
- declare function verifyMultiFactorAuthResult(params: NativeParams<VerifyMultiFactorAuthStatus>): void;
15
- declare function getKycPassportInfo(params: NativeParams<GetKycPassportInfoResult>): void;
16
- declare function share(params: ShareParams): void;
17
- declare function setTitle(params: SetTitleParams): void;
18
- declare function render(params: RenderSmartButtonParams): void;
19
- export interface UpdateCouponIframeHeightMessage {
20
- eventName: 'update-iframe-height';
21
- height: number;
22
- }
23
- declare function scanCode(params: ScanCodeClientParams): void;
24
- declare function getSessionData(params: GetDataParams): void;
25
- declare function setSessionData(params: SetDataParams): void;
26
- declare function setStorageData(params: SetDataParams): void;
27
- declare function getStorageData(params: GetDataParams): void;
28
- declare function removeStorageData(params: RemoveDataParams): void;
29
- declare function copyToClipboard(params: CopyToClipBoardParams): void;
30
- declare const clientFunctions: {
31
- init: typeof init;
32
- verifyMultiFactorAuthResult: typeof verifyMultiFactorAuthResult;
33
- share: typeof share;
34
- setTitle: typeof setTitle;
35
- render: typeof render;
36
- renderCoupons: (params: RenderCouponsParams) => void;
37
- scanCode: typeof scanCode;
38
- copyToClipboard: typeof copyToClipboard;
39
- getSessionData: typeof getSessionData;
40
- setSessionData: typeof setSessionData;
41
- getStorageData: typeof getStorageData;
42
- setStorageData: typeof setStorageData;
43
- removeStorageData: typeof removeStorageData;
44
- getKycPassportInfo: typeof getKycPassportInfo;
45
- logout: (params: NativeParams<{
46
- statusCode: MiniAppStatusType;
47
- }, MiniAppErrorResultType>) => void;
48
- getPaymentSettings: (params: NativeParams<import("../core/coreFunctions/getPaymentSettings").PaymentSettingsType, MiniAppErrorResultType>) => void;
49
- getLoginUrl: (params: GetLoginUrlParams) => void;
50
- markAsReady: (params: NativeParams<void, MiniAppErrorResultType>) => void;
51
- };
52
- export declare type SDKFunctionsType = Omit<MiniAppModule, keyof typeof clientFunctions> & typeof clientFunctions;
53
- export declare type ClientSDKType = {
54
- [K in keyof SDKFunctionsType]: (...params: Parameters<SDKFunctionsType[K]>) => Parameters<SDKFunctionsType[K]>[0] extends {
55
- success?: (result: infer R) => void;
56
- } ? Promise<R> : ReturnType<SDKFunctionsType[K]>;
57
- };
58
- export declare function getClient({ sdkType }: {
3
+ export declare function getClient<T extends Record<string, unknown>>({ sdkType, clientFunctions, }: {
59
4
  sdkType: SdkType;
60
- }): ClientSDKType;
61
- export {};
5
+ clientFunctions: T;
6
+ }): T;
@@ -1,5 +1,40 @@
1
1
  import { miniAppSupportedFunctions } from '../client/supportedFunctionsList';
2
- declare const client: import('../client/index').ClientSDKType;
3
- export declare type MiniAppSdkType = Pick<typeof client, (typeof miniAppSupportedFunctions)[number]>;
2
+ import { copyToClipboard } from './functions/copyToClipboard';
3
+ import { getKycPassportInfo } from './functions/getKycPassportInfo';
4
+ import { scanCode } from './functions/scanCode';
5
+ import { setTitle } from './functions/setTitle';
6
+ import { share } from './functions/share';
7
+ import { getSessionData, getStorageData, removeStorageData, setSessionData, setStorageData } from './functions/storageFunctions';
8
+ import { verifyMultiFactorAuthResult } from './functions/verifyMultiFactorAuthResult';
9
+ import { MiniAppModule } from '../mini-app-api';
10
+ declare const clientFunctions: {
11
+ verifyMultiFactorAuthResult: typeof verifyMultiFactorAuthResult;
12
+ share: typeof share;
13
+ setTitle: typeof setTitle;
14
+ renderCoupons: (params: import('../types').RenderCouponsParams & import("../jsbridge-core/jsbridge").NativeParams<void, import('../types').MiniAppErrorResultType>) => Promise<void>;
15
+ scanCode: typeof scanCode;
16
+ copyToClipboard: typeof copyToClipboard;
17
+ getSessionData: typeof getSessionData;
18
+ setSessionData: typeof setSessionData;
19
+ getStorageData: typeof getStorageData;
20
+ setStorageData: typeof setStorageData;
21
+ removeStorageData: typeof removeStorageData;
22
+ getKycPassportInfo: typeof getKycPassportInfo;
23
+ logout: (params: import("../jsbridge-core/jsbridge").NativeParams<{
24
+ statusCode: import("../model/miniAppStatus").MiniAppStatusType;
25
+ }, import('../types').MiniAppErrorResultType>) => Promise<{
26
+ statusCode: import("../model/miniAppStatus").MiniAppStatusType;
27
+ }>;
28
+ getPaymentSettings: (params: import("../jsbridge-core/jsbridge").NativeParams<import("../core/coreFunctions/getPaymentSettings").PaymentSettingsType, import('../types').MiniAppErrorResultType>) => Promise<import("../core/coreFunctions/getPaymentSettings").PaymentSettingsType>;
29
+ markAsReady: (params: import("../jsbridge-core/jsbridge").NativeParams<void, import('../types').MiniAppErrorResultType>) => Promise<void>;
30
+ };
31
+ declare type ClientFunctionsType = typeof clientFunctions;
32
+ declare type AllSdkFunctionsType = Omit<MiniAppModule, keyof ClientFunctionsType> & ClientFunctionsType;
33
+ declare type MAFunctionsType = Pick<AllSdkFunctionsType, (typeof miniAppSupportedFunctions)[number]>;
34
+ export declare type MiniAppSdkType = {
35
+ [K in keyof MAFunctionsType]: (...params: Parameters<MAFunctionsType[K]>) => Parameters<MAFunctionsType[K]>[0] extends {
36
+ success?: (result: infer R) => void;
37
+ } ? Promise<R> : ReturnType<MAFunctionsType[K]>;
38
+ };
4
39
  declare const miniAppSdk: MiniAppSdkType;
5
40
  export default miniAppSdk;
@@ -19,4 +19,14 @@ export declare function getLocalStorage({ name }: {
19
19
  export declare function removeLocalStorage({ name }: {
20
20
  name: string;
21
21
  }): void;
22
+ export declare function setSessionStorage({ name, value, }: {
23
+ name: string;
24
+ value: string;
25
+ }): void;
26
+ export declare function getSessionStorage({ name }: {
27
+ name: string;
28
+ }): string | null;
29
+ export declare function removeSessionStorage({ name }: {
30
+ name: string;
31
+ }): void;
22
32
  export {};
@@ -1 +1,2 @@
1
1
  export declare function removeQueryParametersFromUrl(removeParams: string[]): void;
2
+ export declare function getUrl(): string;
@@ -11,7 +11,7 @@ interface GetLoginUrlInternalParams extends PostLogInRedirectParams {
11
11
  }
12
12
  export declare const getLoginUrlEndpoint = "public/auth/v1/loginUrl";
13
13
  export declare function getLoginUrl(params: {
14
- redirectUrl: string;
14
+ redirectUrl?: string;
15
15
  redirectType?: RedirectType;
16
16
  }): Promise<{
17
17
  url: string;
@@ -2,7 +2,7 @@ import { NativeParams } from '../jsbridge-core/jsbridge';
2
2
  import { ConsoleDebugInfoParams } from '../types';
3
3
  import { ChallengeMethod } from '../types/getAuthStatus';
4
4
  export declare const OTT_QUERY_PARAMETERS: string[];
5
- export declare function getClientFunctions(): import('../utils/windowBridge').WindowBridgeFunctions<typeof import("../client/clientFunctions")>;
5
+ export declare function getClientFunctions(): import('../utils/windowBridge').WindowBridgeFunctions<typeof import("../client/windowBridgeFunctions")>;
6
6
  export declare function linkOpen(url: string, target?: string, isFocus?: boolean): void;
7
7
  export declare function getDomain(subdomainCookieSharing: boolean, hostname: string): string;
8
8
  export declare function sendRefreshTokenToClient(refreshToken: string, subdomainCookieSharing: boolean): void;
@@ -1,2 +1,2 @@
1
1
  !function(){"use strict";try{if("undefined"!=typeof document){var p=document.createElement("style");p.appendChild(document.createTextNode(".ppmna-reset-css{all:initial}.ppmna-reset-css *{text-align:unset;color:unset;background:initial;background-color:transparent;margin:revert;padding:revert;font-weight:revert;font-style:unset;font-size:unset;-webkit-user-select:none;user-select:none;border:unset;border-radius:revert;vertical-align:unset;word-break:unset;outline:none;box-sizing:content-box}.ppmna-reset-css * img{display:inline-block}.ppmna-reset-css * input,.ppmna-reset-css * select{-webkit-user-select:auto;user-select:auto}.ppmna-reset-css * li{list-style:none}.ppmna-reset-css * :where(*:not(svg,svg *)){all:revert}.pp-smartButtonWrapper .pp-smartBtn{display:flex;align-items:center;border-radius:8px;border:none;font-size:14px;font-weight:600;line-height:22px;color:#fff;padding:0;width:100%;height:44px;margin:auto;-webkit-tap-highlight-color:transparent;text-decoration:none;box-sizing:border-box}.pp-smartButtonWrapper .pp-smartBtn.pp-sm .pp-leftSection .pp-btnContent{flex-direction:column}.pp-smartButtonWrapper .pp-smartBtn.pp-light{background:#fff;color:#242323}.pp-smartButtonWrapper .pp-smartBtn.pp-dark{background:#000}.pp-smartButtonWrapper .pp-smartBtn.pp-red{background:#f03}.pp-smartButtonWrapper .pp-smartBtn.pp-login{min-width:180px}.pp-smartButtonWrapper .pp-smartBtn.pp-login.pp-sm{width:180px!important}.pp-smartButtonWrapper .pp-smartBtn.pp-login.pp-light{border:1px solid #e4e4e8}.pp-smartButtonWrapper .pp-smartBtn.pp-login.pp-light .pp-userProfile{margin-right:4px}.pp-smartButtonWrapper .pp-smartBtn.pp-login .pp-leftSection .pp-btnContent{display:grid}.pp-smartButtonWrapper .pp-smartBtn.pp-pay{min-width:160px}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-light{border:1px solid #dddddd}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-light .pp-cashbackInfo{color:#ff954c;background:#fff0e5}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-red .pp-cashbackInfo{color:#f03}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-ja .pp-cashbackInfo{padding:2px 16px}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-sm{width:160px!important}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-sm.pp-cashback{height:66px;flex-direction:column;justify-content:center}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-sm .pp-cashbackInfo{margin:8px 0 0}.pp-smartButtonWrapper .pp-smartBtn.pp-pay .pp-leftSection .pp-img{width:24px;height:24px}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-shortText{font-size:16px}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-sm .pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-cashback .pp-leftSection .pp-btnContent,.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-shortText .pp-leftSection .pp-btnContent{margin-left:4px}.pp-smartButtonWrapper .pp-smartBtn .pp-leftSection{display:flex;justify-content:center;align-items:center;width:100%;box-sizing:border-box;padding:0 8px}.pp-smartButtonWrapper .pp-smartBtn .pp-leftSection .pp-img{width:20px;height:20px;display:inline-block}.pp-smartButtonWrapper .pp-smartBtn .pp-leftSection .pp-btnContent{margin-left:8px}.pp-smartButtonWrapper .pp-smartBtn .pp-leftSection .pp-btnContent .pp-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-smartButtonWrapper .pp-smartBtn .pp-cashbackInfo{font-size:12px;color:#242323;background:#fff;line-height:14px;padding:2px 8px;border-radius:9px;margin-left:8px}.pp-smartButtonWrapper .pp-smartBtn .pp-userProfile{width:34px;height:34px;border-radius:50%;margin-right:5px}.pp-smartButtonWrapper.pp-button{padding:0;margin:0;background:none;border:none;width:100%;border-radius:8px;-webkit-tap-highlight-color:transparent;font-family:revert!important}.pp-smartButtonWrapper.pp-button *{font-family:revert!important}")),document.head.appendChild(p)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
2
- var pp=function(){"use strict";var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,r=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,a=(e,t)=>{for(var n in t||(t={}))s.call(t,n)&&r(e,n,t[n]);if(o)for(var n of o(t))i.call(t,n)&&r(e,n,t[n]);return e},c=(e,o)=>t(e,n(o)),l=(e,t,n)=>new Promise(((o,s)=>{var i=e=>{try{a(n.next(e))}catch(t){s(t)}},r=e=>{try{a(n.throw(e))}catch(t){s(t)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,r);a((n=n.apply(e,t)).next())}));function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var u=function e(t,n){function o(e,o,s){if("undefined"!=typeof document){"number"==typeof(s=d({},n,s)).expires&&(s.expires=new Date(Date.now()+864e5*s.expires)),s.expires&&(s.expires=s.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var r in s)s[r]&&(i+="; "+r,!0!==s[r]&&(i+="="+s[r].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+i}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],o={},s=0;s<n.length;s++){var i=n[s].split("="),r=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(o[a]=t.read(r,a),e===a)break}catch(c){}}return e?o[e]:o}},remove:function(e,t){o(e,"",d({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,d({},this.attributes,t))},withConverter:function(t){return e(d({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),p=(e=>(e.accessToken="ppjssdk.accessToken",e.refreshToken="ppjssdk.refreshToken",e.env="ppjssdk.env",e.deviceUUID="ppjssdk.deviceUUID",e.clientUUID="ppjssdk.clientUUID",e.lastPayment="ppjssdk.lastPayment",e.lastTopup="ppjssdk.lastTopup",e.appDetail="ppjssdk.appDetail",e.appConfig="ppjssdk.appConfig",e.userInfo="ppjssdk.userInfo",e.lastPaymentMethod="ppjssdk.lastPaymentMethod",e.lastTopupPayMethod="ppjssdk.lastTopupPayMethod",e.codeVerifier="ppjssdk.codeVerifier",e.clientOrigin="ppjssdk.clientOrigin",e.clientVersion="ppjssdk.clientVersion",e.debugMode="ppjssdk.debugMode",e.claimCouponImmediately="ppjssdk.claimCouponImmediately",e.merchant="ppjssdk.merchant",e.consumedOTT="ppjssdk.consumedOTT",e.initializedAt="ppjssdk.initializedAt",e))(p||{});const h="success",g="fail",m="complete",_="init",f="render",v="makePayment",E="verifyMultiFactorAuthResult",S="share",y="scanCode",I="handleMessageFromNative",w="getKycPassportInfo",A="reload",T="link",N="makeVisible",b="consoleDebugInfo",C="clientPopState";var O=(e=>(e.MiniApp="MiniApp",e.SmartPayment="SmartPayment",e))(O||{});const P="_PayPayJsBridge",L=["init","openWebview","openMap","closeApp","makePayment","topup","setSessionData","getSessionData","setStorageData","getStorageData","removeStorageData","getPermissionStatus","scanCode","showAlert","showErrorSheet","getTopBarHeight","setTitle","showUpdateWarning","getPlatformInformation","openApp","share","getKycInformation","getUserLocation","checkPaymentMethod","registerKyc","startMultiFactorAuth","verifyMultiFactorAuthResult","getBankInfo","logout","getUserProfile","getBalance","getUserAddress","getUAID","copyToClipboard","registerUserInfo","setEnablePullDownRefresh","registerEmail","checkAccessToken","debug","inputAddress","getDeviceInformation","openMiniApp","request","requestInternal","registerPaymentFeatures","initKycPassport","getKycPassportInfo","shortcutExists","addShortcut","getAllUserAddresses","getUserPaymentFeatureSettings","getPaymentSettings","getTransactionInfo","getTransactions","getPayPayCardInfo","getExternalLinkageInformation","markAsReady","renderCoupons"],k=["init","createOrder","makePayment","render","logout","getAuthStatus","getUserProfile","getBalance","getUserAddress","getUAID","getCashbackInformation","renderCoupons","getLoginUrl"];function D(e){return"https://image.paypay.ne.jp/miniapps/mini-app-sdk/"+e}const R=D("icon-paypay-rec.svg"),U=D("icon-paypay-rec-white.svg");class x extends Error{constructor(e,t){super(e),this.errorCode=t}}var M=(e=>(e.success="SUCCESS",e.invalidUrl="INVALID_URL",e.invalidData="INVALID_DATA",e.invalidHeader="INVALID_HEADER",e.invalidMethod="INVALID_METHOD",e.invalidPath="INVALID_PATH",e.notReachable="NOT_REACHABLE",e.notAvailable="NOT_AVAILABLE",e.timeOut="TIME_OUT",e.whiteListError="NONE_WHITELIST_DOMAIN",e.statusCodeError="STATUS_CODE_ERROR",e.invalidResponse="INVALID_RESPONSE",e.noLocationPermission="NO_USER_LOCATION_PERMISSION",e.noPermissionListAvailable="NO_PERMISSION_LIST_AVAILABLE",e.other="other",e.serverError="SERVER_ERROR",e.noCameraPermission="HOST_APP_CAMERA_DENIED",e.noAlbumPermission="HOST_APP_ALBUM_DENIED",e.insufficientScope="INSUFFICIENT_SCOPE",e.userCanceled="USER_CANCELED",e.invalidJSAPIParams="INVALID_JS_API_PARAMS",e.hostAppLocationDenied="HOST_APP_LOCATION_DENIED",e.hostAppContactsDenied="HOST_APP_READING_CONTACT_DENIED",e.badRequestInsufficientParameter="BAD_REQUEST_INSUFFICIENT_PARAMETER",e.badRequest="BAD_REQUEST",e.paymentFail="PAYMENT_FAIL",e.topupFail="TOPUP_FAIL",e.topupSuccessButNotAddToBalance="TOPUP_SUCCESS_BUT_NOT_ADD_TO_BALANCE",e.userCanceledSimilarTxn="USER_CANCELED_SIMILAR_TRANSACTION",e.mapAppNotFound="MAP_APP_NOT_FOUND",e.invalidAppSchemeURL="INVALID_APP_SCHEME_URL",e.noValueFound="NO_VALUE_FOUND",e.securityNotSetup="SECURITY_NOT_SETUP",e.userDenied="USER_DENIED",e.securityTemporaryLocked="SECURITY_TEMPORARY_LOCKED",e.couldNotGenerateBarcode="COULD_NOT_GENERATE_BARCODE",e.cannotDetectAvailability="CAN_NOT_DETECT_AVAILABILITY",e.suspectedDuplicatePayment="SUSPECTED_DUPLICATE_PAYMENT",e.noSufficientFund="NO_SUFFICIENT_FUND",e.unknown="UNKNOWN",e.sdkNotInitialized="SDK_NOT_INITIALIZED",e.tokenNotFound="TOKEN_NOT_FOUND",e.tokenExpired="TOKEN_EXPIRED",e.activeRequestExists="ACTIVE_REQUEST_EXISTS",e.invalidType="INVALID_TYPE",e.sessionNotFound="SESSION_NOT_FOUND",e.cookieError="COOKIE_ERROR",e.notAuthorized="NOT_AUTHORIZED",e.permissionRequired="PERMISSION_REQUIRED",e.deeplinkUnavailable="DEEPLINK_UNAVAILABLE",e.kycIncompleted="KYC_INCOMPLETED",e.noBankAccount="NO_BANK_ACCOUNT",e.invalidPaymentIdentifier="INVALID_PAYMENT_IDENTIFIER",e.otpSendTooShort="OTP_SEND_TOO_SHORT",e.otpSendOverLimit="OTP_SEND_OVER_LIMIT",e.userVerificationFailure="USER_VERIFICATION_FAILURE",e.unacceptableOp="UNACCEPTABLE_OP",e.kycUpdateRequired="KYC_UPDATE_REQUIRED",e.notCompleted="NOT_COMPLETED",e.kycValidationInProcess="KYC_VALIDATION_IN_PROCESS",e.noLocationData="NO_LOCATION_DATA",e.functionNotFound="FUNCTION_NOT_FOUND",e.originNotAllowed="ORIGIN_NOT_ALLOWED",e.messageSendingFailed="MESSAGE_SENDING_FAILED",e.transactionNotFound="TRANSACTION_NOT_FOUND",e.unexpectedOperation="UNEXPECTED_OP",e.merchantTimeout="MERCHANT_TIMEOUT",e.rateLimitExceeded="RATE_LIMIT_EXCEEDED",e.sdkUpgradeRequired="SDK_UPGRADE_REQUIRED",e.authorizationNeeded="AUTHORIZATION_NEEDED",e))(M||{});const F="2.46.0",B=new URL("https://mini-app-sdk-core.paypay.ne.jp/"),j=B.origin,V=new URL(`./iframe.html?v=${F}&rev=bd28c67`,B).href,$=new URL(`./coupon/iframe.html?v=${F}`,B).href,q="8.45.1",W=globalThis;function H(e,t,n){const o=W,s=o.__SENTRY__=o.__SENTRY__||{},i=s[q]=s[q]||{};return i[e]||(i[e]=t())}const z="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,K=["debug","info","warn","error","log","assert","trace"],Y={};function G(e){if(!("console"in W))return e();const t=W.console,n={},o=Object.keys(Y);o.forEach((e=>{const o=Y[e];n[e]=t[e],t[e]=o}));try{return e()}finally{o.forEach((e=>{t[e]=n[e]}))}}const J=H("logger",(function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return z?K.forEach((n=>{t[n]=(...t)=>{e&&G((()=>{W.console[n](`Sentry Logger [${n}]:`,...t)}))}})):K.forEach((e=>{t[e]=()=>{}})),t}));function Q(){return X(W),W}function X(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||q,t[q]=t[q]||{}}const Z=Object.prototype.toString;function ee(e){return function(e,t){return Z.call(e)===`[object ${t}]`}(e,"Object")}function te(){return Date.now()/1e3}const ne=function(){const{performance:e}=W;if(!e||!e.now)return te;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}();function oe(){const e=W,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch(o){}return"10000000100040008000100000000000".replace(/[018]/g,(e=>(e^(15&n())>>e/4).toString(16)))}function se(){return oe()}function ie(){return oe().substring(16)}function re(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&t&&0===Object.keys(t).length)return e;const o=a({},e);for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(o[s]=re(o[s],t[s],n-1));return o}(()=>{const{performance:e}=W;if(!e||!e.now)return;const t=36e5,n=e.now(),o=Date.now(),s=e.timeOrigin?Math.abs(e.timeOrigin+n-o):t,i=s<t,r=e.timing&&e.timing.navigationStart,a="number"==typeof r?Math.abs(r+n-o):t;(i||a<t)&&(s<=a&&e.timeOrigin)})();const ae="_sentrySpan";function ce(e,t){t?function(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(o){z&&J.log(`Failed to add non-enumerable property "${t}" to object`,e)}}(e,ae,t):delete e[ae]}function le(e){return e[ae]}class de{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:se(),spanId:ie()}}clone(){const e=new de;return e._breadcrumbs=[...this._breadcrumbs],e._tags=a({},this._tags),e._extra=a({},this._extra),e._contexts=a({},this._contexts),this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata=a({},this._sdkProcessingMetadata),e._propagationContext=a({},this._propagationContext),e._client=this._client,e._lastEventId=this._lastEventId,ce(e,le(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&function(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||ne(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:oe()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags=a(a({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,t){return this._tags=c(a({},this._tags),{[e]:t}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=a(a({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,t){return this._extra=c(a({},this._extra),{[e]:t}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,[n,o]=t instanceof ue?[t.getScopeData(),t.getRequestSession()]:ee(t)?[e,e.requestSession]:[],{tags:s,extra:i,user:r,contexts:c,level:l,fingerprint:d=[],propagationContext:u}=n||{};return this._tags=a(a({},this._tags),s),this._extra=a(a({},this._extra),i),this._contexts=a(a({},this._contexts),c),r&&Object.keys(r).length&&(this._user=r),l&&(this._level=l),d.length&&(this._fingerprint=d),u&&(this._propagationContext=u),o&&(this._requestSession=o),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,ce(this,void 0),this._attachments=[],this.setPropagationContext({traceId:se()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const o=a({timestamp:te()},e),s=this._breadcrumbs;return s.push(o),this._breadcrumbs=s.length>n?s.slice(-n):s,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:le(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=re(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=a({spanId:ie()},e),this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:oe();if(!this._client)return J.warn("No client configured on scope - will not capture exception!"),n;const o=new Error("Sentry syntheticException");return this._client.captureException(e,c(a({originalException:e,syntheticException:o},t),{event_id:n}),this),n}captureMessage(e,t,n){const o=n&&n.event_id?n.event_id:oe();if(!this._client)return J.warn("No client configured on scope - will not capture message!"),o;const s=new Error(e);return this._client.captureMessage(e,t,c(a({originalException:e,syntheticException:s},n),{event_id:o}),this),o}captureEvent(e,t){const n=t&&t.event_id?t.event_id:oe();return this._client?(this._client.captureEvent(e,c(a({},t),{event_id:n}),this),n):(J.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}const ue=de;class pe{constructor(e,t){let n,o;n=e||new ue,o=t||new ue,this._stack=[{scope:n}],this._isolationScope=o}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(s){throw this._popScope(),s}return o=n,Boolean(o&&o.then&&"function"==typeof o.then)?n.then((e=>(this._popScope(),e)),(e=>{throw this._popScope(),e})):(this._popScope(),n);var o}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function he(){const e=X(Q());return e.stack=e.stack||new pe(H("defaultCurrentScope",(()=>new ue)),H("defaultIsolationScope",(()=>new ue)))}function ge(e){return he().withScope(e)}function me(e,t){const n=he();return n.withScope((()=>(n.getStackTop().scope=e,t(e))))}function _e(e){return he().withScope((()=>e(he().getIsolationScope())))}function fe(e){const t=X(e);return t.acs?t.acs:{withIsolationScope:_e,withScope:ge,withSetScope:me,withSetIsolationScope:(e,t)=>_e(t),getCurrentScope:()=>he().getScope(),getIsolationScope:()=>he().getIsolationScope()}}function ve(){return fe(Q()).getCurrentScope()}const Ee=100;function Se(e,t){const n=ve().getClient(),o=fe(Q()).getIsolationScope();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=Ee}=n.getOptions();if(i<=0)return;const r=te(),c=a({timestamp:r},e),l=s?G((()=>s(c,t))):c;null!==l&&(n.emit&&n.emit("beforeAddBreadcrumb",l,t),o.addBreadcrumb(l,i))}const ye=[M.sdkNotInitialized,M.notAuthorized,M.userCanceled,M.userCanceledSimilarTxn,M.suspectedDuplicatePayment,M.noSufficientFund];function Ie(e,t,n){ye.includes(n)||function(e,t){const n=t;ve().captureMessage(e,n,void 0)}(`windowBridge.${e} failed. error: ${n}, message: ${t}`,"log")}const we=e=>"object"!=typeof e||null===e?e:JSON.parse(JSON.stringify(e));class Ae{constructor(e,t,n=[]){this.deferredCallbacks={},this.functions=e,this.allowedOrigins=t,this.middlewares=n,this.messageEventHandler=this.messageEventHandler.bind(this),this.subscribeToMessageEvent()}subscribeToMessageEvent(){window.addEventListener("message",this.messageEventHandler)}unsubscribeToMessageEvent(){window.removeEventListener("message",this.messageEventHandler)}messageEventHandler(e){var t;if(null==(t=e.data)?void 0:t.forWindowBridge)return this.allowedOrigins&&"request"===e.data.type&&!this.allowedOrigins.includes(e.origin)?this.sendErrorResponse(e,`${e.origin} is not allowed to make requests`,M.originNotAllowed):void("request"===e.data.type?this.handleRequest(e):"response"===e.data.type&&this.handleResponse(e))}handleRequest(e){return l(this,null,(function*(){var t;const n=e.data.functionName,o=this.functions[n];o||this.sendErrorResponse(e,`Function '${n}' does not exists on the target window`,M.functionNotFound);try{this.sendSuccessResponse(e,yield function(e,t,n,o){let s=-1;const i=o=>l(this,null,(function*(){if(++s,s<e.length){const n=e[s];return yield n(t,o,i)}return n(...o)}));return i(o)}([...this.middlewares,...null!=(t=o.middlewares)?t:[]],e,o,we(e.data.params)))}catch(s){let t="Some error occurred while processing the request",n=M.unknown;s instanceof x?(t=s.message,n=s.errorCode):console.error(s),this.sendErrorResponse(e,t,n)}}))}handleResponse(e){if(!this.deferredCallbacks[e.data.key])return void console.warn(`Callback for ${e.data.functionName} not found`);const[t,n]=this.deferredCallbacks[e.data.key];delete this.deferredCallbacks[e.data.key],"success"===e.data.status?t(e.data.result):n(new x(e.data.message,e.data.errorCode))}sendErrorResponse(e,t,n){Ie(e.data.functionName,t,n),this.sendResponse(e,{status:"failure",message:t,errorCode:n})}sendSuccessResponse(e,t){this.sendResponse(e,{status:"success",result:t})}sendResponse(e,t){var n;null==(n=e.source)||n.postMessage(a({forWindowBridge:!0,type:"response",key:e.data.key,functionName:e.data.functionName},we(t)),e.origin)}static init(e,t,n=[]){if(this._instance)throw new Error("WindowBridge already initialized, you can't call WindowBridge.init more than once");return this._instance=new this(e,t,n),this._instance}static destroy(){this._instance&&(this._instance.unsubscribeToMessageEvent(),this._instance=void 0)}static getBridge(){if(!this._instance)throw new Error("WindowBridge not initialized, please call WindowBridge.init before calling WindowBridge.getBridge");return this._instance}static getTargetWindowFunctionProxy(e,t){return Ae.getBridge().getTargetWindowFunctionProxy(e,t)}getTargetWindowFunctionProxy(e,t){return new Proxy(this,{get(n,o){return(...s)=>new Promise(((i,r)=>l(this,null,(function*(){const a=o.toString(),c=`${a}--${Te()}`;try{const o=yield e();if(!o)throw new Error("Target window is undefined");n.deferredCallbacks[c]=[i,r],o.postMessage({forWindowBridge:!0,type:"request",functionName:a,key:c,params:we(s)},t)}catch(l){delete n.deferredCallbacks[c],r(new x(l.message,M.messageSendingFailed))}}))))}})}}function Te(){return Math.random().toString(36).substring(7)}function Ne(e){return e===j}function be(e){return e?String(e):""}function Ce(e){return L.includes(e)}function Oe(e){return k.includes(e)}new class{constructor(){var e;this.useLocalStorage=!0,this.memoryStorage={};try{localStorage.setItem(p.initializedAt,Date.now().toString());for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);null!=n&&(this.memoryStorage[n]=null!=(e=localStorage.getItem(n))?e:"")}}catch(t){this.useLocalStorage=!1}}getItem(e){var t;if(this.useLocalStorage)try{if(null!=localStorage.getItem(p.initializedAt))return localStorage.getItem(e);console.debug("local storage value has lost unexpectedly."),Se({message:"local storage value has lost unexpectedly.",category:"storage"})}catch(n){}return this.useLocalStorage=!1,null!=(t=this.memoryStorage[e])?t:null}setItem(e,t){if(this.memoryStorage[e]=t,this.useLocalStorage)try{localStorage.setItem(e,t)}catch(n){this.useLocalStorage=!1,console.warn("localStorage has become unavailable.")}}removeItem(e){delete this.memoryStorage[e];try{localStorage.removeItem(e)}catch(t){this.useLocalStorage=!1}}clear(){try{localStorage.clear(),localStorage.setItem(p.initializedAt,Date.now().toString())}catch(e){}this.memoryStorage={}}};let Pe=[];function Le(e){Pe=Pe.filter((t=>t!==e))}function ke(){const e=Te();return Pe.push(e),e}function De(e,t,n,o){return function(s={}){const i=n(),r=null==o?void 0:o(s);i.logEvent(a({event_action:`pp_${e}_called`,event_category_suffix:e},r)),t(s).then((t=>{var n;i.logEvent(a({event_action:`pp_${e}_success`,event_category_suffix:e},r)),null==(n=s.success)||n.call(s,t)})).catch((t=>{var n;console.error(t.message),i.logEvent(a({event_action:`pp_${e}_fail`,event_category_suffix:e,error_value:t.errorCode},r)),null==(n=s.fail)||n.call(s,{errorCode:t.errorCode})})).finally((()=>{var e;null==(e=s.complete)||e.call(s)}))}}const Re={[M.sdkNotInitialized]:M.authorizationNeeded,[M.tokenNotFound]:M.authorizationNeeded,[M.tokenExpired]:M.tokenExpired};var Ue=(e=>(e.validToken="TOKEN_VALID",e.initialized="INITIALIZED",e.emailRegistered="EMAIL_REGISTERED",e.emailNotVerified="EMAIL_NOT_VERIFIED",e.success="SUCCESS",e.loggedOut="LOGGED_OUT",e.connected="CONNECTED",e))(Ue||{});const xe=Object.freeze(Object.defineProperty({__proto__:null,getCookie:function({name:e}){return u.get(e)},getLocalStorage:function({name:e}){return localStorage.getItem(e)},removeCookie:function({name:e,options:t}){return u.remove(e,t)},removeLocalStorage:function({name:e}){return localStorage.removeItem(e)},removeQueryParametersFromUrl:function(e){const t=new URL(window.location.href);e.forEach((e=>t.searchParams.delete(e)));const n=`${t.pathname}${t.search}`;history.replaceState(null,"",n)},setCookie:function({name:e,value:t,options:n}){return u.set(e,t,n)},setLocalStorage:function({name:e,value:t}){return localStorage.setItem(e,t)}},Symbol.toStringTag,{value:"Module"})),Me="ppmna-iframe",Fe="ppsdk-container";let Be,je;function Ve(){return Be||(Be=function(){if(document.getElementById(Me))return;const e=document.createElement("div");return document.createElement("div"),e.setAttribute("id",Fe),e.setAttribute("class",Fe),e.style.all="initial",e.style.display="none",e.style.position="fixed",e.style.width="100%",e.style.height="100%",e.style.top="0",e.style.left="0",e.style.zIndex="2147483637",document.body.appendChild(e),e}()),Be}function $e(e){const t=Ve();t&&(t.style.display=e?"initial":"none")}function qe(){return je||(je=new Promise(((e,t)=>{function n(){const n=document.createElement("iframe");n.setAttribute("src",V),n.setAttribute("name",Me),n.setAttribute("id",Me),n.setAttribute("class",Me),n.setAttribute("allow","geolocation"),n.onload=()=>{e(n)},n.onerror=t,n.style.all="initial",n.style.width="100%",n.style.height="100%",n.style.border="none";const o=Ve();o&&(o.innerHTML="",o.append(n))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{n()})):n()}))),je}let We,He,ze=!1;Ae.init(xe,[j]),qe(),He=Promise.resolve(!1);const Ke=Ae.getTargetWindowFunctionProxy((function(){return qe().then((e=>null==e?void 0:e.contentWindow)).catch((()=>null))}),j);function Ye(){return Ke}function Ge(e){const t=(n=e.clientId,u.get(`${p.refreshToken}.${n}`)||u.get(p.refreshToken)||"");var n;const o=function(e){return u.get(`${p.codeVerifier}.${e}`)||u.get(p.codeVerifier)||""}(e.clientId);ze=!!e.useAllFunctions;const s={env:e.env,mode:e.mode,debugMode:e.debugMode,clientId:e.clientId,refreshToken:t,clientVersion:"2.46.0",codeVerifier:o,clientSdkType:We,clientUrl:window.location.href};let i;const r=new Promise((e=>i=e)),l=()=>{var t;i(!0),null==(t=e.complete)||t.call(e)};He.then((()=>qe())).then((()=>{nt(_,!1,c(a({},e),{complete:l}),s)})).catch((()=>{var t;null==(t=e.fail)||t.call(e,{errorCode:M.sdkNotInitialized}),l()})),He=r}addEventListener("message",(e=>{var t;if(!(null==(t=e.data)?void 0:t.forWindowBridge)&&Ne(e.origin))if(e.data.name===A&&window.location.reload(),e.data.name!==N){if(e.data.name===T){const t=e.data.data;"_blank"===t.target?window.open(t.url,"_blank"):window.location.href=t.url}if(e.data.name===b){const{params:t}=e.data.data;!function(e){console.debug(...e)}(t)}}else $e(!0)})),addEventListener("popstate",(()=>{qe().then((e=>{var t;const n={name:C};null==(t=null==e?void 0:e.contentWindow)||t.postMessage(n,j)})).catch((e=>console.warn(e)))}));const Je=De("renderCoupons",(e=>l(this,null,(function*(){const{merchant:t,couponId:n,containerId:o,postLoginRedirectUrl:s=window.location.href,postLoginRedirectType:i,locale:r}=e,a=document.getElementById(o);if(!a)throw new x("Invalid coupon container Id",M.badRequestInsufficientParameter);const c=yield Ke.fetchCoupons({merchantId:t,couponId:n,postLoginRedirectUrl:s,postLoginRedirectType:i});try{const e=document.createElement("iframe");e.src=$,e.style.cssText="width:100%;height: 0;border: none;transition: height 300ms ease-in;display: block;",yield new Promise(((t,n)=>{e.onload=()=>t(!0),e.onerror=()=>n(new Error("Failed to load coupon iframe")),a.innerHTML="",a.append(e)})),e.onload=null,e.onerror=null,window.addEventListener("message",(({data:t,source:n})=>{"update-iframe-height"===(null==t?void 0:t.eventName)&&e.contentWindow===n&&(e.style.height=`${t.height}px`)}));const n=Ae.getTargetWindowFunctionProxy((()=>e.contentWindow),j);yield n.renderCoupons({coupons:c,merchantId:t,locale:r,postLoginRedirectUrl:s,postLoginRedirectType:i})}catch(l){throw new x(`An error ocurred while displaying coupons, merchantId=${t}, couponId=${n}, error=${l}`,M.unknown)}}))),Ye,(e=>({event_label2:e.couponId,merchant_id:e.merchant})));const Qe=De("logout",(()=>l(this,null,(function*(){try{return yield Ke.logout(),{statusCode:Ue.loggedOut}}catch(e){throw new x(`An error ocurred while trying to logout the user, error=${e}`,M.unknown)}}))),Ye),Xe=De("getPaymentSettings",Ke.getPaymentSettings,Ye),Ze=De("getLoginUrl",(e=>Ke.getLoginUrl({redirectUrl:e.redirectUrl||location.href,redirectType:e.redirectType})),Ye);function et(e,t,n){var o,s,i;e.result===g&&(null==(o=null==t?void 0:t.fail)||o.call(t,e.data)),e.result===h&&(null==(s=null==t?void 0:t.success)||s.call(t,null==e?void 0:e.data)),e.result===m&&(null==(i=null==t?void 0:t.complete)||i.call(t),removeEventListener("message",n),Le(e.messageId),Pe.length>0||$e(!1))}function tt(e){return l(this,null,(function*(){var t;const n=yield qe().catch((()=>{}));null==(t=null==n?void 0:n.contentWindow)||t.postMessage(JSON.parse(JSON.stringify(e)),j)}))}function nt(e,t,n,o){const s=ke();t&&$e(!0);const i=t=>{Ne(t.origin)&&t.data.name===e&&t.data.messageId===s&&et(t.data,n,i)};addEventListener("message",i),tt({name:e,params:o,messageId:s})}const ot=De("markAsReady",(()=>l(this,null,(function*(){yield Ke.markAsReady()}))),Ye);var st;st={_handleMessageFromNative:e=>{qe().then((t=>{var n;null==(n=null==t?void 0:t.contentWindow)||n.postMessage(JSON.parse(JSON.stringify({name:I,params:{json:e}})),j)}))}},(!window.hasOwnProperty(P)||window[P]!==st)&&(window[P]=st);const it={init:Ge,verifyMultiFactorAuthResult:function(e){const t=new URL(window.location.href);nt(E,!1,e,c(a({},e),{sessionId:t.searchParams.get("ppSessionId")}))},share:function(e){if(!(null==navigator?void 0:navigator.share))return void nt(S,!1,e,e);const t={text:null==e?void 0:e.text};navigator.share(t).then((()=>{var t,n;null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)})).catch((()=>{var t,n;null==(t=null==e?void 0:e.fail)||t.call(e,{errorCode:M.unknown}),null==(n=null==e?void 0:e.complete)||n.call(e)}))},setTitle:function(e){var t,n;document.title=(null==e?void 0:e.title)||"",null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)},render:function(e){var t,n;if(!e.containerId||!document.getElementById(e.containerId))return null==(t=e.fail)||t.call(e,{errorCode:M.badRequestInsufficientParameter}),null==(n=e.complete)||n.call(e),console.error("Invalid container Id");const o=ke(),s=t=>{var n,i,r;if(!Ne(t.origin)||t.data.name!==f||t.data.messageId!==o)return;const c=null==(n=t.data)?void 0:n.data,l=null==(i=t.data)?void 0:i.data;t.data.result===h&&(!function(e,t){var n,o,s,i,r,c,l;const d=document.getElementById(t.containerId),u=document.createElement("button");u.className="ppmna-reset-css pp-smartButtonWrapper pp-button";const p=function(e){return"red"===e?U:R}(null==t?void 0:t.theme),h=(null==(o=null==(n=null==e?void 0:e.data)?void 0:n.cashbackInfo)?void 0:o.length)?"pp-cashback":"",g=t.isShortText?"pp-shortText":"",m=null!=(s=null==t?void 0:t.buttonSize)?s:"lg",_=null!=(i=null==t?void 0:t.theme)?i:"light",f=document.createElement("a");f.className=`pp-smartBtn pp-${_} pp-${m} pp-${be(t.type)} pp-${e.preferredLanguage} ${h} ${g}`,f.href=be(e.data.loginUrl);const E=document.createElement("span");E.className="pp-leftSection";const S=document.createElement("img");S.className="pp-img",S.src=p,S.alt="",E.appendChild(S);const y=document.createElement("span");y.className="pp-btnContent";const I=document.createElement("span");I.className="pp-title",I.innerText=null==(r=null==e?void 0:e.data)?void 0:r.title,y.appendChild(I),E.appendChild(y),f.append(E);const w=document.createElement("span");(null==(c=null==e?void 0:e.data)?void 0:c.cashbackInfo)&&(w.className="pp-cashbackInfo",w.innerText=null==(l=null==e?void 0:e.data)?void 0:l.cashbackInfo,y.append(w));if(e.data.avatarUrl){const t=document.createElement("img");t.className="pp-userProfile",t.src=e.data.avatarUrl,t.addEventListener("error",(function(e){var t;const n=e.target;null==(t=null==n?void 0:n.parentNode)||t.removeChild(n)})),f.append(t)}u.append(f),d&&(d.innerHTML="",d.appendChild(u),"pay"===t.type&&(null==e?void 0:e.isLoggedIn)&&u.addEventListener("click",(e=>{var n;e.preventDefault(),(null==t?void 0:t.callback)?null==(n=null==t?void 0:t.callback)||n.call(t):t.orderInfo&&nt(v,!0,t,a({},t.orderInfo))})))}(l,e),"pay"===c.type&&(null==l?void 0:l.isJustLoggedIn)&&e.autoInvoke&&(null==l?void 0:l.isLoggedIn)&&nt(v,!0,e,a({},e.orderInfo))),t.data.result===g&&(null==(r=null==e?void 0:e.fail)||r.call(e,t.data.data)),t.data.result===m&&(Le(t.data.messageId),removeEventListener("message",s))};addEventListener("message",s),tt({name:f,params:c(a({},e),{redirectUrl:e.redirectUrl||window.location.href}),messageId:o})},renderCoupons:Je,scanCode:function(e){var t;const n=c(a({},e),{redirectUrlOnCancel:null!=(t=null==e?void 0:e.redirectUrlOnCancel)?t:window.location.href});nt(y,!1,e,n)},copyToClipboard:function(e){var t,n,o;const s=document.createElement("textarea");s.setAttribute("readonly","true"),s.setAttribute("contenteditable","true"),s.value=e.value,document.body.appendChild(s),s.select(),s.setSelectionRange(0,s.value.length);const i=document.execCommand("copy");document.body.removeChild(s),i?null==(t=null==e?void 0:e.success)||t.call(e):null==(n=null==e?void 0:e.fail)||n.call(e,{errorCode:M.other}),null==(o=e.complete)||o.call(e)},getSessionData:function(e){var t,n;const o=sessionStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:null!=o?o:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setSessionData:function(e){var t,n,o;sessionStorage.setItem(null==e?void 0:e.key,null!=(t=null==e?void 0:e.value)?t:""),null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},getStorageData:function(e){var t,n;const o=localStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:null!=o?o:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setStorageData:function(e){var t,n,o;localStorage.setItem(null==e?void 0:e.key,null!=(t=null==e?void 0:e.value)?t:""),null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},removeStorageData:function(e){var t,n;localStorage.removeItem(null==e?void 0:e.key),null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)},getKycPassportInfo:function(e){const t=window.location.href;nt(w,!1,e,c(a({},e),{url:t}))},logout:Qe,getPaymentSettings:Xe,getLoginUrl:Ze,markAsReady:ot},rt=["init","setTitle","copyToClipboard","getSessionData","setSessionData","getStorageData","setStorageData","removeStorageData","getLoginUrl"],at=["renderCoupons"];const ct={version:"2.46.0",revision:"bd28c67"};return function({sdkType:e}){We=e;const t=e===O.MiniApp?Ce:Oe,n=new Proxy(it,{get(n,o){if(o in ct)return ct[o];const s=o;if(!ze&&!t(s))throw new Error(`${s} is not supported by ${e} JS SDK`);return function(e,t){return(n={})=>new Promise(((o,s)=>{e(c(a({},n),{success:e=>{var t;o(e),null==(t=n.success)||t.call(n,e)},fail:e=>{var i;"init"===t&&Re[e.errorCode]?o({statusCode:Re[e.errorCode]}):s(e),null==(i=n.fail)||i.call(n,e)}}))}))}((function(e){return l(this,null,(function*(){var t,i;if(!rt.includes(s)&&!(yield He)){if(!at.includes(s)||!function(e){return void 0!==e.clientId}(e))return null==(t=e.fail)||t.call(e,{errorCode:M.sdkNotInitialized}),void(null==(i=e.complete)||i.call(e));Ge({clientId:e.clientId,env:e.env}),yield He}if(Object.prototype.hasOwnProperty.call(n,s))return n[s](e);nt(o,!1,e,e)}))}),s)}});return window._pp=n,function(e){const t=window._ppcs;if(t){window._ppcs=void 0;for(const[n,o,s]of t){const t=e[n](o);s&&s(t)}}}(n),n}({sdkType:O.MiniApp})}();
2
+ var pp=function(){"use strict";var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,r=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,a=(e,t)=>{for(var n in t||(t={}))s.call(t,n)&&r(e,n,t[n]);if(o)for(var n of o(t))i.call(t,n)&&r(e,n,t[n]);return e},c=(e,o)=>t(e,n(o)),l=(e,t,n)=>new Promise(((o,s)=>{var i=e=>{try{a(n.next(e))}catch(t){s(t)}},r=e=>{try{a(n.throw(e))}catch(t){s(t)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,r);a((n=n.apply(e,t)).next())}));function u(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var d=function e(t,n){function o(e,o,s){if("undefined"!=typeof document){"number"==typeof(s=u({},n,s)).expires&&(s.expires=new Date(Date.now()+864e5*s.expires)),s.expires&&(s.expires=s.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var r in s)s[r]&&(i+="; "+r,!0!==s[r]&&(i+="="+s[r].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+i}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],o={},s=0;s<n.length;s++){var i=n[s].split("="),r=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(o[a]=t.read(r,a),e===a)break}catch(c){}}return e?o[e]:o}},remove:function(e,t){o(e,"",u({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,u({},this.attributes,t))},withConverter:function(t){return e(u({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),p=(e=>(e.accessToken="ppjssdk.accessToken",e.refreshToken="ppjssdk.refreshToken",e.env="ppjssdk.env",e.deviceUUID="ppjssdk.deviceUUID",e.clientUUID="ppjssdk.clientUUID",e.lastPayment="ppjssdk.lastPayment",e.lastTopup="ppjssdk.lastTopup",e.appDetail="ppjssdk.appDetail",e.appConfig="ppjssdk.appConfig",e.userInfo="ppjssdk.userInfo",e.lastPaymentMethod="ppjssdk.lastPaymentMethod",e.lastTopupPayMethod="ppjssdk.lastTopupPayMethod",e.codeVerifier="ppjssdk.codeVerifier",e.clientOrigin="ppjssdk.clientOrigin",e.clientVersion="ppjssdk.clientVersion",e.debugMode="ppjssdk.debugMode",e.claimCouponImmediately="ppjssdk.claimCouponImmediately",e.merchant="ppjssdk.merchant",e.consumedOTT="ppjssdk.consumedOTT",e.initializedAt="ppjssdk.initializedAt",e))(p||{});const h="success",g="fail",_="complete",m="init",f="verifyMultiFactorAuthResult",v="share",S="scanCode",E="handleMessageFromNative",y="getKycPassportInfo",I="reload",w="link",A="makeVisible",T="consoleDebugInfo",N="clientPopState";var b=(e=>(e.MiniApp="MiniApp",e.SmartPayment="SmartPayment",e))(b||{});const C="_PayPayJsBridge",O=["init","openWebview","openMap","closeApp","makePayment","topup","setSessionData","getSessionData","setStorageData","getStorageData","removeStorageData","getPermissionStatus","scanCode","showAlert","showErrorSheet","getTopBarHeight","setTitle","showUpdateWarning","getPlatformInformation","openApp","share","getKycInformation","getUserLocation","checkPaymentMethod","registerKyc","startMultiFactorAuth","verifyMultiFactorAuthResult","getBankInfo","logout","getUserProfile","getBalance","getUserAddress","getUAID","copyToClipboard","registerUserInfo","setEnablePullDownRefresh","registerEmail","checkAccessToken","debug","inputAddress","getDeviceInformation","openMiniApp","request","requestInternal","registerPaymentFeatures","initKycPassport","getKycPassportInfo","shortcutExists","addShortcut","getAllUserAddresses","getUserPaymentFeatureSettings","getPaymentSettings","getTransactionInfo","getTransactions","getPayPayCardInfo","getExternalLinkageInformation","markAsReady","renderCoupons"],P=["init","createOrder","makePayment","render","logout","getAuthStatus","getUserProfile","getBalance","getUserAddress","getUAID","getCashbackInformation","renderCoupons","getLoginUrl"];class D extends Error{constructor(e,t){super(e),this.errorCode=t}}var L=(e=>(e.success="SUCCESS",e.invalidUrl="INVALID_URL",e.invalidData="INVALID_DATA",e.invalidHeader="INVALID_HEADER",e.invalidMethod="INVALID_METHOD",e.invalidPath="INVALID_PATH",e.notReachable="NOT_REACHABLE",e.notAvailable="NOT_AVAILABLE",e.timeOut="TIME_OUT",e.whiteListError="NONE_WHITELIST_DOMAIN",e.statusCodeError="STATUS_CODE_ERROR",e.invalidResponse="INVALID_RESPONSE",e.noLocationPermission="NO_USER_LOCATION_PERMISSION",e.noPermissionListAvailable="NO_PERMISSION_LIST_AVAILABLE",e.other="other",e.serverError="SERVER_ERROR",e.noCameraPermission="HOST_APP_CAMERA_DENIED",e.noAlbumPermission="HOST_APP_ALBUM_DENIED",e.insufficientScope="INSUFFICIENT_SCOPE",e.userCanceled="USER_CANCELED",e.invalidJSAPIParams="INVALID_JS_API_PARAMS",e.hostAppLocationDenied="HOST_APP_LOCATION_DENIED",e.hostAppContactsDenied="HOST_APP_READING_CONTACT_DENIED",e.badRequestInsufficientParameter="BAD_REQUEST_INSUFFICIENT_PARAMETER",e.badRequest="BAD_REQUEST",e.paymentFail="PAYMENT_FAIL",e.topupFail="TOPUP_FAIL",e.topupSuccessButNotAddToBalance="TOPUP_SUCCESS_BUT_NOT_ADD_TO_BALANCE",e.userCanceledSimilarTxn="USER_CANCELED_SIMILAR_TRANSACTION",e.mapAppNotFound="MAP_APP_NOT_FOUND",e.invalidAppSchemeURL="INVALID_APP_SCHEME_URL",e.noValueFound="NO_VALUE_FOUND",e.securityNotSetup="SECURITY_NOT_SETUP",e.userDenied="USER_DENIED",e.securityTemporaryLocked="SECURITY_TEMPORARY_LOCKED",e.couldNotGenerateBarcode="COULD_NOT_GENERATE_BARCODE",e.cannotDetectAvailability="CAN_NOT_DETECT_AVAILABILITY",e.suspectedDuplicatePayment="SUSPECTED_DUPLICATE_PAYMENT",e.noSufficientFund="NO_SUFFICIENT_FUND",e.unknown="UNKNOWN",e.sdkNotInitialized="SDK_NOT_INITIALIZED",e.tokenNotFound="TOKEN_NOT_FOUND",e.tokenExpired="TOKEN_EXPIRED",e.activeRequestExists="ACTIVE_REQUEST_EXISTS",e.invalidType="INVALID_TYPE",e.sessionNotFound="SESSION_NOT_FOUND",e.cookieError="COOKIE_ERROR",e.notAuthorized="NOT_AUTHORIZED",e.permissionRequired="PERMISSION_REQUIRED",e.deeplinkUnavailable="DEEPLINK_UNAVAILABLE",e.kycIncompleted="KYC_INCOMPLETED",e.noBankAccount="NO_BANK_ACCOUNT",e.invalidPaymentIdentifier="INVALID_PAYMENT_IDENTIFIER",e.otpSendTooShort="OTP_SEND_TOO_SHORT",e.otpSendOverLimit="OTP_SEND_OVER_LIMIT",e.userVerificationFailure="USER_VERIFICATION_FAILURE",e.unacceptableOp="UNACCEPTABLE_OP",e.kycUpdateRequired="KYC_UPDATE_REQUIRED",e.notCompleted="NOT_COMPLETED",e.kycValidationInProcess="KYC_VALIDATION_IN_PROCESS",e.noLocationData="NO_LOCATION_DATA",e.functionNotFound="FUNCTION_NOT_FOUND",e.originNotAllowed="ORIGIN_NOT_ALLOWED",e.messageSendingFailed="MESSAGE_SENDING_FAILED",e.transactionNotFound="TRANSACTION_NOT_FOUND",e.unexpectedOperation="UNEXPECTED_OP",e.merchantTimeout="MERCHANT_TIMEOUT",e.rateLimitExceeded="RATE_LIMIT_EXCEEDED",e.sdkUpgradeRequired="SDK_UPGRADE_REQUIRED",e.authorizationNeeded="AUTHORIZATION_NEEDED",e))(L||{});const k="2.48.0",R=new URL("https://mini-app-sdk-core.paypay.ne.jp/"),U=R.origin,x=new URL(`./iframe.html?v=${k}&rev=765ecbf`,R).href,M=new URL(`./coupon/iframe.html?v=${k}`,R).href,F="8.45.1",B=globalThis;function j(e,t,n){const o=B,s=o.__SENTRY__=o.__SENTRY__||{},i=s[F]=s[F]||{};return i[e]||(i[e]=t())}const V="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,$=["debug","info","warn","error","log","assert","trace"],q={};function W(e){if(!("console"in B))return e();const t=B.console,n={},o=Object.keys(q);o.forEach((e=>{const o=q[e];n[e]=t[e],t[e]=o}));try{return e()}finally{o.forEach((e=>{t[e]=n[e]}))}}const H=j("logger",(function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return V?$.forEach((n=>{t[n]=(...t)=>{e&&W((()=>{B.console[n](`Sentry Logger [${n}]:`,...t)}))}})):$.forEach((e=>{t[e]=()=>{}})),t}));function z(){return K(B),B}function K(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||F,t[F]=t[F]||{}}const Y=Object.prototype.toString;function G(e){return function(e,t){return Y.call(e)===`[object ${t}]`}(e,"Object")}function J(){return Date.now()/1e3}const Q=function(){const{performance:e}=B;if(!e||!e.now)return J;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}();function X(){const e=B,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch(o){}return"10000000100040008000100000000000".replace(/[018]/g,(e=>(e^(15&n())>>e/4).toString(16)))}function Z(){return X()}function ee(){return X().substring(16)}function te(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&t&&0===Object.keys(t).length)return e;const o=a({},e);for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(o[s]=te(o[s],t[s],n-1));return o}(()=>{const{performance:e}=B;if(!e||!e.now)return;const t=36e5,n=e.now(),o=Date.now(),s=e.timeOrigin?Math.abs(e.timeOrigin+n-o):t,i=s<t,r=e.timing&&e.timing.navigationStart,a="number"==typeof r?Math.abs(r+n-o):t;(i||a<t)&&(s<=a&&e.timeOrigin)})();const ne="_sentrySpan";function oe(e,t){t?function(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(o){V&&H.log(`Failed to add non-enumerable property "${t}" to object`,e)}}(e,ne,t):delete e[ne]}function se(e){return e[ne]}class ie{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Z(),spanId:ee()}}clone(){const e=new ie;return e._breadcrumbs=[...this._breadcrumbs],e._tags=a({},this._tags),e._extra=a({},this._extra),e._contexts=a({},this._contexts),this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata=a({},this._sdkProcessingMetadata),e._propagationContext=a({},this._propagationContext),e._client=this._client,e._lastEventId=this._lastEventId,oe(e,se(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&function(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Q(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:X()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags=a(a({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,t){return this._tags=c(a({},this._tags),{[e]:t}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=a(a({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,t){return this._extra=c(a({},this._extra),{[e]:t}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,[n,o]=t instanceof re?[t.getScopeData(),t.getRequestSession()]:G(t)?[e,e.requestSession]:[],{tags:s,extra:i,user:r,contexts:c,level:l,fingerprint:u=[],propagationContext:d}=n||{};return this._tags=a(a({},this._tags),s),this._extra=a(a({},this._extra),i),this._contexts=a(a({},this._contexts),c),r&&Object.keys(r).length&&(this._user=r),l&&(this._level=l),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),o&&(this._requestSession=o),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,oe(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Z()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const o=a({timestamp:J()},e),s=this._breadcrumbs;return s.push(o),this._breadcrumbs=s.length>n?s.slice(-n):s,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:se(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=te(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=a({spanId:ee()},e),this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:X();if(!this._client)return H.warn("No client configured on scope - will not capture exception!"),n;const o=new Error("Sentry syntheticException");return this._client.captureException(e,c(a({originalException:e,syntheticException:o},t),{event_id:n}),this),n}captureMessage(e,t,n){const o=n&&n.event_id?n.event_id:X();if(!this._client)return H.warn("No client configured on scope - will not capture message!"),o;const s=new Error(e);return this._client.captureMessage(e,t,c(a({originalException:e,syntheticException:s},n),{event_id:o}),this),o}captureEvent(e,t){const n=t&&t.event_id?t.event_id:X();return this._client?(this._client.captureEvent(e,c(a({},t),{event_id:n}),this),n):(H.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}const re=ie;class ae{constructor(e,t){let n,o;n=e||new re,o=t||new re,this._stack=[{scope:n}],this._isolationScope=o}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(s){throw this._popScope(),s}return o=n,Boolean(o&&o.then&&"function"==typeof o.then)?n.then((e=>(this._popScope(),e)),(e=>{throw this._popScope(),e})):(this._popScope(),n);var o}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function ce(){const e=K(z());return e.stack=e.stack||new ae(j("defaultCurrentScope",(()=>new re)),j("defaultIsolationScope",(()=>new re)))}function le(e){return ce().withScope(e)}function ue(e,t){const n=ce();return n.withScope((()=>(n.getStackTop().scope=e,t(e))))}function de(e){return ce().withScope((()=>e(ce().getIsolationScope())))}function pe(e){const t=K(e);return t.acs?t.acs:{withIsolationScope:de,withScope:le,withSetScope:ue,withSetIsolationScope:(e,t)=>de(t),getCurrentScope:()=>ce().getScope(),getIsolationScope:()=>ce().getIsolationScope()}}function he(){return pe(z()).getCurrentScope()}const ge=100;function _e(e,t){const n=he().getClient(),o=pe(z()).getIsolationScope();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=ge}=n.getOptions();if(i<=0)return;const r=J(),c=a({timestamp:r},e),l=s?W((()=>s(c,t))):c;null!==l&&(n.emit&&n.emit("beforeAddBreadcrumb",l,t),o.addBreadcrumb(l,i))}const me=[L.sdkNotInitialized,L.notAuthorized,L.userCanceled,L.userCanceledSimilarTxn,L.suspectedDuplicatePayment,L.noSufficientFund];function fe(e,t,n){me.includes(n)||function(e,t){const n=t;he().captureMessage(e,n,void 0)}(`windowBridge.${e} failed. error: ${n}, message: ${t}`,"log")}const ve=e=>"object"!=typeof e||null===e?e:JSON.parse(JSON.stringify(e));class Se{constructor(e,t,n=[]){this.deferredCallbacks={},this.functions=e,this.allowedOrigins=t,this.middlewares=n,this.messageEventHandler=this.messageEventHandler.bind(this),this.subscribeToMessageEvent()}subscribeToMessageEvent(){window.addEventListener("message",this.messageEventHandler)}unsubscribeToMessageEvent(){window.removeEventListener("message",this.messageEventHandler)}messageEventHandler(e){var t;if(null==(t=e.data)?void 0:t.forWindowBridge)return this.allowedOrigins&&"request"===e.data.type&&!this.allowedOrigins.includes(e.origin)?this.sendErrorResponse(e,`${e.origin} is not allowed to make requests`,L.originNotAllowed):void("request"===e.data.type?this.handleRequest(e):"response"===e.data.type&&this.handleResponse(e))}handleRequest(e){return l(this,null,(function*(){var t;const n=e.data.functionName,o=this.functions[n];o||this.sendErrorResponse(e,`Function '${n}' does not exists on the target window`,L.functionNotFound);try{this.sendSuccessResponse(e,yield function(e,t,n,o){let s=-1;const i=o=>l(this,null,(function*(){if(++s,s<e.length){const n=e[s];return yield n(t,o,i)}return n(...o)}));return i(o)}([...this.middlewares,...null!=(t=o.middlewares)?t:[]],e,o,ve(e.data.params)))}catch(s){let t="Some error occurred while processing the request",n=L.unknown;s instanceof D?(t=s.message,n=s.errorCode):console.error(s),this.sendErrorResponse(e,t,n)}}))}handleResponse(e){if(!this.deferredCallbacks[e.data.key])return void console.warn(`Callback for ${e.data.functionName} not found`);const[t,n]=this.deferredCallbacks[e.data.key];delete this.deferredCallbacks[e.data.key],"success"===e.data.status?t(e.data.result):n(new D(e.data.message,e.data.errorCode))}sendErrorResponse(e,t,n){fe(e.data.functionName,t,n),this.sendResponse(e,{status:"failure",message:t,errorCode:n})}sendSuccessResponse(e,t){this.sendResponse(e,{status:"success",result:t})}sendResponse(e,t){var n;null==(n=e.source)||n.postMessage(a({forWindowBridge:!0,type:"response",key:e.data.key,functionName:e.data.functionName},ve(t)),e.origin)}static init(e,t,n=[]){if(this._instance)throw new Error("WindowBridge already initialized, you can't call WindowBridge.init more than once");return this._instance=new this(e,t,n),this._instance}static destroy(){this._instance&&(this._instance.unsubscribeToMessageEvent(),this._instance=void 0)}static getBridge(){if(!this._instance)throw new Error("WindowBridge not initialized, please call WindowBridge.init before calling WindowBridge.getBridge");return this._instance}static getTargetWindowFunctionProxy(e,t){return Se.getBridge().getTargetWindowFunctionProxy(e,t)}getTargetWindowFunctionProxy(e,t){return new Proxy(this,{get(n,o){return(...s)=>new Promise(((i,r)=>l(this,null,(function*(){const a=o.toString(),c=`${a}--${Ee()}`;try{const o=yield e();if(!o)throw new Error("Target window is undefined");n.deferredCallbacks[c]=[i,r],o.postMessage({forWindowBridge:!0,type:"request",functionName:a,key:c,params:ve(s)},t)}catch(l){delete n.deferredCallbacks[c],r(new D(l.message,L.messageSendingFailed))}}))))}})}}function Ee(){return Math.random().toString(36).substring(7)}new class{constructor(){var e;this.useLocalStorage=!0,this.memoryStorage={};try{localStorage.setItem(p.initializedAt,Date.now().toString());for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);null!=n&&(this.memoryStorage[n]=null!=(e=localStorage.getItem(n))?e:"")}}catch(t){this.useLocalStorage=!1}}getItem(e){var t;if(this.useLocalStorage)try{if(null!=localStorage.getItem(p.initializedAt))return localStorage.getItem(e);console.debug("local storage value has lost unexpectedly."),_e({message:"local storage value has lost unexpectedly.",category:"storage"})}catch(n){}return this.useLocalStorage=!1,null!=(t=this.memoryStorage[e])?t:null}setItem(e,t){if(this.memoryStorage[e]=t,this.useLocalStorage)try{localStorage.setItem(e,t)}catch(n){this.useLocalStorage=!1,console.warn("localStorage has become unavailable.")}}removeItem(e){delete this.memoryStorage[e];try{localStorage.removeItem(e)}catch(t){this.useLocalStorage=!1}}clear(){try{localStorage.clear(),localStorage.setItem(p.initializedAt,Date.now().toString())}catch(e){}this.memoryStorage={}}};const ye=Object.freeze(Object.defineProperty({__proto__:null,getCookie:function({name:e}){return d.get(e)},getLocalStorage:function({name:e}){return localStorage.getItem(e)},getSessionStorage:function({name:e}){return sessionStorage.getItem(e)},getUrl:function(){return window.location.href},removeCookie:function({name:e,options:t}){return d.remove(e,t)},removeLocalStorage:function({name:e}){return localStorage.removeItem(e)},removeQueryParametersFromUrl:function(e){const t=new URL(window.location.href);e.forEach((e=>t.searchParams.delete(e)));const n=`${t.pathname}${t.search}`;history.replaceState(history.state,"",n)},removeSessionStorage:function({name:e}){return sessionStorage.removeItem(e)},setCookie:function({name:e,value:t,options:n}){return d.set(e,t,n)},setLocalStorage:function({name:e,value:t}){return localStorage.setItem(e,t)},setSessionStorage:function({name:e,value:t}){return sessionStorage.setItem(e,t)}},Symbol.toStringTag,{value:"Module"})),Ie="ppmna-iframe",we="ppsdk-container";let Ae,Te;function Ne(){return Ae||(Ae=function(){if(document.getElementById(Ie))return;const e=document.createElement("div");return document.createElement("div"),e.setAttribute("id",we),e.setAttribute("class",we),e.style.all="initial",e.style.display="none",e.style.position="fixed",e.style.width="100%",e.style.height="100%",e.style.top="0",e.style.left="0",e.style.zIndex="2147483637",document.body.appendChild(e),e}()),Ae}function be(e){const t=Ne();t&&(t.style.display=e?"initial":"none")}function Ce(){return Te||(Te=new Promise(((e,t)=>{function n(){const n=document.createElement("iframe");n.setAttribute("src",x),n.setAttribute("name",Ie),n.setAttribute("id",Ie),n.setAttribute("class",Ie),n.setAttribute("allow","geolocation"),n.onload=()=>{e(n),n.onerror=null},n.onerror=t,n.style.all="initial",n.style.width="100%",n.style.height="100%",n.style.border="none";const o=Ne();o&&(o.innerHTML="",o.append(n))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{n()})):n()}))),Te}Se.init(ye,[U]);const Oe=Se.getTargetWindowFunctionProxy((function(){return Ce().then((e=>null==e?void 0:e.contentWindow)).catch((()=>null))}),U);function Pe(e,t,n){var o,s,i,r;e.result===g&&(null==(o=null==t?void 0:t.fail)||o.call(t,e.data)),e.result===h&&(null==(s=null==t?void 0:t.success)||s.call(t,null==e?void 0:e.data)),e.result===_&&(null==(i=null==t?void 0:t.complete)||i.call(t),removeEventListener("message",n),r=e.messageId,Ue=Ue.filter((e=>e!==r)),Ue.length>0||be(!1))}function De(e,t,n,o){const s=function(){const e=Ee();return Ue.push(e),e}(),i=t=>{Le(t.origin)&&t.data.name===e&&t.data.messageId===s&&Pe(t.data,n,i)};addEventListener("message",i),function(e){l(this,null,(function*(){var t;const n=yield Ce().catch((()=>{}));null==(t=null==n?void 0:n.contentWindow)||t.postMessage(JSON.parse(JSON.stringify(e)),U)}))}({name:e,params:o,messageId:s})}function Le(e){return e===U}function ke(e){return O.includes(e)}function Re(e){return P.includes(e)}let Ue=[];function xe(e,t,n){return function(o={}){const s=null==n?void 0:n(o);Oe.logEvent(a({event_action:`pp_${e}_called`,event_category_suffix:e},s));const i=t(o);return i.then((t=>{var n;Oe.logEvent(a({event_action:`pp_${e}_success`,event_category_suffix:e},s)),null==(n=o.success)||n.call(o,t)})).catch((t=>{var n;console.error(t.message),Oe.logEvent(a({event_action:`pp_${e}_fail`,event_category_suffix:e,error_value:t.errorCode},s)),null==(n=o.fail)||n.call(o,{errorCode:t.errorCode})})).finally((()=>{var e;null==(e=o.complete)||e.call(o)})),i}}const Me={[L.sdkNotInitialized]:L.authorizationNeeded,[L.tokenNotFound]:L.authorizationNeeded,[L.tokenExpired]:L.tokenExpired};let Fe,Be;Ce(),Be=Promise.resolve(!1);function je(e){const t=(n=e.clientId,d.get(`${p.refreshToken}.${n}`)||d.get(p.refreshToken)||"");var n;const o=function(e){return d.get(`${p.codeVerifier}.${e}`)||d.get(p.codeVerifier)||""}(e.clientId),s={env:e.env,mode:e.mode,debugMode:e.debugMode,clientId:e.clientId,refreshToken:t,clientVersion:"2.48.0",codeVerifier:o,clientSdkType:Fe,clientUrl:window.location.href};let i;const r=new Promise((e=>i=e)),l=()=>{var t;i(!0),null==(t=e.complete)||t.call(e)};Be.then((()=>Ce())).then((()=>{De(m,0,c(a({},e),{complete:l}),s)})).catch((()=>{var t;null==(t=e.fail)||t.call(e,{errorCode:L.sdkNotInitialized}),l()})),Be=r}addEventListener("message",(e=>{var t;if(!(null==(t=e.data)?void 0:t.forWindowBridge)&&Le(e.origin))if(e.data.name===I&&window.location.reload(),e.data.name!==A){if(e.data.name===w){const t=e.data.data;"_blank"===t.target?window.open(t.url,"_blank"):window.location.href=t.url}if(e.data.name===T){const{params:t}=e.data.data;!function(e){console.debug(...e)}(t)}}else be(!0)})),addEventListener("popstate",(()=>{Ce().then((e=>{var t;const n={name:N};null==(t=null==e?void 0:e.contentWindow)||t.postMessage(n,U)})).catch((e=>console.warn(e)))}));var Ve;Ve={_handleMessageFromNative:e=>{Ce().then((t=>{var n;null==(n=null==t?void 0:t.contentWindow)||n.postMessage(JSON.parse(JSON.stringify({name:E,params:{json:e}})),U)}))}},(!window.hasOwnProperty(C)||window[C]!==Ve)&&(window[C]=Ve);const $e=["init","setTitle","copyToClipboard","getSessionData","setSessionData","getStorageData","setStorageData","removeStorageData","getLoginUrl"],qe=["renderCoupons"];const We={version:"2.48.0",revision:"765ecbf"};xe("getLoginUrl",Oe.getLoginUrl);const He=xe("getPaymentSettings",Oe.getPaymentSettings),ze=xe("markAsReady",Oe.markAsReady);var Ke=(e=>(e.validToken="TOKEN_VALID",e.initialized="INITIALIZED",e.emailRegistered="EMAIL_REGISTERED",e.emailNotVerified="EMAIL_NOT_VERIFIED",e.success="SUCCESS",e.loggedOut="LOGGED_OUT",e.connected="CONNECTED",e))(Ke||{});const Ye=xe("logout",(()=>l(this,null,(function*(){try{return yield Oe.logout(),{statusCode:Ke.loggedOut}}catch(e){throw new D(`An error ocurred while trying to logout the user, error=${e}`,L.unknown)}}))));const Ge={verifyMultiFactorAuthResult:function(e){const t=new URL(window.location.href);De(f,0,e,c(a({},e),{sessionId:t.searchParams.get("ppSessionId")}))},share:function(e){if(!(null==navigator?void 0:navigator.share))return void De(v,0,e,e);const t={text:null==e?void 0:e.text};navigator.share(t).then((()=>{var t,n;null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)})).catch((()=>{var t,n;null==(t=null==e?void 0:e.fail)||t.call(e,{errorCode:L.unknown}),null==(n=null==e?void 0:e.complete)||n.call(e)}))},setTitle:function(e){var t,n,o;document.title=null!=(t=null==e?void 0:e.title)?t:"",null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},renderCoupons:xe("renderCoupons",(e=>l(this,null,(function*(){const{merchant:t,couponId:n,containerId:o,postLoginRedirectUrl:s=window.location.href,postLoginRedirectType:i,locale:r}=e,a=document.getElementById(o);if(!a)throw new D("Invalid coupon container Id",L.badRequestInsufficientParameter);const c=yield Oe.fetchCoupons({merchantId:t,couponId:n,postLoginRedirectUrl:s,postLoginRedirectType:i});try{const e=document.createElement("iframe");e.src=M,e.style.cssText="width:100%;height: 0;border: none;transition: height 300ms ease-in;display: block;",yield new Promise(((t,n)=>{e.onload=()=>t(!0),e.onerror=()=>n(new Error("Failed to load coupon iframe")),a.innerHTML="",a.append(e)})),e.onload=null,e.onerror=null,window.addEventListener("message",(({data:t,source:n})=>{"update-iframe-height"===(null==t?void 0:t.eventName)&&e.contentWindow===n&&(e.style.height=`${t.height}px`)}));const n=Se.getTargetWindowFunctionProxy((()=>e.contentWindow),U);yield n.renderCoupons({coupons:c,merchantId:t,locale:r,postLoginRedirectUrl:s,postLoginRedirectType:i})}catch(l){throw new D(`An error ocurred while displaying coupons, merchantId=${t}, couponId=${n}, error=${l}`,L.unknown)}}))),(e=>({event_label2:e.couponId,merchant_id:e.merchant}))),scanCode:function(e){var t;const n=c(a({},e),{redirectUrlOnCancel:null!=(t=null==e?void 0:e.redirectUrlOnCancel)?t:window.location.href});De(S,0,e,n)},copyToClipboard:function(e){var t,n,o;const s=document.createElement("textarea");s.setAttribute("readonly","true"),s.setAttribute("contenteditable","true"),s.value=e.value,document.body.appendChild(s),s.select(),s.setSelectionRange(0,s.value.length);const i=document.execCommand("copy");document.body.removeChild(s),i?null==(t=null==e?void 0:e.success)||t.call(e):null==(n=null==e?void 0:e.fail)||n.call(e,{errorCode:L.other}),null==(o=e.complete)||o.call(e)},getSessionData:function(e){var t,n;const o=sessionStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:null!=o?o:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setSessionData:function(e){var t,n,o;sessionStorage.setItem(null==e?void 0:e.key,null!=(t=null==e?void 0:e.value)?t:""),null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},getStorageData:function(e){var t,n;const o=localStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:null!=o?o:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setStorageData:function(e){var t,n,o;localStorage.setItem(null==e?void 0:e.key,null!=(t=null==e?void 0:e.value)?t:""),null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},removeStorageData:function(e){var t,n;localStorage.removeItem(null==e?void 0:e.key),null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)},getKycPassportInfo:function(e){const t=window.location.href;De(y,0,e,c(a({},e),{url:t}))},logout:Ye,getPaymentSettings:He,markAsReady:ze};return function({sdkType:e,clientFunctions:t}){Fe=e;const n=e===b.MiniApp?ke:Re,o=new Proxy(c(a({},t),{init:je}),{get(t,o){if(o in We)return We[o];const s=o;if(!n(s))throw new Error(`${s} is not supported by ${e} JS SDK`);return function(e,t){return(n={})=>new Promise(((o,s)=>{e(c(a({},n),{success:e=>{var t;o(e),null==(t=n.success)||t.call(n,e)},fail:e=>{var i;"init"===t&&Me[e.errorCode]?o({statusCode:Me[e.errorCode]}):s(e),null==(i=n.fail)||i.call(n,e)}}))}))}((function(e){return l(this,null,(function*(){var n,i;if(!$e.includes(s)&&!(yield Be)){if(!qe.includes(s)||!function(e){return void 0!==e.clientId}(e))return null==(n=e.fail)||n.call(e,{errorCode:L.sdkNotInitialized}),void(null==(i=e.complete)||i.call(e));je({clientId:e.clientId,env:e.env}),yield Be}const r=t[s];if(r&&"function"==typeof r)return r(e);De(o,0,e,e)}))}),s)}});return window._pp=o,function(e){const t=window._ppcs;if(t){window._ppcs=void 0;for(const[n,o,s]of t){const t=e[n](o);s&&s(t)}}}(o),o}({sdkType:b.MiniApp,clientFunctions:Ge})}();