import{r as t,h as e,g as s}from"./p-3ba9c73c.js";import{B as i}from"./p-4aa42112.js";import{l as h}from"./p-2b74e80e.js";import{E as r}from"./p-b72d14f0.js";const o=class{constructor(e){t(this,e),this.optionIcon=i.ICON_MAP[i.Type.Sort],this.question="",this.required=!1,this.dual=!1,this.options=[],this.feedbackCorrect="",this.feedbackIncorrect="",this.labelQuestion="Formulate your question",this.labelRequired="Required",this.labelOCAddButton="Add",this.labelOCRemoveButton="Delete",this.labelOCOther="Other",this.labelOCImage="Image",this.labelDual="Dual",this.labelFeedbackCorrect="Feedback correct",this.labelFeedbackIncorrect="Feedback incorrect",this.placeholderOptions="Option",this.placeholderFeedbackCorrect="Feedback on correct answer",this.placeholderFeedbackIncorrect="Feedback on incorrect answer",this._link=h(this,this.handleInput),this._question=this._link("question"),this._required=this._link("required"),this._dual=this._link("dual"),this._options=this._link("options"),this._feedbackCorrect=this._link("feedbackCorrect"),this._feedbackIncorrect=this._link("feedbackIncorrect")}handleInput(t,e){const s=e.target;s&&(e.cancelBubble=!0,this[t]=s.value,this.value=this.updateValue({[t]:s.value}),this.el.dispatchEvent(new Event("input",{bubbles:!0})))}updateValue(t={}){return Object.assign({},{question:this.question,required:this.required,dual:this.dual,options:this.options,feedbackCorrect:this.feedbackCorrect,feedbackIncorrect:this.feedbackIncorrect},t)}componentDidLoad(){this.value=this.updateValue(),this.el.dispatchEvent(new Event("input",{bubbles:!0}))}render(){const t=Object.assign({icon:this.optionIcon,labelOCAddButton:this.labelOCAddButton,labelOCRemoveButton:this.labelOCRemoveButton,labelOCOther:this.labelOCOther,labelOCImage:this.labelOCImage},this._options);return e(r,{question:this._question,required:this._required},e("bce-option-creator",Object.assign({},t)),e("bce-input",Object.assign({type:"switch"},this._dual)),e("bce-input",Object.assign({type:"textarea"},this._feedbackCorrect)),e("bce-input",Object.assign({type:"textarea"},this._feedbackIncorrect)))}get el(){return s(this)}};export{o as bce_element_sort_template};