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MAAM,IAAIvE,MAAMqE,EAAAA,EAAmBG,iBAC5F,MAAM5C,CACV,GAGS6C,EAAeA,CAACpM,EAAgCqM,IAC1C,IAAI3C,EAAAA,OAAkB,CACjC2C,UACAC,OAAQ,SACRC,OAAQ,CAAC,GAAI,KACdC,UAAU,CAAEnD,IAAKrJ,EAAOW,UAAW2I,IAAKtJ,EAAOS,U","sources":["webpack://element-web/./node_modules/@vector-im/compound-design-tokens/assets/web/icons/minus.js","webpack://element-web/./src/components/views/beacon/BeaconMarker.tsx","webpack://element-web/./src/utils/beacon/bounds.ts","webpack://element-web/./src/components/views/beacon/ShareLatestLocation.tsx","webpack://element-web/./src/components/views/beacon/BeaconListItem.tsx","webpack://element-web/./src/components/views/beacon/DialogSidebar.tsx","webpack://element-web/./src/components/views/beacon/DialogOwnBeaconStatus.tsx","webpack://element-web/./src/components/views/beacon/BeaconStatusTooltip.tsx","webpack://element-web/./src/components/views/beacon/BeaconViewDialog.tsx","webpack://element-web/./src/utils/beacon/useLiveBeacons.ts","webpack://element-web/./src/components/views/location/Map.tsx","webpack://element-web/./src/utils/location/useMap.ts","webpack://element-web/./src/components/views/location/ZoomButtons.tsx","webpack://element-web/./src/utils/location/map.ts"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction MinusIcon(props, ref) {\n return /*#__PURE__*/_jsx(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"1em\",\n height: \"1em\",\n fill: \"currentColor\",\n viewBox: \"0 0 24 24\",\n ref: ref,\n ...props,\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M6 13a.97.97 0 0 1-.713-.287A.97.97 0 0 1 5 12q0-.424.287-.713A.97.97 0 0 1 6 11h12q.424 0 .712.287.288.288.288.713 0 .424-.288.713A.97.97 0 0 1 18 13z\"\n })\n });\n}\n;\nMinusIcon.displayName = \"MinusIcon\";\nexport default forwardRef(MinusIcon);","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { type ReactNode, useContext } from \"react\";\nimport { type Beacon, BeaconEvent, LocationAssetType } from \"matrix-js-sdk/src/matrix\";\n\nimport type * as maplibregl from \"maplibre-gl\";\nimport MatrixClientContext from \"../../../contexts/MatrixClientContext\";\nimport { useEventEmitterState } from \"../../../hooks/useEventEmitter\";\nimport { SmartMarker } from \"../location\";\n\ninterface Props {\n map: maplibregl.Map;\n beacon: Beacon;\n tooltip?: ReactNode;\n}\n\n/**\n * Updates a map SmartMarker with latest location from given beacon\n */\nconst BeaconMarker: React.FC<Props> = ({ map, beacon, tooltip }) => {\n const latestLocationState = useEventEmitterState(\n beacon,\n BeaconEvent.LocationUpdate,\n () => beacon.latestLocationState,\n );\n const matrixClient = useContext(MatrixClientContext);\n const room = matrixClient.getRoom(beacon.roomId);\n\n if (!latestLocationState || !beacon.isLive) {\n return null;\n }\n\n const geoUri = latestLocationState.uri || \"\";\n\n const assetTypeIsSelf = beacon.beaconInfo?.assetType === LocationAssetType.Self;\n const _member = room?.getMember(beacon.beaconInfoOwner);\n\n const markerRoomMember = assetTypeIsSelf && _member ? _member : undefined;\n\n return (\n <SmartMarker\n map={map}\n id={beacon.identifier}\n geoUri={geoUri}\n roomMember={markerRoomMember}\n tooltip={tooltip}\n useMemberColor\n />\n );\n};\n\nexport default BeaconMarker;\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { type Beacon } from \"matrix-js-sdk/src/matrix\";\n\nimport { filterBoolean } from \"../arrays\";\nimport { parseGeoUri } from \"../location\";\n\nexport type Bounds = {\n north: number;\n east: number;\n west: number;\n south: number;\n};\n\n/**\n * Get the geo bounds of given list of beacons\n *\n * Latitude:\n * equator: 0, North pole: 90, South pole -90\n * Longitude:\n * Prime Meridian (Greenwich): 0\n * east of Greenwich has a positive longitude, max 180\n * west of Greenwich has a negative longitude, min -180\n */\nexport const getBeaconBounds = (beacons: Beacon[]): Bounds | undefined => {\n const coords = filterBoolean<GeolocationCoordinates>(\n beacons.map((beacon) =>\n !!beacon.latestLocationState?.uri ? parseGeoUri(beacon.latestLocationState.uri) : undefined,\n ),\n );\n\n if (!coords.length) {\n return;\n }\n\n // sort descending\n const sortedByLat = [...coords].sort((left, right) => right.latitude - left.latitude);\n const sortedByLong = [...coords].sort((left, right) => right.longitude - left.longitude);\n\n if (sortedByLat.length < 1 || sortedByLong.length < 1) return;\n\n return {\n north: sortedByLat[0]!.latitude,\n south: sortedByLat[sortedByLat.length - 1]!.latitude,\n east: sortedByLong[0]!.longitude,\n west: sortedByLong[sortedByLong.length - 1]!.longitude,\n };\n};\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { useEffect, useState } from \"react\";\nimport { type ContentHelpers } from \"matrix-js-sdk/src/matrix\";\nimport { Tooltip } from \"@vector-im/compound-web\";\nimport { PopOutIcon } from \"@vector-im/compound-design-tokens/assets/web/icons\";\n\nimport { _t } from \"../../../languageHandler\";\nimport { makeMapSiteLink, parseGeoUri } from \"../../../utils/location\";\nimport CopyableText from \"../elements/CopyableText\";\n\ninterface Props {\n latestLocationState?: ContentHelpers.BeaconLocationState;\n}\n\nconst ShareLatestLocation: React.FC<Props> = ({ latestLocationState }) => {\n const [coords, setCoords] = useState<GeolocationCoordinates | undefined>();\n useEffect(() => {\n if (!latestLocationState?.uri) {\n return;\n }\n const coords = parseGeoUri(latestLocationState.uri);\n setCoords(coords);\n }, [latestLocationState]);\n\n if (!latestLocationState || !coords) {\n return null;\n }\n\n const latLonString = `${coords.latitude},${coords.longitude}`;\n const mapLink = makeMapSiteLink(coords);\n\n return (\n <>\n <Tooltip label={_t(\"timeline|context_menu|open_in_osm\")}>\n <a data-testid=\"open-location-in-osm\" href={mapLink} target=\"_blank\" rel=\"noreferrer noopener\">\n <PopOutIcon className=\"mx_ShareLatestLocation_icon\" />\n </a>\n </Tooltip>\n <CopyableText className=\"mx_ShareLatestLocation_copy\" border={false} getTextToCopy={() => latLonString} />\n </>\n );\n};\n\nexport default ShareLatestLocation;\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { type HTMLProps, useContext } from \"react\";\nimport { type Beacon, BeaconEvent, LocationAssetType } from \"matrix-js-sdk/src/matrix\";\nimport { humanizeTime } from \"@element-hq/web-shared-components\";\n\nimport MatrixClientContext from \"../../../contexts/MatrixClientContext\";\nimport { useEventEmitterState } from \"../../../hooks/useEventEmitter\";\nimport { preventDefaultWrapper } from \"../../../utils/NativeEventUtils\";\nimport { _t } from \"../../../languageHandler\";\nimport MemberAvatar from \"../avatars/MemberAvatar\";\nimport BeaconStatus from \"./BeaconStatus\";\nimport { BeaconDisplayStatus } from \"./displayStatus\";\nimport StyledLiveBeaconIcon from \"./StyledLiveBeaconIcon\";\nimport ShareLatestLocation from \"./ShareLatestLocation\";\n\ninterface Props {\n beacon: Beacon;\n}\n\nconst BeaconListItem: React.FC<Props & HTMLProps<HTMLLIElement>> = ({ beacon, ...rest }) => {\n const latestLocationState = useEventEmitterState(\n beacon,\n BeaconEvent.LocationUpdate,\n () => beacon.latestLocationState,\n );\n const matrixClient = useContext(MatrixClientContext);\n const room = matrixClient.getRoom(beacon.roomId);\n\n if (!latestLocationState || !beacon.isLive || !room) {\n return null;\n }\n\n const isSelfLocation = beacon.beaconInfo?.assetType === LocationAssetType.Self;\n const beaconMember = isSelfLocation ? room.getMember(beacon.beaconInfoOwner) : null;\n\n const humanizedUpdateTime = (latestLocationState.timestamp && humanizeTime(latestLocationState.timestamp)) || \"\";\n\n return (\n <li className=\"mx_BeaconListItem\" {...rest}>\n {isSelfLocation ? (\n <MemberAvatar className=\"mx_BeaconListItem_avatar\" member={beaconMember} size=\"32px\" />\n ) : (\n <StyledLiveBeaconIcon className=\"mx_BeaconListItem_avatarIcon\" />\n )}\n <div className=\"mx_BeaconListItem_info\">\n <BeaconStatus\n className=\"mx_BeaconListItem_status\"\n beacon={beacon}\n label={beaconMember?.name || beacon.beaconInfo?.description || beacon.beaconInfoOwner}\n displayStatus={BeaconDisplayStatus.Active}\n >\n {/* eat events from interactive share buttons\n so parent click handlers are not triggered */}\n <div className=\"mx_BeaconListItem_interactions\" onClick={preventDefaultWrapper(() => {})}>\n <ShareLatestLocation latestLocationState={latestLocationState} />\n </div>\n </BeaconStatus>\n <span className=\"mx_BeaconListItem_lastUpdated\">\n {_t(\"location_sharing|live_update_time\", { humanizedUpdateTime })}\n </span>\n </div>\n </li>\n );\n};\n\nexport default BeaconListItem;\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React from \"react\";\nimport { type Beacon } from \"matrix-js-sdk/src/matrix\";\nimport CloseIcon from \"@vector-im/compound-design-tokens/assets/web/icons/close\";\n\nimport { _t } from \"../../../languageHandler\";\nimport AccessibleButton from \"../elements/AccessibleButton\";\nimport Heading from \"../typography/Heading\";\nimport BeaconListItem from \"./BeaconListItem\";\n\ninterface Props {\n beacons: Beacon[];\n requestClose: () => void;\n onBeaconClick: (beacon: Beacon) => void;\n}\n\nconst DialogSidebar: React.FC<Props> = ({ beacons, onBeaconClick, requestClose }) => {\n return (\n <div className=\"mx_DialogSidebar\">\n <div className=\"mx_DialogSidebar_header\">\n <Heading size=\"4\">{_t(\"action|view_list\")}</Heading>\n <AccessibleButton\n className=\"mx_DialogSidebar_closeButton\"\n onClick={requestClose}\n title={_t(\"location_sharing|close_sidebar\")}\n data-testid=\"dialog-sidebar-close\"\n >\n <CloseIcon className=\"mx_DialogSidebar_closeButtonIcon\" height=\"24px\" width=\"24px\" />\n </AccessibleButton>\n </div>\n {beacons?.length ? (\n <ol className=\"mx_DialogSidebar_list\">\n {beacons.map((beacon) => (\n <BeaconListItem key={beacon.identifier} beacon={beacon} onClick={() => onBeaconClick(beacon)} />\n ))}\n </ol>\n ) : (\n <div className=\"mx_DialogSidebar_noResults\">{_t(\"location_sharing|live_locations_empty\")}</div>\n )}\n </div>\n );\n};\n\nexport default DialogSidebar;\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { useContext } from \"react\";\nimport { type Room, type Beacon, LocationAssetType } from \"matrix-js-sdk/src/matrix\";\n\nimport { OwnBeaconStore, OwnBeaconStoreEvent } from \"../../../stores/OwnBeaconStore\";\nimport { useEventEmitterState } from \"../../../hooks/useEventEmitter\";\nimport OwnBeaconStatus from \"./OwnBeaconStatus\";\nimport { BeaconDisplayStatus } from \"./displayStatus\";\nimport MatrixClientContext from \"../../../contexts/MatrixClientContext\";\nimport MemberAvatar from \"../avatars/MemberAvatar\";\nimport StyledLiveBeaconIcon from \"./StyledLiveBeaconIcon\";\n\ninterface Props {\n roomId: Room[\"roomId\"];\n}\n\nconst useOwnBeacon = (roomId: Room[\"roomId\"]): Beacon | undefined => {\n const ownBeacon = useEventEmitterState(OwnBeaconStore.instance, OwnBeaconStoreEvent.LivenessChange, () => {\n const [ownBeaconId] = OwnBeaconStore.instance.getLiveBeaconIds(roomId);\n return OwnBeaconStore.instance.getBeaconById(ownBeaconId);\n });\n\n return ownBeacon;\n};\n\nconst DialogOwnBeaconStatus: React.FC<Props> = ({ roomId }) => {\n const beacon = useOwnBeacon(roomId);\n\n const matrixClient = useContext(MatrixClientContext);\n const room = matrixClient.getRoom(roomId);\n\n if (!beacon?.isLive || !room) {\n return null;\n }\n\n const isSelfLocation = beacon.beaconInfo?.assetType === LocationAssetType.Self;\n const beaconMember = isSelfLocation ? room.getMember(beacon.beaconInfoOwner) : null;\n\n return (\n <div className=\"mx_DialogOwnBeaconStatus\">\n {isSelfLocation ? (\n <MemberAvatar className=\"mx_DialogOwnBeaconStatus_avatar\" member={beaconMember} size=\"32px\" />\n ) : (\n <StyledLiveBeaconIcon className=\"mx_DialogOwnBeaconStatus_avatarIcon\" />\n )}\n <OwnBeaconStatus\n className=\"mx_DialogOwnBeaconStatus_status\"\n beacon={beacon}\n displayStatus={BeaconDisplayStatus.Active}\n />\n </div>\n );\n};\n\nexport default DialogOwnBeaconStatus;\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { useContext } from \"react\";\nimport { type Beacon, LocationAssetType } from \"matrix-js-sdk/src/matrix\";\n\nimport MatrixClientContext from \"../../../contexts/MatrixClientContext\";\nimport BeaconStatus from \"./BeaconStatus\";\nimport { BeaconDisplayStatus } from \"./displayStatus\";\nimport ShareLatestLocation from \"./ShareLatestLocation\";\n\ninterface Props {\n beacon: Beacon;\n}\n\nconst useBeaconName = (beacon: Beacon): string | undefined => {\n const matrixClient = useContext(MatrixClientContext);\n\n if (beacon.beaconInfo?.assetType !== LocationAssetType.Self) {\n return beacon.beaconInfo?.description;\n }\n const room = matrixClient.getRoom(beacon.roomId);\n const member = room?.getMember(beacon.beaconInfoOwner);\n\n return member?.rawDisplayName || beacon.beaconInfoOwner;\n};\n\nconst BeaconStatusTooltip: React.FC<Props> = ({ beacon }) => {\n const label = useBeaconName(beacon);\n\n return (\n <div className=\"mx_BeaconStatusTooltip\">\n <BeaconStatus\n beacon={beacon}\n label={label}\n displayStatus={BeaconDisplayStatus.Active}\n displayLiveTimeRemaining\n className=\"mx_BeaconStatusTooltip_inner\"\n >\n <ShareLatestLocation latestLocationState={beacon.latestLocationState} />\n </BeaconStatus>\n </div>\n );\n};\n\nexport default BeaconStatusTooltip;\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { useState, useEffect } from \"react\";\nimport { type MatrixClient, type Beacon, type Room } from \"matrix-js-sdk/src/matrix\";\n\nimport type * as maplibregl from \"maplibre-gl\";\nimport { Icon as LiveLocationIcon } from \"../../../../res/img/location/live-location.svg\";\nimport { useLiveBeacons } from \"../../../utils/beacon/useLiveBeacons\";\nimport MatrixClientContext from \"../../../contexts/MatrixClientContext\";\nimport BaseDialog from \"../dialogs/BaseDialog\";\nimport Map from \"../location/Map\";\nimport ZoomButtons from \"../location/ZoomButtons\";\nimport BeaconMarker from \"./BeaconMarker\";\nimport { type Bounds, getBeaconBounds } from \"../../../utils/beacon/bounds\";\nimport { getGeoUri } from \"../../../utils/beacon\";\nimport { _t } from \"../../../languageHandler\";\nimport AccessibleButton from \"../elements/AccessibleButton\";\nimport DialogSidebar from \"./DialogSidebar\";\nimport DialogOwnBeaconStatus from \"./DialogOwnBeaconStatus\";\nimport BeaconStatusTooltip from \"./BeaconStatusTooltip\";\nimport MapFallback from \"../location/MapFallback\";\nimport { MapError } from \"../location/MapError\";\nimport { type LocationShareError } from \"../../../utils/location\";\n\nexport interface IProps {\n roomId: Room[\"roomId\"];\n matrixClient: MatrixClient;\n // open the map centered on this beacon's location\n initialFocusedBeacon?: Beacon;\n onFinished(): void;\n}\n\n// track the 'focused time' as ts\n// to make it possible to refocus the same beacon\n// as the beacon location may change\n// or the map may move around\ninterface FocusedBeaconState {\n ts: number;\n beacon?: Beacon;\n}\n\nconst getBoundsCenter = (bounds?: Bounds): string | undefined => {\n if (!bounds) {\n return;\n }\n return getGeoUri({\n latitude: (bounds.north + bounds.south) / 2,\n longitude: (bounds.east + bounds.west) / 2,\n timestamp: Date.now(),\n });\n};\n\nconst useMapPosition = (\n liveBeacons: Beacon[],\n { beacon, ts }: FocusedBeaconState,\n): {\n bounds?: Bounds;\n centerGeoUri?: string;\n} => {\n const [bounds, setBounds] = useState<Bounds | undefined>(getBeaconBounds(liveBeacons));\n const [centerGeoUri, setCenterGeoUri] = useState<string | undefined>(\n beacon?.latestLocationState?.uri || getBoundsCenter(bounds),\n );\n\n useEffect(() => {\n if (\n // this check ignores the first initial focused beacon state\n // as centering logic on map zooms to show everything\n // instead of focusing down\n ts !== 0 &&\n // only set focus to a known location\n beacon?.latestLocationState?.uri\n ) {\n // append custom `mxTs` parameter to geoUri\n // so map is triggered to refocus on this uri\n // event if it was previously the center geouri\n // but the map have moved/zoomed\n setCenterGeoUri(`${beacon?.latestLocationState?.uri};mxTs=${Date.now()}`);\n setBounds(getBeaconBounds([beacon]));\n }\n }, [beacon, ts]);\n\n return { bounds, centerGeoUri };\n};\n\n/**\n * Dialog to view live beacons maximised\n */\nconst BeaconViewDialog: React.FC<IProps> = ({ initialFocusedBeacon, roomId, matrixClient, onFinished }) => {\n const liveBeacons = useLiveBeacons(roomId, matrixClient);\n const [focusedBeaconState, setFocusedBeaconState] = useState<FocusedBeaconState>({\n beacon: initialFocusedBeacon,\n ts: 0,\n });\n\n const [isSidebarOpen, setSidebarOpen] = useState(false);\n\n const { bounds, centerGeoUri } = useMapPosition(liveBeacons, focusedBeaconState);\n\n const [mapDisplayError, setMapDisplayError] = useState<unknown>();\n\n // automatically open the sidebar if there is no map to see\n useEffect(() => {\n if (mapDisplayError) {\n setSidebarOpen(true);\n }\n }, [mapDisplayError]);\n\n const onBeaconListItemClick = (beacon: Beacon): void => {\n setFocusedBeaconState({ beacon, ts: Date.now() });\n };\n\n const hasOwnBeacon =\n liveBeacons.filter((beacon) => beacon?.beaconInfoOwner === matrixClient.getUserId()).length > 0;\n\n return (\n <BaseDialog className=\"mx_BeaconViewDialog\" onFinished={onFinished} fixedWidth={false}>\n <MatrixClientContext.Provider value={matrixClient}>\n {centerGeoUri && !mapDisplayError && (\n <Map\n id=\"mx_BeaconViewDialog\"\n bounds={bounds}\n centerGeoUri={centerGeoUri}\n interactive\n onError={setMapDisplayError}\n className=\"mx_BeaconViewDialog_map\"\n allowGeolocate={!hasOwnBeacon}\n >\n {({ map }: { map: maplibregl.Map }) => (\n <>\n {liveBeacons.map((beacon) => (\n <BeaconMarker\n key={beacon.identifier}\n map={map}\n beacon={beacon}\n tooltip={<BeaconStatusTooltip beacon={beacon} />}\n />\n ))}\n <ZoomButtons map={map} />\n </>\n )}\n </Map>\n )}\n {mapDisplayError instanceof Error && (\n <MapError error={mapDisplayError.message as LocationShareError} isMinimised />\n )}\n {!centerGeoUri && !mapDisplayError && (\n <MapFallback data-testid=\"beacon-view-dialog-map-fallback\" className=\"mx_BeaconViewDialog_map\">\n <span className=\"mx_BeaconViewDialog_mapFallbackMessage\">\n {_t(\"location_sharing|live_locations_empty\")}\n </span>\n <AccessibleButton\n kind=\"primary\"\n onClick={onFinished}\n data-testid=\"beacon-view-dialog-fallback-close\"\n >\n {_t(\"action|close\")}\n </AccessibleButton>\n </MapFallback>\n )}\n {isSidebarOpen ? (\n <DialogSidebar\n beacons={liveBeacons}\n onBeaconClick={onBeaconListItemClick}\n requestClose={() => setSidebarOpen(false)}\n />\n ) : (\n <AccessibleButton\n kind=\"primary\"\n onClick={() => setSidebarOpen(true)}\n data-testid=\"beacon-view-dialog-open-sidebar\"\n className=\"mx_BeaconViewDialog_viewListButton\"\n >\n <LiveLocationIcon height={12} />\n \n {_t(\"action|view_list\")}\n </AccessibleButton>\n )}\n <DialogOwnBeaconStatus roomId={roomId} />\n </MatrixClientContext.Provider>\n </BaseDialog>\n );\n};\n\nexport default BeaconViewDialog;\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { type Beacon, type Room, RoomStateEvent, type MatrixClient } from \"matrix-js-sdk/src/matrix\";\n\nimport { useEventEmitterState } from \"../../hooks/useEventEmitter\";\n\n/**\n * Returns an array of all live beacon ids for a given room\n *\n * Beacons are removed from array when they become inactive\n */\nexport const useLiveBeacons = (roomId: Room[\"roomId\"], matrixClient: MatrixClient): Beacon[] => {\n const room = matrixClient.getRoom(roomId);\n\n const liveBeacons = useEventEmitterState(\n room?.currentState,\n RoomStateEvent.BeaconLiveness,\n () =>\n room?.currentState?.liveBeaconIds.map(\n (beaconIdentifier) => room.currentState.beacons.get(beaconIdentifier)!,\n ) || [],\n );\n\n return liveBeacons;\n};\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { type ReactNode, useContext, useEffect, useState } from \"react\";\nimport classNames from \"classnames\";\nimport * as maplibregl from \"maplibre-gl\";\nimport { ClientEvent, type IClientWellKnown } from \"matrix-js-sdk/src/matrix\";\nimport { logger } from \"matrix-js-sdk/src/logger\";\n\nimport MatrixClientContext from \"../../../contexts/MatrixClientContext\";\nimport { useEventEmitterState } from \"../../../hooks/useEventEmitter\";\nimport { parseGeoUri, positionFailureMessage } from \"../../../utils/location\";\nimport { tileServerFromWellKnown } from \"../../../utils/WellKnownUtils\";\nimport { useMap } from \"../../../utils/location/useMap\";\nimport { type Bounds } from \"../../../utils/beacon/bounds\";\nimport Modal from \"../../../Modal\";\nimport ErrorDialog from \"../dialogs/ErrorDialog\";\nimport { _t } from \"../../../languageHandler\";\n\nconst useMapWithStyle = ({\n id,\n centerGeoUri,\n onError,\n interactive,\n bounds,\n allowGeolocate,\n}: {\n id: string;\n centerGeoUri?: string;\n onError?(error: Error): void;\n interactive?: boolean;\n bounds?: Bounds;\n allowGeolocate?: boolean;\n}): {\n map: maplibregl.Map | undefined;\n bodyId: string;\n} => {\n const bodyId = `mx_Map_${id}`;\n\n // style config\n const context = useContext(MatrixClientContext);\n const mapStyleUrl = useEventEmitterState(\n context,\n ClientEvent.ClientWellKnown,\n (clientWellKnown: IClientWellKnown) => tileServerFromWellKnown(clientWellKnown)?.[\"map_style_url\"],\n );\n\n const map = useMap({ interactive, bodyId, onError });\n\n useEffect(() => {\n if (mapStyleUrl && map) {\n map.setStyle(mapStyleUrl);\n }\n }, [mapStyleUrl, map]);\n\n useEffect(() => {\n if (map && centerGeoUri) {\n try {\n const coords = parseGeoUri(centerGeoUri);\n if (!coords) {\n throw new Error(\"Invalid geo URI\");\n }\n map.setCenter({ lon: coords.longitude, lat: coords.latitude });\n } catch (e) {\n logger.error(\"Could not set map center\", e);\n }\n }\n }, [map, centerGeoUri]);\n\n useEffect(() => {\n if (map && bounds) {\n try {\n const lngLatBounds = new maplibregl.LngLatBounds(\n [bounds.west, bounds.south],\n [bounds.east, bounds.north],\n );\n map.fitBounds(lngLatBounds, { padding: 100, maxZoom: 15 });\n } catch (e) {\n logger.error(\"Invalid map bounds\", e);\n }\n }\n }, [map, bounds]);\n\n const [geolocate, setGeolocate] = useState<maplibregl.GeolocateControl | null>(null);\n\n useEffect(() => {\n if (!map) {\n return;\n }\n if (allowGeolocate && !geolocate) {\n const geolocate = new maplibregl.GeolocateControl({\n positionOptions: {\n enableHighAccuracy: true,\n },\n trackUserLocation: false,\n });\n setGeolocate(geolocate);\n map.addControl(geolocate);\n }\n if (!allowGeolocate && geolocate) {\n map.removeControl(geolocate);\n setGeolocate(null);\n }\n }, [map, geolocate, allowGeolocate]);\n\n useEffect(() => {\n if (geolocate) {\n geolocate.on(\"error\", onGeolocateError);\n return () => {\n geolocate.off(\"error\", onGeolocateError);\n };\n }\n }, [geolocate]);\n\n return {\n map,\n bodyId,\n };\n};\n\nconst onGeolocateError = (e: GeolocationPositionError): void => {\n logger.error(\"Could not fetch location\", e);\n Modal.createDialog(ErrorDialog, {\n title: _t(\"location_sharing|error_fetch_location\"),\n description: positionFailureMessage(e.code) ?? \"\",\n });\n};\n\nexport interface MapProps {\n id: string;\n interactive?: boolean;\n /**\n * set map center to geoUri coords\n * Center will only be set to valid geoUri\n * this prop is only simply diffed by useEffect, so to trigger *recentering* of the same geoUri\n * append the uri with a var not used by the geoUri spec\n * eg a timestamp: `geo:54,42;mxTs=123`\n */\n centerGeoUri?: string;\n bounds?: Bounds;\n className?: string;\n allowGeolocate?: boolean;\n onClick?: () => void;\n onError?: (error: Error) => void;\n children?: (renderProps: { map: maplibregl.Map }) => ReactNode;\n}\n\nconst MapComponent: React.FC<MapProps> = ({\n bounds,\n centerGeoUri,\n children,\n className,\n allowGeolocate,\n id,\n interactive,\n onError,\n onClick,\n}) => {\n const { map, bodyId } = useMapWithStyle({ centerGeoUri, onError, id, interactive, bounds, allowGeolocate });\n\n const onMapClick = (event: React.MouseEvent<HTMLDivElement, MouseEvent>): void => {\n // Eat click events when clicking the attribution button\n const target = event.target as Element;\n if (target.classList.contains(\"maplibregl-ctrl-attrib-button\")) {\n return;\n }\n\n onClick?.();\n };\n\n return (\n <div className={classNames(\"mx_Map\", className)} id={bodyId} onClick={onMapClick}>\n {!!children && !!map && children({ map })}\n </div>\n );\n};\n\nexport default MapComponent;\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { useEffect, useState } from \"react\";\n\nimport type { Map as MapLibreMap } from \"maplibre-gl\";\nimport { createMap } from \"./map\";\nimport { useMatrixClientContext } from \"../../contexts/MatrixClientContext\";\n\ninterface UseMapProps {\n bodyId: string;\n onError?: (error: Error) => void;\n interactive?: boolean;\n}\n\n/**\n * Create a map instance\n * Add listeners for errors\n * Make sure `onError` has a stable reference\n * As map is recreated on changes to it\n */\nexport const useMap = ({ interactive, bodyId, onError }: UseMapProps): MapLibreMap | undefined => {\n const cli = useMatrixClientContext();\n const [map, setMap] = useState<MapLibreMap>();\n\n useEffect(\n () => {\n let map: MapLibreMap | undefined;\n try {\n map = createMap(cli, !!interactive, bodyId, onError);\n setMap(map);\n } catch (error) {\n console.error(\"Error encountered in useMap\", error);\n if (error instanceof Error) {\n onError?.(error);\n }\n }\n return () => {\n if (map) {\n map.remove();\n setMap(undefined);\n }\n };\n },\n // map is excluded as a dependency\n [cli, interactive, bodyId, onError],\n );\n\n return map;\n};\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React from \"react\";\nimport { PlusIcon, MinusIcon } from \"@vector-im/compound-design-tokens/assets/web/icons\";\n\nimport type * as maplibregl from \"maplibre-gl\";\nimport { _t } from \"../../../languageHandler\";\nimport AccessibleButton from \"../elements/AccessibleButton\";\n\ninterface Props {\n map: maplibregl.Map;\n}\n\nconst ZoomButtons: React.FC<Props> = ({ map }) => {\n const onZoomIn = (): void => {\n map.zoomIn();\n };\n\n const onZoomOut = (): void => {\n map.zoomOut();\n };\n\n return (\n <div className=\"mx_ZoomButtons\">\n <AccessibleButton\n onClick={onZoomIn}\n data-testid=\"map-zoom-in-button\"\n title={_t(\"action|zoom_in\")}\n className=\"mx_ZoomButtons_button\"\n >\n <PlusIcon className=\"mx_ZoomButtons_icon\" />\n </AccessibleButton>\n <AccessibleButton\n onClick={onZoomOut}\n data-testid=\"map-zoom-out-button\"\n title={_t(\"action|zoom_out\")}\n className=\"mx_ZoomButtons_button\"\n >\n <MinusIcon className=\"mx_ZoomButtons_icon\" />\n </AccessibleButton>\n </div>\n );\n};\n\nexport default ZoomButtons;\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport * as maplibregl from \"maplibre-gl\";\nimport { type MatrixClient } from \"matrix-js-sdk/src/matrix\";\nimport { logger } from \"matrix-js-sdk/src/logger\";\n\nimport { _t } from \"../../languageHandler\";\nimport { findMapStyleUrl } from \"./findMapStyleUrl\";\nimport { LocationShareError } from \"./LocationShareErrors\";\n\nexport const createMap = (\n client: MatrixClient,\n interactive: boolean,\n bodyId: string,\n onError?: (error: Error) => void,\n): maplibregl.Map => {\n try {\n const styleUrl = findMapStyleUrl(client);\n\n const map = new maplibregl.Map({\n container: bodyId,\n style: styleUrl,\n zoom: 15,\n interactive,\n attributionControl: false,\n locale: {\n \"AttributionControl.ToggleAttribution\": _t(\"location_sharing|toggle_attribution\"),\n \"AttributionControl.MapFeedback\": _t(\"location_sharing|map_feedback\"),\n \"FullscreenControl.Enter\": _t(\"action|enter_fullscreen\"),\n \"FullscreenControl.Exit\": _t(\"action|exit_fullscreeen\"),\n \"GeolocateControl.FindMyLocation\": _t(\"location_sharing|find_my_location\"),\n \"GeolocateControl.LocationNotAvailable\": _t(\"location_sharing|location_not_available\"),\n \"LogoControl.Title\": _t(\"location_sharing|mapbox_logo\"),\n \"NavigationControl.ResetBearing\": _t(\"location_sharing|reset_bearing\"),\n \"NavigationControl.ZoomIn\": _t(\"action|zoom_in\"),\n \"NavigationControl.ZoomOut\": _t(\"action|zoom_out\"),\n },\n });\n map.addControl(new maplibregl.AttributionControl(), \"top-right\");\n\n map.on(\"error\", (e) => {\n logger.error(\"Failed to load map: check map_style_url in config.json has a valid URL and API key\", e.error);\n onError?.(new Error(LocationShareError.MapStyleUrlNotReachable));\n });\n\n return map;\n } catch (e) {\n logger.error(\"Failed to render map\", e);\n const errorMessage = (e as Error)?.message;\n if (errorMessage.includes(\"Failed to initialize WebGL\")) throw new Error(LocationShareError.WebGLNotEnabled);\n throw e;\n }\n};\n\nexport const createMarker = (coords: GeolocationCoordinates, element: HTMLElement): maplibregl.Marker => {\n const marker = new maplibregl.Marker({\n element,\n anchor: \"bottom\",\n offset: [0, -1],\n }).setLngLat({ lon: coords.longitude, lat: coords.latitude });\n return marker;\n};\n"],"names":["MinusIcon","props","ref","xmlns","width","height","fill","viewBox","children","d","displayName","forwardRef","BeaconMarker","map","beacon","tooltip","_beacon$beaconInfo","latestLocationState","useEventEmitterState","BeaconEvent","LocationUpdate","room","useContext","MatrixClientContext","getRoom","roomId","isLive","geoUri","uri","assetTypeIsSelf","beaconInfo","assetType","LocationAssetType","Self","_member","getMember","beaconInfoOwner","markerRoomMember","undefined","React","SmartMarker","id","identifier","roomMember","useMemberColor","getBeaconBounds","beacons","coords","filterBoolean","_beacon$latestLocatio","parseGeoUri","length","sortedByLat","sort","left","right","latitude","sortedByLong","longitude","north","south","east","west","ShareLatestLocation","setCoords","useState","useEffect","latLonString","mapLink","makeMapSiteLink","Tooltip","label","_t","href","target","rel","PopOutIcon","className","CopyableText","border","getTextToCopy","_ref","_beacon$beaconInfo2","rest","_objectWithoutProperties","_excluded","isSelfLocation","beaconMember","humanizedUpdateTime","timestamp","humanizeTime","_extends","MemberAvatar","member","size","StyledLiveBeaconIcon","BeaconStatus","name","description","displayStatus","BeaconDisplayStatus","Active","onClick","preventDefaultWrapper","DialogSidebar","onBeaconClick","requestClose","Heading","AccessibleButton","title","CloseIcon","BeaconListItem","key","DialogOwnBeaconStatus","OwnBeaconStore","instance","OwnBeaconStoreEvent","LivenessChange","ownBeaconId","getLiveBeaconIds","getBeaconById","useOwnBeacon","OwnBeaconStatus","BeaconStatusTooltip","matrixClient","rawDisplayName","useBeaconName","displayLiveTimeRemaining","getBoundsCenter","bounds","getGeoUri","Date","now","BeaconViewDialog","initialFocusedBeacon","onFinished","liveBeacons","useLiveBeacons","currentState","RoomStateEvent","BeaconLiveness","_room$currentState","liveBeaconIds","beaconIdentifier","get","focusedBeaconState","setFocusedBeaconState","ts","isSidebarOpen","setSidebarOpen","centerGeoUri","useMapPosition","setBounds","setCenterGeoUri","_beacon$latestLocatio2","_beacon$latestLocatio3","mapDisplayError","setMapDisplayError","hasOwnBeacon","filter","getUserId","BaseDialog","fixedWidth","Provider","value","Map","interactive","onError","allowGeolocate","ZoomButtons","Error","MapError","error","message","isMinimised","MapFallback","kind","LiveLocationIcon","useMapWithStyle","bodyId","context","mapStyleUrl","ClientEvent","ClientWellKnown","clientWellKnown","_tileServerFromWellKn","tileServerFromWellKnown","useMap","cli","useMatrixClientContext","setMap","createMap","console","remove","setStyle","setCenter","lon","lat","e","logger","lngLatBounds","maplibregl","fitBounds","padding","maxZoom","geolocate","setGeolocate","positionOptions","enableHighAccuracy","trackUserLocation","addControl","removeControl","on","onGeolocateError","off","_positionFailureMessa","Modal","createDialog","ErrorDialog","positionFailureMessage","code","MapComponent","classNames","event","classList","contains","onZoomIn","zoomIn","PlusIcon","onZoomOut","zoomOut","client","styleUrl","findMapStyleUrl","container","style","zoom","attributionControl","locale","LocationShareError","MapStyleUrlNotReachable","includes","WebGLNotEnabled","createMarker","element","anchor","offset","setLngLat"],"ignoreList":[],"sourceRoot":""}