/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
import{E as i,c as t}from"./p-Dc9KNUUp.js";function n(i){return(i===null||i===void 0?void 0:i.type)==="text"}function e(i){return(i===null||i===void 0?void 0:i.type)==="icon"}function s(i){return typeof i==="string"?i:t.toHexString(i)}function r(i){var t,n,e,r,l,u,o,d;return{primaryColor:((n=(t=i===null||i===void 0?void 0:i.attributes)===null||t===void 0?void 0:t.style)===null||n===void 0?void 0:n.primaryColor)==null?undefined:s((r=(e=i===null||i===void 0?void 0:i.attributes)===null||e===void 0?void 0:e.style)===null||r===void 0?void 0:r.primaryColor),accentColor:((u=(l=i===null||i===void 0?void 0:i.attributes)===null||l===void 0?void 0:l.style)===null||u===void 0?void 0:u.accentColor)==null?undefined:s((d=(o=i===null||i===void 0?void 0:i.attributes)===null||o===void 0?void 0:o.style)===null||d===void 0?void 0:d.accentColor)}}class l{constructor(){this.entities={};this.entityAdded=new i;this.entityUpdated=new i;this.entitiesChanged=new i;this.selectionChanged=new i}addPin(i,t=false){if(this.entities[i.id]==null){this.entities={...this.entities,[i.id]:i};if(!t){this.entitiesChanged.emit(this.getPins());this.entityAdded.emit(i)}return true}else{return false}}clearPins(){this.getPins().forEach((i=>this.removePin(i)))}getPins(){return Object.keys(this.entities).map((i=>this.entities[i]))}getPinById(i){return this.entities[i]}getSelectedPinId(){return this.selectedPinId}removePin(i){if(this.entities[i.id]!=null){delete this.entities[i.id];this.entitiesChanged.emit(this.getPins());return true}else{return false}}setPins(i){this.clearPins();i.forEach((i=>this.addPin(i,true)));this.entitiesChanged.emit(this.getPins());return true}setPin(i){const t=this.entities[i.id]==null;this.entities={...this.entities,[i.id]:i};this.entitiesChanged.emit(this.getPins());if(t){this.entityAdded.emit(i)}return true}updatePin(i){const t=this.getPinById(i.id);if(t!=null){this.entities={...this.entities,[i.id]:i};this.entitiesChanged.emit(this.getPins());this.entityUpdated.emit(i);return true}return false}onEntitiesChanged(i){return this.entitiesChanged.on(i)}onEntityAdded(i){return this.entityAdded.on(i)}onEntityUpdated(i){return this.entityUpdated.on(i)}onSelectionChange(i){return this.selectionChanged.on(i)}setSelectedPin(i){this.selectedPinId=i;this.selectionChanged.emit(this.selectedPinId)}}export{l as P,n as a,r as g,e as i};
//# sourceMappingURL=p-zxYMoA6A.js.map