Packages

Phoenix component that utilizes Lea Verou's autocomplete autosuggest accessible (WCAG 2) Awesomplete widget, featuring dynamic data loading

Current section

Files

Jump to
phoenix_form_awesomplete priv static awesomplete_bundle.min.mjs
Raw

priv/static/awesomplete_bundle.min.mjs

var at=Object.create;var nt=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var pt=Object.getPrototypeOf,ht=Object.prototype.hasOwnProperty;var rt=(l,o)=>()=>(o||l((o={exports:{}}).exports,o),o.exports);var dt=(l,o,h,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of ct(o))!ht.call(l,s)&&s!==h&&nt(l,s,{get:()=>o[s],enumerable:!(m=ft(o,s))||m.enumerable});return l};var st=(l,o,h)=>(h=l!=null?at(pt(l)):{},dt(o||!l||!l.__esModule?nt(h,"default",{value:l,enumerable:!0}):h,l));var lt=rt((Ct,Q)=>{(function(){var l=function(i,r){var f=this;l.count=(l.count||0)+1,this.count=l.count,this.isOpened=!1,this.input=s(i),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-autocomplete","list"),this.input.setAttribute("aria-expanded","false"),this.input.setAttribute("aria-controls","awesomplete_list_"+this.count),this.input.setAttribute("role","combobox"),this.options=r=r||{},h(this,{minChars:2,maxItems:10,autoFirst:!1,data:l.DATA,filter:l.FILTER_CONTAINS,sort:r.sort===!1?!1:l.SORT_BYLENGTH,container:l.CONTAINER,item:l.ITEM,replace:l.REPLACE,tabSelect:!1,listLabel:"Results List",statusNoResults:"No results found",statusXResults:"{0} results found",statusTypeXChar:"Type {0} or more characters for results"},r),this.index=-1,this.container=this.container(i),this.ul=s.create("ul",{hidden:"hidden",role:"listbox",id:"awesomplete_list_"+this.count,inside:this.container,"aria-label":this.listLabel}),this.status=s.create("span",{className:"visually-hidden",role:"status","aria-live":"assertive","aria-atomic":!0,inside:this.container,textContent:""}),this._events={input:{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:"blur"}),keydown:function(a){var p=a.keyCode;f.opened&&(p===13&&f.selected||p===9&&f.selected&&f.tabSelect?(a.preventDefault(),f.select(void 0,void 0,a)):p===27?f.close({reason:"esc"}):(p===38||p===40)&&(a.preventDefault(),f[p===38?"previous":"next"]()))}},form:{submit:this.close.bind(this,{reason:"submit"})},ul:{mousedown:function(a){a.preventDefault()},click:function(a){var p=a.target;if(p!==this){for(;p&&!/li/i.test(p.nodeName);)p=p.parentNode;p&&a.button===0&&(a.preventDefault(),f.select(p,a.target,a))}}}},s.bind(this.input,this._events.input),s.bind(this.input.form,this._events.form),s.bind(this.ul,this._events.ul),this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||r.list||[],l.all.push(this)};l.prototype={set list(i){if(Array.isArray(i))this._list=i;else if(typeof i=="string"&&i.indexOf(",")>-1)this._list=i.split(/\s*,\s*/);else if(i=s(i),i&&i.children){var r=[];m.apply(i.children).forEach(function(f){if(!f.disabled){var a=f.textContent.trim(),p=f.value||a,E=f.label||a;p!==""&&r.push({label:E,value:p})}}),this._list=r}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return this.isOpened},close:function(i){this.opened&&(this.input.setAttribute("aria-expanded","false"),this.ul.setAttribute("hidden",""),this.isOpened=!1,this.index=-1,this.status.setAttribute("hidden",""),this.input.setAttribute("aria-activedescendant",""),s.fire(this.input,"awesomplete-close",i||{}))},open:function(){this.input.setAttribute("aria-expanded","true"),this.ul.removeAttribute("hidden"),this.isOpened=!0,this.status.removeAttribute("hidden"),this.autoFirst&&this.index===-1&&this.goto(0),s.fire(this.input,"awesomplete-open")},destroy:function(){if(s.unbind(this.input,this._events.input),s.unbind(this.input.form,this._events.form),!this.options.container){var i=this.container.parentNode;i.insertBefore(this.input,this.container),i.removeChild(this.container)}this.input.removeAttribute("autocomplete"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("role");var r=l.all.indexOf(this);r!==-1&&l.all.splice(r,1)},next:function(){var i=this.ul.children.length;this.goto(this.index<i-1?this.index+1:i?0:-1)},previous:function(){var i=this.ul.children.length,r=this.index-1;this.goto(this.selected&&r!==-1?r:i-1)},goto:function(i){var r=this.ul.children;this.selected&&r[this.index].setAttribute("aria-selected","false"),this.index=i,i>-1&&r.length>0&&(r[i].setAttribute("aria-selected","true"),this.input.setAttribute("aria-activedescendant",this.ul.id+"_item_"+this.index),this.ul.scrollTop=r[i].offsetTop-this.ul.clientHeight+r[i].clientHeight,s.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(i,r,f){if(i?this.index=s.siblingIndex(i):i=this.ul.children[this.index],i){var a=this.suggestions[this.index],p=s.fire(this.input,"awesomplete-select",{text:a,origin:r||i,originalEvent:f});p&&(this.replace(a),this.close({reason:"select"}),s.fire(this.input,"awesomplete-selectcomplete",{text:a,originalEvent:f}))}},evaluate:function(){var i=this,r=this.input.value;r.length>=this.minChars&&this._list&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map(function(f){return new o(i.data(f,r))}).filter(function(f){return i.filter(f,r)}),this.sort!==!1&&(this.suggestions=this.suggestions.sort(this.sort)),this.suggestions=this.suggestions.slice(0,this.maxItems),this.suggestions.forEach(function(f,a){i.ul.appendChild(i.item(f,r,a))}),this.ul.children.length===0?(this.status.textContent=this.statusNoResults,this.close({reason:"nomatches"})):(this.input.setAttribute("aria-activedescendant",""),this.open(),this.status.textContent=this.statusXResults.replaceAll("{0}",this.ul.children.length))):(this.close({reason:"nomatches"}),this.minChar<=1||r.length>=this.minChars?this.status.textContent=this.statusNoResults:this.status.textContent=this.statusTypeXChar.replaceAll("{0}",this.minChars))}},l.all=[],l.FILTER_CONTAINS=function(i,r){return RegExp(s.regExpEscape(r.trim()),"i").test(i)},l.FILTER_STARTSWITH=function(i,r){return RegExp("^"+s.regExpEscape(r.trim()),"i").test(i)},l.SORT_BYLENGTH=function(i,r){return i.length!==r.length?i.length-r.length:i<r?-1:1},l.CONTAINER=function(i){return s.create("div",{className:"awesomplete",around:i})},l.ITEM=function(i,r,f){var a=r.trim()===""?i:i.replace(RegExp(s.regExpEscape(r.trim()),"gi"),"<mark>$&</mark>");return s.create("li",{innerHTML:a,role:"option","aria-selected":"false",tabindex:"-1",id:"awesomplete_list_"+this.count+"_item_"+f})},l.REPLACE=function(i){this.input.value=i.value},l.DATA=function(i){return i};function o(i){var r=Array.isArray(i)?{label:i[0],value:i[1]}:typeof i=="object"&&"label"in i&&"value"in i?i:{label:i,value:i};this.label=r.label||r.value,this.value=r.value}Object.defineProperty(o.prototype=Object.create(String.prototype),"length",{get:function(){return this.label.length}}),o.prototype.toString=o.prototype.valueOf=function(){return""+this.label};function h(i,r,f){for(var a in r){var p=r[a],E=i.input.getAttribute("data-"+a.toLowerCase());typeof p=="number"?i[a]=parseInt(E):p===!1?i[a]=E!==null:p instanceof Function?i[a]=null:i[a]=E,!i[a]&&i[a]!==0&&(i[a]=a in f?f[a]:p)}}var m=Array.prototype.slice;function s(i,r){return typeof i=="string"?(r||document).querySelector(i):i||null}function b(i,r){return m.call((r||document).querySelectorAll(i))}s.create=function(i,r){var f=document.createElement(i);for(var a in r){var p=r[a];if(a==="inside")s(p).appendChild(f);else if(a==="around"){var E=s(p);E.parentNode.insertBefore(f,E),f.appendChild(E),E.getAttribute("autofocus")!=null&&E.focus()}else a in f?f[a]=p:f.setAttribute(a,p)}return f},s.bind=function(i,r){if(i)for(var f in r){var a=r[f];f.split(/\s+/).forEach(function(p){i.addEventListener(p,a)})}},s.unbind=function(i,r){if(i)for(var f in r){var a=r[f];f.split(/\s+/).forEach(function(p){i.removeEventListener(p,a)})}},s.fire=function(i,r,f){var a=document.createEvent("HTMLEvents");a.initEvent(r,!0,!0);for(var p in f)a[p]=f[p];return i.dispatchEvent(a)},s.regExpEscape=function(i){return i.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},s.siblingIndex=function(i){for(var r=0;i=i.previousElementSibling;r++);return r};function v(){b("input.awesomplete").forEach(function(i){new l(i)})}return typeof self!="undefined"&&(self.Awesomplete=l),typeof Document!="undefined"&&(document.readyState!=="loading"?v():document.addEventListener("DOMContentLoaded",v)),l.$=s,l.$$=b,typeof Q=="object"&&Q.exports&&(Q.exports=l),l})()});var ot=rt((Rt,Y)=>{var ut=function(){var l="awesomplete-",o=l+"loadcomplete",h=l+"selectcomplete",m=l+"match",s=l+"prepop",b=l+"select",v="awe-found",i="awe-not-found",r=Awesomplete.$;function f(t){var e=Array.isArray(t)?{label:t[0],value:t[1]}:typeof t=="object"&&"label"in t&&"value"in t?t:{label:t,value:t};return{label:e.label||e.value,value:e.value}}function a(t,e,n){return r.fire(t,e,{detail:n})}function p(t,e){var n=t.input,u=n.classList,c=t.utilprops,d=c.selected,g=c.convertInput.call(t,n.value),_=t.opened,L=[],C=t._list,y,I,A,x;if(c.prepop=!1,C){for(x=0;x<C.length;x++)if(A=C[x],y=f(t.data(A,g)),t.maxItems===0&&(y.toString=function(){return""+this.label},t.filter(y,g)&&(_=!0)),I={input:{value:""}},t.replace.call(I,y),c.convertInput.call(t,I.input.value)===g){if(d&&d.value===y.value&&d.label===y.label){L=[A];break}L.push(A)}L.length>0?e?a(n,s,L):c.changed&&(c.prevSelected=L,u.remove(i),u.add(v),a(n,m,L)):e?a(n,s,[]):c.changed&&(c.prevSelected=[],u.remove(v),!_||n!==document.activeElement?g!==""&&(u.add(i),a(n,m,[])):u.remove(i))}}function E(t){var e=this;(t.type===h||t.type===o||t.type==="blur")&&t.target===e.input&&p(e,e.utilprops.prepop&&t.type===o)}function X(t){var e=this;t.target===e.input&&t.keyCode===9&&e.select(void 0,void 0,t)}function w(t){var e=this;clearTimeout(e.utilprops.timeoutID),e.utilprops.changed=!0,e.utilprops.selected=t.text}function U(t){return Object.keys(t).length===0&&t.constructor===Object}function P(t,e,n){var u=t.utilprops;return!u.listQuery||!u.loadall&&e.lastIndexOf(n,0)===0&&(e.lastIndexOf(u.listQuery,0)!==0||typeof u.limit=="number"&&t._list.length>=u.limit)}function q(t,e,n){t.list=e,t.utilprops.listQuery=n,a(t.input,o,n)}function N(t,e,n,u){var c;if(u||P(t,t.utilprops.val,n)){if(typeof e=="string"&&(e=JSON.parse(e)),t.utilprops.convertResponse&&(e=t.utilprops.convertResponse.call(t,e)),!Array.isArray(e)){if(t.utilprops.limit===0||t.utilprops.limit===1)e=U(e)?[]:[e];else for(c in e)if(Array.isArray(e[c])){e=e[c];break}}Array.isArray(e)&&q(t,e,n||t.utilprops.loadall)}return t}function M(){var t=this,e=t.awe,n=t.xhr,u=t.queryVal;n.status===200&&N(e,n.responseText,u,!1)}function D(t,e){var n=new XMLHttpRequest;t.utilprops.ajax.call(t,t.utilprops.url,t.utilprops.urlEnd,t.utilprops.loadall?"":e,M.bind({awe:t,xhr:n,queryVal:e}),n)}function F(t,e,n){t.utilprops.url&&P(t,e,e)?typeof n=="number"&&n>0?t.utilprops.timeoutID=setTimeout(D.bind(null,t,e),n):D(t,e):p(t,t.utilprops.prepop)}function W(t){var e=t.input,n=e.classList;n.remove(i),n.remove(v),a(e,m,[])}function H(t,e,n){return t.utilprops.prepop=n||!1,t.utilprops.val!==e&&(clearTimeout(t.utilprops.timeoutID),t.utilprops.selected=null,t.utilprops.changed=!0,t.utilprops.val=e,(e===""||e.length<t.minChars)&&W(t),e.length>=t.minChars&&F(t,e,t.utilprops.debounce)),t}function K(t){var e=this,n;t.target===e.input&&(n=e.utilprops.convertInput.call(e,e.input.value),H(e,n))}function S(t,e,n){return r.create("li",{innerHTML:t,role:"option","aria-selected":"false",tabindex:"-1",id:"awesomplete_list_"+this.count+"_item_"+n})}function k(t){return t.replace("&","&amp;").replace("<","&lt;").replace(">","&gt;")}function $(t){var e=this,n=e.sourceId,u=e.dataField,c=e.targetId,d,g;t.target===r(n)&&(typeof c=="function"?c(t,u):(d=r(c),d&&d!==document.activeElement&&(g=Array.isArray(t.detail)&&t.detail.length===1?t.detail[0]:null,g=(u&&g?g[u]:g)||"",typeof d.value!="undefined"?(d.value=g,d.classList&&d.classList.remove&&d.classList.remove(i)):typeof d.src!="undefined"?d.src=g:d.innerHTML=g)))}function B(t){var e=this,n,u;t.target===r(e.btnId)&&(t.preventDefault(),n=e.awe,n.ul.childNodes.length===0||n.ul.hasAttribute("hidden")?(u=n.minChars,n.minChars=0,n.evaluate(),n.minChars=u):n.close())}function T(t,e,n){var u=r.regExpEscape(k(e).trim()),c=u===""?null:n?RegExp("^"+u,"i"):RegExp("(?!<[^>]+?>)"+u+"(?![^<]*?>)","gi");return t.replace(c,"<mark>$&</mark>")}function j(t,e,n,u,c){var d=c.root,g=c.value,_=c.label||c.value,L=!0,C=[],y;if(u===0&&d&&n&&(n+".").lastIndexOf(d+".",0)!==0&&(d+".").lastIndexOf(n+".",0)!==0)return t;if(Object(e)!==e)n?t[n]=e:t=e;else if(Array.isArray(e)){for(y=0;y<e.length;y++)C.push(j({},e[y],"",u+1,c));n?t[n]=C:t=C}else{for(y in e)L=!1,j(t,e[y],n?n+"."+y:y,u,c);L&&n&&(t[n]={})}return u<2&&n&&(g&&(n+".").lastIndexOf(g+".",0)===0&&(t.value=t[n]),_&&(n+".").lastIndexOf(_+".",0)===0&&(t.label=t[n])),u===0&&(g&&!("value"in t)&&(t.value=null),_&&!("label"in t)&&(t.label=null)),t}function G(){var t=this,e=t.awe.input,n=t.boundMatch,u=t.boundOnInput,c=t.boundOnKeydown,d=t.boundSelect;e.removeEventListener(b,d),e.removeEventListener(o,n),e.removeEventListener(h,n),e.removeEventListener("blur",n),e.removeEventListener("input",u),e.removeEventListener("keydown",c)}return{ajax:function(t,e,n,u,c){var d=encodeURIComponent(n);return c=c||new XMLHttpRequest,c.open("GET",t+(typeof e=="function"?e(d):d+(e||""))),c.onload=u,c.send(),c},convertInput:function(t){return typeof t=="string"?t.trim().toLowerCase():""},item:S,load:q,mark:T,itemContains:function(t,e,n){var u;return e.trim()!==""&&(u=(""+t).split(/<p>/),u[0]=T(u[0],e),t=u.join("<p>")),S.call(this,t,e,n)},itemMarkAll:function(t,e,n){return S.call(this,e.trim()===""?""+t:T(""+t,e),e,n)},itemStartsWith:function(t,e,n){return S.call(this,e.trim()===""?""+t:T(""+t,e,!0),e,n)},itemWords:function(t,e,n){var u,c=e.split(/\s+/),d;if(e.trim()!==""){for(u=(""+t).split("<"),d=0;d<c.length;d++)u[0]=T(u[0],c[d]);t=u.join("<")}return S.call(this,t,e,n)},create:function(t,e,n){n.item=n.item||this.itemContains;var u=new Awesomplete(t,n);return u.utilprops=e||{},!u.utilprops.url&&typeof u.utilprops.loadall=="undefined"&&(u.utilprops.loadall=!0),u.utilprops.ajax=u.utilprops.ajax||this.ajax,u.utilprops.convertInput=u.utilprops.convertInput||this.convertInput,u},attach:function(t){var e=t.input,n=E.bind(t),u=X.bind(t),c=K.bind(t),d=w.bind(t),g=G.bind({awe:t,boundMatch:n,boundOnInput:c,boundOnKeydown:u,boundSelect:d}),_={keydown:u,input:c};return _.blur=_[h]=_[o]=n,_[b]=d,r.bind(e,_),t.utilprops.detach=g,t.utilprops.prepop&&(t.utilprops.loadall||e.value!=="")&&(t.utilprops.val=t.utilprops.convertInput.call(t,e.value),F(t,t.utilprops.val)),t},update:function(t,e,n){return t.input.value=e,H(t,e,n)},updateList:function(t,e,n,u){return N(t,e,n,u)},start:function(t,e,n){return this.attach(this.create(t,e,n))},detach:function(t){return clearTimeout(t.utilprops.timeoutID),t.utilprops.detach&&(t.utilprops.detach(),delete t.utilprops.detach),t},createCopyFun:function(t,e,n){return $.bind({sourceId:t,dataField:e,targetId:r(n)||n})},attachCopyFun:function(t,e,n){return e=typeof e=="boolean"?e:!0,n=n||document.body,n.addEventListener(m,t),e&&n.addEventListener(s,t),t},startCopy:function(t,e,n,u){var c=r(t);return this.attachCopyFun(this.createCopyFun(c||t,e,n),u,c)},detachCopyFun:function(t,e){return e=e||document.body,e.removeEventListener(s,t),e.removeEventListener(m,t),t},createClickFun:function(t,e){return B.bind({btnId:t,awe:e})},attachClickFun:function(t,e){return e=e||document.body,e.addEventListener("click",t),t},startClick:function(t,e){var n=r(t);return this.attachClickFun(this.createClickFun(n||t,e),n)},detachClickFun:function(t,e){return e=e||document.body,e.removeEventListener("click",t),t},filterContains:function(t,e){return Awesomplete.FILTER_CONTAINS(t.value,e)},filterStartsWith:function(t,e){return Awesomplete.FILTER_STARTSWITH(t.value,e)},filterOff:function(t,e){return!0},filterWords:function(t,e){var n=e.split(/\s+/),u=!0,c;for(t=" "+t,c=0;u&&c<n.length;c++)u=Awesomplete.FILTER_CONTAINS(t," "+n[c]);return u},jsonFlatten:function(t){return j({},t,"",0,this)}}}();typeof Y=="object"&&Y.exports&&(Y.exports=ut);typeof self!="undefined"&&(self.AwesompleteUtil=ut)});var Tt=st(lt()),Lt=st(ot());var R=AwesompleteUtil,O=(l,o,h)=>{if(o==null)return null;if(typeof l[o]!="function")throw new Error("Unknown "+h+" function "+o);return l[o]},mt=(l,o,h)=>{var m=null,s;return o&&(m=new RegExp("^.+["+o+"]\\s*|"),s=o[0],o[0]!==" "&&(s+=" ")),function(b){var v=h?b.value.substring(0,b.value.lastIndexOf("|")):b.value,i=m?this.input.value.match(m)[0]+v+s:v;l?l.call(this,i):this.input.value=i}},vt=(l,o,h,m)=>(l||(m?l=R.itemMarkAll:o?l=R.itemStartsWith:h&&(l=R.itemContains)),h?function(s,b,v){return l.call(this,s,b.match(h)[0],v)}:l),bt=(l,o,h,m,s)=>{if(!h&&!m)return l;let b=l,v=Awesomplete;if(o)if(s)b=function(i,r){return v.FILTER_STARTSWITH(i,r)||v.FILTER_STARTSWITH(i.substring(i.lastIndexOf("|")+1),r)};else{if(!h)return R.filterStartsWith;b=v.FILTER_STARTSWITH}else if(!l||l===R.filterContains||l===v.FILTER_CONTAINS){if(!h)return R.filterContains;b=v.FILTER_CONTAINS}return function(i,r){let f=h?r.match(h)[0]:r;return h&&this.minChars>1&&f.trimStart().length<this.minChars?!1:b.call(this,m?i.value:i,f)}},gt=(l,o,h,m,s)=>{let b=null;if(h||m)b=function(v,i){return{label:(v[h||o]||"").replace("<p>","<p >")+(m?"<p>"+(v[m]||""):""),value:(v[o]||"")+(s?"|"+(v[m]||"").replace("|"," "):"")}};else if(o)b=function(v,i){return v[o]||""};else return l;return l?function(v,i){return l.call(this,b(v,i),i)}:b},yt=(l,o)=>{if(!o)return l;let h=new RegExp("["+o+"]\\s*$"),m=new RegExp("[^"+o+"]*$");return function(s){var b=s.replace(h,"").match(m)[0].trim().toLowerCase();return l?l.call(this,b):b}},At=(l,o,h)=>{h=h||{},o=o||{};let m=l.getAttribute.bind(l),s=function(it){return m(it)||h[it]},b=s("ajax"),v=s("assign"),i=s("autoFirst"),r=s("combobox"),f=s("container"),a=s("convertInput"),p=s("convertResponse"),E=s("data"),X=s("debounce"),w=s("descr"),U=s("descrSearch"),P=s("item"),q=s("filter"),N=s("forField"),M=s("label"),D=s("limit"),F=s("list"),W=s("loadall"),H=s("listLabel"),K=s("maxItems"),S=s("minChars"),k=s("multiple"),$=s("prepop"),B=s("replace"),T=s("sort"),j=s("statusNoResults"),G=s("statusTypeXChar"),t=s("statusXResults"),e=s("value"),n=s("url"),u=s("urlEnd"),c=O(o,a,"convertInput"),d=O(o,E,"data"),g=O(o,q,"filter"),_=O(o,P,"item"),L=O(o,B,"replace"),C=g===Awesomplete.FILTER_STARTSWITH||g===R.filterStartsWith,y=U==="true"||U===!0;if(N===void 0)throw new Error("Missing forField attribute.");let I={},A={},x=null,Z=null,J=null;if(n&&(I.url=n),u&&(I.urlEnd=typeof o[u]=="function"?o[u]:u),W&&(I.loadall=W==="true"||W===!0),$&&(I.prepop=$==="true"||$===!0),X&&(I.debounce=Number(X)),D&&(I.limit=Number(D)),!e&&w)throw new Error("'descr' without 'value' parameter.");if(!e&&M)throw new Error("'label' without 'value' parameter.");if(y&&!w)throw new Error("Cannot search description texts without knowing the description field. Please supply descr parameter.");p&&(I.convertResponse=O(o,p,"convertResponse")),b&&(I.ajax=O(o,b,"ajax")),k&&k!=="false"&&(x=k==="true"||k===!0?" ":k,Z=r&&r!=="false"?"":"(["+x+"]\\s*)?",J=new RegExp("[^"+x+"]*"+Z+"$"));let V=yt(c,x),tt=bt(g,C,J,M||w,y),et=vt(_,C,J,y);V&&(I.convertInput=V),tt&&(A.filter=tt),et&&(A.item=et),S&&(A.minChars=Number(S)),K&&(A.maxItems=Number(K)),i&&(A.autoFirst=i==="true"||i===!0),f&&(A.container=O(o,f,"container")),(B||x||y)&&(A.replace=mt(L,x,y)),(e||E)&&(A.data=gt(d,e,M,w,y)),F&&(A.list=(typeof o[F]=="function"?o[F]():o[F])||F),H&&(A.listLabel=H),j&&(A.statusNoResults=j),t&&(A.statusXResults=t),G&&(A.statusTypeXChar=G),T==="false"||T===!1?A.sort=!1:T&&(A.sort=o[T]||T);let z=R.start("#"+N,I,A);return v&&v!=="false"&&(o[v==="true"||v===!0?"awe_"+N:v]=z),r&&r!=="false"&&R.startClick("#"+(r==="true"||r===!0?"awe_btn_"+N:r),z),z},Et=At;var _t=l=>{let o=l.getAttribute.bind(l),h=o("dataField"),m=o("field"),s=o("targetField"),b=o("target");if(m==null)throw new Error("Missing field attribute.");if(b==null&&s==null)throw new Error("Missing target or targetField attribute.");AwesompleteUtil.startCopy("#"+m,h,s?"#"+s:b)},It=_t;var export_Awesomplete=Tt.default;var export_AwesompleteUtil=Lt.default;export{export_Awesomplete as Awesomplete,export_AwesompleteUtil as AwesompleteUtil,Et as attachAwesomplete,It as copyValueToId};
//# sourceMappingURL=awesomplete_bundle.min.mjs.map