{"version":3,"sources":["webpack:///./src/core/services/configurations-service.ts","webpack:///./src/core/utils/axios-instance.ts","webpack:///./client-generator/generated-clients/configurations.ts","webpack:///./src/core/services/plants.ts","webpack:///./node_modules/core-js/modules/es.array.find-index.js","webpack:///./src/core/services/naming.service.ts"],"names":["configurationsClient","a","defaults","timeout","interceptors","request","use","config","getToken","token","headers","Authorization","response","error","addError","JSON","stringify","toJSON","status","emit","Promise","reject","push","name","PlantEntityType","Client","baseUrl","instance","jsonParseReviver","undefined","this","create","cancelToken","url_","replace","options_","method","url","catch","_error","isAxiosError","then","_response","processCountriesAutocomplete","_headers","k","hasOwnProperty","_responseText","data","result200","resultData200","Array","isArray","item","AutocompleteDTO","fromJS","throwException","resolve","processDefaultRoomsList","DefaultRoomDTO","processDefaultSettings","DeskToolClientSettingsDTO","plantdesktopid","etype","Error","encodeURIComponent","processFlattenedEntities","PlantFlatEntityDTO","property","_data","value","label","result","init","type","count","icon","uiSettings","plantRefreshInterval","azureAdb2CClientId","azureAdb2CAuthority","azureAdb2CKnownAuthority","azureAdb2CFullAccessScope","instrumentationKey","profileUrl","entrancePlantEnabled","RoomObjectType","RoomType","id","roomType","objectType","currentName","plantEntityType","ApiException","message","isApiException","obj","prototype","Object","call","$type","plantsClient","$","$findIndex","findIndex","addToUnscopables","FIND_INDEX","SKIPS_HOLES","target","proto","forced","callbackfn","arguments","length","NamingService","plantId","eType","flattenedEntities","initialEntities","additionalEntitiesInternal","v","newName","initialEntitiesWantedIdx","e","trim","toLowerCase","additionalEntitiesWantedIdx","additionalEntities","every","list","objectToValidate","oType","sameNameOccurrences","objects","innerObject","isInvalid","loopingPlant","filter","opts","modifier","baseName","initEntityNameOrThrow","isValidEntityTypeName","ROOM_OBJECT","metadata","room","roomObjectType","initRoomObjectName","ROOM","initRoomName","SCENE","initSceneName","GROUP","initGroupName","PLANT","plantSourceName","initPlantName","errMsg","console","sourceName","$t","Shutter","Light","objType","global","t"],"mappings":"iNAAA,4BAGMA,EAAuB,IA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S,OAAH,OAAU3C,EAAc3F,KAAxB,gFAGZ,MADAuI,QAAQjJ,MAAMgJ,GACR,IAAI7F,MAAM6F,KAlMpB,2BAqMU,SAAqBE,GAC3B,gBAAUA,EAAWnC,OAArB,YAA+B9F,KAAKkI,GAAG,oBAAoBnC,iBAtM/D,2BAyMU,SAAqBqB,GAC3B,OAAQA,GACN,KAAK,QAAee,QAClB,OAAOnI,KAAKkI,GAAG,+BACjB,KAAK,QAAeE,MAClB,OAAOpI,KAAKkI,GAAG,6BACjB,QACE,MAAO,MAhNf,2BAoNU,WACN,OAAOlI,KAAKkI,GAAL,uBArNX,0BAwNU,SAAoBvE,GAC1B,OAAO3D,KAAKkI,GAAL,sBAAuB,QAASvE,OAzN3C,gCA4NU,SACNwD,EACAkB,GAEA,MAAO,UAAGlB,EAAK1H,KAAR,KAAkBO,KAAKkI,GAAL,sBAAuB,QAAeG,SAhOnE,KACiB,EAAAH,GAAK,OAAKI,OAAOC,EAQjB,EAAA/C,gBAAwC,GACxC,EAAAC,2BAAmD","file":"js/page-assign-room-object~page-assign-thermo-room-object~page-entranceplant-dashboard~page-entrancepla~a4c4d477.5edeb9f0.js","sourcesContent":["import { Client } from '@/../client-generator/generated-clients/configurations';\nimport axiosInstance from '../utils/axios-instance';\n\nconst configurationsClient = new Client('', axiosInstance);\n\nexport default configurationsClient;\n","import axios from 'axios';\nimport router from '../../core/router/index';\n\naxios.defaults.timeout = 30000;\n\nimport authService from '../services/auth.service';\nimport emitter from '@/core/config/emitter';\nimport { MANAGE_ELIOT_PARSE_EXCEPTION } from './emitter-events';\nimport globalErrors from './global-errors';\n\naxios.interceptors.request.use(async (config) => {\n const token = await authService.getToken();\n if (token) config.headers.Authorization = `Bearer ${token}`;\n else config.headers.Authorization = '';\n return config;\n});\n\naxios.interceptors.response.use(\n (response) => {\n return response;\n },\n (error) => {\n globalErrors.addError(JSON.stringify(error.toJSON()));\n if (error.response.status === 412) {\n emitter.emit(MANAGE_ELIOT_PARSE_EXCEPTION);\n } else if (error.response.status === 477) {\n // user is not in allowed list\n router.push({ name: 'page-user-not-allowed' });\n } else {\n return Promise.reject(error);\n }\n }\n);\n\nexport default axios;\n","/* tslint:disable */\n/* eslint-disable */\n//----------------------\n// \n// Generated using the NSwag toolchain v13.13.2.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)\n// \n//----------------------\n// ReSharper disable InconsistentNaming\n\nimport axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, CancelToken } from 'axios';\n\nexport class Client {\n private instance: AxiosInstance;\n private baseUrl: string;\n protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined;\n\n constructor(baseUrl?: string, instance?: AxiosInstance) {\n this.instance = instance ? instance : axios.create();\n this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : \"\";\n }\n\n /**\n * Get countries autocomplete (Auth)\n * @return List of countries\n */\n countriesAutocomplete( cancelToken?: CancelToken | undefined): Promise {\n let url_ = this.baseUrl + \"/countries-autocomplete\";\n url_ = url_.replace(/[?&]$/, \"\");\n\n let options_ = {\n method: \"GET\",\n url: url_,\n headers: {\n \"Accept\": \"text/plain\"\n },\n cancelToken\n };\n\n return this.instance.request(options_).catch((_error: any) => {\n if (isAxiosError(_error) && _error.response) {\n return _error.response;\n } else {\n throw _error;\n }\n }).then((_response: AxiosResponse) => {\n return this.processCountriesAutocomplete(_response);\n });\n }\n\n protected processCountriesAutocomplete(response: AxiosResponse): Promise {\n const status = response.status;\n let _headers: any = {};\n if (response.headers && typeof response.headers === \"object\") {\n for (let k in response.headers) {\n if (response.headers.hasOwnProperty(k)) {\n _headers[k] = response.headers[k];\n }\n }\n }\n if (status === 200) {\n const _responseText = response.data;\n let result200: any = null;\n let resultData200 = _responseText;\n if (Array.isArray(resultData200)) {\n result200 = [] as any;\n for (let item of resultData200)\n result200!.push(AutocompleteDTO.fromJS(item));\n }\n else {\n result200 = null;\n }\n return result200;\n } else if (status === 500) {\n const _responseText = response.data;\n return throwException(\"Generic error\", status, _responseText, _headers);\n } else if (status === 401) {\n const _responseText = response.data;\n return throwException(\"Unauthorized\", status, _responseText, _headers);\n } else if (status === 403) {\n const _responseText = response.data;\n return throwException(\"Forbidden\", status, _responseText, _headers);\n } else if (status !== 200 && status !== 204) {\n const _responseText = response.data;\n return throwException(\"An unexpected server error occurred.\", status, _responseText, _headers);\n }\n return Promise.resolve(null);\n }\n\n /**\n * Get default rooms list with default values (Auth)\n * @return List of default rooms with values\n */\n defaultRoomsList( cancelToken?: CancelToken | undefined): Promise {\n let url_ = this.baseUrl + \"/default-rooms-list\";\n url_ = url_.replace(/[?&]$/, \"\");\n\n let options_ = {\n method: \"GET\",\n url: url_,\n headers: {\n \"Accept\": \"text/plain\"\n },\n cancelToken\n };\n\n return this.instance.request(options_).catch((_error: any) => {\n if (isAxiosError(_error) && _error.response) {\n return _error.response;\n } else {\n throw _error;\n }\n }).then((_response: AxiosResponse) => {\n return this.processDefaultRoomsList(_response);\n });\n }\n\n protected processDefaultRoomsList(response: AxiosResponse): Promise {\n const status = response.status;\n let _headers: any = {};\n if (response.headers && typeof response.headers === \"object\") {\n for (let k in response.headers) {\n if (response.headers.hasOwnProperty(k)) {\n _headers[k] = response.headers[k];\n }\n }\n }\n if (status === 200) {\n const _responseText = response.data;\n let result200: any = null;\n let resultData200 = _responseText;\n if (Array.isArray(resultData200)) {\n result200 = [] as any;\n for (let item of resultData200)\n result200!.push(DefaultRoomDTO.fromJS(item));\n }\n else {\n result200 = null;\n }\n return result200;\n } else if (status === 500) {\n const _responseText = response.data;\n return throwException(\"Generic error\", status, _responseText, _headers);\n } else if (status === 401) {\n const _responseText = response.data;\n return throwException(\"Unauthorized\", status, _responseText, _headers);\n } else if (status === 403) {\n const _responseText = response.data;\n return throwException(\"Forbidden\", status, _responseText, _headers);\n } else if (status !== 200 && status !== 204) {\n const _responseText = response.data;\n return throwException(\"An unexpected server error occurred.\", status, _responseText, _headers);\n }\n return Promise.resolve(null);\n }\n\n /**\n * Get default settings for DeksTool client\n * @return A JSON object containing the defaults for the desktool client\n */\n defaultSettings( cancelToken?: CancelToken | undefined): Promise {\n let url_ = this.baseUrl + \"/desktool-client/default-settings\";\n url_ = url_.replace(/[?&]$/, \"\");\n\n let options_ = {\n method: \"GET\",\n url: url_,\n headers: {\n \"Accept\": \"text/plain\"\n },\n cancelToken\n };\n\n return this.instance.request(options_).catch((_error: any) => {\n if (isAxiosError(_error) && _error.response) {\n return _error.response;\n } else {\n throw _error;\n }\n }).then((_response: AxiosResponse) => {\n return this.processDefaultSettings(_response);\n });\n }\n\n protected processDefaultSettings(response: AxiosResponse): Promise {\n const status = response.status;\n let _headers: any = {};\n if (response.headers && typeof response.headers === \"object\") {\n for (let k in response.headers) {\n if (response.headers.hasOwnProperty(k)) {\n _headers[k] = response.headers[k];\n }\n }\n }\n if (status === 200) {\n const _responseText = response.data;\n let result200: any = null;\n let resultData200 = _responseText;\n result200 = DeskToolClientSettingsDTO.fromJS(resultData200);\n return result200;\n } else if (status === 500) {\n const _responseText = response.data;\n return throwException(\"Generic error\", status, _responseText, _headers);\n } else if (status !== 200 && status !== 204) {\n const _responseText = response.data;\n return throwException(\"An unexpected server error occurred.\", status, _responseText, _headers);\n }\n return Promise.resolve(null);\n }\n\n /**\n * Returns a flat list of all the entities of the given type across all the plant.\n Use 0 as plantdesktopid when id is not available (Auth)\n * @param plantdesktopid PlantId\n * @param etype PlantEntityType\n \n 0 = ROOM\n \n 1 = SCENE\n \n 2 = GROUP\n \n 3 = ROOM_OBJECT\n \n 4 = PLANT\n * @return Plant Entities Flattened List\n */\n flattenedEntities(plantdesktopid: number, etype: PlantEntityType , cancelToken?: CancelToken | undefined): Promise {\n let url_ = this.baseUrl + \"/plant/{plantdesktopid}/flattened-entities/{etype}\";\n if (plantdesktopid === undefined || plantdesktopid === null)\n throw new Error(\"The parameter 'plantdesktopid' must be defined.\");\n url_ = url_.replace(\"{plantdesktopid}\", encodeURIComponent(\"\" + plantdesktopid));\n if (etype === undefined || etype === null)\n throw new Error(\"The parameter 'etype' must be defined.\");\n url_ = url_.replace(\"{etype}\", encodeURIComponent(\"\" + etype));\n url_ = url_.replace(/[?&]$/, \"\");\n\n let options_ = {\n method: \"GET\",\n url: url_,\n headers: {\n \"Accept\": \"text/plain\"\n },\n cancelToken\n };\n\n return this.instance.request(options_).catch((_error: any) => {\n if (isAxiosError(_error) && _error.response) {\n return _error.response;\n } else {\n throw _error;\n }\n }).then((_response: AxiosResponse) => {\n return this.processFlattenedEntities(_response);\n });\n }\n\n protected processFlattenedEntities(response: AxiosResponse): Promise {\n const status = response.status;\n let _headers: any = {};\n if (response.headers && typeof response.headers === \"object\") {\n for (let k in response.headers) {\n if (response.headers.hasOwnProperty(k)) {\n _headers[k] = response.headers[k];\n }\n }\n }\n if (status === 200) {\n const _responseText = response.data;\n let result200: any = null;\n let resultData200 = _responseText;\n if (Array.isArray(resultData200)) {\n result200 = [] as any;\n for (let item of resultData200)\n result200!.push(PlantFlatEntityDTO.fromJS(item));\n }\n else {\n result200 = null;\n }\n return result200;\n } else if (status === 401) {\n const _responseText = response.data;\n return throwException(\"Unauthorized\", status, _responseText, _headers);\n } else if (status === 403) {\n const _responseText = response.data;\n return throwException(\"Forbidden\", status, _responseText, _headers);\n } else if (status === 404) {\n const _responseText = response.data;\n return throwException(\"Plant doesn\\'t exist or not owned\", status, _responseText, _headers);\n } else if (status === 412) {\n const _responseText = response.data;\n return throwException(\"Eliot parse exception\", status, _responseText, _headers);\n } else if (status === 503) {\n const _responseText = response.data;\n return throwException(\"Eliot API not working\", status, _responseText, _headers);\n } else if (status === 500) {\n const _responseText = response.data;\n return throwException(\"A generic error occurred\", status, _responseText, _headers);\n } else if (status !== 200 && status !== 204) {\n const _responseText = response.data;\n return throwException(\"An unexpected server error occurred.\", status, _responseText, _headers);\n }\n return Promise.resolve(null);\n }\n}\n\nexport class AutocompleteDTO implements IAutocompleteDTO {\n value?: string | undefined;\n label?: string | undefined;\n\n constructor(data?: IAutocompleteDTO) {\n if (data) {\n for (var property in data) {\n if (data.hasOwnProperty(property))\n (this)[property] = (data)[property];\n }\n }\n }\n\n init(_data?: any) {\n if (_data) {\n this.value = _data[\"value\"];\n this.label = _data[\"label\"];\n }\n }\n\n static fromJS(data: any): AutocompleteDTO {\n data = typeof data === 'object' ? data : {};\n let result = new AutocompleteDTO();\n result.init(data);\n return result;\n }\n\n toJSON(data?: any) {\n data = typeof data === 'object' ? data : {};\n data[\"value\"] = this.value;\n data[\"label\"] = this.label;\n return data; \n }\n}\n\nexport interface IAutocompleteDTO {\n value?: string | undefined;\n label?: string | undefined;\n}\n\nexport class DefaultRoomDTO implements IDefaultRoomDTO {\n type?: RoomType;\n count?: number;\n icon?: string | undefined;\n label?: string | undefined;\n\n constructor(data?: IDefaultRoomDTO) {\n if (data) {\n for (var property in data) {\n if (data.hasOwnProperty(property))\n (this)[property] = (data)[property];\n }\n }\n }\n\n init(_data?: any) {\n if (_data) {\n this.type = _data[\"type\"];\n this.count = _data[\"count\"];\n this.icon = _data[\"icon\"];\n this.label = _data[\"label\"];\n }\n }\n\n static fromJS(data: any): DefaultRoomDTO {\n data = typeof data === 'object' ? data : {};\n let result = new DefaultRoomDTO();\n result.init(data);\n return result;\n }\n\n toJSON(data?: any) {\n data = typeof data === 'object' ? data : {};\n data[\"type\"] = this.type;\n data[\"count\"] = this.count;\n data[\"icon\"] = this.icon;\n data[\"label\"] = this.label;\n return data; \n }\n}\n\nexport interface IDefaultRoomDTO {\n type?: RoomType;\n count?: number;\n icon?: string | undefined;\n label?: string | undefined;\n}\n\nexport class DeskToolClientSettingsDTO implements IDeskToolClientSettingsDTO {\n uiSettings?: any | undefined;\n plantRefreshInterval?: number;\n azureAdb2CClientId?: string | undefined;\n azureAdb2CAuthority?: string | undefined;\n azureAdb2CKnownAuthority?: string | undefined;\n azureAdb2CFullAccessScope?: string | undefined;\n instrumentationKey?: string | undefined;\n profileUrl?: string | undefined;\n entrancePlantEnabled?: boolean;\n\n constructor(data?: IDeskToolClientSettingsDTO) {\n if (data) {\n for (var property in data) {\n if (data.hasOwnProperty(property))\n (this)[property] = (data)[property];\n }\n }\n }\n\n init(_data?: any) {\n if (_data) {\n this.uiSettings = _data[\"uiSettings\"];\n this.plantRefreshInterval = _data[\"plantRefreshInterval\"];\n this.azureAdb2CClientId = _data[\"azureAdb2CClientId\"];\n this.azureAdb2CAuthority = _data[\"azureAdb2CAuthority\"];\n this.azureAdb2CKnownAuthority = _data[\"azureAdb2CKnownAuthority\"];\n this.azureAdb2CFullAccessScope = _data[\"azureAdb2CFullAccessScope\"];\n this.instrumentationKey = _data[\"instrumentationKey\"];\n this.profileUrl = _data[\"profileUrl\"];\n this.entrancePlantEnabled = _data[\"entrancePlantEnabled\"];\n }\n }\n\n static fromJS(data: any): DeskToolClientSettingsDTO {\n data = typeof data === 'object' ? data : {};\n let result = new DeskToolClientSettingsDTO();\n result.init(data);\n return result;\n }\n\n toJSON(data?: any) {\n data = typeof data === 'object' ? data : {};\n data[\"uiSettings\"] = this.uiSettings;\n data[\"plantRefreshInterval\"] = this.plantRefreshInterval;\n data[\"azureAdb2CClientId\"] = this.azureAdb2CClientId;\n data[\"azureAdb2CAuthority\"] = this.azureAdb2CAuthority;\n data[\"azureAdb2CKnownAuthority\"] = this.azureAdb2CKnownAuthority;\n data[\"azureAdb2CFullAccessScope\"] = this.azureAdb2CFullAccessScope;\n data[\"instrumentationKey\"] = this.instrumentationKey;\n data[\"profileUrl\"] = this.profileUrl;\n data[\"entrancePlantEnabled\"] = this.entrancePlantEnabled;\n return data; \n }\n}\n\nexport interface IDeskToolClientSettingsDTO {\n uiSettings?: any | undefined;\n plantRefreshInterval?: number;\n azureAdb2CClientId?: string | undefined;\n azureAdb2CAuthority?: string | undefined;\n azureAdb2CKnownAuthority?: string | undefined;\n azureAdb2CFullAccessScope?: string | undefined;\n instrumentationKey?: string | undefined;\n profileUrl?: string | undefined;\n entrancePlantEnabled?: boolean;\n}\n\n/** 0 = ROOM 1 = SCENE 2 = GROUP 3 = ROOM_OBJECT 4 = PLANT */\nexport enum PlantEntityType {\n ROOM = 0,\n SCENE = 1,\n GROUP = 2,\n ROOM_OBJECT = 3,\n PLANT = 4,\n}\n\nexport class PlantFlatEntityDTO implements IPlantFlatEntityDTO {\n id?: string | undefined;\n roomType?: RoomType;\n objectType?: RoomObjectType;\n currentName?: string | undefined;\n plantEntityType?: PlantEntityType;\n\n constructor(data?: IPlantFlatEntityDTO) {\n if (data) {\n for (var property in data) {\n if (data.hasOwnProperty(property))\n (this)[property] = (data)[property];\n }\n }\n }\n\n init(_data?: any) {\n if (_data) {\n this.id = _data[\"id\"];\n this.roomType = _data[\"roomType\"];\n this.objectType = _data[\"objectType\"];\n this.currentName = _data[\"currentName\"];\n this.plantEntityType = _data[\"plantEntityType\"];\n }\n }\n\n static fromJS(data: any): PlantFlatEntityDTO {\n data = typeof data === 'object' ? data : {};\n let result = new PlantFlatEntityDTO();\n result.init(data);\n return result;\n }\n\n toJSON(data?: any) {\n data = typeof data === 'object' ? data : {};\n data[\"id\"] = this.id;\n data[\"roomType\"] = this.roomType;\n data[\"objectType\"] = this.objectType;\n data[\"currentName\"] = this.currentName;\n data[\"plantEntityType\"] = this.plantEntityType;\n return data; \n }\n}\n\nexport interface IPlantFlatEntityDTO {\n id?: string | undefined;\n roomType?: RoomType;\n objectType?: RoomObjectType;\n currentName?: string | undefined;\n plantEntityType?: PlantEntityType;\n}\n\n/** 0 = Light 1 = Shutter 2 = Socket 3 = Lock 4 = Thermostat 5 = Fancoil 6 = TowelWarmer 7 = WirelessCommand 8 = Blind 9 = Player 10 = Xmeter 11 = Alarm 12 = ColoredLight 13 = ScheduledScenarioPlus 14 = None 15 = Contact 16 = AlarmSensor 17 = Thermostat99zones 18 = DimmerDmx 19 = DimmerDali 20 = Actuactor 21 = CentralLoadControl 22 = ActuactorLoadControl 23 = VdeLock 24 = StaircaseLight 25 = FloorCall 26 = Unknown */\nexport enum RoomObjectType {\n Light = 0,\n Shutter = 1,\n Socket = 2,\n Lock = 3,\n Thermostat = 4,\n Fancoil = 5,\n TowelWarmer = 6,\n WirelessCommand = 7,\n Blind = 8,\n Player = 9,\n Xmeter = 10,\n Alarm = 11,\n ColoredLight = 12,\n ScheduledScenarioPlus = 13,\n None = 14,\n Contact = 15,\n AlarmSensor = 16,\n Thermostat99zones = 17,\n DimmerDmx = 18,\n DimmerDali = 19,\n Actuactor = 20,\n CentralLoadControl = 21,\n ActuactorLoadControl = 22,\n VdeLock = 23,\n StaircaseLight = 24,\n FloorCall = 25,\n Unknown = 26,\n}\n\n/** 0 = Livingroom 1 = Bathroom 2 = Kitchen 3 = Bedroom 4 = Dining_room 5 = Toilets 6 = Lobby 7 = Corridor 8 = Garage 9 = Outdoor 10 = Home_office 11 = Stairs 12 = Electrical_cabinet 13 = Custom 14 = Unknown */\nexport enum RoomType {\n Livingroom = 0,\n Bathroom = 1,\n Kitchen = 2,\n Bedroom = 3,\n Dining_room = 4,\n Toilets = 5,\n Lobby = 6,\n Corridor = 7,\n Garage = 8,\n Outdoor = 9,\n Home_office = 10,\n Stairs = 11,\n Electrical_cabinet = 12,\n Custom = 13,\n Unknown = 14,\n}\n\nexport class ApiException extends Error {\n message: string;\n status: number;\n response: string;\n headers: { [key: string]: any; };\n result: any;\n\n constructor(message: string, status: number, response: string, headers: { [key: string]: any; }, result: any) {\n super();\n\n this.message = message;\n this.status = status;\n this.response = response;\n this.headers = headers;\n this.result = result;\n }\n\n protected isApiException = true;\n\n static isApiException(obj: any): obj is ApiException {\n return obj.isApiException === true;\n }\n}\n\nfunction throwException(message: string, status: number, response: string, headers: { [key: string]: any; }, result?: any): any {\n if (result !== null && result !== undefined)\n throw result;\n else\n throw new ApiException(message, status, response, headers, null);\n}\n\nfunction isAxiosError(obj: any | undefined): obj is AxiosError {\n return obj && obj.isAxiosError === true;\n}","import {\n Client,\n ActuatorSettings,\n CommandSettings,\n GeneralCommandsAndGroupsAction,\n DefaultObjectAction,\n ObjectAction,\n WaitTimeAction,\n Action,\n Trigger,\n Condition,\n ObjectTrigger,\n ButtonTrigger,\n DateAndTimeTrigger,\n TimeCondition,\n ObjectCondition,\n ExtDevice,\n ColoredLightExtDevice,\n XmeterExtDevice,\n PlayerExtDevice,\n} from '@/../client-generator/generated-clients/plants';\nimport axiosInstance from '../utils/axios-instance';\n\nCondition.prototype.init \n= Trigger.prototype.init \n= Action.prototype.init \n= ActuatorSettings.prototype.init \n= CommandSettings.prototype.init \n= GeneralCommandsAndGroupsAction.prototype.init \n= DefaultObjectAction.prototype.init \n= ObjectAction.prototype.init \n= WaitTimeAction.prototype.init \n= ObjectTrigger.prototype.init \n= ButtonTrigger.prototype.init \n= DateAndTimeTrigger.prototype.init \n= TimeCondition.prototype.init \n= ObjectCondition.prototype.init\n= ExtDevice.prototype.init\n= ColoredLightExtDevice.prototype.init\n= XmeterExtDevice.prototype.init\n= PlayerExtDevice.prototype.init = function (\n data?: any\n) {\n if (data) {\n for (var property in data) {\n if (Object.prototype.hasOwnProperty.call(data, property))\n (this)[property] = (data)[property];\n }\n }\n};\n\nCondition.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.Condition, ProtocolManager`,\n ...this,\n };\n};\nTrigger.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.Trigger, ProtocolManager`,\n ...this,\n };\n};\nAction.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.Action, ProtocolManager`,\n ...this,\n };\n};\nActuatorSettings.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.ActuatorSettings, ProtocolManager`,\n ...this,\n };\n};\nCommandSettings.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.CommandSettings, ProtocolManager`,\n ...this,\n };\n};\nGeneralCommandsAndGroupsAction.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.GeneralCommandsAndGroupsAction, ProtocolManager`,\n ...this,\n };\n};\nDefaultObjectAction.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.DefaultObjectAction, ProtocolManager`,\n ...this,\n };\n};\nObjectAction.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.ObjectAction, ProtocolManager`,\n ...this,\n };\n};\nWaitTimeAction.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.WaitTimeAction, ProtocolManager`,\n ...this,\n };\n};\nObjectTrigger.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.ObjectTrigger, ProtocolManager`,\n ...this,\n };\n};\nButtonTrigger.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.ButtonTrigger, ProtocolManager`,\n ...this,\n };\n};\nDateAndTimeTrigger.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.DateAndTimeTrigger, ProtocolManager`,\n ...this,\n };\n};\nTimeCondition.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.TimeCondition, ProtocolManager`,\n ...this,\n };\n};\nObjectCondition.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.ObjectCondition, ProtocolManager`,\n ...this,\n };\n};\nExtDevice.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.ExtDevice, ProtocolManager`,\n ...this,\n };\n};\nColoredLightExtDevice.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.ColoredLightExtDevice, ProtocolManager`,\n ...this,\n };\n};\nXmeterExtDevice.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.XmeterExtDevice, ProtocolManager`,\n ...this,\n };\n};\nPlayerExtDevice.prototype.toJSON = function (data?: any) {\n return {\n $type: `ProtocolManager.Model.PlayerExtDevice, ProtocolManager`,\n ...this,\n };\n};\n\nconst plantsClient = new Client('', axiosInstance);\n\nexport default plantsClient;\n","'use strict';\nvar $ = require('../internals/export');\nvar $findIndex = require('../internals/array-iteration').findIndex;\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\nvar FIND_INDEX = 'findIndex';\nvar SKIPS_HOLES = true;\n\n// Shouldn't skip holes\nif (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });\n\n// `Array.prototype.findIndex` method\n// https://tc39.es/ecma262/#sec-array.prototype.findindex\n$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {\n findIndex: function findIndex(callbackfn /* , that = undefined */) {\n return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables(FIND_INDEX);\n","import i18n from '../translations/i18n';\nimport { isValidEnum, ObjectTypes } from '../utils/utils';\nimport configurationsClient from './configurations-service';\nimport {\n PlantEntityType,\n PlantFlatEntityDTO,\n} from '@/../client-generator/generated-clients/configurations';\nimport {\n RoomDTO,\n RoomType,\n RoomObjectType,\n AddRoomObjectDTO,\n IRoomObject,\n PlantListDTO,\n} from '@/../client-generator/generated-clients/plants';\n\nexport interface IValidableObjectType extends AddRoomObjectDTO {\n idx?: number;\n isInvalid?: boolean;\n invalidReason?: string;\n}\n\nexport interface RoomObjectsTypes {\n id: string;\n objects: Array;\n type: RoomObjectType;\n busy?: boolean;\n}\n\nexport type ValidablePlant = Partial & {\n isInvalid?: boolean;\n invalidReason?: string;\n};\n\nexport interface ISuggestValidObjectNameOpts {\n plantId: number;\n eType: PlantEntityType;\n\n /**\n * Additional data required in certain scenarios\n * in order to be able to suggest the next valid name\n */\n metadata?: {\n /**\n * In case we are suggesting the name for a\n * room object, we need the Room\n */\n room?: RoomDTO;\n\n /**\n * In case we are suggesting the name for a\n * room object or a group, we need the RoomObjectType\n */\n roomObjectType?: RoomObjectType;\n\n /**\n * In case we are suggesting the name for\n * a room, we need the RoomType\n */\n roomType?: RoomType;\n\n /**\n * In case we are suggesting the name for\n * a cloned plant, we always start with a\n * source name\n */\n plantSourceName?: string;\n };\n}\n\nexport class NamingService {\n private static $t = i18n.global.t;\n\n /**\n * Used to cache requests. This turns out to be\n * very useful when subsequent entities of the same\n * type must be validated. Without this, the validation\n * method would call the API for each validation.\n */\n private static initialEntities: PlantFlatEntityDTO[] = [];\n private static additionalEntitiesInternal: PlantFlatEntityDTO[] = [];\n\n static async prefetchFlatEntities(\n plantId: number,\n eType: PlantEntityType\n ): Promise {\n this.initialEntities = await configurationsClient.flattenedEntities(\n plantId,\n eType\n );\n return Promise.resolve(!!this.initialEntities);\n }\n\n static set additionalEntities(v: PlantFlatEntityDTO[]) {\n this.additionalEntitiesInternal = v;\n }\n\n static get additionalEntities(): PlantFlatEntityDTO[] {\n return this.additionalEntitiesInternal;\n }\n\n static flushCache(): void {\n this.initialEntities = [];\n this.additionalEntitiesInternal = [];\n }\n\n /**\n * Convenience method to update a cached name without\n * flushing and reloading the cache again\n *\n * @param currentName the entity name you want edit\n * @param newName the new entity name\n */\n static forcefullyRenameFirstEntityWithinCachedOnes(\n currentName: string,\n newName: string\n ): void {\n const initialEntitiesWantedIdx = this.initialEntities.findIndex(\n (e) =>\n e.currentName?.trim().toLowerCase() === currentName.trim().toLowerCase()\n );\n if (initialEntitiesWantedIdx !== -1)\n this.initialEntities[initialEntitiesWantedIdx].currentName = newName;\n\n const additionalEntitiesWantedIdx = this.additionalEntities.findIndex(\n (e) =>\n e.currentName?.trim().toLowerCase() === currentName.trim().toLowerCase()\n );\n if (additionalEntitiesWantedIdx !== -1)\n this.additionalEntities[\n additionalEntitiesWantedIdx\n ].currentName = newName;\n }\n\n static isValidEntityTypeName(name?: string): boolean {\n if (!name || !name.trim()) return false;\n return (\n this.initialEntities.every(\n (e) =>\n e.currentName?.toLowerCase().trim() !== name?.toLowerCase().trim()\n ) &&\n this.additionalEntities.every(\n (e) =>\n e.currentName?.toLowerCase().trim() !== name?.toLowerCase().trim()\n )\n );\n }\n\n static async validateRoomObjectAgainstList(\n list: RoomObjectsTypes[],\n objectToValidate: IRoomObject\n ): Promise {\n for (const oType of list) {\n let sameNameOccurrences = 0;\n for (const innerObject of oType.objects) {\n if (\n innerObject.name?.toLowerCase().trim() ===\n objectToValidate.name?.toLowerCase().trim()\n ) {\n sameNameOccurrences++;\n innerObject.isInvalid = sameNameOccurrences > 1;\n } else {\n innerObject.isInvalid = false;\n }\n }\n }\n return Promise.resolve(list);\n }\n\n static validatePlantAgainstList(list: ValidablePlant[]): ValidablePlant[] {\n for (const loopingPlant of list) {\n loopingPlant.isInvalid =\n list.filter(\n (e) =>\n e.name?.toLowerCase().trim() ===\n loopingPlant.name?.toLowerCase().trim()\n ).length > 1;\n }\n return list;\n }\n\n /**\n * Suggests the next valid name for an entity according to the\n * configuration of the options provided:\n *\n * The minimum required options are the plantId and the PlantEntityType.\n * Other than those, there are specific combinations to use in order to\n * suggest the name for each entity type. These combinations are provided\n * to the \"metadata\" property of the configuration object:\n *\n * - Scene: no metadata required\n * - Room: metadata.roomType must be valorized\n * - Group: metadata.roomObjectType must be valorized\n * - RoomObject: metadata.room, metadata.roomType,\n * metadata.roomObjectType must be valorized\n *\n * @param opts\n * @returns Promise the next valid name that can be used\n */\n static async suggestNextValidEntityName(\n opts: ISuggestValidObjectNameOpts\n ): Promise {\n let modifier = 0;\n let baseName: string = this.initEntityNameOrThrow(opts);\n let name = '';\n\n do {\n modifier++;\n name =\n modifier === 1 ? baseName.trim() : baseName.trim() + ` ${modifier}`;\n } while (!this.isValidEntityTypeName(name));\n\n return Promise.resolve(name);\n }\n\n private static initEntityNameOrThrow(\n opts: ISuggestValidObjectNameOpts\n ): string {\n // RoomObject name suggestion\n if (\n opts.eType === PlantEntityType.ROOM_OBJECT &&\n !!opts.metadata?.room &&\n isValidEnum(opts.metadata?.roomType) &&\n isValidEnum(opts.metadata?.roomObjectType)\n ) {\n return this.initRoomObjectName(\n opts.metadata.room,\n opts.metadata?.roomObjectType as number\n );\n }\n\n // Room name suggestion\n if (\n opts.eType === PlantEntityType.ROOM &&\n isValidEnum(opts.metadata?.roomType)\n ) {\n return this.initRoomName(opts.metadata?.roomType as number);\n }\n\n // Scene name suggestion\n if (opts.eType === PlantEntityType.SCENE) {\n return this.initSceneName();\n }\n\n // Group name suggestion\n if (\n opts.eType === PlantEntityType.GROUP &&\n isValidEnum(opts.metadata?.roomObjectType)\n ) {\n return this.initGroupName(opts.metadata?.roomObjectType as number);\n }\n\n // Plant name suggestion\n if (opts.eType === PlantEntityType.PLANT) {\n if (!opts.metadata?.plantSourceName)\n throw new Error(\n 'PlantSourceName is required to suggest the next plant name'\n );\n return this.initPlantName(opts.metadata?.plantSourceName!);\n }\n\n const errMsg = `[X](${NamingService.name}): Could not infer the entity name to generate. Check your opts combination.`;\n // this log is for convenience since Vue messes up the messages of the errors in console.\n console.error(errMsg);\n throw new Error(errMsg);\n }\n\n private static initPlantName(sourceName: string): string {\n return `${sourceName.trim()} ${this.$t('AppResource.Copy').toLowerCase()}`;\n }\n\n private static initGroupName(roomObjectType: RoomObjectType): string {\n switch (roomObjectType) {\n case RoomObjectType.Shutter:\n return this.$t('AppResource.GroupOfShutters');\n case RoomObjectType.Light:\n return this.$t('AppResource.GroupOfLights');\n default:\n return '';\n }\n }\n\n private static initSceneName(): string {\n return this.$t(`AppResource.Scene`);\n }\n\n private static initRoomName(roomType: RoomType): string {\n return this.$t(`AppResource.${RoomType[roomType]}`);\n }\n\n private static initRoomObjectName(\n room: RoomDTO,\n objType: RoomObjectType\n ): string {\n return `${room.name} ` + this.$t(`AppResource.${RoomObjectType[objType]}`);\n }\n}\n"],"sourceRoot":""}