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,MAAM,WAAEpJ,GAAesC,EAAqB8C,WAAW/G,GACjDgC,EAASL,EAAW8B,GAC1B,IAAKzB,EACD,MAAM,IAAIyF,MAAM,yBAAyBhE,qBAE7C,MAAMuH,EAAYhJ,EAAO8I,GACzB,GAAIG,MAAMC,QAAQF,KAAeA,EAC7B,MAAM,IAAIvD,MAAM,aAAaqD,qDAEjC,MAAM7L,EAAQ+L,EAAU/L,MACxB,QAAcqG,IAAVrG,GAAgC,MAATA,EACvB,MAAM,IAAIwI,MAAM,aAAaqD,iCAIjC,MAAMK,EAAQ,IAAI,IAclB,OAbAC,OAAOC,eAAerJ,EAAO8I,GAAgB,QAAS,CAClDrI,MACI,OAAOlE,KAAK+M,MAChB,EACAvM,UAAUE,GACNV,KAAK+M,OAASrM,QACRkM,EAAMjL,QAAQjB,EACxB,IAEJ+C,EAAO8I,GAAe7L,MAAQA,EACzBV,KAAKsG,mBAAmB7E,EAAMiF,MAAMxB,KACrClF,KAAKsG,mBAAmB7E,EAAMiF,MAAMxB,GAAa,CAAC,GACtDlF,KAAKsG,mBAAmB7E,EAAMiF,MAAMxB,GAAWqH,GAAiBK,EACzDA,CACX,EAEJlH,EAAqBgB,KAAO,uCAC5B,sBAA+BhB,EAAqBgB,K","sources":["webpack://client-app/./node_modules/openbim-components/src/ifc/IfcPropertiesManager/src/entity-actions.js","webpack://client-app/./node_modules/openbim-components/src/ifc/IfcPropertiesManager/src/pset-actions.js","webpack://client-app/./node_modules/openbim-components/src/ifc/IfcPropertiesManager/src/prop-actions.js","webpack://client-app/./node_modules/openbim-components/src/ifc/IfcPropertiesManager/index.js"],"sourcesContent":["import { SimpleUIComponent, TextInput, Button } from \"../../../ui\";\r\nimport { Modal } from \"../../../ui/Modal\";\r\nimport { Event } from \"../../../base-types\";\r\nexport class EntityActionsUI extends SimpleUIComponent {\r\n constructor(components) {\r\n super(components, `
`);\r\n this.onNewPset = new Event();\r\n this.data = {};\r\n this.addPsetBtn = new Button(this._components, {\r\n materialIconName: \"add\",\r\n });\r\n this.addPsetBtn.onClick.add(async () => {\r\n this._nameInput.value = \"\";\r\n this._descriptionInput.value = \"\";\r\n this.modal.visible = true;\r\n });\r\n this.addChild(this.addPsetBtn);\r\n this.modal = new Modal(components, \"New Property Set\");\r\n this._components.ui.add(this.modal);\r\n this.modal.visible = false;\r\n this.modal.onHidden.add(() => this.removeFromParent());\r\n const addPsetUI = new SimpleUIComponent(this._components, ``);\r\n this.modal.setSlot(\"content\", addPsetUI);\r\n this._nameInput = new TextInput(this._components);\r\n this._nameInput.label = \"Name\";\r\n this._descriptionInput = new TextInput(this._components);\r\n this._descriptionInput.label = \"Description\";\r\n this.modal.onAccept.add(() => {\r\n const name = this._nameInput.value;\r\n const description = this._descriptionInput.value;\r\n this.modal.visible = false;\r\n const { model, elementIDs } = this.data;\r\n if (!model || name === \"\")\r\n return;\r\n this.onNewPset.trigger({ model, elementIDs, name, description });\r\n });\r\n this.modal.onCancel.add(() => (this.modal.visible = false));\r\n addPsetUI.addChild(this._nameInput, this._descriptionInput);\r\n }\r\n async dispose(onlyChildren = false) {\r\n await super.dispose(onlyChildren);\r\n this.data = {};\r\n this.onNewPset.reset();\r\n await this.addPsetBtn.dispose();\r\n await this.modal.dispose();\r\n await this._nameInput.dispose();\r\n await this._descriptionInput.dispose();\r\n }\r\n}\r\n//# sourceMappingURL=entity-actions.js.map","import { SimpleUIComponent, TextInput, Dropdown, Button } from \"../../../ui\";\r\nimport { Event } from \"../../../base-types\";\r\nimport { Modal } from \"../../../ui/Modal\";\r\nexport class PsetActionsUI extends SimpleUIComponent {\r\n constructor(components) {\r\n super(components, ``);\r\n this.modalVisible = false;\r\n this.onEditPset = new Event();\r\n this.onRemovePset = new Event();\r\n this.onNewProp = new Event();\r\n this.data = {};\r\n this._modal = new Modal(components, \"New Property Set\");\r\n this._components.ui.add(this._modal);\r\n this._modal.visible = false;\r\n this._modal.onHidden.add(() => this.removeFromParent());\r\n this._modal.onCancel.add(() => {\r\n this._modal.visible = false;\r\n this._modal.slots.content.dispose(true);\r\n });\r\n this.editPsetBtn = new Button(this._components);\r\n this.editPsetBtn.materialIcon = \"edit\";\r\n this.editPsetBtn.onClick.add(() => this.setEditUI());\r\n this.removePsetBtn = new Button(this._components);\r\n this.removePsetBtn.materialIcon = \"delete\";\r\n this.removePsetBtn.onClick.add(() => this.setRemoveUI());\r\n this.addPropBtn = new Button(this._components);\r\n this.addPropBtn.materialIcon = \"add\";\r\n this.addPropBtn.onClick.add(() => this.setAddPropUI());\r\n this.addChild(this.addPropBtn, this.editPsetBtn, this.removePsetBtn);\r\n }\r\n async dispose(onlyChildren = false) {\r\n await super.dispose(onlyChildren);\r\n await this.editPsetBtn.dispose();\r\n await this.removePsetBtn.dispose();\r\n await this.addPropBtn.dispose();\r\n await this._modal.dispose();\r\n this.onEditPset.reset();\r\n this.onRemovePset.reset();\r\n this.onNewProp.reset();\r\n this.data = {};\r\n }\r\n setEditUI() {\r\n var _a, _b, _c, _d;\r\n const { model, psetID } = this.data;\r\n const properties = model === null || model === void 0 ? void 0 : model.properties;\r\n if (!model || !psetID || !properties)\r\n return;\r\n this._modal.onAccept.reset();\r\n this._modal.title = \"Edit Property Set\";\r\n const editUI = new SimpleUIComponent(this._components, ``);\r\n const nameInput = new TextInput(this._components);\r\n nameInput.label = \"Name\";\r\n const descriptionInput = new TextInput(this._components);\r\n descriptionInput.label = \"Description\";\r\n this._modal.onAccept.add(async () => {\r\n this._modal.visible = false;\r\n await this.onEditPset.trigger({\r\n model,\r\n psetID,\r\n name: nameInput.value,\r\n description: descriptionInput.value,\r\n });\r\n });\r\n editUI.addChild(nameInput, descriptionInput);\r\n const entity = properties[psetID];\r\n nameInput.value = (_b = (_a = entity.Name) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : \"\";\r\n descriptionInput.value = (_d = (_c = entity.Description) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : \"\";\r\n this._modal.setSlot(\"content\", editUI);\r\n this._modal.visible = true;\r\n }\r\n setRemoveUI() {\r\n const { model, psetID } = this.data;\r\n if (!model || !psetID)\r\n return;\r\n this._modal.onAccept.reset();\r\n this._modal.title = \"Remove Property Set\";\r\n const removeUI = new SimpleUIComponent(this._components, ``);\r\n const warningText = document.createElement(\"div\");\r\n warningText.className = \"text-base text-center\";\r\n warningText.textContent =\r\n \"Are you sure to delete this property set? This action can't be undone.\";\r\n removeUI.get().append(warningText);\r\n this._modal.onAccept.add(async () => {\r\n this._modal.visible = false;\r\n this.removeFromParent(); // As the psetUI is going to be disposed, then we need to first remove the action buttons so they do not become disposed as well.\r\n await this.onRemovePset.trigger({ model, psetID });\r\n });\r\n this._modal.setSlot(\"content\", removeUI);\r\n this._modal.visible = true;\r\n }\r\n setAddPropUI() {\r\n const { model, psetID } = this.data;\r\n if (!model || !psetID)\r\n return;\r\n this._modal.onAccept.reset();\r\n this._modal.title = \"New Property\";\r\n const addPropUI = new SimpleUIComponent(this._components, ``);\r\n const nameInput = new TextInput(this._components);\r\n nameInput.label = \"Name\";\r\n const typeInput = new Dropdown(this._components);\r\n typeInput.label = \"Type\";\r\n typeInput.addOption(\"IfcText\", \"IfcLabel\", \"IfcIdentifier\");\r\n typeInput.value = \"IfcText\";\r\n const valueInput = new TextInput(this._components);\r\n valueInput.label = \"Value\";\r\n this._modal.onAccept.add(async () => {\r\n this._modal.visible = false;\r\n const name = nameInput.value;\r\n const type = typeInput.value;\r\n if (name === \"\" || !type)\r\n return;\r\n await this.onNewProp.trigger({\r\n model,\r\n psetID,\r\n name,\r\n type,\r\n value: valueInput.value,\r\n });\r\n });\r\n addPropUI.addChild(nameInput, typeInput, valueInput);\r\n this._modal.setSlot(\"content\", addPropUI);\r\n this._modal.visible = true;\r\n }\r\n}\r\n//# sourceMappingURL=pset-actions.js.map","import { SimpleUIComponent, TextInput, Button } from \"../../../ui\";\r\nimport { Event } from \"../../../base-types\";\r\nimport { IfcPropertiesUtils } from \"../../IfcPropertiesUtils\";\r\nimport { Modal } from \"../../../ui/Modal\";\r\nexport class PropActionsUI extends SimpleUIComponent {\r\n constructor(components) {\r\n const div = document.createElement(\"div\");\r\n div.className = \"flex\";\r\n super(components, ``);\r\n this.modalVisible = false;\r\n this.onEditProp = new Event();\r\n this.onRemoveProp = new Event();\r\n this.data = {};\r\n this._modal = new Modal(components, \"New Property Set\");\r\n this._components.ui.add(this._modal);\r\n this._modal.visible = false;\r\n this._modal.onHidden.add(() => this.removeFromParent());\r\n this._modal.onCancel.add(() => {\r\n this._modal.visible = false;\r\n this._modal.slots.content.dispose(true);\r\n });\r\n this.editPropBtn = new Button(this._components);\r\n this.editPropBtn.materialIcon = \"edit\";\r\n this.editPropBtn.onClick.add(() => this.setEditUI());\r\n this.removePropBtn = new Button(this._components);\r\n this.removePropBtn.materialIcon = \"delete\";\r\n this.removePropBtn.onClick.add(() => this.setRemoveUI());\r\n this.addChild(this.editPropBtn, this.removePropBtn);\r\n }\r\n async dispose(onlyChildren = false) {\r\n await super.dispose(onlyChildren);\r\n this.onRemoveProp.reset();\r\n await this.editPropBtn.dispose();\r\n await this.removePropBtn.dispose();\r\n await this._modal.dispose();\r\n this.data = {};\r\n }\r\n setEditUI() {\r\n var _a, _b, _c, _d, _e, _f, _g, _h;\r\n const { model, expressID } = this.data;\r\n const properties = model === null || model === void 0 ? void 0 : model.properties;\r\n if (!model || !expressID || !properties)\r\n return;\r\n this._modal.onAccept.reset();\r\n this._modal.title = \"Edit Property\";\r\n const editUI = new SimpleUIComponent(this._components, ``);\r\n const nameInput = new TextInput(this._components);\r\n nameInput.label = \"Name\";\r\n const valueInput = new TextInput(this._components);\r\n valueInput.label = \"Value\";\r\n this._modal.onAccept.add(async () => {\r\n this._modal.visible = false;\r\n await this.onEditProp.trigger({\r\n model,\r\n expressID,\r\n name: nameInput.value,\r\n value: valueInput.value,\r\n });\r\n });\r\n editUI.addChild(nameInput, valueInput);\r\n const prop = properties[expressID];\r\n const { key: nameKey } = IfcPropertiesUtils.getEntityName(properties, expressID);\r\n if (nameKey) {\r\n nameInput.value = (_b = (_a = prop[nameKey]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : \"\";\r\n }\r\n else {\r\n nameInput.value = (_d = (_c = prop.Name) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : \"\";\r\n }\r\n const { key: valueKey } = IfcPropertiesUtils.getQuantityValue(properties, expressID);\r\n if (valueKey) {\r\n valueInput.value = (_f = (_e = prop[valueKey]) === null || _e === void 0 ? void 0 : _e.value) !== null && _f !== void 0 ? _f : \"\";\r\n }\r\n else {\r\n valueInput.value = (_h = (_g = prop.NominalValue) === null || _g === void 0 ? void 0 : _g.value) !== null && _h !== void 0 ? _h : \"\";\r\n }\r\n this._modal.setSlot(\"content\", editUI);\r\n this._modal.visible = true;\r\n }\r\n setRemoveUI() {\r\n const { model, expressID, setID } = this.data;\r\n if (!model || !expressID || !setID)\r\n return;\r\n const removeUI = new SimpleUIComponent(this._components, ``);\r\n const warningText = document.createElement(\"div\");\r\n warningText.className = \"text-base text-center\";\r\n warningText.textContent =\r\n \"Are you sure to delete this property? This action can't be undone.\";\r\n removeUI.get().append(warningText);\r\n this._modal.onAccept.add(async () => {\r\n this._modal.visible = false;\r\n this.removeFromParent(); // As the psetUI is going to be disposed, then we need to first remove the action buttons so they do not become disposed as well.\r\n await this.onRemoveProp.trigger({ model, expressID, setID });\r\n });\r\n this._modal.setSlot(\"content\", removeUI);\r\n this._modal.visible = true;\r\n }\r\n}\r\n//# sourceMappingURL=prop-actions.js.map","import * as WEBIFC from \"web-ifc\";\r\nimport { Component, Event, UIElement } from \"../../base-types\";\r\nimport { ToolComponent } from \"../../core\";\r\nimport { generateIfcGUID } from \"../../utils\";\r\nimport { IfcPropertiesUtils } from \"../IfcPropertiesUtils\";\r\nimport { EntityActionsUI } from \"./src/entity-actions\";\r\nimport { PsetActionsUI } from \"./src/pset-actions\";\r\nimport { PropActionsUI } from \"./src/prop-actions\";\r\nimport { Button } from \"../../ui\";\r\nimport { FragmentIfcLoader } from \"../../fragments/FragmentIfcLoader\";\r\nexport class IfcPropertiesManager extends Component {\r\n constructor(components) {\r\n super(components);\r\n /** {@link Disposable.onDisposed} */\r\n this.onDisposed = new Event();\r\n this.onRequestFile = new Event();\r\n this.ifcToExport = null;\r\n this.onElementToPset = new Event();\r\n this.onPropToPset = new Event();\r\n this.onPsetRemoved = new Event();\r\n this.onDataChanged = new Event();\r\n this.wasm = {\r\n path: \"/\",\r\n absolute: false,\r\n };\r\n this.enabled = true;\r\n this.attributeListeners = {};\r\n this.uiElement = new UIElement();\r\n this._changeMap = {};\r\n this.components.tools.add(IfcPropertiesManager.uuid, this);\r\n // TODO: Save original IFC file so that opening it again is not necessary\r\n if (components.uiEnabled) {\r\n this.setUI(components);\r\n this.setUIEvents();\r\n }\r\n }\r\n get() {\r\n return this._changeMap;\r\n }\r\n async dispose() {\r\n this.selectedModel = undefined;\r\n this.attributeListeners = {};\r\n this._changeMap = {};\r\n this.onElementToPset.reset();\r\n this.onPropToPset.reset();\r\n this.onPsetRemoved.reset();\r\n this.onDataChanged.reset();\r\n await this.uiElement.dispose();\r\n await this.onDisposed.trigger(IfcPropertiesManager.uuid);\r\n this.onDisposed.reset();\r\n }\r\n setUI(components) {\r\n const exportButton = new Button(components);\r\n exportButton.tooltip = \"Export IFC\";\r\n exportButton.materialIcon = \"exit_to_app\";\r\n exportButton.onClick.add(async () => {\r\n await this.onRequestFile.trigger();\r\n if (!this.ifcToExport || !this.selectedModel)\r\n return;\r\n const fileData = new Uint8Array(this.ifcToExport);\r\n const name = this.selectedModel.name;\r\n const resultBuffer = await this.saveToIfc(this.selectedModel, fileData);\r\n const resultFile = new File([new Blob([resultBuffer])], name);\r\n const link = document.createElement(\"a\");\r\n link.download = name;\r\n link.href = URL.createObjectURL(resultFile);\r\n link.click();\r\n link.remove();\r\n });\r\n this.uiElement.set({\r\n exportButton,\r\n entityActions: new EntityActionsUI(components),\r\n psetActions: new PsetActionsUI(components),\r\n propActions: new PropActionsUI(components),\r\n });\r\n }\r\n setUIEvents() {\r\n const entityActions = this.uiElement.get(\"entityActions\");\r\n const propActions = this.uiElement.get(\"propActions\");\r\n const psetActions = this.uiElement.get(\"psetActions\");\r\n entityActions.onNewPset.add(async ({ model, elementIDs, name, description }) => {\r\n const { pset } = await this.newPset(model, name, description === \"\" ? undefined : description);\r\n for (const expressID of elementIDs !== null && elementIDs !== void 0 ? elementIDs : []) {\r\n await this.addElementToPset(model, pset.expressID, expressID);\r\n }\r\n entityActions.cleanData();\r\n });\r\n propActions.onEditProp.add(async ({ model, expressID, name, value }) => {\r\n var _a, _b;\r\n const { properties } = IfcPropertiesManager.getIFCInfo(model);\r\n const prop = properties[expressID];\r\n const { key: valueKey } = IfcPropertiesUtils.getQuantityValue(properties, expressID);\r\n const { key: nameKey } = IfcPropertiesUtils.getEntityName(properties, expressID);\r\n if (name !== \"\" && nameKey) {\r\n if ((_a = prop[nameKey]) === null || _a === void 0 ? void 0 : _a.value) {\r\n prop[nameKey].value = name;\r\n }\r\n else {\r\n prop.Name = { type: 1, value: name };\r\n }\r\n }\r\n if (value !== \"\" && valueKey) {\r\n if ((_b = prop[valueKey]) === null || _b === void 0 ? void 0 : _b.value) {\r\n prop[valueKey].value = value;\r\n }\r\n else {\r\n prop.NominalValue = { type: 1, value }; // Need to change type based on property 1:STRING, 2: LABEL, 3: ENUM, 4: REAL\r\n }\r\n }\r\n await this.registerChange(model, expressID);\r\n propActions.cleanData();\r\n });\r\n propActions.onRemoveProp.add(async ({ model, expressID, setID }) => {\r\n await this.removePsetProp(model, setID, expressID);\r\n propActions.cleanData();\r\n });\r\n psetActions.onEditPset.add(async ({ model, psetID, name, description }) => {\r\n var _a, _b;\r\n const { properties } = IfcPropertiesManager.getIFCInfo(model);\r\n const pset = properties[psetID];\r\n if (name !== \"\") {\r\n if ((_a = pset.Name) === null || _a === void 0 ? void 0 : _a.value) {\r\n pset.Name.value = name;\r\n }\r\n else {\r\n pset.Name = { type: 1, value: name };\r\n }\r\n }\r\n if (description !== \"\") {\r\n if ((_b = pset.Description) === null || _b === void 0 ? void 0 : _b.value) {\r\n pset.Description.value = description;\r\n }\r\n else {\r\n pset.Description = { type: 1, value: description };\r\n }\r\n }\r\n await this.registerChange(model, psetID);\r\n });\r\n psetActions.onRemovePset.add(async ({ model, psetID }) => {\r\n await this.removePset(model, psetID);\r\n });\r\n psetActions.onNewProp.add(async ({ model, psetID, name, type, value }) => {\r\n const prop = await this.newSingleStringProperty(model, type, name, value);\r\n await this.addPropToPset(model, psetID, prop.expressID);\r\n });\r\n }\r\n increaseMaxID(model) {\r\n model.ifcMetadata.maxExpressID++;\r\n return model.ifcMetadata.maxExpressID;\r\n }\r\n static getIFCInfo(model) {\r\n const properties = model.properties;\r\n if (!properties)\r\n throw new Error(\"FragmentsGroup properties not found\");\r\n const schema = model.ifcMetadata.schema;\r\n if (!schema)\r\n throw new Error(\"IFC Schema not found\");\r\n return { properties, schema };\r\n }\r\n newGUID(model) {\r\n const { schema } = IfcPropertiesManager.getIFCInfo(model);\r\n return new WEBIFC[schema].IfcGloballyUniqueId(generateIfcGUID());\r\n }\r\n getOwnerHistory(model) {\r\n const { properties } = IfcPropertiesManager.getIFCInfo(model);\r\n const ownerHistory = IfcPropertiesUtils.findItemOfType(properties, WEBIFC.IFCOWNERHISTORY);\r\n if (!ownerHistory)\r\n throw new Error(\"No OwnerHistory was found.\");\r\n const ownerHistoryHandle = new WEBIFC.Handle(ownerHistory.expressID);\r\n return { ownerHistory, ownerHistoryHandle };\r\n }\r\n async registerChange(model, ...expressID) {\r\n if (!this._changeMap[model.uuid]) {\r\n this._changeMap[model.uuid] = new Set();\r\n }\r\n for (const id of expressID) {\r\n this._changeMap[model.uuid].add(id);\r\n await this.onDataChanged.trigger({ model, expressID: id });\r\n }\r\n }\r\n async setData(model, ...dataToSave) {\r\n const { properties } = IfcPropertiesManager.getIFCInfo(model);\r\n for (const data of dataToSave) {\r\n const expressID = data.expressID;\r\n if (!expressID)\r\n continue;\r\n properties[expressID] = data;\r\n await this.registerChange(model, expressID);\r\n }\r\n }\r\n async newPset(model, name, description) {\r\n const { schema } = IfcPropertiesManager.getIFCInfo(model);\r\n const { ownerHistoryHandle } = this.getOwnerHistory(model);\r\n // Create the Pset\r\n const psetGlobalId = this.newGUID(model);\r\n const psetName = new WEBIFC[schema].IfcLabel(name);\r\n const psetDescription = description\r\n ? new WEBIFC[schema].IfcText(description)\r\n : null;\r\n const pset = new WEBIFC[schema].IfcPropertySet(psetGlobalId, ownerHistoryHandle, psetName, psetDescription, []);\r\n pset.expressID = this.increaseMaxID(model);\r\n // Create the Pset relation\r\n const relGlobalId = this.newGUID(model);\r\n const rel = new WEBIFC[schema].IfcRelDefinesByProperties(relGlobalId, ownerHistoryHandle, null, null, [], new WEBIFC.Handle(pset.expressID));\r\n rel.expressID = this.increaseMaxID(model);\r\n await this.setData(model, pset, rel);\r\n return { pset, rel };\r\n }\r\n async removePset(model, ...psetID) {\r\n const { properties } = IfcPropertiesManager.getIFCInfo(model);\r\n for (const expressID of psetID) {\r\n const pset = properties[expressID];\r\n if ((pset === null || pset === void 0 ? void 0 : pset.type) !== WEBIFC.IFCPROPERTYSET)\r\n continue;\r\n const relID = IfcPropertiesUtils.getPsetRel(properties, expressID);\r\n if (relID) {\r\n delete properties[relID];\r\n await this.registerChange(model, relID);\r\n }\r\n if (pset) {\r\n for (const propHandle of pset.HasProperties)\r\n delete properties[propHandle.value];\r\n delete properties[expressID];\r\n await this.onPsetRemoved.trigger({ model, psetID: expressID });\r\n await this.registerChange(model, expressID);\r\n }\r\n }\r\n }\r\n async newSingleProperty(model, type, name, value) {\r\n const { schema } = IfcPropertiesManager.getIFCInfo(model);\r\n const propName = new WEBIFC[schema].IfcIdentifier(name);\r\n // @ts-ignore\r\n const propValue = new WEBIFC[schema][type](value);\r\n const prop = new WEBIFC[schema].IfcPropertySingleValue(propName, null, propValue, null);\r\n prop.expressID = this.increaseMaxID(model);\r\n await this.setData(model, prop);\r\n return prop;\r\n }\r\n newSingleStringProperty(model, type, name, value) {\r\n return this.newSingleProperty(model, type, name, value);\r\n }\r\n newSingleNumericProperty(model, type, name, value) {\r\n return this.newSingleProperty(model, type, name, value);\r\n }\r\n newSingleBooleanProperty(model, type, name, value) {\r\n return this.newSingleProperty(model, type, name, value);\r\n }\r\n async removePsetProp(model, psetID, propID) {\r\n const { properties } = IfcPropertiesManager.getIFCInfo(model);\r\n const pset = properties[psetID];\r\n const prop = properties[propID];\r\n if (!(pset.type === WEBIFC.IFCPROPERTYSET && prop))\r\n return;\r\n pset.HasProperties = pset.HasProperties.filter((handle) => {\r\n return handle.value !== propID;\r\n });\r\n delete properties[propID];\r\n await this.registerChange(model, psetID, propID);\r\n }\r\n async addElementToPset(model, psetID, ...elementID) {\r\n const { properties } = IfcPropertiesManager.getIFCInfo(model);\r\n const relID = IfcPropertiesUtils.getPsetRel(properties, psetID);\r\n if (!relID)\r\n return;\r\n const rel = properties[relID];\r\n for (const expressID of elementID) {\r\n const elementHandle = new WEBIFC.Handle(expressID);\r\n rel.RelatedObjects.push(elementHandle);\r\n await this.onElementToPset.trigger({\r\n model,\r\n psetID,\r\n elementID: expressID,\r\n });\r\n }\r\n await this.registerChange(model, psetID);\r\n }\r\n async addPropToPset(model, psetID, ...propID) {\r\n const { properties } = IfcPropertiesManager.getIFCInfo(model);\r\n const pset = properties[psetID];\r\n if (!pset)\r\n return;\r\n for (const expressID of propID) {\r\n if (pset.HasProperties.includes(expressID)) {\r\n continue;\r\n }\r\n const elementHandle = new WEBIFC.Handle(expressID);\r\n pset.HasProperties.push(elementHandle);\r\n await this.onPropToPset.trigger({ model, psetID, propID: expressID });\r\n }\r\n await this.registerChange(model, psetID);\r\n }\r\n async saveToIfc(model, ifcToSaveOn) {\r\n var _a;\r\n const { properties } = IfcPropertiesManager.getIFCInfo(model);\r\n const ifcLoader = this.components.tools.get(FragmentIfcLoader);\r\n const ifcApi = ifcLoader.get();\r\n const modelID = await ifcLoader.readIfcFile(ifcToSaveOn);\r\n const changes = (_a = this._changeMap[model.uuid]) !== null && _a !== void 0 ? _a : [];\r\n for (const expressID of changes) {\r\n const data = properties[expressID];\r\n if (!data) {\r\n try {\r\n ifcApi.DeleteLine(modelID, expressID);\r\n }\r\n catch (err) {\r\n // Nothing here...\r\n }\r\n }\r\n else {\r\n try {\r\n ifcApi.WriteLine(modelID, data);\r\n }\r\n catch (err) {\r\n // Nothing here...\r\n }\r\n }\r\n }\r\n const modifiedIFC = ifcApi.SaveModel(modelID);\r\n ifcLoader.get().CloseModel(modelID);\r\n ifcLoader.cleanIfcApi();\r\n return modifiedIFC;\r\n }\r\n setAttributeListener(model, expressID, attributeName) {\r\n if (!this.attributeListeners[model.uuid])\r\n this.attributeListeners[model.uuid] = {};\r\n const existingListener = this.attributeListeners[model.uuid][expressID]\r\n ? this.attributeListeners[model.uuid][expressID][attributeName]\r\n : null;\r\n if (existingListener)\r\n return existingListener;\r\n const { properties } = IfcPropertiesManager.getIFCInfo(model);\r\n const entity = properties[expressID];\r\n if (!entity) {\r\n throw new Error(`Entity with expressID ${expressID} doesn't exists.`);\r\n }\r\n const attribute = entity[attributeName];\r\n if (Array.isArray(attribute) || !attribute) {\r\n throw new Error(`Attribute ${attributeName} is array or null, and it can't have a listener.`);\r\n }\r\n const value = attribute.value;\r\n if (value === undefined || value == null) {\r\n throw new Error(`Attribute ${attributeName} has a badly defined handle.`);\r\n }\r\n // TODO: Is it good to set all the above as errors? Or better return null?\r\n // TODO: Do we need an async-await in the following set function?\r\n const event = new Event();\r\n Object.defineProperty(entity[attributeName], \"value\", {\r\n get() {\r\n return this._value;\r\n },\r\n async set(value) {\r\n this._value = value;\r\n await event.trigger(value);\r\n },\r\n });\r\n entity[attributeName].value = value;\r\n if (!this.attributeListeners[model.uuid][expressID])\r\n this.attributeListeners[model.uuid][expressID] = {};\r\n this.attributeListeners[model.uuid][expressID][attributeName] = event;\r\n return event;\r\n }\r\n}\r\nIfcPropertiesManager.uuid = \"58c2d9f0-183c-48d6-a402-dfcf5b9a34df\";\r\nToolComponent.libraryUUIDs.add(IfcPropertiesManager.uuid);\r\n//# sourceMappingURL=index.js.map"],"names":["EntityActionsUI","constructor","components","super","this","onNewPset","data","addPsetBtn","_components","materialIconName","onClick","add","async","_nameInput","value","_descriptionInput","modal","visible","addChild","Modal","ui","onHidden","removeFromParent","addPsetUI","setSlot","label","onAccept","name","description","model","elementIDs","trigger","onCancel","onlyChildren","dispose","reset","PsetActionsUI","modalVisible","onEditPset","onRemovePset","onNewProp","_modal","slots","content","editPsetBtn","materialIcon","setEditUI","removePsetBtn","setRemoveUI","addPropBtn","setAddPropUI","_a","_b","_c","_d","psetID","properties","title","editUI","nameInput","descriptionInput","entity","Name","Description","removeUI","warningText","document","createElement","className","textContent","get","append","addPropUI","typeInput","addOption","valueInput","type","PropActionsUI","onEditProp","onRemoveProp","editPropBtn","removePropBtn","_e","_f","_g","_h","expressID","prop","key","nameKey","IfcPropertiesUtils","valueKey","NominalValue","setID","IfcPropertiesManager","onDisposed","onRequestFile","ifcToExport","onElementToPset","onPropToPset","onPsetRemoved","onDataChanged","wasm","path","absolute","enabled","attributeListeners","uiElement","_changeMap","tools","uuid","uiEnabled","setUI","setUIEvents","selectedModel","undefined","exportButton","tooltip","fileData","Uint8Array","resultBuffer","saveToIfc","resultFile","File","Blob","link","download","href","URL","createObjectURL","click","remove","set","entityActions","psetActions","propActions","pset","newPset","addElementToPset","cleanData","getIFCInfo","registerChange","removePsetProp","removePset","newSingleStringProperty","addPropToPset","increaseMaxID","ifcMetadata","maxExpressID","static","Error","schema","newGUID","IfcGloballyUniqueId","getOwnerHistory","ownerHistory","ownerHistoryHandle","Set","id","dataToSave","psetGlobalId","psetName","IfcLabel","psetDescription","IfcText","IfcPropertySet","relGlobalId","rel","IfcRelDefinesByProperties","setData","relID","propHandle","HasProperties","propName","IfcIdentifier","propValue","IfcPropertySingleValue","newSingleProperty","newSingleNumericProperty","newSingleBooleanProperty","propID","filter","handle","elementID","elementHandle","RelatedObjects","push","includes","ifcToSaveOn","ifcLoader","FragmentIfcLoader","ifcApi","modelID","readIfcFile","changes","WriteLine","err","DeleteLine","modifiedIFC","SaveModel","CloseModel","cleanIfcApi","setAttributeListener","attributeName","existingListener","attribute","Array","isArray","event","Object","defineProperty","_value"],"sourceRoot":""}