1 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).firebase=t()}(this,(function(){"use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | function e(t,n){if(!(n instanceof Object))return n;switch(n.constructor){case Date:return new Date(n.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return n}for(const r in n)n.hasOwnProperty(r)&&(t[r]=e(t[r],n[r]));return t}
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 | class t{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,n))}}}
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 | class n extends Error{constructor(e,t){super(t),this.code=e,this.name="FirebaseError",Object.setPrototypeOf(this,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,r.prototype.create)}}class r{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const r=t[0]||{},o=`${this.service}/${e}`,s=this.errors[e],a=s?function(e,t){return e.replace(i,(e,n)=>{const r=t[n];return null!=r?r.toString():`<${n}?>`})}(s,r):"Error",c=`${this.serviceName}: ${a} (${o}).`,u=new n(o,c);for(const e of Object.keys(r))"_"!==e.slice(-1)&&(e in u&&console.warn(`Overwriting FirebaseError base field "${e}" can cause unexpected behavior.`),u[e]=r[e]);return u}}const i=/\{\$([^}]+)}/g;
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 | function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}class s{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY"}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}}
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 | class a{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map}get(e="[DEFAULT]"){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const e=new t;this.instancesDeferred.set(n,e);try{const t=this.getOrInitializeService(n);t&&e.resolve(t)}catch(e){}}return this.instancesDeferred.get(n).promise}getImmediate(e){const{identifier:t,optional:n}=Object.assign({identifier:"[DEFAULT]",optional:!1},e),r=this.normalizeInstanceIdentifier(t);try{const e=this.getOrInitializeService(r);if(!e){if(n)return null;throw Error(`Service ${this.name} is not available`)}return e}catch(e){if(n)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,function(e){return"EAGER"===e.instantiationMode}
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 | (e))try{this.getOrInitializeService("[DEFAULT]")}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService(n);t.resolve(e)}catch(e){}}}clearInstance(e="[DEFAULT]"){this.instancesDeferred.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all(e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()))}isComponentSet(){return null!=this.component}getOrInitializeService(e){let t=this.instances.get(e);return!t&&this.component&&(t=this.component.instanceFactory(this.container,function(e){return"[DEFAULT]"===e?void 0:e}(e)),this.instances.set(e,t)),t||null}normalizeInstanceIdentifier(e){return this.component?this.component.multipleInstances?e:"[DEFAULT]":e}}class c{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new a(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 | const u=[];var l;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(l||(l={}));const p={debug:l.DEBUG,verbose:l.VERBOSE,info:l.INFO,warn:l.WARN,error:l.ERROR,silent:l.SILENT},f=l.INFO,h={[l.DEBUG]:"log",[l.VERBOSE]:"log",[l.INFO]:"info",[l.WARN]:"warn",[l.ERROR]:"error"},d=(e,t,...n)=>{if(t<e.logLevel)return;const r=(new Date).toISOString(),i=h[t];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[i](`[${r}] ${e.name}:`,...n)};class g{constructor(e){this.name=e,this._logLevel=f,this._logHandler=d,this._userLogHandler=null,u.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in l))throw new TypeError("Invalid value assigned to `logLevel`");this._logLevel=e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,l.DEBUG,...e),this._logHandler(this,l.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,l.VERBOSE,...e),this._logHandler(this,l.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,l.INFO,...e),this._logHandler(this,l.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,l.WARN,...e),this._logHandler(this,l.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,l.ERROR,...e),this._logHandler(this,l.ERROR,...e)}}function m(e){const t="string"==typeof e?p[e]:e;u.forEach(e=>{e.logLevel=t})}
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 | const b=new r("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists","app-deleted":"Firebase App named '{$appName}' already deleted","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function."}),w={"@firebase/app":"fire-core","@firebase/analytics":"fire-analytics","@firebase/auth":"fire-auth","@firebase/database":"fire-rtdb","@firebase/functions":"fire-fn","@firebase/installations":"fire-iid","@firebase/messaging":"fire-fcm","@firebase/performance":"fire-perf","@firebase/remote-config":"fire-rc","@firebase/storage":"fire-gcs","@firebase/firestore":"fire-fst","fire-js":"fire-js","firebase-wrapper":"fire-js-all"};
|
164 |
|
165 |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 | class v{constructor(t,n,r){this.firebase_=r,this.isDeleted_=!1,this.INTERNAL={},this.name_=n.name,this.automaticDataCollectionEnabled_=n.automaticDataCollectionEnabled||!1,this.options_=e(void 0,t),this.container=new c(n.name),this.container.addComponent(new s("app",()=>this,"PUBLIC"));for(const e of this.firebase_.INTERNAL.components.values())this.container.addComponent(e)}get automaticDataCollectionEnabled(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_}set automaticDataCollectionEnabled(e){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=e}get name(){return this.checkDestroyed_(),this.name_}get options(){return this.checkDestroyed_(),this.options_}delete(){return new Promise(e=>{this.checkDestroyed_(),e()}).then(()=>(this.firebase_.INTERNAL.removeApp(this.name_),Promise.all(this.container.getProviders().map(e=>e.delete())))).then(()=>{this.isDeleted_=!0})}_getService(e,t="[DEFAULT]"){return this.checkDestroyed_(),this.container.getProvider(e).getImmediate({identifier:t})}checkDestroyed_(){if(this.isDeleted_)throw b.create("app-deleted",{appName:this.name_})}}const y=new g("@firebase/app");
|
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 |
|
187 |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 |
|
213 | function _(t){const n={},r=new Map,i={__esModule:!0,initializeApp:function(e,r={}){if("object"!=typeof r||null===r){r={name:r}}const s=r;void 0===s.name&&(s.name="[DEFAULT]");const{name:a}=s;if("string"!=typeof a||!a)throw b.create("bad-app-name",{appName:String(a)});if(o(n,a))throw b.create("duplicate-app",{appName:a});const c=new t(e,s,i);return n[a]=c,c},app:a,registerVersion:function(e,t,n){var r;let i=null!==(r=w[e])&&void 0!==r?r:e;n&&(i+=`-${n}`);const o=i.match(/\s|\//),a=t.match(/\s|\//);if(o||a){const e=[`Unable to register library "${i}" with version "${t}":`];return o&&e.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&a&&e.push("and"),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void y.warn(e.join(" "))}c(new s(`${i}-version`,()=>({library:i,version:t}),"VERSION"))},setLogLevel:m,onLog:function(e,t){if(null!==e&&"function"!=typeof e)throw b.create("invalid-log-argument",{appName:name});!function(e,t){for(const n of u){let r=null;t&&t.level&&(r=p[t.level]),n.userLogHandler=null===e?null:(t,n,...i)=>{const o=i.map(e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}}).filter(e=>e).join(" ");n>=(null!=r?r:t.logLevel)&&e({level:l[n].toLowerCase(),message:o,args:i,type:t.name})}}}(e,t)},apps:null,SDK_VERSION:"7.13.1",INTERNAL:{registerComponent:c,removeApp:function(e){delete n[e]},components:r,useAsService:function(e,t){if("serverAuth"===t)return null;return t}}};function a(e){if(!o(n,e=e||"[DEFAULT]"))throw b.create("no-app",{appName:e});return n[e]}function c(o){const s=o.name;if(r.has(s))return y.debug(`There were multiple attempts to register component ${s}.`),"PUBLIC"===o.type?i[s]:null;if(r.set(s,o),"PUBLIC"===o.type){const n=(e=a())=>{if("function"!=typeof e[s])throw b.create("invalid-app-argument",{appName:s});return e[s]()};void 0!==o.serviceProps&&e(n,o.serviceProps),i[s]=n,t.prototype[s]=function(...e){return this._getService.bind(this,s).apply(this,o.multipleInstances?e:[])}}for(const e of Object.keys(n))n[e]._addComponent(o);return"PUBLIC"===o.type?i[s]:null}return i.default=i,Object.defineProperty(i,"apps",{get:function(){return Object.keys(n).map(e=>n[e])}}),a.App=t,i}
|
214 |
|
215 |
|
216 |
|
217 |
|
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 |
|
225 |
|
226 |
|
227 |
|
228 |
|
229 |
|
230 |
|
231 |
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 | class I{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}
|
247 |
|
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 | (e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null}).filter(e=>e).join(" ")}}
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 | const E=function(){const e=_(v);e.SDK_VERSION=`${e.SDK_VERSION}_LITE`;const t=e.INTERNAL.registerComponent;return e.INTERNAL.registerComponent=function(e){if("PUBLIC"===e.type&&"performance"!==e.name&&"installations"!==e.name)throw Error(`${name} cannot register with the standalone perf instance`);return t(e)},e}();function S(e){return Array.prototype.slice.call(e)}function T(e){return new Promise((function(t,n){e.onsuccess=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function A(e,t,n){var r,i=new Promise((function(i,o){T(r=e[t].apply(e,n)).then(i,o)}));return i.request=r,i}function N(e,t,n){var r=A(e,t,n);return r.then((function(e){if(e)return new D(e,r.request)}))}function O(e,t,n){n.forEach((function(n){Object.defineProperty(e.prototype,n,{get:function(){return this[t][n]},set:function(e){this[t][n]=e}})}))}function C(e,t,n,r){r.forEach((function(r){r in n.prototype&&(e.prototype[r]=function(){return A(this[t],r,arguments)})}))}function k(e,t,n,r){r.forEach((function(r){r in n.prototype&&(e.prototype[r]=function(){return this[t][r].apply(this[t],arguments)})}))}function P(e,t,n,r){r.forEach((function(r){r in n.prototype&&(e.prototype[r]=function(){return N(this[t],r,arguments)})}))}function L(e){this._index=e}function D(e,t){this._cursor=e,this._request=t}function R(e){this._store=e}function j(e){this._tx=e,this.complete=new Promise((function(t,n){e.oncomplete=function(){t()},e.onerror=function(){n(e.error)},e.onabort=function(){n(e.error)}}))}function M(e,t,n){this._db=e,this.oldVersion=t,this.transaction=new j(n)}function $(e){this._db=e}!function(e,t){e.INTERNAL.registerComponent(new s("platform-logger",e=>new I(e),"PRIVATE")),e.registerVersion("@firebase/app","0.6.0",t),e.registerVersion("fire-js","")}(E,"lite"),O(L,"_index",["name","keyPath","multiEntry","unique"]),C(L,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),P(L,"_index",IDBIndex,["openCursor","openKeyCursor"]),O(D,"_cursor",["direction","key","primaryKey","value"]),C(D,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach((function(e){e in IDBCursor.prototype&&(D.prototype[e]=function(){var t=this,n=arguments;return Promise.resolve().then((function(){return t._cursor[e].apply(t._cursor,n),T(t._request).then((function(e){if(e)return new D(e,t._request)}))}))})})),R.prototype.createIndex=function(){return new L(this._store.createIndex.apply(this._store,arguments))},R.prototype.index=function(){return new L(this._store.index.apply(this._store,arguments))},O(R,"_store",["name","keyPath","indexNames","autoIncrement"]),C(R,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),P(R,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),k(R,"_store",IDBObjectStore,["deleteIndex"]),j.prototype.objectStore=function(){return new R(this._tx.objectStore.apply(this._tx,arguments))},O(j,"_tx",["objectStoreNames","mode"]),k(j,"_tx",IDBTransaction,["abort"]),M.prototype.createObjectStore=function(){return new R(this._db.createObjectStore.apply(this._db,arguments))},O(M,"_db",["name","version","objectStoreNames"]),k(M,"_db",IDBDatabase,["deleteObjectStore","close"]),$.prototype.transaction=function(){return new j(this._db.transaction.apply(this._db,arguments))},O($,"_db",["name","version","objectStoreNames"]),k($,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach((function(e){[R,L].forEach((function(t){e in t.prototype&&(t.prototype[e.replace("open","iterate")]=function(){var t=S(arguments),n=t[t.length-1],r=this._store||this._index,i=r[e].apply(r,t.slice(0,-1));i.onsuccess=function(){n(i.result)}})}))})),[L,R].forEach((function(e){e.prototype.getAll||(e.prototype.getAll=function(e,t){var n=this,r=[];return new Promise((function(i){n.iterateCursor(e,(function(e){e?(r.push(e.value),void 0===t||r.length!=t?e.continue():i(r)):i(r)}))}))})}));const B=new r("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function F(e){return e instanceof n&&e.code.includes("request-failed")}
|
280 |
|
281 |
|
282 |
|
283 |
|
284 |
|
285 |
|
286 |
|
287 |
|
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 | function U({projectId:e}){return`https://firebaseinstallations.googleapis.com/v1/projects/${e}/installations`}function q(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function x(e,t){const n=(await t.json()).error;return B.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function H({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function V(e,{refreshToken:t}){const n=H(e);return n.append("Authorization",function(e){return`FIS_v2 ${e}`}
|
296 |
|
297 |
|
298 |
|
299 |
|
300 |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 | (t)),n}async function K(e){const t=await e();return t.status>=500&&t.status<600?e():t}
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 | function z(e){return new Promise(t=>{setTimeout(t,e)})}
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 | const W=/^[cdef][\w-]{21}$/;function J(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const t=function(e){return(t=e,btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")).substr(0,22);var t}
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 |
|
374 |
|
375 |
|
376 |
|
377 | (e);return W.test(t)?t:""}catch(e){return""}}function G(e){return`${e.appName}!${e.appId}`}
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 | const Z=new Map;function Y(e,t){const n=G(e);Q(n,t),function(e,t){const n=ee();n&&n.postMessage({key:e,fid:t});te()}(n,t)}function Q(e,t){const n=Z.get(e);if(n)for(const e of n)e(t)}let X=null;function ee(){return!X&&"BroadcastChannel"in self&&(X=new BroadcastChannel("[Firebase] FID Change"),X.onmessage=e=>{Q(e.data.key,e.data.fid)}),X}function te(){0===Z.size&&X&&(X.close(),X=null)}
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 | const ne="firebase-installations-store";let re=null;function ie(){return re||(re=function(e,t,n){var r=A(indexedDB,"open",[e,t]),i=r.request;return i&&(i.onupgradeneeded=function(e){n&&n(new M(i.result,e.oldVersion,i.transaction))}),r.then((function(e){return new $(e)}))}("firebase-installations-database",1,e=>{switch(e.oldVersion){case 0:e.createObjectStore(ne)}})),re}async function oe(e,t){const n=G(e),r=(await ie()).transaction(ne,"readwrite"),i=r.objectStore(ne),o=await i.get(n);return await i.put(t,n),await r.complete,o&&o.fid===t.fid||Y(e,t.fid),t}async function se(e){const t=G(e),n=(await ie()).transaction(ne,"readwrite");await n.objectStore(ne).delete(t),await n.complete}async function ae(e,t){const n=G(e),r=(await ie()).transaction(ne,"readwrite"),i=r.objectStore(ne),o=await i.get(n),s=t(o);return void 0===s?await i.delete(n):await i.put(s,n),await r.complete,!s||o&&o.fid===s.fid||Y(e,s.fid),s}
|
410 |
|
411 |
|
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 |
|
424 |
|
425 | async function ce(e){let t;const n=await ae(e,n=>{const r=function(e){return pe(e||{fid:J(),registrationStatus:0})}(n),i=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine){const e=Promise.reject(B.create("app-offline"));return{installationEntry:t,registrationPromise:e}}const n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},r=async function(e,t){try{const n=await async function(e,{fid:t}){const n=U(e),r=H(e),i={fid:t,authVersion:"FIS_v2",appId:e.appId,sdkVersion:"w:0.4.6"},o={method:"POST",headers:r,body:JSON.stringify(i)},s=await K(()=>fetch(n,o));if(s.ok){const e=await s.json();return{fid:e.fid||t,registrationStatus:2,refreshToken:e.refreshToken,authToken:q(e.authToken)}}throw await x("Create Installation",s)}(e,t);return oe(e,n)}catch(n){throw F(n)&&409===n.serverCode?await se(e):await oe(e,{fid:t.fid,registrationStatus:0}),n}}(e,n);return{installationEntry:n,registrationPromise:r}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:ue(e)}:{installationEntry:t}}(e,r);return t=i.registrationPromise,i.installationEntry});return""===n.fid?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}async function ue(e){let t=await le(e);for(;1===t.registrationStatus;)await z(100),t=await le(e);if(0===t.registrationStatus){const{installationEntry:t,registrationPromise:n}=await ce(e);return n||t}return t}function le(e){return ae(e,e=>{if(!e)throw B.create("installation-not-found");return pe(e)})}function pe(e){return 1===(t=e).registrationStatus&&t.registrationTime+1e4<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t;
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 | }async function fe({appConfig:e,platformLoggerProvider:t},n){const r=function(e,{fid:t}){return`${U(e)}/${t}/authTokens:generate`}
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 |
|
453 |
|
454 |
|
455 |
|
456 |
|
457 | (e,n),i=V(e,n),o=t.getImmediate({optional:!0});o&&i.append("x-firebase-client",o.getPlatformInfoString());const s={installation:{sdkVersion:"w:0.4.6"}},a={method:"POST",headers:i,body:JSON.stringify(s)},c=await K(()=>fetch(r,a));if(c.ok){return q(await c.json())}throw await x("Generate Auth Token",c)}async function he(e,t=!1){let n;const r=await ae(e.appConfig,r=>{if(!ge(r))throw B.create("not-registered");const i=r.authToken;if(!t&&function(e){return 2===e.requestStatus&&!function(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+36e5}(e)}(i))return r;if(1===i.requestStatus)return n=async function(e,t){let n=await de(e.appConfig);for(;1===n.authToken.requestStatus;)await z(100),n=await de(e.appConfig);const r=n.authToken;return 0===r.requestStatus?he(e,t):r}(e,t),r;{if(!navigator.onLine)throw B.create("app-offline");const t=function(e){const t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}(r);return n=async function(e,t){try{const n=await fe(e,t),r=Object.assign(Object.assign({},t),{authToken:n});return await oe(e.appConfig,r),n}catch(n){if(!F(n)||401!==n.serverCode&&404!==n.serverCode){const n=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await oe(e.appConfig,n)}else await se(e.appConfig);throw n}}(e,t),t}});return n?await n:r.authToken}function de(e){return ae(e,e=>{if(!ge(e))throw B.create("not-registered");const t=e.authToken;return 1===(n=t).requestStatus&&n.requestTime+1e4<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e;var n;
|
458 |
|
459 |
|
460 |
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 |
|
468 |
|
469 |
|
470 |
|
471 |
|
472 |
|
473 | })}function ge(e){return void 0!==e&&2===e.registrationStatus}
|
474 |
|
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 | async function me(e,t=!1){return await async function(e){const{registrationPromise:t}=await ce(e);t&&await t}
|
491 |
|
492 |
|
493 |
|
494 |
|
495 |
|
496 |
|
497 |
|
498 |
|
499 |
|
500 |
|
501 |
|
502 |
|
503 |
|
504 |
|
505 |
|
506 | (e.appConfig),(await he(e,t)).token}async function be(e,t){const n=function(e,{fid:t}){return`${U(e)}/${t}`}
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 |
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 | (e,t),r={method:"DELETE",headers:V(e,t)},i=await K(()=>fetch(n,r));if(!i.ok)throw await x("Delete Installation",i)}
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 |
|
534 |
|
535 |
|
536 |
|
537 |
|
538 |
|
539 | function we({appConfig:e},t){return function(e,t){ee();const n=G(e);let r=Z.get(n);r||(r=new Set,Z.set(n,r)),r.add(t)}(e,t),()=>{!function(e,t){const n=G(e),r=Z.get(n);r&&(r.delete(t),0===r.size&&Z.delete(n),te())}(e,t)}}
|
540 |
|
541 |
|
542 |
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 | function ve(e){return B.create("missing-app-config-values",{valueName:e})}
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 |
|
564 |
|
565 |
|
566 |
|
567 |
|
568 |
|
569 |
|
570 |
|
571 | var ye;(ye=E).INTERNAL.registerComponent(new s("installations",e=>{const t=e.getProvider("app").getImmediate(),n={appConfig:function(e){if(!e||!e.options)throw ve("App Configuration");if(!e.name)throw ve("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw ve(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t),platformLoggerProvider:e.getProvider("platform-logger")};return{app:t,getId:()=>async function(e){const{installationEntry:t,registrationPromise:n}=await ce(e.appConfig);return n?n.catch(console.error):he(e).catch(console.error),t.fid}(n),getToken:e=>me(n,e),delete:()=>async function(e){const{appConfig:t}=e,n=await ae(t,e=>{if(!e||0!==e.registrationStatus)return e});if(n){if(1===n.registrationStatus)throw B.create("delete-pending-registration");if(2===n.registrationStatus){if(!navigator.onLine)throw B.create("app-offline");await be(t,n),await se(t)}}}(n),onIdChange:e=>we(n,e)}},"PUBLIC")),ye.registerVersion("@firebase/installations","0.4.6");const _e=new r("performance","Performance",{"trace started":"Trace {$traceName} was started before.","trace stopped":"Trace {$traceName} is not running.","no window":"Window is not available.","no app id":"App id is not available.","no project id":"Project id is not available.","no api key":"Api key is not available.","invalid cc log":"Attempted to queue invalid cc event","FB not default":"Performance can only start when Firebase app instance is the default one.","RC response not ok":"RC response is not ok","invalid attribute name":"Attribute name {$attributeName} is invalid.","invalid attribute value":"Attribute value {$attributeValue} is invalid.","invalide custom metric name":"Custom metric name {$customMetricName} is invalid"});
|
572 |
|
573 |
|
574 |
|
575 |
|
576 |
|
577 |
|
578 |
|
579 |
|
580 |
|
581 |
|
582 |
|
583 |
|
584 |
|
585 |
|
586 |
|
587 |
|
588 | let Ie,Ee,Se,Te;class Ae{constructor(e){if(this.window=e,!e)throw _e.create("no window");this.performance=e.performance,this.PerformanceObserver=e.PerformanceObserver,this.windowLocation=e.location,this.navigator=e.navigator,this.document=e.document,this.navigator&&this.navigator.cookieEnabled&&(this.localStorage=e.localStorage),e.perfMetrics&&e.perfMetrics.onFirstInputDelay&&(this.onFirstInputDelay=e.perfMetrics.onFirstInputDelay)}getUrl(){return this.windowLocation.href.split("?")[0]}mark(e){this.performance&&this.performance.mark&&this.performance.mark(e)}measure(e,t,n){this.performance&&this.performance.measure&&this.performance.measure(e,t,n)}getEntriesByType(e){return this.performance&&this.performance.getEntriesByType?this.performance.getEntriesByType(e):[]}getEntriesByName(e){return this.performance&&this.performance.getEntriesByName?this.performance.getEntriesByName(e):[]}getTimeOrigin(){return this.performance&&(this.performance.timeOrigin||this.performance.timing.navigationStart)}requiredApisAvailable(){return!!(fetch&&Promise&&this.navigator&&this.navigator.cookieEnabled)}setupObserver(e,t){if(!this.PerformanceObserver)return;new this.PerformanceObserver(e=>{for(const n of e.getEntries())t(n)}).observe({entryTypes:[e]})}static getInstance(){return void 0===Ie&&(Ie=new Ae(Ee)),Ie}}class Ne{constructor(){this.instrumentationEnabled=!0,this.dataCollectionEnabled=!0,this.loggingEnabled=!1,this.tracesSamplingRate=1,this.networkRequestsSamplingRate=1,this.logEndPointUrl="https://firebaselogging.googleapis.com/v0cc/log?format=json_proto",this.logSource=462,this.logTraceAfterSampling=!1,this.logNetworkAfterSampling=!1,this.configTimeToLive=12}getAppId(){const e=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.appId;if(!e)throw _e.create("no app id");return e}getProjectId(){const e=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.projectId;if(!e)throw _e.create("no project id");return e}getApiKey(){const e=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.apiKey;if(!e)throw _e.create("no api key");return e}static getInstance(){return void 0===Se&&(Se=new Ne),Se}}
|
589 |
|
590 |
|
591 |
|
592 |
|
593 |
|
594 |
|
595 |
|
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 | function Oe(){return Te}
|
605 |
|
606 |
|
607 |
|
608 |
|
609 |
|
610 |
|
611 |
|
612 |
|
613 |
|
614 |
|
615 |
|
616 |
|
617 |
|
618 |
|
619 |
|
620 |
|
621 | var Ce;!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.VISIBLE=1]="VISIBLE",e[e.HIDDEN=2]="HIDDEN"}(Ce||(Ce={}));const ke=["firebase_","google_","ga_"],Pe=new RegExp("^[a-zA-Z]\\w*$");function Le(){const e=Ae.getInstance().navigator;return"serviceWorker"in e?e.serviceWorker.controller?2:3:1}function De(){switch(Ae.getInstance().document.visibilityState){case"visible":return Ce.VISIBLE;case"hidden":return Ce.HIDDEN;default:return Ce.UNKNOWN}}function Re(){const e=Ae.getInstance().navigator.connection;switch(e&&e.effectiveType){case"slow-2g":return 1;case"2g":return 2;case"3g":return 3;case"4g":return 4;default:return 0}}
|
622 |
|
623 |
|
624 |
|
625 |
|
626 |
|
627 |
|
628 |
|
629 |
|
630 |
|
631 |
|
632 |
|
633 |
|
634 |
|
635 |
|
636 |
|
637 |
|
638 | const je=new g("Performance");je.logLevel=l.INFO;
|
639 |
|
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 |
|
646 |
|
647 |
|
648 |
|
649 |
|
650 |
|
651 |
|
652 |
|
653 |
|
654 |
|
655 | const Me=!0;function $e(e){const t=function(){const e=Ae.getInstance().localStorage;if(!e)return;const t=e.getItem("@firebase/performance/configexpire");if(!(t&&(n=t,Number(n)>Date.now())))return;var n;const r=e.getItem("@firebase/performance/config");if(!r)return;try{return JSON.parse(r)}catch(e){return}}();return t?(Be(t),Promise.resolve()):function(e){return function(){const e=Ne.getInstance().installationsService.getToken();return e.then(e=>{}),e}().then(t=>{const n=`https://firebaseremoteconfig.googleapis.com/v1/projects/${Ne.getInstance().getProjectId()}/namespaces/fireperf:fetch?key=${Ne.getInstance().getApiKey()}`,r=new Request(n,{method:"POST",headers:{Authorization:`FIREBASE_INSTALLATIONS_AUTH ${t}`},body:JSON.stringify({app_instance_id:e,app_instance_id_token:t,app_id:Ne.getInstance().getAppId(),app_version:"0.2.36",sdk_version:"0.0.1"})});return fetch(r).then(e=>{if(e.ok)return e.json();throw _e.create("RC response not ok")})}).catch(()=>{je.info("Could not fetch config, will use default configs")})}(e).then(e=>Be(e)).then(e=>function(e){const t=Ae.getInstance().localStorage;if(!e||!t)return;t.setItem("@firebase/performance/config",JSON.stringify(e)),t.setItem("@firebase/performance/configexpire",String(Date.now()+60*Ne.getInstance().configTimeToLive*60*1e3))}(e),()=>{})}function Be(e){if(!e)return e;const t=Ne.getInstance(),n=e.entries||{};return void 0!==n.fpr_enabled?t.loggingEnabled="true"===String(n.fpr_enabled):t.loggingEnabled=Me,n.fpr_log_source&&(t.logSource=Number(n.fpr_log_source)),n.fpr_log_endpoint_url&&(t.logEndPointUrl=n.fpr_log_endpoint_url),void 0!==n.fpr_vc_network_request_sampling_rate&&(t.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate)),void 0!==n.fpr_vc_trace_sampling_rate&&(t.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate)),t.logTraceAfterSampling=Fe(t.tracesSamplingRate),t.logNetworkAfterSampling=Fe(t.networkRequestsSamplingRate),e}function Fe(e){return Math.random()<=e}
|
656 |
|
657 |
|
658 |
|
659 |
|
660 |
|
661 |
|
662 |
|
663 |
|
664 |
|
665 |
|
666 |
|
667 |
|
668 |
|
669 |
|
670 |
|
671 | let Ue,qe=1;function xe(){return qe=2,Ue=Ue||function(){const e=Ae.getInstance().document;return new Promise(t=>{if(e&&"complete"!==e.readyState){const n=()=>{"complete"===e.readyState&&(e.removeEventListener("readystatechange",n),t())};e.addEventListener("readystatechange",n)}else t()})}().then(()=>function(){const e=Ne.getInstance().installationsService.getId();return e.then(e=>{Te=e}),e}()).then(e=>$e(e)).then(()=>He(),()=>He()),Ue}function He(){qe=3}
|
672 |
|
673 |
|
674 |
|
675 |
|
676 |
|
677 |
|
678 |
|
679 |
|
680 |
|
681 |
|
682 |
|
683 |
|
684 |
|
685 |
|
686 |
|
687 | let Ve,Ke=3,ze=[],We=!1;function Je(){We||(!function e(t){setTimeout(()=>{if(0===Ke)return;if(!ze.length)return e(1e4);const t=[...ze];ze=[];const n=t.map(e=>({source_extension_json_proto3:e.message,event_time_ms:String(e.eventTime)})),r={request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:Ne.getInstance().logSource,log_event:n};fetch(Ne.getInstance().logEndPointUrl,{method:"POST",body:JSON.stringify(r)}).then(e=>(e.ok||je.info("Call to Firebase backend failed."),e.json())).then(t=>{const n=Number(t.next_request_wait_millis),r=isNaN(n)?1e4:Math.max(1e4,n);Ke=3,e(r)}).catch(()=>{ze=[...t,...ze],Ke--,je.info(`Tries left: ${Ke}.`),e(1e4)})},t)}(5500),We=!0)}function Ge(e){return(...t)=>{!function(e){if(!e.eventTime||!e.message)throw _e.create("invalid cc log");ze=[...ze,e]}({message:e(...t),eventTime:Date.now()})}}
|
688 |
|
689 |
|
690 |
|
691 |
|
692 |
|
693 |
|
694 |
|
695 |
|
696 |
|
697 |
|
698 |
|
699 |
|
700 |
|
701 |
|
702 |
|
703 | function Ze(e,t){Ve||(Ve=Ge(Xe)),Ve(e,t)}function Ye(e){const t=Ne.getInstance();!t.instrumentationEnabled&&e.isAuto||(t.dataCollectionEnabled||e.isAuto)&&Ae.getInstance().requiredApisAvailable()&&(e.isAuto&&De()!==Ce.VISIBLE||t.loggingEnabled&&t.logTraceAfterSampling&&(3===qe?Qe(e):xe().then(()=>Qe(e),()=>Qe(e))))}function Qe(e){Oe()&&setTimeout(()=>Ze(e,1),0)}function Xe(e,t){return 0===t?function(e){const t={url:e.url,http_method:e.httpMethod||0,http_response_code:200,response_payload_bytes:e.responsePayloadBytes,client_start_time_us:e.startTimeUs,time_to_response_initiated_us:e.timeToResponseInitiatedUs,time_to_response_completed_us:e.timeToResponseCompletedUs},n={application_info:et(),network_request_metric:t};return JSON.stringify(n)}(e):function(e){const t={name:e.name,is_auto:e.isAuto,client_start_time_us:e.startTimeUs,duration_us:e.durationUs};0!==Object.keys(e.counters).length&&(t.counters=e.counters);const n=e.getAttributes();0!==Object.keys(n).length&&(t.custom_attributes=n);const r={application_info:et(),trace_metric:t};return JSON.stringify(r)}(e)}function et(){return{google_app_id:Ne.getInstance().getAppId(),app_instance_id:Oe(),web_app_info:{sdk_version:"0.2.36",page_url:Ae.getInstance().getUrl(),service_worker_status:Le(),visibility_state:De(),effective_connection_type:Re()},application_process_state:0}}
|
704 |
|
705 |
|
706 |
|
707 |
|
708 |
|
709 |
|
710 |
|
711 |
|
712 |
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 | const tt=["_fp","_fcp","_fid"];
|
720 |
|
721 |
|
722 |
|
723 |
|
724 |
|
725 |
|
726 |
|
727 |
|
728 |
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 | class nt{constructor(e,t=!1,n){this.name=e,this.isAuto=t,this.state=1,this.customAttributes={},this.counters={},this.api=Ae.getInstance(),this.randomId=Math.floor(1e6*Math.random()),this.isAuto||(this.traceStartMark=`FB-PERF-TRACE-START-${this.randomId}-${this.name}`,this.traceStopMark=`FB-PERF-TRACE-STOP-${this.randomId}-${this.name}`,this.traceMeasure=n||`FB-PERF-TRACE-MEASURE-${this.randomId}-${this.name}`,n&&this.calculateTraceMetrics())}start(){if(1!==this.state)throw _e.create("trace started",{traceName:this.name});this.api.mark(this.traceStartMark),this.state=2}stop(){if(2!==this.state)throw _e.create("trace stopped",{traceName:this.name});this.state=3,this.api.mark(this.traceStopMark),this.api.measure(this.traceMeasure,this.traceStartMark,this.traceStopMark),this.calculateTraceMetrics(),Ye(this)}record(e,t,n){if(this.durationUs=Math.floor(1e3*t),this.startTimeUs=Math.floor(1e3*e),n&&n.attributes&&(this.customAttributes=Object.assign({},n.attributes)),n&&n.metrics)for(const e of Object.keys(n.metrics))isNaN(Number(n.metrics[e]))||(this.counters[e]=Number(Math.floor(n.metrics[e])));Ye(this)}incrementMetric(e,t=1){void 0===this.counters[e]&&this.putMetric(e,0),this.counters[e]+=t}putMetric(e,t){if(!function(e,t){return!(0===e.length||e.length>100)&&(t&&t.startsWith("_wt_")&&tt.indexOf(e)>-1||!e.startsWith("_"))}(e,this.name))throw _e.create("invalide custom metric name",{customMetricName:e});this.counters[e]=t}getMetric(e){return this.counters[e]||0}putAttribute(e,t){const n=function(e){return!(0===e.length||e.length>40)&&(!ke.some(t=>e.startsWith(t))&&!!e.match(Pe))}(e),r=function(e){return 0!==e.length&&e.length<=100}(t);if(n&&r)this.customAttributes[e]=t;else{if(!n)throw _e.create("invalid attribute name",{attributeName:e});if(!r)throw _e.create("invalid attribute value",{attributeValue:t})}}getAttribute(e){return this.customAttributes[e]}removeAttribute(e){void 0!==this.customAttributes[e]&&delete this.customAttributes[e]}getAttributes(){return Object.assign({},this.customAttributes)}setStartTime(e){this.startTimeUs=e}setDuration(e){this.durationUs=e}calculateTraceMetrics(){const e=this.api.getEntriesByName(this.traceMeasure),t=e&&e[0];t&&(this.durationUs=Math.floor(1e3*t.duration),this.startTimeUs=Math.floor(1e3*(t.startTime+this.api.getTimeOrigin())))}static createOobTrace(e,t,n){const r=Ae.getInstance().getUrl();if(!r)return;const i=new nt("_wt_"+r,!0),o=Math.floor(1e3*Ae.getInstance().getTimeOrigin());i.setStartTime(o),e&&e[0]&&(i.setDuration(Math.floor(1e3*e[0].duration)),i.putMetric("domInteractive",Math.floor(1e3*e[0].domInteractive)),i.putMetric("domContentLoadedEventEnd",Math.floor(1e3*e[0].domContentLoadedEventEnd)),i.putMetric("loadEventEnd",Math.floor(1e3*e[0].loadEventEnd)));if(t){const e=t.find(e=>"first-paint"===e.name);e&&e.startTime&&i.putMetric("_fp",Math.floor(1e3*e.startTime));const r=t.find(e=>"first-contentful-paint"===e.name);r&&r.startTime&&i.putMetric("_fcp",Math.floor(1e3*r.startTime)),n&&i.putMetric("_fid",Math.floor(1e3*n))}Ye(i)}static createUserTimingTrace(e){Ye(new nt(e,!1,e))}}
|
737 |
|
738 |
|
739 |
|
740 |
|
741 |
|
742 |
|
743 |
|
744 |
|
745 |
|
746 |
|
747 |
|
748 |
|
749 |
|
750 |
|
751 |
|
752 | function rt(e){const t=e;if(!t||void 0===t.responseStart)return;const n=Ae.getInstance().getTimeOrigin(),r=Math.floor(1e3*(t.startTime+n)),i=t.responseStart?Math.floor(1e3*(t.responseStart-t.startTime)):void 0,o=Math.floor(1e3*(t.responseEnd-t.startTime));!function(e){const t=Ne.getInstance();t.instrumentationEnabled&&e.url!==t.logEndPointUrl.split("?")[0]&&t.loggingEnabled&&t.logNetworkAfterSampling&&setTimeout(()=>Ze(e,0),0)}({url:t.name&&t.name.split("?")[0],responsePayloadBytes:t.transferSize,startTimeUs:r,timeToResponseInitiatedUs:i,timeToResponseCompletedUs:o})}
|
753 |
|
754 |
|
755 |
|
756 |
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 |
|
768 | function it(){Oe()&&(setTimeout(()=>function(){const e=Ae.getInstance(),t=e.getEntriesByType("navigation"),n=e.getEntriesByType("paint");if(e.onFirstInputDelay){let r=setTimeout(()=>{nt.createOobTrace(t,n),r=void 0},5e3);e.onFirstInputDelay(e=>{r&&(clearTimeout(r),nt.createOobTrace(t,n,e))})}else nt.createOobTrace(t,n)}(),0),setTimeout(()=>function(){const e=Ae.getInstance(),t=e.getEntriesByType("resource");for(const e of t)rt(e);e.setupObserver("resource",rt)}(),0),setTimeout(()=>function(){const e=Ae.getInstance(),t=e.getEntriesByType("measure");for(const e of t)ot(e);e.setupObserver("measure",ot)}(),0))}function ot(e){const t=e.name;"FB-PERF-TRACE-MEASURE"!==t.substring(0,"FB-PERF-TRACE-MEASURE".length)&&nt.createUserTimingTrace(t)}
|
769 |
|
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 |
|
784 | class st{constructor(e){this.app=e,Ae.getInstance().requiredApisAvailable()?(Je(),xe().then(it,it)):je.info("Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled.")}trace(e){return new nt(e)}set instrumentationEnabled(e){Ne.getInstance().instrumentationEnabled=e}get instrumentationEnabled(){return Ne.getInstance().instrumentationEnabled}set dataCollectionEnabled(e){Ne.getInstance().dataCollectionEnabled=e}get dataCollectionEnabled(){return Ne.getInstance().dataCollectionEnabled}}
|
785 |
|
786 |
|
787 |
|
788 |
|
789 |
|
790 |
|
791 |
|
792 |
|
793 |
|
794 |
|
795 |
|
796 |
|
797 |
|
798 |
|
799 |
|
800 | !function(e){const t=(e,t)=>{if("[DEFAULT]"!==e.name)throw _e.create("FB not default");if("undefined"==typeof window)throw _e.create("no window");return function(e){Ee=e}
|
801 |
|
802 |
|
803 |
|
804 |
|
805 |
|
806 |
|
807 |
|
808 |
|
809 |
|
810 |
|
811 |
|
812 |
|
813 |
|
814 |
|
815 |
|
816 | (window),Ne.getInstance().firebaseAppInstance=e,Ne.getInstance().installationsService=t,new st(e)};e.INTERNAL.registerComponent(new s("performance",e=>{const n=e.getProvider("app").getImmediate(),r=e.getProvider("installations").getImmediate();return t(n,r)},"PUBLIC")),e.registerVersion("@firebase/performance","0.2.36")}(E);
|
817 |
|
818 |
|
819 |
|
820 |
|
821 |
|
822 |
|
823 |
|
824 |
|
825 |
|
826 |
|
827 |
|
828 |
|
829 |
|
830 |
|
831 |
|
832 |
|
833 | return E.registerVersion("firebase","7.13.1","lite"),E}));
|
834 |
|