Local modifications to ClusterLabs/Anvil by Alteeve
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
58 KiB

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[74],{93362:function(e,t,o){o.d(t,{D:function(){return u},o:function(){return g}});var n=o(87462),r=o(67294),a=o(92996),i=o(19032),l=o(2097),c=o(59948),s=o(7960);function p(e){return void 0!==e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function u(e={}){let{ignoreAccents:t=!0,ignoreCase:o=!0,limit:n,matchFrom:r="any",stringify:a,trim:i=!1}=e;return(e,{inputValue:l,getOptionLabel:c})=>{let s=i?l.trim():l;o&&(s=s.toLowerCase()),t&&(s=p(s));let u=s?e.filter(e=>{let n=(a||c)(e);return o&&(n=n.toLowerCase()),t&&(n=p(n)),"start"===r?0===n.indexOf(s):n.indexOf(s)>-1}):e;return"number"==typeof n?u.slice(0,n):u}}function d(e,t){for(let o=0;o<e.length;o+=1)if(t(e[o]))return o;return -1}let f=u(),m=e=>{var t;return null!==e.current&&(null==(t=e.current.parentElement)?void 0:t.contains(document.activeElement))};function g(e){let{unstable_isActiveElementInListbox:t=m,unstable_classNamePrefix:o="Mui",autoComplete:p=!1,autoHighlight:u=!1,autoSelect:g=!1,blurOnSelect:h=!1,clearOnBlur:v=!e.freeSolo,clearOnEscape:b=!1,componentName:y="useAutocomplete",defaultValue:x=e.multiple?[]:null,disableClearable:Z=!1,disableCloseOnSelect:w=!1,disabled:O,disabledItemsFocusable:C=!1,disableListWrap:k=!1,filterOptions:S=f,filterSelectedOptions:P=!1,freeSolo:I=!1,getOptionDisabled:R,getOptionKey:L,getOptionLabel:A=e=>{var t;return null!=(t=e.label)?t:e},groupBy:D,handleHomeEndKeys:E=!e.freeSolo,id:M,includeInputInList:T=!1,inputValue:j,isOptionEqualToValue:N=(e,t)=>e===t,multiple:z=!1,onChange:W,onClose:F,onHighlightChange:H,onInputChange:V,onOpen:q,open:B,openOnFocus:$=!1,options:U,readOnly:K=!1,selectOnFocus:G=!e.freeSolo,value:_}=e,X=(0,a.Z)(M),Y=A;Y=e=>{let t=A(e);return"string"!=typeof t?String(t):t};let J=r.useRef(!1),Q=r.useRef(!0),ee=r.useRef(null),et=r.useRef(null),[eo,en]=r.useState(null),[er,ea]=r.useState(-1),ei=u?0:-1,el=r.useRef(ei),[ec,es]=(0,i.Z)({controlled:_,default:x,name:y}),[ep,eu]=(0,i.Z)({controlled:j,default:"",name:y,state:"inputValue"}),[ed,ef]=r.useState(!1),em=r.useCallback((e,t)=>{let o;if((z?ec.length<t.length:null!==t)||v){if(z)o="";else if(null==t)o="";else{let e=Y(t);o="string"==typeof e?e:""}ep!==o&&(eu(o),V&&V(e,o,"reset"))}},[Y,ep,z,V,eu,v,ec]),[eg,eh]=(0,i.Z)({controlled:B,default:!1,name:y,state:"open"}),[ev,eb]=r.useState(!0),ey=!z&&null!=ec&&ep===Y(ec),ex=eg&&!K,eZ=ex?S(U.filter(e=>!(P&&(z?ec:[ec]).some(t=>null!==t&&N(e,t)))),{inputValue:ey&&ev?"":ep,getOptionLabel:Y}):[],ew=(0,l.Z)({filteredOptions:eZ,value:ec,inputValue:ep});r.useEffect(()=>{let e=ec!==ew.value;(!ed||e)&&(!I||e)&&em(null,ec)},[ec,em,ed,ew.value,I]);let eO=eg&&eZ.length>0&&!K,eC=(0,c.Z)(e=>{-1===e?ee.current.focus():eo.querySelector(`[data-tag-index="${e}"]`).focus()});r.useEffect(()=>{z&&er>ec.length-1&&(ea(-1),eC(-1))},[ec,z,er,eC]);let ek=(0,c.Z)(({event:e,index:t,reason:n="auto"})=>{if(el.current=t,-1===t?ee.current.removeAttribute("aria-activedescendant"):ee.current.setAttribute("aria-activedescendant",`${X}-option-${t}`),H&&H(e,-1===t?null:eZ[t],n),!et.current)return;let r=et.current.querySelector(`[role="option"].${o}-focused`);r&&(r.classList.remove(`${o}-focused`),r.classList.remove(`${o}-focusVisible`));let a=et.current;if("listbox"!==et.current.getAttribute("role")&&(a=et.current.parentElement.querySelector('[role="listbox"]')),!a)return;if(-1===t){a.scrollTop=0;return}let i=et.current.querySelector(`[data-option-index="${t}"]`);if(i&&(i.classList.add(`${o}-focused`),"keyboard"===n&&i.classList.add(`${o}-focusVisible`),a.scrollHeight>a.clientHeight&&"mouse"!==n&&"touch"!==n)){let e=a.clientHeight+a.scrollTop,t=i.offsetTop+i.offsetHeight;t>e?a.scrollTop=t-a.clientHeight:i.offsetTop-i.offsetHeight*(D?1.3:0)<a.scrollTop&&(a.scrollTop=i.offsetTop-i.offsetHeight*(D?1.3:0))}}),eS=(0,c.Z)(({event:e,diff:t,direction:o="next",reason:n="auto"})=>{if(!ex)return;let r=function(e,t){if(!et.current||e<0||e>=eZ.length)return -1;let o=e;for(;;){let n=et.current.querySelector(`[data-option-index="${o}"]`),r=!C&&(!n||n.disabled||"true"===n.getAttribute("aria-disable