import{r as t,h as s,g as e}from"./p-3ba9c73c.js";import{B as i}from"./p-89b88b6d.js";import{l as o}from"./p-2b74e80e.js";import{E as h}from"./p-b72d14f0.js";const r=class{constructor(s){t(this,s),this.metadata={},this.optionIcon=i.ICON_MAP.icon,this.question="",this.required=!1,this.options=[{text:"fas:sad-tear",color:"#ef8b54"},{text:"fas:frown-open",color:"#f3ac4c"},{text:"fas:meh",color:"#f6d24c"},{text:"fas:grin",color:"#d7f18e"},{text:"fas:laugh",color:"#aad77e"}],this.labelQuestion="Formulate your question",this.labelRequired="Required",this.labelOCAddButton="Add",this.labelOCRemoveButton="Delete",this.labelOCOther="Other",this.labelOCImage="Image",this.placeholderOptions="Icon",this._link=o(this,this.handleInput),this._question=this._link("question"),this._required=this._link("required"),this._options=this._link("options")}handleInput(t,s){const e=s.target;e&&(s.cancelBubble=!0,this[t]=e.value,this.value=this.updateValue({[t]:e.value}),this.el.dispatchEvent(new Event("input",{bubbles:!0})))}updateValue(t={}){const s={question:this.question,required:this.required,options:this.options,metadata:Object.assign({},this.metadata)};return Object.assign({},s,t)}componentDidLoad(){this.value=this.updateValue(),this.el.dispatchEvent(new Event("input",{bubbles:!0}))}render(){const t=Object.assign({icon:this.options.map(t=>t.text||this.optionIcon),labelOCAddButton:this.labelOCAddButton,labelOCRemoveButton:this.labelOCRemoveButton,labelOCOther:this.labelOCOther,labelOCImage:this.labelOCImage,allowImage:!1,allowColor:!0},this._options);return s(h,{question:this._question,required:this._required},s("bce-option-creator",Object.assign({},t)))}get el(){return e(this)}};export{r as bce_element_icon_template};