1import{g as y,_ as S,a as N,d as W,E as Y,i as L,b as x,c as O,v as k,L as q,e as E,C as _,r as C,f as D,F as H}from"./main-hfaOl_YE.js";import"./index.esm-BdsMmqjB.js";/** 2 * @license 3 * Copyright 2019 Google LLC 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */const I="analytics",V="firebase_id",J="origin",Q=60*1e3,X="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig",A="https://www.googletagmanager.com/gtag/js";/** 17 * @license 18 * Copyright 2019 Google LLC 19 * 20 * Licensed under the Apache License, Version 2.0 (the "License"); 21 * you may not use this file except in compliance with the License. 22 * You may obtain a copy of the License at 23 * 24 * http://www.apache.org/licenses/LICENSE-2.0 25 * 26 * Unless required by applicable law or agreed to in writing, software 27 * distributed under the License is distributed on an "AS IS" BASIS, 28 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 29 * See the License for the specific language governing permissions and 30 * limitations under the License. 31 */const d=new q("@firebase/analytics");/** 32 * @license 33 * Copyright 2019 Google LLC 34 * 35 * Licensed under the Apache License, Version 2.0 (the "License"); 36 * you may not use this file except in compliance with the License. 37 * You may obtain a copy of the License at 38 * 39 * http://www.apache.org/licenses/LICENSE-2.0 40 * 41 * Unless required by applicable law or agreed to in writing, software 42 * distributed under the License is distributed on an "AS IS" BASIS, 43 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44 * See the License for the specific language governing permissions and 45 * limitations under the License. 46 */const Z={"already-exists":"A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"no-client-id":'The "client_id" field is empty.',"invalid-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."},f=new Y("analytics","Analytics",Z);/** 47 * @license 48 * Copyright 2019 Google LLC 49 * 50 * Licensed under the Apache License, Version 2.0 (the "License");
51 * you may not use this file except in compliance with the License. 52 * You may obtain a copy of the License at 53 * 54 * http://www.apache.org/licenses/LICENSE-2.0 55 * 56 * Unless required by applicable law or agreed to in writing, software 57 * distributed under the License is distributed on an "AS IS" BASIS, 58 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 59 * See the License for the specific language governing permissions and 60 * limitations under the License. 61 */function ee(e){if(!e.startsWith(A)){const t=f.create("invalid-gtag-resource",{gtagURL:e});return d.warn(t.message),""}return e}function z(e){return Promise.all(e.map(t=>t.catch(n=>n)))}function te(e,t){let n;return window.trustedTypes&&(n=window.trustedTypes.createPolicy(e,t)),n}function ne(e,t){const n=te("firebase-js-sdk-policy",{createScriptURL:ee}),a=document.createElement("script"),i=`${A}?l=${e}&id=${t}`;a.src=n?n==null?void 0:n.createScriptURL(i):i,a.async=!0,document.head.appendChild(a)}function ie(e){let t=[];return Array.isArray(window[e])?t=window[e]:window[e]=t,t}async function ae(e,t,n,a,i,s){const r=a[i];try{if(r)await t[r];else{const c=(await z(n)).find(l=>l.measurementId===i);c&&await t[c.appId]}}catch(o){d.error(o)}e("config",i,s)}async function se(e,t,n,a,i){try{let s=[];if(i&&i.send_to){let r=i.send_to;Array.isArray(r)||(r=[r]);const o=await z(n);for(const c of r){const l=o.find(m=>m.measurementId===c),h=l&&t[l.appId];if(h)s.push(h);else{s=[];break}}}s.length===0&&(s=Object.values(t)),await Promise.all(s),e("event",a,i||{})}catch(s){d.error(s)}}function re(e,t,n,a){async function i(s,...r){try{if(s==="event"){const[o,c]=r;await se(e,t,n,o,c)}else if(s==="config"){const[o,c]=r;await ae(e,t,n,a,o,c)}else if(s==="consent"){const[o,c]=r;e("consent",o,c)}else if(s==="get"){const[o,c,l]=r;e("get",o,c,l)}else if(s==="set"){const[o]=r;e("set",o)}else e(s,...r)}catch(o){d.error(o)}}return i}function oe(e,t,n,a,i){let s=function(...r){window[a].push(arguments)};return window[i]&&typeof window[i]=="function"&&(s=window[i]),window[i]=re(s,e,t,n),{gtagCore:s,wrappedGtag:window[i]}}function ce(e){const t=window.document.getElementsByTagName("script");for(const n of Object.values(t))if(n.src&&n.src.includes(A)&&n.src.includes(e))return n;return null}/** 62 * @license 63 * Copyright 2020 Google LLC 64 * 65 * Licensed under the Apache License, Version 2.0 (the "License"); 66 * you may not use this file except in compliance with the License. 67 * You may obtain a copy of the License at 68 * 69 * http://www.apache.org/licenses/LICENSE-2.0 70 * 71 * Unless required by applicable law or agreed to in writing, software 72 * distributed under the License is distributed on an "AS IS" BASIS, 73 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 74 * See the License for the specific language governing permissions and 75 * limitations under the License. 76 */const le=30,de=1e3;class fe{constructor(t={},n=de){this.throttleMetadata=t,this.intervalMillis=n}getThrottleMetadata(t){return this.throttleMetadata[t]}setThrottleMetadata(t,n){this.throttleMetadata[t]=n}deleteThrottleMetadata(t){delete this.throttleMetadata[t]}}const G=new fe;function ue(e){return new Headers({Accept:"application/json","x-goog-api-key":e})}async function pe(e){var r;const{appId:t,apiKey:n}=e,a={method:"GET",headers:ue(n)},i=X.replace("{app-id}",t),s=await fetch(i,a);if(s.status!==200&&s.status!==304){let o="";try{const c=await s.json();(r=c.error)!=null&&r.message&&(o=c.error.message)}catch{}throw f.create("config-fetch-failed",{httpStatus:s.status,responseMessage:o})}return s.json()}async function me(e,t=G,n){const{appId:a,apiKey:i,measurementId:s}=e.options;if(!a)throw f.create("no-app-id");if(!i){if(s)return{measurementId:s,appId:a};throw f.create("no-api-key")}const r=t.getThrottleMetadata(a)||{backoffCount:0,throttleEndTimeMillis:Date.now()},o=new ye;return setTimeout(async()=>{o.abort()},Q),U({appId:a,apiKey:i,measurementId:s},r,o,t)}async function U(e,{throttleEndTimeMillis:t,backoffCount:n},a,i=G){var o;const{appId:s,measurementId:r}=e;try{await he(a,t)}catch(c){if(r)return d.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${r} provided in the "measurementId" field in the local Firebase config. [${c==null?void 0:c.message}
76]`),{appId:s,measurementId:r};throw c}try{const c=await pe(e);return i.deleteThrottleMetadata(s),c}catch(c){const l=c;if(!ge(l)){if(i.deleteThrottleMetadata(s),r)return d.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${r} provided in the "measurementId" field in the local Firebase config. [${l==null?void 0:l.message}]`),{appId:s,measurementId:r};throw c}const h=Number((o=l==null?void 0:l.customData)==null?void 0:o.httpStatus)===503?D(n,i.intervalMillis,le):D(n,i.intervalMillis),m={throttleEndTimeMillis:Date.now()+h,backoffCount:n+1};return i.setThrottleMetadata(s,m),d.debug(`Calling attemptFetch again in ${h} millis`),U(e,m,a,i)}}function he(e,t){return new Promise((n,a)=>{const i=Math.max(t-Date.now(),0),s=setTimeout(n,i);e.addEventListener(()=>{clearTimeout(s),a(f.create("fetch-throttle",{throttleEndTimeMillis:t}))})})}function ge(e){if(!(e instanceof H)||!e.customData)return!1;const t=Number(e.customData.httpStatus);return t===429||t===500||t===503||t===504}class ye{constructor(){this.listeners=[]}addEventListener(t){this.listeners.push(t)}abort(){this.listeners.forEach(t=>t())}}/** 77 * @license 78 * Copyright 2019 Google LLC 79 * 80 * Licensed under the Apache License, Version 2.0 (the "License"); 81 * you may not use this file except in compliance with the License. 82 * You may obtain a copy of the License at 83 * 84 * http://www.apache.org/licenses/LICENSE-2.0 85 * 86 * Unless required by applicable law or agreed to in writing, software 87 * distributed under the License is distributed on an "AS IS" BASIS, 88 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 89 * See the License for the specific language governing permissions and 90 * limitations under the License. 91 */let b;async function we(e,t,n,a,i){if(i&&i.global){e("event",n,a);return}else{const s=await t,r={...a,send_to:s};e("event",n,r)}}async function Ie(e,t,n,a){if(a&&a.global)return e("set",{screen_name:n}),Promise.resolve();{const i=await t;e("config",i,{update:!0,screen_name:n})}}async function be(e,t,n,a){if(a&&a.global)return e("set",{user_id:n}),Promise.resolve();{const i=await t;e("config",i,{update:!0,user_id:n})}}async function ve(e,t,n,a){if(a&&a.global){const i={};for(const s of Object.keys(n))i[`user_properties.${s}`]=n[s];return e("set",i),Promise.resolve()}else{const i=await t;e("config",i,{update:!0,user_properties:n})}}async function Te(e,t){const n=await t;return new Promise((a,i)=>{e("get",n,"client_id",s=>{s||i(f.create("no-client-id")),a(s)})})}async function Ae(e,t){const n=await e;window[`ga-disable-${n}`]=!t}let v;function B(e){v=e}function j(e){b=e}/** 92 * @license 93 * Copyright 2020 Google LLC 94 * 95 * Licensed under the Apache License, Version 2.0 (the "License"); 96 * you may not use this file except in compliance with the License. 97 * You may obtain a copy of the License at 98 * 99 * http://www.apache.org/licenses/LICENSE-2.0 100 * 101 * Unless required by applicable law or agreed to in writing, software 102 * distributed under the License is distributed on an "AS IS" BASIS, 103 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 104 * See the License for the specific language governing permissions and 105 * limitations under the License. 106 */async function Ee(){if(O())try{await k()}catch(e){return d.warn(f.create("indexeddb-unavailable",{errorInfo:e==null?void 0:e.toString()}).message),!1}else return d.warn(f.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;return!0}async function _e(e,t,n,a,i,s,r){const o=me(e);o.then(g=>{n[g.measurementId]=g.appId,e.options.measurementId&&g.measurementId!==e.options.measurementId&&d.warn(`The measurement ID in the local Firebase config (${e.options.measurementId}) does not match the measurement ID fetched from the server (${g.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(g=>d.error(g)),t.push(o);const c=Ee().then(g=>{if(g)return a.getId()}),[l,h]=await Promise.all([o,c]);ce(s)||ne(s,l.measurementId),v&&(i("consent","default",v),B(void 0)),i("js",new Date);const m=(r==null?void 0:r.config)??{};return m[J]="firebase",m.update=!0,h!=null&&(m[V]=h),i("config",l.measurementId,m),b&&(i("set",b),j(void 0)),l.measurementId}/** 107 * @license 108 * Copyright 2019 Google LLC 109 * 110 * Licensed under the Apache License, Version 2.0 (the "License");
111 * you may not use this file except in compliance with the License. 112 * You may obtain a copy of the License at 113 * 114 * http://www.apache.org/licenses/LICENSE-2.0 115 * 116 * Unless required by applicable law or agreed to in writing, software 117 * distributed under the License is distributed on an "AS IS" BASIS, 118 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 119 * See the License for the specific language governing permissions and 120 * limitations under the License. 121 */class Ce{constructor(t){this.app=t}_delete(){return delete u[this.app.options.appId],Promise.resolve()}}let u={},M=[];const P={};let w="dataLayer",K="gtag",R,p,T=!1;function xe(e){if(T)throw f.create("already-initialized");e.dataLayerName&&(w=e.dataLayerName),e.gtagName&&(K=e.gtagName)}function De(){const e=[];if(L()&&e.push("This is a browser extension environment."),x()||e.push("Cookies are not available."),e.length>0){const t=e.map((a,i)=>`(${i+1}) ${a}`).join(" "),n=f.create("invalid-analytics-context",{errorInfo:t});d.warn(n.message)}}function Me(e,t,n){De();const a=e.options.appId;if(!a)throw f.create("no-app-id");if(!e.options.apiKey)if(e.options.measurementId)d.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${e.options.measurementId} provided in the "measurementId" field in the local Firebase config.`);else throw f.create("no-api-key");if(u[a]!=null)throw f.create("already-exists",{id:a});if(!T){ie(w);const{wrappedGtag:s,gtagCore:r}=oe(u,M,P,w,K);p=s,R=r,T=!0}return u[a]=_e(e,M,P,t,R,w,n),new Ce(e)}/** 122 * @license 123 * Copyright 2020 Google LLC 124 * 125 * Licensed under the Apache License, Version 2.0 (the "License"); 126 * you may not use this file except in compliance with the License. 127 * You may obtain a copy of the License at 128 * 129 * http://www.apache.org/licenses/LICENSE-2.0 130 * 131 * Unless required by applicable law or agreed to in writing, software 132 * distributed under the License is distributed on an "AS IS" BASIS, 133 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 134 * See the License for the specific language governing permissions and 135 * limitations under the License. 136 */function Oe(e=N()){e=y(e);const t=S(e,I);return t.isInitialized()?t.getImmediate():Pe(e)}function Pe(e,t={}){const n=S(e,I);if(n.isInitialized()){const i=n.getImmediate();if(W(t,n.getOptions()))return i;throw f.create("already-initialized")}return n.initialize({options:t})}async function ke(){if(L()||!x()||!O())return!1;try{return await k()}catch{return!1}}function ze(e,t,n){e=y(e),Ie(p,u[e.app.options.appId],t,n).catch(a=>d.error(a))}async function Ge(e){return e=y(e),Te(p,u[e.app.options.appId])}function Ue(e,t,n){e=y(e),be(p,u[e.app.options.appId],t,n).catch(a=>d.error(a))}function Re(e,t,n){e=y(e),ve(p,u[e.app.options.appId],t,n).catch(a=>d.error(a))}function Be(e,t){e=y(e),Ae(u[e.app.options.appId],t).catch(n=>d.error(n))}function je(e){p?p("set",e):j(e)}function Fe(e,t,n,a){e=y(e),we(p,u[e.app.options.appId],t,n,a).catch(i=>d.error(i))}function Ke(e){p?p("consent","update",e):B(e)}const F="@firebase/analytics",$="0.10.24";/** 137 * @license 138 * Copyright 2019 Google LLC 139 * 140 * Licensed under the Apache License, Version 2.0 (the "License"); 141 * you may not use this file except in compliance with the License. 142 * You may obtain a copy of the License at 143 * 144 * http://www.apache.org/licenses/LICENSE-2.0 145 * 146 * Unless required by applicable law or agreed to in writing, software 147 * distributed under the License is distributed on an "AS IS" BASIS, 148 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 149 * See the License for the specific language governing permissions and 150 * limitations under the License. 151 */function $e(){E(new _(I,(t,{options:n})=>{const a=t.getProvider("app").getImmediate(),i=t.getProvider("installations-internal").getImmediate();return Me(a,i,n)},"PUBLIC")),E(new _("analytics-internal",e,"PRIVATE")),C(F,$),C(F,$,"esm2020");function e(t){try{const n=t.getProvider(I).getImmediate();return{logEvent:(a,i,s)=>Fe(n,a,i,s),setUserProperties:(a,i)=>Re(n,a,i)}}catch(n){throw f.create("interop-component-reg-failed",{reason:n})}}}$e();export{Oe as getAnalytics,Ge as getGoogleAnalyticsClientId,Pe as initializeAnalytics,ke as isSupported,Fe as logEvent,Be as setAnalyticsCollectionEnabled,Ke as setConsent,ze as setCurrentScreen,je as setDefaultEventParameters,Ue as setUserId,Re as setUserProperties,xe as settings}; 152//# sourceMappingURL=index.esm-nqw3CL7v.js.map
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.