1import{j as c}from"./chunk-RNQ7BUHW.js";var te=t=>{let e=new Map;e.set("web",{name:"web"});let r=t.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:e},i=(s,a)=>{r.platforms.set(s,a)},n=s=>{r.platforms.has(s)&&(r.currentPlatform=r.platforms.get(s))};return r.addPlatform=i,r.setPlatform=n,r},re=t=>t.CapacitorPlatforms=te(t),B=re(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),de=B.addPlatform,ue=B.setPlatform;var $=function(t){return t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE",t}($||{}),k=class extends Error{constructor(e,r,i){super(e),this.message=e,this.code=r,this.data=i}},ne=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"},se=t=>{var e,r,i,n,s;let a=t.CapacitorCustomPlatform||null,o=t.Capacitor||{},g=o.Plugins=o.Plugins||{},l=t.CapacitorPlatforms,E=()=>a!==null?a.name:ne(t),y=((e=l==null?void 0:l.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||E,A=()=>y()!=="web",G=((r=l==null?void 0:l.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||A,K=d=>{let u=_.get(d);return!!(u!=null&&u.platforms.has(y())||M(d))},V=((i=l==null?void 0:l.currentPlatform)===null||i===void 0?void 0:i.isPluginAvailable)||K,z=d=>{var u;return(u=o.PluginHeaders)===null||u===void 0?void 0:u.find(L=>L.name===d)},M=((n=l==null?void 0:l.currentPlatform)===null||n===void 0?void 0:n.getPluginHeader)||z,J=d=>t.console.error(d),Q=(d,u,L)=>Promise.reject("".concat(L,' does not have an implementation of "').concat(u,'".')),_=new Map,X=(d,u={})=>{let L=_.get(d);if(L)return console.warn('Capacitor plugin "'.concat(d,'" already registered. Cannot register plugins twice.')),L.proxy;let p=y(),C=M(d),v,Z=()=>c(void 0,null,function*(){return!v&&p in u?v=typeof u[p]=="function"?v=yield u[p]():v=u[p]:a!==null&&!v&&"web"in u&&(v=typeof u.web=="function"?v=yield u.web():v=u.web),v}),N=(f,m)=>{var w,P;if(C){let b=C==null?void 0:C.methods.find(h=>m===h.name);if(b)return b.rtype==="promise"?h=>o.nativePromise(d,m.toString(),h):(h,O)=>o.nativeCallback(d,m.toString(),h,O);if(f)return(w=f[m])===null||w===void 0?void 0:w.bind(f)}else{if(f)return(P=f[m])===null||P===void 0?void 0:P.bind(f);throw new k('"'.concat(d,'" plugin is not implemented on ').concat(p),$.Unimplemented)}},S=f=>{let m,w=(...P)=>{let b=Z().then(h=>{let O=N(h,f);if(O){let j=O(...P);return m=j==null?void 0:j.remove,j}else throw new k('"'.concat(d,".").concat(f,'()" is not implemented on ').concat(p),$.Unimplemented)});return f==="addListener"&&(b.remove=()=>c(void 0,null,function*(){return m()})),b};return w.toString=()=>"".concat(f.toString(),"() { [capacitor code] }"),Object.defineProperty(w,"name",{value:f,writable:!1,configurable:!1}),w},R=S("addListener"),D=S("removeListener"),ee=(f,m)=>{let w=R({eventName:f},m),P=()=>c(void 0,null,function*(){let h=yield w;D({eventName:f,callbackId:h},m)}),b=new Promise(h=>w.then(()=>h({remove:P})));return b.remove=()=>c(void 0,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield P()}),b},T=new Proxy({},{get(f,m){switch(m){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return C?ee:R;case"removeListener":return D;default:return S(m)}}});return g[d]=T,_.set(d,{name:d,proxy:T,platforms:new Set([...Object.keys(u),...C?[p]:[]])}),T},Y=((s=l==null?void 0:l.currentPlatform)===null||s===void 0?void 0:s.registerPlugin)||X;return o.convertFileSrc||(o.convertFileSrc=d=>d),o.getPlatform=y,o.handleError=J,o.isNativePlatform=G,o.isPluginAvailable=V,o.pluginMethodNoop=Q,o.registerPlugin=Y,o.Exception=k,o.DEBUG=!!o.DEBUG,o.isLoggingEnabled=!!o.isLoggingEnabled,o.platform=o.getPlatform(),o.isNative=o.isNativePlatform(),o},oe=t=>t.Capacitor=se(t),U=oe(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),F=U.registerPlugin,fe=U.Plugins;var x=class{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn('Capacitor WebPlugin "'.concat(e.name,'" config object was deprecated
1in v3 and will be removed in v4.')),this.config=e)}addListener(e,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r);let n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);let s=()=>c(this,null,function*(){return this.removeListener(e,r)}),a=Promise.resolve({remove:s});return Object.defineProperty(a,"remove",{value:()=>c(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield s()})}),a}removeAllListeners(){return c(this,null,function*(){this.listeners={};for(let e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}})}notifyListeners(e,r){let i=this.listeners[e];i&&i.forEach(n=>n(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:i=>{this.notifyListeners(r,i)}}}unimplemented(e="not implemented"){return new U.Exception(e,$.Unimplemented)}unavailable(e="not available"){return new U.Exception(e,$.Unavailable)}removeListener(e,r){return c(this,null,function*(){let i=this.listeners[e];if(!i)return;let n=i.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)}};var I=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),q=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent),H=class extends x{getCookies(){return c(this,null,function*(){let e=document.cookie,r={};return e.split(";").forEach(i=>{if(i.length<=0)return;let[n,s]=i.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");n=q(n).trim(),s=q(s).trim(),r[n]=s}),r})}setCookie(e){return c(this,null,function*(){try{let r=I(e.key),i=I(e.value),n="; expires=".concat((e.expires||"").replace("expires=","")),s=(e.path||"/").replace("path=",""),a=e.url!=null&&e.url.length>0?"domain=".concat(e.url):"";document.cookie="".concat(r,"=").concat(i||"").concat(n,"; path=").concat(s,"; ").concat(a,";")}catch(r){return Promise.reject(r)}})}deleteCookie(e){return c(this,null,function*(){try{document.cookie="".concat(e.key,"=; Max-Age=0")}catch(r){return Promise.reject(r)}})}clearCookies(){return c(this,null,function*(){try{let e=document.cookie.split(";")||[];for(let r of e)document.cookie=r.replace(/^ +/,"").replace(/=.*/,"=;expires=".concat(new Date().toUTCString(),";path=/"))}catch(e){return Promise.reject(e)}})}clearAllCookies(){return c(this,null,function*(){try{yield this.clearCookies()}catch(e){return Promise.reject(e)}})}},ge=F("CapacitorCookies",{web:()=>new H}),ie=t=>c(void 0,null,function*(){return new Promise((e,r)=>{let i=new FileReader;i.onload=()=>{let n=i.result;e(n.indexOf(",")>=0?n.split(",")[1]:n)},i.onerror=n=>r(n),i.readAsDataURL(t)})}),ae=(t={})=>{let e=Object.keys(t);return Object.keys(t).map(n=>n.toLocaleLowerCase()).reduce((n,s,a)=>(n[s]=t[e[a]],n),{})},le=(t,e=!0)=>t?Object.entries(t).reduce((i,n)=>{let[s,a]=n,o,g;return Array.isArray(a)?(g="",a.forEach(l=>{o=e?encodeURIComponent(l):l,g+="".concat(s,"=").concat(o,"&")}),g.slice(0,-1)):(o=e?encodeURIComponent(a):a,g="".concat(s,"=").concat(o)),"".concat(i,"&").concat(g)},"").substr(1):null,ce=(t,e={})=>{let r=Object.assign({method:t.method||"GET",headers:t.headers},e),n=ae(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(n.includes("application/x-www-form-urlencoded")){let s=new URLSearchParams;for(let[a,o]of Object.entries(t.data||{}))s.set(a,o);r.body=s.toString()}else if(n.includes("multipart/form-data")||t.data instanceof FormData){let s=new FormData;if(t.data instanceof FormData)t.data.forEach((o,g)=>{s.append(g,o)});else for(let o of Object.keys(t.data))s.append(o,t.data[o]);r.body=s;let a=new Headers(r.headers);a.delete("content-type"),r.headers=a}else(n.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r},W=class extends x{request(e){return c(this,null,function*(){let r=ce(e,e.webFetchExtra),i=le(e.params,e.shouldEncodeUrlParams),n=i?"".concat(e.url,"?").concat(i):e.url,s=yield fetch(n,r),a=s.headers.get("content-type")||"",{responseType:o="text"}=s.ok?e:{};a.includes("application/json")&&(o="json");let g,l;switch(o){case"arraybuffer":case"blob":l=yield s.blob(),g=yield ie(l);break;case"json":g=yield s.json();break;case"document":case"text":default:g=yield s.text()}let E={};
1return s.headers.forEach((y,A)=>{E[A]=y}),{data:g,headers:E,status:s.status,url:s.url}})}get(e){return c(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))})}post(e){return c(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))})}put(e){return c(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))})}patch(e){return c(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))})}delete(e){return c(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))})}},me=F("CapacitorHttp",{web:()=>new W});export{k as a,F as b,x as c}; 2/*! Bundled license information: 3 4@capacitor/core/dist/index.js: 5 (*! Capacitor: https://capacitorjs.com/ - MIT License *) 6*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.