Files
appco_dist/.output/public/_nuxt/ppZ4gnC7.js
T

2 lines
12 KiB
JavaScript
Raw Normal View History

2025-07-26 22:08:43 +03:30
/*! Capacitor: https://capacitorjs.com/ - MIT License */var C;(function(s){s.Unimplemented="UNIMPLEMENTED",s.Unavailable="UNAVAILABLE"})(C||(C={}));class E extends Error{constructor(e,t,n){super(e),this.message=e,this.code=t,this.data=n}}const M=s=>{var e,t;return s!=null&&s.androidBridge?"android":!((t=(e=s==null?void 0:s.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||t===void 0)&&t.bridge?"ios":"web"},B=s=>{const e=s.CapacitorCustomPlatform||null,t=s.Capacitor||{},n=t.Plugins=t.Plugins||{},r=()=>e!==null?e.name:M(s),a=()=>r()!=="web",i=l=>{const d=u.get(l);return!!(d!=null&&d.platforms.has(r())||o(l))},o=l=>{var d;return(d=t.PluginHeaders)===null||d===void 0?void 0:d.find(k=>k.name===l)},c=l=>s.console.error(l),u=new Map,v=(l,d={})=>{const k=u.get(l);if(k)return console.warn(`Capacitor plugin "${l}" already registered. Cannot register plugins twice.`),k.proxy;const y=r(),P=o(l);let g;const H=async()=>(!g&&y in d?g=typeof d[y]=="function"?g=await d[y]():g=d[y]:e!==null&&!g&&"web"in d&&(g=typeof d.web=="function"?g=await d.web():g=d.web),g),D=(m,f)=>{var h,w;if(P){const b=P==null?void 0:P.methods.find(p=>f===p.name);if(b)return b.rtype==="promise"?p=>t.nativePromise(l,f.toString(),p):(p,x)=>t.nativeCallback(l,f.toString(),p,x);if(m)return(h=m[f])===null||h===void 0?void 0:h.bind(m)}else{if(m)return(w=m[f])===null||w===void 0?void 0:w.bind(m);throw new E(`"${l}" plugin is not implemented on ${y}`,C.Unimplemented)}},A=m=>{let f;const h=(...w)=>{const b=H().then(p=>{const x=D(p,m);if(x){const O=x(...w);return f=O==null?void 0:O.remove,O}else throw new E(`"${l}.${m}()" is not implemented on ${y}`,C.Unimplemented)});return m==="addListener"&&(b.remove=async()=>f()),b};return h.toString=()=>`${m.toString()}() { [capacitor code] }`,Object.defineProperty(h,"name",{value:m,writable:!1,configurable:!1}),h},j=A("addListener"),T=A("removeListener"),W=(m,f)=>{const h=j({eventName:m},f),w=async()=>{const p=await h;T({eventName:m,callbackId:p},f)},b=new Promise(p=>h.then(()=>p({remove:w})));return b.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await w()},b},R=new Proxy({},{get(m,f){switch(f){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return P?W:j;case"removeListener":return T;default:return A(f)}}});return n[l]=R,u.set(l,{name:l,proxy:R,platforms:new Set([...Object.keys(d),...P?[y]:[]])}),R};return t.convertFileSrc||(t.convertFileSrc=l=>l),t.getPlatform=r,t.handleError=c,t.isNativePlatform=a,t.isPluginAvailable=i,t.registerPlugin=v,t.Exception=E,t.DEBUG=!!t.DEBUG,t.isLoggingEnabled=!!t.isLoggingEnabled,t},K=s=>s.Capacitor=B(s),$=K(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),S=$.registerPlugin;class _{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(e,t){let n=!1;this.listeners[e]||(this.listeners[e]=[],n=!0),this.listeners[e].push(t);const a=this.windowListeners[e];a&&!a.registered&&this.addWindowListener(a),n&&this.sendRetainedArgumentsForEvent(e);const i=async()=>this.removeListener(e,t);return Promise.resolve({remove:i})}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,t,n){const r=this.listeners[e];if(!r){if(n){let a=this.retainedEventArguments[e];a||(a=[]),a.push(t),this.retainedEventArguments[e]=a}return}r.forEach(a=>a(t))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:n=>{this.notifyListeners(t,n)}}}unimplemented(e="not implemented"){return new $.Exception(e,C.Unimplemented)}unavailable(e="not available"){return new $.Exception(e,C.Unavailable)}async removeListener(e,t){const n=this.listeners[e];if(!n)return;const r=n.indexOf(t);this.listeners[e].splice(r,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler)