(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[898],{29655:(e,t,n)=>{"use strict";functionr(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}functiona(e,t,n){returntine?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}functioni(e,t){varn=Object.keys(e);if(Object.getOwnPropertySymbols){varr=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){returnObject.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}returnn}functiono(e){for(vart=1;t<arguments.length;t++){varn=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}returne}n.r(t),n.d(t,{default:()=>g});vars=function(e,t){returne.matches?e.matches(t):e.msMatchesSelector?e.msMatchesSelector(t):e.webkitMatchesSelector?e.webkitMatchesSelector(t):null},l=function(e,t){returne.closest?e.closest(t):function(e,t){for(varn=e;n&&1===n.nodeType;){if(s(n,t))returnn;n=n.parentNode}returnnull}(e,t)},c=function(e){returnBoolean(e&&"function"==typeofe.then)},u=functione(){vart=this,n=arguments.length>0&&void0!==arguments[0]?arguments[0]:{},i=n.search,o=n.autoSelect,s=void0!==o&&o,u=n.setValue,d=void0===u?function(){}:u,h=n.setAttribute,f=void0===h?function(){}:h,p=n.onUpdate,m=void0===p?function(){}:p,v=n.onSubmit,g=void0===v?function(){}:v,_=n.onShow,y=void0===_?function(){}:_,b=n.onHide,I=void0===b?function(){}:b,T=n.onLoading,M=void0===T?function(){}:T,k=n.onLoaded,E=void0===k?function(){}:k;r(this,e),a(this,"value",""),a(this,"searchCounter",0),a(this,"results",[]),a(this,"selectedIndex",-1),a(this,"handleInput",(function(e){varn=e.target.value;t.updateResults(n),t.value=n})),a(this,"handleKeyDown",(function(e){varn=e.key;switch(n){case"Up":case"Down":case"ArrowUp":case"ArrowDown":varr="ArrowUp"===n||"Up"===n?t.selectedIndex-1:t.selectedIndex+1;e.preventDefault(),t.handleArrows(r);break;case"Tab":t.selectResult();break;case"Enter":vara=t.results[t.selectedIndex];t.selectResult(),t.onSubmit(a);break;case"Esc":case"Escape":t.hideResults(),t.setValue();break;default:return}})),a(this,"handleFocus",(function(e){varn=e.target.value;t.updateResults(n),t.value=n})),a(this,"handleBlur",(function(){t.hideResults()})),a(this,"handleResultMouseDown",(function(e){e.preventDefault()})),a(this,"handleResultClick",(function(e){varn=e.target,r=l(n,"[data-result-index]");if(r){t.selectedIndex=parseInt(r.dataset.resultIndex,10);vara=t.results[t.selectedIndex];t.selectResult(),t.onSubmit(a)}})),a(this,"handleArrows",(function(e){varn=t.results.length;t.selectedIndex=(e%n+n)%n,t.onUpdate(t.results,t.selectedIndex)})),a(this,"selectResult",(function(){vare=t.results[t.selectedIndex];e&&t.setValue(e),t.hideResults()})),a(this,"updateResults",(function(e){varn=++t.searchCounter;t.onLoading(),t.search(e).then((function(e){n===t.searchCounter&&(t.results=e,t.onLoaded(),0!==t.results.length?(t.selectedIndex=t.autoSelect?0:-1,t.onUpdate(t.results,t.selectedIndex),t.showResults()):t.hideResults())}))})),a(this,"showResults",(function(){t.setAttribute("aria-expanded",!0),t.onShow()})),a(this,"hideResults",(function(){t.selectedIndex=-1,t.results=[],t.setAttribute("aria-expanded",!1),t.setAttribute("aria-activedescendant",""),t.onUpdate(t.results,t.selectedIndex),t.onHide()})),a(this,"checkSelectedResultVisible",(function(e){varn=e.querySelector('[data-result-index="'.concat(t.selectedIndex,'"]'));if(n){varr=e.getBoundingClientRect(),a=n.getBoundingClientRect();a.top<r.top?e.scrollTop-=r.top-a.top:a.bottom>r.bottom&&(e.scrollTop+=a.bottom-r.bottom)}})),this.search=c(i)?i:function(e){returnPromise.resolve(i(e))},this.autoSelect=s,this.setValue=d,this.setAttribute=f,this.onUpdate=m,this.onSubmit=g,this.onShow=y,this.onHide=I,this.onLoading=M,this.onLoaded=E},d=0,h=function(){vare=arguments.length>0&&void0!==arguments[0]?argum