{"version":3,"file":"chunk-jQueryAutocompleteHelpers-cbb0a3ab-esm.js","sources":["src/util/jQueryAutocompleteHelpers.ts"],"sourcesContent":["export const changeAutocompleteSource = (autocompleteElement: JQuery, source: string[], headerText?: string): void => {\n autocompleteElement.autocomplete({ source });\n autocompleteElement.data('ui-autocomplete')._renderMenu = function (ul: JQuery, items: string[]) {\n items.forEach((item, index) => {\n this._renderItemData(ul, item);\n if (headerText && index === 0) ul.prepend(`
  • ${headerText}
  • `);\n });\n };\n};\n\nexport const toggleAutocompleteValuesBasedOnInput = (\n autocompleteElement: JQuery,\n fullSource: string[],\n defaultSource: string[],\n defaultSearchHeader?: string\n): void => {\n if (autocompleteElement.val()) {\n changeAutocompleteSource(autocompleteElement, fullSource);\n } else {\n changeAutocompleteSource(autocompleteElement, defaultSource, defaultSearchHeader);\n }\n};\n"],"names":["changeAutocompleteSource","autocompleteElement","source","headerText","autocomplete","data","_renderMenu","ul","items","forEach","item","index","_renderItemData","prepend","toggleAutocompleteValuesBasedOnInput","fullSource","defaultSource","defaultSearchHeader","val"],"mappings":"AAAO,MAAMA,wBAAwB,GAAGA,CAACC,mBAA2B,EAAEC,MAAgB,EAAEC,UAAmB,KAAW;EACpHF,mBAAmB,CAACG,YAAY,CAAC;IAAEF;GAAQ,CAAC;EAC5CD,mBAAmB,CAACI,IAAI,CAAC,iBAAiB,CAAC,CAACC,WAAW,GAAG,UAAUC,EAAU,EAAEC,KAAe,EAAE;IAC/FA,KAAK,CAACC,OAAO,CAAC,CAACC,IAAI,EAAEC,KAAK,KAAK;MAC7B,IAAI,CAACC,eAAe,CAACL,EAAE,EAAEG,IAAI,CAAC;MAC9B,IAAIP,UAAU,IAAIQ,KAAK,KAAK,CAAC,EAAEJ,EAAE,CAACM,OAAO,CAAE,2CAA0CV,UAAW,OAAM,CAAC;KACxG,CAAC;GACH;CACF;AAED,MAAaW,oCAAoC,GAAGA,CAClDb,mBAA2B,EAC3Bc,UAAoB,EACpBC,aAAuB,EACvBC,mBAA4B,KACnB;EACT,IAAIhB,mBAAmB,CAACiB,GAAG,EAAE,EAAE;IAC7BlB,wBAAwB,CAACC,mBAAmB,EAAEc,UAAU,CAAC;GAC1D,MAAM;IACLf,wBAAwB,CAACC,mBAAmB,EAAEe,aAAa,EAAEC,mBAAmB,CAAC;;CAEpF;;;;"}