Your IP : 3.133.133.6


Current Path : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/location/widget/dist/
Upload File :
Current File : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/location/widget/dist/widget.bundle.js.map

{"version":3,"file":"widget.bundle.js","sources":["../src/state.js","../src/mappopup/addressstring.js","../src/mappopup/addressapplier.js","../src/mappopup/popup.js","../src/mappopup/mappopup.js","../src/address/features/basefeature.js","../src/address/address.js","../src/autocomplete/menubottom.js","../src/autocomplete/menu.js","../src/autocomplete/prompt.js","../src/autocomplete/addressstring.js","../src/autocomplete/autocomplete.js","../src/mappopup/photo.js","../src/mappopup/gallery.js","../src/fields/field.js","../src/fields/fields.js","../src/address/features/mapfeature.js","../src/address/features/autocompletefeature.js","../src/address/features/fieldsfeature.js","../src/address/features/mapfeatureauto.js","../src/factory.js","../src/ui-address/switch.js","../src/ui-address/icon.js","../src/ui-address/ui-address.js","../src/widget.js"],"sourcesContent":["/**\n * Contains\n * */\nexport default class State\n{\n\tstatic INITIAL = 'INITIAL';\n\tstatic DATA_INPUTTING = 'DATA_INPUTTING';\n\tstatic DATA_SELECTED = 'DATA_SELECTED';\n\tstatic DATA_SUPPOSED = 'DATA_SUPPOSED';\n\tstatic DATA_LOADING = 'DATA_LOADING';\n\tstatic DATA_LOADED = 'DATA_LOADED';\n}","import {Tag} from 'main.core';\nimport {Address, Format, AddressStringConverter, FormatTemplateType} from 'location.core';\n\nexport default class AddressString\n{\n\t#address;\n\t#element;\n\t#stringElement;\n\t#addressFormat;\n\n\tconstructor(props)\n\t{\n\t\tif (!(props.addressFormat instanceof Format))\n\t\t{\n\t\t\tthrow new Error('addressFormat must be instance of Format');\n\t\t}\n\n\t\tthis.#addressFormat = props.addressFormat;\n\t}\n\n\tset address(address: ?Address): void\n\t{\n\t\tthis.#address = address;\n\n\t\tif (!this.#stringElement)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#stringElement.innerHTML = this.#convertAddressToString(address);\n\n\t\tif (!address && !this.isHidden())\n\t\t{\n\t\t\tthis.hide();\n\t\t}\n\t\telse if (address && this.isHidden())\n\t\t{\n\t\t\tthis.show();\n\t\t}\n\t}\n\n\t#convertAddressToString(address: ?Address): string\n\t{\n\t\tlet result = '';\n\n\t\tif (address)\n\t\t{\n\t\t\tresult = AddressStringConverter.convertAddressToStringTemplate(\n\t\t\t\taddress,\n\t\t\t\tthis.#addressFormat.getTemplate(FormatTemplateType.DEFAULT),\n\t\t\t\tAddressStringConverter.CONTENT_TYPE_HTML,\n\t\t\t\t', ',\n\t\t\t\tthis.#addressFormat\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\t\n\trender(props): Element\n\t{\n\t\tthis.#address = props.address;\n\t\tconst addresStr = this.#convertAddressToString(this.#address);\n\t\tthis.#stringElement = Tag.render`<div class=\"location-map-address-text\">${addresStr}</div>`;\n\n\t\tthis.#element = Tag.render`\n\t\t\t<div class=\"location-map-address-container\">\n\t\t\t\t<div class=\"location-map-address-icon\"></div>\n\t\t\t\t${this.#stringElement}\n\t\t\t</div>`;\n\n\t\tif (addresStr === '')\n\t\t{\n\t\t\tthis.hide();\n\t\t}\n\n\t\treturn this.#element;\n\t}\n\n\tshow()\n\t{\n\t\tif (this.#element)\n\t\t{\n\t\t\tthis.#element.style.display = 'block';\n\t\t}\n\t}\n\n\thide()\n\t{\n\t\tif (this.#element)\n\t\t{\n\t\t\tthis.#element.style.display = 'none';\n\t\t}\n\t}\n\n\tisHidden()\n\t{\n\t\treturn !this.#element || this.#element.style.display === 'none';\n\t}\n}","import {Vue} from 'ui.vue';\nimport {Address, AddressStringConverter} from 'location.core';\n\nexport default Vue.extend({\n\tprops: {\n\t\taddress: {required: true},\n\t\taddressFormat: {required: true},\n\t\tisHidden: {required: true},\n\t},\n\tmethods: {\n\t\thandleApplyClick()\n\t\t{\n\t\t\tthis.$emit('apply', {address: this.address});\n\t\t},\n\t\tconvertAddressToString(address: ?Address): string\n\t\t{\n\t\t\tif (!address)\n\t\t\t{\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\treturn address.toString(this.addressFormat, AddressStringConverter.STRATEGY_TYPE_TEMPLATE_COMMA);\n\t\t}\n\t},\n\tcomputed: {\n\t\taddressString()\n\t\t{\n\t\t\tif (!this.address)\n\t\t\t{\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\treturn this.address.toString(this.addressFormat, AddressStringConverter.STRATEGY_TYPE_TEMPLATE_COMMA, AddressStringConverter.CONTENT_TYPE_TEXT);\n\t\t},\n\t\tcontainerStyles()\n\t\t{\n\t\t\treturn {\n\t\t\t\tdisplay: this.isHidden ? 'none' : 'flex'\n\t\t\t};\n\t\t},\n\t\tcontainerClasses()\n\t\t{\n\t\t\treturn this.isHidden ? {hidden: true} : {};\n\t\t},\n\t\tlocalize()\n\t\t{\n\t\t\treturn Vue.getFilteredPhrases('LOCATION_WIDGET_');\n\t\t},\n\t},\n\ttemplate: `\n\t\t<div\n\t\t\t:class=\"containerClasses\"\n\t\t\t:style=\"containerStyles\"\n\t\t\tclass=\"location-map-address-changed\"\n\t\t>\n\t\t\t<div class=\"location-map-address-changed-inner\">\n\t\t\t<div class=\"location-map-address-changed-title\">\n\t\t\t\t{{localize.LOCATION_WIDGET_AUI_ADDRESS_CHANGED_NEW_ADDRESS}}\n\t\t\t</div>\n\t\t\t<div class=\"location-map-address-changed-text\">{{addressString}}</div>\n\t\t\t</div>\n\t\t\t<button @click=\"handleApplyClick\" type=\"button\" class=\"location-map-address-apply-btn\">\n\t\t\t\t{{localize.LOCATION_WIDGET_AUI_ADDRESS_APPLY}}\n\t\t\t</button>\n\t\t</div>\t\n\t`\n});\n","import {Popup as MainPopup} from 'main.popup';\nimport {Dom} from 'main.core';\n\n/**\n * Popup window, which contains map\n */\nexport default class Popup extends MainPopup\n{\n\tgetBindElement()\n\t{\n\t\treturn this.bindElement;\n\t}\n\n\tadjustPosition(bindOptions: {\n\t\tforceBindPosition?: boolean,\n\t\tforceLeft?: boolean,\n\t\tforceTop?: boolean,\n\t\tposition?: 'right' | 'top' | 'bootom'\n\t}): void\n\t{\n\t\tlet isCustomPosition, isCustomPositionSuccess;\n\n\t\tif (this.bindOptions.position && this.bindOptions.position === 'right')\n\t\t{\n\t\t\tisCustomPosition = true;\n\t\t\tisCustomPositionSuccess = this.#adjustRightPosition();\n\t\t}\n\n\t\tif (!(isCustomPosition && isCustomPositionSuccess))\n\t\t{\n\t\t\tsuper.adjustPosition(bindOptions);\n\t\t}\n\t}\n\n\t/**\n\t * Adjust the popup in right position\n\t * @returns {boolean} an indicator whether or not we have managed to adjust the popup successfully\n\t */\n\t#adjustRightPosition(): boolean\n\t{\n\t\tconst bindElRect = this.bindElement.getBoundingClientRect();\n\t\tconst popupHeight = this.getPopupContainer().offsetHeight;\n\t\tconst popupWidth = this.getPopupContainer().offsetWidth;\n\n\t\t/**\n\t\t * Check if the popup fits in the viewport\n\t\t */\n\t\tif ((bindElRect.left + bindElRect.width + popupWidth) > document.documentElement.clientWidth)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tlet angleOffsetY = popupHeight / 2;\n\n\t\tconst left = bindElRect.left + bindElRect.width + 10;\n\t\tlet top = window.pageYOffset + bindElRect.top + bindElRect.height / 2 - popupHeight / 2;\n\n\t\tif(top < window.pageYOffset)\n\t\t{\n\t\t\tangleOffsetY -= window.pageYOffset - top;\n\t\t\ttop = window.pageYOffset;\n\t\t}\n\t\telse if(top > window.pageYOffset + document.body.clientHeight - popupHeight)\n\t\t{\n\t\t\tangleOffsetY += top - (window.pageYOffset + document.body.clientHeight - popupHeight);\n\t\t\ttop = window.pageYOffset + document.body.clientHeight - popupHeight;\n\t\t}\n\n\t\tthis.setAngle({position: 'left', offset: angleOffsetY});\n\n\t\tDom.adjust(this.popupContainer, {\n\t\t\tstyle: {\n\t\t\t\ttop: `${top}px`,\n\t\t\t\tleft: `${left}px`,\n\t\t\t\tzIndex: this.getZindex()\n\t\t\t}\n\t\t});\n\n\t\treturn true;\n\t}\n}\n","import {\n\tTag,\n\tType,\n\tDom,\n\tEvent,\n\tLoc\n} from 'main.core';\nimport {\n\tAddress,\n\tFormat,\n\tLocation,\n\tControlMode,\n\tMapBase,\n\tGeocodingServiceBase,\n\tAddressStringConverter,\n\tLocationType\n} from 'location.core';\nimport {EventEmitter} from 'main.core.events';\nimport AddressString from './addressstring';\nimport AddressApplier from './addressapplier';\nimport Popup from './popup';\n\nimport 'ui.design-tokens';\nimport './css/mappopup.css';\n\nexport default class MapPopup extends EventEmitter\n{\n\tstatic #onChangedEvent = 'onChanged';\n\tstatic #onMouseOverEvent = 'onMouseOver';\n\tstatic #onMouseOutEvent = 'onMouseOut';\n\tstatic #onShowedEvent = 'onShow';\n\tstatic #onClosedEvent = 'onClose';\n\n\t#map;\n\t#mode;\n\t#address;\n\t#popup;\n\t#addressString;\n\t#addressApplier;\n\t#addressFormat;\n\t#gallery;\n\t#locationRepository;\n\t#isMapRendered = false;\n\t#mapInnerContainer;\n\t#geocodingService;\n\t#contentWrapper;\n\t#userLocationPoint;\n\n\tconstructor(props)\n\t{\n\t\tsuper(props);\n\t\tthis.setEventNamespace('BX.Location.Widget.MapPopup');\n\n\t\tif (!(props.map instanceof MapBase))\n\t\t{\n\t\t\tBX.debug('map must be instance of Map');\n\t\t}\n\n\t\tthis.#map = props.map;\n\n\t\tif (props.geocodingService instanceof GeocodingServiceBase)\n\t\t{\n\t\t\tthis.#geocodingService = props.geocodingService;\n\t\t}\n\n\t\tthis.#map.onLocationChangedEventSubscribe(this.#onLocationChanged.bind(this));\n\n\t\tif (!(props.popup instanceof Popup))\n\t\t{\n\t\t\tBX.debug('popup must be instance of Popup');\n\t\t}\n\n\t\tthis.#popup = props.popup;\n\n\t\tif (!(props.addressFormat instanceof Format))\n\t\t{\n\t\t\tBX.debug('addressFormat must be instance of Format');\n\t\t}\n\n\t\tthis.#addressFormat = props.addressFormat;\n\n\t\tthis.#addressString = new AddressString({\n\t\t\taddressFormat: this.#addressFormat\n\t\t});\n\t\tthis.#createAddressApplier();\n\n\t\tif (props.gallery)\n\t\t{\n\t\t\tthis.#gallery = props.gallery;\n\t\t}\n\n\t\tthis.#locationRepository = props.locationRepository;\n\t\tthis.#userLocationPoint = props.userLocationPoint;\n\t}\n\n\t#createAddressApplier()\n\t{\n\t\tthis.#addressApplier = new AddressApplier(\n\t\t\t{\n\t\t\t\tpropsData: {\n\t\t\t\t\taddress: this.#address,\n\t\t\t\t\taddressFormat: this.#addressFormat,\n\t\t\t\t\tisHidden: true,\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\tthis.#addressApplier.$mount();\n\t\tthis.#addressApplier.$on('apply', (event) => {\n\t\t\tconst prevAddress = event.address;\n\n\t\t\tthis.#address = prevAddress;\n\t\t\tthis.#addressString.address = prevAddress;\n\t\t\tthis.#addressApplier.$props.isHidden = true;\n\n\t\t\tthis.emit(\n\t\t\t\tMapPopup.#onChangedEvent,\n\t\t\t\t{address: prevAddress}\n\t\t\t);\n\t\t});\n\t}\n\n\t#onLocationChanged(event: Event)\n\t{\n\t\tconst data = event.getData();\n\t\tconst location = data.location;\n\t\tconst address = location.toAddress();\n\n\t\tif (!this.#address)\n\t\t{\n\t\t\tthis.#address = address;\n\t\t\tthis.#addressString.address = address;\n\t\t\tthis.emit(\n\t\t\t\tMapPopup.#onChangedEvent,\n\t\t\t\t{address: address}\n\t\t\t);\n\t\t}\n\t\telse if (address.fieldCollection.isEqual(this.#address.fieldCollection, LocationType.ADDRESS_LINE_1))\n\t\t{\n\t\t\tthis.#address.latitude = address.latitude;\n\t\t\tthis.#address.longitude = address.longitude;\n\n\t\t\tif (this.#address.location)\n\t\t\t{\n\t\t\t\tthis.#address.location.latitude = address.latitude;\n\t\t\t\tthis.#address.location.longitude = address.longitude;\n\t\t\t}\n\n\t\t\tthis.emit(\n\t\t\t\tMapPopup.#onChangedEvent,\n\t\t\t\t{address: this.#address}\n\t\t\t);\n\n\t\t\tthis.#addressApplier.$props.isHidden = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.#addressString.address = address;\n\t\t\tthis.#addressApplier.$props.address = address;\n\t\t\tthis.#addressApplier.$props.isHidden = false;\n\t\t}\n\n\t\tif (this.#gallery)\n\t\t{\n\t\t\tthis.#gallery.location = location;\n\t\t}\n\t}\n\n\trender(props: object): void\n\t{\n\t\tthis.#address = props.address;\n\t\tthis.#mode = props.mode;\n\t\tthis.#isMapRendered = false;\n\t\tthis.#mapInnerContainer = Tag.render`<div class=\"location-map-inner\"></div>`;\n\t\tthis.#renderPopup(props.bindElement, this.#mapInnerContainer);\n\t}\n\n\t#renderPopup(bindElement: Element, mapInnerContainer: Element): Popup\n\t{\n\t\tlet gallery = '';\n\n\t\tif (this.#gallery)\n\t\t{\n\t\t\tgallery = this.#gallery.render();\n\t\t}\n\n\t\tconst thirdPartyWarningNode = Tag.render`\n\t\t\t<div class=\"location-map-address-third-party-warning\">\n\t\t\t\t${Loc.getMessage('LOCATION_WIDGET_THIRD_PARTY_WARNING')}\n\t\t\t</div>\n\t\t`;\n\n\t\tthis.#contentWrapper = Tag.render`\n\t\t\t<div class=\"location-map-wrapper\">\n\t\t\t\t<div class=\"location-map-container\">\n\t\t\t\t\t${mapInnerContainer}\n\t\t\t\t\t${gallery}\n\t\t\t\t</div>\n\t\t\t\t${this.#mode === ControlMode.edit ? this.#addressString.render({address: this.#address}) : ''}\n\t\t\t\t${thirdPartyWarningNode}\n\t\t\t\t${this.#mode === ControlMode.edit ? this.#addressApplier.$el : ''}\n\t\t\t</div>`;\n\n\t\tEvent.bind(this.#contentWrapper, 'click', (e) => e.stopPropagation());\n\t\tEvent.bind(this.#contentWrapper, 'mouseover', (e) => this.emit(MapPopup.#onMouseOverEvent, e));\n\t\tEvent.bind(this.#contentWrapper, 'mouseout', (e) => this.emit(MapPopup.#onMouseOutEvent, e));\n\t\tthis.bindElement = bindElement;\n\t\tthis.#popup.setContent(this.#contentWrapper);\n\t}\n\n\tget bindElement()\n\t{\n\t\treturn this.#popup.getBindElement();\n\t}\n\n\tset bindElement(bindElement: Element)\n\t{\n\t\tif (Type.isDomNode(bindElement))\n\t\t{\n\t\t\tthis.#popup.setBindElement(bindElement);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tBX.debug('bindElement must be type of dom node');\n\t\t}\n\t}\n\n\tset address(address: ?Address): void\n\t{\n\t\tthis.#address = address;\n\t\tthis.#addressString.address = address;\n\n\t\tthis.#convertAddressToLocation(address)\n\t\t\t.then((location) => {\n\t\t\t\tthis.#setLocationInternal(location);\n\t\t\t});\n\t}\n\n\t#extractLatLon(address: Address): ?Array\n\t{\n\t\tlet result = null;\n\t\tlet lat;\n\t\tlet lon;\n\n\t\tif (address.latitude && address.longitude)\n\t\t{\n\t\t\tlat = address.latitude;\n\t\t\tlon = address.longitude;\n\t\t}\n\t\telse if (address.location\n\t\t\t&& address.location.latitude\n\t\t\t&& address.location.longitude\n\t\t)\n\t\t{\n\t\t\tlat = address.location.latitude;\n\t\t\tlon = address.location.longitude;\n\t\t}\n\n\t\tif (lat && lat !== '0' && lon && lon !== '0')\n\t\t{\n\t\t\tresult = [lat, lon];\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t#convertAddressToLocation(address: ?Address, useUserLocation: boolean = false): Promise<?Location>\n\t{\n\t\treturn new Promise((resolve) => {\n\t\t\tif (useUserLocation)\n\t\t\t{\n\t\t\t\tresolve(\n\t\t\t\t\tthis.#userLocationPoint && this.#mode !== ControlMode.view\n\t\t\t\t\t\t? new Location({\n\t\t\t\t\t\t\tlatitude: this.#userLocationPoint.latitude,\n\t\t\t\t\t\t\tlongitude: this.#userLocationPoint.longitude\n\t\t\t\t\t\t})\n\t\t\t\t\t\t: null\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (address)\n\t\t\t{\n\t\t\t\tconst latLon = this.#extractLatLon(address);\n\n\t\t\t\tif (latLon)\n\t\t\t\t{\n\t\t\t\t\tresolve(new Location({\n\t\t\t\t\t\tlatitude: latLon[0],\n\t\t\t\t\t\tlongitude: latLon[1],\n\t\t\t\t\t\ttype: address.getType()\n\t\t\t\t\t}));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresolve(null);\n\t\t});\n\t}\n\n\t#setLocationInternal(location: ?Location): void\n\t{\n\t\tif (this.#map)\n\t\t{\n\t\t\tthis.#map.location = location;\n\t\t}\n\n\t\tif (this.#gallery)\n\t\t{\n\t\t\tthis.#gallery.location = location;\n\t\t}\n\t}\n\n\tset mode(mode: string): void\n\t{\n\t\tthis.#mode = mode;\n\t\tthis.#map.mode = mode;\n\t}\n\n\t#renderMap({location})\n\t{\n\t\treturn this.#map.render({\n\t\t\tmapContainer: this.#mapInnerContainer,\n\t\t\tlocation: location,\n\t\t\tmode: this.#mode\n\t\t});\n\t}\n\n\tshow(useUserLocation: boolean = false): void\n\t{\n\t\tthis.#convertAddressToLocation(this.#address, useUserLocation)\n\t\t\t.then((location) => {\n\t\t\t\tif (!location)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.#popup.show();\n\n\t\t\t\tif (!this.#isMapRendered)\n\t\t\t\t{\n\t\t\t\t\tthis.#renderMap({location})\n\t\t\t\t\t\t.then(() => {\n\t\t\t\t\t\t\tif (this.#gallery)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.#gallery.location = location;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.emit(MapPopup.#onShowedEvent);\n\t\t\t\t\t\t\tthis.#map.onMapShow();\n\t\t\t\t\t\t});\n\n\t\t\t\t\tthis.#isMapRendered = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.#map.location = location;\n\n\t\t\t\t\tif (this.#gallery)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.#gallery.location = location;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.emit(MapPopup.#onShowedEvent);\n\t\t\t\t\tthis.#map.onMapShow();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tisShown(): boolean\n\t{\n\t\treturn this.#popup.isShown();\n\t}\n\n\tclose(): void\n\t{\n\t\tthis.#popup.close();\n\t\tthis.#addressApplier.$props.isHidden = true;\n\t\tthis.emit(MapPopup.#onClosedEvent);\n\t}\n\n\tonChangedEventSubscribe(listener: Function): void\n\t{\n\t\tthis.subscribe(MapPopup.#onChangedEvent, listener);\n\t}\n\n\tonMouseOverSubscribe(listener: Function): void\n\t{\n\t\tthis.subscribe(MapPopup.#onMouseOverEvent, listener);\n\t}\n\n\tonMouseOutSubscribe(listener: Function): void\n\t{\n\t\tthis.subscribe(MapPopup.#onMouseOutEvent, listener);\n\t}\n\n\tsubscribeOnShowedEvent(listener: Function): void\n\t{\n\t\tthis.subscribe(MapPopup.#onShowedEvent, listener);\n\t}\n\n\tsubscribeOnClosedEvent(listener: Function): void\n\t{\n\t\tthis.subscribe(MapPopup.#onClosedEvent, listener);\n\t}\n\n\tdestroy()\n\t{\n\t\tthis.#map = null;\n\t\tthis.#gallery = null;\n\t\tthis.#addressString = null;\n\t\tthis.#addressApplier = null;\n\n\t\tthis.#popup.destroy();\n\t\tthis.#popup = null;\n\t\tDom.remove(this.#contentWrapper);\n\t\tthis.#contentWrapper = null;\n\t\tEvent.unbindAll(this);\n\t}\n}\n","import {Address, MethodNotImplemented} from \"location.core\";\nimport MapPopup from \"../../mappopup/mappopup\";\n\n/**\n * Base class for the address widget feature\n */\nexport default class BaseFeature\n{\n\t_saveResourceStrategy = false;\n\n\tconstructor(props)\n\t{\n\t\tthis._saveResourceStrategy = props.saveResourceStrategy;\n\t}\n\n\trender(props)\n\t{\n\t\tthrow new MethodNotImplemented('Method render must be implemented');\n\t}\n\n\tsetAddressWidget(addressWidget): void\n\t{\n\t\tthrow new MethodNotImplemented('Method render must be implemented');\n\t}\n\n\tsetAddress(address: Address): void\n\t{\n\t\tthrow new MethodNotImplemented('Method set address must be implemented');\n\t}\n\n\tsetMode(mode: string): void\n\t{\n\n\t}\n\n\tdestroy(): void\n\t{\n\n\t}\n\n\tresetView(): void\n\t{\n\n\t}\n}","import {Type, Event} from 'main.core';\nimport {EventEmitter} from 'main.core.events';\nimport {\n\tAddress as AddressEntity,\n\tControlMode,\n\tFormat,\n\tAddressStringConverter,\n\tLocationRepository,\n\tErrorPublisher,\n\tFormatTemplateType,\n\tAddressType,\n\tStorage\n} from 'location.core';\nimport State from '../state';\nimport BaseFeature from './features/basefeature';\nimport {FeatureEvent} from './featurevent';\n\n/**\n * Props for the address widget constructor\n */\nexport type AddressConstructorProps = {\n\t/** @see ControlMode */\n\tmode: string,\n\taddressFormat: Format,\n\taddress?: AddressEntity,\n\tneedWarmBackendAfterAddressChanged?: boolean,\n\tlocationRepository?: LocationRepository,\n};\n\n/**\n * Props for the address widget render method\n */\nexport type AddressRenderProps = {\n\t/** Input control witch will be used by user to enter the address */\n\tinputNode: Element,\n\t/** Control wrapper witch could be used for mouseover event etc. */\n\tcontrolWrapper: Element,\n\t/** If map feature is used it could be used to bind map popup */\n\tmapBindElement: ?Element,\n\t/** If autocomplete feature is used it could be used to bind menu node */\n\tautocompleteMenuElement: ?Element\n};\n\n/**\n * Address widget\n */\nexport default class Address extends EventEmitter\n{\n\t/* If address was changed by user */\n\tstatic onAddressChangedEvent = 'onAddressChanged';\n\t/* If state of the widget was changed */\n\tstatic onStateChangedEvent = 'onStateChanged';\n\t/* Any feature-related events */\n\tstatic onFeatureEvent = 'onFeatureEvent';\n\n\t#mode;\n\t#state;\n\t#address;\n\t#addressFormat;\n\t#languageId;\n\n\t#features = [];\n\n\t#inputNode;\n\t#controlWrapper;\n\n\t#destroyed = false;\n\n\t#isAddressChangedByFeature = false;\n\t#isInputNodeValueUpdated = false;\n\n\t#needWarmBackendAfterAddressChanged = true;\n\t#locationRepository;\n\n\t/**\n\t * Constructor\n\t * @param {AddressConstructorProps} props\n\t */\n\tconstructor(props: AddressConstructorProps)\n\t{\n\t\tsuper();\n\n\t\tthis.setEventNamespace('BX.Location.Widget.Address');\n\n\t\tif (!(props.addressFormat instanceof Format))\n\t\t{\n\t\t\tBX.debug('addressFormat must be instance of Format');\n\t\t}\n\n\t\tthis.#addressFormat = props.addressFormat;\n\n\t\tif (props.address && !(props.address instanceof AddressEntity))\n\t\t{\n\t\t\tBX.debug('address must be instance of Address');\n\t\t}\n\n\t\tthis.#address = props.address || null;\n\n\t\tif (!(ControlMode.isValid(props.mode)))\n\t\t{\n\t\t\tBX.debug('mode must be valid ControlMode');\n\t\t}\n\n\t\tthis.#mode = props.mode;\n\n\t\tif (!Type.isString(props.languageId))\n\t\t{\n\t\t\tthrow new TypeError('props.languageId must be type of string');\n\t\t}\n\n\t\tthis.#languageId = props.languageId;\n\n\t\tif (props.features)\n\t\t{\n\t\t\tif (!Type.isArray(props.features))\n\t\t\t{\n\t\t\t\tthrow new TypeError('features must be an array');\n\t\t\t}\n\n\t\t\tprops.features.forEach((feature: BaseFeature) => {\n\t\t\t\tthis.#addFeature(feature);\n\t\t\t});\n\t\t}\n\n\t\tif (Type.isBoolean(props.needWarmBackendAfterAddressChanged))\n\t\t{\n\t\t\tthis.#needWarmBackendAfterAddressChanged = props.needWarmBackendAfterAddressChanged;\n\t\t}\n\n\t\tif (props.locationRepository instanceof LocationRepository)\n\t\t{\n\t\t\tthis.#locationRepository = props.locationRepository;\n\t\t}\n\t\telse if (this.#needWarmBackendAfterAddressChanged)\n\t\t{\n\t\t\tthis.#locationRepository = new LocationRepository();\n\t\t}\n\n\t\tthis.#state = State.INITIAL;\n\t}\n\n\t/**\n\t * @param {AddressEntity} address\n\t * @param {BaseFeature} sourceFeature\n\t * @param {Array} excludeFeatures\n\t * @param {Object} options\n\t * @internal\n\t */\n\tsetAddressByFeature(\n\t\taddress: AddressEntity,\n\t\tsourceFeature: BaseFeature,\n\t\texcludeFeatures: Array = [],\n\t\toptions: Object = {}\n\t): void\n\t{\n\t\tconst addressId = this.#address ? this.#address.id : 0;\n\n\t\tif (\n\t\t\taddress\n\t\t\t&& !address.getFieldValue(AddressType.ADDRESS_LINE_1)\n\t\t\t&& this.#addressFormat.isTemplateExists(FormatTemplateType.ADDRESS_LINE_1)\n\t\t)\n\t\t{\n\t\t\taddress.setFieldValue(\n\t\t\t\tAddressType.ADDRESS_LINE_1,\n\t\t\t\tAddressStringConverter.convertAddressToStringTemplate(\n\t\t\t\t\taddress,\n\t\t\t\t\tthis.#addressFormat.getTemplate(FormatTemplateType.ADDRESS_LINE_1),\n\t\t\t\t\tAddressStringConverter.CONTENT_TYPE_TEXT,\n\t\t\t\t\tnull,\n\t\t\t\t\tthis.#addressFormat\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tthis.#address = address;\n\n\t\tconst storeAsLastAddress = options.hasOwnProperty('storeAsLastAddress')\n\t\t\t? options.storeAsLastAddress\n\t\t\t: true;\n\t\tif (storeAsLastAddress)\n\t\t{\n\t\t\tthis.#storeAsLastAddress();\n\t\t}\n\n\t\tif (addressId > 0)\n\t\t{\n\t\t\tthis.#address.id = addressId;\n\t\t}\n\n\t\tthis.#isAddressChangedByFeature = true;\n\t\tthis.#setInputValue(address);\n\n\t\tthis.#executeFeatureMethod(\n\t\t\t'setAddress',\n\t\t\t[address],\n\t\t\tsourceFeature,\n\t\t\texcludeFeatures\n\t\t);\n\n\t\tif (this.#state !== State.DATA_INPUTTING)\n\t\t{\n\t\t\tthis.#emitOnAddressChanged();\n\t\t}\n\t}\n\n\temitFeatureEvent(featureEvent: FeatureEvent)\n\t{\n\t\tthis.emit(\n\t\t\tAddress.onFeatureEvent,\n\t\t\tfeatureEvent\n\t\t);\n\t}\n\n\t/**\n\t * Add feature to the widget\n\t * @param {BaseFeature} feature\n\t */\n\t#addFeature(feature: BaseFeature)\n\t{\n\t\tif (!(feature instanceof BaseFeature))\n\t\t{\n\t\t\tBX.debug('feature must be instance of BaseFeature');\n\t\t}\n\n\t\tfeature.setAddressWidget(this);\n\t\tthis.#features.push(feature);\n\t}\n\n\tget features()\n\t{\n\t\treturn this.#features;\n\t}\n\n\t#executeFeatureMethod(method, params = [], sourceFeature = null, excludeFeatures = [])\n\t{\n\t\tlet result;\n\n\t\tfor(const feature of this.#features)\n\t\t{\n\t\t\tlet isExcluded = false;\n\t\t\tfor(const excludeFeature of excludeFeatures)\n\t\t\t{\n\t\t\t\tif (feature instanceof excludeFeature)\n\t\t\t\t{\n\t\t\t\t\tisExcluded = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!isExcluded && feature !== sourceFeature)\n\t\t\t{\n\t\t\t\tresult = feature[method].apply(feature, params);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t#emitOnAddressChanged()\n\t{\n\t\tthis.emit(\n\t\t\tAddress.onAddressChangedEvent,\n\t\t\t{address: this.#address}\n\t\t);\n\n\t\tif (this.#address && this.#needWarmBackendAfterAddressChanged)\n\t\t{\n\t\t\tthis.#warmBackendAfterAddressChanged(this.#address);\n\t\t}\n\t}\n\n\t#warmBackendAfterAddressChanged(address: AddressEntity): void\n\t{\n\t\tif (address.location !== null && address.location.id <= 0)\n\t\t{\n\t\t\tthis.#locationRepository.findParents(address.location);\n\t\t}\n\t}\n\n\t// eslint-disable-next-line no-unused-vars\n\t#onInputFocus(e: KeyboardEvent)\n\t{\n\t\tconst value = this.#inputNode.value;\n\n\t\tif (value.length > 0)\n\t\t{\n\t\t\tBX.setCaretPosition(this.#inputNode, value.length);\n\t\t}\n\t}\n\n\t#convertAddressToString(\n\t\taddress: ?Address,\n\t\ttemplateType: string\n\t): string\n\t{\n\t\tlet result = '';\n\n\t\tif (address)\n\t\t{\n\t\t\tif (!this.#addressFormat.isTemplateExists(templateType))\n\t\t\t{\n\t\t\t\tconsole.error(`Address format \"${this.#addressFormat.code}\" does not have a template \"${templateType}\"`);\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tresult = AddressStringConverter.convertAddressToStringTemplate(\n\t\t\t\taddress,\n\t\t\t\tthis.#addressFormat.getTemplate(templateType),\n\t\t\t\tAddressStringConverter.CONTENT_TYPE_TEXT,\n\t\t\t\t', ',\n\t\t\t\tthis.#addressFormat\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t#setInputValue(address: ?Address)\n\t{\n\t\tif (this.#inputNode)\n\t\t{\n\t\t\tconst shortAddressString = this.#convertAddressToString(address, FormatTemplateType.AUTOCOMPLETE);\n\t\t\tconst fullAddressString = this.#convertAddressToString(address, FormatTemplateType.DEFAULT);\n\t\t\tthis.#inputNode.value = shortAddressString.trim() !== '' ? shortAddressString : fullAddressString;\n\t\t\tthis.#inputNode.title = fullAddressString;\n\t\t\tconst selectionStart = this.#inputNode.selectionStart;\n\t\t\tconst selectionEnd = shortAddressString.length;\n\t\t\tthis.#inputNode.setSelectionRange(selectionStart, selectionEnd);\n\t\t}\n\t}\n\n\t// eslint-disable-next-line no-unused-vars\n\t#onInputFocusOut(e: Event)\n\t{\n\t\t// Seems that we don't have any autocompleter feature\n\t\tif (this.#isInputNodeValueUpdated && !this.#isAddressChangedByFeature)\n\t\t{\n\t\t\tconst value = this.#inputNode.value.trim();\n\t\t\tconst address = new AddressEntity({languageId: this.#languageId});\n\t\t\taddress.setFieldValue(this.#addressFormat.fieldForUnRecognized, value);\n\t\t\tthis.address = address;\n\t\t\tthis.#emitOnAddressChanged();\n\t\t}\n\n\t\tthis.#isInputNodeValueUpdated = false;\n\t\tthis.#isAddressChangedByFeature = false;\n\t}\n\n\tonInputKeyup(e: KeyboardEvent)\n\t{\n\t\tswitch (e.code)\n\t\t{\n\t\t\tcase 'Tab':\n\t\t\tcase 'Esc':\n\t\t\tcase 'Enter':\n\t\t\tcase 'NumpadEnter':\n\t\t\t\tthis.resetView();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonInputInput(e)\n\t{\n\t\tthis.#isInputNodeValueUpdated = true;\n\t}\n\n\tresetView(): void\n\t{\n\t\tthis.#executeFeatureMethod('resetView');\n\t}\n\n\t/**\n\t * Render Widget\n\t * @param {AddressRenderProps} props\n\t */\n\trender(props: AddressRenderProps): void\n\t{\n\t\tif (!Type.isDomNode(props.controlWrapper))\n\t\t{\n\t\t\tBX.debug('props.controlWrapper  must be instance of Element');\n\t\t}\n\n\t\tthis.#controlWrapper = props.controlWrapper;\n\n\t\tif (this.#mode === ControlMode.edit)\n\t\t{\n\t\t\tif (!Type.isDomNode(props.inputNode))\n\t\t\t{\n\t\t\t\tBX.debug('props.inputNode  must be instance of Element');\n\t\t\t}\n\n\t\t\tthis.#inputNode = props.inputNode;\n\t\t\tthis.#setInputValue(this.#address);\n\t\t}\n\n\t\tthis.#executeFeatureMethod('render', [props]);\n\n\t\t// We can prevent these events in features if need\n\t\tif (this.#mode === ControlMode.edit)\n\t\t{\n\t\t\tEvent.bind(this.#inputNode, 'focus', this.#onInputFocus.bind(this));\n\t\t\tEvent.bind(this.#inputNode, 'focusout', this.#onInputFocusOut.bind(this));\n\t\t\tEvent.bind(this.#inputNode, 'keyup', this.onInputKeyup.bind(this));\n\t\t\tEvent.bind(this.#inputNode, 'input', this.onInputInput.bind(this));\n\t\t}\n\t}\n\n\tget controlWrapper()\n\t{\n\t\treturn this.#controlWrapper;\n\t}\n\n\tget inputNode()\n\t{\n\t\treturn this.#inputNode;\n\t}\n\n\tget address(): ?AddressEntity\n\t{\n\t\treturn this.#address;\n\t}\n\n\tset address(address: ?AddressEntity): void\n\t{\n\t\tif (address && !(address instanceof AddressEntity))\n\t\t{\n\t\t\tBX.debug('address must be instance of Address');\n\t\t}\n\n\t\tthis.#address = address;\n\t\tthis.#storeAsLastAddress();\n\t\tthis.#executeFeatureMethod('setAddress', [address]);\n\t\tthis.#isInputNodeValueUpdated = false;\n\t\tthis.#isAddressChangedByFeature = false;\n\t\tthis.#setInputValue(address);\n\t}\n\n\tget mode()\n\t{\n\t\treturn this.#mode;\n\t}\n\n\tset mode(mode: string): void\n\t{\n\t\tif (!(ControlMode.isValid(mode)))\n\t\t{\n\t\t\tBX.debug('mode must be valid ControlMode');\n\t\t}\n\n\t\tthis.#mode = mode;\n\n\t\tthis.#executeFeatureMethod('setMode', [mode]);\n\t}\n\n\tget state(): string\n\t{\n\t\treturn this.#state;\n\t}\n\n\tget addressFormat(): Format\n\t{\n\t\treturn this.#addressFormat;\n\t}\n\n\tsetStateByFeature(state: string)\n\t{\n\t\tthis.#state = state;\n\n\t\tthis.emit(\n\t\t\tAddress.onStateChangedEvent,\n\t\t\t{state: state}\n\t\t);\n\t}\n\n\tsubscribeOnStateChangedEvent(listener: Function): void\n\t{\n\t\tthis.subscribe(Address.onStateChangedEvent, listener);\n\t}\n\n\tsubscribeOnAddressChangedEvent(listener: Function): void\n\t{\n\t\tthis.subscribe(Address.onAddressChangedEvent, listener);\n\t}\n\n\tsubscribeOnFeatureEvent(listener: Function): void\n\t{\n\t\tthis.subscribe(Address.onFeatureEvent, listener);\n\t}\n\n\tsubscribeOnErrorEvent(listener: Function): void\n\t{\n\t\tErrorPublisher.getInstance().subscribe(listener);\n\t}\n\n\t#storeAsLastAddress()\n\t{\n\t\tif (\n\t\t\tthis.#address\n\t\t\t&& this.#address.fieldCollection\n\t\t\t&& this.#address.fieldCollection.isFieldExists(AddressType.LOCALITY)\n\t\t)\n\t\t{\n\t\t\tStorage.getInstance().lastAddress = this.#address;\n\t\t}\n\t}\n\n\tdestroy()\n\t{\n\t\tif (this.#destroyed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tEvent.unbindAll(this);\n\t\tEvent.unbind(this.#inputNode, 'focus', this.#onInputFocus);\n\t\tEvent.unbind(this.#inputNode, 'focusout', this.#onInputFocusOut);\n\t\tEvent.unbind(this.#inputNode, 'keyup', this.onInputKeyup);\n\t\tEvent.unbind(this.#inputNode, 'input', this.onInputInput);\n\n\t\tthis.#executeFeatureMethod('destroy');\n\t\tthis.#destroyFeatures();\n\t\tthis.#destroyed = true;\n\t}\n\n\t#destroyFeatures()\n\t{\n\t\tthis.#features.splice(0, this.#features.length);\n\t}\n\n\tisDestroyed()\n\t{\n\t\treturn this.#destroyed;\n\t}\n}\n","import {EventEmitter} from 'main.core.events';\nimport {Tag} from 'main.core';\n\nexport default class MenuBottom extends EventEmitter\n{\n\t#node;\n\t#leftItemNodeContainer;\n\t#rightItemNodeContainer;\n\n\tconstructor()\n\t{\n\t\tsuper();\n\t\tthis.setEventNamespace('BX.Location.Widget.Autocomplete.MenuBottom');\n\t}\n\n\trender()\n\t{\n\t\tthis.#leftItemNodeContainer = Tag.render`<div class=\"location-map-popup-item--info-left\"></div>`;\n\t\tthis.#rightItemNodeContainer = Tag.render`<div></div>`;\n\n\t\tthis.#node = Tag.render`\n\t\t\t<div>\n\t\t\t\t<span class=\"location-map-popup-item--info\"> \t\t\n\t\t\t\t\t${this.#leftItemNodeContainer}\n\t\t\t\t\t${this.#rightItemNodeContainer}\n\t\t\t\t</span>\t\t\t\n\t\t\t</div>\n\t\t`;\n\n\t\treturn this.#node;\n\t}\n\n\tsetRightItemNode(node: Element): void\n\t{\n\t\twhile (this.#rightItemNodeContainer.firstChild)\n\t\t{\n\t\t\tthis.#rightItemNodeContainer.removeChild(this.#rightItemNodeContainer.firstChild);\n\t\t}\n\n\t\tthis.#rightItemNodeContainer.appendChild(node);\n\t}\n\n\tsetLeftItemNode(node: Element): void\n\t{\n\t\twhile (this.#leftItemNodeContainer.firstChild)\n\t\t{\n\t\t\tthis.#leftItemNodeContainer.removeChild(this.#leftItemNodeContainer.firstChild);\n\t\t}\n\n\t\tthis.#leftItemNodeContainer.appendChild(node);\n\t}\n}","import {Menu as MainMenu} from 'main.popup';\nimport './css/menu.css';\nimport MenuBottom from './menubottom';\n\nexport default class Menu extends MainMenu\n{\n\tchoseItemIdx = -1;\n\t#bottom;\n\n\tconstructor(options)\n\t{\n\t\tsuper(options);\n\n\t\tconst elRect = options.bindElement.getBoundingClientRect();\n\t\tthis.popupWindow.setMaxWidth(elRect.width);\n\t\tthis.#bottom = new MenuBottom();\n\t\tthis.layout.menuContainer.appendChild(\n\t\t\tthis.#bottom.render()\n\t\t);\n\t}\n\n\tisMenuEmpty(): boolean\n\t{\n\t\treturn this.menuItems.length <= 0;\n\t}\n\n\tisChoseLastItem(): boolean\n\t{\n\t\treturn this.choseItemIdx >= this.menuItems.length - 1;\n\t}\n\n\tisChoseFirstItem(): boolean\n\t{\n\t\treturn this.choseItemIdx === 0;\n\t}\n\n\tisItemChosen(): boolean\n\t{\n\t\treturn this.choseItemIdx >= 0;\n\t}\n\n\tisDestroyed(): boolean\n\t{\n\t\treturn this.getPopupWindow().isDestroyed();\n\t}\n\n\tisItemExist(index: number): boolean\n\t{\n\t\treturn typeof this.menuItems[index] !== 'undefined';\n\t}\n\n\tgetChosenItem()\n\t{\n\t\tlet result = null;\n\n\t\tif(this.isItemChosen() && this.isItemExist(this.choseItemIdx))\n\t\t{\n\t\t\tresult = this.menuItems[this.choseItemIdx];\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tchooseNextItem(): void\n\t{\n\t\tif(!this.isMenuEmpty() && !this.isChoseLastItem())\n\t\t{\n\t\t\tthis.chooseItem(this.choseItemIdx + 1);\n\t\t}\n\n\t\treturn this.getChosenItem();\n\t}\n\n\tchoosePrevItem(): void\n\t{\n\t\tif(!this.isMenuEmpty() && !this.isChoseFirstItem())\n\t\t{\n\t\t\tthis.chooseItem(this.choseItemIdx - 1);\n\t\t}\n\n\t\treturn this.getChosenItem();\n\t}\n\n\thighlightItem(index: number): void\n\t{\n\t\tif(this.isItemExist(index))\n\t\t{\n\t\t\tconst item = this.getChosenItem();\n\n\t\t\tif(item && item.layout.item)\n\t\t\t{\n\t\t\t\titem.layout.item.classList.add('highlighted');\n\t\t\t}\n\t\t}\n\t}\n\n\tunHighlightItem(index: number): void\n\t{\n\t\tif(this.isItemExist(index))\n\t\t{\n\t\t\tconst item = this.getChosenItem();\n\n\t\t\tif(item && item.layout.item)\n\t\t\t{\n\t\t\t\titem.layout.item.classList.remove('highlighted');\n\t\t\t}\n\t\t}\n\t}\n\n\tchooseItem(index: number)\n\t{\n\t\tlet idx = index;\n\n\t\tif(idx < 0)\n\t\t{\n\t\t\tidx = this.menuItems.length - 1;\n\t\t}\n\t\telse if(idx > this.menuItems.length - 1)\n\t\t{\n\t\t\tidx = 0;\n\t\t}\n\n\t\tthis.unHighlightItem(this.choseItemIdx);\n\t\tthis.choseItemIdx = idx;\n\t\tthis.highlightItem(this.choseItemIdx);\n\t}\n\n\tclearItems()\n\t{\n\t\twhile(this.menuItems.length > 0)\n\t\t{\n\t\t\tthis.removeMenuItem(this.menuItems[0].id);\n\t\t}\n\t}\n\n\tisShown(): boolean\n\t{\n\t\treturn this.getPopupWindow().isShown();\n\t}\n\n\tsetBottomRightItemNode(node: Element): void\n\t{\n\t\tthis.#bottom.setRightItemNode(node);\n\t}\n\n\tsetBottomLeftItemNode(node: Element): void\n\t{\n\t\tthis.#bottom.setLeftItemNode(node);\n\t}\n}\n","import {EventEmitter} from 'main.core.events';\nimport {Loc} from 'main.core';\nimport {Location, Address, AddressType, LocationType} from 'location.core';\nimport Menu from './menu';\n\nexport default class Prompt extends EventEmitter\n{\n\tstatic onItemSelectedEvent = 'onItemSelected';\n\n\t/** Element */\n\t#inputNode;\n\n\t/** Element */\n\t#menuNode;\n\n\t/** {Menu} */\n\t#menu;\n\n\t/** {Array<Location>} */\n\t#locationList;\n\n\tconstructor(props)\n\t{\n\t\tsuper(props);\n\t\tthis.setEventNamespace('BX.Location.Widget.Prompt');\n\n\t\tthis.#inputNode = props.inputNode;\n\n\t\tif (props.menuNode)\n\t\t{\n\t\t\tthis.#menuNode = props.menuNode;\n\t\t}\n\t}\n\n\t#createMenu()\n\t{\n\t\treturn new Menu({\n\t\t\tbindElement: this.#menuNode ? this.#menuNode : this.#inputNode,\n\t\t\tautoHide: false,\n\t\t\tcloseByEsc: true,\n\t\t\tclassName: 'location-widget-prompt-menu',\n\t\t});\n\t}\n\n\tgetMenu(): Menu\n\t{\n\t\tif(!this.#menu || this.#menu.isDestroyed())\n\t\t{\n\t\t\tthis.#menu = this.#createMenu();\n\t\t}\n\n\t\treturn this.#menu;\n\t}\n\n\t/**\n\t * Show menu with list of locations\n\t * @param {array} locationsList\n\t * @param {string} searchPhrase\n\t * @returns void\n\t */\n\tshow(locationsList: Array<Location>, searchPhrase: string): void\n\t{\n\t\tif(locationsList.length > 0)\n\t\t{\n\t\t\tthis.setMenuItems(locationsList, searchPhrase);\n\t\t\tthis.getMenu().show();\n\t\t}\n\t}\n\n\tclose(): void\n\t{\n\t\tthis.getMenu().close();\n\t}\n\n\t/**\n\t * @param {array<Location>} locationsList\n\t * @param {string} searchPhrase\n\t * @param {Address} address\n\t * @returns {*}\n\t */\n\tsetMenuItems(locationsList: Array<Location>, searchPhrase: string, address: ?Address): Menu\n\t{\n\t\tthis.getMenu().clearItems();\n\n\t\tif(Array.isArray(locationsList))\n\t\t{\n\t\t\tthis.#locationList = locationsList.slice();\n\n\t\t\tconst showFlatList = (\n\t\t\t\t!address\n\t\t\t\t|| !address.getFieldValue(AddressType.LOCALITY)\n\t\t\t\t|| !Prompt.#hasLocationWithLocality(this.#locationList)\n\t\t\t);\n\n\t\t\tif (showFlatList)\n\t\t\t{\n\t\t\t\tlocationsList.forEach((location, index) => {\n\t\t\t\t\tthis.getMenu().addMenuItem(\n\t\t\t\t\t\tthis.#createMenuItem(index, location, searchPhrase)\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlocationsList.forEach((location, index) => {\n\t\t\t\t\tif (this.#isAddressOfSameLocation(address, location)) {\n\t\t\t\t\t\tthis.getMenu().addMenuItem(\n\t\t\t\t\t\t\tthis.#createMenuItem(index, location, searchPhrase)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tlet isSeparatorSet = false;\n\t\t\t\tlocationsList.forEach((location, index) => {\n\t\t\t\t\tif (!this.#isAddressOfSameLocation(address, location)) {\n\t\t\t\t\t\tif (!isSeparatorSet)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.getMenu().addMenuItem({\n\t\t\t\t\t\t\t\thtml: Loc.getMessage('LOCATION_WIDGET_PROMPT_IN_OTHER_CITY'),\n\t\t\t\t\t\t\t\tdelimiter: true\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.getMenu().addMenuItem(\n\t\t\t\t\t\t\tthis.#createMenuItem(index, location, searchPhrase)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tisSeparatorSet = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t#isAddressOfSameLocation(address, location)\n\t{\n\t\treturn (\n\t\t\taddress\n\t\t\t&& address.getFieldValue(AddressType.LOCALITY)\n\t\t\t&& location\n\t\t\t&& location.address\n\t\t\t&& location.address.getFieldValue(AddressType.LOCALITY)\n\t\t\t&& Prompt.#getAddressPossibleLocalities(location.address).includes(\n\t\t\t\taddress.getFieldValue(AddressType.LOCALITY)\n\t\t\t)\n\t\t);\n\t}\n\n\tstatic #getAddressPossibleLocalities(address: Address)\n\t{\n\t\tconst result = [];\n\n\t\tif (address.getFieldValue(AddressType.LOCALITY))\n\t\t{\n\t\t\tresult.push(address.getFieldValue(AddressType.LOCALITY));\n\t\t}\n\n\t\t/**\n\t\t * Address break-down formed on frontend is very inaccurate so we can't rely only on the locality type field\n\t\t * @see #142094\n\t\t */\n\t\tif (address.getFieldValue(AddressType.ADM_LEVEL_1))\n\t\t{\n\t\t\tresult.push(address.getFieldValue(AddressType.ADM_LEVEL_1));\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * @param {array<Location>} locationsList\n\t * @returns boolean\n\t */\n\tstatic #hasLocationWithLocality(locationsList: Array<Location>): boolean\n\t{\n\t\tfor (let location of locationsList)\n\t\t{\n\t\t\tif (location.address && location.address.getFieldValue(AddressType.LOCALITY))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * @param {number} index\n\t * @param {Location} location\n\t * @param {string} searchPhrase\n\t * @returns {{onclick: onclick, text: string}}\n\t */\n\t#createMenuItem(index, location: Location, searchPhrase): Object\n\t{\n\t\treturn {\n\t\t\tid: index,\n\t\t\ttitle: location.name,\n\t\t\thtml: Prompt.createMenuItemText(location.name, searchPhrase, location),\n\t\t\tonclick: (event, item) => {\n\t\t\t\tthis.#onItemSelect(index);\n\t\t\t\tthis.close();\n\t\t\t}\n\t\t};\n\t}\n\n\t#onItemSelect(index: number): void\n\t{\n\t\tconst location = this.#getLocationFromList(index);\n\n\t\tif(location)\n\t\t{\n\t\t\tthis.emit(Prompt.onItemSelectedEvent, {location: location});\n\t\t}\n\t}\n\n\tstatic createMenuItemText(locationName: string, searchPhrase: string, location: Location): string\n\t{\n\t\tlet result = `\n\t\t<div>\n\t\t\t<strong>${locationName}</strong>\n\t\t</div>`;\n\n\t\tlet clarification;\n\n\t\tif(location.getFieldValue(LocationType.TMP_TYPE_CLARIFICATION))\n\t\t{\n\t\t\tclarification = location.getFieldValue(LocationType.TMP_TYPE_CLARIFICATION);\n\n\t\t\tif(clarification)\n\t\t\t{\n\t\t\t\tif(location.getFieldValue(LocationType.TMP_TYPE_HINT))\n\t\t\t\t{\n\t\t\t\t\tclarification += ` <i>(${location.getFieldValue(LocationType.TMP_TYPE_HINT)})</i>`;\n\t\t\t\t}\n\n\t\t\t\tresult += `<div>${clarification}</div>`;\n\t\t\t}\n\t\t}\n\n\t\treturn '<div data-role=\"location-widget-menu-item\" tabindex=\"-1\">' + result + '</div>';\n\t}\n\n\tstatic #extractClarification(location: Location): string\n\t{\n\t\tlet clarification = '';\n\n\t\tif(location.getFieldValue(LocationType.TMP_TYPE_CLARIFICATION))\n\t\t{\n\t\t\tclarification = location.getFieldValue(LocationType.TMP_TYPE_CLARIFICATION);\n\t\t}\n\n\t\treturn clarification;\n\t}\n\n\t#getLocationFromList(index: number): ?Location\n\t{\n\t\tlet result = null;\n\n\t\tif (this.#locationList[index] !== undefined)\n\t\t{\n\t\t\tresult = this.#locationList[index];\n\t\t}\n\n\t\tif(!result)\n\t\t{\n\t\t\tBX.debug(`Location with index ${index} was not found`);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tchoosePrevItem(isRecursive: boolean = false)\n\t{\n\t\tlet result = null;\n\t\tconst item = this.getMenu().choosePrevItem();\n\n\t\tif (item)\n\t\t{\n\t\t\tif (item.delimiter && item.delimiter === true)\n\t\t\t{\n\t\t\t\tresult = isRecursive ? this.getMenu().chooseNextItem() : this.choosePrevItem(true);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = this.#getLocationFromList(this.getMenu().choseItemIdx);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tchooseNextItem()\n\t{\n\t\tlet result = null;\n\t\tconst item = this.getMenu().chooseNextItem();\n\n\t\tif (item)\n\t\t{\n\t\t\tif (item.delimiter && item.delimiter === true)\n\t\t\t{\n\t\t\t\tresult = this.chooseNextItem();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = this.#getLocationFromList(this.getMenu().choseItemIdx);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tisItemChosen()\n\t{\n\t\treturn this.getMenu().isItemChosen();\n\t}\n\n\tgetChosenItem()\n\t{\n\t\tlet result = null;\n\t\tconst menuItem = this.getMenu().getChosenItem();\n\n\t\tif(menuItem && menuItem.id)\n\t\t{\n\t\t\tresult = this.#getLocationFromList(this.getMenu().choseItemIdx);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tisShown(): boolean\n\t{\n\t\treturn this.getMenu().isShown();\n\t}\n\n\tdestroy()\n\t{\n\t\tif(this.#menu)\n\t\t{\n\t\t\tthis.#menu.destroy();\n\t\t\tthis.#menu = null;\n\t\t}\n\n\t\tthis.#locationList = null;\n\t}\n}\n","import {Format, FormatTemplateType, AddressStringConverter, Address} from 'location.core';\n\nexport default class AddressString\n{\n\t// Input node element\n\t#input = null;\n\t// Address string value\n\t#value = '';\n\t// Address string as it was without custom inputs\n\t#pureAddressString = '';\n\t#addressFormat = null;\n\n\tconstructor(input: HTMLInputElement, addressFormat: Format, address: ?Address)\n\t{\n\t\tif (!(input instanceof HTMLInputElement))\n\t\t{\n\t\t\tthrow new TypeError('Wrong input type');\n\t\t}\n\n\t\tthis.#input = input;\n\n\t\tif (!(addressFormat instanceof Format))\n\t\t{\n\t\t\tthrow new TypeError('Wrong addressFormat type');\n\t\t}\n\n\t\tthis.#addressFormat = addressFormat;\n\n\t\tif (address && !(address instanceof Address))\n\t\t{\n\t\t\tthrow new TypeError('Wrong address type');\n\t\t}\n\t\tif (address)\n\t\t{\n\t\t\tthis.setValueFromAddress(address);\n\t\t}\n\t}\n\n\t/**\n\t *\n\t * @param {string} value Address string value\n\t * @param {boolean} isPureAddress Does it contain user input or not\n\t */\n\tsetValue(value: string, isPureAddress: boolean = false): void\n\t{\n\t\tthis.#value = value;\n\t\tthis.#input.value = value;\n\n\t\tif (isPureAddress)\n\t\t{\n\t\t\tthis.#pureAddressString = value;\n\t\t}\n\n\t\tthis.#actualizePureString();\n\t}\n\n\tactualize()\n\t{\n\t\tthis.#value = this.#input.value;\n\t\tthis.#actualizePureString();\n\t}\n\n\t#actualizePureString()\n\t{\n\t\tif (this.#isPureAddressStringModified())\n\t\t{\n\t\t\tthis.#pureAddressString = '';\n\t\t}\n\t}\n\n\tisChanged()\n\t{\n\t\treturn this.#value.trim() !== this.#input.value.trim();\n\t}\n\n\tget value(): string\n\t{\n\t\treturn this.#value;\n\t}\n\n\tget customTail()\n\t{\n\t\tif (this.#pureAddressString === '')\n\t\t{\n\t\t\treturn this.#value;\n\t\t}\n\n\t\tlet result;\n\n\t\tif (!this.#isPureAddressStringModified())\n\t\t{\n\t\t\tresult = this.#value.slice(this.#pureAddressString.length);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresult = this.#value;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\thasPureAddressString()\n\t{\n\t\treturn this.#pureAddressString !== '';\n\t}\n\n\t// We suggest that user will input data after the address data\n\t#isPureAddressStringModified(): boolean\n\t{\n\t\treturn this.#value === ''\n\t\t\t|| this.#pureAddressString === ''\n\t\t\t|| this.#value.indexOf(this.#pureAddressString) !== 0;\n\t}\n\n\tsetValueFromAddress(address: ?Address): void\n\t{\n\t\tlet value = '';\n\n\t\tif (address)\n\t\t{\n\t\t\tvalue = this.#convertAddressToString(address, FormatTemplateType.AUTOCOMPLETE);\n\n\t\t\tif (value.trim() === '')\n\t\t\t{\n\t\t\t\tvalue = this.#convertAddressToString(address, FormatTemplateType.DEFAULT);\n\t\t\t}\n\t\t}\n\n\t\tthis.setValue(value, true);\n\t}\n\n\t#convertAddressToString(address: Address, templateType: string): string\n\t{\n\t\tif (!this.#addressFormat.isTemplateExists(templateType))\n\t\t{\n\t\t\tconsole.error(`Address format \"${this.#addressFormat.code}\" does not have a template \"${templateType}\"`);\n\t\t\treturn '';\n\t\t}\n\n\t\treturn AddressStringConverter.convertAddressToStringTemplate(\n\t\t\taddress,\n\t\t\tthis.#addressFormat.getTemplate(templateType),\n\t\t\tAddressStringConverter.CONTENT_TYPE_TEXT,\n\t\t\t', ',\n\t\t\tthis.#addressFormat\n\t\t);\n\t}\n}","import {Event, Loc, Tag} from 'main.core';\nimport {EventEmitter, BaseEvent} from 'main.core.events';\nimport {\n\tLocationRepository,\n\tAutocompleteServiceBase,\n\tFormat,\n\tAddress,\n\tLocation,\n\tErrorPublisher,\n\tAddressType,\n\tStorage,\n\tPoint\n} from 'location.core';\nimport type {AutocompleteServiceParams} from 'location.core';\nimport Prompt from './prompt';\nimport State from '../state';\nimport AddressString from './addressstring';\n\n/**\n * @mixes EventEmitter\n */\nexport default class Autocomplete extends EventEmitter\n{\n\tstatic #onAddressChangedEvent = 'onAddressChanged';\n\tstatic #onStateChangedEvent = 'onStateChanged';\n\tstatic #onSearchStartedEvent = 'onSearchStarted';\n\tstatic #onSearchCompletedEvent = 'onSearchCompleted';\n\tstatic #onShowOnMapClickedEvent = 'onShowOnMapClicked';\n\n\t/** {Address} */\n\t#address;\n\t/** {AddressString|null} */\n\t#addressString = null;\n\t/** {String} */\n\t#languageId;\n\t/** {Format} */\n\t#addressFormat;\n\t/** {String} */\n\t#sourceCode;\n\t/** {LocationRepository} */\n\t#locationRepository;\n\t/** {Point} */\n\t#userLocationPoint;\n\t/** {Function} */\n\t#presetLocationsProvider;\n\t/** {Prompt} */\n\t#prompt;\n\t/** {AutocompleteServiceBase} */\n\t#autocompleteService;\n\t/** {number} */\n\t#timerId = null;\n\t/** {Element} */\n\t#inputNode;\n\n\t#searchPhrase = {\n\t\trequested: '',\n\t\tcurrent: '',\n\t\tdropped: ''\n\t};\n\n\t#state;\n\t#wasCleared = false;\n\t#isDestroyed = false;\n\n\t#isAutocompleteRequestStarted = false;\n\t#isNextAutocompleteRequestWaiting = false;\n\n\t#onLocationSelectTimerId = null;\n\n\tconstructor(props)\n\t{\n\t\tsuper(props);\n\n\t\tthis.setEventNamespace('BX.Location.Widget.Autocomplete');\n\n\t\tif (!(props.addressFormat instanceof Format))\n\t\t{\n\t\t\tthrow new Error('props.addressFormat must be type of Format');\n\t\t}\n\n\t\tthis.#addressFormat = props.addressFormat;\n\n\t\tif (!(props.autocompleteService instanceof AutocompleteServiceBase))\n\t\t{\n\t\t\tthrow new Error('props.autocompleteService must be type of AutocompleteServiceBase');\n\t\t}\n\n\t\tthis.#autocompleteService = props.autocompleteService;\n\n\t\tif (!props.languageId)\n\t\t{\n\t\t\tthrow new Error('props.languageId must be defined');\n\t\t}\n\n\t\tthis.#languageId = props.languageId;\n\t\tthis.#sourceCode = props.sourceCode;\n\t\tthis.#address = props.address;\n\t\tthis.#presetLocationsProvider = props.presetLocationsProvider;\n\t\tthis.#locationRepository = props.locationRepository || new LocationRepository();\n\t\tthis.#userLocationPoint = props.userLocationPoint;\n\t\tthis.#setState(State.INITIAL);\n\t}\n\n\trender(props: {}): void\n\t{\n\t\tthis.#inputNode = props.inputNode;\n\t\tthis.#address = props.address;\n\t\tthis.#addressString = new AddressString(this.#inputNode, this.#addressFormat, this.#address);\n\t\tthis.#inputNode.addEventListener('keydown', this.#onInputKeyDown.bind(this));\n\t\tthis.#inputNode.addEventListener('keyup', this.#onInputKeyUp.bind(this));\n\t\tthis.#inputNode.addEventListener('focus', this.#onInputFocus.bind(this));\n\t\tthis.#inputNode.addEventListener('focusout', this.#onInputFocusOut.bind(this));\n\t\tthis.#inputNode.addEventListener('click', this.#onInputClick.bind(this));\n\t\tthis.#inputNode.addEventListener('paste', this.#onInputPaste.bind(this));\n\n\t\tthis.#prompt = new Prompt({\n\t\t\tinputNode: props.inputNode,\n\t\t\tmenuNode: props.menuNode,\n\t\t});\n\n\t\tthis.#prompt.subscribe(Prompt.onItemSelectedEvent, this.#onPromptItemSelected.bind(this));\n\t\tdocument.addEventListener('click', this.#onDocumentClick.bind(this));\n\t}\n\n\t// eslint-disable-next-line no-unused-vars\n\t#onInputClick(e: MouseEvent)\n\t{\n\t\tconst value = this.#addressString.value;\n\n\t\tif (value.length === 0)\n\t\t{\n\t\t\tthis.#showPresetLocations();\n\t\t}\n\t}\n\n\t#showPresetLocations()\n\t{\n\t\tconst presetLocationList = this.#presetLocationsProvider();\n\n\t\tthis.#prompt.setMenuItems(presetLocationList, '');\n\n\t\tlet leftBottomMenuMessage;\n\n\t\tif (presetLocationList.length > 0)\n\t\t{\n\t\t\tleftBottomMenuMessage = Loc.getMessage('LOCATION_WIDGET_PICK_ADDRESS_OR_SHOW_ON_MAP');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tleftBottomMenuMessage = Loc.getMessage('LOCATION_WIDGET_START_PRINTING_OR_SHOW_ON_MAP');\n\t\t}\n\n\t\tthis.#showMenu(leftBottomMenuMessage, null);\n\t}\n\n\t#createRightBottomMenuNode(location: ?Location): Element\n\t{\n\t\tconst element = Tag.render`\n\t\t\t\t<span class=\"location-map-popup-item--show-on-map\">\n\t\t\t\t\t${Loc.getMessage('LOCATION_WIDGET_SHOW_ON_MAP')}\n\t\t\t\t</span>\n\t\t`;\n\n\t\telement.addEventListener('click', this.#getShowOnMapHandler(location));\n\n\t\treturn element;\n\t}\n\n\t#createLeftBottomMenuNode(text: string): Element\n\t{\n\t\treturn Tag.render`\n\t\t\t\t<span>\n\t\t\t\t\t<span class=\"menu-popup-item-icon\"></span>\n\t\t\t\t\t<span class=\"menu-popup-item-text\">${text}</span>\n\t\t\t\t</span>\n\t\t`;\n\t}\n\n\t#showMenu(leftBottomText: string, location: ?Location): void\n\t{\n\t\t/* Menu destroys popup after the closing, so we need to refresh it every time, we show it */\n\t\tthis.#prompt.getMenu().setBottomRightItemNode(\n\t\t\tthis.#createRightBottomMenuNode(location)\n\t\t);\n\t\tthis.#prompt.getMenu().setBottomLeftItemNode(\n\t\t\tthis.#createLeftBottomMenuNode(leftBottomText)\n\t\t);\n\t\tthis.#prompt.getMenu().show();\n\t}\n\n\t#onInputFocusOut(e: Event)\n\t{\n\t\tif (this.#isDestroyed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tthis.#state === State.DATA_INPUTTING\n\t\t\t&& !(\n\t\t\t\te.relatedTarget\n\t\t\t\t&& (e.relatedTarget.getAttribute('data-role') === 'location-widget-menu-item')\n\t\t\t)\n\t\t) {\n\t\t\tthis.#setState(State.DATA_SUPPOSED);\n\n\t\t\tlet isChanged = false;\n\t\t\tif (this.#addressString) {\n\t\t\t\tif (\n\t\t\t\t\t!this.#address\n\t\t\t\t\t|| !this.#addressString.hasPureAddressString()\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\tthis.#address = this.#convertStringToAddress(\n\t\t\t\t\t\tthis.#addressString.value\n\t\t\t\t\t);\n\t\t\t\t\tisChanged = true;\n\t\t\t\t}\n\t\t\t\t// this.#addressString === null until autocompete'll be rendered\n\t\t\t\telse if (this.#addressString.customTail !== '')\n\t\t\t\t{\n\t\t\t\t\tconst currentValue = this.#address.getFieldValue(this.#addressFormat.fieldForUnRecognized);\n\t\t\t\t\tconst newValue = currentValue\n\t\t\t\t\t\t? currentValue + this.#addressString.customTail\n\t\t\t\t\t\t: this.#addressString.customTail\n\t\t\t\t\t;\n\t\t\t\t\tthis.#address.setFieldValue(\n\t\t\t\t\t\tthis.#addressFormat.fieldForUnRecognized,\n\t\t\t\t\t\tnewValue\n\t\t\t\t\t);\n\t\t\t\t\tisChanged = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isChanged)\n\t\t\t{\n\t\t\t\tthis.#addressString.setValueFromAddress(this.#address);\n\t\t\t\tthis.#onAddressChangedEventEmit([], {storeAsLastAddress: false});\n\t\t\t}\n\t\t}\n\n\t\t// Let's prevent other onInputFocusOut handlers.\n\t\te.stopImmediatePropagation();\n\t}\n\n\t#onInputFocus()\n\t{\n\t\tif (this.#isDestroyed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.#address)\n\t\t{\n\t\t\tconst lastAddress = Storage.getInstance().lastAddress;\n\n\t\t\tif (\n\t\t\t\tlastAddress\n\t\t\t\t&& lastAddress.fieldCollection.isFieldExists(AddressType.LOCALITY)\n\t\t\t\t&& !this.#wasCleared\n\t\t\t)\n\t\t\t{\n\t\t\t\tconst fieldCollection = {};\n\n\t\t\t\tfieldCollection[AddressType.LOCALITY] = lastAddress.fieldCollection.getFieldValue(\n\t\t\t\t\tAddressType.LOCALITY\n\t\t\t\t);\n\t\t\t\tif (lastAddress.fieldCollection.isFieldExists(AddressType.COUNTRY))\n\t\t\t\t{\n\t\t\t\t\tfieldCollection[AddressType.COUNTRY] = lastAddress.fieldCollection.getFieldValue(AddressType.COUNTRY);\n\t\t\t\t}\n\t\t\t\tif (lastAddress.fieldCollection.isFieldExists(AddressType.ADM_LEVEL_1))\n\t\t\t\t{\n\t\t\t\t\tfieldCollection[AddressType.ADM_LEVEL_1] = lastAddress.fieldCollection.getFieldValue(AddressType.ADM_LEVEL_1);\n\t\t\t\t}\n\n\t\t\t\tif (['RU', 'RU_2'].includes(this.#addressFormat.code))\n\t\t\t\t{\n\t\t\t\t\tfieldCollection[AddressType.ADDRESS_LINE_2] = ', ';\n\t\t\t\t}\n\n\t\t\t\tthis.#address = new Address({\n\t\t\t\t\tlanguageId: lastAddress.languageId,\n\t\t\t\t\tfieldCollection: fieldCollection,\n\t\t\t\t});\n\t\t\t\tthis.#addressString.setValueFromAddress(this.#address);\n\t\t\t\tthis.#setState(State.DATA_SUPPOSED);\n\t\t\t\tthis.#onAddressChangedEventEmit(\n\t\t\t\t\t[],\n\t\t\t\t\t{storeAsLastAddress: false}\n\t\t\t\t);\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tBX.setCaretPosition(this.#inputNode, this.#inputNode.value.length);\n\t\t\t\t}, 0);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (\n\t\t\t\tthis.#address\n\t\t\t\t&& (!this.#address.location || !this.#address.location.hasExternalRelation())\n\t\t\t\t&& this.#addressString.value.length > 0\n\t\t\t)\n\t\t\t{\n\t\t\t\tthis.showPrompt(this.#addressString.value);\n\t\t\t}\n\t\t}\n\t}\n\n\t#makeAutocompleteServiceParams(): AutocompleteServiceParams\n\t{\n\t\tconst result: AutocompleteServiceParams = {};\n\n\t\t//result.biasPoint = this.#userLocationPoint;\n\t\tif (this.#address && this.#address.latitude && this.#address.longitude)\n\t\t{\n\t\t\tresult.biasPoint = new Point(\n\t\t\t\tthis.#address.latitude,\n\t\t\t\tthis.#address.longitude\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * @param address\n\t */\n\tset address(address: ?Address): void\n\t{\n\t\tthis.#address = address;\n\n\t\tif (this.#addressString) // already rendered\n\t\t{\n\t\t\tthis.#addressString.setValueFromAddress(this.#address);\n\t\t}\n\n\t\tif (!address)\n\t\t{\n\t\t\tthis.#wasCleared = true;\n\t\t}\n\t}\n\n\t/**\n\t * @returns {Address}\n\t */\n\tget address(): ?Address\n\t{\n\t\treturn this.#address;\n\t}\n\n\t/**\n\t * Close menu on mouse click outside\n\t * @param {MouseEvent} event\n\t */\n\t#onDocumentClick(event: MouseEvent)\n\t{\n\t\tif (this.#isDestroyed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (event.target === this.#inputNode)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.#prompt.isShown())\n\t\t{\n\t\t\tthis.#prompt.close();\n\t\t}\n\t}\n\n\t/**\n\t * Subscribe on changed event\n\t * @param {Function} listener\n\t */\n\tonAddressChangedEventSubscribe(listener: Function): void\n\t{\n\t\tthis.subscribe(Autocomplete.#onAddressChangedEvent, listener);\n\t}\n\n\t/**\n\t * Subscribe on loading event\n\t * @param {Function} listener\n\t */\n\tonStateChangedEventSubscribe(listener: Function): void\n\t{\n\t\tthis.subscribe(Autocomplete.#onStateChangedEvent, listener);\n\t}\n\n\t/**\n\t * @param {Function} listener\n\t */\n\tonSearchStartedEventSubscribe(listener: Function): void\n\t{\n\t\tthis.subscribe(Autocomplete.#onSearchStartedEvent, listener);\n\t}\n\n\t/**\n\t * @param {Function} listener\n\t */\n\tonSearchCompletedEventSubscribe(listener: Function): void\n\t{\n\t\tthis.subscribe(Autocomplete.#onSearchCompletedEvent, listener);\n\t}\n\n\t/**\n\t * @param {Function} listener\n\t */\n\tonShowOnMapClickedEventSubscribe(listener: Function): void\n\t{\n\t\tthis.subscribe(Autocomplete.#onShowOnMapClickedEvent, listener);\n\t}\n\n\t/**\n\t * Is called when autocompleteService returned location list\n\t * @param {array} locationsList\n\t * @param {object} params\n\t */\n\t#onPromptsReceived(locationsList: array<Location>, params: Object): void\n\t{\n\t\tif (Array.isArray(locationsList) && locationsList.length > 0)\n\t\t{\n\t\t\tif (\n\t\t\t\tlocationsList.length === 1\n\t\t\t\t&& this.#address\n\t\t\t\t&& this.#address.location\n\t\t\t\t&& this.#address.location.externalId\n\t\t\t\t&& this.#address.location.externalId === locationsList[0].externalId\n\t\t\t)\n\t\t\t{\n\t\t\t\tthis.closePrompt();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.#prompt.setMenuItems(locationsList, this.#searchPhrase.requested, this.address);\n\t\t\tthis.#showMenu(Loc.getMessage('LOCATION_WIDGET_PICK_ADDRESS_OR_SHOW_ON_MAP'), locationsList[0]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.#prompt.getMenu().clearItems();\n\n\t\t\tthis.#prompt.getMenu().addMenuItem(\n\t\t\t\t{\n\t\t\t\t\tid: 'notFound',\n\t\t\t\t\thtml: `<span>${Loc.getMessage('LOCATION_WIDGET_PROMPT_ADDRESS_NOT_FOUND')}</span>`,\n\t\t\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t\t\t\tonclick: (event, item) => {\n\t\t\t\t\t\tthis.#prompt.close();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tthis.#showMenu(Loc.getMessage('LOCATION_WIDGET_CHECK_ADDRESS_OR_SHOW_ON_MAP'), null);\n\t\t}\n\t}\n\n\t#getShowOnMapHandler(location: ?Location)\n\t{\n\t\treturn () => {\n\t\t\tif (location)\n\t\t\t{\n\t\t\t\tthis.#fulfillSelection(location);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Otherwise this click will close just opened map popup.\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.emit(Autocomplete.#onShowOnMapClickedEvent);\n\t\t\t}, 1);\n\t\t};\n\t}\n\n\tstatic #splitPhrase(phrase: string): Object\n\t{\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tphrase = phrase.trim();\n\n\t\tif (phrase.length <= 0)\n\t\t{\n\t\t\treturn ['', ''];\n\t\t}\n\n\t\tconst tailPosition = phrase.lastIndexOf(' ');\n\n\t\tif (tailPosition <= 0)\n\t\t{\n\t\t\treturn ['', ''];\n\t\t}\n\n\t\treturn [phrase.slice(0, tailPosition), phrase.slice(tailPosition + 1)];\n\t}\n\n\t/**\n\t * Is called when location from menu have chosen\n\t * @param event\n\t */\n\t#onPromptItemSelected(event: BaseEvent): void\n\t{\n\t\tif (event.data.location)\n\t\t{\n\t\t\tthis.#fulfillSelection(event.data.location);\n\t\t}\n\t}\n\n\tget state(): string\n\t{\n\t\treturn this.#state;\n\t}\n\n\t#setState(state: string)\n\t{\n\t\tthis.#state = state;\n\t\tthis.emit(Autocomplete.#onStateChangedEvent, {state: this.#state});\n\t}\n\n\t/**\n\t * Fulfill selected location\n\t * @param {Location} location\n\t * @returns {Promise}\n\t */\n\t#fulfillSelection(location: ?Location): void\n\t{\n\t\tlet result;\n\t\tthis.#setState(State.DATA_SELECTED);\n\t\tif (location)\n\t\t{\n\t\t\tif (location.hasExternalRelation() && this.#sourceCode === location.sourceCode)\n\t\t\t{\n\t\t\t\tresult = this.#getLocationDetails(location)\n\t\t\t\t\t.then(\n\t\t\t\t\t\t(detailedLocation: ?Location) => {\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tlocation.address\n\t\t\t\t\t\t\t\t&& location.address.getFieldValue(AddressType.ADDRESS_LINE_2)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlet addressLine2 = '';\n\t\t\t\t\t\t\t\tif (detailedLocation.address.getFieldValue(AddressType.ADDRESS_LINE_2))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\taddressLine2 = detailedLocation.address.getFieldValue(AddressType.ADDRESS_LINE_2);\n\t\t\t\t\t\t\t\t\taddressLine2 += ', ';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taddressLine2 += location.address.getFieldValue(AddressType.ADDRESS_LINE_2);\n\n\t\t\t\t\t\t\t\tdetailedLocation.address.setFieldValue(AddressType.ADDRESS_LINE_2, addressLine2);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.#createOnLocationSelectTimer(detailedLocation, 0);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(response) => ErrorPublisher.getInstance().notify(response.errors)\n\t\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new Promise((resolve) => {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tthis.#createOnLocationSelectTimer(location, 0);\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t}, 0);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresult = new Promise((resolve) => {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.#createOnLocationSelectTimer(null, 0);\n\t\t\t\t\tresolve();\n\t\t\t\t}, 0);\n\t\t\t});\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t#onAddressChangedEventEmit(excludeSetAddressFeatures: Array = [], options: Object = {})\n\t{\n\t\tthis.emit(\n\t\t\tAutocomplete.#onAddressChangedEvent,\n\t\t\t{\n\t\t\t\taddress: this.#address,\n\t\t\t\texcludeSetAddressFeatures,\n\t\t\t\toptions: options,\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * obtain location details\n\t * @param {Location} location\n\t * @returns {*}\n\t */\n\t#getLocationDetails(location: Location): Promise\n\t{\n\t\tthis.#setState(State.DATA_LOADING);\n\n\t\treturn this.#locationRepository.findByExternalId(\n\t\t\tlocation.externalId,\n\t\t\tlocation.sourceCode,\n\t\t\tlocation.languageId\n\t\t)\n\t\t\t.then((detailedLocation: ?Location) => {\n\t\t\t\t\tthis.#setState(State.DATA_LOADED);\n\n\t\t\t\t\tlet result;\n\t\t\t\t\t/*\n\t\t\t\t\t * Nominatim could return a bit different location without the coordinates.\n\t\t\t\t\t * For example N752206814\n\t\t\t\t\t */\n\t\t\t\t\tif (\n\t\t\t\t\t\tdetailedLocation.latitude !== '0'\n\t\t\t\t\t\t&& detailedLocation.longitude !== '0'\n\t\t\t\t\t\t&& detailedLocation !== ''\n\t\t\t\t\t)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult = detailedLocation;\n\t\t\t\t\t\tresult.name = location.name;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tresult = location;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn result;\n\t\t\t\t},\n\t\t\t\t(response) => {\n\t\t\t\t\tErrorPublisher.getInstance().notify(response.errors);\n\t\t\t\t}\n\t\t\t);\n\t}\n\n\t#convertStringToAddress(addressString: string)\n\t{\n\t\tconst result = new Address({\n\t\t\tlanguageId: this.#languageId\n\t\t});\n\n\t\tresult.setFieldValue(this.#addressFormat.fieldForUnRecognized, addressString);\n\t\treturn result;\n\t}\n\n\t/**\n\t * Is called when location was selected and the location details were obtained\n\t * @param {Location} location\n\t */\n\t#onLocationSelect(location: ?Location): void\n\t{\n\t\tthis.#address = location ? location.toAddress() : null;\n\t\tthis.#addressString.setValueFromAddress(this.#address);\n\t\tthis.#onAddressChangedEventEmit();\n\t}\n\n\t#onInputKeyDown(e: KeyboardEvent): void\n\t{\n\t\tif (\n\t\t\t!(\n\t\t\t\tthis.#inputNode\n\t\t\t\t&& this.#inputNode.selectionStart === 0\n\t\t\t\t&& this.#inputNode.selectionEnd === this.#inputNode.value.length\n\t\t\t)\n\t\t)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t(\n\t\t\t\te.code === 'Backspace'\n\t\t\t\t|| e.code === 'Delete'\n\t\t\t\t|| (e.code === 'KeyV' && ((e.ctrlKey || e.metaKey)))\n\t\t\t\t|| (e.code === 'KeyX' && ((e.ctrlKey || e.metaKey)))\n\t\t\t\t|| (e.code === 'Insert' && e.shiftKey)\n\t\t\t)\n\t\t\t|| (\n\t\t\t\t!(e.ctrlKey || e.metaKey)\n\t\t\t\t&& [...e.key].length === 1\n\t\t\t)\n\t\t)\n\t\t{\n\t\t\tthis.address = null;\n\t\t\tthis.#onAddressChangedEventEmit();\n\t\t}\n\t}\n\n\t#onInputKeyUp(e: KeyboardEvent): void\n\t{\n\t\tif (this.#isDestroyed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tthis.#state !== State.DATA_INPUTTING\n\t\t\t&& this.#addressString.isChanged()\n\t\t)\n\t\t{\n\t\t\tthis.#setState(State.DATA_INPUTTING);\n\t\t}\n\n\t\tif (this.#prompt.isShown())\n\t\t{\n\t\t\tlet location;\n\t\t\tconst onLocationSelectTimeout = 700;\n\n\t\t\tswitch (e.code)\n\t\t\t{\n\t\t\t\tcase 'NumpadEnter':\n\t\t\t\tcase 'Enter':\n\t\t\t\t\tif (this.#prompt.isItemChosen())\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.#fulfillSelection(this.#prompt.getChosenItem())\n\t\t\t\t\t\t\t.then(() => {\n\t\t\t\t\t\t\t\t\tthis.#prompt.close();\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t(error) => BX.debug(error)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\n\t\t\t\tcase 'Tab':\n\t\t\t\tcase 'Escape':\n\t\t\t\t\tthis.#setState(State.DATA_SUPPOSED);\n\t\t\t\t\tthis.#onAddressChangedEventEmit();\n\t\t\t\t\tthis.#prompt.close();\n\t\t\t\t\treturn;\n\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tlocation = this.#prompt.choosePrevItem();\n\n\t\t\t\t\tif (location && location.address)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.#createOnLocationSelectTimer(location, onLocationSelectTimeout);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tlocation = this.#prompt.chooseNextItem();\n\n\t\t\t\t\tif (location && location.address)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.#createOnLocationSelectTimer(location, onLocationSelectTimeout);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (this.#addressString.isChanged())\n\t\t{\n\t\t\tthis.#addressString.actualize();\n\t\t\tthis.showPrompt(this.#addressString.value);\n\t\t}\n\n\t\tif (this.#addressString.value.length === 0)\n\t\t{\n\t\t\tthis.#showPresetLocations();\n\t\t}\n\t}\n\n\t#onInputPaste(): void\n\t{\n\t\tsetTimeout(() => {\n\t\t\tif (\n\t\t\t\tthis.#state !== State.DATA_INPUTTING\n\t\t\t\t&& this.#addressString.isChanged()\n\t\t\t)\n\t\t\t{\n\t\t\t\tthis.#setState(State.DATA_INPUTTING);\n\t\t\t}\n\n\t\t\tif (this.#addressString.isChanged())\n\t\t\t{\n\t\t\t\tthis.#addressString.actualize();\n\t\t\t\tthis.showPrompt(this.#addressString.value);\n\t\t\t}\n\t\t}, 0);\n\t}\n\n\t#createOnLocationSelectTimer(location: Location, timeout: Number): void\n\t{\n\t\tif (this.#onLocationSelectTimerId !== null)\n\t\t{\n\t\t\tclearTimeout(this.#onLocationSelectTimerId);\n\t\t}\n\n\t\tthis.#onLocationSelectTimerId = setTimeout(() => {\n\t\t\t\tthis.#onLocationSelect(location);\n\t\t\t},\n\t\t\ttimeout\n\t\t);\n\t}\n\n\t/**\n\t * @param {string} searchPhrase\n\t */\n\tshowPrompt(searchPhrase: string): void\n\t{\n\t\tthis.#searchPhrase.requested = searchPhrase;\n\t\tthis.#searchPhrase.current = searchPhrase;\n\t\tthis.#searchPhrase.dropped = '';\n\t\tthis.#showPromptInner(searchPhrase);\n\t}\n\n\tclosePrompt(): void\n\t{\n\t\tif (this.#prompt)\n\t\t{\n\t\t\tthis.#prompt.close();\n\t\t}\n\t}\n\n\tisPromptShown(): boolean\n\t{\n\t\tif (this.#prompt)\n\t\t{\n\t\t\tthis.#prompt.isShown();\n\t\t}\n\t}\n\n\t#showPromptInner(searchPhrase: string): void\n\t{\n\t\tif (searchPhrase.length <= 3)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.#timerId !== null)\n\t\t{\n\t\t\tclearTimeout(this.#timerId);\n\t\t}\n\n\t\tthis.#timerId = this.#createTimer(searchPhrase);\n\t}\n\n\t/**\n\t * Wait for further user input for some time\n\t * @param {string} searchPhrase\n\t * @returns {number}\n\t */\n\t#createTimer(searchPhrase: string): number\n\t{\n\t\treturn setTimeout(() => {\n\t\t\t\t// to avoid multiple parallel requests, server responses are too slow.\n\t\t\t\tif (this.#isAutocompleteRequestStarted)\n\t\t\t\t{\n\t\t\t\t\tclearTimeout(this.#timerId);\n\t\t\t\t\tthis.#timerId = this.#createTimer(searchPhrase);\n\t\t\t\t\tthis.#isNextAutocompleteRequestWaiting = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.#isNextAutocompleteRequestWaiting = false;\n\n\t\t\t\tthis.emit(Autocomplete.#onSearchStartedEvent);\n\t\t\t\tthis.#isAutocompleteRequestStarted = true;\n\t\t\t\tconst params = this.#makeAutocompleteServiceParams();\n\n\t\t\t\tthis.#autocompleteService.autocomplete(searchPhrase, params)\n\t\t\t\t\t.then(\n\t\t\t\t\t\t(locationsList: Array<Location>) => {\n\t\t\t\t\t\t\tthis.#timerId = null;\n\t\t\t\t\t\t\tif (!this.#isNextAutocompleteRequestWaiting)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.#onPromptsReceived(locationsList, params);\n\t\t\t\t\t\t\t\tthis.emit(Autocomplete.#onSearchCompletedEvent);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.#isAutocompleteRequestStarted = false;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(error) => {\n\t\t\t\t\t\t\tif (!this.#isNextAutocompleteRequestWaiting)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.emit(Autocomplete.#onSearchCompletedEvent);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.#isAutocompleteRequestStarted = false;\n\t\t\t\t\t\t\tBX.debug(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t},\n\t\t\t300\n\t\t);\n\t}\n\n\tdestroy(): void\n\t{\n\t\tif (this.#isDestroyed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tEvent.unbindAll(this);\n\n\t\tif (this.#prompt)\n\t\t{\n\t\t\tthis.#prompt.destroy();\n\t\t\tthis.#prompt = null;\n\t\t}\n\n\t\tthis.#timerId = null;\n\n\t\tif (this.#inputNode)\n\t\t{\n\t\t\tthis.#inputNode.removeEventListener('keydown', this.#onInputKeyDown);\n\t\t\tthis.#inputNode.removeEventListener('keyup', this.#onInputKeyUp);\n\t\t\tthis.#inputNode.removeEventListener('focus', this.#onInputFocus);\n\t\t\tthis.#inputNode.removeEventListener('focusout', this.#onInputFocusOut);\n\t\t\tthis.#inputNode.removeEventListener('click', this.#onInputClick);\n\t\t\tthis.#inputNode.removeEventListener('paste', this.#onInputPaste);\n\t\t}\n\n\t\tdocument.removeEventListener('click', this.#onDocumentClick);\n\t\tthis.#isDestroyed = true;\n\t}\n}\n","import {Tag} from \"main.core\";\n\nexport default class Photo\n{\n\t#description;\n\t#url;\n\t#link;\n\t#location;\n\t#title;\n\n\tconstructor(props)\n\t{\n\t\tthis.#url = props.url;\n\t\tthis.#link = props.link || '';\n\t\tthis.#description = props.description || '';\n\t\tthis.#location = props.location;\n\t\tthis.#title = props.title || '';\n\t}\n\n\trender()\n\t{\n\t\tlet description = '';\n\n\t\tif(this.#description)\n\t\t{\n\t\t\t//todo: sanitize\n\t\t\tdescription = Tag.render`<span class=\"location-map-item-description\">${this.#description}</span>`;\n\t\t}\n\n\t\treturn Tag.render`\n\t\t\t<div class=\"location-map-photo-item-block\">\n\t\t\t\t<span class=\"location-map-photo-item-block-image-block-inner\">\n\t\t\t\t\t${description}\n\t\t\t\t\t<span \n\t\t\t\t\t\tdata-viewer data-viewer-type=\"image\" \n\t\t\t\t\t\tdata-src=\"${this.#link}\" \n\t\t\t\t\t\tdata-title=\"${this.#title}\"\n\t\t\t\t\t\tclass=\"location-map-item-photo-image\" \n\t\t\t\t\t\tdata-viewer-group-by=\"${this.#location.externalId}\"\n\t\t\t\t\t\tstyle=\"background-image: url(${this.#url});\">\t\t\t\t\t\t\t\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t</div>`;\n\t}\n}","import {Tag, Dom} from \"main.core\";\nimport Photo from \"./photo\";\n\nexport default class Gallery\n{\n\t#photos = [];\n\t#container = null;\n\t#photosContainer = null;\n\t#thumbnailHeight;\n\t#thumbnailWidth;\n\t#photoService;\n\t#maxPhotoCount;\n\t#location;\n\n\tconstructor(props)\n\t{\n\t\tthis.#thumbnailHeight = props.thumbnailHeight;\n\t\tthis.#thumbnailWidth = props.thumbnailWidth;\n\t\tthis.#maxPhotoCount = props.maxPhotoCount;\n\t\tthis.#photoService = props.photoService;\n\t}\n\n\trefresh()\n\t{\n\t\tif(this.#location)\n\t\t{\n\t\t\tthis.#photoService.requestPhotos({\t\t\t\t\n\t\t\t\tlocation: this.#location,\n\t\t\t\tthumbnailHeight: this.#thumbnailHeight,\n\t\t\t\tthumbnailWidth: this.#thumbnailWidth,\n\t\t\t\tmaxPhotoCount: this.#maxPhotoCount\n\t\t\t\t\n\t\t\t})\n\t\t\t.then((photosData) => {\n\t\t\t\tif(Array.isArray(photosData) && photosData.length > 0)\n\t\t\t\t{\n\t\t\t\t\tthis.#setPhotos(photosData);\n\t\t\t\t\tthis.show();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.hide();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.hide();\n\t\t}\n\t}\n\n\tset location(location: Location)\n\t{\n\t\tthis.#location = location;\n\t\tthis.refresh();\n\t}\n\n\t#setPhotos(photosData)\n\t{\n\t\tif(!this.#location)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tlet photos = [];\n\n\t\tfor(let photo of photosData)\n\t\t{\n\t\t\tphotos.push(\n\t\t\t\tnew Photo({\n\t\t\t\t\turl: photo.thumbnail.url,\n\t\t\t\t\tlink: photo.url,\n\t\t\t\t\tlocation: this.#location,\n\t\t\t\t\ttitle: this.#location.name + \" ( \" + BX.util.strip_tags(photo.description) + ' )'\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\n\t\tif(!Array.isArray(photos))\n\t\t{\n\t\t\tBX.debug('Wrong type of photos. Must be array');\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#photos = [];\n\n\t\tfor(let photo of photos)\n\t\t{\n\t\t\tthis.#photos.push(photo);\n\t\t}\n\n\t\tif(this.#photos.length > 0 && this.#photosContainer)\n\t\t{\n\t\t\tlet renderedPhotos = this.#photos ? this.#renderPhotos(this.#photos) : '';\n\n\t\t\tthis.#photosContainer.innerHTML = '';\n\n\t\t\tif(renderedPhotos.length > 0)\n\t\t\t{\n\t\t\t\tfor (let photo of renderedPhotos)\n\t\t\t\t{\n\t\t\t\t\tthis.#photosContainer.appendChild(photo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\thide()\n\t{\n\t\tif(this.#container)\n\t\t{\n\t\t\tthis.#container.style.display = 'none';\n\t\t}\n\t}\n\n\tisHidden()\n\t{\n\t\treturn !this.#container || this.#container.clientWidth <= 0;\n\t}\n\n\tshow()\n\t{\n\t\tif(this.#container)\n\t\t{\n\t\t\tthis.#container.style.display = 'block';\n\t\t}\n\t}\n\n\trender()\n\t{\n\t\tthis.#photosContainer = Tag.render`\t\t\t\t\t\n\t\t\t\t<div class=\"location-map-photo-inner\">\t\t\t\t\t\n\t\t\t\t</div>`;\n\n\t\tthis.#container = Tag.render`\n\t\t\t<div class=\"location-map-photo-container\">\n\t\t\t\t${this.#photosContainer}\n\t\t\t</div>`;\n\n\t\treturn this.#container;\n\t}\n\n\t#renderPhotos(photos)\n\t{\n\t\tlet result = [];\n\n\t\tfor (let photo of photos)\n\t\t{\n\t\t\tresult.push(photo.render());\n\t\t}\n\n\t\treturn result;\n\t}\n}","import {Tag, Event, Dom, Text} from 'main.core';\nimport {EventEmitter} from 'main.core.events';\nimport 'ui.forms';\nimport {ControlMode} from 'location.core';\nimport State from '../state';\n\nexport default class Field extends EventEmitter\n{\n\tstatic #onValueChangedEvent = 'onValueChanged';\n\tstatic #onStateChangedEvent = 'onStateChanged';\n\n\t#title;\n\t#value;\n\t#type;\n\t#sort;\n\t#mode;\n\t#input;\n\t#viewContainer;\n\t#container = null;\n\t#state = State.INITIAL;\n\n\tconstructor(props: FieldConstructorProps)\n\t{\n\t\tsuper(props);\n\t\tthis.setEventNamespace('BX.Location.Widget.Field');\n\n\t\tthis.#title = props.title;\n\t\tthis.#type = props.type;\n\t\tthis.#sort = props.sort;\n\t}\n\n\tget container()\n\t{\n\t\treturn this.#container;\n\t}\n\n\tget state()\n\t{\n\t\treturn this.#state;\n\t}\n\n\t#setState(state: string)\n\t{\n\t\tthis.#state = state;\n\t\tthis.emit(Field.#onStateChangedEvent, {state: this.#state});\n\t}\n\n\trender(props: FieldRenderProps): void\n\t{\n\t\tthis.#value = typeof props.value === 'string' ? props.value : '';\n\n\t\tif(!ControlMode.isValid(props.mode))\n\t\t{\n\t\t\tBX.debug('props.mode must be valid ControlMode');\n\t\t}\n\n\t\tthis.#mode = props.mode;\n\n\t\tthis.#container = Tag.render`\n\t\t\t<div class=\"ui-entity-editor-content-block ui-entity-editor-field-text\">\n\t\t\t\t<div class=\"ui-entity-editor-block-title\">\n\t\t\t\t\t<label class=\"ui-entity-editor-block-title-text\">${this.#title}:</label>\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>`;\n\n\t\tif(this.#mode === ControlMode.edit)\n\t\t{\n\t\t\tthis.#renderEditMode(this.#container)\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.#renderViewMode(this.#container)\n\t\t}\n\n\t\treturn this.#container;\n\t}\n\n\t#renderEditMode(container: Element)\n\t{\n\t\tthis.#input = Tag.render`<input type=\"text\" class=\"ui-ctl-element\" value=\"${Text.encode(this.#value)}\">`;\n\t\tthis.#viewContainer = null;\n\n\t\tEvent.bind(this.#input, 'focus', (e) => {\n\t\t\tthis.#setState(State.DATA_INPUTTING);\n\t\t});\n\n\t\tEvent.bind(this.#input, 'focusout', (e) => {\n\t\t\tthis.#setState(State.DATA_SELECTED);\n\t\t});\n\n\t\tEvent.bind(this.#input, 'change', (e) => {\n\t\t\tthis.#setState(State.DATA_SELECTED);\n\t\t\tthis.#value = this.#input.value;\n\t\t\tthis.emit(Field.#onValueChangedEvent, {value: this});\n\t\t});\n\n\t\tcontainer.appendChild(\n\t\t\tTag.render`\n\t\t\t\t<div class=\"ui-entity-editor-content-block\">\n\t\t\t\t\t<div class=\"ui-ctl ui-ctl-textbox ui-ctl-w100\">\n\t\t\t\t\t\t${this.#input}\n\t\t\t\t\t</div>\n\t\t\t\t</div>`\n\t\t);\n\t}\n\n\t#renderViewMode(container: Element)\n\t{\n\t\tthis.#input = null;\n\n\t\tthis.#viewContainer = Tag.render`\n\t\t\t<div class=\"ui-title-6\">\n\t\t\t\t${Text.encode(this.#value)}\n\t\t\t</div>`;\n\n\t\tcontainer.appendChild(this.#viewContainer);\n\t}\n\n\t#refreshLayout()\n\t{\n\t\tif(this.#mode === ControlMode.edit)\n\t\t{\n\t\t\tthis.#input.value = this.#value;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.#viewContainer.innerHTML = Text.encode(this.#value);\n\t\t}\n\t}\n\n\tset type(type: number)\n\t{\n\t\tthis.#type = type;\n\t}\n\n\tget type(): number\n\t{\n\t\treturn this.#type;\n\t}\n\n\tset sort(sort: number)\n\t{\n\t\tthis.#sort = sort;\n\t}\n\n\tget sort(): number\n\t{\n\t\treturn this.#sort;\n\t}\n\n\tset value(value: string)\n\t{\n\t\tthis.#value = typeof value === 'string' ? value : '';\n\t\tthis.#refreshLayout();\n\t}\n\n\tget value(): string\n\t{\n\t\treturn this.#value;\n\t}\n\n\tsubscribeOnValueChangedEvent(listener: Function): void\n\t{\n\t\tthis.subscribe(Field.#onValueChangedEvent, listener);\n\t}\n\n\tsubscribeOnStateChangedEvent(listener: Function): void\n\t{\n\t\tthis.subscribe(Field.#onStateChangedEvent, listener);\n\t}\n\n\tdestroy()\n\t{\n\t\tDom.remove(this.#container);\n\t\tEvent.unbindAll(this);\n\t\tthis.#container = null;\n\t}\n}\n\ntype FieldConstructorProps = {\n\ttitle: string\n}\n\ntype FieldRenderProps = {\n\tvalue: string,\n\tmode: string //ControlMode\n}","import {Event, Dom, Type} from 'main.core';\nimport {EventEmitter} from 'main.core.events';\nimport {Format, Address, ControlMode} from 'location.core';\nimport Field from './field';\n\nexport type FieldsConstructorType = {\n\taddressFormat: Format\n}\n\nexport type FieldsRenderType = {\n\taddress: Address,\n\tmode: string, // ControlMode\n\tcontainer: Element\n}\n\nexport default class Fields extends EventEmitter\n{\n\tstatic #onAddressChangedEvent = 'onAddressChanged';\n\tstatic #onStateChangedEvent = 'onStateChanged';\n\n\t#address;\n\t#addressFormat;\n\t#mode;\n\t#fields = [];\n\t#languageId;\n\t#container;\n\t#state;\n\n\tconstructor(props: FieldsConstructorType)\n\t{\n\t\tsuper(props);\n\n\t\tthis.setEventNamespace('BX.Location.Widget.Fields');\n\n\t\tif(!(props.addressFormat instanceof Format))\n\t\t{\n\t\t\tBX.debug('addressFormat must be instance of Format');\n\t\t}\n\n\t\tthis.#addressFormat = props.addressFormat;\n\t\tthis.#languageId = props.languageId;\n\t\tthis.#initFields();\n\t}\n\n\t#initFields()\n\t{\n\t\tfor (let type in this.#addressFormat.fieldCollection.fields)\n\t\t{\n\t\t\tif(!this.#addressFormat.fieldCollection.fields.hasOwnProperty(type))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet formatField = this.#addressFormat.fieldCollection.fields[type];\n\n\t\t\tlet field = new Field({\n\t\t\t\ttitle: formatField.name,\n\t\t\t\ttype: formatField.type,\n\t\t\t\tsort: formatField.sort\n\t\t\t});\n\n\t\t\tfield.subscribeOnValueChangedEvent((event) => {\n\t\t\t\tthis.#onFieldChanged(field);\n\t\t\t});\n\n\t\t\tfield.subscribeOnStateChangedEvent((event) => {\n\t\t\t\tlet data = event.getData();\n\t\t\t\tthis.#setState(data.state);\n\t\t\t});\n\n\t\t\tthis.#fields.push(field)\n\t\t}\n\n\t\tthis.#fields.sort((a, b) => {\n\t\t\treturn a.sort - b.sort;\n\t\t});\n\t}\n\n\trender(props: FieldsRenderType): void\n\t{\n\t\tif(props.address && !(props.address instanceof Address))\n\t\t{\n\t\t\tBX.debug('props.address must be instance of Address');\n\t\t}\n\n\t\tthis.#address = props.address;\n\n\t\tif(!ControlMode.isValid(props.mode))\n\t\t{\n\t\t\tBX.debug('props.mode must be valid ControlMode');\n\t\t}\n\n\t\tthis.#mode = props.mode;\n\n\t\tif(!Type.isDomNode(props.container))\n\t\t{\n\t\t\tBX.debug('props.container must be dom node');\n\t\t}\n\n\t\tthis.#container = props.container;\n\n\t\tfor(let field of this.#fields)\n\t\t{\n\t\t\tlet value = this.#address ? this.#address.getFieldValue(field.type) : '';\n\n\t\t\tif(this.#mode === ControlMode.view && !value)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet item = field.render({\n\t\t\t\tvalue: value,\n\t\t\t\tmode: this.#mode\n\t\t\t});\n\n\t\t\tthis.#container.appendChild(item);\n\t\t}\n\t}\n\n\t#onFieldChanged(field: Field)\n\t{\n\t\tif(!this.#address)\n\t\t{\n\t\t\tthis.#address = new Address({\n\t\t\t\tlanguageId: this.#languageId\n\t\t\t});\n\t\t}\n\n\t\tthis.#address.setFieldValue(field.type, field.value);\n\n\t\tthis.emit(Fields.#onAddressChangedEvent, {\n\t\t\taddress: this.#address,\n\t\t\tchangedField: field\n\t\t});\n\t}\n\n\tset address(address: ?Address)\n\t{\n\t\tif(address && !(address instanceof Address))\n\t\t{\n\t\t\tBX.debug('address must be instance of Address');\n\t\t}\n\n\t\tthis.#address = address;\n\n\t\tfor(let field of this.#fields)\n\t\t{\n\t\t\tfield.value = this.#address ? this.#address.getFieldValue(field.type) : '';\n\t\t}\n\t}\n\n\tsubscribeOnAddressChangedEvent(listener: Function): void\n\t{\n\t\tthis.subscribe(Fields.#onAddressChangedEvent, listener);\n\t}\n\n\tdestroy()\n\t{\n\t\tEvent.unbindAll(this);\n\n\t\tfor(let field of this.#fields)\n\t\t{\n\t\t\tfield.destroy();\n\t\t}\n\n\t\tDom.clean(this.#container);\n\t}\n\n\tget state()\n\t{\n\t\treturn this.#state;\n\t}\n\n\t#setState(state: string)\n\t{\n\t\tthis.#state = state;\n\t\tthis.emit(Fields.#onStateChangedEvent, {state: this.#state});\n\t}\n\n\tsubscribeOnStateChangedEvent(listener: Function): void\n\t{\n\t\tthis.subscribe(Fields.#onStateChangedEvent, listener);\n\t}\n}","import {Type} from 'main.core';\nimport {Address} from 'location.core';\nimport MapPopup from '../../mappopup/mappopup';\nimport BaseFeature from './basefeature';\nimport State from '../../state';\n\n/**\n * Complex address widget\n */\nexport default class MapFeature extends BaseFeature\n{\n\t#map = null;\n\n\t#mapBindElement = null;\n\t#addressWidget = null;\n\n\tconstructor(props)\n\t{\n\t\tsuper(props);\n\n\t\tif(!(props.map instanceof MapPopup))\n\t\t{\n\t\t\tBX.debug('props.map must be instance of MapPopup');\n\t\t}\n\n\t\tthis.#map = props.map;\n\n\t\tthis.#map.onChangedEventSubscribe(\n\t\t\t(event) => {\n\t\t\t\tconst data = event.getData();\n\t\t\t\tthis.#addressWidget.setAddressByFeature(data.address, this);\n\t\t\t});\n\t}\n\n\tshowMap(useUserLocation: boolean = false): void\n\t{\n\t\tif(!this.#map.isShown())\n\t\t{\n\t\t\tthis.#map.show(useUserLocation);\n\t\t}\n\t}\n\n\tcloseMap(): void\n\t{\n\t\tif(this.#map.isShown())\n\t\t{\n\t\t\tthis.#map.close();\n\t\t}\n\n\t\tthis.#map.bindelement = this.#mapBindElement;\n\t}\n\n\tresetView(): void\n\t{\n\t\tthis.closeMap();\n\t}\n\n\t/**\n\t * Render Widget\n\t * @param {Object} props\n\t */\n\trender(props: {}): void\n\t{\n\t\tif(!Type.isDomNode(props.mapBindElement))\n\t\t{\n\t\t\tBX.debug('props.mapBindElement  must be instance of Element');\n\t\t}\n\n\t\tthis.#mapBindElement = props.mapBindElement;\n\n\t\tthis.#map.render({\n\t\t\tbindElement: props.mapBindElement,\n\t\t\taddress: this.#addressWidget.address,\n\t\t\tmode: this.#addressWidget.mode,\n\t\t});\n\t}\n\n\tsetAddress(address: ?Address): void\n\t{\n\t\tif(this.addressWidget.state === State.DATA_INPUTTING)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#map.address = address;\n\t}\n\n\tsetAddressWidget(addressWidget): void\n\t{\n\t\tthis.#addressWidget = addressWidget;\n\t}\n\n\tsetMode(mode: string): void\n\t{\n\t\tthis.#map.mode = mode;\n\t}\n\n\tdestroy(): void\n\t{\n\t\tthis.#map.destroy();\n\t\tthis.#map = null;\n\t}\n\n\tget map(): MapPopup\n\t{\n\t\treturn this.#map;\n\t}\n\n\tget addressWidget(): Address\n\t{\n\t\treturn this.#addressWidget;\n\t}\n\n\tget mapBindElement(): Element\n\t{\n\t\treturn this.#mapBindElement;\n\t}\n}","import {Address, ControlMode} from 'location.core';\nimport BaseFeature from './basefeature';\nimport Autocomplete from '../../autocomplete/autocomplete';\n\n/**\n * Complex address widget\n */\nexport default class AutocompleteFeature extends BaseFeature\n{\n\tstatic searchStartedEvent = 'searchStarted';\n\tstatic searchCompletedEvent = 'searchCompleted';\n\tstatic showOnMapClickedEvent = 'showOnMapClicked';\n\n\t#autocomplete;\n\t#addressWidget = null;\n\n\tconstructor(props)\n\t{\n\t\tsuper(props);\n\n\t\tif(!(props.autocomplete instanceof Autocomplete))\n\t\t{\n\t\t\tBX.debug('props.autocomplete  must be instance of Autocomplete');\n\t\t}\n\n\t\tthis.#autocomplete = props.autocomplete;\n\n\t\tthis.#autocomplete.onAddressChangedEventSubscribe(\n\t\t\t(event) =>\n\t\t\t{\n\t\t\t\tconst data = event.getData();\n\n\t\t\t\tthis.#addressWidget.setAddressByFeature(\n\t\t\t\t\tdata.address,\n\t\t\t\t\tthis,\n\t\t\t\t\tdata.excludeSetAddressFeatures,\n\t\t\t\t\tdata.options\n\t\t\t\t);\n\t\t\t});\n\n\t\tthis.#autocomplete.onStateChangedEventSubscribe(\n\t\t\t(event) =>\n\t\t\t{\n\t\t\t\tconst data = event.getData();\n\t\t\t\tthis.#addressWidget.setStateByFeature(data.state);\n\t\t\t});\n\n\t\tthis.#autocomplete.onSearchStartedEventSubscribe(\n\t\t\t(event) =>\n\t\t\t{\n\t\t\t\tconst data = event.getData();\n\t\t\t\tthis.#addressWidget.emitFeatureEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\tfeature: this,\n\t\t\t\t\t\teventCode: AutocompleteFeature.searchStartedEvent,\n\t\t\t\t\t\tpayload: data\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\n\t\tthis.#autocomplete.onSearchCompletedEventSubscribe(\n\t\t\t(event) =>\n\t\t\t{\n\t\t\t\tconst data = event.getData();\n\t\t\t\tthis.#addressWidget.emitFeatureEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\tfeature: this,\n\t\t\t\t\t\teventCode: AutocompleteFeature.searchCompletedEvent,\n\t\t\t\t\t\tpayload: data\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\n\t\tthis.#autocomplete.onShowOnMapClickedEventSubscribe(\n\t\t\t(event) =>\n\t\t\t{\n\t\t\t\tconst data = event.getData();\n\t\t\t\tthis.#addressWidget.emitFeatureEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\tfeature: this,\n\t\t\t\t\t\teventCode: AutocompleteFeature.showOnMapClickedEvent,\n\t\t\t\t\t\tpayload: data\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t}\n\n\tresetView(): void\n\t{\n\t\tthis.#autocomplete.closePrompt();\n\t}\n\n\trender(props): void\n\t{\n\t\tif(this.#addressWidget.mode === ControlMode.edit)\n\t\t{\n\t\t\tthis.#autocomplete.render({\n\t\t\t\tinputNode: this.#addressWidget.inputNode,\n\t\t\t\tmenuNode: props.autocompleteMenuElement,\n\t\t\t\taddress: this.#addressWidget.address,\n\t\t\t\tmode: this.#addressWidget.mode,\n\t\t\t});\n\t\t}\n\t}\n\n\tsetAddress(address: ?Address): void\n\t{\n\t\tthis.#autocomplete.address = address;\n\t}\n\n\tsetAddressWidget(addressWidget)\n\t{\n\t\tthis.#addressWidget = addressWidget;\n\t}\n\n\tdestroy()\n\t{\n\t\tthis.#autocomplete.destroy();\n\t\tthis.#autocomplete = null;\n\t}\n}","import {Type} from 'main.core';\nimport {Address, ControlMode} from 'location.core';\nimport BaseFeature from './basefeature';\nimport Fields from '../../fields/fields';\n\n/**\n * Fields widget feature\n */\nexport default class FieldsFeature extends BaseFeature\n{\n\t#fields;\n\t#addressWidget = null;\n\n\tconstructor(props)\n\t{\n\t\tsuper(props);\n\n\t\tif(!(props.fields instanceof Fields))\n\t\t{\n\t\t\tBX.debug('props.Fields must be instance of Fields');\n\t\t}\n\n\t\tthis.#fields = props.fields;\n\n\t\tthis.#fields.subscribeOnAddressChangedEvent(\n\t\t\t(event) => {\n\t\t\t\tlet data = event.getData();\n\t\t\t\tthis.#addressWidget.setAddressByFeature(data.address, this);\n\t\t\t});\n\n\t\tthis.#fields.subscribeOnStateChangedEvent(\n\t\t\t(event) => {\n\t\t\t\tlet data = event.getData();\n\t\t\t\tthis.#addressWidget.setStateByFeature(data.state);\n\t\t\t});\n\t}\n\n\trender(props): void\n\t{\n\t\tif(this.#addressWidget.mode === ControlMode.edit)\n\t\t{\n\t\t\tif (!Type.isDomNode(props.fieldsContainer))\n\t\t\t{\n\t\t\t\tBX.debug('props.fieldsContainer  must be instance of Element');\n\t\t\t}\n\n\t\t\tthis.#fields.render({\n\t\t\t\taddress: this.#addressWidget.address,\n\t\t\t\tmode: this.#addressWidget.mode,\n\t\t\t\tcontainer: props.fieldsContainer\n\t\t\t});\n\t\t}\n\t}\n\n\tsetAddressWidget(addressWidget)\n\t{\n\t\tthis.#addressWidget = addressWidget;\n\t}\n\n\tsetAddress(address: Address): void\n\t{\n\t\tthis.#fields.address = address;\n\t}\n\n\tsetMode(mode: string): void\n\t{\n\t\tthis.#fields.mode = mode;\n\t}\n\n\tdestroy(): void\n\t{\n\t\tthis.#fields.destroy();\n\t\tthis.#fields = null;\n\t}\n}","import {Address, ControlMode} from 'location.core';\nimport State from '../../state';\nimport MapFeature from './mapfeature';\n\n/**\n * Map feature for the address widget with auto map opening / closing behavior\n */\nexport default class MapFeatureAuto extends MapFeature\n{\n\t#showMapTimerId = null;\n\t#showMapDelay = 700;\n\t#closeMapTimerId = null;\n\t#closeMapDelay = 800;\n\n\t#isDestroyed = false;\n\n\t/**\n\t * Render Widget\n\t * @param {AddressRenderProps} props\n\t */\n\trender(props: AddressRenderProps): void\n\t{\n\t\tsuper.render(props);\n\n\t\tthis.addressWidget.controlWrapper.addEventListener('click', this.#onControlWrapperClick.bind(this));\n\t\tthis.addressWidget.controlWrapper.addEventListener('mouseover', this.#processOnMouseOver.bind(this));\n\t\tthis.addressWidget.controlWrapper.addEventListener('mouseout', this.#processOnMouseOut.bind(this));\n\n\t\tdocument.addEventListener('click', this.#onDocumentClick.bind(this));\n\n\t\tthis.map.onMouseOverSubscribe(this.#processOnMouseOver.bind(this));\n\t\tthis.map.onMouseOutSubscribe(this.#processOnMouseOut.bind(this));\n\t}\n\n\t// eslint-disable-next-line no-unused-vars\n\t#onControlWrapperClick(event)\n\t{\n\t\tif (this.#isDestroyed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.addressWidget.mode === ControlMode.view)\n\t\t{\n\t\t\tif (this.map.isShown())\n\t\t\t{\n\t\t\t\tthis.closeMap();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tclearTimeout(this.#showMapTimerId);\n\t\t\t}\n\t\t}\n\t\telse if (this.addressWidget.mode === ControlMode.edit && this._saveResourceStrategy === false)\n\t\t{\n\t\t\tif (this.addressWidget.address && !this.map.isShown() && event.target === this.addressWidget.inputNode)\n\t\t\t{\n\t\t\t\tthis.showMap();\n\t\t\t}\n\t\t}\n\t}\n\n\t#onDocumentClick(event)\n\t{\n\t\tif (this.#isDestroyed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.addressWidget.inputNode !== event.target)\n\t\t{\n\t\t\tthis.closeMap();\n\t\t}\n\t}\n\n\t#processOnMouseOver()\n\t{\n\t\tif (this.#isDestroyed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tclearTimeout(this.#showMapTimerId);\n\t\tclearTimeout(this.#closeMapTimerId);\n\n\t\tif (this.addressWidget.mode !== ControlMode.view)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.addressWidget.address && !this.map.isShown())\n\t\t{\n\t\t\tthis.#showMapTimerId = setTimeout(() => {\n\t\t\t\t\tthis.showMap();\n\t\t\t\t},\n\t\t\t\tthis.#showMapDelay\n\t\t\t);\n\t\t}\n\t}\n\n\t#processOnMouseOut()\n\t{\n\t\tif (this.#isDestroyed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tclearTimeout(this.#showMapTimerId);\n\t\tclearTimeout(this.#closeMapTimerId);\n\n\t\tif (this.addressWidget.mode !== ControlMode.view)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.addressWidget.mode === ControlMode.view && this.map.isShown())\n\t\t{\n\t\t\tthis.#closeMapTimerId = setTimeout(() => {\n\t\t\t\t\tthis.closeMap();\n\t\t\t\t},\n\t\t\t\tthis.#closeMapDelay\n\t\t\t);\n\t\t}\n\t}\n\n\tsetAddress(address: ?Address): void\n\t{\n\t\tif (!address)\n\t\t{\n\t\t\tthis.closeMap();\n\t\t}\n\n\t\tthis.map.address = address;\n\n\t\tif (address && this.addressWidget.state !== State.DATA_SUPPOSED)\n\t\t{\n\t\t\tthis.showMap();\n\t\t}\n\t}\n\n\tdestroy()\n\t{\n\t\tif (this.#isDestroyed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.removeEventListener('click', this.#onDocumentClick);\n\n\t\tif (this.addressWidget.controlWrapper)\n\t\t{\n\t\t\tthis.addressWidget.controlWrapper.removeEventListener('click', this.#onControlWrapperClick);\n\t\t\tthis.addressWidget.controlWrapper.removeEventListener('mouseover', this.#processOnMouseOver);\n\t\t\tthis.addressWidget.controlWrapper.removeEventListener('mouseout', this.#processOnMouseOut);\n\t\t}\n\n\t\tthis.#showMapTimerId = null;\n\t\tthis.#closeMapTimerId = null;\n\n\t\tsuper.destroy();\n\t\tthis.#isDestroyed = true;\n\t}\n}\n","import {\n\tLocationRepository,\n\tSourceCreationError,\n\tFormat,\n\tLocation,\n} from 'location.core';\nimport { Google } from 'location.google';\nimport Address from './address/address';\nimport Autocomplete from './autocomplete/autocomplete';\nimport { Factory as SourceFactory } from 'location.source';\nimport MapPopup from './mappopup/mappopup';\nimport Gallery from './mappopup/gallery';\nimport Popup from './mappopup/popup';\nimport Fields from './fields/fields';\nimport MapFeature from './address/features/mapfeature';\nimport AutocompleteFeature from './address/features/autocompletefeature';\nimport FieldsFeature from './address/features/fieldsfeature';\nimport MapFeatureAuto from './address/features/mapfeatureauto';\n\n/**\n * Props type for the main fabric method\n */\nexport type FactoryCreateAddressWidgetProps = {\n\t// Initial Address\n\taddress?: Address,\n\t// Initial widget mode\n\tmode: 'edit' | 'view',\n\n\t// optional\n\tlanguageId?: string,\n\taddressFormat?: Format,\n\tsourceCode?: string,\n\tsourceParams?: {},\n\n\t// Witch features will be used?\n\tuseFeatures?: {\n\t\tfields?: boolean, \t\t// default true\n\t\tmap?: boolean, \t\t\t// default true\n\t\tautocomplete?: boolean\t// default true\n\t},\n\n\t// Useful for the using with map feature only\n\t// Address photo height if photo exists\n\tthumbnailHeight: number,\n\t// Address photo width if photo exists\n\tthumbnailWidth: number,\n\t// Max photo thumbnails count\n\tmaxPhotoCount: number,\n\t/*\n\t * auto - open / close map feature depends on user's input\n\t * manual - allow to control open / close map\n\t */\n\tmapBehavior: 'auto' | 'manual',\n\tpopupOptions?: {},\n\tpopupBindOptions: {\n\t\tforceBindPosition?: boolean,\n\t\tforceLeft?: boolean,\n\t\tforceTop?: boolean,\n\t\tposition?: 'right' | 'top' | 'bootom'\n\t},\n\tpresetLocationsProvider?: Function,\n\tpresetLocationList?: []\n};\n\n/**\n * Factory class with a set of tools for the address widget creation\n */\nexport default class Factory\n{\n\t/**\n\t * Main factory method\n\t * @param {FactoryCreateAddressWidgetProps} props\n\t * @returns {Address}\n\t */\n\tcreateAddressWidget(props: FactoryCreateAddressWidgetProps): Address\n\t{\n\t\tconst sourceCode = props.sourceCode || BX.message('LOCATION_WIDGET_SOURCE_CODE');\n\t\tconst sourceParams = props.sourceParams || BX.message('LOCATION_WIDGET_SOURCE_PARAMS');\n\t\tconst languageId = props.languageId || BX.message('LOCATION_WIDGET_LANGUAGE_ID');\n\t\tconst sourceLanguageId = props.sourceLanguageId || BX.message('LOCATION_WIDGET_SOURCE_LANGUAGE_ID');\n\t\tconst userLocationPoint = new Location(JSON.parse(BX.message('LOCATION_WIDGET_USER_LOCATION_POINT')));\n\n\t\tconst addressFormat = props.addressFormat || new Format(\n\t\t\tJSON.parse(\n\t\t\t\tBX.message('LOCATION_WIDGET_DEFAULT_FORMAT')\n\t\t\t));\n\n\t\tconst presetLocationsProvider = props.presetLocationsProvider\n\t\t\t? props.presetLocationsProvider\n\t\t\t: () => {\n\t\t\t\treturn props.presetLocationList ? props.presetLocationList : [];\n\t\t\t};\n\n\t\tconst features = [];\n\n\t\tif(!props.useFeatures || props.useFeatures.fields !== false)\n\t\t{\n\t\t\tfeatures.push(\n\t\t\t\tthis.createFieldsFeature({addressFormat, languageId})\n\t\t\t);\n\t\t}\n\n\t\tlet source = null;\n\n\t\tif(sourceCode && sourceParams)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tsource = SourceFactory.create(sourceCode, languageId, sourceLanguageId, sourceParams)\n\t\t\t}\n\t\t\tcatch (e)\n\t\t\t{\n\t\t\t\tif(e instanceof SourceCreationError)\n\t\t\t\t{\n\t\t\t\t\tsource = null;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet mapFeature = null;\n\t\tif(source)\n\t\t{\n\t\t\tif(!props.useFeatures || props.useFeatures.autocomplete !== false)\n\t\t\t{\n\t\t\t\tfeatures.push(\n\t\t\t\t\tthis.createAutocompleteFeature({\n\t\t\t\t\t\tlanguageId,\n\t\t\t\t\t\taddressFormat,\n\t\t\t\t\t\tsource,\n\t\t\t\t\t\tuserLocationPoint: userLocationPoint,\n\t\t\t\t\t\tpresetLocationsProvider\n\t\t\t\t\t}));\n\t\t\t}\n\n\t\t\tif(!props.useFeatures || props.useFeatures.map !== false)\n\t\t\t{\n\t\t\t\tconst showPhotos = !!sourceParams.showPhotos;\n\t\t\t\tconst useGeocodingService = !!sourceParams.useGeocodingService;\n\t\t\t\tconst DEFAULT_THUMBNAIL_HEIGHT = 80;\n\t\t\t\tconst DEFAULT_THUMBNAIL_WIDTH = 150;\n\t\t\t\tconst DEFAULT_MAX_PHOTO_COUNT = showPhotos ? 5 : 0;\n\t\t\t\tconst DEFAULT_MAP_BEHAVIOR = 'auto';\n\n\t\t\t\tmapFeature = this.createMapFeature({\n\t\t\t\t\taddressFormat,\n\t\t\t\t\tsource,\n\t\t\t\t\tuseGeocodingService,\n\t\t\t\t\tpopupOptions: props.popupOptions,\n\t\t\t\t\tpopupBindOptions: props.popupBindOptions,\n\t\t\t\t\tthumbnailHeight: props.thumbnailHeight || DEFAULT_THUMBNAIL_HEIGHT,\n\t\t\t\t\tthumbnailWidth: props.thumbnailWidth || DEFAULT_THUMBNAIL_WIDTH,\n\t\t\t\t\tmaxPhotoCount: props.maxPhotoCount || DEFAULT_MAX_PHOTO_COUNT,\n\t\t\t\t\tmapBehavior: props.mapBehavior || DEFAULT_MAP_BEHAVIOR,\n\t\t\t\t\tuserLocationPoint: userLocationPoint\n\t\t\t\t});\n\n\t\t\t\tfeatures.push(mapFeature);\n\t\t\t}\n\t\t}\n\n\t\tconst widget = new Address({\n\t\t\tfeatures,\n\t\t\taddress: props.address,\n\t\t\tmode: props.mode,\n\t\t\taddressFormat,\n\t\t\tlanguageId,\n\t\t});\n\n\t\tif(mapFeature)\n\t\t{\n\t\t\twidget.subscribeOnFeatureEvent((event) => {\n\t\t\t\tconst data = event.getData();\n\n\t\t\t\tif(data.feature instanceof AutocompleteFeature\n\t\t\t\t\t&& data.eventCode === AutocompleteFeature.showOnMapClickedEvent\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\tmapFeature.showMap(true);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn widget;\n\t}\n\n\tcreateFieldsFeature(props: {}): FieldsFeature\n\t{\n\t\tconst fields = new Fields({\n\t\t\taddressFormat: props.addressFormat,\n\t\t\tlanguageId: props.languageId,\n\t\t});\n\n\t\treturn new FieldsFeature({\n\t\t\tfields\n\t\t});\n\t}\n\n\tcreateAutocompleteFeature(props: {}): AutocompleteFeature\n\t{\n\t\tconst autocomplete = new Autocomplete({\n\t\t\tsourceCode: props.source.sourceCode,\n\t\t\tlanguageId: props.languageId,\n\t\t\taddressFormat: props.addressFormat,\n\t\t\tautocompleteService: props.source.autocompleteService,\n\t\t\tuserLocationPoint: props.userLocationPoint,\n\t\t\tpresetLocationsProvider: props.presetLocationsProvider,\n\t\t});\n\n\t\treturn new AutocompleteFeature({\n\t\t\tautocomplete\n\t\t});\n\t}\n\n\tcreateMapFeature(props: {}): MapFeature\n\t{\n\t\tlet popupOptions = {\n\t\t\tcacheable: true,\n\t\t\tcloseByEsc: true,\n\t\t\tclassName: `location-popup-window location-source-${props.source.sourceCode}`,\n\t\t\tanimation: 'fading',\n\t\t\tangle: true,\n\t\t\tbindOptions: props.popupBindOptions\n\t\t};\n\t\tif(props.popupOptions)\n\t\t{\n\t\t\tpopupOptions = Object.assign(popupOptions, props.popupOptions);\n\t\t}\n\t\tconst popup = new Popup(popupOptions);\n\n\t\tlet gallery = null;\n\n\t\tif(props.maxPhotoCount > 0)\n\t\t{\n\t\t\tgallery = new Gallery({\n\t\t\t\tphotoService: props.source.photoService,\n\t\t\t\tthumbnailHeight: props.thumbnailHeight,\n\t\t\t\tthumbnailWidth: props.thumbnailWidth,\n\t\t\t\tmaxPhotoCount: props.maxPhotoCount\n\t\t\t});\n\t\t}\n\n\t\tconst mapFeatureProps = {\n\t\t\tsaveResourceStrategy: props.source.sourceCode === Google.code,\n\t\t\tmap: new MapPopup({\n\t\t\t\taddressFormat: props.addressFormat,\n\t\t\t\tmap: props.source.map,\n\t\t\t\tpopup: popup,\n\t\t\t\tgallery: gallery,\n\t\t\t\tlocationRepository: new LocationRepository(),\n\t\t\t\tgeocodingService: props.useGeocodingService ? props.source.geocodingService : null,\n\t\t\t\tuserLocationPoint: props.userLocationPoint\n\t\t\t})\n\t\t};\n\n\t\tlet result;\n\n\t\tif(props.mapBehavior === 'manual')\n\t\t{\n\t\t\tresult = new MapFeature(mapFeatureProps);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresult = new MapFeatureAuto(mapFeatureProps);\n\t\t}\n\n\t\treturn result;\n\t}\n}\n","import {EventEmitter} from \"main.core.events\";\nimport {Tag} from \"main.core\";\n\nexport default class Switch extends EventEmitter\n{\n\tstatic STATE_OFF = 0;\n\tstatic STATE_ON = 1;\n\n\tstatic #onToggleEvent = \"onToggleEvent\";\n\n\t#state;\n\t#titleContainer;\n\t#titles = ['on', 'off'];\n\n\tconstructor(props = {})\n\t{\n\t\tsuper();\n\t\tthis.setEventNamespace('BX.Location.Widget.Switch');\n\t\tthis.#state = props.state;\n\t\tthis.#titles = props.titles;\n\t}\n\n\tset state(state: string)\n\t{\n\t\tthis.#state = state;\n\n\t\tif(this.#titleContainer)\n\t\t{\n\t\t\tthis.#titleContainer.innerHTML = this.#getTitle();\n\t\t}\n\t}\n\n\tget state(): string\n\t{\n\t\treturn this.#state;\n\t}\n\n\t#getTitle()\n\t{\n\t\treturn this.#titles[this.#state];\n\t}\n\n\trender(mode: number)\n\t{\n\t\tthis.#titleContainer = Tag.render`\t\t\t\n\t\t\t<span class=\"ui-link ui-link-secondary ui-entity-editor-block-title-link\">\n\t\t\t\t${this.#getTitle()}\n\t\t\t</span>`;\n\n\t\tthis.#titleContainer.addEventListener(\n\t\t\t'click',\n\t\t\t(event) => {\n\t\t\t\tthis.state = this.#state === Switch.STATE_OFF ? Switch.STATE_ON : Switch.STATE_OFF;\n\t\t\t\tthis.emit(Switch.#onToggleEvent, {state: this.#state});\n\t\t\t\tevent.stopPropagation();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t);\n\n\t\tthis.#titleContainer.addEventListener(\n\t\t\t'mouseover',\n\t\t\t(event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t);\n\n\t\treturn this.#titleContainer;\n\t}\n\n\tsubscribeOnToggleEventSubscribe(listener: Function): void\n\t{\n\t\tthis.subscribe(Switch.#onToggleEvent, listener);\n\t}\n}\n","import {EventEmitter} from \"main.core.events\";\nimport {Tag} from \"main.core\";\n\nexport default class Icon extends EventEmitter\n{\n\tstatic #onClickEvent = 'onClick';\n\n\tstatic TYPE_CLEAR = 'clear';\n\tstatic TYPE_SEARCH = 'search';\n\tstatic TYPE_LOADER = 'loader';\n\n\t#type = Icon.TYPE_SEARCH;\n\t#domNode;\n\n\tconstructor()\n\t{\n\t\tsuper();\n\t\tthis.setEventNamespace('BX.Location.Widget.Icon');\n\t}\n\n\tset type(type: string): void\n\t{\n\t\tthis.#type = type;\n\n\t\tif(this.#domNode)\n\t\t{\n\t\t\tthis.#domNode.className = this.#getClassByType(this.#type);\n\t\t}\n\t}\n\n\t#getClassByType(iconType: string): void\n\t{\n\t\tlet iconClass = '';\n\n\t\tif(iconType === Icon.TYPE_CLEAR)\n\t\t{\n\t\t\ticonClass = \"ui-ctl-after ui-ctl-icon-btn ui-ctl-icon-clear\";\n\t\t}\n\t\telse if(iconType === Icon.TYPE_SEARCH)\n\t\t{\n\t\t\ticonClass = \"ui-ctl-after ui-ctl-icon-search\";\n\t\t}\n\t\telse if(iconType === Icon.TYPE_LOADER)\n\t\t{\n\t\t\ticonClass = \"ui-ctl-after ui-ctl-icon-loader\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tBX.debug('Wrong icon type');\n\t\t}\n\n\t\treturn iconClass;\n\t}\n\n\trender(props)\n\t{\n\t\tthis.#type = props.type;\n\t\tthis.#domNode = Tag.render`<div class=\"${this.#getClassByType(this.#type)}\"></div>`;\n\n\t\tthis.#domNode.addEventListener(\n\t\t\t'click',\n\t\t\t(e) => {\n\t\t\t\tthis.emit(Icon.#onClickEvent);\n\t\t\t}\n\t\t);\n\n\t\treturn this.#domNode;\n\t}\n\n\tsubscribeOnClickEvent(listener: Function): void\n\t{\n\t\tthis.subscribe(Icon.#onClickEvent, listener);\n\t}\n}","import {Type, Tag, Dom} from 'main.core';\nimport {Address, ControlMode, ErrorPublisher} from 'location.core';\nimport {BaseEvent} from 'main.core.events';\nimport './css/ui-address.css';\nimport {State as WidgetState} from 'location.widget';\nimport Factory from '../factory';\nimport Switch from './switch';\nimport Icon from './icon';\n\n/**\n * Address field widget for the ui.entity-editor\n */\nexport default class UIAddress extends BX.UI.EntityEditorField\n{\n\tconstructor(props)\n\t{\n\t\tsuper(props);\n\n\t\tthis._input = null;\n\t\tthis._inputIcon = null;\n\t\tthis._hiddenInput = null;\n\t\tthis._innerWrapper = null;\n\t\tthis._addressWidget = null;\n\t\tthis._addressFieldsContainer = null;\n\t}\n\n\tstatic create(id, settings)\n\t{\n\t\tconst self = new UIAddress();\n\t\tself.initialize(id, settings);\n\t\treturn self;\n\t}\n\n\tinitialize(id, settings)\n\t{\n\t\tsuper.initialize(id, settings);\n\n\t\tconst value = this.getValue();\n\t\tlet address = null;\n\n\t\tif(Type.isStringFilled(value))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\taddress = new Address(JSON.parse(value));\n\t\t\t}\n\t\t\tcatch (e)\n\t\t\t{\n\t\t\t\tBX.debug('Cant parse address value');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\tconst widgetFactory = new Factory();\n\n\t\tthis._addressWidget = widgetFactory.createAddressWidget({\n\t\t\taddress: address,\n\t\t\tmode: this._mode === BX.UI.EntityEditorMode.edit ? ControlMode.edit : ControlMode.view,\n\t\t\tpopupBindOptions: {\n\t\t\t\tposition: 'right'\n\t\t\t}\n\t\t});\n\n\t\tthis._addressWidget.subscribeOnStateChangedEvent(this.#onAddressWidgetChangedState.bind(this));\n\t\tthis._addressWidget.subscribeOnAddressChangedEvent(this.#onAddressChanged.bind(this));\n\n\t\tthis._fieldsSwitch = new Switch({\n\t\t\tstate: Switch.STATE_OFF,\n\t\t\ttitles: [\n\t\t\t\tBX.message('LOCATION_WIDGET_AUI_MORE'),\n\t\t\t\tBX.message('LOCATION_WIDGET_AUI_BRIEFLY')\n\t\t\t]\n\t\t});\n\t\tthis._fieldsSwitch.subscribeOnToggleEventSubscribe(this.#onFieldsSwitchToggle.bind(this));\n\t}\n\n\t#onIconClick()\n\t{\n\t\tif(this._input.value !== '')\n\t\t{\n\t\t\tthis._input.value = '';\n\t\t\tthis._addressWidget.address = null;\n\t\t\tthis._inputIcon.type = Icon.TYPE_SEARCH;\n\t\t}\n\n\t\tif(this.hasError())\n\t\t{\n\t\t\tthis.clearError();\n\t\t}\n\t}\n\n\t#onFieldsSwitchToggle(event)\n\t{\n\t\tconst data = event.getData();\n\t\tconst state = data.state;\n\n\t\tif(state === Switch.STATE_OFF)\n\t\t{\n\t\t\tthis.#hideFields();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.#showFields();\n\t\t}\n\n\t\tthis._addressWidget.resetView();\n\t}\n\n\tfocus()\n\t{\n\t\tif(!this._input)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tBX.focus(this._input);\n\t\tBX.UI.EditorTextHelper.getCurrent().setPositionAtEnd(this._input);\n\t}\n\n\t#hideFields()\n\t{\n\t\tif(this._addressFieldsContainer)\n\t\t{\n\t\t\tthis._addressFieldsContainer.classList.remove('visible');\n\t\t}\n\t}\n\n\t#showFields()\n\t{\n\t\tif(this._addressFieldsContainer)\n\t\t{\n\t\t\tthis._addressFieldsContainer.classList.add('visible');\n\t\t}\n\t}\n\n\t#onAddressWidgetChangedState(event)\n\t{\n\t\tconst data = event.getData();\n\t\tconst state = data.state;\n\t\tlet iconType;\n\n\t\tif(data.state === WidgetState.DATA_LOADING)\n\t\t{\n\t\t\ticonType = Icon.TYPE_LOADER;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(data.state === WidgetState.DATA_INPUTTING)\n\t\t\t{\n\t\t\t\tthis.markAsChanged();\n\t\t\t}\n\n\t\t\ticonType = UIAddress.#chooseInputIconTypeByAddress(this.#getAddress());\n\t\t}\n\n\n\t\tthis._inputIcon.type = iconType;\n\t}\n\n\tgetModeSwitchType(mode)\n\t{\n\t\tlet result = BX.UI.EntityEditorModeSwitchType.common;\n\n\t\tif(mode === BX.UI.EntityEditorMode.edit)\n\t\t{\n\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\tresult |= BX.UI.EntityEditorModeSwitchType.button | BX.UI.EntityEditorModeSwitchType.content;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tdoSetMode(mode)\n\t{\n\t\tthis._addressWidget.mode = mode === BX.UI.EntityEditorMode.edit ? ControlMode.edit : ControlMode.view;\n\t\tthis._fieldsSwitch.state = Switch.STATE_OFF;\n\t}\n\n\tgetContentWrapper()\n\t{\n\t\treturn this._innerWrapper;\n\t}\n\n\t#onAddressChanged(event: BaseEvent): void\n\t{\n\t\tconst data = event.getData();\n\t\tconst address = data.address;\n\n\t\tif(this._hiddenInput)\n\t\t{\n\t\t\tthis._hiddenInput.value = address ? address.toJson() : '';\n\t\t\tthis.markAsChanged();\n\t\t}\n\n\t\tif(this._inputIcon)\n\t\t{\n\t\t\tthis._inputIcon.type = UIAddress.#chooseInputIconTypeByAddress(address);\n\t\t}\n\t}\n\n\tsave()\n\t{\n\t\tif(!this.isEditable())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tconst address = this.#getAddress();\n\n\t\tthis._model.setField(\n\t\t\tthis.getName(),\n\t\t\taddress ? address.toJson() : ''\n\t\t);\n\n\t\tthis._addressWidget.resetView();\n\t}\n\n\tshowError(error, anchor)\n\t{\n\t\tsuper.showError.apply(this, [error, anchor]);\n\n\t\tif(this._input)\n\t\t{\n\t\t\tBX.addClass(this._inputContainer, 'ui-ctl-danger');\n\t\t}\n\t}\n\n\tclearError()\n\t{\n\t\tsuper.clearError.apply(this);\n\n\t\tif(this._input)\n\t\t{\n\t\t\tBX.removeClass(this._inputContainer, 'ui-ctl-danger');\n\t\t}\n\t}\n\n\tdoClearLayout(options)\n\t{\n\t\tthis._input = null;\n\t\tthis._innerWrapper = null;\n\t\tthis._inputContainer = null;\n\t\tthis._addressFieldsContainer = null;\n\t\tthis._inputIcon = null;\n\t\tthis._hiddenInput = null;\n\t\tDom.clean(this._innerWrapper);\n\t}\n\n\tvalidate(result)\n\t{\n\t\tif(!(this._mode === BX.UI.EntityEditorMode.edit && this._input))\n\t\t{\n\t\t\tthrow Error('BX.Location.UIAddress. Invalid validation context');\n\t\t}\n\n\t\tthis.clearError();\n\n\t\tif(this.hasValidators())\n\t\t{\n\t\t\treturn this.executeValidators(result);\n\t\t}\n\n\t\tconst isValid = !this.isRequired() || BX.util.trim(this._input.value) !== '';\n\n\t\tif(!isValid)\n\t\t{\n\t\t\tresult.addError(BX.UI.EntityValidationError.create({field: this}));\n\t\t\tthis.showRequiredFieldError(this._input);\n\t\t}\n\t\treturn isValid;\n\t}\n\n\tgetRuntimeValue()\n\t{\n\t\treturn (this._mode === BX.UI.EntityEditorMode.edit\n\t\t\t? this.#getAddress() : null\n\t\t);\n\t}\n\n\tstatic #chooseInputIconTypeByAddress(address: ?Address): string\n\t{\n\t\treturn address ? Icon.TYPE_CLEAR : Icon.TYPE_SEARCH;\n\t};\n\n\t#convertAddressToString(address: ?Address): string\n\t{\n\t\tif(!address)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\treturn address.toString(this._addressWidget.addressFormat);\n\t}\n\n\t#getAddress(): Address\n\t{\n\t\treturn this._addressWidget.address;\n\t}\n\n\tlayout(options): void\n\t{\n\t\tif(this._hasLayout)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tthis.ensureWrapperCreated({classNames: ['ui-entity-card-content-block-field-phone']});\n\t\tthis.adjustWrapper();\n\n\t\tconst title = this.getTitle();\n\n\t\tif(this.isDragEnabled())\n\t\t{\n\t\t\tthis._wrapper.appendChild(this.createDragButton());\n\t\t}\n\n\t\tconst addressWidgetParams = {};\n\n\t\tif(this._mode === BX.UI.EntityEditorMode.edit)\n\t\t{\n\t\t\tthis._wrapper.appendChild(this.createTitleNode(title));\n\t\t\tthis._input = Tag.render`<input class=\"ui-ctl-element ui-ctl-textbox\" value=\"\" type=\"text\" autocomplete=\"off\" name=\"${`${this.getName()}_STRING`}\">`;\n\t\t\tthis._hiddenInput = Tag.render`<input value='${this.getValue()}' type=\"hidden\" name=\"${this.getName()}\">`;\n\t\t\tthis._inputIcon = new Icon();\n\t\t\tthis._inputIcon.subscribeOnClickEvent(this.#onIconClick.bind(this));\n\t\t\tconst inputIconNode = this._inputIcon.render({\n\t\t\t\ttype: UIAddress.#chooseInputIconTypeByAddress(this.#getAddress())\n\t\t\t});\n\n\t\t\tthis._inputContainer = Tag.render`<div class=\"ui-ctl ui-ctl-w100 ui-ctl-after-icon\">${inputIconNode}${this._input}${this._hiddenInput}</div>`;\n\t\t\tthis._titleWrapper.appendChild(Tag.render`${this._fieldsSwitch.render(this._mode)}`);\n\n\t\t\tthis._innerWrapper = Tag.render`\t\t\t\t\t\t    \n\t\t\t\t<div class=\"location-search-control-block\">\t\t\t\t\t\n\t\t\t\t\t${this._inputContainer}\n\t\t\t\t</div>`;\n\n\t\t\taddressWidgetParams.inputNode = this._input;\n\t\t\taddressWidgetParams.mapBindElement = inputIconNode;\n\n\t\t\tthis._addressFieldsContainer = Tag.render`<div class=\"location-fields-control-block\"></div>`;\n\n\t\t\tif(this._fieldsSwitch.state === Switch.STATE_ON)\n\t\t\t{\n\t\t\t\tthis._addressFieldsContainer.classList.add('visible');\n\t\t\t}\n\n\t\t\taddressWidgetParams.fieldsContainer = this._addressFieldsContainer;\n\t\t\tthis._innerWrapper.appendChild(this._addressFieldsContainer);\n\t\t}\n\t\telse// if(this._mode === BX.UI.EntityEditorMode.view)\n\t\t{\n\t\t\tthis._wrapper.appendChild(this.createTitleNode(title));\n\t\t\tlet addressStringNode;\n\n\t\t\tif(this.hasContentToDisplay())\n\t\t\t{\n\t\t\t\tconst addressString = this.#convertAddressToString(this.#getAddress());\n\t\t\t\taddressStringNode = Tag.render`<span class=\"ui-link ui-link-dark ui-link-dotted\">${addressString}</span>`;\n\n\t\t\t\tthis._innerWrapper = Tag.render`\n\t\t\t\t\t<div class=\"location-search-control-block\">\n\t\t\t\t\t\t<div class=\"ui-entity-editor-content-block-text\">\n\t\t\t\t\t\t\t${addressStringNode}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>`;\n\n\t\t\t\taddressWidgetParams.mapBindElement = addressStringNode;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._innerWrapper = Tag.render`<div class=\"location-search-control-block\">\n\t\t\t\t\t${BX.message('UI_ENTITY_EDITOR_FIELD_EMPTY')}\n\t\t\t\t</div>`;\n\n\t\t\t\taddressWidgetParams.mapBindElement = this._innerWrapper;\n\t\t\t}\n\t\t}\n\n\t\taddressWidgetParams.controlWrapper = this._innerWrapper;\n\t\tthis._addressWidget.render(addressWidgetParams);\n\t\tthis._wrapper.appendChild(this._innerWrapper);\n\n\t\tthis._addressWidget.subscribeOnErrorEvent(this.errorListener.bind(this));\n\n\t\tif(this.isContextMenuEnabled())\n\t\t{\n\t\t\tthis._wrapper.appendChild(this.createContextMenuButton());\n\t\t}\n\n\t\tif(this.isDragEnabled())\n\t\t{\n\t\t\tthis.initializeDragDropAbilities();\n\t\t}\n\n\t\tthis.registerLayout(options);\n\t\tthis._hasLayout = true;\n\t}\n\n\terrorListener(event: BaseEvent)\n\t{\n\t\tconst data = event.getData();\n\t\tconst errors = data.errors;\n\n\t\tif(this._inputIcon)\n\t\t{\n\t\t\tthis._inputIcon.type = Icon.TYPE_CLEAR;\n\t\t}\n\n\t\tif(!Type.isArray(errors))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// todo: this.showError supports only one error\n\t\terrors.forEach((error) => {\n\t\t\tlet message;\n\n\t\t\tif(error.message)\n\t\t\t{\n\t\t\t\tmessage = error.message;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmessage = BX.message('LOCATION_WIDGET_AUI_UNKNOWN_ERROR');\n\t\t\t}\n\n\t\t\tif(error.code)\n\t\t\t{\n\t\t\t\tmessage += ` [${error.code}]`;\n\t\t\t}\n\n\t\t\tthis.showError(message);\n\t\t});\n\t}\n\n\tprocessModelChange(params)\n\t{\n\t\tif(BX.prop.get(params, 'originator', null) === this)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif(!BX.prop.getBoolean(params, 'forAll', false)\n\t\t\t&& BX.prop.getString(params, 'name', '') !== this.getName()\n\t\t)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tthis.refreshLayout();\n\t}\n\n\tstatic registerField(): void\n\t{\n\t\tif(typeof BX.UI.EntityEditorControlFactory !== 'undefined')\n\t\t{\n\t\t\tBX.UI.EntityEditorControlFactory.registerFactoryMethod('address', UIAddress.registerFieldMethod);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tBX.addCustomEvent('BX.UI.EntityEditorControlFactory:onInitialize', (params, eventArgs) =>\n\t\t\t{\n\t\t\t\teventArgs.methods.address = UIAddress.registerFieldMethod;\n\t\t\t});\n\t\t}\n\t}\n\n\tstatic registerFieldMethod(type, controlId, settings): ?UIAddress\n\t{\n\t\tlet result = null;\n\n\t\tif(type === 'address')\n\t\t{\n\t\t\tresult = UIAddress.create(controlId, settings);\n\t\t}\n\n\t\treturn result;\n\t}\n}\n","import Address from './address/address';\nimport Factory from './factory';\nimport UIAddress from './ui-address/ui-address';\nimport State from './state';\nimport BaseFeature from './address/features/basefeature';\nimport MapFeature from './address/features/mapfeature';\nimport AutocompleteFeature from './address/features/autocompletefeature';\nimport FieldsFeature from './address/features/fieldsfeature';\n\n/* A set of widgets for using to deal with addresses */\nexport {\n\n\t// Main Widget\n\tAddress,\n\n\t// Widget features\n\tBaseFeature,\n\n\tMapFeature,\n\tAutocompleteFeature,\n\tFieldsFeature,\n\n\t// Widget factory\n\tFactory,\n\n\t// Possible widget states\n\tState,\n\n\t/* Address field for the ui.forms.\n\t * This can be used as an example of the widget implementation\n\t */\n\tUIAddress,\n};\n\n// Register fields for ui.entity-editor\nUIAddress.registerField();\n"],"names":["State","AddressString","props","addressFormat","Format","Error","address","addresStr","Tag","render","hide","style","display","innerHTML","isHidden","show","result","AddressStringConverter","convertAddressToStringTemplate","getTemplate","FormatTemplateType","DEFAULT","CONTENT_TYPE_HTML","Vue","extend","required","methods","handleApplyClick","$emit","convertAddressToString","toString","STRATEGY_TYPE_TEMPLATE_COMMA","computed","addressString","CONTENT_TYPE_TEXT","containerStyles","containerClasses","hidden","localize","getFilteredPhrases","template","Popup","_classPrivateMethodInitSpec","bindElement","bindOptions","isCustomPosition","isCustomPositionSuccess","position","MainPopup","bindElRect","getBoundingClientRect","popupHeight","getPopupContainer","offsetHeight","popupWidth","offsetWidth","left","width","document","documentElement","clientWidth","angleOffsetY","top","window","pageYOffset","height","body","clientHeight","setAngle","offset","Dom","adjust","popupContainer","zIndex","getZindex","MapPopup","_classPrivateFieldInitSpec","setEventNamespace","map","MapBase","BX","debug","geocodingService","GeocodingServiceBase","onLocationChangedEventSubscribe","_classPrivateMethodGet","bind","popup","gallery","locationRepository","userLocationPoint","mode","useUserLocation","then","location","emit","onMapShow","isShown","close","$props","listener","subscribe","destroy","remove","Event","unbindAll","getBindElement","Type","isDomNode","setBindElement","EventEmitter","AddressApplier","propsData","$mount","$on","event","prevAddress","data","getData","toAddress","fieldCollection","isEqual","LocationType","ADDRESS_LINE_1","latitude","longitude","mapInnerContainer","thirdPartyWarningNode","Loc","getMessage","ControlMode","edit","$el","e","stopPropagation","setContent","lat","lon","Promise","resolve","view","Location","latLon","type","getType","mapContainer","BaseFeature","_saveResourceStrategy","saveResourceStrategy","MethodNotImplemented","addressWidget","Address","AddressEntity","isValid","isString","languageId","TypeError","features","isArray","forEach","feature","isBoolean","needWarmBackendAfterAddressChanged","LocationRepository","INITIAL","sourceFeature","excludeFeatures","options","addressId","id","getFieldValue","AddressType","isTemplateExists","setFieldValue","storeAsLastAddress","hasOwnProperty","DATA_INPUTTING","featureEvent","onFeatureEvent","code","resetView","controlWrapper","inputNode","onInputKeyup","onInputInput","state","onStateChangedEvent","onAddressChangedEvent","ErrorPublisher","getInstance","unbind","setAddressWidget","push","method","params","isExcluded","excludeFeature","apply","findParents","value","length","setCaretPosition","templateType","console","error","shortAddressString","AUTOCOMPLETE","fullAddressString","trim","title","selectionStart","selectionEnd","setSelectionRange","fieldForUnRecognized","isFieldExists","LOCALITY","Storage","lastAddress","splice","MenuBottom","node","firstChild","removeChild","appendChild","Menu","elRect","popupWindow","setMaxWidth","layout","menuContainer","menuItems","choseItemIdx","getPopupWindow","isDestroyed","index","isItemChosen","isItemExist","isMenuEmpty","isChoseLastItem","chooseItem","getChosenItem","isChoseFirstItem","item","classList","add","idx","unHighlightItem","highlightItem","removeMenuItem","setRightItemNode","setLeftItemNode","MainMenu","Prompt","menuNode","locationsList","searchPhrase","setMenuItems","getMenu","clearItems","Array","slice","showFlatList","addMenuItem","isSeparatorSet","html","delimiter","isRecursive","choosePrevItem","chooseNextItem","menuItem","locationName","clarification","TMP_TYPE_CLARIFICATION","TMP_TYPE_HINT","autoHide","closeByEsc","className","includes","ADM_LEVEL_1","name","createMenuItemText","onclick","onItemSelectedEvent","undefined","input","HTMLInputElement","setValueFromAddress","isPureAddress","setValue","indexOf","Autocomplete","requested","current","dropped","autocompleteService","AutocompleteServiceBase","sourceCode","presetLocationsProvider","addEventListener","removeEventListener","presetLocationList","leftBottomMenuMessage","element","text","leftBottomText","setBottomRightItemNode","setBottomLeftItemNode","relatedTarget","getAttribute","DATA_SUPPOSED","isChanged","hasPureAddressString","customTail","currentValue","newValue","stopImmediatePropagation","COUNTRY","ADDRESS_LINE_2","setTimeout","hasExternalRelation","showPrompt","biasPoint","Point","target","externalId","closePrompt","DATA_SELECTED","detailedLocation","addressLine2","response","notify","errors","excludeSetAddressFeatures","DATA_LOADING","findByExternalId","DATA_LOADED","ctrlKey","metaKey","shiftKey","key","onLocationSelectTimeout","actualize","timeout","clearTimeout","autocomplete","Photo","url","link","description","Gallery","thumbnailHeight","thumbnailWidth","maxPhotoCount","photoService","requestPhotos","photosData","refresh","photos","photo","thumbnail","util","strip_tags","renderedPhotos","Field","sort","container","Text","encode","Fields","field","clean","fields","formatField","subscribeOnValueChangedEvent","subscribeOnStateChangedEvent","a","b","changedField","MapFeature","onChangedEventSubscribe","setAddressByFeature","bindelement","closeMap","mapBindElement","AutocompleteFeature","onAddressChangedEventSubscribe","onStateChangedEventSubscribe","setStateByFeature","onSearchStartedEventSubscribe","emitFeatureEvent","eventCode","searchStartedEvent","payload","onSearchCompletedEventSubscribe","searchCompletedEvent","onShowOnMapClickedEventSubscribe","showOnMapClickedEvent","autocompleteMenuElement","FieldsFeature","subscribeOnAddressChangedEvent","fieldsContainer","MapFeatureAuto","onMouseOverSubscribe","onMouseOutSubscribe","showMap","Factory","message","sourceParams","sourceLanguageId","JSON","parse","useFeatures","createFieldsFeature","source","SourceFactory","create","SourceCreationError","mapFeature","createAutocompleteFeature","showPhotos","useGeocodingService","DEFAULT_THUMBNAIL_HEIGHT","DEFAULT_THUMBNAIL_WIDTH","DEFAULT_MAX_PHOTO_COUNT","DEFAULT_MAP_BEHAVIOR","createMapFeature","popupOptions","popupBindOptions","mapBehavior","widget","subscribeOnFeatureEvent","cacheable","animation","angle","Object","assign","mapFeatureProps","Google","Switch","titles","STATE_OFF","STATE_ON","Icon","TYPE_SEARCH","iconType","iconClass","TYPE_CLEAR","TYPE_LOADER","UIAddress","_input","_inputIcon","_hiddenInput","_innerWrapper","_addressWidget","_addressFieldsContainer","settings","getValue","isStringFilled","widgetFactory","createAddressWidget","_mode","UI","EntityEditorMode","_fieldsSwitch","subscribeOnToggleEventSubscribe","focus","EditorTextHelper","getCurrent","setPositionAtEnd","EntityEditorModeSwitchType","common","button","content","isEditable","_model","setField","getName","toJson","anchor","addClass","_inputContainer","removeClass","clearError","hasValidators","executeValidators","isRequired","addError","EntityValidationError","showRequiredFieldError","_hasLayout","ensureWrapperCreated","classNames","adjustWrapper","getTitle","isDragEnabled","_wrapper","createDragButton","addressWidgetParams","createTitleNode","subscribeOnClickEvent","inputIconNode","_titleWrapper","addressStringNode","hasContentToDisplay","subscribeOnErrorEvent","errorListener","isContextMenuEnabled","createContextMenuButton","initializeDragDropAbilities","registerLayout","showError","prop","get","getBoolean","getString","refreshLayout","self","initialize","EntityEditorControlFactory","registerFactoryMethod","registerFieldMethod","addCustomEvent","eventArgs","controlId","EntityEditorField","hasError","WidgetState","markAsChanged","registerField"],"mappings":";;;;;CAAA;CACA;CACA;AAFA,KAGqBA,KAAK;GAAA;CAAA;CAAA,4BAALA,KAAK,aAER,SAAS;CAAA,4BAFNA,KAAK,oBAGD,gBAAgB;CAAA,4BAHpBA,KAAK,mBAIF,eAAe;CAAA,4BAJlBA,KAAK,mBAKF,eAAe;CAAA,4BALlBA,KAAK,kBAMH,cAAc;CAAA,4BANhBA,KAAK,iBAOJ,aAAa;;;;;;;ACVnC,CAC0F;CAAA;CAAA;CAAA;CAAA;CAAA,IAErEC,aAAa;GAOjC,uBAAYC,KAAK,EACjB;KAAA;KAAA;KAAA;OAAA;OAAA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