@rpcbase/client 0.214.0 → 0.215.0
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/access-control/ACLForm/components/GrantField/OpSelector.tsx +129 -0
- package/access-control/ACLForm/components/GrantField/ResourceSelector.tsx +86 -0
- package/access-control/ACLForm/components/GrantField/UsersSelector.tsx +96 -0
- package/access-control/ACLForm/components/GrantField/grant-field.scss +26 -0
- package/access-control/ACLForm/components/GrantField/icons/CheckMark.tsx +16 -0
- package/access-control/ACLForm/components/GrantField/icons/CollapseArrow.tsx +14 -0
- package/access-control/ACLForm/components/GrantField/icons/ExpandArrow.tsx +14 -0
- package/access-control/ACLForm/components/GrantField/index.tsx +91 -0
- package/access-control/ACLForm/components/GrantsList.tsx +48 -0
- package/access-control/ACLForm/components/RoleForm.tsx +134 -0
- package/access-control/ACLForm/components/RoleView.tsx +115 -0
- package/access-control/ACLForm/components/RolesList.tsx +79 -0
- package/access-control/ACLForm/components/constants.tsx +1 -0
- package/access-control/ACLForm/components/resolver.ts +57 -0
- package/access-control/ACLForm/components/role-form.scss +19 -0
- package/access-control/ACLForm/index.tsx +48 -0
- package/access-control/ACLModal/acl-modal.scss +7 -0
- package/access-control/ACLModal/index.tsx +66 -0
- package/access-control/index.ts +2 -0
- package/firebase/index.js +1 -1
- package/firebase/sw.js +1 -1
- package/package.json +10 -10
- package/ui/SelectPills/index.tsx +92 -0
- package/ui/SelectPills/select-pills.scss +66 -0
- package/ui/icons/Close.tsx +14 -0
- package/ui/icons/index.tsx +1 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import assert from "assert"
|
|
2
|
+
import {useForm, FormProvider} from "react-hook-form"
|
|
3
|
+
|
|
4
|
+
import FloatingLabel from "react-bootstrap/FloatingLabel"
|
|
5
|
+
import Form from "react-bootstrap/Form"
|
|
6
|
+
|
|
7
|
+
// import {useEnvContext} from "helpers/EnvContext"
|
|
8
|
+
import {CloseIcon} from "../../../ui/icons/Close"
|
|
9
|
+
import {View} from "../../../ui/View"
|
|
10
|
+
|
|
11
|
+
import {resolver} from "./resolver"
|
|
12
|
+
import {GrantsList} from "./GrantsList"
|
|
13
|
+
|
|
14
|
+
// import create_role from "rpc!server/access-control/create_role"
|
|
15
|
+
// import delete_role from "rpc!server/access-control/delete_role"
|
|
16
|
+
|
|
17
|
+
import "./role-form.scss"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export const RoleView = ({role}) => {
|
|
21
|
+
// const envContext = useEnvContext()
|
|
22
|
+
|
|
23
|
+
// const [isLoading, setIsLoading] = useState(false)
|
|
24
|
+
// TODO:
|
|
25
|
+
// react hook form submit on edit
|
|
26
|
+
// https://stackoverflow.com/a/70119332
|
|
27
|
+
const form = useForm({
|
|
28
|
+
defaultValues: {
|
|
29
|
+
...role,
|
|
30
|
+
_isEditing: true,
|
|
31
|
+
},
|
|
32
|
+
resolver,
|
|
33
|
+
reValidateMode: "onChange",
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const {
|
|
37
|
+
register,
|
|
38
|
+
handleSubmit,
|
|
39
|
+
// watch,
|
|
40
|
+
// getValues,
|
|
41
|
+
formState: {errors},
|
|
42
|
+
} = form
|
|
43
|
+
|
|
44
|
+
const onSubmit = async(data) => {
|
|
45
|
+
const {groupId} = envContext
|
|
46
|
+
console.log("roleview submit", groupId, data)
|
|
47
|
+
// setIsLoading(true)
|
|
48
|
+
// const res = await create_role({group_id: groupId, ...data})
|
|
49
|
+
// assert(res.status === "ok")
|
|
50
|
+
// // TODO: error handling here
|
|
51
|
+
// setIsLoading(false)
|
|
52
|
+
// onDone()
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const onClickRemove = async() => {
|
|
56
|
+
// const res = await delete_role({role_id: role._id})
|
|
57
|
+
// assert(res.status === "ok")
|
|
58
|
+
console.log("NYI DELETE ROLE", role._id)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// useEffect(() => {
|
|
62
|
+
// console.log("le vals", getValues())
|
|
63
|
+
// }, [formState])
|
|
64
|
+
|
|
65
|
+
// TODO: WARNING: DANGER: input should be mapped to field id + index to avoid duplicates in form
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<FormProvider {...form}>
|
|
69
|
+
<div className="w-100" style={{position: "relative"}}>
|
|
70
|
+
<form className="mb-1 me-4 card" onSubmit={handleSubmit(onSubmit)}>
|
|
71
|
+
<div className="p-2">
|
|
72
|
+
<div className="d-flex flex-row w-100 mt-1">
|
|
73
|
+
<FloatingLabel controlId="input-name" label="Name" className="me-2">
|
|
74
|
+
<Form.Control type="text" {...register("name")} />
|
|
75
|
+
{errors.name && <div className="text-danger">{errors.name.message}</div>}
|
|
76
|
+
</FloatingLabel>
|
|
77
|
+
|
|
78
|
+
<FloatingLabel
|
|
79
|
+
controlId="input-description"
|
|
80
|
+
label="Description"
|
|
81
|
+
className="flex-grow-1"
|
|
82
|
+
>
|
|
83
|
+
<Form.Control type="text" {...register("description")} />
|
|
84
|
+
{errors.description && (
|
|
85
|
+
<div className="text-danger">{errors.description.message}</div>
|
|
86
|
+
)}
|
|
87
|
+
</FloatingLabel>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
{/* Grants list */}
|
|
91
|
+
<GrantsList />
|
|
92
|
+
</div>
|
|
93
|
+
</form>
|
|
94
|
+
<View
|
|
95
|
+
className="role-remove-button mt-1 me-1"
|
|
96
|
+
onClick={onClickRemove}
|
|
97
|
+
tooltip="Remove Role"
|
|
98
|
+
>
|
|
99
|
+
<CloseIcon size={14} />
|
|
100
|
+
</View>
|
|
101
|
+
</div>
|
|
102
|
+
</FormProvider>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// <label htmlFor="input-role-name" className="h6">
|
|
107
|
+
// Name
|
|
108
|
+
// </label>
|
|
109
|
+
// <input
|
|
110
|
+
// type="text"
|
|
111
|
+
// className={cx("form-control", {"is-invalid": !!errors.name})}
|
|
112
|
+
// id="input-role-name"
|
|
113
|
+
// {...register("name")}
|
|
114
|
+
// placeholder="Role Name"
|
|
115
|
+
// />
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {useState} from "react"
|
|
2
|
+
// import {arrayMoveImmutable} from "array-move"
|
|
3
|
+
|
|
4
|
+
import {DragHandle, SortableContainer, SortableElement} from "../../../ui/sortable-hoc"
|
|
5
|
+
import {useQuery} from "../../../rts"
|
|
6
|
+
|
|
7
|
+
import {RoleForm} from "./RoleForm"
|
|
8
|
+
import {RoleView} from "./RoleView"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const SortableItem = SortableElement(({value, index, active, onClick}) => (
|
|
12
|
+
<div id={`${value._id}-role-list-item-${index}`} className="d-block px-1 py-2">
|
|
13
|
+
<div className={cx(["d-flex", "align-items-start", {active}])} onClick={onClick}>
|
|
14
|
+
<DragHandle variant="dots" className="mt-1" />
|
|
15
|
+
<RoleView role={value} />
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
))
|
|
19
|
+
|
|
20
|
+
const SortableList = SortableContainer(({ref, items, onClickHandler, activeTab, className = ""}) => {
|
|
21
|
+
return (
|
|
22
|
+
<div ref={ref} className={cx(className)}>
|
|
23
|
+
{items.map((value, index) => (
|
|
24
|
+
<SortableItem
|
|
25
|
+
key={`item-${value._id}`}
|
|
26
|
+
index={index}
|
|
27
|
+
value={value}
|
|
28
|
+
active={`${index}` === activeTab}
|
|
29
|
+
onClick={onClickHandler(`${index}`)}
|
|
30
|
+
/>
|
|
31
|
+
))}
|
|
32
|
+
</div>
|
|
33
|
+
)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
export const RolesList = () => {
|
|
37
|
+
// const [roles, setRoles] = useState([])
|
|
38
|
+
// const rolesQuery = useQuery("ACLRole", {})
|
|
39
|
+
const rolesQuery = {}
|
|
40
|
+
|
|
41
|
+
const [isAddingRole, setIsAddingRole] = useState(false)
|
|
42
|
+
|
|
43
|
+
const onClickAddRole = () => setIsAddingRole(true)
|
|
44
|
+
|
|
45
|
+
const onSortEnd = ({oldIndex, newIndex}) => {
|
|
46
|
+
// setItems(arrayMoveImmutable(items, oldIndex, newIndex))
|
|
47
|
+
console.log("update sort roles", oldIndex, newIndex)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const getOnClickHandler = (arg) => () => {
|
|
51
|
+
console.log("sortable on click handler", arg)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div className="d-block bg-white mb-2">
|
|
56
|
+
{isAddingRole && <RoleForm onDone={() => setIsAddingRole(false)} />}
|
|
57
|
+
|
|
58
|
+
{!isAddingRole && (
|
|
59
|
+
<button className="btn btn-link ms-1" onClick={onClickAddRole}>
|
|
60
|
+
+ Add Role
|
|
61
|
+
</button>
|
|
62
|
+
)}
|
|
63
|
+
|
|
64
|
+
{rolesQuery.data && (
|
|
65
|
+
<SortableList
|
|
66
|
+
className="mt-3"
|
|
67
|
+
axis="y"
|
|
68
|
+
lockAxis={"y"}
|
|
69
|
+
// distance={2} // PUTAIN
|
|
70
|
+
items={rolesQuery.data}
|
|
71
|
+
onSortEnd={onSortEnd}
|
|
72
|
+
onClickHandler={getOnClickHandler}
|
|
73
|
+
transitionDuration={200}
|
|
74
|
+
useDragHandle
|
|
75
|
+
/>
|
|
76
|
+
)}
|
|
77
|
+
</div>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const GRANTS_FIELD = "grants"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import _set from "lodash/set"
|
|
2
|
+
|
|
3
|
+
import {GRANTS_FIELD} from "./constants"
|
|
4
|
+
|
|
5
|
+
const validateGrants = (grants, errors) => {
|
|
6
|
+
grants.forEach((grant, index) => {
|
|
7
|
+
const fieldKey = `${GRANTS_FIELD}.${index}`
|
|
8
|
+
|
|
9
|
+
// Ops
|
|
10
|
+
const ops = grant.ops || {}
|
|
11
|
+
const hasOps = Object.keys(ops).length > 0
|
|
12
|
+
if (!hasOps) {
|
|
13
|
+
const opsErrKey = `${fieldKey}.ops`
|
|
14
|
+
_set(errors, opsErrKey, {type: "error", message: "You must select at least one Operation"})
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Resources
|
|
18
|
+
const resources = grant.resources || {}
|
|
19
|
+
const hasResources = Object.keys(resources).length > 0
|
|
20
|
+
|
|
21
|
+
if (!hasResources) {
|
|
22
|
+
const resErrKey = `${fieldKey}.resources`
|
|
23
|
+
_set(errors, resErrKey, {type: "error", message: "You must select at least one Resource"})
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Users
|
|
27
|
+
const users = grant.users || {}
|
|
28
|
+
const hasUsers = Object.keys(users).length > 0
|
|
29
|
+
|
|
30
|
+
if (!hasUsers) {
|
|
31
|
+
const usersErrKey = `${fieldKey}.users`
|
|
32
|
+
_set(errors, usersErrKey, {type: "error", message: "You must select at least one User"})
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const resolver = (values) => {
|
|
38
|
+
const errors = {}
|
|
39
|
+
|
|
40
|
+
if (!values.name) {
|
|
41
|
+
errors.name = {message: "Please enter a valid name"}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!values.description) {
|
|
45
|
+
errors.description = {message: "Please enter a valid description"}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
validateGrants(values.grants, errors)
|
|
49
|
+
if (values.grants.length === 0) {
|
|
50
|
+
errors.grants = {message: "You must add at least one Grant"}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
values,
|
|
55
|
+
errors,
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@import "helpers";
|
|
2
|
+
|
|
3
|
+
.role-remove-button {
|
|
4
|
+
position: absolute;
|
|
5
|
+
width: 14px;
|
|
6
|
+
height: 14px;
|
|
7
|
+
right: 0;
|
|
8
|
+
top: 0;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
color: $gray-500;
|
|
11
|
+
|
|
12
|
+
&:hover {
|
|
13
|
+
color: $gray-700;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:active {
|
|
17
|
+
color: $gray-900;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {useState} from "react"
|
|
2
|
+
|
|
3
|
+
import {SelectPills} from "../../ui/SelectPills"
|
|
4
|
+
|
|
5
|
+
import {RolesList} from "./components/RolesList"
|
|
6
|
+
|
|
7
|
+
const VISIBILITY_ITEMS = [
|
|
8
|
+
{
|
|
9
|
+
name: "Private",
|
|
10
|
+
key: "private",
|
|
11
|
+
description: "Members cannot discover this group and have to be added manually",
|
|
12
|
+
icon: "/static/icons/acl/acl-visibility-private.svg",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "Public",
|
|
16
|
+
key: "public",
|
|
17
|
+
description: "Members of your organisation will be able to see this group",
|
|
18
|
+
icon: "/static/icons/acl/acl-visibility-public.svg",
|
|
19
|
+
},
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
export const ACLForm = () => {
|
|
23
|
+
const [activeVisibilityKey, setActiveVisibilityKey] = useState("private")
|
|
24
|
+
|
|
25
|
+
const onUpdateGroupVisibility = (k) => setActiveVisibilityKey(k)
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div>
|
|
29
|
+
{/* Visibility */}
|
|
30
|
+
<div className="mx-3">
|
|
31
|
+
<label className="fw-bold mb-1">Group Visibility</label>
|
|
32
|
+
<SelectPills
|
|
33
|
+
direction="row"
|
|
34
|
+
size="sm"
|
|
35
|
+
items={VISIBILITY_ITEMS}
|
|
36
|
+
activeKey={activeVisibilityKey}
|
|
37
|
+
onChange={onUpdateGroupVisibility}
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
{/* Roles */}
|
|
42
|
+
<div>
|
|
43
|
+
<label className="fw-bold mb-1 ms-3">Roles</label>
|
|
44
|
+
<RolesList />
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {useState, useEffect} from "react"
|
|
2
|
+
|
|
3
|
+
import {useHashState} from "../../hashState"
|
|
4
|
+
import Modal from "../../ui/Modal"
|
|
5
|
+
|
|
6
|
+
import {ACLForm} from "../ACLForm"
|
|
7
|
+
|
|
8
|
+
import "./acl-modal.scss"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export const ACLModal = ({}) => {
|
|
12
|
+
const {hashState, serializeHashState} = useHashState()
|
|
13
|
+
|
|
14
|
+
const [isShown, setIsShown] = useState(false)
|
|
15
|
+
|
|
16
|
+
// useEffect(() => {
|
|
17
|
+
// console.log("GOURP", envContext)
|
|
18
|
+
// }, [envContext])
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (hashState.showGroupAccessControlModal) {
|
|
22
|
+
setIsShown(true)
|
|
23
|
+
} else {
|
|
24
|
+
setIsShown(false)
|
|
25
|
+
}
|
|
26
|
+
}, [hashState, setIsShown])
|
|
27
|
+
|
|
28
|
+
const onHide = () => {
|
|
29
|
+
serializeHashState({
|
|
30
|
+
showGroupAccessControlModal: null,
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (!isShown) return null
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Modal className="group-acl-modal" onHide={onHide} size="large">
|
|
38
|
+
<Modal.Header className="close-top" closeButton>
|
|
39
|
+
<img
|
|
40
|
+
width={26}
|
|
41
|
+
height={26}
|
|
42
|
+
style={{marginTop: 0}}
|
|
43
|
+
className="me-2 align-self-start"
|
|
44
|
+
src={`/static/icons/acl-shield.svg`}
|
|
45
|
+
/>
|
|
46
|
+
<div className="">
|
|
47
|
+
<div>
|
|
48
|
+
Permissions for <kbd>wow group name</kbd>
|
|
49
|
+
</div>
|
|
50
|
+
<small className="text-secondary fw-normal">
|
|
51
|
+
Permissions and Grants that control who can see what in your Group
|
|
52
|
+
</small>
|
|
53
|
+
</div>
|
|
54
|
+
</Modal.Header>
|
|
55
|
+
<Modal.Body className="px-0">
|
|
56
|
+
<ACLForm />
|
|
57
|
+
</Modal.Body>
|
|
58
|
+
<Modal.Footer className="justify-content-start">
|
|
59
|
+
Learn more about Access Control and Permissions in
|
|
60
|
+
<a target="_blank" rel="noopener noreferrer" href={`/docs/access-control`}>
|
|
61
|
+
/docs/access-control
|
|
62
|
+
</a>
|
|
63
|
+
</Modal.Footer>
|
|
64
|
+
</Modal>
|
|
65
|
+
)
|
|
66
|
+
}
|
package/firebase/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.r(t),e.d(t,{getMessaging:()=>Vt,getToken:()=>Kt,initializeApp:()=>oe});const n=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},r={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let t=0;t<e.length;t+=3){const i=e[t],a=t+1<e.length,o=a?e[t+1]:0,s=t+2<e.length,c=s?e[t+2]:0,l=i>>2,u=(3&i)<<4|o>>4;let d=(15&o)<<2|c>>6,p=63&c;s||(p=64,a||(d=64)),r.push(n[l],n[u],n[d],n[p])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(n(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){const a=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&a)}else if(i>239&&i<365){const a=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(a>>10)),t[r++]=String.fromCharCode(56320+(1023&a))}else{const a=e[n++],o=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&a)<<6|63&o)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t<e.length;){const a=n[e.charAt(t++)],o=t<e.length?n[e.charAt(t)]:0;++t;const s=t<e.length?n[e.charAt(t)]:64;++t;const c=t<e.length?n[e.charAt(t)]:64;if(++t,null==a||null==o||null==s||null==c)throw new i;const l=a<<2|o>>4;if(r.push(l),64!==s){const e=o<<4&240|s>>2;if(r.push(e),64!==c){const e=s<<6&192|c;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class i extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const a=function(e){return function(e){const t=n(e);return r.encodeByteArray(t,!0)}(e).replace(/\./g,"")},o=()=>{try{return function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e.g)return e.g;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__||(()=>{if("undefined"==typeof process||void 0===process.env)return;const e=process.env.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&function(e){try{return r.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null}(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}},s=()=>{var e;return null===(e=o())||void 0===e?void 0:e.config};class c{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))}}}function l(){try{return"object"==typeof indexedDB}catch(e){return!1}}function u(){return new Promise(((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}}))}class d extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,d.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,p.prototype.create)}}class p{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],a=i?function(e,t){return e.replace(h,((e,n)=>{const r=t[n];return null!=r?String(r):`<${n}?>`}))}(i,n):"Error",o=`${this.serviceName}: ${a} (${r}).`;return new d(r,o,n)}}const h=/\{\$([^}]+)}/g;function f(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const n=e[i],a=t[i];if(g(n)&&g(a)){if(!f(n,a))return!1}else if(n!==a)return!1}for(const e of r)if(!n.includes(e))return!1;return!0}function g(e){return null!==e&&"object"==typeof e}function m(e){return e&&e._delegate?e._delegate:e}class b{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const w="[DEFAULT]";class y{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new c;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),r=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(e){if(r)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,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:w})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e=w){this.instancesDeferred.delete(e),this.instancesOptions.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())),...e.filter((e=>"_delete"in e)).map((e=>e._delete()))])}isComponentSet(){return null!=this.component}isInitialized(e=w){return this.instances.has(e)}getOptions(e=w){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries())n===this.normalizeInstanceIdentifier(e)&&t.resolve(r);return r}onInit(e,t){var n;const r=this.normalizeInstanceIdentifier(t),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(e),this.onInitCallbacks.set(r,i);const a=this.instances.get(r);return a&&e(a,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const r of n)try{r(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(r=e,r===w?void 0:r),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(e){}var r;return n||null}normalizeInstanceIdentifier(e=w){return this.component?this.component.multipleInstances?e:w:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class v{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 y(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}const I=[];var S;!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"}(S||(S={}));const _={debug:S.DEBUG,verbose:S.VERBOSE,info:S.INFO,warn:S.WARN,error:S.ERROR,silent:S.SILENT},E=S.INFO,C={[S.DEBUG]:"log",[S.VERBOSE]:"log",[S.INFO]:"info",[S.WARN]:"warn",[S.ERROR]:"error"},D=(e,t,...n)=>{if(t<e.logLevel)return;const r=(new Date).toISOString(),i=C[t];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[i](`[${r}] ${e.name}:`,...n)},k=(e,t)=>t.some((t=>e instanceof t));let T,A;const O=new WeakMap,P=new WeakMap,N=new WeakMap,j=new WeakMap,M=new WeakMap;let B={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return P.get(e);if("objectStoreNames"===t)return e.objectStoreNames||N.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return $(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function L(e){return"function"==typeof e?(t=e)!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(A||(A=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(R(this),e),$(O.get(this))}:function(...e){return $(t.apply(R(this),e))}:function(e,...n){const r=t.call(R(this),e,...n);return N.set(r,e.sort?e.sort():[e]),$(r)}:(e instanceof IDBTransaction&&function(e){if(P.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",a),e.removeEventListener("abort",a)},i=()=>{t(),r()},a=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",a),e.addEventListener("abort",a)}));P.set(e,t)}(e),k(e,T||(T=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,B):e);var t}function $(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",a)},i=()=>{t($(e.result)),r()},a=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",a)}));return t.then((t=>{t instanceof IDBCursor&&O.set(t,e)})).catch((()=>{})),M.set(t,e),t}(e);if(j.has(e))return j.get(e);const t=L(e);return t!==e&&(j.set(e,t),M.set(t,e)),t}const R=e=>M.get(e);function H(e,t,{blocked:n,upgrade:r,blocking:i,terminated:a}={}){const o=indexedDB.open(e,t),s=$(o);return r&&o.addEventListener("upgradeneeded",(e=>{r($(o.result),e.oldVersion,e.newVersion,$(o.transaction),e)})),n&&o.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),s.then((e=>{a&&e.addEventListener("close",(()=>a())),i&&e.addEventListener("versionchange",(e=>i(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),s}function F(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),$(n).then((()=>{}))}const x=["get","getKey","getAll","getAllKeys","count"],V=["put","add","delete","clear"],K=new Map;function W(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(K.get(t))return K.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=V.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!x.includes(n))return;const a=async function(e,...t){const a=this.transaction(e,i?"readwrite":"readonly");let o=a.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&a.done]))[0]};return K.set(t,a),a}var z;z=B,B={...z,get:(e,t,n)=>W(e,t)||z.get(e,t,n),has:(e,t)=>!!W(e,t)||z.has(e,t)};class U{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)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const q="@firebase/app",G="0.10.11",J=new class{constructor(e){this.name=e,this._logLevel=E,this._logHandler=D,this._userLogHandler=null,I.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in S))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?_[e]: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,S.DEBUG,...e),this._logHandler(this,S.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,S.VERBOSE,...e),this._logHandler(this,S.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,S.INFO,...e),this._logHandler(this,S.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,S.WARN,...e),this._logHandler(this,S.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,S.ERROR,...e),this._logHandler(this,S.ERROR,...e)}}("@firebase/app"),Y="[DEFAULT]",Q={[q]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","@firebase/vertexai-preview":"fire-vertex","fire-js":"fire-js",firebase:"fire-js-all"},X=new Map,Z=new Map,ee=new Map;function te(e,t){try{e.container.addComponent(t)}catch(n){J.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function ne(e){const t=e.name;if(ee.has(t))return J.debug(`There were multiple attempts to register component ${t}.`),!1;ee.set(t,e);for(const t of X.values())te(t,e);for(const t of Z.values())te(t,e);return!0}function re(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}const ie=new p("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","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.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."});class ae{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new b("app",(()=>this),"PUBLIC"))}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}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw ie.create("app-deleted",{appName:this._name})}}function oe(e,t={}){let n=e;"object"!=typeof t&&(t={name:t});const r=Object.assign({name:Y,automaticDataCollectionEnabled:!1},t),i=r.name;if("string"!=typeof i||!i)throw ie.create("bad-app-name",{appName:String(i)});if(n||(n=s()),!n)throw ie.create("no-options");const a=X.get(i);if(a){if(f(n,a.options)&&f(r,a.config))return a;throw ie.create("duplicate-app",{appName:i})}const o=new v(i);for(const e of ee.values())o.addComponent(e);const c=new ae(n,r,o);return X.set(i,c),c}function se(e,t,n){var r;let i=null!==(r=Q[e])&&void 0!==r?r:e;n&&(i+=`-${n}`);const a=i.match(/\s|\//),o=t.match(/\s|\//);if(a||o){const e=[`Unable to register library "${i}" with version "${t}":`];return a&&e.push(`library name "${i}" contains illegal characters (whitespace or "/")`),a&&o&&e.push("and"),o&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void J.warn(e.join(" "))}ne(new b(`${i}-version`,(()=>({library:i,version:t})),"VERSION"))}const ce="firebase-heartbeat-database",le=1,ue="firebase-heartbeat-store";let de=null;function pe(){return de||(de=H(ce,le,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(ue)}catch(e){console.warn(e)}}}).catch((e=>{throw ie.create("idb-open",{originalErrorMessage:e.message})}))),de}async function he(e,t){try{const n=(await pe()).transaction(ue,"readwrite"),r=n.objectStore(ue);await r.put(t,fe(e)),await n.done}catch(e){if(e instanceof d)J.warn(e.message);else{const t=ie.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});J.warn(t.message)}}}function fe(e){return`${e.name}!${e.options.appId}`}class ge{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new be(t),this._heartbeatsCachePromise=this._storage.read().then((e=>(this._heartbeatsCache=e,e)))}async triggerHeartbeat(){var e,t;try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=me();if(null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)))return;if(this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some((e=>e.date===r)))return;return this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter((e=>{const t=new Date(e.date).valueOf();return Date.now()-t<=2592e6})),this._storage.overwrite(this._heartbeatsCache)}catch(e){J.warn(e)}}async getHeartbeatsHeader(){var e;try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const t=me(),{heartbeatsToSend:n,unsentEntries:r}=function(e,t=1024){const n=[];let r=e.slice();for(const i of e){const e=n.find((e=>e.agent===i.agent));if(e){if(e.dates.push(i.date),we(n)>t){e.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),we(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}(this._heartbeatsCache.heartbeats),i=a(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(e){return J.warn(e),""}}}function me(){return(new Date).toISOString().substring(0,10)}class be{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!l()&&u().then((()=>!0)).catch((()=>!1))}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await pe()).transaction(ue),n=await t.objectStore(ue).get(fe(e));return await t.done,n}catch(e){if(e instanceof d)J.warn(e.message);else{const t=ie.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});J.warn(t.message)}}}(this.app);return(null==e?void 0:e.heartbeats)?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return he(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return he(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}function we(e){return a(JSON.stringify({version:2,heartbeats:e})).length}ne(new b("platform-logger",(e=>new U(e)),"PRIVATE")),ne(new b("heartbeat",(e=>new ge(e)),"PRIVATE")),se(q,G,""),se(q,G,"esm2017"),se("fire-js",""),se("firebase","10.13.2","app");const ye="@firebase/installations",ve="0.6.9",Ie=1e4,Se=`w:${ve}`,_e="FIS_v2",Ee="https://firebaseinstallations.googleapis.com/v1",Ce=36e5,De=new p("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 ke(e){return e instanceof d&&e.code.includes("request-failed")}function Te({projectId:e}){return`${Ee}/projects/${e}/installations`}function Ae(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function Oe(e,t){const n=(await t.json()).error;return De.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function Pe({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}async function Ne(e){const t=await e();return t.status>=500&&t.status<600?e():t}function je(e){return new Promise((t=>{setTimeout(t,e)}))}const Me=/^[cdef][\w-]{21}$/,Be="";function Le(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const t=function(e){var t;return(t=e,btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")).substr(0,22)}(e);return Me.test(t)?t:Be}catch(e){return Be}}function $e(e){return`${e.appName}!${e.appId}`}const Re=new Map;function He(e,t){const n=$e(e);Fe(n,t),function(e,t){const n=(!xe&&"BroadcastChannel"in self&&(xe=new BroadcastChannel("[Firebase] FID Change"),xe.onmessage=e=>{Fe(e.data.key,e.data.fid)}),xe);n&&n.postMessage({key:e,fid:t}),0===Re.size&&xe&&(xe.close(),xe=null)}(n,t)}function Fe(e,t){const n=Re.get(e);if(n)for(const e of n)e(t)}let xe=null;const Ve="firebase-installations-database",Ke=1,We="firebase-installations-store";let ze=null;function Ue(){return ze||(ze=H(Ve,Ke,{upgrade:(e,t)=>{0===t&&e.createObjectStore(We)}})),ze}async function qe(e,t){const n=$e(e),r=(await Ue()).transaction(We,"readwrite"),i=r.objectStore(We),a=await i.get(n);return await i.put(t,n),await r.done,a&&a.fid===t.fid||He(e,t.fid),t}async function Ge(e){const t=$e(e),n=(await Ue()).transaction(We,"readwrite");await n.objectStore(We).delete(t),await n.done}async function Je(e,t){const n=$e(e),r=(await Ue()).transaction(We,"readwrite"),i=r.objectStore(We),a=await i.get(n),o=t(a);return void 0===o?await i.delete(n):await i.put(o,n),await r.done,!o||a&&a.fid===o.fid||He(e,o.fid),o}async function Ye(e){let t;const n=await Je(e.appConfig,(n=>{const r=function(e){return Ze(e||{fid:Le(),registrationStatus:0})}(n),i=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine)return{installationEntry:t,registrationPromise:Promise.reject(De.create("app-offline"))};const n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},r=async function(e,t){try{const n=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const r=Te(e),i=Pe(e),a=t.getImmediate({optional:!0});if(a){const e=await a.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}const o={fid:n,authVersion:_e,appId:e.appId,sdkVersion:Se},s={method:"POST",headers:i,body:JSON.stringify(o)},c=await Ne((()=>fetch(r,s)));if(c.ok){const e=await c.json();return{fid:e.fid||n,registrationStatus:2,refreshToken:e.refreshToken,authToken:Ae(e.authToken)}}throw await Oe("Create Installation",c)}(e,t);return qe(e.appConfig,n)}catch(n){throw ke(n)&&409===n.customData.serverCode?await Ge(e.appConfig):await qe(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}(e,n);return{installationEntry:n,registrationPromise:r}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:Qe(e)}:{installationEntry:t}}(e,r);return t=i.registrationPromise,i.installationEntry}));return n.fid===Be?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}async function Qe(e){let t=await Xe(e.appConfig);for(;1===t.registrationStatus;)await je(100),t=await Xe(e.appConfig);if(0===t.registrationStatus){const{installationEntry:t,registrationPromise:n}=await Ye(e);return n||t}return t}function Xe(e){return Je(e,(e=>{if(!e)throw De.create("installation-not-found");return Ze(e)}))}function Ze(e){return 1===(t=e).registrationStatus&&t.registrationTime+Ie<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}async function et({appConfig:e,heartbeatServiceProvider:t},n){const r=function(e,{fid:t}){return`${Te(e)}/${t}/authTokens:generate`}(e,n),i=function(e,{refreshToken:t}){const n=Pe(e);return n.append("Authorization",function(e){return`${_e} ${e}`}(t)),n}(e,n),a=t.getImmediate({optional:!0});if(a){const e=await a.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}const o={installation:{sdkVersion:Se,appId:e.appId}},s={method:"POST",headers:i,body:JSON.stringify(o)},c=await Ne((()=>fetch(r,s)));if(c.ok)return Ae(await c.json());throw await Oe("Generate Auth Token",c)}async function tt(e,t=!1){let n;const r=await Je(e.appConfig,(r=>{if(!rt(r))throw De.create("not-registered");const i=r.authToken;if(!t&&(2===(a=i).requestStatus&&!function(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+Ce}(a)))return r;var a;if(1===i.requestStatus)return n=async function(e,t){let n=await nt(e.appConfig);for(;1===n.authToken.requestStatus;)await je(100),n=await nt(e.appConfig);const r=n.authToken;return 0===r.requestStatus?tt(e,t):r}(e,t),r;{if(!navigator.onLine)throw De.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 et(e,t),r=Object.assign(Object.assign({},t),{authToken:n});return await qe(e.appConfig,r),n}catch(n){if(!ke(n)||401!==n.customData.serverCode&&404!==n.customData.serverCode){const n=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await qe(e.appConfig,n)}else await Ge(e.appConfig);throw n}}(e,t),t}}));return n?await n:r.authToken}function nt(e){return Je(e,(e=>{if(!rt(e))throw De.create("not-registered");return 1===(t=e.authToken).requestStatus&&t.requestTime+Ie<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e;var t}))}function rt(e){return void 0!==e&&2===e.registrationStatus}function it(e){return De.create("missing-app-config-values",{valueName:e})}const at="installations";ne(new b(at,(e=>{const t=e.getProvider("app").getImmediate(),n=function(e){if(!e||!e.options)throw it("App Configuration");if(!e.name)throw it("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw it(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:n,heartbeatServiceProvider:re(t,"heartbeat"),_delete:()=>Promise.resolve()}}),"PUBLIC")),ne(new b("installations-internal",(e=>{const t=re(e.getProvider("app").getImmediate(),at).getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:r}=await Ye(t);return r?r.catch(console.error):tt(t).catch(console.error),n.fid}(t),getToken:e=>async function(e,t=!1){const n=e;return await async function(e){const{registrationPromise:t}=await Ye(e);t&&await t}(n),(await tt(n,t)).token}(t,e)}}),"PRIVATE")),se(ye,ve),se(ye,ve,"esm2017");const ot="/firebase-messaging-sw.js",st="/firebase-cloud-messaging-push-scope",ct="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",lt="https://fcmregistrations.googleapis.com/v1",ut="google.c.a.c_id",dt="google.c.a.c_l",pt="google.c.a.ts";var ht,ft;function gt(e){const t=new Uint8Array(e);return btoa(String.fromCharCode(...t)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function mt(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;++e)r[e]=n.charCodeAt(e);return r}!function(e){e[e.DATA_MESSAGE=1]="DATA_MESSAGE",e[e.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION"}(ht||(ht={})),function(e){e.PUSH_RECEIVED="push-received",e.NOTIFICATION_CLICKED="notification-clicked"}(ft||(ft={}));const bt="fcm_token_details_db",wt=5,yt="fcm_token_object_Store",vt="firebase-messaging-database",It=1,St="firebase-messaging-store";let _t=null;function Et(){return _t||(_t=H(vt,It,{upgrade:(e,t)=>{0===t&&e.createObjectStore(St)}})),_t}async function Ct(e,t){const n=Dt(e),r=(await Et()).transaction(St,"readwrite");return await r.objectStore(St).put(t,n),await r.done,t}function Dt({appConfig:e}){return e.appId}const kt=new p("messaging","Messaging",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. {$browserErrorMessage}","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: {$errorInfo}","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: {$errorInfo}","token-update-failed":"A problem occurred while updating the user from FCM: {$errorInfo}","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invalid-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."});function Tt({projectId:e}){return`${lt}/projects/${e}/registrations`}async function At({appConfig:e,installations:t}){const n=await t.getToken();return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":`FIS ${n}`})}function Ot({p256dh:e,auth:t,endpoint:n,vapidKey:r}){const i={web:{endpoint:n,auth:t,p256dh:e}};return r!==ct&&(i.web.applicationPubKey=r),i}const Pt=6048e5;async function Nt(e){const t=await async function(e,t){const n=await e.pushManager.getSubscription();return n||e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:mt(t)})}(e.swRegistration,e.vapidKey),n={vapidKey:e.vapidKey,swScope:e.swRegistration.scope,endpoint:t.endpoint,auth:gt(t.getKey("auth")),p256dh:gt(t.getKey("p256dh"))},r=await async function(e){const t=Dt(e),n=await Et(),r=await n.transaction(St).objectStore(St).get(t);if(r)return r;{const t=await async function(e){if("databases"in indexedDB){const e=(await indexedDB.databases()).map((e=>e.name));if(!e.includes(bt))return null}let t=null;return(await H(bt,wt,{upgrade:async(n,r,i,a)=>{var o;if(r<2)return;if(!n.objectStoreNames.contains(yt))return;const s=a.objectStore(yt),c=await s.index("fcmSenderId").get(e);if(await s.clear(),c)if(2===r){const e=c;if(!e.auth||!e.p256dh||!e.endpoint)return;t={token:e.fcmToken,createTime:null!==(o=e.createTime)&&void 0!==o?o:Date.now(),subscriptionOptions:{auth:e.auth,p256dh:e.p256dh,endpoint:e.endpoint,swScope:e.swScope,vapidKey:"string"==typeof e.vapidKey?e.vapidKey:gt(e.vapidKey)}}}else if(3===r){const e=c;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:gt(e.auth),p256dh:gt(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:gt(e.vapidKey)}}}else if(4===r){const e=c;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:gt(e.auth),p256dh:gt(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:gt(e.vapidKey)}}}}})).close(),await F(bt),await F("fcm_vapid_details_db"),await F("undefined"),function(e){if(!e||!e.subscriptionOptions)return!1;const{subscriptionOptions:t}=e;return"number"==typeof e.createTime&&e.createTime>0&&"string"==typeof e.token&&e.token.length>0&&"string"==typeof t.auth&&t.auth.length>0&&"string"==typeof t.p256dh&&t.p256dh.length>0&&"string"==typeof t.endpoint&&t.endpoint.length>0&&"string"==typeof t.swScope&&t.swScope.length>0&&"string"==typeof t.vapidKey&&t.vapidKey.length>0}(t)?t:null}(e.appConfig.senderId);if(t)return await Ct(e,t),t}}(e.firebaseDependencies);if(r){if(function(e,t){const n=t.vapidKey===e.vapidKey,r=t.endpoint===e.endpoint,i=t.auth===e.auth,a=t.p256dh===e.p256dh;return n&&r&&i&&a}(r.subscriptionOptions,n))return Date.now()>=r.createTime+Pt?async function(e,t){try{const n=await async function(e,t){const n=await At(e),r=Ot(t.subscriptionOptions),i={method:"PATCH",headers:n,body:JSON.stringify(r)};let a;try{const n=await fetch(`${Tt(e.appConfig)}/${t.token}`,i);a=await n.json()}catch(e){throw kt.create("token-update-failed",{errorInfo:null==e?void 0:e.toString()})}if(a.error){const e=a.error.message;throw kt.create("token-update-failed",{errorInfo:e})}if(!a.token)throw kt.create("token-update-no-token");return a.token}(e.firebaseDependencies,t),r=Object.assign(Object.assign({},t),{token:n,createTime:Date.now()});return await Ct(e.firebaseDependencies,r),n}catch(e){throw e}}(e,{token:r.token,createTime:Date.now(),subscriptionOptions:n}):r.token;try{await async function(e,t){const n={method:"DELETE",headers:await At(e)};try{const r=await fetch(`${Tt(e.appConfig)}/${t}`,n),i=await r.json();if(i.error){const e=i.error.message;throw kt.create("token-unsubscribe-failed",{errorInfo:e})}}catch(e){throw kt.create("token-unsubscribe-failed",{errorInfo:null==e?void 0:e.toString()})}}(e.firebaseDependencies,r.token)}catch(e){console.warn(e)}return jt(e.firebaseDependencies,n)}return jt(e.firebaseDependencies,n)}async function jt(e,t){const n=await async function(e,t){const n=await At(e),r=Ot(t),i={method:"POST",headers:n,body:JSON.stringify(r)};let a;try{const t=await fetch(Tt(e.appConfig),i);a=await t.json()}catch(e){throw kt.create("token-subscribe-failed",{errorInfo:null==e?void 0:e.toString()})}if(a.error){const e=a.error.message;throw kt.create("token-subscribe-failed",{errorInfo:e})}if(!a.token)throw kt.create("token-subscribe-no-token");return a.token}(e,t),r={token:n,createTime:Date.now(),subscriptionOptions:t};return await Ct(e,r),r.token}function Mt(e){const t={from:e.from,collapseKey:e.collapse_key,messageId:e.fcmMessageId};return function(e,t){if(!t.notification)return;e.notification={};const n=t.notification.title;n&&(e.notification.title=n);const r=t.notification.body;r&&(e.notification.body=r);const i=t.notification.image;i&&(e.notification.image=i);const a=t.notification.icon;a&&(e.notification.icon=a)}(t,e),function(e,t){t.data&&(e.data=t.data)}(t,e),function(e,t){var n,r,i,a,o;if(!t.fcmOptions&&!(null===(n=t.notification)||void 0===n?void 0:n.click_action))return;e.fcmOptions={};const s=null!==(i=null===(r=t.fcmOptions)||void 0===r?void 0:r.link)&&void 0!==i?i:null===(a=t.notification)||void 0===a?void 0:a.click_action;s&&(e.fcmOptions.link=s);const c=null===(o=t.fcmOptions)||void 0===o?void 0:o.analytics_label;c&&(e.fcmOptions.analyticsLabel=c)}(t,e),t}function Bt(e,t){const n=[];for(let r=0;r<e.length;r++)n.push(e.charAt(r)),r<t.length&&n.push(t.charAt(r));return n.join("")}function Lt(e){return kt.create("missing-app-config-values",{valueName:e})}Bt("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),Bt("AzSCbw63g1R0nCw85jG8","Iaya3yLKwmgvh7cF0q4");class $t{constructor(e,t,n){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1;const r=function(e){if(!e||!e.options)throw Lt("App Configuration Object");if(!e.name)throw Lt("App Name");const t=["projectId","apiKey","appId","messagingSenderId"],{options:n}=e;for(const e of t)if(!n[e])throw Lt(e);return{appName:e.name,projectId:n.projectId,apiKey:n.apiKey,appId:n.appId,senderId:n.messagingSenderId}}(e);this.firebaseDependencies={app:e,appConfig:r,installations:t,analyticsProvider:n}}_delete(){return Promise.resolve()}}async function Rt(e,t){if(!navigator)throw kt.create("only-available-in-window");if("default"===Notification.permission&&await Notification.requestPermission(),"granted"!==Notification.permission)throw kt.create("permission-blocked");return await async function(e,t){t?e.vapidKey=t:e.vapidKey||(e.vapidKey=ct)}(e,null==t?void 0:t.vapidKey),await async function(e,t){if(t||e.swRegistration||await async function(e){try{e.swRegistration=await navigator.serviceWorker.register(ot,{scope:st}),e.swRegistration.update().catch((()=>{}))}catch(e){throw kt.create("failed-service-worker-registration",{browserErrorMessage:null==e?void 0:e.message})}}(e),t||!e.swRegistration){if(!(t instanceof ServiceWorkerRegistration))throw kt.create("invalid-sw-registration");e.swRegistration=t}}(e,null==t?void 0:t.serviceWorkerRegistration),Nt(e)}async function Ht(e,t){const n=t.data;if(!n.isFirebaseMessaging)return;e.onMessageHandler&&n.messageType===ft.PUSH_RECEIVED&&("function"==typeof e.onMessageHandler?e.onMessageHandler(Mt(n)):e.onMessageHandler.next(Mt(n)));const r=n.data;var i;"object"==typeof(i=r)&&i&&ut in i&&"1"===r["google.c.a.e"]&&await async function(e,t,n){const r=function(e){switch(e){case ft.NOTIFICATION_CLICKED:return"notification_open";case ft.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}(t);(await e.firebaseDependencies.analyticsProvider.get()).logEvent(r,{message_id:n[ut],message_name:n[dt],message_time:n[pt],message_device_time:Math.floor(Date.now()/1e3)})}(e,n.messageType,r)}const Ft="@firebase/messaging",xt="0.12.11";function Vt(e=function(e=Y){const t=X.get(e);if(!t&&e===Y&&s())return oe();if(!t)throw ie.create("no-app",{appName:e});return t}()){return async function(){try{await u()}catch(e){return!1}return"undefined"!=typeof window&&l()&&!("undefined"==typeof navigator||!navigator.cookieEnabled)&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}().then((e=>{if(!e)throw kt.create("unsupported-browser")}),(e=>{throw kt.create("indexed-db-unsupported")})),re(m(e),"messaging").getImmediate()}async function Kt(e,t){return Rt(e=m(e),t)}ne(new b("messaging",(e=>{const t=new $t(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),e.getProvider("analytics-internal"));return navigator.serviceWorker.addEventListener("message",(e=>Ht(t,e))),t}),"PUBLIC")),ne(new b("messaging-internal",(e=>{const t=e.getProvider("messaging").getImmediate();return{getToken:e=>Rt(t,e)}}),"PRIVATE")),se(Ft,xt),se(Ft,xt,"esm2017"),module.exports=t})();
|
|
1
|
+
(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.r(t),e.d(t,{getMessaging:()=>Vt,getToken:()=>Kt,initializeApp:()=>oe});const n=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},r={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let t=0;t<e.length;t+=3){const i=e[t],a=t+1<e.length,o=a?e[t+1]:0,s=t+2<e.length,c=s?e[t+2]:0,l=i>>2,u=(3&i)<<4|o>>4;let d=(15&o)<<2|c>>6,p=63&c;s||(p=64,a||(d=64)),r.push(n[l],n[u],n[d],n[p])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(n(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){const a=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&a)}else if(i>239&&i<365){const a=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(a>>10)),t[r++]=String.fromCharCode(56320+(1023&a))}else{const a=e[n++],o=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&a)<<6|63&o)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t<e.length;){const a=n[e.charAt(t++)],o=t<e.length?n[e.charAt(t)]:0;++t;const s=t<e.length?n[e.charAt(t)]:64;++t;const c=t<e.length?n[e.charAt(t)]:64;if(++t,null==a||null==o||null==s||null==c)throw new i;const l=a<<2|o>>4;if(r.push(l),64!==s){const e=o<<4&240|s>>2;if(r.push(e),64!==c){const e=s<<6&192|c;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class i extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const a=function(e){return function(e){const t=n(e);return r.encodeByteArray(t,!0)}(e).replace(/\./g,"")},o=()=>{try{return function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e.g)return e.g;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__||(()=>{if("undefined"==typeof process||void 0===process.env)return;const e=process.env.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&function(e){try{return r.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null}(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}},s=()=>{var e;return null===(e=o())||void 0===e?void 0:e.config};class c{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))}}}function l(){try{return"object"==typeof indexedDB}catch(e){return!1}}function u(){return new Promise(((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}}))}class d extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,d.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,p.prototype.create)}}class p{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],a=i?function(e,t){return e.replace(h,((e,n)=>{const r=t[n];return null!=r?String(r):`<${n}?>`}))}(i,n):"Error",o=`${this.serviceName}: ${a} (${r}).`;return new d(r,o,n)}}const h=/\{\$([^}]+)}/g;function f(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const n=e[i],a=t[i];if(g(n)&&g(a)){if(!f(n,a))return!1}else if(n!==a)return!1}for(const e of r)if(!n.includes(e))return!1;return!0}function g(e){return null!==e&&"object"==typeof e}function m(e){return e&&e._delegate?e._delegate:e}class b{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const w="[DEFAULT]";class y{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new c;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),r=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(e){if(r)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,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:w})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e=w){this.instancesDeferred.delete(e),this.instancesOptions.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())),...e.filter((e=>"_delete"in e)).map((e=>e._delete()))])}isComponentSet(){return null!=this.component}isInitialized(e=w){return this.instances.has(e)}getOptions(e=w){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries())n===this.normalizeInstanceIdentifier(e)&&t.resolve(r);return r}onInit(e,t){var n;const r=this.normalizeInstanceIdentifier(t),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(e),this.onInitCallbacks.set(r,i);const a=this.instances.get(r);return a&&e(a,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const r of n)try{r(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(r=e,r===w?void 0:r),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(e){}var r;return n||null}normalizeInstanceIdentifier(e=w){return this.component?this.component.multipleInstances?e:w:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class v{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 y(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}const I=[];var S;!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"}(S||(S={}));const _={debug:S.DEBUG,verbose:S.VERBOSE,info:S.INFO,warn:S.WARN,error:S.ERROR,silent:S.SILENT},E=S.INFO,C={[S.DEBUG]:"log",[S.VERBOSE]:"log",[S.INFO]:"info",[S.WARN]:"warn",[S.ERROR]:"error"},D=(e,t,...n)=>{if(t<e.logLevel)return;const r=(new Date).toISOString(),i=C[t];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[i](`[${r}] ${e.name}:`,...n)},k=(e,t)=>t.some((t=>e instanceof t));let T,A;const O=new WeakMap,P=new WeakMap,N=new WeakMap,j=new WeakMap,M=new WeakMap;let B={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return P.get(e);if("objectStoreNames"===t)return e.objectStoreNames||N.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return $(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function L(e){return"function"==typeof e?(t=e)!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(A||(A=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(R(this),e),$(O.get(this))}:function(...e){return $(t.apply(R(this),e))}:function(e,...n){const r=t.call(R(this),e,...n);return N.set(r,e.sort?e.sort():[e]),$(r)}:(e instanceof IDBTransaction&&function(e){if(P.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",a),e.removeEventListener("abort",a)},i=()=>{t(),r()},a=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",a),e.addEventListener("abort",a)}));P.set(e,t)}(e),k(e,T||(T=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,B):e);var t}function $(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",a)},i=()=>{t($(e.result)),r()},a=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",a)}));return t.then((t=>{t instanceof IDBCursor&&O.set(t,e)})).catch((()=>{})),M.set(t,e),t}(e);if(j.has(e))return j.get(e);const t=L(e);return t!==e&&(j.set(e,t),M.set(t,e)),t}const R=e=>M.get(e);function H(e,t,{blocked:n,upgrade:r,blocking:i,terminated:a}={}){const o=indexedDB.open(e,t),s=$(o);return r&&o.addEventListener("upgradeneeded",(e=>{r($(o.result),e.oldVersion,e.newVersion,$(o.transaction),e)})),n&&o.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),s.then((e=>{a&&e.addEventListener("close",(()=>a())),i&&e.addEventListener("versionchange",(e=>i(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),s}function F(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),$(n).then((()=>{}))}const x=["get","getKey","getAll","getAllKeys","count"],V=["put","add","delete","clear"],K=new Map;function W(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(K.get(t))return K.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=V.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!x.includes(n))return;const a=async function(e,...t){const a=this.transaction(e,i?"readwrite":"readonly");let o=a.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&a.done]))[0]};return K.set(t,a),a}var z;z=B,B={...z,get:(e,t,n)=>W(e,t)||z.get(e,t,n),has:(e,t)=>!!W(e,t)||z.has(e,t)};class U{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)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const q="@firebase/app",G="0.10.12",J=new class{constructor(e){this.name=e,this._logLevel=E,this._logHandler=D,this._userLogHandler=null,I.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in S))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?_[e]: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,S.DEBUG,...e),this._logHandler(this,S.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,S.VERBOSE,...e),this._logHandler(this,S.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,S.INFO,...e),this._logHandler(this,S.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,S.WARN,...e),this._logHandler(this,S.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,S.ERROR,...e),this._logHandler(this,S.ERROR,...e)}}("@firebase/app"),Y="[DEFAULT]",Q={[q]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/data-connect":"fire-data-connect","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","@firebase/vertexai-preview":"fire-vertex","fire-js":"fire-js",firebase:"fire-js-all"},X=new Map,Z=new Map,ee=new Map;function te(e,t){try{e.container.addComponent(t)}catch(n){J.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function ne(e){const t=e.name;if(ee.has(t))return J.debug(`There were multiple attempts to register component ${t}.`),!1;ee.set(t,e);for(const t of X.values())te(t,e);for(const t of Z.values())te(t,e);return!0}function re(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}const ie=new p("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","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.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."});class ae{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new b("app",(()=>this),"PUBLIC"))}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}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw ie.create("app-deleted",{appName:this._name})}}function oe(e,t={}){let n=e;"object"!=typeof t&&(t={name:t});const r=Object.assign({name:Y,automaticDataCollectionEnabled:!1},t),i=r.name;if("string"!=typeof i||!i)throw ie.create("bad-app-name",{appName:String(i)});if(n||(n=s()),!n)throw ie.create("no-options");const a=X.get(i);if(a){if(f(n,a.options)&&f(r,a.config))return a;throw ie.create("duplicate-app",{appName:i})}const o=new v(i);for(const e of ee.values())o.addComponent(e);const c=new ae(n,r,o);return X.set(i,c),c}function se(e,t,n){var r;let i=null!==(r=Q[e])&&void 0!==r?r:e;n&&(i+=`-${n}`);const a=i.match(/\s|\//),o=t.match(/\s|\//);if(a||o){const e=[`Unable to register library "${i}" with version "${t}":`];return a&&e.push(`library name "${i}" contains illegal characters (whitespace or "/")`),a&&o&&e.push("and"),o&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void J.warn(e.join(" "))}ne(new b(`${i}-version`,(()=>({library:i,version:t})),"VERSION"))}const ce="firebase-heartbeat-database",le=1,ue="firebase-heartbeat-store";let de=null;function pe(){return de||(de=H(ce,le,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(ue)}catch(e){console.warn(e)}}}).catch((e=>{throw ie.create("idb-open",{originalErrorMessage:e.message})}))),de}async function he(e,t){try{const n=(await pe()).transaction(ue,"readwrite"),r=n.objectStore(ue);await r.put(t,fe(e)),await n.done}catch(e){if(e instanceof d)J.warn(e.message);else{const t=ie.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});J.warn(t.message)}}}function fe(e){return`${e.name}!${e.options.appId}`}class ge{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new be(t),this._heartbeatsCachePromise=this._storage.read().then((e=>(this._heartbeatsCache=e,e)))}async triggerHeartbeat(){var e,t;try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=me();if(null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)))return;if(this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some((e=>e.date===r)))return;return this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter((e=>{const t=new Date(e.date).valueOf();return Date.now()-t<=2592e6})),this._storage.overwrite(this._heartbeatsCache)}catch(e){J.warn(e)}}async getHeartbeatsHeader(){var e;try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const t=me(),{heartbeatsToSend:n,unsentEntries:r}=function(e,t=1024){const n=[];let r=e.slice();for(const i of e){const e=n.find((e=>e.agent===i.agent));if(e){if(e.dates.push(i.date),we(n)>t){e.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),we(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}(this._heartbeatsCache.heartbeats),i=a(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(e){return J.warn(e),""}}}function me(){return(new Date).toISOString().substring(0,10)}class be{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!l()&&u().then((()=>!0)).catch((()=>!1))}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await pe()).transaction(ue),n=await t.objectStore(ue).get(fe(e));return await t.done,n}catch(e){if(e instanceof d)J.warn(e.message);else{const t=ie.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});J.warn(t.message)}}}(this.app);return(null==e?void 0:e.heartbeats)?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return he(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return he(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}function we(e){return a(JSON.stringify({version:2,heartbeats:e})).length}ne(new b("platform-logger",(e=>new U(e)),"PRIVATE")),ne(new b("heartbeat",(e=>new ge(e)),"PRIVATE")),se(q,G,""),se(q,G,"esm2017"),se("fire-js",""),se("firebase","10.14.0","app");const ye="@firebase/installations",ve="0.6.9",Ie=1e4,Se=`w:${ve}`,_e="FIS_v2",Ee="https://firebaseinstallations.googleapis.com/v1",Ce=36e5,De=new p("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 ke(e){return e instanceof d&&e.code.includes("request-failed")}function Te({projectId:e}){return`${Ee}/projects/${e}/installations`}function Ae(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function Oe(e,t){const n=(await t.json()).error;return De.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function Pe({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}async function Ne(e){const t=await e();return t.status>=500&&t.status<600?e():t}function je(e){return new Promise((t=>{setTimeout(t,e)}))}const Me=/^[cdef][\w-]{21}$/,Be="";function Le(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const t=function(e){var t;return(t=e,btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")).substr(0,22)}(e);return Me.test(t)?t:Be}catch(e){return Be}}function $e(e){return`${e.appName}!${e.appId}`}const Re=new Map;function He(e,t){const n=$e(e);Fe(n,t),function(e,t){const n=(!xe&&"BroadcastChannel"in self&&(xe=new BroadcastChannel("[Firebase] FID Change"),xe.onmessage=e=>{Fe(e.data.key,e.data.fid)}),xe);n&&n.postMessage({key:e,fid:t}),0===Re.size&&xe&&(xe.close(),xe=null)}(n,t)}function Fe(e,t){const n=Re.get(e);if(n)for(const e of n)e(t)}let xe=null;const Ve="firebase-installations-database",Ke=1,We="firebase-installations-store";let ze=null;function Ue(){return ze||(ze=H(Ve,Ke,{upgrade:(e,t)=>{0===t&&e.createObjectStore(We)}})),ze}async function qe(e,t){const n=$e(e),r=(await Ue()).transaction(We,"readwrite"),i=r.objectStore(We),a=await i.get(n);return await i.put(t,n),await r.done,a&&a.fid===t.fid||He(e,t.fid),t}async function Ge(e){const t=$e(e),n=(await Ue()).transaction(We,"readwrite");await n.objectStore(We).delete(t),await n.done}async function Je(e,t){const n=$e(e),r=(await Ue()).transaction(We,"readwrite"),i=r.objectStore(We),a=await i.get(n),o=t(a);return void 0===o?await i.delete(n):await i.put(o,n),await r.done,!o||a&&a.fid===o.fid||He(e,o.fid),o}async function Ye(e){let t;const n=await Je(e.appConfig,(n=>{const r=function(e){return Ze(e||{fid:Le(),registrationStatus:0})}(n),i=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine)return{installationEntry:t,registrationPromise:Promise.reject(De.create("app-offline"))};const n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},r=async function(e,t){try{const n=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const r=Te(e),i=Pe(e),a=t.getImmediate({optional:!0});if(a){const e=await a.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}const o={fid:n,authVersion:_e,appId:e.appId,sdkVersion:Se},s={method:"POST",headers:i,body:JSON.stringify(o)},c=await Ne((()=>fetch(r,s)));if(c.ok){const e=await c.json();return{fid:e.fid||n,registrationStatus:2,refreshToken:e.refreshToken,authToken:Ae(e.authToken)}}throw await Oe("Create Installation",c)}(e,t);return qe(e.appConfig,n)}catch(n){throw ke(n)&&409===n.customData.serverCode?await Ge(e.appConfig):await qe(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}(e,n);return{installationEntry:n,registrationPromise:r}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:Qe(e)}:{installationEntry:t}}(e,r);return t=i.registrationPromise,i.installationEntry}));return n.fid===Be?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}async function Qe(e){let t=await Xe(e.appConfig);for(;1===t.registrationStatus;)await je(100),t=await Xe(e.appConfig);if(0===t.registrationStatus){const{installationEntry:t,registrationPromise:n}=await Ye(e);return n||t}return t}function Xe(e){return Je(e,(e=>{if(!e)throw De.create("installation-not-found");return Ze(e)}))}function Ze(e){return 1===(t=e).registrationStatus&&t.registrationTime+Ie<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}async function et({appConfig:e,heartbeatServiceProvider:t},n){const r=function(e,{fid:t}){return`${Te(e)}/${t}/authTokens:generate`}(e,n),i=function(e,{refreshToken:t}){const n=Pe(e);return n.append("Authorization",function(e){return`${_e} ${e}`}(t)),n}(e,n),a=t.getImmediate({optional:!0});if(a){const e=await a.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}const o={installation:{sdkVersion:Se,appId:e.appId}},s={method:"POST",headers:i,body:JSON.stringify(o)},c=await Ne((()=>fetch(r,s)));if(c.ok)return Ae(await c.json());throw await Oe("Generate Auth Token",c)}async function tt(e,t=!1){let n;const r=await Je(e.appConfig,(r=>{if(!rt(r))throw De.create("not-registered");const i=r.authToken;if(!t&&(2===(a=i).requestStatus&&!function(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+Ce}(a)))return r;var a;if(1===i.requestStatus)return n=async function(e,t){let n=await nt(e.appConfig);for(;1===n.authToken.requestStatus;)await je(100),n=await nt(e.appConfig);const r=n.authToken;return 0===r.requestStatus?tt(e,t):r}(e,t),r;{if(!navigator.onLine)throw De.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 et(e,t),r=Object.assign(Object.assign({},t),{authToken:n});return await qe(e.appConfig,r),n}catch(n){if(!ke(n)||401!==n.customData.serverCode&&404!==n.customData.serverCode){const n=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await qe(e.appConfig,n)}else await Ge(e.appConfig);throw n}}(e,t),t}}));return n?await n:r.authToken}function nt(e){return Je(e,(e=>{if(!rt(e))throw De.create("not-registered");return 1===(t=e.authToken).requestStatus&&t.requestTime+Ie<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e;var t}))}function rt(e){return void 0!==e&&2===e.registrationStatus}function it(e){return De.create("missing-app-config-values",{valueName:e})}const at="installations";ne(new b(at,(e=>{const t=e.getProvider("app").getImmediate(),n=function(e){if(!e||!e.options)throw it("App Configuration");if(!e.name)throw it("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw it(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:n,heartbeatServiceProvider:re(t,"heartbeat"),_delete:()=>Promise.resolve()}}),"PUBLIC")),ne(new b("installations-internal",(e=>{const t=re(e.getProvider("app").getImmediate(),at).getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:r}=await Ye(t);return r?r.catch(console.error):tt(t).catch(console.error),n.fid}(t),getToken:e=>async function(e,t=!1){const n=e;return await async function(e){const{registrationPromise:t}=await Ye(e);t&&await t}(n),(await tt(n,t)).token}(t,e)}}),"PRIVATE")),se(ye,ve),se(ye,ve,"esm2017");const ot="/firebase-messaging-sw.js",st="/firebase-cloud-messaging-push-scope",ct="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",lt="https://fcmregistrations.googleapis.com/v1",ut="google.c.a.c_id",dt="google.c.a.c_l",pt="google.c.a.ts";var ht,ft;function gt(e){const t=new Uint8Array(e);return btoa(String.fromCharCode(...t)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function mt(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;++e)r[e]=n.charCodeAt(e);return r}!function(e){e[e.DATA_MESSAGE=1]="DATA_MESSAGE",e[e.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION"}(ht||(ht={})),function(e){e.PUSH_RECEIVED="push-received",e.NOTIFICATION_CLICKED="notification-clicked"}(ft||(ft={}));const bt="fcm_token_details_db",wt=5,yt="fcm_token_object_Store",vt="firebase-messaging-database",It=1,St="firebase-messaging-store";let _t=null;function Et(){return _t||(_t=H(vt,It,{upgrade:(e,t)=>{0===t&&e.createObjectStore(St)}})),_t}async function Ct(e,t){const n=Dt(e),r=(await Et()).transaction(St,"readwrite");return await r.objectStore(St).put(t,n),await r.done,t}function Dt({appConfig:e}){return e.appId}const kt=new p("messaging","Messaging",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. {$browserErrorMessage}","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: {$errorInfo}","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: {$errorInfo}","token-update-failed":"A problem occurred while updating the user from FCM: {$errorInfo}","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invalid-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."});function Tt({projectId:e}){return`${lt}/projects/${e}/registrations`}async function At({appConfig:e,installations:t}){const n=await t.getToken();return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":`FIS ${n}`})}function Ot({p256dh:e,auth:t,endpoint:n,vapidKey:r}){const i={web:{endpoint:n,auth:t,p256dh:e}};return r!==ct&&(i.web.applicationPubKey=r),i}const Pt=6048e5;async function Nt(e){const t=await async function(e,t){const n=await e.pushManager.getSubscription();return n||e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:mt(t)})}(e.swRegistration,e.vapidKey),n={vapidKey:e.vapidKey,swScope:e.swRegistration.scope,endpoint:t.endpoint,auth:gt(t.getKey("auth")),p256dh:gt(t.getKey("p256dh"))},r=await async function(e){const t=Dt(e),n=await Et(),r=await n.transaction(St).objectStore(St).get(t);if(r)return r;{const t=await async function(e){if("databases"in indexedDB){const e=(await indexedDB.databases()).map((e=>e.name));if(!e.includes(bt))return null}let t=null;return(await H(bt,wt,{upgrade:async(n,r,i,a)=>{var o;if(r<2)return;if(!n.objectStoreNames.contains(yt))return;const s=a.objectStore(yt),c=await s.index("fcmSenderId").get(e);if(await s.clear(),c)if(2===r){const e=c;if(!e.auth||!e.p256dh||!e.endpoint)return;t={token:e.fcmToken,createTime:null!==(o=e.createTime)&&void 0!==o?o:Date.now(),subscriptionOptions:{auth:e.auth,p256dh:e.p256dh,endpoint:e.endpoint,swScope:e.swScope,vapidKey:"string"==typeof e.vapidKey?e.vapidKey:gt(e.vapidKey)}}}else if(3===r){const e=c;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:gt(e.auth),p256dh:gt(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:gt(e.vapidKey)}}}else if(4===r){const e=c;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:gt(e.auth),p256dh:gt(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:gt(e.vapidKey)}}}}})).close(),await F(bt),await F("fcm_vapid_details_db"),await F("undefined"),function(e){if(!e||!e.subscriptionOptions)return!1;const{subscriptionOptions:t}=e;return"number"==typeof e.createTime&&e.createTime>0&&"string"==typeof e.token&&e.token.length>0&&"string"==typeof t.auth&&t.auth.length>0&&"string"==typeof t.p256dh&&t.p256dh.length>0&&"string"==typeof t.endpoint&&t.endpoint.length>0&&"string"==typeof t.swScope&&t.swScope.length>0&&"string"==typeof t.vapidKey&&t.vapidKey.length>0}(t)?t:null}(e.appConfig.senderId);if(t)return await Ct(e,t),t}}(e.firebaseDependencies);if(r){if(function(e,t){const n=t.vapidKey===e.vapidKey,r=t.endpoint===e.endpoint,i=t.auth===e.auth,a=t.p256dh===e.p256dh;return n&&r&&i&&a}(r.subscriptionOptions,n))return Date.now()>=r.createTime+Pt?async function(e,t){try{const n=await async function(e,t){const n=await At(e),r=Ot(t.subscriptionOptions),i={method:"PATCH",headers:n,body:JSON.stringify(r)};let a;try{const n=await fetch(`${Tt(e.appConfig)}/${t.token}`,i);a=await n.json()}catch(e){throw kt.create("token-update-failed",{errorInfo:null==e?void 0:e.toString()})}if(a.error){const e=a.error.message;throw kt.create("token-update-failed",{errorInfo:e})}if(!a.token)throw kt.create("token-update-no-token");return a.token}(e.firebaseDependencies,t),r=Object.assign(Object.assign({},t),{token:n,createTime:Date.now()});return await Ct(e.firebaseDependencies,r),n}catch(e){throw e}}(e,{token:r.token,createTime:Date.now(),subscriptionOptions:n}):r.token;try{await async function(e,t){const n={method:"DELETE",headers:await At(e)};try{const r=await fetch(`${Tt(e.appConfig)}/${t}`,n),i=await r.json();if(i.error){const e=i.error.message;throw kt.create("token-unsubscribe-failed",{errorInfo:e})}}catch(e){throw kt.create("token-unsubscribe-failed",{errorInfo:null==e?void 0:e.toString()})}}(e.firebaseDependencies,r.token)}catch(e){console.warn(e)}return jt(e.firebaseDependencies,n)}return jt(e.firebaseDependencies,n)}async function jt(e,t){const n=await async function(e,t){const n=await At(e),r=Ot(t),i={method:"POST",headers:n,body:JSON.stringify(r)};let a;try{const t=await fetch(Tt(e.appConfig),i);a=await t.json()}catch(e){throw kt.create("token-subscribe-failed",{errorInfo:null==e?void 0:e.toString()})}if(a.error){const e=a.error.message;throw kt.create("token-subscribe-failed",{errorInfo:e})}if(!a.token)throw kt.create("token-subscribe-no-token");return a.token}(e,t),r={token:n,createTime:Date.now(),subscriptionOptions:t};return await Ct(e,r),r.token}function Mt(e){const t={from:e.from,collapseKey:e.collapse_key,messageId:e.fcmMessageId};return function(e,t){if(!t.notification)return;e.notification={};const n=t.notification.title;n&&(e.notification.title=n);const r=t.notification.body;r&&(e.notification.body=r);const i=t.notification.image;i&&(e.notification.image=i);const a=t.notification.icon;a&&(e.notification.icon=a)}(t,e),function(e,t){t.data&&(e.data=t.data)}(t,e),function(e,t){var n,r,i,a,o;if(!t.fcmOptions&&!(null===(n=t.notification)||void 0===n?void 0:n.click_action))return;e.fcmOptions={};const s=null!==(i=null===(r=t.fcmOptions)||void 0===r?void 0:r.link)&&void 0!==i?i:null===(a=t.notification)||void 0===a?void 0:a.click_action;s&&(e.fcmOptions.link=s);const c=null===(o=t.fcmOptions)||void 0===o?void 0:o.analytics_label;c&&(e.fcmOptions.analyticsLabel=c)}(t,e),t}function Bt(e,t){const n=[];for(let r=0;r<e.length;r++)n.push(e.charAt(r)),r<t.length&&n.push(t.charAt(r));return n.join("")}function Lt(e){return kt.create("missing-app-config-values",{valueName:e})}Bt("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),Bt("AzSCbw63g1R0nCw85jG8","Iaya3yLKwmgvh7cF0q4");class $t{constructor(e,t,n){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1;const r=function(e){if(!e||!e.options)throw Lt("App Configuration Object");if(!e.name)throw Lt("App Name");const t=["projectId","apiKey","appId","messagingSenderId"],{options:n}=e;for(const e of t)if(!n[e])throw Lt(e);return{appName:e.name,projectId:n.projectId,apiKey:n.apiKey,appId:n.appId,senderId:n.messagingSenderId}}(e);this.firebaseDependencies={app:e,appConfig:r,installations:t,analyticsProvider:n}}_delete(){return Promise.resolve()}}async function Rt(e,t){if(!navigator)throw kt.create("only-available-in-window");if("default"===Notification.permission&&await Notification.requestPermission(),"granted"!==Notification.permission)throw kt.create("permission-blocked");return await async function(e,t){t?e.vapidKey=t:e.vapidKey||(e.vapidKey=ct)}(e,null==t?void 0:t.vapidKey),await async function(e,t){if(t||e.swRegistration||await async function(e){try{e.swRegistration=await navigator.serviceWorker.register(ot,{scope:st}),e.swRegistration.update().catch((()=>{}))}catch(e){throw kt.create("failed-service-worker-registration",{browserErrorMessage:null==e?void 0:e.message})}}(e),t||!e.swRegistration){if(!(t instanceof ServiceWorkerRegistration))throw kt.create("invalid-sw-registration");e.swRegistration=t}}(e,null==t?void 0:t.serviceWorkerRegistration),Nt(e)}async function Ht(e,t){const n=t.data;if(!n.isFirebaseMessaging)return;e.onMessageHandler&&n.messageType===ft.PUSH_RECEIVED&&("function"==typeof e.onMessageHandler?e.onMessageHandler(Mt(n)):e.onMessageHandler.next(Mt(n)));const r=n.data;var i;"object"==typeof(i=r)&&i&&ut in i&&"1"===r["google.c.a.e"]&&await async function(e,t,n){const r=function(e){switch(e){case ft.NOTIFICATION_CLICKED:return"notification_open";case ft.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}(t);(await e.firebaseDependencies.analyticsProvider.get()).logEvent(r,{message_id:n[ut],message_name:n[dt],message_time:n[pt],message_device_time:Math.floor(Date.now()/1e3)})}(e,n.messageType,r)}const Ft="@firebase/messaging",xt="0.12.11";function Vt(e=function(e=Y){const t=X.get(e);if(!t&&e===Y&&s())return oe();if(!t)throw ie.create("no-app",{appName:e});return t}()){return async function(){try{await u()}catch(e){return!1}return"undefined"!=typeof window&&l()&&!("undefined"==typeof navigator||!navigator.cookieEnabled)&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}().then((e=>{if(!e)throw kt.create("unsupported-browser")}),(e=>{throw kt.create("indexed-db-unsupported")})),re(m(e),"messaging").getImmediate()}async function Kt(e,t){return Rt(e=m(e),t)}ne(new b("messaging",(e=>{const t=new $t(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),e.getProvider("analytics-internal"));return navigator.serviceWorker.addEventListener("message",(e=>Ht(t,e))),t}),"PUBLIC")),ne(new b("messaging-internal",(e=>{const t=e.getProvider("messaging").getImmediate();return{getToken:e=>Rt(t,e)}}),"PRIVATE")),se(Ft,xt),se(Ft,xt,"esm2017"),module.exports=t})();
|