var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return e(t,r)};return function(t,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function i(){this.constructor=t}t.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();import{R as ReferenceField}from"./reference-field-a5b414d1.js";import{B as BaseField}from"./BaseField-0b01dc2c.js";import"./index-61dcd269.js";import{M as MultipleChoiceField}from"./index-4e451db4.js";import{h}from"./index-ecdfb761.js";import{r as registerField}from"./FieldGenerator-3ae403b2.js";import{S as SingleChoiceField}from"./index-23baeeef.js";import{S as SubFormField}from"./index-09efdc01.js";import{T as TextField}from"./index-150b6a59.js";import{D as DateField}from"./date-1bc489bd.js";var NumberField=function(e){__extends(t,e);function t(t,r,i,n,o,a,d){if(o===void 0){o=1}if(a===void 0){a=-Infinity}if(d===void 0){d=Infinity}var c=e.call(this,t,"number")||this;c.title=r;c.placeholder=i;c.description=n;c.step=o;c.min=a;c.max=d;return c}t.prototype.showPreview=function(){this.preview=true;return this};t.prototype.getDisplayValue=function(e){return e};return t}(BaseField);NumberField.type="number";var render$2=function(e,t,r,i,n,o){return h("dvn-field-input-number",{disabled:i,field:e,errors:r,onChange:function(t){return n(e,Number(t.detail))},onBlur:function(){return o(e)},value:t})};registerField("number",render$2);var RangeField=function(e){__extends(t,e);function t(t,r,i,n,o,a){if(n===void 0){n=1}if(o===void 0){o=0}if(a===void 0){a=5}var d=e.call(this,t,"range")||this;d.title=r;d.description=i;d.step=n;d.min=o;d.max=a;return d}t.prototype.showPreview=function(){this.preview=true;return this};t.prototype.getDisplayValue=function(e){return e};t.prototype.setInputType=function(e){this.inputType=e;return this};return t}(BaseField);RangeField.type="range";var render$1=function(e,t,r,i,n,o){return h("dvn-field-input-range",{disabled:i,field:e,errors:r,onChange:function(t){return n(e,Number(t.detail))},onBlur:function(){return o(e)},value:t})};registerField("range",render$1);var SectionHeaderField=function(e){__extends(t,e);function t(t,r,i){var n=e.call(this,t,"sectionHeader")||this;n.id=t;n.header=r;n.sectionDescription=i;return n}return t}(BaseField);SectionHeaderField.type="sectionHeader";var render=function(e,t,r,i,n,o){return h("dvn-field-input-section-header",{disabled:i,field:e,onChange:function(t){return n(e,t)},onBlur:function(){return o(e)}})};registerField("sectionHeader",render);function generateFieldModelFromRawData(e){if(!e){return undefined}switch(e.type){case DateField.type:return Object.assign(Object.create(DateField.prototype),e);case MultipleChoiceField.type:return Object.assign(Object.create(MultipleChoiceField.prototype),e);case NumberField.type:return Object.assign(Object.create(NumberField.prototype),e);case RangeField.type:return Object.assign(Object.create(RangeField.prototype),e);case SectionHeaderField.type:return Object.assign(Object.create(SectionHeaderField.prototype),e);case SingleChoiceField.type:return Object.assign(Object.create(SingleChoiceField.prototype),e);case SubFormField.type:return Object.assign(Object.create(SubFormField.prototype),e);case TextField.type:return Object.assign(Object.create(TextField.prototype),e);case ReferenceField.type:return Object.assign(Object.create(ReferenceField.prototype),e);default:return Object.assign(Object.create(BaseField.prototype),e)}}export{NumberField as N,RangeField as R,generateFieldModelFromRawData as g};