/*!
 * KoliBri - The accessible HTML-Standard
 */
import{_ as i}from"./tslib.es6-CxX45GIN.js";import{h as e}from"./index-C_yiBYg2.js";import{I as t}from"./Input-D-VKrBBS.js";import{g as n}from"./FormFieldStateWrapper-Cj4-CJCr.js";const s=s=>{var{id:t,suggestions:a}=s,n=i(s,["id","suggestions"]);return a?e("datalist",Object.assign({id:`${t}-list`},n),a.map(i=>e("option",{value:i}))):null};function r(i,t,a){var r;const _=[...n(i).ariaDescribedBy,...null!==(r=t.ariaDescribedBy)&&void 0!==r?r:[]],o={id:i._id,hideLabel:i._hideLabel,label:i._label,disabled:i._disabled,name:i._name};if("_accessKey"in i&&(o.accessKey=i._accessKey),"_type"in i&&(o.type=i._type),"_value"in i&&(o.value=i._value),"_required"in i&&(o.required=i._required),"_maxLength"in i&&"_maxLengthBehavior"in i&&"hard"===i._maxLengthBehavior&&(o.maxlength=i._maxLength),"_placeholder"in i&&(o.placeholder=i._placeholder),"_autoComplete"in i&&(o.autoComplete=i._autoComplete),"_spellCheck"in i&&(o.spellcheck=i._spellCheck),"_pattern"in i&&(o.pattern=i._pattern),"_readOnly"in i&&(o.readonly=i._readOnly),"_min"in i&&(o.min=i._min),"_max"in i&&(o.max=i._max),"_step"in i&&(o.step=i._step),"_multiple"in i&&(o.multiple=i._multiple),"_checked"in i&&(o.checked=i._checked),"_indeterminate"in i&&(o.indeterminate=i._indeterminate),"_touched"in i&&(o.touched=i._touched),"_msg"in i&&(o.msg=i._msg),"_shortKey"in i&&(o["aria-keyshortcuts"]=i._shortKey),"_suggestions"in i&&!a){Array.isArray(i._suggestions)&&i._suggestions.length>0&&(o.suggestions=e(s,{id:i._id,suggestions:i._suggestions}))}return Object.assign(Object.assign(Object.assign({},o),t),{ariaDescribedBy:_})}const a=s=>{var{state:a,customSuggestions:n}=s,_=i(s,["state","customSuggestions"]);return e(t,Object.assign({},r(a,_,n)))};export{a as I,s as S};