Files
aso/public/dashboard/assets/Autocomplete.b9878eda.js
2023-02-01 19:39:33 +07:00

2 lines
30 KiB
JavaScript

import{aM as Ro,r as x,N as no,aN as je,aK as Ao,z as c,Q as Lo,f as L,w as ho,v as $o,t as V,O as g,V as F,x as Io,y as yo,aO as To,M as fo,D as Q,j as Fe,E as Oo,bM as io,bN as Qe,bO as go,bP as Je,g as Po,bQ as ko,P as So,bR as Do,bS as No,bT as zo}from"./index.2830a4a3.js";function bo(e){return typeof e.normalize<"u"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function wo(e={}){const{ignoreAccents:t=!0,ignoreCase:p=!0,limit:i,matchFrom:m="any",stringify:O,trim:h=!1}=e;return(d,{inputValue:P,getOptionLabel:D})=>{let T=h?P.trim():P;p&&(T=T.toLowerCase()),t&&(T=bo(T));const H=T?d.filter(xe=>{let w=(O||D)(xe);return p&&(w=w.toLowerCase()),t&&(w=bo(w)),m==="start"?w.indexOf(T)===0:w.indexOf(T)>-1}):d;return typeof i=="number"?H.slice(0,i):H}}function so(e,t){for(let p=0;p<e.length;p+=1)if(t(e[p]))return p;return-1}const Mo=wo(),xo=5,Eo=e=>{var t;return e.current!==null&&((t=e.current.parentElement)==null?void 0:t.contains(document.activeElement))};function Fo(e){const{unstable_isActiveElementInListbox:t=Eo,unstable_classNamePrefix:p="Mui",autoComplete:i=!1,autoHighlight:m=!1,autoSelect:O=!1,blurOnSelect:h=!1,clearOnBlur:d=!e.freeSolo,clearOnEscape:P=!1,componentName:D="useAutocomplete",defaultValue:T=e.multiple?[]:null,disableClearable:H=!1,disableCloseOnSelect:xe=!1,disabled:w,disabledItemsFocusable:W=!1,disableListWrap:ve=!1,filterOptions:ke=Mo,filterSelectedOptions:me=!1,freeSolo:J=!1,getOptionDisabled:G,getOptionLabel:Se=a=>{var o;return(o=a.label)!=null?o:a},groupBy:ce,handleHomeEndKeys:Ce=!e.freeSolo,id:oe,includeInputInList:he=!1,inputValue:Ve,isOptionEqualToValue:X=(a,o)=>a===o,multiple:b=!1,onChange:te,onClose:ae,onHighlightChange:B,onInputChange:q,onOpen:pe,open:$e,openOnFocus:Re=!1,options:k,readOnly:le=!1,selectOnFocus:Xe=!e.freeSolo,value:Ye}=e,z=Ro(oe);let re=Se;re=a=>{const o=Se(a);return typeof o!="string"?String(o):o};const Ae=x.exports.useRef(!1),Le=x.exports.useRef(!0),R=x.exports.useRef(null),K=x.exports.useRef(null),[Te,Ze]=x.exports.useState(null),[M,Ie]=x.exports.useState(-1),He=m?0:-1,U=x.exports.useRef(He),[n,We]=no({controlled:Ye,default:T,name:D}),[v,ue]=no({controlled:Ve,default:"",name:D,state:"inputValue"}),[ne,Be]=x.exports.useState(!1),ye=x.exports.useCallback((a,o)=>{if(!(b?n.length<o.length:o!==null)&&!d)return;let r;if(b)r="";else if(o==null)r="";else{const C=re(o);r=typeof C=="string"?C:""}v!==r&&(ue(r),q&&q(a,r,"reset"))},[re,v,b,q,ue,d,n]),De=x.exports.useRef();x.exports.useEffect(()=>{const a=n!==De.current;De.current=n,!(ne&&!a)&&(J&&!a||ye(null,n))},[n,ye,ne,De,J]);const[de,Ke]=no({controlled:$e,default:!1,name:D,state:"open"}),[eo,Ue]=x.exports.useState(!0),_e=!b&&n!=null&&v===re(n),E=de&&!le,$=E?ke(k.filter(a=>!(me&&(b?n:[n]).some(o=>o!==null&&X(a,o)))),{inputValue:_e&&eo?"":v,getOptionLabel:re}):[],Ne=de&&$.length>0&&!le,Oe=je(a=>{a===-1?R.current.focus():Te.querySelector(`[data-tag-index="${a}"]`).focus()});x.exports.useEffect(()=>{b&&M>n.length-1&&(Ie(-1),Oe(-1))},[n,b,M,Oe]);function Pe(a,o){if(!K.current||a===-1)return-1;let l=a;for(;;){if(o==="next"&&l===$.length||o==="previous"&&l===-1)return-1;const r=K.current.querySelector(`[data-option-index="${l}"]`),C=W?!1:!r||r.disabled||r.getAttribute("aria-disabled")==="true";if(r&&!r.hasAttribute("tabindex")||C)l+=o==="next"?1:-1;else return l}}const ie=je(({event:a,index:o,reason:l="auto"})=>{if(U.current=o,o===-1?R.current.removeAttribute("aria-activedescendant"):R.current.setAttribute("aria-activedescendant",`${z}-option-${o}`),B&&B(a,o===-1?null:$[o],l),!K.current)return;const r=K.current.querySelector(`[role="option"].${p}-focused`);r&&(r.classList.remove(`${p}-focused`),r.classList.remove(`${p}-focusVisible`));const C=K.current.parentElement.querySelector('[role="listbox"]');if(!C)return;if(o===-1){C.scrollTop=0;return}const A=K.current.querySelector(`[data-option-index="${o}"]`);if(!!A&&(A.classList.add(`${p}-focused`),l==="keyboard"&&A.classList.add(`${p}-focusVisible`),C.scrollHeight>C.clientHeight&&l!=="mouse")){const y=A,ee=C.clientHeight+C.scrollTop,uo=y.offsetTop+y.offsetHeight;uo>ee?C.scrollTop=uo-C.clientHeight:y.offsetTop-y.offsetHeight*(ce?1.3:0)<C.scrollTop&&(C.scrollTop=y.offsetTop-y.offsetHeight*(ce?1.3:0))}}),j=je(({event:a,diff:o,direction:l="next",reason:r="auto"})=>{if(!E)return;const A=Pe((()=>{const y=$.length-1;if(o==="reset")return He;if(o==="start")return 0;if(o==="end")return y;const ee=U.current+o;return ee<0?ee===-1&&he?-1:ve&&U.current!==-1||Math.abs(o)>1?0:y:ee>y?ee===y+1&&he?-1:ve||Math.abs(o)>1?y:0:ee})(),l);if(ie({index:A,reason:r,event:a}),i&&o!=="reset")if(A===-1)R.current.value=v;else{const y=re($[A]);R.current.value=y,y.toLowerCase().indexOf(v.toLowerCase())===0&&v.length>0&&R.current.setSelectionRange(v.length,y.length)}}),fe=x.exports.useCallback(()=>{if(!E)return;const a=b?n[0]:n;if($.length===0||a==null){j({diff:"reset"});return}if(!!K.current){if(a!=null){const o=$[U.current];if(b&&o&&so(n,r=>X(o,r))!==-1)return;const l=so($,r=>X(r,a));l===-1?j({diff:"reset"}):ie({index:l});return}if(U.current>=$.length-1){ie({index:$.length-1});return}ie({index:U.current})}},[$.length,b?!1:n,me,j,ie,E,v,b]),oo=je(a=>{Ao(K,a),a&&fe()});x.exports.useEffect(()=>{fe()},[fe]);const se=a=>{de||(Ke(!0),Ue(!0),pe&&pe(a))},Y=(a,o)=>{!de||(Ke(!1),ae&&ae(a,o))},Z=(a,o,l,r)=>{if(b){if(n.length===o.length&&n.every((C,A)=>C===o[A]))return}else if(n===o)return;te&&te(a,o,l,r),We(o)},ge=x.exports.useRef(!1),I=(a,o,l="selectOption",r="options")=>{let C=l,A=o;if(b){A=Array.isArray(n)?n.slice():[];const y=so(A,ee=>X(o,ee));y===-1?A.push(o):r!=="freeSolo"&&(A.splice(y,1),C="removeOption")}ye(a,A),Z(a,A,C,{option:o}),!xe&&(!a||!a.ctrlKey&&!a.metaKey)&&Y(a,C),(h===!0||h==="touch"&&ge.current||h==="mouse"&&!ge.current)&&R.current.blur()};function S(a,o){if(a===-1)return-1;let l=a;for(;;){if(o==="next"&&l===n.length||o==="previous"&&l===-1)return-1;const r=Te.querySelector(`[data-tag-index="${l}"]`);if(!r||!r.hasAttribute("tabindex")||r.disabled||r.getAttribute("aria-disabled")==="true")l+=o==="next"?1:-1;else return l}}const _=(a,o)=>{if(!b)return;v===""&&Y(a,"toggleInput");let l=M;M===-1?v===""&&o==="previous"&&(l=n.length-1):(l+=o==="next"?1:-1,l<0&&(l=0),l===n.length&&(l=-1)),l=S(l,o),Ie(l),Oe(l)},to=a=>{Ae.current=!0,ue(""),q&&q(a,"","clear"),Z(a,b?[]:null,"clear")},ao=a=>o=>{if(a.onKeyDown&&a.onKeyDown(o),!o.defaultMuiPrevented&&(M!==-1&&["ArrowLeft","ArrowRight"].indexOf(o.key)===-1&&(Ie(-1),Oe(-1)),o.which!==229))switch(o.key){case"Home":E&&Ce&&(o.preventDefault(),j({diff:"start",direction:"next",reason:"keyboard",event:o}));break;case"End":E&&Ce&&(o.preventDefault(),j({diff:"end",direction:"previous",reason:"keyboard",event:o}));break;case"PageUp":o.preventDefault(),j({diff:-xo,direction:"previous",reason:"keyboard",event:o}),se(o);break;case"PageDown":o.preventDefault(),j({diff:xo,direction:"next",reason:"keyboard",event:o}),se(o);break;case"ArrowDown":o.preventDefault(),j({diff:1,direction:"next",reason:"keyboard",event:o}),se(o);break;case"ArrowUp":o.preventDefault(),j({diff:-1,direction:"previous",reason:"keyboard",event:o}),se(o);break;case"ArrowLeft":_(o,"previous");break;case"ArrowRight":_(o,"next");break;case"Enter":if(U.current!==-1&&E){const l=$[U.current],r=G?G(l):!1;if(o.preventDefault(),r)return;I(o,l,"selectOption"),i&&R.current.setSelectionRange(R.current.value.length,R.current.value.length)}else J&&v!==""&&_e===!1&&(b&&o.preventDefault(),I(o,v,"createOption","freeSolo"));break;case"Escape":E?(o.preventDefault(),o.stopPropagation(),Y(o,"escape")):P&&(v!==""||b&&n.length>0)&&(o.preventDefault(),o.stopPropagation(),to(o));break;case"Backspace":if(b&&!le&&v===""&&n.length>0){const l=M===-1?n.length-1:M,r=n.slice();r.splice(l,1),Z(o,r,"removeOption",{option:n[l]})}break;case"Delete":if(b&&!le&&v===""&&n.length>0&&M!==-1){const l=M,r=n.slice();r.splice(l,1),Z(o,r,"removeOption",{option:n[l]})}break}},co=a=>{Be(!0),Re&&!Ae.current&&se(a)},Ge=a=>{if(t(K)){R.current.focus();return}Be(!1),Le.current=!0,Ae.current=!1,O&&U.current!==-1&&E?I(a,$[U.current],"blur"):O&&J&&v!==""?I(a,v,"blur","freeSolo"):d&&ye(a,n),Y(a,"blur")},qe=a=>{const o=a.target.value;v!==o&&(ue(o),Ue(!1),q&&q(a,o,"input")),o===""?!H&&!b&&Z(a,null,"clear"):se(a)},ze=a=>{ie({event:a,index:Number(a.currentTarget.getAttribute("data-option-index")),reason:"mouse"})},we=()=>{ge.current=!0},Me=a=>{const o=Number(a.currentTarget.getAttribute("data-option-index"));I(a,$[o],"selectOption"),ge.current=!1},Ee=a=>o=>{const l=n.slice();l.splice(a,1),Z(o,l,"removeOption",{option:n[a]})},f=a=>{de?Y(a,"toggleInput"):se(a)},N=a=>{a.target.getAttribute("id")!==z&&a.preventDefault()},be=()=>{R.current.focus(),Xe&&Le.current&&R.current.selectionEnd-R.current.selectionStart===0&&R.current.select(),Le.current=!1},lo=a=>{(v===""||!de)&&f(a)};let ro=J&&v.length>0;ro=ro||(b?n.length>0:n!==null);let po=$;return ce&&(po=$.reduce((a,o,l)=>{const r=ce(o);return a.length>0&&a[a.length-1].group===r?a[a.length-1].options.push(o):a.push({key:l,index:l,group:r,options:[o]}),a},[])),w&&ne&&Ge(),{getRootProps:(a={})=>c({"aria-owns":Ne?`${z}-listbox`:null},a,{onKeyDown:ao(a),onMouseDown:N,onClick:be}),getInputLabelProps:()=>({id:`${z}-label`,htmlFor:z}),getInputProps:()=>({id:z,value:v,onBlur:Ge,onFocus:co,onChange:qe,onMouseDown:lo,"aria-activedescendant":E?"":null,"aria-autocomplete":i?"both":"list","aria-controls":Ne?`${z}-listbox`:void 0,"aria-expanded":Ne,autoComplete:"off",ref:R,autoCapitalize:"none",spellCheck:"false",role:"combobox"}),getClearProps:()=>({tabIndex:-1,onClick:to}),getPopupIndicatorProps:()=>({tabIndex:-1,onClick:f}),getTagProps:({index:a})=>c({key:a,"data-tag-index":a,tabIndex:-1},!le&&{onDelete:Ee(a)}),getListboxProps:()=>({role:"listbox",id:`${z}-listbox`,"aria-labelledby":`${z}-label`,ref:oo,onMouseDown:a=>{a.preventDefault()}}),getOptionProps:({index:a,option:o})=>{const l=(b?n:[n]).some(C=>C!=null&&X(o,C)),r=G?G(o):!1;return{key:re(o),tabIndex:-1,role:"option",id:`${z}-option-${a}`,onMouseOver:ze,onClick:Me,onTouchStart:we,"data-option-index":a,"aria-disabled":r,"aria-selected":l}},id:z,inputValue:v,value:n,dirty:ro,popupOpen:E,focused:ne||M!==-1,anchorEl:Te,setAnchorEl:Ze,focusedTag:M,groupedOptions:po}}const Vo=Lo(L("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function Ho(e){return $o("MuiChip",e)}const Wo=ho("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),u=Wo,Bo=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],Ko=e=>{const{classes:t,disabled:p,size:i,color:m,iconColor:O,onDelete:h,clickable:d,variant:P}=e,D={root:["root",P,p&&"disabled",`size${g(i)}`,`color${g(m)}`,d&&"clickable",d&&`clickableColor${g(m)}`,h&&"deletable",h&&`deletableColor${g(m)}`,`${P}${g(m)}`],label:["label",`label${g(i)}`],avatar:["avatar",`avatar${g(i)}`,`avatarColor${g(m)}`],icon:["icon",`icon${g(i)}`,`iconColor${g(O)}`],deleteIcon:["deleteIcon",`deleteIcon${g(i)}`,`deleteIconColor${g(m)}`,`deleteIcon${g(P)}Color${g(m)}`]};return Oo(D,Ho,t)},Uo=V("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:p}=e,{color:i,iconColor:m,clickable:O,onDelete:h,size:d,variant:P}=p;return[{[`& .${u.avatar}`]:t.avatar},{[`& .${u.avatar}`]:t[`avatar${g(d)}`]},{[`& .${u.avatar}`]:t[`avatarColor${g(i)}`]},{[`& .${u.icon}`]:t.icon},{[`& .${u.icon}`]:t[`icon${g(d)}`]},{[`& .${u.icon}`]:t[`iconColor${g(m)}`]},{[`& .${u.deleteIcon}`]:t.deleteIcon},{[`& .${u.deleteIcon}`]:t[`deleteIcon${g(d)}`]},{[`& .${u.deleteIcon}`]:t[`deleteIconColor${g(i)}`]},{[`& .${u.deleteIcon}`]:t[`deleteIcon${g(P)}Color${g(i)}`]},t.root,t[`size${g(d)}`],t[`color${g(i)}`],O&&t.clickable,O&&i!=="default"&&t[`clickableColor${g(i)})`],h&&t.deletable,h&&i!=="default"&&t[`deletableColor${g(i)}`],t[P],t[`${P}${g(i)}`]]}})(({theme:e,ownerState:t})=>{const p=F(e.palette.text.primary,.26),i=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return c({maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"default",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${u.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${u.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:i,fontSize:e.typography.pxToRem(12)},[`& .${u.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${u.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${u.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${u.icon}`]:c({marginLeft:5,marginRight:-6},t.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},t.iconColor===t.color&&c({color:e.vars?e.vars.palette.Chip.defaultIconColor:i},t.color!=="default"&&{color:"inherit"})),[`& .${u.deleteIcon}`]:c({WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:p,fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:F(p,.4)}},t.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},t.color!=="default"&&{color:e.vars?`rgba(${e.vars.palette[t.color].contrastTextChannel} / 0.7)`:F(e.palette[t.color].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].contrastText}})},t.size==="small"&&{height:24},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.onDelete&&{[`&.${u.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:F(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},t.onDelete&&t.color!=="default"&&{[`&.${u.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}})},({theme:e,ownerState:t})=>c({},t.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:F(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${u.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:F(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}},t.clickable&&t.color!=="default"&&{[`&:hover, &.${u.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}}),({theme:e,ownerState:t})=>c({},t.variant==="outlined"&&{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${u.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${u.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${u.avatar}`]:{marginLeft:4},[`& .${u.avatarSmall}`]:{marginLeft:2},[`& .${u.icon}`]:{marginLeft:4},[`& .${u.iconSmall}`]:{marginLeft:2},[`& .${u.deleteIcon}`]:{marginRight:5},[`& .${u.deleteIconSmall}`]:{marginRight:3}},t.variant==="outlined"&&t.color!=="default"&&{color:(e.vars||e).palette[t.color].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:F(e.palette[t.color].main,.7)}`,[`&.${u.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:F(e.palette[t.color].main,e.palette.action.hoverOpacity)},[`&.${u.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.focusOpacity})`:F(e.palette[t.color].main,e.palette.action.focusOpacity)},[`& .${u.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:F(e.palette[t.color].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].main}}})),_o=V("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:p}=e,{size:i}=p;return[t.label,t[`label${g(i)}`]]}})(({ownerState:e})=>c({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},e.size==="small"&&{paddingLeft:8,paddingRight:8}));function mo(e){return e.key==="Backspace"||e.key==="Delete"}const Go=x.exports.forwardRef(function(t,p){const i=Io({props:t,name:"MuiChip"}),{avatar:m,className:O,clickable:h,color:d="default",component:P,deleteIcon:D,disabled:T=!1,icon:H,label:xe,onClick:w,onDelete:W,onKeyDown:ve,onKeyUp:ke,size:me="medium",variant:J="filled",tabIndex:G,skipFocusWhenDisabled:Se=!1}=i,ce=yo(i,Bo),Ce=x.exports.useRef(null),oe=To(Ce,p),he=k=>{k.stopPropagation(),W&&W(k)},Ve=k=>{k.currentTarget===k.target&&mo(k)&&k.preventDefault(),ve&&ve(k)},X=k=>{k.currentTarget===k.target&&(W&&mo(k)?W(k):k.key==="Escape"&&Ce.current&&Ce.current.blur()),ke&&ke(k)},b=h!==!1&&w?!0:h,te=b||W?fo:P||"div",ae=c({},i,{component:te,disabled:T,size:me,color:d,iconColor:x.exports.isValidElement(H)&&H.props.color||d,onDelete:!!W,clickable:b,variant:J}),B=Ko(ae),q=te===fo?c({component:P||"div",focusVisibleClassName:B.focusVisible},W&&{disableRipple:!0}):{};let pe=null;W&&(pe=D&&x.exports.isValidElement(D)?x.exports.cloneElement(D,{className:Q(D.props.className,B.deleteIcon),onClick:he}):L(Vo,{className:Q(B.deleteIcon),onClick:he}));let $e=null;m&&x.exports.isValidElement(m)&&($e=x.exports.cloneElement(m,{className:Q(B.avatar,m.props.className)}));let Re=null;return H&&x.exports.isValidElement(H)&&(Re=x.exports.cloneElement(H,{className:Q(B.icon,H.props.className)})),Fe(Uo,c({as:te,className:Q(B.root,O),disabled:b&&T?!0:void 0,onClick:w,onKeyDown:Ve,onKeyUp:X,ref:oe,tabIndex:Se&&T?-1:G,ownerState:ae},q,ce,{children:[$e||Re,L(_o,{className:Q(B.label),ownerState:ae,children:xe}),pe]}))}),qo=Go;function jo(e){return $o("MuiAutocomplete",e)}const Qo=ho("MuiAutocomplete",["root","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]),s=Qo;var Co,vo;const Jo=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],Xo=e=>{const{classes:t,disablePortal:p,focused:i,fullWidth:m,hasClearIcon:O,hasPopupIcon:h,inputFocused:d,popupOpen:P,size:D}=e,T={root:["root",i&&"focused",m&&"fullWidth",O&&"hasClearIcon",h&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",d&&"inputFocused"],tag:["tag",`tagSize${g(D)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",P&&"popupIndicatorOpen"],popper:["popper",p&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Oo(T,jo,t)},Yo=V("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:p}=e,{fullWidth:i,hasClearIcon:m,hasPopupIcon:O,inputFocused:h,size:d}=p;return[{[`& .${s.tag}`]:t.tag},{[`& .${s.tag}`]:t[`tagSize${g(d)}`]},{[`& .${s.inputRoot}`]:t.inputRoot},{[`& .${s.input}`]:t.input},{[`& .${s.input}`]:h&&t.inputFocused},t.root,i&&t.fullWidth,O&&t.hasPopupIcon,m&&t.hasClearIcon]}})(({ownerState:e})=>c({[`&.${s.focused} .${s.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${s.clearIndicator}`]:{visibility:"visible"}}},e.fullWidth&&{width:"100%"},{[`& .${s.tag}`]:c({margin:3,maxWidth:"calc(100% - 6px)"},e.size==="small"&&{margin:2,maxWidth:"calc(100% - 4px)"}),[`& .${s.inputRoot}`]:{flexWrap:"wrap",[`.${s.hasPopupIcon}&, .${s.hasClearIcon}&`]:{paddingRight:26+4},[`.${s.hasPopupIcon}.${s.hasClearIcon}&`]:{paddingRight:52+4},[`& .${s.input}`]:{width:0,minWidth:30}},[`& .${io.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${io.root}.${Qe.sizeSmall}`]:{[`& .${io.input}`]:{padding:"2px 4px 3px 0"}},[`& .${go.root}`]:{padding:9,[`.${s.hasPopupIcon}&, .${s.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${s.hasPopupIcon}.${s.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${s.input}`]:{padding:"7.5px 4px 7.5px 6px"},[`& .${s.endAdornment}`]:{right:9}},[`& .${go.root}.${Qe.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${s.input}`]:{padding:"2.5px 4px 2.5px 6px"}},[`& .${Je.root}`]:{paddingTop:19,paddingLeft:8,[`.${s.hasPopupIcon}&, .${s.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${s.hasPopupIcon}.${s.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${Je.input}`]:{padding:"7px 4px"},[`& .${s.endAdornment}`]:{right:9}},[`& .${Je.root}.${Qe.sizeSmall}`]:{paddingBottom:1,[`& .${Je.input}`]:{padding:"2.5px 4px"}},[`& .${Qe.hiddenLabel}`]:{paddingTop:8},[`& .${s.input}`]:c({flexGrow:1,textOverflow:"ellipsis",opacity:0},e.inputFocused&&{opacity:1})})),Zo=V("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,t)=>t.endAdornment})({position:"absolute",right:0,top:"calc(50% - 14px)"}),et=V(Po,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,t)=>t.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),ot=V(Po,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:e},t)=>c({},t.popupIndicator,e.popupOpen&&t.popupIndicatorOpen)})(({ownerState:e})=>c({padding:2,marginRight:-2},e.popupOpen&&{transform:"rotate(180deg)"})),tt=V(ko,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:p}=e;return[{[`& .${s.option}`]:t.option},t.popper,p.disablePortal&&t.popperDisablePortal]}})(({theme:e,ownerState:t})=>c({zIndex:(e.vars||e).zIndex.modal},t.disablePortal&&{position:"absolute"})),at=V(So,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>c({},e.typography.body1,{overflow:"auto"})),lt=V("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,t)=>t.loading})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),rt=V("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,t)=>t.noOptions})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),nt=V("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${s.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${s.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${s.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:F(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${s.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:F(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${s.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:F(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}})),it=V(Do,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,t)=>t.groupLabel})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8})),st=V("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,t)=>t.groupUl})({padding:0,[`& .${s.option}`]:{paddingLeft:24}}),ct=x.exports.forwardRef(function(t,p){var i,m,O,h;const d=Io({props:t,name:"MuiAutocomplete"}),{autoComplete:P=!1,autoHighlight:D=!1,autoSelect:T=!1,blurOnSelect:H=!1,ChipProps:xe,className:w,clearIcon:W=Co||(Co=L(No,{fontSize:"small"})),clearOnBlur:ve=!d.freeSolo,clearOnEscape:ke=!1,clearText:me="Clear",closeText:J="Close",componentsProps:G={},defaultValue:Se=d.multiple?[]:null,disableClearable:ce=!1,disableCloseOnSelect:Ce=!1,disabled:oe=!1,disabledItemsFocusable:he=!1,disableListWrap:Ve=!1,disablePortal:X=!1,filterSelectedOptions:b=!1,forcePopupIcon:te="auto",freeSolo:ae=!1,fullWidth:B=!1,getLimitTagsText:q=f=>`+${f}`,getOptionLabel:pe=f=>{var N;return(N=f.label)!=null?N:f},groupBy:$e,handleHomeEndKeys:Re=!d.freeSolo,includeInputInList:k=!1,limitTags:le=-1,ListboxComponent:Xe="ul",ListboxProps:Ye,loading:z=!1,loadingText:re="Loading\u2026",multiple:Ae=!1,noOptionsText:Le="No options",openOnFocus:R=!1,openText:K="Open",PaperComponent:Te=So,PopperComponent:Ze=ko,popupIcon:M=vo||(vo=L(zo,{})),readOnly:Ie=!1,renderGroup:He,renderInput:U,renderOption:n,renderTags:We,selectOnFocus:v=!d.freeSolo,size:ue="medium",slotProps:ne={}}=d,Be=yo(d,Jo),{getRootProps:ye,getInputProps:De,getInputLabelProps:de,getPopupIndicatorProps:Ke,getClearProps:eo,getTagProps:Ue,getListboxProps:_e,getOptionProps:E,value:$,dirty:Ne,id:Oe,popupOpen:Pe,focused:ie,focusedTag:j,anchorEl:fe,setAnchorEl:oo,inputValue:se,groupedOptions:Y}=Fo(c({},d,{componentName:"Autocomplete"})),Z=!ce&&!oe&&Ne&&!Ie,ge=(!ae||te===!0)&&te!==!1,I=c({},d,{disablePortal:X,focused:ie,fullWidth:B,hasClearIcon:Z,hasPopupIcon:ge,inputFocused:j===-1,popupOpen:Pe,size:ue}),S=Xo(I);let _;if(Ae&&$.length>0){const f=N=>c({className:S.tag,disabled:oe},Ue(N));We?_=We($,f,I):_=$.map((N,be)=>L(qo,c({label:pe(N),size:ue},f({index:be}),xe)))}if(le>-1&&Array.isArray(_)){const f=_.length-le;!ie&&f>0&&(_=_.splice(0,le),_.push(L("span",{className:S.tag,children:q(f)},_.length)))}const ao=He||(f=>Fe("li",{children:[L(it,{className:S.groupLabel,ownerState:I,component:"div",children:f.group}),L(st,{className:S.groupUl,ownerState:I,children:f.children})]},f.key)),Ge=n||((f,N)=>L("li",c({},f,{children:pe(N)}))),qe=(f,N)=>{const be=E({option:f,index:N});return Ge(c({},be,{className:S.option}),f,{selected:be["aria-selected"],index:N,inputValue:se})},ze=(i=ne.clearIndicator)!=null?i:G.clearIndicator,we=(m=ne.paper)!=null?m:G.paper,Me=(O=ne.popper)!=null?O:G.popper,Ee=(h=ne.popupIndicator)!=null?h:G.popupIndicator;return Fe(x.exports.Fragment,{children:[L(Yo,c({ref:p,className:Q(S.root,w),ownerState:I},ye(Be),{children:U({id:Oe,disabled:oe,fullWidth:!0,size:ue==="small"?"small":void 0,InputLabelProps:de(),InputProps:c({ref:oo,className:S.inputRoot,startAdornment:_},(Z||ge)&&{endAdornment:Fe(Zo,{className:S.endAdornment,ownerState:I,children:[Z?L(et,c({},eo(),{"aria-label":me,title:me,ownerState:I},ze,{className:Q(S.clearIndicator,ze==null?void 0:ze.className),children:W})):null,ge?L(ot,c({},Ke(),{disabled:oe,"aria-label":Pe?J:K,title:Pe?J:K,ownerState:I},Ee,{className:Q(S.popupIndicator,Ee==null?void 0:Ee.className),children:M})):null]})}),inputProps:c({className:S.input,disabled:oe,readOnly:Ie},De())})})),fe?L(tt,c({as:Ze,disablePortal:X,style:{width:fe?fe.clientWidth:null},ownerState:I,role:"presentation",anchorEl:fe,open:Pe},Me,{className:Q(S.popper,Me==null?void 0:Me.className),children:Fe(at,c({ownerState:I,as:Te},we,{className:Q(S.paper,we==null?void 0:we.className),children:[z&&Y.length===0?L(lt,{className:S.loading,ownerState:I,children:re}):null,Y.length===0&&!ae&&!z?L(rt,{className:S.noOptions,ownerState:I,role:"presentation",onMouseDown:f=>{f.preventDefault()},children:Le}):null,Y.length>0?L(nt,c({as:Xe,className:S.listbox,ownerState:I},_e(),Ye,{children:Y.map((f,N)=>$e?ao({key:f.key,group:f.group,children:f.options.map((be,lo)=>qe(be,f.index+lo))}):qe(f,N))})):null]}))})):null]})}),ut=ct;export{ut as A};