superapp-miniapp-invoke-native 1.0.35 → 1.0.36
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/lib/main.js +2 -2
- package/lib/main.umd.cjs +1 -1
- package/package.json +1 -1
package/lib/main.js
CHANGED
|
@@ -379,8 +379,8 @@ const q = (t) => {
|
|
|
379
379
|
let r = null;
|
|
380
380
|
t.mockData ? r = t.mockData : r = be(t, {
|
|
381
381
|
asiaUatData: await import("./chunk/1b5f5213.js"),
|
|
382
|
-
euSitData: await import("./chunk/
|
|
383
|
-
euUatData: await import("./chunk/
|
|
382
|
+
euSitData: await import("./chunk/7615ea07.js"),
|
|
383
|
+
euUatData: await import("./chunk/02340160.js")
|
|
384
384
|
}), e((r == null ? void 0 : r.default) ?? null);
|
|
385
385
|
}), ke = () => {
|
|
386
386
|
let t = null;
|
package/lib/main.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ae=Object.defineProperty;var oe=(t,e,r)=>e in t?ae(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var _=(t,e,r)=>(oe(t,typeof e!="symbol"?e+"":e,r),r);/*! Capacitor: https://capacitorjs.com/ - MIT License */const ie=t=>{const e=new Map;e.set("web",{name:"web"});const r=t.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:e},a=(s,i)=>{r.platforms.set(s,i)},n=s=>{r.platforms.has(s)&&(r.currentPlatform=r.platforms.get(s))};return r.addPlatform=a,r.setPlatform=n,r},le=t=>t.CapacitorPlatforms=ie(t),R=le(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});R.addPlatform;R.setPlatform;var L;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(L||(L={}));class E extends Error{constructor(e,r,a){super(e),this.message=e,this.code=r,this.data=a}}const ce=t=>{var e,r;return t!=null&&t.androidBridge?"android":!((r=(e=t==null?void 0:t.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||r===void 0)&&r.bridge?"ios":"web"},de=t=>{var e,r,a,n,s;const i=t.CapacitorCustomPlatform||null,o=t.Capacitor||{},f=o.Plugins=o.Plugins||{},l=t.CapacitorPlatforms,O=()=>i!==null?i.name:ce(t),b=((e=l==null?void 0:l.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||O,j=()=>b()!=="web",z=((r=l==null?void 0:l.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||j,Q=c=>{const d=H.get(c);return!!(d!=null&&d.platforms.has(b())||B(c))},X=((a=l==null?void 0:l.currentPlatform)===null||a===void 0?void 0:a.isPluginAvailable)||Q,Y=c=>{var d;return(d=o.PluginHeaders)===null||d===void 0?void 0:d.find(y=>y.name===c)},B=((n=l==null?void 0:l.currentPlatform)===null||n===void 0?void 0:n.getPluginHeader)||Y,Z=c=>t.console.error(c),V=(c,d,y)=>Promise.reject(`${y} does not have an implementation of "${d}".`),H=new Map,ee=(c,d={})=>{const y=H.get(c);if(y)return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`),y.proxy;const P=b(),C=B(c);let w;const re=async()=>(!w&&P in d?w=typeof d[P]=="function"?w=await d[P]():w=d[P]:i!==null&&!w&&"web"in d&&(w=typeof d.web=="function"?w=await d.web():w=d.web),w),ne=(u,g)=>{var p,v;if(C){const h=C==null?void 0:C.methods.find(m=>g===m.name);if(h)return h.rtype==="promise"?m=>o.nativePromise(c,g.toString(),m):(m,x)=>o.nativeCallback(c,g.toString(),m,x);if(u)return(p=u[g])===null||p===void 0?void 0:p.bind(u)}else{if(u)return(v=u[g])===null||v===void 0?void 0:v.bind(u);throw new E(`"${c}" plugin is not implemented on ${P}`,L.Unimplemented)}},S=u=>{let g;const p=(...v)=>{const h=re().then(m=>{const x=ne(m,u);if(x){const U=x(...v);return g=U==null?void 0:U.remove,U}else throw new E(`"${c}.${u}()" is not implemented on ${P}`,L.Unimplemented)});return u==="addListener"&&(h.remove=async()=>g()),h};return p.toString=()=>`${u.toString()}() { [capacitor code] }`,Object.defineProperty(p,"name",{value:u,writable:!1,configurable:!1}),p},G=S("addListener"),J=S("removeListener"),se=(u,g)=>{const p=G({eventName:u},g),v=async()=>{const m=await p;J({eventName:u,callbackId:m},g)},h=new Promise(m=>p.then(()=>m({remove:v})));return h.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await v()},h},T=new Proxy({},{get(u,g){switch(g){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return C?se:G;case"removeListener":return J;default:return S(g)}}});return f[c]=T,H.set(c,{name:c,proxy:T,platforms:new Set([...Object.keys(d),...C?[P]:[]])}),T},te=((s=l==null?void 0:l.currentPlatform)===null||s===void 0?void 0:s.registerPlugin)||ee;return o.convertFileSrc||(o.convertFileSrc=c=>c),o.getPlatform=b,o.handleError=Z,o.isNativePlatform=z,o.isPluginAvailable=X,o.pluginMethodNoop=V,o.registerPlugin=te,o.Exception=E,o.DEBUG=!!o.DEBUG,o.isLoggingEnabled=!!o.isLoggingEnabled,o.platform=o.getPlatform(),o.isNative=o.isNativePlatform(),o},ue=t=>t.Capacitor=de(t),A=ue(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),N=A.registerPlugin;A.Plugins;class M{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const s=async()=>this.removeListener(e,r),i=Promise.resolve({remove:s});return Object.defineProperty(i,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await s()}}),i}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,r){const a=this.listeners[e];a&&a.forEach(n=>n(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:a=>{this.notifyListeners(r,a)}}}unimplemented(e="not implemented"){return new A.Exception(e,L.Unimplemented)}unavailable(e="not available"){return new A.Exception(e,L.Unavailable)}async removeListener(e,r){const a=this.listeners[e];if(!a)return;const n=a.indexOf(r);this.listeners[e].splice(n,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}}const F=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),K=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class fe extends M{async getCookies(){const e=document.cookie,r={};return e.split(";").forEach(a=>{if(a.length<=0)return;let[n,s]=a.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");n=K(n).trim(),s=K(s).trim(),r[n]=s}),r}async setCookie(e){try{const r=F(e.key),a=F(e.value),n=`; expires=${(e.expires||"").replace("expires=","")}`,s=(e.path||"/").replace("path=",""),i=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${a||""}${n}; path=${s}; ${i};`}catch(r){return Promise.reject(r)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const r of e)document.cookie=r.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}N("CapacitorCookies",{web:()=>new fe});const ge=async t=>new Promise((e,r)=>{const a=new FileReader;a.onload=()=>{const n=a.result;e(n.indexOf(",")>=0?n.split(",")[1]:n)},a.onerror=n=>r(n),a.readAsDataURL(t)}),me=(t={})=>{const e=Object.keys(t);return Object.keys(t).map(n=>n.toLocaleLowerCase()).reduce((n,s,i)=>(n[s]=t[e[i]],n),{})},pe=(t,e=!0)=>t?Object.entries(t).reduce((a,n)=>{const[s,i]=n;let o,f;return Array.isArray(i)?(f="",i.forEach(l=>{o=e?encodeURIComponent(l):l,f+=`${s}=${o}&`}),f.slice(0,-1)):(o=e?encodeURIComponent(i):i,f=`${s}=${o}`),`${a}&${f}`},"").substr(1):null,we=(t,e={})=>{const r=Object.assign({method:t.method||"GET",headers:t.headers},e),n=me(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(n.includes("application/x-www-form-urlencoded")){const s=new URLSearchParams;for(const[i,o]of Object.entries(t.data||{}))s.set(i,o);r.body=s.toString()}else if(n.includes("multipart/form-data")){const s=new FormData;if(t.data instanceof FormData)t.data.forEach((o,f)=>{s.append(f,o)});else for(const o of Object.keys(t.data))s.append(o,t.data[o]);r.body=s;const i=new Headers(r.headers);i.delete("content-type"),r.headers=i}else(n.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r};class ve extends M{async request(e){const r=we(e,e.webFetchExtra),a=pe(e.params,e.shouldEncodeUrlParams),n=a?`${e.url}?${a}`:e.url,s=await fetch(n,r),i=s.headers.get("content-type")||"";let{responseType:o="text"}=s.ok?e:{};i.includes("application/json")&&(o="json");let f,l;switch(o){case"arraybuffer":case"blob":l=await s.blob(),f=await ge(l);break;case"json":f=await s.json();break;case"document":case"text":default:f=await s.text()}const O={};return s.headers.forEach((b,j)=>{O[j]=b}),{data:f,headers:O,status:s.status,url:s.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}N("CapacitorHttp",{web:()=>new ve});/*! Ionic Portals: https://ionic.io/portals - Commercial License */N("Portals",{web:()=>Promise.resolve().then(function(){return Pe}).then(t=>new t.PortalsWeb)});function D(){return A.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}class he extends M{async publishNative(e){}}const Pe=Object.freeze({__proto__:null,PortalsWeb:he});var k=(t=>(t.DEV="dev",t.SIT="sit",t.UAT="uat",t.PROD="prod",t.TEST="test",t))(k||{}),I=(t=>(t.EU="eu",t.ASIA="asia",t))(I||{});const q=t=>{var e,r;if(!(typeof window>"u")&&D&&(e=D())!=null&&e.value){const a=((r=D())==null?void 0:r.value)??null;a&&t&&t(a)}},be=(t,{asiaUatData:e,euSitData:r,euUatData:a})=>{const n=t.mockServerInfo.env,s=t.mockServerInfo.area;let i=null;return I.ASIA===s?k.UAT===n&&(i=e):I.EU===s&&(k.SIT===n?i=r:k.UAT===n&&(i=a)),i},ye=({cb:t})=>{setTimeout(()=>{q(e=>{if(!(e!=null&&e.params))return;const r=JSON.parse(e.params)??null;if(!r)return;const{params:a,routeName:n}=r;!a||!n||t&&t(r)})})},Ce=()=>{let t=!1;return q(e=>{t=!!(e!=null&&e.isNative)}),t},Le=t=>new Promise(async e=>{let r=null;t.mockData?r=t.mockData:r=be(t,{asiaUatData:await Promise.resolve().then(()=>require("./umd/fbb879ae.umd.cjs")),euSitData:await Promise.resolve().then(()=>require("./umd/5ca52608.umd.cjs")),euUatData:await Promise.resolve().then(()=>require("./umd/7c40191f.umd.cjs"))}),e((r==null?void 0:r.default)??null)}),ke=()=>{let t=null;return q(e=>{e?t={data_info:e.data_info?JSON.parse(e.data_info):null,data_store:e.data_store?JSON.parse(e.data_store):null,data_language:e.data_language?JSON.parse(e.data_language):null}:t=null}),t},$=class ${constructor(){_(this,"nativeApiConfig");this.nativeApiConfig=$.defaultNativeApiConfig}async getIsNativeHandle(){return await Ce()}async specifiedPageHandle({cb:e}){await ye({cb:e})}async nativeAppInfo(e){return e&&(this.nativeApiConfig=e),await this.getIsNativeHandle()?await ke():await Le(this.nativeApiConfig)}};_($,"defaultNativeApiConfig",{mockServerInfo:{area:I.ASIA,env:k.UAT}});let W=$;class Ae extends W{constructor(){super()}async getIsNativeHandle(){return await super.getIsNativeHandle()}async specifiedPageHandle({cb:e}){return await super.specifiedPageHandle({cb:e})}async nativeAppInfo(e){return await super.nativeAppInfo(e)}}const Oe=new Ae;module.exports=Oe;
|
|
1
|
+
"use strict";var ae=Object.defineProperty;var oe=(t,e,r)=>e in t?ae(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var _=(t,e,r)=>(oe(t,typeof e!="symbol"?e+"":e,r),r);/*! Capacitor: https://capacitorjs.com/ - MIT License */const ie=t=>{const e=new Map;e.set("web",{name:"web"});const r=t.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:e},a=(s,i)=>{r.platforms.set(s,i)},n=s=>{r.platforms.has(s)&&(r.currentPlatform=r.platforms.get(s))};return r.addPlatform=a,r.setPlatform=n,r},le=t=>t.CapacitorPlatforms=ie(t),R=le(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});R.addPlatform;R.setPlatform;var L;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(L||(L={}));class E extends Error{constructor(e,r,a){super(e),this.message=e,this.code=r,this.data=a}}const ce=t=>{var e,r;return t!=null&&t.androidBridge?"android":!((r=(e=t==null?void 0:t.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||r===void 0)&&r.bridge?"ios":"web"},de=t=>{var e,r,a,n,s;const i=t.CapacitorCustomPlatform||null,o=t.Capacitor||{},f=o.Plugins=o.Plugins||{},l=t.CapacitorPlatforms,O=()=>i!==null?i.name:ce(t),b=((e=l==null?void 0:l.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||O,j=()=>b()!=="web",z=((r=l==null?void 0:l.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||j,Q=c=>{const d=H.get(c);return!!(d!=null&&d.platforms.has(b())||B(c))},X=((a=l==null?void 0:l.currentPlatform)===null||a===void 0?void 0:a.isPluginAvailable)||Q,Y=c=>{var d;return(d=o.PluginHeaders)===null||d===void 0?void 0:d.find(y=>y.name===c)},B=((n=l==null?void 0:l.currentPlatform)===null||n===void 0?void 0:n.getPluginHeader)||Y,Z=c=>t.console.error(c),V=(c,d,y)=>Promise.reject(`${y} does not have an implementation of "${d}".`),H=new Map,ee=(c,d={})=>{const y=H.get(c);if(y)return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`),y.proxy;const P=b(),C=B(c);let w;const re=async()=>(!w&&P in d?w=typeof d[P]=="function"?w=await d[P]():w=d[P]:i!==null&&!w&&"web"in d&&(w=typeof d.web=="function"?w=await d.web():w=d.web),w),ne=(u,g)=>{var p,v;if(C){const h=C==null?void 0:C.methods.find(m=>g===m.name);if(h)return h.rtype==="promise"?m=>o.nativePromise(c,g.toString(),m):(m,x)=>o.nativeCallback(c,g.toString(),m,x);if(u)return(p=u[g])===null||p===void 0?void 0:p.bind(u)}else{if(u)return(v=u[g])===null||v===void 0?void 0:v.bind(u);throw new E(`"${c}" plugin is not implemented on ${P}`,L.Unimplemented)}},S=u=>{let g;const p=(...v)=>{const h=re().then(m=>{const x=ne(m,u);if(x){const U=x(...v);return g=U==null?void 0:U.remove,U}else throw new E(`"${c}.${u}()" is not implemented on ${P}`,L.Unimplemented)});return u==="addListener"&&(h.remove=async()=>g()),h};return p.toString=()=>`${u.toString()}() { [capacitor code] }`,Object.defineProperty(p,"name",{value:u,writable:!1,configurable:!1}),p},G=S("addListener"),J=S("removeListener"),se=(u,g)=>{const p=G({eventName:u},g),v=async()=>{const m=await p;J({eventName:u,callbackId:m},g)},h=new Promise(m=>p.then(()=>m({remove:v})));return h.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await v()},h},T=new Proxy({},{get(u,g){switch(g){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return C?se:G;case"removeListener":return J;default:return S(g)}}});return f[c]=T,H.set(c,{name:c,proxy:T,platforms:new Set([...Object.keys(d),...C?[P]:[]])}),T},te=((s=l==null?void 0:l.currentPlatform)===null||s===void 0?void 0:s.registerPlugin)||ee;return o.convertFileSrc||(o.convertFileSrc=c=>c),o.getPlatform=b,o.handleError=Z,o.isNativePlatform=z,o.isPluginAvailable=X,o.pluginMethodNoop=V,o.registerPlugin=te,o.Exception=E,o.DEBUG=!!o.DEBUG,o.isLoggingEnabled=!!o.isLoggingEnabled,o.platform=o.getPlatform(),o.isNative=o.isNativePlatform(),o},ue=t=>t.Capacitor=de(t),A=ue(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),N=A.registerPlugin;A.Plugins;class M{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const s=async()=>this.removeListener(e,r),i=Promise.resolve({remove:s});return Object.defineProperty(i,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await s()}}),i}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,r){const a=this.listeners[e];a&&a.forEach(n=>n(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:a=>{this.notifyListeners(r,a)}}}unimplemented(e="not implemented"){return new A.Exception(e,L.Unimplemented)}unavailable(e="not available"){return new A.Exception(e,L.Unavailable)}async removeListener(e,r){const a=this.listeners[e];if(!a)return;const n=a.indexOf(r);this.listeners[e].splice(n,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}}const F=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),K=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class fe extends M{async getCookies(){const e=document.cookie,r={};return e.split(";").forEach(a=>{if(a.length<=0)return;let[n,s]=a.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");n=K(n).trim(),s=K(s).trim(),r[n]=s}),r}async setCookie(e){try{const r=F(e.key),a=F(e.value),n=`; expires=${(e.expires||"").replace("expires=","")}`,s=(e.path||"/").replace("path=",""),i=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${a||""}${n}; path=${s}; ${i};`}catch(r){return Promise.reject(r)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const r of e)document.cookie=r.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}N("CapacitorCookies",{web:()=>new fe});const ge=async t=>new Promise((e,r)=>{const a=new FileReader;a.onload=()=>{const n=a.result;e(n.indexOf(",")>=0?n.split(",")[1]:n)},a.onerror=n=>r(n),a.readAsDataURL(t)}),me=(t={})=>{const e=Object.keys(t);return Object.keys(t).map(n=>n.toLocaleLowerCase()).reduce((n,s,i)=>(n[s]=t[e[i]],n),{})},pe=(t,e=!0)=>t?Object.entries(t).reduce((a,n)=>{const[s,i]=n;let o,f;return Array.isArray(i)?(f="",i.forEach(l=>{o=e?encodeURIComponent(l):l,f+=`${s}=${o}&`}),f.slice(0,-1)):(o=e?encodeURIComponent(i):i,f=`${s}=${o}`),`${a}&${f}`},"").substr(1):null,we=(t,e={})=>{const r=Object.assign({method:t.method||"GET",headers:t.headers},e),n=me(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(n.includes("application/x-www-form-urlencoded")){const s=new URLSearchParams;for(const[i,o]of Object.entries(t.data||{}))s.set(i,o);r.body=s.toString()}else if(n.includes("multipart/form-data")){const s=new FormData;if(t.data instanceof FormData)t.data.forEach((o,f)=>{s.append(f,o)});else for(const o of Object.keys(t.data))s.append(o,t.data[o]);r.body=s;const i=new Headers(r.headers);i.delete("content-type"),r.headers=i}else(n.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r};class ve extends M{async request(e){const r=we(e,e.webFetchExtra),a=pe(e.params,e.shouldEncodeUrlParams),n=a?`${e.url}?${a}`:e.url,s=await fetch(n,r),i=s.headers.get("content-type")||"";let{responseType:o="text"}=s.ok?e:{};i.includes("application/json")&&(o="json");let f,l;switch(o){case"arraybuffer":case"blob":l=await s.blob(),f=await ge(l);break;case"json":f=await s.json();break;case"document":case"text":default:f=await s.text()}const O={};return s.headers.forEach((b,j)=>{O[j]=b}),{data:f,headers:O,status:s.status,url:s.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}N("CapacitorHttp",{web:()=>new ve});/*! Ionic Portals: https://ionic.io/portals - Commercial License */N("Portals",{web:()=>Promise.resolve().then(function(){return Pe}).then(t=>new t.PortalsWeb)});function D(){return A.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}class he extends M{async publishNative(e){}}const Pe=Object.freeze({__proto__:null,PortalsWeb:he});var k=(t=>(t.DEV="dev",t.SIT="sit",t.UAT="uat",t.PROD="prod",t.TEST="test",t))(k||{}),I=(t=>(t.EU="eu",t.ASIA="asia",t))(I||{});const q=t=>{var e,r;if(!(typeof window>"u")&&D&&(e=D())!=null&&e.value){const a=((r=D())==null?void 0:r.value)??null;a&&t&&t(a)}},be=(t,{asiaUatData:e,euSitData:r,euUatData:a})=>{const n=t.mockServerInfo.env,s=t.mockServerInfo.area;let i=null;return I.ASIA===s?k.UAT===n&&(i=e):I.EU===s&&(k.SIT===n?i=r:k.UAT===n&&(i=a)),i},ye=({cb:t})=>{setTimeout(()=>{q(e=>{if(!(e!=null&&e.params))return;const r=JSON.parse(e.params)??null;if(!r)return;const{params:a,routeName:n}=r;!a||!n||t&&t(r)})})},Ce=()=>{let t=!1;return q(e=>{t=!!(e!=null&&e.isNative)}),t},Le=t=>new Promise(async e=>{let r=null;t.mockData?r=t.mockData:r=be(t,{asiaUatData:await Promise.resolve().then(()=>require("./umd/fbb879ae.umd.cjs")),euSitData:await Promise.resolve().then(()=>require("./umd/7c40191f.umd.cjs")),euUatData:await Promise.resolve().then(()=>require("./umd/5ca52608.umd.cjs"))}),e((r==null?void 0:r.default)??null)}),ke=()=>{let t=null;return q(e=>{e?t={data_info:e.data_info?JSON.parse(e.data_info):null,data_store:e.data_store?JSON.parse(e.data_store):null,data_language:e.data_language?JSON.parse(e.data_language):null}:t=null}),t},$=class ${constructor(){_(this,"nativeApiConfig");this.nativeApiConfig=$.defaultNativeApiConfig}async getIsNativeHandle(){return await Ce()}async specifiedPageHandle({cb:e}){await ye({cb:e})}async nativeAppInfo(e){return e&&(this.nativeApiConfig=e),await this.getIsNativeHandle()?await ke():await Le(this.nativeApiConfig)}};_($,"defaultNativeApiConfig",{mockServerInfo:{area:I.ASIA,env:k.UAT}});let W=$;class Ae extends W{constructor(){super()}async getIsNativeHandle(){return await super.getIsNativeHandle()}async specifiedPageHandle({cb:e}){return await super.specifiedPageHandle({cb:e})}async nativeAppInfo(e){return await super.nativeAppInfo(e)}}const Oe=new Ae;module.exports=Oe;
|